=== added directory '.pc' === added file '.pc/.version' --- .pc/.version 1970-01-01 00:00:00 +0000 +++ .pc/.version 2010-07-21 23:21:17 +0000 @@ -0,0 +1,1 @@ +2 === added directory '.pc/01_build_system.diff' === added directory '.pc/01_build_system.diff/qtiplot' === added file '.pc/01_build_system.diff/qtiplot.pro' --- .pc/01_build_system.diff/qtiplot.pro 1970-01-01 00:00:00 +0000 +++ .pc/01_build_system.diff/qtiplot.pro 2010-07-21 23:36:12 +0000 @@ -0,0 +1,7 @@ +TEMPLATE = subdirs + +SUBDIRS = fitPlugins \ + manual \ + 3rdparty/qwt \ + 3rdparty/qwtplot3d \ + qtiplot === added file '.pc/01_build_system.diff/qtiplot/qtiplot.pro' --- .pc/01_build_system.diff/qtiplot/qtiplot.pro 1970-01-01 00:00:00 +0000 +++ .pc/01_build_system.diff/qtiplot/qtiplot.pro 2010-07-21 23:36:12 +0000 @@ -0,0 +1,241 @@ +TARGET = qtiplot +QTI_ROOT = .. +!include( $$QTI_ROOT/build.conf ) { + message( "You need a build.conf file with local settings!" ) +} + +##################### 3rd PARTY HEADER FILES SECTION ######################## +#!!! Warning: You must set this up in $$QTIROOT/build.conf +############################################################################# + +# local copy included +INCLUDEPATH += ../3rdparty/zlib +INCLUDEPATH += ../3rdparty/QTeXEngine/src + +# configurable +INCLUDEPATH += $$MUPARSER_INCLUDEPATH +INCLUDEPATH += $$QWT_INCLUDEPATH +INCLUDEPATH += $$QWT3D_INCLUDEPATH +INCLUDEPATH += $$GSL_INCLUDEPATH + +# configurable libs +LIBS += $$MUPARSER_LIBS +LIBS += $$QWT_LIBS +LIBS += $$QWT3D_LIBS +LIBS += $$GSL_LIBS + +############################################################################# +###################### BASIC PROJECT PROPERTIES ############################# +############################################################################# + +QMAKE_PROJECT_DEPTH = 0 + +!contains(CONFIG, BrowserPlugin){ + TEMPLATE = app +} + +CONFIG += qt warn_on exceptions opengl thread +CONFIG += assistant + +DEFINES += QT_PLUGIN +contains(CONFIG, CustomInstall){ + INSTALLS += target + INSTALLS += translations + INSTALLS += manual + INSTALLS += documentation + unix:INSTALLS += man + + unix: INSTALLBASE = /usr + win32: INSTALLBASE = C:/QtiPlot + + unix: target.path = $$INSTALLBASE/bin + unix: translations.path = $$INSTALLBASE/share/qtiplot/translations + unix: manual.path = $$INSTALLBASE/share/doc/qtiplot/manual + unix: documentation.path = $$INSTALLBASE/share/doc/qtiplot + unix: man.path = $$INSTALLBASE/share/man/man1/ + + win32: target.path = $$INSTALLBASE + win32: translations.path = $$INSTALLBASE/translations + win32: manual.path = $$INSTALLBASE/manual + win32: documentation.path = $$INSTALLBASE/doc + + DEFINES += TRANSLATIONS_PATH="\\\"$$replace(translations.path," ","\ ")\\\" + DEFINES += MANUAL_PATH="\\\"$$replace(manual.path," ","\ ")\\\" + } + +win32:DEFINES += QT_DLL QT_THREAD_SUPPORT +QT += opengl qt3support network svg xml + +MOC_DIR = ../tmp/qtiplot +OBJECTS_DIR = ../tmp/qtiplot +SIP_DIR = ../tmp/qtiplot +DESTDIR = ./ + +############################################################################# +###################### PROJECT FILES SECTION ################################ +############################################################################# + +###################### ICONS ################################################ +INCLUDEPATH += icons/ +win32:RC_FILE = icons/qtiplot.rc +mac:RC_FILE = icons/qtiplot.icns +RESOURCES = ../manual/html/icons/icons.qrc + +###################### TRANSLATIONS ######################################### + +TRANSLATIONS = translations/qtiplot_cn.ts \ + translations/qtiplot_cz.ts \ + translations/qtiplot_de.ts \ + translations/qtiplot_es.ts \ + translations/qtiplot_fr.ts \ + #translations/qtiplot_pt.ts \ + translations/qtiplot_ro.ts \ + translations/qtiplot_ru.ts \ + translations/qtiplot_ja.ts \ + translations/qtiplot_sv.ts + +translations.files += translations/qtiplot_cn.qm \ + translations/qtiplot_cz.qm \ + translations/qtiplot_de.qm \ + translations/qtiplot_es.qm \ + translations/qtiplot_fr.qm \ + #translations/qtiplot_pt.qm \ + translations/qtiplot_ro.qm \ + translations/qtiplot_ru.qm \ + translations/qtiplot_ja.qm \ + translations/qtiplot_sv.qm + +isEmpty(LUPDATE): LUPDATE = lupdate +#system($$LUPDATE -verbose qtiplot.pro) +isEmpty(LRELEASE): LRELEASE = lrelease +#system($$LRELEASE -verbose qtiplot.pro) + +###################### DOCUMENTATION ######################################## + +manual.files += ../manual/html \ + ../manual/qtiplot-manual-en.pdf + +documentation.files += ../README.html \ + ../gpl_licence.txt + +unix: man.files += ../qtiplot.1 + +############################################################### +##################### Compression (zlib-1.2.3) ################ +############################################################### + +SOURCES += ../3rdparty/zlib/minigzip.c + +############################################################### +################# Default Modules ############################# +############################################################### + +include(src/analysis/analysis.pri) +include(src/core/core.pri) +include(src/lib/libqti.pri) +include(src/plot2D/plot2D.pri) +include(src/plot3D/plot3D.pri) +include(src/matrix/matrix.pri) +include(src/table/table.pri) +include(src/scripting/scripting.pri) + +############################################################### +##################### TeX export: QTeXEngine ################## +############################################################### + +INCLUDEPATH += ../3rdparty/QTeXEngine/src +HEADERS += ../3rdparty/QTeXEngine/src/QTeXEngine.h +SOURCES += ../3rdparty/QTeXEngine/src/QTeXPaintEngine.cpp +SOURCES += ../3rdparty/QTeXEngine/src/QTeXPaintDevice.cpp + +############################################################### +##################### Scripting: PYTHON + SIP + PyQT ########## +############################################################### + +contains(SCRIPTING_LANGS, Python) { + contains(CONFIG, CustomInstall){ + INSTALLS += pythonconfig + pythonconfig.files += qtiplotrc.py \ + qtiUtil.py \ + qti_wordlist.txt \ + + unix: pythonconfig.path = /usr/local/qtiplot + win32: pythonconfig.path = $$INSTALLBASE + DEFINES += PYTHON_CONFIG_PATH="\\\"$$replace(pythonconfig.path," ","\ ")\\\" + } + + unix { + isEmpty(PYTHON): PYTHON = python + INCLUDEPATH += $$system($$PYTHON python-includepath.py) + LIBS += $$system($$PYTHON -c "\"from distutils import sysconfig; print '-lpython'+sysconfig.get_config_var('VERSION')\"") + LIBS += -lm + system(mkdir -p $${SIP_DIR}) + system($$system($$PYTHON python-sipcmd.py) -c $${SIP_DIR} src/scripting/qti.sip) + } + + win32 { + INCLUDEPATH += $$system(call python-includepath.py) + LIBS += $$system(call python-libs-win.py) + system($$system(call python-sipcmd.py) -c $${SIP_DIR} src/scripting/qti.sip) + } +} + +############################################################### + +# check if we have libpng +!isEmpty(LIBPNG_LIBS) { + DEFINES += GL2PS_HAVE_LIBPNG + INCLUDEPATH += $$LIBPNG_INCLUDEPATH + LIBS += $$LIBPNG_LIBS +} + +############################################################### + +# check if we have EmfEnginge +!isEmpty(EMF_ENGINE_LIBS) { + DEFINES += EMF_OUTPUT + INCLUDEPATH += $$EMF_ENGINE_INCLUDEPATH + LIBS += $$EMF_ENGINE_LIBS + win32:LIBS += -lgdiplus + unix:LIBS += -lEMF +} + +# check if we have libxls +!isEmpty(XLS_LIBS) { + DEFINES += XLS_IMPORT + INCLUDEPATH += $$XLS_INCLUDEPATH + LIBS += $$XLS_LIBS +} + +# check if we have QuaZIP +!isEmpty(QUAZIP_LIBS) { + DEFINES += ODS_IMPORT + INCLUDEPATH += $$QUAZIP_INCLUDEPATH + LIBS += $$QUAZIP_LIBS +} + +# check if we have liborigin2 +!isEmpty(BOOST_LIBS) { + DEFINES += OPJ_IMPORT + INCLUDEPATH += $$BOOST_INCLUDEPATH + INCLUDEPATH += ../3rdparty/liborigin + LIBS += $$BOOST_LIBS + include(src/origin/origin.pri) +} + +############################################################### + +# At the very end: add global include- and lib path +unix:INCLUDEPATH += $$SYS_INCLUDEPATH +unix:LIBS += $$SYS_LIBS + +############################################################### +############### Building QtiPlot as a browser plugin ########## +############################################################### + +contains(CONFIG, BrowserPlugin){ + DEFINES += BROWSER_PLUGIN + win32: CONFIG += qaxserver + RC_FILE = qtiplot.rc + include(../3rdparty/QtSolutions/qtbrowserplugin/src/qtbrowserplugin.pri) +} === added directory '.pc/01_build_system.diff/qtiplot/src' === added directory '.pc/01_build_system.diff/qtiplot/src/origin' === added file '.pc/01_build_system.diff/qtiplot/src/origin/origin.pri' --- .pc/01_build_system.diff/qtiplot/src/origin/origin.pri 1970-01-01 00:00:00 +0000 +++ .pc/01_build_system.diff/qtiplot/src/origin/origin.pri 2010-07-21 23:36:12 +0000 @@ -0,0 +1,27 @@ +############################################################### +################# Origin Import (liborigin) ################### +############################################################### +INCLUDEPATH += src/origin/ + +HEADERS += src/origin/importOPJ.h +HEADERS += ../3rdparty/liborigin/OriginObj.h +HEADERS += ../3rdparty/liborigin/OriginFile.h +HEADERS += ../3rdparty/liborigin/OriginParser.h +HEADERS += ../3rdparty/liborigin/OriginDefaultParser.h +HEADERS += ../3rdparty/liborigin/Origin600Parser.h +HEADERS += ../3rdparty/liborigin/Origin610Parser.h +HEADERS += ../3rdparty/liborigin/Origin700Parser.h +HEADERS += ../3rdparty/liborigin/Origin750Parser.h +HEADERS += ../3rdparty/liborigin/Origin800Parser.h +HEADERS += ../3rdparty/liborigin/Origin810Parser.h + +SOURCES += src/origin/importOPJ.cpp +SOURCES += ../3rdparty/liborigin/OriginFile.cpp +SOURCES += ../3rdparty/liborigin/OriginParser.cpp +SOURCES += ../3rdparty/liborigin/OriginDefaultParser.cpp +SOURCES += ../3rdparty/liborigin/Origin600Parser.cpp +SOURCES += ../3rdparty/liborigin/Origin610Parser.cpp +SOURCES += ../3rdparty/liborigin/Origin700Parser.cpp +SOURCES += ../3rdparty/liborigin/Origin750Parser.cpp +SOURCES += ../3rdparty/liborigin/Origin800Parser.cpp +SOURCES += ../3rdparty/liborigin/Origin810Parser.cpp === added directory '.pc/02_fix_paths.diff' === added directory '.pc/02_fix_paths.diff/qtiplot' === added directory '.pc/02_fix_paths.diff/qtiplot/src' === added directory '.pc/02_fix_paths.diff/qtiplot/src/core' === added file '.pc/02_fix_paths.diff/qtiplot/src/core/ApplicationWindow.cpp' --- .pc/02_fix_paths.diff/qtiplot/src/core/ApplicationWindow.cpp 1970-01-01 00:00:00 +0000 +++ .pc/02_fix_paths.diff/qtiplot/src/core/ApplicationWindow.cpp 2010-07-21 23:36:11 +0000 @@ -0,0 +1,18381 @@ +/*************************************************************************** + File : ApplicationWindow.cpp + Project : QtiPlot +-------------------------------------------------------------------- + Copyright : (C) 2004 - 2010 by Ion Vasilief, + (C) 2006 - June 2007 Tilman Hoener zu Siederdissen, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : QtiPlot's main window + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "globals.h" +#include "ApplicationWindow.h" +#include + +#include "PlotWizard.h" +#include "ConfigDialog.h" +#include "RenameWindowDialog.h" +#include "ImportASCIIDialog.h" +#include "Folder.h" +#include "FindDialog.h" +#include "OpenProjectDialog.h" +#include "CustomActionDialog.h" +#include "MdiSubWindow.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// TODO: move tool-specific code to an extension manager +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +using namespace std; + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#ifdef XLS_IMPORT +extern "C" { + #include +} +#endif + +#ifdef ODS_IMPORT + #include + #include + #include + #include +#endif + +#ifdef OPJ_IMPORT + #include "importOPJ.h" +#endif + +using namespace Qwt3D; + +extern "C" +{ +void file_compress(char *file, char *mode); +void file_uncompress(char *file); +} + +ApplicationWindow::ApplicationWindow(bool factorySettings) +: QMainWindow(), scripted(ScriptingLangManager::newEnv(this)) +{ + setAttribute(Qt::WA_DeleteOnClose); + init(factorySettings); + ((QtiPlotApplication *)QCoreApplication::instance ())->append(this); +} + +void ApplicationWindow::init(bool factorySettings) +{ + setWindowTitle(tr("QtiPlot - untitled")); + setObjectName(tr("QtiPlot")); + initGlobalConstants(); + QPixmapCache::setCacheLimit(20*QPixmapCache::cacheLimit ()); + + tablesDepend = new QMenu(this); + + explorerWindow = new QDockWidget( this ); + explorerWindow->setWindowTitle(tr("Project Explorer")); + explorerWindow->setObjectName("explorerWindow"); // this is needed for QMainWindow::restoreState() + explorerWindow->setMinimumHeight(150); + addDockWidget( Qt::BottomDockWidgetArea, explorerWindow ); + + actionSaveProject = NULL; + folders = new FolderListView(this); + folders->header()->setClickEnabled( false ); + folders->addColumn( tr("Folder") ); + folders->setRootIsDecorated( true ); + folders->setResizeMode(Q3ListView::LastColumn); + folders->header()->hide(); + folders->setSelectionMode(Q3ListView::Single); + + connect(folders, SIGNAL(currentChanged(Q3ListViewItem *)), + this, SLOT(folderItemChanged(Q3ListViewItem *))); + connect(folders, SIGNAL(itemRenamed(Q3ListViewItem *, int, const QString &)), + this, SLOT(renameFolder(Q3ListViewItem *, int, const QString &))); + connect(folders, SIGNAL(contextMenuRequested(Q3ListViewItem *, const QPoint &, int)), + this, SLOT(showFolderPopupMenu(Q3ListViewItem *, const QPoint &, int))); + connect(folders, SIGNAL(dragItems(QList)), + this, SLOT(dragFolderItems(QList))); + connect(folders, SIGNAL(dropItems(Q3ListViewItem *)), + this, SLOT(dropFolderItems(Q3ListViewItem *))); + connect(folders, SIGNAL(renameItem(Q3ListViewItem *)), + this, SLOT(startRenameFolder(Q3ListViewItem *))); + connect(folders, SIGNAL(addFolderItem()), this, SLOT(addFolder())); + connect(folders, SIGNAL(deleteSelection()), this, SLOT(deleteSelectedItems())); + + current_folder = new Folder( 0, tr("UNTITLED")); + FolderListItem *fli = new FolderListItem(folders, current_folder); + current_folder->setFolderListItem(fli); + fli->setOpen( true ); + + lv = new FolderListView(); + lv->addColumn (tr("Name"),-1 ); + lv->addColumn (tr("Type"),-1 ); + lv->addColumn (tr("View"),-1 ); + lv->addColumn (tr("Size"),-1 ); + lv->addColumn (tr("Created"),-1); + lv->addColumn (tr("Label"),-1); + lv->setResizeMode(Q3ListView::LastColumn); + lv->setMinimumHeight(80); + lv->setSelectionMode(Q3ListView::Extended); + lv->setDefaultRenameAction (Q3ListView::Accept); + + explorerSplitter = new QSplitter(Qt::Horizontal, explorerWindow); + explorerSplitter->addWidget(folders); + explorerSplitter->addWidget(lv); + explorerWindow->setWidget(explorerSplitter); + + QList splitterSizes; + explorerSplitter->setSizes( splitterSizes << 45 << 45); + explorerWindow->hide(); + + logWindow = new QDockWidget(this); + logWindow->setObjectName("logWindow"); // this is needed for QMainWindow::restoreState() + logWindow->setWindowTitle(tr("Results Log")); + addDockWidget( Qt::TopDockWidgetArea, logWindow ); + + results=new QTextEdit(logWindow); + results->setReadOnly (true); + + logWindow->setWidget(results); + logWindow->hide(); + +#ifdef SCRIPTING_CONSOLE + consoleWindow = new QDockWidget(this); + consoleWindow->setObjectName("consoleWindow"); // this is needed for QMainWindow::restoreState() + consoleWindow->setWindowTitle(tr("Scripting Console")); + addDockWidget( Qt::TopDockWidgetArea, consoleWindow ); + console = new QTextEdit(consoleWindow); + console->setReadOnly(true); + consoleWindow->setWidget(console); + consoleWindow->hide(); +#endif + + undoStackWindow = new QDockWidget(this); + undoStackWindow->setObjectName("undoStackWindow"); // this is needed for QMainWindow::restoreState() + undoStackWindow->setWindowTitle(tr("Undo Stack")); + addDockWidget(Qt::RightDockWidgetArea, undoStackWindow); + + d_undo_view = new QUndoView(undoStackWindow); + d_undo_view->setCleanIcon(QIcon(":/filesave.png")); + undoStackWindow->setWidget(d_undo_view); + undoStackWindow->hide(); + + // Needs to be done after initialization of dock windows, + // because we now use QDockWidget::toggleViewAction() + createActions(); + initToolBars(); + initMainMenu(); + + d_workspace = new QMdiArea(); + d_workspace->setOption(QMdiArea::DontMaximizeSubWindowOnActivation); + d_workspace->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); + d_workspace->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); + d_workspace->setActivationOrder(QMdiArea::ActivationHistoryOrder); + setCentralWidget(d_workspace); + + setAcceptDrops(true); + + hiddenWindows = new QList(); + + scriptWindow = 0; + d_text_editor = NULL; + + renamedTables = QStringList(); + if (!factorySettings) + readSettings(); + createLanguagesList(); + insertTranslatedStrings(); + disableToolbars(); + + assistant = new QAssistantClient( QString(), this ); + + actionNextWindow = new QAction(QIcon(":/next.png"), tr("&Next","next window"), this); + actionNextWindow->setShortcut( tr("F5","next window shortcut") ); + connect(actionNextWindow, SIGNAL(activated()), d_workspace, SLOT(activateNextSubWindow())); + + actionPrevWindow = new QAction(QIcon(":/prev.png"), tr("&Previous","previous window"), this); + actionPrevWindow->setShortcut( tr("F6","previous window shortcut") ); + connect(actionPrevWindow, SIGNAL(activated()), d_workspace, SLOT(activatePreviousSubWindow())); + + connect(tablesDepend, SIGNAL(activated(int)), this, SLOT(showTable(int))); + + connect(this, SIGNAL(modified()),this, SLOT(modifiedProject())); + connect(d_workspace, SIGNAL(subWindowActivated(QMdiSubWindow *)), + this, SLOT(windowActivated(QMdiSubWindow*))); + connect(lv, SIGNAL(doubleClicked(Q3ListViewItem *)), + this, SLOT(maximizeWindow(Q3ListViewItem *))); + connect(lv, SIGNAL(doubleClicked(Q3ListViewItem *)), + this, SLOT(folderItemDoubleClicked(Q3ListViewItem *))); + connect(lv, SIGNAL(contextMenuRequested(Q3ListViewItem *, const QPoint &, int)), + this, SLOT(showWindowPopupMenu(Q3ListViewItem *, const QPoint &, int))); + connect(lv, SIGNAL(dragItems(QList)), + this, SLOT(dragFolderItems(QList))); + connect(lv, SIGNAL(dropItems(Q3ListViewItem *)), + this, SLOT(dropFolderItems(Q3ListViewItem *))); + connect(lv, SIGNAL(renameItem(Q3ListViewItem *)), + this, SLOT(startRenameFolder(Q3ListViewItem *))); + connect(lv, SIGNAL(addFolderItem()), this, SLOT(addFolder())); + connect(lv, SIGNAL(deleteSelection()), this, SLOT(deleteSelectedItems())); + connect(lv, SIGNAL(itemRenamed(Q3ListViewItem *, int, const QString &)), + this, SLOT(renameWindow(Q3ListViewItem *, int, const QString &))); + + connect(scriptEnv, SIGNAL(error(const QString&,const QString&,int)), + this, SLOT(scriptError(const QString&,const QString&,int))); + connect(scriptEnv, SIGNAL(print(const QString&)), this, SLOT(scriptPrint(const QString&))); + + connect(recent, SIGNAL(activated(int)), this, SLOT(openRecentProject(int))); + connect(explorerWindow, SIGNAL(dockLocationChanged (Qt::DockWidgetArea)), this, SLOT(updateExplorerWindowLayout(Qt::DockWidgetArea))); + + // this has to be done after connecting scriptEnv + scriptEnv->initialize(); + + //apply user settings + updateAppFonts(); + setScriptingLanguage(defaultScriptingLang); + setAppColors(workspaceColor, panelsColor, panelsTextColor, true); + + loadCustomActions(); + initCompleter(); +} + +void ApplicationWindow::updateExplorerWindowLayout(Qt::DockWidgetArea area) +{ + switch(area){ + case Qt::LeftDockWidgetArea: + case Qt::RightDockWidgetArea: + explorerSplitter->setOrientation(Qt::Vertical); + break; + + case Qt::TopDockWidgetArea: + case Qt::BottomDockWidgetArea: + case Qt::NoDockWidgetArea: + explorerSplitter->setOrientation(Qt::Horizontal); + break; + + default: + break; + } +} + +void ApplicationWindow::initWindow() +{ + switch(d_init_window_type){ + case TableWindow: + newTable(); + break; + case MatrixWindow: + newMatrix(); + break; + case MultiLayerWindow: + newGraph(); + break; + case NoteWindow: + newNote(); + break; + default: + break; + } + savedProject(); +} + +void ApplicationWindow::initGlobalConstants() +{ + d_indexed_colors = ColorBox::defaultColors(); + d_indexed_color_names = ColorBox::defaultColorNames(); + + d_symbols_list = SymbolBox::defaultSymbols(); + + d_latex_compiler = MathTran; + d_latex_compiler_path = QString::null; + d_mdi_windows_area = true; + d_open_project_filter = QString::null;//tr("QtiPlot project") + " (*.qti)"; + + d_comment_highlight_color = Qt::red; + d_class_highlight_color = Qt::darkMagenta; + d_numeric_highlight_color = Qt::darkGreen; + d_keyword_highlight_color = Qt::darkBlue; + d_function_highlight_color = Qt::blue; + d_quotation_highlight_color = Qt::darkYellow; + + d_notes_tab_length = 20; + d_completer = NULL; + d_completion = true; + d_note_line_numbers = true; + + d_auto_update_table_values = true; + d_active_window = NULL; + d_matrix_undo_stack_size = 10; + + d_opening_file = false; + d_is_appending_file = false; + d_in_place_editing = true; + + d_matrix_tool_bar = true; + d_file_tool_bar = true; + d_table_tool_bar = true; + d_column_tool_bar = true; + d_edit_tool_bar = true; + d_notes_tool_bar = true; + d_plot_tool_bar = true; + d_plot3D_tool_bar = true; + d_display_tool_bar = false; + d_format_tool_bar = true; + + appStyle = qApp->style()->objectName(); + d_app_rect = QRect(); + projectname = "untitled"; + lastCopiedLayer = 0; + d_enrichement_copy = NULL; + d_arrow_copy = NULL; + + savingTimerId = 0; + + autoSearchUpdatesRequest = false; + + show_windows_policy = ActiveFolder; + d_script_win_on_top = false; + d_script_win_rect = QRect(0, 0, 500, 300); + d_init_window_type = TableWindow; + + QString aux = qApp->applicationDirPath(); + workingDir = aux; + +#ifdef TRANSLATIONS_PATH + d_translations_folder = TRANSLATIONS_PATH; +#else + d_translations_folder = aux + "/translations"; +#endif + +#ifdef MANUAL_PATH + helpFilePath = MANUAL_PATH; + helpFilePath += "/index.html"; +#else + helpFilePath = aux + "/manual/index.html"; +#endif + +#ifdef PYTHON_CONFIG_PATH + d_python_config_folder = PYTHON_CONFIG_PATH; +#else + d_python_config_folder = aux; +#endif + + fitPluginsPath = aux + "fitPlugins"; + fitModelsPath = QString::null; + templatesDir = aux; + asciiDirPath = aux; + imagesDirPath = aux; + scriptsDirPath = aux; + customActionsDirPath = QString::null; + + appFont = QFont(); + d_notes_font = appFont; + + QString family = appFont.family(); + int pointSize = appFont.pointSize(); + tableTextFont = appFont; + tableHeaderFont = appFont; + plotAxesFont = QFont(family, pointSize, QFont::Bold, false); + plotNumbersFont = QFont(family, pointSize ); + plotLegendFont = appFont; + plotTitleFont = QFont(family, pointSize + 2, QFont::Bold,false); + + autoSearchUpdates = false; + appLanguage = QLocale::system().name().section('_',0,0); + show_windows_policy = ApplicationWindow::ActiveFolder; + + workspaceColor = QColor("darkGray"); + panelsColor = QColor("#ffffff"); + panelsTextColor = QColor("#000000"); + tableBkgdColor = QColor("#ffffff"); + tableTextColor = QColor("#000000"); + tableHeaderColor = QColor("#000000"); + + d_graph_background_color = Qt::white; + d_graph_canvas_color = Qt::white; + d_graph_border_color = Qt::black; + d_graph_background_opacity = 255; + d_graph_canvas_opacity = 255; + d_graph_border_width = 0; + d_graph_tick_labels_dist = 4; + d_graph_axes_labels_dist = 2; + + autoSave = true; + autoSaveTime = 15; + d_backup_files = true; + + defaultScriptingLang = "muParser"; +/*#ifdef SCRIPTING_PYTHON + defaultScriptingLang = "Python"; +#endif*/ + + d_decimal_digits = 13; + d_muparser_c_locale = true; + + d_extended_open_dialog = true; + d_extended_export_dialog = true; + d_extended_import_ASCII_dialog = true; + d_extended_plot_dialog = true; + + d_add_curves_dialog_size = QSize(700, 400); + d_show_current_folder = false; + + d_confirm_overwrite = true; + confirmCloseFolder = true; + confirmCloseTable = true; + confirmCloseMatrix = true; + confirmClosePlot2D = true; + confirmClosePlot3D = true; + confirmCloseNotes = true; + d_inform_rename_table = true; + + d_show_table_comments = false; + + titleOn = true; + d_show_axes = QVector (QwtPlot::axisCnt, true); + d_show_axes_labels = QVector (QwtPlot::axisCnt, true); + canvasFrameWidth = 0; + d_canvas_frame_color = Qt::black; + defaultPlotMargin = 0; + drawBackbones = true; + axesLineWidth = 1; + autoscale2DPlots = true; + autoScaleFonts = true; + autoResizeLayers = true; + antialiasing2DPlots = false; + d_scale_plots_on_print = false; + d_print_cropmarks = false; + d_graph_legend_display = Graph::ColumnName; + d_graph_axis_labeling = Graph::Default; + d_synchronize_graph_scales = true; + d_print_paper_size = QPrinter::A4; + d_printer_orientation = QPrinter::Landscape; + defaultCurveStyle = int(Graph::LineSymbols); + defaultCurveLineWidth = 1; + d_curve_line_style = 0;//Qt::SolidLine; + defaultCurveBrush = 0; + defaultCurveAlpha = 255; + defaultSymbolSize = 7; + defaultSymbolEdge = 1.0; + d_fill_symbols = true; + d_symbol_style = 0; + d_indexed_symbols = true; + d_keep_aspect_ration = true; + + majTicksStyle = int(ScaleDraw::Out); + minTicksStyle = int(ScaleDraw::Out); + minTicksLength = 5; + majTicksLength = 9; + + legendFrameStyle = int(LegendWidget::Line); + d_frame_widget_pen = QPen(Qt::black, 1, Qt::SolidLine); + legendTextColor = Qt::black; + legendBackground = Qt::white; + legendBackground.setAlpha(0); // transparent by default; + d_legend_default_angle = 0; + d_frame_geometry_unit = (int)FrameWidget::Scale; + d_layer_geometry_unit = (int)FrameWidget::Pixel; + d_layer_canvas_width = 400; + d_layer_canvas_height = 300; + + d_rect_default_background = Qt::white; + d_rect_default_brush = QBrush(Qt::white); + + defaultArrowLineWidth = 1; + defaultArrowColor = Qt::black; + defaultArrowHeadLength = 4; + defaultArrowHeadAngle = 45; + defaultArrowHeadFill = true; + defaultArrowLineStyle = Graph::getPenStyle("SolidLine"); + + d_3D_legend = true; + d_3D_projection = NOFLOOR; + d_3D_smooth_mesh = true; + d_3D_resolution = 1; + d_3D_orthogonal = false; + d_3D_autoscale = true; + d_3D_axes_font = QFont(family, pointSize, QFont::Normal, false); + d_3D_numbers_font = QFont(family, pointSize); + d_3D_title_font = QFont(family, pointSize + 2, QFont::Normal, false); + d_3D_color_map = QwtLinearColorMap(Qt::blue, Qt::red); + d_3D_mesh_color = Qt::black; + d_3D_axes_color = Qt::black; + d_3D_numbers_color = Qt::black; + d_3D_labels_color = Qt::black; + d_3D_background_color = Qt::white; + d_3D_grid_color = Qt::blue; + d_3D_minor_grid_color = Qt::lightGray; + d_3D_minor_grids = true; + d_3D_major_grids = true; + d_3D_major_style = Qwt3D::SOLID; + d_3D_minor_style = Qwt3D::DASH; + d_3D_major_width = 1.0; + d_3D_minor_width = 0.8; + + fit_output_precision = 13; + pasteFitResultsToPlot = false; + writeFitResultsToLog = true; + generateUniformFitPoints = true; + fitPoints = 100; + generatePeakCurves = true; + peakCurvesColor = Qt::green; + fit_scale_errors = true; + d_2_linear_fit_points = true; + d_multi_peak_messages = true; + + columnSeparator = "\t"; + ignoredLines = 0; + renameColumns = true; + strip_spaces = false; + simplify_spaces = false; + d_ASCII_file_filter = "*"; + d_ASCII_import_locale = QLocale::system().name(); + d_ASCII_import_mode = int(ImportASCIIDialog::NewTables); + d_ASCII_import_first_row_role = 0;//column names + d_ASCII_comment_string = "#"; + d_ASCII_import_comments = false; + d_ASCII_import_read_only = false; + d_ASCII_import_preview = true; + d_preview_lines = 100; + d_import_ASCII_dialog_size = QSize(); + d_ASCII_end_line = LF; + d_eol = LF; +#ifdef Q_OS_MAC + d_ASCII_end_line = CR; + d_eol = CR; +#endif + + d_export_col_separator = "\t"; + d_export_col_names = false; + d_export_col_comment = false; + d_export_table_selection = false; + d_export_ASCII_file_filter = ".dat"; + + d_scale_fonts_factor = 0.0; + d_image_export_filter = ".png"; + d_export_transparency = false; + d_export_quality = 100; + d_export_raster_size = QSizeF(); + d_export_size_unit = FrameWidget::Pixel; + d_export_vector_resolution = QWidget().logicalDpiX(); + d_export_bitmap_resolution = d_export_vector_resolution; + d_export_color = true; + d_export_escape_tex_strings = true; + d_export_tex_font_sizes = true; + d_3D_export_text_mode = 0; //VectorWriter::PIXEL + d_3D_export_sort = 1; //VectorWriter::SIMPLESORT +} + +void ApplicationWindow::initToolBars() +{ + initPlot3DToolBar(); + + setWindowIcon(QIcon(":/logo.png")); + QPixmap openIcon, saveIcon; + + fileTools = new QToolBar(tr( "File" ), this); + fileTools->setObjectName("fileTools"); // this is needed for QMainWindow::restoreState() + fileTools->setIconSize( QSize(18,20) ); + addToolBar( Qt::TopToolBarArea, fileTools ); + + fileTools->addAction(actionNewProject); + fileTools->addAction(actionNewFolder); + fileTools->addAction(actionNewTable); + fileTools->addAction(actionNewMatrix); + fileTools->addAction(actionNewNote); + fileTools->addAction(actionNewGraph); + fileTools->addAction(actionNewFunctionPlot); + fileTools->addAction(actionNewSurfacePlot); + fileTools->addSeparator (); + fileTools->addAction(actionOpen); + fileTools->addAction(actionOpenTemplate); +#ifdef XLS_IMPORT + fileTools->addAction(actionOpenExcel); +#endif +#ifdef ODS_IMPORT + fileTools->addAction(actionOpenOds); +#endif + fileTools->addAction(actionAppendProject); + fileTools->addAction(actionSaveProject); + fileTools->addAction(actionSaveTemplate); + fileTools->addSeparator (); + fileTools->addAction(actionLoad); + fileTools->addSeparator (); + fileTools->addAction(actionCopyWindow); + fileTools->addAction(actionPrint); + fileTools->addAction(actionPrintPreview); + fileTools->addAction(actionExportPDF); + fileTools->addSeparator(); + fileTools->addAction(actionShowExplorer); + fileTools->addAction(actionShowLog); +#ifdef SCRIPTING_PYTHON + fileTools->addAction(actionShowScriptWindow); +#endif + + editTools = new QToolBar(tr("Edit"), this); + editTools->setObjectName("editTools"); // this is needed for QMainWindow::restoreState() + editTools->setIconSize( QSize(18,20) ); + addToolBar( editTools ); + + editTools->addAction(actionUndo); + editTools->addAction(actionRedo); + editTools->addAction(actionCutSelection); + editTools->addAction(actionCopySelection); + editTools->addAction(actionPasteSelection); + editTools->addAction(actionClearSelection); + + noteTools = new QToolBar(tr("Notes"), this); + noteTools->setObjectName("noteTools"); // this is needed for QMainWindow::restoreState() + noteTools->setIconSize( QSize(18,20) ); +#ifdef SCRIPTING_PYTHON + noteTools->addAction(actionNoteExecuteAll); + noteTools->addAction(actionNoteExecute); + noteTools->addAction(actionCommentSelection); + noteTools->addAction(actionUncommentSelection); +#endif + noteTools->addAction(actionDecreaseIndent); + noteTools->addAction(actionIncreaseIndent); + noteTools->addAction(actionFind); + noteTools->addAction(actionFindPrev); + noteTools->addAction(actionFindNext); + noteTools->addAction(actionReplace); + addToolBar( noteTools ); + + plotTools = new QToolBar(tr("Plot"), this); + plotTools->setObjectName("plotTools"); // this is needed for QMainWindow::restoreState() + plotTools->setIconSize( QSize(16,20) ); + addToolBar( plotTools ); + + plotTools->addAction(actionAddLayer); + plotTools->addAction(actionAddInsetLayer); + plotTools->addAction(actionAddInsetCurveLayer); + plotTools->addSeparator(); + plotTools->addAction(actionShowLayerDialog); + plotTools->addAction(actionAutomaticLayout); + plotTools->addSeparator(); + plotTools->addAction(actionExtractLayers); + plotTools->addAction(actionExtractGraphs); + plotTools->addSeparator(); + plotTools->addAction(actionAddErrorBars); + plotTools->addAction(actionShowCurvesDialog); + plotTools->addAction(actionAddFunctionCurve); + plotTools->addAction(actionNewLegend); + plotTools->addSeparator (); + plotTools->addAction(actionUnzoom); + + dataTools = new QActionGroup( this ); + dataTools->setExclusive( true ); + + btnPointer = new QAction(tr("Disable &Tools"), this); + btnPointer->setActionGroup(dataTools); + btnPointer->setCheckable( true ); + btnPointer->setIcon(QIcon(":/pointer.png")); + btnPointer->setChecked(true); + plotTools->addAction(btnPointer); + + actionMagnify->setActionGroup(dataTools); + actionMagnify->setCheckable( true ); + + actionMagnifyHor->setActionGroup(dataTools); + actionMagnifyHor->setCheckable( true ); + + actionMagnifyVert->setActionGroup(dataTools); + actionMagnifyVert->setCheckable( true ); + + btnZoomIn = new QAction(tr("&Zoom In"), this); + btnZoomIn->setShortcut( tr("Ctrl++") ); + btnZoomIn->setActionGroup(dataTools); + btnZoomIn->setCheckable( true ); + btnZoomIn->setIcon(QIcon(":/zoom.png")); + + btnZoomOut = new QAction(tr("&Zoom Out"), this); + btnZoomOut->setShortcut( tr("Ctrl+-") ); + btnZoomOut->setActionGroup(dataTools); + btnZoomOut->setCheckable( true ); + btnZoomOut->setIcon(QIcon(":/zoomOut.png")); + + QMenu *menu_zoom = new QMenu(this); + menu_zoom->addAction(actionMagnify); + menu_zoom->addAction(actionMagnifyHor); + menu_zoom->addAction(actionMagnifyVert); + menu_zoom->addAction(btnZoomIn); + menu_zoom->addAction(btnZoomOut); + + QToolButton *btn_zoom = new QToolButton(this); + btn_zoom->setMenu(menu_zoom); + btn_zoom->setPopupMode(QToolButton::MenuButtonPopup); + btn_zoom->setDefaultAction(actionMagnify); + connect(menu_zoom, SIGNAL(triggered(QAction *)), btn_zoom, SLOT(setDefaultAction(QAction *))); + + plotTools->addWidget(btn_zoom); + + btnCursor = new QAction(tr("&Data Reader"), this); + btnCursor->setShortcut( tr("CTRL+D") ); + btnCursor->setActionGroup(dataTools); + btnCursor->setCheckable( true ); + btnCursor->setIcon(QIcon(":/select.png")); + plotTools->addAction(btnCursor); + + btnSelect = new QAction(tr("&Select Data Range"), this); + btnSelect->setShortcut( tr("ALT+S") ); + btnSelect->setActionGroup(dataTools); + btnSelect->setCheckable( true ); + btnSelect->setIcon(QIcon(":/cursors.png")); + plotTools->addAction(btnSelect); + + btnPicker = new QAction(tr("S&creen Reader"), this); + btnPicker->setActionGroup(dataTools); + btnPicker->setCheckable( true ); + btnPicker->setIcon(QIcon(":/cursor_16.png")); + plotTools->addAction(btnPicker); + + actionDrawPoints = new QAction(tr("&Draw Data Points"), this); + actionDrawPoints->setActionGroup(dataTools); + actionDrawPoints->setCheckable( true ); + actionDrawPoints->setIcon(QIcon(":/draw_points.png")); + plotTools->addAction(actionDrawPoints); + + btnMovePoints = new QAction(tr("&Move Data Points..."), this); + btnMovePoints->setShortcut( tr("Ctrl+ALT+M") ); + btnMovePoints->setActionGroup(dataTools); + btnMovePoints->setCheckable( true ); + btnMovePoints->setIcon(QIcon(":/hand.png")); + plotTools->addAction(btnMovePoints); + + btnRemovePoints = new QAction(tr("Remove &Bad Data Points..."), this); + btnRemovePoints->setShortcut( tr("Alt+B") ); + btnRemovePoints->setActionGroup(dataTools); + btnRemovePoints->setCheckable( true ); + btnRemovePoints->setIcon(QIcon(":/delete.png")); + plotTools->addAction(btnRemovePoints); + + actionDragCurve = new QAction(tr("Dra&g Curve"), this); + actionDragCurve->setActionGroup(dataTools); + actionDragCurve->setCheckable( true ); + actionDragCurve->setIcon(QIcon(":/drag_curve.png")); + plotTools->addAction(actionDragCurve); + + connect( dataTools, SIGNAL( triggered( QAction* ) ), this, SLOT( pickDataTool( QAction* ) ) ); + plotTools->addSeparator (); + + actionAddFormula = new QAction(tr("Add E&quation"), this); + actionAddFormula->setShortcut( tr("ALT+Q") ); + actionAddFormula->setCheckable(true); + actionAddFormula->setIcon(QIcon(":/equation.png")); + connect(actionAddFormula, SIGNAL(triggered()), this, SLOT(addTexFormula())); + plotTools->addAction(actionAddFormula); + + actionAddText = new QAction(tr("Add &Text"), this); + actionAddText->setShortcut( tr("ALT+T") ); + actionAddText->setIcon(QIcon(":/text.png")); + actionAddText->setCheckable(true); + connect(actionAddText, SIGNAL(triggered()), this, SLOT(addText())); + plotTools->addAction(actionAddText); + + btnArrow = new QAction(tr("Draw &Arrow"), this); + btnArrow->setShortcut( tr("CTRL+ALT+A") ); + btnArrow->setActionGroup(dataTools); + btnArrow->setCheckable( true ); + btnArrow->setIcon(QIcon(":/arrow.png")); + plotTools->addAction(btnArrow); + + btnLine = new QAction(tr("Draw &Line"), this); + btnLine->setShortcut( tr("CTRL+ALT+L") ); + btnLine->setActionGroup(dataTools); + btnLine->setCheckable( true ); + btnLine->setIcon(QIcon(":/lPlot.png")); + plotTools->addAction(btnLine); + + QPixmap pix = QPixmap(16, 16); + pix.fill(Qt::transparent); + QPainter p; + p.begin(&pix); + p.setBrush(Qt::lightGray); + p.drawRect(QRect(1, 2, 12, 10)); + + actionAddRectangle = new QAction(tr("Add &Rectangle"), this); + actionAddRectangle->setShortcut( tr("CTRL+ALT+R") ); + actionAddRectangle->setCheckable(true); + actionAddRectangle->setIcon(QIcon(pix)); + connect(actionAddRectangle, SIGNAL(triggered()), this, SLOT(addRectangle())); + plotTools->addAction(actionAddRectangle); + + pix.fill(Qt::transparent); + p.drawEllipse(QRect(0, 2, 15, 12)); + p.end(); + + actionAddEllipse = new QAction(tr("Add &Ellipse"), this); + actionAddEllipse->setShortcut( tr("CTRL+ALT+E") ); + actionAddEllipse->setCheckable(true); + actionAddEllipse->setIcon(QIcon(pix)); + connect(actionAddEllipse, SIGNAL(triggered()), this, SLOT(addEllipse())); + plotTools->addAction(actionAddEllipse); + + plotTools->addAction(actionTimeStamp); + plotTools->addAction(actionAddImage); + plotTools->hide(); + + tableTools = new QToolBar(tr("Table"), this); + tableTools->setObjectName("tableTools"); // this is needed for QMainWindow::restoreState() + tableTools->setIconSize( QSize(16, 20)); + addToolBar(Qt::TopToolBarArea, tableTools); + + QMenu *menuPlotLine = new QMenu(this); + menuPlotLine->addAction(actionPlotL); + menuPlotLine->addAction(actionPlotHorSteps); + menuPlotLine->addAction(actionPlotVertSteps); + + QToolButton *btnPlotLine = new QToolButton(this); + btnPlotLine->setMenu(menuPlotLine); + btnPlotLine->setPopupMode(QToolButton::MenuButtonPopup); + btnPlotLine->setDefaultAction(actionPlotL); + connect(menuPlotLine, SIGNAL(triggered(QAction *)), btnPlotLine, SLOT(setDefaultAction(QAction *))); + tableTools->addWidget(btnPlotLine); + + QMenu *menuPlotScatter = new QMenu(this); + menuPlotScatter->addAction(actionPlotP); + menuPlotScatter->addAction(actionPlotVerticalDropLines); + + QToolButton *btnPlotScatter = new QToolButton(this); + btnPlotScatter->setMenu(menuPlotScatter); + btnPlotScatter->setPopupMode(QToolButton::MenuButtonPopup); + btnPlotScatter->setDefaultAction(actionPlotP); + connect(menuPlotScatter, SIGNAL(triggered(QAction *)), btnPlotScatter, SLOT(setDefaultAction(QAction *))); + tableTools->addWidget(btnPlotScatter); + + QMenu *menuPlotLineSymbol = new QMenu(this); + menuPlotLineSymbol->addAction(actionPlotLP); + menuPlotLineSymbol->addAction(actionPlotSpline); + + QToolButton *btnPlotLineSymbol = new QToolButton(this); + btnPlotLineSymbol->setMenu(menuPlotLineSymbol); + btnPlotLineSymbol->setPopupMode(QToolButton::MenuButtonPopup); + btnPlotLineSymbol->setDefaultAction(actionPlotLP); + connect(menuPlotLineSymbol, SIGNAL(triggered(QAction *)), btnPlotLineSymbol, SLOT(setDefaultAction(QAction *))); + tableTools->addWidget(btnPlotLineSymbol); + + QMenu *menuPlotBars = new QMenu(this); + menuPlotBars->addAction(actionPlotVerticalBars); + menuPlotBars->addAction(actionPlotHorizontalBars); + menuPlotBars->addAction(actionStackColumns); + menuPlotBars->addAction(actionStackBars); + + QToolButton *btnPlotBars = new QToolButton(this); + btnPlotBars->setMenu(menuPlotBars); + btnPlotBars->setPopupMode(QToolButton::MenuButtonPopup); + btnPlotBars->setDefaultAction(actionPlotVerticalBars); + connect(menuPlotBars, SIGNAL(triggered(QAction *)), btnPlotBars, SLOT(setDefaultAction(QAction *))); + tableTools->addWidget(btnPlotBars); + + tableTools->addAction(actionPlotArea); + tableTools->addAction(actionPlotPie); + + QMenu *menuStatisticPlots = new QMenu(this); + menuStatisticPlots->addAction(actionBoxPlot); + menuStatisticPlots->addAction(actionPlotHistogram); + menuStatisticPlots->addAction(actionPlotStackedHistograms); + menuStatisticPlots->addAction(actionStemPlot); + + QToolButton *btnStatisticPlots = new QToolButton(this); + btnStatisticPlots->setMenu(menuStatisticPlots); + btnStatisticPlots->setPopupMode(QToolButton::MenuButtonPopup); + btnStatisticPlots->setDefaultAction(actionBoxPlot); + connect(menuStatisticPlots, SIGNAL(triggered(QAction *)), btnStatisticPlots, SLOT(setDefaultAction(QAction *))); + tableTools->addWidget(btnStatisticPlots); + + QMenu *menuVectorPlots = new QMenu(this); + menuVectorPlots->addAction(actionPlotVectXYXY); + menuVectorPlots->addAction(actionPlotVectXYAM); + + QToolButton *btnVectorPlots = new QToolButton(this); + btnVectorPlots->setMenu(menuVectorPlots); + btnVectorPlots->setPopupMode(QToolButton::MenuButtonPopup); + btnVectorPlots->setDefaultAction(actionPlotVectXYXY); + connect(menuVectorPlots, SIGNAL(triggered(QAction *)), btnVectorPlots, SLOT(setDefaultAction(QAction *))); + tableTools->addWidget(btnVectorPlots); + + QMenu *menuPlotSpecial = new QMenu(this); + menuPlotSpecial->addAction(actionPlotDoubleYAxis); + menuPlotSpecial->addAction(actionWaterfallPlot); + menuPlotSpecial->addAction(actionAddZoomPlot); + menuPlotSpecial->addAction(actionPlot2VerticalLayers); + menuPlotSpecial->addAction(actionPlot2HorizontalLayers); + menuPlotSpecial->addAction(actionPlot4Layers); + menuPlotSpecial->addAction(actionPlotStackedLayers); + menuPlotSpecial->addAction(actionCustomSharedAxisLayers); + + QToolButton *btnPlotSpecial = new QToolButton(this); + btnPlotSpecial->setMenu(menuPlotSpecial); + btnPlotSpecial->setPopupMode(QToolButton::MenuButtonPopup); + btnPlotSpecial->setDefaultAction(actionPlotDoubleYAxis); + connect(menuPlotSpecial, SIGNAL(triggered(QAction *)), btnPlotSpecial, SLOT(setDefaultAction(QAction *))); + tableTools->addWidget(btnPlotSpecial); + + tableTools->addSeparator (); + + QMenu *menu3DPlots = new QMenu(this); + menu3DPlots->addAction(actionPlot3DBars); + menu3DPlots->addAction(actionPlot3DRibbon); + menu3DPlots->addAction(actionPlot3DScatter); + menu3DPlots->addAction(actionPlot3DTrajectory); + + QToolButton *btn3DPlots = new QToolButton(this); + btn3DPlots->setMenu(menu3DPlots); + btn3DPlots->setPopupMode(QToolButton::MenuButtonPopup); + btn3DPlots->setDefaultAction(actionPlot3DBars); + connect(menu3DPlots, SIGNAL(triggered(QAction *)), btn3DPlots, SLOT(setDefaultAction(QAction *))); + tableTools->addWidget(btn3DPlots); + + tableTools->setEnabled(false); + tableTools->hide(); + + columnTools = new QToolBar(tr( "Column"), this); + columnTools->setObjectName("columnTools"); // this is needed for QMainWindow::restoreState() + columnTools->setIconSize(QSize(16, 20)); + addToolBar(Qt::TopToolBarArea, columnTools); + + columnTools->addAction(actionShowColumnValuesDialog); + columnTools->addAction(actionSetAscValues); + columnTools->addAction(actionSetRandomValues); + columnTools->addSeparator(); + columnTools->addAction(actionSortTable); + columnTools->addAction(actionShowColStatistics); + columnTools->addAction(actionShowRowStatistics); + columnTools->addSeparator(); + columnTools->addAction(actionSetXCol); + columnTools->addAction(actionSetYCol); + columnTools->addAction(actionSetZCol); + columnTools->addAction(actionSetYErrCol); + columnTools->addAction(actionSetLabelCol); + columnTools->addAction(actionDisregardCol); + columnTools->addSeparator(); + columnTools->addAction(actionMoveColFirst); + columnTools->addAction(actionMoveColLeft); + columnTools->addAction(actionMoveColRight); + columnTools->addAction(actionMoveColLast); + columnTools->addAction(actionSwapColumns); + columnTools->addSeparator(); + columnTools->addAction(actionAdjustColumnWidth); + columnTools->addAction(actionMoveRowUp); + columnTools->addAction(actionMoveRowDown); + columnTools->addSeparator(); + columnTools->addAction(actionAddColToTable); + columnTools->setEnabled(false); + columnTools->hide(); + + displayBar = new QToolBar( tr( "Data Display" ), this ); + displayBar->setAllowedAreas( Qt::TopToolBarArea | Qt::BottomToolBarArea ); + displayBar->setObjectName("displayBar"); // this is needed for QMainWindow::restoreState() + info = new QLineEdit( this ); + displayBar->addWidget( info ); + info->setReadOnly(true); + QPalette palette; + palette.setColor(QPalette::Text, QColor(Qt::green)); + palette.setColor(QPalette::HighlightedText, QColor(Qt::darkGreen)); + palette.setColor(QPalette::Base, QColor(Qt::black)); + info->setPalette(palette); + + addToolBar( Qt::TopToolBarArea, displayBar ); + displayBar->hide(); + + insertToolBarBreak (displayBar); + + plotMatrixBar = new QToolBar( tr( "Matrix Plot" ), this); + plotMatrixBar->setObjectName("plotMatrixBar"); + addToolBar(Qt::BottomToolBarArea, plotMatrixBar); + + QMenu *menu3DMatrix = new QMenu(this); + menu3DMatrix->addAction(actionPlot3DWireFrame); + menu3DMatrix->addAction(actionPlot3DHiddenLine); + menu3DMatrix->addAction(actionPlot3DWireSurface); + menu3DMatrix->addAction(actionPlot3DPolygons); + + QToolButton *btn3DMatrix = new QToolButton(this); + btn3DMatrix->setMenu(menu3DMatrix); + btn3DMatrix->setPopupMode(QToolButton::MenuButtonPopup); + btn3DMatrix->setDefaultAction(actionPlot3DWireSurface); + connect(menu3DMatrix, SIGNAL(triggered(QAction *)), btn3DMatrix, SLOT(setDefaultAction(QAction *))); + plotMatrixBar->addWidget(btn3DMatrix); + + actionPlot3DBars->addTo(plotMatrixBar); + actionPlot3DScatter->addTo(plotMatrixBar); + + plotMatrixBar->addSeparator(); + + QMenu *menuContourPlot = new QMenu(this); + menuContourPlot->addAction(actionColorMap); + menuContourPlot->addAction(actionContourMap); + menuContourPlot->addAction(actionGrayMap); + + QToolButton *btnContourPlot = new QToolButton(this); + btnContourPlot->setMenu(menuContourPlot); + btnContourPlot->setPopupMode(QToolButton::MenuButtonPopup); + btnContourPlot->setDefaultAction(actionColorMap); + connect(menuContourPlot, SIGNAL(triggered(QAction *)), btnContourPlot, SLOT(setDefaultAction(QAction *))); + plotMatrixBar->addWidget(btnContourPlot); + + actionImagePlot->addTo(plotMatrixBar); + actionImageProfilesPlot->addTo(plotMatrixBar); + actionPlotHistogram->addTo(plotMatrixBar); + plotMatrixBar->addSeparator(); + actionSetMatrixValues->addTo(plotMatrixBar); + actionFlipMatrixHorizontally->addTo(plotMatrixBar); + actionFlipMatrixVertically->addTo(plotMatrixBar); + actionRotateMatrix->addTo(plotMatrixBar); + actionRotateMatrixMinus->addTo(plotMatrixBar); + plotMatrixBar->addSeparator(); + plotMatrixBar->addAction(actionIncreasePrecision); + plotMatrixBar->addAction(actionDecreasePrecision); + plotMatrixBar->hide(); + + formatToolBar = new QToolBar(tr( "Format" ), this); + formatToolBar->setObjectName("formatToolBar"); + addToolBar(Qt::TopToolBarArea, formatToolBar); + + QFontComboBox *fb = new QFontComboBox(); + connect(fb, SIGNAL(currentFontChanged(const QFont &)), this, SLOT(setFontFamily(const QFont &))); + actionFontBox = formatToolBar->addWidget(fb); + + QSpinBox *sb = new QSpinBox(); + connect(sb, SIGNAL(valueChanged(int)), this, SLOT(setFontSize(int))); + actionFontSize = formatToolBar->addWidget(sb); + + actionFontBold->addTo(formatToolBar); + actionFontItalic->addTo(formatToolBar); + + actionUnderline->addTo(formatToolBar); + actionSuperscript->addTo(formatToolBar); + actionSubscript->addTo(formatToolBar); + actionGreekSymbol->addTo(formatToolBar); + actionGreekMajSymbol->addTo(formatToolBar); + actionMathSymbol->addTo(formatToolBar); + + formatToolBar->setEnabled(false); + formatToolBar->hide(); + + QList toolBars = toolBarsList(); + foreach (QToolBar *t, toolBars) + connect(t, SIGNAL(actionTriggered(QAction *)), this, SLOT(performCustomAction(QAction *))); +} + +void ApplicationWindow::insertTranslatedStrings() +{ + if (projectname == "untitled") + setWindowTitle(tr("QtiPlot - untitled")); + + lv->setColumnText (0, tr("Name")); + lv->setColumnText (1, tr("Type")); + lv->setColumnText (2, tr("View")); + lv->setColumnText (3, tr("Size")); + lv->setColumnText (4, tr("Created")); + lv->setColumnText (5, tr("Label")); + + if (scriptWindow) + scriptWindow->setWindowTitle(tr("QtiPlot - Script Window")); + explorerWindow->setWindowTitle(tr("Project Explorer")); + logWindow->setWindowTitle(tr("Results Log")); + undoStackWindow->setWindowTitle(tr("Undo Stack")); +#ifdef SCRIPTING_CONSOLE + consoleWindow->setWindowTitle(tr("Scripting Console")); +#endif + displayBar->setWindowTitle(tr("Data Display")); + tableTools->setWindowTitle(tr("Table")); + columnTools->setWindowTitle(tr("Column")); + plotTools->setWindowTitle(tr("Plot")); + fileTools->setWindowTitle(tr("File")); + editTools->setWindowTitle(tr("Edit")); + noteTools->setWindowTitle(tr("Notes")); + plotMatrixBar->setWindowTitle(tr("Matrix Plot")); + plot3DTools->setWindowTitle(tr("3D Surface")); + formatToolBar->setWindowTitle(tr("Format")); + + fileMenu->changeItem(recentMenuID, tr("&Recent Projects")); + fileMenu->setTitle(tr("&File")); + newMenu->setTitle(tr("&New")); + exportPlotMenu->setTitle(tr("&Export Graph")); + importMenu->setTitle(tr("&Import")); + edit->setTitle(tr("&Edit")); + view->setTitle(tr("&View")); + graphMenu->setTitle(tr("&Graph")); + plot3DMenu->setTitle(tr("3D &Plot")); + matrixMenu->setTitle(tr("&Matrix")); + plot2DMenu->setTitle(tr("&Plot")); + plotDataMenu->setTitle(tr("&Data")); + normMenu->setTitle(tr("&Normalize")); + fillMenu->setTitle(tr("&Fill Columns With")); + tableMenu->setTitle(tr("&Table")); + smoothMenu->setTitle(tr("&Smooth")); + filterMenu->setTitle(tr("&FFT filter")); + decayMenu->setTitle(tr("Fit E&xponential Decay")); + multiPeakMenu->setTitle(tr("Fit &Multi-peak")); + analysisMenu->setTitle(tr("&Analysis")); + format->setTitle(tr("F&ormat")); + scriptingMenu->setTitle(tr("&Scripting")); + windowsMenu->setTitle(tr("&Windows")); + help->setTitle(tr("&Help")); + + translateActionsStrings(); + customMenu(activeWindow()); +} + +void ApplicationWindow::initMainMenu() +{ + menuBar()->setObjectName("menuBar"); + + fileMenu = new QMenu(this); + fileMenu->setObjectName("fileMenu"); + connect(fileMenu, SIGNAL(aboutToShow()), this, SLOT(fileMenuAboutToShow())); + menuBar()->addMenu(fileMenu); + + recent = new QMenu(this); + newMenu = new QMenu(this); + newMenu->setObjectName("newMenu"); + exportPlotMenu = new QMenu(this); + exportPlotMenu->setObjectName("exportPlotMenu"); + importMenu = new QMenu(this); + importMenu->setObjectName("importMenu"); + + edit = new QMenu(this); + edit->setObjectName("editMenu"); + menuBar()->addMenu(edit); + + edit->addAction(actionUndo); + edit->addAction(actionRedo); + edit->insertSeparator(); + edit->addAction(actionCopySelection); + edit->addAction(actionPasteSelection); + edit->addAction(actionClearSelection); + edit->insertSeparator(); + edit->addAction(actionDeleteFitTables); + edit->addAction(actionClearLogInfo); + edit->insertSeparator(); + edit->addAction(actionShowConfigureDialog); + + connect(edit, SIGNAL(aboutToShow()), this, SLOT(editMenuAboutToShow())); + + view = new QMenu(this); + view->setObjectName("viewMenu"); + menuBar()->addMenu(view); + + view->setCheckable(true); + view->addAction(actionToolBars); + view->addAction(actionShowPlotWizard); + view->addAction(actionShowExplorer); + view->addAction(actionShowLog); + view->addAction(actionShowUndoStack); +#ifdef SCRIPTING_CONSOLE + view->addAction(actionShowConsole); +#endif + + scriptingMenu = new QMenu(this); + scriptingMenu->setObjectName("scriptingMenu"); + connect(scriptingMenu, SIGNAL(aboutToShow()), this, SLOT(scriptingMenuAboutToShow())); + menuBar()->addMenu(scriptingMenu); + + graphMenu = new QMenu(this); + graphMenu->setObjectName("graphMenu"); + graphMenu->setCheckable(true); + menuBar()->addMenu(graphMenu); + + graphMenu->addAction(actionShowCurvesDialog); + graphMenu->addAction(actionAddFunctionCurve); + graphMenu->addAction(actionAddErrorBars); + graphMenu->addAction(actionNewLegend); + graphMenu->addSeparator(); + graphMenu->addAction(actionAddFormula); + graphMenu->addAction(actionAddText); + graphMenu->addAction(btnArrow); + graphMenu->addAction(btnLine); + graphMenu->addAction(actionAddRectangle); + graphMenu->addAction(actionAddEllipse); + graphMenu->addAction(actionTimeStamp); + graphMenu->addAction(actionAddImage); + graphMenu->addSeparator();//layers section + graphMenu->addAction(actionAddLayer); + graphMenu->addAction(actionAddInsetLayer); + graphMenu->addAction(actionAddInsetCurveLayer); + graphMenu->addAction(actionShowLayerDialog); + graphMenu->addAction(actionAutomaticLayout); + graphMenu->addSeparator(); + graphMenu->addAction(actionExtractLayers); + graphMenu->addAction(actionExtractGraphs); + graphMenu->addSeparator(); + graphMenu->addAction(actionDeleteLayer); + + plot3DMenu = new QMenu(this); + plot3DMenu->setObjectName("plot3DMenu"); + plot3DMenu->addAction(actionPlot3DWireFrame); + plot3DMenu->addAction(actionPlot3DHiddenLine); + plot3DMenu->addAction(actionPlot3DPolygons); + plot3DMenu->addAction(actionPlot3DWireSurface); + plot3DMenu->insertSeparator(); + plot3DMenu->addAction(actionPlot3DBars); + plot3DMenu->addAction(actionPlot3DScatter); + plot3DMenu->insertSeparator(); + plot3DMenu->addAction(actionColorMap); + plot3DMenu->addAction(actionContourMap); + plot3DMenu->addAction(actionGrayMap); + plot3DMenu->insertSeparator(); + plot3DMenu->addAction(actionImagePlot); + plot3DMenu->addAction(actionImageProfilesPlot); + plot3DMenu->insertSeparator(); + plot3DMenu->addAction(actionPlotHistogram); + menuBar()->addMenu(plot3DMenu); + + matrixMenu = new QMenu(this); + matrixMenu->setObjectName("matrixMenu"); + connect(matrixMenu, SIGNAL(aboutToShow()), this, SLOT(matrixMenuAboutToShow())); + menuBar()->addMenu(matrixMenu); + + plot2DMenu = new QMenu(this); + plot2DMenu->setObjectName("plot2DMenu"); + connect(plot2DMenu, SIGNAL(aboutToShow()), this, SLOT(plotMenuAboutToShow())); + menuBar()->addMenu(plot2DMenu); + + plotDataMenu = new QMenu(this); + plotDataMenu->setObjectName("plotDataMenu"); + plotDataMenu->setCheckable(true); + connect(plotDataMenu, SIGNAL(aboutToShow()), this, SLOT(plotDataMenuAboutToShow())); + menuBar()->addMenu(plotDataMenu); + + normMenu = new QMenu(this); + normMenu->setObjectName("normMenu"); + + fillMenu = new QMenu(); + fillMenu->setObjectName("fillMenu"); + + analysisMenu = new QMenu(this); + analysisMenu->setObjectName("analysisMenu"); + connect(analysisMenu, SIGNAL(aboutToShow()), this, SLOT(analysisMenuAboutToShow())); + menuBar()->addMenu(analysisMenu); + + tableMenu = new QMenu(this); + tableMenu->setObjectName("tableMenu"); + connect(tableMenu, SIGNAL(aboutToShow()), this, SLOT(tableMenuAboutToShow())); + menuBar()->addMenu(tableMenu); + + smoothMenu = new QMenu(this); + smoothMenu->setObjectName("smoothMenu"); + + filterMenu = new QMenu(this); + filterMenu->setObjectName("filterMenu"); + + decayMenu = new QMenu(this); + decayMenu->setObjectName("decayMenu"); + + multiPeakMenu = new QMenu(this); + multiPeakMenu->setObjectName("multiPeakMenu"); + + format = new QMenu(this); + format->setObjectName("formatMenu"); + menuBar()->addMenu(format); + + windowsMenu = new QMenu(this); + windowsMenu->setObjectName("windowsMenu"); + windowsMenu->setCheckable(true); + connect(windowsMenu, SIGNAL(aboutToShow()), this, SLOT(windowsMenuAboutToShow())); + menuBar()->addMenu(windowsMenu); + + foldersMenu = new QMenu(this); + foldersMenu->setCheckable(true); + + help = new QMenu(this); + help->setObjectName("helpMenu"); + menuBar()->addMenu(help); + + help->addAction(actionShowHelp); + help->addAction(actionChooseHelpFolder); + help->insertSeparator(); + help->addAction(actionHomePage); + help->addAction(actionCheckUpdates); + help->addAction(actionDownloadManual); + help->addAction(actionTranslations); + help->insertSeparator(); + help->addAction(actionTechnicalSupport); + help->addAction(actionDonate); + help->addAction(actionHelpForums); + help->addAction(actionHelpBugReports); + help->insertSeparator(); + help->addAction(actionAbout); + + QList menus; + menus << windowsMenu << view << graphMenu << fileMenu << format << edit; + menus << help << plot2DMenu << analysisMenu; + menus << matrixMenu << plot3DMenu << plotDataMenu << scriptingMenu; + menus << tableMenu << newMenu << exportPlotMenu << importMenu; + + foreach (QMenu *m, menus) + connect(m, SIGNAL(triggered(QAction *)), this, SLOT(performCustomAction(QAction *))); + + disableActions(); +} + +void ApplicationWindow::tableMenuAboutToShow() +{ + tableMenu->clear(); + fillMenu->clear(); + + QMenu *setAsMenu = tableMenu->addMenu(tr("Set Columns &As")); + setAsMenu->addAction(actionSetXCol); + setAsMenu->addAction(actionSetYCol); + setAsMenu->addAction(actionSetZCol); + setAsMenu->insertSeparator(); + setAsMenu->addAction(actionSetLabelCol); + setAsMenu->addAction(actionDisregardCol); + setAsMenu->insertSeparator(); + setAsMenu->addAction(actionSetXErrCol); + setAsMenu->addAction(actionSetYErrCol); + setAsMenu->insertSeparator(); + setAsMenu->addAction(tr("&Read-only"), this, SLOT(setReadOnlyColumns())); + setAsMenu->addAction(tr("Read/&Write"), this, SLOT(setReadWriteColumns())); + + tableMenu->addAction(actionShowColumnOptionsDialog); + tableMenu->insertSeparator(); + + tableMenu->addAction(actionShowColumnValuesDialog); + tableMenu->addAction(actionTableRecalculate); + + fillMenu->addAction(actionSetAscValues); + fillMenu->addAction(actionSetRandomValues); + tableMenu->addMenu (fillMenu); + + tableMenu->addAction(actionClearTable); + tableMenu->insertSeparator(); + tableMenu->addAction(actionAddColToTable); + tableMenu->addAction(actionShowColsDialog); + tableMenu->insertSeparator(); + tableMenu->addAction(actionHideSelectedColumns); + tableMenu->addAction(actionShowAllColumns); + tableMenu->addAction(actionAdjustColumnWidth); + tableMenu->insertSeparator(); + tableMenu->addAction(actionMoveColFirst); + tableMenu->addAction(actionMoveColLeft); + tableMenu->addAction(actionMoveColRight); + tableMenu->addAction(actionMoveColLast); + tableMenu->addAction(actionSwapColumns); + tableMenu->insertSeparator(); + tableMenu->addAction(actionShowRowsDialog); + tableMenu->addAction(actionDeleteRows); + + QMenu *moveRowMenu = tableMenu->addMenu(tr("Move Row")); + moveRowMenu->addAction(actionMoveRowUp); + moveRowMenu->addAction(actionMoveRowDown); + + tableMenu->insertSeparator(); + tableMenu->addAction(actionGoToRow); + tableMenu->addAction(actionGoToColumn); + tableMenu->addAction(actionExtractTableData); + tableMenu->insertSeparator(); + + QMenu *convertToMatrixMenu = tableMenu->addMenu(tr("Convert to &Matrix")); + convertToMatrixMenu->addAction(actionConvertTableDirect); + convertToMatrixMenu->addAction(actionConvertTableBinning); + convertToMatrixMenu->addAction(actionConvertTableRegularXYZ); + + reloadCustomActions(); +} + +void ApplicationWindow::plotDataMenuAboutToShow() +{ + plotDataMenu->clear(); + plotDataMenu->addAction(btnPointer); + plotDataMenu->insertSeparator(); + plotDataMenu->addAction(actionMagnify); + plotDataMenu->addAction(actionMagnifyHor); + plotDataMenu->addAction(actionMagnifyVert); + plotDataMenu->addAction(btnZoomIn); + plotDataMenu->addAction(btnZoomOut); + plotDataMenu->addAction(actionUnzoom); + plotDataMenu->insertSeparator(); + plotDataMenu->addAction(btnCursor); + plotDataMenu->addAction(btnSelect); + plotDataMenu->addAction(btnPicker); + plotDataMenu->insertSeparator(); + plotDataMenu->addAction(actionDrawPoints); + plotDataMenu->addAction(btnMovePoints); + plotDataMenu->addAction(btnRemovePoints); + plotDataMenu->addAction(actionDragCurve); + + reloadCustomActions(); +} + +void ApplicationWindow::plotMenuAboutToShow() +{ + plot2DMenu->clear(); + + plot2DMenu->addAction(actionPlotL); + plot2DMenu->addAction(actionPlotP); + plot2DMenu->addAction(actionPlotLP); + + QMenu *specialPlotMenu = plot2DMenu->addMenu (tr("Special Line/Symb&ol")); + specialPlotMenu->addAction(actionPlotVerticalDropLines); + specialPlotMenu->addAction(actionPlotSpline); + specialPlotMenu->addAction(actionPlotVertSteps); + specialPlotMenu->addAction(actionPlotHorSteps); + specialPlotMenu->insertSeparator(); + specialPlotMenu->addAction(actionPlotDoubleYAxis); + specialPlotMenu->addAction(actionWaterfallPlot); + specialPlotMenu->addAction(actionAddZoomPlot); + + plot2DMenu->insertSeparator(); + plot2DMenu->addAction(actionPlotVerticalBars); + plot2DMenu->addAction(actionPlotHorizontalBars); + QMenu *specialBarMenu = plot2DMenu->addMenu (tr("Spec&ial Bar/Column")); + specialBarMenu->addAction(actionStackBars); + specialBarMenu->addAction(actionStackColumns); + + plot2DMenu->addAction(actionPlotArea); + plot2DMenu->addAction(actionPlotPie); + plot2DMenu->addAction(actionPlotVectXYXY); + plot2DMenu->addAction(actionPlotVectXYAM); + plot2DMenu->insertSeparator(); + + QMenu *statMenu = plot2DMenu->addMenu (tr("Statistical &Graphs")); + statMenu->addAction(actionBoxPlot); + statMenu->addAction(actionPlotHistogram); + statMenu->addAction(actionPlotStackedHistograms); + statMenu->insertSeparator(); + statMenu->addAction(actionStemPlot); + + QMenu *panelsMenu = plot2DMenu->addMenu (tr("Pa&nel")); + panelsMenu->addAction(actionPlot2VerticalLayers); + panelsMenu->addAction(actionPlot2HorizontalLayers); + panelsMenu->addAction(actionPlot4Layers); + panelsMenu->addAction(actionPlotStackedLayers); + panelsMenu->addAction(actionCustomLayout); + + QMenu *gridMenu = plot2DMenu->addMenu (tr("Shared A&xes Panel")); + gridMenu->addAction(actionVertSharedAxisLayers); + gridMenu->addAction(actionHorSharedAxisLayers); + gridMenu->addAction(actionSharedAxesLayers); + gridMenu->addAction(actionStackSharedAxisLayers); + gridMenu->addAction(actionCustomSharedAxisLayers); + + QMenu *plot3D = plot2DMenu->addMenu (tr("3&D Plot")); + plot3D->addAction(actionPlot3DRibbon); + plot3D->addAction(actionPlot3DBars); + plot3D->addAction(actionPlot3DScatter); + plot3D->addAction(actionPlot3DTrajectory); + + reloadCustomActions(); +} + +void ApplicationWindow::customMenu(QMdiSubWindow* w) +{ + analysisMenu->menuAction()->setVisible(false); + tableMenu->menuAction()->setVisible(false); + plotDataMenu->menuAction()->setVisible(false); + graphMenu->menuAction()->setVisible(false); + matrixMenu->menuAction()->setVisible(false); + format->menuAction()->setVisible(false); + plot2DMenu->menuAction()->setVisible(false); + plot3DMenu->menuAction()->setVisible(false); +#ifndef SCRIPTING_PYTHON + scriptingMenu->menuAction()->setVisible(false); +#endif + + // these use the same keyboard shortcut (Ctrl+Return) and should not be enabled at the same time + actionNoteEvaluate->setEnabled(false); + actionTableRecalculate->setEnabled(false); + // these use the same keyboard shortcut (Alt+C) and should not be enabled at the same time + actionShowCurvesDialog->setEnabled(false); + actionAddColToTable->setEnabled(false); + // these use the same keyboard shortcut (Alt+Q) and should not be enabled at the same time + actionAddFormula->setEnabled(false); + actionShowColumnValuesDialog->setEnabled(false); + actionSetMatrixValues->setEnabled(false); + // these use the same keyboard shortcut (Ctrl+Alt+F) and should not be enabled at the same time + actionAddFunctionCurve->setEnabled(false); + actionFind->setEnabled(false); + + // clear undo stack view (in case window is not a matrix) + d_undo_view->setStack(0); + actionUndo->setEnabled(false); + actionRedo->setEnabled(false); + + actionCopyWindow->setEnabled(w); + actionPrint->setEnabled(w); + actionPrintPreview->setEnabled(w); + actionExportPDF->setEnabled(w); + + if(w){ + actionPrintAllPlots->setEnabled(projectHas2DPlots()); + actionPrint->setEnabled(true); + actionCutSelection->setEnabled(true); + actionCopySelection->setEnabled(true); + actionPasteSelection->setEnabled(true); + actionClearSelection->setEnabled(true); + actionSaveTemplate->setEnabled(true); + QStringList tables = tableNames() + matrixNames(); + if (!tables.isEmpty()) + actionShowExportASCIIDialog->setEnabled(true); + else + actionShowExportASCIIDialog->setEnabled(false); + + if (w->isA("MultiLayer")) { + actionAddFunctionCurve->setEnabled(true); + actionShowCurvesDialog->setEnabled(true); + actionAddFormula->setEnabled(true); + + graphMenu->menuAction()->setVisible(true); + plotDataMenu->menuAction()->setVisible(true); + analysisMenu->menuAction()->setVisible(true); + format->menuAction()->setVisible(true); + format->clear(); + format->addAction(actionShowPlotDialog); + format->insertSeparator(); + format->addAction(actionShowScaleDialog); + format->addAction(actionShowAxisDialog); + actionShowAxisDialog->setEnabled(true); + format->insertSeparator(); + format->addAction(actionShowGridDialog); + format->addAction(actionShowTitleDialog); + } else if (w->isA("Graph3D")) { + disableActions(); + + actionPrint->setEnabled(true); + actionSaveTemplate->setEnabled(true); + + format->menuAction()->setVisible(true); + format->clear(); + format->addAction(actionShowPlotDialog); + format->addAction(actionShowScaleDialog); + format->addAction(actionShowAxisDialog); + format->addAction(actionShowTitleDialog); + if (((Graph3D*)w)->coordStyle() == Qwt3D::NOCOORD) + actionShowAxisDialog->setEnabled(false); + } else if (w->inherits("Table")) { + plot2DMenu->menuAction()->setVisible(true); + analysisMenu->menuAction()->setVisible(true); + tableMenu->menuAction()->setVisible(true); + + actionTableRecalculate->setEnabled(true); + actionAddColToTable->setEnabled(true); + actionShowColumnValuesDialog->setEnabled(true); + } else if (w->isA("Matrix")){ + actionTableRecalculate->setEnabled(true); + actionSetMatrixValues->setEnabled(true); + + plot3DMenu->menuAction()->setVisible(true); + analysisMenu->menuAction()->setVisible(true); + matrixMenu->menuAction()->setVisible(true); + + d_undo_view->setEmptyLabel(w->objectName() + ": " + tr("Empty Stack")); + QUndoStack *stack = ((Matrix *)w)->undoStack(); + d_undo_view->setStack(stack); + } else if (qobject_cast(w)){ + #ifndef SCRIPTING_PYTHON + scriptingMenu->menuAction()->setVisible(true); + #endif + actionSaveTemplate->setEnabled(false); + actionNoteEvaluate->setEnabled(true); + actionFind->setEnabled(true); + } else + disableActions(); + } else + disableActions(); + + reloadCustomActions(); +} + +void ApplicationWindow::disableActions() +{ + actionSaveTemplate->setEnabled(false); + actionPrintAllPlots->setEnabled(false); + actionPrint->setEnabled(false); + + actionCutSelection->setEnabled(false); + actionCopySelection->setEnabled(false); + actionPasteSelection->setEnabled(false); + actionClearSelection->setEnabled(false); +} + +void ApplicationWindow::customColumnActions() +{ + actionAdjustColumnWidth->setEnabled(false); + actionMoveColFirst->setEnabled(false); + actionMoveColLeft->setEnabled(false); + actionMoveColRight->setEnabled(false); + actionMoveColLast->setEnabled(false); + actionSetXCol->setEnabled(false); + actionSetYCol->setEnabled(false); + actionSetZCol->setEnabled(false); + actionSetLabelCol->setEnabled(false); + actionSetYErrCol->setEnabled(false); + actionDisregardCol->setEnabled(false); + actionSwapColumns->setEnabled(false); + actionSetAscValues->setEnabled(false); + actionSetRandomValues->setEnabled(false); + + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + int selectedCols = t->selectedColsNumber(); + if (selectedCols == 1){ + int col = t->selectedColumn(); + if (col > 0){ + actionMoveColFirst->setEnabled(true); + actionMoveColLeft->setEnabled(true); + } + + if (col < t->numCols() - 1){ + actionMoveColRight->setEnabled(true); + actionMoveColLast->setEnabled(true); + } + } + + if (selectedCols >= 1){ + actionSetAscValues->setEnabled(true); + actionSetRandomValues->setEnabled(true); + actionSetXCol->setEnabled(true); + actionSetYCol->setEnabled(true); + actionSetZCol->setEnabled(true); + actionSetYErrCol->setEnabled(true); + actionSetLabelCol->setEnabled(true); + actionDisregardCol->setEnabled(true); + actionAdjustColumnWidth->setEnabled(true); + } + + if (selectedCols == 2) + actionSwapColumns->setEnabled(true); +} + +void ApplicationWindow::customToolBars(QMdiSubWindow* w) +{ + disableToolbars(); + if (!w) + return; + + if (w->isA("MultiLayer") && d_plot_tool_bar){ + if(!plotTools->isVisible()) + plotTools->show(); + plotTools->setEnabled (true); + custom2DPlotTools((MultiLayer *)w); + if(d_format_tool_bar && !formatToolBar->isVisible()){ + formatToolBar->setEnabled (true); + formatToolBar->show(); + } + } else if (w->inherits("Table")){ + if(d_table_tool_bar){ + if(!tableTools->isVisible()) + tableTools->show(); + tableTools->setEnabled (true); + } + if (d_column_tool_bar){ + if(!columnTools->isVisible()) + columnTools->show(); + columnTools->setEnabled (true); + customColumnActions(); + } + } else if (w->isA("Matrix") && d_matrix_tool_bar){ + if(!plotMatrixBar->isVisible()) + plotMatrixBar->show(); + plotMatrixBar->setEnabled (true); + } else if (w->isA("Graph3D") && d_plot3D_tool_bar){ + if(!plot3DTools->isVisible()) + plot3DTools->show(); + + plot3DTools->setEnabled(((Graph3D*)w)->plotStyle() != Qwt3D::NOPLOT); + custom3DActions(w); + } else if (w->isA("Note")){ + if(d_format_tool_bar && !formatToolBar->isVisible()) + formatToolBar->show(); + if(d_notes_tool_bar && !noteTools->isVisible()) + noteTools->show(); + + formatToolBar->setEnabled (true); + noteTools->setEnabled (true); + setFormatBarFont(((Note*)w)->currentEditor()->currentFont()); + } +} + +void ApplicationWindow::disableToolbars() +{ + plotTools->setEnabled(false); + tableTools->setEnabled(false); + columnTools->setEnabled(false); + plot3DTools->setEnabled(false); + plotMatrixBar->setEnabled(false); + noteTools->setEnabled(false); +} + +void ApplicationWindow::plot3DRibbon() +{ + MdiSubWindow *w = activeWindow(TableWindow); + if (!w) + return; + + Table *table = static_cast(w); + if(table->selectedColumns().count() == 1){ + if (!validFor3DPlot(table)) + return; + plotXYZ(table, table->colName(table->selectedColumn()), Graph3D::Ribbon); + } else + QMessageBox::warning(this, tr("QtiPlot - Plot error"), tr("You must select exactly one column for plotting!")); +} + +void ApplicationWindow::plot3DWireframe() +{ + plot3DMatrix (0, Qwt3D::WIREFRAME); +} + +void ApplicationWindow::plot3DHiddenLine() +{ + plot3DMatrix (0, Qwt3D::HIDDENLINE); +} + +void ApplicationWindow::plot3DPolygons() +{ + plot3DMatrix (0, Qwt3D::FILLED); +} + +void ApplicationWindow::plot3DWireSurface() +{ + plot3DMatrix (0, Qwt3D::FILLEDMESH); +} + +void ApplicationWindow::plot3DBars() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (w->inherits("Table")){ + Table *table = static_cast(w); + if (!validFor3DPlot(table)) + return; + + if(table->selectedColumns().count() == 1) + plotXYZ(table, table->colName(table->selectedColumn()), Graph3D::Bars); + else + QMessageBox::warning(this, tr("QtiPlot - Plot error"),tr("You must select exactly one column for plotting!")); + } + else if(w->inherits("Matrix")) + plot3DMatrix(0, Qwt3D::USER); +} + +void ApplicationWindow::plot3DScatter() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (w->inherits("Table")) + { + Table *table = static_cast
(w); + if (!validFor3DPlot(table)) + return; + + if(table->selectedColumns().count() == 1) + plotXYZ(table, table->colName(table->selectedColumn()), Graph3D::Scatter); + else + QMessageBox::warning(this, tr("QtiPlot - Plot error"),tr("You must select exactly one column for plotting!")); + } + else if(w->inherits("Matrix")) + plot3DMatrix (0, Qwt3D::POINTS); +} + +void ApplicationWindow::plot3DTrajectory() +{ + Table *table = (Table *)activeWindow(TableWindow); + if (!table) + return; + if (!validFor3DPlot(table)) + return; + + if(table->selectedColumns().count() == 1) + plotXYZ(table, table->colName(table->selectedColumn()), Graph3D::Trajectory); + else + QMessageBox::warning(this, tr("QtiPlot - Plot error"), tr("You must select exactly one column for plotting!")); +} + +void ApplicationWindow::plotBoxDiagram() +{ + generate2DGraph(Graph::Box); +} + +void ApplicationWindow::plotVerticalBars() +{ + generate2DGraph(Graph::VerticalBars); +} + +void ApplicationWindow::plotHorizontalBars() +{ + generate2DGraph(Graph::HorizontalBars); +} + +void ApplicationWindow::plotStackBar() +{ + generate2DGraph(Graph::StackBar); +} + +void ApplicationWindow::plotStackColumn() +{ + generate2DGraph(Graph::StackColumn); +} + +MultiLayer* ApplicationWindow::plotHistogram() +{ + return generate2DGraph(Graph::Histogram); +} + +MultiLayer* ApplicationWindow::plotHistogram(Matrix *m) +{ + if (!m){ + m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + } + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + MultiLayer* g = newGraph(); + if (g) + g->activeLayer()->addHistogram(m); + QApplication::restoreOverrideCursor(); + return g; +} + +void ApplicationWindow::plotArea() +{ + generate2DGraph(Graph::Area); +} + +void ApplicationWindow::plotPie() +{ + Table *table = (Table *)activeWindow(TableWindow); + if (!table) + return; + + if(table->selectedColumns().count() != 1){ + QMessageBox::warning(this, tr("QtiPlot - Plot error"), + tr("You must select exactly one column for plotting!")); + return; + } + + QStringList s = table->selectedColumns(); + if (s.count()>0){ + Q3TableSelection sel = table->getSelection(); + multilayerPlot(table, s, Graph::Pie, sel.topRow(), sel.bottomRow()); + } else + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select a column to plot!")); +} + +void ApplicationWindow::plotL() +{ + generate2DGraph(Graph::Line); +} + +void ApplicationWindow::plotP() +{ + generate2DGraph(Graph::Scatter); +} + +void ApplicationWindow::plotLP() +{ + generate2DGraph(Graph::LineSymbols); +} + +void ApplicationWindow::plotVerticalDropLines() +{ + generate2DGraph(Graph::VerticalDropLines); +} + +void ApplicationWindow::plotSpline() +{ + generate2DGraph(Graph::Spline); +} + +void ApplicationWindow::plotVertSteps() +{ + generate2DGraph(Graph::VerticalSteps); +} + +void ApplicationWindow::plotHorSteps() +{ + generate2DGraph(Graph::HorizontalSteps); +} + +void ApplicationWindow::plotVectXYXY() +{ + Table *table = (Table *)activeWindow(TableWindow); + if (!table) + return; + if (!validFor2DPlot(table, Graph::VectXYXY)) + return; + + QStringList s = table->selectedColumns(); + if (s.count() == 4) { + Q3TableSelection sel = table->getSelection(); + multilayerPlot(table, s, Graph::VectXYXY, sel.topRow(), sel.bottomRow()); + } else + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select four columns for this operation!")); +} + +void ApplicationWindow::plotVectXYAM() +{ + Table *table = (Table *)activeWindow(TableWindow); + if (!table) + return; + if (!validFor2DPlot(table, Graph::VectXYAM)) + return; + + QStringList s = table->selectedColumns(); + if (s.count() == 4){ + Q3TableSelection sel = table->getSelection(); + multilayerPlot(table, s, Graph::VectXYAM, sel.topRow(), sel.bottomRow()); + } else + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select four columns for this operation!")); +} + +void ApplicationWindow::renameListViewItem(const QString& oldName,const QString& newName) +{ + Q3ListViewItem *it=lv->findItem (oldName,0, Q3ListView::ExactMatch | Qt::CaseSensitive ); + if (it) + it->setText(0,newName); +} + +void ApplicationWindow::setListViewLabel(const QString& caption,const QString& label) +{ + Q3ListViewItem *it = lv->findItem ( caption, 0, Q3ListView::ExactMatch | Qt::CaseSensitive ); + if (it){ + QString s = label; + it->setText(5, s.replace("\n", " ")); + } +} + +void ApplicationWindow::setListViewDate(const QString& caption,const QString& date) +{ + Q3ListViewItem *it=lv->findItem ( caption, 0, Q3ListView::ExactMatch | Qt::CaseSensitive ); + if (it) + it->setText(4,date); +} + +void ApplicationWindow::setListView(const QString& caption,const QString& view) +{ + Q3ListViewItem *it=lv->findItem ( caption,0, Q3ListView::ExactMatch | Qt::CaseSensitive ); + if (it) + it->setText(2,view); +} + +void ApplicationWindow::setListViewSize(const QString& caption,const QString& size) +{ + Q3ListViewItem *it=lv->findItem ( caption,0, Q3ListView::ExactMatch | Qt::CaseSensitive ); + if (it) + it->setText(3,size); +} + +QString ApplicationWindow::listViewDate(const QString& caption) +{ + Q3ListViewItem *it=lv->findItem (caption,0, Q3ListView::ExactMatch | Qt::CaseSensitive ); + if (it) + return it->text(4); + else + return ""; +} + +void ApplicationWindow::updateTableNames(const QString& oldName, const QString& newName) +{ + QList windows = windowsList(); + foreach (MdiSubWindow *w, windows) { + if (w->isA("MultiLayer")) { + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers) + g->updateCurveNames(oldName, newName); + } else if (w->isA("Graph3D")) { + QString name = ((Graph3D*)w)->formula(); + if (name.contains(oldName, true)) { + name.replace(oldName,newName); + ((Graph3D*)w)->setPlotAssociation(name); + } + } + } +} + +void ApplicationWindow::updateColNames(const QString& oldName, const QString& newName) +{ + QList windows = windowsList(); + foreach (MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")){ + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers) + g->updateCurveNames(oldName, newName, false); + } + else if (w->isA("Graph3D")){ + QString name = ((Graph3D*)w)->formula(); + if (name.contains(oldName)){ + name.replace(oldName,newName); + ((Graph3D*)w)->setPlotAssociation(name); + } + } + } +} + +void ApplicationWindow::changeMatrixName(const QString& oldName, const QString& newName) +{ + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("Graph3D")) + { + QString s = ((Graph3D*)w)->formula(); + if (s.contains(oldName)) + { + s.replace(oldName, newName); + ((Graph3D*)w)->setPlotAssociation(s); + } + } + else if (w->isA("MultiLayer")) + { + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers){ + for (int i=0; icurveCount(); i++){ + QwtPlotItem *sp = (QwtPlotItem *)g->plotItem(i); + if (sp && sp->rtti() == QwtPlotItem::Rtti_PlotSpectrogram && sp->title().text() == oldName) + sp->setTitle(newName); + } + } + } + } +} + +void ApplicationWindow::remove3DMatrixPlots(Matrix *m) +{ + if (!m) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("Graph3D") && ((Graph3D*)w)->matrix() == m) + ((Graph3D*)w)->clearData(); + else if (w->isA("MultiLayer")){ + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers){ + QList curvesList = g->curvesList(); + foreach (QwtPlotItem *it, curvesList){ + if (it->rtti() == QwtPlotItem::Rtti_PlotSpectrogram){ + if (((Spectrogram *)it)->matrix() == m) + g->removeCurve(it); + } else if (((PlotCurve *)it)->type() == Graph::Histogram){ + if (((QwtHistogram *)it)->matrix() == m) + g->removeCurve(it); + } + } + g->updatePlot(); + } + } + } + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::updateMatrixPlots(Matrix *m) +{ + if (!m) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("Graph3D") && ((Graph3D*)w)->matrix() == m) + ((Graph3D*)w)->updateMatrixData(m); + else if (w->isA("MultiLayer")){ + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers){ + QList curvesList = g->curvesList(); + foreach (QwtPlotItem *it, curvesList){ + if (it->rtti() == QwtPlotItem::Rtti_PlotSpectrogram){ + Spectrogram *sp = (Spectrogram *)it; + if (sp->matrix() == m){ + sp->updateData(); + g->updatePlot(); + } + } else if (((PlotCurve *)it)->type() == Graph::Histogram){ + QwtHistogram *h = (QwtHistogram *)it; + if (h->matrix() == m){ + h->loadData(); + g->updatePlot(); + } + } + } + } + } + } + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::add3DData() +{ + if (!hasTable()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no tables available in this project.

" + "

Please create a table and try again!

")); + return; + } + + QStringList zColumns = columnsList(Table::Z); + if ((int)zColumns.count() <= 0){ + QMessageBox::critical(this,tr("QtiPlot - Warning"), + tr("There are no available columns with plot designation set to Z!")); + return; + } + + bool ok; + QString column = QInputDialog::getItem(this, tr("QtiPlot - Choose data set"), + tr("Column") + ": ", zColumns, 0, false, &ok); + if (ok && !column.isEmpty()) + insertNew3DData(column); +} + +void ApplicationWindow::change3DData() +{ + bool ok; + QString column = QInputDialog::getItem(this, tr("QtiPlot - Choose data set"), + tr("Column") + ": ", columnsList(Table::Z), 0, false, &ok); + if (ok && !column.isEmpty()) + change3DData(column); +} + +void ApplicationWindow::change3DMatrix() +{ + QStringList matrices = matrixNames(); + int currentIndex = 0; + Graph3D* g = (Graph3D*)activeWindow(Plot3DWindow); + if (g && g->matrix()) + currentIndex = matrices.indexOf(g->matrix()->objectName()); + + bool ok; + QString matrixName = QInputDialog::getItem(this, tr("QtiPlot - Choose matrix to plot"), + tr("Matrix") + ": ", matrices, currentIndex, false, &ok); + if (ok && !matrixName.isEmpty()) + change3DMatrix(matrixName); +} + +void ApplicationWindow::change3DMatrix(const QString& matrix_name) +{ + Graph3D *g = (Graph3D*)activeWindow(Plot3DWindow); + if (!g) + return; + + Matrix *m = matrix(matrix_name); + if (!m) + return; + + if (d_3D_autoscale) + g->addMatrixData(m); + else + g->addMatrixData(m, g->xStart(), g->xStop(), g->yStart(), g->yStop(), g->zStart(), g->zStop()); + + emit modified(); +} + +void ApplicationWindow::add3DMatrixPlot() +{ + QStringList matrices = matrixNames(); + if ((int)matrices.count() <= 0){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), + tr("

There are no matrices available in this project.

" + "

Please create a matrix and try again!

")); + return; + } + + bool ok; + QString matrixName = QInputDialog::getItem(this, tr("QtiPlot - Choose matrix to plot"), + tr("Matrix") + ": ", matrices, 0, false, &ok); + if (ok && !matrixName.isEmpty()) + insert3DMatrixPlot(matrixName); +} + +void ApplicationWindow::insert3DMatrixPlot(const QString& matrix_name) +{ + Graph3D *g = (Graph3D*)activeWindow(Plot3DWindow); + if (!g) + return; + + g->addMatrixData(matrix(matrix_name)); + emit modified(); +} + +void ApplicationWindow::insertNew3DData(const QString& colName) +{ + Graph3D *g = (Graph3D*)activeWindow(Plot3DWindow); + if (!g) + return; + + g->insertNewData(table(colName),colName); + emit modified(); +} + +void ApplicationWindow::change3DData(const QString& colName) +{ + Graph3D *g = (Graph3D*)activeWindow(Plot3DWindow); + if (!g) + return; + + g->changeDataColumn(table(colName), colName, g->tablePlotType()); + emit modified(); +} + +void ApplicationWindow::editSurfacePlot() +{ + Graph3D *g = (Graph3D*)activeWindow(Plot3DWindow); + if (!g) + return; + + SurfaceDialog* sd = new SurfaceDialog(this); + sd->setAttribute(Qt::WA_DeleteOnClose); + + if (g->hasData() && g->userFunction()) + sd->setFunction(g); + else if (g->hasData() && g->parametricSurface()) + sd->setParametricSurface(g); + else + sd->setGraph(g); + sd->exec(); +} + +void ApplicationWindow::newSurfacePlot() +{ + SurfaceDialog* sd = new SurfaceDialog(this); + sd->setAttribute(Qt::WA_DeleteOnClose); + sd->exec(); +} + +Graph3D* ApplicationWindow::plotSurface(const QString& formula, double xl, double xr, + double yl, double yr, double zl, double zr, int columns, int rows) +{ + Graph3D *plot = newPlot3D(); + if(!plot) + return 0; + + plot->addFunction(formula, xl, xr, yl, yr, zl, zr, columns, rows); + plot->setDataColorMap(d_3D_color_map); + plot->update(); + + emit modified(); + return plot; +} + +Graph3D* ApplicationWindow::plotParametricSurface(const QString& xFormula, const QString& yFormula, + const QString& zFormula, double ul, double ur, double vl, double vr, + int columns, int rows, bool uPeriodic, bool vPeriodic) +{ + Graph3D *plot = newPlot3D(); + if(!plot) + return 0; + plot->addParametricSurface(xFormula, yFormula, zFormula, ul, ur, vl, vr, + columns, rows, uPeriodic, vPeriodic); + plot->setDataColorMap(d_3D_color_map); + plot->update(); + + emit modified(); + return plot; +} + +void ApplicationWindow::updateSurfaceFuncList(const QString& s) +{ + surfaceFunc.remove(s); + surfaceFunc.push_front(s); + while ((int)surfaceFunc.size() > 10) + surfaceFunc.pop_back(); +} + +Graph3D* ApplicationWindow::addRibbon(const QString& caption, const QString& formula, + double xl, double xr, double yl, double yr, double zl, double zr) +{ + Table* t = table(formula.left(formula.find("_", 0))); + if (!t) + return 0; + + QString s = formula; + s.remove("(X)").remove("(Y)"); + QStringList l = s.split(","); + if (l.size() != 2) + return 0; + + Graph3D *plot = newPlot3D(caption); + if(!plot) + return 0; + + plot->addRibbon(t, l[0], l[1], xl, xr, yl, yr, zl, zr); + plot->setDataColorMap(d_3D_color_map); + plot->update(); + + return plot; +} + +Graph3D* ApplicationWindow::newPlot3D(const QString& title) +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QString label = title; + if (label.isEmpty() || alreadyUsedName(label)) + label = generateUniqueName(tr("Graph")); + + Graph3D *plot = new Graph3D("", this, 0); + plot->setWindowTitle(label); + plot->setName(label); + + initPlot3D(plot); + + emit modified(); + QApplication::restoreOverrideCursor(); + return plot; +} + +Graph3D* ApplicationWindow::plotXYZ(Table* table, const QString& zColName, int type) +{ + int zCol = table->colIndex(zColName); + if (zCol < 0) + return 0; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + Graph3D *plot = newPlot3D(); + if(!plot) + return 0; + + if (type == Graph3D::Ribbon) { + int ycol = table->colIndex(zColName); + plot->addRibbon(table, table->colName(table->colX(ycol)), zColName); + } else + plot->addData(table, table->colX(zCol), table->colY(zCol), zCol, type); + + plot->setDataColorMap(d_3D_color_map); + plot->update(); + + emit modified(); + QApplication::restoreOverrideCursor(); + return plot; +} + +void ApplicationWindow::initPlot3D(Graph3D *plot) +{ + if (d_mdi_windows_area) + d_workspace->addSubWindow(plot); + else + plot->setParent(0); + + connectSurfacePlot(plot); + + plot->setIcon(QPixmap(":/trajectory.png")); + plot->show(); + plot->setFocus(); + + addListViewItem(plot); + + if (!plot3DTools->isVisible()) + plot3DTools->show(); + + if (!plot3DTools->isEnabled()) + plot3DTools->setEnabled(true); + + customMenu(plot); + customToolBars(plot); +} + +void ApplicationWindow::exportMatrix(const QString& exportFilter) +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + ImageExportDialog *ied = new ImageExportDialog(m, this, d_extended_export_dialog); + ied->setDir(imagesDirPath); + ied->selectFile(m->objectName()); + if (exportFilter.isEmpty()) + ied->selectFilter(d_image_export_filter); + else + ied->selectFilter(exportFilter); + + if ( ied->exec() != QDialog::Accepted ) + return; + imagesDirPath = ied->directory().path(); + + QString selected_filter = ied->selectedFilter().remove("*"); + QString file_name = ied->selectedFiles()[0]; + if(!file_name.endsWith(selected_filter, Qt::CaseInsensitive)) + file_name.append(selected_filter); + + if (selected_filter.contains(".eps") || selected_filter.contains(".pdf") || selected_filter.contains(".ps")) + m->exportVector(file_name, ied->vectorResolution(), ied->color()); + else if (selected_filter.contains(".svg")) + m->exportSVG(file_name); +#ifdef EMF_OUTPUT + else if (selected_filter.contains(".emf")) + m->exportEMF(file_name); +#endif + else if (selected_filter.contains(".odf")) + m->exportRasterImage(file_name, ied->quality(), ied->bitmapResolution()); + else { + QList list = QImageWriter::supportedImageFormats(); + for (int i=0; i<(int)list.count(); i++){ + if (selected_filter.contains("." + (list[i]).lower())) + m->exportRasterImage(file_name, ied->quality(), ied->bitmapResolution()); + } + } +} + +Matrix* ApplicationWindow::importImage(const QString& fileName, bool newWindow) +{ + QString fn = fileName; + if (fn.isEmpty()){ + fn = getFileName(this, tr("QtiPlot - Import image from file"), imagesDirPath, imageFilter(), 0, false); + if ( !fn.isEmpty() ){ + QFileInfo fi(fn); + imagesDirPath = fi.dirPath(true); + } + } + + QImage image(fn); + if (image.isNull()) + return 0; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + MdiSubWindow *w = activeWindow(MatrixWindow); + Matrix* m = NULL; + if (w && !newWindow){ + m = (Matrix *)w; + m->importImage(fn); + } else { + m = new Matrix(scriptEnv, image, "", this); + initMatrix(m, generateUniqueName(tr("Matrix"))); + m->show(); + m->setWindowLabel(fn); + m->setCaptionPolicy(MdiSubWindow::Both); + } + + QApplication::restoreOverrideCursor(); + return m; +} + +QString ApplicationWindow::imageFilter() +{ + QList list = QImageReader::supportedImageFormats(); + QString filter = tr("Images") + " (", aux1, aux2; + for (int i = 0; i < (int)list.count(); i++){ + aux1 = " *." + list[i] + " "; + aux2 += " *." + list[i] + ";;"; + filter += aux1; + } + filter += ");;" + aux2; + return filter; +} + +void ApplicationWindow::loadImage() +{ + QString fn = getFileName(this, tr("QtiPlot - Load image from file"), imagesDirPath, imageFilter(), 0, false); + if ( !fn.isEmpty() ){ + loadImage(fn); + QFileInfo fi(fn); + imagesDirPath = fi.dirPath(true); + } +} + +void ApplicationWindow::loadImage(const QString& fn) +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + MultiLayer *plot = multilayerPlot(generateUniqueName(tr("Graph"))); + plot->setWindowLabel(fn); + plot->setCaptionPolicy(MdiSubWindow::Both); + + Graph *g = plot->activeLayer(); + g->setTitle(""); + for (int i=0; i<4; i++) + g->enableAxis(i, false); + g->addImage(fn); + QApplication::restoreOverrideCursor(); +} + +MultiLayer* ApplicationWindow::multilayerPlot(const QString& caption, int layers, int rows, int cols) +{ + MultiLayer* ml = new MultiLayer(this, layers, rows, cols); + initMultilayerPlot(ml, caption); + return ml; +} + +MultiLayer* ApplicationWindow::newGraph(const QString& caption) +{ + MultiLayer *ml = multilayerPlot(generateUniqueName(caption)); + if (ml){ + Graph *g = ml->activeLayer(); + if (g){ + setPreferences(g); + g->newLegend(); + } + ml->arrangeLayers(false, true); + } + + return ml; +} + +MultiLayer* ApplicationWindow::multilayerPlot(Table* w, const QStringList& colList, int style, int startRow, int endRow) +{//used when plotting selected columns + if (!w) + return 0; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + MultiLayer* g = multilayerPlot(generateUniqueName(tr("Graph"))); + Graph *ag = g->activeLayer(); + if (!ag) + return 0; + + setPreferences(ag); + ag->addCurves(w, colList, style, defaultCurveLineWidth, defaultSymbolSize, startRow, endRow); + ag->newLegend(); + + g->arrangeLayers(false, true); + QApplication::restoreOverrideCursor(); + return g; +} + +MultiLayer* ApplicationWindow::multilayerPlot(int c, int r, int style, const MultiLayer::AlignPolicy& align) +{//used when plotting from the panel menu + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return 0; + + if (!validFor2DPlot(t, (Graph::CurveType)style)) + return 0; + + QStringList list = t->drawableColumnSelection(); + if((int)list.count() < 1) { + QMessageBox::warning(this, tr("QtiPlot - Plot error"), tr("Please select a Y column to plot!")); + return 0; + } + + int curves = list.count(); + if (r < 0) + r = curves; + + int layers = c*r; + MultiLayer* g = multilayerPlot(generateUniqueName(tr("Graph")), layers, r, c); + QList layersList = g->layersList(); + int i = 0; + foreach(Graph *ag, layersList){ + setPreferences(ag); + if (i < curves){ + QStringList lst = QStringList() << list[i]; + for (int j = 0; j < curves; j++){ + int col = t->colIndex(list[j]); + if (t->colPlotDesignation(col) == Table::xErr || + t->colPlotDesignation(col) == Table::yErr || + t->colPlotDesignation(col) == Table::Label){ + lst << list[j]; + } + } + ag->addCurves(t, lst, style, defaultCurveLineWidth, defaultSymbolSize); + } + i++; + } + + if (align == MultiLayer::AlignCanvases){ + g->setAlignPolicy(align); + g->setSpacing(0, 0); + g->setCommonLayerAxes(); + connect(layersList.last(), SIGNAL(updatedLayout(Graph *)), g, SLOT(updateLayersLayout(Graph *))); + } else { + g->arrangeLayers(false, true); + foreach(Graph *ag, layersList){ + if (ag->curveCount()) + ag->newLegend(); + } + } + return g; +} + +MultiLayer* ApplicationWindow::waterfallPlot() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return 0; + + return waterfallPlot(t, t->selectedYColumns()); +} + +MultiLayer* ApplicationWindow::waterfallPlot(Table *t, const QStringList& list) +{ + if (!t) + return 0; + + int curves = list.count(); + if(curves < 1){ + QMessageBox::warning(this, tr("QtiPlot - Plot error"), + tr("Please select a Y column to plot!")); + return 0; + } + + MultiLayer* ml = new MultiLayer(this, curves, 1, 1); + QList layersList = ml->layersList(); + int i = 0; + foreach(Graph *g, layersList){ + DataCurve *cv = g->insertCurve(t, list[i], Graph::Line); + if (cv) + cv->setPen(QPen(d_indexed_colors[i], defaultCurveLineWidth)); + i++; + } + QString legend = QString(); + initMultilayerPlot(ml, QString()); + foreach(Graph *g, layersList){ + g->hide(); + legend += g->legendText(true) + "\n"; + setPreferences(g); + g->setCanvasFrame(0); + g->setTitle(QString::null); + g->setMargin(0); + g->setFrame(0); + g->raise(); + } + + ml->setWaterfallLayout(); + Graph *g = layersList.last(); + if (g) + g->newLegend(legend.trimmed())->move(QPoint(5, 5)); + return ml; +} + +void ApplicationWindow::initMultilayerPlot(MultiLayer* g, const QString& name) +{ + QString label = name; + while(alreadyUsedName(label)) + label = generateUniqueName(tr("Graph")); + + g->setWindowTitle(label); + g->setName(label); + g->setIcon(QPixmap(":/graph.png")); + g->setScaleLayersOnPrint(d_scale_plots_on_print); + g->printCropmarks(d_print_cropmarks); + + if (d_mdi_windows_area) + d_workspace->addSubWindow(g); + else + g->setParent(0); + + connectMultilayerPlot(g); + g->showNormal(); + + addListViewItem(g); +} + +void ApplicationWindow::setAutoUpdateTableValues(bool on) +{ + if (d_auto_update_table_values == on) + return; + + d_auto_update_table_values = on; + + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->inherits("Table")) + ((Table *)w)->setAutoUpdateValues(d_auto_update_table_values); + } + f = f->folderBelow(); + } +} + +void ApplicationWindow::customTable(Table* w) +{ + QColorGroup cg; + cg.setColor(QColorGroup::Base, tableBkgdColor); + cg.setColor(QColorGroup::Text, tableTextColor); + w->setPalette(QPalette(cg, cg, cg)); + + w->setHeaderColor(tableHeaderColor); + w->setTextFont(tableTextFont); + w->setHeaderFont(tableHeaderFont); + w->showComments(d_show_table_comments); + w->setNumericPrecision(d_decimal_digits); +} + +void ApplicationWindow::setPreferences(Graph* g) +{ + if (!g) + return; + + if (!g->isPiePlot()){ + for (int i = 0; i < QwtPlot::axisCnt; i++){ + bool show = d_show_axes[i]; + g->enableAxis(i, show); + if(show){ + ScaleDraw *sd = (ScaleDraw *)g->axisScaleDraw (i); + sd->enableComponent(QwtAbstractScaleDraw::Labels, d_show_axes_labels[i]); + sd->setSpacing(d_graph_tick_labels_dist); + if (i == QwtPlot::yRight && !d_show_axes_labels[i]) + g->setAxisTitle(i, tr(" ")); + } + } + + g->updateSecondaryAxis(QwtPlot::xTop); + g->updateSecondaryAxis(QwtPlot::yRight); + + QList ticksList; + ticksList<setMajorTicksType(ticksList); + ticksList.clear(); + ticksList<setMinorTicksType(ticksList); + + g->setTicksLength (minTicksLength, majTicksLength); + g->setAxesLinewidth(axesLineWidth); + g->drawAxesBackbones(drawBackbones); + g->setCanvasFrame(canvasFrameWidth, d_canvas_frame_color); + for (int i = 0; i < QwtPlot::axisCnt; i++) + g->setAxisTitleDistance(i, d_graph_axes_labels_dist); + } + + g->setAxisTitlePolicy(d_graph_axis_labeling); + g->setSynchronizedScaleDivisions(d_synchronize_graph_scales); + g->initFonts(plotAxesFont, plotNumbersFont); + g->initTitle(titleOn, plotTitleFont); + + g->setMargin(defaultPlotMargin); + g->enableAutoscaling(autoscale2DPlots); + g->setAutoscaleFonts(autoScaleFonts); + g->setAntialiasing(antialiasing2DPlots); + g->setFrame(d_graph_border_width, d_graph_border_color); + + QColor c = d_graph_background_color; + c.setAlpha(d_graph_background_opacity); + g->setBackgroundColor(c); + + c = d_graph_canvas_color; + c.setAlpha(d_graph_canvas_opacity); + g->setCanvasBackground(c); +} + +/* + * return the current Plot (used for the Python interface) + */ +MultiLayer* ApplicationWindow::currentPlot() +{ + MultiLayer* p = (MultiLayer*)activeWindow(MultiLayerWindow); + return p; +} + +/* + * return the current Table (used for the Python interface) + */ +Table* ApplicationWindow::currentTable() +{ + Table* w = (Table*)activeWindow(TableWindow); + return w; +} + +/* + *creates a new empty table + */ +Table* ApplicationWindow::newTable() +{ + Table* w = new Table(scriptEnv, 30, 2, "", this, 0); + initTable(w, generateUniqueName(tr("Table"))); + w->showNormal(); + return w; +} + +/* + *used when opening a project file + */ +Table* ApplicationWindow::newTable(const QString& caption, int r, int c) +{ + Table* w = new Table(scriptEnv, r, c, "", this, 0); + initTable(w, caption); + if (d_is_appending_file && w->objectName() != caption){//the table was renamed + renamedTables << caption << w->objectName(); + if (d_inform_rename_table){ + QApplication::restoreOverrideCursor(); + QMessageBox:: warning(this, tr("QtiPlot - Renamed Window"), + tr("The table '%1' already exists. It has been renamed '%2'.").arg(caption).arg(w->objectName())); + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + } + } + w->showNormal(); + return w; +} + +Table* ApplicationWindow::newTable(int r, int c, const QString& name, const QString& legend) +{ + Table* w = new Table(scriptEnv, r, c, legend, this, 0); + initTable(w, name); + return w; +} + +Table* ApplicationWindow::newHiddenTable(const QString& name, const QString& label, int r, int c, const QString& text) +{ + Table* w = new Table(scriptEnv, r, c, label, this, 0); + + if (!text.isEmpty()) { + QStringList rows = text.split("\n", QString::SkipEmptyParts); + QStringList list = rows[0].split("\t"); + w->setHeader(list); + + QString rlist; + for (int i=0; isetText(i, j, list[j]); + } + } + + initTable(w, name); + hideWindow(w); + return w; +} + +void ApplicationWindow::initTable(Table* w, const QString& caption) +{ + QString name = caption; + name = name.replace ("_","-"); + + while(name.isEmpty() || alreadyUsedName(name)) + name = generateUniqueName(tr("Table")); + + if (d_mdi_windows_area) + d_workspace->addSubWindow(w); + else + w->setParent(0); + + connectTable(w); + customTable(w); + + w->setName(name); + w->setIcon(QPixmap(":/worksheet.png") ); + addListViewItem(w); +} + +/* + * !creates a new table with type statistics on target columns/rows of table base + */ +TableStatistics *ApplicationWindow::newTableStatistics(Table *base, int type, QList target, const QString &caption) +{ + TableStatistics* s = new TableStatistics(scriptEnv, this, base, (TableStatistics::Type) type, target); + if (caption.isEmpty()) + initTable(s, s->objectName()); + else + initTable(s, caption); + s->showNormal(); + return s; +} + +/* + * return the current note (used for the Python interface) + */ +Note* ApplicationWindow::currentNote() +{ + Note* m = (Note*)activeWindow(NoteWindow); + return m; +} + +/* + *creates a new empty note window + */ +Note* ApplicationWindow::newNote(const QString& caption) +{ + Note* m = new Note(scriptEnv, "", this); + + QString name = caption; + while(name.isEmpty() || alreadyUsedName(name)) + name = generateUniqueName(tr("Notes")); + + m->setName(name); + m->setIcon(QPixmap(":/note.png")); + m->askOnCloseEvent(confirmCloseNotes); + + if (d_mdi_windows_area) + d_workspace->addSubWindow(m); + else + m->setParent(0); + + addListViewItem(m); + + connect(m, SIGNAL(modifiedWindow(MdiSubWindow*)), this, SLOT(modifiedProject(MdiSubWindow*))); + connect(m, SIGNAL(resizedWindow(MdiSubWindow*)),this,SLOT(modifiedProject(MdiSubWindow*))); + connect(m, SIGNAL(closedWindow(MdiSubWindow*)), this, SLOT(closeWindow(MdiSubWindow*))); + connect(m, SIGNAL(hiddenWindow(MdiSubWindow*)), this, SLOT(hideWindow(MdiSubWindow*))); + connect(m, SIGNAL(statusChanged(MdiSubWindow*)), this, SLOT(updateWindowStatus(MdiSubWindow*))); + connect(m, SIGNAL(dirPathChanged(const QString&)), this, SLOT(scriptsDirPathChanged(const QString&))); + connect(m, SIGNAL(currentEditorChanged()), this, SLOT(scriptingMenuAboutToShow())); + + m->showNormal(); + return m; +} + +void ApplicationWindow::connectScriptEditor(ScriptEdit *editor) +{ + if (!editor) + return; + + QTextDocument *doc = editor->document(); + actionUndo->setEnabled(doc->isUndoAvailable()); + actionRedo->setEnabled(doc->isRedoAvailable()); + + connect(editor, SIGNAL(undoAvailable(bool)), actionUndo, SLOT(setEnabled(bool))); + connect(editor, SIGNAL(redoAvailable(bool)), actionRedo, SLOT(setEnabled(bool))); +} + +/* + * return the current Matrix (used for the Python interface) + */ +Matrix* ApplicationWindow::currentMatrix() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + return m; +} + +Matrix* ApplicationWindow::newMatrix(int rows, int columns) +{ + Matrix* m = new Matrix(scriptEnv, rows, columns, "", this, 0); + initMatrix(m, generateUniqueName(tr("Matrix"))); + m->showNormal(); + return m; +} + +Matrix* ApplicationWindow::newMatrix(const QString& caption, int r, int c) +{ + Matrix* w = new Matrix(scriptEnv, r, c, "", this, 0); + initMatrix(w, caption); + if (d_is_appending_file && w->objectName() != caption){//the matrix was renamed + renamedTables << caption << w->objectName(); + if (d_inform_rename_table){ + QApplication::restoreOverrideCursor(); + QMessageBox:: warning(this, tr("QtiPlot - Renamed Window"), + tr("The table '%1' already exists. It has been renamed '%2'.").arg(caption).arg(w->objectName())); + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + } + } + + w->showNormal(); + return w; +} + +void ApplicationWindow::viewMatrixImage() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + m->undoStack()->push(new MatrixSetViewCommand(m, m->viewType(), Matrix::ImageView, tr("Set Image Mode"))); + m->setViewType(Matrix::ImageView); + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::viewMatrixTable() +{ + Matrix* m = static_cast(activeWindow(MatrixWindow)); + if (!m) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + m->undoStack()->push(new MatrixSetViewCommand(m, m->viewType(), Matrix::TableView, tr("Set Data Mode"))); + m->setViewType(Matrix::TableView); + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::viewMatrixXY() +{ + Matrix* m = static_cast(activeWindow(MatrixWindow)); + if (!m) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + m->undoStack()->push(new MatrixSetHeaderViewCommand(m, m->headerViewType(), Matrix::XY, tr("Show X/Y"))); + m->setHeaderViewType(Matrix::XY); + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::viewMatrixColumnRow() +{ + Matrix* m = static_cast(activeWindow(MatrixWindow)); + if (!m) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + m->undoStack()->push(new MatrixSetHeaderViewCommand(m, m->headerViewType(), Matrix::ColumnRow, tr("Show Column/Row"))); + m->setHeaderViewType(Matrix::ColumnRow); + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::setMatrixDefaultScale() +{ + Matrix* m = static_cast(activeWindow(MatrixWindow)); + if (!m) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + m->undoStack()->push(new MatrixSetColorMapCommand(m, m->colorMapType(), m->colorMap(), + Matrix::Default, QwtLinearColorMap(), tr("Set Default Palette"))); + m->setDefaultColorMap(); + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::setMatrixGrayScale() +{ + Matrix* m = static_cast(activeWindow(MatrixWindow)); + if (!m) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + m->undoStack()->push(new MatrixSetColorMapCommand(m, m->colorMapType(), m->colorMap(), + Matrix::GrayScale, QwtLinearColorMap(), tr("Set Gray Scale Palette"))); + m->setGrayScale(); + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::setMatrixRainbowScale() +{ + Matrix* m = static_cast(activeWindow(MatrixWindow)); + if (!m) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + m->undoStack()->push(new MatrixSetColorMapCommand(m, m->colorMapType(), m->colorMap(), + Matrix::Rainbow, QwtLinearColorMap(), tr("Set Rainbow Palette"))); + m->setRainbowColorMap(); + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::showColorMapDialog() +{ + Matrix* m = static_cast(activeWindow(MatrixWindow)); + if (!m) + return; + + ColorMapDialog *cmd = new ColorMapDialog(this); + cmd->setAttribute(Qt::WA_DeleteOnClose); + cmd->setMatrix(m); + cmd->exec(); +} + +void ApplicationWindow::transposeMatrix() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + m->transpose(); +} + +void ApplicationWindow::flipMatrixVertically() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + m->flipVertically(); +} + +void ApplicationWindow::flipMatrixHorizontally() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + m->flipHorizontally(); +} + +void ApplicationWindow::rotateMatrix90() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + m->rotate90(); +} + +void ApplicationWindow::rotateMatrixMinus90() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + m->rotate90(false); +} + +void ApplicationWindow::matrixDeterminant() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + QDateTime dt = QDateTime::currentDateTime (); + QString info=dt.toString(Qt::LocalDate); + info+= "\n" + tr("Determinant of ") + QString(m->objectName()) + ":\t"; + info+= "det = " + QString::number(m->determinant()) + "\n"; + info+="-------------------------------------------------------------\n"; + + current_folder->appendLogInfo(info); + + showResults(true); +} + +void ApplicationWindow::invertMatrix() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + m->invert(); +} + +Table* ApplicationWindow::convertMatrixToTableDirect() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + + return matrixToTable(m, Direct); +} + +Table* ApplicationWindow::convertMatrixToTableXYZ() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + + return matrixToTable(m, XYZ); +} + +Table* ApplicationWindow::convertMatrixToTableYXZ() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + + return matrixToTable(m, YXZ); +} + +Table* ApplicationWindow::matrixToTable(Matrix* m, MatrixToTableConversion conversionType) +{ + if (!m) + return 0; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + int rows = m->numRows(); + int cols = m->numCols(); + MatrixModel *mModel = m->matrixModel(); + + Table* w = NULL; + if (conversionType == Direct){ + w = new Table(scriptEnv, rows, cols, "", this, 0); + for (int i = 0; isetCell(i, j, m->cell(i,j)); + } + } else if (conversionType == XYZ){ + int tableRows = rows*cols; + w = new Table(scriptEnv, tableRows, 3, "", this, 0); + for (int i = 0; isetCell(cell, 0, mModel->x(j)); + w->setCell(cell, 1, mModel->y(i)); + w->setCell(cell, 2, mModel->cell(i, j)); + } + } + } else if (conversionType == YXZ){ + int tableRows = rows*cols; + w = new Table(scriptEnv, tableRows, 3, "", this, 0); + for (int i = 0; isetCell(cell, 0, mModel->x(i)); + w->setCell(cell, 1, mModel->y(j)); + w->setCell(cell, 2, mModel->cell(i, j)); + } + } + } + + + initTable(w, generateUniqueName(tr("Table"))); + w->setWindowLabel(m->windowLabel()); + w->setCaptionPolicy(m->captionPolicy()); + w->resize(m->size()); + w->showNormal(); + + QApplication::restoreOverrideCursor(); + return w; +} + +void ApplicationWindow::initMatrix(Matrix* m, const QString& caption) +{ + QString name = caption; + while(alreadyUsedName(name)){name = generateUniqueName(tr("Matrix"));} + + m->setWindowTitle(name); + m->setName(name); + m->setIcon( QPixmap(":/matrix.png") ); + m->askOnCloseEvent(confirmCloseMatrix); + m->setNumericPrecision(d_decimal_digits); + + if (d_mdi_windows_area) + d_workspace->addSubWindow(m); + else + m->setParent(0); + + addListViewItem(m); + + QUndoStack *stack = m->undoStack(); + connect(stack, SIGNAL(canUndoChanged(bool)), actionUndo, SLOT(setEnabled(bool))); + connect(stack, SIGNAL(canRedoChanged(bool)), actionRedo, SLOT(setEnabled(bool))); + connect(m, SIGNAL(modifiedWindow(MdiSubWindow*)), this, SLOT(modifiedProject(MdiSubWindow*))); + connect(m, SIGNAL(modifiedData(Matrix*)), this, SLOT(updateMatrixPlots(Matrix *))); + connect(m, SIGNAL(resizedWindow(MdiSubWindow*)),this,SLOT(modifiedProject(MdiSubWindow*))); + connect(m, SIGNAL(closedWindow(MdiSubWindow*)), this, SLOT(closeWindow(MdiSubWindow*))); + connect(m, SIGNAL(hiddenWindow(MdiSubWindow*)), this, SLOT(hideWindow(MdiSubWindow*))); + connect(m, SIGNAL(statusChanged(MdiSubWindow*)),this, SLOT(updateWindowStatus(MdiSubWindow*))); + connect(m, SIGNAL(showContextMenu()), this, SLOT(showWindowContextMenu())); + + emit modified(); +} + +void ApplicationWindow::showBinMatrixDialog() +{ + Table* t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + Q3TableSelection sel = t->getSelection(); + if (t->selectedYColumns().size() != 1 || fabs(sel.topRow() - sel.bottomRow()) < 2){ + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), + tr("You must select a single Y column that has an associated X column!")); + return; + } + + CreateBinMatrixDialog *cbmd = new CreateBinMatrixDialog(t, sel.topRow(), sel.bottomRow(), this); + cbmd->exec(); +} + +Matrix* ApplicationWindow::convertTableToMatrixRegularXYZ() +{ + Table* t = (Table*)activeWindow(TableWindow); + if (!t) + return 0; + + Q3TableSelection sel = t->getSelection(); + if (t->selectedColumns().size() != 1 || + t->colPlotDesignation(t->colIndex(t->selectedColumns()[0])) != Table::Z || + fabs(sel.topRow() - sel.bottomRow()) < 2){ + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), + tr("You must select exactly one Z column!")); + return 0; + } + + int zcol = t->colIndex(t->selectedColumns()[0]); + int ycol = t->colY(zcol); + int xcol = t->colX(ycol); + + int cells = 0; + int startRow = sel.topRow(); + int endRow = sel.bottomRow(); + for (int i = startRow; i <= endRow; i++){ + QString xs = t->text(i, xcol); + QString ys = t->text(i, ycol); + QString zs = t->text(i, zcol); + if (!xs.isEmpty() && !ys.isEmpty() && !zs.isEmpty()) + cells++; + } + + if (!cells) + return 0; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QLocale locale = this->locale(); + bool xVariesFirst = false; + int firstValidRow = sel.topRow(); + double x0 = 0.0, y0 = 0.0, xstart = 0.0, ystart = 0.0; + double tolerance = 0.15; + for (int i = startRow; i <= endRow; i++){ + QString xs = t->text(i, xcol); + QString ys = t->text(i, ycol); + QString zs = t->text(i, zcol); + if (!xs.isEmpty() && !ys.isEmpty() && !zs.isEmpty()){ + x0 = locale.toDouble(xs); + y0 = locale.toDouble(ys); + xstart = x0; + ystart = y0; + firstValidRow = i; + + for (int j = i + 1; j <= endRow; j++){ + xs = t->text(j, xcol); + ys = t->text(j, ycol); + zs = t->text(j, zcol); + if (!xs.isEmpty() && !ys.isEmpty() && !zs.isEmpty()){ + double x = locale.toDouble(xs); + double y = locale.toDouble(ys); + if (fabs(x - x0) > tolerance*x0 && fabs(y - y0) <= tolerance*y0) + xVariesFirst = true; + break; + } + } + break; + } + } + + int rows = 0; + int cols = 0; + for (int i = firstValidRow; i <= endRow; i++){ + QString xs = t->text(i, xcol); + QString ys = t->text(i, ycol); + QString zs = t->text(i, zcol); + if (!xs.isEmpty() && !ys.isEmpty() && !zs.isEmpty()){ + double x = locale.toDouble(xs); + double y = locale.toDouble(ys); + if (xVariesFirst){ + if (fabs(y - y0) <= tolerance*y0){ + cols++; + y0 = y; + } else + break; + } else { + if (fabs(x - x0) <= tolerance*x0){ + rows++; + x0 = x; + } else + break; + } + } + } + + if (rows) + cols = cells/rows; + else + rows = cells/cols; + + double xend = xstart, yend = ystart; + Matrix* m = newMatrix(rows, cols); + for (int i = startRow; i <= endRow; i++){ + QString xs = t->text(i, xcol); + QString ys = t->text(i, ycol); + QString zs = t->text(i, zcol); + if (!xs.isEmpty() && !ys.isEmpty() && !zs.isEmpty()){ + int row = 0, col = 0; + if (xVariesFirst){ + col = i%cols; + row = i/cols; + } else { + row = i%rows; + col = i/rows; + } + + double x = locale.toDouble(xs); + double y = locale.toDouble(ys); + if (x > xend) + xend = x; + if (y > yend) + yend = y; + + m->setCell(row, col, locale.toDouble(zs)); + } + } + + m->setCoordinates(QMIN(xstart, xend), QMAX(xstart, xend), QMIN(ystart, yend), QMAX(ystart, yend)); + + QApplication::restoreOverrideCursor(); + return m; +} + +Matrix* ApplicationWindow::convertTableToMatrix() +{ + Table* t = (Table*)activeWindow(TableWindow); + if (!t) + return 0; + + return tableToMatrix (t); +} + +Matrix* ApplicationWindow::tableToMatrix(Table* t) +{ + if (!t) + return 0; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + int rows = t->numRows(); + int cols = t->numCols(); + + Matrix* m = newMatrix(rows, cols); + for (int i = 0; isetCell(i, j, t->cell(i, j)); + } + + m->showNormal(); + + QApplication::restoreOverrideCursor(); + return m; +} + +MdiSubWindow* ApplicationWindow::window(const QString& name) +{ + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->objectName() == name) + return w; + } + return NULL; +} + +Table* ApplicationWindow::table(const QString& name) +{ + int pos = name.find("_", 0); + QString caption = name.left(pos); + + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->inherits("Table") && w->objectName() == caption) + return (Table*)w; + } + f = f->folderBelow(); + } + + return 0; +} + +Matrix* ApplicationWindow::matrix(const QString& name) +{ + QString caption = name; + if (d_is_appending_file && !renamedTables.isEmpty() && renamedTables.contains(caption)){ + int index = renamedTables.findIndex(caption); + caption = renamedTables[index + 1]; + } + + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->isA("Matrix") && w->objectName() == caption) + return (Matrix*)w; + } + f = f->folderBelow(); + } + return 0; +} + +MdiSubWindow *ApplicationWindow::activeWindow(WindowType type) +{ + if (!d_active_window){ + QList windows = current_folder->windowsList(); + if (!current_folder->activeWindow() && windows.size() > 0){ + d_active_window = windows[0]; + } else + return NULL; + } + + switch(type){ + case NoWindow: + break; + + case TableWindow: + if (d_active_window->inherits("Table")) + return d_active_window; + else + return NULL; + break; + + case MatrixWindow: + return qobject_cast(d_active_window); + break; + + case MultiLayerWindow: + return qobject_cast(d_active_window); + break; + + case NoteWindow: + return qobject_cast(d_active_window); + break; + + case Plot3DWindow: + return qobject_cast(d_active_window); + break; + } + return d_active_window; +} + +void ApplicationWindow::windowActivated(QMdiSubWindow *w) +{ + MdiSubWindow *window = qobject_cast(w); + if (!window) + return; + + if (d_active_window && d_active_window == window) + return; + + d_active_window = window; + + customToolBars(window); + customMenu(window); + + if (d_opening_file) + return; + + QList windows = current_folder->windowsList(); + foreach(MdiSubWindow *ow, windows){ + if (ow != window && ow->status() == MdiSubWindow::Maximized){ + ow->setNormal(); + break; + } + } + + Folder *f = window->folder(); + if (f) + f->setActiveWindow(window); + + emit modified(); +} + +void ApplicationWindow::addErrorBars() +{ + MdiSubWindow *w = activeWindow(MultiLayerWindow); + if (!w) + return; + + MultiLayer* plot = (MultiLayer*)w; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (!g) + return; + + if (!g->curveCount()){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), tr("There are no curves available on this plot!")); + return; + } + + if (g->isPiePlot()){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), tr("This functionality is not available for pie plots!")); + return; + } + + ErrDialog* ed = new ErrDialog(this); + connect (ed, SIGNAL(options(const QString&, int, double, int)), this, SLOT(defineErrorBars(const QString&, int, double, int))); + connect (ed, SIGNAL(options(const QString&, const QString&, int)), this, SLOT(defineErrorBars(const QString&, const QString&, int))); + + ed->setCurveNames(g->analysableCurvesList()); + ed->setSrcTables(tableList()); + ed->exec(); +} + +void ApplicationWindow::defineErrorBars(const QString& name, int type, double percent, int direction) +{ + MdiSubWindow *w = activeWindow(MultiLayerWindow); + if (!w) + return; + + Graph* g = ((MultiLayer*)w)->activeLayer(); + if (!g) + return; + + Table *t = table(name); + if (!t){//user defined function + QMessageBox::critical(this, tr("QtiPlot - Error bars error"), + tr("This feature is not available for user defined function curves!")); + return; + } + + DataCurve *master_curve = (DataCurve *)g->curve(name); + QString xColName = master_curve->xColumnName(); + if (xColName.isEmpty()) + return; + + if (direction == QwtErrorPlotCurve::Horizontal) + t->addCol(Table::xErr); + else + t->addCol(Table::yErr); + + int r = master_curve->dataSize(); + int rows = t->numRows(); + int c = t->numCols() - 1; + int ycol = t->colIndex(name); + if (!direction) + ycol = t->colIndex(xColName); + + QVarLengthArray Y(r); + if (direction == QwtErrorPlotCurve::Horizontal){ + for (int i = 0; i < r; i++) + Y[i] = master_curve->x(i); + } else { + for (int i = 0; i < r; i++) + Y[i] = master_curve->y(i); + } + + QString errColName = t->colName(c); + + if (type == 0){ + double prc = 0.01*percent; + int aux = 0; + for (int i = 0; i < rows; i++){ + if (!t->text(i, ycol).isEmpty() && aux < r){ + t->setCell(i, c, Y[aux]*prc); + aux++; + } + } + } else if (type == 1) { + double sd = gsl_stats_sd(Y.data(), 1, r); + for (int i = 0; i < rows; i++){ + if (!t->text(i, ycol).isEmpty()) + t->setCell(i, c, sd); + } + } + QwtErrorPlotCurve *er = g->addErrorBars(xColName, name, t, errColName, direction); + if (er){ + er->setColor(master_curve->pen().color()); + g->replot(); + emit modified(); + } +} + +void ApplicationWindow::defineErrorBars(const QString& curveName, const QString& errColumnName, int direction) +{ + Table *w = table(curveName); + if (!w){//user defined function --> no worksheet available + QMessageBox::critical(this,tr("QtiPlot - Error"), + tr("This feature is not available for user defined function curves!")); + return; + } + + Table *errTable = table(errColumnName); + if (w->numRows() != errTable->numRows()){ + QMessageBox::critical(this,tr("QtiPlot - Error"), tr("The selected columns have different numbers of rows!")); + addErrorBars(); + return; + } + + int errCol = errTable->colIndex(errColumnName); + if (errTable->isEmptyColumn(errCol)){ + QMessageBox::critical(this, tr("QtiPlot - Error"), tr("The selected error column is empty!")); + addErrorBars(); + return; + } + + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g) + return; + + QwtErrorPlotCurve *er = g->addErrorBars(curveName, errTable, errColumnName, direction); + if (er){ + DataCurve *mc = er->masterCurve(); + if (mc){ + er->setColor(mc->pen().color()); + g->replot(); + } + emit modified(); + } +} + +void ApplicationWindow::removeCurves(const QString& name) +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")){ + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers) + g->removeCurves(name); + } else if (w->isA("Graph3D")){ + if ( (((Graph3D*)w)->formula()).contains(name) ) + ((Graph3D*)w)->clearData(); + } + } + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::updateCurves(Table *t, const QString& name) +{ + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")){ + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers) + g->updateCurvesData(t, name); + } else if (w->isA("Graph3D")){ + Graph3D* g = (Graph3D*)w; + if ((g->formula()).contains(name)) + g->updateData(t); + } + } +} + +void ApplicationWindow::showPreferencesDialog() +{ + ConfigDialog* cd = new ConfigDialog(this); + cd->setColumnSeparator(columnSeparator); + cd->exec(); +} + +void ApplicationWindow::setSaveSettings(bool autoSaving, int min) +{ + if (autoSave==autoSaving && autoSaveTime==min) + return; + + autoSave=autoSaving; + autoSaveTime=min; + + killTimer(savingTimerId); + + if (autoSave) + savingTimerId=startTimer(autoSaveTime*60000); + else + savingTimerId=0; +} + +void ApplicationWindow::changeAppStyle(const QString& s) +{ + // style keys are case insensitive + if (appStyle.toLower() == s.toLower()) + return; + + qApp->setStyle(s); + appStyle = qApp->style()->objectName(); + + QPalette pal = qApp->palette(); + pal.setColor (QPalette::Active, QPalette::Base, QColor(panelsColor)); + qApp->setPalette(pal); + +} + +void ApplicationWindow::changeAppFont(const QFont& f) +{ + if (appFont == f) + return; + + appFont = f; + updateAppFonts(); +} + +void ApplicationWindow::updateAppFonts() +{ + qApp->setFont(appFont); + this->setFont(appFont); + info->setFont(QFont(appFont.family(), 2 + appFont.pointSize(), QFont::Bold,false)); +} + +void ApplicationWindow::updateConfirmOptions(bool askTables, bool askMatrices, bool askPlots2D, + bool askPlots3D, bool askNotes) +{ + QList windows = windowsList(); + + + if (confirmCloseTable != askTables){ + confirmCloseTable=askTables; + foreach(MdiSubWindow *w, windows){ + if (w->inherits("Table")) + w->askOnCloseEvent(confirmCloseTable); + } + } + + if (confirmCloseMatrix != askMatrices){ + confirmCloseMatrix = askMatrices; + foreach(MdiSubWindow *w, windows){ + if (w->isA("Matrix")) + w->askOnCloseEvent(confirmCloseMatrix); + } + } + + if (confirmClosePlot2D != askPlots2D){ + confirmClosePlot2D=askPlots2D; + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")) + w->askOnCloseEvent(confirmClosePlot2D); + } + } + + if (confirmClosePlot3D != askPlots3D){ + confirmClosePlot3D=askPlots3D; + foreach(MdiSubWindow *w, windows){ + if (w->isA("Graph3D")) + w->askOnCloseEvent(confirmClosePlot3D); + } + } + + if (confirmCloseNotes != askNotes){ + confirmCloseNotes = askNotes; + foreach(MdiSubWindow *w, windows){ + if (w->isA("Note")) + w->askOnCloseEvent(confirmCloseNotes); + } + } +} + +void ApplicationWindow::setGraphDefaultSettings(bool autoscale, bool scaleFonts, + bool resizeLayers, bool antialiasing) +{ + if (autoscale2DPlots == autoscale && + autoScaleFonts == scaleFonts && + autoResizeLayers != resizeLayers && + antialiasing2DPlots == antialiasing) + return; + + autoscale2DPlots = autoscale; + autoScaleFonts = scaleFonts; + autoResizeLayers = !resizeLayers; + antialiasing2DPlots = antialiasing; + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")){ + ((MultiLayer*)w)->setScaleLayersOnResize(autoResizeLayers); + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers){ + g->enableAutoscaling(autoscale2DPlots); + g->updateScale(); + g->setAutoscaleFonts(autoScaleFonts); + g->setAntialiasing(antialiasing2DPlots); + } + } + } +} + +void ApplicationWindow::setArrowDefaultSettings(double lineWidth, const QColor& c, Qt::PenStyle style, + int headLength, int headAngle, bool fillHead) +{ + if (defaultArrowLineWidth == lineWidth && + defaultArrowColor == c && + defaultArrowLineStyle == style && + defaultArrowHeadLength == headLength && + defaultArrowHeadAngle == headAngle && + defaultArrowHeadFill == fillHead) + return; + + defaultArrowLineWidth = lineWidth; + defaultArrowColor = c; + defaultArrowLineStyle = style; + defaultArrowHeadLength = headLength; + defaultArrowHeadAngle = headAngle; + defaultArrowHeadFill = fillHead; + saveSettings(); +} + +ApplicationWindow * ApplicationWindow::plotFile(const QString& fn) +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + ApplicationWindow *app = new ApplicationWindow(); + app->restoreApplicationGeometry(); + + QList lst = QImageReader::supportedImageFormats() << "JPG"; + QStringList tempList; + foreach(QByteArray temp,lst)// convert QList to QStringList to be able to 'filter' + tempList.append(QString(temp)); + + QFileInfo fi(fn); + QStringList l = tempList.filter(fi.suffix(), Qt::CaseInsensitive); + if (l.count() > 0) + app->importImage(fn); + else { + Table* t = app->newTable(); + if (!t) { + QApplication::restoreOverrideCursor(); + return NULL; + } + t->importASCII(fn, app->columnSeparator, 0, app->renameColumns, app->strip_spaces, app->simplify_spaces, + app->d_ASCII_import_comments, app->d_ASCII_comment_string, + app->d_ASCII_import_read_only, Table::Overwrite, app->d_ASCII_import_locale, app->d_ASCII_end_line); + t->setCaptionPolicy(MdiSubWindow::Both); + app->multilayerPlot(t, t->YColumns(), defaultCurveStyle); + } + + QApplication::restoreOverrideCursor(); + savedProject();//force saved state + close(); + return app; +} + +Table * ApplicationWindow::importOdfSpreadsheet(const QString& fileName, int sheet) +{ +#ifdef ODS_IMPORT + QString fn = fileName; + if (fn.isEmpty()){ + fn = getFileName(this, tr("Open ODF Spreadsheet File"), QString::null, "*.ods", 0, false); + if (fn.isEmpty()) + return NULL; + } + + QuaZipFile file(fn, "content.xml"); + if(!file.open(QIODevice::ReadOnly)){ + QMessageBox::critical(this, tr("QtiPlot"), tr("Couldn't open file %1").arg(fn)); + return NULL; + } + QTemporaryFile out; + if (out.open()){ + char c; + while(file.getChar(&c)) + out.putChar(c); + out.close(); + } + file.close(); + + OdsFileHandler handler(this, fn); + QXmlSimpleReader reader; + reader.setContentHandler(&handler); + reader.setErrorHandler(&handler); + + QXmlInputSource xmlInputSource(&out); + if (reader.parse(xmlInputSource)){ + int sheets = handler.sheetsCount(); + if (sheet > sheets){ + QMessageBox::critical(this, tr("QtiPlot"), tr("File %1 contains only %2 sheets!").arg(fn).arg(sheets)); + } else if (sheet > 0){ + Table *aux = NULL; + for (int i = 0; i < sheets; i++){ + Table *t = handler.sheet(i); + if (i == sheet - 1) + aux = t; + else { + t->askOnCloseEvent(false); + t->close(); + } + } + return aux; + } + return handler.sheet(sheets - 1); + } + return NULL; +#else + QMessageBox::critical(this, tr("QtiPlot"), tr("QtiPlot was built without ODF spreadsheet support!")); + return NULL; +#endif +} + +Table * ApplicationWindow::importExcel(const QString& fileName, int sheet) +{ +#ifdef XLS_IMPORT + QString fn = fileName; + if (fn.isEmpty()){ + fn = getFileName(this, tr("Open Excel File"), QString::null, "*.xls", 0, false); + if (fn.isEmpty()) + return NULL; + } + + // open workbook, choose standard conversion + xlsWorkBook* pWB = xls_open(fn.toAscii().data(), "iso-8859-15//TRANSLIT"); + if (!pWB) + return NULL; + + if (sheet > 0 && sheet > pWB->sheets.count){ + QMessageBox::critical(this, tr("QtiPlot"), tr("File %1 contains only %2 sheets, operation aborted!").arg(fn).arg(pWB->sheets.count)); + return NULL; + } + + Table *table = NULL; + for (int i = 0; i < pWB->sheets.count; i++){// process all sheets + int currentSheet = i + 1; + if (sheet > 0 && sheet != currentSheet) + continue; + + xlsWorkSheet* pWS = xls_getWorkSheet(pWB, i);// open and parse the sheet + xls_parseWorkSheet(pWS); + + int rows = pWS->rows.lastrow + 1; + int cols = pWS->rows.lastcol; + if (rows == 1 && !cols){ + if (sheet > 0 && sheet == currentSheet){ + QMessageBox::critical(this, tr("QtiPlot"), tr("Sheet %1 is empty, operation aborted!").arg(sheet)); + return NULL; + } else + continue; + } + + table = newTable(rows, cols, QString::null, fn + ", " + tr("sheet") + ": " + QString(pWB->sheets.sheet[i].name)); + QDate d1(1899, 12, 30);//start date in Excel files see(http://sc.openoffice.org/excelfileformat.pdf) + QTime t1(0, 0); + double daySeconds = 24*60*60; + for (int t = 0; t <= pWS->rows.lastrow; t++){// process all rows of the sheet + struct st_row::st_row_data* row = &pWS->rows.row[t]; + for (int tt = 0; tt <= pWS->rows.lastcol; tt++){ + st_cell::st_cell_data cell = row->cells.cell[tt]; + if (!cell.ishiden){ + // display the colspan as only one cell, but reject rowspans (they can't be converted to CSV) + if (cell.rowspan > 1){ + printf("%d,%d: rowspan=%i", tt, t, cell.rowspan); + continue; + } + // display the value of the cell (either numeric or string) + if (cell.id == 0x0BD){ // number + if (table->columnType(tt) == Table::Date){ + QDate d2 = d1.addDays(cell.d); + table->setText(t, tt, d2.toString("dd.MM.yyyy")); + } else if (table->columnType(tt) == Table::Time){ + QTime t2 = t1.addSecs(qRound(cell.d*daySeconds)); + table->setText(t, tt, t2.toString("hh:mm:ss")); + } else + table->setCell(t, tt, cell.d); + } else if (cell.id == 0x27e){//date + QDate d2 = d1.addDays(cell.d); + table->setDateFormat("dd.MM.yyyy", tt, false); + table->setText(t, tt, d2.toString("dd.MM.yyyy")); + } else if (cell.id == 0x203){//time + table->setTimeFormat("hh:mm:ss", tt, false); + QTime t2 = t1.addSecs(qRound(cell.d*daySeconds)); + table->setText(t, tt, t2.toString("hh:mm:ss")); + } else if (cell.id == 0x06 && cell.l == 0)//formula + table->setCell(t, tt, cell.d); + else if (cell.str != NULL) + table->setText(t, tt, QString(cell.str)); + } + } + } + table->showNormal(); + + if (sheet > 0 && sheet == currentSheet) + break; + } + xls_close(pWB); + + updateRecentProjectsList(fn); + return table; +#else + QMessageBox::critical(this, tr("QtiPlot"), tr("QtiPlot was built without libxls support!")); + return NULL; +#endif +} + +Table * ApplicationWindow::importWaveFile() +{ + QString fn = getFileName(this, tr("Open File"), QString::null, "*.wav", 0, false); + if (fn.isEmpty()) + return NULL; + + QString log = QDateTime::currentDateTime ().toString(Qt::LocalDate) + " - "; + log += tr("Imported sound file") + ": " + fn + "\n"; + ifstream file(fn, ios::in | ios::binary); + + file.seekg(4, ios::beg); + int chunkSize; + file.read( (char*) &chunkSize, 4 ); // read the ChunkSize + + file.seekg(16, ios::beg); + int subChunk1Size; + file.read( (char*) &subChunk1Size, 4 ); // read the SubChunk1Size + + short format; + file.read( (char*) &format, sizeof(short) ); // read the file format. This should be 1 for PCM + log += tr("Format") + ": "; + if (format != 1){ + QMessageBox::information(this, tr("QtiPlot"), + tr("This is not a PCM type WAV file, operation aborted!")); + log += QString::number(format) + "\n"; + showResults(log, true); + return NULL; + } else + log += tr("PCM") + "\n"; + + short channels; + file.read( (char*) &channels, sizeof(short) ); // read the # of channels (1 or 2) + QStringList header; + if (channels == 2) + header << tr("Time") << tr("Left") << tr("Right"); + else if (channels == 1) + header << tr("Time") << tr("Data"); + log += tr("Channels") + ": " + QString::number(channels) + "\n"; + + int sampleRate; + file.read( (char*) &sampleRate, sizeof(int) ); + log += tr("Sample Rate") + ": " + QString::number(sampleRate) + "\n"; + + int byteRate; + file.read( (char*) &byteRate, sizeof(int) ); + log += tr("Byte Rate") + ": " + QString::number(byteRate) + "\n"; + + short blockAlign; + file.read( (char*) &blockAlign, sizeof(short) ); + log += tr("Block Align") + ": " + QString::number(blockAlign) + "\n"; + + short bitsPerSample; + file.read( (char*) &bitsPerSample, sizeof(short) ); + log += tr("Bits Per Sample") + ": " + QString::number(bitsPerSample) + "\n"; + log += "__________________________________\n"; + showResults(log, true); + + int rows = (chunkSize - 36)/blockAlign; + Table *t = newTable(rows, int(channels + 1), QFileInfo(fn).baseName(), fn); + if (!t) + return NULL; + + t->setHeader(header); + + file.seekg(44, ios::beg); + + double dt = 1.0/(double)sampleRate; + int aux = 1; + if (bitsPerSample == 8){ + if (channels == 2) + file.seekg(46, ios::beg);//???Why??? + int size = 1; + uchar ch; + while(!file.eof()){ + int i = aux - 1; + t->setCell(i, 0, dt*aux); + for (int j = 1; j <= channels; j++){ + file.read((char*) &ch, size); + t->setText(i, j, QString::number(ch)); + } + aux++; + } + } else if (bitsPerSample == 16){ + int size = sizeof(short); + short ch; + while(!file.eof()){ + int i = aux - 1; + t->setCell(i, 0, dt*aux); + for (int j = 1; j <= channels; j++){ + file.read((char*) &ch, size); + t->setText(i, j, QString::number(ch)); + } + aux++; + } + } + + file.close(); + t->show(); + return t; +} + +void ApplicationWindow::importASCII() +{ + ImportASCIIDialog *import_dialog = new ImportASCIIDialog(!activeWindow(TableWindow) && !activeWindow(MatrixWindow), this, d_extended_import_ASCII_dialog); + import_dialog->setDirectory(asciiDirPath); + import_dialog->selectFilter(d_ASCII_file_filter); + if (d_import_ASCII_dialog_size.isValid()) + import_dialog->resize(d_import_ASCII_dialog_size); + if (import_dialog->exec() != QDialog::Accepted) + return; + + asciiDirPath = import_dialog->directory().path(); + d_ASCII_import_mode = import_dialog->importMode(); + columnSeparator = import_dialog->columnSeparator(); + ignoredLines = import_dialog->ignoredLines(); + renameColumns = import_dialog->useFirstRow(); + strip_spaces = import_dialog->stripSpaces(); + simplify_spaces = import_dialog->simplifySpaces(); + d_ASCII_import_locale = import_dialog->decimalSeparators(); + d_ASCII_comment_string = import_dialog->commentString(); + d_ASCII_import_comments = import_dialog->useSecondRow(); + d_ASCII_import_read_only = import_dialog->readOnly(); + d_ASCII_end_line = (EndLineChar)import_dialog->endLineChar(); + saveSettings(); + + importASCII(import_dialog->selectedFiles(), + import_dialog->importMode(), + import_dialog->columnSeparator(), + import_dialog->ignoredLines(), + import_dialog->renameColumns(), + import_dialog->stripSpaces(), + import_dialog->simplifySpaces(), + import_dialog->importComments(), + import_dialog->decimalSeparators(), + import_dialog->commentString(), + import_dialog->readOnly(), + import_dialog->endLineChar(), + import_dialog->columnTypes()); +} + +void ApplicationWindow::importASCII(const QStringList& files, int import_mode, const QString& local_column_separator, + int local_ignored_lines, bool local_rename_columns, bool local_strip_spaces, bool local_simplify_spaces, + bool local_import_comments, QLocale local_separators, const QString& local_comment_string, + bool import_read_only, int endLineChar, const QList& colTypes) +{ + if (files.isEmpty()) + return; + + switch(import_mode) { + case ImportASCIIDialog::NewTables: + { + int dx = 0, dy = 0; + QStringList sorted_files = files; + sorted_files.sort(); + int filesCount = sorted_files.size(); + for (int i=0; iimportASCII(sorted_files[i], local_column_separator, local_ignored_lines, + local_rename_columns, local_strip_spaces, local_simplify_spaces, + local_import_comments, local_comment_string, import_read_only, + Table::Overwrite, local_separators, endLineChar, -1, colTypes); + if (!w) continue; + w->setWindowLabel(sorted_files[i]); + w->setCaptionPolicy(MdiSubWindow::Both); + + QString name = QFileInfo(sorted_files[i]).baseName(); + if (!alreadyUsedName(name) && !name.contains(QRegExp("\\W"))) + setWindowName(w, name); + + if (i == 0){ + dx = w->verticalHeaderWidth(); + dy = w->frameGeometry().height() - w->widget()->height(); + } + if (filesCount > 1) + w->move(QPoint(i*dx, i*dy)); + } + modifiedProject(); + break; + } + case ImportASCIIDialog::NewMatrices: + { + int dx = 0, dy = 0; + QStringList sorted_files = files; + sorted_files.sort(); + int filesCount = sorted_files.size(); + for (int i=0; iimportASCII(sorted_files[i], local_column_separator, local_ignored_lines, + local_strip_spaces, local_simplify_spaces, local_comment_string, + Matrix::Overwrite, local_separators, endLineChar); + w->setWindowLabel(sorted_files[i]); + w->setCaptionPolicy(MdiSubWindow::Both); + + QString name = QFileInfo(sorted_files[i]).baseName(); + if (!alreadyUsedName(name) && !name.contains(QRegExp("\\W"))) + setWindowName(w, name); + + if (i == 0){ + dx = w->verticalHeaderWidth(); + dy = w->frameGeometry().height() - w->widget()->height(); + } + if (filesCount > 1) + w->move(QPoint(i*dx,i*dy)); + } + modifiedProject(); + break; + } + + case ImportASCIIDialog::NewColumns: + case ImportASCIIDialog::NewRows: + { + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (w->inherits("Table")){ + Table *t = (Table*)w; + for (int i = 0; i < files.size(); i++){ + t->importASCII(files[i], local_column_separator, local_ignored_lines, local_rename_columns, + local_strip_spaces, local_simplify_spaces, local_import_comments, + local_comment_string, import_read_only, (Table::ImportMode)(import_mode - 2), + local_separators, endLineChar, -1, colTypes); + } + t->notifyChanges(); + emit modifiedProject(t); + } else if (w->isA("Matrix")){ + Matrix *m = (Matrix *)w; + for (int i=0; iimportASCII(files[i], local_column_separator, local_ignored_lines, + local_strip_spaces, local_simplify_spaces, local_comment_string, + (Matrix::ImportMode)(import_mode - 2), local_separators, endLineChar); + } + } + w->setWindowLabel(files.join("; ")); + w->setCaptionPolicy(MdiSubWindow::Name); + break; + } + case ImportASCIIDialog::Overwrite: + { + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (w->inherits("Table")){ + Table *t = (Table *)w; + t->importASCII(files[0], local_column_separator, local_ignored_lines, local_rename_columns, + local_strip_spaces, local_simplify_spaces, local_import_comments, + local_comment_string, import_read_only, Table::Overwrite, local_separators, endLineChar, -1, colTypes); + t->notifyChanges(); + } else if (w->isA("Matrix")){ + Matrix *m = (Matrix *)w; + m->importASCII(files[0], local_column_separator, local_ignored_lines, + local_strip_spaces, local_simplify_spaces, local_comment_string, + Matrix::Overwrite, local_separators, endLineChar); + } + + w->setWindowLabel(files[0]); + w->setCaptionPolicy(MdiSubWindow::Both); + + QString name = QFileInfo(files[0]).baseName(); + if (!alreadyUsedName(name) && !name.contains(QRegExp("\\W"))) + setWindowName(w, name); + + modifiedProject(); + break; + } + } +} + +void ApplicationWindow::open() +{ + if (showSaveProjectMessage() == QMessageBox::Cancel) + return; + + OpenProjectDialog *open_dialog = new OpenProjectDialog(this, d_extended_open_dialog); + open_dialog->setDirectory(workingDir); + + if (open_dialog->exec() != QDialog::Accepted || open_dialog->selectedFiles().isEmpty()) + return; + workingDir = open_dialog->directory().path(); + + switch(open_dialog->openMode()) { + case OpenProjectDialog::NewProject: + { + QString fn = open_dialog->selectedFiles()[0]; + QFileInfo fi(fn); + + if (projectname != "untitled"){ + QFileInfo fi(projectname); + QString pn = fi.absFilePath(); + if (fn == pn){ + QMessageBox::warning(this, tr("QtiPlot - File openning error"), + tr("The file: %1 is the current file!").arg(fn)); + return; + } + } + + if (!fi.exists ()){ + QMessageBox::critical(this, tr("QtiPlot - File openning error"), + tr("The file: %1 doesn't exist!").arg(fn)); + return; + } + + saveSettings();//the recent projects must be saved + + #ifdef BROWSER_PLUGIN + if (isProjectFile(fn)) + closeProject(); + open(fn, false, false); + #else + ApplicationWindow *a = open (fn); + if (a){ + a->workingDir = workingDir; + if (isProjectFile(fn)) + this->close(); + } + #endif + + break; + } + case OpenProjectDialog::NewFolder: + appendProject(open_dialog->selectedFiles()[0]); + break; + } +} + +bool ApplicationWindow::isProjectFile(const QString& fn) +{ + if (fn.endsWith(".qti", Qt::CaseInsensitive) || fn.endsWith(".qti.gz", Qt::CaseInsensitive) || + fn.endsWith(".qti~", Qt::CaseInsensitive) || + fn.endsWith(".opj",Qt::CaseInsensitive) || fn.endsWith(".ogg",Qt::CaseInsensitive)) + return true; + return false; +} + +ApplicationWindow* ApplicationWindow::open(const QString& fn, bool factorySettings, bool newProject) +{ + QFileInfo fi(fn); + if (!fi.isReadable()){ + QMessageBox::critical(this, tr("QtiPlot - File openning error"), + tr("You don't have the permission to open this file: %1").arg(fn)); + return NULL; + } + +#ifdef OPJ_IMPORT + if (fn.endsWith(".opj", Qt::CaseInsensitive) || fn.endsWith(".ogm", Qt::CaseInsensitive) || + fn.endsWith(".ogw", Qt::CaseInsensitive) || fn.endsWith(".ogg", Qt::CaseInsensitive)) + return importOPJ(fn, factorySettings, newProject); + else +#endif + if (fn.endsWith(".py", Qt::CaseInsensitive)) + return loadScript(fn); + else if (fn.endsWith(".xls", Qt::CaseInsensitive)){ + importExcel(fn); + return this; + } else if (fn.endsWith(".ods", Qt::CaseInsensitive)){ + importOdfSpreadsheet(fn); + return this; + } + + QString fname = fn; + if (fn.endsWith(".qti.gz", Qt::CaseInsensitive)){//decompress using zlib + file_uncompress((char *)fname.ascii()); + fname = fname.left(fname.size() - 3); + } + + QFile f(fname); + QTextStream t( &f ); + f.open(QIODevice::ReadOnly); + QString s = t.readLine(); + f.close(); + + QStringList lst = s.split(QRegExp("\\s"), QString::SkipEmptyParts); + bool qtiProject = (lst.count() < 2 || lst[0] != "QtiPlot") ? false : true; + if (!qtiProject){ + if (QFile::exists(fname + "~")){ + int choice = QMessageBox::question(this, tr("QtiPlot - File opening error"), + tr("The file %1 is corrupted, but there exists a backup copy.
Do you want to open the backup instead?").arg(fn), + QMessageBox::Yes|QMessageBox::Default, QMessageBox::No|QMessageBox::Escape); + if (choice == QMessageBox::Yes) + return open(fname + "~"); + else + QMessageBox::critical(this, tr("QtiPlot - File opening error"), tr("The file: %1 was not created using QtiPlot!").arg(fn)); + return 0; + } + + return plotFile(fn); + } + + QStringList vl = lst[1].split(".", QString::SkipEmptyParts); + d_file_version = 100*(vl[0]).toInt()+10*(vl[1]).toInt()+(vl[2]).toInt(); + + ApplicationWindow* app = openProject(fname, factorySettings, newProject); + + f.close(); + return app; +} + +void ApplicationWindow::openRecentProject(int index) +{ + QString fn = recent->text(index); + int pos = fn.find(" ", 0); + fn = fn.right(fn.length() - pos - 1); + + if (projectname != "untitled"){ + QFileInfo fi(projectname); + QString pn = fi.absFilePath(); + + if (QDir::toNativeSeparators(fn) == QDir::toNativeSeparators(pn)){ + QMessageBox::warning(this, tr("QtiPlot - File openning error"), + tr("The file:

%1

is the current file!").arg(QDir::toNativeSeparators(fn))); + return; + } + } + + if (isProjectFile(fn)){ + if (showSaveProjectMessage() == QMessageBox::Cancel) + return; + } + + QFile f(fn); + if (!f.exists()){ + QMessageBox::critical(this, tr("QtiPlot - File Open Error"), + tr("The file: %1

does not exist anymore!" + "

It will be removed from the list.").arg(fn)); + + for (int i = 0; i < recentProjects.size(); i++){ + if (QDir::toNativeSeparators(recentProjects[i]) == fn){ + recentProjects.removeAt(i); + break; + } + } + updateRecentProjectsList(); + return; + } + + if (!fn.isEmpty()){ + saveSettings();//the recent projects must be saved + #ifdef BROWSER_PLUGIN + if (isProjectFile(fn)) + closeProject(); + open (fn, false, false); + #else + bool isSaved = saved; + ApplicationWindow * a = open (fn); + if (a){ + if (isSaved) + savedProject();//force saved state + if (isProjectFile(fn)) + close(); + else + modifiedProject(); + } + #endif + } +} + +ApplicationWindow* ApplicationWindow::openProject(const QString& fn, bool factorySettings, bool newProject) +{ + ApplicationWindow *app = this; + if (newProject) + app = new ApplicationWindow(factorySettings); + + app->projectname = fn; + app->d_file_version = d_file_version; + app->setWindowTitle(tr("QtiPlot") + " - " + fn); + app->d_opening_file = true; + app->d_workspace->blockSignals(true); + + QFile f(fn); + QTextStream t( &f ); + t.setEncoding(QTextStream::UnicodeUTF8); + f.open(QIODevice::ReadOnly); + + QFileInfo fi(fn); + QString baseName = fi.fileName(); + + t.readLine(); + if (d_file_version < 73) + t.readLine(); + + QString s = t.readLine(); + QStringList list=s.split("\t", QString::SkipEmptyParts); + if (list[0] == "") + { + if (!app->setScriptingLanguage(list[1])) + QMessageBox::warning(app, tr("QtiPlot - File opening error"), + tr("The file \"%1\" was created using \"%2\" as scripting language.\n\n"\ + "Initializing support for this language FAILED; I'm using \"%3\" instead.\n"\ + "Various parts of this file may not be displayed as expected.")\ + .arg(fn).arg(list[1]).arg(scriptEnv->name())); + + s = t.readLine(); + list=s.split("\t", QString::SkipEmptyParts); + } + int aux=0,widgets=list[1].toInt(); + + QString titleBase = tr("Window") + ": "; + QString title = titleBase + "1/" + QString::number(widgets) + " "; + + QProgressDialog progress(app); + progress.setWindowModality(Qt::WindowModal); + progress.setRange(0, widgets); + progress.setMinimumWidth(app->width()/2); + progress.setWindowTitle(tr("QtiPlot - Opening file") + ": " + baseName); + progress.setLabelText(title); + + Folder *cf = app->projectFolder(); + app->folders->blockSignals (true); + app->blockSignals (true); + + //rename project folder item + FolderListItem *item = (FolderListItem *)app->folders->firstChild(); + item->setText(0, fi.baseName()); + item->folder()->setObjectName(fi.baseName()); + + //process tables and matrix information + while ( !t.atEnd() && !progress.wasCanceled()){ + s = t.readLine(); + list.clear(); + if (s.left(8) == ""){ + list = s.split("\t"); + Folder *f = new Folder(app->current_folder, list[1]); + f->setBirthDate(list[2]); + f->setModificationDate(list[3]); + if(list.count() > 4) + if (list[4] == "current") + cf = f; + + FolderListItem *fli = new FolderListItem(app->current_folder->folderListItem(), f); + f->setFolderListItem(fli); + + app->current_folder = f; + } else if (s.contains("")) { + app->current_folder->folderListItem()->setOpen(s.remove("").remove("").toInt()); + } else if (s == "

") { + title = titleBase + QString::number(++aux)+"/"+QString::number(widgets); + progress.setLabelText(title); + QStringList lst; + while ( s!="
" ){ + s=t.readLine(); + lst<") { + QStringList lst; + while ( s!="" ){ + s=t.readLine(); + lst<openTableStatistics(lst); + } else if (s == "") { + title= titleBase + QString::number(++aux)+"/"+QString::number(widgets); + progress.setLabelText(title); + QStringList lst; + while ( s != "" ) { + s=t.readLine(); + lst<") { + title= titleBase + QString::number(++aux)+"/"+QString::number(widgets); + progress.setLabelText(title); + for (int i=0; i<3; i++){ + s = t.readLine(); + list << s; + } + Note* m = openNote(app,list); + QStringList cont; + while ( s != "" ){ + s = t.readLine(); + cont << s; + } + cont.pop_back(); + m->restore(cont); + progress.setValue(aux); + } else if (s == "") + app->goToParentFolder(); + } + f.close(); + + if (progress.wasCanceled()){ + app->saved = true; + app->close(); + return 0; + } + + //process the rest + f.open(QIODevice::ReadOnly); + + MultiLayer *plot=0; + while ( !t.atEnd() && !progress.wasCanceled()){ + s=t.readLine(); + if (s.left(8) == ""){ + list = s.split("\t"); + if (app->current_folder && list.size() >= 2) + app->current_folder = app->current_folder->findSubfolder(list[1]); + } else if (s == ""){//process multilayers information + title = titleBase + QString::number(++aux) + "/" + QString::number(widgets); + progress.setLabelText(title); + + s = t.readLine(); + QStringList graph = s.split("\t"); + QString caption = graph[0]; + + plot = app->multilayerPlot(caption, 0, graph[2].toInt(), graph[1].toInt()); + + app->setListViewDate(caption, graph[3]); + plot->setBirthDate(graph[3]); + + restoreWindowGeometry(app, plot, t.readLine()); + plot->blockSignals(true); + + if (d_file_version > 71){ + QStringList lst=t.readLine().split("\t"); + plot->setWindowLabel(lst[1]); + plot->setCaptionPolicy((MdiSubWindow::CaptionPolicy)lst[2].toInt()); + } + if (d_file_version > 83){ + QStringList lst=t.readLine().split("\t", QString::SkipEmptyParts); + plot->setMargins(lst[1].toInt(),lst[2].toInt(),lst[3].toInt(),lst[4].toInt()); + lst=t.readLine().split("\t", QString::SkipEmptyParts); + plot->setSpacing(lst[1].toInt(),lst[2].toInt()); + lst=t.readLine().split("\t", QString::SkipEmptyParts); + plot->setLayerCanvasSize(lst[1].toInt(),lst[2].toInt()); + lst=t.readLine().split("\t", QString::SkipEmptyParts); + plot->setAlignement(lst[1].toInt(),lst[2].toInt()); + } + + while ( s != "" ){//open layers + s = t.readLine(); + if (s.contains("")){ + QStringList lst = s.trimmed().remove("").remove("").split(","); + if (lst.size() >= 2) + plot->setWaterfallOffset(lst[0].toInt(), lst[1].toInt()); + if (lst.size() >= 3) + plot->setWaterfallSideLines(lst[2].toInt()); + plot->createWaterfallBox(); + } + + if (s.left(7) == ""){ + list.clear(); + while ( s != "" ){ + s = t.readLine(); + list<")) + plot->linkXLayerAxes(s.trimmed().remove("").remove("").toInt()); + else if (s.contains("")) + plot->setAlignPolicy((MultiLayer::AlignPolicy)s.trimmed().remove("").remove("").toInt()); + } + plot->blockSignals(false); + progress.setValue(aux); + } else if (s == "") {//process 3D plots information + list.clear(); + title = titleBase + QString::number(++aux)+"/"+QString::number(widgets); + progress.setLabelText(title); + while ( s != "" ){ + s = t.readLine(); + list << s; + } + Graph3D::restore(app, list, d_file_version); + progress.setValue(aux); + } else if (s == "") + app->goToParentFolder(); + else if (s == ""){//process analysis information + s = t.readLine(); + QString log = s + "\n"; + while(s != ""){ + s = t.readLine(); + log += s + "\n"; + } + if (app->current_folder) + app->current_folder->appendLogInfo(log.remove("")); + } + } + f.close(); + + if (progress.wasCanceled()){ + app->saved = true; + app->close(); + return 0; + } + + QFileInfo fi2(f); + QString fileName = fi2.absFilePath(); + + app->updateRecentProjectsList(fileName); + + app->folders->setCurrentItem(cf->folderListItem()); + app->folders->blockSignals (false); + app->changeFolder(cf, true);//change folder to user defined current folder + app->blockSignals (false); + app->renamedTables.clear(); + + app->restoreApplicationGeometry(); + app->executeNotes(); + app->savedProject(); + app->d_opening_file = false; + app->d_workspace->blockSignals(false); + app->addWindowsListToCompleter(); + return app; +} + +void ApplicationWindow::executeNotes() +{ + QList lst = projectFolder()->windowsList(); + foreach(MdiSubWindow *widget, lst) + if (widget->isA("Note") && ((Note*)widget)->autoexec()) + ((Note*)widget)->executeAll(); +} + +void ApplicationWindow::scriptError(const QString &message, const QString &scriptName, int lineNumber) +{ + Q_UNUSED(scriptName); + Q_UNUSED(lineNumber); + + QMessageBox::critical(this, tr("QtiPlot") + " - "+ tr("Script Error"), message); +} + +void ApplicationWindow::scriptPrint(const QString &text) +{ +#ifdef SCRIPTING_CONSOLE + if(!text.stripWhiteSpace().isEmpty()) console->append(text); +#else + printf(text.ascii()); +#endif +} + +bool ApplicationWindow::setScriptingLanguage(const QString &lang, bool force) +{ + if (!force && lang == scriptEnv->name())return true; + if (lang.isEmpty()) return false; + + ScriptingEnv *newEnv = ScriptingLangManager::newEnv(lang, this); + if (!newEnv) + return false; + + connect(newEnv, SIGNAL(error(const QString&,const QString&,int)), + this, SLOT(scriptError(const QString&,const QString&,int))); + connect(newEnv, SIGNAL(print(const QString&)), this, SLOT(scriptPrint(const QString&))); + if (!newEnv->initialize()){ + delete newEnv; + return false; + } + + // notify everyone who might be interested + ScriptingChangeEvent *sce = new ScriptingChangeEvent(newEnv); + QApplication::sendEvent(this, sce); + delete sce; + + initCompleter(); + + foreach(QObject *i, findChildren()) + QApplication::postEvent(i, new ScriptingChangeEvent(newEnv)); + if (scriptWindow) + foreach(QObject *i, scriptWindow->findChildren()) + QApplication::postEvent(i, new ScriptingChangeEvent(newEnv)); + +#ifdef SCRIPTING_PYTHON + bool python = (lang == QString("Python")); + actionCommentSelection->setEnabled(python); + actionUncommentSelection->setEnabled(python); +#endif + + return true; +} + +void ApplicationWindow::showScriptingLangDialog() +{ + ScriptingLangDialog* d = new ScriptingLangDialog(scriptEnv, this); + d->exec(); +} + +void ApplicationWindow::restartScriptingEnv() +{ + if (setScriptingLanguage(scriptEnv->name(), true)) + executeNotes(); + else + QMessageBox::critical(this, tr("QtiPlot - Scripting Error"), + tr("Scripting language \"%1\" failed to initialize.").arg(scriptEnv->name())); +} + +void ApplicationWindow::openTemplate() +{ + QString filter = "QtiPlot 2D Graph Template (*.qpt);;"; + filter += "QtiPlot 3D Surface Template (*.qst);;"; + filter += "QtiPlot Table Template (*.qtt);;"; + filter += "QtiPlot Matrix Template (*.qmt);;"; + + QString fn = getFileName(this, tr("QtiPlot - Open Template File"), templatesDir, filter, 0, false); + if (!fn.isEmpty()){ + QFileInfo fi(fn); + templatesDir = fi.dirPath(true); + if (fn.contains(".qmt") || fn.contains(".qpt") || fn.contains(".qtt") || fn.contains(".qst")) + openTemplate(fn); + else { + QMessageBox::critical(this,tr("QtiPlot - File opening error"), + tr("The file: %1 is not a QtiPlot template file!").arg(fn)); + return; + } + } +} + +MdiSubWindow* ApplicationWindow::openTemplate(const QString& fn) +{ + if (fn.isEmpty() || !QFile::exists(fn)){ + QMessageBox::critical(this, tr("QtiPlot - File opening error"), + tr("The file: %1 doesn't exist!").arg(fn)); + return 0; + } + + QFile f(fn); + QTextStream t(&f); + t.setEncoding(QTextStream::UnicodeUTF8); + f.open(QIODevice::ReadOnly); + QStringList l=t.readLine().split(QRegExp("\\s"), QString::SkipEmptyParts); + QString fileType=l[0]; + if (fileType != "QtiPlot"){ + QMessageBox::critical(this,tr("QtiPlot - File opening error"), + tr("The file: %1 was not created using QtiPlot!").arg(fn)); + return 0; + } + + QStringList vl = l[1].split(".", QString::SkipEmptyParts); + d_file_version = 100*(vl[0]).toInt()+10*(vl[1]).toInt()+(vl[2]).toInt(); + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + MdiSubWindow *w = 0; + QString templateType; + t>>templateType; + + if (templateType == "") { + t.skipWhiteSpace(); + QStringList lst; + while (!t.atEnd()) + lst << t.readLine(); + w = Graph3D::restore(this, lst, d_file_version); + if (w) + ((Graph3D *)w)->clearData(); + } else { + int rows, cols; + t>>rows; t>>cols; + t.skipWhiteSpace(); + QString geometry = t.readLine(); + + if (templateType == ""){ + w = multilayerPlot(generateUniqueName(tr("Graph")), 0, rows, cols); + if (w){ + MultiLayer *ml = qobject_cast(w); + restoreWindowGeometry(this, w, geometry); + if (d_file_version > 83){ + QStringList lst=t.readLine().split("\t", QString::SkipEmptyParts); + ml->setMargins(lst[1].toInt(),lst[2].toInt(),lst[3].toInt(),lst[4].toInt()); + lst=t.readLine().split("\t", QString::SkipEmptyParts); + ml->setSpacing(lst[1].toInt(),lst[2].toInt()); + lst=t.readLine().split("\t", QString::SkipEmptyParts); + ml->setLayerCanvasSize(lst[1].toInt(),lst[2].toInt()); + lst=t.readLine().split("\t", QString::SkipEmptyParts); + ml->setAlignement(lst[1].toInt(),lst[2].toInt()); + } + while (!t.atEnd()){//open layers + QString s = t.readLine(); + if (s.contains("")){ + QStringList lst = s.trimmed().remove("").remove("").split(","); + if (lst.size() >= 2) + ml->setWaterfallOffset(lst[0].toInt(), lst[1].toInt()); + if (lst.size() >= 3) + ml->setWaterfallSideLines(lst[2].toInt()); + ml->createWaterfallBox(); + } + if (s.left(7) == ""){ + QStringList lst; + while ( s != "" ){ + s = t.readLine(); + lst << s; + } + openGraph(this, ml, lst); + } + if (s.contains("")) + ml->linkXLayerAxes(s.trimmed().remove("").remove("").toInt()); + else if (s.contains("")) + ml->setAlignPolicy((MultiLayer::AlignPolicy)s.trimmed().remove("").remove("").toInt()); + } + } + } else { + if (templateType == "") + w = newTable(tr("Table1"), rows, cols); + else if (templateType == "") + w = newMatrix(rows, cols); + if (w){ + QStringList lst; + while (!t.atEnd()) + lst << t.readLine(); + w->restore(lst); + restoreWindowGeometry(this, w, geometry); + } + } + } + + f.close(); + if (w){ + w->show(); + customMenu(w); + customToolBars(w); + } + + QApplication::restoreOverrideCursor(); + return w; +} + +void ApplicationWindow::readSettings() +{ +#ifdef Q_OS_MAC // Mac + QSettings settings(QSettings::IniFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); +#else + QSettings settings(QSettings::NativeFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); +#endif + + /* ---------------- group General --------------- */ + settings.beginGroup("/General"); + settings.beginGroup("/ApplicationGeometry");//main window geometry + d_app_rect = QRect(settings.value("/x", 0).toInt(), settings.value("/y", 0).toInt(), + settings.value("/width", 0).toInt(), settings.value("/height", 0).toInt()); + settings.endGroup(); + + autoSearchUpdates = settings.value("/AutoSearchUpdates", false).toBool(); + appLanguage = settings.value("/Language", QLocale::system().name().section('_',0,0)).toString(); + show_windows_policy = (ShowWindowsPolicy)settings.value("/ShowWindowsPolicy", ApplicationWindow::ActiveFolder).toInt(); + + recentProjects = settings.value("/RecentProjects").toStringList(); + //Follows an ugly hack added by Ion in order to fix Qt4 porting issues + //(only needed on Windows due to a Qt bug?) +#ifdef Q_OS_WIN + if (!recentProjects.isEmpty() && recentProjects[0].contains("^e")) + recentProjects = recentProjects[0].split("^e", QString::SkipEmptyParts); + else if (recentProjects.count() == 1){ + QString s = recentProjects[0]; + if (s.remove(QRegExp("\\s")).isEmpty()) + recentProjects = QStringList(); + } +#endif + + updateRecentProjectsList(); + + changeAppStyle(settings.value("/Style", appStyle).toString()); + autoSave = settings.value("/AutoSave",true).toBool(); + autoSaveTime = settings.value("/AutoSaveTime",15).toInt(); + d_backup_files = settings.value("/BackupProjects", true).toBool(); + d_init_window_type = (WindowType)settings.value("/InitWindow", TableWindow).toInt(); + d_completion = settings.value("/Completion", true).toBool(); + defaultScriptingLang = settings.value("/ScriptingLang","muParser").toString(); + + bool thousandsSep = settings.value("/ThousandsSeparator", true).toBool(); + QLocale loc = QLocale(settings.value("/Locale", QLocale::system().name()).toString()); + if (!thousandsSep) + loc.setNumberOptions(QLocale::OmitGroupSeparator); + setLocale(loc); + QLocale::setDefault(loc); + + d_decimal_digits = settings.value("/DecimalDigits", 13).toInt(); + d_clipboard_locale = QLocale(settings.value("/ClipboardLocale", QLocale::system().name()).toString()); + d_muparser_c_locale = settings.value("/MuParserCLocale", true).toBool(); + + d_matrix_undo_stack_size = settings.value("/MatrixUndoStackSize", 10).toInt(); + d_eol = (EndLineChar)settings.value("/EndOfLine", d_eol).toInt(); + + //restore dock windows and tool bars + restoreState(settings.value("/DockWindows").toByteArray()); + explorerSplitter->restoreState(settings.value("/ExplorerSplitter").toByteArray()); + QList lst = explorerSplitter->sizes(); + for (int i=0; i< lst.count(); i++){ + if (lst[i] == 0){ + lst[i] = 45; + explorerSplitter->setSizes(lst); + } + } + + QStringList applicationFont = settings.value("/Font").toStringList(); + if (applicationFont.size() == 4) + appFont=QFont (applicationFont[0],applicationFont[1].toInt(),applicationFont[2].toInt(),applicationFont[3].toInt()); + + QStringList colors = settings.value("/IndexedColors").toStringList(); + if (!colors.isEmpty()){ + d_indexed_colors.clear(); + for (int i = 0; i < colors.size(); i++) + d_indexed_colors << QColor(colors[i]); + } + d_indexed_color_names = settings.value("/IndexedColorNames", d_indexed_color_names).toStringList(); + + QStringList symbols = settings.value("/IndexedSymbolsList").toStringList(); + if (!symbols.isEmpty()){ + d_symbols_list.clear(); + for (int i = 0; i < symbols.size(); i++) + d_symbols_list << symbols[i].toInt(); + } + + settings.beginGroup("/Dialogs"); + d_extended_open_dialog = settings.value("/ExtendedOpenDialog", true).toBool(); + d_extended_export_dialog = settings.value("/ExtendedExportDialog", true).toBool(); + d_extended_import_ASCII_dialog = settings.value("/ExtendedImportAsciiDialog", true).toBool(); + d_extended_plot_dialog = settings.value("/ExtendedPlotDialog", true).toBool();//used by PlotDialog + + settings.beginGroup("/AddRemoveCurves"); + d_add_curves_dialog_size = QSize(settings.value("/Width", 700).toInt(), settings.value("/Height", 400).toInt()); + d_show_current_folder = settings.value("/ShowCurrentFolder", false).toBool(); + settings.endGroup(); // AddRemoveCurves Dialog + settings.endGroup(); // Dialogs + + settings.beginGroup("/Colors"); + workspaceColor = settings.value("/Workspace","darkGray").value(); + // see http://doc.trolltech.com/4.2/qvariant.html for instructions on qcolor <-> qvariant conversion + panelsColor = settings.value("/Panels","#ffffff").value(); + panelsTextColor = settings.value("/PanelsText","#000000").value(); + settings.endGroup(); // Colors + + settings.beginGroup("/Paths"); + QString appPath = qApp->applicationDirPath(); + workingDir = settings.value("/WorkingDir", appPath).toString(); +#ifdef Q_OS_WIN + fitPluginsPath = settings.value("/FitPlugins", "fitPlugins").toString(); + templatesDir = settings.value("/TemplatesDir", appPath).toString(); + asciiDirPath = settings.value("/ASCII", appPath).toString(); + imagesDirPath = settings.value("/Images", appPath).toString(); +#else + fitPluginsPath = settings.value("/FitPlugins", "/usr/lib/qtiplot/plugins").toString(); + templatesDir = settings.value("/TemplatesDir", QDir::homePath()).toString(); + asciiDirPath = settings.value("/ASCII", QDir::homePath()).toString(); + imagesDirPath = settings.value("/Images", QDir::homePath()).toString(); + workingDir = settings.value("/WorkingDir", QDir::homePath()).toString(); +#endif + scriptsDirPath = settings.value("/ScriptsDir", appPath).toString(); + fitModelsPath = settings.value("/FitModelsDir", "").toString(); + customActionsDirPath = settings.value("/CustomActionsDir", "").toString(); + helpFilePath = settings.value("/HelpFile", helpFilePath).toString(); + d_translations_folder = settings.value("/Translations", d_translations_folder).toString(); + d_python_config_folder = settings.value("/PythonConfigDir", d_python_config_folder).toString(); + d_latex_compiler_path = settings.value("/LaTeXCompiler", d_latex_compiler_path).toString(); + settings.endGroup(); // Paths + + d_open_project_filter = settings.value("/OpenProjectFilter", d_open_project_filter).toString(); + d_latex_compiler = settings.value("/TeXCompilerPolicy", d_latex_compiler).toInt(); + settings.endGroup(); + /* ------------- end group General ------------------- */ + + settings.beginGroup("/UserFunctions"); + if (100*maj_version + 10*min_version + patch_version == 91 && + settings.contains("/FitFunctions")){ + saveFitFunctions(settings.value("/FitFunctions").toStringList()); + settings.remove("/FitFunctions"); + } + surfaceFunc = settings.value("/SurfaceFunctions").toStringList(); + xFunctions = settings.value("/xFunctions").toStringList(); + yFunctions = settings.value("/yFunctions").toStringList(); + rFunctions = settings.value("/rFunctions").toStringList(); + thetaFunctions = settings.value("/thetaFunctions").toStringList(); + d_param_surface_func = settings.value("/ParametricSurfaces").toStringList(); + d_recent_functions = settings.value("/Functions").toStringList(); + settings.endGroup(); // UserFunctions + + settings.beginGroup("/Confirmations"); + confirmCloseFolder = settings.value("/Folder", true).toBool(); + confirmCloseTable = settings.value("/Table", true).toBool(); + confirmCloseMatrix = settings.value("/Matrix", true).toBool(); + confirmClosePlot2D = settings.value("/Plot2D", true).toBool(); + confirmClosePlot3D = settings.value("/Plot3D", true).toBool(); + confirmCloseNotes = settings.value("/Note", true).toBool(); + d_inform_rename_table = settings.value("/RenameTable", true).toBool(); + d_confirm_overwrite = settings.value("/Overwrite", true).toBool(); + settings.endGroup(); // Confirmations + + + /* ---------------- group Tables --------------- */ + settings.beginGroup("/Tables"); + d_show_table_comments = settings.value("/DisplayComments", false).toBool(); + d_auto_update_table_values = settings.value("/AutoUpdateValues", true).toBool(); + + QStringList tableFonts = settings.value("/Fonts").toStringList(); + if (tableFonts.size() == 8) + { + tableTextFont=QFont (tableFonts[0],tableFonts[1].toInt(),tableFonts[2].toInt(),tableFonts[3].toInt()); + tableHeaderFont=QFont (tableFonts[4],tableFonts[5].toInt(),tableFonts[6].toInt(),tableFonts[7].toInt()); + } + + settings.beginGroup("/Colors"); + tableBkgdColor = settings.value("/Background","#ffffff").value(); + tableTextColor = settings.value("/Text","#000000").value(); + tableHeaderColor = settings.value("/Header","#000000").value(); + settings.endGroup(); // Colors + settings.endGroup(); + /* --------------- end group Tables ------------------------ */ + + /* --------------- group 2D Plots ----------------------------- */ + settings.beginGroup("/2DPlots"); + settings.beginGroup("/General"); + titleOn = settings.value("/Title", true).toBool(); + canvasFrameWidth = settings.value("/CanvasFrameWidth", 0).toInt(); + defaultPlotMargin = settings.value("/Margin", 0).toInt(); + drawBackbones = settings.value("/AxesBackbones", true).toBool(); + axesLineWidth = settings.value("/AxesLineWidth", 1).toInt(); + autoscale2DPlots = settings.value("/Autoscale", true).toBool(); + autoScaleFonts = settings.value("/AutoScaleFonts", true).toBool(); + autoResizeLayers = settings.value("/AutoResizeLayers", true).toBool(); + antialiasing2DPlots = settings.value("/Antialiasing", antialiasing2DPlots).toBool(); + d_scale_plots_on_print = settings.value("/ScaleLayersOnPrint", false).toBool(); + d_print_cropmarks = settings.value("/PrintCropmarks", false).toBool(); + d_layer_geometry_unit = settings.value("/GeometryUnit", d_layer_geometry_unit).toInt(); + d_layer_canvas_width = settings.value("/LayerCanvasWidth", d_layer_canvas_width).toInt(); + d_layer_canvas_height = settings.value("/LayerCanvasHeight", d_layer_canvas_height).toInt(); + + QStringList graphFonts = settings.value("/Fonts").toStringList(); + if (graphFonts.size() == 16) { + plotAxesFont=QFont (graphFonts[0],graphFonts[1].toInt(),graphFonts[2].toInt(),graphFonts[3].toInt()); + plotNumbersFont=QFont (graphFonts[4],graphFonts[5].toInt(),graphFonts[6].toInt(),graphFonts[7].toInt()); + plotLegendFont=QFont (graphFonts[8],graphFonts[9].toInt(),graphFonts[10].toInt(),graphFonts[11].toInt()); + plotTitleFont=QFont (graphFonts[12],graphFonts[13].toInt(),graphFonts[14].toInt(),graphFonts[15].toInt()); + } + d_in_place_editing = settings.value("/InPlaceEditing", true).toBool(); + d_graph_background_color = settings.value("/BackgroundColor", d_graph_background_color).value(); + d_graph_canvas_color = settings.value("/CanvasColor", d_graph_canvas_color).value(); + d_graph_border_color = settings.value("/FrameColor", d_graph_border_color).value(); + d_graph_background_opacity = settings.value("/BackgroundOpacity", d_graph_background_opacity).toInt(); + d_graph_canvas_opacity = settings.value("/BackgroundOpacity", d_graph_canvas_opacity).toInt(); + d_graph_border_width = settings.value("/FrameWidth", d_graph_border_width).toInt(); + d_canvas_frame_color = settings.value("/FrameColor", Qt::black).value(); + d_graph_axes_labels_dist = settings.value("/LabelsAxesDist", d_graph_axes_labels_dist).toInt(); + d_graph_tick_labels_dist = settings.value("/TickLabelsDist", d_graph_tick_labels_dist).toInt(); + int size = settings.beginReadArray("EnabledAxes"); + for (int i = 0; i < size; ++i) { + settings.setArrayIndex(i); + d_show_axes[i] = settings.value("enabled", true).toBool(); + d_show_axes_labels[i] = settings.value("labels", true).toBool(); + } + settings.endArray(); + d_graph_legend_display = (Graph::LegendDisplayMode)settings.value("/LegendDisplayMode", d_graph_legend_display).toInt(); + d_graph_axis_labeling = (Graph::AxisTitlePolicy)settings.value("/AxisTitlePolicy", d_graph_axis_labeling).toInt(); + d_keep_aspect_ration = settings.value("/KeepAspectRatio", d_keep_aspect_ration).toBool(); + d_synchronize_graph_scales = settings.value("/SynchronizeScales", d_synchronize_graph_scales).toBool(); + settings.endGroup(); // General + + settings.beginGroup("/Curves"); + defaultCurveStyle = settings.value("/Style", Graph::LineSymbols).toInt(); + defaultCurveLineWidth = settings.value("/LineWidth", 1).toDouble(); + d_curve_line_style = settings.value("/LineType", d_curve_line_style).toInt(); + defaultSymbolSize = settings.value("/SymbolSize", 7).toInt(); + defaultSymbolEdge = settings.value("/SymbolEdge", defaultSymbolEdge).toDouble(); + d_fill_symbols = settings.value("/FillSymbols", d_fill_symbols).toBool(); + d_symbol_style = settings.value("/SymbolStyle", d_symbol_style).toInt(); + d_indexed_symbols = settings.value("/IndexedSymbols", d_indexed_symbols).toBool(); + defaultCurveBrush = settings.value("/BrushStyle", defaultCurveBrush).toInt(); + defaultCurveAlpha = settings.value("/BrushAlpha", defaultCurveAlpha).toInt(); + settings.endGroup(); // Curves + + settings.beginGroup("/Ticks"); + majTicksStyle = settings.value("/MajTicksStyle", ScaleDraw::Out).toInt(); + minTicksStyle = settings.value("/MinTicksStyle", ScaleDraw::Out).toInt(); + minTicksLength = settings.value("/MinTicksLength", 5).toInt(); + majTicksLength = settings.value("/MajTicksLength", 9).toInt(); + settings.endGroup(); // Ticks + + settings.beginGroup("/Legend"); + legendFrameStyle = settings.value("/FrameStyle", LegendWidget::Line).toInt(); + d_frame_widget_pen.setColor(settings.value("/FrameColor", Qt::black).value()); + d_frame_widget_pen.setWidthF(settings.value("/FrameWidth", 1).toDouble()); + d_frame_widget_pen.setStyle(PenStyleBox::penStyle(settings.value("/FramePenStyle", 0).toInt())); + + legendTextColor = settings.value("/TextColor", "#000000").value(); //default color Qt::black + legendBackground = settings.value("/BackgroundColor", Qt::white).value(); //default color Qt::white + legendBackground.setAlpha(settings.value("/Transparency", 0).toInt()); // transparent by default; + d_legend_default_angle = settings.value("/Angle", 0).toInt(); + d_frame_geometry_unit = settings.value("/DefaultGeometryUnit", FrameWidget::Scale).toInt(); + settings.endGroup(); // Legend + + settings.beginGroup("/Arrows"); + defaultArrowLineWidth = settings.value("/Width", 1).toDouble(); + defaultArrowColor = settings.value("/Color", "#000000").value();//default color Qt::black + defaultArrowHeadLength = settings.value("/HeadLength", 4).toInt(); + defaultArrowHeadAngle = settings.value("/HeadAngle", 45).toInt(); + defaultArrowHeadFill = settings.value("/HeadFill", true).toBool(); + defaultArrowLineStyle = Graph::getPenStyle(settings.value("/LineStyle", "SolidLine").toString()); + settings.endGroup(); // Arrows + + settings.beginGroup("/Rectangle"); + d_rect_default_background = settings.value("/BackgroundColor", Qt::white).value(); + d_rect_default_background.setAlpha(settings.value("/Transparency", 255).toInt()); + + d_rect_default_brush.setColor(settings.value("/BrushColor", d_rect_default_brush).value()); + d_rect_default_brush.setStyle(PatternBox::brushStyle(settings.value("/Pattern", 0).toInt())); + settings.endGroup(); // Rectangle + settings.endGroup(); + /* ----------------- end group 2D Plots --------------------------- */ + + /* ----------------- group 3D Plots --------------------------- */ + settings.beginGroup("/3DPlots"); + d_3D_legend = settings.value("/Legend",true).toBool(); + d_3D_projection = settings.value("/Projection", d_3D_projection).toInt(); + d_3D_smooth_mesh = settings.value("/Antialiasing", true).toBool(); + d_3D_resolution = settings.value ("/Resolution", 1).toInt(); + d_3D_orthogonal = settings.value("/Orthogonal", false).toBool(); + d_3D_autoscale = settings.value ("/Autoscale", true).toBool(); + + QStringList plot3DFonts = settings.value("/Fonts").toStringList(); + if (plot3DFonts.size() == 12){ + d_3D_title_font=QFont (plot3DFonts[0],plot3DFonts[1].toInt(),plot3DFonts[2].toInt(),plot3DFonts[3].toInt()); + d_3D_numbers_font=QFont (plot3DFonts[4],plot3DFonts[5].toInt(),plot3DFonts[6].toInt(),plot3DFonts[7].toInt()); + d_3D_axes_font=QFont (plot3DFonts[8],plot3DFonts[9].toInt(),plot3DFonts[10].toInt(),plot3DFonts[11].toInt()); + } + + settings.beginGroup("/Colors"); + QColor max_color = settings.value("/MaxData", Qt::red).value(); + d_3D_labels_color = settings.value("/Labels", d_3D_labels_color).value(); + d_3D_mesh_color = settings.value("/Mesh", d_3D_mesh_color).value(); + QColor min_color = settings.value("/MinData", Qt::blue).value(); + d_3D_numbers_color = settings.value("/Numbers", d_3D_numbers_color).value(); + d_3D_axes_color = settings.value("/Axes", d_3D_axes_color).value(); + d_3D_background_color = settings.value("/Background", d_3D_background_color).value(); + + d_3D_color_map = QwtLinearColorMap(min_color, max_color); + d_3D_color_map.setMode((QwtLinearColorMap::Mode)settings.value("/ColorMapMode", QwtLinearColorMap::ScaledColors).toInt()); + QList stop_values = settings.value("/ColorMapStops").toList(); + QStringList stop_colors = settings.value("/ColorMapColors").toStringList(); + for (int i = 0; i < stop_colors.size(); i++) + d_3D_color_map.addColorStop(stop_values[i].toDouble(), QColor(stop_colors[i])); + + settings.endGroup(); // Colors + + settings.beginGroup("/Grids"); + d_3D_major_grids = settings.value("/EnableMajor", d_3D_major_grids).toBool(); + d_3D_grid_color = settings.value("/MajorColor", d_3D_grid_color).value(); + d_3D_major_style = settings.value("/MajorStyle", d_3D_major_style).toInt(); + d_3D_major_width = settings.value("/MajorWidth", d_3D_major_width).toDouble(); + + d_3D_minor_grids = settings.value("/EnableMinor", d_3D_minor_grids).toBool(); + d_3D_minor_grid_color = settings.value("/MinorColor", d_3D_minor_grid_color).value(); + d_3D_minor_style = settings.value("/MinorStyle", d_3D_minor_style).toInt(); + d_3D_minor_width = settings.value("/MinorWidth", d_3D_minor_width).toDouble(); + settings.endGroup(); // Grids + + settings.endGroup(); + /* ----------------- end group 3D Plots --------------------------- */ + + settings.beginGroup("/Fitting"); + fit_output_precision = settings.value("/OutputPrecision", 15).toInt(); + pasteFitResultsToPlot = settings.value("/PasteResultsToPlot", false).toBool(); + writeFitResultsToLog = settings.value("/WriteResultsToLog", true).toBool(); + generateUniformFitPoints = settings.value("/GenerateFunction", true).toBool(); + fitPoints = settings.value("/Points", 100).toInt(); + generatePeakCurves = settings.value("/GeneratePeakCurves", true).toBool(); + peakCurvesColor = QColor(settings.value("/PeakColor", peakCurvesColor.name()).toString());//green color + fit_scale_errors = settings.value("/ScaleErrors", true).toBool(); + d_2_linear_fit_points = settings.value("/TwoPointsLinearFit", true).toBool(); + d_multi_peak_messages = settings.value("/MultiPeakToolMsg", d_multi_peak_messages).toBool(); + settings.endGroup(); // Fitting + + settings.beginGroup("/ImportASCII"); + columnSeparator = settings.value("/ColumnSeparator", "\\t").toString(); + columnSeparator.replace("\\t", "\t").replace("\\s", " "); + ignoredLines = settings.value("/IgnoreLines", 0).toInt(); + renameColumns = settings.value("/RenameColumns", true).toBool(); + strip_spaces = settings.value("/StripSpaces", false).toBool(); + simplify_spaces = settings.value("/SimplifySpaces", false).toBool(); + d_ASCII_file_filter = settings.value("/AsciiFileTypeFilter", "*").toString(); + d_ASCII_import_locale = settings.value("/AsciiImportLocale", QLocale::system().name()).toString(); + if (settings.value("/OmitGroupSeparator", false).toBool()) + d_ASCII_import_locale.setNumberOptions(QLocale::OmitGroupSeparator); + + d_ASCII_import_mode = settings.value("/ImportMode", ImportASCIIDialog::NewTables).toInt(); + d_ASCII_comment_string = settings.value("/CommentString", "#").toString(); + d_ASCII_import_comments = settings.value("/ImportComments", false).toBool(); + d_ASCII_import_read_only = settings.value("/ImportReadOnly", false).toBool(); + d_ASCII_import_preview = settings.value("/Preview", true).toBool(); + d_preview_lines = settings.value("/PreviewLines", 100).toInt(); + d_ASCII_end_line = (EndLineChar)settings.value("/EndLineCharacter", d_ASCII_end_line).toInt(); + d_ASCII_import_first_row_role = settings.value("/FirstLineRole", 0).toInt(); + d_import_ASCII_dialog_size = settings.value("/DialogSize", d_import_ASCII_dialog_size).toSize(); + settings.endGroup(); // Import ASCII + + settings.beginGroup("/ExportASCII"); + d_export_col_separator = settings.value("/ColumnSeparator", "\\t").toString(); + d_export_col_separator.replace("\\t", "\t").replace("\\s", " "); + d_export_col_names = settings.value("/ExportLabels", false).toBool(); + d_export_col_comment = settings.value("/ExportComments", false).toBool(); + d_export_table_selection = settings.value("/ExportSelection", false).toBool(); + d_export_ASCII_file_filter = settings.value("/ExportAsciiFilter", d_export_ASCII_file_filter).toString(); + settings.endGroup(); // ExportASCII + + settings.beginGroup("/ExportImage"); + d_image_export_filter = settings.value("/ImageFileTypeFilter", ".png").toString(); + d_export_transparency = settings.value("/ExportTransparency", false).toBool(); + d_export_quality = settings.value("/ImageQuality", 100).toInt(); + d_export_vector_resolution = settings.value("/Resolution", d_export_vector_resolution).toInt(); + d_export_color = settings.value("/ExportColor", true).toBool(); + d_3D_export_text_mode = settings.value("/3DTextMode", d_3D_export_text_mode).toInt(); + d_3D_export_sort = settings.value("/3DSortMode", d_3D_export_sort).toInt(); + d_export_bitmap_resolution = settings.value("/BitmapResolution", d_export_bitmap_resolution).toInt(); + d_export_raster_size = settings.value("/RasterSize", d_export_raster_size).toSizeF(); + d_export_size_unit = settings.value("/SizeUnit", d_export_size_unit).toInt(); + d_scale_fonts_factor = settings.value("/ScaleFontsFactor", d_scale_fonts_factor).toDouble(); + d_export_escape_tex_strings = settings.value("/EscapeTeXStrings", true).toBool(); + d_export_tex_font_sizes = settings.value("/ExportTeXFontSize", true).toBool(); + settings.endGroup(); // ExportImage + + settings.beginGroup("/ScriptWindow"); + d_script_win_on_top = settings.value("/AlwaysOnTop", false).toBool(); + d_script_win_rect = QRect(settings.value("/x", 0).toInt(), settings.value("/y", 0).toInt(), + settings.value("/width", 500).toInt(), settings.value("/height", 300).toInt()); + settings.endGroup(); + + settings.beginGroup("/ToolBars"); + d_file_tool_bar = settings.value("/FileToolBar", true).toBool(); + d_edit_tool_bar = settings.value("/EditToolBar", true).toBool(); + d_table_tool_bar = settings.value("/TableToolBar", true).toBool(); + d_column_tool_bar = settings.value("/ColumnToolBar", true).toBool(); + d_matrix_tool_bar = settings.value("/MatrixToolBar", true).toBool(); + d_plot_tool_bar = settings.value("/PlotToolBar", true).toBool(); + d_plot3D_tool_bar = settings.value("/Plot3DToolBar", true).toBool(); + d_display_tool_bar = settings.value("/DisplayToolBar", false).toBool(); + d_format_tool_bar = settings.value("/FormatToolBar", true).toBool(); + d_notes_tool_bar = settings.value("/NotesToolBar", true).toBool(); + settings.endGroup(); + + settings.beginGroup("/Notes"); + d_note_line_numbers = settings.value("/LineNumbers", true).toBool(); + d_notes_tab_length = settings.value("/TabLength", d_notes_tab_length).toInt(); + d_notes_font.setFamily(settings.value("/FontFamily", d_notes_font.family()).toString()); + d_notes_font.setPointSize(settings.value("/FontSize", d_notes_font.pointSize()).toInt()); + d_notes_font.setBold(settings.value("/FontBold", d_notes_font.bold()).toBool()); + d_notes_font.setItalic(settings.value("/FontItalic", d_notes_font.italic()).toBool()); + + settings.beginGroup("/SyntaxHighlighting"); + d_comment_highlight_color = settings.value("/Comments", d_comment_highlight_color).value(); + d_keyword_highlight_color = settings.value("/Keywords", d_keyword_highlight_color).value(); + d_quotation_highlight_color = settings.value("/Quotations", d_quotation_highlight_color).value(); + d_numeric_highlight_color = settings.value("/Numbers", d_numeric_highlight_color).value(); + d_function_highlight_color = settings.value("/Functions", d_function_highlight_color).value(); + d_class_highlight_color = settings.value("/QtClasses", d_class_highlight_color).value(); + settings.endGroup(); //end group SyntaxHighlighting + settings.endGroup(); // end group Notes + + settings.beginGroup("/PrintPreview"); + d_print_paper_size = (QPrinter::PaperSize)settings.value("/PaperSize", (int)d_print_paper_size).toInt(); + d_printer_orientation = (QPrinter::Orientation)settings.value("/Orientation", (int)d_printer_orientation).toInt(); + settings.endGroup();//PrintPreview + + settings.beginGroup("/Proxy"); + QNetworkProxy proxy; + proxy.setType(QNetworkProxy::NoProxy); + proxy.setHostName(settings.value("/Host", QString()).toString()); + proxy.setPort(settings.value("/Port", 8080).toInt()); + proxy.setUser(settings.value("/Username", QString()).toString()); + settings.endGroup(); + QNetworkProxy::setApplicationProxy(proxy); +} + +void ApplicationWindow::saveSettings() +{ +#ifdef Q_OS_MAC // Mac + QSettings settings(QSettings::IniFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); +#else + QSettings settings(QSettings::NativeFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); +#endif + + /* ---------------- group General --------------- */ + settings.beginGroup("/General"); + + settings.beginGroup("/ApplicationGeometry"); + d_app_rect = QRect(this->pos(), this->size()); + if (this->isMaximized()) + d_app_rect = QRect(); + + settings.setValue("/x", d_app_rect.x()); + settings.setValue("/y", d_app_rect.y()); + settings.setValue("/width", d_app_rect.width()); + settings.setValue("/height", d_app_rect.height()); + settings.endGroup(); + + settings.setValue("/AutoSearchUpdates", autoSearchUpdates); + settings.setValue("/Language", appLanguage); + settings.setValue("/ShowWindowsPolicy", show_windows_policy); + settings.setValue("/RecentProjects", recentProjects); + settings.setValue("/Style", appStyle); + settings.setValue("/AutoSave", autoSave); + settings.setValue("/AutoSaveTime", autoSaveTime); + settings.setValue("/BackupProjects", d_backup_files); + settings.setValue("/InitWindow", int(d_init_window_type)); + settings.setValue("/Completion", d_completion); + settings.setValue("/ScriptingLang", defaultScriptingLang); + + bool thousandsSep = (locale().numberOptions() & QLocale::OmitGroupSeparator) ? false : true; + settings.setValue("/ThousandsSeparator", thousandsSep); + + settings.setValue("/Locale", locale().name()); + settings.setValue("/DecimalDigits", d_decimal_digits); + settings.setValue("/ClipboardLocale", d_clipboard_locale.name()); + settings.setValue("/MuParserCLocale", d_muparser_c_locale); + + settings.setValue("/MatrixUndoStackSize", d_matrix_undo_stack_size); + settings.setValue("/EndOfLine", (int)d_eol); + settings.setValue("/DockWindows", saveState()); + settings.setValue("/ExplorerSplitter", explorerSplitter->saveState()); + + QStringList applicationFont; + applicationFont< stop_values; + QStringList stop_colors; + QwtArray colors = d_3D_color_map.colorStops(); + int stops = (int)colors.size() - 1; + for (int i = 1; i < stops; i++){ + stop_values << QVariant(colors[i]); + stop_colors << QColor(d_3D_color_map.rgb(QwtDoubleInterval(0, 1), colors[i])).name(); + } + settings.setValue("/ColorMapStops", QVariant(stop_values)); + settings.setValue("/ColorMapColors", stop_colors); + settings.endGroup(); // Colors + + settings.beginGroup("/Grids"); + settings.setValue("/EnableMajor", d_3D_major_grids); + settings.setValue("/MajorColor", d_3D_grid_color); + settings.setValue("/MajorStyle", d_3D_major_style); + settings.setValue("/MajorWidth", d_3D_major_width); + settings.setValue("/EnableMinor", d_3D_minor_grids); + settings.setValue("/MinorColor", d_3D_minor_grid_color); + settings.setValue("/MinorStyle", d_3D_minor_style); + settings.setValue("/MinorWidth", d_3D_minor_width); + settings.endGroup(); // Grids + + settings.endGroup(); + /* ----------------- end group 3D Plots -------- */ + + settings.beginGroup("/Fitting"); + settings.setValue("/OutputPrecision", fit_output_precision); + settings.setValue("/PasteResultsToPlot", pasteFitResultsToPlot); + settings.setValue("/WriteResultsToLog", writeFitResultsToLog); + settings.setValue("/GenerateFunction", generateUniformFitPoints); + settings.setValue("/Points", fitPoints); + settings.setValue("/GeneratePeakCurves", generatePeakCurves); + settings.setValue("/PeakColor", peakCurvesColor.name()); + settings.setValue("/ScaleErrors", fit_scale_errors); + settings.setValue("/TwoPointsLinearFit", d_2_linear_fit_points); + settings.setValue("/MultiPeakToolMsg", d_multi_peak_messages); + settings.endGroup(); // Fitting + + settings.beginGroup("/ImportASCII"); + QString sep = columnSeparator; + settings.setValue("/ColumnSeparator", sep.replace("\t", "\\t").replace(" ", "\\s")); + settings.setValue("/IgnoreLines", ignoredLines); + settings.setValue("/RenameColumns", renameColumns); + settings.setValue("/StripSpaces", strip_spaces); + settings.setValue("/SimplifySpaces", simplify_spaces); + settings.setValue("/AsciiFileTypeFilter", d_ASCII_file_filter); + settings.setValue("/AsciiImportLocale", d_ASCII_import_locale.name()); + + bool omitGroupSep = (d_ASCII_import_locale.numberOptions() & QLocale::OmitGroupSeparator) ? true : false; + settings.setValue("/OmitGroupSeparator", omitGroupSep); + + settings.setValue("/ImportMode", d_ASCII_import_mode); + settings.setValue("/CommentString", d_ASCII_comment_string); + settings.setValue("/ImportComments", d_ASCII_import_comments); + settings.setValue("/ImportReadOnly", d_ASCII_import_read_only); + settings.setValue("/Preview", d_ASCII_import_preview); + settings.setValue("/PreviewLines", d_preview_lines); + settings.setValue("/EndLineCharacter", (int)d_ASCII_end_line); + settings.setValue("/FirstLineRole", d_ASCII_import_first_row_role); + settings.setValue("/DialogSize", d_import_ASCII_dialog_size); + settings.endGroup(); // ImportASCII + + settings.beginGroup("/ExportASCII"); + sep = d_export_col_separator; + settings.setValue("/ColumnSeparator", sep.replace("\t", "\\t").replace(" ", "\\s")); + settings.setValue("/ExportLabels", d_export_col_names); + settings.setValue("/ExportComments", d_export_col_comment); + settings.setValue("/ExportSelection", d_export_table_selection); + settings.setValue("/ExportAsciiFilter", d_export_ASCII_file_filter); + settings.endGroup(); // ExportASCII + + settings.beginGroup("/ExportImage"); + settings.setValue("/ImageFileTypeFilter", d_image_export_filter); + settings.setValue("/ExportTransparency", d_export_transparency); + settings.setValue("/ImageQuality", d_export_quality); + settings.setValue("/Resolution", d_export_vector_resolution); + settings.setValue("/ExportColor", d_export_color); + settings.setValue("/3DTextMode", d_3D_export_text_mode); + settings.setValue("/3DSortMode", d_3D_export_sort); + settings.setValue("/BitmapResolution", d_export_bitmap_resolution); + settings.setValue("/RasterSize", d_export_raster_size); + settings.setValue("/SizeUnit", d_export_size_unit); + settings.setValue("/ScaleFontsFactor", d_scale_fonts_factor); + settings.setValue("/EscapeTeXStrings", d_export_escape_tex_strings); + settings.setValue("/ExportTeXFontSize", d_export_tex_font_sizes); + settings.endGroup(); // ExportImage + + settings.beginGroup("/ScriptWindow"); + settings.setValue("/AlwaysOnTop", d_script_win_on_top); + settings.setValue("/x", d_script_win_rect.x()); + settings.setValue("/y", d_script_win_rect.y()); + settings.setValue("/width", d_script_win_rect.width()); + settings.setValue("/height", d_script_win_rect.height()); + settings.endGroup();//ScriptWindow + + settings.beginGroup("/ToolBars"); + settings.setValue("/FileToolBar", d_file_tool_bar); + settings.setValue("/EditToolBar", d_edit_tool_bar); + settings.setValue("/TableToolBar", d_table_tool_bar); + settings.setValue("/ColumnToolBar", d_column_tool_bar); + settings.setValue("/MatrixToolBar", d_matrix_tool_bar); + settings.setValue("/PlotToolBar", d_plot_tool_bar); + settings.setValue("/Plot3DToolBar", d_plot3D_tool_bar); + settings.setValue("/DisplayToolBar", d_display_tool_bar); + settings.setValue("/FormatToolBar", d_format_tool_bar); + settings.setValue("/NotesToolBar", d_notes_tool_bar); + settings.endGroup();//ToolBars + + settings.beginGroup("/Notes"); + settings.setValue("/LineNumbers", d_note_line_numbers); + settings.setValue("/TabLength", d_notes_tab_length); + settings.setValue("/FontFamily", d_notes_font.family()); + settings.setValue("/FontSize", d_notes_font.pointSize()); + settings.setValue("/FontBold", d_notes_font.bold()); + settings.setValue("/FontItalic", d_notes_font.italic()); + settings.beginGroup("/SyntaxHighlighting"); + settings.setValue("/Comments", d_comment_highlight_color.name()); + settings.setValue("/Keywords", d_keyword_highlight_color.name()); + settings.setValue("/Quotations", d_quotation_highlight_color.name()); + settings.setValue("/Numbers", d_numeric_highlight_color.name()); + settings.setValue("/Functions", d_function_highlight_color.name()); + settings.setValue("/QtClasses", d_class_highlight_color.name()); + settings.endGroup();//SyntaxHighlighting + settings.endGroup();//Notes + + settings.beginGroup("/PrintPreview"); + settings.setValue("/PaperSize", (int)d_print_paper_size); + settings.setValue("/Orientation", (int)d_printer_orientation); + settings.endGroup();//PrintPreview + + QNetworkProxy proxy = QNetworkProxy::applicationProxy(); + if (!proxy.hostName().isEmpty()){ + settings.beginGroup("/Proxy"); + settings.setValue("/Host", proxy.hostName()); + settings.setValue("/Port", proxy.port()); + settings.setValue("/Username", proxy.user()); + settings.endGroup();//Proxy + } else + settings.remove("/Proxy"); +} + +void ApplicationWindow::exportGraph(const QString& exportFilter) +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + MultiLayer *plot2D = qobject_cast(w); + Graph3D *plot3D = qobject_cast(w); + if(plot2D && plot2D->isEmpty()){ + QMessageBox::critical(this, tr("QtiPlot - Export Error"), + tr("

There are no plot layers available in this window!

")); + return; + } + + if (!plot2D && !plot3D) + return; + + ImageExportDialog *ied = new ImageExportDialog(w, this, d_extended_export_dialog); + ied->setDirectory(imagesDirPath); + ied->selectFile(w->objectName()); + if (exportFilter.isEmpty()) + ied->selectFilter(d_image_export_filter); + else + ied->selectFilter(exportFilter); + + if ( ied->exec() != QDialog::Accepted ) + return; + imagesDirPath = ied->directory().path(); + + QString selected_filter = ied->selectedFilter().remove("*"); + QString file_name = ied->selectedFiles()[0]; + if(!file_name.endsWith(selected_filter, Qt::CaseInsensitive)) + file_name.append(selected_filter); + + if (plot3D && selected_filter.contains(".pgf")){ + plot3D->exportVector(file_name, ied->textExportMode(), ied->sortMode()); + return; + } + +#ifdef EMF_OUTPUT + if (plot2D && selected_filter.contains(".emf")){ + plot2D->exportEMF(file_name, ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + return; + } +#endif + + if (plot2D && selected_filter.contains(".tex")){ + plot2D->exportTeX(file_name, ied->color(), ied->escapeStrings(), ied->exportFontSizes(), ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + return; + } + + if (selected_filter.contains(".eps") || selected_filter.contains(".pdf") || + selected_filter.contains(".ps") || selected_filter.contains(".svg")) { + if (plot3D) + plot3D->exportVector(file_name, ied->textExportMode(), ied->sortMode(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + else if (plot2D){ + if (selected_filter.contains(".svg")) + plot2D->exportSVG(file_name, ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + else + plot2D->exportVector(file_name, ied->vectorResolution(), ied->color(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + } + } else if (selected_filter.contains(".odf")){ + if (plot2D) + plot2D->exportImage(file_name, ied->quality(), ied->transparency(), ied->bitmapResolution(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + else if (plot3D) + plot3D->exportImage(file_name, ied->quality(), ied->transparency(), ied->bitmapResolution(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + + } else { + QList list = QImageWriter::supportedImageFormats(); + for (int i=0; i<(int)list.count(); i++){ + if (selected_filter.contains("." + (list[i]).lower())) { + if (plot2D) + plot2D->exportImage(file_name, ied->quality(), ied->transparency(), + ied->bitmapResolution(), ied->customExportSize(), ied->sizeUnit(), + ied->scaleFontsFactor()); + else if (plot3D){ + plot3D->exportImage(file_name, ied->quality(), ied->transparency(), + ied->bitmapResolution(), ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + } + } + } + } +} + +void ApplicationWindow::exportLayer() +{ + MdiSubWindow *w = activeWindow(MultiLayerWindow); + if (!w) + return; + + Graph* g = ((MultiLayer*)w)->activeLayer(); + if (!g) + return; + + ImageExportDialog *ied = new ImageExportDialog(w, this, d_extended_export_dialog, g); + ied->setDir(imagesDirPath); + ied->selectFile(w->objectName()); + ied->selectFilter(d_image_export_filter); + if ( ied->exec() != QDialog::Accepted ) + return; + imagesDirPath = ied->directory().path(); + + QString file_name = ied->selectedFiles()[0]; + QString selected_filter = ied->selectedFilter().remove("*"); + if(!file_name.endsWith(selected_filter, Qt::CaseInsensitive)) + file_name.append(selected_filter); + + if (selected_filter.contains(".eps") || selected_filter.contains(".pdf") || selected_filter.contains(".ps")) + g->exportVector(file_name, ied->vectorResolution(), ied->color(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + else if (selected_filter.contains(".svg")) + g->exportSVG(file_name, ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); +#ifdef EMF_OUTPUT + else if (selected_filter.contains(".emf")) + g->exportEMF(file_name, ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); +#endif + else if (selected_filter.contains(".tex")) + g->exportTeX(file_name, ied->color(), ied->escapeStrings(), ied->exportFontSizes(), ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + else if (selected_filter.contains(".odf")) + g->exportImage(file_name, ied->quality(), ied->transparency(), ied->bitmapResolution(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + else { + QList list = QImageWriter::supportedImageFormats(); + for (int i=0; i<(int)list.count(); i++) + if (selected_filter.contains("."+(list[i]).lower())) + g->exportImage(file_name, ied->quality(), ied->transparency(), + ied->bitmapResolution(), ied->customExportSize(), ied->sizeUnit(), + ied->scaleFontsFactor()); + } +} + +void ApplicationWindow::exportPresentationODF() +{ + ImageExportDialog *ied = new ImageExportDialog(NULL, this, d_extended_export_dialog); + ied->setDir(imagesDirPath); + ied->setNameFilter("*.odf"); + + if ( ied->exec() != QDialog::Accepted ) + return; + imagesDirPath = ied->directory().path(); + + QString selected_filter = ied->selectedFilter().remove("*"); + QString file_name = ied->selectedFiles()[0]; + if(!file_name.endsWith(selected_filter, Qt::CaseInsensitive)) + file_name.append(selected_filter); + + QDialog *previewDlg = new QDialog(this); + previewDlg->setSizeGripEnabled(true); + previewDlg->setWindowTitle(tr("QtiPlot") + " - " + tr("Presentation Preview")); + previewDlg->resize(QSize(600, 400)); + + QHBoxLayout *bl = new QHBoxLayout(); + bl->addStretch(); + QPushButton *okBtn = new QPushButton(tr("&Save")); + connect(okBtn, SIGNAL(clicked()), previewDlg, SLOT(accept())); + bl->addWidget(okBtn); + + QPushButton *cancelBtn = new QPushButton(tr("&Cancel")); + connect(cancelBtn, SIGNAL(clicked()), previewDlg, SLOT(reject())); + bl->addWidget(cancelBtn); + bl->addStretch(); + + QVBoxLayout *vl = new QVBoxLayout(previewDlg); + QTextEdit *te = new QTextEdit(); + vl->addWidget(te); + vl->addLayout(bl); + + QTextDocument *document = te->document(); + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (qobject_cast(w)){ + MultiLayer *plot2D = qobject_cast(w); + if (!plot2D->isEmpty()) + plot2D->exportImage(document, ied->quality(), ied->transparency(), ied->bitmapResolution(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + } else if (qobject_cast(w)) + ((Graph3D *)w)->exportImage(document, ied->quality(), ied->transparency(), ied->bitmapResolution(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + } + + if (previewDlg->exec() == QDialog::Accepted){ + QTextDocumentWriter writer(file_name); + writer.write(document); + } +} + +void ApplicationWindow::exportAllGraphs() +{ + ImageExportDialog *ied = new ImageExportDialog(NULL, this, d_extended_export_dialog); + ied->setWindowTitle(tr("Choose a directory to export the graphs to")); + QStringList tmp = ied->filters(); + ied->setFileMode(QFileDialog::Directory); + ied->setFilters(tmp); + ied->setLabelText(QFileDialog::FileType, tr("Output format:")); + ied->setLabelText(QFileDialog::FileName, tr("Directory:")); + ied->setDir(imagesDirPath); + ied->selectFilter(d_image_export_filter); + + if ( ied->exec() != QDialog::Accepted ) + return; + imagesDirPath = ied->directory().path(); + if (ied->selectedFiles().isEmpty()) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QString output_dir = ied->selectedFiles()[0]; + QString file_suffix = ied->selectedFilter(); + file_suffix.lower(); + file_suffix.remove("*"); + + bool confirm_overwrite = d_confirm_overwrite; + MultiLayer *plot2D; + Graph3D *plot3D; + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")) { + plot3D = 0; + plot2D = (MultiLayer *)w; + if (plot2D->isEmpty()) { + QApplication::restoreOverrideCursor(); + QMessageBox::warning(this, tr("QtiPlot - Warning"), + tr("There are no plot layers available in window %1.
" + "Graph window not exported!").arg(plot2D->objectName())); + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + continue; + } + } else if (w->isA("Graph3D")) { + plot2D = 0; + plot3D = (Graph3D *)w; + } else + continue; + + QString file_name = output_dir + "/" + w->objectName() + file_suffix; + QFile f(file_name); + if (f.exists() && confirm_overwrite) { + QApplication::restoreOverrideCursor(); + + QString msg = tr("A file called:

%1

already exists. ""Do you want to overwrite it?").arg(file_name); + QMessageBox msgBox(QMessageBox::Question, tr("QtiPlot - Overwrite file?"), msg, + QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::Cancel, + (ApplicationWindow *)this); + msgBox.exec(); + switch(msgBox.standardButton(msgBox.clickedButton())){ + case QMessageBox::Yes: + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + break; + case QMessageBox::YesToAll: + confirm_overwrite = false; + break; + case QMessageBox::No: + confirm_overwrite = true; + continue; + break; + case QMessageBox::Cancel: + return; + break; + default: + break; + } + } + if ( !f.open( QIODevice::WriteOnly ) ) { + QApplication::restoreOverrideCursor(); + QMessageBox::critical(this, tr("QtiPlot - Export error"), + tr("Could not write to file:

%1

" + "Please verify that you have the right to write to this location!").arg(file_name)); + return; + } + f.close(); + +#ifdef EMF_OUTPUT + if (plot2D && file_suffix.contains(".emf")){ + plot2D->exportEMF(file_name, ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + return; + } +#endif + if (plot2D && file_suffix.contains(".tex")){ + plot2D->exportTeX(file_name, ied->color(), ied->escapeStrings(), ied->exportFontSizes(), ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + return; + } + + if (file_suffix.contains(".eps") || file_suffix.contains(".pdf") || + file_suffix.contains(".ps") || file_suffix.contains(".svg")) { + if (plot3D) + plot3D->exportVector(file_name, ied->textExportMode(), ied->sortMode(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + else if (plot2D){ + if (file_suffix.contains(".svg")) + plot2D->exportSVG(file_name, ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + else + plot2D->exportVector(file_name, ied->vectorResolution(), ied->color(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + } + } else { + QList list = QImageWriter::supportedImageFormats(); + for (int i=0; i<(int)list.count(); i++){ + if (file_suffix.contains("." + (list[i]).lower())) { + if (plot2D) + plot2D->exportImage(file_name, ied->quality(), ied->transparency(), + ied->bitmapResolution(), ied->customExportSize(), ied->sizeUnit(), + ied->scaleFontsFactor()); + else if (plot3D) + plot3D->exportImage(file_name, ied->quality(), ied->transparency(), + ied->bitmapResolution(), ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + } + } + } + } + QApplication::restoreOverrideCursor(); +} + +QString ApplicationWindow::windowGeometryInfo(MdiSubWindow *w) +{ + QString s = "geometry\t"; + if (w->status() == MdiSubWindow::Maximized){ + if (w == w->folder()->activeWindow()) + return s + "maximized\tactive\n"; + else + return s + "maximized\n"; + } + + s += QString::number(w->x()) + "\t"; + s += QString::number(w->y()) + "\t"; + + QSize minRestoreSize = w->minRestoreSize(); + if (w->status() == MdiSubWindow::Hidden && + minRestoreSize.width() > w->width() && + minRestoreSize.height() > w->height()){ + // the window was minimized and afterwards hidden + s += QString::number(minRestoreSize.width()) + "\t"; + s += QString::number(minRestoreSize.height()) + "\t"; + } else if (w->status() != MdiSubWindow::Minimized){ + s += QString::number(w->width()) + "\t"; + s += QString::number(w->height()) + "\t"; + } else { + s += QString::number(minRestoreSize.width()) + "\t"; + s += QString::number(minRestoreSize.height()) + "\t"; + s += "minimized\t"; + } + + bool hide = hidden(w); + if (w == w->folder()->activeWindow() && !hide) + s += "active\n"; + else if(hide) + s += "hidden\n"; + else + s += "\n"; + return s; +} + +void ApplicationWindow::restoreWindowGeometry(ApplicationWindow *app, MdiSubWindow *w, const QString s) +{ + if (qobject_cast(w)) + w->hide(); + + QString caption = w->objectName(); + if (s.contains ("minimized")) { + QStringList lst = s.split("\t"); + if (lst.count() > 4){ + int width = lst[3].toInt(); + int height = lst[4].toInt(); + if(width > 0 && height > 0) + w->resize(width, height); + } + w->setStatus(MdiSubWindow::Minimized); + app->setListView(caption, tr("Minimized")); + } else if (s.contains ("maximized")){ + w->setMaximized(); + } else { + QStringList lst = s.split("\t"); + if (lst.count() > 4){ + w->resize(lst[3].toInt(), lst[4].toInt()); + w->move(lst[1].toInt(), lst[2].toInt()); + } + w->setStatus(MdiSubWindow::Normal); + if (lst.count() > 5) { + if (lst[5] == "hidden") + app->hideWindow(w); + } + } + + if (s.contains ("active")) { + Folder *f = w->folder(); + if (f) + f->setActiveWindow(w); + } +} + +Folder* ApplicationWindow::projectFolder() +{ + return ((FolderListItem *)folders->firstChild())->folder(); +} + +bool ApplicationWindow::saveProject(bool compress) +{ + if (projectname == "untitled" || projectname.endsWith(".opj", Qt::CaseInsensitive) || + projectname.endsWith(".ogm", Qt::CaseInsensitive) || projectname.endsWith(".ogw", Qt::CaseInsensitive) + || projectname.endsWith(".ogg", Qt::CaseInsensitive)) + { + saveProjectAs(); + return false; + } + +#ifdef QTIPLOT_DEMO + showDemoVersionMessage(); + return false; +#endif + + saveFolder(projectFolder(), projectname, compress); + + setWindowTitle("QtiPlot - " + projectname); + savedProject(); + + if (autoSave){ + if (savingTimerId) + killTimer(savingTimerId); + savingTimerId=startTimer(autoSaveTime*60000); + } else + savingTimerId=0; + + QApplication::restoreOverrideCursor(); + return true; +} + +QString ApplicationWindow::getFileName(QWidget *parent, const QString & caption, const QString & dir, const QString & filter, + QString * selectedFilter, bool save, bool confirmOverwrite) +{ + QFileDialog fd(parent, caption, dir, filter); + if (save){ + fd.setAcceptMode(QFileDialog::AcceptSave); + fd.setConfirmOverwrite(confirmOverwrite); + } else + fd.setAcceptMode(QFileDialog::AcceptOpen); + + fd.setFileMode(QFileDialog::AnyFile); + + if (fd.exec() != QDialog::Accepted ) + return QString(); + + if (fd.selectedFiles().isEmpty()) + return QString(); + + if (selectedFilter) + *selectedFilter = fd.selectedNameFilter(); + return fd.selectedFiles()[0]; +} + +void ApplicationWindow::saveProjectAs(const QString& fileName, bool compress) +{ +#ifdef QTIPLOT_DEMO + showDemoVersionMessage(); + return; +#endif + + QString fn = fileName; + if (fileName.isEmpty()){ + QString filter = tr("QtiPlot project") + " (*.qti);;"; + filter += tr("Compressed QtiPlot project") + " (*.qti.gz)"; + + QString selectedFilter; + fn = getFileName(this, tr("Save Project As"), workingDir, filter, &selectedFilter, true, d_confirm_overwrite); + if (selectedFilter.contains(".gz")) + compress = true; + } + + if ( !fn.isEmpty() ){ + QFileInfo fi(fn); + workingDir = fi.dirPath(true); + if (!fn.endsWith(".qti", Qt::CaseInsensitive)) + fn.append(".qti"); + + projectname = fn; + if (saveProject(compress)){ + updateRecentProjectsList(projectname); + + QFileInfo fi(fn); + QString baseName = fi.baseName(); + FolderListItem *item = (FolderListItem *)folders->firstChild(); + item->setText(0, baseName); + item->folder()->setObjectName(baseName); + } + } +} + +void ApplicationWindow::saveNoteAs() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + w->exportASCII(); +} + +void ApplicationWindow::increaseNoteIndent() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + + w->setTabStopWidth(w->currentEditor()->tabStopWidth() + 5); + modifiedProject(); +} + +void ApplicationWindow::decreaseNoteIndent() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + + w->setTabStopWidth(w->currentEditor()->tabStopWidth() - 5); + modifiedProject(); +} + +void ApplicationWindow::showNoteLineNumbers(bool show) +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + w->showLineNumbers(show); + modifiedProject(); +} + +void ApplicationWindow::noteFindDialogue() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + + w->currentEditor()->showFindDialog(); +} + +void ApplicationWindow::noteFindNext() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + + w->currentEditor()->findNext(); +} + +void ApplicationWindow::noteFindPrev() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + + w->currentEditor()->findPrevious(); +} + +void ApplicationWindow::noteReplaceDialogue() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + + w->currentEditor()->showFindDialog(true); +} + +void ApplicationWindow::renameCurrentNoteTab() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + w->renameCurrentTab(); + modifiedProject(); +} + +void ApplicationWindow::addNoteTab() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + w->addTab(); + modifiedProject(); +} + +void ApplicationWindow::closeNoteTab() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + w->removeTab(); + modifiedProject(); +} + +void ApplicationWindow::saveAsTemplate(MdiSubWindow* w, const QString& fileName) +{ + if (!w) { + w = activeWindow(); + if (!w) + return; + } + + QString fn = fileName; + if (fn.isEmpty()){ + QString filter; + if (w->isA("Matrix")) + filter = tr("QtiPlot Matrix Template")+" (*.qmt)"; + else if (w->isA("MultiLayer")) + filter = tr("QtiPlot 2D Graph Template")+" (*.qpt)"; + else if (w->inherits("Table")) + filter = tr("QtiPlot Table Template")+" (*.qtt)"; + else if (w->isA("Graph3D")) + filter = tr("QtiPlot 3D Surface Template")+" (*.qst)"; + + QString selectedFilter; + fn = getFileName(this, tr("Save Window As Template"), templatesDir + "/" + w->objectName(), filter, &selectedFilter, true, d_confirm_overwrite); + + if (!fn.isEmpty()){ + QFileInfo fi(fn); + templatesDir = fi.dirPath(true); + QString baseName = fi.fileName(); + if (!baseName.contains(".")){ + selectedFilter = selectedFilter.right(5).left(4); + fn.append(selectedFilter); + } + } else + return; + } + + QFile f(fn); + if ( !f.open( QIODevice::WriteOnly ) ){ + QMessageBox::critical(this, tr("QtiPlot - Export error"), + tr("Could not write to file:

%1

Please verify that you have the right to write to this location!").arg(fn)); + return; + } + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + QTextStream t( &f ); + t.setEncoding(QTextStream::UnicodeUTF8); + t << "QtiPlot " + QString::number(maj_version)+"."+ QString::number(min_version)+"."+ + QString::number(patch_version) + " template file\n"; + f.close(); + w->save(fn, windowGeometryInfo(w), true); + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::rename() +{ + MdiSubWindow* m = activeWindow(); + if (!m) + return; + + RenameWindowDialog *rwd = new RenameWindowDialog(this); + rwd->setAttribute(Qt::WA_DeleteOnClose); + rwd->setWidget(m); + rwd->exec(); +} + +void ApplicationWindow::renameWindow() +{ + WindowListItem *it = (WindowListItem *)lv->currentItem(); + MdiSubWindow *w = it->window(); + if (!w) + return; + + RenameWindowDialog *rwd = new RenameWindowDialog(this); + rwd->setAttribute(Qt::WA_DeleteOnClose); + rwd->setWidget(w); + rwd->exec(); +} + +void ApplicationWindow::renameWindow(Q3ListViewItem *item, int, const QString &text) +{ + if (!item) + return; + + MdiSubWindow *w = ((WindowListItem *)item)->window(); + if (!w || text == w->objectName()) + return; + + if(!setWindowName(w, text)) + item->setText(0, w->objectName()); +} + +bool ApplicationWindow::setWindowName(MdiSubWindow *w, const QString &text) +{ + if (!w) + return false; + + QString name = w->objectName(); + if (name == text) + return true; + + QString newName = text; + newName.replace("-", "_"); + if (newName.isEmpty()){ + QMessageBox::critical(this, tr("QtiPlot - Error"), tr("Please enter a valid name!")); + return false; + } else if (newName.contains(QRegExp("\\W"))){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("The name you chose is not valid: only letters and digits are allowed!")+ + "

" + tr("Please choose another name!")); + return false; + } + + if (w->inherits("Table")) + newName.replace("_", "-"); + + while(alreadyUsedName(newName)){ + QMessageBox::critical(this, tr("QtiPlot - Error"), tr("Name %1 already exists!").arg(newName)+ + "

"+tr("Please choose another name!")+ + "

"+tr("Warning: for internal consistency reasons the underscore character is replaced with a minus sign.")); + return false; + } + + if (w->inherits("Table")) + updateTableNames(name, newName); + else if (w->isA("Matrix")) + changeMatrixName(name, newName); + + w->setName(newName); + renameListViewItem(name, newName); + updateCompleter(name, false, newName); + return true; +} + +QStringList ApplicationWindow::columnsList(Table::PlotDesignation plotType) +{ + QStringList list; + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (!w->inherits("Table")) + continue; + + Table *t = (Table *)w; + for (int i=0; i < t->numCols(); i++) + { + if (t->colPlotDesignation(i) == plotType || plotType == Table::All) + list << QString(t->objectName()) + "_" + t->colLabel(i); + } + } + return list; +} + +void ApplicationWindow::showCurvesDialog() +{ + MdiSubWindow *w = activeWindow(MultiLayerWindow); + if (!w) + return; + + if (((MultiLayer*)w)->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Error"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + return; + } + + Graph* g = ((MultiLayer*)w)->activeLayer(); + if (!g) + return; + + if (g->isPiePlot()){ + QMessageBox::warning(this,tr("QtiPlot - Error"), + tr("This functionality is not available for pie plots!")); + } else { + CurvesDialog* crvDialog = new CurvesDialog(this); + crvDialog->setAttribute(Qt::WA_DeleteOnClose); + crvDialog->setGraph(g); + crvDialog->resize(d_add_curves_dialog_size); + crvDialog->setModal(true); + crvDialog->show(); + } +} + +bool ApplicationWindow::hasTable() +{ + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->inherits("Table")) + return true; + } + f = f->folderBelow(); + } + return false; +} + +QStringList ApplicationWindow::tableNames() +{ + QStringList lst = QStringList(); + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->inherits("Table")) + lst << w->objectName(); + } + f = f->folderBelow(); + } + return lst; +} + +QList ApplicationWindow::tableList() +{ + QList lst; + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->inherits("Table")) + lst << w; + } + f = f->folderBelow(); + } + return lst; +} + +AssociationsDialog* ApplicationWindow::showPlotAssociations(int curve) +{ + MdiSubWindow* w = activeWindow(MultiLayerWindow); + if (!w) + return 0; + + Graph *g = ((MultiLayer*)w)->activeLayer(); + if (!g) + return 0; + + AssociationsDialog* ad = new AssociationsDialog(this); + ad->setAttribute(Qt::WA_DeleteOnClose); + ad->setGraph(g); + ad->initTablesList(tableList(), curve); + ad->show(); + return ad; +} + +void ApplicationWindow::showTitleDialog() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (w->isA("MultiLayer")){ + Graph* g = ((MultiLayer*)w)->activeLayer(); + if (g){ + TextDialog* td= new TextDialog(TextDialog::LayerTitle, this,0); + td->setGraph(g); + td->exec(); + } + } else if (w->isA("Graph3D")) { + Plot3DDialog* pd = (Plot3DDialog*)showPlot3dDialog(); + if (pd) + pd->showTitleTab(); + } +} + +void ApplicationWindow::showAxisTitleDialog() +{ + MdiSubWindow* w = activeWindow(MultiLayerWindow); + if (!w) + return; + + Graph* g = ((MultiLayer*)w)->activeLayer(); + if (!g) + return; + + TextDialog* td = new TextDialog(TextDialog::AxisTitle, this, 0); + td->setGraph(g); + td->exec(); +} + +void ApplicationWindow::showExportASCIIDialog() +{ + MdiSubWindow* t = activeWindow(); + if (!t) + return; + if (!qobject_cast(t) && !t->inherits("Table")) + return; + + ExportDialog* ed = new ExportDialog(t, this, true); + ed->exec(); +} + +void ApplicationWindow::exportAllTables(const QString& dir, const QString& filter, const QString& sep, bool colNames, bool colComments, bool expSelection) +{ + if (dir.isEmpty()) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + workingDir = dir; + + bool confirmOverwrite = d_confirm_overwrite; + bool success = true; + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->inherits("Table") || w->isA("Matrix")){ + QString fileName = dir + "/" + w->objectName() + filter; + QFile f(fileName); + if (f.exists(fileName) && confirmOverwrite){ + QApplication::restoreOverrideCursor(); + switch(QMessageBox::question(this, tr("QtiPlot - Overwrite file?"), + tr("A file called:

%1

already exists. " + "Do you want to overwrite it?").arg(fileName), tr("&Yes"), tr("&All"), tr("&Cancel"), 0, 1)) + { + case 0: + if (w->inherits("Table")) + success = ((Table*)w)->exportASCII(fileName, sep, colNames, colComments, expSelection); + else if (w->isA("Matrix")) + success = ((Matrix*)w)->exportASCII(fileName, sep, expSelection); + break; + + case 1: + confirmOverwrite = false; + if (w->inherits("Table")) + success = ((Table*)w)->exportASCII(fileName, sep, colNames, colComments, expSelection); + else if (w->isA("Matrix")) + success = ((Matrix*)w)->exportASCII(fileName, sep, expSelection); + break; + + case 2: + return; + break; + } + } else if (w->inherits("Table")) + success = ((Table*)w)->exportASCII(fileName, sep, colNames, colComments, expSelection); + else if (w->isA("Matrix")) + success = ((Matrix*)w)->exportASCII(fileName, sep, expSelection); + + if (!success) + break; + } + } + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::showRowsDialog() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + bool ok; + int rows = QInputDialog::getInteger(this, tr("QtiPlot - Enter rows number"), tr("Rows"), + t->numRows(), 0, 1000000, 1, &ok); + if ( ok ) + t->resizeRows(rows); +} + +void ApplicationWindow::showDeleteRowsDialog() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + bool ok; + int start_row = QInputDialog::getInteger(this, tr("QtiPlot - Delete rows"), tr("Start row"), + 1, 1, t->numRows(), 1, &ok); + if (ok){ + int end_row = QInputDialog::getInteger(this, tr("QtiPlot - Delete rows"), tr("End row"), + t->numRows(), 1, t->numRows(), 1, &ok); + if (ok) + t->deleteRows(start_row, end_row); + } +} + +void ApplicationWindow::showColsDialog() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + bool ok; + int cols = QInputDialog::getInteger(this, tr("QtiPlot - Enter columns number"), tr("Columns"), + t->numCols(), 0, 1000000, 1, &ok); + if ( ok ) + t->resizeCols(cols); +} + +void ApplicationWindow::showColumnValuesDialog() +{ + Table *w = (Table*)activeWindow(TableWindow); + if (!w) + return; + + if (w->selectedColumns().count()>0 || w->table()->currentSelection() >= 0){ + SetColValuesDialog* vd = new SetColValuesDialog(scriptEnv, this); + vd->setTable(w); + if (d_completion) + vd->setCompleter(d_completer); + vd->exec(); + } else + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), tr("Please select a column first!")); +} + +void ApplicationWindow::showExtractDataDialog() +{ + Table *w = (Table*)activeWindow(TableWindow); + if (!w) + return; + + ExtractDataDialog* edd = new ExtractDataDialog(scriptEnv, this); + edd->setTable(w); + if (d_completion) + edd->setCompleter(d_completer); + edd->exec(); +} + +void ApplicationWindow::recalculateTable() +{ + MdiSubWindow* w = activeWindow(); + if (!w) + return; + + if (qobject_cast(w)) + ((TableStatistics*)w)->update(); + else if (qobject_cast

(w)) + ((Table*)w)->calculate(); + else if (qobject_cast(w)) + ((Matrix*)w)->calculate(); +} + +void ApplicationWindow::sortActiveTable() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + if ((int)t->selectedColumns().count()>0) + t->sortTableDialog(); + else + QMessageBox::warning(this, "QtiPlot - Column selection error","Please select a column first!"); +} + +void ApplicationWindow::sortSelection() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + t->sortColumnsDialog(); +} + +void ApplicationWindow::normalizeActiveTable() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + if (int(t->selectedColumns().count())>0) + t->normalize(); + else + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), tr("Please select a column first!")); +} + +void ApplicationWindow::normalizeSelection() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + if (int(t->selectedColumns().count())>0) + t->normalizeSelection(); + else + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), tr("Please select a column first!")); +} + +void ApplicationWindow::correlate() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + QStringList s = t->selectedColumns(); + if ((int)s.count() != 2){ + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select two columns for this operation!")); + return; + } + + Correlation *cor = new Correlation(this, t, s[0], s[1]); + cor->run(); + delete cor; +} + +void ApplicationWindow::autoCorrelate() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + QStringList s = t->selectedColumns(); + if ((int)s.count() != 1) + { + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select exactly one columns for this operation!")); + return; + } + + Correlation *cor = new Correlation(this, t, s[0], s[0]); + cor->run(); + delete cor; +} + +void ApplicationWindow::convolute() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + QStringList s = t->selectedColumns(); + if ((int)s.count() != 2) + { + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select two columns for this operation:\n the first represents the signal and the second the response function!")); + return; + } + + Convolution *cv = new Convolution(this, t, s[0], s[1]); + cv->run(); + delete cv; +} + +void ApplicationWindow::deconvolute() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + QStringList s = t->selectedColumns(); + if ((int)s.count() != 2) + { + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select two columns for this operation:\n the first represents the signal and the second the response function!")); + return; + } + + Deconvolution *dcv = new Deconvolution(this, t, s[0], s[1]); + dcv->run(); + delete dcv; +} + +void ApplicationWindow::showColStatistics() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + if (int(t->selectedColumns().count()) > 0) + { + QList targets; + for (int i=0; i < t->numCols(); i++) + if (t->isColumnSelected(i, true)) + targets << i; + newTableStatistics(t, TableStatistics::column, targets)->showNormal(); + } + else + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), + tr("Please select a column first!")); +} + +void ApplicationWindow::showRowStatistics() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + if (t->numSelectedRows() > 0){ + QList targets; + for (int i=0; i < t->numRows(); i++) + if (t->isRowSelected(i, true)) + targets << i; + newTableStatistics(t, TableStatistics::row, targets)->showNormal(); + } else + QMessageBox::warning(this, tr("QtiPlot - Row selection error"), + tr("Please select a row first!")); +} + +void ApplicationWindow::showColMenu(int c) +{ + Table *w = (Table*)activeWindow(TableWindow); + if (!w) + return; + + QMenu contextMenu(this); + QMenu plot(this); + QMenu specialPlot(this); + QMenu specialBarMenu(this); + QMenu fill(this); + QMenu sorting(this); + QMenu colType(this); + colType.setCheckable(true); + QMenu panels(this); + QMenu gridMenu(this); + QMenu stat(this); + QMenu norm(this); + + if ((int)w->selectedColumns().count() == 1){ + w->setSelectedCol(c); + plot.addAction(actionPlotL); + plot.addAction(actionPlotP); + plot.addAction(actionPlotLP); + + specialPlot.addAction(actionPlotVerticalDropLines); + specialPlot.addAction(actionPlotSpline); + specialPlot.addAction(actionPlotVertSteps); + specialPlot.addAction(actionPlotHorSteps); + specialPlot.insertSeparator(); + specialPlot.addAction(actionAddZoomPlot); + specialPlot.setTitle(tr("Special Line/Symb&ol")); + plot.addMenu(&specialPlot); + plot.insertSeparator(); + plot.addAction(actionPlotVerticalBars); + plot.addAction(actionPlotHorizontalBars); + specialBarMenu.addAction(actionStackBars); + specialBarMenu.addAction(actionStackColumns); + specialBarMenu.setTitle(tr("Spec&ial Bar/Column")); + plot.addMenu (&specialBarMenu); + plot.addAction(actionPlotArea); + plot.addAction(actionPlotPie); + plot.insertSeparator(); + + plot.addAction(actionPlot3DRibbon); + plot.addAction(actionPlot3DBars); + plot.addAction(actionPlot3DScatter); + plot.addAction(actionPlot3DTrajectory); + + plot.insertSeparator(); + + stat.addAction(actionBoxPlot); + stat.addAction(actionPlotHistogram); + stat.addAction(actionPlotStackedHistograms); + stat.insertSeparator(); + stat.addAction(actionStemPlot); + stat.setTitle(tr("Statistical &Graphs")); + plot.addMenu(&stat); + + plot.setTitle(tr("&Plot")); + contextMenu.addMenu(&plot); + contextMenu.insertSeparator(); + + contextMenu.addAction(QIcon(":/cut.png"),tr("Cu&t"), w, SLOT(cutSelection())); + contextMenu.addAction(QIcon(":/copy.png"),tr("&Copy"), w, SLOT(copySelection())); + contextMenu.addAction(QIcon(":/paste.png"),tr("Past&e"), w, SLOT(pasteSelection())); + contextMenu.insertSeparator(); + + QAction * xColID=colType.addAction(QIcon(":/x_col.png"), tr("&X"), this, SLOT(setXCol())); + xColID->setCheckable(true); + QAction * yColID=colType.addAction(QIcon(":/y_col.png"), tr("&Y"), this, SLOT(setYCol())); + yColID->setCheckable(true); + QAction * zColID=colType.addAction(QIcon(":/z_col.png"), tr("&Z"), this, SLOT(setZCol())); + zColID->setCheckable(true); + colType.insertSeparator(); + QAction * labelID = colType.addAction(QIcon(":/set_label_col.png"), tr("&Label"), this, SLOT(setLabelCol())); + labelID->setCheckable(true); + QAction * noneID=colType.addAction(QIcon(":/disregard_col.png"), tr("&None"), this, SLOT(disregardCol())); + noneID->setCheckable(true); + colType.insertSeparator(); + QAction * xErrColID =colType.addAction(tr("X E&rror"), this, SLOT(setXErrCol())); + xErrColID->setCheckable(true); + QAction * yErrColID = colType.addAction(QIcon(":/errors.png"), tr("Y &Error"), this, SLOT(setYErrCol())); + yErrColID->setCheckable(true); + colType.insertSeparator(); + + + if (w->colPlotDesignation(c) == Table::X) + xColID->setChecked(true); + else if (w->colPlotDesignation(c) == Table::Y) + yColID->setChecked(true); + else if (w->colPlotDesignation(c) == Table::Z) + zColID->setChecked(true); + else if (w->colPlotDesignation(c) == Table::xErr) + xErrColID->setChecked(true); + else if (w->colPlotDesignation(c) == Table::yErr) + yErrColID->setChecked(true); + else if (w->colPlotDesignation(c) == Table::Label) + labelID->setChecked(true); + else + noneID->setChecked(true); + + actionReadOnlyCol->addTo(&colType); + actionReadOnlyCol->setCheckable(true); + actionReadOnlyCol->setChecked(w->isReadOnlyColumn(c)); + + colType.setTitle(tr("Set As")); + contextMenu.addMenu(&colType); + + if (w){ + contextMenu.insertSeparator(); + + contextMenu.addAction(actionShowColumnValuesDialog); + contextMenu.addAction(actionTableRecalculate); + fill.addAction(actionSetAscValues); + fill.addAction(actionSetRandomValues); + fill.setTitle(tr("&Fill Column With")); + contextMenu.addMenu(&fill); + + norm.addAction(tr("&Column"), w, SLOT(normalizeSelection())); + norm.addAction(actionNormalizeTable); + norm.setTitle(tr("&Normalize")); + contextMenu.addMenu(& norm); + + contextMenu.insertSeparator(); + contextMenu.addAction(actionFrequencyCount); + contextMenu.addAction(actionShowColStatistics); + + contextMenu.insertSeparator(); + + contextMenu.addAction(QIcon(":/erase.png"), tr("Clea&r"), w, SLOT(clearSelection())); + contextMenu.addAction(QIcon(":/delete_column.png"), tr("&Delete"), w, SLOT(removeCol())); + contextMenu.addAction(actionHideSelectedColumns); + contextMenu.addAction(actionShowAllColumns); + contextMenu.insertSeparator(); + contextMenu.addAction(QIcon(":/insert_column.png"), tr("&Insert"), w, SLOT(insertCol())); + contextMenu.addAction(actionAddColToTable); + contextMenu.insertSeparator(); + + sorting.addAction(QIcon(":/sort_ascending.png"), tr("&Ascending"), w, SLOT(sortColAsc())); + sorting.addAction(QIcon(":/sort_descending.png"), tr("&Descending"), w, SLOT(sortColDesc())); + sorting.setTitle(tr("Sort Colu&mn")); + contextMenu.addMenu(&sorting); + + contextMenu.addAction(actionSortTable); + } + contextMenu.insertSeparator(); + contextMenu.addAction(actionAdjustColumnWidth); + contextMenu.addAction(actionShowColumnOptionsDialog); + } else if ((int)w->selectedColumns().count() > 1){ + plot.addAction(actionPlotL); + plot.addAction(actionPlotP); + plot.addAction(actionPlotLP); + + specialPlot.addAction(actionPlotVerticalDropLines); + specialPlot.addAction(actionPlotSpline); + specialPlot.addAction(actionPlotVertSteps); + specialPlot.addAction(actionPlotHorSteps); + specialPlot.insertSeparator(); + specialPlot.addAction(actionPlotDoubleYAxis); + specialPlot.addAction(actionWaterfallPlot); + specialPlot.addAction(actionAddZoomPlot); + specialPlot.setTitle(tr("Special Line/Symb&ol")); + plot.addMenu(&specialPlot); + plot.insertSeparator(); + plot.addAction(actionPlotVerticalBars); + plot.addAction(actionPlotHorizontalBars); + + specialBarMenu.addAction(actionStackBars); + specialBarMenu.addAction(actionStackColumns); + specialBarMenu.setTitle(tr("Spec&ial Bar/Column")); + plot.addMenu (&specialBarMenu);; + + plot.addAction(actionPlotArea); + plot.addAction(actionPlotVectXYXY); + plot.addAction(actionPlotVectXYAM); + plot.insertSeparator(); + stat.addAction(actionBoxPlot); + stat.addAction(actionPlotHistogram); + stat.addAction(actionPlotStackedHistograms); + stat.insertSeparator(); + stat.addAction(actionStemPlot); + stat.setTitle(tr("Statistical &Graphs")); + plot.addMenu(&stat); + + panels.addAction(actionPlot2VerticalLayers); + panels.addAction(actionPlot2HorizontalLayers); + panels.addAction(actionPlot4Layers); + panels.addAction(actionPlotStackedLayers); + panels.addAction(actionCustomLayout); + panels.setTitle(tr("Pa&nel")); + plot.addMenu(&panels); + + gridMenu.addAction(actionVertSharedAxisLayers); + gridMenu.addAction(actionHorSharedAxisLayers); + gridMenu.addAction(actionSharedAxesLayers); + gridMenu.addAction(actionStackSharedAxisLayers); + gridMenu.addAction(actionCustomSharedAxisLayers); + gridMenu.setTitle(tr("Shared A&xes Panel")); + plot.addMenu(&gridMenu); + + plot.setTitle(tr("&Plot")); + contextMenu.addMenu(&plot); + contextMenu.insertSeparator(); + contextMenu.addAction(QIcon(":/cut.png"),tr("Cu&t"), w, SLOT(cutSelection())); + contextMenu.addAction(QIcon(":/copy.png"),tr("&Copy"), w, SLOT(copySelection())); + contextMenu.addAction(QIcon(":/paste.png"),tr("Past&e"), w, SLOT(pasteSelection())); + contextMenu.insertSeparator(); + + if (w){ + contextMenu.addAction(QIcon(":/erase.png"),tr("Clea&r"), w, SLOT(clearSelection())); + contextMenu.addAction(QIcon(":/close.png"),tr("&Delete"), w, SLOT(removeCol())); + contextMenu.addAction(actionHideSelectedColumns); + contextMenu.addAction(actionShowAllColumns); + contextMenu.insertSeparator(); + contextMenu.addAction(tr("&Insert"), w, SLOT(insertCol())); + contextMenu.addAction(actionAddColToTable); + contextMenu.insertSeparator(); + } + + colType.addAction(actionSetXCol); + colType.addAction(actionSetYCol); + colType.addAction(actionSetZCol); + colType.insertSeparator(); + colType.addAction(actionSetLabelCol); + colType.addAction(actionDisregardCol); + colType.insertSeparator(); + colType.addAction(actionSetXErrCol); + colType.addAction(actionSetYErrCol); + colType.insertSeparator(); + colType.addAction(tr("&Read-only"), this, SLOT(setReadOnlyColumns())); + colType.addAction(tr("Read/&Write"), this, SLOT(setReadWriteColumns())); + colType.setTitle(tr("Set As")); + contextMenu.addMenu(&colType); + + if (w){ + contextMenu.insertSeparator(); + + fill.addAction(actionSetAscValues); + fill.addAction(actionSetRandomValues); + fill.setTitle(tr("&Fill Columns With")); + contextMenu.addMenu(&fill); + + norm.addAction(actionNormalizeSelection); + norm.addAction(actionNormalizeTable); + norm.setTitle(tr("&Normalize")); + contextMenu.addMenu(&norm); + + contextMenu.insertSeparator(); + contextMenu.addAction(actionSortSelection); + contextMenu.addAction(actionSortTable); + contextMenu.insertSeparator(); + contextMenu.addAction(actionShowColStatistics); + contextMenu.insertSeparator(); + contextMenu.addAction(actionAdjustColumnWidth); + } + } + + QPoint posMouse=QCursor::pos(); + contextMenu.exec(posMouse); +} + +void ApplicationWindow::plotVerticalSharedAxisLayers() +{ + multilayerPlot(1, 2, defaultCurveStyle, MultiLayer::AlignCanvases); +} + +void ApplicationWindow::plotHorizontalSharedAxisLayers() +{ + multilayerPlot(2, 1, defaultCurveStyle, MultiLayer::AlignCanvases); +} + +void ApplicationWindow::plotSharedAxesLayers() +{ + multilayerPlot(2, 2, defaultCurveStyle, MultiLayer::AlignCanvases); +} + +void ApplicationWindow::plotStackSharedAxisLayers() +{ + multilayerPlot(1, -1, defaultCurveStyle, MultiLayer::AlignCanvases); +} + +void ApplicationWindow::plotCustomLayout(bool sharedAxes) +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t || !validFor2DPlot(t, (Graph::CurveType)defaultCurveStyle)) + return; + + QStringList list = t->drawableColumnSelection(); + int curves = list.count(); + if(curves < 1){ + QMessageBox::warning(this, tr("QtiPlot - Plot error"), tr("Please select a Y column to plot!")); + return; + } + + LayerDialog *id = new LayerDialog(this, true); + id->setLayers(curves); + id->setRows(curves); + id->setMargins(5, 5, 5, 5); + id->setLayerCanvasSize(d_layer_canvas_width, d_layer_canvas_height, d_layer_geometry_unit); + if (sharedAxes) + id->setSharedAxes(); + id->exec(); +} + +void ApplicationWindow::plot2VerticalLayers() +{ + multilayerPlot(1, 2, defaultCurveStyle); +} + +void ApplicationWindow::plot2HorizontalLayers() +{ + multilayerPlot(2, 1, defaultCurveStyle); +} + +void ApplicationWindow::plot4Layers() +{ + multilayerPlot(2, 2, defaultCurveStyle); +} + +void ApplicationWindow::plotStackedLayers() +{ + multilayerPlot(1, -1, defaultCurveStyle); +} + +void ApplicationWindow::plotStackedHistograms() +{ + multilayerPlot(1, -1, Graph::Histogram); +} + +void ApplicationWindow::zoomRectanglePlot() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + QStringList lst = t->selectedYColumns(); + int cols = lst.size(); + if (cols < 1){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("You need to select at least one Y column for this operation!")); + return; + } + + Q3TableSelection sel = t->getSelection(); + MultiLayer *ml = multilayerPlot(t, lst, Graph::LineSymbols, sel.topRow(), sel.bottomRow()); + if (ml){ + Graph *ag = ml->activeLayer(); + ag->setTitle(""); + ag->setAxisTitle(QwtPlot::xBottom, " "); + ag->setAxisTitle(QwtPlot::yLeft, " "); + ag->setCanvasFrame(); + ag->drawAxesBackbones(false); + ag->showGrid(); + ag->removeLegend(); + + RectangleWidget *r = new RectangleWidget(ag); + QColor c = Qt::yellow; + c.setAlpha(100); + r->setBackgroundColor(c); + r->setFrameColor(Qt::blue); + ag->add(r, false); + + Graph *g = ml->addLayer(); + if (!g) + return; + + setPreferences(g); + g->setTitle(""); + g->setAxisTitle(QwtPlot::xBottom, " "); + g->setAxisTitle(QwtPlot::yLeft, " "); + g->copyCurves(ag); + g->drawAxesBackbones(false); + g->setCanvasFrame(); + g->setCanvasBackground(c); + + ml->setRows(2); + ml->setCols(1); + ml->arrangeLayers(false); + + QRect canvasRect = ag->canvas()->geometry(); + r->setRect(canvasRect.x(), canvasRect.bottom() - 50, 100, 50); + + g->setCanvasCoordinates(r->boundingRect()); + r->setLinkedLayer(1); + } +} + +void ApplicationWindow::plotDoubleYAxis() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + QStringList lst = t->selectedYColumns(); + int cols = lst.size(); + if (cols < 2){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("You need at least two columns for this operation!")); + return; + } + + Q3TableSelection sel = t->getSelection(); + MultiLayer *ml = multilayerPlot(t, lst, Graph::LineSymbols, sel.topRow(), sel.bottomRow()); + if (ml){ + Graph *g = ml->activeLayer(); + g->enableAxis(QwtPlot::yRight); + g->setAxisTitle(QwtPlot::yRight, tr("Y2 Axis Title")); + + QwtPlotCurve *c = g->curve(cols - 1); + if (c){ + c->setYAxis(QwtPlot::yRight); + g->setAutoScale(); + } + } +} + +void ApplicationWindow::showMatrixDialog() +{ + Matrix *m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + MatrixDialog* md = new MatrixDialog(this); + md->setMatrix (m); + md->exec(); +} + +void ApplicationWindow::showMatrixSizeDialog() +{ + Matrix *m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + MatrixSizeDialog* md = new MatrixSizeDialog(m, this); + md->exec(); +} + +void ApplicationWindow::showMatrixValuesDialog() +{ + Matrix *m = NULL; + MultiLayer *ml = (MultiLayer*)activeWindow(MultiLayerWindow); + if (ml){ + int curveIndex = actionSetMatrixValues->data().toInt(); + Graph *g = ml->activeLayer(); + if (g){ + Spectrogram *sp = (Spectrogram *)g->plotItem(curveIndex); + if (sp) + m = sp->matrix(); + } + } else + m = (Matrix*)activeWindow(MatrixWindow); + + if (!m) + return; + + MatrixValuesDialog* md = new MatrixValuesDialog(scriptEnv, this); + md->setMatrix(m); + if (d_completion) + md->setCompleter(d_completer); + md->exec(); +} + +void ApplicationWindow::showColumnOptionsDialog() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + if(t->selectedColumns().count()>0) { + TableDialog* td = new TableDialog(t, this); + td->setAttribute(Qt::WA_DeleteOnClose); + td->exec(); + } else + QMessageBox::warning(this, tr("QtiPlot"), tr("Please select a column first!")); +} + +void ApplicationWindow::showGeneralPlotDialog() +{ + MdiSubWindow* plot = activeWindow(); + if (!plot) + return; + + if (plot->isA("MultiLayer") && ((MultiLayer*)plot)->numLayers()) + showPlotDialog(); + else if (plot->isA("Graph3D")){ + QDialog* gd = showScaleDialog(); + ((Plot3DDialog*)gd)->showGeneralTab(); + } +} + +void ApplicationWindow::showAxisDialog() +{ + MdiSubWindow* plot = activeWindow(); + if (!plot) + return; + + QDialog* gd = showScaleDialog(); + if (gd && plot->isA("MultiLayer") && ((MultiLayer*)plot)->numLayers()) + ((AxesDialog*)gd)->showAxesPage(); + else if (gd && plot->isA("Graph3D")) + ((Plot3DDialog*)gd)->showAxisTab(); +} + +void ApplicationWindow::showGridDialog() +{ + AxesDialog* gd = (AxesDialog*)showScaleDialog(); + if (gd) + gd->showGridPage(); +} + +QDialog* ApplicationWindow::showScaleDialog() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return 0; + + if (w->isA("MultiLayer")){ + if (((MultiLayer*)w)->isEmpty()) + return 0; + + Graph* g = ((MultiLayer*)w)->activeLayer(); + if (g->isPiePlot()){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), tr("This functionality is not available for pie plots!")); + return 0; + } + + AxesDialog* ad = new AxesDialog(this); + ad->setGraph(g); + ad->exec(); + return ad; + } else if (w->isA("Graph3D")) + return showPlot3dDialog(); + + return 0; +} + +AxesDialog* ApplicationWindow::showScalePageFromAxisDialog(int axisPos) +{ + AxesDialog* gd = (AxesDialog*)showScaleDialog(); + if (gd) + gd->setCurrentScale(axisPos); + + return gd; +} + +AxesDialog* ApplicationWindow::showAxisPageFromAxisDialog(int axisPos) +{ + AxesDialog* gd = (AxesDialog*)showScaleDialog(); + if (gd){ + gd->showAxesPage(); + gd->setCurrentScale(axisPos); + } + return gd; +} + +QDialog* ApplicationWindow::showPlot3dDialog() +{ + Graph3D *g = (Graph3D*)activeWindow(Plot3DWindow); + if (!g) + return 0; + + if (!g->hasData()){ + QApplication::restoreOverrideCursor(); + QMessageBox::warning(this, tr("QtiPlot - Warning"), + tr("Not available for empty 3D surface plots!")); + return 0; + } + + Plot3DDialog* pd = new Plot3DDialog(this); + pd->setPlot(g); + pd->show(); + return pd; +} + +void ApplicationWindow::showPlotDialog(int curveIndex) +{ + MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!w) + return; + + PlotDialog* pd = new PlotDialog(d_extended_plot_dialog, this); + pd->insertColumnsList(columnsList(Table::All)); + pd->setMultiLayer(w); + if (curveIndex >= 0){ + Graph *g = w->activeLayer(); + if (g) + pd->selectCurve(curveIndex); + } + pd->initFonts(plotTitleFont, plotAxesFont, plotNumbersFont, plotLegendFont); + pd->showAll(d_extended_plot_dialog); + pd->show(); + +} + +void ApplicationWindow::showCurvePlotDialog() +{ + showPlotDialog(actionShowCurvePlotDialog->data().toInt()); +} + +void ApplicationWindow::showCurveContextMenu(QwtPlotItem *cv) +{ + if (!cv || !cv->isVisible()) + return; + + MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!w) + return; + + Graph *g = w->activeLayer(); + if (!g) + return; + + int curveIndex = g->curveIndex(cv); + if (curveIndex < 0 || curveIndex >= g->curveCount()) + return; + + QMenu curveMenu(this); + curveMenu.addAction(cv->title().text(), this, SLOT(showCurvePlotDialog())); + curveMenu.insertSeparator(); + + curveMenu.addAction(actionHideCurve); + actionHideCurve->setData(curveIndex); + + int type = ((PlotCurve *)cv)->type(); + bool spectrogram = (cv->rtti() == QwtPlotItem::Rtti_PlotSpectrogram) ? true : false; + if (g->visibleCurves() > 1 && (type == Graph::Function || spectrogram)){ + curveMenu.addAction(actionHideOtherCurves); + actionHideOtherCurves->setData(curveIndex); + } else if (type != Graph::Function && !spectrogram) { + if ((g->visibleCurves() - ((DataCurve *)cv)->errorBarsList().count()) > 1) { + curveMenu.addAction(actionHideOtherCurves); + actionHideOtherCurves->setData(curveIndex); + } + } + + if (g->visibleCurves() != g->curveCount()) + curveMenu.addAction(actionShowAllCurves); + curveMenu.insertSeparator(); + + if (g->rangeSelectorsEnabled() || (g->activeTool() && + g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker)) + curveMenu.addAction(actionCopySelection); + if (spectrogram){ + curveMenu.insertSeparator(); + curveMenu.addAction(actionSetMatrixValues); + actionSetMatrixValues->setData(curveIndex); + } else if (type != Graph::Function && type != Graph::ErrorBars){ + if (g->rangeSelectorsEnabled() || (g->activeTool() && + g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker)){ + curveMenu.addAction(actionCutSelection); + curveMenu.addAction(actionPasteSelection); + if (g->activeTool() && g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker){ + DataPickerTool *dpt = (DataPickerTool *)g->activeTool(); + if (dpt){ + QAction *act = new QAction(tr("Paste Selection as Te&xt"), this); + connect(act, SIGNAL(activated()), dpt, SLOT(pasteSelectionAsLayerText())); + curveMenu.addAction(act); + } + } + + curveMenu.addAction(actionClearSelection); + curveMenu.insertSeparator(); + if (g->rangeSelectorsEnabled()){ + QAction *act = new QAction(tr("Set Display Range"), this); + connect(act, SIGNAL(activated()), g->rangeSelectorTool(), SLOT(setCurveRange())); + curveMenu.addAction(act); + } + } + + curveMenu.addAction(actionEditCurveRange); + actionEditCurveRange->setData(curveIndex); + + curveMenu.addAction(actionCurveFullRange); + if (((DataCurve *)cv)->isFullRange()) + actionCurveFullRange->setDisabled(true); + else + actionCurveFullRange->setEnabled(true); + actionCurveFullRange->setData(curveIndex); + + curveMenu.insertSeparator(); + } + + curveMenu.addAction(actionShowCurveWorksheet); + actionShowCurveWorksheet->setData(curveIndex); + + curveMenu.addAction(actionShowCurvePlotDialog); + actionShowCurvePlotDialog->setData(curveIndex); + + curveMenu.insertSeparator(); + + curveMenu.addAction(actionRemoveCurve); + actionRemoveCurve->setData(curveIndex); + curveMenu.exec(QCursor::pos()); +} + +void ApplicationWindow::showAllCurves() +{ + MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!w) + return; + + Graph* g = w->activeLayer(); + if (!g) + return; + + for(int i=0; i< g->curveCount(); i++) + g->showCurve(i); + g->replot(); +} + +void ApplicationWindow::hideOtherCurves() +{ + MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!w) + return; + + Graph* g = w->activeLayer(); + if (!g) + return; + + for(int i=0; i< g->curveCount(); i++) + g->showCurve(i, false); + + g->showCurve(actionHideOtherCurves->data().toInt()); + g->replot(); +} + +void ApplicationWindow::hideCurve() +{ + MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!w) + return; + + Graph* g = w->activeLayer(); + if (!g) + return; + + g->showCurve(actionHideCurve->data().toInt(), false); +} + +void ApplicationWindow::removeCurve() +{ + MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!w) + return; + + Graph* g = w->activeLayer(); + if (!g) + return; + + g->removeCurve(actionRemoveCurve->data().toInt()); + g->updatePlot(); +} + +void ApplicationWindow::showCurveWorksheet(Graph *g, int curveIndex) +{ + if (!g) + return; + + const QwtPlotItem *it = g->plotItem(curveIndex); + if (!it) + return; + + if (it->rtti() == QwtPlotItem::Rtti_PlotSpectrogram){ + Spectrogram *sp = (Spectrogram *)it; + if (sp->matrix()) + sp->matrix()->showMaximized(); + } else if (((PlotCurve *)it)->type() == Graph::Function) + g->createTable((PlotCurve *)it); + else { + showTable(it->title().text()); + if (g->activeTool() && g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker) + ((DataPickerTool *)g->activeTool())->selectTableRow(); + } +} + +void ApplicationWindow::showCurveWorksheet() +{ + MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!w) + return; + + Graph* g = w->activeLayer(); + if (!g) + return; + + showCurveWorksheet(g, actionShowCurveWorksheet->data().toInt()); +} + +void ApplicationWindow::magnify(int mode) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + if (plot->isEmpty()){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setOn(true); + return; + } + + QList layers = plot->layersList(); + foreach(Graph *g, layers) + g->enablePanningMagnifier(true, mode); +} + +void ApplicationWindow::zoomIn() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + if (plot->isEmpty()) + { + QMessageBox::warning(this, tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setOn(true); + return; + } + + if ((Graph*)plot->activeLayer()->isPiePlot()) + { + if (btnZoomIn->isOn()) + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("This functionality is not available for pie plots!")); + btnPointer->setOn(true); + return; + } + + QList layers = plot->layersList(); + foreach(Graph *g, layers){ + if (!g->isPiePlot()) + g->zoom(true); + } +} + +void ApplicationWindow::zoomOut() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + if (plot->isEmpty() || (Graph*)plot->activeLayer()->isPiePlot()) + return; + + ((Graph*)plot->activeLayer())->zoomOut(); + btnPointer->setOn(true); +} + +void ApplicationWindow::setAutoScale() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

")); + return; + } + + Graph *g = (Graph*)plot->activeLayer(); + if (g) + g->setAutoScale(); +} + +void ApplicationWindow::removePoints() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()) + { + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setChecked(true); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + { + btnPointer->setChecked(true); + return; + } + + if (g->isPiePlot()) + { + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("This functionality is not available for pie plots!")); + btnPointer->setChecked(true); + return; + } + else + { + switch(QMessageBox::warning (this,tr("QtiPlot"), + tr("This will modify the data in the worksheets!\nAre you sure you want to continue?"), + tr("Continue"),tr("Cancel"),0,1)) + { + case 0: + g->setActiveTool(new DataPickerTool(g, this, DataPickerTool::Remove, info, SLOT(setText(const QString&)))); + displayBar->show(); + break; + + case 1: + btnPointer->setChecked(true); + break; + } + } +} + +void ApplicationWindow::movePoints(bool wholeCurve) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setChecked(true); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (!g || !g->validCurvesDataSize()){ + btnPointer->setChecked(true); + return; + } + + if (g->isPiePlot()){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), + tr("This functionality is not available for pie plots!")); + + btnPointer->setChecked(true); + return; + } else { + switch(QMessageBox::warning (this, tr("QtiPlot"), + tr("This will modify the data in the worksheets!\nAre you sure you want to continue?"), + tr("Continue"), tr("Cancel"), 0, 1)) + { + case 0: + if (g){ + DataPickerTool *tool = new DataPickerTool(g, this, DataPickerTool::Move, info, SLOT(setText(const QString&))); + if (wholeCurve) + tool->setMode(DataPickerTool::MoveCurve); + g->setActiveTool(tool); + displayBar->show(); + } + break; + + case 1: + btnPointer->setChecked(true); + break; + } + } +} + +void ApplicationWindow::exportPDF() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if(qobject_cast(w) && ((MultiLayer *)w)->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

")); + return; + } + + if (qobject_cast(w) || qobject_cast(w)){ + exportGraph("*.pdf"); + return; + } else if (qobject_cast(w)){ + exportMatrix("*.pdf"); + return; + } + + QString fname = getFileName(this, tr("Choose a filename to save under"), + imagesDirPath + "/" + w->objectName(), "*.pdf", 0, true, d_confirm_overwrite); + if (!fname.isEmpty() ){ + QFileInfo fi(fname); + QString baseName = fi.fileName(); + if (!baseName.contains(".")) + fname.append(".pdf"); + + imagesDirPath = fi.dirPath(true); + + QFile f(fname); + if (!f.open(QIODevice::WriteOnly)){ + QMessageBox::critical(this, tr("QtiPlot - Export error"), + tr("Could not write to file:

%1

Please verify that you have the right to write to this location or that the file is not being used by another application!").arg(fname)); + return; + } + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + w->exportPDF(fname); + QApplication::restoreOverrideCursor(); + } +} + +//print active window +void ApplicationWindow::print() +{ + MdiSubWindow* w = activeWindow(); + if (!w) + return; + + if (w->isA("MultiLayer") && ((MultiLayer *)w)->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

")); + return; + } + w->print(); +} + +//print preview for active window +void ApplicationWindow::printPreview() +{ + MdiSubWindow* w = activeWindow(); + if (!w) + return; + + if (w->isA("MultiLayer") && ((MultiLayer *)w)->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

")); + return; + } + + QPrinter p; + p.setPaperSize(d_print_paper_size); + p.setOrientation(d_printer_orientation); + + QPrintPreviewDialog *preview = new QPrintPreviewDialog(&p, this, Qt::Window); + preview->setWindowTitle(tr("QtiPlot") + " - " + tr("Print preview of window: ") + w->objectName()); + connect(preview, SIGNAL(paintRequested(QPrinter *)), w, SLOT(print(QPrinter *))); + connect(preview, SIGNAL(paintRequested(QPrinter *)), this, SLOT(setPrintPreviewOptions(QPrinter *))); + + preview->exec(); +} + + +void ApplicationWindow::setPrintPreviewOptions(QPrinter *printer) +{ + if (!printer) + return; + + d_print_paper_size = printer->paperSize(); + d_printer_orientation = printer->orientation(); +} + +void ApplicationWindow::printAllPlots() +{ + QPrinter printer; + printer.setOrientation(QPrinter::Landscape); + printer.setColorMode (QPrinter::Color); + printer.setFullPage(true); + + if (printer.setup()) + { + QPainter *paint = new QPainter (&printer); + + int plots = 0; + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")) + plots++; + } + + printer.setMinMax (0, plots); + printer.setFromTo (0, plots); + + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer") && printer.newPage()) + ((MultiLayer*)w)->printAllLayers(paint); + } + paint->end(); + delete paint; + } +} + +void ApplicationWindow::showExpGrowthDialog() +{ + showExpDecayDialog(-1); +} + +void ApplicationWindow::showExpDecayDialog() +{ + showExpDecayDialog(1); +} + +void ApplicationWindow::showExpDecayDialog(int type) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + return; + + ExpDecayDialog *edd = new ExpDecayDialog(type, this); + edd->setGraph(g); + edd->show(); +} + +void ApplicationWindow::showTwoExpDecayDialog() +{ + showExpDecayDialog(2); +} + +void ApplicationWindow::showExpDecay3Dialog() +{ + showExpDecayDialog(3); +} + +void ApplicationWindow::showFitDialog() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + MultiLayer* plot = 0; + if(w->isA("MultiLayer")) + plot = (MultiLayer*)w; + else if(w->inherits("Table")){ + QStringList columnsLst = ((Table *)w)->drawableColumnSelection(); + if (columnsLst.isEmpty()){ + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), + tr("Please select a 'Y' column first!")); + return; + } + plot = multilayerPlot((Table *)w, columnsLst, Graph::LineSymbols); + } + + if (!plot) + return; + + Graph* g = (Graph*)plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + return; + + FitDialog *fd = new FitDialog(g, this); + connect (plot, SIGNAL(destroyed()), fd, SLOT(close())); + + fd->setSrcTables(tableList()); + fd->show(); + fd->resize(fd->minimumSize()); +} + +void ApplicationWindow::showFilterDialog(int filter) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if ( g && g->validCurvesDataSize()){ + FilterDialog *fd = new FilterDialog(filter, this); + fd->setGraph(g); + fd->exec(); + } +} + +void ApplicationWindow::lowPassFilterDialog() +{ + showFilterDialog(FFTFilter::LowPass); +} + +void ApplicationWindow::highPassFilterDialog() +{ + showFilterDialog(FFTFilter::HighPass); +} + +void ApplicationWindow::bandPassFilterDialog() +{ + showFilterDialog(FFTFilter::BandPass); +} + +void ApplicationWindow::bandBlockFilterDialog() +{ + showFilterDialog(FFTFilter::BandBlock); +} + +void ApplicationWindow::showFFTDialog() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + FFTDialog *sd = 0; + if (w->isA("MultiLayer")) { + Graph* g = ((MultiLayer*)w)->activeLayer(); + if ( g && g->validCurvesDataSize() ){ + sd = new FFTDialog(FFTDialog::onGraph, this); + sd->setGraph(g); + } + } else if (w->inherits("Table")) { + sd = new FFTDialog(FFTDialog::onTable, this); + sd->setTable((Table*)w); + } else if (w->inherits("Matrix")) { + sd = new FFTDialog(FFTDialog::onMatrix, this); + sd->setMatrix((Matrix*)w); + } + + if (sd) + sd->exec(); +} + +void ApplicationWindow::showSmoothDialog(int m) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + return; + + SmoothCurveDialog *sd = new SmoothCurveDialog(m, this); + sd->setGraph(g); + sd->exec(); +} + +void ApplicationWindow::showSmoothSavGolDialog() +{ + showSmoothDialog(SmoothFilter::SavitzkyGolay); +} + +void ApplicationWindow::showSmoothFFTDialog() +{ + showSmoothDialog(SmoothFilter::FFT); +} + +void ApplicationWindow::showSmoothAverageDialog() +{ + showSmoothDialog(SmoothFilter::Average); +} + +void ApplicationWindow::showSmoothLowessDialog() +{ + showSmoothDialog(SmoothFilter::Lowess); +} + +void ApplicationWindow::showInterpolationDialog() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + return; + + InterpolationDialog *id = new InterpolationDialog(this); + id->setGraph(g); + id->show(); +} + +void ApplicationWindow::showFitPolynomDialog() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + return; + + PolynomFitDialog *pfd = new PolynomFitDialog(this); + pfd->setGraph(g); + pfd->show(); +} + +void ApplicationWindow::updateLog(const QString& result) +{ + if ( !result.isEmpty() ){ + current_folder->appendLogInfo(result); + showResults(true); + emit modified(); + } +} + +void ApplicationWindow::showIntegrationDialog() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g) + return; + + IntDialog *id = new IntDialog(this, g); + id->exec(); +} + +void ApplicationWindow::showResults(bool ok) +{ + if (ok){ + if (!current_folder->logInfo().isEmpty()) + results->setText(current_folder->logInfo()); + else + results->setText(tr("Sorry, there are no results to display!")); + + logWindow->show(); + QTextCursor cur = results->textCursor(); + cur.movePosition(QTextCursor::End); + results->setTextCursor(cur); + } else + logWindow->hide(); +} + +void ApplicationWindow::showResults(const QString& s, bool ok) +{ + current_folder->appendLogInfo(s); + + QString logInfo = current_folder->logInfo(); + if (!logInfo.isEmpty()) + results->setText(logInfo); + showResults(ok); +} + +void ApplicationWindow::showScreenReader() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setChecked(true); + return; + } + + QList layers = plot->layersList(); + foreach(Graph *g, layers) + g->setActiveTool(new ScreenPickerTool(g, info, SLOT(setText(const QString&)))); + + displayBar->show(); +} + +void ApplicationWindow::drawPoints() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setChecked(true); + return; + } + + QList layers = plot->layersList(); + foreach(Graph *g, layers) + g->setActiveTool(new DrawPointTool(this, g, info, SLOT(setText(const QString&)))); + + displayBar->show(); +} + +void ApplicationWindow::showRangeSelectors() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), tr("There are no plot layers available in this window!")); + btnPointer->setChecked(true); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (!g) + return; + + if (!g->curveCount()){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), tr("There are no curves available on this plot!")); + btnPointer->setChecked(true); + return; + } else if (g->isPiePlot()) { + QMessageBox::warning(this, tr("QtiPlot - Warning"), tr("This functionality is not available for pie plots!")); + btnPointer->setChecked(true); + return; + } + + displayBar->show(); + g->enableRangeSelectors(info, SLOT(setText(const QString&))); +} + +void ApplicationWindow::showCursor() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setChecked(true); + return; + } + + if ((Graph*)plot->activeLayer()->isPiePlot()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("This functionality is not available for pie plots!")); + btnPointer->setChecked(true); + return; + } + + QList layers = plot->layersList(); + foreach(Graph *g, layers){ + if (g->isPiePlot() || !g->curveCount()) + continue; + if (g->validCurvesDataSize()) + g->setActiveTool(new DataPickerTool(g, this, DataPickerTool::Display, info, SLOT(setText(const QString&)))); + } + displayBar->show(); +} + +void ApplicationWindow::newLegend() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if ( g ) + g->newLegend(); +} + +void ApplicationWindow::addTimeStamp() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()) + { + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if ( g ) + g->addTimeStamp(); +} + +void ApplicationWindow::addRectangle() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph *g = (Graph*)plot->activeLayer(); + if (!g){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("There are no layers available on this plot. Operation aborted!")); + return; + } + + g->setActiveTool(new AddWidgetTool(AddWidgetTool::Rectangle, g, actionAddRectangle, info, SLOT(setText(const QString&)))); + btnPointer->setOn(false); +} + +void ApplicationWindow::addEllipse() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph *g = (Graph*)plot->activeLayer(); + if (!g){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("There are no layers available on this plot. Operation aborted!")); + return; + } + + g->setActiveTool(new AddWidgetTool(AddWidgetTool::Ellipse, g, actionAddEllipse, info, SLOT(setText(const QString&)))); + btnPointer->setOn(false); +} + +void ApplicationWindow::addTexFormula() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph *g = (Graph*)plot->activeLayer(); + if (!g){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("There are no layers available on this plot. Operation aborted!")); + return; + } + + g->setActiveTool(new AddWidgetTool(AddWidgetTool::TexEquation, g, actionAddFormula, info, SLOT(setText(const QString&)))); + btnPointer->setOn(false); +} + +void ApplicationWindow::addText() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + Graph *g = (Graph*)plot->activeLayer(); + if (g){ + g->setActiveTool(new AddWidgetTool(AddWidgetTool::Text, g, actionAddText, info, SLOT(setText(const QString&)))); + btnPointer->setOn(false); + } +} + +void ApplicationWindow::addImage() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (!g) + return; + + QString fn = getFileName(this, tr("QtiPlot - Insert image from file"), imagesDirPath, imageFilter(), 0, false); + if ( !fn.isEmpty() ){ + QFileInfo fi(fn); + imagesDirPath = fi.dirPath(true); + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + g->addImage(fn); + QApplication::restoreOverrideCursor(); + } +} + +void ApplicationWindow::drawLine() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()) + { + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + + btnPointer->setChecked(true); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (g) + { + g->drawLine(true); + emit modified(); + } +} + +void ApplicationWindow::drawArrow() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()) + { + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + + btnPointer->setOn(true); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (g){ + g->drawLine(true, 1); + emit modified(); + } +} + +void ApplicationWindow::showLayerDialog() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + if(plot->isEmpty()){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), + tr("There are no plot layers available in this window.")); + return; + } + + LayerDialog *id = new LayerDialog(this); + id->setMultiLayer(plot); + id->exec(); +} + +void ApplicationWindow::showEnrichementDialog() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g) + return; + + EnrichmentDialog::WidgetType wt = EnrichmentDialog::Frame; + LegendWidget *l = (LegendWidget *)g->activeText(); + if (l) + wt = EnrichmentDialog::Text; + else if (qobject_cast(g->activeEnrichment())) + wt = EnrichmentDialog::Image; + else if (qobject_cast(g->activeEnrichment())) + wt = EnrichmentDialog::Tex; + else if (qobject_cast(g->activeEnrichment())) + wt = EnrichmentDialog::Ellipse; + + EnrichmentDialog *ed = new EnrichmentDialog(wt, g, this); + ed->setWidget(g->activeEnrichment()); + ed->exec(); + + g->deselectMarker(); +} + +void ApplicationWindow::showLineDialog() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (g){ + ArrowMarker *lm = g->selectedArrow(); + if (!lm) + return; + + LineDialog *ld = new LineDialog(lm, this); + ld->exec(); + + g->deselectMarker(); + } +} + +void ApplicationWindow::addColToTable() +{ + Table* m = (Table*)activeWindow(TableWindow); + if ( m ) + m->addCol(); +} + +void ApplicationWindow::clearSelection() +{ + if(lv->hasFocus()){ + deleteSelectedItems(); + return; + } + + MdiSubWindow* m = activeWindow(); + if (!m) + return; + + if (m->inherits("Table")) + ((Table*)m)->clearSelection(); + else if (m->isA("Matrix")) + ((Matrix*)m)->clearSelection(); + else if (m->isA("MultiLayer")){ + Graph* g = ((MultiLayer*)m)->activeLayer(); + if (!g) + return; + + if (((MultiLayer*)m)->hasSelectedLayers()){ + ((MultiLayer*)m)->confirmRemoveLayer(); + emit modified(); + return; + } + + if (g->rangeSelectorsEnabled()) + g->rangeSelectorTool()->clearSelection(); + else if (g->activeTool() && g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker) + ((DataPickerTool *)g->activeTool())->removePoint(); + else if (g->titleSelected()) + g->clearTitle(); + else if (g->axisTitleSelected()){ + QwtScaleWidget *axis = g->currentScale(); + if (axis) + axis->setTitle(" "); + } else + g->removeMarker(); + } + else if (m->isA("Note")) + ((Note*)m)->currentEditor()->textCursor().removeSelectedText(); + emit modified(); +} + +void ApplicationWindow::copySelection() +{ + if(results->hasFocus()){ + results->copy(); + return; + } else if(info->hasFocus()) { + info->copy(); + return; + } + + MdiSubWindow* m = activeWindow(); + if (!m) + return; + + if (m->inherits("Table")) + ((Table*)m)->copySelection(); + else if (m->isA("Matrix")) + ((Matrix*)m)->copySelection(); + else if (m->isA("MultiLayer")){ + MultiLayer* plot = (MultiLayer*)m; + if (!plot || plot->numLayers() == 0) + return; + + Graph* g = (Graph*)plot->activeLayer(); + if (!g) + return; + + if (g->rangeSelectorsEnabled()) + g->rangeSelectorTool()->copySelection(); + else if (g->activeTool() && g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker) + ((DataPickerTool *)g->activeTool())->copySelection(); + else if (g->markerSelected()) + copyMarker(); + else + copyActiveLayer(); + } else if (m->isA("Note")) + ((Note*)m)->currentEditor()->copy(); +} + +void ApplicationWindow::cutSelection() +{ + MdiSubWindow* m = activeWindow(); + if (!m) + return; + + if (m->inherits("Table")) + ((Table*)m)->cutSelection(); + else if (m->isA("Matrix")) + ((Matrix*)m)->cutSelection(); + else if(m->isA("MultiLayer")){ + MultiLayer* plot = (MultiLayer*)m; + if (!plot || plot->numLayers() == 0) + return; + + Graph* g = (Graph*)plot->activeLayer(); + if (!g) + return; + + if (g->rangeSelectorsEnabled()) + g->rangeSelectorTool()->cutSelection(); + else if (g->activeTool() && g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker) + ((DataPickerTool *)g->activeTool())->cutSelection(); + else { + copyMarker(); + g->removeMarker(); + } + } else if (m->isA("Note")) + ((Note*)m)->currentEditor()->cut(); + + emit modified(); +} + +void ApplicationWindow::copyMarker() +{ + lastCopiedLayer = NULL; + + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (g && g->markerSelected()){ + d_enrichement_copy = NULL; + d_arrow_copy = NULL; + if (g->activeEnrichment()) + d_enrichement_copy = g->activeEnrichment(); + else if (g->arrowMarkerSelected()) + d_arrow_copy = g->selectedArrow(); + } +} + +void ApplicationWindow::pasteSelection() +{ + MdiSubWindow* m = activeWindow(); + if (!m) + return; + + if (m->inherits("Table")) + ((Table*)m)->pasteSelection(); + else if (m->isA("Matrix")) + ((Matrix*)m)->pasteSelection(); + else if (m->isA("Note")) + ((Note*)m)->currentEditor()->paste(); + else if (m->isA("MultiLayer")){ + MultiLayer* plot = (MultiLayer*)m; + if (!plot) + return; + + if (lastCopiedLayer){ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + Graph* g = plot->addLayer(); + g->copy(lastCopiedLayer); + QPoint pos = plot->canvas()->mapFromGlobal(QCursor::pos()); + g->setCanvasGeometry(pos.x(), pos.y(), lastCopiedLayer->canvas()->width(), lastCopiedLayer->canvas()->height()); + + QApplication::restoreOverrideCursor(); + } else { + if (plot->numLayers() == 0) + return; + + Graph* g = (Graph*)plot->activeLayer(); + if (!g) + return; + + if (g->rangeSelectorsEnabled()) + g->rangeSelectorTool()->pasteSelection(); + else if (g->activeTool() && g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker) + ((DataPickerTool *)g->activeTool())->pasteSelection(); + else if (d_enrichement_copy){ + FrameWidget *t = g->add(d_enrichement_copy); + QPoint pos = g->mapFromGlobal(QCursor::pos()); + if (g->geometry().contains(pos)) + t->move(pos); + else + t->move(g->pos()); + } else if (d_arrow_copy){ + ArrowMarker *a = g->addArrow(d_arrow_copy); + a->setStartPoint(d_arrow_copy->startPointCoord().x(), d_arrow_copy->startPointCoord().y()); + a->setEndPoint(d_arrow_copy->endPointCoord().x(), d_arrow_copy->endPointCoord().y()); + //translate the new arrow 10 pixels to the right; + a->setStartPoint(a->startPoint() + QPoint(10, 0)); + a->setEndPoint(a->endPoint() + QPoint(10, 0)); + g->replot(); + g->deselectMarker(); + } + } + } + emit modified(); +} + +MdiSubWindow* ApplicationWindow::clone(MdiSubWindow* w) +{ + if (!w) { + w = activeWindow(); + if (!w){ + QMessageBox::critical(this,tr("QtiPlot - Duplicate window error"), + tr("There are no windows available in this folder!")); + return 0; + } + } + + MdiSubWindow* nw = 0; + MdiSubWindow::Status status = w->status(); + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + if (w->isA("MultiLayer")){ + MultiLayer *g = (MultiLayer *)w; + nw = multilayerPlot(generateUniqueName(tr("Graph")), 0, g->getRows(), g->getCols()); + ((MultiLayer *)nw)->copy(g); + } else if (w->inherits("Table")){ + Table *t = (Table *)w; + QString caption = generateUniqueName(tr("Table")); + nw = newTable(caption, t->numRows(), t->numCols()); + ((Table *)nw)->copy(t); + } else if (w->isA("Graph3D")){ + Graph3D *g = (Graph3D *)w; + if (!g->hasData()){ + QApplication::restoreOverrideCursor(); + QMessageBox::warning(this, tr("QtiPlot - Duplicate error"), tr("Empty 3D surface plots cannot be duplicated!")); + return 0; + } + nw = newPlot3D(); + if (!nw) + return 0; + if (status == MdiSubWindow::Maximized) + nw->hide(); + ((Graph3D *)nw)->copy(g); + customToolBars(nw); + } else if (w->isA("Matrix")){ + nw = newMatrix(((Matrix *)w)->numRows(), ((Matrix *)w)->numCols()); + ((Matrix *)nw)->copy((Matrix *)w); + } else if (w->isA("Note")){ + nw = newNote(); + if (nw){ + ((Note*)nw)->setText(((Note*)w)->text()); + ((Note*)nw)->showLineNumbers(((Note*)w)->hasLineNumbers()); + } + } + + if (nw){ + if (w->isA("MultiLayer")){ + if (status == MdiSubWindow::Maximized) + nw->showMaximized(); + } else if (w->isA("Graph3D")){ + ((Graph3D*)nw)->setIgnoreFonts(true); + if (status != MdiSubWindow::Maximized){ + nw->resize(w->size()); + nw->showNormal(); + } else + nw->showMaximized(); + ((Graph3D*)nw)->setIgnoreFonts(false); + } else { + nw->resize(w->size()); + nw->showNormal(); + } + + nw->setWindowLabel(w->windowLabel()); + nw->setCaptionPolicy(w->captionPolicy()); + setListViewSize(nw->objectName(), w->sizeToString()); + } + QApplication::restoreOverrideCursor(); + customMenu(nw); + return nw; +} + +void ApplicationWindow::undo() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + if (qobject_cast(w)) + ((Note*)w)->currentEditor()->undo(); + else if (qobject_cast(w)){ + QUndoStack *stack = ((Matrix *)w)->undoStack(); + if (stack && stack->canUndo()) + stack->undo(); + } + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::redo() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + if (qobject_cast(w)) + ((Note*)w)->currentEditor()->redo(); + else if (qobject_cast(w)){ + QUndoStack *stack = ((Matrix *)w)->undoStack(); + if (stack && stack->canRedo()) + stack->redo(); + } + QApplication::restoreOverrideCursor(); +} + +bool ApplicationWindow::hidden(QWidget* window) +{ + if (hiddenWindows->contains(window)) + return true; + + return false; +} + +void ApplicationWindow::updateWindowStatus(MdiSubWindow* w) +{ + setListView(w->objectName(), w->aspect()); + if (w->status() == MdiSubWindow::Maximized){ + QList windows = current_folder->windowsList(); + foreach(MdiSubWindow *oldMaxWindow, windows){ + if (oldMaxWindow != w && oldMaxWindow->status() == MdiSubWindow::Maximized) + oldMaxWindow->setStatus(MdiSubWindow::Normal); + } + } + modifiedProject(); +} + +void ApplicationWindow::hideActiveWindow() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + hideWindow(w); +} + +void ApplicationWindow::hideWindow(MdiSubWindow* w) +{ + hiddenWindows->append(w); + w->setHidden(); + emit modified(); +} + +void ApplicationWindow::hideWindow() +{ + WindowListItem *it = (WindowListItem *)lv->currentItem(); + MdiSubWindow *w = it->window(); + if (!w) + return; + + hideWindow(w); +} + +void ApplicationWindow::resizeActiveWindow() +{ + MdiSubWindow* w = activeWindow(); + if (!w) + return; + + EnrichmentDialog *ed = new EnrichmentDialog(EnrichmentDialog::MDIWindow, NULL, this); + ed->setWidget(w); + ed->exec(); +} + +void ApplicationWindow::resizeWindow() +{ + WindowListItem *it = (WindowListItem *)lv->currentItem(); + MdiSubWindow *w = it->window(); + if (!w) + return; + + d_workspace->setActiveSubWindow(w); + + EnrichmentDialog *ed = new EnrichmentDialog(EnrichmentDialog::MDIWindow, NULL, this); + ed->setWidget(w); + ed->exec(); +} + +void ApplicationWindow::activateWindow() +{ + WindowListItem *it = (WindowListItem *)lv->currentItem(); + activateWindow(it->window()); +} + +void ApplicationWindow::activateWindow(MdiSubWindow *w) +{ + if (!w) + return; + + w->setNormal(); + d_workspace->setActiveSubWindow(w); + + updateWindowLists(w); + emit modified(); +} + +void ApplicationWindow::maximizeWindow(Q3ListViewItem * lbi) +{ + if (!lbi) + lbi = lv->currentItem(); + + if (!lbi || lbi->rtti() == FolderListItem::RTTI) + return; + + maximizeWindow(((WindowListItem*)lbi)->window()); +} + +void ApplicationWindow::maximizeWindow(MdiSubWindow *w) +{ + if (!w || w->status() == MdiSubWindow::Maximized) + return; + + QList windows = current_folder->windowsList(); + foreach(MdiSubWindow *ow, windows){ + if (ow != w && ow->status() == MdiSubWindow::Maximized){ + ow->setNormal(); + break; + } + } + + w->setMaximized(); + updateWindowLists(w); + emit modified(); +} + +void ApplicationWindow::minimizeWindow(MdiSubWindow *w) +{ + if (!w) + w = ((WindowListItem *)lv->currentItem())->window(); + + if (!w) + return; + + updateWindowLists(w); + w->setMinimized(); + emit modified(); +} + +void ApplicationWindow::updateWindowLists(MdiSubWindow *w) +{ + if (!w) + return; + + if (hiddenWindows->contains(w)) + hiddenWindows->takeAt(hiddenWindows->indexOf(w)); +} + +void ApplicationWindow::closeActiveWindow() +{ + MdiSubWindow *w = activeWindow(); + if (w) + w->close(); +} + +void ApplicationWindow::removeWindowFromLists(MdiSubWindow* w) +{ + if (!w) + return; + + QString caption = w->objectName(); + if (w->inherits("Table")){ + Table* m=(Table*)w; + for (int i=0; inumCols(); i++){ + QString name=m->colName(i); + removeCurves(name); + } + } else if (w->isA("MultiLayer")){ + MultiLayer *ml = (MultiLayer*)w; + Graph *g = ml->activeLayer(); + if (g) + btnPointer->setChecked(true); + } else if (w->isA("Matrix")) + remove3DMatrixPlots((Matrix*)w); + + if (hiddenWindows->contains(w)) + hiddenWindows->takeAt(hiddenWindows->indexOf(w)); + + updateCompleter(caption, true); +} + +void ApplicationWindow::closeWindow(MdiSubWindow* window) +{ + if (!window) + return; + + if (d_active_window == window) + d_active_window = NULL; + + removeWindowFromLists(window); + + Folder *f = window->folder(); + f->removeWindow(window); + + //update list view in project explorer + Q3ListViewItem *it = lv->findItem (window->objectName(), 0, Q3ListView::ExactMatch|Q3ListView::CaseSensitive); + if (it) + lv->takeItem(it); + + window->close(); + + if (show_windows_policy == ActiveFolder && !f->windowsList().count()){ + customMenu(0); + customToolBars(0); + } else if (show_windows_policy == SubFolders && !(current_folder->children()).isEmpty()){ + FolderListItem *fi = current_folder->folderListItem(); + FolderListItem *item = (FolderListItem *)fi->firstChild(); + int initial_depth = item->depth(); + bool emptyFolder = true; + while (item && item->depth() >= initial_depth){ + QList lst = item->folder()->windowsList(); + if (lst.count() > 0){ + emptyFolder = false; + break; + } + item = (FolderListItem *)item->itemBelow(); + } + if (emptyFolder){ + customMenu(0); + customToolBars(0); + } + } + emit modified(); +} + +QMessageBox * ApplicationWindow::about(bool dialog) +{ + if (dialog){ + QString text = "

"+ versionString() + "

"; + text += "

" + QString(copyright_string).replace("\n", "
") + "

"; + text += "

" + tr("Released") + ": " + QString(release_date) + "

"; + + QMessageBox *mb = new QMessageBox(); + mb->setAttribute(Qt::WA_DeleteOnClose); + mb->setWindowTitle (tr("About QtiPlot")); + mb->setWindowIcon(QIcon(":/logo.png")); + mb->setIconPixmap(QPixmap(":/logo.png")); + mb->setText(text); + mb->exec(); + return mb; + } else { + printf("%s\n", versionString().toAscii().constData()); + printf("%s\n", copyright_string); + printf("%s\n", (tr("Released") + ": " + QString(release_date)).toAscii().constData()); + exit(0); + } + return NULL; +} + +void ApplicationWindow::scriptingMenuAboutToShow() +{ + scriptingMenu->clear(); +#ifdef SCRIPTING_PYTHON + scriptingMenu->addAction(actionScriptingLang); + scriptingMenu->addAction(actionRestartScripting); + scriptingMenu->addAction(actionCustomActionDialog); + scriptingMenu->addAction(actionOpenQtDesignerUi); +#endif + + Note *note = (Note *)activeWindow(NoteWindow); + if (note){ + scriptingMenu->insertSeparator(); + + bool noteHasText = !note->text().isEmpty(); + noteTools->setEnabled(noteHasText); + if (noteHasText){ + if (scriptEnv->name() == QString("Python")){ + scriptingMenu->addAction(actionNoteExecute); + scriptingMenu->addAction(actionNoteExecuteAll); + } + scriptingMenu->addAction(actionNoteEvaluate); + + #ifdef SCRIPTING_PYTHON + if (scriptEnv->name() == QString("Python") && note->currentEditor() && note->currentEditor()->textCursor().hasSelection()){ + scriptingMenu->insertSeparator(); + scriptingMenu->addAction(actionCommentSelection); + scriptingMenu->addAction(actionUncommentSelection); + } + #endif + + scriptingMenu->insertSeparator(); + scriptingMenu->addAction(actionIncreaseIndent); + scriptingMenu->addAction(actionDecreaseIndent); + scriptingMenu->insertSeparator(); + scriptingMenu->addAction(actionFind); + scriptingMenu->addAction(actionFindNext); + scriptingMenu->addAction(actionFindPrev); + scriptingMenu->addAction(actionReplace); + scriptingMenu->insertSeparator(); + } + scriptingMenu->addAction(actionRenameNoteTab); + scriptingMenu->addAction(actionAddNoteTab); + if (note->tabs() > 1) + scriptingMenu->addAction(actionCloseNoteTab); + scriptingMenu->insertSeparator(); + actionShowNoteLineNumbers->setChecked(note->hasLineNumbers()); + scriptingMenu->addAction(actionShowNoteLineNumbers); + } + + reloadCustomActions(); +} + +void ApplicationWindow::analysisMenuAboutToShow() +{ + analysisMenu->clear(); + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (w->isA("MultiLayer")){ + QMenu *translateMenu = analysisMenu->addMenu (tr("&Translate")); + translateMenu->addAction(actionTranslateVert); + translateMenu->addAction(actionTranslateHor); + + QMenu *subtractMenu = analysisMenu->addMenu(tr("S&ubtract")); + subtractMenu->addAction(actionSubtractReference); + subtractMenu->addAction(actionSubtractLine); + + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionDifferentiate); + analysisMenu->addAction(actionIntegrate); + analysisMenu->addAction(actionShowIntDialog); + analysisMenu->insertSeparator(); + + smoothMenu->clear(); + analysisMenu->addMenu(smoothMenu); + smoothMenu->addAction(actionSmoothSavGol); + smoothMenu->addAction(actionSmoothAverage); + smoothMenu->addAction(actionSmoothLowess); + smoothMenu->addAction(actionSmoothFFT); + + filterMenu->clear(); + analysisMenu->addMenu(filterMenu); + filterMenu->addAction(actionLowPassFilter); + filterMenu->addAction(actionHighPassFilter); + filterMenu->addAction(actionBandPassFilter); + filterMenu->addAction(actionBandBlockFilter); + + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionInterpolate); + analysisMenu->addAction(actionFFT); + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionFitSlope); + analysisMenu->addAction(actionFitLinear); + analysisMenu->addAction(actionShowFitPolynomDialog); + analysisMenu->insertSeparator(); + + decayMenu->clear(); + analysisMenu->addMenu(decayMenu); + decayMenu->addAction(actionShowExpDecayDialog); + decayMenu->addAction(actionShowTwoExpDecayDialog); + decayMenu->addAction(actionShowExpDecay3Dialog); + + analysisMenu->addAction(actionFitExpGrowth); + analysisMenu->addAction(actionFitSigmoidal); + analysisMenu->addAction(actionFitGauss); + analysisMenu->addAction(actionFitLorentz); + + multiPeakMenu->clear(); + analysisMenu->addMenu(multiPeakMenu); + multiPeakMenu->addAction(actionMultiPeakGauss); + multiPeakMenu->addAction(actionMultiPeakLorentz); + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionShowFitDialog); + } else if (w->isA("Matrix")){ + analysisMenu->addAction(actionIntegrate); + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionFFT); + analysisMenu->addAction(actionMatrixFFTDirect); + analysisMenu->addAction(actionMatrixFFTInverse); + } else if (w->inherits("Table")){ + analysisMenu->addAction(actionShowColStatistics); + analysisMenu->addAction(actionShowRowStatistics); + analysisMenu->addAction(actionFrequencyCount); + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionSortSelection); + analysisMenu->addAction(actionSortTable); + + normMenu->clear(); + analysisMenu->addMenu(normMenu); + normMenu->addAction(actionNormalizeSelection); + normMenu->addAction(actionNormalizeTable); + + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionDifferentiate); + analysisMenu->addAction(actionIntegrate); + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionFFT); + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionCorrelate); + analysisMenu->addAction(actionAutoCorrelate); + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionConvolute); + analysisMenu->addAction(actionDeconvolute); + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionFitSlope); + analysisMenu->addAction(actionFitLinear); + analysisMenu->addAction(actionShowFitDialog); + } + reloadCustomActions(); +} + +void ApplicationWindow::matrixMenuAboutToShow() +{ + matrixMenu->clear(); + matrixMenu->addAction(actionSetMatrixProperties); + matrixMenu->addAction(actionSetMatrixDimensions); + matrixMenu->insertSeparator(); + matrixMenu->addAction(actionSetMatrixValues); + matrixMenu->addAction(actionTableRecalculate); + matrixMenu->insertSeparator(); + matrixMenu->addAction(actionRotateMatrix); + matrixMenu->addAction(actionRotateMatrixMinus); + matrixMenu->addAction(actionFlipMatrixVertically); + matrixMenu->addAction(actionFlipMatrixHorizontally); + matrixMenu->insertSeparator(); + matrixMenu->addAction(actionTransposeMatrix); + matrixMenu->addAction(actionInvertMatrix); + matrixMenu->addAction(actionMatrixDeterminant); + matrixMenu->insertSeparator(); + matrixMenu->addAction(actionGoToRow); + matrixMenu->addAction(actionGoToColumn); + matrixMenu->insertSeparator(); + QMenu *matrixViewMenu = matrixMenu->addMenu (tr("Vie&w")); + matrixViewMenu->addAction(actionViewMatrixImage); + matrixViewMenu->addAction(actionViewMatrix); + QMenu *matrixPaletteMenu = matrixMenu->addMenu (tr("&Palette")); + matrixPaletteMenu->addAction(actionMatrixDefaultScale); + matrixPaletteMenu->addAction(actionMatrixGrayScale); + matrixPaletteMenu->addAction(actionMatrixRainbowScale); + matrixPaletteMenu->addAction(actionMatrixCustomScale); + matrixMenu->insertSeparator(); + matrixMenu->addAction(actionMatrixColumnRow); + matrixMenu->addAction(actionMatrixXY); + matrixMenu->insertSeparator(); + QMenu *convertToTableMenu = matrixMenu->addMenu (tr("&Convert to Spreadsheet")); + convertToTableMenu->addAction(actionConvertMatrixDirect); + convertToTableMenu->addAction(actionConvertMatrixXYZ); + convertToTableMenu->addAction(actionConvertMatrixYXZ); + + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + actionViewMatrixImage->setChecked(m->viewType() == Matrix::ImageView); + actionViewMatrix->setChecked(m->viewType() == Matrix::TableView); + actionMatrixColumnRow->setChecked(m->headerViewType() == Matrix::ColumnRow); + actionMatrixColumnRow->setEnabled(m->viewType() == Matrix::TableView); + actionMatrixXY->setChecked(m->headerViewType() == Matrix::XY); + actionMatrixXY->setEnabled(m->viewType() == Matrix::TableView); + + actionMatrixDefaultScale->setChecked(m->colorMapType() == Matrix::Default); + actionMatrixGrayScale->setChecked(m->colorMapType() == Matrix::GrayScale); + actionMatrixRainbowScale->setChecked(m->colorMapType() == Matrix::Rainbow); + actionMatrixCustomScale->setChecked(m->colorMapType() == Matrix::Custom); + + reloadCustomActions(); +} + +void ApplicationWindow::fileMenuAboutToShow() +{ + if (fileMenu) + fileMenu->clear(); + if (newMenu) + newMenu->clear(); + if (exportPlotMenu) + exportPlotMenu->clear(); + if (importMenu) + importMenu->clear(); + + fileMenu->addMenu(newMenu); + newMenu->addAction(actionNewProject); + newMenu->addAction(actionNewFolder); + newMenu->addAction(actionNewTable); + newMenu->addAction(actionNewMatrix); + newMenu->addAction(actionNewNote); + newMenu->addAction(actionNewGraph); + newMenu->addAction(actionNewFunctionPlot); + newMenu->addAction(actionNewSurfacePlot); + fileMenu->addAction(actionOpen); +#ifdef XLS_IMPORT + fileMenu->addAction(actionOpenExcel); +#endif +#ifdef ODS_IMPORT + fileMenu->addAction(actionOpenOds); +#endif + fileMenu->addAction(actionLoadImage); + fileMenu->addAction(actionAppendProject); + recentMenuID = fileMenu->insertItem(tr("&Recent Projects"), recent); + fileMenu->addAction(actionCloseProject); + fileMenu->insertSeparator(); + fileMenu->addAction(actionSaveProject); + fileMenu->addAction(actionSaveProjectAs); + fileMenu->insertSeparator(); + fileMenu->addAction(actionOpenTemplate); + fileMenu->addAction(actionSaveTemplate); + fileMenu->insertSeparator(); + fileMenu->addAction(actionPrint); + fileMenu->addAction(actionPrintPreview); + fileMenu->addAction(actionPrintAllPlots); + fileMenu->insertSeparator(); + + MdiSubWindow *w = activeWindow(); + if (w){ + if (w->isA("MultiLayer") || w->isA("Graph3D")){ + fileMenu->addMenu (exportPlotMenu); + exportPlotMenu->addAction(actionExportGraph); + exportPlotMenu->addAction(actionExportAllGraphs); + exportPlotMenu->addAction(actionPresentationODF); + } else if (w->inherits("Table")) + fileMenu->addAction(actionShowExportASCIIDialog); + else if (w->isA("Matrix")){ + QMenu *exportMatrixMenu = fileMenu->addMenu(tr("Export")); + exportMatrixMenu->addAction(actionShowExportASCIIDialog); + exportMatrixMenu->addAction(actionExportMatrix); + } + } + + fileMenu->addMenu(importMenu); + importMenu->addAction(actionLoad); + importMenu->addAction(actionImportSound); + importMenu->addAction(actionImportImage); + + fileMenu->insertSeparator(); + fileMenu->addAction(actionCloseAllWindows); + + reloadCustomActions(); +} + +void ApplicationWindow::editMenuAboutToShow() +{ + MdiSubWindow *w = activeWindow(); + if (!w){ + actionUndo->setEnabled(false); + actionRedo->setEnabled(false); + return; + } + + if (qobject_cast(w)){ + QTextDocument *doc = ((Note *)w)->currentEditor()->document(); + actionUndo->setEnabled(doc->isUndoAvailable()); + actionRedo->setEnabled(doc->isRedoAvailable()); + } else if (qobject_cast(w)){ + QUndoStack *stack = ((Matrix *)w)->undoStack(); + actionUndo->setEnabled(stack->canUndo()); + actionRedo->setEnabled(stack->canRedo()); + } else { + actionUndo->setEnabled(false); + actionRedo->setEnabled(false); + } +} + +void ApplicationWindow::windowsMenuAboutToShow() +{ + windowsMenu->clear(); + foldersMenu->clear(); + + int folder_param = 0; + Folder *f = projectFolder(); + while (f){ + int id; + if (folder_param < 9) + id = foldersMenu->insertItem("&" + QString::number(folder_param+1) + " " + f->path(), this, SLOT(foldersMenuActivated(int))); + else + id = foldersMenu->insertItem(f->path(), this, SLOT(foldersMenuActivated(int))); + + foldersMenu->setItemParameter(id, folder_param); + folder_param++; + foldersMenu->setItemChecked(id, f == current_folder); + + f = f->folderBelow(); + } + + windowsMenu->insertItem(tr("&Folders"), foldersMenu); + windowsMenu->insertSeparator(); + + QList windows = current_folder->windowsList(); + int n = int(windows.count()); + if (!n ){ + #ifdef SCRIPTING_PYTHON + windowsMenu->addAction(actionShowScriptWindow); + #endif + return; + } + + windowsMenu->insertItem(tr("&Cascade"), this, SLOT(cascade())); + windowsMenu->insertItem(tr("&Tile"), d_workspace, SLOT(tileSubWindows())); + windowsMenu->insertSeparator(); + windowsMenu->addAction(actionNextWindow); + windowsMenu->addAction(actionPrevWindow); + windowsMenu->insertSeparator(); + windowsMenu->addAction(actionFindWindow); + windowsMenu->addAction(actionRename); + windowsMenu->addAction(actionCopyWindow); + windowsMenu->insertSeparator(); +#ifdef SCRIPTING_PYTHON + windowsMenu->addAction(actionShowScriptWindow); + windowsMenu->insertSeparator(); +#endif + + windowsMenu->addAction(actionResizeActiveWindow); + windowsMenu->addAction(actionHideActiveWindow); + windowsMenu->insertItem(QPixmap(":/close.png"), tr("Close &Window"), this, SLOT(closeActiveWindow()), Qt::CTRL + Qt::Key_W); + + if (n > 0) + windowsMenu->insertSeparator(); + + bool moreWindows = (n >= 10); + if (moreWindows) + n = 9; + + for (int i = 0; i < n; ++i){ + MdiSubWindow *w = windows.at(i); + if (!w) + continue; + + int id = windowsMenu->insertItem("&" + QString::number(i + 1) + " " + w->windowTitle(), this, SLOT(windowsMenuActivated(int))); + windowsMenu->setItemParameter(id, i); + windowsMenu->setItemChecked(id, current_folder->activeWindow() == w); + } + + if (moreWindows){ + windowsMenu->insertSeparator(); + windowsMenu->insertItem(tr("More windows..."), this, SLOT(showMoreWindows())); + } + + reloadCustomActions(); +} + +void ApplicationWindow::showMarkerPopupMenu() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + QMenu markerMenu(this); + + if (g->imageMarkerSelected()){ + markerMenu.insertItem(QPixmap(":/pixelProfile.png"),tr("&View Pixel Line profile"),this, SLOT(pixelLineProfile())); + markerMenu.insertItem(tr("&Intensity Matrix"),this, SLOT(intensityTable())); + markerMenu.insertSeparator(); + } + if (!g->activeEnrichment()) + markerMenu.insertItem(QPixmap(":/cut.png"),tr("&Cut"),this, SLOT(cutSelection())); + markerMenu.insertItem(QPixmap(":/copy.png"), tr("&Copy"),this, SLOT(copySelection())); + markerMenu.insertItem(QPixmap(":/delete.png"), tr("&Delete"),this, SLOT(clearSelection())); + markerMenu.insertSeparator(); + if (g->arrowMarkerSelected()) + markerMenu.insertItem(tr("&Properties..."),this, SLOT(showLineDialog())); + else + markerMenu.insertItem(tr("&Properties..."),this, SLOT(showEnrichementDialog())); + + markerMenu.exec(QCursor::pos()); +} + +void ApplicationWindow::showMoreWindows() +{ + if (explorerWindow->isVisible()) + QMessageBox::information(this, "QtiPlot",tr("Please use the project explorer to select a window!")); + else + explorerWindow->show(); +} + +void ApplicationWindow::windowsMenuActivated( int id ) +{ + QList windows = current_folder->windowsList(); + MdiSubWindow* w = windows.at( id ); + if ( w ){ + w->showNormal(); + w->setFocus(); + if(hidden(w)){ + hiddenWindows->takeAt(hiddenWindows->indexOf(w)); + setListView(w->objectName(), tr("Normal")); + } + d_workspace->setActiveSubWindow(w); + } +} + +void ApplicationWindow::foldersMenuActivated( int id ) +{ + int folder_param = 0; + Folder *f = projectFolder(); + while (f){ + if (folder_param == id){ + changeFolder (f); + return; + } + + folder_param++; + f = f->folderBelow(); + } +} + +void ApplicationWindow::newProject() +{ + if (showSaveProjectMessage() == QMessageBox::Cancel) + return; + + saveSettings();//the recent projects must be saved + +#ifdef BROWSER_PLUGIN + closeProject(); + initWindow(); +#else + ApplicationWindow *ed = new ApplicationWindow(); + ed->restoreApplicationGeometry(); + ed->initWindow(); + close(); +#endif +} + +void ApplicationWindow::savedProject() +{ + //QCoreApplication::processEvents(); + + actionSaveProject->setEnabled(false); + saved = true; + + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->isA("Matrix")) + ((Matrix *)w)->undoStack()->setClean(); + } + f = f->folderBelow(); + } +} + +void ApplicationWindow::modifiedProject() +{ + if (saved == false) + return; + + if (actionSaveProject) + actionSaveProject->setEnabled(true); + saved = false; +} + +void ApplicationWindow::modifiedProject(MdiSubWindow *w) +{ + if (!w) + return; + + modifiedProject(); + + Q3ListViewItem *it = lv->findItem (w->objectName(), 0, Q3ListView::ExactMatch | Qt::CaseSensitive ); + if (it) + it->setText(3, w->sizeToString()); +} + +void ApplicationWindow::timerEvent ( QTimerEvent *e) +{ + if (e->timerId() == savingTimerId) + saveProject(); + else + QWidget::timerEvent(e); +} + +void ApplicationWindow::dropEvent( QDropEvent* e ) +{ + if (!e->mimeData()->hasImage() && !e->mimeData()->hasUrls()) + return; + + MdiSubWindow *destWindow = NULL; + QList windows = d_workspace->subWindowList(QMdiArea::StackingOrder); + QListIterator it(windows); + it.toBack(); + QPoint pos = d_workspace->mapFromGlobal(e->pos()); + while (it.hasPrevious()){ + QMdiSubWindow *w = it.previous(); + if (w->frameGeometry().contains(pos)){ + destWindow = (MdiSubWindow*)w; + break; + } + } + + if (e->mimeData()->hasImage()){ + QImage image = qvariant_cast(e->mimeData()->imageData()); + MultiLayer *ml = qobject_cast(destWindow); + if (ml){ + Graph *l = ml->layerAt(pos); + if (l) + l->addImage(image); + else if (ml->activeLayer()) + ml->activeLayer()->addImage(image); + else + ml->addLayer()->addImage(image); + return; + } + + Matrix *m = qobject_cast(destWindow); + if (m) + m->importImage(image); + else { + m = new Matrix(scriptEnv, image, "", this); + initMatrix(m, generateUniqueName(tr("Matrix"))); + m->show(); + } + return; + } + + if (e->mimeData()->hasUrls()){ + QList urls = e->mimeData()->urls(); + QStringList fileNames; + foreach(QUrl url, urls) + fileNames << url.toLocalFile(); + + QList lst = QImageReader::supportedImageFormats() << "JPG"; + QStringList asciiFiles; + + for(int i = 0; i<(int)fileNames.count(); i++){ + QString fn = fileNames[i]; + QFileInfo fi (fn); + QString ext = fi.extension(); + QStringList tempList; + // convert QList to QStringList to be able to 'filter' + foreach(QByteArray temp,lst) + tempList.append(QString(temp)); + QStringList l = tempList.filter(ext, Qt::CaseInsensitive); + if (l.count() > 0){ + MultiLayer *ml = qobject_cast(destWindow); + if (ml){ + Graph *l = ml->layerAt(pos); + if (l) + l->addImage(fn); + else if (ml->activeLayer()) + ml->activeLayer()->addImage(fn); + else + ml->addLayer()->addImage(fn); + } else { + Matrix *m = qobject_cast(destWindow); + if (m) + m->importImage(fn); + else + importImage(fn, true); + } + } else if ( ext == "opj" || ext == "qti") + open(fn); + else + asciiFiles << fn; + } + + importASCII(asciiFiles, ImportASCIIDialog::NewTables, columnSeparator, ignoredLines, + renameColumns, strip_spaces, simplify_spaces, d_ASCII_import_comments, + d_ASCII_import_locale, d_ASCII_comment_string, d_ASCII_import_read_only, d_ASCII_end_line); + } +} + +void ApplicationWindow::dragEnterEvent( QDragEnterEvent* e ) +{ + if (e->source()){ + e->ignore(); + return; + } + + e->accept(Q3UriDrag::canDecode(e)); +} + +void ApplicationWindow::closeEvent( QCloseEvent* ce ) +{ + #ifdef QTIPLOT_DEMO + showDemoVersionMessage(); + #endif + + switch(showSaveProjectMessage()){ + case QMessageBox::Yes: + if (!saveProject()){ + ce->ignore(); + break; + } + saveSettings(); + ce->accept(); + break; + + case QMessageBox::No: + default: + saveSettings(); + ce->accept(); + break; + + case QMessageBox::Cancel: + ce->ignore(); + break; + } + + if (ce->isAccepted()) + ((QtiPlotApplication *)QCoreApplication::instance ())->remove(this); +} + +QMessageBox::StandardButton ApplicationWindow::showSaveProjectMessage() +{ + if (!saved){ + QString s = tr("Save changes to project:

%1 ?").arg(projectname); + switch(QMessageBox::information(this, tr("QtiPlot"), s, QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel, QMessageBox::Yes)){ + case QMessageBox::Yes: + #ifdef QTIPLOT_DEMO + showDemoVersionMessage(); + return QMessageBox::Discard; + #else + saveProject(); + return QMessageBox::Yes; + #endif + break; + case QMessageBox::No: + default: + savedProject(); + return QMessageBox::No; + break; + case QMessageBox::Cancel: + return QMessageBox::Cancel; + break; + } + } + return QMessageBox::No; +} + +void ApplicationWindow::closeProject() +{ + if (showSaveProjectMessage() == QMessageBox::Cancel) + return; + + blockSignals(true); + + Folder *f = projectFolder(); + f->folderListItem()->setText(0, tr("UNTITLED")); + current_folder = f; + projectname = "untitled"; + + foreach(MdiSubWindow *w, f->windowsList()){ + w->askOnCloseEvent(false); + closeWindow(w); + } + + if (!(f->children()).isEmpty()){ + Folder *subFolder = f->folderBelow(); + int initial_depth = f->depth(); + while (subFolder && subFolder->depth() > initial_depth){ + foreach(MdiSubWindow *w, subFolder->windowsList()){ + removeWindowFromLists(w); + subFolder->removeWindow(w); + delete w; + } + delete subFolder->folderListItem(); + delete subFolder; + + subFolder = f->folderBelow(); + } + } + + blockSignals(false); + savedProject(); + setWindowTitle(tr("QtiPlot - untitled")); +} + +void ApplicationWindow::customEvent(QEvent *e) +{ + if (e->type() == SCRIPTING_CHANGE_EVENT) + scriptingChangeEvent((ScriptingChangeEvent*)e); +} + +void ApplicationWindow::deleteSelectedItems() +{ + if (folders->hasFocus() && folders->currentItem() != folders->firstChild()) + {//we never allow the user to delete the project folder item + deleteFolder(); + return; + } + + Q3ListViewItem *item; + QList lst; + for (item = lv->firstChild(); item; item = item->nextSibling()){ + if (item->isSelected()) + lst.append(item); + } + + folders->blockSignals(true); + foreach(item, lst){ + if (item->rtti() == FolderListItem::RTTI) + deleteFolder(((FolderListItem *)item)->folder()); + else + ((WindowListItem *)item)->window()->close(); + } + folders->blockSignals(false); +} + +void ApplicationWindow::showListViewSelectionMenu(const QPoint &p) +{ + QMenu cm(this); + cm.insertItem(tr("&Show All Windows"), this, SLOT(showSelectedWindows())); + cm.insertItem(tr("&Hide All Windows"), this, SLOT(hideSelectedWindows())); + cm.insertSeparator(); + cm.insertItem(tr("&Delete Selection"), this, SLOT(deleteSelectedItems()), Qt::Key_F8); + cm.exec(p); +} + +void ApplicationWindow::showListViewPopupMenu(const QPoint &p) +{ + QMenu cm(this); + QMenu window(this); + + window.addAction(actionNewTable); + window.addAction(actionNewMatrix); + window.addAction(actionNewNote); + window.addAction(actionNewGraph); + window.addAction(actionNewFunctionPlot); + window.addAction(actionNewSurfacePlot); + cm.insertItem(tr("New &Window"), &window); + + cm.addAction(actionNewFolder); + cm.insertSeparator(); + cm.insertItem(tr("Auto &Column Width"), lv, SLOT(adjustColumns())); + cm.exec(p); +} + +void ApplicationWindow::showWindowPopupMenu(Q3ListViewItem *it, const QPoint &p, int) +{ + if (folders->isRenaming()) + return; + + if (!it){ + showListViewPopupMenu(p); + return; + } + + Q3ListViewItem *item; + int selected = 0; + for (item = lv->firstChild(); item; item = item->nextSibling()){ + if (item->isSelected()) + selected++; + + if (selected>1){ + showListViewSelectionMenu(p); + return; + } + } + + if (it->rtti() == FolderListItem::RTTI){ + current_folder = ((FolderListItem *)it)->folder(); + showFolderPopupMenu(it, p, false); + return; + } + + MdiSubWindow *w = ((WindowListItem *)it)->window(); + if (w){ + QMenu cm(this); + QMenu plots(this); + + cm.addAction(actionActivateWindow); + cm.addAction(actionMinimizeWindow); + cm.addAction(actionMaximizeWindow); + cm.insertSeparator(); + if (!hidden(w)) + cm.addAction(actionHideWindow); + cm.insertItem(QPixmap(":/close.png"), tr("&Delete Window"), w, SLOT(close()), Qt::Key_F8); + cm.insertSeparator(); + cm.insertItem(tr("&Rename Window"), this, SLOT(renameWindow()), Qt::Key_F2); + cm.addAction(actionResizeWindow); + cm.insertSeparator(); + cm.insertItem(QPixmap(":/fileprint.png"), tr("&Print Window"), w, SLOT(print())); + cm.insertSeparator(); + cm.insertItem(tr("&Properties..."), this, SLOT(windowProperties())); + + if (w->inherits("Table")){ + QStringList graphs = dependingPlots(w->objectName()); + if (int(graphs.count())>0){ + cm.insertSeparator(); + for (int i=0;iisA("Matrix")){ + QStringList graphs = depending3DPlots((Matrix*)w); + if (int(graphs.count())>0){ + cm.insertSeparator(); + for (int i=0;iisA("MultiLayer")) { + tablesDepend->clear(); + QStringList tbls=multilayerDependencies(w); + int n = int(tbls.count()); + if (n > 0){ + cm.insertSeparator(); + for (int i=0; iinsertItem(tbls[i], i, -1); + + cm.insertItem(tr("D&epends on"), tablesDepend); + } + } else if (w->isA("Graph3D")) { + Graph3D *sp=(Graph3D*)w; + Matrix *m = sp->matrix(); + QString formula = sp->formula(); + if (!formula.isEmpty()){ + cm.insertSeparator(); + if (formula.contains("_")){ + QStringList tl = formula.split("_", QString::SkipEmptyParts); + tablesDepend->clear(); + tablesDepend->insertItem(tl[0], 0, -1); + cm.insertItem(tr("D&epends on"), tablesDepend); + } else if (m) { + plots.insertItem(m->objectName(), m, SLOT(showNormal())); + cm.insertItem(tr("D&epends on"),&plots); + } else { + plots.insertItem(formula, w, SLOT(showNormal())); + cm.insertItem(tr("Function"), &plots); + } + } + } + cm.exec(p); + } +} + +void ApplicationWindow::showTable(int i) +{ + Table *t = table(tablesDepend->text(i)); + if (!t) + return; + + updateWindowLists(t); + + t->showMaximized(); + Q3ListViewItem *it=lv->findItem (t->objectName(), 0, Q3ListView::ExactMatch | Qt::CaseSensitive ); + if (it) + it->setText(2,tr("Maximized")); +} + +void ApplicationWindow::showTable(const QString& curve) +{ + Table* w=table(curve); + if (!w) + return; + + updateWindowLists(w); + int colIndex = w->colIndex(curve); + w->setSelectedCol(colIndex); + w->table()->clearSelection(); + w->table()->selectColumn(colIndex); + w->showMaximized(); + Q3ListViewItem *it=lv->findItem (w->objectName(), 0, Q3ListView::ExactMatch | Qt::CaseSensitive ); + if (it) + it->setText(2,tr("Maximized")); + emit modified(); +} + +QStringList ApplicationWindow::depending3DPlots(Matrix *m) +{ + QStringList plots; + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("Graph3D") && ((Graph3D *)w)->matrix() == m) + plots << w->objectName(); + } + return plots; +} + +QStringList ApplicationWindow::dependingPlots(const QString& name) +{ + QStringList plots; + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")){ + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers){ + QStringList onPlot = g->curveNamesList(); + onPlot = onPlot.grep (name,TRUE); + if (int(onPlot.count()) && plots.contains(w->objectName())<=0) + plots << w->objectName(); + } + }else if (w->isA("Graph3D")){ + if ((((Graph3D*)w)->formula()).contains(name,TRUE) && plots.contains(w->objectName())<=0) + plots << w->objectName(); + } + } + return plots; +} + +QStringList ApplicationWindow::multilayerDependencies(QWidget *w) +{ + QStringList tables; + MultiLayer *g=(MultiLayer*)w; + QList layers = g->layersList(); + foreach(Graph *ag, layers){ + QStringList onPlot = ag->curveNamesList(); + for (int j=0; jactiveLayer(); + if (!ag) + return; + + QMenu cm(this); + + QMenu addMenu(this); + if (ag->isPiePlot()){ + cm.addAction(tr("Re&move Pie Curve"),ag, SLOT(removePie())); + addMenu.addAction(actionNewLegend); + } else { + if (ag->visibleCurves() != ag->curveCount()){ + cm.addAction(actionShowAllCurves); + cm.addSeparator(); + } + + addMenu.addAction(actionShowCurvesDialog); + addMenu.addAction(actionAddFunctionCurve); + addMenu.addAction(actionAddErrorBars); + addMenu.addAction(actionNewLegend); + addMenu.addSeparator(); + } + + addMenu.addAction(actionAddFormula); + addMenu.addAction(actionAddText); + addMenu.addAction(btnArrow); + addMenu.addAction(btnLine); + addMenu.addAction(actionAddRectangle); + addMenu.addAction(actionAddEllipse); + addMenu.addAction(actionTimeStamp); + addMenu.addAction(actionAddImage); + addMenu.addSeparator(); + addMenu.addAction(actionAddLayer); + addMenu.addAction(actionAddInsetLayer); + addMenu.addAction(actionAddInsetCurveLayer); + cm.insertItem(tr("&Add"), &addMenu); + + QMenu paletteMenu(this); + if (!ag->isPiePlot()){ + cm.insertItem(tr("Anal&yze"), analysisMenu); + cm.insertItem(tr("&Data"), plotDataMenu); + + paletteMenu.addAction(tr("&Gray Scale"), ag, SLOT(setGrayScale())); + paletteMenu.addAction(tr("&Indexed Colors"), ag, SLOT(setIndexedColors())); + cm.insertItem(tr("Pale&tte"), &paletteMenu); + cm.addSeparator(); + } + + QMenu copy(this); + copy.addAction(tr("&Layer"), this, SLOT(copyActiveLayer())); + copy.addAction(tr("&Window"), plot, SLOT(copyAllLayers())); + cm.insertItem(QPixmap(":/copy.png"), tr("&Copy"), ©); + + if (lastCopiedLayer) + cm.addAction(QPixmap(":/paste.png"), tr("&Paste Layer"), this, SLOT(pasteSelection())); + else if (d_enrichement_copy){ + if (qobject_cast(d_enrichement_copy)) + cm.addAction(QPixmap(":/paste.png"), tr("&Paste Text"), plot, SIGNAL(pasteMarker())); + else if (qobject_cast(d_enrichement_copy)) + cm.addAction(QPixmap(":/paste.png"), tr("&Paste Tex Formula"), plot, SIGNAL(pasteMarker())); + else if (qobject_cast(d_enrichement_copy)) + cm.addAction(QPixmap(":/paste.png"), tr("&Paste Image"), plot, SIGNAL(pasteMarker())); + else if (qobject_cast(d_enrichement_copy)) + cm.addAction(QPixmap(":/paste.png"), tr("&Paste Rectangle"), plot, SIGNAL(pasteMarker())); + else if (qobject_cast(d_enrichement_copy)) + cm.addAction(QPixmap(":/paste.png"), tr("&Paste Ellipse"), plot, SIGNAL(pasteMarker())); + } else if (d_arrow_copy) + cm.addAction(QPixmap(":/paste.png"), tr("&Paste Line/Arrow"), plot, SIGNAL(pasteMarker())); + + QMenu exports(this); + exports.addAction(tr("&Layer"), this, SLOT(exportLayer())); + exports.addAction(tr("&Window"), this, SLOT(exportGraph())); + cm.insertItem(tr("E&xport"),&exports); + + QMenu prints(this); + prints.addAction(tr("&Layer"), plot, SLOT(printActiveLayer())); + prints.addAction(tr("&Window"), plot, SLOT(print())); + cm.insertItem(QPixmap(":/fileprint.png"), tr("&Print"),&prints); + + cm.addSeparator(); + + cm.addAction(tr("P&roperties..."), this, SLOT(showGeneralPlotDialog())); + cm.addSeparator(); + cm.addAction(actionDeleteLayer); + cm.exec(QCursor::pos()); +} + +void ApplicationWindow::showWindowContextMenu() +{ + MdiSubWindow* w = activeWindow(); + if (!w) + return; + + QMenu cm(this); + QMenu plot3D(this); + if (w->isA("MultiLayer")){ + MultiLayer *g = (MultiLayer*)w; + if (lastCopiedLayer){ + cm.insertItem(QPixmap(":/paste.png"), tr("&Paste Layer"), this, SLOT(pasteSelection())); + cm.insertSeparator(); + } + + cm.addAction(actionAddLayer); + if (g->numLayers() != 0) + cm.addAction(actionDeleteLayer); + + cm.addAction(actionShowLayerDialog); + cm.insertSeparator(); + cm.addAction(actionRename); + cm.addAction(actionCopyWindow); + cm.insertSeparator(); + cm.insertItem(QPixmap(":/copy.png"),tr("&Copy Page"), g, SLOT(copyAllLayers())); + cm.insertItem(tr("E&xport Page"), this, SLOT(exportGraph())); + cm.addAction(actionPrint); + cm.insertSeparator(); + cm.addAction(actionCloseWindow); + } else if (w->isA("Graph3D")){ + Graph3D *g=(Graph3D*)w; + if (!g->hasData()){ + cm.insertItem(tr("3D &Plot"), &plot3D); + if (hasTable()) + plot3D.addAction(actionAdd3DData); + if (matrixNames().count()) + plot3D.insertItem(tr("&Matrix..."), this, SLOT(add3DMatrixPlot())); + plot3D.addAction(actionEditSurfacePlot); + } else { + if (g->table()) + cm.insertItem(tr("Choose &Data Set..."), this, SLOT(change3DData())); + else if (g->matrix()) + cm.insertItem(tr("Choose &Matrix..."), this, SLOT(change3DMatrix())); + else if (g->userFunction() || g->parametricSurface()) + cm.addAction(actionEditSurfacePlot); + cm.insertItem(QPixmap(":/erase.png"), tr("C&lear"), g, SLOT(clearData())); + } + cm.addMenu(format); + cm.insertSeparator(); + cm.addAction(actionRename); + cm.addAction(actionCopyWindow); + cm.insertSeparator(); + cm.insertItem(tr("&Copy Graph"), g, SLOT(copyImage())); + cm.insertItem(tr("&Export"), this, SLOT(exportGraph())); + cm.addAction(actionPrint); + cm.insertSeparator(); + cm.addAction(actionCloseWindow); + } else if (qobject_cast(w)){ + Matrix *t = (Matrix *)w; + cm.addMenu(plot3DMenu); + cm.insertSeparator(); + cm.addAction(actionSetMatrixProperties); + cm.addAction(actionSetMatrixDimensions); + cm.insertSeparator(); + cm.addAction(actionSetMatrixValues); + cm.addAction(actionTableRecalculate); + cm.insertSeparator(); + + if (t->viewType() == Matrix::TableView){ + cm.insertItem(QPixmap(":/cut.png"),tr("Cu&t"), t, SLOT(cutSelection())); + cm.insertItem(QPixmap(":/copy.png"),tr("&Copy"), t, SLOT(copySelection())); + cm.insertItem(QPixmap(":/paste.png"),tr("&Paste"), t, SLOT(pasteSelection())); + cm.insertSeparator(); + cm.insertItem(QPixmap(":/insert_row.png"), tr("&Insert Row"), t, SLOT(insertRow())); + cm.insertItem(QPixmap(":/insert_column.png"), tr("&Insert Column"), t, SLOT(insertColumn())); + if (t->numSelectedRows() > 0) + cm.insertItem(QPixmap(":/delete_row.png"), tr("&Delete Rows"), t, SLOT(deleteSelectedRows())); + else if (t->numSelectedColumns() > 0) + cm.insertItem(QPixmap(":/delete_column.png"), tr("&Delete Columns"), t, SLOT(deleteSelectedColumns())); + + cm.insertItem(QPixmap(":/erase.png"),tr("Clea&r"), t, SLOT(clearSelection())); + cm.insertSeparator(); + cm.addAction(actionViewMatrixImage); + } else if (t->viewType() == Matrix::ImageView){ + cm.addAction(actionImportImage); + cm.addAction(actionExportMatrix); + cm.insertSeparator(); + cm.addAction(actionRotateMatrix); + cm.addAction(actionRotateMatrixMinus); + cm.insertSeparator(); + cm.addAction(actionFlipMatrixVertically); + cm.addAction(actionFlipMatrixHorizontally); + cm.insertSeparator(); + cm.addAction(actionTransposeMatrix); + cm.addAction(actionInvertMatrix); + cm.insertSeparator(); + cm.addAction(actionViewMatrix); + } + } + cm.exec(QCursor::pos()); +} + +void ApplicationWindow::customWindowTitleBarMenu(MdiSubWindow *w, QMenu *menu) +{ + menu->addAction(actionHideActiveWindow); + menu->addSeparator(); + if (w->inherits("Table") || w->isA("Matrix")){ + menu->addAction(actionLoad); + menu->addAction(actionShowExportASCIIDialog); + menu->addSeparator(); + } + + if (w->isA("Note")) + menu->addAction(actionSaveNote); + else + menu->addAction(actionSaveTemplate); + menu->addAction(actionPrint); + menu->addSeparator(); + menu->addAction(actionRename); + menu->addAction(actionCopyWindow); + menu->addSeparator(); +} + +void ApplicationWindow::showTableContextMenu(bool selection) +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + QMenu cm(this); + QMenu moveRow(this); + if (selection){ + if ((int)t->selectedColumns().count() > 0){ + showColMenu(t->firstSelectedColumn()); + return; + } else if (t->numSelectedRows() == 1) { + cm.addAction(actionShowColumnValuesDialog); + cm.addAction(actionTableRecalculate); + cm.insertSeparator(); + cm.insertItem(QPixmap(":/cut.png"),tr("Cu&t"), t, SLOT(cutSelection())); + cm.insertItem(QPixmap(":/copy.png"),tr("&Copy"), t, SLOT(copySelection())); + cm.insertItem(QPixmap(":/paste.png"),tr("&Paste"), t, SLOT(pasteSelection())); + cm.insertSeparator(); + moveRow.addAction(actionMoveRowUp); + moveRow.addAction(actionMoveRowDown); + moveRow.setTitle(tr("Move Row")); + cm.addMenu (&moveRow); + cm.insertItem(QPixmap(":/insert_row.png"), tr("&Insert Row"), t, SLOT(insertRow())); + cm.insertItem(QPixmap(":/delete_row.png"), tr("&Delete Row"), t, SLOT(deleteSelectedRows())); + cm.insertItem(QPixmap(":/erase.png"), tr("Clea&r Row"), t, SLOT(clearSelection())); + cm.insertSeparator(); + cm.addAction(actionShowRowStatistics); + } else if (t->numSelectedRows() > 1) { + cm.addAction(actionShowColumnValuesDialog); + cm.insertItem(QPixmap(":/cut.png"),tr("Cu&t"), t, SLOT(cutSelection())); + cm.insertItem(QPixmap(":/copy.png"),tr("&Copy"), t, SLOT(copySelection())); + cm.insertItem(QPixmap(":/paste.png"),tr("&Paste"), t, SLOT(pasteSelection())); + cm.insertSeparator(); + cm.addAction(actionTableRecalculate); + cm.insertItem(QPixmap(":/delete_row.png"), tr("&Delete Rows"), t, SLOT(deleteSelectedRows())); + cm.insertItem(QPixmap(":/erase.png"),tr("Clea&r Rows"), t, SLOT(clearSelection())); + cm.insertSeparator(); + cm.addAction(actionShowRowStatistics); + } else if (t->numRows() > 0 && t->numCols() > 0){ + cm.addAction(actionShowColumnValuesDialog); + cm.insertItem(QPixmap(":/cut.png"),tr("Cu&t"), t, SLOT(cutSelection())); + cm.insertItem(QPixmap(":/copy.png"),tr("&Copy"), t, SLOT(copySelection())); + cm.insertItem(QPixmap(":/paste.png"),tr("&Paste"), t, SLOT(pasteSelection())); + cm.insertSeparator(); + cm.addAction(actionTableRecalculate); + cm.insertItem(QPixmap(":/erase.png"),tr("Clea&r"), t, SLOT(clearSelection())); + } + } else { + cm.addAction(actionShowExportASCIIDialog); + cm.insertSeparator(); + cm.addAction(actionAddColToTable); + cm.addAction(actionClearTable); + cm.insertSeparator(); + cm.addAction(actionGoToRow); + cm.addAction(actionGoToColumn); + } + cm.exec(QCursor::pos()); +} + +void ApplicationWindow::chooseHelpFolder() +{ + QFileInfo hfi(helpFilePath); + QString dir = QFileDialog::getExistingDirectory(this, tr("Choose the location of the QtiPlot help folder!"), + hfi.dir().absolutePath(), QFileDialog::ShowDirsOnly); + if (!dir.isEmpty()){ + helpFilePath = QDir(dir).absoluteFilePath ("index.html"); + if (!QFile(helpFilePath).exists()){ + QMessageBox::critical(this, tr("QtiPlot - index.html File Not Found!"), + tr("There is no file called index.html in this folder.
Please choose another folder!")); + } + } +} + +void ApplicationWindow::showStandAloneHelp() +{ +#ifdef Q_OS_MAC // Mac + QSettings settings(QSettings::IniFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); +#else + QSettings settings(QSettings::NativeFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); +#endif + + settings.beginGroup("/General"); + settings.beginGroup("/Paths"); + QString helpPath = settings.value("/HelpFile", qApp->applicationDirPath()+"/manual/index.html").toString(); + settings.endGroup(); + settings.endGroup(); + + QFile helpFile(helpPath); + if (!helpPath.isEmpty() && !helpFile.exists()) + { + QMessageBox::critical(0, tr("QtiPlot - Help Files Not Found!"), + tr("The manual can be downloaded from the following internet address:")+ + "

http://soft.proindependent.com/manuals.html

"); + exit(0); + } + + QFileInfo fi(helpPath); + QString profilePath = QString(fi.dirPath(true)+"/qtiplot.adp"); + if (!QFile(profilePath).exists()) + { + QMessageBox::critical(0, tr("QtiPlot - Help Profile Not Found!"), + tr("The assistant could not start because the file %1 was not found in the help file directory!").arg("qtiplot.adp")+"
"+ + tr("This file is provided with the QtiPlot manual which can be downloaded from the following internet address:")+ + "

http://soft.proindependent.com/manuals.html

"); + exit(0); + } + + QStringList cmdLst = QStringList() << "-profile" << profilePath; + QAssistantClient *assist = new QAssistantClient( QString(), 0); + assist->setArguments( cmdLst ); + assist->showPage(helpPath); + connect(assist, SIGNAL(assistantClosed()), qApp, SLOT(quit()) ); +} + +void ApplicationWindow::showHelp() +{ + QFile helpFile(helpFilePath); + if (!helpFile.exists()){ + QMessageBox::critical(this, tr("QtiPlot - Help Files Not Found!"), + tr("Please indicate the location of the help file!")+"
"+ + tr("The manual can be downloaded from the following internet address:")+ + "

http://soft.proindependent.com/manuals.html

"); + QString fn = getFileName(this, tr("QtiPlot - Help Files Not Found!"), QDir::currentDirPath(), "*.html", 0, false); + if (!fn.isEmpty()){ + QFileInfo fi(fn); + helpFilePath = fi.absFilePath(); + saveSettings(); + } + } + + QFileInfo fi(helpFilePath); + QString profilePath = QString(fi.dirPath(true)+"/qtiplot.adp"); + if (!QFile(profilePath).exists()) + { + QMessageBox::critical(this,tr("QtiPlot - Help Profile Not Found!"), + tr("The assistant could not start because the file %1 was not found in the help file directory!").arg("qtiplot.adp")+"
"+ + tr("This file is provided with the QtiPlot manual which can be downloaded from the following internet address:")+ + "

http://soft.proindependent.com/manuals.html

"); + return; + } + + QStringList cmdLst = QStringList() << "-profile" << profilePath; + assistant->setArguments( cmdLst ); + assistant->showPage(helpFilePath); +} + +void ApplicationWindow::showPlotWizard() +{ + QStringList lst = tableNames(); + if (lst.count() > 0){ + PlotWizard* pw = new PlotWizard(this); + pw->insertTablesList(lst); + pw->setColumnsList(columnsList(Table::All)); + pw->changeColumnsList(lst[0]); + pw->exec(); + } else + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no tables available in this project.

" + "

Please create a table and try again!

")); +} + +void ApplicationWindow::setCurveFullRange() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g) + return; + + g->setCurveFullRange(actionCurveFullRange->data().toInt()); +} + +void ApplicationWindow::showCurveRangeDialog() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g) + return; + + showCurveRangeDialog(g, actionEditCurveRange->data().toInt()); +} + +CurveRangeDialog* ApplicationWindow::showCurveRangeDialog(Graph *g, int curve) +{ + if (!g) + return 0; + + CurveRangeDialog* crd = new CurveRangeDialog(this); + crd->setAttribute(Qt::WA_DeleteOnClose); + crd->setCurveToModify(g, curve); + crd->exec(); + return crd; +} + +FunctionDialog* ApplicationWindow::showFunctionDialog(Graph *g, int curve) +{ + if ( !g ) + return 0; + + FunctionDialog* fd = functionDialog(); + fd->setWindowTitle(tr("QtiPlot - Edit function")); + fd->setCurveToModify(g, curve); + return fd; +} + +FunctionDialog* ApplicationWindow::functionDialog() +{ + FunctionDialog* fd = new FunctionDialog(this); + fd->setModal(true); + fd->show(); + fd->setActiveWindow(); + return fd; +} + +void ApplicationWindow::addFunctionCurve() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + return; + } + + Graph* g = plot->activeLayer(); + if ( g ) { + FunctionDialog* fd = functionDialog(); + if (fd) + fd->setGraph(g); + } +} + +void ApplicationWindow::updateFunctionLists(int type, QStringList &formulas) +{ + int maxListSize = 10; + if (type == 2 && formulas.size() >= 2){ + rFunctions.remove(formulas[0]); + rFunctions.push_front(formulas[0]); + + thetaFunctions.remove(formulas[1]); + thetaFunctions.push_front(formulas[1]); + + while ((int)rFunctions.size() > maxListSize) + rFunctions.pop_back(); + while ((int)thetaFunctions.size() > maxListSize) + thetaFunctions.pop_back(); + } else if (type == 1 && formulas.size() >= 2){ + xFunctions.remove(formulas[0]); + xFunctions.push_front(formulas[0]); + + yFunctions.remove(formulas[1]); + yFunctions.push_front(formulas[1]); + + while ((int)xFunctions.size() > maxListSize) + xFunctions.pop_back(); + while ((int)yFunctions.size() > maxListSize) + yFunctions.pop_back(); + } else if (type == 0 && formulas.size() >= 1){ + d_recent_functions.remove(formulas[0]); + d_recent_functions.push_front(formulas[0]); + + while ((int)d_recent_functions.size() > maxListSize) + d_recent_functions.pop_back(); + } +} + +MultiLayer* ApplicationWindow::newFunctionPlot(QStringList &formulas, double start, double end, int points, const QString& var, int type) +{ + MultiLayer *ml = newGraph(); + if (ml) + ml->activeLayer()->addFunction(formulas, start, end, points, var, type); + + updateFunctionLists(type, formulas); + return ml; +} + +void ApplicationWindow::clearLogInfo() +{ + if (!current_folder->logInfo().isEmpty()){ + current_folder->clearLogInfo(); + results->setText(""); + emit modified(); + } +} + +void ApplicationWindow::setFramed3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setFramed(); + actionShowAxisDialog->setEnabled(TRUE); +} + +void ApplicationWindow::setBoxed3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setBoxed(); + actionShowAxisDialog->setEnabled(TRUE); +} + +void ApplicationWindow::removeAxes3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setNoAxes(); + actionShowAxisDialog->setEnabled(false); +} + +void ApplicationWindow::removeGrid3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setPolygonStyle(); +} + +void ApplicationWindow::setHiddenLineGrid3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setHiddenLineStyle(); +} + +void ApplicationWindow::setPoints3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setDotStyle(); +} + +void ApplicationWindow::setCones3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setConeStyle(); +} + +void ApplicationWindow::setCrosses3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setCrossStyle(); +} + +void ApplicationWindow::setBars3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setBarStyle(); +} + +void ApplicationWindow::setLineGrid3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setWireframeStyle(); +} + +void ApplicationWindow::setFilledMesh3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setFilledMeshStyle(); +} + +void ApplicationWindow::setFloorData3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setFloorData(); +} + +void ApplicationWindow::setFloorIso3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setFloorIsolines(); +} + +void ApplicationWindow::setEmptyFloor3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setEmptyFloor(); +} + +void ApplicationWindow::setFrontGrid3DPlot(bool on) +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setFrontGrid(on); +} + +void ApplicationWindow::setBackGrid3DPlot(bool on) +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setBackGrid(on); +} + +void ApplicationWindow::setFloorGrid3DPlot(bool on) +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setFloorGrid(on); +} + +void ApplicationWindow::setCeilGrid3DPlot(bool on) +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setCeilGrid(on); +} + +void ApplicationWindow::setRightGrid3DPlot(bool on) +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setRightGrid(on); +} + +void ApplicationWindow::setLeftGrid3DPlot(bool on) +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setLeftGrid(on); +} + +void ApplicationWindow::pickPlotStyle( QAction* action ) +{ + if (!action ) + return; + + if (action == polygon) + removeGrid3DPlot(); + else if (action == filledmesh) + setFilledMesh3DPlot(); + else if (action == wireframe) + setLineGrid3DPlot(); + else if (action == hiddenline) + setHiddenLineGrid3DPlot(); + else if (action == pointstyle) + setPoints3DPlot(); + else if (action == conestyle) + setCones3DPlot(); + else if (action == crossHairStyle) + setCrosses3DPlot(); + else if (action == barstyle) + setBars3DPlot(); + + emit modified(); +} + + +void ApplicationWindow::pickCoordSystem( QAction* action) +{ + if (!action) + return; + + if (action == Box || action == Frame) + { + if (action == Box) + setBoxed3DPlot(); + if (action == Frame) + setFramed3DPlot(); + grids->setEnabled(true); + } + else if (action == None) + { + removeAxes3DPlot(); + grids->setEnabled(false); + } + + emit modified(); +} + +void ApplicationWindow::pickFloorStyle( QAction* action ) +{ + if (!action) + return; + + if (action == floordata) + setFloorData3DPlot(); + else if (action == flooriso) + setFloorIso3DPlot(); + else + setEmptyFloor3DPlot(); + + emit modified(); +} + +void ApplicationWindow::custom3DActions(QMdiSubWindow *w) +{ + if (w && w->isA("Graph3D")) + { + Graph3D* plot = (Graph3D*)w; + actionAnimate->setOn(plot->isAnimated()); + actionPerspective->setOn(!plot->isOrthogonal()); + switch(plot->plotStyle()) + { + case FILLEDMESH: + wireframe->setChecked( false ); + hiddenline->setChecked( false ); + polygon->setChecked( false ); + filledmesh->setChecked( true ); + pointstyle->setChecked( false ); + barstyle->setChecked( false ); + conestyle->setChecked( false ); + crossHairStyle->setChecked( false ); + break; + + case FILLED: + wireframe->setChecked( false ); + hiddenline->setChecked( false ); + polygon->setChecked( true ); + filledmesh->setChecked( false ); + pointstyle->setChecked( false ); + barstyle->setChecked( false ); + conestyle->setChecked( false ); + crossHairStyle->setChecked( false ); + break; + + case Qwt3D::USER: + wireframe->setChecked( false ); + hiddenline->setChecked( false ); + polygon->setChecked( false ); + filledmesh->setChecked( false ); + + if (plot->pointType() == Graph3D::VerticalBars) + { + pointstyle->setChecked( false ); + conestyle->setChecked( false ); + crossHairStyle->setChecked( false ); + barstyle->setChecked( true ); + } + else if (plot->pointType() == Graph3D::Dots) + { + pointstyle->setChecked( true ); + barstyle->setChecked( false ); + conestyle->setChecked( false ); + crossHairStyle->setChecked( false ); + } + else if (plot->pointType() == Graph3D::HairCross) + { + pointstyle->setChecked( false ); + barstyle->setChecked( false ); + conestyle->setChecked( false ); + crossHairStyle->setChecked( true ); + } + else if (plot->pointType() == Graph3D::Cones) + { + pointstyle->setChecked( false ); + barstyle->setChecked( false ); + conestyle->setChecked( true ); + crossHairStyle->setChecked( false ); + } + break; + + case WIREFRAME: + wireframe->setChecked( true ); + hiddenline->setChecked( false ); + polygon->setChecked( false ); + filledmesh->setChecked( false ); + pointstyle->setChecked( false ); + barstyle->setChecked( false ); + conestyle->setChecked( false ); + crossHairStyle->setChecked( false ); + break; + + case HIDDENLINE: + wireframe->setChecked( false ); + hiddenline->setChecked( true ); + polygon->setChecked( false ); + filledmesh->setChecked( false ); + pointstyle->setChecked( false ); + barstyle->setChecked( false ); + conestyle->setChecked( false ); + crossHairStyle->setChecked( false ); + break; + + default: + break; + } + + switch(plot->coordStyle()) + { + case Qwt3D::NOCOORD: + None->setChecked( true ); + Box->setChecked( false ); + Frame->setChecked( false ); + break; + + case Qwt3D::BOX: + None->setChecked( false ); + Box->setChecked( true ); + Frame->setChecked( false ); + break; + + case Qwt3D::FRAME: + None->setChecked(false ); + Box->setChecked( false ); + Frame->setChecked(true ); + break; + } + + switch(plot->floorStyle()) + { + case NOFLOOR: + floornone->setChecked( true ); + flooriso->setChecked( false ); + floordata->setChecked( false ); + break; + + case FLOORISO: + floornone->setChecked( false ); + flooriso->setChecked( true ); + floordata->setChecked( false ); + break; + + case FLOORDATA: + floornone->setChecked(false ); + flooriso->setChecked( false ); + floordata->setChecked(true ); + break; + } + custom3DGrids(plot->grids()); + } +} + +void ApplicationWindow::custom3DGrids(int grids) +{ + if (Qwt3D::BACK & grids) + back->setChecked(true); + else + back->setChecked(false); + + if (Qwt3D::FRONT & grids) + front->setChecked(true); + else + front->setChecked(false); + + if (Qwt3D::CEIL & grids) + ceil->setChecked(true); + else + ceil->setChecked(false); + + if (Qwt3D::FLOOR & grids) + floor->setChecked(true); + else + floor->setChecked(false); + + if (Qwt3D::RIGHT & grids) + right->setChecked(true); + else + right->setChecked(false); + + if (Qwt3D::LEFT & grids) + left->setChecked(true); + else + left->setChecked(false); +} + +void ApplicationWindow::initPlot3DToolBar() +{ + plot3DTools = new QToolBar( tr( "3D Surface" ), this ); + plot3DTools->setObjectName("plot3DTools"); // this is needed for QMainWindow::restoreState() + plot3DTools->setIconSize( QSize(20,20) ); + addToolBarBreak( Qt::TopToolBarArea ); + addToolBar( Qt::TopToolBarArea, plot3DTools ); + + coord = new QActionGroup( this ); + Box = new QAction( coord ); + Box->setIcon(QIcon(":/box.png")); + Box->setCheckable(true); + + Frame = new QAction( coord ); + Frame->setIcon(QIcon(":/free_axes.png")); + Frame->setCheckable(true); + + None = new QAction( coord ); + None->setIcon(QIcon(":/no_axes.png")); + None->setCheckable(true); + + plot3DTools->addAction(Frame); + plot3DTools->addAction(Box); + plot3DTools->addAction(None); + Box->setChecked( true ); + + plot3DTools->addSeparator(); + + // grid actions + grids = new QActionGroup( this ); + grids->setEnabled( true ); + grids->setExclusive( false ); + front = new QAction( grids ); + front->setCheckable( true ); + front->setIcon(QIcon(":/frontGrid.png")); + back = new QAction( grids ); + back->setCheckable( true ); + back->setIcon(QIcon(":/backGrid.png")); + right = new QAction( grids ); + right->setCheckable( true ); + right->setIcon(QIcon(":/leftGrid.png")); + left = new QAction( grids ); + left->setCheckable( true ); + left->setIcon(QIcon(":/rightGrid.png")); + ceil = new QAction( grids ); + ceil->setCheckable( true ); + ceil->setIcon(QIcon(":/ceilGrid.png")); + floor = new QAction( grids ); + floor->setCheckable( true ); + floor->setIcon(QIcon(":/floorGrid.png")); + + plot3DTools->addAction(front); + plot3DTools->addAction(back); + plot3DTools->addAction(right); + plot3DTools->addAction(left); + plot3DTools->addAction(ceil); + plot3DTools->addAction(floor); + + plot3DTools->addSeparator(); + + actionPerspective = new QAction( this ); + actionPerspective->setToggleAction( TRUE ); + actionPerspective->setIconSet(QPixmap(":/perspective.png")); + actionPerspective->addTo( plot3DTools ); + actionPerspective->setOn(!d_3D_orthogonal); + connect(actionPerspective, SIGNAL(toggled(bool)), this, SLOT(togglePerspective(bool))); + + actionResetRotation = new QAction( this ); + actionResetRotation->setToggleAction( false ); + actionResetRotation->setIconSet(QPixmap(":/reset_rotation.png")); + actionResetRotation->addTo( plot3DTools ); + connect(actionResetRotation, SIGNAL(activated()), this, SLOT(resetRotation())); + + actionFitFrame = new QAction( this ); + actionFitFrame->setToggleAction( false ); + actionFitFrame->setIconSet(QPixmap(":/fit_frame.png")); + actionFitFrame->addTo( plot3DTools ); + connect(actionFitFrame, SIGNAL(activated()), this, SLOT(fitFrameToLayer())); + + plot3DTools->addSeparator(); + + //plot style actions + plotstyle = new QActionGroup( this ); + wireframe = new QAction( plotstyle ); + wireframe->setCheckable( true ); + wireframe->setEnabled( true ); + wireframe->setIcon(QIcon(":/lineMesh.png")); + hiddenline = new QAction( plotstyle ); + hiddenline->setCheckable( true ); + hiddenline->setEnabled( true ); + hiddenline->setIcon(QIcon(":/grid_only.png")); + polygon = new QAction( plotstyle ); + polygon->setCheckable( true ); + polygon->setEnabled( true ); + polygon->setIcon(QIcon(":/no_grid.png")); + filledmesh = new QAction( plotstyle ); + filledmesh->setCheckable( true ); + filledmesh->setIcon(QIcon(":/grid_poly.png")); + pointstyle = new QAction( plotstyle ); + pointstyle->setCheckable( true ); + pointstyle->setIcon(QIcon(":/pointsMesh.png")); + + conestyle = new QAction( plotstyle ); + conestyle->setCheckable( true ); + conestyle->setIcon(QIcon(":/cones.png")); + + crossHairStyle = new QAction( plotstyle ); + crossHairStyle->setCheckable( true ); + crossHairStyle->setIcon(QIcon(":/crosses.png")); + + barstyle = new QAction( plotstyle ); + barstyle->setCheckable( true ); + barstyle->setIcon(QIcon(":/plot_bars.png")); + + plot3DTools->addAction(barstyle); + plot3DTools->addAction(pointstyle); + + plot3DTools->addAction(conestyle); + plot3DTools->addAction(crossHairStyle); + plot3DTools->addSeparator(); + + plot3DTools->addAction(wireframe); + plot3DTools->addAction(hiddenline); + plot3DTools->addAction(polygon); + plot3DTools->addAction(filledmesh); + filledmesh->setChecked( true ); + + plot3DTools->addSeparator(); + + //floor actions + floorstyle = new QActionGroup( this ); + floordata = new QAction( floorstyle ); + floordata->setCheckable( true ); + floordata->setIcon(QIcon(":/floor.png")); + flooriso = new QAction( floorstyle ); + flooriso->setCheckable( true ); + flooriso->setIcon(QIcon(":/isolines.png")); + floornone = new QAction( floorstyle ); + floornone->setCheckable( true ); + floornone->setIcon(QIcon(":/no_floor.png")); + + plot3DTools->addAction(floordata); + plot3DTools->addAction(flooriso); + plot3DTools->addAction(floornone); + floornone->setChecked( true ); + + plot3DTools->addSeparator(); + + actionAnimate = new QAction( this ); + actionAnimate->setToggleAction( true ); + actionAnimate->setIconSet(QPixmap(":/movie.png")); + plot3DTools->addAction(actionAnimate); + + plot3DTools->hide(); + + connect(actionAnimate, SIGNAL(toggled(bool)), this, SLOT(toggle3DAnimation(bool))); + connect( coord, SIGNAL( triggered( QAction* ) ), this, SLOT( pickCoordSystem( QAction* ) ) ); + connect( floorstyle, SIGNAL( triggered( QAction* ) ), this, SLOT( pickFloorStyle( QAction* ) ) ); + connect( plotstyle, SIGNAL( triggered( QAction* ) ), this, SLOT( pickPlotStyle( QAction* ) ) ); + + connect( left, SIGNAL( triggered( bool ) ), this, SLOT( setLeftGrid3DPlot(bool) )); + connect( right, SIGNAL( triggered( bool ) ), this, SLOT( setRightGrid3DPlot( bool ) ) ); + connect( ceil, SIGNAL( triggered( bool ) ), this, SLOT( setCeilGrid3DPlot( bool ) ) ); + connect( floor, SIGNAL( triggered( bool ) ), this, SLOT(setFloorGrid3DPlot( bool ) ) ); + connect( back, SIGNAL( triggered( bool ) ), this, SLOT(setBackGrid3DPlot( bool ) ) ); + connect( front, SIGNAL( triggered( bool ) ), this, SLOT( setFrontGrid3DPlot( bool ) ) ); +} + +void ApplicationWindow::pixelLineProfile() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g) + return; + + bool ok; + int res = QInputDialog::getInteger( + tr("QtiPlot - Set the number of pixels to average"), tr("Number of averaged pixels"),1, 1, 2000, 2, + &ok, this ); + if ( !ok ) + return; + + LineProfileTool *lpt = new LineProfileTool(g, this, res); + g->setActiveTool(lpt); +} + +void ApplicationWindow::intensityTable() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (g){ + ImageWidget *im = qobject_cast(g->activeEnrichment()); + if (im){ + QString fn = im->fileName(); + if (!fn.isEmpty()) + importImage(fn); + } + } +} + +void ApplicationWindow::autoArrangeLayers() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + if (plot->isWaterfallPlot()) + plot->updateWaterfallLayout(); + else { + plot->setMargins(5, 5, 5, 5); + plot->setSpacing(5, 5); + plot->arrangeLayers(true, false); + } +} + +void ApplicationWindow::extractGraphs() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + if (plot->numLayers() < 2){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("You must have more than one layer in the active window!")); + return; + } + + QList lst = plot->layersList(); + foreach(Graph *g, lst){ + MultiLayer *nw = multilayerPlot(generateUniqueName(tr("Graph")), 0, plot->getRows(), plot->getCols()); + nw->resize(plot->size()); + Graph *ng = nw->addLayer(g->pos().x(), g->pos().y(), g->width(), g->height()); + if (ng) + ng->copy(g); + } +} + +void ApplicationWindow::extractLayers() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph *g = plot->activeLayer(); + if (!g) + return; + + int curves = g->curveCount(); + if (curves < 2){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("You must have more than one dataset in the active layer!")); + return; + } + + for(int i = 0; i < curves; i++){ + Graph *ng = plot->addLayer(g->pos().x(), g->pos().y(), g->width(), g->height()); + if (ng){ + ng->copy(g); + for(int j = 0; j < curves; j++){ + if (j != i) + ng->removeCurve(j); + } + } + } + plot->removeLayer(g); + plot->arrangeLayers(true, false); +} + +void ApplicationWindow::addInsetLayer(bool curves) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph *al = plot->activeLayer(); + if (!al) + return; + + QRect r = al->geometry(); + Graph *g = plot->addLayer(r.x() + r.width()/2, al->canvas()->y(), r.width()/2, r.height()/2, true); + if (g){ + g->setTitle(""); + g->setAxisTitle(QwtPlot::xBottom, ""); + g->setAxisTitle(QwtPlot::yLeft, ""); + g->enableAxis(QwtPlot::yRight, false); + g->enableAxis(QwtPlot::xTop, false); + + QColor c = Qt::white; + c.setAlpha(0); + g->setBackgroundColor(c); + g->setCanvasBackground(c); + if (curves) + g->copyCurves(al); + } +} + +void ApplicationWindow::addInsetCurveLayer() +{ + addInsetLayer(true); +} + +void ApplicationWindow::addLayer() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + if (plot->numLayers() == 0){ + setPreferences(plot->addLayer()); + return; + } + + switch(QMessageBox::information(this, + tr("QtiPlot - Guess best origin for the new layer?"), + tr("Do you want QtiPlot to guess the best position for the new layer?\n Warning: this will rearrange existing layers!"), + tr("&Guess"), tr("&Top-left corner"), tr("&Cancel"), 0, 2 ) ){ + case 0: + setPreferences(plot->addLayer()); + plot->arrangeLayers(true, true); + break; + + case 1: + setPreferences(plot->addLayer(0, 0, plot->canvasRect().width(), plot->canvasRect().height())); + break; + + case 2: + return; + break; + } +} + +void ApplicationWindow::deleteLayer() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + plot->confirmRemoveLayer(); +} + +Note* ApplicationWindow::openNote(ApplicationWindow* app, const QStringList &flist) +{ + QStringList lst = flist[0].split("\t", QString::SkipEmptyParts); + QString caption = lst[0]; + Note* w = app->newNote(caption); + if (lst.count() == 2){ + app->setListViewDate(caption, lst[1]); + w->setBirthDate(lst[1]); + } + + if (flist.size() >= 2) + restoreWindowGeometry(app, w, flist[1]); + + if (flist.size() >= 3){ + lst = flist[2].split("\t"); + if (lst.size() >= 3){ + w->setWindowLabel(lst[1]); + w->setCaptionPolicy((MdiSubWindow::CaptionPolicy)lst[2].toInt()); + } + } + return w; +} + +Matrix* ApplicationWindow::openMatrix(ApplicationWindow* app, const QStringList &flist) +{ + QStringList::const_iterator line = flist.begin(); + + QStringList list=(*line).split("\t"); + QString caption=list[0]; + int rows = list[1].toInt(); + int cols = list[2].toInt(); + + Matrix* w = app->newMatrix(caption, rows, cols); + app->setListViewDate(caption,list[3]); + w->setBirthDate(list[3]); + + for (line++; line!=flist.end(); line++) + { + QStringList fields = (*line).split("\t"); + if (fields[0] == "geometry") { + restoreWindowGeometry(app, w, *line); + } else if (fields[0] == "ColWidth") { + w->setColumnsWidth(fields[1].toInt()); + } else if (fields[0] == "Formula") { + w->setFormula(fields[1]); + } else if (fields[0] == "") { + QString formula; + for (line++; line!=flist.end() && *line != ""; line++) + formula += *line + "\n"; + formula.truncate(formula.length()-1); + w->setFormula(formula); + } else if (fields[0] == "TextFormat") { + if (fields[1] == "f") + w->setTextFormat('f', fields[2].toInt()); + else + w->setTextFormat('e', fields[2].toInt()); + } else if (fields[0] == "WindowLabel" && fields.size() >= 3) { // d_file_version > 71 + w->setWindowLabel(fields[1]); + w->setCaptionPolicy((MdiSubWindow::CaptionPolicy)fields[2].toInt()); + } else if (fields[0] == "Coordinates") { // d_file_version > 81 + w->setCoordinates(fields[1].toDouble(), fields[2].toDouble(), fields[3].toDouble(), fields[4].toDouble()); + } else if (fields[0] == "ViewType") { // d_file_version > 90 + w->setViewType((Matrix::ViewType)fields[1].toInt()); + } else if (fields[0] == "HeaderViewType") { // d_file_version > 90 + w->setHeaderViewType((Matrix::HeaderViewType)fields[1].toInt()); + } else if (fields[0] == "ColorPolicy"){// d_file_version > 90 + w->setColorMapType((Matrix::ColorMapType)fields[1].toInt()); + } else if (fields[0] == ""){// d_file_version > 90 + QStringList lst; + while ( *line != "" ){ + line++; + lst << *line; + } + lst.pop_back(); + w->setColorMap(lst); + } else // or values + break; + } + if (*line == "") line++; + + //read and set table values + for (; line!=flist.end() && *line != ""; line++){ + QStringList fields = (*line).split("\t"); + int row = fields[0].toInt(); + for (int col=0; colsetCell(row, col, QLocale::c().toDouble(cell)); + else if (d_file_version == 90) + w->setText(row, col, cell); + else + w->setCell(row, col, cell.toDouble()); + } + qApp->processEvents(QEventLoop::ExcludeUserInput); + } + w->resetView(); + return w; +} + +Table* ApplicationWindow::openTable(ApplicationWindow* app, const QStringList &flist) +{ + QStringList::const_iterator line = flist.begin(); + + QStringList list = (*line).split("\t"); + QString caption = list[0]; + int rows = list[1].toInt(); + int cols = list[2].toInt(); + + Table* w = app->newTable(caption, rows, cols); + app->setListViewDate(caption, list[3]); + w->setBirthDate(list[3]); + + for (line++; line!=flist.end(); line++) + { + QStringList fields = (*line).split("\t"); + if (fields[0] == "geometry" || fields[0] == "tgeometry") { + restoreWindowGeometry(app, w, *line); + } else if (fields[0] == "header") { + fields.pop_front(); + if (d_file_version >= 78) + w->loadHeader(fields); + else if (list.size() >= 7){ + w->setColPlotDesignation(list[4].toInt(), Table::X); + w->setColPlotDesignation(list[6].toInt(), Table::Y); + w->setHeader(fields); + } + } else if (fields[0] == "ColWidth") { + fields.pop_front(); + w->setColWidths(fields); + } else if (fields[0] == "com") { // legacy code + w->setCommands(*line); + } else if (fields[0] == "") { + for (line++; line!=flist.end() && *line != ""; line++) + { + int col = (*line).mid(9,(*line).length()-11).toInt(); + QString formula; + for (line++; line!=flist.end() && *line != ""; line++) + formula += *line + "\n"; + formula.truncate(formula.length()-1); + w->setCommand(col,formula); + } + } else if (fields[0] == "ColType") { // d_file_version > 65 + fields.pop_front(); + w->setColumnTypes(fields); + } else if (fields[0] == "Comments") { // d_file_version > 71 + fields.pop_front(); + w->setColComments(fields); + w->setHeaderColType(); + } else if (fields[0] == "WindowLabel" && fields.size() >= 3) { // d_file_version > 71 + w->setWindowLabel(fields[1]); + w->setCaptionPolicy((MdiSubWindow::CaptionPolicy)fields[2].toInt()); + } else if (fields[0] == "ReadOnlyColumn") { // d_file_version > 91 + fields.pop_front(); + for (int i=0; i < w->numCols(); i++) + w->setReadOnlyColumn(i, fields[i] == "1"); + } else if (fields[0] == "HiddenColumn") { // d_file_version >= 93 + fields.pop_front(); + for (int i=0; i < w->numCols(); i++) + w->hideColumn(i, fields[i] == "1"); + } else // or values + break; + } + + QApplication::setOverrideCursor(Qt::WaitCursor); + w->table()->blockSignals(true); + for (line++; line!=flist.end() && *line != ""; line++) + {//read and set table values + QStringList fields = (*line).split("\t"); + int row = fields[0].toInt(); + for (int col=0; col= col+2){ + QString cell = fields[col+1]; + if (cell.isEmpty()) + continue; + + if (w->columnType(col) == Table::Numeric){ + if (d_file_version < 90) + w->setCell(row, col, QLocale::c().toDouble(cell.replace(",", "."))); + else if (d_file_version == 90) + w->setText(row, col, cell); + else if (d_file_version >= 91) + w->setCell(row, col, cell.toDouble()); + } else + w->setText(row, col, cell); + } + } + QApplication::processEvents(QEventLoop::ExcludeUserInput); + } + QApplication::restoreOverrideCursor(); + + w->table()->blockSignals(false); + return w; +} + +TableStatistics* ApplicationWindow::openTableStatistics(const QStringList &flist) +{ + QStringList::const_iterator line = flist.begin(); + + QStringList list=(*line++).split("\t"); + QString caption=list[0]; + + QList targets; + for (int i=1; i <= (*line).count('\t'); i++) + targets << (*line).section('\t',i,i).toInt(); + + TableStatistics* w = newTableStatistics(table(list[1]), + list[2]=="row" ? TableStatistics::row : TableStatistics::column, targets, caption); + + setListViewDate(caption,list[3]); + w->setBirthDate(list[3]); + + for (line++; line!=flist.end(); line++){ + QStringList fields = (*line).split("\t"); + if (fields[0] == "geometry"){ + restoreWindowGeometry(this, w, *line);} + else if (fields[0] == "header"){ + fields.pop_front(); + + if (w->numCols() != fields.size()) + w->setNumCols(fields.size()); + + if (d_file_version >= 78) + w->loadHeader(fields); + else { + w->setColPlotDesignation(list[4].toInt(), Table::X); + w->setColPlotDesignation(list[6].toInt(), Table::Y); + w->setHeader(fields); + } + } else if (fields[0] == "ColWidth") { + fields.pop_front(); + w->setColWidths(fields); + } else if (fields[0] == "com") { // legacy code + w->setCommands(*line); + } else if (fields[0] == "") { + for (line++; line!=flist.end() && *line != ""; line++) + { + int col = (*line).mid(9,(*line).length()-11).toInt(); + QString formula; + for (line++; line!=flist.end() && *line != ""; line++) + formula += *line + "\n"; + formula.truncate(formula.length()-1); + w->setCommand(col,formula); + } + } else if (fields[0] == "ColType") { // d_file_version > 65 + fields.pop_front(); + w->setColumnTypes(fields); + } else if (fields[0] == "Comments") { // d_file_version > 71 + fields.pop_front(); + w->setColComments(fields); + } else if (fields[0] == "WindowLabel" && fields.size() >= 3) { // d_file_version > 71 + w->setWindowLabel(fields[1]); + w->setCaptionPolicy((MdiSubWindow::CaptionPolicy)fields[2].toInt()); + } + } + return w; +} + +Graph* ApplicationWindow::openGraph(ApplicationWindow* app, MultiLayer *plot, const QStringList &list) +{ + Graph* ag = 0; + int curveID = 0; + for (int j=0;j<(int)list.count()-1;j++){ + QString s=list[j]; + if (s.contains ("ggeometry")){ + QStringList fList = s.split("\t"); + ag = (Graph*)plot->addLayer(fList[1].toInt(), fList[2].toInt(), fList[3].toInt(), fList[4].toInt()); + ag->blockSignals(true); + ag->enableAutoscaling(autoscale2DPlots); + } + else if (s.left(10) == "Background"){ + QStringList fList = s.split("\t"); + QColor c = QColor(fList[1]); + if (fList.count() == 3) + c.setAlpha(fList[2].toInt()); + ag->setBackgroundColor(c); + } + else if (s.contains ("Margin")){ + QStringList fList=s.split("\t"); + ag->setMargin(fList[1].toInt()); + } + else if (s.contains ("Border")){ + QStringList fList=s.split("\t"); + ag->setFrame(fList[1].toInt(), QColor(fList[2])); + } + else if (s.contains ("EnabledAxes")){ + QStringList fList=s.split("\t"); + fList.pop_front(); + for (int i=0; i<(int)fList.count(); i++) + ag->enableAxis(i, fList[i].toInt()); + } + else if (s.contains ("AxesBaseline")){ + QStringList fList = s.split("\t", QString::SkipEmptyParts); + fList.pop_front(); + for (int i=0; i<(int)fList.count(); i++) + ag->setAxisMargin(i, fList[i].toInt()); + } + else if (s.contains ("EnabledTicks")) + {//version < 0.8.6 + QStringList fList=s.split("\t"); + fList.pop_front(); + fList.replaceInStrings("-1", "3"); + ag->setMajorTicksType(fList); + ag->setMinorTicksType(fList); + } + else if (s.contains ("MajorTicks")) + {//version >= 0.8.6 + QStringList fList=s.split("\t"); + fList.pop_front(); + ag->setMajorTicksType(fList); + } + else if (s.contains ("MinorTicks")) + {//version >= 0.8.6 + QStringList fList=s.split("\t"); + fList.pop_front(); + ag->setMinorTicksType(fList); + } + else if (s.contains ("TicksLength")){ + QStringList fList=s.split("\t"); + ag->setTicksLength(fList[1].toInt(), fList[2].toInt()); + } + else if (s.contains ("EnabledTickLabels")){ + QStringList fList=s.split("\t"); + fList.pop_front(); + for (int i=0; ienableAxisLabels(i, fList[i].toInt()); + } + else if (s.contains ("AxesColors")){ + QStringList fList = s.split("\t"); + fList.pop_front(); + for (int i=0; isetAxisColor(i, QColor(fList[i])); + } + else if (s.contains ("AxesNumberColors")){ + QStringList fList=QStringList::split ("\t",s,TRUE); + fList.pop_front(); + for (int i=0; isetAxisLabelsColor(i, QColor(fList[i])); + } + else if (s.left(5)=="grid\t"){ + ag->grid()->load(s.split("\t")); + } + else if (s.startsWith ("") && s.endsWith ("")){ + bool antialiasing = s.remove("").remove("").toInt(); + ag->setAntialiasing(antialiasing); + } + else if (s.contains ("PieCurve")){ + QStringList curve=s.split("\t"); + if (!app->renamedTables.isEmpty()){ + QString caption = (curve[1]).left((curve[1]).find("_",0)); + if (app->renamedTables.contains(caption)) + {//modify the name of the curve according to the new table name + int index = app->renamedTables.findIndex(caption); + QString newCaption = app->renamedTables[++index]; + curve.replaceInStrings(caption+"_", newCaption+"_"); + } + } + QPen pen = QPen(QColor(curve[3]), curve[2].toDouble(),Graph::getPenStyle(curve[4])); + + Table *table = app->table(curve[1]); + if (table){ + int startRow = 0; + int endRow = table->numRows() - 1; + int first_color = curve[7].toInt(); + bool visible = true; + if (d_file_version >= 90){ + startRow = curve[8].toInt(); + endRow = curve[9].toInt(); + visible = curve[10].toInt(); + } + + if (d_file_version <= 89) + first_color = convertOldToNewColorIndex(first_color); + + if (curve.size() >= 22){//version 0.9.3-rc3 + ag->plotPie(table, curve[1], pen, curve[5].toInt(), + curve[6].toInt(), first_color, startRow, endRow, visible, + curve[11].toDouble(), curve[12].toDouble(), curve[13].toDouble(), + curve[14].toDouble(), curve[15].toDouble(), curve[16].toInt(), + curve[17].toInt(), curve[18].toInt(), curve[19].toInt(), + curve[20].toInt(), curve[21].toInt()); + } else + ag->plotPie(table, curve[1], pen, curve[5].toInt(), + curve[6].toInt(), first_color, startRow, endRow, visible); + } + }else if (s.left(6)=="curve\t"){ + QStringList curve = s.split("\t", QString::SkipEmptyParts); + if (!app->renamedTables.isEmpty()){ + QString caption = (curve[2]).left((curve[2]).find("_",0)); + if (app->renamedTables.contains(caption)) + {//modify the name of the curve according to the new table name + int index = app->renamedTables.findIndex (caption); + QString newCaption = app->renamedTables[++index]; + curve.replaceInStrings(caption+"_", newCaption+"_"); + } + } + + CurveLayout cl; + cl.connectType=curve[4].toInt(); + cl.lCol = readColorFromProject(curve[5]); + cl.lStyle = curve[6].toInt(); + cl.lWidth = curve[7].toDouble(); + cl.sSize = curve[8].toInt(); + if (d_file_version <= 78) + cl.sType=Graph::obsoleteSymbolStyle(curve[9].toInt()); + else + cl.sType=curve[9].toInt(); + + cl.symCol = readColorFromProject(curve[10]); + cl.fillCol = readColorFromProject(curve[11]); + cl.filledArea = curve[12].toDouble(); + cl.aCol = readColorFromProject(curve[13]); + cl.aStyle = curve[14].toInt(); + if(curve.count() < 16) + cl.penWidth = cl.lWidth; + else if ((d_file_version >= 79) && (curve[3].toInt() == Graph::Box)) + cl.penWidth = curve[15].toDouble(); + else if ((d_file_version >= 78) && (curve[3].toInt() <= Graph::LineSymbols)) + cl.penWidth = curve[15].toDouble(); + else + cl.penWidth = cl.lWidth; + + int plotType = curve[3].toInt(); + Table *w = app->table(curve[2]); + PlotCurve *c = NULL; + if (w){ + if(plotType == Graph::VectXYXY || plotType == Graph::VectXYAM){ + QStringList colsList; + colsList<colName(curve[1].toInt())); + else + colsList.prepend(curve[1]); + + int startRow = 0; + int endRow = -1; + if (d_file_version >= 90){ + startRow = curve[curve.count()-3].toInt(); + endRow = curve[curve.count()-2].toInt(); + } + + c = (PlotCurve *)ag->plotVectorCurve(w, colsList, plotType, startRow, endRow); + + if (d_file_version <= 77){ + int temp_index = convertOldToNewColorIndex(curve[15].toInt()); + ag->updateVectorsLayout(curveID, ColorBox::defaultColor(temp_index), curve[16].toDouble(), curve[17].toInt(), + curve[18].toInt(), curve[19].toInt(), 0, curve[20], curve[21]); + } else { + if(plotType == Graph::VectXYXY) + ag->updateVectorsLayout(curveID, curve[15], curve[16].toDouble(), + curve[17].toInt(), curve[18].toInt(), curve[19].toInt(), 0); + else + ag->updateVectorsLayout(curveID, curve[15], curve[16].toDouble(), curve[17].toInt(), + curve[18].toInt(), curve[19].toInt(), curve[22].toInt()); + } + } else if (plotType == Graph::Box) + c = (PlotCurve *)ag->openBoxDiagram(w, curve, d_file_version); + else { + if (d_file_version < 72) + c = (PlotCurve *)ag->insertCurve(w, curve[1].toInt(), curve[2], plotType); + else if (d_file_version < 90) + c = (PlotCurve *)ag->insertCurve(w, curve[1], curve[2], plotType); + else { + int startRow = curve[curve.count()-3].toInt(); + int endRow = curve[curve.count()-2].toInt(); + c = (PlotCurve *)ag->insertCurve(w, curve[1], curve[2], plotType, startRow, endRow); + } + } + + if(plotType == Graph::Histogram){ + QwtHistogram *h = (QwtHistogram *)ag->curve(curveID); + if (d_file_version <= 76) + h->setBinning(curve[16].toInt(),curve[17].toDouble(),curve[18].toDouble(),curve[19].toDouble()); + else + h->setBinning(curve[17].toInt(),curve[18].toDouble(),curve[19].toDouble(),curve[20].toDouble()); + h->loadData(); + } + + if(plotType == Graph::VerticalBars || plotType == Graph::HorizontalBars || + plotType == Graph::Histogram){ + if (d_file_version <= 76) + ag->setBarsGap(curveID, curve[15].toInt(), 0); + else + ag->setBarsGap(curveID, curve[15].toInt(), curve[16].toInt()); + } + ag->updateCurveLayout(c, &cl); + if (d_file_version >= 88){ + if (c && c->rtti() == QwtPlotItem::Rtti_PlotCurve){ + if (d_file_version < 90) + c->setAxis(curve[curve.count()-2].toInt(), curve[curve.count()-1].toInt()); + else { + c->setAxis(curve[curve.count()-5].toInt(), curve[curve.count()-4].toInt()); + c->setVisible(curve.last().toInt()); + } + } + } + } else if(plotType == Graph::Histogram){//histograms from matrices + Matrix *m = app->matrix(curve[2]); + QwtHistogram *h = ag->restoreHistogram(m, curve); + ag->updateCurveLayout(h, &cl); + } + curveID++; + } else if (s == ""){ + QStringList lst; + while ( s!="" ){ + s = list[++j]; + lst << s; + } + lst.pop_back(); + ag->restoreCurveLabels(curveID - 1, lst); + } else if (s.contains("")){ + PlotCurve *c = (PlotCurve *)ag->curve(curveID - 1); + if (c) + c->setSkipSymbolsCount(s.remove("").remove("").toInt()); + } else if (s.contains("")){ + QwtBarCurve *b = (QwtBarCurve *)ag->curve(curveID - 1); + if (b) + b->setWhiteOut(); + } else if (s == ""){//version 0.9.5 + curveID++; + QStringList lst; + while ( s != "" ){ + s = list[++j]; + lst << s; + } + lst.pop_back(); + FunctionCurve::restore(ag, lst); + } else if (s.contains ("FunctionCurve")){ + QStringList curve = s.split("\t"); + CurveLayout cl; + cl.connectType = curve[6].toInt(); + cl.lCol = readColorFromProject(curve[7]); + cl.lStyle = curve[8].toInt(); + cl.lWidth=curve[9].toDouble(); + cl.sSize=curve[10].toInt(); + cl.sType=curve[11].toInt(); + cl.symCol = readColorFromProject(curve[12]); + cl.fillCol = readColorFromProject(curve[13]); + cl.filledArea = curve[14].toDouble(); + cl.aCol = readColorFromProject(curve[15]); + cl.aStyle=curve[16].toInt(); + int current_index = 17; + if(curve.count() < 16) + cl.penWidth = cl.lWidth; + else if ((d_file_version >= 79) && (curve[5].toInt() == Graph::Box)) + { + cl.penWidth = curve[17].toDouble(); + current_index++; + } + else if ((d_file_version >= 78) && (curve[5].toInt() <= Graph::LineSymbols)) + { + cl.penWidth = curve[17].toDouble(); + current_index++; + } + else + cl.penWidth = cl.lWidth; + + PlotCurve *c = (PlotCurve *)ag->insertFunctionCurve(curve[1], curve[2].toInt(), d_file_version); + c->setPlotStyle(curve[5].toInt()); + ag->updateCurveLayout(c, &cl); + if (d_file_version >= 88){ + QwtPlotCurve *c = ag->curve(curveID); + if (c){ + if(current_index + 1 < curve.size()) + c->setAxis(curve[current_index].toInt(), curve[current_index+1].toInt()); + if (d_file_version >= 90 && current_index+2 < curve.size()) + c->setVisible(curve.last().toInt()); + else + c->setVisible(true); + } + + } + curveID++; + } + else if (s.contains ("ErrorBars")){ + QStringList curve = s.split("\t", QString::SkipEmptyParts); + if (!app->renamedTables.isEmpty()){ + QString caption = (curve[4]).left((curve[4]).find("_",0)); + if (app->renamedTables.contains(caption)) + {//modify the name of the curve according to the new table name + int index = app->renamedTables.findIndex (caption); + QString newCaption = app->renamedTables[++index]; + curve.replaceInStrings(caption+"_", newCaption+"_"); + } + } + Table *w = app->table(curve[3]); + Table *errTable = app->table(curve[4]); + if (w && errTable){ + ag->addErrorBars(curve[2], curve[3], errTable, curve[4], curve[1].toInt(), + curve[5].toDouble(), curve[6].toInt(), QColor(curve[7]), + curve[8].toInt(), curve[10].toInt(), curve[9].toInt()); + } + curveID++; + } + else if (s == ""){ + curveID++; + QStringList lst; + while ( s!="" ){ + s = list[++j]; + lst << s; + } + lst.pop_back(); + ag->restoreSpectrogram(app, lst); + } + else if (s.left(6) == "scale\t"){ + QStringList scl = s.split("\t"); + scl.pop_front(); + int size = scl.count(); + if (d_file_version < 88){ + double step = scl[2].toDouble(); + if (scl[5] == "0") + step = 0.0; + ag->setScale(QwtPlot::xBottom, scl[0].toDouble(), scl[1].toDouble(), step, + scl[3].toInt(), scl[4].toInt(), scl[6].toInt(), bool(scl[7].toInt())); + ag->setScale(QwtPlot::xTop, scl[0].toDouble(), scl[1].toDouble(), step, + scl[3].toInt(), scl[4].toInt(), scl[6].toInt(), bool(scl[7].toInt())); + + step = scl[10].toDouble(); + if (scl[13] == "0") + step = 0.0; + ag->setScale(QwtPlot::yLeft, scl[8].toDouble(), scl[9].toDouble(), step, scl[11].toInt(), + scl[12].toInt(), scl[14].toInt(), bool(scl[15].toInt())); + ag->setScale(QwtPlot::yRight, scl[8].toDouble(), scl[9].toDouble(), step, scl[11].toInt(), + scl[12].toInt(), scl[14].toInt(), bool(scl[15].toInt())); + } else if (size == 8){ + ag->setScale(scl[0].toInt(), scl[1].toDouble(), scl[2].toDouble(), scl[3].toDouble(), + scl[4].toInt(), scl[5].toInt(), scl[6].toInt(), bool(scl[7].toInt())); + } else if (size == 18){ + ag->setScale(scl[0].toInt(), scl[1].toDouble(), scl[2].toDouble(), scl[3].toDouble(), + scl[4].toInt(), scl[5].toInt(), scl[6].toInt(), bool(scl[7].toInt()), scl[8].toDouble(), + scl[9].toDouble(), scl[10].toInt(), scl[11].toDouble(), scl[12].toDouble(), scl[13].toInt(), + scl[14].toInt(), bool(scl[15].toInt()), scl[16].toInt(), bool(scl[17].toInt())); + } + } + else if (s.contains ("PlotTitle")){ + QStringList fList=s.split("\t"); + ag->setTitle(fList[1]); + ag->setTitleColor(QColor(fList[2])); + ag->setTitleAlignment(fList[3].toInt()); + } + else if (s.contains ("TitleFont")){ + QStringList fList=s.split("\t"); + QFont fnt=QFont (fList[1],fList[2].toInt(),fList[3].toInt(),fList[4].toInt()); + fnt.setUnderline(fList[5].toInt()); + fnt.setStrikeOut(fList[6].toInt()); + ag->setTitleFont(fnt); + } + else if (s.contains ("AxesTitles")){ + QStringList lst=s.split("\t"); + lst.pop_front(); + for (int i=0; i<4; i++){ + if (lst.count() > i) + ag->setScaleTitle(i, lst[i]); + } + } + else if (s.contains ("AxesTitleColors")){ + QStringList colors = s.split("\t", QString::SkipEmptyParts); + colors.pop_front(); + for (int i=0; isetAxisTitleColor(i, colors[i]); + }else if (s.contains ("AxesTitleAlignment")){ + QStringList align=s.split("\t", QString::SkipEmptyParts); + align.pop_front(); + for (int i=0; i<(int)align.count(); i++) + ag->setAxisTitleAlignment(i, align[i].toInt()); + } else if (s.contains ("AxesTitleDistance")){ + QStringList align = s.split("\t", QString::SkipEmptyParts); + align.pop_front(); + for (int i=0; i<(int)align.count(); i++) + ag->setAxisTitleDistance(i, align[i].toInt()); + } else if (s.contains ("")){ + QwtScaleWidget *scale = ag->axisWidget(QwtPlot::yRight); + if (scale) + scale->setLayoutFlag(QwtScaleWidget::TitleInverted, true); + } else if (s.contains ("ScaleFont")){ + QStringList fList=s.split("\t"); + QFont fnt=QFont (fList[1],fList[2].toInt(),fList[3].toInt(),fList[4].toInt()); + fnt.setUnderline(fList[5].toInt()); + fnt.setStrikeOut(fList[6].toInt()); + + int axis=(fList[0].right(1)).toInt(); + ag->setAxisTitleFont(axis,fnt); + }else if (s.contains ("AxisFont")){ + QStringList fList=s.split("\t"); + QFont fnt=QFont (fList[1],fList[2].toInt(),fList[3].toInt(),fList[4].toInt()); + fnt.setUnderline(fList[5].toInt()); + fnt.setStrikeOut(fList[6].toInt()); + + int axis=(fList[0].right(1)).toInt(); + ag->setAxisFont(axis,fnt); + } + else if (s.contains ("AxesFormulas")) + { + QStringList fList=s.split("\t"); + fList.remove(fList.first()); + for (int i=0; i<(int)fList.count(); i++) + ag->setAxisFormula(i, fList[i]); + } + else if (s.startsWith("setAxisFormula(axis, formula); + } + else if (s.contains ("LabelsFormat")) + { + QStringList fList=s.split("\t"); + fList.pop_front(); + ag->setLabelsNumericFormat(fList); + } + else if (s.contains ("LabelsRotation")) + { + QStringList fList=s.split("\t"); + ag->setAxisLabelRotation(QwtPlot::xBottom, fList[1].toInt()); + ag->setAxisLabelRotation(QwtPlot::xTop, fList[2].toInt()); + } + else if (s.contains ("DrawAxesBackbone")) + { + ag->loadAxesOptions(s.split("\t")); + } + else if (s.contains ("AxesLineWidth")) + { + QStringList fList=s.split("\t"); + ag->loadAxesLinewidth(fList[1].toInt()); + } + else if (s.contains ("TickLabelsSpace")) + { + QStringList lst = s.split("\t"); + lst.removeFirst(); + for (int i = 0; i < QwtPlot::axisCnt; i++){ + QwtScaleDraw *sd = ag->axisScaleDraw (i); + if (sd && lst.count() > i) + sd->setSpacing(lst[i].toInt()); + } + } + else if (s.contains ("ShowTicksPolicy")) + { + QStringList lst = s.split("\t"); + lst.removeFirst(); + for (int i = 0; i < QwtPlot::axisCnt; i++){ + ScaleDraw *sd = (ScaleDraw *)ag->axisScaleDraw (i); + if (sd && lst.count() > i) + sd->setShowTicksPolicy((ScaleDraw::ShowTicksPolicy)lst[i].toInt()); + } + } + else if (s.contains ("CanvasFrame")){ + QStringList lst = s.split("\t"); + ag->setCanvasFrame(lst[1].toInt(), QColor(lst[2])); + } + else if (s.contains ("CanvasBackground")) + { + QStringList list = s.split("\t"); + QColor c = QColor(list[1]); + if (list.count() == 3) + c.setAlpha(list[2].toInt()); + ag->setCanvasBackground(c); + } + else if (s.startsWith ("Legend")) + {// version <= 0.8.9 + QStringList fList = QStringList::split ("\t",s, true); + ag->insertLegend(fList, d_file_version); + } + else if (s.startsWith ("") && s.endsWith ("")) + { + QStringList fList = QStringList::split ("\t", s.remove(""), true); + ag->insertLegend(fList, d_file_version); + } + else if (s.contains ("textMarker")) + {// version <= 0.8.9 + QStringList fList = QStringList::split ("\t",s, true); + ag->insertText(fList, d_file_version); + } + else if (s.startsWith ("") && s.endsWith ("")) + { + QStringList fList = QStringList::split ("\t", s.remove(""), true); + ag->insertText(fList, d_file_version); + } + else if (s.startsWith ("") && s.endsWith ("")) + { + QStringList fList = QStringList::split ("\t", s.remove(""), true); + ag->insertText(fList, d_file_version); + } else if (s == ""){//version 0.9.7 + QStringList lst; + while ( s != "" ){ + s = list[++j]; + lst << s; + } + lst.pop_back(); + PieLabel::restore(ag, lst); + } + else if (s.contains ("lineMarker")) + {// version <= 0.8.9 + QStringList fList=s.split("\t"); + ag->addArrow(fList, d_file_version); + } + else if (s.startsWith ("") && s.endsWith ("")) + { + QStringList fList=s.remove("").split("\t"); + ag->addArrow(fList, d_file_version); + } + else if (s.contains ("ImageMarker") || (s.startsWith ("") && s.endsWith (""))) + { + QStringList fList=s.remove("").split("\t"); + ag->insertImageMarker(fList, d_file_version); + } else if (s == ""){//version 0.9.7 + QStringList lst; + while ( s != "" ){ + s = list[++j]; + lst << s; + } + lst.pop_back(); + TexWidget::restore(ag, lst); + } else if (s == ""){//version 0.9.7 + QStringList lst; + while ( s != "" ){ + s = list[++j]; + lst << s; + } + lst.pop_back(); + ImageWidget::restore(ag, lst); + } else if (s == ""){//version 0.9.7 + QStringList lst; + while ( s != "" ){ + s = list[++j]; + lst << s; + } + lst.pop_back(); + LegendWidget::restore(ag, lst); + } else if (s == ""){//version 0.9.7 + QStringList lst; + while ( s != "" ){ + s = list[++j]; + lst << s; + } + lst.pop_back(); + RectangleWidget::restore(ag, lst); + } else if (s == ""){//version 0.9.7.2 + QStringList lst; + while ( s != "" ){ + s = list[++j]; + lst << s; + } + lst.pop_back(); + EllipseWidget::restore(ag, lst); + } + else if (s.contains("AxisType")) + { + QStringList fList = s.split("\t"); + for (int i=0; i<4; i++){ + QStringList lst = fList[i+1].split(";", QString::SkipEmptyParts); + int format = lst[0].toInt(); + if (format == ScaleDraw::Numeric) + continue; + if (format == ScaleDraw::Day) + ag->setLabelsDayFormat(i, lst[1].toInt()); + else if (format == ScaleDraw::Month) + ag->setLabelsMonthFormat(i, lst[1].toInt()); + else if (format == ScaleDraw::Time || format == ScaleDraw::Date) + ag->setLabelsDateTimeFormat(i, format, lst[1]+";"+lst[2]); + else if (lst.size() > 1) + ag->setLabelsTextFormat(i, format, lst[1], app->table(lst[1])); + } + } + else if (d_file_version < 69 && s.contains ("AxesTickLabelsCol")) + { + QStringList fList = s.split("\t"); + for (int i=0; i<4; i++){ + QString colName = fList[i+1]; + Table *nw = app->table(colName); + ag->setLabelsTextFormat(i, ag->axisType(i), colName, nw); + } + } else if (s.startsWith ("") && s.endsWith ("")){ + QStringList lst = s.remove("").remove("").split("\t"); + if (lst.size() == 2) + ag->enableDouglasPeukerSpeedMode(lst[0].toDouble(), lst[1].toInt()); + } else if (s.startsWith ("") && s.endsWith ("")){ + QStringList lst = s.remove("").remove("").split("\t"); + if (!lst.isEmpty()){ + Table *hort = 0, *vert = 0; + if (lst.size() >= 2) + hort = app->table(lst[1]); + if (lst.size() >= 3) + vert = app->table(lst[2]); + ag->setActiveTool(new ImageProfilesTool(app, ag, app->matrix(lst[0]), hort, vert, app->info, SLOT(setText(const QString&)))); + } + } else if (s.startsWith ("") && s.endsWith ("")){ + QStringList lst = s.remove("").remove("").split("\t"); + if (lst.size() == 2 && ag->activeTool()) + ((ImageProfilesTool *)ag->activeTool())->append(QwtDoublePoint(lst[0].toDouble(), lst[1].toDouble())); + } + } + ag->updateLayout(); + + ag->blockSignals(false); + ag->setAutoscaleFonts(app->autoScaleFonts); + return ag; +} + +void ApplicationWindow::copyActiveLayer() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph *g = plot->activeLayer(); + if (!g) + return; + + lastCopiedLayer = g; + connect (g, SIGNAL(destroyed()), this, SLOT(closedLastCopiedLayer())); + g->copyImage(); +} + +void ApplicationWindow::showDataSetDialog(Analysis operation) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph *g = plot->activeLayer(); + if (!g) + return; + + bool ok; + QString curve = QInputDialog::getItem(this, tr("QtiPlot - Choose data set"), + tr("Curve") + ": ", g->analysableCurvesList(), 0, false, &ok); + if (ok && !curve.isEmpty()) + analyzeCurve(g, operation, curve); +} + +void ApplicationWindow::analyzeCurve(Graph *g, Analysis operation, const QString& curveTitle) +{ + if (!g) + return; + + Fit *fitter = 0; + switch(operation){ + case NoAnalysis: + break; + case Integrate: + { + Integration *i = new Integration(this, g, curveTitle); + i->run(); + delete i; + } + break; + case Diff: + { + Differentiation *diff = new Differentiation(this, g, curveTitle); + diff->enableGraphicsDisplay(true); + diff->run(); + delete diff; + } + break; + case FitLinear: + fitter = new LinearFit (this, g); + break; + case FitLorentz: + fitter = new LorentzFit(this, g); + break; + case FitGauss: + fitter = new GaussFit(this, g); + break; + case FitSigmoidal: + { + QwtPlotCurve* c = g->curve(curveTitle); + if (c){ + ScaleEngine *se = (ScaleEngine *)g->axisScaleEngine(c->xAxis()); + if(se->type() == ScaleTransformation::Log10) + fitter = new LogisticFit (this, g); + else + fitter = new SigmoidalFit (this, g); + } + } + break; + case FitSlope: + fitter = new LinearSlopeFit (this, g); + break; + } + + if (!fitter) + return; + + if (fitter->setDataFromCurve(curveTitle)){ + if (operation != FitLinear && operation != FitSlope){ + fitter->guessInitialValues(); + fitter->scaleErrors(fit_scale_errors); + fitter->generateFunction(generateUniformFitPoints, fitPoints); + } else if (d_2_linear_fit_points) + fitter->generateFunction(generateUniformFitPoints, 2); + fitter->setOutputPrecision(fit_output_precision); + fitter->fit(); + if (pasteFitResultsToPlot) + fitter->showLegend(); + delete fitter; + } +} + +void ApplicationWindow::analysis(Analysis operation) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + return; + + QString curve_title = g->selectedCurveTitle(); + if (!curve_title.isNull()) { + analyzeCurve(g, operation, curve_title); + return; + } + + QStringList lst = g->analysableCurvesList(); + if (lst.count() == 1){ + const QwtPlotCurve *c = g->curve(lst[0]); + if (c) + analyzeCurve(g, operation, lst[0]); + } else + showDataSetDialog(operation); +} + +void ApplicationWindow::integrate() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (w->isA("MultiLayer")) + analysis(Integrate); + else if (w->isA("Matrix")){ + QDateTime dt = QDateTime::currentDateTime (); + QString info = dt.toString(Qt::LocalDate); + info += "\n" + tr("Integration of %1 from zero is").arg(QString(w->objectName())) + ":\t"; + info += QString::number(((Matrix *)w)->integrate()) + "\n"; + info += "-------------------------------------------------------------\n"; + current_folder->appendLogInfo(info); + showResults(true); + } else if (w->inherits("Table")){ + Table *t = (Table *)w; + QStringList lst = t->selectedYColumns(); + int cols = lst.size(); + if (!cols){ + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), + tr("Please select a 'Y' column first!")); + return; + } + + Table *result = newTable(cols, 2, "", tr("Integration of %1").arg(t->objectName())); + result->setColName(0, tr("Column")); + result->setColName(1, tr("Area")); + int aux = 0; + foreach (QString yCol, lst){ + int xCol = t->colX(t->colIndex(yCol)); + Integration *i = new Integration(this, t, t->colName(xCol), yCol); + i->run(); + result->setText(aux, 0, yCol); + result->setCell(aux, 1, i->area()); + aux++; + delete i; + } + result->show(); + } +} + +void ApplicationWindow::differentiate() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (qobject_cast(w)) + analysis(Diff); + else if (w->inherits("Table")){ + Table *t = qobject_cast
(w); + QStringList lst = t->selectedYColumns(); + int cols = lst.size(); + if (!cols){ + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), + tr("Please select a 'Y' column first!")); + return; + } + + Differentiation *diff = new Differentiation(this, NULL, "", ""); + int aux = 0; + foreach (QString yCol, lst){ + int xCol = t->colX(t->colIndex(yCol)); + diff->setDataFromTable(t, t->colName(xCol), yCol); + diff->run(); + Graph *g = diff->outputGraph(); + if (!g) + continue; + + QwtPlotCurve *c = g->curve(aux); + if (c){ + QPen pen = c->pen(); + pen.setColor(d_indexed_colors[aux]); + c->setPen(pen); + aux++; + } + } + delete diff; + } +} + +void ApplicationWindow::fitLinear() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (qobject_cast(w)) + analysis(FitLinear); + else if (w->inherits("Table")){ + Table *t = (Table *)w; + QStringList lst = t->selectedYColumns(); + int cols = lst.size(); + if (!cols){ + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), tr("Please select a 'Y' column first!")); + return; + } + + MultiLayer* g = multilayerPlot(t, t->drawableColumnSelection(), Graph::LineSymbols); + if (!g) + return; + + QString legend = tr("Linear Regression of %1").arg(t->objectName()); + g->setWindowLabel(legend); + + Table *result = newTable(cols, 5, "", legend); + result->setColName(0, tr("Column")); + result->setColName(1, tr("Slope")); + result->setColName(2, tr("Intercept")); + result->setColName(3, tr("Chi^2")); + result->setColName(4, tr("R^2")); + + LinearFit *lf = new LinearFit (this, g->activeLayer()); + if (d_2_linear_fit_points) + lf->generateFunction(generateUniformFitPoints, 2); + lf->setOutputPrecision(fit_output_precision); + + int aux = 0; + foreach (QString yCol, lst){ + if (!lf->setDataFromCurve(yCol)) + continue; + + lf->setColor(aux); + lf->fit(); + double *res = lf->results(); + result->setText(aux, 0, yCol); + result->setCell(aux, 1, res[1]); + result->setCell(aux, 2, res[0]); + result->setCell(aux, 3, lf->chiSquare()); + result->setCell(aux, 4, lf->rSquare()); + aux++; + } + for (int i = 0; i < result->numCols(); i++) + result->table()->adjustColumn(i); + result->show(); + delete lf; + } +} + +void ApplicationWindow::fitSlope() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (qobject_cast(w)) + analysis(FitSlope); + else if (w->inherits("Table")){ + Table *t = (Table *)w; + QStringList lst = t->selectedYColumns(); + int cols = lst.size(); + if (!cols){ + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), tr("Please select a 'Y' column first!")); + return; + } + + MultiLayer* g = multilayerPlot(t, t->drawableColumnSelection(), Graph::LineSymbols); + if (!g) + return; + + QString legend = tr("Linear Regression of %1").arg(t->objectName()); + g->setWindowLabel(legend); + + Table *result = newTable(cols, 4, "", legend); + result->setColName(0, tr("Column")); + result->setColName(1, tr("Slope")); + result->setColName(2, tr("Chi^2")); + result->setColName(3, tr("R^2")); + + LinearSlopeFit *lf = new LinearSlopeFit (this, g->activeLayer()); + if (d_2_linear_fit_points) + lf->generateFunction(generateUniformFitPoints, 2); + lf->setOutputPrecision(fit_output_precision); + + int aux = 0; + foreach (QString yCol, lst){ + if (!lf->setDataFromCurve(yCol)) + continue; + + lf->setColor(aux); + lf->fit(); + double *res = lf->results(); + result->setText(aux, 0, yCol); + result->setCell(aux, 1, res[0]); + result->setCell(aux, 2, lf->chiSquare()); + result->setCell(aux, 3, lf->rSquare()); + aux++; + } + for (int i = 0; i < result->numCols(); i++) + result->table()->adjustColumn(i); + result->show(); + delete lf; + } +} + +void ApplicationWindow::fitSigmoidal() +{ + analysis(FitSigmoidal); +} + +void ApplicationWindow::fitGauss() +{ + analysis(FitGauss); +} + +void ApplicationWindow::fitLorentz() + +{ + analysis(FitLorentz); +} + +void ApplicationWindow::pickPointerCursor() +{ + btnPointer->setChecked(true); +} + +void ApplicationWindow::disableTools() +{ + if (displayBar && displayBar->isVisible()) + displayBar->hide(); + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")){ + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers) + g->disableTools(); + } + } +} + +void ApplicationWindow::pickDataTool( QAction* action ) +{ + if (!action) + return; + + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + QList layers = plot->layersList(); + foreach(Graph *g, layers) + g->disableTools(); + + if (action == btnCursor) + showCursor(); + else if (action == btnSelect) + showRangeSelectors(); + else if (action == btnPicker) + showScreenReader(); + else if (action == btnMovePoints) + movePoints(); + else if (action == actionDragCurve) + movePoints(true); + else if (action == btnRemovePoints) + removePoints(); + else if (action == actionDrawPoints) + drawPoints(); + else if (action == btnZoomIn) + zoomIn(); + else if (action == btnZoomOut) + zoomOut(); + else if (action == btnArrow) + drawArrow(); + else if (action == btnLine) + drawLine(); + else if (action == actionMagnify) + magnify(); + else if (action == actionMagnifyHor) + magnify(2); + else if (action == actionMagnifyVert) + magnify(1); +} + +void ApplicationWindow::custom2DPlotTools(MultiLayer *plot) +{ + if (!plot) + return; + + actionAddText->setChecked(false); + actionAddFormula->setChecked(false); + actionAddRectangle->setChecked(false); + actionAddEllipse->setChecked(false); + + QList layers = plot->layersList(); + foreach(Graph *g, layers){ + PlotToolInterface *active_tool = g->activeTool(); + if (active_tool){ + if (active_tool->rtti() == PlotToolInterface::Rtti_PlotTool){ + btnPicker->setChecked(true); + return; + } else if (active_tool->rtti() == PlotToolInterface::Rtti_DataPicker){ + switch(((DataPickerTool *)active_tool)->mode()){ + case DataPickerTool::Display: + btnCursor->setChecked(true); + break; + case DataPickerTool::Move: + btnMovePoints->setChecked(true); + break; + case DataPickerTool::Remove: + btnRemovePoints->setChecked(true); + break; + case DataPickerTool::MoveCurve: + actionDragCurve->setChecked(true); + break; + } + return; + } else if (active_tool->rtti() == PlotToolInterface::Rtti_DrawDataPoints){ + actionDrawPoints->setChecked(true); + return; + } else if (active_tool->rtti() == PlotToolInterface::Rtti_AddWidgetTool){ + switch(((AddWidgetTool *)active_tool)->widgetType()){ + case AddWidgetTool::Text: + actionAddText->setChecked(true); + break; + case AddWidgetTool::TexEquation: + actionAddFormula->setChecked(true); + break; + case AddWidgetTool::Rectangle: + actionAddRectangle->setChecked(true); + break; + case AddWidgetTool::Ellipse: + actionAddEllipse->setChecked(true); + break; + default: + break; + } + return; + } + } else if (g->hasPanningMagnifierEnabled()){ + QwtPlotMagnifier *magnifier = g->magnifyTool(); + if (!magnifier->isAxisEnabled(QwtPlot::xBottom) && !magnifier->isAxisEnabled(QwtPlot::xTop)) + actionMagnifyVert->setChecked(true); + else if (!magnifier->isAxisEnabled(QwtPlot::yLeft) && !magnifier->isAxisEnabled(QwtPlot::yRight)) + actionMagnifyHor->setChecked(true); + else + actionMagnify->setChecked(true); + return; + } else if (g->drawArrow()){ + btnArrow->setChecked(true); + return; + } else if (g->drawLineActive()){ + btnLine->setChecked(true); + return; + } else if (g->rangeSelectorsEnabled()){ + btnSelect->setChecked(true); + return; + } else if (g->zoomOn()){ + btnZoomIn->setChecked(true); + return; + } + } + btnPointer->setChecked(true); +} + +void ApplicationWindow::connectSurfacePlot(Graph3D *plot) +{ + connect (plot, SIGNAL(showContextMenu()), this,SLOT(showWindowContextMenu())); + connect (plot, SIGNAL(showOptionsDialog()), this,SLOT(showPlot3dDialog())); + connect (plot, SIGNAL(closedWindow(MdiSubWindow*)), this, SLOT(closeWindow(MdiSubWindow*))); + connect (plot, SIGNAL(hiddenWindow(MdiSubWindow*)), this, SLOT(hideWindow(MdiSubWindow*))); + connect (plot, SIGNAL(statusChanged(MdiSubWindow*)), this, SLOT(updateWindowStatus(MdiSubWindow*))); + connect (plot, SIGNAL(modified()), this, SIGNAL(modified())); + + plot->askOnCloseEvent(confirmClosePlot3D); +} + +void ApplicationWindow::connectMultilayerPlot(MultiLayer *g) +{ + connect (g,SIGNAL(showEnrichementDialog()),this,SLOT(showEnrichementDialog())); + connect (g,SIGNAL(showPlotDialog(int)),this,SLOT(showPlotDialog(int))); + connect (g,SIGNAL(showScaleDialog(int)), this, SLOT(showScalePageFromAxisDialog(int))); + connect (g,SIGNAL(showAxisDialog(int)), this, SLOT(showAxisPageFromAxisDialog(int))); + connect (g,SIGNAL(showCurveContextMenu(QwtPlotItem *)), this, SLOT(showCurveContextMenu(QwtPlotItem *))); + connect (g,SIGNAL(showContextMenu()),this,SLOT(showWindowContextMenu())); + connect (g,SIGNAL(showCurvesDialog()),this,SLOT(showCurvesDialog())); + connect (g,SIGNAL(drawLineEnded(bool)), btnPointer, SLOT(setOn(bool))); + connect (g, SIGNAL(showAxisTitleDialog()), this, SLOT(showAxisTitleDialog())); + + connect (g,SIGNAL(showMarkerPopupMenu()),this,SLOT(showMarkerPopupMenu())); + connect (g,SIGNAL(closedWindow(MdiSubWindow*)),this, SLOT(closeWindow(MdiSubWindow*))); + connect (g,SIGNAL(hiddenWindow(MdiSubWindow*)),this, SLOT(hideWindow(MdiSubWindow*))); + connect (g,SIGNAL(statusChanged(MdiSubWindow*)),this, SLOT(updateWindowStatus(MdiSubWindow*))); + connect (g,SIGNAL(cursorInfo(const QString&)),info,SLOT(setText(const QString&))); + connect (g,SIGNAL(viewTitleDialog()),this,SLOT(showTitleDialog())); + connect (g,SIGNAL(modifiedWindow(MdiSubWindow*)),this,SLOT(modifiedProject(MdiSubWindow*))); + connect (g,SIGNAL(modifiedPlot()), this, SLOT(modifiedProject())); + connect (g,SIGNAL(showLineDialog()),this, SLOT(showLineDialog())); + connect (g,SIGNAL(pasteMarker()),this,SLOT(pasteSelection())); + connect (g,SIGNAL(showGraphContextMenu()),this,SLOT(showGraphContextMenu())); + connect (g,SIGNAL(setPointerCursor()),this, SLOT(pickPointerCursor())); + connect (g,SIGNAL(currentFontChanged(const QFont&)), this, SLOT(setFormatBarFont(const QFont&))); + connect (g,SIGNAL(enableTextEditor(Graph *)), this, SLOT(enableTextEditor(Graph *))); + + g->askOnCloseEvent(confirmClosePlot2D); +} + +void ApplicationWindow::connectTable(Table* w) +{ + connect (w->table(), SIGNAL(selectionChanged()), this, SLOT(customColumnActions())); + connect (w,SIGNAL(statusChanged(MdiSubWindow*)),this, SLOT(updateWindowStatus(MdiSubWindow*))); + connect (w,SIGNAL(hiddenWindow(MdiSubWindow*)),this, SLOT(hideWindow(MdiSubWindow*))); + connect (w,SIGNAL(closedWindow(MdiSubWindow*)),this, SLOT(closeWindow(MdiSubWindow*))); + connect (w,SIGNAL(removedCol(const QString&)),this,SLOT(removeCurves(const QString&))); + connect (w,SIGNAL(modifiedData(Table *, const QString&)), + this, SLOT(updateCurves(Table *, const QString&))); + connect (w,SIGNAL(resizedWindow(MdiSubWindow*)),this,SLOT(modifiedProject(MdiSubWindow*))); + connect (w,SIGNAL(modifiedWindow(MdiSubWindow*)),this,SLOT(modifiedProject(MdiSubWindow*))); + connect (w,SIGNAL(optionsDialog()),this,SLOT(showColumnOptionsDialog())); + connect (w,SIGNAL(colValuesDialog()),this,SLOT(showColumnValuesDialog())); + connect (w,SIGNAL(showContextMenu(bool)),this,SLOT(showTableContextMenu(bool))); + connect (w,SIGNAL(changedColHeader(const QString&,const QString&)),this,SLOT(updateColNames(const QString&,const QString&))); + + w->askOnCloseEvent(confirmCloseTable); +} + +void ApplicationWindow::setAppColors(const QColor& wc, const QColor& pc, const QColor& tpc, bool force) +{ + if (force || workspaceColor != wc){ + workspaceColor = wc; + d_workspace->setBackground(wc); + } + + if (!force && panelsColor == pc && panelsTextColor == tpc) + return; + + panelsColor = pc; + panelsTextColor = tpc; + + QPalette palette; + palette.setColor(QPalette::Base, QColor(panelsColor)); + qApp->setPalette(palette); + + palette.setColor(QPalette::Text, QColor(panelsTextColor)); + palette.setColor(QPalette::WindowText, QColor(panelsTextColor)); + + lv->setPalette(palette); + results->setPalette(palette); + folders->setPalette(palette); +} + +void ApplicationWindow::setPlot3DOptions() +{ + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("Graph3D")){ + Graph3D *g = (Graph3D*)w; + g->setOrthogonal(d_3D_orthogonal); + g->setAutoscale(d_3D_autoscale); + g->setAntialiasing(d_3D_smooth_mesh); + } + } +} + +void ApplicationWindow::createActions() +{ + actionCustomActionDialog = new QAction(tr("Add &Custom Script Action..."), this); + connect(actionCustomActionDialog, SIGNAL(activated()), this, SLOT(showCustomActionDialog())); + + actionNewProject = new QAction(QIcon(":/new.png"), tr("New &Project"), this); + actionNewProject->setShortcut( tr("Ctrl+N") ); + connect(actionNewProject, SIGNAL(activated()), this, SLOT(newProject())); + + actionAppendProject = new QAction(QIcon(":/append_file.png"), tr("App&end Project..."), this); + connect(actionAppendProject, SIGNAL(activated()), this, SLOT(appendProject())); + + actionNewFolder = new QAction(QIcon(":/newfolder.png"), tr("New F&older"), this); + actionNewProject->setShortcut(Qt::Key_F7); + connect(actionNewFolder, SIGNAL(activated()), this, SLOT(addFolder())); + + actionNewGraph = new QAction(QIcon(":/new_graph.png"), tr("New &Graph"), this); + actionNewGraph->setShortcut( tr("Ctrl+G") ); + connect(actionNewGraph, SIGNAL(activated()), this, SLOT(newGraph())); + + actionNewNote = new QAction(QIcon(":/new_note.png"), tr("New &Note"), this); + connect(actionNewNote, SIGNAL(activated()), this, SLOT(newNote())); + + actionNewTable = new QAction(QIcon(":/table.png"), tr("New &Table"), this); + actionNewTable->setShortcut( tr("Ctrl+T") ); + connect(actionNewTable, SIGNAL(activated()), this, SLOT(newTable())); + + actionNewMatrix = new QAction(QIcon(":/new_matrix.png"), tr("New &Matrix"), this); + actionNewMatrix->setShortcut( tr("Ctrl+M") ); + connect(actionNewMatrix, SIGNAL(activated()), this, SLOT(newMatrix())); + + actionNewFunctionPlot = new QAction(QIcon(":/newF.png"), tr("New &Function Plot"), this); + actionNewFunctionPlot->setShortcut( tr("Ctrl+F") ); + connect(actionNewFunctionPlot, SIGNAL(activated()), this, SLOT(functionDialog())); + + actionNewSurfacePlot = new QAction(QIcon(":/newFxy.png"), tr("New 3D &Surface Plot"), this); + actionNewSurfacePlot->setShortcut( tr("Ctrl+ALT+Z") ); + connect(actionNewSurfacePlot, SIGNAL(activated()), this, SLOT(newSurfacePlot())); + + actionOpen = new QAction(QIcon(":/fileopen.png"), tr("&Open..."), this); + actionOpen->setShortcut( tr("Ctrl+O") ); + connect(actionOpen, SIGNAL(activated()), this, SLOT(open())); + +#ifdef XLS_IMPORT + actionOpenExcel = new QAction(QIcon(":/open_excel.png"), tr("Open Exce&l ..."), this); + actionOpenExcel->setShortcut( tr("Ctrl+Shift+E") ); + connect(actionOpenExcel, SIGNAL(activated()), this, SLOT(importExcel())); +#endif + +#ifdef ODS_IMPORT + actionOpenOds = new QAction(QIcon(":/ods_spreadsheet.png"), tr("Open ODF Spreads&heet..."), this); + actionOpenOds->setShortcut( tr("Ctrl+Alt+S") ); + connect(actionOpenOds, SIGNAL(activated()), this, SLOT(importOdfSpreadsheet())); +#endif + + actionLoadImage = new QAction(tr("Open Image &File..."), this); + actionLoadImage->setShortcut( tr("Ctrl+I") ); + connect(actionLoadImage, SIGNAL(activated()), this, SLOT(loadImage())); + + actionImportImage = new QAction(QPixmap(":/monalisa.png"), tr("Import I&mage..."), this); + connect(actionImportImage, SIGNAL(activated()), this, SLOT(importImage())); + + actionSaveProject = new QAction(QIcon(":/filesave.png"), tr("&Save Project"), this); + + actionSaveProject->setShortcut( tr("Ctrl+S") ); + connect(actionSaveProject, SIGNAL(activated()), this, SLOT(saveProject())); + + actionSaveProjectAs = new QAction(QIcon(":/filesaveas.png"), tr("Save Project &As..."), this); + actionSaveProjectAs->setShortcut( tr("Ctrl+Shift+S") ); + connect(actionSaveProjectAs, SIGNAL(activated()), this, SLOT(saveProjectAs())); + + actionOpenTemplate = new QAction(QIcon(":/open_template.png"),tr("Open Temp&late..."), this); + connect(actionOpenTemplate, SIGNAL(activated()), this, SLOT(openTemplate())); + + actionSaveTemplate = new QAction(QIcon(":/save_template.png"), tr("Save As &Template..."), this); + connect(actionSaveTemplate, SIGNAL(activated()), this, SLOT(saveAsTemplate())); + + actionSaveNote = new QAction(QIcon(":/filesaveas.png"), tr("Save Note As..."), this); + connect(actionSaveNote, SIGNAL(activated()), this, SLOT(saveNoteAs())); + + actionLoad = new QAction(QIcon(":/import.png"), tr("&Import ASCII..."), this); + connect(actionLoad, SIGNAL(activated()), this, SLOT(importASCII())); + + actionImportSound = new QAction(tr("&Sound (WAV)..."), this); + connect(actionImportSound, SIGNAL(activated()), this, SLOT(importWaveFile())); + + actionUndo = new QAction(QIcon(":/undo.png"), tr("&Undo"), this); + actionUndo->setShortcut( tr("Ctrl+Z") ); + connect(actionUndo, SIGNAL(activated()), this, SLOT(undo())); + + actionRedo = new QAction(QIcon(":/redo.png"), tr("&Redo"), this); + actionRedo->setShortcut(QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_Z)); + connect(actionRedo, SIGNAL(activated()), this, SLOT(redo())); + + actionCopyWindow = new QAction(QIcon(":/duplicate.png"), tr("&Duplicate"), this); + actionCopyWindow->setShortcut(tr("Ctrl+Alt+D")); + connect(actionCopyWindow, SIGNAL(activated()), this, SLOT(clone())); + + actionCutSelection = new QAction(QIcon(":/cut.png"), tr("Cu&t Selection"), this); + actionCutSelection->setShortcut( tr("Ctrl+X") ); + connect(actionCutSelection, SIGNAL(activated()), this, SLOT(cutSelection())); + + actionCopySelection = new QAction(QIcon(":/copy.png"), tr("&Copy Selection"), this); + actionCopySelection->setShortcut( tr("Ctrl+C") ); + connect(actionCopySelection, SIGNAL(activated()), this, SLOT(copySelection())); + + actionPasteSelection = new QAction(QIcon(":/paste.png"), tr("&Paste Selection"), this); + actionPasteSelection->setShortcut( tr("Ctrl+V") ); + connect(actionPasteSelection, SIGNAL(activated()), this, SLOT(pasteSelection())); + + actionClearSelection = new QAction(QIcon(":/erase.png"), tr("&Delete Selection"), this); + actionClearSelection->setShortcut( tr("Del","delete key") ); + connect(actionClearSelection, SIGNAL(activated()), this, SLOT(clearSelection())); + + actionShowExplorer = explorerWindow->toggleViewAction(); + actionShowExplorer->setIcon(QIcon(":/folder.png")); + actionShowExplorer->setShortcut( tr("Ctrl+E") ); + + actionFindWindow = new QAction(QIcon(":/find.png"), tr("&Find..."), this); + connect(actionFindWindow, SIGNAL(activated()), this, SLOT(showFindDialogue())); + + actionShowLog = logWindow->toggleViewAction(); + actionShowLog->setIcon(QIcon(":/log.png")); + + actionShowUndoStack = undoStackWindow->toggleViewAction(); + +#ifdef SCRIPTING_CONSOLE + actionShowConsole = consoleWindow->toggleViewAction(); +#endif + + actionAddLayer = new QAction(QIcon(":/newLayer.png"), tr("Add La&yer"), this); + actionAddLayer->setShortcut( tr("ALT+L") ); + connect(actionAddLayer, SIGNAL(activated()), this, SLOT(addLayer())); + + actionShowLayerDialog = new QAction(QIcon(":/arrangeLayers.png"), tr("Arran&ge Layers"), this); + actionShowLayerDialog->setShortcut( tr("Shift+A") ); + connect(actionShowLayerDialog, SIGNAL(activated()), this, SLOT(showLayerDialog())); + + actionAutomaticLayout = new QAction(QIcon(":/auto_layout.png"), tr("Automatic Layout"), this); + connect(actionAutomaticLayout, SIGNAL(activated()), this, SLOT(autoArrangeLayers())); + + actionExportGraph = new QAction(tr("&Current"), this); + actionExportGraph->setShortcut( tr("Ctrl+Alt+G") ); + connect(actionExportGraph, SIGNAL(activated()), this, SLOT(exportGraph())); + + actionExportAllGraphs = new QAction(tr("&All"), this); + actionExportAllGraphs->setShortcut( tr("Alt+X") ); + connect(actionExportAllGraphs, SIGNAL(activated()), this, SLOT(exportAllGraphs())); + + actionPresentationODF = new QAction(tr("Create Open &Document Presentation..."), this); + connect(actionPresentationODF, SIGNAL(activated()), this, SLOT(exportPresentationODF())); + + actionExportPDF = new QAction(QIcon(":/pdf.png"), tr("&Export PDF"), this); + actionExportPDF->setShortcut( tr("Ctrl+Alt+P") ); + connect(actionExportPDF, SIGNAL(activated()), this, SLOT(exportPDF())); + + actionPrint = new QAction(QIcon(":/fileprint.png"), tr("&Print..."), this); + actionPrint->setShortcut( tr("Ctrl+P") ); + connect(actionPrint, SIGNAL(activated()), this, SLOT(print())); + + actionPrintPreview = new QAction(QPixmap(":/preview.png"), tr("Print Pre&view..."), this); + connect(actionPrintPreview, SIGNAL(activated()), this, SLOT(printPreview())); + + actionPrintAllPlots = new QAction(tr("Print All Plo&ts"), this); + connect(actionPrintAllPlots, SIGNAL(activated()), this, SLOT(printAllPlots())); + + actionShowExportASCIIDialog = new QAction(tr("E&xport ASCII..."), this); + connect(actionShowExportASCIIDialog, SIGNAL(activated()), this, SLOT(showExportASCIIDialog())); + + actionCloseAllWindows = new QAction(QIcon(":/quit.png"), tr("&Quit"), this); + actionCloseAllWindows->setShortcut( tr("Ctrl+Q") ); + connect(actionCloseAllWindows, SIGNAL(activated()), qApp, SLOT(closeAllWindows())); + + actionCloseProject = new QAction(QIcon(":/delete.png"), tr("&Close"), this); +#ifdef BROWSER_PLUGIN + connect(actionCloseProject, SIGNAL(activated()), this, SLOT(closeProject())); +#else + connect(actionCloseProject, SIGNAL(activated()), this, SLOT(newProject())); +#endif + + actionClearLogInfo = new QAction(tr("Clear &Log Information"), this); + connect(actionClearLogInfo, SIGNAL(activated()), this, SLOT(clearLogInfo())); + + actionDeleteFitTables = new QAction(QIcon(":/close.png"), tr("Delete &Fit Tables"), this); + connect(actionDeleteFitTables, SIGNAL(activated()), this, SLOT(deleteFitTables())); + + actionShowPlotWizard = new QAction(QIcon(":/wizard.png"), tr("Plot &Wizard"), this); + actionShowPlotWizard->setShortcut( tr("Ctrl+Alt+W") ); + connect(actionShowPlotWizard, SIGNAL(activated()), this, SLOT(showPlotWizard())); + + actionShowConfigureDialog = new QAction(QIcon(":/configure.png"), tr("&Preferences..."), this); + connect(actionShowConfigureDialog, SIGNAL(activated()), this, SLOT(showPreferencesDialog())); + + actionShowCurvesDialog = new QAction(QIcon(":/curves.png"), tr("Add/Remove &Curve..."), this); + actionShowCurvesDialog->setShortcut( tr("ALT+C") ); + connect(actionShowCurvesDialog, SIGNAL(activated()), this, SLOT(showCurvesDialog())); + + actionAddErrorBars = new QAction(QIcon(":/errors.png"), tr("Add &Error Bars..."), this); + actionAddErrorBars->setShortcut( tr("Ctrl+B") ); + connect(actionAddErrorBars, SIGNAL(activated()), this, SLOT(addErrorBars())); + + actionAddFunctionCurve = new QAction(QIcon(":/fx.png"), tr("Add &Function..."), this); + actionAddFunctionCurve->setShortcut( tr("Ctrl+Alt+F") ); + connect(actionAddFunctionCurve, SIGNAL(activated()), this, SLOT(addFunctionCurve())); + + actionUnzoom = new QAction(QIcon(":/unzoom.png"), tr("&Rescale to Show All"), this); + actionUnzoom->setShortcut( tr("Ctrl+Shift+R") ); + connect(actionUnzoom, SIGNAL(activated()), this, SLOT(setAutoScale())); + + actionMagnify = new QAction(QIcon(":/magnifier.png"), tr("Zoom &In/Out and Drag Canvas"), this); + connect(actionMagnify, SIGNAL(activated()), this, SLOT(magnify())); + + actionMagnifyHor = new QAction(QIcon(":/magnifier_hor.png"), tr("Zoom/Drag Canvas &Horizontally"), this); + actionMagnifyVert = new QAction(QIcon(":/magnifier_vert.png"), tr("Zoom/Drag Canvas &Vertically"), this); + + actionNewLegend = new QAction(QIcon(":/legend.png"), tr("New &Legend"), this); + actionNewLegend->setShortcut( tr("Ctrl+L") ); + connect(actionNewLegend, SIGNAL(activated()), this, SLOT(newLegend())); + + actionTimeStamp = new QAction(QIcon(":/clock.png"), tr("Add Time Stamp"), this); + actionTimeStamp->setShortcut( tr("Ctrl+ALT+T") ); + connect(actionTimeStamp, SIGNAL(activated()), this, SLOT(addTimeStamp())); + + actionAddImage = new QAction(QIcon(":/monalisa.png"), tr("Add &Image"), this); + actionAddImage->setShortcut( tr("ALT+I") ); + connect(actionAddImage, SIGNAL(activated()), this, SLOT(addImage())); + + actionPlotL = new QAction(QIcon(":/lPlot.png"), tr("&Line"), this); + connect(actionPlotL, SIGNAL(activated()), this, SLOT(plotL())); + + actionPlotP = new QAction(QIcon(":/pPlot.png"), tr("&Scatter"), this); + connect(actionPlotP, SIGNAL(activated()), this, SLOT(plotP())); + + actionPlotLP = new QAction(QIcon(":/lpPlot.png"), tr("Line + S&ymbol"), this); + connect(actionPlotLP, SIGNAL(activated()), this, SLOT(plotLP())); + + actionPlotVerticalDropLines = new QAction(QIcon(":/dropLines.png"), tr("Vertical &Drop Lines"), this); + connect(actionPlotVerticalDropLines, SIGNAL(activated()), this, SLOT(plotVerticalDropLines())); + + actionPlotSpline = new QAction(QIcon(":/spline.png"), tr("&Spline"), this); + connect(actionPlotSpline, SIGNAL(activated()), this, SLOT(plotSpline())); + + actionPlotHorSteps = new QAction(QPixmap(":/hor_steps.png"), tr("&Horizontal Steps"), this); + connect(actionPlotHorSteps, SIGNAL(activated()), this, SLOT(plotHorSteps())); + + actionPlotVertSteps = new QAction(QIcon(":/vert_steps.png"), tr("&Vertical Steps"), this); + connect(actionPlotVertSteps, SIGNAL(activated()), this, SLOT(plotVertSteps())); + + actionPlotVerticalBars = new QAction(QIcon(":/vertBars.png"), tr("&Columns"), this); + connect(actionPlotVerticalBars, SIGNAL(activated()), this, SLOT(plotVerticalBars())); + + actionPlotHorizontalBars = new QAction(QIcon(":/hBars.png"), tr("&Rows"), this); + connect(actionPlotHorizontalBars, SIGNAL(activated()), this, SLOT(plotHorizontalBars())); + + actionStackBars = new QAction(QIcon(":/stack_bar.png"), tr("Stack &Bar"), this); + connect(actionStackBars, SIGNAL(activated()), this, SLOT(plotStackBar())); + + actionStackColumns = new QAction(QIcon(":/stack_column.png"), tr("Stack &Column"), this); + connect(actionStackColumns, SIGNAL(activated()), this, SLOT(plotStackColumn())); + + actionPlotArea = new QAction(QIcon(":/area.png"), tr("&Area"), this); + connect(actionPlotArea, SIGNAL(activated()), this, SLOT(plotArea())); + + actionPlotPie = new QAction(QIcon(":/pie.png"), tr("&Pie"), this); + connect(actionPlotPie, SIGNAL(activated()), this, SLOT(plotPie())); + + actionPlotVectXYAM = new QAction(QIcon(":/vectXYAM.png"), tr("Vectors XY&AM"), this); + connect(actionPlotVectXYAM, SIGNAL(activated()), this, SLOT(plotVectXYAM())); + + actionPlotVectXYXY = new QAction(QIcon(":/vectXYXY.png"), tr("&Vectors &XYXY"), this); + connect(actionPlotVectXYXY, SIGNAL(activated()), this, SLOT(plotVectXYXY())); + + actionPlotHistogram = new QAction(QIcon(":/histogram.png"), tr("&Histogram"), this); + connect(actionPlotHistogram, SIGNAL(activated()), this, SLOT(plotHistogram())); + + actionPlotStackedHistograms = new QAction(QIcon(":/stacked_hist.png"), tr("&Stacked Histogram"), this); + connect(actionPlotStackedHistograms, SIGNAL(activated()), this, SLOT(plotStackedHistograms())); + + actionStemPlot = new QAction(QIcon(":/leaf.png"), tr("Stem-and-&Leaf Plot"), this); + connect(actionStemPlot, SIGNAL(activated()), this, SLOT(newStemPlot())); + + actionPlot2VerticalLayers = new QAction(QIcon(":/panel_v2.png"), tr("&Vertical 2 Layers"), this); + connect(actionPlot2VerticalLayers, SIGNAL(activated()), this, SLOT(plot2VerticalLayers())); + + actionPlot2HorizontalLayers = new QAction(QIcon(":/panel_h2.png"), tr("&Horizontal 2 Layers"), this); + connect(actionPlot2HorizontalLayers, SIGNAL(activated()), this, SLOT(plot2HorizontalLayers())); + + actionPlot4Layers = new QAction(QIcon(":/panel_4.png"), tr("&4 Layers"), this); + connect(actionPlot4Layers, SIGNAL(activated()), this, SLOT(plot4Layers())); + + actionPlotStackedLayers = new QAction(QIcon(":/stacked.png"), tr("&Stacked Layers"), this); + connect(actionPlotStackedLayers, SIGNAL(activated()), this, SLOT(plotStackedLayers())); + + actionVertSharedAxisLayers = new QAction(QIcon(":/panel_v2.png"), tr("&Vertical 2 Layers"), this); + connect(actionVertSharedAxisLayers, SIGNAL(activated()), this, SLOT(plotVerticalSharedAxisLayers())); + + actionHorSharedAxisLayers = new QAction(QIcon(":/panel_h2.png"), tr("&Horizontal 2 Layers"), this); + connect(actionHorSharedAxisLayers, SIGNAL(activated()), this, SLOT(plotHorizontalSharedAxisLayers())); + + actionSharedAxesLayers = new QAction(QIcon(":/panel_4.png"), tr("&4 Layers"), this); + connect(actionSharedAxesLayers, SIGNAL(activated()), this, SLOT(plotSharedAxesLayers())); + + actionStackSharedAxisLayers = new QAction(QIcon(":/stacked.png"), tr("&Stacked Layers"), this); + connect(actionStackSharedAxisLayers, SIGNAL(activated()), this, SLOT(plotStackSharedAxisLayers())); + + actionCustomSharedAxisLayers = new QAction(QIcon(":/arrangeLayers.png"), tr("&Custom Layout..."), this); + connect(actionCustomSharedAxisLayers, SIGNAL(activated()), this, SLOT(plotCustomLayoutSharedAxes())); + + actionCustomLayout = new QAction(QIcon(":/arrangeLayers.png"), tr("&Custom Layout..."), this); + connect(actionCustomLayout, SIGNAL(activated()), this, SLOT(plotCustomLayout())); + + actionPlotDoubleYAxis = new QAction(QIcon(":/plot_double_y.png"), tr("D&ouble-Y"), this); + connect(actionPlotDoubleYAxis, SIGNAL(activated()), this, SLOT(plotDoubleYAxis())); + + actionAddZoomPlot = new QAction(QIcon(":/add_zoom_plot.png"), tr("&Zoom"), this); + connect(actionAddZoomPlot, SIGNAL(activated()), this, SLOT(zoomRectanglePlot())); + + actionWaterfallPlot = new QAction(QIcon(":/waterfall_plot.png"), tr("&Waterfall Plot"), this); + connect(actionWaterfallPlot, SIGNAL(activated()), this, SLOT(waterfallPlot())); + + actionExtractGraphs = new QAction(QIcon(":/extract_graphs.png"), tr("E&xtract to Graphs"), this); + connect(actionExtractGraphs, SIGNAL(activated()), this, SLOT(extractGraphs())); + + actionExtractLayers = new QAction(QIcon(":/extract_layers.png"), tr("Extract to &Layers"), this); + connect(actionExtractLayers, SIGNAL(activated()), this, SLOT(extractLayers())); + + actionAddInsetLayer = new QAction(QIcon(":/add_inset_layer.png"), tr("Add Inset Layer"), this); + connect(actionAddInsetLayer, SIGNAL(activated()), this, SLOT(addInsetLayer())); + + actionAddInsetCurveLayer = new QAction(QIcon(":/add_inset_curve_layer.png"), tr("Add Inset Layer"), this); + connect(actionAddInsetCurveLayer, SIGNAL(activated()), this, SLOT(addInsetCurveLayer())); + + actionPlot3DRibbon = new QAction(QIcon(":/ribbon.png"), tr("&Ribbon"), this); + connect(actionPlot3DRibbon, SIGNAL(activated()), this, SLOT(plot3DRibbon())); + + actionPlot3DBars = new QAction(QIcon(":/bars.png"), tr("&Bars"), this); + connect(actionPlot3DBars, SIGNAL(activated()), this, SLOT(plot3DBars())); + + actionPlot3DScatter = new QAction(QIcon(":/scatter.png"), tr("&Scatter"), this); + connect(actionPlot3DScatter, SIGNAL(activated()), this, SLOT(plot3DScatter())); + + actionPlot3DTrajectory = new QAction(QIcon(":/trajectory.png"), tr("&Trajectory"), this); + connect(actionPlot3DTrajectory, SIGNAL(activated()), this, SLOT(plot3DTrajectory())); + + actionShowColStatistics = new QAction(QIcon(":/col_stat.png"), tr("Statistics on &Columns"), this); + connect(actionShowColStatistics, SIGNAL(activated()), this, SLOT(showColStatistics())); + + actionShowRowStatistics = new QAction(QIcon(":/stat_rows.png"), tr("Statistics on &Rows"), this); + connect(actionShowRowStatistics, SIGNAL(activated()), this, SLOT(showRowStatistics())); + + actionIntegrate = new QAction(tr("&Integrate"), this); + connect(actionIntegrate, SIGNAL(activated()), this, SLOT(integrate())); + + actionShowIntDialog = new QAction(tr("Integr&ate Function..."), this); + connect(actionShowIntDialog, SIGNAL(activated()), this, SLOT(showIntegrationDialog())); + + actionInterpolate = new QAction(tr("Inte&rpolate ..."), this); + connect(actionInterpolate, SIGNAL(activated()), this, SLOT(showInterpolationDialog())); + + actionLowPassFilter = new QAction(tr("&Low Pass..."), this); + connect(actionLowPassFilter, SIGNAL(activated()), this, SLOT(lowPassFilterDialog())); + + actionHighPassFilter = new QAction(tr("&High Pass..."), this); + connect(actionHighPassFilter, SIGNAL(activated()), this, SLOT(highPassFilterDialog())); + + actionBandPassFilter = new QAction(tr("&Band Pass..."), this); + connect(actionBandPassFilter, SIGNAL(activated()), this, SLOT(bandPassFilterDialog())); + + actionBandBlockFilter = new QAction(tr("&Band Block..."), this); + connect(actionBandBlockFilter, SIGNAL(activated()), this, SLOT(bandBlockFilterDialog())); + + actionFFT = new QAction(tr("&FFT..."), this); + connect(actionFFT, SIGNAL(activated()), this, SLOT(showFFTDialog())); + + actionSmoothSavGol = new QAction(tr("&Savitzky-Golay..."), this); + connect(actionSmoothSavGol, SIGNAL(activated()), this, SLOT(showSmoothSavGolDialog())); + + actionSmoothFFT = new QAction(tr("&FFT Filter..."), this); + connect(actionSmoothFFT, SIGNAL(activated()), this, SLOT(showSmoothFFTDialog())); + + actionSmoothAverage = new QAction(tr("Moving Window &Average..."), this); + connect(actionSmoothAverage, SIGNAL(activated()), this, SLOT(showSmoothAverageDialog())); + + actionSmoothLowess = new QAction(tr("&Lowess..."), this); + connect(actionSmoothLowess, SIGNAL(activated()), this, SLOT(showSmoothLowessDialog())); + + actionDifferentiate = new QAction(tr("&Differentiate"), this); + connect(actionDifferentiate, SIGNAL(activated()), this, SLOT(differentiate())); + + actionFitSlope = new QAction(tr("Fit Slop&e"), this); + connect(actionFitSlope, SIGNAL(activated()), this, SLOT(fitSlope())); + + actionFitLinear = new QAction(tr("Fit &Linear"), this); + connect(actionFitLinear, SIGNAL(activated()), this, SLOT(fitLinear())); + + actionShowFitPolynomDialog = new QAction(tr("Fit &Polynomial ..."), this); + connect(actionShowFitPolynomDialog, SIGNAL(activated()), this, SLOT(showFitPolynomDialog())); + + actionShowExpDecayDialog = new QAction(tr("&First Order ..."), this); + connect(actionShowExpDecayDialog, SIGNAL(activated()), this, SLOT(showExpDecayDialog())); + + actionShowTwoExpDecayDialog = new QAction(tr("&Second Order ..."), this); + connect(actionShowTwoExpDecayDialog, SIGNAL(activated()), this, SLOT(showTwoExpDecayDialog())); + + actionShowExpDecay3Dialog = new QAction(tr("&Third Order ..."), this); + connect(actionShowExpDecay3Dialog, SIGNAL(activated()), this, SLOT(showExpDecay3Dialog())); + + actionFitExpGrowth = new QAction(tr("Fit Exponential Gro&wth ..."), this); + connect(actionFitExpGrowth, SIGNAL(activated()), this, SLOT(showExpGrowthDialog())); + + actionFitSigmoidal = new QAction(tr("Fit &Boltzmann (Sigmoidal)"), this); + connect(actionFitSigmoidal, SIGNAL(activated()), this, SLOT(fitSigmoidal())); + + actionFitGauss = new QAction(tr("Fit &Gaussian"), this); + connect(actionFitGauss, SIGNAL(activated()), this, SLOT(fitGauss())); + + actionFitLorentz = new QAction(tr("Fit Lorent&zian"), this); + connect(actionFitLorentz, SIGNAL(activated()), this, SLOT(fitLorentz())); + + actionShowFitDialog = new QAction(tr("Fit &Wizard..."), this); + actionShowFitDialog->setShortcut( tr("Ctrl+Y") ); + connect(actionShowFitDialog, SIGNAL(activated()), this, SLOT(showFitDialog())); + + actionShowPlotDialog = new QAction(tr("&Plot ..."), this); + connect(actionShowPlotDialog, SIGNAL(activated()), this, SLOT(showGeneralPlotDialog())); + + actionShowScaleDialog = new QAction(tr("&Scales..."), this); + connect(actionShowScaleDialog, SIGNAL(activated()), this, SLOT(showScaleDialog())); + + actionShowAxisDialog = new QAction(tr("&Axes..."), this); + connect(actionShowAxisDialog, SIGNAL(activated()), this, SLOT(showAxisDialog())); + + actionShowGridDialog = new QAction(tr("&Grid ..."), this); + connect(actionShowGridDialog, SIGNAL(activated()), this, SLOT(showGridDialog())); + + actionShowTitleDialog = new QAction(tr("&Title ..."), this); + connect(actionShowTitleDialog, SIGNAL(activated()), this, SLOT(showTitleDialog())); + + actionShowColumnOptionsDialog = new QAction(tr("Column &Options ..."), this); + actionShowColumnOptionsDialog->setShortcut(tr("Ctrl+Alt+O")); + connect(actionShowColumnOptionsDialog, SIGNAL(activated()), this, SLOT(showColumnOptionsDialog())); + + actionShowColumnValuesDialog = new QAction(QIcon(":/formula.png"), tr("Set Column &Values ..."), this); + connect(actionShowColumnValuesDialog, SIGNAL(activated()), this, SLOT(showColumnValuesDialog())); + actionShowColumnValuesDialog->setShortcut(tr("Alt+Q")); + + actionExtractTableData = new QAction(tr("&Extract Data..."), this); + connect(actionExtractTableData, SIGNAL(activated()), this, SLOT(showExtractDataDialog())); + + actionTableRecalculate = new QAction(tr("Recalculate"), this); + actionTableRecalculate->setShortcut(tr("Ctrl+Return")); + connect(actionTableRecalculate, SIGNAL(activated()), this, SLOT(recalculateTable())); + + actionHideSelectedColumns = new QAction(tr("&Hide Selected"), this); + connect(actionHideSelectedColumns, SIGNAL(activated()), this, SLOT(hideSelectedColumns())); + + actionShowAllColumns = new QAction(tr("Sho&w All Columns"), this); + connect(actionShowAllColumns, SIGNAL(activated()), this, SLOT(showAllColumns())); + + actionSwapColumns = new QAction(QIcon(":/swap_columns.png"), tr("&Swap columns"), this); + connect(actionSwapColumns, SIGNAL(activated()), this, SLOT(swapColumns())); + + actionMoveColRight = new QAction(QIcon(":/move_col_right.png"), tr("Move &Right"), this); + connect(actionMoveColRight, SIGNAL(activated()), this, SLOT(moveColumnRight())); + + actionMoveColLeft = new QAction(QIcon(":/move_col_left.png"), tr("Move &Left"), this); + connect(actionMoveColLeft, SIGNAL(activated()), this, SLOT(moveColumnLeft())); + + actionMoveColFirst = new QAction(QIcon(":/move_col_first.png"), tr("Move to F&irst"), this); + connect(actionMoveColFirst, SIGNAL(activated()), this, SLOT(moveColumnFirst())); + + actionMoveColLast = new QAction(QIcon(":/move_col_last.png"), tr("Move to Las&t"), this); + connect(actionMoveColLast, SIGNAL(activated()), this, SLOT(moveColumnLast())); + + actionAdjustColumnWidth = new QAction(QIcon(":/adjust_col_width.png"), tr("Ad&just Column Width"), this); + connect(actionAdjustColumnWidth, SIGNAL(activated()), this, SLOT(adjustColumnWidth())); + + actionShowColsDialog = new QAction(tr("&Columns..."), this); + connect(actionShowColsDialog, SIGNAL(activated()), this, SLOT(showColsDialog())); + + actionShowRowsDialog = new QAction(tr("&Rows..."), this); + connect(actionShowRowsDialog, SIGNAL(activated()), this, SLOT(showRowsDialog())); + + actionDeleteRows = new QAction(tr("&Delete Rows Interval..."), this); + connect(actionDeleteRows, SIGNAL(activated()), this, SLOT(showDeleteRowsDialog())); + + actionMoveRowUp = new QAction(QIcon(":/move_row_up.png"), tr("&Upward"), this); + connect(actionMoveRowUp, SIGNAL(activated()), this, SLOT(moveTableRowUp())); + + actionMoveRowDown = new QAction(QIcon(":/move_row_down.png"), tr("&Downward"), this); + connect(actionMoveRowDown, SIGNAL(activated()), this, SLOT(moveTableRowDown())); + + actionAbout = new QAction(tr("&About QtiPlot"), this); + actionAbout->setShortcut( tr("F1") ); + connect(actionAbout, SIGNAL(activated()), this, SLOT(about())); + + actionShowHelp = new QAction(tr("&Help"), this); + actionShowHelp->setShortcut( tr("Ctrl+H") ); + connect(actionShowHelp, SIGNAL(activated()), this, SLOT(showHelp())); + + actionChooseHelpFolder = new QAction(tr("&Choose Help Folder..."), this); + connect(actionChooseHelpFolder, SIGNAL(activated()), this, SLOT(chooseHelpFolder())); + + actionRename = new QAction(tr("&Rename Window"), this); + connect(actionRename, SIGNAL(activated()), this, SLOT(rename())); + + actionCloseWindow = new QAction(QIcon(":/close.png"), tr("Close &Window"), this); + actionCloseWindow->setShortcut( tr("Ctrl+W") ); + connect(actionCloseWindow, SIGNAL(activated()), this, SLOT(closeActiveWindow())); + + actionAddColToTable = new QAction(QIcon(":/addCol.png"), tr("Add Column"), this); + connect(actionAddColToTable, SIGNAL(activated()), this, SLOT(addColToTable())); + + actionGoToRow = new QAction(tr("&Go to Row..."), this); + actionGoToRow->setShortcut(tr("Ctrl+Alt+G")); + connect(actionGoToRow, SIGNAL(activated()), this, SLOT(goToRow())); + + actionGoToColumn = new QAction(tr("Go to Colum&n..."), this); + actionGoToColumn->setShortcut(tr("Ctrl+Alt+C")); + connect(actionGoToColumn, SIGNAL(activated()), this, SLOT(goToColumn())); + + actionClearTable = new QAction(QPixmap(":/erase.png"), tr("Clear"), this); + connect(actionClearTable, SIGNAL(activated()), this, SLOT(clearTable())); + + actionDeleteLayer = new QAction(QIcon(":/delete.png"), tr("&Remove Layer"), this); + actionDeleteLayer->setShortcut( tr("Alt+R") ); + connect(actionDeleteLayer, SIGNAL(activated()), this, SLOT(deleteLayer())); + + actionResizeActiveWindow = new QAction(QIcon(":/resize.png"), tr("Window &Geometry..."), this); + connect(actionResizeActiveWindow, SIGNAL(activated()), this, SLOT(resizeActiveWindow())); + + actionHideActiveWindow = new QAction(tr("&Hide Window"), this); + actionHideActiveWindow->setShortcut(tr("Ctrl+Alt+H")); + connect(actionHideActiveWindow, SIGNAL(activated()), this, SLOT(hideActiveWindow())); + + actionShowMoreWindows = new QAction(tr("More windows..."), this); + connect(actionShowMoreWindows, SIGNAL(activated()), this, SLOT(showMoreWindows())); + + actionPixelLineProfile = new QAction(QIcon(":/pixelProfile.png"), tr("&View Pixel Line Profile"), this); + connect(actionPixelLineProfile, SIGNAL(activated()), this, SLOT(pixelLineProfile())); + + actionIntensityTable = new QAction(tr("&Intensity Table"), this); + connect(actionIntensityTable, SIGNAL(activated()), this, SLOT(intensityTable())); + + actionShowLineDialog = new QAction(tr("&Properties"), this); + connect(actionShowLineDialog, SIGNAL(activated()), this, SLOT(showLineDialog())); + + actionShowTextDialog = new QAction(tr("&Properties"), this); + connect(actionShowTextDialog, SIGNAL(activated()), this, SLOT(showEnrichementDialog())); + + actionActivateWindow = new QAction(tr("&Activate Window"), this); + connect(actionActivateWindow, SIGNAL(activated()), this, SLOT(activateWindow())); + + actionMinimizeWindow = new QAction(tr("Mi&nimize Window"), this); + connect(actionMinimizeWindow, SIGNAL(activated()), this, SLOT(minimizeWindow())); + + actionMaximizeWindow = new QAction(tr("Ma&ximize Window"), this); + connect(actionMaximizeWindow, SIGNAL(activated()), this, SLOT(maximizeWindow())); + + actionHideWindow = new QAction(tr("&Hide Window"), this); + actionHideWindow->setShortcut(tr("Ctrl+Alt+H")); + connect(actionHideWindow, SIGNAL(activated()), this, SLOT(hideWindow())); + + actionResizeWindow = new QAction(QIcon(":/resize.png"), tr("Re&size Window..."), this); + connect(actionResizeWindow, SIGNAL(activated()), this, SLOT(resizeWindow())); + + actionEditSurfacePlot = new QAction(tr("&Surface..."), this); + connect(actionEditSurfacePlot, SIGNAL(activated()), this, SLOT(editSurfacePlot())); + + actionAdd3DData = new QAction(tr("&Data Set..."), this); + connect(actionAdd3DData, SIGNAL(activated()), this, SLOT(add3DData())); + + actionSetMatrixProperties = new QAction(tr("Set &Properties..."), this); + connect(actionSetMatrixProperties, SIGNAL(activated()), this, SLOT(showMatrixDialog())); + + actionSetMatrixDimensions = new QAction(tr("Set &Dimensions..."), this); + connect(actionSetMatrixDimensions, SIGNAL(activated()), this, SLOT(showMatrixSizeDialog())); + actionSetMatrixDimensions->setShortcut(tr("Ctrl+D")); + + actionSetMatrixValues = new QAction(QIcon(":/formula.png"), tr("Set &Values..."), this); + connect(actionSetMatrixValues, SIGNAL(activated()), this, SLOT(showMatrixValuesDialog())); + actionSetMatrixValues->setShortcut(tr("Alt+Q")); + + actionImagePlot = new QAction(QIcon(":/image_plot.png"), tr("&Image Plot"), this); + connect(actionImagePlot, SIGNAL(activated()), this, SLOT(plotImage())); + + actionImageProfilesPlot = new QAction(QIcon(":/image_profiles.png"), tr("&Image Profiles"), this); + connect(actionImageProfilesPlot, SIGNAL(activated()), this, SLOT(plotImageProfiles())); + + actionTransposeMatrix = new QAction(tr("&Transpose"), this); + connect(actionTransposeMatrix, SIGNAL(activated()), this, SLOT(transposeMatrix())); + + actionFlipMatrixVertically = new QAction(QIcon(":/flip_vertical.png"), tr("Flip &V"), this); + actionFlipMatrixVertically->setShortcut(tr("Ctrl+Shift+V")); + connect(actionFlipMatrixVertically, SIGNAL(activated()), this, SLOT(flipMatrixVertically())); + + actionFlipMatrixHorizontally = new QAction(QIcon(":/flip_horizontal.png"), tr("Flip &H"), this); + actionFlipMatrixHorizontally->setShortcut(tr("Ctrl+Shift+H")); + connect(actionFlipMatrixHorizontally, SIGNAL(activated()), this, SLOT(flipMatrixHorizontally())); + + actionRotateMatrix = new QAction(QIcon(":/rotate_clockwise.png"), tr("R&otate 90"), this); + actionRotateMatrix->setShortcut(tr("Ctrl+Shift+R")); + connect(actionRotateMatrix, SIGNAL(activated()), this, SLOT(rotateMatrix90())); + + actionRotateMatrixMinus = new QAction(QIcon(":/rotate_counterclockwise.png"), tr("Rotate &-90"), this); + actionRotateMatrixMinus->setShortcut(tr("Ctrl+Alt+R")); + connect(actionRotateMatrixMinus, SIGNAL(activated()), this, SLOT(rotateMatrixMinus90())); + + actionInvertMatrix = new QAction(tr("&Invert"), this); + connect(actionInvertMatrix, SIGNAL(activated()), this, SLOT(invertMatrix())); + + actionMatrixDeterminant = new QAction(tr("&Determinant"), this); + connect(actionMatrixDeterminant, SIGNAL(activated()), this, SLOT(matrixDeterminant())); + + actionViewMatrixImage = new QAction(tr("&Image mode"), this); + actionViewMatrixImage->setShortcut(tr("Ctrl+Shift+I")); + connect(actionViewMatrixImage, SIGNAL(activated()), this, SLOT(viewMatrixImage())); + actionViewMatrixImage->setCheckable(true); + + actionViewMatrix = new QAction(tr("&Data mode"), this); + actionViewMatrix->setShortcut(tr("Ctrl+Shift+D")); + connect(actionViewMatrix, SIGNAL(activated()), this, SLOT(viewMatrixTable())); + actionViewMatrix->setCheckable(true); + + actionMatrixXY = new QAction(tr("Show &X/Y"), this); + actionMatrixXY->setShortcut(tr("Ctrl+Shift+X")); + connect(actionMatrixXY, SIGNAL(activated()), this, SLOT(viewMatrixXY())); + actionMatrixXY->setCheckable(true); + + actionMatrixColumnRow = new QAction(tr("Show &Column/Row"), this); + actionMatrixColumnRow->setShortcut(tr("Ctrl+Shift+C")); + connect(actionMatrixColumnRow, SIGNAL(activated()), this, SLOT(viewMatrixColumnRow())); + actionMatrixColumnRow->setCheckable(true); + + actionMatrixGrayScale = new QAction(tr("&Gray Scale"), this); + connect(actionMatrixGrayScale, SIGNAL(activated()), this, SLOT(setMatrixGrayScale())); + actionMatrixGrayScale->setCheckable(true); + + actionMatrixDefaultScale = new QAction(tr("&Default"), this); + connect(actionMatrixDefaultScale, SIGNAL(activated()), this, SLOT(setMatrixDefaultScale())); + actionMatrixDefaultScale->setCheckable(true); + + actionMatrixRainbowScale = new QAction(tr("&Rainbow"), this); + connect(actionMatrixRainbowScale, SIGNAL(activated()), this, SLOT(setMatrixRainbowScale())); + actionMatrixRainbowScale->setCheckable(true); + + actionMatrixCustomScale = new QAction(tr("&Custom"), this); + connect(actionMatrixCustomScale, SIGNAL(activated()), this, SLOT(showColorMapDialog())); + actionMatrixCustomScale->setCheckable(true); + + actionExportMatrix = new QAction(tr("&Export Image ..."), this); + connect(actionExportMatrix, SIGNAL(activated()), this, SLOT(exportMatrix())); + + actionConvertMatrixDirect = new QAction(tr("&Direct"), this); + connect(actionConvertMatrixDirect, SIGNAL(activated()), this, SLOT(convertMatrixToTableDirect())); + + actionConvertMatrixXYZ = new QAction(tr("&XYZ Columns"), this); + connect(actionConvertMatrixXYZ, SIGNAL(activated()), this, SLOT(convertMatrixToTableXYZ())); + + actionConvertMatrixYXZ = new QAction(tr("&YXZ Columns"), this); + connect(actionConvertMatrixYXZ, SIGNAL(activated()), this, SLOT(convertMatrixToTableYXZ())); + + actionMatrixFFTDirect = new QAction(tr("&Forward FFT"), this); + connect(actionMatrixFFTDirect, SIGNAL(activated()), this, SLOT(matrixDirectFFT())); + + actionMatrixFFTInverse = new QAction(tr("&Inverse FFT"), this); + connect(actionMatrixFFTInverse, SIGNAL(activated()), this, SLOT(matrixInverseFFT())); + + actionConvertTableDirect= new QAction(tr("&Direct"), this); + connect(actionConvertTableDirect, SIGNAL(activated()), this, SLOT(convertTableToMatrix())); + + actionConvertTableBinning = new QAction(tr("2D &Binning"), this); + connect(actionConvertTableBinning, SIGNAL(activated()), this, SLOT(showBinMatrixDialog())); + + actionConvertTableRegularXYZ = new QAction(tr("&Regular XYZ"), this); + connect(actionConvertTableRegularXYZ, SIGNAL(activated()), this, SLOT(convertTableToMatrixRegularXYZ())); + + actionPlot3DWireFrame = new QAction(QIcon(":/lineMesh.png"), tr("3D &Wire Frame"), this); + connect(actionPlot3DWireFrame, SIGNAL(activated()), this, SLOT(plot3DWireframe())); + + actionPlot3DHiddenLine = new QAction(QIcon(":/grid_only.png"), tr("3D &Hidden Line"), this); + connect(actionPlot3DHiddenLine, SIGNAL(activated()), this, SLOT(plot3DHiddenLine())); + + actionPlot3DPolygons = new QAction(QIcon(":/no_grid.png"), tr("3D &Polygons"), this); + connect(actionPlot3DPolygons, SIGNAL(activated()), this, SLOT(plot3DPolygons())); + + actionPlot3DWireSurface = new QAction(QIcon(":/grid_poly.png"), tr("3D Wire &Surface"), this); + connect(actionPlot3DWireSurface, SIGNAL(activated()), this, SLOT(plot3DWireSurface())); + + actionColorMap = new QAction(QIcon(":/color_map.png"), tr("Contour - &Color Fill"), this); + connect(actionColorMap, SIGNAL(activated()), this, SLOT(plotColorMap())); + + actionContourMap = new QAction(QIcon(":/contour_map.png"), tr("Contour &Lines"), this); + connect(actionContourMap, SIGNAL(activated()), this, SLOT(plotContour())); + + actionGrayMap = new QAction(QIcon(":/gray_map.png"), tr("&Gray Scale Map"), this); + connect(actionGrayMap, SIGNAL(activated()), this, SLOT(plotGrayScale())); + + actionSortTable = new QAction(QPixmap(":/sort.png"), tr("Sort Ta&ble"), this); + connect(actionSortTable, SIGNAL(activated()), this, SLOT(sortActiveTable())); + + actionSortSelection = new QAction(tr("Sort Columns"), this); + connect(actionSortSelection, SIGNAL(activated()), this, SLOT(sortSelection())); + + actionNormalizeTable = new QAction(tr("&Table"), this); + connect(actionNormalizeTable, SIGNAL(activated()), this, SLOT(normalizeActiveTable())); + + actionNormalizeSelection = new QAction(tr("&Columns"), this); + connect(actionNormalizeSelection, SIGNAL(activated()), this, SLOT(normalizeSelection())); + + actionCorrelate = new QAction(tr("Co&rrelate"), this); + connect(actionCorrelate, SIGNAL(activated()), this, SLOT(correlate())); + + actionAutoCorrelate = new QAction(tr("&Autocorrelate"), this); + connect(actionAutoCorrelate, SIGNAL(activated()), this, SLOT(autoCorrelate())); + + actionConvolute = new QAction(tr("&Convolute"), this); + connect(actionConvolute, SIGNAL(activated()), this, SLOT(convolute())); + + actionDeconvolute = new QAction(tr("&Deconvolute"), this); + connect(actionDeconvolute, SIGNAL(activated()), this, SLOT(deconvolute())); + + actionTranslateHor = new QAction(tr("&Horizontal"), this); + connect(actionTranslateHor, SIGNAL(activated()), this, SLOT(translateCurveHor())); + + actionTranslateVert = new QAction(tr("&Vertical"), this); + connect(actionTranslateVert, SIGNAL(activated()), this, SLOT(translateCurve())); + + actionSetAscValues = new QAction(QIcon(":/rowNumbers.png"),tr("Ro&w Numbers"), this); + connect(actionSetAscValues, SIGNAL(activated()), this, SLOT(setAscValues())); + + actionSetRandomValues = new QAction(QIcon(":/randomNumbers.png"),tr("&Random Values"), this); + connect(actionSetRandomValues, SIGNAL(activated()), this, SLOT(setRandomValues())); + + actionFrequencyCount = new QAction(tr("&Frequency Count ..."), this); + connect(actionFrequencyCount, SIGNAL(activated()), this, SLOT(showFrequencyCountDialog())); + + actionReadOnlyCol = new QAction(tr("&Read Only"), this); + connect(actionReadOnlyCol, SIGNAL(activated()), this, SLOT(setReadOnlyCol())); + + actionSetXCol = new QAction(QIcon(":/x_col.png"), tr("&X"), this); + connect(actionSetXCol, SIGNAL(activated()), this, SLOT(setXCol())); + + actionSetYCol = new QAction(QIcon(":/y_col.png"), tr("&Y"), this); + connect(actionSetYCol, SIGNAL(activated()), this, SLOT(setYCol())); + + actionSetZCol = new QAction(QIcon(":/z_col.png"), tr("&Z"), this); + connect(actionSetZCol, SIGNAL(activated()), this, SLOT(setZCol())); + + actionSetXErrCol = new QAction(tr("X E&rror"), this); + connect(actionSetXErrCol, SIGNAL(activated()), this, SLOT(setXErrCol())); + + actionSetYErrCol = new QAction(QIcon(":/errors.png"), tr("Y &Error"), this); + connect(actionSetYErrCol, SIGNAL(activated()), this, SLOT(setYErrCol())); + + actionDisregardCol = new QAction(QIcon(":/disregard_col.png"), tr("&Disregard"), this); + connect(actionDisregardCol, SIGNAL(activated()), this, SLOT(disregardCol())); + + actionSetLabelCol = new QAction(QIcon(":/set_label_col.png"), tr("&Label"), this); + connect(actionSetLabelCol, SIGNAL(activated()), this, SLOT(setLabelCol())); + + actionBoxPlot = new QAction(QIcon(":/boxPlot.png"),tr("&Box Plot"), this); + connect(actionBoxPlot, SIGNAL(activated()), this, SLOT(plotBoxDiagram())); + + actionMultiPeakGauss = new QAction(tr("&Gaussian..."), this); + connect(actionMultiPeakGauss, SIGNAL(activated()), this, SLOT(fitMultiPeakGauss())); + + actionMultiPeakLorentz = new QAction(tr("&Lorentzian..."), this); + connect(actionMultiPeakLorentz, SIGNAL(activated()), this, SLOT(fitMultiPeakLorentz())); + + actionSubtractLine = new QAction(tr("&Straight Line..."), this); + connect(actionSubtractLine, SIGNAL(activated()), this, SLOT(subtractStraightLine())); + + actionSubtractReference = new QAction(tr("&Reference Data..."), this); + connect(actionSubtractReference, SIGNAL(activated()), this, SLOT(subtractReferenceData())); + + actionCheckUpdates = new QAction(tr("Search for &Updates"), this); + connect(actionCheckUpdates, SIGNAL(activated()), this, SLOT(searchForUpdates())); + + actionHomePage = new QAction(tr("&QtiPlot Homepage"), this); + connect(actionHomePage, SIGNAL(activated()), this, SLOT(showHomePage())); + + actionHelpForums = new QAction(tr("QtiPlot &Forums"), this); + connect(actionHelpForums, SIGNAL(triggered()), this, SLOT(showForums())); + + actionHelpBugReports = new QAction(tr("Report a &Bug"), this); + connect(actionHelpBugReports, SIGNAL(triggered()), this, SLOT(showBugTracker())); + + actionDownloadManual = new QAction(tr("Download &Manual"), this); + connect(actionDownloadManual, SIGNAL(activated()), this, SLOT(downloadManual())); + + actionTranslations = new QAction(tr("&Translations"), this); + connect(actionTranslations, SIGNAL(activated()), this, SLOT(downloadTranslation())); + + actionDonate = new QAction(tr("Make a &Donation"), this); + connect(actionDonate, SIGNAL(activated()), this, SLOT(showDonationsPage())); + + actionTechnicalSupport = new QAction(tr("Technical &Support"), this); + connect(actionTechnicalSupport, SIGNAL(activated()), this, SLOT(showSupportPage())); + +#ifdef SCRIPTING_PYTHON + actionScriptingLang = new QAction(tr("Scripting &language"), this); + connect(actionScriptingLang, SIGNAL(activated()), this, SLOT(showScriptingLangDialog())); + + actionCommentSelection = new QAction(QIcon(":/comment.png"), tr("Commen&t Selection"), this); + actionCommentSelection->setEnabled(false); + connect(actionCommentSelection, SIGNAL(activated()), this, SLOT(commentSelection())); + + actionUncommentSelection = new QAction(QIcon(":/uncomment.png"), tr("&Uncomment Selection"), this); + actionUncommentSelection->setEnabled(false); + connect(actionUncommentSelection, SIGNAL(activated()), this, SLOT(uncommentSelection())); +#endif + + actionRestartScripting = new QAction(tr("&Restart scripting"), this); + connect(actionRestartScripting, SIGNAL(activated()), this, SLOT(restartScriptingEnv())); + + actionNoteExecute = new QAction(QIcon(":/execute_selection.png"), tr("E&xecute"), this); + actionNoteExecute->setShortcut(tr("Ctrl+J")); + connect(actionNoteExecute, SIGNAL(activated()), this, SLOT(execute())); + + actionNoteExecuteAll = new QAction(QIcon(":/play.png"), tr("Execute &All"), this); + actionNoteExecuteAll->setShortcut(tr("Ctrl+Shift+J")); + connect(actionNoteExecuteAll, SIGNAL(activated()), this, SLOT(executeAll())); + + actionNoteEvaluate = new QAction(tr("&Evaluate Expression"), this); + actionNoteEvaluate->setShortcut(tr("Ctrl+Return")); + connect(actionNoteEvaluate, SIGNAL(activated()), this, SLOT(evaluate())); + + actionShowNoteLineNumbers = new QAction(tr("Show Line &Numbers"), this); + actionShowNoteLineNumbers->setCheckable(true); + connect(actionShowNoteLineNumbers, SIGNAL(toggled(bool)), this, SLOT(showNoteLineNumbers(bool))); + + actionFind = new QAction(QIcon(":/find.png"), tr("&Find..."), this); + actionFind->setShortcut(tr("Ctrl+Alt+F")); + connect(actionFind, SIGNAL(activated()), this, SLOT(noteFindDialogue())); + + actionFindNext = new QAction(QIcon(":/find_next.png"), tr("Find &Next"), this); + actionFindNext->setShortcut(tr("F3")); + connect(actionFindNext, SIGNAL(activated()), this, SLOT(noteFindNext())); + + actionFindPrev = new QAction(QIcon(":/find_previous.png"), tr("Find &Previous"), this); + actionFindPrev->setShortcut(tr("F4")); + connect(actionFindPrev, SIGNAL(activated()), this, SLOT(noteFindPrev())); + + actionReplace = new QAction(QIcon(":/replace.png"), tr("&Replace..."), this); + connect(actionReplace, SIGNAL(activated()), this, SLOT(noteReplaceDialogue())); + + actionIncreaseIndent = new QAction(QIcon(":/increase_indent.png"), tr("Increase Indent"), this); + connect(actionIncreaseIndent, SIGNAL(activated()), this, SLOT(increaseNoteIndent())); + + actionDecreaseIndent = new QAction(QIcon(":/decrease_indent.png"),tr("Decrease Indent"), this); + connect(actionDecreaseIndent, SIGNAL(activated()), this, SLOT(decreaseNoteIndent())); + + actionRenameNoteTab = new QAction(tr("Rena&me Tab..."), this); + connect(actionRenameNoteTab, SIGNAL(activated()), this, SLOT(renameCurrentNoteTab())); + + actionAddNoteTab = new QAction(QIcon(":/plus.png"), tr("A&dd Tab"), this); + connect(actionAddNoteTab, SIGNAL(activated()), this, SLOT(addNoteTab())); + + actionCloseNoteTab = new QAction(QIcon(":/delete.png"), tr("C&lose Tab"), this); + connect(actionCloseNoteTab, SIGNAL(activated()), this, SLOT(closeNoteTab())); + +#ifdef SCRIPTING_PYTHON + actionShowScriptWindow = new QAction(QPixmap(":/python.png"), tr("&Script Window"), this); + actionShowScriptWindow->setShortcut(QKeySequence(Qt::ALT + Qt::Key_F3)); + actionShowScriptWindow->setToggleAction( true ); + connect(actionShowScriptWindow, SIGNAL(activated()), this, SLOT(showScriptWindow())); + + actionOpenQtDesignerUi = new QAction(tr("Load Custom User &Interface..."), this); + connect(actionOpenQtDesignerUi, SIGNAL(activated()), this, SLOT(openQtDesignerUi())); +#endif + + actionShowCurvePlotDialog = new QAction(tr("&Plot details..."), this); + connect(actionShowCurvePlotDialog, SIGNAL(activated()), this, SLOT(showCurvePlotDialog())); + + actionShowCurveWorksheet = new QAction(tr("&Worksheet"), this); + connect(actionShowCurveWorksheet, SIGNAL(activated()), this, SLOT(showCurveWorksheet())); + + actionCurveFullRange = new QAction(tr("&Reset to Full Range"), this); + connect(actionCurveFullRange, SIGNAL(activated()), this, SLOT(setCurveFullRange())); + + actionEditCurveRange = new QAction(tr("Edit &Range..."), this); + connect(actionEditCurveRange, SIGNAL(activated()), this, SLOT(showCurveRangeDialog())); + + actionRemoveCurve = new QAction(QPixmap(":/close.png"), tr("&Delete"), this); + connect(actionRemoveCurve, SIGNAL(activated()), this, SLOT(removeCurve())); + + actionHideCurve = new QAction(tr("&Hide"), this); + connect(actionHideCurve, SIGNAL(activated()), this, SLOT(hideCurve())); + + actionHideOtherCurves = new QAction(tr("Hide &Other Curves"), this); + connect(actionHideOtherCurves, SIGNAL(activated()), this, SLOT(hideOtherCurves())); + + actionShowAllCurves = new QAction(tr("&Show All Curves"), this); + connect(actionShowAllCurves, SIGNAL(activated()), this, SLOT(showAllCurves())); + + actionToolBars = new QAction(tr("&Toolbars..."), this); + actionToolBars->setShortcut(tr("Ctrl+Shift+T")); + connect(actionToolBars, SIGNAL(activated()), this, SLOT(showToolBarsMenu())); + + actionFontBold = new QAction("B", this); + actionFontBold->setToolTip(tr("Bold")); + QFont font = appFont; + font.setBold(true); + actionFontBold->setFont(font); + actionFontBold->setCheckable(true); + connect(actionFontBold, SIGNAL(toggled(bool)), this, SLOT(setBoldFont(bool))); + + actionFontItalic = new QAction("It", this); + actionFontItalic->setToolTip(tr("Italic")); + font = appFont; + font.setItalic(true); + actionFontItalic->setFont(font); + actionFontItalic->setCheckable(true); + connect(actionFontItalic, SIGNAL(toggled(bool)), this, SLOT(setItalicFont(bool))); + + actionSuperscript = new QAction(QPixmap(":/exp.png"), tr("Superscript"), this); + connect(actionSuperscript, SIGNAL(activated()), this, SLOT(insertSuperscript())); + actionSuperscript->setEnabled(false); + + actionSubscript = new QAction(QPixmap(":/index.png"), tr("Subscript"), this); + connect(actionSubscript, SIGNAL(activated()), this, SLOT(insertSubscript())); + actionSubscript->setEnabled(false); + + actionUnderline = new QAction("U", this); + actionUnderline->setToolTip(tr("Underline (Ctrl+U)")); + actionUnderline->setShortcut(tr("Ctrl+U")); + font = appFont; + font.setUnderline(true); + actionUnderline->setFont(font); + connect(actionUnderline, SIGNAL(activated()), this, SLOT(underline())); + actionUnderline->setEnabled(false); + + actionGreekSymbol = new QAction(QString(QChar(0x3B1)) + QString(QChar(0x3B2)), this); + actionGreekSymbol->setToolTip(tr("Greek")); + connect(actionGreekSymbol, SIGNAL(activated()), this, SLOT(insertGreekSymbol())); + + actionGreekMajSymbol = new QAction(QString(QChar(0x393)), this); + actionGreekMajSymbol->setToolTip(tr("Greek")); + connect(actionGreekMajSymbol, SIGNAL(activated()), this, SLOT(insertGreekMajSymbol())); + + actionMathSymbol = new QAction(QString(QChar(0x222B)), this); + actionMathSymbol->setToolTip(tr("Mathematical Symbols")); + connect(actionMathSymbol, SIGNAL(activated()), this, SLOT(insertMathSymbol())); + + actionIncreasePrecision = new QAction(QPixmap(":/increase_decimals.png"), tr("Increase Precision"), this); + connect(actionIncreasePrecision, SIGNAL(activated()), this, SLOT(increasePrecision())); + + actionDecreasePrecision = new QAction(QPixmap(":/decrease_decimals.png"), tr("Decrease Precision"), this); + connect(actionDecreasePrecision, SIGNAL(activated()), this, SLOT(decreasePrecision())); +} + +void ApplicationWindow::translateActionsStrings() +{ + actionFontBold->setToolTip(tr("Bold")); + actionFontItalic->setToolTip(tr("Italic")); + actionUnderline->setStatusTip(tr("Underline (Ctrl+U)")); + actionUnderline->setShortcut(tr("Ctrl+U")); + actionGreekSymbol->setToolTip(tr("Greek")); + actionGreekMajSymbol->setToolTip(tr("Greek")); + actionMathSymbol->setToolTip(tr("Mathematical Symbols")); + + actionShowCurvePlotDialog->setMenuText(tr("&Plot details...")); + actionShowCurveWorksheet->setMenuText(tr("&Worksheet")); + actionRemoveCurve->setMenuText(tr("&Delete")); + + actionCurveFullRange->setMenuText(tr("&Reset to Full Range")); + actionEditCurveRange->setMenuText(tr("Edit &Range...")); + actionHideCurve->setMenuText(tr("&Hide")); + actionHideOtherCurves->setMenuText(tr("Hide &Other Curves")); + actionShowAllCurves->setMenuText(tr("&Show All Curves")); + + actionNewProject->setMenuText(tr("New &Project")); + actionNewProject->setToolTip(tr("Open a new project")); + actionNewProject->setShortcut(tr("Ctrl+N")); + + actionAppendProject->setMenuText(tr("App&end Project...")); + actionAppendProject->setToolTip(tr("Append a project to the current folder")); + actionAppendProject->setShortcut(tr("Ctrl+Alt+A")); + + actionNewFolder->setMenuText(tr("New F&older")); + actionNewFolder->setToolTip(tr("Create a new folder")); + actionNewFolder->setShortcut(Qt::Key_F7); + + actionNewGraph->setMenuText(tr("New &Graph")); + actionNewGraph->setToolTip(tr("Create an empty 2D plot")); + actionNewGraph->setShortcut(tr("Ctrl+G")); + + actionNewNote->setMenuText(tr("New &Note")); + actionNewNote->setToolTip(tr("Create an empty note window")); + + actionNewTable->setMenuText(tr("New &Table")); + actionNewTable->setShortcut(tr("Ctrl+T")); + actionNewTable->setToolTip(tr("New table")); + + actionNewMatrix->setMenuText(tr("New &Matrix")); + actionNewMatrix->setShortcut(tr("Ctrl+M")); + actionNewMatrix->setToolTip(tr("New matrix")); + + actionNewFunctionPlot->setMenuText(tr("New &Function Plot")); + actionNewFunctionPlot->setToolTip(tr("Create a new 2D function plot")); + actionNewFunctionPlot->setShortcut(tr("Ctrl+F")); + + actionNewSurfacePlot->setMenuText(tr("New 3D &Surface Plot")); + actionNewSurfacePlot->setToolTip(tr("Create a new 3D surface plot")); + actionNewSurfacePlot->setShortcut(tr("Ctrl+ALT+Z")); + + actionOpen->setMenuText(tr("&Open...")); + actionOpen->setShortcut(tr("Ctrl+O")); + actionOpen->setToolTip(tr("Open project")); + +#ifdef XLS_IMPORT + actionOpenExcel->setMenuText(tr("Open Exce&l ...")); + actionOpenExcel->setShortcut( tr("Ctrl+Shift+E") ); + actionOpenExcel->setToolTip(tr("Open Excel")); +#endif +#ifdef ODS_IMPORT + actionOpenOds->setMenuText(tr("Open ODF Spreads&heet...")); + actionOpenOds->setShortcut( tr("Ctrl+Alt+S") ); + actionOpenOds->setToolTip(tr("Open ODF Spreadsheet")); +#endif + actionLoadImage->setMenuText(tr("Open Image &File...")); + actionLoadImage->setShortcut(tr("Ctrl+I")); + + actionImportSound->setMenuText(tr("&Sound (WAV)...")); + actionImportImage->setMenuText(tr("Import I&mage...")); + + actionSaveProject->setMenuText(tr("&Save Project")); + actionSaveProject->setToolTip(tr("Save project")); + actionSaveProject->setShortcut(tr("Ctrl+S")); + + actionSaveProjectAs->setMenuText(tr("Save Project &As...")); + actionSaveProjectAs->setShortcut( tr("Ctrl+Shift+S") ); + + actionOpenTemplate->setMenuText(tr("Open Te&mplate...")); + actionOpenTemplate->setToolTip(tr("Open template")); + + actionSaveTemplate->setMenuText(tr("Save As &Template...")); + actionSaveTemplate->setToolTip(tr("Save window as template")); + + actionLoad->setMenuText(tr("&Import ASCII...")); + actionLoad->setToolTip(tr("Import data file(s)")); + actionLoad->setShortcut(tr("Ctrl+K")); + + actionUndo->setMenuText(tr("&Undo")); + actionUndo->setToolTip(tr("Undo changes")); + actionUndo->setShortcut(tr("Ctrl+Z")); + + actionRedo->setMenuText(tr("&Redo")); + actionRedo->setToolTip(tr("Redo changes")); + + actionCopyWindow->setMenuText(tr("&Duplicate")); + actionCopyWindow->setToolTip(tr("Duplicate window")); + actionCopyWindow->setShortcut(tr("Ctrl+Alt+D")); + + actionCutSelection->setMenuText(tr("Cu&t Selection")); + actionCutSelection->setToolTip(tr("Cut selection")); + actionCutSelection->setShortcut(tr("Ctrl+X")); + + actionCopySelection->setMenuText(tr("&Copy Selection")); + actionCopySelection->setToolTip(tr("Copy selection")); + actionCopySelection->setShortcut(tr("Ctrl+C")); + + actionPasteSelection->setMenuText(tr("&Paste Selection")); + actionPasteSelection->setToolTip(tr("Paste selection")); + actionPasteSelection->setShortcut(tr("Ctrl+V")); + + actionClearSelection->setMenuText(tr("&Delete Selection")); + actionClearSelection->setToolTip(tr("Delete selection")); + actionClearSelection->setShortcut(tr("Del","delete key")); + + actionShowExplorer->setMenuText(tr("Project &Explorer")); + actionShowExplorer->setShortcut(tr("Ctrl+E")); + actionShowExplorer->setToolTip(tr("Show project explorer")); + + actionFindWindow->setMenuText(tr("&Find...")); + + actionShowLog->setMenuText(tr("Results &Log")); + actionShowLog->setToolTip(tr("Show analysis results")); + + actionShowUndoStack->setMenuText(tr("&Undo/Redo Stack")); + actionShowUndoStack->setToolTip(tr("Show available undo/redo commands")); + +#ifdef SCRIPTING_CONSOLE + actionShowConsole->setMenuText(tr("&Console")); + actionShowConsole->setToolTip(tr("Show Scripting console")); +#endif + +#ifdef SCRIPTING_PYTHON + actionShowScriptWindow->setMenuText(tr("&Script Window")); + actionShowScriptWindow->setToolTip(tr("Script Window")); + actionOpenQtDesignerUi->setMenuText(tr("Load Custom User &Interface...")); +#endif + + actionCustomActionDialog->setMenuText(tr("Add &Custom Script Action...")); + + actionAddLayer->setMenuText(tr("Add La&yer")); + actionAddLayer->setToolTip(tr("Add Layer")); + actionAddLayer->setShortcut(tr("ALT+L")); + + actionShowLayerDialog->setMenuText(tr("Arran&ge Layers")); + actionShowLayerDialog->setToolTip(tr("Arrange Layers")); + actionShowLayerDialog->setShortcut(tr("Shift+A")); + + actionAutomaticLayout->setMenuText(tr("Automatic Layout")); + actionAutomaticLayout->setToolTip(tr("Automatic Layout")); + + actionExportGraph->setMenuText(tr("&Current")); + actionExportGraph->setShortcut(tr("Ctrl+Alt+G")); + actionExportGraph->setToolTip(tr("Export current graph")); + + actionExportAllGraphs->setMenuText(tr("&All")); + actionExportAllGraphs->setShortcut(tr("Alt+X")); + actionExportAllGraphs->setToolTip(tr("Export all graphs")); + + actionPresentationODF->setMenuText(tr("Create Open &Document Presentation...")); + + actionExportPDF->setMenuText(tr("&Export PDF")); + actionExportPDF->setShortcut(tr("Ctrl+Alt+P")); + actionExportPDF->setToolTip(tr("Export to PDF")); + + actionPrint->setMenuText(tr("&Print...")); + actionPrint->setShortcut(tr("Ctrl+P")); + actionPrint->setToolTip(tr("Print window")); + + actionPrintPreview->setMenuText(tr("Print Pre&view...")); + actionPrintPreview->setToolTip(tr("Print preview")); + + actionPrintAllPlots->setMenuText(tr("Print All Plo&ts")); + actionShowExportASCIIDialog->setMenuText(tr("E&xport ASCII...")); + + actionCloseAllWindows->setMenuText(tr("&Quit")); + actionCloseAllWindows->setShortcut(tr("Ctrl+Q")); + actionCloseProject->setMenuText(tr("&Close")); + + actionClearLogInfo->setMenuText(tr("Clear &Log Information")); + actionDeleteFitTables->setMenuText(tr("Delete &Fit Tables")); + + actionToolBars->setMenuText(tr("&Toolbars...")); + actionToolBars->setShortcut(tr("Ctrl+Shift+T")); + + actionShowPlotWizard->setMenuText(tr("Plot &Wizard")); + actionShowPlotWizard->setShortcut(tr("Ctrl+Alt+W")); + + actionShowConfigureDialog->setMenuText(tr("&Preferences...")); + + actionShowCurvesDialog->setMenuText(tr("Add/Remove &Curve...")); + actionShowCurvesDialog->setShortcut(tr("ALT+C")); + actionShowCurvesDialog->setToolTip(tr("Add curve to graph")); + + actionAddErrorBars->setMenuText(tr("Add &Error Bars...")); + actionAddErrorBars->setToolTip(tr("Add Error Bars...")); + actionAddErrorBars->setShortcut(tr("Ctrl+B")); + + actionAddFunctionCurve->setMenuText(tr("Add &Function...")); + actionAddFunctionCurve->setToolTip(tr("Add Function...")); + actionAddFunctionCurve->setShortcut(tr("Ctrl+Alt+F")); + + actionUnzoom->setMenuText(tr("&Rescale to Show All")); + actionUnzoom->setShortcut(tr("Ctrl+Shift+R")); + actionUnzoom->setToolTip(tr("Best fit")); + + actionNewLegend->setMenuText( tr("New &Legend")); + actionNewLegend->setShortcut(tr("Ctrl+L")); + actionNewLegend->setToolTip(tr("Add new legend")); + + actionTimeStamp->setMenuText(tr("Add Time Stamp")); + actionTimeStamp->setShortcut(tr("Ctrl+ALT+T")); + actionTimeStamp->setToolTip(tr("Date & time ")); + + actionAddImage->setMenuText(tr("Add &Image")); + actionAddImage->setToolTip(tr("Add Image")); + actionAddImage->setShortcut(tr("ALT+I")); + + actionPlotL->setMenuText(tr("&Line")); + actionPlotL->setToolTip(tr("Plot as line")); + + actionPlotP->setMenuText(tr("&Scatter")); + actionPlotP->setToolTip(tr("Plot as symbols")); + + actionPlotLP->setMenuText(tr("Line + S&ymbol")); + actionPlotLP->setToolTip(tr("Plot as line + symbols")); + + actionPlotVerticalDropLines->setMenuText(tr("Vertical &Drop Lines")); + + actionPlotSpline->setMenuText(tr("&Spline")); + actionPlotVertSteps->setMenuText(tr("&Vertical Steps")); + actionPlotHorSteps->setMenuText(tr("&Horizontal Steps")); + + actionPlotVerticalBars->setMenuText(tr("&Columns")); + actionPlotVerticalBars->setToolTip(tr("Plot with vertical bars")); + + actionPlotHorizontalBars->setMenuText(tr("&Rows")); + actionPlotHorizontalBars->setToolTip(tr("Plot with horizontal bars")); + + actionStackBars->setMenuText(tr("Stack &Bar")); + actionStackBars->setToolTip(tr("Plot stack bar")); + + actionStackColumns->setMenuText(tr("Stack &Column")); + actionStackColumns->setToolTip(tr("Plot stack column")); + + actionPlotArea->setMenuText(tr("&Area")); + actionPlotArea->setToolTip(tr("Plot area")); + + actionPlotPie->setMenuText(tr("&Pie")); + actionPlotPie->setToolTip(tr("Plot pie")); + + actionPlotVectXYXY->setMenuText(tr("&Vectors XYXY")); + actionPlotVectXYXY->setToolTip(tr("Vectors XYXY")); + + actionPlotVectXYAM->setMenuText(tr("Vectors XY&AM")); + actionPlotVectXYAM->setToolTip(tr("Vectors XYAM")); + + actionPlotHistogram->setMenuText( tr("&Histogram")); + actionPlotStackedHistograms->setMenuText(tr("&Stacked Histogram")); + + actionPlot2VerticalLayers->setMenuText(tr("&Vertical 2 Layers")); + actionPlot2HorizontalLayers->setMenuText(tr("&Horizontal 2 Layers")); + actionPlot4Layers->setMenuText(tr("&4 Layers")); + actionPlotStackedLayers->setMenuText(tr("&Stacked Layers")); + + actionVertSharedAxisLayers->setMenuText(tr("&Vertical 2 Layers")); + actionHorSharedAxisLayers->setMenuText(tr("&Horizontal 2 Layers")); + actionSharedAxesLayers->setMenuText(tr("&4 Layers")); + actionStackSharedAxisLayers->setMenuText(tr("&Stacked Layers")); + actionCustomSharedAxisLayers->setMenuText(tr("&Custom Layout...")); + actionCustomLayout->setMenuText(tr("&Custom Layout...")); + + actionStemPlot->setMenuText(tr("Stem-and-&Leaf Plot")); + actionStemPlot->setToolTip(tr("Stem-and-Leaf Plot")); + + actionPlotDoubleYAxis->setMenuText(tr("D&ouble-Y")); + actionPlotDoubleYAxis->setToolTip(tr("Double Y Axis")); + + actionAddZoomPlot->setMenuText(tr("&Zoom")); + actionAddZoomPlot->setToolTip(tr("Zoom")); + + actionWaterfallPlot->setMenuText(tr("&Waterfall Plot")); + actionWaterfallPlot->setToolTip(tr("Waterfall Plot")); + + actionExtractGraphs->setMenuText(tr("E&xtract to Graphs")); + actionExtractGraphs->setToolTip(tr("Extract to Graphs")); + + actionExtractLayers->setMenuText(tr("Extract to Layer&s")); + actionExtractLayers->setToolTip(tr("Extract to Layers")); + + actionPlot3DRibbon->setMenuText(tr("&Ribbon")); + actionPlot3DRibbon->setToolTip(tr("Plot 3D ribbon")); + + actionPlot3DBars->setMenuText(tr("&Bars")); + actionPlot3DBars->setToolTip(tr("Plot 3D bars")); + + actionPlot3DScatter->setMenuText(tr("&Scatter")); + actionPlot3DScatter->setToolTip(tr("Plot 3D scatter")); + + actionPlot3DTrajectory->setMenuText(tr("&Trajectory")); + actionPlot3DTrajectory->setToolTip(tr("Plot 3D trajectory")); + + actionColorMap->setMenuText(tr("Contour + &Color Fill")); + actionColorMap->setToolTip(tr("Contour Lines + Color Fill")); + + actionContourMap->setMenuText(tr("Contour &Lines")); + actionContourMap->setToolTip(tr("Contour Lines")); + + actionGrayMap->setMenuText(tr("&Gray Scale Map")); + actionGrayMap->setToolTip(tr("Gray Scale Map")); + + actionShowColStatistics->setMenuText(tr("Statistics on &Columns")); + actionShowColStatistics->setToolTip(tr("Selected columns statistics")); + + actionShowRowStatistics->setMenuText(tr("Statistics on &Rows")); + actionShowRowStatistics->setToolTip(tr("Selected rows statistics")); + actionShowIntDialog->setMenuText(tr("Integr&ate Function...")); + actionIntegrate->setMenuText(tr("&Integrate")); + actionInterpolate->setMenuText(tr("Inte&rpolate ...")); + actionLowPassFilter->setMenuText(tr("&Low Pass...")); + actionHighPassFilter->setMenuText(tr("&High Pass...")); + actionBandPassFilter->setMenuText(tr("&Band Pass...")); + actionBandBlockFilter->setMenuText(tr("&Band Block...")); + actionFFT->setMenuText(tr("&FFT...")); + actionSmoothSavGol->setMenuText(tr("&Savitzky-Golay...")); + actionSmoothFFT->setMenuText(tr("&FFT Filter...")); + actionSmoothAverage->setMenuText(tr("Moving Window &Average...")); + actionSmoothLowess->setMenuText(tr("&Lowess...")); + actionDifferentiate->setMenuText(tr("&Differentiate")); + actionFitLinear->setMenuText(tr("Fit &Linear")); + actionFitSlope->setMenuText(tr("Fit Slop&e")); + actionShowFitPolynomDialog->setMenuText(tr("Fit &Polynomial ...")); + actionShowExpDecayDialog->setMenuText(tr("&First Order ...")); + actionShowTwoExpDecayDialog->setMenuText(tr("&Second Order ...")); + actionShowExpDecay3Dialog->setMenuText(tr("&Third Order ...")); + actionFitExpGrowth->setMenuText(tr("Fit Exponential Gro&wth ...")); + actionFitSigmoidal->setMenuText(tr("Fit &Boltzmann (Sigmoidal)")); + actionFitGauss->setMenuText(tr("Fit &Gaussian")); + actionFitLorentz->setMenuText(tr("Fit Lorent&zian")); + + actionShowFitDialog->setMenuText(tr("Fit &Wizard...")); + actionShowFitDialog->setShortcut(tr("Ctrl+Y")); + + actionShowPlotDialog->setMenuText(tr("&Plot ...")); + actionShowScaleDialog->setMenuText(tr("&Scales...")); + actionShowAxisDialog->setMenuText(tr("&Axes...")); + actionShowGridDialog->setMenuText(tr("&Grid ...")); + actionShowTitleDialog->setMenuText(tr("&Title ...")); + actionShowColumnOptionsDialog->setMenuText(tr("Column &Options ...")); + actionShowColumnOptionsDialog->setShortcut(tr("Ctrl+Alt+O")); + actionShowColumnValuesDialog->setMenuText(tr("Set Column &Values ...")); + actionShowColumnValuesDialog->setShortcut(tr("Alt+Q")); + actionTableRecalculate->setMenuText(tr("Recalculate")); + actionTableRecalculate->setShortcut(tr("Ctrl+Return")); + actionHideSelectedColumns->setMenuText(tr("&Hide Selected")); + actionHideSelectedColumns->setToolTip(tr("Hide selected columns")); + actionShowAllColumns->setMenuText(tr("Sho&w All Columns")); + actionHideSelectedColumns->setToolTip(tr("Show all table columns")); + actionSwapColumns->setMenuText(tr("&Swap columns")); + actionSwapColumns->setToolTip(tr("Swap selected columns")); + actionMoveColRight->setMenuText(tr("Move &Right")); + actionMoveColRight->setToolTip(tr("Move Right")); + actionMoveColLeft->setMenuText(tr("Move &Left")); + actionMoveColLeft->setToolTip(tr("Move Left")); + actionMoveColFirst->setMenuText(tr("Move to F&irst")); + actionMoveColFirst->setToolTip(tr("Move to First")); + actionMoveColLast->setMenuText(tr("Move to Las&t")); + actionMoveColLast->setToolTip(tr("Move to Last")); + actionShowColsDialog->setMenuText(tr("&Columns...")); + actionShowRowsDialog->setMenuText(tr("&Rows...")); + actionDeleteRows->setMenuText(tr("&Delete Rows Interval...")); + actionMoveRowUp->setMenuText(tr("&Upward")); + actionMoveRowUp->setToolTip(tr("Move current row upward")); + actionMoveRowDown->setMenuText(tr("&Downward")); + actionMoveRowDown->setToolTip(tr("Move current row downward")); + actionAdjustColumnWidth->setMenuText(tr("Ad&just Column Width")); + actionAdjustColumnWidth->setToolTip(tr("Set optimal column width")); + + actionExtractTableData->setMenuText(tr("&Extract Data...")); + + actionAbout->setMenuText(tr("&About QtiPlot")); + actionAbout->setShortcut(tr("F1")); + + actionShowHelp->setMenuText(tr("&Help")); + actionShowHelp->setShortcut(tr("Ctrl+H")); + + actionChooseHelpFolder->setMenuText(tr("&Choose Help Folder...")); + actionRename->setMenuText(tr("&Rename Window")); + + actionCloseWindow->setMenuText(tr("Close &Window")); + actionCloseWindow->setShortcut(tr("Ctrl+W")); + + actionAddColToTable->setMenuText(tr("Add Column")); + actionAddColToTable->setToolTip(tr("Add Column")); + actionAddColToTable->setShortcut(tr("Alt+C")); + + actionClearTable->setMenuText(tr("Clear")); + actionGoToRow->setMenuText(tr("&Go to Row...")); + actionGoToRow->setShortcut(tr("Ctrl+Alt+G")); + + actionGoToColumn->setMenuText(tr("Go to Colum&n...")); + actionGoToColumn->setShortcut(tr("Ctrl+Alt+C")); + + actionDeleteLayer->setMenuText(tr("&Remove Layer")); + actionDeleteLayer->setShortcut(tr("Alt+R")); + + actionResizeActiveWindow->setMenuText(tr("Window &Geometry...")); + actionHideActiveWindow->setMenuText(tr("&Hide Window")); + actionHideActiveWindow->setShortcut(tr("Ctrl+Alt+H")); + actionShowMoreWindows->setMenuText(tr("More Windows...")); + actionPixelLineProfile->setMenuText(tr("&View Pixel Line Profile")); + actionIntensityTable->setMenuText(tr("&Intensity Table")); + actionShowLineDialog->setMenuText(tr("&Properties")); + actionShowTextDialog->setMenuText(tr("&Properties")); + actionActivateWindow->setMenuText(tr("&Activate Window")); + actionMinimizeWindow->setMenuText(tr("Mi&nimize Window")); + actionMaximizeWindow->setMenuText(tr("Ma&ximize Window")); + actionHideWindow->setMenuText(tr("&Hide Window")); + actionHideWindow->setShortcut(tr("Ctrl+Alt+H")); + actionResizeWindow->setMenuText(tr("Re&size Window...")); + actionEditSurfacePlot->setMenuText(tr("&Surface...")); + actionAdd3DData->setMenuText(tr("&Data Set...")); + actionSetMatrixProperties->setMenuText(tr("Set &Properties...")); + actionSetMatrixDimensions->setMenuText(tr("Set &Dimensions...")); + actionSetMatrixDimensions->setShortcut(tr("Ctrl+D")); + actionSetMatrixValues->setMenuText(tr("Set &Values...")); + actionSetMatrixValues->setToolTip(tr("Set Matrix Values")); + actionSetMatrixValues->setShortcut(tr("Alt+Q")); + actionImagePlot->setMenuText(tr("&Image Plot")); + actionImagePlot->setToolTip(tr("Image Plot")); + + actionImageProfilesPlot->setMenuText(tr("&Image Profiles")); + actionImageProfilesPlot->setToolTip(tr("Image Profiles")); + + actionTransposeMatrix->setMenuText(tr("&Transpose")); + actionRotateMatrix->setMenuText(tr("R&otate 90")); + actionRotateMatrix->setToolTip(tr("Rotate 90 Clockwise")); + actionRotateMatrixMinus->setMenuText(tr("Rotate &-90")); + actionRotateMatrixMinus->setToolTip(tr("Rotate 90 Counterclockwise")); + actionFlipMatrixVertically->setMenuText(tr("Flip &V")); + actionFlipMatrixVertically->setToolTip(tr("Flip Vertically")); + actionFlipMatrixHorizontally->setMenuText(tr("Flip &H")); + actionFlipMatrixHorizontally->setToolTip(tr("Flip Horizontally")); + + actionMatrixXY->setMenuText(tr("Show &X/Y")); + actionMatrixColumnRow->setMenuText(tr("Show &Column/Row")); + actionViewMatrix->setMenuText(tr("&Data mode")); + actionViewMatrixImage->setMenuText(tr("&Image mode")); + actionMatrixDefaultScale->setMenuText(tr("&Default")); + actionMatrixGrayScale->setMenuText(tr("&Gray Scale")); + actionMatrixRainbowScale->setMenuText(tr("&Rainbow")); + actionMatrixCustomScale->setMenuText(tr("&Custom")); + actionInvertMatrix->setMenuText(tr("&Invert")); + actionMatrixDeterminant->setMenuText(tr("&Determinant")); + actionConvertMatrixDirect->setMenuText(tr("&Direct")); + actionConvertMatrixXYZ->setMenuText(tr("&XYZ Columns")); + actionConvertMatrixYXZ->setMenuText(tr("&YXZ Columns")); + actionExportMatrix->setMenuText(tr("&Export Image ...")); + + actionConvertTableDirect->setMenuText(tr("&Direct")); + actionConvertTableBinning->setMenuText(tr("2D &Binning")); + actionConvertTableRegularXYZ->setMenuText(tr("&Regular XYZ")); + + actionPlot3DWireFrame->setMenuText(tr("3D &Wire Frame")); + actionPlot3DHiddenLine->setMenuText(tr("3D &Hidden Line")); + actionPlot3DPolygons->setMenuText(tr("3D &Polygons")); + actionPlot3DWireSurface->setMenuText(tr("3D Wire &Surface")); + actionSortTable->setMenuText(tr("Sort Ta&ble")); + actionSortSelection->setMenuText(tr("Sort Columns")); + actionNormalizeTable->setMenuText(tr("&Table")); + actionNormalizeSelection->setMenuText(tr("&Columns")); + actionCorrelate->setMenuText(tr("Co&rrelate")); + actionAutoCorrelate->setMenuText(tr("&Autocorrelate")); + actionConvolute->setMenuText(tr("&Convolute")); + actionDeconvolute->setMenuText(tr("&Deconvolute")); + actionTranslateHor->setMenuText(tr("&Horizontal")); + actionTranslateVert->setMenuText(tr("&Vertical")); + actionSetAscValues->setMenuText(tr("Ro&w Numbers")); + actionSetAscValues->setToolTip(tr("Fill selected columns with row numbers")); + actionSetRandomValues->setMenuText(tr("&Random Values")); + actionSetRandomValues->setToolTip(tr("Fill selected columns with random numbers")); + actionFrequencyCount->setMenuText(tr("&Frequency Count ...")); + actionSetXCol->setMenuText(tr("&X")); + actionSetXCol->setToolTip(tr("Set column as X")); + actionSetYCol->setMenuText(tr("&Y")); + actionSetYCol->setToolTip(tr("Set column as Y")); + actionSetZCol->setMenuText(tr("&Z")); + actionSetZCol->setToolTip(tr("Set column as Z")); + actionSetXErrCol->setMenuText(tr("X E&rror")); + actionSetYErrCol->setMenuText(tr("Y &Error")); + actionSetYErrCol->setToolTip(tr("Set as Y Error Bars")); + actionSetLabelCol->setMenuText(tr("&Label")); + actionSetLabelCol->setToolTip(tr("Set as Labels")); + actionDisregardCol->setMenuText(tr("&Disregard")); + actionDisregardCol->setToolTip(tr("Disregard Columns")); + actionReadOnlyCol->setMenuText(tr("&Read Only")); + + actionBoxPlot->setMenuText(tr("&Box Plot")); + actionBoxPlot->setToolTip(tr("Box and whiskers plot")); + + actionSubtractReference->setMenuText(tr("&Reference Data...")); + actionSubtractLine->setMenuText(tr("&Straight Line...")); + actionMultiPeakGauss->setMenuText(tr("&Gaussian...")); + actionMultiPeakLorentz->setMenuText(tr("&Lorentzian...")); + actionHomePage->setMenuText(tr("&QtiPlot Homepage")); + actionCheckUpdates->setMenuText(tr("Search for &Updates")); + actionHelpForums->setText(tr("Visit QtiPlot &Forums")); + actionHelpBugReports->setText(tr("Report a &Bug")); + actionDownloadManual->setMenuText(tr("Download &Manual")); + actionTranslations->setMenuText(tr("&Translations")); + actionDonate->setMenuText(tr("Make a &Donation")); + actionTechnicalSupport->setMenuText(tr("Technical &Support")); + +#ifdef SCRIPTING_PYTHON + actionScriptingLang->setMenuText(tr("Scripting &language")); + actionCommentSelection->setMenuText(tr("Commen&t Selection")); + actionCommentSelection->setToolTip(tr("Comment Selection")); + actionCommentSelection->setShortcut(tr("Ctrl+Shift+O")); + + actionUncommentSelection->setMenuText(tr("&Uncomment Selection")); + actionUncommentSelection->setToolTip(tr("Uncomment Selection")); + actionUncommentSelection->setShortcut(tr("Ctrl+Shift+U")); +#endif + actionRestartScripting->setMenuText(tr("&Restart scripting")); + + actionNoteExecute->setMenuText(tr("E&xecute")); + actionNoteExecute->setToolTip(tr("Execute Selected Lines")); + actionNoteExecute->setShortcut(tr("Ctrl+J")); + + actionNoteExecuteAll->setMenuText(tr("Execute &All")); + actionNoteExecuteAll->setShortcut(tr("Ctrl+Shift+J")); + + actionNoteEvaluate->setMenuText(tr("&Evaluate Expression")); + actionNoteEvaluate->setShortcut(tr("Ctrl+Return")); + + actionShowNoteLineNumbers->setMenuText(tr("Show Line &Numbers")); + actionRenameNoteTab->setMenuText(tr("Rena&me Tab...")); + actionAddNoteTab->setMenuText(tr("A&dd Tab")); + actionCloseNoteTab->setMenuText(tr("C&lose Tab")); + + actionFind->setMenuText(tr("&Find...")); + actionFind->setToolTip(tr("Show find dialog")); + actionFind->setShortcut(tr("Ctrl+Alt+F")); + + actionFindNext->setMenuText(tr("Find &Next")); + actionFindNext->setToolTip(tr("Find Next")); + actionFindNext->setShortcut(tr("F3")); + + actionFindPrev->setMenuText(tr("Find &Previous")); + actionFindPrev->setToolTip(tr("Find Previous")); + actionFindPrev->setShortcut(tr("F4")); + + actionReplace->setMenuText(tr("&Replace...")); + actionReplace->setToolTip(tr("Show replace dialog")); + actionReplace->setShortcut(tr("Ctrl+R")); + + actionIncreaseIndent->setToolTip(tr("Increase Indent")); + actionDecreaseIndent->setToolTip(tr("Decrease Indent")); + + btnPointer->setMenuText(tr("Disable &tools")); + btnPointer->setToolTip( tr( "Pointer" ) ); + + actionMagnify->setMenuText(tr("Zoom &In/Out and Drag Canvas")); + actionMagnify->setToolTip(tr("Zoom In (Shift++) or Out (-) and Drag Canvas")); + + actionMagnifyHor->setMenuText(tr("Zoom/Drag Canvas &Horizontally")); + actionMagnifyVert->setMenuText(tr("Zoom/Drag Canvas &Vertically")); + + actionMagnifyHor->setToolTip(tr("Zoom In/Out and Drag Canvas Horizontally")); + actionMagnifyVert->setToolTip(tr("Zoom In/Out and Drag Canvas Vertically")); + + btnZoomIn->setMenuText(tr("&Zoom In")); + btnZoomIn->setShortcut(tr("Ctrl++")); + btnZoomIn->setToolTip(tr("Zoom In")); + + btnZoomOut->setMenuText(tr("Zoom &Out")); + btnZoomOut->setShortcut(tr("Ctrl+-")); + btnZoomOut->setToolTip(tr("Zoom Out")); + + btnCursor->setMenuText(tr("&Data Reader")); + btnCursor->setShortcut(tr("CTRL+D")); + btnCursor->setToolTip(tr("Data reader")); + + btnSelect->setMenuText(tr("&Select Data Range")); + btnSelect->setShortcut(tr("ALT+S")); + btnSelect->setToolTip(tr("Select data range")); + + btnPicker->setMenuText(tr("S&creen Reader")); + btnPicker->setToolTip(tr("Screen reader")); + + actionDrawPoints->setMenuText(tr("&Draw Data Points")); + actionDrawPoints->setToolTip(tr("Draw Data Points")); + + btnMovePoints->setMenuText(tr("&Move Data Points...")); + btnMovePoints->setShortcut(tr("Ctrl+ALT+M")); + btnMovePoints->setToolTip(tr("Move data points")); + + actionDragCurve->setMenuText(tr("Dra&g Curve")); + actionDragCurve->setToolTip(tr("Drag Curve")); + + btnRemovePoints->setMenuText(tr("Remove &Bad Data Points...")); + btnRemovePoints->setShortcut(tr("Alt+B")); + btnRemovePoints->setToolTip(tr("Remove data points")); + + actionAddText->setMenuText(tr("Add &Text")); + actionAddText->setToolTip(tr("Add Text")); + actionAddText->setShortcut(tr("ALT+T")); + + actionAddFormula->setMenuText(tr("Add E&quation")); + actionAddFormula->setToolTip(tr("Add Equation")); + actionAddFormula->setShortcut( tr("ALT+Q") ); + + actionAddRectangle->setMenuText(tr("Add &Rectangle")); + actionAddRectangle->setToolTip(tr("Add Rectangle")); + actionAddRectangle->setShortcut( tr("CTRL+ALT+R") ); + + actionAddEllipse->setMenuText(tr("Add &Ellipse")); + actionAddEllipse->setToolTip(tr("Add Ellipse/Circle")); + actionAddEllipse->setShortcut( tr("CTRL+ALT+E") ); + + btnArrow->setMenuText(tr("Draw &Arrow")); + btnArrow->setShortcut(tr("CTRL+ALT+A")); + btnArrow->setToolTip(tr("Draw arrow")); + + btnLine->setMenuText(tr("Draw &Line")); + btnLine->setShortcut(tr("CTRL+ALT+L")); + btnLine->setToolTip(tr("Draw line")); + + // FIXME: is setText necessary for action groups? + // coord->setText( tr( "Coordinates" ) ); + // coord->setMenuText( tr( "&Coord" ) ); + // coord->setStatusTip( tr( "Coordinates" ) ); + Box->setText( tr( "Box" ) ); + Box->setMenuText( tr( "Box" ) ); + Box->setToolTip( tr( "Box" ) ); + Box->setStatusTip( tr( "Box" ) ); + Frame->setText( tr( "Frame" ) ); + Frame->setMenuText( tr( "&Frame" ) ); + Frame->setToolTip( tr( "Frame" ) ); + Frame->setStatusTip( tr( "Frame" ) ); + None->setText( tr( "No Axes" ) ); + None->setMenuText( tr( "No Axes" ) ); + None->setToolTip( tr( "No axes" ) ); + None->setStatusTip( tr( "No axes" ) ); + + front->setToolTip( tr( "Front grid" ) ); + back->setToolTip( tr( "Back grid" ) ); + right->setToolTip( tr( "Right grid" ) ); + left->setToolTip( tr( "Left grid" ) ); + ceil->setToolTip( tr( "Ceiling grid" ) ); + floor->setToolTip( tr( "Floor grid" ) ); + + wireframe->setText( tr( "Wireframe" ) ); + wireframe->setMenuText( tr( "Wireframe" ) ); + wireframe->setToolTip( tr( "Wireframe" ) ); + wireframe->setStatusTip( tr( "Wireframe" ) ); + hiddenline->setText( tr( "Hidden Line" ) ); + hiddenline->setMenuText( tr( "Hidden Line" ) ); + hiddenline->setToolTip( tr( "Hidden line" ) ); + hiddenline->setStatusTip( tr( "Hidden line" ) ); + polygon->setText( tr( "Polygon Only" ) ); + polygon->setMenuText( tr( "Polygon Only" ) ); + polygon->setToolTip( tr( "Polygon only" ) ); + polygon->setStatusTip( tr( "Polygon only" ) ); + filledmesh->setText( tr( "Mesh & Filled Polygons" ) ); + filledmesh->setMenuText( tr( "Mesh & Filled Polygons" ) ); + filledmesh->setToolTip( tr( "Mesh & filled Polygons" ) ); + filledmesh->setStatusTip( tr( "Mesh & filled Polygons" ) ); + pointstyle->setText( tr( "Dots" ) ); + pointstyle->setMenuText( tr( "Dots" ) ); + pointstyle->setToolTip( tr( "Dots" ) ); + pointstyle->setStatusTip( tr( "Dots" ) ); + barstyle->setText( tr( "Bars" ) ); + barstyle->setMenuText( tr( "Bars" ) ); + barstyle->setToolTip( tr( "Bars" ) ); + barstyle->setStatusTip( tr( "Bars" ) ); + conestyle->setText( tr( "Cones" ) ); + conestyle->setMenuText( tr( "Cones" ) ); + conestyle->setToolTip( tr( "Cones" ) ); + conestyle->setStatusTip( tr( "Cones" ) ); + crossHairStyle->setText( tr( "Crosshairs" ) ); + crossHairStyle->setMenuText( tr( "Crosshairs" ) ); + crossHairStyle->setToolTip( tr( "Crosshairs" ) ); + crossHairStyle->setStatusTip( tr( "Crosshairs" ) ); + + //floorstyle->setText( tr( "Floor Style" ) ); + //floorstyle->setMenuText( tr( "Floor Style" ) ); + //floorstyle->setStatusTip( tr( "Floor Style" ) ); + floordata->setText( tr( "Floor Data Projection" ) ); + floordata->setMenuText( tr( "Floor Data Projection" ) ); + floordata->setToolTip( tr( "Floor data projection" ) ); + floordata->setStatusTip( tr( "Floor data projection" ) ); + flooriso->setText( tr( "Floor Isolines" ) ); + flooriso->setMenuText( tr( "Floor Isolines" ) ); + flooriso->setToolTip( tr( "Floor isolines" ) ); + flooriso->setStatusTip( tr( "Floor isolines" ) ); + floornone->setText( tr( "Empty Floor" ) ); + floornone->setMenuText( tr( "Empty Floor" ) ); + floornone->setToolTip( tr( "Empty floor" ) ); + floornone->setStatusTip( tr( "Empty floor" ) ); + + actionAnimate->setText( tr( "Animation" ) ); + actionAnimate->setMenuText( tr( "Animation" ) ); + actionAnimate->setToolTip( tr( "Animation" ) ); + actionAnimate->setStatusTip( tr( "Animation" ) ); + + actionPerspective->setText( tr( "Enable perspective" ) ); + actionPerspective->setMenuText( tr( "Enable perspective" ) ); + actionPerspective->setToolTip( tr( "Enable perspective" ) ); + actionPerspective->setStatusTip( tr( "Enable perspective" ) ); + + actionResetRotation->setText( tr( "Reset rotation" ) ); + actionResetRotation->setMenuText( tr( "Reset rotation" ) ); + actionResetRotation->setToolTip( tr( "Reset rotation" ) ); + actionResetRotation->setStatusTip( tr( "Reset rotation" ) ); + + actionFitFrame->setText( tr( "Fit frame to window" ) ); + actionFitFrame->setMenuText( tr( "Fit frame to window" ) ); + actionFitFrame->setToolTip( tr( "Fit frame to window" ) ); + actionFitFrame->setStatusTip( tr( "Fit frame to window" ) ); +} + +Graph3D * ApplicationWindow::plot3DMatrix(Matrix *m, int style) +{ + if (!m) { + m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + } + + QApplication::setOverrideCursor(Qt::WaitCursor); + Graph3D *plot = newPlot3D(); + if(!plot) + return 0; + + plot->addMatrixData(m); + plot->customPlotStyle(style); + plot->setDataColorMap(m->colorMap()); + plot->update(); + + custom3DActions(plot); + emit modified(); + QApplication::restoreOverrideCursor(); + return plot; +} + +MultiLayer* ApplicationWindow::plotGrayScale(Matrix *m) +{ + if (!m) { + m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + } + + return plotSpectrogram(m, Graph::GrayScale); +} + +MultiLayer* ApplicationWindow::plotContour(Matrix *m) +{ + if (!m) { + m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + } + + return plotSpectrogram(m, Graph::Contour); +} + +MultiLayer* ApplicationWindow::plotColorMap(Matrix *m) +{ + if (!m) { + m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + } + + return plotSpectrogram(m, Graph::ColorMap); +} + +MultiLayer* ApplicationWindow::plotImage(Matrix *m) +{ + if (!m) { + m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + } + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + MultiLayer* g = multilayerPlot(generateUniqueName(tr("Graph"))); + Graph* plot = g->activeLayer(); + setPreferences(plot); + Spectrogram *s = plot->plotSpectrogram(m, Graph::GrayScale); + if (!s) + return 0; + + s->setAxis(QwtPlot::xTop, QwtPlot::yLeft); + plot->enableAxis(QwtPlot::xTop, true); + plot->setScale(QwtPlot::xTop, QMIN(m->xStart(), m->xEnd()), QMAX(m->xStart(), m->xEnd())); + plot->setScale(QwtPlot::xBottom, QMIN(m->xStart(), m->xEnd()), QMAX(m->xStart(), m->xEnd())); + plot->enableAxis(QwtPlot::xBottom, false); + plot->enableAxis(QwtPlot::yRight, false); + plot->setScale(QwtPlot::yLeft, QMIN(m->yStart(), m->yEnd()), QMAX(m->yStart(), m->yEnd()), + 0.0, 5, 5, Graph::Linear, true); + plot->setAxisTitle(QwtPlot::yLeft, QString::null); + plot->setAxisTitle(QwtPlot::xTop, QString::null); + plot->setTitle(QString::null); + + g->arrangeLayers(false, true); + + emit modified(); + QApplication::restoreOverrideCursor(); + return g; +} + +MultiLayer* ApplicationWindow::plotSpectrogram(Matrix *m, Graph::CurveType type) +{ + if (type == Graph::ImagePlot) + return plotImage(m); + else if (type == Graph::Histogram) + return plotHistogram(m); + + if (!m) + return 0; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + MultiLayer* g = multilayerPlot(generateUniqueName(tr("Graph"))); + Graph* plot = g->activeLayer(); + setPreferences(plot); + plot->plotSpectrogram(m, type); + g->arrangeLayers(false, true); + QApplication::restoreOverrideCursor(); + return g; +} + +MultiLayer* ApplicationWindow::plotImageProfiles(Matrix *m) +{ + if (!m) { + m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + } + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + MultiLayer* g = multilayerPlot(generateUniqueName(tr("Profiles")), 0); + g->resize(650, 600); + g->plotProfiles(m); + + Table *horTable = newHiddenTable(tr("Horizontal"), QString::null, m->numCols(), 2); + Table *verTable = newHiddenTable(tr("Vertical"), QString::null, m->numRows(), 2); + + Graph *sg = g->layer(1); + ImageProfilesTool *screener = new ImageProfilesTool(this, sg, m, horTable, verTable, info, SLOT(setText(const QString&))); + sg->setActiveTool(screener); + + if (horTable && g->layer(2)) + g->layer(2)->addCurves(horTable, QStringList(horTable->colName(1))); + + if (verTable && g->layer(3)){ + DataCurve *c = g->layer(3)->insertCurve(verTable, verTable->colName(1), verTable->colName(0), Graph::Line); + if (c){ + c->setAxis(QwtPlot::xTop, QwtPlot::yLeft); + c->setCurveType(QwtPlotCurve::Xfy); + } + } + + QApplication::restoreOverrideCursor(); + return g; +} + +#ifdef OPJ_IMPORT +ApplicationWindow* ApplicationWindow::importOPJ(const QString& filename, bool factorySettings, bool newProject) +{ + if (filename.endsWith(".opj", Qt::CaseInsensitive) || filename.endsWith(".ogg", Qt::CaseInsensitive)) + { + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + ApplicationWindow *app = this; + if (newProject) + app = new ApplicationWindow(factorySettings); + + app->setWindowTitle("QtiPlot - " + filename); + app->restoreApplicationGeometry(); + app->projectname = filename; + app->updateRecentProjectsList(filename); + + ImportOPJ(app, filename); + + QApplication::restoreOverrideCursor(); + return app; + } + else if (filename.endsWith(".ogm", Qt::CaseInsensitive) || filename.endsWith(".ogw", Qt::CaseInsensitive)) + { + ImportOPJ(this, filename); + updateRecentProjectsList(filename); + return this; + } + return 0; +} +#endif + +void ApplicationWindow::deleteFitTables() +{ + QList* mLst = new QList(); + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")) + mLst->append(w); + } + + foreach(QWidget *ml, *mLst){ + if (ml->isA("MultiLayer")){ + QList layers = ((MultiLayer*)ml)->layersList(); + foreach(Graph *g, layers){ + QList curves = g->fitCurvesList(); + foreach(QwtPlotCurve *c, curves){ + if (((PlotCurve *)c)->type() != Graph::Function){ + Table *t = ((DataCurve *)c)->table(); + if (!t) + continue; + + t->askOnCloseEvent(false); + t->close(); + } + } + } + } + } + delete mLst; +} + +QList ApplicationWindow::windowsList() +{ + QList lst; + + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows) + lst << w; + f = f->folderBelow(); + } + return lst; +} + +void ApplicationWindow::updateRecentProjectsList(const QString& fn) +{ + QString nativeFileName = QDir::toNativeSeparators(fn); + if (!nativeFileName.isEmpty()){ + recentProjects.removeAll(nativeFileName); + recentProjects.push_front(nativeFileName); + } + + if (recentProjects.isEmpty()) + return; + + while ((int)recentProjects.size() > MaxRecentProjects) + recentProjects.pop_back(); + + recent->clear(); + + for (int i = 0; i<(int)recentProjects.size(); i++ ) + recent->insertItem("&" + QString::number(i+1) + " " + QDir::toNativeSeparators(recentProjects[i])); +} + +void ApplicationWindow::translateCurveHor() +{ + translateCurve(TranslateCurveTool::Horizontal); +} + +void ApplicationWindow::translateCurve(TranslateCurveTool::Direction direction) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setChecked(true); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (!g) + return; + + if (g->isPiePlot()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("This functionality is not available for pie plots!")); + + btnPointer->setChecked(true); + return; + } else if (g->validCurvesDataSize()) { + btnPointer->setChecked(true); + g->setActiveTool(new TranslateCurveTool(g, this, direction, info, SLOT(setText(const QString&)))); + displayBar->show(); + } +} + +void ApplicationWindow::setReadOnlyCol() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + QStringList list = t->selectedColumns(); + for (int i=0; i<(int) list.count(); i++) + t->setReadOnlyColumn(t->colIndex(list[i]), actionReadOnlyCol->isChecked()); +} + +void ApplicationWindow::setReadOnlyColumns() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + QStringList list = t->selectedColumns(); + for (int i=0; i<(int) list.count(); i++) + t->setReadOnlyColumn(t->colIndex(list[i])); +} + +void ApplicationWindow::setReadWriteColumns() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + QStringList list = t->selectedColumns(); + for (int i=0; i<(int) list.count(); i++) + t->setReadOnlyColumn(t->colIndex(list[i]), false); +} + +void ApplicationWindow::setAscValues() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + t->setAscValues(); +} + +void ApplicationWindow::setRandomValues() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + t->setRandomValues(); +} + +void ApplicationWindow::setXErrCol() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + t->setPlotDesignation(Table::xErr); +} + +void ApplicationWindow::setYErrCol() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + t->setPlotDesignation(Table::yErr); +} + +void ApplicationWindow::setXCol() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + t->setPlotDesignation(Table::X); +} + +void ApplicationWindow::setYCol() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + t->setPlotDesignation(Table::Y); +} + +void ApplicationWindow::setZCol() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + t->setPlotDesignation(Table::Z); +} + +void ApplicationWindow::setLabelCol() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + t->setPlotDesignation(Table::Label); +} + +void ApplicationWindow::disregardCol() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + t->setPlotDesignation(Table::None); +} + +void ApplicationWindow::fitMultiPeakGauss() +{ + fitMultiPeak((int)MultiPeakFit::Gauss); +} + +void ApplicationWindow::fitMultiPeakLorentz() +{ + fitMultiPeak((int)MultiPeakFit::Lorentz); +} + +void ApplicationWindow::fitMultiPeak(int profile) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setChecked(true); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + return; + + if (g->isPiePlot()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("This functionality is not available for pie plots!")); + return; + } else { + bool ok; + int peaks = QInputDialog::getInteger(tr("QtiPlot - Enter the number of peaks"), + tr("Peaks"), 2, 2, 1000000, 1, &ok, this); + if (ok && peaks){ + g->setActiveTool(new MultiPeakFitTool(g, this, (MultiPeakFit::PeakProfile)profile, peaks, info, SLOT(setText(const QString&)))); + displayBar->show(); + } + } +} + +void ApplicationWindow::subtractStraightLine() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setChecked(true); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + return; + + if (g->isPiePlot()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("This functionality is not available for pie plots!")); + return; + } else { + g->setActiveTool(new SubtractLineTool(g, this, info, SLOT(setText(const QString&)))); + displayBar->show(); + } +} + +void ApplicationWindow::subtractReferenceData() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + return; + + SubtractDataDialog *sdd = new SubtractDataDialog(this); + sdd->setGraph(g); + sdd->exec(); +} + +void ApplicationWindow::showSupportPage() +{ + QDesktopServices::openUrl(QUrl("http://soft.proindependent.com/contracts.html")); +} + + +void ApplicationWindow::showDonationsPage() +{ + QDesktopServices::openUrl(QUrl("http://soft.proindependent.com/why_donate.html")); +} + +void ApplicationWindow::downloadManual() +{ + QDesktopServices::openUrl(QUrl("http://soft.proindependent.com/manuals.html")); +} + +void ApplicationWindow::downloadTranslation() +{ + QDesktopServices::openUrl(QUrl("http://soft.proindependent.com/translations.html")); +} + +void ApplicationWindow::showHomePage() +{ + QDesktopServices::openUrl(QUrl("http://www.qtiplot.ro")); +} + +void ApplicationWindow::showForums() +{ + QDesktopServices::openUrl(QUrl("https://developer.berlios.de/forum/?group_id=6626")); +} + +void ApplicationWindow::showBugTracker() +{ + QDesktopServices::openUrl(QUrl("https://developer.berlios.de/bugs/?group_id=6626")); +} + +#ifdef QTIPLOT_SUPPORT +void ApplicationWindow::showDonationDialog() +{ + QString s = tr("QtiPlot is open-source software and its development required hundreds of hours of work.

\ + If you like it, you're using it in your work and you would like to see it \ + constantly improved, please support its authors by making a donation.
"); + + QMessageBox *msg = new QMessageBox(this); + msg->setText(s); + msg->setWindowTitle(tr("Please support QtiPlot!")); + QPushButton *btn = msg->addButton(tr("Make a donation"), QMessageBox::AcceptRole); + msg->addButton(tr("Close"), QMessageBox::RejectRole); + msg->exec(); + if (msg->clickedButton() == btn) + showDonationsPage(); +} +#endif + +void ApplicationWindow::parseCommandLineArguments(const QStringList& args) +{ + int num_args = args.count(); + if(num_args == 0){ + initWindow(); + return; + } + + QString str; + bool exec = false; + bool noGui = false; + bool default_settings = false; + bool console = false; + foreach(str, args){ + if( (str == "-a" || str == "--about") || + (str == "-m" || str == "--manual") ){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr(" %1 : This command line option must be used without other arguments!").arg(str)); + } else if (str == "-c" || str == "--console") { + d_mdi_windows_area = false; + showScriptWindow(false); + setScriptingLanguage("Python"); + hide(); + console = true; + } + else if( (str == "-d" || str == "--default-settings")) + default_settings = true; + else if (str == "-v" || str == "--version"){ + QString s = versionString() + "\n"; + s += QString(copyright_string) + "\n"; + s += tr("Released") + ": " + release_date + "\n"; + #ifdef Q_OS_WIN + hide(); + QMessageBox::information(this, tr("QtiPlot") + " - " + tr("Version"), s); + #else + std::wcout << s.toStdWString(); + #endif + exit(0); + } + else if (str == "-h" || str == "--help"){ + QString s = "\n" + tr("Usage") + ": "; + s += "qtiplot [" + tr("options") + "] [" + tr("file") + "_" + tr("name") + "]\n\n"; + s += tr("Valid options are") + ":\n"; + s += "-a " + tr("or") + " --about: " + tr("show about dialog and exit") + "\n"; + s += "-c " + tr("or") + " --console: " + tr("show standalone scripting window") + "\n"; + s += "-d " + tr("or") + " --default-settings: " + tr("start QtiPlot with the default settings") + "\n"; + s += "-h " + tr("or") + " --help: " + tr("show command line options") + "\n"; + s += "-l=XX " + tr("or") + " --lang=XX: " + tr("start QtiPlot in language") + " XX ('en', 'fr', 'de', ...)\n"; + s += "-m " + tr("or") + " --manual: " + tr("show QtiPlot manual in a standalone window") + "\n"; + s += "-v " + tr("or") + " --version: " + tr("print QtiPlot version and release date") + "\n"; + s += "-x " + tr("or") + " --execute: " + tr("execute the script file given as argument") + "\n"; + s += "-X: " + tr("execute the script file given as argument without displying the user interface. Warning: 2D plots are not correctly handled in this functioning mode!") + "\n\n"; + s += "'" + tr("file") + "_" + tr("name") + "' " + tr("can be any .qti, qti.gz, .ods, .opj, .ogm, .ogw, .ogg, .py, .xls or ASCII file") + "\n"; + #ifdef Q_OS_WIN + hide(); + QMessageBox::information(this, tr("QtiPlot") + " - " + tr("Help"), s); + #else + std::wcout << s.toStdWString(); + #endif + exit(0); + } + else if (str.startsWith("--lang=") || str.startsWith("-l=")){ + QString locale = str.mid(str.find('=')+1); + if (locales.contains(locale)) + switchToLanguage(locale); + + if (!locales.contains(locale)) + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr(" %1 : Wrong locale option or no translation available!").arg(locale)); + } + else if (str.startsWith("--execute") || str.startsWith("-x")) + exec = true; + else if (str.startsWith("-X")) + noGui = true; + else if (str.startsWith("-") || str.startsWith("--")){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr(" %1 unknown command line option!").arg(str) + "\n" + tr("Type %1 to see the list of the valid options.").arg("'qtiplot -h'")); + } + } + + QString file_name = args[num_args-1]; // last argument + if(file_name.startsWith("-")){// no file name given + if (console) + return; + + initWindow(); + return; + } + + savedProject(); + + if (!file_name.isEmpty()){ + QFileInfo fi(file_name); + if (fi.isDir()){ + QMessageBox::critical(this, tr("QtiPlot - File openning error"), + tr("%1 is a directory, please specify a file name!").arg(file_name)); + return; + } else if (!fi.exists()){ + QMessageBox::critical(this, tr("QtiPlot - File openning error"), + tr("The file: %1 doesn't exist!").arg(file_name)); + return; + } else if (fi.exists() && !fi.isReadable()){ + QMessageBox::critical(this, tr("QtiPlot - File openning error"), + tr("You don't have the permission to open this file: %1").arg(file_name)); + return; + } + + workingDir = fi.dirPath(true); + saveSettings();//the recent projects must be saved + + if (console){ + scriptWindow->open(file_name); + if (exec) + scriptWindow->executeAll(); + } else if (exec || noGui) + loadScript(file_name, exec, noGui); + else { + ApplicationWindow *app = open(file_name, default_settings); + if (app && app != this) + close(); + } + } +} + +void ApplicationWindow::createLanguagesList() +{ + locales.clear(); + + appTranslator = new QTranslator(this); + qtTranslator = new QTranslator(this); + qApp->installTranslator(appTranslator); + qApp->installTranslator(qtTranslator); + + QString qmPath = d_translations_folder; + QDir dir(qmPath); + QStringList fileNames = dir.entryList("qtiplot_*.qm"); + for (int i=0; i < (int)fileNames.size(); i++) + { + QString locale = fileNames[i]; + locale = locale.mid(locale.find('_')+1); + locale.truncate(locale.find('.')); + locales.push_back(locale); + } + locales.push_back("en"); + locales.sort(); + + if (appLanguage != "en") + { + appTranslator->load("qtiplot_" + appLanguage, qmPath); + qtTranslator->load("qt_" + appLanguage, qmPath+"/qt"); + } +} + +void ApplicationWindow::switchToLanguage(int param) +{ + if (param < (int)locales.size()) + switchToLanguage(locales[param]); +} + +void ApplicationWindow::switchToLanguage(const QString& locale) +{ + if (!locales.contains(locale) || appLanguage == locale) + return; + + appLanguage = locale; + if (locale == "en") + { + qApp->removeTranslator(appTranslator); + qApp->removeTranslator(qtTranslator); + delete appTranslator; + delete qtTranslator; + appTranslator = new QTranslator(this); + qtTranslator = new QTranslator(this); + qApp->installTranslator(appTranslator); + qApp->installTranslator(qtTranslator); + } + else + { + QString qmPath = d_translations_folder; + appTranslator->load("qtiplot_" + locale, qmPath); + qtTranslator->load("qt_" + locale, qmPath+"/qt"); + } + insertTranslatedStrings(); +} + +QStringList ApplicationWindow::matrixNames() +{ + QStringList names; + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->isA("Matrix")) + names << w->objectName(); + } + f = f->folderBelow(); + } + return names; +} + +bool ApplicationWindow::alreadyUsedName(const QString& label) +{ + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->objectName() == label) + return true; + } + f = f->folderBelow(); + } + return false; +} + +bool ApplicationWindow::projectHas2DPlots() +{ + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->isA("MultiLayer")) + return true; + } + f = f->folderBelow(); + } + return false; +} + +void ApplicationWindow::appendProject() +{ + OpenProjectDialog *open_dialog = new OpenProjectDialog(this, false); + open_dialog->setDirectory(workingDir); + open_dialog->setExtensionWidget(0); + open_dialog->selectNameFilter(d_open_project_filter); + if (open_dialog->exec() != QDialog::Accepted || open_dialog->selectedFiles().isEmpty()) + return; + workingDir = open_dialog->directory().path(); + appendProject(open_dialog->selectedFiles()[0]); +} + +Folder* ApplicationWindow::appendProject(const QString& fn, Folder* parentFolder) +{ + if (fn.isEmpty()) + return 0; + + QFileInfo fi(fn); + workingDir = fi.dirPath(true); + + if (fn.endsWith(".qti") || fn.endsWith(".opj", Qt::CaseInsensitive) || fn.endsWith(".ogm", Qt::CaseInsensitive) || + fn.endsWith(".ogw", Qt::CaseInsensitive) || fn.endsWith(".ogg", Qt::CaseInsensitive) || + fn.endsWith(".xls", Qt::CaseInsensitive) || fn.endsWith(".ods", Qt::CaseInsensitive)){ + QFileInfo f(fn); + if (!f.exists ()){ + QMessageBox::critical(this, tr("QtiPlot - File opening error"), tr("The file: %1 doesn't exist!").arg(fn)); + return 0; + } + } else { + QMessageBox::critical(this,tr("QtiPlot - File opening error"), tr("The file: %1 is not a QtiPlot or Origin project file!").arg(fn)); + return 0; + } + + d_is_appending_file = true; + + if (fn != projectname) + updateRecentProjectsList(fn); + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QString fname = fn; + if (fn.contains(".qti.gz")){//decompress using zlib + file_uncompress((char *)fname.ascii()); + fname.remove(".gz"); + } + + Folder *cf = current_folder; + if (parentFolder) + changeFolder(parentFolder, true); + + FolderListItem *item = (FolderListItem *)current_folder->folderListItem(); + folders->blockSignals (true); + blockSignals (true); + + QString baseName = fi.baseName(); + QStringList lst = current_folder->subfolders(); + int n = lst.count(baseName); + if (n){//avoid identical subfolder names + while (lst.count(baseName + QString::number(n))) + n++; + baseName += QString::number(n); + } + + Folder *new_folder; + if (parentFolder) + new_folder = new Folder(parentFolder, baseName); + else + new_folder = new Folder(current_folder, baseName); + + current_folder = new_folder; + FolderListItem *fli = new FolderListItem(item, current_folder); + current_folder->setFolderListItem(fli); + +#ifdef OPJ_IMPORT + if (fn.contains(".opj", Qt::CaseInsensitive) || fn.contains(".ogm", Qt::CaseInsensitive) || + fn.contains(".ogw", Qt::CaseInsensitive) || fn.contains(".ogg", Qt::CaseInsensitive)) + ImportOPJ(this, fn); + else +#endif + if (fn.endsWith(".xls", Qt::CaseInsensitive)) + importExcel(fn); + else if (fn.endsWith(".ods", Qt::CaseInsensitive)) + importOdfSpreadsheet(fn); + else { + QFile f(fname); + QTextStream t( &f ); + t.setEncoding(QTextStream::UnicodeUTF8); + f.open(QIODevice::ReadOnly); + + QString s = t.readLine(); + lst = s.split(QRegExp("\\s"), QString::SkipEmptyParts); + QString version = lst[1]; + lst = version.split(".", QString::SkipEmptyParts); + d_file_version =100*(lst[0]).toInt()+10*(lst[1]).toInt()+(lst[2]).toInt(); + + t.readLine(); + if (d_file_version < 73) + t.readLine(); + + //process tables and matrix information + while ( !t.atEnd()){ + s = t.readLine(); + lst.clear(); + if (s.left(8) == ""){ + lst = s.split("\t"); + Folder *f = new Folder(current_folder, lst[1]); + f->setBirthDate(lst[2]); + f->setModificationDate(lst[3]); + if(lst.count() > 4) + if (lst[4] == "current") + cf = f; + + FolderListItem *fli = new FolderListItem(current_folder->folderListItem(), f); + fli->setText(0, lst[1]); + f->setFolderListItem(fli); + + current_folder = f; + }else if (s == "
"){ + while ( s!="
" ){ + s=t.readLine(); + lst<"){ + while ( s != "" ){ + s=t.readLine(); + lst<"){ + for (int i=0; i<3; i++){ + s = t.readLine(); + lst << s; + } + Note* m = openNote(this, lst); + QStringList cont; + while ( s != "" ){ + s = t.readLine(); + cont << s; + } + cont.pop_back(); + m->restore(cont); + } else if (s == "") + goToParentFolder(); + } + f.close(); + + //process the rest + f.open(QIODevice::ReadOnly); + + MultiLayer *plot=0; + while ( !t.atEnd()){ + s=t.readLine(); + if (s.left(8) == ""){ + lst = s.split("\t"); + if (current_folder && lst.size() >= 2) + current_folder = current_folder->findSubfolder(lst[1]); + }else if (s == ""){//process multilayers information + s=t.readLine(); + QStringList graph=s.split("\t"); + QString caption=graph[0]; + plot = multilayerPlot(caption, 0, graph[2].toInt(), graph[1].toInt()); + setListViewDate(caption, graph[3]); + plot->setBirthDate(graph[3]); + plot->blockSignals(true); + + restoreWindowGeometry(this, plot, t.readLine()); + + if (d_file_version > 71){ + QStringList lst = t.readLine().split("\t"); + if (lst.size() >= 3){ + plot->setWindowLabel(lst[1]); + plot->setCaptionPolicy((MdiSubWindow::CaptionPolicy)lst[2].toInt()); + } + } + + if (d_file_version > 83){ + QStringList lst=t.readLine().split("\t", QString::SkipEmptyParts); + plot->setMargins(lst[1].toInt(),lst[2].toInt(),lst[3].toInt(),lst[4].toInt()); + lst=t.readLine().split("\t", QString::SkipEmptyParts); + plot->setSpacing(lst[1].toInt(),lst[2].toInt()); + lst=t.readLine().split("\t", QString::SkipEmptyParts); + plot->setLayerCanvasSize(lst[1].toInt(),lst[2].toInt()); + lst=t.readLine().split("\t", QString::SkipEmptyParts); + plot->setAlignement(lst[1].toInt(),lst[2].toInt()); + } + + while ( s != "" ){//open layers + s = t.readLine(); + if (s.contains("")){ + QStringList lst = s.trimmed().remove("").remove("").split(","); + if (lst.size() >= 2) + plot->setWaterfallOffset(lst[0].toInt(), lst[1].toInt()); + if (lst.size() >= 3) + plot->setWaterfallSideLines(lst[2].toInt()); + plot->createWaterfallBox(); + } + if (s.left(7) == ""){ + lst.clear(); + while ( s != "" ){ + s = t.readLine(); + lst << s; + } + openGraph(this, plot, lst); + } + if (s.contains("")) + plot->linkXLayerAxes(s.trimmed().remove("").remove("").toInt()); + else if (s.contains("")) + plot->setAlignPolicy((MultiLayer::AlignPolicy)s.trimmed().remove("").remove("").toInt()); + } + plot->blockSignals(false); + }else if (s == ""){//process 3D plots information + lst.clear(); + while ( s!="" ){ + s = t.readLine(); + lst<") + goToParentFolder(); + } + f.close(); + } + + folders->blockSignals (false); + //change folder to user defined current folder + changeFolder(cf); + blockSignals (false); + renamedTables = QStringList(); + QApplication::restoreOverrideCursor(); + d_is_appending_file = false; + return new_folder; +} + +#ifdef QTIPLOT_DEMO +void ApplicationWindow::showDemoVersionMessage() +{ + saved = true; + QMessageBox::critical(this, tr("QtiPlot - Demo Version"), + tr("You are using the demonstration version of Qtiplot.\ + It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session.\ +

\ + If you want to have ready-to-use, fully functional binaries, please subscribe for a\ + single-user binaries maintenance contract.\ +

\ + QtiPlot is free software in the sense of free speech.\ + If you know how to use it, you can get\ + the source code\ + free of charge.\ + Nevertheless, you are welcome to\ + make a donation\ + in order to support the further development of QtiPlot.")); +} +#endif + +void ApplicationWindow::saveFolder(Folder *folder, const QString& fn, bool compress) +{ + QFile f( fn ); + if (d_backup_files && f.exists()) + {// make byte-copy of current file so that there's always a copy of the data on disk + while (!f.open(QIODevice::ReadOnly)){ + if (f.isOpen()) + f.close(); + int choice = QMessageBox::warning(this, tr("QtiPlot - File backup error"), + tr("Cannot make a backup copy of %1 (to %2).
If you ignore this, you run the risk of data loss.").arg(projectname).arg(projectname+"~"), + QMessageBox::Retry|QMessageBox::Default, QMessageBox::Abort|QMessageBox::Escape, QMessageBox::Ignore); + if (choice == QMessageBox::Abort) + return; + if (choice == QMessageBox::Ignore) + break; + } + + if (f.isOpen()){ + QString bfn = fn + "~"; + QFile::remove(bfn);//remove any existing backup + QFile::copy(fn, bfn); + f.close(); + } + } + + if ( !f.open( QIODevice::WriteOnly ) ){ + QMessageBox::about(this, tr("QtiPlot - File save error"), tr("The file:
%1 is opened in read-only mode").arg(fn)); + return; + } + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QList lst = folder->windowsList(); + int windows = lst.count(); + int initial_depth = folder->depth(); + Folder *dir = folder->folderBelow(); + while (dir && dir->depth() > initial_depth){ + windows += dir->windowsList().count(); + dir = dir->folderBelow(); + } + + QTextStream t( &f ); + t.setEncoding(QTextStream::UnicodeUTF8); + t << "QtiPlot " + QString::number(maj_version) + "." + QString::number(min_version) + "."+ + QString::number(patch_version) + " project file\n"; + t << "\t" + QString(scriptEnv->name()) + "\n"; + t << "\t" + QString::number(windows) + "\n"; + f.close(); + + foreach(MdiSubWindow *w, lst) + w->save(fn, windowGeometryInfo(w)); + + initial_depth = folder->depth(); + dir = folder->folderBelow(); + while (dir && dir->depth() > initial_depth){ + if (!f.isOpen()) + f.open(QIODevice::Append); + + t << "\t" + QString(dir->objectName()) + "\t" + dir->birthDate() + "\t" + dir->modificationDate(); + if (dir == current_folder) + t << "\tcurrent\n"; + else + t << "\n"; // FIXME: Having no 5th string here is not a good idea + t << "" + QString::number(dir->folderListItem()->isOpen()) + "\n"; + f.close(); + + lst = dir->windowsList(); + foreach(MdiSubWindow *w, lst) + w->save(fn, windowGeometryInfo(w)); + + if (!f.isOpen()) + f.open(QIODevice::Append); + + if (!dir->logInfo().isEmpty() ) + t << "\n" + dir->logInfo() + "\n" ; + + if ( (dir->children()).isEmpty() ) + t << "\n"; + + int depth = dir->depth(); + dir = dir->folderBelow(); + if (dir){ + int next_dir_depth = dir->depth(); + if (next_dir_depth < depth){ + int diff = depth - next_dir_depth; + for (int i = 0; i < diff; i++) + t << "
\n"; + } + } else { + int diff = depth - initial_depth - 1; + for (int i = 0; i < diff; i++) + t << "\n"; + } + } + + if (!f.isOpen()) + f.open(QIODevice::Append); + + t << "" + QString::number(folder->folderListItem()->isOpen()) + "\n"; + if (!folder->logInfo().isEmpty()) + t << "\n" + folder->logInfo() + "" ; + + f.close(); + + if (compress) + file_compress((char *)fn.ascii(), "wb9"); + + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::saveAsProject() +{ + saveFolderAsProject(current_folder); +} + +void ApplicationWindow::saveFolderAsProject(Folder *f) +{ +#ifdef QTIPLOT_DEMO + showDemoVersionMessage(); + return; +#endif + QString filter = tr("QtiPlot project")+" (*.qti);;"; + filter += tr("Compressed QtiPlot project")+" (*.qti.gz)"; + + QString selectedFilter; + QString fn = getFileName(this, tr("Save project as"), workingDir, filter, &selectedFilter, true, d_confirm_overwrite); + if ( !fn.isEmpty() ){ + QFileInfo fi(fn); + workingDir = fi.dirPath(true); + QString baseName = fi.fileName(); + if (!baseName.contains(".")) + fn.append(".qti"); + + saveFolder(f, fn, selectedFilter.contains(".gz")); + } +} + +void ApplicationWindow::showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, int) +{ + showFolderPopupMenu(it, p, true); +} + +void ApplicationWindow::showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, bool fromFolders) +{ + if (!it || folders->isRenaming()) + return; + + QMenu cm(this); + QMenu window(this); + QMenu viewWindowsMenu(this); + viewWindowsMenu.setCheckable ( true ); + + cm.addAction(actionFindWindow); + cm.insertSeparator(); + cm.addAction(actionAppendProject); + if (((FolderListItem *)it)->folder()->parent()) + cm.insertItem(QIcon(":/filesaveas.png"), tr("Save &As Project..."), this, SLOT(saveAsProject())); + else + cm.addAction(actionSaveProjectAs); + cm.insertSeparator(); + + if (fromFolders && show_windows_policy != HideAll) + { + cm.insertItem(tr("&Show All Windows"), this, SLOT(showAllFolderWindows())); + cm.insertItem(tr("&Hide All Windows"), this, SLOT(hideAllFolderWindows())); + cm.insertSeparator(); + } + + if (((FolderListItem *)it)->folder()->parent()) + { + cm.insertItem(QPixmap(":/close.png"), tr("&Delete Folder"), this, SLOT(deleteFolder()), Qt::Key_F8); + cm.insertItem(tr("&Rename"), this, SLOT(startRenameFolder()), Qt::Key_F2); + cm.insertSeparator(); + } + + if (fromFolders) + { + window.addAction(actionNewTable); + window.addAction(actionNewMatrix); + window.addAction(actionNewNote); + window.addAction(actionNewGraph); + window.addAction(actionNewFunctionPlot); + window.addAction(actionNewSurfacePlot); + cm.insertItem(tr("New &Window"), &window); + } + + cm.addAction(actionNewFolder); + cm.insertSeparator(); + + QStringList lst; + lst << tr("&None") << tr("&Windows in Active Folder") << tr("Windows in &Active Folder && Subfolders"); + for (int i = 0; i < 3; ++i) + { + int id = viewWindowsMenu.insertItem(lst[i],this, SLOT( setShowWindowsPolicy( int ) ) ); + viewWindowsMenu.setItemParameter( id, i ); + viewWindowsMenu.setItemChecked( id, show_windows_policy == i ); + } + cm.insertItem(tr("&View Windows"), &viewWindowsMenu); + cm.insertSeparator(); + cm.insertItem(tr("&Properties..."), this, SLOT(folderProperties())); + cm.exec(p); +} + +void ApplicationWindow::setShowWindowsPolicy(int p) +{ + if (show_windows_policy == (ShowWindowsPolicy)p) + return; + + show_windows_policy = (ShowWindowsPolicy)p; + if (show_windows_policy == HideAll){ + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + hiddenWindows->append(w); + w->hide(); + setListView(w->objectName(), tr("Hidden")); + } + } else + showAllFolderWindows(); +} + +void ApplicationWindow::showFindDialogue() +{ + FindDialog *fd = new FindDialog(this); + fd->exec(); +} + +void ApplicationWindow::startRenameFolder() +{ + FolderListItem *fi = current_folder->folderListItem(); + if (!fi) + return; + + disconnect(folders, SIGNAL(currentChanged(Q3ListViewItem *)), this, SLOT(folderItemChanged(Q3ListViewItem *))); + fi->setRenameEnabled (0, true); + fi->startRename (0); +} + +void ApplicationWindow::startRenameFolder(Q3ListViewItem *item) +{ + if (!item || item == folders->firstChild()) + return; + + if (item->listView() == lv && item->rtti() == FolderListItem::RTTI) { + disconnect(folders, SIGNAL(currentChanged(Q3ListViewItem *)), this, SLOT(folderItemChanged(Q3ListViewItem *))); + current_folder = ((FolderListItem *)item)->folder(); + FolderListItem *it = current_folder->folderListItem(); + it->setRenameEnabled (0, true); + it->startRename (0); + } else { + item->setRenameEnabled (0, true); + item->startRename (0); + } +} + +void ApplicationWindow::renameFolder(Q3ListViewItem *it, int col, const QString &text) +{ + Q_UNUSED(col) + + if (!it) + return; + + Folder *parent = (Folder *)current_folder->parent(); + if (!parent)//the parent folder is the project folder (it always exists) + parent = projectFolder(); + + while(text.isEmpty()){ + QMessageBox::critical(this,tr("QtiPlot - Error"), tr("Please enter a valid name!")); + it->setRenameEnabled (0, false); + it->setText(0, ((FolderListItem*)it)->folder()->objectName()); + return; + } + + QStringList lst = parent->subfolders(); + lst.remove(current_folder->objectName()); + while(lst.contains(text)){ + QMessageBox::critical(this,tr("QtiPlot - Error"), + tr("Name already exists!")+"\n"+tr("Please choose another name!")); + + it->setRenameEnabled (0, false); + it->setText(0, ((FolderListItem*)it)->folder()->objectName()); + return; + } + + current_folder->setObjectName(text); + it->setRenameEnabled (0, false); + connect(folders, SIGNAL(currentChanged(Q3ListViewItem *)), + this, SLOT(folderItemChanged(Q3ListViewItem *))); + folders->setCurrentItem(parent->folderListItem());//update the list views +} + +void ApplicationWindow::showAllFolderWindows() +{ + QList lst = current_folder->windowsList(); + foreach(MdiSubWindow *w, lst) + {//force show all windows in current folder + if (w) + { + updateWindowLists(w); + switch (w->status()) + { + case MdiSubWindow::Hidden: + w->showNormal(); + break; + + case MdiSubWindow::Normal: + w->showNormal(); + break; + + case MdiSubWindow::Minimized: + w->showMinimized(); + break; + + case MdiSubWindow::Maximized: + w->showMaximized(); + break; + } + } + } + + if ( (current_folder->children()).isEmpty() ) + return; + + FolderListItem *fi = current_folder->folderListItem(); + FolderListItem *item = (FolderListItem *)fi->firstChild(); + int initial_depth = item->depth(); + while (item && item->depth() >= initial_depth) + {// show/hide windows in all subfolders + lst = ((Folder *)item->folder())->windowsList(); + foreach(MdiSubWindow *w, lst){ + if (w && show_windows_policy == SubFolders){ + updateWindowLists(w); + switch (w->status()) + { + case MdiSubWindow::Hidden: + w->showNormal(); + break; + + case MdiSubWindow::Normal: + w->showNormal(); + break; + + case MdiSubWindow::Minimized: + w->showMinimized(); + break; + + case MdiSubWindow::Maximized: + w->showMaximized(); + break; + } + } + else + w->hide(); + } + + item = (FolderListItem *)item->itemBelow(); + } +} + +void ApplicationWindow::hideAllFolderWindows() +{ + QList lst = current_folder->windowsList(); + foreach(MdiSubWindow *w, lst) + hideWindow(w); + + if ( (current_folder->children()).isEmpty() ) + return; + + if (show_windows_policy == SubFolders) + { + FolderListItem *fi = current_folder->folderListItem(); + FolderListItem *item = (FolderListItem *)fi->firstChild(); + int initial_depth = item->depth(); + while (item && item->depth() >= initial_depth) + { + lst = item->folder()->windowsList(); + foreach(MdiSubWindow *w, lst) + hideWindow(w); + + item = (FolderListItem *)item->itemBelow(); + } + } +} + +void ApplicationWindow::projectProperties() +{ + QString s = QString(current_folder->objectName()) + "\n\n"; + s += "\n\n\n"; + s += tr("Type") + ": " + tr("Project")+"\n\n"; + if (projectname != "untitled") + { + s += tr("Path") + ": " + projectname + "\n\n"; + + QFileInfo fi(projectname); + s += tr("Size") + ": " + QString::number(fi.size()) + " " + tr("bytes")+ "\n\n"; + } + + s += tr("Contents") + ": " + QString::number(windowsList().size()) + " " + tr("windows"); + s += ", " + QString::number(current_folder->subfolders().count()) + " " + tr("folders") + "\n\n"; + s += "\n\n\n"; + + if (projectname != "untitled") + { + QFileInfo fi(projectname); + s += tr("Created") + ": " + fi.created().toString(Qt::LocalDate) + "\n\n"; + s += tr("Modified") + ": " + fi.lastModified().toString(Qt::LocalDate) + "\n\n"; + } + else + s += tr("Created") + ": " + current_folder->birthDate() + "\n\n"; + + QMessageBox *mbox = new QMessageBox ( tr("Properties"), s, QMessageBox::NoIcon, + QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton, this); + + mbox->setIconPixmap(QPixmap(":/qtiplot_logo.png" )); + mbox->show(); +} + +void ApplicationWindow::folderProperties() +{ + if (!current_folder->parent()) + { + projectProperties(); + return; + } + + QString s = QString(current_folder->objectName()) + "\n\n"; + s += "\n\n\n"; + s += tr("Type") + ": " + tr("Folder")+"\n\n"; + s += tr("Path") + ": " + current_folder->path() + "\n\n"; + s += tr("Size") + ": " + current_folder->sizeToString() + "\n\n"; + s += tr("Contents") + ": " + QString::number(current_folder->windowsList().count()) + " " + tr("windows"); + s += ", " + QString::number(current_folder->subfolders().count()) + " " + tr("folders") + "\n\n"; + //s += "\n\n\n"; + s += tr("Created") + ": " + current_folder->birthDate() + "\n\n"; + //s += tr("Modified") + ": " + current_folder->modificationDate() + "\n\n"; + + QMessageBox *mbox = new QMessageBox ( tr("Properties"), s, QMessageBox::NoIcon, + QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton, this); + + mbox->setIconPixmap(QPixmap(":/folder_open.png" )); + mbox->show(); +} + +void ApplicationWindow::addFolder() +{ + if (!explorerWindow->isVisible()) + explorerWindow->show(); + + QStringList lst = current_folder->subfolders(); + QString name = tr("New Folder"); + lst = lst.grep( name ); + if (!lst.isEmpty()) + name += " ("+ QString::number(lst.size()+1)+")"; + + Folder *f = new Folder(current_folder, name); + addFolderListViewItem(f); + + FolderListItem *fi = new FolderListItem(current_folder->folderListItem(), f); + if (fi){ + f->setFolderListItem(fi); + fi->setRenameEnabled (0, true); + fi->startRename(0); + } +} + +Folder* ApplicationWindow::addFolder(QString name, Folder* parent) +{ + if(!parent){ + if (current_folder) + parent = current_folder; + else + parent = projectFolder(); + } + + QStringList lst = parent->subfolders(); + lst = lst.grep( name ); + if (!lst.isEmpty()) + name += " ("+ QString::number(lst.size()+1)+")"; + + Folder *f = new Folder(parent, name); + addFolderListViewItem(f); + + FolderListItem *fi = new FolderListItem(parent->folderListItem(), f); + if (fi) + f->setFolderListItem(fi); + + return f; +} + +bool ApplicationWindow::deleteFolder(Folder *f) +{ + if (!f) + return false; + + if (confirmCloseFolder && QMessageBox::information(this, tr("QtiPlot - Delete folder?"), + tr("Delete folder '%1' and all the windows it contains?").arg(f->objectName()), + tr("Yes"), tr("No"), 0, 0)) + return false; + else { + Folder *parent = projectFolder(); + if (current_folder){ + if (current_folder->parent()) + parent = (Folder *)current_folder->parent(); + } + + folders->blockSignals(true); + + FolderListItem *fi = f->folderListItem(); + foreach(MdiSubWindow *w, f->windowsList()){ + w->askOnCloseEvent(false); + closeWindow(w); + } + + if (!(f->children()).isEmpty()){ + Folder *subFolder = f->folderBelow(); + int initial_depth = f->depth(); + while (subFolder && subFolder->depth() > initial_depth){ + foreach(MdiSubWindow *w, subFolder->windowsList()){ + removeWindowFromLists(w); + subFolder->removeWindow(w); + delete w; + } + delete subFolder->folderListItem(); + delete subFolder; + + subFolder = f->folderBelow(); + } + } + + delete f; + delete fi; + + current_folder = parent; + folders->setCurrentItem(parent->folderListItem()); + changeFolder(parent, true); + + folders->blockSignals(false); + folders->setFocus(); + return true; + } +} + +void ApplicationWindow::deleteFolder() +{ + Folder *parent = (Folder *)current_folder->parent(); + if (!parent) + parent = projectFolder(); + + folders->blockSignals(true); + + if (deleteFolder(current_folder)){ + current_folder = parent; + folders->setCurrentItem(parent->folderListItem()); + changeFolder(parent, true); + } + + folders->blockSignals(false); + folders->setFocus(); +} + +void ApplicationWindow::folderItemDoubleClicked(Q3ListViewItem *it) +{ + if (!it || it->rtti() != FolderListItem::RTTI) + return; + + FolderListItem *item = ((FolderListItem *)it)->folder()->folderListItem(); + folders->setCurrentItem(item); +} + +void ApplicationWindow::folderItemChanged(Q3ListViewItem *it) +{ + if (!it) + return; + + it->setOpen(true); + changeFolder (((FolderListItem *)it)->folder()); + folders->setFocus(); +} + +void ApplicationWindow::hideFolderWindows(Folder *f) +{ + if (!f) + return; + + QList lst = f->windowsList(); + foreach(MdiSubWindow *w, lst) + w->hide(); + + if ((f->children()).isEmpty()) + return; + + Folder *dir = f->folderBelow(); + int initial_depth = f->depth(); + while (dir && dir->depth() > initial_depth){ + lst = dir->windowsList(); + foreach(MdiSubWindow *w, lst) + w->hide(); + + dir = dir->folderBelow(); + } +} + +void ApplicationWindow::goToParentFolder() +{ + if (current_folder && current_folder->parent()) + current_folder = (Folder *)current_folder->parent(); + else + current_folder = projectFolder(); +} + +bool ApplicationWindow::changeFolder(Folder *newFolder, bool force) +{ + if (!newFolder) + return false; + + if (current_folder == newFolder && !force) + return false; + + disconnect(d_workspace, SIGNAL(subWindowActivated(QMdiSubWindow *)), + this, SLOT(windowActivated(QMdiSubWindow*))); + + desactivateFolders(); + newFolder->folderListItem()->setActive(true); + + Folder *oldFolder = current_folder; + MdiSubWindow::Status old_active_window_state = MdiSubWindow::Normal; + MdiSubWindow *old_active_window = oldFolder->activeWindow(); + if (old_active_window) + old_active_window_state = old_active_window->status(); + + MdiSubWindow::Status active_window_state = MdiSubWindow::Normal; + MdiSubWindow *active_window = newFolder->activeWindow(); + + if (active_window) + active_window_state = active_window->status(); + + hideFolderWindows(oldFolder); + current_folder = newFolder; + + results->setText(current_folder->logInfo()); + + lv->clear(); + + QObjectList folderLst = newFolder->children(); + if(!folderLst.isEmpty()){ + foreach(QObject *f, folderLst) + addFolderListViewItem(static_cast(f)); + } + + QList lst = newFolder->windowsList(); + foreach(MdiSubWindow *w, lst){ + if (!hiddenWindows->contains(w) && show_windows_policy != HideAll){ + //show only windows in the current folder which are not hidden by the user + if(w->status() == MdiSubWindow::Normal) + w->showNormal(); + else if(w->status() == MdiSubWindow::Minimized) + w->showMinimized(); + else if(w->status() == MdiSubWindow::Maximized) + w->showMaximized(); + } else + w->setStatus(MdiSubWindow::Hidden); + + addListViewItem(w); + } + + if (!(newFolder->children()).isEmpty()){ + Folder *f = newFolder->folderBelow(); + int initial_depth = newFolder->depth(); + while (f && f->depth() > initial_depth){//show/hide windows in subfolders + lst = f->windowsList(); + foreach(MdiSubWindow *w, lst){ + if (!hiddenWindows->contains(w)){ + if (show_windows_policy == SubFolders){ + if (w->status() == MdiSubWindow::Normal || w->status() == MdiSubWindow::Maximized) + w->showNormal(); + else if (w->status() == MdiSubWindow::Minimized) + w->showMinimized(); + } else + w->hide(); + } + } + f = f->folderBelow(); + } + } + + if (active_window){ + d_active_window = active_window; + d_workspace->setActiveSubWindow(active_window); + + if (active_window_state == MdiSubWindow::Minimized) + active_window->showMinimized();//ws->setActiveWindow() makes minimized windows to be shown normally + else if (active_window_state == MdiSubWindow::Maximized){ + if (active_window->isA("Graph3D")) + ((Graph3D *)active_window)->setIgnoreFonts(true); + active_window->showMaximized(); + if (active_window->isA("Graph3D")) + ((Graph3D *)active_window)->setIgnoreFonts(false); + } + } else + d_active_window = (MdiSubWindow *)d_workspace->activeSubWindow(); + + customMenu(d_active_window); + customToolBars(d_active_window); + + if (old_active_window){ + old_active_window->setStatus(old_active_window_state); + oldFolder->setActiveWindow(old_active_window); + } + + connect(d_workspace, SIGNAL(subWindowActivated(QMdiSubWindow *)), + this, SLOT(windowActivated(QMdiSubWindow*))); + + if (!d_opening_file) + modifiedProject(); + return true; +} + +void ApplicationWindow::desactivateFolders() +{ + FolderListItem *item = (FolderListItem *)folders->firstChild(); + while (item){ + item->setActive(false); + item = (FolderListItem *)item->itemBelow(); + } +} + +void ApplicationWindow::addListViewItem(MdiSubWindow *w) +{ + if (!w) + return; + + WindowListItem* it = new WindowListItem(lv, w); + if (w->isA("Matrix")){ + it->setPixmap(0, QPixmap(":/matrix.png")); + it->setText(1, tr("Matrix")); + } + else if (w->inherits("Table")){ + it->setPixmap(0, QPixmap(":/worksheet.png")); + it->setText(1, tr("Table")); + } + else if (w->isA("Note")){ + it->setPixmap(0, QPixmap(":/note.png")); + it->setText(1, tr("Note")); + } + else if (w->isA("MultiLayer")){ + it->setPixmap(0, QPixmap(":/graph.png")); + it->setText(1, tr("Graph")); + } + else if (w->isA("Graph3D")){ + it->setPixmap(0, QPixmap(":/trajectory.png")); + it->setText(1, tr("3D Graph")); + } + + it->setText(0, w->objectName()); + it->setText(2, w->aspect()); + it->setText(3, w->sizeToString()); + it->setText(4, w->birthDate()); + it->setText(5, w->windowLabel().replace("\n", " ")); + + updateCompleter(w->objectName()); +} + +void ApplicationWindow::windowProperties() +{ + WindowListItem *it = (WindowListItem *)lv->currentItem(); + MdiSubWindow *w = it->window(); + if (!w) + return; + + QMessageBox *mbox = new QMessageBox ( tr("Properties"), QString(), QMessageBox::NoIcon, + QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton, this); + + QString s = QString(w->objectName()) + "\n\n"; + s += "\n\n\n"; + + s += tr("Label") + ": " + ((MdiSubWindow *)w)->windowLabel() + "\n\n"; + + if (w->isA("Matrix")){ + mbox->setIconPixmap(QPixmap(":/matrix.png")); + s += tr("Type") + ": " + tr("Matrix") + "\n\n"; + }else if (w->inherits("Table")){ + mbox->setIconPixmap(QPixmap(":/worksheet.png")); + s += tr("Type") + ": " + tr("Table") + "\n\n"; + }else if (w->isA("Note")){ + mbox->setIconPixmap(QPixmap(":/note.png")); + s += tr("Type") + ": " + tr("Note") + "\n\n"; + }else if (w->isA("MultiLayer")){ + mbox->setIconPixmap(QPixmap(":/graph.png")); + s += tr("Type") + ": " + tr("Graph") + "\n\n"; + }else if (w->isA("Graph3D")){ + mbox->setIconPixmap(QPixmap(":/trajectory.png")); + s += tr("Type") + ": " + tr("3D Graph") + "\n\n"; + } + s += tr("Path") + ": " + current_folder->path() + "\n\n"; + s += tr("Size") + ": " + w->sizeToString() + "\n\n"; + s += tr("Created") + ": " + w->birthDate() + "\n\n"; + s += tr("Status") + ": " + it->text(2) + "\n\n"; + mbox->setText(s); + mbox->show(); +} + +void ApplicationWindow::addFolderListViewItem(Folder *f) +{ + if (!f) + return; + + FolderListItem* it = new FolderListItem(lv, f); + it->setActive(false); + it->setText(0, f->objectName()); + it->setText(1, tr("Folder")); + it->setText(3, f->sizeToString()); + it->setText(4, f->birthDate()); +} + +void ApplicationWindow::find(const QString& s, bool windowNames, bool labels, + bool folderNames, bool caseSensitive, bool partialMatch, bool subfolders) +{ + if (windowNames || labels){ + MdiSubWindow *w = current_folder->findWindow(s, windowNames, labels, caseSensitive, partialMatch); + if (w){ + activateWindow(w); + return; + } + + if (subfolders){ + FolderListItem *item = (FolderListItem *)folders->currentItem()->firstChild(); + while (item){ + Folder *f = item->folder(); + MdiSubWindow *w = f->findWindow(s,windowNames,labels,caseSensitive,partialMatch); + if (w){ + folders->setCurrentItem(f->folderListItem()); + activateWindow(w); + return; + } + item = (FolderListItem *)item->itemBelow(); + } + } + } + + if (folderNames){ + Folder *f = current_folder->findSubfolder(s, caseSensitive, partialMatch); + if (f){ + folders->setCurrentItem(f->folderListItem()); + return; + } + + if (subfolders){ + FolderListItem *item = (FolderListItem *)folders->currentItem()->firstChild(); + while (item){ + Folder *f = item->folder()->findSubfolder(s, caseSensitive, partialMatch); + if (f){ + folders->setCurrentItem(f->folderListItem()); + return; + } + + item = (FolderListItem *)item->itemBelow(); + } + } + } + + QMessageBox::warning(this, tr("QtiPlot - No match found"), + tr("Sorry, no match found for string: '%1'").arg(s)); +} + +void ApplicationWindow::dropFolderItems(Q3ListViewItem *dest) +{ + if (!dest || draggedItems.isEmpty ()) + return; + + Folder *dest_f = ((FolderListItem *)dest)->folder(); + + Q3ListViewItem *it; + QStringList subfolders = dest_f->subfolders(); + + foreach(it, draggedItems){ + if (it->rtti() == FolderListItem::RTTI){ + Folder *f = ((FolderListItem *)it)->folder(); + FolderListItem *src = f->folderListItem(); + if (dest_f == f){ + QMessageBox::critical(this, "QtiPlot - Error", tr("Cannot move an object to itself!")); + return; + } + + if (((FolderListItem *)dest)->isChildOf(src)){ + QMessageBox::critical(this,"QtiPlot - Error",tr("Cannot move a parent folder into a child folder!")); + draggedItems.clear(); + folders->setCurrentItem(current_folder->folderListItem()); + return; + } + + Folder *parent = (Folder *)f->parent(); + if (!parent) + parent = projectFolder(); + if (dest_f == parent) + return; + + if (subfolders.contains(f->objectName())){ + QMessageBox::critical(this, tr("QtiPlot") +" - " + tr("Skipped moving folder"), + tr("The destination folder already contains a folder called '%1'! Folder skipped!").arg(f->objectName())); + } else + moveFolder(src, (FolderListItem *)dest); + } else { + if (dest_f == current_folder) + return; + + hideFolderWindows(current_folder); + + MdiSubWindow *w = ((WindowListItem *)it)->window(); + if (w){ + current_folder->removeWindow(w); + w->hide(); + dest_f->addWindow(w); + dest_f->setActiveWindow(w); + delete it; + } + } + } + + draggedItems.clear(); + current_folder = dest_f; + folders->setCurrentItem(dest_f->folderListItem()); + changeFolder(dest_f, true); + folders->setFocus(); +} + +void ApplicationWindow::moveFolder(FolderListItem *src, FolderListItem *dest) +{ + folders->blockSignals(true); + if (copyFolder(src->folder(), dest->folder())){ + delete src->folder(); + delete src; + } + folders->blockSignals(false); +} + +bool ApplicationWindow::copyFolder(Folder *src, Folder *dest) +{ + if (!src || !dest) + return false; + + if (dest->subfolders().contains(src->objectName())){ + QMessageBox::critical(this, tr("QtiPlot") + " - " + tr("Error"), + tr("The destination folder already contains a folder called '%1'! Folder skipped!").arg(src->objectName())); + return false; + } + + Folder *dest_f = new Folder(dest, src->objectName()); + dest_f->setBirthDate(src->birthDate()); + dest_f->setModificationDate(src->modificationDate()); + + FolderListItem *copy_item = new FolderListItem(dest->folderListItem(), dest_f); + copy_item->setText(0, src->objectName()); + copy_item->setOpen(src->folderListItem()->isOpen()); + dest_f->setFolderListItem(copy_item); + + QList lst = QList(src->windowsList()); + foreach(MdiSubWindow *w, lst) + dest_f->addWindow(w); + + if (!(src->children()).isEmpty()){ + int initial_depth = src->depth(); + Folder *parentFolder = dest_f; + src = src->folderBelow(); + while (src && parentFolder && src->depth() > initial_depth){ + dest_f = new Folder(parentFolder, src->objectName()); + dest_f->setBirthDate(src->birthDate()); + dest_f->setModificationDate(src->modificationDate()); + + copy_item = new FolderListItem(parentFolder->folderListItem(), dest_f); + copy_item->setText(0, src->objectName()); + copy_item->setOpen(src->folderListItem()->isOpen()); + dest_f->setFolderListItem(copy_item); + + lst = QList(src->windowsList()); + foreach(MdiSubWindow *w, lst) + dest_f->addWindow(w); + + int depth = src->depth(); + src = src->folderBelow(); + if (src){ + int next_folder_depth = src->depth(); + if (next_folder_depth > depth) + parentFolder = dest_f; + else if (next_folder_depth < depth && next_folder_depth > initial_depth) + parentFolder = (Folder*)parentFolder->parent(); + } + } + } + return true; +} + +void ApplicationWindow::searchForUpdates() +{ + int choice = QMessageBox::question(this, tr("QtiPlot"), + tr("QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet!") + "\n" + + tr("Do you wish to continue?"), + QMessageBox::Yes|QMessageBox::Default, QMessageBox::No|QMessageBox::Escape); + + if (choice == QMessageBox::Yes){ + version_buffer.open(IO_WriteOnly); + http = new QHttp(this); + connect(http, SIGNAL(done(bool)), this, SLOT(receivedVersionFile(bool))); + + QNetworkProxy proxy = QNetworkProxy::applicationProxy(); + if (!proxy.hostName().isEmpty()) + http->setProxy(proxy.hostName(), proxy.port(), proxy.user(), proxy.password()); + + http->setHost("soft.proindependent.com"); + http->get("/version.txt", &version_buffer); + } +} + +void ApplicationWindow::receivedVersionFile(bool error) +{ + if (error){ + QMessageBox::warning(this, tr("QtiPlot - HTTP get version file"), + tr("Error while fetching version file with HTTP: %1.").arg(http->errorString())); + return; + } + + version_buffer.close(); + if (version_buffer.open(IO_ReadOnly)){ + QTextStream t( &version_buffer ); + t.setEncoding(QTextStream::UnicodeUTF8); + QString version = t.readLine(); + version_buffer.close(); + + QString currentVersion = QString::number(maj_version) + "." + QString::number(min_version) + + "." + QString::number(patch_version) + QString(extra_version); + + if (currentVersion != version){ + if(QMessageBox::question(this, tr("QtiPlot - Updates Available"), + tr("There is a newer version of QtiPlot (%1) available for download. Would you like to download it?").arg(version), + QMessageBox::Yes|QMessageBox::Default, QMessageBox::No|QMessageBox::Escape) == QMessageBox::Yes) + QDesktopServices::openUrl(QUrl("http://soft.proindependent.com/download.html")); + } else if (!autoSearchUpdatesRequest){ + QMessageBox::information(this, tr("QtiPlot - No Updates Available"), + tr("No updates available. Your current version %1 is the last version available!").arg(version)); + } + autoSearchUpdatesRequest = false; + } + http->abort(); + delete http; +} + +/*! + Turns 3D animation on or off + */ +void ApplicationWindow::toggle3DAnimation(bool on) +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->animate(on); +} + +QString ApplicationWindow::generateUniqueName(const QString& name, bool increment) +{ + int index = 0; + QStringList lst; + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + lst << QString(w->objectName()); + if (QString(w->objectName()).startsWith(name)) + index++; + } + f = f->folderBelow(); + } + + QString newName = name; + if (increment)//force return of a different name + newName += QString::number(++index); + else if (index>0) + newName += QString::number(index); + + while(lst.contains(newName)) + newName = name + QString::number(++index); + + return newName; +} + +void ApplicationWindow::clearTable() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + if (QMessageBox::question(this, tr("QtiPlot - Warning"), + tr("This will clear the contents of all the data associated with the table. Are you sure?"), + tr("&Yes"), tr("&No"), QString(), 0, 1 ) ) + return; + else + t->clear(); +} + +void ApplicationWindow::goToRow() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + if (!w->inherits("Table") && !w->isA("Matrix")) + return; + + int rows = 0; + if (w->inherits("Table")) + rows = ((Table *)w)->numRows(); + else if (w->isA("Matrix")) + rows = ((Matrix *)w)->numRows(); + + bool ok; + int row = QInputDialog::getInteger(this, tr("QtiPlot - Enter row number"), tr("Row"), + 1, 1, rows, 1, &ok, windowFlags() & ~Qt::WindowContextHelpButtonHint & ~Qt::WindowMinMaxButtonsHint ); + if ( !ok ) + return; + + if (w->inherits("Table")) + ((Table *)w)->goToRow(row); + else if (w->isA("Matrix")) + ((Matrix *)w)->goToRow(row); +} + +void ApplicationWindow::goToColumn() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + if (!w->inherits("Table") && !w->isA("Matrix")) + return; + + int columns = 0; + if (w->inherits("Table")) + columns = ((Table *)w)->numCols(); + else if (w->isA("Matrix")) + columns = ((Matrix *)w)->numCols(); + + bool ok; + int col = QInputDialog::getInt (this, tr("QtiPlot - Enter column number"), tr("Column"), + 1, 1, columns, 1, &ok, windowFlags() & ~Qt::WindowContextHelpButtonHint & ~Qt::WindowMinMaxButtonsHint ); + if ( !ok ) + return; + + if (w->inherits("Table")) + ((Table *)w)->goToColumn(col); + else if (w->isA("Matrix")) + ((Matrix *)w)->goToColumn(col); +} + +void ApplicationWindow::showScriptWindow(bool parent) +{ + if (!scriptWindow){ + scriptWindow = new ScriptWindow(scriptEnv, this); + if (d_completion && d_completer) + scriptWindow->editor()->setCompleter(d_completer); + scriptWindow->showLineNumbers(d_note_line_numbers); + scriptWindow->editor()->setTabStopWidth(d_notes_tab_length); + scriptWindow->editor()->setCurrentFont(d_notes_font); + scriptWindow->resize(d_script_win_rect.size()); + scriptWindow->move(d_script_win_rect.topLeft()); + connect(scriptWindow, SIGNAL(visibilityChanged(bool)), actionShowScriptWindow, SLOT(setOn(bool))); + } + + if (!parent) + scriptWindow->setAttribute(Qt::WA_DeleteOnClose); + + if (!scriptWindow->isVisible()){ + Qt::WindowFlags flags = 0; + if (d_script_win_on_top) + flags |= Qt::WindowStaysOnTopHint; + scriptWindow->setWindowFlags(flags); + scriptWindow->show(); + scriptWindow->setFocus(); + } else + scriptWindow->hide(); +} + +/*! + Turns perspective mode on or off + */ +void ApplicationWindow::togglePerspective(bool on) +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setOrthogonal(!on); +} + +/*! + Resets rotation of 3D plots to default values + */ +void ApplicationWindow::resetRotation() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setRotation(30, 0, 15); +} + +/*! + Finds best layout for the 3D plot + */ +void ApplicationWindow::fitFrameToLayer() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->findBestLayout(); +} + +ApplicationWindow::~ApplicationWindow() +{ + disableTools();//avoids crash if a plot tol is still active + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + MultiLayer *ml = qobject_cast(w); + if (ml && ml->hasSelectedLayers()) + delete ml; + } + + delete hiddenWindows; + + if (scriptWindow) + scriptWindow->close(); + + if (d_text_editor) + delete d_text_editor; + + QApplication::clipboard()->clear(QClipboard::Clipboard); + QApplication::restoreOverrideCursor(); +} + +QString ApplicationWindow::versionString() +{ + return "QtiPlot " + QString::number(maj_version) + "." + + QString::number(min_version) + "." + QString::number(patch_version) + extra_version; +} + + +int ApplicationWindow::convertOldToNewColorIndex(int cindex) +{ + if( (cindex == 13) || (cindex == 14) ) // white and light gray + return cindex + 4; + + if(cindex == 15) // dark gray + return cindex + 8; + + return cindex; +} + +void ApplicationWindow::cascade() +{ + const int xoffset = 13; + const int yoffset = 20; + int x = 0; + int y = 0; + QList windows = d_workspace->subWindowList(QMdiArea::StackingOrder); + foreach (QMdiSubWindow *w, windows){ + if (!w->isVisible()) + continue; + + w->setActiveWindow(); + ((MdiSubWindow *)w)->setNormal(); + w->setGeometry(x, y, w->geometry().width(), w->geometry().height()); + w->raise(); + x += xoffset; + y += yoffset; + } + modifiedProject(); +} + +ApplicationWindow * ApplicationWindow::loadScript(const QString& fn, bool execute, bool noGui) +{ +#ifdef SCRIPTING_PYTHON + if (noGui){ + hide(); + setScriptingLanguage("Python"); + + ScriptEdit *se = new ScriptEdit(scriptEnv, this); + se->importASCII(fn); + se->executeAll(); + + exit(0); + } else { + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + setScriptingLanguage("Python"); + restoreApplicationGeometry(); + + showScriptWindow(); + scriptWindow->open(fn); + + QApplication::restoreOverrideCursor(); + + if (execute){ + scriptWindow->hide(); + scriptWindow->executeAll(); + if (scriptWindow->editor()->error()) + showScriptWindow(); + } + return this; + } +#else + QMessageBox::critical(this, tr("QtiPlot") + " - " + tr("Error"), + tr("QtiPlot was not built with Python scripting support included!")); +#endif + return 0; +} + +bool ApplicationWindow::validFor2DPlot(Table *table, Graph::CurveType type) +{ + if (!table->selectedYColumns().count()){ + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select a Y column to plot!")); + return false; + } else if (type != Graph::Box && type != Graph::Histogram && type != Graph::Pie){ + if (table->numCols() < 2) { + QMessageBox::critical(this, tr("QtiPlot - Error"),tr("You need at least two columns for this operation!")); + return false; + } else if (table->noXColumn()) { + QMessageBox::critical(this, tr("QtiPlot - Error"), tr("Please set a default X column for this table, first!")); + return false; + } + } + return true; +} + +MultiLayer* ApplicationWindow::generate2DGraph(Graph::CurveType type) +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return 0; + + if (w->inherits("Table")){ + Table *table = static_cast(w); + if (!validFor2DPlot(table, type)) + return 0; + + Q3TableSelection sel = table->getSelection(); + return multilayerPlot(table, table->drawableColumnSelection(), type, sel.topRow(), sel.bottomRow()); + } else if (w->isA("Matrix")){ + Matrix *m = static_cast(w); + return plotHistogram(m); + } + return 0; +} + +bool ApplicationWindow::validFor3DPlot(Table *table) +{ + if (table->numCols()<2){ + QMessageBox::critical(0,tr("QtiPlot - Error"),tr("You need at least two columns for this operation!")); + return false; + } + if (table->selectedColumn() < 0 || table->colPlotDesignation(table->selectedColumn()) != Table::Z){ + QMessageBox::critical(0,tr("QtiPlot - Error"),tr("Please select a Z column for this operation!")); + return false; + } + if (table->noXColumn()){ + QMessageBox::critical(0,tr("QtiPlot - Error"),tr("You need to define a X column first!")); + return false; + } + if (table->noYColumn()){ + QMessageBox::critical(0,tr("QtiPlot - Error"),tr("You need to define a Y column first!")); + return false; + } + return true; +} + +void ApplicationWindow::hideSelectedWindows() +{ + Q3ListViewItem *item; + QList lst; + for (item = lv->firstChild(); item; item = item->nextSibling()){ + if (item->isSelected()) + lst.append(item); + } + + folders->blockSignals(true); + foreach(item, lst){ + if (item->rtti() != FolderListItem::RTTI) + hideWindow(((WindowListItem *)item)->window()); + } + folders->blockSignals(false); +} + +void ApplicationWindow::showSelectedWindows() +{ + Q3ListViewItem *item; + QList lst; + for (item = lv->firstChild(); item; item = item->nextSibling()){ + if (item->isSelected()) + lst.append(item); + } + + folders->blockSignals(true); + foreach(item, lst){ + if (item->rtti() != FolderListItem::RTTI) + activateWindow(((WindowListItem *)item)->window()); + } + folders->blockSignals(false); +} + +void ApplicationWindow::swapColumns() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + QStringList lst = t->selectedColumns(); + if(lst.count() != 2) + return; + + t->swapColumns(t->colIndex(lst[0]), t->colIndex(lst[1])); +} + +void ApplicationWindow::moveColumnRight() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (t) + t->moveColumnBy(1); +} + +void ApplicationWindow::moveColumnLeft() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (t) + t->moveColumnBy(-1); +} + +void ApplicationWindow::moveColumnFirst() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (t) + t->moveColumnBy(-t->selectedColumn()); +} + +void ApplicationWindow::moveColumnLast() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (t) + t->moveColumnBy(t->numCols() - t->selectedColumn() - 1); +} + +void ApplicationWindow::adjustColumnWidth() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (t) + t->adjustColumnsWidth(); +} + +void ApplicationWindow::moveTableRowUp() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (t) + t->moveRow(); +} + +void ApplicationWindow::moveTableRowDown() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (t) + t->moveRow(false); +} + +void ApplicationWindow::restoreApplicationGeometry() +{ + if (d_app_rect.isNull()) + showMaximized(); + else { + resize(d_app_rect.size()); + move(d_app_rect.topLeft()); + show(); + } +} + +void ApplicationWindow::scriptsDirPathChanged(const QString& path) +{ + scriptsDirPath = path; + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("Note")) + ((Note*)w)->setDirPath(path); + } +} + +void ApplicationWindow::showToolBarsMenu() +{ + QMenu toolBarsMenu; + + QAction *actionFileTools = new QAction(fileTools->windowTitle(), this); + actionFileTools->setCheckable(true); + actionFileTools->setChecked(fileTools->isVisible()); + connect(actionFileTools, SIGNAL(toggled(bool)), fileTools, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionFileTools); + + QAction *actionEditTools = new QAction(editTools->windowTitle(), this); + actionEditTools->setCheckable(true); + actionEditTools->setChecked(editTools->isVisible()); + connect(actionEditTools, SIGNAL(toggled(bool)), editTools, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionEditTools); + + QAction *actionNoteTools = new QAction(noteTools->windowTitle(), this); + actionNoteTools->setCheckable(true); + actionNoteTools->setChecked(noteTools->isVisible()); + connect(actionNoteTools, SIGNAL(toggled(bool)), noteTools, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionNoteTools); + + QAction *actionTableTools = new QAction(tableTools->windowTitle(), this); + actionTableTools->setCheckable(true); + actionTableTools->setChecked(tableTools->isVisible()); + connect(actionTableTools, SIGNAL(toggled(bool)), tableTools, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionTableTools); + + QAction *actionColumnTools = new QAction(columnTools->windowTitle(), this); + actionColumnTools->setCheckable(true); + actionColumnTools->setChecked(columnTools->isVisible()); + connect(actionColumnTools, SIGNAL(toggled(bool)), columnTools, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionColumnTools); + + QAction *actionPlotTools = new QAction(plotTools->windowTitle(), this); + actionPlotTools->setCheckable(true); + actionPlotTools->setChecked(plotTools->isVisible()); + connect(actionPlotTools, SIGNAL(toggled(bool)), plotTools, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionPlotTools); + + QAction *actionMatrixTools = new QAction(plotMatrixBar->windowTitle(), this); + actionMatrixTools->setCheckable(true); + actionMatrixTools->setChecked(plotMatrixBar->isVisible()); + connect(actionMatrixTools, SIGNAL(toggled(bool)), plotMatrixBar, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionMatrixTools); + + QAction *actionPlot3DTools = new QAction(plot3DTools->windowTitle(), this); + actionPlot3DTools->setCheckable(true); + actionPlot3DTools->setChecked(plot3DTools->isVisible()); + connect(actionPlot3DTools, SIGNAL(toggled(bool)), plot3DTools, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionPlot3DTools); + + QAction *actionDisplayBar = new QAction(displayBar->windowTitle(), this); + actionDisplayBar->setCheckable(true); + actionDisplayBar->setChecked(displayBar->isVisible()); + connect(actionDisplayBar, SIGNAL(toggled(bool)), displayBar, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionDisplayBar); + + QAction *actionFormatToolBar = new QAction(formatToolBar->windowTitle(), this); + actionFormatToolBar->setCheckable(true); + actionFormatToolBar->setChecked(formatToolBar->isVisible()); + connect(actionFormatToolBar, SIGNAL(toggled(bool)), formatToolBar, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionFormatToolBar); + + QAction *action = toolBarsMenu.exec(QCursor::pos()); + if (!action) + return; + + MdiSubWindow *w = activeWindow(); + + if (action->text() == plotMatrixBar->windowTitle()){ + d_matrix_tool_bar = action->isChecked(); + plotMatrixBar->setEnabled(w && w->isA("Matrix")); + } else if (action->text() == tableTools->windowTitle()){ + d_table_tool_bar = action->isChecked(); + tableTools->setEnabled(w && w->inherits("Table")); + } else if (action->text() == columnTools->windowTitle()){ + d_column_tool_bar = action->isChecked(); + columnTools->setEnabled(w && w->inherits("Table")); + } else if (action->text() == plotTools->windowTitle()){ + d_plot_tool_bar = action->isChecked(); + plotTools->setEnabled(w && w->isA("MultiLayer")); + } else if (action->text() == plot3DTools->windowTitle()){ + d_plot3D_tool_bar = action->isChecked(); + plot3DTools->setEnabled(w && w->isA("Graph3D")); + } else if (action->text() == fileTools->windowTitle()){ + d_file_tool_bar = action->isChecked(); + } else if (action->text() == editTools->windowTitle()){ + d_edit_tool_bar = action->isChecked(); + } else if (action->text() == displayBar->windowTitle()){ + d_display_tool_bar = action->isChecked(); + } else if (action->text() == formatToolBar->windowTitle()){ + d_format_tool_bar = action->isChecked(); + } else if (action->text() == noteTools->windowTitle()){ + d_notes_tool_bar = action->isChecked(); + } +} + +void ApplicationWindow::saveFitFunctions(const QStringList& lst) +{ + if (!lst.count()) + return; + + QString explain = tr("Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location."); + explain += " " + tr("If you want to save your already defined models, please choose a destination folder."); + if (QMessageBox::Ok != QMessageBox::information(this, tr("QtiPlot") + " - " + tr("Import fit models"), explain, + QMessageBox::Ok, QMessageBox::Cancel)) return; + + QString dir = QFileDialog::getExistingDirectory(this, tr("Choose a directory to export the fit models to"), fitModelsPath, QFileDialog::ShowDirsOnly); + if (!dir.isEmpty()){ + fitModelsPath = dir; + + for (int i = 0; isetFormula(l[1]); + + fit->save(fitModelsPath + "/" + fit->objectName() + ".fit"); + } + } + } +} + +void ApplicationWindow::matrixDirectFFT() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + m->fft(); +} + +void ApplicationWindow::matrixInverseFFT() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + m->fft(true); +} + +void ApplicationWindow::setFormatBarFont(const QFont& font) +{ + formatToolBar->setEnabled(true); + + QFontComboBox *fb = (QFontComboBox *)formatToolBar->widgetForAction(actionFontBox); + fb->blockSignals(true); + fb->setCurrentFont(font); + fb->blockSignals(false); + fb->setEnabled(true); + + QSpinBox *sb = (QSpinBox *)formatToolBar->widgetForAction(actionFontSize); + sb->blockSignals(true); + sb->setValue(font.pointSize()); + sb->blockSignals(false); + sb->setEnabled(true); + + actionFontBold->blockSignals(true); + actionFontBold->setChecked(font.bold()); + actionFontBold->blockSignals(false); + + actionFontItalic->blockSignals(true); + actionFontItalic->setChecked(font.italic()); + actionFontItalic->blockSignals(false); + + actionSubscript->setEnabled(false); + actionSuperscript->setEnabled(false); + actionUnderline->setEnabled(false); + actionGreekSymbol->setEnabled(false); + actionGreekMajSymbol->setEnabled(false); + actionMathSymbol->setEnabled(false); +} + +void ApplicationWindow::setFontSize(int size) +{ + QFontComboBox *fb = (QFontComboBox *)formatToolBar->widgetForAction(actionFontBox); + QFont f(fb->currentFont().family(), size); + f.setBold(actionFontBold->isChecked()); + f.setItalic(actionFontItalic->isChecked()); + + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (plot){ + Graph* g = plot->activeLayer(); + if (g) + g->setCurrentFont(f); + } + + Note *n = (Note *)activeWindow(NoteWindow); + if (n){ + d_notes_font = f; + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + Note *m = qobject_cast(w); + if (m) + m->setFont(f); + } + } +} + +void ApplicationWindow::setFontFamily(const QFont& font) +{ + QSpinBox *sb = (QSpinBox *)formatToolBar->widgetForAction(actionFontSize); + QFont f(font.family(), sb->value()); + f.setBold(actionFontBold->isChecked()); + f.setItalic(actionFontItalic->isChecked()); + + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (plot){ + Graph* g = plot->activeLayer(); + if (g) + g->setCurrentFont(f); + } + + Note *n = (Note *)activeWindow(NoteWindow); + if (n){ + d_notes_font = f; + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + Note *m = qobject_cast(w); + if (m) + m->setFont(f); + } + } +} + +void ApplicationWindow::setItalicFont(bool italic) +{ + QFontComboBox *fb = (QFontComboBox *)formatToolBar->widgetForAction(actionFontBox); + QSpinBox *sb = (QSpinBox *)formatToolBar->widgetForAction(actionFontSize); + QFont f(fb->currentFont().family(), sb->value()); + f.setBold(actionFontBold->isChecked()); + f.setItalic(italic); + + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (plot){ + Graph* g = plot->activeLayer(); + if (g) + g->setCurrentFont(f); + } + + Note *n = (Note *)activeWindow(NoteWindow); + if (n){ + d_notes_font = f; + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + Note *m = qobject_cast(w); + if (m) + m->setFont(f); + } + } +} + +void ApplicationWindow::setBoldFont(bool bold) +{ + QFontComboBox *fb = (QFontComboBox *)formatToolBar->widgetForAction(actionFontBox); + QSpinBox *sb = (QSpinBox *)formatToolBar->widgetForAction(actionFontSize); + QFont f(fb->currentFont().family(), sb->value()); + f.setBold(bold); + f.setItalic(actionFontItalic->isChecked()); + + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (plot){ + Graph* g = plot->activeLayer(); + if (g) + g->setCurrentFont(f); + } + + Note *n = (Note *)activeWindow(NoteWindow); + if (n){ + d_notes_font = f; + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + Note *m = qobject_cast(w); + if (m) + m->setFont(f); + } + } +} + +void ApplicationWindow::enableTextEditor(Graph *g) +{ + if (!g){ + formatToolBar->setEnabled(false); + if (d_text_editor){ + d_text_editor->close(); + d_text_editor = NULL; + } + } else if (g) { + if (!g->activeText() && !g->selectedScale() && !g->titleSelected()) + return; + + d_text_editor = new TextEditor(g); + + formatToolBar->setEnabled(true); + actionSubscript->setEnabled(true); + actionSuperscript->setEnabled(true); + actionUnderline->setEnabled(true); + actionGreekSymbol->setEnabled(true); + actionGreekMajSymbol->setEnabled(true); + actionMathSymbol->setEnabled(true); + } +} + +void ApplicationWindow::insertSuperscript() +{ + if (!d_text_editor) + return; + + d_text_editor->formatText("",""); +} + +void ApplicationWindow::insertSubscript() +{ + if (!d_text_editor) + return; + + d_text_editor->formatText("",""); +} + +void ApplicationWindow::underline() +{ + if (!d_text_editor) + return; + + d_text_editor->formatText("",""); +} + +void ApplicationWindow::insertGreekSymbol() +{ + if (!d_text_editor) + return; + + SymbolDialog *greekLetters = new SymbolDialog(SymbolDialog::lowerGreek, this); + connect(greekLetters, SIGNAL(addLetter(const QString&)), d_text_editor, SLOT(addSymbol(const QString&))); + greekLetters->exec(); +} + +void ApplicationWindow::insertGreekMajSymbol() +{ + if (!d_text_editor) + return; + + SymbolDialog *greekLetters = new SymbolDialog(SymbolDialog::upperGreek, this); + connect(greekLetters, SIGNAL(addLetter(const QString&)), d_text_editor, SLOT(addSymbol(const QString&))); + greekLetters->exec(); +} + +void ApplicationWindow::insertMathSymbol() +{ + if (!d_text_editor) + return; + + SymbolDialog *ms = new SymbolDialog(SymbolDialog::mathSymbols, this); + connect(ms, SIGNAL(addLetter(const QString&)), d_text_editor, SLOT(addSymbol(const QString&))); + ms->exec(); +} + +void ApplicationWindow::showCustomActionDialog() +{ + CustomActionDialog *ad = new CustomActionDialog(this); + ad->setAttribute(Qt::WA_DeleteOnClose); + ad->show(); + ad->setFocus(); +} + +void ApplicationWindow::addCustomAction(QAction *action, const QString& parentName, int index) +{ + if (!action) + return; + + QList toolBars = toolBarsList(); + foreach (QToolBar *t, toolBars){ + if (t->objectName() == parentName){ + if (action->icon().isNull()){ + QPixmap icon = QPixmap(16, 16); + QRect r = QRect(0, 0, 15, 15); + icon.fill (Qt::white); + QPainter p; + p.begin(&icon); + p.setPen(QPen(Qt::red, 2)); + p.drawLine(0, 0, 15, 15); + p.drawLine(0, 15, 15, 0); + p.setPen(QPen(Qt::black)); + p.drawRect(r); + action->setIcon(QIcon(icon)); + action->setIconText(tr("No Icon")); + } + t->addAction(action); + if (index < 0) + d_user_actions << action; + else if (index >= 0 && index < d_user_actions.size()) + d_user_actions.replace(index, action); + return; + } + } + + QList menus = customizableMenusList(); + menus += d_user_menus; + foreach (QMenu *m, menus){ + if (m->objectName() == parentName){ + if (action->icon().isNull()) + action->setIconText(tr("No Icon")); + m->addAction(action); + if (index < 0) + d_user_actions << action; + else if (index >= 0 && index < d_user_actions.size()) + d_user_actions.replace(index, action); + return; + } + } +} + +void ApplicationWindow::reloadCustomActions() +{ + reloadCustomMenus(); + + QList menus = customizableMenusList(); + foreach(QAction *a, d_user_actions){ + if (!a->statusTip().isEmpty()){ + foreach (QMenu *m, menus){ + if (m->objectName() == a->statusTip()){ + QList lst = m->actions(); + if (!lst.contains(a)) + m->addAction(a); + + break; + } + } + } + } +} + +void ApplicationWindow::removeCustomAction(QAction *action) +{ + int index = d_user_actions.indexOf(action); + if (index >= 0 && index < d_user_actions.count()){ + d_user_actions.removeAt(index); + delete action; + } +} + +void ApplicationWindow::performCustomAction(QAction *action) +{ + if (!action || !d_user_actions.contains(action)) + return; + +#ifdef SCRIPTING_PYTHON + QString lang = scriptEnv->name(); + setScriptingLanguage("Python"); + + ScriptEdit *script = new ScriptEdit(scriptEnv, 0); + script->importASCII(action->data().toString()); + script->executeAll(); + delete script; + + setScriptingLanguage(lang);// reset old scripting language +#else + QMessageBox::critical(this, tr("QtiPlot") + " - " + tr("Error"), + tr("QtiPlot was not built with Python scripting support included!")); +#endif +} + +void ApplicationWindow::loadCustomActions() +{ + QString path = customActionsDirPath + "/"; + QDir dir(path); + QStringList lst = dir.entryList(QDir::Files|QDir::NoSymLinks, QDir::Name); + for (int i = 0; i < lst.count(); i++){// parse menu files first + QString fileName = path + lst[i]; + QFile file(fileName); + QFileInfo fi(file); + if (!file.open(QFile::ReadOnly | QFile::Text)) + continue; + + if (fi.completeSuffix () != "qcm") + continue; + + CustomMenuHandler handler; + QXmlSimpleReader reader; + reader.setContentHandler(&handler); + reader.setErrorHandler(&handler); + + QXmlInputSource xmlInputSource(&file); + if (reader.parse(xmlInputSource)) + addCustomMenu(handler.title(), handler.location()); + } + + for (int i = 0; i < lst.count(); i++){// parse action files + QString fileName = path + lst[i]; + QFile file(fileName); + QFileInfo fi(file); + if (!file.open(QFile::ReadOnly | QFile::Text)) + continue; + + if (fi.completeSuffix () != "qca") + continue; + + QAction *action = new QAction(this); + CustomActionHandler handler(action); + QXmlSimpleReader reader; + reader.setContentHandler(&handler); + reader.setErrorHandler(&handler); + + QXmlInputSource xmlInputSource(&file); + if (reader.parse(xmlInputSource)) + addCustomAction(action, handler.parentName()); + } +} + +QList ApplicationWindow::customizableMenusList() +{ + QList lst; + lst << windowsMenu << view << graphMenu << fileMenu << format << edit; + lst << help << plot2DMenu; + lst << analysisMenu << multiPeakMenu << smoothMenu << filterMenu << decayMenu << normMenu; + lst << matrixMenu << plot3DMenu << plotDataMenu << scriptingMenu; + lst << tableMenu << fillMenu << newMenu << exportPlotMenu << importMenu; + return lst; +} + +QList ApplicationWindow::menusList() +{ + QList lst; + QObjectList children = this->children(); + foreach (QObject *w, children){ + if (w->isA("QMenu")) + lst << (QMenu *)w; + } + return lst; +} + +QList ApplicationWindow::toolBarsList() +{ + QList lst; + QObjectList children = this->children(); + foreach (QObject *w, children){ + if (w->isA("QToolBar")) + lst << (QToolBar *)w; + } + return lst; +} + +void ApplicationWindow::hideSelectedColumns() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (t) + t->hideSelectedColumns(); +} + +void ApplicationWindow::showAllColumns() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (t) + t->showAllColumns(); +} + +void ApplicationWindow::setMatrixUndoStackSize(int size) +{ + if (d_matrix_undo_stack_size == size) + return; + + d_matrix_undo_stack_size = size; + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->isA("Matrix")){ + QUndoStack *stack = ((Matrix *)w)->undoStack(); + if (!stack->count())// undo limit can only be changed for empty stacks + stack->setUndoLimit(size); + } + } + f = f->folderBelow(); + } +} + +QString ApplicationWindow::guessEndOfLine(const QString& sample) +{//Try to guess which end-of-line character is used: + if (sample.indexOf("\r\n") != -1)//Try \r\n first + return "\r\n"; + else if (sample.indexOf("\r") != -1)//then look for \r + return "\r"; + // use \n if neither \r\n nor \r have been found + return "\n"; +} + +QString ApplicationWindow::endOfLine() +{ + switch(d_eol){ + case LF: + return "\n"; + break; + case CRLF: + return "\r\n"; + break; + case CR: + return "\r"; + break; + } + return "\n"; +} + +void ApplicationWindow::initCompleter() +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QStringList words; +#ifdef SCRIPTING_PYTHON + if (scriptEnv->name() == QString("Python")){ + QString fn = d_python_config_folder + "/qti_wordlist.txt"; + QFile file(fn); + if (!file.open(QFile::ReadOnly)){ + QMessageBox::critical(this, tr("QtiPlot - Warning"), + tr("Couldn't load file: %1.\nAutocompletion will not be available!").arg(QFileInfo(file).absoluteFilePath())); + } else { + while (!file.atEnd()){ + QByteArray line = file.readLine(); + if (!line.isEmpty()){ + QString s = line.trimmed(); + if (!words.contains(s)) + words << s; + } + } + file.close(); + } + + words.append(PythonSyntaxHighlighter::keywordsList()); + + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows) + words << w->objectName(); + f = f->folderBelow(); + } + } +#endif + + QStringList functions = scriptEnv->mathFunctions(); + foreach(QString s, functions) + words.append(s); + + words.sort(); + + if (!d_completer){ + d_completer = new QCompleter(this); + d_completer->setModelSorting(QCompleter::CaseSensitivelySortedModel); + d_completer->setCompletionMode(QCompleter::PopupCompletion); + } + d_completer->setModel(new QStringListModel(words, d_completer)); + + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::enableCompletion(bool on) +{ + if (!d_completer || d_completion == on) + return; + + d_completion = on; + + if (scriptWindow){ + if (d_completion) + scriptWindow->editor()->setCompleter(d_completer); + else + scriptWindow->editor()->setCompleter(0); + } + + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if(w->isA("Note")){ + if (d_completion) + ((Note *)w)->currentEditor()->setCompleter(d_completer); + else + ((Note *)w)->currentEditor()->setCompleter(0); + } + } + f = f->folderBelow(); + } +} + +void ApplicationWindow::showFrequencyCountDialog() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + int validRows = 0; + int ts = t->table()->currentSelection(); + if (ts >= 0){ + Q3TableSelection sel = t->table()->selection(ts); + if (sel.numRows() > 1 && sel.numCols() == 1){ + int col = sel.leftCol(); + for (int i = sel.topRow(); i <= sel.bottomRow(); i++){ + if (!t->text(i, col).isEmpty()) + validRows++; + if (validRows > 1){ + FrequencyCountDialog *fcd = new FrequencyCountDialog(t, this); + fcd->exec(); + break; + } + } + } + } + if (validRows < 2) + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), + tr("Please select exactly one column and more than one non empty cell!")); +} + +Note * ApplicationWindow::newStemPlot() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return NULL; + + int ts = t->table()->currentSelection(); + if (ts < 0) + return NULL; + + Note *n = newNote(); + if (!n) + return NULL; + n->hide(); + + ScriptEdit* editor = n->currentEditor(); + QStringList lst = t->selectedColumns(); + if (lst.isEmpty()){ + Q3TableSelection sel = t->table()->selection(ts); + for (int i = sel.leftCol(); i <= sel.rightCol(); i++) + editor->insertPlainText(stemPlot(t, t->colName(i), 1001, sel.topRow() + 1, sel.bottomRow() + 1) + "\n"); + } else { + for (int i = 0; i < lst.count(); i++) + editor->insertPlainText(stemPlot(t, lst[i], 1001) + "\n"); + } + + n->show(); + return n; +} + +QString ApplicationWindow::stemPlot(Table *t, const QString& colName, int power, int startRow, int endRow) +{ + if (!t) + return QString(); + + int col = t->colIndex(colName); + if (col < 0){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("Data set: %1 doesn't exist!").arg(colName)); + return QString(); + } + + startRow--; + endRow--; + if (startRow < 0 || startRow >= t->numRows()) + startRow = 0; + if (endRow < 0 || endRow >= t->numRows()) + endRow = t->numRows() - 1; + + QString result = tr("Stem and leaf plot of dataset") + ": " + colName + " "; + result += tr("from row") + ": " + QString::number(startRow + 1) + " "; + result += tr("to row") + ": " + QString::number(endRow + 1) + "\n"; + + int rows = 0; + for (int j = startRow; j <= endRow; j++){ + if (!t->text(j, col).isEmpty()) + rows++; + } + + if (rows >= 1){ + double *data = (double *)malloc(rows * sizeof (double)); + if (!data){ + result += tr("Not enough memory for this dataset!") + "\n"; + return result; + } + + result += "\n" + tr("Stem") + " | " + tr("Leaf"); + result += "\n---------------------\n"; + + int row = 0; + for (int j = startRow; j <= endRow; j++){ + if (!t->text(j, col).isEmpty()){ + data[row] = t->cell(j, col); + row++; + } + } + gsl_sort (data, 1, rows); + + if (power > 1e3){ + power = std::ceil(log10(data[rows - 1] - data[0]) - log10(rows - 1)); + bool ok; + int input = QInputDialog::getInteger(this, tr("Please confirm the stem unit!"), + tr("Data set") + ": " + colName + ", " + tr("stem unit") + " = 10n, n = ", + power, -1000, 1000, 1, &ok); + if (ok) + power = input; + } + + double stem_unit = pow(10.0, power); + double leaf_unit = stem_unit/10.0; + + int prev_stem = int(data[0]/stem_unit); + result += " " + QString::number(prev_stem) + " | "; + + for (int j = 0; j objectName()){ + QMenu *menu = menuBar()->addMenu(title); + if (menu){ + menu->setObjectName(title); + d_user_menus.append(menu); + connect(menu, SIGNAL(triggered(QAction *)), this, SLOT(performCustomAction(QAction *))); + return menu; + } + } + + QList menus = customizableMenusList(); + foreach (QMenu *m, menus){ + if (m->objectName() == parentName){ + QMenu *menu = m->addMenu(title); + if (menu){ + menu->setObjectName(title); + d_user_menus.append(menu); + return menu; + } + } + } + return NULL; +} + +void ApplicationWindow::removeCustomMenu(const QString& title) +{ + foreach (QMenu *m, d_user_menus){ + if (m->objectName() == title){ + int index = d_user_menus.indexOf(m); + if (index >= 0 && index < d_user_menus.count()){ + d_user_menus.removeAt(index); + delete m; + return; + } + } + } +} + +void ApplicationWindow::reloadCustomMenus() +{ + foreach(QMenu *m, d_user_menus){ + QWidget *parent = m->parentWidget(); + if (parent && !parent->children().contains(m)) + ((QMenu *)parent)->addMenu(m); + } +} + +QColor ApplicationWindow::readColorFromProject(const QString& name) +{ + QColor c = QColor(); + bool canConvertToInt = false; + int fillColIndex = name.toInt(&canConvertToInt); + if (canConvertToInt){ + if (fillColIndex < 0) + return c; + if (d_file_version <= 89) + fillColIndex = convertOldToNewColorIndex(fillColIndex); + c = ColorBox::defaultColor(fillColIndex); + } else + c = QColor(name); + + return c; +} + +void ApplicationWindow::enableMdiArea(bool on) +{ + if (d_mdi_windows_area == on) + return; + + d_mdi_windows_area = on; + + if (on){ + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows) + d_workspace->addSubWindow(w); + } else { + QList windows = d_workspace->subWindowList(); + foreach(QMdiSubWindow *w, windows){ + d_workspace->removeSubWindow(w); + w->show(); + } + } +} + +void ApplicationWindow::memoryAllocationError() +{ + QMessageBox::critical(0, tr("QtiPlot") + " - " + tr("Memory Allocation Error"), + tr("Not enough memory, operation aborted!")); +} + +void ApplicationWindow::increasePrecision() +{ + Matrix *m = (Matrix *)activeWindow(MatrixWindow); + if (!m) + return; + + int oldPrec = m->precision(); + if (oldPrec == 13) + return; + + int prec = oldPrec + 1; + QChar format = m->textFormat(); + m->undoStack()->push(new MatrixSetPrecisionCommand(m, format, format, + oldPrec, prec, tr("Set Precision %1 digits").arg(prec))); + m->setNumericPrecision(prec); +} + +void ApplicationWindow::decreasePrecision() +{ + Matrix *m = (Matrix *)activeWindow(MatrixWindow); + if (!m) + return; + + int oldPrec = m->precision(); + if (oldPrec == 0) + return; + + int prec = oldPrec - 1; + QChar format = m->textFormat(); + m->undoStack()->push(new MatrixSetPrecisionCommand(m, format, format, + oldPrec, prec, tr("Set Precision %1 digits").arg(prec))); + m->setNumericPrecision(prec); +} + +void ApplicationWindow::commentSelection() +{ + Note *note = (Note *)activeWindow(NoteWindow); + if (!note || !note->currentEditor()) + return; + + note->currentEditor()->commentSelection(); +} + +void ApplicationWindow::uncommentSelection() +{ + Note *note = (Note *)activeWindow(NoteWindow); + if (!note || !note->currentEditor()) + return; + + note->currentEditor()->uncommentSelection(); +} + +void ApplicationWindow::execute() +{ + Note *note = (Note *)activeWindow(NoteWindow); + if (!note) + return; + + note->execute(); +} + +void ApplicationWindow::executeAll() +{ + Note *note = (Note *)activeWindow(NoteWindow); + if (!note) + return; + + note->executeAll(); +} + +void ApplicationWindow::evaluate() +{ + Note *note = (Note *)activeWindow(NoteWindow); + if (!note) + return; + + note->evaluate(); +} + +void ApplicationWindow::addWindowsListToCompleter() +{ +#ifdef SCRIPTING_PYTHON + if (scriptEnv->name() != QString("Python")) + return; + + if (!d_completer) + return; + + QStringListModel *model = qobject_cast (d_completer->model()); + if (!model) + return; + + QStringList lst = model->stringList(); + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows) + lst << w->objectName(); + f = f->folderBelow(); + } + lst.sort(); + model->setStringList(lst); +#endif +} + +void ApplicationWindow::updateCompleter(const QString& windowName, bool remove, const QString& newName) +{ +#ifdef SCRIPTING_PYTHON + if (scriptEnv->name() != QString("Python")) + return; + + if (!d_completer || d_is_appending_file || d_opening_file) + return; + + QStringListModel *model = qobject_cast (d_completer->model()); + if (!model) + return; + + QStringList lst = model->stringList(); + + if (newName.isEmpty()){ + if (remove) + lst.removeAll(windowName); + else + lst.append(windowName); + } else { + int index = lst.indexOf(windowName); + if (index >= 0) + lst.replace(index, newName); + } + + lst.sort(); + model->setStringList(lst); +#endif +} + +#ifdef SCRIPTING_PYTHON +void ApplicationWindow::openQtDesignerUi() +{ + QString fn = getFileName(this, tr("QtiPlot") + " - " + tr("Choose custom user interface"), workingDir, "*.ui", 0, false); + if (!fn.isEmpty()){ + QFileInfo fi(fn); + workingDir = fi.dirPath(true); + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + setScriptingLanguage("Python"); + + QString script = "# " + tr("Custom user interfaces can be created using the QtDesigner application provided by the Qt framework") + ":\n"; + script += "# http://qt.nokia.com\n"; + script += "# " + tr("For more details about how to use .ui files in your Python scripts please read the PyQt4 documentation") + ":\n"; + script += "# http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#using-the-generated-code\n"; + script += "##############################################################################################\n"; + script += "from PyQt4 import uic\n"; + script += "global ui\n"; + script += "ui = uic.loadUi(\"" + fn + "\")\n"; + script += "ui.show()\n"; + + Note *note = newNote(); + note->setText(script); + note->executeAll(); + + QApplication::restoreOverrideCursor(); + } +} +#endif + +#ifdef BROWSER_PLUGIN +QTNPFACTORY_BEGIN("QtiPlot Browser Plugin", "A Qt-based NSAPI plug-in application that graphs numeric data"); + QTNPCLASS(ApplicationWindow) +QTNPFACTORY_END() +#endif + +#ifdef QAXSERVER +#include +QAXFACTORY_BEGIN("{89ab08da-df8c-4bd0-8327-72f73741c1a6}", "{082bd921-0832-4ca7-ab5a-ec06ca7f3350}") + QAXCLASS(ApplicationWindow) +QAXFACTORY_END() +#endif === added file '.pc/applied-patches' --- .pc/applied-patches 1970-01-01 00:00:00 +0000 +++ .pc/applied-patches 2010-07-21 23:41:24 +0000 @@ -0,0 +1,3 @@ +01_build_system.diff +02_fix_paths.diff +debian-changes-0.9.7.14-1 === added directory '.pc/debian-changes-0.9.7.14-1' === added file '.pc/debian-changes-0.9.7.14-1/qtiplot_0.9.7.14-1_amd64.build' === removed directory '3rdparty/liborigin' === removed file '3rdparty/liborigin/FORMAT' --- 3rdparty/liborigin/FORMAT 2009-12-08 18:06:27 +0000 +++ 3rdparty/liborigin/FORMAT 1970-01-01 00:00:00 +0000 @@ -1,77 +0,0 @@ -Origin 7.5 column value display -############################### -Numeric, Text&Numeric: - Decimal:1000 = 0 - Scientific:1E3 = 1 - Engeneering:1k = 2 - Decimal:1,000 = 3 - -Time: - hh:mm = 0 - hh = 1 - hh:mm:ss = 2 - hh:mm:ss.zz = 3 - hh ap = 4 - hh:mm ap = 5 - mm:ss = 6 - mm:ss.zz = 7 - hhmm = 8 - hhmmss = 9 - hh:mm:ss.zzz = 10 - -Date: - dd/MM/yyyy = -128 - dd/MM/yyyy HH:mm = -119 - dd/MM/yyyy HH:mm:ss = -118 - dd.MM.yyyy = 0 - y. = 1 (year abbreviation - for instance, '.' in russian) - MMM d = 2 - M/d = 3 - d = 4 - ddd = 5 - F = 6 (first letter of day of week) - yyyy = 7 - yy = 8 - dd.MM.yyyy hh:mm = 9 - dd.MM.yyyy hh:mm:ss = 10 - yyMMdd = 11 - yyMMdd hh:mm = 12 - yyMMdd hh:mm:ss = 13 - yyMMdd hhmm = 14 - yyMMdd hhmmss = 15 - MMM = 16 - J = 17 (first letter of month) - Q1 = 18 (quartal) - M-d-yyyy (Custom1) = 19 - hh:mm:ss.zzzz (Custom2) = 20 - -Month: - MMM = 0 - MMMM = 1 - J = 2 (first letter of month) - -Day of Week: - ddd = 0 - dddd = 1 - F = 2 (first letter of day of week) - -Fill Area Patterns - none = 0 - /// = 1 - / / = 2 - / = 3 - \\\ = 4 - \ \ = 5 - \ = 6 - xxx = 7 - x x = 8 - x = 9 - --- = 10 - - - = 11 - - = 12 - ||| = 13 - | | = 14 - | = 15 - +++ = 16 - + + = 17 - + = 18 === removed file '3rdparty/liborigin/Origin750Parser.cpp' --- 3rdparty/liborigin/Origin750Parser.cpp 2009-11-18 10:33:29 +0000 +++ 3rdparty/liborigin/Origin750Parser.cpp 1970-01-01 00:00:00 +0000 @@ -1,2413 +0,0 @@ -/*************************************************************************** - File : Origin750Parser.cpp - -------------------------------------------------------------------- - Copyright : (C) 2007-2008 Alex Kargovsky, Stefan Gerlach, - Ion Vasilief - Email (use @ for *) : kargovsky*yumr.phys.msu.su, ion_vasilief*yahoo.fr - Description : Origin 7.5 file parser class - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#include "Origin750Parser.h" -#include -#include -#include -#include -#include -#include - -using namespace boost; - -const char* colTypeNames[] = {"X", "Y", "Z", "XErr", "YErr", "Label", "None"}; - -inline boost::posix_time::ptime doubleToPosixTime(double jdt) -{ - return boost::posix_time::ptime(boost::gregorian::date(boost::gregorian::gregorian_calendar::from_julian_day_number(jdt+1)), boost::posix_time::seconds((jdt-(int)jdt)*86400)); -} - -Origin750Parser::Origin750Parser(const string& fileName) -: file(fileName.c_str(), ios::binary) -{ - objectIndex = 0; -} - -bool Origin750Parser::parse() -{ - unsigned int dataIndex = 0; - - stringstream out; - unsigned char c; - /////////////////// find column /////////////////////////////////////////////////////////// - file.seekg(0x10 + 1, ios_base::beg); - unsigned int size; - file >> size; - file.seekg(1 + size + 1 + 5, ios_base::cur); - - file >> size; - - file.seekg(1, ios_base::cur); - BOOST_LOG_(1, format(" [column found = %d/0x%X @ 0x%X]") % size % size % (unsigned int) file.tellg()); - - unsigned int colpos = file.tellg(); - unsigned int current_col = 1, nr = 0, nbytes = 0; - - while(size > 0 && size < 0x84) { // should be 0x72, 0x73 or 0x83 - //////////////////////////////// COLUMN HEADER ///////////////////////////////////////////// - short data_type; - char data_type_u; - unsigned int oldpos = file.tellg(); - - file.seekg(oldpos + 0x16, ios_base::beg); - file >> data_type; - - file.seekg(oldpos + 0x3F, ios_base::beg); - file >> data_type_u; - - char valuesize; - file.seekg(oldpos + 0x3D, ios_base::beg); - file >> valuesize; - - BOOST_LOG_(1, format(" [valuesize = %d @ 0x%X]") % (int)valuesize % ((unsigned int) file.tellg()-1)); - if(valuesize <= 0) - { - BOOST_LOG_(1, format(" WARNING : found strange valuesize of %d") % (int)valuesize); - valuesize = 10; - } - - file.seekg(oldpos + 0x58, ios_base::beg); - BOOST_LOG_(1, format(" [Spreadsheet @ 0x%X]") % (unsigned int) file.tellg()); - - string name(25, 0); - file >> name; - - string::size_type pos = name.find_last_of("_"); - string columnname; - if(pos != string::npos) - { - columnname = name.substr(pos + 1); - name.resize(pos); - } - BOOST_LOG_(1, format(" NAME: %s") % name.c_str()); - - unsigned int spread = 0; - if(columnname.empty()) - { - BOOST_LOG_(1, "NO COLUMN NAME FOUND! Must be a Matrix or Function."); - ////////////////////////////// READ matrixes or functions //////////////////////////////////// - - BOOST_LOG_(1, format(" [position @ 0x%X]") % (unsigned int) file.tellg()); - // TODO - short signature; - file >> signature; - BOOST_LOG_(1, format(" SIGNATURE : %02X ") % signature); - - - file.seekg(oldpos + size + 1, ios_base::beg); - file >> size; - file.seekg(1, ios_base::cur); - size /= valuesize; - BOOST_LOG_(1, format(" SIZE = %d") % size); - - // catch exception - /*if(size>10000) - size=1000;*/ - - switch(signature) - { - case 0x50CA: - case 0x70CA: - case 0x50F2: - case 0x50E2: - case 0x50C8: - case 0x50E7: - BOOST_LOG_(1, "NEW MATRIX"); - matrixes.push_back(Matrix(name, dataIndex)); - ++dataIndex; - - BOOST_LOG_(1, "VALUES :"); - out.str(size > 100 ? "matrix too big..." : string()); - switch(data_type) - { - case 0x6001://double - for(unsigned int i = 0; i < size; ++i) - { - double value; - file >> value; - matrixes.back().data.push_back((double)value); - if(size < 100) - out << format("%g ") % matrixes.back().data.back(); - } - BOOST_LOG_(1, out.str()); - break; - case 0x6003://float - for(unsigned int i = 0; i < size; ++i) - { - float value; - file >> value; - matrixes.back().data.push_back((double)value); - if(size < 100) - out << format("%g ") % matrixes.back().data.back(); - } - BOOST_LOG_(1, out.str()); - break; - case 0x6801://int - if(data_type_u == 8)//unsigned - { - for(unsigned int i = 0; i < size; ++i) - { - unsigned int value; - file >> value; - matrixes.back().data.push_back((double)value); - if(size < 100) - out << format("%g ") % matrixes.back().data.back(); - } - BOOST_LOG_(1, out.str()); - } - else - { - for(unsigned int i = 0; i < size; ++i) - { - int value; - file >> value; - matrixes.back().data.push_back((double)value); - if(size < 100) - out << format("%g ") % matrixes.back().data.back(); - } - BOOST_LOG_(1, out.str()); - } - break; - case 0x6803://short - if(data_type_u == 8)//unsigned - { - for(unsigned int i = 0; i < size; ++i) - { - unsigned short value; - file >> value; - matrixes.back().data.push_back((double)value); - if(size < 100) - out << format("%g ") % matrixes.back().data.back(); - } - BOOST_LOG_(1, out.str()); - } - else - { - for(unsigned int i = 0; i < size; ++i) - { - short value; - file >> value; - matrixes.back().data.push_back((double)value); - if(size < 100) - out << format("%g ") % matrixes.back().data.back(); - } - BOOST_LOG_(1, out.str()); - } - break; - case 0x6821://char - if(data_type_u == 8)//unsigned - { - for(unsigned int i = 0; i < size; ++i) - { - unsigned char value; - file >> value; - matrixes.back().data.push_back((double)value); - if(size < 100) - out << format("%g ") % matrixes.back().data.back(); - } - BOOST_LOG_(1, out.str()); - } - else - { - for(unsigned int i = 0; i < size; ++i) - { - char value; - file >> value; - matrixes.back().data.push_back((double)value); - if(size < 100) - out << format("%g ") % matrixes.back().data.back(); - } - BOOST_LOG_(1, out.str()); - } - break; - default: - BOOST_LOG_(1, format("UNKNOWN MATRIX DATATYPE: %02X SKIP DATA") % data_type); - file.seekg(valuesize*size, ios_base::cur); - matrixes.pop_back(); - } - break; - case 0x10C8: - BOOST_LOG_(1, "NEW FUNCTION"); - functions.push_back(Function(name, dataIndex)); - ++dataIndex; - - file >> functions.back().formula.assign(valuesize, 0); - oldpos = file.tellg(); - short t; - - file.seekg(colpos + 0xA, ios_base::beg); - file >> t; - - if(t == 0x1194) - functions.back().type = Function::Polar; - - file.seekg(colpos + 0x21, ios_base::beg); - file >> functions.back().totalPoints; - - file >> functions.back().begin; - double d; - file >> d; - functions.back().end = functions.back().begin + d*(functions.back().totalPoints - 1); - - BOOST_LOG_(1, format("FUNCTION %s : %s") % functions.back().name.c_str() % functions.back().formula.c_str()); - BOOST_LOG_(1, format(" interval %g : %g, number of points %d") % functions.back().begin % functions.back().end % functions.back().totalPoints); - - file.seekg(oldpos, ios_base::beg); - break; - default: - BOOST_LOG_(1, format("UNKNOWN SIGNATURE: %.2X SKIP DATA") % signature); - file.seekg(valuesize*size, ios_base::cur); - - if(valuesize != 8 && valuesize <= 16) - { - file.seekg(2, ios_base::cur); - } - } - } - else - { // worksheet - if(speadSheets.size() == 0 || findSpreadByName(name) == -1) - { - BOOST_LOG_(1, "NEW SPREADSHEET"); - current_col = 1; - speadSheets.push_back(SpreadSheet(name)); - spread = speadSheets.size() - 1; - speadSheets.back().maxRows = 0; - } - else - { - spread = findSpreadByName(/*sname*/name); - - current_col = speadSheets[spread].columns.size(); - - if(!current_col) - current_col = 1; - ++current_col; - } - BOOST_LOG_(1, format("SPREADSHEET = %s COLUMN NAME = %s (%d) (@0x%X)") % name % columnname % current_col % (unsigned int)file.tellg()); - speadSheets[spread].columns.push_back(SpreadColumn(columnname, dataIndex)); - string::size_type sheetpos = speadSheets[spread].columns.back().name.find_last_of("@"); - if(!speadSheets[spread].multisheet && sheetpos != string::npos) - { - if(lexical_cast(columnname.substr(sheetpos + 1).c_str()) > 1) - { - speadSheets[spread].multisheet = true; - BOOST_LOG_(1, format("SPREADSHEET \"%s\" IS MULTISHEET") % name); - } - } - ++dataIndex; - - ////////////////////////////// SIZE of column ///////////////////////////////////////////// - file.seekg(oldpos + size + 1, ios_base::beg); - - file >> nbytes; - if(fmod(nbytes, (double)valuesize)>0) - { - BOOST_LOG_(1, "WARNING: data section could not be read correct"); - } - nr = nbytes / valuesize; - BOOST_LOG_(1, format(" [number of rows = %d (%d Bytes) @ 0x%X]") % nr % nbytes % (unsigned int)file.tellg()); - - speadSheets[spread].maxRows> value; - out << format("%g ") % value; - speadSheets[spread].columns[(current_col-1)].data.push_back(value); - } - else if((data_type & 0x100) == 0x100) // Text&Numeric - { - file >> c; - file.seekg(1, ios_base::cur); - if(c == 0) //value - { - file >> value; - out << format("%g ") % value; - speadSheets[spread].columns[(current_col-1)].data.push_back(value); - file.seekg(valuesize - 10, ios_base::cur); - } - else //text - { - string stmp(valuesize - 2, 0); - file >> stmp; - if(stmp.find(0x0E) != string::npos) // try find non-printable symbol - garbage test - stmp = string(); - speadSheets[spread].columns[(current_col-1)].data.push_back(stmp); - out << format("%s ") % stmp; - } - } - else //text - { - string stmp(valuesize, 0); - file >> stmp; - if(stmp.find(0x0E) != string::npos) // try find non-printable symbol - garbage test - stmp = string(); - speadSheets[spread].columns[(current_col-1)].data.push_back(stmp); - out << format("%s ") % stmp; - } - } - BOOST_LOG_(1, out.str()); - } - - if(nbytes > 0 || columnname.empty()) - { - file.seekg(1, ios_base::cur); - } - - file >> size; - file.seekg(1 + size + (size > 0 ? 1 : 0), ios_base::cur); - - file >> size; - - file.seekg(1, ios_base::cur); - BOOST_LOG_(1, format(" [column found = %d/0x%X (@ 0x%X)]") % size % size %((unsigned int) file.tellg()-5)); - colpos = file.tellg(); - } - - //////////////////////////////////////////////////////////////////////////// - for(unsigned int i = 0; i < speadSheets.size(); ++i) - { - if(speadSheets[i].multisheet) - { - BOOST_LOG_(1, format(" CONVERT SPREADSHEET \"%s\" to EXCEL") % speadSheets[i].name.c_str()); - convertSpreadToExcel(i); - --i; - } - } - //////////////////////////////////////////////////////////////////////////// - ////////////////////// HEADER SECTION ////////////////////////////////////// - - unsigned int POS = (unsigned int)file.tellg()-11; - BOOST_LOG_(1, "\nHEADER SECTION"); - BOOST_LOG_(1, format(" nr_spreads = %d") % speadSheets.size()); - BOOST_LOG_(1, format(" [position @ 0x%X]") % POS); - - //////////////////////// OBJECT INFOS ////////////////////////////////////// - POS += 0xB; - file.seekg(POS, ios_base::beg); - while(1) - { - BOOST_LOG_(1, " reading Header"); - // HEADER - // check header - POS = file.tellg(); - - file >> size; - if(size == 0) - break; - - file.seekg(POS + 0x7, ios_base::beg); - string name(25, 0); - file >> name; - - file.seekg(POS, ios_base::beg); - - if(findSpreadByName(name) != -1) - readSpreadInfo(); - else if(findMatrixByName(name) != -1) - readMatrixInfo(); - else if(findExcelByName(name) != -1) - readExcelInfo(); - else - readGraphInfo(); - } - - file.seekg(1, ios_base::cur); - BOOST_LOG_(1, format("Some Origin params @ 0x%X:") % (unsigned int)file.tellg()); - - file >> c; - while(c != 0) - { - out.str(string()); - out << " "; - while(c != '\n') - { - out << c; - file >> c; - } - double parvalue; - file >> parvalue; - out << format(": %g") % parvalue; - BOOST_LOG_(1, out.str()); - - file.seekg(1, ios_base::cur); - file >> c; - } - file.seekg(1 + 5, ios_base::cur); - while(1) - { - //fseek(f,5+0x40+1,SEEK_CUR); - int size; - file >> size; - if(size != 0x40) - break; - - file.seekg(1, ios_base::cur); - Rect rect; - unsigned int coord; - file >> coord; - rect.left = coord; - file >> coord; - rect.top = coord; - file >> coord; - rect.right = coord; - file >> coord; - rect.bottom = coord; - - unsigned char state; - file.seekg(0x8, ios_base::cur); - file >> state; - - double creationDate, modificationDate; - file.seekg(0x7, ios_base::cur); - file >> creationDate; - file >> modificationDate; - - file.seekg(0x8, ios_base::cur); - file >> c; - - unsigned char labellen; - file.seekg(0x3, ios_base::cur); - file >> labellen; - - file.seekg(4, ios_base::cur); - file >> size; - - file.seekg(1, ios_base::cur); - - string name(size, 0); - file >> name; - - if(name == "ResultsLog") - { - file.seekg(1, ios_base::cur); - file >> size; - - file.seekg(1, ios_base::cur); - resultsLog.resize(size); - file >> resultsLog; - - BOOST_LOG_(1, format("Results Log: %s") % resultsLog); - break; - } - else - { - notes.push_back(Note(name)); - notes.back().objectID = objectIndex; - notes.back().frameRect = rect; - notes.back().creationDate = doubleToPosixTime(creationDate); - notes.back().modificationDate = doubleToPosixTime(modificationDate); - - if(c & 0x01) - notes.back().title = Window::Label; - else if(c & 0x02) - notes.back().title = Window::Name; - else - notes.back().title = Window::Both; - - notes.back().hidden = (state & 0x40); - - ++objectIndex; - - file.seekg(1, ios_base::cur); - file >> size; - - file.seekg(1, ios_base::cur); - - if(labellen > 1) - { - file >> notes.back().label.assign(labellen-1, 0); - file.seekg(1, ios_base::cur); - } - - file >> notes.back().text.assign(size - labellen, 0); - - BOOST_LOG_(1, format("NOTE %d NAME: %s") % notes.size() % notes.back().name); - BOOST_LOG_(1, format("NOTE %d LABEL: %s") % notes.size() % notes.back().label); - BOOST_LOG_(1, format("NOTE %d TEXT: %s") % notes.size() % notes.back().text); - - file.seekg(1, ios_base::cur); - } - } - - file.seekg(1 + 4*5 + 0x10 + 1, ios_base::cur); - try - { - readProjectTree(); - } - catch(...) - {} - BOOST_LOG_(1, "Done parsing"); - BOOST_LOG_FINALIZE(); - - return true; -} - -void Origin750Parser::readSpreadInfo() -{ - unsigned int POS = file.tellg(); - - unsigned int size; - file >> size; - - POS += 5; - - BOOST_LOG_(1, format(" [Spreadsheet SECTION (@ 0x%X)]") % POS); - - // check spreadsheet name - file.seekg(POS + 0x2, ios_base::beg); - string name(25, 0); - file >> name; - - int spread = findSpreadByName(name); - speadSheets[spread].name = name; - file.seekg(POS, ios_base::beg); - readWindowProperties(speadSheets[spread], size); - speadSheets[spread].loose = false; - char c = 0; - - unsigned int LAYER = POS; - { - // LAYER section - LAYER += size + 0x1 + 0x5/* length of block = 0x12D + '\n'*/ + 0x12D + 0x1; - //now structure is next : section_header_size=0x6F(4 bytes) + '\n' + section_header(0x6F bytes) + section_body_1_size(4 bytes) + '\n' + section_body_1 + section_body_2_size(maybe=0)(4 bytes) + '\n' + section_body_2 + '\n' - //possible sections: column formulas, __WIPR, __WIOTN, __LayerInfoStorage etc - //section name(column name in formula case) starts with 0x46 position - while(1) - { - //section_header_size=0x6F(4 bytes) + '\n' - LAYER += 0x5; - - //section_header - file.seekg(LAYER + 0x46, ios_base::beg); - string sec_name(41, 0); - file >> sec_name; - - BOOST_LOG_(1, format(" SECTION NAME: %s (@ 0x%X)") % sec_name % (LAYER + 0x46)); - - //section_body_1_size - LAYER += 0x6F + 0x1; - file.seekg(LAYER, ios_base::beg); - file >> size; - - //section_body_1 - LAYER += 0x5; - file.seekg(LAYER, ios_base::beg); - //check if it is a formula - int col_index = findSpreadColumnByName(spread, sec_name); - if(col_index != -1) - { - file >> speadSheets[spread].columns[col_index].command.assign(size, 0); - } - - //section_body_2_size - LAYER += size + 0x1; - file.seekg(LAYER, ios_base::beg); - file >> size; - - //section_body_2 - LAYER += 0x5; - - //close section 00 00 00 00 0A - LAYER += size + (size > 0 ? 0x1 : 0) + 0x5; - - if(sec_name == "__LayerInfoStorage") - break; - - } - LAYER += 0x5; - } - - /////////////// COLUMN Types /////////////////////////////////////////// - BOOST_LOG_(1, format(" Spreadsheet has %d columns") % speadSheets[spread].columns.size()); - - while(1) - { - LAYER += 0x5; - file.seekg(LAYER + 0x12, ios_base::beg); - name.resize(12); - file >> name; - - file.seekg(LAYER + 0x11, ios_base::beg); - file >> c; - - short width=0; - file.seekg(LAYER + 0x4A, ios_base::beg); - file >> width; - int col_index = findSpreadColumnByName(spread, name); - if(col_index != -1) - { - SpreadColumn::ColumnType type; - switch(c) - { - case 3: - type = SpreadColumn::X; - break; - case 0: - type = SpreadColumn::Y; - break; - case 5: - type = SpreadColumn::Z; - break; - case 6: - type = SpreadColumn::XErr; - break; - case 2: - type = SpreadColumn::YErr; - break; - case 4: - type = SpreadColumn::Label; - break; - default: - type = SpreadColumn::NONE; - break; - } - speadSheets[spread].columns[col_index].type = type; - width/=0xA; - if(width == 0) - width = 8; - speadSheets[spread].columns[col_index].width = width; - - unsigned char c1,c2; - file.seekg(LAYER + 0x1E, ios_base::beg); - file >> c1; - file >> c2; - - switch(c1) - { - case 0x00: // Numeric - Dec1000 - case 0x09: // Text&Numeric - Dec1000 - case 0x10: // Numeric - Scientific - case 0x19: // Text&Numeric - Scientific - case 0x20: // Numeric - Engeneering - case 0x29: // Text&Numeric - Engeneering - case 0x30: // Numeric - Dec1,000 - case 0x39: // Text&Numeric - Dec1,000 - speadSheets[spread].columns[col_index].valueType = (c1%0x10 == 0x9) ? TextNumeric : Numeric; - speadSheets[spread].columns[col_index].valueTypeSpecification = c1 / 0x10; - if(c2 >= 0x80) - { - speadSheets[spread].columns[col_index].significantDigits = c2 - 0x80; - speadSheets[spread].columns[col_index].numericDisplayType = SignificantDigits; - } - else if(c2 > 0) - { - speadSheets[spread].columns[col_index].decimalPlaces = c2 - 0x03; - speadSheets[spread].columns[col_index].numericDisplayType = DecimalPlaces; - } - break; - case 0x02: // Time - speadSheets[spread].columns[col_index].valueType = Time; - speadSheets[spread].columns[col_index].valueTypeSpecification = c2 - 0x80; - break; - case 0x03: // Date - speadSheets[spread].columns[col_index].valueType = Date; - speadSheets[spread].columns[col_index].valueTypeSpecification= c2 - 0x80; - break; - case 0x31: // Text - speadSheets[spread].columns[col_index].valueType = Text; - break; - case 0x4: // Month - case 0x34: - speadSheets[spread].columns[col_index].valueType = Month; - speadSheets[spread].columns[col_index].valueTypeSpecification = c2; - break; - case 0x5: // Day - case 0x35: - speadSheets[spread].columns[col_index].valueType = Day; - speadSheets[spread].columns[col_index].valueTypeSpecification = c2; - break; - default: // Text - speadSheets[spread].columns[col_index].valueType = Text; - break; - } - BOOST_LOG_(1, format(" COLUMN \"%s\" type = %s(%d) (@ 0x%X)") % speadSheets[spread].columns[col_index].name.c_str() % colTypeNames[type] % (int)c % (LAYER + 0x11)); - } - LAYER += 0x1E7 + 0x1; - - int size; - file.seekg(LAYER, ios_base::beg); - file >> size; - - LAYER += 0x5; - if(size > 0) - { - if(col_index != -1) - { - file.seekg(LAYER, ios_base::beg); - file >> speadSheets[spread].columns[col_index].comment.assign(size, 0); - } - LAYER += size + 0x1; - } - - file.seekg(LAYER, ios_base::beg); - file >> size; - if(size != 0x1E7) - break; - } - BOOST_LOG_(1, format(" Done with spreadsheet %d") % spread); - - file.seekg(LAYER + 0x5*0x6 + 0x1ED*0x12, ios_base::beg); -} - -void Origin750Parser::readExcelInfo() -{ - unsigned int POS = file.tellg(); - - unsigned int size; - file >> size; - - POS += 5; - - BOOST_LOG_(1, format(" [EXCEL SECTION (@ 0x%X)]") % POS); - - // check spreadsheet name - string name(25, 0); - file.seekg(POS + 0x2, ios_base::beg); - file >> name; - - int iexcel = findExcelByName(name); - excels[iexcel].name = name; - file.seekg(POS, ios_base::beg); - readWindowProperties(excels[iexcel], size); - excels[iexcel].loose = false; - char c = 0; - - unsigned int LAYER = POS; - LAYER += size + 0x1; - int isheet = 0; - while(1)// multisheet loop - { - // LAYER section - LAYER += 0x5/* length of block = 0x12D + '\n'*/ + 0x12D + 0x1; - //now structure is next : section_header_size=0x6F(4 bytes) + '\n' + section_header(0x6F bytes) + section_body_1_size(4 bytes) + '\n' + section_body_1 + section_body_2_size(maybe=0)(4 bytes) + '\n' + section_body_2 + '\n' - //possible sections: column formulas, __WIPR, __WIOTN, __LayerInfoStorage etc - //section name(column name in formula case) starts with 0x46 position - while(1) - { - //section_header_size=0x6F(4 bytes) + '\n' - LAYER += 0x5; - - //section_header - - string sec_name(41, 0); - file.seekg(LAYER + 0x46, ios_base::beg); - file >> sec_name; - - BOOST_LOG_(1, format(" SECTION NAME: %s (@ 0x%X)") % sec_name % (LAYER + 0x46)); - - //section_body_1_size - LAYER += 0x6F + 0x1; - file.seekg(LAYER, ios_base::beg); - file >> size; - - //section_body_1 - LAYER += 0x5; - file.seekg(LAYER, ios_base::beg); - //check if it is a formula - int col_index = findExcelColumnByName(iexcel, isheet, sec_name); - if(col_index!=-1) - { - file >> excels[iexcel].sheets[isheet].columns[col_index].command.assign(size, 0); - } - - //section_body_2_size - LAYER += size + 0x1; - file.seekg(LAYER, ios_base::beg); - file >> size; - - //section_body_2 - LAYER += 0x5; - - //close section 00 00 00 00 0A - LAYER += size + (size > 0 ? 0x1 : 0) + 0x5; - - if(sec_name == "__LayerInfoStorage") - break; - - } - LAYER += 0x5; - - /////////////// COLUMN Types /////////////////////////////////////////// - BOOST_LOG_(1, format(" Excel sheet %d has %d columns") % isheet % excels[iexcel].sheets[isheet].columns.size()); - - while(1) - { - LAYER += 0x5; - file.seekg(LAYER + 0x12, ios_base::beg); - name.resize(12); - file >> name; - - file.seekg(LAYER + 0x11, ios_base::beg); - file >> c; - - short width=0; - file.seekg(LAYER + 0x4A, ios_base::beg); - file >> width; - - int col_index = findExcelColumnByName(iexcel, isheet, name); - if(col_index != -1) - { - SpreadColumn::ColumnType type; - switch(c) - { - case 3: - type = SpreadColumn::X; - break; - case 0: - type = SpreadColumn::Y; - break; - case 5: - type = SpreadColumn::Z; - break; - case 6: - type = SpreadColumn::XErr; - break; - case 2: - type = SpreadColumn::YErr; - break; - case 4: - type = SpreadColumn::Label; - break; - default: - type = SpreadColumn::NONE; - break; - } - excels[iexcel].sheets[isheet].columns[col_index].type = type; - width/=0xA; - if(width == 0) - width = 8; - excels[iexcel].sheets[isheet].columns[col_index].width = width; - - unsigned char c1,c2; - file.seekg(LAYER + 0x1E, ios_base::beg); - file >> c1; - file >> c2; - switch(c1) - { - case 0x00: // Numeric - Dec1000 - case 0x09: // Text&Numeric - Dec1000 - case 0x10: // Numeric - Scientific - case 0x19: // Text&Numeric - Scientific - case 0x20: // Numeric - Engeneering - case 0x29: // Text&Numeric - Engeneering - case 0x30: // Numeric - Dec1,000 - case 0x39: // Text&Numeric - Dec1,000 - excels[iexcel].sheets[isheet].columns[col_index].valueType = (c1%0x10 == 0x9) ? TextNumeric : Numeric; - excels[iexcel].sheets[isheet].columns[col_index].valueTypeSpecification = c1 / 0x10; - if(c2>=0x80) - { - excels[iexcel].sheets[isheet].columns[col_index].significantDigits = c2 - 0x80; - excels[iexcel].sheets[isheet].columns[col_index].numericDisplayType = SignificantDigits; - } - else if(c2>0) - { - excels[iexcel].sheets[isheet].columns[col_index].decimalPlaces = c2 - 0x03; - excels[iexcel].sheets[isheet].columns[col_index].numericDisplayType = DecimalPlaces; - } - break; - case 0x02: // Time - excels[iexcel].sheets[isheet].columns[col_index].valueType = Time; - excels[iexcel].sheets[isheet].columns[col_index].valueTypeSpecification = c2 - 0x80; - break; - case 0x03: // Date - excels[iexcel].sheets[isheet].columns[col_index].valueType = Date; - excels[iexcel].sheets[isheet].columns[col_index].valueTypeSpecification = c2 - 0x80; - break; - case 0x31: // Text - excels[iexcel].sheets[isheet].columns[col_index].valueType = Text; - break; - case 0x4: // Month - case 0x34: - excels[iexcel].sheets[isheet].columns[col_index].valueType = Month; - excels[iexcel].sheets[isheet].columns[col_index].valueTypeSpecification = c2; - break; - case 0x5: // Day - case 0x35: - excels[iexcel].sheets[isheet].columns[col_index].valueType = Day; - excels[iexcel].sheets[isheet].columns[col_index].valueTypeSpecification = c2; - break; - default: // Text - excels[iexcel].sheets[isheet].columns[col_index].valueType = Text; - break; - } - BOOST_LOG_(1, format(" COLUMN \"%s\" type = %s(%d) (@ 0x%X)") % excels[iexcel].sheets[isheet].columns[col_index].name.c_str() % type % (int)c % (LAYER + 0x11)); - } - LAYER += 0x1E7 + 0x1; - - file.seekg(LAYER, ios_base::beg); - file >> size; - - LAYER += 0x5; - if(size > 0) - { - if(col_index != -1) - { - file.seekg(LAYER, ios_base::beg); - file >> excels[iexcel].sheets[isheet].columns[col_index].comment.assign(size, 0); - } - LAYER += size + 0x1; - } - - file.seekg(LAYER, ios_base::beg); - file >> size; - - if(size != 0x1E7) - break; - } - BOOST_LOG_(1, format(" Done with Excel %d") % iexcel); - - //POS = LAYER+0x5*0x6+0x1ED*0x12; - LAYER += 0x5*0x5 + 0x1ED*0x12; - file.seekg(LAYER, ios_base::beg); - file >> size; - - if(size == 0) - break; - - ++isheet; - } - - file.seekg(LAYER + 0x5, ios_base::beg); -} - -void Origin750Parser::readMatrixInfo() -{ - unsigned int POS = file.tellg(); - - unsigned int size; - file >> size; - - POS+=5; - - BOOST_LOG_(1, format(" [Matrix SECTION (@ 0x%X)]") % POS); - - string name(25, 0); - file.seekg(POS + 0x2, ios_base::beg); - file >> name; - - int idx = findMatrixByName(name); - matrixes[idx].name = name; - file.seekg(POS, ios_base::beg); - readWindowProperties(matrixes[idx], size); - - unsigned char h; - file.seekg(POS + 0x87, ios_base::beg); - file >> h; - - switch(h) - { - case 1: - matrixes[idx].view = Matrix::ImageView; - break; - case 2: - matrixes[idx].header = Matrix::XY; - break; - } - - unsigned int LAYER = POS; - LAYER += size + 0x1; - - // LAYER section - LAYER += 0x5; - - file.seekg(LAYER + 0x2B, ios_base::beg); - file >> matrixes[idx].columnCount; - - file.seekg(LAYER + 0x52, ios_base::beg); - file >> matrixes[idx].rowCount; - - LAYER += 0x12D + 0x1; - //now structure is next : section_header_size=0x6F(4 bytes) + '\n' + section_header(0x6F bytes) + section_body_1_size(4 bytes) + '\n' + section_body_1 + section_body_2_size(maybe=0)(4 bytes) + '\n' + section_body_2 + '\n' - //possible sections: column formulas, __WIPR, __WIOTN, __LayerInfoStorage - //section name(column name in formula case) starts with 0x46 position - while(1) - { - //section_header_size=0x6F(4 bytes) + '\n' - LAYER += 0x5; - - //section_header - string sec_name(41, 0); - file.seekg(LAYER + 0x46, ios_base::beg); - file >> sec_name; - - //section_body_1_size - LAYER += 0x6F+0x1; - file.seekg(LAYER, ios_base::beg); - file >> size; - - //section_body_1 - LAYER += 0x5; - //check if it is a formula - if(sec_name == "MV") - { - file.seekg(LAYER, ios_base::beg); - file >> matrixes[idx].command.assign(size, 0); - } - - //section_body_2_size - LAYER += size + 0x1; - file.seekg(LAYER, ios_base::beg); - file >> size; - - //section_body_2 - LAYER += 0x5; - if(sec_name == "COLORMAP") - { - file.seekg(LAYER + 0x14, ios_base::beg); - readColorMap(matrixes[idx].colorMap); - } - - //close section 00 00 00 00 0A - LAYER += size + (size > 0 ? 0x1 : 0) + 0x5; - - if(sec_name == "__LayerInfoStorage") - break; - - } - LAYER += 0x5; - - while(1) - { - LAYER+=0x5; - - unsigned short width; - file.seekg(LAYER + 0x2B, ios_base::beg); - file >> width; - - width = (width-55)/0xA; - if(width == 0) - width = 8; - matrixes[idx].width = width; - - unsigned char c1,c2; - file.seekg(LAYER + 0x1E, ios_base::beg); - file >> c1; - file >> c2; - - matrixes[idx].valueTypeSpecification = c1/0x10; - if(c2 >= 0x80) - { - matrixes[idx].significantDigits = c2-0x80; - matrixes[idx].numericDisplayType = SignificantDigits; - } - else if(c2 > 0) - { - matrixes[idx].decimalPlaces = c2-0x03; - matrixes[idx].numericDisplayType = DecimalPlaces; - } - - LAYER += 0x1E7 + 0x1; - - file.seekg(LAYER, ios_base::beg); - file >> size; - - LAYER += size + (size > 0 ? 0x1 : 0) + 0x5; - - file.seekg(LAYER, ios_base::beg); - file >> size; - - if(size != 0x1E7) - break; - } - - file.seekg(LAYER + 0x5*0x5 + 0x1ED*0x12 + 0x5, ios_base::beg); -} - -void Origin750Parser::readGraphInfo() -{ - unsigned int POS = file.tellg(); - - unsigned int size; - file >> size; - POS += 5; - - BOOST_LOG_(1, format(" [Graph SECTION (@ 0x%X)]") % POS); - - string name(25, 0); - file.seekg(POS + 0x02, ios_base::beg); - file >> name; - - graphs.push_back(Graph(name)); - file.seekg(POS, ios_base::beg); - readWindowProperties(graphs.back(), size); - - file.seekg(POS + 0x23, ios_base::beg); - file >> graphs.back().width; - file >> graphs.back().height; - - unsigned int LAYER = POS; - LAYER += size + 0x1; - - while(1)// multilayer loop - { - graphs.back().layers.push_back(GraphLayer()); - GraphLayer& layer(graphs.back().layers.back()); - // LAYER section - LAYER += 0x05; - - file.seekg(LAYER + 0x0F, ios_base::beg); - file >> layer.xAxis.min; - file >> layer.xAxis.max; - file >> layer.xAxis.step; - - file.seekg(LAYER + 0x2B, ios_base::beg); - file >> layer.xAxis.majorTicks; - - file.seekg(LAYER + 0x37, ios_base::beg); - file >> layer.xAxis.minorTicks; - file >> layer.xAxis.scale; - - file.seekg(LAYER + 0x3A, ios_base::beg); - file >> layer.yAxis.min; - file >> layer.yAxis.max; - file >> layer.yAxis.step; - - file.seekg(LAYER + 0x56, ios_base::beg); - file >> layer.yAxis.majorTicks; - - file.seekg(LAYER + 0x62, ios_base::beg); - file >> layer.yAxis.minorTicks; - file >> layer.yAxis.scale; - - file.seekg(LAYER + 0x71, ios_base::beg); - file.read(reinterpret_cast(&layer.clientRect), sizeof(Rect)); - - unsigned char border; - file.seekg(LAYER + 0x89, ios_base::beg); - file >> border; - layer.borderType = (BorderType)(border >= 0x80 ? border-0x80 : None); - - file.seekg(LAYER + 0x105, ios_base::beg); - file >> layer.backgroundColor; - - LAYER += 0x12D + 0x1; - //now structure is next : section_header_size=0x6F(4 bytes) + '\n' + section_header(0x6F bytes) + section_body_1_size(4 bytes) + '\n' + section_body_1 + section_body_2_size(maybe=0)(4 bytes) + '\n' + section_body_2 + '\n' - //possible sections: axes, legend, __BC02, _202, _231, _232, __LayerInfoStorage etc - //section name starts with 0x46 position - while(1) - { - //section_header_size=0x6F(4 bytes) + '\n' - LAYER += 0x5; - - //section_header - - string sec_name(41, 0); - file.seekg(LAYER + 0x46, ios_base::beg); - file >> sec_name; - - BOOST_LOG_(1, format(" SECTION NAME: %s (@ 0x%X)") % sec_name % (LAYER + 0x46)); - - Rect r; - file.seekg(LAYER + 0x03, ios_base::beg); - file.read(reinterpret_cast(&r), sizeof(Rect)); - - unsigned char attach; - file.seekg(LAYER + 0x28, ios_base::beg); - file >> attach; - - unsigned char border; - file >> border; - - Color color; - file.seekg(LAYER + 0x33, ios_base::beg); - file >> color; - - //section_body_1_size - LAYER += 0x6F + 0x1; - file.seekg(LAYER, ios_base::beg); - file >> size; - - //section_body_1 - LAYER += 0x5; - unsigned int osize = size; - - unsigned char type; - file.seekg(LAYER, ios_base::beg); - file >> type; - - //text properties - short rotation; - file.seekg(LAYER + 0x02, ios_base::beg); - file >> rotation; - - unsigned char fontSize; - file >> fontSize; - - unsigned char tab; - file.seekg(LAYER + 0x0A, ios_base::beg); - file >> tab; - - //line properties - unsigned char lineStyle = 0; - double width = 0.0; - LineVertex begin, end; - unsigned int w = 0; - - file.seekg(LAYER + 0x12, ios_base::beg); - file >> lineStyle; - - unsigned short w1; - file >> w1; - width = (double)w1/500.0; - - file.seekg(LAYER + 0x20, ios_base::beg); - file >> begin.x; - file >> end.x; - - file.seekg(LAYER + 0x40, ios_base::beg); - file >> begin.y; - file >> end.y; - - file.seekg(LAYER + 0x60, ios_base::beg); - file >> begin.shapeType; - - file.seekg(LAYER + 0x64, ios_base::beg); - file >> w; - begin.shapeWidth = (double)w/500.0; - - file >> w; - begin.shapeLength = (double)w/500.0; - - file.seekg(LAYER + 0x6C, ios_base::beg); - file >> end.shapeType; - - file.seekg(LAYER + 0x70, ios_base::beg); - file >> w; - end.shapeWidth = (double)w/500.0; - - file >> w; - end.shapeLength = (double)w/500.0; - - Figure figure; - file.seekg(LAYER + 0x05, ios_base::beg); - file >> w1; - figure.width = (double)w1/500.0; - - file.seekg(LAYER + 0x08, ios_base::beg); - file >> figure.style; - - file.seekg(LAYER + 0x42, ios_base::beg); - file >> figure.fillAreaColor; - file >> w1; - figure.fillAreaPatternWidth = (double)w1/500.0; - - file.seekg(LAYER + 0x4A, ios_base::beg); - file >> figure.fillAreaPatternColor; - file >> figure.fillAreaPattern; - - unsigned char h; - file.seekg(LAYER + 0x57, ios_base::beg); - file >> h; - figure.useBorderColor = (h == 0x10); - - - //section_body_2_size - LAYER += size + 0x1; - - file.seekg(LAYER, ios_base::beg); - file >> size; - - //section_body_2 - LAYER += 0x5; - //check if it is a axis or legend - - file.seekg(1, ios_base::cur); - if(sec_name == "XB") - { - string text(size, 0); - file >> text; - - layer.xAxis.position = GraphAxis::Bottom; - layer.xAxis.label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); - } - else if(sec_name == "XT") - { - string text(size, 0); - file >> text; - - layer.xAxis.position = GraphAxis::Top; - layer.xAxis.label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); - } - else if(sec_name == "YL") - { - string text(size, 0); - file >> text; - - layer.yAxis.position = GraphAxis::Left; - layer.yAxis.label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); - } - else if(sec_name == "YR") - { - string text(size, 0); - file >> text; - - layer.yAxis.position = GraphAxis::Right; - layer.yAxis.label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); - } - else if(sec_name == "ZF") - { - string text(size, 0); - file >> text; - - layer.zAxis.position = GraphAxis::Front; - layer.zAxis.label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); - } - else if(sec_name == "ZB") - { - string text(size, 0); - file >> text; - - layer.zAxis.position = GraphAxis::Back; - layer.zAxis.label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); - } - else if(sec_name == "3D") - { - file >> layer.zAxis.min; - file >> layer.zAxis.max; - file >> layer.zAxis.step; - - file.seekg(LAYER + 0x1C, ios_base::beg); - file >> layer.zAxis.majorTicks; - - file.seekg(LAYER + 0x28, ios_base::beg); - file >> layer.zAxis.minorTicks; - file >> layer.zAxis.scale; - - file.seekg(LAYER + 0x218, ios_base::beg); - file >> layer.xLength; - file >> layer.yLength; - file >> layer.zLength; - - layer.xLength /= 23.0; - layer.yLength /= 23.0; - layer.zLength /= 23.0; - } - else if(sec_name == "Legend") - { - string text(size, 0); - file >> text; - - layer.legend = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); - } - else if(sec_name == "__BCO2") // histogram - { - file.seekg(LAYER + 0x10, ios_base::beg); - file >> layer.histogramBin; - - file.seekg(LAYER + 0x20, ios_base::beg); - file >> layer.histogramEnd; - file >> layer.histogramBegin; - } - else if(osize == 0x3E) // text - { - string text(size, 0); - file >> text; - - layer.texts.push_back( - TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach)); - } - else if(osize == 0x5E) // rectangle & circle - { - switch(type) - { - case 0: - case 1: - figure.type = Figure::Rectangle; - break; - case 2: - case 3: - figure.type = Figure::Circle; - break; - } - figure.clientRect = r; - figure.attach = (Attach)attach; - figure.color = color; - - layer.figures.push_back(figure); - } - else if(osize == 0x78 && type == 2) // line - { - layer.lines.push_back(Line()); - Line& line(layer.lines.back()); - line.color = color; - line.clientRect = r; - line.attach = (Attach)attach; - line.width = width; - line.style = lineStyle; - line.begin = begin; - line.end = end; - } - else if(osize == 0x28 && type == 4) // bitmap - { - unsigned long filesize = size + 14; - layer.bitmaps.push_back(Bitmap()); - Bitmap& bitmap(layer.bitmaps.back()); - bitmap.clientRect = r; - bitmap.attach = (Attach)attach; - bitmap.size = filesize; - bitmap.data = new unsigned char[filesize]; - unsigned char* data = bitmap.data; - //add Bitmap header - memcpy(data, "BM", 2); - data += 2; - memcpy(data, &filesize, 4); - data += 4; - unsigned int d = 0; - memcpy(data, &d, 4); - data += 4; - d = 0x36; - memcpy(data, &d, 4); - data += 4; - file.read(reinterpret_cast(data), size); - } - - //close section 00 00 00 00 0A - LAYER += size + (size > 0 ? 0x1 : 0); - - //section_body_3_size - file.seekg(LAYER, ios_base::beg); - file >> size; - - //section_body_3 - LAYER += 0x5; - - //close section 00 00 00 00 0A - LAYER += size + (size > 0 ? 0x1 : 0); - - if(sec_name == "__LayerInfoStorage") - break; - - } - LAYER += 0x5; - unsigned char h; - short w; - - file.seekg(LAYER, ios_base::beg); - file >> size; - - if(size == 0x1E7)//check layer is not empty - { - while(1) - { - LAYER += 0x5; - - layer.curves.push_back(GraphCurve()); - GraphCurve& curve(layer.curves.back()); - file.seekg(LAYER + 0x4C, ios_base::beg); - file >> curve.type; - BOOST_LOG_(1, format(" graph %d layer %d curve %d type : %d") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % (int)curve.type); - - file.seekg(LAYER + 0x04, ios_base::beg); - file >> w; - pair column = findDataByIndex(w-1); - short nColY = w; - if(column.first.size() > 0) - { - curve.dataName = column.first; - if(layer.is3D()) - { - BOOST_LOG_(1, format(" graph %d layer %d curve %d Z : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); - curve.zColumnName = column.second; - } - else - { - BOOST_LOG_(1, format(" graph %d layer %d curve %d Y : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); - curve.yColumnName = column.second; - } - } - - file.seekg(LAYER + 0x23, ios_base::beg); - file >> w; - column = findDataByIndex(w-1); - if(column.first.size() > 0) - { - if(curve.dataName != column.first) - { - BOOST_LOG_(1, format(" graph %d X and Y from different tables") % graphs.size()); - } - - if(layer.is3D()) - { - BOOST_LOG_(1, format(" graph %d layer %d curve %d Y : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); - curve.yColumnName = column.second; - } - else - { - BOOST_LOG_(1, format(" graph %d layer %d curve %d X : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); - curve.xColumnName = column.second; - } - } - - file.seekg(LAYER + 0x4D, ios_base::beg); - file >> w; - column = findDataByIndex(w-1); - if(column.first.size() > 0 && layer.is3D()) - { - BOOST_LOG_(1, format(" graph %d layer %d curve %d X : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); - curve.xColumnName = column.second; - if(curve.dataName != column.first) - { - BOOST_LOG_(1, format(" graph %d X and Y from different tables") % graphs.size()); - } - } - - file.seekg(LAYER + 0x11, ios_base::beg); - file >> curve.lineConnect; - file >> curve.lineStyle; - - file.seekg(LAYER + 0x15, ios_base::beg); - file >> w; - curve.lineWidth=(double)w/500.0; - - file.seekg(LAYER + 0x19, ios_base::beg); - file >> w; - curve.symbolSize=(double)w/500.0; - - file.seekg(LAYER + 0x1C, ios_base::beg); - file >> h; - curve.fillArea = (h==2); - - file.seekg(LAYER + 0x1E, ios_base::beg); - file >> curve.fillAreaType; - - //text - if(curve.type == GraphCurve::TextPlot) - { - file.seekg(LAYER + 0x13, ios_base::beg); - file >> curve.text.rotation; - curve.text.rotation /= 10; - file >> curve.text.fontSize; - - file.seekg(LAYER + 0x19, ios_base::beg); - file >> h; - switch(h) - { - case 26: - curve.text.justify = TextProperties::Center; - break; - case 2: - curve.text.justify = TextProperties::Right; - break; - default: - curve.text.justify = TextProperties::Left; - break; - } - - file >> h; - curve.text.fontUnderline = (h & 0x1); - curve.text.fontItalic = (h & 0x2); - curve.text.fontBold = (h & 0x8); - curve.text.whiteOut = (h & 0x20); - - char offset; - file.seekg(LAYER + 0x37, ios_base::beg); - file >> offset; - curve.text.xOffset = offset * 5; - file >> offset; - curve.text.yOffset = offset * 5; - } - - //vector - if(curve.type == GraphCurve::FlowVector || curve.type == GraphCurve::Vector) - { - file.seekg(LAYER + 0x56, ios_base::beg); - file >> curve.vector.multiplier; - - file.seekg(LAYER + 0x5E, ios_base::beg); - file >> h; - - column = findDataByIndex(nColY - 1 + h - 0x64); - if(column.first.size() > 0) - { - curve.vector.endXColumnName = column.second; - } - - file.seekg(LAYER + 0x62, ios_base::beg); - file >> h; - - column = findDataByIndex(nColY - 1 + h - 0x64); - if(column.first.size() > 0) - { - curve.vector.endYColumnName = column.second; - } - - file.seekg(LAYER + 0x18, ios_base::beg); - file >> h; - - if(h >= 0x64) - { - column = findDataByIndex(nColY - 1 + h - 0x64); - if(column.first.size() > 0) - curve.vector.angleColumnName = column.second; - } - else if(h <= 0x08) - { - curve.vector.constAngle = 45*h; - } - - file >> h; - - if(h >= 0x64 && h < 0x1F4) - { - column = findDataByIndex(nColY - 1 + h - 0x64); - if(column.first.size() > 0) - curve.vector.magnitudeColumnName = column.second; - } - else - { - curve.vector.constMagnitude = (int)curve.symbolSize; - } - - file.seekg(LAYER + 0x66, ios_base::beg); - file >> curve.vector.arrowLenght; - file >> curve.vector.arrowAngle; - - file >> h; - curve.vector.arrowClosed = !(h & 0x1); - - file >> w; - curve.vector.width=(double)w/500.0; - - file.seekg(LAYER + 0x142, ios_base::beg); - file >> h; - switch(h) - { - case 2: - curve.vector.position = VectorProperties::Midpoint; - break; - case 4: - curve.vector.position = VectorProperties::Head; - break; - default: - curve.vector.position = VectorProperties::Tail; - break; - } - - } - - //pie - if(curve.type == GraphCurve::Pie) - { - file.seekg(LAYER + 0x92, ios_base::beg); - file >> h; - - curve.pie.formatPercentages = (h & 0x01); - curve.pie.formatValues = (h & 0x02); - curve.pie.positionAssociate = (h & 0x08); - curve.pie.clockwiseRotation = (h & 0x20); - curve.pie.formatCategories = (h & 0x80); - - file >> curve.pie.formatAutomatic; - file >> curve.pie.distance; - file >> curve.pie.viewAngle; - - file.seekg(LAYER + 0x98, ios_base::beg); - file >> curve.pie.thickness; - - file.seekg(LAYER + 0x9A, ios_base::beg); - file >> curve.pie.rotation; - - file.seekg(LAYER + 0x9E, ios_base::beg); - file >> curve.pie.displacement; - - file.seekg(LAYER + 0xA0, ios_base::beg); - file >> curve.pie.radius; - file >> curve.pie.horizontalOffset; - - file.seekg(LAYER + 0xA6, ios_base::beg); - file >> curve.pie.displacedSectionCount; - } - //surface - if(curve.type == GraphCurve::Mesh3D) - { - file.seekg(LAYER + 0x17, ios_base::beg); - file >> curve.surface.type; - file.seekg(LAYER + 0x1C, ios_base::beg); - file >> h; - if(h & 0x60 == 0x60) - curve.surface.grids = SurfaceProperties::X; - else if(h & 0x20) - curve.surface.grids = SurfaceProperties::Y; - else if(h & 0x40) - curve.surface.grids = SurfaceProperties::None; - else - curve.surface.grids = SurfaceProperties::XY; - - curve.surface.sideWallEnabled = (h & 0x10); - file >> curve.surface.frontColor; - - file.seekg(LAYER + 0x14C, ios_base::beg); - file >> w; - curve.surface.gridLineWidth = (double)w/500.0; - file >> curve.surface.gridColor; - - file.seekg(LAYER + 0x13, ios_base::beg); - file >> h; - curve.surface.backColorEnabled = (h & 0x08); - file.seekg(LAYER + 0x15A, ios_base::beg); - file >> curve.surface.backColor; - file >> curve.surface.xSideWallColor; - file >> curve.surface.ySideWallColor; - - curve.surface.surface.fill = (h & 0x10); - curve.surface.surface.contour = (h & 0x40); - file.seekg(LAYER + 0x94, ios_base::beg); - file >> w; - curve.surface.surface.lineWidth = (double)w/500.0; - file >> curve.surface.surface.lineColor; - - curve.surface.topContour.fill = (h & 0x02); - curve.surface.topContour.contour = (h & 0x04); - file.seekg(LAYER + 0xB4, ios_base::beg); - file >> w; - curve.surface.topContour.lineWidth = (double)w/500.0; - file >> curve.surface.topContour.lineColor; - - curve.surface.bottomContour.fill = (h & 0x80); - curve.surface.bottomContour.contour = (h & 0x01); - file.seekg(LAYER + 0xA4, ios_base::beg); - file >> w; - curve.surface.bottomContour.lineWidth = (double)w/500.0; - file >> curve.surface.bottomContour.lineColor; - } - - if(curve.type == GraphCurve::Mesh3D || curve.type == GraphCurve::Contour) - { - ColorMap& colorMap = (curve.type == GraphCurve::Mesh3D ? curve.surface.colorMap : curve.colorMap); - file.seekg(LAYER + 0x13, ios_base::beg); - file >> h; - colorMap.fillEnabled = (h & 0x82); - file.seekg(LAYER + 0x259, ios_base::beg); - readColorMap(colorMap); - } - - file.seekg(LAYER + 0xC2, ios_base::beg); - file >> curve.fillAreaColor; - file >> w; - curve.fillAreaPatternWidth=(double)w/500.0; - - file.seekg(LAYER + 0xCA, ios_base::beg); - file >> curve.fillAreaPatternColor; - file >> curve.fillAreaPattern; - file >> curve.fillAreaPatternBorderStyle; - file >> w; - curve.fillAreaPatternBorderWidth=(double)w/500.0; - file >> curve.fillAreaPatternBorderColor; - - file.seekg(LAYER + 0x16A, ios_base::beg); - file >> curve.lineColor; - curve.text.color = curve.lineColor; - - file.seekg(LAYER + 0x17, ios_base::beg); - file >> curve.symbolType; - - file.seekg(LAYER + 0x12E, ios_base::beg); - file >> curve.symbolFillColor; - file >> curve.symbolColor; - curve.vector.color = curve.symbolColor; - - file >> h; - curve.symbolThickness = (h == 255 ? 1 : h); - file >> curve.pointOffset; - - file.seekg(LAYER + 0x143, ios_base::beg); - file >> h; - curve.connectSymbols = (h&0x8); - - LAYER += 0x1E7 + 0x1; - - int size; - file.seekg(LAYER, ios_base::beg); - file >> size; - - LAYER += size + (size > 0 ? 0x1 : 0) + 0x5; - - file.seekg(LAYER, ios_base::beg); - file >> size; - - if(size != 0x1E7) - break; - } - - } - //LAYER+=0x5*0x5+0x1ED*0x12; - //LAYER+=2*0x5; - - LAYER += 0x5; - //read axis breaks - while(1) - { - file.seekg(LAYER, ios_base::beg); - file >> size; - - if(size == 0x2D) - { - LAYER += 0x5; - file.seekg(LAYER + 2, ios_base::beg); - file >> h; - - if(h == 2) - { - layer.xAxisBreak.minorTicksBefore = layer.xAxis.minorTicks; - layer.xAxisBreak.scaleIncrementBefore = layer.xAxis.step; - file.seekg(LAYER, ios_base::beg); - readGraphAxisBreakInfo(layer.xAxisBreak); - } - else if(h == 4) - { - layer.yAxisBreak.minorTicksBefore = layer.yAxis.minorTicks; - layer.yAxisBreak.scaleIncrementBefore = layer.yAxis.step; - file.seekg(LAYER, ios_base::beg); - readGraphAxisBreakInfo(layer.yAxisBreak); - } - LAYER += 0x2D + 0x1; - } - else - break; - } - LAYER += 0x5; - - file.seekg(LAYER, ios_base::beg); - readGraphAxisInfo(layer.xAxis); - LAYER += 0x1ED*0x6; - - LAYER += 0x5; - - file.seekg(LAYER, ios_base::beg); - readGraphAxisInfo(layer.yAxis); - LAYER += 0x1ED*0x6; - - LAYER += 0x5; - - file.seekg(LAYER, ios_base::beg); - readGraphAxisInfo(layer.zAxis); - LAYER += 0x1ED*0x6; - - LAYER += 0x5; - - //LAYER += 0x2*0x5 + 0x1ED*0x6; - - file.seekg(LAYER, ios_base::beg); - file >> size; - - if(size == 0) - break; - } - - file.seekg(LAYER + 0x5, ios_base::beg); -} - -void Origin750Parser::skipObjectInfo() -{ - unsigned int POS = file.tellg(); - - unsigned int size; - file >> size; - - POS += 5; - - unsigned int LAYER = POS; - LAYER += size + 0x1; - while(1)// multilayer loop - { - // LAYER section - LAYER +=0x5/* length of block = 0x12D + '\n'*/ + 0x12D + 0x1; - //now structure is next : section_header_size=0x6F(4 bytes) + '\n' + section_header(0x6F bytes) + section_body_1_size(4 bytes) + '\n' + section_body_1 + section_body_2_size(maybe=0)(4 bytes) + '\n' + section_body_2 + '\n' - //possible sections: column formulas, __WIPR, __WIOTN, __LayerInfoStorage - //section name(column name in formula case) starts with 0x46 position - while(1) - { - //section_header_size=0x6F(4 bytes) + '\n' - LAYER += 0x5; - - //section_header - string sec_name(41, 0); - file.seekg(LAYER + 0x46, ios_base::beg); - file >> sec_name; - - //section_body_1_size - LAYER += 0x6F + 0x1; - file.seekg(LAYER, ios_base::beg); - file >> size; - - //section_body_1 - LAYER += 0x5; - - //section_body_2_size - LAYER += size + 0x1; - file.seekg(LAYER, ios_base::beg); - file >> size; - - //section_body_2 - LAYER += 0x5; - - //close section 00 00 00 00 0A - LAYER += size + (size > 0 ? 0x1 : 0); - - //section_body_3_size - file.seekg(LAYER, ios_base::beg); - file >> size; - - //section_body_3 - LAYER += 0x5; - - //close section 00 00 00 00 0A - LAYER += size + (size > 0 ? 0x1 : 0); - - if(sec_name == "__LayerInfoStorage") - break; - - } - LAYER += 0x5; - - while(1) - { - LAYER += 0x5; - - LAYER += 0x1E7 + 0x1; - file.seekg(LAYER, ios_base::beg); - file >> size; - - LAYER += 0x5 + size + (size > 0 ? 0x1 : 0); - - file.seekg(LAYER, ios_base::beg); - file >> size; - - if(size != 0x1E7) - break; - } - - LAYER += 0x5*0x5 + 0x1ED*0x12; - file.seekg(LAYER, ios_base::beg); - file >> size; - - if(size == 0) - break; - } - file.seekg(LAYER + 0x50, ios_base::beg); -} - -void Origin750Parser::readGraphGridInfo(GraphGrid& grid) -{ - unsigned int POS = file.tellg(); - - unsigned char h; - short w; - - file.seekg(POS + 0x26, ios_base::beg); - file >> h; - grid.hidden = (h == 0); - - file.seekg(POS + 0x0F, ios_base::beg); - file >> grid.color; - - file.seekg(POS + 0x12, ios_base::beg); - file >> grid.style; - - file.seekg(POS + 0x15, ios_base::beg); - file >> w; - grid.width = (double)w/500.0; -} - -void Origin750Parser::readGraphAxisBreakInfo(GraphAxisBreak& axis_break) -{ - unsigned int POS = file.tellg(); - - axis_break.show = true; - - file.seekg(POS + 0x0B, ios_base::beg); - file >> axis_break.from; - - file >> axis_break.to; - - file >> axis_break.scaleIncrementAfter; - - file >> axis_break.position; - - unsigned char h; - file >> h; - axis_break.log10 = (h == 1); - - file >> axis_break.minorTicksAfter; -} - -void Origin750Parser::readGraphAxisFormatInfo(GraphAxisFormat& format) -{ - unsigned int POS = file.tellg(); - - unsigned char h; - short w; - - file.seekg(POS + 0x26, ios_base::beg); - file >> h; - format.hidden = (h == 0); - - file.seekg(POS + 0x0F, ios_base::beg); - file >> format.color; - - file.seekg(POS + 0x4A, ios_base::beg); - file >> w; - format.majorTickLength = (double)w/10.0; - - file.seekg(POS + 0x15, ios_base::beg); - file >> w; - format.thickness = (double)w/500.0; - - file.seekg(POS + 0x25, ios_base::beg); - file >> h; - - format.minorTicksType = (h>>6); - format.majorTicksType = ((h>>4) & 3); - format.axisPosition = (h & 0x0F); - switch(format.axisPosition) // need for testing - { - case 1: - file.seekg(POS + 0x37, ios_base::beg); - file >> h; - format.axisPositionValue = (double)h; - break; - case 2: - file.seekg(POS + 0x2F, ios_base::beg); - file >> format.axisPositionValue; - break; - } -} - -void Origin750Parser::readGraphAxisTickLabelsInfo(GraphAxisTick& tick) -{ - unsigned int POS = file.tellg(); - - unsigned char h; - unsigned char h1; - short w; - - file.seekg(POS + 0x26, ios_base::beg); - file >> h; - tick.hidden = (h == 0); - - file.seekg(POS + 0x0F, ios_base::beg); - file >> tick.color; - - file.seekg(POS + 0x13, ios_base::beg); - file >> w; - tick.rotation = w/10; - - file >> tick.fontSize; - - file.seekg(POS + 0x1A, ios_base::beg); - file >> h; - tick.fontBold = (h & 0x08); - - file.seekg(POS + 0x23, ios_base::beg); - file >> w; - file >> h; - file >> h1; - tick.valueType = (ValueType)(h & 0x0F); - - pair column; - switch(tick.valueType) - { - case Numeric: - - /*switch((h>>4)) - { - case 0x9: - tick.valueTypeSpecification=1; - break; - case 0xA: - tick.valueTypeSpecification=2; - break; - case 0xB: - tick.valueTypeSpecification=3; - break; - default: - tick.valueTypeSpecification=0; - }*/ - if((h>>4) > 7) - { - tick.valueTypeSpecification = (h>>4) - 8; - tick.decimalPlaces = h1 - 0x40; - } - else - { - tick.valueTypeSpecification = (h>>4); - tick.decimalPlaces = -1; - } - - break; - case Time: - case Date: - case Month: - case Day: - case ColumnHeading: - tick.valueTypeSpecification = h1 - 0x40; - break; - case Text: - case TickIndexedDataset: - case Categorical: - column = findDataByIndex(w-1); - if(column.first.size() > 0) - { - tick.dataName = column.first; - tick.columnName = column.second; - } - break; - default: // Numeric Decimal 1.000 - tick.valueType = Numeric; - tick.valueTypeSpecification = 0; - break; - } -} - -void Origin750Parser::readGraphAxisInfo(GraphAxis& axis) -{ - unsigned int POS = file.tellg(); - POS += 0x5; - file.seekg(POS, ios_base::beg); - readGraphGridInfo(axis.minorGrid); - POS += 0x1E7 + 1; - - POS += 0x5; - file.seekg(POS, ios_base::beg); - readGraphGridInfo(axis.majorGrid); - POS += 0x1E7 + 1; - - POS += 0x5; - file.seekg(POS, ios_base::beg); - readGraphAxisTickLabelsInfo(axis.tickAxis[0]); - POS += 0x1E7 + 1; - - POS += 0x5; - file.seekg(POS, ios_base::beg); - readGraphAxisFormatInfo(axis.formatAxis[0]); - POS += 0x1E7 + 1; - - POS += 0x5; - file.seekg(POS, ios_base::beg); - readGraphAxisTickLabelsInfo(axis.tickAxis[1]); - POS += 0x1E7 + 1; - - POS += 0x5; - file.seekg(POS, ios_base::beg); - readGraphAxisFormatInfo(axis.formatAxis[1]); -} - -void Origin750Parser::readProjectTree() -{ - readProjectTreeFolder(projectTree.begin()); - - BOOST_LOG_(1, "Origin project Tree"); - for(tree::iterator it = projectTree.begin(projectTree.begin()); it != projectTree.end(projectTree.begin()); ++it) - { - BOOST_LOG_(1, string(projectTree.depth(it) - 1, ' ') + (*it).name); - } -} - -void Origin750Parser::readProjectTreeFolder(tree::iterator parent) -{ - unsigned int POS = file.tellg(); - - double creationDate, modificationDate; - POS += 5; - - file.seekg(POS + 0x10, ios_base::beg); - file >> creationDate; - - file >> modificationDate; - - POS += 0x20 + 1 + 5; - unsigned int size; - file.seekg(POS, ios_base::beg); - file >> size; - - POS += 5; - - // read folder name - string name(size, 0); - file.seekg(POS, ios_base::beg); - file >> name; - - tree::iterator current_folder = projectTree.append_child(parent, ProjectNode(name, ProjectNode::Folder, doubleToPosixTime(creationDate), doubleToPosixTime(modificationDate))); - POS += size + 1 + 5 + 5; - - unsigned int objectcount; - file.seekg(POS, ios_base::beg); - file >> objectcount; - - POS += 5 + 5; - - for(unsigned int i = 0; i < objectcount; ++i) - { - POS += 5; - char c; - file.seekg(POS + 0x2, ios_base::beg); - file >> c; - - unsigned int objectID; - file.seekg(POS + 0x4, ios_base::beg); - file >> objectID; - - if(c == 0x10) - { - projectTree.append_child(current_folder, ProjectNode(notes[objectID].name, ProjectNode::Note)); - } - else - { - pair object = findObjectByIndex(objectID); - projectTree.append_child(current_folder, ProjectNode(object.second, object.first)); - } - - POS += 8 + 1 + 5 + 5; - } - - file.seekg(POS, ios_base::beg); - file >> objectcount; - - file.seekg(1, ios_base::cur); - for(unsigned int i = 0; i < objectcount; ++i) - readProjectTreeFolder(current_folder); -} - -void Origin750Parser::readWindowProperties(Window& window, unsigned int size) -{ - unsigned int POS = file.tellg(); - - window.objectID = objectIndex; - ++objectIndex; - - file.seekg(POS + 0x1B, ios_base::beg); - file.read(reinterpret_cast(&window.frameRect), sizeof(window.frameRect)); - - char c; - file.seekg(POS + 0x32, ios_base::beg); - file >> c; - - if(c & 0x01) - window.state = Window::Minimized; - else if(c & 0x02) - window.state = Window::Maximized; - - file.seekg(POS + 0x69, ios_base::beg); - file >> c; - - if(c & 0x01) - window.title = Window::Label; - else if(c & 0x02) - window.title = Window::Name; - else - window.title = Window::Both; - - window.hidden = (c & 0x08); - if(window.hidden) - { - BOOST_LOG_(1, format(" WINDOW %d NAME : %s is hidden") % objectIndex % window.name.c_str()); - } - - double creationDate, modificationDate; - file.seekg(POS + 0x73, ios_base::beg); - file >> creationDate; - file >> modificationDate; - window.creationDate = doubleToPosixTime(creationDate); - window.modificationDate = doubleToPosixTime(modificationDate); - - if(size > 0xC3) - { - unsigned int labellen = 0; - file.seekg(POS + 0xC3, ios_base::beg); - file >> c; - while(c != '@') - { - file >> c; - ++labellen; - } - if(labellen > 0) - { - file.seekg(POS + 0xC3, ios_base::beg); - file >> window.label.assign(labellen, 0); - } - - BOOST_LOG_(1, format(" WINDOW %d LABEL: %s") % objectIndex % window.label); - } -} - -void Origin750Parser::readColorMap(ColorMap& colorMap) -{ - unsigned char h; - short w; - unsigned int colorMapSize; - file >> colorMapSize; - file.seekg(0x110, ios_base::cur); - for(unsigned int i = 0; i < colorMapSize + 2; ++i) - { - ColorMapLevel level; - file >> level.fillPattern; - - file.seekg(0x03, ios_base::cur); - file >> level.fillPatternColor; - file >> w; - level.fillPatternLineWidth = (double)w/500.0; - - file.seekg(0x06, ios_base::cur); - file >> level.lineStyle; - - file.seekg(0x01, ios_base::cur); - file >> w; - level.lineWidth = (double)w/500.0; - file >> level.lineColor; - - file.seekg(0x02, ios_base::cur); - file >> h; - level.labelVisible = (h & 0x1); - level.lineVisible = !(h & 0x2); - - file.seekg(0x0D, ios_base::cur); - file >> level.fillColor; - file.seekg(0x04, ios_base::cur); - double value; - file >> value; - - colorMap.levels.push_back(make_pair(value, level)); - } -} - -OriginParser* createOrigin750Parser(const string& fileName) -{ - return new Origin750Parser(fileName); -} \ No newline at end of file === removed file '3rdparty/liborigin/Origin750Parser.h' --- 3rdparty/liborigin/Origin750Parser.h 2009-11-18 10:33:29 +0000 +++ 3rdparty/liborigin/Origin750Parser.h 1970-01-01 00:00:00 +0000 @@ -1,65 +0,0 @@ -/*************************************************************************** - File : Origin750Parser.h - -------------------------------------------------------------------- - Copyright : (C) 2007-2008 Alex Kargovsky, Stefan Gerlach, - Ion Vasilief - Email (use @ for *) : kargovsky*yumr.phys.msu.su, ion_vasilief*yahoo.fr - Description : Origin 7.5 file parser class - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - - -#ifndef ORIGIN_750_PARSER_H -#define ORIGIN_750_PARSER_H - -#include "OriginParser.h" -#include "endianfstream.hh" - -using namespace Origin; - -class Origin750Parser : public OriginParser -{ -public: - Origin750Parser(const string& fileName); - bool parse(); - -private: - void readSpreadInfo(); - void readExcelInfo(); - void readMatrixInfo(); - void readGraphInfo(); - void skipObjectInfo(); - void readGraphAxisInfo(GraphAxis& axis); - void readGraphGridInfo(GraphGrid& grid); - void readGraphAxisBreakInfo(GraphAxisBreak& axis_break); - void readGraphAxisFormatInfo(GraphAxisFormat& format); - void readGraphAxisTickLabelsInfo(GraphAxisTick& tick); - void readProjectTree(); - void readProjectTreeFolder(tree::iterator parent); - void readWindowProperties(Window& window, unsigned int size); - void readColorMap(ColorMap& colorMap); - - unsigned int objectIndex; - iendianfstream file; -}; - -#endif // ORIGIN_750_PARSER_H === removed file '3rdparty/liborigin/OriginDefaultParser.cpp' --- 3rdparty/liborigin/OriginDefaultParser.cpp 2009-11-18 10:33:29 +0000 +++ 3rdparty/liborigin/OriginDefaultParser.cpp 1970-01-01 00:00:00 +0000 @@ -1,481 +0,0 @@ -/*************************************************************************** - File : OriginDefaultParser.cpp - -------------------------------------------------------------------- - Copyright : (C) 2005-2008 Stefan Gerlach - (C) 2007-2008 Alex Kargovsky, Ion Vasilief - Email (use @ for *) : kargovsky*yumr.phys.msu.su, ion_vasilief*yahoo.fr - Description : Default Origin file parser class - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#include "OriginDefaultParser.h" -#include -#include -#include -#include -#include - -#include - -using namespace Origin; - -#define MAX_LEVEL 20 -#define ERROR_MSG "Please send the OPJ file and the opjfile.log to the author of liborigin!\n" - -#define SwapBytes(x) ByteSwap((unsigned char *) &x,sizeof(x)) - -void ByteSwap(unsigned char * b, int n) { - register int i = 0; - register int j = n-1; - while (i410) - for(i=0;i<5;i++) // skip "0" - fread(&c,1,1,f); - - int col_found; - fread(&col_found,4,1,f); - if(IsBigEndian()) SwapBytes(col_found); - - fread(&c,1,1,f); // skip '\n' - fprintf(debug," [column found = %d/0x%X @ 0x%X]\n",col_found,col_found,(unsigned int) ftell(f)); - - int current_col=1, nr=0, nbytes=0; - double a; - char name[25], valuesize; - while(col_found > 0 && col_found < 0x84) { // should be 0x72, 0x73 or 0x83 - //////////////////////////////// COLUMN HEADER ///////////////////////////////////////////// - fprintf(debug,"COLUMN HEADER :\n"); - for(i=0;i < 0x3D;i++) { // skip 0x3C chars to value size - fread(&c,1,1,f); - //if(i>21 && i<27) { - fprintf(debug,"%.2X ",c); - if(!((i+1)%16)) fprintf(debug,"\n"); - //} - } - fprintf(debug,"\n"); - - fread(&valuesize,1,1,f); - fprintf(debug," [valuesize = %d @ 0x%X]\n",valuesize,(unsigned int) ftell(f)-1); - if(valuesize <= 0) { - fprintf(debug," WARNING : found strange valuesize of %d\n",valuesize); - valuesize=10; - } - - fprintf(debug,"SKIP :\n"); - for(i=0;i<0x1A;i++) { // skip to name - fread(&c,1,1,f); - fprintf(debug,"%.2X ",c); - if(!((i+1)%16)) fprintf(debug,"\n"); - } - fprintf(debug,"\n"); - - // read name - fprintf(debug," [Spreadsheet @ 0x%X]\n",(unsigned int) ftell(f)); - fflush(debug); - fread(&name,25,1,f); - //char* sname = new char[26]; - char sname[26]; - sprintf(sname,"%s",strtok(name,"_")); // spreadsheet name - char* cname = strtok(NULL,"_"); // column name - while(char* tmpstr = strtok(NULL,"_")) { // get multiple-"_" title correct - strcat(sname,"_"); - strcat(sname,cname); - strcpy(cname,tmpstr); - } - int spread=0; - if(speadSheets.size() == 0 || findSpreadByName(sname) == -1) { - fprintf(debug,"NEW SPREADSHEET\n"); - current_col=1; - speadSheets.push_back(SpreadSheet(sname)); - spread=speadSheets.size()-1; - speadSheets.back().maxRows=0; - } - else { - - spread = findSpreadByName(sname); - - current_col=speadSheets[spread].columns.size(); - - if(!current_col) - current_col=1; - current_col++; - } - fprintf(debug,"SPREADSHEET = %s COLUMN %d NAME = %s (@0x%X)\n", - sname, current_col, cname, (unsigned int) ftell(f)); - fflush(debug); - - if(cname == 0) { - fprintf(debug,"NO COLUMN NAME FOUND! Must be a Matrix or Function.\n"); - ////////////////////////////// READ matrixes or functions //////////////////////////////////// - fprintf(debug,"Reading MATRIX.\n"); - fflush(debug); - - fprintf(debug," [position @ 0x%X]\n",(unsigned int) ftell(f)); - // TODO - fprintf(debug," SIGNATURE : "); - for(i=0;i<2;i++) { // skip header - fread(&c,1,1,f); - fprintf(debug,"%.2X ",c); - } - fflush(debug); - - do{ // skip until '\n' - fread(&c,1,1,f); - // fprintf(debug,"%.2X ",c); - } while (c != '\n'); - fprintf(debug,"\n"); - fflush(debug); - - // read size - int size; - fread(&size,4,1,f); - fread(&c,1,1,f); // skip '\n' - // TODO : use entry size : double, float, ... - size /= 8; - fprintf(debug," SIZE = %d\n",size); - fflush(debug); - - // catch exception - if(size>10000) - size=1000; - - fprintf(debug,"VALUES :\n"); - speadSheets[speadSheets.size()-1].maxRows=1; - - double value=0; - for(i=0;i0) - fprintf(debug,"WARNING: data section could not be read correct\n"); - nr = nbytes / valuesize; - fprintf(debug," [number of rows = %d (%d Bytes) @ 0x%X]\n",nr,nbytes,(unsigned int) ftell(f)); - fflush(debug); - - speadSheets[spread].maxRows 16) { // skip 0 0 - fread(&c,1,1,f); - fread(&c,1,1,f); - } - fread(&col_found,4,1,f); - if(IsBigEndian()) SwapBytes(col_found); - fread(&c,1,1,f); // skip '\n' - fprintf(debug," [column found = %d/0x%X (@ 0x%X)]\n",col_found,col_found,(unsigned int) ftell(f)-5); - fflush(debug); - } - - ////////////////////// HEADER SECTION ////////////////////////////////////// - // TODO : use new method ('\n') - - int POS = ftell(f)-11; - fprintf(debug,"\nHEADER SECTION\n"); - fprintf(debug," nr_spreads = %d\n",speadSheets.size()); - fprintf(debug," [position @ 0x%X]\n",POS); - fflush(debug); - - ///////////////////// speadSheets INFOS //////////////////////////////////// - int LAYER=0; - int COL_JUMP = 0x1ED; - for(unsigned int i=0; i < speadSheets.size(); i++) { - fprintf(debug," reading Spreadsheet %d/%zd properties\n",i+1,speadSheets.size()); - fflush(debug); - if(i > 0) { - if (version == 700 ) - POS += 0x2530 + speadSheets[i-1].columns.size()*COL_JUMP; - else if (version == 610 ) - POS += 0x25A4 + speadSheets[i-1].columns.size()*COL_JUMP; - else if (version == 604 ) - POS += 0x25A0 + speadSheets[i-1].columns.size()*COL_JUMP; - else if (version == 601 ) - POS += 0x2560 + speadSheets[i-1].columns.size()*COL_JUMP; // ? - else if (version == 600 ) - POS += 0x2560 + speadSheets[i-1].columns.size()*COL_JUMP; - else if (version == 500 ) - POS += 0x92C + speadSheets[i-1].columns.size()*COL_JUMP; - else if (version == 410 ) - POS += 0x7FB + speadSheets[i-1].columns.size()*COL_JUMP; - } - - fprintf(debug," reading Header\n"); - fflush(debug); - // HEADER - // check header - int ORIGIN = 0x55; - if(version == 500) - ORIGIN = 0x58; - fseek(f,POS + ORIGIN,SEEK_SET); // check for 'O'RIGIN - char c; - fread(&c,1,1,f); - int jump=0; - if( c == 'O') - fprintf(debug," \"ORIGIN\" found ! (@ 0x%X)\n",POS+ORIGIN); - while( c != 'O' && jump < MAX_LEVEL) { // no inf loop - fprintf(debug," TRY %d \"O\"RIGIN not found ! : %c (@ 0x%X)",jump+1,c,POS+ORIGIN); - fprintf(debug," POS=0x%X | ORIGIN = 0x%X\n",POS,ORIGIN); - fflush(debug); - POS+=0x1F2; - fseek(f,POS + ORIGIN,SEEK_SET); - fread(&c,1,1,f); - jump++; - } - - int spread=i; - if(jump == MAX_LEVEL){ - fprintf(debug," Spreadsheet SECTION not found ! (@ 0x%X)\n",POS-10*0x1F2+0x55); - // setColName(spread); - return -5; - } - - fprintf(debug," [Spreadsheet SECTION (@ 0x%X)]\n",POS); - fflush(debug); - - // check spreadsheet name - fseek(f,POS + 0x12,SEEK_SET); - fread(&name,25,1,f); - - spread=findSpreadByName(name); - if(spread == -1) - spread=i; - - fprintf(debug," SPREADSHEET %d NAME : %s (@ 0x%X) has %d columns\n", - spread+1,name,POS + 0x12,speadSheets[spread].columns.size()); - fflush(debug); - - int ATYPE=0; - LAYER = POS; - if (version == 700) - ATYPE = 0x2E4; - else if (version == 610) - ATYPE = 0x358; - else if (version == 604) - ATYPE = 0x354; - else if (version == 601) - ATYPE = 0x500; // ? - else if (version == 600) - ATYPE = 0x314; - else if (version == 500) { - COL_JUMP=0x5D; - ATYPE = 0x300; - } - else if (version == 410) { - COL_JUMP = 0x58; - ATYPE = 0x229; - } - fflush(debug); - - /////////////// COLUMN Types /////////////////////////////////////////// - fprintf(debug," Spreadsheet has %d columns\n",speadSheets[spread].columns.size()); - for (unsigned int j=0;j -#include -#include -#include -#include - -using namespace boost; - -OriginFile::OriginFile(const string& fileName) -: fileVersion(0) -{ - BOOST_LOG_INIT((logging::trace >> logging::eol)); // log format - logging::sink s(new ofstream("./opjfile.log"), 1); - s.attach_qualifier(logging::log); - BOOST_LOG_ADD_OUTPUT_STREAM(s); - - ifstream file(fileName.c_str(), ios_base::binary); - - if(!file.is_open()) - { - cerr << format("Could not open %s!") % fileName.c_str() << endl; - return; - } - - string vers(4, 0); - file.seekg(0x7, ios_base::beg); - file >> vers; - fileVersion = lexical_cast(vers); - file.close(); - - BOOST_LOG_(1, format(" [version = %d]") % fileVersion); - - // translate version - if(fileVersion >= 130 && fileVersion <= 140) // 4.1 - fileVersion = 410; - else if(fileVersion == 210) // 5.0 - fileVersion = 500; - else if(fileVersion == 2625) // 6.0 - fileVersion = 600; - else if(fileVersion == 2627) // 6.0 SR1 - fileVersion = 601; - else if(fileVersion == 2630) // 6.0 SR4 - fileVersion = 604; - else if(fileVersion == 2635) // 6.1 - fileVersion = 610; - else if(fileVersion == 2656) // 7.0 - fileVersion = 700; - else if(fileVersion == 2672) // 7.0 SR3 - fileVersion = 703; - else if(fileVersion >= 2766 && fileVersion <= 2769) // 7.5 - fileVersion = 750; - else - { - BOOST_LOG_(1, format("Found unknown project version %d") % fileVersion); - BOOST_LOG_(1, "Please contact the authors of liborigin2"); - BOOST_LOG_FINALIZE(); - throw std::logic_error("Unknown project version"); - } - BOOST_LOG_(1, format("Found project version %.2f") % (fileVersion/100.0)); - - switch(fileVersion) - { - case 750: - parser.reset(createOrigin750Parser(fileName)); - break; - default: - parser.reset(createOriginDefaultParser(fileName)); - break; - } -} - -bool OriginFile::parse() -{ - return parser->parse(); -} - -double OriginFile::version() const -{ - return fileVersion/100.0; -} - -const tree* OriginFile::project() const -{ - return &parser->projectTree; -} - -vector::size_type OriginFile::spreadCount() const -{ - return parser->speadSheets.size(); -} - -Origin::SpreadSheet& OriginFile::spread(vector::size_type s) const -{ - return parser->speadSheets[s]; -} - -vector::size_type OriginFile::matrixCount() const -{ - return parser->matrixes.size(); -} - -Origin::Matrix& OriginFile::matrix(vector::size_type m) const -{ - return parser->matrixes[m]; -} - -vector::size_type OriginFile::functionCount() const -{ - return parser->functions.size(); -} - -vector::size_type OriginFile::functionIndex(const string& name) const -{ - return parser->findFunctionByName(name); -} - -Origin::Function& OriginFile::function(vector::size_type f) const -{ - return parser->functions[f]; -} - -vector::size_type OriginFile::graphCount() const -{ - return parser->graphs.size(); -} - -Origin::Graph& OriginFile::graph(vector::size_type g) const -{ - return parser->graphs[g]; -} - -vector::size_type OriginFile::noteCount() const -{ - return parser->notes.size(); -} - -Origin::Note& OriginFile::note(vector::size_type n) const -{ - return parser->notes[n]; -} - -string OriginFile::resultsLogString() const -{ - return parser->resultsLog; -} === removed file '3rdparty/liborigin/OriginFile.h' --- 3rdparty/liborigin/OriginFile.h 2009-11-18 10:33:29 +0000 +++ 3rdparty/liborigin/OriginFile.h 1970-01-01 00:00:00 +0000 @@ -1,75 +0,0 @@ -/*************************************************************************** - File : OriginFile.h - -------------------------------------------------------------------- - Copyright : (C) 2005-2007 Stefan Gerlach - (C) 2007-2008 Alex Kargovsky, Ion Vasilief - Email (use @ for *) : kargovsky*yumr.phys.msu.su, ion_vasilief*yahoo.fr - Description : Origin file import class - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#ifndef ORIGIN_FILE_H -#define ORIGIN_FILE_H - -/* version 0.0 2007-09-26 */ -#define LIBORIGIN_VERSION 0x00070926 -#define LIBORIGIN_VERSION_STRING "2007-09-26" - -#include "OriginObj.h" -#include "OriginParser.h" -#include - -using namespace std; - -class OriginFile -{ -public: - OriginFile(const string& fileName); - - bool parse(); //!< parse Origin file - double version() const; //!< get version of Origin file - - vector::size_type spreadCount() const; //!< get number of spreadsheets - Origin::SpreadSheet& spread(vector::size_type s) const; //!< get spreadsheet s - - vector::size_type matrixCount() const; //!< get number of matrices - Origin::Matrix& matrix(vector::size_type m) const; //!< get matrix m - - vector::size_type functionCount() const; //!< get number of functions - vector::size_type functionIndex(const string& name) const; //!< get name of function s - Origin::Function& function(vector::size_type f) const; //!< get function f - - vector::size_type graphCount() const; //!< get number of graphs - Origin::Graph& graph(vector::size_type g) const; //!< get graph g - - vector::size_type noteCount() const; //!< get number of notes - Origin::Note& note(vector::size_type n) const; //!< get note n - - const tree* project() const; //!< get project tree - string resultsLogString() const; //!< get Results Log - -private: - int fileVersion; - auto_ptr parser; -}; - -#endif // ORIGIN_FILE_H === removed file '3rdparty/liborigin/OriginObj.h' --- 3rdparty/liborigin/OriginObj.h 2009-11-18 10:33:29 +0000 +++ 3rdparty/liborigin/OriginObj.h 1970-01-01 00:00:00 +0000 @@ -1,703 +0,0 @@ -/*************************************************************************** - File : OriginObj.h - -------------------------------------------------------------------- - Copyright : (C) 2005-2007 Stefan Gerlach - (C) 2007-2008 Alex Kargovsky, Ion Vasilief - Email (use @ for *) : kargovsky*yumr.phys.msu.su, ion_vasilief*yahoo.fr - Description : Origin internal object classes - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - - -#ifndef ORIGIN_OBJ_H -#define ORIGIN_OBJ_H - -#include -#include -#include "boost/variant.hpp" -#include "boost/bind.hpp" -#include "boost/date_time/posix_time/ptime.hpp" - -using namespace std; - -#define _ONAN (-1.23456789E-300) - -namespace Origin -{ - enum ValueType {Numeric = 0, Text = 1, Time = 2, Date = 3, Month = 4, Day = 5, ColumnHeading = 6, TickIndexedDataset = 7, TextNumeric = 9, Categorical = 10}; - enum NumericDisplayType {DefaultDecimalDigits = 0, DecimalPlaces = 1, SignificantDigits = 2}; - enum Attach {Frame = 0, Page = 1, Scale = 2}; - enum BorderType {BlackLine = 0, Shadow = 1, DarkMarble = 2, WhiteOut = 3, BlackOut = 4, None = -1}; - enum FillPattern {NoFill, BDiagDense, BDiagMedium, BDiagSparse, FDiagDense, FDiagMedium, FDiagSparse, - DiagCrossDense, DiagCrossMedium, DiagCrossSparse, HorizontalDense, HorizontalMedium, HorizontalSparse, - VerticalDense, VerticalMedium, VerticalSparse, CrossDense, CrossMedium, CrossSparse}; - - struct Color - { - enum ColorType {None, Automatic, Regular, Custom, Increment, Indexing, RGB, Mapping}; - enum RegularColor {Black = 0, Red = 1, Green = 2, Blue = 3, Cyan = 4, Magenta = 5, Yellow = 6, DarkYellow = 7, Navy = 8, - Purple = 9, Wine = 10, Olive = 11, DarkCyan = 12, Royal= 13, Orange = 14, Violet = 15, Pink = 16, White = 17, - LightGray = 18, Gray = 19, LTYellow = 20, LTCyan = 21, LTMagenta = 22, DarkGray = 23/*, Custom = 255*/}; - - ColorType type; - union - { - unsigned char regular; - unsigned char custom[3]; - unsigned char starting; - unsigned char column; - }; - }; - - struct Rect - { - short left; - short top; - short right; - short bottom; - - Rect(short width = 0, short height = 0) - : left(0) - , top(0) - , right(width) - , bottom(height) - { - }; - - int height() const - { - return bottom - top; - }; - - int width() const - { - return right - left; - }; - - bool isValid() const - { - return height() > 0 && width() > 0; - } - }; - - struct ColorMapLevel - { - Color fillColor; - unsigned char fillPattern; - Color fillPatternColor; - double fillPatternLineWidth; - - bool lineVisible; - Color lineColor; - unsigned char lineStyle; - double lineWidth; - - bool labelVisible; - }; - - typedef vector > ColorMapVector; - - struct ColorMap - { - bool fillEnabled; - ColorMapVector levels; - }; - - struct Window - { - enum State {Normal, Minimized, Maximized}; - enum Title {Name, Label, Both}; - - string name; - string label; - unsigned int objectID; - bool hidden; - State state; - Title title; - Rect frameRect; - boost::posix_time::ptime creationDate; - boost::posix_time::ptime modificationDate; - - Window(const string& _name= "", const string& _label = "", bool _hidden = false) - : name(_name) - , label(_label) - , hidden(_hidden) - , state(Normal) - , title(Both) - {}; - }; - - typedef boost::variant variant; - - struct SpreadColumn - { - enum ColumnType {X, Y, Z, XErr, YErr, Label, NONE}; - - string name; - ColumnType type; - ValueType valueType; - int valueTypeSpecification; - int significantDigits; - int decimalPlaces; - NumericDisplayType numericDisplayType; - string command; - string comment; - int width; - unsigned int index; - vector data; - - SpreadColumn(const string& _name = "", unsigned int _index = 0) - : name(_name) - , index(_index) - , command("") - , comment("") - , valueType(Numeric) - , valueTypeSpecification(0) - , significantDigits(6) - , decimalPlaces(6) - , width(8) - , numericDisplayType(DefaultDecimalDigits) - {}; - }; - - struct SpreadSheet : public Window - { - unsigned int maxRows; - bool loose; - bool multisheet; - vector columns; - - SpreadSheet(const string& _name = "") - : Window(_name) - , loose(true) - , multisheet(false) - {}; - }; - - struct Excel : public Window - { - unsigned int maxRows; - bool loose; - vector sheets; - - Excel(const string& _name = "", const string& _label = "", int _maxRows = 0, bool _hidden = false, bool _loose = true) - : Window(_name, _label, _hidden) - , maxRows(_maxRows) - , loose(_loose) - { - }; - }; - - struct Matrix : public Window - { - enum ViewType {DataView, ImageView}; - enum HeaderViewType {ColumnRow, XY}; - - unsigned short rowCount; - unsigned short columnCount; - int valueTypeSpecification; - int significantDigits; - int decimalPlaces; - NumericDisplayType numericDisplayType; - string command; - int width; - unsigned int index; - ViewType view; - HeaderViewType header; - ColorMap colorMap; - vector data; - - Matrix(const string& _name = "", unsigned int _index = 0) - : Window(_name) - , index(_index) - , command("") - , valueTypeSpecification(0) - , significantDigits(6) - , decimalPlaces(6) - , width(8) - , numericDisplayType(DefaultDecimalDigits) - , view(DataView) - , header(ColumnRow) - {}; - }; - - struct Function - { - enum FunctionType {Normal, Polar}; - - string name; - FunctionType type; - string formula; - double begin; - double end; - int totalPoints; - unsigned int index; - - Function(const string& _name = "", unsigned int _index = 0) - : name(_name) - , index(_index) - , type(Normal) - , formula("") - , begin(0.0) - , end(0.0) - , totalPoints(0) - {}; - }; - - - struct TextBox - { - string text; - Rect clientRect; - Color color; - unsigned short fontSize; - int rotation; - int tab; - BorderType borderType; - Attach attach; - - TextBox(const string& _text = "") - : text(_text) - {}; - - TextBox(const string& _text, const Rect& _clientRect, const Color& _color, unsigned short _fontSize, int _rotation, int _tab, BorderType _borderType, Attach _attach) - : text(_text) - , clientRect(_clientRect) - , color(_color) - , fontSize(_fontSize) - , rotation(_rotation) - , tab(_tab) - , borderType(_borderType) - , attach(_attach) - {}; - }; - - struct PieProperties - { - unsigned char viewAngle; - unsigned char thickness; - bool clockwiseRotation; - short rotation; - unsigned short radius; - unsigned short horizontalOffset; - unsigned long displacedSectionCount; // maximum - 32 sections - unsigned short displacement; - - //labels - bool formatAutomatic; - bool formatValues; - bool formatPercentages; - bool formatCategories; - bool positionAssociate; - unsigned short distance; - - PieProperties() - : clockwiseRotation(false) - , formatAutomatic(false) - , formatValues(false) - , formatPercentages(false) - , formatCategories(false) - , positionAssociate(false) - {}; - }; - - struct VectorProperties - { - enum VectorPosition {Tail, Midpoint, Head}; - - Color color; - double width; - unsigned short arrowLenght; - unsigned char arrowAngle; - bool arrowClosed; - string endXColumnName; - string endYColumnName; - - VectorPosition position; - string angleColumnName; - string magnitudeColumnName; - float multiplier; - int constAngle; - int constMagnitude; - - VectorProperties() - : arrowClosed(false) - , position(Tail) - , multiplier(1.0) - , constAngle(0) - , constMagnitude(0) - {}; - }; - - struct TextProperties - { - enum Justify {Left, Center, Right}; - - Color color; - bool fontBold; - bool fontItalic; - bool fontUnderline; - bool whiteOut; - Justify justify; - - short rotation; - short xOffset; - short yOffset; - unsigned short fontSize; - }; - - struct SurfaceProperties - { - struct SurfaceColoration - { - bool fill; - bool contour; - Color lineColor; - double lineWidth; - }; - - enum Type {ColorMap3D, ColorFill, WireFrame, Bars}; - enum Grids {None, X, Y, XY}; - - unsigned char type; - Grids grids; - double gridLineWidth; - Color gridColor; - - bool backColorEnabled; - Color frontColor; - Color backColor; - - bool sideWallEnabled; - Color xSideWallColor; - Color ySideWallColor; - - SurfaceColoration surface; - SurfaceColoration topContour; - SurfaceColoration bottomContour; - - ColorMap colorMap; - }; - - struct GraphCurve - { - enum Plot {Line = 200, Scatter=201, LineSymbol=202, Column = 203, Area = 204, HiLoClose = 205, Box = 206, - ColumnFloat = 207, Vector = 208, PlotDot = 209, Wall3D = 210, Ribbon3D = 211, Bar3D = 212, ColumnStack = 213, - AreaStack = 214, Bar = 215, BarStack = 216, FlowVector = 218, Histogram = 219, MatrixImage = 220, Pie = 225, - Contour = 226, Unknown = 230, ErrorBar = 231, TextPlot = 232, XErrorBar = 233, SurfaceColorMap = 236, - SurfaceColorFill = 237, SurfaceWireframe = 238, SurfaceBars = 239, Line3D = 240, Text3D = 241, Mesh3D = 242, - XYZTriangular = 245, LineSeries = 246, YErrorBar = 254, XYErrorBar = 255, GraphScatter3D = 0x8AF0, - GraphTrajectory3D = 0x8AF1, Polar = 0x00020000, SmithChart = 0x00040000, FillArea = 0x00800000}; - enum LineStyle {Solid = 0, Dash = 1, Dot = 2, DashDot = 3, DashDotDot = 4, ShortDash = 5, ShortDot = 6, ShortDashDot = 7}; - enum LineConnect {NoLine = 0, Straight = 1, TwoPointSegment = 2, ThreePointSegment = 3, BSpline = 8, Spline = 9, StepHorizontal = 11, StepVertical = 12, StepHCenter = 13, StepVCenter = 14, Bezier = 15}; - - unsigned char type; - string dataName; - string xColumnName; - string yColumnName; - string zColumnName; - Color lineColor; - unsigned char lineStyle; - unsigned char lineConnect; - double lineWidth; - - bool fillArea; - unsigned char fillAreaType; - unsigned char fillAreaPattern; - Color fillAreaColor; - Color fillAreaPatternColor; - double fillAreaPatternWidth; - unsigned char fillAreaPatternBorderStyle; - Color fillAreaPatternBorderColor; - double fillAreaPatternBorderWidth; - - unsigned short symbolType; - Color symbolColor; - Color symbolFillColor; - double symbolSize; - unsigned char symbolThickness; - unsigned char pointOffset; - - bool connectSymbols; - - //pie - PieProperties pie; - - //vector - VectorProperties vector; - - //text - TextProperties text; - - //surface - SurfaceProperties surface; - - //contour - ColorMap colorMap; - }; - - struct GraphAxisBreak - { - bool show; - - bool log10; - double from; - double to; - double position; - - double scaleIncrementBefore; - double scaleIncrementAfter; - - unsigned char minorTicksBefore; - unsigned char minorTicksAfter; - - GraphAxisBreak() - : show(false) - {}; - }; - - struct GraphGrid - { - bool hidden; - unsigned char color; - unsigned char style; - double width; - }; - - struct GraphAxisFormat - { - bool hidden; - unsigned char color; - double thickness; - double majorTickLength; - int majorTicksType; - int minorTicksType; - int axisPosition; - double axisPositionValue; - }; - - struct GraphAxisTick - { - bool hidden; - unsigned char color; - ValueType valueType; - int valueTypeSpecification; - int decimalPlaces; - unsigned short fontSize; - bool fontBold; - string dataName; - string columnName; - int rotation; - }; - - struct GraphAxis - { - enum AxisPosition {Left = 0, Bottom, Right, Top, Front, Back}; - enum Scale {Linear = 0, Log10 = 1, Probability = 2, Probit = 3, Reciprocal = 4, OffsetReciprocal = 5, Logit = 6, Ln = 7, Log2 = 8}; - - AxisPosition position; - TextBox label; - double min; - double max; - double step; - unsigned char majorTicks; - unsigned char minorTicks; - unsigned char scale; - GraphGrid majorGrid; - GraphGrid minorGrid; - GraphAxisFormat formatAxis[2]; - GraphAxisTick tickAxis[2]; //bottom-top, left-right - }; - - struct Figure - { - enum FigureType {Rectangle, Circle}; - - FigureType type; - Rect clientRect; - Attach attach; - Color color; - unsigned char style; - double width; - Color fillAreaColor; - unsigned char fillAreaPattern; - Color fillAreaPatternColor; - double fillAreaPatternWidth; - bool useBorderColor; - - Figure(FigureType _type = Rectangle) - : type(_type) - { - }; - }; - - struct LineVertex - { - unsigned char shapeType; - double shapeWidth; - double shapeLength; - double x; - double y; - - LineVertex() - : shapeType(0) - , shapeWidth(0.0) - , shapeLength(0.0) - , x(0.0) - , y(0.0) - {}; - }; - - struct Line - { - Rect clientRect; - Color color; - Attach attach; - double width; - unsigned char style; - LineVertex begin; - LineVertex end; - }; - - struct Bitmap - { - Rect clientRect; - Attach attach; - unsigned long size; - unsigned char* data; - - Bitmap() - : size(0) - , data(0) - { - }; - - Bitmap(const Bitmap& bitmap) - : clientRect(bitmap.clientRect) - , attach(bitmap.attach) - , size(bitmap.size) - { - if(size > 0) - { - data = new unsigned char[size]; - memcpy(data, bitmap.data, size); - } - }; - - ~Bitmap() - { - if(size > 0) - delete data; - }; - }; - - struct GraphLayer - { - Rect clientRect; - TextBox legend; - Color backgroundColor; - BorderType borderType; - - GraphAxis xAxis; - GraphAxis yAxis; - GraphAxis zAxis; - - GraphAxisBreak xAxisBreak; - GraphAxisBreak yAxisBreak; - GraphAxisBreak zAxisBreak; - - double histogramBin; - double histogramBegin; - double histogramEnd; - - vector texts; - vector lines; - vector
figures; - vector bitmaps; - vector curves; - - float xLength; - float yLength; - float zLength; - - //bool threeDimensional; - bool is3D() const - { - return curves.end() != find_if(curves.begin(), curves.end(), - boost::bind(logical_or(), boost::bind(&GraphCurve::type, _1) == GraphCurve::Line3D, - boost::bind(&GraphCurve::type, _1) == GraphCurve::Mesh3D)); - } - }; - - struct GraphLayerRange - { - double min; - double max; - double step; - - GraphLayerRange(double _min = 0.0, double _max = 0.0, double _step = 0.0) - : min(_min) - , max(_max) - , step(_step) - {}; - }; - - struct Graph : public Window - { - vector layers; - unsigned short width; - unsigned short height; - - Graph(const string& _name = "") - : Window(_name) - {}; - }; - - struct Note : public Window - { - string text; - Note(const string& _name = "") - : Window(_name) - {}; - }; - - struct ProjectNode - { - enum NodeType {SpreadSheet, Matrix, Excel, Graph, Note, Folder}; - - NodeType type; - string name; - boost::posix_time::ptime creationDate; - boost::posix_time::ptime modificationDate; - - ProjectNode(const string& _name = "", NodeType _type = Folder, const boost::posix_time::ptime& _creationDate = boost::posix_time::ptime(), const boost::posix_time::ptime& _modificationDate = boost::posix_time::ptime()) - : name(_name) - , type(_type) - , creationDate(_creationDate) - , modificationDate(_modificationDate) - {}; - }; -} - - - -#endif // ORIGIN_OBJ_H === removed file '3rdparty/liborigin/OriginParser.cpp' --- 3rdparty/liborigin/OriginParser.cpp 2009-11-18 10:33:29 +0000 +++ 3rdparty/liborigin/OriginParser.cpp 1970-01-01 00:00:00 +0000 @@ -1,189 +0,0 @@ -/*************************************************************************** - File : OriginParser.cpp - -------------------------------------------------------------------- - Copyright : (C) 2008 Alex Kargovsky - Email (use @ for *) : kargovsky*yumr.phys.msu.su - Description : Origin file parser base class - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#include "OriginParser.h" -#include -#include -#include -#include -#include - -using namespace boost; -using namespace boost::algorithm; -using namespace Origin; - -vector::size_type OriginParser::findSpreadByName(const string& name) const -{ - vector::const_iterator it = find_if(speadSheets.begin(), - speadSheets.end(), - bind(iequals, - bind(&SpreadSheet::name, _1), - name, - locale())); - return it != speadSheets.end() ? it - speadSheets.begin() : -1; -} - -vector::size_type OriginParser::findExcelByName(const string& name) const -{ - vector::const_iterator it = find_if(excels.begin(), - excels.end(), - bind(iequals, - bind(&Excel::name, _1), - name, - locale())); - return it != excels.end() ? it - excels.begin() : -1; -} - -vector::size_type OriginParser::findSpreadColumnByName(vector::size_type spread, const string& name) const -{ - vector::const_iterator it = find_if(speadSheets[spread].columns.begin(), - speadSheets[spread].columns.end(), - bind(&SpreadColumn::name, _1) == name); - return it != speadSheets[spread].columns.end() ? it - speadSheets[spread].columns.begin() : -1; -} - -vector::size_type OriginParser::findExcelColumnByName(vector::size_type excel, vector::size_type sheet, const string& name) const -{ - vector::const_iterator it = find_if(excels[excel].sheets[sheet].columns.begin(), - excels[excel].sheets[sheet].columns.end(), - bind(&SpreadColumn::name, _1) == name); - return it != excels[excel].sheets[sheet].columns.end() ? it - excels[excel].sheets[sheet].columns.begin() : -1; -} - -vector::size_type OriginParser::findMatrixByName(const string& name) const -{ - vector::const_iterator it = find_if(matrixes.begin(), - matrixes.end(), - bind(iequals, - bind(&Matrix::name, _1), - name, - locale())); - return it != matrixes.end() ? it - matrixes.begin() : -1; -} - -vector::size_type OriginParser::findFunctionByName(const string& name) const -{ - vector::const_iterator it = find_if(functions.begin(), - functions.end(), - bind(iequals, - bind(&Function::name, _1), - name, - locale())); - return it != functions.end() ? it - functions.begin() : -1; -} - -pair OriginParser::findDataByIndex(unsigned int index) const -{ - for(vector::const_iterator it = speadSheets.begin(); it != speadSheets.end(); ++it) - { - for(vector::const_iterator it1 = it->columns.begin(); it1 != it->columns.end(); ++it1) - { - if(it1->index == index) - return make_pair("T_" + it->name, it1->name); - } - } - - for(vector::const_iterator it = matrixes.begin(); it != matrixes.end(); ++it) - { - if(it->index == index) - return make_pair("M_" + it->name, it->name); - } - - for(vector::const_iterator it = excels.begin(); it != excels.end(); ++it) - { - for(vector::const_iterator it1 = it->sheets.begin(); it1 != it->sheets.end(); ++it1) - { - for(vector::const_iterator it2 = it1->columns.begin(); it2 != it1->columns.end(); ++it2) - { - if(it2->index == index) - return make_pair("E_" + it->name, it2->name); - } - } - } - - for(vector::const_iterator it = functions.begin(); it != functions.end(); ++it) - { - if(it->index == index) - return make_pair("F_" + it->name, it->name); - } - - return pair(); -} - -pair OriginParser::findObjectByIndex(unsigned int index) const -{ - for(vector::const_iterator it = speadSheets.begin(); it != speadSheets.end(); ++it) - { - if(it->objectID == index) - return make_pair(ProjectNode::SpreadSheet, it->name); - } - - for(vector::const_iterator it = matrixes.begin(); it != matrixes.end(); ++it) - { - if(it->objectID == index) - return make_pair(ProjectNode::Matrix, it->name); - } - - for(vector::const_iterator it = excels.begin(); it != excels.end(); ++it) - { - if(it->objectID == index) - return make_pair(ProjectNode::Excel, it->name); - } - - for(vector::const_iterator it = graphs.begin(); it != graphs.end(); ++it) - { - if(it->objectID == index) - return make_pair(ProjectNode::Graph, it->name); - } - - return pair(); -} - -void OriginParser::convertSpreadToExcel(vector::size_type spread) -{ - //add new Excel sheet - excels.push_back(Excel(speadSheets[spread].name, speadSheets[spread].label, speadSheets[spread].maxRows, speadSheets[spread].hidden, speadSheets[spread].loose)); - - for(vector::iterator it = speadSheets[spread].columns.begin(); it != speadSheets[spread].columns.end(); ++it) - { - unsigned int index = 0; - int pos = it->name.find_last_of("@"); - if(pos != -1) - { - index = lexical_cast(it->name.substr(pos + 1).c_str()) - 1; - it->name = it->name.substr(0, pos); - } - - if(excels.back().sheets.size() <= index) - excels.back().sheets.resize(index + 1); - - excels.back().sheets[index].columns.push_back(*it); - } - - speadSheets.erase(speadSheets.begin() + spread); -} \ No newline at end of file === removed file '3rdparty/liborigin/OriginParser.h' --- 3rdparty/liborigin/OriginParser.h 2009-11-18 10:33:29 +0000 +++ 3rdparty/liborigin/OriginParser.h 1970-01-01 00:00:00 +0000 @@ -1,67 +0,0 @@ -/*************************************************************************** - File : OriginParser.h - -------------------------------------------------------------------- - Copyright : (C) 2008 Alex Kargovsky - Email (use @ for *) : kargovsky*yumr.phys.msu.su - Description : Origin file parser base class - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#ifndef ORIGIN_PARSER_H -#define ORIGIN_PARSER_H - -#include "OriginObj.h" -#include "tree.hh" - -class OriginParser -{ -public: - virtual ~OriginParser() {}; - virtual bool parse() = 0; - - vector::size_type findSpreadByName(const string& name) const; - vector::size_type findMatrixByName(const string& name) const; - vector::size_type findFunctionByName(const string& name) const; - vector::size_type findExcelByName(const string& name) const; - -protected: - vector::size_type findSpreadColumnByName(vector::size_type spread, const string& name) const; - vector::size_type findExcelColumnByName(vector::size_type excel, vector::size_type sheet, const string& name) const; - pair findDataByIndex(unsigned int index) const; - pair findObjectByIndex(unsigned int index) const; - void convertSpreadToExcel(vector::size_type spread); - -public: - vector speadSheets; - vector matrixes; - vector excels; - vector functions; - vector graphs; - vector notes; - tree projectTree; - string resultsLog; -}; - -OriginParser* createOriginDefaultParser(const string& fileName); -OriginParser* createOrigin750Parser(const string& fileName); - -#endif // ORIGIN_PARSER_H === removed file '3rdparty/liborigin/copying' --- 3rdparty/liborigin/copying 2009-12-08 18:06:27 +0000 +++ 3rdparty/liborigin/copying 1970-01-01 00:00:00 +0000 @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. === removed directory '3rdparty/liborigin/doc' === removed file '3rdparty/liborigin/doc/Doxyfile' --- 3rdparty/liborigin/doc/Doxyfile 2009-11-18 10:33:29 +0000 +++ 3rdparty/liborigin/doc/Doxyfile 1970-01-01 00:00:00 +0000 @@ -1,236 +0,0 @@ -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = liborigin2 -PROJECT_NUMBER = 06/04/2009 -OUTPUT_DIRECTORY = . -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = YES -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = YES -INHERIT_DOCS = YES -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 4 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = NO -OPTIMIZE_OUTPUT_JAVA = NO -SUBGROUPING = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = YES -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = YES -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = .. -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.dox \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.txt \ - *.CC \ - *.C++ \ - *.HH \ - *.H++ \ - *.C \ - *.H -RECURSIVE = yes -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = *moc_* -EXAMPLE_PATH = ../README ../COPYING ../liborigin.pro -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -VERBATIM_HEADERS = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = YES -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = NO -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -# recommendation: install graphviz and use HAVE_DOT = YES -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 1000 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO === removed directory '3rdparty/liborigin/doc/html' === removed directory '3rdparty/liborigin/doc/html/images' === removed file '3rdparty/liborigin/doc/html/images/origin_import.png' Binary files 3rdparty/liborigin/doc/html/images/origin_import.png 2009-11-18 10:33:29 +0000 and 3rdparty/liborigin/doc/html/images/origin_import.png 1970-01-01 00:00:00 +0000 differ === removed file '3rdparty/liborigin/doc/liborigin2.dox' --- 3rdparty/liborigin/doc/liborigin2.dox 2009-11-18 10:33:29 +0000 +++ 3rdparty/liborigin/doc/liborigin2.dox 1970-01-01 00:00:00 +0000 @@ -1,66 +0,0 @@ -/*! - \mainpage liborigin2 - - A library for reading OriginLab project files. Only files created with Origin version 7.5 can be parsed for the moment. - Any help from developers interested in working on the import of files created with other Origin versions is most welcome. - - \image html images/origin_import.png - - \section license License - - liborigin2 is distributed under the terms of the \ref gpllicense. - - \section platforms Platforms - - liborigin2 might be usable in all environments where you find a C/C++ compiler. - - \section dependencies Dependencies - - liborigin2 depends on the following libraries: - BOOST C++ libraries (version >= 1.33.0) and - tree.hh.\n - - \section downloads Downloads - liborigin2.zip - - \section svn SVN - The developement version of liborigin2 can be found inside the QtiPlot project's SVN repository hosted by - BerliOS Developer. - It can be checked out through anonymous SVN with the following instruction set: - - - \code svn checkout svn://svn.berlios.de/qtiplot/trunk/3rdparty/liborigin \endcode - - \section installonmainpage Installation - - Have a look at the \ref projectfile project file in the source archive. It is prepared for building - dynamic libraries in Win32 and Unix/X11 environments. If you don't know what to do with it, read the \ref liborigin2install file and/or - Trolltechs qmake manual. - - \section relatedprojects Related Projects - - QtiPlot, data analysis and scientific plotting tool. - - \section credits Credits: - \par Author: - Alex Kargovsky - \par Contributors: - Stefan Gerlach, Ion Vasilief - \par Contact: - Ion Vasilief \ -*/ - -/*! - \page gpllicense GPL License, Version 3 - \include "COPYING" -*/ - -/*! - \page projectfile liborigin.pro - \include "liborigin.pro" -*/ - -/*! - \page liborigin2install README - \include "README" -*/ === removed file '3rdparty/liborigin/endianfstream.hh' --- 3rdparty/liborigin/endianfstream.hh 2009-11-18 10:33:29 +0000 +++ 3rdparty/liborigin/endianfstream.hh 1970-01-01 00:00:00 +0000 @@ -1,225 +0,0 @@ -/*************************************************************************** - File : endianfstream.hh - -------------------------------------------------------------------- - Copyright : (C) 2008 Alex Kargovsky - Email (use @ for *) : kargovsky*yumr.phys.msu.su - Description : Endianless file stream class - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#ifndef ENDIAN_FSTREAM_H -#define ENDIAN_FSTREAM_H - -#include -#include "OriginObj.h" - -namespace std -{ - class iendianfstream : public ifstream - { - public: - iendianfstream(const char *_Filename, ios_base::openmode _Mode = ios_base::in) - : ifstream(_Filename, _Mode) - { - short word = 0x4321; - bigEndian = (*(char*)& word) != 0x21; - }; - - iendianfstream& operator>>(bool& value) - { - char c; - get(c); - value = (c != 0); - return *this; - } - - iendianfstream& operator>>(char& value) - { - get(value); - return *this; - } - - iendianfstream& operator>>(unsigned char& value) - { - get(reinterpret_cast(value)); - return *this; - } - - iendianfstream& operator>>(short& value) - { - read(reinterpret_cast(&value), sizeof(value)); - if(bigEndian) - swap_bytes(reinterpret_cast(&value), sizeof(value)); - - return *this; - } - - iendianfstream& operator>>(unsigned short& value) - { - read(reinterpret_cast(&value), sizeof(value)); - if(bigEndian) - swap_bytes(reinterpret_cast(&value), sizeof(value)); - - return *this; - } - - iendianfstream& operator>>(int& value) - { - read(reinterpret_cast(&value), sizeof(value)); - if(bigEndian) - swap_bytes(reinterpret_cast(&value), sizeof(value)); - - return *this; - } - - iendianfstream& operator>>(unsigned int& value) - { - read(reinterpret_cast(&value), sizeof(value)); - if(bigEndian) - swap_bytes(reinterpret_cast(&value), sizeof(value)); - - return *this; - } - - iendianfstream& operator>>(long& value) - { - read(reinterpret_cast(&value), sizeof(value)); - if(bigEndian) - swap_bytes(reinterpret_cast(&value), sizeof(value)); - - return *this; - } - - iendianfstream& operator>>(unsigned long& value) - { - read(reinterpret_cast(&value), sizeof(value)); - if(bigEndian) - swap_bytes(reinterpret_cast(&value), sizeof(value)); - - return *this; - } - - iendianfstream& operator>>(float& value) - { - read(reinterpret_cast(&value), sizeof(value)); - if(bigEndian) - swap_bytes(reinterpret_cast(&value), sizeof(value)); - - return *this; - } - - iendianfstream& operator>>(double& value) - { - read(reinterpret_cast(&value), sizeof(value)); - if(bigEndian) - swap_bytes(reinterpret_cast(&value), sizeof(value)); - - return *this; - } - - iendianfstream& operator>>(long double& value) - { - read(reinterpret_cast(&value), sizeof(value)); - if(bigEndian) - swap_bytes(reinterpret_cast(&value), sizeof(value)); - - return *this; - } - - iendianfstream& operator>>(string& value) - { - read(reinterpret_cast(&value[0]), value.size()); - string::size_type pos = value.find_first_of('\0'); - if(pos != string::npos) - value.resize(pos); - - return *this; - } - - iendianfstream& operator>>(Origin::Color& value) - { - unsigned char color[4]; - read(reinterpret_cast(&color), sizeof(color)); - switch(color[3]) - { - case 0: - if(color[0] < 0x64) - { - value.type = Origin::Color::Regular; - value.regular = color[0]; - } - else - { - switch(color[2]) - { - case 0: - value.type = Origin::Color::Indexing; - break; - case 0x40: - value.type = Origin::Color::Mapping; - break; - case 0x80: - value.type = Origin::Color::RGB; - break; - } - - value.column = color[0] - 0x64; - } - - break; - case 1: - value.type = Origin::Color::Custom; - for(int i = 0; i < 3; ++i) - value.custom[i] = color[i]; - break; - case 0x20: - value.type = Origin::Color::Increment; - value.starting = color[1]; - break; - case 0xFF: - if(color[0] == 0xFC) - value.type = Origin::Color::None; - else if(color[0] == 0xF7) - value.type = Origin::Color::Automatic; - - break; - } - - return *this; - } - - private: - bool bigEndian; - void swap_bytes(unsigned char* data, int size) - { - register int i = 0; - register int j = size - 1; - while(i < j) - { - std::swap(data[i], data[j]); - ++i, --j; - } - } - }; -} - -#endif // ENDIAN_FSTREAM_H \ No newline at end of file === removed file '3rdparty/liborigin/liborigin.pro' --- 3rdparty/liborigin/liborigin.pro 2009-11-18 10:33:29 +0000 +++ 3rdparty/liborigin/liborigin.pro 1970-01-01 00:00:00 +0000 @@ -1,26 +0,0 @@ -TARGET = origin2 -TEMPLATE = lib -CONFIG += warn_on release thread -#CONFIG += staticlib -MOC_DIR = ./tmp -OBJECTS_DIR = ./tmp - -DESTDIR = ./ - -#INCLUDEPATH += boost_1_33_0 -LIBS += -lboost_date_time -LIBS += -lboost_thread - -HEADERS += endianfstream.hh -HEADERS += logging.hpp -HEADERS += OriginObj.h -HEADERS += OriginFile.h -HEADERS += OriginParser.h -HEADERS += OriginDefaultParser.h -HEADERS += Origin750Parser.h - -SOURCES += OriginFile.cpp -SOURCES += OriginParser.cpp -SOURCES += OriginDefaultParser.cpp -SOURCES += Origin750Parser.cpp - === removed file '3rdparty/liborigin/logging.hpp' --- 3rdparty/liborigin/logging.hpp 2009-11-18 10:33:29 +0000 +++ 3rdparty/liborigin/logging.hpp 1970-01-01 00:00:00 +0000 @@ -1,619 +0,0 @@ -// Boost general library logging.hpp header file ---------------------------// - -// (C) Copyright Jean-Daniel Michaud 2007. Permission to copy, use, modify, -// sell and distribute this software is granted provided this copyright notice -// appears in all copies. This software is provided "as is" without express or -// implied warranty, and with no claim as to its suitability for any purpose. - -// See http://www.boost.org/LICENSE_1_0.txt for licensing. -// See http://code.google.com/p/loglite/ for library home page. - -#ifndef BOOST_LOGGING_HPP -#define BOOST_LOGGING_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef BOOST_CONFIG_HPP -# include -#endif -#if defined(BOOST_HAS_THREADS) -# include -# include -#endif // BOOST_HAS_THREADS -#include -#include -#include - -#ifndef BOOST_NO_CODE_GENERATION_FOR_LOG -#define BOOST_LOG_INIT( format ) \ -{ \ - boost::logging::logger *l = boost::logging::logger::get_instance(); \ - assert(l); \ - l->add_format(format); \ -} - -#define BOOST_LOG_ADD_OUTPUT_STREAM( sink ) \ -{ \ - boost::logging::logger *l = boost::logging::logger::get_instance(); \ - assert(l); \ - l->add_sink(sink); \ -} - -#define BOOST_LOG(level, qualifier, _trace) \ -{ \ - boost::logging::logger *l = boost::logging::logger::get_instance(); \ - assert(l); \ - if (l->get_global_max_log_level() >= level) \ - { \ - if (l->m_string_stream.str() != "") \ - l->m_string_stack.push(l->m_string_stream.str()); \ - \ - l->m_string_stream.str(""); \ - l->m_string_stream << _trace; \ - l->trace(level, qualifier, l->m_string_stream.str(), __FILE__, __LINE__); \ - if (!l->m_string_stack.empty()) \ - { \ - l->m_string_stream.str(l->m_string_stack.top()); \ - l->m_string_stack.pop(); \ - } \ - } \ -} - -#define BOOST_LOG_( level, _trace ) \ - { BOOST_LOG(level, boost::logging::log, _trace) } - -#define BOOST_LOG_UNFORMATTED(level, qualifier, _trace) \ -{ \ - boost::logging::logger *l = boost::logging::logger::get_instance(); \ - assert(l); \ - if (l->get_global_max_log_level() >= level) \ - { \ - if (l->m_string_stream.str() != "") \ - l->m_string_stack.push(l->m_string_stream.str()); \ - \ - l->m_string_stream.str(""); \ - l->m_string_stream << _trace; \ - l->unformatted_trace(level, qualifier, \ - l->m_string_stream.str(), __FILE__, __LINE__); \ - if (!l->m_string_stack.empty()) \ - { \ - l->m_string_stream.str(l->m_string_stack.top()); \ - l->m_string_stack.pop(); \ - } \ - } \ -} - -#define BOOST_LOG_FINALIZE() \ -{ \ - boost::logging::logger *l = boost::logging::logger::get_instance(); \ - assert(l); \ - l->clear(); \ -} -#else // !BOOST_NO_CODE_GENERATION_FOR_LOG -#define BOOST_LOG_INIT( format ) -#define BOOST_LOG_ADD_OUTPUT_STREAM( sink ) -#define BOOST_LOG(level, qualifier, _trace) -#define BOOST_LOG_( level, _trace ) -#define BOOST_LOG_UNFORMATTED(level, qualifier, _trace) -#endif // BOOST_NO_CODE_GENERATION_FOR_LOG - -#define BOOST_MAX_LINE_STR_SIZE 20 // log(2^64) -#define BOOST_LEVEL_UP_LIMIT 999 - -namespace boost { - - namespace logging { - -// Logging forward declarations ---------------------------------------------// - class log_element; - class level_element; - class qualifier; - class trace_element; - class format; - class sink; - class logger; - -// Logging typedefs declarations --------------------------------------------// - typedef enum { LEVEL = 0, QUALIFIER, TRACE, FILENAME, LINE } param_e; - typedef enum { SINK = 0, FORMAT } sink_format_assoc_e; - typedef std::list > element_list_t; - typedef std::list > stream_list_t; - typedef unsigned short level_t; - typedef tuple log_param_t; - typedef std::list format_list_t; - typedef tuple sink_format_assoc_t; - typedef std::list sink_format_assoc_list_t; - typedef std::list qualifier_list_t; - -// Used for shared_ptr() on statically allocated log_element ----------------// - struct null_deleter - { void operator()(void const *) const {} }; - -// Qualifier class declaration ----------------------------------------------// - class qualifier - { - public: - qualifier() {} - inline std::string to_string() const { return m_identifier; } - virtual bool operator==(const qualifier &q) { return false; } - protected: - std::string m_identifier; - }; - - class log_qualifier : public qualifier - { - public: - log_qualifier() { m_identifier = "log"; } - bool operator==(const qualifier &q) - { return (dynamic_cast(&q) != NULL); } - }; - - class notice_qualifier : public qualifier - { - public: - notice_qualifier() { m_identifier = "notice"; } - bool operator==(const qualifier &q) - { return (dynamic_cast(&q) != NULL); } - }; - - class warning_qualifier : public qualifier - { - public: - warning_qualifier() { m_identifier = "warning"; } - bool operator==(const qualifier &q) - { return (dynamic_cast(&q) != NULL); } - }; - - class error_qualifier : public qualifier - { - public: - error_qualifier() { m_identifier = "error"; } - bool operator==(const qualifier &q) - { return (dynamic_cast(&q) != NULL); } - }; - -// Element classes declaration ---------------------------------------------// - class log_element - { - public: - virtual std::string to_string() { assert(0); return ""; }; - - virtual std::string visit(format &f, const log_param_t &log_param); - }; - - class level_element : public log_element - { - public: - std::string to_string(level_t l) - { - return str(boost::format("%i") % l); - }; - - std::string visit(format &f, const log_param_t &log_param); - }; - - class filename_element : public log_element - { - public: - std::string to_string(const std::string &f) { return f; } - std::string visit(format &f, const log_param_t &log_param); - }; - - class line_element : public log_element - { - public: - std::string to_string(unsigned int l) - { - return str(boost::format("%i") % l); - } - std::string visit(format &f, const log_param_t &log_param); - }; - - class date_element : public log_element - { - public: - std::string to_string() - { - boost::gregorian::date d(boost::gregorian::day_clock::local_day()); - return boost::gregorian::to_iso_extended_string(d); - } - }; - - class time_element : public log_element - { - public: - std::string to_string() - { - boost::posix_time::ptime - t(boost::posix_time::microsec_clock::local_time()); - return boost::posix_time::to_simple_string(t); - }; - }; - - class trace_element : public log_element - { - public: - std::string to_string(const std::string& s) { return s; }; - - std::string visit(format &f, const log_param_t &log_param); - }; - - class eol_element : public log_element - { - public: - std::string to_string() { return "\n"; }; - }; - - class literal_element : public log_element - { - public: - explicit literal_element(const std::string &l) : m_literal(l) {} - std::string to_string() { return m_literal; }; - private: - std::string m_literal; - }; - - class qualifier_element : public log_element - { - public: - qualifier_element(const qualifier &lq) - { - m_qualifier_identifier = lq.to_string(); - } - std::string to_string() { return m_qualifier_identifier; }; - private: - std::string m_qualifier_identifier; - }; - -// Format class declatation -------------------------------------------------// - class format - { - public: - format(log_element &e) - : m_identifier("unnamed") - { - boost::shared_ptr p(&e, null_deleter()); - m_element_list.push_back(p); - } - - format(log_element &e, const std::string &identifier) - : m_identifier(identifier) - { - boost::shared_ptr p(&e, null_deleter()); - m_element_list.push_back(p); - } - - format(element_list_t e) - : m_element_list(e), m_identifier("unnamed") {} - - format(element_list_t e, const std::string &identifier) - : m_element_list(e), m_identifier(identifier) {} - - std::string produce_trace(const log_param_t &log_param) - { - element_list_t::iterator e_it = m_element_list.begin(); - std::stringstream str_stream; - for (; e_it != m_element_list.end(); ++e_it) - { - str_stream << (*e_it)->visit(*this, log_param); - } - - return str_stream.str(); - } - - // Visitors for the log elements - std::string accept(log_element &e) - { - return e.to_string(); - } - std::string accept(level_element &e, level_t l) - { - return e.to_string(l); - } - std::string accept(trace_element &e, const std::string& s) - { - return e.to_string(s); - } - std::string accept(filename_element &e, const std::string& s) - { - return e.to_string(s); - } - std::string accept(line_element &e, unsigned int l) - { - return e.to_string(l); - } - - private: - element_list_t m_element_list; - std::string m_identifier; - }; - -// Sink class declaration ---------------------------------------------------// - class sink - { - public: - sink(std::ostream *s, level_t max_log_level = 1) - { - if (s) - if (*s == std::cout || *s == std::cerr || *s == std::clog) - m_output_stream.reset(s, null_deleter()); - else - m_output_stream.reset(s); - - set_max_log_level(max_log_level); - } - - void set_max_log_level(level_t max_log_level) - { - m_max_log_level = ((BOOST_LEVEL_UP_LIMIT < max_log_level) - ? BOOST_LEVEL_UP_LIMIT : max_log_level); - } - - inline level_t get_max_log_level() const { return m_max_log_level; } - - void consume_trace(format &f, const log_param_t &log_param) - { - /* make here check to avoid producing a useless trace */ - if (get(log_param) > m_max_log_level) - return ; - - qualifier_list_t::const_iterator it = m_qualifier_list.begin(); - bool qualifier_present = false; - for ( ; !qualifier_present && it != m_qualifier_list.end(); ++it) - qualifier_present = (**it == *get(log_param)); - - if (!qualifier_present) - return ; - - *m_output_stream << f.produce_trace(log_param); - } - - void attach_qualifier(qualifier &q) - { - m_qualifier_list.push_back(&q); - } - - private: - level_t m_max_log_level; - shared_ptr m_output_stream; - qualifier_list_t m_qualifier_list; - }; - -// Element static instantiations --------------------------------------------// - static level_element level = level_element(); - static filename_element filename = filename_element(); - static line_element line = line_element(); - static date_element date = date_element(); - static time_element time = time_element(); - static trace_element trace = trace_element(); - static eol_element eol = eol_element(); - - static log_qualifier log = log_qualifier(); - static notice_qualifier notice = notice_qualifier(); - static warning_qualifier warning = warning_qualifier(); - static error_qualifier error = error_qualifier(); - -// Logger class declaration ------------------------------------------------// - class logger - { - public: - logger() : m_global_max_log_level(0) {} - - void clear() - { - m_format_list.clear(); - m_sink_format_assoc.clear(); - } - - static logger *get_instance() - { -#if defined(BOOST_HAS_THREADS) - static boost::mutex m_inst_mutex; - boost::mutex::scoped_lock scoped_lock(m_inst_mutex); -#endif // BOOST_HAS_THREADS - static logger *l = NULL; - - if (!l) - { - l = new logger(); - static shared_ptr s_ptr_l(l); - } - - return l; - } - - void add_format(const format &f) - { - m_format_list.push_back(f); - } - - void add_sink(const sink &s) - { - if (m_format_list.begin() == m_format_list.end()) - throw "no format defined"; - - // Updating global_max_level used for full lazy evaluation - m_global_max_log_level = - (m_global_max_log_level < s.get_max_log_level()) - ? - s.get_max_log_level() - : - m_global_max_log_level; - - m_sink_format_assoc.push_back - ( - sink_format_assoc_t(s, *m_format_list.begin()) - ); - } - - void add_sink(const sink &s, format &f) - { - // Updating global_max_level used for full lazy evaluation - m_global_max_log_level = - (m_global_max_log_level < s.get_max_log_level()) - ? - s.get_max_log_level() - : - m_global_max_log_level; - - m_sink_format_assoc.push_back(sink_format_assoc_t(s, f)); - } - - inline level_t get_global_max_log_level() - { return m_global_max_log_level; } - - void trace(unsigned short l, - const qualifier &q, - const std::string &t, - const std::string &f, - unsigned int ln) - { -#if defined(BOOST_HAS_THREADS) - boost::mutex::scoped_lock scoped_lock(m_mutex); -#endif // BOOST_HAS_THREADS - - log_param_t log_param(l, &q, t, f, ln); - sink_format_assoc_list_t::iterator - s_it = m_sink_format_assoc.begin(); - for (; s_it != m_sink_format_assoc.end(); ++s_it) - { - get(*s_it).consume_trace(get(*s_it), log_param); - } - } - - void unformatted_trace(unsigned short l, - const qualifier &q, - const std::string &t, - const std::string &f, - unsigned int ln); - - public: - std::stringstream m_string_stream; - std::stack m_string_stack; - - private: - format_list_t m_format_list; - sink_format_assoc_list_t m_sink_format_assoc; - - // The global max log level is the highest log level on all the link - // added to the logger. If no sink as a log level high enougth for - // a trace, the trace does not need to be evaluated. - level_t m_global_max_log_level; -#if defined(BOOST_HAS_THREADS) - boost::mutex m_mutex; -#endif // BOOST_HAS_THREADS - }; // logger - -// Element functions definition ---------------------------------------------// - inline std::string log_element::visit(format &f, - const log_param_t &log_param) - { - return f.accept(*this); - } - - inline std::string level_element::visit(format &f, - const log_param_t &log_param) - { - return f.accept(*this, get(log_param)); - } - - inline std::string trace_element::visit(format &f, - const log_param_t &log_param) - { - return f.accept(*this, get(log_param)); - } - - inline std::string filename_element::visit(format &f, - const log_param_t &log_param) - { - return f.accept(*this, get(log_param)); - } - - inline std::string line_element::visit(format &f, - const log_param_t &log_param) - { - return f.accept(*this, get(log_param)); - } - - } // !namespace logging - -} // !namespace boost - -// Element global operators -------------------------------------------------// -inline boost::logging::element_list_t operator>>( - boost::logging::log_element &lhs, - boost::logging::log_element &rhs) -{ - boost::logging::element_list_t l; - l.push_back(boost::shared_ptr - (&lhs, boost::logging::null_deleter())); - l.push_back(boost::shared_ptr - (&rhs, boost::logging::null_deleter())); - return l; -} - -inline boost::logging::element_list_t operator>>( - boost::logging::element_list_t lhs, - boost::logging::log_element &rhs) -{ - lhs.push_back(boost::shared_ptr - (&rhs, boost::logging::null_deleter())); - return lhs; -} - -inline boost::logging::element_list_t operator>>( - const std::string &s, - boost::logging::log_element &rhs) -{ - boost::logging::element_list_t l; - boost::shared_ptr - p(new boost::logging::literal_element(s)); - l.push_back(p); - l.push_back(boost::shared_ptr - (&rhs, boost::logging::null_deleter())); - return l; -} - -inline boost::logging::element_list_t operator>>( - boost::logging::element_list_t lhs, - const std::string &s) -{ - boost::shared_ptr - p(new boost::logging::literal_element(s)); - lhs.push_back(p); - return lhs; -} - -inline -void boost::logging::logger::unformatted_trace(unsigned short l, - const qualifier &q, - const std::string &t, - const std::string &f, - unsigned int ln) -{ -#if defined(BOOST_HAS_THREADS) - boost::mutex::scoped_lock scoped_lock(m_mutex); -#endif // BOOST_HAS_THREADS - log_param_t log_param(l, &q, t, f, ln); - sink_format_assoc_list_t::iterator - s_it = m_sink_format_assoc.begin(); - for (; s_it != m_sink_format_assoc.end(); ++s_it) - { - boost::logging::format f(boost::logging::trace); - get(*s_it).consume_trace(f, log_param); - } -} - -#endif // !BOOST_LOGGING_HPP === removed file '3rdparty/liborigin/readme' --- 3rdparty/liborigin/readme 2009-12-08 18:06:27 +0000 +++ 3rdparty/liborigin/readme 1970-01-01 00:00:00 +0000 @@ -1,27 +0,0 @@ -liborigin2 ---------------------- - -AUTHOR: Alex Kargovsky - -CONTRIBUTORS: Stefan Gerlach, Ion Vasilief - -ACKNOWLEDGEMENTS: The developement of liborigin2 is financially supported by Ion Vasilief. - -DEPENDENCIES: liborigin2 depends on the BOOST C++ libraries (version >= 1.33.0): http://www.boost.org/ - (enter the correct version number in liborigin.pro) - ---------------------------------------------------------------------------- -COMPILING: liborigin2 uses qmake for the building process. - qmake is part of a Qt distribution: http://trolltech.com/ - qmake reads project files, that contain the options and rules how to build a certain project. - A project file ends with the suffix "*.pro". Please read the qmake documentation for more details. - -After installing qmake and the BOOST C++ libraries on your system, type the following command lines: - $ qmake - $ make - ---------------------------------------------------------------------------- -FEATURES : - * supports the import of 7.5 projects only - ---------------------------------------------------------------------------- === removed file '3rdparty/liborigin/tree.hh' --- 3rdparty/liborigin/tree.hh 2009-12-08 18:06:27 +0000 +++ 3rdparty/liborigin/tree.hh 1970-01-01 00:00:00 +0000 @@ -1,2663 +0,0 @@ -/* - - $Id: tree.hh,v 1.147 2007/10/19 11:24:24 peekas Exp $ - - STL-like templated tree class. - Copyright (C) 2001-2006 Kasper Peeters . - -*/ - -/** \mainpage tree.hh - \author Kasper Peeters - \version 2.4 - \date 18-Oct-2007 - \see http://www.aei.mpg.de/~peekas/tree/ - \see http://www.aei.mpg.de/~peekas/tree/ChangeLog - - The tree.hh library for C++ provides an STL-like container class - for n-ary trees, templated over the data stored at the - nodes. Various types of iterators are provided (post-order, - pre-order, and others). Where possible the access methods are - compatible with the STL or alternative algorithms are - available. -*/ - - -/* - The tree.hh code is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 or 3. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/** \todo - - New-style move members are not completely finished yet. - - It would be good to have an iterator which can iterate over all - nodes below a given node. - - Fixed depth iterators do not iterate over the entire range if there - are 'holes' in the tree. - - If a range uses const iter_base& as end iterator, things will - inevitably go wrong, because upcast from iter_base to a non-sibling_iter - is incorrect. This upcast should be removed (and then all illegal uses - as previously in 'equal' will be flagged by the compiler). This requires - new copy constructors though. - - There's a bug in replace(sibling_iterator, ...) when the ranges - sit next to each other. Turned up in append_child(iter,iter) - but has been avoided now. - - "std::operator<" does not work correctly on our iterators, and for some - reason a globally defined template operator< did not get picked up. - Using a comparison class now, but this should be investigated. -*/ - -#ifndef tree_hh_ -#define tree_hh_ - -#include -#include -#include -#include -#include -#include -#include - -// HP-style construct/destroy have gone from the standard, -// so here is a copy. - -namespace kp { - -template -void constructor(T1* p, T2& val) - { - new ((void *) p) T1(val); - } - -template -void constructor(T1* p) - { - new ((void *) p) T1; - } - -template -void destructor(T1* p) - { - p->~T1(); - } - -}; - -/// A node in the tree, combining links to other nodes as well as the actual data. -template -class tree_node_ { // size: 5*4=20 bytes (on 32 bit arch), can be reduced by 8. - public: - tree_node_ *parent; - tree_node_ *first_child, *last_child; - tree_node_ *prev_sibling, *next_sibling; - T data; -}; // __attribute__((packed)); - -template > > -class tree { - protected: - typedef tree_node_ tree_node; - public: - /// Value of the data stored at a node. - typedef T value_type; - - class iterator_base; - class pre_order_iterator; - class post_order_iterator; - class sibling_iterator; - class leaf_iterator; - - tree(); - tree(const T&); - tree(const iterator_base&); - tree(const tree&); - ~tree(); - void operator=(const tree&); - - /// Base class for iterators, only pointers stored, no traversal logic. -#ifdef __SGI_STL_PORT - class iterator_base : public stlport::bidirectional_iterator { -#else - class iterator_base { -#endif - public: - typedef T value_type; - typedef T* pointer; - typedef T& reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef std::bidirectional_iterator_tag iterator_category; - - iterator_base(); - iterator_base(tree_node *); - - T& operator*() const; - T* operator->() const; - - /// When called, the next increment/decrement skips children of this node. - void skip_children(); - /// Number of children of the node pointed to by the iterator. - unsigned int number_of_children() const; - - sibling_iterator begin() const; - sibling_iterator end() const; - - tree_node *node; - protected: - bool skip_current_children_; - }; - - /// Depth-first iterator, first accessing the node, then its children. - class pre_order_iterator : public iterator_base { - public: - pre_order_iterator(); - pre_order_iterator(tree_node *); - pre_order_iterator(const iterator_base&); - pre_order_iterator(const sibling_iterator&); - - bool operator==(const pre_order_iterator&) const; - bool operator!=(const pre_order_iterator&) const; - pre_order_iterator& operator++(); - pre_order_iterator& operator--(); - pre_order_iterator operator++(int); - pre_order_iterator operator--(int); - pre_order_iterator& operator+=(unsigned int); - pre_order_iterator& operator-=(unsigned int); - }; - - /// Depth-first iterator, first accessing the children, then the node itself. - class post_order_iterator : public iterator_base { - public: - post_order_iterator(); - post_order_iterator(tree_node *); - post_order_iterator(const iterator_base&); - post_order_iterator(const sibling_iterator&); - - bool operator==(const post_order_iterator&) const; - bool operator!=(const post_order_iterator&) const; - post_order_iterator& operator++(); - post_order_iterator& operator--(); - post_order_iterator operator++(int); - post_order_iterator operator--(int); - post_order_iterator& operator+=(unsigned int); - post_order_iterator& operator-=(unsigned int); - - /// Set iterator to the first child as deep as possible down the tree. - void descend_all(); - }; - - /// Breadth-first iterator, using a queue - class breadth_first_queued_iterator : public iterator_base { - public: - breadth_first_queued_iterator(); - breadth_first_queued_iterator(tree_node *); - breadth_first_queued_iterator(const iterator_base&); - - bool operator==(const breadth_first_queued_iterator&) const; - bool operator!=(const breadth_first_queued_iterator&) const; - breadth_first_queued_iterator& operator++(); - breadth_first_queued_iterator operator++(int); - breadth_first_queued_iterator& operator+=(unsigned int); - - private: - std::queue traversal_queue; - }; - - /// The default iterator types throughout the tree class. - typedef pre_order_iterator iterator; - typedef breadth_first_queued_iterator breadth_first_iterator; - - /// Iterator which traverses only the nodes at a given depth from the root. - class fixed_depth_iterator : public iterator_base { - public: - fixed_depth_iterator(); - fixed_depth_iterator(tree_node *); - fixed_depth_iterator(const iterator_base&); - fixed_depth_iterator(const sibling_iterator&); - fixed_depth_iterator(const fixed_depth_iterator&); - - bool operator==(const fixed_depth_iterator&) const; - bool operator!=(const fixed_depth_iterator&) const; - fixed_depth_iterator& operator++(); - fixed_depth_iterator& operator--(); - fixed_depth_iterator operator++(int); - fixed_depth_iterator operator--(int); - fixed_depth_iterator& operator+=(unsigned int); - fixed_depth_iterator& operator-=(unsigned int); - - tree_node *first_parent_; - private: - void set_first_parent_(); - void find_leftmost_parent_(); - }; - - /// Iterator which traverses only the nodes which are siblings of each other. - class sibling_iterator : public iterator_base { - public: - sibling_iterator(); - sibling_iterator(tree_node *); - sibling_iterator(const sibling_iterator&); - sibling_iterator(const iterator_base&); - - bool operator==(const sibling_iterator&) const; - bool operator!=(const sibling_iterator&) const; - sibling_iterator& operator++(); - sibling_iterator& operator--(); - sibling_iterator operator++(int); - sibling_iterator operator--(int); - sibling_iterator& operator+=(unsigned int); - sibling_iterator& operator-=(unsigned int); - - tree_node *range_first() const; - tree_node *range_last() const; - tree_node *parent_; - private: - void set_parent_(); - }; - - /// Iterator which traverses only the leaves. - class leaf_iterator : public iterator_base { - public: - leaf_iterator(); - leaf_iterator(tree_node *); - leaf_iterator(const sibling_iterator&); - leaf_iterator(const iterator_base&); - - bool operator==(const leaf_iterator&) const; - bool operator!=(const leaf_iterator&) const; - leaf_iterator& operator++(); - leaf_iterator& operator--(); - leaf_iterator operator++(int); - leaf_iterator operator--(int); - leaf_iterator& operator+=(unsigned int); - leaf_iterator& operator-=(unsigned int); - }; - - /// Return iterator to the beginning of the tree. - inline pre_order_iterator begin() const; - /// Return iterator to the end of the tree. - inline pre_order_iterator end() const; - /// Return post-order iterator to the beginning of the tree. - post_order_iterator begin_post() const; - /// Return post-order iterator to the end of the tree. - post_order_iterator end_post() const; - /// Return fixed-depth iterator to the first node at a given depth from the given iterator. - fixed_depth_iterator begin_fixed(const iterator_base&, unsigned int) const; - /// Return fixed-depth iterator to end of the nodes at given depth from the given iterator. - fixed_depth_iterator end_fixed(const iterator_base&, unsigned int) const; - /// Return breadth-first iterator to the first node at a given depth. - breadth_first_queued_iterator begin_breadth_first() const; - /// Return breadth-first iterator to end of the nodes at given depth. - breadth_first_queued_iterator end_breadth_first() const; - /// Return sibling iterator to the first child of given node. - sibling_iterator begin(const iterator_base&) const; - /// Return sibling iterator to the end of the children of a given node. - sibling_iterator end(const iterator_base&) const; - /// Return leaf iterator to the first leaf of the tree. - leaf_iterator begin_leaf() const; - /// Return leaf iterator to the last leaf of the tree. - leaf_iterator end_leaf() const; - - /// Return iterator to the parent of a node. - template static iter parent(iter); - /// Return iterator to the previous sibling of a node. - template iter previous_sibling(iter) const; - /// Return iterator to the next sibling of a node. - template iter next_sibling(iter) const; - /// Return iterator to the next node at a given depth. - template iter next_at_same_depth(iter) const; - - /// Erase all nodes of the tree. - void clear(); - /// Erase element at position pointed to by iterator, return incremented iterator. - template iter erase(iter); - /// Erase all children of the node pointed to by iterator. - void erase_children(const iterator_base&); - - /// Insert empty node as last/first child of node pointed to by position. - template iter append_child(iter position); - template iter prepend_child(iter position); - /// Insert node as last/first child of node pointed to by position. - template iter append_child(iter position, const T& x); - template iter prepend_child(iter position, const T& x); - /// Append the node (plus its children) at other_position as last/first child of position. - template iter append_child(iter position, iter other_position); - template iter prepend_child(iter position, iter other_position); - /// Append the nodes in the from-to range (plus their children) as last/first children of position. - template iter append_children(iter position, sibling_iterator from, sibling_iterator to); - template iter prepend_children(iter position, sibling_iterator from, sibling_iterator to); - - /// Short-hand to insert topmost node in otherwise empty tree. - pre_order_iterator set_head(const T& x); - /// Insert node as previous sibling of node pointed to by position. - template iter insert(iter position, const T& x); - /// Specialisation of previous member. - sibling_iterator insert(sibling_iterator position, const T& x); - /// Insert node (with children) pointed to by subtree as previous sibling of node pointed to by position. - template iter insert_subtree(iter position, const iterator_base& subtree); - /// Insert node as next sibling of node pointed to by position. - template iter insert_after(iter position, const T& x); - /// Insert node (with children) pointed to by subtree as next sibling of node pointed to by position. - template iter insert_subtree_after(iter position, const iterator_base& subtree); - - /// Replace node at 'position' with other node (keeping same children); 'position' becomes invalid. - template iter replace(iter position, const T& x); - /// Replace node at 'position' with subtree starting at 'from' (do not erase subtree at 'from'); see above. - template iter replace(iter position, const iterator_base& from); - /// Replace string of siblings (plus their children) with copy of a new string (with children); see above - sibling_iterator replace(sibling_iterator orig_begin, sibling_iterator orig_end, - sibling_iterator new_begin, sibling_iterator new_end); - - /// Move all children of node at 'position' to be siblings, returns position. - template iter flatten(iter position); - /// Move nodes in range to be children of 'position'. - template iter reparent(iter position, sibling_iterator begin, sibling_iterator end); - /// Move all child nodes of 'from' to be children of 'position'. - template iter reparent(iter position, iter from); - - /// Replace node with a new node, making the old node a child of the new node. - template iter wrap(iter position, const T& x); - - /// Move 'source' node (plus its children) to become the next sibling of 'target'. - template iter move_after(iter target, iter source); - /// Move 'source' node (plus its children) to become the previous sibling of 'target'. - template iter move_before(iter target, iter source); - sibling_iterator move_before(sibling_iterator target, sibling_iterator source); - /// Move 'source' node (plus its children) to become the node at 'target' (erasing the node at 'target'). - template iter move_ontop(iter target, iter source); - - /// Merge with other tree, creating new branches and leaves only if they are not already present. - void merge(sibling_iterator, sibling_iterator, sibling_iterator, sibling_iterator, - bool duplicate_leaves=false); - /// Sort (std::sort only moves values of nodes, this one moves children as well). - void sort(sibling_iterator from, sibling_iterator to, bool deep=false); - template - void sort(sibling_iterator from, sibling_iterator to, StrictWeakOrdering comp, bool deep=false); - /// Compare two ranges of nodes (compares nodes as well as tree structure). - template - bool equal(const iter& one, const iter& two, const iter& three) const; - template - bool equal(const iter& one, const iter& two, const iter& three, BinaryPredicate) const; - template - bool equal_subtree(const iter& one, const iter& two) const; - template - bool equal_subtree(const iter& one, const iter& two, BinaryPredicate) const; - /// Extract a new tree formed by the range of siblings plus all their children. - tree subtree(sibling_iterator from, sibling_iterator to) const; - void subtree(tree&, sibling_iterator from, sibling_iterator to) const; - /// Exchange the node (plus subtree) with its sibling node (do nothing if no sibling present). - void swap(sibling_iterator it); - /// Exchange two nodes (plus subtrees) - void swap(iterator, iterator); - - /// Count the total number of nodes. - int size() const; - /// Count the total number of nodes below the indicated node (plus one). - int size(const iterator_base&) const; - /// Check if tree is empty. - bool empty() const; - /// Compute the depth to the root. - int depth(const iterator_base&) const; - /// Determine the maximal depth of the tree. - int max_depth() const; - /// Determine the maximal depth of the tree below a given one. - int max_depth(const iterator_base&) const; - /// Count the number of children of node at position. - static unsigned int number_of_children(const iterator_base&); - /// Count the number of 'next' siblings of node at iterator. - unsigned int number_of_siblings(const iterator_base&) const; - /// Determine whether node at position is in the subtrees with root in the range. - bool is_in_subtree(const iterator_base& position, const iterator_base& begin, - const iterator_base& end) const; - /// Determine whether the iterator is an 'end' iterator and thus not actually pointing to a node. - bool is_valid(const iterator_base&) const; - - /// Determine the index of a node in the range of siblings to which it belongs. - unsigned int index(sibling_iterator it) const; - /// Inverse of 'index': return the n-th child of the node at position. - sibling_iterator child(const iterator_base& position, unsigned int) const; - - /// Comparator class for iterators (compares pointer values; why doesn't this work automatically?) - class iterator_base_less { - public: - bool operator()(const typename tree::iterator_base& one, - const typename tree::iterator_base& two) const - { - return one.node < two.node; - } - }; - tree_node *head, *feet; // head/feet are always dummy; if an iterator points to them it is invalid - private: - tree_node_allocator alloc_; - void head_initialise_(); - void copy_(const tree& other); - - /// Comparator class for two nodes of a tree (used for sorting and searching). - template - class compare_nodes { - public: - compare_nodes(StrictWeakOrdering comp) : comp_(comp) {}; - - bool operator()(const tree_node *a, const tree_node *b) - { - static StrictWeakOrdering comp; - return comp(a->data, b->data); - } - private: - StrictWeakOrdering comp_; - }; -}; - -//template -//class iterator_base_less { -// public: -// bool operator()(const typename tree::iterator_base& one, -// const typename tree::iterator_base& two) const -// { -// txtout << "operatorclass<" << one.node < two.node << std::endl; -// return one.node < two.node; -// } -//}; - -// template -// bool operator<(const typename tree::iterator& one, -// const typename tree::iterator& two) -// { -// txtout << "operator< " << one.node < two.node << std::endl; -// if(one.node < two.node) return true; -// return false; -// } -// -// template -// bool operator==(const typename tree::iterator& one, -// const typename tree::iterator& two) -// { -// txtout << "operator== " << one.node == two.node << std::endl; -// if(one.node == two.node) return true; -// return false; -// } -// -// template -// bool operator>(const typename tree::iterator_base& one, -// const typename tree::iterator_base& two) -// { -// txtout << "operator> " << one.node < two.node << std::endl; -// if(one.node > two.node) return true; -// return false; -// } - - - -// Tree - -template -tree::tree() - { - head_initialise_(); - } - -template -tree::tree(const T& x) - { - head_initialise_(); - set_head(x); - } - -template -tree::tree(const iterator_base& other) - { - head_initialise_(); - set_head((*other)); - replace(begin(), other); - } - -template -tree::~tree() - { - clear(); - alloc_.deallocate(head,1); - alloc_.deallocate(feet,1); - } - -template -void tree::head_initialise_() - { - head = alloc_.allocate(1,0); // MSVC does not have default second argument - feet = alloc_.allocate(1,0); - - head->parent=0; - head->first_child=0; - head->last_child=0; - head->prev_sibling=0; //head; - head->next_sibling=feet; //head; - - feet->parent=0; - feet->first_child=0; - feet->last_child=0; - feet->prev_sibling=head; - feet->next_sibling=0; - } - -template -void tree::operator=(const tree& other) - { - copy_(other); - } - -template -tree::tree(const tree& other) - { - head_initialise_(); - copy_(other); - } - -template -void tree::copy_(const tree& other) - { - clear(); - pre_order_iterator it=other.begin(), to=begin(); - while(it!=other.end()) { - to=insert(to, (*it)); - it.skip_children(); - ++it; - } - to=begin(); - it=other.begin(); - while(it!=other.end()) { - to=replace(to, it); - to.skip_children(); - it.skip_children(); - ++to; - ++it; - } - } - -template -void tree::clear() - { - if(head) - while(head->next_sibling!=feet) - erase(pre_order_iterator(head->next_sibling)); - } - -template -void tree::erase_children(const iterator_base& it) - { -// std::cout << "erase_children " << it.node << std::endl; - if(it.node==0) return; - - tree_node *cur=it.node->first_child; - tree_node *prev=0; - - while(cur!=0) { - prev=cur; - cur=cur->next_sibling; - erase_children(pre_order_iterator(prev)); - kp::destructor(&prev->data); - alloc_.deallocate(prev,1); - } - it.node->first_child=0; - it.node->last_child=0; -// std::cout << "exit" << std::endl; - } - -template -template -iter tree::erase(iter it) - { - tree_node *cur=it.node; - assert(cur!=head); - iter ret=it; - ret.skip_children(); - ++ret; - erase_children(it); - if(cur->prev_sibling==0) { - cur->parent->first_child=cur->next_sibling; - } - else { - cur->prev_sibling->next_sibling=cur->next_sibling; - } - if(cur->next_sibling==0) { - cur->parent->last_child=cur->prev_sibling; - } - else { - cur->next_sibling->prev_sibling=cur->prev_sibling; - } - - kp::destructor(&cur->data); - alloc_.deallocate(cur,1); - return ret; - } - -template -typename tree::pre_order_iterator tree::begin() const - { - return pre_order_iterator(head->next_sibling); - } - -template -typename tree::pre_order_iterator tree::end() const - { - return pre_order_iterator(feet); - } - -template -typename tree::breadth_first_queued_iterator tree::begin_breadth_first() const - { - return breadth_first_queued_iterator(head->next_sibling); - } - -template -typename tree::breadth_first_queued_iterator tree::end_breadth_first() const - { - return breadth_first_queued_iterator(); - } - -template -typename tree::post_order_iterator tree::begin_post() const - { - tree_node *tmp=head->next_sibling; - if(tmp!=feet) { - while(tmp->first_child) - tmp=tmp->first_child; - } - return post_order_iterator(tmp); - } - -template -typename tree::post_order_iterator tree::end_post() const - { - return post_order_iterator(feet); - } - -template -typename tree::fixed_depth_iterator tree::begin_fixed(const iterator_base& pos, unsigned int dp) const - { - tree_node *tmp=pos.node; - unsigned int curdepth=0; - while(curdepthfirst_child==0) { - if(tmp->next_sibling==0) { - // try to walk up and then right again - do { - tmp=tmp->parent; - if(tmp==0) - throw std::range_error("tree: begin_fixed out of range"); - --curdepth; - } while(tmp->next_sibling==0); - } - tmp=tmp->next_sibling; - } - tmp=tmp->first_child; - ++curdepth; - } - return tmp; - } - -template -typename tree::fixed_depth_iterator tree::end_fixed(const iterator_base& pos, unsigned int dp) const - { - assert(1==0); // FIXME: not correct yet: use is_valid() as a temporary workaround - tree_node *tmp=pos.node; - unsigned int curdepth=1; - while(curdepthfirst_child==0) { - tmp=tmp->next_sibling; - if(tmp==0) - throw std::range_error("tree: end_fixed out of range"); - } - tmp=tmp->first_child; - ++curdepth; - } - return tmp; - } - -template -typename tree::sibling_iterator tree::begin(const iterator_base& pos) const - { - assert(pos.node!=0); - if(pos.node->first_child==0) { - return end(pos); - } - return pos.node->first_child; - } - -template -typename tree::sibling_iterator tree::end(const iterator_base& pos) const - { - sibling_iterator ret(0); - ret.parent_=pos.node; - return ret; - } - -template -typename tree::leaf_iterator tree::begin_leaf() const - { - tree_node *tmp=head->next_sibling; - if(tmp!=feet) { - while(tmp->first_child) - tmp=tmp->first_child; - } - return leaf_iterator(tmp); - } - -template -typename tree::leaf_iterator tree::end_leaf() const - { - return leaf_iterator(feet); - } - -template -template -iter tree::parent(iter position) - { - assert(position.node!=0); - return iter(position.node->parent); - } - -template -template -iter tree::previous_sibling(iter position) const - { - assert(position.node!=0); - iter ret(position); - ret.node=position.node->prev_sibling; - return ret; - } - -template -template -iter tree::next_sibling(iter position) const - { - assert(position.node!=0); - iter ret(position); - ret.node=position.node->next_sibling; - return ret; - } - -template -template -iter tree::next_at_same_depth(iter position) const - { - assert(position.node!=0); - iter ret(position); - - if(position.node->next_sibling) { - ret.node=position.node->next_sibling; - } - else { - int relative_depth=0; - upper: - do { - ret.node=ret.node->parent; - if(ret.node==0) return ret; - --relative_depth; - } while(ret.node->next_sibling==0); - lower: - ret.node=ret.node->next_sibling; - while(ret.node->first_child==0) { - if(ret.node->next_sibling==0) - goto upper; - ret.node=ret.node->next_sibling; - if(ret.node==0) return ret; - } - while(relative_depth<0 && ret.node->first_child!=0) { - ret.node=ret.node->first_child; - ++relative_depth; - } - if(relative_depth<0) { - if(ret.node->next_sibling==0) goto upper; - else goto lower; - } - } - return ret; - } - -template -template -iter tree::append_child(iter position) - { - assert(position.node!=head); - assert(position.node); - - tree_node *tmp=alloc_.allocate(1,0); - kp::constructor(&tmp->data); - tmp->first_child=0; - tmp->last_child=0; - - tmp->parent=position.node; - if(position.node->last_child!=0) { - position.node->last_child->next_sibling=tmp; - } - else { - position.node->first_child=tmp; - } - tmp->prev_sibling=position.node->last_child; - position.node->last_child=tmp; - tmp->next_sibling=0; - return tmp; - } - -template -template -iter tree::prepend_child(iter position) - { - assert(position.node!=head); - assert(position.node); - - tree_node *tmp=alloc_.allocate(1,0); - kp::constructor(&tmp->data); - tmp->first_child=0; - tmp->last_child=0; - - tmp->parent=position.node; - if(position.node->first_child!=0) { - position.node->first_child->prev_sibling=tmp; - } - else { - position.node->last_child=tmp; - } - tmp->next_sibling=position.node->first_child; - position.node->prev_child=tmp; - tmp->prev_sibling=0; - return tmp; - } - -template -template -iter tree::append_child(iter position, const T& x) - { - // If your program fails here you probably used 'append_child' to add the top - // node to an empty tree. From version 1.45 the top element should be added - // using 'insert'. See the documentation for further information, and sorry about - // the API change. - assert(position.node!=head); - assert(position.node); - - tree_node* tmp = alloc_.allocate(1,0); - kp::constructor(&tmp->data, x); - tmp->first_child=0; - tmp->last_child=0; - - tmp->parent=position.node; - if(position.node->last_child!=0) { - position.node->last_child->next_sibling=tmp; - } - else { - position.node->first_child=tmp; - } - tmp->prev_sibling=position.node->last_child; - position.node->last_child=tmp; - tmp->next_sibling=0; - return tmp; - } - -template -template -iter tree::prepend_child(iter position, const T& x) - { - assert(position.node!=head); - assert(position.node); - - tree_node* tmp = alloc_.allocate(1,0); - kp::constructor(&tmp->data, x); - tmp->first_child=0; - tmp->last_child=0; - - tmp->parent=position.node; - if(position.node->first_child!=0) { - position.node->first_child->prev_sibling=tmp; - } - else { - position.node->last_child=tmp; - } - tmp->next_sibling=position.node->first_child; - position.node->first_child=tmp; - tmp->prev_sibling=0; - return tmp; - } - -template -template -iter tree::append_child(iter position, iter other) - { - assert(position.node!=head); - assert(position.node); - - sibling_iterator aargh=append_child(position, value_type()); - return replace(aargh, other); - } - -template -template -iter tree::prepend_child(iter position, iter other) - { - assert(position.node!=head); - assert(position.node); - - sibling_iterator aargh=prepend_child(position, value_type()); - return replace(aargh, other); - } - -template -template -iter tree::append_children(iter position, sibling_iterator from, sibling_iterator to) - { - assert(position.node!=head); - assert(position.node); - - iter ret=from; - - while(from!=to) { - insert_subtree(position.end(), from); - ++from; - } - return ret; - } - -template -template -iter tree::prepend_children(iter position, sibling_iterator from, sibling_iterator to) - { - assert(position.node!=head); - assert(position.node); - - iter ret=from; - - while(from!=to) { - insert_subtree(position.begin(), from); - ++from; - } - return ret; - } - -template -typename tree::pre_order_iterator tree::set_head(const T& x) - { - assert(head->next_sibling==feet); - return insert(iterator(feet), x); - } - -template -template -iter tree::insert(iter position, const T& x) - { - if(position.node==0) { - position.node=feet; // Backward compatibility: when calling insert on a null node, - // insert before the feet. - } - tree_node* tmp = alloc_.allocate(1,0); - kp::constructor(&tmp->data, x); - tmp->first_child=0; - tmp->last_child=0; - - tmp->parent=position.node->parent; - tmp->next_sibling=position.node; - tmp->prev_sibling=position.node->prev_sibling; - position.node->prev_sibling=tmp; - - if(tmp->prev_sibling==0) { - if(tmp->parent) // when inserting nodes at the head, there is no parent - tmp->parent->first_child=tmp; - } - else - tmp->prev_sibling->next_sibling=tmp; - return tmp; - } - -template -typename tree::sibling_iterator tree::insert(sibling_iterator position, const T& x) - { - tree_node* tmp = alloc_.allocate(1,0); - kp::constructor(&tmp->data, x); - tmp->first_child=0; - tmp->last_child=0; - - tmp->next_sibling=position.node; - if(position.node==0) { // iterator points to end of a subtree - tmp->parent=position.parent_; - tmp->prev_sibling=position.range_last(); - tmp->parent->last_child=tmp; - } - else { - tmp->parent=position.node->parent; - tmp->prev_sibling=position.node->prev_sibling; - position.node->prev_sibling=tmp; - } - - if(tmp->prev_sibling==0) { - if(tmp->parent) // when inserting nodes at the head, there is no parent - tmp->parent->first_child=tmp; - } - else - tmp->prev_sibling->next_sibling=tmp; - return tmp; - } - -template -template -iter tree::insert_after(iter position, const T& x) - { - tree_node* tmp = alloc_.allocate(1,0); - kp::constructor(&tmp->data, x); - tmp->first_child=0; - tmp->last_child=0; - - tmp->parent=position.node->parent; - tmp->prev_sibling=position.node; - tmp->next_sibling=position.node->next_sibling; - position.node->next_sibling=tmp; - - if(tmp->next_sibling==0) { - if(tmp->parent) // when inserting nodes at the head, there is no parent - tmp->parent->last_child=tmp; - } - else { - tmp->next_sibling->prev_sibling=tmp; - } - return tmp; - } - -template -template -iter tree::insert_subtree(iter position, const iterator_base& subtree) - { - // insert dummy - iter it=insert(position, value_type()); - // replace dummy with subtree - return replace(it, subtree); - } - -template -template -iter tree::insert_subtree_after(iter position, const iterator_base& subtree) - { - // insert dummy - iter it=insert_after(position, value_type()); - // replace dummy with subtree - return replace(it, subtree); - } - -// template -// template -// iter tree::insert_subtree(sibling_iterator position, iter subtree) -// { -// // insert dummy -// iter it(insert(position, value_type())); -// // replace dummy with subtree -// return replace(it, subtree); -// } - -template -template -iter tree::replace(iter position, const T& x) - { - kp::destructor(&position.node->data); - kp::constructor(&position.node->data, x); - return position; - } - -template -template -iter tree::replace(iter position, const iterator_base& from) - { - assert(position.node!=head); - tree_node *current_from=from.node; - tree_node *start_from=from.node; - tree_node *current_to =position.node; - - // replace the node at position with head of the replacement tree at from -// std::cout << "warning!" << position.node << std::endl; - erase_children(position); -// std::cout << "no warning!" << std::endl; - tree_node* tmp = alloc_.allocate(1,0); - kp::constructor(&tmp->data, (*from)); - tmp->first_child=0; - tmp->last_child=0; - if(current_to->prev_sibling==0) { - if(current_to->parent!=0) - current_to->parent->first_child=tmp; - } - else { - current_to->prev_sibling->next_sibling=tmp; - } - tmp->prev_sibling=current_to->prev_sibling; - if(current_to->next_sibling==0) { - if(current_to->parent!=0) - current_to->parent->last_child=tmp; - } - else { - current_to->next_sibling->prev_sibling=tmp; - } - tmp->next_sibling=current_to->next_sibling; - tmp->parent=current_to->parent; - kp::destructor(¤t_to->data); - alloc_.deallocate(current_to,1); - current_to=tmp; - - // only at this stage can we fix 'last' - tree_node *last=from.node->next_sibling; - - pre_order_iterator toit=tmp; - // copy all children - do { - assert(current_from!=0); - if(current_from->first_child != 0) { - current_from=current_from->first_child; - toit=append_child(toit, current_from->data); - } - else { - while(current_from->next_sibling==0 && current_from!=start_from) { - current_from=current_from->parent; - toit=parent(toit); - assert(current_from!=0); - } - current_from=current_from->next_sibling; - if(current_from!=last) { - toit=append_child(parent(toit), current_from->data); - } - } - } while(current_from!=last); - - return current_to; - } - -template -typename tree::sibling_iterator tree::replace( - sibling_iterator orig_begin, - sibling_iterator orig_end, - sibling_iterator new_begin, - sibling_iterator new_end) - { - tree_node *orig_first=orig_begin.node; - tree_node *new_first=new_begin.node; - tree_node *orig_last=orig_first; - while((++orig_begin)!=orig_end) - orig_last=orig_last->next_sibling; - tree_node *new_last=new_first; - while((++new_begin)!=new_end) - new_last=new_last->next_sibling; - - // insert all siblings in new_first..new_last before orig_first - bool first=true; - pre_order_iterator ret; - while(1==1) { - pre_order_iterator tt=insert_subtree(pre_order_iterator(orig_first), pre_order_iterator(new_first)); - if(first) { - ret=tt; - first=false; - } - if(new_first==new_last) - break; - new_first=new_first->next_sibling; - } - - // erase old range of siblings - bool last=false; - tree_node *next=orig_first; - while(1==1) { - if(next==orig_last) - last=true; - next=next->next_sibling; - erase((pre_order_iterator)orig_first); - if(last) - break; - orig_first=next; - } - return ret; - } - -template -template -iter tree::flatten(iter position) - { - if(position.node->first_child==0) - return position; - - tree_node *tmp=position.node->first_child; - while(tmp) { - tmp->parent=position.node->parent; - tmp=tmp->next_sibling; - } - if(position.node->next_sibling) { - position.node->last_child->next_sibling=position.node->next_sibling; - position.node->next_sibling->prev_sibling=position.node->last_child; - } - else { - position.node->parent->last_child=position.node->last_child; - } - position.node->next_sibling=position.node->first_child; - position.node->next_sibling->prev_sibling=position.node; - position.node->first_child=0; - position.node->last_child=0; - - return position; - } - - -template -template -iter tree::reparent(iter position, sibling_iterator begin, sibling_iterator end) - { - tree_node *first=begin.node; - tree_node *last=first; - - assert(first!=position.node); - - if(begin==end) return begin; - // determine last node - while((++begin)!=end) { - last=last->next_sibling; - } - // move subtree - if(first->prev_sibling==0) { - first->parent->first_child=last->next_sibling; - } - else { - first->prev_sibling->next_sibling=last->next_sibling; - } - if(last->next_sibling==0) { - last->parent->last_child=first->prev_sibling; - } - else { - last->next_sibling->prev_sibling=first->prev_sibling; - } - if(position.node->first_child==0) { - position.node->first_child=first; - position.node->last_child=last; - first->prev_sibling=0; - } - else { - position.node->last_child->next_sibling=first; - first->prev_sibling=position.node->last_child; - position.node->last_child=last; - } - last->next_sibling=0; - - tree_node *pos=first; - while(1==1) { - pos->parent=position.node; - if(pos==last) break; - pos=pos->next_sibling; - } - - return first; - } - -template -template iter tree::reparent(iter position, iter from) - { - if(from.node->first_child==0) return position; - return reparent(position, from.node->first_child, end(from)); - } - -template -template iter tree::wrap(iter position, const T& x) - { - assert(position.node!=0); - sibling_iterator fr=position, to=position; - ++to; - iter ret = insert(position, x); - reparent(ret, fr, to); - return ret; - } - -template -template iter tree::move_after(iter target, iter source) - { - tree_node *dst=target.node; - tree_node *src=source.node; - assert(dst); - assert(src); - - if(dst==src) return source; - if(dst->next_sibling) - if(dst->next_sibling==src) // already in the right spot - return source; - - // take src out of the tree - if(src->prev_sibling!=0) src->prev_sibling->next_sibling=src->next_sibling; - else src->parent->first_child=src->next_sibling; - if(src->next_sibling!=0) src->next_sibling->prev_sibling=src->prev_sibling; - else src->parent->last_child=src->prev_sibling; - - // connect it to the new point - if(dst->next_sibling!=0) dst->next_sibling->prev_sibling=src; - else dst->parent->last_child=src; - src->next_sibling=dst->next_sibling; - dst->next_sibling=src; - src->prev_sibling=dst; - src->parent=dst->parent; - return src; - } - -template -template iter tree::move_before(iter target, iter source) - { - tree_node *dst=target.node; - tree_node *src=source.node; - assert(dst); - assert(src); - - if(dst==src) return source; - if(dst->prev_sibling) - if(dst->prev_sibling==src) // already in the right spot - return source; - - // take src out of the tree - if(src->prev_sibling!=0) src->prev_sibling->next_sibling=src->next_sibling; - else src->parent->first_child=src->next_sibling; - if(src->next_sibling!=0) src->next_sibling->prev_sibling=src->prev_sibling; - else src->parent->last_child=src->prev_sibling; - - // connect it to the new point - if(dst->prev_sibling!=0) dst->prev_sibling->next_sibling=src; - else dst->parent->first_child=src; - src->prev_sibling=dst->prev_sibling; - dst->prev_sibling=src; - src->next_sibling=dst; - src->parent=dst->parent; - return src; - } - -// specialisation for sibling_iterators -template -typename tree::sibling_iterator tree::move_before(sibling_iterator target, - sibling_iterator source) - { - tree_node *dst=target.node; - tree_node *src=source.node; - tree_node *dst_prev_sibling; - if(dst==0) { // must then be an end iterator - dst_prev_sibling=target.parent_->last_child; - assert(dst_prev_sibling); - } - else dst_prev_sibling=dst->prev_sibling; - assert(src); - - if(dst==src) return source; - if(dst_prev_sibling) - if(dst_prev_sibling==src) // already in the right spot - return source; - - // take src out of the tree - if(src->prev_sibling!=0) src->prev_sibling->next_sibling=src->next_sibling; - else src->parent->first_child=src->next_sibling; - if(src->next_sibling!=0) src->next_sibling->prev_sibling=src->prev_sibling; - else src->parent->last_child=src->prev_sibling; - - // connect it to the new point - if(dst_prev_sibling!=0) dst_prev_sibling->next_sibling=src; - else target.parent_->first_child=src; - src->prev_sibling=dst_prev_sibling; - if(dst) { - dst->prev_sibling=src; - src->parent=dst->parent; - } - src->next_sibling=dst; - return src; - } - -template -template iter tree::move_ontop(iter target, iter source) - { - tree_node *dst=target.node; - tree_node *src=source.node; - assert(dst); - assert(src); - - if(dst==src) return source; - - // remember connection points - tree_node *b_prev_sibling=dst->prev_sibling; - tree_node *b_next_sibling=dst->next_sibling; - tree_node *b_parent=dst->parent; - - // remove target - erase(target); - - // take src out of the tree - if(src->prev_sibling!=0) src->prev_sibling->next_sibling=src->next_sibling; - else src->parent->first_child=src->next_sibling; - if(src->next_sibling!=0) src->next_sibling->prev_sibling=src->prev_sibling; - else src->parent->last_child=src->prev_sibling; - - // connect it to the new point - if(b_prev_sibling!=0) b_prev_sibling->next_sibling=src; - else b_parent->first_child=src; - if(b_next_sibling!=0) b_next_sibling->prev_sibling=src; - else b_parent->last_child=src; - src->prev_sibling=b_prev_sibling; - src->next_sibling=b_next_sibling; - src->parent=b_parent; - return src; - } - -template -void tree::merge(sibling_iterator to1, sibling_iterator to2, - sibling_iterator from1, sibling_iterator from2, - bool duplicate_leaves) - { - sibling_iterator fnd; - while(from1!=from2) { - if((fnd=std::find(to1, to2, (*from1))) != to2) { // element found - if(from1.begin()==from1.end()) { // full depth reached - if(duplicate_leaves) - append_child(parent(to1), (*from1)); - } - else { // descend further - merge(fnd.begin(), fnd.end(), from1.begin(), from1.end(), duplicate_leaves); - } - } - else { // element missing - insert_subtree(to2, from1); - } - ++from1; - } - } - - -template -void tree::sort(sibling_iterator from, sibling_iterator to, bool deep) - { - std::less comp; - sort(from, to, comp, deep); - } - -template -template -void tree::sort(sibling_iterator from, sibling_iterator to, - StrictWeakOrdering comp, bool deep) - { - if(from==to) return; - // make list of sorted nodes - // CHECK: if multiset stores equivalent nodes in the order in which they - // are inserted, then this routine should be called 'stable_sort'. - std::multiset > nodes(comp); - sibling_iterator it=from, it2=to; - while(it != to) { - nodes.insert(it.node); - ++it; - } - // reassemble - --it2; - - // prev and next are the nodes before and after the sorted range - tree_node *prev=from.node->prev_sibling; - tree_node *next=it2.node->next_sibling; - typename std::multiset >::iterator nit=nodes.begin(), eit=nodes.end(); - if(prev==0) { - if((*nit)->parent!=0) // to catch "sorting the head" situations, when there is no parent - (*nit)->parent->first_child=(*nit); - } - else prev->next_sibling=(*nit); - - --eit; - while(nit!=eit) { - (*nit)->prev_sibling=prev; - if(prev) - prev->next_sibling=(*nit); - prev=(*nit); - ++nit; - } - // prev now points to the last-but-one node in the sorted range - if(prev) - prev->next_sibling=(*eit); - - // eit points to the last node in the sorted range. - (*eit)->next_sibling=next; - (*eit)->prev_sibling=prev; // missed in the loop above - if(next==0) { - if((*eit)->parent!=0) // to catch "sorting the head" situations, when there is no parent - (*eit)->parent->last_child=(*eit); - } - else next->prev_sibling=(*eit); - - if(deep) { // sort the children of each node too - sibling_iterator bcs(*nodes.begin()); - sibling_iterator ecs(*eit); - ++ecs; - while(bcs!=ecs) { - sort(begin(bcs), end(bcs), comp, deep); - ++bcs; - } - } - } - -template -template -bool tree::equal(const iter& one_, const iter& two, const iter& three_) const - { - std::equal_to comp; - return equal(one_, two, three_, comp); - } - -template -template -bool tree::equal_subtree(const iter& one_, const iter& two_) const - { - std::equal_to comp; - return equal_subtree(one_, two_, comp); - } - -template -template -bool tree::equal(const iter& one_, const iter& two, const iter& three_, BinaryPredicate fun) const - { - pre_order_iterator one(one_), three(three_); - -// if(one==two && is_valid(three) && three.number_of_children()!=0) -// return false; - while(one!=two && is_valid(three)) { - if(!fun(*one,*three)) - return false; - if(one.number_of_children()!=three.number_of_children()) - return false; - ++one; - ++three; - } - return true; - } - -template -template -bool tree::equal_subtree(const iter& one_, const iter& two_, BinaryPredicate fun) const - { - pre_order_iterator one(one_), two(two_); - - if(!fun(*one,*two)) return false; - if(number_of_children(one)!=number_of_children(two)) return false; - return equal(begin(one),end(one),begin(two),fun); - } - -template -tree tree::subtree(sibling_iterator from, sibling_iterator to) const - { - tree tmp; - tmp.set_head(value_type()); - tmp.replace(tmp.begin(), tmp.end(), from, to); - return tmp; - } - -template -void tree::subtree(tree& tmp, sibling_iterator from, sibling_iterator to) const - { - tmp.set_head(value_type()); - tmp.replace(tmp.begin(), tmp.end(), from, to); - } - -template -int tree::size() const - { - int i=0; - pre_order_iterator it=begin(), eit=end(); - while(it!=eit) { - ++i; - ++it; - } - return i; - } - -template -int tree::size(const iterator_base& top) const - { - int i=0; - pre_order_iterator it=top, eit=top; - eit.skip_children(); - ++eit; - while(it!=eit) { - ++i; - ++it; - } - return i; - } - -template -bool tree::empty() const - { - pre_order_iterator it=begin(), eit=end(); - return (it==eit); - } - -template -int tree::depth(const iterator_base& it) const - { - tree_node* pos=it.node; - assert(pos!=0); - int ret=0; - while(pos->parent!=0) { - pos=pos->parent; - ++ret; - } - return ret; - } - -template -int tree::max_depth() const - { - return max_depth(begin()); - } - - -template -int tree::max_depth(const iterator_base& pos) const - { - tree_node *tmp=pos.node; - int curdepth=0, maxdepth=0; - while(true) { // try to walk the bottom of the tree - while(tmp->first_child==0) { - if(tmp==pos.node) return maxdepth; - if(tmp->next_sibling==0) { - // try to walk up and then right again - do { - tmp=tmp->parent; - if(tmp==0) return maxdepth; - --curdepth; - } while(tmp->next_sibling==0); - } - if(tmp==pos.node) return maxdepth; - tmp=tmp->next_sibling; - } - tmp=tmp->first_child; - ++curdepth; - maxdepth=std::max(curdepth, maxdepth); - } - } - -template -unsigned int tree::number_of_children(const iterator_base& it) - { - tree_node *pos=it.node->first_child; - if(pos==0) return 0; - - unsigned int ret=1; -// while(pos!=it.node->last_child) { -// ++ret; -// pos=pos->next_sibling; -// } - while((pos=pos->next_sibling)) - ++ret; - return ret; - } - -template -unsigned int tree::number_of_siblings(const iterator_base& it) const - { - tree_node *pos=it.node; - unsigned int ret=0; - // count forward - while(pos->next_sibling && - pos->next_sibling!=head && - pos->next_sibling!=feet) { - ++ret; - pos=pos->next_sibling; - } - // count backward - pos=it.node; - while(pos->prev_sibling && - pos->prev_sibling!=head && - pos->prev_sibling!=feet) { - ++ret; - pos=pos->prev_sibling; - } - - return ret; - } - -template -void tree::swap(sibling_iterator it) - { - tree_node *nxt=it.node->next_sibling; - if(nxt) { - if(it.node->prev_sibling) - it.node->prev_sibling->next_sibling=nxt; - else - it.node->parent->first_child=nxt; - nxt->prev_sibling=it.node->prev_sibling; - tree_node *nxtnxt=nxt->next_sibling; - if(nxtnxt) - nxtnxt->prev_sibling=it.node; - else - it.node->parent->last_child=it.node; - nxt->next_sibling=it.node; - it.node->prev_sibling=nxt; - it.node->next_sibling=nxtnxt; - } - } - -template -void tree::swap(iterator one, iterator two) - { - // if one and two are adjacent siblings, use the sibling swap - if(one.node->next_sibling==two.node) swap(one); - else if(two.node->next_sibling==one.node) swap(two); - else { - tree_node *nxt1=one.node->next_sibling; - tree_node *nxt2=two.node->next_sibling; - tree_node *pre1=one.node->prev_sibling; - tree_node *pre2=two.node->prev_sibling; - tree_node *par1=one.node->parent; - tree_node *par2=two.node->parent; - - // reconnect - one.node->parent=par2; - one.node->next_sibling=nxt2; - if(nxt2) nxt2->prev_sibling=one.node; - else par2->last_child=one.node; - one.node->prev_sibling=pre2; - if(pre2) pre2->next_sibling=one.node; - else par2->first_child=one.node; - - two.node->parent=par1; - two.node->next_sibling=nxt1; - if(nxt1) nxt1->prev_sibling=two.node; - else par1->last_child=two.node; - two.node->prev_sibling=pre1; - if(pre1) pre1->next_sibling=two.node; - else par1->first_child=two.node; - } - } - -// template -// tree::iterator tree::find_subtree( -// sibling_iterator subfrom, sibling_iterator subto, iterator from, iterator to, -// BinaryPredicate fun) const -// { -// assert(1==0); // this routine is not finished yet. -// while(from!=to) { -// if(fun(*subfrom, *from)) { -// -// } -// } -// return to; -// } - -template -bool tree::is_in_subtree(const iterator_base& it, const iterator_base& begin, - const iterator_base& end) const - { - // FIXME: this should be optimised. - pre_order_iterator tmp=begin; - while(tmp!=end) { - if(tmp==it) return true; - ++tmp; - } - return false; - } - -template -bool tree::is_valid(const iterator_base& it) const - { - if(it.node==0 || it.node==feet || it.node==head) return false; - else return true; - } - -template -unsigned int tree::index(sibling_iterator it) const - { - unsigned int ind=0; - if(it.node->parent==0) { - while(it.node->prev_sibling!=head) { - it.node=it.node->prev_sibling; - ++ind; - } - } - else { - while(it.node->prev_sibling!=0) { - it.node=it.node->prev_sibling; - ++ind; - } - } - return ind; - } - - -template -typename tree::sibling_iterator tree::child(const iterator_base& it, unsigned int num) const - { - tree_node *tmp=it.node->first_child; - while(num--) { - assert(tmp!=0); - tmp=tmp->next_sibling; - } - return tmp; - } - - - - -// Iterator base - -template -tree::iterator_base::iterator_base() - : node(0), skip_current_children_(false) - { - } - -template -tree::iterator_base::iterator_base(tree_node *tn) - : node(tn), skip_current_children_(false) - { - } - -template -T& tree::iterator_base::operator*() const - { - return node->data; - } - -template -T* tree::iterator_base::operator->() const - { - return &(node->data); - } - -template -bool tree::post_order_iterator::operator!=(const post_order_iterator& other) const - { - if(other.node!=this->node) return true; - else return false; - } - -template -bool tree::post_order_iterator::operator==(const post_order_iterator& other) const - { - if(other.node==this->node) return true; - else return false; - } - -template -bool tree::pre_order_iterator::operator!=(const pre_order_iterator& other) const - { - if(other.node!=this->node) return true; - else return false; - } - -template -bool tree::pre_order_iterator::operator==(const pre_order_iterator& other) const - { - if(other.node==this->node) return true; - else return false; - } - -template -bool tree::sibling_iterator::operator!=(const sibling_iterator& other) const - { - if(other.node!=this->node) return true; - else return false; - } - -template -bool tree::sibling_iterator::operator==(const sibling_iterator& other) const - { - if(other.node==this->node) return true; - else return false; - } - -template -bool tree::leaf_iterator::operator!=(const leaf_iterator& other) const - { - if(other.node!=this->node) return true; - else return false; - } - -template -bool tree::leaf_iterator::operator==(const leaf_iterator& other) const - { - if(other.node==this->node) return true; - else return false; - } - -template -typename tree::sibling_iterator tree::iterator_base::begin() const - { - if(node->first_child==0) - return end(); - - sibling_iterator ret(node->first_child); - ret.parent_=this->node; - return ret; - } - -template -typename tree::sibling_iterator tree::iterator_base::end() const - { - sibling_iterator ret(0); - ret.parent_=node; - return ret; - } - -template -void tree::iterator_base::skip_children() - { - skip_current_children_=true; - } - -template -unsigned int tree::iterator_base::number_of_children() const - { - tree_node *pos=node->first_child; - if(pos==0) return 0; - - unsigned int ret=1; - while(pos!=node->last_child) { - ++ret; - pos=pos->next_sibling; - } - return ret; - } - - - -// Pre-order iterator - -template -tree::pre_order_iterator::pre_order_iterator() - : iterator_base(0) - { - } - -template -tree::pre_order_iterator::pre_order_iterator(tree_node *tn) - : iterator_base(tn) - { - } - -template -tree::pre_order_iterator::pre_order_iterator(const iterator_base &other) - : iterator_base(other.node) - { - } - -template -tree::pre_order_iterator::pre_order_iterator(const sibling_iterator& other) - : iterator_base(other.node) - { - if(this->node==0) { - if(other.range_last()!=0) - this->node=other.range_last(); - else - this->node=other.parent_; - this->skip_children(); - ++(*this); - } - } - -template -typename tree::pre_order_iterator& tree::pre_order_iterator::operator++() - { - assert(this->node!=0); - if(!this->skip_current_children_ && this->node->first_child != 0) { - this->node=this->node->first_child; - } - else { - this->skip_current_children_=false; - while(this->node->next_sibling==0) { - this->node=this->node->parent; - if(this->node==0) - return *this; - } - this->node=this->node->next_sibling; - } - return *this; - } - -template -typename tree::pre_order_iterator& tree::pre_order_iterator::operator--() - { - assert(this->node!=0); - if(this->node->prev_sibling) { - this->node=this->node->prev_sibling; - while(this->node->last_child) - this->node=this->node->last_child; - } - else { - this->node=this->node->parent; - if(this->node==0) - return *this; - } - return *this; -} - -template -typename tree::pre_order_iterator tree::pre_order_iterator::operator++(int n) - { - pre_order_iterator copy = *this; - ++(*this); - return copy; - } - -template -typename tree::pre_order_iterator tree::pre_order_iterator::operator--(int n) -{ - pre_order_iterator copy = *this; - --(*this); - return copy; -} - -template -typename tree::pre_order_iterator& tree::pre_order_iterator::operator+=(unsigned int num) - { - while(num>0) { - ++(*this); - --num; - } - return (*this); - } - -template -typename tree::pre_order_iterator& tree::pre_order_iterator::operator-=(unsigned int num) - { - while(num>0) { - --(*this); - --num; - } - return (*this); - } - - - -// Post-order iterator - -template -tree::post_order_iterator::post_order_iterator() - : iterator_base(0) - { - } - -template -tree::post_order_iterator::post_order_iterator(tree_node *tn) - : iterator_base(tn) - { - } - -template -tree::post_order_iterator::post_order_iterator(const iterator_base &other) - : iterator_base(other.node) - { - } - -template -tree::post_order_iterator::post_order_iterator(const sibling_iterator& other) - : iterator_base(other.node) - { - if(this->node==0) { - if(other.range_last()!=0) - this->node=other.range_last(); - else - this->node=other.parent_; - this->skip_children(); - ++(*this); - } - } - -template -typename tree::post_order_iterator& tree::post_order_iterator::operator++() - { - assert(this->node!=0); - if(this->node->next_sibling==0) { - this->node=this->node->parent; - this->skip_current_children_=false; - } - else { - this->node=this->node->next_sibling; - if(this->skip_current_children_) { - this->skip_current_children_=false; - } - else { - while(this->node->first_child) - this->node=this->node->first_child; - } - } - return *this; - } - -template -typename tree::post_order_iterator& tree::post_order_iterator::operator--() - { - assert(this->node!=0); - if(this->skip_current_children_ || this->node->last_child==0) { - this->skip_current_children_=false; - while(this->node->prev_sibling==0) - this->node=this->node->parent; - this->node=this->node->prev_sibling; - } - else { - this->node=this->node->last_child; - } - return *this; - } - -template -typename tree::post_order_iterator tree::post_order_iterator::operator++(int) - { - post_order_iterator copy = *this; - ++(*this); - return copy; - } - -template -typename tree::post_order_iterator tree::post_order_iterator::operator--(int) - { - post_order_iterator copy = *this; - --(*this); - return copy; - } - - -template -typename tree::post_order_iterator& tree::post_order_iterator::operator+=(unsigned int num) - { - while(num>0) { - ++(*this); - --num; - } - return (*this); - } - -template -typename tree::post_order_iterator& tree::post_order_iterator::operator-=(unsigned int num) - { - while(num>0) { - --(*this); - --num; - } - return (*this); - } - -template -void tree::post_order_iterator::descend_all() - { - assert(this->node!=0); - while(this->node->first_child) - this->node=this->node->first_child; - } - - -// Breadth-first iterator - -template -tree::breadth_first_queued_iterator::breadth_first_queued_iterator() - : iterator_base() - { - } - -template -tree::breadth_first_queued_iterator::breadth_first_queued_iterator(tree_node *tn) - : iterator_base(tn) - { - traversal_queue.push(tn); - } - -template -tree::breadth_first_queued_iterator::breadth_first_queued_iterator(const iterator_base& other) - : iterator_base(other.node) - { - traversal_queue.push(other.node); - } - -template -bool tree::breadth_first_queued_iterator::operator!=(const breadth_first_queued_iterator& other) const - { - if(other.node!=this->node) return true; - else return false; - } - -template -bool tree::breadth_first_queued_iterator::operator==(const breadth_first_queued_iterator& other) const - { - if(other.node==this->node) return true; - else return false; - } - -template -typename tree::breadth_first_queued_iterator& tree::breadth_first_queued_iterator::operator++() - { - assert(this->node!=0); - - // Add child nodes and pop current node - sibling_iterator sib=this->begin(); - while(sib!=this->end()) { - traversal_queue.push(sib.node); - ++sib; - } - traversal_queue.pop(); - if(traversal_queue.size()>0) - this->node=traversal_queue.front(); - else - this->node=0; - return (*this); - } - -template -typename tree::breadth_first_queued_iterator tree::breadth_first_queued_iterator::operator++(int n) - { - breadth_first_queued_iterator copy = *this; - ++(*this); - return copy; - } - -template -typename tree::breadth_first_queued_iterator& tree::breadth_first_queued_iterator::operator+=(unsigned int num) - { - while(num>0) { - ++(*this); - --num; - } - return (*this); - } - - - -// Fixed depth iterator - -template -tree::fixed_depth_iterator::fixed_depth_iterator() - : iterator_base() - { - set_first_parent_(); - } - -template -tree::fixed_depth_iterator::fixed_depth_iterator(tree_node *tn) - : iterator_base(tn) - { - set_first_parent_(); - } - -template -tree::fixed_depth_iterator::fixed_depth_iterator(const iterator_base& other) - : iterator_base(other.node) - { - set_first_parent_(); - } - -template -tree::fixed_depth_iterator::fixed_depth_iterator(const sibling_iterator& other) - : iterator_base(other.node), first_parent_(other.parent_) - { - find_leftmost_parent_(); - } - -template -tree::fixed_depth_iterator::fixed_depth_iterator(const fixed_depth_iterator& other) - : iterator_base(other.node), first_parent_(other.first_parent_) - { - } - -template -bool tree::fixed_depth_iterator::operator==(const fixed_depth_iterator& other) const - { - if(other.node==this->node && other.first_parent_==first_parent_) return true; - else return false; - } - -template -bool tree::fixed_depth_iterator::operator!=(const fixed_depth_iterator& other) const - { - if(other.node!=this->node || other.first_parent_!=first_parent_) return true; - else return false; - } - -template -void tree::fixed_depth_iterator::set_first_parent_() - { - return; // FIXME: we do not use first_parent_ yet, and it actually needs some serious reworking if - // it is ever to work at the 'head' level. - first_parent_=0; - if(this->node==0) return; - if(this->node->parent!=0) - first_parent_=this->node->parent; - if(first_parent_) - find_leftmost_parent_(); - } - -template -void tree::fixed_depth_iterator::find_leftmost_parent_() - { - return; // FIXME: see 'set_first_parent()' - tree_node *tmppar=first_parent_; - while(tmppar->prev_sibling) { - tmppar=tmppar->prev_sibling; - if(tmppar->first_child) - first_parent_=tmppar; - } - } - -template -typename tree::fixed_depth_iterator& tree::fixed_depth_iterator::operator++() - { - assert(this->node!=0); - - if(this->node->next_sibling) { - this->node=this->node->next_sibling; - } - else { - int relative_depth=0; - upper: - do { - this->node=this->node->parent; - if(this->node==0) return *this; - --relative_depth; - } while(this->node->next_sibling==0); - lower: - this->node=this->node->next_sibling; - while(this->node->first_child==0) { - if(this->node->next_sibling==0) - goto upper; - this->node=this->node->next_sibling; - if(this->node==0) return *this; - } - while(relative_depth<0 && this->node->first_child!=0) { - this->node=this->node->first_child; - ++relative_depth; - } - if(relative_depth<0) { - if(this->node->next_sibling==0) goto upper; - else goto lower; - } - } - return *this; - -// if(this->node->next_sibling!=0) { -// this->node=this->node->next_sibling; -// assert(this->node!=0); -// if(this->node->parent==0 && this->node->next_sibling==0) // feet element -// this->node=0; -// } -// else { -// tree_node *par=this->node->parent; -// do { -// par=par->next_sibling; -// if(par==0) { // FIXME: need to keep track of this! -// this->node=0; -// return *this; -// } -// } while(par->first_child==0); -// this->node=par->first_child; -// } - return *this; - } - -template -typename tree::fixed_depth_iterator& tree::fixed_depth_iterator::operator--() - { - assert(this->node!=0); - if(this->node->prev_sibling!=0) { - this->node=this->node->prev_sibling; - assert(this->node!=0); - if(this->node->parent==0 && this->node->prev_sibling==0) // head element - this->node=0; - } - else { - tree_node *par=this->node->parent; - do { - par=par->prev_sibling; - if(par==0) { // FIXME: need to keep track of this! - this->node=0; - return *this; - } - } while(par->last_child==0); - this->node=par->last_child; - } - return *this; -} - -template -typename tree::fixed_depth_iterator tree::fixed_depth_iterator::operator++(int) - { - fixed_depth_iterator copy = *this; - ++(*this); - return copy; - } - -template -typename tree::fixed_depth_iterator tree::fixed_depth_iterator::operator--(int) -{ - fixed_depth_iterator copy = *this; - --(*this); - return copy; -} - -template -typename tree::fixed_depth_iterator& tree::fixed_depth_iterator::operator-=(unsigned int num) - { - while(num>0) { - --(*this); - --(num); - } - return (*this); - } - -template -typename tree::fixed_depth_iterator& tree::fixed_depth_iterator::operator+=(unsigned int num) - { - while(num>0) { - ++(*this); - --(num); - } - return *this; - } - -// FIXME: add the other members of fixed_depth_iterator. - - -// Sibling iterator - -template -tree::sibling_iterator::sibling_iterator() - : iterator_base() - { - set_parent_(); - } - -template -tree::sibling_iterator::sibling_iterator(tree_node *tn) - : iterator_base(tn) - { - set_parent_(); - } - -template -tree::sibling_iterator::sibling_iterator(const iterator_base& other) - : iterator_base(other.node) - { - set_parent_(); - } - -template -tree::sibling_iterator::sibling_iterator(const sibling_iterator& other) - : iterator_base(other), parent_(other.parent_) - { - } - -template -void tree::sibling_iterator::set_parent_() - { - parent_=0; - if(this->node==0) return; - if(this->node->parent!=0) - parent_=this->node->parent; - } - -template -typename tree::sibling_iterator& tree::sibling_iterator::operator++() - { - if(this->node) - this->node=this->node->next_sibling; - return *this; - } - -template -typename tree::sibling_iterator& tree::sibling_iterator::operator--() - { - if(this->node) this->node=this->node->prev_sibling; - else { - assert(parent_); - this->node=parent_->last_child; - } - return *this; -} - -template -typename tree::sibling_iterator tree::sibling_iterator::operator++(int) - { - sibling_iterator copy = *this; - ++(*this); - return copy; - } - -template -typename tree::sibling_iterator tree::sibling_iterator::operator--(int) - { - sibling_iterator copy = *this; - --(*this); - return copy; - } - -template -typename tree::sibling_iterator& tree::sibling_iterator::operator+=(unsigned int num) - { - while(num>0) { - ++(*this); - --num; - } - return (*this); - } - -template -typename tree::sibling_iterator& tree::sibling_iterator::operator-=(unsigned int num) - { - while(num>0) { - --(*this); - --num; - } - return (*this); - } - -template -typename tree::tree_node *tree::sibling_iterator::range_first() const - { - tree_node *tmp=parent_->first_child; - return tmp; - } - -template -typename tree::tree_node *tree::sibling_iterator::range_last() const - { - return parent_->last_child; - } - -// Leaf iterator - -template -tree::leaf_iterator::leaf_iterator() - : iterator_base(0) - { - } - -template -tree::leaf_iterator::leaf_iterator(tree_node *tn) - : iterator_base(tn) - { - } - -template -tree::leaf_iterator::leaf_iterator(const iterator_base &other) - : iterator_base(other.node) - { - } - -template -tree::leaf_iterator::leaf_iterator(const sibling_iterator& other) - : iterator_base(other.node) - { - if(this->node==0) { - if(other.range_last()!=0) - this->node=other.range_last(); - else - this->node=other.parent_; - ++(*this); - } - } - -template -typename tree::leaf_iterator& tree::leaf_iterator::operator++() - { - assert(this->node!=0); - while(this->node->next_sibling==0) { - if (this->node->parent==0) return *this; - this->node=this->node->parent; - } - this->node=this->node->next_sibling; - while(this->node->first_child) - this->node=this->node->first_child; - return *this; - } - -template -typename tree::leaf_iterator& tree::leaf_iterator::operator--() - { - assert(this->node!=0); - while (this->node->prev_sibling==0) { - if (this->node->parent==0) return *this; - this->node=this->node->parent; - } - this->node=this->node->prev_sibling; - while(this->node->last_child) - this->node=this->node->last_child; - return *this; - } - -template -typename tree::leaf_iterator tree::leaf_iterator::operator++(int) - { - leaf_iterator copy = *this; - ++(*this); - return copy; - } - -template -typename tree::leaf_iterator tree::leaf_iterator::operator--(int) - { - leaf_iterator copy = *this; - --(*this); - return copy; - } - - -template -typename tree::leaf_iterator& tree::leaf_iterator::operator+=(unsigned int num) - { - while(num>0) { - ++(*this); - --num; - } - return (*this); - } - -template -typename tree::leaf_iterator& tree::leaf_iterator::operator-=(unsigned int num) - { - while(num>0) { - --(*this); - --num; - } - return (*this); - } - -#endif - -// Local variables: -// default-tab-width: 3 -// End: === added directory '3rdparty/qwtplot3d' === removed directory '3rdparty/qwtplot3d' === added directory '3rdparty/qwtplot3d/3rdparty' === removed directory '3rdparty/qwtplot3d/3rdparty' === added directory '3rdparty/qwtplot3d/3rdparty/gl2ps' === removed directory '3rdparty/qwtplot3d/3rdparty/gl2ps' === added file '3rdparty/qwtplot3d/3rdparty/gl2ps/COPYING.GL2PS' --- 3rdparty/qwtplot3d/3rdparty/gl2ps/COPYING.GL2PS 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/3rdparty/gl2ps/COPYING.GL2PS 2010-07-21 23:21:08 +0000 @@ -0,0 +1,25 @@ + + GL2PS LICENSE + Version 2, November 2003 + + Copyright (C) 2003, Christophe Geuzaine + +Permission to use, copy, and distribute this software and its +documentation for any purpose with or without fee is hereby granted, +provided that the copyright notice appear in all copies and that both +that copyright notice and this permission notice appear in supporting +documentation. + +Permission to modify and distribute modified versions of this software +is granted, provided that: + +1) the modifications are licensed under the same terms as this +software; + +2) you make available the source code of any modifications that you +distribute, either on the same media as you distribute any executable +or other form of this software, or via a mechanism generally accepted +in the software development community for the electronic transfer of +data. + +This software is provided "as is" without express or implied warranty. === removed file '3rdparty/qwtplot3d/3rdparty/gl2ps/COPYING.GL2PS' --- 3rdparty/qwtplot3d/3rdparty/gl2ps/COPYING.GL2PS 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/3rdparty/gl2ps/COPYING.GL2PS 1970-01-01 00:00:00 +0000 @@ -1,25 +0,0 @@ - - GL2PS LICENSE - Version 2, November 2003 - - Copyright (C) 2003, Christophe Geuzaine - -Permission to use, copy, and distribute this software and its -documentation for any purpose with or without fee is hereby granted, -provided that the copyright notice appear in all copies and that both -that copyright notice and this permission notice appear in supporting -documentation. - -Permission to modify and distribute modified versions of this software -is granted, provided that: - -1) the modifications are licensed under the same terms as this -software; - -2) you make available the source code of any modifications that you -distribute, either on the same media as you distribute any executable -or other form of this software, or via a mechanism generally accepted -in the software development community for the electronic transfer of -data. - -This software is provided "as is" without express or implied warranty. === added file '3rdparty/qwtplot3d/3rdparty/gl2ps/COPYING.LGPL' --- 3rdparty/qwtplot3d/3rdparty/gl2ps/COPYING.LGPL 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/3rdparty/gl2ps/COPYING.LGPL 2010-07-21 23:21:08 +0000 @@ -0,0 +1,482 @@ + + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! === removed file '3rdparty/qwtplot3d/3rdparty/gl2ps/COPYING.LGPL' --- 3rdparty/qwtplot3d/3rdparty/gl2ps/COPYING.LGPL 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/3rdparty/gl2ps/COPYING.LGPL 1970-01-01 00:00:00 +0000 @@ -1,482 +0,0 @@ - - GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the library, or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on -the original authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - - GNU LIBRARY GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! === added file '3rdparty/qwtplot3d/3rdparty/gl2ps/gl2ps.c' --- 3rdparty/qwtplot3d/3rdparty/gl2ps/gl2ps.c 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/3rdparty/gl2ps/gl2ps.c 2010-07-21 23:21:08 +0000 @@ -0,0 +1,6062 @@ +/* + * GL2PS, an OpenGL to PostScript Printing Library + * Copyright (C) 1999-2009 C. Geuzaine + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of either: + * + * a) the GNU Library General Public License as published by the Free + * Software Foundation, either version 2 of the License, or (at your + * option) any later version; or + * + * b) the GL2PS License as published by Christophe Geuzaine, either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either + * the GNU Library General Public License or the GL2PS License for + * more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library in the file named "COPYING.LGPL"; + * if not, write to the Free Software Foundation, Inc., 675 Mass Ave, + * Cambridge, MA 02139, USA. + * + * You should have received a copy of the GL2PS License with this + * library in the file named "COPYING.GL2PS"; if not, I will be glad + * to provide one. + * + * For the latest info about gl2ps and a full list of contributors, + * see http://www.geuz.org/gl2ps/. + * + * Please report all bugs and problems to . + */ + +#include "gl2ps.h" + +#include +#include +#include +#include +#include +#include + +#if defined(GL2PS_HAVE_ZLIB) +#include +#endif + +#if defined(GL2PS_HAVE_LIBPNG) +#include +#endif + +/********************************************************************* + * + * Private definitions, data structures and prototypes + * + *********************************************************************/ + +/* Magic numbers (assuming that the order of magnitude of window + coordinates is 10^3) */ + +#define GL2PS_EPSILON 5.0e-3F +#define GL2PS_ZSCALE 1000.0F +#define GL2PS_ZOFFSET 5.0e-2F +#define GL2PS_ZOFFSET_LARGE 20.0F +#define GL2PS_ZERO(arg) (fabs(arg) < 1.e-20) + +/* Primitive types */ + +#define GL2PS_NO_TYPE -1 +#define GL2PS_TEXT 1 +#define GL2PS_POINT 2 +#define GL2PS_LINE 3 +#define GL2PS_QUADRANGLE 4 +#define GL2PS_TRIANGLE 5 +#define GL2PS_PIXMAP 6 +#define GL2PS_IMAGEMAP 7 +#define GL2PS_IMAGEMAP_WRITTEN 8 +#define GL2PS_IMAGEMAP_VISIBLE 9 +#define GL2PS_SPECIAL 10 + +/* BSP tree primitive comparison */ + +#define GL2PS_COINCIDENT 1 +#define GL2PS_IN_FRONT_OF 2 +#define GL2PS_IN_BACK_OF 3 +#define GL2PS_SPANNING 4 + +/* 2D BSP tree primitive comparison */ + +#define GL2PS_POINT_COINCIDENT 0 +#define GL2PS_POINT_INFRONT 1 +#define GL2PS_POINT_BACK 2 + +/* Internal feedback buffer pass-through tokens */ + +#define GL2PS_BEGIN_OFFSET_TOKEN 1 +#define GL2PS_END_OFFSET_TOKEN 2 +#define GL2PS_BEGIN_BOUNDARY_TOKEN 3 +#define GL2PS_END_BOUNDARY_TOKEN 4 +#define GL2PS_BEGIN_STIPPLE_TOKEN 5 +#define GL2PS_END_STIPPLE_TOKEN 6 +#define GL2PS_POINT_SIZE_TOKEN 7 +#define GL2PS_LINE_WIDTH_TOKEN 8 +#define GL2PS_BEGIN_BLEND_TOKEN 9 +#define GL2PS_END_BLEND_TOKEN 10 +#define GL2PS_SRC_BLEND_TOKEN 11 +#define GL2PS_DST_BLEND_TOKEN 12 +#define GL2PS_IMAGEMAP_TOKEN 13 +#define GL2PS_DRAW_PIXELS_TOKEN 14 +#define GL2PS_TEXT_TOKEN 15 + +typedef enum { + T_UNDEFINED = -1, + T_CONST_COLOR = 1, + T_VAR_COLOR = 1<<1, + T_ALPHA_1 = 1<<2, + T_ALPHA_LESS_1 = 1<<3, + T_VAR_ALPHA = 1<<4 +} GL2PS_TRIANGLE_PROPERTY; + +typedef GLfloat GL2PSxyz[3]; +typedef GLfloat GL2PSplane[4]; + +typedef struct _GL2PSbsptree2d GL2PSbsptree2d; + +struct _GL2PSbsptree2d { + GL2PSplane plane; + GL2PSbsptree2d *front, *back; +}; + +typedef struct { + GLint nmax, size, incr, n; + char *array; +} GL2PSlist; + +typedef struct _GL2PSbsptree GL2PSbsptree; + +struct _GL2PSbsptree { + GL2PSplane plane; + GL2PSlist *primitives; + GL2PSbsptree *front, *back; +}; + +typedef struct { + GL2PSxyz xyz; + GL2PSrgba rgba; +} GL2PSvertex; + +typedef struct { + GL2PSvertex vertex[3]; + int prop; +} GL2PStriangle; + +typedef struct { + GLshort fontsize; + char *str, *fontname; + /* Note: for a 'special' string, 'alignment' holds the format + (PostScript, PDF, etc.) of the special string */ + GLint alignment; + GLfloat angle; +} GL2PSstring; + +typedef struct { + GLsizei width, height; + /* Note: for an imagemap, 'type' indicates if it has already been + written to the file or not, and 'format' indicates if it is + visible or not */ + GLenum format, type; + GLfloat *pixels; +} GL2PSimage; + +typedef struct _GL2PSimagemap GL2PSimagemap; + +struct _GL2PSimagemap { + GL2PSimage *image; + GL2PSimagemap *next; +}; + +typedef struct { + GLshort type, numverts; + GLushort pattern; + char boundary, offset, culled; + GLint factor; + GLfloat width; + GL2PSvertex *verts; + union { + GL2PSstring *text; + GL2PSimage *image; + } data; +} GL2PSprimitive; + +typedef struct { +#if defined(GL2PS_HAVE_ZLIB) + Bytef *dest, *src, *start; + uLongf destLen, srcLen; +#else + int dummy; +#endif +} GL2PScompress; + +typedef struct{ + GL2PSlist* ptrlist; + int gsno, fontno, imno, shno, maskshno, trgroupno; + int gsobjno, fontobjno, imobjno, shobjno, maskshobjno, trgroupobjno; +} GL2PSpdfgroup; + +typedef struct { + /* General */ + GLint format, sort, options, colorsize, colormode, buffersize; + char *title, *producer, *filename; + GLboolean boundary, blending; + GLfloat *feedback, offset[2], lastlinewidth; + GLint viewport[4], blendfunc[2], lastfactor; + GL2PSrgba *colormap, lastrgba, threshold, bgcolor; + GLushort lastpattern; + GL2PSvertex lastvertex; + GL2PSlist *primitives, *auxprimitives; + FILE *stream; + GL2PScompress *compress; + GLboolean header; + + /* BSP-specific */ + GLint maxbestroot; + + /* Occlusion culling-specific */ + GLboolean zerosurfacearea; + GL2PSbsptree2d *imagetree; + GL2PSprimitive *primitivetoadd; + + /* PDF-specific */ + int streamlength; + GL2PSlist *pdfprimlist, *pdfgrouplist; + int *xreflist; + int objects_stack; /* available objects */ + int extgs_stack; /* graphics state object number */ + int font_stack; /* font object number */ + int im_stack; /* image object number */ + int trgroupobjects_stack; /* xobject numbers */ + int shader_stack; /* shader object numbers */ + int mshader_stack; /* mask shader object numbers */ + + /* for image map list */ + GL2PSimagemap *imagemap_head; + GL2PSimagemap *imagemap_tail; +} GL2PScontext; + +typedef struct { + void (*printHeader)(void); + void (*printFooter)(void); + void (*beginViewport)(GLint viewport[4]); + GLint (*endViewport)(void); + void (*printPrimitive)(void *data); + void (*printFinalPrimitive)(void); + const char *file_extension; + const char *description; +} GL2PSbackend; + +/* The gl2ps context. gl2ps is not thread safe (we should create a + local GL2PScontext during gl2psBeginPage) */ + +static GL2PScontext *gl2ps = NULL; + +/* Need to forward-declare this one */ + +static GLint gl2psPrintPrimitives(void); + +/********************************************************************* + * + * Utility routines + * + *********************************************************************/ + +static void gl2psMsg(GLint level, const char *fmt, ...) +{ + va_list args; + + if(!(gl2ps->options & GL2PS_SILENT)){ + switch(level){ + case GL2PS_INFO : fprintf(stderr, "GL2PS info: "); break; + case GL2PS_WARNING : fprintf(stderr, "GL2PS warning: "); break; + case GL2PS_ERROR : fprintf(stderr, "GL2PS error: "); break; + } + va_start(args, fmt); + vfprintf(stderr, fmt, args); + va_end(args); + fprintf(stderr, "\n"); + } + /* if(level == GL2PS_ERROR) exit(1); */ +} + +static void *gl2psMalloc(size_t size) +{ + void *ptr; + + if(!size) return NULL; + ptr = malloc(size); + if(!ptr){ + gl2psMsg(GL2PS_ERROR, "Couldn't allocate requested memory"); + return NULL; + } + return ptr; +} + +static void *gl2psRealloc(void *ptr, size_t size) +{ + if(!size) return NULL; + ptr = realloc(ptr, size); + if(!ptr){ + gl2psMsg(GL2PS_ERROR, "Couldn't reallocate requested memory"); + return NULL; + } + return ptr; +} + +static void gl2psFree(void *ptr) +{ + if(!ptr) return; + free(ptr); +} + +static size_t gl2psWriteBigEndian(unsigned long data, size_t bytes) +{ + size_t i; + size_t size = sizeof(unsigned long); + for(i = 1; i <= bytes; ++i){ + fputc(0xff & (data >> (size-i) * 8), gl2ps->stream); + } + return bytes; +} + +/* zlib compression helper routines */ + +#if defined(GL2PS_HAVE_ZLIB) + +static void gl2psSetupCompress(void) +{ + gl2ps->compress = (GL2PScompress*)gl2psMalloc(sizeof(GL2PScompress)); + gl2ps->compress->src = NULL; + gl2ps->compress->start = NULL; + gl2ps->compress->dest = NULL; + gl2ps->compress->srcLen = 0; + gl2ps->compress->destLen = 0; +} + +static void gl2psFreeCompress(void) +{ + if(!gl2ps->compress) + return; + gl2psFree(gl2ps->compress->start); + gl2psFree(gl2ps->compress->dest); + gl2ps->compress->src = NULL; + gl2ps->compress->start = NULL; + gl2ps->compress->dest = NULL; + gl2ps->compress->srcLen = 0; + gl2ps->compress->destLen = 0; +} + +static int gl2psAllocCompress(unsigned int srcsize) +{ + gl2psFreeCompress(); + + if(!gl2ps->compress || !srcsize) + return GL2PS_ERROR; + + gl2ps->compress->srcLen = srcsize; + gl2ps->compress->destLen = (int)ceil(1.001 * gl2ps->compress->srcLen + 12); + gl2ps->compress->src = (Bytef*)gl2psMalloc(gl2ps->compress->srcLen); + gl2ps->compress->start = gl2ps->compress->src; + gl2ps->compress->dest = (Bytef*)gl2psMalloc(gl2ps->compress->destLen); + + return GL2PS_SUCCESS; +} + +static void *gl2psReallocCompress(unsigned int srcsize) +{ + if(!gl2ps->compress || !srcsize) + return NULL; + + if(srcsize < gl2ps->compress->srcLen) + return gl2ps->compress->start; + + gl2ps->compress->srcLen = srcsize; + gl2ps->compress->destLen = (int)ceil(1.001 * gl2ps->compress->srcLen + 12); + gl2ps->compress->src = (Bytef*)gl2psRealloc(gl2ps->compress->src, + gl2ps->compress->srcLen); + gl2ps->compress->start = gl2ps->compress->src; + gl2ps->compress->dest = (Bytef*)gl2psRealloc(gl2ps->compress->dest, + gl2ps->compress->destLen); + + return gl2ps->compress->start; +} + +static size_t gl2psWriteBigEndianCompress(unsigned long data, size_t bytes) +{ + size_t i; + size_t size = sizeof(unsigned long); + for(i = 1; i <= bytes; ++i){ + *gl2ps->compress->src = (Bytef)(0xff & (data >> (size-i) * 8)); + ++gl2ps->compress->src; + } + return bytes; +} + +static int gl2psDeflate(void) +{ + /* For compatibility with older zlib versions, we use compress(...) + instead of compress2(..., Z_BEST_COMPRESSION) */ + return compress(gl2ps->compress->dest, &gl2ps->compress->destLen, + gl2ps->compress->start, gl2ps->compress->srcLen); +} + +#endif + +static int gl2psPrintf(const char* fmt, ...) +{ + int ret; + va_list args; + +#if defined(GL2PS_HAVE_ZLIB) + unsigned int oldsize = 0; + static char buf[1000]; + if(gl2ps->options & GL2PS_COMPRESS){ + va_start(args, fmt); + ret = vsprintf(buf, fmt, args); + va_end(args); + oldsize = gl2ps->compress->srcLen; + gl2ps->compress->start = (Bytef*)gl2psReallocCompress(oldsize + ret); + memcpy(gl2ps->compress->start+oldsize, buf, ret); + ret = 0; + } + else{ +#endif + va_start(args, fmt); + ret = vfprintf(gl2ps->stream, fmt, args); + va_end(args); +#if defined(GL2PS_HAVE_ZLIB) + } +#endif + return ret; +} + +static void gl2psPrintGzipHeader() +{ +#if defined(GL2PS_HAVE_ZLIB) + char tmp[10] = {'\x1f', '\x8b', /* magic numbers: 0x1f, 0x8b */ + 8, /* compression method: Z_DEFLATED */ + 0, /* flags */ + 0, 0, 0, 0, /* time */ + 2, /* extra flags: max compression */ + '\x03'}; /* OS code: 0x03 (Unix) */ + + if(gl2ps->options & GL2PS_COMPRESS){ + gl2psSetupCompress(); + /* add the gzip file header */ + fwrite(tmp, 10, 1, gl2ps->stream); + } +#endif +} + +static void gl2psPrintGzipFooter() +{ +#if defined(GL2PS_HAVE_ZLIB) + int n; + uLong crc, len; + char tmp[8]; + + if(gl2ps->options & GL2PS_COMPRESS){ + if(Z_OK != gl2psDeflate()){ + gl2psMsg(GL2PS_ERROR, "Zlib deflate error"); + } + else{ + /* determine the length of the header in the zlib stream */ + n = 2; /* CMF+FLG */ + if(gl2ps->compress->dest[1] & (1<<5)){ + n += 4; /* DICTID */ + } + /* write the data, without the zlib header and footer */ + fwrite(gl2ps->compress->dest+n, gl2ps->compress->destLen-(n+4), + 1, gl2ps->stream); + /* add the gzip file footer */ + crc = crc32(0L, gl2ps->compress->start, gl2ps->compress->srcLen); + for(n = 0; n < 4; ++n){ + tmp[n] = (char)(crc & 0xff); + crc >>= 8; + } + len = gl2ps->compress->srcLen; + for(n = 4; n < 8; ++n){ + tmp[n] = (char)(len & 0xff); + len >>= 8; + } + fwrite(tmp, 8, 1, gl2ps->stream); + } + gl2psFreeCompress(); + gl2psFree(gl2ps->compress); + gl2ps->compress = NULL; + } +#endif +} + +/* The list handling routines */ + +static void gl2psListRealloc(GL2PSlist *list, GLint n) +{ + if(!list){ + gl2psMsg(GL2PS_ERROR, "Cannot reallocate NULL list"); + return; + } + if(n <= 0) return; + if(!list->array){ + list->nmax = n; + list->array = (char*)gl2psMalloc(list->nmax * list->size); + } + else{ + if(n > list->nmax){ + list->nmax = ((n - 1) / list->incr + 1) * list->incr; + list->array = (char*)gl2psRealloc(list->array, + list->nmax * list->size); + } + } +} + +static GL2PSlist *gl2psListCreate(GLint n, GLint incr, GLint size) +{ + GL2PSlist *list; + + if(n < 0) n = 0; + if(incr <= 0) incr = 1; + list = (GL2PSlist*)gl2psMalloc(sizeof(GL2PSlist)); + list->nmax = 0; + list->incr = incr; + list->size = size; + list->n = 0; + list->array = NULL; + gl2psListRealloc(list, n); + return list; +} + +static void gl2psListReset(GL2PSlist *list) +{ + if(!list) return; + list->n = 0; +} + +static void gl2psListDelete(GL2PSlist *list) +{ + if(!list) return; + gl2psFree(list->array); + gl2psFree(list); +} + +static void gl2psListAdd(GL2PSlist *list, void *data) +{ + if(!list){ + gl2psMsg(GL2PS_ERROR, "Cannot add into unallocated list"); + return; + } + list->n++; + gl2psListRealloc(list, list->n); + memcpy(&list->array[(list->n - 1) * list->size], data, list->size); +} + +static int gl2psListNbr(GL2PSlist *list) +{ + if(!list) + return 0; + return list->n; +} + +static void *gl2psListPointer(GL2PSlist *list, GLint index) +{ + if(!list){ + gl2psMsg(GL2PS_ERROR, "Cannot point into unallocated list"); + return NULL; + } + if((index < 0) || (index >= list->n)){ + gl2psMsg(GL2PS_ERROR, "Wrong list index in gl2psListPointer"); + return NULL; + } + return &list->array[index * list->size]; +} + +static void gl2psListSort(GL2PSlist *list, + int (*fcmp)(const void *a, const void *b)) +{ + if(!list) + return; + qsort(list->array, list->n, list->size, fcmp); +} + +static void gl2psListAction(GL2PSlist *list, void (*action)(void *data)) +{ + GLint i; + + for(i = 0; i < gl2psListNbr(list); i++){ + (*action)(gl2psListPointer(list, i)); + } +} + +static void gl2psListActionInverse(GL2PSlist *list, void (*action)(void *data)) +{ + GLint i; + + for(i = gl2psListNbr(list); i > 0; i--){ + (*action)(gl2psListPointer(list, i-1)); + } +} + +#if defined(GL2PS_HAVE_LIBPNG) + +static void gl2psListRead(GL2PSlist *list, int index, void *data) +{ + if((index < 0) || (index >= list->n)) + gl2psMsg(GL2PS_ERROR, "Wrong list index in gl2psListRead"); + memcpy(data, &list->array[index * list->size], list->size); +} + +static void gl2psEncodeBase64Block(unsigned char in[3], unsigned char out[4], int len) +{ + static const char cb64[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + + out[0] = cb64[ in[0] >> 2 ]; + out[1] = cb64[ ((in[0] & 0x03) << 4) | ((in[1] & 0xf0) >> 4) ]; + out[2] = (len > 1) ? cb64[ ((in[1] & 0x0f) << 2) | ((in[2] & 0xc0) >> 6) ] : '='; + out[3] = (len > 2) ? cb64[ in[2] & 0x3f ] : '='; +} + +static void gl2psListEncodeBase64(GL2PSlist *list) +{ + unsigned char *buffer, in[3], out[4]; + int i, n, index, len; + + n = list->n * list->size; + buffer = (unsigned char*)gl2psMalloc(n * sizeof(unsigned char)); + memcpy(buffer, list->array, n * sizeof(unsigned char)); + gl2psListReset(list); + + index = 0; + while(index < n) { + len = 0; + for(i = 0; i < 3; i++) { + if(index < n){ + in[i] = buffer[index]; + len++; + } + else{ + in[i] = 0; + } + index++; + } + if(len) { + gl2psEncodeBase64Block(in, out, len); + for(i = 0; i < 4; i++) + gl2psListAdd(list, &out[i]); + } + } + gl2psFree(buffer); +} + +#endif + +/* Helpers for rgba colors */ + +static GLboolean gl2psSameColor(GL2PSrgba rgba1, GL2PSrgba rgba2) +{ + if(!GL2PS_ZERO(rgba1[0] - rgba2[0]) || + !GL2PS_ZERO(rgba1[1] - rgba2[1]) || + !GL2PS_ZERO(rgba1[2] - rgba2[2])) + return GL_FALSE; + return GL_TRUE; +} + +static GLboolean gl2psVertsSameColor(const GL2PSprimitive *prim) +{ + int i; + + for(i = 1; i < prim->numverts; i++){ + if(!gl2psSameColor(prim->verts[0].rgba, prim->verts[i].rgba)){ + return GL_FALSE; + } + } + return GL_TRUE; +} + +static GLboolean gl2psSameColorThreshold(int n, GL2PSrgba rgba[], + GL2PSrgba threshold) +{ + int i; + + if(n < 2) return GL_TRUE; + + for(i = 1; i < n; i++){ + if(fabs(rgba[0][0] - rgba[i][0]) > threshold[0] || + fabs(rgba[0][1] - rgba[i][1]) > threshold[1] || + fabs(rgba[0][2] - rgba[i][2]) > threshold[2]) + return GL_FALSE; + } + + return GL_TRUE; +} + +static void gl2psSetLastColor(GL2PSrgba rgba) +{ + int i; + for(i = 0; i < 3; ++i){ + gl2ps->lastrgba[i] = rgba[i]; + } +} + +static GLfloat gl2psGetRGB(GL2PSimage *im, GLuint x, GLuint y, + GLfloat *red, GLfloat *green, GLfloat *blue) +{ + + GLsizei width = im->width; + GLsizei height = im->height; + GLfloat *pixels = im->pixels; + GLfloat *pimag; + + /* OpenGL image is from down to up, PS image is up to down */ + switch(im->format){ + case GL_RGBA: + pimag = pixels + 4 * (width * (height - 1 - y) + x); + break; + case GL_RGB: + default: + pimag = pixels + 3 * (width * (height - 1 - y) + x); + break; + } + *red = *pimag; pimag++; + *green = *pimag; pimag++; + *blue = *pimag; pimag++; + + return (im->format == GL_RGBA) ? *pimag : 1.0F; +} + +/* Helper routines for pixmaps */ + +static GL2PSimage *gl2psCopyPixmap(GL2PSimage *im) +{ + int size; + GL2PSimage *image = (GL2PSimage*)gl2psMalloc(sizeof(GL2PSimage)); + + image->width = im->width; + image->height = im->height; + image->format = im->format; + image->type = im->type; + + switch(image->format){ + case GL_RGBA: + size = image->height * image->width * 4 * sizeof(GLfloat); + break; + case GL_RGB: + default: + size = image->height * image->width * 3 * sizeof(GLfloat); + break; + } + + image->pixels = (GLfloat*)gl2psMalloc(size); + memcpy(image->pixels, im->pixels, size); + + return image; +} + +static void gl2psFreePixmap(GL2PSimage *im) +{ + if(!im) + return; + gl2psFree(im->pixels); + gl2psFree(im); +} + +#if defined(GL2PS_HAVE_LIBPNG) + +#if !defined(png_jmpbuf) +# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) +#endif + +static void gl2psUserWritePNG(png_structp png_ptr, png_bytep data, png_size_t length) +{ + unsigned int i; + GL2PSlist *png = (GL2PSlist*)png_get_io_ptr(png_ptr); + for(i = 0; i < length; i++) + gl2psListAdd(png, &data[i]); +} + +static void gl2psUserFlushPNG(png_structp png_ptr) +{ +} + +static void gl2psConvertPixmapToPNG(GL2PSimage *pixmap, GL2PSlist *png) +{ + png_structp png_ptr; + png_infop info_ptr; + unsigned char *row_data; + GLfloat dr, dg, db; + int row, col; + + if(!(png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL))) + return; + + if(!(info_ptr = png_create_info_struct(png_ptr))){ + png_destroy_write_struct(&png_ptr, NULL); + return; + } + + if(setjmp(png_jmpbuf(png_ptr))) { + png_destroy_write_struct(&png_ptr, &info_ptr); + return; + } + + png_set_write_fn(png_ptr, (void *)png, gl2psUserWritePNG, gl2psUserFlushPNG); + png_set_compression_level(png_ptr, Z_DEFAULT_COMPRESSION); + png_set_IHDR(png_ptr, info_ptr, pixmap->width, pixmap->height, 8, + PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, + PNG_FILTER_TYPE_BASE); + png_write_info(png_ptr, info_ptr); + + row_data = (unsigned char*)gl2psMalloc(3 * pixmap->width * sizeof(unsigned char)); + for(row = 0; row < pixmap->height; row++){ + for(col = 0; col < pixmap->width; col++){ + gl2psGetRGB(pixmap, col, row, &dr, &dg, &db); + row_data[3*col] = (unsigned char)(255. * dr); + row_data[3*col+1] = (unsigned char)(255. * dg); + row_data[3*col+2] = (unsigned char)(255. * db); + } + png_write_row(png_ptr, (png_bytep)row_data); + } + gl2psFree(row_data); + + png_write_end(png_ptr, info_ptr); + png_destroy_write_struct(&png_ptr, &info_ptr); +} + +#endif + +/* Helper routines for text strings */ + +static GLint gl2psAddText(GLint type, const char *str, const char *fontname, + GLshort fontsize, GLint alignment, GLfloat angle) +{ + GLfloat pos[4]; + GL2PSprimitive *prim; + //GLboolean valid; + + if(!gl2ps || !str || !fontname) return GL2PS_UNINITIALIZED; + + if(gl2ps->options & GL2PS_NO_TEXT) return GL2PS_SUCCESS; + + //The lines bellow were commented out by Ion Vasilief since this check prevents the export of some texts + //glGetBooleanv(GL_CURRENT_RASTER_POSITION_VALID, &valid); + //if(GL_FALSE == valid) return GL2PS_SUCCESS; /* the primitive is culled */ + + glGetFloatv(GL_CURRENT_RASTER_POSITION, pos); + + prim = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); + prim->type = type; + prim->boundary = 0; + prim->numverts = 1; + prim->verts = (GL2PSvertex*)gl2psMalloc(sizeof(GL2PSvertex)); + prim->verts[0].xyz[0] = pos[0]; + prim->verts[0].xyz[1] = pos[1]; + prim->verts[0].xyz[2] = pos[2]; + prim->culled = 0; + prim->offset = 0; + prim->pattern = 0; + prim->factor = 0; + prim->width = 1; + glGetFloatv(GL_CURRENT_RASTER_COLOR, prim->verts[0].rgba); + prim->data.text = (GL2PSstring*)gl2psMalloc(sizeof(GL2PSstring)); + prim->data.text->str = (char*)gl2psMalloc((strlen(str)+1)*sizeof(char)); + strcpy(prim->data.text->str, str); + prim->data.text->fontname = (char*)gl2psMalloc((strlen(fontname)+1)*sizeof(char)); + strcpy(prim->data.text->fontname, fontname); + prim->data.text->fontsize = fontsize; + prim->data.text->alignment = alignment; + prim->data.text->angle = angle; + + gl2psListAdd(gl2ps->auxprimitives, &prim); + glPassThrough(GL2PS_TEXT_TOKEN); + + return GL2PS_SUCCESS; +} + +static GL2PSstring *gl2psCopyText(GL2PSstring *t) +{ + GL2PSstring *text = (GL2PSstring*)gl2psMalloc(sizeof(GL2PSstring)); + text->str = (char*)gl2psMalloc((strlen(t->str)+1)*sizeof(char)); + strcpy(text->str, t->str); + text->fontname = (char*)gl2psMalloc((strlen(t->fontname)+1)*sizeof(char)); + strcpy(text->fontname, t->fontname); + text->fontsize = t->fontsize; + text->alignment = t->alignment; + text->angle = t->angle; + + return text; +} + +static void gl2psFreeText(GL2PSstring *text) +{ + if(!text) + return; + gl2psFree(text->str); + gl2psFree(text->fontname); + gl2psFree(text); +} + +/* Helpers for blending modes */ + +static GLboolean gl2psSupportedBlendMode(GLenum sfactor, GLenum dfactor) +{ + /* returns TRUE if gl2ps supports the argument combination: only two + blending modes have been implemented so far */ + + if( (sfactor == GL_SRC_ALPHA && dfactor == GL_ONE_MINUS_SRC_ALPHA) || + (sfactor == GL_ONE && dfactor == GL_ZERO) ) + return GL_TRUE; + return GL_FALSE; +} + +static void gl2psAdaptVertexForBlending(GL2PSvertex *v) +{ + /* Transforms vertex depending on the actual blending function - + currently the vertex v is considered as source vertex and his + alpha value is changed to 1.0 if source blending GL_ONE is + active. This might be extended in the future */ + + if(!v || !gl2ps) + return; + + if(gl2ps->options & GL2PS_NO_BLENDING || !gl2ps->blending){ + v->rgba[3] = 1.0F; + return; + } + + switch(gl2ps->blendfunc[0]){ + case GL_ONE: + v->rgba[3] = 1.0F; + break; + default: + break; + } +} + +static void gl2psAssignTriangleProperties(GL2PStriangle *t) +{ + /* int i; */ + + t->prop = T_VAR_COLOR; + + /* Uncommenting the following lines activates an even more fine + grained distinction between triangle types - please don't delete, + a remarkable amount of PDF handling code inside this file depends + on it if activated */ + /* + t->prop = T_CONST_COLOR; + for(i = 0; i < 3; ++i){ + if(!GL2PS_ZERO(t->vertex[0].rgba[i] - t->vertex[1].rgba[i]) || + !GL2PS_ZERO(t->vertex[1].rgba[i] - t->vertex[2].rgba[i])){ + t->prop = T_VAR_COLOR; + break; + } + } + */ + + if(!GL2PS_ZERO(t->vertex[0].rgba[3] - t->vertex[1].rgba[3]) || + !GL2PS_ZERO(t->vertex[1].rgba[3] - t->vertex[2].rgba[3])){ + t->prop |= T_VAR_ALPHA; + } + else{ + if(t->vertex[0].rgba[3] < 1) + t->prop |= T_ALPHA_LESS_1; + else + t->prop |= T_ALPHA_1; + } +} + +static void gl2psFillTriangleFromPrimitive(GL2PStriangle *t, GL2PSprimitive *p, + GLboolean assignprops) +{ + t->vertex[0] = p->verts[0]; + t->vertex[1] = p->verts[1]; + t->vertex[2] = p->verts[2]; + if(GL_TRUE == assignprops) + gl2psAssignTriangleProperties(t); +} + +static void gl2psInitTriangle(GL2PStriangle *t) +{ + int i; + GL2PSvertex vertex = { {-1.0F, -1.0F, -1.0F}, {-1.0F, -1.0F, -1.0F, -1.0F} }; + for(i = 0; i < 3; i++) + t->vertex[i] = vertex; + t->prop = T_UNDEFINED; +} + +/* Miscellaneous helper routines */ + +static GL2PSprimitive *gl2psCopyPrimitive(GL2PSprimitive *p) +{ + GL2PSprimitive *prim; + + if(!p){ + gl2psMsg(GL2PS_ERROR, "Trying to copy an empty primitive"); + return NULL; + } + + prim = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); + + prim->type = p->type; + prim->numverts = p->numverts; + prim->boundary = p->boundary; + prim->offset = p->offset; + prim->pattern = p->pattern; + prim->factor = p->factor; + prim->culled = p->culled; + prim->width = p->width; + prim->verts = (GL2PSvertex*)gl2psMalloc(p->numverts*sizeof(GL2PSvertex)); + memcpy(prim->verts, p->verts, p->numverts * sizeof(GL2PSvertex)); + + switch(prim->type){ + case GL2PS_PIXMAP : + prim->data.image = gl2psCopyPixmap(p->data.image); + break; + case GL2PS_TEXT : + case GL2PS_SPECIAL : + prim->data.text = gl2psCopyText(p->data.text); + break; + default: + break; + } + + return prim; +} + +static GLboolean gl2psSamePosition(GL2PSxyz p1, GL2PSxyz p2) +{ + if(!GL2PS_ZERO(p1[0] - p2[0]) || + !GL2PS_ZERO(p1[1] - p2[1]) || + !GL2PS_ZERO(p1[2] - p2[2])) + return GL_FALSE; + return GL_TRUE; +} + +/********************************************************************* + * + * 3D sorting routines + * + *********************************************************************/ + +static GLfloat gl2psComparePointPlane(GL2PSxyz point, GL2PSplane plane) +{ + return (plane[0] * point[0] + + plane[1] * point[1] + + plane[2] * point[2] + + plane[3]); +} + +static GLfloat gl2psPsca(GLfloat *a, GLfloat *b) +{ + return (a[0]*b[0] + a[1]*b[1] + a[2]*b[2]); +} + +static void gl2psPvec(GLfloat *a, GLfloat *b, GLfloat *c) +{ + c[0] = a[1]*b[2] - a[2]*b[1]; + c[1] = a[2]*b[0] - a[0]*b[2]; + c[2] = a[0]*b[1] - a[1]*b[0]; +} + +static GLfloat gl2psNorm(GLfloat *a) +{ + return (GLfloat)sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]); +} + +static void gl2psGetNormal(GLfloat *a, GLfloat *b, GLfloat *c) +{ + GLfloat norm; + + gl2psPvec(a, b, c); + if(!GL2PS_ZERO(norm = gl2psNorm(c))){ + c[0] = c[0] / norm; + c[1] = c[1] / norm; + c[2] = c[2] / norm; + } + else{ + /* The plane is still wrong despite our tests in gl2psGetPlane. + Let's return a dummy value for now (this is a hack: we should + do more intelligent tests in GetPlane) */ + c[0] = c[1] = 0.0F; + c[2] = 1.0F; + } +} + +static void gl2psGetPlane(GL2PSprimitive *prim, GL2PSplane plane) +{ + GL2PSxyz v = {0.0F, 0.0F, 0.0F}, w = {0.0F, 0.0F, 0.0F}; + + switch(prim->type){ + case GL2PS_TRIANGLE : + case GL2PS_QUADRANGLE : + v[0] = prim->verts[1].xyz[0] - prim->verts[0].xyz[0]; + v[1] = prim->verts[1].xyz[1] - prim->verts[0].xyz[1]; + v[2] = prim->verts[1].xyz[2] - prim->verts[0].xyz[2]; + w[0] = prim->verts[2].xyz[0] - prim->verts[0].xyz[0]; + w[1] = prim->verts[2].xyz[1] - prim->verts[0].xyz[1]; + w[2] = prim->verts[2].xyz[2] - prim->verts[0].xyz[2]; + if((GL2PS_ZERO(v[0]) && GL2PS_ZERO(v[1]) && GL2PS_ZERO(v[2])) || + (GL2PS_ZERO(w[0]) && GL2PS_ZERO(w[1]) && GL2PS_ZERO(w[2]))){ + plane[0] = plane[1] = 0.0F; + plane[2] = 1.0F; + plane[3] = -prim->verts[0].xyz[2]; + } + else{ + gl2psGetNormal(v, w, plane); + plane[3] = + - plane[0] * prim->verts[0].xyz[0] + - plane[1] * prim->verts[0].xyz[1] + - plane[2] * prim->verts[0].xyz[2]; + } + break; + case GL2PS_LINE : + v[0] = prim->verts[1].xyz[0] - prim->verts[0].xyz[0]; + v[1] = prim->verts[1].xyz[1] - prim->verts[0].xyz[1]; + v[2] = prim->verts[1].xyz[2] - prim->verts[0].xyz[2]; + if(GL2PS_ZERO(v[0]) && GL2PS_ZERO(v[1]) && GL2PS_ZERO(v[2])){ + plane[0] = plane[1] = 0.0F; + plane[2] = 1.0F; + plane[3] = -prim->verts[0].xyz[2]; + } + else{ + if(GL2PS_ZERO(v[0])) w[0] = 1.0F; + else if(GL2PS_ZERO(v[1])) w[1] = 1.0F; + else w[2] = 1.0F; + gl2psGetNormal(v, w, plane); + plane[3] = + - plane[0] * prim->verts[0].xyz[0] + - plane[1] * prim->verts[0].xyz[1] + - plane[2] * prim->verts[0].xyz[2]; + } + break; + case GL2PS_POINT : + case GL2PS_PIXMAP : + case GL2PS_TEXT : + case GL2PS_SPECIAL : + case GL2PS_IMAGEMAP: + plane[0] = plane[1] = 0.0F; + plane[2] = 1.0F; + plane[3] = -prim->verts[0].xyz[2]; + break; + default : + gl2psMsg(GL2PS_ERROR, "Unknown primitive type in BSP tree"); + plane[0] = plane[1] = plane[3] = 0.0F; + plane[2] = 1.0F; + break; + } +} + +static void gl2psCutEdge(GL2PSvertex *a, GL2PSvertex *b, GL2PSplane plane, + GL2PSvertex *c) +{ + GL2PSxyz v; + GLfloat sect, psca; + + v[0] = b->xyz[0] - a->xyz[0]; + v[1] = b->xyz[1] - a->xyz[1]; + v[2] = b->xyz[2] - a->xyz[2]; + + if(!GL2PS_ZERO(psca = gl2psPsca(plane, v))) + sect = -gl2psComparePointPlane(a->xyz, plane) / psca; + else + sect = 0.0F; + + c->xyz[0] = a->xyz[0] + v[0] * sect; + c->xyz[1] = a->xyz[1] + v[1] * sect; + c->xyz[2] = a->xyz[2] + v[2] * sect; + + c->rgba[0] = (1 - sect) * a->rgba[0] + sect * b->rgba[0]; + c->rgba[1] = (1 - sect) * a->rgba[1] + sect * b->rgba[1]; + c->rgba[2] = (1 - sect) * a->rgba[2] + sect * b->rgba[2]; + c->rgba[3] = (1 - sect) * a->rgba[3] + sect * b->rgba[3]; +} + +static void gl2psCreateSplitPrimitive(GL2PSprimitive *parent, GL2PSplane plane, + GL2PSprimitive *child, GLshort numverts, + GLshort *index0, GLshort *index1) +{ + GLshort i; + + if(parent->type == GL2PS_IMAGEMAP){ + child->type = GL2PS_IMAGEMAP; + child->data.image = parent->data.image; + } + else{ + if(numverts > 4){ + gl2psMsg(GL2PS_WARNING, "%d vertices in polygon", numverts); + numverts = 4; + } + switch(numverts){ + case 1 : child->type = GL2PS_POINT; break; + case 2 : child->type = GL2PS_LINE; break; + case 3 : child->type = GL2PS_TRIANGLE; break; + case 4 : child->type = GL2PS_QUADRANGLE; break; + default: child->type = GL2PS_NO_TYPE; break; + } + } + + child->boundary = 0; /* FIXME: not done! */ + child->culled = parent->culled; + child->offset = parent->offset; + child->pattern = parent->pattern; + child->factor = parent->factor; + child->width = parent->width; + child->numverts = numverts; + child->verts = (GL2PSvertex*)gl2psMalloc(numverts * sizeof(GL2PSvertex)); + + for(i = 0; i < numverts; i++){ + if(index1[i] < 0){ + child->verts[i] = parent->verts[index0[i]]; + } + else{ + gl2psCutEdge(&parent->verts[index0[i]], &parent->verts[index1[i]], + plane, &child->verts[i]); + } + } +} + +static void gl2psAddIndex(GLshort *index0, GLshort *index1, GLshort *nb, + GLshort i, GLshort j) +{ + GLint k; + + for(k = 0; k < *nb; k++){ + if((index0[k] == i && index1[k] == j) || + (index1[k] == i && index0[k] == j)) return; + } + index0[*nb] = i; + index1[*nb] = j; + (*nb)++; +} + +static GLshort gl2psGetIndex(GLshort i, GLshort num) +{ + return (i < num - 1) ? i + 1 : 0; +} + +static GLint gl2psTestSplitPrimitive(GL2PSprimitive *prim, GL2PSplane plane) +{ + GLint type = GL2PS_COINCIDENT; + GLshort i, j; + GLfloat d[5]; + + for(i = 0; i < prim->numverts; i++){ + d[i] = gl2psComparePointPlane(prim->verts[i].xyz, plane); + } + + if(prim->numverts < 2){ + return 0; + } + else{ + for(i = 0; i < prim->numverts; i++){ + j = gl2psGetIndex(i, prim->numverts); + if(d[j] > GL2PS_EPSILON){ + if(type == GL2PS_COINCIDENT) type = GL2PS_IN_BACK_OF; + else if(type != GL2PS_IN_BACK_OF) return 1; + if(d[i] < -GL2PS_EPSILON) return 1; + } + else if(d[j] < -GL2PS_EPSILON){ + if(type == GL2PS_COINCIDENT) type = GL2PS_IN_FRONT_OF; + else if(type != GL2PS_IN_FRONT_OF) return 1; + if(d[i] > GL2PS_EPSILON) return 1; + } + } + } + return 0; +} + +static GLint gl2psSplitPrimitive(GL2PSprimitive *prim, GL2PSplane plane, + GL2PSprimitive **front, GL2PSprimitive **back) +{ + GLshort i, j, in = 0, out = 0, in0[5], in1[5], out0[5], out1[5]; + GLint type; + GLfloat d[5]; + + type = GL2PS_COINCIDENT; + + for(i = 0; i < prim->numverts; i++){ + d[i] = gl2psComparePointPlane(prim->verts[i].xyz, plane); + } + + switch(prim->type){ + case GL2PS_POINT : + if(d[0] > GL2PS_EPSILON) type = GL2PS_IN_BACK_OF; + else if(d[0] < -GL2PS_EPSILON) type = GL2PS_IN_FRONT_OF; + else type = GL2PS_COINCIDENT; + break; + default : + for(i = 0; i < prim->numverts; i++){ + j = gl2psGetIndex(i, prim->numverts); + if(d[j] > GL2PS_EPSILON){ + if(type == GL2PS_COINCIDENT) type = GL2PS_IN_BACK_OF; + else if(type != GL2PS_IN_BACK_OF) type = GL2PS_SPANNING; + if(d[i] < -GL2PS_EPSILON){ + gl2psAddIndex(in0, in1, &in, i, j); + gl2psAddIndex(out0, out1, &out, i, j); + type = GL2PS_SPANNING; + } + gl2psAddIndex(out0, out1, &out, j, -1); + } + else if(d[j] < -GL2PS_EPSILON){ + if(type == GL2PS_COINCIDENT) type = GL2PS_IN_FRONT_OF; + else if(type != GL2PS_IN_FRONT_OF) type = GL2PS_SPANNING; + if(d[i] > GL2PS_EPSILON){ + gl2psAddIndex(in0, in1, &in, i, j); + gl2psAddIndex(out0, out1, &out, i, j); + type = GL2PS_SPANNING; + } + gl2psAddIndex(in0, in1, &in, j, -1); + } + else{ + gl2psAddIndex(in0, in1, &in, j, -1); + gl2psAddIndex(out0, out1, &out, j, -1); + } + } + break; + } + + if(type == GL2PS_SPANNING){ + *back = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); + *front = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); + gl2psCreateSplitPrimitive(prim, plane, *back, out, out0, out1); + gl2psCreateSplitPrimitive(prim, plane, *front, in, in0, in1); + } + + return type; +} + +static void gl2psDivideQuad(GL2PSprimitive *quad, + GL2PSprimitive **t1, GL2PSprimitive **t2) +{ + *t1 = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); + *t2 = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); + (*t1)->type = (*t2)->type = GL2PS_TRIANGLE; + (*t1)->numverts = (*t2)->numverts = 3; + (*t1)->culled = (*t2)->culled = quad->culled; + (*t1)->offset = (*t2)->offset = quad->offset; + (*t1)->pattern = (*t2)->pattern = quad->pattern; + (*t1)->factor = (*t2)->factor = quad->factor; + (*t1)->width = (*t2)->width = quad->width; + (*t1)->verts = (GL2PSvertex*)gl2psMalloc(3 * sizeof(GL2PSvertex)); + (*t2)->verts = (GL2PSvertex*)gl2psMalloc(3 * sizeof(GL2PSvertex)); + (*t1)->verts[0] = quad->verts[0]; + (*t1)->verts[1] = quad->verts[1]; + (*t1)->verts[2] = quad->verts[2]; + (*t1)->boundary = ((quad->boundary & 1) ? 1 : 0) | ((quad->boundary & 2) ? 2 : 0); + (*t2)->verts[0] = quad->verts[0]; + (*t2)->verts[1] = quad->verts[2]; + (*t2)->verts[2] = quad->verts[3]; + (*t2)->boundary = ((quad->boundary & 4) ? 2 : 0) | ((quad->boundary & 4) ? 2 : 0); +} + +static int gl2psCompareDepth(const void *a, const void *b) +{ + GL2PSprimitive *q, *w; + GLfloat dq = 0.0F, dw = 0.0F, diff; + int i; + + q = *(GL2PSprimitive**)a; + w = *(GL2PSprimitive**)b; + + for(i = 0; i < q->numverts; i++){ + dq += q->verts[i].xyz[2]; + } + dq /= (GLfloat)q->numverts; + + for(i = 0; i < w->numverts; i++){ + dw += w->verts[i].xyz[2]; + } + dw /= (GLfloat)w->numverts; + + diff = dq - dw; + if(diff > 0.){ + return -1; + } + else if(diff < 0.){ + return 1; + } + else{ + return 0; + } +} + +static int gl2psTrianglesFirst(const void *a, const void *b) +{ + GL2PSprimitive *q, *w; + + q = *(GL2PSprimitive**)a; + w = *(GL2PSprimitive**)b; + return (q->type < w->type ? 1 : -1); +} + +static GLint gl2psFindRoot(GL2PSlist *primitives, GL2PSprimitive **root) +{ + GLint i, j, count, best = 1000000, index = 0; + GL2PSprimitive *prim1, *prim2; + GL2PSplane plane; + GLint maxp; + + if(!gl2psListNbr(primitives)){ + gl2psMsg(GL2PS_ERROR, "Cannot fint root in empty primitive list"); + return 0; + } + + *root = *(GL2PSprimitive**)gl2psListPointer(primitives, 0); + + if(gl2ps->options & GL2PS_BEST_ROOT){ + maxp = gl2psListNbr(primitives); + if(maxp > gl2ps->maxbestroot){ + maxp = gl2ps->maxbestroot; + } + for(i = 0; i < maxp; i++){ + prim1 = *(GL2PSprimitive**)gl2psListPointer(primitives, i); + gl2psGetPlane(prim1, plane); + count = 0; + for(j = 0; j < gl2psListNbr(primitives); j++){ + if(j != i){ + prim2 = *(GL2PSprimitive**)gl2psListPointer(primitives, j); + count += gl2psTestSplitPrimitive(prim2, plane); + } + if(count > best) break; + } + if(count < best){ + best = count; + index = i; + *root = prim1; + if(!count) return index; + } + } + /* if(index) gl2psMsg(GL2PS_INFO, "GL2PS_BEST_ROOT was worth it: %d", index); */ + return index; + } + else{ + return 0; + } +} + +static void gl2psFreeImagemap(GL2PSimagemap *list) +{ + GL2PSimagemap *next; + while(list != NULL){ + next = list->next; + gl2psFree(list->image->pixels); + gl2psFree(list->image); + gl2psFree(list); + list = next; + } +} + +static void gl2psFreePrimitive(void *data) +{ + GL2PSprimitive *q; + + q = *(GL2PSprimitive**)data; + gl2psFree(q->verts); + if(q->type == GL2PS_TEXT || q->type == GL2PS_SPECIAL){ + gl2psFreeText(q->data.text); + } + else if(q->type == GL2PS_PIXMAP){ + gl2psFreePixmap(q->data.image); + } + gl2psFree(q); +} + +static void gl2psAddPrimitiveInList(GL2PSprimitive *prim, GL2PSlist *list) +{ + GL2PSprimitive *t1, *t2; + + if(prim->type != GL2PS_QUADRANGLE){ + gl2psListAdd(list, &prim); + } + else{ + gl2psDivideQuad(prim, &t1, &t2); + gl2psListAdd(list, &t1); + gl2psListAdd(list, &t2); + gl2psFreePrimitive(&prim); + } + +} + +static void gl2psFreeBspTree(GL2PSbsptree **tree) +{ + if(*tree){ + if((*tree)->back) gl2psFreeBspTree(&(*tree)->back); + if((*tree)->primitives){ + gl2psListAction((*tree)->primitives, gl2psFreePrimitive); + gl2psListDelete((*tree)->primitives); + } + if((*tree)->front) gl2psFreeBspTree(&(*tree)->front); + gl2psFree(*tree); + *tree = NULL; + } +} + +static GLboolean gl2psGreater(GLfloat f1, GLfloat f2) +{ + if(f1 > f2) return GL_TRUE; + else return GL_FALSE; +} + +static GLboolean gl2psLess(GLfloat f1, GLfloat f2) +{ + if(f1 < f2) return GL_TRUE; + else return GL_FALSE; +} + +static void gl2psBuildBspTree(GL2PSbsptree *tree, GL2PSlist *primitives) +{ + GL2PSprimitive *prim, *frontprim = NULL, *backprim = NULL; + GL2PSlist *frontlist, *backlist; + GLint i, index; + + tree->front = NULL; + tree->back = NULL; + tree->primitives = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); + index = gl2psFindRoot(primitives, &prim); + gl2psGetPlane(prim, tree->plane); + gl2psAddPrimitiveInList(prim, tree->primitives); + + frontlist = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); + backlist = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); + + for(i = 0; i < gl2psListNbr(primitives); i++){ + if(i != index){ + prim = *(GL2PSprimitive**)gl2psListPointer(primitives,i); + switch(gl2psSplitPrimitive(prim, tree->plane, &frontprim, &backprim)){ + case GL2PS_COINCIDENT: + gl2psAddPrimitiveInList(prim, tree->primitives); + break; + case GL2PS_IN_BACK_OF: + gl2psAddPrimitiveInList(prim, backlist); + break; + case GL2PS_IN_FRONT_OF: + gl2psAddPrimitiveInList(prim, frontlist); + break; + case GL2PS_SPANNING: + gl2psAddPrimitiveInList(backprim, backlist); + gl2psAddPrimitiveInList(frontprim, frontlist); + gl2psFreePrimitive(&prim); + break; + } + } + } + + if(gl2psListNbr(tree->primitives)){ + gl2psListSort(tree->primitives, gl2psTrianglesFirst); + } + + if(gl2psListNbr(frontlist)){ + gl2psListSort(frontlist, gl2psTrianglesFirst); + tree->front = (GL2PSbsptree*)gl2psMalloc(sizeof(GL2PSbsptree)); + gl2psBuildBspTree(tree->front, frontlist); + } + else{ + gl2psListDelete(frontlist); + } + + if(gl2psListNbr(backlist)){ + gl2psListSort(backlist, gl2psTrianglesFirst); + tree->back = (GL2PSbsptree*)gl2psMalloc(sizeof(GL2PSbsptree)); + gl2psBuildBspTree(tree->back, backlist); + } + else{ + gl2psListDelete(backlist); + } + + gl2psListDelete(primitives); +} + +static void gl2psTraverseBspTree(GL2PSbsptree *tree, GL2PSxyz eye, GLfloat epsilon, + GLboolean (*compare)(GLfloat f1, GLfloat f2), + void (*action)(void *data), int inverse) +{ + GLfloat result; + + if(!tree) return; + + result = gl2psComparePointPlane(eye, tree->plane); + + if(GL_TRUE == compare(result, epsilon)){ + gl2psTraverseBspTree(tree->back, eye, epsilon, compare, action, inverse); + if(inverse){ + gl2psListActionInverse(tree->primitives, action); + } + else{ + gl2psListAction(tree->primitives, action); + } + gl2psTraverseBspTree(tree->front, eye, epsilon, compare, action, inverse); + } + else if(GL_TRUE == compare(-epsilon, result)){ + gl2psTraverseBspTree(tree->front, eye, epsilon, compare, action, inverse); + if(inverse){ + gl2psListActionInverse(tree->primitives, action); + } + else{ + gl2psListAction(tree->primitives, action); + } + gl2psTraverseBspTree(tree->back, eye, epsilon, compare, action, inverse); + } + else{ + gl2psTraverseBspTree(tree->front, eye, epsilon, compare, action, inverse); + gl2psTraverseBspTree(tree->back, eye, epsilon, compare, action, inverse); + } +} + +static void gl2psRescaleAndOffset() +{ + GL2PSprimitive *prim; + GLfloat minZ, maxZ, rangeZ, scaleZ; + GLfloat factor, units, area, dZ, dZdX, dZdY, maxdZ; + int i, j; + + if(!gl2psListNbr(gl2ps->primitives)) + return; + + /* get z-buffer range */ + prim = *(GL2PSprimitive**)gl2psListPointer(gl2ps->primitives, 0); + minZ = maxZ = prim->verts[0].xyz[2]; + for(i = 1; i < prim->numverts; i++){ + if(prim->verts[i].xyz[2] < minZ) minZ = prim->verts[i].xyz[2]; + if(prim->verts[i].xyz[2] > maxZ) maxZ = prim->verts[i].xyz[2]; + } + for(i = 1; i < gl2psListNbr(gl2ps->primitives); i++){ + prim = *(GL2PSprimitive**)gl2psListPointer(gl2ps->primitives, i); + for(j = 0; j < prim->numverts; j++){ + if(prim->verts[j].xyz[2] < minZ) minZ = prim->verts[j].xyz[2]; + if(prim->verts[j].xyz[2] > maxZ) maxZ = prim->verts[j].xyz[2]; + } + } + rangeZ = (maxZ - minZ); + + /* rescale z-buffer coordinate in [0,GL2PS_ZSCALE], to make it of + the same order of magnitude as the x and y coordinates */ + scaleZ = GL2PS_ZERO(rangeZ) ? GL2PS_ZSCALE : (GL2PS_ZSCALE / rangeZ); + /* avoid precision loss (we use floats!) */ + if(scaleZ > 100000.F) scaleZ = 100000.F; + + /* apply offsets */ + for(i = 0; i < gl2psListNbr(gl2ps->primitives); i++){ + prim = *(GL2PSprimitive**)gl2psListPointer(gl2ps->primitives, i); + for(j = 0; j < prim->numverts; j++){ + prim->verts[j].xyz[2] = (prim->verts[j].xyz[2] - minZ) * scaleZ; + } + if((gl2ps->options & GL2PS_SIMPLE_LINE_OFFSET) && + (prim->type == GL2PS_LINE)){ + if(gl2ps->sort == GL2PS_SIMPLE_SORT){ + prim->verts[0].xyz[2] -= GL2PS_ZOFFSET_LARGE; + prim->verts[1].xyz[2] -= GL2PS_ZOFFSET_LARGE; + } + else{ + prim->verts[0].xyz[2] -= GL2PS_ZOFFSET; + prim->verts[1].xyz[2] -= GL2PS_ZOFFSET; + } + } + else if(prim->offset && (prim->type == GL2PS_TRIANGLE)){ + factor = gl2ps->offset[0]; + units = gl2ps->offset[1]; + area = + (prim->verts[1].xyz[0] - prim->verts[0].xyz[0]) * + (prim->verts[2].xyz[1] - prim->verts[1].xyz[1]) - + (prim->verts[2].xyz[0] - prim->verts[1].xyz[0]) * + (prim->verts[1].xyz[1] - prim->verts[0].xyz[1]); + if(!GL2PS_ZERO(area)){ + dZdX = + ((prim->verts[2].xyz[1] - prim->verts[1].xyz[1]) * + (prim->verts[1].xyz[2] - prim->verts[0].xyz[2]) - + (prim->verts[1].xyz[1] - prim->verts[0].xyz[1]) * + (prim->verts[2].xyz[2] - prim->verts[1].xyz[2])) / area; + dZdY = + ((prim->verts[1].xyz[0] - prim->verts[0].xyz[0]) * + (prim->verts[2].xyz[2] - prim->verts[1].xyz[2]) - + (prim->verts[2].xyz[0] - prim->verts[1].xyz[0]) * + (prim->verts[1].xyz[2] - prim->verts[0].xyz[2])) / area; + maxdZ = (GLfloat)sqrt(dZdX * dZdX + dZdY * dZdY); + } + else{ + maxdZ = 0.0F; + } + dZ = factor * maxdZ + units; + prim->verts[0].xyz[2] += dZ; + prim->verts[1].xyz[2] += dZ; + prim->verts[2].xyz[2] += dZ; + } + } +} + +/********************************************************************* + * + * 2D sorting routines (for occlusion culling) + * + *********************************************************************/ + +static GLint gl2psGetPlaneFromPoints(GL2PSxyz a, GL2PSxyz b, GL2PSplane plane) +{ + GLfloat n; + + plane[0] = b[1] - a[1]; + plane[1] = a[0] - b[0]; + n = (GLfloat)sqrt(plane[0]*plane[0] + plane[1]*plane[1]); + plane[2] = 0.0F; + if(!GL2PS_ZERO(n)){ + plane[0] /= n; + plane[1] /= n; + plane[3] = -plane[0]*a[0]-plane[1]*a[1]; + return 1; + } + else{ + plane[0] = -1.0F; + plane[1] = 0.0F; + plane[3] = a[0]; + return 0; + } +} + +static void gl2psFreeBspImageTree(GL2PSbsptree2d **tree) +{ + if(*tree){ + if((*tree)->back) gl2psFreeBspImageTree(&(*tree)->back); + if((*tree)->front) gl2psFreeBspImageTree(&(*tree)->front); + gl2psFree(*tree); + *tree = NULL; + } +} + +static GLint gl2psCheckPoint(GL2PSxyz point, GL2PSplane plane) +{ + GLfloat pt_dis; + + pt_dis = gl2psComparePointPlane(point, plane); + if(pt_dis > GL2PS_EPSILON) return GL2PS_POINT_INFRONT; + else if(pt_dis < -GL2PS_EPSILON) return GL2PS_POINT_BACK; + else return GL2PS_POINT_COINCIDENT; +} + +static void gl2psAddPlanesInBspTreeImage(GL2PSprimitive *prim, + GL2PSbsptree2d **tree) +{ + GLint ret = 0; + GLint i; + GLint offset = 0; + GL2PSbsptree2d *head = NULL, *cur = NULL; + + if((*tree == NULL) && (prim->numverts > 2)){ + /* don't cull if transparent + for(i = 0; i < prim->numverts - 1; i++) + if(prim->verts[i].rgba[3] < 1.0F) return; + */ + head = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d)); + for(i = 0; i < prim->numverts-1; i++){ + if(!gl2psGetPlaneFromPoints(prim->verts[i].xyz, + prim->verts[i+1].xyz, + head->plane)){ + if(prim->numverts-i > 3){ + offset++; + } + else{ + gl2psFree(head); + return; + } + } + else{ + break; + } + } + head->back = NULL; + head->front = NULL; + for(i = 2+offset; i < prim->numverts; i++){ + ret = gl2psCheckPoint(prim->verts[i].xyz, head->plane); + if(ret != GL2PS_POINT_COINCIDENT) break; + } + switch(ret){ + case GL2PS_POINT_INFRONT : + cur = head; + for(i = 1+offset; i < prim->numverts-1; i++){ + if(cur->front == NULL){ + cur->front = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d)); + } + if(gl2psGetPlaneFromPoints(prim->verts[i].xyz, + prim->verts[i+1].xyz, + cur->front->plane)){ + cur = cur->front; + cur->front = NULL; + cur->back = NULL; + } + } + if(cur->front == NULL){ + cur->front = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d)); + } + if(gl2psGetPlaneFromPoints(prim->verts[i].xyz, + prim->verts[offset].xyz, + cur->front->plane)){ + cur->front->front = NULL; + cur->front->back = NULL; + } + else{ + gl2psFree(cur->front); + cur->front = NULL; + } + break; + case GL2PS_POINT_BACK : + for(i = 0; i < 4; i++){ + head->plane[i] = -head->plane[i]; + } + cur = head; + for(i = 1+offset; i < prim->numverts-1; i++){ + if(cur->front == NULL){ + cur->front = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d)); + } + if(gl2psGetPlaneFromPoints(prim->verts[i+1].xyz, + prim->verts[i].xyz, + cur->front->plane)){ + cur = cur->front; + cur->front = NULL; + cur->back = NULL; + } + } + if(cur->front == NULL){ + cur->front = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d)); + } + if(gl2psGetPlaneFromPoints(prim->verts[offset].xyz, + prim->verts[i].xyz, + cur->front->plane)){ + cur->front->front = NULL; + cur->front->back = NULL; + } + else{ + gl2psFree(cur->front); + cur->front = NULL; + } + break; + default: + gl2psFree(head); + return; + } + (*tree) = head; + } +} + +static GLint gl2psCheckPrimitive(GL2PSprimitive *prim, GL2PSplane plane) +{ + GLint i; + GLint pos; + + pos = gl2psCheckPoint(prim->verts[0].xyz, plane); + for(i = 1; i < prim->numverts; i++){ + pos |= gl2psCheckPoint(prim->verts[i].xyz, plane); + if(pos == (GL2PS_POINT_INFRONT | GL2PS_POINT_BACK)) return GL2PS_SPANNING; + } + if(pos & GL2PS_POINT_INFRONT) return GL2PS_IN_FRONT_OF; + else if(pos & GL2PS_POINT_BACK) return GL2PS_IN_BACK_OF; + else return GL2PS_COINCIDENT; +} + +static GL2PSprimitive *gl2psCreateSplitPrimitive2D(GL2PSprimitive *parent, + GLshort numverts, + GL2PSvertex *vertx) +{ + GLint i; + GL2PSprimitive *child = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); + + if(parent->type == GL2PS_IMAGEMAP){ + child->type = GL2PS_IMAGEMAP; + child->data.image = parent->data.image; + } + else { + switch(numverts){ + case 1 : child->type = GL2PS_POINT; break; + case 2 : child->type = GL2PS_LINE; break; + case 3 : child->type = GL2PS_TRIANGLE; break; + case 4 : child->type = GL2PS_QUADRANGLE; break; + default: child->type = GL2PS_NO_TYPE; break; /* FIXME */ + } + } + child->boundary = 0; /* FIXME: not done! */ + child->culled = parent->culled; + child->offset = parent->offset; + child->pattern = parent->pattern; + child->factor = parent->factor; + child->width = parent->width; + child->numverts = numverts; + child->verts = (GL2PSvertex*)gl2psMalloc(numverts * sizeof(GL2PSvertex)); + for(i = 0; i < numverts; i++){ + child->verts[i] = vertx[i]; + } + return child; +} + +static void gl2psSplitPrimitive2D(GL2PSprimitive *prim, + GL2PSplane plane, + GL2PSprimitive **front, + GL2PSprimitive **back) +{ + /* cur will hold the position of the current vertex + prev will hold the position of the previous vertex + prev0 will hold the position of the vertex number 0 + v1 and v2 represent the current and previous vertices, respectively + flag is set if the current vertex should be checked against the plane */ + GLint cur = -1, prev = -1, i, v1 = 0, v2 = 0, flag = 1, prev0 = -1; + + /* list of vertices that will go in front and back primitive */ + GL2PSvertex *front_list = NULL, *back_list = NULL; + + /* number of vertices in front and back list */ + GLshort front_count = 0, back_count = 0; + + for(i = 0; i <= prim->numverts; i++){ + v1 = i; + if(v1 == prim->numverts){ + if(prim->numverts < 3) break; + v1 = 0; + v2 = prim->numverts - 1; + cur = prev0; + } + else if(flag){ + cur = gl2psCheckPoint(prim->verts[v1].xyz, plane); + if(i == 0){ + prev0 = cur; + } + } + if(((prev == -1) || (prev == cur) || (prev == 0) || (cur == 0)) && + (i < prim->numverts)){ + if(cur == GL2PS_POINT_INFRONT){ + front_count++; + front_list = (GL2PSvertex*)gl2psRealloc(front_list, + sizeof(GL2PSvertex)*front_count); + front_list[front_count-1] = prim->verts[v1]; + } + else if(cur == GL2PS_POINT_BACK){ + back_count++; + back_list = (GL2PSvertex*)gl2psRealloc(back_list, + sizeof(GL2PSvertex)*back_count); + back_list[back_count-1] = prim->verts[v1]; + } + else{ + front_count++; + front_list = (GL2PSvertex*)gl2psRealloc(front_list, + sizeof(GL2PSvertex)*front_count); + front_list[front_count-1] = prim->verts[v1]; + back_count++; + back_list = (GL2PSvertex*)gl2psRealloc(back_list, + sizeof(GL2PSvertex)*back_count); + back_list[back_count-1] = prim->verts[v1]; + } + flag = 1; + } + else if((prev != cur) && (cur != 0) && (prev != 0)){ + if(v1 != 0){ + v2 = v1-1; + i--; + } + front_count++; + front_list = (GL2PSvertex*)gl2psRealloc(front_list, + sizeof(GL2PSvertex)*front_count); + gl2psCutEdge(&prim->verts[v2], &prim->verts[v1], + plane, &front_list[front_count-1]); + back_count++; + back_list = (GL2PSvertex*)gl2psRealloc(back_list, + sizeof(GL2PSvertex)*back_count); + back_list[back_count-1] = front_list[front_count-1]; + flag = 0; + } + prev = cur; + } + *front = gl2psCreateSplitPrimitive2D(prim, front_count, front_list); + *back = gl2psCreateSplitPrimitive2D(prim, back_count, back_list); + gl2psFree(front_list); + gl2psFree(back_list); +} + +static GLint gl2psAddInBspImageTree(GL2PSprimitive *prim, GL2PSbsptree2d **tree) +{ + GLint ret = 0; + GL2PSprimitive *frontprim = NULL, *backprim = NULL; + + /* FIXME: until we consider the actual extent of text strings and + pixmaps, never cull them. Otherwise the whole string/pixmap gets + culled as soon as the reference point is hidden */ + if(prim->type == GL2PS_PIXMAP || + prim->type == GL2PS_TEXT || + prim->type == GL2PS_SPECIAL){ + return 1; + } + + if(*tree == NULL){ + if((prim->type != GL2PS_IMAGEMAP) && (GL_FALSE == gl2ps->zerosurfacearea)){ + gl2psAddPlanesInBspTreeImage(gl2ps->primitivetoadd, tree); + } + return 1; + } + else{ + switch(gl2psCheckPrimitive(prim, (*tree)->plane)){ + case GL2PS_IN_BACK_OF: return gl2psAddInBspImageTree(prim, &(*tree)->back); + case GL2PS_IN_FRONT_OF: + if((*tree)->front != NULL) return gl2psAddInBspImageTree(prim, &(*tree)->front); + else return 0; + case GL2PS_SPANNING: + gl2psSplitPrimitive2D(prim, (*tree)->plane, &frontprim, &backprim); + ret = gl2psAddInBspImageTree(backprim, &(*tree)->back); + if((*tree)->front != NULL){ + if(gl2psAddInBspImageTree(frontprim, &(*tree)->front)){ + ret = 1; + } + } + gl2psFree(frontprim->verts); + gl2psFree(frontprim); + gl2psFree(backprim->verts); + gl2psFree(backprim); + return ret; + case GL2PS_COINCIDENT: + if((*tree)->back != NULL){ + gl2ps->zerosurfacearea = GL_TRUE; + ret = gl2psAddInBspImageTree(prim, &(*tree)->back); + gl2ps->zerosurfacearea = GL_FALSE; + if(ret) return ret; + } + if((*tree)->front != NULL){ + gl2ps->zerosurfacearea = GL_TRUE; + ret = gl2psAddInBspImageTree(prim, &(*tree)->front); + gl2ps->zerosurfacearea = GL_FALSE; + if(ret) return ret; + } + if(prim->type == GL2PS_LINE) return 1; + else return 0; + } + } + return 0; +} + +static void gl2psAddInImageTree(void *data) +{ + GL2PSprimitive *prim = *(GL2PSprimitive **)data; + gl2ps->primitivetoadd = prim; + if(prim->type == GL2PS_IMAGEMAP && prim->data.image->format == GL2PS_IMAGEMAP_VISIBLE){ + prim->culled = 1; + } + else if(!gl2psAddInBspImageTree(prim, &gl2ps->imagetree)){ + prim->culled = 1; + } + else if(prim->type == GL2PS_IMAGEMAP){ + prim->data.image->format = GL2PS_IMAGEMAP_VISIBLE; + } +} + +/* Boundary construction */ + +static void gl2psAddBoundaryInList(GL2PSprimitive *prim, GL2PSlist *list) +{ + GL2PSprimitive *b; + GLshort i; + GL2PSxyz c; + + c[0] = c[1] = c[2] = 0.0F; + for(i = 0; i < prim->numverts; i++){ + c[0] += prim->verts[i].xyz[0]; + c[1] += prim->verts[i].xyz[1]; + } + c[0] /= prim->numverts; + c[1] /= prim->numverts; + + for(i = 0; i < prim->numverts; i++){ + if(prim->boundary & (GLint)pow(2., i)){ + b = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); + b->type = GL2PS_LINE; + b->offset = prim->offset; + b->pattern = prim->pattern; + b->factor = prim->factor; + b->culled = prim->culled; + b->width = prim->width; + b->boundary = 0; + b->numverts = 2; + b->verts = (GL2PSvertex*)gl2psMalloc(2 * sizeof(GL2PSvertex)); + +#if 0 /* FIXME: need to work on boundary offset... */ + v[0] = c[0] - prim->verts[i].xyz[0]; + v[1] = c[1] - prim->verts[i].xyz[1]; + v[2] = 0.0F; + norm = gl2psNorm(v); + v[0] /= norm; + v[1] /= norm; + b->verts[0].xyz[0] = prim->verts[i].xyz[0] +0.1*v[0]; + b->verts[0].xyz[1] = prim->verts[i].xyz[1] +0.1*v[1]; + b->verts[0].xyz[2] = prim->verts[i].xyz[2]; + v[0] = c[0] - prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[0]; + v[1] = c[1] - prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[1]; + norm = gl2psNorm(v); + v[0] /= norm; + v[1] /= norm; + b->verts[1].xyz[0] = prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[0] +0.1*v[0]; + b->verts[1].xyz[1] = prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[1] +0.1*v[1]; + b->verts[1].xyz[2] = prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[2]; +#else + b->verts[0].xyz[0] = prim->verts[i].xyz[0]; + b->verts[0].xyz[1] = prim->verts[i].xyz[1]; + b->verts[0].xyz[2] = prim->verts[i].xyz[2]; + b->verts[1].xyz[0] = prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[0]; + b->verts[1].xyz[1] = prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[1]; + b->verts[1].xyz[2] = prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[2]; +#endif + + b->verts[0].rgba[0] = 0.0F; + b->verts[0].rgba[1] = 0.0F; + b->verts[0].rgba[2] = 0.0F; + b->verts[0].rgba[3] = 0.0F; + b->verts[1].rgba[0] = 0.0F; + b->verts[1].rgba[1] = 0.0F; + b->verts[1].rgba[2] = 0.0F; + b->verts[1].rgba[3] = 0.0F; + gl2psListAdd(list, &b); + } + } + +} + +static void gl2psBuildPolygonBoundary(GL2PSbsptree *tree) +{ + GLint i; + GL2PSprimitive *prim; + + if(!tree) return; + gl2psBuildPolygonBoundary(tree->back); + for(i = 0; i < gl2psListNbr(tree->primitives); i++){ + prim = *(GL2PSprimitive**)gl2psListPointer(tree->primitives, i); + if(prim->boundary) gl2psAddBoundaryInList(prim, tree->primitives); + } + gl2psBuildPolygonBoundary(tree->front); +} + +/********************************************************************* + * + * Feedback buffer parser + * + *********************************************************************/ + +static void gl2psAddPolyPrimitive(GLshort type, GLshort numverts, + GL2PSvertex *verts, GLint offset, + GLushort pattern, GLint factor, + GLfloat width, char boundary) +{ + GL2PSprimitive *prim; + + prim = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); + prim->type = type; + prim->numverts = numverts; + prim->verts = (GL2PSvertex*)gl2psMalloc(numverts * sizeof(GL2PSvertex)); + memcpy(prim->verts, verts, numverts * sizeof(GL2PSvertex)); + prim->boundary = boundary; + prim->offset = offset; + prim->pattern = pattern; + prim->factor = factor; + prim->width = width; + prim->culled = 0; + + /* FIXME: here we should have an option to split stretched + tris/quads to enhance SIMPLE_SORT */ + + gl2psListAdd(gl2ps->primitives, &prim); +} + +static GLint gl2psGetVertex(GL2PSvertex *v, GLfloat *p) +{ + GLint i; + + v->xyz[0] = p[0]; + v->xyz[1] = p[1]; + v->xyz[2] = p[2]; + + if(gl2ps->colormode == GL_COLOR_INDEX && gl2ps->colorsize > 0){ + i = (GLint)(p[3] + 0.5); + v->rgba[0] = gl2ps->colormap[i][0]; + v->rgba[1] = gl2ps->colormap[i][1]; + v->rgba[2] = gl2ps->colormap[i][2]; + v->rgba[3] = gl2ps->colormap[i][3]; + return 4; + } + else{ + v->rgba[0] = p[3]; + v->rgba[1] = p[4]; + v->rgba[2] = p[5]; + v->rgba[3] = p[6]; + return 7; + } +} + +static void gl2psParseFeedbackBuffer(GLint used) +{ + char flag; + GLushort pattern = 0; + GLboolean boundary; + GLint i, sizeoffloat, count, v, vtot, offset = 0, factor = 0, auxindex = 0; + GLfloat lwidth = 1.0F, psize = 1.0F; + GLfloat *current; + GL2PSvertex vertices[3]; + GL2PSprimitive *prim; + GL2PSimagemap *node; + + current = gl2ps->feedback; + boundary = gl2ps->boundary = GL_FALSE; + + while(used > 0){ + + if(GL_TRUE == boundary) gl2ps->boundary = GL_TRUE; + + switch((GLint)*current){ + case GL_POINT_TOKEN : + current ++; + used --; + i = gl2psGetVertex(&vertices[0], current); + current += i; + used -= i; + gl2psAddPolyPrimitive(GL2PS_POINT, 1, vertices, 0, + pattern, factor, psize, 0); + break; + case GL_LINE_TOKEN : + case GL_LINE_RESET_TOKEN : + current ++; + used --; + i = gl2psGetVertex(&vertices[0], current); + current += i; + used -= i; + i = gl2psGetVertex(&vertices[1], current); + current += i; + used -= i; + gl2psAddPolyPrimitive(GL2PS_LINE, 2, vertices, 0, + pattern, factor, lwidth, 0); + break; + case GL_POLYGON_TOKEN : + count = (GLint)current[1]; + current += 2; + used -= 2; + v = vtot = 0; + while(count > 0 && used > 0){ + i = gl2psGetVertex(&vertices[v], current); + gl2psAdaptVertexForBlending(&vertices[v]); + current += i; + used -= i; + count --; + vtot++; + if(v == 2){ + if(GL_TRUE == boundary){ + if(!count && vtot == 2) flag = 1|2|4; + else if(!count) flag = 2|4; + else if(vtot == 2) flag = 1|2; + else flag = 2; + } + else + flag = 0; + gl2psAddPolyPrimitive(GL2PS_TRIANGLE, 3, vertices, offset, + pattern, factor, 1, flag); + vertices[1] = vertices[2]; + } + else + v ++; + } + break; + case GL_BITMAP_TOKEN : + case GL_DRAW_PIXEL_TOKEN : + case GL_COPY_PIXEL_TOKEN : + current ++; + used --; + i = gl2psGetVertex(&vertices[0], current); + current += i; + used -= i; + break; + case GL_PASS_THROUGH_TOKEN : + switch((GLint)current[1]){ + case GL2PS_BEGIN_OFFSET_TOKEN : offset = 1; break; + case GL2PS_END_OFFSET_TOKEN : offset = 0; break; + case GL2PS_BEGIN_BOUNDARY_TOKEN : boundary = GL_TRUE; break; + case GL2PS_END_BOUNDARY_TOKEN : boundary = GL_FALSE; break; + case GL2PS_END_STIPPLE_TOKEN : pattern = factor = 0; break; + case GL2PS_BEGIN_BLEND_TOKEN : gl2ps->blending = GL_TRUE; break; + case GL2PS_END_BLEND_TOKEN : gl2ps->blending = GL_FALSE; break; + case GL2PS_BEGIN_STIPPLE_TOKEN : + current += 2; + used -= 2; + pattern = (GLushort)current[1]; + current += 2; + used -= 2; + factor = (GLint)current[1]; + break; + case GL2PS_SRC_BLEND_TOKEN : + current += 2; + used -= 2; + gl2ps->blendfunc[0] = (GLint)current[1]; + break; + case GL2PS_DST_BLEND_TOKEN : + current += 2; + used -= 2; + gl2ps->blendfunc[1] = (GLint)current[1]; + break; + case GL2PS_POINT_SIZE_TOKEN : + current += 2; + used -= 2; + psize = current[1]; + break; + case GL2PS_LINE_WIDTH_TOKEN : + current += 2; + used -= 2; + lwidth = current[1]; + break; + case GL2PS_IMAGEMAP_TOKEN : + prim = (GL2PSprimitive *)gl2psMalloc(sizeof(GL2PSprimitive)); + prim->type = GL2PS_IMAGEMAP; + prim->boundary = 0; + prim->numverts = 4; + prim->verts = (GL2PSvertex *)gl2psMalloc(4 * sizeof(GL2PSvertex)); + prim->culled = 0; + prim->offset = 0; + prim->pattern = 0; + prim->factor = 0; + prim->width = 1; + + node = (GL2PSimagemap*)gl2psMalloc(sizeof(GL2PSimagemap)); + node->image = (GL2PSimage*)gl2psMalloc(sizeof(GL2PSimage)); + node->image->type = 0; + node->image->format = 0; + node->next = NULL; + + if(gl2ps->imagemap_head == NULL) + gl2ps->imagemap_head = node; + else + gl2ps->imagemap_tail->next = node; + gl2ps->imagemap_tail = node; + prim->data.image = node->image; + + current += 2; used -= 2; + i = gl2psGetVertex(&prim->verts[0], ¤t[1]); + current += i; used -= i; + + node->image->width = (GLint)current[2]; + current += 2; used -= 2; + node->image->height = (GLint)current[2]; + prim->verts[0].xyz[0] = prim->verts[0].xyz[0] - (int)(node->image->width / 2) + 0.5F; + prim->verts[0].xyz[1] = prim->verts[0].xyz[1] - (int)(node->image->height / 2) + 0.5F; + for(i = 1; i < 4; i++){ + for(v = 0; v < 3; v++){ + prim->verts[i].xyz[v] = prim->verts[0].xyz[v]; + prim->verts[i].rgba[v] = prim->verts[0].rgba[v]; + } + prim->verts[i].rgba[v] = prim->verts[0].rgba[v]; + } + prim->verts[1].xyz[0] = prim->verts[1].xyz[0] + node->image->width; + prim->verts[2].xyz[0] = prim->verts[1].xyz[0]; + prim->verts[2].xyz[1] = prim->verts[2].xyz[1] + node->image->height; + prim->verts[3].xyz[1] = prim->verts[2].xyz[1]; + + sizeoffloat = sizeof(GLfloat); + v = 2 * sizeoffloat; + vtot = node->image->height + node->image->height * + ((node->image->width - 1) / 8); + node->image->pixels = (GLfloat*)gl2psMalloc(v + vtot); + node->image->pixels[0] = prim->verts[0].xyz[0]; + node->image->pixels[1] = prim->verts[0].xyz[1]; + + for(i = 0; i < vtot; i += sizeoffloat){ + current += 2; used -= 2; + if((vtot - i) >= 4) + memcpy(&(((char*)(node->image->pixels))[i + v]), &(current[2]), sizeoffloat); + else + memcpy(&(((char*)(node->image->pixels))[i + v]), &(current[2]), vtot - i); + } + current++; used--; + gl2psListAdd(gl2ps->primitives, &prim); + break; + case GL2PS_DRAW_PIXELS_TOKEN : + case GL2PS_TEXT_TOKEN : + if(auxindex < gl2psListNbr(gl2ps->auxprimitives)) + gl2psListAdd(gl2ps->primitives, + gl2psListPointer(gl2ps->auxprimitives, auxindex++)); + else + gl2psMsg(GL2PS_ERROR, "Wrong number of auxiliary tokens in buffer"); + break; + } + current += 2; + used -= 2; + break; + default : + gl2psMsg(GL2PS_WARNING, "Unknown token in buffer"); + current ++; + used --; + break; + } + } + + gl2psListReset(gl2ps->auxprimitives); +} + +/********************************************************************* + * + * PostScript routines + * + *********************************************************************/ + +static void gl2psWriteByte(unsigned char byte) +{ + unsigned char h = byte / 16; + unsigned char l = byte % 16; + gl2psPrintf("%x%x", h, l); +} + +static void gl2psPrintPostScriptPixmap(GLfloat x, GLfloat y, GL2PSimage *im) +{ + GLuint nbhex, nbyte, nrgb, nbits; + GLuint row, col, ibyte, icase; + GLfloat dr, dg, db, fgrey; + unsigned char red = 0, green = 0, blue = 0, b, grey; + GLuint width = (GLuint)im->width; + GLuint height = (GLuint)im->height; + + /* FIXME: should we define an option for these? Or just keep the + 8-bit per component case? */ + int greyscale = 0; /* set to 1 to output greyscale image */ + int nbit = 8; /* number of bits per color compoment (2, 4 or 8) */ + + if((width <= 0) || (height <= 0)) return; + + gl2psPrintf("gsave\n"); + gl2psPrintf("%.2f %.2f translate\n", x, y); + gl2psPrintf("%d %d scale\n", width, height); + + if(greyscale){ /* greyscale */ + gl2psPrintf("/picstr %d string def\n", width); + gl2psPrintf("%d %d %d\n", width, height, 8); + gl2psPrintf("[ %d 0 0 -%d 0 %d ]\n", width, height, height); + gl2psPrintf("{ currentfile picstr readhexstring pop }\n"); + gl2psPrintf("image\n"); + for(row = 0; row < height; row++){ + for(col = 0; col < width; col++){ + gl2psGetRGB(im, col, row, &dr, &dg, &db); + fgrey = (0.30F * dr + 0.59F * dg + 0.11F * db); + grey = (unsigned char)(255. * fgrey); + gl2psWriteByte(grey); + } + gl2psPrintf("\n"); + } + nbhex = width * height * 2; + gl2psPrintf("%%%% nbhex digit :%d\n", nbhex); + } + else if(nbit == 2){ /* color, 2 bits for r and g and b; rgbs following each other */ + nrgb = width * 3; + nbits = nrgb * nbit; + nbyte = nbits / 8; + if((nbyte * 8) != nbits) nbyte++; + gl2psPrintf("/rgbstr %d string def\n", nbyte); + gl2psPrintf("%d %d %d\n", width, height, nbit); + gl2psPrintf("[ %d 0 0 -%d 0 %d ]\n", width, height, height); + gl2psPrintf("{ currentfile rgbstr readhexstring pop }\n"); + gl2psPrintf("false 3\n"); + gl2psPrintf("colorimage\n"); + for(row = 0; row < height; row++){ + icase = 1; + col = 0; + b = 0; + for(ibyte = 0; ibyte < nbyte; ibyte++){ + if(icase == 1) { + if(col < width) { + gl2psGetRGB(im, col, row, &dr, &dg, &db); + } + else { + dr = dg = db = 0; + } + col++; + red = (unsigned char)(3. * dr); + green = (unsigned char)(3. * dg); + blue = (unsigned char)(3. * db); + b = red; + b = (b<<2) + green; + b = (b<<2) + blue; + if(col < width) { + gl2psGetRGB(im, col, row, &dr, &dg, &db); + } + else { + dr = dg = db = 0; + } + col++; + red = (unsigned char)(3. * dr); + green = (unsigned char)(3. * dg); + blue = (unsigned char)(3. * db); + b = (b<<2) + red; + gl2psWriteByte(b); + b = 0; + icase++; + } + else if(icase == 2) { + b = green; + b = (b<<2) + blue; + if(col < width) { + gl2psGetRGB(im, col, row, &dr, &dg, &db); + } + else { + dr = dg = db = 0; + } + col++; + red = (unsigned char)(3. * dr); + green = (unsigned char)(3. * dg); + blue = (unsigned char)(3. * db); + b = (b<<2) + red; + b = (b<<2) + green; + gl2psWriteByte(b); + b = 0; + icase++; + } + else if(icase == 3) { + b = blue; + if(col < width) { + gl2psGetRGB(im, col, row, &dr, &dg, &db); + } + else { + dr = dg = db = 0; + } + col++; + red = (unsigned char)(3. * dr); + green = (unsigned char)(3. * dg); + blue = (unsigned char)(3. * db); + b = (b<<2) + red; + b = (b<<2) + green; + b = (b<<2) + blue; + gl2psWriteByte(b); + b = 0; + icase = 1; + } + } + gl2psPrintf("\n"); + } + } + else if(nbit == 4){ /* color, 4 bits for r and g and b; rgbs following each other */ + nrgb = width * 3; + nbits = nrgb * nbit; + nbyte = nbits / 8; + if((nbyte * 8) != nbits) nbyte++; + gl2psPrintf("/rgbstr %d string def\n", nbyte); + gl2psPrintf("%d %d %d\n", width, height, nbit); + gl2psPrintf("[ %d 0 0 -%d 0 %d ]\n", width, height, height); + gl2psPrintf("{ currentfile rgbstr readhexstring pop }\n"); + gl2psPrintf("false 3\n"); + gl2psPrintf("colorimage\n"); + for(row = 0; row < height; row++){ + col = 0; + icase = 1; + for(ibyte = 0; ibyte < nbyte; ibyte++){ + if(icase == 1) { + if(col < width) { + gl2psGetRGB(im, col, row, &dr, &dg, &db); + } + else { + dr = dg = db = 0; + } + col++; + red = (unsigned char)(15. * dr); + green = (unsigned char)(15. * dg); + gl2psPrintf("%x%x", red, green); + icase++; + } + else if(icase == 2) { + blue = (unsigned char)(15. * db); + if(col < width) { + gl2psGetRGB(im, col, row, &dr, &dg, &db); + } + else { + dr = dg = db = 0; + } + col++; + red = (unsigned char)(15. * dr); + gl2psPrintf("%x%x", blue, red); + icase++; + } + else if(icase == 3) { + green = (unsigned char)(15. * dg); + blue = (unsigned char)(15. * db); + gl2psPrintf("%x%x", green, blue); + icase = 1; + } + } + gl2psPrintf("\n"); + } + } + else{ /* 8 bit for r and g and b */ + nbyte = width * 3; + gl2psPrintf("/rgbstr %d string def\n", nbyte); + gl2psPrintf("%d %d %d\n", width, height, 8); + gl2psPrintf("[ %d 0 0 -%d 0 %d ]\n", width, height, height); + gl2psPrintf("{ currentfile rgbstr readhexstring pop }\n"); + gl2psPrintf("false 3\n"); + gl2psPrintf("colorimage\n"); + for(row = 0; row < height; row++){ + for(col = 0; col < width; col++){ + gl2psGetRGB(im, col, row, &dr, &dg, &db); + red = (unsigned char)(255. * dr); + gl2psWriteByte(red); + green = (unsigned char)(255. * dg); + gl2psWriteByte(green); + blue = (unsigned char)(255. * db); + gl2psWriteByte(blue); + } + gl2psPrintf("\n"); + } + } + + gl2psPrintf("grestore\n"); +} + +static void gl2psPrintPostScriptImagemap(GLfloat x, GLfloat y, + GLsizei width, GLsizei height, + const unsigned char *imagemap){ + int i, size; + + if((width <= 0) || (height <= 0)) return; + + size = height + height * (width - 1) / 8; + + gl2psPrintf("gsave\n"); + gl2psPrintf("%.2f %.2f translate\n", x, y); + gl2psPrintf("%d %d scale\n%d %d\ntrue\n", width, height,width, height); + gl2psPrintf("[ %d 0 0 -%d 0 %d ] {<", width, height); + for(i = 0; i < size; i++){ + gl2psWriteByte(*imagemap); + imagemap++; + } + gl2psPrintf(">} imagemask\ngrestore\n"); +} + +static void gl2psPrintPostScriptHeader(void) +{ + time_t now; + + /* Since compression is not part of the PostScript standard, + compressed PostScript files are just gzipped PostScript files + ("ps.gz" or "eps.gz") */ + gl2psPrintGzipHeader(); + + time(&now); + + if(gl2ps->format == GL2PS_PS){ + gl2psPrintf("%%!PS-Adobe-3.0\n"); + } + else{ + gl2psPrintf("%%!PS-Adobe-3.0 EPSF-3.0\n"); + } + + gl2psPrintf("%%%%Title: %s\n" + "%%%%Creator: GL2PS %d.%d.%d%s, %s\n" + "%%%%For: %s\n" + "%%%%CreationDate: %s" + "%%%%LanguageLevel: 3\n" + "%%%%DocumentData: Clean7Bit\n" + "%%%%Pages: 1\n", + gl2ps->title, GL2PS_MAJOR_VERSION, GL2PS_MINOR_VERSION, + GL2PS_PATCH_VERSION, GL2PS_EXTRA_VERSION, GL2PS_COPYRIGHT, + gl2ps->producer, ctime(&now)); + + if(gl2ps->format == GL2PS_PS){ + gl2psPrintf("%%%%Orientation: %s\n" + "%%%%DocumentMedia: Default %d %d 0 () ()\n", + (gl2ps->options & GL2PS_LANDSCAPE) ? "Landscape" : "Portrait", + (gl2ps->options & GL2PS_LANDSCAPE) ? (int)gl2ps->viewport[3] : + (int)gl2ps->viewport[2], + (gl2ps->options & GL2PS_LANDSCAPE) ? (int)gl2ps->viewport[2] : + (int)gl2ps->viewport[3]); + } + + gl2psPrintf("%%%%BoundingBox: %d %d %d %d\n" + "%%%%EndComments\n", + (gl2ps->options & GL2PS_LANDSCAPE) ? (int)gl2ps->viewport[1] : + (int)gl2ps->viewport[0], + (gl2ps->options & GL2PS_LANDSCAPE) ? (int)gl2ps->viewport[0] : + (int)gl2ps->viewport[1], + (gl2ps->options & GL2PS_LANDSCAPE) ? (int)gl2ps->viewport[3] : + (int)gl2ps->viewport[2], + (gl2ps->options & GL2PS_LANDSCAPE) ? (int)gl2ps->viewport[2] : + (int)gl2ps->viewport[3]); + + /* RGB color: r g b C (replace C by G in output to change from rgb to gray) + Grayscale: r g b G + Font choose: size fontname FC + Text string: (string) x y size fontname S?? + Rotated text string: (string) angle x y size fontname S??R + Point primitive: x y size P + Line width: width W + Line start: x y LS + Line joining last point: x y L + Line end: x y LE + Flat-shaded triangle: x3 y3 x2 y2 x1 y1 T + Smooth-shaded triangle: x3 y3 r3 g3 b3 x2 y2 r2 g2 b2 x1 y1 r1 g1 b1 ST */ + + gl2psPrintf("%%%%BeginProlog\n" + "/gl2psdict 64 dict def gl2psdict begin\n" + "0 setlinecap 0 setlinejoin\n" + "/tryPS3shading %s def %% set to false to force subdivision\n" + "/rThreshold %g def %% red component subdivision threshold\n" + "/gThreshold %g def %% green component subdivision threshold\n" + "/bThreshold %g def %% blue component subdivision threshold\n", + (gl2ps->options & GL2PS_NO_PS3_SHADING) ? "false" : "true", + gl2ps->threshold[0], gl2ps->threshold[1], gl2ps->threshold[2]); + + gl2psPrintf("/BD { bind def } bind def\n" + "/C { setrgbcolor } BD\n" + "/G { 0.082 mul exch 0.6094 mul add exch 0.3086 mul add neg 1.0 add setgray } BD\n" + "/W { setlinewidth } BD\n"); + + gl2psPrintf("/FC { findfont exch /SH exch def SH scalefont setfont } BD\n" + "/SW { dup stringwidth pop } BD\n" + "/S { FC moveto show } BD\n" + "/SBC{ FC moveto SW -2 div 0 rmoveto show } BD\n" + "/SBR{ FC moveto SW neg 0 rmoveto show } BD\n" + "/SCL{ FC moveto 0 SH -2 div rmoveto show } BD\n" + "/SCC{ FC moveto SW -2 div SH -2 div rmoveto show } BD\n" + "/SCR{ FC moveto SW neg SH -2 div rmoveto show } BD\n" + "/STL{ FC moveto 0 SH neg rmoveto show } BD\n" + "/STC{ FC moveto SW -2 div SH neg rmoveto show } BD\n" + "/STR{ FC moveto SW neg SH neg rmoveto show } BD\n"); + + /* rotated text routines: same nameanem with R appended */ + + gl2psPrintf("/FCT { FC translate 0 0 } BD\n" + "/SR { gsave FCT moveto rotate show grestore } BD\n" + "/SBCR{ gsave FCT moveto rotate SW -2 div 0 rmoveto show grestore } BD\n" + "/SBRR{ gsave FCT moveto rotate SW neg 0 rmoveto show grestore } BD\n" + "/SCLR{ gsave FCT moveto rotate 0 SH -2 div rmoveto show grestore} BD\n"); + gl2psPrintf("/SCCR{ gsave FCT moveto rotate SW -2 div SH -2 div rmoveto show grestore} BD\n" + "/SCRR{ gsave FCT moveto rotate SW neg SH -2 div rmoveto show grestore} BD\n" + "/STLR{ gsave FCT moveto rotate 0 SH neg rmoveto show grestore } BD\n" + "/STCR{ gsave FCT moveto rotate SW -2 div SH neg rmoveto show grestore } BD\n" + "/STRR{ gsave FCT moveto rotate SW neg SH neg rmoveto show grestore } BD\n"); + + gl2psPrintf("/P { newpath 0.0 360.0 arc closepath fill } BD\n" + "/LS { newpath moveto } BD\n" + "/L { lineto } BD\n" + "/LE { lineto stroke } BD\n" + "/T { newpath moveto lineto lineto closepath fill } BD\n"); + + /* Smooth-shaded triangle with PostScript level 3 shfill operator: + x3 y3 r3 g3 b3 x2 y2 r2 g2 b2 x1 y1 r1 g1 b1 STshfill */ + + gl2psPrintf("/STshfill {\n" + " /b1 exch def /g1 exch def /r1 exch def /y1 exch def /x1 exch def\n" + " /b2 exch def /g2 exch def /r2 exch def /y2 exch def /x2 exch def\n" + " /b3 exch def /g3 exch def /r3 exch def /y3 exch def /x3 exch def\n" + " gsave << /ShadingType 4 /ColorSpace [/DeviceRGB]\n" + " /DataSource [ 0 x1 y1 r1 g1 b1 0 x2 y2 r2 g2 b2 0 x3 y3 r3 g3 b3 ] >>\n" + " shfill grestore } BD\n"); + + /* Flat-shaded triangle with middle color: + x3 y3 r3 g3 b3 x2 y2 r2 g2 b2 x1 y1 r1 g1 b1 Tm */ + + gl2psPrintf(/* stack : x3 y3 r3 g3 b3 x2 y2 r2 g2 b2 x1 y1 r1 g1 b1 */ + "/Tm { 3 -1 roll 8 -1 roll 13 -1 roll add add 3 div\n" /* r = (r1+r2+r3)/3 */ + /* stack : x3 y3 g3 b3 x2 y2 g2 b2 x1 y1 g1 b1 r */ + " 3 -1 roll 7 -1 roll 11 -1 roll add add 3 div\n" /* g = (g1+g2+g3)/3 */ + /* stack : x3 y3 b3 x2 y2 b2 x1 y1 b1 r g b */ + " 3 -1 roll 6 -1 roll 9 -1 roll add add 3 div" /* b = (b1+b2+b3)/3 */ + /* stack : x3 y3 x2 y2 x1 y1 r g b */ + " C T } BD\n"); + + /* Split triangle in four sub-triangles (at sides middle points) and call the + STnoshfill procedure on each, interpolating the colors in RGB space: + x3 y3 r3 g3 b3 x2 y2 r2 g2 b2 x1 y1 r1 g1 b1 STsplit + (in procedure comments key: (Vi) = xi yi ri gi bi) */ + + gl2psPrintf("/STsplit {\n" + " 4 index 15 index add 0.5 mul\n" /* x13 = (x1+x3)/2 */ + " 4 index 15 index add 0.5 mul\n" /* y13 = (y1+y3)/2 */ + " 4 index 15 index add 0.5 mul\n" /* r13 = (r1+r3)/2 */ + " 4 index 15 index add 0.5 mul\n" /* g13 = (g1+g3)/2 */ + " 4 index 15 index add 0.5 mul\n" /* b13 = (b1+b3)/2 */ + " 5 copy 5 copy 25 15 roll\n"); + + /* at his point, stack = (V3) (V13) (V13) (V13) (V2) (V1) */ + + gl2psPrintf(" 9 index 30 index add 0.5 mul\n" /* x23 = (x2+x3)/2 */ + " 9 index 30 index add 0.5 mul\n" /* y23 = (y2+y3)/2 */ + " 9 index 30 index add 0.5 mul\n" /* r23 = (r2+r3)/2 */ + " 9 index 30 index add 0.5 mul\n" /* g23 = (g2+g3)/2 */ + " 9 index 30 index add 0.5 mul\n" /* b23 = (b2+b3)/2 */ + " 5 copy 5 copy 35 5 roll 25 5 roll 15 5 roll\n"); + + /* stack = (V3) (V13) (V23) (V13) (V23) (V13) (V23) (V2) (V1) */ + + gl2psPrintf(" 4 index 10 index add 0.5 mul\n" /* x12 = (x1+x2)/2 */ + " 4 index 10 index add 0.5 mul\n" /* y12 = (y1+y2)/2 */ + " 4 index 10 index add 0.5 mul\n" /* r12 = (r1+r2)/2 */ + " 4 index 10 index add 0.5 mul\n" /* g12 = (g1+g2)/2 */ + " 4 index 10 index add 0.5 mul\n" /* b12 = (b1+b2)/2 */ + " 5 copy 5 copy 40 5 roll 25 5 roll 15 5 roll 25 5 roll\n"); + + /* stack = (V3) (V13) (V23) (V13) (V12) (V23) (V13) (V1) (V12) (V23) (V12) (V2) */ + + gl2psPrintf(" STnoshfill STnoshfill STnoshfill STnoshfill } BD\n"); + + /* Gouraud shaded triangle using recursive subdivision until the difference + between corner colors does not exceed the thresholds: + x3 y3 r3 g3 b3 x2 y2 r2 g2 b2 x1 y1 r1 g1 b1 STnoshfill */ + + gl2psPrintf("/STnoshfill {\n" + " 2 index 8 index sub abs rThreshold gt\n" /* |r1-r2|>rth */ + " { STsplit }\n" + " { 1 index 7 index sub abs gThreshold gt\n" /* |g1-g2|>gth */ + " { STsplit }\n" + " { dup 6 index sub abs bThreshold gt\n" /* |b1-b2|>bth */ + " { STsplit }\n" + " { 2 index 13 index sub abs rThreshold gt\n" /* |r1-r3|>rht */ + " { STsplit }\n" + " { 1 index 12 index sub abs gThreshold gt\n" /* |g1-g3|>gth */ + " { STsplit }\n" + " { dup 11 index sub abs bThreshold gt\n" /* |b1-b3|>bth */ + " { STsplit }\n" + " { 7 index 13 index sub abs rThreshold gt\n"); /* |r2-r3|>rht */ + gl2psPrintf(" { STsplit }\n" + " { 6 index 12 index sub abs gThreshold gt\n" /* |g2-g3|>gth */ + " { STsplit }\n" + " { 5 index 11 index sub abs bThreshold gt\n" /* |b2-b3|>bth */ + " { STsplit }\n" + " { Tm }\n" /* all colors sufficiently similar */ + " ifelse }\n" + " ifelse }\n" + " ifelse }\n" + " ifelse }\n" + " ifelse }\n" + " ifelse }\n" + " ifelse }\n" + " ifelse }\n" + " ifelse } BD\n"); + + gl2psPrintf("tryPS3shading\n" + "{ /shfill where\n" + " { /ST { STshfill } BD }\n" + " { /ST { STnoshfill } BD }\n" + " ifelse }\n" + "{ /ST { STnoshfill } BD }\n" + "ifelse\n"); + + gl2psPrintf("end\n" + "%%%%EndProlog\n" + "%%%%BeginSetup\n" + "/DeviceRGB setcolorspace\n" + "gl2psdict begin\n" + "%%%%EndSetup\n" + "%%%%Page: 1 1\n" + "%%%%BeginPageSetup\n"); + + if(gl2ps->options & GL2PS_LANDSCAPE){ + gl2psPrintf("%d 0 translate 90 rotate\n", + (int)gl2ps->viewport[3]); + } + + gl2psPrintf("%%%%EndPageSetup\n" + "mark\n" + "gsave\n" + "1.0 1.0 scale\n"); + + if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ + gl2psPrintf("%g %g %g C\n" + "newpath %d %d moveto %d %d lineto %d %d lineto %d %d lineto\n" + "closepath fill\n", + gl2ps->bgcolor[0], gl2ps->bgcolor[1], gl2ps->bgcolor[2], + (int)gl2ps->viewport[0], (int)gl2ps->viewport[1], (int)gl2ps->viewport[2], + (int)gl2ps->viewport[1], (int)gl2ps->viewport[2], (int)gl2ps->viewport[3], + (int)gl2ps->viewport[0], (int)gl2ps->viewport[3]); + } +} + +static void gl2psPrintPostScriptColor(GL2PSrgba rgba) +{ + if(!gl2psSameColor(gl2ps->lastrgba, rgba)){ + gl2psSetLastColor(rgba); + gl2psPrintf("%g %g %g C\n", rgba[0], rgba[1], rgba[2]); + } +} + +static void gl2psResetPostScriptColor(void) +{ + gl2ps->lastrgba[0] = gl2ps->lastrgba[1] = gl2ps->lastrgba[2] = -1.; +} + +static void gl2psEndPostScriptLine(void) +{ + int i; + if(gl2ps->lastvertex.rgba[0] >= 0.){ + gl2psPrintf("%g %g LE\n", gl2ps->lastvertex.xyz[0], gl2ps->lastvertex.xyz[1]); + for(i = 0; i < 3; i++) + gl2ps->lastvertex.xyz[i] = -1.; + for(i = 0; i < 4; i++) + gl2ps->lastvertex.rgba[i] = -1.; + } +} + +static void gl2psParseStipplePattern(GLushort pattern, GLint factor, + int *nb, int array[10]) +{ + int i, n; + int on[8] = {0, 0, 0, 0, 0, 0, 0, 0}; + int off[8] = {0, 0, 0, 0, 0, 0, 0, 0}; + char tmp[16]; + + /* extract the 16 bits from the OpenGL stipple pattern */ + for(n = 15; n >= 0; n--){ + tmp[n] = (char)(pattern & 0x01); + pattern >>= 1; + } + /* compute the on/off pixel sequence */ + n = 0; + for(i = 0; i < 8; i++){ + while(n < 16 && !tmp[n]){ off[i]++; n++; } + while(n < 16 && tmp[n]){ on[i]++; n++; } + if(n >= 15){ i++; break; } + } + + /* store the on/off array from right to left, starting with off + pixels. The PostScript specification allows for at most 11 + elements in the on/off array, so we limit ourselves to 5 on/off + couples (our longest possible array is thus [on4 off4 on3 off3 + on2 off2 on1 off1 on0 off0]) */ + *nb = 0; + for(n = i - 1; n >= 0; n--){ + array[(*nb)++] = factor * on[n]; + array[(*nb)++] = factor * off[n]; + if(*nb == 10) break; + } +} + +static int gl2psPrintPostScriptDash(GLushort pattern, GLint factor, const char *str) +{ + int len = 0, i, n, array[10]; + + if(pattern == gl2ps->lastpattern && factor == gl2ps->lastfactor) + return 0; + + gl2ps->lastpattern = pattern; + gl2ps->lastfactor = factor; + + if(!pattern || !factor){ + /* solid line */ + len += gl2psPrintf("[] 0 %s\n", str); + } + else{ + gl2psParseStipplePattern(pattern, factor, &n, array); + len += gl2psPrintf("["); + for(i = 0; i < n; i++){ + if(i) len += gl2psPrintf(" "); + len += gl2psPrintf("%d", array[i]); + } + len += gl2psPrintf("] 0 %s\n", str); + } + + return len; +} + +static void gl2psPrintPostScriptPrimitive(void *data) +{ + int newline; + GL2PSprimitive *prim; + + prim = *(GL2PSprimitive**)data; + + if((gl2ps->options & GL2PS_OCCLUSION_CULL) && prim->culled) return; + + /* Every effort is made to draw lines as connected segments (i.e., + using a single PostScript path): this is the only way to get nice + line joins and to not restart the stippling for every line + segment. So if the primitive to print is not a line we must first + finish the current line (if any): */ + if(prim->type != GL2PS_LINE) gl2psEndPostScriptLine(); + + switch(prim->type){ + case GL2PS_POINT : + gl2psPrintPostScriptColor(prim->verts[0].rgba); + gl2psPrintf("%g %g %g P\n", + prim->verts[0].xyz[0], prim->verts[0].xyz[1], 0.5 * prim->width); + break; + case GL2PS_LINE : + if(!gl2psSamePosition(gl2ps->lastvertex.xyz, prim->verts[0].xyz) || + !gl2psSameColor(gl2ps->lastrgba, prim->verts[0].rgba) || + gl2ps->lastlinewidth != prim->width || + gl2ps->lastpattern != prim->pattern || + gl2ps->lastfactor != prim->factor){ + /* End the current line if the new segment does not start where + the last one ended, or if the color, the width or the + stippling have changed (multi-stroking lines with changing + colors is necessary until we use /shfill for lines; + unfortunately this means that at the moment we can screw up + line stippling for smooth-shaded lines) */ + gl2psEndPostScriptLine(); + newline = 1; + } + else{ + newline = 0; + } + if(gl2ps->lastlinewidth != prim->width){ + gl2ps->lastlinewidth = prim->width; + gl2psPrintf("%g W\n", gl2ps->lastlinewidth); + } + gl2psPrintPostScriptDash(prim->pattern, prim->factor, "setdash"); + gl2psPrintPostScriptColor(prim->verts[0].rgba); + gl2psPrintf("%g %g %s\n", prim->verts[0].xyz[0], prim->verts[0].xyz[1], + newline ? "LS" : "L"); + gl2ps->lastvertex = prim->verts[1]; + break; + case GL2PS_TRIANGLE : + if(!gl2psVertsSameColor(prim)){ + gl2psResetPostScriptColor(); + gl2psPrintf("%g %g %g %g %g %g %g %g %g %g %g %g %g %g %g ST\n", + prim->verts[2].xyz[0], prim->verts[2].xyz[1], + prim->verts[2].rgba[0], prim->verts[2].rgba[1], + prim->verts[2].rgba[2], prim->verts[1].xyz[0], + prim->verts[1].xyz[1], prim->verts[1].rgba[0], + prim->verts[1].rgba[1], prim->verts[1].rgba[2], + prim->verts[0].xyz[0], prim->verts[0].xyz[1], + prim->verts[0].rgba[0], prim->verts[0].rgba[1], + prim->verts[0].rgba[2]); + } + else{ + gl2psPrintPostScriptColor(prim->verts[0].rgba); + gl2psPrintf("%g %g %g %g %g %g T\n", + prim->verts[2].xyz[0], prim->verts[2].xyz[1], + prim->verts[1].xyz[0], prim->verts[1].xyz[1], + prim->verts[0].xyz[0], prim->verts[0].xyz[1]); + } + break; + case GL2PS_QUADRANGLE : + gl2psMsg(GL2PS_WARNING, "There should not be any quad left to print"); + break; + case GL2PS_PIXMAP : + gl2psPrintPostScriptPixmap(prim->verts[0].xyz[0], prim->verts[0].xyz[1], + prim->data.image); + break; + case GL2PS_IMAGEMAP : + if(prim->data.image->type != GL2PS_IMAGEMAP_WRITTEN){ + gl2psPrintPostScriptColor(prim->verts[0].rgba); + gl2psPrintPostScriptImagemap(prim->data.image->pixels[0], + prim->data.image->pixels[1], + prim->data.image->width, prim->data.image->height, + (const unsigned char*)(&(prim->data.image->pixels[2]))); + prim->data.image->type = GL2PS_IMAGEMAP_WRITTEN; + } + break; + case GL2PS_TEXT : + gl2psPrintPostScriptColor(prim->verts[0].rgba); + gl2psPrintf("(%s) ", prim->data.text->str); + if(prim->data.text->angle) + gl2psPrintf("%g ", prim->data.text->angle); + gl2psPrintf("%g %g %d /%s ", + prim->verts[0].xyz[0], prim->verts[0].xyz[1], + prim->data.text->fontsize, prim->data.text->fontname); + switch(prim->data.text->alignment){ + case GL2PS_TEXT_C: + gl2psPrintf(prim->data.text->angle ? "SCCR\n" : "SCC\n"); + break; + case GL2PS_TEXT_CL: + gl2psPrintf(prim->data.text->angle ? "SCLR\n" : "SCL\n"); + break; + case GL2PS_TEXT_CR: + gl2psPrintf(prim->data.text->angle ? "SCRR\n" : "SCR\n"); + break; + case GL2PS_TEXT_B: + gl2psPrintf(prim->data.text->angle ? "SBCR\n" : "SBC\n"); + break; + case GL2PS_TEXT_BR: + gl2psPrintf(prim->data.text->angle ? "SBRR\n" : "SBR\n"); + break; + case GL2PS_TEXT_T: + gl2psPrintf(prim->data.text->angle ? "STCR\n" : "STC\n"); + break; + case GL2PS_TEXT_TL: + gl2psPrintf(prim->data.text->angle ? "STLR\n" : "STL\n"); + break; + case GL2PS_TEXT_TR: + gl2psPrintf(prim->data.text->angle ? "STRR\n" : "STR\n"); + break; + case GL2PS_TEXT_BL: + default: + gl2psPrintf(prim->data.text->angle ? "SR\n" : "S\n"); + break; + } + break; + case GL2PS_SPECIAL : + /* alignment contains the format for which the special output text + is intended */ + if(prim->data.text->alignment == GL2PS_PS || + prim->data.text->alignment == GL2PS_EPS) + gl2psPrintf("%s\n", prim->data.text->str); + break; + default : + break; + } +} + +static void gl2psPrintPostScriptFooter(void) +{ + gl2psPrintf("grestore\n" + "showpage\n" + "cleartomark\n" + "%%%%PageTrailer\n" + "%%%%Trailer\n" + "end\n" + "%%%%EOF\n"); + + gl2psPrintGzipFooter(); +} + +static void gl2psPrintPostScriptBeginViewport(GLint viewport[4]) +{ + GLint index; + GLfloat rgba[4]; + int x = viewport[0], y = viewport[1], w = viewport[2], h = viewport[3]; + + glRenderMode(GL_FEEDBACK); + + if(gl2ps->header){ + gl2psPrintPostScriptHeader(); + gl2ps->header = GL_FALSE; + } + + gl2psPrintf("gsave\n" + "1.0 1.0 scale\n"); + + if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ + if(gl2ps->colormode == GL_RGBA || gl2ps->colorsize == 0){ + glGetFloatv(GL_COLOR_CLEAR_VALUE, rgba); + } + else{ + glGetIntegerv(GL_INDEX_CLEAR_VALUE, &index); + rgba[0] = gl2ps->colormap[index][0]; + rgba[1] = gl2ps->colormap[index][1]; + rgba[2] = gl2ps->colormap[index][2]; + rgba[3] = 1.0F; + } + gl2psPrintf("%g %g %g C\n" + "newpath %d %d moveto %d %d lineto %d %d lineto %d %d lineto\n" + "closepath fill\n", + rgba[0], rgba[1], rgba[2], + x, y, x+w, y, x+w, y+h, x, y+h); + } + + gl2psPrintf("newpath %d %d moveto %d %d lineto %d %d lineto %d %d lineto\n" + "closepath clip\n", + x, y, x+w, y, x+w, y+h, x, y+h); + +} + +static GLint gl2psPrintPostScriptEndViewport(void) +{ + GLint res; + + res = gl2psPrintPrimitives(); + gl2psPrintf("grestore\n"); + return res; +} + +static void gl2psPrintPostScriptFinalPrimitive(void) +{ + /* End any remaining line, if any */ + gl2psEndPostScriptLine(); +} + +/* definition of the PostScript and Encapsulated PostScript backends */ + +static GL2PSbackend gl2psPS = { + gl2psPrintPostScriptHeader, + gl2psPrintPostScriptFooter, + gl2psPrintPostScriptBeginViewport, + gl2psPrintPostScriptEndViewport, + gl2psPrintPostScriptPrimitive, + gl2psPrintPostScriptFinalPrimitive, + "ps", + "Postscript" +}; + +static GL2PSbackend gl2psEPS = { + gl2psPrintPostScriptHeader, + gl2psPrintPostScriptFooter, + gl2psPrintPostScriptBeginViewport, + gl2psPrintPostScriptEndViewport, + gl2psPrintPostScriptPrimitive, + gl2psPrintPostScriptFinalPrimitive, + "eps", + "Encapsulated Postscript" +}; + +/********************************************************************* + * + * LaTeX routines + * + *********************************************************************/ + +static void gl2psPrintTeXHeader(void) +{ + char name[256]; + time_t now; + int i; + + if(gl2ps->filename && strlen(gl2ps->filename) < 256){ + for(i = strlen(gl2ps->filename)-1; i >= 0; i--){ + if(gl2ps->filename[i] == '.'){ + strncpy(name, gl2ps->filename, i); + name[i] = '\0'; + break; + } + } + if(i <= 0) strcpy(name, gl2ps->filename); + } + else{ + strcpy(name, "untitled"); + } + + time(&now); + + fprintf(gl2ps->stream, + "%% Title: %s\n" + "%% Creator: GL2PS %d.%d.%d%s, %s\n" + "%% For: %s\n" + "%% CreationDate: %s", + gl2ps->title, GL2PS_MAJOR_VERSION, GL2PS_MINOR_VERSION, + GL2PS_PATCH_VERSION, GL2PS_EXTRA_VERSION, GL2PS_COPYRIGHT, + gl2ps->producer, ctime(&now)); + + fprintf(gl2ps->stream, + "\\setlength{\\unitlength}{1pt}\n" + "\\begin{picture}(0,0)\n" + "\\includegraphics{%s}\n" + "\\end{picture}%%\n" + "%s\\begin{picture}(%d,%d)(0,0)\n", + name, (gl2ps->options & GL2PS_LANDSCAPE) ? "\\rotatebox{90}{" : "", + (int)gl2ps->viewport[2], (int)gl2ps->viewport[3]); +} + +static void gl2psPrintTeXPrimitive(void *data) +{ + GL2PSprimitive *prim; + + prim = *(GL2PSprimitive**)data; + + switch(prim->type){ + case GL2PS_TEXT : + fprintf(gl2ps->stream, "\\fontsize{%d}{0}\n\\selectfont", + prim->data.text->fontsize); + fprintf(gl2ps->stream, "\\put(%g,%g){\\makebox(0,0)", + prim->verts[0].xyz[0], prim->verts[0].xyz[1]); + switch(prim->data.text->alignment){ + case GL2PS_TEXT_C: + fprintf(gl2ps->stream, "{"); + break; + case GL2PS_TEXT_CL: + fprintf(gl2ps->stream, "[l]{"); + break; + case GL2PS_TEXT_CR: + fprintf(gl2ps->stream, "[r]{"); + break; + case GL2PS_TEXT_B: + fprintf(gl2ps->stream, "[b]{"); + break; + case GL2PS_TEXT_BR: + fprintf(gl2ps->stream, "[br]{"); + break; + case GL2PS_TEXT_T: + fprintf(gl2ps->stream, "[t]{"); + break; + case GL2PS_TEXT_TL: + fprintf(gl2ps->stream, "[tl]{"); + break; + case GL2PS_TEXT_TR: + fprintf(gl2ps->stream, "[tr]{"); + break; + case GL2PS_TEXT_BL: + default: + fprintf(gl2ps->stream, "[bl]{"); + break; + } + if(prim->data.text->angle) + fprintf(gl2ps->stream, "\\rotatebox{%g}{", prim->data.text->angle); + fprintf(gl2ps->stream, "\\textcolor[rgb]{%g,%g,%g}{{%s}}", + prim->verts[0].rgba[0], prim->verts[0].rgba[1], prim->verts[0].rgba[2], + prim->data.text->str); + if(prim->data.text->angle) + fprintf(gl2ps->stream, "}"); + fprintf(gl2ps->stream, "}}\n"); + break; + case GL2PS_SPECIAL : + /* alignment contains the format for which the special output text + is intended */ + if (prim->data.text->alignment == GL2PS_TEX) + fprintf(gl2ps->stream, "%s\n", prim->data.text->str); + break; + default : + break; + } +} + +static void gl2psPrintTeXFooter(void) +{ + fprintf(gl2ps->stream, "\\end{picture}%s\n", + (gl2ps->options & GL2PS_LANDSCAPE) ? "}" : ""); +} + +static void gl2psPrintTeXBeginViewport(GLint viewport[4]) +{ + glRenderMode(GL_FEEDBACK); + + if(gl2ps->header){ + gl2psPrintTeXHeader(); + gl2ps->header = GL_FALSE; + } +} + +static GLint gl2psPrintTeXEndViewport(void) +{ + return gl2psPrintPrimitives(); +} + +static void gl2psPrintTeXFinalPrimitive(void) +{ +} + +/* definition of the LaTeX backend */ + +static GL2PSbackend gl2psTEX = { + gl2psPrintTeXHeader, + gl2psPrintTeXFooter, + gl2psPrintTeXBeginViewport, + gl2psPrintTeXEndViewport, + gl2psPrintTeXPrimitive, + gl2psPrintTeXFinalPrimitive, + "tex", + "LaTeX text" +}; + +/********************************************************************* + * + * PDF routines + * + *********************************************************************/ + +static int gl2psPrintPDFCompressorType(void) +{ +#if defined(GL2PS_HAVE_ZLIB) + if(gl2ps->options & GL2PS_COMPRESS){ + return fprintf(gl2ps->stream, "/Filter [/FlateDecode]\n"); + } +#endif + return 0; +} + +static int gl2psPrintPDFStrokeColor(GL2PSrgba rgba) +{ + int i, offs = 0; + + gl2psSetLastColor(rgba); + for(i = 0; i < 3; ++i){ + if(GL2PS_ZERO(rgba[i])) + offs += gl2psPrintf("%.0f ", 0.); + else if(rgba[i] < 1e-4 || rgba[i] > 1e6) /* avoid %e formatting */ + offs += gl2psPrintf("%f ", rgba[i]); + else + offs += gl2psPrintf("%g ", rgba[i]); + } + offs += gl2psPrintf("RG\n"); + return offs; +} + +static int gl2psPrintPDFFillColor(GL2PSrgba rgba) +{ + int i, offs = 0; + + for(i = 0; i < 3; ++i){ + if(GL2PS_ZERO(rgba[i])) + offs += gl2psPrintf("%.0f ", 0.); + else if(rgba[i] < 1e-4 || rgba[i] > 1e6) /* avoid %e formatting */ + offs += gl2psPrintf("%f ", rgba[i]); + else + offs += gl2psPrintf("%g ", rgba[i]); + } + offs += gl2psPrintf("rg\n"); + return offs; +} + +static int gl2psPrintPDFLineWidth(GLfloat lw) +{ + if(GL2PS_ZERO(lw)) + return gl2psPrintf("%.0f w\n", 0.); + else if(lw < 1e-4 || lw > 1e6) /* avoid %e formatting */ + return gl2psPrintf("%f w\n", lw); + else + return gl2psPrintf("%g w\n", lw); +} + +static void gl2psPutPDFText(GL2PSstring *text, int cnt, GLfloat x, GLfloat y) +{ + GLfloat rad = M_PI * text->angle / 180.0F; + GLfloat srad = (GLfloat)sin(rad); + GLfloat crad = (GLfloat)cos(rad); + + int dx = 0, dy = 0; + int l = strlen(text->str)*text->fontsize/4; + switch(text->alignment){//the alignment code is totally empirical, it might not work in all cases + case GL2PS_TEXT_C: + dx = -l; + dy = -text->fontsize/2; + break; + case GL2PS_TEXT_CL: + dy = -text->fontsize/2; + break; + case GL2PS_TEXT_CR: + dx = -2*l; + dy = -text->fontsize/2; + break; + case GL2PS_TEXT_B: + dx = -4*l; + dy = -text->fontsize/2; + break; + case GL2PS_TEXT_BR: + dx = -4*l; + dy = -text->fontsize/2; + break; + case GL2PS_TEXT_T: + dx = -l; + dy = -text->fontsize; + break; + case GL2PS_TEXT_TL: + dx = -2*l; + dy = -text->fontsize; + break; + case GL2PS_TEXT_TR: + dx = -2*l; + dy = -text->fontsize; + break; + case GL2PS_TEXT_BL: + default: + dx = -2*l; + dy = -text->fontsize/2; + break; + } + + gl2ps->streamlength += + gl2psPrintf("BT\n" + "/F%d %d Tf\n" + "%f %f %f %f %f %f Tm\n" + "%d %d Td\n" + "(%s) Tj\n" + "ET\n", + cnt, text->fontsize, crad, srad, -srad, crad, x, y, dx, dy, text->str); +} + +static void gl2psPutPDFImage(GL2PSimage *image, int cnt, GLfloat x, GLfloat y) +{ + gl2ps->streamlength += gl2psPrintf + ("q\n" + "%d 0 0 %d %f %f cm\n" + "/Im%d Do\n" + "Q\n", + (int)image->width, (int)image->height, x, y, cnt); +} + +static void gl2psPDFstacksInit(void) +{ + gl2ps->objects_stack = 7 /* FIXED_XREF_ENTRIES */ + 1; + gl2ps->extgs_stack = 0; + gl2ps->font_stack = 0; + gl2ps->im_stack = 0; + gl2ps->trgroupobjects_stack = 0; + gl2ps->shader_stack = 0; + gl2ps->mshader_stack = 0; +} + +static void gl2psPDFgroupObjectInit(GL2PSpdfgroup *gro) +{ + if(!gro) + return; + + gro->ptrlist = NULL; + gro->fontno = gro->gsno = gro->imno = gro->maskshno = gro->shno + = gro->trgroupno = gro->fontobjno = gro->imobjno = gro->shobjno + = gro->maskshobjno = gro->gsobjno = gro->trgroupobjno = -1; +} + +/* Build up group objects and assign name and object numbers */ + +static void gl2psPDFgroupListInit(void) +{ + int i; + GL2PSprimitive *p = NULL; + GL2PSpdfgroup gro; + int lasttype = GL2PS_NO_TYPE; + GL2PSrgba lastrgba = {-1.0F, -1.0F, -1.0F, -1.0F}; + GLushort lastpattern = 0; + GLint lastfactor = 0; + GLfloat lastwidth = 1; + GL2PStriangle lastt, tmpt; + int lastTriangleWasNotSimpleWithSameColor = 0; + + if(!gl2ps->pdfprimlist) + return; + + gl2ps->pdfgrouplist = gl2psListCreate(500, 500, sizeof(GL2PSpdfgroup)); + gl2psInitTriangle(&lastt); + + for(i = 0; i < gl2psListNbr(gl2ps->pdfprimlist); ++i){ + p = *(GL2PSprimitive**)gl2psListPointer(gl2ps->pdfprimlist, i); + switch(p->type){ + case GL2PS_PIXMAP: + gl2psPDFgroupObjectInit(&gro); + gro.ptrlist = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); + gro.imno = gl2ps->im_stack++; + gl2psListAdd(gro.ptrlist, &p); + gl2psListAdd(gl2ps->pdfgrouplist, &gro); + break; + case GL2PS_TEXT: + gl2psPDFgroupObjectInit(&gro); + gro.ptrlist = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); + gro.fontno = gl2ps->font_stack++; + gl2psListAdd(gro.ptrlist, &p); + gl2psListAdd(gl2ps->pdfgrouplist, &gro); + break; + case GL2PS_LINE: + if(lasttype != p->type || lastwidth != p->width || + lastpattern != p->pattern || lastfactor != p->factor || + !gl2psSameColor(p->verts[0].rgba, lastrgba)){ + gl2psPDFgroupObjectInit(&gro); + gro.ptrlist = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); + gl2psListAdd(gro.ptrlist, &p); + gl2psListAdd(gl2ps->pdfgrouplist, &gro); + } + else{ + gl2psListAdd(gro.ptrlist, &p); + } + lastpattern = p->pattern; + lastfactor = p->factor; + lastwidth = p->width; + lastrgba[0] = p->verts[0].rgba[0]; + lastrgba[1] = p->verts[0].rgba[1]; + lastrgba[2] = p->verts[0].rgba[2]; + break; + case GL2PS_POINT: + if(lasttype != p->type || lastwidth != p->width || + !gl2psSameColor(p->verts[0].rgba, lastrgba)){ + gl2psPDFgroupObjectInit(&gro); + gro.ptrlist = gl2psListCreate(1,2,sizeof(GL2PSprimitive*)); + gl2psListAdd(gro.ptrlist, &p); + gl2psListAdd(gl2ps->pdfgrouplist, &gro); + } + else{ + gl2psListAdd(gro.ptrlist, &p); + } + lastwidth = p->width; + lastrgba[0] = p->verts[0].rgba[0]; + lastrgba[1] = p->verts[0].rgba[1]; + lastrgba[2] = p->verts[0].rgba[2]; + break; + case GL2PS_TRIANGLE: + gl2psFillTriangleFromPrimitive(&tmpt, p, GL_TRUE); + lastTriangleWasNotSimpleWithSameColor = + !(tmpt.prop & T_CONST_COLOR && tmpt.prop & T_ALPHA_1) || + !gl2psSameColor(tmpt.vertex[0].rgba, lastt.vertex[0].rgba); + if(lasttype == p->type && tmpt.prop == lastt.prop && + lastTriangleWasNotSimpleWithSameColor){ + /* TODO Check here for last alpha */ + gl2psListAdd(gro.ptrlist, &p); + } + else{ + gl2psPDFgroupObjectInit(&gro); + gro.ptrlist = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); + gl2psListAdd(gro.ptrlist, &p); + gl2psListAdd(gl2ps->pdfgrouplist, &gro); + } + lastt = tmpt; + break; + default: + break; + } + lasttype = p->type; + } +} + +static void gl2psSortOutTrianglePDFgroup(GL2PSpdfgroup *gro) +{ + GL2PStriangle t; + GL2PSprimitive *prim = NULL; + + if(!gro) + return; + + if(!gl2psListNbr(gro->ptrlist)) + return; + + prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, 0); + + if(prim->type != GL2PS_TRIANGLE) + return; + + gl2psFillTriangleFromPrimitive(&t, prim, GL_TRUE); + + if(t.prop & T_CONST_COLOR && t.prop & T_ALPHA_LESS_1){ + gro->gsno = gl2ps->extgs_stack++; + gro->gsobjno = gl2ps->objects_stack ++; + } + else if(t.prop & T_CONST_COLOR && t.prop & T_VAR_ALPHA){ + gro->gsno = gl2ps->extgs_stack++; + gro->gsobjno = gl2ps->objects_stack++; + gro->trgroupno = gl2ps->trgroupobjects_stack++; + gro->trgroupobjno = gl2ps->objects_stack++; + gro->maskshno = gl2ps->mshader_stack++; + gro->maskshobjno = gl2ps->objects_stack++; + } + else if(t.prop & T_VAR_COLOR && t.prop & T_ALPHA_1){ + gro->shno = gl2ps->shader_stack++; + gro->shobjno = gl2ps->objects_stack++; + } + else if(t.prop & T_VAR_COLOR && t.prop & T_ALPHA_LESS_1){ + gro->gsno = gl2ps->extgs_stack++; + gro->gsobjno = gl2ps->objects_stack++; + gro->shno = gl2ps->shader_stack++; + gro->shobjno = gl2ps->objects_stack++; + } + else if(t.prop & T_VAR_COLOR && t.prop & T_VAR_ALPHA){ + gro->gsno = gl2ps->extgs_stack++; + gro->gsobjno = gl2ps->objects_stack++; + gro->shno = gl2ps->shader_stack++; + gro->shobjno = gl2ps->objects_stack++; + gro->trgroupno = gl2ps->trgroupobjects_stack++; + gro->trgroupobjno = gl2ps->objects_stack++; + gro->maskshno = gl2ps->mshader_stack++; + gro->maskshobjno = gl2ps->objects_stack++; + } +} + +/* Main stream data */ + +static void gl2psPDFgroupListWriteMainStream(void) +{ + int i, j, lastel; + GL2PSprimitive *prim = NULL, *prev = NULL; + GL2PSpdfgroup *gro; + GL2PStriangle t; + + if(!gl2ps->pdfgrouplist) + return; + + for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ + gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist, i); + + lastel = gl2psListNbr(gro->ptrlist) - 1; + if(lastel < 0) + continue; + + prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, 0); + + switch(prim->type){ + case GL2PS_POINT: + gl2ps->streamlength += gl2psPrintf("1 J\n"); + gl2ps->streamlength += gl2psPrintPDFLineWidth(prim->width); + gl2ps->streamlength += gl2psPrintPDFStrokeColor(prim->verts[0].rgba); + for(j = 0; j <= lastel; ++j){ + prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); + gl2ps->streamlength += + gl2psPrintf("%f %f m %f %f l\n", + prim->verts[0].xyz[0], prim->verts[0].xyz[1], + prim->verts[0].xyz[0], prim->verts[0].xyz[1]); + } + gl2ps->streamlength += gl2psPrintf("S\n"); + gl2ps->streamlength += gl2psPrintf("0 J\n"); + break; + case GL2PS_LINE: + /* We try to use as few paths as possible to draw lines, in + order to get nice stippling even when the individual segments + are smaller than the stipple */ + gl2ps->streamlength += gl2psPrintPDFLineWidth(prim->width); + gl2ps->streamlength += gl2psPrintPDFStrokeColor(prim->verts[0].rgba); + gl2ps->streamlength += gl2psPrintPostScriptDash(prim->pattern, prim->factor, "d"); + /* start new path */ + gl2ps->streamlength += + gl2psPrintf("%f %f m\n", + prim->verts[0].xyz[0], prim->verts[0].xyz[1]); + + for(j = 1; j <= lastel; ++j){ + prev = prim; + prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); + if(!gl2psSamePosition(prim->verts[0].xyz, prev->verts[1].xyz)){ + /* the starting point of the new segment does not match the + end point of the previous line, so we end the current + path and start a new one */ + gl2ps->streamlength += + gl2psPrintf("%f %f l\n", + prev->verts[1].xyz[0], prev->verts[1].xyz[1]); + gl2ps->streamlength += + gl2psPrintf("%f %f m\n", + prim->verts[0].xyz[0], prim->verts[0].xyz[1]); + } + else{ + /* the two segements are connected, so we just append to the + current path */ + gl2ps->streamlength += + gl2psPrintf("%f %f l\n", + prim->verts[0].xyz[0], prim->verts[0].xyz[1]); + } + } + /* end last path */ + gl2ps->streamlength += + gl2psPrintf("%f %f l\n", + prim->verts[1].xyz[0], prim->verts[1].xyz[1]); + gl2ps->streamlength += gl2psPrintf("S\n"); + break; + case GL2PS_TRIANGLE: + gl2psFillTriangleFromPrimitive(&t, prim, GL_TRUE); + gl2psSortOutTrianglePDFgroup(gro); + + /* No alpha and const color: Simple PDF draw orders */ + if(t.prop & T_CONST_COLOR && t.prop & T_ALPHA_1){ + gl2ps->streamlength += gl2psPrintPDFFillColor(t.vertex[0].rgba); + for(j = 0; j <= lastel; ++j){ + prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); + gl2psFillTriangleFromPrimitive(&t, prim, GL_FALSE); + gl2ps->streamlength + += gl2psPrintf("%f %f m\n" + "%f %f l\n" + "%f %f l\n" + "h f\n", + t.vertex[0].xyz[0], t.vertex[0].xyz[1], + t.vertex[1].xyz[0], t.vertex[1].xyz[1], + t.vertex[2].xyz[0], t.vertex[2].xyz[1]); + } + } + /* Const alpha < 1 and const color: Simple PDF draw orders + and an extra extended Graphics State for the alpha const */ + else if(t.prop & T_CONST_COLOR && t.prop & T_ALPHA_LESS_1){ + gl2ps->streamlength += gl2psPrintf("q\n" + "/GS%d gs\n", + gro->gsno); + gl2ps->streamlength += gl2psPrintPDFFillColor(prim->verts[0].rgba); + for(j = 0; j <= lastel; ++j){ + prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); + gl2psFillTriangleFromPrimitive(&t, prim, GL_FALSE); + gl2ps->streamlength + += gl2psPrintf("%f %f m\n" + "%f %f l\n" + "%f %f l\n" + "h f\n", + t.vertex[0].xyz[0], t.vertex[0].xyz[1], + t.vertex[1].xyz[0], t.vertex[1].xyz[1], + t.vertex[2].xyz[0], t.vertex[2].xyz[1]); + } + gl2ps->streamlength += gl2psPrintf("Q\n"); + } + /* Variable alpha and const color: Simple PDF draw orders + and an extra extended Graphics State + Xobject + Shader + object for the alpha mask */ + else if(t.prop & T_CONST_COLOR && t.prop & T_VAR_ALPHA){ + gl2ps->streamlength += gl2psPrintf("q\n" + "/GS%d gs\n" + "/TrG%d Do\n", + gro->gsno, gro->trgroupno); + gl2ps->streamlength += gl2psPrintPDFFillColor(prim->verts[0].rgba); + for(j = 0; j <= lastel; ++j){ + prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); + gl2psFillTriangleFromPrimitive(&t, prim, GL_FALSE); + gl2ps->streamlength + += gl2psPrintf("%f %f m\n" + "%f %f l\n" + "%f %f l\n" + "h f\n", + t.vertex[0].xyz[0], t.vertex[0].xyz[1], + t.vertex[1].xyz[0], t.vertex[1].xyz[1], + t.vertex[2].xyz[0], t.vertex[2].xyz[1]); + } + gl2ps->streamlength += gl2psPrintf("Q\n"); + } + /* Variable color and no alpha: Shader Object for the colored + triangle(s) */ + else if(t.prop & T_VAR_COLOR && t.prop & T_ALPHA_1){ + gl2ps->streamlength += gl2psPrintf("/Sh%d sh\n", gro->shno); + } + /* Variable color and const alpha < 1: Shader Object for the + colored triangle(s) and an extra extended Graphics State + for the alpha const */ + else if(t.prop & T_VAR_COLOR && t.prop & T_ALPHA_LESS_1){ + gl2ps->streamlength += gl2psPrintf("q\n" + "/GS%d gs\n" + "/Sh%d sh\n" + "Q\n", + gro->gsno, gro->shno); + } + /* Variable alpha and color: Shader Object for the colored + triangle(s) and an extra extended Graphics State + + Xobject + Shader object for the alpha mask */ + else if(t.prop & T_VAR_COLOR && t.prop & T_VAR_ALPHA){ + gl2ps->streamlength += gl2psPrintf("q\n" + "/GS%d gs\n" + "/TrG%d Do\n" + "/Sh%d sh\n" + "Q\n", + gro->gsno, gro->trgroupno, gro->shno); + } + break; + case GL2PS_PIXMAP: + for(j = 0; j <= lastel; ++j){ + prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); + gl2psPutPDFImage(prim->data.image, gro->imno, prim->verts[0].xyz[0], + prim->verts[0].xyz[1]); + } + break; + case GL2PS_TEXT: + for(j = 0; j <= lastel; ++j){ + prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); + gl2ps->streamlength += gl2psPrintPDFFillColor(prim->verts[0].rgba); + gl2psPutPDFText(prim->data.text, gro->fontno, prim->verts[0].xyz[0], + prim->verts[0].xyz[1]); + } + break; + default: + break; + } + } +} + +/* Graphics State names */ + +static int gl2psPDFgroupListWriteGStateResources(void) +{ + GL2PSpdfgroup *gro; + int offs = 0; + int i; + + offs += fprintf(gl2ps->stream, + "/ExtGState\n" + "<<\n" + "/GSa 7 0 R\n"); + for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ + gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist, i); + if(gro->gsno >= 0) + offs += fprintf(gl2ps->stream, "/GS%d %d 0 R\n", gro->gsno, gro->gsobjno); + } + offs += fprintf(gl2ps->stream, ">>\n"); + return offs; +} + +/* Main Shader names */ + +static int gl2psPDFgroupListWriteShaderResources(void) +{ + GL2PSpdfgroup *gro; + int offs = 0; + int i; + + offs += fprintf(gl2ps->stream, + "/Shading\n" + "<<\n"); + for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ + gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist, i); + if(gro->shno >= 0) + offs += fprintf(gl2ps->stream, "/Sh%d %d 0 R\n", gro->shno, gro->shobjno); + if(gro->maskshno >= 0) + offs += fprintf(gl2ps->stream, "/TrSh%d %d 0 R\n", gro->maskshno, gro->maskshobjno); + } + offs += fprintf(gl2ps->stream,">>\n"); + return offs; +} + +/* Images & Mask Shader XObject names */ + +static int gl2psPDFgroupListWriteXObjectResources(void) +{ + int i; + GL2PSprimitive *p = NULL; + GL2PSpdfgroup *gro; + int offs = 0; + + offs += fprintf(gl2ps->stream, + "/XObject\n" + "<<\n"); + + for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ + gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist, i); + if(!gl2psListNbr(gro->ptrlist)) + continue; + p = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, 0); + switch(p->type){ + case GL2PS_PIXMAP: + gro->imobjno = gl2ps->objects_stack++; + if(GL_RGBA == p->data.image->format) /* reserve one object for image mask */ + gl2ps->objects_stack++; + offs += fprintf(gl2ps->stream, "/Im%d %d 0 R\n", gro->imno, gro->imobjno); + case GL2PS_TRIANGLE: + if(gro->trgroupno >=0) + offs += fprintf(gl2ps->stream, "/TrG%d %d 0 R\n", gro->trgroupno, gro->trgroupobjno); + break; + default: + break; + } + } + offs += fprintf(gl2ps->stream,">>\n"); + return offs; +} + +/* Font names */ + +static int gl2psPDFgroupListWriteFontResources(void) +{ + int i; + GL2PSpdfgroup *gro; + int offs = 0; + + offs += fprintf(gl2ps->stream, "/Font\n<<\n"); + + for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ + gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist, i); + if(gro->fontno < 0) + continue; + gro->fontobjno = gl2ps->objects_stack++; + offs += fprintf(gl2ps->stream, "/F%d %d 0 R\n", gro->fontno, gro->fontobjno); + } + offs += fprintf(gl2ps->stream, ">>\n"); + + return offs; +} + +static void gl2psPDFgroupListDelete(void) +{ + int i; + GL2PSpdfgroup *gro = NULL; + + if(!gl2ps->pdfgrouplist) + return; + + for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ + gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist,i); + gl2psListDelete(gro->ptrlist); + } + + gl2psListDelete(gl2ps->pdfgrouplist); + gl2ps->pdfgrouplist = NULL; +} + +/* Print 1st PDF object - file info */ + +static int gl2psPrintPDFInfo(void) +{ + int offs; + time_t now; + struct tm *newtime; + + time(&now); + newtime = gmtime(&now); + + offs = fprintf(gl2ps->stream, + "1 0 obj\n" + "<<\n" + "/Title (%s)\n" + "/Creator (GL2PS %d.%d.%d%s, %s)\n" + "/Producer (%s)\n", + gl2ps->title, GL2PS_MAJOR_VERSION, GL2PS_MINOR_VERSION, + GL2PS_PATCH_VERSION, GL2PS_EXTRA_VERSION, GL2PS_COPYRIGHT, + gl2ps->producer); + + if(!newtime){ + offs += fprintf(gl2ps->stream, + ">>\n" + "endobj\n"); + return offs; + } + + offs += fprintf(gl2ps->stream, + "/CreationDate (D:%d%02d%02d%02d%02d%02d)\n" + ">>\n" + "endobj\n", + newtime->tm_year+1900, + newtime->tm_mon+1, + newtime->tm_mday, + newtime->tm_hour, + newtime->tm_min, + newtime->tm_sec); + return offs; +} + +/* Create catalog and page structure - 2nd and 3th PDF object */ + +static int gl2psPrintPDFCatalog(void) +{ + return fprintf(gl2ps->stream, + "2 0 obj\n" + "<<\n" + "/Type /Catalog\n" + "/Pages 3 0 R\n" + ">>\n" + "endobj\n"); +} + +static int gl2psPrintPDFPages(void) +{ + return fprintf(gl2ps->stream, + "3 0 obj\n" + "<<\n" + "/Type /Pages\n" + "/Kids [6 0 R]\n" + "/Count 1\n" + ">>\n" + "endobj\n"); +} + +/* Open stream for data - graphical objects, fonts etc. PDF object 4 */ + +static int gl2psOpenPDFDataStream(void) +{ + int offs = 0; + + offs += fprintf(gl2ps->stream, + "4 0 obj\n" + "<<\n" + "/Length 5 0 R\n" ); + offs += gl2psPrintPDFCompressorType(); + offs += fprintf(gl2ps->stream, + ">>\n" + "stream\n"); + return offs; +} + +/* Stream setup - Graphics state, fill background if allowed */ + +static int gl2psOpenPDFDataStreamWritePreface(void) +{ + int offs; + + offs = gl2psPrintf("/GSa gs\n"); + + if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ + offs += gl2psPrintPDFFillColor(gl2ps->bgcolor); + offs += gl2psPrintf("%d %d %d %d re\n", + (int)gl2ps->viewport[0], (int)gl2ps->viewport[1], + (int)gl2ps->viewport[2], (int)gl2ps->viewport[3]); + offs += gl2psPrintf("f\n"); + } + return offs; +} + +/* Use the functions above to create the first part of the PDF*/ + +static void gl2psPrintPDFHeader(void) +{ + int offs = 0; + gl2ps->pdfprimlist = gl2psListCreate(500, 500, sizeof(GL2PSprimitive*)); + gl2psPDFstacksInit(); + + gl2ps->xreflist = (int*)gl2psMalloc(sizeof(int) * gl2ps->objects_stack); + +#if defined(GL2PS_HAVE_ZLIB) + if(gl2ps->options & GL2PS_COMPRESS){ + gl2psSetupCompress(); + } +#endif + gl2ps->xreflist[0] = 0; + offs += fprintf(gl2ps->stream, "%%PDF-1.4\n"); + gl2ps->xreflist[1] = offs; + + offs += gl2psPrintPDFInfo(); + gl2ps->xreflist[2] = offs; + + offs += gl2psPrintPDFCatalog(); + gl2ps->xreflist[3] = offs; + + offs += gl2psPrintPDFPages(); + gl2ps->xreflist[4] = offs; + + offs += gl2psOpenPDFDataStream(); + gl2ps->xreflist[5] = offs; /* finished in gl2psPrintPDFFooter */ + gl2ps->streamlength = gl2psOpenPDFDataStreamWritePreface(); +} + +/* The central primitive drawing */ + +static void gl2psPrintPDFPrimitive(void *data) +{ + GL2PSprimitive *prim = *(GL2PSprimitive**)data; + + if((gl2ps->options & GL2PS_OCCLUSION_CULL) && prim->culled) + return; + + prim = gl2psCopyPrimitive(prim); /* deep copy */ + gl2psListAdd(gl2ps->pdfprimlist, &prim); +} + +/* close stream and ... */ + +static int gl2psClosePDFDataStream(void) +{ + int offs = 0; + +#if defined(GL2PS_HAVE_ZLIB) + if(gl2ps->options & GL2PS_COMPRESS){ + if(Z_OK != gl2psDeflate()) + gl2psMsg(GL2PS_ERROR, "Zlib deflate error"); + else + fwrite(gl2ps->compress->dest, gl2ps->compress->destLen, 1, gl2ps->stream); + gl2ps->streamlength += gl2ps->compress->destLen; + + offs += gl2ps->streamlength; + gl2psFreeCompress(); + } +#endif + + offs += fprintf(gl2ps->stream, + "endstream\n" + "endobj\n"); + return offs; +} + +/* ... write the now known length object */ + +static int gl2psPrintPDFDataStreamLength(int val) +{ + return fprintf(gl2ps->stream, + "5 0 obj\n" + "%d\n" + "endobj\n", val); +} + +/* Put the info created before in PDF objects */ + +static int gl2psPrintPDFOpenPage(void) +{ + int offs; + + /* Write fixed part */ + + offs = fprintf(gl2ps->stream, + "6 0 obj\n" + "<<\n" + "/Type /Page\n" + "/Parent 3 0 R\n" + "/MediaBox [%d %d %d %d]\n", + (int)gl2ps->viewport[0], (int)gl2ps->viewport[1], + (int)gl2ps->viewport[2], (int)gl2ps->viewport[3]); + + if(gl2ps->options & GL2PS_LANDSCAPE) + offs += fprintf(gl2ps->stream, "/Rotate -90\n"); + + offs += fprintf(gl2ps->stream, + "/Contents 4 0 R\n" + "/Resources\n" + "<<\n" + "/ProcSet [/PDF /Text /ImageB /ImageC] %%/ImageI\n"); + + return offs; + + /* End fixed part, proceeds in gl2psPDFgroupListWriteVariableResources() */ +} + +static int gl2psPDFgroupListWriteVariableResources(void) +{ + int offs = 0; + + /* a) Graphics States for shader alpha masks*/ + offs += gl2psPDFgroupListWriteGStateResources(); + + /* b) Shader and shader masks */ + offs += gl2psPDFgroupListWriteShaderResources(); + + /* c) XObjects (Images & Shader Masks) */ + offs += gl2psPDFgroupListWriteXObjectResources(); + + /* d) Fonts */ + offs += gl2psPDFgroupListWriteFontResources(); + + /* End resources and page */ + offs += fprintf(gl2ps->stream, + ">>\n" + ">>\n" + "endobj\n"); + return offs; +} + +/* Standard Graphics State */ + +static int gl2psPrintPDFGSObject(void) +{ + return fprintf(gl2ps->stream, + "7 0 obj\n" + "<<\n" + "/Type /ExtGState\n" + "/SA false\n" + "/SM 0.02\n" + "/OP false\n" + "/op false\n" + "/OPM 0\n" + "/BG2 /Default\n" + "/UCR2 /Default\n" + "/TR2 /Default\n" + ">>\n" + "endobj\n"); +} + +/* Put vertex' edge flag (8bit) and coordinates (32bit) in shader stream */ + +static int gl2psPrintPDFShaderStreamDataCoord(GL2PSvertex *vertex, + size_t (*action)(unsigned long data, + size_t size), + GLfloat dx, GLfloat dy, + GLfloat xmin, GLfloat ymin) +{ + int offs = 0; + unsigned long imap; + GLfloat diff; + double dmax = ~1UL; + char edgeflag = 0; + + /* FIXME: temp bux fix for 64 bit archs: */ + if(sizeof(unsigned long) == 8) dmax = dmax - 2048.; + + offs += (*action)(edgeflag, 1); + + /* The Shader stream in PDF requires to be in a 'big-endian' + order */ + + if(GL2PS_ZERO(dx * dy)){ + offs += (*action)(0, 4); + offs += (*action)(0, 4); + } + else{ + diff = (vertex->xyz[0] - xmin) / dx; + if(diff > 1) + diff = 1.0F; + else if(diff < 0) + diff = 0.0F; + imap = (unsigned long)(diff * dmax); + offs += (*action)(imap, 4); + + diff = (vertex->xyz[1] - ymin) / dy; + if(diff > 1) + diff = 1.0F; + else if(diff < 0) + diff = 0.0F; + imap = (unsigned long)(diff * dmax); + offs += (*action)(imap, 4); + } + + return offs; +} + +/* Put vertex' rgb value (8bit for every component) in shader stream */ + +static int gl2psPrintPDFShaderStreamDataRGB(GL2PSvertex *vertex, + size_t (*action)(unsigned long data, + size_t size)) +{ + int offs = 0; + unsigned long imap; + double dmax = ~1UL; + + /* FIXME: temp bux fix for 64 bit archs: */ + if(sizeof(unsigned long) == 8) dmax = dmax - 2048.; + + imap = (unsigned long)((vertex->rgba[0]) * dmax); + offs += (*action)(imap, 1); + + imap = (unsigned long)((vertex->rgba[1]) * dmax); + offs += (*action)(imap, 1); + + imap = (unsigned long)((vertex->rgba[2]) * dmax); + offs += (*action)(imap, 1); + + return offs; +} + +/* Put vertex' alpha (8/16bit) in shader stream */ + +static int gl2psPrintPDFShaderStreamDataAlpha(GL2PSvertex *vertex, + size_t (*action)(unsigned long data, + size_t size), + int sigbyte) +{ + int offs = 0; + unsigned long imap; + double dmax = ~1UL; + + /* FIXME: temp bux fix for 64 bit archs: */ + if(sizeof(unsigned long) == 8) dmax = dmax - 2048.; + + if(sigbyte != 8 && sigbyte != 16) + sigbyte = 8; + + sigbyte /= 8; + + imap = (unsigned long)((vertex->rgba[3]) * dmax); + + offs += (*action)(imap, sigbyte); + + return offs; +} + +/* Put a triangles raw data in shader stream */ + +static int gl2psPrintPDFShaderStreamData(GL2PStriangle *triangle, + GLfloat dx, GLfloat dy, + GLfloat xmin, GLfloat ymin, + size_t (*action)(unsigned long data, + size_t size), + int gray) +{ + int i, offs = 0; + GL2PSvertex v; + + if(gray && gray != 8 && gray != 16) + gray = 8; + + for(i = 0; i < 3; ++i){ + offs += gl2psPrintPDFShaderStreamDataCoord(&triangle->vertex[i], action, + dx, dy, xmin, ymin); + if(gray){ + v = triangle->vertex[i]; + offs += gl2psPrintPDFShaderStreamDataAlpha(&v, action, gray); + } + else{ + offs += gl2psPrintPDFShaderStreamDataRGB(&triangle->vertex[i], action); + } + } + + return offs; +} + +static void gl2psPDFRectHull(GLfloat *xmin, GLfloat *xmax, + GLfloat *ymin, GLfloat *ymax, + GL2PStriangle *triangles, int cnt) +{ + int i, j; + + *xmin = triangles[0].vertex[0].xyz[0]; + *xmax = triangles[0].vertex[0].xyz[0]; + *ymin = triangles[0].vertex[0].xyz[1]; + *ymax = triangles[0].vertex[0].xyz[1]; + + for(i = 0; i < cnt; ++i){ + for(j = 0; j < 3; ++j){ + if(*xmin > triangles[i].vertex[j].xyz[0]) + *xmin = triangles[i].vertex[j].xyz[0]; + if(*xmax < triangles[i].vertex[j].xyz[0]) + *xmax = triangles[i].vertex[j].xyz[0]; + if(*ymin > triangles[i].vertex[j].xyz[1]) + *ymin = triangles[i].vertex[j].xyz[1]; + if(*ymax < triangles[i].vertex[j].xyz[1]) + *ymax = triangles[i].vertex[j].xyz[1]; + } + } +} + +/* Writes shaded triangle + gray == 0 means write RGB triangles + gray == 8 8bit-grayscale (for alpha masks) + gray == 16 16bit-grayscale (for alpha masks) */ + +static int gl2psPrintPDFShader(int obj, GL2PStriangle *triangles, + int size, int gray) +{ + int i, offs = 0, vertexbytes, done = 0; + GLfloat xmin, xmax, ymin, ymax; + + switch(gray){ + case 0: + vertexbytes = 1+4+4+1+1+1; + break; + case 8: + vertexbytes = 1+4+4+1; + break; + case 16: + vertexbytes = 1+4+4+2; + break; + default: + gray = 8; + vertexbytes = 1+4+4+1; + break; + } + + gl2psPDFRectHull(&xmin, &xmax, &ymin, &ymax, triangles, size); + + offs += fprintf(gl2ps->stream, + "%d 0 obj\n" + "<< " + "/ShadingType 4 " + "/ColorSpace %s " + "/BitsPerCoordinate 32 " + "/BitsPerComponent %d " + "/BitsPerFlag 8 " + "/Decode [%f %f %f %f 0 1 %s] ", + obj, + (gray) ? "/DeviceGray" : "/DeviceRGB", + (gray) ? gray : 8, + xmin, xmax, ymin, ymax, + (gray) ? "" : "0 1 0 1"); + +#if defined(GL2PS_HAVE_ZLIB) + if(gl2ps->options & GL2PS_COMPRESS){ + gl2psAllocCompress(vertexbytes * size * 3); + + for(i = 0; i < size; ++i) + gl2psPrintPDFShaderStreamData(&triangles[i], + xmax-xmin, ymax-ymin, xmin, ymin, + gl2psWriteBigEndianCompress, gray); + + if(Z_OK == gl2psDeflate() && 23 + gl2ps->compress->destLen < gl2ps->compress->srcLen){ + offs += gl2psPrintPDFCompressorType(); + offs += fprintf(gl2ps->stream, + "/Length %d " + ">>\n" + "stream\n", + (int)gl2ps->compress->destLen); + offs += gl2ps->compress->destLen * fwrite(gl2ps->compress->dest, + gl2ps->compress->destLen, + 1, gl2ps->stream); + done = 1; + } + gl2psFreeCompress(); + } +#endif + + if(!done){ + /* no compression, or too long after compression, or compress error + -> write non-compressed entry */ + offs += fprintf(gl2ps->stream, + "/Length %d " + ">>\n" + "stream\n", + vertexbytes * 3 * size); + for(i = 0; i < size; ++i) + offs += gl2psPrintPDFShaderStreamData(&triangles[i], + xmax-xmin, ymax-ymin, xmin, ymin, + gl2psWriteBigEndian, gray); + } + + offs += fprintf(gl2ps->stream, + "\nendstream\n" + "endobj\n"); + + return offs; +} + +/* Writes a XObject for a shaded triangle mask */ + +static int gl2psPrintPDFShaderMask(int obj, int childobj) +{ + int offs = 0, len; + + offs += fprintf(gl2ps->stream, + "%d 0 obj\n" + "<<\n" + "/Type /XObject\n" + "/Subtype /Form\n" + "/BBox [ %d %d %d %d ]\n" + "/Group \n<<\n/S /Transparency /CS /DeviceRGB\n" + ">>\n", + obj, + (int)gl2ps->viewport[0], (int)gl2ps->viewport[1], + (int)gl2ps->viewport[2], (int)gl2ps->viewport[3]); + + len = (childobj>0) + ? strlen("/TrSh sh\n") + (int)log10((double)childobj)+1 + : strlen("/TrSh0 sh\n"); + + offs += fprintf(gl2ps->stream, + "/Length %d\n" + ">>\n" + "stream\n", + len); + offs += fprintf(gl2ps->stream, + "/TrSh%d sh\n", + childobj); + offs += fprintf(gl2ps->stream, + "endstream\n" + "endobj\n"); + + return offs; +} + +/* Writes a Extended graphics state for a shaded triangle mask if + simplealpha ist true the childobj argument is ignored and a /ca + statement will be written instead */ + +static int gl2psPrintPDFShaderExtGS(int obj, int childobj) +{ + int offs = 0; + + offs += fprintf(gl2ps->stream, + "%d 0 obj\n" + "<<\n", + obj); + + offs += fprintf(gl2ps->stream, + "/SMask << /S /Alpha /G %d 0 R >> ", + childobj); + + offs += fprintf(gl2ps->stream, + ">>\n" + "endobj\n"); + return offs; +} + +/* a simple graphics state */ + +static int gl2psPrintPDFShaderSimpleExtGS(int obj, GLfloat alpha) +{ + int offs = 0; + + offs += fprintf(gl2ps->stream, + "%d 0 obj\n" + "<<\n" + "/ca %g" + ">>\n" + "endobj\n", + obj, alpha); + return offs; +} + +/* Similar groups of functions for pixmaps and text */ + +static int gl2psPrintPDFPixmapStreamData(GL2PSimage *im, + size_t (*action)(unsigned long data, + size_t size), + int gray) +{ + int x, y, shift; + GLfloat r, g, b, a; + + if(im->format != GL_RGBA && gray) + return 0; + + if(gray && gray != 8 && gray != 16) + gray = 8; + + gray /= 8; + + shift = (sizeof(unsigned long) - 1) * 8; + + for(y = 0; y < im->height; ++y){ + for(x = 0; x < im->width; ++x){ + a = gl2psGetRGB(im, x, y, &r, &g, &b); + if(im->format == GL_RGBA && gray){ + (*action)((unsigned long)(a * 255) << shift, gray); + } + else{ + (*action)((unsigned long)(r * 255) << shift, 1); + (*action)((unsigned long)(g * 255) << shift, 1); + (*action)((unsigned long)(b * 255) << shift, 1); + } + } + } + + switch(gray){ + case 0: return 3 * im->width * im->height; + case 1: return im->width * im->height; + case 2: return 2 * im->width * im->height; + default: return 3 * im->width * im->height; + } +} + +static int gl2psPrintPDFPixmap(int obj, int childobj, GL2PSimage *im, int gray) +{ + int offs = 0, done = 0, sigbytes = 3; + + if(gray && gray !=8 && gray != 16) + gray = 8; + + if(gray) + sigbytes = gray / 8; + + offs += fprintf(gl2ps->stream, + "%d 0 obj\n" + "<<\n" + "/Type /XObject\n" + "/Subtype /Image\n" + "/Width %d\n" + "/Height %d\n" + "/ColorSpace %s \n" + "/BitsPerComponent 8\n", + obj, + (int)im->width, (int)im->height, + (gray) ? "/DeviceGray" : "/DeviceRGB" ); + if(GL_RGBA == im->format && gray == 0){ + offs += fprintf(gl2ps->stream, + "/SMask %d 0 R\n", + childobj); + } + +#if defined(GL2PS_HAVE_ZLIB) + if(gl2ps->options & GL2PS_COMPRESS){ + gl2psAllocCompress((int)(im->width * im->height * sigbytes)); + + gl2psPrintPDFPixmapStreamData(im, gl2psWriteBigEndianCompress, gray); + + if(Z_OK == gl2psDeflate() && 23 + gl2ps->compress->destLen < gl2ps->compress->srcLen){ + offs += gl2psPrintPDFCompressorType(); + offs += fprintf(gl2ps->stream, + "/Length %d " + ">>\n" + "stream\n", + (int)gl2ps->compress->destLen); + offs += gl2ps->compress->destLen * fwrite(gl2ps->compress->dest, gl2ps->compress->destLen, + 1, gl2ps->stream); + done = 1; + } + gl2psFreeCompress(); + } +#endif + + if(!done){ + /* no compression, or too long after compression, or compress error + -> write non-compressed entry */ + offs += fprintf(gl2ps->stream, + "/Length %d " + ">>\n" + "stream\n", + (int)(im->width * im->height * sigbytes)); + offs += gl2psPrintPDFPixmapStreamData(im, gl2psWriteBigEndian, gray); + } + + offs += fprintf(gl2ps->stream, + "\nendstream\n" + "endobj\n"); + + return offs; +} + +static int gl2psPrintPDFText(int obj, GL2PSstring *s, int fontnumber) +{ + int offs = 0; + + offs += fprintf(gl2ps->stream, + "%d 0 obj\n" + "<<\n" + "/Type /Font\n" + "/Subtype /Type1\n" + "/Name /F%d\n" + "/BaseFont /%s\n" + "/Encoding /MacRomanEncoding\n" + ">>\n" + "endobj\n", + obj, fontnumber, s->fontname); + return offs; +} + +/* Write the physical objects */ + +static int gl2psPDFgroupListWriteObjects(int entryoffs) +{ + int i,j; + GL2PSprimitive *p = NULL; + GL2PSpdfgroup *gro; + int offs = entryoffs; + GL2PStriangle *triangles; + int size = 0; + + if(!gl2ps->pdfgrouplist) + return offs; + + for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ + gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist, i); + if(!gl2psListNbr(gro->ptrlist)) + continue; + p = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, 0); + switch(p->type){ + case GL2PS_POINT: + break; + case GL2PS_LINE: + break; + case GL2PS_TRIANGLE: + size = gl2psListNbr(gro->ptrlist); + triangles = (GL2PStriangle*)gl2psMalloc(sizeof(GL2PStriangle) * size); + for(j = 0; j < size; ++j){ + p = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); + gl2psFillTriangleFromPrimitive(&triangles[j], p, GL_TRUE); + } + if(triangles[0].prop & T_VAR_COLOR){ + gl2ps->xreflist[gro->shobjno] = offs; + offs += gl2psPrintPDFShader(gro->shobjno, triangles, size, 0); + } + if(triangles[0].prop & T_ALPHA_LESS_1){ + gl2ps->xreflist[gro->gsobjno] = offs; + offs += gl2psPrintPDFShaderSimpleExtGS(gro->gsobjno, triangles[0].vertex[0].rgba[3]); + } + if(triangles[0].prop & T_VAR_ALPHA){ + gl2ps->xreflist[gro->gsobjno] = offs; + offs += gl2psPrintPDFShaderExtGS(gro->gsobjno, gro->trgroupobjno); + gl2ps->xreflist[gro->trgroupobjno] = offs; + offs += gl2psPrintPDFShaderMask(gro->trgroupobjno, gro->maskshno); + gl2ps->xreflist[gro->maskshobjno] = offs; + offs += gl2psPrintPDFShader(gro->maskshobjno, triangles, size, 8); + } + gl2psFree(triangles); + break; + case GL2PS_PIXMAP: + gl2ps->xreflist[gro->imobjno] = offs; + offs += gl2psPrintPDFPixmap(gro->imobjno, gro->imobjno+1, p->data.image, 0); + if(p->data.image->format == GL_RGBA){ + gl2ps->xreflist[gro->imobjno+1] = offs; + offs += gl2psPrintPDFPixmap(gro->imobjno+1, -1, p->data.image, 8); + } + break; + case GL2PS_TEXT: + gl2ps->xreflist[gro->fontobjno] = offs; + offs += gl2psPrintPDFText(gro->fontobjno,p->data.text,gro->fontno); + break; + case GL2PS_SPECIAL : + /* alignment contains the format for which the special output text + is intended */ + if(p->data.text->alignment == GL2PS_PDF) + offs += fprintf(gl2ps->stream, "%s\n", p->data.text->str); + break; + default: + break; + } + } + return offs; +} + +/* All variable data has been written at this point and all required + functioninality has been gathered, so we can write now file footer + with cross reference table and trailer */ + +static void gl2psPrintPDFFooter(void) +{ + int i, offs; + + gl2psPDFgroupListInit(); + gl2psPDFgroupListWriteMainStream(); + + offs = gl2ps->xreflist[5] + gl2ps->streamlength; + offs += gl2psClosePDFDataStream(); + gl2ps->xreflist[5] = offs; + + offs += gl2psPrintPDFDataStreamLength(gl2ps->streamlength); + gl2ps->xreflist[6] = offs; + gl2ps->streamlength = 0; + + offs += gl2psPrintPDFOpenPage(); + offs += gl2psPDFgroupListWriteVariableResources(); + gl2ps->xreflist = (int*)gl2psRealloc(gl2ps->xreflist, + sizeof(int) * (gl2ps->objects_stack + 1)); + gl2ps->xreflist[7] = offs; + + offs += gl2psPrintPDFGSObject(); + gl2ps->xreflist[8] = offs; + + gl2ps->xreflist[gl2ps->objects_stack] = + gl2psPDFgroupListWriteObjects(gl2ps->xreflist[8]); + + /* Start cross reference table. The file has to been opened in + binary mode to preserve the 20 digit string length! */ + fprintf(gl2ps->stream, + "xref\n" + "0 %d\n" + "%010d 65535 f \n", gl2ps->objects_stack, 0); + + for(i = 1; i < gl2ps->objects_stack; ++i) + fprintf(gl2ps->stream, "%010d 00000 n \n", gl2ps->xreflist[i]); + + fprintf(gl2ps->stream, + "trailer\n" + "<<\n" + "/Size %d\n" + "/Info 1 0 R\n" + "/Root 2 0 R\n" + ">>\n" + "startxref\n%d\n" + "%%%%EOF\n", + gl2ps->objects_stack, gl2ps->xreflist[gl2ps->objects_stack]); + + /* Free auxiliary lists and arrays */ + gl2psFree(gl2ps->xreflist); + gl2psListAction(gl2ps->pdfprimlist, gl2psFreePrimitive); + gl2psListDelete(gl2ps->pdfprimlist); + gl2psPDFgroupListDelete(); + +#if defined(GL2PS_HAVE_ZLIB) + if(gl2ps->options & GL2PS_COMPRESS){ + gl2psFreeCompress(); + gl2psFree(gl2ps->compress); + gl2ps->compress = NULL; + } +#endif +} + +/* PDF begin viewport */ + +static void gl2psPrintPDFBeginViewport(GLint viewport[4]) +{ + int offs = 0; + GLint index; + GLfloat rgba[4]; + int x = viewport[0], y = viewport[1], w = viewport[2], h = viewport[3]; + + glRenderMode(GL_FEEDBACK); + + if(gl2ps->header){ + gl2psPrintPDFHeader(); + gl2ps->header = GL_FALSE; + } + + offs += gl2psPrintf("q\n"); + + if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ + if(gl2ps->colormode == GL_RGBA || gl2ps->colorsize == 0){ + glGetFloatv(GL_COLOR_CLEAR_VALUE, rgba); + } + else{ + glGetIntegerv(GL_INDEX_CLEAR_VALUE, &index); + rgba[0] = gl2ps->colormap[index][0]; + rgba[1] = gl2ps->colormap[index][1]; + rgba[2] = gl2ps->colormap[index][2]; + rgba[3] = 1.0F; + } + offs += gl2psPrintPDFFillColor(rgba); + offs += gl2psPrintf("%d %d %d %d re\n" + "W\n" + "f\n", + x, y, w, h); + } + else{ + offs += gl2psPrintf("%d %d %d %d re\n" + "W\n" + "n\n", + x, y, w, h); + } + + gl2ps->streamlength += offs; +} + +static GLint gl2psPrintPDFEndViewport(void) +{ + GLint res; + + res = gl2psPrintPrimitives(); + gl2ps->streamlength += gl2psPrintf("Q\n"); + return res; +} + +static void gl2psPrintPDFFinalPrimitive(void) +{ +} + +/* definition of the PDF backend */ + +static GL2PSbackend gl2psPDF = { + gl2psPrintPDFHeader, + gl2psPrintPDFFooter, + gl2psPrintPDFBeginViewport, + gl2psPrintPDFEndViewport, + gl2psPrintPDFPrimitive, + gl2psPrintPDFFinalPrimitive, + "pdf", + "Portable Document Format" +}; + +/********************************************************************* + * + * SVG routines + * + *********************************************************************/ + +static void gl2psSVGGetCoordsAndColors(int n, GL2PSvertex *verts, + GL2PSxyz *xyz, GL2PSrgba *rgba) +{ + int i, j; + + for(i = 0; i < n; i++){ + xyz[i][0] = verts[i].xyz[0]; + xyz[i][1] = gl2ps->viewport[3] - verts[i].xyz[1]; + xyz[i][2] = 0.0F; + for(j = 0; j < 4; j++) + rgba[i][j] = verts[i].rgba[j]; + } +} + +static void gl2psSVGGetColorString(GL2PSrgba rgba, char str[32]) +{ + int r = (int)(255. * rgba[0]); + int g = (int)(255. * rgba[1]); + int b = (int)(255. * rgba[2]); + int rc = (r < 0) ? 0 : (r > 255) ? 255 : r; + int gc = (g < 0) ? 0 : (g > 255) ? 255 : g; + int bc = (b < 0) ? 0 : (b > 255) ? 255 : b; + sprintf(str, "#%2.2x%2.2x%2.2x", rc, gc, bc); +} + +static void gl2psPrintSVGHeader(void) +{ + int x, y, width, height; + char col[32]; + time_t now; + + time(&now); + + if (gl2ps->options & GL2PS_LANDSCAPE){ + x = (int)gl2ps->viewport[1]; + y = (int)gl2ps->viewport[0]; + width = (int)gl2ps->viewport[3]; + height = (int)gl2ps->viewport[2]; + } + else{ + x = (int)gl2ps->viewport[0]; + y = (int)gl2ps->viewport[1]; + width = (int)gl2ps->viewport[2]; + height = (int)gl2ps->viewport[3]; + } + + /* Compressed SVG files (.svgz) are simply gzipped SVG files */ + gl2psPrintGzipHeader(); + + gl2psPrintf("\n"); + gl2psPrintf("\n", + width, height, x, y, width, height); + gl2psPrintf("%s\n", gl2ps->title); + gl2psPrintf("\n"); + gl2psPrintf("Creator: GL2PS %d.%d.%d%s, %s\n" + "For: %s\n" + "CreationDate: %s", + GL2PS_MAJOR_VERSION, GL2PS_MINOR_VERSION, GL2PS_PATCH_VERSION, + GL2PS_EXTRA_VERSION, GL2PS_COPYRIGHT, gl2ps->producer, ctime(&now)); + gl2psPrintf("\n"); + gl2psPrintf("\n"); + gl2psPrintf("\n"); + + if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ + gl2psSVGGetColorString(gl2ps->bgcolor, col); + gl2psPrintf("\n", col, + (int)gl2ps->viewport[0], (int)gl2ps->viewport[1], + (int)gl2ps->viewport[2], (int)gl2ps->viewport[1], + (int)gl2ps->viewport[2], (int)gl2ps->viewport[3], + (int)gl2ps->viewport[0], (int)gl2ps->viewport[3]); + } + + /* group all the primitives and disable antialiasing */ + gl2psPrintf("\n"); +} + +static void gl2psPrintSVGSmoothTriangle(GL2PSxyz xyz[3], GL2PSrgba rgba[3]) +{ + int i; + GL2PSxyz xyz2[3]; + GL2PSrgba rgba2[3]; + char col[32]; + + /* Apparently there is no easy way to do Gouraud shading in SVG + without explicitly pre-defining gradients, so for now we just do + recursive subdivision */ + + if(gl2psSameColorThreshold(3, rgba, gl2ps->threshold)){ + gl2psSVGGetColorString(rgba[0], col); + gl2psPrintf("\n", xyz[0][0], xyz[0][1], + xyz[1][0], xyz[1][1], xyz[2][0], xyz[2][1]); + } + else{ + /* subdivide into 4 subtriangles */ + for(i = 0; i < 3; i++){ + xyz2[0][i] = xyz[0][i]; + xyz2[1][i] = 0.5F * (xyz[0][i] + xyz[1][i]); + xyz2[2][i] = 0.5F * (xyz[0][i] + xyz[2][i]); + } + for(i = 0; i < 4; i++){ + rgba2[0][i] = rgba[0][i]; + rgba2[1][i] = 0.5F * (rgba[0][i] + rgba[1][i]); + rgba2[2][i] = 0.5F * (rgba[0][i] + rgba[2][i]); + } + gl2psPrintSVGSmoothTriangle(xyz2, rgba2); + for(i = 0; i < 3; i++){ + xyz2[0][i] = 0.5F * (xyz[0][i] + xyz[1][i]); + xyz2[1][i] = xyz[1][i]; + xyz2[2][i] = 0.5F * (xyz[1][i] + xyz[2][i]); + } + for(i = 0; i < 4; i++){ + rgba2[0][i] = 0.5F * (rgba[0][i] + rgba[1][i]); + rgba2[1][i] = rgba[1][i]; + rgba2[2][i] = 0.5F * (rgba[1][i] + rgba[2][i]); + } + gl2psPrintSVGSmoothTriangle(xyz2, rgba2); + for(i = 0; i < 3; i++){ + xyz2[0][i] = 0.5F * (xyz[0][i] + xyz[2][i]); + xyz2[1][i] = xyz[2][i]; + xyz2[2][i] = 0.5F * (xyz[1][i] + xyz[2][i]); + } + for(i = 0; i < 4; i++){ + rgba2[0][i] = 0.5F * (rgba[0][i] + rgba[2][i]); + rgba2[1][i] = rgba[2][i]; + rgba2[2][i] = 0.5F * (rgba[1][i] + rgba[2][i]); + } + gl2psPrintSVGSmoothTriangle(xyz2, rgba2); + for(i = 0; i < 3; i++){ + xyz2[0][i] = 0.5F * (xyz[0][i] + xyz[1][i]); + xyz2[1][i] = 0.5F * (xyz[1][i] + xyz[2][i]); + xyz2[2][i] = 0.5F * (xyz[0][i] + xyz[2][i]); + } + for(i = 0; i < 4; i++){ + rgba2[0][i] = 0.5F * (rgba[0][i] + rgba[1][i]); + rgba2[1][i] = 0.5F * (rgba[1][i] + rgba[2][i]); + rgba2[2][i] = 0.5F * (rgba[0][i] + rgba[2][i]); + } + gl2psPrintSVGSmoothTriangle(xyz2, rgba2); + } +} + +static void gl2psPrintSVGDash(GLushort pattern, GLint factor) +{ + int i, n, array[10]; + + if(!pattern || !factor) return; /* solid line */ + + gl2psParseStipplePattern(pattern, factor, &n, array); + gl2psPrintf("stroke-dasharray=\""); + for(i = 0; i < n; i++){ + if(i) gl2psPrintf(","); + gl2psPrintf("%d", array[i]); + } + gl2psPrintf("\" "); +} + +static void gl2psEndSVGLine(void) +{ + int i; + if(gl2ps->lastvertex.rgba[0] >= 0.){ + gl2psPrintf("%g,%g\"/>\n", gl2ps->lastvertex.xyz[0], + gl2ps->viewport[3] - gl2ps->lastvertex.xyz[1]); + for(i = 0; i < 3; i++) + gl2ps->lastvertex.xyz[i] = -1.; + for(i = 0; i < 4; i++) + gl2ps->lastvertex.rgba[i] = -1.; + } +} + +static void gl2psPrintSVGPixmap(GLfloat x, GLfloat y, GL2PSimage *pixmap) +{ +#if defined(GL2PS_HAVE_LIBPNG) + GL2PSlist *png; + unsigned char c; + int i; + + /* The only image types supported by the SVG standard are JPEG, PNG + and SVG. Here we choose PNG, and since we want to embed the image + directly in the SVG stream (and not link to an external image + file), we need to encode the pixmap into PNG in memory, then + encode it into base64. */ + + png = gl2psListCreate(pixmap->width * pixmap->height * 3, 1000, + sizeof(unsigned char)); + gl2psConvertPixmapToPNG(pixmap, png); + gl2psListEncodeBase64(png); + gl2psPrintf("height, pixmap->width, pixmap->height); + gl2psPrintf("xlink:href=\"data:image/png;base64,"); + for(i = 0; i < gl2psListNbr(png); i++){ + gl2psListRead(png, i, &c); + gl2psPrintf("%c", c); + } + gl2psPrintf("\"/>\n"); + gl2psListDelete(png); +#else + gl2psMsg(GL2PS_WARNING, "GL2PS must be compiled with PNG support in " + "order to embed images in SVG streams"); +#endif +} + +static void gl2psPrintSVGPrimitive(void *data) +{ + GL2PSprimitive *prim; + GL2PSxyz xyz[4]; + GL2PSrgba rgba[4]; + char col[32]; + int newline; + + prim = *(GL2PSprimitive**)data; + + if((gl2ps->options & GL2PS_OCCLUSION_CULL) && prim->culled) return; + + /* We try to draw connected lines as a single path to get nice line + joins and correct stippling. So if the primitive to print is not + a line we must first finish the current line (if any): */ + if(prim->type != GL2PS_LINE) gl2psEndSVGLine(); + + gl2psSVGGetCoordsAndColors(prim->numverts, prim->verts, xyz, rgba); + + switch(prim->type){ + case GL2PS_POINT : + gl2psSVGGetColorString(rgba[0], col); + gl2psPrintf("\n", + xyz[0][0], xyz[0][1], 0.5 * prim->width); + break; + case GL2PS_LINE : + if(!gl2psSamePosition(gl2ps->lastvertex.xyz, prim->verts[0].xyz) || + !gl2psSameColor(gl2ps->lastrgba, prim->verts[0].rgba) || + gl2ps->lastlinewidth != prim->width || + gl2ps->lastpattern != prim->pattern || + gl2ps->lastfactor != prim->factor){ + /* End the current line if the new segment does not start where + the last one ended, or if the color, the width or the + stippling have changed (we will need to use multi-point + gradients for smooth-shaded lines) */ + gl2psEndSVGLine(); + newline = 1; + } + else{ + newline = 0; + } + gl2ps->lastvertex = prim->verts[1]; + gl2psSetLastColor(prim->verts[0].rgba); + gl2ps->lastlinewidth = prim->width; + gl2ps->lastpattern = prim->pattern; + gl2ps->lastfactor = prim->factor; + if(newline){ + gl2psSVGGetColorString(rgba[0], col); + gl2psPrintf("width); + if(rgba[0][3] < 1.0F) gl2psPrintf("stroke-opacity=\"%g\" ", rgba[0][3]); + gl2psPrintSVGDash(prim->pattern, prim->factor); + gl2psPrintf("points=\"%g,%g ", xyz[0][0], xyz[0][1]); + } + else{ + gl2psPrintf("%g,%g ", xyz[0][0], xyz[0][1]); + } + break; + case GL2PS_TRIANGLE : + gl2psPrintSVGSmoothTriangle(xyz, rgba); + break; + case GL2PS_QUADRANGLE : + gl2psMsg(GL2PS_WARNING, "There should not be any quad left to print"); + break; + case GL2PS_PIXMAP : + gl2psPrintSVGPixmap(xyz[0][0], xyz[0][1], prim->data.image); + break; + case GL2PS_TEXT : + gl2psSVGGetColorString(prim->verts[0].rgba, col); + gl2psPrintf("data.text->fontsize); + if(prim->data.text->angle) + gl2psPrintf("transform=\"rotate(%g, %g, %g)\" ", + -prim->data.text->angle, xyz[0][0], xyz[0][1]); + if(!strcmp(prim->data.text->fontname, "Times-Roman")) + gl2psPrintf("font-family=\"Times\">"); + else if(!strcmp(prim->data.text->fontname, "Times-Bold")) + gl2psPrintf("font-family=\"Times\" font-weight=\"bold\">"); + else if(!strcmp(prim->data.text->fontname, "Times-Italic")) + gl2psPrintf("font-family=\"Times\" font-style=\"italic\">"); + else if(!strcmp(prim->data.text->fontname, "Times-BoldItalic")) + gl2psPrintf("font-family=\"Times\" font-style=\"italic\" font-weight=\"bold\">"); + else if(!strcmp(prim->data.text->fontname, "Helvetica-Bold")) + gl2psPrintf("font-family=\"Helvetica\" font-weight=\"bold\">"); + else if(!strcmp(prim->data.text->fontname, "Helvetica-Oblique")) + gl2psPrintf("font-family=\"Helvetica\" font-style=\"oblique\">"); + else if(!strcmp(prim->data.text->fontname, "Helvetica-BoldOblique")) + gl2psPrintf("font-family=\"Helvetica\" font-style=\"oblique\" font-weight=\"bold\">"); + else if(!strcmp(prim->data.text->fontname, "Courier-Bold")) + gl2psPrintf("font-family=\"Courier\" font-weight=\"bold\">"); + else if(!strcmp(prim->data.text->fontname, "Courier-Oblique")) + gl2psPrintf("font-family=\"Courier\" font-style=\"oblique\">"); + else if(!strcmp(prim->data.text->fontname, "Courier-BoldOblique")) + gl2psPrintf("font-family=\"Courier\" font-style=\"oblique\" font-weight=\"bold\">"); + else + gl2psPrintf("font-family=\"%s\">", prim->data.text->fontname); + gl2psPrintf("%s\n", prim->data.text->str); + break; + case GL2PS_SPECIAL : + /* alignment contains the format for which the special output text + is intended */ + if(prim->data.text->alignment == GL2PS_SVG) + gl2psPrintf("%s\n", prim->data.text->str); + break; + default : + break; + } +} + +static void gl2psPrintSVGFooter(void) +{ + gl2psPrintf("\n"); + gl2psPrintf("\n"); + + gl2psPrintGzipFooter(); +} + +static void gl2psPrintSVGBeginViewport(GLint viewport[4]) +{ + GLint index; + char col[32]; + GLfloat rgba[4]; + int x = viewport[0], y = viewport[1], w = viewport[2], h = viewport[3]; + + glRenderMode(GL_FEEDBACK); + + if(gl2ps->header){ + gl2psPrintSVGHeader(); + gl2ps->header = GL_FALSE; + } + + if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ + if(gl2ps->colormode == GL_RGBA || gl2ps->colorsize == 0){ + glGetFloatv(GL_COLOR_CLEAR_VALUE, rgba); + } + else{ + glGetIntegerv(GL_INDEX_CLEAR_VALUE, &index); + rgba[0] = gl2ps->colormap[index][0]; + rgba[1] = gl2ps->colormap[index][1]; + rgba[2] = gl2ps->colormap[index][2]; + rgba[3] = 1.0F; + } + gl2psSVGGetColorString(rgba, col); + gl2psPrintf("\n", col, + x, gl2ps->viewport[3] - y, + x + w, gl2ps->viewport[3] - y, + x + w, gl2ps->viewport[3] - (y + h), + x, gl2ps->viewport[3] - (y + h)); + } + + gl2psPrintf("\n", x, y, w, h); + gl2psPrintf(" \n", + x, gl2ps->viewport[3] - y, + x + w, gl2ps->viewport[3] - y, + x + w, gl2ps->viewport[3] - (y + h), + x, gl2ps->viewport[3] - (y + h)); + gl2psPrintf("\n"); + gl2psPrintf("\n", x, y, w, h); +} + +static GLint gl2psPrintSVGEndViewport(void) +{ + GLint res; + + res = gl2psPrintPrimitives(); + gl2psPrintf("\n"); + return res; +} + +static void gl2psPrintSVGFinalPrimitive(void) +{ + /* End any remaining line, if any */ + gl2psEndSVGLine(); +} + +/* definition of the SVG backend */ + +static GL2PSbackend gl2psSVG = { + gl2psPrintSVGHeader, + gl2psPrintSVGFooter, + gl2psPrintSVGBeginViewport, + gl2psPrintSVGEndViewport, + gl2psPrintSVGPrimitive, + gl2psPrintSVGFinalPrimitive, + "svg", + "Scalable Vector Graphics" +}; + +/********************************************************************* + * + * PGF routines + * + *********************************************************************/ + +static void gl2psPrintPGFColor(GL2PSrgba rgba) +{ + if(!gl2psSameColor(gl2ps->lastrgba, rgba)){ + gl2psSetLastColor(rgba); + fprintf(gl2ps->stream, "\\color[rgb]{%f,%f,%f}\n", rgba[0], rgba[1], rgba[2]); + } +} + +static void gl2psPrintPGFHeader(void) +{ + time_t now; + + time(&now); + + fprintf(gl2ps->stream, + "%% Title: %s\n" + "%% Creator: GL2PS %d.%d.%d%s, %s\n" + "%% For: %s\n" + "%% CreationDate: %s", + gl2ps->title, GL2PS_MAJOR_VERSION, GL2PS_MINOR_VERSION, + GL2PS_PATCH_VERSION, GL2PS_EXTRA_VERSION, GL2PS_COPYRIGHT, + gl2ps->producer, ctime(&now)); + + fprintf(gl2ps->stream, "\\begin{pgfpicture}\n"); + if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ + gl2psPrintPGFColor(gl2ps->bgcolor); + fprintf(gl2ps->stream, + "\\pgfpathrectanglecorners{" + "\\pgfpoint{%dpt}{%dpt}}{\\pgfpoint{%dpt}{%dpt}}\n" + "\\pgfusepath{fill}\n", + (int)gl2ps->viewport[0], (int)gl2ps->viewport[1], + (int)gl2ps->viewport[2], (int)gl2ps->viewport[3]); + } +} + +static void gl2psPrintPGFDash(GLushort pattern, GLint factor) +{ + int i, n, array[10]; + + if(pattern == gl2ps->lastpattern && factor == gl2ps->lastfactor) + return; + + gl2ps->lastpattern = pattern; + gl2ps->lastfactor = factor; + + if(!pattern || !factor){ + /* solid line */ + fprintf(gl2ps->stream, "\\pgfsetdash{}{0pt}\n"); + } + else{ + gl2psParseStipplePattern(pattern, factor, &n, array); + fprintf(gl2ps->stream, "\\pgfsetdash{"); + for(i = 0; i < n; i++) fprintf(gl2ps->stream, "{%dpt}", array[i]); + fprintf(gl2ps->stream, "}{0pt}\n"); + } +} + +static const char *gl2psPGFTextAlignment(int align) +{ + switch(align){ + case GL2PS_TEXT_C : return "center"; + case GL2PS_TEXT_CL : return "west"; + case GL2PS_TEXT_CR : return "east"; + case GL2PS_TEXT_B : return "south"; + case GL2PS_TEXT_BR : return "south east"; + case GL2PS_TEXT_T : return "north"; + case GL2PS_TEXT_TL : return "north west"; + case GL2PS_TEXT_TR : return "north east"; + case GL2PS_TEXT_BL : + default : return "south west"; + } +} + +static void gl2psPrintPGFPrimitive(void *data) +{ + GL2PSprimitive *prim; + + prim = *(GL2PSprimitive**)data; + + switch(prim->type){ + case GL2PS_POINT : + /* Points in openGL are rectangular */ + gl2psPrintPGFColor(prim->verts[0].rgba); + fprintf(gl2ps->stream, + "\\pgfpathrectangle{\\pgfpoint{%fpt}{%fpt}}" + "{\\pgfpoint{%fpt}{%fpt}}\n\\pgfusepath{fill}\n", + prim->verts[0].xyz[0]-0.5*prim->width, + prim->verts[0].xyz[1]-0.5*prim->width, + prim->width,prim->width); + break; + case GL2PS_LINE : + gl2psPrintPGFColor(prim->verts[0].rgba); + if(gl2ps->lastlinewidth != prim->width){ + gl2ps->lastlinewidth = prim->width; + fprintf(gl2ps->stream, "\\pgfsetlinewidth{%fpt}\n", gl2ps->lastlinewidth); + } + gl2psPrintPGFDash(prim->pattern, prim->factor); + fprintf(gl2ps->stream, + "\\pgfpathmoveto{\\pgfpoint{%fpt}{%fpt}}\n" + "\\pgflineto{\\pgfpoint{%fpt}{%fpt}}\n" + "\\pgfusepath{stroke}\n", + prim->verts[1].xyz[0], prim->verts[1].xyz[1], + prim->verts[0].xyz[0], prim->verts[0].xyz[1]); + break; + case GL2PS_TRIANGLE : + if(gl2ps->lastlinewidth != 0){ + gl2ps->lastlinewidth = 0; + fprintf(gl2ps->stream, "\\pgfsetlinewidth{0.01pt}\n"); + } + gl2psPrintPGFColor(prim->verts[0].rgba); + fprintf(gl2ps->stream, + "\\pgfpathmoveto{\\pgfpoint{%fpt}{%fpt}}\n" + "\\pgflineto{\\pgfpoint{%fpt}{%fpt}}\n" + "\\pgflineto{\\pgfpoint{%fpt}{%fpt}}\n" + "\\pgfpathclose\n" + "\\pgfusepath{fill,stroke}\n", + prim->verts[2].xyz[0], prim->verts[2].xyz[1], + prim->verts[1].xyz[0], prim->verts[1].xyz[1], + prim->verts[0].xyz[0], prim->verts[0].xyz[1]); + break; + case GL2PS_TEXT : + fprintf(gl2ps->stream, "{\n\\pgftransformshift{\\pgfpoint{%fpt}{%fpt}}\n", + prim->verts[0].xyz[0], prim->verts[0].xyz[1]); + + if(prim->data.text->angle) + fprintf(gl2ps->stream, "\\pgftransformrotate{%f}{", prim->data.text->angle); + + fprintf(gl2ps->stream, "\\pgfnode{rectangle}{%s}{\\fontsize{%d}{0}\\selectfont", + gl2psPGFTextAlignment(prim->data.text->alignment), + prim->data.text->fontsize); + + fprintf(gl2ps->stream, "\\textcolor[rgb]{%g,%g,%g}{{%s}}", + prim->verts[0].rgba[0], prim->verts[0].rgba[1], + prim->verts[0].rgba[2], prim->data.text->str); + + fprintf(gl2ps->stream, "}{}{\\pgfusepath{discard}}}\n"); + break; + case GL2PS_SPECIAL : + /* alignment contains the format for which the special output text + is intended */ + if (prim->data.text->alignment == GL2PS_PGF) + fprintf(gl2ps->stream, "%s\n", prim->data.text->str); + break; + default : + break; + } +} + +static void gl2psPrintPGFFooter(void) +{ + fprintf(gl2ps->stream, "\\end{pgfpicture}\n"); +} + +static void gl2psPrintPGFBeginViewport(GLint viewport[4]) +{ + GLint index; + GLfloat rgba[4]; + int x = viewport[0], y = viewport[1], w = viewport[2], h = viewport[3]; + + glRenderMode(GL_FEEDBACK); + + if(gl2ps->header){ + gl2psPrintPGFHeader(); + gl2ps->header = GL_FALSE; + } + + fprintf(gl2ps->stream, "\\begin{pgfscope}\n"); + if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ + if(gl2ps->colormode == GL_RGBA || gl2ps->colorsize == 0){ + glGetFloatv(GL_COLOR_CLEAR_VALUE, rgba); + } + else{ + glGetIntegerv(GL_INDEX_CLEAR_VALUE, &index); + rgba[0] = gl2ps->colormap[index][0]; + rgba[1] = gl2ps->colormap[index][1]; + rgba[2] = gl2ps->colormap[index][2]; + rgba[3] = 1.0F; + } + gl2psPrintPGFColor(rgba); + fprintf(gl2ps->stream, + "\\pgfpathrectangle{\\pgfpoint{%dpt}{%dpt}}" + "{\\pgfpoint{%dpt}{%dpt}}\n" + "\\pgfusepath{fill}\n", + x, y, w, h); + } + + fprintf(gl2ps->stream, + "\\pgfpathrectangle{\\pgfpoint{%dpt}{%dpt}}" + "{\\pgfpoint{%dpt}{%dpt}}\n" + "\\pgfusepath{clip}\n", + x, y, w, h); +} + +static GLint gl2psPrintPGFEndViewport(void) +{ + GLint res; + res = gl2psPrintPrimitives(); + fprintf(gl2ps->stream, "\\end{pgfscope}\n"); + return res; +} + +static void gl2psPrintPGFFinalPrimitive(void) +{ +} + +/* definition of the PGF backend */ + +static GL2PSbackend gl2psPGF = { + gl2psPrintPGFHeader, + gl2psPrintPGFFooter, + gl2psPrintPGFBeginViewport, + gl2psPrintPGFEndViewport, + gl2psPrintPGFPrimitive, + gl2psPrintPGFFinalPrimitive, + "tex", + "PGF Latex Graphics" +}; + +/********************************************************************* + * + * General primitive printing routine + * + *********************************************************************/ + +/* Warning: the ordering of the backends must match the format + #defines in gl2ps.h */ + +static GL2PSbackend *gl2psbackends[] = { + &gl2psPS, /* 0 */ + &gl2psEPS, /* 1 */ + &gl2psTEX, /* 2 */ + &gl2psPDF, /* 3 */ + &gl2psSVG, /* 4 */ + &gl2psPGF /* 5 */ +}; + +static void gl2psComputeTightBoundingBox(void *data) +{ + GL2PSprimitive *prim; + int i; + + prim = *(GL2PSprimitive**)data; + + for(i = 0; i < prim->numverts; i++){ + if(prim->verts[i].xyz[0] < gl2ps->viewport[0]) + gl2ps->viewport[0] = (GLint)prim->verts[i].xyz[0]; + if(prim->verts[i].xyz[0] > gl2ps->viewport[2]) + gl2ps->viewport[2] = (GLint)(prim->verts[i].xyz[0] + 0.5F); + if(prim->verts[i].xyz[1] < gl2ps->viewport[1]) + gl2ps->viewport[1] = (GLint)prim->verts[i].xyz[1]; + if(prim->verts[i].xyz[1] > gl2ps->viewport[3]) + gl2ps->viewport[3] = (GLint)(prim->verts[i].xyz[1] + 0.5F); + } +} + +static GLint gl2psPrintPrimitives(void) +{ + GL2PSbsptree *root; + GL2PSxyz eye = {0.0F, 0.0F, 100.0F * GL2PS_ZSCALE}; + GLint used; + + used = glRenderMode(GL_RENDER); + + if(used < 0){ + gl2psMsg(GL2PS_INFO, "OpenGL feedback buffer overflow"); + return GL2PS_OVERFLOW; + } + + if(used > 0) + gl2psParseFeedbackBuffer(used); + + gl2psRescaleAndOffset(); + + if(gl2ps->header){ + if(gl2psListNbr(gl2ps->primitives) && + (gl2ps->options & GL2PS_TIGHT_BOUNDING_BOX)){ + gl2ps->viewport[0] = gl2ps->viewport[1] = 100000; + gl2ps->viewport[2] = gl2ps->viewport[3] = -100000; + gl2psListAction(gl2ps->primitives, gl2psComputeTightBoundingBox); + } + (gl2psbackends[gl2ps->format]->printHeader)(); + gl2ps->header = GL_FALSE; + } + + if(!gl2psListNbr(gl2ps->primitives)){ + /* empty feedback buffer and/or nothing else to print */ + return GL2PS_NO_FEEDBACK; + } + + switch(gl2ps->sort){ + case GL2PS_NO_SORT : + gl2psListAction(gl2ps->primitives, gl2psbackends[gl2ps->format]->printPrimitive); + gl2psListAction(gl2ps->primitives, gl2psFreePrimitive); + /* reset the primitive list, waiting for the next viewport */ + gl2psListReset(gl2ps->primitives); + break; + case GL2PS_SIMPLE_SORT : + gl2psListSort(gl2ps->primitives, gl2psCompareDepth); + if(gl2ps->options & GL2PS_OCCLUSION_CULL){ + gl2psListActionInverse(gl2ps->primitives, gl2psAddInImageTree); + gl2psFreeBspImageTree(&gl2ps->imagetree); + } + gl2psListAction(gl2ps->primitives, gl2psbackends[gl2ps->format]->printPrimitive); + gl2psListAction(gl2ps->primitives, gl2psFreePrimitive); + /* reset the primitive list, waiting for the next viewport */ + gl2psListReset(gl2ps->primitives); + break; + case GL2PS_BSP_SORT : + root = (GL2PSbsptree*)gl2psMalloc(sizeof(GL2PSbsptree)); + gl2psBuildBspTree(root, gl2ps->primitives); + if(GL_TRUE == gl2ps->boundary) gl2psBuildPolygonBoundary(root); + if(gl2ps->options & GL2PS_OCCLUSION_CULL){ + gl2psTraverseBspTree(root, eye, -GL2PS_EPSILON, gl2psLess, + gl2psAddInImageTree, 1); + gl2psFreeBspImageTree(&gl2ps->imagetree); + } + gl2psTraverseBspTree(root, eye, GL2PS_EPSILON, gl2psGreater, + gl2psbackends[gl2ps->format]->printPrimitive, 0); + gl2psFreeBspTree(&root); + /* reallocate the primitive list (it's been deleted by + gl2psBuildBspTree) in case there is another viewport */ + gl2ps->primitives = gl2psListCreate(500, 500, sizeof(GL2PSprimitive*)); + break; + } + gl2psbackends[gl2ps->format]->printFinalPrimitive(); + + return GL2PS_SUCCESS; +} + +/********************************************************************* + * + * Public routines + * + *********************************************************************/ + +GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer, + GLint viewport[4], GLint format, GLint sort, + GLint options, GLint colormode, + GLint colorsize, GL2PSrgba *colormap, + GLint nr, GLint ng, GLint nb, GLint buffersize, + FILE *stream, const char *filename) +{ + GLint index; + int i; + + if(gl2ps){ + gl2psMsg(GL2PS_ERROR, "gl2psBeginPage called in wrong program state"); + return GL2PS_ERROR; + } + + gl2ps = (GL2PScontext*)gl2psMalloc(sizeof(GL2PScontext)); + + if(format >= 0 && format < (GLint)(sizeof(gl2psbackends) / sizeof(gl2psbackends[0]))){ + gl2ps->format = format; + } + else { + gl2psMsg(GL2PS_ERROR, "Unknown output format: %d", format); + gl2psFree(gl2ps); + gl2ps = NULL; + return GL2PS_ERROR; + } + + switch(sort){ + case GL2PS_NO_SORT : + case GL2PS_SIMPLE_SORT : + case GL2PS_BSP_SORT : + gl2ps->sort = sort; + break; + default : + gl2psMsg(GL2PS_ERROR, "Unknown sorting algorithm: %d", sort); + gl2psFree(gl2ps); + gl2ps = NULL; + return GL2PS_ERROR; + } + + if(stream){ + gl2ps->stream = stream; + } + else{ + gl2psMsg(GL2PS_ERROR, "Bad file pointer"); + gl2psFree(gl2ps); + gl2ps = NULL; + return GL2PS_ERROR; + } + + gl2ps->header = GL_TRUE; + gl2ps->maxbestroot = 10; + gl2ps->options = options; + gl2ps->compress = NULL; + gl2ps->imagemap_head = NULL; + gl2ps->imagemap_tail = NULL; + + if(gl2ps->options & GL2PS_USE_CURRENT_VIEWPORT){ + glGetIntegerv(GL_VIEWPORT, gl2ps->viewport); + } + else{ + for(i = 0; i < 4; i++){ + gl2ps->viewport[i] = viewport[i]; + } + } + + if(!gl2ps->viewport[2] || !gl2ps->viewport[3]){ + gl2psMsg(GL2PS_ERROR, "Incorrect viewport (x=%d, y=%d, width=%d, height=%d)", + gl2ps->viewport[0], gl2ps->viewport[1], + gl2ps->viewport[2], gl2ps->viewport[3]); + gl2psFree(gl2ps); + gl2ps = NULL; + return GL2PS_ERROR; + } + + gl2ps->threshold[0] = nr ? 1.0F / (GLfloat)nr : 0.064F; + gl2ps->threshold[1] = ng ? 1.0F / (GLfloat)ng : 0.034F; + gl2ps->threshold[2] = nb ? 1.0F / (GLfloat)nb : 0.100F; + gl2ps->colormode = colormode; + gl2ps->buffersize = buffersize > 0 ? buffersize : 2048 * 2048; + for(i = 0; i < 3; i++){ + gl2ps->lastvertex.xyz[i] = -1.0F; + } + for(i = 0; i < 4; i++){ + gl2ps->lastvertex.rgba[i] = -1.0F; + gl2ps->lastrgba[i] = -1.0F; + } + gl2ps->lastlinewidth = -1.0F; + gl2ps->lastpattern = 0; + gl2ps->lastfactor = 0; + gl2ps->imagetree = NULL; + gl2ps->primitivetoadd = NULL; + gl2ps->zerosurfacearea = GL_FALSE; + gl2ps->pdfprimlist = NULL; + gl2ps->pdfgrouplist = NULL; + gl2ps->xreflist = NULL; + + /* get default blending mode from current OpenGL state (enabled by + default for SVG) */ + gl2ps->blending = (gl2ps->format == GL2PS_SVG) ? GL_TRUE : glIsEnabled(GL_BLEND); + glGetIntegerv(GL_BLEND_SRC, &gl2ps->blendfunc[0]); + glGetIntegerv(GL_BLEND_DST, &gl2ps->blendfunc[1]); + + if(gl2ps->colormode == GL_RGBA){ + gl2ps->colorsize = 0; + gl2ps->colormap = NULL; + glGetFloatv(GL_COLOR_CLEAR_VALUE, gl2ps->bgcolor); + } + else if(gl2ps->colormode == GL_COLOR_INDEX){ + if(!colorsize || !colormap){ + gl2psMsg(GL2PS_ERROR, "Missing colormap for GL_COLOR_INDEX rendering"); + gl2psFree(gl2ps); + gl2ps = NULL; + return GL2PS_ERROR; + } + gl2ps->colorsize = colorsize; + gl2ps->colormap = (GL2PSrgba*)gl2psMalloc(gl2ps->colorsize * sizeof(GL2PSrgba)); + memcpy(gl2ps->colormap, colormap, gl2ps->colorsize * sizeof(GL2PSrgba)); + glGetIntegerv(GL_INDEX_CLEAR_VALUE, &index); + gl2ps->bgcolor[0] = gl2ps->colormap[index][0]; + gl2ps->bgcolor[1] = gl2ps->colormap[index][1]; + gl2ps->bgcolor[2] = gl2ps->colormap[index][2]; + gl2ps->bgcolor[3] = 1.0F; + } + else{ + gl2psMsg(GL2PS_ERROR, "Unknown color mode in gl2psBeginPage"); + gl2psFree(gl2ps); + gl2ps = NULL; + return GL2PS_ERROR; + } + + if(!title){ + gl2ps->title = (char*)gl2psMalloc(sizeof(char)); + gl2ps->title[0] = '\0'; + } + else{ + gl2ps->title = (char*)gl2psMalloc((strlen(title)+1)*sizeof(char)); + strcpy(gl2ps->title, title); + } + + if(!producer){ + gl2ps->producer = (char*)gl2psMalloc(sizeof(char)); + gl2ps->producer[0] = '\0'; + } + else{ + gl2ps->producer = (char*)gl2psMalloc((strlen(producer)+1)*sizeof(char)); + strcpy(gl2ps->producer, producer); + } + + if(!filename){ + gl2ps->filename = (char*)gl2psMalloc(sizeof(char)); + gl2ps->filename[0] = '\0'; + } + else{ + gl2ps->filename = (char*)gl2psMalloc((strlen(filename)+1)*sizeof(char)); + strcpy(gl2ps->filename, filename); + } + + gl2ps->primitives = gl2psListCreate(500, 500, sizeof(GL2PSprimitive*)); + gl2ps->auxprimitives = gl2psListCreate(100, 100, sizeof(GL2PSprimitive*)); + gl2ps->feedback = (GLfloat*)gl2psMalloc(gl2ps->buffersize * sizeof(GLfloat)); + glFeedbackBuffer(gl2ps->buffersize, GL_3D_COLOR, gl2ps->feedback); + glRenderMode(GL_FEEDBACK); + + return GL2PS_SUCCESS; +} + +GL2PSDLL_API GLint gl2psEndPage(void) +{ + GLint res; + + if(!gl2ps) return GL2PS_UNINITIALIZED; + + res = gl2psPrintPrimitives(); + + if(res != GL2PS_OVERFLOW) + (gl2psbackends[gl2ps->format]->printFooter)(); + + fflush(gl2ps->stream); + + gl2psListDelete(gl2ps->primitives); + gl2psListDelete(gl2ps->auxprimitives); + gl2psFreeImagemap(gl2ps->imagemap_head); + gl2psFree(gl2ps->colormap); + gl2psFree(gl2ps->title); + gl2psFree(gl2ps->producer); + gl2psFree(gl2ps->filename); + gl2psFree(gl2ps->feedback); + gl2psFree(gl2ps); + gl2ps = NULL; + + return res; +} + +GL2PSDLL_API GLint gl2psBeginViewport(GLint viewport[4]) +{ + if(!gl2ps) return GL2PS_UNINITIALIZED; + + (gl2psbackends[gl2ps->format]->beginViewport)(viewport); + + return GL2PS_SUCCESS; +} + +GL2PSDLL_API GLint gl2psEndViewport(void) +{ + GLint res; + + if(!gl2ps) return GL2PS_UNINITIALIZED; + + res = (gl2psbackends[gl2ps->format]->endViewport)(); + + /* reset last used colors, line widths */ + gl2ps->lastlinewidth = -1.0F; + + return res; +} + +GL2PSDLL_API GLint gl2psTextOpt(const char *str, const char *fontname, + GLshort fontsize, GLint alignment, GLfloat angle) +{ + return gl2psAddText(GL2PS_TEXT, str, fontname, fontsize, alignment, angle); +} + +GL2PSDLL_API GLint gl2psText(const char *str, const char *fontname, GLshort fontsize) +{ + return gl2psAddText(GL2PS_TEXT, str, fontname, fontsize, GL2PS_TEXT_BL, 0.0F); +} + +GL2PSDLL_API GLint gl2psSpecial(GLint format, const char *str) +{ + return gl2psAddText(GL2PS_SPECIAL, str, "", 0, format, 0.0F); +} + +GL2PSDLL_API GLint gl2psDrawPixels(GLsizei width, GLsizei height, + GLint xorig, GLint yorig, + GLenum format, GLenum type, + const void *pixels) +{ + int size, i; + GLfloat pos[4], *piv; + GL2PSprimitive *prim; + GLboolean valid; + + if(!gl2ps || !pixels) return GL2PS_UNINITIALIZED; + + if((width <= 0) || (height <= 0)) return GL2PS_ERROR; + + if(gl2ps->options & GL2PS_NO_PIXMAP) return GL2PS_SUCCESS; + + if((format != GL_RGB && format != GL_RGBA) || type != GL_FLOAT){ + gl2psMsg(GL2PS_ERROR, "gl2psDrawPixels only implemented for " + "GL_RGB/GL_RGBA, GL_FLOAT pixels"); + return GL2PS_ERROR; + } + + glGetBooleanv(GL_CURRENT_RASTER_POSITION_VALID, &valid); + if(GL_FALSE == valid) return GL2PS_SUCCESS; /* the primitive is culled */ + + glGetFloatv(GL_CURRENT_RASTER_POSITION, pos); + + prim = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); + prim->type = GL2PS_PIXMAP; + prim->boundary = 0; + prim->numverts = 1; + prim->verts = (GL2PSvertex*)gl2psMalloc(sizeof(GL2PSvertex)); + prim->verts[0].xyz[0] = pos[0] + xorig; + prim->verts[0].xyz[1] = pos[1] + yorig; + prim->verts[0].xyz[2] = pos[2]; + prim->culled = 0; + prim->offset = 0; + prim->pattern = 0; + prim->factor = 0; + prim->width = 1; + glGetFloatv(GL_CURRENT_RASTER_COLOR, prim->verts[0].rgba); + prim->data.image = (GL2PSimage*)gl2psMalloc(sizeof(GL2PSimage)); + prim->data.image->width = width; + prim->data.image->height = height; + prim->data.image->format = format; + prim->data.image->type = type; + + switch(format){ + case GL_RGBA: + if(gl2ps->options & GL2PS_NO_BLENDING || !gl2ps->blending){ + /* special case: blending turned off */ + prim->data.image->format = GL_RGB; + size = height * width * 3; + prim->data.image->pixels = (GLfloat*)gl2psMalloc(size * sizeof(GLfloat)); + piv = (GLfloat*)pixels; + for(i = 0; i < size; ++i, ++piv){ + prim->data.image->pixels[i] = *piv; + if(!((i+1)%3)) + ++piv; + } + } + else{ + size = height * width * 4; + prim->data.image->pixels = (GLfloat*)gl2psMalloc(size * sizeof(GLfloat)); + memcpy(prim->data.image->pixels, pixels, size * sizeof(GLfloat)); + } + break; + case GL_RGB: + default: + size = height * width * 3; + prim->data.image->pixels = (GLfloat*)gl2psMalloc(size * sizeof(GLfloat)); + memcpy(prim->data.image->pixels, pixels, size * sizeof(GLfloat)); + break; + } + + gl2psListAdd(gl2ps->auxprimitives, &prim); + glPassThrough(GL2PS_DRAW_PIXELS_TOKEN); + + return GL2PS_SUCCESS; +} + +GL2PSDLL_API GLint gl2psDrawImageMap(GLsizei width, GLsizei height, + const GLfloat position[3], + const unsigned char *imagemap){ + int size, i; + int sizeoffloat = sizeof(GLfloat); + + if(!gl2ps || !imagemap) return GL2PS_UNINITIALIZED; + + if((width <= 0) || (height <= 0)) return GL2PS_ERROR; + + size = height + height * ((width - 1) / 8); + glPassThrough(GL2PS_IMAGEMAP_TOKEN); + glBegin(GL_POINTS); + glVertex3f(position[0], position[1],position[2]); + glEnd(); + glPassThrough((GLfloat)width); + glPassThrough((GLfloat)height); + for(i = 0; i < size; i += sizeoffloat){ + float *value = (float*)imagemap; + glPassThrough(*value); + imagemap += sizeoffloat; + } + return GL2PS_SUCCESS; +} + +GL2PSDLL_API GLint gl2psEnable(GLint mode) +{ + GLint tmp; + + if(!gl2ps) return GL2PS_UNINITIALIZED; + + switch(mode){ + case GL2PS_POLYGON_OFFSET_FILL : + glPassThrough(GL2PS_BEGIN_OFFSET_TOKEN); + glGetFloatv(GL_POLYGON_OFFSET_FACTOR, &gl2ps->offset[0]); + glGetFloatv(GL_POLYGON_OFFSET_UNITS, &gl2ps->offset[1]); + break; + case GL2PS_POLYGON_BOUNDARY : + glPassThrough(GL2PS_BEGIN_BOUNDARY_TOKEN); + break; + case GL2PS_LINE_STIPPLE : + glPassThrough(GL2PS_BEGIN_STIPPLE_TOKEN); + glGetIntegerv(GL_LINE_STIPPLE_PATTERN, &tmp); + glPassThrough((GLfloat)tmp); + glGetIntegerv(GL_LINE_STIPPLE_REPEAT, &tmp); + glPassThrough((GLfloat)tmp); + break; + case GL2PS_BLEND : + glPassThrough(GL2PS_BEGIN_BLEND_TOKEN); + break; + default : + gl2psMsg(GL2PS_WARNING, "Unknown mode in gl2psEnable: %d", mode); + return GL2PS_WARNING; + } + + return GL2PS_SUCCESS; +} + +GL2PSDLL_API GLint gl2psDisable(GLint mode) +{ + if(!gl2ps) return GL2PS_UNINITIALIZED; + + switch(mode){ + case GL2PS_POLYGON_OFFSET_FILL : + glPassThrough(GL2PS_END_OFFSET_TOKEN); + break; + case GL2PS_POLYGON_BOUNDARY : + glPassThrough(GL2PS_END_BOUNDARY_TOKEN); + break; + case GL2PS_LINE_STIPPLE : + glPassThrough(GL2PS_END_STIPPLE_TOKEN); + break; + case GL2PS_BLEND : + glPassThrough(GL2PS_END_BLEND_TOKEN); + break; + default : + gl2psMsg(GL2PS_WARNING, "Unknown mode in gl2psDisable: %d", mode); + return GL2PS_WARNING; + } + + return GL2PS_SUCCESS; +} + +GL2PSDLL_API GLint gl2psPointSize(GLfloat value) +{ + if(!gl2ps) return GL2PS_UNINITIALIZED; + + glPassThrough(GL2PS_POINT_SIZE_TOKEN); + glPassThrough(value); + + return GL2PS_SUCCESS; +} + +GL2PSDLL_API GLint gl2psLineWidth(GLfloat value) +{ + if(!gl2ps) return GL2PS_UNINITIALIZED; + + glPassThrough(GL2PS_LINE_WIDTH_TOKEN); + glPassThrough(value); + + return GL2PS_SUCCESS; +} + +GL2PSDLL_API GLint gl2psBlendFunc(GLenum sfactor, GLenum dfactor) +{ + if(!gl2ps) return GL2PS_UNINITIALIZED; + + if(GL_FALSE == gl2psSupportedBlendMode(sfactor, dfactor)) + return GL2PS_WARNING; + + glPassThrough(GL2PS_SRC_BLEND_TOKEN); + glPassThrough((GLfloat)sfactor); + glPassThrough(GL2PS_DST_BLEND_TOKEN); + glPassThrough((GLfloat)dfactor); + + return GL2PS_SUCCESS; +} + +GL2PSDLL_API GLint gl2psSetOptions(GLint options) +{ + if(!gl2ps) return GL2PS_UNINITIALIZED; + + gl2ps->options = options; + + return GL2PS_SUCCESS; +} + +GL2PSDLL_API GLint gl2psGetOptions(GLint *options) +{ + if(!gl2ps) { + *options = 0; + return GL2PS_UNINITIALIZED; + } + + *options = gl2ps->options; + + return GL2PS_SUCCESS; +} + +GL2PSDLL_API const char *gl2psGetFileExtension(GLint format) +{ + if(format >= 0 && format < (GLint)(sizeof(gl2psbackends) / sizeof(gl2psbackends[0]))) + return gl2psbackends[format]->file_extension; + else + return "Unknown format"; +} + +GL2PSDLL_API const char *gl2psGetFormatDescription(GLint format) +{ + if(format >= 0 && format < (GLint)(sizeof(gl2psbackends) / sizeof(gl2psbackends[0]))) + return gl2psbackends[format]->description; + else + return "Unknown format"; +} === removed file '3rdparty/qwtplot3d/3rdparty/gl2ps/gl2ps.c' --- 3rdparty/qwtplot3d/3rdparty/gl2ps/gl2ps.c 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/3rdparty/gl2ps/gl2ps.c 1970-01-01 00:00:00 +0000 @@ -1,6061 +0,0 @@ -/* - * GL2PS, an OpenGL to PostScript Printing Library - * Copyright (C) 1999-2009 C. Geuzaine - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of either: - * - * a) the GNU Library General Public License as published by the Free - * Software Foundation, either version 2 of the License, or (at your - * option) any later version; or - * - * b) the GL2PS License as published by Christophe Geuzaine, either - * version 2 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either - * the GNU Library General Public License or the GL2PS License for - * more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library in the file named "COPYING.LGPL"; - * if not, write to the Free Software Foundation, Inc., 675 Mass Ave, - * Cambridge, MA 02139, USA. - * - * You should have received a copy of the GL2PS License with this - * library in the file named "COPYING.GL2PS"; if not, I will be glad - * to provide one. - * - * For the latest info about gl2ps and a full list of contributors, - * see http://www.geuz.org/gl2ps/. - * - * Please report all bugs and problems to . - */ - -#include "gl2ps.h" - -#include -#include -#include -#include -#include -#include - -#if defined(GL2PS_HAVE_ZLIB) -#include -#endif - -#if defined(GL2PS_HAVE_LIBPNG) -#include -#endif - -/********************************************************************* - * - * Private definitions, data structures and prototypes - * - *********************************************************************/ - -/* Magic numbers (assuming that the order of magnitude of window - coordinates is 10^3) */ - -#define GL2PS_EPSILON 5.0e-3F -#define GL2PS_ZSCALE 1000.0F -#define GL2PS_ZOFFSET 5.0e-2F -#define GL2PS_ZOFFSET_LARGE 20.0F -#define GL2PS_ZERO(arg) (fabs(arg) < 1.e-20) - -/* Primitive types */ - -#define GL2PS_NO_TYPE -1 -#define GL2PS_TEXT 1 -#define GL2PS_POINT 2 -#define GL2PS_LINE 3 -#define GL2PS_QUADRANGLE 4 -#define GL2PS_TRIANGLE 5 -#define GL2PS_PIXMAP 6 -#define GL2PS_IMAGEMAP 7 -#define GL2PS_IMAGEMAP_WRITTEN 8 -#define GL2PS_IMAGEMAP_VISIBLE 9 -#define GL2PS_SPECIAL 10 - -/* BSP tree primitive comparison */ - -#define GL2PS_COINCIDENT 1 -#define GL2PS_IN_FRONT_OF 2 -#define GL2PS_IN_BACK_OF 3 -#define GL2PS_SPANNING 4 - -/* 2D BSP tree primitive comparison */ - -#define GL2PS_POINT_COINCIDENT 0 -#define GL2PS_POINT_INFRONT 1 -#define GL2PS_POINT_BACK 2 - -/* Internal feedback buffer pass-through tokens */ - -#define GL2PS_BEGIN_OFFSET_TOKEN 1 -#define GL2PS_END_OFFSET_TOKEN 2 -#define GL2PS_BEGIN_BOUNDARY_TOKEN 3 -#define GL2PS_END_BOUNDARY_TOKEN 4 -#define GL2PS_BEGIN_STIPPLE_TOKEN 5 -#define GL2PS_END_STIPPLE_TOKEN 6 -#define GL2PS_POINT_SIZE_TOKEN 7 -#define GL2PS_LINE_WIDTH_TOKEN 8 -#define GL2PS_BEGIN_BLEND_TOKEN 9 -#define GL2PS_END_BLEND_TOKEN 10 -#define GL2PS_SRC_BLEND_TOKEN 11 -#define GL2PS_DST_BLEND_TOKEN 12 -#define GL2PS_IMAGEMAP_TOKEN 13 -#define GL2PS_DRAW_PIXELS_TOKEN 14 -#define GL2PS_TEXT_TOKEN 15 - -typedef enum { - T_UNDEFINED = -1, - T_CONST_COLOR = 1, - T_VAR_COLOR = 1<<1, - T_ALPHA_1 = 1<<2, - T_ALPHA_LESS_1 = 1<<3, - T_VAR_ALPHA = 1<<4 -} GL2PS_TRIANGLE_PROPERTY; - -typedef GLfloat GL2PSxyz[3]; -typedef GLfloat GL2PSplane[4]; - -typedef struct _GL2PSbsptree2d GL2PSbsptree2d; - -struct _GL2PSbsptree2d { - GL2PSplane plane; - GL2PSbsptree2d *front, *back; -}; - -typedef struct { - GLint nmax, size, incr, n; - char *array; -} GL2PSlist; - -typedef struct _GL2PSbsptree GL2PSbsptree; - -struct _GL2PSbsptree { - GL2PSplane plane; - GL2PSlist *primitives; - GL2PSbsptree *front, *back; -}; - -typedef struct { - GL2PSxyz xyz; - GL2PSrgba rgba; -} GL2PSvertex; - -typedef struct { - GL2PSvertex vertex[3]; - int prop; -} GL2PStriangle; - -typedef struct { - GLshort fontsize; - char *str, *fontname; - /* Note: for a 'special' string, 'alignment' holds the format - (PostScript, PDF, etc.) of the special string */ - GLint alignment; - GLfloat angle; -} GL2PSstring; - -typedef struct { - GLsizei width, height; - /* Note: for an imagemap, 'type' indicates if it has already been - written to the file or not, and 'format' indicates if it is - visible or not */ - GLenum format, type; - GLfloat *pixels; -} GL2PSimage; - -typedef struct _GL2PSimagemap GL2PSimagemap; - -struct _GL2PSimagemap { - GL2PSimage *image; - GL2PSimagemap *next; -}; - -typedef struct { - GLshort type, numverts; - GLushort pattern; - char boundary, offset, culled; - GLint factor; - GLfloat width; - GL2PSvertex *verts; - union { - GL2PSstring *text; - GL2PSimage *image; - } data; -} GL2PSprimitive; - -typedef struct { -#if defined(GL2PS_HAVE_ZLIB) - Bytef *dest, *src, *start; - uLongf destLen, srcLen; -#else - int dummy; -#endif -} GL2PScompress; - -typedef struct{ - GL2PSlist* ptrlist; - int gsno, fontno, imno, shno, maskshno, trgroupno; - int gsobjno, fontobjno, imobjno, shobjno, maskshobjno, trgroupobjno; -} GL2PSpdfgroup; - -typedef struct { - /* General */ - GLint format, sort, options, colorsize, colormode, buffersize; - char *title, *producer, *filename; - GLboolean boundary, blending; - GLfloat *feedback, offset[2], lastlinewidth; - GLint viewport[4], blendfunc[2], lastfactor; - GL2PSrgba *colormap, lastrgba, threshold, bgcolor; - GLushort lastpattern; - GL2PSvertex lastvertex; - GL2PSlist *primitives, *auxprimitives; - FILE *stream; - GL2PScompress *compress; - GLboolean header; - - /* BSP-specific */ - GLint maxbestroot; - - /* Occlusion culling-specific */ - GLboolean zerosurfacearea; - GL2PSbsptree2d *imagetree; - GL2PSprimitive *primitivetoadd; - - /* PDF-specific */ - int streamlength; - GL2PSlist *pdfprimlist, *pdfgrouplist; - int *xreflist; - int objects_stack; /* available objects */ - int extgs_stack; /* graphics state object number */ - int font_stack; /* font object number */ - int im_stack; /* image object number */ - int trgroupobjects_stack; /* xobject numbers */ - int shader_stack; /* shader object numbers */ - int mshader_stack; /* mask shader object numbers */ - - /* for image map list */ - GL2PSimagemap *imagemap_head; - GL2PSimagemap *imagemap_tail; -} GL2PScontext; - -typedef struct { - void (*printHeader)(void); - void (*printFooter)(void); - void (*beginViewport)(GLint viewport[4]); - GLint (*endViewport)(void); - void (*printPrimitive)(void *data); - void (*printFinalPrimitive)(void); - const char *file_extension; - const char *description; -} GL2PSbackend; - -/* The gl2ps context. gl2ps is not thread safe (we should create a - local GL2PScontext during gl2psBeginPage) */ - -static GL2PScontext *gl2ps = NULL; - -/* Need to forward-declare this one */ - -static GLint gl2psPrintPrimitives(void); - -/********************************************************************* - * - * Utility routines - * - *********************************************************************/ - -static void gl2psMsg(GLint level, const char *fmt, ...) -{ - va_list args; - - if(!(gl2ps->options & GL2PS_SILENT)){ - switch(level){ - case GL2PS_INFO : fprintf(stderr, "GL2PS info: "); break; - case GL2PS_WARNING : fprintf(stderr, "GL2PS warning: "); break; - case GL2PS_ERROR : fprintf(stderr, "GL2PS error: "); break; - } - va_start(args, fmt); - vfprintf(stderr, fmt, args); - va_end(args); - fprintf(stderr, "\n"); - } - /* if(level == GL2PS_ERROR) exit(1); */ -} - -static void *gl2psMalloc(size_t size) -{ - void *ptr; - - if(!size) return NULL; - ptr = malloc(size); - if(!ptr){ - gl2psMsg(GL2PS_ERROR, "Couldn't allocate requested memory"); - return NULL; - } - return ptr; -} - -static void *gl2psRealloc(void *ptr, size_t size) -{ - if(!size) return NULL; - ptr = realloc(ptr, size); - if(!ptr){ - gl2psMsg(GL2PS_ERROR, "Couldn't reallocate requested memory"); - return NULL; - } - return ptr; -} - -static void gl2psFree(void *ptr) -{ - if(!ptr) return; - free(ptr); -} - -static size_t gl2psWriteBigEndian(unsigned long data, size_t bytes) -{ - size_t i; - size_t size = sizeof(unsigned long); - for(i = 1; i <= bytes; ++i){ - fputc(0xff & (data >> (size-i) * 8), gl2ps->stream); - } - return bytes; -} - -/* zlib compression helper routines */ - -#if defined(GL2PS_HAVE_ZLIB) - -static void gl2psSetupCompress(void) -{ - gl2ps->compress = (GL2PScompress*)gl2psMalloc(sizeof(GL2PScompress)); - gl2ps->compress->src = NULL; - gl2ps->compress->start = NULL; - gl2ps->compress->dest = NULL; - gl2ps->compress->srcLen = 0; - gl2ps->compress->destLen = 0; -} - -static void gl2psFreeCompress(void) -{ - if(!gl2ps->compress) - return; - gl2psFree(gl2ps->compress->start); - gl2psFree(gl2ps->compress->dest); - gl2ps->compress->src = NULL; - gl2ps->compress->start = NULL; - gl2ps->compress->dest = NULL; - gl2ps->compress->srcLen = 0; - gl2ps->compress->destLen = 0; -} - -static int gl2psAllocCompress(unsigned int srcsize) -{ - gl2psFreeCompress(); - - if(!gl2ps->compress || !srcsize) - return GL2PS_ERROR; - - gl2ps->compress->srcLen = srcsize; - gl2ps->compress->destLen = (int)ceil(1.001 * gl2ps->compress->srcLen + 12); - gl2ps->compress->src = (Bytef*)gl2psMalloc(gl2ps->compress->srcLen); - gl2ps->compress->start = gl2ps->compress->src; - gl2ps->compress->dest = (Bytef*)gl2psMalloc(gl2ps->compress->destLen); - - return GL2PS_SUCCESS; -} - -static void *gl2psReallocCompress(unsigned int srcsize) -{ - if(!gl2ps->compress || !srcsize) - return NULL; - - if(srcsize < gl2ps->compress->srcLen) - return gl2ps->compress->start; - - gl2ps->compress->srcLen = srcsize; - gl2ps->compress->destLen = (int)ceil(1.001 * gl2ps->compress->srcLen + 12); - gl2ps->compress->src = (Bytef*)gl2psRealloc(gl2ps->compress->src, - gl2ps->compress->srcLen); - gl2ps->compress->start = gl2ps->compress->src; - gl2ps->compress->dest = (Bytef*)gl2psRealloc(gl2ps->compress->dest, - gl2ps->compress->destLen); - - return gl2ps->compress->start; -} - -static size_t gl2psWriteBigEndianCompress(unsigned long data, size_t bytes) -{ - size_t i; - size_t size = sizeof(unsigned long); - for(i = 1; i <= bytes; ++i){ - *gl2ps->compress->src = (Bytef)(0xff & (data >> (size-i) * 8)); - ++gl2ps->compress->src; - } - return bytes; -} - -static int gl2psDeflate(void) -{ - /* For compatibility with older zlib versions, we use compress(...) - instead of compress2(..., Z_BEST_COMPRESSION) */ - return compress(gl2ps->compress->dest, &gl2ps->compress->destLen, - gl2ps->compress->start, gl2ps->compress->srcLen); -} - -#endif - -static int gl2psPrintf(const char* fmt, ...) -{ - int ret; - va_list args; - -#if defined(GL2PS_HAVE_ZLIB) - unsigned int oldsize = 0; - static char buf[1000]; - if(gl2ps->options & GL2PS_COMPRESS){ - va_start(args, fmt); - ret = vsprintf(buf, fmt, args); - va_end(args); - oldsize = gl2ps->compress->srcLen; - gl2ps->compress->start = (Bytef*)gl2psReallocCompress(oldsize + ret); - memcpy(gl2ps->compress->start+oldsize, buf, ret); - ret = 0; - } - else{ -#endif - va_start(args, fmt); - ret = vfprintf(gl2ps->stream, fmt, args); - va_end(args); -#if defined(GL2PS_HAVE_ZLIB) - } -#endif - return ret; -} - -static void gl2psPrintGzipHeader() -{ -#if defined(GL2PS_HAVE_ZLIB) - char tmp[10] = {'\x1f', '\x8b', /* magic numbers: 0x1f, 0x8b */ - 8, /* compression method: Z_DEFLATED */ - 0, /* flags */ - 0, 0, 0, 0, /* time */ - 2, /* extra flags: max compression */ - '\x03'}; /* OS code: 0x03 (Unix) */ - - if(gl2ps->options & GL2PS_COMPRESS){ - gl2psSetupCompress(); - /* add the gzip file header */ - fwrite(tmp, 10, 1, gl2ps->stream); - } -#endif -} - -static void gl2psPrintGzipFooter() -{ -#if defined(GL2PS_HAVE_ZLIB) - int n; - uLong crc, len; - char tmp[8]; - - if(gl2ps->options & GL2PS_COMPRESS){ - if(Z_OK != gl2psDeflate()){ - gl2psMsg(GL2PS_ERROR, "Zlib deflate error"); - } - else{ - /* determine the length of the header in the zlib stream */ - n = 2; /* CMF+FLG */ - if(gl2ps->compress->dest[1] & (1<<5)){ - n += 4; /* DICTID */ - } - /* write the data, without the zlib header and footer */ - fwrite(gl2ps->compress->dest+n, gl2ps->compress->destLen-(n+4), - 1, gl2ps->stream); - /* add the gzip file footer */ - crc = crc32(0L, gl2ps->compress->start, gl2ps->compress->srcLen); - for(n = 0; n < 4; ++n){ - tmp[n] = (char)(crc & 0xff); - crc >>= 8; - } - len = gl2ps->compress->srcLen; - for(n = 4; n < 8; ++n){ - tmp[n] = (char)(len & 0xff); - len >>= 8; - } - fwrite(tmp, 8, 1, gl2ps->stream); - } - gl2psFreeCompress(); - gl2psFree(gl2ps->compress); - gl2ps->compress = NULL; - } -#endif -} - -/* The list handling routines */ - -static void gl2psListRealloc(GL2PSlist *list, GLint n) -{ - if(!list){ - gl2psMsg(GL2PS_ERROR, "Cannot reallocate NULL list"); - return; - } - if(n <= 0) return; - if(!list->array){ - list->nmax = n; - list->array = (char*)gl2psMalloc(list->nmax * list->size); - } - else{ - if(n > list->nmax){ - list->nmax = ((n - 1) / list->incr + 1) * list->incr; - list->array = (char*)gl2psRealloc(list->array, - list->nmax * list->size); - } - } -} - -static GL2PSlist *gl2psListCreate(GLint n, GLint incr, GLint size) -{ - GL2PSlist *list; - - if(n < 0) n = 0; - if(incr <= 0) incr = 1; - list = (GL2PSlist*)gl2psMalloc(sizeof(GL2PSlist)); - list->nmax = 0; - list->incr = incr; - list->size = size; - list->n = 0; - list->array = NULL; - gl2psListRealloc(list, n); - return list; -} - -static void gl2psListReset(GL2PSlist *list) -{ - if(!list) return; - list->n = 0; -} - -static void gl2psListDelete(GL2PSlist *list) -{ - if(!list) return; - gl2psFree(list->array); - gl2psFree(list); -} - -static void gl2psListAdd(GL2PSlist *list, void *data) -{ - if(!list){ - gl2psMsg(GL2PS_ERROR, "Cannot add into unallocated list"); - return; - } - list->n++; - gl2psListRealloc(list, list->n); - memcpy(&list->array[(list->n - 1) * list->size], data, list->size); -} - -static int gl2psListNbr(GL2PSlist *list) -{ - if(!list) - return 0; - return list->n; -} - -static void *gl2psListPointer(GL2PSlist *list, GLint index) -{ - if(!list){ - gl2psMsg(GL2PS_ERROR, "Cannot point into unallocated list"); - return NULL; - } - if((index < 0) || (index >= list->n)){ - gl2psMsg(GL2PS_ERROR, "Wrong list index in gl2psListPointer"); - return NULL; - } - return &list->array[index * list->size]; -} - -static void gl2psListSort(GL2PSlist *list, - int (*fcmp)(const void *a, const void *b)) -{ - if(!list) - return; - qsort(list->array, list->n, list->size, fcmp); -} - -static void gl2psListAction(GL2PSlist *list, void (*action)(void *data)) -{ - GLint i; - - for(i = 0; i < gl2psListNbr(list); i++){ - (*action)(gl2psListPointer(list, i)); - } -} - -static void gl2psListActionInverse(GL2PSlist *list, void (*action)(void *data)) -{ - GLint i; - - for(i = gl2psListNbr(list); i > 0; i--){ - (*action)(gl2psListPointer(list, i-1)); - } -} - -#if defined(GL2PS_HAVE_LIBPNG) - -static void gl2psListRead(GL2PSlist *list, int index, void *data) -{ - if((index < 0) || (index >= list->n)) - gl2psMsg(GL2PS_ERROR, "Wrong list index in gl2psListRead"); - memcpy(data, &list->array[index * list->size], list->size); -} - -static void gl2psEncodeBase64Block(unsigned char in[3], unsigned char out[4], int len) -{ - static const char cb64[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - - out[0] = cb64[ in[0] >> 2 ]; - out[1] = cb64[ ((in[0] & 0x03) << 4) | ((in[1] & 0xf0) >> 4) ]; - out[2] = (len > 1) ? cb64[ ((in[1] & 0x0f) << 2) | ((in[2] & 0xc0) >> 6) ] : '='; - out[3] = (len > 2) ? cb64[ in[2] & 0x3f ] : '='; -} - -static void gl2psListEncodeBase64(GL2PSlist *list) -{ - unsigned char *buffer, in[3], out[4]; - int i, n, index, len; - - n = list->n * list->size; - buffer = (unsigned char*)gl2psMalloc(n * sizeof(unsigned char)); - memcpy(buffer, list->array, n * sizeof(unsigned char)); - gl2psListReset(list); - - index = 0; - while(index < n) { - len = 0; - for(i = 0; i < 3; i++) { - if(index < n){ - in[i] = buffer[index]; - len++; - } - else{ - in[i] = 0; - } - index++; - } - if(len) { - gl2psEncodeBase64Block(in, out, len); - for(i = 0; i < 4; i++) - gl2psListAdd(list, &out[i]); - } - } - gl2psFree(buffer); -} - -#endif - -/* Helpers for rgba colors */ - -static GLboolean gl2psSameColor(GL2PSrgba rgba1, GL2PSrgba rgba2) -{ - if(!GL2PS_ZERO(rgba1[0] - rgba2[0]) || - !GL2PS_ZERO(rgba1[1] - rgba2[1]) || - !GL2PS_ZERO(rgba1[2] - rgba2[2])) - return GL_FALSE; - return GL_TRUE; -} - -static GLboolean gl2psVertsSameColor(const GL2PSprimitive *prim) -{ - int i; - - for(i = 1; i < prim->numverts; i++){ - if(!gl2psSameColor(prim->verts[0].rgba, prim->verts[i].rgba)){ - return GL_FALSE; - } - } - return GL_TRUE; -} - -static GLboolean gl2psSameColorThreshold(int n, GL2PSrgba rgba[], - GL2PSrgba threshold) -{ - int i; - - if(n < 2) return GL_TRUE; - - for(i = 1; i < n; i++){ - if(fabs(rgba[0][0] - rgba[i][0]) > threshold[0] || - fabs(rgba[0][1] - rgba[i][1]) > threshold[1] || - fabs(rgba[0][2] - rgba[i][2]) > threshold[2]) - return GL_FALSE; - } - - return GL_TRUE; -} - -static void gl2psSetLastColor(GL2PSrgba rgba) -{ - int i; - for(i = 0; i < 3; ++i){ - gl2ps->lastrgba[i] = rgba[i]; - } -} - -static GLfloat gl2psGetRGB(GL2PSimage *im, GLuint x, GLuint y, - GLfloat *red, GLfloat *green, GLfloat *blue) -{ - - GLsizei width = im->width; - GLsizei height = im->height; - GLfloat *pixels = im->pixels; - GLfloat *pimag; - - /* OpenGL image is from down to up, PS image is up to down */ - switch(im->format){ - case GL_RGBA: - pimag = pixels + 4 * (width * (height - 1 - y) + x); - break; - case GL_RGB: - default: - pimag = pixels + 3 * (width * (height - 1 - y) + x); - break; - } - *red = *pimag; pimag++; - *green = *pimag; pimag++; - *blue = *pimag; pimag++; - - return (im->format == GL_RGBA) ? *pimag : 1.0F; -} - -/* Helper routines for pixmaps */ - -static GL2PSimage *gl2psCopyPixmap(GL2PSimage *im) -{ - int size; - GL2PSimage *image = (GL2PSimage*)gl2psMalloc(sizeof(GL2PSimage)); - - image->width = im->width; - image->height = im->height; - image->format = im->format; - image->type = im->type; - - switch(image->format){ - case GL_RGBA: - size = image->height * image->width * 4 * sizeof(GLfloat); - break; - case GL_RGB: - default: - size = image->height * image->width * 3 * sizeof(GLfloat); - break; - } - - image->pixels = (GLfloat*)gl2psMalloc(size); - memcpy(image->pixels, im->pixels, size); - - return image; -} - -static void gl2psFreePixmap(GL2PSimage *im) -{ - if(!im) - return; - gl2psFree(im->pixels); - gl2psFree(im); -} - -#if defined(GL2PS_HAVE_LIBPNG) - -#if !defined(png_jmpbuf) -# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) -#endif - -static void gl2psUserWritePNG(png_structp png_ptr, png_bytep data, png_size_t length) -{ - unsigned int i; - GL2PSlist *png = (GL2PSlist*)png_get_io_ptr(png_ptr); - for(i = 0; i < length; i++) - gl2psListAdd(png, &data[i]); -} - -static void gl2psUserFlushPNG(png_structp png_ptr) -{ -} - -static void gl2psConvertPixmapToPNG(GL2PSimage *pixmap, GL2PSlist *png) -{ - png_structp png_ptr; - png_infop info_ptr; - unsigned char *row_data; - GLfloat dr, dg, db; - int row, col; - - if(!(png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL))) - return; - - if(!(info_ptr = png_create_info_struct(png_ptr))){ - png_destroy_write_struct(&png_ptr, NULL); - return; - } - - if(setjmp(png_jmpbuf(png_ptr))) { - png_destroy_write_struct(&png_ptr, &info_ptr); - return; - } - - png_set_write_fn(png_ptr, (void *)png, gl2psUserWritePNG, gl2psUserFlushPNG); - png_set_compression_level(png_ptr, Z_DEFAULT_COMPRESSION); - png_set_IHDR(png_ptr, info_ptr, pixmap->width, pixmap->height, 8, - PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, - PNG_FILTER_TYPE_BASE); - png_write_info(png_ptr, info_ptr); - - row_data = (unsigned char*)gl2psMalloc(3 * pixmap->width * sizeof(unsigned char)); - for(row = 0; row < pixmap->height; row++){ - for(col = 0; col < pixmap->width; col++){ - gl2psGetRGB(pixmap, col, row, &dr, &dg, &db); - row_data[3*col] = (unsigned char)(255. * dr); - row_data[3*col+1] = (unsigned char)(255. * dg); - row_data[3*col+2] = (unsigned char)(255. * db); - } - png_write_row(png_ptr, (png_bytep)row_data); - } - gl2psFree(row_data); - - png_write_end(png_ptr, info_ptr); - png_destroy_write_struct(&png_ptr, &info_ptr); -} - -#endif - -/* Helper routines for text strings */ - -static GLint gl2psAddText(GLint type, const char *str, const char *fontname, - GLshort fontsize, GLint alignment, GLfloat angle) -{ - GLfloat pos[4]; - GL2PSprimitive *prim; - GLboolean valid; - - if(!gl2ps || !str || !fontname) return GL2PS_UNINITIALIZED; - - if(gl2ps->options & GL2PS_NO_TEXT) return GL2PS_SUCCESS; - - glGetBooleanv(GL_CURRENT_RASTER_POSITION_VALID, &valid); - if(GL_FALSE == valid) return GL2PS_SUCCESS; /* the primitive is culled */ - - glGetFloatv(GL_CURRENT_RASTER_POSITION, pos); - - prim = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - prim->type = type; - prim->boundary = 0; - prim->numverts = 1; - prim->verts = (GL2PSvertex*)gl2psMalloc(sizeof(GL2PSvertex)); - prim->verts[0].xyz[0] = pos[0]; - prim->verts[0].xyz[1] = pos[1]; - prim->verts[0].xyz[2] = pos[2]; - prim->culled = 0; - prim->offset = 0; - prim->pattern = 0; - prim->factor = 0; - prim->width = 1; - glGetFloatv(GL_CURRENT_RASTER_COLOR, prim->verts[0].rgba); - prim->data.text = (GL2PSstring*)gl2psMalloc(sizeof(GL2PSstring)); - prim->data.text->str = (char*)gl2psMalloc((strlen(str)+1)*sizeof(char)); - strcpy(prim->data.text->str, str); - prim->data.text->fontname = (char*)gl2psMalloc((strlen(fontname)+1)*sizeof(char)); - strcpy(prim->data.text->fontname, fontname); - prim->data.text->fontsize = fontsize; - prim->data.text->alignment = alignment; - prim->data.text->angle = angle; - - gl2psListAdd(gl2ps->auxprimitives, &prim); - glPassThrough(GL2PS_TEXT_TOKEN); - - return GL2PS_SUCCESS; -} - -static GL2PSstring *gl2psCopyText(GL2PSstring *t) -{ - GL2PSstring *text = (GL2PSstring*)gl2psMalloc(sizeof(GL2PSstring)); - text->str = (char*)gl2psMalloc((strlen(t->str)+1)*sizeof(char)); - strcpy(text->str, t->str); - text->fontname = (char*)gl2psMalloc((strlen(t->fontname)+1)*sizeof(char)); - strcpy(text->fontname, t->fontname); - text->fontsize = t->fontsize; - text->alignment = t->alignment; - text->angle = t->angle; - - return text; -} - -static void gl2psFreeText(GL2PSstring *text) -{ - if(!text) - return; - gl2psFree(text->str); - gl2psFree(text->fontname); - gl2psFree(text); -} - -/* Helpers for blending modes */ - -static GLboolean gl2psSupportedBlendMode(GLenum sfactor, GLenum dfactor) -{ - /* returns TRUE if gl2ps supports the argument combination: only two - blending modes have been implemented so far */ - - if( (sfactor == GL_SRC_ALPHA && dfactor == GL_ONE_MINUS_SRC_ALPHA) || - (sfactor == GL_ONE && dfactor == GL_ZERO) ) - return GL_TRUE; - return GL_FALSE; -} - -static void gl2psAdaptVertexForBlending(GL2PSvertex *v) -{ - /* Transforms vertex depending on the actual blending function - - currently the vertex v is considered as source vertex and his - alpha value is changed to 1.0 if source blending GL_ONE is - active. This might be extended in the future */ - - if(!v || !gl2ps) - return; - - if(gl2ps->options & GL2PS_NO_BLENDING || !gl2ps->blending){ - v->rgba[3] = 1.0F; - return; - } - - switch(gl2ps->blendfunc[0]){ - case GL_ONE: - v->rgba[3] = 1.0F; - break; - default: - break; - } -} - -static void gl2psAssignTriangleProperties(GL2PStriangle *t) -{ - /* int i; */ - - t->prop = T_VAR_COLOR; - - /* Uncommenting the following lines activates an even more fine - grained distinction between triangle types - please don't delete, - a remarkable amount of PDF handling code inside this file depends - on it if activated */ - /* - t->prop = T_CONST_COLOR; - for(i = 0; i < 3; ++i){ - if(!GL2PS_ZERO(t->vertex[0].rgba[i] - t->vertex[1].rgba[i]) || - !GL2PS_ZERO(t->vertex[1].rgba[i] - t->vertex[2].rgba[i])){ - t->prop = T_VAR_COLOR; - break; - } - } - */ - - if(!GL2PS_ZERO(t->vertex[0].rgba[3] - t->vertex[1].rgba[3]) || - !GL2PS_ZERO(t->vertex[1].rgba[3] - t->vertex[2].rgba[3])){ - t->prop |= T_VAR_ALPHA; - } - else{ - if(t->vertex[0].rgba[3] < 1) - t->prop |= T_ALPHA_LESS_1; - else - t->prop |= T_ALPHA_1; - } -} - -static void gl2psFillTriangleFromPrimitive(GL2PStriangle *t, GL2PSprimitive *p, - GLboolean assignprops) -{ - t->vertex[0] = p->verts[0]; - t->vertex[1] = p->verts[1]; - t->vertex[2] = p->verts[2]; - if(GL_TRUE == assignprops) - gl2psAssignTriangleProperties(t); -} - -static void gl2psInitTriangle(GL2PStriangle *t) -{ - int i; - GL2PSvertex vertex = { {-1.0F, -1.0F, -1.0F}, {-1.0F, -1.0F, -1.0F, -1.0F} }; - for(i = 0; i < 3; i++) - t->vertex[i] = vertex; - t->prop = T_UNDEFINED; -} - -/* Miscellaneous helper routines */ - -static GL2PSprimitive *gl2psCopyPrimitive(GL2PSprimitive *p) -{ - GL2PSprimitive *prim; - - if(!p){ - gl2psMsg(GL2PS_ERROR, "Trying to copy an empty primitive"); - return NULL; - } - - prim = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - - prim->type = p->type; - prim->numverts = p->numverts; - prim->boundary = p->boundary; - prim->offset = p->offset; - prim->pattern = p->pattern; - prim->factor = p->factor; - prim->culled = p->culled; - prim->width = p->width; - prim->verts = (GL2PSvertex*)gl2psMalloc(p->numverts*sizeof(GL2PSvertex)); - memcpy(prim->verts, p->verts, p->numverts * sizeof(GL2PSvertex)); - - switch(prim->type){ - case GL2PS_PIXMAP : - prim->data.image = gl2psCopyPixmap(p->data.image); - break; - case GL2PS_TEXT : - case GL2PS_SPECIAL : - prim->data.text = gl2psCopyText(p->data.text); - break; - default: - break; - } - - return prim; -} - -static GLboolean gl2psSamePosition(GL2PSxyz p1, GL2PSxyz p2) -{ - if(!GL2PS_ZERO(p1[0] - p2[0]) || - !GL2PS_ZERO(p1[1] - p2[1]) || - !GL2PS_ZERO(p1[2] - p2[2])) - return GL_FALSE; - return GL_TRUE; -} - -/********************************************************************* - * - * 3D sorting routines - * - *********************************************************************/ - -static GLfloat gl2psComparePointPlane(GL2PSxyz point, GL2PSplane plane) -{ - return (plane[0] * point[0] + - plane[1] * point[1] + - plane[2] * point[2] + - plane[3]); -} - -static GLfloat gl2psPsca(GLfloat *a, GLfloat *b) -{ - return (a[0]*b[0] + a[1]*b[1] + a[2]*b[2]); -} - -static void gl2psPvec(GLfloat *a, GLfloat *b, GLfloat *c) -{ - c[0] = a[1]*b[2] - a[2]*b[1]; - c[1] = a[2]*b[0] - a[0]*b[2]; - c[2] = a[0]*b[1] - a[1]*b[0]; -} - -static GLfloat gl2psNorm(GLfloat *a) -{ - return (GLfloat)sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]); -} - -static void gl2psGetNormal(GLfloat *a, GLfloat *b, GLfloat *c) -{ - GLfloat norm; - - gl2psPvec(a, b, c); - if(!GL2PS_ZERO(norm = gl2psNorm(c))){ - c[0] = c[0] / norm; - c[1] = c[1] / norm; - c[2] = c[2] / norm; - } - else{ - /* The plane is still wrong despite our tests in gl2psGetPlane. - Let's return a dummy value for now (this is a hack: we should - do more intelligent tests in GetPlane) */ - c[0] = c[1] = 0.0F; - c[2] = 1.0F; - } -} - -static void gl2psGetPlane(GL2PSprimitive *prim, GL2PSplane plane) -{ - GL2PSxyz v = {0.0F, 0.0F, 0.0F}, w = {0.0F, 0.0F, 0.0F}; - - switch(prim->type){ - case GL2PS_TRIANGLE : - case GL2PS_QUADRANGLE : - v[0] = prim->verts[1].xyz[0] - prim->verts[0].xyz[0]; - v[1] = prim->verts[1].xyz[1] - prim->verts[0].xyz[1]; - v[2] = prim->verts[1].xyz[2] - prim->verts[0].xyz[2]; - w[0] = prim->verts[2].xyz[0] - prim->verts[0].xyz[0]; - w[1] = prim->verts[2].xyz[1] - prim->verts[0].xyz[1]; - w[2] = prim->verts[2].xyz[2] - prim->verts[0].xyz[2]; - if((GL2PS_ZERO(v[0]) && GL2PS_ZERO(v[1]) && GL2PS_ZERO(v[2])) || - (GL2PS_ZERO(w[0]) && GL2PS_ZERO(w[1]) && GL2PS_ZERO(w[2]))){ - plane[0] = plane[1] = 0.0F; - plane[2] = 1.0F; - plane[3] = -prim->verts[0].xyz[2]; - } - else{ - gl2psGetNormal(v, w, plane); - plane[3] = - - plane[0] * prim->verts[0].xyz[0] - - plane[1] * prim->verts[0].xyz[1] - - plane[2] * prim->verts[0].xyz[2]; - } - break; - case GL2PS_LINE : - v[0] = prim->verts[1].xyz[0] - prim->verts[0].xyz[0]; - v[1] = prim->verts[1].xyz[1] - prim->verts[0].xyz[1]; - v[2] = prim->verts[1].xyz[2] - prim->verts[0].xyz[2]; - if(GL2PS_ZERO(v[0]) && GL2PS_ZERO(v[1]) && GL2PS_ZERO(v[2])){ - plane[0] = plane[1] = 0.0F; - plane[2] = 1.0F; - plane[3] = -prim->verts[0].xyz[2]; - } - else{ - if(GL2PS_ZERO(v[0])) w[0] = 1.0F; - else if(GL2PS_ZERO(v[1])) w[1] = 1.0F; - else w[2] = 1.0F; - gl2psGetNormal(v, w, plane); - plane[3] = - - plane[0] * prim->verts[0].xyz[0] - - plane[1] * prim->verts[0].xyz[1] - - plane[2] * prim->verts[0].xyz[2]; - } - break; - case GL2PS_POINT : - case GL2PS_PIXMAP : - case GL2PS_TEXT : - case GL2PS_SPECIAL : - case GL2PS_IMAGEMAP: - plane[0] = plane[1] = 0.0F; - plane[2] = 1.0F; - plane[3] = -prim->verts[0].xyz[2]; - break; - default : - gl2psMsg(GL2PS_ERROR, "Unknown primitive type in BSP tree"); - plane[0] = plane[1] = plane[3] = 0.0F; - plane[2] = 1.0F; - break; - } -} - -static void gl2psCutEdge(GL2PSvertex *a, GL2PSvertex *b, GL2PSplane plane, - GL2PSvertex *c) -{ - GL2PSxyz v; - GLfloat sect, psca; - - v[0] = b->xyz[0] - a->xyz[0]; - v[1] = b->xyz[1] - a->xyz[1]; - v[2] = b->xyz[2] - a->xyz[2]; - - if(!GL2PS_ZERO(psca = gl2psPsca(plane, v))) - sect = -gl2psComparePointPlane(a->xyz, plane) / psca; - else - sect = 0.0F; - - c->xyz[0] = a->xyz[0] + v[0] * sect; - c->xyz[1] = a->xyz[1] + v[1] * sect; - c->xyz[2] = a->xyz[2] + v[2] * sect; - - c->rgba[0] = (1 - sect) * a->rgba[0] + sect * b->rgba[0]; - c->rgba[1] = (1 - sect) * a->rgba[1] + sect * b->rgba[1]; - c->rgba[2] = (1 - sect) * a->rgba[2] + sect * b->rgba[2]; - c->rgba[3] = (1 - sect) * a->rgba[3] + sect * b->rgba[3]; -} - -static void gl2psCreateSplitPrimitive(GL2PSprimitive *parent, GL2PSplane plane, - GL2PSprimitive *child, GLshort numverts, - GLshort *index0, GLshort *index1) -{ - GLshort i; - - if(parent->type == GL2PS_IMAGEMAP){ - child->type = GL2PS_IMAGEMAP; - child->data.image = parent->data.image; - } - else{ - if(numverts > 4){ - gl2psMsg(GL2PS_WARNING, "%d vertices in polygon", numverts); - numverts = 4; - } - switch(numverts){ - case 1 : child->type = GL2PS_POINT; break; - case 2 : child->type = GL2PS_LINE; break; - case 3 : child->type = GL2PS_TRIANGLE; break; - case 4 : child->type = GL2PS_QUADRANGLE; break; - default: child->type = GL2PS_NO_TYPE; break; - } - } - - child->boundary = 0; /* FIXME: not done! */ - child->culled = parent->culled; - child->offset = parent->offset; - child->pattern = parent->pattern; - child->factor = parent->factor; - child->width = parent->width; - child->numverts = numverts; - child->verts = (GL2PSvertex*)gl2psMalloc(numverts * sizeof(GL2PSvertex)); - - for(i = 0; i < numverts; i++){ - if(index1[i] < 0){ - child->verts[i] = parent->verts[index0[i]]; - } - else{ - gl2psCutEdge(&parent->verts[index0[i]], &parent->verts[index1[i]], - plane, &child->verts[i]); - } - } -} - -static void gl2psAddIndex(GLshort *index0, GLshort *index1, GLshort *nb, - GLshort i, GLshort j) -{ - GLint k; - - for(k = 0; k < *nb; k++){ - if((index0[k] == i && index1[k] == j) || - (index1[k] == i && index0[k] == j)) return; - } - index0[*nb] = i; - index1[*nb] = j; - (*nb)++; -} - -static GLshort gl2psGetIndex(GLshort i, GLshort num) -{ - return (i < num - 1) ? i + 1 : 0; -} - -static GLint gl2psTestSplitPrimitive(GL2PSprimitive *prim, GL2PSplane plane) -{ - GLint type = GL2PS_COINCIDENT; - GLshort i, j; - GLfloat d[5]; - - for(i = 0; i < prim->numverts; i++){ - d[i] = gl2psComparePointPlane(prim->verts[i].xyz, plane); - } - - if(prim->numverts < 2){ - return 0; - } - else{ - for(i = 0; i < prim->numverts; i++){ - j = gl2psGetIndex(i, prim->numverts); - if(d[j] > GL2PS_EPSILON){ - if(type == GL2PS_COINCIDENT) type = GL2PS_IN_BACK_OF; - else if(type != GL2PS_IN_BACK_OF) return 1; - if(d[i] < -GL2PS_EPSILON) return 1; - } - else if(d[j] < -GL2PS_EPSILON){ - if(type == GL2PS_COINCIDENT) type = GL2PS_IN_FRONT_OF; - else if(type != GL2PS_IN_FRONT_OF) return 1; - if(d[i] > GL2PS_EPSILON) return 1; - } - } - } - return 0; -} - -static GLint gl2psSplitPrimitive(GL2PSprimitive *prim, GL2PSplane plane, - GL2PSprimitive **front, GL2PSprimitive **back) -{ - GLshort i, j, in = 0, out = 0, in0[5], in1[5], out0[5], out1[5]; - GLint type; - GLfloat d[5]; - - type = GL2PS_COINCIDENT; - - for(i = 0; i < prim->numverts; i++){ - d[i] = gl2psComparePointPlane(prim->verts[i].xyz, plane); - } - - switch(prim->type){ - case GL2PS_POINT : - if(d[0] > GL2PS_EPSILON) type = GL2PS_IN_BACK_OF; - else if(d[0] < -GL2PS_EPSILON) type = GL2PS_IN_FRONT_OF; - else type = GL2PS_COINCIDENT; - break; - default : - for(i = 0; i < prim->numverts; i++){ - j = gl2psGetIndex(i, prim->numverts); - if(d[j] > GL2PS_EPSILON){ - if(type == GL2PS_COINCIDENT) type = GL2PS_IN_BACK_OF; - else if(type != GL2PS_IN_BACK_OF) type = GL2PS_SPANNING; - if(d[i] < -GL2PS_EPSILON){ - gl2psAddIndex(in0, in1, &in, i, j); - gl2psAddIndex(out0, out1, &out, i, j); - type = GL2PS_SPANNING; - } - gl2psAddIndex(out0, out1, &out, j, -1); - } - else if(d[j] < -GL2PS_EPSILON){ - if(type == GL2PS_COINCIDENT) type = GL2PS_IN_FRONT_OF; - else if(type != GL2PS_IN_FRONT_OF) type = GL2PS_SPANNING; - if(d[i] > GL2PS_EPSILON){ - gl2psAddIndex(in0, in1, &in, i, j); - gl2psAddIndex(out0, out1, &out, i, j); - type = GL2PS_SPANNING; - } - gl2psAddIndex(in0, in1, &in, j, -1); - } - else{ - gl2psAddIndex(in0, in1, &in, j, -1); - gl2psAddIndex(out0, out1, &out, j, -1); - } - } - break; - } - - if(type == GL2PS_SPANNING){ - *back = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - *front = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - gl2psCreateSplitPrimitive(prim, plane, *back, out, out0, out1); - gl2psCreateSplitPrimitive(prim, plane, *front, in, in0, in1); - } - - return type; -} - -static void gl2psDivideQuad(GL2PSprimitive *quad, - GL2PSprimitive **t1, GL2PSprimitive **t2) -{ - *t1 = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - *t2 = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - (*t1)->type = (*t2)->type = GL2PS_TRIANGLE; - (*t1)->numverts = (*t2)->numverts = 3; - (*t1)->culled = (*t2)->culled = quad->culled; - (*t1)->offset = (*t2)->offset = quad->offset; - (*t1)->pattern = (*t2)->pattern = quad->pattern; - (*t1)->factor = (*t2)->factor = quad->factor; - (*t1)->width = (*t2)->width = quad->width; - (*t1)->verts = (GL2PSvertex*)gl2psMalloc(3 * sizeof(GL2PSvertex)); - (*t2)->verts = (GL2PSvertex*)gl2psMalloc(3 * sizeof(GL2PSvertex)); - (*t1)->verts[0] = quad->verts[0]; - (*t1)->verts[1] = quad->verts[1]; - (*t1)->verts[2] = quad->verts[2]; - (*t1)->boundary = ((quad->boundary & 1) ? 1 : 0) | ((quad->boundary & 2) ? 2 : 0); - (*t2)->verts[0] = quad->verts[0]; - (*t2)->verts[1] = quad->verts[2]; - (*t2)->verts[2] = quad->verts[3]; - (*t2)->boundary = ((quad->boundary & 4) ? 2 : 0) | ((quad->boundary & 4) ? 2 : 0); -} - -static int gl2psCompareDepth(const void *a, const void *b) -{ - GL2PSprimitive *q, *w; - GLfloat dq = 0.0F, dw = 0.0F, diff; - int i; - - q = *(GL2PSprimitive**)a; - w = *(GL2PSprimitive**)b; - - for(i = 0; i < q->numverts; i++){ - dq += q->verts[i].xyz[2]; - } - dq /= (GLfloat)q->numverts; - - for(i = 0; i < w->numverts; i++){ - dw += w->verts[i].xyz[2]; - } - dw /= (GLfloat)w->numverts; - - diff = dq - dw; - if(diff > 0.){ - return -1; - } - else if(diff < 0.){ - return 1; - } - else{ - return 0; - } -} - -static int gl2psTrianglesFirst(const void *a, const void *b) -{ - GL2PSprimitive *q, *w; - - q = *(GL2PSprimitive**)a; - w = *(GL2PSprimitive**)b; - return (q->type < w->type ? 1 : -1); -} - -static GLint gl2psFindRoot(GL2PSlist *primitives, GL2PSprimitive **root) -{ - GLint i, j, count, best = 1000000, index = 0; - GL2PSprimitive *prim1, *prim2; - GL2PSplane plane; - GLint maxp; - - if(!gl2psListNbr(primitives)){ - gl2psMsg(GL2PS_ERROR, "Cannot fint root in empty primitive list"); - return 0; - } - - *root = *(GL2PSprimitive**)gl2psListPointer(primitives, 0); - - if(gl2ps->options & GL2PS_BEST_ROOT){ - maxp = gl2psListNbr(primitives); - if(maxp > gl2ps->maxbestroot){ - maxp = gl2ps->maxbestroot; - } - for(i = 0; i < maxp; i++){ - prim1 = *(GL2PSprimitive**)gl2psListPointer(primitives, i); - gl2psGetPlane(prim1, plane); - count = 0; - for(j = 0; j < gl2psListNbr(primitives); j++){ - if(j != i){ - prim2 = *(GL2PSprimitive**)gl2psListPointer(primitives, j); - count += gl2psTestSplitPrimitive(prim2, plane); - } - if(count > best) break; - } - if(count < best){ - best = count; - index = i; - *root = prim1; - if(!count) return index; - } - } - /* if(index) gl2psMsg(GL2PS_INFO, "GL2PS_BEST_ROOT was worth it: %d", index); */ - return index; - } - else{ - return 0; - } -} - -static void gl2psFreeImagemap(GL2PSimagemap *list) -{ - GL2PSimagemap *next; - while(list != NULL){ - next = list->next; - gl2psFree(list->image->pixels); - gl2psFree(list->image); - gl2psFree(list); - list = next; - } -} - -static void gl2psFreePrimitive(void *data) -{ - GL2PSprimitive *q; - - q = *(GL2PSprimitive**)data; - gl2psFree(q->verts); - if(q->type == GL2PS_TEXT || q->type == GL2PS_SPECIAL){ - gl2psFreeText(q->data.text); - } - else if(q->type == GL2PS_PIXMAP){ - gl2psFreePixmap(q->data.image); - } - gl2psFree(q); -} - -static void gl2psAddPrimitiveInList(GL2PSprimitive *prim, GL2PSlist *list) -{ - GL2PSprimitive *t1, *t2; - - if(prim->type != GL2PS_QUADRANGLE){ - gl2psListAdd(list, &prim); - } - else{ - gl2psDivideQuad(prim, &t1, &t2); - gl2psListAdd(list, &t1); - gl2psListAdd(list, &t2); - gl2psFreePrimitive(&prim); - } - -} - -static void gl2psFreeBspTree(GL2PSbsptree **tree) -{ - if(*tree){ - if((*tree)->back) gl2psFreeBspTree(&(*tree)->back); - if((*tree)->primitives){ - gl2psListAction((*tree)->primitives, gl2psFreePrimitive); - gl2psListDelete((*tree)->primitives); - } - if((*tree)->front) gl2psFreeBspTree(&(*tree)->front); - gl2psFree(*tree); - *tree = NULL; - } -} - -static GLboolean gl2psGreater(GLfloat f1, GLfloat f2) -{ - if(f1 > f2) return GL_TRUE; - else return GL_FALSE; -} - -static GLboolean gl2psLess(GLfloat f1, GLfloat f2) -{ - if(f1 < f2) return GL_TRUE; - else return GL_FALSE; -} - -static void gl2psBuildBspTree(GL2PSbsptree *tree, GL2PSlist *primitives) -{ - GL2PSprimitive *prim, *frontprim = NULL, *backprim = NULL; - GL2PSlist *frontlist, *backlist; - GLint i, index; - - tree->front = NULL; - tree->back = NULL; - tree->primitives = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); - index = gl2psFindRoot(primitives, &prim); - gl2psGetPlane(prim, tree->plane); - gl2psAddPrimitiveInList(prim, tree->primitives); - - frontlist = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); - backlist = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); - - for(i = 0; i < gl2psListNbr(primitives); i++){ - if(i != index){ - prim = *(GL2PSprimitive**)gl2psListPointer(primitives,i); - switch(gl2psSplitPrimitive(prim, tree->plane, &frontprim, &backprim)){ - case GL2PS_COINCIDENT: - gl2psAddPrimitiveInList(prim, tree->primitives); - break; - case GL2PS_IN_BACK_OF: - gl2psAddPrimitiveInList(prim, backlist); - break; - case GL2PS_IN_FRONT_OF: - gl2psAddPrimitiveInList(prim, frontlist); - break; - case GL2PS_SPANNING: - gl2psAddPrimitiveInList(backprim, backlist); - gl2psAddPrimitiveInList(frontprim, frontlist); - gl2psFreePrimitive(&prim); - break; - } - } - } - - if(gl2psListNbr(tree->primitives)){ - gl2psListSort(tree->primitives, gl2psTrianglesFirst); - } - - if(gl2psListNbr(frontlist)){ - gl2psListSort(frontlist, gl2psTrianglesFirst); - tree->front = (GL2PSbsptree*)gl2psMalloc(sizeof(GL2PSbsptree)); - gl2psBuildBspTree(tree->front, frontlist); - } - else{ - gl2psListDelete(frontlist); - } - - if(gl2psListNbr(backlist)){ - gl2psListSort(backlist, gl2psTrianglesFirst); - tree->back = (GL2PSbsptree*)gl2psMalloc(sizeof(GL2PSbsptree)); - gl2psBuildBspTree(tree->back, backlist); - } - else{ - gl2psListDelete(backlist); - } - - gl2psListDelete(primitives); -} - -static void gl2psTraverseBspTree(GL2PSbsptree *tree, GL2PSxyz eye, GLfloat epsilon, - GLboolean (*compare)(GLfloat f1, GLfloat f2), - void (*action)(void *data), int inverse) -{ - GLfloat result; - - if(!tree) return; - - result = gl2psComparePointPlane(eye, tree->plane); - - if(GL_TRUE == compare(result, epsilon)){ - gl2psTraverseBspTree(tree->back, eye, epsilon, compare, action, inverse); - if(inverse){ - gl2psListActionInverse(tree->primitives, action); - } - else{ - gl2psListAction(tree->primitives, action); - } - gl2psTraverseBspTree(tree->front, eye, epsilon, compare, action, inverse); - } - else if(GL_TRUE == compare(-epsilon, result)){ - gl2psTraverseBspTree(tree->front, eye, epsilon, compare, action, inverse); - if(inverse){ - gl2psListActionInverse(tree->primitives, action); - } - else{ - gl2psListAction(tree->primitives, action); - } - gl2psTraverseBspTree(tree->back, eye, epsilon, compare, action, inverse); - } - else{ - gl2psTraverseBspTree(tree->front, eye, epsilon, compare, action, inverse); - gl2psTraverseBspTree(tree->back, eye, epsilon, compare, action, inverse); - } -} - -static void gl2psRescaleAndOffset() -{ - GL2PSprimitive *prim; - GLfloat minZ, maxZ, rangeZ, scaleZ; - GLfloat factor, units, area, dZ, dZdX, dZdY, maxdZ; - int i, j; - - if(!gl2psListNbr(gl2ps->primitives)) - return; - - /* get z-buffer range */ - prim = *(GL2PSprimitive**)gl2psListPointer(gl2ps->primitives, 0); - minZ = maxZ = prim->verts[0].xyz[2]; - for(i = 1; i < prim->numverts; i++){ - if(prim->verts[i].xyz[2] < minZ) minZ = prim->verts[i].xyz[2]; - if(prim->verts[i].xyz[2] > maxZ) maxZ = prim->verts[i].xyz[2]; - } - for(i = 1; i < gl2psListNbr(gl2ps->primitives); i++){ - prim = *(GL2PSprimitive**)gl2psListPointer(gl2ps->primitives, i); - for(j = 0; j < prim->numverts; j++){ - if(prim->verts[j].xyz[2] < minZ) minZ = prim->verts[j].xyz[2]; - if(prim->verts[j].xyz[2] > maxZ) maxZ = prim->verts[j].xyz[2]; - } - } - rangeZ = (maxZ - minZ); - - /* rescale z-buffer coordinate in [0,GL2PS_ZSCALE], to make it of - the same order of magnitude as the x and y coordinates */ - scaleZ = GL2PS_ZERO(rangeZ) ? GL2PS_ZSCALE : (GL2PS_ZSCALE / rangeZ); - /* avoid precision loss (we use floats!) */ - if(scaleZ > 100000.F) scaleZ = 100000.F; - - /* apply offsets */ - for(i = 0; i < gl2psListNbr(gl2ps->primitives); i++){ - prim = *(GL2PSprimitive**)gl2psListPointer(gl2ps->primitives, i); - for(j = 0; j < prim->numverts; j++){ - prim->verts[j].xyz[2] = (prim->verts[j].xyz[2] - minZ) * scaleZ; - } - if((gl2ps->options & GL2PS_SIMPLE_LINE_OFFSET) && - (prim->type == GL2PS_LINE)){ - if(gl2ps->sort == GL2PS_SIMPLE_SORT){ - prim->verts[0].xyz[2] -= GL2PS_ZOFFSET_LARGE; - prim->verts[1].xyz[2] -= GL2PS_ZOFFSET_LARGE; - } - else{ - prim->verts[0].xyz[2] -= GL2PS_ZOFFSET; - prim->verts[1].xyz[2] -= GL2PS_ZOFFSET; - } - } - else if(prim->offset && (prim->type == GL2PS_TRIANGLE)){ - factor = gl2ps->offset[0]; - units = gl2ps->offset[1]; - area = - (prim->verts[1].xyz[0] - prim->verts[0].xyz[0]) * - (prim->verts[2].xyz[1] - prim->verts[1].xyz[1]) - - (prim->verts[2].xyz[0] - prim->verts[1].xyz[0]) * - (prim->verts[1].xyz[1] - prim->verts[0].xyz[1]); - if(!GL2PS_ZERO(area)){ - dZdX = - ((prim->verts[2].xyz[1] - prim->verts[1].xyz[1]) * - (prim->verts[1].xyz[2] - prim->verts[0].xyz[2]) - - (prim->verts[1].xyz[1] - prim->verts[0].xyz[1]) * - (prim->verts[2].xyz[2] - prim->verts[1].xyz[2])) / area; - dZdY = - ((prim->verts[1].xyz[0] - prim->verts[0].xyz[0]) * - (prim->verts[2].xyz[2] - prim->verts[1].xyz[2]) - - (prim->verts[2].xyz[0] - prim->verts[1].xyz[0]) * - (prim->verts[1].xyz[2] - prim->verts[0].xyz[2])) / area; - maxdZ = (GLfloat)sqrt(dZdX * dZdX + dZdY * dZdY); - } - else{ - maxdZ = 0.0F; - } - dZ = factor * maxdZ + units; - prim->verts[0].xyz[2] += dZ; - prim->verts[1].xyz[2] += dZ; - prim->verts[2].xyz[2] += dZ; - } - } -} - -/********************************************************************* - * - * 2D sorting routines (for occlusion culling) - * - *********************************************************************/ - -static GLint gl2psGetPlaneFromPoints(GL2PSxyz a, GL2PSxyz b, GL2PSplane plane) -{ - GLfloat n; - - plane[0] = b[1] - a[1]; - plane[1] = a[0] - b[0]; - n = (GLfloat)sqrt(plane[0]*plane[0] + plane[1]*plane[1]); - plane[2] = 0.0F; - if(!GL2PS_ZERO(n)){ - plane[0] /= n; - plane[1] /= n; - plane[3] = -plane[0]*a[0]-plane[1]*a[1]; - return 1; - } - else{ - plane[0] = -1.0F; - plane[1] = 0.0F; - plane[3] = a[0]; - return 0; - } -} - -static void gl2psFreeBspImageTree(GL2PSbsptree2d **tree) -{ - if(*tree){ - if((*tree)->back) gl2psFreeBspImageTree(&(*tree)->back); - if((*tree)->front) gl2psFreeBspImageTree(&(*tree)->front); - gl2psFree(*tree); - *tree = NULL; - } -} - -static GLint gl2psCheckPoint(GL2PSxyz point, GL2PSplane plane) -{ - GLfloat pt_dis; - - pt_dis = gl2psComparePointPlane(point, plane); - if(pt_dis > GL2PS_EPSILON) return GL2PS_POINT_INFRONT; - else if(pt_dis < -GL2PS_EPSILON) return GL2PS_POINT_BACK; - else return GL2PS_POINT_COINCIDENT; -} - -static void gl2psAddPlanesInBspTreeImage(GL2PSprimitive *prim, - GL2PSbsptree2d **tree) -{ - GLint ret = 0; - GLint i; - GLint offset = 0; - GL2PSbsptree2d *head = NULL, *cur = NULL; - - if((*tree == NULL) && (prim->numverts > 2)){ - /* don't cull if transparent - for(i = 0; i < prim->numverts - 1; i++) - if(prim->verts[i].rgba[3] < 1.0F) return; - */ - head = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d)); - for(i = 0; i < prim->numverts-1; i++){ - if(!gl2psGetPlaneFromPoints(prim->verts[i].xyz, - prim->verts[i+1].xyz, - head->plane)){ - if(prim->numverts-i > 3){ - offset++; - } - else{ - gl2psFree(head); - return; - } - } - else{ - break; - } - } - head->back = NULL; - head->front = NULL; - for(i = 2+offset; i < prim->numverts; i++){ - ret = gl2psCheckPoint(prim->verts[i].xyz, head->plane); - if(ret != GL2PS_POINT_COINCIDENT) break; - } - switch(ret){ - case GL2PS_POINT_INFRONT : - cur = head; - for(i = 1+offset; i < prim->numverts-1; i++){ - if(cur->front == NULL){ - cur->front = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d)); - } - if(gl2psGetPlaneFromPoints(prim->verts[i].xyz, - prim->verts[i+1].xyz, - cur->front->plane)){ - cur = cur->front; - cur->front = NULL; - cur->back = NULL; - } - } - if(cur->front == NULL){ - cur->front = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d)); - } - if(gl2psGetPlaneFromPoints(prim->verts[i].xyz, - prim->verts[offset].xyz, - cur->front->plane)){ - cur->front->front = NULL; - cur->front->back = NULL; - } - else{ - gl2psFree(cur->front); - cur->front = NULL; - } - break; - case GL2PS_POINT_BACK : - for(i = 0; i < 4; i++){ - head->plane[i] = -head->plane[i]; - } - cur = head; - for(i = 1+offset; i < prim->numverts-1; i++){ - if(cur->front == NULL){ - cur->front = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d)); - } - if(gl2psGetPlaneFromPoints(prim->verts[i+1].xyz, - prim->verts[i].xyz, - cur->front->plane)){ - cur = cur->front; - cur->front = NULL; - cur->back = NULL; - } - } - if(cur->front == NULL){ - cur->front = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d)); - } - if(gl2psGetPlaneFromPoints(prim->verts[offset].xyz, - prim->verts[i].xyz, - cur->front->plane)){ - cur->front->front = NULL; - cur->front->back = NULL; - } - else{ - gl2psFree(cur->front); - cur->front = NULL; - } - break; - default: - gl2psFree(head); - return; - } - (*tree) = head; - } -} - -static GLint gl2psCheckPrimitive(GL2PSprimitive *prim, GL2PSplane plane) -{ - GLint i; - GLint pos; - - pos = gl2psCheckPoint(prim->verts[0].xyz, plane); - for(i = 1; i < prim->numverts; i++){ - pos |= gl2psCheckPoint(prim->verts[i].xyz, plane); - if(pos == (GL2PS_POINT_INFRONT | GL2PS_POINT_BACK)) return GL2PS_SPANNING; - } - if(pos & GL2PS_POINT_INFRONT) return GL2PS_IN_FRONT_OF; - else if(pos & GL2PS_POINT_BACK) return GL2PS_IN_BACK_OF; - else return GL2PS_COINCIDENT; -} - -static GL2PSprimitive *gl2psCreateSplitPrimitive2D(GL2PSprimitive *parent, - GLshort numverts, - GL2PSvertex *vertx) -{ - GLint i; - GL2PSprimitive *child = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - - if(parent->type == GL2PS_IMAGEMAP){ - child->type = GL2PS_IMAGEMAP; - child->data.image = parent->data.image; - } - else { - switch(numverts){ - case 1 : child->type = GL2PS_POINT; break; - case 2 : child->type = GL2PS_LINE; break; - case 3 : child->type = GL2PS_TRIANGLE; break; - case 4 : child->type = GL2PS_QUADRANGLE; break; - default: child->type = GL2PS_NO_TYPE; break; /* FIXME */ - } - } - child->boundary = 0; /* FIXME: not done! */ - child->culled = parent->culled; - child->offset = parent->offset; - child->pattern = parent->pattern; - child->factor = parent->factor; - child->width = parent->width; - child->numverts = numverts; - child->verts = (GL2PSvertex*)gl2psMalloc(numverts * sizeof(GL2PSvertex)); - for(i = 0; i < numverts; i++){ - child->verts[i] = vertx[i]; - } - return child; -} - -static void gl2psSplitPrimitive2D(GL2PSprimitive *prim, - GL2PSplane plane, - GL2PSprimitive **front, - GL2PSprimitive **back) -{ - /* cur will hold the position of the current vertex - prev will hold the position of the previous vertex - prev0 will hold the position of the vertex number 0 - v1 and v2 represent the current and previous vertices, respectively - flag is set if the current vertex should be checked against the plane */ - GLint cur = -1, prev = -1, i, v1 = 0, v2 = 0, flag = 1, prev0 = -1; - - /* list of vertices that will go in front and back primitive */ - GL2PSvertex *front_list = NULL, *back_list = NULL; - - /* number of vertices in front and back list */ - GLshort front_count = 0, back_count = 0; - - for(i = 0; i <= prim->numverts; i++){ - v1 = i; - if(v1 == prim->numverts){ - if(prim->numverts < 3) break; - v1 = 0; - v2 = prim->numverts - 1; - cur = prev0; - } - else if(flag){ - cur = gl2psCheckPoint(prim->verts[v1].xyz, plane); - if(i == 0){ - prev0 = cur; - } - } - if(((prev == -1) || (prev == cur) || (prev == 0) || (cur == 0)) && - (i < prim->numverts)){ - if(cur == GL2PS_POINT_INFRONT){ - front_count++; - front_list = (GL2PSvertex*)gl2psRealloc(front_list, - sizeof(GL2PSvertex)*front_count); - front_list[front_count-1] = prim->verts[v1]; - } - else if(cur == GL2PS_POINT_BACK){ - back_count++; - back_list = (GL2PSvertex*)gl2psRealloc(back_list, - sizeof(GL2PSvertex)*back_count); - back_list[back_count-1] = prim->verts[v1]; - } - else{ - front_count++; - front_list = (GL2PSvertex*)gl2psRealloc(front_list, - sizeof(GL2PSvertex)*front_count); - front_list[front_count-1] = prim->verts[v1]; - back_count++; - back_list = (GL2PSvertex*)gl2psRealloc(back_list, - sizeof(GL2PSvertex)*back_count); - back_list[back_count-1] = prim->verts[v1]; - } - flag = 1; - } - else if((prev != cur) && (cur != 0) && (prev != 0)){ - if(v1 != 0){ - v2 = v1-1; - i--; - } - front_count++; - front_list = (GL2PSvertex*)gl2psRealloc(front_list, - sizeof(GL2PSvertex)*front_count); - gl2psCutEdge(&prim->verts[v2], &prim->verts[v1], - plane, &front_list[front_count-1]); - back_count++; - back_list = (GL2PSvertex*)gl2psRealloc(back_list, - sizeof(GL2PSvertex)*back_count); - back_list[back_count-1] = front_list[front_count-1]; - flag = 0; - } - prev = cur; - } - *front = gl2psCreateSplitPrimitive2D(prim, front_count, front_list); - *back = gl2psCreateSplitPrimitive2D(prim, back_count, back_list); - gl2psFree(front_list); - gl2psFree(back_list); -} - -static GLint gl2psAddInBspImageTree(GL2PSprimitive *prim, GL2PSbsptree2d **tree) -{ - GLint ret = 0; - GL2PSprimitive *frontprim = NULL, *backprim = NULL; - - /* FIXME: until we consider the actual extent of text strings and - pixmaps, never cull them. Otherwise the whole string/pixmap gets - culled as soon as the reference point is hidden */ - if(prim->type == GL2PS_PIXMAP || - prim->type == GL2PS_TEXT || - prim->type == GL2PS_SPECIAL){ - return 1; - } - - if(*tree == NULL){ - if((prim->type != GL2PS_IMAGEMAP) && (GL_FALSE == gl2ps->zerosurfacearea)){ - gl2psAddPlanesInBspTreeImage(gl2ps->primitivetoadd, tree); - } - return 1; - } - else{ - switch(gl2psCheckPrimitive(prim, (*tree)->plane)){ - case GL2PS_IN_BACK_OF: return gl2psAddInBspImageTree(prim, &(*tree)->back); - case GL2PS_IN_FRONT_OF: - if((*tree)->front != NULL) return gl2psAddInBspImageTree(prim, &(*tree)->front); - else return 0; - case GL2PS_SPANNING: - gl2psSplitPrimitive2D(prim, (*tree)->plane, &frontprim, &backprim); - ret = gl2psAddInBspImageTree(backprim, &(*tree)->back); - if((*tree)->front != NULL){ - if(gl2psAddInBspImageTree(frontprim, &(*tree)->front)){ - ret = 1; - } - } - gl2psFree(frontprim->verts); - gl2psFree(frontprim); - gl2psFree(backprim->verts); - gl2psFree(backprim); - return ret; - case GL2PS_COINCIDENT: - if((*tree)->back != NULL){ - gl2ps->zerosurfacearea = GL_TRUE; - ret = gl2psAddInBspImageTree(prim, &(*tree)->back); - gl2ps->zerosurfacearea = GL_FALSE; - if(ret) return ret; - } - if((*tree)->front != NULL){ - gl2ps->zerosurfacearea = GL_TRUE; - ret = gl2psAddInBspImageTree(prim, &(*tree)->front); - gl2ps->zerosurfacearea = GL_FALSE; - if(ret) return ret; - } - if(prim->type == GL2PS_LINE) return 1; - else return 0; - } - } - return 0; -} - -static void gl2psAddInImageTree(void *data) -{ - GL2PSprimitive *prim = *(GL2PSprimitive **)data; - gl2ps->primitivetoadd = prim; - if(prim->type == GL2PS_IMAGEMAP && prim->data.image->format == GL2PS_IMAGEMAP_VISIBLE){ - prim->culled = 1; - } - else if(!gl2psAddInBspImageTree(prim, &gl2ps->imagetree)){ - prim->culled = 1; - } - else if(prim->type == GL2PS_IMAGEMAP){ - prim->data.image->format = GL2PS_IMAGEMAP_VISIBLE; - } -} - -/* Boundary construction */ - -static void gl2psAddBoundaryInList(GL2PSprimitive *prim, GL2PSlist *list) -{ - GL2PSprimitive *b; - GLshort i; - GL2PSxyz c; - - c[0] = c[1] = c[2] = 0.0F; - for(i = 0; i < prim->numverts; i++){ - c[0] += prim->verts[i].xyz[0]; - c[1] += prim->verts[i].xyz[1]; - } - c[0] /= prim->numverts; - c[1] /= prim->numverts; - - for(i = 0; i < prim->numverts; i++){ - if(prim->boundary & (GLint)pow(2., i)){ - b = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - b->type = GL2PS_LINE; - b->offset = prim->offset; - b->pattern = prim->pattern; - b->factor = prim->factor; - b->culled = prim->culled; - b->width = prim->width; - b->boundary = 0; - b->numverts = 2; - b->verts = (GL2PSvertex*)gl2psMalloc(2 * sizeof(GL2PSvertex)); - -#if 0 /* FIXME: need to work on boundary offset... */ - v[0] = c[0] - prim->verts[i].xyz[0]; - v[1] = c[1] - prim->verts[i].xyz[1]; - v[2] = 0.0F; - norm = gl2psNorm(v); - v[0] /= norm; - v[1] /= norm; - b->verts[0].xyz[0] = prim->verts[i].xyz[0] +0.1*v[0]; - b->verts[0].xyz[1] = prim->verts[i].xyz[1] +0.1*v[1]; - b->verts[0].xyz[2] = prim->verts[i].xyz[2]; - v[0] = c[0] - prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[0]; - v[1] = c[1] - prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[1]; - norm = gl2psNorm(v); - v[0] /= norm; - v[1] /= norm; - b->verts[1].xyz[0] = prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[0] +0.1*v[0]; - b->verts[1].xyz[1] = prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[1] +0.1*v[1]; - b->verts[1].xyz[2] = prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[2]; -#else - b->verts[0].xyz[0] = prim->verts[i].xyz[0]; - b->verts[0].xyz[1] = prim->verts[i].xyz[1]; - b->verts[0].xyz[2] = prim->verts[i].xyz[2]; - b->verts[1].xyz[0] = prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[0]; - b->verts[1].xyz[1] = prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[1]; - b->verts[1].xyz[2] = prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[2]; -#endif - - b->verts[0].rgba[0] = 0.0F; - b->verts[0].rgba[1] = 0.0F; - b->verts[0].rgba[2] = 0.0F; - b->verts[0].rgba[3] = 0.0F; - b->verts[1].rgba[0] = 0.0F; - b->verts[1].rgba[1] = 0.0F; - b->verts[1].rgba[2] = 0.0F; - b->verts[1].rgba[3] = 0.0F; - gl2psListAdd(list, &b); - } - } - -} - -static void gl2psBuildPolygonBoundary(GL2PSbsptree *tree) -{ - GLint i; - GL2PSprimitive *prim; - - if(!tree) return; - gl2psBuildPolygonBoundary(tree->back); - for(i = 0; i < gl2psListNbr(tree->primitives); i++){ - prim = *(GL2PSprimitive**)gl2psListPointer(tree->primitives, i); - if(prim->boundary) gl2psAddBoundaryInList(prim, tree->primitives); - } - gl2psBuildPolygonBoundary(tree->front); -} - -/********************************************************************* - * - * Feedback buffer parser - * - *********************************************************************/ - -static void gl2psAddPolyPrimitive(GLshort type, GLshort numverts, - GL2PSvertex *verts, GLint offset, - GLushort pattern, GLint factor, - GLfloat width, char boundary) -{ - GL2PSprimitive *prim; - - prim = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - prim->type = type; - prim->numverts = numverts; - prim->verts = (GL2PSvertex*)gl2psMalloc(numverts * sizeof(GL2PSvertex)); - memcpy(prim->verts, verts, numverts * sizeof(GL2PSvertex)); - prim->boundary = boundary; - prim->offset = offset; - prim->pattern = pattern; - prim->factor = factor; - prim->width = width; - prim->culled = 0; - - /* FIXME: here we should have an option to split stretched - tris/quads to enhance SIMPLE_SORT */ - - gl2psListAdd(gl2ps->primitives, &prim); -} - -static GLint gl2psGetVertex(GL2PSvertex *v, GLfloat *p) -{ - GLint i; - - v->xyz[0] = p[0]; - v->xyz[1] = p[1]; - v->xyz[2] = p[2]; - - if(gl2ps->colormode == GL_COLOR_INDEX && gl2ps->colorsize > 0){ - i = (GLint)(p[3] + 0.5); - v->rgba[0] = gl2ps->colormap[i][0]; - v->rgba[1] = gl2ps->colormap[i][1]; - v->rgba[2] = gl2ps->colormap[i][2]; - v->rgba[3] = gl2ps->colormap[i][3]; - return 4; - } - else{ - v->rgba[0] = p[3]; - v->rgba[1] = p[4]; - v->rgba[2] = p[5]; - v->rgba[3] = p[6]; - return 7; - } -} - -static void gl2psParseFeedbackBuffer(GLint used) -{ - char flag; - GLushort pattern = 0; - GLboolean boundary; - GLint i, sizeoffloat, count, v, vtot, offset = 0, factor = 0, auxindex = 0; - GLfloat lwidth = 1.0F, psize = 1.0F; - GLfloat *current; - GL2PSvertex vertices[3]; - GL2PSprimitive *prim; - GL2PSimagemap *node; - - current = gl2ps->feedback; - boundary = gl2ps->boundary = GL_FALSE; - - while(used > 0){ - - if(GL_TRUE == boundary) gl2ps->boundary = GL_TRUE; - - switch((GLint)*current){ - case GL_POINT_TOKEN : - current ++; - used --; - i = gl2psGetVertex(&vertices[0], current); - current += i; - used -= i; - gl2psAddPolyPrimitive(GL2PS_POINT, 1, vertices, 0, - pattern, factor, psize, 0); - break; - case GL_LINE_TOKEN : - case GL_LINE_RESET_TOKEN : - current ++; - used --; - i = gl2psGetVertex(&vertices[0], current); - current += i; - used -= i; - i = gl2psGetVertex(&vertices[1], current); - current += i; - used -= i; - gl2psAddPolyPrimitive(GL2PS_LINE, 2, vertices, 0, - pattern, factor, lwidth, 0); - break; - case GL_POLYGON_TOKEN : - count = (GLint)current[1]; - current += 2; - used -= 2; - v = vtot = 0; - while(count > 0 && used > 0){ - i = gl2psGetVertex(&vertices[v], current); - gl2psAdaptVertexForBlending(&vertices[v]); - current += i; - used -= i; - count --; - vtot++; - if(v == 2){ - if(GL_TRUE == boundary){ - if(!count && vtot == 2) flag = 1|2|4; - else if(!count) flag = 2|4; - else if(vtot == 2) flag = 1|2; - else flag = 2; - } - else - flag = 0; - gl2psAddPolyPrimitive(GL2PS_TRIANGLE, 3, vertices, offset, - pattern, factor, 1, flag); - vertices[1] = vertices[2]; - } - else - v ++; - } - break; - case GL_BITMAP_TOKEN : - case GL_DRAW_PIXEL_TOKEN : - case GL_COPY_PIXEL_TOKEN : - current ++; - used --; - i = gl2psGetVertex(&vertices[0], current); - current += i; - used -= i; - break; - case GL_PASS_THROUGH_TOKEN : - switch((GLint)current[1]){ - case GL2PS_BEGIN_OFFSET_TOKEN : offset = 1; break; - case GL2PS_END_OFFSET_TOKEN : offset = 0; break; - case GL2PS_BEGIN_BOUNDARY_TOKEN : boundary = GL_TRUE; break; - case GL2PS_END_BOUNDARY_TOKEN : boundary = GL_FALSE; break; - case GL2PS_END_STIPPLE_TOKEN : pattern = factor = 0; break; - case GL2PS_BEGIN_BLEND_TOKEN : gl2ps->blending = GL_TRUE; break; - case GL2PS_END_BLEND_TOKEN : gl2ps->blending = GL_FALSE; break; - case GL2PS_BEGIN_STIPPLE_TOKEN : - current += 2; - used -= 2; - pattern = (GLushort)current[1]; - current += 2; - used -= 2; - factor = (GLint)current[1]; - break; - case GL2PS_SRC_BLEND_TOKEN : - current += 2; - used -= 2; - gl2ps->blendfunc[0] = (GLint)current[1]; - break; - case GL2PS_DST_BLEND_TOKEN : - current += 2; - used -= 2; - gl2ps->blendfunc[1] = (GLint)current[1]; - break; - case GL2PS_POINT_SIZE_TOKEN : - current += 2; - used -= 2; - psize = current[1]; - break; - case GL2PS_LINE_WIDTH_TOKEN : - current += 2; - used -= 2; - lwidth = current[1]; - break; - case GL2PS_IMAGEMAP_TOKEN : - prim = (GL2PSprimitive *)gl2psMalloc(sizeof(GL2PSprimitive)); - prim->type = GL2PS_IMAGEMAP; - prim->boundary = 0; - prim->numverts = 4; - prim->verts = (GL2PSvertex *)gl2psMalloc(4 * sizeof(GL2PSvertex)); - prim->culled = 0; - prim->offset = 0; - prim->pattern = 0; - prim->factor = 0; - prim->width = 1; - - node = (GL2PSimagemap*)gl2psMalloc(sizeof(GL2PSimagemap)); - node->image = (GL2PSimage*)gl2psMalloc(sizeof(GL2PSimage)); - node->image->type = 0; - node->image->format = 0; - node->next = NULL; - - if(gl2ps->imagemap_head == NULL) - gl2ps->imagemap_head = node; - else - gl2ps->imagemap_tail->next = node; - gl2ps->imagemap_tail = node; - prim->data.image = node->image; - - current += 2; used -= 2; - i = gl2psGetVertex(&prim->verts[0], ¤t[1]); - current += i; used -= i; - - node->image->width = (GLint)current[2]; - current += 2; used -= 2; - node->image->height = (GLint)current[2]; - prim->verts[0].xyz[0] = prim->verts[0].xyz[0] - (int)(node->image->width / 2) + 0.5F; - prim->verts[0].xyz[1] = prim->verts[0].xyz[1] - (int)(node->image->height / 2) + 0.5F; - for(i = 1; i < 4; i++){ - for(v = 0; v < 3; v++){ - prim->verts[i].xyz[v] = prim->verts[0].xyz[v]; - prim->verts[i].rgba[v] = prim->verts[0].rgba[v]; - } - prim->verts[i].rgba[v] = prim->verts[0].rgba[v]; - } - prim->verts[1].xyz[0] = prim->verts[1].xyz[0] + node->image->width; - prim->verts[2].xyz[0] = prim->verts[1].xyz[0]; - prim->verts[2].xyz[1] = prim->verts[2].xyz[1] + node->image->height; - prim->verts[3].xyz[1] = prim->verts[2].xyz[1]; - - sizeoffloat = sizeof(GLfloat); - v = 2 * sizeoffloat; - vtot = node->image->height + node->image->height * - ((node->image->width - 1) / 8); - node->image->pixels = (GLfloat*)gl2psMalloc(v + vtot); - node->image->pixels[0] = prim->verts[0].xyz[0]; - node->image->pixels[1] = prim->verts[0].xyz[1]; - - for(i = 0; i < vtot; i += sizeoffloat){ - current += 2; used -= 2; - if((vtot - i) >= 4) - memcpy(&(((char*)(node->image->pixels))[i + v]), &(current[2]), sizeoffloat); - else - memcpy(&(((char*)(node->image->pixels))[i + v]), &(current[2]), vtot - i); - } - current++; used--; - gl2psListAdd(gl2ps->primitives, &prim); - break; - case GL2PS_DRAW_PIXELS_TOKEN : - case GL2PS_TEXT_TOKEN : - if(auxindex < gl2psListNbr(gl2ps->auxprimitives)) - gl2psListAdd(gl2ps->primitives, - gl2psListPointer(gl2ps->auxprimitives, auxindex++)); - else - gl2psMsg(GL2PS_ERROR, "Wrong number of auxiliary tokens in buffer"); - break; - } - current += 2; - used -= 2; - break; - default : - gl2psMsg(GL2PS_WARNING, "Unknown token in buffer"); - current ++; - used --; - break; - } - } - - gl2psListReset(gl2ps->auxprimitives); -} - -/********************************************************************* - * - * PostScript routines - * - *********************************************************************/ - -static void gl2psWriteByte(unsigned char byte) -{ - unsigned char h = byte / 16; - unsigned char l = byte % 16; - gl2psPrintf("%x%x", h, l); -} - -static void gl2psPrintPostScriptPixmap(GLfloat x, GLfloat y, GL2PSimage *im) -{ - GLuint nbhex, nbyte, nrgb, nbits; - GLuint row, col, ibyte, icase; - GLfloat dr, dg, db, fgrey; - unsigned char red = 0, green = 0, blue = 0, b, grey; - GLuint width = (GLuint)im->width; - GLuint height = (GLuint)im->height; - - /* FIXME: should we define an option for these? Or just keep the - 8-bit per component case? */ - int greyscale = 0; /* set to 1 to output greyscale image */ - int nbit = 8; /* number of bits per color compoment (2, 4 or 8) */ - - if((width <= 0) || (height <= 0)) return; - - gl2psPrintf("gsave\n"); - gl2psPrintf("%.2f %.2f translate\n", x, y); - gl2psPrintf("%d %d scale\n", width, height); - - if(greyscale){ /* greyscale */ - gl2psPrintf("/picstr %d string def\n", width); - gl2psPrintf("%d %d %d\n", width, height, 8); - gl2psPrintf("[ %d 0 0 -%d 0 %d ]\n", width, height, height); - gl2psPrintf("{ currentfile picstr readhexstring pop }\n"); - gl2psPrintf("image\n"); - for(row = 0; row < height; row++){ - for(col = 0; col < width; col++){ - gl2psGetRGB(im, col, row, &dr, &dg, &db); - fgrey = (0.30F * dr + 0.59F * dg + 0.11F * db); - grey = (unsigned char)(255. * fgrey); - gl2psWriteByte(grey); - } - gl2psPrintf("\n"); - } - nbhex = width * height * 2; - gl2psPrintf("%%%% nbhex digit :%d\n", nbhex); - } - else if(nbit == 2){ /* color, 2 bits for r and g and b; rgbs following each other */ - nrgb = width * 3; - nbits = nrgb * nbit; - nbyte = nbits / 8; - if((nbyte * 8) != nbits) nbyte++; - gl2psPrintf("/rgbstr %d string def\n", nbyte); - gl2psPrintf("%d %d %d\n", width, height, nbit); - gl2psPrintf("[ %d 0 0 -%d 0 %d ]\n", width, height, height); - gl2psPrintf("{ currentfile rgbstr readhexstring pop }\n"); - gl2psPrintf("false 3\n"); - gl2psPrintf("colorimage\n"); - for(row = 0; row < height; row++){ - icase = 1; - col = 0; - b = 0; - for(ibyte = 0; ibyte < nbyte; ibyte++){ - if(icase == 1) { - if(col < width) { - gl2psGetRGB(im, col, row, &dr, &dg, &db); - } - else { - dr = dg = db = 0; - } - col++; - red = (unsigned char)(3. * dr); - green = (unsigned char)(3. * dg); - blue = (unsigned char)(3. * db); - b = red; - b = (b<<2) + green; - b = (b<<2) + blue; - if(col < width) { - gl2psGetRGB(im, col, row, &dr, &dg, &db); - } - else { - dr = dg = db = 0; - } - col++; - red = (unsigned char)(3. * dr); - green = (unsigned char)(3. * dg); - blue = (unsigned char)(3. * db); - b = (b<<2) + red; - gl2psWriteByte(b); - b = 0; - icase++; - } - else if(icase == 2) { - b = green; - b = (b<<2) + blue; - if(col < width) { - gl2psGetRGB(im, col, row, &dr, &dg, &db); - } - else { - dr = dg = db = 0; - } - col++; - red = (unsigned char)(3. * dr); - green = (unsigned char)(3. * dg); - blue = (unsigned char)(3. * db); - b = (b<<2) + red; - b = (b<<2) + green; - gl2psWriteByte(b); - b = 0; - icase++; - } - else if(icase == 3) { - b = blue; - if(col < width) { - gl2psGetRGB(im, col, row, &dr, &dg, &db); - } - else { - dr = dg = db = 0; - } - col++; - red = (unsigned char)(3. * dr); - green = (unsigned char)(3. * dg); - blue = (unsigned char)(3. * db); - b = (b<<2) + red; - b = (b<<2) + green; - b = (b<<2) + blue; - gl2psWriteByte(b); - b = 0; - icase = 1; - } - } - gl2psPrintf("\n"); - } - } - else if(nbit == 4){ /* color, 4 bits for r and g and b; rgbs following each other */ - nrgb = width * 3; - nbits = nrgb * nbit; - nbyte = nbits / 8; - if((nbyte * 8) != nbits) nbyte++; - gl2psPrintf("/rgbstr %d string def\n", nbyte); - gl2psPrintf("%d %d %d\n", width, height, nbit); - gl2psPrintf("[ %d 0 0 -%d 0 %d ]\n", width, height, height); - gl2psPrintf("{ currentfile rgbstr readhexstring pop }\n"); - gl2psPrintf("false 3\n"); - gl2psPrintf("colorimage\n"); - for(row = 0; row < height; row++){ - col = 0; - icase = 1; - for(ibyte = 0; ibyte < nbyte; ibyte++){ - if(icase == 1) { - if(col < width) { - gl2psGetRGB(im, col, row, &dr, &dg, &db); - } - else { - dr = dg = db = 0; - } - col++; - red = (unsigned char)(15. * dr); - green = (unsigned char)(15. * dg); - gl2psPrintf("%x%x", red, green); - icase++; - } - else if(icase == 2) { - blue = (unsigned char)(15. * db); - if(col < width) { - gl2psGetRGB(im, col, row, &dr, &dg, &db); - } - else { - dr = dg = db = 0; - } - col++; - red = (unsigned char)(15. * dr); - gl2psPrintf("%x%x", blue, red); - icase++; - } - else if(icase == 3) { - green = (unsigned char)(15. * dg); - blue = (unsigned char)(15. * db); - gl2psPrintf("%x%x", green, blue); - icase = 1; - } - } - gl2psPrintf("\n"); - } - } - else{ /* 8 bit for r and g and b */ - nbyte = width * 3; - gl2psPrintf("/rgbstr %d string def\n", nbyte); - gl2psPrintf("%d %d %d\n", width, height, 8); - gl2psPrintf("[ %d 0 0 -%d 0 %d ]\n", width, height, height); - gl2psPrintf("{ currentfile rgbstr readhexstring pop }\n"); - gl2psPrintf("false 3\n"); - gl2psPrintf("colorimage\n"); - for(row = 0; row < height; row++){ - for(col = 0; col < width; col++){ - gl2psGetRGB(im, col, row, &dr, &dg, &db); - red = (unsigned char)(255. * dr); - gl2psWriteByte(red); - green = (unsigned char)(255. * dg); - gl2psWriteByte(green); - blue = (unsigned char)(255. * db); - gl2psWriteByte(blue); - } - gl2psPrintf("\n"); - } - } - - gl2psPrintf("grestore\n"); -} - -static void gl2psPrintPostScriptImagemap(GLfloat x, GLfloat y, - GLsizei width, GLsizei height, - const unsigned char *imagemap){ - int i, size; - - if((width <= 0) || (height <= 0)) return; - - size = height + height * (width - 1) / 8; - - gl2psPrintf("gsave\n"); - gl2psPrintf("%.2f %.2f translate\n", x, y); - gl2psPrintf("%d %d scale\n%d %d\ntrue\n", width, height,width, height); - gl2psPrintf("[ %d 0 0 -%d 0 %d ] {<", width, height); - for(i = 0; i < size; i++){ - gl2psWriteByte(*imagemap); - imagemap++; - } - gl2psPrintf(">} imagemask\ngrestore\n"); -} - -static void gl2psPrintPostScriptHeader(void) -{ - time_t now; - - /* Since compression is not part of the PostScript standard, - compressed PostScript files are just gzipped PostScript files - ("ps.gz" or "eps.gz") */ - gl2psPrintGzipHeader(); - - time(&now); - - if(gl2ps->format == GL2PS_PS){ - gl2psPrintf("%%!PS-Adobe-3.0\n"); - } - else{ - gl2psPrintf("%%!PS-Adobe-3.0 EPSF-3.0\n"); - } - - gl2psPrintf("%%%%Title: %s\n" - "%%%%Creator: GL2PS %d.%d.%d%s, %s\n" - "%%%%For: %s\n" - "%%%%CreationDate: %s" - "%%%%LanguageLevel: 3\n" - "%%%%DocumentData: Clean7Bit\n" - "%%%%Pages: 1\n", - gl2ps->title, GL2PS_MAJOR_VERSION, GL2PS_MINOR_VERSION, - GL2PS_PATCH_VERSION, GL2PS_EXTRA_VERSION, GL2PS_COPYRIGHT, - gl2ps->producer, ctime(&now)); - - if(gl2ps->format == GL2PS_PS){ - gl2psPrintf("%%%%Orientation: %s\n" - "%%%%DocumentMedia: Default %d %d 0 () ()\n", - (gl2ps->options & GL2PS_LANDSCAPE) ? "Landscape" : "Portrait", - (gl2ps->options & GL2PS_LANDSCAPE) ? (int)gl2ps->viewport[3] : - (int)gl2ps->viewport[2], - (gl2ps->options & GL2PS_LANDSCAPE) ? (int)gl2ps->viewport[2] : - (int)gl2ps->viewport[3]); - } - - gl2psPrintf("%%%%BoundingBox: %d %d %d %d\n" - "%%%%EndComments\n", - (gl2ps->options & GL2PS_LANDSCAPE) ? (int)gl2ps->viewport[1] : - (int)gl2ps->viewport[0], - (gl2ps->options & GL2PS_LANDSCAPE) ? (int)gl2ps->viewport[0] : - (int)gl2ps->viewport[1], - (gl2ps->options & GL2PS_LANDSCAPE) ? (int)gl2ps->viewport[3] : - (int)gl2ps->viewport[2], - (gl2ps->options & GL2PS_LANDSCAPE) ? (int)gl2ps->viewport[2] : - (int)gl2ps->viewport[3]); - - /* RGB color: r g b C (replace C by G in output to change from rgb to gray) - Grayscale: r g b G - Font choose: size fontname FC - Text string: (string) x y size fontname S?? - Rotated text string: (string) angle x y size fontname S??R - Point primitive: x y size P - Line width: width W - Line start: x y LS - Line joining last point: x y L - Line end: x y LE - Flat-shaded triangle: x3 y3 x2 y2 x1 y1 T - Smooth-shaded triangle: x3 y3 r3 g3 b3 x2 y2 r2 g2 b2 x1 y1 r1 g1 b1 ST */ - - gl2psPrintf("%%%%BeginProlog\n" - "/gl2psdict 64 dict def gl2psdict begin\n" - "0 setlinecap 0 setlinejoin\n" - "/tryPS3shading %s def %% set to false to force subdivision\n" - "/rThreshold %g def %% red component subdivision threshold\n" - "/gThreshold %g def %% green component subdivision threshold\n" - "/bThreshold %g def %% blue component subdivision threshold\n", - (gl2ps->options & GL2PS_NO_PS3_SHADING) ? "false" : "true", - gl2ps->threshold[0], gl2ps->threshold[1], gl2ps->threshold[2]); - - gl2psPrintf("/BD { bind def } bind def\n" - "/C { setrgbcolor } BD\n" - "/G { 0.082 mul exch 0.6094 mul add exch 0.3086 mul add neg 1.0 add setgray } BD\n" - "/W { setlinewidth } BD\n"); - - gl2psPrintf("/FC { findfont exch /SH exch def SH scalefont setfont } BD\n" - "/SW { dup stringwidth pop } BD\n" - "/S { FC moveto show } BD\n" - "/SBC{ FC moveto SW -2 div 0 rmoveto show } BD\n" - "/SBR{ FC moveto SW neg 0 rmoveto show } BD\n" - "/SCL{ FC moveto 0 SH -2 div rmoveto show } BD\n" - "/SCC{ FC moveto SW -2 div SH -2 div rmoveto show } BD\n" - "/SCR{ FC moveto SW neg SH -2 div rmoveto show } BD\n" - "/STL{ FC moveto 0 SH neg rmoveto show } BD\n" - "/STC{ FC moveto SW -2 div SH neg rmoveto show } BD\n" - "/STR{ FC moveto SW neg SH neg rmoveto show } BD\n"); - - /* rotated text routines: same nameanem with R appended */ - - gl2psPrintf("/FCT { FC translate 0 0 } BD\n" - "/SR { gsave FCT moveto rotate show grestore } BD\n" - "/SBCR{ gsave FCT moveto rotate SW -2 div 0 rmoveto show grestore } BD\n" - "/SBRR{ gsave FCT moveto rotate SW neg 0 rmoveto show grestore } BD\n" - "/SCLR{ gsave FCT moveto rotate 0 SH -2 div rmoveto show grestore} BD\n"); - gl2psPrintf("/SCCR{ gsave FCT moveto rotate SW -2 div SH -2 div rmoveto show grestore} BD\n" - "/SCRR{ gsave FCT moveto rotate SW neg SH -2 div rmoveto show grestore} BD\n" - "/STLR{ gsave FCT moveto rotate 0 SH neg rmoveto show grestore } BD\n" - "/STCR{ gsave FCT moveto rotate SW -2 div SH neg rmoveto show grestore } BD\n" - "/STRR{ gsave FCT moveto rotate SW neg SH neg rmoveto show grestore } BD\n"); - - gl2psPrintf("/P { newpath 0.0 360.0 arc closepath fill } BD\n" - "/LS { newpath moveto } BD\n" - "/L { lineto } BD\n" - "/LE { lineto stroke } BD\n" - "/T { newpath moveto lineto lineto closepath fill } BD\n"); - - /* Smooth-shaded triangle with PostScript level 3 shfill operator: - x3 y3 r3 g3 b3 x2 y2 r2 g2 b2 x1 y1 r1 g1 b1 STshfill */ - - gl2psPrintf("/STshfill {\n" - " /b1 exch def /g1 exch def /r1 exch def /y1 exch def /x1 exch def\n" - " /b2 exch def /g2 exch def /r2 exch def /y2 exch def /x2 exch def\n" - " /b3 exch def /g3 exch def /r3 exch def /y3 exch def /x3 exch def\n" - " gsave << /ShadingType 4 /ColorSpace [/DeviceRGB]\n" - " /DataSource [ 0 x1 y1 r1 g1 b1 0 x2 y2 r2 g2 b2 0 x3 y3 r3 g3 b3 ] >>\n" - " shfill grestore } BD\n"); - - /* Flat-shaded triangle with middle color: - x3 y3 r3 g3 b3 x2 y2 r2 g2 b2 x1 y1 r1 g1 b1 Tm */ - - gl2psPrintf(/* stack : x3 y3 r3 g3 b3 x2 y2 r2 g2 b2 x1 y1 r1 g1 b1 */ - "/Tm { 3 -1 roll 8 -1 roll 13 -1 roll add add 3 div\n" /* r = (r1+r2+r3)/3 */ - /* stack : x3 y3 g3 b3 x2 y2 g2 b2 x1 y1 g1 b1 r */ - " 3 -1 roll 7 -1 roll 11 -1 roll add add 3 div\n" /* g = (g1+g2+g3)/3 */ - /* stack : x3 y3 b3 x2 y2 b2 x1 y1 b1 r g b */ - " 3 -1 roll 6 -1 roll 9 -1 roll add add 3 div" /* b = (b1+b2+b3)/3 */ - /* stack : x3 y3 x2 y2 x1 y1 r g b */ - " C T } BD\n"); - - /* Split triangle in four sub-triangles (at sides middle points) and call the - STnoshfill procedure on each, interpolating the colors in RGB space: - x3 y3 r3 g3 b3 x2 y2 r2 g2 b2 x1 y1 r1 g1 b1 STsplit - (in procedure comments key: (Vi) = xi yi ri gi bi) */ - - gl2psPrintf("/STsplit {\n" - " 4 index 15 index add 0.5 mul\n" /* x13 = (x1+x3)/2 */ - " 4 index 15 index add 0.5 mul\n" /* y13 = (y1+y3)/2 */ - " 4 index 15 index add 0.5 mul\n" /* r13 = (r1+r3)/2 */ - " 4 index 15 index add 0.5 mul\n" /* g13 = (g1+g3)/2 */ - " 4 index 15 index add 0.5 mul\n" /* b13 = (b1+b3)/2 */ - " 5 copy 5 copy 25 15 roll\n"); - - /* at his point, stack = (V3) (V13) (V13) (V13) (V2) (V1) */ - - gl2psPrintf(" 9 index 30 index add 0.5 mul\n" /* x23 = (x2+x3)/2 */ - " 9 index 30 index add 0.5 mul\n" /* y23 = (y2+y3)/2 */ - " 9 index 30 index add 0.5 mul\n" /* r23 = (r2+r3)/2 */ - " 9 index 30 index add 0.5 mul\n" /* g23 = (g2+g3)/2 */ - " 9 index 30 index add 0.5 mul\n" /* b23 = (b2+b3)/2 */ - " 5 copy 5 copy 35 5 roll 25 5 roll 15 5 roll\n"); - - /* stack = (V3) (V13) (V23) (V13) (V23) (V13) (V23) (V2) (V1) */ - - gl2psPrintf(" 4 index 10 index add 0.5 mul\n" /* x12 = (x1+x2)/2 */ - " 4 index 10 index add 0.5 mul\n" /* y12 = (y1+y2)/2 */ - " 4 index 10 index add 0.5 mul\n" /* r12 = (r1+r2)/2 */ - " 4 index 10 index add 0.5 mul\n" /* g12 = (g1+g2)/2 */ - " 4 index 10 index add 0.5 mul\n" /* b12 = (b1+b2)/2 */ - " 5 copy 5 copy 40 5 roll 25 5 roll 15 5 roll 25 5 roll\n"); - - /* stack = (V3) (V13) (V23) (V13) (V12) (V23) (V13) (V1) (V12) (V23) (V12) (V2) */ - - gl2psPrintf(" STnoshfill STnoshfill STnoshfill STnoshfill } BD\n"); - - /* Gouraud shaded triangle using recursive subdivision until the difference - between corner colors does not exceed the thresholds: - x3 y3 r3 g3 b3 x2 y2 r2 g2 b2 x1 y1 r1 g1 b1 STnoshfill */ - - gl2psPrintf("/STnoshfill {\n" - " 2 index 8 index sub abs rThreshold gt\n" /* |r1-r2|>rth */ - " { STsplit }\n" - " { 1 index 7 index sub abs gThreshold gt\n" /* |g1-g2|>gth */ - " { STsplit }\n" - " { dup 6 index sub abs bThreshold gt\n" /* |b1-b2|>bth */ - " { STsplit }\n" - " { 2 index 13 index sub abs rThreshold gt\n" /* |r1-r3|>rht */ - " { STsplit }\n" - " { 1 index 12 index sub abs gThreshold gt\n" /* |g1-g3|>gth */ - " { STsplit }\n" - " { dup 11 index sub abs bThreshold gt\n" /* |b1-b3|>bth */ - " { STsplit }\n" - " { 7 index 13 index sub abs rThreshold gt\n"); /* |r2-r3|>rht */ - gl2psPrintf(" { STsplit }\n" - " { 6 index 12 index sub abs gThreshold gt\n" /* |g2-g3|>gth */ - " { STsplit }\n" - " { 5 index 11 index sub abs bThreshold gt\n" /* |b2-b3|>bth */ - " { STsplit }\n" - " { Tm }\n" /* all colors sufficiently similar */ - " ifelse }\n" - " ifelse }\n" - " ifelse }\n" - " ifelse }\n" - " ifelse }\n" - " ifelse }\n" - " ifelse }\n" - " ifelse }\n" - " ifelse } BD\n"); - - gl2psPrintf("tryPS3shading\n" - "{ /shfill where\n" - " { /ST { STshfill } BD }\n" - " { /ST { STnoshfill } BD }\n" - " ifelse }\n" - "{ /ST { STnoshfill } BD }\n" - "ifelse\n"); - - gl2psPrintf("end\n" - "%%%%EndProlog\n" - "%%%%BeginSetup\n" - "/DeviceRGB setcolorspace\n" - "gl2psdict begin\n" - "%%%%EndSetup\n" - "%%%%Page: 1 1\n" - "%%%%BeginPageSetup\n"); - - if(gl2ps->options & GL2PS_LANDSCAPE){ - gl2psPrintf("%d 0 translate 90 rotate\n", - (int)gl2ps->viewport[3]); - } - - gl2psPrintf("%%%%EndPageSetup\n" - "mark\n" - "gsave\n" - "1.0 1.0 scale\n"); - - if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ - gl2psPrintf("%g %g %g C\n" - "newpath %d %d moveto %d %d lineto %d %d lineto %d %d lineto\n" - "closepath fill\n", - gl2ps->bgcolor[0], gl2ps->bgcolor[1], gl2ps->bgcolor[2], - (int)gl2ps->viewport[0], (int)gl2ps->viewport[1], (int)gl2ps->viewport[2], - (int)gl2ps->viewport[1], (int)gl2ps->viewport[2], (int)gl2ps->viewport[3], - (int)gl2ps->viewport[0], (int)gl2ps->viewport[3]); - } -} - -static void gl2psPrintPostScriptColor(GL2PSrgba rgba) -{ - if(!gl2psSameColor(gl2ps->lastrgba, rgba)){ - gl2psSetLastColor(rgba); - gl2psPrintf("%g %g %g C\n", rgba[0], rgba[1], rgba[2]); - } -} - -static void gl2psResetPostScriptColor(void) -{ - gl2ps->lastrgba[0] = gl2ps->lastrgba[1] = gl2ps->lastrgba[2] = -1.; -} - -static void gl2psEndPostScriptLine(void) -{ - int i; - if(gl2ps->lastvertex.rgba[0] >= 0.){ - gl2psPrintf("%g %g LE\n", gl2ps->lastvertex.xyz[0], gl2ps->lastvertex.xyz[1]); - for(i = 0; i < 3; i++) - gl2ps->lastvertex.xyz[i] = -1.; - for(i = 0; i < 4; i++) - gl2ps->lastvertex.rgba[i] = -1.; - } -} - -static void gl2psParseStipplePattern(GLushort pattern, GLint factor, - int *nb, int array[10]) -{ - int i, n; - int on[8] = {0, 0, 0, 0, 0, 0, 0, 0}; - int off[8] = {0, 0, 0, 0, 0, 0, 0, 0}; - char tmp[16]; - - /* extract the 16 bits from the OpenGL stipple pattern */ - for(n = 15; n >= 0; n--){ - tmp[n] = (char)(pattern & 0x01); - pattern >>= 1; - } - /* compute the on/off pixel sequence */ - n = 0; - for(i = 0; i < 8; i++){ - while(n < 16 && !tmp[n]){ off[i]++; n++; } - while(n < 16 && tmp[n]){ on[i]++; n++; } - if(n >= 15){ i++; break; } - } - - /* store the on/off array from right to left, starting with off - pixels. The PostScript specification allows for at most 11 - elements in the on/off array, so we limit ourselves to 5 on/off - couples (our longest possible array is thus [on4 off4 on3 off3 - on2 off2 on1 off1 on0 off0]) */ - *nb = 0; - for(n = i - 1; n >= 0; n--){ - array[(*nb)++] = factor * on[n]; - array[(*nb)++] = factor * off[n]; - if(*nb == 10) break; - } -} - -static int gl2psPrintPostScriptDash(GLushort pattern, GLint factor, const char *str) -{ - int len = 0, i, n, array[10]; - - if(pattern == gl2ps->lastpattern && factor == gl2ps->lastfactor) - return 0; - - gl2ps->lastpattern = pattern; - gl2ps->lastfactor = factor; - - if(!pattern || !factor){ - /* solid line */ - len += gl2psPrintf("[] 0 %s\n", str); - } - else{ - gl2psParseStipplePattern(pattern, factor, &n, array); - len += gl2psPrintf("["); - for(i = 0; i < n; i++){ - if(i) len += gl2psPrintf(" "); - len += gl2psPrintf("%d", array[i]); - } - len += gl2psPrintf("] 0 %s\n", str); - } - - return len; -} - -static void gl2psPrintPostScriptPrimitive(void *data) -{ - int newline; - GL2PSprimitive *prim; - - prim = *(GL2PSprimitive**)data; - - if((gl2ps->options & GL2PS_OCCLUSION_CULL) && prim->culled) return; - - /* Every effort is made to draw lines as connected segments (i.e., - using a single PostScript path): this is the only way to get nice - line joins and to not restart the stippling for every line - segment. So if the primitive to print is not a line we must first - finish the current line (if any): */ - if(prim->type != GL2PS_LINE) gl2psEndPostScriptLine(); - - switch(prim->type){ - case GL2PS_POINT : - gl2psPrintPostScriptColor(prim->verts[0].rgba); - gl2psPrintf("%g %g %g P\n", - prim->verts[0].xyz[0], prim->verts[0].xyz[1], 0.5 * prim->width); - break; - case GL2PS_LINE : - if(!gl2psSamePosition(gl2ps->lastvertex.xyz, prim->verts[0].xyz) || - !gl2psSameColor(gl2ps->lastrgba, prim->verts[0].rgba) || - gl2ps->lastlinewidth != prim->width || - gl2ps->lastpattern != prim->pattern || - gl2ps->lastfactor != prim->factor){ - /* End the current line if the new segment does not start where - the last one ended, or if the color, the width or the - stippling have changed (multi-stroking lines with changing - colors is necessary until we use /shfill for lines; - unfortunately this means that at the moment we can screw up - line stippling for smooth-shaded lines) */ - gl2psEndPostScriptLine(); - newline = 1; - } - else{ - newline = 0; - } - if(gl2ps->lastlinewidth != prim->width){ - gl2ps->lastlinewidth = prim->width; - gl2psPrintf("%g W\n", gl2ps->lastlinewidth); - } - gl2psPrintPostScriptDash(prim->pattern, prim->factor, "setdash"); - gl2psPrintPostScriptColor(prim->verts[0].rgba); - gl2psPrintf("%g %g %s\n", prim->verts[0].xyz[0], prim->verts[0].xyz[1], - newline ? "LS" : "L"); - gl2ps->lastvertex = prim->verts[1]; - break; - case GL2PS_TRIANGLE : - if(!gl2psVertsSameColor(prim)){ - gl2psResetPostScriptColor(); - gl2psPrintf("%g %g %g %g %g %g %g %g %g %g %g %g %g %g %g ST\n", - prim->verts[2].xyz[0], prim->verts[2].xyz[1], - prim->verts[2].rgba[0], prim->verts[2].rgba[1], - prim->verts[2].rgba[2], prim->verts[1].xyz[0], - prim->verts[1].xyz[1], prim->verts[1].rgba[0], - prim->verts[1].rgba[1], prim->verts[1].rgba[2], - prim->verts[0].xyz[0], prim->verts[0].xyz[1], - prim->verts[0].rgba[0], prim->verts[0].rgba[1], - prim->verts[0].rgba[2]); - } - else{ - gl2psPrintPostScriptColor(prim->verts[0].rgba); - gl2psPrintf("%g %g %g %g %g %g T\n", - prim->verts[2].xyz[0], prim->verts[2].xyz[1], - prim->verts[1].xyz[0], prim->verts[1].xyz[1], - prim->verts[0].xyz[0], prim->verts[0].xyz[1]); - } - break; - case GL2PS_QUADRANGLE : - gl2psMsg(GL2PS_WARNING, "There should not be any quad left to print"); - break; - case GL2PS_PIXMAP : - gl2psPrintPostScriptPixmap(prim->verts[0].xyz[0], prim->verts[0].xyz[1], - prim->data.image); - break; - case GL2PS_IMAGEMAP : - if(prim->data.image->type != GL2PS_IMAGEMAP_WRITTEN){ - gl2psPrintPostScriptColor(prim->verts[0].rgba); - gl2psPrintPostScriptImagemap(prim->data.image->pixels[0], - prim->data.image->pixels[1], - prim->data.image->width, prim->data.image->height, - (const unsigned char*)(&(prim->data.image->pixels[2]))); - prim->data.image->type = GL2PS_IMAGEMAP_WRITTEN; - } - break; - case GL2PS_TEXT : - gl2psPrintPostScriptColor(prim->verts[0].rgba); - gl2psPrintf("(%s) ", prim->data.text->str); - if(prim->data.text->angle) - gl2psPrintf("%g ", prim->data.text->angle); - gl2psPrintf("%g %g %d /%s ", - prim->verts[0].xyz[0], prim->verts[0].xyz[1], - prim->data.text->fontsize, prim->data.text->fontname); - switch(prim->data.text->alignment){ - case GL2PS_TEXT_C: - gl2psPrintf(prim->data.text->angle ? "SCCR\n" : "SCC\n"); - break; - case GL2PS_TEXT_CL: - gl2psPrintf(prim->data.text->angle ? "SCLR\n" : "SCL\n"); - break; - case GL2PS_TEXT_CR: - gl2psPrintf(prim->data.text->angle ? "SCRR\n" : "SCR\n"); - break; - case GL2PS_TEXT_B: - gl2psPrintf(prim->data.text->angle ? "SBCR\n" : "SBC\n"); - break; - case GL2PS_TEXT_BR: - gl2psPrintf(prim->data.text->angle ? "SBRR\n" : "SBR\n"); - break; - case GL2PS_TEXT_T: - gl2psPrintf(prim->data.text->angle ? "STCR\n" : "STC\n"); - break; - case GL2PS_TEXT_TL: - gl2psPrintf(prim->data.text->angle ? "STLR\n" : "STL\n"); - break; - case GL2PS_TEXT_TR: - gl2psPrintf(prim->data.text->angle ? "STRR\n" : "STR\n"); - break; - case GL2PS_TEXT_BL: - default: - gl2psPrintf(prim->data.text->angle ? "SR\n" : "S\n"); - break; - } - break; - case GL2PS_SPECIAL : - /* alignment contains the format for which the special output text - is intended */ - if(prim->data.text->alignment == GL2PS_PS || - prim->data.text->alignment == GL2PS_EPS) - gl2psPrintf("%s\n", prim->data.text->str); - break; - default : - break; - } -} - -static void gl2psPrintPostScriptFooter(void) -{ - gl2psPrintf("grestore\n" - "showpage\n" - "cleartomark\n" - "%%%%PageTrailer\n" - "%%%%Trailer\n" - "end\n" - "%%%%EOF\n"); - - gl2psPrintGzipFooter(); -} - -static void gl2psPrintPostScriptBeginViewport(GLint viewport[4]) -{ - GLint index; - GLfloat rgba[4]; - int x = viewport[0], y = viewport[1], w = viewport[2], h = viewport[3]; - - glRenderMode(GL_FEEDBACK); - - if(gl2ps->header){ - gl2psPrintPostScriptHeader(); - gl2ps->header = GL_FALSE; - } - - gl2psPrintf("gsave\n" - "1.0 1.0 scale\n"); - - if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ - if(gl2ps->colormode == GL_RGBA || gl2ps->colorsize == 0){ - glGetFloatv(GL_COLOR_CLEAR_VALUE, rgba); - } - else{ - glGetIntegerv(GL_INDEX_CLEAR_VALUE, &index); - rgba[0] = gl2ps->colormap[index][0]; - rgba[1] = gl2ps->colormap[index][1]; - rgba[2] = gl2ps->colormap[index][2]; - rgba[3] = 1.0F; - } - gl2psPrintf("%g %g %g C\n" - "newpath %d %d moveto %d %d lineto %d %d lineto %d %d lineto\n" - "closepath fill\n", - rgba[0], rgba[1], rgba[2], - x, y, x+w, y, x+w, y+h, x, y+h); - } - - gl2psPrintf("newpath %d %d moveto %d %d lineto %d %d lineto %d %d lineto\n" - "closepath clip\n", - x, y, x+w, y, x+w, y+h, x, y+h); - -} - -static GLint gl2psPrintPostScriptEndViewport(void) -{ - GLint res; - - res = gl2psPrintPrimitives(); - gl2psPrintf("grestore\n"); - return res; -} - -static void gl2psPrintPostScriptFinalPrimitive(void) -{ - /* End any remaining line, if any */ - gl2psEndPostScriptLine(); -} - -/* definition of the PostScript and Encapsulated PostScript backends */ - -static GL2PSbackend gl2psPS = { - gl2psPrintPostScriptHeader, - gl2psPrintPostScriptFooter, - gl2psPrintPostScriptBeginViewport, - gl2psPrintPostScriptEndViewport, - gl2psPrintPostScriptPrimitive, - gl2psPrintPostScriptFinalPrimitive, - "ps", - "Postscript" -}; - -static GL2PSbackend gl2psEPS = { - gl2psPrintPostScriptHeader, - gl2psPrintPostScriptFooter, - gl2psPrintPostScriptBeginViewport, - gl2psPrintPostScriptEndViewport, - gl2psPrintPostScriptPrimitive, - gl2psPrintPostScriptFinalPrimitive, - "eps", - "Encapsulated Postscript" -}; - -/********************************************************************* - * - * LaTeX routines - * - *********************************************************************/ - -static void gl2psPrintTeXHeader(void) -{ - char name[256]; - time_t now; - int i; - - if(gl2ps->filename && strlen(gl2ps->filename) < 256){ - for(i = strlen(gl2ps->filename)-1; i >= 0; i--){ - if(gl2ps->filename[i] == '.'){ - strncpy(name, gl2ps->filename, i); - name[i] = '\0'; - break; - } - } - if(i <= 0) strcpy(name, gl2ps->filename); - } - else{ - strcpy(name, "untitled"); - } - - time(&now); - - fprintf(gl2ps->stream, - "%% Title: %s\n" - "%% Creator: GL2PS %d.%d.%d%s, %s\n" - "%% For: %s\n" - "%% CreationDate: %s", - gl2ps->title, GL2PS_MAJOR_VERSION, GL2PS_MINOR_VERSION, - GL2PS_PATCH_VERSION, GL2PS_EXTRA_VERSION, GL2PS_COPYRIGHT, - gl2ps->producer, ctime(&now)); - - fprintf(gl2ps->stream, - "\\setlength{\\unitlength}{1pt}\n" - "\\begin{picture}(0,0)\n" - "\\includegraphics{%s}\n" - "\\end{picture}%%\n" - "%s\\begin{picture}(%d,%d)(0,0)\n", - name, (gl2ps->options & GL2PS_LANDSCAPE) ? "\\rotatebox{90}{" : "", - (int)gl2ps->viewport[2], (int)gl2ps->viewport[3]); -} - -static void gl2psPrintTeXPrimitive(void *data) -{ - GL2PSprimitive *prim; - - prim = *(GL2PSprimitive**)data; - - switch(prim->type){ - case GL2PS_TEXT : - fprintf(gl2ps->stream, "\\fontsize{%d}{0}\n\\selectfont", - prim->data.text->fontsize); - fprintf(gl2ps->stream, "\\put(%g,%g){\\makebox(0,0)", - prim->verts[0].xyz[0], prim->verts[0].xyz[1]); - switch(prim->data.text->alignment){ - case GL2PS_TEXT_C: - fprintf(gl2ps->stream, "{"); - break; - case GL2PS_TEXT_CL: - fprintf(gl2ps->stream, "[l]{"); - break; - case GL2PS_TEXT_CR: - fprintf(gl2ps->stream, "[r]{"); - break; - case GL2PS_TEXT_B: - fprintf(gl2ps->stream, "[b]{"); - break; - case GL2PS_TEXT_BR: - fprintf(gl2ps->stream, "[br]{"); - break; - case GL2PS_TEXT_T: - fprintf(gl2ps->stream, "[t]{"); - break; - case GL2PS_TEXT_TL: - fprintf(gl2ps->stream, "[tl]{"); - break; - case GL2PS_TEXT_TR: - fprintf(gl2ps->stream, "[tr]{"); - break; - case GL2PS_TEXT_BL: - default: - fprintf(gl2ps->stream, "[bl]{"); - break; - } - if(prim->data.text->angle) - fprintf(gl2ps->stream, "\\rotatebox{%g}{", prim->data.text->angle); - fprintf(gl2ps->stream, "\\textcolor[rgb]{%g,%g,%g}{{%s}}", - prim->verts[0].rgba[0], prim->verts[0].rgba[1], prim->verts[0].rgba[2], - prim->data.text->str); - if(prim->data.text->angle) - fprintf(gl2ps->stream, "}"); - fprintf(gl2ps->stream, "}}\n"); - break; - case GL2PS_SPECIAL : - /* alignment contains the format for which the special output text - is intended */ - if (prim->data.text->alignment == GL2PS_TEX) - fprintf(gl2ps->stream, "%s\n", prim->data.text->str); - break; - default : - break; - } -} - -static void gl2psPrintTeXFooter(void) -{ - fprintf(gl2ps->stream, "\\end{picture}%s\n", - (gl2ps->options & GL2PS_LANDSCAPE) ? "}" : ""); -} - -static void gl2psPrintTeXBeginViewport(GLint viewport[4]) -{ - glRenderMode(GL_FEEDBACK); - - if(gl2ps->header){ - gl2psPrintTeXHeader(); - gl2ps->header = GL_FALSE; - } -} - -static GLint gl2psPrintTeXEndViewport(void) -{ - return gl2psPrintPrimitives(); -} - -static void gl2psPrintTeXFinalPrimitive(void) -{ -} - -/* definition of the LaTeX backend */ - -static GL2PSbackend gl2psTEX = { - gl2psPrintTeXHeader, - gl2psPrintTeXFooter, - gl2psPrintTeXBeginViewport, - gl2psPrintTeXEndViewport, - gl2psPrintTeXPrimitive, - gl2psPrintTeXFinalPrimitive, - "tex", - "LaTeX text" -}; - -/********************************************************************* - * - * PDF routines - * - *********************************************************************/ - -static int gl2psPrintPDFCompressorType(void) -{ -#if defined(GL2PS_HAVE_ZLIB) - if(gl2ps->options & GL2PS_COMPRESS){ - return fprintf(gl2ps->stream, "/Filter [/FlateDecode]\n"); - } -#endif - return 0; -} - -static int gl2psPrintPDFStrokeColor(GL2PSrgba rgba) -{ - int i, offs = 0; - - gl2psSetLastColor(rgba); - for(i = 0; i < 3; ++i){ - if(GL2PS_ZERO(rgba[i])) - offs += gl2psPrintf("%.0f ", 0.); - else if(rgba[i] < 1e-4 || rgba[i] > 1e6) /* avoid %e formatting */ - offs += gl2psPrintf("%f ", rgba[i]); - else - offs += gl2psPrintf("%g ", rgba[i]); - } - offs += gl2psPrintf("RG\n"); - return offs; -} - -static int gl2psPrintPDFFillColor(GL2PSrgba rgba) -{ - int i, offs = 0; - - for(i = 0; i < 3; ++i){ - if(GL2PS_ZERO(rgba[i])) - offs += gl2psPrintf("%.0f ", 0.); - else if(rgba[i] < 1e-4 || rgba[i] > 1e6) /* avoid %e formatting */ - offs += gl2psPrintf("%f ", rgba[i]); - else - offs += gl2psPrintf("%g ", rgba[i]); - } - offs += gl2psPrintf("rg\n"); - return offs; -} - -static int gl2psPrintPDFLineWidth(GLfloat lw) -{ - if(GL2PS_ZERO(lw)) - return gl2psPrintf("%.0f w\n", 0.); - else if(lw < 1e-4 || lw > 1e6) /* avoid %e formatting */ - return gl2psPrintf("%f w\n", lw); - else - return gl2psPrintf("%g w\n", lw); -} - -static void gl2psPutPDFText(GL2PSstring *text, int cnt, GLfloat x, GLfloat y) -{ - GLfloat rad = M_PI * text->angle / 180.0F; - GLfloat srad = (GLfloat)sin(rad); - GLfloat crad = (GLfloat)cos(rad); - - int dx = 0, dy = 0; - int l = strlen(text->str)*text->fontsize/4; - switch(text->alignment){//the alignment code is totally empirical, it might not work in all cases - case GL2PS_TEXT_C: - dx = -l; - dy = -text->fontsize/2; - break; - case GL2PS_TEXT_CL: - dy = -text->fontsize/2; - break; - case GL2PS_TEXT_CR: - dx = -2*l; - dy = -text->fontsize/2; - break; - case GL2PS_TEXT_B: - dx = -4*l; - dy = -text->fontsize/2; - break; - case GL2PS_TEXT_BR: - dx = -4*l; - dy = -text->fontsize/2; - break; - case GL2PS_TEXT_T: - dx = -l; - dy = -text->fontsize; - break; - case GL2PS_TEXT_TL: - dx = -2*l; - dy = -text->fontsize; - break; - case GL2PS_TEXT_TR: - dx = -2*l; - dy = -text->fontsize; - break; - case GL2PS_TEXT_BL: - default: - dx = -2*l; - dy = -text->fontsize/2; - break; - } - - gl2ps->streamlength += - gl2psPrintf("BT\n" - "/F%d %d Tf\n" - "%f %f %f %f %f %f Tm\n" - "%d %d Td\n" - "(%s) Tj\n" - "ET\n", - cnt, text->fontsize, crad, srad, -srad, crad, x, y, dx, dy, text->str); -} - -static void gl2psPutPDFImage(GL2PSimage *image, int cnt, GLfloat x, GLfloat y) -{ - gl2ps->streamlength += gl2psPrintf - ("q\n" - "%d 0 0 %d %f %f cm\n" - "/Im%d Do\n" - "Q\n", - (int)image->width, (int)image->height, x, y, cnt); -} - -static void gl2psPDFstacksInit(void) -{ - gl2ps->objects_stack = 7 /* FIXED_XREF_ENTRIES */ + 1; - gl2ps->extgs_stack = 0; - gl2ps->font_stack = 0; - gl2ps->im_stack = 0; - gl2ps->trgroupobjects_stack = 0; - gl2ps->shader_stack = 0; - gl2ps->mshader_stack = 0; -} - -static void gl2psPDFgroupObjectInit(GL2PSpdfgroup *gro) -{ - if(!gro) - return; - - gro->ptrlist = NULL; - gro->fontno = gro->gsno = gro->imno = gro->maskshno = gro->shno - = gro->trgroupno = gro->fontobjno = gro->imobjno = gro->shobjno - = gro->maskshobjno = gro->gsobjno = gro->trgroupobjno = -1; -} - -/* Build up group objects and assign name and object numbers */ - -static void gl2psPDFgroupListInit(void) -{ - int i; - GL2PSprimitive *p = NULL; - GL2PSpdfgroup gro; - int lasttype = GL2PS_NO_TYPE; - GL2PSrgba lastrgba = {-1.0F, -1.0F, -1.0F, -1.0F}; - GLushort lastpattern = 0; - GLint lastfactor = 0; - GLfloat lastwidth = 1; - GL2PStriangle lastt, tmpt; - int lastTriangleWasNotSimpleWithSameColor = 0; - - if(!gl2ps->pdfprimlist) - return; - - gl2ps->pdfgrouplist = gl2psListCreate(500, 500, sizeof(GL2PSpdfgroup)); - gl2psInitTriangle(&lastt); - - for(i = 0; i < gl2psListNbr(gl2ps->pdfprimlist); ++i){ - p = *(GL2PSprimitive**)gl2psListPointer(gl2ps->pdfprimlist, i); - switch(p->type){ - case GL2PS_PIXMAP: - gl2psPDFgroupObjectInit(&gro); - gro.ptrlist = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); - gro.imno = gl2ps->im_stack++; - gl2psListAdd(gro.ptrlist, &p); - gl2psListAdd(gl2ps->pdfgrouplist, &gro); - break; - case GL2PS_TEXT: - gl2psPDFgroupObjectInit(&gro); - gro.ptrlist = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); - gro.fontno = gl2ps->font_stack++; - gl2psListAdd(gro.ptrlist, &p); - gl2psListAdd(gl2ps->pdfgrouplist, &gro); - break; - case GL2PS_LINE: - if(lasttype != p->type || lastwidth != p->width || - lastpattern != p->pattern || lastfactor != p->factor || - !gl2psSameColor(p->verts[0].rgba, lastrgba)){ - gl2psPDFgroupObjectInit(&gro); - gro.ptrlist = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); - gl2psListAdd(gro.ptrlist, &p); - gl2psListAdd(gl2ps->pdfgrouplist, &gro); - } - else{ - gl2psListAdd(gro.ptrlist, &p); - } - lastpattern = p->pattern; - lastfactor = p->factor; - lastwidth = p->width; - lastrgba[0] = p->verts[0].rgba[0]; - lastrgba[1] = p->verts[0].rgba[1]; - lastrgba[2] = p->verts[0].rgba[2]; - break; - case GL2PS_POINT: - if(lasttype != p->type || lastwidth != p->width || - !gl2psSameColor(p->verts[0].rgba, lastrgba)){ - gl2psPDFgroupObjectInit(&gro); - gro.ptrlist = gl2psListCreate(1,2,sizeof(GL2PSprimitive*)); - gl2psListAdd(gro.ptrlist, &p); - gl2psListAdd(gl2ps->pdfgrouplist, &gro); - } - else{ - gl2psListAdd(gro.ptrlist, &p); - } - lastwidth = p->width; - lastrgba[0] = p->verts[0].rgba[0]; - lastrgba[1] = p->verts[0].rgba[1]; - lastrgba[2] = p->verts[0].rgba[2]; - break; - case GL2PS_TRIANGLE: - gl2psFillTriangleFromPrimitive(&tmpt, p, GL_TRUE); - lastTriangleWasNotSimpleWithSameColor = - !(tmpt.prop & T_CONST_COLOR && tmpt.prop & T_ALPHA_1) || - !gl2psSameColor(tmpt.vertex[0].rgba, lastt.vertex[0].rgba); - if(lasttype == p->type && tmpt.prop == lastt.prop && - lastTriangleWasNotSimpleWithSameColor){ - /* TODO Check here for last alpha */ - gl2psListAdd(gro.ptrlist, &p); - } - else{ - gl2psPDFgroupObjectInit(&gro); - gro.ptrlist = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); - gl2psListAdd(gro.ptrlist, &p); - gl2psListAdd(gl2ps->pdfgrouplist, &gro); - } - lastt = tmpt; - break; - default: - break; - } - lasttype = p->type; - } -} - -static void gl2psSortOutTrianglePDFgroup(GL2PSpdfgroup *gro) -{ - GL2PStriangle t; - GL2PSprimitive *prim = NULL; - - if(!gro) - return; - - if(!gl2psListNbr(gro->ptrlist)) - return; - - prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, 0); - - if(prim->type != GL2PS_TRIANGLE) - return; - - gl2psFillTriangleFromPrimitive(&t, prim, GL_TRUE); - - if(t.prop & T_CONST_COLOR && t.prop & T_ALPHA_LESS_1){ - gro->gsno = gl2ps->extgs_stack++; - gro->gsobjno = gl2ps->objects_stack ++; - } - else if(t.prop & T_CONST_COLOR && t.prop & T_VAR_ALPHA){ - gro->gsno = gl2ps->extgs_stack++; - gro->gsobjno = gl2ps->objects_stack++; - gro->trgroupno = gl2ps->trgroupobjects_stack++; - gro->trgroupobjno = gl2ps->objects_stack++; - gro->maskshno = gl2ps->mshader_stack++; - gro->maskshobjno = gl2ps->objects_stack++; - } - else if(t.prop & T_VAR_COLOR && t.prop & T_ALPHA_1){ - gro->shno = gl2ps->shader_stack++; - gro->shobjno = gl2ps->objects_stack++; - } - else if(t.prop & T_VAR_COLOR && t.prop & T_ALPHA_LESS_1){ - gro->gsno = gl2ps->extgs_stack++; - gro->gsobjno = gl2ps->objects_stack++; - gro->shno = gl2ps->shader_stack++; - gro->shobjno = gl2ps->objects_stack++; - } - else if(t.prop & T_VAR_COLOR && t.prop & T_VAR_ALPHA){ - gro->gsno = gl2ps->extgs_stack++; - gro->gsobjno = gl2ps->objects_stack++; - gro->shno = gl2ps->shader_stack++; - gro->shobjno = gl2ps->objects_stack++; - gro->trgroupno = gl2ps->trgroupobjects_stack++; - gro->trgroupobjno = gl2ps->objects_stack++; - gro->maskshno = gl2ps->mshader_stack++; - gro->maskshobjno = gl2ps->objects_stack++; - } -} - -/* Main stream data */ - -static void gl2psPDFgroupListWriteMainStream(void) -{ - int i, j, lastel; - GL2PSprimitive *prim = NULL, *prev = NULL; - GL2PSpdfgroup *gro; - GL2PStriangle t; - - if(!gl2ps->pdfgrouplist) - return; - - for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ - gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist, i); - - lastel = gl2psListNbr(gro->ptrlist) - 1; - if(lastel < 0) - continue; - - prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, 0); - - switch(prim->type){ - case GL2PS_POINT: - gl2ps->streamlength += gl2psPrintf("1 J\n"); - gl2ps->streamlength += gl2psPrintPDFLineWidth(prim->width); - gl2ps->streamlength += gl2psPrintPDFStrokeColor(prim->verts[0].rgba); - for(j = 0; j <= lastel; ++j){ - prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); - gl2ps->streamlength += - gl2psPrintf("%f %f m %f %f l\n", - prim->verts[0].xyz[0], prim->verts[0].xyz[1], - prim->verts[0].xyz[0], prim->verts[0].xyz[1]); - } - gl2ps->streamlength += gl2psPrintf("S\n"); - gl2ps->streamlength += gl2psPrintf("0 J\n"); - break; - case GL2PS_LINE: - /* We try to use as few paths as possible to draw lines, in - order to get nice stippling even when the individual segments - are smaller than the stipple */ - gl2ps->streamlength += gl2psPrintPDFLineWidth(prim->width); - gl2ps->streamlength += gl2psPrintPDFStrokeColor(prim->verts[0].rgba); - gl2ps->streamlength += gl2psPrintPostScriptDash(prim->pattern, prim->factor, "d"); - /* start new path */ - gl2ps->streamlength += - gl2psPrintf("%f %f m\n", - prim->verts[0].xyz[0], prim->verts[0].xyz[1]); - - for(j = 1; j <= lastel; ++j){ - prev = prim; - prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); - if(!gl2psSamePosition(prim->verts[0].xyz, prev->verts[1].xyz)){ - /* the starting point of the new segment does not match the - end point of the previous line, so we end the current - path and start a new one */ - gl2ps->streamlength += - gl2psPrintf("%f %f l\n", - prev->verts[1].xyz[0], prev->verts[1].xyz[1]); - gl2ps->streamlength += - gl2psPrintf("%f %f m\n", - prim->verts[0].xyz[0], prim->verts[0].xyz[1]); - } - else{ - /* the two segements are connected, so we just append to the - current path */ - gl2ps->streamlength += - gl2psPrintf("%f %f l\n", - prim->verts[0].xyz[0], prim->verts[0].xyz[1]); - } - } - /* end last path */ - gl2ps->streamlength += - gl2psPrintf("%f %f l\n", - prim->verts[1].xyz[0], prim->verts[1].xyz[1]); - gl2ps->streamlength += gl2psPrintf("S\n"); - break; - case GL2PS_TRIANGLE: - gl2psFillTriangleFromPrimitive(&t, prim, GL_TRUE); - gl2psSortOutTrianglePDFgroup(gro); - - /* No alpha and const color: Simple PDF draw orders */ - if(t.prop & T_CONST_COLOR && t.prop & T_ALPHA_1){ - gl2ps->streamlength += gl2psPrintPDFFillColor(t.vertex[0].rgba); - for(j = 0; j <= lastel; ++j){ - prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); - gl2psFillTriangleFromPrimitive(&t, prim, GL_FALSE); - gl2ps->streamlength - += gl2psPrintf("%f %f m\n" - "%f %f l\n" - "%f %f l\n" - "h f\n", - t.vertex[0].xyz[0], t.vertex[0].xyz[1], - t.vertex[1].xyz[0], t.vertex[1].xyz[1], - t.vertex[2].xyz[0], t.vertex[2].xyz[1]); - } - } - /* Const alpha < 1 and const color: Simple PDF draw orders - and an extra extended Graphics State for the alpha const */ - else if(t.prop & T_CONST_COLOR && t.prop & T_ALPHA_LESS_1){ - gl2ps->streamlength += gl2psPrintf("q\n" - "/GS%d gs\n", - gro->gsno); - gl2ps->streamlength += gl2psPrintPDFFillColor(prim->verts[0].rgba); - for(j = 0; j <= lastel; ++j){ - prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); - gl2psFillTriangleFromPrimitive(&t, prim, GL_FALSE); - gl2ps->streamlength - += gl2psPrintf("%f %f m\n" - "%f %f l\n" - "%f %f l\n" - "h f\n", - t.vertex[0].xyz[0], t.vertex[0].xyz[1], - t.vertex[1].xyz[0], t.vertex[1].xyz[1], - t.vertex[2].xyz[0], t.vertex[2].xyz[1]); - } - gl2ps->streamlength += gl2psPrintf("Q\n"); - } - /* Variable alpha and const color: Simple PDF draw orders - and an extra extended Graphics State + Xobject + Shader - object for the alpha mask */ - else if(t.prop & T_CONST_COLOR && t.prop & T_VAR_ALPHA){ - gl2ps->streamlength += gl2psPrintf("q\n" - "/GS%d gs\n" - "/TrG%d Do\n", - gro->gsno, gro->trgroupno); - gl2ps->streamlength += gl2psPrintPDFFillColor(prim->verts[0].rgba); - for(j = 0; j <= lastel; ++j){ - prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); - gl2psFillTriangleFromPrimitive(&t, prim, GL_FALSE); - gl2ps->streamlength - += gl2psPrintf("%f %f m\n" - "%f %f l\n" - "%f %f l\n" - "h f\n", - t.vertex[0].xyz[0], t.vertex[0].xyz[1], - t.vertex[1].xyz[0], t.vertex[1].xyz[1], - t.vertex[2].xyz[0], t.vertex[2].xyz[1]); - } - gl2ps->streamlength += gl2psPrintf("Q\n"); - } - /* Variable color and no alpha: Shader Object for the colored - triangle(s) */ - else if(t.prop & T_VAR_COLOR && t.prop & T_ALPHA_1){ - gl2ps->streamlength += gl2psPrintf("/Sh%d sh\n", gro->shno); - } - /* Variable color and const alpha < 1: Shader Object for the - colored triangle(s) and an extra extended Graphics State - for the alpha const */ - else if(t.prop & T_VAR_COLOR && t.prop & T_ALPHA_LESS_1){ - gl2ps->streamlength += gl2psPrintf("q\n" - "/GS%d gs\n" - "/Sh%d sh\n" - "Q\n", - gro->gsno, gro->shno); - } - /* Variable alpha and color: Shader Object for the colored - triangle(s) and an extra extended Graphics State - + Xobject + Shader object for the alpha mask */ - else if(t.prop & T_VAR_COLOR && t.prop & T_VAR_ALPHA){ - gl2ps->streamlength += gl2psPrintf("q\n" - "/GS%d gs\n" - "/TrG%d Do\n" - "/Sh%d sh\n" - "Q\n", - gro->gsno, gro->trgroupno, gro->shno); - } - break; - case GL2PS_PIXMAP: - for(j = 0; j <= lastel; ++j){ - prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); - gl2psPutPDFImage(prim->data.image, gro->imno, prim->verts[0].xyz[0], - prim->verts[0].xyz[1]); - } - break; - case GL2PS_TEXT: - for(j = 0; j <= lastel; ++j){ - prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); - gl2ps->streamlength += gl2psPrintPDFFillColor(prim->verts[0].rgba); - gl2psPutPDFText(prim->data.text, gro->fontno, prim->verts[0].xyz[0], - prim->verts[0].xyz[1]); - } - break; - default: - break; - } - } -} - -/* Graphics State names */ - -static int gl2psPDFgroupListWriteGStateResources(void) -{ - GL2PSpdfgroup *gro; - int offs = 0; - int i; - - offs += fprintf(gl2ps->stream, - "/ExtGState\n" - "<<\n" - "/GSa 7 0 R\n"); - for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ - gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist, i); - if(gro->gsno >= 0) - offs += fprintf(gl2ps->stream, "/GS%d %d 0 R\n", gro->gsno, gro->gsobjno); - } - offs += fprintf(gl2ps->stream, ">>\n"); - return offs; -} - -/* Main Shader names */ - -static int gl2psPDFgroupListWriteShaderResources(void) -{ - GL2PSpdfgroup *gro; - int offs = 0; - int i; - - offs += fprintf(gl2ps->stream, - "/Shading\n" - "<<\n"); - for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ - gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist, i); - if(gro->shno >= 0) - offs += fprintf(gl2ps->stream, "/Sh%d %d 0 R\n", gro->shno, gro->shobjno); - if(gro->maskshno >= 0) - offs += fprintf(gl2ps->stream, "/TrSh%d %d 0 R\n", gro->maskshno, gro->maskshobjno); - } - offs += fprintf(gl2ps->stream,">>\n"); - return offs; -} - -/* Images & Mask Shader XObject names */ - -static int gl2psPDFgroupListWriteXObjectResources(void) -{ - int i; - GL2PSprimitive *p = NULL; - GL2PSpdfgroup *gro; - int offs = 0; - - offs += fprintf(gl2ps->stream, - "/XObject\n" - "<<\n"); - - for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ - gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist, i); - if(!gl2psListNbr(gro->ptrlist)) - continue; - p = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, 0); - switch(p->type){ - case GL2PS_PIXMAP: - gro->imobjno = gl2ps->objects_stack++; - if(GL_RGBA == p->data.image->format) /* reserve one object for image mask */ - gl2ps->objects_stack++; - offs += fprintf(gl2ps->stream, "/Im%d %d 0 R\n", gro->imno, gro->imobjno); - case GL2PS_TRIANGLE: - if(gro->trgroupno >=0) - offs += fprintf(gl2ps->stream, "/TrG%d %d 0 R\n", gro->trgroupno, gro->trgroupobjno); - break; - default: - break; - } - } - offs += fprintf(gl2ps->stream,">>\n"); - return offs; -} - -/* Font names */ - -static int gl2psPDFgroupListWriteFontResources(void) -{ - int i; - GL2PSpdfgroup *gro; - int offs = 0; - - offs += fprintf(gl2ps->stream, "/Font\n<<\n"); - - for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ - gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist, i); - if(gro->fontno < 0) - continue; - gro->fontobjno = gl2ps->objects_stack++; - offs += fprintf(gl2ps->stream, "/F%d %d 0 R\n", gro->fontno, gro->fontobjno); - } - offs += fprintf(gl2ps->stream, ">>\n"); - - return offs; -} - -static void gl2psPDFgroupListDelete(void) -{ - int i; - GL2PSpdfgroup *gro = NULL; - - if(!gl2ps->pdfgrouplist) - return; - - for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ - gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist,i); - gl2psListDelete(gro->ptrlist); - } - - gl2psListDelete(gl2ps->pdfgrouplist); - gl2ps->pdfgrouplist = NULL; -} - -/* Print 1st PDF object - file info */ - -static int gl2psPrintPDFInfo(void) -{ - int offs; - time_t now; - struct tm *newtime; - - time(&now); - newtime = gmtime(&now); - - offs = fprintf(gl2ps->stream, - "1 0 obj\n" - "<<\n" - "/Title (%s)\n" - "/Creator (GL2PS %d.%d.%d%s, %s)\n" - "/Producer (%s)\n", - gl2ps->title, GL2PS_MAJOR_VERSION, GL2PS_MINOR_VERSION, - GL2PS_PATCH_VERSION, GL2PS_EXTRA_VERSION, GL2PS_COPYRIGHT, - gl2ps->producer); - - if(!newtime){ - offs += fprintf(gl2ps->stream, - ">>\n" - "endobj\n"); - return offs; - } - - offs += fprintf(gl2ps->stream, - "/CreationDate (D:%d%02d%02d%02d%02d%02d)\n" - ">>\n" - "endobj\n", - newtime->tm_year+1900, - newtime->tm_mon+1, - newtime->tm_mday, - newtime->tm_hour, - newtime->tm_min, - newtime->tm_sec); - return offs; -} - -/* Create catalog and page structure - 2nd and 3th PDF object */ - -static int gl2psPrintPDFCatalog(void) -{ - return fprintf(gl2ps->stream, - "2 0 obj\n" - "<<\n" - "/Type /Catalog\n" - "/Pages 3 0 R\n" - ">>\n" - "endobj\n"); -} - -static int gl2psPrintPDFPages(void) -{ - return fprintf(gl2ps->stream, - "3 0 obj\n" - "<<\n" - "/Type /Pages\n" - "/Kids [6 0 R]\n" - "/Count 1\n" - ">>\n" - "endobj\n"); -} - -/* Open stream for data - graphical objects, fonts etc. PDF object 4 */ - -static int gl2psOpenPDFDataStream(void) -{ - int offs = 0; - - offs += fprintf(gl2ps->stream, - "4 0 obj\n" - "<<\n" - "/Length 5 0 R\n" ); - offs += gl2psPrintPDFCompressorType(); - offs += fprintf(gl2ps->stream, - ">>\n" - "stream\n"); - return offs; -} - -/* Stream setup - Graphics state, fill background if allowed */ - -static int gl2psOpenPDFDataStreamWritePreface(void) -{ - int offs; - - offs = gl2psPrintf("/GSa gs\n"); - - if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ - offs += gl2psPrintPDFFillColor(gl2ps->bgcolor); - offs += gl2psPrintf("%d %d %d %d re\n", - (int)gl2ps->viewport[0], (int)gl2ps->viewport[1], - (int)gl2ps->viewport[2], (int)gl2ps->viewport[3]); - offs += gl2psPrintf("f\n"); - } - return offs; -} - -/* Use the functions above to create the first part of the PDF*/ - -static void gl2psPrintPDFHeader(void) -{ - int offs = 0; - gl2ps->pdfprimlist = gl2psListCreate(500, 500, sizeof(GL2PSprimitive*)); - gl2psPDFstacksInit(); - - gl2ps->xreflist = (int*)gl2psMalloc(sizeof(int) * gl2ps->objects_stack); - -#if defined(GL2PS_HAVE_ZLIB) - if(gl2ps->options & GL2PS_COMPRESS){ - gl2psSetupCompress(); - } -#endif - gl2ps->xreflist[0] = 0; - offs += fprintf(gl2ps->stream, "%%PDF-1.4\n"); - gl2ps->xreflist[1] = offs; - - offs += gl2psPrintPDFInfo(); - gl2ps->xreflist[2] = offs; - - offs += gl2psPrintPDFCatalog(); - gl2ps->xreflist[3] = offs; - - offs += gl2psPrintPDFPages(); - gl2ps->xreflist[4] = offs; - - offs += gl2psOpenPDFDataStream(); - gl2ps->xreflist[5] = offs; /* finished in gl2psPrintPDFFooter */ - gl2ps->streamlength = gl2psOpenPDFDataStreamWritePreface(); -} - -/* The central primitive drawing */ - -static void gl2psPrintPDFPrimitive(void *data) -{ - GL2PSprimitive *prim = *(GL2PSprimitive**)data; - - if((gl2ps->options & GL2PS_OCCLUSION_CULL) && prim->culled) - return; - - prim = gl2psCopyPrimitive(prim); /* deep copy */ - gl2psListAdd(gl2ps->pdfprimlist, &prim); -} - -/* close stream and ... */ - -static int gl2psClosePDFDataStream(void) -{ - int offs = 0; - -#if defined(GL2PS_HAVE_ZLIB) - if(gl2ps->options & GL2PS_COMPRESS){ - if(Z_OK != gl2psDeflate()) - gl2psMsg(GL2PS_ERROR, "Zlib deflate error"); - else - fwrite(gl2ps->compress->dest, gl2ps->compress->destLen, 1, gl2ps->stream); - gl2ps->streamlength += gl2ps->compress->destLen; - - offs += gl2ps->streamlength; - gl2psFreeCompress(); - } -#endif - - offs += fprintf(gl2ps->stream, - "endstream\n" - "endobj\n"); - return offs; -} - -/* ... write the now known length object */ - -static int gl2psPrintPDFDataStreamLength(int val) -{ - return fprintf(gl2ps->stream, - "5 0 obj\n" - "%d\n" - "endobj\n", val); -} - -/* Put the info created before in PDF objects */ - -static int gl2psPrintPDFOpenPage(void) -{ - int offs; - - /* Write fixed part */ - - offs = fprintf(gl2ps->stream, - "6 0 obj\n" - "<<\n" - "/Type /Page\n" - "/Parent 3 0 R\n" - "/MediaBox [%d %d %d %d]\n", - (int)gl2ps->viewport[0], (int)gl2ps->viewport[1], - (int)gl2ps->viewport[2], (int)gl2ps->viewport[3]); - - if(gl2ps->options & GL2PS_LANDSCAPE) - offs += fprintf(gl2ps->stream, "/Rotate -90\n"); - - offs += fprintf(gl2ps->stream, - "/Contents 4 0 R\n" - "/Resources\n" - "<<\n" - "/ProcSet [/PDF /Text /ImageB /ImageC] %%/ImageI\n"); - - return offs; - - /* End fixed part, proceeds in gl2psPDFgroupListWriteVariableResources() */ -} - -static int gl2psPDFgroupListWriteVariableResources(void) -{ - int offs = 0; - - /* a) Graphics States for shader alpha masks*/ - offs += gl2psPDFgroupListWriteGStateResources(); - - /* b) Shader and shader masks */ - offs += gl2psPDFgroupListWriteShaderResources(); - - /* c) XObjects (Images & Shader Masks) */ - offs += gl2psPDFgroupListWriteXObjectResources(); - - /* d) Fonts */ - offs += gl2psPDFgroupListWriteFontResources(); - - /* End resources and page */ - offs += fprintf(gl2ps->stream, - ">>\n" - ">>\n" - "endobj\n"); - return offs; -} - -/* Standard Graphics State */ - -static int gl2psPrintPDFGSObject(void) -{ - return fprintf(gl2ps->stream, - "7 0 obj\n" - "<<\n" - "/Type /ExtGState\n" - "/SA false\n" - "/SM 0.02\n" - "/OP false\n" - "/op false\n" - "/OPM 0\n" - "/BG2 /Default\n" - "/UCR2 /Default\n" - "/TR2 /Default\n" - ">>\n" - "endobj\n"); -} - -/* Put vertex' edge flag (8bit) and coordinates (32bit) in shader stream */ - -static int gl2psPrintPDFShaderStreamDataCoord(GL2PSvertex *vertex, - size_t (*action)(unsigned long data, - size_t size), - GLfloat dx, GLfloat dy, - GLfloat xmin, GLfloat ymin) -{ - int offs = 0; - unsigned long imap; - GLfloat diff; - double dmax = ~1UL; - char edgeflag = 0; - - /* FIXME: temp bux fix for 64 bit archs: */ - if(sizeof(unsigned long) == 8) dmax = dmax - 2048.; - - offs += (*action)(edgeflag, 1); - - /* The Shader stream in PDF requires to be in a 'big-endian' - order */ - - if(GL2PS_ZERO(dx * dy)){ - offs += (*action)(0, 4); - offs += (*action)(0, 4); - } - else{ - diff = (vertex->xyz[0] - xmin) / dx; - if(diff > 1) - diff = 1.0F; - else if(diff < 0) - diff = 0.0F; - imap = (unsigned long)(diff * dmax); - offs += (*action)(imap, 4); - - diff = (vertex->xyz[1] - ymin) / dy; - if(diff > 1) - diff = 1.0F; - else if(diff < 0) - diff = 0.0F; - imap = (unsigned long)(diff * dmax); - offs += (*action)(imap, 4); - } - - return offs; -} - -/* Put vertex' rgb value (8bit for every component) in shader stream */ - -static int gl2psPrintPDFShaderStreamDataRGB(GL2PSvertex *vertex, - size_t (*action)(unsigned long data, - size_t size)) -{ - int offs = 0; - unsigned long imap; - double dmax = ~1UL; - - /* FIXME: temp bux fix for 64 bit archs: */ - if(sizeof(unsigned long) == 8) dmax = dmax - 2048.; - - imap = (unsigned long)((vertex->rgba[0]) * dmax); - offs += (*action)(imap, 1); - - imap = (unsigned long)((vertex->rgba[1]) * dmax); - offs += (*action)(imap, 1); - - imap = (unsigned long)((vertex->rgba[2]) * dmax); - offs += (*action)(imap, 1); - - return offs; -} - -/* Put vertex' alpha (8/16bit) in shader stream */ - -static int gl2psPrintPDFShaderStreamDataAlpha(GL2PSvertex *vertex, - size_t (*action)(unsigned long data, - size_t size), - int sigbyte) -{ - int offs = 0; - unsigned long imap; - double dmax = ~1UL; - - /* FIXME: temp bux fix for 64 bit archs: */ - if(sizeof(unsigned long) == 8) dmax = dmax - 2048.; - - if(sigbyte != 8 && sigbyte != 16) - sigbyte = 8; - - sigbyte /= 8; - - imap = (unsigned long)((vertex->rgba[3]) * dmax); - - offs += (*action)(imap, sigbyte); - - return offs; -} - -/* Put a triangles raw data in shader stream */ - -static int gl2psPrintPDFShaderStreamData(GL2PStriangle *triangle, - GLfloat dx, GLfloat dy, - GLfloat xmin, GLfloat ymin, - size_t (*action)(unsigned long data, - size_t size), - int gray) -{ - int i, offs = 0; - GL2PSvertex v; - - if(gray && gray != 8 && gray != 16) - gray = 8; - - for(i = 0; i < 3; ++i){ - offs += gl2psPrintPDFShaderStreamDataCoord(&triangle->vertex[i], action, - dx, dy, xmin, ymin); - if(gray){ - v = triangle->vertex[i]; - offs += gl2psPrintPDFShaderStreamDataAlpha(&v, action, gray); - } - else{ - offs += gl2psPrintPDFShaderStreamDataRGB(&triangle->vertex[i], action); - } - } - - return offs; -} - -static void gl2psPDFRectHull(GLfloat *xmin, GLfloat *xmax, - GLfloat *ymin, GLfloat *ymax, - GL2PStriangle *triangles, int cnt) -{ - int i, j; - - *xmin = triangles[0].vertex[0].xyz[0]; - *xmax = triangles[0].vertex[0].xyz[0]; - *ymin = triangles[0].vertex[0].xyz[1]; - *ymax = triangles[0].vertex[0].xyz[1]; - - for(i = 0; i < cnt; ++i){ - for(j = 0; j < 3; ++j){ - if(*xmin > triangles[i].vertex[j].xyz[0]) - *xmin = triangles[i].vertex[j].xyz[0]; - if(*xmax < triangles[i].vertex[j].xyz[0]) - *xmax = triangles[i].vertex[j].xyz[0]; - if(*ymin > triangles[i].vertex[j].xyz[1]) - *ymin = triangles[i].vertex[j].xyz[1]; - if(*ymax < triangles[i].vertex[j].xyz[1]) - *ymax = triangles[i].vertex[j].xyz[1]; - } - } -} - -/* Writes shaded triangle - gray == 0 means write RGB triangles - gray == 8 8bit-grayscale (for alpha masks) - gray == 16 16bit-grayscale (for alpha masks) */ - -static int gl2psPrintPDFShader(int obj, GL2PStriangle *triangles, - int size, int gray) -{ - int i, offs = 0, vertexbytes, done = 0; - GLfloat xmin, xmax, ymin, ymax; - - switch(gray){ - case 0: - vertexbytes = 1+4+4+1+1+1; - break; - case 8: - vertexbytes = 1+4+4+1; - break; - case 16: - vertexbytes = 1+4+4+2; - break; - default: - gray = 8; - vertexbytes = 1+4+4+1; - break; - } - - gl2psPDFRectHull(&xmin, &xmax, &ymin, &ymax, triangles, size); - - offs += fprintf(gl2ps->stream, - "%d 0 obj\n" - "<< " - "/ShadingType 4 " - "/ColorSpace %s " - "/BitsPerCoordinate 32 " - "/BitsPerComponent %d " - "/BitsPerFlag 8 " - "/Decode [%f %f %f %f 0 1 %s] ", - obj, - (gray) ? "/DeviceGray" : "/DeviceRGB", - (gray) ? gray : 8, - xmin, xmax, ymin, ymax, - (gray) ? "" : "0 1 0 1"); - -#if defined(GL2PS_HAVE_ZLIB) - if(gl2ps->options & GL2PS_COMPRESS){ - gl2psAllocCompress(vertexbytes * size * 3); - - for(i = 0; i < size; ++i) - gl2psPrintPDFShaderStreamData(&triangles[i], - xmax-xmin, ymax-ymin, xmin, ymin, - gl2psWriteBigEndianCompress, gray); - - if(Z_OK == gl2psDeflate() && 23 + gl2ps->compress->destLen < gl2ps->compress->srcLen){ - offs += gl2psPrintPDFCompressorType(); - offs += fprintf(gl2ps->stream, - "/Length %d " - ">>\n" - "stream\n", - (int)gl2ps->compress->destLen); - offs += gl2ps->compress->destLen * fwrite(gl2ps->compress->dest, - gl2ps->compress->destLen, - 1, gl2ps->stream); - done = 1; - } - gl2psFreeCompress(); - } -#endif - - if(!done){ - /* no compression, or too long after compression, or compress error - -> write non-compressed entry */ - offs += fprintf(gl2ps->stream, - "/Length %d " - ">>\n" - "stream\n", - vertexbytes * 3 * size); - for(i = 0; i < size; ++i) - offs += gl2psPrintPDFShaderStreamData(&triangles[i], - xmax-xmin, ymax-ymin, xmin, ymin, - gl2psWriteBigEndian, gray); - } - - offs += fprintf(gl2ps->stream, - "\nendstream\n" - "endobj\n"); - - return offs; -} - -/* Writes a XObject for a shaded triangle mask */ - -static int gl2psPrintPDFShaderMask(int obj, int childobj) -{ - int offs = 0, len; - - offs += fprintf(gl2ps->stream, - "%d 0 obj\n" - "<<\n" - "/Type /XObject\n" - "/Subtype /Form\n" - "/BBox [ %d %d %d %d ]\n" - "/Group \n<<\n/S /Transparency /CS /DeviceRGB\n" - ">>\n", - obj, - (int)gl2ps->viewport[0], (int)gl2ps->viewport[1], - (int)gl2ps->viewport[2], (int)gl2ps->viewport[3]); - - len = (childobj>0) - ? strlen("/TrSh sh\n") + (int)log10((double)childobj)+1 - : strlen("/TrSh0 sh\n"); - - offs += fprintf(gl2ps->stream, - "/Length %d\n" - ">>\n" - "stream\n", - len); - offs += fprintf(gl2ps->stream, - "/TrSh%d sh\n", - childobj); - offs += fprintf(gl2ps->stream, - "endstream\n" - "endobj\n"); - - return offs; -} - -/* Writes a Extended graphics state for a shaded triangle mask if - simplealpha ist true the childobj argument is ignored and a /ca - statement will be written instead */ - -static int gl2psPrintPDFShaderExtGS(int obj, int childobj) -{ - int offs = 0; - - offs += fprintf(gl2ps->stream, - "%d 0 obj\n" - "<<\n", - obj); - - offs += fprintf(gl2ps->stream, - "/SMask << /S /Alpha /G %d 0 R >> ", - childobj); - - offs += fprintf(gl2ps->stream, - ">>\n" - "endobj\n"); - return offs; -} - -/* a simple graphics state */ - -static int gl2psPrintPDFShaderSimpleExtGS(int obj, GLfloat alpha) -{ - int offs = 0; - - offs += fprintf(gl2ps->stream, - "%d 0 obj\n" - "<<\n" - "/ca %g" - ">>\n" - "endobj\n", - obj, alpha); - return offs; -} - -/* Similar groups of functions for pixmaps and text */ - -static int gl2psPrintPDFPixmapStreamData(GL2PSimage *im, - size_t (*action)(unsigned long data, - size_t size), - int gray) -{ - int x, y, shift; - GLfloat r, g, b, a; - - if(im->format != GL_RGBA && gray) - return 0; - - if(gray && gray != 8 && gray != 16) - gray = 8; - - gray /= 8; - - shift = (sizeof(unsigned long) - 1) * 8; - - for(y = 0; y < im->height; ++y){ - for(x = 0; x < im->width; ++x){ - a = gl2psGetRGB(im, x, y, &r, &g, &b); - if(im->format == GL_RGBA && gray){ - (*action)((unsigned long)(a * 255) << shift, gray); - } - else{ - (*action)((unsigned long)(r * 255) << shift, 1); - (*action)((unsigned long)(g * 255) << shift, 1); - (*action)((unsigned long)(b * 255) << shift, 1); - } - } - } - - switch(gray){ - case 0: return 3 * im->width * im->height; - case 1: return im->width * im->height; - case 2: return 2 * im->width * im->height; - default: return 3 * im->width * im->height; - } -} - -static int gl2psPrintPDFPixmap(int obj, int childobj, GL2PSimage *im, int gray) -{ - int offs = 0, done = 0, sigbytes = 3; - - if(gray && gray !=8 && gray != 16) - gray = 8; - - if(gray) - sigbytes = gray / 8; - - offs += fprintf(gl2ps->stream, - "%d 0 obj\n" - "<<\n" - "/Type /XObject\n" - "/Subtype /Image\n" - "/Width %d\n" - "/Height %d\n" - "/ColorSpace %s \n" - "/BitsPerComponent 8\n", - obj, - (int)im->width, (int)im->height, - (gray) ? "/DeviceGray" : "/DeviceRGB" ); - if(GL_RGBA == im->format && gray == 0){ - offs += fprintf(gl2ps->stream, - "/SMask %d 0 R\n", - childobj); - } - -#if defined(GL2PS_HAVE_ZLIB) - if(gl2ps->options & GL2PS_COMPRESS){ - gl2psAllocCompress((int)(im->width * im->height * sigbytes)); - - gl2psPrintPDFPixmapStreamData(im, gl2psWriteBigEndianCompress, gray); - - if(Z_OK == gl2psDeflate() && 23 + gl2ps->compress->destLen < gl2ps->compress->srcLen){ - offs += gl2psPrintPDFCompressorType(); - offs += fprintf(gl2ps->stream, - "/Length %d " - ">>\n" - "stream\n", - (int)gl2ps->compress->destLen); - offs += gl2ps->compress->destLen * fwrite(gl2ps->compress->dest, gl2ps->compress->destLen, - 1, gl2ps->stream); - done = 1; - } - gl2psFreeCompress(); - } -#endif - - if(!done){ - /* no compression, or too long after compression, or compress error - -> write non-compressed entry */ - offs += fprintf(gl2ps->stream, - "/Length %d " - ">>\n" - "stream\n", - (int)(im->width * im->height * sigbytes)); - offs += gl2psPrintPDFPixmapStreamData(im, gl2psWriteBigEndian, gray); - } - - offs += fprintf(gl2ps->stream, - "\nendstream\n" - "endobj\n"); - - return offs; -} - -static int gl2psPrintPDFText(int obj, GL2PSstring *s, int fontnumber) -{ - int offs = 0; - - offs += fprintf(gl2ps->stream, - "%d 0 obj\n" - "<<\n" - "/Type /Font\n" - "/Subtype /Type1\n" - "/Name /F%d\n" - "/BaseFont /%s\n" - "/Encoding /MacRomanEncoding\n" - ">>\n" - "endobj\n", - obj, fontnumber, s->fontname); - return offs; -} - -/* Write the physical objects */ - -static int gl2psPDFgroupListWriteObjects(int entryoffs) -{ - int i,j; - GL2PSprimitive *p = NULL; - GL2PSpdfgroup *gro; - int offs = entryoffs; - GL2PStriangle *triangles; - int size = 0; - - if(!gl2ps->pdfgrouplist) - return offs; - - for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ - gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist, i); - if(!gl2psListNbr(gro->ptrlist)) - continue; - p = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, 0); - switch(p->type){ - case GL2PS_POINT: - break; - case GL2PS_LINE: - break; - case GL2PS_TRIANGLE: - size = gl2psListNbr(gro->ptrlist); - triangles = (GL2PStriangle*)gl2psMalloc(sizeof(GL2PStriangle) * size); - for(j = 0; j < size; ++j){ - p = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); - gl2psFillTriangleFromPrimitive(&triangles[j], p, GL_TRUE); - } - if(triangles[0].prop & T_VAR_COLOR){ - gl2ps->xreflist[gro->shobjno] = offs; - offs += gl2psPrintPDFShader(gro->shobjno, triangles, size, 0); - } - if(triangles[0].prop & T_ALPHA_LESS_1){ - gl2ps->xreflist[gro->gsobjno] = offs; - offs += gl2psPrintPDFShaderSimpleExtGS(gro->gsobjno, triangles[0].vertex[0].rgba[3]); - } - if(triangles[0].prop & T_VAR_ALPHA){ - gl2ps->xreflist[gro->gsobjno] = offs; - offs += gl2psPrintPDFShaderExtGS(gro->gsobjno, gro->trgroupobjno); - gl2ps->xreflist[gro->trgroupobjno] = offs; - offs += gl2psPrintPDFShaderMask(gro->trgroupobjno, gro->maskshno); - gl2ps->xreflist[gro->maskshobjno] = offs; - offs += gl2psPrintPDFShader(gro->maskshobjno, triangles, size, 8); - } - gl2psFree(triangles); - break; - case GL2PS_PIXMAP: - gl2ps->xreflist[gro->imobjno] = offs; - offs += gl2psPrintPDFPixmap(gro->imobjno, gro->imobjno+1, p->data.image, 0); - if(p->data.image->format == GL_RGBA){ - gl2ps->xreflist[gro->imobjno+1] = offs; - offs += gl2psPrintPDFPixmap(gro->imobjno+1, -1, p->data.image, 8); - } - break; - case GL2PS_TEXT: - gl2ps->xreflist[gro->fontobjno] = offs; - offs += gl2psPrintPDFText(gro->fontobjno,p->data.text,gro->fontno); - break; - case GL2PS_SPECIAL : - /* alignment contains the format for which the special output text - is intended */ - if(p->data.text->alignment == GL2PS_PDF) - offs += fprintf(gl2ps->stream, "%s\n", p->data.text->str); - break; - default: - break; - } - } - return offs; -} - -/* All variable data has been written at this point and all required - functioninality has been gathered, so we can write now file footer - with cross reference table and trailer */ - -static void gl2psPrintPDFFooter(void) -{ - int i, offs; - - gl2psPDFgroupListInit(); - gl2psPDFgroupListWriteMainStream(); - - offs = gl2ps->xreflist[5] + gl2ps->streamlength; - offs += gl2psClosePDFDataStream(); - gl2ps->xreflist[5] = offs; - - offs += gl2psPrintPDFDataStreamLength(gl2ps->streamlength); - gl2ps->xreflist[6] = offs; - gl2ps->streamlength = 0; - - offs += gl2psPrintPDFOpenPage(); - offs += gl2psPDFgroupListWriteVariableResources(); - gl2ps->xreflist = (int*)gl2psRealloc(gl2ps->xreflist, - sizeof(int) * (gl2ps->objects_stack + 1)); - gl2ps->xreflist[7] = offs; - - offs += gl2psPrintPDFGSObject(); - gl2ps->xreflist[8] = offs; - - gl2ps->xreflist[gl2ps->objects_stack] = - gl2psPDFgroupListWriteObjects(gl2ps->xreflist[8]); - - /* Start cross reference table. The file has to been opened in - binary mode to preserve the 20 digit string length! */ - fprintf(gl2ps->stream, - "xref\n" - "0 %d\n" - "%010d 65535 f \n", gl2ps->objects_stack, 0); - - for(i = 1; i < gl2ps->objects_stack; ++i) - fprintf(gl2ps->stream, "%010d 00000 n \n", gl2ps->xreflist[i]); - - fprintf(gl2ps->stream, - "trailer\n" - "<<\n" - "/Size %d\n" - "/Info 1 0 R\n" - "/Root 2 0 R\n" - ">>\n" - "startxref\n%d\n" - "%%%%EOF\n", - gl2ps->objects_stack, gl2ps->xreflist[gl2ps->objects_stack]); - - /* Free auxiliary lists and arrays */ - gl2psFree(gl2ps->xreflist); - gl2psListAction(gl2ps->pdfprimlist, gl2psFreePrimitive); - gl2psListDelete(gl2ps->pdfprimlist); - gl2psPDFgroupListDelete(); - -#if defined(GL2PS_HAVE_ZLIB) - if(gl2ps->options & GL2PS_COMPRESS){ - gl2psFreeCompress(); - gl2psFree(gl2ps->compress); - gl2ps->compress = NULL; - } -#endif -} - -/* PDF begin viewport */ - -static void gl2psPrintPDFBeginViewport(GLint viewport[4]) -{ - int offs = 0; - GLint index; - GLfloat rgba[4]; - int x = viewport[0], y = viewport[1], w = viewport[2], h = viewport[3]; - - glRenderMode(GL_FEEDBACK); - - if(gl2ps->header){ - gl2psPrintPDFHeader(); - gl2ps->header = GL_FALSE; - } - - offs += gl2psPrintf("q\n"); - - if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ - if(gl2ps->colormode == GL_RGBA || gl2ps->colorsize == 0){ - glGetFloatv(GL_COLOR_CLEAR_VALUE, rgba); - } - else{ - glGetIntegerv(GL_INDEX_CLEAR_VALUE, &index); - rgba[0] = gl2ps->colormap[index][0]; - rgba[1] = gl2ps->colormap[index][1]; - rgba[2] = gl2ps->colormap[index][2]; - rgba[3] = 1.0F; - } - offs += gl2psPrintPDFFillColor(rgba); - offs += gl2psPrintf("%d %d %d %d re\n" - "W\n" - "f\n", - x, y, w, h); - } - else{ - offs += gl2psPrintf("%d %d %d %d re\n" - "W\n" - "n\n", - x, y, w, h); - } - - gl2ps->streamlength += offs; -} - -static GLint gl2psPrintPDFEndViewport(void) -{ - GLint res; - - res = gl2psPrintPrimitives(); - gl2ps->streamlength += gl2psPrintf("Q\n"); - return res; -} - -static void gl2psPrintPDFFinalPrimitive(void) -{ -} - -/* definition of the PDF backend */ - -static GL2PSbackend gl2psPDF = { - gl2psPrintPDFHeader, - gl2psPrintPDFFooter, - gl2psPrintPDFBeginViewport, - gl2psPrintPDFEndViewport, - gl2psPrintPDFPrimitive, - gl2psPrintPDFFinalPrimitive, - "pdf", - "Portable Document Format" -}; - -/********************************************************************* - * - * SVG routines - * - *********************************************************************/ - -static void gl2psSVGGetCoordsAndColors(int n, GL2PSvertex *verts, - GL2PSxyz *xyz, GL2PSrgba *rgba) -{ - int i, j; - - for(i = 0; i < n; i++){ - xyz[i][0] = verts[i].xyz[0]; - xyz[i][1] = gl2ps->viewport[3] - verts[i].xyz[1]; - xyz[i][2] = 0.0F; - for(j = 0; j < 4; j++) - rgba[i][j] = verts[i].rgba[j]; - } -} - -static void gl2psSVGGetColorString(GL2PSrgba rgba, char str[32]) -{ - int r = (int)(255. * rgba[0]); - int g = (int)(255. * rgba[1]); - int b = (int)(255. * rgba[2]); - int rc = (r < 0) ? 0 : (r > 255) ? 255 : r; - int gc = (g < 0) ? 0 : (g > 255) ? 255 : g; - int bc = (b < 0) ? 0 : (b > 255) ? 255 : b; - sprintf(str, "#%2.2x%2.2x%2.2x", rc, gc, bc); -} - -static void gl2psPrintSVGHeader(void) -{ - int x, y, width, height; - char col[32]; - time_t now; - - time(&now); - - if (gl2ps->options & GL2PS_LANDSCAPE){ - x = (int)gl2ps->viewport[1]; - y = (int)gl2ps->viewport[0]; - width = (int)gl2ps->viewport[3]; - height = (int)gl2ps->viewport[2]; - } - else{ - x = (int)gl2ps->viewport[0]; - y = (int)gl2ps->viewport[1]; - width = (int)gl2ps->viewport[2]; - height = (int)gl2ps->viewport[3]; - } - - /* Compressed SVG files (.svgz) are simply gzipped SVG files */ - gl2psPrintGzipHeader(); - - gl2psPrintf("\n"); - gl2psPrintf("\n", - width, height, x, y, width, height); - gl2psPrintf("%s\n", gl2ps->title); - gl2psPrintf("\n"); - gl2psPrintf("Creator: GL2PS %d.%d.%d%s, %s\n" - "For: %s\n" - "CreationDate: %s", - GL2PS_MAJOR_VERSION, GL2PS_MINOR_VERSION, GL2PS_PATCH_VERSION, - GL2PS_EXTRA_VERSION, GL2PS_COPYRIGHT, gl2ps->producer, ctime(&now)); - gl2psPrintf("\n"); - gl2psPrintf("\n"); - gl2psPrintf("\n"); - - if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ - gl2psSVGGetColorString(gl2ps->bgcolor, col); - gl2psPrintf("\n", col, - (int)gl2ps->viewport[0], (int)gl2ps->viewport[1], - (int)gl2ps->viewport[2], (int)gl2ps->viewport[1], - (int)gl2ps->viewport[2], (int)gl2ps->viewport[3], - (int)gl2ps->viewport[0], (int)gl2ps->viewport[3]); - } - - /* group all the primitives and disable antialiasing */ - gl2psPrintf("\n"); -} - -static void gl2psPrintSVGSmoothTriangle(GL2PSxyz xyz[3], GL2PSrgba rgba[3]) -{ - int i; - GL2PSxyz xyz2[3]; - GL2PSrgba rgba2[3]; - char col[32]; - - /* Apparently there is no easy way to do Gouraud shading in SVG - without explicitly pre-defining gradients, so for now we just do - recursive subdivision */ - - if(gl2psSameColorThreshold(3, rgba, gl2ps->threshold)){ - gl2psSVGGetColorString(rgba[0], col); - gl2psPrintf("\n", xyz[0][0], xyz[0][1], - xyz[1][0], xyz[1][1], xyz[2][0], xyz[2][1]); - } - else{ - /* subdivide into 4 subtriangles */ - for(i = 0; i < 3; i++){ - xyz2[0][i] = xyz[0][i]; - xyz2[1][i] = 0.5F * (xyz[0][i] + xyz[1][i]); - xyz2[2][i] = 0.5F * (xyz[0][i] + xyz[2][i]); - } - for(i = 0; i < 4; i++){ - rgba2[0][i] = rgba[0][i]; - rgba2[1][i] = 0.5F * (rgba[0][i] + rgba[1][i]); - rgba2[2][i] = 0.5F * (rgba[0][i] + rgba[2][i]); - } - gl2psPrintSVGSmoothTriangle(xyz2, rgba2); - for(i = 0; i < 3; i++){ - xyz2[0][i] = 0.5F * (xyz[0][i] + xyz[1][i]); - xyz2[1][i] = xyz[1][i]; - xyz2[2][i] = 0.5F * (xyz[1][i] + xyz[2][i]); - } - for(i = 0; i < 4; i++){ - rgba2[0][i] = 0.5F * (rgba[0][i] + rgba[1][i]); - rgba2[1][i] = rgba[1][i]; - rgba2[2][i] = 0.5F * (rgba[1][i] + rgba[2][i]); - } - gl2psPrintSVGSmoothTriangle(xyz2, rgba2); - for(i = 0; i < 3; i++){ - xyz2[0][i] = 0.5F * (xyz[0][i] + xyz[2][i]); - xyz2[1][i] = xyz[2][i]; - xyz2[2][i] = 0.5F * (xyz[1][i] + xyz[2][i]); - } - for(i = 0; i < 4; i++){ - rgba2[0][i] = 0.5F * (rgba[0][i] + rgba[2][i]); - rgba2[1][i] = rgba[2][i]; - rgba2[2][i] = 0.5F * (rgba[1][i] + rgba[2][i]); - } - gl2psPrintSVGSmoothTriangle(xyz2, rgba2); - for(i = 0; i < 3; i++){ - xyz2[0][i] = 0.5F * (xyz[0][i] + xyz[1][i]); - xyz2[1][i] = 0.5F * (xyz[1][i] + xyz[2][i]); - xyz2[2][i] = 0.5F * (xyz[0][i] + xyz[2][i]); - } - for(i = 0; i < 4; i++){ - rgba2[0][i] = 0.5F * (rgba[0][i] + rgba[1][i]); - rgba2[1][i] = 0.5F * (rgba[1][i] + rgba[2][i]); - rgba2[2][i] = 0.5F * (rgba[0][i] + rgba[2][i]); - } - gl2psPrintSVGSmoothTriangle(xyz2, rgba2); - } -} - -static void gl2psPrintSVGDash(GLushort pattern, GLint factor) -{ - int i, n, array[10]; - - if(!pattern || !factor) return; /* solid line */ - - gl2psParseStipplePattern(pattern, factor, &n, array); - gl2psPrintf("stroke-dasharray=\""); - for(i = 0; i < n; i++){ - if(i) gl2psPrintf(","); - gl2psPrintf("%d", array[i]); - } - gl2psPrintf("\" "); -} - -static void gl2psEndSVGLine(void) -{ - int i; - if(gl2ps->lastvertex.rgba[0] >= 0.){ - gl2psPrintf("%g,%g\"/>\n", gl2ps->lastvertex.xyz[0], - gl2ps->viewport[3] - gl2ps->lastvertex.xyz[1]); - for(i = 0; i < 3; i++) - gl2ps->lastvertex.xyz[i] = -1.; - for(i = 0; i < 4; i++) - gl2ps->lastvertex.rgba[i] = -1.; - } -} - -static void gl2psPrintSVGPixmap(GLfloat x, GLfloat y, GL2PSimage *pixmap) -{ -#if defined(GL2PS_HAVE_LIBPNG) - GL2PSlist *png; - unsigned char c; - int i; - - /* The only image types supported by the SVG standard are JPEG, PNG - and SVG. Here we choose PNG, and since we want to embed the image - directly in the SVG stream (and not link to an external image - file), we need to encode the pixmap into PNG in memory, then - encode it into base64. */ - - png = gl2psListCreate(pixmap->width * pixmap->height * 3, 1000, - sizeof(unsigned char)); - gl2psConvertPixmapToPNG(pixmap, png); - gl2psListEncodeBase64(png); - gl2psPrintf("height, pixmap->width, pixmap->height); - gl2psPrintf("xlink:href=\"data:image/png;base64,"); - for(i = 0; i < gl2psListNbr(png); i++){ - gl2psListRead(png, i, &c); - gl2psPrintf("%c", c); - } - gl2psPrintf("\"/>\n"); - gl2psListDelete(png); -#else - gl2psMsg(GL2PS_WARNING, "GL2PS must be compiled with PNG support in " - "order to embed images in SVG streams"); -#endif -} - -static void gl2psPrintSVGPrimitive(void *data) -{ - GL2PSprimitive *prim; - GL2PSxyz xyz[4]; - GL2PSrgba rgba[4]; - char col[32]; - int newline; - - prim = *(GL2PSprimitive**)data; - - if((gl2ps->options & GL2PS_OCCLUSION_CULL) && prim->culled) return; - - /* We try to draw connected lines as a single path to get nice line - joins and correct stippling. So if the primitive to print is not - a line we must first finish the current line (if any): */ - if(prim->type != GL2PS_LINE) gl2psEndSVGLine(); - - gl2psSVGGetCoordsAndColors(prim->numverts, prim->verts, xyz, rgba); - - switch(prim->type){ - case GL2PS_POINT : - gl2psSVGGetColorString(rgba[0], col); - gl2psPrintf("\n", - xyz[0][0], xyz[0][1], 0.5 * prim->width); - break; - case GL2PS_LINE : - if(!gl2psSamePosition(gl2ps->lastvertex.xyz, prim->verts[0].xyz) || - !gl2psSameColor(gl2ps->lastrgba, prim->verts[0].rgba) || - gl2ps->lastlinewidth != prim->width || - gl2ps->lastpattern != prim->pattern || - gl2ps->lastfactor != prim->factor){ - /* End the current line if the new segment does not start where - the last one ended, or if the color, the width or the - stippling have changed (we will need to use multi-point - gradients for smooth-shaded lines) */ - gl2psEndSVGLine(); - newline = 1; - } - else{ - newline = 0; - } - gl2ps->lastvertex = prim->verts[1]; - gl2psSetLastColor(prim->verts[0].rgba); - gl2ps->lastlinewidth = prim->width; - gl2ps->lastpattern = prim->pattern; - gl2ps->lastfactor = prim->factor; - if(newline){ - gl2psSVGGetColorString(rgba[0], col); - gl2psPrintf("width); - if(rgba[0][3] < 1.0F) gl2psPrintf("stroke-opacity=\"%g\" ", rgba[0][3]); - gl2psPrintSVGDash(prim->pattern, prim->factor); - gl2psPrintf("points=\"%g,%g ", xyz[0][0], xyz[0][1]); - } - else{ - gl2psPrintf("%g,%g ", xyz[0][0], xyz[0][1]); - } - break; - case GL2PS_TRIANGLE : - gl2psPrintSVGSmoothTriangle(xyz, rgba); - break; - case GL2PS_QUADRANGLE : - gl2psMsg(GL2PS_WARNING, "There should not be any quad left to print"); - break; - case GL2PS_PIXMAP : - gl2psPrintSVGPixmap(xyz[0][0], xyz[0][1], prim->data.image); - break; - case GL2PS_TEXT : - gl2psSVGGetColorString(prim->verts[0].rgba, col); - gl2psPrintf("data.text->fontsize); - if(prim->data.text->angle) - gl2psPrintf("transform=\"rotate(%g, %g, %g)\" ", - -prim->data.text->angle, xyz[0][0], xyz[0][1]); - if(!strcmp(prim->data.text->fontname, "Times-Roman")) - gl2psPrintf("font-family=\"Times\">"); - else if(!strcmp(prim->data.text->fontname, "Times-Bold")) - gl2psPrintf("font-family=\"Times\" font-weight=\"bold\">"); - else if(!strcmp(prim->data.text->fontname, "Times-Italic")) - gl2psPrintf("font-family=\"Times\" font-style=\"italic\">"); - else if(!strcmp(prim->data.text->fontname, "Times-BoldItalic")) - gl2psPrintf("font-family=\"Times\" font-style=\"italic\" font-weight=\"bold\">"); - else if(!strcmp(prim->data.text->fontname, "Helvetica-Bold")) - gl2psPrintf("font-family=\"Helvetica\" font-weight=\"bold\">"); - else if(!strcmp(prim->data.text->fontname, "Helvetica-Oblique")) - gl2psPrintf("font-family=\"Helvetica\" font-style=\"oblique\">"); - else if(!strcmp(prim->data.text->fontname, "Helvetica-BoldOblique")) - gl2psPrintf("font-family=\"Helvetica\" font-style=\"oblique\" font-weight=\"bold\">"); - else if(!strcmp(prim->data.text->fontname, "Courier-Bold")) - gl2psPrintf("font-family=\"Courier\" font-weight=\"bold\">"); - else if(!strcmp(prim->data.text->fontname, "Courier-Oblique")) - gl2psPrintf("font-family=\"Courier\" font-style=\"oblique\">"); - else if(!strcmp(prim->data.text->fontname, "Courier-BoldOblique")) - gl2psPrintf("font-family=\"Courier\" font-style=\"oblique\" font-weight=\"bold\">"); - else - gl2psPrintf("font-family=\"%s\">", prim->data.text->fontname); - gl2psPrintf("%s\n", prim->data.text->str); - break; - case GL2PS_SPECIAL : - /* alignment contains the format for which the special output text - is intended */ - if(prim->data.text->alignment == GL2PS_SVG) - gl2psPrintf("%s\n", prim->data.text->str); - break; - default : - break; - } -} - -static void gl2psPrintSVGFooter(void) -{ - gl2psPrintf("\n"); - gl2psPrintf("\n"); - - gl2psPrintGzipFooter(); -} - -static void gl2psPrintSVGBeginViewport(GLint viewport[4]) -{ - GLint index; - char col[32]; - GLfloat rgba[4]; - int x = viewport[0], y = viewport[1], w = viewport[2], h = viewport[3]; - - glRenderMode(GL_FEEDBACK); - - if(gl2ps->header){ - gl2psPrintSVGHeader(); - gl2ps->header = GL_FALSE; - } - - if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ - if(gl2ps->colormode == GL_RGBA || gl2ps->colorsize == 0){ - glGetFloatv(GL_COLOR_CLEAR_VALUE, rgba); - } - else{ - glGetIntegerv(GL_INDEX_CLEAR_VALUE, &index); - rgba[0] = gl2ps->colormap[index][0]; - rgba[1] = gl2ps->colormap[index][1]; - rgba[2] = gl2ps->colormap[index][2]; - rgba[3] = 1.0F; - } - gl2psSVGGetColorString(rgba, col); - gl2psPrintf("\n", col, - x, gl2ps->viewport[3] - y, - x + w, gl2ps->viewport[3] - y, - x + w, gl2ps->viewport[3] - (y + h), - x, gl2ps->viewport[3] - (y + h)); - } - - gl2psPrintf("\n", x, y, w, h); - gl2psPrintf(" \n", - x, gl2ps->viewport[3] - y, - x + w, gl2ps->viewport[3] - y, - x + w, gl2ps->viewport[3] - (y + h), - x, gl2ps->viewport[3] - (y + h)); - gl2psPrintf("\n"); - gl2psPrintf("\n", x, y, w, h); -} - -static GLint gl2psPrintSVGEndViewport(void) -{ - GLint res; - - res = gl2psPrintPrimitives(); - gl2psPrintf("\n"); - return res; -} - -static void gl2psPrintSVGFinalPrimitive(void) -{ - /* End any remaining line, if any */ - gl2psEndSVGLine(); -} - -/* definition of the SVG backend */ - -static GL2PSbackend gl2psSVG = { - gl2psPrintSVGHeader, - gl2psPrintSVGFooter, - gl2psPrintSVGBeginViewport, - gl2psPrintSVGEndViewport, - gl2psPrintSVGPrimitive, - gl2psPrintSVGFinalPrimitive, - "svg", - "Scalable Vector Graphics" -}; - -/********************************************************************* - * - * PGF routines - * - *********************************************************************/ - -static void gl2psPrintPGFColor(GL2PSrgba rgba) -{ - if(!gl2psSameColor(gl2ps->lastrgba, rgba)){ - gl2psSetLastColor(rgba); - fprintf(gl2ps->stream, "\\color[rgb]{%f,%f,%f}\n", rgba[0], rgba[1], rgba[2]); - } -} - -static void gl2psPrintPGFHeader(void) -{ - time_t now; - - time(&now); - - fprintf(gl2ps->stream, - "%% Title: %s\n" - "%% Creator: GL2PS %d.%d.%d%s, %s\n" - "%% For: %s\n" - "%% CreationDate: %s", - gl2ps->title, GL2PS_MAJOR_VERSION, GL2PS_MINOR_VERSION, - GL2PS_PATCH_VERSION, GL2PS_EXTRA_VERSION, GL2PS_COPYRIGHT, - gl2ps->producer, ctime(&now)); - - fprintf(gl2ps->stream, "\\begin{pgfpicture}\n"); - if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ - gl2psPrintPGFColor(gl2ps->bgcolor); - fprintf(gl2ps->stream, - "\\pgfpathrectanglecorners{" - "\\pgfpoint{%dpt}{%dpt}}{\\pgfpoint{%dpt}{%dpt}}\n" - "\\pgfusepath{fill}\n", - (int)gl2ps->viewport[0], (int)gl2ps->viewport[1], - (int)gl2ps->viewport[2], (int)gl2ps->viewport[3]); - } -} - -static void gl2psPrintPGFDash(GLushort pattern, GLint factor) -{ - int i, n, array[10]; - - if(pattern == gl2ps->lastpattern && factor == gl2ps->lastfactor) - return; - - gl2ps->lastpattern = pattern; - gl2ps->lastfactor = factor; - - if(!pattern || !factor){ - /* solid line */ - fprintf(gl2ps->stream, "\\pgfsetdash{}{0pt}\n"); - } - else{ - gl2psParseStipplePattern(pattern, factor, &n, array); - fprintf(gl2ps->stream, "\\pgfsetdash{"); - for(i = 0; i < n; i++) fprintf(gl2ps->stream, "{%dpt}", array[i]); - fprintf(gl2ps->stream, "}{0pt}\n"); - } -} - -static const char *gl2psPGFTextAlignment(int align) -{ - switch(align){ - case GL2PS_TEXT_C : return "center"; - case GL2PS_TEXT_CL : return "west"; - case GL2PS_TEXT_CR : return "east"; - case GL2PS_TEXT_B : return "south"; - case GL2PS_TEXT_BR : return "south east"; - case GL2PS_TEXT_T : return "north"; - case GL2PS_TEXT_TL : return "north west"; - case GL2PS_TEXT_TR : return "north east"; - case GL2PS_TEXT_BL : - default : return "south west"; - } -} - -static void gl2psPrintPGFPrimitive(void *data) -{ - GL2PSprimitive *prim; - - prim = *(GL2PSprimitive**)data; - - switch(prim->type){ - case GL2PS_POINT : - /* Points in openGL are rectangular */ - gl2psPrintPGFColor(prim->verts[0].rgba); - fprintf(gl2ps->stream, - "\\pgfpathrectangle{\\pgfpoint{%fpt}{%fpt}}" - "{\\pgfpoint{%fpt}{%fpt}}\n\\pgfusepath{fill}\n", - prim->verts[0].xyz[0]-0.5*prim->width, - prim->verts[0].xyz[1]-0.5*prim->width, - prim->width,prim->width); - break; - case GL2PS_LINE : - gl2psPrintPGFColor(prim->verts[0].rgba); - if(gl2ps->lastlinewidth != prim->width){ - gl2ps->lastlinewidth = prim->width; - fprintf(gl2ps->stream, "\\pgfsetlinewidth{%fpt}\n", gl2ps->lastlinewidth); - } - gl2psPrintPGFDash(prim->pattern, prim->factor); - fprintf(gl2ps->stream, - "\\pgfpathmoveto{\\pgfpoint{%fpt}{%fpt}}\n" - "\\pgflineto{\\pgfpoint{%fpt}{%fpt}}\n" - "\\pgfusepath{stroke}\n", - prim->verts[1].xyz[0], prim->verts[1].xyz[1], - prim->verts[0].xyz[0], prim->verts[0].xyz[1]); - break; - case GL2PS_TRIANGLE : - if(gl2ps->lastlinewidth != 0){ - gl2ps->lastlinewidth = 0; - fprintf(gl2ps->stream, "\\pgfsetlinewidth{0.01pt}\n"); - } - gl2psPrintPGFColor(prim->verts[0].rgba); - fprintf(gl2ps->stream, - "\\pgfpathmoveto{\\pgfpoint{%fpt}{%fpt}}\n" - "\\pgflineto{\\pgfpoint{%fpt}{%fpt}}\n" - "\\pgflineto{\\pgfpoint{%fpt}{%fpt}}\n" - "\\pgfpathclose\n" - "\\pgfusepath{fill,stroke}\n", - prim->verts[2].xyz[0], prim->verts[2].xyz[1], - prim->verts[1].xyz[0], prim->verts[1].xyz[1], - prim->verts[0].xyz[0], prim->verts[0].xyz[1]); - break; - case GL2PS_TEXT : - fprintf(gl2ps->stream, "{\n\\pgftransformshift{\\pgfpoint{%fpt}{%fpt}}\n", - prim->verts[0].xyz[0], prim->verts[0].xyz[1]); - - if(prim->data.text->angle) - fprintf(gl2ps->stream, "\\pgftransformrotate{%f}{", prim->data.text->angle); - - fprintf(gl2ps->stream, "\\pgfnode{rectangle}{%s}{\\fontsize{%d}{0}\\selectfont", - gl2psPGFTextAlignment(prim->data.text->alignment), - prim->data.text->fontsize); - - fprintf(gl2ps->stream, "\\textcolor[rgb]{%g,%g,%g}{{%s}}", - prim->verts[0].rgba[0], prim->verts[0].rgba[1], - prim->verts[0].rgba[2], prim->data.text->str); - - fprintf(gl2ps->stream, "}{}{\\pgfusepath{discard}}}\n"); - break; - case GL2PS_SPECIAL : - /* alignment contains the format for which the special output text - is intended */ - if (prim->data.text->alignment == GL2PS_PGF) - fprintf(gl2ps->stream, "%s\n", prim->data.text->str); - break; - default : - break; - } -} - -static void gl2psPrintPGFFooter(void) -{ - fprintf(gl2ps->stream, "\\end{pgfpicture}\n"); -} - -static void gl2psPrintPGFBeginViewport(GLint viewport[4]) -{ - GLint index; - GLfloat rgba[4]; - int x = viewport[0], y = viewport[1], w = viewport[2], h = viewport[3]; - - glRenderMode(GL_FEEDBACK); - - if(gl2ps->header){ - gl2psPrintPGFHeader(); - gl2ps->header = GL_FALSE; - } - - fprintf(gl2ps->stream, "\\begin{pgfscope}\n"); - if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ - if(gl2ps->colormode == GL_RGBA || gl2ps->colorsize == 0){ - glGetFloatv(GL_COLOR_CLEAR_VALUE, rgba); - } - else{ - glGetIntegerv(GL_INDEX_CLEAR_VALUE, &index); - rgba[0] = gl2ps->colormap[index][0]; - rgba[1] = gl2ps->colormap[index][1]; - rgba[2] = gl2ps->colormap[index][2]; - rgba[3] = 1.0F; - } - gl2psPrintPGFColor(rgba); - fprintf(gl2ps->stream, - "\\pgfpathrectangle{\\pgfpoint{%dpt}{%dpt}}" - "{\\pgfpoint{%dpt}{%dpt}}\n" - "\\pgfusepath{fill}\n", - x, y, w, h); - } - - fprintf(gl2ps->stream, - "\\pgfpathrectangle{\\pgfpoint{%dpt}{%dpt}}" - "{\\pgfpoint{%dpt}{%dpt}}\n" - "\\pgfusepath{clip}\n", - x, y, w, h); -} - -static GLint gl2psPrintPGFEndViewport(void) -{ - GLint res; - res = gl2psPrintPrimitives(); - fprintf(gl2ps->stream, "\\end{pgfscope}\n"); - return res; -} - -static void gl2psPrintPGFFinalPrimitive(void) -{ -} - -/* definition of the PGF backend */ - -static GL2PSbackend gl2psPGF = { - gl2psPrintPGFHeader, - gl2psPrintPGFFooter, - gl2psPrintPGFBeginViewport, - gl2psPrintPGFEndViewport, - gl2psPrintPGFPrimitive, - gl2psPrintPGFFinalPrimitive, - "tex", - "PGF Latex Graphics" -}; - -/********************************************************************* - * - * General primitive printing routine - * - *********************************************************************/ - -/* Warning: the ordering of the backends must match the format - #defines in gl2ps.h */ - -static GL2PSbackend *gl2psbackends[] = { - &gl2psPS, /* 0 */ - &gl2psEPS, /* 1 */ - &gl2psTEX, /* 2 */ - &gl2psPDF, /* 3 */ - &gl2psSVG, /* 4 */ - &gl2psPGF /* 5 */ -}; - -static void gl2psComputeTightBoundingBox(void *data) -{ - GL2PSprimitive *prim; - int i; - - prim = *(GL2PSprimitive**)data; - - for(i = 0; i < prim->numverts; i++){ - if(prim->verts[i].xyz[0] < gl2ps->viewport[0]) - gl2ps->viewport[0] = (GLint)prim->verts[i].xyz[0]; - if(prim->verts[i].xyz[0] > gl2ps->viewport[2]) - gl2ps->viewport[2] = (GLint)(prim->verts[i].xyz[0] + 0.5F); - if(prim->verts[i].xyz[1] < gl2ps->viewport[1]) - gl2ps->viewport[1] = (GLint)prim->verts[i].xyz[1]; - if(prim->verts[i].xyz[1] > gl2ps->viewport[3]) - gl2ps->viewport[3] = (GLint)(prim->verts[i].xyz[1] + 0.5F); - } -} - -static GLint gl2psPrintPrimitives(void) -{ - GL2PSbsptree *root; - GL2PSxyz eye = {0.0F, 0.0F, 100.0F * GL2PS_ZSCALE}; - GLint used; - - used = glRenderMode(GL_RENDER); - - if(used < 0){ - gl2psMsg(GL2PS_INFO, "OpenGL feedback buffer overflow"); - return GL2PS_OVERFLOW; - } - - if(used > 0) - gl2psParseFeedbackBuffer(used); - - gl2psRescaleAndOffset(); - - if(gl2ps->header){ - if(gl2psListNbr(gl2ps->primitives) && - (gl2ps->options & GL2PS_TIGHT_BOUNDING_BOX)){ - gl2ps->viewport[0] = gl2ps->viewport[1] = 100000; - gl2ps->viewport[2] = gl2ps->viewport[3] = -100000; - gl2psListAction(gl2ps->primitives, gl2psComputeTightBoundingBox); - } - (gl2psbackends[gl2ps->format]->printHeader)(); - gl2ps->header = GL_FALSE; - } - - if(!gl2psListNbr(gl2ps->primitives)){ - /* empty feedback buffer and/or nothing else to print */ - return GL2PS_NO_FEEDBACK; - } - - switch(gl2ps->sort){ - case GL2PS_NO_SORT : - gl2psListAction(gl2ps->primitives, gl2psbackends[gl2ps->format]->printPrimitive); - gl2psListAction(gl2ps->primitives, gl2psFreePrimitive); - /* reset the primitive list, waiting for the next viewport */ - gl2psListReset(gl2ps->primitives); - break; - case GL2PS_SIMPLE_SORT : - gl2psListSort(gl2ps->primitives, gl2psCompareDepth); - if(gl2ps->options & GL2PS_OCCLUSION_CULL){ - gl2psListActionInverse(gl2ps->primitives, gl2psAddInImageTree); - gl2psFreeBspImageTree(&gl2ps->imagetree); - } - gl2psListAction(gl2ps->primitives, gl2psbackends[gl2ps->format]->printPrimitive); - gl2psListAction(gl2ps->primitives, gl2psFreePrimitive); - /* reset the primitive list, waiting for the next viewport */ - gl2psListReset(gl2ps->primitives); - break; - case GL2PS_BSP_SORT : - root = (GL2PSbsptree*)gl2psMalloc(sizeof(GL2PSbsptree)); - gl2psBuildBspTree(root, gl2ps->primitives); - if(GL_TRUE == gl2ps->boundary) gl2psBuildPolygonBoundary(root); - if(gl2ps->options & GL2PS_OCCLUSION_CULL){ - gl2psTraverseBspTree(root, eye, -GL2PS_EPSILON, gl2psLess, - gl2psAddInImageTree, 1); - gl2psFreeBspImageTree(&gl2ps->imagetree); - } - gl2psTraverseBspTree(root, eye, GL2PS_EPSILON, gl2psGreater, - gl2psbackends[gl2ps->format]->printPrimitive, 0); - gl2psFreeBspTree(&root); - /* reallocate the primitive list (it's been deleted by - gl2psBuildBspTree) in case there is another viewport */ - gl2ps->primitives = gl2psListCreate(500, 500, sizeof(GL2PSprimitive*)); - break; - } - gl2psbackends[gl2ps->format]->printFinalPrimitive(); - - return GL2PS_SUCCESS; -} - -/********************************************************************* - * - * Public routines - * - *********************************************************************/ - -GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer, - GLint viewport[4], GLint format, GLint sort, - GLint options, GLint colormode, - GLint colorsize, GL2PSrgba *colormap, - GLint nr, GLint ng, GLint nb, GLint buffersize, - FILE *stream, const char *filename) -{ - GLint index; - int i; - - if(gl2ps){ - gl2psMsg(GL2PS_ERROR, "gl2psBeginPage called in wrong program state"); - return GL2PS_ERROR; - } - - gl2ps = (GL2PScontext*)gl2psMalloc(sizeof(GL2PScontext)); - - if(format >= 0 && format < (GLint)(sizeof(gl2psbackends) / sizeof(gl2psbackends[0]))){ - gl2ps->format = format; - } - else { - gl2psMsg(GL2PS_ERROR, "Unknown output format: %d", format); - gl2psFree(gl2ps); - gl2ps = NULL; - return GL2PS_ERROR; - } - - switch(sort){ - case GL2PS_NO_SORT : - case GL2PS_SIMPLE_SORT : - case GL2PS_BSP_SORT : - gl2ps->sort = sort; - break; - default : - gl2psMsg(GL2PS_ERROR, "Unknown sorting algorithm: %d", sort); - gl2psFree(gl2ps); - gl2ps = NULL; - return GL2PS_ERROR; - } - - if(stream){ - gl2ps->stream = stream; - } - else{ - gl2psMsg(GL2PS_ERROR, "Bad file pointer"); - gl2psFree(gl2ps); - gl2ps = NULL; - return GL2PS_ERROR; - } - - gl2ps->header = GL_TRUE; - gl2ps->maxbestroot = 10; - gl2ps->options = options; - gl2ps->compress = NULL; - gl2ps->imagemap_head = NULL; - gl2ps->imagemap_tail = NULL; - - if(gl2ps->options & GL2PS_USE_CURRENT_VIEWPORT){ - glGetIntegerv(GL_VIEWPORT, gl2ps->viewport); - } - else{ - for(i = 0; i < 4; i++){ - gl2ps->viewport[i] = viewport[i]; - } - } - - if(!gl2ps->viewport[2] || !gl2ps->viewport[3]){ - gl2psMsg(GL2PS_ERROR, "Incorrect viewport (x=%d, y=%d, width=%d, height=%d)", - gl2ps->viewport[0], gl2ps->viewport[1], - gl2ps->viewport[2], gl2ps->viewport[3]); - gl2psFree(gl2ps); - gl2ps = NULL; - return GL2PS_ERROR; - } - - gl2ps->threshold[0] = nr ? 1.0F / (GLfloat)nr : 0.064F; - gl2ps->threshold[1] = ng ? 1.0F / (GLfloat)ng : 0.034F; - gl2ps->threshold[2] = nb ? 1.0F / (GLfloat)nb : 0.100F; - gl2ps->colormode = colormode; - gl2ps->buffersize = buffersize > 0 ? buffersize : 2048 * 2048; - for(i = 0; i < 3; i++){ - gl2ps->lastvertex.xyz[i] = -1.0F; - } - for(i = 0; i < 4; i++){ - gl2ps->lastvertex.rgba[i] = -1.0F; - gl2ps->lastrgba[i] = -1.0F; - } - gl2ps->lastlinewidth = -1.0F; - gl2ps->lastpattern = 0; - gl2ps->lastfactor = 0; - gl2ps->imagetree = NULL; - gl2ps->primitivetoadd = NULL; - gl2ps->zerosurfacearea = GL_FALSE; - gl2ps->pdfprimlist = NULL; - gl2ps->pdfgrouplist = NULL; - gl2ps->xreflist = NULL; - - /* get default blending mode from current OpenGL state (enabled by - default for SVG) */ - gl2ps->blending = (gl2ps->format == GL2PS_SVG) ? GL_TRUE : glIsEnabled(GL_BLEND); - glGetIntegerv(GL_BLEND_SRC, &gl2ps->blendfunc[0]); - glGetIntegerv(GL_BLEND_DST, &gl2ps->blendfunc[1]); - - if(gl2ps->colormode == GL_RGBA){ - gl2ps->colorsize = 0; - gl2ps->colormap = NULL; - glGetFloatv(GL_COLOR_CLEAR_VALUE, gl2ps->bgcolor); - } - else if(gl2ps->colormode == GL_COLOR_INDEX){ - if(!colorsize || !colormap){ - gl2psMsg(GL2PS_ERROR, "Missing colormap for GL_COLOR_INDEX rendering"); - gl2psFree(gl2ps); - gl2ps = NULL; - return GL2PS_ERROR; - } - gl2ps->colorsize = colorsize; - gl2ps->colormap = (GL2PSrgba*)gl2psMalloc(gl2ps->colorsize * sizeof(GL2PSrgba)); - memcpy(gl2ps->colormap, colormap, gl2ps->colorsize * sizeof(GL2PSrgba)); - glGetIntegerv(GL_INDEX_CLEAR_VALUE, &index); - gl2ps->bgcolor[0] = gl2ps->colormap[index][0]; - gl2ps->bgcolor[1] = gl2ps->colormap[index][1]; - gl2ps->bgcolor[2] = gl2ps->colormap[index][2]; - gl2ps->bgcolor[3] = 1.0F; - } - else{ - gl2psMsg(GL2PS_ERROR, "Unknown color mode in gl2psBeginPage"); - gl2psFree(gl2ps); - gl2ps = NULL; - return GL2PS_ERROR; - } - - if(!title){ - gl2ps->title = (char*)gl2psMalloc(sizeof(char)); - gl2ps->title[0] = '\0'; - } - else{ - gl2ps->title = (char*)gl2psMalloc((strlen(title)+1)*sizeof(char)); - strcpy(gl2ps->title, title); - } - - if(!producer){ - gl2ps->producer = (char*)gl2psMalloc(sizeof(char)); - gl2ps->producer[0] = '\0'; - } - else{ - gl2ps->producer = (char*)gl2psMalloc((strlen(producer)+1)*sizeof(char)); - strcpy(gl2ps->producer, producer); - } - - if(!filename){ - gl2ps->filename = (char*)gl2psMalloc(sizeof(char)); - gl2ps->filename[0] = '\0'; - } - else{ - gl2ps->filename = (char*)gl2psMalloc((strlen(filename)+1)*sizeof(char)); - strcpy(gl2ps->filename, filename); - } - - gl2ps->primitives = gl2psListCreate(500, 500, sizeof(GL2PSprimitive*)); - gl2ps->auxprimitives = gl2psListCreate(100, 100, sizeof(GL2PSprimitive*)); - gl2ps->feedback = (GLfloat*)gl2psMalloc(gl2ps->buffersize * sizeof(GLfloat)); - glFeedbackBuffer(gl2ps->buffersize, GL_3D_COLOR, gl2ps->feedback); - glRenderMode(GL_FEEDBACK); - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psEndPage(void) -{ - GLint res; - - if(!gl2ps) return GL2PS_UNINITIALIZED; - - res = gl2psPrintPrimitives(); - - if(res != GL2PS_OVERFLOW) - (gl2psbackends[gl2ps->format]->printFooter)(); - - fflush(gl2ps->stream); - - gl2psListDelete(gl2ps->primitives); - gl2psListDelete(gl2ps->auxprimitives); - gl2psFreeImagemap(gl2ps->imagemap_head); - gl2psFree(gl2ps->colormap); - gl2psFree(gl2ps->title); - gl2psFree(gl2ps->producer); - gl2psFree(gl2ps->filename); - gl2psFree(gl2ps->feedback); - gl2psFree(gl2ps); - gl2ps = NULL; - - return res; -} - -GL2PSDLL_API GLint gl2psBeginViewport(GLint viewport[4]) -{ - if(!gl2ps) return GL2PS_UNINITIALIZED; - - (gl2psbackends[gl2ps->format]->beginViewport)(viewport); - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psEndViewport(void) -{ - GLint res; - - if(!gl2ps) return GL2PS_UNINITIALIZED; - - res = (gl2psbackends[gl2ps->format]->endViewport)(); - - /* reset last used colors, line widths */ - gl2ps->lastlinewidth = -1.0F; - - return res; -} - -GL2PSDLL_API GLint gl2psTextOpt(const char *str, const char *fontname, - GLshort fontsize, GLint alignment, GLfloat angle) -{ - return gl2psAddText(GL2PS_TEXT, str, fontname, fontsize, alignment, angle); -} - -GL2PSDLL_API GLint gl2psText(const char *str, const char *fontname, GLshort fontsize) -{ - return gl2psAddText(GL2PS_TEXT, str, fontname, fontsize, GL2PS_TEXT_BL, 0.0F); -} - -GL2PSDLL_API GLint gl2psSpecial(GLint format, const char *str) -{ - return gl2psAddText(GL2PS_SPECIAL, str, "", 0, format, 0.0F); -} - -GL2PSDLL_API GLint gl2psDrawPixels(GLsizei width, GLsizei height, - GLint xorig, GLint yorig, - GLenum format, GLenum type, - const void *pixels) -{ - int size, i; - GLfloat pos[4], *piv; - GL2PSprimitive *prim; - GLboolean valid; - - if(!gl2ps || !pixels) return GL2PS_UNINITIALIZED; - - if((width <= 0) || (height <= 0)) return GL2PS_ERROR; - - if(gl2ps->options & GL2PS_NO_PIXMAP) return GL2PS_SUCCESS; - - if((format != GL_RGB && format != GL_RGBA) || type != GL_FLOAT){ - gl2psMsg(GL2PS_ERROR, "gl2psDrawPixels only implemented for " - "GL_RGB/GL_RGBA, GL_FLOAT pixels"); - return GL2PS_ERROR; - } - - glGetBooleanv(GL_CURRENT_RASTER_POSITION_VALID, &valid); - if(GL_FALSE == valid) return GL2PS_SUCCESS; /* the primitive is culled */ - - glGetFloatv(GL_CURRENT_RASTER_POSITION, pos); - - prim = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - prim->type = GL2PS_PIXMAP; - prim->boundary = 0; - prim->numverts = 1; - prim->verts = (GL2PSvertex*)gl2psMalloc(sizeof(GL2PSvertex)); - prim->verts[0].xyz[0] = pos[0] + xorig; - prim->verts[0].xyz[1] = pos[1] + yorig; - prim->verts[0].xyz[2] = pos[2]; - prim->culled = 0; - prim->offset = 0; - prim->pattern = 0; - prim->factor = 0; - prim->width = 1; - glGetFloatv(GL_CURRENT_RASTER_COLOR, prim->verts[0].rgba); - prim->data.image = (GL2PSimage*)gl2psMalloc(sizeof(GL2PSimage)); - prim->data.image->width = width; - prim->data.image->height = height; - prim->data.image->format = format; - prim->data.image->type = type; - - switch(format){ - case GL_RGBA: - if(gl2ps->options & GL2PS_NO_BLENDING || !gl2ps->blending){ - /* special case: blending turned off */ - prim->data.image->format = GL_RGB; - size = height * width * 3; - prim->data.image->pixels = (GLfloat*)gl2psMalloc(size * sizeof(GLfloat)); - piv = (GLfloat*)pixels; - for(i = 0; i < size; ++i, ++piv){ - prim->data.image->pixels[i] = *piv; - if(!((i+1)%3)) - ++piv; - } - } - else{ - size = height * width * 4; - prim->data.image->pixels = (GLfloat*)gl2psMalloc(size * sizeof(GLfloat)); - memcpy(prim->data.image->pixels, pixels, size * sizeof(GLfloat)); - } - break; - case GL_RGB: - default: - size = height * width * 3; - prim->data.image->pixels = (GLfloat*)gl2psMalloc(size * sizeof(GLfloat)); - memcpy(prim->data.image->pixels, pixels, size * sizeof(GLfloat)); - break; - } - - gl2psListAdd(gl2ps->auxprimitives, &prim); - glPassThrough(GL2PS_DRAW_PIXELS_TOKEN); - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psDrawImageMap(GLsizei width, GLsizei height, - const GLfloat position[3], - const unsigned char *imagemap){ - int size, i; - int sizeoffloat = sizeof(GLfloat); - - if(!gl2ps || !imagemap) return GL2PS_UNINITIALIZED; - - if((width <= 0) || (height <= 0)) return GL2PS_ERROR; - - size = height + height * ((width - 1) / 8); - glPassThrough(GL2PS_IMAGEMAP_TOKEN); - glBegin(GL_POINTS); - glVertex3f(position[0], position[1],position[2]); - glEnd(); - glPassThrough((GLfloat)width); - glPassThrough((GLfloat)height); - for(i = 0; i < size; i += sizeoffloat){ - float *value = (float*)imagemap; - glPassThrough(*value); - imagemap += sizeoffloat; - } - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psEnable(GLint mode) -{ - GLint tmp; - - if(!gl2ps) return GL2PS_UNINITIALIZED; - - switch(mode){ - case GL2PS_POLYGON_OFFSET_FILL : - glPassThrough(GL2PS_BEGIN_OFFSET_TOKEN); - glGetFloatv(GL_POLYGON_OFFSET_FACTOR, &gl2ps->offset[0]); - glGetFloatv(GL_POLYGON_OFFSET_UNITS, &gl2ps->offset[1]); - break; - case GL2PS_POLYGON_BOUNDARY : - glPassThrough(GL2PS_BEGIN_BOUNDARY_TOKEN); - break; - case GL2PS_LINE_STIPPLE : - glPassThrough(GL2PS_BEGIN_STIPPLE_TOKEN); - glGetIntegerv(GL_LINE_STIPPLE_PATTERN, &tmp); - glPassThrough((GLfloat)tmp); - glGetIntegerv(GL_LINE_STIPPLE_REPEAT, &tmp); - glPassThrough((GLfloat)tmp); - break; - case GL2PS_BLEND : - glPassThrough(GL2PS_BEGIN_BLEND_TOKEN); - break; - default : - gl2psMsg(GL2PS_WARNING, "Unknown mode in gl2psEnable: %d", mode); - return GL2PS_WARNING; - } - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psDisable(GLint mode) -{ - if(!gl2ps) return GL2PS_UNINITIALIZED; - - switch(mode){ - case GL2PS_POLYGON_OFFSET_FILL : - glPassThrough(GL2PS_END_OFFSET_TOKEN); - break; - case GL2PS_POLYGON_BOUNDARY : - glPassThrough(GL2PS_END_BOUNDARY_TOKEN); - break; - case GL2PS_LINE_STIPPLE : - glPassThrough(GL2PS_END_STIPPLE_TOKEN); - break; - case GL2PS_BLEND : - glPassThrough(GL2PS_END_BLEND_TOKEN); - break; - default : - gl2psMsg(GL2PS_WARNING, "Unknown mode in gl2psDisable: %d", mode); - return GL2PS_WARNING; - } - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psPointSize(GLfloat value) -{ - if(!gl2ps) return GL2PS_UNINITIALIZED; - - glPassThrough(GL2PS_POINT_SIZE_TOKEN); - glPassThrough(value); - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psLineWidth(GLfloat value) -{ - if(!gl2ps) return GL2PS_UNINITIALIZED; - - glPassThrough(GL2PS_LINE_WIDTH_TOKEN); - glPassThrough(value); - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psBlendFunc(GLenum sfactor, GLenum dfactor) -{ - if(!gl2ps) return GL2PS_UNINITIALIZED; - - if(GL_FALSE == gl2psSupportedBlendMode(sfactor, dfactor)) - return GL2PS_WARNING; - - glPassThrough(GL2PS_SRC_BLEND_TOKEN); - glPassThrough((GLfloat)sfactor); - glPassThrough(GL2PS_DST_BLEND_TOKEN); - glPassThrough((GLfloat)dfactor); - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psSetOptions(GLint options) -{ - if(!gl2ps) return GL2PS_UNINITIALIZED; - - gl2ps->options = options; - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psGetOptions(GLint *options) -{ - if(!gl2ps) { - *options = 0; - return GL2PS_UNINITIALIZED; - } - - *options = gl2ps->options; - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API const char *gl2psGetFileExtension(GLint format) -{ - if(format >= 0 && format < (GLint)(sizeof(gl2psbackends) / sizeof(gl2psbackends[0]))) - return gl2psbackends[format]->file_extension; - else - return "Unknown format"; -} - -GL2PSDLL_API const char *gl2psGetFormatDescription(GLint format) -{ - if(format >= 0 && format < (GLint)(sizeof(gl2psbackends) / sizeof(gl2psbackends[0]))) - return gl2psbackends[format]->description; - else - return "Unknown format"; -} === added file '3rdparty/qwtplot3d/3rdparty/gl2ps/gl2ps.h' --- 3rdparty/qwtplot3d/3rdparty/gl2ps/gl2ps.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/3rdparty/gl2ps/gl2ps.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,199 @@ +/* + * GL2PS, an OpenGL to PostScript Printing Library + * Copyright (C) 1999-2009 C. Geuzaine + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of either: + * + * a) the GNU Library General Public License as published by the Free + * Software Foundation, either version 2 of the License, or (at your + * option) any later version; or + * + * b) the GL2PS License as published by Christophe Geuzaine, either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either + * the GNU Library General Public License or the GL2PS License for + * more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library in the file named "COPYING.LGPL"; + * if not, write to the Free Software Foundation, Inc., 675 Mass Ave, + * Cambridge, MA 02139, USA. + * + * You should have received a copy of the GL2PS License with this + * library in the file named "COPYING.GL2PS"; if not, I will be glad + * to provide one. + * + * For the latest info about gl2ps and a full list of contributors, + * see http://www.geuz.org/gl2ps/. + * + * Please report all bugs and problems to . + */ + +#ifndef __GL2PS_H__ +#define __GL2PS_H__ + +#include +#include + +/* Define GL2PSDLL at compile time to build a Windows DLL */ + +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) +# if defined(_MSC_VER) +# pragma warning(disable:4115) +# pragma warning(disable:4996) +# endif +# include +# if defined(GL2PSDLL) +# if defined(GL2PSDLL_EXPORTS) +# define GL2PSDLL_API __declspec(dllexport) +# else +# define GL2PSDLL_API __declspec(dllimport) +# endif +# else +# define GL2PSDLL_API +# endif +#else +# define GL2PSDLL_API +#endif + +#if defined(__APPLE__) || defined(HAVE_OPENGL_GL_H) +# include +#else +# include +#endif + +/* Support for compressed PostScript/PDF/SVG and for embedded PNG + images in SVG */ + +#if defined(HAVE_ZLIB) || defined(HAVE_LIBZ) +# define GL2PS_HAVE_ZLIB +# if defined(HAVE_LIBPNG) || defined(HAVE_PNG) +# define GL2PS_HAVE_LIBPNG +# endif +#endif + +/* Version number */ + +#define GL2PS_MAJOR_VERSION 1 +#define GL2PS_MINOR_VERSION 3 +#define GL2PS_PATCH_VERSION 5 +#define GL2PS_EXTRA_VERSION "" + +#define GL2PS_VERSION (GL2PS_MAJOR_VERSION + \ + 0.01 * GL2PS_MINOR_VERSION + \ + 0.0001 * GL2PS_PATCH_VERSION) + +#define GL2PS_COPYRIGHT "(C) 1999-2009 C. Geuzaine" + +/* Output file formats (the values and the ordering are important!) */ + +#define GL2PS_PS 0 +#define GL2PS_EPS 1 +#define GL2PS_TEX 2 +#define GL2PS_PDF 3 +#define GL2PS_SVG 4 +#define GL2PS_PGF 5 + +/* Sorting algorithms */ + +#define GL2PS_NO_SORT 1 +#define GL2PS_SIMPLE_SORT 2 +#define GL2PS_BSP_SORT 3 + +/* Message levels and error codes */ + +#define GL2PS_SUCCESS 0 +#define GL2PS_INFO 1 +#define GL2PS_WARNING 2 +#define GL2PS_ERROR 3 +#define GL2PS_NO_FEEDBACK 4 +#define GL2PS_OVERFLOW 5 +#define GL2PS_UNINITIALIZED 6 + +/* Options for gl2psBeginPage */ + +#define GL2PS_NONE 0 +#define GL2PS_DRAW_BACKGROUND (1<<0) +#define GL2PS_SIMPLE_LINE_OFFSET (1<<1) +#define GL2PS_SILENT (1<<2) +#define GL2PS_BEST_ROOT (1<<3) +#define GL2PS_OCCLUSION_CULL (1<<4) +#define GL2PS_NO_TEXT (1<<5) +#define GL2PS_LANDSCAPE (1<<6) +#define GL2PS_NO_PS3_SHADING (1<<7) +#define GL2PS_NO_PIXMAP (1<<8) +#define GL2PS_USE_CURRENT_VIEWPORT (1<<9) +#define GL2PS_COMPRESS (1<<10) +#define GL2PS_NO_BLENDING (1<<11) +#define GL2PS_TIGHT_BOUNDING_BOX (1<<12) + +/* Arguments for gl2psEnable/gl2psDisable */ + +#define GL2PS_POLYGON_OFFSET_FILL 1 +#define GL2PS_POLYGON_BOUNDARY 2 +#define GL2PS_LINE_STIPPLE 3 +#define GL2PS_BLEND 4 + +/* Text alignment (o=raster position; default mode is BL): + +---+ +---+ +---+ +---+ +---+ +---+ +-o-+ o---+ +---o + | o | o | | o | | | | | | | | | | | | + +---+ +---+ +---+ +-o-+ o---+ +---o +---+ +---+ +---+ + C CL CR B BL BR T TL TR */ + +#define GL2PS_TEXT_C 1 +#define GL2PS_TEXT_CL 2 +#define GL2PS_TEXT_CR 3 +#define GL2PS_TEXT_B 4 +#define GL2PS_TEXT_BL 5 +#define GL2PS_TEXT_BR 6 +#define GL2PS_TEXT_T 7 +#define GL2PS_TEXT_TL 8 +#define GL2PS_TEXT_TR 9 + +typedef GLfloat GL2PSrgba[4]; + +#if defined(__cplusplus) +extern "C" { +#endif + +GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer, + GLint viewport[4], GLint format, GLint sort, + GLint options, GLint colormode, + GLint colorsize, GL2PSrgba *colormap, + GLint nr, GLint ng, GLint nb, GLint buffersize, + FILE *stream, const char *filename); +GL2PSDLL_API GLint gl2psEndPage(void); +GL2PSDLL_API GLint gl2psSetOptions(GLint options); +GL2PSDLL_API GLint gl2psGetOptions(GLint *options); +GL2PSDLL_API GLint gl2psBeginViewport(GLint viewport[4]); +GL2PSDLL_API GLint gl2psEndViewport(void); +GL2PSDLL_API GLint gl2psText(const char *str, const char *fontname, + GLshort fontsize); +GL2PSDLL_API GLint gl2psTextOpt(const char *str, const char *fontname, + GLshort fontsize, GLint align, GLfloat angle); +GL2PSDLL_API GLint gl2psSpecial(GLint format, const char *str); +GL2PSDLL_API GLint gl2psDrawPixels(GLsizei width, GLsizei height, + GLint xorig, GLint yorig, + GLenum format, GLenum type, const void *pixels); +GL2PSDLL_API GLint gl2psEnable(GLint mode); +GL2PSDLL_API GLint gl2psDisable(GLint mode); +GL2PSDLL_API GLint gl2psPointSize(GLfloat value); +GL2PSDLL_API GLint gl2psLineWidth(GLfloat value); +GL2PSDLL_API GLint gl2psBlendFunc(GLenum sfactor, GLenum dfactor); + +/* undocumented */ +GL2PSDLL_API GLint gl2psDrawImageMap(GLsizei width, GLsizei height, + const GLfloat position[3], + const unsigned char *imagemap); +GL2PSDLL_API const char *gl2psGetFileExtension(GLint format); +GL2PSDLL_API const char *gl2psGetFormatDescription(GLint format); + +#if defined(__cplusplus) +} +#endif + +#endif /* __GL2PS_H__ */ === removed file '3rdparty/qwtplot3d/3rdparty/gl2ps/gl2ps.h' --- 3rdparty/qwtplot3d/3rdparty/gl2ps/gl2ps.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/3rdparty/gl2ps/gl2ps.h 1970-01-01 00:00:00 +0000 @@ -1,199 +0,0 @@ -/* - * GL2PS, an OpenGL to PostScript Printing Library - * Copyright (C) 1999-2009 C. Geuzaine - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of either: - * - * a) the GNU Library General Public License as published by the Free - * Software Foundation, either version 2 of the License, or (at your - * option) any later version; or - * - * b) the GL2PS License as published by Christophe Geuzaine, either - * version 2 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either - * the GNU Library General Public License or the GL2PS License for - * more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library in the file named "COPYING.LGPL"; - * if not, write to the Free Software Foundation, Inc., 675 Mass Ave, - * Cambridge, MA 02139, USA. - * - * You should have received a copy of the GL2PS License with this - * library in the file named "COPYING.GL2PS"; if not, I will be glad - * to provide one. - * - * For the latest info about gl2ps and a full list of contributors, - * see http://www.geuz.org/gl2ps/. - * - * Please report all bugs and problems to . - */ - -#ifndef __GL2PS_H__ -#define __GL2PS_H__ - -#include -#include - -/* Define GL2PSDLL at compile time to build a Windows DLL */ - -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) -# if defined(_MSC_VER) -# pragma warning(disable:4115) -# pragma warning(disable:4996) -# endif -# include -# if defined(GL2PSDLL) -# if defined(GL2PSDLL_EXPORTS) -# define GL2PSDLL_API __declspec(dllexport) -# else -# define GL2PSDLL_API __declspec(dllimport) -# endif -# else -# define GL2PSDLL_API -# endif -#else -# define GL2PSDLL_API -#endif - -#if defined(__APPLE__) || defined(HAVE_OPENGL_GL_H) -# include -#else -# include -#endif - -/* Support for compressed PostScript/PDF/SVG and for embedded PNG - images in SVG */ - -#if defined(HAVE_ZLIB) || defined(HAVE_LIBZ) -# define GL2PS_HAVE_ZLIB -# if defined(HAVE_LIBPNG) || defined(HAVE_PNG) -# define GL2PS_HAVE_LIBPNG -# endif -#endif - -/* Version number */ - -#define GL2PS_MAJOR_VERSION 1 -#define GL2PS_MINOR_VERSION 3 -#define GL2PS_PATCH_VERSION 5 -#define GL2PS_EXTRA_VERSION "" - -#define GL2PS_VERSION (GL2PS_MAJOR_VERSION + \ - 0.01 * GL2PS_MINOR_VERSION + \ - 0.0001 * GL2PS_PATCH_VERSION) - -#define GL2PS_COPYRIGHT "(C) 1999-2009 C. Geuzaine" - -/* Output file formats (the values and the ordering are important!) */ - -#define GL2PS_PS 0 -#define GL2PS_EPS 1 -#define GL2PS_TEX 2 -#define GL2PS_PDF 3 -#define GL2PS_SVG 4 -#define GL2PS_PGF 5 - -/* Sorting algorithms */ - -#define GL2PS_NO_SORT 1 -#define GL2PS_SIMPLE_SORT 2 -#define GL2PS_BSP_SORT 3 - -/* Message levels and error codes */ - -#define GL2PS_SUCCESS 0 -#define GL2PS_INFO 1 -#define GL2PS_WARNING 2 -#define GL2PS_ERROR 3 -#define GL2PS_NO_FEEDBACK 4 -#define GL2PS_OVERFLOW 5 -#define GL2PS_UNINITIALIZED 6 - -/* Options for gl2psBeginPage */ - -#define GL2PS_NONE 0 -#define GL2PS_DRAW_BACKGROUND (1<<0) -#define GL2PS_SIMPLE_LINE_OFFSET (1<<1) -#define GL2PS_SILENT (1<<2) -#define GL2PS_BEST_ROOT (1<<3) -#define GL2PS_OCCLUSION_CULL (1<<4) -#define GL2PS_NO_TEXT (1<<5) -#define GL2PS_LANDSCAPE (1<<6) -#define GL2PS_NO_PS3_SHADING (1<<7) -#define GL2PS_NO_PIXMAP (1<<8) -#define GL2PS_USE_CURRENT_VIEWPORT (1<<9) -#define GL2PS_COMPRESS (1<<10) -#define GL2PS_NO_BLENDING (1<<11) -#define GL2PS_TIGHT_BOUNDING_BOX (1<<12) - -/* Arguments for gl2psEnable/gl2psDisable */ - -#define GL2PS_POLYGON_OFFSET_FILL 1 -#define GL2PS_POLYGON_BOUNDARY 2 -#define GL2PS_LINE_STIPPLE 3 -#define GL2PS_BLEND 4 - -/* Text alignment (o=raster position; default mode is BL): - +---+ +---+ +---+ +---+ +---+ +---+ +-o-+ o---+ +---o - | o | o | | o | | | | | | | | | | | | - +---+ +---+ +---+ +-o-+ o---+ +---o +---+ +---+ +---+ - C CL CR B BL BR T TL TR */ - -#define GL2PS_TEXT_C 1 -#define GL2PS_TEXT_CL 2 -#define GL2PS_TEXT_CR 3 -#define GL2PS_TEXT_B 4 -#define GL2PS_TEXT_BL 5 -#define GL2PS_TEXT_BR 6 -#define GL2PS_TEXT_T 7 -#define GL2PS_TEXT_TL 8 -#define GL2PS_TEXT_TR 9 - -typedef GLfloat GL2PSrgba[4]; - -#if defined(__cplusplus) -extern "C" { -#endif - -GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer, - GLint viewport[4], GLint format, GLint sort, - GLint options, GLint colormode, - GLint colorsize, GL2PSrgba *colormap, - GLint nr, GLint ng, GLint nb, GLint buffersize, - FILE *stream, const char *filename); -GL2PSDLL_API GLint gl2psEndPage(void); -GL2PSDLL_API GLint gl2psSetOptions(GLint options); -GL2PSDLL_API GLint gl2psGetOptions(GLint *options); -GL2PSDLL_API GLint gl2psBeginViewport(GLint viewport[4]); -GL2PSDLL_API GLint gl2psEndViewport(void); -GL2PSDLL_API GLint gl2psText(const char *str, const char *fontname, - GLshort fontsize); -GL2PSDLL_API GLint gl2psTextOpt(const char *str, const char *fontname, - GLshort fontsize, GLint align, GLfloat angle); -GL2PSDLL_API GLint gl2psSpecial(GLint format, const char *str); -GL2PSDLL_API GLint gl2psDrawPixels(GLsizei width, GLsizei height, - GLint xorig, GLint yorig, - GLenum format, GLenum type, const void *pixels); -GL2PSDLL_API GLint gl2psEnable(GLint mode); -GL2PSDLL_API GLint gl2psDisable(GLint mode); -GL2PSDLL_API GLint gl2psPointSize(GLfloat value); -GL2PSDLL_API GLint gl2psLineWidth(GLfloat value); -GL2PSDLL_API GLint gl2psBlendFunc(GLenum sfactor, GLenum dfactor); - -/* undocumented */ -GL2PSDLL_API GLint gl2psDrawImageMap(GLsizei width, GLsizei height, - const GLfloat position[3], - const unsigned char *imagemap); -GL2PSDLL_API const char *gl2psGetFileExtension(GLint format); -GL2PSDLL_API const char *gl2psGetFormatDescription(GLint format); - -#if defined(__cplusplus) -} -#endif - -#endif /* __GL2PS_H__ */ === added directory '3rdparty/qwtplot3d/include' === removed directory '3rdparty/qwtplot3d/include' === added file '3rdparty/qwtplot3d/include/qwt3d_autoptr.h' --- 3rdparty/qwtplot3d/include/qwt3d_autoptr.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_autoptr.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,75 @@ +#ifndef qwt3d_autoptr_h__2004_05_14_18_57_begin_guarded_code +#define qwt3d_autoptr_h__2004_05_14_18_57_begin_guarded_code + +namespace Qwt3D +{ + +//! Simple Auto pointer providing deep copies for raw pointer +/*! + Requirements: \n + virtual T* T::clone() const;\n + T::destroy() const; + virtual ~T() private/protected\n\n + clone() is necessary for the pointer to preserve polymorphic behaviour. + The pointer requires also heap based objects with regard to the template + argument in order to be able to get ownership and control over destruction. + */ +template +class qwt3d_ptr +{ +public: + //! Standard ctor + explicit qwt3d_ptr(T* ptr = 0) + :rawptr_(ptr) + { + } + //! Dtor (calls T::destroy) + ~qwt3d_ptr() + { + destroyRawPtr(); + } + + //! Copy ctor (calls (virtual) clone()) + qwt3d_ptr(qwt3d_ptr const& val) + { + rawptr_ = val.rawptr_->clone(); + } + + //! Assignment in the same spirit as copy ctor + qwt3d_ptr& operator=(qwt3d_ptr const& val) + { + if (this == &val) + return *this; + + destroyRawPtr(); + rawptr_ = val.rawptr_->clone(); + + return *this; + } + + //! It's a pointerlike object, isn't it ? + T* operator->() const + { + return rawptr_; + } + + //! Dereferencing + T& operator*() const + { + return *rawptr_; + } + + +private: + T* rawptr_; + void destroyRawPtr() + { + if (rawptr_) + rawptr_->destroy(); + rawptr_ = 0; + } +}; + +} // ns + +#endif /* include guarded */ === removed file '3rdparty/qwtplot3d/include/qwt3d_autoptr.h' --- 3rdparty/qwtplot3d/include/qwt3d_autoptr.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_autoptr.h 1970-01-01 00:00:00 +0000 @@ -1,75 +0,0 @@ -#ifndef qwt3d_autoptr_h__2004_05_14_18_57_begin_guarded_code -#define qwt3d_autoptr_h__2004_05_14_18_57_begin_guarded_code - -namespace Qwt3D -{ - -//! Simple Auto pointer providing deep copies for raw pointer -/*! - Requirements: \n - virtual T* T::clone() const;\n - T::destroy() const; - virtual ~T() private/protected\n\n - clone() is necessary for the pointer to preserve polymorphic behaviour. - The pointer requires also heap based objects with regard to the template - argument in order to be able to get ownership and control over destruction. - */ -template -class qwt3d_ptr -{ -public: - //! Standard ctor - explicit qwt3d_ptr(T* ptr = 0) - :rawptr_(ptr) - { - } - //! Dtor (calls T::destroy) - ~qwt3d_ptr() - { - destroyRawPtr(); - } - - //! Copy ctor (calls (virtual) clone()) - qwt3d_ptr(qwt3d_ptr const& val) - { - rawptr_ = val.rawptr_->clone(); - } - - //! Assignment in the same spirit as copy ctor - qwt3d_ptr& operator=(qwt3d_ptr const& val) - { - if (this == &val) - return *this; - - destroyRawPtr(); - rawptr_ = val.rawptr_->clone(); - - return *this; - } - - //! It's a pointerlike object, isn't it ? - T* operator->() const - { - return rawptr_; - } - - //! Dereferencing - T& operator*() const - { - return *rawptr_; - } - - -private: - T* rawptr_; - void destroyRawPtr() - { - if (rawptr_) - rawptr_->destroy(); - rawptr_ = 0; - } -}; - -} // ns - -#endif /* include guarded */ === added file '3rdparty/qwtplot3d/include/qwt3d_autoscaler.h' --- 3rdparty/qwtplot3d/include/qwt3d_autoscaler.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_autoscaler.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,51 @@ +#ifndef __qwt3d_autoscaler_2003_08_18_12_05__ +#define __qwt3d_autoscaler_2003_08_18_12_05__ + +#include +#include "qwt3d_global.h" +#include "qwt3d_autoptr.h" + +namespace Qwt3D +{ + +//! ABC for autoscaler +class QWT3D_EXPORT AutoScaler +{ +friend class qwt3d_ptr; +protected: + //! Returns a new heap based object of the derived class. + virtual AutoScaler* clone() const = 0; + //! To implement from subclasses + virtual int execute(double& a, double& b, double start, double stop, int ivals) = 0; + virtual ~AutoScaler(){} + +private: + void destroy() const {delete this;} //!< Used by qwt3d_ptr +}; + +//! Automatic beautifying of linear scales +class QWT3D_EXPORT LinearAutoScaler : public AutoScaler +{ +friend class LinearScale; +protected: + LinearAutoScaler(); + explicit LinearAutoScaler(std::vector& mantisses); + //! Returns a new heap based object utilized from qwt3d_ptr + AutoScaler* clone() const {return new LinearAutoScaler(*this);} + int execute(double& a, double& b, double start, double stop, int ivals); + +private: + + double start_, stop_; + int intervals_; + + void init(double start, double stop, int ivals); + double anchorvalue(double start, double mantisse, int exponent); + int segments(int& l_intervals, int& r_intervals, double start, double stop, double anchor, double mantissa, int exponent); + std::vector mantissi_; +}; + +} // ns + + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_autoscaler.h' --- 3rdparty/qwtplot3d/include/qwt3d_autoscaler.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_autoscaler.h 1970-01-01 00:00:00 +0000 @@ -1,51 +0,0 @@ -#ifndef __qwt3d_autoscaler_2003_08_18_12_05__ -#define __qwt3d_autoscaler_2003_08_18_12_05__ - -#include -#include "qwt3d_global.h" -#include "qwt3d_autoptr.h" - -namespace Qwt3D -{ - -//! ABC for autoscaler -class QWT3D_EXPORT AutoScaler -{ -friend class qwt3d_ptr; -protected: - //! Returns a new heap based object of the derived class. - virtual AutoScaler* clone() const = 0; - //! To implement from subclasses - virtual int execute(double& a, double& b, double start, double stop, int ivals) = 0; - virtual ~AutoScaler(){} - -private: - void destroy() const {delete this;} //!< Used by qwt3d_ptr -}; - -//! Automatic beautifying of linear scales -class QWT3D_EXPORT LinearAutoScaler : public AutoScaler -{ -friend class LinearScale; -protected: - LinearAutoScaler(); - explicit LinearAutoScaler(std::vector& mantisses); - //! Returns a new heap based object utilized from qwt3d_ptr - AutoScaler* clone() const {return new LinearAutoScaler(*this);} - int execute(double& a, double& b, double start, double stop, int ivals); - -private: - - double start_, stop_; - int intervals_; - - void init(double start, double stop, int ivals); - double anchorvalue(double start, double mantisse, int exponent); - int segments(int& l_intervals, int& r_intervals, double start, double stop, double anchor, double mantissa, int exponent); - std::vector mantissi_; -}; - -} // ns - - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_axis.h' --- 3rdparty/qwtplot3d/include/qwt3d_axis.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_axis.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,140 @@ +#ifndef __AXIS_H__ +#define __AXIS_H__ + +#include "qwt3d_autoptr.h" +#include "qwt3d_label.h" +#include "qwt3d_scale.h" +#include "qwt3d_autoscaler.h" + +namespace Qwt3D +{ + +//! Autoscalable axis with caption. +/*! + Axes are highly customizable especially in terms + of labeling and scaling. +*/ +class QWT3D_EXPORT Axis : public Drawable +{ + +public: + + Axis(); //!< Constructs standard axis + Axis(Qwt3D::Triple beg, Qwt3D::Triple end); //!< Constructs a new axis with specified limits + virtual ~Axis(); // dtor + + virtual void draw(); //!< Draws axis + + void setPosition(const Qwt3D::Triple& beg, const Qwt3D::Triple& end); //!< Positionate axis + void position(Qwt3D::Triple& beg, Qwt3D::Triple& end) const {beg = beg_; end = end_;} //!< Returns axis' position + Qwt3D::Triple begin() const { return beg_; } //!< Returns axis' beginning position + Qwt3D::Triple end() const { return end_; } //!< Returns axis' ending position + double length() const { return (end_-beg_).length(); } //!< Returns axis' length + + bool decorate() const { return decorate_; } //! whether or not labels/tics will be drawn (overrides individual flags) + void setDecorate(bool on) { decorate_ = on; } //! toggle whether or not labels/tics will be drawn (overrides individual flags) + + void setTicLength(double majorl, double minorl); //!< Sets tics lengths in world coordinates + //! Returns tics lengths + void ticLength(double& majorl, double& minorl) const {majorl = lmaj_; minorl = lmin_;} + void setTicOrientation(double tx, double ty, double tz); //!< Sets tic orientation + void setTicOrientation(const Qwt3D::Triple& val); //!< Same function as above + Qwt3D::Triple ticOrientation() const { return orientation_; } //!< Returns tic orientation + void setSymmetricTics( bool b) { symtics_ = b; } //!< Sets two-sided tics (default is false) + + //! Sets font for axis label + void setLabelFont(QString const& family, int pointSize, int weight = QFont::Normal, bool italic = false); + void setLabelFont(QFont const& font); //!< Sets font for axis label + QFont const& labelFont() const { return labelfont_; } //!< Returns current label font + + void setLabelString(QString const& name); //!< Sets label content + const QString& labelString() const { return label_.string(); } //!< Gets label content + + void setLabelPosition(const Qwt3D::Triple& pos, Qwt3D::ANCHOR); + void setLabelColor(Qwt3D::RGBA col); + void setLabel(bool d) { drawLabel_ = d; } //!< Turns label drawing on or off + bool label() const { return drawLabel_; } //!< Whether label drawing is on or off + void adjustLabel(int val) { labelgap_ = val; } //!< Shifts label in device coordinates dependent on anchor; + + void setScaling(bool d) { drawTics_ = d; } //!< Turns scale drawing on or off + bool scaling() const { return drawTics_; } //!< Returns, if scale drawing is on or off + void setScale(Qwt3D::SCALETYPE); + void setScale(Scale* item); + + void setNumbers(bool d) { drawNumbers_ = d; } //!< Turns number drawing on or off + bool numbers() const { return drawNumbers_; } //!< Returns, if number drawing is on or off + void setNumberColor(Qwt3D::RGBA col); //!< Sets the color for axes numbers + Qwt3D::RGBA numberColor() const { return numbercolor_; } //!< Returns the color for axes numbers + //! Sets font for numbering + void setNumberFont(QString const& family, int pointSize, int weight = QFont::Normal, bool italic = false); + void setNumberFont(QFont const&); //!< Overloaded member, works like the above function + QFont const& numberFont() const { return numberfont_; } //!< Returns current numbering font + void setNumberAnchor(Qwt3D::ANCHOR a) { scaleNumberAnchor_ = a; } //!< Sets anchor position for numbers + void adjustNumbers(int val) { numbergap_ = val; } //!< Shifts axis numbers in device coordinates dependent on anchor; + + void setAutoScale(bool val = true) { autoscale_ = val; } //!< Turns Autoscaling on or off + bool autoScale() const { return autoscale_; } //!< actual Autoscaling mode + + void setMajors(int val); //!< Requests major intervals (maybe changed, if autoscaling is present) + void setMinors(int val); //!< Requests minor intervals + int majors() const { return majorintervals_; } //!< Returns number of major intervals + int minors() const { return minorintervals_; } //!< Returns number of minor intervals + Qwt3D::TripleField const& majorPositions() const {return majorpos_; } //!< Returns positions for actual major tics (also if invisible) + Qwt3D::TripleField const& minorPositions() const {return minorpos_; } //!< Returns positions for actual minor tics (also if invisible) + + //! Sets line width for axis components + void setLineWidth(double val, double majfac = 0.9, double minfac = 0.5); + double lineWidth() const { return lineWidth_; } //!< Returns line width for axis body + double majLineWidth() const { return majLineWidth_; } //!< Returns Line width for major tics + double minLineWidth() const { return minLineWidth_; } //!< Returns Line width for minor tics + + void setLimits(double start, double stop) {start_=start; stop_=stop;} //!< Sets interval + void limits(double& start, double& stop) const {start = start_; stop = stop_;} //!< Returns axis interval + void recalculateTics(); //!< Enforces recalculation of ticmark positions + + int numericPrecision(){return scale_->numericPrecision();};//!< Returns numeric precision for tick labels + Qwt3D::Scale::NumericFormat numericFormat(){return scale_->numericFormat();};//!< Returns numeric format for tick labels + void setNumericFormat(const Qwt3D::Scale::NumericFormat& fmt, int prec){scale_->setNumericFormat(fmt, prec);}; + +private: + + void init(); + void drawBase(); + void drawTics(); + void drawTicLabel(Qwt3D::Triple Pos, int mtic); + Qwt3D::Triple drawTic(Qwt3D::Triple nadir, double length); + void drawLabel(); + bool prepTicCalculation(Triple& startpoint); + + Qwt3D::ANCHOR scaleNumberAnchor_; + Qwt3D::Label label_; + std::vector markerLabel_; + + Qwt3D::Triple beg_, end_; + Qwt3D::TripleField majorpos_, minorpos_; //! vectors, holding major resp. minor tic positions; + + Qwt3D::Triple ncube_beg_, ncube_end_; //!< enclosing parallelepiped for axis numbering + + double start_, stop_, autostart_, autostop_; + double lmaj_, lmin_; + Qwt3D::Triple orientation_; + + int majorintervals_, minorintervals_; + + double lineWidth_, majLineWidth_, minLineWidth_; + bool symtics_; + bool drawNumbers_, drawTics_, drawLabel_; + bool autoscale_; + QFont numberfont_, labelfont_; + Qwt3D::RGBA numbercolor_; + + int numbergap_, labelgap_; + + Qwt3D::qwt3d_ptr scale_; + + bool decorate_; +}; + +} // ns + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_axis.h' --- 3rdparty/qwtplot3d/include/qwt3d_axis.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_axis.h 1970-01-01 00:00:00 +0000 @@ -1,127 +0,0 @@ -#ifndef __AXIS_H__ -#define __AXIS_H__ - -#include "qwt3d_autoptr.h" -#include "qwt3d_label.h" -#include "qwt3d_scale.h" -#include "qwt3d_autoscaler.h" - -namespace Qwt3D -{ - -//! Autoscalable axis with caption. -/*! - Axes are highly customizable especially in terms - of labeling and scaling. -*/ -class QWT3D_EXPORT Axis : public Drawable -{ - -public: - - Axis(); //!< Constructs standard axis - Axis(Qwt3D::Triple beg, Qwt3D::Triple end); //!< Constructs a new axis with specified limits - virtual ~Axis(); // dtor - - virtual void draw(); //!< Draws axis - - void setPosition(const Qwt3D::Triple& beg, const Qwt3D::Triple& end); //!< Positionate axis - void position(Qwt3D::Triple& beg, Qwt3D::Triple& end) const {beg = beg_; end = end_;} //!< Returns axis' position - Qwt3D::Triple begin() const { return beg_; } //!< Returns axis' beginning position - Qwt3D::Triple end() const { return end_; } //!< Returns axis' ending position - double length() const { return (end_-beg_).length(); } //!< Returns axis' length - - void setTicLength(double majorl, double minorl); //!< Sets tics lengths in world coordinates - //! Returns tics lengths - void ticLength(double& majorl, double& minorl) const {majorl = lmaj_; minorl = lmin_;} - void setTicOrientation(double tx, double ty, double tz); //!< Sets tic orientation - void setTicOrientation(const Qwt3D::Triple& val); //!< Same function as above - Qwt3D::Triple ticOrientation() const { return orientation_;} //!< Returns tic orientation - void setSymmetricTics( bool b) { symtics_ = b;} //!< Sets two-sided tics (default is false) - - //! Sets font for axis label - void setLabelFont(QString const& family, int pointSize, int weight = QFont::Normal, bool italic = false); - void setLabelFont(QFont const& font); //!< Sets font for axis label - QFont const& labelFont() const {return labelfont_;} //!< Returns current label font - - void setLabelString(QString const& name); //!< Sets label content - void setLabelPosition(const Qwt3D::Triple& pos, Qwt3D::ANCHOR); - void setLabelColor(Qwt3D::RGBA col); - void setLabel(bool d) {drawLabel_ = d;} //!< Turns label drawing on or off - void adjustLabel(int val) {labelgap_ = val;} //!< Shifts label in device coordinates dependent on anchor; - - void setScaling(bool d) {drawTics_ = d;} //!< Turns scale drawing on or off - bool scaling() const {return drawTics_;} //!< Returns, if scale drawing is on or off - void setScale(Qwt3D::SCALETYPE); - void setScale(Scale* item); - void setNumbers(bool d) {drawNumbers_ = d;} //!< Turns number drawing on or off - bool numbers() const {return drawNumbers_;} //!< Returns, if number drawing is on or off - void setNumberColor(Qwt3D::RGBA col); //!< Sets the color for axes numbers - Qwt3D::RGBA numberColor() const {return numbercolor_;} //!< Returns the color for axes numbers - //! Sets font for numbering - void setNumberFont(QString const& family, int pointSize, int weight = QFont::Normal, bool italic = false); - void setNumberFont(QFont const&); //!< Overloaded member, works like the above function - QFont const& numberFont() const {return numberfont_;} //!< Returns current numbering font - void setNumberAnchor(Qwt3D::ANCHOR a) { scaleNumberAnchor_ = a;} //!< Sets anchor position for numbers - void adjustNumbers(int val) {numbergap_ = val;} //!< Shifts axis numbers in device coordinates dependent on anchor; - - void setAutoScale(bool val = true) {autoscale_ = val;} //!< Turns Autoscaling on or off - bool autoScale() const { return autoscale_;} //!< actual Autoscaling mode - - void setMajors(int val); //!< Requests major intervals (maybe changed, if autoscaling is present) - void setMinors(int val); //!< Requests minor intervals - int majors() const { return majorintervals_; } //!< Returns number of major intervals - int minors() const { return minorintervals_; } //!< Returns number of minor intervals - Qwt3D::TripleField const& majorPositions() const {return majorpos_;} //!< Returns positions for actual major tics (also if invisible) - Qwt3D::TripleField const& minorPositions() const {return minorpos_;} //!< Returns positions for actual minor tics (also if invisible) - - //! Sets line width for axis components - void setLineWidth(double val, double majfac = 0.9, double minfac = 0.5); - double lineWidth() const { return lineWidth_;} //!< Returns line width for axis body - double majLineWidth() const { return majLineWidth_;} //!< Returns Line width for major tics - double minLineWidth() const { return minLineWidth_;} //!< Returns Line width for minor tics - - void setLimits(double start, double stop) {start_=start; stop_=stop;} //!< Sets interval - void limits(double& start, double& stop) const {start = start_; stop = stop_;} //!< Returns axis interval - void recalculateTics(); //!< Enforces recalculation of ticmark positions - -private: - - void init(); - void drawBase(); - void drawTics(); - void drawTicLabel(Qwt3D::Triple Pos, int mtic); - Qwt3D::Triple drawTic(Qwt3D::Triple nadir, double length); - void drawLabel(); - bool prepTicCalculation(Triple& startpoint); - - Qwt3D::ANCHOR scaleNumberAnchor_; - Qwt3D::Label label_; - std::vector markerLabel_; - - Qwt3D::Triple beg_, end_; - Qwt3D::TripleField majorpos_, minorpos_; //! vectors, holding major resp. minor tic positions; - - Qwt3D::Triple ncube_beg_, ncube_end_; //!< enclosing parallelepiped for axis numbering - - double start_, stop_, autostart_, autostop_; - double lmaj_, lmin_; - Qwt3D::Triple orientation_; - - int majorintervals_, minorintervals_; - - double lineWidth_, majLineWidth_, minLineWidth_; - bool symtics_; - bool drawNumbers_, drawTics_, drawLabel_; - bool autoscale_; - QFont numberfont_, labelfont_; - Qwt3D::RGBA numbercolor_; - - int numbergap_, labelgap_; - - Qwt3D::qwt3d_ptr scale_; -}; - -} // ns - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_color.h' --- 3rdparty/qwtplot3d/include/qwt3d_color.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_color.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,64 @@ +#ifndef __COLORGENERATOR_H__ +#define __COLORGENERATOR_H__ + +#include +#include "qwt3d_global.h" +#include "qwt3d_types.h" + +namespace Qwt3D +{ + class Curve; + +//! Abstract base class for color functors +/*! +Use your own color model by providing an implementation of operator()(double x, double y, double z). +Colors destructor has been declared \c protected, in order to use only heap based objects. Curve +will handle the objects destruction. +See StandardColor for an example +*/ +class QWT3D_EXPORT Color +{ +public: + virtual Qwt3D::RGBA operator()(double x, double y, double z) const = 0; //!< Implement your color model here + virtual Qwt3D::RGBA operator()(Qwt3D::Triple const& t) const {return this->operator()(t.x,t.y,t.z);} + //! Should create a color vector usable by ColorLegend. The default implementation returns his argument + virtual Qwt3D::ColorVector& createVector(Qwt3D::ColorVector& vec) { return vec; } + + void destroy() const { delete this;} + +protected: + virtual ~Color(){} //!< Allow heap based objects only +}; + + + +class Curve; +//! Standard color model for Curve - implements the data driven operator()(double x, double y, double z) +/*! +The class has a ColorVector representing z values, which will be used by operator()(double x, double y, double z) +*/ +class QWT3D_EXPORT StandardColor : public Color +{ +public: + //! Initializes with data and set up a ColorVector with a size of 100 z values (default); + explicit StandardColor(Qwt3D::Curve* data, unsigned size = 100); + Qwt3D::RGBA operator()(double x, double y, double z) const; //!< Receives z-dependend color from ColorVector + void setColorVector(Qwt3D::ColorVector const& cv); + void reset(unsigned size=100); //!< Resets the standard colors; + void setAlpha(double a); //!< Sets unitary alpha value for all colors + /** + \brief Creates color vector + + Creates a color vector used by ColorLegend. This is essentially a copy from the internal used vector. + \return The vector created + */ + Qwt3D::ColorVector& createVector(Qwt3D::ColorVector& vec) {vec = colors_; return vec;} + +protected: + Qwt3D::ColorVector colors_; + Qwt3D::Curve* data_; +}; + +} // ns + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_color.h' --- 3rdparty/qwtplot3d/include/qwt3d_color.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_color.h 1970-01-01 00:00:00 +0000 @@ -1,63 +0,0 @@ -#ifndef __COLORGENERATOR_H__ -#define __COLORGENERATOR_H__ - -#include -#include "qwt3d_global.h" -#include "qwt3d_types.h" - -namespace Qwt3D -{ - -//! Abstract base class for color functors -/*! -Use your own color model by providing an implementation of operator()(double x, double y, double z). -Colors destructor has been declared \c protected, in order to use only heap based objects. Plot3D -will handle the objects destruction. -See StandardColor for an example -*/ -class QWT3D_EXPORT Color -{ -public: - virtual Qwt3D::RGBA operator()(double x, double y, double z) const = 0; //!< Implement your color model here - virtual Qwt3D::RGBA operator()(Qwt3D::Triple const& t) const {return this->operator()(t.x,t.y,t.z);} - //! Should create a color vector usable by ColorLegend. The default implementation returns his argument - virtual Qwt3D::ColorVector& createVector(Qwt3D::ColorVector& vec) { return vec; } - - void destroy() const { delete this;} - -protected: - virtual ~Color(){} //!< Allow heap based objects only -}; - - - -class Plot3D; -//! Standard color model for Plot3D - implements the data driven operator()(double x, double y, double z) -/*! -The class has a ColorVector representing z values, which will be used by operator()(double x, double y, double z) -*/ -class QWT3D_EXPORT StandardColor : public Color -{ -public: - //! Initializes with data and set up a ColorVector with a size of 100 z values (default); - explicit StandardColor(Qwt3D::Plot3D* data, unsigned size = 100); - Qwt3D::RGBA operator()(double x, double y, double z) const; //!< Receives z-dependend color from ColorVector - void setColorVector(Qwt3D::ColorVector const& cv); - void reset(unsigned size=100); //!< Resets the standard colors; - void setAlpha(double a); //!< Sets unitary alpha value for all colors - /** - \brief Creates color vector - - Creates a color vector used by ColorLegend. This is essentially a copy from the internal used vector. - \return The vector created - */ - Qwt3D::ColorVector& createVector(Qwt3D::ColorVector& vec) {vec = colors_; return vec;} - -protected: - Qwt3D::ColorVector colors_; - Qwt3D::Plot3D* data_; -}; - -} // ns - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_colorlegend.h' --- 3rdparty/qwtplot3d/include/qwt3d_colorlegend.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_colorlegend.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,80 @@ +#ifndef __PLANE_H__ +#define __PLANE_H__ + +#include "qwt3d_global.h" +#include "qwt3d_drawable.h" +#include "qwt3d_axis.h" +#include "qwt3d_color.h" + +namespace Qwt3D +{ + +//! A flat color legend +/** + The class visualizes a ColorVector together with a scale (axis) and a caption. ColorLegends are vertical + or horizontal +*/ +class QWT3D_EXPORT ColorLegend : public Drawable +{ + +public: + + //! Possible anchor points for caption and axis + enum SCALEPOSITION + { + Top, //!< scale on top + Bottom, //!< scale on bottom + Left, //!< scale left + Right //!< scale right + }; + + //! Orientation of the legend + enum ORIENTATION + { + BottomTop, //!< Positionate the legend vertically, the lowest color index is on the bottom + LeftRight //!< Positionate the legend horizontally, the lowest color index is on left side + }; + + ColorLegend(); //!< Standard constructor + + Qwt3D::Axis *axis(){return &axis_;};//! < Returns a pointer to the axis object. + bool isAxisEnabled(){return showaxis_;}; //! Returns true if the legend scale is displayed. + void draw(); //!< Draws the object. You should not use this explicitly - the function is called by updateGL(). + + void setRelPosition(Qwt3D::Tuple relMin, Qwt3D::Tuple relMax); //!< Sets the relative position of the legend inside widget + void setOrientation(ORIENTATION, SCALEPOSITION); //!< Sets legend orientation and scale position + void setLimits(double start, double stop); //!< Sets the limit of the scale. + void setMajors(int); //!< Sets scale major tics. + void setMinors(int); //!< Sets scale minor tics. + void drawScale(bool val) { showaxis_ = val; } //!< Sets whether a scale will be drawn. + void drawNumbers(bool val) { axis_.setNumbers(val); } //!< Sets whether the scale will have scale numbers. + void setAutoScale(bool val); //!< Sets, whether the axis is autoscaled or not. + void setScale(Qwt3D::Scale *scale); //!< Sets another scale + void setScale(Qwt3D::SCALETYPE); //!< Sets one of the predefined scale types + + void setTitleString(QString const& s); //!< Sets the legends caption string. + + //! Sets the legends caption font. + void setTitleFont(QString const& family, int pointSize, int weight = QFont::Normal, bool italic = false); + + Qwt3D::ColorVector colors; //!< The color vector + virtual void setPlot(Plot3D *plot); + + private: + + Qwt3D::Label caption_; + Qwt3D::ParallelEpiped geometry() const { return pe_;} + void setGeometryInternal(); + + Qwt3D::ParallelEpiped pe_; + Qwt3D::Tuple relMin_, relMax_; + Qwt3D::Axis axis_; + SCALEPOSITION axisposition_; + ORIENTATION orientation_; + + bool showaxis_; +}; + +} // ns + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_colorlegend.h' --- 3rdparty/qwtplot3d/include/qwt3d_colorlegend.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_colorlegend.h 1970-01-01 00:00:00 +0000 @@ -1,80 +0,0 @@ -#ifndef __PLANE_H__ -#define __PLANE_H__ - -#include "qwt3d_global.h" -#include "qwt3d_drawable.h" -#include "qwt3d_axis.h" -#include "qwt3d_color.h" - -namespace Qwt3D -{ - -//! A flat color legend -/** - The class visualizes a ColorVector together with a scale (axis) and a caption. ColorLegends are vertical - or horizontal -*/ -class QWT3D_EXPORT ColorLegend : public Drawable -{ - -public: - - //! Possible anchor points for caption and axis - enum SCALEPOSITION - { - Top, //!< scale on top - Bottom, //!< scale on bottom - Left, //!< scale left - Right //!< scale right - }; - - //! Orientation of the legend - enum ORIENTATION - { - BottomTop, //!< Positionate the legend vertically, the lowest color index is on the bottom - LeftRight //!< Positionate the legend horizontally, the lowest color index is on left side - }; - - ColorLegend(); //!< Standard constructor - - //! return a pointer to the axis object. - Qwt3D::Axis *axis(){return &axis_;}; - void draw(); //!< Draws the object. You should not use this explicitely - the function is called by updateGL(). - - void setRelPosition(Qwt3D::Tuple relMin, Qwt3D::Tuple relMax); //!< Sets the relative position of the legend inside widget - void setOrientation(ORIENTATION, SCALEPOSITION); //!< Sets legend orientation and scale position - void setLimits(double start, double stop); //!< Sets the limit of the scale. - void setMajors(int); //!< Sets scale major tics. - void setMinors(int); //!< Sets scale minor tics. - void drawScale(bool val) { showaxis_ = val; } //!< Sets whether a scale will be drawn. - void drawNumbers(bool val) { axis_.setNumbers(val); } //!< Sets whether the scale will have scale numbers. - void setAutoScale(bool val); //!< Sets, whether the axis is autoscaled or not. - void setScale(Qwt3D::Scale *scale); //!< Sets another scale - void setScale(Qwt3D::SCALETYPE); //!< Sets one of the predefined scale types - - void setTitleString(QString const& s); //!< Sets the legends caption string. - - //! Sets the legends caption font. - void setTitleFont(QString const& family, int pointSize, int weight = QFont::Normal, bool italic = false); - - Qwt3D::ColorVector colors; //!< The color vector - virtual void setPlot(Plot3D *plot); - -private: - - Qwt3D::Label caption_; - Qwt3D::ParallelEpiped geometry() const { return pe_;} - void setGeometryInternal(); - - Qwt3D::ParallelEpiped pe_; - Qwt3D::Tuple relMin_, relMax_; - Qwt3D::Axis axis_; - SCALEPOSITION axisposition_; - ORIENTATION orientation_; - - bool showaxis_; -}; - -} // ns - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_coordsys.h' --- 3rdparty/qwtplot3d/include/qwt3d_coordsys.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_coordsys.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,128 @@ +#ifndef __COORDSYS_H__ +#define __COORDSYS_H__ + +#include "qwt3d_axis.h" +#include "qwt3d_colorlegend.h" + +namespace Qwt3D +{ + enum LINESTYLE {SOLID, DASH, DOT, DASHDOT, DASHDOTDOT, SHORTDASH, SHORTDOT, SHORTDASHDOT}; + + struct GridLine + { + bool visible_; + RGBA color_; + LINESTYLE style_; + double width_; + + GridLine(bool visible = false, RGBA color = RGBA(), LINESTYLE style = SOLID, double width = 1.0) + : visible_(visible) + , color_(color) + , style_(style) + , width_(width) + {} + }; + +//! A coordinate system with different styles (BOX, FRAME) +class QWT3D_EXPORT CoordinateSystem : public Drawable +{ + +public: + explicit CoordinateSystem(Qwt3D::Triple blb = Qwt3D::Triple(0,0,0), Qwt3D::Triple ftr = Qwt3D::Triple(0,0,0), Qwt3D::COORDSTYLE = Qwt3D::BOX); + ~CoordinateSystem(); + + void init(Qwt3D::Triple beg = Qwt3D::Triple(0,0,0), Qwt3D::Triple end = Qwt3D::Triple(0,0,0)); + //! Set style for the coordinate system (NOCOORD, FRAME or BOX) + void setStyle(Qwt3D::COORDSTYLE s, Qwt3D::AXIS frame_1 = Qwt3D::X1, + Qwt3D::AXIS frame_2 = Qwt3D::Y1, + Qwt3D::AXIS frame_3 = Qwt3D::Z1); + Qwt3D::COORDSTYLE style() const { return style_;} //!< Return style oft the coordinate system + void setPosition(Qwt3D::Triple first, Qwt3D::Triple second); //!< first == front_left_bottom, second == back_right_top + + void setAxesColor(Qwt3D::RGBA val); //!< Set common color for all axes + //! Set common font for all axis numberings + void setNumberFont(QString const& family, int pointSize, int weight = QFont::Normal, bool italic = false); + //! Set common font for all axis numberings + void setNumberFont(QFont const& font); + //! Set common color for all axis numberings + void setNumberColor(Qwt3D::RGBA val); + void setStandardScale(); //!< Sets an linear axis with real number items + + void adjustNumbers(int val); //!< Fine tunes distance between axis numbering and axis body + void adjustLabels(int val); //!< Fine tunes distance between axis label and axis body + + //! Sets color for the grid lines + void setGridLinesColor(Qwt3D::RGBA val){gridlinecolor_ = val;} + + QMap majorGridLines(){return gridmajors_;}; + void setMajorGridLines(Qwt3D::AXIS axis, Qwt3D::GridLine val) {gridmajors_[axis] = val;} + + QMap minorGridLines(){return gridminors_;}; + void setMinorGridLines(Qwt3D::AXIS axis, Qwt3D::GridLine val) {gridminors_[axis] = val;} + + Qwt3D::GridLine majorGridLine(Qwt3D::AXIS axis) {return gridmajors_[axis];}; + Qwt3D::GridLine minorGridLine(Qwt3D::AXIS axis) {return gridminors_[axis];}; + + //! Set common font for all axis labels + void setLabelFont(QString const& family, int pointSize, int weight = QFont::Normal, bool italic = false); + //! Set common font for all axis labels + void setLabelFont(QFont const& font); + //! Set common color for all axis labels + void setLabelColor(Qwt3D::RGBA val); + + //! Set line width for tic marks and axes + void setLineWidth(double val, double majfac = 0.9, double minfac = 0.5); + //! Set length for tic marks + void setTicLength(double major, double minor); + + //! Switch autoscaling of axes + void setAutoScale(bool val = true); + + Qwt3D::Triple first() const { return first_;} + Qwt3D::Triple second() const { return second_;} + + void setAutoDecoration(bool val = true) {autodecoration_ = val;} + bool autoDecoration() const { return autodecoration_;} + + void setLineSmooth(bool val = true) {smooth_ = val;} //!< draw smooth axes + bool lineSmooth() const {return smooth_;} //!< smooth axes ? + + void draw(); + + //! Defines whether a grid between the major and/or minor tics should be drawn + void setGridLines(bool majors, bool minors, int sides = Qwt3D::NOSIDEGRID); + int grids() const {return sides_;} //!< Returns grids switched on + + //! The vector of all12 axes - use them to set axis properties individually. + std::vector axes; + + +private: + void destroy(); + + Qwt3D::Triple first_, second_; + Qwt3D::COORDSTYLE style_; + + Qwt3D::RGBA gridlinecolor_; + + QMap gridmajors_; + QMap gridminors_; + + bool smooth_; + + void chooseAxes(); + void autoDecorateExposedAxis(Axis& ax, bool left); + void drawMajorGridLines(); //!< Draws a grid between the major tics on the site + void drawMinorGridLines(); //!< Draws a grid between the minor tics on the site + void drawMajorGridLines(Qwt3D::Axis&, Qwt3D::Axis&); //! Helper + void drawMinorGridLines(Qwt3D::Axis&, Qwt3D::Axis&); //! Helper + void recalculateAxesTics(); + + bool autodecoration_; + bool majorgridlines_, minorgridlines_; + int sides_; +}; + +} // ns + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_coordsys.h' --- 3rdparty/qwtplot3d/include/qwt3d_coordsys.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_coordsys.h 1970-01-01 00:00:00 +0000 @@ -1,125 +0,0 @@ -#ifndef __COORDSYS_H__ -#define __COORDSYS_H__ - -#include "qwt3d_axis.h" -#include "qwt3d_colorlegend.h" - -namespace Qwt3D -{ - enum LINESTYLE {SOLID, DASH, DOT, DASHDOT, DASHDOTDOT, SHORTDASH, SHORTDOT, SHORTDASHDOT}; - - struct GridLine - { - bool visible_; - RGBA color_; - LINESTYLE style_; - double width_; - - GridLine(bool visible = false, RGBA color = RGBA(), LINESTYLE style = SOLID, double width = 1.0) - : visible_(visible) - , color_(color) - , style_(style) - , width_(width) - {} - }; - -//! A coordinate system with different styles (BOX, FRAME) -class QWT3D_EXPORT CoordinateSystem : public Drawable -{ - -public: - explicit CoordinateSystem(Qwt3D::Triple blb = Qwt3D::Triple(0,0,0), Qwt3D::Triple ftr = Qwt3D::Triple(0,0,0), Qwt3D::COORDSTYLE = Qwt3D::BOX); - ~CoordinateSystem(); - - void init(Qwt3D::Triple beg = Qwt3D::Triple(0,0,0), Qwt3D::Triple end = Qwt3D::Triple(0,0,0)); - //! Set style for the coordinate system (NOCOORD, FRAME or BOX) - void setStyle(Qwt3D::COORDSTYLE s, Qwt3D::AXIS frame_1 = Qwt3D::X1, - Qwt3D::AXIS frame_2 = Qwt3D::Y1, - Qwt3D::AXIS frame_3 = Qwt3D::Z1); - Qwt3D::COORDSTYLE style() const { return style_;} //!< Return style oft the coordinate system - void setPosition(Qwt3D::Triple first, Qwt3D::Triple second); //!< first == front_left_bottom, second == back_right_top - - void setAxesColor(Qwt3D::RGBA val); //!< Set common color for all axes - //! Set common font for all axis numberings - void setNumberFont(QString const& family, int pointSize, int weight = QFont::Normal, bool italic = false); - //! Set common font for all axis numberings - void setNumberFont(QFont const& font); - //! Set common color for all axis numberings - void setNumberColor(Qwt3D::RGBA val); - void setStandardScale(); //!< Sets an linear axis with real number items - - void adjustNumbers(int val); //!< Fine tunes distance between axis numbering and axis body - void adjustLabels(int val); //!< Fine tunes distance between axis label and axis body - - //! Sets color for the grid lines - void setGridLinesColor(Qwt3D::RGBA val){gridlinecolor_ = val;}; - - Qwt3D::GridLine majorGridLine(Qwt3D::AXIS axis) {return gridmajors_[axis];}; - Qwt3D::GridLine minorGridLine(Qwt3D::AXIS axis) {return gridminors_[axis];}; - - void setMajorGridLines(Qwt3D::AXIS axis, Qwt3D::GridLine val) {gridmajors_[axis] = val;}; - void setMinorGridLines(Qwt3D::AXIS axis, Qwt3D::GridLine val) {gridminors_[axis] = val;}; - - //! Set common font for all axis labels - void setLabelFont(QString const& family, int pointSize, int weight = QFont::Normal, bool italic = false); - //! Set common font for all axis labels - void setLabelFont(QFont const& font); - //! Set common color for all axis labels - void setLabelColor(Qwt3D::RGBA val); - - //! Set line width for tic marks and axes - void setLineWidth(double val, double majfac = 0.9, double minfac = 0.5); - //! Set length for tic marks - void setTicLength(double major, double minor); - - //! Switch autoscaling of axes - void setAutoScale(bool val = true); - - Qwt3D::Triple first() const { return first_;} - Qwt3D::Triple second() const { return second_;} - - void setAutoDecoration(bool val = true) {autodecoration_ = val;} - bool autoDecoration() const { return autodecoration_;} - - void setLineSmooth(bool val = true) {smooth_ = val;} //!< draw smooth axes - bool lineSmooth() const {return smooth_;} //!< smooth axes ? - - void draw(); - - //! Defines whether a grid between the major and/or minor tics should be drawn - void setGridLines(bool majors, bool minors, int sides = Qwt3D::NOSIDEGRID); - int grids() const {return sides_;} //!< Returns grids switched on - - //! The vector of all12 axes - use them to set axis properties individually. - std::vector axes; - - -private: - void destroy(); - - Qwt3D::Triple first_, second_; - Qwt3D::COORDSTYLE style_; - - Qwt3D::RGBA gridlinecolor_; - - QMap gridmajors_; - QMap gridminors_; - - bool smooth_; - - void chooseAxes(); - void autoDecorateExposedAxis(Axis& ax, bool left); - void drawMajorGridLines(); //!< Draws a grid between the major tics on the site - void drawMinorGridLines(); //!< Draws a grid between the minor tics on the site - void drawMajorGridLines(Qwt3D::Axis&, Qwt3D::Axis&); //! Helper - void drawMinorGridLines(Qwt3D::Axis&, Qwt3D::Axis&); //! Helper - void recalculateAxesTics(); - - bool autodecoration_; - bool majorgridlines_, minorgridlines_; - int sides_; -}; - -} // ns - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_curve.h' --- 3rdparty/qwtplot3d/include/qwt3d_curve.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_curve.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,258 @@ +#ifndef __CURVE_H__ +#define __CURVE_H__ + +#include +#include +#include + +#include "qwt3d_plot.h" + +// Shorthand definitions +#define TITLE "QwtPlot3D (Use Ctrl-Alt-Shift-LeftBtn-Wheel or keyboard)" + +namespace Qwt3D +{ + +//! A class representing Curved Surfaces +/** + A Curved Surface ... + +*/ +class QWT3D_EXPORT Curve : public QObject +{ + Q_OBJECT + +public: + Curve(QWidget* parent = 0); + virtual ~Curve(); + + void setPlot(Qwt3D::Plot3D* p) { plot_p = p; } + Qwt3D::Plot3D* plot() const { return plot_p; } //!< Returns pointer to parent Plot3D object + Qwt3D::Label* title() const { return title_p; } //!< Returns pointer to title Label object + Qwt3D::ColorLegend* legend() { return &legend_; } //!< Returns pointer to key ColorLegend object + virtual void draw(); + + void connects(); + void disconnects(); + void updateNormals(); //!< Recalculates surface normals; + + std::pair facets() const; //!< Returns the number of mesh cells for the ORIGINAL data + bool loadFromData(Qwt3D::Triple** data, unsigned int columns, unsigned int rows, QString titlestr = QString(), + bool uperiodic = false, bool vperiodic = false); + bool loadFromData(double** data, unsigned int columns, unsigned int rows, + double minx, double maxx, double miny, double maxy, QString titlestr = QString()); + bool loadFromData(Qwt3D::TripleField const& data, Qwt3D::CellField const& poly, QString titlestr = QString()); + + Qwt3D::FLOORSTYLE floorStyle() const { return floorstyle_; } //!< Returns floor style + Qwt3D::Enrichment* userStyle() const { return userplotstyle_p; } //!< Returns current Enrichment object used for plotting styles (if set, zero else) + Qwt3D::PLOTSTYLE plotStyle() const { return plotstyle_; } //!< Returns plotting style + Qwt3D::SHADINGSTYLE shading() const { return shading_; } //!< Returns shading style + unsigned int resolution() const { return resolution_p; } //!< Returns data resolution (1 means all data) + unsigned int isolines() const { return isolines_; } //!< Returns number of isolines + bool smoothDataMesh() const { return smoothdatamesh_p; }//!< True if mesh antialiasing is on + Qwt3D::RGBA meshColor() const { return meshcolor_; } //!< Returns color for data mesh + double meshLineWidth() const { return meshLineWidth_; } //!< Returns line width for data mesh + const Qwt3D::Color* dataColor() const { return datacolor_p; } //!< Returns data color object + double polygonOffset() const { return polygonOffset_; } //!< Returns relative value for polygon offset [0..1] + + bool normals() const { return datanormals_p; } //!< Returns \c true, if normal drawing is on + double normalLength() const { return normalLength_p; } //!< Returns relative length of normals + int normalQuality() const { return normalQuality_p; } //!< Returns plotting quality of normal arrows + + Qwt3D::ParallelEpiped hull() const { return hull_; } //!< Returns rectangular hull + const Qwt3D::Data* data() const { return actualData_p; } //!< the data pointer + bool hasData() const { return (actualData_p) ? !actualData_p->empty() : false; } //!< Returns true if valid data available, false else + bool dataProjected() const { return datapoints_; } //!< Returns projected state of data points + + QList enrichmentList(){return elist_p;}; //!< Returns the Enrichments list + virtual Qwt3D::Enrichment* addEnrichment(Qwt3D::Enrichment const&); //!< Add an Enrichment + virtual bool degrade(Qwt3D::Enrichment*); //!< Remove an Enrichment + + bool isColorLegend() const { return displaylegend_; } //!< Returns Color Legend display state + void setColorLegend(int index, bool doublemode = false, QSize size = QSize(3, 32), QPoint pos = QPoint(3, 10)); + + void clearEnrichments();//!< Remove all Enrichments + + double** getData(int *cols, int *rows); + Qwt3D::CellField* getCellData(int *cells); + Qwt3D::TripleField* getNodeData(int *nodes); + + void deleteData(double**data, int columns); + void deleteData(CellField* poly); + void deleteData(TripleField* data); + + void queueUpdate(); + + // Public data members + Qwt3D::Tuple titlerel_; + Qwt3D::ANCHOR titleanchor_; + double titlespace_; + unsigned int titlepos_; + +signals: + void resolutionChanged(int); + void updatePlotData(bool); + void updatePlot(); + void readInFinished(const QString&); + +public slots: + void setResolution(int); + void setPlotStyle(Qwt3D::PLOTSTYLE val); + void setPlotStyle(Qwt3D::Enrichment& val); + void setPolygonOffset(double d); + void setFloorStyle(Qwt3D::FLOORSTYLE val) { floorstyle_ = val; update_displaylists_ = true;} //!< Sets floor style + void setShading(Qwt3D::SHADINGSTYLE val); + void setIsolines(unsigned int isolines); + + void updateColorLegend(int majors, int minors); //!< Updates the curve data color legend + void showColorLegend(bool); //!< Show curve data color legend + void showNormals(bool); //!< Draw normals to every vertex + void setNormalLength(double val); //!< Sets length of normals in percent per hull diagonale + void setNormalQuality(int val); //!< Increases plotting quality of normal arrows + + void setSmoothMesh(bool val) { smoothdatamesh_p = val; update_displaylists_ = true;} //!< Enables/disables smooth data mesh lines. Default is false + void setMeshColor(Qwt3D::RGBA rgba); //!< Sets color for data mesh + void setMeshLineWidth(double lw); //!< Sets line width for data mesh + + void setDataColor(Color* col); //!< Sets new data color object + void setDataProjection(bool toggle = true) { datapoints_ = toggle; } //!< Sets data point projection on & off + void setProjection(Qwt3D::PROJECTMODE val, bool toggle = true); //!< Sets projection modes + + void setTitleColor(Qwt3D::RGBA col) { title_p->setColor(col); } //!< Set caption color + void setTitle(const QString& title) { //!< Set caption text (one row only) + if (title.isEmpty() || ((title == TITLE) && (plot_p->titleList().size() > 1))) + plot_p->removeTitle(title_p); + title_p->setString(title); // allows title to be reset & removed + } + + void setTitlePosition(double rely, double relx = 0.5, Qwt3D::ANCHOR anchor = Qwt3D::TopCenter); + void setTitleFont(const QString& family, int pointSize, int weight = QFont::Normal, bool italic = false); + + void createData(); + void createEnrichments(); + +protected: + typedef QList EnrichmentList; + typedef EnrichmentList::iterator ELIT; + + Qwt3D::Plot3D* plot_p; + Qwt3D::Label* title_p; + Qwt3D::Data* actualData_p; + + bool update_displaylists_; + Qwt3D::Color* datacolor_p; + Qwt3D::Enrichment* userplotstyle_p; + EnrichmentList elist_p; + + Qwt3D::RGBA meshcolor_; + double meshLineWidth_; + Qwt3D::RGBA bgcolor_; + Qwt3D::PLOTSTYLE plotstyle_; + Qwt3D::SHADINGSTYLE shading_; + Qwt3D::FLOORSTYLE floorstyle_; + double polygonOffset_; + + unsigned int isolines_; + unsigned int point_size_; + + bool datapoints_; + bool facemode_; + bool sidemode_; + bool floormode_; + bool smoothdatamesh_p; + bool datanormals_p; + double normalLength_p; + int normalQuality_p; + int resolution_p; + + void updateData(bool coord = true); + virtual void drawImplementation(); + + void setHull(Qwt3D::ParallelEpiped p) {hull_ = p;} + virtual void calculateHull(); + + virtual void createEnrichment(Qwt3D::Enrichment& p); + virtual void createFloorData(); + virtual void createSideData(); + virtual void createFaceData(); + void createNormals(); + void createPoints(); + + void drawVertex(Qwt3D::Triple& vertex, double shift, unsigned int comp = 3); + virtual void drawIntersections(std::vector& intersection, double shift, unsigned int comp, + bool projected, std::vector* colour = 0); + + void readIn(Qwt3D::GridData& gdata, Qwt3D::Triple** data, unsigned int columns, unsigned int rows); + void readIn(Qwt3D::GridData& gdata, double** data, unsigned int columns, unsigned int rows, + double minx, double maxx, double miny, double maxy); + void calcNormals(Qwt3D::GridData& gdata); + void sewPeriodic(Qwt3D::GridData& gdata); + + void animateData(double** data); + void animateData(Qwt3D::TripleField* data, Qwt3D::CellField* poly); + void animateData(Qwt3D::TripleField* data); + +private: + enum OBJECTS { + DataObject=0, + NormalObject, + DisplayListSize // only to have a vector length ... + }; + QVector displaylists_p; + + void Data2Floor(); + void Isolines2Floor(); + + Qwt3D::ParallelEpiped hull_; + + // grid plot + Qwt3D::GridData* actualDataG_; + virtual void createDataG(); + virtual void createFaceDataG(); + virtual void createSideDataG(); + virtual void createFloorDataG(); + void createNormalsG(); + + void Data2FloorG() { DatamapG(2); } + void Data2FrontG() { DatamapG(1); } + void Data2SideG() { DatamapG(0); } + void DatamapG(unsigned int comp); + + void Isolines2FloorG(bool projected = false) { IsolinesG(2, projected); } + void Isolines2FrontG(bool projected = false) { IsolinesG(1, projected); } + void Isolines2SideG(bool projected = false) { IsolinesG(0, projected); } + void IsolinesG(unsigned int comp, bool projected); + + void setColorFromVertexG(int ix, int iy, bool skip = false); + + void DataPointsG(unsigned int comp, bool projected); + void DataPoints2SideG(bool projected = false) { DataPointsG(0, projected); } + void DataPoints2BackG(bool projected = false) { DataPointsG(1, projected); } + + // mesh plot + Qwt3D::CellData* actualDataC_; + virtual void createDataC(); + virtual void createFaceDataC(); + virtual void createSideDataC(); + virtual void createFloorDataC(); + void createNormalsC(); + + void Data2FloorC() { DatamapC(2); } + void Data2FrontC() { DatamapC(1); } + void Data2SideC() { DatamapC(0); } + void DatamapC(unsigned int comp); + + void Isolines2FloorC(bool projected = false) { IsolinesC(2, projected); } + void Isolines2FrontC(bool projected = false) { IsolinesC(1, projected); } + void Isolines2SideC(bool projected = false) { IsolinesC(0, projected); } + void IsolinesC(unsigned int comp, bool projected); + + void setColorFromVertexC(int node, bool skip = false); + + bool displaylegend_; + Qwt3D::ColorLegend legend_; +}; + +} + +#endif === added file '3rdparty/qwtplot3d/include/qwt3d_drawable.h' --- 3rdparty/qwtplot3d/include/qwt3d_drawable.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_drawable.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,66 @@ +#ifndef __DRAWABLE_H__ +#define __DRAWABLE_H__ + + +#include +#include "qwt3d_global.h" +#include "qwt3d_types.h" +#include "qwt3d_io_gl2ps.h" + +namespace Qwt3D +{ + +//! ABC for Drawables +class QWT3D_EXPORT Drawable +{ + +public: + Drawable(Plot3D *plot = 0){d_plot = plot;}; + virtual ~Drawable() = 0; + virtual void draw(); + + virtual void saveGLState(); + virtual void restoreGLState(); + + void attach(Drawable*); + void detach(Drawable*); + void detachAll(); + + virtual void setColor(double r, double g, double b, double a = 1); + virtual void setColor(Qwt3D::RGBA rgba); + Qwt3D::Triple relativePosition(Qwt3D::Triple rel); + + Plot3D *plot(){return d_plot;}; + virtual void setPlot(Plot3D *plot){d_plot = plot;}; + +protected: + Plot3D *d_plot; + Qwt3D::RGBA color; + void Enable(GLenum what, GLboolean val); + Qwt3D::Triple ViewPort2World(Qwt3D::Triple win, bool* err = 0); + Qwt3D::Triple World2ViewPort(Qwt3D::Triple obj, bool* err = 0); + + GLdouble modelMatrix[16]; + GLdouble projMatrix[16]; + GLint viewport[4]; + +private: + GLboolean ls; + GLboolean pols; + GLint polmode[2]; + GLfloat lw; + GLint blsrc, bldst; + GLdouble col[4]; + GLint pattern, factor; + GLboolean sallowed; + GLboolean tex2d; + GLint matrixmode; + GLfloat poloffs[2]; + GLboolean poloffsfill; + + std::list dlist; +}; + +} // ns + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_drawable.h' --- 3rdparty/qwtplot3d/include/qwt3d_drawable.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_drawable.h 1970-01-01 00:00:00 +0000 @@ -1,70 +0,0 @@ -#ifndef __DRAWABLE_H__ -#define __DRAWABLE_H__ - - -#include -#include "qwt3d_global.h" -#include "qwt3d_types.h" -#include "qwt3d_io_gl2ps.h" -//#include "qwt3d_plot.h" - -namespace Qwt3D -{ - -//! ABC for Drawables -class QWT3D_EXPORT Drawable -{ - -public: - Drawable(Plot3D *plot = 0){d_plot = plot;}; - virtual ~Drawable() = 0; - - virtual void draw(); - - virtual void saveGLState(); - virtual void restoreGLState(); - - void attach(Drawable*); - void detach(Drawable*); - void detachAll(); - - virtual void setColor(double r, double g, double b, double a = 1); - virtual void setColor(Qwt3D::RGBA rgba); - Qwt3D::Triple relativePosition(Qwt3D::Triple rel); - - Plot3D *plot(){return d_plot;}; - virtual void setPlot(Plot3D *plot){d_plot = plot;}; - -protected: - - Plot3D *d_plot; - Qwt3D::RGBA color; - void Enable(GLenum what, GLboolean val); - Qwt3D::Triple ViewPort2World(Qwt3D::Triple win, bool* err = 0); - Qwt3D::Triple World2ViewPort(Qwt3D::Triple obj, bool* err = 0); - - GLdouble modelMatrix[16]; - GLdouble projMatrix[16]; - GLint viewport[4]; - -private: - - GLboolean ls; - GLboolean pols; - GLint polmode[2]; - GLfloat lw; - GLint blsrc, bldst; - GLdouble col[4]; - GLint pattern, factor; - GLboolean sallowed; - GLboolean tex2d; - GLint matrixmode; - GLfloat poloffs[2]; - GLboolean poloffsfill; - - std::list dlist; -}; - -} // ns - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_enrichment.h' --- 3rdparty/qwtplot3d/include/qwt3d_enrichment.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_enrichment.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,62 @@ +#ifndef qwt3d_enrichment_h__2004_02_23_19_24_begin_guarded_code +#define qwt3d_enrichment_h__2004_02_23_19_24_begin_guarded_code + +#include "qwt3d_global.h" +#include "qwt3d_types.h" + +namespace Qwt3D +{ + +class Curve; + + +//! Abstract base class for data dependent visible user objects +/** +Enrichments provide a framework for user defined OPenGL objects. The base class has a pure virtuell +function clone(). 2 additional functions are per default empty and could also get a new implementation +in derived classes. They can be used for initialization issues or actions not depending on the related +primitive. +*/ +class QWT3D_EXPORT Enrichment +{ +public: + enum TYPE{ + VERTEXENRICHMENT, + EDGEENRICHMENT, + FACEENRICHMENT, + VOXELENRICHMENT + }; //!< Type of the Enrichment - only VERTEXENRICHMENT's are defined at this moment. + + Enrichment() : plot(0) {} + virtual ~Enrichment(){} + virtual Enrichment* clone() const = 0; //!< The derived class should give back a new Derived(something) here + virtual void drawBegin(){}; //!< Empty per default. Can be overwritten. + virtual void drawEnd(){}; //!< Empty per default. Can be overwritten. + virtual void assign(Curve const& pl) {plot = &pl;} //!< Assign to existent plot; + virtual TYPE type() const = 0; //!< Overwrite + +protected: + const Curve* plot; +}; + +//! Abstract base class for vertex dependent visible user objects +/** +VertexEnrichments introduce a specialized draw routine for vertex dependent data. +draw() is called, when the Plot realizes its internal OpenGL data representation +for every Vertex associated to his argument. +*/ +class QWT3D_EXPORT VertexEnrichment : public Enrichment +{ +public: + + VertexEnrichment() : Qwt3D::Enrichment() {} + virtual Enrichment* clone() const = 0; //!< The derived class should give back a new Derived(something) here + virtual void draw(Qwt3D::Triple const&) = 0; //!< Overwrite this + virtual TYPE type() const {return Qwt3D::Enrichment::VERTEXENRICHMENT;} //!< This gives VERTEXENRICHMENT +}; + +// todo EdgeEnrichment, FaceEnrichment, VoxelEnrichment etc. + +} // ns + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_enrichment.h' --- 3rdparty/qwtplot3d/include/qwt3d_enrichment.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_enrichment.h 1970-01-01 00:00:00 +0000 @@ -1,62 +0,0 @@ -#ifndef qwt3d_enrichment_h__2004_02_23_19_24_begin_guarded_code -#define qwt3d_enrichment_h__2004_02_23_19_24_begin_guarded_code - -#include "qwt3d_global.h" -#include "qwt3d_types.h" - -namespace Qwt3D -{ - -class Plot3D; - - -//! Abstract base class for data dependent visible user objects -/** -Enrichments provide a framework for user defined OPenGL objects. The base class has a pure virtuell -function clone(). 2 additional functions are per default empty and could also get a new implementation -in derived classes. They can be used for initialization issues or actions not depending on the related -primitive. -*/ -class QWT3D_EXPORT Enrichment -{ -public: - enum TYPE{ - VERTEXENRICHMENT, - EDGEENRICHMENT, - FACEENRICHMENT, - VOXELENRICHMENT - }; //!< Type of the Enrichment - only VERTEXENRICHMENT's are defined at this moment. - - Enrichment() : plot(0) {} - virtual ~Enrichment(){} - virtual Enrichment* clone() const = 0; //!< The derived class should give back a new Derived(something) here - virtual void drawBegin(){}; //!< Empty per default. Can be overwritten. - virtual void drawEnd(){}; //!< Empty per default. Can be overwritten. - virtual void assign(Plot3D const& pl) {plot = &pl;} //!< Assign to existent plot; - virtual TYPE type() const = 0; //!< Overwrite - -protected: - const Plot3D* plot; -}; - -//! Abstract base class for vertex dependent visible user objects -/** -VertexEnrichments introduce a specialized draw routine for vertex dependent data. -draw() is called, when the Plot realizes its internal OpenGL data representation -for every Vertex associated to his argument. -*/ -class QWT3D_EXPORT VertexEnrichment : public Enrichment -{ -public: - - VertexEnrichment() : Qwt3D::Enrichment() {} - virtual Enrichment* clone() const = 0; //!< The derived class should give back a new Derived(something) here - virtual void draw(Qwt3D::Triple const&) = 0; //!< Overwrite this - virtual TYPE type() const {return Qwt3D::Enrichment::VERTEXENRICHMENT;} //!< This gives VERTEXENRICHMENT -}; - -// todo EdgeEnrichment, FaceEnrichment, VoxelEnrichment etc. - -} // ns - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_enrichment_std.h' --- 3rdparty/qwtplot3d/include/qwt3d_enrichment_std.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_enrichment_std.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,116 @@ +#ifndef qwt3d_enrichment_std_h__2004_02_23_19_25_begin_guarded_code +#define qwt3d_enrichment_std_h__2004_02_23_19_25_begin_guarded_code + +#include "qwt3d_enrichment.h" + +namespace Qwt3D +{ + +class Curve; + +//! The Cross Hair Style +class QWT3D_EXPORT CrossHair : public VertexEnrichment +{ +public: + CrossHair(); + CrossHair(double rad, double linewidth, bool smooth, bool boxed); + + Qwt3D::Enrichment* clone() const {return new CrossHair(*this);} + + void configure(double rad, double linewidth, bool smooth, bool boxed); + void drawBegin(); + void drawEnd(); + void draw(Qwt3D::Triple const&); + +private: + bool boxed_, smooth_; + double linewidth_, radius_; + GLboolean oldstate_; +}; + +//! The Point Style +class QWT3D_EXPORT Dot : public VertexEnrichment +{ +public: + Dot(); + Dot(double pointsize, bool smooth); + + Qwt3D::Enrichment* clone() const {return new Dot(*this);} + + void configure(double pointsize, bool smooth); + void drawBegin(); + void drawEnd(); + void draw(Qwt3D::Triple const&); + +private: + bool smooth_; + double pointsize_; + GLboolean oldstate_; +}; + +//! The Cone Style +class QWT3D_EXPORT Cone : public VertexEnrichment +{ +public: + Cone(); + Cone(double rad, unsigned quality); + ~Cone(); + + Qwt3D::Enrichment* clone() const {return new Cone(*this);} + + void configure(double rad, unsigned quality); + void draw(Qwt3D::Triple const&); + +private: + GLUquadricObj *hat; + GLUquadricObj *disk; + unsigned quality_; + double radius_; + GLboolean oldstate_; +}; + +//! 3D vector field. +/** + The class encapsulates a vector field including his OpenGL representation as arrow field. + The arrows can be configured in different aspects (color, shape, painting quality). + +*/ +class QWT3D_EXPORT Arrow : public VertexEnrichment +{ +public: + + Arrow(); + ~Arrow(); + + Qwt3D::Enrichment* clone() const {return new Arrow(*this);} + + void configure(int segs, double relconelength, double relconerad, double relstemrad); + void setQuality(int val) {segments_ = val;} //!< Set the number of faces for the arrow + void draw(Qwt3D::Triple const&); + + void setTop(Qwt3D::Triple t){top_ = t;} + void setColor(Qwt3D::RGBA rgba) {rgba_ = rgba;} + +private: + + GLUquadricObj *hat; + GLUquadricObj *disk; + GLUquadricObj *base; + GLUquadricObj *bottom; + GLboolean oldstate_; + + double calcRotation(Qwt3D::Triple& axis, Qwt3D::FreeVector const& vec); + + int segments_; + double rel_cone_length; + + double rel_cone_radius; + double rel_stem_radius; + + Qwt3D::Triple top_; + Qwt3D::RGBA rgba_; +}; + +} // ns + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_enrichment_std.h' --- 3rdparty/qwtplot3d/include/qwt3d_enrichment_std.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_enrichment_std.h 1970-01-01 00:00:00 +0000 @@ -1,116 +0,0 @@ -#ifndef qwt3d_enrichment_std_h__2004_02_23_19_25_begin_guarded_code -#define qwt3d_enrichment_std_h__2004_02_23_19_25_begin_guarded_code - -#include "qwt3d_enrichment.h" - -namespace Qwt3D -{ - -class Plot3D; - -//! The Cross Hair Style -class QWT3D_EXPORT CrossHair : public VertexEnrichment -{ -public: - CrossHair(); - CrossHair(double rad, double linewidth, bool smooth, bool boxed); - - Qwt3D::Enrichment* clone() const {return new CrossHair(*this);} - - void configure(double rad, double linewidth, bool smooth, bool boxed); - void drawBegin(); - void drawEnd(); - void draw(Qwt3D::Triple const&); - -private: - bool boxed_, smooth_; - double linewidth_, radius_; - GLboolean oldstate_; -}; - -//! The Point Style -class QWT3D_EXPORT Dot : public VertexEnrichment -{ -public: - Dot(); - Dot(double pointsize, bool smooth); - - Qwt3D::Enrichment* clone() const {return new Dot(*this);} - - void configure(double pointsize, bool smooth); - void drawBegin(); - void drawEnd(); - void draw(Qwt3D::Triple const&); - -private: - bool smooth_; - double pointsize_; - GLboolean oldstate_; -}; - -//! The Cone Style -class QWT3D_EXPORT Cone : public VertexEnrichment -{ -public: - Cone(); - Cone(double rad, unsigned quality); - ~Cone(); - - Qwt3D::Enrichment* clone() const {return new Cone(*this);} - - void configure(double rad, unsigned quality); - void draw(Qwt3D::Triple const&); - -private: - GLUquadricObj *hat; - GLUquadricObj *disk; - unsigned quality_; - double radius_; - GLboolean oldstate_; -}; - -//! 3D vector field. -/** - The class encapsulates a vector field including his OpenGL representation as arrow field. - The arrows can be configured in different aspects (color, shape, painting quality). - -*/ -class QWT3D_EXPORT Arrow : public VertexEnrichment -{ -public: - - Arrow(); - ~Arrow(); - - Qwt3D::Enrichment* clone() const {return new Arrow(*this);} - - void configure(int segs, double relconelength, double relconerad, double relstemrad); - void setQuality(int val) {segments_ = val;} //!< Set the number of faces for the arrow - void draw(Qwt3D::Triple const&); - - void setTop(Qwt3D::Triple t){top_ = t;} - void setColor(Qwt3D::RGBA rgba) {rgba_ = rgba;} - -private: - - GLUquadricObj *hat; - GLUquadricObj *disk; - GLUquadricObj *base; - GLUquadricObj *bottom; - GLboolean oldstate_; - - double calcRotation(Qwt3D::Triple& axis, Qwt3D::FreeVector const& vec); - - int segments_; - double rel_cone_length; - - double rel_cone_radius; - double rel_stem_radius; - - Qwt3D::Triple top_; - Qwt3D::RGBA rgba_; -}; - -} // ns - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_extglwidget.h' --- 3rdparty/qwtplot3d/include/qwt3d_extglwidget.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_extglwidget.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,203 @@ +#ifndef qwt3d_extglwidget_h +#define qwt3d_extglwidget_h + +#include "qwt3d_types.h" + +class QMouseEvent; +class QWheelEvent; +class QKeyEvent; + +namespace Qwt3D +{ + +//! An enhanced QGLWidget +/*! + The class covers mouse/keyboard handling, lighting and basic transformations, like + scaling, shifting and rotating objects. +*/ +class QWT3D_EXPORT ExtGLWidget : public QGLWidget +{ + Q_OBJECT + +public: + ExtGLWidget ( QWidget * parent = 0, const QGLWidget * shareWidget = 0 ); + virtual ~ExtGLWidget() {} + + // transformations + double xRotation() const { return xRot_; } //!< Returns rotation around X axis [-360..360] (some angles are equivalent) + double yRotation() const { return yRot_; } //!< Returns rotation around Y axis [-360..360] (some angles are equivalent) + double zRotation() const { return zRot_; } //!< Returns rotation around Z axis [-360..360] (some angles are equivalent) + + double xShift() const { return xShift_; } //!< Returns shift along X axis (object coordinates) + double yShift() const { return yShift_; } //!< Returns shift along Y axis (object coordinates) + double zShift() const { return zShift_; } //!< Returns shift along Z axis (object coordinates) + + double xViewportShift() const { return xVPShift_; } //!< Returns relative shift [-1..1] along X axis (view coordinates) + double yViewportShift() const { return yVPShift_; } //!< Returns relative shift [-1..1] along Y axis (view coordinates) + + double xScale() const { return xScale_; } //!< Returns scaling for X values [0..inf] + double yScale() const { return yScale_; } //!< Returns scaling for Y values [0..inf] + double zScale() const { return zScale_; } //!< Returns scaling for Z values [0..inf] + + double zoom() const { return zoom_; } //!< Returns zoom (0..inf) + bool ortho() const { return ortho_; } //!< Returns orthogonal (true) or perspective (false) projection + + // input devices + void assignMouse(MouseState xrot, MouseState yrot, MouseState zrot, + MouseState xscale, MouseState yscale, MouseState zscale, + MouseState zoom, MouseState xshift, MouseState yshift); + + bool mouseEnabled() const; //!< Returns true, if the widget accept mouse input from the user + void assignKeyboard(KeyboardState xrot_n, KeyboardState xrot_p + ,KeyboardState yrot_n, KeyboardState yrot_p + ,KeyboardState zrot_n, KeyboardState zrot_p + ,KeyboardState xscale_n, KeyboardState xscale_p + ,KeyboardState yscale_n, KeyboardState yscale_p + ,KeyboardState zscale_n, KeyboardState zscale_p + ,KeyboardState zoom_n, KeyboardState zoom_p + ,KeyboardState xshift_n, KeyboardState xshift_p + ,KeyboardState yshift_n, KeyboardState yshift_p); + + bool keyboardEnabled() const; //!< Returns true, if the widget accept keyboard input from the user + //! Sets speed for keyboard driven transformations + void setKeySpeed(double rot, double scale, double shift); + //! Gets speed for keyboard driven transformations + void keySpeed(double& rot, double& scale, double& shift) const; + + // lighting + bool lightingEnabled() const; //!< Returns true, if Lighting is enabled, false else + void illuminate(unsigned light = 0); //!< Turn light on + void blowout(unsigned light = 0); //!< Turn light off + + void setMaterialComponent(GLenum property, double r, double g, double b, double a = 1.0); + void setMaterialComponent(GLenum property, double intensity); + void setShininess(double exponent); + void setLightComponent(GLenum property, double r, double g, double b, double a = 1.0, unsigned light=0); + void setLightComponent(GLenum property, double intensity, unsigned light=0); + + //! Returns Light 'idx' rotation around X axis [-360..360] (some angles are equivalent) + double xLightRotation(unsigned idx = 0) const { return (idx<8) ? lights_[idx].rot.x : 0; } + //! Returns Light 'idx' rotation around Y axis [-360..360] (some angles are equivalent) + double yLightRotation(unsigned idx = 0) const { return (idx<8) ? lights_[idx].rot.y : 0; } + //! Returns Light 'idx' rotation around Z axis [-360..360] (some angles are equivalent) + double zLightRotation(unsigned idx = 0) const { return (idx<8) ? lights_[idx].rot.z : 0; } + //! Returns shift of Light 'idx 'along X axis (object coordinates) + double xLightShift(unsigned idx = 0) const { return (idx<8) ? lights_[idx].shift.x : 0; } + //! Returns shift of Light 'idx 'along Y axis (object coordinates) + double yLightShift(unsigned idx = 0) const { return (idx<8) ? lights_[idx].shift.y : 0; } + //! Returns shift of Light 'idx 'along Z axis (object coordinates) + double zLightShift(unsigned idx = 0) const { return (idx<8) ? lights_[idx].shift.z : 0; } + +signals: + //! Emitted, if the rotation is changed + void rotationChanged( double xAngle, double yAngle, double zAngle); + //! Emitted, if the shift is changed + void shiftChanged( double xShift, double yShift, double zShift); + //! Emitted, if the viewport shift is changed + void vieportShiftChanged( double xShift, double yShift); + //! Emitted, if the scaling is changed + void scaleChanged( double xScale, double yScale, double zScale); + //! Emitted, if the zoom is changed + void zoomChanged(double); + //! Emitted, if the projection mode is changed + void projectionChanged(bool); + +public slots: + void setRotation( double xVal, double yVal, double zVal ); + void setShift( double xVal, double yVal, double zVal ); + void setViewportShift( double xVal, double yVal ); + void setScale( double xVal, double yVal, double zVal ); + void setZoom( double ); + void setOrtho(bool); + + void enableMouse(bool val=true); //!< Enable mouse input + void disableMouse(bool val =true); //!< Disable mouse input + void enableKeyboard(bool val=true); //!< Enable keyboard input + void disableKeyboard(bool val =true); //!< Disable keyboard input + + void enableLighting(bool val = true); //!< Turn Lighting on or off + void disableLighting(bool val = true); //!< Turn Lighting on or off + //! Rotate ligthsource[idx] + void setLightRotation( double xVal, double yVal, double zVal, unsigned int idx = 0 ); + //! Shift ligthsource[idx] + void setLightShift( double xVal, double yVal, double zVal, unsigned int idx = 0 ); + +protected: + void applyModelViewAndProjection(Qwt3D::Triple beg, Qwt3D::Triple end); + + void mousePressEvent( QMouseEvent *e ); + void mouseReleaseEvent( QMouseEvent *e ); + void mouseMoveEvent( QMouseEvent *e ); + void wheelEvent( QWheelEvent *e ); + void keyPressEvent( QKeyEvent *e ); + + void initializeGL(); + bool initializedGL() const { return initializedGL_; } + void applyLights(); + + bool lighting_enabled_; + +private: + // trafos + GLdouble xRot_, yRot_, zRot_, xShift_, yShift_, zShift_, zoom_, + xScale_, yScale_, zScale_, xVPShift_, yVPShift_; + + bool ortho_; + + // mouse + QPoint lastMouseMovePosition_; + bool mpressed_; + + MouseState xrot_mstate_, + yrot_mstate_, + zrot_mstate_, + xscale_mstate_, + yscale_mstate_, + zscale_mstate_, + zoom_mstate_, + xshift_mstate_, + yshift_mstate_; + + bool mouse_input_enabled_; + + void setRotationMouse(MouseState bstate, double accel, QPoint diff); + void setScaleMouse(MouseState bstate, double accel, QPoint diff); + void setShiftMouse(MouseState bstate, double accel, QPoint diff); + + // keyboard + bool kpressed_; + + KeyboardState xrot_kstate_[2], + yrot_kstate_[2], + zrot_kstate_[2], + xscale_kstate_[2], + yscale_kstate_[2], + zscale_kstate_[2], + zoom_kstate_[2], + xshift_kstate_[2], + yshift_kstate_[2]; + + bool kbd_input_enabled_; + double kbd_rot_speed_, kbd_scale_speed_, kbd_shift_speed_; + + void setRotationKeyboard(KeyboardState kseq, double speed); + void setScaleKeyboard(KeyboardState kseq, double speed); + void setShiftKeyboard(KeyboardState kseq, double speed); + + // lighting + struct Light { + Light() : unlit(true){} + bool unlit; + Qwt3D::Triple rot; + Qwt3D::Triple shift; + }; + + std::vector lights_; + void applyLight(unsigned idx); + + bool initializedGL_; +}; + +} // ns + +#endif /* include guard */ === added file '3rdparty/qwtplot3d/include/qwt3d_function.h' --- 3rdparty/qwtplot3d/include/qwt3d_function.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_function.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,41 @@ +#ifndef qwt3d_function_h__2004_03_05_13_51_begin_guarded_code +#define qwt3d_function_h__2004_03_05_13_51_begin_guarded_code + +#include "qwt3d_gridmapping.h" + +namespace Qwt3D +{ + +class Curve; + +//! Abstract base class for mathematical functions +/** + A Function encapsulates a mathematical function with rectangular domain. The user has to adapt the pure virtual operator() + to get a working object. Also, the client code should call setDomain, setMesh and create for reasonable operating conditions. +*/ +class QWT3D_EXPORT Function : public GridMapping +{ + +public: + + Function(); //!< Constructs Function object w/o assigned Curve. + explicit Function(Qwt3D::Curve& plotWidget); //!< Constructs Function object and assigns a Curve + explicit Function(Qwt3D::Curve* plotWidget); //!< Constructs Function object and assigns a Curve + virtual double operator()(double x, double y) = 0; //!< Overwrite this. + + void setMinZ(double val); //!< Sets minimal z value. + void setMaxZ(double val); //!< Sets maximal z value. + + //! Assigns a new Curve and creates a data representation for it. + virtual bool create(Qwt3D::Curve& plotWidget); + //! Creates data representation for the actual assigned Curve. + virtual bool create(); + //! Assigns the object to another widget. To see the changes, you have to call this function before create(). + void assign(Qwt3D::Curve& plotWidget); + //! Assigns the object to another widget. To see the changes, you have to call this function before create(). + void assign(Qwt3D::Curve* plotWidget); +}; + +} // ns + +#endif /* include guarded */ === removed file '3rdparty/qwtplot3d/include/qwt3d_function.h' --- 3rdparty/qwtplot3d/include/qwt3d_function.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_function.h 1970-01-01 00:00:00 +0000 @@ -1,41 +0,0 @@ -#ifndef qwt3d_function_h__2004_03_05_13_51_begin_guarded_code -#define qwt3d_function_h__2004_03_05_13_51_begin_guarded_code - -#include "qwt3d_gridmapping.h" - -namespace Qwt3D -{ - -class SurfacePlot; - -//! Abstract base class for mathematical functions -/** - A Function encapsulates a mathematical function with rectangular domain. The user has to adapt the pure virtual operator() - to get a working object. Also, the client code should call setDomain, setMesh and create for reasonable operating conditions. -*/ -class QWT3D_EXPORT Function : public GridMapping -{ - -public: - - Function(); //!< Constructs Function object w/o assigned SurfacePlot. - explicit Function(Qwt3D::SurfacePlot& plotWidget); //!< Constructs Function object and assigns a SurfacePlot - explicit Function(Qwt3D::SurfacePlot* plotWidget); //!< Constructs Function object and assigns a SurfacePlot - virtual double operator()(double x, double y) = 0; //!< Overwrite this. - - void setMinZ(double val); //!< Sets minimal z value. - void setMaxZ(double val); //!< Sets maximal z value. - - //! Assigns a new SurfacePlot and creates a data representation for it. - virtual bool create(Qwt3D::SurfacePlot& plotWidget); - //! Creates data representation for the actual assigned SurfacePlot. - virtual bool create(); - //! Assigns the object to another widget. To see the changes, you have to call this function before create(). - void assign(Qwt3D::SurfacePlot& plotWidget); - //! Assigns the object to another widget. To see the changes, you have to call this function before create(). - void assign(Qwt3D::SurfacePlot* plotWidget); -}; - -} // ns - -#endif /* include guarded */ === added file '3rdparty/qwtplot3d/include/qwt3d_global.h' --- 3rdparty/qwtplot3d/include/qwt3d_global.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_global.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,58 @@ +#ifndef QWT3D_GLOBAL_H +#define QWT3D_GLOBAL_H + +#include +#if QT_VERSION < 0x040000 +#include +#endif + +#define QWT3D_MAJOR_VERSION 0 +#define QWT3D_MINOR_VERSION 3 +#define QWT3D_PATCH_VERSION 0 + +// +// Create Qwt3d DLL if QWT3D_DLL is defined (Windows only) +// + +#if defined(Q_WS_WIN) + #if defined(_MSC_VER) /* MSVC Compiler */ + #pragma warning(disable: 4251) // dll interface required for stl templates + //pragma warning(disable: 4244) // 'conversion' conversion from 'type1' to 'type2', possible loss of data + #pragma warning(disable: 4786) // truncating debug info after 255 characters + #pragma warning(disable: 4660) // template-class specialization 'identifier' is already instantiated + #if (_MSC_VER >= 1400) /* VS8 - not sure about VC7 */ + #pragma warning(disable: 4996) /* MS security enhancements */ + #endif + #endif + + #if defined(QWT3D_NODLL) + #undef QWT3D_MAKEDLL + #undef QWT3D_DLL + #undef QWT3D_TEMPLATEDLL + #endif + + #ifdef QWT3D_DLL + #if defined(QWT3D_MAKEDLL) /* create a Qwt3d DLL library */ + #undef QWT3D_DLL + #define QWT3D_EXPORT __declspec(dllexport) + #define QWT3D_TEMPLATEDLL + #endif + #endif + + #if defined(QWT3D_DLL) /* use a Qwt3d DLL library */ + #define QWT3D_EXPORT __declspec(dllimport) + #define QWT3D_TEMPLATEDLL + #endif + +#else // ! Q_WS_WIN + #undef QWT3D_MAKEDLL /* ignore these for other platforms */ + #undef QWT3D_DLL + #undef QWT3D_TEMPLATEDLL +#endif + +#ifndef QWT3D_EXPORT + #define QWT3D_EXPORT +#endif + + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_global.h' --- 3rdparty/qwtplot3d/include/qwt3d_global.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_global.h 1970-01-01 00:00:00 +0000 @@ -1,58 +0,0 @@ -#ifndef QWT3D_GLOBAL_H -#define QWT3D_GLOBAL_H - -#include -#if QT_VERSION < 0x040000 -#include -#endif - -#define QWT3D_MAJOR_VERSION 0 -#define QWT3D_MINOR_VERSION 2 -#define QWT3D_PATCH_VERSION 6 - -// -// Create Qwt3d DLL if QWT3D_DLL is defined (Windows only) -// - -#if defined(Q_WS_WIN) - #if defined(_MSC_VER) /* MSVC Compiler */ - #pragma warning(disable: 4251) // dll interface required for stl templates - //pragma warning(disable: 4244) // 'conversion' conversion from 'type1' to 'type2', possible loss of data - #pragma warning(disable: 4786) // truncating debug info after 255 characters - #pragma warning(disable: 4660) // template-class specialization 'identifier' is already instantiated - #if (_MSC_VER >= 1400) /* VS8 - not sure about VC7 */ - #pragma warning(disable: 4996) /* MS security enhancements */ - #endif - #endif - - #if defined(QWT3D_NODLL) - #undef QWT3D_MAKEDLL - #undef QWT3D_DLL - #undef QWT3D_TEMPLATEDLL - #endif - - #ifdef QWT3D_DLL - #if defined(QWT3D_MAKEDLL) /* create a Qwt3d DLL library */ - #undef QWT3D_DLL - #define QWT3D_EXPORT __declspec(dllexport) - #define QWT3D_TEMPLATEDLL - #endif - #endif - - #if defined(QWT3D_DLL) /* use a Qwt3d DLL library */ - #define QWT3D_EXPORT __declspec(dllimport) - #define QWT3D_TEMPLATEDLL - #endif - -#else // ! Q_WS_WIN - #undef QWT3D_MAKEDLL /* ignore these for other platforms */ - #undef QWT3D_DLL - #undef QWT3D_TEMPLATEDLL -#endif - -#ifndef QWT3D_EXPORT - #define QWT3D_EXPORT -#endif - - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_graphplot.h' --- 3rdparty/qwtplot3d/include/qwt3d_graphplot.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_graphplot.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,24 @@ +#ifndef qwt3d_graphplot_h__2004_03_06_01_57_begin_guarded_code +#define qwt3d_graphplot_h__2004_03_06_01_57_begin_guarded_code + +#include "qwt3d_plot.h" + +namespace Qwt3D +{ + +//! TODO +class QWT3D_EXPORT GraphPlot : public Plot3D +{ +// Q_OBJECT + +public: + GraphPlot( QWidget* parent = 0, const char* name = 0 ); + +protected: + virtual void createData() = 0; +}; + +} // ns + + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_graphplot.h' --- 3rdparty/qwtplot3d/include/qwt3d_graphplot.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_graphplot.h 1970-01-01 00:00:00 +0000 @@ -1,24 +0,0 @@ -#ifndef qwt3d_graphplot_h__2004_03_06_01_57_begin_guarded_code -#define qwt3d_graphplot_h__2004_03_06_01_57_begin_guarded_code - -#include "qwt3d_plot.h" - -namespace Qwt3D -{ - -//! TODO -class QWT3D_EXPORT GraphPlot : public Plot3D -{ -// Q_OBJECT - -public: - GraphPlot( QWidget* parent = 0, const char* name = 0 ); - -protected: - virtual void createData() = 0; -}; - -} // ns - - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_gridmapping.h' --- 3rdparty/qwtplot3d/include/qwt3d_gridmapping.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_gridmapping.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,34 @@ +#ifndef qwt3d_gridmapping_h__2004_03_06_12_31_begin_guarded_code +#define qwt3d_gridmapping_h__2004_03_06_12_31_begin_guarded_code + +#include "qwt3d_mapping.h" + +namespace Qwt3D +{ + +class Curve; + + +//! Abstract base class for mappings acting on rectangular grids +/** + +*/ +class QWT3D_EXPORT GridMapping : public Mapping +{ +public: + GridMapping(); //!< Constructs GridMapping object w/o assigned Curve. + + void setMesh(unsigned int columns, unsigned int rows); //!< Sets number of rows and columns. + void setDomain(double minu, double maxu, double minv, double maxv); //!< Sets u-v domain boundaries. + void restrictRange(Qwt3D::ParallelEpiped const&); //!< Restrict the mappings range to the parallelepiped + +protected: + Qwt3D::ParallelEpiped range_p; + Qwt3D::Curve* plotwidget_p; + unsigned int umesh_p, vmesh_p; + double minu_p, maxu_p, minv_p, maxv_p; +}; + +} // ns + +#endif /* include guarded */ === removed file '3rdparty/qwtplot3d/include/qwt3d_gridmapping.h' --- 3rdparty/qwtplot3d/include/qwt3d_gridmapping.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_gridmapping.h 1970-01-01 00:00:00 +0000 @@ -1,34 +0,0 @@ -#ifndef qwt3d_gridmapping_h__2004_03_06_12_31_begin_guarded_code -#define qwt3d_gridmapping_h__2004_03_06_12_31_begin_guarded_code - -#include "qwt3d_mapping.h" - -namespace Qwt3D -{ - -class SurfacePlot; - - -//! Abstract base class for mappings acting on rectangular grids -/** - -*/ -class QWT3D_EXPORT GridMapping : public Mapping -{ -public: - GridMapping(); //!< Constructs GridMapping object w/o assigned SurfacePlot. - - void setMesh(unsigned int columns, unsigned int rows); //!< Sets number of rows and columns. - void setDomain(double minu, double maxu, double minv, double maxv); //!< Sets u-v domain boundaries. - void restrictRange(Qwt3D::ParallelEpiped const&); //!< Restrict the mappings range to the parallelepiped - -protected: - Qwt3D::ParallelEpiped range_p; - Qwt3D::SurfacePlot* plotwidget_p; - unsigned int umesh_p, vmesh_p; - double minu_p, maxu_p, minv_p, maxv_p; -}; - -} // ns - -#endif /* include guarded */ === added file '3rdparty/qwtplot3d/include/qwt3d_helper.h' --- 3rdparty/qwtplot3d/include/qwt3d_helper.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_helper.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,36 @@ +#ifndef __HELPER_H__ +#define __HELPER_H__ + +#include +#include +#include +#include + +namespace +{ + inline double Min_(double a, double b) + { + return (a0) ? int(d+0.5) : int(d-0.5); +} + + +} //ns + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_helper.h' --- 3rdparty/qwtplot3d/include/qwt3d_helper.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_helper.h 1970-01-01 00:00:00 +0000 @@ -1,36 +0,0 @@ -#ifndef __HELPER_H__ -#define __HELPER_H__ - -#include -#include -#include -#include - -namespace -{ - inline double Min_(double a, double b) - { - return (a0) ? int(d+0.5) : int(d-0.5); -} - - -} //ns - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_io.h' --- 3rdparty/qwtplot3d/include/qwt3d_io.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_io.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,150 @@ +#ifndef __qwt3d_io_2003_07_04_23_27__ +#define __qwt3d_io_2003_07_04_23_27__ + +#include +#include + +#include +#include +#include "qwt3d_global.h" + +namespace Qwt3D +{ + +class Plot3D; +/** +IO provides a generic interface for standard and user written I/O handlers. +It also provides functionality for the registering of such handlers in the +framework.\n +The interface mimics roughly Qt's QImageIO functions for defining +image input/output functions. +*/ +class QWT3D_EXPORT IO +{ + +public: + /*! + The function type that can be processed by the define... members. + An extension is the IO::Functor. + */ + typedef bool (*Function)(Plot3D*, QString const& fname); + + + /*! + This class gives more flexibility in implementing + userdefined IO handlers than the simple IO::Function type. + */ + class Functor + { + public: + virtual ~Functor() {} + /*! Must clone the content of *this for an object of a derived class with + \c new and return the pointer. Like operator() the predefined Functors + hide this function from the user, still allowing IO access + (friend declaration) + */ + virtual Functor* clone() const = 0; + /*! The workhorse of the user-defined implementation. Eventually, the + framework will call this operator. + */ + virtual bool operator()(Plot3D* plot, QString const& fname) = 0; + virtual bool operator()(QImage* image, QString const& fname) = 0; + }; + + static bool defineInputHandler( QString const& format, Function func); + static bool defineOutputHandler( QString const& format, Function func); + static bool defineInputHandler( QString const& format, Functor const& func); + static bool defineOutputHandler( QString const& format, Functor const& func); + static bool save(Plot3D*, QString const& fname, QString const& format); + static bool save(QImage*, QString const& fname, QString const& format); + static bool load(Plot3D*, QString const& fname, QString const& format); + static QStringList inputFormatList(); + static QStringList outputFormatList(); + static Functor* outputHandler(QString const& format); + static Functor* inputHandler(QString const& format); + + static QString title; + +private: + IO(){} + + //! Lightweight Functor encapsulating an IO::Function + class Wrapper : public Functor + { + public: + //! Performs actual input + Functor* clone() const { return new Wrapper(*this); } + //! Creates a Wrapper object from a function pointer + explicit Wrapper(Function h) : hdl(h) {} + //! Returns a pointer to the wrapped function + bool operator()(Plot3D* plot, QString const& fname) + { + return (hdl) ? (*hdl)(plot, fname) : false; + } + bool operator()(QImage* image, QString const& fname) + { + Q_UNUSED(image); Q_UNUSED(fname); return false; // image function pointer is not supported + } + private: + Function hdl; + }; + + struct Entry + { + Entry(); + ~Entry(); + + Entry(Entry const& e); + void operator=(Entry const& e); + + Entry(QString const& s, Functor const& f); + Entry(QString const& s, Function f); + + QString fmt; + Functor* iofunc; + }; + + struct FormatCompare + { + explicit FormatCompare(Entry const& e); + bool operator() (Entry const& e); + + Entry e_; + }; + + struct FormatCompare2 + { + explicit FormatCompare2(QString s); + bool operator() (Entry const& e); + + QString s_; + }; + + typedef std::vector Container; + typedef Container::iterator IT; + + static bool add_unique(Container& l, Entry const& e); + static IT find(Container& l, QString const& fmt); + static Container& rlist(); + static Container& wlist(); + static void setupHandler(); +}; + +//! Provides Qt's Pixmap output facilities +class QWT3D_EXPORT PixmapWriter : public IO::Functor +{ +friend class IO; +public: + PixmapWriter() : quality_(-1) {} + void setQuality(int val); +private: + IO::Functor* clone() const {return new PixmapWriter(*this);} + bool operator()(Plot3D* plot, QString const& fname); + bool operator()(QImage* image, QString const& fname); + QString fmt_; + int quality_; +}; + +} //ns + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_io.h' --- 3rdparty/qwtplot3d/include/qwt3d_io.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_io.h 1970-01-01 00:00:00 +0000 @@ -1,141 +0,0 @@ -#ifndef __qwt3d_io_2003_07_04_23_27__ -#define __qwt3d_io_2003_07_04_23_27__ - -#include -#include - -#include -#include -#include "qwt3d_global.h" - -namespace Qwt3D -{ - -class Plot3D; -/** -IO provides a generic interface for standard and user written I/O handlers. -It also provides functionality for the registering of such handlers in the -framework.\n -The interface mimics roughly Qt's QImageIO functions for defining -image input/output functions. -*/ -class QWT3D_EXPORT IO -{ - -public: - /*! - The function type that can be processed by the define... members. - An extension is the IO::Functor. - */ - typedef bool (*Function)(Plot3D*, QString const& fname); - - - /*! - This class gives more flexibility in implementing - userdefined IO handlers than the simple IO::Function type. - */ - class Functor - { - public: - virtual ~Functor() {} - /*! Must clone the content of *this for an object of a derived class with - \c new and return the pointer. Like operator() the predefined Functors - hide this function from the user, still allowing IO access - (friend declaration) - */ - virtual Functor* clone() const = 0; - /*! The workhorse of the user-defined implementation. Eventually, the - framework will call this operator. - */ - virtual bool operator()(Plot3D* plot, QString const& fname) = 0; - }; - - static bool defineInputHandler( QString const& format, Function func); - static bool defineOutputHandler( QString const& format, Function func); - static bool defineInputHandler( QString const& format, Functor const& func); - static bool defineOutputHandler( QString const& format, Functor const& func); - static bool save(Plot3D*, QString const& fname, QString const& format); - static bool load(Plot3D*, QString const& fname, QString const& format); - static QStringList inputFormatList(); - static QStringList outputFormatList(); - static Functor* outputHandler(QString const& format); - static Functor* inputHandler(QString const& format); - -private: - IO(){} - - //! Lightweight Functor encapsulating an IO::Function - class Wrapper : public Functor - { - public: - //! Performs actual input - Functor* clone() const { return new Wrapper(*this); } - //! Creates a Wrapper object from a function pointer - explicit Wrapper(Function h) : hdl(h) {} - //! Returns a pointer to the wrapped function - bool operator()(Plot3D* plot, QString const& fname) - { - return (hdl) ? (*hdl)(plot, fname) : false; - } - private: - Function hdl; - }; - - struct Entry - { - Entry(); - ~Entry(); - - Entry(Entry const& e); - void operator=(Entry const& e); - - Entry(QString const& s, Functor const& f); - Entry(QString const& s, Function f); - - QString fmt; - Functor* iofunc; - }; - - struct FormatCompare - { - explicit FormatCompare(Entry const& e); - bool operator() (Entry const& e); - - Entry e_; - }; - - struct FormatCompare2 - { - explicit FormatCompare2(QString s); - bool operator() (Entry const& e); - - QString s_; - }; - - typedef std::vector Container; - typedef Container::iterator IT; - - static bool add_unique(Container& l, Entry const& e); - static IT find(Container& l, QString const& fmt); - static Container& rlist(); - static Container& wlist(); - static void setupHandler(); -}; - -//! Provides Qt's Pixmap output facilities -class QWT3D_EXPORT PixmapWriter : public IO::Functor -{ -friend class IO; -public: - PixmapWriter() : quality_(-1) {} - void setQuality(int val); -private: - IO::Functor* clone() const {return new PixmapWriter(*this);} - bool operator()(Plot3D* plot, QString const& fname); - QString fmt_; - int quality_; -}; - -} //ns - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_io_gl2ps.h' --- 3rdparty/qwtplot3d/include/qwt3d_io_gl2ps.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_io_gl2ps.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,98 @@ +#ifndef qwt3d_io_gl2ps_h__2004_05_07_01_16_begin_guarded_code +#define qwt3d_io_gl2ps_h__2004_05_07_01_16_begin_guarded_code + +#include + +#if QT_VERSION < 0x040000 +#include +#else +#include +#endif + +#include "qwt3d_types.h" +#include "qwt3d_io.h" + +namespace Qwt3D +{ + +//! Provides EPS, PS, PDF and TeX output +/*! + + */ +class QWT3D_EXPORT VectorWriter : public IO::Functor +{ +friend class IO; + +public: + //! The possible output formats for the text parts of the scene + enum TEXTMODE + { + PIXEL, //!< All text will be converted to pixmaps + NATIVE, //!< Text output in the native output format + TEX //!< Text output in additional LaTeX file as an overlay + }; + //! The possible behaviour for landscape settings + enum LANDSCAPEMODE + { + ON, //!< Landscape mode on + OFF, //!< Landscape mode off + AUTO //!< The output orientation depends on the plot widgets aspect ratio (default) + }; + + //! The possible sorting types which are translated in gl2ps types + enum SORTMODE + { + NOSORT, //!< No sorting at all + SIMPLESORT, //!< A more simple (yet quicker) algorithm (default) + BSPSORT //!< BSP SORT (best and slow!) + }; + + VectorWriter(); + + void setLandscape(LANDSCAPEMODE val) {landscape_ = val;} //!< Sets landscape mode. + LANDSCAPEMODE landscape() const {return landscape_;} //!< Returns the current landscape mode + + void setTextMode(TEXTMODE val, QString fname = ""); + TEXTMODE textMode() const {return textmode_;} //!< Return current text output mode. + + void setExportSize(const QSize& size){export_size_ = size;};//!< Sets a custom output size. + QSize exportSize(){return export_size_;};//!< Return current output size. + + //! Sets one of the SORTMODE sorting modes. + void setSortMode(SORTMODE val) {sortmode_ = val;} + SORTMODE sortMode() const {return sortmode_;} //!< Returns gl2ps sorting type. + //! Turns compressed output on or off (no effect if zlib support is not available) + void setCompressed(bool val); + //! Returns compression mode (always false if zlib support has not been set) + bool compressed() const {return compressed_;} + + bool setFormat(QString const& format); + +private: + IO::Functor* clone() const; + bool operator()(Plot3D* plot, QString const& fname); + bool operator()(QImage* image, QString const& fname) + { + Q_UNUSED(image); Q_UNUSED(fname); return false; // Can't vectorise a bitmap image. + } + + GLint gl2ps_format_; + bool formaterror_; + bool compressed_; + SORTMODE sortmode_; + LANDSCAPEMODE landscape_; + TEXTMODE textmode_; + QString texfname_; + QSize export_size_; +}; + +GLint setDeviceLineWidth(GLfloat val); +GLint setDevicePointSize(GLfloat val); +GLint drawDevicePixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLint drawDeviceText(const char* str, const char* fontname, int fontsize, Qwt3D::Triple pos, Qwt3D::RGBA rgba, Qwt3D::ANCHOR align, double gap, double angle); +void setDevicePolygonOffset(GLfloat factor, GLfloat units); + + +} // ns + +#endif /* include guarded */ === removed file '3rdparty/qwtplot3d/include/qwt3d_io_gl2ps.h' --- 3rdparty/qwtplot3d/include/qwt3d_io_gl2ps.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_io_gl2ps.h 1970-01-01 00:00:00 +0000 @@ -1,94 +0,0 @@ -#ifndef qwt3d_io_gl2ps_h__2004_05_07_01_16_begin_guarded_code -#define qwt3d_io_gl2ps_h__2004_05_07_01_16_begin_guarded_code - -#include - -#if QT_VERSION < 0x040000 -#include -#else -#include -#endif - -#include "qwt3d_types.h" -#include "qwt3d_io.h" - -namespace Qwt3D -{ - -//! Provides EPS, PS, PDF and TeX output -/*! - - */ -class QWT3D_EXPORT VectorWriter : public IO::Functor -{ -friend class IO; - -public: - //! The possible output formats for the text parts of the scene - enum TEXTMODE - { - PIXEL, //!< All text will be converted to pixmaps - NATIVE, //!< Text output in the native output format - TEX //!< Text output in additional LaTeX file as an overlay - }; - //! The possible behaviour for landscape settings - enum LANDSCAPEMODE - { - ON, //!< Landscape mode on - OFF, //!< Landscape mode off - AUTO //!< The output orientation depends on the plot widgets aspect ratio (default) - }; - - //! The possible sorting types which are translated in gl2ps types - enum SORTMODE - { - NOSORT, //!< No sorting at all - SIMPLESORT, //!< A more simple (yet quicker) algorithm (default) - BSPSORT //!< BSP SORT (best and slow!) - }; - - VectorWriter(); - - void setLandscape(LANDSCAPEMODE val) {landscape_ = val;} //!< Sets landscape mode. - LANDSCAPEMODE landscape() const {return landscape_;} //!< Returns the current landscape mode - - void setTextMode(TEXTMODE val, QString fname = ""); - TEXTMODE textMode() const {return textmode_;} //!< Return current text output mode. - - void setExportSize(const QSize& size){export_size_ = size;};//!< Sets a custom output size. - QSize exportSize(){return export_size_;};//!< Return current output size. - - //! Sets one of the SORTMODE sorting modes. - void setSortMode(SORTMODE val) {sortmode_ = val;} - SORTMODE sortMode() const {return sortmode_;} //!< Returns gl2ps sorting type. - //! Turns compressed output on or off (no effect if zlib support is not available) - void setCompressed(bool val); - //! Returns compression mode (always false if zlib support has not been set) - bool compressed() const {return compressed_;} - - bool setFormat(QString const& format); - -private: - IO::Functor* clone() const; - bool operator()(Plot3D* plot, QString const& fname); - - GLint gl2ps_format_; - bool formaterror_; - bool compressed_; - SORTMODE sortmode_; - LANDSCAPEMODE landscape_; - TEXTMODE textmode_; - QString texfname_; - QSize export_size_; -}; - -GLint setDeviceLineWidth(GLfloat val); -GLint setDevicePointSize(GLfloat val); -GLint drawDevicePixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -GLint drawDeviceText(const char* str, const char* fontname, int fontsize, Qwt3D::Triple pos, Qwt3D::RGBA rgba, Qwt3D::ANCHOR align, double gap, double angle); -void setDevicePolygonOffset(GLfloat factor, GLfloat units); - - -} // ns - -#endif /* include guarded */ === added file '3rdparty/qwtplot3d/include/qwt3d_io_reader.h' --- 3rdparty/qwtplot3d/include/qwt3d_io_reader.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_io_reader.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,40 @@ +#ifndef qwt3d_reader_h__2004_03_07_14_03_begin_guarded_code +#define qwt3d_reader_h__2004_03_07_14_03_begin_guarded_code + +#include "qwt3d_io.h" + +namespace Qwt3D +{ + +/*! +Functor for reading of native files containing grid data. +As a standart input functor associated with "mes" and "MES" +file extensions. +*/ +class QWT3D_EXPORT NativeReader : public IO::Functor +{ +friend class IO; + +public: + NativeReader(); + +private: + //! Provides new NativeReader object. + IO::Functor* clone() const{return new NativeReader(*this);} + //! Performs actual input + bool operator()(Plot3D* plot, QString const& fname); + bool operator()(QImage* plot, QString const& fname) + { + Q_UNUSED(plot); Q_UNUSED(fname); return false; // Reading an image is not supported. + } + + static const char* magicstring; + double minz_, maxz_; + bool collectInfo(FILE*& file, QString const& fname, unsigned& xmesh, unsigned& ymesh, + double& minx, double& maxx, double& miny, double& maxy); +}; + + +} // ns + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_io_reader.h' --- 3rdparty/qwtplot3d/include/qwt3d_io_reader.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_io_reader.h 1970-01-01 00:00:00 +0000 @@ -1,35 +0,0 @@ -#ifndef qwt3d_reader_h__2004_03_07_14_03_begin_guarded_code -#define qwt3d_reader_h__2004_03_07_14_03_begin_guarded_code - -#include "qwt3d_io.h" - -namespace Qwt3D -{ - -/*! -Functor for reading of native files containing grid data. -As a standart input functor associated with "mes" and "MES" -file extensions. -*/ -class QWT3D_EXPORT NativeReader : public IO::Functor -{ -friend class IO; - -public: - NativeReader(); - -private: - //! Provides new NativeReader object. - IO::Functor* clone() const{return new NativeReader(*this);} - //! Performs actual input - bool operator()(Plot3D* plot, QString const& fname); - static const char* magicstring; - double minz_, maxz_; - bool collectInfo(FILE*& file, QString const& fname, unsigned& xmesh, unsigned& ymesh, - double& minx, double& maxx, double& miny, double& maxy); -}; - - -} // ns - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_label.h' --- 3rdparty/qwtplot3d/include/qwt3d_label.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_label.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,86 @@ +#ifndef __LABELPIXMAP_H__ +#define __LABELPIXMAP_H__ + +#include +#include +#include +#include +#include + +#include "qwt3d_drawable.h" + +namespace Qwt3D +{ + +//! A Qt string or an output device dependent string +class QWT3D_EXPORT Label : public Drawable +{ + +public: + + Label(); + //! Construct label and initialize with font + Label(const QString & family, int pointSize, int weight = QFont::Normal, bool italic = false); + + //! Sets the labels font + void setFont(const QFont&); + + //! Sets the labels font + void setFont(QString const& family, int pointSize, int weight = QFont::Normal, bool italic = false); + + void adjust(int gap); //!< Fine tunes label; + double gap() const {return gap_;} //!< Returns the gap caused by adjust(); + void setPosition(Qwt3D::Triple pos, ANCHOR a = BottomLeft); //!< Sets the labels position + void setRelPosition(Tuple rpos, ANCHOR a); //!< Sets the labels position relative to screen + Qwt3D::Triple first() const { return beg_;} //!< Receives bottom left label position + Qwt3D::Triple second() const { return end_;} //!< Receives top right label position + ANCHOR anchor() const { return anchor_; } //!< Defines an anchor point for the labels surrounding rectangle + virtual void setColor(double r, double g, double b, double a = 1); + virtual void setColor(Qwt3D::RGBA rgba); + + /*! + \brief Sets the label's string + For unicode labeling ( QChar(0x3c0) etc.) please look at www.unicode.org. + */ + void setString(QString const& s); + //! the label's string + const QString& string() const; + void draw(double angle = 0.0); //!< Actual drawing + + /** + \brief Decides about use of PDF standard fonts for PDF output + If true, Label can use one of the PDF standard fonts (unprecise positioning for now), + otherwise it dumps pixmaps in the PDF stream (poor quality) + */ + static void useDeviceFonts(bool val); + double width() const; + double height() const; + double textHeight() const; + +private: + + bool use_relpos_; + Qwt3D::Triple relpos_; + Qwt3D::Triple beg_, end_, pos_; + QFont font_; + QString text_; + + ANCHOR anchor_; + + void init(); + void init(const QString & family, int pointSize, int weight = QFont::Normal, bool italic = false); + QImage createImage(double angle);//!< Creates an internal bitmap used only for axis labels + const char * fontname(); //!< Try to guess an appropriate font name from the 14 standard Type 1 fonts available + void convert2screen(); + + int gap_; + + bool flagforupdate_; + + static bool devicefonts_; + double width_, height_; +}; + +} // ns + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_label.h' --- 3rdparty/qwtplot3d/include/qwt3d_label.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_label.h 1970-01-01 00:00:00 +0000 @@ -1,78 +0,0 @@ -#ifndef __LABELPIXMAP_H__ -#define __LABELPIXMAP_H__ - -#include -#include -#include -#include -#include - -#include "qwt3d_drawable.h" - -namespace Qwt3D -{ - -//! A Qt string or an output device dependent string -class QWT3D_EXPORT Label : public Drawable -{ - -public: - - Label(); - //! Construct label and initialize with font - Label(const QString & family, int pointSize, int weight = QFont::Normal, bool italic = false); - - //! Sets the labels font - void setFont(QString const& family, int pointSize, int weight = QFont::Normal, bool italic = false); - - void adjust(int gap); //!< Fine tunes label; - double gap() const {return gap_;} //!< Returns the gap caused by adjust(); - void setPosition(Qwt3D::Triple pos, ANCHOR a = BottomLeft); //!< Sets the labels position - void setRelPosition(Tuple rpos, ANCHOR a); //!< Sets the labels position relative to screen - Qwt3D::Triple first() const { return beg_;} //!< Receives bottom left label position - Qwt3D::Triple second() const { return end_;} //!< Receives top right label position - ANCHOR anchor() const { return anchor_; } //!< Defines an anchor point for the labels surrounding rectangle - virtual void setColor(double r, double g, double b, double a = 1); - virtual void setColor(Qwt3D::RGBA rgba); - - QString string(){return text_;}; - /*! - \brief Sets the labels string - For unicode labeling ( QChar(0x3c0) etc.) please look at www.unicode.org. - */ - void setString(QString const& s); - void draw(double angle = 0.0); //!< Actual drawing - - /** - \brief Decides about use of PDF standard fonts for PDF output - If true, Label can use one of the PDF standard fonts (unprecise positioning for now), - otherwise it dumps pixmaps in the PDF stream (poor quality) - */ - static void useDeviceFonts(bool val); - double width() const; - double height() const; - double textHeight() const; - -private: - - Qwt3D::Triple beg_, end_, pos_; - QFont font_; - QString text_; - - ANCHOR anchor_; - - void init(); - void init(const QString & family, int pointSize, int weight = QFont::Normal, bool italic = false); - QImage createImage(double angle);//!< Creates an internal bitmap used only for axis labels - const char * fontname(); //!< Try to guess an appropriate font name from the 14 standard Type 1 fonts available - - void convert2screen(); - - int gap_; - static bool devicefonts_; - double width_, height_; -}; - -} // ns - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_mapping.h' --- 3rdparty/qwtplot3d/include/qwt3d_mapping.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_mapping.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,27 @@ +#ifndef qwt3d_mapping_h__2004_03_05_13_51_begin_guarded_code +#define qwt3d_mapping_h__2004_03_05_13_51_begin_guarded_code + +#include +#include "qwt3d_global.h" +#include "qwt3d_types.h" + +namespace Qwt3D +{ + +//! Abstract base class for general mappings +/** + +*/ +class QWT3D_EXPORT Mapping +{ + +public: + + virtual ~Mapping(){} //!< Destructor. + virtual QString name() const { return QString(""); } //!< Descriptive String. +}; + + +} // ns + +#endif /* include guarded */ === removed file '3rdparty/qwtplot3d/include/qwt3d_mapping.h' --- 3rdparty/qwtplot3d/include/qwt3d_mapping.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_mapping.h 1970-01-01 00:00:00 +0000 @@ -1,27 +0,0 @@ -#ifndef qwt3d_mapping_h__2004_03_05_13_51_begin_guarded_code -#define qwt3d_mapping_h__2004_03_05_13_51_begin_guarded_code - -#include -#include "qwt3d_global.h" -#include "qwt3d_types.h" - -namespace Qwt3D -{ - -//! Abstract base class for general mappings -/** - -*/ -class QWT3D_EXPORT Mapping -{ - -public: - - virtual ~Mapping(){} //!< Destructor. - virtual QString name() const { return QString(""); } //!< Descriptive String. -}; - - -} // ns - -#endif /* include guarded */ === added file '3rdparty/qwtplot3d/include/qwt3d_multiplot.h' --- 3rdparty/qwtplot3d/include/qwt3d_multiplot.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_multiplot.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,24 @@ +#ifndef qwt3d_multiplot_h__2004_03_06_02_05_begin_guarded_code +#define qwt3d_multiplot_h__2004_03_06_02_05_begin_guarded_code + +#include "qwt3d_plot.h" + +namespace Qwt3D +{ + +//! TODO +class QWT3D_EXPORT MultiPlot : public Plot3D +{ +// Q_OBJECT + +public: + MultiPlot( QWidget* parent = 0, const char* name = 0 ){} + +protected: + virtual void createData() = 0; +}; + +} // ns + + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_multiplot.h' --- 3rdparty/qwtplot3d/include/qwt3d_multiplot.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_multiplot.h 1970-01-01 00:00:00 +0000 @@ -1,24 +0,0 @@ -#ifndef qwt3d_multiplot_h__2004_03_06_02_05_begin_guarded_code -#define qwt3d_multiplot_h__2004_03_06_02_05_begin_guarded_code - -#include "qwt3d_plot.h" - -namespace Qwt3D -{ - -//! TODO -class QWT3D_EXPORT MultiPlot : public Plot3D -{ -// Q_OBJECT - -public: - MultiPlot( QWidget* parent = 0, const char* name = 0 ){} - -protected: - virtual void createData() = 0; -}; - -} // ns - - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_openglhelper.h' --- 3rdparty/qwtplot3d/include/qwt3d_openglhelper.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_openglhelper.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,130 @@ +#ifndef __openglhelper_2003_06_06_15_49__ +#define __openglhelper_2003_06_06_15_49__ + +#include "qglobal.h" +#if QT_VERSION < 0x040000 +#include +#else +#include +#endif + +namespace Qwt3D +{ + +#ifndef QWT3D_NOT_FOR_DOXYGEN + +class GLStateBewarer +{ +public: + + GLStateBewarer(GLenum what, bool on, bool persist=false) + { + state_ = what; + stateval_ = glIsEnabled(what); + if (on) + turnOn(persist); + else + turnOff(persist); + } + + ~GLStateBewarer() + { + if (stateval_) + glEnable(state_); + else + glDisable(state_); + } + + void turnOn(bool persist = false) + { + glEnable(state_); + if (persist) + stateval_ = true; + } + + void turnOff(bool persist = false) + { + glDisable(state_); + if (persist) + stateval_ = false; + } + + +private: + + GLenum state_; + bool stateval_; + +}; + +inline const GLubyte* gl_error() +{ + GLenum errcode; + const GLubyte* err = 0; + + if ((errcode = glGetError()) != GL_NO_ERROR) + { + err = gluErrorString(errcode); + } + return err; +} + +inline void SaveGlDeleteLists(GLuint& lstidx, GLsizei range) +{ + if (glIsList(lstidx)) + glDeleteLists(lstidx, range); + lstidx = 0; +} + +//! get OpenGL transformation matrices +/** + Don't rely on (use) this in display lists ! + \param modelMatrix should be a GLdouble[16] + \param projMatrix should be a GLdouble[16] + \param viewport should be a GLint[4] +*/ +inline void getMatrices(GLdouble* modelMatrix, GLdouble* projMatrix, GLint* viewport) +{ + glGetIntegerv(GL_VIEWPORT, viewport); + glGetDoublev(GL_MODELVIEW_MATRIX, modelMatrix); + glGetDoublev(GL_PROJECTION_MATRIX, projMatrix); +} + +//! simplified glut routine (glUnProject): windows coordinates_p --> object coordinates_p +/** + Don't rely on (use) this in display lists ! +*/ +inline bool ViewPort2World(double& objx, double& objy, double& objz, double winx, double winy, double winz) +{ + GLdouble modelMatrix[16]; + GLdouble projMatrix[16]; + GLint viewport[4]; + + getMatrices(modelMatrix, projMatrix, viewport); + int res = gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, &objx, &objy, &objz); + + return (res == GL_FALSE) ? false : true; +} + +//! simplified glut routine (glProject): object coordinates_p --> windows coordinates_p +/** + Don't rely on (use) this in display lists ! +*/ +inline bool World2ViewPort(double& winx, double& winy, double& winz, double objx, double objy, double objz ) +{ + GLdouble modelMatrix[16]; + GLdouble projMatrix[16]; + GLint viewport[4]; + + getMatrices(modelMatrix, projMatrix, viewport); + int res = gluProject(objx, objy, objz, modelMatrix, projMatrix, viewport, &winx, &winy, &winz); + + return (res == GL_FALSE) ? false : true; +} + + +#endif // QWT3D_NOT_FOR_DOXYGEN + +} // ns + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_openglhelper.h' --- 3rdparty/qwtplot3d/include/qwt3d_openglhelper.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_openglhelper.h 1970-01-01 00:00:00 +0000 @@ -1,130 +0,0 @@ -#ifndef __openglhelper_2003_06_06_15_49__ -#define __openglhelper_2003_06_06_15_49__ - -#include "qglobal.h" -#if QT_VERSION < 0x040000 -#include -#else -#include -#endif - -namespace Qwt3D -{ - -#ifndef QWT3D_NOT_FOR_DOXYGEN - -class GLStateBewarer -{ -public: - - GLStateBewarer(GLenum what, bool on, bool persist=false) - { - state_ = what; - stateval_ = glIsEnabled(what); - if (on) - turnOn(persist); - else - turnOff(persist); - } - - ~GLStateBewarer() - { - if (stateval_) - glEnable(state_); - else - glDisable(state_); - } - - void turnOn(bool persist = false) - { - glEnable(state_); - if (persist) - stateval_ = true; - } - - void turnOff(bool persist = false) - { - glDisable(state_); - if (persist) - stateval_ = false; - } - - -private: - - GLenum state_; - bool stateval_; - -}; - -inline const GLubyte* gl_error() -{ - GLenum errcode; - const GLubyte* err = 0; - - if ((errcode = glGetError()) != GL_NO_ERROR) - { - err = gluErrorString(errcode); - } - return err; -} - -inline void SaveGlDeleteLists(GLuint& lstidx, GLsizei range) -{ - if (glIsList(lstidx)) - glDeleteLists(lstidx, range); - lstidx = 0; -} - -//! get OpenGL transformation matrices -/** - Don't rely on (use) this in display lists ! - \param modelMatrix should be a GLdouble[16] - \param projMatrix should be a GLdouble[16] - \param viewport should be a GLint[4] -*/ -inline void getMatrices(GLdouble* modelMatrix, GLdouble* projMatrix, GLint* viewport) -{ - glGetIntegerv(GL_VIEWPORT, viewport); - glGetDoublev(GL_MODELVIEW_MATRIX, modelMatrix); - glGetDoublev(GL_PROJECTION_MATRIX, projMatrix); -} - -//! simplified glut routine (glUnProject): windows coordinates_p --> object coordinates_p -/** - Don't rely on (use) this in display lists ! -*/ -inline bool ViewPort2World(double& objx, double& objy, double& objz, double winx, double winy, double winz) -{ - GLdouble modelMatrix[16]; - GLdouble projMatrix[16]; - GLint viewport[4]; - - getMatrices(modelMatrix, projMatrix, viewport); - int res = gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, &objx, &objy, &objz); - - return (res == GL_FALSE) ? false : true; -} - -//! simplified glut routine (glProject): object coordinates_p --> windows coordinates_p -/** - Don't rely on (use) this in display lists ! -*/ -inline bool World2ViewPort(double& winx, double& winy, double& winz, double objx, double objy, double objz ) -{ - GLdouble modelMatrix[16]; - GLdouble projMatrix[16]; - GLint viewport[4]; - - getMatrices(modelMatrix, projMatrix, viewport); - int res = gluProject(objx, objy, objz, modelMatrix, projMatrix, viewport, &winx, &winy, &winz); - - return (res == GL_FALSE) ? false : true; -} - - -#endif // QWT3D_NOT_FOR_DOXYGEN - -} // ns - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_parametricsurface.h' --- 3rdparty/qwtplot3d/include/qwt3d_parametricsurface.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_parametricsurface.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,44 @@ +#ifndef qwt3d_parametricsurface_h__2004_03_05_23_43_begin_guarded_code +#define qwt3d_parametricsurface_h__2004_03_05_23_43_begin_guarded_code + +#include "qwt3d_gridmapping.h" + +namespace Qwt3D +{ + +class Curve; + + +//! Abstract base class for parametric surfaces +/** + +*/ +class QWT3D_EXPORT ParametricSurface : public GridMapping +{ + +public: + ParametricSurface(); //!< Constructs ParametricSurface object w/o assigned Curve. + //! Constructs ParametricSurface object and assigns a Curve + explicit ParametricSurface(Qwt3D::Curve& plotWidget); + //! Constructs ParametricSurface object and assigns a Curve + explicit ParametricSurface(Qwt3D::Curve* plotWidget); + //! Overwrite this + virtual Qwt3D::Triple operator()(double u, double v) = 0; + //! Assigns a new Curve and creates a data representation for it. + virtual bool create(Qwt3D::Curve& plotWidget); + //! Creates data representation for the actual assigned Curve. + virtual bool create(); + //! Assigns the object to another widget. To see the changes, you have to call this function before create(). + void assign(Qwt3D::Curve& plotWidget); + //! Assigns the object to another widget. To see the changes, you have to call this function before create(). + void assign(Qwt3D::Curve* plotWidget); + //! Provide information about periodicity of the 'u' resp. 'v' domains. + void setPeriodic(bool u, bool v); + +private: + bool uperiodic_, vperiodic_; +}; + +} // ns + +#endif /* include guarded */ === removed file '3rdparty/qwtplot3d/include/qwt3d_parametricsurface.h' --- 3rdparty/qwtplot3d/include/qwt3d_parametricsurface.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_parametricsurface.h 1970-01-01 00:00:00 +0000 @@ -1,44 +0,0 @@ -#ifndef qwt3d_parametricsurface_h__2004_03_05_23_43_begin_guarded_code -#define qwt3d_parametricsurface_h__2004_03_05_23_43_begin_guarded_code - -#include "qwt3d_gridmapping.h" - -namespace Qwt3D -{ - -class SurfacePlot; - - -//! Abstract base class for parametric surfaces -/** - -*/ -class QWT3D_EXPORT ParametricSurface : public GridMapping -{ - -public: - ParametricSurface(); //!< Constructs ParametricSurface object w/o assigned SurfacePlot. - //! Constructs ParametricSurface object and assigns a SurfacePlot - explicit ParametricSurface(Qwt3D::SurfacePlot& plotWidget); - //! Constructs ParametricSurface object and assigns a SurfacePlot - explicit ParametricSurface(Qwt3D::SurfacePlot* plotWidget); - //! Overwrite this - virtual Qwt3D::Triple operator()(double u, double v) = 0; - //! Assigns a new SurfacePlot and creates a data representation for it. - virtual bool create(Qwt3D::SurfacePlot& plotWidget); - //! Creates data representation for the actual assigned SurfacePlot. - virtual bool create(); - //! Assigns the object to another widget. To see the changes, you have to call this function before create(). - void assign(Qwt3D::SurfacePlot& plotWidget); - //! Assigns the object to another widget. To see the changes, you have to call this function before create(). - void assign(Qwt3D::SurfacePlot* plotWidget); - //! Provide information about periodicity of the 'u' resp. 'v' domains. - void setPeriodic(bool u, bool v); - -private: - bool uperiodic_, vperiodic_; -}; - -} // ns - -#endif /* include guarded */ === added file '3rdparty/qwtplot3d/include/qwt3d_plot.h' --- 3rdparty/qwtplot3d/include/qwt3d_plot.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_plot.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,190 @@ +#ifndef __plot_h__ +#define __plot_h__ + +#include + +#include "qwt3d_coordsys.h" +#include "qwt3d_extglwidget.h" +#include "qwt3d_enrichment_std.h" + +namespace Qwt3D +{ + class Curve; + +//! Base class for all plotting widgets +/*! + Plot3D handles all the common features for plotting widgets beyond the low-level extensions of + ExtGLWidget - coordinate system, labeling and more. It contains some pure virtual functions and is, + in this respect, an abstract base class. It's nevertheless no pure interface. + The class provides interfaces for data handling and implements basic data controlled color allocation. +*/ +class QWT3D_EXPORT Plot3D : public ExtGLWidget +{ + Q_OBJECT + +public: + +#if QT_VERSION < 0x040000 + Plot3D( QWidget* parent = 0, const char* name = 0 ); +#else + Plot3D ( QWidget * parent = 0, const QGLWidget * shareWidget = 0 ); +#endif + virtual ~Plot3D(); + + void setCurve(Qwt3D::Curve* c) { curve_p = c; } + void setTitle(Qwt3D::Label* l) { title_p = l; } + Qwt3D::Curve* curve() const { return curve_p; } + Qwt3D::Label* title() const { return title_p; } + void manageConnect(bool connect, Qwt3D::Curve* curve = 0); + + QPixmap renderPixmap (int w = 0, int h = 0, bool useContext = false); + void createCoordinateSystem(Qwt3D::Triple beg, Qwt3D::Triple end); + + Qwt3D::CoordinateSystem* coordinates() { return &coordinates_p; } //!< Returns pointer to CoordinateSystem object + + void setBackgroundColor(Qwt3D::RGBA rgba) { bgcolor_ = rgba; } //!< Sets widgets background color + Qwt3D::RGBA backgroundRGBAColor() const { return bgcolor_; } //!< Returns the widgets background color + + void setDoubleLegend(bool mode = true) { doublelegend_ = mode; } //!< Sets legend drawing mode + bool isDoubleLegend() const { return doublelegend_; } //!< Returns the legend drawing mode + + void calculateHull(); + Qwt3D::ParallelEpiped hull() const { return hull_;} //!< Returns rectangular hull + + void setCoordinateStyle(Qwt3D::COORDSTYLE st); //!< Sets style of coordinate system. + + //! Returns true if valid data available, else false + bool hasData() const { return (!curvelist_p.empty()); } + + void addCurve(Qwt3D::Curve* curve); + void addDrawable(Qwt3D::Drawable* drawable); + void addTitle(Qwt3D::Label* label); + + bool removeCurve(Qwt3D::Curve* curve); + bool removeDrawable(Qwt3D::Drawable* drawable); + bool removeTitle(Qwt3D::Label* label); + + void createCoordinateSystem(); + void normaliseScale(Qwt3D::Curve* curve, Qwt3D::Plot3D* parentplot = 0, Qwt3D::ParallelEpiped* curvehull = 0); + + typedef QVector CurveList; + const CurveList& curveList() const { return curvelist_p; } + + typedef QVector DrawableList; + const DrawableList& drawableList() const { return drawablelist_p; } + + typedef QVector TitleList; + const TitleList& titleList() const { return titlelist_p; } + + bool isExportingVector(){return d_exporting_vector;}; + GLint vectorExportFormat(){return gl2ps_export_format_;}; + void setExportingVector(bool on = true, GLint format = 0){d_exporting_vector = on; gl2ps_export_format_ = format;}; + +signals: + // Internally sent signals through signal slot mechanism + void setCurveResolution(int); //!< Emits, resolution change to all connected curves + void setCurvePolygonOffset(double d); //!< Emits, polygon offset change to all connected curves + void setCurveIsolines(unsigned int isolines); //!< Emits, number of isolines change to all connected curves + void setCurvePlotStyle(Qwt3D::PLOTSTYLE val); //!< Emits, plotting style change to all connected curves + void setCurvePlotStyle(Qwt3D::Enrichment& val); //!< Emits, user defined plotting style change to all connected curves + void setCurveFloorStyle(Qwt3D::FLOORSTYLE val); //!< Emits, floor style change to all connected curves + + void showCurveColorLegend(bool on); //!< Emits, show colour legend mode to all connected curves + void showCurveNormals(bool on); //!< Emits, draw normals to every vertex to all connected curves + void setCurveNormalLength(double val); //!< Emits, set length of normals in percent per hull diagonale to all connected curves + void setCurveNormalQuality(int val); //!< Emits, increases plotting quality of normal arrows to all connected curves + + void setCurveSmoothMesh(bool val); //!< Emits, smooth data mesh lines setting to all connected curves + void setCurveMeshColor(Qwt3D::RGBA rgba); //!< Emits, colour for data mesh to all connected curves + void setCurveMeshLineWidth(double lw); //!< Emits, line width for data mesh to all connected curves + + void setCurveDataColor(Color* col); //!< Emits, data colour change to all connected curves + void setCurveDataProjection(bool on); //!< Emits, data point projection on & off to all connected curves + void setCurveProjection(Qwt3D::PROJECTMODE val, bool on); //!< Emits, projection mode to all connected curves + void setCurveShading(Qwt3D::SHADINGSTYLE val); //!< Emits, shading mode to all connected curves + + void setCurveTitleColor(Qwt3D::RGBA col); //!< Emits, caption color + void setCurveTitle(const QString& title); //!< Emits, caption text (one row only) + void setCurveTitlePosition(double rely, double relx, Qwt3D::ANCHOR anchor); + void setCurveTitleFont(const QString& family, int pointSize, int weight, bool italic); + + void createEnrichments(); + void createData(); + +public slots: + void updateData(bool coord = true); //!< Recalculate data + + void setResolution(int val) { emit setCurveResolution(val); } //!< Set resolution for all attached curves + void setPolygonOffset(double d) { emit setCurvePolygonOffset(d); } //!< Set polygon offset for all attached curves + void setIsolines(unsigned int isolines) { emit setCurveIsolines(isolines); } //!< Set number of isolines for all attached curves + void setPlotStyle(Qwt3D::PLOTSTYLE val) { emit setCurvePlotStyle(val); } //!< Set plot style for all attached curves + void setPlotStyle(Qwt3D::Enrichment& val) { emit setCurvePlotStyle(val); } //!< Set user defined plot style for all attached curves + void setFloorStyle(Qwt3D::FLOORSTYLE val) { emit setCurveFloorStyle(val); } //!< Set floor style for all attached curves + void setShading(Qwt3D::SHADINGSTYLE val) { emit setCurveShading(val); } //!< Set shading modes for all attached curves + + void showColorLegend(bool on) { emit showCurveColorLegend(on); } //!< Draw colour legend for all attached curves + void showNormals(bool on) { emit showCurveNormals(on); } //!< Draw normals to every vertex for all attached curves + void setNormalLength(double val) { emit setCurveNormalLength(val); } //!< Set length of normals in percent per hull diagonale for all attached curves + void setNormalQuality(int val) { emit setCurveNormalQuality(val); } //!< Set plotting quality of normal arrows for all attached curves + + void setSmoothMesh(bool val) { emit setCurveSmoothMesh(val); } //!< Enable/disable smooth data mesh lines for all attached curves + void setMeshColor(Qwt3D::RGBA rgba) { emit setCurveMeshColor(rgba); } //!< Set colour for data mesh for all attached curves + void setMeshLineWidth(double lw) { emit setCurveMeshLineWidth(lw); } //!< Set line width for data mesh for all attached curves + + void setDataColor(Color* col) { emit setCurveDataColor(col); } //!< Set data colour for all attached curves + void setDataProjection(bool on) { emit setCurveDataProjection(on); } //!< Set data point projection on & off for all attached curves + void setProjection(Qwt3D::PROJECTMODE val, bool on) { emit setCurveProjection(val, on); } //!< Set projection modes for all attached curves + + void setTitleColor(Qwt3D::RGBA col) { emit setCurveTitleColor(col); } //!< Set caption color + void setTitle(const QString& title) { emit setCurveTitle(title); } //!< Set caption text (one row only) + void setTitlePosition(double rely, double relx = 0.5, Qwt3D::ANCHOR anchor = Qwt3D::TopCenter) + { emit setCurveTitlePosition(rely, relx, anchor); } //!< Set caption text position + void setTitleFont(const QString& family, int pointSize, int weight = QFont::Normal, bool italic = false) + { emit setCurveTitleFont(family, pointSize, weight, italic); } //!< Set caption text font + + virtual bool savePixmap(QString const& fileName, QString const& format); //!< Saves content to pixmap format + virtual bool saveVector(QString const& fileName, QString const& format, + VectorWriter::TEXTMODE text, VectorWriter::SORTMODE sortmode); //!< Saves content to vector format + virtual bool save(QString const& fileName, QString const& format); //!< Saves content + +protected: + void initializeGL(); + void paintGL(); + void resizeGL(int w, int h); + void setHull(Qwt3D::ParallelEpiped p) {hull_ = p;} + + enum OBJECTS { + LegendObject, + NormalObject, + DisplayListSize // only to have a vector length ... + }; + + std::vector displaylists_p; + Qwt3D::CoordinateSystem coordinates_p; + + Qwt3D::Curve* curve_p; + Qwt3D::Label* title_p; + + CurveList curvelist_p; + DrawableList drawablelist_p; + TitleList titlelist_p; + +private: + void childConnect(bool connect); + inline void intScale(double& scale) { scale = (scale > 10) ? floor(scale + 0.5) : floor(10*scale + 0.5)/10; } + + bool update_coordinate_sys_; + Qwt3D::RGBA meshcolor_; + double meshLineWidth_; + Qwt3D::RGBA bgcolor_; + bool renderpixmaprequest_; + bool doublelegend_; + bool d_exporting_vector; + GLint gl2ps_export_format_; + + Qwt3D::ParallelEpiped hull_; +}; + +} // ns + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_plot.h' --- 3rdparty/qwtplot3d/include/qwt3d_plot.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_plot.h 1970-01-01 00:00:00 +0000 @@ -1,320 +0,0 @@ -#ifndef __plot3d_2003_06_09_12_14__ -#define __plot3d_2003_06_09_12_14__ - -#include "qwt3d_coordsys.h" -#include "qwt3d_enrichment_std.h" - -namespace Qwt3D -{ - -//! Base class for all plotting widgets -/*! - Plot3D handles all the common features for plotting widgets - coordinate system, transformations, mouse/keyboard - handling, labeling etc.. It contains some pure virtual functions and is, in so far, an abstract base class. - The class provides interfaces for data handling and implements basic data controlled color allocation. -*/ -class QWT3D_EXPORT Plot3D : public QGLWidget -{ - Q_OBJECT - -public: - -#if QT_VERSION < 0x040000 - Plot3D( QWidget* parent = 0, const char* name = 0 ); -#else - Plot3D ( QWidget * parent = 0, const QGLWidget * shareWidget = 0 ); -#endif - virtual ~Plot3D(); - - QPixmap renderPixmap (int w=0, int h=0, bool useContext=false); - void updateData(); //!< Recalculate data - void createCoordinateSystem(Qwt3D::Triple beg, Qwt3D::Triple end); - Qwt3D::CoordinateSystem* coordinates() { return &coordinates_p; } //!< Returns pointer to CoordinateSystem object - Qwt3D::ColorLegend* legend() { return &legend_;} //!< Returns pointer to ColorLegend object - - double xRotation() const { return xRot_;} //!< Returns rotation around X axis [-360..360] (some angles are equivalent) - double yRotation() const { return yRot_;} //!< Returns rotation around Y axis [-360..360] (some angles are equivalent) - double zRotation() const { return zRot_;} //!< Returns rotation around Z axis [-360..360] (some angles are equivalent) - - double xShift() const { return xShift_;} //!< Returns shift along X axis (object coordinates) - double yShift() const { return yShift_;} //!< Returns shift along Y axis (object coordinates) - double zShift() const { return zShift_;} //!< Returns shift along Z axis (object coordinates) - - double xViewportShift() const { return xVPShift_;} //!< Returns relative shift [-1..1] along X axis (view coordinates) - double yViewportShift() const { return yVPShift_;} //!< Returns relative shift [-1..1] along Y axis (view coordinates) - - double xScale() const { return xScale_;} //!< Returns scaling for X values [0..inf] - double yScale() const { return yScale_;} //!< Returns scaling for Y values [0..inf] - double zScale() const { return zScale_;} //!< Returns scaling for Z values [0..inf] - - double zoom() const { return zoom_;} //!< Returns zoom (0..inf) - - bool ortho() const { return ortho_; } //!< Returns orthogonal (true) or perspective (false) projection - void setPlotStyle( Qwt3D::PLOTSTYLE val); - Qwt3D::Enrichment* setPlotStyle( Qwt3D::Enrichment const& val); - Qwt3D::PLOTSTYLE plotStyle() const { return plotstyle_; }//!< Returns plotting style - //! Returns current Enrichment object used for plotting styles (if set, zero else) - Qwt3D::Enrichment* userStyle() const { return userplotstyle_p; } - void setShading( Qwt3D::SHADINGSTYLE val ); - Qwt3D::SHADINGSTYLE shading() const { return shading_; }//!< Returns shading style - void setIsolines(int isolines); - int isolines() const { return isolines_;} //!< Returns number of isolines - - void setSmoothMesh(bool val) {smoothdatamesh_p = val;} //!< Enables/disables smooth data mesh lines. Default is false - bool smoothDataMesh() const {return smoothdatamesh_p;} //!< True if mesh antialiasing is on - void setBackgroundColor(Qwt3D::RGBA rgba); //!< Sets widgets background color - Qwt3D::RGBA backgroundRGBAColor() const {return bgcolor_;} //!< Returns the widgets background color - void setMeshColor(Qwt3D::RGBA rgba); //!< Sets color for data mesh - Qwt3D::RGBA meshColor() const {return meshcolor_;} //!< Returns color for data mesh - void setMeshLineWidth(double lw); //!< Sets line width for data mesh - double meshLineWidth() const {return meshLineWidth_;} //!< Returns line width for data mesh - void setDataColor(Color* col); //!< Sets new data color object - const Color* dataColor() const {return datacolor_p;} //!< Returns data color object - - virtual Qwt3D::Enrichment* addEnrichment(Qwt3D::Enrichment const&); //!< Add an Enrichment - virtual bool degrade(Qwt3D::Enrichment*); //!< Remove an Enrichment - - Qwt3D::ParallelEpiped hull() const { return hull_;} //!< Returns rectangular hull - - void showColorLegend(bool); - - void setCoordinateStyle(Qwt3D::COORDSTYLE st); //!< Sets style of coordinate system. - void setPolygonOffset(double d); - double polygonOffset() const {return polygonOffset_;} //!< Returns relative value for polygon offset [0..1] - - void setTitlePosition(double rely, double relx = 0.5, Qwt3D::ANCHOR = Qwt3D::TopCenter); - void setTitleFont(const QString& family, int pointSize, int weight = QFont::Normal, bool italic = false); - void setTitleColor(Qwt3D::RGBA col) {title_.setColor(col);} //!< Set caption color - void setTitle(const QString& title) {title_.setString(title);} //!< Set caption text (one row only) - - - void assignMouse(MouseState xrot, MouseState yrot, MouseState zrot, - MouseState xscale, MouseState yscale, MouseState zscale, - MouseState zoom, MouseState xshift, MouseState yshift); - - bool mouseEnabled() const; //!< Returns true, if the widget accept mouse input from the user - void assignKeyboard( - KeyboardState xrot_n, KeyboardState xrot_p - ,KeyboardState yrot_n, KeyboardState yrot_p - ,KeyboardState zrot_n, KeyboardState zrot_p - ,KeyboardState xscale_n, KeyboardState xscale_p - ,KeyboardState yscale_n, KeyboardState yscale_p - ,KeyboardState zscale_n, KeyboardState zscale_p - ,KeyboardState zoom_n, KeyboardState zoom_p - ,KeyboardState xshift_n, KeyboardState xshift_p - ,KeyboardState yshift_n, KeyboardState yshift_p - ); - - bool keyboardEnabled() const; //!< Returns true, if the widget accept keyboard input from the user - //! Sets speed for keyboard driven transformations - void setKeySpeed(double rot, double scale, double shift); - //! Gets speed for keyboard driven transformations - void keySpeed(double& rot, double& scale, double& shift) const; - - bool lightingEnabled() const; //!< Returns true, if Lighting is enabled, false else - //! Turn light on - void illuminate(unsigned light = 0); - //! Turn light off - void blowout(unsigned light = 0); - - void setMaterialComponent(GLenum property, double r, double g, double b, double a = 1.0); - void setMaterialComponent(GLenum property, double intensity); - void setShininess(double exponent); - void setLightComponent(GLenum property, double r, double g, double b, double a = 1.0, unsigned light=0); - void setLightComponent(GLenum property, double intensity, unsigned light=0); - - //! Returns Light 'idx' rotation around X axis [-360..360] (some angles are equivalent) - double xLightRotation(unsigned idx = 0) const { return (idx<8) ? lights_[idx].rot.x : 0;} - //! Returns Light 'idx' rotation around Y axis [-360..360] (some angles are equivalent) - double yLightRotation(unsigned idx = 0) const { return (idx<8) ? lights_[idx].rot.y : 0;} - //! Returns Light 'idx' rotation around Z axis [-360..360] (some angles are equivalent) - double zLightRotation(unsigned idx = 0) const { return (idx<8) ? lights_[idx].rot.z : 0;} - - //! Returns shift of Light 'idx 'along X axis (object coordinates) - double xLightShift(unsigned idx = 0) const {return (idx<8) ? lights_[idx].shift.x : 0;} - //! Returns shift of Light 'idx 'along Y axis (object coordinates) - double yLightShift(unsigned idx = 0) const {return (idx<8) ? lights_[idx].shift.y : 0;} - //! Returns shift of Light 'idx 'along Z axis (object coordinates) - double zLightShift(unsigned idx = 0) const {return (idx<8) ? lights_[idx].shift.z : 0;} - //! Returns true if valid data available, false else - bool hasData() const { return (actualData_p) ? !actualData_p->empty() : false;} - - bool isExportingVector(){return d_exporting_vector;}; - GLint vectorExportFormat(){return gl2ps_export_format_;}; - void setExportingVector(bool on = true, GLint format = 0){d_exporting_vector = on; gl2ps_export_format_ = format;}; - -signals: - - //! Emitted, if the rotation is changed - void rotationChanged( double xAngle, double yAngle, double zAngle ); - //! Emitted, if the shift is changed - void shiftChanged( double xShift, double yShift, double zShift ); - //! Emitted, if the viewport shift is changed - void vieportShiftChanged( double xShift, double yShift ); - //! Emitted, if the scaling is changed - void scaleChanged( double xScale, double yScale, double zScale ); - //! Emitted, if the zoom is changed - void zoomChanged(double); - //! Emitted, if the projection mode is changed - void projectionChanged(bool); - -public slots: - - void setRotation( double xVal, double yVal, double zVal ); - void setShift( double xVal, double yVal, double zVal ); - void setViewportShift( double xVal, double yVal ); - void setScale( double xVal, double yVal, double zVal ); - void setZoom( double ); - - void setOrtho(bool); - - void enableMouse(bool val=true); //!< Enable mouse input - void disableMouse(bool val =true); //!< Disable mouse input - void enableKeyboard(bool val=true); //!< Enable keyboard input - void disableKeyboard(bool val =true); //!< Disable keyboard input - - void enableLighting(bool val = true); //!< Turn Lighting on or off - void disableLighting(bool val = true); //!< Turn Lighting on or off - - void setLightRotation( double xVal, double yVal, double zVal, unsigned int idx = 0 ); - void setLightShift( double xVal, double yVal, double zVal, unsigned int idx = 0 ); - - virtual bool savePixmap(QString const& fileName, QString const& format); //!< Saves content to pixmap format - //! Saves content to vector format - virtual bool saveVector(QString const& fileName, QString const& format, VectorWriter::TEXTMODE text, VectorWriter::SORTMODE sortmode); - virtual bool save(QString const& fileName, QString const& format); //!< Saves content - -protected: - typedef std::list EnrichmentList; - typedef EnrichmentList::iterator ELIT; - - void initializeGL(); - void paintGL(); - void resizeGL( int w, int h ); - - void mousePressEvent( QMouseEvent *e ); - void mouseReleaseEvent( QMouseEvent *e ); - void mouseMoveEvent( QMouseEvent *e ); - void wheelEvent( QWheelEvent *e ); - - void keyPressEvent( QKeyEvent *e ); - - Qwt3D::CoordinateSystem coordinates_p; - Qwt3D::Color* datacolor_p; - Qwt3D::Enrichment* userplotstyle_p; - EnrichmentList elist_p; - - virtual void calculateHull() = 0; - virtual void createData() = 0; - virtual void createEnrichment(Qwt3D::Enrichment&){} - virtual void createEnrichments(); - - void createCoordinateSystem(); - void setHull(Qwt3D::ParallelEpiped p) {hull_ = p;} - - bool initializedGL() const {return initializedGL_;} - - enum OBJECTS - { - DataObject, - LegendObject, - NormalObject, - DisplayListSize // only to have a vector length ... - }; - std::vector displaylists_p; - Qwt3D::Data* actualData_p; - - -private: - struct Light - { - Light() : unlit(true){} - bool unlit; - Qwt3D::Triple rot; - Qwt3D::Triple shift; - }; - std::vector lights_; - - GLdouble xRot_, yRot_, zRot_, xShift_, yShift_, zShift_, zoom_ - , xScale_, yScale_, zScale_, xVPShift_, yVPShift_; - - Qwt3D::RGBA meshcolor_; - double meshLineWidth_; - Qwt3D::RGBA bgcolor_; - Qwt3D::PLOTSTYLE plotstyle_; - Qwt3D::SHADINGSTYLE shading_; - Qwt3D::FLOORSTYLE floorstyle_; - bool ortho_; - double polygonOffset_; - int isolines_; - bool displaylegend_; - bool smoothdatamesh_p; - - Qwt3D::ParallelEpiped hull_; - - Qwt3D::ColorLegend legend_; - - Label title_; - Qwt3D::Tuple titlerel_; - Qwt3D::ANCHOR titleanchor_; - - - // mouse - - QPoint lastMouseMovePosition_; - bool mpressed_; - - MouseState xrot_mstate_, - yrot_mstate_, - zrot_mstate_, - xscale_mstate_, - yscale_mstate_, - zscale_mstate_, - zoom_mstate_, - xshift_mstate_, - yshift_mstate_; - - bool mouse_input_enabled_; - - void setRotationMouse(MouseState bstate, double accel, QPoint diff); - void setScaleMouse(MouseState bstate, double accel, QPoint diff); - void setShiftMouse(MouseState bstate, double accel, QPoint diff); - - // keyboard - - bool kpressed_; - - KeyboardState xrot_kstate_[2], - yrot_kstate_[2], - zrot_kstate_[2], - xscale_kstate_[2], - yscale_kstate_[2], - zscale_kstate_[2], - zoom_kstate_[2], - xshift_kstate_[2], - yshift_kstate_[2]; - - bool kbd_input_enabled_; - double kbd_rot_speed_, kbd_scale_speed_, kbd_shift_speed_; - - void setRotationKeyboard(KeyboardState kseq, double speed); - void setScaleKeyboard(KeyboardState kseq, double speed); - void setShiftKeyboard(KeyboardState kseq, double speed); - - - - bool lighting_enabled_; - void applyLight(unsigned idx); - void applyLights(); - - bool initializedGL_; - bool renderpixmaprequest_; - bool d_exporting_vector; - GLint gl2ps_export_format_; -}; - - -} // ns - - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_portability.h' --- 3rdparty/qwtplot3d/include/qwt3d_portability.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_portability.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,91 @@ +#ifndef qwt3d_portability_h__2005_07_02_11_55_begin_guarded_code +#define qwt3d_portability_h__2005_07_02_11_55_begin_guarded_code + +//! Portability classes providing transparent Qt3/4 support + +#include +#include "qwt3d_global.h" + +#if QT_VERSION < 0x040000 + +namespace Qwt3D +{ + #define QWT3DLOCAL8BIT(qstring) \ + ((const char*)(qstring.local8Bit())) + + typedef int MouseState; + typedef int KeyboardState; + const Qt::TextFlags SingleLine = Qt::SingleLine; +} // ns + + +#else // Qt4 + +#include + +namespace Qwt3D +{ + + #define QWT3DLOCAL8BIT(qstring) \ + ((const char*)(qstring.toLocal8Bit())) + + const Qt::TextFlag SingleLine = Qt::TextSingleLine; + + //! This class creates a (mouse-button,modifier) pair (ordinary typedef for int if Qt3 is used) + class MouseState + { + public: + MouseState(Qt::MouseButtons mb = Qt::NoButton, Qt::KeyboardModifiers km = Qt::NoModifier) + : mb_(mb), km_(km) + { + } + + MouseState(Qt::MouseButton mb, Qt::KeyboardModifiers km = Qt::NoModifier) + : mb_(mb), km_(km) + { + } + + bool operator==(const MouseState& ms) + { + return mb_ == ms.mb_ && km_ == ms.km_; + } + + bool operator!=(const MouseState& ms) + { + return !operator==(ms); + } + + private: + Qt::MouseButtons mb_; + Qt::KeyboardModifiers km_; + }; + + //! This class creates a (key-button,modifier) pair (ordinary typedef for int if Qt3 is used) + class KeyboardState + { + public: + KeyboardState(int key = Qt::Key_unknown, Qt::KeyboardModifiers km = Qt::NoModifier) + : key_(key), km_(km) + { + } + + bool operator==(const KeyboardState& ms) + { + return key_ == ms.key_ && km_ == ms.km_; + } + + bool operator!=(const KeyboardState& ms) + { + return !operator==(ms); + } + + private: + int key_; + Qt::KeyboardModifiers km_; + }; +} // ns + +#endif + + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_portability.h' --- 3rdparty/qwtplot3d/include/qwt3d_portability.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_portability.h 1970-01-01 00:00:00 +0000 @@ -1,91 +0,0 @@ -#ifndef qwt3d_portability_h__2005_07_02_11_55_begin_guarded_code -#define qwt3d_portability_h__2005_07_02_11_55_begin_guarded_code - -//! Portability classes providing transparent Qt3/4 support - -#include -#include "qwt3d_global.h" - -#if QT_VERSION < 0x040000 - -namespace Qwt3D -{ - #define QWT3DLOCAL8BIT(qstring) \ - ((const char*)(qstring.local8Bit())) - - typedef int MouseState; - typedef int KeyboardState; - const Qt::TextFlags SingleLine = Qt::SingleLine; -} // ns - - -#else // Qt4 - -#include - -namespace Qwt3D -{ - - #define QWT3DLOCAL8BIT(qstring) \ - ((const char*)(qstring.toLocal8Bit())) - - const Qt::TextFlag SingleLine = Qt::TextSingleLine; - - //! This class creates a (mouse-button,modifier) pair (ordinary typedef for int if Qt3 is used) - class MouseState - { - public: - MouseState(Qt::MouseButtons mb = Qt::NoButton, Qt::KeyboardModifiers km = Qt::NoModifier) - : mb_(mb), km_(km) - { - } - - MouseState(Qt::MouseButton mb, Qt::KeyboardModifiers km = Qt::NoModifier) - : mb_(mb), km_(km) - { - } - - bool operator==(const MouseState& ms) - { - return mb_ == ms.mb_ && km_ == ms.km_; - } - - bool operator!=(const MouseState& ms) - { - return !operator==(ms); - } - - private: - Qt::MouseButtons mb_; - Qt::KeyboardModifiers km_; - }; - - //! This class creates a (key-button,modifier) pair (ordinary typedef for int if Qt3 is used) - class KeyboardState - { - public: - KeyboardState(int key = Qt::Key_unknown, Qt::KeyboardModifiers km = Qt::NoModifier) - : key_(key), km_(km) - { - } - - bool operator==(const KeyboardState& ms) - { - return key_ == ms.key_ && km_ == ms.km_; - } - - bool operator!=(const KeyboardState& ms) - { - return !operator==(ms); - } - - private: - int key_; - Qt::KeyboardModifiers km_; - }; -} // ns - -#endif - - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_scale.h' --- 3rdparty/qwtplot3d/include/qwt3d_scale.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_scale.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,97 @@ +#ifndef qwt3d_scale_h__2004_06_02_22_02_begin_guarded_code +#define qwt3d_scale_h__2004_06_02_22_02_begin_guarded_code + +#include +#include "qwt3d_types.h" +#include "qwt3d_autoscaler.h" +#include "qwt3d_autoptr.h" + +namespace Qwt3D +{ + +/*! +The class encapsulates non-visual scales. +She is utilized by Axis and also collaborates closely with AutoScaler. +A Scale allows control over all aspects of tic generation including +arbitrary transformations of tic values into corresponding strings. +The strings contain what eventually will be shown as tic labels.\n +Standard linear and logarithmic scales have been integrated yet into the Axis +interface. User-defined axes can be derived from Scale, LinearScale et al. +*/ +class QWT3D_EXPORT Scale +{ + friend class Axis; + friend class qwt3d_ptr; + +public: + enum NumericFormat{Default, Decimal, Scientific, Engineering}; + + int numericPrecision(){return d_numeric_precision;};//!< Returns numeric precision for tick labels + NumericFormat numericFormat(){return d_numeric_format;};//!< Returns numeric format for tick labels + void setNumericFormat(const NumericFormat& fmt, int prec){d_numeric_format = fmt; d_numeric_precision = prec;};//!< Set numeric format and precision for tick labels + + protected: + Scale(); + virtual ~Scale(){} + virtual QString ticLabel(unsigned int idx) const; + double ticValue(unsigned int idx) const; + + virtual void setLimits(double start, double stop); + virtual void setMajors(int val) {majorintervals_p=val;} //!< Sets number of major intervals + virtual void setMinors(int val) {minorintervals_p=val;} //!< Sets number of minor intervals per major interval + virtual void setMajorLimits(double start, double stop); + + int majors() const {return majorintervals_p;} //!< Returns major intervals + int minors() const {return minorintervals_p;} //!< Returns minor intervals + + //! Derived classes should return a new heap based object here. + virtual Scale* clone() const = 0; + //! This function should setup the 2 vectors for major and minor positions; + virtual void calculate() = 0; + virtual int autoscale(double& a, double& b, double start, double stop, int ivals); + + std::vector majors_p, minors_p; + double start_p, stop_p; + int majorintervals_p, minorintervals_p; + double mstart_p, mstop_p; + + private: + void destroy() const {delete this;} //!< Used by qwt3d_ptr + int d_numeric_precision; + NumericFormat d_numeric_format; +}; + +//! The standard (1:1) mapping class for axis numbering +class QWT3D_EXPORT LinearScale : public Scale +{ + friend class Axis; + friend class qwt3d_ptr; +protected: + int autoscale(double& a, double& b, double start, double stop, int ivals); + //! Returns a new heap based object utilized from qwt3d_ptr + Scale* clone() const {return new LinearScale(*this);} + void calculate(); + LinearAutoScaler autoscaler_p; +}; + +//! log10 scale +class QWT3D_EXPORT LogScale : public Scale +{ + friend class Axis; + friend class qwt3d_ptr; +protected: + QString ticLabel(unsigned int idx) const; + void setMinors(int val); + //! Standard ctor + LogScale(); + //! Returns a new heap based object utilized from qwt3d_ptr + Scale* clone() const {return new LogScale;} + void calculate(); +private: + void setupCounter(double& k, int& step); +}; + +} // namespace Qwt3D + + +#endif /* include guarded */ === removed file '3rdparty/qwtplot3d/include/qwt3d_scale.h' --- 3rdparty/qwtplot3d/include/qwt3d_scale.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_scale.h 1970-01-01 00:00:00 +0000 @@ -1,89 +0,0 @@ -#ifndef qwt3d_scale_h__2004_06_02_22_02_begin_guarded_code -#define qwt3d_scale_h__2004_06_02_22_02_begin_guarded_code - -#include -#include "qwt3d_types.h" -#include "qwt3d_autoscaler.h" -#include "qwt3d_autoptr.h" - -namespace Qwt3D -{ - -/*! -The class encapsulates non-visual scales. -She is utilized by Axis and also collaborates closely with AutoScaler. -A Scale allows control over all aspects of tic generation including -arbitrary transformations of tic values into corresponding strings. -The strings contain what eventually will be shown as tic labels.\n -Standard linear and logarithmic scales have been integrated yet into the Axis -interface. User-defined axes can be derived from Scale, LinearScale et al. -*/ -class QWT3D_EXPORT Scale -{ - friend class Axis; - friend class qwt3d_ptr; - - protected: - Scale(); - virtual ~Scale(){} - virtual QString ticLabel(unsigned int idx) const; - - virtual void setLimits(double start, double stop); - virtual void setMajors(int val) {majorintervals_p=val;} //!< Sets number of major intervals - virtual void setMinors(int val) {minorintervals_p=val;} //!< Sets number of minor intervals per major interval - virtual void setMajorLimits(double start, double stop); - - double ticValue(unsigned int idx) const; - - int majors() const {return majorintervals_p;} //!< Returns major intervals - int minors() const {return minorintervals_p;} //!< Returns minor intervals - - //! Derived classes should return a new heap based object here. - virtual Scale* clone() const = 0; - //! This function should setup the 2 vectors for major and minor positions; - virtual void calculate() = 0; - virtual int autoscale(double& a, double& b, double start, double stop, int ivals); - - std::vector majors_p, minors_p; - double start_p, stop_p; - int majorintervals_p, minorintervals_p; - double mstart_p, mstop_p; - - private: - void destroy() const {delete this;} //!< Used by qwt3d_ptr -}; - -//! The standard (1:1) mapping class for axis numbering -class QWT3D_EXPORT LinearScale : public Scale -{ - friend class Axis; - friend class qwt3d_ptr; -protected: - int autoscale(double& a, double& b, double start, double stop, int ivals); - //! Returns a new heap based object utilized from qwt3d_ptr - Scale* clone() const {return new LinearScale(*this);} - void calculate(); - LinearAutoScaler autoscaler_p; -}; - -//! log10 scale -class QWT3D_EXPORT LogScale : public Scale -{ - friend class Axis; - friend class qwt3d_ptr; -protected: - QString ticLabel(unsigned int idx) const; - void setMinors(int val); - //! Standard ctor - LogScale(); - //! Returns a new heap based object utilized from qwt3d_ptr - Scale* clone() const {return new LogScale;} - void calculate(); -private: - void setupCounter(double& k, int& step); -}; - -} // namespace Qwt3D - - -#endif /* include guarded */ === added file '3rdparty/qwtplot3d/include/qwt3d_surfaceplot.h' --- 3rdparty/qwtplot3d/include/qwt3d_surfaceplot.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_surfaceplot.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,191 @@ +#ifndef qwt3d_SurfacePlot_h__2004_03_05_11_36_begin_guarded_code +#define qwt3d_SurfacePlot_h__2004_03_05_11_36_begin_guarded_code + +#include "qwt3d_plot.h" + +namespace Qwt3D +{ +//! A class representing Surfaces +/** + A SurfacePlot ... + +*/ +class QWT3D_EXPORT SurfacePlot : public Plot3D +{ + Q_OBJECT + +public: +#if QT_VERSION < 0x040000 + SurfacePlot( QWidget* parent = 0, const char* name = 0 ); +#else + SurfacePlot( QWidget* parent = 0, const QGLWidget* shareWidget = 0 ); +#endif + ~SurfacePlot(); + void updateNormals(); //!< Recalculates surface normals; + int resolution() const {return resolution_p;} //!< Returns data resolution (1 means all data) + std::pair facets() const; //!< Returns the number of mesh cells for the ORIGINAL data + bool loadFromData(Qwt3D::Triple** data, unsigned int columns, unsigned int rows + , bool uperiodic = false, bool vperiodic = false); + bool loadFromData(double** data, unsigned int columns, unsigned int rows + ,double minx, double maxx, double miny, double maxy); + bool loadFromData(Qwt3D::TripleField const& data, Qwt3D::CellField const& poly); + + + //! Equivalent to loadFromData(); + /** + \deprecated Use loadFromData instead + */ + bool createDataRepresentation(Qwt3D::Triple** data, unsigned int columns, unsigned int rows + , bool uperiodic = false, bool vperiodic = false) + { + return loadFromData(data, columns, rows, uperiodic, vperiodic); + } + //! Equivalent to loadFromData(); + /** + \deprecated Use loadFromData instead + */ + bool createDataRepresentation(double** data, unsigned int columns, unsigned int rows + ,double minx, double maxx, double miny, double maxy) + { + return loadFromData(data, columns, rows, minx, maxx, miny, maxy); + } + //! Equivalent to loadFromData(); + /** + \deprecated Use loadFromData instead + */ + bool createDataRepresentation(Qwt3D::TripleField const& data, Qwt3D::CellField const& poly) + { + return loadFromData(data, poly); + } + + Qwt3D::FLOORSTYLE floorStyle() const { return floorstyle_; } //!< Return floor style + void setFloorStyle(Qwt3D::FLOORSTYLE val) { floorstyle_ = val; } //!< Sets floor style + void showNormals(bool); //!< Draw normals to every vertex + bool normals() const { return datanormals_p; } //!< Returns \c true, if normal drawing is on + + void setNormalLength(double val); //!< Sets length of normals in percent per hull diagonale + double normalLength() const { return normalLength_p; } //!< Returns relative length of normals + void setNormalQuality(int val); //!< Increases plotting quality of normal arrows + int normalQuality() const { return normalQuality_p; } //!< Returns plotting quality of normal arrows + + double** getData(int *cols, int *rows); + CellField* getCellData(int *cells); + TripleField* getNodeData(int *nodes); + + void deleteData(double**data, int columns); + void deleteData(CellField* poly); + void deleteData(TripleField* data); + + void setDataProjection(bool toggle = true) { datapoints_ = toggle; } + bool dataProjected() const { return datapoints_; } + void setProjection(Qwt3D::PROJECTMODE val, bool toggle = true) + { + switch(val) { + case Qwt3D::FACE: + facemode_ = toggle; break; + case Qwt3D::SIDE: + sidemode_ = toggle; break; + case Qwt3D::BASE: + floormode_ = toggle; break; + } + } //!< Sets projection modes + +signals: + void resolutionChanged(int); + +public slots: + void setResolution( int ); + +protected: + bool datanormals_p; + double normalLength_p; + int normalQuality_p; + + virtual void calculateHull(); + virtual void createData(); + virtual void createEnrichment(Qwt3D::Enrichment& p); + virtual void createFloorData(); + virtual void createSideData(); + virtual void createFaceData(); + + void drawVertex(Triple& vertex, double shift, unsigned int comp = 3); + virtual void drawIntersections(std::vector& intersection, double shift, unsigned int comp, + bool projected, std::vector* colour = 0); + + void createNormals(); + void createPoints(); + + int resolution_p; + + void readIn(Qwt3D::GridData& gdata, Triple** data, unsigned int columns, unsigned int rows); + void readIn(Qwt3D::GridData& gdata, double** data, unsigned int columns, unsigned int rows, + double minx, double maxx, double miny, double maxy); + void calcNormals(GridData& gdata); + void sewPeriodic(GridData& gdata); + + void animateData(double** data); + void animateData(TripleField* data, CellField* poly); + void animateData(TripleField* data); +// void calcLowResolution(); + +private: + +// void Data2Floor(); +// void Isolines2Floor(); + + Qwt3D::FLOORSTYLE floorstyle_; + unsigned int point_size_; + bool datapoints_; + bool facemode_; + bool sidemode_; + bool floormode_; + + // grid plot + Qwt3D::GridData* actualDataG_; + virtual void createDataG(); + virtual void createFaceDataG(); + virtual void createSideDataG(); + virtual void createFloorDataG(); + void createNormalsG(); + + void Data2FloorG() { DatamapG(2); } + void Data2FrontG() { DatamapG(1); } + void Data2SideG() { DatamapG(0); } + void DatamapG(unsigned int comp); + + void Isolines2FloorG(bool projected = false) { IsolinesG(2, projected); } + void Isolines2FrontG(bool projected = false) { IsolinesG(1, projected); } + void Isolines2SideG(bool projected = false) { IsolinesG(0, projected); } + void IsolinesG(unsigned int comp, bool projected); + + void setColorFromVertexG(int ix, int iy, bool skip = false); + + void DataPointsG(unsigned int comp, bool projected); + void DataPoints2SideG(bool projected = false) { DataPointsG(0, projected); } + void DataPoints2BackG(bool projected = false) { DataPointsG(1, projected); } + + // mesh plot + Qwt3D::CellData* actualDataC_; + virtual void createDataC(); + virtual void createFaceDataC(); + virtual void createSideDataC(); + virtual void createFloorDataC(); + void createNormalsC(); + + void Data2FloorC() { DatamapC(2); } + void Data2FrontC() { DatamapC(1); } + void Data2SideC() { DatamapC(0); } + void DatamapC(unsigned int comp); + + void Isolines2FloorC(bool projected = false) { IsolinesC(2, projected); } + void Isolines2FrontC(bool projected = false) { IsolinesC(1, projected); } + void Isolines2SideC(bool projected = false) { IsolinesC(0, projected); } + void IsolinesC(unsigned int comp, bool projected); + + void setColorFromVertexC(int node, bool skip = false); +}; + +} // ns + + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_surfaceplot.h' --- 3rdparty/qwtplot3d/include/qwt3d_surfaceplot.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_surfaceplot.h 1970-01-01 00:00:00 +0000 @@ -1,130 +0,0 @@ -#ifndef qwt3d_SurfacePlot_h__2004_03_05_11_36_begin_guarded_code -#define qwt3d_SurfacePlot_h__2004_03_05_11_36_begin_guarded_code - -#include "qwt3d_plot.h" - -namespace Qwt3D -{ -//! A class representing Surfaces -/** - A SurfacePlot ... - -*/ -class QWT3D_EXPORT SurfacePlot : public Plot3D -{ - Q_OBJECT - -public: -#if QT_VERSION < 0x040000 - SurfacePlot( QWidget* parent = 0, const char* name = 0 ); -#else - SurfacePlot( QWidget * parent = 0, const QGLWidget * shareWidget = 0 ); -#endif - ~SurfacePlot(); - void updateNormals(); //!< Recalculates surface normals; - int resolution() const {return resolution_p;} //!< Returns data resolution (1 means all data) - std::pair facets() const; //!< Returns the number of mesh cells for the ORIGINAL data - bool loadFromData(Qwt3D::Triple** data, unsigned int columns, unsigned int rows - , bool uperiodic = false, bool vperiodic = false); - bool loadFromData(double** data, unsigned int columns, unsigned int rows - ,double minx, double maxx, double miny, double maxy); - bool loadFromData(Qwt3D::TripleField const& data, Qwt3D::CellField const& poly); - - - //! Equivalent to loadFromData(); - /** - \deprecated Use loadFromData instead - */ - bool createDataRepresentation(Qwt3D::Triple** data, unsigned int columns, unsigned int rows - , bool uperiodic = false, bool vperiodic = false) - { - return loadFromData(data, columns, rows, uperiodic, vperiodic); - } - //! Equivalent to loadFromData(); - /** - \deprecated Use loadFromData instead - */ - bool createDataRepresentation(double** data, unsigned int columns, unsigned int rows - ,double minx, double maxx, double miny, double maxy) - { - return loadFromData(data, columns, rows, minx, maxx, miny, maxy); - } - //! Equivalent to loadFromData(); - /** - \deprecated Use loadFromData instead - */ - bool createDataRepresentation(Qwt3D::TripleField const& data, Qwt3D::CellField const& poly) - { - return loadFromData(data, poly); - } - - - Qwt3D::FLOORSTYLE floorStyle() const { return floorstyle_;} //!< Return floor style - void setFloorStyle( Qwt3D::FLOORSTYLE val ) {floorstyle_ = val;} //!< Sets floor style - void showNormals(bool); //!< Draw normals to every vertex - bool normals() const { return datanormals_p;} //!< Returns \c true, if normal drawing is on - - void setNormalLength(double val); //!< Sets length of normals in percent per hull diagonale - double normalLength() const { return normalLength_p; }//!< Returns relative length of normals - void setNormalQuality(int val); //!< Increases plotting quality of normal arrows - int normalQuality() const { return normalQuality_p; }//!< Returns plotting quality of normal arrows - -signals: - void resolutionChanged(int); - -public slots: - void setResolution( int ); - -protected: - bool datanormals_p; - double normalLength_p; - int normalQuality_p; - - virtual void calculateHull(); - virtual void createData(); - virtual void createEnrichment(Qwt3D::Enrichment& p); - virtual void createFloorData(); - void createNormals(); - void createPoints(); - - int resolution_p; - - void readIn(Qwt3D::GridData& gdata, Triple** data, unsigned int columns, unsigned int rows); - void readIn(Qwt3D::GridData& gdata, double** data, unsigned int columns, unsigned int rows, - double minx, double maxx, double miny, double maxy); - void calcNormals(GridData& gdata); - void sewPeriodic(GridData& gdata); - - //void calcLowResolution(); -private: - - void Data2Floor(); - void Isolines2Floor(); - - Qwt3D::FLOORSTYLE floorstyle_; - - // grid plot - - Qwt3D::GridData* actualDataG_; - virtual void createDataG(); - virtual void createFloorDataG(); - void createNormalsG(); - void Data2FloorG(); - void Isolines2FloorG(); - void setColorFromVertexG(int ix, int iy, bool skip = false); - - // mesh plot - - Qwt3D::CellData* actualDataC_; - virtual void createDataC(); - virtual void createFloorDataC(); - void createNormalsC(); - void Data2FloorC(); - void Isolines2FloorC(); - void setColorFromVertexC(int node, bool skip = false); -}; - -} // ns - - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_types.h' --- 3rdparty/qwtplot3d/include/qwt3d_types.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_types.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,477 @@ +#if defined(_MSC_VER) /* MSVC Compiler */ +#pragma warning ( disable : 4786 ) +#endif + +#ifndef __DATATYPES_H__ +#define __DATATYPES_H__ + +#ifdef _DEBUG + #include +#endif + +#include + +#include "qwt3d_global.h" + +#if defined(Q_WS_WIN) + #include +#endif + +#ifndef WHEEL_DELTA + #define WHEEL_DELTA 120 +#endif + +#include "qwt3d_portability.h" +#include "qwt3d_helper.h" +#include "qwt3d_openglhelper.h" + +//! Common namespace for all QwtPlot3D classes +namespace Qwt3D +{ + +const double PI = 3.14159265358979323846264338328; + +//! Plotting style +enum PLOTSTYLE +{ + NOPLOT=0 , //!< No visible data + WIREFRAME , //!< Wireframe style + HIDDENLINE , //!< Hidden Line style + FILLED , //!< Color filled polygons w/o edges + FILLEDMESH , //!< Color filled polygons w/ separately colored edges + POINTS , //!< User defined style (used by Enrichments) + USER //!< User defined style (used by Enrichments) +}; + +//! Shading style +enum SHADINGSTYLE +{ + FLAT, //!< Flat shading (OpenGL) + GOURAUD //!< Gouraud Shading (OpenGL) +}; + +//! Style of Coordinate system +enum COORDSTYLE +{ + NOCOORD=0, //!< Coordinate system is not visible + BOX, //!< Boxed + FRAME //!< Frame - 3 visible axes +}; + +//! Different types of axis scales +enum SCALETYPE +{ + LINEARSCALE,//!< Linear scaling + LOG10SCALE, //!< Logarithmic scaling (base 10) + USERSCALE //!< User-defined (for extensions) +}; + +//! Plotting style for floor data (projections) +enum FLOORSTYLE +{ + NOFLOOR=0, //!< Empty floor + FLOORISO, //!< Isoline projections visible + FLOORDATA //!< Projected polygons visible +}; + +//! Data Projection modes +enum PROJECTMODE +{ + FACE=0, //!< Projected front and back faces + SIDE, //!< Projected left and right side + BASE //!< Projected onto floor base +}; + +//! Mesh type +enum DATATYPE +{ + GRID, //!< Rectangular grid + POLYGON //!< Convex polygon +}; + +//! The 12 axes +/** +\image html axes.png +*/ +enum AXIS +{ + X1 = 0, //!< 1st x-axis + X2 = 3, //!< 2nd x-axis + X3 = 4, //!< 3th x-axis + X4 = 5, //!< 4th x-axis + Y1 = 1, //!< 1st y-axis + Y2 = 8, //!< 2nd y-axis + Y3 = 7, //!< 3th y-axis + Y4 = 6, //!< 4th y-axis + Z1 = 2, //!< 1st z-axis + Z2 = 9, //!< 2nd z-axis + Z3 = 11, //!< 3th z-axis + Z4 = 10 //!< 4th z-axis +}; + +//! The 6 sides +enum SIDE +{ + NOSIDEGRID = 0, + LEFT = 1 << 0, + RIGHT = 1 << 1, + CEIL = 1 << 2, + FLOOR = 1 << 3, + FRONT = 1 << 4, + BACK = 1 << 5 +}; + +//! Possible anchor points for drawing operations +enum ANCHOR +{ + BottomLeft, + BottomRight, + BottomCenter, + TopLeft, + TopRight, + TopCenter, + CenterLeft, + CenterRight, + Center +}; + + +//! Tuple [x,y] +struct QWT3D_EXPORT Tuple +{ + Tuple() : x(0), y(0) {} //!< Calls Tuple(0,0) + Tuple(double X, double Y) : x(X), y(Y) {} //!< Initialize Tuple with x and y + //! Tuple coordinates + double x,y; +}; + +//! Triple [x,y,z] +/** +Consider Triples also as vectors in R^3 +*/ +struct QWT3D_EXPORT Triple +{ + //! Initialize Triple with x,y and z + explicit Triple(double xv = 0,double yv = 0,double zv = 0) + : x(xv), y(yv), z(zv) + { + } + +#ifndef QWT3D_NOT_FOR_DOXYGEN +#ifdef Q_OS_IRIX + Triple(const Triple& val) + { + if (&val == this) + return; + x = val.x; + y = val.y; + z = val.z; + } + const Triple& operator=(const Triple& val) + { + if (&val == this) + return *this; + x = val.x; + y = val.y; + z = val.z; + return *this; + } +#endif +#endif // QWT3D_NOT_FOR_DOXYGEN + + //! Triple coordinates + double x,y,z; + + Triple& operator+=(Triple t) + { + x += t.x; + y += t.y; + z += t.z; + + return *this; + } + + Triple& operator-=(Triple t) + { + x -= t.x; + y -= t.y; + z -= t.z; + + return *this; + } + Triple& operator*=(double d) + { + x *= d; + y *= d; + z *= d; + + return *this; + } + Triple& operator/=(double d) + { + x /= d; + y /= d; + z /= d; + + return *this; + } + Triple& operator*=(Triple t) // scale + { + x *= t.x; + y *= t.y; + z *= t.z; + + return *this; + } + + bool operator!=(Triple t) const + { + return !isPracticallyZero(x,t.x) || !isPracticallyZero(y,t.y) || !isPracticallyZero(z,t.z); + } + + bool operator==(Triple t) const + { + return !operator!=(t); + } + + double length() const + { + double l2 = x*x + y*y + z*z; + return (isPracticallyZero(l2)) ? 0 :sqrt(l2); + } + + void normalize() + { + double l = length(); + if (l) + *this /= l; + } + + double operator()(unsigned int comp) + { + switch (comp) { + case 0: + return x; + case 1: + return y; + case 2: + return z; + default: + return 0; + } + } +}; + +inline const Triple operator+(const Triple& t, const Triple& t2) +{ + return Triple(t) += t2; +} +inline const Triple operator-(const Triple& t, const Triple& t2) +{ + return Triple(t) -= t2; +} +inline const Triple operator*(double d, const Triple& t) +{ + return Triple(t) *= d; +} +inline const Triple operator*(const Triple& t, double d) +{ + return Triple(t) *= d; +} +inline const Triple operator/(double d, const Triple& t) +{ + return Triple(t) /= d; +} +inline const Triple operator/(const Triple& t, double d) +{ + return Triple(t) /= d; +} +inline const Triple operator*(const Triple& t, const Triple& t2) +{ + return Triple(t) *= t2; +} + +//! Parallelepiped spanned by 2 Triples +/** +Please use \em normalized Parallelepipeds:\n\n +minVertex.x <= maxVertex.x\n +minVertex.y <= maxVertex.y\n +minVertex.z <= maxVertex.z\n +*/ +struct QWT3D_EXPORT ParallelEpiped +{ + //! Construct non-initialized Parallelepiped + ParallelEpiped() + { + } + + //! Construct initialized Parallelepiped + /** + minv -> minVertex\n + maxv -> maxVertex\n + */ + ParallelEpiped(Triple minv, Triple maxv) + : minVertex(minv), maxVertex(maxv) + { + } + + Triple minVertex; + Triple maxVertex; +}; + +//! Free vector +/** + FreeVectors represent objects like normal vectors and other vector fields inside R^3 +*/ +struct QWT3D_EXPORT FreeVector +{ + FreeVector() + { + } + + //! Construct initialized vector + /** + b -> base\n + e -> top\n + */ + FreeVector(Triple b, Triple t) + : base(b), top(t) + { + } + + Triple base; + Triple top; +}; + +//! A free vector field in R^3 +typedef std::vector FreeVectorField; + +//! A point field in R^3 +typedef std::vector TripleField; +//! Holds indices in a TripleField interpreted as counterclockwise node numbering for a convex polygon +typedef std::vector Cell; +//! Vector of convex polygons. You need a TripleField as base for the node data +typedef std::vector CellField; +//! Returns the sum over the sizes of the single cells +unsigned tesselationSize(Qwt3D::CellField const& t); + +//! Red-Green-Blue-Alpha value +struct QWT3D_EXPORT RGBA +{ + RGBA() + : r(0), g(0), b(0), a(1) + {} + RGBA(double rr, double gg, double bb, double aa = 1) + : r(rr), g(gg), b(bb), a(aa) + {} + double r,g,b,a; +}; + +//! A Color field +typedef std::vector ColorVector; + +#ifndef QWT3D_NOT_FOR_DOXYGEN + +QWT3D_EXPORT QColor GL2Qt(GLdouble r, GLdouble g, GLdouble b); //!< RGB -> QColor +QWT3D_EXPORT Qwt3D::RGBA Qt2GL(QColor col); //!< QColor -> RGBA + +typedef double *Vertex; +typedef std::vector DataRow; +typedef std::vector DataMatrix; + + +class Data +{ +public: + Qwt3D::DATATYPE datatype; + Data() {datatype= Qwt3D::POLYGON;} + virtual ~Data() {} + virtual void clear() = 0; //!< destroy content + virtual bool empty() const = 0; //!< no data + void setHull(Qwt3D::ParallelEpiped const& h) {hull_p = h;} + Qwt3D::ParallelEpiped const& hull() const {return hull_p;} + +protected: + Qwt3D::ParallelEpiped hull_p; +}; + + +//! Implements a matrix of z-Values with limit access functions +class GridData : public Data +{ +public: + GridData(); + GridData(unsigned int columns, unsigned int rows); //!< see setSize() + ~GridData() { clear();} + + int columns() const; + int rows() const; + + void clear(); //!< destroy content + bool empty() const { return vertices.empty(); } + void setSize(unsigned int columns, unsigned int rows); //!< destroys content and set new size, elements are uninitialized + + DataMatrix vertices; //!< mesh vertices + DataMatrix normals; //!< mesh normals + void setPeriodic(bool u, bool v) { uperiodic_ = u; vperiodic_ = v; } + bool uperiodic() const { return uperiodic_; } + bool vperiodic() const { return vperiodic_; } + +private: + bool uperiodic_, vperiodic_; +}; + + +//! Implements a graph-like cell structure with limit access functions +class CellData : public Data +{ +public: + CellData() { datatype=Qwt3D::POLYGON; } + ~CellData() { clear(); } + + void clear(); //!< destroy content + bool empty() const { return cells.empty(); } + + Triple const& operator()(unsigned cellnumber, unsigned vertexnumber); + + CellField cells; //!< polygon/cell mesh + TripleField nodes; + TripleField normals; //!< mesh normals +}; + +inline Triple normalizedcross(Triple const& u, Triple const& v) +{ + Triple n; + + /* compute the cross product (u x v for right-handed [ccw]) */ + n.x = u.y * v.z - u.z * v.y; + n.y = u.z * v.x - u.x * v.z; + n.z = u.x * v.y - u.y * v.x; + + /* normalize */ + double l = n.length(); + if (l) + { + n /= l; + } + else + { + n = Triple(0,0,0); + } + + return n; +} + +inline double dotProduct(Triple const& u, Triple const& v) +{ + return u.x*v.x + u.y*v.y + u.z*v.z; +} + +void convexhull2d( std::vector& idx, const std::vector& src ); + + +#endif // QWT3D_NOT_FOR_DOXYGEN + +} // ns + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_types.h' --- 3rdparty/qwtplot3d/include/qwt3d_types.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_types.h 1970-01-01 00:00:00 +0000 @@ -1,455 +0,0 @@ -#if defined(_MSC_VER) /* MSVC Compiler */ -#pragma warning ( disable : 4786 ) -#endif - -#ifndef __DATATYPES_H__ -#define __DATATYPES_H__ - -#ifdef _DEBUG - #include -#endif - -#include - -#include "qwt3d_global.h" - -#if defined(Q_WS_WIN) - #include -#endif - -#ifndef WHEEL_DELTA - #define WHEEL_DELTA 120 -#endif - -#include "qwt3d_portability.h" -#include "qwt3d_helper.h" -#include "qwt3d_openglhelper.h" - -//! Common namespace for all QwtPlot3D classes -namespace Qwt3D -{ - -const double PI = 3.14159265358979323846264338328; - -//! Plotting style -enum PLOTSTYLE -{ - NOPLOT , //!< No visible data - WIREFRAME , //!< Wireframe style - HIDDENLINE , //!< Hidden Line style - FILLED , //!< Color filled polygons w/o edges - FILLEDMESH , //!< Color filled polygons w/ separately colored edges - POINTS , //!< User defined style (used by Enrichments) - USER //!< User defined style (used by Enrichments) -}; - -//! Shading style -enum SHADINGSTYLE -{ - FLAT, //!< Flat shading (OpenGL) - GOURAUD //!< Gouraud Shading (OpenGL) -}; - -//! Style of Coordinate system -enum COORDSTYLE -{ - NOCOORD, //!< Coordinate system is not visible - BOX, //!< Boxed - FRAME //!< Frame - 3 visible axes -}; - -//! Different types of axis scales -enum SCALETYPE -{ - LINEARSCALE,//!< Linear scaling - LOG10SCALE, //!< Logarithmic scaling (base 10) - USERSCALE //!< User-defined (for extensions) -}; - -//! Plotting style for floor data (projections) -enum FLOORSTYLE -{ - NOFLOOR, //!< Empty floor - FLOORISO, //!< Isoline projections visible - FLOORDATA //!< Projected polygons visible -}; - -//! Mesh type -enum DATATYPE -{ - GRID, //!< Rectangular grid - POLYGON //!< Convex polygon -}; - -//! The 12 axes -/** -\image html axes.png -*/ -enum AXIS -{ - X1 = 0, //!< 1st x-axis - X2 = 3, //!< 2nd x-axis - X3 = 4, //!< 3th x-axis - X4 = 5, //!< 4th x-axis - Y1 = 1, //!< 1st y-axis - Y2 = 8, //!< 2nd y-axis - Y3 = 7, //!< 3th y-axis - Y4 = 6, //!< 4th y-axis - Z1 = 2, //!< 1st z-axis - Z2 = 9, //!< 2nd z-axis - Z3 = 11, //!< 3th z-axis - Z4 = 10 //!< 4th z-axis -}; - -//! The 6 sides -enum SIDE -{ - NOSIDEGRID = 0, - LEFT = 1 << 0, - RIGHT = 1 << 1, - CEIL = 1 << 2, - FLOOR = 1 << 3, - FRONT = 1 << 4, - BACK = 1 << 5 -}; - -//! Possible anchor points for drawing operations -enum ANCHOR -{ - BottomLeft, - BottomRight, - BottomCenter, - TopLeft, - TopRight, - TopCenter, - CenterLeft, - CenterRight, - Center -}; - - -//! Tuple [x,y] -struct QWT3D_EXPORT Tuple -{ - Tuple() : x(0), y(0) {} //!< Calls Tuple(0,0) - Tuple(double X, double Y) : x(X), y(Y) {} //!< Initialize Tuple with x and y - //! Tuple coordinates - double x,y; -}; - -//! Triple [x,y,z] -/** -Consider Triples also as vectors in R^3 -*/ -struct QWT3D_EXPORT Triple -{ - //! Initialize Triple with x,y and z - explicit Triple(double xv = 0,double yv = 0,double zv = 0) - : x(xv), y(yv), z(zv) - { - } - -#ifndef QWT3D_NOT_FOR_DOXYGEN -#ifdef Q_OS_IRIX - Triple(const Triple& val) - { - if (&val == this) - return; - x = val.x; - y = val.y; - z = val.z; - } - const Triple& operator=(const Triple& val) - { - if (&val == this) - return *this; - x = val.x; - y = val.y; - z = val.z; - return *this; - } -#endif -#endif // QWT3D_NOT_FOR_DOXYGEN - - //! Triple coordinates - double x,y,z; - - Triple& operator+=(Triple t) - { - x += t.x; - y += t.y; - z += t.z; - - return *this; - } - - Triple& operator-=(Triple t) - { - x -= t.x; - y -= t.y; - z -= t.z; - - return *this; - } - Triple& operator*=(double d) - { - x *= d; - y *= d; - z *= d; - - return *this; - } - Triple& operator/=(double d) - { - x /= d; - y /= d; - z /= d; - - return *this; - } - Triple& operator*=(Triple t) // scale - { - x *= t.x; - y *= t.y; - z *= t.z; - - return *this; - } - - bool operator!=(Triple t) const - { - return !isPracticallyZero(x,t.x) || !isPracticallyZero(y,t.y) || !isPracticallyZero(z,t.z); - } - - bool operator==(Triple t) const - { - return !operator!=(t); - } - - double length() const - { - double l2 = x*x + y*y + z*z; - return (isPracticallyZero(l2)) ? 0 :sqrt(l2); - } - - void normalize() - { - double l = length(); - if (l) - *this /= l; - } -}; - -inline const Triple operator+(const Triple& t, const Triple& t2) -{ - return Triple(t) += t2; -} -inline const Triple operator-(const Triple& t, const Triple& t2) -{ - return Triple(t) -= t2; -} -inline const Triple operator*(double d, const Triple& t) -{ - return Triple(t) *= d; -} -inline const Triple operator*(const Triple& t, double d) -{ - return Triple(t) *= d; -} -inline const Triple operator/(double d, const Triple& t) -{ - return Triple(t) /= d; -} -inline const Triple operator/(const Triple& t, double d) -{ - return Triple(t) /= d; -} -inline const Triple operator*(const Triple& t, const Triple& t2) -{ - return Triple(t) *= t2; -} - -//! Parallelepiped spanned by 2 Triples -/** -Please use \em normalized Parallelepipeds:\n\n -minVertex.x <= maxVertex.x\n -minVertex.y <= maxVertex.y\n -minVertex.z <= maxVertex.z\n -*/ -struct QWT3D_EXPORT ParallelEpiped -{ - //! Construct non-initialized Parallelepiped - ParallelEpiped() - { - } - - //! Construct initialized Parallelepiped - /** - minv -> minVertex\n - maxv -> maxVertex\n - */ - ParallelEpiped(Triple minv, Triple maxv) - : minVertex(minv), maxVertex(maxv) - { - } - - Triple minVertex; - Triple maxVertex; -}; - -//! Free vector -/** - FreeVectors represent objects like normal vectors and other vector fields inside R^3 -*/ -struct QWT3D_EXPORT FreeVector -{ - FreeVector() - { - } - - //! Construct initialized vector - /** - b -> base\n - e -> top\n - */ - FreeVector(Triple b, Triple t) - : base(b), top(t) - { - } - - Triple base; - Triple top; -}; - -//! A free vector field in R^3 -typedef std::vector FreeVectorField; - -//! A point field in R^3 -typedef std::vector TripleField; -//! Holds indices in a TripleField interpreted as counterclockwise node numbering for a convex polygon -typedef std::vector Cell; -//! Vector of convex polygons. You need a TripleField as base for the node data -typedef std::vector CellField; -//! Returns the sum over the sizes of the single cells -unsigned tesselationSize(Qwt3D::CellField const& t); - -//! Red-Green-Blue-Alpha value -struct QWT3D_EXPORT RGBA -{ - RGBA() - : r(0), g(0), b(0), a(1) - {} - RGBA(double rr, double gg, double bb, double aa = 1) - : r(rr), g(gg), b(bb), a(aa) - {} - double r,g,b,a; -}; - -//! A Color field -typedef std::vector ColorVector; - -#ifndef QWT3D_NOT_FOR_DOXYGEN - -QWT3D_EXPORT QColor GL2Qt(GLdouble r, GLdouble g, GLdouble b); //!< RGB -> QColor -QWT3D_EXPORT Qwt3D::RGBA Qt2GL(QColor col); //!< QColor -> RGBA - -typedef double *Vertex; -typedef std::vector DataRow; -typedef std::vector DataMatrix; - - -class Data -{ -public: - Qwt3D::DATATYPE datatype; - Data() {datatype= Qwt3D::POLYGON;} - virtual ~Data() {} - virtual void clear() = 0; //!< destroy content - virtual bool empty() const = 0; //!< no data - void setHull(Qwt3D::ParallelEpiped const& h) {hull_p = h;} - Qwt3D::ParallelEpiped const& hull() const {return hull_p;} - -protected: - Qwt3D::ParallelEpiped hull_p; -}; - - -//! Implements a matrix of z-Values with limit access functions -class GridData : public Data -{ -public: - GridData(); - GridData(unsigned int columns, unsigned int rows);//!< see setSize() - ~GridData() { clear();} - - int columns() const; - int rows() const; - - void clear(); //!< destroy content - bool empty() const { return vertices.empty();} - void setSize(unsigned int columns, unsigned int rows); //!< destroys content and set new size, elements are uninitialized - - DataMatrix vertices; //!< mesh vertices - DataMatrix normals; //!< mesh normals - void setPeriodic(bool u, bool v) {uperiodic_ = u; vperiodic_ = v;} - bool uperiodic() const {return uperiodic_;} - bool vperiodic() const {return vperiodic_;} - -private: - bool uperiodic_, vperiodic_; -}; - - -//! Implements a graph-like cell structure with limit access functions -class CellData : public Data -{ -public: - CellData() {datatype=Qwt3D::POLYGON;} - ~CellData() { clear();} - - void clear(); //!< destroy content - bool empty() const { return cells.empty();} - - Triple const& operator()(unsigned cellnumber, unsigned vertexnumber); - - CellField cells; //!< polygon/cell mesh - TripleField nodes; - TripleField normals; //!< mesh normals -}; - -inline Triple normalizedcross(Triple const& u, Triple const& v) -{ - Triple n; - - /* compute the cross product (u x v for right-handed [ccw]) */ - n.x = u.y * v.z - u.z * v.y; - n.y = u.z * v.x - u.x * v.z; - n.z = u.x * v.y - u.y * v.x; - - /* normalize */ - double l = n.length(); - if (l) - { - n /= l; - } - else - { - n = Triple(0,0,0); - } - - return n; -} - -inline double dotProduct(Triple const& u, Triple const& v) -{ - return u.x*v.x + u.y*v.y + u.z*v.z; -} - -void convexhull2d( std::vector& idx, const std::vector& src ); - - -#endif // QWT3D_NOT_FOR_DOXYGEN - -} // ns - -#endif === added file '3rdparty/qwtplot3d/include/qwt3d_volumeplot.h' --- 3rdparty/qwtplot3d/include/qwt3d_volumeplot.h 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_volumeplot.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,24 @@ +#ifndef qwt3d_volumeplot_h__2004_03_06_01_52_begin_guarded_code +#define qwt3d_volumeplot_h__2004_03_06_01_52_begin_guarded_code + +#include "qwt3d_plot.h" + +namespace Qwt3D +{ + +//! TODO +class QWT3D_EXPORT VolumePlot : public Plot3D +{ +// Q_OBJECT + +public: + VolumePlot( QWidget* parent = 0, const char* name = 0 ){} + +protected: + virtual void createData() = 0; +}; + +} // ns + + +#endif === removed file '3rdparty/qwtplot3d/include/qwt3d_volumeplot.h' --- 3rdparty/qwtplot3d/include/qwt3d_volumeplot.h 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/include/qwt3d_volumeplot.h 1970-01-01 00:00:00 +0000 @@ -1,24 +0,0 @@ -#ifndef qwt3d_volumeplot_h__2004_03_06_01_52_begin_guarded_code -#define qwt3d_volumeplot_h__2004_03_06_01_52_begin_guarded_code - -#include "qwt3d_plot.h" - -namespace Qwt3D -{ - -//! TODO -class QWT3D_EXPORT VolumePlot : public Plot3D -{ -// Q_OBJECT - -public: - VolumePlot( QWidget* parent = 0, const char* name = 0 ){} - -protected: - virtual void createData() = 0; -}; - -} // ns - - -#endif === added file '3rdparty/qwtplot3d/qwtplot3d.pri' --- 3rdparty/qwtplot3d/qwtplot3d.pri 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/qwtplot3d.pri 2010-07-21 23:21:08 +0000 @@ -0,0 +1,66 @@ +# ##################################################################### +# Automatically generated by qmake (2.01a) Tue 6. May 14:33:47 2008 +# ##################################################################### +TARGET = qwtplot3d +TEMPLATE = lib +DEPENDPATH += src \ + include \ + 3rdparty\gl2ps +INCLUDEPATH += . + +# Input +HEADERS += include/qwt3d_extglwidget.h \ + include/qwt3d_color.h \ + include/qwt3d_global.h \ + include/qwt3d_types.h \ + include/qwt3d_axis.h \ + include/qwt3d_coordsys.h \ + include/qwt3d_drawable.h \ + include/qwt3d_helper.h \ + include/qwt3d_label.h \ + include/qwt3d_openglhelper.h \ + include/qwt3d_curve.h \ + include/qwt3d_colorlegend.h \ + include/qwt3d_plot.h \ + include/qwt3d_enrichment.h \ + include/qwt3d_enrichment_std.h \ + include/qwt3d_autoscaler.h \ + include/qwt3d_autoptr.h \ + include/qwt3d_io.h \ + include/qwt3d_io_reader.h \ + include/qwt3d_scale.h \ + include/qwt3d_portability.h \ + include/qwt3d_mapping.h \ + include/qwt3d_gridmapping.h \ + include/qwt3d_parametricsurface.h \ + include/qwt3d_function.h \ + include/qwt3d_volumeplot.h \ + include/qwt3d_graphplot.h \ + include/qwt3d_multiplot.h \ + include/qwt3d_io_gl2ps.h \ + 3rdparty/gl2ps/gl2ps.h +SOURCES += src/qwt3d_extglwidget.cpp \ + src/qwt3d_axis.cpp \ + src/qwt3d_color.cpp \ + src/qwt3d_coordsys.cpp \ + src/qwt3d_drawable.cpp \ + src/qwt3d_mousekeyboard.cpp \ + src/qwt3d_movements.cpp \ + src/qwt3d_lighting.cpp \ + src/qwt3d_curve.cpp \ + src/qwt3d_colorlegend.cpp \ + src/qwt3d_plot.cpp \ + src/qwt3d_label.cpp \ + src/qwt3d_types.cpp \ + src/qwt3d_enrichment_std.cpp \ + src/qwt3d_autoscaler.cpp \ + src/qwt3d_io_reader.cpp \ + src/qwt3d_io.cpp \ + src/qwt3d_scale.cpp \ + src/qwt3d_gridmapping.cpp \ + src/qwt3d_parametricsurface.cpp \ + src/qwt3d_function.cpp \ + src/qwt3d_gridplot.cpp \ + src/qwt3d_meshplot.cpp \ + src/qwt3d_io_gl2ps.cpp \ + 3rdparty/gl2ps/gl2ps.c === removed file '3rdparty/qwtplot3d/qwtplot3d.pri' --- 3rdparty/qwtplot3d/qwtplot3d.pri 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/qwtplot3d.pri 1970-01-01 00:00:00 +0000 @@ -1,71 +0,0 @@ -#DEFINES += GL2PS_HAVE_LIBPNG - -# Comment the next line, if you have zlib on your windows system -win32:CONFIG -= zlib - -# Input -SOURCES += ../3rdparty/qwtplot3d/src/qwt3d_axis.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_color.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_coordsys.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_drawable.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_mousekeyboard.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_movements.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_lighting.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_colorlegend.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_plot.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_label.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_types.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_enrichment_std.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_autoscaler.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_io_reader.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_io.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_scale.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_gridmapping.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_parametricsurface.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_function.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_surfaceplot.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_gridplot.cpp \ - ../3rdparty/qwtplot3d/src/qwt3d_meshplot.cpp - - -HEADERS += ../3rdparty/qwtplot3d/include/qwt3d_color.h \ - ../3rdparty/qwtplot3d/include/qwt3d_global.h \ - ../3rdparty/qwtplot3d/include/qwt3d_types.h \ - ../3rdparty/qwtplot3d/include/qwt3d_axis.h \ - ../3rdparty/qwtplot3d/include/qwt3d_coordsys.h \ - ../3rdparty/qwtplot3d/include/qwt3d_drawable.h \ - ../3rdparty/qwtplot3d/include/qwt3d_helper.h \ - ../3rdparty/qwtplot3d/include/qwt3d_label.h \ - ../3rdparty/qwtplot3d/include/qwt3d_openglhelper.h \ - ../3rdparty/qwtplot3d/include/qwt3d_colorlegend.h \ - ../3rdparty/qwtplot3d/include/qwt3d_plot.h \ - ../3rdparty/qwtplot3d/include/qwt3d_enrichment.h \ - ../3rdparty/qwtplot3d/include/qwt3d_enrichment_std.h \ - ../3rdparty/qwtplot3d/include/qwt3d_autoscaler.h \ - ../3rdparty/qwtplot3d/include/qwt3d_autoptr.h \ - ../3rdparty/qwtplot3d/include/qwt3d_io.h \ - ../3rdparty/qwtplot3d/include/qwt3d_io_reader.h \ - ../3rdparty/qwtplot3d/include/qwt3d_scale.h \ - ../3rdparty/qwtplot3d/include/qwt3d_portability.h \ - ../3rdparty/qwtplot3d/include/qwt3d_mapping.h \ - ../3rdparty/qwtplot3d/include/qwt3d_gridmapping.h \ - ../3rdparty/qwtplot3d/include/qwt3d_parametricsurface.h \ - ../3rdparty/qwtplot3d/include/qwt3d_function.h \ - ../3rdparty/qwtplot3d/include/qwt3d_surfaceplot.h \ - ../3rdparty/qwtplot3d/include/qwt3d_volumeplot.h \ - ../3rdparty/qwtplot3d/include/qwt3d_graphplot.h \ - ../3rdparty/qwtplot3d/include/qwt3d_multiplot.h - -# gl2ps support -HEADERS += ../3rdparty/qwtplot3d/3rdparty/gl2ps/gl2ps.h \ - ../3rdparty/qwtplot3d/include/qwt3d_io_gl2ps.h - -SOURCES += ../3rdparty/qwtplot3d/src/qwt3d_io_gl2ps.cpp \ - ../3rdparty/qwtplot3d/3rdparty/gl2ps/gl2ps.c - -# zlib support for gl2ps -zlib { - DEFINES += GL2PS_HAVE_ZLIB - win32:LIBS += zlib.lib - unix:LIBS += -lz -} === added file '3rdparty/qwtplot3d/qwtplot3d.pro' --- 3rdparty/qwtplot3d/qwtplot3d.pro 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/qwtplot3d.pro 2010-07-21 23:21:08 +0000 @@ -0,0 +1,45 @@ +# pro file for building the makefile for qwtplot3d +# + +include (qwtplot3d.pri) + +CONFIG += qt warn_on opengl thread zlib release +MOC_DIR = tmp +OBJECTS_DIR = tmp +INCLUDEPATH = include +DEPENDPATH = include src +QT += opengl + +#win32:CONFIG += static +win32:CONFIG += dll +unix:CONFIG += staticlib +win32:CONFIG += exceptions + +win32:dll:DEFINES += QT_DLL QWT3D_DLL QWT3D_MAKEDLL +win32:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_STL + +# Comment the next line, if you have zlib on your windows system +win32:CONFIG -= zlib + +# Comment the next line, if you do not want debug message output +#DEFINES -= QT_NO_DEBUG_OUTPUT + +linux-g++:TMAKE_CXXFLAGS += -fno-exceptions +unix:VERSION = 0.3.0 + +DESTDIR = lib + +OBJECTS_DIR = $$DESTDIR/tmp +RCC_DIR = $$DESTDIR/tmp +MOC_DIR = $$DESTDIR/tmp + +# zlib support for gl2ps +zlib { + DEFINES += GL2PS_HAVE_ZLIB + win32:LIBS += zlib.lib + unix:LIBS += -lz +} + +# install +target.path = lib +INSTALLS += target === removed file '3rdparty/qwtplot3d/qwtplot3d.pro' --- 3rdparty/qwtplot3d/qwtplot3d.pro 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/qwtplot3d.pro 1970-01-01 00:00:00 +0000 @@ -1,96 +0,0 @@ -# pro file for building the makefile for qwtplot3d -# - -TARGET = qwtplot3d -TEMPLATE = lib -CONFIG += qt warn_on opengl thread zlib debug -MOC_DIR = tmp -OBJECTS_DIR = tmp -INCLUDEPATH = include -DEPENDPATH = include src -DESTDIR = lib - -QT += opengl -DEFINES += GL2PS_HAVE_LIBPNG - -win32:CONFIG += dll exceptions -win32:dll:DEFINES += QT_DLL QWT3D_DLL QWT3D_MAKEDLL -win32:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_STL - -# Comment the next line, if you have zlib on your windows system -win32:CONFIG -= zlib - -linux-g++:TMAKE_CXXFLAGS += -fno-exceptions -unix:VERSION = 0.2.7 -unix:CONFIG += staticlib - -# Input -SOURCES += src/qwt3d_axis.cpp \ - src/qwt3d_color.cpp \ - src/qwt3d_coordsys.cpp \ - src/qwt3d_drawable.cpp \ - src/qwt3d_mousekeyboard.cpp \ - src/qwt3d_movements.cpp \ - src/qwt3d_lighting.cpp \ - src/qwt3d_colorlegend.cpp \ - src/qwt3d_plot.cpp \ - src/qwt3d_label.cpp \ - src/qwt3d_types.cpp \ - src/qwt3d_enrichment_std.cpp \ - src/qwt3d_autoscaler.cpp \ - src/qwt3d_io_reader.cpp \ - src/qwt3d_io.cpp \ - src/qwt3d_scale.cpp - -SOURCES += src/qwt3d_gridmapping.cpp \ - src/qwt3d_parametricsurface.cpp \ - src/qwt3d_function.cpp - -SOURCES += src/qwt3d_surfaceplot.cpp \ - src/qwt3d_gridplot.cpp \ - src/qwt3d_meshplot.cpp - - -HEADERS += include/qwt3d_color.h \ - include/qwt3d_global.h \ - include/qwt3d_types.h \ - include/qwt3d_axis.h \ - include/qwt3d_coordsys.h \ - include/qwt3d_drawable.h \ - include/qwt3d_helper.h \ - include/qwt3d_label.h \ - include/qwt3d_openglhelper.h \ - include/qwt3d_colorlegend.h \ - include/qwt3d_plot.h \ - include/qwt3d_enrichment.h \ - include/qwt3d_enrichment_std.h \ - include/qwt3d_autoscaler.h \ - include/qwt3d_autoptr.h \ - include/qwt3d_io.h \ - include/qwt3d_io_reader.h \ - include/qwt3d_scale.h \ - include/qwt3d_portability.h - -HEADERS += include/qwt3d_mapping.h \ - include/qwt3d_gridmapping.h \ - include/qwt3d_parametricsurface.h \ - include/qwt3d_function.h - -HEADERS += include/qwt3d_surfaceplot.h \ - include/qwt3d_volumeplot.h \ - include/qwt3d_graphplot.h \ - include/qwt3d_multiplot.h - -# gl2ps support -HEADERS+=3rdparty/gl2ps/gl2ps.h \ - include/qwt3d_io_gl2ps.h - -SOURCES+=src/qwt3d_io_gl2ps.cpp \ - 3rdparty/gl2ps/gl2ps.c - -# zlib support for gl2ps -zlib { - DEFINES += GL2PS_HAVE_ZLIB - win32:LIBS += zlib.lib - unix:LIBS += -lz -} === added directory '3rdparty/qwtplot3d/src' === removed directory '3rdparty/qwtplot3d/src' === added file '3rdparty/qwtplot3d/src/qwt3d_autoscaler.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_autoscaler.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_autoscaler.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,253 @@ +#include "qwt3d_helper.h" +#include "qwt3d_autoscaler.h" + +using namespace Qwt3D; + +namespace +{ + +double floorExt( int& exponent, double x, std::vector& sortedmantissi) +{ + if (x == 0.0) + { + exponent = 0; + return 0.0; + } + + double sign = (x > 0) ? 1.0 : -1.0; + double lx = log10(fabs(x)); + exponent = (int)floor(lx); + + double fr = pow(10.0, lx - exponent); + if (fr >= 10.0) + { + fr = 1.0; + ++exponent; + } + else + { + for (int i=(int)sortedmantissi.size()-1; i>=0;--i) + { + if (fr>=sortedmantissi[i]) + { + fr = sortedmantissi[i]; + break; + } + } + } + return sign * fr; +} + +/* + \brief Find the largest value out of {1,2,5}*10^n with an integer number n + which is smaller than or equal to x + \param exponent n + \param x Input value + \return Mantissa +*/ +double floor125( int& exponent, double x) +{ + std::vector m(2); + m[0] = 1; + m[1] = 2; + m[2] = 5; + return floorExt(exponent, x, m); +} + +} // anon ns + + +//! Initializes with an {1,2,5} sequence of mantissas +LinearAutoScaler::LinearAutoScaler() +{ + init(0,1,1); + mantissi_ = std::vector(3); + mantissi_[0] = 1; + mantissi_[1] = 2; + mantissi_[2] = 5; +} +//! Initialize with interval [0,1] and one requested interval +/*! +val mantisse A increasing ordered vector of values representing +mantisse values between 1 and 9. +*/ +LinearAutoScaler::LinearAutoScaler(std::vector& mantisse) +{ + init(0,1,1); + if (mantisse.empty()) + { + mantissi_ = std::vector(3); + mantissi_[0] = 1; + mantissi_[1] = 2; + mantissi_[2] = 5; + return; + } + mantissi_ = mantisse; +} + + +//! Initialize with interval [start,stop] and number of requested intervals +/** + Switchs start and stop, if stop < start and sets intervals = 1 if ivals < 1 +*/ +void LinearAutoScaler::init(double start, double stop, int ivals) +{ + start_ = start; + stop_ = stop; + intervals_ = ivals; + + if (start_ > stop_) + { + double tmp = start_; + start_ = stop_; + stop_ = tmp; + } + if (intervals_ < 1) + intervals_ = 1; +} + +/*! +\return Anchor value + +\verbatim +|_______|____________ _ _ _ _ _____|_____________|________________ + +0 m*10^n start anchor := c*m*10^n + +c 'minimal' (anchor-start < m*10^n) +\endverbatim +*/ +double LinearAutoScaler::anchorvalue(double start, double m, int n) +{ + double stepval = m * pow(10.0, n); + return stepval * ceil(start / stepval); +} + +/*! +\return New number of intervals (:= l_intervals + r_intervals) +\param l_intervals Number of intervals left from anchor +\param r_intervals Number of intervals right from anchor + +\verbatim + -l_intervals * i -2 * i -i +r_intervals * i + | +|______|_______ _ _ _ ____|____|___ _ _ _ _ _ _ _|_______|_______|_ _ _ _ _ _ _____|__|_____ + | | | | +0 i := m*10^n start anchor stop + +c 'minimal' (anchor-start < m*10^n) +\endverbatim +*/ +int LinearAutoScaler::segments(int& l_intervals, int& r_intervals, double start, double stop, double anchor, double m, int n) +{ + double val = m * pow(10.0, n); + double delta = (stop - anchor) / val; + + r_intervals = (int)floor(delta); // right side intervals + + delta = (anchor - start) / val; + + l_intervals = (int)floor(delta); // left side intervals + + return r_intervals + l_intervals; +} + + +/*! + \brief Does the actual scaling + \return Number of intervals after rescaling. This will in the most cases differ + from the requested interval number! Always >0. + \param a Start value after scaling (always >= start) + \param b Stop value after scaling (always <= stop) + \param start Start value + \param stop Stop value + \param ivals Requested intervals + \return Number of intervals after autoscaling + + If the given interval has zero length the function returns the current + interval number and a and b remain unchanged. +*/ +int LinearAutoScaler::execute(double& a, double& b, double start, double stop, int ivals) +{ + init(start,stop,ivals); + + double delta = stop_ - start_; + + if (isPracticallyZero(delta)) + return intervals_; + + double c; + int n; + + c = floorExt(n, delta, mantissi_); + + int l_ival, r_ival; + + double anchor = anchorvalue(start_, c, n); + int ival = segments(l_ival, r_ival, start_, stop_, anchor, c, n); + + if (ival >= intervals_) + { + a = anchor - l_ival * c * pow(10.0,n); + b = anchor + r_ival * c * pow(10.0,n); + intervals_ = ival; + return intervals_; + } + + int prev_ival, prev_l_ival, prev_r_ival; + double prev_anchor; + double prev_c; + int prev_n; + + while(1) + { + prev_c = c; + prev_n = n; + prev_anchor = anchor; + prev_ival = ival; + prev_l_ival = l_ival; + prev_r_ival = r_ival; + + + if (int(c) == 1) + { + c = mantissi_.back(); + --n; + } + else + { + for (unsigned int i=mantissi_.size()-1; i>0; --i) + { + if (int(c) == mantissi_[i]) + { + c = mantissi_[i-1]; + break; + } + } + } + + anchor = anchorvalue(start_, c, n); + ival = segments(l_ival, r_ival, start_, stop_, anchor, c, n); + + int prev_diff = intervals_ - prev_ival; + int actual_diff = ival - intervals_; + + if (prev_diff >= 0 && actual_diff >= 0) + { + if (prev_diff < actual_diff) + { + c = prev_c; + n = prev_n; + anchor = prev_anchor; + ival = prev_ival; + l_ival = prev_l_ival; + r_ival = prev_r_ival; + } + a = anchor - l_ival * c * pow(10.0,n); + b = anchor + r_ival * c * pow(10.0,n); + intervals_ = ival; + break; + } + } + return intervals_; +} === removed file '3rdparty/qwtplot3d/src/qwt3d_autoscaler.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_autoscaler.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_autoscaler.cpp 1970-01-01 00:00:00 +0000 @@ -1,253 +0,0 @@ -#include "qwt3d_helper.h" -#include "qwt3d_autoscaler.h" - -using namespace Qwt3D; - -namespace -{ - -double floorExt( int& exponent, double x, std::vector& sortedmantissi) -{ - if (x == 0.0) - { - exponent = 0; - return 0.0; - } - - double sign = (x > 0) ? 1.0 : -1.0; - double lx = log10(fabs(x)); - exponent = (int)floor(lx); - - double fr = pow(10.0, lx - exponent); - if (fr >= 10.0) - { - fr = 1.0; - ++exponent; - } - else - { - for (int i=(int)sortedmantissi.size()-1; i>=0;--i) - { - if (fr>=sortedmantissi[i]) - { - fr = sortedmantissi[i]; - break; - } - } - } - return sign * fr; -} - -/* - \brief Find the largest value out of {1,2,5}*10^n with an integer number n - which is smaller than or equal to x - \param exponent n - \param x Input value - \return Mantissa -*/ -double floor125( int& exponent, double x) -{ - std::vector m(2); - m[0] = 1; - m[1] = 2; - m[2] = 5; - return floorExt(exponent, x, m); -} - -} // anon ns - - -//! Initializes with an {1,2,5} sequence of mantissas -LinearAutoScaler::LinearAutoScaler() -{ - init(0,1,1); - mantissi_ = std::vector(3); - mantissi_[0] = 1; - mantissi_[1] = 2; - mantissi_[2] = 5; -} -//! Initialize with interval [0,1] and one requested interval -/*! -val mantisse A increasing ordered vector of values representing -mantisse values between 1 and 9. -*/ -LinearAutoScaler::LinearAutoScaler(std::vector& mantisse) -{ - init(0,1,1); - if (mantisse.empty()) - { - mantissi_ = std::vector(3); - mantissi_[0] = 1; - mantissi_[1] = 2; - mantissi_[2] = 5; - return; - } - mantissi_ = mantisse; -} - - -//! Initialize with interval [start,stop] and number of requested intervals -/** - Switchs start and stop, if stop < start and sets intervals = 1 if ivals < 1 -*/ -void LinearAutoScaler::init(double start, double stop, int ivals) -{ - start_ = start; - stop_ = stop; - intervals_ = ivals; - - if (start_ > stop_) - { - double tmp = start_; - start_ = stop_; - stop_ = tmp; - } - if (intervals_ < 1) - intervals_ = 1; -} - -/*! -\return Anchor value - -\verbatim -|_______|____________ _ _ _ _ _____|_____________|________________ - -0 m*10^n start anchor := c*m*10^n - -c 'minimal' (anchor-start < m*10^n) -\endverbatim -*/ -double LinearAutoScaler::anchorvalue(double start, double m, int n) -{ - double stepval = m * pow(10.0, n); - return stepval * ceil(start / stepval); -} - -/*! -\return New number of intervals (:= l_intervals + r_intervals) -\param l_intervals Number of intervals left from anchor -\param r_intervals Number of intervals right from anchor - -\verbatim - -l_intervals * i -2 * i -i +r_intervals * i - | -|______|_______ _ _ _ ____|____|___ _ _ _ _ _ _ _|_______|_______|_ _ _ _ _ _ _____|__|_____ - | | | | -0 i := m*10^n start anchor stop - -c 'minimal' (anchor-start < m*10^n) -\endverbatim -*/ -int LinearAutoScaler::segments(int& l_intervals, int& r_intervals, double start, double stop, double anchor, double m, int n) -{ - double val = m * pow(10.0, n); - double delta = (stop - anchor) / val; - - r_intervals = (int)floor(delta); // right side intervals - - delta = (anchor - start) / val; - - l_intervals = (int)floor(delta); // left side intervals - - return r_intervals + l_intervals; -} - - -/*! - \brief Does the actual scaling - \return Number of intervals after rescaling. This will in the most cases differ - from the requested interval number! Always >0. - \param a Start value after scaling (always >= start) - \param b Stop value after scaling (always <= stop) - \param start Start value - \param stop Stop value - \param ivals Requested intervals - \return Number of intervals after autoscaling - - If the given interval has zero length the function returns the current - interval number and a and b remain unchanged. -*/ -int LinearAutoScaler::execute(double& a, double& b, double start, double stop, int ivals) -{ - init(start,stop,ivals); - - double delta = stop_ - start_; - - if (isPracticallyZero(delta)) - return intervals_; - - double c; - int n; - - c = floorExt(n, delta, mantissi_); - - int l_ival, r_ival; - - double anchor = anchorvalue(start_, c, n); - int ival = segments(l_ival, r_ival, start_, stop_, anchor, c, n); - - if (ival >= intervals_) - { - a = anchor - l_ival * c * pow(10.0,n); - b = anchor + r_ival * c * pow(10.0,n); - intervals_ = ival; - return intervals_; - } - - int prev_ival, prev_l_ival, prev_r_ival; - double prev_anchor; - double prev_c; - int prev_n; - - while(1) - { - prev_c = c; - prev_n = n; - prev_anchor = anchor; - prev_ival = ival; - prev_l_ival = l_ival; - prev_r_ival = r_ival; - - - if (int(c) == 1) - { - c = mantissi_.back(); - --n; - } - else - { - for (unsigned int i=mantissi_.size()-1; i>0; --i) - { - if (int(c) == mantissi_[i]) - { - c = mantissi_[i-1]; - break; - } - } - } - - anchor = anchorvalue(start_, c, n); - ival = segments(l_ival, r_ival, start_, stop_, anchor, c, n); - - int prev_diff = intervals_ - prev_ival; - int actual_diff = ival - intervals_; - - if (prev_diff >= 0 && actual_diff >= 0) - { - if (prev_diff < actual_diff) - { - c = prev_c; - n = prev_n; - anchor = prev_anchor; - ival = prev_ival; - l_ival = prev_l_ival; - r_ival = prev_r_ival; - } - a = anchor - l_ival * c * pow(10.0,n); - b = anchor + r_ival * c * pow(10.0,n); - intervals_ = ival; - break; - } - } - return intervals_; -} === added file '3rdparty/qwtplot3d/src/qwt3d_axis.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_axis.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_axis.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,374 @@ +#include "qwt3d_axis.h" +#include "qwt3d_plot.h" + +using namespace Qwt3D; + +Axis::Axis() +{ + init(); +}; + +Axis::~Axis() +{ +} + +Axis::Axis(Triple beg, Triple end) +{ + init(); + setPosition(beg,end); +} + +void Axis::init() +{ + detachAll(); + + scale_ = qwt3d_ptr(new LinearScale); + + beg_ = Triple(0.0, 0.0, 0.0); + end_ = beg_; + + majorintervals_ = 0; + minorintervals_ = 0; + setMajors(1); + setMinors(1); + setLimits(0,0); + + setTicOrientation(0.0, 0.0, 0.0); + setTicLength(0.0, 0.0); + setColor(0.0, 0.0, 0.0); + setLineWidth(1.0); + symtics_ = false; + drawNumbers_ = false; + drawLabel_ = false; + + drawTics_ = false; + autoscale_ = true; + markerLabel_.clear(); + numberfont_ = QFont("Courier",12); + setLabelFont(QFont("Courier",14)); + + numbercolor_ = RGBA(0,0,0,0); + + setNumberAnchor(Center); + + numbergap_ = 0; + labelgap_ = 0; + + decorate_ = true; +} + +void Axis::setPosition(const Triple& beg, const Triple& end) +{ + beg_ = beg; + end_ = end; +} + +void Axis::setMajors(int val) +{ + if (val == majorintervals_) + return; + + majorintervals_ = (val<=0) ? 1 : val; // always >= 1 +} + +/*! +\see LogScale::setMinors(). +*/ +void Axis::setMinors(int val) +{ + if (val == minorintervals_) + return; + + minorintervals_ = (val<=0) ? 1 : val; // always >= 1 +} + +void Axis::setTicLength(double majorl, double minorl) +{ + lmaj_ = majorl; + lmin_ = minorl; +} + +void Axis::setTicOrientation(double tx, double ty, double tz) +{ + setTicOrientation(Triple(tx,ty,tz)); +} + +void Axis::setTicOrientation(const Triple& val) +{ + orientation_ = val; + orientation_.normalize(); +} + +/** +\param val thickness for axis base line +\param majfac relative thickness for axis major tics (majfac*val) +\param minfac relative thickness for axis minor tics (minfac*val) +*/ +void Axis::setLineWidth(double val, double majfac, double minfac) +{ + lineWidth_ = val; + majLineWidth_ = majfac * lineWidth_; + minLineWidth_ = minfac * lineWidth_; +} + +void Axis::draw() +{ + Drawable::draw(); + + saveGLState(); + +// GLStateBewarer sb(GL_LINE_SMOOTH, true); +// glBlendFunc(GL_ONE, GL_ZERO); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4d(color.r,color.g,color.b,color.a); + + drawBase(); + + if ( decorate_ ) { + drawTics(); + drawLabel(); + } + + restoreGLState(); +} + +/** +Always use AFTER drawNumbers() ! (Needs length of number string) +*/ +void Axis::drawLabel() +{ + if (!drawLabel_) + return; + + label_.setPlot(plot()); + + double width = 0.0; + for (unsigned i = 0; i != markerLabel_.size(); i++){ + double aux = markerLabel_[i].width(); + if (aux > width) + width = aux; + } + + Triple center = begin() + (end_ - beg_)/2; + Triple ticEnd = ViewPort2World(World2ViewPort(center + ticOrientation() * lmaj_)); + + double rap = (width + labelgap_ + label_.textHeight())/(World2ViewPort(ticEnd) - World2ViewPort(center)).length(); + + Triple pos = ViewPort2World(World2ViewPort(center + ticOrientation() * lmaj_*(1 + rap))); + setLabelPosition(pos, Center); + + Triple end = World2ViewPort(end_); + Triple beg = World2ViewPort(beg_); + double angle = 360 - fabs(QLineF(beg.x, beg.y, end.x, end.y).angle()); + + int ax = 0; + Qwt3D::CoordinateSystem *coords = plot()->coordinates(); + for (int i = 0; i < (int)coords->axes.size(); i++){ + Qwt3D::Axis axis = coords->axes[i]; + if (axis.begin() == beg_ && axis.end() == end_){ + ax = i; + break; + } + } + + if (ax != Qwt3D::Z1 && ax != Qwt3D::Z2 && ax != Qwt3D::Z3 && ax != Qwt3D::Z4){ + if (angle > 90 && angle < 180) + angle += 180; + if (angle > 180 && angle < 270) + angle -= 180; + } + + label_.draw(angle); +} + +void Axis::drawBase() +{ + setDeviceLineWidth( lineWidth_ ); + glBegin( GL_LINES ); + glVertex3d( beg_.x, beg_.y, beg_.z); + glVertex3d( end_.x, end_.y, end_.z); + glEnd(); +} + +bool Axis::prepTicCalculation(Triple& startpoint) +{ + if (isPracticallyZero(start_, stop_)) + return false; + + autostart_ = start_; + autostop_ = stop_; + + if (autoScale()) { + setMajors(scale_->autoscale(autostart_, autostop_, start_, stop_, majors())); + if (isPracticallyZero(autostart_, autostop_)) + return false; + } + + scale_->setLimits(start_,stop_); + scale_->setMajors(majors()); + scale_->setMinors(minors()); + scale_->setMajorLimits(autostart_,autostop_); + scale_->calculate(); + + Triple normal = (end_ - beg_); + //normal.normalize(); + //Triple beg = beg_ + ((autostart_ - start_) / (stop_ - start_)) * normal; + //Triple end = end_ - ((stop_ - autostop_) / (stop_ - start_))* normal; + + startpoint = end_ - beg_; + + majorpos_.clear(); + minorpos_.clear(); + + return true; +} + +void Axis::recalculateTics() +{ + Triple runningpoint; + if (false==prepTicCalculation(runningpoint)) + return; + + unsigned int i; + + for (i = 0; i != scale_->majors_p.size(); ++i) { + double t = (scale_->majors_p[i] - start_) / (stop_-start_); + majorpos_.push_back(beg_ + t * runningpoint); + } + for (i = 0; i != scale_->minors_p.size(); ++i) { + double t = (scale_->minors_p[i] - start_) / (stop_-start_); + minorpos_.push_back(beg_ + t * runningpoint); + } +} + +void Axis::drawTics() +{ + Triple runningpoint; + if (!drawTics_ || false==prepTicCalculation(runningpoint)) + return; + + unsigned int i; + Triple nadir; + + markerLabel_.resize(scale_->majors_p.size()); + setDeviceLineWidth(majLineWidth_); + for (i = 0; i != scale_->majors_p.size(); ++i) { + double t = (scale_->majors_p[i] - start_) / (stop_-start_); + nadir = beg_ + t * runningpoint; + majorpos_.push_back(drawTic(nadir, lmaj_)); + drawTicLabel(nadir + 1.2 * lmaj_ * orientation_, i); + } + + setDeviceLineWidth(minLineWidth_); + for (i = 0; i != scale_->minors_p.size(); ++i) { + double t = (scale_->minors_p[i] - start_) / (stop_-start_); + nadir = beg_ + t * runningpoint; + minorpos_.push_back(drawTic(nadir, lmin_)); + } +} + +void Axis::drawTicLabel(Triple pos, int mtic) +{ + if (!drawNumbers_ || (mtic < 0)) + return; + + markerLabel_[mtic].setFont(numberfont_.family(), numberfont_.pointSize(), numberfont_.weight(), numberfont_.italic()); + markerLabel_[mtic].setColor(numbercolor_); + markerLabel_[mtic].setString(scale_->ticLabel(mtic)); + markerLabel_[mtic].setPosition(pos, scaleNumberAnchor_); + markerLabel_[mtic].setPlot(plot()); + markerLabel_[mtic].adjust(numbergap_); + markerLabel_[mtic].draw(); +} + +Triple Axis::drawTic(Triple nadir, double length) +{ + double ilength = (symtics_) ? -length : 0.0; + + glBegin( GL_LINES ); + glColor4d(color.r,color.g,color.b,color.a); + glVertex3d( nadir.x + ilength * orientation_.x, + nadir.y + ilength * orientation_.y, + nadir.z + ilength * orientation_.z) ; + glVertex3d( nadir.x + length * orientation_.x, + nadir.y + length * orientation_.y, + nadir.z + length * orientation_.z); + glEnd(); + return nadir; +} + +void Axis::setNumberFont(QString const& family, int pointSize, int weight, bool italic) +{ + numberfont_ = QFont(family, pointSize, weight, italic ); +} + +void Axis::setNumberFont(QFont const& font) +{ + numberfont_ = font; +} + +void Axis::setNumberColor(RGBA col) +{ + numbercolor_ = col; +} + +void Axis::setLabelFont(QString const& family, int pointSize, int weight, bool italic) +{ + labelfont_ = QFont(family, pointSize, weight, italic ); + label_.setFont(family, pointSize, weight, italic); +} + +void Axis::setLabelFont(QFont const& font) +{ + setLabelFont(font.family(), font.pointSize(), font.weight(), font.italic()); +} + +void Axis::setLabelString(QString const& name) +{ + label_.setString(name); +} + +/*! + Sets label position in conjunction with an anchoring strategy +*/ +void Axis::setLabelPosition(const Triple& pos,Qwt3D::ANCHOR an) +{ + label_.setPosition(pos, an); +} + +//! Sets color for label +void Axis::setLabelColor(RGBA col) +{ + label_.setColor(col); +} + +/*! + This variant sets a user-defined scale object. + Use with a heap based initialized pointer only. + The axis adopts ownership. +*/ +void Axis::setScale(Scale* val) +{ + scale_ = qwt3d_ptr(val); +} + +/*! + Sets one of the predefined scaling types. + \warning Too small intervals in logarithmic scales lead to + empty scales (or perhaps a scale only containing an isolated + major tic). Better switch to linear scales in such cases. +*/ +void Axis::setScale(Qwt3D::SCALETYPE val) +{ + switch(val) { + case Qwt3D::LINEARSCALE: + setScale(new LinearScale); + break; + case Qwt3D::LOG10SCALE: + setScale(new LogScale); + setMinors(9); + break; + default: + break; + } +} === removed file '3rdparty/qwtplot3d/src/qwt3d_axis.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_axis.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_axis.cpp 1970-01-01 00:00:00 +0000 @@ -1,359 +0,0 @@ -#include "qwt3d_axis.h" -#include "qwt3d_plot.h" - -#include -#include - -using namespace Qwt3D; - -Axis::Axis() -{ - init(); -}; - -Axis::~Axis() -{ -} - -Axis::Axis(Triple beg, Triple end) -{ - init(); - setPosition(beg,end); -} - -void Axis::init() -{ - detachAll(); - - scale_ = qwt3d_ptr(new LinearScale); - - beg_ = Triple(0.0, 0.0, 0.0); - end_ = beg_; - - majorintervals_ = 0; - minorintervals_ = 0; - setMajors(1); - setMinors(1); - setLimits(0,0); - - setTicOrientation(0.0, 0.0, 0.0); - setTicLength(0.0, 0.0); - setColor(0.0, 0.0, 0.0); - setLineWidth(1.0); - symtics_ = false; - drawNumbers_ = false; - drawLabel_ = false; - - drawTics_ = false; - autoscale_ = true; - markerLabel_.clear(); - numberfont_ = QFont("Courier",12); - setLabelFont(QFont("Courier",14)); - - numbercolor_ = RGBA(0,0,0,0); - - setNumberAnchor(Center); - - numbergap_ = 0; - labelgap_ = 0; -} - -void Axis::setPosition(const Triple& beg, const Triple& end) -{ - beg_ = beg; - end_ = end; -} - -void Axis::setMajors(int val) -{ - if (val == majorintervals_) - return; - - majorintervals_ = (val<=0) ? 1 : val; // always >= 1 -} - -/*! -\see LogScale::setMinors(). -*/ -void Axis::setMinors(int val) -{ - if (val == minorintervals_) - return; - - minorintervals_ = (val<=0) ? 1 : val; // always >= 1 -} - -void Axis::setTicLength(double majorl, double minorl) -{ - lmaj_ = majorl; - lmin_ = minorl; -} - -void Axis::setTicOrientation(double tx, double ty, double tz) -{ - setTicOrientation(Triple(tx,ty,tz)); -} - -void Axis::setTicOrientation(const Triple& val) -{ - orientation_ = val; - orientation_.normalize(); -} - -/** -\param val thickness for axis base line -\param majfac relative thickness for axis major tics (majfac*val) -\param minfac relative thickness for axis minor tics (minfac*val) -*/ -void Axis::setLineWidth(double val, double majfac, double minfac) -{ - lineWidth_ = val; - majLineWidth_ = majfac * lineWidth_; - minLineWidth_ = minfac * lineWidth_; -} - -void Axis::draw() -{ - Drawable::draw(); - - saveGLState(); - -// GLStateBewarer sb(GL_LINE_SMOOTH, true); -// glBlendFunc(GL_ONE, GL_ZERO); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glColor4d(color.r,color.g,color.b,color.a); - - drawBase(); - drawTics(); - drawLabel(); - restoreGLState(); -} - -/** -Always use AFTER drawNumbers() ! (Needs length of number string) -*/ -void Axis::drawLabel() -{ - if (!drawLabel_) - return; - - label_.setPlot(plot()); - - double width = 0.0; - for (unsigned i = 0; i != markerLabel_.size(); i++){ - double aux = markerLabel_[i].width(); - if (aux > width) - width = aux; - } - - Triple center = begin() + (end_ - beg_)/2; - Triple ticEnd = ViewPort2World(World2ViewPort(center + ticOrientation() * lmaj_)); - - double rap = (width + labelgap_ + label_.textHeight())/(World2ViewPort(ticEnd) - World2ViewPort(center)).length(); - - Triple pos = ViewPort2World(World2ViewPort(center + ticOrientation() * lmaj_*(1 + rap))); - setLabelPosition(pos, Center); - - Triple end = World2ViewPort(end_); - Triple beg = World2ViewPort(beg_); - double angle = 360 - fabs(QLineF(beg.x, beg.y, end.x, end.y).angle()); - - label_.draw(angle); -} - -void Axis::drawBase() -{ - setDeviceLineWidth( lineWidth_ ); - glBegin( GL_LINES ); - glVertex3d( beg_.x, beg_.y, beg_.z); - glVertex3d( end_.x, end_.y, end_.z); - glEnd(); -} - -bool Axis::prepTicCalculation(Triple& startpoint) -{ - if (isPracticallyZero(start_, stop_)) - return false; - - autostart_ = start_; - autostop_ = stop_; - - if (autoScale()) - { - setMajors(scale_->autoscale(autostart_, autostop_, start_, stop_, majors())); - if (isPracticallyZero(autostart_, autostop_)) - return false; - } - - scale_->setLimits(start_,stop_); - scale_->setMajors(majors()); - scale_->setMinors(minors()); - scale_->setMajorLimits(autostart_,autostop_); - scale_->calculate(); - - Triple normal = (end_ - beg_); - //normal.normalize(); - Triple beg = beg_ + ((autostart_ - start_) / (stop_ - start_)) * normal; - Triple end = end_ - ((stop_ - autostop_) / (stop_ - start_))* normal; - - startpoint = end_ - beg_; - - majorpos_.clear(); - minorpos_.clear(); - - return true; -} - -void Axis::recalculateTics() -{ - Triple runningpoint; - if (false==prepTicCalculation(runningpoint)) - return; - - unsigned int i; - - for (i = 0; i != scale_->majors_p.size(); ++i) - { - double t = (scale_->majors_p[i] - start_) / (stop_-start_); - majorpos_.push_back(beg_ + t * runningpoint); - } - for (i = 0; i != scale_->minors_p.size(); ++i) - { - double t = (scale_->minors_p[i] - start_) / (stop_-start_); - minorpos_.push_back(beg_ + t * runningpoint); - } -} - -void Axis::drawTics() -{ - Triple runningpoint; - if (!drawTics_ || false == prepTicCalculation(runningpoint)) - return; - - unsigned int i; - Triple nadir; - - markerLabel_.resize(scale_->majors_p.size()); - setDeviceLineWidth(majLineWidth_); - for (i = 0; i != scale_->majors_p.size(); ++i) - { - double t = (scale_->majors_p[i] - start_) / (stop_-start_); - nadir = beg_ + t * runningpoint; - majorpos_.push_back(drawTic(nadir, lmaj_)); - drawTicLabel(nadir + 1.2 * lmaj_ * orientation_, i); - } - - setDeviceLineWidth(minLineWidth_); - for (i = 0; i != scale_->minors_p.size(); ++i) - { - double t = (scale_->minors_p[i] - start_) / (stop_-start_); - nadir = beg_ + t * runningpoint; - minorpos_.push_back(drawTic(nadir, lmin_)); - } -} - -void Axis::drawTicLabel(Triple pos, int mtic) -{ - if (!drawNumbers_ || (mtic < 0)) - return; - - markerLabel_[mtic].setFont(numberfont_.family(), numberfont_.pointSize(), numberfont_.weight(), numberfont_.italic()); - markerLabel_[mtic].setColor(numbercolor_); - markerLabel_[mtic].setString(plot()->locale().toString(scale_->ticValue(mtic))); - markerLabel_[mtic].setPosition(pos, scaleNumberAnchor_); - markerLabel_[mtic].setPlot(plot()); - markerLabel_[mtic].adjust(numbergap_); - markerLabel_[mtic].draw(); -} - -Triple Axis::drawTic(Triple nadir, double length) -{ - double ilength = (symtics_) ? -length : 0.0; - - glBegin( GL_LINES ); - glColor4d(color.r,color.g,color.b,color.a); - glVertex3d( nadir.x + ilength * orientation_.x, - nadir.y + ilength * orientation_.y, - nadir.z + ilength * orientation_.z) ; - glVertex3d( nadir.x + length * orientation_.x, - nadir.y + length * orientation_.y, - nadir.z + length * orientation_.z); - glEnd(); - return nadir; -} - -void Axis::setNumberFont(QString const& family, int pointSize, int weight, bool italic) -{ - numberfont_ = QFont(family, pointSize, weight, italic ); -} - -void Axis::setNumberFont(QFont const& font) -{ - numberfont_ = font; -} - -void Axis::setNumberColor(RGBA col) -{ - numbercolor_ = col; -} - -void Axis::setLabelFont(QString const& family, int pointSize, int weight, bool italic) -{ - labelfont_ = QFont(family, pointSize, weight, italic ); - label_.setFont(family, pointSize, weight, italic); -} - -void Axis::setLabelFont(QFont const& font) -{ - setLabelFont(font.family(), font.pointSize(), font.weight(), font.italic()); -} - -void Axis::setLabelString(QString const& name) -{ - label_.setString(name); -} - -/*! - Sets label position in conjunction with an anchoring strategy -*/ -void Axis::setLabelPosition(const Triple& pos,Qwt3D::ANCHOR an) -{ - label_.setPosition(pos, an); -} - -//! Sets color for label -void Axis::setLabelColor(RGBA col) -{ - label_.setColor(col); -} - -/*! - This variant sets a user-defined scale object. - Use with a heap based initialized pointer only. - The axis adopts ownership. -*/ -void Axis::setScale(Scale* val) -{ - scale_ = qwt3d_ptr(val); -} - -/*! - Sets one of the predefined scaling types. - \warning Too small intervals in logarithmic scales lead to - empty scales (or perhaps a scale only containing an isolated - major tic). Better switch to linear scales in such cases. -*/ -void Axis::setScale(Qwt3D::SCALETYPE val) -{ - switch(val) { - case Qwt3D::LINEARSCALE: - setScale(new LinearScale); - break; - case Qwt3D::LOG10SCALE: - setScale(new LogScale); - setMinors(9); - break; - default: - break; - } -} === added file '3rdparty/qwtplot3d/src/qwt3d_color.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_color.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_color.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,63 @@ +#include "qwt3d_color.h" +#include "qwt3d_curve.h" + +using namespace Qwt3D; + +StandardColor::StandardColor(Curve* data, unsigned size) + : data_(data) +{ + Q_ASSERT(data_); + + reset(size); +} + +void StandardColor::reset(unsigned size) +{ + colors_ = ColorVector(size); + RGBA elem; + + double dsize = size; + + for (unsigned int i=0; i!=size; ++i) + { + elem.r = i / dsize; + elem.g = i / dsize / 4; + elem.b = 1 - i/dsize; + elem.a = 1.0; + colors_[i] = elem; + } +} + +/** + Assigns a new ColorVector (Also overwrites the constructors size argument) +*/ +void StandardColor::setColorVector(ColorVector const& cv) +{ + colors_ = cv; +} + +void StandardColor::setAlpha(double a) +{ + if (a<0 || a>1) + return; + + RGBA elem; + + for (unsigned int i=0; i!=colors_.size(); ++i) + { + elem = colors_[i]; + elem.a = a; + colors_[i] = elem; + } +} + +RGBA StandardColor::operator()(double, double, double z) const +{ + Q_ASSERT(data_); + int index = (int)((colors_.size()-1) * (z - data_->hull().minVertex.z) / (data_->hull().maxVertex.z-data_->hull().minVertex.z)); + if (index < 0) + index = 0; + if ((unsigned int)index > colors_.size() - 1) + index = (int)(colors_.size() - 1); + return colors_[index]; +} === removed file '3rdparty/qwtplot3d/src/qwt3d_color.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_color.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_color.cpp 1970-01-01 00:00:00 +0000 @@ -1,63 +0,0 @@ -#include "qwt3d_color.h" -#include "qwt3d_plot.h" - -using namespace Qwt3D; - -StandardColor::StandardColor(Plot3D* data, unsigned size) - : data_(data) -{ - Q_ASSERT(data_); - - reset(size); -} - -void StandardColor::reset(unsigned size) -{ - colors_ = ColorVector(size); - RGBA elem; - - double dsize = size; - - for (unsigned int i=0; i!=size; ++i) - { - elem.r = i / dsize; - elem.g = i / dsize / 4; - elem.b = 1 - i/dsize; - elem.a = 1.0; - colors_[i] = elem; - } -} - -/** - Assigns a new ColorVector (Also overwrites the constructors size argument) -*/ -void StandardColor::setColorVector(ColorVector const& cv) -{ - colors_ = cv; -} - -void StandardColor::setAlpha(double a) -{ - if (a<0 || a>1) - return; - - RGBA elem; - - for (unsigned int i=0; i!=colors_.size(); ++i) - { - elem = colors_[i]; - elem.a = a; - colors_[i] = elem; - } -} - -RGBA StandardColor::operator()(double, double, double z) const -{ - Q_ASSERT(data_); - int index = (int)((colors_.size() - 1) * (z - data_->hull().minVertex.z) / (data_->hull().maxVertex.z-data_->hull().minVertex.z)); - if (index < 0) - index = 0; - if ((unsigned int)index > colors_.size() - 1) - index = (int)(colors_.size() - 1); - return colors_[index]; -} === added file '3rdparty/qwtplot3d/src/qwt3d_colorlegend.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_colorlegend.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_colorlegend.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,230 @@ +#if defined(_MSC_VER) /* MSVC Compiler */ +#pragma warning ( disable : 4305 ) +#endif + +#include "qwt3d_colorlegend.h" + +using namespace Qwt3D; + +/** +Contructs a legend object with an axis at the left +side. The legend resides in the top-right area +and has no caption. Scale numbering is shown. +*/ +ColorLegend::ColorLegend() +{ + axis_.setNumbers(true); + axis_.setScaling(true); + axis_.setNumberColor(RGBA(0,0,0,1)); + axis_.setNumberAnchor(CenterRight); + axis_.setNumberFont(QFont("Courier",8)); + + caption_.setFont("Courier", 10, QFont::Bold); + caption_.setColor(RGBA(0,0,0,1)); + axisposition_ = ColorLegend::Left; + orientation_ = ColorLegend::BottomTop; + showaxis_ = true; + setRelPosition(Tuple(0.94, 1-0.36),Tuple(0.97, 1-0.04)); +} + +void ColorLegend::setTitleString(QString const& s) +{ + caption_.setString(s); +} + +void ColorLegend::setTitleFont(QString const& family, int pointSize, int weight, bool italic) +{ + caption_.setFont(family, pointSize, weight, italic); +} + +void ColorLegend::setLimits(double start, double stop) +{ + axis_.setLimits(start, stop); +} + +void ColorLegend::setMajors(int majors) +{ + axis_.setMajors(majors); +} + +void ColorLegend::setMinors(int minors) +{ + axis_.setMinors(minors); +} + +void ColorLegend::setAutoScale(bool val) +{ + axis_.setAutoScale(val); +} + +void ColorLegend::setScale(SCALETYPE val) +{ + axis_.setScale(val); +} + +void ColorLegend::setScale(Scale* val) +{ + axis_.setScale(val); +} + + +void ColorLegend::setOrientation(ORIENTATION orientation, SCALEPOSITION pos) +{ + orientation_ = orientation; + axisposition_ = pos; + + if (orientation_==BottomTop) + { + if (axisposition_ == Bottom || axisposition_ == Top) + axisposition_ = Left; + } + else + { + if (axisposition_ == Left || axisposition_ == Right) + axisposition_ = Bottom; + } +} + +void ColorLegend::setRelPosition(Tuple relMin, Tuple relMax) +{ + relMin_ = relMin; + relMax_ = relMax; +} + +void ColorLegend::setGeometryInternal() +{ + double ot = .99; + + getMatrices(modelMatrix, projMatrix, viewport); + pe_.minVertex = relativePosition(Triple(relMin_.x, relMin_.y, ot)); + pe_.maxVertex = relativePosition(Triple(relMax_.x, relMax_.y, ot)); + + double diff = 0; + Triple b; + Triple e; + + switch (axisposition_) + { + case ColorLegend::Left: + b = pe_.minVertex; + e = pe_.maxVertex; e.x = b.x; + axis_.setTicOrientation(-1,0,0); + axis_.setNumberAnchor(CenterRight); + diff = pe_.maxVertex.x - pe_.minVertex.x; + break; + case ColorLegend::Right: + e = pe_.maxVertex; + b = pe_.minVertex; b.x = e.x; + axis_.setTicOrientation(+1,0,0); + axis_.setNumberAnchor(CenterLeft); + diff = pe_.maxVertex.x - pe_.minVertex.x; + break; + case ColorLegend::Top: + e = pe_.maxVertex; + b = pe_.minVertex; b.z = e.z; + axis_.setTicOrientation(0,0,+1); + axis_.setNumberAnchor(BottomCenter); + diff = pe_.maxVertex.z - pe_.minVertex.z; + break; + case ColorLegend::Bottom: + b = pe_.minVertex; + e = pe_.maxVertex; e.z = b.z; + axis_.setTicOrientation(0,0,-1); + axis_.setNumberAnchor(TopCenter); + diff = pe_.maxVertex.z - pe_.minVertex.z; + break; + default: + break; + } + + axis_.setPosition(b,e); + diff /= 10; + + axis_.setTicLength(diff, 0.6*diff); + + Triple c; + c.x = pe_.minVertex.x + ((pe_.maxVertex-pe_.minVertex) / 2).x; + c.z = pe_.maxVertex.z; + c.z += (pe_.maxVertex.z-pe_.minVertex.z)/20; + c.y = pe_.maxVertex.y; + + caption_.setPosition(c, BottomCenter); +} + +void ColorLegend::draw() +{ + if (colors.empty()) + return; + + setGeometryInternal(); + + saveGLState(); + + Triple one = pe_.minVertex; + Triple two = pe_.maxVertex; + + double h = (orientation_ == ColorLegend::BottomTop) + ? (two-one).z / colors.size() + : (two-one).x / colors.size(); + + //glEnable(GL_DEPTH_TEST); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + GLStateBewarer(GL_POLYGON_OFFSET_FILL,true); +// glPolygonOffset(0.0, 0.0); + + glColor4d(0, 0, 0, 1); + glBegin(GL_LINE_LOOP); + glVertex3d(one.x, one.y, one.z); + glVertex3d(one.x, one.y, two.z); + glVertex3d(two.x, one.y, two.z); + glVertex3d(two.x, one.y, one.z); + glEnd(); + + + unsigned size = colors.size(); + RGBA rgb; + + if (orientation_ == ColorLegend::BottomTop) + { + for (unsigned i=1; i<=size; ++i) + { + rgb = colors[i-1]; + glColor4d(rgb.r,rgb.g,rgb.b,rgb.a); + glBegin( GL_POLYGON ); + glVertex3d( one.x, one.y, one.z+(i-1)*h ); + glVertex3d( one.x, one.y, one.z+i*h ); + glVertex3d( two.x, one.y, one.z+i*h ); + glVertex3d( two.x, one.y, one.z+(i-1)*h ); + glEnd(); + } + } + else + { + for (unsigned i=1; i<=size; ++i) + { + rgb = colors[i-1]; + glColor4d(rgb.r,rgb.g,rgb.b,rgb.a); + glBegin( GL_POLYGON ); + glVertex3d( one.x+(i-1)*h, one.y, one.z ); + glVertex3d( one.x+i*h, one.y, one.z ); + glVertex3d( one.x+i*h, one.y, two.z ); + glVertex3d( one.x+(i-1)*h, one.y, two.z ); + glEnd(); + } + } + + restoreGLState(); + + if (showaxis_) + axis_.draw(); + + caption_.draw(); +} + +void ColorLegend::setPlot(Plot3D *plot) +{ + d_plot = plot; + axis_.setPlot(plot); + caption_.setPlot(plot); +} === removed file '3rdparty/qwtplot3d/src/qwt3d_colorlegend.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_colorlegend.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_colorlegend.cpp 1970-01-01 00:00:00 +0000 @@ -1,229 +0,0 @@ -#if defined(_MSC_VER) /* MSVC Compiler */ -#pragma warning ( disable : 4305 ) -#endif - -#include "qwt3d_colorlegend.h" - -using namespace Qwt3D; - -/** -Contructs a legend object with an axis at the left -side. The legend resides in the top-right area -and has no caption. Scale numbering is shown. -*/ -ColorLegend::ColorLegend() -{ - axis_.setNumbers(true); - axis_.setScaling(true); - axis_.setNumberColor(RGBA(0,0,0,1)); - axis_.setNumberAnchor(CenterRight); - axis_.setNumberFont(QFont("Courier",8)); - - caption_.setFont("Courier", 10, QFont::Bold); - caption_.setColor(RGBA(0,0,0,1)); - axisposition_ = ColorLegend::Left; - orientation_ = ColorLegend::BottomTop; - showaxis_ = true; - setRelPosition(Tuple(0.94, 1-0.36),Tuple(0.97, 1-0.04)); -} - -void ColorLegend::setTitleString(QString const& s) -{ - caption_.setString(s); -} - -void ColorLegend::setTitleFont(QString const& family, int pointSize, int weight, bool italic) -{ - caption_.setFont(family, pointSize, weight, italic); -} - -void ColorLegend::setLimits(double start, double stop) -{ - axis_.setLimits(start, stop); -} - -void ColorLegend::setMajors(int majors) -{ - axis_.setMajors(majors); -} - -void ColorLegend::setMinors(int minors) -{ - axis_.setMinors(minors); -} - -void ColorLegend::setAutoScale(bool val) -{ - axis_.setAutoScale(val); -} - -void ColorLegend::setScale(SCALETYPE val) -{ - axis_.setScale(val); -} - -void ColorLegend::setScale(Scale* val) -{ - axis_.setScale(val); -} - - -void ColorLegend::setOrientation(ORIENTATION orientation, SCALEPOSITION pos) -{ - orientation_ = orientation; - axisposition_ = pos; - - if (orientation_==BottomTop) - { - if (axisposition_ == Bottom || axisposition_ == Top) - axisposition_ = Left; - } - else - { - if (axisposition_ == Left || axisposition_ == Right) - axisposition_ = Bottom; - } -} - -void ColorLegend::setRelPosition(Tuple relMin, Tuple relMax) -{ - relMin_ = relMin; - relMax_ = relMax; -} - -void ColorLegend::setGeometryInternal() -{ - double ot = .99; - - getMatrices(modelMatrix, projMatrix, viewport); - pe_.minVertex = relativePosition(Triple(relMin_.x, relMin_.y, ot)); - pe_.maxVertex = relativePosition(Triple(relMax_.x, relMax_.y, ot)); - - double diff = 0; - Triple b; - Triple e; - - switch (axisposition_) - { - case ColorLegend::Left: - b = pe_.minVertex; - e = pe_.maxVertex; e.x = b.x; - axis_.setTicOrientation(-1,0,0); - axis_.setNumberAnchor(CenterRight); - diff = pe_.maxVertex.x - pe_.minVertex.x; - break; - case ColorLegend::Right: - e = pe_.maxVertex; - b = pe_.minVertex; b.x = e.x; - axis_.setTicOrientation(+1,0,0); - axis_.setNumberAnchor(CenterLeft); - diff = pe_.maxVertex.x - pe_.minVertex.x; - break; - case ColorLegend::Top: - e = pe_.maxVertex; - b = pe_.minVertex; b.z = e.z; - axis_.setTicOrientation(0,0,+1); - axis_.setNumberAnchor(BottomCenter); - diff = pe_.maxVertex.z - pe_.minVertex.z; - break; - case ColorLegend::Bottom: - b = pe_.minVertex; - e = pe_.maxVertex; e.z = b.z; - axis_.setTicOrientation(0,0,-1); - axis_.setNumberAnchor(TopCenter); - diff = pe_.maxVertex.z - pe_.minVertex.z; - break; - default: - break; - } - - axis_.setPosition(b,e); - diff /= 10; - - axis_.setTicLength(diff, 0.6*diff); - - Triple c; - c.x = pe_.minVertex.x + ((pe_.maxVertex-pe_.minVertex) / 2).x; - c.z = pe_.maxVertex.z; - c.z += (pe_.maxVertex.z-pe_.minVertex.z)/20; - c.y = pe_.maxVertex.y; - - caption_.setPosition(c, BottomCenter); -} - -void ColorLegend::draw() -{ - if (colors.empty()) - return; - - setGeometryInternal(); - - saveGLState(); - - Triple one = pe_.minVertex; - Triple two = pe_.maxVertex; - - double h = (orientation_ == ColorLegend::BottomTop) - ? (two-one).z / colors.size() : (two-one).x / colors.size(); - - //glEnable(GL_DEPTH_TEST); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - GLStateBewarer(GL_POLYGON_OFFSET_FILL,true); -// glPolygonOffset(0.0, 0.0); - - glColor4d(0, 0, 0, 1); - glBegin(GL_LINE_LOOP); - glVertex3d(one.x, one.y, one.z); - glVertex3d(one.x, one.y, two.z); - glVertex3d(two.x, one.y, two.z); - glVertex3d(two.x, one.y, one.z); - glEnd(); - - - unsigned size = colors.size(); - RGBA rgb; - - if (orientation_ == ColorLegend::BottomTop) - { - for (unsigned i=1; i<=size; ++i) - { - rgb = colors[i-1]; - glColor4d(rgb.r,rgb.g,rgb.b,rgb.a); - glBegin( GL_POLYGON ); - glVertex3d( one.x, one.y, one.z+(i-1)*h ); - glVertex3d( one.x, one.y, one.z+i*h ); - glVertex3d( two.x, one.y, one.z+i*h ); - glVertex3d( two.x, one.y, one.z+(i-1)*h ); - glEnd(); - } - } - else - { - for (unsigned i=1; i<=size; ++i) - { - rgb = colors[i-1]; - glColor4d(rgb.r,rgb.g,rgb.b,rgb.a); - glBegin( GL_POLYGON ); - glVertex3d( one.x+(i-1)*h, one.y, one.z ); - glVertex3d( one.x+i*h, one.y, one.z ); - glVertex3d( one.x+i*h, one.y, two.z ); - glVertex3d( one.x+(i-1)*h, one.y, two.z ); - glEnd(); - } - } - - restoreGLState(); - - if (showaxis_) - axis_.draw(); - - caption_.draw(); -} - -void ColorLegend::setPlot(Plot3D *plot) -{ - d_plot = plot; - axis_.setPlot(plot); - caption_.setPlot(plot); -} === added file '3rdparty/qwtplot3d/src/qwt3d_coordsys.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_coordsys.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_coordsys.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,727 @@ +#include "qwt3d_coordsys.h" + +using namespace std; +using namespace Qwt3D; + + +CoordinateSystem::CoordinateSystem(Triple first, Triple second, COORDSTYLE st) +{ + autodecoration_ = true; + axes = std::vector(12); + setStyle(st); + setLineSmooth(true); + init(first,second); + + setAxesColor(RGBA(0,0,0,1)); + setGridLinesColor(RGBA(0.2,0.2,0.2,1)); + setNumberFont("Courier", 12); + setNumberColor(RGBA(0,0,0)); + setLabelFont("Courier", 14, QFont::Bold); + setGridLines(false, false); +} + +CoordinateSystem::~CoordinateSystem() +{ + destroy(); +} + +void CoordinateSystem::destroy() +{ + for (unsigned i=0; i!=axes.size(); ++i) + axes[i].setLabelString(""); + + detachAll(); +} + +void CoordinateSystem::init(Triple first, Triple second) +{ + destroy(); + + for (unsigned i=0; i!=axes.size(); ++i) + axes[i].setScale(LINEARSCALE); + + Triple dv = second - first; + + setPosition(first, second); + + double majl = dv.length() / 100; // 1 % + setTicLength(majl, 0.6 * majl); + + axes[X1].setPosition(first, first+Triple(dv.x, 0, 0)); // front bottom x + axes[Y1].setPosition(first, first+Triple( 0, dv.y, 0)); // bottom left y + axes[Z1].setPosition (first+Triple( 0, dv.y, 0), first+Triple( 0, dv.y, dv.z)); // back left z + axes[X1].setTicOrientation(0,-1,0); + axes[Y1].setTicOrientation(-1,0,0); + axes[Z1].setTicOrientation(-1,0,0); + + axes[X1].setLimits(first.x, second.x); + axes[X2].setLimits(first.x, second.x); + axes[X3].setLimits(first.x, second.x); + axes[X4].setLimits(first.x, second.x); + + axes[Y1].setLimits(first.y, second.y); + axes[Y2].setLimits(first.y, second.y); + axes[Y3].setLimits(first.y, second.y); + axes[Y4].setLimits(first.y, second.y); + + axes[Z1].setLimits(first.z, second.z); + axes[Z2].setLimits(first.z, second.z); + axes[Z3].setLimits(first.z, second.z); + axes[Z4].setLimits(first.z, second.z); + + // remaining x axes + axes[X2].setPosition(first+Triple( 0, 0, dv.z), first+Triple( dv.x, 0, dv.z)); // front top x + axes[X3].setPosition(first+Triple( 0, dv.y, dv.z), second); // back top x + axes[X4].setPosition(first+Triple( 0, dv.y, 0), first+Triple( dv.x, dv.y, 0)); // back bottom x + axes[X2].setTicOrientation(0,-1,0); + axes[X3].setTicOrientation(0,1,0); + axes[X4].setTicOrientation(0,1,0); + + // remaining y axes + axes[Y2].setPosition(first+Triple(dv.x, 0, 0), first+Triple(dv.x, dv.y, 0)); // bottom right y + axes[Y3].setPosition(first+Triple(dv.x, 0, dv.z), second); // top right y + axes[Y4].setPosition(first+Triple(0, 0, dv.z), first+Triple(0, dv.y, dv.z)); // top left y + axes[Y2].setTicOrientation(1,0,0); + axes[Y3].setTicOrientation(1,0,0); + axes[Y4].setTicOrientation (-1,0,0); + + // remaining z axes + axes[Z2].setPosition(first, first+Triple( 0, 0, dv.z)); // front left z + axes[Z4].setPosition(first+Triple(dv.x, dv.y, 0), second ); // back right z + axes[Z3].setPosition(first+Triple(dv.x, 0, 0), first+Triple(dv.x, 0, dv.z)); // front right z + axes[Z2].setTicOrientation(-1,0,0); + axes[Z4].setTicOrientation(1,0,0); + axes[Z3].setTicOrientation(1,0,0); + + setStyle(style_); +} + +void CoordinateSystem::draw() +{ +// saveGLState(); + + GLStateBewarer sb(GL_LINE_SMOOTH, true); + + if (!lineSmooth()) + sb.turnOff(); + + + if (autoDecoration()) + chooseAxes(); + + Drawable::draw(); + + if( style_ == NOCOORD) + return; + + if (majorgridlines_ || minorgridlines_) + recalculateAxesTics(); + if (majorgridlines_) + drawMajorGridLines(); + if (minorgridlines_) + drawMinorGridLines(); + + // restoreGLState(); +} + + +//! build convex hull (6 axes: 2 x, 2 y, 2 z) and choose one of them at a time for scales, labels etc. +void CoordinateSystem::chooseAxes() +{ + vector beg(axes.size()); + vector end(axes.size()); + vector src(2*axes.size()); + + unsigned i; + // collect axes viewport coordinates and initialize + for (i=0; i!=axes.size(); ++i) + { + if (style() != NOCOORD) + attach(&axes[i]); + + beg[i] = World2ViewPort(axes[i].begin()); + end[i] = World2ViewPort(axes[i].end()); + src[i] = Tuple(beg[i].x, beg[i].y); + src[axes.size()+i] = Tuple(end[i].x, end[i].y); + + axes[i].setScaling(false); + axes[i].setNumbers(false); + axes[i].setLabel(false); + axes[i].setDecorate(false); + } + + vector idx; + convexhull2d(idx,src); + + int rem_x = -1; + int rem_y = -1; + int rem_z = -1; + + + bool left; + + int choice_x = -1; + int choice_y = -1; + int choice_z = -1; + + int other_x = -1; + int other_y = -1; + int other_z = -1; + + //traverse convex hull + for (unsigned k=0; k!=idx.size(); ++k) + { + Triple one, two; + + if (idx[k] >= axes.size()) // is end point + one = end[idx[k]-axes.size()]; + else // is begin point + one = beg[idx[k]]; + + unsigned int next = idx[(k+1) % idx.size()]; // next point in cv (considered as ring buffer of points) + + if (next >= axes.size()) + two = end[next-axes.size()]; + else + two = beg[next]; + + for (i=0; i!=axes.size(); ++i) + { + if ( + (one == beg[i] && two == end[i]) + || + (two == beg[i] && one == end[i]) + ) + { + if (i==X1 || i==X2 || i==X3 || i==X4) // x Achsen + { + if (rem_x>=0) // schon zweite Achse der konvexen Huelle ? + { + // untere der beiden x Achsen + double y = min(min(end[rem_x].y,end[i].y),min(beg[rem_x].y,beg[i].y)); + choice_x = (y == beg[i].y || y == end[i].y) ? i : rem_x; + + other_x = (choice_x == (int)i) ? rem_x : (int)i; + left = (beg[choice_x].x < beg[other_x].x || end[choice_x].x < end[other_x].x) + ? true + : false; + + autoDecorateExposedAxis(axes[choice_x], left); + + rem_x = -1; + } + else + { + rem_x = i; + } + } + else if (i==Y1 || i==Y2 || i==Y3 || i==Y4) + { + if (rem_y>=0) + { + // untere der beiden y Achsen + double y = min(min(end[rem_y].y,end[i].y),min(beg[rem_y].y,beg[i].y)); + choice_y = (y == beg[i].y || y == end[i].y) ? i : rem_y; + + other_y = (choice_y == (int)i) ? rem_y : (int)i; + left = (beg[choice_y].x < beg[other_y].x || end[choice_y].x < end[other_y].x) + ? true + : false; + autoDecorateExposedAxis(axes[choice_y], left); + + rem_y = -1; + } + else + { + rem_y = i; + } + } + else if (i==Z1 || i==Z2 || i==Z3 || i==Z4) + { + if (rem_z>=0) + { + // hintere der beiden z Achsen + double z = max(max(end[rem_z].z,end[i].z),max(beg[rem_z].z,beg[i].z)); + choice_z = (z == beg[i].z || z == end[i].z) ? i : rem_z; + + other_z = (choice_z == (int)i) ? rem_z : (int)i; + + rem_z = -1; + + } + else + { + rem_z = i; + } + } + } + } // for axes + } // for idx + + // fit z axis in - the onthewall axis if the decorated axes build a continous line, the opposite else + if (choice_x>=0 && choice_y>=0 && choice_z>=0) + { + left = (beg[choice_z].x < beg[other_z].x || end[choice_z].x < end[other_z].x) + ? true + : false; + + + if ( + axes[choice_z].begin() == axes[choice_x].begin() + || axes[choice_z].begin() == axes[choice_x].end() + || axes[choice_z].begin() == axes[choice_y].begin() + || axes[choice_z].begin() == axes[choice_y].end() + || axes[choice_z].end() == axes[choice_x].begin() + || axes[choice_z].end() == axes[choice_x].end() + || axes[choice_z].end() == axes[choice_y].begin() + || axes[choice_z].end() == axes[choice_y].end() + + ) + { + autoDecorateExposedAxis(axes[choice_z], left); + } + + else + { + autoDecorateExposedAxis(axes[other_z], !left); + choice_z = other_z; // for FRAME + } + } + + if (style() == FRAME) + { + for (i=0; i!=axes.size(); ++i) + { + if ((int)i!=choice_x && (int)i!=choice_y && (int)i!=choice_z) + detach(&axes[i]); + } + } + +} + + +void CoordinateSystem::autoDecorateExposedAxis(Axis& ax, bool left) +{ + Triple diff = World2ViewPort(ax.end()) - World2ViewPort(ax.begin()); + + diff = Triple(diff.x,diff.y,0); // projection + + double s = diff.length(); + + if (!s) + return; + + ax.setScaling(true); + ax.setNumbers(true); + ax.setLabel(true); + ax.setDecorate(true); + + const double SQRT_2 = 0.7071067; + double sina = fabs(diff.y / s); + + + if (left) // leftmost (compared with antagonist in CV) axis -> draw decorations on the left side + { + if ( diff.x >= 0 && diff.y >= 0 && sina < SQRT_2) // 0..Pi/4 + { + ax.setNumberAnchor(BottomCenter); + } + else if ( diff.x >= 0 && diff.y >= 0 && !left) // octant 2 + { + ax.setNumberAnchor(CenterRight); + } + else if ( diff.x <= 0 && diff.y >= 0 && sina >= SQRT_2) // octant 3 + { + ax.setNumberAnchor(CenterRight); + } + else if ( diff.x <= 0 && diff.y >= 0 ) // octant 4 + { + ax.setNumberAnchor(TopCenter); + } + else if ( diff.x <= 0 && diff.y <= 0 && sina <= SQRT_2) // octant 5 + { + ax.setNumberAnchor(BottomCenter); + } + else if ( diff.x <= 0 && diff.y <= 0) // octant 6 + { + ax.setNumberAnchor(CenterRight); + } + else if ( diff.x >= 0 && diff.y <= 0 && sina >= SQRT_2) // octant 7 + { + ax.setNumberAnchor(CenterRight); + } + else if ( diff.x >= 0 && diff.y <= 0) // octant 8 + { + ax.setNumberAnchor(TopCenter); + } + } + else // rightmost axis + { + if ( diff.x >= 0 && diff.y >= 0 && sina <= SQRT_2) + { + ax.setNumberAnchor(TopCenter); + } + else if ( diff.x >= 0 && diff.y >= 0 && !left) + { + ax.setNumberAnchor(CenterLeft); + } + else if ( diff.x <= 0 && diff.y >= 0 && sina >= SQRT_2) + { + ax.setNumberAnchor(CenterLeft); + } + else if ( diff.x <= 0 && diff.y >= 0) + { + ax.setNumberAnchor(BottomCenter); + } + else if ( diff.x <= 0 && diff.y <= 0 && sina <= SQRT_2) + { + ax.setNumberAnchor(TopCenter); + } + else if ( diff.x <= 0 && diff.y <= 0) + { + ax.setNumberAnchor(CenterLeft); + } + else if ( diff.x >= 0 && diff.y <= 0 && sina >= SQRT_2) + { + ax.setNumberAnchor(CenterLeft); + } + else if ( diff.x >= 0 && diff.y <= 0) + { + ax.setNumberAnchor(BottomCenter); + } + } +} + + +void CoordinateSystem::setPosition(Triple first, Triple second) +{ + first_ = first; + second_ = second; +} + +void CoordinateSystem::setTicLength(double major, double minor) +{ + for (unsigned i=0; i!=axes.size(); ++i) + axes[i].setTicLength(major, minor); +} + +void CoordinateSystem::adjustNumbers(int val) +{ + for (unsigned i=0; i!=axes.size(); ++i) + axes[i].adjustNumbers(val); +} + +void CoordinateSystem::adjustLabels(int val) +{ + for (unsigned i=0; i!=axes.size(); ++i) + axes[i].adjustLabel(val); +} + +void CoordinateSystem::setAutoScale(bool val) +{ + for (unsigned i=0; i!=axes.size(); ++i) + axes[i].setAutoScale(val); +} + +void CoordinateSystem::setAxesColor(RGBA val) +{ + for (unsigned i=0; i!=axes.size(); ++i) + axes[i].setColor(val); +} + +void CoordinateSystem::recalculateAxesTics() +{ + for (unsigned i=0; i!=axes.size(); ++i) + axes[i].recalculateTics(); +} + +void CoordinateSystem::setNumberFont(QString const& family, int pointSize, int weight, bool italic) +{ + for (unsigned i=0; i!=axes.size(); ++i) + axes[i].setNumberFont(family,pointSize,weight,italic); +} + +void CoordinateSystem::setNumberFont(QFont const& font) +{ + for (unsigned i=0; i!=axes.size(); ++i) + axes[i].setNumberFont(font); +} + +void CoordinateSystem::setNumberColor(RGBA val) +{ + for (unsigned i=0; i!=axes.size(); ++i) + axes[i].setNumberColor( val); +} + +void CoordinateSystem::setStandardScale() +{ + for (unsigned i=0; i!=axes.size(); ++i) + axes[i].setScale(LINEARSCALE); +} + +void CoordinateSystem::setLabelFont(QFont const& font) +{ + for (unsigned i=0; i!=axes.size(); ++i) + axes[i].setLabelFont(font); +} + + +void CoordinateSystem::setLabelFont(QString const& family, int pointSize, int weight, bool italic) +{ + setLabelFont(QFont(family,pointSize,weight,italic)); +} + +void CoordinateSystem::setLabelColor(RGBA val) +{ + for (unsigned i=0; i!=axes.size(); ++i) + axes[i].setLabelColor(val); +} + +void CoordinateSystem::setLineWidth(double val, double majfac, double minfac) +{ + for (unsigned i=0; i!=axes.size(); ++i) + axes[i].setLineWidth(val, majfac, minfac); +} + +void CoordinateSystem::setStyle(COORDSTYLE s, AXIS frame_1, AXIS frame_2, AXIS frame_3) +{ + style_ = s; + + switch (s) + { + case NOCOORD: + { + for (unsigned i=0; i!=axes.size(); ++i) + detach (&axes[i]); + } + break; + case BOX: + { + for (unsigned i=0; i!=axes.size(); ++i) + attach (&axes[i]); + } + break; + case FRAME: + { + for (unsigned i=0; i!=axes.size(); ++i) + detach (&axes[i]); + if (!autoDecoration()) + { + attach(&axes[frame_1]); + attach(&axes[frame_2]); + attach(&axes[frame_3]); + } + } + break; + default: + break; + } +} + +/** +The axis used for tic calculation is chosen randomly from the respective pair. +For most cases an identical tic distribution is therefore recommended. +\param majors Draw grid between major tics +\param minors Draw grid between minor tics +\param sides Side(s), where the grid should be drawn +*/ +void CoordinateSystem::setGridLines(bool majors, bool minors, int sides) +{ + sides_ = sides; + majorgridlines_ = majors; + minorgridlines_ = minors; +} + +void CoordinateSystem::drawMajorGridLines() +{ + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4d(gridlinecolor_.r,gridlinecolor_.g,gridlinecolor_.b,gridlinecolor_.a); + setDeviceLineWidth(axes[X1].majLineWidth()); + + std::vector > axis; + if (sides_ & Qwt3D::FLOOR) + { + axis.push_back(make_pair(X1,X4)); + axis.push_back(make_pair(Y1,Y2)); + } + if (sides_ & Qwt3D::CEIL) + { + axis.push_back(make_pair(X2,X3)); + axis.push_back(make_pair(Y3,Y4)); + } + if (sides_ & Qwt3D::LEFT) + { + axis.push_back(make_pair(Y1,Y4)); + axis.push_back(make_pair(Z1,Z2)); + } + if (sides_ & Qwt3D::RIGHT) + { + axis.push_back(make_pair(Y2,Y3)); + axis.push_back(make_pair(Z3,Z4)); + } + if (sides_ & Qwt3D::FRONT) + { + axis.push_back(make_pair(X1,X2)); + axis.push_back(make_pair(Z2,Z3)); + } + if (sides_ & Qwt3D::BACK) + { + axis.push_back(make_pair(X3,X4)); + axis.push_back(make_pair(Z4,Z1)); + } + + for(std::vector >::const_iterator it=axis.begin(); it!=axis.end(); ++it) + { + GridLine grid = GridLine(majorgridlines_, gridlinecolor_); + if(!gridmajors_.value(it->first, grid).visible_) + continue; + + Qwt3D::RGBA gridcolor = gridmajors_.value(it->first, grid).color_; + glColor4d(gridcolor.r,gridcolor.g,gridcolor.b,gridcolor.a); + + setDeviceLineWidth(gridmajors_.value(it->first, grid).width_); + + glEnable(GL_LINE_STIPPLE); + switch(gridmajors_.value(it->first, grid).style_) + { + case SOLID: + glLineStipple(1, 0xFFFF); + break; + case DASH: + glLineStipple(2, 0x7777); + break; + case DOT: + glLineStipple(2, 0x1111); + break; + case DASHDOT: + glLineStipple(2, 0x087F); + break; + case DASHDOTDOT: + glLineStipple(2, 0x24FF); + break; + case SHORTDASH: + glLineStipple(1, 0x7777); + break; + case SHORTDOT: + glLineStipple(1, 0x1111); + break; + case SHORTDASHDOT: + glLineStipple(1, 0x087F); + break; + } + + glBegin(GL_LINES); + drawMajorGridLines(axes[it->first],axes[it->second]); + glEnd(); + + glDisable(GL_LINE_STIPPLE); + } +} + +void CoordinateSystem::drawMinorGridLines() +{ + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4d(gridlinecolor_.r,gridlinecolor_.g,gridlinecolor_.b,gridlinecolor_.a); + setDeviceLineWidth(axes[X1].minLineWidth()); + + std::vector > axis; + if (sides_ & Qwt3D::FLOOR) + { + axis.push_back(make_pair(X1,X4)); + axis.push_back(make_pair(Y1,Y2)); + } + if (sides_ & Qwt3D::CEIL) + { + axis.push_back(make_pair(X2,X3)); + axis.push_back(make_pair(Y3,Y4)); + } + if (sides_ & Qwt3D::LEFT) + { + axis.push_back(make_pair(Y1,Y4)); + axis.push_back(make_pair(Z1,Z2)); + } + if (sides_ & Qwt3D::RIGHT) + { + axis.push_back(make_pair(Y2,Y3)); + axis.push_back(make_pair(Z3,Z4)); + } + if (sides_ & Qwt3D::FRONT) + { + axis.push_back(make_pair(X1,X2)); + axis.push_back(make_pair(Z2,Z3)); + } + if (sides_ & Qwt3D::BACK) + { + axis.push_back(make_pair(X3,X4)); + axis.push_back(make_pair(Z4,Z1)); + } + + for(std::vector >::const_iterator it=axis.begin(); it!=axis.end(); ++it) + { + GridLine grid = GridLine(minorgridlines_, gridlinecolor_); + if(!gridminors_.value(it->first, grid).visible_) + continue; + + Qwt3D::RGBA gridcolor = gridminors_.value(it->first, grid).color_; + glColor4d(gridcolor.r,gridcolor.g,gridcolor.b,gridcolor.a); + + setDeviceLineWidth(gridminors_.value(it->first, grid).width_); + + glEnable(GL_LINE_STIPPLE); + switch(gridminors_.value(it->first, grid).style_) + { + case SOLID: + glLineStipple(1, 0xFFFF); + break; + case DASH: + glLineStipple(2, 0x7777); + break; + case DOT: + glLineStipple(2, 0x1111); + break; + case DASHDOT: + glLineStipple(2, 0x087F); + break; + case DASHDOTDOT: + glLineStipple(2, 0x24FF); + break; + case SHORTDASH: + glLineStipple(1, 0x7777); + break; + case SHORTDOT: + glLineStipple(1, 0x1111); + break; + case SHORTDASHDOT: + glLineStipple(1, 0x087F); + break; + } + + glBegin(GL_LINES); + drawMinorGridLines(axes[it->first],axes[it->second]); + glEnd(); + + glDisable(GL_LINE_STIPPLE); + } +} + +void CoordinateSystem::drawMajorGridLines(Axis& a0, Axis& a1) +{ + Triple d = a1.begin()-a0.begin(); + + for (unsigned int i=0; i!=a0.majorPositions().size(); ++i) + { + glVertex3d( a0.majorPositions()[i].x, a0.majorPositions()[i].y, a0.majorPositions()[i].z ); + glVertex3d( a0.majorPositions()[i].x + d.x, a0.majorPositions()[i].y + d.y, a0.majorPositions()[i].z +d.z); + } +} + +void CoordinateSystem::drawMinorGridLines(Axis& a0, Axis& a1) +{ + Triple d = a1.begin()-a0.begin(); + + for (unsigned int i=0; i!=a0.minorPositions().size(); ++i) + { + glVertex3d( a0.minorPositions()[i].x, a0.minorPositions()[i].y, a0.minorPositions()[i].z ); + glVertex3d( a0.minorPositions()[i].x + d.x, a0.minorPositions()[i].y + d.y, a0.minorPositions()[i].z +d.z); + } +} === removed file '3rdparty/qwtplot3d/src/qwt3d_coordsys.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_coordsys.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_coordsys.cpp 1970-01-01 00:00:00 +0000 @@ -1,725 +0,0 @@ -#include "qwt3d_coordsys.h" - -using namespace std; -using namespace Qwt3D; - - -CoordinateSystem::CoordinateSystem(Triple first, Triple second, COORDSTYLE st) -{ - autodecoration_ = true; - axes = std::vector(12); - setStyle(st); - setLineSmooth(true); - init(first,second); - - setAxesColor(RGBA(0,0,0,1)); - setGridLinesColor(RGBA(0.2,0.2,0.2,1)); - setNumberFont("Courier", 12); - setNumberColor(RGBA(0,0,0)); - setLabelFont("Courier", 14, QFont::Bold); - setGridLines(false, false); -} - -CoordinateSystem::~CoordinateSystem() -{ - destroy(); -} - -void CoordinateSystem::destroy() -{ - for (unsigned i=0; i!=axes.size(); ++i) - axes[i].setLabelString(""); - - detachAll(); -} - -void CoordinateSystem::init(Triple first, Triple second) -{ - destroy(); - - for (unsigned i=0; i!=axes.size(); ++i) - axes[i].setScale(LINEARSCALE); - - Triple dv = second - first; - - setPosition(first, second); - - double majl = dv.length() / 100; // 1 % - setTicLength(majl, 0.6 * majl); - - axes[X1].setPosition(first, first+Triple(dv.x, 0, 0)); // front bottom x - axes[Y1].setPosition(first, first+Triple( 0, dv.y, 0)); // bottom left y - axes[Z1].setPosition (first+Triple( 0, dv.y, 0), first+Triple( 0, dv.y, dv.z)); // back left z - axes[X1].setTicOrientation(0,-1,0); - axes[Y1].setTicOrientation(-1,0,0); - axes[Z1].setTicOrientation(-1,0,0); - - axes[X1].setLimits(first.x, second.x); - axes[X2].setLimits(first.x, second.x); - axes[X3].setLimits(first.x, second.x); - axes[X4].setLimits(first.x, second.x); - - axes[Y1].setLimits(first.y, second.y); - axes[Y2].setLimits(first.y, second.y); - axes[Y3].setLimits(first.y, second.y); - axes[Y4].setLimits(first.y, second.y); - - axes[Z1].setLimits(first.z, second.z); - axes[Z2].setLimits(first.z, second.z); - axes[Z3].setLimits(first.z, second.z); - axes[Z4].setLimits(first.z, second.z); - - // remaining x axes - axes[X2].setPosition(first+Triple( 0, 0, dv.z), first+Triple( dv.x, 0, dv.z)); // front top x - axes[X3].setPosition(first+Triple( 0, dv.y, dv.z), second); // back top x - axes[X4].setPosition(first+Triple( 0, dv.y, 0), first+Triple( dv.x, dv.y, 0)); // back bottom x - axes[X2].setTicOrientation(0,-1,0); - axes[X3].setTicOrientation(0,1,0); - axes[X4].setTicOrientation(0,1,0); - - // remaining y axes - axes[Y2].setPosition(first+Triple(dv.x, 0, 0), first+Triple(dv.x, dv.y, 0)); // bottom right y - axes[Y3].setPosition(first+Triple(dv.x, 0, dv.z), second); // top right y - axes[Y4].setPosition(first+Triple(0, 0, dv.z), first+Triple(0, dv.y, dv.z)); // top left y - axes[Y2].setTicOrientation(1,0,0); - axes[Y3].setTicOrientation(1,0,0); - axes[Y4].setTicOrientation (-1,0,0); - - // remaining z axes - axes[Z2].setPosition(first, first+Triple( 0, 0, dv.z)); // front left z - axes[Z4].setPosition(first+Triple(dv.x, dv.y, 0), second ); // back right z - axes[Z3].setPosition(first+Triple(dv.x, 0, 0), first+Triple(dv.x, 0, dv.z)); // front right z - axes[Z2].setTicOrientation(-1,0,0); - axes[Z4].setTicOrientation(1,0,0); - axes[Z3].setTicOrientation(1,0,0); - - setStyle(style_); -} - -void CoordinateSystem::draw() -{ -// saveGLState(); - - GLStateBewarer sb(GL_LINE_SMOOTH, true); - - if (!lineSmooth()) - sb.turnOff(); - - - if (autoDecoration()) - chooseAxes(); - - Drawable::draw(); - - if( style_ == NOCOORD) - return; - - if (majorgridlines_ || minorgridlines_) - recalculateAxesTics(); - if (majorgridlines_) - drawMajorGridLines(); - if (minorgridlines_) - drawMinorGridLines(); - - // restoreGLState(); -} - - -//! build convex hull (6 axes: 2 x, 2 y, 2 z) and choose one of them at a time for scales, labels etc. -void CoordinateSystem::chooseAxes() -{ - vector beg(axes.size()); - vector end(axes.size()); - vector src(2*axes.size()); - - unsigned i; - // collect axes viewport coordinates and initialize - for (i=0; i!=axes.size(); ++i) - { - if (style() != NOCOORD) - attach(&axes[i]); - - beg[i] = World2ViewPort(axes[i].begin()); - end[i] = World2ViewPort(axes[i].end()); - src[i] = Tuple(beg[i].x, beg[i].y); - src[axes.size()+i] = Tuple(end[i].x, end[i].y); - - axes[i].setScaling(false); - axes[i].setNumbers(false); - axes[i].setLabel(false); - } - - vector idx; - convexhull2d(idx,src); - - int rem_x = -1; - int rem_y = -1; - int rem_z = -1; - - - bool left; - - int choice_x = -1; - int choice_y = -1; - int choice_z = -1; - - int other_x = -1; - int other_y = -1; - int other_z = -1; - - //traverse convex hull - for (unsigned k=0; k!=idx.size(); ++k) - { - Triple one, two; - - if (idx[k] >= axes.size()) // is end point - one = end[idx[k]-axes.size()]; - else // is begin point - one = beg[idx[k]]; - - unsigned int next = idx[(k+1) % idx.size()]; // next point in cv (considered as ring buffer of points) - - if (next >= axes.size()) - two = end[next-axes.size()]; - else - two = beg[next]; - - for (i=0; i!=axes.size(); ++i) - { - if ( - (one == beg[i] && two == end[i]) - || - (two == beg[i] && one == end[i]) - ) - { - if (i==X1 || i==X2 || i==X3 || i==X4) // x Achsen - { - if (rem_x>=0) // schon zweite Achse der konvexen Huelle ? - { - // untere der beiden x Achsen - double y = min(min(end[rem_x].y,end[i].y),min(beg[rem_x].y,beg[i].y)); - choice_x = (y == beg[i].y || y == end[i].y) ? i : rem_x; - - other_x = (choice_x == (int)i) ? rem_x : (int)i; - left = (beg[choice_x].x < beg[other_x].x || end[choice_x].x < end[other_x].x) - ? true - : false; - - autoDecorateExposedAxis(axes[choice_x], left); - - rem_x = -1; - } - else - { - rem_x = i; - } - } - else if (i==Y1 || i==Y2 || i==Y3 || i==Y4) - { - if (rem_y>=0) - { - // untere der beiden y Achsen - double y = min(min(end[rem_y].y,end[i].y),min(beg[rem_y].y,beg[i].y)); - choice_y = (y == beg[i].y || y == end[i].y) ? i : rem_y; - - other_y = (choice_y == (int)i) ? rem_y : (int)i; - left = (beg[choice_y].x < beg[other_y].x || end[choice_y].x < end[other_y].x) - ? true - : false; - autoDecorateExposedAxis(axes[choice_y], left); - - rem_y = -1; - } - else - { - rem_y = i; - } - } - else if (i==Z1 || i==Z2 || i==Z3 || i==Z4) - { - if (rem_z>=0) - { - // hintere der beiden z Achsen - double z = max(max(end[rem_z].z,end[i].z),max(beg[rem_z].z,beg[i].z)); - choice_z = (z == beg[i].z || z == end[i].z) ? i : rem_z; - - other_z = (choice_z == (int)i) ? rem_z : (int)i; - - rem_z = -1; - - } - else - { - rem_z = i; - } - } - } - } // for axes - } // for idx - - // fit z axis in - the onthewall axis if the decorated axes build a continous line, the opposite else - if (choice_x>=0 && choice_y>=0 && choice_z>=0) - { - left = (beg[choice_z].x < beg[other_z].x || end[choice_z].x < end[other_z].x) - ? true - : false; - - - if ( - axes[choice_z].begin() == axes[choice_x].begin() - || axes[choice_z].begin() == axes[choice_x].end() - || axes[choice_z].begin() == axes[choice_y].begin() - || axes[choice_z].begin() == axes[choice_y].end() - || axes[choice_z].end() == axes[choice_x].begin() - || axes[choice_z].end() == axes[choice_x].end() - || axes[choice_z].end() == axes[choice_y].begin() - || axes[choice_z].end() == axes[choice_y].end() - - ) - { - autoDecorateExposedAxis(axes[choice_z], left); - } - - else - { - autoDecorateExposedAxis(axes[other_z], !left); - choice_z = other_z; // for FRAME - } - } - - if (style() == FRAME) - { - for (i=0; i!=axes.size(); ++i) - { - if ((int)i!=choice_x && (int)i!=choice_y && (int)i!=choice_z) - detach(&axes[i]); - } - } - -} - - -void CoordinateSystem::autoDecorateExposedAxis(Axis& ax, bool left) -{ - Triple diff = World2ViewPort(ax.end()) - World2ViewPort(ax.begin()); - - diff = Triple(diff.x,diff.y,0); // projection - - double s = diff.length(); - - if (!s) - return; - - ax.setScaling(true); - ax.setNumbers(true); - ax.setLabel(true); - - const double SQRT_2 = 0.7071067; - double sina = fabs(diff.y / s); - - - if (left) // leftmost (compared with antagonist in CV) axis -> draw decorations on the left side - { - if ( diff.x >= 0 && diff.y >= 0 && sina < SQRT_2) // 0..Pi/4 - { - ax.setNumberAnchor(BottomCenter); - } - else if ( diff.x >= 0 && diff.y >= 0 && !left) // octant 2 - { - ax.setNumberAnchor(CenterRight); - } - else if ( diff.x <= 0 && diff.y >= 0 && sina >= SQRT_2) // octant 3 - { - ax.setNumberAnchor(CenterRight); - } - else if ( diff.x <= 0 && diff.y >= 0 ) // octant 4 - { - ax.setNumberAnchor(TopCenter); - } - else if ( diff.x <= 0 && diff.y <= 0 && sina <= SQRT_2) // octant 5 - { - ax.setNumberAnchor(BottomCenter); - } - else if ( diff.x <= 0 && diff.y <= 0) // octant 6 - { - ax.setNumberAnchor(CenterRight); - } - else if ( diff.x >= 0 && diff.y <= 0 && sina >= SQRT_2) // octant 7 - { - ax.setNumberAnchor(CenterRight); - } - else if ( diff.x >= 0 && diff.y <= 0) // octant 8 - { - ax.setNumberAnchor(TopCenter); - } - } - else // rightmost axis - { - if ( diff.x >= 0 && diff.y >= 0 && sina <= SQRT_2) - { - ax.setNumberAnchor(TopCenter); - } - else if ( diff.x >= 0 && diff.y >= 0 && !left) - { - ax.setNumberAnchor(CenterLeft); - } - else if ( diff.x <= 0 && diff.y >= 0 && sina >= SQRT_2) - { - ax.setNumberAnchor(CenterLeft); - } - else if ( diff.x <= 0 && diff.y >= 0) - { - ax.setNumberAnchor(BottomCenter); - } - else if ( diff.x <= 0 && diff.y <= 0 && sina <= SQRT_2) - { - ax.setNumberAnchor(TopCenter); - } - else if ( diff.x <= 0 && diff.y <= 0) - { - ax.setNumberAnchor(CenterLeft); - } - else if ( diff.x >= 0 && diff.y <= 0 && sina >= SQRT_2) - { - ax.setNumberAnchor(CenterLeft); - } - else if ( diff.x >= 0 && diff.y <= 0) - { - ax.setNumberAnchor(BottomCenter); - } - } -} - - -void CoordinateSystem::setPosition(Triple first, Triple second) -{ - first_ = first; - second_ = second; -} - -void CoordinateSystem::setTicLength(double major, double minor) -{ - for (unsigned i=0; i!=axes.size(); ++i) - axes[i].setTicLength(major, minor); -} - -void CoordinateSystem::adjustNumbers(int val) -{ - for (unsigned i=0; i!=axes.size(); ++i) - axes[i].adjustNumbers(val); -} - -void CoordinateSystem::adjustLabels(int val) -{ - for (unsigned i=0; i!=axes.size(); ++i) - axes[i].adjustLabel(val); -} - -void CoordinateSystem::setAutoScale(bool val) -{ - for (unsigned i=0; i!=axes.size(); ++i) - axes[i].setAutoScale(val); -} - -void CoordinateSystem::setAxesColor(RGBA val) -{ - for (unsigned i=0; i!=axes.size(); ++i) - axes[i].setColor(val); -} - -void CoordinateSystem::recalculateAxesTics() -{ - for (unsigned i=0; i!=axes.size(); ++i) - axes[i].recalculateTics(); -} - -void CoordinateSystem::setNumberFont(QString const& family, int pointSize, int weight, bool italic) -{ - for (unsigned i=0; i!=axes.size(); ++i) - axes[i].setNumberFont(family,pointSize,weight,italic); -} - -void CoordinateSystem::setNumberFont(QFont const& font) -{ - for (unsigned i=0; i!=axes.size(); ++i) - axes[i].setNumberFont(font); -} - -void CoordinateSystem::setNumberColor(RGBA val) -{ - for (unsigned i=0; i!=axes.size(); ++i) - axes[i].setNumberColor( val); -} - -void CoordinateSystem::setStandardScale() -{ - for (unsigned i=0; i!=axes.size(); ++i) - axes[i].setScale(LINEARSCALE); -} - -void CoordinateSystem::setLabelFont(QFont const& font) -{ - for (unsigned i=0; i!=axes.size(); ++i) - axes[i].setLabelFont(font); -} - - -void CoordinateSystem::setLabelFont(QString const& family, int pointSize, int weight, bool italic) -{ - setLabelFont(QFont(family,pointSize,weight,italic)); -} - -void CoordinateSystem::setLabelColor(RGBA val) -{ - for (unsigned i=0; i!=axes.size(); ++i) - axes[i].setLabelColor(val); -} - -void CoordinateSystem::setLineWidth(double val, double majfac, double minfac) -{ - for (unsigned i=0; i!=axes.size(); ++i) - axes[i].setLineWidth(val, majfac, minfac); -} - -void CoordinateSystem::setStyle(COORDSTYLE s, AXIS frame_1, AXIS frame_2, AXIS frame_3) -{ - style_ = s; - - switch (s) - { - case NOCOORD: - { - for (unsigned i=0; i!=axes.size(); ++i) - detach (&axes[i]); - } - break; - case BOX: - { - for (unsigned i=0; i!=axes.size(); ++i) - attach (&axes[i]); - } - break; - case FRAME: - { - for (unsigned i=0; i!=axes.size(); ++i) - detach (&axes[i]); - if (!autoDecoration()) - { - attach(&axes[frame_1]); - attach(&axes[frame_2]); - attach(&axes[frame_3]); - } - } - break; - default: - break; - } -} - -/** -The axis used for tic calculation is chosen randomly from the respective pair. -For most cases an identical tic distribution is therefore recommended. -\param majors Draw grid between major tics -\param minors Draw grid between minor tics -\param sides Side(s), where the grid should be drawn -*/ -void CoordinateSystem::setGridLines(bool majors, bool minors, int sides) -{ - sides_ = sides; - majorgridlines_ = majors; - minorgridlines_ = minors; -} - -void CoordinateSystem::drawMajorGridLines() -{ - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glColor4d(gridlinecolor_.r,gridlinecolor_.g,gridlinecolor_.b,gridlinecolor_.a); - setDeviceLineWidth(axes[X1].majLineWidth()); - - std::vector > axis; - if (sides_ & Qwt3D::FLOOR) - { - axis.push_back(make_pair(X1,X4)); - axis.push_back(make_pair(Y1,Y2)); - } - if (sides_ & Qwt3D::CEIL) - { - axis.push_back(make_pair(X2,X3)); - axis.push_back(make_pair(Y3,Y4)); - } - if (sides_ & Qwt3D::LEFT) - { - axis.push_back(make_pair(Y1,Y4)); - axis.push_back(make_pair(Z1,Z2)); - } - if (sides_ & Qwt3D::RIGHT) - { - axis.push_back(make_pair(Y2,Y3)); - axis.push_back(make_pair(Z3,Z4)); - } - if (sides_ & Qwt3D::FRONT) - { - axis.push_back(make_pair(X1,X2)); - axis.push_back(make_pair(Z2,Z3)); - } - if (sides_ & Qwt3D::BACK) - { - axis.push_back(make_pair(X3,X4)); - axis.push_back(make_pair(Z4,Z1)); - } - - for(std::vector >::const_iterator it=axis.begin(); it!=axis.end(); ++it) - { - GridLine grid = GridLine(majorgridlines_, gridlinecolor_); - if(!gridmajors_.value(it->first, grid).visible_) - continue; - - Qwt3D::RGBA gridcolor = gridmajors_.value(it->first, grid).color_; - glColor4d(gridcolor.r,gridcolor.g,gridcolor.b,gridcolor.a); - - setDeviceLineWidth(gridmajors_.value(it->first, grid).width_); - - glEnable(GL_LINE_STIPPLE); - switch(gridmajors_.value(it->first, grid).style_) - { - case SOLID: - glLineStipple(1, 0xFFFF); - break; - case DASH: - glLineStipple(2, 0x7777); - break; - case DOT: - glLineStipple(2, 0x1111); - break; - case DASHDOT: - glLineStipple(2, 0x087F); - break; - case DASHDOTDOT: - glLineStipple(2, 0x24FF); - break; - case SHORTDASH: - glLineStipple(1, 0x7777); - break; - case SHORTDOT: - glLineStipple(1, 0x1111); - break; - case SHORTDASHDOT: - glLineStipple(1, 0x087F); - break; - } - - glBegin(GL_LINES); - drawMajorGridLines(axes[it->first],axes[it->second]); - glEnd(); - - glDisable(GL_LINE_STIPPLE); - } -} - -void CoordinateSystem::drawMinorGridLines() -{ - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glColor4d(gridlinecolor_.r,gridlinecolor_.g,gridlinecolor_.b,gridlinecolor_.a); - setDeviceLineWidth(axes[X1].minLineWidth()); - - std::vector > axis; - if (sides_ & Qwt3D::FLOOR) - { - axis.push_back(make_pair(X1,X4)); - axis.push_back(make_pair(Y1,Y2)); - } - if (sides_ & Qwt3D::CEIL) - { - axis.push_back(make_pair(X2,X3)); - axis.push_back(make_pair(Y3,Y4)); - } - if (sides_ & Qwt3D::LEFT) - { - axis.push_back(make_pair(Y1,Y4)); - axis.push_back(make_pair(Z1,Z2)); - } - if (sides_ & Qwt3D::RIGHT) - { - axis.push_back(make_pair(Y2,Y3)); - axis.push_back(make_pair(Z3,Z4)); - } - if (sides_ & Qwt3D::FRONT) - { - axis.push_back(make_pair(X1,X2)); - axis.push_back(make_pair(Z2,Z3)); - } - if (sides_ & Qwt3D::BACK) - { - axis.push_back(make_pair(X3,X4)); - axis.push_back(make_pair(Z4,Z1)); - } - - for(std::vector >::const_iterator it=axis.begin(); it!=axis.end(); ++it) - { - GridLine grid = GridLine(minorgridlines_, gridlinecolor_); - if(!gridminors_.value(it->first, grid).visible_) - continue; - - Qwt3D::RGBA gridcolor = gridminors_.value(it->first, grid).color_; - glColor4d(gridcolor.r,gridcolor.g,gridcolor.b,gridcolor.a); - - setDeviceLineWidth(gridminors_.value(it->first, grid).width_); - - glEnable(GL_LINE_STIPPLE); - switch(gridminors_.value(it->first, grid).style_) - { - case SOLID: - glLineStipple(1, 0xFFFF); - break; - case DASH: - glLineStipple(2, 0x7777); - break; - case DOT: - glLineStipple(2, 0x1111); - break; - case DASHDOT: - glLineStipple(2, 0x087F); - break; - case DASHDOTDOT: - glLineStipple(2, 0x24FF); - break; - case SHORTDASH: - glLineStipple(1, 0x7777); - break; - case SHORTDOT: - glLineStipple(1, 0x1111); - break; - case SHORTDASHDOT: - glLineStipple(1, 0x087F); - break; - } - - glBegin(GL_LINES); - drawMinorGridLines(axes[it->first],axes[it->second]); - glEnd(); - - glDisable(GL_LINE_STIPPLE); - } -} - -void CoordinateSystem::drawMajorGridLines(Axis& a0, Axis& a1) -{ - Triple d = a1.begin()-a0.begin(); - - for (unsigned int i=0; i!=a0.majorPositions().size(); ++i) - { - glVertex3d( a0.majorPositions()[i].x, a0.majorPositions()[i].y, a0.majorPositions()[i].z ); - glVertex3d( a0.majorPositions()[i].x + d.x, a0.majorPositions()[i].y + d.y, a0.majorPositions()[i].z +d.z); - } -} - -void CoordinateSystem::drawMinorGridLines(Axis& a0, Axis& a1) -{ - Triple d = a1.begin()-a0.begin(); - - for (unsigned int i=0; i!=a0.minorPositions().size(); ++i) - { - glVertex3d( a0.minorPositions()[i].x, a0.minorPositions()[i].y, a0.minorPositions()[i].z ); - glVertex3d( a0.minorPositions()[i].x + d.x, a0.minorPositions()[i].y + d.y, a0.minorPositions()[i].z +d.z); - } -} === added file '3rdparty/qwtplot3d/src/qwt3d_curve.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_curve.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_curve.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,741 @@ +#include "qwt3d_curve.h" + +using namespace std; +using namespace Qwt3D; + +/** +Initializes with dataNormals()==false, NOFLOOR, resolution() == 1 +*/ +Curve::Curve(QWidget* parent) +: plot_p(qobject_cast (parent)) +{ + if (plot_p) { + title_p = new Label(); + qDebug() << "Curve: Class constructor" << this + << "\r\n\t Parent:" << parent; + plot_p->setCurve(this); + plot_p->addTitle(title_p); + connects(); + } + + plotstyle_ = FILLEDMESH; + userplotstyle_p = 0; + shading_ = GOURAUD; + floorstyle_ = NOFLOOR; + floormode_ = true; + isolines_ = 10; + point_size_ = 5; + + datanormals_p = false; + normalLength_p = 0.02; + normalQuality_p = 3; + + resolution_p = 1; + actualDataG_ = new GridData(); + actualDataC_ = new CellData(); + qDebug() << "Curve: Constructor Actual Data - " << this << "GridData =" << actualDataG_ << "CellData =" << actualDataC_; + + actualData_p = actualDataG_; + + displaylists_p.resize(DisplayListSize); + meshLineWidth_ = 1; + datacolor_p = new StandardColor(this, 100); + setPolygonOffset(0.5); + setMeshColor(RGBA(0.0,0.0,0.0)); + setMeshLineWidth(1); + + title_p->setFont("Courier", 16, QFont::Bold); + title_p->setString(""); + + titlespace_ = 0.02; + titlepos_ = plot_p->titleList().size() - 1; + setTitlePosition(0.98 - (titlepos_ * titlespace_)); + + update_displaylists_ = false; + displaylegend_ = false; + + legend_.setPlot(plot_p); + legend_.setLimits(0, 100); + legend_.setMajors(10); + legend_.setMinors(2); + legend_.setOrientation(ColorLegend::BottomTop, ColorLegend::Left); +} + +Curve::~Curve() +{ + delete actualDataG_; + delete actualDataC_; + + glDeleteLists(displaylists_p[DataObject], 1); + + for (ELIT it = elist_p.begin(); it!=elist_p.end(); ++it) + delete (*it); + + elist_p.clear(); + + if (plot_p) { + plot_p->removeCurve(this); + plot_p->removeTitle(title_p); + } + disconnects(); + + delete title_p; +} + +void Curve::connects() +{ + qDebug() << "Curve: Connecting Curve" << this; + + // Parent Plot3D Relayed Signals + connect(plot_p, SIGNAL(setCurveResolution(int)), SLOT(setResolution(int))); + connect(plot_p, SIGNAL(setCurvePolygonOffset(double)), SLOT(setPolygonOffset(double))); + connect(plot_p, SIGNAL(setCurveIsolines(unsigned int)), SLOT(setIsolines(unsigned int))); + + connect(plot_p, SIGNAL(setCurvePlotStyle(Qwt3D::PLOTSTYLE)), SLOT(setPlotStyle(Qwt3D::PLOTSTYLE))); + connect(plot_p, SIGNAL(setCurvePlotStyle(Qwt3D::Enrichment&)), SLOT(setPlotStyle(Qwt3D::Enrichment&))); + connect(plot_p, SIGNAL(setCurveFloorStyle(Qwt3D::FLOORSTYLE)), SLOT(setFloorStyle(Qwt3D::FLOORSTYLE))); + connect(plot_p, SIGNAL(setCurveShading(Qwt3D::SHADINGSTYLE)), SLOT(setShading(Qwt3D::SHADINGSTYLE))); + + connect(plot_p, SIGNAL(showCurveColorLegend(bool)), SLOT(showColorLegend(bool))); + connect(plot_p, SIGNAL(showCurveNormals(bool)), SLOT(showNormals(bool))); + connect(plot_p, SIGNAL(setCurveNormalLength(double)), SLOT(setNormalLength(double))); + connect(plot_p, SIGNAL(setCurveNormalQuality(int)), SLOT(setNormalQuality(int))); + + connect(plot_p, SIGNAL(setCurveSmoothMesh(bool)), SLOT(setSmoothMesh(bool))); + connect(plot_p, SIGNAL(setCurveMeshColor(Qwt3D::RGBA)), SLOT(setMeshColor(Qwt3D::RGBA))); + connect(plot_p, SIGNAL(setCurveMeshLineWidth(double)), SLOT(setMeshLineWidth(double))); + + connect(plot_p, SIGNAL(setCurveDataColor(Color*)), SLOT(setDataColor(Color*))); + connect(plot_p, SIGNAL(setCurveDataProjection(bool)), SLOT(setDataProjection(bool))); + connect(plot_p, SIGNAL(setCurveProjection(Qwt3D::PROJECTMODE, bool)), SLOT(setProjection(Qwt3D::PROJECTMODE, bool))); + + connect(plot_p, SIGNAL(setCurveTitleColor(Qwt3D::RGBA)), SLOT(setTitleColor(Qwt3D::RGBA))); + connect(plot_p, SIGNAL(setCurveTitle(const QString&)), SLOT(setTitle(const QString&))); + connect(plot_p, SIGNAL(setCurveTitlePosition(double,double,Qwt3D::ANCHOR)), SLOT(setTitlePosition(double,double,Qwt3D::ANCHOR))); + connect(plot_p, SIGNAL(setCurveTitleFont(const QString&,int,int,bool)), SLOT(setTitleFont(const QString&,int,int,bool))); + + connect(plot_p, SIGNAL(createData()), SLOT(createData())); + connect(plot_p, SIGNAL(createEnrichments()), SLOT(createEnrichments())); + + // Reverse relayed signals + connect(this, SIGNAL(updatePlotData(bool)), plot_p, SLOT(updateData(bool))); + connect(this, SIGNAL(updatePlot()), plot_p, SLOT(update())); +} + +void Curve::disconnects() +{ + qDebug() << "Curve: Disconnecting Data Curve" << this; + + disconnect(plot_p, 0, this, 0); + disconnect(this, 0, plot_p, 0); +} + +void Curve::draw() +{ + // if the display list needs to be updated + if ( update_displaylists_ ) { + // create display list if necessary + if ( 0 == displaylists_p[DataObject] ) { + displaylists_p[DataObject] = glGenLists(1); + } + + // glGenLists returns 0 on error. So, if displaylists_p[DataObject] is still 0, + // then just call drawImplementation() + if ( 0 == displaylists_p[DataObject] ) { + drawImplementation(); + return; + } + + glNewList(displaylists_p[DataObject], GL_COMPILE); + drawImplementation(); + glEndList(); + + update_displaylists_ = false; + + updateNormals(); + } + + // glGenLists returns 0 on error. So, if displaylists_p[DataObject] is still 0, + // then just call drawImplementation() + if ( 0 == displaylists_p[DataObject] ) { + drawImplementation(); + return; + } + + for ( unsigned int i=0; i < DisplayListSize; ++i ) { + glCallList(displaylists_p[i]); + } +} + +void Curve::drawImplementation() +{ + createEnrichments(); + createData(); +} + +/*! + Calculates the smallest x-y-z parallelepiped enclosing the data. + It can be accessed by hull(); +*/ +void Curve::calculateHull() +{ + if (actualData_p->empty()) return; + + setHull(actualData_p->hull()); +} + +void Curve::updateData(bool coord) +{ + update_displaylists_ = true; + + if ( plot_p ) { + calculateHull(); + emit updatePlotData(coord); + } +} + +void Curve::queueUpdate() +{ + update_displaylists_ = true; + if ( plot_p ) { + emit updatePlot(); + } +} + +void Curve::updateNormals() +{ + SaveGlDeleteLists(displaylists_p[NormalObject], 1); + + if (plotStyle() == NOPLOT && !normals() || !actualData_p) return; + + displaylists_p[NormalObject] = glGenLists(1); + glNewList(displaylists_p[NormalObject], GL_COMPILE); + + if (actualData_p->datatype == Qwt3D::POLYGON) + createNormalsC(); + else if (actualData_p->datatype == Qwt3D::GRID) + createNormalsG(); + + glEndList(); +} + +void Curve::createData() +{ + if (!actualData_p) return; + + switch (shading_) { + case FLAT: + glShadeModel(GL_FLAT); + break; + case GOURAUD: + glShadeModel(GL_SMOOTH); + break; + default: + break; + } + + if (actualData_p->datatype == Qwt3D::POLYGON) + createDataC(); + else if (actualData_p->datatype == Qwt3D::GRID) + createDataG(); +} + +void Curve::createFloorData() +{ + if (!actualData_p) return; + + if (actualData_p->datatype == Qwt3D::POLYGON) + createFloorDataC(); + else if (actualData_p->datatype == Qwt3D::GRID) + createFloorDataG(); +} + +void Curve::createSideData() +{ + if (!actualData_p) return; + + if (actualData_p->datatype == Qwt3D::POLYGON) + createSideDataC(); + else if (actualData_p->datatype == Qwt3D::GRID) + createSideDataG(); +} + +void Curve::createFaceData() +{ + if (!actualData_p) return; + + if (actualData_p->datatype == Qwt3D::POLYGON) + createFaceDataC(); + else if (actualData_p->datatype == Qwt3D::GRID) + createFaceDataG(); +} + +/*! + The returned value is not affected by resolution(). The pair gives (columns,rows) for grid data, + (number of cells,1) for free formed data (datatype() == POLYGON) and (0,0) else +*/ +pair Curve::facets() const +{ + if (!hasData()) { + qDebug() << "Curve: has no data, no facets found!" << this; + if (actualData_p) qDebug() << "Curve: Grid type -" << (actualData_p->datatype == Qwt3D::GRID); + if (actualData_p->datatype == Qwt3D::POLYGON) + qDebug() << "Curve: Polygon data -" << actualDataC_->cells.size(); + else if (actualData_p->datatype == Qwt3D::GRID) + qDebug() << "Curve: Grid data -" << actualDataG_->columns() << actualDataG_->rows(); + return pair(0,0); + } + + if (actualData_p->datatype == Qwt3D::POLYGON) + return pair(int(actualDataC_->cells.size()), 1); + else if (actualData_p->datatype == Qwt3D::GRID) + return pair(actualDataG_->columns(), actualDataG_->rows()); + else + return pair(0,0); +} + +void Curve::createPoints() +{ +// Dot pt; +// Cone d(15,32); +// CrossHair d(0.003,0,true,false); + + Dot pt(5,true); + createEnrichment(pt); +} + +Enrichment* Curve::addEnrichment(Enrichment const& e) +{ + ELIT it = std::find( elist_p.begin(), elist_p.end(), &e ); + if ( elist_p.end() == it ) { + elist_p.push_back(e.clone()); + update_displaylists_ = true; + } else return *it; + + return elist_p.back(); +} + +bool Curve::degrade(Enrichment* e) +{ + ELIT it = std::find(elist_p.begin(), elist_p.end(), e); + + if ( it != elist_p.end() ) { + delete (*it); + elist_p.erase(it); + update_displaylists_ = true; + return true; + } + return false; +} + +void Curve::clearEnrichments() +{ + for (ELIT it = elist_p.begin(); it != elist_p.end(); ++it) + this->degrade(*it); +} + +void Curve::createEnrichments() +{ + for (ELIT it = elist_p.begin(); it!=elist_p.end(); ++it) + this->createEnrichment(**it); +} + +void Curve::createEnrichment(Enrichment& p) +{ + if (!actualData_p) return; + + //todo future work + if (p.type() != Enrichment::VERTEXENRICHMENT) return; + + p.assign(*this); + p.drawBegin(); + + VertexEnrichment* ve = (VertexEnrichment*)&p; + if (actualData_p->datatype == Qwt3D::POLYGON) { + for (unsigned i = 0; i != actualDataC_->normals.size(); ++i) + ve->draw(actualDataC_->nodes[i]); + } else if (actualData_p->datatype == Qwt3D::GRID) { + int step = resolution(); + for (int i = 0; i <= actualDataG_->columns() - step; i += step) + for (int j = 0; j <= actualDataG_->rows() - step; j += step) + ve->draw(Triple(actualDataG_->vertices[i][j][0], + actualDataG_->vertices[i][j][1], + actualDataG_->vertices[i][j][2])); + } + + p.drawEnd(); +} + +void Curve::drawVertex(Triple& vertex, double shift, unsigned int comp) +{ + switch (comp) { + case 0: + glVertex3d(shift, vertex.y, vertex.z); break; + case 1: + glVertex3d(vertex.x, shift, vertex.z); break; + case 2: + glVertex3d(vertex.x, vertex.y, shift); break; + default: + glVertex3d(vertex.x, vertex.y, vertex.z); + } +} + +void Curve::drawIntersections(vector& intersection, double shift, unsigned int comp, + bool projected, vector* colour) +{ + if (intersection.empty()) + return; + + if (intersection.size() > 2) { + glBegin(GL_LINE_STRIP); + for (unsigned dd = 0; dd!=intersection.size(); ++dd) { + if (colour) glColor4d((*colour)[dd].r, (*colour)[dd].g, (*colour)[dd].b, (*colour)[dd].a); + drawVertex(intersection[dd], shift, comp); + } + glEnd(); + + if (projected) { + glBegin(GL_POINTS); + drawVertex(intersection[0], shift, comp); + glEnd(); + } + } else if (intersection.size() == 2) { + glBegin(GL_LINES); + drawVertex(intersection[0], shift, comp); + drawVertex(intersection[1], shift, comp); + + // small pixel gap problem (see OpenGL spec.) + drawVertex(intersection[1], shift, comp); + drawVertex(intersection[0], shift, comp); + glEnd(); + + if (projected) { + glBegin(GL_POINTS); + drawVertex(intersection[0], shift, comp); + drawVertex(intersection[1], shift, comp); + glEnd(); + } + } + + intersection.clear(); +} + +/*! +Set relative caption position (0.5,0.5) means, the anchor point lies in the center of the screen +*/ +void Curve::setTitlePosition(double rely, double relx, Qwt3D::ANCHOR anchor) +{ + titlerel_.y = (rely < 0 || rely > 1) ? 0.5 : rely; + titlerel_.x = (relx < 0 || relx > 1) ? 0.5 : relx; + + titleanchor_ = anchor; +} + +/*! +Set caption font +*/ +void Curve::setTitleFont(const QString& family, int pointSize, int weight, bool italic) +{ + title_p->setFont(family, pointSize, weight, italic); + + titlespace_ = ((pointSize/8.0 + weight/50.0)*0.01); // factor in pointsize & weight to title spacing + setTitlePosition(0.98 - (titlepos_ * titlespace_)); +} + +/*! + Sets data resolution (res == 1 original resolution) and updates widget + If res < 1, the function does nothing +*/ +void Curve::setResolution(int res) +{ + if (!actualData_p || actualData_p->datatype == Qwt3D::POLYGON) + return; + + if ((resolution_p == res) || res < 1) + return; + + resolution_p = res; + calculateHull(); + update_displaylists_ = true; + + emit resolutionChanged(res); +} + +void Curve::setProjection(Qwt3D::PROJECTMODE val, bool toggle) +{ + switch(val) { + case Qwt3D::FACE: + facemode_ = toggle; break; + case Qwt3D::SIDE: + sidemode_ = toggle; break; + case Qwt3D::BASE: + floormode_ = toggle; break; + } +} + +void Curve::setMeshColor(RGBA rgba) +{ + meshcolor_ = rgba; + update_displaylists_ = true; +} + +/*! + Assign a new coloring object for the data. +*/ +void Curve::setDataColor(Color* col) +{ + Q_ASSERT(datacolor_p); + + if (col == datacolor_p) return; + + datacolor_p->destroy(); + datacolor_p = col; + update_displaylists_ = true; +} + +void Curve::showNormals(bool b) +{ + datanormals_p = b; + update_displaylists_ = true; +} + +/*! + Values < 0 or > 1 are ignored +*/ +void Curve::setNormalLength(double val) +{ + if (val < 0 || val > 1) return; + + normalLength_p = val; + update_displaylists_ = true; +} + +/*! + Values < 3 are ignored +*/ +void Curve::setNormalQuality(int val) +{ + if (val < 3) return; + + normalQuality_p = val; + update_displaylists_ = true; +} + +/*! + Set plotstyle for the standard plotting types. An argument of value Qwt3D::USER is ignored. +*/ +void Curve::setPlotStyle( PLOTSTYLE val ) +{ + if (val == Qwt3D::USER) return; + + if ( val == plotstyle_ ) return; + + delete userplotstyle_p; + userplotstyle_p = 0; + plotstyle_ = val; + update_displaylists_ = true; +} + +/*! + Set plotstyle to Qwt3D::USER and an associated enrichment object. +*/ +void Curve::setPlotStyle( Qwt3D::Enrichment& obj ) +{ + if (&obj == userplotstyle_p) return; + + userplotstyle_p = obj.clone(); + plotstyle_ = Qwt3D::USER; + update_displaylists_ = true; +} + +/*! + Set shading style +*/ +void Curve::setShading( SHADINGSTYLE val ) +{ + if (val == shading_) return; + + shading_ = val; + update_displaylists_ = true; +} + +/*! + Set number of isolines. The lines are equidistant between minimal and maximal Z value +*/ +void Curve::setIsolines(unsigned int steps) +{ + if (steps == isolines_) return; + + isolines_ = steps; + update_displaylists_ = true; +} + +/*! + Set Polygon offset. The function affects the OpenGL rendering process. + Try different values for surfaces with polygons only and with mesh and polygons +*/ +void Curve::setPolygonOffset( double val ) +{ + if ( val == polygonOffset_ ) return; + + polygonOffset_ = val; + update_displaylists_ = true; +} + +void Curve::setMeshLineWidth( double val ) +{ + Q_ASSERT(val >= 0); + + if (val < 0 || val == meshLineWidth_ ) return; + + meshLineWidth_ = val; + update_displaylists_ = true; +} + +void Curve::showColorLegend(bool show) +{ + displaylegend_ = show; + + if (show) { + Color* color = const_cast(dataColor()); + if (color) color->createVector(legend_.colors); + } + updateData(false); +} + +void Curve::updateColorLegend(int majors, int minors) +{ + if (legend_.axis()->majors() != majors) legend_.setMajors(majors); + if (legend_.axis()->minors() != minors) legend_.setMinors(minors); + + ParallelEpiped hull = data()->hull(); + pair limits(hull.minVertex.z, hull.maxVertex.z); + + legend_.setLimits(limits.first, limits.second); +} + +void Curve::setColorLegend(int index, bool doublemode, QSize size, QPoint pos) +{ + double w = size.width()/100.0, h = size.height()/100.0; // legend color vector as screen size percentage + double x = pos.x()/100.0, y = pos.y()/100.0; // legend anchor as screen position percentage + + switch(index) { + case 0: + legend_.setOrientation(ColorLegend::BottomTop, ColorLegend::Left); + legend_.setRelPosition(Tuple(1-x-w, 0.5+y), Tuple(1-x, 0.5+y+h)); + break; + case 1: + if (doublemode) { + legend_.setOrientation(ColorLegend::BottomTop, ColorLegend::Right); + legend_.setRelPosition(Tuple(1-x, 0.5+y), Tuple(1-x+w, 0.5+y+h)); + } else { + legend_.setOrientation(ColorLegend::BottomTop, ColorLegend::Left); + legend_.setRelPosition(Tuple(1-x-w, 0.5-y-h), Tuple(1-x, 0.5-y)); + } + break; + case 2: + if (doublemode) { + legend_.setOrientation(ColorLegend::BottomTop, ColorLegend::Left); + legend_.setRelPosition(Tuple(1-x-w, 0.5-y-h), Tuple(1-x, 0.5-y)); + } else { + legend_.setOrientation(ColorLegend::LeftRight, ColorLegend::Top); + legend_.setRelPosition(Tuple(0.5+y, x), Tuple(0.5+y+h, x+w)); + } + break; + case 3: + if (doublemode) { + legend_.setOrientation(ColorLegend::BottomTop, ColorLegend::Right); + legend_.setRelPosition(Tuple(1-x, 0.5-y-h), Tuple(1-x+w, 0.5-y)); + } else { + legend_.setOrientation(ColorLegend::LeftRight, ColorLegend::Top); + legend_.setRelPosition(Tuple(0.5-y-h, x), Tuple(0.5-y, x+w)); + } + break; + case 4: + if (doublemode) { + legend_.setOrientation(ColorLegend::LeftRight, ColorLegend::Top); + legend_.setRelPosition(Tuple(0.5+y, x), Tuple(0.5+y+h, x+w)); + } else { + legend_.setOrientation(ColorLegend::BottomTop, ColorLegend::Right); + legend_.setRelPosition(Tuple(x, 0.5-y-h), Tuple(x+w, 0.5-y)); + } + break; + case 5: + if (doublemode) { + legend_.setOrientation(ColorLegend::LeftRight, ColorLegend::Bottom); + legend_.setRelPosition(Tuple(0.5+y, x-w), Tuple(0.5+y+h, x)); + } else { + legend_.setOrientation(ColorLegend::BottomTop, ColorLegend::Right); + legend_.setRelPosition(Tuple(x, 0.5+y), Tuple(x+w, 0.5+y+h)); + } + break; + case 6: + if (doublemode) { + legend_.setOrientation(ColorLegend::LeftRight, ColorLegend::Top); + legend_.setRelPosition(Tuple(0.5-y-h, x), Tuple(0.5-y, x+w)); + } else { + legend_.setOrientation(ColorLegend::LeftRight, ColorLegend::Bottom); + legend_.setRelPosition(Tuple(0.5-y-h, 1-x-w), Tuple(0.5-y, 1-x)); + } + break; + case 7: + if (doublemode) { + legend_.setOrientation(ColorLegend::LeftRight, ColorLegend::Bottom); + legend_.setRelPosition(Tuple(0.5-y-h, x-w), Tuple(0.5-y, x)); + } else { + legend_.setOrientation(ColorLegend::LeftRight, ColorLegend::Bottom); + legend_.setRelPosition(Tuple(0.5+y, 1-x-w), Tuple(0.5+y+h, 1-x)); + } + break; + case 8: + if (doublemode) { + legend_.setOrientation(ColorLegend::BottomTop, ColorLegend::Right); + legend_.setRelPosition(Tuple(x, 0.5-y-h), Tuple(x+w, 0.5-y)); + } + break; + case 9: + if (doublemode) { + legend_.setOrientation(ColorLegend::BottomTop, ColorLegend::Left); + legend_.setRelPosition(Tuple(x-w, 0.5-y-h), Tuple(x, 0.5-y)); + } + break; + case 10: + if (doublemode) { + legend_.setOrientation(ColorLegend::BottomTop, ColorLegend::Right); + legend_.setRelPosition(Tuple(x, 0.5+y), Tuple(x+w, 0.5+y+h)); + } + break; + case 11: + if (doublemode) { + legend_.setOrientation(ColorLegend::BottomTop, ColorLegend::Left); + legend_.setRelPosition(Tuple(x-w, 0.5+y), Tuple(x, 0.5+y+h)); + } + break; + case 12: + if (doublemode) { + legend_.setOrientation(ColorLegend::LeftRight, ColorLegend::Bottom); + legend_.setRelPosition(Tuple(0.5-y-h, 1-x-w), Tuple(0.5-y, 1-x)); + } + break; + case 13: + if (doublemode) { + legend_.setOrientation(ColorLegend::LeftRight, ColorLegend::Top); + legend_.setRelPosition(Tuple(0.5-y-h, 1-x), Tuple(0.5-y, 1-x+w)); + } + break; + case 14: + if (doublemode) { + legend_.setOrientation(ColorLegend::LeftRight, ColorLegend::Bottom); + legend_.setRelPosition(Tuple(0.5+y, 1-x-w), Tuple(0.5+y+h, 1-x)); + } + break; + case 15: + if (doublemode) { + legend_.setOrientation(ColorLegend::LeftRight, ColorLegend::Top); + legend_.setRelPosition(Tuple(0.5+y, 1-x), Tuple(0.5+y+h, 1-x+w)); + } + break; + default: + break; + } +} === added file '3rdparty/qwtplot3d/src/qwt3d_dataviews.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_dataviews.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_dataviews.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,10 @@ +#if defined(_MSC_VER) /* MSVC Compiler */ +#pragma warning ( disable : 4305 ) +#pragma warning ( disable : 4786 ) +#endif + +#include "qwt3d_plot.h" + +using namespace std; +using namespace Qwt3D; + === removed file '3rdparty/qwtplot3d/src/qwt3d_dataviews.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_dataviews.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_dataviews.cpp 1970-01-01 00:00:00 +0000 @@ -1,10 +0,0 @@ -#if defined(_MSC_VER) /* MSVC Compiler */ -#pragma warning ( disable : 4305 ) -#pragma warning ( disable : 4786 ) -#endif - -#include "qwt3d_plot.h" - -using namespace std; -using namespace Qwt3D; - === added file '3rdparty/qwtplot3d/src/qwt3d_drawable.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_drawable.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_drawable.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,140 @@ +#include "qwt3d_drawable.h" + +using namespace Qwt3D; + +Drawable::~Drawable() +{ + detachAll(); +} + +void Drawable::saveGLState() +{ + glGetBooleanv(GL_LINE_SMOOTH, &ls); + glGetBooleanv(GL_POLYGON_SMOOTH, &pols); + glGetFloatv(GL_LINE_WIDTH, &lw); + glGetIntegerv(GL_BLEND_SRC, &blsrc); + glGetIntegerv(GL_BLEND_DST, &bldst); + glGetDoublev(GL_CURRENT_COLOR, col); + glGetIntegerv(GL_LINE_STIPPLE_PATTERN, &pattern); + glGetIntegerv(GL_LINE_STIPPLE_REPEAT, &factor); + glGetBooleanv(GL_LINE_STIPPLE, &sallowed); + glGetBooleanv(GL_TEXTURE_2D, &tex2d); + glGetIntegerv(GL_POLYGON_MODE, polmode); + glGetIntegerv(GL_MATRIX_MODE, &matrixmode); + glGetFloatv(GL_POLYGON_OFFSET_FACTOR, &poloffs[0]); + glGetFloatv(GL_POLYGON_OFFSET_UNITS, &poloffs[1]); + glGetBooleanv(GL_POLYGON_OFFSET_FILL, &poloffsfill); +} + +void Drawable::restoreGLState() +{ + Enable(GL_LINE_SMOOTH, ls); + Enable(GL_POLYGON_SMOOTH, pols); + + setDeviceLineWidth(lw); + glBlendFunc(blsrc, bldst); + glColor4dv(col); + + glLineStipple(factor,pattern); + Enable(GL_LINE_STIPPLE,sallowed); + Enable(GL_TEXTURE_2D,tex2d); + glPolygonMode(polmode[0], polmode[1]); + glMatrixMode(matrixmode); + glPolygonOffset(poloffs[0], poloffs[1]); + setDevicePolygonOffset(poloffs[0], poloffs[1]); + + Enable(GL_POLYGON_OFFSET_FILL, poloffsfill); +} + +void Drawable::Enable(GLenum what, GLboolean val) +{ + if (val) + glEnable(what); + else + glDisable(what); +} + +void Drawable::attach(Drawable* dr) +{ + if ( dlist.end() == std::find( dlist.begin(), dlist.end(), dr ) ) + if (dr){ + dr->setPlot(d_plot); + dlist.push_back(dr); + } +} + +void Drawable::detach(Drawable* dr) +{ + std::list::iterator it = std::find(dlist.begin(), dlist.end(), dr); + + if ( it != dlist.end() ) + { + dlist.erase(it); + } +} +void Drawable::detachAll() +{ + dlist.clear(); +} + + +//! simplified glut routine (glUnProject): windows coordinates_p --> object coordinates_p +/** + Don't rely on (use) this in display lists ! +*/ +Triple Drawable::ViewPort2World(Triple win, bool* err) +{ + Triple obj; + + getMatrices(modelMatrix, projMatrix, viewport); + int res = gluUnProject(win.x, win.y, win.z, modelMatrix, projMatrix, viewport, &obj.x, &obj.y, &obj.z); + + if (err) + *err = (res) ? false : true; + return obj; +} + +//! simplified glut routine (glProject): object coordinates_p --> windows coordinates_p +/** + Don't rely on (use) this in display lists ! +*/ +Triple Drawable::World2ViewPort(Triple obj, bool* err) +{ + Triple win; + + getMatrices(modelMatrix, projMatrix, viewport); + int res = gluProject(obj.x, obj.y, obj.z, modelMatrix, projMatrix, viewport, &win.x, &win.y, &win.z); + + if (err) + *err = (res) ? false : true; + return win; +} + +/** + Don't rely on (use) this in display lists ! +*/ +Triple Drawable::relativePosition(Triple rel) +{ + return ViewPort2World(Triple((rel.x-viewport[0])*viewport[2],(rel.y-viewport[1])*viewport[3],rel.z)); +} + +void Drawable::draw() +{ + saveGLState(); + + for (std::list::iterator it = dlist.begin(); it!=dlist.end(); ++it) + { + (*it)->draw(); + } + restoreGLState(); +} + +void Drawable::setColor(double r, double g, double b, double a) +{ + color = RGBA(r,g,b,a); +} + +void Drawable::setColor(RGBA rgba) +{ + color = rgba; +} === removed file '3rdparty/qwtplot3d/src/qwt3d_drawable.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_drawable.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_drawable.cpp 1970-01-01 00:00:00 +0000 @@ -1,140 +0,0 @@ -#include "qwt3d_drawable.h" - -using namespace Qwt3D; - -Drawable::~Drawable() -{ - detachAll(); -} - -void Drawable::saveGLState() -{ - glGetBooleanv(GL_LINE_SMOOTH, &ls); - glGetBooleanv(GL_POLYGON_SMOOTH, &pols); - glGetFloatv(GL_LINE_WIDTH, &lw); - glGetIntegerv(GL_BLEND_SRC, &blsrc); - glGetIntegerv(GL_BLEND_DST, &bldst); - glGetDoublev(GL_CURRENT_COLOR, col); - glGetIntegerv(GL_LINE_STIPPLE_PATTERN, &pattern); - glGetIntegerv(GL_LINE_STIPPLE_REPEAT, &factor); - glGetBooleanv(GL_LINE_STIPPLE, &sallowed); - glGetBooleanv(GL_TEXTURE_2D, &tex2d); - glGetIntegerv(GL_POLYGON_MODE, polmode); - glGetIntegerv(GL_MATRIX_MODE, &matrixmode); - glGetFloatv(GL_POLYGON_OFFSET_FACTOR, &poloffs[0]); - glGetFloatv(GL_POLYGON_OFFSET_UNITS, &poloffs[1]); - glGetBooleanv(GL_POLYGON_OFFSET_FILL, &poloffsfill); -} - -void Drawable::restoreGLState() -{ - Enable(GL_LINE_SMOOTH, ls); - Enable(GL_POLYGON_SMOOTH, pols); - - setDeviceLineWidth(lw); - glBlendFunc(blsrc, bldst); - glColor4dv(col); - - glLineStipple(factor,pattern); - Enable(GL_LINE_STIPPLE,sallowed); - Enable(GL_TEXTURE_2D,tex2d); - glPolygonMode(polmode[0], polmode[1]); - glMatrixMode(matrixmode); - glPolygonOffset(poloffs[0], poloffs[1]); - setDevicePolygonOffset(poloffs[0], poloffs[1]); - - Enable(GL_POLYGON_OFFSET_FILL, poloffsfill); -} - -void Drawable::Enable(GLenum what, GLboolean val) -{ - if (val) - glEnable(what); - else - glDisable(what); -} - -void Drawable::attach(Drawable* dr) -{ - if ( dlist.end() == std::find( dlist.begin(), dlist.end(), dr ) ) - if (dr){ - dr->setPlot(d_plot); - dlist.push_back(dr); - } -} - -void Drawable::detach(Drawable* dr) -{ - std::list::iterator it = std::find(dlist.begin(), dlist.end(), dr); - - if ( it != dlist.end() ) - { - dlist.erase(it); - } -} -void Drawable::detachAll() -{ - dlist.clear(); -} - - -//! simplified glut routine (glUnProject): windows coordinates_p --> object coordinates_p -/** - Don't rely on (use) this in display lists ! -*/ -Triple Drawable::ViewPort2World(Triple win, bool* err) -{ - Triple obj; - - getMatrices(modelMatrix, projMatrix, viewport); - int res = gluUnProject(win.x, win.y, win.z, modelMatrix, projMatrix, viewport, &obj.x, &obj.y, &obj.z); - - if (err) - *err = (res) ? false : true; - return obj; -} - -//! simplified glut routine (glProject): object coordinates_p --> windows coordinates_p -/** - Don't rely on (use) this in display lists ! -*/ -Triple Drawable::World2ViewPort(Triple obj, bool* err) -{ - Triple win; - - getMatrices(modelMatrix, projMatrix, viewport); - int res = gluProject(obj.x, obj.y, obj.z, modelMatrix, projMatrix, viewport, &win.x, &win.y, &win.z); - - if (err) - *err = (res) ? false : true; - return win; -} - -/** - Don't rely on (use) this in display lists ! -*/ -Triple Drawable::relativePosition(Triple rel) -{ - return ViewPort2World(Triple((rel.x-viewport[0])*viewport[2],(rel.y-viewport[1])*viewport[3],rel.z)); -} - -void Drawable::draw() -{ - saveGLState(); - - for (std::list::iterator it = dlist.begin(); it!=dlist.end(); ++it) - { - (*it)->draw(); - } - restoreGLState(); -} - -void Drawable::setColor(double r, double g, double b, double a) -{ - color = RGBA(r,g,b,a); -} - -void Drawable::setColor(RGBA rgba) -{ - color = rgba; -} === added file '3rdparty/qwtplot3d/src/qwt3d_enrichment_std.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_enrichment_std.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_enrichment_std.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,345 @@ +#include +#include "qwt3d_color.h" +#include "qwt3d_curve.h" +#include "qwt3d_enrichment_std.h" + +using namespace Qwt3D; + + +///////////////////////////////////////////////////////////////// +// +// CrossHair +// +///////////////////////////////////////////////////////////////// + +CrossHair::CrossHair() +{ + configure(0, 1, false, false); +} + +CrossHair::CrossHair(double rad, double linewidth, bool smooth, bool boxed) +{ + configure(rad, linewidth, smooth, boxed); +} + +void CrossHair::configure(double rad, double linewidth, bool smooth, bool boxed) +{ + plot = 0; + radius_ = rad; + linewidth_ = linewidth; + smooth_ = smooth; + boxed_ = boxed; +} + +void CrossHair::drawBegin() +{ + setDeviceLineWidth( linewidth_ ); + oldstate_ = glIsEnabled(GL_LINE_SMOOTH); + if (smooth_) + glEnable(GL_LINE_SMOOTH); + else + glDisable(GL_LINE_SMOOTH); + glBegin( GL_LINES ); +} + +void CrossHair::drawEnd() +{ + glEnd(); + + if (oldstate_) + glEnable(GL_LINE_SMOOTH); + else + glDisable(GL_LINE_SMOOTH); +} + +void CrossHair::draw(Qwt3D::Triple const& pos) +{ + RGBA rgba = (*plot->dataColor())(pos); + glColor4d(rgba.r,rgba.g,rgba.b,rgba.a); + + double diag = (plot->hull().maxVertex-plot->hull().minVertex).length() * radius_; + + glVertex3d( pos.x - diag, pos.y, pos.z); + glVertex3d( pos.x + diag, pos.y, pos.z); + + glVertex3d( pos.x, pos.y - diag, pos.z); + glVertex3d( pos.x, pos.y + diag, pos.z); + + glVertex3d( pos.x, pos.y, pos.z - diag); + glVertex3d( pos.x, pos.y, pos.z + diag); + + // hull + + if (!boxed_) + return; + + glVertex3d( pos.x - diag, pos.y - diag, pos.z + diag); + glVertex3d( pos.x + diag, pos.y - diag, pos.z + diag); + glVertex3d( pos.x - diag, pos.y - diag, pos.z - diag); + glVertex3d( pos.x + diag, pos.y - diag, pos.z - diag); + + glVertex3d( pos.x - diag, pos.y + diag, pos.z + diag); + glVertex3d( pos.x + diag, pos.y + diag, pos.z + diag); + glVertex3d( pos.x - diag, pos.y + diag, pos.z - diag); + glVertex3d( pos.x + diag, pos.y + diag, pos.z - diag); + + glVertex3d( pos.x - diag, pos.y - diag, pos.z + diag); + glVertex3d( pos.x - diag, pos.y + diag, pos.z + diag); + glVertex3d( pos.x - diag, pos.y - diag, pos.z - diag); + glVertex3d( pos.x - diag, pos.y + diag, pos.z - diag); + + glVertex3d( pos.x + diag, pos.y - diag, pos.z + diag); + glVertex3d( pos.x + diag, pos.y + diag, pos.z + diag); + glVertex3d( pos.x + diag, pos.y - diag, pos.z - diag); + glVertex3d( pos.x + diag, pos.y + diag, pos.z - diag); + + glVertex3d( pos.x - diag, pos.y - diag, pos.z - diag); + glVertex3d( pos.x - diag, pos.y - diag, pos.z + diag); + glVertex3d( pos.x + diag, pos.y - diag, pos.z - diag); + glVertex3d( pos.x + diag, pos.y - diag, pos.z + diag); + + glVertex3d( pos.x - diag, pos.y + diag, pos.z - diag); + glVertex3d( pos.x - diag, pos.y + diag, pos.z + diag); + glVertex3d( pos.x + diag, pos.y + diag, pos.z - diag); + glVertex3d( pos.x + diag, pos.y + diag, pos.z + diag); +} + +///////////////////////////////////////////////////////////////// +// +// Dot +// +///////////////////////////////////////////////////////////////// + +Dot::Dot() +{ + configure(1, false); +} + +Dot::Dot(double pointsize, bool smooth) +{ + configure(pointsize, smooth); +} + +void Dot::configure(double pointsize, bool smooth) +{ + plot = 0; + pointsize_ = pointsize; + smooth_ = smooth; +} + +void Dot::drawBegin() +{ + setDevicePointSize( pointsize_ ); + oldstate_ = glIsEnabled(GL_POINT_SMOOTH); + if (smooth_) + glEnable(GL_POINT_SMOOTH); + else + glDisable(GL_POINT_SMOOTH); + + //glPointSize(10); + glBegin( GL_POINTS ); +} + +void Dot::drawEnd() +{ + glEnd(); + + if (oldstate_) + glEnable(GL_POINT_SMOOTH); + else + glDisable(GL_POINT_SMOOTH); +} + +void Dot::draw(Qwt3D::Triple const& pos) +{ + RGBA rgba = (*plot->dataColor())(pos); + glColor4d(rgba.r,rgba.g,rgba.b,rgba.a); + glVertex3d( pos.x, pos.y, pos.z); +} + + +///////////////////////////////////////////////////////////////// +// +// Cone +// +///////////////////////////////////////////////////////////////// + +Cone::Cone() +{ + hat = gluNewQuadric(); + disk = gluNewQuadric(); + + configure(0, 3); +} + +Cone::Cone(double rad, unsigned quality) +{ + hat = gluNewQuadric(); + disk = gluNewQuadric(); + + configure(rad, quality); +} + +Cone::~Cone() +{ + gluDeleteQuadric(hat); + gluDeleteQuadric(disk); +} + +void Cone::configure(double rad, unsigned quality) +{ + plot = 0; + radius_ = rad; + quality_ = quality; + oldstate_ = GL_FALSE; + + gluQuadricDrawStyle(hat,GLU_FILL); + gluQuadricNormals(hat,GLU_SMOOTH); + gluQuadricOrientation(hat,GLU_OUTSIDE); + gluQuadricDrawStyle(disk,GLU_FILL); + gluQuadricNormals(disk,GLU_SMOOTH); + gluQuadricOrientation(disk,GLU_OUTSIDE); +} + +void Cone::draw(Qwt3D::Triple const& pos) +{ + RGBA rgba = (*plot->dataColor())(pos); + glColor4d(rgba.r,rgba.g,rgba.b,rgba.a); + + GLint mode; + glGetIntegerv(GL_MATRIX_MODE, &mode); + glMatrixMode( GL_MODELVIEW ); + glPushMatrix(); + + glTranslatef(pos.x, pos.y, pos.z); + + gluCylinder(hat, 0.0, radius_, radius_*2, quality_, 1); + glTranslatef(0, 0, radius_*2); + gluDisk(disk, 0.0, radius_, quality_, 1); + + glPopMatrix(); + glMatrixMode(mode); +} + + +///////////////////////////////////////////////////////////////// +// +// Arrow +// +///////////////////////////////////////////////////////////////// + +Arrow::Arrow() +{ + hat = gluNewQuadric(); + disk = gluNewQuadric(); + base = gluNewQuadric(); + bottom = gluNewQuadric(); + + gluQuadricDrawStyle(hat,GLU_FILL); + gluQuadricNormals(hat,GLU_SMOOTH); + gluQuadricOrientation(hat,GLU_OUTSIDE); + gluQuadricDrawStyle(disk,GLU_FILL); + gluQuadricNormals(disk,GLU_SMOOTH); + gluQuadricOrientation(disk,GLU_OUTSIDE); + gluQuadricDrawStyle(base,GLU_FILL); + gluQuadricNormals(base,GLU_SMOOTH); + gluQuadricOrientation(base,GLU_OUTSIDE); + gluQuadricDrawStyle(bottom,GLU_FILL); + gluQuadricNormals(bottom,GLU_SMOOTH); + gluQuadricOrientation(bottom,GLU_OUTSIDE); + + configure(3, 0.4, 0.06, 0.02); +} + +Arrow::~Arrow() +{ + gluDeleteQuadric(hat); + gluDeleteQuadric(disk); + gluDeleteQuadric(base); + gluDeleteQuadric(bottom); +} + +/** +\param segs number of faces for the fields arrows (see the gallery for examples) +\param relconelength see picture +\param relconerad see picture +\param relstemrad see picture +\image html arrowanatomy.png +*/ +void Arrow::configure(int segs, double relconelength, double relconerad, double relstemrad) +{ + plot = 0; + segments_ = segs; + oldstate_ = GL_FALSE; + rel_cone_length = relconelength; + rel_cone_radius = relconerad; + rel_stem_radius = relstemrad; +} + +void Arrow::draw(Qwt3D::Triple const& pos) +{ + Triple end = top_; + Triple beg = pos; + Triple vdiff = end-beg; + double length = vdiff.length(); + glColor4d(rgba_.r,rgba_.g,rgba_.b,rgba_.a); + + double radius[2]; + radius[0] = rel_cone_radius * length; + radius[1] = rel_stem_radius * length; + + GLint mode; + glGetIntegerv(GL_MATRIX_MODE, &mode); + + glMatrixMode( GL_MODELVIEW ); + glPushMatrix(); + + + Triple axis; + double phi = calcRotation(axis, FreeVector(beg,end)); + + glTranslatef(beg.x, beg.y, beg.z); + glRotatef(phi, axis.x, axis.y, axis.z); + + double baseheight = (1-rel_cone_length) * length; + + glTranslatef(0, 0, baseheight); + + gluCylinder(hat, radius[0], 0.0, rel_cone_length * length, segments_,1); + gluDisk(disk,radius[1],radius[0], segments_,1); + + glTranslatef(0, 0, -baseheight); + + gluCylinder(base, radius[1],radius[1], baseheight,segments_,1); + gluDisk(disk,0,radius[1],segments_,1); + + glPopMatrix(); + glMatrixMode(mode); +} + + +//! transform a vector on the z axis with length |beg-end|, to get them in coincidence with the vector(beg,end) +/** + \return Angle in degree to rotate + \param axis The axis to rotate around + \param vec result vector of points +*/ +double Arrow::calcRotation(Triple& axis, FreeVector const& vec) +{ + Triple end = vec.top; // param end result vector top point + Triple beg = vec.base; // param beg result vector base point + + Triple firstbeg(0.0,0.0,0.0); + Triple firstend(0.0,0.0,(end-beg).length()); + + Triple first = firstend - firstbeg; + first.normalize(); + + Triple second = end-beg; + second.normalize(); + + axis = normalizedcross(first,second); + double cosphi = dotProduct(first,second); + + return 180 * acos(cosphi) / Qwt3D::PI; +} === removed file '3rdparty/qwtplot3d/src/qwt3d_enrichment_std.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_enrichment_std.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_enrichment_std.cpp 1970-01-01 00:00:00 +0000 @@ -1,347 +0,0 @@ -#include -#include "qwt3d_color.h" -#include "qwt3d_plot.h" -#include "qwt3d_enrichment_std.h" - -using namespace Qwt3D; - - -///////////////////////////////////////////////////////////////// -// -// CrossHair -// -///////////////////////////////////////////////////////////////// - -CrossHair::CrossHair() -{ - configure(0, 1, false, false); -} - -CrossHair::CrossHair(double rad, double linewidth, bool smooth, bool boxed) -{ - configure(rad, linewidth, smooth, boxed); -} - -void CrossHair::configure(double rad, double linewidth, bool smooth, bool boxed) -{ - plot = 0; - radius_ = rad; - linewidth_ = linewidth; - smooth_ = smooth; - boxed_ = boxed; -} - -void CrossHair::drawBegin() -{ - setDeviceLineWidth( linewidth_ ); - oldstate_ = glIsEnabled(GL_LINE_SMOOTH); - if (smooth_) - glEnable(GL_LINE_SMOOTH); - else - glDisable(GL_LINE_SMOOTH); - glBegin( GL_LINES ); -} - -void CrossHair::drawEnd() -{ - glEnd(); - - if (oldstate_) - glEnable(GL_LINE_SMOOTH); - else - glDisable(GL_LINE_SMOOTH); -} - -void CrossHair::draw(Qwt3D::Triple const& pos) -{ - RGBA rgba = (*plot->dataColor())(pos); - glColor4d(rgba.r,rgba.g,rgba.b,rgba.a); - - double diag = (plot->hull().maxVertex-plot->hull().minVertex).length() * radius_; - - glVertex3d( pos.x - diag, pos.y, pos.z); - glVertex3d( pos.x + diag, pos.y, pos.z); - - glVertex3d( pos.x, pos.y - diag, pos.z); - glVertex3d( pos.x, pos.y + diag, pos.z); - - glVertex3d( pos.x, pos.y, pos.z - diag); - glVertex3d( pos.x, pos.y, pos.z + diag); - - // hull - - if (!boxed_) - return; - - glVertex3d( pos.x - diag, pos.y - diag, pos.z + diag); - glVertex3d( pos.x + diag, pos.y - diag, pos.z + diag); - glVertex3d( pos.x - diag, pos.y - diag, pos.z - diag); - glVertex3d( pos.x + diag, pos.y - diag, pos.z - diag); - - glVertex3d( pos.x - diag, pos.y + diag, pos.z + diag); - glVertex3d( pos.x + diag, pos.y + diag, pos.z + diag); - glVertex3d( pos.x - diag, pos.y + diag, pos.z - diag); - glVertex3d( pos.x + diag, pos.y + diag, pos.z - diag); - - glVertex3d( pos.x - diag, pos.y - diag, pos.z + diag); - glVertex3d( pos.x - diag, pos.y + diag, pos.z + diag); - glVertex3d( pos.x - diag, pos.y - diag, pos.z - diag); - glVertex3d( pos.x - diag, pos.y + diag, pos.z - diag); - - glVertex3d( pos.x + diag, pos.y - diag, pos.z + diag); - glVertex3d( pos.x + diag, pos.y + diag, pos.z + diag); - glVertex3d( pos.x + diag, pos.y - diag, pos.z - diag); - glVertex3d( pos.x + diag, pos.y + diag, pos.z - diag); - - glVertex3d( pos.x - diag, pos.y - diag, pos.z - diag); - glVertex3d( pos.x - diag, pos.y - diag, pos.z + diag); - glVertex3d( pos.x + diag, pos.y - diag, pos.z - diag); - glVertex3d( pos.x + diag, pos.y - diag, pos.z + diag); - - glVertex3d( pos.x - diag, pos.y + diag, pos.z - diag); - glVertex3d( pos.x - diag, pos.y + diag, pos.z + diag); - glVertex3d( pos.x + diag, pos.y + diag, pos.z - diag); - glVertex3d( pos.x + diag, pos.y + diag, pos.z + diag); -} - -///////////////////////////////////////////////////////////////// -// -// Dot -// -///////////////////////////////////////////////////////////////// - -Dot::Dot() -{ - configure(1, false); -} - -Dot::Dot(double pointsize, bool smooth) -{ - configure(pointsize, smooth); -} - -void Dot::configure(double pointsize, bool smooth) -{ - plot = 0; - pointsize_ = pointsize; - smooth_ = smooth; -} - -void Dot::drawBegin() -{ - setDevicePointSize( pointsize_ ); - oldstate_ = glIsEnabled(GL_POINT_SMOOTH); - if (smooth_) - glEnable(GL_POINT_SMOOTH); - else - glDisable(GL_POINT_SMOOTH); - - //glPointSize(10); - glBegin( GL_POINTS ); -} - -void Dot::drawEnd() -{ - glEnd(); - - if (oldstate_) - glEnable(GL_POINT_SMOOTH); - else - glDisable(GL_POINT_SMOOTH); -} - -void Dot::draw(Qwt3D::Triple const& pos) -{ - RGBA rgba = (*plot->dataColor())(pos); - glColor4d(rgba.r,rgba.g,rgba.b,rgba.a); - glVertex3d( pos.x, pos.y, pos.z); -} - - -///////////////////////////////////////////////////////////////// -// -// Cone -// -///////////////////////////////////////////////////////////////// - -Cone::Cone() -{ - hat = gluNewQuadric(); - disk = gluNewQuadric(); - - configure(0, 3); -} - -Cone::Cone(double rad, unsigned quality) -{ - hat = gluNewQuadric(); - disk = gluNewQuadric(); - - configure(rad, quality); -} - -Cone::~Cone() -{ - gluDeleteQuadric(hat); - gluDeleteQuadric(disk); -} - -void Cone::configure(double rad, unsigned quality) -{ - plot = 0; - radius_ = rad; - quality_ = quality; - oldstate_ = GL_FALSE; - - gluQuadricDrawStyle(hat,GLU_FILL); - gluQuadricNormals(hat,GLU_SMOOTH); - gluQuadricOrientation(hat,GLU_OUTSIDE); - gluQuadricDrawStyle(disk,GLU_FILL); - gluQuadricNormals(disk,GLU_SMOOTH); - gluQuadricOrientation(disk,GLU_OUTSIDE); -} - -void Cone::draw(Qwt3D::Triple const& pos) -{ - RGBA rgba = (*plot->dataColor())(pos); - glColor4d(rgba.r,rgba.g,rgba.b,rgba.a); - - GLint mode; - glGetIntegerv(GL_MATRIX_MODE, &mode); - glMatrixMode( GL_MODELVIEW ); - glPushMatrix(); - - glTranslatef(pos.x, pos.y, pos.z); - - gluCylinder(hat, 0.0, radius_, radius_*2, quality_, 1); - glTranslatef(0, 0, radius_*2); - gluDisk(disk, 0.0, radius_, quality_, 1); - - glPopMatrix(); - glMatrixMode(mode); -} - - -///////////////////////////////////////////////////////////////// -// -// Arrow -// -///////////////////////////////////////////////////////////////// - -Arrow::Arrow() -{ - hat = gluNewQuadric(); - disk = gluNewQuadric(); - base = gluNewQuadric(); - bottom = gluNewQuadric(); - - gluQuadricDrawStyle(hat,GLU_FILL); - gluQuadricNormals(hat,GLU_SMOOTH); - gluQuadricOrientation(hat,GLU_OUTSIDE); - gluQuadricDrawStyle(disk,GLU_FILL); - gluQuadricNormals(disk,GLU_SMOOTH); - gluQuadricOrientation(disk,GLU_OUTSIDE); - gluQuadricDrawStyle(base,GLU_FILL); - gluQuadricNormals(base,GLU_SMOOTH); - gluQuadricOrientation(base,GLU_OUTSIDE); - gluQuadricDrawStyle(bottom,GLU_FILL); - gluQuadricNormals(bottom,GLU_SMOOTH); - gluQuadricOrientation(bottom,GLU_OUTSIDE); - - configure(3, 0.4, 0.06, 0.02); -} - -Arrow::~Arrow() -{ - gluDeleteQuadric(hat); - gluDeleteQuadric(disk); - gluDeleteQuadric(base); - gluDeleteQuadric(bottom); -} - -/** -\param segs number of faces for the fields arrows (see the gallery for examples) -\param relconelength see picture -\param relconerad see picture -\param relstemrad see picture -\image html arrowanatomy.png -*/ -void Arrow::configure(int segs, double relconelength, double relconerad, double relstemrad) -{ - plot = 0; - segments_ = segs; - oldstate_ = GL_FALSE; - rel_cone_length = relconelength; - rel_cone_radius = relconerad; - rel_stem_radius = relstemrad; -} - -void Arrow::draw(Qwt3D::Triple const& pos) -{ - Triple end = top_; - Triple beg = pos; - Triple vdiff = end-beg; - double length = vdiff.length(); - glColor4d(rgba_.r,rgba_.g,rgba_.b,rgba_.a); - - double radius[2]; - radius[0] = rel_cone_radius * length; - radius[1] = rel_stem_radius * length; - - GLint mode; - glGetIntegerv(GL_MATRIX_MODE, &mode); - - glMatrixMode( GL_MODELVIEW ); - glPushMatrix(); - - - Triple axis; - double phi = calcRotation(axis, FreeVector(beg,end)); - - glTranslatef(beg.x, beg.y, beg.z); - glRotatef(phi, axis.x, axis.y, axis.z); - - double baseheight = (1-rel_cone_length) * length; - - glTranslatef(0, 0, baseheight); - - gluCylinder(hat, radius[0], 0.0, rel_cone_length * length, segments_,1); - gluDisk(disk,radius[1],radius[0], segments_,1); - - glTranslatef(0, 0, -baseheight); - - gluCylinder(base, radius[1],radius[1], baseheight,segments_,1); - gluDisk(disk,0,radius[1],segments_,1); - - glPopMatrix(); - glMatrixMode(mode); -} - - -//! transform a vector on the z axis with length |beg-end|, to get them in coincidence with the vector(beg,end) -/** - \return Angle in degree to rotate - \param axis The axis to rotate around - \param beg result vector base point - \param end result vector top point -*/ -double Arrow::calcRotation(Triple& axis, FreeVector const& vec) -{ - - Triple end = vec.top; - Triple beg = vec.base; - - Triple firstbeg(0.0,0.0,0.0); - Triple firstend(0.0,0.0,(end-beg).length()); - - Triple first = firstend - firstbeg; - first.normalize(); - - Triple second = end-beg; - second.normalize(); - - axis = normalizedcross(first,second); - double cosphi = dotProduct(first,second); - - return 180 * acos(cosphi) / Qwt3D::PI; -} === added file '3rdparty/qwtplot3d/src/qwt3d_extglwidget.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_extglwidget.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_extglwidget.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,136 @@ +#if defined(_MSC_VER) /* MSVC Compiler */ +#pragma warning ( disable : 4305 ) +#pragma warning ( disable : 4786 ) +#endif + +#include +#include "qwt3d_extglwidget.h" + +using namespace std; +using namespace Qwt3D; + +#ifndef WHEEL_DELTA + #define WHEEL_DELTA 120 +#endif + + +/*! + This should be the first call in your derived classes constructors. +*/ +ExtGLWidget::ExtGLWidget( QWidget * parent, const QGLWidget * shareWidget) +: QGLWidget(parent, shareWidget) +{ + initializedGL_ = false; + xRot_ = yRot_ = zRot_ = 0.0; // default object rotation + + xShift_ = yShift_ = zShift_ = xVPShift_ = yVPShift_ = 0.0; + xScale_ = yScale_ = zScale_ = 1.0; + zoom_ = 1; + ortho_ = true; + lastMouseMovePosition_ = QPoint(0,0); + mpressed_ = false; + mouse_input_enabled_ = true; + + kbd_input_enabled_ = true; + + setFocusPolicy(Qt::StrongFocus); + assignMouse(Qt::LeftButton, + MouseState(Qt::LeftButton, Qt::ShiftModifier), Qt::LeftButton, + MouseState(Qt::LeftButton, Qt::AltModifier), + MouseState(Qt::LeftButton, Qt::AltModifier), + MouseState(Qt::LeftButton, Qt::AltModifier | Qt::ShiftModifier), + MouseState(Qt::LeftButton, Qt::AltModifier | Qt::ControlModifier), + MouseState(Qt::LeftButton, Qt::ControlModifier), + MouseState(Qt::LeftButton, Qt::ControlModifier)); + + + assignKeyboard(Qt::Key_Down, Qt::Key_Up, + KeyboardState(Qt::Key_Right, Qt::ShiftModifier), + KeyboardState(Qt::Key_Left, Qt::ShiftModifier), Qt::Key_Right, Qt::Key_Left, + KeyboardState(Qt::Key_Right, Qt::AltModifier), + KeyboardState(Qt::Key_Left, Qt::AltModifier), + KeyboardState(Qt::Key_Down, Qt::AltModifier), + KeyboardState(Qt::Key_Up, Qt::AltModifier), + KeyboardState(Qt::Key_Down, Qt::AltModifier|Qt::ShiftModifier), + KeyboardState(Qt::Key_Up, Qt::AltModifier|Qt::ShiftModifier), + KeyboardState(Qt::Key_Down, Qt::AltModifier|Qt::ControlModifier), + KeyboardState(Qt::Key_Up, Qt::AltModifier|Qt::ControlModifier), + KeyboardState(Qt::Key_Right, Qt::ControlModifier), + KeyboardState(Qt::Key_Left, Qt::ControlModifier), + KeyboardState(Qt::Key_Down, Qt::ControlModifier), + KeyboardState(Qt::Key_Up, Qt::ControlModifier)); + + setKeySpeed(3,5,5); + + lighting_enabled_ = false; + disableLighting(); + lights_ = std::vector(8); +} + +/*! + Set up ortogonal or perspective mode and updates widget +*/ +void ExtGLWidget::setOrtho( bool val ) +{ + if (val == ortho_) return; + ortho_ = val; + updateGL(); + + emit projectionChanged(val); +} + +/*! + Set up the OpenGL rendering state +*/ +void ExtGLWidget::initializeGL() +{ + glEnable( GL_BLEND ); + glEnable(GL_DEPTH_TEST); + glShadeModel(GL_SMOOTH); + + // Set up the lights + disableLighting(); + + GLfloat whiteAmb[4] = {1.0, 1.0, 1.0, 1.0}; + + setLightShift(0, 0, 3000); + glEnable(GL_COLOR_MATERIAL); + + glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, whiteAmb); + + setMaterialComponent(GL_DIFFUSE, 1.0); + setMaterialComponent(GL_SPECULAR, 0.3); + setMaterialComponent(GL_SHININESS, 5.0); + setLightComponent(GL_DIFFUSE, 1.0); + setLightComponent(GL_SPECULAR, 1.0); + + initializedGL_ = true; +} + +void ExtGLWidget::applyModelViewAndProjection(Triple beg, Triple end) +{ + Triple center = beg + (end-beg) / 2; + double radius = (center-beg).length(); + + glLoadIdentity(); + + glRotatef( xRot_-90, 1.0, 0.0, 0.0 ); + glRotatef( yRot_, 0.0, 1.0, 0.0 ); + glRotatef( zRot_, 0.0, 0.0, 1.0 ); + glScalef( zoom_ * xScale_, zoom_ * yScale_, zoom_ * zScale_ ); + glTranslatef(xShift_-center.x, yShift_-center.y, zShift_-center.z); + + glMatrixMode( GL_PROJECTION ); + glLoadIdentity(); + + if (beg != end) { + if (ortho_) glOrtho( -radius, +radius, -radius, +radius, 0, 40 * radius); + else glFrustum( -radius, +radius, -radius, +radius, 5 * radius, 400 * radius ); + } else { + if (ortho_) glOrtho( -1.0, 1.0, -1.0, 1.0, 10.0, 100.0 ); + else glFrustum( -1.0, 1.0, -1.0, 1.0, 10.0, 100.0 ); + } + + glTranslatef( xVPShift_ * 2 * radius , yVPShift_ * 2 * radius , -7 * radius ); +} === added file '3rdparty/qwtplot3d/src/qwt3d_function.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_function.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_function.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,101 @@ +#include "qwt3d_curve.h" +#include "qwt3d_function.h" + +using namespace Qwt3D; + +Function::Function() +:GridMapping() +{ +} + +Function::Function(Curve& pw) +:GridMapping() +{ + plotwidget_p = &pw; +} + +Function::Function(Curve* pw) +:GridMapping() +{ + plotwidget_p = pw; +} + +void Function::assign(Curve& plotWidget) +{ + if (&plotWidget != plotwidget_p) + plotwidget_p = &plotWidget; +} + +void Function::assign(Curve* plotWidget) +{ + if (plotWidget != plotwidget_p) + plotwidget_p = plotWidget; +} + +void Function:: setMinZ(double val) +{ + range_p.minVertex.z = val; +} + +void Function:: setMaxZ(double val) +{ + range_p.maxVertex.z = val; +} + +bool Function::create() +{ + if ((umesh_p<=2) || (vmesh_p<=2) || !plotwidget_p) + return false; + + /* allocate some space for the mesh */ + double** data = new double* [umesh_p] ; + + unsigned i,j; + for ( i = 0; i < umesh_p; i++) + { + data[i] = new double [vmesh_p]; + } + + /* get the data */ + + double dx = (maxu_p - minu_p) / (umesh_p - 1); + double dy = (maxv_p - minv_p) / (vmesh_p - 1); + + for (i = 0; i < umesh_p; ++i) + { + for (j = 0; j < vmesh_p; ++j) + { + data[i][j] = operator()(minu_p + i*dx, minv_p + j*dy); + + if (data[i][j] > range_p.maxVertex.z) + data[i][j] = range_p.maxVertex.z; + else if (data[i][j] < range_p.minVertex.z) + data[i][j] = range_p.minVertex.z; + } + } + + Q_ASSERT(plotwidget_p); + if (!plotwidget_p) + { + fprintf(stderr,"Function: no valid Plot3D Widget assigned"); + } + else + { + (plotwidget_p)->loadFromData(data, umesh_p, vmesh_p, minu_p, maxu_p, minv_p, maxv_p); + } + + for ( i = 0; i < umesh_p; i++) + { + delete [] data[i]; + } + + delete [] data; + + return true; +} + +bool Function::create(Curve& pl) +{ + assign(pl); + return create(); +} === removed file '3rdparty/qwtplot3d/src/qwt3d_function.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_function.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_function.cpp 1970-01-01 00:00:00 +0000 @@ -1,102 +0,0 @@ -#include "qwt3d_surfaceplot.h" -#include "qwt3d_function.h" -#include - -using namespace Qwt3D; - -Function::Function() -:GridMapping() -{ -} - -Function::Function(SurfacePlot& pw) -:GridMapping() -{ - plotwidget_p = &pw; -} - -Function::Function(SurfacePlot* pw) -:GridMapping() -{ - plotwidget_p = pw; -} - -void Function::assign(SurfacePlot& plotWidget) -{ - if (&plotWidget != plotwidget_p) - plotwidget_p = &plotWidget; -} - -void Function::assign(SurfacePlot* plotWidget) -{ - if (plotWidget != plotwidget_p) - plotwidget_p = plotWidget; -} - -void Function:: setMinZ(double val) -{ - range_p.minVertex.z = val; -} - -void Function:: setMaxZ(double val) -{ - range_p.maxVertex.z = val; -} - -bool Function::create() -{ - if ((umesh_p<=2) || (vmesh_p<=2) || !plotwidget_p) - return false; - - /* allocate some space for the mesh */ - double** data = new double* [umesh_p] ; - - unsigned i,j; - for ( i = 0; i < umesh_p; i++) - { - data[i] = new double [vmesh_p]; - } - - /* get the data */ - - double dx = (maxu_p - minu_p) / (umesh_p - 1); - double dy = (maxv_p - minv_p) / (vmesh_p - 1); - - for (i = 0; i < umesh_p; ++i) - { - for (j = 0; j < vmesh_p; ++j) - { - data[i][j] = operator()(minu_p + i*dx, minv_p + j*dy); - - if (data[i][j] > range_p.maxVertex.z) - data[i][j] = range_p.maxVertex.z; - else if (data[i][j] < range_p.minVertex.z) - data[i][j] = range_p.minVertex.z; - } - } - - Q_ASSERT(plotwidget_p); - if (!plotwidget_p) - { - fprintf(stderr,"Function: no valid Plot3D Widget assigned"); - } - else - { - ((SurfacePlot*)plotwidget_p)->loadFromData(data, umesh_p, vmesh_p, minu_p, maxu_p, minv_p, maxv_p); - } - - for ( i = 0; i < umesh_p; i++) - { - delete [] data[i]; - } - - delete [] data; - - return true; -} - -bool Function::create(SurfacePlot& pl) -{ - assign(pl); - return create(); -} === added file '3rdparty/qwtplot3d/src/qwt3d_gridmapping.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_gridmapping.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_gridmapping.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,32 @@ +#include "qwt3d_gridmapping.h" +#include "qwt3d_curve.h" + +using namespace Qwt3D; + +GridMapping::GridMapping() +{ + plotwidget_p = 0; + setMesh(0,0); + setDomain(0,0,0,0); + restrictRange(ParallelEpiped(Triple(-DBL_MAX,-DBL_MAX,-DBL_MAX),Triple(DBL_MAX,DBL_MAX,DBL_MAX))); +} + +void GridMapping::setMesh(unsigned int columns,unsigned int rows) +{ + umesh_p = columns; + vmesh_p = rows; +} + +void GridMapping::setDomain(double minu, double maxu, double minv, double maxv) +{ + minu_p = minu; + maxu_p = maxu; + minv_p = minv; + maxv_p = maxv; +} + +void GridMapping::restrictRange(Qwt3D::ParallelEpiped const& p) +{ + range_p = p; +} + === removed file '3rdparty/qwtplot3d/src/qwt3d_gridmapping.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_gridmapping.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_gridmapping.cpp 1970-01-01 00:00:00 +0000 @@ -1,32 +0,0 @@ -#include "qwt3d_gridmapping.h" -#include "qwt3d_surfaceplot.h" - -using namespace Qwt3D; - -GridMapping::GridMapping() -{ - plotwidget_p = 0; - setMesh(0,0); - setDomain(0,0,0,0); - restrictRange(ParallelEpiped(Triple(-DBL_MAX,-DBL_MAX,-DBL_MAX),Triple(DBL_MAX,DBL_MAX,DBL_MAX))); -} - -void GridMapping::setMesh(unsigned int columns,unsigned int rows) -{ - umesh_p = columns; - vmesh_p = rows; -} - -void GridMapping::setDomain(double minu, double maxu, double minv, double maxv) -{ - minu_p = minu; - maxu_p = maxu; - minv_p = minv; - maxv_p = maxv; -} - -void GridMapping::restrictRange(Qwt3D::ParallelEpiped const& p) -{ - range_p = p; -} - === added file '3rdparty/qwtplot3d/src/qwt3d_gridplot.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_gridplot.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_gridplot.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,679 @@ +#if defined(_MSC_VER) /* MSVC Compiler */ +#pragma warning ( disable : 4305 ) +#pragma warning ( disable : 4786 ) +#endif + +#include "qwt3d_curve.h" +#include "qwt3d_enrichment_std.h" + +using namespace std; +using namespace Qwt3D; + + + +void Curve::createDataG() +{ + if (facemode_) createFaceData(); + if (sidemode_) createSideData(); + if (floormode_) createFloorData(); + + if (plotStyle() == NOPLOT) + return; + + int i, j; + RGBA col; + int step = resolution(); + + if (plotStyle() == Qwt3D::POINTS) + { + createPoints(); + return; + } + else if (plotStyle() == Qwt3D::USER) + { + if (userplotstyle_p) + createEnrichment(*userplotstyle_p); + return; + } + glPushAttrib(GL_POLYGON_BIT|GL_LINE_BIT); + + setDeviceLineWidth(meshLineWidth()); + + GLStateBewarer sb(GL_POLYGON_OFFSET_FILL,true); + setDevicePolygonOffset(polygonOffset(),1.0); + + GLStateBewarer sb2(GL_LINE_SMOOTH, smoothDataMesh()); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + + int lastcol = actualDataG_->columns(); + int lastrow = actualDataG_->rows(); + + if (plotStyle() != WIREFRAME) + { + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + + bool hl = (plotStyle() == HIDDENLINE); + if (hl) + { + col = plot_p->backgroundRGBAColor(); + glColor4d(col.r, col.g, col.b, col.a); + } + + for (i = 0; i < lastcol - step; i += step) + { + glBegin(GL_TRIANGLE_STRIP); + setColorFromVertexG(i, 0, hl); + glNormal3dv(actualDataG_->normals[i][0]); + glVertex3dv(actualDataG_->vertices[i][0]); + + int ni = i + step; + setColorFromVertexG(ni, 0, hl); + glNormal3dv(actualDataG_->normals[ni][0]); + glVertex3dv(actualDataG_->vertices[ni][0]); + + for (j = 0; j < lastrow - step; j += step) + { + int nj = j + step; + setColorFromVertexG(i, nj, hl); + glNormal3dv(actualDataG_->normals[i][nj]); + glVertex3dv(actualDataG_->vertices[i][nj]); + + setColorFromVertexG(ni, nj, hl); + glNormal3dv(actualDataG_->normals[ni][nj]); + glVertex3dv(actualDataG_->vertices[ni][nj]); + } + glEnd(); + } + } + + if (plotStyle() == FILLEDMESH || plotStyle() == WIREFRAME || plotStyle() == HIDDENLINE) + { + glColor4d(meshColor().r, meshColor().g, meshColor().b, meshColor().a); + + if (step < actualDataG_->columns() && step < actualDataG_->rows()) + { + glBegin(GL_LINE_LOOP); + for (i = 0; i < actualDataG_->columns() - step; i += step) + glVertex3dv(actualDataG_->vertices[i][0]); + for (j = 0; j < actualDataG_->rows() - step; j += step) + glVertex3dv(actualDataG_->vertices[i][j]); + for (; i >= 0; i -= step) + glVertex3dv(actualDataG_->vertices[i][j]); + for (; j >= 0; j -= step) + glVertex3dv(actualDataG_->vertices[0][j]); + glEnd(); + } + + // weaving + for (i = step; i < actualDataG_->columns() - step; i += step) + { + glBegin(GL_LINE_STRIP); + for (j = 0; j < actualDataG_->rows(); j += step) + glVertex3dv(actualDataG_->vertices[i][j]); + glEnd(); + } + for (j = step; j < actualDataG_->rows() - step; j += step) + { + glBegin(GL_LINE_STRIP); + for (i = 0; i < actualDataG_->columns(); i += step) + glVertex3dv(actualDataG_->vertices[i][j]); + glEnd(); + } + } + glPopAttrib(); +} + +void Curve::setColorFromVertexG(int ix, int iy, bool skip) +{ + if (skip) + return; + + RGBA col = (*datacolor_p)( + actualDataG_->vertices[ix][iy][0], + actualDataG_->vertices[ix][iy][1], + actualDataG_->vertices[ix][iy][2]); + + glColor4d(col.r, col.g, col.b, col.a); +} + + +void Curve::createNormalsG() +{ + if (!normals() || actualDataG_->empty()) + return; + + Arrow arrow; + arrow.setQuality(normalQuality()); + + Triple basev, topv, norm; + + int step = resolution(); + + double diag = (actualDataG_->hull().maxVertex-actualDataG_->hull().minVertex).length() * normalLength(); + + arrow.assign(*this); + arrow.drawBegin(); + for (int i = 0; i <= actualDataG_->columns() - step; i += step) + { + for (int j = 0; j <= actualDataG_->rows() - step; j += step) + { + basev = Triple(actualDataG_->vertices[i][j][0],actualDataG_->vertices[i][j][1],actualDataG_->vertices[i][j][2]); + topv = Triple(actualDataG_->vertices[i][j][0]+actualDataG_->normals[i][j][0], + actualDataG_->vertices[i][j][1]+actualDataG_->normals[i][j][1], + actualDataG_->vertices[i][j][2]+actualDataG_->normals[i][j][2]); + + norm = topv-basev; + norm.normalize(); + norm *= diag; + + arrow.setTop(basev+norm); + arrow.setColor((*datacolor_p)(basev.x,basev.y,basev.z)); + arrow.draw(basev); + } + } + arrow.drawEnd(); +} + +void Curve::readIn(GridData& gdata, Triple** data, unsigned int columns, unsigned int rows) +{ + gdata.setSize(columns,rows); + + ParallelEpiped range(Triple(DBL_MAX,DBL_MAX,DBL_MAX),Triple(-DBL_MAX,-DBL_MAX,-DBL_MAX)); + + /* fill out the vertex array for the mesh. */ + for (unsigned i = 0; i != columns; ++i) + { + for (unsigned j = 0; j != rows; ++j) + { + gdata.vertices[i][j][0] = data[i][j].x; + gdata.vertices[i][j][1] = data[i][j].y; + gdata.vertices[i][j][2] = data[i][j].z; +// qDebug() << "Curve: Data Values - " << data[i][j].x << data[i][j].y << data[i][j].z; + + if (data[i][j].x > range.maxVertex.x) + range.maxVertex.x = data[i][j].x; + if (data[i][j].y > range.maxVertex.y) + range.maxVertex.y = data[i][j].y; + if (data[i][j].z > range.maxVertex.z) + range.maxVertex.z = data[i][j].z; + if (data[i][j].x < range.minVertex.x) + range.minVertex.x = data[i][j].x; + if (data[i][j].y < range.minVertex.y) + range.minVertex.y = data[i][j].y; + if (data[i][j].z < range.minVertex.z) + range.minVertex.z = data[i][j].z; + } + } + gdata.setHull(range); + emit readInFinished(title()->string()); +} + +void Curve::readIn(GridData& gdata, double** data, unsigned int columns, unsigned int rows + , double minx, double maxx, double miny, double maxy) +{ + gdata.setPeriodic(false,false); + gdata.setSize(columns,rows); + + double dx = (maxx - minx) / (gdata.columns() - 1); + double dy = (maxy - miny) / (gdata.rows() - 1); + + double tmin = DBL_MAX; + double tmax = -DBL_MAX; + + /* fill out the vertex array for the mesh. */ + for (unsigned i = 0; i != columns; ++i) + { + for (unsigned j = 0; j != rows; ++j) + { + gdata.vertices[i][j][0] = minx + i*dx; + gdata.vertices[i][j][1] = miny + j*dy; + gdata.vertices[i][j][2] = data[i][j]; + + if (data[i][j] > tmax) + tmax = data[i][j]; + if (data[i][j] < tmin) + tmin = data[i][j]; + } + } + + ParallelEpiped hull = ParallelEpiped( + Triple(gdata.vertices[0][0][0], gdata.vertices[0][0][1], tmin), + Triple(gdata.vertices[gdata.columns()-1][gdata.rows()-1][0], + gdata.vertices[gdata.columns()-1][gdata.rows()-1][1], + tmax) + ); + + gdata.setHull(hull); + emit readInFinished(title()->string()); +} + +void Curve::calcNormals(GridData& gdata) +{ + unsigned int rows = gdata.rows(); + unsigned int columns = gdata.columns(); + + // normals + Triple u, v, n; // for cross product + + for (unsigned i = 0; i != columns; ++i) { + for (unsigned j = 0; j != rows; ++j) { + n = Triple(0,0,0); + + if (i0 && j0 && j>0) { + u = Triple(gdata.vertices[i-1][j][0] - gdata.vertices[i][j][0], + gdata.vertices[i-1][j][1] - gdata.vertices[i][j][1], + gdata.vertices[i-1][j][2] - gdata.vertices[i][j][2]); + + v = Triple(gdata.vertices[i][j-1][0] - gdata.vertices[i][j][0], + gdata.vertices[i][j-1][1] - gdata.vertices[i][j][1], + gdata.vertices[i][j-1][2] - gdata.vertices[i][j][2]); + + n += normalizedcross(u,v); + } + + if (i0) { + u = Triple(gdata.vertices[i][j-1][0] - gdata.vertices[i][j][0], + gdata.vertices[i][j-1][1] - gdata.vertices[i][j][1], + gdata.vertices[i][j-1][2] - gdata.vertices[i][j][2]); + + v = Triple(gdata.vertices[i+1][j][0] - gdata.vertices[i][j][0], + gdata.vertices[i+1][j][1] - gdata.vertices[i][j][1], + gdata.vertices[i+1][j][2] - gdata.vertices[i][j][2]); + + n += normalizedcross(u,v); + } + + n.normalize(); + gdata.normals[i][j][0] = n.x; + gdata.normals[i][j][1] = n.y; + gdata.normals[i][j][2] = n.z; + } + } +} + +void Curve::sewPeriodic(GridData& gdata) +{ + // sewing + Triple n; + + unsigned int columns = gdata.columns(); + unsigned int rows = gdata.rows(); + + if (gdata.uperiodic()) { + for (unsigned i = 0; i != columns; ++i) { + n = Triple(gdata.normals[i][0][0] + gdata.normals[i][rows-1][0], + gdata.normals[i][0][1] + gdata.normals[i][rows-1][1], + gdata.normals[i][0][2] + gdata.normals[i][rows-1][2]); + + n.normalize(); + gdata.normals[i][0][0] = gdata.normals[i][rows-1][0] = n.x; + gdata.normals[i][0][1] = gdata.normals[i][rows-1][1] = n.y; + gdata.normals[i][0][2] = gdata.normals[i][rows-1][2] = n.z; + } + } + + if (gdata.vperiodic()) { + for (unsigned j = 0; j != rows; ++j) { + n = Triple(gdata.normals[0][j][0] + gdata.normals[columns-1][j][0], + gdata.normals[0][j][1] + gdata.normals[columns-1][j][1], + gdata.normals[0][j][2] + gdata.normals[columns-1][j][2]); + + n.normalize(); + gdata.normals[0][j][0] = gdata.normals[columns-1][j][0] = n.x; + gdata.normals[0][j][1] = gdata.normals[columns-1][j][1] = n.y; + gdata.normals[0][j][2] = gdata.normals[columns-1][j][2] = n.z; + } + } +} + +/*! + Convert user grid data to internal vertex structure. + See also NativeReader::read() and Function::create() +*/ +bool Curve::loadFromData(Triple** data, unsigned int columns, unsigned int rows, QString titlestr, bool uperiodic, bool vperiodic) +{ + actualDataC_->clear(); + actualData_p = actualDataG_; + + if (!titlestr.isEmpty()) setTitle(titlestr); + readIn(*actualDataG_, data, columns, rows); + calcNormals(*actualDataG_); + actualDataG_->datatype = Qwt3D::GRID; + actualDataG_->setPeriodic(uperiodic,vperiodic); + sewPeriodic(*actualDataG_); + + updateData(); + return true; +} + +/*! + Convert user grid data to internal vertex structure. + See also NativeReader::read() and Function::create() +*/ +bool Curve::loadFromData(double** data, unsigned int columns, unsigned int rows, double minx, double maxx, double miny, double maxy, QString titlestr) +{ + actualDataC_->clear(); + actualData_p = actualDataG_; + + actualDataG_->setPeriodic(false,false); + actualDataG_->setSize(columns,rows); + + if (!titlestr.isEmpty()) setTitle(titlestr); + readIn(*actualDataG_,data,columns,rows,minx,maxx,miny,maxy); + calcNormals(*actualDataG_); + + updateData(); + return true; +} + + +void Curve::createFloorDataG() +{ + switch (floorStyle()) + { + case FLOORDATA: + Data2FloorG(); + break; + case FLOORISO: + Isolines2FloorG(dataProjected()); + if (dataProjected()) createPoints(); + break; + default: + break; + } +} + +void Curve::createSideDataG() +{ + switch (floorStyle()) + { + case FLOORDATA: + Data2SideG(); + break; + case FLOORISO: + Isolines2SideG(dataProjected()); + if (dataProjected()) { + DataPoints2SideG(dataProjected()); + createPoints(); + } + break; + default: + break; + } +} + +void Curve::createFaceDataG() +{ + switch (floorStyle()) + { + case FLOORDATA: + Data2FrontG(); + break; + case FLOORISO: + Isolines2FrontG(dataProjected()); + if (dataProjected()) { + DataPoints2BackG(dataProjected()); + createPoints(); + } + break; + default: + break; + } +} + +void Curve::DatamapG(unsigned int comp) +{ + if (actualData_p->empty()) + return; + + int step = resolution(); + + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glPolygonMode(GL_FRONT_AND_BACK, GL_QUADS); + + Triple tmin = actualData_p->hull().minVertex; + double shift = tmin(comp); + + for (int i = 0; i < actualDataG_->columns() - step; i += step) { + glBegin(GL_TRIANGLE_STRIP); + int ni = i + step; + Triple curr(actualDataG_->vertices[i][0][0], + actualDataG_->vertices[i][0][1], + actualDataG_->vertices[i][0][2]); + Triple next(actualDataG_->vertices[ni][0][0], + actualDataG_->vertices[ni][0][1], + actualDataG_->vertices[ni][0][2]); + + setColorFromVertexG(i, 0); + drawVertex(curr, shift, comp); + + setColorFromVertexG(i+step, 0); + drawVertex(next, shift, comp); + + for (int j = 0; j < actualDataG_->rows() - step; j += step) { + int nj = j + step; + Triple curr(actualDataG_->vertices[i][nj][0], + actualDataG_->vertices[i][nj][1], + actualDataG_->vertices[i][nj][2]); + Triple next(actualDataG_->vertices[ni][nj][0], + actualDataG_->vertices[ni][nj][1], + actualDataG_->vertices[ni][nj][2]); + + setColorFromVertexG(i, nj); + drawVertex(curr, shift, comp); + + setColorFromVertexG(ni, nj); + drawVertex(next, shift, comp); + } + glEnd(); + } +} + +void Curve::IsolinesG(unsigned int comp, bool projected) +{ + if (isolines() <= 0 || actualData_p->empty()) + return; + + Triple tmax = actualData_p->hull().maxVertex; + Triple tmin = actualData_p->hull().minVertex; + + double delta = tmax(comp) - tmin(comp); + double shift = tmin(comp); + double count = delta / isolines(); + + RGBA col; + + int step = resolution(); + int cols = actualDataG_->columns(); + int rows = actualDataG_->rows(); + + Triple t[4]; + vector intersection; + + double lambda = 0; + + GLStateBewarer sb2(GL_LINE_SMOOTH, false); + + for (unsigned int k = 0; k != isolines(); ++k) { + double val = shift + k * count; + + for (int i = 0; i < cols-step; i += step) { + for (int j = 0; j < rows-step; j += step) { + t[0] = Triple( actualDataG_->vertices[i][j][0], + actualDataG_->vertices[i][j][1], + actualDataG_->vertices[i][j][2]); + + col = (*datacolor_p)(t[0].x,t[0].y,t[0].z); + glColor4d(col.r, col.g, col.b, col.a); + + t[1] = Triple( actualDataG_->vertices[i+step][j][0], + actualDataG_->vertices[i+step][j][1], + actualDataG_->vertices[i+step][j][2]); + t[2] = Triple( actualDataG_->vertices[i+step][j+step][0], + actualDataG_->vertices[i+step][j+step][1], + actualDataG_->vertices[i+step][j+step][2]); + t[3] = Triple( actualDataG_->vertices[i][j+step][0], + actualDataG_->vertices[i][j+step][1], + actualDataG_->vertices[i][j+step][2]); + + double diff = 0; + + for (int m = 0; m!=4; ++m) { + int mm = (m+1)%4; + + bool outer = (val >= t[mm](comp) && val <= t[m](comp)); + bool inner = (val >= t[m](comp) && val <= t[mm](comp)); + + if (inner || outer) { + diff = t[mm](comp) - t[m](comp); + + if (isPracticallyZero(diff)) { // degenerated + intersection.push_back(t[m]); + intersection.push_back(t[mm]); + continue; + } + + Triple intersect; + double component[3]; + + lambda = (val - t[m](comp)) / diff; + for (unsigned int c = 0; c!=3; ++c) + component[c] = (t[m](c) + lambda * (t[mm](c)-t[m](c))); + + switch (comp) { + case 0: + intersect = Triple(val, component[1], component[2]); + break; + case 1: + intersect = Triple(component[0], val, component[2]); + break; + case 2: + intersect = Triple(component[0], component[1], val); + break; + } + intersection.push_back(intersect); + } + } + drawIntersections(intersection, shift, comp, projected); + } + } + } +} + +void Curve::DataPointsG(unsigned int comp, bool projected) +{ + if (actualData_p->empty() || actualDataG_->columns() <= 0) + return; + + int cols = 0, rows = 0, step = resolution(); + + switch (comp) { + case 0: // iterate through each column + cols = actualDataG_->columns(); + rows = actualDataG_->rows(); + break; + case 1: // iterate through each row + cols = actualDataG_->rows(); + rows = actualDataG_->columns(); + break; + } + + Triple tmax = actualData_p->hull().maxVertex; + double shift = tmax(comp); + + vector col; + vector t; + + col.resize(rows/step); + t.resize(rows/step); + + vector projection; + + GLStateBewarer sb(GL_LINE_SMOOTH, false); + + for (int outer = 0; outer < cols-step; outer += step) { + for (int inner = 0; inner < rows-step; inner += step) { + int i = comp ? inner : outer; + int j = comp ? outer : inner; + + t[inner] = Triple( actualDataG_->vertices[i][j][0], + actualDataG_->vertices[i][j][1], + actualDataG_->vertices[i][j][2] ); + col[inner] = (*datacolor_p)(t[inner].x,t[inner].y,t[inner].z); + + projection.push_back(t[inner]); + } + + drawIntersections(projection, shift, comp, projected, &col); + } +} + +double** Curve::getData(int *columns, int *rows) +{ + if (!actualDataG_) return 0; + + *columns = actualDataG_->columns(); + *rows = actualDataG_->rows(); + + /* allocate some space for the mesh */ + double** data = new double* [*columns]; + + for (int i = 0; i < *columns; ++i) { + data[i] = new double [*rows]; + for (int j = 0; j != *rows; ++j) { + data[i][j] = actualDataG_->vertices[i][j][2]; + } + } + return data; +} + +void Curve::deleteData(double** data, int columns) +{ + for ( int i = 0; i < columns; i++) + { + delete [] data[i]; + } + delete [] data; +} + +void Curve::animateData(double** data) +{ + if (!actualDataG_) return; + + int cols = actualDataG_->columns(); + int rows = actualDataG_->rows(); + + for (int i = 0; i < cols; ++i) { + for (int j = 0; j < rows; ++j) { + actualDataG_->vertices[i][j][2] = data[i][j]; + } + } +} === removed file '3rdparty/qwtplot3d/src/qwt3d_gridplot.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_gridplot.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_gridplot.cpp 1970-01-01 00:00:00 +0000 @@ -1,595 +0,0 @@ -#if defined(_MSC_VER) /* MSVC Compiler */ -#pragma warning ( disable : 4305 ) -#pragma warning ( disable : 4786 ) -#endif - -#include "qwt3d_surfaceplot.h" -#include "qwt3d_enrichment_std.h" - -using namespace std; -using namespace Qwt3D; - - - -void SurfacePlot::createDataG() -{ - createFloorData(); - - if (plotStyle() == NOPLOT) - return; - - int i, j; - RGBA col; - int step = resolution(); - - if (plotStyle() == Qwt3D::POINTS) - { - createPoints(); - return; - } - else if (plotStyle() == Qwt3D::USER) - { - if (userplotstyle_p) - createEnrichment(*userplotstyle_p); - return; - } - - setDeviceLineWidth(meshLineWidth()); - - GLStateBewarer sb(GL_POLYGON_OFFSET_FILL,true); - setDevicePolygonOffset(polygonOffset(),1.0); - - GLStateBewarer sb2(GL_LINE_SMOOTH, smoothDataMesh()); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - - int lastcol = actualDataG_->columns(); - int lastrow = actualDataG_->rows(); - - if (plotStyle() != WIREFRAME) - { - glPolygonMode(GL_FRONT_AND_BACK, GL_QUADS); - - bool hl = (plotStyle() == HIDDENLINE); - if (hl) - { - col = backgroundRGBAColor(); - glColor4d(col.r, col.g, col.b, col.a); - } - - for (i = 0; i < lastcol - step; i += step){ - glBegin(GL_TRIANGLE_STRIP); - setColorFromVertexG(i, 0, hl); - glNormal3dv(actualDataG_->normals[i][0]); - glVertex3dv(actualDataG_->vertices[i][0]); - - int ni = i + step; - setColorFromVertexG(ni, 0, hl); - glNormal3dv(actualDataG_->normals[ni][0]); - glVertex3dv(actualDataG_->vertices[ni][0]); - - for (j = 0; j < lastrow - step; j += step){ - int nj = j + step; - setColorFromVertexG(i, nj, hl); - glNormal3dv(actualDataG_->normals[i][nj]); - glVertex3dv(actualDataG_->vertices[i][nj]); - - setColorFromVertexG(ni, nj, hl); - glNormal3dv(actualDataG_->normals[ni][nj]); - glVertex3dv(actualDataG_->vertices[ni][nj]); - } - glEnd(); - } - } - - if (plotStyle() == FILLEDMESH || plotStyle() == WIREFRAME || plotStyle() == HIDDENLINE) - { - glColor4d(meshColor().r, meshColor().g, meshColor().b, meshColor().a); - - if (step < actualDataG_->columns() && step < actualDataG_->rows()) - { - glBegin(GL_LINE_LOOP); - for (i = 0; i < actualDataG_->columns() - step; i += step) - glVertex3dv(actualDataG_->vertices[i][0]); - for (j = 0; j < actualDataG_->rows() - step; j += step) - glVertex3dv(actualDataG_->vertices[i][j]); - for (; i >= 0; i -= step) - glVertex3dv(actualDataG_->vertices[i][j]); - for (; j >= 0; j -= step) - glVertex3dv(actualDataG_->vertices[0][j]); - glEnd(); - } - - // weaving - for (i = step; i < actualDataG_->columns() - step; i += step) - { - glBegin(GL_LINE_STRIP); - for (j = 0; j < actualDataG_->rows(); j += step) - glVertex3dv(actualDataG_->vertices[i][j]); - glEnd(); - } - for (j = step; j < actualDataG_->rows() - step; j += step) - { - glBegin(GL_LINE_STRIP); - for (i = 0; i < actualDataG_->columns(); i += step) - glVertex3dv(actualDataG_->vertices[i][j]); - glEnd(); - } - } -} - -void SurfacePlot::setColorFromVertexG(int ix, int iy, bool skip) -{ - if (skip) - return; - - RGBA col = (*datacolor_p)( - actualDataG_->vertices[ix][iy][0], - actualDataG_->vertices[ix][iy][1], - actualDataG_->vertices[ix][iy][2]); - - glColor4d(col.r, col.g, col.b, col.a); -} - - -void SurfacePlot::createNormalsG() -{ - if (!normals() || actualDataG_->empty()) - return; - - Arrow arrow; - arrow.setQuality(normalQuality()); - - Triple basev, topv, norm; - - int step = resolution(); - - double diag = (actualDataG_->hull().maxVertex-actualDataG_->hull().minVertex).length() * normalLength(); - - arrow.assign(*this); - arrow.drawBegin(); - for (int i = 0; i <= actualDataG_->columns() - step; i += step) - { - for (int j = 0; j <= actualDataG_->rows() - step; j += step) - { - basev = Triple(actualDataG_->vertices[i][j][0],actualDataG_->vertices[i][j][1],actualDataG_->vertices[i][j][2]); - topv = Triple(actualDataG_->vertices[i][j][0]+actualDataG_->normals[i][j][0], - actualDataG_->vertices[i][j][1]+actualDataG_->normals[i][j][1], - actualDataG_->vertices[i][j][2]+actualDataG_->normals[i][j][2]); - - norm = topv-basev; - norm.normalize(); - norm *= diag; - - arrow.setTop(basev+norm); - arrow.setColor((*datacolor_p)(basev.x,basev.y,basev.z)); - arrow.draw(basev); - } - } - arrow.drawEnd(); -} - -void SurfacePlot::readIn(GridData& gdata, Triple** data, unsigned int columns, unsigned int rows) -{ - gdata.setSize(columns,rows); - - ParallelEpiped range(Triple(DBL_MAX,DBL_MAX,DBL_MAX),Triple(-DBL_MAX,-DBL_MAX,-DBL_MAX)); - - /* fill out the vertex array for the mesh. */ - for (unsigned i = 0; i != columns; ++i) - { - for (unsigned j = 0; j != rows; ++j) - { - gdata.vertices[i][j][0] = data[i][j].x; - gdata.vertices[i][j][1] = data[i][j].y; - gdata.vertices[i][j][2] = data[i][j].z; - - if (data[i][j].x > range.maxVertex.x) - range.maxVertex.x = data[i][j].x; - if (data[i][j].y > range.maxVertex.y) - range.maxVertex.y = data[i][j].y; - if (data[i][j].z > range.maxVertex.z) - range.maxVertex.z = data[i][j].z; - if (data[i][j].x < range.minVertex.x) - range.minVertex.x = data[i][j].x; - if (data[i][j].y < range.minVertex.y) - range.minVertex.y = data[i][j].y; - if (data[i][j].z < range.minVertex.z) - range.minVertex.z = data[i][j].z; - } - } - gdata.setHull(range); -} - - -void SurfacePlot::readIn(GridData& gdata, double** data, unsigned int columns, unsigned int rows - , double minx, double maxx, double miny, double maxy) -{ - gdata.setPeriodic(false,false); - gdata.setSize(columns,rows); - - double dx = (maxx - minx) / (gdata.columns() - 1); - double dy = (maxy - miny) / (gdata.rows() - 1); - - double tmin = DBL_MAX; - double tmax = -DBL_MAX; - - /* fill out the vertex array for the mesh. */ - for (unsigned i = 0; i != columns; ++i) - { - for (unsigned j = 0; j != rows; ++j) - { - gdata.vertices[i][j][0] = minx + i*dx; - gdata.vertices[i][j][1] = miny + j*dy; - gdata.vertices[i][j][2] = data[i][j]; - - if (data[i][j] > tmax) - tmax = data[i][j]; - if (data[i][j] < tmin) - tmin = data[i][j]; - } - } - ParallelEpiped hull = - ParallelEpiped( - Triple( - gdata.vertices[0][0][0], - gdata.vertices[0][0][1], - tmin - ), - Triple( - gdata.vertices[gdata.columns()-1][gdata.rows()-1][0], - gdata.vertices[gdata.columns()-1][gdata.rows()-1][1], - tmax - ) - ); - - gdata.setHull(hull); -} - - -void SurfacePlot::calcNormals(GridData& gdata) -{ - - unsigned int rows = gdata.rows(); - unsigned int columns = gdata.columns(); - - // normals - - Triple u, v, n; // for cross product - - for (unsigned i = 0; i != columns; ++i) - { - for (unsigned j = 0; j != rows; ++j) - { - n = Triple(0,0,0); - - - if (i0 && j0 && j>0) - { - u = Triple( - gdata.vertices[i-1][j][0] - gdata.vertices[i][j][0], - gdata.vertices[i-1][j][1] - gdata.vertices[i][j][1], - gdata.vertices[i-1][j][2] - gdata.vertices[i][j][2] - ); - - v = Triple( - gdata.vertices[i][j-1][0] - gdata.vertices[i][j][0], - gdata.vertices[i][j-1][1] - gdata.vertices[i][j][1], - gdata.vertices[i][j-1][2] - gdata.vertices[i][j][2] - ); - n += normalizedcross(u,v); - } - - if (i0) - { - u = Triple( - gdata.vertices[i][j-1][0] - gdata.vertices[i][j][0], - gdata.vertices[i][j-1][1] - gdata.vertices[i][j][1], - gdata.vertices[i][j-1][2] - gdata.vertices[i][j][2] - ); - - v = Triple( - gdata.vertices[i+1][j][0] - gdata.vertices[i][j][0], - gdata.vertices[i+1][j][1] - gdata.vertices[i][j][1], - gdata.vertices[i+1][j][2] - gdata.vertices[i][j][2] - ); - n += normalizedcross(u,v); - } - n.normalize(); - - gdata.normals[i][j][0] = n.x; - gdata.normals[i][j][1] = n.y; - gdata.normals[i][j][2] = n.z; - } - } -} - - -void SurfacePlot::sewPeriodic(GridData& gdata) -{ - // sewing - - Triple n; - - unsigned int columns = gdata.columns(); - unsigned int rows = gdata.rows(); - - if (gdata.uperiodic()) - { - for (unsigned i = 0; i != columns; ++i) - { - n = Triple( - gdata.normals[i][0][0] + gdata.normals[i][rows-1][0], - gdata.normals[i][0][1] + gdata.normals[i][rows-1][1], - gdata.normals[i][0][2] + gdata.normals[i][rows-1][2] - ); - - n.normalize(); - gdata.normals[i][0][0] = gdata.normals[i][rows-1][0] = n.x; - gdata.normals[i][0][1] = gdata.normals[i][rows-1][1] = n.y; - gdata.normals[i][0][2] = gdata.normals[i][rows-1][2] = n.z; - } - } - if (gdata.vperiodic()) - { - for (unsigned j = 0; j != rows; ++j) - { - n = Triple( - gdata.normals[0][j][0] + gdata.normals[columns-1][j][0], - gdata.normals[0][j][1] + gdata.normals[columns-1][j][1], - gdata.normals[0][j][2] + gdata.normals[columns-1][j][2] - ); - - n.normalize(); - gdata.normals[0][j][0] = gdata.normals[columns-1][j][0] = n.x; - gdata.normals[0][j][1] = gdata.normals[columns-1][j][1] = n.y; - gdata.normals[0][j][2] = gdata.normals[columns-1][j][2] = n.z; - } - } -} - -/*! - Convert user grid data to internal vertex structure. - See also NativeReader::read() and Function::create() -*/ -bool SurfacePlot::loadFromData(Triple** data, unsigned int columns, unsigned int rows, bool uperiodic, bool vperiodic) -{ - actualDataC_->clear(); - actualData_p = actualDataG_; - - readIn(*actualDataG_, data, columns, rows); - calcNormals(*actualDataG_); - actualDataG_->setPeriodic(uperiodic,vperiodic); - sewPeriodic(*actualDataG_); - - updateData(); - updateNormals(); - createCoordinateSystem(); - - return true; -} - -/*! - Convert user grid data to internal vertex structure. - See also NativeReader::read() and Function::create() -*/ -bool SurfacePlot::loadFromData(double** data, unsigned int columns, unsigned int rows - , double minx, double maxx, double miny, double maxy) -{ - actualDataC_->clear(); - actualData_p = actualDataG_; - - actualDataG_->setPeriodic(false,false); - actualDataG_->setSize(columns,rows); - readIn(*actualDataG_,data,columns,rows,minx,maxx,miny,maxy); - calcNormals(*actualDataG_); - - updateData(); - updateNormals(); - createCoordinateSystem(); - - return true; -} - - -void SurfacePlot::createFloorDataG() -{ - switch (floorStyle()) - { - case FLOORDATA: - Data2FloorG(); - break; - case FLOORISO: - Isolines2FloorG(); - break; - default: - break; - } -} - -void SurfacePlot::Data2FloorG() -{ - if (actualData_p->empty()) - return; - - int step = resolution(); - - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glPolygonMode(GL_FRONT_AND_BACK, GL_QUADS); - - double zshift = actualData_p->hull().minVertex.z; - for (int i = 0; i < actualDataG_->columns() - step; i += step){ - glBegin(GL_TRIANGLE_STRIP); - setColorFromVertexG(i, 0); - glVertex3d(actualDataG_->vertices[i][0][0], actualDataG_->vertices[i][0][1], zshift); - - int ni = i + step; - setColorFromVertexG(ni, 0); - glVertex3d(actualDataG_->vertices[ni][0][0],actualDataG_->vertices[ni][0][1], zshift); - for (int j = 0; j < actualDataG_->rows() - step; j += step) { - int nj = j + step; - setColorFromVertexG(i, nj); - glVertex3d(actualDataG_->vertices[i][nj][0], actualDataG_->vertices[i][nj][1], zshift); - - setColorFromVertexG(ni, nj); - glVertex3d(actualDataG_->vertices[ni][nj][0], actualDataG_->vertices[ni][nj][1], zshift); - } - glEnd(); - } -} - -void SurfacePlot::Isolines2FloorG() -{ - if (isolines() <= 0 || actualData_p->empty()) - return; - - double count = (actualData_p->hull().maxVertex.z - actualData_p->hull().minVertex.z) / isolines(); - - RGBA col; - - int step = resolution(); - - double zshift = actualData_p->hull().minVertex.z; - - int cols = actualDataG_->columns(); - int rows = actualDataG_->rows(); - - Triple t[4]; - vector intersection; - - double lambda = 0; - - GLStateBewarer sb2(GL_LINE_SMOOTH, false); - - for (int k = 0; k != isolines(); ++k) - { - double val = zshift + k * count; - - for (int i = 0; i < cols-step; i += step) - { - for (int j = 0; j < rows-step; j += step) - { - t[0] = Triple( actualDataG_->vertices[i][j][0], - actualDataG_->vertices[i][j][1], - actualDataG_->vertices[i][j][2]); - - col = (*datacolor_p)(t[0].x,t[0].y,t[0].z); - glColor4d(col.r, col.g, col.b, col.a); -// glColor4d(0,0,0,1); - - t[1] = Triple( actualDataG_->vertices[i+step][j][0], - actualDataG_->vertices[i+step][j][1], - actualDataG_->vertices[i+step][j][2]); - t[2] = Triple( actualDataG_->vertices[i+step][j+step][0], - actualDataG_->vertices[i+step][j+step][1], - actualDataG_->vertices[i+step][j+step][2]); - t[3] = Triple( actualDataG_->vertices[i][j+step][0], - actualDataG_->vertices[i][j+step][1], - actualDataG_->vertices[i][j+step][2]); - - double diff = 0; - for (int m = 0; m!=4; ++m) - { - int mm = (m+1)%4; - if ((val>=t[m].z && val<=t[mm].z) || (val>=t[mm].z && val<=t[m].z)) - { - diff = t[mm].z - t[m].z; - - if (isPracticallyZero(diff)) // degenerated - { - intersection.push_back(t[m]); - intersection.push_back(t[mm]); - continue; - } - - lambda = (val - t[m].z) / diff; - intersection.push_back(Triple(t[m].x + lambda * (t[mm].x-t[m].x), t[m].y + lambda * (t[mm].y-t[m].y), val)); - } - } - - if (!intersection.empty()) - { - if (intersection.size()>2) - { - glBegin(GL_LINE_STRIP); - for (unsigned dd = 0; dd!=intersection.size(); ++dd) - { - glVertex3d(intersection[dd].x, intersection[dd].y, zshift); - } - glEnd(); - glBegin(GL_POINTS); - glVertex3d(intersection[0].x,intersection[0].y,zshift); - glEnd(); - } - else if (intersection.size() == 2) - { - glBegin(GL_LINES); - glVertex3d(intersection[0].x,intersection[0].y,zshift); - glVertex3d(intersection[1].x,intersection[1].y,zshift); - - // small pixel gap problem (see OpenGL spec.) - glVertex3d(intersection[1].x,intersection[1].y,zshift); - glVertex3d(intersection[0].x,intersection[0].y,zshift); - glEnd(); - } - - intersection.clear(); - } - } - } - } -} - - - -/* -void SurfacePlot::calcLowResolution() -{ - if (!actualDataG_) - return; - - int res = resolution(); - if (res == 1) - { - lowresData_p = *actualDataG_; - return; - } - - GridData const& src = *actualDataG_; - result.clear(); - - -}*/ === added file '3rdparty/qwtplot3d/src/qwt3d_io.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_io.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_io.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,398 @@ +#include + +#include "qwt3d_plot.h" +#include "qwt3d_io_gl2ps.h" +#include "qwt3d_io_reader.h" +#if QT_VERSION < 0x040000 +#else + #include + #include + #include +#endif + +namespace { + QString tr(const char* val) { return QObject::tr(val); } +} + +using namespace Qwt3D; + +IO::Entry::Entry() : iofunc(0) +{ +} + +IO::Entry::~Entry() +{ + delete iofunc; +} + +IO::Entry::Entry(IO::Entry const& e) +{ + if (this==&e) + return; + + fmt = e.fmt; + iofunc = e.iofunc->clone(); +} + +void IO::Entry::operator=(IO::Entry const& e) +{ + if (this==&e) + return; + + delete iofunc; + fmt = e.fmt; + iofunc = e.iofunc->clone(); +} + +IO::Entry::Entry(QString const& s, Functor const& f) + : fmt(s) +{ + iofunc = f.clone(); +} + +IO::Entry::Entry(QString const& s, Function f) + : fmt(s) +{ + Wrapper w(f); + iofunc = w.clone(); +} + + +IO::FormatCompare::FormatCompare(IO::Entry const& e) +{ + e_ = e; +} + +bool IO::FormatCompare::operator() (IO::Entry const& e) +{ + return ( e.fmt == e_.fmt); +} + +IO::FormatCompare2::FormatCompare2(QString s) +{ + s_ = s; +} + +bool IO::FormatCompare2::operator() (IO::Entry const& e) +{ + return( e.fmt == s_); +} + + + + +bool IO::add_unique(Container& l, Entry const& e) +{ + FormatCompare comp(e); + l.erase(std::remove_if(l.begin(), l.end(), comp), l.end()); + l.push_back(e); + + return true; +} + +IO::IT IO::find(Container& l, QString const& fmt) +{ + FormatCompare2 comp(fmt); + return std::find_if(l.begin(), l.end(), comp); +} + +IO::Container& IO::rlist() +{ + static Container rl = Container(); + static bool rfirst = true; + bool f = false; + f = rfirst; + if (rfirst) + { + rfirst = false; + setupHandler(); + } + return rl; +} + +IO::Container& IO::wlist() +{ + static Container wl = Container(); + static bool wfirst = true; + bool f = false; + f = wfirst; + if (wfirst) + { + wfirst = false; + setupHandler(); + } + return wl; +} + +/*! + Registers a new IO::Function for data input.\n + Every call overwrites a formerly registered handler for the same format string + (case sensitive). +*/ +bool IO::defineInputHandler(QString const& format, IO::Function func) +{ + return add_unique(rlist(), Entry(format, func)); +} + +/*! + Registers a new Functor for data input.\n + Every call overwrites a formerly registered handler for the same format string + (case sensitive). +*/ +bool IO::defineInputHandler(QString const& format, IO::Functor const& func) +{ + return add_unique(rlist(), Entry(format, func)); +} + +/*! + Registers a new IO::Function for data output. + Every call overwrites a formerly registered handler for the same format string + (case sensitive). + */ +bool IO::defineOutputHandler(QString const& format, IO::Function func) +{ + return add_unique(wlist(), Entry(format, func)); +} + +/*! + Registers a new Functor for data output.\n + Every call overwrites a formerly registered handler for the same format string + (case sensitive). +*/ +bool IO::defineOutputHandler(QString const& format, IO::Functor const& func) +{ + return add_unique(wlist(), Entry(format, func)); +} + +/*! + Applies a reading IO::Function or IO::Functor. + \param plot Plot with the content that should be loaded + \param fname File name + \param format Input format + \return The return value from the called Function/Functor. + The function returns false, if no registered handler could be found. +*/ +bool IO::load(Plot3D* plot, QString const& fname, QString const& format) +{ + IT it = IO::find(rlist(), format); + + if (it == rlist().end()) + return false; + + return (*it->iofunc)(plot, fname); +} + +/*! + Applies a writing IO::Function or IO::Functor. + \param plot Plot with the content that should be saved + \param fname File name + \param format Output format + \return The return value from the called Function/Functor. + The function returns false, if no registered handler could be found. +*/ +bool IO::save(Plot3D* plot, QString const& fname, QString const& format) +{ + IT it = IO::find(wlist(), format); + + if (it == wlist().end()) + return false; + + return (*it->iofunc)(plot, fname); +} + +bool IO::save(QImage* image, QString const& fname, QString const& format) +{ + IT it = IO::find(wlist(), format); + + if (it == wlist().end()) + return false; + + return (*it->iofunc)(image, fname); +} + +/*! + Returns a list of currently registered input formats. +*/ +QStringList IO::inputFormatList() +{ + QStringList list; + for ( IT it = rlist().begin(); it!=rlist().end(); ++it ) + list.append(it->fmt); + + return list; +} + +/*! + Returns a list of currently registered output formats. +*/ +QStringList IO::outputFormatList() +{ + QStringList list; + for ( IT it = wlist().begin(); it!=wlist().end(); ++it ) + list.append(it->fmt); + + return list; +} + +/*! + Returns the input functor in charge for format and 0 if non-existent. +*/ +IO::Functor* IO::inputHandler(QString const& format) +{ + IO::IT it = IO::find(rlist(), format); + + if (it==rlist().end()) + return 0; + + return it->iofunc; +} + +/*! + Returns the output functor in charge for format and 0 if non-existent. +*/ +IO::Functor* IO::outputHandler(QString const& format) +{ + IO::IT it = IO::find(wlist(), format); + + if (it==wlist().end()) + return 0; + + return it->iofunc; +} + +bool PixmapWriter::operator()(Plot3D* plot, QString const& fname) +{ + QImage im = plot->grabFrameBuffer(true); + + return operator()(&im, fname); +} + +bool PixmapWriter::operator()(QImage* image, QString const& fname) +{ +#if QT_VERSION < 0x040000 + QImageIO iio; + iio.setImage(*image); +#else + QImageWriter iio; +#endif + iio.setFormat(QWT3DLOCAL8BIT(fmt_)); + iio.setQuality(quality_); + iio.setFileName(fname); +#if QT_VERSION < 0x040000 + return iio.write(); +#else + if (!iio.canWrite()) { + QMessageBox::critical(0, tr("Pixmap file Open error"), + tr("Could not open read only image file:

%1

Please check you have file/folder write access permissions").arg(fname)); + return false; + } + + bool status = iio.write(*image); + + if (!status) + QMessageBox::critical(0, tr("Pixmap file Write error"), + tr("Could not write to image file:

%1

%2").arg(fname).arg(iio.errorString())); + + return status; +#endif +} + +//! Calls Qt's QImageIO::setQuality() function. +void PixmapWriter::setQuality(int val) +{ + quality_ = val; +} + +void IO::setupHandler() +{ +#if QT_VERSION < 0x040000 + QStringList list = QImage::outputFormatList(); + QStringList::Iterator it = list.begin(); +#else + QList list = QImageWriter::supportedImageFormats(); + QList::Iterator it = list.begin(); +#endif + PixmapWriter qtw; + while( it != list.end() ) + { + qtw.fmt_ = *it; + defineOutputHandler(*it, qtw); + ++it; + } + VectorWriter vecfunc; + vecfunc.setCompressed(false); + vecfunc.setFormat("EPS"); + defineOutputHandler("EPS", vecfunc); + vecfunc.setFormat("PS"); + defineOutputHandler("PS", vecfunc); + +#ifdef GL2PS_HAVE_ZLIB + vecfunc.setCompressed(true); + vecfunc.setFormat("EPS_GZ"); + defineOutputHandler("EPS_GZ", vecfunc); + vecfunc.setFormat("PS_GZ"); + defineOutputHandler("PS_GZ", vecfunc); +#endif + vecfunc.setFormat("PDF"); + defineOutputHandler("PDF", vecfunc); + vecfunc.setFormat("SVG"); + defineOutputHandler("SVG", vecfunc); + vecfunc.setFormat("PGF"); + defineOutputHandler("PGF", vecfunc); +#ifdef GL2PS_HAVE_ZLIB + vecfunc.setFormat("SVG_GZ"); + defineOutputHandler("SVG_GZ", vecfunc); +#endif + + defineInputHandler("mes", NativeReader()); + defineInputHandler("MES", NativeReader()); +} + +/*! + \deprecated Use Plot3D::save or IO::save instead. + + Writes vector data supported by gl2ps. The corresponding format types are "EPS","PS", "PDF", "SVG", or "PGF". + If zlib has been configured this will be extended by "EPS_GZ", "PS_GZ" and "SVG_GZ". + \b Beware: BSPSORT turns out to behave very slowly and memory consuming, especially in cases where + many polygons appear. It is still more exact than SIMPLESORT. +*/ +bool Plot3D::saveVector(QString const& fileName, QString const& format, VectorWriter::TEXTMODE textmode, VectorWriter::SORTMODE sortmode) +{ + if (format == "EPS" || format == "EPS_GZ" || format == "PS" + || format == "PS_GZ" || format == "PDF" || format == "SVG" + || format == "SVG_GZ" || format == "PGF") + { + VectorWriter* gl2ps = (VectorWriter*)IO::outputHandler(format); + if (gl2ps) + { + gl2ps->setSortMode(sortmode); + gl2ps->setTextMode(textmode); + } + return IO::save(this, fileName, format); + } + return false; +} +/*! + \deprecated Use Plot3D::save or IO::save instead. + + Saves the framebuffer to the file fileName using one of the image file formats supported by Qt. +*/ +bool Plot3D::savePixmap(QString const& fileName, QString const& format) +{ + if (format == "EPS" || format == "EPS_GZ" || format == "PS" + || format == "PS_GZ" || format == "PDF" || format == "SVG" + || format == "SVG_GZ" || format == "PGF") + return false; + + return IO::save(this, fileName, format); +} + +/*! + Saves content in one of the registered output formats. To modify the + behaviour for more complex output handling use IO::outputHandler. +*/ +bool Plot3D::save(QString const& fileName, QString const& format) +{ + return IO::save(this, fileName, format); +} + === removed file '3rdparty/qwtplot3d/src/qwt3d_io.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_io.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_io.cpp 1970-01-01 00:00:00 +0000 @@ -1,365 +0,0 @@ -#include - -#include "qwt3d_plot.h" -#include "qwt3d_io_gl2ps.h" -#include "qwt3d_io_reader.h" -#if QT_VERSION < 0x040000 -#else - #include -#endif - -using namespace Qwt3D; - -IO::Entry::Entry() : iofunc(0) -{ -} - -IO::Entry::~Entry() -{ - delete iofunc; -} - -IO::Entry::Entry(IO::Entry const& e) -{ - if (this==&e) - return; - - fmt = e.fmt; - iofunc = e.iofunc->clone(); -} - -void IO::Entry::operator=(IO::Entry const& e) -{ - if (this==&e) - return; - - delete iofunc; - fmt = e.fmt; - iofunc = e.iofunc->clone(); -} - -IO::Entry::Entry(QString const& s, Functor const& f) - : fmt(s) -{ - iofunc = f.clone(); -} - -IO::Entry::Entry(QString const& s, Function f) - : fmt(s) -{ - Wrapper w(f); - iofunc = w.clone(); -} - - -IO::FormatCompare::FormatCompare(IO::Entry const& e) -{ - e_ = e; -} - -bool IO::FormatCompare::operator() (IO::Entry const& e) -{ - return ( e.fmt == e_.fmt); -} - -IO::FormatCompare2::FormatCompare2(QString s) -{ - s_ = s; -} - -bool IO::FormatCompare2::operator() (IO::Entry const& e) -{ - return( e.fmt == s_); -} - - - - -bool IO::add_unique(Container& l, Entry const& e) -{ - FormatCompare comp(e); - l.erase(std::remove_if(l.begin(), l.end(), comp), l.end()); - l.push_back(e); - - return true; -} - -IO::IT IO::find(Container& l, QString const& fmt) -{ - FormatCompare2 comp(fmt); - return std::find_if(l.begin(), l.end(), comp); -} - -IO::Container& IO::rlist() -{ - static Container rl = Container(); - static bool rfirst = true; - bool f = false; - f = rfirst; - if (rfirst) - { - rfirst = false; - setupHandler(); - } - return rl; -} - -IO::Container& IO::wlist() -{ - static Container wl = Container(); - static bool wfirst = true; - bool f = false; - f = wfirst; - if (wfirst) - { - wfirst = false; - setupHandler(); - } - return wl; -} - -/*! - Registers a new IO::Function for data input.\n - Every call overwrites a formerly registered handler for the same format string - (case sensitive). -*/ -bool IO::defineInputHandler(QString const& format, IO::Function func) -{ - return add_unique(rlist(), Entry(format, func)); -} - -/*! - Registers a new Functor for data input.\n - Every call overwrites a formerly registered handler for the same format string - (case sensitive). -*/ -bool IO::defineInputHandler(QString const& format, IO::Functor const& func) -{ - return add_unique(rlist(), Entry(format, func)); -} - -/*! - Registers a new IO::Function for data output. - Every call overwrites a formerly registered handler for the same format string - (case sensitive). - */ -bool IO::defineOutputHandler(QString const& format, IO::Function func) -{ - return add_unique(wlist(), Entry(format, func)); -} - -/*! - Registers a new Functor for data output.\n - Every call overwrites a formerly registered handler for the same format string - (case sensitive). -*/ -bool IO::defineOutputHandler(QString const& format, IO::Functor const& func) -{ - return add_unique(wlist(), Entry(format, func)); -} - -/*! - Applies a reading IO::Function or IO::Functor. - \param plot Plot with the content that should be loaded - \param fname File name - \param format Input format - \return The return value from the called Function/Functor. - The function returns false, if no registered handler could be found. -*/ -bool IO::load(Plot3D* plot, QString const& fname, QString const& format) -{ - IT it = IO::find(rlist(), format); - - if (it == rlist().end()) - return false; - - return (*it->iofunc)(plot, fname); -} - -/*! - Applies a writing IO::Function or IO::Functor. - \param plot Plot with the content that should be saved - \param fname File name - \param format Output format - \return The return value from the called Function/Functor. - The function returns false, if no registered handler could be found. -*/ -bool IO::save(Plot3D* plot, QString const& fname, QString const& format) -{ - IT it = IO::find(wlist(), format); - - if (it == wlist().end()) - return false; - - return (*it->iofunc)(plot, fname); -} - -/*! - Returns a list of currently registered input formats. -*/ -QStringList IO::inputFormatList() -{ - QStringList list; - for ( IT it = rlist().begin(); it!=rlist().end(); ++it ) - list.append(it->fmt); - - return list; -} - -/*! - Returns a list of currently registered output formats. -*/ -QStringList IO::outputFormatList() -{ - QStringList list; - for ( IT it = wlist().begin(); it!=wlist().end(); ++it ) - list.append(it->fmt); - - return list; -} - -/*! - Returns the input functor in charge for format and 0 if non-existent. -*/ -IO::Functor* IO::inputHandler(QString const& format) -{ - IO::IT it = IO::find(rlist(), format); - - if (it==rlist().end()) - return 0; - - return it->iofunc; -} - -/*! - Returns the output functor in charge for format and 0 if non-existent. -*/ -IO::Functor* IO::outputHandler(QString const& format) -{ - IO::IT it = IO::find(wlist(), format); - - if (it==wlist().end()) - return 0; - - return it->iofunc; -} - -bool PixmapWriter::operator()(Plot3D* plot, QString const& fname) -{ - QImage im = plot->grabFrameBuffer(true); - -#if QT_VERSION < 0x040000 - QImageIO iio; - iio.setImage(im); -#else - QImageWriter iio; -#endif - iio.setFormat(QWT3DLOCAL8BIT(fmt_)); - iio.setQuality(quality_); - iio.setFileName(fname); -#if QT_VERSION < 0x040000 - return iio.write(); -#else - return iio.write(im); -#endif -} - -//! Calls Qt's QImageIO::setQuality() function. -void PixmapWriter::setQuality(int val) -{ - quality_ = val; -} - -void IO::setupHandler() -{ -#if QT_VERSION < 0x040000 - QStringList list = QImage::outputFormatList(); - QStringList::Iterator it = list.begin(); -#else - QList list = QImageWriter::supportedImageFormats(); - QList::Iterator it = list.begin(); -#endif - PixmapWriter qtw; - while( it != list.end() ) - { - qtw.fmt_ = *it; - defineOutputHandler(*it, qtw); - ++it; - } - VectorWriter vecfunc; - vecfunc.setCompressed(false); - vecfunc.setFormat("EPS"); - defineOutputHandler("EPS", vecfunc); - vecfunc.setFormat("PS"); - defineOutputHandler("PS", vecfunc); - -#ifdef GL2PS_HAVE_ZLIB - vecfunc.setCompressed(true); - vecfunc.setFormat("EPS_GZ"); - defineOutputHandler("EPS_GZ", vecfunc); - vecfunc.setFormat("PS_GZ"); - defineOutputHandler("PS_GZ", vecfunc); -#endif - vecfunc.setFormat("PDF"); - defineOutputHandler("PDF", vecfunc); - vecfunc.setFormat("SVG"); - defineOutputHandler("SVG", vecfunc); - vecfunc.setFormat("PGF"); - defineOutputHandler("PGF", vecfunc); -#ifdef GL2PS_HAVE_ZLIB - vecfunc.setFormat("SVG_GZ"); - defineOutputHandler("SVG_GZ", vecfunc); -#endif - - defineInputHandler("mes", NativeReader()); - defineInputHandler("MES", NativeReader()); -} - -/*! - \deprecated Use Plot3D::save or IO::save instead. - - Writes vector data supported by gl2ps. The corresponding format types are "EPS","PS", "PDF", "SVG", or "PGF". - If zlib has been configured this will be extended by "EPS_GZ", "PS_GZ" and "SVG_GZ". - \b Beware: BSPSORT turns out to behave very slowly and memory consuming, especially in cases where - many polygons appear. It is still more exact than SIMPLESORT. -*/ -bool Plot3D::saveVector(QString const& fileName, QString const& format, VectorWriter::TEXTMODE textmode, VectorWriter::SORTMODE sortmode) -{ - if (format == "EPS" || format == "EPS_GZ" || format == "PS" - || format == "PS_GZ" || format == "PDF" || format == "SVG" - || format == "SVG_GZ" || format == "PGF") - { - VectorWriter* gl2ps = (VectorWriter*)IO::outputHandler(format); - if (gl2ps) - { - gl2ps->setSortMode(sortmode); - gl2ps->setTextMode(textmode); - } - return IO::save(this, fileName, format); - } - return false; -} -/*! - \deprecated Use Plot3D::save or IO::save instead. - - Saves the framebuffer to the file fileName using one of the image file formats supported by Qt. -*/ -bool Plot3D::savePixmap(QString const& fileName, QString const& format) -{ - if (format == "EPS" || format == "EPS_GZ" || format == "PS" - || format == "PS_GZ" || format == "PDF" || format == "SVG" - || format == "SVG_GZ" || format == "PGF") - return false; - - return IO::save(this, fileName, format); -} - -/*! - Saves content in one of the registered output formats. To modify the - behaviour for more complex output handling use IO::outputHandler. -*/ -bool Plot3D::save(QString const& fileName, QString const& format) -{ - return IO::save(this, fileName, format); -} - === added file '3rdparty/qwtplot3d/src/qwt3d_io_gl2ps.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_io_gl2ps.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_io_gl2ps.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,417 @@ +#if defined(_MSC_VER) /* MSVC Compiler */ +#pragma warning ( disable : 4786 ) +#endif + +#include +#include + +#include "qwt3d_openglhelper.h" +#include "../3rdparty/gl2ps/gl2ps.h" +#include "qwt3d_io_gl2ps.h" +#include "qwt3d_plot.h" + +#include + +using namespace Qwt3D; + +//! Provides a new VectorWriter object. +IO::Functor* VectorWriter::clone() const +{ + return new VectorWriter(*this); +} + +VectorWriter::VectorWriter() + : gl2ps_format_(GL2PS_EPS), + formaterror_(false), +#ifdef GL2PS_HAVE_ZLIB + compressed_(true), +#else + compressed_(false), +#endif + sortmode_(SIMPLESORT), + landscape_(VectorWriter::AUTO), + textmode_(VectorWriter::PIXEL), + texfname_(""), + export_size_(QSize()) +{} + + +/*! + Sets the mode for text output:\n + \param val The underlying format for the generated output:\n + PIXEL - poor quality but exact positioning\n + NATIVE - high quality but inexact positioning\n + TEX - high quality and exact positioning, arbitrary TeX strings as content for + the saved labels are possible. The disadvantage is the need for an additionally TeX run + to get the final output.\n + \param fname Optional, used only in conjunction with TeX output; file name + for the generated TeX file. If not set, a file called "OUTPUT.FOR.tex" + will be generated, where "OUTPUT.FOR" describes the file name argument for IO::save().\n\n + (04/05/27: On Linux platforms, pdflatex seems a file named 'dump_0.pdf.tex' mistakenly to + identify as PDF file.) +*/ +void VectorWriter::setTextMode(TEXTMODE val, QString fname) +{ + textmode_ = val; + texfname_ = (fname.isEmpty()) ? QString("") : fname; +} + + +#ifdef GL2PS_HAVE_ZLIB +//! Turns compressed output on or off (no effect if zlib support has not been set) +void VectorWriter::setCompressed(bool val) +{ + compressed_ = val; +} +#else +//! Turns compressed output on or off (no effect if zlib support has not been set) +void VectorWriter::setCompressed(bool) +{ + compressed_ = false; +} +#endif + + +/*! +Set output format, must be one of "EPS_GZ", "PS_GZ", "SVG_GZ", "EPS", +"PS", "PDF", "SVG", or "PGF" (case sensitive) +*/ +bool VectorWriter::setFormat(QString const& format) +{ + if (format == QString("EPS")) + { + gl2ps_format_ = GL2PS_EPS; + } + else if (format == QString("PS")) + { + gl2ps_format_ = GL2PS_PS; + } + else if (format == QString("PDF")) + { + gl2ps_format_ = GL2PS_PDF; + } +#ifdef GL2PS_HAVE_ZLIB + else if (format == QString("EPS_GZ")) + { + gl2ps_format_ = GL2PS_EPS; + } + else if (format == QString("PS_GZ")) + { + gl2ps_format_ = GL2PS_PS; + } +#endif + else if (format == QString("SVG")) + { + gl2ps_format_ = GL2PS_SVG; + } +#ifdef GL2PS_HAVE_ZLIB + else if (format == QString("SVG_GZ")) + { + gl2ps_format_ = GL2PS_SVG; + } +#endif + else if (format == QString("PGF")) + { + gl2ps_format_ = GL2PS_PGF; + } + else + { + formaterror_ = true; + return false; + } + formaterror_ = false; + return true; +} + +//! Performs actual output +bool VectorWriter::operator()(Plot3D* plot, QString const& fname) +{ + if (formaterror_) + return false; + + char* tmploc = setlocale(LC_ALL, "C"); + + plot->makeCurrent(); + + QSize size = plot->size(); + if (export_size_.isValid()) + plot->resize(export_size_); + + GLint bufsize = 0, state = GL2PS_OVERFLOW; + GLint viewport[4]; + + glGetIntegerv(GL_VIEWPORT, viewport); + + GLint options = GL2PS_SIMPLE_LINE_OFFSET | GL2PS_SILENT | GL2PS_DRAW_BACKGROUND | + GL2PS_OCCLUSION_CULL | GL2PS_BEST_ROOT; + + + if (compressed_) + options |= GL2PS_COMPRESS; + + switch (landscape_) + { + case VectorWriter::AUTO: + if (viewport[2] - viewport[0] > viewport[3] - viewport[0]) + options |= GL2PS_LANDSCAPE; + break; + case VectorWriter::ON: + options |= GL2PS_LANDSCAPE; + break; + default: + break; + } + + int sortmode = GL2PS_SIMPLE_SORT; + switch (sortmode_) + { + case VectorWriter::NOSORT: + sortmode = GL2PS_NO_SORT; + break; + case VectorWriter::SIMPLESORT: + sortmode = GL2PS_SIMPLE_SORT; + break; + case VectorWriter::BSPSORT: + sortmode = GL2PS_BSP_SORT; + break; + default: + break; + } + + switch (textmode_) + { + case NATIVE: + Label::useDeviceFonts(true); + break; + case PIXEL: + Label::useDeviceFonts(false); + break; + case TEX: + options |= GL2PS_NO_PIXMAP | GL2PS_NO_TEXT; + break; + default: + break; + } + + QString version = QString::number(QWT3D_MAJOR_VERSION) + "." + + QString::number(QWT3D_MINOR_VERSION) + "." + + QString::number(QWT3D_PATCH_VERSION); + + QString producer = QString("QwtPlot3D ") + version + + ", (C) 2002"; + + // calculate actual year + time_t now; + struct tm *newtime; + time(&now); + newtime = gmtime(&now); + if (newtime && newtime->tm_year + 1900 > 2002) + producer += "-" + QString::number(newtime->tm_year+1900); + + // the SVG format does not like some of the characters in a mail address + producer += " Micha Bieber, mailto: krischnamurti at users.sourceforge.net"; + + FILE *fp = fopen(QWT3DLOCAL8BIT(fname), "wb"); + if (!fp) + { + Label::useDeviceFonts(false); + setlocale(LC_ALL, tmploc); + return false; + } + + plot->setExportingVector(true, gl2ps_format_); + + while( state == GL2PS_OVERFLOW ){ + bufsize += 2*1024*1024; + gl2psBeginPage ( QWT3DLOCAL8BIT(fname), QWT3DLOCAL8BIT(producer), viewport, + gl2ps_format_, sortmode, + options, GL_RGBA, 0, NULL, 0, 0, 0, bufsize, + fp, QWT3DLOCAL8BIT(fname) ); + + plot->updateGL(); + state = gl2psEndPage(); + } + fclose(fp); + + // extra TeX file + if (textmode_ == TEX) + { + QFileInfo fi(fname); + QString fn = fname; + fn = fn.remove(fi.suffix()) + "tex"; + + fp = fopen(QWT3DLOCAL8BIT(fn), "wb"); + if (!fp) + { + Label::useDeviceFonts(false); + setlocale(LC_ALL, tmploc); + return false; + } + Label::useDeviceFonts(true); + options &= ~GL2PS_NO_PIXMAP & ~GL2PS_NO_TEXT; + state = GL2PS_OVERFLOW; + while( state == GL2PS_OVERFLOW ) + { + bufsize += 2*1024*1024; + gl2psBeginPage ( QWT3DLOCAL8BIT(fn), QWT3DLOCAL8BIT(producer), viewport, + GL2PS_TEX, sortmode, + options, GL_RGBA, 0, NULL, 0, 0, 0, bufsize, + fp, QWT3DLOCAL8BIT(fn) ); + + plot->updateGL(); + state = gl2psEndPage(); + } + fclose(fp); + } + plot->setExportingVector(false); + + Label::useDeviceFonts(false); + + setlocale(LC_ALL, tmploc); + if (export_size_.isValid()) + plot->resize(size);// restore original plot size + + return true; +} + + +// moved + +GLint Qwt3D::setDeviceLineWidth(GLfloat val) +{ + if (val<0) + val=0; + + GLint ret = gl2psLineWidth(val); + + GLfloat lw[2]; + glGetFloatv(GL_LINE_WIDTH_RANGE, lw); + + if (val < lw[0]) + val = lw[0]; + else if (val > lw[1]) + val = lw[1]; + + glLineWidth(val); + return ret; +} + +GLint Qwt3D::setDevicePointSize(GLfloat val) +{ + if (val<0) + val=0; + + GLint ret = gl2psPointSize(val); + + GLfloat lw[2]; + glGetFloatv(GL_POINT_SIZE_RANGE, lw); + + if (val < lw[0]) + val = lw[0]; + else if (val > lw[1]) + val = lw[1]; + + glPointSize(val); + return ret; +} + +GLint Qwt3D::drawDevicePixels(GLsizei width, GLsizei height, + GLenum format, GLenum type, + const void *pixels) +{ + glDrawPixels(width, height, format, type, pixels); + + if(format != GL_RGBA || type != GL_UNSIGNED_BYTE) + return GL2PS_ERROR; + + GLfloat* convertedpixel = (GLfloat*)malloc(4 * width * height * sizeof(GLfloat)); + if (!convertedpixel) + return GL2PS_ERROR; + + GLubyte* px = (GLubyte*)pixels; + for (int i = 0; i != 4*width*height; i += 4){ + convertedpixel[i] = px[i] / 255.0; + convertedpixel[i+1] = px[i+1] / 255.0; + convertedpixel[i+2] = px[i+2] / 255.0; + convertedpixel[i+3] = px[i+3] / 255.0; + } + GLint ret = gl2psDrawPixels(width, height, 0, 0, GL_RGBA, GL_FLOAT, convertedpixel); + free(convertedpixel); + return ret; +} + +GLint Qwt3D::drawDeviceText(const char* str, const char* fontname, int fontsize, Triple pos, RGBA color, ANCHOR align, double gap, double angle) +{ + double vp[3]; + + World2ViewPort(vp[0], vp[1], vp[2], pos.x, pos.y, pos.z); + Triple start(vp[0],vp[1],vp[2]); + + GLdouble fcol[4]; + glGetDoublev(GL_CURRENT_COLOR, fcol); + GLdouble bcol[4]; + glGetDoublev(GL_COLOR_CLEAR_VALUE, bcol); + + glColor4d(color.r, color.g, color.b, color.a); + glClearColor(color.r, color.g, color.b, color.a); + + GLint ret = GL2PS_SUCCESS; + + GLint a = GL2PS_TEXT_BL; + switch(align) + { + case Center: + a = GL2PS_TEXT_C; + break; + case CenterLeft: + a = GL2PS_TEXT_CL; + start += Triple(gap,0,0); + break; + case CenterRight: + a = GL2PS_TEXT_CR; + start += Triple(-gap,0,0); + break; + case BottomCenter: + a = GL2PS_TEXT_B; + start += Triple(0,gap,0); + break; + case BottomLeft: + a = GL2PS_TEXT_BL; + start += Triple(gap,gap,0); + break; + case BottomRight: + a = GL2PS_TEXT_BR; + start += Triple(-gap,gap,0); + break; + case TopCenter: + a = GL2PS_TEXT_T; + start += Triple(0,-gap,0); + break; + case TopLeft: + a = GL2PS_TEXT_TL; + start += Triple(gap,-gap,0); + break; + case TopRight: + a = GL2PS_TEXT_TR; + start += Triple(-gap,-gap,0); + break; + default: + break; + } + + ViewPort2World(vp[0], vp[1], vp[2], start.x, start.y, start.z); + Triple adjpos(vp[0],vp[1],vp[2]); + + glRasterPos3d(adjpos.x, adjpos.y, adjpos.z); + ret = gl2psTextOpt(str, fontname, (int)fontsize, a, angle); + glColor4dv(fcol); + glClearColor(bcol[0], bcol[1], bcol[2], bcol[3]); + return ret; +} + +void Qwt3D::setDevicePolygonOffset(GLfloat factor, GLfloat units) +{ + glPolygonOffset(factor, units); + gl2psEnable(GL2PS_POLYGON_OFFSET_FILL); +} + === removed file '3rdparty/qwtplot3d/src/qwt3d_io_gl2ps.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_io_gl2ps.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_io_gl2ps.cpp 1970-01-01 00:00:00 +0000 @@ -1,417 +0,0 @@ -#if defined(_MSC_VER) /* MSVC Compiler */ -#pragma warning ( disable : 4786 ) -#endif - -#include -#include - -#include "qwt3d_openglhelper.h" -#include "../3rdparty/gl2ps/gl2ps.h" -#include "qwt3d_io_gl2ps.h" -#include "qwt3d_plot.h" - -#include -#include - -using namespace Qwt3D; - -//! Provides a new VectorWriter object. -IO::Functor* VectorWriter::clone() const -{ - return new VectorWriter(*this); -} - -VectorWriter::VectorWriter() - : gl2ps_format_(GL2PS_EPS), - formaterror_(false), -#ifdef GL2PS_HAVE_ZLIB - compressed_(true), -#else - compressed_(false), -#endif - sortmode_(SIMPLESORT), - landscape_(VectorWriter::AUTO), - textmode_(VectorWriter::PIXEL), - texfname_(""), - export_size_(QSize()) - {} - - -/*! - Sets the mode for text output:\n - \param val The underlying format for the generated output:\n - PIXEL - poor quality but exact positioning\n - NATIVE - high quality but inexact positioning\n - TEX - high quality and exact positioning, arbitrary TeX strings as content for - the saved labels are possible. The disadvantage is the need for an additionally TeX run - to get the final output.\n - \param fname Optional, used only in conjunction with TeX output; file name - for the generated TeX file. If not set, a file called "OUTPUT.FOR.tex" - will be generated, where "OUTPUT.FOR" describes the file name argument for IO::save().\n\n - (04/05/27: On Linux platforms, pdflatex seems a file named 'dump_0.pdf.tex' mistakenly to - identify as PDF file.) -*/ -void VectorWriter::setTextMode(TEXTMODE val, QString fname) -{ - textmode_ = val; - texfname_ = (fname.isEmpty()) ? QString("") : fname; -} - - -#ifdef GL2PS_HAVE_ZLIB -//! Turns compressed output on or off (no effect if zlib support has not been set) -void VectorWriter::setCompressed(bool val) -{ - compressed_ = val; -} -#else -//! Turns compressed output on or off (no effect if zlib support has not been set) -void VectorWriter::setCompressed(bool) -{ - compressed_ = false; -} -#endif - - -/*! -Set output format, must be one of "EPS_GZ", "PS_GZ", "SVG_GZ", "EPS", -"PS", "PDF", "SVG", or "PGF" (case sensitive) -*/ -bool VectorWriter::setFormat(QString const& format) -{ - if (format == QString("EPS")) - { - gl2ps_format_ = GL2PS_EPS; - } - else if (format == QString("PS")) - { - gl2ps_format_ = GL2PS_PS; - } - else if (format == QString("PDF")) - { - gl2ps_format_ = GL2PS_PDF; - } -#ifdef GL2PS_HAVE_ZLIB - else if (format == QString("EPS_GZ")) - { - gl2ps_format_ = GL2PS_EPS; - } - else if (format == QString("PS_GZ")) - { - gl2ps_format_ = GL2PS_PS; - } -#endif - else if (format == QString("SVG")) - { - gl2ps_format_ = GL2PS_SVG; - } -#ifdef GL2PS_HAVE_ZLIB - else if (format == QString("SVG_GZ")) - { - gl2ps_format_ = GL2PS_SVG; - } -#endif - else if (format == QString("PGF")) - { - gl2ps_format_ = GL2PS_PGF; - } - else - { - formaterror_ = true; - return false; - } - formaterror_ = false; - return true; -} - -//! Performs actual output -bool VectorWriter::operator()(Plot3D* plot, QString const& fname) -{ - if (formaterror_) - return false; - - char* tmploc = setlocale(LC_ALL, "C"); - - plot->makeCurrent(); - - QSize size = plot->size(); - if (export_size_.isValid()) - plot->resize(export_size_); - - GLint bufsize = 0, state = GL2PS_OVERFLOW; - GLint viewport[4]; - - glGetIntegerv(GL_VIEWPORT, viewport); - - GLint options = GL2PS_SIMPLE_LINE_OFFSET | GL2PS_SILENT | GL2PS_DRAW_BACKGROUND | - GL2PS_OCCLUSION_CULL | GL2PS_BEST_ROOT; - - - if (compressed_) - options |= GL2PS_COMPRESS; - - switch (landscape_) - { - case VectorWriter::AUTO: - if (viewport[2] - viewport[0] > viewport[3] - viewport[0]) - options |= GL2PS_LANDSCAPE; - break; - case VectorWriter::ON: - options |= GL2PS_LANDSCAPE; - break; - default: - break; - } - - int sortmode = GL2PS_SIMPLE_SORT; - switch (sortmode_) - { - case VectorWriter::NOSORT: - sortmode = GL2PS_NO_SORT; - break; - case VectorWriter::SIMPLESORT: - sortmode = GL2PS_SIMPLE_SORT; - break; - case VectorWriter::BSPSORT: - sortmode = GL2PS_BSP_SORT; - break; - default: - break; - } - - switch (textmode_) - { - case NATIVE: - Label::useDeviceFonts(true); - break; - case PIXEL: - Label::useDeviceFonts(false); - break; - case TEX: - options |= GL2PS_NO_PIXMAP | GL2PS_NO_TEXT; - break; - default: - break; - } - - QString version = QString::number(QWT3D_MAJOR_VERSION) + "." - + QString::number(QWT3D_MINOR_VERSION) + "." - + QString::number(QWT3D_PATCH_VERSION); - - QString producer = QString("QwtPlot3D ") + version + - ", (C) 2002"; - - // calculate actual year - time_t now; - struct tm *newtime; - time(&now); - newtime = gmtime(&now); - if (newtime && newtime->tm_year + 1900 > 2002) - producer += "-" + QString::number(newtime->tm_year+1900); - - // the SVG format does not like some of the characters in a mail address - producer += " Micha Bieber, mailto: krischnamurti at users.sourceforge.net"; - - FILE *fp = fopen(QWT3DLOCAL8BIT(fname), "wb"); - if (!fp) - { - Label::useDeviceFonts(false); - setlocale(LC_ALL, tmploc); - return false; - } - - plot->setExportingVector(true, gl2ps_format_); - - while( state == GL2PS_OVERFLOW ){ - bufsize += 2*1024*1024; - gl2psBeginPage ( QWT3DLOCAL8BIT(fname), QWT3DLOCAL8BIT(producer), viewport, - gl2ps_format_, sortmode, - options, GL_RGBA, 0, NULL, 0, 0, 0, bufsize, - fp, QWT3DLOCAL8BIT(fname) ); - - plot->updateGL(); - state = gl2psEndPage(); - } - fclose(fp); - - // extra TeX file - if (textmode_ == TEX) - { - QFileInfo fi(fname); - QString fn = fname; - fn = fn.remove(fi.suffix()) + "tex"; - - fp = fopen(QWT3DLOCAL8BIT(fn), "wb"); - if (!fp) - { - Label::useDeviceFonts(false); - setlocale(LC_ALL, tmploc); - return false; - } - Label::useDeviceFonts(true); - options &= ~GL2PS_NO_PIXMAP & ~GL2PS_NO_TEXT; - state = GL2PS_OVERFLOW; - while( state == GL2PS_OVERFLOW ) - { - bufsize += 2*1024*1024; - gl2psBeginPage ( QWT3DLOCAL8BIT(fn), QWT3DLOCAL8BIT(producer), viewport, - GL2PS_TEX, sortmode, - options, GL_RGBA, 0, NULL, 0, 0, 0, bufsize, - fp, QWT3DLOCAL8BIT(fn) ); - - plot->updateGL(); - state = gl2psEndPage(); - } - fclose(fp); - } - plot->setExportingVector(false); - - Label::useDeviceFonts(false); - - setlocale(LC_ALL, tmploc); - if (export_size_.isValid()) - plot->resize(size);// restore original plot size - - return true; -} - - -// moved - -GLint Qwt3D::setDeviceLineWidth(GLfloat val) -{ - if (val<0) - val=0; - - GLint ret = gl2psLineWidth(val); - - GLfloat lw[2]; - glGetFloatv(GL_LINE_WIDTH_RANGE, lw); - - if (val < lw[0]) - val = lw[0]; - else if (val > lw[1]) - val = lw[1]; - - glLineWidth(val); - return ret; -} - -GLint Qwt3D::setDevicePointSize(GLfloat val) -{ - if (val<0) - val=0; - - GLint ret = gl2psPointSize(val); - - GLfloat lw[2]; - glGetFloatv(GL_POINT_SIZE_RANGE, lw); - - if (val < lw[0]) - val = lw[0]; - else if (val > lw[1]) - val = lw[1]; - - glPointSize(val); - return ret; -} - -GLint Qwt3D::drawDevicePixels(GLsizei width, GLsizei height, - GLenum format, GLenum type, - const void *pixels) -{ - glDrawPixels(width, height, format, type, pixels); - - if(format != GL_RGBA || type != GL_UNSIGNED_BYTE) - return GL2PS_ERROR; - - GLfloat* convertedpixel = (GLfloat*)malloc(4 * width * height * sizeof(GLfloat)); - if (!convertedpixel) - return GL2PS_ERROR; - - GLubyte* px = (GLubyte*)pixels; - for (int i = 0; i != 4*width*height; i += 4){ - convertedpixel[i] = px[i] / 255.0; - convertedpixel[i+1] = px[i+1] / 255.0; - convertedpixel[i+2] = px[i+2] / 255.0; - convertedpixel[i+3] = px[i+3] / 255.0; - } - GLint ret = gl2psDrawPixels(width, height, 0, 0, GL_RGBA, GL_FLOAT, convertedpixel); - free(convertedpixel); - return ret; -} - -GLint Qwt3D::drawDeviceText(const char* str, const char* fontname, int fontsize, Triple pos, RGBA color, ANCHOR align, double gap, double angle) -{ - double vp[3]; - - World2ViewPort(vp[0], vp[1], vp[2], pos.x, pos.y, pos.z); - Triple start(vp[0],vp[1],vp[2]); - - GLdouble fcol[4]; - glGetDoublev(GL_CURRENT_COLOR, fcol); - GLdouble bcol[4]; - glGetDoublev(GL_COLOR_CLEAR_VALUE, bcol); - - glColor4d(color.r, color.g, color.b, color.a); - glClearColor(color.r, color.g, color.b, color.a); - - GLint ret = GL2PS_SUCCESS; - - GLint a = GL2PS_TEXT_BL; - switch(align) - { - case Center: - a = GL2PS_TEXT_C; - break; - case CenterLeft: - a = GL2PS_TEXT_CL; - start += Triple(gap,0,0); - break; - case CenterRight: - a = GL2PS_TEXT_CR; - start += Triple(-gap,0,0); - break; - case BottomCenter: - a = GL2PS_TEXT_B; - start += Triple(0,gap,0); - break; - case BottomLeft: - a = GL2PS_TEXT_BL; - start += Triple(gap,gap,0); - break; - case BottomRight: - a = GL2PS_TEXT_BR; - start += Triple(-gap,gap,0); - break; - case TopCenter: - a = GL2PS_TEXT_T; - start += Triple(0,-gap,0); - break; - case TopLeft: - a = GL2PS_TEXT_TL; - start += Triple(gap,-gap,0); - break; - case TopRight: - a = GL2PS_TEXT_TR; - start += Triple(-gap,-gap,0); - break; - default: - break; - } - - ViewPort2World(vp[0], vp[1], vp[2], start.x, start.y, start.z); - Triple adjpos(vp[0],vp[1],vp[2]); - - glRasterPos3d(adjpos.x, adjpos.y, adjpos.z); - ret = gl2psTextOpt(str, fontname, (int)fontsize, a, angle); - glColor4dv(fcol); - glClearColor(bcol[0], bcol[1], bcol[2], bcol[3]); - return ret; -} - -void Qwt3D::setDevicePolygonOffset(GLfloat factor, GLfloat units) -{ - glPolygonOffset(factor, units); - gl2psEnable(GL2PS_POLYGON_OFFSET_FILL); -} === added file '3rdparty/qwtplot3d/src/qwt3d_io_reader.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_io_reader.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_io_reader.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,210 @@ +#if defined(_MSC_VER) /* MSVC Compiler */ +#pragma warning ( disable : 4786 ) +#endif + +#include +#include +#include +#include + +#include "qwt3d_curve.h" +#include "qwt3d_io_reader.h" + +using namespace std; +using namespace Qwt3D; + +const char* NativeReader::magicstring = "jk:11051895-17021986"; +QString IO::title = QString(); + +namespace +{ + FILE* open(QString fname) { + FILE* file = fopen(QWT3DLOCAL8BIT(fname), "r"); + if (!file) { + fprintf(stderr, "NativeReader::read: cannot open data file \"%s\"\n", QWT3DLOCAL8BIT(fname)); + } + return file; + } + + int read_char (FILE * fp, bool skipcomments = true) { + int c; + + if ((c = fgetc (fp)) == EOF) return (c); + + if (skipcomments) { + if (c == '#') { + do { + if ((c = fgetc (fp)) == EOF) return (c); + } while (c != '\n' && c != '\r'); + } + } + return (c); + } + + char* read_field (FILE * fp, bool skipcomments = true) { + static char buf[71]; + int c, i; + + do { + if ((c = read_char (fp,skipcomments)) == EOF) return (NULL); + } while (isspace (c)); + + for (i = 0; i < 70 && !isspace (c); ++i) { + buf[i] = c; + if ((c = read_char (fp,skipcomments)) == EOF) break; + } + buf[i] = '\0'; + return (buf); + } + + QString read_line (FILE * fp, bool skipcomments = true) { + int c; + QString line; + + do { + if ((c = read_char (fp,skipcomments)) == EOF) return (NULL); + if (c != '\n' && c != '\r') line.append(c); + } while (c != '\n' && c != '\r'); + + return line; + } + + //! set to data begin + bool extract_info(FILE* fp, unsigned int& xmesh, unsigned int& ymesh, double& xmin, double& xmax, double& ymin, double& ymax) { + char* p; + + // find out the size + if ((p = read_field (fp)) == 0) return false; + xmesh = (unsigned int)atoi(p); + + if ((p = read_field (fp)) == 0) return false; + ymesh = (unsigned int)atoi (p); + + if (xmesh < 1 || ymesh < 1) return false; + + // ... and the limits + if ((p = read_field (fp)) == 0) return false; + xmin = atof (p); + + if ((p = read_field (fp)) == 0) return false; + xmax = atof (p); + + if ((p = read_field (fp)) == 0) return false; + ymin = atof (p); + + if ((p = read_field (fp)) == 0) return false; + ymax = atof (p); + + if (xmin > xmax || ymin > ymax) return false; + + return true; + } + + //! find out what the magic string is and compare + bool check_magic(FILE* fp, const char* val) + { + Q_UNUSED(val); + + if ((IO::title = read_line (fp,false)) == 0) return false; + + return true; + } + + //! find out what the type is + bool check_type(FILE* fp, const char* val) + { + char* p; + if ((p = read_field (fp)) == 0) return false; + + if (strcmp (p, val ) != 0) return false; + + return true; + } + + double** allocateData(int columns, int rows) + { + double** data = new double* [columns] ; + + for ( int i = 0; i < columns; ++i) + { + data[i] = new double [rows]; + } + return data; + } + + void deleteData(double**data, int columns) + { + for ( int i = 0; i < columns; i++) + { + delete [] data[i]; + } + delete [] data; + } +} + +NativeReader::NativeReader() +: minz_(-DBL_MAX), maxz_(DBL_MAX) +{ +} + +bool NativeReader::collectInfo(FILE*& file, QString const& fname, unsigned& xmesh, unsigned& ymesh, + double& minx, double& maxx, double& miny, double& maxy) +{ + if (fname.isEmpty()) + return false; + + file = open(fname); + + if (!file) + return false; + + + if ( + (!check_magic(file, magicstring)) + ||(!check_type(file, "MESH")) + ||(!extract_info(file, xmesh, ymesh, minx, maxx, miny, maxy)) + ) + { + fclose(file); + return false; + } + + return true; +} + + +bool NativeReader::operator()(Plot3D* plot, QString const& fname) +{ + FILE* file; + unsigned int xmesh, ymesh; + double minx, maxx, miny, maxy; + + if ( !collectInfo(file, fname, xmesh, ymesh, minx, maxx, miny, maxy) ) + return false; + + double** data = allocateData(xmesh, ymesh); // allocate some space for the mesh + + for (unsigned int j = 0; j < ymesh; j++) { + for (unsigned int i = 0; i < xmesh; i++) { + if (fscanf(file, "%lf", &data[i][j]) != 1) { + fprintf(stderr, "NativeReader::read: error in data file \"%s\"\n", QWT3DLOCAL8BIT(fname)); + return false; + } + + if (data[i][j] > maxz_) data[i][j] = maxz_; + else if (data[i][j] < minz_) data[i][j] = minz_; + } + } + + fclose(file); // close the file + + Curve* curve = plot->curve(); + curve->loadFromData(data, xmesh, ymesh, minx, maxx, miny, maxy); + qDebug() << "NativeReader: loadFromData - data =" << data << "[ xmesh =" << xmesh << "ymesh =" << ymesh << "maxx =" << maxx << "maxy =" << maxy << "]"; + + plot->addCurve(curve); + plot->addTitle(curve->title()); + deleteData(data,xmesh); + + return true; +} === removed file '3rdparty/qwtplot3d/src/qwt3d_io_reader.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_io_reader.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_io_reader.cpp 1970-01-01 00:00:00 +0000 @@ -1,225 +0,0 @@ -#if defined(_MSC_VER) /* MSVC Compiler */ -#pragma warning ( disable : 4786 ) -#endif - -#include -#include -#include - -#include "qwt3d_surfaceplot.h" -#include "qwt3d_io_reader.h" - -using namespace std; -using namespace Qwt3D; - -const char* NativeReader::magicstring = "jk:11051895-17021986"; - -namespace -{ - FILE* open(QString fname) - { - FILE* file = fopen(QWT3DLOCAL8BIT(fname), "r"); - if (!file) - { - fprintf(stderr, "NativeReader::read: cannot open data file \"%s\"\n", QWT3DLOCAL8BIT(fname)); - } - return file; - } - - int read_char (FILE * fp, bool skipcomments = true) - { - int c; - - if ((c = fgetc (fp)) == EOF) - return (c); - if (skipcomments) - { - if (c == '#') - { - do - { - if ((c = fgetc (fp)) == EOF) - return (c); - } - while (c != '\n' && c != '\r'); - } - } - return (c); - } - - char* read_field (FILE * fp, bool skipcomments = true) - { - static char buf[71]; - int c, i; - - do - { - if ((c = read_char (fp,skipcomments)) == EOF) - return (NULL); - } - while (isspace (c)); - for (i = 0; i < 70 && !isspace (c); ++i) - { - buf[i] = c; - if ((c = read_char (fp,skipcomments)) == EOF) - break; - } - buf[i] = '\0'; - return (buf); - } - - - //! set to data begin - bool extract_info(FILE* fp, unsigned int& xmesh, unsigned int& ymesh, double& xmin, double& xmax, double& ymin, double& ymax) - { - char* p; - - // find out the size - if ((p = read_field (fp)) == 0) - return false; - xmesh = (unsigned int)atoi(p); - - if ((p = read_field (fp)) == 0) - return false; - ymesh = (unsigned int)atoi (p); - - if (xmesh < 1 || ymesh < 1) - return false; - - // ... and the limits - if ((p = read_field (fp)) == 0) - return false; - xmin = atof (p); - - if ((p = read_field (fp)) == 0) - return false; - xmax = atof (p); - - if ((p = read_field (fp)) == 0) - return false; - ymin = atof (p); - - if ((p = read_field (fp)) == 0) - return false; - ymax = atof (p); - - if (xmin > xmax || ymin > ymax) - return false; - - return true; - } - - //! find out what the magic string is and compare - bool check_magic(FILE* fp, const char* val) - { - char* p; - if ((p = read_field (fp,false)) == 0) - return false; - - if (strcmp (p, val ) != 0) - return false; - return true; - } - - //! find out what the type is - bool check_type(FILE* fp, const char* val) - { - char* p; - if ((p = read_field (fp)) == 0) - return false; - - if (strcmp (p, val ) != 0) - return false; - return true; - } - - double** allocateData(int columns, int rows) - { - double** data = new double* [columns] ; - - for ( int i = 0; i < columns; ++i) - { - data[i] = new double [rows]; - } - return data; - } - - void deleteData(double**data, int columns) - { - for ( int i = 0; i < columns; i++) - { - delete [] data[i]; - } - delete [] data; - } -} - -NativeReader::NativeReader() -: minz_(-DBL_MAX), maxz_(DBL_MAX) -{ -} - -bool NativeReader::collectInfo(FILE*& file, QString const& fname, unsigned& xmesh, unsigned& ymesh, - double& minx, double& maxx, double& miny, double& maxy) -{ - if (fname.isEmpty()) - return false; - - file = open(fname); - - if (!file) - return false; - - - if ( - (!check_magic(file, magicstring)) - ||(!check_type(file, "MESH")) - ||(!extract_info(file, xmesh, ymesh, minx, maxx, miny, maxy)) - ) - { - fclose(file); - return false; - } - - return true; -} - - -bool NativeReader::operator()(Plot3D* plot, QString const& fname) -{ - - FILE* file; - unsigned int xmesh, ymesh; - double minx, maxx, miny, maxy; - - if ( !collectInfo(file, fname, xmesh, ymesh, minx, maxx, miny, maxy) ) - return false; - - /* allocate some space for the mesh */ - double** data = allocateData(xmesh, ymesh); - - for (unsigned int j = 0; j < ymesh; j++) - { - for (unsigned int i = 0; i < xmesh; i++) - { - if (fscanf(file, "%lf", &data[i][j]) != 1) - { - fprintf(stderr, "NativeReader::read: error in data file \"%s\"\n", QWT3DLOCAL8BIT(fname)); - return false; - } - - if (data[i][j] > maxz_) - data[i][j] = maxz_; - else if (data[i][j] < minz_) - data[i][j] = minz_; - } - } - - /* close the file */ - fclose(file); - - ((SurfacePlot*)plot)->loadFromData(data, xmesh, ymesh, minx, maxx, miny, maxy); - deleteData(data,xmesh); - - return true; -} === added file '3rdparty/qwtplot3d/src/qwt3d_label.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_label.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_label.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,326 @@ +#include +#include "qwt3d_label.h" +#include "qwt3d_plot.h" +#include "../3rdparty/gl2ps/gl2ps.h" + +using namespace Qwt3D; + +bool Label::devicefonts_ = false; + +Label::Label() +{ + init(); +} + +Label::Label(const QString & family, int pointSize, int weight, bool italic) +{ + init(family, pointSize, weight, italic); +} + + +void Label::init(const QString & family, int pointSize, int weight, bool italic) +{ + init(); + font_ = QFont(family, pointSize, weight, italic ); +} + +void Label::init() +{ + beg_ = Triple(0.0, 0.0, 0.0); + end_ = beg_; + pos_ = beg_; + setColor(0,0,0); + font_ = QFont(); + anchor_ = BottomLeft; + gap_ = 0; + width_ = 0.0; + height_ = 0.0; +} + +void Label::useDeviceFonts(bool val) +{ + devicefonts_ = val; +} + +void Label::setFont(const QFont& f) +{ + if ( font_ == f ) { + return; + } + font_ = f; +} + +void Label::setFont(const QString & family, int pointSize, int weight, bool italic) +{ + setFont( QFont(family, pointSize, weight, italic ) ); +} + +void Label::setString(QString const& s) +{ + text_ = s; +} + +const QString& Label::string() const +{ + return text_; +} + +void Label::setColor(double r, double g, double b, double a) +{ + Drawable::setColor(r,g,b,a); + flagforupdate_ = true; +} + +void Label::setColor(Qwt3D::RGBA rgba) +{ + Drawable::setColor(rgba); + flagforupdate_ = true; +} + +/** +example: + +\verbatim + + Anchor TopCenter (*) resp. BottomRight(X) + + +----*----+ + | Pixmap | + +---------X + +\endverbatim +*/ +void Label::setPosition(Triple pos, ANCHOR a) +{ + use_relpos_ = false; + anchor_ = a; + pos_ = pos; +} + +void Label::setRelPosition(Tuple rpos, ANCHOR a) +{ + double ot = 0.99; + relpos_ = Triple(rpos.x, rpos.y, ot); + anchor_ = a; + use_relpos_ = true; +} + +QImage Label::createImage(double angle) +{ + QRect r = QRect(QPoint(0, 0), QFontMetrics(font_).size(Qwt3D::SingleLine, text_)); + int textWidth = r.width(); + int textHeight = r.height(); + + double aux_a = angle; + if (aux_a > 270) + aux_a -= 270; + if (aux_a >= 180) + aux_a -= 180; + if (aux_a > 90) + aux_a -= 90; + + double rad = aux_a*M_PI/180.0; + + int w = 0, h = 0; + if ((angle >= 0 && angle <= 90) || (angle >= 180 && angle <= 270)){ + w = qRound(fabs(textWidth*cos(rad) + textHeight*sin(rad))); + h = qRound(fabs(textWidth*sin(rad) + textHeight*cos(rad))); + } else { + w = qRound(fabs(textWidth*sin(rad) + textHeight*cos(rad))); + h = qRound(fabs(textWidth*cos(rad) + textHeight*sin(rad))); + } + + width_ = w; + height_ = h; + + QPixmap pm_ = QPixmap(w, h); + + if (plot() && plot()->isExportingVector() && plot()->vectorExportFormat() != GL2PS_PDF){ + Qwt3D::RGBA rgba = plot()->backgroundRGBAColor(); + pm_.fill(GL2Qt(rgba.r, rgba.g, rgba.b)); + } else + pm_.fill(Qt::transparent); + + QPainter p(&pm_); + + if (angle >= 270) + p.translate(textHeight*cos(rad), 0.0); + else if (angle >= 180) + p.translate(w, textHeight*cos(rad)); + else if (angle > 90) + p.translate(textWidth*sin(rad), h); + else + p.translate(0.0, textWidth*sin(rad)); + + p.rotate(-angle); + p.translate(0.0, textHeight - QFontMetrics(font_).descent()); + + p.setFont( font_ ); + p.setPen(Qt::SolidLine); + p.setPen(GL2Qt(color.r, color.g, color.b)); + p.drawText(0, 0, text_); + p.end(); + + return QGLWidget::convertToGLFormat(pm_.toImage()); +} + +/** +Adds an additional shift to the anchor point. This happens in a more or less intelligent manner +depending on the nature of the anchor: +\verbatim +anchor type shift + +left aligned --> +right aligned <-- +top aligned top-down +bottom aligned bottom-up +\endverbatim +The unit is user space dependend (one pixel on screen - play around to get satisfying results) +*/ +void Label::adjust(int gap) +{ + gap_ = gap; +} + +void Label::convert2screen() +{ + Triple start = World2ViewPort(pos_); + + switch (anchor_) + { + case BottomLeft : + beg_ = pos_; + break; + case BottomRight: + beg_ = ViewPort2World(start - Triple(width() + gap_, 0, 0)); + break; + case BottomCenter: + beg_ = ViewPort2World(start - Triple(width() / 2, -gap_, 0)); + break; + case TopRight: + beg_ = ViewPort2World(start - Triple(width() + gap_, height(), 0)); + break; + case TopLeft: + beg_ = ViewPort2World(start - Triple(-gap_, height(), 0)); + break; + case TopCenter: + beg_ = ViewPort2World(start - Triple(width() / 2, height() + gap_, 0)); + break; + case CenterLeft: + beg_ = ViewPort2World(start - Triple(-gap_, height() / 2, 0)); + break; + case CenterRight: + beg_ = ViewPort2World(start - Triple(width() + gap_, height() / 2, 0)); + break; + case Center: + beg_ = ViewPort2World(start - Triple(width() / 2, height() / 2, 0)); + break; + default: + break; + } + start = World2ViewPort(beg_); + end_ = ViewPort2World(start + Triple(width(), height(), 0)); +} + +const char * Label::fontname() +{ + const char *name = "Helvetica"; + if (font_.family() == "Times New Roman"){ + name = "Times"; + if (font_.bold() && font_.italic ()) + name = "Times-BoldItalic"; + else if (font_.italic()) + name = "Times-Italic"; + else if (font_.bold()) + name = "Times-Bold"; + } else if (font_.family() == "Courier" || font_.family() == "Courier New"){ + name = "Courier"; + if (font_.bold() && font_.italic ()) + name = "Courier-BoldOblique"; + else if (font_.italic()) + name = "Courier-Oblique"; + else if (font_.bold()) + name = "Courier-Bold"; + } else { + if (font_.bold() && font_.italic ()) + name = "Helvetica-BoldOblique"; + else if (font_.italic()) + name = "Helvetica-Oblique"; + else if (font_.bold()) + name = "Helvetica-Bold"; + } + + return (const char*) name; +} + +void Label::draw(double angle) +{ + if (!plot() || !plot()->isVisible()) + return; + + if (text_.isEmpty()) + return; + + if ( use_relpos_ ) { + getMatrices(modelMatrix, projMatrix, viewport); + beg_ = relativePosition(relpos_); + setPosition(beg_, anchor_); + use_relpos_ = true;// reset the flag + } + + GLboolean b; + GLint func; + GLdouble v; + glGetBooleanv(GL_ALPHA_TEST, &b); + glGetIntegerv(GL_ALPHA_TEST_FUNC, &func); + glGetDoublev(GL_ALPHA_TEST_REF, &v); + + glEnable (GL_ALPHA_TEST); + glAlphaFunc (GL_NOTEQUAL, 0.0); + + convert2screen(); + glRasterPos3d(beg_.x, beg_.y, beg_.z); + + if (plot()->isExportingVector()){ + if (devicefonts_) + drawDeviceText(QWT3DLOCAL8BIT(text_), fontname(), font_.pointSize(), pos_, color, anchor_, gap_, angle); + else { + QImage tex_ = createImage(angle); + drawDevicePixels(tex_.width(), tex_.height(), GL_RGBA, GL_UNSIGNED_BYTE, tex_.bits()); + } + } else { + if (!angle){ + Triple start = World2ViewPort(beg_); + start = ViewPort2World(start + Triple(0, QFontMetrics(font_).descent(), 0)); + plot()->qglColor(GL2Qt(color.r, color.g, color.b)); + plot()->renderText(start.x, start.y, start.z, text_, font_); + } else { + QImage tex_ = createImage(angle); + drawDevicePixels(tex_.width(), tex_.height(), GL_RGBA, GL_UNSIGNED_BYTE, tex_.bits()); + } + } + + glAlphaFunc(func,v); + Enable(GL_ALPHA_TEST, b); +} + +double Label::width() const +{ + if (width_ > 0.0 && height_ > 0.0) + return width_; + + return QRect(QPoint(0, 0), QFontMetrics(font_).size(Qwt3D::SingleLine, text_)).width(); +} + +double Label::height() const +{ + if (width_ > 0.0 && height_ > 0.0) + return height_; + + return QRect(QPoint(0, 0), QFontMetrics(font_).size(Qwt3D::SingleLine, text_)).height(); +} + +double Label::textHeight() const +{ + return QRect(QPoint(0, 0), QFontMetrics(font_).size(Qwt3D::SingleLine, text_)).height(); +} === removed file '3rdparty/qwtplot3d/src/qwt3d_label.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_label.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_label.cpp 1970-01-01 00:00:00 +0000 @@ -1,304 +0,0 @@ -#include -#include "qwt3d_label.h" -#include "qwt3d_plot.h" -#include "../3rdparty/gl2ps/gl2ps.h" - -using namespace Qwt3D; - -bool Label::devicefonts_ = false; - -Label::Label() -{ - init(); -} - -Label::Label(const QString & family, int pointSize, int weight, bool italic) -{ - init(family, pointSize, weight, italic); -} - - -void Label::init(const QString & family, int pointSize, int weight, bool italic) -{ - init(); - font_ = QFont(family, pointSize, weight, italic ); -} - -void Label::init() -{ - beg_ = Triple(0.0, 0.0, 0.0); - end_ = beg_; - pos_ = beg_; - setColor(0,0,0); - font_ = QFont(); - anchor_ = BottomLeft; - gap_ = 0; - width_ = 0.0; - height_ = 0.0; -} - -void Label::useDeviceFonts(bool val) -{ - devicefonts_ = val; -} - -void Label::setFont(const QString & family, int pointSize, int weight, bool italic) -{ - font_ = QFont(family, pointSize, weight, italic ); -} - -void Label::setString(QString const& s) -{ - text_ = s; -} - -void Label::setColor(double r, double g, double b, double a) -{ - Drawable::setColor(r,g,b,a); -} - -void Label::setColor(Qwt3D::RGBA rgba) -{ - Drawable::setColor(rgba); -} - -/** -example: - -\verbatim - - Anchor TopCenter (*) resp. BottomRight(X) - - +----*----+ - | Pixmap | - +---------X - -\endverbatim -*/ -void Label::setPosition(Triple pos, ANCHOR a) -{ - anchor_ = a; - pos_ = pos; -} - -void Label::setRelPosition(Tuple rpos, ANCHOR a) -{ - double ot = 0.99; - - getMatrices(modelMatrix, projMatrix, viewport); - beg_ = relativePosition(Triple(rpos.x, rpos.y, ot)); - setPosition(beg_, a); -} - -QImage Label::createImage(double angle) -{ - QRect r = QRect(QPoint(0, 0), QFontMetrics(font_).size(Qwt3D::SingleLine, text_)); - int textWidth = r.width(); - int textHeight = r.height(); - - double aux_a = angle; - if (aux_a > 270) - aux_a -= 270; - if (aux_a >= 180) - aux_a -= 180; - if (aux_a > 90) - aux_a -= 90; - - double rad = aux_a*M_PI/180.0; - - int w = 0, h = 0; - if ((angle >= 0 && angle <= 90) || (angle >= 180 && angle <= 270)){ - w = qRound(fabs(textWidth*cos(rad) + textHeight*sin(rad))); - h = qRound(fabs(textWidth*sin(rad) + textHeight*cos(rad))); - } else { - w = qRound(fabs(textWidth*sin(rad) + textHeight*cos(rad))); - h = qRound(fabs(textWidth*cos(rad) + textHeight*sin(rad))); - } - - width_ = w; - height_ = h; - - QPixmap pm_ = QPixmap(w, h); - - if (plot() && plot()->isExportingVector() && plot()->vectorExportFormat() != GL2PS_PDF){ - Qwt3D::RGBA rgba = plot()->backgroundRGBAColor(); - pm_.fill(GL2Qt(rgba.r, rgba.g, rgba.b)); - } else - pm_.fill(Qt::transparent); - - QPainter p(&pm_); - - if (angle >= 270) - p.translate(textHeight*cos(rad), 0.0); - else if (angle >= 180) - p.translate(w, textHeight*cos(rad)); - else if (angle > 90) - p.translate(textWidth*sin(rad), h); - else - p.translate(0.0, textWidth*sin(rad)); - - p.rotate(-angle); - p.translate(0.0, textHeight - QFontMetrics(font_).descent()); - - p.setFont( font_ ); - p.setPen(Qt::SolidLine); - p.setPen(GL2Qt(color.r, color.g, color.b)); - p.drawText(0, 0, text_); - p.end(); - - return QGLWidget::convertToGLFormat(pm_.toImage()); -} - -/** -Adds an additional shift to the anchor point. This happens in a more or less intelligent manner -depending on the nature of the anchor: -\verbatim -anchor type shift - -left aligned --> -right aligned <-- -top aligned top-down -bottom aligned bottom-up -\endverbatim -The unit is user space dependend (one pixel on screen - play around to get satisfying results) -*/ -void Label::adjust(int gap) -{ - gap_ = gap; -} - -void Label::convert2screen() -{ - Triple start = World2ViewPort(pos_); - - switch (anchor_) - { - case BottomLeft : - beg_ = pos_; - break; - case BottomRight: - beg_ = ViewPort2World(start - Triple(width() + gap_, 0, 0)); - break; - case BottomCenter: - beg_ = ViewPort2World(start - Triple(width() / 2, -gap_, 0)); - break; - case TopRight: - beg_ = ViewPort2World(start - Triple(width() + gap_, height(), 0)); - break; - case TopLeft: - beg_ = ViewPort2World(start - Triple(-gap_, height(), 0)); - break; - case TopCenter: - beg_ = ViewPort2World(start - Triple(width() / 2, height() + gap_, 0)); - break; - case CenterLeft: - beg_ = ViewPort2World(start - Triple(-gap_, height() / 2, 0)); - break; - case CenterRight: - beg_ = ViewPort2World(start - Triple(width() + gap_, height() / 2, 0)); - break; - case Center: - beg_ = ViewPort2World(start - Triple(width() / 2, height() / 2, 0)); - break; - default: - break; - } - start = World2ViewPort(beg_); - end_ = ViewPort2World(start + Triple(width(), height(), 0)); -} - -const char * Label::fontname() -{ - char *name = "Helvetica"; - if (font_.family() == "Times New Roman"){ - name = "Times"; - if (font_.bold() && font_.italic ()) - name = "Times-BoldItalic"; - else if (font_.italic()) - name = "Times-Italic"; - else if (font_.bold()) - name = "Times-Bold"; - } else if (font_.family() == "Courier" || font_.family() == "Courier New"){ - name = "Courier"; - if (font_.bold() && font_.italic ()) - name = "Courier-BoldOblique"; - else if (font_.italic()) - name = "Courier-Oblique"; - else if (font_.bold()) - name = "Courier-Bold"; - } else { - if (font_.bold() && font_.italic ()) - name = "Helvetica-BoldOblique"; - else if (font_.italic()) - name = "Helvetica-Oblique"; - else if (font_.bold()) - name = "Helvetica-Bold"; - } - - return (const char*) name; -} - -void Label::draw(double angle) -{ - if (!plot() || !plot()->isVisible()) - return; - - if (text_.isEmpty()) - return; - - GLboolean b; - GLint func; - GLdouble v; - glGetBooleanv(GL_ALPHA_TEST, &b); - glGetIntegerv(GL_ALPHA_TEST_FUNC, &func); - glGetDoublev(GL_ALPHA_TEST_REF, &v); - - glEnable (GL_ALPHA_TEST); - glAlphaFunc (GL_NOTEQUAL, 0.0); - - convert2screen(); - glRasterPos3d(beg_.x, beg_.y, beg_.z); - - if (plot()->isExportingVector()){ - if (devicefonts_) - drawDeviceText(QWT3DLOCAL8BIT(text_), fontname(), font_.pointSize(), pos_, color, anchor_, gap_, angle); - else { - QImage tex_ = createImage(angle); - drawDevicePixels(tex_.width(), tex_.height(), GL_RGBA, GL_UNSIGNED_BYTE, tex_.bits()); - } - } else { - if (!angle){ - Triple start = World2ViewPort(beg_); - start = ViewPort2World(start + Triple(0, QFontMetrics(font_).descent(), 0)); - plot()->qglColor(GL2Qt(color.r, color.g, color.b)); - plot()->renderText(start.x, start.y, start.z, text_, font_); - } else { - QImage tex_ = createImage(angle); - drawDevicePixels(tex_.width(), tex_.height(), GL_RGBA, GL_UNSIGNED_BYTE, tex_.bits()); - } - } - - glAlphaFunc(func,v); - Enable(GL_ALPHA_TEST, b); -} - -double Label::width() const -{ - if (width_ > 0.0 && height_ > 0.0) - return width_; - - return QRect(QPoint(0, 0), QFontMetrics(font_).size(Qwt3D::SingleLine, text_)).width(); -} - -double Label::height() const -{ - if (width_ > 0.0 && height_ > 0.0) - return height_; - - return QRect(QPoint(0, 0), QFontMetrics(font_).size(Qwt3D::SingleLine, text_)).height(); -} - -double Label::textHeight() const -{ - return QRect(QPoint(0, 0), QFontMetrics(font_).size(Qwt3D::SingleLine, text_)).height(); -} === added file '3rdparty/qwtplot3d/src/qwt3d_lighting.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_lighting.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_lighting.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,192 @@ +#if defined(_MSC_VER) /* MSVC Compiler */ +#pragma warning ( disable : 4305 ) +#pragma warning ( disable : 4786 ) +#endif + +#include +#include "qwt3d_plot.h" + +using namespace Qwt3D; + +namespace { +inline GLenum lightEnum(unsigned idx) +{ + switch(idx) { + case 0: + return GL_LIGHT0; + case 1: + return GL_LIGHT1; + case 2: + return GL_LIGHT2; + case 3: + return GL_LIGHT3; + case 4: + return GL_LIGHT4; + case 5: + return GL_LIGHT5; + case 6: + return GL_LIGHT6; + case 7: + return GL_LIGHT7; + default: + return GL_LIGHT0; + } +} + +} + +void ExtGLWidget::enableLighting(bool val) +{ + if (lighting_enabled_ == val) + return; + + lighting_enabled_ = val; + makeCurrent(); + if (val) + glEnable(GL_LIGHTING); + else + glDisable(GL_LIGHTING); + + if (!initializedGL()) + return; + updateGL(); +} + +void ExtGLWidget::disableLighting(bool val) +{ + enableLighting(!val); +} + +bool ExtGLWidget::lightingEnabled() const +{ + return lighting_enabled_; +} + +/** + \param light light number [0..7] + \see setLight +*/ +void ExtGLWidget::illuminate(unsigned light) +{ + if (light>7) + return; + lights_[light].unlit = false; +} +/** + \param light light number [0..7] + \see setLight +*/ +void ExtGLWidget::blowout(unsigned light) +{ + if (light>7) + return; + lights_[light].unlit = false; +} + +/** + Sets GL material properties +*/ +void ExtGLWidget::setMaterialComponent(GLenum property, double r, double g, double b, double a) +{ + GLfloat rgba[4] = {(GLfloat)r, (GLfloat)g, (GLfloat)b, (GLfloat)a}; + makeCurrent(); + glMaterialfv(GL_FRONT_AND_BACK, property, rgba); +} + +/** + This function is for convenience. It sets GL material properties with the equal r,g,b values + and a blending alpha with value 1.0 +*/ +void ExtGLWidget::setMaterialComponent(GLenum property, double intensity) +{ + setMaterialComponent(property,intensity,intensity,intensity,1.0); +} + +/** + Sets GL shininess +*/ +void ExtGLWidget::setShininess(double exponent) +{ + makeCurrent(); + glMaterialf(GL_FRONT, GL_SHININESS, exponent); +} + +/** + Sets GL light properties for light 'light' +*/ +void ExtGLWidget::setLightComponent(GLenum property, double r, double g, double b, double a, unsigned light) +{ + GLfloat rgba[4] = {(GLfloat)r, (GLfloat)g, (GLfloat)b, (GLfloat)a}; + makeCurrent(); + glLightfv(lightEnum(light), property, rgba); +} + +/** + This function is for convenience. It sets GL light properties with the equal r,g,b values + and a blending alpha with value 1.0 +*/ +void ExtGLWidget::setLightComponent(GLenum property, double intensity, unsigned light) +{ + setLightComponent(property,intensity,intensity,intensity,1.0, lightEnum(light)); +} + +/** + Set the rotation angle of the light source. If you look along the respective axis towards ascending values, + the rotation is performed in mathematical \e negative sense + \param xVal angle in \e degree to rotate around the X axis + \param yVal angle in \e degree to rotate around the Y axis + \param zVal angle in \e degree to rotate around the Z axis + \param light light number +*/ +void ExtGLWidget::setLightRotation( double xVal, double yVal, double zVal, unsigned light ) +{ + if (light>7) + return; + lights_[light].rot.x = xVal; + lights_[light].rot.y = yVal; + lights_[light].rot.z = zVal; +} + +/** + Set the shift in light source (world) coordinates. + \param xVal shift along (world) X axis + \param yVal shift along (world) Y axis + \param zVal shift along (world) Z axis + \param light light number + \see setViewportShift() +*/ +void ExtGLWidget::setLightShift( double xVal, double yVal, double zVal, unsigned light ) +{ + if (light>7) + return; + lights_[light].shift.x = xVal; + lights_[light].shift.y = yVal; + lights_[light].shift.z = zVal; +} + +void ExtGLWidget::applyLight(unsigned light) +{ + if (lights_[light].unlit) + return; + + glEnable(lightEnum(light)); + glLoadIdentity(); + + glRotatef( lights_[light].rot.x-90, 1.0, 0.0, 0.0 ); + glRotatef( lights_[light].rot.y , 0.0, 1.0, 0.0 ); + glRotatef( lights_[light].rot.z , 0.0, 0.0, 1.0 ); + GLfloat lightPos[4] = { lights_[light].shift.x, lights_[light].shift.y, lights_[light].shift.z, 1.0}; + GLenum le = lightEnum(light); + glLightfv(le, GL_POSITION, lightPos); +} + +void ExtGLWidget::applyLights() +{ + glMatrixMode( GL_MODELVIEW ); + glPushMatrix(); + for (unsigned i=0; i<8; ++i) + { + applyLight(i); + } + glPopMatrix(); +} === removed file '3rdparty/qwtplot3d/src/qwt3d_lighting.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_lighting.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_lighting.cpp 1970-01-01 00:00:00 +0000 @@ -1,192 +0,0 @@ -#if defined(_MSC_VER) /* MSVC Compiler */ -#pragma warning ( disable : 4305 ) -#pragma warning ( disable : 4786 ) -#endif - -#include -#include "qwt3d_plot.h" - -using namespace Qwt3D; - -namespace { -inline GLenum lightEnum(unsigned idx) -{ - switch(idx) { - case 0: - return GL_LIGHT0; - case 1: - return GL_LIGHT1; - case 2: - return GL_LIGHT2; - case 3: - return GL_LIGHT3; - case 4: - return GL_LIGHT4; - case 5: - return GL_LIGHT5; - case 6: - return GL_LIGHT6; - case 7: - return GL_LIGHT7; - default: - return GL_LIGHT0; - } -} - -} - -void Plot3D::enableLighting(bool val) -{ - if (lighting_enabled_ == val) - return; - - lighting_enabled_ = val; - makeCurrent(); - if (val) - glEnable(GL_LIGHTING); - else - glDisable(GL_LIGHTING); - - if (!initializedGL()) - return; - updateGL(); -} - -void Plot3D::disableLighting(bool val) -{ - enableLighting(!val); -} - -bool Plot3D::lightingEnabled() const -{ - return lighting_enabled_; -} - -/** - \param light light number [0..7] - \see setLight -*/ -void Plot3D::illuminate(unsigned light) -{ - if (light>7) - return; - lights_[light].unlit = false; -} -/** - \param light light number [0..7] - \see setLight -*/ -void Plot3D::blowout(unsigned light) -{ - if (light>7) - return; - lights_[light].unlit = false; -} - -/** - Sets GL material properties -*/ -void Plot3D::setMaterialComponent(GLenum property, double r, double g, double b, double a) -{ - GLfloat rgba[4] = {(GLfloat)r, (GLfloat)g, (GLfloat)b, (GLfloat)a}; - makeCurrent(); - glMaterialfv(GL_FRONT_AND_BACK, property, rgba); -} - -/** - This function is for convenience. It sets GL material properties with the equal r,g,b values - and a blending alpha with value 1.0 -*/ -void Plot3D::setMaterialComponent(GLenum property, double intensity) -{ - setMaterialComponent(property,intensity,intensity,intensity,1.0); -} - -/** - Sets GL shininess -*/ -void Plot3D::setShininess(double exponent) -{ - makeCurrent(); - glMaterialf(GL_FRONT, GL_SHININESS, exponent); -} - -/** - Sets GL light properties for light 'light' -*/ -void Plot3D::setLightComponent(GLenum property, double r, double g, double b, double a, unsigned light) -{ - GLfloat rgba[4] = {(GLfloat)r, (GLfloat)g, (GLfloat)b, (GLfloat)a}; - makeCurrent(); - glLightfv(lightEnum(light), property, rgba); -} - -/** - This function is for convenience. It sets GL light properties with the equal r,g,b values - and a blending alpha with value 1.0 -*/ -void Plot3D::setLightComponent(GLenum property, double intensity, unsigned light) -{ - setLightComponent(property,intensity,intensity,intensity,1.0, lightEnum(light)); -} - -/** - Set the rotation angle of the light source. If you look along the respective axis towards ascending values, - the rotation is performed in mathematical \e negative sense - \param xVal angle in \e degree to rotate around the X axis - \param yVal angle in \e degree to rotate around the Y axis - \param zVal angle in \e degree to rotate around the Z axis - \param light light number -*/ -void Plot3D::setLightRotation( double xVal, double yVal, double zVal, unsigned light ) -{ - if (light>7) - return; - lights_[light].rot.x = xVal; - lights_[light].rot.y = yVal; - lights_[light].rot.z = zVal; -} - -/** - Set the shift in light source (world) coordinates. - \param xVal shift along (world) X axis - \param yVal shift along (world) Y axis - \param zVal shift along (world) Z axis - \param light light number - \see setViewportShift() -*/ -void Plot3D::setLightShift( double xVal, double yVal, double zVal, unsigned light ) -{ - if (light>7) - return; - lights_[light].shift.x = xVal; - lights_[light].shift.y = yVal; - lights_[light].shift.z = zVal; -} - -void Plot3D::applyLight(unsigned light) -{ - if (lights_[light].unlit) - return; - - glEnable(lightEnum(light)); - glLoadIdentity(); - - glRotatef( lights_[light].rot.x-90, 1.0, 0.0, 0.0 ); - glRotatef( lights_[light].rot.y , 0.0, 1.0, 0.0 ); - glRotatef( lights_[light].rot.z , 0.0, 0.0, 1.0 ); - GLfloat lightPos[4] = { lights_[light].shift.x, lights_[light].shift.y, lights_[light].shift.z, 1.0}; - GLenum le = lightEnum(light); - glLightfv(le, GL_POSITION, lightPos); -} - -void Plot3D::applyLights() -{ - glMatrixMode( GL_MODELVIEW ); - glPushMatrix(); - for (unsigned i=0; i<8; ++i) - { - applyLight(i); - } - glPopMatrix(); -} === added file '3rdparty/qwtplot3d/src/qwt3d_meshplot.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_meshplot.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_meshplot.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,403 @@ +#if defined(_MSC_VER) /* MSVC Compiler */ +#pragma warning ( disable : 4305 ) +#pragma warning ( disable : 4786 ) +#endif + +#include "qwt3d_curve.h" +#include "qwt3d_enrichment_std.h" + +using namespace std; +using namespace Qwt3D; + + +///////////////////////////////////////////////////////////////////////////////// +// +// cell specific +// + + +void Curve::createDataC() +{ + if (facemode_) createFaceData(); + if (sidemode_) createSideData(); + if (floormode_) createFloorData(); + + if (plotStyle() == NOPLOT) + return; + + if (plotStyle() == Qwt3D::POINTS) + { + createPoints(); + return; + } + else if (plotStyle() == Qwt3D::USER) + { + if (userplotstyle_p) + createEnrichment(*userplotstyle_p); + return; + } + + glPushAttrib(GL_POLYGON_BIT|GL_LINE_BIT|GL_COLOR_BUFFER_BIT); + setDeviceLineWidth(meshLineWidth()); + GLStateBewarer sb(GL_POLYGON_OFFSET_FILL,true); + setDevicePolygonOffset(polygonOffset(),1.0); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + int idx = 0; + if (plotStyle() != WIREFRAME) + { + glPolygonMode(GL_FRONT_AND_BACK, GL_QUADS); + + bool hl = (plotStyle() == HIDDENLINE); + if (hl) + { + RGBA col = plot_p->backgroundRGBAColor(); + glColor4d(col.r, col.g, col.b, col.a); + } + + for (unsigned i=0; i!=actualDataC_->cells.size(); ++i) + { + glBegin(GL_POLYGON); + for (unsigned j=0; j!=actualDataC_->cells[i].size(); ++j) + { + idx = actualDataC_->cells[i][j]; + setColorFromVertexC(idx, hl); + glVertex3d( actualDataC_->nodes[idx].x, actualDataC_->nodes[idx].y, actualDataC_->nodes[idx].z ); + glNormal3d( actualDataC_->normals[idx].x, actualDataC_->normals[idx].y, actualDataC_->normals[idx].z ); + } + glEnd(); + } + } + + if (plotStyle() == FILLEDMESH || plotStyle() == WIREFRAME || plotStyle() == HIDDENLINE) + { + glColor4d(meshColor().r, meshColor().g, meshColor().b, meshColor().a); + { + for (unsigned i=0; i!=actualDataC_->cells.size(); ++i) + { + glBegin(GL_LINE_LOOP); + for (unsigned j=0; j!=actualDataC_->cells[i].size(); ++j) + { + idx = actualDataC_->cells[i][j]; + glVertex3d( actualDataC_->nodes[idx].x, actualDataC_->nodes[idx].y, actualDataC_->nodes[idx].z ); + } + glEnd(); + } + } + } + glPopAttrib(); +} + +// ci = cell index +// cv = vertex index in cell ci +void Curve::setColorFromVertexC(int node, bool skip) +{ + if (skip) + return; + + RGBA col = (*datacolor_p)( + actualDataC_->nodes[node].x, actualDataC_->nodes[node].y, actualDataC_->nodes[node].z); + + glColor4d(col.r, col.g, col.b, col.a); +} + +void Curve::createFloorDataC() +{ + switch (floorStyle()) + { + case FLOORDATA: + Data2FloorC(); + break; + case FLOORISO: + Isolines2FloorC(dataProjected()); + break; + default: + break; + } +} + +void Curve::createSideDataC() +{ + switch (floorStyle()) + { + case FLOORDATA: + Data2SideC(); + break; + case FLOORISO: + Isolines2SideC(dataProjected()); + if (dataProjected()) createPoints(); + break; + default: + break; + } +} + +void Curve::createFaceDataC() +{ + switch (floorStyle()) + { + case FLOORDATA: + Data2FrontC(); + break; + case FLOORISO: + Isolines2FrontC(dataProjected()); + if (dataProjected()) createPoints(); + break; + default: + break; + } +} + +void Curve::DatamapC(unsigned int comp) +{ + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + + Triple tmin = actualData_p->hull().minVertex; + double shift = tmin(comp); + + for (unsigned i = 0; i!=actualDataC_->cells.size(); ++i) { + glBegin(GL_POLYGON); + for (unsigned j=0; j!=actualDataC_->cells[i].size(); ++j) { + int idx = actualDataC_->cells[i][j]; + Triple curr = actualDataC_->nodes[idx]; + + setColorFromVertexC(idx); + drawVertex(curr, shift, comp); + } + glEnd(); + } +} + +void Curve::IsolinesC(unsigned comp, bool projected) +{ + if (isolines() <= 0 || actualData_p->empty()) + return; + + Triple tmax = actualData_p->hull().maxVertex; + Triple tmin = actualData_p->hull().minVertex; + + double delta = tmax(comp) - tmin(comp); + double shift = tmin(comp); + double step = delta / isolines(); + + RGBA col; + + TripleField nodes; + TripleField intersection; + + double lambda = 0; + + GLStateBewarer sb2(GL_LINE_SMOOTH, false); + + for (unsigned int k = 0; k != isolines(); ++k) { + double val = shift + k * step; + + for (unsigned int i = 0; i != actualDataC_->cells.size(); ++i) { + nodes.clear(); + unsigned int cellnodes = actualDataC_->cells[i].size(); + for (unsigned int j = 0; j != cellnodes; ++j) { + nodes.push_back(actualDataC_->nodes[actualDataC_->cells[i][j]]); + } + + double diff = 0; + for (unsigned int m = 0; m != cellnodes; ++m) { + unsigned int mm = (m+1) % cellnodes; + + bool outer = (val >= nodes[mm](comp) && val <= nodes[m](comp)); + bool inner = (val >= nodes[m](comp) && val <= nodes[mm](comp)); + + if (inner || outer) { + diff = nodes[mm](comp) - nodes[m](comp); + + if (isPracticallyZero(diff)) { // degenerated + intersection.push_back(nodes[m]); + intersection.push_back(nodes[mm]); + continue; + } + + Triple intersect; + double component[3]; + + lambda = (val - nodes[m](comp)) / diff; + + for (unsigned int c = 0; c!=3; ++c) { + component[c] = (nodes[m](c) + lambda * (nodes[mm](c)-nodes[m](c))); + } + + switch (comp) { + case 0: + intersect = Triple(val, component[1], component[2]); + break; + case 1: + intersect = Triple(component[0], val, component[2]); + break; + case 2: + intersect = Triple(component[0], component[1], val); + break; + } + + intersection.push_back(intersect); + } + } + col = (*datacolor_p)(nodes[0].x,nodes[0].y,nodes[0].z); + glColor4d(col.r, col.g, col.b, col.a); + + drawIntersections(intersection, shift, comp, projected); + } + } +} + +void Curve::createNormalsC() +{ + if (!normals() || actualData_p->empty()) + return; + + if (actualDataC_->nodes.size() != actualDataC_->normals.size()) + return; + Arrow arrow; + arrow.setQuality(normalQuality()); + + Triple basev, topv, norm; + + double diag = (actualData_p->hull().maxVertex-actualData_p->hull().minVertex).length() * normalLength(); + + arrow.assign(*this); + arrow.drawBegin(); + for (unsigned i = 0; i != actualDataC_->normals.size(); ++i) + { + basev = actualDataC_->nodes[i]; + topv = basev + actualDataC_->normals[i]; + + norm = topv-basev; + norm.normalize(); + norm *= diag; + + arrow.setTop(basev+norm); + arrow.setColor((*datacolor_p)(basev.x,basev.y,basev.z)); + arrow.draw(basev); + } + arrow.drawEnd(); +} + +/*! + Convert user (non-rectangular) mesh based data to internal structure. + See also Qwt3D::TripleField and Qwt3D::CellField +*/ +bool Curve::loadFromData(TripleField const& data, CellField const& poly, QString titlestr) +{ + actualDataG_->clear(); + actualData_p = actualDataC_; + + actualDataC_->datatype = Qwt3D::POLYGON; + actualDataC_->nodes = data; + actualDataC_->cells = poly; + actualDataC_->normals = TripleField(actualDataC_->nodes.size()); + + if (!titlestr.isEmpty()) setTitle(titlestr); + + unsigned i; + +// normals for the moment + Triple n, u, v; + for ( i = 0; i < poly.size(); ++i) + { + if (poly[i].size() < 3) + n = Triple(0,0,0); + else + { + for (unsigned j = 0; j < poly[i].size(); ++j) + { + unsigned jj = (j+1) % poly[i].size(); + unsigned pjj = (j) ? j-1 : poly[i].size()-1; + u = actualDataC_->nodes[poly[i][jj]]-actualDataC_->nodes[poly[i][j]]; + v = actualDataC_->nodes[poly[i][pjj]]-actualDataC_->nodes[poly[i][j]]; + n = normalizedcross(u,v); + actualDataC_->normals[poly[i][j]] += n; + } + } + } + for ( i = 0; i != actualDataC_->normals.size(); ++i) + { + actualDataC_->normals[i].normalize(); + } + + ParallelEpiped hull(Triple(DBL_MAX,DBL_MAX,DBL_MAX),Triple(-DBL_MAX,-DBL_MAX,-DBL_MAX)); + + for (i = 0; i!=data.size(); ++i) + { + if (data[i].x < hull.minVertex.x) + hull.minVertex.x = data[i].x; + if (data[i].y < hull.minVertex.y) + hull.minVertex.y = data[i].y; + if (data[i].z < hull.minVertex.z) + hull.minVertex.z = data[i].z; + + if (data[i].x > hull.maxVertex.x) + hull.maxVertex.x = data[i].x; + if (data[i].y > hull.maxVertex.y) + hull.maxVertex.y = data[i].y; + if (data[i].z > hull.maxVertex.z) + hull.maxVertex.z = data[i].z; + } + + actualDataC_->setHull(hull); + emit readInFinished(title()->string()); + + updateData(); + return true; +} + +TripleField* Curve::getNodeData(int *nodes) +{ + if (!actualDataC_) return 0; + + *nodes = actualDataC_->nodes.size(); + + /* allocate some space for the nodes */ + TripleField* nodeData = new TripleField(); + + *nodeData = actualDataC_->nodes; + + return nodeData; +} + +CellField* Curve::getCellData(int *cells) +{ + if (!actualDataC_) return 0; + + *cells = actualDataC_->cells.size(); + + /* allocate some space for the cells */ + CellField* cellData = new CellField(); + + *cellData = actualDataC_->cells; + + return cellData; +} + +void Curve::deleteData(TripleField* data) +{ + data->clear(); + delete data; +} + +void Curve::deleteData(CellField* poly) +{ + poly->clear(); + delete poly; +} + +void Curve::animateData(TripleField* data) +{ + if (!actualDataC_) return; + + actualDataC_->nodes = *data; +} + +void Curve::animateData(TripleField* data, CellField* poly) +{ + if (!actualDataC_) return; + + actualDataC_->nodes = *data; + actualDataC_->cells = *poly; +} === removed file '3rdparty/qwtplot3d/src/qwt3d_meshplot.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_meshplot.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_meshplot.cpp 1970-01-01 00:00:00 +0000 @@ -1,318 +0,0 @@ -#if defined(_MSC_VER) /* MSVC Compiler */ -#pragma warning ( disable : 4305 ) -#pragma warning ( disable : 4786 ) -#endif - -#include "qwt3d_surfaceplot.h" -#include "qwt3d_enrichment_std.h" - -using namespace std; -using namespace Qwt3D; - - -///////////////////////////////////////////////////////////////////////////////// -// -// cell specific -// - - -void SurfacePlot::createDataC() -{ - createFloorDataC(); - - if (plotStyle() == NOPLOT) - return; - - if (plotStyle() == Qwt3D::POINTS) - { - createPoints(); - return; - } - else if (plotStyle() == Qwt3D::USER) - { - if (userplotstyle_p) - createEnrichment(*userplotstyle_p); - return; - } - - setDeviceLineWidth(meshLineWidth()); - GLStateBewarer sb(GL_POLYGON_OFFSET_FILL,true); - setDevicePolygonOffset(polygonOffset(),1.0); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - int idx = 0; - if (plotStyle() != WIREFRAME) - { - glPolygonMode(GL_FRONT_AND_BACK, GL_QUADS); - - bool hl = (plotStyle() == HIDDENLINE); - if (hl) - { - RGBA col = backgroundRGBAColor(); - glColor4d(col.r, col.g, col.b, col.a); - } - - for (unsigned i=0; i!=actualDataC_->cells.size(); ++i) - { - glBegin(GL_POLYGON); - for (unsigned j=0; j!=actualDataC_->cells[i].size(); ++j) - { - idx = actualDataC_->cells[i][j]; - setColorFromVertexC(idx, hl); - glVertex3d( actualDataC_->nodes[idx].x, actualDataC_->nodes[idx].y, actualDataC_->nodes[idx].z ); - glNormal3d( actualDataC_->normals[idx].x, actualDataC_->normals[idx].y, actualDataC_->normals[idx].z ); - } - glEnd(); - } - } - - if (plotStyle() == FILLEDMESH || plotStyle() == WIREFRAME || plotStyle() == HIDDENLINE) - { - glColor4d(meshColor().r, meshColor().g, meshColor().b, meshColor().a); - { - for (unsigned i=0; i!=actualDataC_->cells.size(); ++i) - { - glBegin(GL_LINE_LOOP); - for (unsigned j=0; j!=actualDataC_->cells[i].size(); ++j) - { - idx = actualDataC_->cells[i][j]; - glVertex3d( actualDataC_->nodes[idx].x, actualDataC_->nodes[idx].y, actualDataC_->nodes[idx].z ); - } - glEnd(); - } - } - } -} - -// ci = cell index -// cv = vertex index in cell ci -void SurfacePlot::setColorFromVertexC(int node, bool skip) -{ - if (skip) - return; - - RGBA col = (*datacolor_p)( - actualDataC_->nodes[node].x, actualDataC_->nodes[node].y, actualDataC_->nodes[node].z); - - glColor4d(col.r, col.g, col.b, col.a); -} - -void SurfacePlot::createFloorDataC() -{ - switch (floorStyle()) - { - case FLOORDATA: - Data2FloorC(); - break; - case FLOORISO: - Isolines2FloorC(); - break; - default: - break; - } -} - -void SurfacePlot::Data2FloorC() -{ - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - - double zshift = actualDataC_->hull().minVertex.z; - int idx; - - for (unsigned i = 0; i!=actualDataC_->cells.size(); ++i) - { - glBegin(GL_POLYGON); - for (unsigned j=0; j!=actualDataC_->cells[i].size(); ++j) - { - idx = actualDataC_->cells[i][j]; - setColorFromVertexC(idx); - glVertex3d( actualDataC_->nodes[idx].x, actualDataC_->nodes[idx].y, zshift ); - } - glEnd(); - } -} - -void SurfacePlot::Isolines2FloorC() -{ - if (isolines() <= 0 || actualData_p->empty()) - return; - - double step = (actualData_p->hull().maxVertex.z - actualData_p->hull().minVertex.z) / isolines(); - - RGBA col; - - double zshift = actualData_p->hull().minVertex.z; - - TripleField nodes; - TripleField intersection; - - double lambda = 0; - - GLStateBewarer sb2(GL_LINE_SMOOTH, false); - - for (int k = 0; k != isolines(); ++k) - { - double val = zshift + k * step; - - for (unsigned i=0; i!=actualDataC_->cells.size(); ++i) - { - nodes.clear(); - unsigned cellnodes = actualDataC_->cells[i].size(); - for (unsigned j=0; j!=cellnodes; ++j) - { - nodes.push_back(actualDataC_->nodes[actualDataC_->cells[i][j]]); - } - - double diff = 0; - for (unsigned m = 0; m!=cellnodes; ++m) - { - unsigned mm = (m+1)%cellnodes; - if ((val>=nodes[m].z && val<=nodes[mm].z) || (val>=nodes[mm].z && val<=nodes[m].z)) - { - diff = nodes[mm].z - nodes[m].z; - - if (isPracticallyZero(diff)) // degenerated - { - intersection.push_back(nodes[m]); - intersection.push_back(nodes[mm]); - continue; - } - - lambda = (val - nodes[m].z) / diff; - intersection.push_back(Triple(nodes[m].x + lambda * (nodes[mm].x-nodes[m].x), nodes[m].y + lambda * (nodes[mm].y-nodes[m].y), val)); - } - } - - if (!intersection.empty()) - { - col = (*datacolor_p)(nodes[0].x,nodes[0].y,nodes[0].z); - glColor4d(col.r, col.g, col.b, col.a); - if (intersection.size()>2) - { - glBegin(GL_LINE_STRIP); - for (unsigned dd = 0; dd!=intersection.size(); ++dd) - { - glVertex3d(intersection[dd].x, intersection[dd].y, zshift); - } - glEnd(); - glBegin(GL_POINTS); - glVertex3d(intersection[0].x,intersection[0].y,zshift); - glEnd(); - } - else if (intersection.size() == 2) - { - glBegin(GL_LINES); - glVertex3d(intersection[0].x,intersection[0].y,zshift); - glVertex3d(intersection[1].x,intersection[1].y,zshift); - - // small pixel gap problem (see OpenGL spec.) - glVertex3d(intersection[1].x,intersection[1].y,zshift); - glVertex3d(intersection[0].x,intersection[0].y,zshift); - glEnd(); - } - - intersection.clear(); - } - } - } -} - -void SurfacePlot::createNormalsC() -{ - if (!normals() || actualData_p->empty()) - return; - - if (actualDataC_->nodes.size() != actualDataC_->normals.size()) - return; - Arrow arrow; - arrow.setQuality(normalQuality()); - - Triple basev, topv, norm; - - double diag = (actualData_p->hull().maxVertex-actualData_p->hull().minVertex).length() * normalLength(); - - RGBA col; - arrow.assign(*this); - arrow.drawBegin(); - for (unsigned i = 0; i != actualDataC_->normals.size(); ++i) - { - basev = actualDataC_->nodes[i]; - topv = basev + actualDataC_->normals[i]; - - norm = topv-basev; - norm.normalize(); - norm *= diag; - - arrow.setTop(basev+norm); - arrow.setColor((*datacolor_p)(basev.x,basev.y,basev.z)); - arrow.draw(basev); - } - arrow.drawEnd(); -} - -/*! - Convert user (non-rectangular) mesh based data to internal structure. - See also Qwt3D::TripleField and Qwt3D::CellField -*/ -bool SurfacePlot::loadFromData(TripleField const& data, CellField const& poly) -{ - actualDataG_->clear(); - actualData_p = actualDataC_; - - actualDataC_->nodes = data; - actualDataC_->cells = poly; - actualDataC_->normals = TripleField(actualDataC_->nodes.size()); - - unsigned i; - -// normals for the moment - Triple n, u, v; - for ( i = 0; i < poly.size(); ++i) - { - if (poly[i].size() < 3) - n = Triple(0,0,0); - else - { - for (unsigned j = 0; j < poly[i].size(); ++j) - { - unsigned jj = (j+1) % poly[i].size(); - unsigned pjj = (j) ? j-1 : poly[i].size()-1; - u = actualDataC_->nodes[poly[i][jj]]-actualDataC_->nodes[poly[i][j]]; - v = actualDataC_->nodes[poly[i][pjj]]-actualDataC_->nodes[poly[i][j]]; - n = normalizedcross(u,v); - actualDataC_->normals[poly[i][j]] += n; - } - } - } - for ( i = 0; i != actualDataC_->normals.size(); ++i) - { - actualDataC_->normals[i].normalize(); - } - - ParallelEpiped hull(Triple(DBL_MAX,DBL_MAX,DBL_MAX),Triple(-DBL_MAX,-DBL_MAX,-DBL_MAX)); - - for (i = 0; i!=data.size(); ++i) - { - if (data[i].x < hull.minVertex.x) - hull.minVertex.x = data[i].x; - if (data[i].y < hull.minVertex.y) - hull.minVertex.y = data[i].y; - if (data[i].z < hull.minVertex.z) - hull.minVertex.z = data[i].z; - - if (data[i].x > hull.maxVertex.x) - hull.maxVertex.x = data[i].x; - if (data[i].y > hull.maxVertex.y) - hull.maxVertex.y = data[i].y; - if (data[i].z > hull.maxVertex.z) - hull.maxVertex.z = data[i].z; - } - - actualDataC_->setHull(hull); - - updateData(); - updateNormals(); - createCoordinateSystem(); - - return true; -} === added file '3rdparty/qwtplot3d/src/qwt3d_mousekeyboard.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_mousekeyboard.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_mousekeyboard.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,376 @@ +#if defined(_MSC_VER) /* MSVC Compiler */ +#pragma warning ( disable : 4305 ) +#pragma warning ( disable : 4786 ) +#endif + +#include "qwt3d_extglwidget.h" + +using namespace std; +using namespace Qwt3D; + + +/** + Standard mouse button Function. Prepares the call to mouseMoveEvent + \see mouseMoveEvent() +*/ +void ExtGLWidget::mousePressEvent( QMouseEvent *e ) +{ + lastMouseMovePosition_ = e->pos(); + mpressed_ = true; +} + +/** + Standard mouse button Function. Completes the call to mouseMoveEvent + \see mouseMoveEvent() +*/ +void ExtGLWidget::mouseReleaseEvent( QMouseEvent* ) +{ + mpressed_ = false; +} + +/** + Standard mouse button Function + \see assignMouse() +*/ +void ExtGLWidget::mouseMoveEvent( QMouseEvent *e ) +{ + if (!mpressed_ || !mouseEnabled()) { + e->ignore(); + return; + } + +#if QT_VERSION < 0x040000 + MouseState bstate = e->state(); +#else + MouseState bstate(e->buttons(),e->modifiers()); +#endif + + QPoint diff = e->pos() - lastMouseMovePosition_; + + setRotationMouse(bstate, 3, diff); + setScaleMouse(bstate, 5, diff); + setShiftMouse(bstate, 2, diff); + + lastMouseMovePosition_ = e->pos(); +} + +void ExtGLWidget::setRotationMouse(MouseState bstate, double accel, QPoint diff) +{ + // Rotation + double w = max(1,width()); + double h = max(1,height()); + + double relx = accel*360 * diff.x() / w; + double relyz = accel*360 * diff.y() / h; + + double new_xrot = xRotation(); + double new_yrot = yRotation(); + double new_zrot = zRotation(); + + if ( bstate == xrot_mstate_ ) + new_xrot = round(xRotation() + relyz) % 360; + if ( bstate == yrot_mstate_ ) + new_yrot = round(yRotation() + relx) % 360; + if ( bstate == zrot_mstate_ ) + new_zrot = round(zRotation() + relx) % 360; + + setRotation(new_xrot, new_yrot, new_zrot); +} + +void ExtGLWidget::setScaleMouse(MouseState bstate, double accel, QPoint diff) +{ + // Scale + double w = max(1,width()); + double h = max(1,height()); + + double relx = diff.x() * accel / w; relx = exp(relx) - 1; + double relyz = diff.y() * accel / h; relyz = exp(relyz) - 1; + + double new_xscale = xScale(); + double new_yscale = yScale(); + double new_zscale = zScale(); + + if ( bstate == xscale_mstate_) + new_xscale = max(0.0,xScale() + relx); + if ( bstate == yscale_mstate_) + new_yscale = max(0.0,yScale() - relyz); + if ( bstate == zscale_mstate_) + new_zscale = max(0.0,zScale() - relyz); + + setScale(new_xscale, new_yscale, new_zscale); + + if ( bstate == zoom_mstate_) + setZoom(max(0.0,zoom() - relyz)); +} + +void ExtGLWidget::setShiftMouse(MouseState bstate, double accel, QPoint diff) +{ + // Shift + double w = max(1,width()); + double h = max(1,height()); + + double relx = diff.x() * accel / w; + double relyz = diff.y() * accel / h; + + double new_xshift = xViewportShift(); + double new_yshift = yViewportShift(); + + if ( bstate == xshift_mstate_) + new_xshift = xViewportShift() + relx; + if ( bstate == yshift_mstate_) + new_yshift = yViewportShift() - relyz; + + setViewportShift(new_xshift, new_yshift); +} + +/** + Standard wheel Function - zoom (wheel only) or z-scale (shift+wheel) +*/ +void ExtGLWidget::wheelEvent( QWheelEvent *e ) +{ + if (!mouseEnabled()) return; + + double accel = 0.05; + double step = accel * e->delta() / WHEEL_DELTA ; + step = exp(step)-1; + +#if QT_VERSION < 0x040000 + if ( e->state() & Qt::ShiftButton ) +#else + if ( e->modifiers() & Qt::ShiftModifier ) +#endif + setScale(xScale(),yScale(), max(0.0,zScale() + step)); + else + setZoom(max(0.0,zoom() + step )); +} + +/** + Sets the key/mousebutton combination for data/coordinatesystem moves inside the widget\n\n + default behaviour:\n + + \verbatim + rotate around x axis: Qt::LeftButton + rotate around y axis: Qt::LeftButton | Qt::ShiftButton + rotate around z axis: Qt::LeftButton + scale x: Qt::LeftButton | Qt::AltButton + scale y: Qt::LeftButton | Qt::AltButton + scale z: Qt::LeftButton | Qt::AltButton | Qt::ShiftButton + zoom: Qt::LeftButton | Qt::AltButton | Qt::ControlButton + shifting along x: Qt::LeftButton | Qt::ControlButton + shifting along y: Qt::LeftButton | Qt::ControlButton + \endverbatim + + mouseMoveEvent() evaluates this function - if overridden, their usefulness becomes somehow limited +*/ +void ExtGLWidget::assignMouse(MouseState xrot, MouseState yrot, MouseState zrot, + MouseState xscale, MouseState yscale, MouseState zscale, + MouseState zoom, MouseState xshift, MouseState yshift) +{ + xrot_mstate_ = xrot; + yrot_mstate_ = yrot; + zrot_mstate_ = zrot; + xscale_mstate_ = xscale; + yscale_mstate_ = yscale; + zscale_mstate_ = zscale; + zoom_mstate_ = zoom; + xshift_mstate_ = xshift; + yshift_mstate_ = yshift; +} + +/** +The function has no effect if you derive from ExtGLWidget and overrides the mouse Function too careless. +In this case check first against mouseEnabled() in your version of mouseMoveEvent() and wheelEvent(). +A more fine grained input control can be achieved by combining assignMouse() with enableMouse(). +*/ +void ExtGLWidget::enableMouse(bool val) {mouse_input_enabled_ = val;} + +/** +\see enableMouse() +*/ +void ExtGLWidget::disableMouse(bool val) {mouse_input_enabled_ = !val;} +bool ExtGLWidget::mouseEnabled() const {return mouse_input_enabled_;} + + +void ExtGLWidget::keyPressEvent( QKeyEvent *e ) +{ + if (!keyboardEnabled()) { + e->ignore(); + return; + } + +#if QT_VERSION < 0x040000 + int bstate = e->state() & Qt::KeyButtonMask; // filter kbd modifier only + KeyboardState keyseq = bstate + e->key(); +#else + KeyboardState keyseq(e->key(), e->modifiers()); +#endif + + setRotationKeyboard(keyseq, kbd_rot_speed_); + setScaleKeyboard(keyseq, kbd_scale_speed_); + setShiftKeyboard(keyseq, kbd_shift_speed_); +} + +void ExtGLWidget::setRotationKeyboard(KeyboardState kseq, double speed) +{ + // Rotation + double w = max(1,width()); + double h = max(1,height()); + + double relx = speed*360 / w; + double relyz = speed*360 / h; + + double new_xrot = xRotation(); + double new_yrot = yRotation(); + double new_zrot = zRotation(); + + if ( kseq == xrot_kstate_[0] ) + new_xrot = round(xRotation() + relyz) % 360; + if ( kseq == xrot_kstate_[1] ) + new_xrot = round(xRotation() - relyz) % 360; + if ( kseq == yrot_kstate_[0] ) + new_yrot = round(yRotation() + relx) % 360; + if ( kseq == yrot_kstate_[1] ) + new_yrot = round(yRotation() - relx) % 360; + if ( kseq == zrot_kstate_[0] ) + new_zrot = round(zRotation() + relx) % 360; + if ( kseq == zrot_kstate_[1] ) + new_zrot = round(zRotation() - relx) % 360; + + setRotation(new_xrot, new_yrot, new_zrot); +} + +void ExtGLWidget::setScaleKeyboard(KeyboardState kseq, double speed) +{ + // Scale + double w = max(1,width()); + double h = max(1,height()); + + double relx = speed / w; relx = exp(relx) - 1; + double relyz = speed / h; relyz = exp(relyz) - 1; + + double new_xscale = xScale(); + double new_yscale = yScale(); + double new_zscale = zScale(); + + if ( kseq == xscale_kstate_[0]) + new_xscale = max(0.0,xScale() + relx); + if ( kseq == xscale_kstate_[1]) + new_xscale = max(0.0,xScale() - relx); + if ( kseq == yscale_kstate_[0]) + new_yscale = max(0.0,yScale() - relyz); + if ( kseq == yscale_kstate_[1]) + new_yscale = max(0.0,yScale() + relyz); + if ( kseq == zscale_kstate_[0]) + new_zscale = max(0.0,zScale() - relyz); + if ( kseq == zscale_kstate_[1]) + new_zscale = max(0.0,zScale() + relyz); + + setScale(new_xscale, new_yscale, new_zscale); + + if ( kseq == zoom_kstate_[0]) + setZoom(max(0.0,zoom() - relyz)); + if ( kseq == zoom_kstate_[1]) + setZoom(max(0.0,zoom() + relyz)); +} + +void ExtGLWidget::setShiftKeyboard(KeyboardState kseq, double speed) +{ + // Shift + double w = max(1,width()); + double h = max(1,height()); + + double relx = speed / w; + double relyz = speed / h; + + double new_xshift = xViewportShift(); + double new_yshift = yViewportShift(); + + if ( kseq == xshift_kstate_[0]) + new_xshift = xViewportShift() + relx; + if ( kseq == xshift_kstate_[1]) + new_xshift = xViewportShift() - relx; + if ( kseq == yshift_kstate_[0]) + new_yshift = yViewportShift() - relyz; + if ( kseq == yshift_kstate_[1]) + new_yshift = yViewportShift() + relyz; + + setViewportShift(new_xshift, new_yshift); +} + +/** + Sets the keybutton combination for data/coordinatesystem moves inside the widget\n\n + default behaviour:\n + + \verbatim + rotate around x axis: [Key_Down, Key_Up] + rotate around y axis: SHIFT+[Key_Right, Key_Left] + rotate around z axis: [Key_Right, Key_Left] + scale x: ALT+[Key_Right, Key_Left] + scale y: ALT+[Key_Up, Key_Down] + scale z: ALT+SHIFT[Key_Down, Key_Up] + zoom: ALT+CTRL+[Key_Down, Key_Up] + shifting along x: CTRL+[Key_Right, Key_Left] + shifting along z: CTRL+[Key_Down, Key_Up] + \endverbatim +*/ +void ExtGLWidget::assignKeyboard(KeyboardState xrot_n, KeyboardState xrot_p + ,KeyboardState yrot_n, KeyboardState yrot_p + ,KeyboardState zrot_n, KeyboardState zrot_p + ,KeyboardState xscale_n, KeyboardState xscale_p + ,KeyboardState yscale_n, KeyboardState yscale_p + ,KeyboardState zscale_n, KeyboardState zscale_p + ,KeyboardState zoom_n, KeyboardState zoom_p + ,KeyboardState xshift_n, KeyboardState xshift_p + ,KeyboardState yshift_n, KeyboardState yshift_p) +{ + xrot_kstate_[0] = xrot_n; + yrot_kstate_[0] = yrot_n; + zrot_kstate_[0] = zrot_n; + xrot_kstate_[1] = xrot_p; + yrot_kstate_[1] = yrot_p; + zrot_kstate_[1] = zrot_p; + + xscale_kstate_[0] = xscale_n; + yscale_kstate_[0] = yscale_n; + zscale_kstate_[0] = zscale_n; + xscale_kstate_[1] = xscale_p; + yscale_kstate_[1] = yscale_p; + zscale_kstate_[1] = zscale_p; + + zoom_kstate_[0] = zoom_n; + xshift_kstate_[0] = xshift_n; + yshift_kstate_[0] = yshift_n; + zoom_kstate_[1] = zoom_p; + xshift_kstate_[1] = xshift_p; + yshift_kstate_[1] = yshift_p; +} + +/** +The function has no effect if you derive from ExtGLWidget and overrides the keyboard Functions too careless. +In this case check first against keyboardEnabled() in your version of keyPressEvent() +A more fine grained input control can be achieved by combining assignKeyboard() with enableKeyboard(). +*/ +void ExtGLWidget::enableKeyboard(bool val) {kbd_input_enabled_ = val;} + +/** +\see enableKeyboard() +*/ +void ExtGLWidget::disableKeyboard(bool val) {kbd_input_enabled_ = !val;} +bool ExtGLWidget::keyboardEnabled() const {return kbd_input_enabled_;} + +/** +Values < 0 are ignored. Default is (3,5,5) +*/ +void ExtGLWidget::setKeySpeed(double rot, double scale, double shift) +{ + if (rot > 0) kbd_rot_speed_ = rot; + if (scale > 0) kbd_scale_speed_ = scale; + if (shift > 0) kbd_shift_speed_ = shift; +} + +void ExtGLWidget::keySpeed(double& rot, double& scale, double& shift) const +{ + rot = kbd_rot_speed_; + scale = kbd_scale_speed_; + shift = kbd_shift_speed_; +} === removed file '3rdparty/qwtplot3d/src/qwt3d_mousekeyboard.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_mousekeyboard.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_mousekeyboard.cpp 1970-01-01 00:00:00 +0000 @@ -1,387 +0,0 @@ -#if defined(_MSC_VER) /* MSVC Compiler */ -#pragma warning ( disable : 4305 ) -#pragma warning ( disable : 4786 ) -#endif - -#include "qwt3d_plot.h" - -using namespace std; -using namespace Qwt3D; - - -/** - Standard mouse button Function. Prepares the call to mouseMoveEvent - \see mouseMoveEvent() -*/ -void Plot3D::mousePressEvent( QMouseEvent *e ) -{ - lastMouseMovePosition_ = e->pos(); - mpressed_ = true; -} - -/** - Standard mouse button Function. Completes the call to mouseMoveEvent - \see mouseMoveEvent() -*/ -void Plot3D::mouseReleaseEvent( QMouseEvent* ) -{ - mpressed_ = false; -} - -/** - Standard mouse button Function - \see assignMouse() -*/ -void Plot3D::mouseMoveEvent( QMouseEvent *e ) -{ - if (!mpressed_ || !mouseEnabled()) - { - e->ignore(); - return; - } - -#if QT_VERSION < 0x040000 - MouseState bstate = e->state(); -#else - MouseState bstate(e->buttons(),e->modifiers()); -#endif - - QPoint diff = e->pos() - lastMouseMovePosition_; - - setRotationMouse(bstate, 3, diff); - setScaleMouse(bstate, 5, diff); - setShiftMouse(bstate, 2, diff); - - lastMouseMovePosition_ = e->pos(); -} - -void Plot3D::setRotationMouse(MouseState bstate, double accel, QPoint diff) -{ - // Rotation - double w = max(1,width()); - double h = max(1,height()); - - double relx = accel*360 * diff.x() / w; - double relyz = accel*360 * diff.y() / h; - - double new_xrot = xRotation(); - double new_yrot = yRotation(); - double new_zrot = zRotation(); - - if ( bstate == xrot_mstate_ ) - new_xrot = round(xRotation() + relyz) % 360; - if ( bstate == yrot_mstate_ ) - new_yrot = round(yRotation() + relx) % 360; - if ( bstate == zrot_mstate_ ) - new_zrot = round(zRotation() + relx) % 360; - - setRotation(new_xrot, new_yrot, new_zrot); -} - -void Plot3D::setScaleMouse(MouseState bstate, double accel, QPoint diff) -{ - // Scale - double w = max(1,width()); - double h = max(1,height()); - - double relx = diff.x() * accel / w; relx = exp(relx) - 1; - double relyz = diff.y() * accel / h; relyz = exp(relyz) - 1; - - double new_xscale = xScale(); - double new_yscale = yScale(); - double new_zscale = zScale(); - - if ( bstate == xscale_mstate_) - new_xscale = max(0.0,xScale() + relx); - if ( bstate == yscale_mstate_) - new_yscale = max(0.0,yScale() - relyz); - if ( bstate == zscale_mstate_) - new_zscale = max(0.0,zScale() - relyz); - - setScale(new_xscale, new_yscale, new_zscale); - - if ( bstate == zoom_mstate_) - setZoom(max(0.0,zoom() - relyz)); -} - -void Plot3D::setShiftMouse(MouseState bstate, double accel, QPoint diff) -{ - // Shift - double w = max(1,width()); - double h = max(1,height()); - - double relx = diff.x() * accel / w; - double relyz = diff.y() * accel / h; - - double new_xshift = xViewportShift(); - double new_yshift = yViewportShift(); - - if ( bstate == xshift_mstate_) - new_xshift = xViewportShift() + relx; - if ( bstate == yshift_mstate_) - new_yshift = yViewportShift() - relyz; - - setViewportShift(new_xshift, new_yshift); -} - -/** - Standard wheel Function - zoom (wheel only) or z-scale (shift+wheel) -*/ -void Plot3D::wheelEvent( QWheelEvent *e ) -{ - if (!mouseEnabled()) - return; - - double accel = 0.05; - - double step = accel * e->delta() / WHEEL_DELTA ; - step = exp(step)-1; - -#if QT_VERSION < 0x040000 - if ( e->state() & Qt::ShiftButton ) -#else - if ( e->modifiers() & Qt::ShiftModifier ) -#endif - setScale(xScale(),yScale(), max(0.0,zScale() + step)); - else - setZoom(max(0.0,zoom() + step )); -} - -/** - Sets the key/mousebutton combination for data/coordinatesystem moves inside the widget\n\n - default behaviour:\n - - \verbatim - rotate around x axis: Qt::LeftButton - rotate around y axis: Qt::LeftButton | Qt::ShiftButton - rotate around z axis: Qt::LeftButton - scale x: Qt::LeftButton | Qt::AltButton - scale y: Qt::LeftButton | Qt::AltButton - scale z: Qt::LeftButton | Qt::AltButton | Qt::ShiftButton - zoom: Qt::LeftButton | Qt::AltButton | Qt::ControlButton - shifting along x: Qt::LeftButton | Qt::ControlButton - shifting along y: Qt::LeftButton | Qt::ControlButton - \endverbatim - - mouseMoveEvent() evaluates this function - if overridden, their usefulness becomes somehow limited -*/ -void Plot3D::assignMouse(MouseState xrot, MouseState yrot, MouseState zrot, - MouseState xscale, MouseState yscale, MouseState zscale, - MouseState zoom, MouseState xshift, MouseState yshift) -{ - xrot_mstate_ = xrot; - yrot_mstate_ = yrot; - zrot_mstate_ = zrot; - xscale_mstate_ = xscale; - yscale_mstate_ = yscale; - zscale_mstate_ = zscale; - zoom_mstate_ = zoom; - xshift_mstate_ = xshift; - yshift_mstate_ = yshift; -} - -/** -The function has no effect if you derive from Plot3D and overrides the mouse Function too careless. -In this case check first against mouseEnabled() in your version of mouseMoveEvent() and wheelEvent(). -A more fine grained input control can be achieved by combining assignMouse() with enableMouse(). -*/ -void Plot3D::enableMouse(bool val) {mouse_input_enabled_ = val;} - -/** -\see enableMouse() -*/ -void Plot3D::disableMouse(bool val) {mouse_input_enabled_ = !val;} -bool Plot3D::mouseEnabled() const {return mouse_input_enabled_;} - - - - -void Plot3D::keyPressEvent( QKeyEvent *e ) -{ - if (!keyboardEnabled()) - { - e->ignore(); - return; - } - -#if QT_VERSION < 0x040000 - int bstate = e->state() & Qt::KeyButtonMask; // filter kbd modifier only - KeyboardState keyseq = bstate + e->key(); -#else - KeyboardState keyseq(e->key(), e->modifiers()); -#endif - - setRotationKeyboard(keyseq, kbd_rot_speed_); - setScaleKeyboard(keyseq, kbd_scale_speed_); - setShiftKeyboard(keyseq, kbd_shift_speed_); -} - -void Plot3D::setRotationKeyboard(KeyboardState kseq, double speed) -{ - // Rotation - double w = max(1,width()); - double h = max(1,height()); - - double relx = speed*360 / w; - double relyz = speed*360 / h; - - double new_xrot = xRotation(); - double new_yrot = yRotation(); - double new_zrot = zRotation(); - - if ( kseq == xrot_kstate_[0] ) - new_xrot = round(xRotation() + relyz) % 360; - if ( kseq == xrot_kstate_[1] ) - new_xrot = round(xRotation() - relyz) % 360; - if ( kseq == yrot_kstate_[0] ) - new_yrot = round(yRotation() + relx) % 360; - if ( kseq == yrot_kstate_[1] ) - new_yrot = round(yRotation() - relx) % 360; - if ( kseq == zrot_kstate_[0] ) - new_zrot = round(zRotation() + relx) % 360; - if ( kseq == zrot_kstate_[1] ) - new_zrot = round(zRotation() - relx) % 360; - - setRotation(new_xrot, new_yrot, new_zrot); -} - -void Plot3D::setScaleKeyboard(KeyboardState kseq, double speed) -{ - // Scale - double w = max(1,width()); - double h = max(1,height()); - - double relx = speed / w; relx = exp(relx) - 1; - double relyz = speed / h; relyz = exp(relyz) - 1; - - double new_xscale = xScale(); - double new_yscale = yScale(); - double new_zscale = zScale(); - - if ( kseq == xscale_kstate_[0]) - new_xscale = max(0.0,xScale() + relx); - if ( kseq == xscale_kstate_[1]) - new_xscale = max(0.0,xScale() - relx); - if ( kseq == yscale_kstate_[0]) - new_yscale = max(0.0,yScale() - relyz); - if ( kseq == yscale_kstate_[1]) - new_yscale = max(0.0,yScale() + relyz); - if ( kseq == zscale_kstate_[0]) - new_zscale = max(0.0,zScale() - relyz); - if ( kseq == zscale_kstate_[1]) - new_zscale = max(0.0,zScale() + relyz); - - setScale(new_xscale, new_yscale, new_zscale); - - if ( kseq == zoom_kstate_[0]) - setZoom(max(0.0,zoom() - relyz)); - if ( kseq == zoom_kstate_[1]) - setZoom(max(0.0,zoom() + relyz)); -} - -void Plot3D::setShiftKeyboard(KeyboardState kseq, double speed) -{ - // Shift - double w = max(1,width()); - double h = max(1,height()); - - double relx = speed / w; - double relyz = speed / h; - - double new_xshift = xViewportShift(); - double new_yshift = yViewportShift(); - - if ( kseq == xshift_kstate_[0]) - new_xshift = xViewportShift() + relx; - if ( kseq == xshift_kstate_[1]) - new_xshift = xViewportShift() - relx; - if ( kseq == yshift_kstate_[0]) - new_yshift = yViewportShift() - relyz; - if ( kseq == yshift_kstate_[1]) - new_yshift = yViewportShift() + relyz; - - setViewportShift(new_xshift, new_yshift); -} - -/** - Sets the keybutton combination for data/coordinatesystem moves inside the widget\n\n - default behaviour:\n - - \verbatim - rotate around x axis: [Key_Down, Key_Up] - rotate around y axis: SHIFT+[Key_Right, Key_Left] - rotate around z axis: [Key_Right, Key_Left] - scale x: ALT+[Key_Right, Key_Left] - scale y: ALT+[Key_Up, Key_Down] - scale z: ALT+SHIFT[Key_Down, Key_Up] - zoom: ALT+CTRL+[Key_Down, Key_Up] - shifting along x: CTRL+[Key_Right, Key_Left] - shifting along z: CTRL+[Key_Down, Key_Up] - \endverbatim -*/ -void Plot3D::assignKeyboard( - KeyboardState xrot_n, KeyboardState xrot_p - ,KeyboardState yrot_n, KeyboardState yrot_p - ,KeyboardState zrot_n, KeyboardState zrot_p - ,KeyboardState xscale_n, KeyboardState xscale_p - ,KeyboardState yscale_n, KeyboardState yscale_p - ,KeyboardState zscale_n, KeyboardState zscale_p - ,KeyboardState zoom_n, KeyboardState zoom_p - ,KeyboardState xshift_n, KeyboardState xshift_p - ,KeyboardState yshift_n, KeyboardState yshift_p - ) -{ - xrot_kstate_[0] = xrot_n; - yrot_kstate_[0] = yrot_n; - zrot_kstate_[0] = zrot_n; - xrot_kstate_[1] = xrot_p; - yrot_kstate_[1] = yrot_p; - zrot_kstate_[1] = zrot_p; - - xscale_kstate_[0] = xscale_n; - yscale_kstate_[0] = yscale_n; - zscale_kstate_[0] = zscale_n; - xscale_kstate_[1] = xscale_p; - yscale_kstate_[1] = yscale_p; - zscale_kstate_[1] = zscale_p; - - zoom_kstate_[0] = zoom_n; - xshift_kstate_[0] = xshift_n; - yshift_kstate_[0] = yshift_n; - zoom_kstate_[1] = zoom_p; - xshift_kstate_[1] = xshift_p; - yshift_kstate_[1] = yshift_p; -} - -/** -The function has no effect if you derive from Plot3D and overrides the keyboard Functions too careless. -In this case check first against keyboardEnabled() in your version of keyPressEvent() -A more fine grained input control can be achieved by combining assignKeyboard() with enableKeyboard(). -*/ -void Plot3D::enableKeyboard(bool val) {kbd_input_enabled_ = val;} - -/** -\see enableKeyboard() -*/ -void Plot3D::disableKeyboard(bool val) {kbd_input_enabled_ = !val;} -bool Plot3D::keyboardEnabled() const {return kbd_input_enabled_;} - -/** -Values < 0 are ignored. Default is (3,5,5) -*/ -void Plot3D::setKeySpeed(double rot, double scale, double shift) -{ - if (rot > 0) - kbd_rot_speed_ = rot; - if (scale > 0) - kbd_scale_speed_ = scale; - if (shift > 0) - kbd_shift_speed_ = shift; -} - -void Plot3D::keySpeed(double& rot, double& scale, double& shift) const -{ - rot = kbd_rot_speed_; - scale = kbd_scale_speed_; - shift = kbd_shift_speed_; -} === added file '3rdparty/qwtplot3d/src/qwt3d_movements.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_movements.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_movements.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,102 @@ +#if defined(_MSC_VER) /* MSVC Compiler */ +#pragma warning ( disable : 4305 ) +#pragma warning ( disable : 4786 ) +#endif + +#include +#include "qwt3d_extglwidget.h" + +using namespace Qwt3D; + + +/** + Set the rotation angle of the object. If you look along the respective axis towards ascending values, + the rotation is performed in mathematical \e negative sense + \param xVal angle in \e degree to rotate around the X axis + \param yVal angle in \e degree to rotate around the Y axis + \param zVal angle in \e degree to rotate around the Z axis +*/ +void ExtGLWidget::setRotation( double xVal, double yVal, double zVal ) +{ + if (xRot_ == xVal && yRot_ == yVal && zRot_ == zVal) return; + + xRot_ = xVal; + yRot_ = yVal; + zRot_ = zVal; + + updateGL(); + emit rotationChanged(xVal, yVal, zVal); +} + +/** + Set the shift in object (world) coordinates. + \param xVal shift along (world) X axis + \param yVal shift along (world) Y axis + \param zVal shift along (world) Z axis + \see setViewportShift() +*/ +void ExtGLWidget::setShift( double xVal, double yVal, double zVal ) +{ + if (xShift_ == xVal && yShift_ == yVal && zShift_ == zVal) return; + + xShift_ = xVal; + yShift_ = yVal; + zShift_ = zVal; + + updateGL(); + emit shiftChanged(xVal, yVal, zVal); +} + +/** + Performs shifting along screen axes. + The shift moves points inside a sphere, + which encloses the unscaled and unzoomed data + by multiples of the spheres diameter + + \param xVal shift along (view) X axis + \param yVal shift along (view) Y axis + \see setShift() +*/ +void ExtGLWidget::setViewportShift( double xVal, double yVal ) +{ + if (xVPShift_ == xVal && yVPShift_ == yVal) return; + + xVPShift_ = xVal; + yVPShift_ = yVal; + + updateGL(); + emit vieportShiftChanged(xVPShift_, yVPShift_); +} + +/** + Set the scale in object (world) coordinates. + \param xVal scaling for X values + \param yVal scaling for Y values + \param zVal scaling for Z values + + A respective value of 1 represents no scaling; +*/ +void ExtGLWidget::setScale( double xVal, double yVal, double zVal ) +{ + if (xScale_ == xVal && yScale_ == yVal && zScale_ == zVal) return; + + xScale_ = (xVal < DBL_EPSILON ) ? DBL_EPSILON : xVal; + yScale_ = (yVal < DBL_EPSILON ) ? DBL_EPSILON : yVal; + zScale_ = (zVal < DBL_EPSILON ) ? DBL_EPSILON : zVal; + + updateGL(); + emit scaleChanged(xVal, yVal, zVal); +} + +/** + Set the (zoom in addition to scale). + \param val zoom value (value == 1 indicates no zooming) +*/ +void ExtGLWidget::setZoom( double val ) +{ + if (zoom_ == val) return; + + zoom_ = (val < DBL_EPSILON ) ? DBL_EPSILON : val; + updateGL(); + emit zoomChanged(val); +} === removed file '3rdparty/qwtplot3d/src/qwt3d_movements.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_movements.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_movements.cpp 1970-01-01 00:00:00 +0000 @@ -1,106 +0,0 @@ -#if defined(_MSC_VER) /* MSVC Compiler */ -#pragma warning ( disable : 4305 ) -#pragma warning ( disable : 4786 ) -#endif - -#include -#include "qwt3d_plot.h" - -using namespace Qwt3D; - - -/** - Set the rotation angle of the object. If you look along the respective axis towards ascending values, - the rotation is performed in mathematical \e negative sense - \param xVal angle in \e degree to rotate around the X axis - \param yVal angle in \e degree to rotate around the Y axis - \param zVal angle in \e degree to rotate around the Z axis -*/ -void Plot3D::setRotation( double xVal, double yVal, double zVal ) -{ - if (xRot_ == xVal && yRot_ == yVal && zRot_ == zVal) - return; - - xRot_ = xVal; - yRot_ = yVal; - zRot_ = zVal; - - updateGL(); - emit rotationChanged(xVal, yVal, zVal); -} - -/** - Set the shift in object (world) coordinates. - \param xVal shift along (world) X axis - \param yVal shift along (world) Y axis - \param zVal shift along (world) Z axis - \see setViewportShift() -*/ -void Plot3D::setShift( double xVal, double yVal, double zVal ) -{ - if (xShift_ == xVal && yShift_ == yVal && zShift_ == zVal) - return; - - xShift_ = xVal; - yShift_ = yVal; - zShift_ = zVal; - updateGL(); - emit shiftChanged(xVal, yVal, zVal); -} - -/** - Performs shifting along screen axes. - The shift moves points inside a sphere, - which encloses the unscaled and unzoomed data - by multiples of the spheres diameter - - \param xVal shift along (view) X axis - \param yVal shift along (view) Y axis - \see setShift() -*/ -void Plot3D::setViewportShift( double xVal, double yVal ) -{ - if (xVPShift_ == xVal && yVPShift_ == yVal) - return; - - xVPShift_ = xVal; - yVPShift_ = yVal; - - updateGL(); - emit vieportShiftChanged(xVPShift_, yVPShift_); -} - -/** - Set the scale in object (world) coordinates. - \param xVal scaling for X values - \param yVal scaling for Y values - \param zVal scaling for Z values - - A respective value of 1 represents no scaling; -*/ -void Plot3D::setScale( double xVal, double yVal, double zVal ) -{ - if (xScale_ == xVal && yScale_ == yVal && zScale_ == zVal) - return; - - xScale_ = (xVal < DBL_EPSILON ) ? DBL_EPSILON : xVal; - yScale_ = (yVal < DBL_EPSILON ) ? DBL_EPSILON : yVal; - zScale_ = (zVal < DBL_EPSILON ) ? DBL_EPSILON : zVal; - - updateGL(); - emit scaleChanged(xVal, yVal, zVal); -} - -/** - Set the (zoom in addition to scale). - \param val zoom value (value == 1 indicates no zooming) -*/ -void Plot3D::setZoom( double val ) -{ - if (zoom_ == val) - return; - - zoom_ = (val < DBL_EPSILON ) ? DBL_EPSILON : val; - updateGL(); - emit zoomChanged(val); -} === added file '3rdparty/qwtplot3d/src/qwt3d_parametricsurface.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_parametricsurface.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_parametricsurface.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,104 @@ +#include "qwt3d_parametricsurface.h" +#include "qwt3d_curve.h" + +using namespace Qwt3D; + +ParametricSurface::ParametricSurface() +:GridMapping() +{ +} + +ParametricSurface::ParametricSurface(Curve& pw) +:GridMapping() +{ + plotwidget_p = &pw; + uperiodic_ = false; + vperiodic_ = false; +} + +ParametricSurface::ParametricSurface(Curve* pw) +:GridMapping() +{ + plotwidget_p = pw; + uperiodic_ = false; + vperiodic_ = false; +} + +void ParametricSurface::setPeriodic(bool u, bool v) +{ + uperiodic_ = u; + vperiodic_ = v; +} + +void ParametricSurface::assign(Curve& plotWidget) +{ + if (&plotWidget != plotwidget_p) + plotwidget_p = &plotWidget; +} + +void ParametricSurface::assign(Curve* plotWidget) +{ + if (plotWidget != plotwidget_p) + plotwidget_p = plotWidget; +} + +/** +For plotWidget != 0 the function permanently assigns her argument (In fact, assign(plotWidget) is called) +*/ +bool ParametricSurface::create() +{ + if ((umesh_p<=2) || (vmesh_p<=2) || !plotwidget_p) + return false; + + /* allocate some space for the mesh */ + Triple** data = new Triple* [umesh_p] ; + + unsigned i,j; + for ( i = 0; i < umesh_p; i++) + { + data[i] = new Triple [vmesh_p]; + } + + /* get the data */ + + double du = (maxu_p - minu_p) / (umesh_p - 1); + double dv = (maxv_p - minv_p) / (vmesh_p - 1); + + for (i = 0; i < umesh_p; ++i) + { + for (j = 0; j < vmesh_p; ++j) + { + data[i][j] = operator()(minu_p + i*du, minv_p + j*dv); + + if (data[i][j].x > range_p.maxVertex.x) + data[i][j].x = range_p.maxVertex.x; + else if (data[i][j].y > range_p.maxVertex.y) + data[i][j].y = range_p.maxVertex.y; + else if (data[i][j].z > range_p.maxVertex.z) + data[i][j].z = range_p.maxVertex.z; + else if (data[i][j].x < range_p.minVertex.x) + data[i][j].x = range_p.minVertex.x; + else if (data[i][j].y < range_p.minVertex.y) + data[i][j].y = range_p.minVertex.y; + else if (data[i][j].z < range_p.minVertex.z) + data[i][j].z = range_p.minVertex.z; + } + } + + plotwidget_p->loadFromData(data, umesh_p, vmesh_p, "", uperiodic_, vperiodic_); + + for ( i = 0; i < umesh_p; i++) + { + delete [] data[i]; + } + + delete [] data; + + return true; +} + +bool ParametricSurface::create(Curve& pl) +{ + assign(pl); + return create(); +} === removed file '3rdparty/qwtplot3d/src/qwt3d_parametricsurface.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_parametricsurface.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_parametricsurface.cpp 1970-01-01 00:00:00 +0000 @@ -1,104 +0,0 @@ -#include "qwt3d_parametricsurface.h" -#include "qwt3d_surfaceplot.h" - -using namespace Qwt3D; - -ParametricSurface::ParametricSurface() -:GridMapping() -{ -} - -ParametricSurface::ParametricSurface(SurfacePlot& pw) -:GridMapping() -{ - plotwidget_p = &pw; - uperiodic_ = false; - vperiodic_ = false; -} - -ParametricSurface::ParametricSurface(SurfacePlot* pw) -:GridMapping() -{ - plotwidget_p = pw; - uperiodic_ = false; - vperiodic_ = false; -} - -void ParametricSurface::setPeriodic(bool u, bool v) -{ - uperiodic_ = u; - vperiodic_ = v; -} - -void ParametricSurface::assign(SurfacePlot& plotWidget) -{ - if (&plotWidget != plotwidget_p) - plotwidget_p = &plotWidget; -} - -void ParametricSurface::assign(SurfacePlot* plotWidget) -{ - if (plotWidget != plotwidget_p) - plotwidget_p = plotWidget; -} - -/** -For plotWidget != 0 the function permanently assigns her argument (In fact, assign(plotWidget) is called) -*/ -bool ParametricSurface::create() -{ - if ((umesh_p<=2) || (vmesh_p<=2) || !plotwidget_p) - return false; - - /* allocate some space for the mesh */ - Triple** data = new Triple* [umesh_p] ; - - unsigned i,j; - for ( i = 0; i < umesh_p; i++) - { - data[i] = new Triple [vmesh_p]; - } - - /* get the data */ - - double du = (maxu_p - minu_p) / (umesh_p - 1); - double dv = (maxv_p - minv_p) / (vmesh_p - 1); - - for (i = 0; i < umesh_p; ++i) - { - for (j = 0; j < vmesh_p; ++j) - { - data[i][j] = operator()(minu_p + i*du, minv_p + j*dv); - - if (data[i][j].x > range_p.maxVertex.x) - data[i][j].x = range_p.maxVertex.x; - else if (data[i][j].y > range_p.maxVertex.y) - data[i][j].y = range_p.maxVertex.y; - else if (data[i][j].z > range_p.maxVertex.z) - data[i][j].z = range_p.maxVertex.z; - else if (data[i][j].x < range_p.minVertex.x) - data[i][j].x = range_p.minVertex.x; - else if (data[i][j].y < range_p.minVertex.y) - data[i][j].y = range_p.minVertex.y; - else if (data[i][j].z < range_p.minVertex.z) - data[i][j].z = range_p.minVertex.z; - } - } - - ((SurfacePlot*)plotwidget_p)->loadFromData(data, umesh_p, vmesh_p, uperiodic_, vperiodic_); - - for ( i = 0; i < umesh_p; i++) - { - delete [] data[i]; - } - - delete [] data; - - return true; -} - -bool ParametricSurface::create(SurfacePlot& pl) -{ - assign(pl); - return create(); -} === added file '3rdparty/qwtplot3d/src/qwt3d_plot.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_plot.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_plot.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,413 @@ +#if defined(_MSC_VER) /* MSVC Compiler */ +#pragma warning ( disable : 4305 ) +#pragma warning ( disable : 4786 ) +#endif + +#include + +#include "qwt3d_plot.h" +#include "qwt3d_enrichment.h" +#include "qwt3d_curve.h" + +using namespace Qwt3D; + +#ifdef QT_NO_DEBUG_STREAM + #define DEBUG QNoDebug() +#else + #define DEBUG qDebug() +#endif + +//! Non-member '<<' debug stream operator method used for 'Triple' types +static QDebug operator<<(QDebug dbg, const Triple& t) +{ + dbg.nospace() << "Triple(" << t.x << ',' << t.y << ',' << t.z << ')'; + + return dbg.space(); +} + +/*! + This should be the first call in your derived classes constructor. +*/ +#if QT_VERSION < 0x040000 +Plot3D::Plot3D(QWidget* parent, const char* name) + : QGLWidget(parent, name) +#else +Plot3D::Plot3D(QWidget* parent, const QGLWidget* shareWidget) + : ExtGLWidget(parent, shareWidget) +#endif +{ + d_exporting_vector = false; + renderpixmaprequest_ = false; + doublelegend_ = false; + + displaylists_p = std::vector(DisplayListSize); + for (unsigned k=0; k!=displaylists_p.size(); ++k) { + displaylists_p[k] = 0; + } + + curve_p = 0; + setBackgroundColor(RGBA(1.0,1.0,1.0,1.0)); + update_coordinate_sys_ = true; +} + +/*! + Release allocated resources +*/ +Plot3D::~Plot3D() +{ + int i; + + makeCurrent(); + SaveGlDeleteLists( displaylists_p[0], displaylists_p.size() ); + + for (i = 0; i < curvelist_p.size(); ++i) { + delete curvelist_p[i]; + } + for (DrawableList::const_iterator itr = drawablelist_p.begin(); itr != drawablelist_p.end(); ++itr ) { + delete (*itr); + } + for (i = 0; i < titlelist_p.size(); ++i) { + delete titlelist_p[i]; + } +} + +/*! + Set up the OpenGL rendering state +*/ +void Plot3D::initializeGL() +{ + ExtGLWidget::initializeGL(); + if (renderpixmaprequest_) { + renderpixmaprequest_ = false; + } +} + +//! Reimplements QGLWidget::renderPixmap +QPixmap Plot3D::renderPixmap(int w/* =0 */, int h/* =0 */, bool useContext/* =false */) +{ + renderpixmaprequest_ = true; + for (int i = 0; i != curvelist_p.size(); ++i) + curvelist_p[i]->queueUpdate(); + + return QGLWidget::renderPixmap(w, h, useContext); +} + +/*! + Paint the widgets content. +*/ +void Plot3D::paintGL() +{ + int i; + + glClearColor(bgcolor_.r, bgcolor_.g, bgcolor_.b, bgcolor_.a); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glMatrixMode( GL_MODELVIEW ); + glPushMatrix(); + applyLights(); + + glRotatef( -90, 1.0, 0.0, 0.0 ); + glRotatef( 0.0, 0.0, 1.0, 0.0 ); + glRotatef( 0.0, 0.0, 0.0, 1.0 ); + + CurveList::const_iterator c = curvelist_p.begin(); + + for (i = 0; i != curvelist_p.size(); ++i) { + if (curvelist_p[i]->isColorLegend()) curvelist_p[i]->legend()->draw(); + } + + for (i = 0; i != titlelist_p.size(); ++i) + if (c != curvelist_p.end() && (*c)) { + titlelist_p[i]->setRelPosition((*c)->titlerel_, (*c)->titleanchor_); + titlelist_p[i]->draw(); + ++c; + } + + for (DrawableList::const_iterator itr = drawablelist_p.begin(); itr != drawablelist_p.end(); ++itr ) { + (*itr)->draw(); + } + + ExtGLWidget::applyModelViewAndProjection(coordinates_p.first(), coordinates_p.second()); + + if (lighting_enabled_) glEnable(GL_NORMALIZE); + + for (unsigned int j = 0; j != displaylists_p.size(); ++j) { + if (j != LegendObject) glCallList( displaylists_p[j] ); + } + + // ripped from old updateData method + if ( update_coordinate_sys_ ) { + GLStateBewarer dt(GL_DEPTH_TEST, true); + GLStateBewarer ls(GL_LINE_SMOOTH, true); + createCoordinateSystem(); + } + coordinates_p.draw(); + + for (i = 0; i != curvelist_p.size(); ++i) { + curvelist_p[i]->draw(); + } + + if (lighting_enabled_) glDisable(GL_NORMALIZE); + + glMatrixMode( GL_MODELVIEW ); + glPopMatrix(); +} + +/*! + Set up the OpenGL view port +*/ +void Plot3D::resizeGL( int w, int h ) +{ + glViewport( 0, 0, w, h ); + paintGL(); +} + +/*! + Add a Curve object to the plot. + Takes ownership of the object and will delete it when finished. + */ +void Plot3D::addCurve(Curve* curve) +{ + if (!curve || curvelist_p.contains(curve)) return; + + if (curve->plot() != this) curve->setPlot(this); + curvelist_p.push_back(curve); +} + +/*! + Remove a Curve object from the plot. + Erases the curve from the object list. + */ +bool Plot3D::removeCurve(Curve* curve) +{ + if (!curve || !curvelist_p.contains(curve)) return false; + + QVector::iterator c; + for (c = curvelist_p.begin(); c != curvelist_p.end(); ++c) { + if ((*c) == curve) { + curvelist_p.erase(c); + if (curve == curve_p) + setCurve(curvelist_p.size() ? curvelist_p.last() : 0); + return true; + } + } + return false; +} + +/*! + Add a Drawable object to the plot. + Takes ownership of the object and will delete it when finished. + */ +void Plot3D::addDrawable(Drawable* drawable) +{ + if (!drawable || drawablelist_p.contains(drawable)) return; + + drawable->setPlot(this); + drawablelist_p.push_back(drawable); +} + +/*! + Remove a Drawable object from the plot. + Erases the drawable from the object list. + */ +bool Plot3D::removeDrawable(Drawable* drawable) +{ + if (!drawable || !drawablelist_p.contains(drawable)) return false; + + QVector::iterator d; + for (d = drawablelist_p.begin(); d != drawablelist_p.end(); ++d) { + if ((*d) == drawable) { + drawablelist_p.erase(d); + return true; + } + } + return false; +} + +/*! + Add a Title object to the plot. + Takes ownership of the object and will delete it when finished. + */ +void Plot3D::addTitle(Label* label) +{ + if (!label || titlelist_p.contains(label)) return; + + if (title() != label) setTitle(label); + label->setPlot(this); + titlelist_p.push_back(label); +} + +/*! + Remove a Title object from the plot. + Erases the curve from the object list. + */ +bool Plot3D::removeTitle(Label* title) +{ + if (!title || !titlelist_p.contains(title)) return false; + + QVector::iterator t; + for (t = titlelist_p.begin(); t != titlelist_p.end(); ++t) { + if ((*t) == title) { + titlelist_p.erase(t); + if (title == title_p) + setTitle(titlelist_p.size() ? titlelist_p.last() : 0); + return true; + } + } + return false; +} + +void Plot3D::manageConnect(bool connect, Qwt3D::Curve* curve) +{ + DEBUG << "Plot3D:" << (connect ? "Connecting" : "Disconnecting") << "Curve(s)"; + + curve ? (connect ? curve->connects() : curve->disconnects()) : + childConnect(connect); +} + +void Plot3D::childConnect(bool connect) +{ + DEBUG << "Plot3D:" << (connect ? "Connecting" : "Disconnecting") << "All Curves"; + + foreach (Curve* curve, curvelist_p) { + if (curve) connect ? curve->connects() : curve->disconnects(); + } +} + +/*! + Create a coordinate system with generating corners beg and end +*/ +void Plot3D::createCoordinateSystem( Triple beg, Triple end ) +{ + if (beg != coordinates_p.first() || end != coordinates_p.second()){ + coordinates_p.setPlot(this); + coordinates_p.init(beg, end); + } +} + +/*! + Create a coordinate system from data +*/ +void Plot3D::createCoordinateSystem() +{ + calculateHull(); + Qwt3D::ParallelEpiped the_hull = hull(); + Triple beg = the_hull.minVertex; // Irix 6.5 compiler bug + Triple end = the_hull.maxVertex; + + createCoordinateSystem(beg, end); +} + +/*! + Update the hull +*/ +void Plot3D::calculateHull() +{ + Qwt3D::ParallelEpiped the_hull; + + // account for the curves (if any) + if ( !curvelist_p.empty() ) { + the_hull.minVertex.x = DBL_MAX; + the_hull.minVertex.y = DBL_MAX; + the_hull.minVertex.z = DBL_MAX; + the_hull.maxVertex.x = -DBL_MAX; + the_hull.maxVertex.y = -DBL_MAX; + the_hull.maxVertex.z = -DBL_MAX; + for ( int i = 0; i < curvelist_p.size(); ++i ) { + Qwt3D::ParallelEpiped sub_hull = curvelist_p[i]->hull(); + + if ( sub_hull.minVertex == sub_hull.maxVertex ) { + continue; + } + + if ( sub_hull.minVertex.x < the_hull.minVertex.x ) { the_hull.minVertex.x = sub_hull.minVertex.x; } + if ( sub_hull.minVertex.y < the_hull.minVertex.y ) { the_hull.minVertex.y = sub_hull.minVertex.y; } + if ( sub_hull.minVertex.z < the_hull.minVertex.z ) { the_hull.minVertex.z = sub_hull.minVertex.z; } + if ( sub_hull.maxVertex.x > the_hull.maxVertex.x ) { the_hull.maxVertex.x = sub_hull.maxVertex.x; } + if ( sub_hull.maxVertex.y > the_hull.maxVertex.y ) { the_hull.maxVertex.y = sub_hull.maxVertex.y; } + if ( sub_hull.maxVertex.z > the_hull.maxVertex.z ) { the_hull.maxVertex.z = sub_hull.maxVertex.z; } + } + } + setHull(the_hull); +// +// Triple beg = the_hull.minVertex; // Irix 6.5 compiler bug +// Triple end = the_hull.maxVertex; +// std::cout << "Hull is from " +// << "(" << beg.x << ", " << beg.y << ", " << beg.z << ")" +// << " to " +// << "(" << end.x << ", " << end.y << ", " << end.z << ")" +// << std::endl; +} + +/*! + Set style of coordinate system +*/ +void Plot3D::setCoordinateStyle(COORDSTYLE st) +{ + coordinates_p.setStyle(st); + updateGL(); +} + +/*! + Update OpenGL data representation +*/ +void Plot3D::updateData(bool coord) +{ + update_coordinate_sys_ = coord; + updateGL(); +} + +/*! + Square up the plot scale based on the loaded curve +*/ +void Plot3D::normaliseScale(Curve* curve, Plot3D* parentplot, ParallelEpiped* curvehull) +{ + if (!parentplot) parentplot = this; + + Triple range, scale(parentplot->xScale(), parentplot->yScale(), parentplot->zScale()); + ParallelEpiped datahull; + + do { +#ifdef BUILTIN_CURVEFIT + datahull = curvehull ? *curvehull : curve->data()->hull(); +#else + datahull = curve->data()->hull(); +#endif + range = Triple(datahull.maxVertex.x - datahull.minVertex.x, + datahull.maxVertex.y - datahull.minVertex.y, + datahull.maxVertex.z - datahull.minVertex.z); + + DEBUG << "Plot3D: Waiting for a valid hull -" << curve + << "( Min =" << datahull.minVertex << ", Max =" << datahull.maxVertex << ") range =" << range; + } while (!range.length()); // Waiting for a valid hull + + DEBUG << "Plot3D: Existing Scale - scale =" << scale << "range =" << range << curve + << "( Min =" << datahull.minVertex << ", Max =" << datahull.maxVertex << zScale() << curvehull; + + scale.z = qMax(range.x/range.z, range.y/range.z); + + int height = (int)floor((range.x/range.y) + 0.5); + + if (height == 1) scale.y = scale.x = height; + else (height > 1) ? scale.y = height : scale.x = height; + + intScale(scale.x); intScale(scale.y); intScale(scale.z); // Round scales to thier nearest integers. + double zoomFactor = 1.0; + + if (!parentplot) { + if ((xScale() != 1) && (scale.x >= xScale()) && + (yScale() != 1) && (scale.y >= yScale()) && + (zScale() != 1) && (scale.z >= zScale())) + return; + zoomFactor = (scale.length() > 10) ? 8/scale.length() : 2/scale.length(); + } else { + if (scale.z <= zScale()) + return; + } + + setZoom(0.9 * zoomFactor * parentplot->zoom()); + setScale(scale.x, scale.y, scale.z); + + DEBUG << "Plot3D: Normalised Scale - scale =" << scale << height + << "( Min =" << datahull.minVertex << ", Max =" << datahull.maxVertex << "] zoom" << zoom() << zoomFactor << scale.length(); +} === removed file '3rdparty/qwtplot3d/src/qwt3d_plot.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_plot.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_plot.cpp 1970-01-01 00:00:00 +0000 @@ -1,500 +0,0 @@ -#if defined(_MSC_VER) /* MSVC Compiler */ -#pragma warning ( disable : 4305 ) -#pragma warning ( disable : 4786 ) -#endif - -#include "qwt3d_plot.h" -#include "qwt3d_enrichment.h" - - -using namespace Qwt3D; - -/*! - This should be the first call in your derived classes constructors. -*/ -#if QT_VERSION < 0x040000 -Plot3D::Plot3D( QWidget* parent, const char* name ) - : QGLWidget( parent, name ) -#else -Plot3D::Plot3D( QWidget * parent, const QGLWidget * shareWidget) - : QGLWidget( parent, shareWidget) -#endif -{ - d_exporting_vector = false; - initializedGL_ = false; - renderpixmaprequest_ = false; - xRot_ = yRot_ = zRot_ = 0.0; // default object rotation - - xShift_ = yShift_ = zShift_ = xVPShift_ = yVPShift_ = 0.0; - xScale_ = yScale_ = zScale_ = 1.0; - zoom_ = 1; - ortho_ = true; - plotstyle_ = FILLEDMESH; - userplotstyle_p = 0; - shading_ = GOURAUD; - floorstyle_ = NOFLOOR; - isolines_ = 10; - displaylegend_ = false; - smoothdatamesh_p = false; - actualData_p = 0; - - lastMouseMovePosition_ = QPoint(0,0); - mpressed_ = false; - mouse_input_enabled_ = true; - - setPolygonOffset(0.5); - setMeshColor(RGBA(0.0,0.0,0.0)); - setMeshLineWidth(1); - setBackgroundColor(RGBA(1.0,1.0,1.0,1.0)); - - displaylists_p = std::vector(DisplayListSize); - for (unsigned k=0; k!=displaylists_p.size(); ++k) - displaylists_p[k] = 0; - - datacolor_p = new StandardColor(this, 100); - title_.setPlot(this); - title_.setFont("Courier", 16, QFont::Bold); - title_.setString(""); - - setTitlePosition(0.95); - - kbd_input_enabled_ = true; - -#if QT_VERSION < 0x040000 - setFocusPolicy(QWidget::StrongFocus); - assignMouse(Qt::LeftButton, - Qt::LeftButton | Qt::ShiftButton, - Qt::LeftButton, - Qt::LeftButton | Qt::AltButton, - Qt::LeftButton | Qt::AltButton, - Qt::LeftButton | Qt::AltButton | Qt::ShiftButton, - Qt::LeftButton | Qt::AltButton | Qt::ControlButton, - Qt::LeftButton | Qt::ControlButton, - Qt::LeftButton | Qt::ControlButton); - - - assignKeyboard(Qt::Key_Down, Qt::Key_Up, - Qt::ShiftButton + Qt::Key_Right, Qt::ShiftButton + Qt::Key_Left, - Qt::Key_Right, Qt::Key_Left, - Qt::AltButton + Qt::Key_Right, Qt::AltButton + Qt::Key_Left, - Qt::AltButton + Qt::Key_Down, Qt::AltButton + Qt::Key_Up, - Qt::AltButton + Qt::ShiftButton + Qt::Key_Down, Qt::AltButton + Qt::ShiftButton + Qt::Key_Up, - Qt::AltButton + Qt::ControlButton + Qt::Key_Down, Qt::AltButton + Qt::ControlButton + Qt::Key_Up, - Qt::ControlButton + Qt::Key_Right, Qt::ControlButton + Qt::Key_Left, - Qt::ControlButton + Qt::Key_Down, Qt::ControlButton + Qt::Key_Up - ); -#else - setFocusPolicy(Qt::StrongFocus); - assignMouse(Qt::LeftButton, - MouseState(Qt::LeftButton, Qt::ShiftModifier), - Qt::LeftButton, - MouseState(Qt::LeftButton, Qt::AltModifier), - MouseState(Qt::LeftButton, Qt::AltModifier), - MouseState(Qt::LeftButton, Qt::AltModifier | Qt::ShiftModifier), - MouseState(Qt::LeftButton, Qt::AltModifier | Qt::ControlModifier), - MouseState(Qt::LeftButton, Qt::ControlModifier), - MouseState(Qt::LeftButton, Qt::ControlModifier) - ); - - - assignKeyboard(Qt::Key_Down, Qt::Key_Up, - KeyboardState(Qt::Key_Right, Qt::ShiftModifier), KeyboardState(Qt::Key_Left, Qt::ShiftModifier), - Qt::Key_Right, Qt::Key_Left, - KeyboardState(Qt::Key_Right, Qt::AltModifier), KeyboardState(Qt::Key_Left, Qt::AltModifier), - KeyboardState(Qt::Key_Down, Qt::AltModifier), KeyboardState(Qt::Key_Up, Qt::AltModifier), - KeyboardState(Qt::Key_Down, Qt::AltModifier|Qt::ShiftModifier), KeyboardState(Qt::Key_Up, Qt::AltModifier|Qt::ShiftModifier), - KeyboardState(Qt::Key_Down, Qt::AltModifier|Qt::ControlModifier), KeyboardState(Qt::Key_Up, Qt::AltModifier|Qt::ControlModifier), - KeyboardState(Qt::Key_Right, Qt::ControlModifier), KeyboardState(Qt::Key_Left, Qt::ControlModifier), - KeyboardState(Qt::Key_Down, Qt::ControlModifier), KeyboardState(Qt::Key_Up, Qt::ControlModifier) - ); -#endif - setKeySpeed(3,5,5); - legend_.setPlot(this); - legend_.setLimits(0, 100); - legend_.setMajors(10); - legend_.setMinors(2); - legend_.setOrientation(ColorLegend::BottomTop, ColorLegend::Left); - - lighting_enabled_ = false; - disableLighting(); - lights_ = std::vector(8); -} - -/*! - Release allocated resources -*/ - -Plot3D::~Plot3D() -{ - makeCurrent(); - SaveGlDeleteLists( displaylists_p[0], displaylists_p.size() ); - datacolor_p->destroy(); - delete userplotstyle_p; - for (ELIT it = elist_p.begin(); it!=elist_p.end(); ++it) - delete (*it); - - elist_p.clear(); -} - - -/*! - Set up the OpenGL rendering state -*/ -void Plot3D::initializeGL() -{ - glEnable( GL_BLEND ); - glEnable(GL_DEPTH_TEST); - glShadeModel(GL_SMOOTH); - - // Set up the lights - - disableLighting(); - - GLfloat whiteAmb[4] = {1.0, 1.0, 1.0, 1.0}; - - setLightShift(0, 0, 3000); - glEnable(GL_COLOR_MATERIAL); - - glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); - glLightModelfv(GL_LIGHT_MODEL_AMBIENT, whiteAmb); - - setMaterialComponent(GL_DIFFUSE, 1.0); - setMaterialComponent(GL_SPECULAR, 0.3); - setMaterialComponent(GL_SHININESS, 5.0); - setLightComponent(GL_DIFFUSE, 1.0); - setLightComponent(GL_SPECULAR, 1.0); - - initializedGL_ = true; - if (renderpixmaprequest_) - { - updateData(); - renderpixmaprequest_ = false; - } -} - -/*! - Paint the widgets content. -*/ -void Plot3D::paintGL() -{ - glClearColor(bgcolor_.r, bgcolor_.g, bgcolor_.b, bgcolor_.a); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glMatrixMode( GL_MODELVIEW ); - glPushMatrix(); - applyLights(); - - glRotatef( -90, 1.0, 0.0, 0.0 ); - glRotatef( 0.0, 0.0, 1.0, 0.0 ); - glRotatef( 0.0, 0.0, 0.0, 1.0 ); - - if (displaylegend_) - { - legend_.draw(); - } - title_.setRelPosition(titlerel_, titleanchor_); - title_.draw(); - - Triple beg = coordinates_p.first(); - Triple end = coordinates_p.second(); - - Triple center = beg + (end-beg) / 2; - double radius = (center-beg).length(); - - glLoadIdentity(); - - glRotatef( xRot_-90, 1.0, 0.0, 0.0 ); - glRotatef( yRot_, 0.0, 1.0, 0.0 ); - glRotatef( zRot_, 0.0, 0.0, 1.0 ); - - glScalef( zoom_ * xScale_, zoom_ * yScale_, zoom_ * zScale_ ); - - glTranslatef(xShift_-center.x, yShift_-center.y, zShift_-center.z); - - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - - if (beg != end) - { - if (ortho_) - { - glOrtho( -radius, +radius, -radius, +radius, 0, 40 * radius); - } - else - { - glFrustum( -radius, +radius, -radius, +radius, 5 * radius, 400 * radius ); - } - } - else - { - if (ortho_) - glOrtho( -1.0, 1.0, -1.0, 1.0, 10.0, 100.0 ); - else - glFrustum( -1.0, 1.0, -1.0, 1.0, 10.0, 100.0 ); - } - - glTranslatef( xVPShift_ * 2 * radius , yVPShift_ * 2 * radius , -7 * radius ); - - if (lighting_enabled_) - glEnable(GL_NORMALIZE); - - for (unsigned i=0; i!= displaylists_p.size(); ++i) - { - if (i!=LegendObject) - glCallList( displaylists_p[i] ); - } - coordinates_p.draw(); - - if (lighting_enabled_) - glDisable(GL_NORMALIZE); - - glMatrixMode( GL_MODELVIEW ); - glPopMatrix(); -} - - -/*! - Set up the OpenGL view port -*/ -void Plot3D::resizeGL( int w, int h ) -{ - glViewport( 0, 0, w, h ); - paintGL(); -} - -/*! - Reimplemented from QGLWidget -*/ -QPixmap Plot3D::renderPixmap(int w/* =0 */, int h/* =0 */, bool useContext/* =false */) -{ - renderpixmaprequest_ = true; - return QGLWidget::renderPixmap(w,h,useContext); -} - -/*! - Create a coordinate system with generating corners beg and end -*/ -void Plot3D::createCoordinateSystem( Triple beg, Triple end ) -{ - if (beg != coordinates_p.first() || end != coordinates_p.second()){ - coordinates_p.setPlot(this); - coordinates_p.init(beg, end); - } -} - -/*! - Create a coordinate system from data -*/ -void Plot3D::createCoordinateSystem() -{ - calculateHull(); - Triple beg = hull().minVertex; // Irix 6.5 compiler bug - Triple end = hull().maxVertex; - createCoordinateSystem(beg, end); -} - -/*! - Show a color legend -*/ -void Plot3D::showColorLegend( bool show ) -{ - displaylegend_ = show; - if (show) - datacolor_p->createVector(legend_.colors); - updateGL(); -} - -void Plot3D::setMeshColor(RGBA rgba) -{ - meshcolor_ = rgba; -} - -void Plot3D::setBackgroundColor(RGBA rgba) -{ - bgcolor_ = rgba; -} - - -/*! - assign a new coloring object for the data. -*/ -void Plot3D::setDataColor( Color* col ) -{ - Q_ASSERT(datacolor_p); - - datacolor_p->destroy(); - datacolor_p = col; -} - -/*! - Set up ortogonal or perspective mode and updates widget -*/ -void Plot3D::setOrtho( bool val ) -{ - if (val == ortho_) - return; - ortho_ = val; - updateGL(); - - emit projectionChanged(val); -} - -/*! - Set style of coordinate system -*/ -void Plot3D::setCoordinateStyle(COORDSTYLE st) -{ - coordinates_p.setStyle(st); - updateGL(); -} - -/*! - Set plotstyle for the standard plotting types. An argument of value Qwt3D::USER - is ignored. -*/ -void Plot3D::setPlotStyle( PLOTSTYLE val ) -{ - if (val == Qwt3D::USER) - return; - delete userplotstyle_p; - userplotstyle_p = 0; - plotstyle_ = val; -} - -/*! - Set plotstyle to Qwt3D::USER and an associated enrichment object. -*/ -Qwt3D::Enrichment* Plot3D::setPlotStyle( Qwt3D::Enrichment const& obj ) -{ - if (&obj == userplotstyle_p) - return userplotstyle_p; - - delete userplotstyle_p; - userplotstyle_p = obj.clone(); - plotstyle_ = Qwt3D::USER; - return userplotstyle_p; -} - -/*! - Set shading style -*/ -void Plot3D::setShading( SHADINGSTYLE val ) -{ - if (val == shading_) - return; - - shading_ = val; - - switch (shading_) - { - case FLAT: - glShadeModel(GL_FLAT); - break; - case GOURAUD: - glShadeModel(GL_SMOOTH); - break; - default: - break; - } - updateGL(); -} - -/*! - Set number of isolines. The lines are equidistant between minimal and maximal Z value -*/ -void Plot3D::setIsolines(int steps) -{ - if (steps < 0) - return; - - isolines_ = steps; -} - -/*! - Set Polygon offset. The function affects the OpenGL rendering process. - Try different values for surfaces with polygons only and with mesh and polygons -*/ -void Plot3D::setPolygonOffset( double val ) -{ - polygonOffset_ = val; -} - -void Plot3D::setMeshLineWidth( double val ) -{ - Q_ASSERT(val>=0); - - if (val < 0) - return; - - meshLineWidth_ = val; -} - - -/*! -Set relative caption position (0.5,0.5) means, the anchor point lies in the center of the screen -*/ -void Plot3D::setTitlePosition(double rely, double relx, Qwt3D::ANCHOR anchor) -{ - titlerel_.y = (rely<0 || rely>1) ? 0.5 : rely; - titlerel_.x = (relx<0 || relx>1) ? 0.5 : relx; - - titleanchor_ = anchor; -} - -/*! -Set caption font -*/ -void Plot3D::setTitleFont(const QString& family, int pointSize, int weight, bool italic) -{ - title_.setFont(family, pointSize, weight, italic); -} - -Enrichment* Plot3D::addEnrichment(Enrichment const& e) -{ - if ( elist_p.end() == std::find( elist_p.begin(), elist_p.end(), &e ) ) - elist_p.push_back(e.clone()); - return elist_p.back(); -} - -bool Plot3D::degrade(Enrichment* e) -{ - ELIT it = std::find(elist_p.begin(), elist_p.end(), e); - - if ( it != elist_p.end() ) - { - delete (*it); - elist_p.erase(it); - return true; - } - return false; -} - -void Plot3D::createEnrichments() -{ - for (ELIT it = elist_p.begin(); it!=elist_p.end(); ++it) - { - this->createEnrichment(**it); - } -} - -/*! - Update OpenGL data representation -*/ -void Plot3D::updateData() -{ - makeCurrent(); - GLStateBewarer dt(GL_DEPTH_TEST, true); - GLStateBewarer ls(GL_LINE_SMOOTH, true); - - calculateHull(); - - SaveGlDeleteLists(displaylists_p[DataObject], 1); // nur Daten - - displaylists_p[DataObject] = glGenLists(1); - glNewList(displaylists_p[DataObject], GL_COMPILE); - - this->createEnrichments(); - this->createData(); - - glEndList(); -} === added file '3rdparty/qwtplot3d/src/qwt3d_scale.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_scale.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_scale.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,381 @@ +#include "qwt3d_scale.h" +#include + +using namespace Qwt3D; + +Scale::Scale() +: start_p(0.), stop_p(0.), + majorintervals_p(0), minorintervals_p(0), + mstart_p(0.), mstop_p(0.), + d_numeric_precision(6), + d_numeric_format(Default) +{ +} + +/*! The function maps the double value at tic-position idx to a final +representation. The default return value is simply the tic values QString +representation. Overwrite this function, if you plan to transform the value +in some way. See e.g. LogScale::ticLabel. +\param idx the current major tic index +\return The QString representation for the value corresponding to a valid index, +an empty QString else. +*/ +QString Scale::ticLabel(unsigned int idx) const +{ + if (idx < 0 || idx >= majors_p.size()) + return QString::null; + + QLocale locale = QLocale(); + switch (d_numeric_format){ + case Default: + return locale.toString(majors_p[idx], 'g', d_numeric_precision); + break; + + case Decimal: + return locale.toString(majors_p[idx], 'f', d_numeric_precision); + break; + + case Scientific: + return locale.toString(majors_p[idx], 'e', d_numeric_precision); + break; + + case Engineering:{ + QString eng_suff; + double new_value = majors_p[idx]; + + if(fabs(new_value) >= 1e18){ + eng_suff = 'E'; + new_value /= 1e18; + } else if(fabs(new_value) >= 1e15){ + eng_suff = 'P'; + new_value /= 1e15; + } else if(fabs(new_value) >= 1e12){ + eng_suff = 'T'; + new_value /= 1e12; + } else if(fabs(new_value) >= 1e9){ + eng_suff = 'G'; + new_value /= 1e9; + } else if(fabs(new_value) >= 1e6){ + eng_suff = 'M'; + new_value /= 1e6; + } else if(fabs(new_value) >= 1e3){ + eng_suff = 'k'; + new_value /= 1e3; + } else if(fabs(new_value) >= 1){ + eng_suff = ""; + new_value /= 1.0; + } else if(fabs(new_value) >= 1e-3){ + eng_suff = 'm'; + new_value /= 1e-3; + } else if(fabs(new_value) >= 1e-6){ + eng_suff = ''; + new_value /= 1e-6; + } else if(fabs(new_value) >= 1e-9){ + eng_suff = 'n'; + new_value /= 1e-9; + } else if(fabs(new_value) >= 1e-12){ + eng_suff = 'p'; + new_value /= 1e-12; + } else if(fabs(new_value) >= 1e-15){ + eng_suff = 'f'; + new_value /= 1e-15; + } else { + eng_suff = 'a'; + new_value /= 1e-18; + } + + QString txt = locale.toString((new_value), 'f', d_numeric_precision); + if(txt.contains(QRegExp("^0[\\.,]?0*$"))) + return "0"; + + return txt + eng_suff; + } + break; + } + return QString::null; +} + +double Scale::ticValue(unsigned int idx) const +{ + if (idx < majors_p.size()) + return majors_p[idx]; + + return 0.0; +} + +//! Sets start and stop value for the scale; +void Scale::setLimits(double start, double stop) +{ + if (start < stop) + { + start_p = start; + stop_p = stop; + return; + } + start_p = stop; + stop_p = start; +} + +//! Sets value of first major tic +void Scale::setMajorLimits(double start, double stop) +{ + if (start < stop) + { + mstart_p = start; + mstop_p = stop; + return; + } + mstart_p = stop; + mstop_p = start; +} + +/*! + \param a First major tic after applying autoscaling + \param b Last major tic after applying autoscaling + \param start Scale begin + \param stop Scale end + \param ivals Requested number of major intervals + \return Number of major intervals after autoscaling\n + + The default implementation sets a=start, b=stop and returns ivals. +*/ +int Scale::autoscale(double& a, double& b, double start, double stop, int ivals) +{ + a = start; + b = stop; + return ivals; +} + +/*************************** +* +* linear scales +* +***************************/ + + +//! Applies LinearAutoScaler::execute() +int LinearScale::autoscale(double& a, double& b, double start, double stop, int ivals) +{ + return autoscaler_p.execute(a, b, start, stop, ivals); +} + +//! Creates the major and minor vector for the scale +void LinearScale::calculate() +{ + majors_p.clear(); + minors_p.clear(); + + double interval = mstop_p-mstart_p; + + double runningval; + int i=0; + + // majors + + // first tic +// if (mstart_pstop_p) +// return; + + majors_p.push_back(mstart_p); + + // remaining tics + for (i = 1; i <= majorintervals_p; ++i) + { + double t = double(i) / majorintervals_p; + runningval = mstart_p + t * interval; + if (runningval>stop_p) + break; + if (isPracticallyZero(mstart_p, -t*interval)) // prevent rounding errors near 0 + runningval = 0.0; + majors_p.push_back(runningval); + } + majorintervals_p = majors_p.size(); + if (majorintervals_p) + --majorintervals_p; + + + // minors + + if (!majorintervals_p || !minorintervals_p) // no valid interval + { + minorintervals_p = 0; + return; + } + + // start_p mstart_p + // |_____________|_____ _ _ _ + + double step = (majors_p[1]-majors_p[0]) / minorintervals_p; + if (isPracticallyZero(step)) + return; + + runningval = mstart_p-step; + while (runningval>start_p) + { + minors_p.push_back(runningval); + runningval -= step; + } + + // mstart_p mstop_p + // ________|_____ _ _ _ _ _ ___|__________ + + for (i=0; i!=majorintervals_p; ++i) + { + runningval = majors_p[i] + step; + for (int j=0; j!=minorintervals_p; ++j) + { + minors_p.push_back(runningval); + runningval += step; + } + } + + // mstop_p stop_p + // _ _ _|_____________| + + runningval = mstop_p + step; + while (runningval DBL_MAX_10_EXP) + stop_p = DBL_MAX_10_EXP; + + double interval = stop_p-start_p; + if (interval<=0) + return; + + double runningval = floor(start_p); + while(runningval<=stop_p) + { + if (runningval>=start_p) + majors_p.push_back(runningval); + ++runningval; + } + majorintervals_p = majors_p.size(); + if (majorintervals_p) + --majorintervals_p; + + if (majors_p.size()<1) // not even a single major tic + { + return; + } + + + // minors + + // start_p mstart_p + // |_____________|_____ _ _ _ + + double k; + int step; + setupCounter(k,step); + runningval = log10(k)+(majors_p[0]-1); + while (runningval>start_p && k>1) + { + minors_p.push_back(runningval); + k -=step; + runningval = log10(k)+(majors_p[0]-1); + } + + // mstart_p mstop_p + // ________|_____ _ _ _ _ _ ___|__________ + + for (int i=0; i!=majorintervals_p; ++i) + { + setupCounter(k,step); + runningval = log10(k)+(majors_p[i]); + while (k>1) + { + minors_p.push_back(runningval); + k-=step; + runningval = log10(k)+(majors_p[i]); + } + } + + // mstop_p stop_p + // _ _ _|_____________| + + setupCounter(k,step); + runningval = log10(k)+(majors_p.back()); + do + { + k-=step; + runningval = log10(k)+(majors_p.back()); + } + while(runningval>=stop_p); + while (k>1) + { + minors_p.push_back(runningval); + k-=step; + runningval = log10(k)+(majors_p.back()); + } +} + +/*! +Sets the minor intervals for the logarithmic scale. Only values of 9,5,3 or 2 +are accepted as arguments. They will produce mantissa sets of {2,3,4,5,6,7,8,9}, +{2,4,6,8}, {2,5} or {5} respectively. +*/ +void LogScale::setMinors(int val) +{ + if ((val == 2) || (val == 3) || (val == 5) || (val == 9)) + minorintervals_p = val; +} + +LogScale::LogScale() +{ + minorintervals_p = 9; +} + +//! Returns a power of 10 associated to the major value at index idx. +QString LogScale::ticLabel(unsigned int idx) const +{ + if (idxstop_p) -// return; - - majors_p.push_back(mstart_p); - - // remaining tics - for (i = 1; i <= majorintervals_p; ++i) - { - double t = double(i) / majorintervals_p; - runningval = mstart_p + t * interval; - if (runningval>stop_p) - break; - if (isPracticallyZero(mstart_p, -t*interval)) // prevent rounding errors near 0 - runningval = 0.0; - majors_p.push_back(runningval); - } - majorintervals_p = majors_p.size(); - if (majorintervals_p) - --majorintervals_p; - - - // minors - - if (!majorintervals_p || !minorintervals_p) // no valid interval - { - minorintervals_p = 0; - return; - } - - // start_p mstart_p - // |_____________|_____ _ _ _ - - double step = (majors_p[1]-majors_p[0]) / minorintervals_p; - if (isPracticallyZero(step)) - return; - - runningval = mstart_p-step; - while (runningval>start_p) - { - minors_p.push_back(runningval); - runningval -= step; - } - - // mstart_p mstop_p - // ________|_____ _ _ _ _ _ ___|__________ - - for (i=0; i!=majorintervals_p; ++i) - { - runningval = majors_p[i] + step; - for (int j=0; j!=minorintervals_p; ++j) - { - minors_p.push_back(runningval); - runningval += step; - } - } - - // mstop_p stop_p - // _ _ _|_____________| - - runningval = mstop_p + step; - while (runningval DBL_MAX_10_EXP) - stop_p = DBL_MAX_10_EXP; - - double interval = stop_p-start_p; - if (interval<=0) - return; - - double runningval = floor(start_p); - while(runningval<=stop_p) - { - if (runningval>=start_p) - majors_p.push_back(runningval); - ++runningval; - } - majorintervals_p = majors_p.size(); - if (majorintervals_p) - --majorintervals_p; - - if (majors_p.size()<1) // not even a single major tic - { - return; - } - - - // minors - - // start_p mstart_p - // |_____________|_____ _ _ _ - - double k; - int step; - setupCounter(k,step); - runningval = log10(k)+(majors_p[0]-1); - while (runningval>start_p && k>1) - { - minors_p.push_back(runningval); - k -=step; - runningval = log10(k)+(majors_p[0]-1); - } - - // mstart_p mstop_p - // ________|_____ _ _ _ _ _ ___|__________ - - for (int i=0; i!=majorintervals_p; ++i) - { - setupCounter(k,step); - runningval = log10(k)+(majors_p[i]); - while (k>1) - { - minors_p.push_back(runningval); - k-=step; - runningval = log10(k)+(majors_p[i]); - } - } - - // mstop_p stop_p - // _ _ _|_____________| - - setupCounter(k,step); - runningval = log10(k)+(majors_p.back()); - do - { - k-=step; - runningval = log10(k)+(majors_p.back()); - } - while(runningval>=stop_p); - while (k>1) - { - minors_p.push_back(runningval); - k-=step; - runningval = log10(k)+(majors_p.back()); - } -} - -/*! -Sets the minor intervals for the logarithmic scale. Only values of 9,5,3 or 2 -are accepted as arguments. They will produce mantissa sets of {2,3,4,5,6,7,8,9}, -{2,4,6,8}, {2,5} or {5} respectively. -*/ -void LogScale::setMinors(int val) -{ - if ((val == 2) || (val == 3) || (val == 5) || (val == 9)) - minorintervals_p = val; -} - -LogScale::LogScale() -{ - minorintervals_p = 9; -} - -//! Returns a power of 10 associated to the major value at index idx. -QString LogScale::ticLabel(unsigned int idx) const -{ - if (idx 1 are ignored +*/ +void SurfacePlot::setNormalLength(double val) +{ + if (val<0 || val>1) + return; + normalLength_p = val; +} + +/** +Values < 3 are ignored +*/ +void SurfacePlot::setNormalQuality(int val) +{ + if (val<3) + return; + normalQuality_p = val; +} + +/** + Calculates the smallest x-y-z parallelepiped enclosing the data. + It can be accessed by hull(); +*/ +void SurfacePlot::calculateHull() +{ + if (actualData_p->empty()) + return; + setHull(actualData_p->hull()); +} + +/*! + Sets data resolution (res == 1 original resolution) and updates widget + If res < 1, the function does nothing +*/ +void SurfacePlot::setResolution( int res ) +{ + if (!actualData_p || actualData_p->datatype == Qwt3D::POLYGON) + return; + + if ((resolution_p == res) || res < 1) + return; + + resolution_p = res; + updateNormals(); + updateData(); + if (initializedGL()) + updateGL(); + + emit resolutionChanged(res); +} + +void SurfacePlot::updateNormals() +{ + SaveGlDeleteLists(displaylists_p[NormalObject], 1); + + if (plotStyle() == NOPLOT && !normals() || !actualData_p) + return; + + displaylists_p[NormalObject] = glGenLists(1); + glNewList(displaylists_p[NormalObject], GL_COMPILE); + + if (actualData_p->datatype == Qwt3D::POLYGON) + createNormalsC(); + else if (actualData_p->datatype == Qwt3D::GRID) + createNormalsG(); + + glEndList(); +} + +void SurfacePlot::createData() +{ + if (!actualData_p) + return; + if (actualData_p->datatype == Qwt3D::POLYGON) + createDataC(); + else if (actualData_p->datatype == Qwt3D::GRID) + createDataG(); +} + + +void SurfacePlot::createFloorData() +{ + if (!actualData_p) + return; + if (actualData_p->datatype == Qwt3D::POLYGON) + createFloorDataC(); + else if (actualData_p->datatype == Qwt3D::GRID) + createFloorDataG(); +} + +void SurfacePlot::createSideData() +{ + if (!actualData_p) + return; + if (actualData_p->datatype == Qwt3D::POLYGON) + createSideDataC(); + else if (actualData_p->datatype == Qwt3D::GRID) + createSideDataG(); +} + +void SurfacePlot::createFaceData() +{ + if (!actualData_p) + return; + if (actualData_p->datatype == Qwt3D::POLYGON) + createFaceDataC(); + else if (actualData_p->datatype == Qwt3D::GRID) + createFaceDataG(); +} + +/** + The returned value is not affected by resolution(). The pair gives (columns,rows) for grid data +, (number of cells,1) for free formed data (datatype() == POLYGON) and (0,0) else +*/ +pair SurfacePlot::facets() const +{ + if (!hasData()) + return pair(0,0); + + if (actualData_p->datatype == Qwt3D::POLYGON) + return pair(int(actualDataC_->cells.size()), 1); + else if (actualData_p->datatype == Qwt3D::GRID) + return pair(actualDataG_->columns(), actualDataG_->rows()); + else + return pair(0,0); +} + +void SurfacePlot::createPoints() +{ + Dot pt(point_size_,true); + createEnrichment(pt); +} + +void SurfacePlot::createEnrichment(Enrichment& p) +{ + if (!actualData_p) + return; + + //todo future work + if (p.type() != Enrichment::VERTEXENRICHMENT) + return; + + p.assign(*this); + p.drawBegin(); + + VertexEnrichment* ve = (VertexEnrichment*)&p; + if (actualData_p->datatype == Qwt3D::POLYGON) + { + for (unsigned i = 0; i != actualDataC_->normals.size(); ++i) + ve->draw(actualDataC_->nodes[i]); + } + else if (actualData_p->datatype == Qwt3D::GRID) + { + int step = resolution(); + for (int i = 0; i <= actualDataG_->columns() - step; i += step) + for (int j = 0; j <= actualDataG_->rows() - step; j += step) + ve->draw(Triple(actualDataG_->vertices[i][j][0], + actualDataG_->vertices[i][j][1], + actualDataG_->vertices[i][j][2])); + } + p.drawEnd(); +} + +void SurfacePlot::drawVertex(Triple& vertex, double shift, unsigned int comp) +{ + switch (comp) { + case 0: + glVertex3d(shift, vertex.y, vertex.z); break; + case 1: + glVertex3d(vertex.x, shift, vertex.z); break; + case 2: + glVertex3d(vertex.x, vertex.y, shift); break; + default: + glVertex3d(vertex.x, vertex.y, vertex.z); + } +} + +void SurfacePlot::drawIntersections(vector& intersection, double shift, unsigned int comp, + bool projected, vector* col) +{ + if (intersection.empty()) + return; + + if (intersection.size() > 2) { + glBegin(GL_LINE_STRIP); + for (unsigned dd = 0; dd!=intersection.size(); ++dd) { + if (colour) glColor4d((*colour)[dd].r, (*colour)[dd].g, (*colour)[dd].b, (*colour)[dd].a); + drawVertex(intersection[dd], shift, comp); + } + glEnd(); + + if (projected) { + glBegin(GL_POINTS); + drawVertex(intersection[0], shift, comp); + glEnd(); + } + } else if (intersection.size() == 2) { + glBegin(GL_LINES); + drawVertex(intersection[0], shift, comp); + drawVertex(intersection[1], shift, comp); + + // small pixel gap problem (see OpenGL spec.) + drawVertex(intersection[1], shift, comp); + drawVertex(intersection[0], shift, comp); + glEnd(); + + if (projected) { + glBegin(GL_POINTS); + drawVertex(intersection[0], shift, comp); + drawVertex(intersection[1], shift, comp); + glEnd(); + } + } + + intersection.clear(); +} === removed file '3rdparty/qwtplot3d/src/qwt3d_surfaceplot.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_surfaceplot.cpp 2009-12-08 18:06:27 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_surfaceplot.cpp 1970-01-01 00:00:00 +0000 @@ -1,183 +0,0 @@ -#include "qwt3d_surfaceplot.h" - -using namespace std; -using namespace Qwt3D; - -/** -Initializes with dataNormals()==false, NOFLOOR, resolution() == 1 -*/ -#if QT_VERSION < 0x040000 -SurfacePlot::SurfacePlot( QWidget* parent, const char* name ) - : Plot3D( parent, name ) -#else -SurfacePlot::SurfacePlot( QWidget * parent, const QGLWidget * shareWidget) - : Plot3D( parent, shareWidget) -#endif -{ - datanormals_p = false; - normalLength_p = 0.02; - normalQuality_p = 3; - - resolution_p = 1; - actualDataG_ = new GridData(); - actualDataC_ = new CellData(); - - actualData_p = actualDataG_; - - floorstyle_ = NOFLOOR; -} - -SurfacePlot::~SurfacePlot() -{ - delete actualDataG_; - delete actualDataC_; -} - -void SurfacePlot::showNormals(bool b) -{ - datanormals_p = b; -} - -/** -Values < 0 or > 1 are ignored -*/ -void SurfacePlot::setNormalLength(double val) -{ - if (val<0 || val>1) - return; - normalLength_p = val; -} - -/** -Values < 3 are ignored -*/ -void SurfacePlot::setNormalQuality(int val) -{ - if (val<3) - return; - normalQuality_p = val; -} - -/** - Calculates the smallest x-y-z parallelepiped enclosing the data. - It can be accessed by hull(); -*/ -void SurfacePlot::calculateHull() -{ - if (actualData_p->empty()) - return; - setHull(actualData_p->hull()); -} - -/*! - Sets data resolution (res == 1 original resolution) and updates widget - If res < 1, the function does nothing -*/ -void SurfacePlot::setResolution( int res ) -{ - if (!actualData_p || actualData_p->datatype == Qwt3D::POLYGON) - return; - - if ((resolution_p == res) || res < 1) - return; - - resolution_p = res; - updateNormals(); - updateData(); - if (initializedGL()) - updateGL(); - - emit resolutionChanged(res); -} - -void SurfacePlot::updateNormals() -{ - SaveGlDeleteLists(displaylists_p[NormalObject], 1); - - if (plotStyle() == NOPLOT && !normals() || !actualData_p) - return; - - displaylists_p[NormalObject] = glGenLists(1); - glNewList(displaylists_p[NormalObject], GL_COMPILE); - - if (actualData_p->datatype == Qwt3D::POLYGON) - createNormalsC(); - else if (actualData_p->datatype == Qwt3D::GRID) - createNormalsG(); - - glEndList(); -} - -void SurfacePlot::createData() -{ - if (!actualData_p) - return; - if (actualData_p->datatype == Qwt3D::POLYGON) - createDataC(); - else if (actualData_p->datatype == Qwt3D::GRID) - createDataG(); -} - - -void SurfacePlot::createFloorData() -{ - if (!actualData_p) - return; - if (actualData_p->datatype == Qwt3D::POLYGON) - createFloorDataC(); - else if (actualData_p->datatype == Qwt3D::GRID) - createFloorDataG(); -} - -/** - The returned value is not affected by resolution(). The pair gives (columns,rows) for grid data -, (number of cells,1) for free formed data (datatype() == POLYGON) and (0,0) else -*/ -pair SurfacePlot::facets() const -{ - if (!hasData()) - return pair(0,0); - - if (actualData_p->datatype == Qwt3D::POLYGON) - return pair(int(actualDataC_->cells.size()), 1); - else if (actualData_p->datatype == Qwt3D::GRID) - return pair(actualDataG_->columns(), actualDataG_->rows()); - else - return pair(0,0); -} - -void SurfacePlot::createPoints() -{ - Dot pt; - createEnrichment(pt); -} - -void SurfacePlot::createEnrichment(Enrichment& p) -{ - if (!actualData_p) - return; - - //todo future work - if (p.type() != Enrichment::VERTEXENRICHMENT) - return; - - p.assign(*this); - p.drawBegin(); - - VertexEnrichment* ve = (VertexEnrichment*)&p; - if (actualData_p->datatype == Qwt3D::POLYGON) - { - for (unsigned i = 0; i != actualDataC_->normals.size(); ++i) - ve->draw(actualDataC_->nodes[i]); - } - else if (actualData_p->datatype == Qwt3D::GRID) - { - int step = resolution(); - for (int i = 0; i <= actualDataG_->columns() - step; i += step) - for (int j = 0; j <= actualDataG_->rows() - step; j += step) - ve->draw(Triple(actualDataG_->vertices[i][j][0], - actualDataG_->vertices[i][j][1], - actualDataG_->vertices[i][j][2])); - } - p.drawEnd(); -} === added file '3rdparty/qwtplot3d/src/qwt3d_types.cpp' --- 3rdparty/qwtplot3d/src/qwt3d_types.cpp 1970-01-01 00:00:00 +0000 +++ 3rdparty/qwtplot3d/src/qwt3d_types.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,218 @@ +#if defined(_MSC_VER) /* MSVC Compiler */ +#pragma warning ( disable : 4786 ) +#endif + +#include // qsort +#include +#include +#include "qwt3d_types.h" + +using namespace Qwt3D; + +#ifndef QWT3D_NOT_FOR_DOXYGEN + +namespace { + // convex hull + + typedef double coordinate_type; + + int ccw(coordinate_type **P, int i, int j, int k) { + coordinate_type a = P[i][0] - P[j][0], + b = P[i][1] - P[j][1], + c = P[k][0] - P[j][0], + d = P[k][1] - P[j][1]; + return a*d - b*c <= 0; /* true if points i, j, k counterclockwise */ + } + + +#define CMPM(c,A,B) \ + v = (*(coordinate_type**)A)[c] - (*(coordinate_type**)B)[c];\ + if (v>0) return 1;\ + if (v<0) return -1; + + int cmpl(const void *a, const void *b) { + double v; + CMPM(0,a,b); + CMPM(1,b,a); + return 0; + } + + int cmph(const void *a, const void *b) {return cmpl(b,a);} + + + int make_chain(coordinate_type** V, int n, int (*cmp)(const void*, const void*)) { + int i, j, s = 1; + coordinate_type* t; + + qsort(V, n, sizeof(coordinate_type*), cmp); + for (i=2; i=1 && ccw(V, i, j, j-1); j--){} + s = j+1; + t = V[s]; V[s] = V[i]; V[i] = t; + } + return s; + } + + int _ch2d(coordinate_type **P, int n) { + int u = make_chain(P, n, cmpl); /* make lower hull */ + if (!n) return 0; + P[n] = P[0]; + return u+make_chain(P+u, n-u+1, cmph); /* make upper hull */ + } + + +} // ns anon + + +GridData::GridData() +{ + datatype = Qwt3D::GRID; + setSize(0,0); + setPeriodic(false,false); +} + +GridData::GridData(unsigned int columns, unsigned int rows) +{ + datatype = Qwt3D::GRID; + setSize(columns,rows); + setPeriodic(false,false); +} + +int GridData::columns() const +{ + return (int)vertices.size(); +} + +int GridData::rows() const +{ + return (empty()) ? 0 : (int)vertices[0].size(); +} + +void GridData::clear() +{ + setHull(ParallelEpiped()); + { + for (unsigned i=0; i!=vertices.size(); ++i) + { + for (unsigned j=0; j!=vertices[i].size(); ++j) + { + delete [] vertices[i][j]; + } + vertices[i].clear(); + } + } + + vertices.clear(); + + { + for (unsigned i=0; i!=normals.size(); ++i) + { + for (unsigned j=0; j!=normals[i].size(); ++j) + { + delete [] normals[i][j]; + } + normals[i].clear(); + } + } + + normals.clear(); +} + + +void GridData::setSize(unsigned int columns, unsigned int rows) +{ + this->clear(); + vertices = std::vector(columns); + for (unsigned int i=0; i!=vertices.size(); ++i) + { + vertices[i] = DataRow(rows); + for (unsigned int j=0; j!=vertices[i].size(); ++j) + { + vertices[i][j] = new GLdouble[3]; + } + } + normals = std::vector(columns); + for (unsigned int i=0; i!=normals.size(); ++i) + { + normals[i] = DataRow(rows); + for (unsigned int j=0; j!=normals[i].size(); ++j) + { + normals[i][j] = new GLdouble[3]; + } + } +} + +Triple const& CellData::operator()(unsigned cellnumber, unsigned vertexnumber) +{ + return nodes[cells[cellnumber][vertexnumber]]; +} + +void CellData::clear() +{ + setHull(ParallelEpiped()); + cells.clear(); + nodes.clear(); + normals.clear(); +} + +QColor Qwt3D::GL2Qt(GLdouble r, GLdouble g, GLdouble b) +{ + return QColor(round(r * 255), round(g * 255), round(b * 255)); +} + +RGBA Qwt3D::Qt2GL(QColor col) +{ + QRgb qrgb = col.rgb(); + RGBA rgba; + rgba.r = qRed(qrgb) / 255.0; + rgba.g = qGreen(qrgb) / 255.0; + rgba.b = qBlue(qrgb) / 255.0; + rgba.a = qAlpha(qrgb) / 255.0; + return rgba; +} + + +void Qwt3D::convexhull2d( std::vector& idx, const std::vector& src ) +{ + idx.clear(); + if (src.empty()) + return; + if (src.size()==1) + { + idx.push_back(0); + return; + } + coordinate_type** points = new coordinate_type*[src.size()+1] ; + coordinate_type* P = new coordinate_type[src.size()*2]; + + int i; + for (i=0; i<(int)src.size(); ++i) + { + points[i] = &P[2*i]; + points[i][0] = src[i].x; + points[i][1] = src[i].y; + } + + coordinate_type* start = points[0]; + int m = _ch2d( points, src.size() ); + idx.resize(m); + + for (i=0; i // qsort -#include -#include -#include "qwt3d_types.h" - -using namespace Qwt3D; - -#ifndef QWT3D_NOT_FOR_DOXYGEN - -namespace { - // convex hull - - typedef double coordinate_type; - - int ccw(coordinate_type **P, int i, int j, int k) { - coordinate_type a = P[i][0] - P[j][0], - b = P[i][1] - P[j][1], - c = P[k][0] - P[j][0], - d = P[k][1] - P[j][1]; - return a*d - b*c <= 0; /* true if points i, j, k counterclockwise */ - } - - -#define CMPM(c,A,B) \ - v = (*(coordinate_type**)A)[c] - (*(coordinate_type**)B)[c];\ - if (v>0) return 1;\ - if (v<0) return -1; - - int cmpl(const void *a, const void *b) { - double v; - CMPM(0,a,b); - CMPM(1,b,a); - return 0; - } - - int cmph(const void *a, const void *b) {return cmpl(b,a);} - - - int make_chain(coordinate_type** V, int n, int (*cmp)(const void*, const void*)) { - int i, j, s = 1; - coordinate_type* t; - - qsort(V, n, sizeof(coordinate_type*), cmp); - for (i=2; i=1 && ccw(V, i, j, j-1); j--){} - s = j+1; - t = V[s]; V[s] = V[i]; V[i] = t; - } - return s; - } - - int _ch2d(coordinate_type **P, int n) { - int u = make_chain(P, n, cmpl); /* make lower hull */ - if (!n) return 0; - P[n] = P[0]; - return u+make_chain(P+u, n-u+1, cmph); /* make upper hull */ - } - - -} // ns anon - - -GridData::GridData() -{ - datatype = Qwt3D::GRID; - setSize(0,0); - setPeriodic(false,false); -} - -GridData::GridData(unsigned int columns, unsigned int rows) -{ - datatype = Qwt3D::GRID; - setSize(columns,rows); - setPeriodic(false,false); -} - -int GridData::columns() const -{ - return (int)vertices.size(); -} - -int GridData::rows() const -{ - return (empty()) ? 0 : (int)vertices[0].size(); -} - -void GridData::clear() -{ - setHull(ParallelEpiped()); - { - for (unsigned i=0; i!=vertices.size(); ++i) - { - for (unsigned j=0; j!=vertices[i].size(); ++j) - { - delete [] vertices[i][j]; - } - vertices[i].clear(); - } - } - - vertices.clear(); - - { - for (unsigned i=0; i!=normals.size(); ++i) - { - for (unsigned j=0; j!=normals[i].size(); ++j) - { - delete [] normals[i][j]; - } - normals[i].clear(); - } - } - - normals.clear(); -} - - -void GridData::setSize(unsigned int columns, unsigned int rows) -{ - this->clear(); - vertices = std::vector(columns); - { - for (unsigned int i=0; i!=vertices.size(); ++i) - { - vertices[i] = DataRow(rows); - for (unsigned int j=0; j!=vertices[i].size(); ++j) - { - vertices[i][j] = new GLdouble[3]; - } - } - } - normals = std::vector(columns); - { - for (unsigned int i=0; i!=normals.size(); ++i) - { - normals[i] = DataRow(rows); - for (unsigned int j=0; j!=normals[i].size(); ++j) - { - normals[i][j] = new GLdouble[3]; - } - } - } -} - -Triple const& CellData::operator()(unsigned cellnumber, unsigned vertexnumber) -{ - return nodes[cells[cellnumber][vertexnumber]]; -} - -void CellData::clear() -{ - setHull(ParallelEpiped()); - cells.clear(); - nodes.clear(); - normals.clear(); -} - -QColor Qwt3D::GL2Qt(GLdouble r, GLdouble g, GLdouble b) -{ - return QColor(round(r * 255), round(g * 255), round(b * 255)); -} - -RGBA Qwt3D::Qt2GL(QColor col) -{ - QRgb qrgb = col.rgb(); - RGBA rgba; - rgba.r = qRed(qrgb) / 255.0; - rgba.g = qGreen(qrgb) / 255.0; - rgba.b = qBlue(qrgb) / 255.0; - rgba.a = qAlpha(qrgb) / 255.0; - return rgba; -} - - -void Qwt3D::convexhull2d( std::vector& idx, const std::vector& src ) -{ - idx.clear(); - if (src.empty()) - return; - if (src.size()==1) - { - idx.push_back(0); - return; - } - coordinate_type** points = new coordinate_type*[src.size()+1] ; - coordinate_type* P = new coordinate_type[src.size()*2]; - - int i; - for (i=0; i<(int)src.size(); ++i) - { - points[i] = &P[2*i]; - points[i][0] = src[i].x; - points[i][1] = src[i].y; - } - - coordinate_type* start = points[0]; - int m = _ch2d( points, src.size() ); - idx.resize(m); - - for (i=0; i -#include "zlib.h" - -#ifdef STDC -# include -# include -#endif - -#ifdef USE_MMAP -# include -# include -# include -#endif - -#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) -# include -# include -# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) -#else -# define SET_BINARY_MODE(file) -#endif - -#ifdef VMS -# define unlink delete -# define GZ_SUFFIX "-gz" -#endif -#ifdef RISCOS -# define unlink remove -# define GZ_SUFFIX "-gz" -# define fileno(file) file->__file -#endif -#if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os -# include /* for fileno */ -#endif - -#ifndef WIN32 /* unlink already in stdio.h for WIN32 */ - extern int unlink OF((const char *)); -#endif - -#ifndef GZ_SUFFIX -# define GZ_SUFFIX ".gz" -#endif -#define SUFFIX_LEN (sizeof(GZ_SUFFIX)-1) - -#define BUFLEN 16384 -#define MAX_NAME_LEN 1024 - -#ifdef MAXSEG_64K -# define local static - /* Needed for systems with limitation on stack size. */ -#else -# define local -#endif - -char *prog; - -void error OF((const char *msg)); -void gz_compress OF((FILE *in, gzFile out)); -#ifdef USE_MMAP -int gz_compress_mmap OF((FILE *in, gzFile out)); -#endif -void gz_uncompress OF((gzFile in, FILE *out)); -void file_compress OF((char *file, char *mode)); -void file_uncompress OF((char *file)); -int main OF((int argc, char *argv[])); - -/* =========================================================================== - * Display error message and exit - */ -void error(msg) - const char *msg; -{ - fprintf(stderr, "%s: %s\n", prog, msg); - exit(1); -} - -/* =========================================================================== - * Compress input to output then close both files. - */ - -void gz_compress(in, out) - FILE *in; - gzFile out; -{ - local char buf[BUFLEN]; - int len; - int err; - -#ifdef USE_MMAP - /* Try first compressing with mmap. If mmap fails (minigzip used in a - * pipe), use the normal fread loop. - */ - if (gz_compress_mmap(in, out) == Z_OK) return; -#endif - for (;;) { - len = (int)fread(buf, 1, sizeof(buf), in); - if (ferror(in)) { - perror("fread"); - exit(1); - } - if (len == 0) break; - - if (gzwrite(out, buf, (unsigned)len) != len) error(gzerror(out, &err)); - } - fclose(in); - if (gzclose(out) != Z_OK) error("failed gzclose"); -} - -#ifdef USE_MMAP /* MMAP version, Miguel Albrecht */ - -/* Try compressing the input file at once using mmap. Return Z_OK if - * if success, Z_ERRNO otherwise. - */ -int gz_compress_mmap(in, out) - FILE *in; - gzFile out; -{ - int len; - int err; - int ifd = fileno(in); - caddr_t buf; /* mmap'ed buffer for the entire input file */ - off_t buf_len; /* length of the input file */ - struct stat sb; - - /* Determine the size of the file, needed for mmap: */ - if (fstat(ifd, &sb) < 0) return Z_ERRNO; - buf_len = sb.st_size; - if (buf_len <= 0) return Z_ERRNO; - - /* Now do the actual mmap: */ - buf = mmap((caddr_t) 0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0); - if (buf == (caddr_t)(-1)) return Z_ERRNO; - - /* Compress the whole file at once: */ - len = gzwrite(out, (char *)buf, (unsigned)buf_len); - - if (len != (int)buf_len) error(gzerror(out, &err)); - - munmap(buf, buf_len); - fclose(in); - if (gzclose(out) != Z_OK) error("failed gzclose"); - return Z_OK; -} -#endif /* USE_MMAP */ - -/* =========================================================================== - * Uncompress input to output then close both files. - */ -void gz_uncompress(in, out) - gzFile in; - FILE *out; -{ - local char buf[BUFLEN]; - int len; - int err; - - for (;;) { - len = gzread(in, buf, sizeof(buf)); - if (len < 0) error (gzerror(in, &err)); - if (len == 0) break; - - if ((int)fwrite(buf, 1, (unsigned)len, out) != len) { - error("failed fwrite"); - } - } - if (fclose(out)) error("failed fclose"); - - if (gzclose(in) != Z_OK) error("failed gzclose"); -} - - -/* =========================================================================== - * Compress the given file: create a corresponding .gz file and remove the - * original. - */ -void file_compress(file, mode) - char *file; - char *mode; -{ - local char outfile[MAX_NAME_LEN]; - FILE *in; - gzFile out; - - strcpy(outfile, file); - strcat(outfile, GZ_SUFFIX); - - in = fopen(file, "rb"); - if (in == NULL) { - perror(file); - exit(1); - } - out = gzopen(outfile, mode); - if (out == NULL) { - fprintf(stderr, "%s: can't gzopen %s\n", prog, outfile); - exit(1); - } - gz_compress(in, out); - - unlink(file); -} - - -/* =========================================================================== - * Uncompress the given file and remove the original. - */ -void file_uncompress(file) - char *file; -{ - local char buf[MAX_NAME_LEN]; - char *infile, *outfile; - FILE *out; - gzFile in; - uInt len = (uInt)strlen(file); - - strcpy(buf, file); - - if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) { - infile = file; - outfile = buf; - outfile[len-3] = '\0'; - } else { - outfile = file; - infile = buf; - strcat(infile, GZ_SUFFIX); - } - in = gzopen(infile, "rb"); - if (in == NULL) { - fprintf(stderr, "%s: can't gzopen %s\n", prog, infile); - exit(1); - } - out = fopen(outfile, "wb"); - if (out == NULL) { - perror(file); - exit(1); - } - - gz_uncompress(in, out); - - unlink(infile); -} - === removed file '3rdparty/zlib/zconf.h' --- 3rdparty/zlib/zconf.h 2009-11-18 10:33:29 +0000 +++ 3rdparty/zlib/zconf.h 1970-01-01 00:00:00 +0000 @@ -1,332 +0,0 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#ifndef ZCONF_H -#define ZCONF_H - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - */ -#ifdef Z_PREFIX -# define deflateInit_ z_deflateInit_ -# define deflate z_deflate -# define deflateEnd z_deflateEnd -# define inflateInit_ z_inflateInit_ -# define inflate z_inflate -# define inflateEnd z_inflateEnd -# define deflateInit2_ z_deflateInit2_ -# define deflateSetDictionary z_deflateSetDictionary -# define deflateCopy z_deflateCopy -# define deflateReset z_deflateReset -# define deflateParams z_deflateParams -# define deflateBound z_deflateBound -# define deflatePrime z_deflatePrime -# define inflateInit2_ z_inflateInit2_ -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateCopy z_inflateCopy -# define inflateReset z_inflateReset -# define inflateBack z_inflateBack -# define inflateBackEnd z_inflateBackEnd -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# define uncompress z_uncompress -# define adler32 z_adler32 -# define crc32 z_crc32 -# define get_crc_table z_get_crc_table -# define zError z_zError - -# define alloc_func z_alloc_func -# define free_func z_free_func -# define in_func z_in_func -# define out_func z_out_func -# define Byte z_Byte -# define uInt z_uInt -# define uLong z_uLong -# define Bytef z_Bytef -# define charf z_charf -# define intf z_intf -# define uIntf z_uIntf -# define uLongf z_uLongf -# define voidpf z_voidpf -# define voidp z_voidp -#endif - -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif -#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 -#endif -#if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS -#endif -#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif -#endif -#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#ifdef SYS16BIT -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif -#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC -#endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC -#endif -#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC -#endif -#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC -#endif - -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif -#endif - -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) -# define NO_DUMMY_DECL -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif -#endif - -#if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# ifdef ZLIB_DLL -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# include - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - -#ifndef ZEXTERN -# define ZEXTERN extern -#endif -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */ -# include /* for off_t */ -# include /* for SEEK_* and off_t */ -# ifdef VMS -# include /* for off_t */ -# endif -# define z_off_t off_t -#endif -#ifndef SEEK_SET -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif -#ifndef z_off_t -# define z_off_t long -#endif - -#if defined(__OS400__) -# define NO_vsnprintf -#endif - -#if defined(__MVS__) -# define NO_vsnprintf -# ifdef FAR -# undef FAR -# endif -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) -# pragma map(deflateInit_,"DEIN") -# pragma map(deflateInit2_,"DEIN2") -# pragma map(deflateEnd,"DEEND") -# pragma map(deflateBound,"DEBND") -# pragma map(inflateInit_,"ININ") -# pragma map(inflateInit2_,"ININ2") -# pragma map(inflateEnd,"INEND") -# pragma map(inflateSync,"INSY") -# pragma map(inflateSetDictionary,"INSEDI") -# pragma map(compressBound,"CMBND") -# pragma map(inflate_table,"INTABL") -# pragma map(inflate_fast,"INFA") -# pragma map(inflate_copyright,"INCOPY") -#endif - -#endif /* ZCONF_H */ === removed file '3rdparty/zlib/zlib.h' --- 3rdparty/zlib/zlib.h 2009-11-18 10:33:29 +0000 +++ 3rdparty/zlib/zlib.h 1970-01-01 00:00:00 +0000 @@ -1,1357 +0,0 @@ -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.3, July 18th, 2005 - - Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt - (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). -*/ - -#ifndef ZLIB_H -#define ZLIB_H - -#include "zconf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ZLIB_VERSION "1.2.3" -#define ZLIB_VERNUM 0x1230 - -/* - The 'zlib' compression library provides in-memory compression and - decompression functions, including integrity checks of the uncompressed - data. This version of the library supports only one compression method - (deflation) but other algorithms will be added later and will have the same - stream interface. - - Compression can be done in a single step if the buffers are large - enough (for example if an input file is mmap'ed), or can be done by - repeated calls of the compression function. In the latter case, the - application must provide more input and/or consume the output - (providing more output space) before each call. - - The compressed data format used by default by the in-memory functions is - the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped - around a deflate stream, which is itself documented in RFC 1951. - - The library also supports reading and writing files in gzip (.gz) format - with an interface similar to that of stdio using the functions that start - with "gz". The gzip format is different from the zlib format. gzip is a - gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. - - This library can optionally read and write gzip streams in memory as well. - - The zlib format was designed to be compact and fast for use in memory - and on communications channels. The gzip format was designed for single- - file compression on file systems, has a larger header than zlib to maintain - directory information, and uses a different, slower check method than zlib. - - The library does not install any signal handler. The decoder checks - the consistency of the compressed data, so the library should never - crash even in case of corrupted input. -*/ - -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); - -struct internal_state; - -typedef struct z_stream_s { - Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total nb of input bytes read so far */ - - Bytef *next_out; /* next output byte should be put there */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total nb of bytes output so far */ - - char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ - - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ - voidpf opaque; /* private data object passed to zalloc and zfree */ - - int data_type; /* best guess about the data type: binary or text */ - uLong adler; /* adler32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ -} z_stream; - -typedef z_stream FAR *z_streamp; - -/* - gzip header information passed to and from zlib routines. See RFC 1952 - for more details on the meanings of these fields. -*/ -typedef struct gz_header_s { - int text; /* true if compressed data believed to be text */ - uLong time; /* modification time */ - int xflags; /* extra flags (not used when writing a gzip file) */ - int os; /* operating system */ - Bytef *extra; /* pointer to extra field or Z_NULL if none */ - uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ - uInt extra_max; /* space at extra (only when reading header) */ - Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ - uInt name_max; /* space at name (only when reading header) */ - Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ - uInt comm_max; /* space at comment (only when reading header) */ - int hcrc; /* true if there was or will be a header crc */ - int done; /* true when done reading gzip header (not used - when writing a gzip file) */ -} gz_header; - -typedef gz_header FAR *gz_headerp; - -/* - The application must update next_in and avail_in when avail_in has - dropped to zero. It must update next_out and avail_out when avail_out - has dropped to zero. The application must initialize zalloc, zfree and - opaque before calling the init function. All other fields are set by the - compression library and must not be updated by the application. - - The opaque value provided by the application will be passed as the first - parameter for calls of zalloc and zfree. This can be useful for custom - memory management. The compression library attaches no meaning to the - opaque value. - - zalloc must return Z_NULL if there is not enough memory for the object. - If zlib is used in a multi-threaded application, zalloc and zfree must be - thread safe. - - On 16-bit systems, the functions zalloc and zfree must be able to allocate - exactly 65536 bytes, but will not be required to allocate more than this - if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, - pointers returned by zalloc for objects of exactly 65536 bytes *must* - have their offset normalized to zero. The default allocation function - provided by this library ensures this (see zutil.c). To reduce memory - requirements and avoid any allocation of 64K objects, at the expense of - compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). - - The fields total_in and total_out can be used for statistics or - progress reports. After compression, total_in holds the total size of - the uncompressed data and may be saved for use in the decompressor - (particularly if the decompressor wants to decompress everything in - a single step). -*/ - - /* constants */ - -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -#define Z_BLOCK 5 -/* Allowed flush values; see deflate() and inflate() below for details */ - -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) -/* Return codes for the compression/decompression functions. Negative - * values are errors, positive values are used for special but normal events. - */ - -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) -/* compression levels */ - -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_RLE 3 -#define Z_FIXED 4 -#define Z_DEFAULT_STRATEGY 0 -/* compression strategy; see deflateInit2() below for details */ - -#define Z_BINARY 0 -#define Z_TEXT 1 -#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ -#define Z_UNKNOWN 2 -/* Possible values of the data_type field (though see inflate()) */ - -#define Z_DEFLATED 8 -/* The deflate compression method (the only one supported in this version) */ - -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ - -#define zlib_version zlibVersion() -/* for compatibility with versions < 1.0.2 */ - - /* basic functions */ - -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); -/* The application can compare zlibVersion and ZLIB_VERSION for consistency. - If the first character differs, the library code actually used is - not compatible with the zlib.h header file used by the application. - This check is automatically made by deflateInit and inflateInit. - */ - -/* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); - - Initializes the internal stream state for compression. The fields - zalloc, zfree and opaque must be initialized before by the caller. - If zalloc and zfree are set to Z_NULL, deflateInit updates them to - use default allocation functions. - - The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: - 1 gives best speed, 9 gives best compression, 0 gives no compression at - all (the input data is simply copied a block at a time). - Z_DEFAULT_COMPRESSION requests a default compromise between speed and - compression (currently equivalent to level 6). - - deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if level is not a valid compression level, - Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible - with the version assumed by the caller (ZLIB_VERSION). - msg is set to null if there is no error message. deflateInit does not - perform any compression: this will be done by deflate(). -*/ - - -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); -/* - deflate compresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce some - output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. deflate performs one or both of the - following actions: - - - Compress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in and avail_in are updated and - processing will resume at this point for the next call of deflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. This action is forced if the parameter flush is non zero. - Forcing flush frequently degrades the compression ratio, so this parameter - should be set only when necessary (in interactive applications). - Some output may be provided even if flush is not set. - - Before the call of deflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating avail_in or avail_out accordingly; avail_out - should never be zero before the call. The application can consume the - compressed output when it wants, for example when the output buffer is full - (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK - and with zero avail_out, it must be called again after making room in the - output buffer because there might be more output pending. - - Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to - decide how much data to accumualte before producing output, in order to - maximize compression. - - If the parameter flush is set to Z_SYNC_FLUSH, all pending output is - flushed to the output buffer and the output is aligned on a byte boundary, so - that the decompressor can get all input data available so far. (In particular - avail_in is zero after the call if enough output space has been provided - before the call.) Flushing may degrade compression for some compression - algorithms and so it should be used only when necessary. - - If flush is set to Z_FULL_FLUSH, all output is flushed as with - Z_SYNC_FLUSH, and the compression state is reset so that decompression can - restart from this point if previous compressed data has been damaged or if - random access is desired. Using Z_FULL_FLUSH too often can seriously degrade - compression. - - If deflate returns with avail_out == 0, this function must be called again - with the same value of the flush parameter and more output space (updated - avail_out), until the flush is complete (deflate returns with non-zero - avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six to avoid repeated flush markers due to - avail_out == 0 on return. - - If the parameter flush is set to Z_FINISH, pending input is processed, - pending output is flushed and deflate returns with Z_STREAM_END if there - was enough output space; if deflate returns with Z_OK, this function must be - called again with Z_FINISH and more output space (updated avail_out) but no - more input data, until it returns with Z_STREAM_END or an error. After - deflate has returned Z_STREAM_END, the only possible operations on the - stream are deflateReset or deflateEnd. - - Z_FINISH can be used immediately after deflateInit if all the compression - is to be done in a single step. In this case, avail_out must be at least - the value returned by deflateBound (see below). If deflate does not return - Z_STREAM_END, then it must be called again as described above. - - deflate() sets strm->adler to the adler32 checksum of all input read - so far (that is, total_in bytes). - - deflate() may update strm->data_type if it can make a good guess about - the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered - binary. This field is only for information purposes and does not affect - the compression algorithm in any manner. - - deflate() returns Z_OK if some progress has been made (more input - processed or more output produced), Z_STREAM_END if all input has been - consumed and all output has been produced (only when flush is set to - Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible - (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not - fatal, and deflate() can be called again with more input and more output - space to continue compressing. -*/ - - -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the - stream state was inconsistent, Z_DATA_ERROR if the stream was freed - prematurely (some input or output was discarded). In the error case, - msg may be set but then points to a static string (which must not be - deallocated). -*/ - - -/* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); - - Initializes the internal stream state for decompression. The fields - next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. If next_in is not Z_NULL and avail_in is large enough (the exact - value depends on the compression method), inflateInit determines the - compression method from the zlib header and allocates all data structures - accordingly; otherwise the allocation will be deferred to the first call of - inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to - use default allocation functions. - - inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller. msg is set to null if there is no error - message. inflateInit does not perform any decompression apart from reading - the zlib header if present: this will be done by inflate(). (So next_in and - avail_in may be modified, but next_out and avail_out are unchanged.) -*/ - - -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); -/* - inflate decompresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. inflate performs one or both of the - following actions: - - - Decompress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in is updated and processing - will resume at this point for the next call of inflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. inflate() provides as much output as possible, until there - is no more input data or no more space in the output buffer (see below - about the flush parameter). - - Before the call of inflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating the next_* and avail_* values accordingly. - The application can consume the uncompressed output when it wants, for - example when the output buffer is full (avail_out == 0), or after each - call of inflate(). If inflate returns Z_OK and with zero avail_out, it - must be called again after making room in the output buffer because there - might be more output pending. - - The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, - Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much - output as possible to the output buffer. Z_BLOCK requests that inflate() stop - if and when it gets to the next deflate block boundary. When decoding the - zlib or gzip format, this will cause inflate() to return immediately after - the header and before the first block. When doing a raw inflate, inflate() - will go ahead and process the first block, and will return when it gets to - the end of that block, or when it runs out of data. - - The Z_BLOCK option assists in appending to or combining deflate streams. - Also to assist in this, on return inflate() will set strm->data_type to the - number of unused bits in the last byte taken from strm->next_in, plus 64 - if inflate() is currently decoding the last block in the deflate stream, - plus 128 if inflate() returned immediately after decoding an end-of-block - code or decoding the complete header up to just before the first byte of the - deflate stream. The end-of-block will not be indicated until all of the - uncompressed data from that block has been written to strm->next_out. The - number of unused bits may in general be greater than seven, except when - bit 7 of data_type is set, in which case the number of unused bits will be - less than eight. - - inflate() should normally be called until it returns Z_STREAM_END or an - error. However if all decompression is to be performed in a single step - (a single call of inflate), the parameter flush should be set to - Z_FINISH. In this case all pending input is processed and all pending - output is flushed; avail_out must be large enough to hold all the - uncompressed data. (The size of the uncompressed data may have been saved - by the compressor for this purpose.) The next operation on this stream must - be inflateEnd to deallocate the decompression state. The use of Z_FINISH - is never required, but can be used to inform inflate that a faster approach - may be used for the single inflate() call. - - In this implementation, inflate() always flushes as much output as - possible to the output buffer, and always uses the faster approach on the - first call. So the only effect of the flush parameter in this implementation - is on the return value of inflate(), as noted below, or when it returns early - because Z_BLOCK is used. - - If a preset dictionary is needed after this call (see inflateSetDictionary - below), inflate sets strm->adler to the adler32 checksum of the dictionary - chosen by the compressor and returns Z_NEED_DICT; otherwise it sets - strm->adler to the adler32 checksum of all output produced so far (that is, - total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described - below. At the end of the stream, inflate() checks that its computed adler32 - checksum is equal to that saved by the compressor and returns Z_STREAM_END - only if the checksum is correct. - - inflate() will decompress and check either zlib-wrapped or gzip-wrapped - deflate data. The header type is detected automatically. Any information - contained in the gzip header is not retained, so applications that need that - information should instead use raw inflate, see inflateInit2() below, or - inflateBack() and perform their own processing of the gzip header and - trailer. - - inflate() returns Z_OK if some progress has been made (more input processed - or more output produced), Z_STREAM_END if the end of the compressed data has - been reached and all uncompressed output has been produced, Z_NEED_DICT if a - preset dictionary is needed at this point, Z_DATA_ERROR if the input data was - corrupted (input stream not conforming to the zlib format or incorrect check - value), Z_STREAM_ERROR if the stream structure was inconsistent (for example - if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory, - Z_BUF_ERROR if no progress is possible or if there was not enough room in the - output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and - inflate() can be called again with more input and more output space to - continue decompressing. If Z_DATA_ERROR is returned, the application may then - call inflateSync() to look for a good compression block if a partial recovery - of the data is desired. -*/ - - -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state - was inconsistent. In the error case, msg may be set but then points to a - static string (which must not be deallocated). -*/ - - /* Advanced functions */ - -/* - The following functions are needed only in some special applications. -*/ - -/* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); - - This is another version of deflateInit with more compression options. The - fields next_in, zalloc, zfree and opaque must be initialized before by - the caller. - - The method parameter is the compression method. It must be Z_DEFLATED in - this version of the library. - - The windowBits parameter is the base two logarithm of the window size - (the size of the history buffer). It should be in the range 8..15 for this - version of the library. Larger values of this parameter result in better - compression at the expense of memory usage. The default value is 15 if - deflateInit is used instead. - - windowBits can also be -8..-15 for raw deflate. In this case, -windowBits - determines the window size. deflate() will then generate raw deflate data - with no zlib header or trailer, and will not compute an adler32 check value. - - windowBits can also be greater than 15 for optional gzip encoding. Add - 16 to windowBits to write a simple gzip header and trailer around the - compressed data instead of a zlib wrapper. The gzip header will have no - file name, no extra data, no comment, no modification time (set to zero), - no header crc, and the operating system will be set to 255 (unknown). If a - gzip stream is being written, strm->adler is a crc32 instead of an adler32. - - The memLevel parameter specifies how much memory should be allocated - for the internal compression state. memLevel=1 uses minimum memory but - is slow and reduces compression ratio; memLevel=9 uses maximum memory - for optimal speed. The default value is 8. See zconf.h for total memory - usage as a function of windowBits and memLevel. - - The strategy parameter is used to tune the compression algorithm. Use the - value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a - filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no - string match), or Z_RLE to limit match distances to one (run-length - encoding). Filtered data consists mostly of small values with a somewhat - random distribution. In this case, the compression algorithm is tuned to - compress them better. The effect of Z_FILTERED is to force more Huffman - coding and less string matching; it is somewhat intermediate between - Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as - Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy - parameter only affects the compression ratio but not the correctness of the - compressed output even if it is not set appropriately. Z_FIXED prevents the - use of dynamic Huffman codes, allowing for a simpler decoder for special - applications. - - deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid - method). msg is set to null if there is no error message. deflateInit2 does - not perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the compression dictionary from the given byte sequence - without producing any compressed output. This function must be called - immediately after deflateInit, deflateInit2 or deflateReset, before any - call of deflate. The compressor and decompressor must use exactly the same - dictionary (see inflateSetDictionary). - - The dictionary should consist of strings (byte sequences) that are likely - to be encountered later in the data to be compressed, with the most commonly - used strings preferably put towards the end of the dictionary. Using a - dictionary is most useful when the data to be compressed is short and can be - predicted with good accuracy; the data can then be compressed better than - with the default empty dictionary. - - Depending on the size of the compression data structures selected by - deflateInit or deflateInit2, a part of the dictionary may in effect be - discarded, for example if the dictionary is larger than the window size in - deflate or deflate2. Thus the strings most likely to be useful should be - put at the end of the dictionary, not at the front. In addition, the - current implementation of deflate will use at most the window size minus - 262 bytes of the provided dictionary. - - Upon return of this function, strm->adler is set to the adler32 value - of the dictionary; the decompressor may later use this value to determine - which dictionary has been used by the compressor. (The adler32 value - applies to the whole dictionary even if only a subset of the dictionary is - actually used by the compressor.) If a raw deflate was requested, then the - adler32 value is not computed and strm->adler is not set. - - deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent (for example if deflate has already been called for this stream - or if the compression method is bsort). deflateSetDictionary does not - perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when several compression strategies will be - tried, for example when there are several ways of pre-processing the input - data with a filter. The streams that will be discarded should then be freed - by calling deflateEnd. Note that deflateCopy duplicates the internal - compression state which can be quite large, so this strategy is slow and - can consume lots of memory. - - deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); -/* - This function is equivalent to deflateEnd followed by deflateInit, - but does not free and reallocate all the internal compression state. - The stream will keep the same compression level and any other attributes - that may have been set by deflateInit2. - - deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - int level, - int strategy)); -/* - Dynamically update the compression level and compression strategy. The - interpretation of level and strategy is as in deflateInit2. This can be - used to switch between compression and straight copy of the input data, or - to switch to a different kind of input data requiring a different - strategy. If the compression level is changed, the input available so far - is compressed with the old level (and may be flushed); the new level will - take effect only at the next call of deflate(). - - Before the call of deflateParams, the stream state must be set as for - a call of deflate(), since the currently available input may have to - be compressed and flushed. In particular, strm->avail_out must be non-zero. - - deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source - stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR - if strm->avail_out was zero. -*/ - -ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, - int good_length, - int max_lazy, - int nice_length, - int max_chain)); -/* - Fine tune deflate's internal compression parameters. This should only be - used by someone who understands the algorithm used by zlib's deflate for - searching for the best matching string, and even then only by the most - fanatic optimizer trying to squeeze out the last compressed bit for their - specific input data. Read the deflate.c source code for the meaning of the - max_lazy, good_length, nice_length, and max_chain parameters. - - deflateTune() can be called after deflateInit() or deflateInit2(), and - returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. - */ - -ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, - uLong sourceLen)); -/* - deflateBound() returns an upper bound on the compressed size after - deflation of sourceLen bytes. It must be called after deflateInit() - or deflateInit2(). This would be used to allocate an output buffer - for deflation in a single pass, and so would be called before deflate(). -*/ - -ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - deflatePrime() inserts bits in the deflate output stream. The intent - is that this function is used to start off the deflate output with the - bits leftover from a previous deflate stream when appending to it. As such, - this function can only be used for raw deflate, and must be used before the - first deflate() call after a deflateInit2() or deflateReset(). bits must be - less than or equal to 16, and that many of the least significant bits of - value will be inserted in the output. - - deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, - gz_headerp head)); -/* - deflateSetHeader() provides gzip header information for when a gzip - stream is requested by deflateInit2(). deflateSetHeader() may be called - after deflateInit2() or deflateReset() and before the first call of - deflate(). The text, time, os, extra field, name, and comment information - in the provided gz_header structure are written to the gzip header (xflag is - ignored -- the extra flags are set according to the compression level). The - caller must assure that, if not Z_NULL, name and comment are terminated with - a zero byte, and that if extra is not Z_NULL, that extra_len bytes are - available there. If hcrc is true, a gzip header crc is included. Note that - the current versions of the command-line version of gzip (up through version - 1.3.x) do not support header crc's, and will report that it is a "multi-part - gzip file" and give up. - - If deflateSetHeader is not used, the default gzip header has text false, - the time set to zero, and os set to 255, with no extra, name, or comment - fields. The gzip header is returned to the default state by deflateReset(). - - deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, - int windowBits)); - - This is another version of inflateInit with an extra parameter. The - fields next_in, avail_in, zalloc, zfree and opaque must be initialized - before by the caller. - - The windowBits parameter is the base two logarithm of the maximum window - size (the size of the history buffer). It should be in the range 8..15 for - this version of the library. The default value is 15 if inflateInit is used - instead. windowBits must be greater than or equal to the windowBits value - provided to deflateInit2() while compressing, or it must be equal to 15 if - deflateInit2() was not used. If a compressed stream with a larger window - size is given as input, inflate() will return with the error code - Z_DATA_ERROR instead of trying to allocate a larger window. - - windowBits can also be -8..-15 for raw inflate. In this case, -windowBits - determines the window size. inflate() will then process raw deflate data, - not looking for a zlib or gzip header, not generating a check value, and not - looking for any check values for comparison at the end of the stream. This - is for use with other formats that use the deflate compressed data format - such as zip. Those formats provide their own check values. If a custom - format is developed using the raw deflate format for compressed data, it is - recommended that a check value such as an adler32 or a crc32 be applied to - the uncompressed data as is done in the zlib, gzip, and zip formats. For - most applications, the zlib format should be used as is. Note that comments - above on the use in deflateInit2() applies to the magnitude of windowBits. - - windowBits can also be greater than 15 for optional gzip decoding. Add - 32 to windowBits to enable zlib and gzip decoding with automatic header - detection, or add 16 to decode only the gzip format (the zlib format will - return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is - a crc32 instead of an adler32. - - inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg - is set to null if there is no error message. inflateInit2 does not perform - any decompression apart from reading the zlib header if present: this will - be done by inflate(). (So next_in and avail_in may be modified, but next_out - and avail_out are unchanged.) -*/ - -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the decompression dictionary from the given uncompressed byte - sequence. This function must be called immediately after a call of inflate, - if that call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the adler32 value returned by that call of inflate. - The compressor and decompressor must use exactly the same dictionary (see - deflateSetDictionary). For raw inflate, this function can be called - immediately after inflateInit2() or inflateReset() and before any call of - inflate() to set the dictionary. The application must insure that the - dictionary that was used for compression is provided. - - inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the - expected one (incorrect adler32 value). inflateSetDictionary does not - perform any decompression: this will be done by subsequent calls of - inflate(). -*/ - -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); -/* - Skips invalid compressed data until a full flush point (see above the - description of deflate with Z_FULL_FLUSH) can be found, or until all - available input is skipped. No output is provided. - - inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR - if no more input was provided, Z_DATA_ERROR if no flush point has been found, - or Z_STREAM_ERROR if the stream structure was inconsistent. In the success - case, the application may save the current current value of total_in which - indicates where valid compressed data was found. In the error case, the - application may repeatedly call inflateSync, providing more input each time, - until success or end of the input data. -*/ - -ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when randomly accessing a large stream. The - first pass through the stream can periodically record the inflate state, - allowing restarting inflate at those points when randomly accessing the - stream. - - inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); -/* - This function is equivalent to inflateEnd followed by inflateInit, - but does not free and reallocate all the internal decompression state. - The stream will keep attributes that may have been set by inflateInit2. - - inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - -ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - This function inserts bits in the inflate input stream. The intent is - that this function is used to start inflating at a bit position in the - middle of a byte. The provided bits will be used before any bytes are used - from next_in. This function should only be used with raw inflate, and - should be used before the first inflate() call after inflateInit2() or - inflateReset(). bits must be less than or equal to 16, and that many of the - least significant bits of value will be inserted in the input. - - inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, - gz_headerp head)); -/* - inflateGetHeader() requests that gzip header information be stored in the - provided gz_header structure. inflateGetHeader() may be called after - inflateInit2() or inflateReset(), and before the first call of inflate(). - As inflate() processes the gzip stream, head->done is zero until the header - is completed, at which time head->done is set to one. If a zlib stream is - being decoded, then head->done is set to -1 to indicate that there will be - no gzip header information forthcoming. Note that Z_BLOCK can be used to - force inflate() to return immediately after header processing is complete - and before any actual data is decompressed. - - The text, time, xflags, and os fields are filled in with the gzip header - contents. hcrc is set to true if there is a header CRC. (The header CRC - was valid if done is set to one.) If extra is not Z_NULL, then extra_max - contains the maximum number of bytes to write to extra. Once done is true, - extra_len contains the actual extra field length, and extra contains the - extra field, or that field truncated if extra_max is less than extra_len. - If name is not Z_NULL, then up to name_max characters are written there, - terminated with a zero unless the length is greater than name_max. If - comment is not Z_NULL, then up to comm_max characters are written there, - terminated with a zero unless the length is greater than comm_max. When - any of extra, name, or comment are not Z_NULL and the respective field is - not present in the header, then that field is set to Z_NULL to signal its - absence. This allows the use of deflateSetHeader() with the returned - structure to duplicate the header. However if those fields are set to - allocated memory, then the application will need to save those pointers - elsewhere so that they can be eventually freed. - - If inflateGetHeader is not used, then the header information is simply - discarded. The header is always checked for validity, including the header - CRC if present. inflateReset() will reset the process to discard the header - information. The application would need to call inflateGetHeader() again to - retrieve the header from the next gzip stream. - - inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); - - Initialize the internal stream state for decompression using inflateBack() - calls. The fields zalloc, zfree and opaque in strm must be initialized - before the call. If zalloc and zfree are Z_NULL, then the default library- - derived memory allocation routines are used. windowBits is the base two - logarithm of the window size, in the range 8..15. window is a caller - supplied buffer of that size. Except for special applications where it is - assured that deflate was used with small window sizes, windowBits must be 15 - and a 32K byte window must be supplied to be able to decompress general - deflate streams. - - See inflateBack() for the usage of these routines. - - inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of - the paramaters are invalid, Z_MEM_ERROR if the internal state could not - be allocated, or Z_VERSION_ERROR if the version of the library does not - match the version of the header file. -*/ - -typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); -typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); - -ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); -/* - inflateBack() does a raw inflate with a single call using a call-back - interface for input and output. This is more efficient than inflate() for - file i/o applications in that it avoids copying between the output and the - sliding window by simply making the window itself the output buffer. This - function trusts the application to not change the output buffer passed by - the output function, at least until inflateBack() returns. - - inflateBackInit() must be called first to allocate the internal state - and to initialize the state with the user-provided window buffer. - inflateBack() may then be used multiple times to inflate a complete, raw - deflate stream with each call. inflateBackEnd() is then called to free - the allocated state. - - A raw deflate stream is one with no zlib or gzip header or trailer. - This routine would normally be used in a utility that reads zip or gzip - files and writes out uncompressed files. The utility would decode the - header and process the trailer on its own, hence this routine expects - only the raw deflate stream to decompress. This is different from the - normal behavior of inflate(), which expects either a zlib or gzip header and - trailer around the deflate stream. - - inflateBack() uses two subroutines supplied by the caller that are then - called by inflateBack() for input and output. inflateBack() calls those - routines until it reads a complete deflate stream and writes out all of the - uncompressed data, or until it encounters an error. The function's - parameters and return types are defined above in the in_func and out_func - typedefs. inflateBack() will call in(in_desc, &buf) which should return the - number of bytes of provided input, and a pointer to that input in buf. If - there is no input available, in() must return zero--buf is ignored in that - case--and inflateBack() will return a buffer error. inflateBack() will call - out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() - should return zero on success, or non-zero on failure. If out() returns - non-zero, inflateBack() will return with an error. Neither in() nor out() - are permitted to change the contents of the window provided to - inflateBackInit(), which is also the buffer that out() uses to write from. - The length written by out() will be at most the window size. Any non-zero - amount of input may be provided by in(). - - For convenience, inflateBack() can be provided input on the first call by - setting strm->next_in and strm->avail_in. If that input is exhausted, then - in() will be called. Therefore strm->next_in must be initialized before - calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called - immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in - must also be initialized, and then if strm->avail_in is not zero, input will - initially be taken from strm->next_in[0 .. strm->avail_in - 1]. - - The in_desc and out_desc parameters of inflateBack() is passed as the - first parameter of in() and out() respectively when they are called. These - descriptors can be optionally used to pass any information that the caller- - supplied in() and out() functions need to do their job. - - On return, inflateBack() will set strm->next_in and strm->avail_in to - pass back any unused input that was provided by the last in() call. The - return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR - if in() or out() returned an error, Z_DATA_ERROR if there was a format - error in the deflate stream (in which case strm->msg is set to indicate the - nature of the error), or Z_STREAM_ERROR if the stream was not properly - initialized. In the case of Z_BUF_ERROR, an input or output error can be - distinguished using strm->next_in which will be Z_NULL only if in() returned - an error. If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to - out() returning non-zero. (in() will always be called before out(), so - strm->next_in is assured to be defined if out() returns non-zero.) Note - that inflateBack() cannot return Z_OK. -*/ - -ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); -/* - All memory allocated by inflateBackInit() is freed. - - inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream - state was inconsistent. -*/ - -ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); -/* Return flags indicating compile-time options. - - Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: - 1.0: size of uInt - 3.2: size of uLong - 5.4: size of voidpf (pointer) - 7.6: size of z_off_t - - Compiler, assembler, and debug options: - 8: DEBUG - 9: ASMV or ASMINF -- use ASM code - 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention - 11: 0 (reserved) - - One-time table building (smaller code, but not thread-safe if true): - 12: BUILDFIXED -- build static block decoding tables when needed - 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed - 14,15: 0 (reserved) - - Library content (indicates missing functionality): - 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking - deflate code when not needed) - 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect - and decode gzip streams (to avoid linking crc code) - 18-19: 0 (reserved) - - Operation variations (changes in library functionality): - 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate - 21: FASTEST -- deflate algorithm with only one, lowest compression level - 22,23: 0 (reserved) - - The sprintf variant used by gzprintf (zero is best): - 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format - 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! - 26: 0 = returns value, 1 = void -- 1 means inferred string length returned - - Remainder: - 27-31: 0 (reserved) - */ - - - /* utility functions */ - -/* - The following utility functions are implemented on top of the - basic stream-oriented functions. To simplify the interface, some - default options are assumed (compression level and memory usage, - standard memory allocation functions). The source code of these - utility functions can easily be modified if you need special options. -*/ - -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be at least the value returned - by compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - This function can be used to compress a whole file at once if the - input file is mmap'ed. - compress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer. -*/ - -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); -/* - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ - -ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); -/* - compressBound() returns an upper bound on the compressed size after - compress() or compress2() on sourceLen bytes. It would be used before - a compress() or compress2() call to allocate the destination buffer. -*/ - -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be large enough to hold the - entire uncompressed data. (The size of the uncompressed data must have - been saved previously by the compressor and transmitted to the decompressor - by some mechanism outside the scope of this compression library.) - Upon exit, destLen is the actual size of the compressed buffer. - This function can be used to decompress a whole file at once if the - input file is mmap'ed. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. -*/ - - -typedef voidp gzFile; - -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); -/* - Opens a gzip (.gz) file for reading or writing. The mode parameter - is as in fopen ("rb" or "wb") but can also include a compression level - ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for - Huffman only compression as in "wb1h", or 'R' for run-length encoding - as in "wb1R". (See the description of deflateInit2 for more information - about the strategy parameter.) - - gzopen can be used to read a file which is not in gzip format; in this - case gzread will directly read from the file without decompression. - - gzopen returns NULL if the file could not be opened or if there was - insufficient memory to allocate the (de)compression state; errno - can be checked to distinguish the two cases (if errno is zero, the - zlib error is Z_MEM_ERROR). */ - -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); -/* - gzdopen() associates a gzFile with the file descriptor fd. File - descriptors are obtained from calls like open, dup, creat, pipe or - fileno (in the file has been previously opened with fopen). - The mode parameter is as in gzopen. - The next call of gzclose on the returned gzFile will also close the - file descriptor fd, just like fclose(fdopen(fd), mode) closes the file - descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). - gzdopen returns NULL if there was insufficient memory to allocate - the (de)compression state. -*/ - -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); -/* - Dynamically update the compression level or strategy. See the description - of deflateInit2 for the meaning of these parameters. - gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not - opened for writing. -*/ - -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); -/* - Reads the given number of uncompressed bytes from the compressed file. - If the input file was not in gzip format, gzread copies the given number - of bytes into the buffer. - gzread returns the number of uncompressed bytes actually read (0 for - end of file, -1 for error). */ - -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, - voidpc buf, unsigned len)); -/* - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of uncompressed bytes actually written - (0 in case of error). -*/ - -ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); -/* - Converts, formats, and writes the args to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written (0 in case of error). The number of - uncompressed bytes written is limited to 4095. The caller should assure that - this limit is not exceeded. If it is exceeded, then gzprintf() will return - return an error (0) with nothing written. In this case, there may also be a - buffer overflow with unpredictable consequences, which is possible only if - zlib was compiled with the insecure functions sprintf() or vsprintf() - because the secure snprintf() or vsnprintf() functions were not available. -*/ - -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); -/* - Writes the given null-terminated string to the compressed file, excluding - the terminating null character. - gzputs returns the number of characters written, or -1 in case of error. -*/ - -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); -/* - Reads bytes from the compressed file until len-1 characters are read, or - a newline character is read and transferred to buf, or an end-of-file - condition is encountered. The string is then terminated with a null - character. - gzgets returns buf, or Z_NULL in case of error. -*/ - -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); -/* - Writes c, converted to an unsigned char, into the compressed file. - gzputc returns the value that was written, or -1 in case of error. -*/ - -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); -/* - Reads one byte from the compressed file. gzgetc returns this byte - or -1 in case of end of file or error. -*/ - -ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); -/* - Push one character back onto the stream to be read again later. - Only one character of push-back is allowed. gzungetc() returns the - character pushed, or -1 on failure. gzungetc() will fail if a - character has been pushed but not read yet, or if c is -1. The pushed - character will be discarded if the stream is repositioned with gzseek() - or gzrewind(). -*/ - -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); -/* - Flushes all pending output into the compressed file. The parameter - flush is as in the deflate() function. The return value is the zlib - error number (see function gzerror below). gzflush returns Z_OK if - the flush parameter is Z_FINISH and all output could be flushed. - gzflush should be called only when strictly necessary because it can - degrade compression. -*/ - -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, - z_off_t offset, int whence)); -/* - Sets the starting position for the next gzread or gzwrite on the - given compressed file. The offset represents a number of bytes in the - uncompressed data stream. The whence parameter is defined as in lseek(2); - the value SEEK_END is not supported. - If the file is opened for reading, this function is emulated but can be - extremely slow. If the file is opened for writing, only forward seeks are - supported; gzseek then compresses a sequence of zeroes up to the new - starting position. - - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error, in - particular if the file is opened for writing and the new starting position - would be before the current position. -*/ - -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); -/* - Rewinds the given file. This function is supported only for reading. - - gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) -*/ - -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); -/* - Returns the starting position for the next gzread or gzwrite on the - given compressed file. This position represents a number of bytes in the - uncompressed data stream. - - gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) -*/ - -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); -/* - Returns 1 when EOF has previously been detected reading the given - input stream, otherwise zero. -*/ - -ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); -/* - Returns 1 if file is being read directly without decompression, otherwise - zero. -*/ - -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); -/* - Flushes all pending output if necessary, closes the compressed file - and deallocates all the (de)compression state. The return value is the zlib - error number (see function gzerror below). -*/ - -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); -/* - Returns the error message for the last error which occurred on the - given compressed file. errnum is set to zlib error number. If an - error occurred in the file system and not in the compression library, - errnum is set to Z_ERRNO and the application may consult errno - to get the exact error code. -*/ - -ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); -/* - Clears the error and end-of-file flags for file. This is analogous to the - clearerr() function in stdio. This is useful for continuing to read a gzip - file that is being written concurrently. -*/ - - /* checksum functions */ - -/* - These functions are not related to compression but are exported - anyway because they might be useful in applications using the - compression library. -*/ - -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); -/* - Update a running Adler-32 checksum with the bytes buf[0..len-1] and - return the updated checksum. If buf is NULL, this function returns - the required initial value for the checksum. - An Adler-32 checksum is almost as reliable as a CRC32 but can be computed - much faster. Usage example: - - uLong adler = adler32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - adler = adler32(adler, buffer, length); - } - if (adler != original_adler) error(); -*/ - -ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, - z_off_t len2)); -/* - Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 - and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for - each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of - seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. -*/ - -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); -/* - Update a running CRC-32 with the bytes buf[0..len-1] and return the - updated CRC-32. If buf is NULL, this function returns the required initial - value for the for the crc. Pre- and post-conditioning (one's complement) is - performed within this function so it shouldn't be done by the application. - Usage example: - - uLong crc = crc32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - crc = crc32(crc, buffer, length); - } - if (crc != original_crc) error(); -*/ - -ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); - -/* - Combine two CRC-32 check values into one. For two sequences of bytes, - seq1 and seq2 with lengths len1 and len2, CRC-32 check values were - calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 - check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. -*/ - - - /* various hacks, don't look :) */ - -/* deflateInit and inflateInit are macros to allow checking the zlib version - * and the compiler's view of z_stream: - */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, - unsigned char FAR *window, - const char *version, - int stream_size)); -#define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) -#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) -#define inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, sizeof(z_stream)) - - -#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) - struct internal_state {int dummy;}; /* hack for buggy compilers */ -#endif - -ZEXTERN const char * ZEXPORT zError OF((int)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); -ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); - -#ifdef __cplusplus -} -#endif - -#endif /* ZLIB_H */ === modified file 'README.html' --- README.html 2009-12-08 18:06:27 +0000 +++ README.html 2010-07-21 23:21:08 +0000 @@ -47,7 +47,7 @@ You need to install the following libraries: Qt (>= 4.5.0), GSL, -muParser (1.28), +muParser (1.32), zlib, libpng and BOOST C++ libraries.

@@ -59,6 +59,10 @@ You must use the slightly modified version of the Qwt (5.2) library which is shipped with QtiPlot in the "3rdparty/qwt" folder.

+If you want to be able to import Excel files, you need to download and install libxls.
+For the import of ODF spreadsheet files, you need to download and install QuaZIP. +

+ If you need Python scripting support, don't forget to download and install Python, SIP and PyQt4.
=== modified file 'build.conf.example' --- build.conf.example 2009-11-18 10:33:29 +0000 +++ build.conf.example 2010-07-21 23:21:08 +0000 @@ -3,7 +3,7 @@ } ########################################################## -## System specific configuration +## System specific configuration ########################################################## # Global include path which is always added at the end of the INCLUDEPATH @@ -23,7 +23,7 @@ #MUPARSER_LIBS = -lmuparser ########################################################## -## GNU Sientific Library (http://www.gnu.org/software/gsl/) +## GNU Sientific Library (http://www.gnu.org/software/gsl/) ########################################################## # include path. leave it blank to use SYS_INCLUDE @@ -53,12 +53,43 @@ # http://qwt.sourceforge.net/index.html ########################################################## -# include path. +# include path. QWT_INCLUDEPATH = $$QTI_ROOT/3rdparty/qwt/src # link locally against a copy in 3rdparty/ QWT_LIBS = $$QTI_ROOT/3rdparty/qwt/lib/libqwt.a ########################################################## +## QwtPlot3D - use local copy till upstream catches up +# http://qwtplot3d.sourceforge.net/ +########################################################## + +# include path. +QWT3D_INCLUDEPATH = $$QTI_ROOT/3rdparty/qwtplot3d/include +# link locally against a copy in 3rdparty/ +win32:QWT3D_LIBS = $$QTI_ROOT/3rdparty/qwtplot3d/lib/qwtplot3d.dll +unix:QWT3D_LIBS = $$QTI_ROOT/3rdparty/qwtplot3d/lib/libqwtplot3d.a + +########################################################### +## libxls - optional. you don't have to set these variables +# http://libxls.sourceforge.net/ +########################################################### + +# include path. +XLS_INCLUDEPATH = $$QTI_ROOT/3rdparty/libxls/include/ +# link locally against a copy in 3rdparty/ +XLS_LIBS = $$QTI_ROOT/3rdparty/libxls/lib/libxlsreader.a + +########################################################### +## QuaZIP - optional. you don't have to set these variables +# http://quazip.sourceforge.net/ +########################################################### + +# include path. +QUAZIP_INCLUDEPATH = $$QTI_ROOT/3rdparty/quazip/quazip/ +# link locally against a copy in 3rdparty/ +QUAZIP_LIBS = $$QTI_ROOT/3rdparty/quazip/lib/libquazip.a + +########################################################## ## libpng - optional. you don't have to set these variables ########################################################## @@ -74,7 +105,7 @@ # http://soft.proindependent.com/emf/index.html ########################################################## -# include path. +# include path. EMF_ENGINE_INCLUDEPATH = $$QTI_ROOT/3rdparty/EmfEngine/src # link locally against a copy in 3rdparty/ EMF_ENGINE_LIBS = $$QTI_ROOT/3rdparty/EmfEngine/libEmfEngine.a @@ -107,9 +138,6 @@ # where running QtiPlot from a terminal is inconvenient DEFINES += SCRIPTING_CONSOLE - # a dialog for selecting the scripting language on a per-project basis - DEFINES += SCRIPTING_DIALOG - #DEFINES += QTIPLOT_DEMO # Comment the following lines to disable donations start-up message. @@ -118,6 +146,9 @@ # Uncomment the following line if you want to perform a custom installation using the *.path variables defined in ./qtiplot.pro. #CONFIG += CustomInstall + # Uncomment the following line if you want to build QtiPlot as a browser plugin (not working on Internet Explorer). + #CONFIG += BrowserPlugin + CONFIG += release #CONFIG += debug #win32: CONFIG += console === modified file 'debian/build.conf' --- debian/build.conf 2009-11-18 10:33:29 +0000 +++ debian/build.conf 2010-07-21 23:21:17 +0000 @@ -46,7 +46,7 @@ #win32:BOOST_LIBS = $$QTI_ROOT/3rdparty/boost/lib/libboost_date_time-mgw34-mt.lib \ # $$QTI_ROOT/3rdparty/boost/lib/libboost_thread-mgw34-mt.lib # or dynamically against a system-wide installation -BOOST_LIBS = -lboost_date_time-mt -lboost_thread-mt +#BOOST_LIBS = -lboost_date_time-mt -lboost_thread-mt ########################################################## ## QWT - use local copy till upstream catches up @@ -59,6 +59,17 @@ QWT_LIBS = $$QTI_ROOT/3rdparty/qwt/lib/libqwt.a ########################################################## +## QwtPlot3D - use local copy till upstream catches up +# http://qwtplot3d.sourceforge.net/ +########################################################## + +# include path. +QWT3D_INCLUDEPATH = $$QTI_ROOT/3rdparty/qwtplot3d/include +# link locally against a copy in 3rdparty/ +win32:QWT3D_LIBS = $$QTI_ROOT/3rdparty/qwtplot3d/lib/qwtplot3d.dll +unix:QWT3D_LIBS = $$QTI_ROOT/3rdparty/qwtplot3d/lib/libqwtplot3d.a + +########################################################## ## libpng - optional. you don't have to set these variables ########################################################## === modified file 'debian/changelog' --- debian/changelog 2010-02-07 16:13:25 +0000 +++ debian/changelog 2010-07-22 00:34:16 +0000 @@ -1,3 +1,40 @@ +qtiplot (0.9.7.14-1ubuntu1) maverick; urgency=low + + * Merge with Debian unstable (LP: #605027, LP: #608360) + + debian/control: Ubuntu maintainers + * debian/patches/01_build_system.diff: Rm explicit python version + (Closes: #560852) + * debian/control: Fix Qt 4.7 compatibility (LP: #598826) + + Build-Depends: libqtassistantclient-dev + + Recommends: qt-assistant-compat + + -- Alexander Valavanis Thu, 22 Jul 2010 01:32:49 +0100 + +qtiplot (0.9.7.14-1) unstable; urgency=low + + * New upstream release + * Build QTeXEngine into program + * Bump liborigin2 dependency to >=1:06042009+svn1724 + * Bump muparser dependency to 1.32 + + -- Gudjon I. Gudjonsson Sun, 23 May 2010 10:17:19 +0200 + +qtiplot (0.9.7.13-1) UNRELEASED; urgency=low + + * New upstream release + * Switch to dpkg-source 3.0 (quilt) format + * Minor fix to patch 01_build_system.diff + * Add qwtplot3d to build.conf + * Bump standards version to 3.8.4 + * Fix spelling errors in description + * Add misc depends in qtiplot-doc + * Remove patch 02_docbook_stylesheet and + 04_add_includes.diff + * Rename 03_fix_qti_wordlist.txt_path to + 02_fix_paths.diff + + -- Gudjon I. Gudjonsson Wed, 28 Apr 2010 08:50:00 +0200 + qtiplot (0.9.7.10+r1453-1ubuntu2) lucid; urgency=low * Rebuild against new SIP, no changes (LP: #518473) === modified file 'debian/control' --- debian/control 2009-12-08 18:06:27 +0000 +++ debian/control 2010-07-22 00:32:44 +0000 @@ -7,9 +7,10 @@ Andreas Tille Build-Depends: debhelper (>= 7), quilt, dblatex, docbook-utils, doxygen, libgsl0-dev, zlib1g-dev, libpng12-dev, - liborigin2-dev, libmuparser-dev (>=1.30), python-all-dev (>= 2.4.4), - python-qt4, python-qt4-dev, python-sip4-dev, sip4, libqt4-opengl-dev -Standards-Version: 3.8.3 + liborigin2-dev (>=1:06042009+svn1724), libmuparser-dev (>=1.32), python-all-dev (>= 2.4.4), + python-qt4, python-qt4-dev, python-sip4-dev, sip4, libqt4-opengl-dev, + libqtassistantclient-dev +Standards-Version: 3.8.4 Homepage: http://soft.proindependent.com/qtiplot.html Vcs-Svn: svn://svn.debian.org/svn/debian-science/packages/qtiplot/trunk/ Vcs-Browser: http://svn.debian.org/viewsvn/debian-science/packages/qtiplot/trunk @@ -19,9 +20,10 @@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, python-qt4, libqt4-opengl, python-central, python-sip4 (>=4.9-1) +Recommends: qt-assistant-compat Description: data analysis and scientific plotting Qtiplot is a fully fledged plotting software similar to the OriginLab Origin - software (See http://www.originlab.com for more informations about Origin). + software (See http://www.originlab.com for more information about Origin). . It can make two and three dimensional plots of publication quality, both from datasets and functions. It can do non-linear fitting and multi-peak fitting. @@ -52,10 +54,11 @@ Package: qtiplot-doc Architecture: all +Depends: ${misc:Depends} Section: doc Description: data analysis and scientific plotting (documentation) This package is part of QtiPlot. . It contains QtiPlot manual and API documentation. . - See the 'qtiplot' package for more informations. + See the 'qtiplot' package for more information. === modified file 'debian/patches/01_build_system.diff' --- debian/patches/01_build_system.diff 2009-12-08 18:06:27 +0000 +++ debian/patches/01_build_system.diff 2010-07-21 23:35:58 +0000 @@ -1,20 +1,30 @@ -Changes the build system according to the Debian packages and -fixes possible errors in the project files ---- a/qtiplot/qtiplot.pro -+++ b/qtiplot/qtiplot.pro -@@ -10,9 +10,7 @@ - - # local copy included - INCLUDEPATH += ../3rdparty/qwtplot3d/include --INCLUDEPATH += ../3rdparty/liborigin --INCLUDEPATH += ../3rdparty/zlib --INCLUDEPATH += ../3rdparty/QTeXEngine/src -+#INCLUDEPATH += ../3rdparty/QTeXEngine/src - - # configurable - INCLUDEPATH += $$MUPARSER_INCLUDEPATH -@@ -103,17 +101,16 @@ - translations/qtiplot_sv.qm +Index: qtiplot-fix-605025/qtiplot.pro +=================================================================== +--- qtiplot-fix-605025.orig/qtiplot.pro 2010-07-22 00:24:11.291217002 +0100 ++++ qtiplot-fix-605025/qtiplot.pro 2010-07-22 00:24:18.441217002 +0100 +@@ -1,7 +1,5 @@ + TEMPLATE = subdirs + +-SUBDIRS = fitPlugins \ +- manual \ +- 3rdparty/qwt \ ++SUBDIRS = 3rdparty/qwt \ + 3rdparty/qwtplot3d \ + qtiplot +Index: qtiplot-fix-605025/qtiplot/qtiplot.pro +=================================================================== +--- qtiplot-fix-605025.orig/qtiplot/qtiplot.pro 2010-07-22 00:24:11.321217002 +0100 ++++ qtiplot-fix-605025/qtiplot/qtiplot.pro 2010-07-22 00:35:54.671217002 +0100 +@@ -23,6 +23,7 @@ + LIBS += $$QWT_LIBS + LIBS += $$QWT3D_LIBS + LIBS += $$GSL_LIBS ++LIBS += -lorigin2 + + ############################################################################# + ###################### BASIC PROJECT PROPERTIES ############################# +@@ -106,17 +107,16 @@ + translations/qtiplot_sv.qm isEmpty(LUPDATE): LUPDATE = lupdate -#system($$LUPDATE -verbose qtiplot.pro) @@ -30,11 +40,11 @@ -documentation.files += ../README.html \ - ../gpl_licence.txt -+documentation.files += ../README.html ++documentation.files += ../README.html unix: man.files += ../qtiplot.1 -@@ -121,7 +118,7 @@ +@@ -124,7 +124,7 @@ ##################### Compression (zlib-1.2.3) ################ ############################################################### @@ -43,71 +53,54 @@ ############################################################### ################# Default Modules ############################# -@@ -158,18 +155,19 @@ +@@ -159,7 +159,7 @@ qtiUtil.py \ qti_wordlist.txt \ - unix: pythonconfig.path = /usr/local/qtiplot + unix: pythonconfig.path = /usr/share/qtiplot win32: pythonconfig.path = $$INSTALLBASE -- DEFINES += PYTHON_CONFIG_PATH="\\\"$$replace(pythonconfig.path," ","\ ")\\\" -+ PYTHON_CONFIG_PATH="\\\"$$replace(pythonconfig.path," ","\ ")\\\" -+ DEFINES += PYTHON_CONFIG_PATH - } - - unix { - isEmpty(PYTHON): PYTHON = python -- INCLUDEPATH += $$system($$PYTHON python-includepath.py) -- LIBS += $$system($$PYTHON -c "\"from distutils import sysconfig; print '-lpython'+sysconfig.get_config_var('VERSION')\"") -+ INCLUDEPATH += /usr/include/python2.6 -+ LIBS += -lpython2.6 - LIBS += -lm - system(mkdir -p $${SIP_DIR}) -- system($$system($$PYTHON python-sipcmd.py) -c $${SIP_DIR} src/scripting/qti.sip) -+ system($$system(python2.6 python-sipcmd.py) -c $${SIP_DIR} src/scripting/qti.sip) - } - - win32 { ---- a/qtiplot/src/origin/origin.pri -+++ b/qtiplot/src/origin/origin.pri -@@ -1,17 +1,19 @@ + DEFINES += PYTHON_CONFIG_PATH="\\\"$$replace(pythonconfig.path," ","\ ")\\\" + } +@@ -218,7 +218,7 @@ + !isEmpty(BOOST_LIBS) { + DEFINES += OPJ_IMPORT + INCLUDEPATH += $$BOOST_INCLUDEPATH +- INCLUDEPATH += ../3rdparty/liborigin ++ INCLUDEPATH += /usr/include/liborigin2 + LIBS += $$BOOST_LIBS + include(src/origin/origin.pri) + } +Index: qtiplot-fix-605025/qtiplot/src/origin/origin.pri +=================================================================== +--- qtiplot-fix-605025.orig/qtiplot/src/origin/origin.pri 2010-07-22 00:24:11.341217002 +0100 ++++ qtiplot-fix-605025/qtiplot/src/origin/origin.pri 2010-07-22 00:24:18.441217002 +0100 +@@ -1,27 +1,8 @@ ############################################################### ################# Origin Import (liborigin) ################### ############################################################### -INCLUDEPATH += src/origin/ -+INCLUDEPATH += src/origin/ /usr/include/liborigin2/ ++INCLUDEPATH += src/origin/ /usr/include/liborigin2 HEADERS += src/origin/importOPJ.h -HEADERS += ../3rdparty/liborigin/OriginObj.h -HEADERS += ../3rdparty/liborigin/OriginFile.h -HEADERS += ../3rdparty/liborigin/OriginParser.h -HEADERS += ../3rdparty/liborigin/OriginDefaultParser.h +-HEADERS += ../3rdparty/liborigin/Origin600Parser.h +-HEADERS += ../3rdparty/liborigin/Origin610Parser.h +-HEADERS += ../3rdparty/liborigin/Origin700Parser.h -HEADERS += ../3rdparty/liborigin/Origin750Parser.h -+#HEADERS += ../3rdparty/liborigin/OriginObj.h -+#HEADERS += ../3rdparty/liborigin/OriginFile.h -+#HEADERS += ../3rdparty/liborigin/OriginParser.h -+#HEADERS += ../3rdparty/liborigin/OriginDefaultParser.h -+#HEADERS += ../3rdparty/liborigin/Origin750Parser.h +-HEADERS += ../3rdparty/liborigin/Origin800Parser.h +-HEADERS += ../3rdparty/liborigin/Origin810Parser.h SOURCES += src/origin/importOPJ.cpp -SOURCES += ../3rdparty/liborigin/OriginFile.cpp -SOURCES += ../3rdparty/liborigin/OriginParser.cpp -SOURCES += ../3rdparty/liborigin/OriginDefaultParser.cpp +-SOURCES += ../3rdparty/liborigin/Origin600Parser.cpp +-SOURCES += ../3rdparty/liborigin/Origin610Parser.cpp +-SOURCES += ../3rdparty/liborigin/Origin700Parser.cpp -SOURCES += ../3rdparty/liborigin/Origin750Parser.cpp -+#SOURCES += ../3rdparty/liborigin/OriginFile.cpp -+#SOURCES += ../3rdparty/liborigin/OriginParser.cpp -+#SOURCES += ../3rdparty/liborigin/OriginDefaultParser.cpp -+#SOURCES += ../3rdparty/liborigin/Origin750Parser.cpp -+ -+LIBS += -lorigin2 ---- a/qtiplot.pro -+++ b/qtiplot.pro -@@ -1,6 +1,5 @@ - TEMPLATE = subdirs - --SUBDIRS = fitPlugins \ -- manual \ -- 3rdparty/qwt \ -+SUBDIRS = 3rdparty/qwt \ -+ 3rdparty/qwtplot3d \ - qtiplot +-SOURCES += ../3rdparty/liborigin/Origin800Parser.cpp +-SOURCES += ../3rdparty/liborigin/Origin810Parser.cpp === removed file 'debian/patches/02_docbook_stylesheet.diff' --- debian/patches/02_docbook_stylesheet.diff 2009-12-08 18:06:27 +0000 +++ debian/patches/02_docbook_stylesheet.diff 1970-01-01 00:00:00 +0000 @@ -1,11 +0,0 @@ ---- a/manual/qtiplot.dsl -+++ b/manual/qtiplot.dsl -@@ -6,7 +6,7 @@ - html stylesheet. You have to adapt this to your installation. --> -- -+ - - - === added file 'debian/patches/02_fix_paths.diff' --- debian/patches/02_fix_paths.diff 1970-01-01 00:00:00 +0000 +++ debian/patches/02_fix_paths.diff 2010-07-21 23:21:17 +0000 @@ -0,0 +1,11 @@ +--- a/qtiplot/src/core/ApplicationWindow.cpp ++++ b/qtiplot/src/core/ApplicationWindow.cpp +@@ -17735,7 +17735,7 @@ + QStringList words; + #ifdef SCRIPTING_PYTHON + if (scriptEnv->name() == QString("Python")){ +- QString fn = d_python_config_folder + "/qti_wordlist.txt"; ++ QString fn = "/usr/share/qtiplot/qti_wordlist.txt"; + QFile file(fn); + if (!file.open(QFile::ReadOnly)){ + QMessageBox::critical(this, tr("QtiPlot - Warning"), === removed file 'debian/patches/03_fix_qti_wordlist.txt_path.diff' --- debian/patches/03_fix_qti_wordlist.txt_path.diff 2009-11-18 10:33:29 +0000 +++ debian/patches/03_fix_qti_wordlist.txt_path.diff 1970-01-01 00:00:00 +0000 @@ -1,13 +0,0 @@ -Fixes the path to qti_wordlist.txt ---- a/qtiplot/src/core/ApplicationWindow.cpp -+++ b/qtiplot/src/core/ApplicationWindow.cpp -@@ -17082,7 +17082,8 @@ - QStringList words; - #ifdef SCRIPTING_PYTHON - if (scriptEnv->name() == QString("Python")){ -- QString fn = d_python_config_folder + "/qti_wordlist.txt"; -+ QString fn = "/usr/share/qtiplot/qti_wordlist.txt"; -+ //QString fn = d_python_config_folder + "/qti_wordlist.txt"; - QFile file(fn); - if (!file.open(QFile::ReadOnly)){ - QMessageBox::critical(this, tr("QtiPlot - Warning"), === removed file 'debian/patches/04_add_includes.diff' --- debian/patches/04_add_includes.diff 2009-12-08 18:06:27 +0000 +++ debian/patches/04_add_includes.diff 1970-01-01 00:00:00 +0000 @@ -1,10 +0,0 @@ ---- a/qtiplot/src/plot2D/ScaleEngine.cpp -+++ b/qtiplot/src/plot2D/ScaleEngine.cpp -@@ -26,6 +26,7 @@ - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -+#include - #include "ScaleEngine.h" - - QwtScaleTransformation* ScaleEngine::transformation() const === added file 'debian/patches/debian-changes-0.9.7.14-1' --- debian/patches/debian-changes-0.9.7.14-1 1970-01-01 00:00:00 +0000 +++ debian/patches/debian-changes-0.9.7.14-1 2010-07-21 23:21:17 +0000 @@ -0,0 +1,187 @@ +Description: Upstream changes introduced in version 0.9.7.14-1 + This patch has been created by dpkg-source during the package build. + Here's the last changelog entry, hopefully it gives details on why + those changes were made: + . + qtiplot (0.9.7.14-1) unstable; urgency=low + . + * New upstream release + * Build QTeXEngine into program + * Bump liborigin2 dependency to >=1:06042009+svn1724 + * Bump muparser dependency to 1.32 + . + The person named in the Author field signed this changelog entry. +Author: Gudjon I. Gudjonsson + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: http://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- /dev/null ++++ qtiplot-0.9.7.14/qtiplot_0.9.7.14-1_amd64.build +@@ -0,0 +1,156 @@ ++I: Using pkgname logfile ++I: Current time: Sun May 23 23:19:43 CEST 2010 ++I: pbuilder-time-stamp: 1274649583 ++I: Obtaining the cached apt archive contents ++I: Installing the build-deps ++ -> Attempting to satisfy build-dependencies ++ -> Creating pbuilder-satisfydepends-dummy package ++Package: pbuilder-satisfydepends-dummy ++Version: 0.invalid.0 ++Architecture: amd64 ++Maintainer: Debian Pbuilder Team ++Description: Dummy package to satisfy dependencies with aptitude - created by pbuilder ++ This package was created automatically by pbuilder and should ++Depends: debhelper (>= 7), quilt, dblatex, docbook-utils, doxygen, libgsl0-dev, zlib1g-dev, libpng12-dev, liborigin2-dev (>= 1:06042009+svn1724), libmuparser-dev (>= 1.32), python-all-dev (>= 2.4.4), python-qt4, python-qt4-dev, python-sip4-dev, sip4, libqt4-opengl-dev ++dpkg-deb: building package `pbuilder-satisfydepends-dummy' in `/tmp/satisfydepends-aptitude/pbuilder-satisfydepends-dummy.deb'. ++Reading package lists... ++Building dependency tree... ++Reading state information... ++aptitude is already the newest version. ++0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. ++Selecting previously deselected package pbuilder-satisfydepends-dummy. ++(Reading database ... 10981 files and directories currently installed.) ++Unpacking pbuilder-satisfydepends-dummy (from .../pbuilder-satisfydepends-dummy.deb) ... ++dpkg: dependency problems prevent configuration of pbuilder-satisfydepends-dummy: ++ pbuilder-satisfydepends-dummy depends on debhelper (>= 7); however: ++ Package debhelper is not installed. ++ pbuilder-satisfydepends-dummy depends on quilt; however: ++ Package quilt is not installed. ++ pbuilder-satisfydepends-dummy depends on dblatex; however: ++ Package dblatex is not installed. ++ pbuilder-satisfydepends-dummy depends on docbook-utils; however: ++ Package docbook-utils is not installed. ++ pbuilder-satisfydepends-dummy depends on doxygen; however: ++ Package doxygen is not installed. ++ pbuilder-satisfydepends-dummy depends on libgsl0-dev; however: ++ Package libgsl0-dev is not installed. ++ pbuilder-satisfydepends-dummy depends on zlib1g-dev; however: ++ Package zlib1g-dev is not installed. ++ pbuilder-satisfydepends-dummy depends on libpng12-dev; however: ++ Package libpng12-dev is not installed. ++ pbuilder-satisfydepends-dummy depends on liborigin2-dev (>= 1:06042009+svn1724); however: ++ Package liborigin2-dev is not installed. ++ pbuilder-satisfydepends-dummy depends on libmuparser-dev (>= 1.32); however: ++ Package libmuparser-dev is not installed. ++ pbuilder-satisfydepends-dummy depends on python-all-dev (>= 2.4.4); however: ++ Package python-all-dev is not installed. ++ pbuilder-satisfydepends-dummy depends on python-qt4; however: ++ Package python-qt4 is not installed. ++ pbuilder-satisfydepends-dummy depends on python-qt4-dev; however: ++ Package python-qt4-dev is not installed. ++ pbuilder-satisfydepends-dummy depends on python-sip4-dev; however: ++ Package python-sip4-dev is not installed. ++ pbuilder-satisfydepends-dummy depends on sip4; however: ++ Package sip4 is not installed. ++ pbuilder-satisfydepends-dummy depends on libqt4-opengl-dev; however: ++ Package libqt4-opengl-dev is not installed. ++dpkg: error processing pbuilder-satisfydepends-dummy (--install): ++ dependency problems - leaving unconfigured ++Errors were encountered while processing: ++ pbuilder-satisfydepends-dummy ++Reading package lists... ++Building dependency tree... ++Reading state information... ++Initializing package states... ++Writing extended state information... ++The following NEW packages will be installed: ++ apt-utils{a} bsdmainutils{a} dblatex{a} debhelper{a} diffstat{a} ++ docbook-dsssl{a} docbook-utils{a} docbook-xml{a} doxygen{a} file{a} ++ fontconfig{a} fontconfig-config{a} gettext{a} gettext-base{a} ++ groff-base{a} html2text{a} intltool-debian{a} jadetex{a} libasound2{a} ++ libasyncns0{a} libaudio2{a} libbsd0{a} libcap2{a} libcroco3{a} ++ libdb4.5{a} libdbus-1-3{a} libdrm2{a} libflac8{a} libfontconfig1{a} ++ libfreetype6{a} libgl1-mesa-dev{a} libgl1-mesa-glx{a} libglib2.0-0{a} ++ libglu1-mesa{a} libglu1-mesa-dev{a} libgsl0-dev{a} libgsl0ldbl{a} ++ libice6{a} libidn11{a} libjpeg62{a} libjs-jquery{a} libkpathsea5{a} ++ liblcms1{a} libmagic1{a} libmng1{a} libmuparser-dev{a} libmuparser0{a} ++ libogg0{a} libopenjpeg2{a} libosp5{a} libostyle1c2{a} libpcre3{a} ++ libphonon4{a} libpng12-0{a} libpng12-dev{a} libpoppler5{a} ++ libpthread-stubs0{a} libpthread-stubs0-dev{a} libpulse-mainloop-glib0{a} ++ libpulse0{a} libpython2.6{a} libqt4-assistant{a} libqt4-dbus{a} ++ libqt4-designer{a} libqt4-dev{a} libqt4-help{a} libqt4-multimedia{a} ++ libqt4-network{a} libqt4-opengl{a} libqt4-opengl-dev{a} ++ libqt4-qt3support{a} libqt4-script{a} libqt4-scripttools{a} libqt4-sql{a} ++ libqt4-svg{a} libqt4-test{a} libqt4-webkit{a} libqt4-xml{a} ++ libqt4-xmlpatterns{a} libqtcore4{a} libqtgui4{a} libsgmls-perl{a} ++ libsm6{a} libsndfile1{a} libsp1c2{a} libssl0.9.8{a} libtiff4{a} ++ libvorbis0a{a} libvorbisenc2{a} libwrap0{a} libx11-6{a} libx11-data{a} ++ libx11-dev{a} libxau-dev{a} libxau6{a} libxaw7{a} libxcb1{a} ++ libxcb1-dev{a} libxdamage1{a} libxdmcp-dev{a} libxdmcp6{a} libxext6{a} ++ libxfixes3{a} libxi6{a} libxml2{a} libxmu6{a} libxpm4{a} libxrender1{a} ++ libxslt1.1{a} libxt6{a} libxtst6{a} libxxf86vm1{a} luatex{a} lynx{a} ++ lynx-cur{a} man-db{a} mesa-common-dev{a} mime-support{a} openjade{a} ++ po-debconf{a} preview-latex-style{a} python{a} python-all{a} ++ python-all-dev{a} python-apt{a} python-central{a} python-dev{a} ++ python-minimal{a} python-qt4{a} python-qt4-dev{a} python-sip{a} ++ python-sip-dev{a} python-support{a} python2.5{a} python2.5-dev{a} ++ python2.5-minimal{a} python2.6{a} python2.6-dev{a} python2.6-minimal{a} ++ qt4-qmake{a} quilt{a} sgml-base{a} sgml-data{a} sgmlspl{a} sp{a} ++ tex-common{a} texlive{a} texlive-base{a} texlive-bibtex-extra{a} ++ texlive-binaries{a} texlive-common{a} texlive-doc-base{a} ++ texlive-extra-utils{a} texlive-fonts-recommended{a} texlive-latex-base{a} ++ texlive-latex-extra{a} texlive-latex-recommended{a} texlive-math-extra{a} ++ texlive-pictures{a} tipa{a} ttf-dejavu-core{a} ucf{a} x11-common{a} ++ x11proto-core-dev{a} x11proto-input-dev{a} x11proto-kb-dev{a} xml-core{a} ++ xsltproc{a} xtrans-dev{a} zlib1g-dev{a} ++The following partially installed packages will be configured: ++ pbuilder-satisfydepends-dummy{b} ++0 packages upgraded, 170 newly installed, 0 to remove and 0 not upgraded. ++Need to get 113MB/168MB of archives. After unpacking 499MB will be used. ++The following packages have unmet dependencies: ++ pbuilder-satisfydepends-dummy: Depends: liborigin2-dev (>= 1:06042009+svn1724) but it is not going to be installed. ++The following actions will resolve these dependencies: ++ ++ Remove the following packages: ++1) pbuilder-satisfydepends-dummy ++ ++ ++ ++The following NEW packages will be installed: ++ apt-utils{a} bsdmainutils{a} libpng12-0{a} ++The following packages will be REMOVED: ++ pbuilder-satisfydepends-dummy{a} ++0 packages upgraded, 3 newly installed, 1 to remove and 0 not upgraded. ++Need to get 226kB/607kB of archives. After unpacking 1540kB will be used. ++Writing extended state information... ++Get:1 http://ftp.tu-chemnitz.de sid/main apt-utils 0.7.25.3 [226kB] ++debconf: delaying package configuration, since apt-utils is not installed ++Fetched 226kB in 5s (42.6kB/s) ++(Reading database ... 10981 files and directories currently installed.) ++Removing pbuilder-satisfydepends-dummy ... ++Selecting previously deselected package apt-utils. ++(Reading database ... 10981 files and directories currently installed.) ++Unpacking apt-utils (from .../apt-utils_0.7.25.3_amd64.deb) ... ++Selecting previously deselected package bsdmainutils. ++Unpacking bsdmainutils (from .../bsdmainutils_8.0.11_amd64.deb) ... ++Selecting previously deselected package libpng12-0. ++Unpacking libpng12-0 (from .../libpng12-0_1.2.43-1_amd64.deb) ... ++Setting up apt-utils (0.7.25.3) ... ++Setting up bsdmainutils (8.0.11) ... ++update-alternatives: using /usr/bin/bsd-write to provide /usr/bin/write (write) in auto mode. ++update-alternatives: using /usr/bin/bsd-from to provide /usr/bin/from (from) in auto mode. ++Setting up libpng12-0 (1.2.43-1) ... ++Reading package lists... ++Building dependency tree... ++Reading state information... ++Reading extended state information... ++Initializing package states... ++Writing extended state information... ++Aptitude couldn't satisfy the build dependencies ++E: pbuilder-satisfydepends failed. ++I: Copying back the cached apt archive contents ++I: new cache content apt-utils_0.7.25.3_amd64.deb added ++I: unmounting dev/pts filesystem ++I: unmounting proc filesystem ++I: cleaning the build env ++I: removing directory /var/cache/pbuilder/build//31075 and its subdirectories === modified file 'debian/patches/series' --- debian/patches/series 2009-12-08 18:06:27 +0000 +++ debian/patches/series 2010-07-21 23:21:17 +0000 @@ -1,3 +1,3 @@ 01_build_system.diff -03_fix_qti_wordlist.txt_path.diff -#05_gcc44_fix.diff +02_fix_paths.diff +debian-changes-0.9.7.14-1 === modified file 'debian/rules' --- debian/rules 2009-11-18 10:33:29 +0000 +++ debian/rules 2010-07-21 23:21:17 +0000 @@ -1,8 +1,6 @@ #!/usr/bin/make -f # -*- makefile -*- -include /usr/share/quilt/quilt.make - # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 @@ -18,7 +16,7 @@ endif configure: configure-stamp -configure-stamp: $(QUILT_STAMPFN) +configure-stamp: dh_testdir /bin/gunzip -c /usr/share/doc/zlib1g-dev/examples/minigzip.c.gz > minigzip.c @@ -50,12 +48,11 @@ touch $@ -clean: clean-patched unpatch -clean-patched: +clean: dh_testdir dh_testroot - rm -f build-arch-stamp build-indep-stamp #CONFIGURE-STAMP# + rm -f build-arch-stamp build-indep-stamp configure-stamp [ ! -f Makefile ] || $(MAKE) clean find -type f -name 'Makefile' -exec rm -f {} \; @@ -128,10 +125,11 @@ get-orig-source: VER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-+~]+).*,\1,p'); \ uscan --force-download --rename --download-version=$$VER --destdir=. && (\ - tar -xj --exclude 3rdparty/liborigin --exclude 3rdparty/zlib 3rdparty/QTeXEngine/ -f qtiplot_$$VER.orig.tar.bz2 ; \ + tar -xj --exclude 3rdparty/liborigin --exclude 3rdparty/zlib -f qtiplot_$$VER.orig.tar.bz2 ; \ chmod -R o-w qtiplot-$$VER ; \ - dos2unix `find qtiplot-$$VER -type f |grep -v .png`; \ + fromdos `find qtiplot-$$VER -type f |grep -v .png`; \ find qtiplot-$$VER -type f -exec chmod a-x {} \; ;\ + rm -f qtiplot-$$VER/.gitignore ;\ tar -czf qtiplot_$$VER.orig.tar.gz qtiplot-$$VER; \ rm -rf qtiplot-$$VER; \ rm -f qtiplot_$$VER.orig.tar.bz2); === added directory 'debian/source' === added file 'debian/source/format' --- debian/source/format 1970-01-01 00:00:00 +0000 +++ debian/source/format 2010-07-21 23:21:17 +0000 @@ -0,0 +1,1 @@ +3.0 (quilt) === added directory 'fitPlugins/exp_saturation' === removed directory 'fitPlugins/exp_saturation' === added file 'fitPlugins/exp_saturation/exp_saturation.c' --- fitPlugins/exp_saturation/exp_saturation.c 1970-01-01 00:00:00 +0000 +++ fitPlugins/exp_saturation/exp_saturation.c 2010-07-21 23:21:08 +0000 @@ -0,0 +1,102 @@ +/*************************************************************************** + File : exp_saturation.c + Project : QtiPlot + Description : Fit plugin for "b1*(1-exp(-b2*x))" + -------------------------------------------------------------------- + Copyright : (C) 2008 Knut Franke (knut.franke*gmx.de) + (replace * with @ in the email address) + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * As a special exception, you may omit the above copyright notice when * + * distributing modified copies of this file (for instance, when using it * + * as a template for your own fit plugin). * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + +#include +#include +#include + +struct data { + int n; + int p; + double * X; + double * Y; + double * sigma; +}; + +char * name() { return "ExponentialSaturation"; } + +char * function() { return "b1*(1-exp(-b2*x))"; } + +char * parameters() { return "b1,b2"; } + +double function_eval(double x, double * params) +{ + return params[0]*(1-exp(-params[1]*x)); +} + +int function_f(const gsl_vector * params, void * void_data, gsl_vector * f) +{ + struct data * d = (struct data*) void_data; + double b1 = gsl_vector_get(params, 0); + double b2 = gsl_vector_get(params, 1); + int i; + for (i=0; in; i++) + gsl_vector_set(f, i, (b1*(1-exp(-b2*d->X[i])) - d->Y[i])/d->sigma[i]); + + return GSL_SUCCESS; +} + +int function_df(const gsl_vector * params, void * void_data, gsl_matrix *J) +{ + struct data * d = (struct data*) void_data; + double b1 = gsl_vector_get(params, 0); + double b2 = gsl_vector_get(params, 1); + int i; + for (i=0; in; i++) { + double x = d->X[i]; + gsl_matrix_set(J, i, 0, (1-exp(-b2*x))); + gsl_matrix_set(J, i, 1, b1*x*exp(-b2*x)); + } + return GSL_SUCCESS; +} + +int function_fdf(const gsl_vector * params, void * void_data, gsl_vector * f, gsl_matrix * J) +{ + function_f(params, void_data, f); + function_df(params, void_data, J); + return GSL_SUCCESS; +} + +double function_d(const gsl_vector * params, void * void_data) +{ + struct data * d = (struct data*) void_data; + gsl_vector * f = gsl_vector_alloc(d->n); + double result = 0; + int i; + + function_f(params, void_data, f); + for (i=0; in; i++) + result += pow(gsl_vector_get(f, i), 2); + + gsl_vector_free(f); + return result; +} === removed file 'fitPlugins/exp_saturation/exp_saturation.c' --- fitPlugins/exp_saturation/exp_saturation.c 2009-12-08 18:06:27 +0000 +++ fitPlugins/exp_saturation/exp_saturation.c 1970-01-01 00:00:00 +0000 @@ -1,70 +0,0 @@ -#include -#include -#include - -struct data { - int n; - int p; - double * X; - double * Y; - double * sigma; -}; - -char * name() { return "ExponentialSaturation"; } - -char * function() { return "b1*(1-exp(-b2*x))"; } - -char * parameters() { return "b1,b2"; } - -double function_eval(double x, double * params) -{ - return params[0]*(1-exp(-params[1]*x)); -} - -int function_f(const gsl_vector * params, void * void_data, gsl_vector * f) -{ - struct data * d = (struct data*) void_data; - double b1 = gsl_vector_get(params, 0); - double b2 = gsl_vector_get(params, 1); - int i; - for (i=0; in; i++) - gsl_vector_set(f, i, (b1*(1-exp(-b2*d->X[i])) - d->Y[i])/d->sigma[i]); - - return GSL_SUCCESS; -} - -int function_df(const gsl_vector * params, void * void_data, gsl_matrix *J) -{ - struct data * d = (struct data*) void_data; - double b1 = gsl_vector_get(params, 0); - double b2 = gsl_vector_get(params, 1); - int i; - for (i=0; in; i++) { - double x = d->X[i]; - gsl_matrix_set(J, i, 0, (1-exp(-b2*x))); - gsl_matrix_set(J, i, 1, b1*x*exp(-b2*x)); - } - return GSL_SUCCESS; -} - -int function_fdf(const gsl_vector * params, void * void_data, gsl_vector * f, gsl_matrix * J) -{ - function_f(params, void_data, f); - function_df(params, void_data, J); - return GSL_SUCCESS; -} - -double function_d(const gsl_vector * params, void * void_data) -{ - struct data * d = (struct data*) void_data; - gsl_vector * f = gsl_vector_alloc(d->n); - double result = 0; - int i; - - function_f(params, void_data, f); - for (i=0; in; i++) - result += pow(gsl_vector_get(f, i), 2); - - gsl_vector_free(f); - return result; -} === added file 'fitPlugins/exp_saturation/exp_saturation.pro' --- fitPlugins/exp_saturation/exp_saturation.pro 1970-01-01 00:00:00 +0000 +++ fitPlugins/exp_saturation/exp_saturation.pro 2010-07-21 23:21:08 +0000 @@ -0,0 +1,29 @@ +QTI_ROOT = ../.. +!include( $$QTI_ROOT/build.conf ) { + message( "You need a build.conf with local settings!" ) +} + +QMAKE_PROJECT_DEPTH = 0 +linux-g++-64: libsuff=64 + +TARGET = exp_saturation +TEMPLATE = lib + +CONFIG += thread +CONFIG += warn_on +CONFIG += release +CONFIG += dll + +DESTDIR = ../ + +INCLUDEPATH += $$GSL_INCLUDEPATH +LIBS += $$GSL_LIBS + +target.path=/usr/lib$${libsuff}/qtiplot/plugins +INSTALLS += target + +SOURCES += exp_saturation.c + +# At the very end: add global include- and lib path +INCLUDEPATH += $$SYS_INCLUDEPATH +LIBS += $$SYS_LIBS === removed file 'fitPlugins/exp_saturation/exp_saturation.pro' --- fitPlugins/exp_saturation/exp_saturation.pro 2009-12-08 18:06:27 +0000 +++ fitPlugins/exp_saturation/exp_saturation.pro 1970-01-01 00:00:00 +0000 @@ -1,29 +0,0 @@ -QTI_ROOT = ../.. -!include( $$QTI_ROOT/build.conf ) { - message( "You need a build.conf with local settings!" ) -} - -QMAKE_PROJECT_DEPTH = 0 -linux-g++-64: libsuff=64 - -TARGET = exp_saturation -TEMPLATE = lib - -CONFIG += thread -CONFIG += warn_on -CONFIG += release -CONFIG += dll - -DESTDIR = ../ - -INCLUDEPATH += $$GSL_INCLUDEPATH -LIBS += $$GSL_LIBS - -target.path=/usr/lib$${libsuff}/qtiplot/plugins -INSTALLS += target - -SOURCES += exp_saturation.c - -# At the very end: add global include- and lib path -INCLUDEPATH += $$SYS_INCLUDEPATH -LIBS += $$SYS_LIBS === added directory 'fitPlugins/explin' === removed directory 'fitPlugins/explin' === added file 'fitPlugins/explin/explin.c' --- fitPlugins/explin/explin.c 1970-01-01 00:00:00 +0000 +++ fitPlugins/explin/explin.c 2010-07-21 23:21:08 +0000 @@ -0,0 +1,108 @@ +/*************************************************************************** + File : planck_wavelength.c + Project : QtiPlot + Description : Fit plugin for "exp(-b1*x)/(b2+b3*x)" + -------------------------------------------------------------------- + Copyright : (C) 2008 Knut Franke (knut.franke*gmx.de) + (replace * with @ in the email address) + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * As a special exception, you may omit the above copyright notice when * + * distributing modified copies of this file (for instance, when using it * + * as a template for your own fit plugin). * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + +#include +#include +#include + +struct data { + int n; + int p; + double * X; + double * Y; + double * sigma; +}; + +char * name() { return "ExpLin"; } + +char * function() { return "exp(-b1*x)/(b2+b3*x)"; } + +char * parameters() { return "b1,b2,b3"; } + +double function_eval(double x, double * params) +{ + return exp(-params[0]*x)/(params[1]+params[2]*x); +} + +int function_f(const gsl_vector * params, void * void_data, gsl_vector * f) +{ + struct data * d = (struct data*) void_data; + double p[3]; + int i; + for (i=0; ip; i++) + p[i] = gsl_vector_get(params, i); + + for (i=0; in; i++) + gsl_vector_set(f, i, (function_eval(d->X[i], p) - d->Y[i])/d->sigma[i]); + + return GSL_SUCCESS; +} + +double function_d(const gsl_vector * params, void * void_data) +{ + struct data * d = (struct data*) void_data; + gsl_vector * f = gsl_vector_alloc(d->n); + double result = 0; + int i; + + function_f(params, void_data, f); + for (i=0; in; i++) + result += pow(gsl_vector_get(f, i), 2); + + gsl_vector_free(f); + return result; +} + +int function_df(const gsl_vector * params, void * void_data, gsl_matrix * J) +{ + struct data * d = (struct data*) void_data; + double b1 = gsl_vector_get(params, 0); + double b2 = gsl_vector_get(params, 1); + double b3 = gsl_vector_get(params, 2); + int i; + for (i=0; in; i++) { + double x = d->X[i]; + double l = b2+b3*x; + double f = (-1) * exp(-b1*x) / (l * d->sigma[i]); + gsl_matrix_set(J, i, 0, x*f); + gsl_matrix_set(J, i, 1, f/l); + gsl_matrix_set(J, i, 2, x*f/l); + } + return GSL_SUCCESS; +} + +int function_fdf(const gsl_vector * params, void * void_data, gsl_vector * f, gsl_matrix * J) +{ + function_f(params, void_data, f); + function_df(params, void_data, J); + return GSL_SUCCESS; +} === removed file 'fitPlugins/explin/explin.c' --- fitPlugins/explin/explin.c 2009-12-08 18:06:27 +0000 +++ fitPlugins/explin/explin.c 1970-01-01 00:00:00 +0000 @@ -1,76 +0,0 @@ -#include -#include -#include - -struct data { - int n; - int p; - double * X; - double * Y; - double * sigma; -}; - -char * name() { return "ExpLin"; } - -char * function() { return "exp(-b1*x)/(b2+b3*x)"; } - -char * parameters() { return "b1,b2,b3"; } - -double function_eval(double x, double * params) -{ - return exp(-params[0]*x)/(params[1]+params[2]*x); -} - -int function_f(const gsl_vector * params, void * void_data, gsl_vector * f) -{ - struct data * d = (struct data*) void_data; - double p[3]; - int i; - for (i=0; ip; i++) - p[i] = gsl_vector_get(params, i); - - for (i=0; in; i++) - gsl_vector_set(f, i, (function_eval(d->X[i], p) - d->Y[i])/d->sigma[i]); - - return GSL_SUCCESS; -} - -double function_d(const gsl_vector * params, void * void_data) -{ - struct data * d = (struct data*) void_data; - gsl_vector * f = gsl_vector_alloc(d->n); - double result = 0; - int i; - - function_f(params, void_data, f); - for (i=0; in; i++) - result += pow(gsl_vector_get(f, i), 2); - - gsl_vector_free(f); - return result; -} - -int function_df(const gsl_vector * params, void * void_data, gsl_matrix * J) -{ - struct data * d = (struct data*) void_data; - double b1 = gsl_vector_get(params, 0); - double b2 = gsl_vector_get(params, 1); - double b3 = gsl_vector_get(params, 2); - int i; - for (i=0; in; i++) { - double x = d->X[i]; - double l = b2+b3*x; - double f = (-1) * exp(-b1*x) / (l * d->sigma[i]); - gsl_matrix_set(J, i, 0, x*f); - gsl_matrix_set(J, i, 1, f/l); - gsl_matrix_set(J, i, 2, x*f/l); - } - return GSL_SUCCESS; -} - -int function_fdf(const gsl_vector * params, void * void_data, gsl_vector * f, gsl_matrix * J) -{ - function_f(params, void_data, f); - function_df(params, void_data, J); - return GSL_SUCCESS; -} === added file 'fitPlugins/explin/explin.pro' --- fitPlugins/explin/explin.pro 1970-01-01 00:00:00 +0000 +++ fitPlugins/explin/explin.pro 2010-07-21 23:21:08 +0000 @@ -0,0 +1,29 @@ +QTI_ROOT = ../.. +!include( $$QTI_ROOT/build.conf ) { + message( "You need a build.conf with local settings!" ) +} + +QMAKE_PROJECT_DEPTH = 0 +linux-g++-64: libsuff=64 + +TARGET = explin +TEMPLATE = lib + +CONFIG += thread +CONFIG += warn_on +CONFIG += release +CONFIG += dll + +DESTDIR = ../ + +INCLUDEPATH += $$GSL_INCLUDEPATH +LIBS += $$GSL_LIBS + +target.path=/usr/lib$${libsuff}/qtiplot/plugins +INSTALLS += target + +SOURCES += explin.c + +# At the very end: add global include- and lib path +INCLUDEPATH += $$SYS_INCLUDEPATH +LIBS += $$SYS_LIBS === removed file 'fitPlugins/explin/explin.pro' --- fitPlugins/explin/explin.pro 2009-12-08 18:06:27 +0000 +++ fitPlugins/explin/explin.pro 1970-01-01 00:00:00 +0000 @@ -1,29 +0,0 @@ -QTI_ROOT = ../.. -!include( $$QTI_ROOT/build.conf ) { - message( "You need a build.conf with local settings!" ) -} - -QMAKE_PROJECT_DEPTH = 0 -linux-g++-64: libsuff=64 - -TARGET = explin -TEMPLATE = lib - -CONFIG += thread -CONFIG += warn_on -CONFIG += release -CONFIG += dll - -DESTDIR = ../ - -INCLUDEPATH += $$GSL_INCLUDEPATH -LIBS += $$GSL_LIBS - -target.path=/usr/lib$${libsuff}/qtiplot/plugins -INSTALLS += target - -SOURCES += explin.c - -# At the very end: add global include- and lib path -INCLUDEPATH += $$SYS_INCLUDEPATH -LIBS += $$SYS_LIBS === added file 'fitPlugins/fitPlugins.pro' --- fitPlugins/fitPlugins.pro 1970-01-01 00:00:00 +0000 +++ fitPlugins/fitPlugins.pro 2010-07-21 23:21:08 +0000 @@ -0,0 +1,7 @@ +TEMPLATE = subdirs + +SUBDIRS = explin \ + exp_saturation \ + fitRational0 \ + fitRational1 \ + planck_wavelength === removed file 'fitPlugins/fitPlugins.pro' --- fitPlugins/fitPlugins.pro 2009-12-08 18:06:27 +0000 +++ fitPlugins/fitPlugins.pro 1970-01-01 00:00:00 +0000 @@ -1,7 +0,0 @@ -TEMPLATE = subdirs - -SUBDIRS = explin \ - exp_saturation \ - fitRational0 \ - fitRational1 \ - planck_wavelength === modified file 'fitPlugins/fitRational0/fitRational0.cpp' --- fitPlugins/fitRational0/fitRational0.cpp 2009-12-08 18:06:27 +0000 +++ fitPlugins/fitRational0/fitRational0.cpp 2010-07-21 23:21:08 +0000 @@ -1,3 +1,35 @@ +/*************************************************************************** + File : fitRational0.cpp + Project : QtiPlot + Description : Fit plugin for "(b + c*x)/(1 + a*x)" + -------------------------------------------------------------------- + Copyright : (C) 2005 Ion Vasilief (ion_vasilief*yahoo.fr) + (replace * with @ in the email address) + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * As a special exception, you may omit the above copyright notice when * + * distributing modified copies of this file (for instance, when using it * + * as a template for your own fit plugin). * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + #include #include #include === modified file 'fitPlugins/fitRational1/fitRational1.cpp' --- fitPlugins/fitRational1/fitRational1.cpp 2009-12-08 18:06:27 +0000 +++ fitPlugins/fitRational1/fitRational1.cpp 2010-07-21 23:21:08 +0000 @@ -1,3 +1,35 @@ +/*************************************************************************** + File : fitRational1.cpp + Project : QtiPlot + Description : Fit plugin for "A*t^2*x/(1+4*PI^2*t^2*x^2)" + -------------------------------------------------------------------- + Copyright : (C) 2005 Ion Vasilief (ion_vasilief*yahoo.fr) + (replace * with @ in the email address) + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * As a special exception, you may omit the above copyright notice when * + * distributing modified copies of this file (for instance, when using it * + * as a template for your own fit plugin). * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + #include #include #include === added directory 'fitPlugins/planck_wavelength' === removed directory 'fitPlugins/planck_wavelength' === added file 'fitPlugins/planck_wavelength/planck_wavelength.c' --- fitPlugins/planck_wavelength/planck_wavelength.c 1970-01-01 00:00:00 +0000 +++ fitPlugins/planck_wavelength/planck_wavelength.c 2010-07-21 23:21:08 +0000 @@ -0,0 +1,102 @@ +/*************************************************************************** + File : planck_wavelength.c + Project : QtiPlot + Description : Fit plugin for "a/(x^5*(exp(b/x)-1))" + -------------------------------------------------------------------- + Copyright : (C) 2009 Knut Franke (knut.franke*gmx.de) + (replace * with @ in the email address) + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * As a special exception, you may omit the above copyright notice when * + * distributing modified copies of this file (for instance, when using it * + * as a template for your own fit plugin). * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + +#include +#include +#include + +struct data { + size_t n; + size_t p; + double * X; + double * Y; + double * sigma; +}; + +char * name() { return "PlanckWavelength"; } + +char * function() { return "a/(x^5*(exp(b/x)-1))"; } + +char * parameters() { return "a,b"; } + +double function_eval(double x, double * params) +{ + return params[0]/(pow(x,5)*(exp(params[1]/x)-1.0)); +} + +int function_f(const gsl_vector * params, void * void_data, gsl_vector * f) +{ + struct data * d = (struct data*) void_data; + double a = gsl_vector_get(params, 0); + double b = gsl_vector_get(params, 1); + size_t i; + for (i=0; in; i++) + gsl_vector_set(f, i, (a/(pow(d->X[i],5)*(exp(b/d->X[i])-1.0)) - d->Y[i])/d->sigma[i]); + return GSL_SUCCESS; +} + +int function_df(const gsl_vector * params, void * void_data, gsl_matrix *J) +{ + struct data * d = (struct data*) void_data; + double a = gsl_vector_get(params, 0); + double b = gsl_vector_get(params, 1); + size_t i; + for (i=0; in; i++) { + double x = d->X[i]; + gsl_matrix_set(J, i, 0, 1.0/(pow(x,5)*(exp(b/x)-1.0))); + gsl_matrix_set(J, i, 1, a/(pow(x,3)*pow(exp(b/x)-1, 2)*exp(b/x)*b)); + } + return GSL_SUCCESS; +} + +int function_fdf(const gsl_vector * params, void * void_data, gsl_vector * f, gsl_matrix * J) +{ + function_f(params, void_data, f); + function_df(params, void_data, J); + return GSL_SUCCESS; +} + +double function_d(const gsl_vector * params, void * void_data) +{ + struct data * d = (struct data*) void_data; + gsl_vector * f = gsl_vector_alloc(d->n); + double result = 0; + size_t i; + + function_f(params, void_data, f); + for (i=0; in; i++) + result += pow(gsl_vector_get(f, i), 2); + + gsl_vector_free(f); + return result; +} + === removed file 'fitPlugins/planck_wavelength/planck_wavelength.c' --- fitPlugins/planck_wavelength/planck_wavelength.c 2009-12-08 18:06:27 +0000 +++ fitPlugins/planck_wavelength/planck_wavelength.c 1970-01-01 00:00:00 +0000 @@ -1,70 +0,0 @@ -#include -#include -#include - -struct data { - size_t n; - size_t p; - double * X; - double * Y; - double * sigma; -}; - -char * name() { return "PlanckWavelength"; } - -char * function() { return "a/(x^5*(exp(b/x)-1))"; } - -char * parameters() { return "a,b"; } - -double function_eval(double x, double * params) -{ - return params[0]/(pow(x,5)*(exp(params[1]/x)-1.0)); -} - -int function_f(const gsl_vector * params, void * void_data, gsl_vector * f) -{ - struct data * d = (struct data*) void_data; - double a = gsl_vector_get(params, 0); - double b = gsl_vector_get(params, 1); - size_t i; - for (i=0; in; i++) - gsl_vector_set(f, i, (a/(pow(d->X[i],5)*(exp(b/d->X[i])-1.0)) - d->Y[i])/d->sigma[i]); - return GSL_SUCCESS; -} - -int function_df(const gsl_vector * params, void * void_data, gsl_matrix *J) -{ - struct data * d = (struct data*) void_data; - double a = gsl_vector_get(params, 0); - double b = gsl_vector_get(params, 1); - size_t i; - for (i=0; in; i++) { - double x = d->X[i]; - gsl_matrix_set(J, i, 0, 1.0/(pow(x,5)*(exp(b/x)-1.0))); - gsl_matrix_set(J, i, 1, a/(pow(x,3)*pow(exp(b/x)-1, 2)*exp(b/x)*b)); - } - return GSL_SUCCESS; -} - -int function_fdf(const gsl_vector * params, void * void_data, gsl_vector * f, gsl_matrix * J) -{ - function_f(params, void_data, f); - function_df(params, void_data, J); - return GSL_SUCCESS; -} - -double function_d(const gsl_vector * params, void * void_data) -{ - struct data * d = (struct data*) void_data; - gsl_vector * f = gsl_vector_alloc(d->n); - double result = 0; - size_t i; - - function_f(params, void_data, f); - for (i=0; in; i++) - result += pow(gsl_vector_get(f, i), 2); - - gsl_vector_free(f); - return result; -} - === added file 'fitPlugins/planck_wavelength/planck_wavelength.pro' --- fitPlugins/planck_wavelength/planck_wavelength.pro 1970-01-01 00:00:00 +0000 +++ fitPlugins/planck_wavelength/planck_wavelength.pro 2010-07-21 23:21:08 +0000 @@ -0,0 +1,27 @@ +QTI_ROOT = ../.. +!include( $$QTI_ROOT/build.conf ) { + message( "You need a build.conf with local settings!" ) +} + +QMAKE_PROJECT_DEPTH = 0 +linux-g++-64: libsuff=64 + +TARGET = planck_wavelength +TEMPLATE = lib +CONFIG += dll +CONFIG -= qt +CONFIG += release +DESTDIR = ../ + +INSTALLS += target + +INCLUDEPATH += $$GSL_INCLUDEPATH +LIBS += $$GSL_LIBS + +target.path=/usr/lib$${libsuff}/qtiplot/plugins + +SOURCES = planck_wavelength.c + +# At the very end: add global include- and lib path +INCLUDEPATH += $$SYS_INCLUDEPATH +LIBS += $$SYS_LIBS === removed file 'fitPlugins/planck_wavelength/planck_wavelength.pro' --- fitPlugins/planck_wavelength/planck_wavelength.pro 2009-12-08 18:06:27 +0000 +++ fitPlugins/planck_wavelength/planck_wavelength.pro 1970-01-01 00:00:00 +0000 @@ -1,27 +0,0 @@ -QTI_ROOT = ../.. -!include( $$QTI_ROOT/build.conf ) { - message( "You need a build.conf with local settings!" ) -} - -QMAKE_PROJECT_DEPTH = 0 -linux-g++-64: libsuff=64 - -TARGET = planck_wavelength -TEMPLATE = lib -CONFIG += dll -CONFIG -= qt -CONFIG += release -DESTDIR = ../ - -INSTALLS += target - -INCLUDEPATH += $$GSL_INCLUDEPATH -LIBS += $$GSL_LIBS - -target.path=/usr/lib$${libsuff}/qtiplot/plugins - -SOURCES = planck_wavelength.c - -# At the very end: add global include- and lib path -INCLUDEPATH += $$SYS_INCLUDEPATH -LIBS += $$SYS_LIBS === modified file 'manual/docbook-en/appendix.docbook' --- manual/docbook-en/appendix.docbook 2009-12-08 18:06:27 +0000 +++ manual/docbook-en/appendix.docbook 2010-07-21 23:21:08 +0000 @@ -183,7 +183,7 @@ muParser - The version of the muParser library used by &appname; is 1.28. + The version of the muParser library used by &appname; is 1.32. @@ -218,7 +218,19 @@ For the export of 3D plots &appname; also uses the libpng library. - + + libxls + + For the import of Excel .xls files &appname; also uses the libxls library. + + + + QuaZIP + + For the import of ODF spreadsheet .ods files &appname; uses the QuaZIP library. + + + Finally, if you want Python scripting support, you will also need to download and install: Python 2.x, === modified file 'manual/docbook-en/dialogs.docbook' --- manual/docbook-en/dialogs.docbook 2009-12-08 18:06:27 +0000 +++ manual/docbook-en/dialogs.docbook 2010-07-21 23:21:08 +0000 @@ -97,6 +97,19 @@
+ + If the function expression contains constants, e.g.: f(x) = a*x + b, QtiPlot automatically detects them and displays a two column table + on the right side of the dialog, containing input spin boxes that allow to choose appropriate values for those constants: + +
+ The &add-function-cmd; dialog box: automatic detection of constants. + + + + + +
+ The functions can also be defined in a parametric definition: if t is the parameter, the (x,y) data points are computed by x=f(t) and y=g(t). The first parameter is the name of the parametric variable (here t) followed by the range, the definition of the two functions and the number of data points.
@@ -178,14 +191,26 @@ This dialog is activated by selecting the command &arrange-layers-cmd; from the Graph Menu or by the key code &arrange-layers-key;. - It allows to modify the geometrical arrangement of the plots which are already present - in the active window. You can add new layers or remove existing ones using the Number of layers control. - You can specify the numbers of rows and columns which will define a grid of plots. -With the default settings, &appname; computes the size of the layers from the size of the window. If you check the Layer Canvas Size, - you can set the size of the layers and &appname; will modify the size of the window. - The controls in the two right group boxes, Alignment and Spacing, allow to set the alignment - of the layers in the window, and the margins between the layer borders and the window limits. -Finally you have the possibility to swap two layers using the Swap Layers box. +It allows to modify the geometrical arrangement of the plots which are already present +in the active window. You can add new layers or remove existing ones using the Number of layers control. +By checking the Link X axes option, the layers will be interconnected, +meaning that if you manually set the abscissae scale limits for one plot layer, the same limits will be automatically set +for all other layers in the plot window. + +You can specify the numbers of rows and columns which will define a grid of plots. +With the default settings, &appname; computes the size of the layers from the size of the window. +If you check the Layer Canvas Size, +you can set the size of drawing area of the layers and &appname; will modify the size of the window. +By checking the Fixed size box, the size of the layers will be kept unchanged when you manually +resize the plot window. + +The controls in the two right group boxes, Alignment and Spacing, +allow to set the alignment of the layers in the window, and the margins between the layer borders and the window limits. +By choosing, the option Canvases for the Spacing | Align field, +the spacing defines the distance between the axes of the layers, whereas with the Layers + option it defines the distance between the borders of the layers. + +Finally you have the possibility to swap two layers using the Swap Layers box.
The &arrange-layers-cmd; dialog: the geometry tab @@ -645,41 +670,6 @@ - - - - Add/Remove curves - This dialog is activated by selecting the command &add-remove-curve-cmd; from the Graph Menu. - The left window shows the columns which are available for plotting in the different tables of the project. - If the Show current folder only option is checked, only the tables in the active folder of the - project will be listed in this window. - The right window gives the list of the curves already plotted. - In the case presented below, there are two tables from which the &add-remove-curve-cmd; - dialog box allows to select columns. If you use this dialog box to add a column, - the X column will be the one defined as X in the corresponding table. -
- The &add-remove-curve-cmd; dialog box. - - - - - -
- - In this dialog box, if you select one curve of the plot in the right window, - you can change the columns used for X and Y with the Plot Association button. - In any case, you can't mix the X values of one table with the Y values of another one. - If you want to do this, you have to copy the columns in the same table. - If the curve selected is a function, you can modify it by pressing the Edit Function... button. - Refer to the &add-function-cmd; dialog box for more details on functions editing. -If the Show Range option is checked, the plot range of all the curves -not defined as analytical functions will be also displayed in the right window of the dialog. -The plot range is the interval of points which are visible in a curve. You can show/hide data points from -a selected curve, without having to delete them, by pressing the Edit Range... button, -which opens a dialog allowing to edit the plot range. -
- - @@ -1075,7 +1065,17 @@
- The fifth tab named Fonts defines the default fonts used when you create a new plot. + + The fifth tab named Geometry defines the default size for the drawing area of a plot layer. + + + + + + + + + The sixth tab named Fonts defines the default fonts used when you create a new plot. @@ -1230,8 +1230,8 @@
-If you want to import several data files, the first parameter Import each file as -must be set to "New Table". +You can define a custom file filter in the Files of type: field in order to preselect files + (e.g. typing *.mydata then "Enter" so that only files XXX.mydata are listed in the directory view). Concerning the separator which is used between the columns, you must bear in mind that there is no grouping of separators, so if you use "SPACE", you must use only one @@ -1247,20 +1247,15 @@ to be displayed in the table header, you must use the same separator between the column names and between the data columns. -Finally, assuming that the data files you want to import were created +Assuming that the data files you want to import were created using different decimal separator conventions than the ones you're using, like for example a comma character for the decimal point instead of a dot character, you have the possibility to convert the data to your current settings, by specifying the Decimal Separators convention used in the ASCII files -in conjunction with the Omit thousands separator option. +in conjunction with the Omit thousands separator option. -If an ASCII file contains text columns you can only import them correctly if the -combination Decimal Separators + Omit thousands separator -is the same as the one specified in the Numeric Format -tab from the Preferences dialog (the default settings). -Otherwise &appname; will try to convert the texts to floating point values and -all text cells will be overwritten and set to zero. - +Finally, you can specify the kind of data to be imported in each column by clicking on the column header of the preview table. + A dialog will pop-up allowing you to choose a data type (the default data type for each column is Numeric). @@ -1352,15 +1347,26 @@ - The third tab is used to define or modify the title of the plot. You can not add subscripts/superscripts, bold characters, etc in your title as you can do it for 2D plots. + + The third tab is used to define or modify the properties of the plot grid. - + - The fourth tab allows to modify the colors used in the different elements of the plot. + + The fourth tab is used to define or modify the title of the plot. You can not add subscripts/superscripts, bold characters, etc in your title as you can do it for 2D plots. + + + + + + + + + The fifth tab allows to modify the colors used in the different elements of the plot. @@ -1377,16 +1383,28 @@ between 0 and 255. The numbers should be separated by spaces. You can find several examples of colormaps on the QtiPlot web site. -The last tab is used to define some global parameters and the aspect ratio of the plot. The default behaviour is to use the perspective to compute the 3D plot. If you choose to check the Orthogonal check box, the plot will use vertical Z axis whatever the view angle of the plot. +The General tab is used to define some global parameters and the aspect ratio of the plot. The default behaviour is to use the perspective to compute the 3D plot. If you choose to check the Orthogonal check box, the plot will use vertical Z axis whatever the view angle of the plot.
- The surface plot options dialog box with tab 5: aspect ratio. + The general plot options tab.
+ +The Print tab is used to define some useful print options, like scaling to the paper size or + showing the cropmarks. + +
+ The 3D plot print options. + + + + + +
@@ -1429,8 +1447,13 @@ If the Auto-update box is checked the legend is updated each time -a curve is added or removed from the plot layer. -By pressing the Set As Default button all text format options will +a curve is added or removed from the plot layer. + +The TeX Output option specifies if LaTeX special characters should be escaped or not when exporting +to .tex files. If the text contains LaTeX syntax (like superscripts, subscripts, etc...) and you want them to be interpreted +by the LaTeX compiler, you should check this option. + +By pressing the Set As Default button all text format options will be saved to the user preferences and will be applied to new text objects. The Apply to... button can be used to apply the format options to all text objects in the active plot layer or in the current plot window or in === modified file 'manual/docbook-en/index.docbook' --- manual/docbook-en/index.docbook 2009-12-08 18:06:27 +0000 +++ manual/docbook-en/index.docbook 2010-07-21 23:21:08 +0000 @@ -86,7 +86,7 @@ Append Project..."> Append Project... command'> Ctrl-Alt-A"> - '> + '> Recent Projects"> Recent Projects command'> @@ -290,7 +290,7 @@ Rescale to Show All"> Rescale to Show All command'> Ctrl-Shift-R"> -'> +'> Remove Layer"> Remove Layer command'> @@ -477,15 +477,15 @@ Set Column As command'> Set Column As -> X"> Set Column As -> X command'> -'> +'> Set Column As -> Y"> Set Column As -> Y command'> -'> +'> Set Column As -> Z"> Set Column As -> Z command'> -'> +'> Set Column As -> X error"> Set Column As -> X error command'> @@ -501,7 +501,7 @@ Set Column As -> Disregard"> Set Column As -> Disregard command'> -'> +'> Column Options..."> Column Options... command'> @@ -690,7 +690,7 @@ Remove Bad Data Points"> Remove Bad Data Points command'> Alt-B"> - '> + '> === modified file 'manual/docbook-en/scripting.docbook' --- manual/docbook-en/scripting.docbook 2009-12-08 18:06:27 +0000 +++ manual/docbook-en/scripting.docbook 2010-07-21 23:21:08 +0000 @@ -1017,19 +1017,37 @@ # and t.setCell(col, row, value) + Whenever you have to specify a column, you can use either the column name (as a string) or the consecutive column number (starting -with 1). Row numbers also start with 1, just as they are displayed. If -you want to work with arbitrary texts or the textual representations +with 1). Row numbers also start with 1, just as they are displayed. +In many places there is an alternative API which represents a table +as a Python sequence is provided. Here rows are addressed by Python +indices or slices which start at 0. These places are marked as such. + + +If you want to work with arbitrary texts or the textual representations of numeric values, you can use: t.text(col, row) # and t.setText(col, row, string) +An alternative way to get/set the value of a cell is using the format of the column (Text, Numeric, ...). +Qtiplot handles all the casting under the hood and throws an TypeError if this isn't possible. +Assigning None will clear the cell's value. +The column type Day-of-Week returns/accepts the numbers 1 (monday) to 7 (sunday, for which also 0 is accepted). +The column type Month returns/accepts the numbers 1 to 12. +The column type Date returns/accepts datetime.datetime objects and also accepts a QDateTime. +The column type Time returns/accepts datetime.time objects and also accepts a QTime. + +t.cellData(col, row) +# and +t.setCellData(col, row, value) + The number of columns and rows is accessed via: -t.numRows() +t.numRows() # same as len(t) t.numCols() t.setNumRows(number) t.setNumCols(number) @@ -1041,6 +1059,54 @@ t.addColumn() t.insertColumns(startColumn, count) +Adding an empty row at the end of the table is done with the addRow() method. +It returns the new row number. + +newRowIndex = t.addRow() + + +If you need all the data of a row or column you can use the rowData() +and colData() methods. This is much faster then iterating manually over the cells. +Alternatively you can use the [] operator in combination with Python indices or slices, +which start at 0. + +valueList = t.colData(col) # col may be a string or a number starting at 1 +rowTuple = t.rowData(row) # row number starting at 1 +rowTuple = t[idx] # row index starts at 0 +rowTupleList = t[slice] + + +A Table is iteratable. The data is returned row wise as tuple. + +for c1, c2, c3 in t: + # do stuff, assuming t has three columns + + +Assigning values to a complete row or column is also possible. +While the new row data has to be a tuple which length must match the column number, +column data just has to be iteratable. If the iterator stops before the end of the table +is reached, a StopIteration exception is raised. +In combination with the offset this allows to fill a column chunk wise. +A positive offset starts filling the column after this row number. +A negative offset ignores the firsts values of the iterator. + +t.setColData(col, iterableValueSequence, offset=0) +# just fill the first column with a list of values, staring at row 6 +t.setColData(1, [12,23,34,56,67], 5) +# fill the second column with fibonacci numbers, omitting the first three. +def FibonacciGenerator(): + a, b = 1, 1 + while True: + a, b = b, a+b + yield a +t.setColData(2, FibonacciGenerator(), -3) +t.setRowData(row, rowTuple) # row starts at 1 +# assuming t has exactly two columns... +t.setRowData(2, (23, 5)) # fill the second row +t[1] = 23, 5 # using a Python index, starting at 0 +# adding a new row and set it's values +t.appendRowData(rowTuple) + You can set the format of a column to text using: @@ -1286,16 +1352,25 @@ t.removeCol(number) t.deleteRows(startRowNumber, endRowNumber) +It is also possible to use Python's del statement to remove rows. +Note that in this case a Python index or slice (instead of row numbers) is used, which start at 0. + +del t[5] # deletes row 6 +del t[0:4] # deletes row 1 to 5 + Column names can be read and written with: t.colName(number) +t.colNames() t.setColName(col, newName, enumerateRight=False) +t.setColNames(newNamesList) If enumerateRight is set to True, all the table columns starting from index col will have their names modified to a combination of the newName and a numerical increasing index. If this parameter is not specified, by default it is set to False. +The plural forms get/set all headers at once. You can change the plot role of a table column (abscissae, ordinates, error bars, etc...) using: @@ -1358,11 +1433,14 @@ t.sort(type = 0, order = 0, leadingColumnName) + +Import ASCII files + Import values from file, using sep as separator char, ignoring ignoreLines lines at the head of the file and all lines starting with a comment string. t.importASCII(file, sep="\t",ignoreLines=0,renameCols=False,stripSpaces=True,simplifySpace=False, -importComments=False,comment="#",readOnly=False,importAs=Table.Overwrite,endLine=0,maxRows=-1) +importComments=False,comment="#",readOnly=False,importAs=Table.Overwrite,locale=QLocale(),endLine=0,maxRows=-1) As you see from the above list of import options, you have the possibility to set the new columns as read-only. @@ -1433,6 +1511,32 @@ + + + +Importing Excel sheets + +It is possible to import a sheet from an Excel .xls file file to a table, using: + +t = importExcel(file, sheet) + +If the integer sheet variable is not specified, all non-empty sheets in the Excel workbook are imported + into separate tables and a reference to the table containing the data from the last sheet is returned. + + + +Importing ODF spreadsheets + +It is possible to import a sheet from an ODF spreadsheet .ods file to a table, using: + +t = importOdfSpreadsheet(file, sheet) + +If the integer sheet variable is not specified, all non-empty sheets in the spreadsheet are imported + into separate tables and a reference to the table containing the data from the last sheet is returned. + + + +Export Tables You can export values from a table to an ASCII file, using sep as separator chararacter. The ColumnLabels option @@ -1453,6 +1557,7 @@ t.setCommand(col, newExpression) t.recalculate(col, startRow=1, endRow=-1, forceMuParser=False, notifyChanges=True) + You can access the column comments and enable/disable their display via the following functions: @@ -1471,6 +1576,11 @@ t.showAllColumns() +You can ensure the visibility of a cell with: + +t.scrollToCell(col, row) + + After having changed some table values from a script, you will likely want to update dependent Graphs: t.notifyChanges() @@ -1483,6 +1593,12 @@ t.setCell(1, i, i**2) t.notifyChanges() +While the above is easy to understand, there is a faster and more pythonic way of doing the same: + +t = table("table1") +t.setColData(1, [i*i for i in range(len(t))]) +t.notifyChanges() + You can check if a column or row of a table is selected by using the following functions: @@ -1491,11 +1607,14 @@ t.isRowSelected(row) + +R interface + If RPy2 is available, the default initialization file sets up the helper functions qti.Table.toRDataFrame and qti.app.newTableFromRDataFrame to convert back and forth -between R data frames and Qtiplot tables. +between R data frames and &appname; tables. Here is a little example of an R session... df <- read.table("/some/path/data.csv", header=TRUE) @@ -1504,7 +1623,7 @@ source("/some/path/my_func.r") new_df <- my_func(df, foo=bar) -... and now the same from within Qtiplot: +... and now the same from within &appname;: df = table("Table1").toRDataFrame() print R.mean(df), R.var(df) @@ -1512,6 +1631,7 @@ new_df = R.my_func(df, foo=bar) newTableFromRDataFrame(new_df, "my result table") + @@ -1924,10 +2044,21 @@ Sometimes, when performing data analysis, one might need the curve title. It is possible to obtain it using the method bellow: - title = l.curveTitle(curveIndex) - - -Use the following function to change the axis attachment of a curve: +title = l.curveTitle(curveIndex) + + +It is possible to get a reference to a curve on the layer l using it's index or it's title, like shown bellow: + +c = l.curve(curveIndex) +c = l.curve(curveTitle) +dc = l.dataCurve(curveIndex) + +Please, keep in mind the fact that the above methods might return an invalid reference +if the curve with the specified index/title is not a PlotCurve or a DataCurve object, respectively. +For example, an analytical function curve is a PlotCurve but not a DataCurve and spectrograms are a +completely different type of plot items which are neither PlotCurves nor DataCurves. + +Use the following function to change the axis attachment of a curve: l.setCurveAxes(number, x-axis, y-axis) @@ -1973,7 +2104,7 @@ l.setIndexedColors() # uses the colors in the default QtiPlot color list: 0 = black, 1 = red, 2 = green, etc... -You can display labels showing the y values for each data point in a plot curve: +You can display labels showing the y values for each data point in a DataCurve: c.setLabelsColumnName("Table1_2") c.setLabelsOffset(50, 50) @@ -1989,7 +2120,7 @@ l.replot() # redraw the plot layer object -If you need to change the range of data points displayed in a curve you can use +If you need to change the range of data points displayed in a DataCurve you can use the following methods: c.setRowRange(int startRow, int endRow) @@ -2169,7 +2300,18 @@ g3 = plot(m, Layer.GrayScale) -It is possible to fine tune the plots created from the matrix: +The plot functions above return a reference to the multilayer plot window. If you need a reference to the +spectrogram object itself, you can get it as shown in the example bellow: + +m = newMatrix("TestMatrix", 1000, 800) +m.setFormula("x*y") +m.calculate() +g = plot(m, Layer.ColorMap) +s = g.activeLayer().spectrogram(m) +s.setColorBarWidth(20) + + +It is possible to fine tune the plots created from a matrix: m = newMatrix("TestMatrix", 1000, 800) @@ -2211,6 +2353,7 @@ s.setCustomColorMap(LinearColorMap map) s.showContourLineLabels(bool show = True) # enable/disable contour line labels s.setLabelsOffset(int x, int y) # offset values for all labels in % of the text size +s.updateData() @@ -2606,9 +2749,20 @@ l.remove(arrow1) -As you might notice from the sample code above, the addArrow function +As you might notice from the sample code above, the addArrow function returns a reference to a new arrow object that can be used later on to modify this -new arrow or to delete it with the remove function. +new arrow or to delete it with the remove function. + +It is possible to modify the properties of all the lines/arrows in a plot layer, see the short example bellow: + +g = graph("Graph1").activeLayer() +lst = g.arrowsList() +for i in range (0, g.numArrows()): + lst[i].setColor(Qt.green) + +g.replot() + + @@ -2690,8 +2844,22 @@ - -Resize events + +Resizing layers +A layer can be resized using the methods bellow, where the first argument is the new width, + the second is the new height and sizes are defined in pixels: + + l.resize(200, 200); + l.resize(QSize(w, h)) + + + If you also need to reposition the layer, you can use the following functions, where the first two arguments + specify the new position of the top left corner of the canvas: + + l.setGeometry(100, 100, 200, 200); + l.setGeometry(QRect(x, y, w, h)); + + The default behaviour of 2D plot layers, with respect to the resizing of the graph window is to adapt the sizes of the fonts used for the various texts, to the new size of the plot window. You can override this behaviour and keep the size of the fonts unchanged: @@ -2700,6 +2868,25 @@ + +Resizing the drawing area + The drawing area of a layer (the canvas) can be resized using the methods bellow, where the first argument is the new width, + the second is the new height and sizes are defined in pixels: + + l.setCanvasSize(200, 200); + l.setCanvasSize(QSize(w, h)) + + + If you also need to reposition the canvas, you can use the following functions, where the first two arguments + specify the new position of the top left corner of the canvas: + + l.setCanvasGeometry(100, 100, 200, 200); + l.setCanvasGeometry(QRect(x, y, w, h)); + + +Please keep in mind that the fonts of the layer are not rescaled when you resize the layer canvas using the above methods. + + Exporting plots/layers to different image formats Layers and whole Graphs can be printed and exported from within Python. @@ -2830,12 +3017,15 @@ refer to the position of the top-left corner of the layer. The origin of the coordinates system coincides with the top-left corner of the plot window, the y coordinate increasing towards the bottom of the window. If the width and height of the layer are not specified -they will be set to the default values: +they will be set to the default values. The last argument specifies if the default preferences, specified via the +Preferences dialog, will be used to customize the new layer + (default value is False): g = newGraph() l1 = g.addLayer() -l2 = g.addLayer(10, 20, 200, 200) -l3 = g.addLayer(215, 20) +l2 = g.addLayer(215, 20) +l3 = g.addLayer(10, 20, 200, 200) +l4 = g.addLayer(10, 20, 200, 200, True) You can remove a plot layer using: @@ -3097,6 +3287,47 @@ g.setLabelsDistance(30) +It is possible to set the numerical format and precision of the axes using the function bellow: + +g.setAxisNumericFormat(axis, format, precision) + +where the first parameter is the index of the axis: 0 for X, 1 for Y and 2 for Z, the second one is the numerical format: + + + 0. + + Graph3D.Default: decimal or scientific, depending which is most compact + + + + 1. + + Graph3D.Decimal: 10000.0 + + + + 2. + + Graph3D.Scientific: 1e4 + + + + 3. + + Graph3D.Engineering: 10k + + + + +and the last parameter is the precision (the number of significant digits). + +The following convenience functions are also provided, where you don't have to specify the index of the axis anymore: + +g.setXAxisNumericFormat(1, 3) +g.setYAxisNumericFormat(1, 3) +g.setZAxisNumericFormat(1, 3) + + Also, you can fix the length of the major and minor ticks of an axis: g.setXAxisTickLength(2.5, 1.5) @@ -3772,7 +4003,7 @@ t = newTable() t.setCell(1, 1, ui.valueBox.value()) -ui = uic.loadUi("dialog.ui") +ui = uic.loadUi("myDialog.ui") ui.connect(ui.okButton, QtCore.SIGNAL("clicked()"), createTable) ui.show() === removed file 'manual/html/icons/add.png' Binary files manual/html/icons/add.png 2008-06-12 08:57:17 +0000 and manual/html/icons/add.png 1970-01-01 00:00:00 +0000 differ === modified file 'manual/html/icons/addCol.png' Binary files manual/html/icons/addCol.png 2008-06-12 08:57:17 +0000 and manual/html/icons/addCol.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/add_inset_curve_layer.png' Binary files manual/html/icons/add_inset_curve_layer.png 2008-08-17 19:43:31 +0000 and manual/html/icons/add_inset_curve_layer.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/add_inset_layer.png' Binary files manual/html/icons/add_inset_layer.png 2008-08-17 19:43:31 +0000 and manual/html/icons/add_inset_layer.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/add_zoom_plot.png' Binary files manual/html/icons/add_zoom_plot.png 2008-08-17 19:43:31 +0000 and manual/html/icons/add_zoom_plot.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/adjust_col_width.png' Binary files manual/html/icons/adjust_col_width.png 1970-01-01 00:00:00 +0000 and manual/html/icons/adjust_col_width.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/append_drag_curves.png' Binary files manual/html/icons/append_drag_curves.png 1970-01-01 00:00:00 +0000 and manual/html/icons/append_drag_curves.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/append_file.png' Binary files manual/html/icons/append_file.png 1970-01-01 00:00:00 +0000 and manual/html/icons/append_file.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/area.png' Binary files manual/html/icons/area.png 2008-06-12 08:57:17 +0000 and manual/html/icons/area.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/arrangeLayers.png' Binary files manual/html/icons/arrangeLayers.png 2008-08-17 19:43:31 +0000 and manual/html/icons/arrangeLayers.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/arrow.png' Binary files manual/html/icons/arrow.png 2008-08-17 19:43:31 +0000 and manual/html/icons/arrow.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/arrow_down.png' Binary files manual/html/icons/arrow_down.png 1970-01-01 00:00:00 +0000 and manual/html/icons/arrow_down.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/arrow_up.png' Binary files manual/html/icons/arrow_up.png 1970-01-01 00:00:00 +0000 and manual/html/icons/arrow_up.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/auto_layout.png' Binary files manual/html/icons/auto_layout.png 2008-08-17 19:43:31 +0000 and manual/html/icons/auto_layout.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/icons/back.png' Binary files manual/html/icons/back.png 2008-06-12 08:57:17 +0000 and manual/html/icons/back.png 1970-01-01 00:00:00 +0000 differ === modified file 'manual/html/icons/backGrid.png' Binary files manual/html/icons/backGrid.png 2008-06-12 08:57:17 +0000 and manual/html/icons/backGrid.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/bars.png' Binary files manual/html/icons/bars.png 2008-06-12 08:57:17 +0000 and manual/html/icons/bars.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/bottom_axis.png' Binary files manual/html/icons/bottom_axis.png 1970-01-01 00:00:00 +0000 and manual/html/icons/bottom_axis.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/bottom_scl.png' Binary files manual/html/icons/bottom_scl.png 2008-06-12 08:57:17 +0000 and manual/html/icons/bottom_scl.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/box.png' Binary files manual/html/icons/box.png 2008-06-12 08:57:17 +0000 and manual/html/icons/box.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/boxPlot.png' Binary files manual/html/icons/boxPlot.png 2008-06-12 08:57:17 +0000 and manual/html/icons/boxPlot.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/ceilGrid.png' Binary files manual/html/icons/ceilGrid.png 2008-06-12 08:57:17 +0000 and manual/html/icons/ceilGrid.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/icons/chain.png' Binary files manual/html/icons/chain.png 2008-06-12 08:57:17 +0000 and manual/html/icons/chain.png 1970-01-01 00:00:00 +0000 differ === modified file 'manual/html/icons/clock.png' Binary files manual/html/icons/clock.png 2008-08-17 19:43:31 +0000 and manual/html/icons/clock.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/close.png' Binary files manual/html/icons/close.png 2008-06-12 08:57:17 +0000 and manual/html/icons/close.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/col_stat.png' Binary files manual/html/icons/col_stat.png 2008-06-12 08:57:17 +0000 and manual/html/icons/col_stat.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/color_map.png' Binary files manual/html/icons/color_map.png 2008-06-12 08:57:17 +0000 and manual/html/icons/color_map.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/comment.png' Binary files manual/html/icons/comment.png 1970-01-01 00:00:00 +0000 and manual/html/icons/comment.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/cones.png' Binary files manual/html/icons/cones.png 2008-06-12 08:57:17 +0000 and manual/html/icons/cones.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/configTable.png' Binary files manual/html/icons/configTable.png 2008-06-12 08:57:17 +0000 and manual/html/icons/configTable.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/config_curves.png' Binary files manual/html/icons/config_curves.png 2008-06-12 08:57:17 +0000 and manual/html/icons/config_curves.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/configure.png' Binary files manual/html/icons/configure.png 1970-01-01 00:00:00 +0000 and manual/html/icons/configure.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/contour_map.png' Binary files manual/html/icons/contour_map.png 2008-06-12 08:57:17 +0000 and manual/html/icons/contour_map.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/copy.png' Binary files manual/html/icons/copy.png 2008-06-12 08:57:17 +0000 and manual/html/icons/copy.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/crosses.png' Binary files manual/html/icons/crosses.png 2008-06-12 08:57:17 +0000 and manual/html/icons/crosses.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/cursor.png' Binary files manual/html/icons/cursor.png 2008-08-17 19:43:31 +0000 and manual/html/icons/cursor.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/cursor_16.png' Binary files manual/html/icons/cursor_16.png 1970-01-01 00:00:00 +0000 and manual/html/icons/cursor_16.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/cursors.png' Binary files manual/html/icons/cursors.png 2008-08-17 19:43:31 +0000 and manual/html/icons/cursors.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/curves.png' Binary files manual/html/icons/curves.png 2008-06-12 08:57:17 +0000 and manual/html/icons/curves.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/cut.png' Binary files manual/html/icons/cut.png 2008-06-12 08:57:17 +0000 and manual/html/icons/cut.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/decrease_decimals.png' Binary files manual/html/icons/decrease_decimals.png 1970-01-01 00:00:00 +0000 and manual/html/icons/decrease_decimals.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/decrease_indent.png' Binary files manual/html/icons/decrease_indent.png 1970-01-01 00:00:00 +0000 and manual/html/icons/decrease_indent.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/delete.png' Binary files manual/html/icons/delete.png 1970-01-01 00:00:00 +0000 and manual/html/icons/delete.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/delete_column.png' Binary files manual/html/icons/delete_column.png 1970-01-01 00:00:00 +0000 and manual/html/icons/delete_column.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/delete_row.png' Binary files manual/html/icons/delete_row.png 1970-01-01 00:00:00 +0000 and manual/html/icons/delete_row.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/disregard_col.png' Binary files manual/html/icons/disregard_col.png 1970-01-01 00:00:00 +0000 and manual/html/icons/disregard_col.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/icons/down.png' Binary files manual/html/icons/down.png 2008-06-12 08:57:17 +0000 and manual/html/icons/down.png 1970-01-01 00:00:00 +0000 differ === added file 'manual/html/icons/drag_curve.png' Binary files manual/html/icons/drag_curve.png 1970-01-01 00:00:00 +0000 and manual/html/icons/drag_curve.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/drag_curves.png' Binary files manual/html/icons/drag_curves.png 1970-01-01 00:00:00 +0000 and manual/html/icons/drag_curves.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/draw_points.png' Binary files manual/html/icons/draw_points.png 2008-06-12 08:57:17 +0000 and manual/html/icons/draw_points.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/dropLines.png' Binary files manual/html/icons/dropLines.png 2008-06-12 08:57:17 +0000 and manual/html/icons/dropLines.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/duplicate.png' Binary files manual/html/icons/duplicate.png 2008-06-12 08:57:17 +0000 and manual/html/icons/duplicate.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/equation.png' Binary files manual/html/icons/equation.png 2008-08-17 19:43:31 +0000 and manual/html/icons/equation.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/erase.png' Binary files manual/html/icons/erase.png 2008-06-12 08:57:17 +0000 and manual/html/icons/erase.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/errors.png' Binary files manual/html/icons/errors.png 2008-06-12 08:57:17 +0000 and manual/html/icons/errors.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/execute_selection.png' Binary files manual/html/icons/execute_selection.png 1970-01-01 00:00:00 +0000 and manual/html/icons/execute_selection.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/exp.png' Binary files manual/html/icons/exp.png 2008-06-12 08:57:17 +0000 and manual/html/icons/exp.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/extract_graphs.png' Binary files manual/html/icons/extract_graphs.png 2008-08-17 19:43:31 +0000 and manual/html/icons/extract_graphs.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/extract_layers.png' Binary files manual/html/icons/extract_layers.png 2008-08-17 19:43:31 +0000 and manual/html/icons/extract_layers.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/icons/fileappend.png' Binary files manual/html/icons/fileappend.png 2009-11-18 10:33:29 +0000 and manual/html/icons/fileappend.png 1970-01-01 00:00:00 +0000 differ === modified file 'manual/html/icons/fileopen.png' Binary files manual/html/icons/fileopen.png 2008-06-12 08:57:17 +0000 and manual/html/icons/fileopen.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/fileprint.png' Binary files manual/html/icons/fileprint.png 2008-06-12 08:57:17 +0000 and manual/html/icons/fileprint.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/filesave.png' Binary files manual/html/icons/filesave.png 2008-06-12 08:57:17 +0000 and manual/html/icons/filesave.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/filesaveas.png' Binary files manual/html/icons/filesaveas.png 1970-01-01 00:00:00 +0000 and manual/html/icons/filesaveas.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/find.png' Binary files manual/html/icons/find.png 1970-01-01 00:00:00 +0000 and manual/html/icons/find.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/find_next.png' Binary files manual/html/icons/find_next.png 1970-01-01 00:00:00 +0000 and manual/html/icons/find_next.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/find_previous.png' Binary files manual/html/icons/find_previous.png 1970-01-01 00:00:00 +0000 and manual/html/icons/find_previous.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/fit.png' Binary files manual/html/icons/fit.png 2008-06-12 08:57:17 +0000 and manual/html/icons/fit.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/fit_frame.png' Binary files manual/html/icons/fit_frame.png 2008-06-12 08:57:17 +0000 and manual/html/icons/fit_frame.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/flip_horizontal.png' Binary files manual/html/icons/flip_horizontal.png 1970-01-01 00:00:00 +0000 and manual/html/icons/flip_horizontal.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/flip_vertical.png' Binary files manual/html/icons/flip_vertical.png 1970-01-01 00:00:00 +0000 and manual/html/icons/flip_vertical.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/floor.png' Binary files manual/html/icons/floor.png 2008-06-12 08:57:17 +0000 and manual/html/icons/floor.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/floorGrid.png' Binary files manual/html/icons/floorGrid.png 2008-06-12 08:57:17 +0000 and manual/html/icons/floorGrid.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/folder.png' Binary files manual/html/icons/folder.png 2008-06-12 08:57:17 +0000 and manual/html/icons/folder.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/folder_closed.png' Binary files manual/html/icons/folder_closed.png 2008-06-12 08:57:17 +0000 and manual/html/icons/folder_closed.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/folder_open.png' Binary files manual/html/icons/folder_open.png 2008-06-12 08:57:17 +0000 and manual/html/icons/folder_open.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/formula.png' Binary files manual/html/icons/formula.png 1970-01-01 00:00:00 +0000 and manual/html/icons/formula.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/icons/forward.png' Binary files manual/html/icons/forward.png 2008-06-12 08:57:17 +0000 and manual/html/icons/forward.png 1970-01-01 00:00:00 +0000 differ === added file 'manual/html/icons/fraction.png' Binary files manual/html/icons/fraction.png 1970-01-01 00:00:00 +0000 and manual/html/icons/fraction.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/free_axes.png' Binary files manual/html/icons/free_axes.png 2008-06-12 08:57:17 +0000 and manual/html/icons/free_axes.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/frontGrid.png' Binary files manual/html/icons/frontGrid.png 2008-06-12 08:57:17 +0000 and manual/html/icons/frontGrid.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/fx.png' Binary files manual/html/icons/fx.png 2008-06-12 08:57:17 +0000 and manual/html/icons/fx.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/general.png' Binary files manual/html/icons/general.png 2008-06-12 08:57:17 +0000 and manual/html/icons/general.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/icons/gomme.png' Binary files manual/html/icons/gomme.png 2008-08-17 19:43:31 +0000 and manual/html/icons/gomme.png 1970-01-01 00:00:00 +0000 differ === modified file 'manual/html/icons/graph.png' Binary files manual/html/icons/graph.png 2008-06-12 08:57:17 +0000 and manual/html/icons/graph.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/graph_disabled.png' Binary files manual/html/icons/graph_disabled.png 1970-01-01 00:00:00 +0000 and manual/html/icons/graph_disabled.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/graph_enabled.png' Binary files manual/html/icons/graph_enabled.png 1970-01-01 00:00:00 +0000 and manual/html/icons/graph_enabled.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/gray_map.png' Binary files manual/html/icons/gray_map.png 2008-06-12 08:57:17 +0000 and manual/html/icons/gray_map.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/grid_only.png' Binary files manual/html/icons/grid_only.png 2008-06-12 08:57:17 +0000 and manual/html/icons/grid_only.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/grid_poly.png' Binary files manual/html/icons/grid_poly.png 2008-06-12 08:57:17 +0000 and manual/html/icons/grid_poly.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/hBars.png' Binary files manual/html/icons/hBars.png 2008-06-12 08:57:17 +0000 and manual/html/icons/hBars.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/hand.png' Binary files manual/html/icons/hand.png 2008-08-17 19:43:31 +0000 and manual/html/icons/hand.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/help.png' Binary files manual/html/icons/help.png 1970-01-01 00:00:00 +0000 and manual/html/icons/help.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/histogram.png' Binary files manual/html/icons/histogram.png 2008-06-12 08:57:17 +0000 and manual/html/icons/histogram.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/icons/home.png' Binary files manual/html/icons/home.png 2008-06-12 08:57:17 +0000 and manual/html/icons/home.png 1970-01-01 00:00:00 +0000 differ === modified file 'manual/html/icons/hor_steps.png' Binary files manual/html/icons/hor_steps.png 2008-06-12 08:57:17 +0000 and manual/html/icons/hor_steps.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/icons/horizont_scl.png' Binary files manual/html/icons/horizont_scl.png 2008-06-12 08:57:17 +0000 and manual/html/icons/horizont_scl.png 1970-01-01 00:00:00 +0000 differ === added file 'manual/html/icons/horizontal_grid.png' Binary files manual/html/icons/horizontal_grid.png 1970-01-01 00:00:00 +0000 and manual/html/icons/horizontal_grid.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/icons.qrc' --- manual/html/icons/icons.qrc 1970-01-01 00:00:00 +0000 +++ manual/html/icons/icons.qrc 2010-07-21 23:21:08 +0000 @@ -0,0 +1,225 @@ + + + comment.png + execute_selection.png + magnifier_hor.png + magnifier_vert.png + open_excel.png + ods_spreadsheet.png + help.png + reload.png + image_profiles.png + sort.png + preview.png + decrease_decimals.png + increase_decimals.png + configure.png + replace.png + find_previous.png + find_next.png + increase_indent.png + decrease_indent.png + play.png + arrow_down.png + arrow_up.png + drag_curves.png + append_drag_curves.png + plus.png + folder_open.png + folder_closed.png + adjust_col_width.png + move_row_down.png + move_row_up.png + stack_column.png + stack_bar.png + waterfall_plot.png + delete.png + append_file.png + find.png + magnifier.png + leaf.png + extract_layers.png + extract_graphs.png + add_zoom_plot.png + add_inset_curve_layer.png + add_inset_layer.png + plot_double_y.png + equation.png + sort_descending.png + sort_ascending.png + formula.png + rotate_counterclockwise.png + rotate_clockwise.png + flip_vertical.png + flip_horizontal.png + delete_column.png + insert_column.png + delete_row.png + insert_row.png + set_label_col.png + index.png + exp.png + draw_points.png + image_plot.png + move_col_first.png + move_col_last.png + x_col.png + y_col.png + z_col.png + disregard_col.png + move_col_right.png + move_col_left.png + pdf.png + fit_frame.png + reset_rotation.png + perspective.png + gray_map.png + contour_map.png + color_map.png + auto_layout.png + movie.png + python.png + fit.png + zoomOut.png + configTable.png + config_curves.png + general.png + swap_columns.png + resize.png + newfolder.png + folder_open.png + note.png + new_note.png + new_graph.png + vectXYAM.png + vectXYXY.png + open_template.png + save_template.png + boxPlot.png + clock.png + matrix.png + new_matrix.png + prev.png + next.png + stacked.png + panel_v2.png + panel_4.png + panel_h2.png + stacked_hist.png + histogram.png + dropLines.png + spline.png + hor_steps.png + vert_steps.png + cones.png + crosses.png + plot_bars.png + bars.png + trajectory.png + scatter.png + ribbon.png + pointer.png + arrangeLayers.png + newLayer.png + pixelProfile.png + monalisa.png + lineMesh.png + rightGrid.png + leftGrid.png + backGrid.png + ceilGrid.png + floorGrid.png + pointsMesh.png + frontGrid.png + no_floor.png + isolines.png + floor.png + grid_poly.png + grid_only.png + no_grid.png + no_axes.png + box.png + free_axes.png + newFxy.png + newF.png + stat_rows.png + fx.png + redo.png + undo.png + col_stat.png + wizard.png + pie.png + randomNumbers.png + rowNumbers.png + hBars.png + vertBars.png + area.png + cursors.png + close.png + logo.png + hand.png + drag_curve.png + errors.png + curves.png + arrow.png + legend.png + select.png + cursor_16.png + unzoom.png + paste.png + cut.png + copy.png + text.png + duplicate.png + new.png + addCol.png + pPlot.png + lpPlot.png + lPlot.png + table.png + multiload.png + import.png + graph.png + worksheet.png + folder.png + fileopen.png + fileprint.png + filesave.png + filesaveas.png + erase.png + zoom.png + log.png + quit.png + qtiplot_logo.png + bottom_axis.png + left_axis.png + top_axis.png + right_axis.png + liniar_scale.png + log10.png + ln_scale.png + log2_scale.png + reciprocal_scale.png + bottom_scl.png + top_scl.png + left_scl.png + right_scl.png + vertical_grid.png + horizontal_grid.png + probability_scale.png + logit_scale.png + layer_disabled.png + layer_enabled.png + graph_disabled.png + graph_enabled.png + cursor.png + vizor.png + lens.png + lineSymbol.png + fraction.png + square_root.png + param_range_btn.png + notes_32.png + uncomment.png + + === removed file 'manual/html/icons/image2_data.png' Binary files manual/html/icons/image2_data.png 2008-06-12 08:57:17 +0000 and manual/html/icons/image2_data.png 1970-01-01 00:00:00 +0000 differ === removed file 'manual/html/icons/image3_data.png' Binary files manual/html/icons/image3_data.png 2008-06-12 08:57:17 +0000 and manual/html/icons/image3_data.png 1970-01-01 00:00:00 +0000 differ === removed file 'manual/html/icons/image4_data.png' Binary files manual/html/icons/image4_data.png 2008-06-12 08:57:17 +0000 and manual/html/icons/image4_data.png 1970-01-01 00:00:00 +0000 differ === removed file 'manual/html/icons/image5_data.png' Binary files manual/html/icons/image5_data.png 2008-06-12 08:57:17 +0000 and manual/html/icons/image5_data.png 1970-01-01 00:00:00 +0000 differ === removed file 'manual/html/icons/image6_data.png' Binary files manual/html/icons/image6_data.png 2008-06-12 08:57:17 +0000 and manual/html/icons/image6_data.png 1970-01-01 00:00:00 +0000 differ === removed file 'manual/html/icons/image7_data.png' Binary files manual/html/icons/image7_data.png 2008-06-12 08:57:17 +0000 and manual/html/icons/image7_data.png 1970-01-01 00:00:00 +0000 differ === added file 'manual/html/icons/image_plot.png' Binary files manual/html/icons/image_plot.png 1970-01-01 00:00:00 +0000 and manual/html/icons/image_plot.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/image_profiles.png' Binary files manual/html/icons/image_profiles.png 1970-01-01 00:00:00 +0000 and manual/html/icons/image_profiles.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/import.png' Binary files manual/html/icons/import.png 2008-06-12 08:57:17 +0000 and manual/html/icons/import.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/increase_decimals.png' Binary files manual/html/icons/increase_decimals.png 1970-01-01 00:00:00 +0000 and manual/html/icons/increase_decimals.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/increase_indent.png' Binary files manual/html/icons/increase_indent.png 1970-01-01 00:00:00 +0000 and manual/html/icons/increase_indent.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/index.png' Binary files manual/html/icons/index.png 2008-06-12 08:57:17 +0000 and manual/html/icons/index.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/insert_column.png' Binary files manual/html/icons/insert_column.png 1970-01-01 00:00:00 +0000 and manual/html/icons/insert_column.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/insert_row.png' Binary files manual/html/icons/insert_row.png 1970-01-01 00:00:00 +0000 and manual/html/icons/insert_row.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/isolines.png' Binary files manual/html/icons/isolines.png 2008-06-12 08:57:17 +0000 and manual/html/icons/isolines.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/lPlot.png' Binary files manual/html/icons/lPlot.png 2008-08-17 19:43:31 +0000 and manual/html/icons/lPlot.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/layer_disabled.png' Binary files manual/html/icons/layer_disabled.png 1970-01-01 00:00:00 +0000 and manual/html/icons/layer_disabled.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/layer_enabled.png' Binary files manual/html/icons/layer_enabled.png 1970-01-01 00:00:00 +0000 and manual/html/icons/layer_enabled.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/leaf.png' Binary files manual/html/icons/leaf.png 1970-01-01 00:00:00 +0000 and manual/html/icons/leaf.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/leftGrid.png' Binary files manual/html/icons/leftGrid.png 2008-06-12 08:57:17 +0000 and manual/html/icons/leftGrid.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/left_axis.png' Binary files manual/html/icons/left_axis.png 1970-01-01 00:00:00 +0000 and manual/html/icons/left_axis.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/left_scl.png' Binary files manual/html/icons/left_scl.png 2008-06-12 08:57:17 +0000 and manual/html/icons/left_scl.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/legend.png' Binary files manual/html/icons/legend.png 2008-06-12 08:57:17 +0000 and manual/html/icons/legend.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/lens.png' Binary files manual/html/icons/lens.png 2008-06-12 08:57:17 +0000 and manual/html/icons/lens.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/lineMesh.png' Binary files manual/html/icons/lineMesh.png 2008-06-12 08:57:17 +0000 and manual/html/icons/lineMesh.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/lineSymbol.png' Binary files manual/html/icons/lineSymbol.png 2008-06-12 08:57:17 +0000 and manual/html/icons/lineSymbol.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/liniar_scale.png' Binary files manual/html/icons/liniar_scale.png 1970-01-01 00:00:00 +0000 and manual/html/icons/liniar_scale.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/ln_scale.png' Binary files manual/html/icons/ln_scale.png 1970-01-01 00:00:00 +0000 and manual/html/icons/ln_scale.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/log.png' Binary files manual/html/icons/log.png 2008-06-12 08:57:17 +0000 and manual/html/icons/log.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/log10.png' Binary files manual/html/icons/log10.png 1970-01-01 00:00:00 +0000 and manual/html/icons/log10.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/log2_scale.png' Binary files manual/html/icons/log2_scale.png 1970-01-01 00:00:00 +0000 and manual/html/icons/log2_scale.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/logit_scale.png' Binary files manual/html/icons/logit_scale.png 1970-01-01 00:00:00 +0000 and manual/html/icons/logit_scale.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/logo.png' Binary files manual/html/icons/logo.png 2008-06-12 08:57:17 +0000 and manual/html/icons/logo.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/lpPlot.png' Binary files manual/html/icons/lpPlot.png 2008-06-12 08:57:17 +0000 and manual/html/icons/lpPlot.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/magnifier.png' Binary files manual/html/icons/magnifier.png 1970-01-01 00:00:00 +0000 and manual/html/icons/magnifier.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/magnifier_hor.png' Binary files manual/html/icons/magnifier_hor.png 1970-01-01 00:00:00 +0000 and manual/html/icons/magnifier_hor.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/magnifier_vert.png' Binary files manual/html/icons/magnifier_vert.png 1970-01-01 00:00:00 +0000 and manual/html/icons/magnifier_vert.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/matrix.png' Binary files manual/html/icons/matrix.png 2008-06-12 08:57:17 +0000 and manual/html/icons/matrix.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/monalisa.png' Binary files manual/html/icons/monalisa.png 2008-06-12 08:57:17 +0000 and manual/html/icons/monalisa.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/move_col_first.png' Binary files manual/html/icons/move_col_first.png 2008-06-12 08:57:17 +0000 and manual/html/icons/move_col_first.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/move_col_last.png' Binary files manual/html/icons/move_col_last.png 2008-06-12 08:57:17 +0000 and manual/html/icons/move_col_last.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/move_col_left.png' Binary files manual/html/icons/move_col_left.png 2008-06-12 08:57:17 +0000 and manual/html/icons/move_col_left.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/move_col_right.png' Binary files manual/html/icons/move_col_right.png 2008-06-12 08:57:17 +0000 and manual/html/icons/move_col_right.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/move_row_down.png' Binary files manual/html/icons/move_row_down.png 1970-01-01 00:00:00 +0000 and manual/html/icons/move_row_down.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/move_row_up.png' Binary files manual/html/icons/move_row_up.png 1970-01-01 00:00:00 +0000 and manual/html/icons/move_row_up.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/movie.png' Binary files manual/html/icons/movie.png 2008-06-12 08:57:17 +0000 and manual/html/icons/movie.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/multiload.png' Binary files manual/html/icons/multiload.png 1970-01-01 00:00:00 +0000 and manual/html/icons/multiload.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/new.png' Binary files manual/html/icons/new.png 2008-06-12 08:57:17 +0000 and manual/html/icons/new.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/newF.png' Binary files manual/html/icons/newF.png 2008-06-12 08:57:17 +0000 and manual/html/icons/newF.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/newFxy.png' Binary files manual/html/icons/newFxy.png 2008-06-12 08:57:17 +0000 and manual/html/icons/newFxy.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/newLayer.png' Binary files manual/html/icons/newLayer.png 2008-06-12 08:57:17 +0000 and manual/html/icons/newLayer.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/new_graph.png' Binary files manual/html/icons/new_graph.png 2008-06-12 08:57:17 +0000 and manual/html/icons/new_graph.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/new_matrix.png' Binary files manual/html/icons/new_matrix.png 2008-06-12 08:57:17 +0000 and manual/html/icons/new_matrix.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/new_note.png' Binary files manual/html/icons/new_note.png 2008-06-12 08:57:17 +0000 and manual/html/icons/new_note.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/newfolder.png' Binary files manual/html/icons/newfolder.png 2009-12-08 18:06:27 +0000 and manual/html/icons/newfolder.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/next.png' Binary files manual/html/icons/next.png 2008-06-12 08:57:17 +0000 and manual/html/icons/next.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/no_axes.png' Binary files manual/html/icons/no_axes.png 2008-06-12 08:57:17 +0000 and manual/html/icons/no_axes.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/no_floor.png' Binary files manual/html/icons/no_floor.png 2008-06-12 08:57:17 +0000 and manual/html/icons/no_floor.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/no_grid.png' Binary files manual/html/icons/no_grid.png 2008-06-12 08:57:17 +0000 and manual/html/icons/no_grid.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/note.png' Binary files manual/html/icons/note.png 2008-06-12 08:57:17 +0000 and manual/html/icons/note.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/notes_32.png' Binary files manual/html/icons/notes_32.png 1970-01-01 00:00:00 +0000 and manual/html/icons/notes_32.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/ods_spreadsheet.png' Binary files manual/html/icons/ods_spreadsheet.png 1970-01-01 00:00:00 +0000 and manual/html/icons/ods_spreadsheet.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/open_excel.png' Binary files manual/html/icons/open_excel.png 1970-01-01 00:00:00 +0000 and manual/html/icons/open_excel.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/open_template.png' Binary files manual/html/icons/open_template.png 2008-06-12 08:57:17 +0000 and manual/html/icons/open_template.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/pPlot.png' Binary files manual/html/icons/pPlot.png 2008-06-12 08:57:17 +0000 and manual/html/icons/pPlot.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/icons/palette.png' Binary files manual/html/icons/palette.png 2008-06-12 08:57:17 +0000 and manual/html/icons/palette.png 1970-01-01 00:00:00 +0000 differ === modified file 'manual/html/icons/panel_4.png' Binary files manual/html/icons/panel_4.png 2008-06-12 08:57:17 +0000 and manual/html/icons/panel_4.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/panel_h2.png' Binary files manual/html/icons/panel_h2.png 2008-06-12 08:57:17 +0000 and manual/html/icons/panel_h2.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/panel_v2.png' Binary files manual/html/icons/panel_v2.png 2008-06-12 08:57:17 +0000 and manual/html/icons/panel_v2.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/param_range_btn.png' Binary files manual/html/icons/param_range_btn.png 1970-01-01 00:00:00 +0000 and manual/html/icons/param_range_btn.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/paste.png' Binary files manual/html/icons/paste.png 2008-06-12 08:57:17 +0000 and manual/html/icons/paste.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/pdf.png' Binary files manual/html/icons/pdf.png 2009-11-18 10:33:29 +0000 and manual/html/icons/pdf.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/perspective.png' Binary files manual/html/icons/perspective.png 2008-06-12 08:57:17 +0000 and manual/html/icons/perspective.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/pie.png' Binary files manual/html/icons/pie.png 2008-06-12 08:57:17 +0000 and manual/html/icons/pie.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/pixelProfile.png' Binary files manual/html/icons/pixelProfile.png 2008-06-12 08:57:17 +0000 and manual/html/icons/pixelProfile.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/play.png' Binary files manual/html/icons/play.png 1970-01-01 00:00:00 +0000 and manual/html/icons/play.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/plot_bars.png' Binary files manual/html/icons/plot_bars.png 2008-06-12 08:57:17 +0000 and manual/html/icons/plot_bars.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/plot_double_y.png' Binary files manual/html/icons/plot_double_y.png 2008-08-17 19:43:31 +0000 and manual/html/icons/plot_double_y.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/plus.png' Binary files manual/html/icons/plus.png 1970-01-01 00:00:00 +0000 and manual/html/icons/plus.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/pointer.png' Binary files manual/html/icons/pointer.png 2008-08-17 19:43:31 +0000 and manual/html/icons/pointer.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/pointsMesh.png' Binary files manual/html/icons/pointsMesh.png 2008-06-12 08:57:17 +0000 and manual/html/icons/pointsMesh.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/prev.png' Binary files manual/html/icons/prev.png 2008-06-12 08:57:17 +0000 and manual/html/icons/prev.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/preview.png' Binary files manual/html/icons/preview.png 1970-01-01 00:00:00 +0000 and manual/html/icons/preview.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/probability_scale.png' Binary files manual/html/icons/probability_scale.png 1970-01-01 00:00:00 +0000 and manual/html/icons/probability_scale.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/python.png' Binary files manual/html/icons/python.png 2008-06-12 08:57:17 +0000 and manual/html/icons/python.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/qtiplot_logo.png' Binary files manual/html/icons/qtiplot_logo.png 2008-06-12 08:57:17 +0000 and manual/html/icons/qtiplot_logo.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/quit.png' Binary files manual/html/icons/quit.png 2008-06-12 08:57:17 +0000 and manual/html/icons/quit.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/randomNumbers.png' Binary files manual/html/icons/randomNumbers.png 2008-06-12 08:57:17 +0000 and manual/html/icons/randomNumbers.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/reciprocal_scale.png' Binary files manual/html/icons/reciprocal_scale.png 1970-01-01 00:00:00 +0000 and manual/html/icons/reciprocal_scale.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/rectangle.png' Binary files manual/html/icons/rectangle.png 2008-08-17 19:43:31 +0000 and manual/html/icons/rectangle.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/redo.png' Binary files manual/html/icons/redo.png 2008-06-12 08:57:17 +0000 and manual/html/icons/redo.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/reload.png' Binary files manual/html/icons/reload.png 1970-01-01 00:00:00 +0000 and manual/html/icons/reload.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/icons/remove.png' Binary files manual/html/icons/remove.png 2008-06-12 08:57:17 +0000 and manual/html/icons/remove.png 1970-01-01 00:00:00 +0000 differ === added file 'manual/html/icons/replace.png' Binary files manual/html/icons/replace.png 1970-01-01 00:00:00 +0000 and manual/html/icons/replace.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/icons/rescale.png' Binary files manual/html/icons/rescale.png 2008-08-17 19:43:31 +0000 and manual/html/icons/rescale.png 1970-01-01 00:00:00 +0000 differ === modified file 'manual/html/icons/reset_rotation.png' Binary files manual/html/icons/reset_rotation.png 2008-06-12 08:57:17 +0000 and manual/html/icons/reset_rotation.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/resize.png' Binary files manual/html/icons/resize.png 2008-06-12 08:57:17 +0000 and manual/html/icons/resize.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/ribbon.png' Binary files manual/html/icons/ribbon.png 2008-06-12 08:57:17 +0000 and manual/html/icons/ribbon.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/rightGrid.png' Binary files manual/html/icons/rightGrid.png 2008-06-12 08:57:17 +0000 and manual/html/icons/rightGrid.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/right_axis.png' Binary files manual/html/icons/right_axis.png 1970-01-01 00:00:00 +0000 and manual/html/icons/right_axis.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/right_scl.png' Binary files manual/html/icons/right_scl.png 2008-06-12 08:57:17 +0000 and manual/html/icons/right_scl.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/rotate_clockwise.png' Binary files manual/html/icons/rotate_clockwise.png 1970-01-01 00:00:00 +0000 and manual/html/icons/rotate_clockwise.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/rotate_counterclockwise.png' Binary files manual/html/icons/rotate_counterclockwise.png 1970-01-01 00:00:00 +0000 and manual/html/icons/rotate_counterclockwise.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/rowNumbers.png' Binary files manual/html/icons/rowNumbers.png 2008-06-12 08:57:17 +0000 and manual/html/icons/rowNumbers.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/save_template.png' Binary files manual/html/icons/save_template.png 2008-06-12 08:57:17 +0000 and manual/html/icons/save_template.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/scatter.png' Binary files manual/html/icons/scatter.png 2008-06-12 08:57:17 +0000 and manual/html/icons/scatter.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/select.png' Binary files manual/html/icons/select.png 2008-08-17 19:43:31 +0000 and manual/html/icons/select.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/set_label_col.png' Binary files manual/html/icons/set_label_col.png 1970-01-01 00:00:00 +0000 and manual/html/icons/set_label_col.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/icons/set_none_col.png' Binary files manual/html/icons/set_none_col.png 2008-06-12 08:57:17 +0000 and manual/html/icons/set_none_col.png 1970-01-01 00:00:00 +0000 differ === removed file 'manual/html/icons/set_x_col.png' Binary files manual/html/icons/set_x_col.png 2008-06-12 08:57:17 +0000 and manual/html/icons/set_x_col.png 1970-01-01 00:00:00 +0000 differ === removed file 'manual/html/icons/set_y_col.png' Binary files manual/html/icons/set_y_col.png 2008-06-12 08:57:17 +0000 and manual/html/icons/set_y_col.png 1970-01-01 00:00:00 +0000 differ === removed file 'manual/html/icons/set_z_col.png' Binary files manual/html/icons/set_z_col.png 2008-06-12 08:57:17 +0000 and manual/html/icons/set_z_col.png 1970-01-01 00:00:00 +0000 differ === added file 'manual/html/icons/sort.png' Binary files manual/html/icons/sort.png 1970-01-01 00:00:00 +0000 and manual/html/icons/sort.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/sort_ascending.png' Binary files manual/html/icons/sort_ascending.png 1970-01-01 00:00:00 +0000 and manual/html/icons/sort_ascending.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/sort_descending.png' Binary files manual/html/icons/sort_descending.png 1970-01-01 00:00:00 +0000 and manual/html/icons/sort_descending.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/spline.png' Binary files manual/html/icons/spline.png 2008-06-12 08:57:17 +0000 and manual/html/icons/spline.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/square_root.png' Binary files manual/html/icons/square_root.png 1970-01-01 00:00:00 +0000 and manual/html/icons/square_root.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/stack_bar.png' Binary files manual/html/icons/stack_bar.png 1970-01-01 00:00:00 +0000 and manual/html/icons/stack_bar.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/stack_column.png' Binary files manual/html/icons/stack_column.png 1970-01-01 00:00:00 +0000 and manual/html/icons/stack_column.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/stacked.png' Binary files manual/html/icons/stacked.png 2008-06-12 08:57:17 +0000 and manual/html/icons/stacked.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/stacked_hist.png' Binary files manual/html/icons/stacked_hist.png 2008-06-12 08:57:17 +0000 and manual/html/icons/stacked_hist.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/stat_rows.png' Binary files manual/html/icons/stat_rows.png 2008-06-12 08:57:17 +0000 and manual/html/icons/stat_rows.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/icons/steps.png' Binary files manual/html/icons/steps.png 2008-06-12 08:57:17 +0000 and manual/html/icons/steps.png 1970-01-01 00:00:00 +0000 differ === modified file 'manual/html/icons/swap_columns.png' Binary files manual/html/icons/swap_columns.png 2008-06-12 08:57:17 +0000 and manual/html/icons/swap_columns.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/table.png' Binary files manual/html/icons/table.png 2008-06-12 08:57:17 +0000 and manual/html/icons/table.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/text.png' Binary files manual/html/icons/text.png 2008-08-17 19:43:31 +0000 and manual/html/icons/text.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/top_axis.png' Binary files manual/html/icons/top_axis.png 1970-01-01 00:00:00 +0000 and manual/html/icons/top_axis.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/top_scl.png' Binary files manual/html/icons/top_scl.png 2008-06-12 08:57:17 +0000 and manual/html/icons/top_scl.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/trajectory.png' Binary files manual/html/icons/trajectory.png 2008-06-12 08:57:17 +0000 and manual/html/icons/trajectory.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/icons/unchain.png' Binary files manual/html/icons/unchain.png 2008-06-12 08:57:17 +0000 and manual/html/icons/unchain.png 1970-01-01 00:00:00 +0000 differ === added file 'manual/html/icons/uncomment.png' Binary files manual/html/icons/uncomment.png 1970-01-01 00:00:00 +0000 and manual/html/icons/uncomment.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/undo.png' Binary files manual/html/icons/undo.png 2008-06-12 08:57:17 +0000 and manual/html/icons/undo.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/unzoom.png' Binary files manual/html/icons/unzoom.png 2008-06-12 08:57:17 +0000 and manual/html/icons/unzoom.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/icons/up.png' Binary files manual/html/icons/up.png 2008-06-12 08:57:17 +0000 and manual/html/icons/up.png 1970-01-01 00:00:00 +0000 differ === modified file 'manual/html/icons/vectXYAM.png' Binary files manual/html/icons/vectXYAM.png 2008-06-12 08:57:17 +0000 and manual/html/icons/vectXYAM.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/vectXYXY.png' Binary files manual/html/icons/vectXYXY.png 2008-06-12 08:57:17 +0000 and manual/html/icons/vectXYXY.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/vertBars.png' Binary files manual/html/icons/vertBars.png 2008-06-12 08:57:17 +0000 and manual/html/icons/vertBars.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/icons/vert_scl.png' Binary files manual/html/icons/vert_scl.png 2008-06-12 08:57:17 +0000 and manual/html/icons/vert_scl.png 1970-01-01 00:00:00 +0000 differ === modified file 'manual/html/icons/vert_steps.png' Binary files manual/html/icons/vert_steps.png 2008-06-12 08:57:17 +0000 and manual/html/icons/vert_steps.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/vertical_grid.png' Binary files manual/html/icons/vertical_grid.png 1970-01-01 00:00:00 +0000 and manual/html/icons/vertical_grid.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/vizor.png' Binary files manual/html/icons/vizor.png 2008-06-12 08:57:17 +0000 and manual/html/icons/vizor.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/waterfall_plot.png' Binary files manual/html/icons/waterfall_plot.png 1970-01-01 00:00:00 +0000 and manual/html/icons/waterfall_plot.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/wizard.png' Binary files manual/html/icons/wizard.png 2008-06-12 08:57:17 +0000 and manual/html/icons/wizard.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/worksheet.png' Binary files manual/html/icons/worksheet.png 2008-06-12 08:57:17 +0000 and manual/html/icons/worksheet.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/x_col.png' Binary files manual/html/icons/x_col.png 1970-01-01 00:00:00 +0000 and manual/html/icons/x_col.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/y_col.png' Binary files manual/html/icons/y_col.png 1970-01-01 00:00:00 +0000 and manual/html/icons/y_col.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/icons/z_col.png' Binary files manual/html/icons/z_col.png 1970-01-01 00:00:00 +0000 and manual/html/icons/z_col.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/zoom.png' Binary files manual/html/icons/zoom.png 2008-08-17 19:43:31 +0000 and manual/html/icons/zoom.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/icons/zoomOut.png' Binary files manual/html/icons/zoomOut.png 2008-08-17 19:43:31 +0000 and manual/html/icons/zoomOut.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/add-function-dialog1.png' Binary files manual/html/pics/add-function-dialog1.png 2009-12-08 18:06:27 +0000 and manual/html/pics/add-function-dialog1.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/add-function-dialog2.png' Binary files manual/html/pics/add-function-dialog2.png 2009-12-08 18:06:27 +0000 and manual/html/pics/add-function-dialog2.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/add-function-dialog3.png' Binary files manual/html/pics/add-function-dialog3.png 2009-12-08 18:06:27 +0000 and manual/html/pics/add-function-dialog3.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/pics/add-function-dialog4.png' Binary files manual/html/pics/add-function-dialog4.png 1970-01-01 00:00:00 +0000 and manual/html/pics/add-function-dialog4.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/arrange-layers-dialog.png' Binary files manual/html/pics/arrange-layers-dialog.png 2008-06-12 08:57:17 +0000 and manual/html/pics/arrange-layers-dialog.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/pics/contour-curve-dialog-7.png' Binary files manual/html/pics/contour-curve-dialog-7.png 1970-01-01 00:00:00 +0000 and manual/html/pics/contour-curve-dialog-7.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/pics/contour-curve-dialog-7.png' Binary files manual/html/pics/contour-curve-dialog-7.png 2009-12-08 18:06:27 +0000 and manual/html/pics/contour-curve-dialog-7.png 1970-01-01 00:00:00 +0000 differ === added file 'manual/html/pics/contour-curve-dialog-8.png' Binary files manual/html/pics/contour-curve-dialog-8.png 1970-01-01 00:00:00 +0000 and manual/html/pics/contour-curve-dialog-8.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/pics/contour-curve-dialog-8.png' Binary files manual/html/pics/contour-curve-dialog-8.png 2009-12-08 18:06:27 +0000 and manual/html/pics/contour-curve-dialog-8.png 1970-01-01 00:00:00 +0000 differ === added file 'manual/html/pics/contour-curve-dialog-9.png' Binary files manual/html/pics/contour-curve-dialog-9.png 1970-01-01 00:00:00 +0000 and manual/html/pics/contour-curve-dialog-9.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/pics/contour-curve-dialog-9.png' Binary files manual/html/pics/contour-curve-dialog-9.png 2009-12-08 18:06:27 +0000 and manual/html/pics/contour-curve-dialog-9.png 1970-01-01 00:00:00 +0000 differ === modified file 'manual/html/pics/custom-curves-1.png' Binary files manual/html/pics/custom-curves-1.png 2009-12-08 18:06:27 +0000 and manual/html/pics/custom-curves-1.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/custom-curves-4.png' Binary files manual/html/pics/custom-curves-4.png 2009-11-18 10:33:29 +0000 and manual/html/pics/custom-curves-4.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/custom-layer-geometry.png' Binary files manual/html/pics/custom-layer-geometry.png 2009-12-08 18:06:27 +0000 and manual/html/pics/custom-layer-geometry.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/define-param-surface-plot.png' Binary files manual/html/pics/define-param-surface-plot.png 2008-06-12 08:57:17 +0000 and manual/html/pics/define-param-surface-plot.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/define-surface-plot.png' Binary files manual/html/pics/define-surface-plot.png 2008-06-12 08:57:17 +0000 and manual/html/pics/define-surface-plot.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/direct-function-plot.png' Binary files manual/html/pics/direct-function-plot.png 2008-06-12 08:57:17 +0000 and manual/html/pics/direct-function-plot.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/export-graph-tex.png' Binary files manual/html/pics/export-graph-tex.png 2009-11-18 10:33:29 +0000 and manual/html/pics/export-graph-tex.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/fit-dialog1.png' Binary files manual/html/pics/fit-dialog1.png 2008-06-12 08:57:17 +0000 and manual/html/pics/fit-dialog1.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/fit-dialog2.png' Binary files manual/html/pics/fit-dialog2.png 2008-06-12 08:57:17 +0000 and manual/html/pics/fit-dialog2.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/fit-dialog4.png' Binary files manual/html/pics/fit-dialog4.png 2008-06-12 08:57:17 +0000 and manual/html/pics/fit-dialog4.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/plot-options-3.png' Binary files manual/html/pics/plot-options-3.png 2008-06-12 08:57:17 +0000 and manual/html/pics/plot-options-3.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/plot-two-axes-dialog.png' Binary files manual/html/pics/plot-two-axes-dialog.png 2008-06-12 08:57:17 +0000 and manual/html/pics/plot-two-axes-dialog.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/preferences-dialog10.png' Binary files manual/html/pics/preferences-dialog10.png 2009-12-08 18:06:27 +0000 and manual/html/pics/preferences-dialog10.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/pics/preferences-dialog14.png' Binary files manual/html/pics/preferences-dialog14.png 1970-01-01 00:00:00 +0000 and manual/html/pics/preferences-dialog14.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/pics/preferences-dialog14.png' Binary files manual/html/pics/preferences-dialog14.png 2009-12-08 18:06:27 +0000 and manual/html/pics/preferences-dialog14.png 1970-01-01 00:00:00 +0000 differ === added file 'manual/html/pics/preferences-dialog15.png' Binary files manual/html/pics/preferences-dialog15.png 1970-01-01 00:00:00 +0000 and manual/html/pics/preferences-dialog15.png 2010-07-21 23:21:08 +0000 differ === removed file 'manual/html/pics/preferences-dialog15.png' Binary files manual/html/pics/preferences-dialog15.png 2009-12-08 18:06:27 +0000 and manual/html/pics/preferences-dialog15.png 1970-01-01 00:00:00 +0000 differ === added file 'manual/html/pics/preferences-dialog17.png' Binary files manual/html/pics/preferences-dialog17.png 1970-01-01 00:00:00 +0000 and manual/html/pics/preferences-dialog17.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/preferences-dialog2.png' Binary files manual/html/pics/preferences-dialog2.png 2009-12-08 18:06:27 +0000 and manual/html/pics/preferences-dialog2.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/preferences-dialog5.png' Binary files manual/html/pics/preferences-dialog5.png 2009-12-08 18:06:27 +0000 and manual/html/pics/preferences-dialog5.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/preferences-dialog6.png' Binary files manual/html/pics/preferences-dialog6.png 2009-12-08 18:06:27 +0000 and manual/html/pics/preferences-dialog6.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/preferences-dialog7.png' Binary files manual/html/pics/preferences-dialog7.png 2009-12-08 18:06:27 +0000 and manual/html/pics/preferences-dialog7.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/set-import-options.png' Binary files manual/html/pics/set-import-options.png 2009-12-08 18:06:27 +0000 and manual/html/pics/set-import-options.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/surface-plot-options-dialog1.png' Binary files manual/html/pics/surface-plot-options-dialog1.png 2008-06-12 08:57:17 +0000 and manual/html/pics/surface-plot-options-dialog1.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/surface-plot-options-dialog2.png' Binary files manual/html/pics/surface-plot-options-dialog2.png 2009-12-08 18:06:27 +0000 and manual/html/pics/surface-plot-options-dialog2.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/surface-plot-options-dialog3.png' Binary files manual/html/pics/surface-plot-options-dialog3.png 2009-12-08 18:06:27 +0000 and manual/html/pics/surface-plot-options-dialog3.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/surface-plot-options-dialog4.png' Binary files manual/html/pics/surface-plot-options-dialog4.png 2009-12-08 18:06:27 +0000 and manual/html/pics/surface-plot-options-dialog4.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/surface-plot-options-dialog5.png' Binary files manual/html/pics/surface-plot-options-dialog5.png 2009-12-08 18:06:27 +0000 and manual/html/pics/surface-plot-options-dialog5.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/pics/surface-plot-options-dialog6.png' Binary files manual/html/pics/surface-plot-options-dialog6.png 1970-01-01 00:00:00 +0000 and manual/html/pics/surface-plot-options-dialog6.png 2010-07-21 23:21:08 +0000 differ === added file 'manual/html/pics/surface-plot-options-dialog7.png' Binary files manual/html/pics/surface-plot-options-dialog7.png 1970-01-01 00:00:00 +0000 and manual/html/pics/surface-plot-options-dialog7.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/pics/text-options-dialog3.png' Binary files manual/html/pics/text-options-dialog3.png 2008-08-17 19:43:31 +0000 and manual/html/pics/text-options-dialog3.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/qtiplot.adp' --- manual/html/qtiplot.adp 2009-12-08 18:06:27 +0000 +++ manual/html/qtiplot.adp 2010-07-21 23:21:08 +0000 @@ -8,11 +8,11 @@ graph table matrix -table -table -matrix -table -matrix +table +table +matrix +table +matrix
@@ -44,11 +44,11 @@ graph table matrix -table -table -matrix -table -matrix +table +table +matrix +table +matrix
@@ -80,11 +80,11 @@ graph table matrix -table -table -matrix -table -matrix +table +table +matrix +table +matrix
@@ -105,358 +105,372 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Command line parameters -Command line options -table -matrix -graph -table -matrix -table -table -matrix -table -matrix -
-
-
-
-
-
-
-
-
-
-
-
-
-
-Command line parameters -Command line options -table -matrix -graph -table -matrix -table -table -matrix -table -matrix -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Command line parameters -Command line options -table -matrix -graph -table -matrix -table -table -matrix -table -matrix -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Command line parameters -Command line options -table -matrix -graph -table -matrix -table -table -matrix -table -matrix -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Command line parameters -Command line options -table -matrix -graph -table -matrix -table -table -matrix -table -matrix -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Command line parameters -Command line options -table -matrix -graph -table -matrix -table -table -matrix -table -matrix -
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Command line parameters +Command line options +table +matrix +graph +table +matrix +table +table +matrix +table +matrix +
+
+
+
+
+
+
+
+
+
+
+
+
+
+Command line parameters +Command line options +table +matrix +graph +table +matrix +table +table +matrix +table +matrix +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Command line parameters +Command line options +table +matrix +graph +table +matrix +table +table +matrix +table +matrix +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Command line parameters +Command line options +table +matrix +graph +table +matrix +table +table +matrix +table +matrix +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Command line parameters +Command line options +table +matrix +graph +table +matrix +table +table +matrix +table +matrix +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Command line parameters +Command line options +table +matrix +graph +table +matrix +table +table +matrix +table +matrix +
+
+
+
+
+
+
+
+
+
+
+
+
+
=== modified file 'manual/html/tutorial/table-function-plot1.png' Binary files manual/html/tutorial/table-function-plot1.png 2008-06-12 08:57:17 +0000 and manual/html/tutorial/table-function-plot1.png 2010-07-21 23:21:08 +0000 differ === modified file 'manual/html/tutorial/table-function-plot2.png' Binary files manual/html/tutorial/table-function-plot2.png 2008-06-12 08:57:17 +0000 and manual/html/tutorial/table-function-plot2.png 2010-07-21 23:21:08 +0000 differ === modified file 'qtiplot.pro' --- qtiplot.pro 2009-12-08 18:06:27 +0000 +++ qtiplot.pro 2010-07-21 23:41:22 +0000 @@ -1,6 +1,5 @@ TEMPLATE = subdirs -SUBDIRS = fitPlugins \ - manual \ - 3rdparty/qwt \ - qtiplot +SUBDIRS = 3rdparty/qwt \ + 3rdparty/qwtplot3d \ + qtiplot === added directory 'qtiplot/examples' === removed directory 'qtiplot/examples' === added directory 'qtiplot/examples/python' === removed directory 'qtiplot/examples/python' === added file 'qtiplot/examples/python/filter_table.py' --- qtiplot/examples/python/filter_table.py 1970-01-01 00:00:00 +0000 +++ qtiplot/examples/python/filter_table.py 2010-07-21 23:21:08 +0000 @@ -0,0 +1,50 @@ +########################################################################## +# File : filter_table.py +# Project : QtiPlot +# -------------------------------------------------------------------- +# Copyright : (C) 2008 by Luyang Han +# Email : +# Description : Filtering table values. +# +# Usage : Add this plugin to the 'Table' menu using +# 'Scripting | Add custom script action...'. +########################################################################## + +########################################################################## +# # +# This program is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software # +# Foundation, Inc., 51 Franklin Street, Fifth Floor, # +# Boston, MA 02110-1301 USA # +# # +########################################################################## + +def filter_table(t, filter_str): + num_row = t.numRows() + delete_list = [] + for i in range(1, num_row+1): + col = lambda x: t.cell(x, i) + res = bool(eval(filter_str)) + if not res: + delete_list.append(i) + for i, row in enumerate(delete_list): + row_index = row - i + t.deleteRows(row_index, row_index) + +t = currentTable() +filter_str, isOK = QtGui.QInputDialog.getText(qti.app, "Row filter", "Input the python expression to filter current table.\nUse col(col_name) to access one column. \nIf the expression yields false value, the corresponding row will be deleted.", QtGui.QLineEdit.Normal, 'col("1") > 0') +if isOK: + try: + filter_table(t, str(filter_str)) + except Exception, x: + QtGui.QMessageBox.warning(qti.app, 'Filtering failed!', x.__str__()) === removed file 'qtiplot/examples/python/filter_table.py' --- qtiplot/examples/python/filter_table.py 2009-12-08 18:06:27 +0000 +++ qtiplot/examples/python/filter_table.py 1970-01-01 00:00:00 +0000 @@ -1,50 +0,0 @@ -########################################################################## -# File : filter_table.py -# Project : QtiPlot -# -------------------------------------------------------------------- -# Copyright : (C) 2008 by Luyang Han -# Email : -# Description : Filtering table values. -# -# Usage : Add this plugin to the 'Table' menu using -# 'Scripting | Add custom script action...'. -########################################################################## - -########################################################################## -# # -# This program is free software; you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation; either version 2 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with this program; if not, write to the Free Software # -# Foundation, Inc., 51 Franklin Street, Fifth Floor, # -# Boston, MA 02110-1301 USA # -# # -########################################################################## - -def filter_table(t, filter_str): - num_row = t.numRows() - delete_list = [] - for i in range(1, num_row+1): - col = lambda x: t.cell(x, i) - res = bool(eval(filter_str)) - if not res: - delete_list.append(i) - for i, row in enumerate(delete_list): - row_index = row - i - t.deleteRows(row_index, row_index) - -t = currentTable() -filter_str, isOK = QtGui.QInputDialog.getText(qti.app, "Row filter", "Input the python expression to filter current table.\nUse col(col_name) to access one column. \nIf the expression yields false value, the corresponding row will be deleted.", QtGui.QLineEdit.Normal, 'col("1") > 0') -if isOK: - try: - filter_table(t, str(filter_str)) - except Exception, x: - QtGui.QMessageBox.warning(qti.app, 'Filtering failed!', x.__str__()) === added file 'qtiplot/examples/python/strd_nist_fit.py' --- qtiplot/examples/python/strd_nist_fit.py 1970-01-01 00:00:00 +0000 +++ qtiplot/examples/python/strd_nist_fit.py 2010-07-21 23:21:08 +0000 @@ -0,0 +1,163 @@ +########################################################################## +# File : strd_nist_fit.py +# Project : QtiPlot +# -------------------------------------------------------------------- +# Copyright : (C) 2008 by Ion Vasilief +# Email : ion_vasilief At yahoo.fr +# Description : Example of nonlinear curve fitting in QtiPlot. +# Uses data from the Statistical Reference Datasets Project of +# the National Institute of Standards and Technology (NIST). +# +# Usage : qtiplot -x strd_nist_fit.py +########################################################################## + +########################################################################## +# # +# This program is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software # +# Foundation, Inc., 51 Franklin Street, Fifth Floor, # +# Boston, MA 02110-1301 USA # +# # +########################################################################## +import urllib, re, sys + +# Pop-up a file dialog allowing to chose a destination folder: +dirPath = QtGui.QFileDialog.getExistingDirectory(qti.app, "Choose Destination Folder") + +saveout = sys.stdout +# create a log file in the destination folder +fsock = open(dirPath + "/" + "results.txt", "w") +sys.stdout = fsock + +# on Unix systems you can redirect the output directly to a console by uncommenting the line bellow: +#sys.stdout = sys.__stdout__ + +# make sure that the decimal separator is the dot character +qti.app.setLocale(QtCore.QLocale.c()) + +host = "http://www.itl.nist.gov/div898/strd/nls/data/LINKS/DATA/" +url = urllib.urlopen(host) +url_string = url.read() +p = re.compile( '\w{,}.dat">' ) +iterator = p.finditer( url_string ) +for m in iterator: + name = (m.group()).replace("\">", "") + if (name == "Nelson.dat"): + continue + + url = host + name + print "\nRetrieving file: " + url + path = dirPath + "/" + name + urllib.urlretrieve( url, path ) # retrieve .dat file to specified location + + file = QtCore.QFile(path) + if file.open(QtCore.QIODevice.ReadOnly): + ts = QtCore.QTextStream(file) + name = name.replace(".dat", "") + changeFolder(addFolder(name)) #create a new folder and move to it + formula = "" + parameters = 0 + initValues = list() + certifiedValues = list() + standardDevValues = list() + xLabel = "X" + yLabel = "Y" + + while (ts.atEnd() == False): + s = ts.readLine().simplified() + + if (s.contains("(y = ")): + lst = s.split("=") + yLabel = lst[1].remove(")") + + if (s.contains("(x = ")): + lst = s.split("=") + xLabel = lst[1].remove(")") + + if (s.contains("Model:")): + s = ts.readLine().simplified() + lst = s.split(QtCore.QRegExp("\\s")) + s = lst[0] + parameters = s.toInt()[0] + ts.readLine() + if (name == "Roszman1"): + ts.readLine() + formula = ts.readLine().simplified() + else: + formula = (ts.readLine() + ts.readLine() + ts.readLine()).simplified() + formula.remove("+ e").remove("y =").replace("[", "(").replace("]", ")") + formula.replace("**", "^").replace("arctan", "atan") + + if (s.contains("Starting")): + ts.readLine() + ts.readLine() + for i in range (1, parameters + 1): + s = ts.readLine().simplified() + lst = s.split(" = ") + s = lst[1].simplified() + lst = s.split(QtCore.QRegExp("\\s")) + initValues.append(lst[1]) + certifiedValues.append(lst[2]) + standardDevValues.append(lst[3]) + + if (s.contains("Data: y")): + row = 0 + t = newTable(name, 300, 2) + t.setColName(1, "y") + t.setColumnRole(1, Table.Y) + t.setColName(2, "x") + t.setColumnRole(2, Table.X) + while (ts.atEnd() == False): + row = row + 1 + s = ts.readLine().simplified() + lst = s.split(QtCore.QRegExp("\\s")) + t.setText(1, row, lst[0]) + t.setText(2, row, lst[1]) + + g = plot(t, t.colName(1), Layer.Scatter).activeLayer() + g.setTitle("Data set: " + name + ".dat") + g.setAxisTitle(Layer.Bottom, xLabel) + g.setAxisTitle(Layer.Left, yLabel) + + f = NonLinearFit(g, name + "_" + t.colName(1)) + if (f.setFormula(formula) == False) : + file.close() + changeFolder(rootFolder()) + continue + + f.scaleErrors() + for i in range (0, parameters): + f.setInitialValue(i, initValues[i].toDouble()[0]) + f.fit() + g.removeLegend() + f.showLegend() + print "QtiPlot Results:\n" + f.legendInfo().toAscii() + + print "\nCertified Values:" + paramNames = f.parameterNames() + for i in range (0, parameters): + print '%s = %s +/- %s' % (paramNames[i], certifiedValues[i], standardDevValues[i]) + + print "\nDifference with QtiPlot results:" + results = f.results() + for i in range (0, parameters): + diff = fabs(results[i] - certifiedValues[i].toDouble()[0]) + print 'db%d = %6g' % (i+1, diff) + + file.close() + changeFolder(rootFolder()) + +newNote("ResultsLog").importASCII(dirPath + "/" + "results.txt") +saveProjectAs(dirPath + "/" + "StRD_NIST.qti") +sys.stdout = saveout +fsock.close() === removed file 'qtiplot/examples/python/strd_nist_fit.py' --- qtiplot/examples/python/strd_nist_fit.py 2009-12-08 18:06:27 +0000 +++ qtiplot/examples/python/strd_nist_fit.py 1970-01-01 00:00:00 +0000 @@ -1,163 +0,0 @@ -########################################################################## -# File : strd_nist_fit.py -# Project : QtiPlot -# -------------------------------------------------------------------- -# Copyright : (C) 2008 by Ion Vasilief -# Email : ion_vasilief At yahoo.fr -# Description : Example of nonlinear curve fitting in QtiPlot. -# Uses data from the Statistical Reference Datasets Project of -# the National Institute of Standards and Technology (NIST). -# -# Usage : qtiplot -x strd_nist_fit.py -########################################################################## - -########################################################################## -# # -# This program is free software; you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation; either version 2 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with this program; if not, write to the Free Software # -# Foundation, Inc., 51 Franklin Street, Fifth Floor, # -# Boston, MA 02110-1301 USA # -# # -########################################################################## -import urllib, re, sys - -# Pop-up a file dialog allowing to chose a destination folder: -dirPath = QtGui.QFileDialog.getExistingDirectory(qti.app, "Choose Destination Folder") - -saveout = sys.stdout -# create a log file in the destination folder -fsock = open(dirPath + "/" + "results.txt", "w") -sys.stdout = fsock - -# on Unix systems you can redirect the output directly to a console by uncommenting the line bellow: -#sys.stdout = sys.__stdout__ - -# make sure that the decimal separator is the dot character -qti.app.setLocale(QtCore.QLocale.c()) - -host = "http://www.itl.nist.gov/div898/strd/nls/data/LINKS/DATA/" -url = urllib.urlopen(host) -url_string = url.read() -p = re.compile( '\w{,}.dat">' ) -iterator = p.finditer( url_string ) -for m in iterator: - name = (m.group()).replace("\">", "") - if (name == "Nelson.dat"): - continue - - url = host + name - print "\nRetrieving file: " + url - path = dirPath + "/" + name - urllib.urlretrieve( url, path ) # retrieve .dat file to specified location - - file = QtCore.QFile(path) - if file.open(QtCore.QIODevice.ReadOnly): - ts = QtCore.QTextStream(file) - name = name.replace(".dat", "") - changeFolder(addFolder(name)) #create a new folder and move to it - formula = "" - parameters = 0 - initValues = list() - certifiedValues = list() - standardDevValues = list() - xLabel = "X" - yLabel = "Y" - - while (ts.atEnd() == False): - s = ts.readLine().simplified() - - if (s.contains("(y = ")): - lst = s.split("=") - yLabel = lst[1].remove(")") - - if (s.contains("(x = ")): - lst = s.split("=") - xLabel = lst[1].remove(")") - - if (s.contains("Model:")): - s = ts.readLine().simplified() - lst = s.split(QtCore.QRegExp("\\s")) - s = lst[0] - parameters = s.toInt()[0] - ts.readLine() - if (name == "Roszman1"): - ts.readLine() - formula = ts.readLine().simplified() - else: - formula = (ts.readLine() + ts.readLine() + ts.readLine()).simplified() - formula.remove("+ e").remove("y =").replace("[", "(").replace("]", ")") - formula.replace("**", "^").replace("arctan", "atan") - - if (s.contains("Starting")): - ts.readLine() - ts.readLine() - for i in range (1, parameters + 1): - s = ts.readLine().simplified() - lst = s.split(" = ") - s = lst[1].simplified() - lst = s.split(QtCore.QRegExp("\\s")) - initValues.append(lst[1]) - certifiedValues.append(lst[2]) - standardDevValues.append(lst[3]) - - if (s.contains("Data: y")): - row = 0 - t = newTable(name, 300, 2) - t.setColName(1, "y") - t.setColumnRole(1, Table.Y) - t.setColName(2, "x") - t.setColumnRole(2, Table.X) - while (ts.atEnd() == False): - row = row + 1 - s = ts.readLine().simplified() - lst = s.split(QtCore.QRegExp("\\s")) - t.setText(1, row, lst[0]) - t.setText(2, row, lst[1]) - - g = plot(t, t.colName(1), Layer.Scatter).activeLayer() - g.setTitle("Data set: " + name + ".dat") - g.setAxisTitle(Layer.Bottom, xLabel) - g.setAxisTitle(Layer.Left, yLabel) - - f = NonLinearFit(g, name + "_" + t.colName(1)) - if (f.setFormula(formula) == False) : - file.close() - changeFolder(rootFolder()) - continue - - f.scaleErrors() - for i in range (0, parameters): - f.setInitialValue(i, initValues[i].toDouble()[0]) - f.fit() - g.removeLegend() - f.showLegend() - print "QtiPlot Results:\n" + f.legendInfo().toAscii() - - print "\nCertified Values:" - paramNames = f.parameterNames() - for i in range (0, parameters): - print '%s = %s +/- %s' % (paramNames[i], certifiedValues[i], standardDevValues[i]) - - print "\nDifference with QtiPlot results:" - results = f.results() - for i in range (0, parameters): - diff = fabs(results[i] - certifiedValues[i].toDouble()[0]) - print 'db%d = %6g' % (i+1, diff) - - file.close() - changeFolder(rootFolder()) - -newNote("ResultsLog").importASCII(dirPath + "/" + "results.txt") -saveProjectAs(dirPath + "/" + "StRD_NIST.qti") -sys.stdout = saveout -fsock.close() === removed file 'qtiplot/icons/axes_icons.h' --- qtiplot/icons/axes_icons.h 2009-12-08 18:06:27 +0000 +++ qtiplot/icons/axes_icons.h 1970-01-01 00:00:00 +0000 @@ -1,1275 +0,0 @@ -static const char* const bottom_axis_xpm[] = { -"35 32 4 1", -"# c #000000", -"a c #bfbfbf", -"b c #ff0000", -". c #ffffff", -"...................................", -".........#.....#.....#.....#.......", -".....#.#.#.#.#.#.#.#.#.#.#.#.......", -".....#.#.#.#.#.#.#.#.#.#.#.#.......", -"....##########################.....", -"....#aaaaaaaaaaaaaaaaaaaaaaaa#.....", -"..###aaaaaaaaaaaaaaaaaaaaaaaa###...", -"....#aaaaaaaaaaaaaaaaaaaaaaaa#.....", -"..###aaaaaaaaaaaaaaaaaaaaaaaa###...", -"....#aaaaaaaaaaaaaaaaaaaaaaaa#.....", -".####aaaaaaaaaaaaaaaa#aaaaaaa####..", -"....#aaaaaaaaaaaaaaa#a#aaaaaa#.....", -"..###aaaaaaaaaaaaaaa#a#aaaaaa###...", -"....#aaaaaaaaaaaaaa#aaa#aaaaa#.....", -"..###aaaaaaa#aaaaaa#aaa#aaaaa###...", -"....#aaaaaa#a#aaaa#aaaaa#aaaa#.....", -".####aaaaaa#a#aaaa#aaaaa#aaaa####..", -"....#aaaaa#aaa#aa#aaaaaaa#aaa#.....", -"..###aaaaa#aaa###aaaaaaaaa######...", -"....#aaaa#aaaaa#aaaaaaaaaaaaa#.....", -"..###aaaa#aaaaa#aaaaaaaaaaaaa###...", -"....#aaa#aaaaaaa#aaaaaaaaaaaa#.....", -".#######aaaaaaaaa#####aaaaaaa####..", -"....#aaaaaaaaaaaaaaaaaaaaaaaa#.....", -"..###aaaaaaaaaaaaaaaaaaaaaaaa###...", -"....#aaaaaaaaaaaaaaaaaaaaaaaa#.....", -"....bbbbbbbbbbbbbbbbbbbbbbbbbb.....", -"....bbbbbbbbbbbbbbbbbbbbbbbbbb.....", -".....b.b.b.b.b.b.b.b.b.b.b.b.......", -".....b.b.b.b.b.b.b.b.b.b.b.b.......", -".........b.....b.....b.....b.......", -"..................................."}; - -static const char* const left_axis_xpm[] = { -"33 32 4 1", -"# c #000000", -"b c #bfbfbf", -"a c #ff0000", -". c #ffffff", -".................................", -".........#.....#.....#.....#.....", -".....#.#.#.#.#.#.#.#.#.#.#.#.....", -".....#.#.#.#.#.#.#.#.#.#.#.#.....", -"....aa########################...", -"....aabbbbbbbbbbbbbbbbbbbbbbb#...", -"..aaaabbbbbbbbbbbbbbbbbbbbbbb###.", -"....aabbbbbbbbbbbbbbbbbbbbbbb#...", -"..aaaabbbbbbbbbbbbbbbbbbbbbbb###.", -"....aabbbbbbbbbbbbbbbbbbbbbbb#...", -".aaaaabbbbbbbbbbbbbbb#bbbbbbb####", -"....aabbbbbbbbbbbbbb#b#bbbbbb#...", -"..aaaabbbbbbbbbbbbbb#b#bbbbbb###.", -"....aabbbbbbbbbbbbb#bbb#bbbbb#...", -"..aaaabbbbbb#bbbbbb#bbb#bbbbb###.", -"....aabbbbb#b#bbbb#bbbbb#bbbb#...", -".aaaaabbbbb#b#bbbb#bbbbb#bbbb####", -"....aabbbb#bbb#bb#bbbbbbb#bbb#...", -"..aaaabbbb#bbb###bbbbbbbbb######.", -"....aabbb#bbbbb#bbbbbbbbbbbbb#...", -"..aaaabbb#bbbbb#bbbbbbbbbbbbb###.", -"....aabb#bbbbbbb#bbbbbbbbbbbb#...", -".aaaaa##bbbbbbbbb#####bbbbbbb####", -"....aabbbbbbbbbbbbbbbbbbbbbbb#...", -"..aaaabbbbbbbbbbbbbbbbbbbbbbb###.", -"....aabbbbbbbbbbbbbbbbbbbbbbb#...", -"....aabbbbbbbbbbbbbbbbbbbbbbb#...", -"....aa########################...", -".....#.#.#.#.#.#.#.#.#.#.#.#.....", -".....#.#.#.#.#.#.#.#.#.#.#.#.....", -".........#.....#.....#.....#.....", -"................................."}; - -static const char* const top_axis_xpm[] = { -"34 34 4 1", -"a c #000000", -"b c #bfbfbf", -"# c #ff0000", -". c #ffffff", -"..................................", -"..................................", -".........#.....#.....#.....#......", -".....#.#.#.#.#.#.#.#.#.#.#.#......", -".....#.#.#.#.#.#.#.#.#.#.#.#......", -"....##########################....", -"....##########################....", -"..aaabbbbbbbbbbbbbbbbbbbbbbbbaaa..", -"....abbbbbbbbbbbbbbbbbbbbbbbba....", -"..aaabbbbbbbbbbbbbbbbbbbbbbbbaaa..", -"....abbbbbbbbbbbbbbbbbbbbbbbba....", -".aaaabbbbbbbbbbbbbbbbabbbbbbbaaaa.", -"....abbbbbbbbbbbbbbbababbbbbba....", -"..aaabbbbbbbbbbbbbbbababbbbbbaaa..", -"....abbbbbbbbbbbbbbabbbabbbbba....", -"..aaabbbbbbbabbbbbbabbbabbbbbaaa..", -"....abbbbbbababbbbabbbbbabbbba....", -".aaaabbbbbbababbbbabbbbbabbbbaaaa.", -"....abbbbbabbbabbabbbbbbbabbba....", -"..aaabbbbbabbbaaabbbbbbbbbaaaaaa..", -"....abbbbabbbbbabbbbbbbbbbbbba....", -"..aaabbbbabbbbbabbbbbbbbbbbbbaaa..", -"....abbbabbbbbbbabbbbbbbbbbbba....", -".aaaaaaabbbbbbbbbaaaaabbbbbbbaaaa.", -"....abbbbbbbbbbbbbbbbbbbbbbbba....", -"..aaabbbbbbbbbbbbbbbbbbbbbbbbaaa..", -"....abbbbbbbbbbbbbbbbbbbbbbbba....", -"....abbbbbbbbbbbbbbbbbbbbbbbba....", -"....aaaaaaaaaaaaaaaaaaaaaaaaaa....", -".....a.a.a.a.a.a.a.a.a.a.a.a......", -".....a.a.a.a.a.a.a.a.a.a.a.a......", -".........a.....a.....a.....a......", -"..................................", -".................................."}; - -static const char* const right_axis_xpm[] = { -"32 32 4 1", -"# c #000000", -"b c #bfbfbf", -"a c #ff0000", -". c #ffffff", -"................................", -"........#.....#.....#.....#.....", -"....#.#.#.#.#.#.#.#.#.#.#.#.....", -"....#.#.#.#.#.#.#.#.#.#.#.#.....", -"...########################aa...", -"...#bbbbbbbbbbbbbbbbbbbbbbbaa...", -".###bbbbbbbbbbbbbbbbbbbbbbbaaaa.", -"...#bbbbbbbbbbbbbbbbbbbbbbbaa...", -".###bbbbbbbbbbbbbbbbbbbbbbbaaaa.", -"...#bbbbbbbbbbbbbbbbbbbbbbbaa...", -"####bbbbbbbbbbbbbbbb#bbbbbbaaaaa", -"...#bbbbbbbbbbbbbbb#b#bbbbbaa...", -".###bbbbbbbbbbbbbbb#b#bbbbbaaaa.", -"...#bbbbbbbbbbbbbb#bbb#bbbbaa...", -".###bbbbbbb#bbbbbb#bbb#bbbbaaaa.", -"...#bbbbbb#b#bbbb#bbbbb#bbbaa...", -"####bbbbbb#b#bbbb#bbbbb#bbbaaaaa", -"...#bbbbb#bbb#bb#bbbbbbb#bbaa...", -".###bbbbb#bbb###bbbbbbbbb##aaaa.", -"...#bbbb#bbbbb#bbbbbbbbbbbbaa...", -".###bbbb#bbbbb#bbbbbbbbbbbbaaaa.", -"...#bbb#bbbbbbb#bbbbbbbbbbbaa...", -"#######bbbbbbbbb#####bbbbbbaaaaa", -"...#bbbbbbbbbbbbbbbbbbbbbbbaa...", -".###bbbbbbbbbbbbbbbbbbbbbbbaaaa.", -"...#bbbbbbbbbbbbbbbbbbbbbbbaa...", -"...#bbbbbbbbbbbbbbbbbbbbbbbaa...", -"...########################aa...", -"....#.#.#.#.#.#.#.#.#.#.#.#.....", -"....#.#.#.#.#.#.#.#.#.#.#.#.....", -"........#.....#.....#.....#.....", -"................................"}; - -/* XPM */ -static const char * liniar_scale_xpm[] = { -"27 16 3 1", -" c None", -". c #000000", -"+ c #C0C0C0", -" ........................", -"....++++++++++++++++++++++.", -" .++++++++++++++++++++.+.", -" ...++++++++++++++++++..++.", -" .++++++++++++++++..++++.", -" ...++++++++++++++..++++++.", -" .++++++++++++..++++++++.", -"....++++++++++..++++++++++.", -" .++++++++..++++++++++++.", -" ...++++++..++++++++++++++.", -" .++++..++++++++++++++++.", -"....++++++++++++++++++++++.", -" ........................", -" . . . . . ", -" . . . . . ", -" . . . "}; - -/* XPM */ -static const char * log10_xpm[] = { -"27 16 3 1", -" c None", -". c #000000", -"+ c #C0C0C0", -" ........................", -"....++++++++++++++++++++++.", -" .++..++..+++++++++++..+.", -" ...++..+.+..++++++++..+++.", -" .++..+.+..++++++..+++++.", -" ...++..+.+..++++..+++++++.", -" .++..++..+++..+++++++++.", -"....+++++++++..+++++++++++.", -" .+++++++..+++++++++++++.", -" ...+++++..+++++++++++++++.", -" .+++..+++++++++++++++++.", -"....++++++++++++++++++++++.", -" ........................", -" . . . . . . . ", -" . . . . . . . ", -" . "}; - -/* XPM */ -static const char * ln_scale_xpm[] = { -"27 16 3 1", -" c None", -". c #000000", -"+ c #C0C0C0", -" ........................", -"....++++++++++++++++++++++.", -" .++++++++++++++++++.+++.", -" ...++++...+++++++++++.+++.", -" .+++..+..+++++++++.++++.", -" ...+++.....+++++++++.++++.", -" .+++..+++++++++++.+++++.", -"....++++....++++++++.+++++.", -" .+++++++++++++++.++++++.", -" ...+++++++++++++..+++++++.", -" .+++++........+++++++++.", -"....++++++++++++++++++++++.", -" ........................", -" . . . . . . . ", -" . . . . . . . ", -" . "}; - -/* XPM */ -static const char * log2_scale_xpm[] = { -"27 16 3 1", -" c None", -". c #000000", -"+ c #C0C0C0", -" ........................", -"....++++++++++++++++++++++.", -" .++++++++++++++++++++++.", -" ...++....+++++++++++++..+.", -" .++++..+++++++++++..+++.", -"....++++..++++++++...+++++.", -" .+++..+++++++..++++++++.", -"....++....++++..++++++++++.", -" .+++++++...++++++++++++.", -" ...+++++..+++++++++++++++.", -" .+++..+++++++++++++++++.", -"....++++++++++++++++++++++.", -" ........................", -" . . . . . . . ", -" . . . . . . . ", -" . "}; - -/* XPM */ -static const char * reciprocal_scale_xpm[] = { -"27 16 3 1", -" c None", -". c #000000", -"+ c #C0C0C0", -" ........................", -"....+++.++++++++++++++++++.", -" .+++.++++++++++++++++++.", -" ...++++++++++++++++++++...", -" .+.....++++++++++++..++.", -"....++++++++++++++++..++++.", -" .+.....++++++++..++++++.", -"....+.+.+.++++++..++++++++.", -" .+++.++++++..++++++++++.", -" ...+++.++++..++++++++++++.", -" .++...+..++++++++++++++.", -"....++++++++++++++++++++++.", -" ........................", -" . . . . . . . . ", -" . . . . . . . . ", -" . . . . . "}; - -/* XPM */ -static const char* const bottom_scl_xpm[] = { -"36 38 75 1", -" c None", -". c #FFFFFF", -"+ c #818181", -"@ c #070707", -"# c #101010", -"$ c #EEEEEE", -"% c #1D1D1D", -"& c #ACACAC", -"* c #151515", -"= c #121212", -"- c #929292", -"; c #242424", -"> c #D5D5D5", -", c #C9C9C9", -"' c #2A2A2A", -") c #5E5E5E", -"! c #000000", -"~ c #C8C8C8", -"{ c #D2D2D2", -"] c #090909", -"^ c #060606", -"/ c #FEFEFE", -"( c #FCFCFC", -"_ c #F7F7F7", -": c #CECECE", -"< c #444444", -"[ c #E0E0E0", -"} c #464646", -"| c #E8E8E8", -"1 c #282828", -"2 c #D3D3D3", -"3 c #D1D1D1", -"4 c #A4A4A4", -"5 c #484848", -"6 c #EBEBEB", -"7 c #7D7D7D", -"8 c #050505", -"9 c #7F7F7F", -"0 c #FDFDFD", -"a c #7D6F6F", -"b c #F38C82", -"c c #E71E09", -"d c #E82612", -"e c #FDEFEE", -"f c #E9321F", -"g c #F7B3AC", -"h c #E82B17", -"i c #E82814", -"j c #F49C93", -"k c #EA3826", -"l c #FBD8D5", -"m c #F9CEC9", -"n c #EA3E2C", -"o c #EF6D5F", -"p c #E71803", -"q c #F9CDC8", -"r c #FAD6D2", -"s c #E7200B", -"t c #E71D08", -"u c #FEFCFC", -"v c #FEF7F7", -"w c #FAD2CE", -"x c #ED5546", -"y c #FCE2E0", -"z c #ED5748", -"A c #FCEAE8", -"B c #EA3C2A", -"C c #FAD7D3", -"D c #FAD5D1", -"E c #F6ACA5", -"F c #ED594A", -"G c #FDECEB", -"H c #F2897E", -"I c #E71C07", -"J c #F28B80", -"....................................", -"......+@#+......$%......&*=-........", -"......;>,'......)!......%~{]........", -"......^/(^......_!........:<........", -"......^((^.......!.......[}|........", -"......123;.......!......456.........", -"......78^9.......!......*!!!........", -"+@#+................................", -";>,'...(!0.......!.......!.....+@#+.", -"^/(^...!!!!!!!!!!!!!!!!!!!!!!..;>,'.", -"^((^...!aaaaaaaaaaaaaaaaaaaa!..^/(^.", -"123;..!!aaaaaaaaaaaaaaaaaaaa!!.^((^.", -"78^9...!aaaaaaaaaaaaaaaaaaaa!..123;.", -".......!aaaaaaaaaaaaaaaaaaaa!..78^9.", -".......!aaaaaaaaaaaaaaaaaaaa!.......", -"$%.....!aaaaaaaaaaaaaaaaaaaa!.......", -")!.....!aaaaaaaaaaaaaaaaaaaa!..$%...", -"_!.....!aaaaaaaaaaaaaaaaaaaa!..)!...", -".!....!!aaaaaaaaaaaaaaaaaaaa!!._!...", -".!.....!aaaaaaaaaaaaaaaaaaaa!...!...", -".!.....!aaaaaaaaaaaaaaaaaaaa!...!...", -".......!aaaaaaaaaaaaaaaaaaaa!...!...", -"&*=-...!aaaaaaaaaaaaaaaaaaaa!.......", -"%~{]...!aaaaaaaaaaaaaaaaaaaa!..&*=-.", -"..:<...!aaaaaaaaaaaaaaaaaaaa!..%~{].", -".[}|..!!aaaaaaaaaaaaaaaaaaaa!!...:<.", -"456....!aaaaaaaaaaaaaaaaaaaa!...[}|.", -"*!!!...!aaaaaaaaaaaaaaaaaaaa!..456..", -".......!!!!!!!!!!!!!!!!!!!!!!..*!!!.", -".........!........!.......!.........", -"....................................", -"........bcdb.....ef......ghij.......", -"........klmn.....op......fqrs.......", -"........t/ut.....vp........wx.......", -"........tuut......p.......yzA.......", -"........BCDk......p......EFG........", -"........HItJ......p......hppp.......", -"...................................."}; - -/* XPM */ -static const char* const top_scl_xpm[] = { -"36 38 75 1", -" c None", -". c #FFFFFF", -"+ c #F38C82", -"@ c #E71E09", -"# c #E82612", -"$ c #FEFAFA", -"% c #E9321F", -"& c #F7B3AC", -"* c #E82B17", -"= c #E82814", -"- c #F49C93", -"; c #EA3826", -"> c #FBD8D5", -", c #F9CEC9", -"' c #EA3E2C", -") c #EF6D5F", -"! c #E71803", -"~ c #F9CDC8", -"{ c #FAD6D2", -"] c #E7200B", -"^ c #E71D08", -"/ c #FEFEFE", -"( c #FEFCFC", -"_ c #FAD2CE", -": c #ED5546", -"< c #FCE2E0", -"[ c #ED5748", -"} c #FCEAE8", -"| c #EA3C2A", -"1 c #FAD7D3", -"2 c #FAD5D1", -"3 c #F6ACA5", -"4 c #ED594A", -"5 c #FDF2F1", -"6 c #F2897E", -"7 c #E71C07", -"8 c #F28B80", -"9 c #818181", -"0 c #070707", -"a c #101010", -"b c #242424", -"c c #D5D5D5", -"d c #C9C9C9", -"e c #2A2A2A", -"f c #000000", -"g c #060606", -"h c #FCFCFC", -"i c #7D6F6F", -"j c #282828", -"k c #D3D3D3", -"l c #D1D1D1", -"m c #7D7D7D", -"n c #050505", -"o c #7F7F7F", -"p c #FAFAFA", -"q c #1D1D1D", -"r c #5E5E5E", -"s c #ACACAC", -"t c #151515", -"u c #121212", -"v c #929292", -"w c #C8C8C8", -"x c #D2D2D2", -"y c #090909", -"z c #CECECE", -"A c #444444", -"B c #E0E0E0", -"C c #464646", -"D c #E8E8E8", -"E c #A4A4A4", -"F c #484848", -"G c #F1F1F1", -"H c #EEEEEE", -"I c #F7F7F7", -"J c #EBEBEB", -"....................................", -".......+@#+.....$%......&*=-........", -".......;>,'.....)!......%~{]........", -".......^/(^......!........_:........", -".......^((^......!.......<[}........", -".......|12;......!......345.........", -".......67^8......!......*!!!........", -"90a9................................", -"bcde....f........f.......f.....90a9.", -"g/hg...ffffffffffffffffffffff..bcde.", -"ghhg...fiiiiiiiiiiiiiiiiiiiif..g/hg.", -"jklb..ffiiiiiiiiiiiiiiiiiiiiff.ghhg.", -"mngo...fiiiiiiiiiiiiiiiiiiiif..jklb.", -".......fiiiiiiiiiiiiiiiiiiiif..mngo.", -".......fiiiiiiiiiiiiiiiiiiiif.......", -"pq.....fiiiiiiiiiiiiiiiiiiiif.......", -"rf.....fiiiiiiiiiiiiiiiiiiiif..pq...", -".f.....fiiiiiiiiiiiiiiiiiiiif..rf...", -".f....ffiiiiiiiiiiiiiiiiiiiiff..f...", -".f.....fiiiiiiiiiiiiiiiiiiiif...f...", -".f.....fiiiiiiiiiiiiiiiiiiiif...f...", -".......fiiiiiiiiiiiiiiiiiiiif...f...", -"stuv...fiiiiiiiiiiiiiiiiiiiif.......", -"qwxy...fiiiiiiiiiiiiiiiiiiiif..stuv.", -"..zA...fiiiiiiiiiiiiiiiiiiiif..qwxy.", -".BCD..ffiiiiiiiiiiiiiiiiiiiiff...zA.", -"EFG....fiiiiiiiiiiiiiiiiiiiif...BCD.", -"tfff...fiiiiiiiiiiiiiiiiiiiif..EFG..", -".......ffffffffffffffffffffff..tfff.", -".........f........f.......f.........", -"....................................", -".......90a9......Hq......stuv.......", -".......bcde......rf......qwxy.......", -".......g/hg......If........zA.......", -".......ghhg.......f.......BCD.......", -".......jklb.......f......EFJ........", -".......mngo.......f......tfff.......", -"...................................."}; - -/* XPM */ -static const char* const left_scl_xpm[] = { -"36 36 72 1", -" c None", -". c #FFFFFF", -"+ c #818181", -"@ c #070707", -"# c #101010", -"$ c #FAFAFA", -"% c #1D1D1D", -"& c #ACACAC", -"* c #151515", -"= c #121212", -"- c #929292", -"; c #242424", -"> c #D5D5D5", -", c #C9C9C9", -"' c #2A2A2A", -") c #5E5E5E", -"! c #000000", -"~ c #C8C8C8", -"{ c #D2D2D2", -"] c #090909", -"^ c #060606", -"/ c #FEFEFE", -"( c #FCFCFC", -"_ c #CECECE", -": c #444444", -"< c #E0E0E0", -"[ c #464646", -"} c #E8E8E8", -"| c #282828", -"1 c #D3D3D3", -"2 c #D1D1D1", -"3 c #A4A4A4", -"4 c #484848", -"5 c #F1F1F1", -"6 c #7D7D7D", -"7 c #050505", -"8 c #7F7F7F", -"9 c #F38C82", -"0 c #E71E09", -"a c #E82612", -"b c #EA3826", -"c c #FBD8D5", -"d c #F9CEC9", -"e c #EA3E2C", -"f c #E71D08", -"g c #FEFCFC", -"h c #7D6F6F", -"i c #EA3C2A", -"j c #FAD7D3", -"k c #FAD5D1", -"l c #F2897E", -"m c #E71C07", -"n c #F28B80", -"o c #FEFAFA", -"p c #E9321F", -"q c #EF6D5F", -"r c #E71803", -"s c #F7B3AC", -"t c #E82B17", -"u c #E82814", -"v c #F49C93", -"w c #F9CDC8", -"x c #FAD6D2", -"y c #E7200B", -"z c #FAD2CE", -"A c #ED5546", -"B c #FCE2E0", -"C c #ED5748", -"D c #FCEAE8", -"E c #F6ACA5", -"F c #ED594A", -"G c #FDF2F1", -".......+@#+......$%......&*=-.......", -".......;>,'......)!......%~{].......", -".......^/(^.......!........_:.......", -".......^((^.......!.......<[}.......", -".......|12;.......!......345........", -".......67^8.......!......*!!!.......", -"....................................", -".90a9...!........!.......!.....+@#+.", -".bcde..!!!!!!!!!!!!!!!!!!!!!!..;>,'.", -".f/gf..!hhhhhhhhhhhhhhhhhhhh!..^/(^.", -".fggf.!!hhhhhhhhhhhhhhhhhhhh!!.^((^.", -".ijkb..!hhhhhhhhhhhhhhhhhhhh!..|12;.", -".lmfn..!hhhhhhhhhhhhhhhhhhhh!..67^8.", -".......!hhhhhhhhhhhhhhhhhhhh!.......", -".......!hhhhhhhhhhhhhhhhhhhh!.......", -"..op...!hhhhhhhhhhhhhhhhhhhh!...%...", -"..qr...!hhhhhhhhhhhhhhhhhhhh!..)!...", -"...r..!!hhhhhhhhhhhhhhhhhhhh!!..!...", -"...r...!hhhhhhhhhhhhhhhhhhhh!...!...", -"...r...!hhhhhhhhhhhhhhhhhhhh!...!...", -"...r...!hhhhhhhhhhhhhhhhhhhh!...!...", -".......!hhhhhhhhhhhhhhhhhhhh!.......", -".stuv..!hhhhhhhhhhhhhhhhhhhh!..&*=-.", -".pwxy..!hhhhhhhhhhhhhhhhhhhh!..%~{].", -"...zA.!!hhhhhhhhhhhhhhhhhhhh!!..._:.", -"..BCD..!hhhhhhhhhhhhhhhhhhhh!...<[}.", -".EFG...!hhhhhhhhhhhhhhhhhhhh!..34...", -".trrr..!!!!!!!!!!!!!!!!!!!!!!..*!!!.", -".........!........!.......!.........", -"....................................", -".......+@#+......$%......&*=-.......", -".......;>,'......)!......%~{].......", -".......^/(^.......!........_:.......", -".......^((^.......!.......<[}.......", -".......|12;.......!......345........", -".......67^8.......!......*!!!......."}; - -/* XPM */ -static const char* const right_scl_xpm[] = { -"36 36 72 1", -" c None", -". c #FFFFFF", -"+ c #818181", -"@ c #070707", -"# c #101010", -"$ c #FAFAFA", -"% c #1D1D1D", -"& c #ACACAC", -"* c #151515", -"= c #121212", -"- c #929292", -"; c #242424", -"> c #D5D5D5", -", c #C9C9C9", -"' c #2A2A2A", -") c #5E5E5E", -"! c #000000", -"~ c #C8C8C8", -"{ c #D2D2D2", -"] c #090909", -"^ c #060606", -"/ c #FEFEFE", -"( c #FCFCFC", -"_ c #CECECE", -": c #444444", -"< c #E0E0E0", -"[ c #464646", -"} c #E8E8E8", -"| c #282828", -"1 c #D3D3D3", -"2 c #D1D1D1", -"3 c #A4A4A4", -"4 c #484848", -"5 c #F1F1F1", -"6 c #7D7D7D", -"7 c #050505", -"8 c #7F7F7F", -"9 c #F38C82", -"0 c #E71E09", -"a c #E82612", -"b c #EA3826", -"c c #FBD8D5", -"d c #F9CEC9", -"e c #EA3E2C", -"f c #7D6F6F", -"g c #E71D08", -"h c #FEFCFC", -"i c #EA3C2A", -"j c #FAD7D3", -"k c #FAD5D1", -"l c #F2897E", -"m c #E71C07", -"n c #F28B80", -"o c #FEFAFA", -"p c #E9321F", -"q c #EF6D5F", -"r c #E71803", -"s c #F7B3AC", -"t c #E82B17", -"u c #E82814", -"v c #F49C93", -"w c #F9CDC8", -"x c #FAD6D2", -"y c #E7200B", -"z c #FAD2CE", -"A c #ED5546", -"B c #FCE2E0", -"C c #ED5748", -"D c #FCEAE8", -"E c #F6ACA5", -"F c #ED594A", -"G c #FDF2F1", -".......+@#+......$%......&*=-.......", -".......;>,'......)!......%~{].......", -".......^/(^.......!........_:.......", -".......^((^.......!.......<[}.......", -".......|12;.......!......345........", -".......67^8.......!......*!!!.......", -"....................................", -".+@#+...!........!.......!.....90a9.", -".;>,'..!!!!!!!!!!!!!!!!!!!!!!..bcde.", -".^/(^..!ffffffffffffffffffff!..g/hg.", -".^((^.!!ffffffffffffffffffff!!.ghhg.", -".|12;..!ffffffffffffffffffff!..ijkb.", -".67^8..!ffffffffffffffffffff!..lmgn.", -".......!ffffffffffffffffffff!.......", -".......!ffffffffffffffffffff!.......", -".$%....!ffffffffffffffffffff!...op..", -".)!....!ffffffffffffffffffff!...qr..", -"..!...!!ffffffffffffffffffff!!...r..", -"..!....!ffffffffffffffffffff!....r..", -"..!....!ffffffffffffffffffff!....r..", -"..!....!ffffffffffffffffffff!....r..", -".......!ffffffffffffffffffff!.......", -".&*=-..!ffffffffffffffffffff!..stuv.", -".%~{]..!ffffffffffffffffffff!..pwxy.", -"..._:.!!ffffffffffffffffffff!!...zA.", -"..<[}..!ffffffffffffffffffff!...BCD.", -".345...!ffffffffffffffffffff!..EFG..", -".*!!!..!!!!!!!!!!!!!!!!!!!!!!..trrr.", -".........!........!.......!.........", -"....................................", -".......+@#+......$%......&*=-.......", -".......;>,'......)!......%~{].......", -".......^/(^.......!........_:.......", -".......^((^.......!.......<[}.......", -".......|12;.......!......345........", -".......67^8.......!......*!!!......."}; - -static const char* const image2_data[] = { -"74 77 171 2", -" c None", -". c #FFFFFF", -"+ c #E0E0E0", -"@ c #FAFAFA", -"# c #363636", -"$ c #ABABAB", -"% c #000000", -"& c #BDBDBD", -"* c #737373", -"= c #858585", -"- c #FFE8E8", -"; c #FFF7F7", -"> c #FFD1D1", -", c #FFF0F0", -"' c #E6E6E6", -") c #FFB2B2", -"! c #FFE6E6", -"~ c #FF6666", -"{ c #FFCCCC", -"] c #C9C9C9", -"^ c #939493", -"/ c #808080", -"( c #878787", -"_ c #D6D6D6", -": c #969696", -"< c #030303", -"[ c #383838", -"} c #4C4C4C", -"| c #1A1A1A", -"1 c #080808", -"2 c #C2C2C2", -"3 c #EBEBEB", -"4 c #F0F0F0", -"5 c #8C8C8C", -"6 c #7A7A7A", -"7 c #A3A3A3", -"8 c #999999", -"9 c #A1A1A1", -"0 c #828282", -"a c #949494", -"b c #F2F2F2", -"c c #474747", -"d c #545454", -"e c #0F0F0F", -"f c #B5B5B5", -"g c #CFCFCF", -"h c #262626", -"i c #333333", -"j c #DEDEDE", -"k c #FDFDFD", -"l c #D7D7D7", -"m c #B7B7B7", -"n c #C4C4C4", -"o c #F7F7F7", -"p c #CCCCCC", -"q c #2E2E2E", -"r c #B2B2B2", -"s c #DFDFDF", -"t c #ACACAC", -"u c #ADADAD", -"v c #D3D3D3", -"w c #CDCDCD", -"x c #AAAAAA", -"y c #D4C3C3", -"z c #A9A9A9", -"A c #AAA8A8", -"B c #DB7F7F", -"C c #E3E3E3", -"D c #E5E5E5", -"E c #F2DADA", -"F c #B19999", -"G c #FFC4C4", -"H c #D2D2D2", -"I c #FFD4D4", -"J c #EA6565", -"K c #E2E2E2", -"L c #FFA1A1", -"M c #C8C8C8", -"N c #AFAFAF", -"O c #FF9999", -"P c #F5C6C6", -"Q c #E9E9E9", -"R c #B6B6B6", -"S c #CFB4B4", -"T c #B9B9B9", -"U c #F5F5F5", -"V c #ACA7A7", -"W c #EAEAEA", -"X c #F9F9F9", -"Y c #B8B8B8", -"Z c #C0A6A6", -"` c #B4B4B4", -" . c #EFEFEF", -".. c #F2C3C3", -"+. c #EEEEEE", -"@. c #BCBCBC", -"#. c #C5C5C5", -"$. c #DADADA", -"%. c #BEBEBE", -"&. c #B0B0B0", -"*. c #FBFBFB", -"=. c #C6C6C6", -"-. c #B1B1B1", -";. c #BABABA", -">. c #AEAEAE", -",. c #D0D0D0", -"'. c #FCFCFC", -"). c #141414", -"!. c #D8D8D8", -"~. c #C7C7C7", -"{. c #575757", -"]. c #3D3D3D", -"^. c #C3C3C3", -"/. c #5E5E5E", -"(. c #7D7D7D", -"_. c #B3B3B3", -":. c #F6C8C8", -"<. c #757575", -"[. c #919191", -"}. c #CAB3B3", -"|. c #EDEDED", -"1. c #ADA8A8", -"2. c #666666", -"3. c #2B2B2B", -"4. c #BBBBBB", -"5. c #C9AAAA", -"6. c #292929", -"7. c #D4D4D4", -"8. c #FBC9C9", -"9. c #E8E8E8", -"0. c #9C9C9C", -"a. c #E4E4E4", -"b. c #E7E7E7", -"c. c #CACACA", -"d. c #C1C1C1", -"e. c #E39090", -"f. c #CBCBCB", -"g. c #ADA3A3", -"h. c #C8B0B0", -"i. c #F59A9A", -"j. c #C0A9A9", -"k. c #C9BFBF", -"l. c #7A4747", -"m. c #A18C8C", -"n. c #8C8282", -"o. c #332929", -"p. c #242424", -"q. c #0A0A0A", -"r. c #454545", -"s. c #595959", -"t. c #525252", -"u. c #5C5C5C", -"v. c #D9D9D9", -"w. c #121212", -"x. c #8A8A8A", -"y. c #171717", -"z. c #A8A8A8", -"A. c #696969", -"B. c #707070", -"C. c #9E9E9E", -"D. c #404040", -"E. c #616161", -"F. c #8F8F8F", -"G. c #4F4F4F", -"H. c #050505", -"I. c #DBDBDB", -"J. c #4A4A4A", -"K. c #212121", -"L. c #3B3B3B", -"M. c #636363", -"N. c #D1D1D1", -". . . . . . . . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . @ # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . $ % & . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . * % = . . . . . . . . . . . - . . . . . . . . . . . ; > . . . . . . . . . . . . , . . . . . . . . . . . - - . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . . . ) . . . . . . . . . . . ! ~ . . . . . . . . . . . . { . . . . . . . . . . . ) ) . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . . . ) . . . . . . . . . . . ! ~ . . . . . . . . . . . . { . . . . . . . . . . . ) ) . . . . . . . . . . . ", -". . . ] ^ / ( _ . ' % . . . . . . . . . . . . ) . . . . . . . . . . . ! ~ . . . . . . . . . . . . { . . . . . . . . . . . ) ) . . . . . . . . . . . ", -". . : < [ } | 1 ] ' % . . . . . . . . . . . . ) . . . . . . . . . . . ! ~ . . . . . . . . . . . . { . . . . . . . . . . . ) ) . . . . . . . . . . . ", -". . 2 ' . . 3 % / ' % . . . . . . . . . . . . ) . . . . . . . . . . . ! ~ . . . . . . . . . . . . { . . . . . . . . . . . ) ) . . . . . . . . . . . ", -". . . . . . 4 % 5 ' % . . . . . . . . . . . . ) . . . . . . . . . . . ! ~ . . . . . . . . . . . . { . . . . . . . . . . . ) ) . . . . . . . . . . . ", -". . . . . . 6 1 + ' % . . . . . . . . . . . . ) . . . . . . . . . . . ! ~ . . . . . . . . . . . . { . . . . . . . . . . . ) ) . . . . . . . . . . . ", -". . . . . 7 < 8 @ 5 % 9 . . . . . . . . . . . ) . . . . . . . . . . . ! ~ . . . . . . . . . . . . { . . . . . . . . . . . ) ) . . . . . . . . . . . ", -". . . . 0 < a . b c % d . . . . . . . . . . . ) . . . . . . . . . . . ! ~ . . . . . . . . . . . . { . . . . . . . . . . . ) ) . . . . . . . . . . . ", -". . b d e f . . . ' % . . . . . . . . . . . . ) . . . . . . . . . . . ! ~ . . . . . . . . . . . . { . . . . . . . . . . . ) ) . . . . . . . . . . . ", -". g h i j . . . . ' % . . . . . . . . . . . . ) . . . . k l m m m n o ! ~ . . . . . . . . . . . . { . . . . . . . . . . . ) ) . . . . . . . . . . . ", -"p 1 q $ r r r g . ' % . . . . . . . . . . . . ) . . . s t u ] v w r x y ~ . . . . . . . . . . . . { . . . . . . . . . . . ) ) . . . . . . . . . . . ", -"7 i i i i i i : . ' % . . . . . . . . . . . . ) . . p z _ . . . . . l A B . . . . . . . . . . . . { . . . . . . . . . . . ) ) . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . . . ) . C x D . . . . . . . E F ] . . . . . . . . . . . { . . . . . . . . . . . ) ) . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . . . G . u H . . . . . . . . I J x K . . . . . . . . . . { . . . . . . . . . . . L G . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . . . { M N . . . . . . . . . { ~ _ $ o . . . . . . . . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . . . P x Q . . . . . . . . . { ~ . & R . . . . . . . . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . . . S T . . . . . . . . . . { ~ . U $ _ . . . . . . . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . . 4 V W . . . . . . . . . . { ~ . . K x X . . . . . . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . . Y Z . . . . . . . . . . . { ~ . . . ` n . . . . . . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . .x ... . . . . . . . . . . { ~ . . . +.$ +.. . . . . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . @.n { . . . . . . . . . . . { ~ . . . . #.R . . . . . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . x +.{ . . . . . . . . . . . { ~ . . . . X z o . . . . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . $.u . { . . . . . . . . . . . { ~ . . . . . %.&.*.. . . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . ` =.. { . . . . . . . . . . . { ~ . . . . . . -.=.. . . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . 4 z X . { . . . . . . . . . . . { ~ . . . . . . + t . . . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . #.;.. . { . . . . . . . . . . . { ~ . . . . . . . >.v . . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . u $.. . { . . . . . . . . . . . { ~ . . . . . . . _ t . . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . n 2 . ' % . . . . . . . + t k . . { . . . . . . . . . . . { ~ . . . . . . . . t ,.. . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . '.& ).5 . ' % . . . . . . . m #.. . . { . . . . . . . . . . . { ~ . . . . . . . . !.t . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . f % % % ~.. ' % . . . . . . . x W . . . { . . . . . . . . . . . { ~ . . . . . . . . . N ] . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . a 1 @ . ' % . . . . . . s u . . . . { . . . . . . . . . . . { ~ . . . . . . . . . l u k { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . {.].. . ' % . . . . . . %.%.. . . . { . . . . . . . . . . . { ~ . . . . . . . . . . r ^.{ . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . | 6 . U /.% (.. . . . . _.' . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . 4 u :.. . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . + % r . o <.% [.. . . . o $ '.. . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . ^.}.. . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . 7 % |.. . ' % . . . . . ,._.. . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . o 1.D . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . 2.3.. . . ' % . . . . . 4.=.. . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . 5.-.. . . . . . . . . . O { . . . . . . . . . . . ", -". . p p 6.} p + . ' % . . . . . _.7.. . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . 8.t ,.. . . . . . . . . O { . . . . . . . . . . . ", -". 9.i i i i i 0.. ' % . . . . . x +.. . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { C x a.. . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . x . . . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { . ,.u . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . b.t . . . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { . . &.4.. . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . ^.T . . . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { . . X u c.. . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . m H . . . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { . . . +.$ p . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . t C . . . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { . . . . +.x _ . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . z X . . . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { . . . . . + x _ . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . U x . . . . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { . . . . . . K x H . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . a.f . . . . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { . . . . . . . ' &.d.X O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . $.-.. . . . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { . . . . . . . . X _.>.e.{ . . . . . . . . . . . ", -". . . . . . . . . ' % . . . M 4.. . . . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { . . . . . . . . . . f.g.h.U . . . . . . . . . . ", -". . . . . . . . . ' % . . . $.,.. . . . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { . . . . . . . . . . . i.j.x Y b . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { . . . . . . . . . . . O { b.@.x &.~.D . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { . . . . . . . . . . . O { . . U f.m @.. . . . . ", -". . . . . . . . . ' % . . . . . . . . . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . . . { . . . . . . . . . . . { ~ . . . . . . . . . . . . { . . . . . . . . . . . O { . . . . . . . . . . . ", -". . . . . . . . . ' % . . . . . . . . . . . . { . . . . . . . . . . . k.l.. . . . . . . . . . . . { . . . . . . . . . . . m.n.. . . . . . . 2 C . . ", -". . . . . . . . . ' % i i i i i i i i i i i i o.i i i i i i i i i i i p.q.i i i i i i i i i i i i o.i i i i i i i i i i i | ).i i i i i i i ).< r.~.", -". . . . . . . . . . Y r r r r r r r r r r r r r r r r r r r r r r r r (.p.r r r r r r r r r r r r r r r r r r r r r r r r s.c r r r r r r r t.u.2 . ", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 ] . . . . . . . . . . . . . . . . . . . . . . . . + v.. . . . . . . . . . . ", -". . . . '.= ).% w.[.. . . . . . . . . . . . . . . . . . . . . . . . . . x.8 . . . . . . . . . . . . . . . . . . . . . ~.2.[ i c 2 . . . . . . . . . ", -". . . . 2.y.z.p A.< j . . . . . . . . . . . . . . . . . . . . . . b &.B.< C.. . . . . . . . . . . . . . . . . . . . . D.t.[.a 3.1 9.. . . . . . . . ", -". . . p % &.. . + % r . . . . . . . . . . . . . . . . . . . . . . 2 } i % v.. . . . . . . . . . . . . . . . . . . . . 3 . . . &.% p . . . . . . . . ", -". . . E.h . . . ' % r . . . . . . . . . . . . . . . . . . . . . . . . / ).. . . . . . . . . . . . . . . . . . . . . . . . . . F.< 9.. . . . . . . . ", -". . . | * . . . ~.% ~.. . . . . . . . . . . . . . . . . . . . . . . . c G.. . . . . . . . . . . . . . . . . . . . . . . . . + ).E.. . . . . . . . . ", -". . j % &.. . . a H.U . . . . . . . . . . . . . . . . . . . . . . . '.q.x.. . . . . . . . . . . . . . . . . . . . . . . . j h # U . . . . . . . . . ", -". . Y % I.. . . G.D.. . . . . . . . . . . . . . . . . . . . . . . . p % ~.. . . . . . . . . . . . . . . . . . . . . . . n y.J.4 . . . . . . . . . . ", -". . r % ' . . 9.1 8 . . . . . . . . . . . . . . . . . . . . . . . . a 1 o . . . . . . . . . . . . . . . . . . . . . . [.H.<.'.. . . . . . . . . . . ", -". . & % 2 . '.s.K.U . . . . . . . . . . . . . . . . . . . . . . . . d L.. . . . . . . . . . . . . . . . . . . . . |.t.w.r . . . . . . . . . . . . . ", -". . @ 6.).} h y.p . . . . . . . . . . . . . . . . . . . . . . @ / / ).# / Y . . . . . . . . . . . . . . . . . . . M.% J.2.2.2.2.N.. . . . . . . . . ", -". . . 3 F./ a 4 . . . . . . . . . . . . . . . . . . . . . . . |./ / / / / n . . . . . . . . . . . . . . . . . . . 0./ / / / / / 9.. . . . . . . . . "}; - -static const char* const image3_data[] = { -"74 77 168 2", -" c None", -". c #FFFFFF", -"+ c #E0E0E0", -"@ c #FAFAFA", -"# c #363636", -"$ c #ABABAB", -"% c #000000", -"& c #BDBDBD", -"* c #737373", -"= c #858585", -"- c #E6E6E6", -"; c #C9C9C9", -"> c #939493", -", c #808080", -"' c #878787", -") c #D6D6D6", -"! c #969696", -"~ c #030303", -"{ c #383838", -"] c #4C4C4C", -"^ c #1A1A1A", -"/ c #080808", -"( c #C2C2C2", -"_ c #EBEBEB", -": c #F0F0F0", -"< c #8C8C8C", -"[ c #7A7A7A", -"} c #A3A3A3", -"| c #999999", -"1 c #A1A1A1", -"2 c #FFE6E6", -"3 c #FFF0F0", -"4 c #828282", -"5 c #949494", -"6 c #F2F2F2", -"7 c #474747", -"8 c #545454", -"9 c #FF8080", -"0 c #FFB2B2", -"a c #0F0F0F", -"b c #B5B5B5", -"c c #CFCFCF", -"d c #262626", -"e c #333333", -"f c #DEDEDE", -"g c #FDFDFD", -"h c #D7D7D7", -"i c #B7B7B7", -"j c #C4C4C4", -"k c #F7F7F7", -"l c #CCCCCC", -"m c #2E2E2E", -"n c #B2B2B2", -"o c #DFDFDF", -"p c #ACACAC", -"q c #ADADAD", -"r c #D3D3D3", -"s c #CDCDCD", -"t c #AAAAAA", -"u c #D4D4D4", -"v c #A9A9A9", -"w c #DBDBDB", -"x c #E3E3E3", -"y c #E5E5E5", -"z c #B1B1B1", -"A c #D2D2D2", -"B c #EAEAEA", -"C c #E2E2E2", -"D c #C8C8C8", -"E c #AFAFAF", -"F c #F5F5F5", -"G c #E9E9E9", -"H c #B6B6B6", -"I c #B9B9B9", -"J c #F9F9F9", -"K c #B8B8B8", -"L c #C0C0C0", -"M c #B4B4B4", -"N c #EFD9D9", -"O c #AAA8A8", -"P c #F2DBDB", -"Q c #EED6D6", -"R c #ABA8A8", -"S c #EED8D8", -"T c #BCB1B1", -"U c #C4B6B6", -"V c #C5B7B7", -"W c #B6ADAD", -"X c #EEEEEE", -"Y c #DADADA", -"Z c #BEBEBE", -"` c #B0B0B0", -" . c #FBFBFB", -".. c #C6C6C6", -"+. c #C5C5C5", -"@. c #BABABA", -"#. c #AEAEAE", -"$. c #D0D0D0", -"%. c #FCFCFC", -"&. c #141414", -"*. c #D8D8D8", -"=. c #C7C7C7", -"-. c #575757", -";. c #3D3D3D", -">. c #C3C3C3", -",. c #5E5E5E", -"'. c #7D6E6E", -"). c #FF9999", -"!. c #B39D9D", -"~. c #E69292", -"{. c #F09393", -"]. c #ADA2A2", -"^. c #F49999", -"/. c #FFC2C2", -"(. c #757575", -"_. c #918787", -":. c #F7AEAE", -"<. c #ABA6A6", -"[. c #FCB2B2", -"}. c #C3A0A0", -"|. c #C7A4A4", -"1. c #FFD1D1", -"2. c #EDEDED", -"3. c #B3B3B3", -"4. c #666666", -"5. c #2B2B2B", -"6. c #BBBBBB", -"7. c #292929", -"8. c #E8E8E8", -"9. c #9C9C9C", -"0. c #E4E4E4", -"a. c #E7E7E7", -"b. c #CACACA", -"c. c #E4A7A7", -"d. c #B59F9F", -"e. c #E6A7A7", -"f. c #B0A3A3", -"g. c #C19E9E", -"h. c #F9B0B0", -"i. c #CBCBCB", -"j. c #F4F4F4", -"k. c #BCBCBC", -"l. c #707070", -"m. c #242424", -"n. c #0A0A0A", -"o. c #454545", -"p. c #7D7D7D", -"q. c #595959", -"r. c #525252", -"s. c #5C5C5C", -"t. c #D9D9D9", -"u. c #121212", -"v. c #919191", -"w. c #8A8A8A", -"x. c #171717", -"y. c #A8A8A8", -"z. c #696969", -"A. c #9E9E9E", -"B. c #404040", -"C. c #616161", -"D. c #8F8F8F", -"E. c #4F4F4F", -"F. c #050505", -"G. c #4A4A4A", -"H. c #212121", -"I. c #3B3B3B", -"J. c #636363", -"K. c #D1D1D1", -". . . . . . . . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . @ # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . $ % & . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . * % = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . ; > , ' ) . - % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . ! ~ { ] ^ / ; - % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . ( - . . _ % , - % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . : % < - % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . [ / + - % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . } ~ | @ < % 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 . . . ", -". . . . 4 ~ 5 . 6 7 % 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 0 . . . ", -". . 6 8 a b . . . - % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". c d e f . . . . - % . . . . . . . . . . . . . . . . . g h i i i j k . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -"l / m $ n n n c . - % . . . . . . . . . . . . . . . . o p q ; r s n t u . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -"} e e e e e e ! . - % . . . . . . . . . . . . . . . l v ) . . . . . h t w . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . . . . . . . x t y . . . . . . . 6 z ; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . . . . . . . q A . . . . . . . . . B t C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . . . . . . D E . . . . . . . . . . . ) $ k . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . . . . . F t G . . . . . . . . . . . . & H . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . . . . . c I . . . . . . . . . . . . . F $ ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . . . . : p B . . . . . . . . . . . . . . C t J . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . . . . K L . . . . . . . . . . . . . . . . M j . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % 2 2 2 2 2 2 2 2 2 2 N O P 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 Q R S 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 . . . ", -". . . . . . . . . - % 2 2 2 2 2 2 2 2 2 2 T U 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 V W 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 . . . ", -". . . . . . . . . - % . . . . . . . . . . t X . . . . . . . . . . . . . . . . . . J v k . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . . Y q . . . . . . . . . . . . . . . . . . . . Z ` .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . . M ... . . . . . . . . . . . . . . . . . . . . z ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . : v J . . . . . . . . . . . . . . . . . . . . . + p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . +.@.. . . . . . . . . . . . . . . . . . . . . . . #.r . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . q Y . . . . . . . . . . . . . . . . . . . . . . . ) p . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . j ( . - % . . . . . . . + p g . . . . . . . . . . . . . . . . . . . . . . . . p $.. . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . %.& &.< . - % . . . . . . . i +.. . . . . . . . . . . . . . . . . . . . . . . . . *.p . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . b % % % =.. - % . . . . . . . t B . . . . . . . . . . . . . . . . . . . . . . . . . . E ; . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . 5 / @ . - % . . . . . . o q . . . . . . . . . . . . . . . . . . . . . . . . . . . h q g . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . -.;.. . - % . . . . . . Z Z . . . . . . . . . . . . . . . . . . . . . . . . . . . . n >.. . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . ^ [ . F ,.% '.).).).).).!.~.).).).).).).).).).).).).).).).).).).).).).).).).).).).).{.].^.).).).).).).).).).).).).).).).).).).).)./.. . . ", -". . . . + % n . k (.% _.0 0 0 0 :.<.[.0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }.|.0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.. . . ", -". . . . } % 2.. . - % . . . . . $.3.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . k p y . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . 4.5.. . . - % . . . . . 6.... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ; z . . . . . . . . . . . . . . . . . . . . . . . ", -". . l l 7.] l + . - % . . . . . 3.u . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .p $.. . . . . . . . . . . . . . . . . . . . . . ", -". 8.e e e e e 9.. - % . . . . . t X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x t 0.. . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . $.q . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . a.p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ` 6.. . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . >.I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . J q b.. . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . i A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X $ l . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . p x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X t ) . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . v J . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + t ) . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . F t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C t A . . . . . . . . . . . . . . . ", -". . . . . . . . . - % 0 0 0 c.d.0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e.f.g.h.0 0 0 0 0 0 0 0 0 1.. . . ", -". . . . . . . . . - % . . . Y z . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . J 3.#.x . . . . . . . . . . . . ", -". . . . . . . . . - % . . . D 6.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i.p D F . . . . . . . . . . ", -". . . . . . . . . - % . . . Y $.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . j.L t K 6 . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . a.k.t ` =.y . . . . . ", -". . . . . . . . . - % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F i.i k.. . . . . ", -". . . . . . . . . - % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". . . . . . . . . - % . . . . . . . . . . . . . . . . . . . . . . . . ; l.. . . . . . . . . . . . . . . . . . . . . . . . 1 < . . . . . . . ( x . . ", -". . . . . . . . . - % e e e e e e e e e e e e e e e e e e e e e e e e m.n.e e e e e e e e e e e e e e e e e e e e e e e e ^ &.e e e e e e e &.~ o.=.", -". . . . . . . . . . K n n n n n n n n n n n n n n n n n n n n n n n n p.m.n n n n n n n n n n n n n n n n n n n n n n n n q.7 n n n n n n n r.s.( . ", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . : ; . . . . . . . . . . . . . . . . . . . . . . . . + t.. . . . . . . . . . . ", -". . . . %.= &.% u.v.. . . . . . . . . . . . . . . . . . . . . . . . . . w.| . . . . . . . . . . . . . . . . . . . . . =.4.{ e 7 ( . . . . . . . . . ", -". . . . 4.x.y.l z.~ f . . . . . . . . . . . . . . . . . . . . . . 6 ` l.~ A.. . . . . . . . . . . . . . . . . . . . . B.r.v.5 5./ 8.. . . . . . . . ", -". . . l % ` . . + % n . . . . . . . . . . . . . . . . . . . . . . ( ] e % t.. . . . . . . . . . . . . . . . . . . . . _ . . . ` % l . . . . . . . . ", -". . . C.d . . . - % n . . . . . . . . . . . . . . . . . . . . . . . . , &.. . . . . . . . . . . . . . . . . . . . . . . . . . D.~ 8.. . . . . . . . ", -". . . ^ * . . . =.% =.. . . . . . . . . . . . . . . . . . . . . . . . 7 E.. . . . . . . . . . . . . . . . . . . . . . . . . + &.C.. . . . . . . . . ", -". . f % ` . . . 5 F.F . . . . . . . . . . . . . . . . . . . . . . . %.n.w.. . . . . . . . . . . . . . . . . . . . . . . . f d # F . . . . . . . . . ", -". . K % w . . . E.B.. . . . . . . . . . . . . . . . . . . . . . . . l % =.. . . . . . . . . . . . . . . . . . . . . . . j x.G.: . . . . . . . . . . ", -". . n % - . . 8./ | . . . . . . . . . . . . . . . . . . . . . . . . 5 / k . . . . . . . . . . . . . . . . . . . . . . v.F.(.%.. . . . . . . . . . . ", -". . & % ( . %.q.H.F . . . . . . . . . . . . . . . . . . . . . . . . 8 I.. . . . . . . . . . . . . . . . . . . . . 2.r.u.n . . . . . . . . . . . . . ", -". . @ 7.&.] d x.l . . . . . . . . . . . . . . . . . . . . . . @ , , &.# , K . . . . . . . . . . . . . . . . . . . J.% G.4.4.4.4.K.. . . . . . . . . ", -". . . _ D., 5 : . . . . . . . . . . . . . . . . . . . . . . . 2., , , , , j . . . . . . . . . . . . . . . . . . . 9., , , , , , 8.. . . . . . . . . "}; - -/* XPM */ -static const char * probability_scale_xpm[] = { -"27 16 3 1", -" c None", -". c #000000", -"+ c #C0C0C0", -" ........................", -"....++++++++++++++++++++++.", -" .+++++++++++++++++.++++.", -" ...+++++++++++++++..+++++.", -" .++++++++++++++.+++++++.", -" ...++++++++++++..++++++++.", -" .+++++++++++.++++++++++.", -"....++++++++++.+++++++++++.", -" .++++++++..++++++++++++.", -" ...++++++..++++++++++++++.", -" .+++...++++++++++++++++.", -"....++++++++++++++++++++++.", -" ........................", -" . . . . . . . . ", -" . . . . . . . . ", -" . "}; - -/* XPM */ -static const char * logit_scale_xpm[] = { -"27 16 3 1", -" c None", -". c #000000", -"+ c #C0C0C0", -" ........................", -"....++++++++++++++++++++++.", -" .+...+++++++++++++++..+.", -" ...++.++++++++++++++..+++.", -" .++.++++++++++++..+++++.", -" ...++.++++++++++..+++++++.", -" .++.++.+++++..+++++++++.", -"....+.....+++..+++++++++++.", -" .+++++++..+++++++++++++.", -" ...+++++..+++++++++++++++.", -" .+++..+++++++++++++++++.", -"....++++++++++++++++++++++.", -" ........................", -" . . . . . ", -" . . . . . ", -" . . . "}; === removed file 'qtiplot/icons/pixmaps.h' --- qtiplot/icons/pixmaps.h 2009-12-08 18:06:27 +0000 +++ qtiplot/icons/pixmaps.h 1970-01-01 00:00:00 +0000 @@ -1,12630 +0,0 @@ -/*************************************************************************** - File : pixmaps.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006-2009 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Various pixmaps - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#ifndef PIXMAPS_H -#define PIXMAPS_H - -/* XPM */ -static char * preview_xpm[] = { -"16 15 111 2", -" c None", -". c #BCBEBD", -"+ c #898C8D", -"@ c #787B7D", -"# c #A7AAA9", -"$ c #929EA7", -"% c #B7CEDF", -"& c #C3DBEF", -"* c #9CA8B4", -"= c #858D97", -"- c #87949F", -"; c #BCD7ED", -"> c #D4E7F6", -", c #E7F2FA", -"' c #E5EFF8", -") c #D2E3EF", -"! c #909AA4", -"~ c #B8BAB8", -"{ c #9AA7B3", -"] c #F2F5F7", -"^ c #7C7E80", -"/ c #A7C0D6", -"( c #C8DFF0", -"_ c #E0ECF6", -": c #E1EDF6", -"< c #D9E7F3", -"[ c #BBCBD9", -"} c #757778", -"| c #97A4B0", -"1 c #E8EEF3", -"2 c #E2E9EF", -"3 c #5E6163", -"4 c #A7C6E1", -"5 c #CEE1EF", -"6 c #D4E4F1", -"7 c #D2E3F0", -"8 c #BED4E5", -"9 c #5D6060", -"0 c #96A1AD", -"a c #E9EFF3", -"b c #E3EAEF", -"c c #65676B", -"d c #90B0CB", -"e c #BCD5E9", -"f c #C4DBEC", -"g c #BDD6E9", -"h c #A3BACE", -"i c #616364", -"j c #929EA9", -"k c #EAEFF3", -"l c #E4EBF0", -"m c #919599", -"n c #6F7E8C", -"o c #B7D2E7", -"p c #C8DFEF", -"q c #CEE3F2", -"r c #BBD4E7", -"s c #79858D", -"t c #8C8E8D", -"u c #8F9BA7", -"v c #ECF0F4", -"w c #E7ECF1", -"x c #D3D9DD", -"y c #7A7D7F", -"z c #74818C", -"A c #B5C9D8", -"B c #C6DCEC", -"C c #B4C9D7", -"D c #79858C", -"E c #5C4619", -"F c #976A00", -"G c #8C97A2", -"H c #EEF3F6", -"I c #CFD4D7", -"J c #8A8C8F", -"K c #545558", -"L c #404143", -"M c #3A3E40", -"N c #7F807E", -"O c #8B6100", -"P c #F3DD9E", -"Q c #9C6D00", -"R c #88949F", -"S c #EFF3F6", -"T c #EBF0F4", -"U c #D8DCDF", -"V c #C4C9CC", -"W c #BEC2C4", -"X c #727C84", -"Y c #8F6200", -"Z c #E8C039", -"` c #EFD47E", -" . c #848F9A", -".. c #F3F6F8", -"+. c #815500", -"@. c #E6BA21", -"#. c #EED072", -"$. c #818C97", -"%. c #F6F8FA", -"&. c #F3F6F9", -"*. c #734900", -"=. c #D1A61B", -"-. c #7E8993", -";. c #F9FAFB", -">. c #F7F9FA", -",. c #876D45", -"'. c #A69A84", -"). c #7C8691", -"!. c #FBFBFD", -"~. c #FAFAFC", -"{. c #79838D", -" . + @ + . ", -" # $ % & % $ # ", -"* * * * = - ; > , ' ) ! ~ ", -"{ ] ] ] ^ / ( _ : : < [ } ", -"| 1 2 2 3 4 5 6 6 6 7 8 9 ", -"0 a b b c d e f f f g h i ", -"j k l l m n o p q p r s t ", -"u v w w x y z A B C D E F ", -"G H a a a I J K L M N O P Q ", -"R S T T T T U V W X Y Z ` Y ", -" ...S S S S S S S . +.@.#.+.", -"$.%.&.&.&.&.&.&.&.$. *.=.*.", -"-.;.>.>.>.>.>.>.>.-. ,.'.", -").!.~.~.~.~.~.~.~.). ", -"{.{.{.{.{.{.{.{.{.{. "}; - -/* XPM */ -static char * decrease_decimals_xpm[] = { -"16 16 102 2", -" c None", -". c #D7958F", -"+ c #B40000", -"@ c #D6958F", -"# c #AE0000", -"$ c #FFCACA", -"% c #AD0000", -"& c #D5958F", -"* c #6D838F", -"= c #4E6A7B", -"- c #D7DAD1", -"; c #A70000", -"> c #FF7575", -", c #FFB0B0", -"' c #A60000", -") c #D1958D", -"! c #BBC3BE", -"~ c #345366", -"{ c #4D6776", -"] c #7E9096", -"^ c #BCBBB1", -"/ c #9F0000", -"( c #FF3D3D", -"_ c #FF9494", -": c #BCBCB1", -"< c #94A1A3", -"[ c #2F4D5E", -"} c #617780", -"| c #960000", -"1 c #FF0C0C", -"2 c #FF8080", -"3 c #9EA9A8", -"4 c #2A4557", -"5 c #506772", -"6 c #6B7D84", -"7 c #8C0000", -"8 c #FF0000", -"9 c #233C4E", -"0 c #4B5F6B", -"a c #B6BDB8", -"b c #820000", -"c c #FF7E7E", -"d c #8D9697", -"e c #D0D2C9", -"f c #780000", -"g c #FF8484", -"h c #FF1616", -"i c #A67771", -"j c #6F0000", -"k c #FF2F2F", -"l c #A27771", -"m c #DAD9CD", -"n c #9F7771", -"o c #670000", -"p c #DAD8CD", -"q c #738187", -"r c #496373", -"s c #ADB7B7", -"t c #669CDF", -"u c #4180D2", -"v c #3972BB", -"w c #C6CED1", -"x c #7D8F94", -"y c #4D6775", -"z c #345365", -"A c #BAC1BC", -"B c #B7CADC", -"C c #2973DE", -"D c #4483DE", -"E c #77A2DD", -"F c #61767F", -"G c #2F4C5E", -"H c #93A0A1", -"I c #8EAFD9", -"J c #236DD7", -"K c #588ED8", -"L c #6A7C83", -"M c #506671", -"N c #294557", -"O c #9DA7A6", -"P c #D1D3C9", -"Q c #839194", -"R c #36505F", -"S c #9AB3D2", -"T c #2161C4", -"U c #4A7CC9", -"V c #658FCC", -"W c #738186", -"X c #D0D2C8", -"Y c #4B5F6A", -"Z c #586A73", -"` c #304857", -" . c #808D8F", -".. c #1E53AB", -"+. c #4771B4", -"@. c #B4C1CE", -"#. c #B5B9B3", -"$. c #CFD0C7", -"%. c #8C9595", -"&. c #99A09F", -"*. c #8A9DBA", -"=. c #CFD3D2", -" . + . @ + . ", -" # $ % & & # $ # ", -" * = = - ; > , ' ) ) ; , > ; ", -"! ~ { ] ^ / ( _ / / _ ( / : ", -"< [ } } ^ | 1 2 2 1 | : ", -"3 4 5 6 7 8 8 8 8 7 ", -" 9 0 9 a b c 8 b b 8 c b ", -" d e f g h f i i f h g f ", -" j k j l m m l j k j ", -" n o n m m n o n ", -" - = = * p q r = s t u v w ", -" x y z A z A x y B C D E ", -" F F G H G H G I J K K ", -" L M N O N P Q R S T U V ", -"W W X 9 Y 9 Z ` 9 . ..+...@.", -"#.#. $.%. &.#. *.=. "}; - -/* XPM */ -static char * increase_decimals_xpm[] = { -"16 16 60 1", -" c None", -". c #39AA00", -"+ c #37A700", -"@ c #DFF290", -"# c #33A000", -"$ c #C8DF79", -"% c #2E9900", -"& c #DCF088", -"* c #C4DD6E", -"= c #669CDF", -"- c #4588DF", -"; c #289200", -"> c #C1DB65", -", c #B8CBDF", -"' c #2A73DF", -") c #4483DF", -"! c #77A3DF", -"~ c #BCBCB2", -"{ c #228B00", -"] c #BFDA5E", -"^ c #8EB0DC", -"/ c #236DD7", -"( c #588ED9", -"_ c #1E8500", -": c #9BB4D5", -"< c #2161C4", -"[ c #4A7DCA", -"} c #658FCD", -"| c #1E53AB", -"1 c #4771B6", -"2 c #B5C2D1", -"3 c #8B9EBC", -"4 c #ADB7B7", -"5 c #4E6A7B", -"6 c #8D9DA3", -"7 c #6D838F", -"8 c #4E697B", -"9 c #4D6775", -"0 c #7D8F95", -"a c #BAC1BD", -"b c #345365", -"c c #7D8F94", -"d c #2F4C5E", -"e c #93A0A1", -"f c #61767F", -"g c #365060", -"h c #839195", -"i c #294557", -"j c #9DA7A7", -"k c #506671", -"l c #6A7C83", -"m c #4B5F6A", -"n c #9BA4A3", -"o c #8E999A", -"p c #233C4E", -"q c #304857", -"r c #B6BBB5", -"s c #99A0A0", -"t c #B5B9B4", -"u c #8C9595", -" ... ", -" +@+ ", -"###$### ", -"%&&*&&% =-- ", -";;;>;;; ,' )! ", -"~~{]{~~ ^/ (( ", -" ___ :< [} ", -" ~~~ |1|2 ", -" 3 ", -" ", -" 4556 755 4886", -" 90abab 9c90ab", -" de ded ffde d", -" gh iji klgh i", -" mnopqm pmpropqm", -" s ts u ts "}; - -/* XPM */ -static char * configure_xpm[] = { -"15 15 66 1", -" c None", -". c #848681", -"+ c #82847F", -"@ c #81837E", -"# c #B3B3B3", -"$ c #888A85", -"% c #DCDCDB", -"& c #80827E", -"* c #CFCFCF", -"= c #7E807C", -"- c #B1B1B1", -"; c #D1D1D1", -"> c #7C7E79", -", c #A2A2A2", -"' c #D6D6D6", -") c #7D7F7A", -"! c #BFBFBF", -"~ c #7A7B77", -"{ c #8A8C87", -"] c #707070", -"^ c #989898", -"/ c #E2E2E2", -"( c #DEDEDE", -"_ c #ABABAB", -": c #E1E1E1", -"< c #AEAEAE", -"[ c #C3C3C3", -"} c #BCBCBC", -"| c #B2B2B2", -"1 c #B0B0B0", -"2 c #DFDFDF", -"3 c #DBDBDB", -"4 c #777874", -"5 c #C9C9C9", -"6 c #E0E0E0", -"7 c #DCDCDC", -"8 c #C3C4C2", -"9 c #797B77", -"0 c #ACACAC", -"a c #AAAAAA", -"b c #9F9F9F", -"c c #757575", -"d c #2B4F82", -"e c #868686", -"f c #A7CBEB", -"g c #77A3CA", -"h c #A8A8A8", -"i c #B4B4B4", -"j c #C5C5C5", -"k c #A9A9A9", -"l c #7AA5CC", -"m c #598EBD", -"n c #9A9A9A", -"o c #A5A5A5", -"p c #969696", -"q c #6B6B6B", -"r c #7CA8CE", -"s c #C1C1C1", -"t c #A1A1A1", -"u c #BEBEBE", -"v c #A3A3A3", -"w c #686868", -"x c #7FAAD0", -"y c #676767", -"z c #81ACD1", -"A c #999999", -" .+@ #$%", -" &*= #$ $", -" -;> $ $#", -",' )!~ %${# ", -"]^/ (_:< %$% ", -"[}|}1234%$% ", -" >5}673%$8 ", -" 90ab%$%c ", -" dd$%*1e ", -" fdfgdhijbk ", -" fdflmd no[pq ", -"fdfrmdf stuvw ", -"dfxmdf ooyn ", -"dzmdf yA ", -"zddf "}; - -/* XPM */ -static char * replace_xpm[] = { -"16 16 143 2", -" c None", -". c #FFFFFF", -"+ c #FBF7F9", -"@ c #D8DFED", -"# c #ACC8E8", -"$ c #9FC4EB", -"% c #BACCE2", -"& c #DBE0EA", -"* c #FAF7F8", -"= c #FFFFFD", -"- c #E7E7ED", -"; c #A7C2E4", -"> c #A2CBEF", -", c #B7DCF6", -"' c #BDDFF4", -") c #B6DCF4", -"! c #A5CDE9", -"~ c #BDCCDD", -"{ c #F0F0F2", -"] c #F2F0F3", -"^ c #AEC6E3", -"/ c #B3DEFF", -"( c #000000", -"_ c #ACDAF0", -": c #B8C6D6", -"< c #F9F7F8", -"[ c #C5CDDE", -"} c #A7CFF4", -"| c #E0FFFF", -"1 c #E3FFFF", -"2 c #D1F7FE", -"3 c #C9F4FE", -"4 c #A9C8D8", -"5 c #DFE1E7", -"6 c #96ADCF", -"7 c #B4D9F7", -"8 c #E2FFFF", -"9 c #E4FFFF", -"0 c #DDFDFD", -"a c #DFFFFF", -"b c #D9FFFF", -"c c #A3A9BC", -"d c #82A6D3", -"e c #BBDFF8", -"f c #D9FEFF", -"g c #CDE6EC", -"h c #CCEDF1", -"i c #8F94A9", -"j c #CFD1DA", -"k c #869EC3", -"l c #BAE2FB", -"m c #D5FBFF", -"n c #E9FFFF", -"o c #FBFFFF", -"p c #F3FFFF", -"q c #E4FAFF", -"r c #8E93A8", -"s c #B5B7C3", -"t c #A8B0C3", -"u c #AED4F1", -"v c #D7FFFF", -"w c #F2FFFF", -"x c #C2CCDC", -"y c #A3A6B9", -"z c #BBBEC9", -"A c #E4E2E7", -"B c #8EA4C1", -"C c #CFFFFF", -"D c #EBFFFF", -"E c #F1FFFF", -"F c #7F8198", -"G c #A7ACC2", -"H c #BAC6DD", -"I c #FDFCFC", -"J c #BBBECD", -"K c #8FA4BE", -"L c #DDFFFF", -"M c #E1FFFF", -"N c #EFFFFF", -"O c #CCE1EC", -"P c #8487A3", -"Q c #ACA1A0", -"R c #C89A65", -"S c #FDFBF8", -"T c #F3F4F7", -"U c #F6F1F5", -"V c #F7EEF0", -"W c #9FA6B9", -"X c #8896AC", -"Y c #8796AB", -"Z c #8892A6", -"` c #A6A9BA", -" . c #C1C5DD", -".. c #B9AEAB", -"+. c #CD9446", -"@. c #FA941E", -"#. c #E0A056", -"$. c #F2F3F6", -"%. c #EEEBF1", -"&. c #D9B18F", -"*. c #F2B051", -"=. c #FFF48D", -"-. c #F19222", -";. c #D2944D", -">. c #FAF9F8", -",. c #EDECF2", -"'. c #FDFFFF", -"). c #FAFFFF", -"!. c #F5FDFF", -"~. c #D1A77B", -"{. c #F5C16A", -"]. c #FFF98D", -"^. c #F19122", -"/. c #CC9558", -"(. c #F9F7F7", -"_. c #ECECF2", -":. c #F8FEFF", -"<. c #DBE7FF", -"[. c #97714C", -"}. c #F9CD6C", -"|. c #FFFD8B", -"1. c #F29124", -"2. c #B77936", -"3. c #FEFFFF", -"4. c #DBE9FF", -"5. c #B6BBCD", -"6. c #D8B79A", -"7. c #F1CB75", -"8. c #ECB661", -"9. c #936B4A", -"0. c #C2C6D2", -"a. c #A4A8B7", -"b. c #A7ACBB", -"c. c #A7ABBA", -"d. c #A6ABBA", -"e. c #A6AABA", -"f. c #A4A8B8", -"g. c #A4A8BB", -"h. c #9EA3B9", -"i. c #C1C5D6", -"j. c #AB7B4C", -"k. c #896955", -"l. c #8085AF", -". . + @ # $ % & * . . . . . . . ", -"= - ; > , ' ) ! ~ { . . . . . . ", -"] ^ / ( ( ( ( ( _ : < . . . . . ", -"[ } | ( . 1 2 3 ( 4 5 . . . . . ", -"6 7 8 ( . 9 0 a ( b c . . . . . ", -"d e f ( ( ( ( ( g h i j . . . . ", -"k l m ( n ( ( o p q r s . . . . ", -"t u v ( n w ( ( . x y z . . . . ", -"A B C ( 8 D E ( ( F G H . . . . ", -"I J K ( L M N O ( P Q R S . . . ", -"T U V W X Y Z ` ...+.@.#.I . . ", -"$.%.. . . . . . . &.*.=.-.;.>.. ", -"$.,.. . . . . '.).!.~.{.].^./.(.", -"$._.. . . . . o :.o <.[.}.|.1.2.", -"$._.. . . . . . '.3.4.5.6.7.8.9.", -"3.0.a.b.b.c.d.e.f.g.h.i.. j.k.l."}; - -/* XPM */ -static char * find_previous_xpm[] = { -"16 16 149 2", -" c None", -". c #FFFFFF", -"+ c #FBF7F9", -"@ c #D8DFED", -"# c #ACC8E8", -"$ c #9FC4EB", -"% c #BACCE2", -"& c #DBE0EA", -"* c #FAF7F8", -"= c #FFFFFD", -"- c #E7E7ED", -"; c #A7C2E4", -"> c #A2CBEF", -", c #B7DCF6", -"' c #BDDFF4", -") c #B6DCF4", -"! c #A5CDE9", -"~ c #BDCCDD", -"{ c #F0F0F2", -"] c #F2F0F3", -"^ c #AEC6E3", -"/ c #B3DEFF", -"( c #D2F7FF", -"_ c #D4F9FF", -": c #000000", -"< c #B8DBF2", -"[ c #B6DCF0", -"} c #ACDAF0", -"| c #B8C6D6", -"1 c #F9F7F8", -"2 c #C5CDDE", -"3 c #A7CFF4", -"4 c #E0FFFF", -"5 c #F3FFFF", -"6 c #D1F7FE", -"7 c #C9F4FE", -"8 c #D3FEFF", -"9 c #A9C8D8", -"0 c #DFE1E7", -"a c #96ADCF", -"b c #B4D9F7", -"c c #E2FFFF", -"d c #DDFDFD", -"e c #DFFFFF", -"f c #F8FFFF", -"g c #D9FFFF", -"h c #A3A9BC", -"i c #82A6D3", -"j c #BBDFF8", -"k c #CCEDF1", -"l c #8F94A9", -"m c #CFD1DA", -"n c #869EC3", -"o c #BAE2FB", -"p c #D5FBFF", -"q c #F4FFFF", -"r c #FBFFFF", -"s c #E4FAFF", -"t c #8E93A8", -"u c #B5B7C3", -"v c #A8B0C3", -"w c #AED4F1", -"x c #D7FFFF", -"y c #D4FDFF", -"z c #F7FFFF", -"A c #F9FFFF", -"B c #C2CCDC", -"C c #A3A6B9", -"D c #BBBEC9", -"E c #E4E2E7", -"F c #8EA4C1", -"G c #CFFFFF", -"H c #E4FFFF", -"I c #F1FFFF", -"J c #7F8198", -"K c #A7ACC2", -"L c #BAC6DD", -"M c #FDFCFC", -"N c #BBBECD", -"O c #8FA4BE", -"P c #BFEAF4", -"Q c #DDFFFF", -"R c #E1FFFF", -"S c #EFFFFF", -"T c #CCE1EC", -"U c #7C8098", -"V c #8487A3", -"W c #ACA1A0", -"X c #C89A65", -"Y c #FDFBF8", -"Z c #F3F4F7", -"` c #F6F1F5", -" . c #F7EEF0", -".. c #9FA6B9", -"+. c #8896AC", -"@. c #8796AB", -"#. c #8892A6", -"$. c #A6A9BA", -"%. c #C1C5DD", -"&. c #B9AEAB", -"*. c #CD9446", -"=. c #FA941E", -"-. c #E0A056", -";. c #F2F3F6", -">. c #EEEBF1", -",. c #D9B18F", -"'. c #F2B051", -"). c #FFF48D", -"!. c #F19222", -"~. c #D2944D", -"{. c #FAF9F8", -"]. c #EDECF2", -"^. c #FDFFFF", -"/. c #FAFFFF", -"(. c #F5FDFF", -"_. c #D1A77B", -":. c #F5C16A", -"<. c #FFF98D", -"[. c #F19122", -"}. c #CC9558", -"|. c #F9F7F7", -"1. c #ECECF2", -"2. c #F8FEFF", -"3. c #DBE7FF", -"4. c #97714C", -"5. c #F9CD6C", -"6. c #FFFD8B", -"7. c #F29124", -"8. c #B77936", -"9. c #FEFFFF", -"0. c #DBE9FF", -"a. c #B6BBCD", -"b. c #D8B79A", -"c. c #F1CB75", -"d. c #ECB661", -"e. c #936B4A", -"f. c #C2C6D2", -"g. c #A4A8B7", -"h. c #A7ACBB", -"i. c #A7ABBA", -"j. c #A6ABBA", -"k. c #A6AABA", -"l. c #A4A8B8", -"m. c #A4A8BB", -"n. c #9EA3B9", -"o. c #C1C5D6", -"p. c #AB7B4C", -"q. c #896955", -"r. c #8085AF", -". . + @ # $ % & * . . . . . . . ", -"= - ; > , ' ) ! ~ { . . . . . . ", -"] ^ / ( _ : < [ } | 1 . . . . . ", -"2 3 4 5 : : 6 7 8 9 0 . . . . . ", -"a b c : : : d e f g h . . . . . ", -"i j : : : : : : : k l m . . . . ", -"n o p : : : q r 5 s t u . . . . ", -"v w x y : : z A . B C D . . . . ", -"E F G H c : I . . J K L . . . . ", -"M N O P Q R S T U V W X Y . . . ", -"Z ` ...+.@.#.$.%.&.*.=.-.M . . ", -";.>.. . . . . . . ,.'.).!.~.{.. ", -";.].. . . . . ^./.(._.:.<.[.}.|.", -";.1.. . . . . r 2.r 3.4.5.6.7.8.", -";.1.. . . . . . ^.9.0.a.b.c.d.e.", -"9.f.g.h.h.i.j.k.l.m.n.o.. p.q.r."}; - -/* XPM */ -static char * find_next_xpm[] = { -"16 16 146 2", -" c None", -". c #FFFFFF", -"+ c #FBF7F9", -"@ c #D8DFED", -"# c #ACC8E8", -"$ c #9FC4EB", -"% c #BACCE2", -"& c #DBE0EA", -"* c #FAF7F8", -"= c #FFFFFD", -"- c #E7E7ED", -"; c #A7C2E4", -"> c #A2CBEF", -", c #B7DCF6", -"' c #BDDFF4", -") c #B6DCF4", -"! c #A5CDE9", -"~ c #BDCCDD", -"{ c #F0F0F2", -"] c #F2F0F3", -"^ c #AEC6E3", -"/ c #B3DEFF", -"( c #D2F7FF", -"_ c #D4F9FF", -": c #000000", -"< c #B8DBF2", -"[ c #B6DCF0", -"} c #ACDAF0", -"| c #B8C6D6", -"1 c #F9F7F8", -"2 c #C5CDDE", -"3 c #A7CFF4", -"4 c #E0FFFF", -"5 c #F3FFFF", -"6 c #C9F4FE", -"7 c #D3FEFF", -"8 c #A9C8D8", -"9 c #DFE1E7", -"0 c #96ADCF", -"a c #B4D9F7", -"b c #E2FFFF", -"c c #F8FFFF", -"d c #D9FFFF", -"e c #A3A9BC", -"f c #82A6D3", -"g c #BBDFF8", -"h c #CCEDF1", -"i c #8F94A9", -"j c #CFD1DA", -"k c #869EC3", -"l c #BAE2FB", -"m c #D5FBFF", -"n c #DCFFFF", -"o c #E9FFFF", -"p c #E4FAFF", -"q c #8E93A8", -"r c #B5B7C3", -"s c #A8B0C3", -"t c #AED4F1", -"u c #D7FFFF", -"v c #D4FDFF", -"w c #F9FFFF", -"x c #C2CCDC", -"y c #A3A6B9", -"z c #BBBEC9", -"A c #E4E2E7", -"B c #8EA4C1", -"C c #CFFFFF", -"D c #E4FFFF", -"E c #F1FFFF", -"F c #7F8198", -"G c #A7ACC2", -"H c #BAC6DD", -"I c #FDFCFC", -"J c #BBBECD", -"K c #8FA4BE", -"L c #BFEAF4", -"M c #DDFFFF", -"N c #E1FFFF", -"O c #EFFFFF", -"P c #CCE1EC", -"Q c #7C8098", -"R c #8487A3", -"S c #ACA1A0", -"T c #C89A65", -"U c #FDFBF8", -"V c #F3F4F7", -"W c #F6F1F5", -"X c #F7EEF0", -"Y c #9FA6B9", -"Z c #8896AC", -"` c #8796AB", -" . c #8892A6", -".. c #A6A9BA", -"+. c #C1C5DD", -"@. c #B9AEAB", -"#. c #CD9446", -"$. c #FA941E", -"%. c #E0A056", -"&. c #F2F3F6", -"*. c #EEEBF1", -"=. c #D9B18F", -"-. c #F2B051", -";. c #FFF48D", -">. c #F19222", -",. c #D2944D", -"'. c #FAF9F8", -"). c #EDECF2", -"!. c #FDFFFF", -"~. c #FAFFFF", -"{. c #F5FDFF", -"]. c #D1A77B", -"^. c #F5C16A", -"/. c #FFF98D", -"(. c #F19122", -"_. c #CC9558", -":. c #F9F7F7", -"<. c #ECECF2", -"[. c #FBFFFF", -"}. c #F8FEFF", -"|. c #DBE7FF", -"1. c #97714C", -"2. c #F9CD6C", -"3. c #FFFD8B", -"4. c #F29124", -"5. c #B77936", -"6. c #FEFFFF", -"7. c #DBE9FF", -"8. c #B6BBCD", -"9. c #D8B79A", -"0. c #F1CB75", -"a. c #ECB661", -"b. c #936B4A", -"c. c #C2C6D2", -"d. c #A4A8B7", -"e. c #A7ACBB", -"f. c #A7ABBA", -"g. c #A6ABBA", -"h. c #A6AABA", -"i. c #A4A8B8", -"j. c #A4A8BB", -"k. c #9EA3B9", -"l. c #C1C5D6", -"m. c #AB7B4C", -"n. c #896955", -"o. c #8085AF", -". . + @ # $ % & * . . . . . . . ", -"= - ; > , ' ) ! ~ { . . . . . . ", -"] ^ / ( _ : < [ } | 1 . . . . . ", -"2 3 4 5 . : : 6 7 8 9 . . . . . ", -"0 a b . . : : : c d e . . . . . ", -"f g : : : : : : : h i j . . . . ", -"k l m n o : : : 5 p q r . . . . ", -"s t u v o : : w . x y z . . . . ", -"A B C D b : E . . F G H . . . . ", -"I J K L M N O P Q R S T U . . . ", -"V W X Y Z ` ...+.@.#.$.%.I . . ", -"&.*.. . . . . . . =.-.;.>.,.'.. ", -"&.).. . . . . !.~.{.].^./.(._.:.", -"&.<.. . . . . [.}.[.|.1.2.3.4.5.", -"&.<.. . . . . . !.6.7.8.9.0.a.b.", -"6.c.d.e.e.f.g.h.i.j.k.l.. m.n.o."}; - -/* XPM */ -static char * increase_indent_xpm[] = { -"16 15 34 1", -" c None", -". c #616B74", -"+ c #56616A", -"@ c #4B555F", -"# c #CC8E65", -"$ c #B43800", -"% c #AD2900", -"& c #FCE1CA", -"* c #C98B65", -"= c #128DC9", -"- c #C28765", -"; c #A32200", -"> c #A12C00", -", c #C75D29", -"' c #FAC89E", -") c #942800", -"! c #F9B77E", -"~ c #F7A254", -"{ c #F58204", -"] c #F6B77F", -"^ c #971900", -"/ c #A26851", -"( c #8A0E00", -"_ c #B84500", -": c #F58100", -"< c #7C0000", -"[ c #FFAD61", -"} c #9A6251", -"| c #935C50", -"1 c #700000", -"2 c #945C50", -"3 c #2C3844", -"4 c #283441", -"5 c #24313E", -" . ", -" + ", -" @@@ @@@@@@@", -" ", -" #$# ", -" %&%* =======", -"-;;>,';- =======", -")!!!~{]^ ", -"/(((_:(/ ===== ", -" <[<} ===== ", -" |12 ", -" ", -" 333 3333333", -" 4 ", -" 5 "}; - -/* XPM */ -static char * decrease_indent_xpm[] = { -"16 15 34 1", -" c None", -". c #616B74", -"+ c #56616A", -"@ c #4B555F", -"# c #CC8E65", -"$ c #B43800", -"% c #C98B65", -"& c #AD2900", -"* c #FCE1CA", -"= c #128DC9", -"- c #C28765", -"; c #A32200", -"> c #FAC89E", -", c #C75D29", -"' c #A12C00", -") c #C28865", -"! c #971900", -"~ c #F6B77F", -"{ c #F58204", -"] c #F7A254", -"^ c #F9B77E", -"/ c #942800", -"( c #A26851", -"_ c #8A0E00", -": c #F58100", -"< c #B84500", -"[ c #9A6251", -"} c #7C0000", -"| c #FFAD61", -"1 c #945C50", -"2 c #700000", -"3 c #2C3844", -"4 c #283441", -"5 c #24313E", -" . ", -" + ", -" @@@ @@@@@@@", -" ", -" #$# ", -" %&*& =======", -"-;>,';;) =======", -"!~{]^^^/ ", -"(_:<___( ===== ", -" [}|} ===== ", -" 121 ", -" ", -" 333 3333333", -" 4 ", -" 5 "}; - -/* XPM */ -static char * play_xpm[] = { -"16 16 25 1", -" c None", -". c #62B548", -"+ c #CEEFA6", -"@ c #CFEFA8", -"# c #98DC45", -"$ c #A1DF54", -"% c #86D624", -"& c #83D31D", -"* c #FFFFFF", -"= c #80D116", -"- c #FDFFFA", -"; c #7DCE10", -"> c #F9FFF2", -", c #7ACC0B", -"' c #F5FFE9", -") c #78CA07", -"! c #F0FFDF", -"~ c #77C903", -"{ c #ECFFD5", -"] c #76C801", -"^ c #E8FFCC", -"/ c #76C800", -"( c #E4FFC4", -"_ c #81CE11", -": c #95DB30", -" ", -" .......... ", -" .+@@@@@@@@+. ", -" .#$%%%%%%%%$#. ", -" .&&&&*&&&&&&&. ", -" .====--======. ", -" .;;;;>>>;;;;;. ", -" .,,,,'''',,,,. ", -" .))))!!!!)))). ", -" .~~~~{{{~~~~~. ", -" .]]]]^^]]]]]]. ", -" .////(///////. ", -" .____________. ", -" .::::::::::. ", -" .......... ", -" "}; - -/* XPM */ -static char * arrow_down_xpm[] = { -"11 12 2 1", -" c None", -". c #000000", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -"...........", -" ......... ", -" ....... ", -" ..... ", -" ... "}; - -/* XPM */ -static char * arrow_up_xpm[] = { -"11 12 2 1", -" c None", -". c #000000", -" ... ", -" ..... ", -" ....... ", -" ......... ", -"...........", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... "}; - -/* XPM */ -static char * drag_curves_xpm[] = { -"15 13 4 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #D2211C", -" ..........", -" .++++++++.", -" ..........+.", -" .++++++++.+.", -"..........++.@.", -".++++++++.++.+.", -".++++++++.+@.+.", -".++++@+++.@+.+.", -".+++@+@+@.++...", -".++@+++@+.++. ", -".+@++++++.... ", -".++++++++. ", -".......... "}; - -/* XPM */ -static char * append_drag_curves_xpm[] = { -"16 16 70 1", -" c None", -". c #239500", -"+ c #229203", -"@ c #228E05", -"# c #208707", -"$ c #208209", -"% c #229201", -"& c #74E55E", -"* c #75E55F", -"= c #70E059", -"- c #1F7A0A", -"; c #228D05", -"> c #6FE058", -", c #69DB50", -"' c #1D740C", -") c #218807", -"! c #70E158", -"~ c #63D449", -"{ c #1C6D0E", -"] c #239201", -"^ c #218707", -"/ c #1F8209", -"( c #6ADB51", -"_ c #62D449", -": c #5ACD3F", -"< c #1B660F", -"[ c #1A5F11", -"} c #185813", -"| c #185115", -"1 c #164C17", -"2 c #229101", -"3 c #75E55E", -"4 c #69DB51", -"5 c #62D448", -"6 c #51C435", -"7 c #49BC2A", -"8 c #41B422", -"9 c #39AC19", -"0 c #31A412", -"a c #154618", -"b c #000000", -"c c #6ADA51", -"d c #62D548", -"e c #51C434", -"f c #49BC2B", -"g c #32A412", -"h c #2B9E0C", -"i c #15421A", -"j c #FFFFFF", -"k c #208806", -"l c #63D448", -"m c #2C9E0C", -"n c #279907", -"o c #143E1A", -"p c #1F7B0A", -"q c #1C6D0D", -"r c #174B16", -"s c #164718", -"t c #15411A", -"u c #133E1B", -"v c #133B1C", -"w c #154718", -"x c #D2211C", -"y c #195813", -"z c #32A512", -"A c #185114", -"B c #32A413", -"C c #279A06", -"D c #164C16", -"E c #143D1B", -" .+@#$ ", -" %&*=- ", -" ;&>,' ", -" )!,~{ ", -".]@^/(_:<[}|1 ", -"2&3=45:67890abbb", -";&!cd:ef89ghijjb", -"k=4l:e789gmnobjb", -"$p'q c #6FE058", -", c #69DB50", -"' c #1D740C", -") c #218807", -"! c #70E158", -"~ c #63D449", -"{ c #1C6D0E", -"] c #239201", -"^ c #218707", -"/ c #1F8209", -"( c #6ADB51", -"_ c #62D449", -": c #5ACD3F", -"< c #1B660F", -"[ c #1A5F11", -"} c #185813", -"| c #185115", -"1 c #164C17", -"2 c #229101", -"3 c #75E55E", -"4 c #69DB51", -"5 c #62D448", -"6 c #51C435", -"7 c #49BC2A", -"8 c #41B422", -"9 c #39AC19", -"0 c #31A412", -"a c #154618", -"b c #6ADA51", -"c c #62D548", -"d c #51C434", -"e c #49BC2B", -"f c #32A412", -"g c #2B9E0C", -"h c #15421A", -"i c #208806", -"j c #63D448", -"k c #2C9E0C", -"l c #279907", -"m c #143E1A", -"n c #1F7B0A", -"o c #1C6D0D", -"p c #174B16", -"q c #164718", -"r c #15411A", -"s c #133E1B", -"t c #133B1C", -"u c #154718", -"v c #195813", -"w c #32A512", -"x c #185114", -"y c #32A413", -"z c #279A06", -"A c #164C16", -"B c #143D1B", -" .+@#$ ", -" %&*=- ", -" ;&>,' ", -" )!,~{ ", -".]@^/(_:<[}|1", -"2&3=45:67890a", -";&!bc:de89fgh", -"i=4j:d789fklm", -"$n'o c #A70000", -", c #FF4949", -"' c #FF9A9A", -") c #B86D6D", -"! c #9E0000", -"~ c #FF1D1D", -"{ c #FF8787", -"] c #B36D6D", -"^ c #940000", -"/ c #FF0000", -"( c #C68989", -"_ c #890000", -": c #FF7E7E", -"< c #C28989", -"[ c #7E0000", -"} c #FF7F7F", -"| c #FF0606", -"1 c #740000", -"2 c #FF8686", -"3 c #FF1C1C", -"4 c #A46D6D", -"5 c #6B0000", -"6 c #FF3434", -"7 c #9F6D6D", -"8 c #B19696", -"9 c #630000", -"0 c #9B6D6D", -"a c #CBCBCB", -".++@ @++.", -"#$$#% %#$$#", -"&**=&-&=**&", -";>,,'>',,>;", -" )!~~{~~!) ", -" ]^///^] ", -" (_:///:_( ", -"<[}||[||}[<", -"12331413321", -"56657 75665", -"8990 0998", -" aa aa "}; - -/* XPM */ -static char * append_file_xpm[] = { -"16 16 102 2", -" c None", -". c #3AAB00", -"+ c #9DA9B5", -"@ c #A6B1BC", -"# c #DEE2E6", -"$ c #38A700", -"% c #E0F291", -"& c #F2F5F7", -"* c #BDC3CB", -"= c #FDFDFE", -"- c #BAC2CB", -"; c #DEE2E5", -"> c #34A100", -", c #C8DF7A", -"' c #E3EAEF", -") c #ACB6BF", -"! c #ECF1F6", -"~ c #B3BDC7", -"{ c #DDE1E5", -"] c #2F9A00", -"^ c #DDF089", -"/ c #C4DD6F", -"( c #E3E9EF", -"_ c #DDE6EF", -": c #97A3AF", -"< c #289300", -"[ c #C2DB66", -"} c #E4EBF0", -"| c #9EAAB4", -"1 c #95A1AC", -"2 c #CBCBCB", -"3 c #238B00", -"4 c #BFDA5F", -"5 c #C2C7CB", -"6 c #E5ECF0", -"7 c #DFE5EA", -"8 c #D6DADE", -"9 c #D0D4D7", -"0 c #85909B", -"a c #1F8600", -"b c #E7EDF2", -"c c #C89685", -"d c #AE3500", -"e c #E5EBF0", -"f c #E1E7EC", -"g c #DEE4E8", -"h c #8B96A2", -"i c #8D2000", -"j c #D18D51", -"k c #B37155", -"l c #AE412A", -"m c #E9EFF3", -"n c #A52F00", -"o c #F8CBA5", -"p c #C59586", -"q c #8C98A3", -"r c #B4785D", -"s c #9D1D00", -"t c #F7A254", -"u c #CF7A52", -"v c #F49028", -"w c #F7BB88", -"x c #9B2700", -"y c #C09287", -"z c #ECF0F4", -"A c #89959F", -"B c #E2E2E2", -"C c #805148", -"D c #8F1F00", -"E c #F79C47", -"F c #F9B87E", -"G c #F58200", -"H c #F58306", -"I c #901400", -"J c #EFF3F6", -"K c #86919C", -"L c #78828C", -"M c #A67B74", -"N c #831500", -"O c #F78406", -"P c #A57A73", -"Q c #F3F6F8", -"R c #838E99", -"S c #808B95", -"T c #E3E5E6", -"U c #CFD1D2", -"V c #780B00", -"W c #FF9627", -"X c #A17874", -"Y c #E1E3E5", -"Z c #F6F8FA", -"` c #7D8994", -" . c #FAFBFC", -".. c #F8FAFB", -"+. c #9D7675", -"@. c #6F0000", -"#. c #7B8691", -"$. c #FBFBFD", -"%. c #FAFAFC", -"&. c #E5E5E6", -"*. c #D2D3D4", -"=. c #7A848E", -" . . . + + + + + + @ + # ", -" $ % $ & & & & & & * = - ; ", -"> > > , > > > ' ' ' ' ) ! ! ~ { ", -"] ^ ^ / ^ ^ ] ( ( ( ( @ _ _ _ : ", -"< < < [ < < < } } } } | 1 1 1 1 ", -"2 2 3 4 3 5 5 6 6 6 6 7 8 9 9 0 ", -" a a a b b c d c b e f g g h ", -" i j k l m n o n p m m m m q ", -" r s t u s s v w x y z z z A ", -" B C D E F F G H F I J J J K ", -" L M N N N O O N P Q Q Q R ", -" S T U U V W V X Y Z Z Z S ", -" ` .....+.@.+.T ........` ", -" #.$.%.%.&.*.&.%.%.%.%.%.#.", -" =.=.=.=.=.=.=.=.=.=.=.=.=.", -" 2 2 2 2 2 2 2 2 2 2 2 2 2 "}; - -/* XPM */ -static char * find_xpm[] = { -"16 16 46 1", -" c None", -". c #2A2A2A", -"+ c #606060", -"@ c #B5B5B5", -"# c #909090", -"$ c #C4C4C4", -"% c #878787", -"& c #6C6C6C", -"* c #464646", -"= c #3E3E3E", -"- c #A1A1A1", -"; c #757575", -"> c #0E0E0E", -", c #787878", -"' c #A5A5A5", -") c #777777", -"! c #0A0A0A", -"~ c #3D3D3D", -"{ c #626262", -"] c #989898", -"^ c #545454", -"/ c #222222", -"( c #151515", -"_ c #131313", -": c #4E4E4E", -"< c #C6C6C6", -"[ c #9F9F9F", -"} c #686868", -"| c #525252", -"1 c #1F1F1F", -"2 c #ACACAC", -"3 c #858585", -"4 c #5C5C5C", -"5 c #535353", -"6 c #BEBEBE", -"7 c #767676", -"8 c #949494", -"9 c #7B7B7B", -"0 c #191919", -"a c #6A6A6A", -"b c #404040", -"c c #3C3C3C", -"d c #484848", -"e c #656565", -"f c #2D2D2D", -"g c #D8D8D8", -" ... ... ", -" +@. .@+ ", -" #...# #...# ", -" .$%&.**.&=$. ", -" .-;>,'',>)-. ", -" .-;!~{{~!)-. ", -"]^./!(,'',(!!_^]", -":<[}|.(11(.|}[<:", -".23}45.66.54}32.", -".23}{7. .7{}32.", -".23}{7. .7{}32.", -".@897%. .%798@.", -"0a|bcd0 0dcb|a0", -".23}{7. .7{}32.", -"efffffe efffffe", -"g66666g g66666g"}; - -/* XPM */ -static char * magnifier_xpm[] = { -"24 24 240 2", -" c None", -". c #C5C5BF", -"+ c #777674", -"@ c #454646", -"# c #17181A", -"$ c #171719", -"% c #444546", -"& c #767673", -"* c #81817E", -"= c #111213", -"- c #525E6B", -"; c #7A8B9E", -"> c #A8BCD1", -", c #A2B7CE", -"' c #7B8C9E", -") c #56616C", -"! c #101112", -"~ c #7D7E7B", -"{ c #424242", -"] c #2F353A", -"^ c #B2C4D7", -"/ c #E9F1F9", -"( c #FAFBFD", -"_ c #F6F9FC", -": c #EFF4FA", -"< c #E0EBF6", -"[ c #C6DAEF", -"} c #A6B9CE", -"| c #32373B", -"1 c #3C3D3D", -"2 c #80807D", -"3 c #33373E", -"4 c #D1E1F1", -"5 c #FFFFFF", -"6 c #F9FBFD", -"7 c #F2F6FB", -"8 c #EBF2F9", -"9 c #E4EDF7", -"0 c #D6E5F3", -"a c #C7DBEF", -"b c #C3D8EE", -"c c #C4D8ED", -"d c #363A3F", -"e c #727271", -"f c #C2C1BB", -"g c #141516", -"h c #B1C3D8", -"i c #FCFCFE", -"j c #EEF4FA", -"k c #E7EFF8", -"l c #DEEAF6", -"m c #C8DBEF", -"n c #C4D8EE", -"o c #C6DAEE", -"p c #C9DCF0", -"q c #B5C5D6", -"r c #141515", -"s c #BABAB6", -"t c #6A6A67", -"u c #586470", -"v c #E1EBF6", -"w c #DDE8F5", -"x c #CADCF0", -"y c #CCDDF0", -"z c #CEDFF1", -"A c #CFE0F1", -"B c #646C73", -"C c #5D5E5E", -"D c #3B3D3D", -"E c #8494A4", -"F c #ECF3FA", -"G c #D9E6F4", -"H c #CCDEF1", -"I c #CCDEF0", -"J c #D0E0F1", -"K c #D2E1F2", -"L c #D4E3F2", -"M c #949DA8", -"N c #353636", -"O c #111212", -"P c #B7C8DA", -"Q c #DCE8F5", -"R c #D5E4F3", -"S c #D2E2F2", -"T c #D6E4F3", -"U c #D8E5F4", -"V c #C3CFDA", -"W c #0C0C0D", -"X c #0E0F10", -"Y c #BECFE0", -"Z c #CADDF0", -"` c #CBDEF0", -" . c #D4E3F3", -".. c #DAE7F4", -"+. c #C9D3DE", -"@. c #0B0B0B", -"#. c #383939", -"$. c #94A1AF", -"%. c #CDDFF1", -"&. c #CBDDF0", -"*. c #D0E1F2", -"=. c #D8E6F4", -"-. c #DEE9F5", -";. c #9FA6AD", -">. c #333434", -",. c #646461", -"'. c #656E77", -"). c #CFDFF1", -"!. c #D1E1F2", -"~. c #D3E2F2", -"{. c #D5E3F3", -"]. c #DEEAF5", -"^. c #E2ECF6", -"/. c #72767A", -"(. c #5B5B5B", -"_. c #B7B6B1", -":. c #131415", -"<. c #C0CEDC", -"[. c #D7E5F3", -"}. c #DBE7F4", -"|. c #E2ECF7", -"1. c #E6EFF8", -"2. c #D3DAE2", -"3. c #141415", -"4. c #A3A3A3", -"5. c #6D6D6B", -"6. c #45494D", -"7. c #DDE9F5", -"8. c #DFEAF6", -"9. c #E4EEF7", -"0. c #E8F0F8", -"a. c #EAF1F9", -"b. c #4A4C4E", -"c. c #656565", -"d. c #A3A3A1", -"e. c #313131", -"f. c #434649", -"g. c #CBD5E0", -"h. c #E3ECF7", -"i. c #E5EEF7", -"j. c #E9F0F8", -"k. c #EAF2F9", -"l. c #D7DDE3", -"m. c #47494B", -"n. c #383838", -"o. c #5C5C5C", -"p. c #8C8C8C", -"q. c #5A5A59", -"r. c #C3A168", -"s. c #636463", -"t. c #131414", -"u. c #767A7F", -"v. c #A8AEB5", -"w. c #D9DFE6", -"x. c #DAE1E7", -"y. c #ADB1B6", -"z. c #7B7D80", -"A. c #565656", -"B. c #464646", -"C. c #B3B3B3", -"D. c #D8D8D8", -"E. c #56564F", -"F. c #D29C2C", -"G. c #F4BB61", -"H. c #AAA9A7", -"I. c #565757", -"J. c #2D2E2E", -"K. c #080808", -"L. c #2E2E2F", -"M. c #575757", -"N. c #A2A2A1", -"O. c #797977", -"P. c #666666", -"Q. c #BCBCBC", -"R. c #666662", -"S. c #6C7038", -"T. c #F9FDA6", -"U. c #F6C257", -"V. c #F4BA60", -"W. c #BACBB6", -"X. c #CCCCCA", -"Y. c #ACABA5", -"Z. c #232322", -"`. c #33322B", -" + c #545023", -".+ c #EBE43F", -"++ c #F7F874", -"@+ c #FEFEED", -"#+ c #F2C057", -"$+ c #F4B95D", -"%+ c #46361C", -"&+ c #7A5A14", -"*+ c #F9CE32", -"=+ c #F8D536", -"-+ c #F7DC39", -";+ c #F8EA6E", -">+ c #FEFDEC", -",+ c #EEBC56", -"'+ c #F1B55A", -")+ c #D2D0C6", -"!+ c #6C4E23", -"~+ c #AD7718", -"{+ c #FBBC2A", -"]+ c #FAC32E", -"^+ c #F9CA31", -"/+ c #FADD69", -"(+ c #FEFBEB", -"_+ c #E9B756", -":+ c #ECB057", -"<+ c #D2D1C6", -"[+ c #664B25", -"}+ c #A96B15", -"|+ c #FDAA22", -"1+ c #FCB125", -"2+ c #FBB829", -"3+ c #FBD063", -"4+ c #FEF9EB", -"5+ c #E2A63F", -"6+ c #E8AE59", -"7+ c #CAD0C0", -"8+ c #604824", -"9+ c #A26614", -"0+ c #FEA01E", -"a+ c #FEA621", -"b+ c #FDB942", -"c+ c #F1AB24", -"d+ c #D18C29", -"e+ c #BBCDB2", -"f+ c #5B4526", -"g+ c #9D6414", -"h+ c #BA791B", -"i+ c #CAA772", -"j+ c #564328", -"k+ c #975F14", -"l+ c #E9921B", -"m+ c #996217", -"n+ c #9E7841", -"o+ c #53442C", -"p+ c #4F3614", -"q+ c #9D8B6F", -" . + @ # $ % & . ", -" * = - ; > , ' ) ! ~ ", -" { ] ^ / ( _ : < [ } | 1 ", -" 2 3 4 5 6 7 8 9 0 a b c d e ", -"f g h i _ j k l m n o m p q r s ", -"t u v 7 8 9 w p [ m x y z A B C ", -"D E F k < G H m x I z J K L M N ", -"O P 9 Q R I x I z J S L T U V W ", -"X Y G K Z ` z J S .T U ..Q +.@. ", -"#.$.%.&.z *.S .T =...Q -.< ;.>. ", -",.'.).!.~.{.0 =...Q ].< ^.9 /.(. ", -"_.:.<.{.[.G }.w ].< |.9 1.2.3.4. ", -" 5.6.G }.7.8.v |.9.1.0.a.b.c.d. ", -" e.f.g.v h.i.k j.k.l.m.n.o.p.q.r. ", -" s.t.u.v.w.x.y.z.3.A.B.C.D.E.F.G. ", -" H.I.J.K.K.L.M.N.O.P.Q.R.S.T.U.V. ", -" W.X. Y.Z.`. +.+++@+#+$+ ", -" %+&+*+=+-+;+>+,+'+ ", -" )+!+~+{+]+^+/+(+_+:+ ", -" <+[+}+|+1+2+3+4+5+6+", -" 7+8+9+0+0+a+b+c+d+", -" e+f+g+0+0+0+h+i+", -" j+k+l+m+n+ ", -" o+p+q+ "}; - -/* XPM */ -static char * leaf_xpm[] = { -"16 16 5 1", -" c None", -". c #000000", -"+ c #00A500", -"@ c #000900", -"# c #007000", -" ", -" ......", -" ..+++@#.", -" ..++++.##.", -" .+++++.@@@.", -" .+++++.###. ", -" .++++.####. ", -" .++++@@@@@. ", -" .+++.#####. ", -" .++.@@@##. ", -" .+.####.. ", -" @.###.. ", -" .@... ", -" .@ ", -" .@ ", -"@@ "}; - -/* XPM */ -static char * extract_layers_xpm[] = { -"16 16 5 1", -" c None", -". c #000000", -"+ c #1A1A1A", -"@ c #FF0000", -"# c #FFFFFF", -"................", -". .", -". . + @ .", -". . + @ .", -". .+ @ .", -". ........... .", -". .", -". .", -".##############.", -".##############.", -".#.##+###.###@#.", -".#.#+####.##@##.", -".#.+#####.#@###.", -".#.....##.....#.", -".##############.", -"................"}; - -/* XPM */ -static char * extract_graphs_xpm[] = { -"16 16 3 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"................", -".++++++++++++++.", -".++.+++++.+++++.", -".++.+++++.+++++.", -".++....++....++.", -".++++++++++++++.", -"................", -" ", -" ", -"....... .......", -".+++++. .+++++.", -".+.+++. .+.+++.", -".+.+++. .+.+++.", -".+...+. .+...+.", -".+++++. .+++++.", -"....... ......."}; - -/* XPM */ -static char * add_zoom_plot_xpm[] = { -"16 16 3 1", -" c None", -". c #000000", -"+ c #FDFFCB", -". ", -". ....... . ", -". . .+++++. ", -". .+.+.+. . ", -". . ..+++.. .", -". ....... ", -". . . ", -". ", -"................", -".++++++++++++++.", -".++++++++++++++.", -".++++++.++.++++.", -".++++++++++++++.", -".++++.++++++.++.", -".++++++++++++++.", -"................"}; - -/* XPM */ -static char * add_inset_curve_layer_xpm[] = { -"13 13 4 1", -" c None", -". c #ACA899", -"+ c #000000", -"@ c #FF0000", -".. ++ ", -". + @ ", -". ++ @ @", -".. + @ ", -". ++ @ ", -". ++++++", -".. + + +", -". ", -". ", -".. ", -". ", -". . . . . ", -"............."}; - - -/* XPM */ -static char * add_inset_layer_xpm[] = { -"13 13 3 1", -" c None", -". c #ACA899", -"+ c #000000", -".. ++ ", -". + ", -". ++ ", -".. + ", -". ++ ", -". ++++++", -".. + + +", -". ", -". ", -".. ", -". ", -". . . . . ", -"............."}; - - -/* XPM */ -static char * plot_double_y_xpm[] = { -"16 16 3 1", -" c None", -". c #000000", -"+ c #FF0000", -"...............+", -". +", -". + +++ +", -". ++ + + ++ +", -". ++ + + +", -".+ ++ +", -". ++ .. +", -". .. +", -". . . +", -". . . +", -". .. .+", -". .. .+", -". . +", -". .. +", -". .. +", -"...............+"}; - -/* XPM */ -static char * equation_xpm[] = { -"16 11 4 1", -" c None", -". c #A64D4D", -"+ c #A6A6A6", -"@ c #4D4DA6", -" ...........", -" .++++++++++", -" . ", -" . @@@+ +@", -" +. @@ @@@+", -" .+ .+ @@ @+ ", -"..+ . @@ @ ", -" +. . @@ @ ", -" .+. @@ @@++", -" +.+ @@@ @@", -" . "}; - -/* XPM */ -static char * sort_descending_xpm[] = { -"13 16 36 1", -" c None", -". c #C8C5DA", -"+ c #B4B0D4", -"@ c #A09BCE", -"# c #9B96CD", -"$ c #7971C2", -"% c #544AB7", -"& c #FF0000", -"* c #8D86C8", -"= c #AAA6D1", -"- c #D5282B", -"; c #655CBC", -"> c #C8C4D9", -", c #7971C1", -"' c #A09ACD", -") c #B4AFD3", -"! c #CECDCB", -"~ c #8A8D98", -"{ c #93959E", -"] c #9B9DA5", -"^ c #6B6F80", -"/ c #DEDDD7", -"( c #717585", -"_ c #828591", -": c #B4B5B8", -"< c #E9C7C0", -"[ c #EAC8C0", -"} c #C5C5C5", -"| c #A4A5AB", -"1 c #ACADB1", -"2 c #7A7D8B", -"3 c #ECD9D1", -"4 c #E7B7B1", -"5 c #ACAEB0", -"6 c #CECEC9", -"7 c #A3A6AA", -".+@@@+ ", -"#$%%%$ & ", -" *%= - ", -" .%; - ", -" $%+ - ", -" >%; - ", -">,%,') - ", -",%%%%, - ", -" - ", -" !~{ - ", -" ]^^/ &---&", -" (_^: <&-&[", -"!^}^~ &-& ", -"|^12^ 3&3 ", -"_(~2^} 4 ", -"^5 6^7 "}; - -/* XPM */ -static char * sort_ascending_xpm[] = { -"13 16 35 1", -" c None", -". c #A09BCF", -"+ c #DBDAE1", -"@ c #B4B0D5", -"# c #544AB7", -"$ c #FF0000", -"% c #827BC5", -"& c #5B52B9", -"* c #D5282B", -"= c #655CBC", -"- c #C9C5DB", -"; c #9791CC", -"> c #BEBBD8", -", c #9790CB", -"' c #6F67BF", -") c #8D86C8", -"! c #A09BCE", -"~ c #DBD9DF", -"{ c #BDBEBE", -"] c #8A8D98", -"^ c #868995", -"/ c #7F838F", -"( c #7D808D", -"_ c #D6D6D2", -": c #ACAEB2", -"< c #7A7D8B", -"[ c #6B6F80", -"} c #EAC8C1", -"| c #EAC8C0", -"1 c #93959E", -"2 c #CECECC", -"3 c #EDDAD1", -"4 c #E8B7B1", -"5 c #CECEC9", -"6 c #ABAEB0", -" ..+ ", -" @##@ $ ", -" %&#% * ", -" &%=# * ", -"-#@;#> * ", -",#'=#) * ", -"'=!!#= * ", -"#) '#~ * ", -" * ", -"{]^/(_ * ", -" {:<[_ $***$", -" [] }$*$|", -" 1[2 $*$ ", -" 2[] 3$3 ", -" ][:2 4 ", -"5[[[[6 "}; - -/* XPM */ -static char * formula_xpm[] = { -"9 9 3 1", -" c None", -". c #000000", -"+ c #626677", -".........", -" .. +.", -" .. .", -" .. ", -" .. ", -" .. ", -" .. .", -" .. +.", -"........."}; - -/* XPM */ -static char * rotate_counterclockwise_xpm[] = { -"11 13 15 1", -" c None", -". c #ABBBD2", -"+ c #3F6397", -"@ c #204A87", -"# c #6F8AB1", -"$ c #3B6096", -"% c #5A86B9", -"& c #729FCF", -"* c #859CBE", -"= c #315890", -"- c #6794C7", -"; c #5E8BC0", -"> c #5987BD", -", c #5071A1", -"' c #2A528C", -" .+@@@@@", -" #$%&&&&@", -" *=&-;>>&@", -" ,&-&&&&&@", -" @&>&'@@@@", -" @&>&@ ", -"@@@&>&@@@ ", -"@&&&>&&&@ ", -" @&>>>&@ ", -" @&>&@ ", -" @&@ ", -" @ ", -" "}; - -/* XPM */ -static char * rotate_clockwise_xpm[] = { -"11 13 15 1", -" c None", -". c #204A87", -"+ c #3F6397", -"@ c #ABBBD2", -"# c #729FCF", -"$ c #5A86B9", -"% c #3B6096", -"& c #6F8AB1", -"* c #5987BD", -"= c #5E8BC0", -"- c #6794C7", -"; c #315890", -"> c #859CBE", -", c #5071A1", -"' c #2A528C", -".....+@ ", -".####$%& ", -".#**=-#;> ", -".#####-#, ", -"....'#*#. ", -" .#*#. ", -" ...#*#...", -" .###*###.", -" .#***#. ", -" .#*#. ", -" .#. ", -" . ", -" "}; - -/* XPM */ -static char * flip_vertical_xpm[] = { -"9 14 18 1", -" c None", -". c #C0CCDD", -"+ c #204A87", -"@ c #D3DCE7", -"# c #B7C5D8", -"$ c #BED2EA", -"% c #B1C0D5", -"& c #93B4DD", -"* c #BCD1EA", -"= c #BCC8DB", -"- c #C3CEDF", -"; c #A4C0E2", -"> c #ACC6E4", -", c #BBD0E9", -"' c #C4D6EC", -") c #9DBBDF", -"! c #B8C6D9", -"~ c #C7D2E1", -" .+@ ", -" #+$+@ ", -" %+$&*+@ ", -"=+$&&&*+-", -"+$;>&>;$+", -"+++$&,+++", -" +$&'+ ", -" +$&'+ ", -"+++$&,+++", -"+$;)&>;$+", -"=+$&&&$+-", -" %+$&$+@ ", -" #+$+@ ", -" !+~ "}; - -/* XPM */ -static char * flip_horizontal_xpm[] = { -"14 9 18 1", -" c None", -". c #C3CEDF", -"+ c #204A87", -"@ c #D3DCE7", -"# c #BED2EA", -"$ c #BCD1EA", -"% c #A4C0E2", -"& c #93B4DD", -"* c #ACC6E4", -"= c #BBD0E9", -"- c #C4D6EC", -"; c #C7D2E1", -"> c #C0CCDD", -", c #9DBBDF", -"' c #B8C6D9", -") c #B7C5D8", -"! c #B1C0D5", -"~ c #BCC8DB", -" .++ ++. ", -" @+#+ +#+@ ", -" @+$%++++%#+@ ", -"@+$&*=--=*&#+;", -"+#&&&&&&&&&&#+", -">+#&*####,&#+'", -" )+#%++++%#+) ", -" !+#+ +#+! ", -" ~++ ++~ "}; - -/* XPM */ -static char * delete_column_xpm[] = { -"16 13 6 1", -" c None", -". c #878B98", -"+ c #FFFFFF", -"@ c #FF0000", -"# c #464B5C", -"$ c #B2B5BF", -"................", -".++++.@@@@.++++#", -".++++.@@@@.++++#", -".....$....$.....", -".++++.@@@@.++++#", -".++++.@@@@.++++#", -".....$....$.....", -".++++.@@@@.++++#", -".++++.@@@@.++++#", -".....$....$.....", -".++++.@@@@.++++#", -".++++.@@@@.++++#", -".####.####.#####"}; - -/* XPM */ -static char * insert_column_xpm[] = { -"16 15 8 1", -" c None", -". c #594FBF", -"+ c #655BEF", -"@ c #878B98", -"# c #FFFFFF", -"$ c #E8D038", -"% c #464B5C", -"& c #E89238", -" .+++++. ", -" .+++. ", -"@@@@@@@.+.@@@@@@", -"@####@$$.$@####%", -"@####@$$$$@####%", -"@@@@@@&&&&@@@@@@", -"@####@$$$$@####%", -"@####@$$$$@####%", -"@@@@@@&&&&@@@@@@", -"@####@$$$$@####%", -"@####@$$$$@####%", -"@@@@@@&&&&@@@@@@", -"@####@$$$$@####%", -"@####@$$$$@####%", -"@%%%%@%%%%@%%%%%"}; - -/* XPM */ -static char * delete_row_xpm[] = { -"16 13 6 1", -" c None", -". c #878B98", -"+ c #FFFFFF", -"@ c #464B5C", -"# c #B2B5BF", -"$ c #FF0000", -"................", -".++++.++++.++++@", -".++++.++++.++++@", -".....#....#.....", -".$$$$.$$$$.$$$$@", -".$$$$.$$$$.$$$$@", -".....#....#.....", -".++++.++++.++++@", -".++++.++++.++++@", -".....#....#.....", -".++++.++++.++++@", -".++++.++++.++++@", -".@@@@.@@@@.@@@@@"}; - -/* XPM */ -static char * insert_row_xpm[] = { -"16 13 9 1", -" c None", -". c #878B98", -"+ c #FFFFFF", -"@ c #464B5C", -"# c #594FBF", -"$ c #655BEF", -"% c #E8D038", -"& c #E89238", -"* c #B2B5BF", -"................", -".++++.++++.++++@", -"#++++.++++.++++@", -"$#..............", -"$$#%%&%%%%&%%%%@", -"$$$#%&%%%%&%%%%@", -"$$#.............", -"$#+++.++++.++++@", -"#++++.++++.++++@", -".....*....*.....", -".++++.++++.++++@", -".++++.++++.++++@", -".@@@@.@@@@.@@@@@"}; - -/* XPM */ -static char * set_label_col_xpm[] = { -"14 11 2 1", -" c None", -". c #000000", -" . ", -" .. ... .. ", -" . . . . .", -" ... . . . ", -". . . . . .", -".... ... .. ", -" ", -" .... ", -" .... ", -" .... ", -" .... "}; - -/* XPM */ -static char *index_xpm[]={ -"11 16 3 1", -" c None", -". c #000000", -"+ c #FF0000", -" ", -" ", -" ", -" ", -" ", -"... .. ", -" ... ", -" .. ", -" ... ++ ", -".. ... + +", -" +", -" + ", -" + ", -" ++++", -" ", -" "}; - -/* XPM */ -static char *exp_xpm[]={ -"11 16 3 1", -" c None", -". c #FF0000", -"+ c #000000", -" .. ", -" . .", -" .", -" . ", -" . ", -"+++ ++ ....", -" +++ ", -" ++ ", -" +++ ", -"++ +++ ", -" ", -" ", -" ", -" ", -" ", -" "}; - -/* XPM */ -static char * draw_points_xpm[] = { -"10 10 2 1", -" c None", -". c #BC0F0F", -" .. ", -" .. ", -" ..", -" ..", -".. ", -".. ..", -" ..", -" ", -" .. ", -" .. "}; - -/* XPM */ -static char * image_plot_xpm[] = { -"14 14 6 1", -" c None", -". c #000000", -"+ c #FF0000", -"@ c #FFFFFF", -"# c #00FF00", -"$ c #0000FF", -"..............", -".++++@@@@@@@@.", -".++++@@@@@@@@.", -".++++@@@@@@@@.", -".++++@####@@@.", -".++++######@@.", -".++++######@@.", -".@@@@######@@.", -".@@@@######$@.", -".@@@@######$@.", -".@@@@@####$$$.", -".@@@@@@@@@$$$.", -".@@@@@@@@$$$$.", -".............."}; - -/* XPM */ -static char * move_col_first_xpm[] = { -"11 14 2 1", -" c None", -". c #000000", -".. ", -".. . ", -".. .. ", -".. ... ", -".. .... ", -".. .......", -".. .......", -".. .......", -".. .... ", -".. ... ", -".. .. ", -".. . ", -".. ", -".. "}; - -/* XPM */ -static char * move_col_last_xpm[] = { -"11 14 2 1", -" c None", -". c #000000", -" ..", -" . ..", -" .. ..", -" ... ..", -" .... ..", -"....... ..", -"....... ..", -"....... ..", -" .... ..", -" ... ..", -" .. ..", -" . ..", -" ..", -" .."}; - -/* XPM */ -static char * x_col_xpm[] = { -"10 11 2 1", -" c None", -". c #000000", -". .", -".. ..", -" .. .. ", -" .. .. ", -" .... ", -" .. ", -" .... ", -" .. .. ", -" .. .. ", -".. ..", -". ."}; - -/* XPM */ -static char * y_col_xpm[] = { -"12 11 2 1", -" c None", -". c #000000", -"... ...", -" .. .. ", -" .. .. ", -" .... ", -" .. ", -" .. ", -" .. ", -" .. ", -" .. ", -" .. ", -" .... "}; - -/* XPM */ -static char * z_col_xpm[] = { -"9 11 2 1", -" c None", -". c #000000", -".........", -".........", -" .. ", -" .. ", -" .. ", -" .. ", -" .. ", -" .. ", -".. ", -".........", -"........."}; - -/* XPM */ -static char * disregard_col_xpm[] = { -"15 5 2 1", -" c None", -". c #000000", -". . . . . ...", -"... . . ... . ", -"... . . ... .. ", -". . . . . . . ", -". . . . . ..."}; - -/* XPM */ -static char * move_col_right_xpm[] = { -"7 11 2 1", -" c None", -". c #000000", -" . ", -" .. ", -" ... ", -" .... ", -".......", -".......", -".......", -" .... ", -" ... ", -" .. ", -" . "}; - -/* XPM */ -static char * move_col_left_xpm[] = { -"7 11 2 1", -" c None", -". c #000000", -" . ", -" .. ", -" ... ", -" .... ", -".......", -".......", -".......", -" .... ", -" ... ", -" .. ", -" . "}; - - -/* XPM */ -static char * pdf_xpm[] = { -"16 16 149 2", -" c None", -". c #A5A38D", -"+ c #949285", -"@ c #918F82", -"# c #908E81", -"$ c #929083", -"% c #94927E", -"& c #C3C3CB", -"* c #BEBEC6", -"= c #BCBCC2", -"- c #BABAC0", -"; c #B2B2B8", -"> c #A8A8AC", -", c #88888D", -"' c #DFDFDF", -") c #A09F99", -"! c #ABA891", -"~ c #FE7C7F", -"{ c #FF6A6C", -"] c #FF5356", -"^ c #FF484C", -"/ c #FF4144", -"( c #FF3D3F", -"_ c #FF373A", -": c #FF3134", -"< c #FB2E32", -"[ c #DB191D", -"} c #808085", -"| c #FBFBFB", -"1 c #9B9B94", -"2 c #AAA791", -"3 c #FF7476", -"4 c #FF3639", -"5 c #FF2124", -"6 c #FF1519", -"7 c #FF0C11", -"8 c #FF060A", -"9 c #FF0004", -"0 c #F50003", -"a c #E90004", -"b c #AB0104", -"c c #717173", -"d c #9A9991", -"e c #FF6163", -"f c #FF272A", -"g c #FF1A1E", -"h c #FF1217", -"i c #FF0B0F", -"j c #FF0408", -"k c #FA0003", -"l c #EE0003", -"m c #DB0003", -"n c #8B0002", -"o c #8A8A8D", -"p c #747477", -"q c #727274", -"r c #7E7E81", -"s c #8C8C8E", -"t c #A4A18B", -"u c #D7191C", -"v c #810406", -"w c #E6E6E6", -"x c #CBCBCB", -"y c #C5C5C5", -"z c #BBBBBB", -"A c #C8C8C8", -"B c #93907D", -"C c #969480", -"D c #D4D4D4", -"E c #CCCCCC", -"F c #D0D0D0", -"G c #DEDEDE", -"H c #D35152", -"I c #DCDBDB", -"J c #E0E0E0", -"K c #D8D8D8", -"L c #D2D2D2", -"M c #C7C7C7", -"N c #D9D9D9", -"O c #8E8C79", -"P c #D5D5D5", -"Q c #DDDDDD", -"R c #F4F4F4", -"S c #DF4E4D", -"T c #E3E2E3", -"U c #ECECEC", -"V c #E5E5E5", -"W c #DBDBDB", -"X c #CECECE", -"Y c #E1E1E1", -"Z c #8A8875", -"` c #E4E4E4", -" . c #DADADA", -".. c #E8DBDB", -"+. c #DD3B3A", -"@. c #E89A9D", -"#. c #EEEEEE", -"$. c #E7E7E7", -"%. c #868472", -"&. c #F5F5F5", -"*. c #EA7C7B", -"=. c #E9EDF1", -"-. c #E68F90", -";. c #EAAAAB", -">. c #F6F6F6", -",. c #E8E8E8", -"'. c #E9E9E9", -"). c #EAEAEA", -"!. c #EBD3D6", -"~. c #E94B4C", -"{. c #E9AAAA", -"]. c #E74849", -"^. c #E74747", -"/. c #ED5252", -"(. c #DB8486", -"_. c #F1F1F1", -":. c #F2F2F2", -"<. c #F3F3F3", -"[. c #E35A5A", -"}. c #EABCBE", -"|. c #EFDADC", -"1. c #EFF0F2", -"2. c #F0FFFF", -"3. c #E4EDF0", -"4. c #D8B6B9", -"5. c #D36468", -"6. c #EFE2E5", -"7. c #E25D5F", -"8. c #E58D8F", -"9. c #EBEBEB", -"0. c #CDCDCD", -"a. c #E16F70", -"b. c #E57070", -"c. c #DCDCDC", -"d. c #D1D1D1", -"e. c #C0C0C0", -"f. c #D3D3D3", -"g. c #95927E", -"h. c #FFFFFF", -"i. c #F7F7F7", -"j. c #EDEDED", -"k. c #E2E2E2", -"l. c #C6C6C6", -"m. c #858371", -"n. c #93917D", -"o. c #302F29", -"p. c #1C1B17", -"q. c #161613", -"r. c #8F8D79", -" . + @ # @ # # # $ ", -" % & * = - ; > , ' ) ! ", -"~ { ] ^ / ( _ : < [ } | ' 1 2 ", -"3 4 5 6 7 8 9 0 a b c | | ' d ", -"e f g h i j k l m n o p q r s t ", -"u n n n n n n n n v w x y z A B ", -" C D E F G H I J K L M N O ", -" C J P Q R S T U V W X Y Z ", -" C ` .U ..+.@.R #.V D $.%.", -" C $.Y &.*.=.-.;.>.,. .'.%.", -" C U ).!.~.{.{.].^./.(._.%.", -" C :.<.[.}.|.1.2.3.4.5.).%.", -" C 6.7.8.<.9.$.V J .0.Q %.", -" C a.b._.` Y c.K d.F e.f.%.", -" g.h.i.j.).w k.c.K L l.f.m.", -" n.o.p.p.p.p.p.p.p.p.q.o.r."}; - -/* XPM */ -static char * fit_frame_xpm[] = { -"12 12 2 1", -" c None", -". c #0810B5", -".... ....", -"... ...", -".... ....", -". ........ .", -" . . ", -" . . ", -" . . ", -" . . ", -". ........ .", -".... ....", -"... ...", -".... ...."}; - -/* XPM */ -static char * reset_rotation_xpm[] = { -"15 15 2 1", -" c None", -". c #0810B5", -" .. ", -" .. ", -" .. ", -" ....... ", -" . .. ", -" . . . ", -" ....... . ", -" . . . ", -" . . . ", -" . . ....", -" . . .....", -" . .. ", -" ........ ", -"... ", -".. "}; - -/* XPM */ -static char * perspective_xpm[] = { -"16 16 2 1", -" c None", -". c #0810B5", -" ........ ", -" .. .. ", -" . . . . ", -" . . . . ", -"................", -". . . .", -". . . .", -". . . .", -". . . .", -". . . .", -". . . .", -". ........ .", -". . . .", -". . . .", -".. ..", -"................"}; - -/* XPM */ -static char * gray_map_xpm[] = { -"16 15 5 1", -" c None", -". c #000000", -"+ c #C2BFA5", -"@ c #FFFFFF", -"# c #808080", -".++++@@@@++++@@@", -".+##++@@++##++@@", -".####++++####+++", -".#..##++##..##++", -".#..##++##..##++", -".####++++####+++", -".+##++@@++##++@@", -".++++@@@@++++@@@", -".++++@@@@++++@@@", -".+##++@@++##++@@", -".####++++####+++", -".#..##++##..##++", -".#..##++##..##++", -".####++++####+++", -"................"}; - -/* XPM */ -static char * contour_map_xpm[] = { -"16 15 3 1", -" c None", -". c #000000", -"+ c #FFFFFF", -".+++++++.+++++++", -".+....++.++....+", -"..++++.+.+.++++.", -"..+..+.+.+.+..+.", -"..+..+.+.+.+..+.", -"..++++.+.+.++++.", -".+....++.++....+", -".++++++.+.++++++", -".......+++......", -".++++++.+.++++++", -".+....++.++....+", -"..++++.+.+.++++.", -"..+..+.+.+.+..+.", -"..+..+.+.+.+..+.", -"................"}; - -/* XPM */ -static char * color_map_xpm[] = { -"16 15 6 1", -" c None", -". c #000000", -"+ c #00FF00", -"@ c #0000FF", -"# c #FFFF00", -"$ c #FF0000", -".+ +@ @+ +@ ", -".+++++@@++++++@@", -".+##++++++##++++", -".#$$#+ +#$$#+ ", -".#$$#+ +#$$#+ ", -".+##++++++##++++", -".+++++@@++++++@@", -".+ +@ @+ +@ ", -".+ +@ @+ +@ ", -".+++++@@++++++@@", -".+##++++++##++++", -".#$$#+ +#$$#+ ", -".#$$#+ +#$$#+ ", -".+##++++++##++++", -"................"}; - -/* XPM */ -static char * auto_layout_xpm[] = { -"16 16 3 1", -" c None", -". c #000000", -"+ c #010000", -"... ...", -".. ..", -". . . .", -" ", -" ........ ", -" . + + . ", -" . . ", -" . . ", -" . . ", -" . . ", -" . + + . ", -" ........ ", -" ", -". . . .", -".. ..", -"... ..."}; - -/* XPM */ -static char * movie_xpm[] = { -"32 32 257 2", -" c None", -". c #000000", -"+ c #969600", -"@ c #928E00", -"# c #8E8600", -"$ c #8A7E00", -"% c #908A00", -"& c #847200", -"* c #847000", -"= c #836F00", -"- c #826E00", -"; c #826D00", -"> c #7F6600", -", c #7C5F00", -"' c #966200", -") c #836E00", -"! c #775300", -"~ c #734A00", -"{ c #755000", -"] c #785600", -"^ c #7B5D00", -"/ c #D0B545", -"( c #B69931", -"_ c #AA8C27", -": c #744D00", -"< c #808080", -"[ c #775500", -"} c #765100", -"| c #765300", -"1 c #785700", -"2 c #9D7E1D", -"3 c #84630A", -"4 c #795900", -"5 c #8C8100", -"6 c #85640B", -"7 c #857400", -"8 c #C4A83C", -"9 c #86650C", -"0 c #7F6700", -"a c #B2952E", -"b c #877700", -"c c #7A5B00", -"d c #A08120", -"e c #7F6500", -"f c #8F6F13", -"g c #795B00", -"h c #775400", -"i c #8F7013", -"j c #7A5C00", -"k c #907114", -"l c #000080", -"m c #FFFCF6", -"n c #FFFDF7", -"o c #FFFBF4", -"p c #FFFBF3", -"q c #FFFBF2", -"r c #FFFBF5", -"s c #FFFFFF", -"t c #000000", -"u c #000000", -"v c #000000", -"w c #000000", -"x c #000000", -"y c #000000", -"z c #000000", -"A c #000000", -"B c #000000", -"C c #000000", -"D c #000000", -"E c #000000", -"F c #000000", -"G c #000000", -"H c #000000", -"I c #000000", -"J c #000000", -"K c #000000", -"L c #000000", -"M c #000000", -"N c #000000", -"O c #000000", -"P c #000000", -"Q c #000000", -"R c #000000", -"S c #000000", -"T c #000000", -"U c #000000", -"V c #000000", -"W c #000000", -"X c #000000", -"Y c #000000", -"Z c #000000", -"` c #000000", -" . c #000000", -".. c #000000", -"+. c #000000", -"@. c #000000", -"#. c #000000", -"$. c #000000", -"%. c #000000", -"&. c #000000", -"*. c #000000", -"=. c #000000", -"-. c #000000", -";. c #000000", -">. c #000000", -",. c #000000", -"'. c #000000", -"). c #000000", -"!. c #000000", -"~. c #000000", -"{. c #000000", -"]. c #000000", -"^. c #000000", -"/. c #000000", -"(. c #000000", -"_. c #000000", -":. c #000000", -"<. c #000000", -"[. c #000000", -"}. c #000000", -"|. c #000000", -"1. c #000000", -"2. c #000000", -"3. c #000000", -"4. c #000000", -"5. c #000000", -"6. c #000000", -"7. c #000000", -"8. c #000000", -"9. c #000000", -"0. c #000000", -"a. c #000000", -"b. c #000000", -"c. c #000000", -"d. c #000000", -"e. c #000000", -"f. c #000000", -"g. c #000000", -"h. c #000000", -"i. c #000000", -"j. c #000000", -"k. c #000000", -"l. c #000000", -"m. c #000000", -"n. c #000000", -"o. c #000000", -"p. c #000000", -"q. c #000000", -"r. c #000000", -"s. c #000000", -"t. c #000000", -"u. c #000000", -"v. c #000000", -"w. c #000000", -"x. c #000000", -"y. c #000000", -"z. c #000000", -"A. c #000000", -"B. c #000000", -"C. c #000000", -"D. c #000000", -"E. c #000000", -"F. c #000000", -"G. c #000000", -"H. c #000000", -"I. c #000000", -"J. c #000000", -"K. c #000000", -"L. c #000000", -"M. c #000000", -"N. c #000000", -"O. c #000000", -"P. c #000000", -"Q. c #000000", -"R. c #000000", -"S. c #000000", -"T. c #000000", -"U. c #000000", -"V. c #000000", -"W. c #000000", -"X. c #000000", -"Y. c #000000", -"Z. c #000000", -"`. c #000000", -" + c #000000", -".+ c #000000", -"++ c #000000", -"@+ c #000000", -"#+ c #000000", -"$+ c #000000", -"%+ c #000000", -"&+ c #000000", -"*+ c #000000", -"=+ c #000000", -"-+ c #000000", -";+ c #000000", -">+ c #000000", -",+ c #000000", -"'+ c #000000", -")+ c #000000", -"!+ c #000000", -"~+ c #000000", -"{+ c #000000", -"]+ c #000000", -"^+ c #000000", -"/+ c #000000", -"(+ c #000000", -"_+ c #000000", -":+ c #000000", -"<+ c #000000", -"[+ c #000000", -"}+ c #000000", -"|+ c #000000", -"1+ c #000000", -"2+ c #000000", -"3+ c #000000", -"4+ c #000000", -"5+ c #000000", -"6+ c #000000", -"7+ c #000000", -"8+ c #000000", -"9+ c #000000", -"0+ c #000000", -"a+ c #000000", -"b+ c #000000", -"c+ c #000000", -"d+ c #000000", -"e+ c #000000", -"f+ c #000000", -"g+ c #000000", -"h+ c #000000", -"i+ c #000000", -"j+ c #000000", -"k+ c #000000", -"l+ c #000000", -"m+ c #000000", -"n+ c #000000", -"o+ c #000000", -"p+ c #000000", -"q+ c #000000", -"r+ c #000000", -"s+ c #000000", -"t+ c #000000", -"u+ c #000000", -"v+ c #000000", -"w+ c #000000", -"x+ c #000000", -"y+ c #000000", -"z+ c #000000", -"A+ c #000000", -"B+ c #000000", -"C+ c #000000", -"D+ c #000000", -"E+ c #000000", -"F+ c #000000", -"G+ c #000000", -"H+ c #000000", -" ", -" ", -" ", -" ", -" ", -" . . . . . . . . . . . . ", -" . . . . . . . . . . . . ", -" . . . . . . . . . . . . . . . . . . . . ", -" . . . . + @ # $ . . . . . . . . + % $ $ & . . . ", -" . . % . * = - ; > , . . . . . . . ' ) . . . . ! ~ . . ", -" . . ! . ~ { ] ^ ] { ~ . . . . . . / / . . . . . . ! ~ . . ", -" . . ! . ~ { ] ^ ] { ~ . . . . . / / ( _ . . . . . . : . < . ", -" . . [ . } | [ 1 . . . < . . . . / ( ( 2 3 . . < . . . . < . . ", -" . < . . 4 ] . . . < . . . / / . ( 2 2 3 3 . 5 . < . < . . . . ", -" . . . . . . . < . . . / / ( ( . 2 3 3 3 6 . 7 8 . . . . / % . ", -" . . < . < . < . . / / ( ( 2 2 . 3 3 3 6 9 . 0 a / / / / ( b . ", -" . % . . . . . % . ( ( 2 2 3 3 . 3 6 6 9 [ . c d ( ( ( ( 2 e . ", -" . b / / / / / b . 2 2 3 3 3 3 . 6 9 9 . . . c f 2 2 2 2 3 ! . ", -" . e ( / / / ( e . 3 3 3 3 6 6 . 9 . . . . g f 3 3 3 3 3 h . ", -" . ! 2 _ _ _ 2 ! . 3 3 6 6 9 9 . . . . . . g i 3 3 3 3 6 h . ", -" . h 3 3 3 3 3 ! . 6 6 9 9 . . . . . . j k 6 6 6 6 9 [ . ", -" . h 3 3 3 3 3 h . 9 9 . . . . . . . . 9 9 9 9 . . . ", -" . [ 6 6 6 6 6 h . . . . . . . . . . . . . ", -" . . 9 9 9 9 9 [ . . . . . . . . ", -" . . . . . . . . . . . . . . . ", -" . . . . . ", -" . . . . . . . ", -" p ", -" ", -" ", -" ", -" "}; - -/* XPM */ -static char * python_xpm[] = { -"16 16 36 1", -" c None", -". c #000000", -"+ c #909090", -"@ c #3F3FFF", -"# c #7F7FFF", -"$ c #0000FF", -"% c #5050CF", -"& c #4040BF", -"* c #00007F", -"= c #DFDFDF", -"- c #404040", -"; c #404000", -"> c #202000", -", c #606000", -"' c #7F7F7F", -") c #A0A0A0", -"! c #7F7F00", -"~ c #3F3F3F", -"{ c #BFBF3F", -"] c #808000", -"^ c #609F00", -"/ c #00BF00", -"( c #40BF00", -"_ c #209F00", -": c #00FF00", -"< c #20DF00", -"[ c #007F00", -"} c #003F00", -"| c #205F00", -"1 c #9F5F00", -"2 c #BF0000", -"3 c #5F5F00", -"4 c #3F3F00", -"5 c #8F8F8F", -"6 c #AFAFAF", -"7 c #707070", -"................", -".+@@#@#$@$$$%&+.", -".**************.", -".=- .;>,> ').", -".=- !~{~; ').", -".=- !~{~;. ').", -".=-.>;,;,]>;.').", -".=-,]]]]^^/,]').", -".=-,],^(_/:;]').", -".=-:<<<[><[<]').", -".=-}|1>><}|<]').", -".=-.23_/}._^]').", -".=-24[}.}(^],').", -".=5''''''''''6).", -".5))))))))))))7.", -" .............. "}; - -/* XPM */ -static char * fit_xpm[] = { -"32 32 4 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #FF0000", -"................................", -".++++++++++++++++++++++++++++++.", -".++++++++++++++++++++++++++++++.", -".++++++++++++++++++++++++++++++.", -".+++++++++++++++++++++..+++++++.", -".+++++++++++++++++++++..+++++++.", -".+++++++++++++++++++++++@++++++.", -".+++++++++++++++++++++@@@++++++.", -".+++++++++++++++++..+@..+++++++.", -".+++++++++++++++++..+@..+++++++.", -".+++++++++++++++++++@@+++++++++.", -".++++++++++++++++++@@++++++++++.", -".++++++++++++++++..@+..++++++++.", -".++++++++++++++++..@+..++++++++.", -".+++++++++++++..++@++++++++++++.", -".+++++++++++++..+@@++++++++++++.", -".+++++++++++++++@..++++++++++++.", -".+++++++++++++@@@..++++++++++++.", -".+++++++++..+@..+++++++++++++++.", -".+++++++++..+@..+++++++++++++++.", -".+++++++++++@@+++++++++++++++++.", -".++++++++++@@++++++++++++++++++.", -".++++++++..@+..++++++++++++++++.", -".++++++++..@+..++++++++++++++++.", -".+++++++++@++++++++++++++++++++.", -".++++++++@@++++++++++++++++++++.", -".+++++++@..++++++++++++++++++++.", -".+++++++@..++++++++++++++++++++.", -".++++++++++++++++++++++++++++++.", -".++++++++++++++++++++++++++++++.", -".++++++++++++++++++++++++++++++.", -"................................"}; - -/* XPM */ -static char * zoomOut_xpm[] = { -"20 20 101 2", -" c None", -". c #8D8C89", -"+ c #50504F", -"@ c #202121", -"# c #010101", -"$ c #1F2020", -"% c #4F4F4E", -"& c #3B3A3A", -"* c #222224", -"= c #6E777E", -"- c #95A0AA", -"; c #ABBAC9", -"> c #8998A6", -", c #606C77", -"' c #1D2022", -") c #393939", -"! c #111211", -"~ c #5F6368", -"{ c #D1DBE6", -"] c #D8E3ED", -"^ c #D5E0EB", -"/ c #CDDBE8", -"( c #C3D3E3", -"_ c #B7CBDE", -": c #A6BCD2", -"< c #48545E", -"[ c #101110", -"} c #DDE6EF", -"| c #E5ECF3", -"1 c #E6EDF3", -"2 c #BED0E1", -"3 c #B1C6DB", -"4 c #A3BCD5", -"5 c #47535E", -"6 c #F1F5F8", -"7 c #F4F7FA", -"8 c #C1D2E2", -"9 c #B4C8DC", -"0 c #A6BED6", -"a c #98B2CC", -"b c #1C1F22", -"c c #F9FAFC", -"d c #C2D3E3", -"e c #B4C9DC", -"f c #A6BFD6", -"g c #9DB8D2", -"h c #566573", -"i c #000000", -"j c #74899C", -"k c #1E2020", -"l c #E5C479", -"m c #EED9A8", -"n c #F2E1BC", -"o c #EDD5A0", -"p c #E3BF6F", -"q c #D9A636", -"r c #D1940C", -"s c #8CA4BB", -"t c #030303", -"u c #232425", -"v c #A9C1D7", -"w c #9FB9D3", -"x c #525252", -"y c #191D20", -"z c #434E5A", -"A c #080809", -"B c #ADACA8", -"C c #040405", -"D c #191919", -"E c #262625", -"F c #8BA3BA", -"G c #13161A", -"H c #050607", -"I c #1C1C1C", -"J c #737373", -"K c #252525", -"L c #72716E", -"M c #131312", -"N c #050505", -"O c #262626", -"P c #727272", -"Q c #272626", -"R c #2F2F2E", -"S c #090908", -"T c #2F2F2F", -"U c #6F6F6F", -"V c #2A2A29", -"W c #5C5B59", -"X c #080808", -"Y c #3A3A3A", -"Z c #6A6A6A", -"` c #323231", -" . c #8D8B88", -".. c #444444", -"+. c #656565", -"@. c #3D3D3C", -"#. c #B3B1AD", -"$. c #4E4E4E", -"%. c #585858", -"&. c #30302F", -"*. c #323232", -" . + @ # $ % . ", -" & * = - ; > , ' ) ", -" ! ~ { ] ^ / ( _ : < [ ", -" & ~ } | 1 } / 2 2 3 4 5 ) ", -". * { | 6 7 | / 2 8 9 0 a b . ", -"+ = ] 1 7 c 1 / 2 d e f g h % ", -"@ - ^ i i i i i i i i i g j k ", -"# ; / i l m n o p q r i g s t ", -"$ > ( i i i # i i i i i g j u ", -"% , _ 2 8 d v w g v w g g h x ", -". ' : 3 9 e w g g w g g a y . ", -" ) < 4 0 f g g g g g g z A B ", -" [ 5 a g g g g g a z C D E ", -" ) b h j F j h G H i I J K ", -" . % k # k % L M N i O P Q ", -" R S i T U V ", -" W X i Y Z ` ", -" .X # ..+.@.", -" #.M N $.%.", -" &.# *."}; - -/* XPM */ -static char * configTable_xpm[] = { -"32 32 99 2", -" c None", -". c #B9B8A7", -"+ c #B49581", -"@ c #AF8875", -"# c #B08976", -"$ c #B08A77", -"% c #B18B77", -"& c #B18D78", -"* c #B28E79", -"= c #B28F79", -"- c #B3907A", -"; c #B3917A", -"> c #B4927B", -", c #B4937C", -"' c #B5957C", -") c #B5967D", -"! c #B6977E", -"~ c #B6987E", -"{ c #B7997F", -"] c #B79B80", -"^ c #B79C80", -"/ c #B89D81", -"( c #B99E82", -"_ c #B99F82", -": c #BAA083", -"< c #BAA183", -"[ c #BAA384", -"} c #BBA485", -"| c #BBA585", -"1 c #BCA686", -"2 c #BCA787", -"3 c #BDA887", -"4 c #2B2B2B", -"5 c #932E1A", -"6 c #943E2D", -"7 c #90302A", -"8 c #14148F", -"9 c #77352E", -"0 c #CAC7B0", -"a c #C2BFA5", -"b c #B9B7A2", -"c c #999682", -"d c #888674", -"e c #555555", -"f c #ECEBE2", -"g c #999887", -"h c #6A6855", -"i c #45443B", -"j c #9E9B86", -"k c #AFAD99", -"l c #8C8A77", -"m c #8F8D7E", -"n c #553D3D", -"o c #735B5B", -"p c #735C5B", -"q c #96937D", -"r c #8B886E", -"s c #F0F0E8", -"t c #D9D7C7", -"u c #BCB9A0", -"v c #95927E", -"w c #A09D88", -"x c #A2A08B", -"y c #CCCAB3", -"z c #CBC8B1", -"A c #CDCBB8", -"B c #E0DFD1", -"C c #DCDACB", -"D c #B6B5A9", -"E c #686653", -"F c #FFFFFF", -"G c #F8F7F4", -"H c #E8E7DA", -"I c #EBE9DD", -"J c #E9E7DB", -"K c #EAE9DD", -"L c #E9E8DB", -"M c #EAE9DC", -"N c #E9E8DC", -"O c #EAE8DC", -"P c #F7F6F2", -"Q c #EEEEE6", -"R c #E0DFD2", -"S c #EAE9E0", -"T c #C9C6AF", -"U c #E8E7DD", -"V c #B6B39A", -"W c #C1BEA5", -"X c #DFDED3", -"Y c #A8A487", -"Z c #B9B6A0", -"` c #D3D1BA", -" . c #CFCDB5", -".. c #D3D1C2", -"+. c #E6E4D5", -"@. c #DCDACA", -"#. c #C0BEAF", -"$. c #9A9889", -"%. c #AAA797", -". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", -". + @ # $ % & * = - ; > , ' ) ! ~ { ] ^ / ( _ : < [ } | 1 2 3 4 ", -". 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 4 ", -". 7 8 8 8 9 5 5 5 5 5 5 5 5 5 5 5 5 5 0 a a 6 4 4 4 6 b c d 6 4 ", -". 7 e f f 9 5 5 5 5 5 5 5 5 5 5 5 5 5 0 a a 6 g a h 6 0 i j 6 4 ", -". 7 e f f 9 5 5 5 5 5 5 5 5 5 5 5 5 5 k 4 l 6 m a h 6 b 4 4 6 4 ", -". 7 n o p 9 5 5 5 5 5 5 5 5 5 5 5 5 5 h h h 6 h h h 6 q r r 6 4 ", -". 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 4 ", -". 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 ", -". 4 s s s s t a a a a a h 4 a a a a a a h 4 a a a a a 0 u a h 4 ", -". 4 s s s s t a a a a a h 4 a a a a a a h 4 a a a a a 0 4 4 h 4 ", -". 4 s s s s t a a a a a h 4 a a a a a a h 4 a a a a a 0 v w h 4 ", -". 4 s s s s t a a a a a h 4 a a a a a a h 4 a a a a a x 4 4 h 4 ", -". 4 s s s s t a a a a a h 4 a a a a a a h 4 a a a a a y z z h 4 ", -". 4 s s s s A h h h h h h 4 h h h h h h h 4 a a a a a 0 a a h 4 ", -". 4 B B B C 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 f f f f f D 4 4 E 4 ", -". 4 a a a h 4 F F F F F F 4 F F F F F F F 4 F F F F F G s s H 4 ", -". 4 a a a h 4 F F F F F F 4 F F F F F F F 4 F F F F F G s s I 4 ", -". 4 a a a h 4 F F F F F F 4 F F F F F F F 4 F F F F F G s s J 4 ", -". 4 a a a h 4 F F F F F F 4 F F F F F F F 4 F F F F F G s s K 4 ", -". 4 a a a h 4 F F F F F F 4 F F F F F F F 4 F F F F F G s s L 4 ", -". 4 h h h h 4 F F F F F F 4 F F F F F F F 4 F F F F F G s s M 4 ", -". 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 F F F F F G s f N 4 ", -". 4 a a a h 4 F F F F F F 4 F F F F F F F 4 F F F F F G s s O 4 ", -". 4 a a a h 4 F F F F F F 4 F F F F F F F 4 F F F F F G s s O 4 ", -". 4 a a a h 4 F F F F F F 4 F F F F F F F 4 F F F F F P Q Q R 4 ", -". 4 a a a h 4 F F F F F F 4 F F F F F F F 4 F F F F F S T T h 4 ", -". 4 h h h h 4 F F F F F F 4 F F F F F F F 4 F F F F F U 4 4 h 4 ", -". 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 F F F F F U c V h 4 ", -". 4 z z z W 4 F F F F F F 4 F F F F F F F 4 F F F F F X Y Y h 4 ", -". Z ` ` ` ...+.+.+.+.+.+.+.+.+.+.+.+.+.+.@.+.+.+.+.+.#.$.$.%.4 ", -"4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 "}; - -/* XPM */ -static char * config_curves_xpm[] = { -"32 32 234 2", -" c #000000", -". c #808080", -"+ c #FFFFFF", -"@ c #FEFEFE", -"# c #FDFDFD", -"$ c #FCFCFC", -"% c #FBFBFB", -"& c #FF00FF", -"* c #D000D0", -"= c #A100A1", -"- c #FAFAFA", -"; c #F9F9F9", -"> c #F8F8F8", -", c #F900F9", -"' c #C900C9", -") c #9F009F", -"! c #F9F9FA", -"~ c #F8F8F9", -"{ c #F7F7F8", -"] c #F7F7F7", -"^ c #F6F6F7", -"/ c #F5F5F6", -"( c #F4F4F5", -"_ c #F400F4", -": c #C200C2", -"< c #9E009E", -"[ c #F6F6F6", -"} c #F5F5F5", -"| c #F4F4F4", -"1 c #F3F3F3", -"2 c #F2F2F2", -"3 c #F1F1F1", -"4 c #EF00EF", -"5 c #BC00BC", -"6 c #9C009C", -"7 c #F3F3F4", -"8 c #F0F0F1", -"9 c #EFEFF0", -"0 c #EEEEEF", -"a c #EDEDEE", -"b c #E900E9", -"c c #B500B5", -"d c #9B009B", -"e c #F1F1F2", -"f c #F0F0F0", -"g c #EDEDED", -"h c #EBEBEC", -"i c #EAEAEB", -"j c #FAFAFB", -"k c #FBFBFC", -"l c #E400E4", -"m c #AE00AE", -"n c #990099", -"o c #ECECEC", -"p c #E8E8E9", -"q c #E7E7E8", -"r c #DF00DF", -"s c #A800A8", -"t c #980098", -"u c #EFEFEF", -"v c #EBEBEB", -"w c #E9E9E9", -"x c #E7E7E7", -"y c #E5E5E5", -"z c #E3E3E4", -"A c #0000FF", -"B c #0000D0", -"C c #0000A1", -"D c #D900D9", -"E c #970097", -"F c #E6E6E7", -"G c #E4E4E5", -"H c #E2E2E3", -"I c #E0E0E1", -"J c #0000F7", -"K c #0000C7", -"L c #00009F", -"M c #D400D4", -"N c #9A009A", -"O c #950095", -"P c #E3E3E5", -"Q c #E1E1E2", -"R c #DEDEE0", -"S c #DCDCDE", -"T c #0000F0", -"U c #0000BE", -"V c #00009D", -"W c #CF00CF", -"X c #940094", -"Y c #E1E1E1", -"Z c #DEDEDF", -"` c #DBDBDC", -" . c #D9D9DA", -".. c #0000E9", -"+. c #0000B5", -"@. c #00009B", -"#. c #8D008D", -"$. c #920092", -"%. c #D8D8D9", -"&. c #D5D5D7", -"*. c #F2F2F3", -"=. c #0000E2", -"-. c #0000AC", -";. c #000099", -">. c #C400C4", -",. c #860086", -"'. c #910091", -"). c #E5E5E6", -"!. c #DBDBDD", -"~. c #D8D8DA", -"{. c #D2D2D4", -"]. c #0000DB", -"^. c #0000A3", -"/. c #000097", -"(. c #BF00BF", -"_. c #800080", -":. c #900090", -"<. c #CFCFD1", -"[. c #0000D4", -"}. c #00009A", -"|. c #000095", -"1. c #00FF00", -"2. c #00D000", -"3. c #00A100", -"4. c #0000CD", -"5. c #000091", -"6. c #000093", -"7. c #B900B9", -"8. c #8E008E", -"9. c #DFDFE0", -"0. c #D5D5D6", -"a. c #D1D1D3", -"b. c #CECED0", -"c. c #CBCBCD", -"d. c #00F200", -"e. c #00C000", -"f. c #009D00", -"g. c #0000C6", -"h. c #000088", -"i. c #B400B4", -"j. c #C8C8CA", -"k. c #00E500", -"l. c #00B000", -"m. c #009A00", -"n. c #0000BF", -"o. c #000080", -"p. c #000090", -"q. c #AF00AF", -"r. c #8C008C", -"s. c #D7D7D9", -"t. c #D4D4D6", -"u. c #CDCDD0", -"v. c #CACACD", -"w. c #C7C7CA", -"x. c #C4C4C7", -"y. c #00D800", -"z. c #00A000", -"A. c #009600", -"B. c #0000B8", -"C. c #00008E", -"D. c #AA00AA", -"E. c #8A008A", -"F. c #C1C1C4", -"G. c #00CB00", -"H. c #009000", -"I. c #009300", -"J. c #0000B1", -"K. c #00008C", -"L. c #E9E9EA", -"M. c #A400A4", -"N. c #890089", -"O. c #D3D3D5", -"P. c #FF0000", -"Q. c #D00000", -"R. c #A10000", -"S. c #BEBEC0", -"T. c #ECECED", -"U. c #00BF00", -"V. c #008000", -"W. c #0000AA", -"X. c #00008A", -"Y. c #880088", -"Z. c #E90000", -"`. c #B50000", -" + c #9B0000", -".+ c #BABABD", -"++ c #CCCCCE", -"@+ c #D40000", -"#+ c #9A0000", -"$+ c #950000", -"%+ c #B7B7BA", -"&+ c #00B200", -"*+ c #008C00", -"=+ c #00009C", -"-+ c #000087", -";+ c #DCDCDD", -">+ c #850085", -",+ c #BF0000", -"'+ c #800000", -")+ c #900000", -"!+ c #B4B4B7", -"~+ c #00A500", -"{+ c #008900", -"]+ c #000085", -"^+ c #8F008F", -"/+ c #840084", -"(+ c #C4C4C6", -"_+ c #B0B0B4", -":+ c #009900", -"<+ c #008600", -"[+ c #000083", -"}+ c #D4D4D5", -"|+ c #820082", -"1+ c #C0C0C2", -"2+ c #AA0000", -"3+ c #8A0000", -"4+ c #ADADB0", -"5+ c #008300", -"6+ c #000081", -"7+ c #810081", -"8+ c #BCBCBF", -"9+ c #850000", -"0+ c #AAAAAD", -"a+ c #B8B8BB", -"b+ c #A6A6AA", -"c+ c #D6D6D8", -"d+ c #C7C7C9", -"e+ c #B5B5B8", -"f+ c #A3A3A7", -"g+ c #D2D2D3", -"h+ c #C3C3C5", -"i+ c #B1B1B4", -"j+ c #AFAFB2", -"k+ c #A0A0A4", -" . ", -" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . ", -" @ @ @ @ @ @ @ @ @ @ @ @ @ @ + # # $ $ $ % % % % . ", -" # # # # # # # @ @ @ @ @ @ @ + & * = . % % - - ; ; > > . ", -" $ $ $ $ $ # # # # # @ @ @ @ + , ' ) . ! ~ { ] ^ / ( ( . ", -" % % % % $ $ $ # # # # @ @ @ + _ : < . > ] [ } | 1 2 3 . ", -" - - - % % % $ $ $ # # # @ @ + 4 5 6 . [ ( 7 2 8 9 0 a . ", -" ; ; ; - - % % $ $ $ # # @ @ + b c d . ( 1 e f 0 g h i . ", -" ~ ~ ; ! - j % k $ $ # # @ @ + l m n . 1 3 9 a o i p q . ", -" { { ~ ~ ! ! j % @ + r s t . 3 u g v w x y z . ", -" ^ ^ { { ~ ; ! j A B C . + D = E . 9 g v p F G H I . ", -" / / ^ ] { ~ ; - J K L . + M N O . a h p F P Q R S . ", -" ( ( / ^ ] { ~ ! T U V . + W X X . o w F z Y Z ` . . ", -" 7 7 ( / ^ ] > ; ..+.@. . + ' #.$. . i q G Q Z ` %.&. . ", -" *.*.7 ( / ^ { ~ =.-.;. . + >.,.'. . p ).H R !.~.&.{. . ", -" *.*.7 ( / ^ { ~ ].^./. . + (._.:. . q z I S .&.{.<. . ", -" *. { ~ [.}.|. . + (._.:. . q z I S .&.{.<. . ", -" e 1.2.3. . / 4.5.6. . - 7._.8. . H 9.!.%.0.a.b.c. . ", -" 8 d.e.f. . 1 g.h.5. . [ i._.#. . 9.` %.0.a.b.c.j. . ", -" 9 k.l.m. . 8 n.o.p. . 2 q._.r. . ` s.t.a.u.v.w.x. . ", -" 0 y.z.A. . a B.o.C. . a D._.E. . s. x.F. . ", -" a G.H.I. . h J.o.K. . L. M._.N. . O. P.Q.R. . S. . ", -" T. U.V.H. . p W.o.X. . ). ) _.Y. . <. Z.`. + . .+ . ", -" T. U.V.H. . F ^.o.h. . Q N _.,. . ++ @+#+$+ . %+ . ", -" h &+V.*+ . z =+o.-+ . ;+ O _.>+ . j. ,+'+)+ . !+ . ", -" i ~+V.{+ . Q |.o.]+ . %. ^+_./+ . (+ ,+'+)+ . _+ . ", -" L. :+V.<+ . Z C.o.[+ . }+ E._.|+ . 1+ 2+'+3+ . 4+ . ", -" p *+V.5+ . !. -+o.6+ . <. >+_.7+ . 8+ $+'+9+ . 0+ . ", -" q V.V.V. . . o.o.o. . c. _._._. . a+ '+'+'+ . b+ . ", -" F . c+ . d+ . e+ . f+ . ", -" F z . . . . . t.g+. . . . . h+1+. . . . . i+j+. . . . . k+ . ", -" . "}; - -/* XPM */ -static char * general_xpm[] = { -"32 32 760 2", -" c None", -". c #AFB7C3", -"+ c #ABB5C2", -"@ c #A3B1BF", -"# c #A1AFBE", -"$ c #A0ADBE", -"% c #9FABBD", -"& c #9DA9BC", -"* c #9BA9BB", -"= c #99A7BA", -"- c #97A6B9", -"; c #95A4B9", -"> c #94A2B9", -", c #92A0B8", -"' c #919FB7", -") c #8F9EB7", -"! c #8D9BB6", -"~ c #8B9AB5", -"{ c #8A99B4", -"] c #8897B2", -"^ c #8695B0", -"/ c #8492AC", -"( c #818FA9", -"_ c #7D8BA5", -": c #7A88A2", -"< c #76849E", -"[ c #727F99", -"} c #6E7B94", -"| c #69768E", -"1 c #647187", -"2 c #5E6A82", -"3 c #667184", -"4 c #A0A3A9", -"5 c #ABB6C2", -"6 c #B4BEC9", -"7 c #C2CCD5", -"8 c #C3CCD6", -"9 c #BEC8D4", -"0 c #BEC7D3", -"a c #BCC5D2", -"b c #BBC4D2", -"c c #BAC3D1", -"d c #B9C3D1", -"e c #B7C2D0", -"f c #B6C0D0", -"g c #B5BFCF", -"h c #B3BDCE", -"i c #B0BACD", -"j c #B2BCCF", -"k c #AFBACD", -"l c #AEB8CB", -"m c #ADB7CA", -"n c #ABB5C7", -"o c #A9B3C5", -"p c #A7B0C3", -"q c #A4AEC0", -"r c #A2ACBD", -"s c #9FA9BA", -"t c #9DA5B7", -"u c #99A2B3", -"v c #99A2B1", -"w c #929BAC", -"x c #6F798D", -"y c #9599A0", -"z c #C8D1D9", -"A c #FAFCFE", -"B c #EEF1F6", -"C c #FCFDFF", -"D c #FBFDFE", -"E c #FDFEFF", -"F c #FBFCFE", -"G c #FAFCFD", -"H c #F6F8FB", -"I c #EDF1F5", -"J c #FDFDFF", -"K c #F9FAFD", -"L c #F8FAFD", -"M c #F8FAFC", -"N c #F8F9FC", -"O c #F7F9FD", -"P c #ECEFF6", -"Q c #FAFCFF", -"R c #838D9F", -"S c #7F838C", -"T c #A2B0BE", -"U c #CBD3DC", -"V c #DEE3EB", -"W c #99A5BB", -"X c #F7F8FA", -"Y c #F1F4F7", -"Z c #F1F3F6", -"` c #EDF0F4", -" . c #EEF2F5", -".. c #EFF2F5", -"+. c #EEF1F4", -"@. c #E7EBEE", -"#. c #DADFE4", -"$. c #F0F3F7", -"%. c #EBEEF2", -"&. c #EAEEF2", -"*. c #E9EDF1", -"=. c #E8EBF0", -"-. c #E7EAEF", -";. c #E7E9EE", -">. c #E5E8ED", -",. c #E4E8ED", -"'. c #E3E7ED", -"). c #E2E6EC", -"!. c #E3E6EC", -"~. c #E3E6EB", -"{. c #EAEDF5", -"]. c #8690A1", -"^. c #7B7F88", -"/. c #A0AEBE", -"(. c #C6CFD9", -"_. c #F9FBFD", -":. c #F0F3F6", -"<. c #EFF3F5", -"[. c #F3F6F9", -"}. c #5F6876", -"|. c #CCD0D5", -"1. c #F4F6F8", -"2. c #EDF0F3", -"3. c #ECF0F3", -"4. c #ECF0F4", -"5. c #E5E8EC", -"6. c #D6DADF", -"7. c #EFF3F6", -"8. c #E8ECF0", -"9. c #D0D4DB", -"0. c #C8C8D6", -"a. c #C8C6D7", -"b. c #C7C6D6", -"c. c #C7C7D6", -"d. c #C6C7D5", -"e. c #C7CBD4", -"f. c #DEE3E9", -"g. c #DDE0E7", -"h. c #D4D9E1", -"i. c #F6F8FD", -"j. c #848E9F", -"k. c #7A7F87", -"l. c #9FACBE", -"m. c #C5CDD8", -"n. c #F3F5F7", -"o. c #F0F3F5", -"p. c #F4F7F9", -"q. c #4D5767", -"r. c #C7CCD2", -"s. c #F5F6F9", -"t. c #E4E8EC", -"u. c #D5D9DF", -"v. c #E8EBEF", -"w. c #D6D3E3", -"x. c #8ED287", -"y. c #6CD45A", -"z. c #69C95B", -"A. c #53B949", -"B. c #64B562", -"C. c #CDCCDA", -"D. c #DEE3E8", -"E. c #DDE1E8", -"F. c #F8FAFE", -"G. c #848D9F", -"H. c #7A7E87", -"I. c #9EAABD", -"J. c #C4CCD8", -"K. c #535C6C", -"L. c #C9CED3", -"M. c #ECEFF3", -"N. c #EDEFF4", -"O. c #EFF3F7", -"P. c #E9ECF1", -"Q. c #E1DBEE", -"R. c #6DCD64", -"S. c #60E03C", -"T. c #83EE59", -"U. c #48CB2D", -"V. c #39A834", -"W. c #DAD6E5", -"X. c #DFE3E9", -"Y. c #DEE2E8", -"Z. c #DCE0E7", -"`. c #838D9E", -" + c #797E87", -".+ c #9CA9BC", -"++ c #C3CBD7", -"@+ c #F1F3F7", -"#+ c #F7FAFC", -"$+ c #535D6C", -"%+ c #CBD1D5", -"&+ c #F8FBFC", -"*+ c #F1F4F6", -"=+ c #E6E8ED", -"-+ c #D7DBE0", -";+ c #ECE5F6", -">+ c #60BE5E", -",+ c #5BD93D", -"'+ c #95FF6A", -")+ c #50D336", -"!+ c #359E33", -"~+ c #E5E1EE", -"{+ c #E0E3EA", -"]+ c #DEE2E9", -"^+ c #DCE1E8", -"/+ c #F9FBFF", -"(+ c #838C9D", -"_+ c #797E86", -":+ c #9AA8BB", -"<+ c #C2CAD7", -"[+ c #E1E5EA", -"}+ c #E2E6EB", -"|+ c #E5EAEE", -"1+ c #535F6E", -"2+ c #BEC4CC", -"3+ c #E6E9EE", -"4+ c #DFE3E8", -"5+ c #E6E9ED", -"6+ c #D8DCE0", -"7+ c #F0F4F7", -"8+ c #E8ECF1", -"9+ c #F6EFFE", -"0+ c #55B254", -"a+ c #20B711", -"b+ c #44D830", -"c+ c #1CB110", -"d+ c #2D962B", -"e+ c #EFEBF8", -"f+ c #E1E4EB", -"g+ c #DDE2E9", -"h+ c #828B9D", -"i+ c #797D86", -"j+ c #98A7BA", -"k+ c #C1CBD6", -"l+ c #DBE1E7", -"m+ c #B2B9C5", -"n+ c #B4BBC7", -"o+ c #6A7587", -"p+ c #9FA8B6", -"q+ c #B3BAC8", -"r+ c #ACB4C3", -"s+ c #C6CCD6", -"t+ c #E8EBEE", -"u+ c #D8DCE1", -"v+ c #F1F4F8", -"w+ c #E9EDF2", -"x+ c #FCF5FF", -"y+ c #5EB65F", -"z+ c #048D02", -"A+ c #0F8B0F", -"B+ c #058506", -"C+ c #3B9D3C", -"D+ c #F7F2FC", -"E+ c #DEE2EA", -"F+ c #818A9B", -"G+ c #787C85", -"H+ c #96A5B9", -"I+ c #C2CBD7", -"J+ c #C0C8D2", -"K+ c #F3F7F9", -"L+ c #EEF2F7", -"M+ c #EAEFF4", -"N+ c #ECF0F6", -"O+ c #ECF0F7", -"P+ c #F1F4FA", -"Q+ c #CDD3DD", -"R+ c #C2C8D2", -"S+ c #ECEEF2", -"T+ c #D8DDE2", -"U+ c #F2F4F9", -"V+ c #EBEEF3", -"W+ c #EAEEF3", -"X+ c #EBEDF2", -"Y+ c #E7ECEC", -"Z+ c #E8EFEC", -"`+ c #EBF1EE", -" @ c #E9EFED", -".@ c #E7EDEC", -"+@ c #E3E7EE", -"@@ c #E2E6ED", -"#@ c #E0E4EB", -"$@ c #FBFEFF", -"%@ c #80899B", -"&@ c #777C85", -"*@ c #95A3B9", -"=@ c #C2CBD8", -"-@ c #B6BDC9", -";@ c #F9FDFF", -">@ c #EBF0F3", -",@ c #E7ECF1", -"'@ c #D9DDE3", -")@ c #ECEFF4", -"!@ c #EBEFF4", -"~@ c #EEF1F7", -"{@ c #F1F2F9", -"]@ c #F0F1F9", -"^@ c #F0F1F8", -"/@ c #EDEFF6", -"(@ c #E7EAF1", -"_@ c #E4E8EF", -":@ c #E3E8EE", -"<@ c #FCFFFF", -"[@ c #7F889A", -"}@ c #777B84", -"|@ c #93A2B9", -"1@ c #C0C9D7", -"2@ c #F5F7FA", -"3@ c #A8B1C2", -"4@ c #A7B0C0", -"5@ c #A5AFBF", -"6@ c #848E9E", -"7@ c #99A2B2", -"8@ c #9FA7B8", -"9@ c #9AA3B4", -"0@ c #939CAC", -"a@ c #B7BEC7", -"b@ c #D9DEE4", -"c@ c #F2F5F9", -"d@ c #EDF0F5", -"e@ c #DBE0E6", -"f@ c #D5D8DC", -"g@ c #D6D7DB", -"h@ c #D5D6DB", -"i@ c #D7D6DA", -"j@ c #D7D7DB", -"k@ c #D4D9E2", -"l@ c #E6EAF1", -"m@ c #E4E9EF", -"n@ c #E3E7EF", -"o@ c #FDFFFF", -"p@ c #7E8698", -"q@ c #767A83", -"r@ c #92A0B9", -"s@ c #BDC6D6", -"t@ c #FFFFFF", -"u@ c #DCE0E8", -"v@ c #8C98AD", -"w@ c #919CB2", -"x@ c #929DB2", -"y@ c #3F4C60", -"z@ c #788397", -"A@ c #8B95AA", -"B@ c #838EA2", -"C@ c #858FA0", -"D@ c #B5BCC6", -"E@ c #DADFE5", -"F@ c #F4F6FA", -"G@ c #EFF2F7", -"H@ c #D7D9DE", -"I@ c #AEC8E0", -"J@ c #A0C3E6", -"K@ c #9FBDE1", -"L@ c #8FB6DE", -"M@ c #95B9DA", -"N@ c #D0D3DA", -"O@ c #E9EDF3", -"P@ c #E7EBF2", -"Q@ c #E5E9F2", -"R@ c #FEFFFF", -"S@ c #7C8597", -"T@ c #757A82", -"U@ c #919EB8", -"V@ c #BCC5D5", -"W@ c #ECEEF4", -"X@ c #C1C8D6", -"Y@ c #C2C9D7", -"Z@ c #C4CCD9", -"`@ c #434F5F", -" # c #9DA6B4", -".# c #BDC4D1", -"+# c #B5BCC8", -"@# c #ADB4C1", -"## c #C5CBD4", -"$# c #EDF1F6", -"%# c #F3F5FA", -"&# c #ECEFF5", -"*# c #E0DDDF", -"=# c #87BDF4", -"-# c #76C2FF", -";# c #86CCFC", -"># c #58B0F5", -",# c #53A0E6", -"'# c #D9D8DC", -")# c #E5E9F1", -"!# c #E4E8F0", -"~# c #E2E6F0", -"{# c #7C8596", -"]# c #757982", -"^# c #909DB7", -"/# c #BCC4D4", -"(# c #F3F5F9", -"_# c #F7F9FC", -":# c #FBFDFF", -"<# c #5B6876", -"[# c #D0D5DB", -"}# c #F5F7FB", -"|# c #D3D8DE", -"1# c #EEF1F5", -"2# c #E3E7EC", -"3# c #E2E5EA", -"4# c #E2E5EB", -"5# c #E2E0DF", -"6# c #6EA4EC", -"7# c #73C6FC", -"8# c #AAFDFF", -"9# c #69C6F6", -"0# c #458BDB", -"a# c #DBDBDD", -"b# c #D9DEE6", -"c# c #D8DDE6", -"d# c #D6DCE6", -"e# c #F8FBFF", -"f# c #7B8596", -"g# c #8E9BB6", -"h# c #BBC3D4", -"i# c #F2F6FA", -"j# c #5A6776", -"k# c #C6CCD3", -"l# c #E4E6EB", -"m# c #DCDFE5", -"n# c #CFD4DA", -"o# c #DEE2E7", -"p# c #DDE1E6", -"q# c #EBE8E5", -"r# c #5B93DF", -"s# c #43A8F0", -"t# c #78E7FF", -"u# c #43AFEF", -"v# c #3779CE", -"w# c #E4E3E5", -"x# c #D5DBE4", -"y# c #D3DAE3", -"z# c #D1D8E2", -"A# c #F5F9FF", -"B# c #7B8496", -"C# c #8C9BB5", -"D# c #BAC3D3", -"E# c #EAEDF2", -"F# c #5A6877", -"G# c #C2CAD0", -"H# c #E9EDF0", -"I# c #E3E7EB", -"J# c #E3E6EA", -"K# c #DBDEE4", -"L# c #CED3D9", -"M# c #DDE1E7", -"N# c #DCE0E5", -"O# c #F6F1ED", -"P# c #4D87D3", -"Q# c #0051C5", -"R# c #065EC6", -"S# c #0050BC", -"T# c #296AC1", -"U# c #F0EEEF", -"V# c #D5DBE5", -"W# c #D3DBE6", -"X# c #D1D9E4", -"Y# c #F6F9FF", -"Z# c #B7C0D2", -"`# c #F7F9FB", -" $ c #E5E9ED", -".$ c #E7EBEF", -"+$ c #5B6978", -"@$ c #C2C9D0", -"#$ c #E9ECEF", -"$$ c #DADEE3", -"%$ c #CED2D9", -"&$ c #DDE0E6", -"*$ c #DBDFE5", -"=$ c #E7E8EA", -"-$ c #BECFE5", -";$ c #A9C1E4", -">$ c #AEC4E5", -",$ c #ABC2E3", -"'$ c #B7CAE4", -")$ c #D4DCE7", -"!$ c #D3DCE7", -"~$ c #D1DAE5", -"{$ c #F6FAFF", -"]$ c #8998B3", -"^$ c #B6BFD0", -"/$ c #F4F6F9", -"($ c #E2E6EA", -"_$ c #E3E8EB", -":$ c #5B6A78", -"<$ c #C2C8CF", -"[$ c #E2E5E9", -"}$ c #E1E4E9", -"|$ c #DADDE3", -"1$ c #CDD2D9", -"2$ c #E7EBF1", -"3$ c #DDE0E5", -"4$ c #DDE2E7", -"5$ c #E9EAEC", -"6$ c #F2F0F0", -"7$ c #F2F2F2", -"8$ c #F1F2F3", -"9$ c #EAEDF0", -"0$ c #D9E0EA", -"a$ c #D4DDE8", -"b$ c #D3DDE9", -"c$ c #D0DAE7", -"d$ c #F6FBFF", -"e$ c #8897B1", -"f$ c #B5BED0", -"g$ c #5D6B79", -"h$ c #C2C7CF", -"i$ c #E0E4E9", -"j$ c #E0E3E8", -"k$ c #CCD1D8", -"l$ c #E7EAF0", -"m$ c #D2D7DF", -"n$ c #CBD4DE", -"o$ c #C8D4DF", -"p$ c #C7D4DF", -"q$ c #C7D5E1", -"r$ c #C7D5E2", -"s$ c #CCD4E1", -"t$ c #D4DEEA", -"u$ c #D3DDEA", -"v$ c #D0DBE9", -"w$ c #F6FCFF", -"x$ c #8694AF", -"y$ c #B4BDCE", -"z$ c #E1E5E9", -"A$ c #5E6C7A", -"B$ c #C1C7CE", -"C$ c #D8DCE2", -"D$ c #CCD1D7", -"E$ c #E6EAEF", -"F$ c #DBDEE5", -"G$ c #C2C9D3", -"H$ c #BDB8C3", -"I$ c #C0B4BF", -"J$ c #BFB2BE", -"K$ c #BDACB8", -"L$ c #BAAEBA", -"M$ c #BBC6D4", -"N$ c #D5DFEC", -"O$ c #D3DDEC", -"P$ c #D0DCEB", -"Q$ c #B2BCCD", -"R$ c #E4E7EB", -"S$ c #5F6D7B", -"T$ c #C0C7CE", -"U$ c #DDE2E8", -"V$ c #D7DBE1", -"W$ c #CBD0D6", -"X$ c #E5E9EF", -"Y$ c #DADEE4", -"Z$ c #DADEE5", -"`$ c #DBDFE7", -" % c #C2D1DB", -".% c #EAA0A4", -"+% c #FF9191", -"@% c #FA8C8B", -"#% c #F26565", -"$% c #DF686C", -"%% c #BFD1DF", -"&% c #D3DFEE", -"*% c #D2DEEE", -"=% c #CFDCED", -"-% c #F7FDFF", -";% c #B0BACA", -">% c #F3F6F8", -",% c #DFE2E7", -"'% c #5F6E7C", -")% c #C0C6CD", -"!% c #DEE1E7", -"~% c #D6DAE0", -"{% c #CACFD6", -"]% c #D9DDE4", -"^% c #D9DDE5", -"/% c #D9DFE7", -"(% c #CCDDE5", -"_% c #E78386", -":% c #FE8A87", -"<% c #FFAEAC", -"[% c #F27171", -"}% c #D3595C", -"|% c #CADCE9", -"1% c #D2DFEF", -"2% c #D0DEEF", -"3% c #7E8CA6", -"4% c #AEB8C9", -"5% c #E1E6EA", -"6% c #5F6F7D", -"7% c #BFC6CD", -"8% c #DCE0E6", -"9% c #D6D9DF", -"0% c #C9CED5", -"a% c #E4E9EE", -"b% c #D8DDE3", -"c% c #D8DDE5", -"d% c #D7DDE6", -"e% c #D7E8F0", -"f% c #D77071", -"g% c #F06361", -"h% c #FF9190", -"i% c #EC5D5D", -"j% c #C34F51", -"k% c #D6E7F3", -"l% c #D2E0F0", -"m% c #D1E0F1", -"n% c #CFDFF1", -"o% c #F7FEFF", -"p% c #7B88A2", -"q% c #ACB6C7", -"r% c #DCE1E6", -"s% c #DDE2E6", -"t% c #606E7D", -"u% c #BFC5CC", -"v% c #E1E4EA", -"w% c #DBDFE4", -"x% c #D4D8DE", -"y% c #C8CED4", -"z% c #E3E8EF", -"A% c #D7DDE3", -"B% c #D7DDE5", -"C% c #E2F2F9", -"D% c #CA6062", -"E% c #C51F1F", -"F% c #CE3737", -"G% c #BE2120", -"H% c #B64042", -"I% c #E1F2FC", -"J% c #D1E1F3", -"K% c #CFDFF3", -"L% c #77859E", -"M% c #AAB3C4", -"N% c #E0E3E7", -"O% c #E0E3E9", -"P% c #586776", -"Q% c #BCC2CA", -"R% c #D3D7DE", -"S% c #C7CDD4", -"T% c #E3E9EE", -"U% c #D7DCE3", -"V% c #D7DDE4", -"W% c #D6DCE5", -"X% c #E2EDF4", -"Y% c #D39EA3", -"Z% c #C97073", -"`% c #CA7678", -" & c #C67374", -".& c #CB9094", -"+& c #E2EFF9", -"@& c #D0E0F3", -"#& c #D1E1F4", -"$& c #D2E4F9", -"%& c #F8FFFF", -"&& c #74819A", -"*& c #A9B2C2", -"=& c #C5CBD5", -"-& c #7B8793", -";& c #C2C8D0", -">& c #D1D5DD", -",& c #C6CBD3", -"'& c #E2E7ED", -")& c #D6DAE2", -"!& c #D5DBE3", -"~& c #D4DCE5", -"{& c #D8DEE7", -"]& c #DFECF5", -"^& c #E7F8FF", -"/& c #ECFBFF", -"(& c #EAFBFF", -"_& c #E3F3FE", -":& c #D7E2F0", -"<& c #D0E2F6", -"[& c #BCCEE4", -"}& c #F4FBFF", -"|& c #7C8697", -"1& c #717C96", -"2& c #AAB2C2", -"3& c #D9DEE7", -"4& c #919CB1", -"5& c #DCDFE6", -"6& c #D4D8DF", -"7& c #D8DEE6", -"8& c #D7DFE8", -"9& c #D7DEEA", -"0& c #D6DFEA", -"a& c #D5DFEE", -"b& c #D4E0F0", -"c& c #D3E1F2", -"d& c #D4E3F4", -"e& c #D5E4F6", -"f& c #D5E6F9", -"g& c #94A0B5", -"h& c #ECF2F9", -"i& c #7E8899", -"j& c #6D7891", -"k& c #A0A8B9", -"l& c #EEF0F6", -"m& c #EFF1F7", -"n& c #EFF2F8", -"o& c #EFF3F8", -"p& c #EDF1F7", -"q& c #E9EDF4", -"r& c #F5F8FB", -"s& c #F0F4F9", -"t& c #F0F4FA", -"u& c #F1F5FB", -"v& c #F1F5FC", -"w& c #F1F6FC", -"x& c #F2F7FD", -"y& c #F2F7FE", -"z& c #F2F8FE", -"A& c #F3F9FE", -"B& c #F3F9FF", -"C& c #F6FDFF", -"D& c #788395", -"E& c #767F94", -"F& c #7E889D", -"G& c #929CAE", -"H& c #9EA8B8", -"I& c #9CA6B6", -"J& c #9BA5B5", -"K& c #9AA4B4", -"L& c #9AA2B3", -"M& c #98A0B1", -"N& c #979FB0", -"O& c #959EAE", -"P& c #949CAD", -"Q& c #929AAA", -"R& c #929AA9", -"S& c #8F98A8", -"T& c #8E96A5", -"U& c #8D95A4", -"V& c #8D96A5", -"W& c #8D97A6", -"X& c #8E97A6", -"Y& c #9099A8", -"Z& c #7F8999", -"`& c #5D697B", -" * c #7E8289", -".* c #A9ABB1", -"+* c #9FA2A8", -"@* c #90949A", -"#* c #91949A", -"$* c #909399", -"%* c #8F9399", -"&* c #8F9398", -"** c #909298", -"=* c #8F9297", -"-* c #8F9197", -";* c #8E9197", -">* c #8E9096", -",* c #8D9096", -"'* c #8D8F95", -")* c #8C8F94", -"!* c #8B8E94", -"~* c #8B8D93", -"{* c #8A8D92", -"]* c #8A8D93", -"^* c #8B8E93", -"/* c #85888D", -"(* c #83878C", -"_* c #959697", -". + @ # $ % & * = - ; > , ' ) ! ~ { ] ^ / ( _ : < [ } | 1 2 3 4 ", -"5 6 7 8 9 0 a b c d e f g h i j i k l m n o p q r s t u v w x y ", -"@ z A B C D A E D F G G G H I J K L M M L K L L N N N O P Q R S ", -"T U V W X Y Z ` ...+.+.+.@.#.$.%.&.*.=.-.;.>.,.'.).!.~.W {.].^.", -"/.(._.=.:.<.[.}.|.1.2.3.4.5.6.7.8.-.=.9.0.a.b.c.d.e.f.g.h.i.j.k.", -"l.m.E n.:.o.p.q.r.s.2.3.4.t.u.7.8.v.8.w.x.y.z.A.B.C.D.E.g.F.G.H.", -"I.J.C :.:.:.p.K.L.p.2.M.N.>.6.O.P.=.=.Q.R.S.T.U.V.W.X.Y.Z.F.`. +", -".+++C @+[.[.#+$+%+&+*+..` =+-+$.P.=.=.;+>+,+'+)+!+~+{+]+^+/+(+_+", -":+<+E 2.[+}+|+1+2+3+4+3+..5+6+7+*.8+8+9+0+a+b+c+d+e+f+{+g+Q h+i+", -"j+k+D l+. m+n+o+p+q+r+s+%.t+u+v+&.w+8+x+y+z+A+B+C+D+).f+E+Q F+G+", -"H+I+M.J+K+$.L+M+N+O+P+Q+R+S+T+U+V+W+w+X+Y+Z+`+ @.@v.+@@@#@$@%@&@", -"*@=@=.-@;@>@,@W++@]+g+-@n++.'@U+)@V+W+!@~@{@]@^@/@(@_@:@@@<@[@}@", -"|@1@2@s+3@4@5@6@7@8@9@0@a@ .b@c@d@)@d@e@f@g@h@i@j@k@l@m@n@o@p@q@", -"r@s@t@u@v@w@x@y@z@A@B@C@D@O.E@F@~@B G@H@I@J@K@L@M@N@O@P@Q@R@S@T@", -"U@V@t@W@X@Y@Z@`@ #.#+#@###$#b@%#&#V+&#*#=#-#;#>#,#'#)#!#~#o@{#]#", -"^#/#R@(#_#_#:#<#[#:#}#%#$.,.|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#T@", -"g#h#R@c@c@U+i#j#k#` t.~.l#m#n#*.4+o#p#q#r#s#t#u#v#w#x#y#z#A#B#T@", -"C#D#E ` E#-.E#F#G#H#I#~.J#K#L#P.Y.M#N#O#P#Q#R#S#T#U#V#W#X#Y#B#T@", -"{ Z#`# $ $t..$+$@$#$J#3#3#$$%$8.M#&$*$=$-$;$>$,$'$2#)$!$~${$f#T@", -"]$^$/$($I#_$.$:$<$t+[$}$}$|$1$2$&$3$E@4$5$6$7$8$9$0$a$b$c$d$f#T@", -"e$f$/$($I#~.;.g$h$3+i$j$i$'@k$l$&$m#*$m$n$o$p$q$r$s$t$u$v$w$f#T@", -"x$y$/$z$($3#>.A$B$>.4+4+4+C$D$E$m#F$Z.G$H$I$J$K$L$M$N$O$P$w$f#]#", -"/ Q$[.j$}$}$R$S$T$t.Y.U$o#V$W$X$Y$Z$`$ %.%+%@%#%$%%%&%*%=%-%f#]#", -"( ;%>%,%4+4+I#'%)%2#4$p#!%~%{%X$]%^%/%(%_%:%<%[%}%|%&%1%2%-%f#]#", -"3%4%[.4$Y.o#5%6%7%4#&$N#8%9%0%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%f#]#", -"p%q%c@r%M#s%}$t%u%v%m#w%*$x%y%z%A%B%d#C%D%E%F%G%H%I%m%J%K%o%f#]#", -"L%M%[.N%N#&$O%P%Q%O%Y$Y$Y$R%S%T%U%V%W%X%Y%Z%`% &.&+&@&#&$&%&f#]#", -"&&*&W+=&m#K#&$-&;&&$C$C$b%>&,&'&)&!&~&{&]&^&/&(&_&:&@&<&[&}&|&]#", -"1&2&3&4&i$5&m#[+p#E@E@Z$E@6&{%_@c%7&8&9&0&N$a&b&c&d&e&f&g&h&i&]#", -"j&k&U+l&m&G@G@n&n&n&n&o&o&p&q&r&s&s&t&u&v&w&x&y&y&z&A&B&z&C&D&T@", -"E&F&G&H&I&J&K&9@L&v M&N&O&P&Q&R&S&T&U&V&V&V&V&V&W&W&X&X&Y&Z&`& *", -".*+*@*#*$*$*%*&***=*-*;*>*,*'*)*!*~*{*{*{*{*{*{*{*]*]*]*^*/*(*_*"}; - -/* XPM */ -static char * swap_columns_xpm[] = { -"10 12 2 1", -" c None", -". c #000000", -" . ", -" .. ", -"..........", -"..........", -" .. ", -" . ", -" . ", -" .. ", -"..........", -"..........", -" .. ", -" . "}; - -/* XPM */ -static char * resize_xpm[] = { -"16 15 28 1", -" c None", -". c #010000", -"+ c #0000FC", -"@ c #B7C5D5", -"# c #859DB7", -"$ c #8AA0BA", -"% c #8EA4BD", -"& c #93A8C0", -"* c #98ACC2", -"= c #BBC8D7", -"- c #8AA1BA", -"; c #8FA5BD", -"> c #94A9C0", -", c #99ADC3", -"' c #9EB1C6", -") c #000000", -"! c #B2C1D2", -"~ c #90A6BE", -"{ c #95AAC1", -"] c #9AAEC3", -"^ c #9FB1C6", -"/ c #A5A38C", -"( c #A19F89", -"_ c #9E9C87", -": c #AAA790", -"< c #B0AD95", -"[ c #92907C", -"} c #878573", -"........ ", -".++++++. ", -"........ ", -".@#$%&*. ", -".=-;>,'. ) ) ) )", -".!~{]^.. ", -"......../ )", -" ()/ ", -" ) _): )", -" _)< ", -" ) ()[) )", -" })) ", -" ) ))) )", -" ", -" ) ) ) ) ) ) )"}; - -static char* newfolder_xpm[] = { - "15 14 4 1", - " c None", - ". c #000000", - "+ c #FFFF00", - "@ c #FFFFFF", - " . ", - " ", - " . ", - " . . ", - " .... . . . ", - " .+@+@. . . ", - ".......... . .", - ".@+@+@+@+@.. ", - ".+@+@+@+@+. . ", - ".@+@+@+@+@. . ", - ".+@+@+@+@+. ", - ".@+@+@+@+@. ", - ".+@+@+@+@+. ", - "........... "}; - -static char* folder_open_xpm[]={ - "16 16 11 1", - "# c #000000", - "g c #c0c0c0", - "e c #303030", - "a c #ffa858", - "b c #808080", - "d c #a0a0a4", - "f c #585858", - "c c #ffdca8", - "h c #dcdcdc", - "i c #ffffff", - ". c None", - "....###.........", - "....#ab##.......", - "....#acab####...", - "###.#acccccca#..", - "#ddefaaaccccca#.", - "#bdddbaaaacccab#", - ".eddddbbaaaacab#", - ".#bddggdbbaaaab#", - "..edgdggggbbaab#", - "..#bgggghghdaab#", - "...ebhggghicfab#", - "....#edhhiiidab#", - "......#egiiicfb#", - "........#egiibb#", - "..........#egib#", - "............#ee#"}; - -/* XPM */ -static char * note_xpm[] = { -"16 16 28 1", -" c None", -". c #3F3F3F", -"+ c #000000", -"@ c #303030", -"# c #609F9F", -"$ c #60DFDF", -"% c #30AFAF", -"& c #00AFAF", -"* c #305F5F", -"= c #202020", -"- c #308F8F", -"; c #909090", -"> c #404040", -", c #306F6F", -"' c #30DFDF", -") c #C0C0C0", -"! c #A0A0A0", -"~ c #BFBFBF", -"{ c #707070", -"] c #DFDFDF", -"^ c #808080", -"/ c #30CFCF", -"( c #204F4F", -"_ c #606060", -": c #FFFFFF", -"< c #505050", -"[ c #6F6F6F", -"} c #CFCFCF", -" .+..+..+.+ ", -" @#$%#$%#$&*=", -" +%$$$$$$$$-;>", -" @$$,,,,,$'*)>", -" +%$#,,,,%$-;)>", -" @$$$$$$$$'*!~>", -" +%$$$$$$$$-{!~>", -" @$$$$$$$$'*)]]>", -"+%$$$$$$$$-^!~~>", -"+////////-(!!~~>", -" ++++@___;))]:]>", -" ", -" ", -" []]]]]:::}>", -" +^!!!!!!!;=", -" +++++++++ "}; - -/* XPM */ -static char * new_note_xpm[] = { -"15 16 6 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #C2BFA5", -"# c #00FFFF", -"$ c #030003", -".......... ", -".++++++++.. ", -".++++++++.@. ", -".++++++++.@@. ", -".++++++++.@@@. ", -".++++++++..... ", -".++++......... ", -".+++.#@#@#@#@#.", -".+++.@#....@#..", -".++.@#@#@#@#.+.", -".++.#@....#@.+.", -".+.@@#@#@#@.++.", -".+.@#@#@#@#.++.", -".++........+++.", -".++++.++++++++.", -"..............$"}; - -/* XPM */ -static char * new_graph_xpm[] = { -"14 16 5 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #A0A7AF", -"# c #FF0000", -".......... ", -".++++++++.. ", -".++++++++.@. ", -".+..+++++.@@. ", -".++.+++++.....", -".++.+++++++++.", -".+..++##+++#+.", -".++.+#++#++#+.", -".++.+#++#++#+.", -".+..#++++##++.", -".++.#++++++++.", -".++.#++++++++.", -".+..........+.", -".++.++.++.+++.", -".++++++++++++.", -".............."}; - -/* XPM */ -static char * vectXYAM_xpm[] = { -"15 15 2 1", -" c None", -". c #882F2A", -" ... .. ", -" .. .. ", -" . . . ", -" . . ", -" . ", -" . ", -" . ", -" . ", -" . ", -" ... ... ", -" .. . ", -" . . . ", -" . . ", -" . ", -" "}; - -static char * vectXYXY_xpm[] = { -"15 15 3 1", -" c None", -". c #080000", -"+ c #7B1616", -" . ", -" . ", -" +++ . ", -" ++ . ", -" + + . ", -". + + .", -" . + ", -" . + ", -" + ", -" + ", -" + + ", -" ++ ", -" . +++ ", -" . ", -" . "}; - -/* XPM */ -static char * open_template_xpm[] = { -"15 16 7 1", -" c None", -". c #000000", -"+ c #E1E0D2", -"@ c #FFFF00", -"# c #808000", -"$ c #FFFFFF", -"% c #030003", -" ... ", -" . . .", -" ... ..", -".+@+....... ...", -".@+@+@+@+@. ", -".+@+@+@+@+. ", -".@+@+..........", -".+@+.#########.", -".@+............", -".+..$$$$$$$$$$.", -"..#.$%$$$$$$$$.", -"....$%$$$$$$$$.", -" .$%$%$$%$$$.", -" .$%%%%%%%%$.", -" .$$$$$$$$$$.", -" ............"}; - -/* XPM */ -static char * save_template_xpm[] = { -"17 16 83 1", -" c None", -". c #030003", -"+ c #AEC9E4", -"@ c #84808A", -"# c #ECA898", -"$ c #EEA493", -"% c #E69D91", -"& c #E69E94", -"* c #E29E91", -"= c #DF9689", -"- c #DE9488", -"; c #DB9287", -"> c #C28985", -", c #83909E", -"' c #728A9D", -") c #A3BEDA", -"! c #7E7784", -"~ c #D89187", -"{ c #D88B83", -"] c #D78B83", -"^ c #D78C83", -"/ c #CD837C", -"( c #D0827B", -"_ c #D2867C", -": c #CD796F", -"< c #B67977", -"[ c #778293", -"} c #516B7D", -"| c #9EBDD4", -"1 c #878D93", -"2 c #FFFFFF", -"3 c #E4E4E4", -"4 c #7B8998", -"5 c #4E687B", -"6 c #A0BBD2", -"7 c #82878D", -"8 c #DDDEDD", -"9 c #C0C1C0", -"0 c #7E8B98", -"a c #4C6374", -"b c #9AB9D2", -"c c #80858B", -"d c #7E8A98", -"e c #475F70", -"f c #95B7CF", -"g c #81888D", -"h c #C5C5C5", -"i c #4E606D", -"j c #99B8CE", -"k c #838088", -"l c #D4D3D4", -"m c #D3D2D3", -"n c #D0D1D2", -"o c #D1D1D1", -"p c #BEBEBF", -"q c #7A8A99", -"r c #4B5B65", -"s c #91B1CB", -"t c #7E97AB", -"u c #7E90A2", -"v c #7C8D9D", -"w c #000000", -"x c #90AECA", -"y c #6D90A9", -"z c #637380", -"A c #697075", -"B c #8DADC7", -"C c #67859B", -"D c #797B7D", -"E c #D5D4D2", -"F c #8BABC5", -"G c #6A8399", -"H c #888889", -"I c #E6E1E0", -"J c #7B99AE", -"K c #647E93", -"L c #7F8081", -"M c #D7D6D6", -"N c #838072", -"O c #4C5E6B", -"P c #646A6D", -"Q c #A8A39D", -"R c #838071", -"............... ", -".+@#$%&*=-;>,'. ", -".)!~{]^/(_:<[}. ", -".|122222222345. ", -".678888888890a. ", -".bc222222223de. ", -".fg88888888h4i. ", -".jklmmmnommpqr. ", -".stuvwwwwwwwwwwww", -".xyzAw2222222222w", -".BCDEw2.22222222w", -".FGHIw2.22222222w", -".JKLMw2.2.22.222w", -"N.OPQw2........2w", -" R....2222222222w", -" wwwwwwwwwwww"}; - -/* XPM */ -static char * boxPlot_xpm[] = { -"16 16 2 1", -" c None", -". c #1F0E77", -" ", -" ", -" ....... ", -" . ", -" . ", -" .............. ", -" . . ", -" . . ", -" . . ", -" .............. ", -" . . ", -" .............. ", -" . ", -" . ", -" ....... ", -" "}; - -static char * clock_xpm[] = { -"17 17 57 1", -" c None", -". c #808080", -"+ c #FFFFFF", -"@ c #DDDDAC", -"# c #C8C8A8", -"$ c #000000", -"% c #000080", -"& c #B8B8A6", -"* c #ACACA5", -"= c #F4F4AF", -"- c #EFEFAE", -"; c #EAEAAD", -"> c #E0E0AC", -", c #DBDBAB", -"' c #D6D6AA", -") c #E4E4AC", -"! c #DFDFAB", -"~ c #D2D2A9", -"{ c #CECEA9", -"] c #CACAA8", -"^ c #E5E5AD", -"/ c #DADAAB", -"( c #D5D5AA", -"_ c #CDCDA9", -": c #C7C7A8", -"< c #C4C4A7", -"[ c #E1E1AC", -"} c #D0D0A9", -"| c #C3C3A7", -"1 c #C1C1A7", -"2 c #BDBDA6", -"3 c #BBBBA6", -"4 c #D7D7AB", -"5 c #D1D1AA", -"6 c #CBCBA9", -"7 c #C6C6A8", -"8 c #C0C0A7", -"9 c #B6B6A6", -"0 c #BBBBA7", -"a c #BABAA6", -"b c #B9B9A6", -"c c #B7B7A6", -"d c #BEBEA7", -"e c #B4B4A6", -"f c #B3B3A5", -"g c #B2B2A5", -"h c #B1B1A5", -"i c #B0B0A5", -"j c #B5B5A6", -"k c #ADADA5", -"l c #ABABA5", -"m c #ADADA4", -"n c #A9A9A4", -"o c #A6A6A4", -"p c #A5A5A4", -"q c #A3A3A4", -"r c #A0A0A4", -" ..... ", -" ..+++++.. ", -" .++@#$@#++. ", -" .+#%&$$$*%@+$ ", -" .+&*=-;$>,'&*+$ ", -" .+%-;)!$'~{]%+$ ", -".+@#^>/($_]:<@#+$", -".+&[,(}]$|1$23*+$", -".+%45678$$$$$9%+$", -".+@456780ab$c9#+$", -".+&*#|dbefghi&*+$", -" .+%dajhk**ll%+$ ", -" .+@#hmnoppp@#+$ ", -" .+*%@qrr#%&+$ ", -" .$++&*%&*++$ ", -" $$+++++$$ ", -" $$$$$ "}; - -static char * matrix_xpm[] = { -"13 12 20 1", -" c None", -". c #000821", -"+ c #000720", -"@ c #000927", -"# c #000C39", -"$ c #000C37", -"% c #000929", -"& c #00041B", -"* c #000519", -"= c #597384", -"- c #5A7387", -"; c #00061E", -"> c #4C7799", -", c #517595", -"' c #000212", -") c #000209", -"! c #000207", -"~ c #00030C", -"{ c #010101", -"] c #FFFF80", -".++@#$%++%#$&", -"*=-;>>;==;>,'", -")!))~~~!))~){", -"{]]{]]{]]{]]{", -"{]]{]]{]]{]]{", -"{{{{{{{{{{{{{", -"{]]{]]{]]{]]{", -"{]]{]]{]]{]]{", -"{{{{{{{{{{{{{", -"{]]{]]{]]{]]{", -"{]]{]]{]]{]]{", -"{{{{{{{{{{{{{"}; - - -static char * new_matrix_xpm[] = { -"15 16 6 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #8F888F", -"# c #2007F0", -"$ c #FFFF80", -".......... ", -".++++++++.. ", -".++++++++.@. ", -".++++++++.@@. ", -".++++++++.@@@. ", -".++++++++..... ", -".++++++++++++. ", -".+.............", -".+.##.##.##.##.", -".+.............", -".+.$$.$$.$$.$$.", -".+.$$.$$.$$.$$.", -".+.............", -".+.$$.$$.$$.$$.", -".+.$$.$$.$$.$$.", -"..............."}; - -static char * prev_xpm[] = { -"16 17 27 1", -" c None", -". c #000000", -"+ c #BDD3BD", -"@ c #B5CBB5", -"# c #B5C7B5", -"$ c #B5CFB5", -"% c #BDCFB5", -"& c #BDCFBD", -"* c #7BAA7B", -"= c #ADC7AD", -"- c #B5CBAD", -"; c #ADC7A5", -"> c #6B8263", -", c #292C29", -"' c #ADCBAD", -") c #B5C7AD", -"! c #638E63", -"~ c #9CAE9C", -"{ c #84AE84", -"] c #84B284", -"^ c #8CAE84", -"/ c #8CB284", -"( c #527152", -"_ c #395131", -": c #5A7952", -"< c #4A6142", -"[ c #425539", -" . ", -" .. ", -" .+. ", -" .@#. ", -" .@@#........", -" .@@$$%+%&+@*.", -" .@=@@-=====;>.", -" ,@')=='===)='!.", -".~{{{{{{]^{]/{(.", -" ._:::::::::::<.", -" ._::::::::::<.", -" ._::<______[.", -" ._:<........", -" ._<. ", -" .<. ", -" .. ", -" . "}; - -static char * next_xpm[] = { -"16 17 26 1", -" c None", -". c #000000", -"+ c #8CA684", -"@ c #BAD4B8", -"# c #73A26B", -"$ c #BAD4BA", -"% c #ADCBAD", -"& c #739A63", -"* c #BDD7BD", -"= c #BAD3B8", -"- c #BAD3BA", -"; c #ADC7AD", -"> c #081008", -", c #ADC7A5", -"' c #A5C7A5", -") c #7B9E73", -"! c #A5BEA5", -"~ c #A5C3A5", -"{ c #6B9263", -"] c #738E6B", -"^ c #6B8E63", -"/ c #425929", -"( c #6B8663", -"_ c #5A7952", -": c #63825A", -"< c #526942", -" . ", -" .. ", -" .+. ", -" .@#. ", -"........$%&. ", -".*******=-;&> ", -".;%;;;,,;%;'). ", -".!;,',,;%;;%~{. ", -".]^{{{{{{{{{{^/.", -".(___________/. ", -".(__________/. ", -".:<<<<<<___/. ", -"........<_/. ", -" . c #0000F6", -", c #0000DF", -"' c #0000FD", -") c #0000F7", -"! c #0000FB", -"~ c #0000F0", -"{ c #0000E5", -"] c #0000D6", -"^ c #00009F", -"/ c #000080", -"( c #0000E2", -"_ c #00FF00", -": c #0000F5", -"< c #0000DB", -"[ c #00EE00", -"} c #00F300", -"| c #00F900", -"1 c #00E900", -"2 c #00D400", -"3 c #00BF00", -"4 c #00BD00", -"5 c #00AE00", -"6 c #009E00", -"7 c #0000F1", -"8 c #0000CD", -"9 c #0000EF", -"0 c #0000C6", -"a c #00FC00", -"b c #00F400", -"c c #0000EC", -"d c #0000B8", -"e c #008000", -"f c #00F600", -"g c #00DF00", -"h c #0000EA", -"i c #0000ED", -"j c #0000B1", -"k c #FF0000", -"l c #0000E8", -"m c #0000E4", -"n c #0000AA", -"o c #EE0000", -"p c #F30000", -"q c #F90000", -"r c #E90000", -"s c #D40000", -"t c #BF0000", -"u c #00F000", -"v c #00C900", -"w c #0000E6", -"x c #0000A3", -"y c #BD0000", -"z c #AE0000", -"A c #9E0000", -"B c #0000D2", -"C c #00009C", -"D c #00EB00", -"E c #00F100", -"F c #00B400", -"G c #0000C9", -"H c #000095", -"I c #00E800", -"J c #00E400", -"K c #00AA00", -"L c #0000E0", -"M c #0000C0", -"N c #00008E", -"O c #00E500", -"P c #00D600", -"Q c #009F00", -"R c #0000DE", -"S c #0000B7", -"T c #000087", -"U c #00E200", -"V c #009500", -"W c #0000DD", -"X c #E80000", -"Y c #E40000", -"Z c #AA0000", -"` c #00BB00", -" . c #008A00", -".. c #E20000", -"+. c #C90000", - -"@. c #950000", -"#. c #00DD00", -"$. c #800000", -"%. c #DD0000", -" ", -" ", -" ", -" . . . ", -" . . + + + . . ", -" . @ # $ + % & * . ", -" . . . = - ; . . . ", -" . + + . . . + + . ", -" . > + , . ' + ) . ", -" . @ + * . ! + ~ . ", -" . { ] ^ . $ + % . ", -" . . . - / . ) + ( . ", -" . . _ _ _ . . . : + < . ", -" . [ } | _ 1 2 3 . # + & . ", -" . . . 4 5 6 . . . 7 + 8 . ", -" . _ _ . . . _ _ . 9 + 0 . ", -" . [ _ 3 . a _ b . @ + * . ", -" . [ _ 3 . | _ 1 . c > d . ", -" . . . 5 e . f _ g . h i j . ", -" . . k k k . . . } _ 2 . l m n . ", -" . o p q k r s t . u _ v . w < x . ", -" . . . y z A . . . [ _ 3 . m B C . ", -" . k k . . . k k . D E F . ( G H . ", -" . q k r . q k r . I J K . L M N . ", -" . p k s . p k s . O P Q . R S T . ", -" . o k t . o k t . U v V . W . . ", -" . X Y Z . o k t . g ` .. . ", -" . ..+.@.. X Y Z . #.. . ", -" . . z $.. ..+.@.. . ", -" . . . %.. . ", -" . . ", -" "}; - -static char * bars_xpm[] = { -"16 16 6 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #E51212", -"# c #0000FF", -"$ c #9E0606", -" ", -" ..........", -" .+.+...+++.", -" .++.+.@@+++.", -" .++....@@+++.", -" .+++.@@.@...+.", -" .++###@@.@.@@+.", -" .++#$$@@.@.@@+.", -" .++#$###.@.@@+.", -" .++#$#$###.@@+.", -" .++#$#$#$$.@@. ", -" .++#$#$#$$.@. ", -" .++#$#$#$$.. ", -" .+.+$#$#$$. ", -" ..+++++#$. ", -" ......... "}; - -static char * trajectory_xpm[] = { -"15 16 4 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #BC0303", -" ", -" ..........", -" .+.+++++++.", -" .+@@++++@@+.", -" .++@@@@@@@@+.", -" .++++.+++++@+.", -".+@@++.++++@++.", -".+@@++.++@@+++.", -".++@++.++@@+++.", -".++@++.........", -".+@@+.+++++++. ", -".+@@.+++++++. ", -".++.@@@@@++. ", -".+.++++@@+. ", -"..+++++++. ", -"......... "}; - -static char * scatter_xpm[] = { -"16 16 4 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #BC0303", -" ", -" ..........", -" .+.+++++++.", -" .+@@++++@@+.", -" .++@@++++@@+.", -" .++++.+++++++.", -" .+@@++.+@@++++.", -" .+@@++.+@@++++.", -" .+++++.+++++++.", -" .+@@++.........", -" .+@@+.+++++++. ", -" .+++.++@@+++. ", -" .++.+++@@++. ", -" .+.+++++++. ", -" ..+++++++. ", -" ......... "}; - -static char * ribbon_xpm[] = { -"16 16 6 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #AF032E", -"# c #0000FF", -"$ c #100493", -" ", -" ..........", -" .+.+++++++.", -" .++.+++++++.", -" .+++.++++.++.", -" .++++.+++.@.+.", -" .+#++..++.@@@..", -" .#$#.@.+.@@@.+.", -" #$$$#@@.@@@.++.", -" .#$$$#@@@@.....", -" .+#$$$#@##+++. ", -" .++#$$$#$$#+. ", -" .++.#$$$$#+. ", -" .+.++#$$#+. ", -" ..++++##+. ", -" ......... "}; - -static char * pointer_xpm[] = { -"16 17 3 1", -" c None", -". c #000000", -"+ c #FFFFFF", -" ", -" .. ", -" .+. ", -" .++. ", -" .+++. ", -" .++++. ", -" .+++++. ", -" .++++++. ", -" .+++++++. ", -" .++++..... ", -" .++.+. ", -" .+. .+. ", -" .. .+. ", -" . .+. ", -" .+. ", -" ... ", -" "}; - -static char * arrangeLayers_xpm[] = { -"15 15 2 1", -" c None", -". c #000000", -".. .. ", -" . . ", -".. .. ", -" . . ", -".. .. ", -" . . ", -" ..... .......", -" . . . . ", -".. .. ", -" . . ", -".. .. ", -" . . ", -".. .. ", -" ..... .......", -" . . . . "}; - -/* XPM */ -static char * newLayer_xpm[] = { -"16 12 4 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #FF0000", -" ............", -" .++++++++++.", -" .+.++++++++.", -" @ .+..+++++++.", -" @ .+.++++++++.", -"@@@ .+..+++++++.", -" @ .+.++++++++.", -" @ .+..+++++++.", -" .+.++.+.+++.", -" .+........+.", -" .++++++++++.", -" ............"}; - -static char * pixelProfile_xpm[] = { -"20 20 56 1", -" c None", -". c #6B696B", -"+ c #6B6D6B", -"@ c #D6D3D6", -"# c #737173", -"$ c #A5A29C", -"% c #BDBABD", -"& c #212021", -"* c #E7E3E7", -"= c #B5B2B5", -"- c #FFFFFF", -"; c #7B797B", -"> c #D6D7D6", -", c #949694", -"' c #FFFBFF", -") c #8C8E8C", -"! c #848284", -"~ c #A5A2A5", -"{ c #313031", -"] c #8C8A8C", -"^ c #737573", -"/ c #EFEBEF", -"( c #ADAEAD", -"_ c #636563", -": c #9C9A9C", -"< c #F7F3F7", -"[ c #A5A6A5", -"} c #BDBEBD", -"| c #424542", -"1 c #ADAAAD", -"2 c #393839", -"3 c #5A595A", -"4 c #424142", -"5 c #EFEFEF", -"6 c #F7F7F7", -"7 c #525552", -"8 c #181818", -"9 c #636163", -"0 c #B5B6B5", -"a c #4A4D4A", -"b c #7B7D7B", -"c c #DEDFDE", -"d c #DEDBDE", -"e c #5A5D5A", -"f c #949294", -"g c #E7E7E7", -"h c #9C9E9C", -"i c #525152", -"j c #313431", -"k c #181C18", -"l c #101010", -"m c #212421", -"n c #292C29", -"o c #848684", -"p c #101410", -"q c #292829", -" . +@# $@#@#@#@#@#@.", -".%&*=-=-=-;>,'=-=-=@", -" &)!-=-='.~{=]-=-=-^", -"+ {/=-=-(,_/+(:<['(@", -"@;~,-=-=}|<1<2 :'(-^", -"3]{/=-~ 4*15:/{ 16=@", -" 7~,'=-3()5:/)/85:<^", -"#>{/[6](9/,*) ;0a0b ", -"@;~]'1@{cb>]d_ #(41e", -"3f{g=g{ ,g. . _ _>_ ", -" |~,<]hb>. 9 e 3}3hi", -"#>{*#h!d; _(&fj!&,a ", -"@;~e1b/] _ &bk~j}a _", -"ehl[^/)>4:m(4}{}n%_ ", -" j:o']fp1i=n {!812 _", -"#@qhpf_ 9 3:j1k%& _ ", -" i]ed!5]@. _[4 e[_ _", -"e,{g(6:5:c_ a~3 _ _ ", -" ; ~-:<:/b _ a _ ^c+", -". +@^ ^ # _ _ _ _ # "}; - -static char * monalisa_xpm[] = { -"19 19 219 2", -" c None", -". c #B5AEA5", -"+ c #8C8A84", -"@ c #636163", -"# c #525552", -"$ c #424542", -"% c #424139", -"& c #847973", -"* c #7B9AB5", -"= c #6B96C6", -"- c #6B92C6", -"; c #84AEE7", -"> c #6B86A5", -", c #523831", -"' c #CEA673", -") c #F7F3CE", -"! c #FFF7D6", -"~ c #FFF7CE", -"{ c #FFFBCE", -"] c #F7EBAD", -"^ c #E7BE84", -"/ c #A56552", -"( c #5A4542", -"_ c #393439", -": c #080408", -"< c #292821", -"[ c #7BA6D6", -"} c #427DBD", -"| c #528AC6", -"1 c #73A2D6", -"2 c #313439", -"3 c #311000", -"4 c #C6965A", -"5 c #EFDFA5", -"6 c #EFE3A5", -"7 c #EFE7AD", -"8 c #E7E39C", -"9 c #DECF84", -"0 c #CE9652", -"a c #AD5939", -"b c #6B2C21", -"c c #311410", -"d c #080808", -"e c #000000", -"f c #4A86C6", -"g c #6BA2DE", -"h c #6B758C", -"i c #100400", -"j c #5A2C18", -"k c #D6AE6B", -"l c #EFDB94", -"m c #EFE39C", -"n c #EFEBAD", -"o c #EFD78C", -"p c #DEBA6B", -"q c #D6A263", -"r c #BD754A", -"s c #6B3029", -"t c #100808", -"u c #8CB2E7", -"v c #7BAADE", -"w c #84B2DE", -"x c #524D52", -"y c #734121", -"z c #E7BA7B", -"A c #E7CB8C", -"B c #F7EBA5", -"C c #E7C78C", -"D c #CE9E63", -"E c #DEAE73", -"F c #B5714A", -"G c #5A2C21", -"H c #84AEDE", -"I c #73A2DE", -"J c #392C29", -"K c #080000", -"L c #4A2818", -"M c #9C5D42", -"N c #8C4931", -"O c #C69E52", -"P c #DEB26B", -"Q c #632418", -"R c #7B3421", -"S c #844531", -"T c #4A1C18", -"U c #391010", -"V c #6396CE", -"W c #4271A5", -"X c #212021", -"Y c #7B4129", -"Z c #AD6939", -"` c #BD8E5A", -" . c #631C10", -".. c #C6925A", -"+. c #734129", -"@. c #632818", -"#. c #A5794A", -"$. c #8C5139", -"%. c #180808", -"&. c #52718C", -"*. c #183042", -"=. c #395984", -"-. c #211C21", -";. c #946542", -">. c #DEAA6B", -",. c #BD824A", -"'. c #D6B263", -"). c #C69663", -"!. c #A55931", -"~. c #CEA263", -"{. c #D6B673", -"]. c #EFC784", -"^. c #945139", -"/. c #100408", -"(. c #394952", -"_. c #081821", -":. c #212429", -"<. c #211410", -"[. c #946139", -"}. c #F7DB8C", -"|. c #F7E7A5", -"1. c #EFDF94", -"2. c #D6AA73", -"3. c #CE9252", -"4. c #EFE79C", -"5. c #F7F3C6", -"6. c #EFDF9C", -"7. c #CE8A52", -"8. c #6B2821", -"9. c #393C42", -"0. c #081018", -"a. c #100C08", -"b. c #180C08", -"c. c #6B3821", -"d. c #EFCF84", -"e. c #E7D394", -"f. c #EFDB9C", -"g. c #DEB684", -"h. c #C68A5A", -"i. c #E7CF8C", -"j. c #A55139", -"k. c #421C18", -"l. c #080C10", -"m. c #080400", -"n. c #390C08", -"o. c #C68E5A", -"p. c #DEB66B", -"q. c #946952", -"r. c #7B4529", -"s. c #DEC384", -"t. c #B57552", -"u. c #733029", -"v. c #39414A", -"w. c #180400", -"x. c #943C31", -"y. c #DE9E63", -"z. c #D6B27B", -"A. c #521810", -"B. c #7B4131", -"C. c #C68E63", -"D. c #C68A52", -"E. c #AD5D42", -"F. c #394142", -"G. c #080C08", -"H. c #8C4131", -"I. c #CE9663", -"J. c #732C29", -"K. c #AD654A", -"L. c #081418", -"M. c #101010", -"N. c #391410", -"O. c #C68652", -"P. c #DEB673", -"Q. c #AD6542", -"R. c #9C4D39", -"S. c #B56D4A", -"T. c #BD7552", -"U. c #843C31", -"V. c #211010", -"W. c #100810", -"X. c #39454A", -"Y. c #102029", -"Z. c #181C29", -"`. c #4A2010", -" + c #DEBA7B", -".+ c #F7E79C", -"++ c #D69A6B", -"@+ c #AD5542", -"#+ c #733429", -"$+ c #421818", -"%+ c #311818", -"&+ c #180C10", -"*+ c #394552", -"=+ c #102839", -"-+ c #182839", -";+ c #5A3821", -">+ c #A57552", -",+ c #844D39", -"'+ c #311010", -")+ c #291010", -"!+ c #181010", -"~+ c #425163", -"{+ c #214163", -"]+ c #213C5A", -"^+ c #100C10", -"/+ c #000400", -"(+ c #180000", -"_+ c #291410", -":+ c #211008", -"<+ c #182C42", -"[+ c #101418", -"}+ c #291810", -"|+ c #523021", -"1+ c #210C08", -"2+ c #422018", -"3+ c #4A2418", -"4+ c #181008", -"5+ c #212018", -"6+ c #635D52", -". + @ # # # # # # # # # # # # # $ % & ", -"+ * = - ; > , ' ) ! ~ { ] ^ / ( _ : < ", -"@ [ } | 1 2 3 4 5 6 7 8 9 0 a b c d e ", -"# 1 f g h i j k l m m n o p q r s t e ", -"# u v w x e y z A m B C D E q F G : e ", -"# H I = J K L M N O P Q R S T U T t e ", -"# H V W X i c Y b Z ` ...+.@.#.$.%.e ", -"# &.*.=.-.e ;.>.,.'.).!.p ~.{.].^./.e ", -"# (._.:.<.e [.}.|.1.2.3.4.5.6.7.8.d e ", -"# 9.0.a.b.e c.d.e.f.g.h.i.5 z j.k.d e ", -"# 9.l.m.i K n.o.p.2.q.r.e.s.t.u.c t e ", -"# v.l.d m.m.w.x.y.z.A.B.C.D.E.u.c t e ", -"# F.l.G.: /.K H.F I.E.J.^.I.K.b c t e ", -"# v.L.M.t /.e N.O.P.Q.R.S.T.U.T V.W.e ", -"# X.Y.Z.t m./.e `. +.+++@+#+$+%+&+t e ", -"# *+=+-+t i i m.e ;+>+,+T '+)+V.!+t e ", -"$ ~+{+]+^+i : m./+e K (+t b.b._+%+:+e ", -"% <+*.<+[+K i m.e e }+|+_+1+_+2+3+4+5+", -"& < e e e e e e e e e e e e e e e 5+6+"}; - -static char * lineMesh_xpm[] = { -"20 18 130 2", -" c None", -". c #4245E7", -"+ c #29286B", -"@ c #212021", -"# c #181C29", -"$ c #4241E7", -"% c #4A499C", -"& c #181418", -"* c #181818", -"= c #5A595A", -"- c #B5AEB5", -"; c #4241C6", -"> c #8482FF", -", c #9C9E9C", -"' c #6B696B", -") c #FFFBFF", -"! c #9C969C", -"~ c #5251AD", -"{ c #6B69FF", -"] c #EFEFFF", -"^ c #393C39", -"/ c #211C21", -"( c #101410", -"_ c #D6CFD6", -": c #F7F7F7", -"< c #4A454A", -"[ c #7375B5", -"} c #5A59FF", -"| c #E7E7FF", -"1 c #A59EA5", -"2 c #080C08", -"3 c #42417B", -"4 c #4A4994", -"5 c #6B6973", -"6 c #ADA6CE", -"7 c #5251FF", -"8 c #C6BEE7", -"9 c #312C31", -"0 c #181C18", -"a c #181821", -"b c #6B69EF", -"c c #6B65DE", -"d c #313031", -"e c #212429", -"f c #393CAD", -"g c #31306B", -"h c #292C29", -"i c #212421", -"j c #6B697B", -"k c #635DFF", -"l c #BDBAFF", -"m c #5A5D5A", -"n c #52515A", -"o c #292C63", -"p c #A5A2EF", -"q c #EFE7EF", -"r c #A5A2A5", -"s c #101010", -"t c #ADAAE7", -"u c #5255FF", -"v c #D6D3EF", -"w c #636163", -"x c #393863", -"y c #9C9AFF", -"z c #FFFFFF", -"A c #D6D7D6", -"B c #525152", -"C c #8C8AFF", -"D c #B5B2B5", -"E c #636563", -"F c #5A598C", -"G c #847DFF", -"H c #292429", -"I c #525163", -"J c #524DF7", -"K c #8482D6", -"L c #737173", -"M c #313431", -"N c #EFEFEF", -"O c #7B79A5", -"P c #5A5DFF", -"Q c #F7EFFF", -"R c #EFEBEF", -"S c #393839", -"T c #393439", -"U c #C6BEEF", -"V c #424142", -"W c #423C42", -"X c #4A4D63", -"Y c #5A55F7", -"Z c #5A5D73", -"` c #949294", -" . c #7B79FF", -".. c #ADAAB5", -"+. c #737573", -"@. c #4A494A", -"#. c #5A59F7", -"$. c #9C96CE", -"%. c #847D84", -"&. c #DEDFEF", -"*. c #C6BEFF", -"=. c #6B656B", -"-. c #FFF7FF", -";. c #F7F3F7", -">. c #BDBEBD", -",. c #8C86FF", -"'. c #DEDBDE", -"). c #848684", -"!. c #C6C3FF", -"~. c #7375FF", -"{. c #E7DFEF", -"]. c #8C8E8C", -"^. c #E7E3E7", -"/. c #D6D3D6", -"(. c #B5B6FF", -"_. c #4A4552", -":. c #5A59EF", -"<. c #A5A6EF", -"[. c #E7E3FF", -"}. c #E7DFFF", -"|. c #949694", -"1. c #5A5D9C", -"2. c #292C31", -"3. c #9C9A9C", -"4. c #292829", -"5. c #73717B", -"6. c #5251E7", -"7. c #5A59AD", -"8. c #312C52", -"9. c #292C4A", -" . + ", -" @ # $ % & * ", -" * = - ; > , & ", -" & ' ) ! ~ { ] ^ / ", -" ( _ : < [ } | 1 2 ", -" ( 3 4 5 * 6 7 8 - 9 0 ", -" a b c d & e f g h i i ", -" & j k l = m n o p q r s ", -" ( t u v i 1 w x y z A ( ", -" ( B C > D * _ E F G z : H ", -" s I J K L M N w O P Q R S @ ", -" * T U 7 x 0 @ V W X Y Z d @ & ", -" 2 ` l ...s +.1 @.5 #.$., %.2 ", -" H &. .*.=.^ -.;.W >.,.y z '.* ", -" s ).!.~.{.i ].z ^.i /.(.~.) : d @ ", -" s @ _.:.<.r * _ z _ @ '.[.P }.z |.2 ", -"& ( ` ..1.2.@ i ' 3.L 4.! 5.6.7.@.4.@ d ", -"^ w S h 9 4.H @ @ 8.9.@ s "}; - -static char * rightGrid_xpm[] = { -"20 19 25 1", -" c None", -". c #C60000", -"+ c #21109C", -"@ c #0810B5", -"# c #0814B5", -"$ c #B50010", -"% c #C60818", -"& c #1018BD", -"* c #0010B5", -"= c #A50018", -"- c #BD0C18", -"; c #BD0000", -"> c #A50829", -", c #940839", -"' c #BD0410", -") c #9C0429", -"! c #9C0021", -"~ c #BD0008", -"{ c #AD0421", -"] c #BD0C21", -"^ c #A5245A", -"/ c #636DFF", -"( c #BD1021", -"_ c #B50008", -": c #8C0439", -" ..+ @ @ @ @ @ # ", -" $% &", -" ... * ", -" =. - @", -" .. $; * ", -".>.,.' @ @ @ @ @", -")!.; . @ ", -".'. - @", -"~;. .. @ ", -".{...% @", -"$ .. . @ ", -".'. ] @", -"~;. . @ ", -".{. .^ / / / / / / @", -"$ ... @ ", -". .( @ ", -"$_. @ ", -".( @ ", -": @ @ @ @ @ @ @ "}; - -static char * leftGrid_xpm[] = { -"20 19 25 1", -" c None", -". c #0810B5", -"+ c #840842", -"@ c #C60000", -"# c #0010B5", -"$ c #636DFF", -"% c #BD0410", -"& c #B50008", -"* c #9C0C31", -"= c #B50410", -"- c #A50018", -"; c #940C39", -"> c #BD0000", -", c #BD0010", -"' c #101CBD", -") c #29109C", -"! c #8C104A", -"~ c #B50010", -"{ c #AD0421", -"] c #BD0008", -"^ c #7B55CE", -"/ c #8C45A5", -"( c #BD0C21", -"_ c #8C0839", -": c #8C0439", -" . . . . . . +@", -" #$ @@%", -" @&*@", -" # $ @@@ =", -" @-;>,@", -" ' . . . . . )@! @>%", -". ~ @@{@", -" $ @=@@ =", -". ]> @,@", -" $ @ @>%", -". ~ @@{@", -" $ @=@@ =", -". ]> @ @", -" $ $ $ $ ^@/ (@_", -". ~ @@ ", -" $ @ @= ", -". ~@@ ", -" $ @= ", -". . . . . . . : "}; - -static char * backGrid_xpm[] = { -"20 19 31 1", -" c None", -". c #C60000", -"+ c #9C0421", -"@ c #A50421", -"# c #B50010", -"$ c #290C94", -"% c #BD0C21", -"& c #B50410", -"* c #0010B5", -"= c #BD0C18", -"- c #BD0000", -"; c #BD0008", -"> c #B50008", -", c #BD0410", -"' c #101CBD", -") c #0810B5", -"! c #1010AD", -"~ c #390C84", -"{ c #C60408", -"] c #C60008", -"^ c #4A0C73", -"/ c #C60810", -"( c #BD0408", -"_ c #310C8C", -": c #A5245A", -"< c #AD1842", -"[ c #B51839", -"} c #B51842", -"| c #B51029", -"1 c #8C0842", -"2 c #636DFF", -" .+.@.#.@.@.@.@.", -" $% . . &", -" . . . * .", -" * = . . &", -" -;>;-.;;>.-,-;.", -" ' ) , ! ~.~ ! { &", -") . . $- .", -" % . ] &", -") . . ^- .", -" /.......,....;(", -") . . _- .", -" % . ] &", -") . . ^- .", -" :.<.[.[.}.|.}.1", -") ! ", -" 2 ) ", -") ) ", -" 2 ) ", -") ) ) ) ) ) ) ) "}; - -static char * ceilGrid_xpm[] = { -"20 19 24 1", -" c None", -". c #C60000", -"+ c #9C0429", -"@ c #B50010", -"# c #A50421", -"$ c #B50410", -"% c #AD0010", -"& c #8C419C", -"* c #BD0008", -"= c #BD0408", -"- c #BD0410", -"; c #421084", -"> c #B50008", -", c #A50018", -"' c #B51839", -") c #0810B5", -"! c #BD0010", -"~ c #BD0000", -"{ c #AD0421", -"] c #B50418", -"^ c #A50429", -"/ c #0810AD", -"( c #1010AD", -"_ c #636DFF", -" ..+.@.#.@.#.#.$.", -" .%&..* =.- ..;", -" ...............> ", -" ., '. .. .. )", -".. !~ >* ., ", -".{.#.{.#.].#.^. )", -"/ ( ", -" _ )", -") ) ", -" _ )", -") ) ", -" _ )", -") ) ", -" _ _ _ _ _ _ _ )", -") ) ", -" _ ) ", -") ) ", -" _ ) ", -") ) ) ) ) ) ) ) "}; - -static char * floorGrid_xpm[] = { -"20 19 30 1", -" c None", -". c #0810B5", -"+ c #0814B5", -"@ c #0010B5", -"# c #636DFF", -"$ c #1018BD", -"% c #101CBD", -"& c #310C8C", -"* c #C60000", -"= c #AD1C4A", -"- c #B51839", -"; c #BD0C21", -"> c #AD1842", -", c #940431", -"' c #BD0000", -") c #6B085A", -"! c #BD0818", -"~ c #C60008", -"{ c #BD0410", -"] c #1010AD", -"^ c #AD0010", -"/ c #1810A5", -"( c #BD1021", -"_ c #9C0429", -": c #B50010", -"< c #B50008", -"[ c #BD0408", -"} c #B50418", -"| c #A50421", -"1 c #B50410", -" . . . . . . + ", -" @# $", -" @ ", -" @ # .", -" @ ", -" % . . . . . . .", -". . ", -" # .", -". . ", -" # .", -". . ", -" # .", -". & ", -" *=*-*;*>*;*-*-*,", -". ** ** *') ** ", -" *!*********~***{ ", -"]^* ** ** /** ", -"*(_ :~_ <[ *} ", -",*|*1*|*|*1*|*, "}; - - -static char * pointsMesh_xpm[] = { -"19 20 14 1", -" c None", -". c #1800FF", -"+ c #1804FF", -"@ c #FFFFFF", -"# c #EFEBEF", -"$ c #FFF7FF", -"% c #F7F3F7", -"& c #2104FF", -"* c #FFFBFF", -"= c #EFEFEF", -"- c #EFE7EF", -"; c #E7E3E7", -"> c #E7E7E7", -", c #F7EFF7", -" .+ ", -" @@.. ", -" @@@# ", -" @$..$@ ", -" @@%&.#@@ ", -" @*@@@@=@@ ", -" .+#-@@@;@@@ ", -" ..@>..@@..@ ", -" @@@@.&@@.& ", -" @@@@@@@@@@@@ ", -" @@*@@&.@@*@@@ ", -" @#@@..@@@$@@ ", -" &.$@,@@@*@@@@.+ ", -" ..@@..#@*..@@.. ", -" @,@@+.@@@.&@@@@ ", -" *@@@@@@@@@@@@@@ ", -" @,@@@@@@@@@@@@@+.", -"..$@..@@@=@@@@@@@..", -".& .&@@.&@@ &.@ ", -" .. .. "}; - - -static char * frontGrid_xpm[] = { -"20 19 22 1", -" c None", -". c #0810B5", -"+ c #0814B5", -"@ c #0010B5", -"# c #636DFF", -"$ c #1018BD", -"% c #C60000", -"& c #A50829", -"* c #A50421", -"= c #B50010", -"- c #7359D6", -"; c #BD0408", -"> c #B51431", -", c #8449B5", -"' c #8449AD", -") c #BD0008", -"! c #7B55CE", -"~ c #BD0000", -"{ c #7B084A", -"] c #310C8C", -"^ c #8C0439", -"/ c #AD0418", -" . . . . . . + ", -" @# $", -" @ ", -" @ # .", -" @ ", -"%&%*%*%*%*%*%*% .", -"= % % = ", -"% %- % % .", -"= % % = ", -"%;%%%>%%%%%%%;% .", -"= % % = ", -"% %- % % .", -"= % % = ", -"% %, - ,%' ,%- # .", -"))%%%%%%%%%%%)) ", -"% !% % % . ", -"= % % = ", -"%, ~ % {%] ", -"^%*%/%*%*%/%*%^ "}; - - -static char * no_floor_xpm[] = { -"20 10 2 1", -" c None", -". c #000000", -" ................", -" . .", -" . .", -" . . ", -" . . ", -" . . ", -" . . ", -" . . ", -". . ", -"................ "}; - -static char * isolines_xpm[] = { -"20 10 9 1", -" c None", -". c #000000", -"+ c #DE0810", -"@ c #DE0808", -"# c #DE0C10", -"$ c #E70C10", -"% c #0010DE", -"& c #0010E7", -"* c #0014E7", -" ................", -" . + @ .", -" . #+$ # .", -" .@+ %& +@ . ", -" . *% * +. ", -" . & % . ", -" . +$ % *% +#+$. ", -" . + %& @ . ", -". + + . ", -"................ "}; - -static char * floor_xpm[] = { -"20 10 22 1", -" c None", -". c #000000", -"+ c #314D63", -"@ c #314D5A", -"# c #395963", -"$ c #39555A", -"% c #39595A", -"& c #31555A", -"* c #395D52", -"= c #396152", -"- c #42694A", -"; c #426952", -"> c #4A714A", -", c #427142", -"' c #42714A", -") c #4A7D42", -"! c #4A7942", -"~ c #4A8231", -"{ c #528639", -"] c #4A8239", -"^ c #528E31", -"/ c #5A8E31", -" ................", -" .+++@+++@+++@++.", -" .#$%&#$%&#$%&#$%.", -" .*=*=*=*=*=*=*=. ", -" .-;-;-;-;-;-;-;-. ", -" .>,',>,',>,',>,. ", -" .)!)!)!)!)!)!)!). ", -" .~{]{~{]{~{]{~{. ", -".^/^/^/^/^/^/^/^. ", -"................ "}; - -static char * grid_poly_xpm[] = { -"20 18 86 1", -" c None", -". c #101010", -"+ c #312021", -"@ c #181818", -"# c #312829", -"$ c #181418", -"% c #311418", -"& c #FFCF21", -"* c #211410", -"= c #211418", -"- c #FFBE29", -"; c #FFC329", -"> c #393031", -", c #211C21", -"' c #181410", -") c #FFAE31", -"! c #636163", -"~ c #291C21", -"{ c #100C08", -"] c #101410", -"^ c #423839", -"/ c #4A3C39", -"( c #FF9E39", -"_ c #BD7173", -": c #BD7573", -"< c #312C31", -"[ c #181C18", -"} c #211818", -"| c #FF8A39", -"1 c #FF8E42", -"2 c #732021", -"3 c #292829", -"4 c #392829", -"5 c #292421", -"6 c #212421", -"7 c #7B595A", -"8 c #FF7D42", -"9 c #FF7939", -"0 c #8C3C39", -"a c #FF6931", -"b c #FF6531", -"c c #524D52", -"d c #525152", -"e c #FF5529", -"f c #291418", -"g c #5A494A", -"h c #6B1C18", -"i c #5A4D4A", -"j c #FF4121", -"k c #737173", -"l c #313031", -"m c #FF4521", -"n c #292429", -"o c #732C29", -"p c #212021", -"q c #4A3031", -"r c #FF3018", -"s c #393439", -"t c #5A3439", -"u c #AD2829", -"v c #843031", -"w c #5A4D52", -"x c #180C08", -"y c #FF1C10", -"z c #FF1808", -"A c #181010", -"B c #312421", -"C c #080C08", -"D c #FF0400", -"E c #FF0808", -"F c #6B656B", -"G c #635D63", -"H c #211010", -"I c #F70000", -"J c #523C42", -"K c #E70000", -"L c #291818", -"M c #949294", -"N c #ADAEAD", -"O c #5A595A", -"P c #D60000", -"Q c #CE0000", -"R c #393C39", -"S c #4A494A", -"T c #393839", -"U c #292C29", -" .. ", -" +@.#$@ ", -" %&&*&&$ ", -" =-;->-;-, ", -" ')))!~)){ ", -" ]^/(@(@_:<[ ", -" }|12*3.,456 ", -" $7890983898. ", -" 'aba+abcbab' ", -" ]deeefeeegeeh ", -" .idjklmjmnmjop ", -" @qrrs[~tuv,wlp$ ", -" xyzyzAzyzyByzyC ", -" BDEDF^EDEDGDED@ ", -" HIIII6IIIIIIJII2p ", -" .pKKKKLKKKKKK5KKK{ ", -"$]MNO3p6PQQQPQpRS3pl", -"R !TU c #313031", -", c #393839", -"' c #EFEBEF", -") c #393C39", -"! c #211C21", -"~ c #101410", -"{ c #D6CFD6", -"] c #F7F7F7", -"^ c #4A454A", -"/ c #636163", -"( c #DEDFDE", -"_ c #A59EA5", -": c #080C08", -"< c #424142", -"[ c #736D73", -"} c #9C9A9C", -"| c #B5B2B5", -"1 c #312C31", -"2 c #181C18", -"3 c #BDBEBD", -"4 c #949294", -"5 c #292829", -"6 c #212421", -"7 c #FFFFFF", -"8 c #5A5D5A", -"9 c #8C8A8C", -"0 c #EFE7EF", -"a c #A5A2A5", -"b c #DED7DE", -"c c #524D52", -"d c #7B797B", -"e c #D6D7D6", -"f c #525152", -"g c #FFF7FF", -"h c #6B6D6B", -"i c #292429", -"j c #ADAAAD", -"k c #737173", -"l c #313431", -"m c #EFEFEF", -"n c #393439", -"o c #DEDBDE", -"p c #948E94", -"q c #6B656B", -"r c #4A4D4A", -"s c #525552", -"t c #ADAEAD", -"u c #737573", -"v c #949694", -"w c #847D84", -"x c #E7E7E7", -"y c #635D63", -"z c #848684", -"A c #8C8E8C", -"B c #424542", -"C c #D6D3D6", -"D c #4A494A", -" .. ", -" +@.#$@ ", -" @%&@%*$ ", -" $=-;>,')! ", -" ~{]^/+(_: ", -" ~)<[@}@|&12 ", -" @34>$5.!#66 ", -" $[77%8 590a. ", -" ~b7'6_-cd7e~ ", -" ~fg7|@{7hf7]i ", -" .ffjklm7_5'',+ ", -" @nopn2++$ ", -" :477t.ua*v69*w: ", -" ix77q)g777yd7o@ ", -" .z77'6A7777*B]]>+ ", -" .+^9Ca@{7777b6C7v: ", -"$~4t%5+6=}a*_h+)D5+>", -") /,#1##++6++ ."}; - -static char * no_grid_xpm[] = { -"20 18 54 1", -" c None", -". c #181818", -"+ c #212021", -"@ c #181C18", -"# c #4A494A", -"$ c #525152", -"% c #181418", -"& c #5A595A", -"* c #FFCF21", -"= c #6B696B", -"- c #FFC329", -"; c #FFBE29", -"> c #FFC331", -", c #393C39", -"' c #211C21", -") c #FFAE31", -"! c #080C08", -"~ c #101410", -"{ c #737173", -"] c #FF9E39", -"^ c #FF8A39", -"/ c #FF8E42", -"( c #636163", -"_ c #736D73", -": c #FF7D42", -"< c #FF7939", -"[ c #101010", -"} c #FF6931", -"| c #FF6531", -"1 c #FF5529", -"2 c #FF5531", -"3 c #292429", -"4 c #FF4121", -"5 c #FF4521", -"6 c #393839", -"7 c #292829", -"8 c #393439", -"9 c #FF3018", -"0 c #FF1C10", -"a c #FF1808", -"b c #FF0400", -"c c #FF0808", -"d c #F70000", -"e c #313031", -"f c #E70000", -"g c #949294", -"h c #ADAEAD", -"i c #CE0000", -"j c #D60000", -"k c #737573", -"l c #5A5D5A", -"m c #8C8A8C", -"n c #292C29", -"o c #312C31", -" .. ", -" +@#$%. ", -" .&****% ", -" %=-;>;-,' ", -" %)))))))! ", -" ~{]]]]]]]+ ", -" .^/^/^/^/(% ", -" %_:<:<:<:<:[ ", -" ~}|}|}|}|}|~ ", -" ~&11121112113 ", -" [4545454545467 ", -" .899999999999=+ ", -" !0a0a0a0a0a0a0! ", -" 3bcbcbcbcbcbcb. ", -" [dddddddddddddde+ ", -" [+fffffffffffffff! ", -"%~gh&7#(_iiijk(l#7+e", -", m#nonn+++++ ["}; - -static char * no_axes_xpm[] = { -"20 19 6 1", -" c None", -". c #0810B5", -"+ c #0814B5", -"@ c #0010B5", -"# c #1018BD", -"$ c #101CBD", -" . . . . . . + ", -" @ #", -" @ ", -" @ .", -" @ ", -" $ . . . . . . .", -". . ", -" .", -". . ", -" .", -". . ", -" .", -". . ", -" .", -". . ", -" . ", -". . ", -" . ", -". . . . . . . . "}; - -static char * box_xpm[] = { -"20 19 7 1", -" c None", -". c #101CB5", -"+ c #0810B5", -"@ c #0010B5", -"# c #0814B5", -"$ c #1018BD", -"% c #101CBD", -" .+@+@+@+@+@+@#.", -" @ @$", -" @ @ @", -" @ @ +", -" @ @ @", -"@%@+@+@+@+@+@+@ +", -"+ + @", -"@ @ +", -"+ + @", - -"@ @ +", -"+ + @", -"@ @ +", -"+ + @", -"@ @ +", -"+ + + ", -"@ @ + ", -"+ + + ", -"@ @+ ", -"+@+@+@+@+@+@+@+ "}; - -static char * free_axes_xpm[] = { -"17 18 3 1", -" c None", -". c #0810B5", -"+ c #0010B5", -". ", -"+ ", -". ", -"+ ", -". ", -"+ ", -". ", -"+ ", -". ", -"+ ", -". ", -"+ +", -". + ", -" .+ + ", -" +. + ", -" .+ + ", -" +. + ", -" .+ "}; - -static char * newFxy_xpm[] = { -"14 16 75 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #A0A7AF", -"# c #FB0000", -"$ c #F90000", -"% c #E60000", -"& c #EE0000", -"* c #ED0000", -"= c #E00000", -"- c #D80000", -"; c #DE0000", -"> c #D60000", -", c #C90000", -"' c #CD0000", -") c #C70000", -"! c #AD0000", -"~ c #B80000", -"{ c #BC0000", -"] c #BB0000", -"^ c #B60000", -"/ c #A80000", -"( c #9D0000", -"_ c #A70000", -": c #AA0000", -"< c #A90000", -"[ c #A50000", -"} c #9A0000", -"| c #8D0000", -"1 c #940000", -"2 c #980000", -"3 c #970000", -"4 c #930000", -"5 c #890000", -"6 c #6C0000", -"7 c #7C0000", -"8 c #830000", -"9 c #850000", -"0 c #820000", -"a c #790000", -"b c #640000", -"c c #5D0000", -"d c #6A0000", -"e c #700000", -"f c #730000", -"g c #6F0000", -"h c #670000", -"i c #570000", -"j c #010000", -"k c #4C0000", -"l c #590000", -"m c #600000", -"n c #5C0000", -"o c #550000", -"p c #470000", -"q c #0C0000", -"r c #3A0000", -"s c #460000", -"t c #4B0000", -"u c #4D0000", -"v c #490000", -"w c #430000", -"x c #370000", -"y c #140000", -"z c #290000", -"A c #330000", -"B c #380000", -"C c #3B0000", -"D c #300000", -"E c #250000", -"F c #0A0000", -"G c #060000", -"H c #0D0000", -"I c #110000", -"J c #030000", -".......... ", -".++++++++.. ", -".++++++++.@. ", -".++++#$++.@@. ", -".+++%&*=+.....", -".+++-;;>+++++.", -".+++,'')+++++.", -".++!~{]^/++++.", -".++(_:<[}++++.", -".++|12345++++.", -".+678990ab+++.", -".+cdeffghi+++.", -"j+klcmmnop+++.", -"jqrstuuvwxj++.", -"jyzABrCxDEFjj.", -".jGHIyyIqyJj.."}; - -/* XPM */ -static char * newF_xpm[] = { -"14 16 4 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #A0A7AF", -".......... ", -".++++++++.. ", -".++++++++.@. ", -".+++...++.@@. ", -".++..+..+.....", -".++..++++++++.", -".++..++++++++.", -".+.....++++++.", -".++..++..+..+.", -".++..++..+..+.", -".++..+++...++.", -".++..++..+..+.", -".+....+..+..+.", -".++++++++++++.", -".++++++++++++.", -".............."}; - -/* XPM */ -static char * newFolder_xpm[] = { -"15 16 5 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #A0A7AF", -"# c #FFFF00", -".......... ", -".++++++++.. ", -".++++++++.@. ", -".++++++++.@@. ", -".++++++++..... ", -".++....++++++. ", -".+.#+#+.+++++. ", -".+.............", -".+.#+#+#+#+#+#.", -".+.+#+#+#+#+#+.", -".+.#+#+#+#+#+#.", -".+.+#+#+#+#+#+.", -".+.#+#+#+#+#+#.", -".+.+#+#+#+#+#+.", -".+.#+#+#+#+#+#.", -"..............."}; - -static char * stat_rows_xpm[] = { -"16 15 3 1", -" c None", -". c #000000", -"+ c #FFFFFF", -" ....... ", -" . .. ", -" . . ", -" .. ", -" .. ", -" .. ", -" . ", -" . . ", -" . .. ", -" ....... ", -" ", -"................", -". .++.++.++.++.", -". .++.++.++.++.", -"................"}; - -/* XPM */ -static char * fx_xpm[] = { -"14 16 4 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #FF0000", -"..............", -".++++++++++++.", -".+++++++++@++.", -".+++...++@@@+.", -".++..+..++@++.", -".++..++++++++.", -".++..++++++++.", -".+.....++++++.", -".++..++..+..+.", -".++..++..+..+.", -".++..+++...++.", -".++..++..+..+.", -".+....+..+..+.", -".++++++++++++.", -".++++++++++++.", -".............."}; - -static char * redo_xpm[] = { -"14 18 36 1", -" c None", -". c #000000", -"+ c #949A8C", -"@ c #BDD39C", -"# c #848E73", -"$ c #ADBEA5", -"% c #C6D7AD", -"& c #D6DFBD", -"* c #BDD3A5", -"= c #9CA28C", -"- c #D6E3C6", -"; c #CEDFBD", -"> c #D6E3BD", -", c #8C9A7B", -"' c #9CAA84", -") c #B5C3AD", -"! c #94AE63", -"~ c #7B9A42", -"{ c #5A7129", -"] c #7B8E6B", -"^ c #CEDBB5", -"/ c #84A24A", -"( c #526929", -"_ c #A5B694", -": c #9CB673", -"< c #6B8A39", -"[ c #94A67B", -"} c #8CAA5A", -"| c #637152", -"1 c #9CAE73", -"2 c #ADC394", -"3 c #6B795A", -"4 c #9CAE84", -"5 c #738263", -"6 c #849673", -"7 c #5A554A", -" . ", -" .. ", -" .+. ", -" ....@+. ", -" .#$%&*@=. ", -" .$-;>%@@@+. ", -" .,--&*@@@@@'.", -" .)-!~~~~~~{. ", -".]^/~~~~~~(. ", -"._:~{...~(. ", -".@~<. .{. ", -".@~. .. ", -".[}. . ", -".|1. ", -" .2. ", -" .34. ", -" .56. ", -" ..7 "}; - -static char * undo_xpm[] = { -"16 18 34 1", -" c None", -". c #000000", -"+ c #EFE7BD", -"@ c #EFE7C6", -"# c #EFD784", -"$ c #5A5952", -"% c #EFE7B5", -"& c #D6B65A", -"* c #B59642", -"= c #D6B252", -"- c #C6AE73", -"; c #C6A24A", -"> c #9C6900", -", c #D69608", -"' c #E7B64A", -") c #DEC373", -"! c #8C6500", -"~ c #D69E18", -"{ c #B59239", -"] c #DEB64A", -"^ c #CEB66B", -"/ c #BD8208", -"( c #DEA629", -"_ c #D6A629", -": c #C6B26B", -"< c #A59252", -"[ c #52514A", -"} c #8C867B", -"| c #E7CB7B", -"1 c #948E84", -"2 c #8C7D4A", -"3 c #AD9E5A", -"4 c #94864A", -"5 c #8C8A7B", -" . ", -" .. ", -" .+. ", -" .@#...$ ", -" .%####&*. ", -" .+#######=. ", -" .-#########;. ", -" .>,,,,,,'#). ", -" .!,,,,,,~#{. ", -" .!,...>,]^. ", -" .>. ./(#. ", -" .. .,#. ", -" . ._:. ", -" .=<[ ", -" }.|.1 ", -" .^2. ", -" .34. ", -" 5.. "}; - - - -static char * col_stat_xpm[] = { -"16 16 3 1", -" c None", -". c #000000", -"+ c #FFFFFF", -" ", -" ......", -" . .", -" ....... . .", -" . .. ......", -" . . .++++.", -" .. ......", -" .. .++++.", -" .. ......", -" . .++++.", -" . . ......", -" . .. .++++.", -" ....... ......", -" .++++.", -" ......", -" "}; - -static char * wizard_xpm[] = { -"32 32 91 1", -" c None", -". c #FF6500", -"+ c #FF8E00", -"@ c #FFFF00", -"# c #FFA600", -"$ c #FFC300", -"% c #FF9A00", -"& c #FFB200", -"* c #FFB600", -"= c #FFA200", -"- c #FF9E00", -"; c #FFBA00", -"> c #FFE700", -", c #FFE310", -"' c #FFFF31", -") c #FFD739", -"! c #FFFFE7", -"~ c #FF8600", -"{ c #FFCB00", -"] c #FFD700", -"^ c #FFE752", -"/ c #FFF7B5", -"( c #FFFFDE", -"_ c #FFEF00", -": c #FFF7A5", -"< c #FFFFD6", -"[ c #FFDB00", -"} c #FFE300", -"| c #FFF700", -"1 c #FFF77B", -"2 c #FFFBB5", -"3 c #FFF784", -"4 c #FF8200", -"5 c #FFDF00", -"6 c #FFCF00", -"7 c #FFE773", -"8 c #B52800", -"9 c #BD3C00", -"0 c #FFAA00", -"a c #FFE718", -"b c #FFE363", -"c c #B52400", -"d c #D65900", -"e c #FFD300", -"f c #FFDF18", -"g c #FFFF73", -"h c #A51800", -"i c #D65100", -"j c #FF9600", -"k c #FFAE00", -"l c #840000", -"m c #E74D00", -"n c #FF1800", -"o c #FF3400", -"p c #940000", -"q c #B50000", -"r c #F71400", -"s c #FF5100", -"t c #FF7100", -"u c #E70800", -"v c #E73000", -"w c #FF8A00", -"x c #9C0000", -"y c #E70000", -"z c #FF0000", -"A c #FF1C00", -"B c #FF2400", -"C c #C62400", -"D c #F70000", -"E c #312CB5", -"F c #6B3063", -"G c #0020FF", -"H c #0855FF", -"I c #5269C6", -"J c #0000FF", -"K c #0061FF", -"L c #3196FF", -"M c #847DC6", -"N c #3192FF", -"O c #4AA2FF", -"P c #63A2F7", -"Q c #C62031", -"R c #002CFF", -"S c #4AA6FF", -"T c #5AAAFF", -"U c #52A6FF", -"V c #5224A5", -"W c #73005A", -"X c #2996FF", -"Y c #0041FF", -"Z c #108AFF", -" ", -" ", -" .. .+@+. .. ", -" .#$. .+@+. .$#. ", -" %&*=-;@;-=*&% ", -" +>$$,',$$>+ ", -" %>>)!)>>% ", -" ..~{]^/(/^]{~.. ", -" .#*$_^: c #F5F5F6", -", c #F9F9FA", -"' c #FBFBFB", -") c #FCFCFC", -"................", -".++++++++++++++.", -".@@@@@+++++++++.", -".####.+++++++++.", -".............@+.", -".$$$$$$$$$$$$@+.", -".$$$$$$$$$$$$@+.", -"..............+.", -".%%%%%%%%%%.&&+.", -".%%%%%%%%%%.*&+.", -".@@@@@@@@@@.**+.", -".======@+++++++.", -".======.-;+++*+.", -".@@@@@@@>++,')+.", -".++++++++++++++.", -"................"}; - - -static char * vertBars_xpm[] = { -"16 17 16 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #FCFCFC", -"# c #FDFDFD", -"$ c #FEFEFE", -"% c #030003", -"& c #FBFBFB", -"* c #E83703", -"= c #F9F9FA", -"- c #0000FC", -"; c #F8F8F8", -"> c #F5F5F6", -", c #F7F7F7", -"' c #28DA18", -") c #830000", -"................", -".++++++++++++++.", -".+@#+#$$.%%%+++.", -".+&++##$.**.+++.", -".+=++....**.+++.", -".++++%--.**.+++.", -".++;+%--.**.+++.", -".+>,+%--.**.+++.", -".+%.%%--.**.+++.", -".+%''%--.**.+++.", -".+%''%--.**..%+.", -".+%''%--.**.)%+.", -".+%''%--.**.)%+.", -".+%''%--.**.)%+.", -".+%''%--.**.)%+.", -".+%''%--.**.)%+.", -"................"}; - -static char * area_xpm[] = { -"16 16 4 1", -" c #000000", -". c #FFFFFF", -"+ c #00FF00", -"@ c #FF0000", -" ", -" .............. ", -" .............. ", -" .............. ", -" ...++....+++.. ", -" ..+++++.+++++. ", -" .+++++@@@@++++ ", -" @@+++@@@@@@++@ ", -" @@@@@@@@ @@@@ ", -" @@ @@@ @@@ ", -" @ @ @@ ", -" ", -" ", -" ", -" ", -" "}; - -static char * cursors_xpm[] = { -"16 16 8 1", -" c None", -". c #D51309", -"+ c #010000", -"@ c #030003", -"# c #28DAC6", -"$ c #F90C02", -"% c #000002", -"& c #00000E", -" .. ", -" .. ", -" .. ", -" ++ .. ", -" @@ .. ", -" .......##.....", -" .......##..$..", -" +@ .. ", -" @@ .. ", -"+++++%+++..@ ", -"+++&+@+++..@ ", -" ++ .. ", -" ++ .. ", -" ++ .. ", -" ++ ", -" ++ "}; - -static char *close_xpm[] = { -"13 15 26 1", -" c None", -". c #8A9BA7", -"+ c #718D96", -"@ c #667987", -"# c #576876", -"$ c #A6A6A4", -"% c #535A62", -"& c #42454A", -"* c #878787", -"= c #F4F3F5", -"- c #E6EFF8", -"; c #DBE6F2", -"> c #D7DEEC", -", c #C2D4E6", -"' c #B8CCE9", -") c #B0BBE3", -"! c #97A5DA", -"~ c #333333", -"{ c #D8D8DA", -"] c #B7C0CC", -"^ c #C4C8C1", -"/ c #CADAE8", -"( c #98B6DF", -"_ c #A0A8BF", -": c #96A6AF", -"< c #CCD2D6", -" .+@# ", -"$#@+.+@#%%&* ", -"%=-;>,'))!!~{", -"%#@+.+@#%%&~]", -"^#=->/')(!&.]", -" #=+>_:)@!&] ", -" #=@>::)@!&] ", -" #=@>::)@!&] ", -" #=@>::)@!&] ", -" #=@>::)@!&] ", -" #=@>::)@!&] ", -" #=+>_:)@!&] ", -" #=->/')(!&] ", -" .@+.+@#%%@] ", -" <]]]]]]]]< "}; - -static char *logo_xpm[]={ -"32 32 144 2", -"Qt c None", -".# c #000000", -".B c #000080", -"#3 c #000087", -"#U c #00008e", -"#L c #000095", -"#D c #00009c", -".j c #00009e", -".y c #00009f", -"#u c #0000a3", -"#h c #0000aa", -".i c #0000ae", -"#b c #0000b1", -"#2 c #0000b7", -".6 c #0000b8", -".h c #0000bd", -".g c #0000bf", -"#T c #0000c0", -".W c #0000c6", -"#K c #0000c9", -".T c #0000cd", -"#C c #0000d2", -".f c #0000d4", -".x c #0000d6", -".G c #0000db", -"#9 c #0000dd", -"#1 c #0000de", -".m c #0000df", -"#S c #0000e0", -".C c #0000e2", -"#g c #0000e4", -".w c #0000e5", -"#t c #0000e6", -"#f c #0000e8", -".e c #0000e9", -"## c #0000ea", -".5 c #0000ec", -"#a c #0000ed", -".b c #0000ee", -".V c #0000ef", -".s c #0000f0", -".S c #0000f1", -".c c #0000f3", -".F c #0000f5", -".l c #0000f6", -".o c #0000f7", -".d c #0000f9", -".r c #0000fb", -".n c #0000fd", -".a c #0000ff", -".8 c #008000", -"ae c #008a00", -"#8 c #009500", -".R c #009e00", -"#0 c #009f00", -"#R c #00aa00", -".Q c #00ae00", -"#J c #00b400", -"ad c #00bb00", -".P c #00bd00", -".N c #00bf00", -"#s c #00c900", -".M c #00d400", -"#Z c #00d600", -"aj c #00dd00", -"#. c #00df00", -"#7 c #00e200", -"#Q c #00e400", -"#Y c #00e500", -"#P c #00e800", -".L c #00e900", -"#H c #00eb00", -".I c #00ee00", -"#r c #00f000", -"#I c #00f100", -".J c #00f300", -".2 c #00f400", -".9 c #00f600", -".K c #00f900", -".1 c #00fc00", -".E c #00ff00", -"ak c #800000", -"a# c #808080", -"#6 c #848484", -"#X c #898989", -"a. c #8b8b8b", -"#O c #8d8d8d", -"#5 c #909090", -"#E c #929292", -"ai c #950000", -"#W c #959595", -"#w c #969696", -"#N c #9a9a9a", -"#j c #9b9b9b", -"#4 c #9c9c9c", -"af c #9d9d9d", -"#B c #9e0000", -"an c #9f9f9f", -".7 c #a0a0a0", -"am c #a1a1a1", -"#V c #a2a2a2", -".3 c #a4a4a4", -"#v c #a5a5a5", -"#G c #a6a6a6", -"#M c #a8a8a8", -".Y c #a9a9a9", -"ac c #aa0000", -"#i c #aaaaaa", -"#F c #ababab", -"#y c #acacac", -".U c #adadad", -"#A c #ae0000", -"#x c #aeaeae", -"#k c #afafaf", -".4 c #b0b0b0", -"#d c #b1b1b1", -".O c #b2b2b2", -"#c c #b3b3b3", -".X c #b4b4b4", -".0 c #b5b5b5", -".A c #b6b6b6", -".Z c #b7b7b7", -".v c #b8b8b8", -".u c #b9b9b9", -".t c #bababa", -".H c #bbbbbb", -".q c #bcbcbc", -"#z c #bd0000", -".p c #bdbdbd", -".z c #bebebe", -"#q c #bf0000", -".D c #bfbfbf", -".k c #c0c0c0", -"ah c #c90000", -"#p c #d40000", -"al c #dd0000", -"ag c #e20000", -"ab c #e40000", -"aa c #e80000", -"#o c #e90000", -"#l c #ee0000", -"#m c #f30000", -"#n c #f90000", -"#e c #ff0000", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.#.#.#QtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.#.#.a.a.a.#.#QtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQt.#.b.c.d.a.e.f.g.#QtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQt.#.#.#.h.i.j.#.#.#QtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQt.#.#.a.a.#.#.#.a.a.#QtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQt.#.#.k.#.l.a.m.#.n.a.o.#QtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQt.#.#.p.q.q.#.b.a.g.#.r.a.s.#.#QtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQt.#.#.p.q.t.u.v.#.w.x.y.#.d.a.e.#.k.#.#QtQtQtQtQtQt", -"QtQtQtQtQt.#.#.k.z.q.t.v.A.#.#.#.i.B.#.o.a.C.#.z.D.k.#.#QtQtQtQt", -"QtQtQt.#.#.z.D.k.p.t.v.#.#.E.E.E.#.#.#.F.a.G.#.p.z.k.k.H.#.#QtQt", -"Qt.#.#.q.p.z.D.k.q.u.#.I.J.K.E.L.M.N.#.c.a.f.#.q.z.k.k.u.O.#QtQt", -".#.u.t.H.q.p.z.k.q.v.#.#.#.P.Q.R.#.#.#.S.a.T.#.t.p.k.k.A.U.#QtQt", -".#.v.u.t.q.p.z.k.H.A.#.E.E.#.#.#.E.E.#.V.a.W.#.u.q.k.k.X.Y.#QtQt", -".#.Z.v.t.H.p.z.k.t.0.#.I.E.N.#.1.E.2.#.b.a.g.#.v.q.k.k.O.3.#QtQt", -".#.A.A.Z.v.v.u.t.0.4.#.I.E.N.#.K.E.L.#.5.l.6.#.Z.H.k.k.4.7.#QtQt", -".#.0.0.0.0.0.0.0.4.#.#.#.Q.8.#.9.E#..####a#b.#.Z.H.k.k.4.7.#QtQt", -".#.X#c.O.O#d.4.#.##e#e#e.#.#.#.J.E.M.##f#g#h.#.0.Z.t.t#i#j.#QtQt", -".##c#d.4#k.U.##l#m#n#e#o#p#q.##r.E#s.##t.G#u.#.X.X.X.X#v#w.#QtQt", -".#.O.4#x#y#i.#.#.##z#A#B.#.#.#.I.E.N.##g#C#D.##c.4#x#x.7#E.#QtQt", -".##d#x#F.Y#G.##e#e.#.#.##e#e.##H#I#J.#.C#K#L.#.O.U#M#M#N#O.#QtQt", -".#.4#y.Y#G.#.##n#e#o.##n#e#o.##P#Q#R.##S#T#U.##d.Y#V#V#W#X.#QtQt", -".##k#F.#.#.k.##m#e#p.##m#e#p.##Y#Z#0.##1#2#3.#.#.##4#4#5#6.#QtQt", -".#.#.#.k.v.4.##l#e#q.##l#e#q.##7#s#8.##9.#.#.k.k.k.#.#a.a#.#QtQt", -".#.Z.H.k.4.7.#aaabac.##l#e#q.##.adae.#.#.D.z.p.q.H.t.u.#.#.#QtQt", -".#.##k#Faf#5.#agahai.#aaabac.#aj.#.#.D.k.z.q.t.v.Z.0#c#d.4.#QtQt", -"QtQt.#.#a.a#.#.##Aak.#agahai.#.#.p.z.D.k.p.t.v.0.O.4.U.#.#QtQtQt", -"QtQtQtQt.#.#.p.v.#.#.#al.#.#.H.q.p.z.D.k.q.v.0#d#x.#.#QtQtQtQtQt", -"QtQtQtQtQtQt.#.#.p.v.#.#.0.0.0.0.0.0.0.0#d#x#F.#.#QtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQt.#.##c.O#d.4#k#x.U#y#F#F#M.#.#QtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQt.#.#.U#F.Y#M#G.3#V.#.#QtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQt.#.#.3aman.#.#QtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQt.#.#.#QtQtQtQtQtQtQtQtQtQtQtQtQtQtQt"}; - - -/* XPM */ -static char * hand_xpm[] = { -"16 20 3 1", -" c None", -". c #000000", -"+ c #FFFFFF", -" .. ", -" .++. ", -" .++. ", -" .++. ", -" .++. ", -" .++. ", -" .++... ", -" .++.++... ", -" .++.++.++.. ", -" .. .++.++.++.+.", -".++..++.++.++.+.", -".+++.++++++++++.", -" .+++++++++++++.", -" .++++++++++++.", -" .++++++++++++.", -" .++++++++++. ", -" .++++++++++. ", -" .++++++++. ", -" .++++++++. ", -" .......... "}; - -/* XPM */ -static char * drag_curve_xpm[] = { -"13 16 4 1", -" c None", -". c #FF0000", -"+ c #000000", -"@ c #FFFFFF", -" .. . ", -" . . . ", -" . . . ", -" . .. ", -" . ", -" ++.++ ++ ", -" +@@+@@+@@++ ", -" +@@@@@@@@+@+", -" +@@@@@@@@@+", -" ++@@@@@@@@@+", -"+@@@@@@@@@@@+", -"+@@@@@@@@@@+ ", -" +@@@@@@@@@+ ", -" +@@@@@@@+ ", -" +@@@@@@+ ", -" +@@@@@@+ "}; - -/* XPM */ -static char *errors_xpm[]={ -"3 11 2 1", -" c None", -". c #000000", -"...", -" . ", -" . ", -" . ", -"...", -"...", -"...", -" . ", -" . ", -" . ", -"..."}; - -static char *curves_xpm[]={ -"14 16 5 1", -" c None", -". c #000000", -"+ c #100000", -"@ c #FFFFFF", -"# c #FF0000", -".......+++++++", -".@@@@@@@@@@@@+", -".@@@@@@@@@#@@+", -".@..@@@@@###@+", -".@@.@@@@@@#@@+", -".@@.@@@@@@@@@.", -".@..@@##@@@#@.", -".@@.@#@@#@@#@.", -".@@.@#@@#@@#@.", -".@..#@@@@##@@.", -".@@.#@@@@@@@@.", -".@@.#@@@@@@@@.", -".@..........@.", -".@@.@@.@@.@@@.", -".@@@@@@@@@@@@.", -".............."}; - -static char *arrow_xpm[]={ -"11 12 2 1", -" c None", -". c #000000", -" ......", -" .....", -" ....", -" ....", -" .. ..", -" .. .", -" .. ", -" .. ", -" .. ", -" .. ", -".. ", -". "}; - -static char *legend_xpm[]={ -"14 15 4 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #0000FF", -"..............", -".++++++++++++.", -".+++++++...++.", -".+++++++.++.+.", -".+.....+...++.", -".+++++++.++.+.", -".+++++++....+.", -".++++++++++++.", -".++++++++...+.", -".++@@+++.++++.", -".+@@@@@+.++++.", -".++@@+++.++++.", -".++++++++...+.", -".++++++++++++.", -".............."}; - - -static char *select_xpm[]={ -"16 16 4 1", -" c None", -". c #D51309", -"+ c #010000", -"@ c #28DAC6", -" . ", -" . ", -" . ", -" . ", -" +++.+++ ", -" + . + ", -" + . + ", -"........@.......", -" + . + ", -" + . + ", -" +++.+++ ", -" . ", -" . ", -" . ", -" . ", -" . "}; - -static char *cursor_16[]={ -"16 16 2 1", -". c None", -"# c #000000", -"................", -"................", -"................", -"........#.......", -"........#.......", -".....#######....", -".....#.....#....", -"...###.....###..", -".....#.....#....", -".....#######....", -"........#.......", -"........#.......", -"................", -"................", -"................", -"................"}; - -static char *unzoom_xpm[]={ -"15 15 2 1", -". c None", -"# c #000000", -"..#............", -".###........##.", -"#.#.#...##..##.", -"..#..##.##.....", -"..#..##....##..", -"..#........##..", -"..#...##.......", -"..#...##.##.##.", -"#.#.#....##.##.", -".###...........", -"..#...#.....#..", -"..#..#.......#.", -"..#############", -".....#.......#.", -"......#.....#.."}; - -static char *paste_xpm[]={ -"16 15 7 1", -". c None", -"# c #000000", -"d c #00007f", -"c c #7f7f00", -"b c #7f7f7f", -"a c #ffff00", -"e c #ffffff", -"................", -"......####......", -"..#####aa#####..", -".#bcb#a##a#cbc#.", -".#cb#......#cb#.", -".#bc########bc#.", -".#cbcbcbcbcbcb#.", -".#bcbcbddddddd#.", -".#cbcbcdeeeeedd.", -".#bcbcbdeeeeeded", -".#cbcbcdedddeddd", -".#bcbcbdeeeeeeed", -".#cbcbcdeddddded", -"..#####deeeeeeed", -".......ddddddddd"}; - -static char *cut_xpm[]={ -"18 18 3 1", -". c None", -"# c #000000", -"a c #00007f", -"..................", -"..................", -"..................", -".......#...#......", -".......#...#......", -".......#...#......", -".......##.##......", -"........#.#.......", -"........###.......", -".........#........", -"........a#a.......", -"........a.aaa.....", -"......aaa.a..a....", -".....a..a.a..a....", -".....a..a.a..a....", -".....a..a..aa.....", -"......aa..........", -".................."}; - -static char *copy_xpm[]={ -"15 13 4 1", -"# c None", -". c #000000", -"b c #00007f", -"a c #ffffff", -"......#########", -".aaaa..########", -".aaaa.a.#######", -".a..a.bbbbbb###", -".aaaaabaaaabb##", -".a....baaaabab#", -".aaaaaba..abbbb", -".a....baaaaaaab", -".aaaaaba.....ab", -"......baaaaaaab", -"######ba.....ab", -"######baaaaaaab", -"######bbbbbbbbb"}; - -/* XPM */ -static char * text_xpm[] = { -"12 11 2 1", -" c None", -". c #1F0E77", -"............", -".. .. ..", -" .. ", -" .. ", -" .. ", -" .. ", -" .. ", -" .. ", -" .. ", -" .. ", -" .... "}; - - -static char * duplicate_xpm[] = { -"14 14 4 1", -" c None", -". c #000000", -"+ c #0000FF", -"@ c #C6C4C4", -"..............", -".++++++++++++.", -".@@@@@@@@@@@@.", -".@@@@@@@@@@@@.", -".@@@@@@@@@@@@.", -"..............", -" ", -" ", -"..............", -".++++++++++++.", -".@@@@@@@@@@@@.", -".@@@@@@@@@@@@.", -".@@@@@@@@@@@@.", -".............."}; - -static char *new_xpm[]={ -"14 16 4 1", -"# c None", -". c #000000", -"b c #a0a7af", -"a c #ffffff", -"..........####", -".aaaaaaaa..###", -".aaaaaaaa.b.##", -".aaaaaaaa.bb.#", -".aaaaaaaa.bbb.", -".aaaaaaaa.....", -".aaaaaaaaaaaa.", -".aaaaaaaaaaaa.", -".aaaaaaaaaaaa.", -".aaaaaaaaaaaa.", -".aaaaaaaaaaaa.", -".aaaaaaaaaaaa.", -".aaaaaaaaaaaa.", -".aaaaaaaaaaaa.", -".aaaaaaaaaaaa.", -".............."}; - -static char *addCol_xpm[]={ -"15 16 5 1", -". c None", -"# c #000000", -"a c #0018f0", -"b c #ff0000", -"c c #ffffff", -"...............", -".......######..", -".......#aaaa#..", -".......#aaaa#..", -".......######..", -"..b....#cccc#..", -"..b....######..", -".bbb...#cccc#..", -"..b....######..", -"..b....#cccc#..", -".......######..", -".......#cccc#..", -".......######..", -".......#cccc#..", -".......######..", -"..............."}; - -static char *pPlot_xpm[]={ -"13 13 2 1", -". c None", -"# c #000000", -"..........###", -"..........###", -"..........###", -".............", -".............", -".....###.....", -".....###.....", -".....###.....", -".............", -".............", -"###..........", -"###..........", -"###.........."}; - - -static char *lpPlot_xpm[]={ -"13 13 2 1", -". c None", -"# c #000000", -"..........###", -"..........###", -"..........###", -".........#...", -"........#....", -".....###.....", -".....###.....", -".....###.....", -"....#........", -"...#.........", -"###..........", -"###..........", -"###.........."}; - -static char *lPlot_xpm[]={ -"14 14 2 1", -". c None", -"# c #000000", -".............#", -"............#.", -"...........#..", -"..........#...", -".........#....", -"........#.....", -".......#......", -"......#.......", -".....#........", -"....#.........", -"...#..........", -"..#...........", -".#............", -"#............."}; - - -static char *table_xpm[]={ -"15 16 5 1", -"# c None", -". c #000000", -"c c #2007f0", -"b c #8f888f", -"a c #ffffff", -"..........#####", -".aaaaaaaa..####", -".aaaaaaaa.b.###", -".aaaaaaaa.bb.##", -".aaaaaaaa.bbb.#", -".aaaaaaaa.....#", -".aaaaaaaaaaaa.#", -".a.............", -".a.cc.cc.cc.cc.", -".a.............", -".a.aa.aa.aa.aa.", -".a.aa.aa.aa.aa.", -".a.............", -".a.aa.aa.aa.aa.", -".a.aa.aa.aa.aa.", -"..............."}; - -static char *multiload_xpm[]={ -"16 15 5 1", -". c None", -"# c #000000", -"b c #2007f0", -"a c #ff0000", -"c c #ffffff", -".#..##.##.......", -"##...#..#.......", -".#..#..##.aaaa..", -".#..#...#....a..", -"###.##.##..aaaaa", -"............aaa.", -"############.a..", -"#b#bb#bb#bb#....", -"################", -"#c#.#b#bb#bb#bb#", -"################", -"#c#.#c#..#..#..#", -"################", -"....#c#..#..#..#", -"....############"}; - -static char *import_xpm[]={ -"16 15 5 1", -" c None", -". c #000000", -"+ c #FF0000", -"@ c #2F2FF0", -"# c #FFFFFF", -" . .. .. ", -".. . . ", -" . . .. ++++ ", -" . . . + ", -"... .. .. +++++", -" +++ ", -" + ", -" ", -" ............", -" .@.@@.@@.@@.", -" ............", -" .#.##.##.##.", -" ............", -" .#.##.##.##.", -" ............"}; - -static char * graph_xpm[] = { -"14 14 6 1", -" c None", -". c #030003", -"+ c #FFFFFF", -"@ c #FC0D00", -"# c #2F28EF", -"$ c #0000FC", -"..............", -".++++@@++++++.", -".++++@@++++++.", -".+++@++@+++++.", -".++@++++@@+++.", -".+@+++++@@++#.", -".++++##+++@+#.", -".++++##++++$+.", -".+++#++#++$+@.", -".++#++++##+++.", -".+#+++++##+++.", -".++++++++++++.", -".++++++++++++.", -".............."}; - -static char *worksheet_xpm[]={ -"13 12 32 1", -" c black", -". c #000100", -"X c #010101", -"o c #000002", -"O c #000201", -"+ c #000005", -"@ c #000207", -"# c #000209", -"$ c #000309", -"% c #00020B", -"& c #00030C", -"* c #00030E", -"= c #000212", -"- c #000519", -"; c #00041B", -": c #00061E", -"> c #00071E", -", c #000720", -"< c #000821", -"1 c #000927", -"2 c #000929", -"3 c #000A33", -"4 c #000C37", -"5 c #000C39", -"6 c #4C7799", -"7 c #597384", -"8 c #5A7387", -"9 c #5A7485", -"0 c #517595", -"q c #FFFFFD", -"w c #FEFFFF", -"e c gray100", -/* pixels */ -"<,,1542,,254;", -"-78:66:77:60=", -"#@##&&&@##&#X", -"XeeXeeXeeXeeX", -"XeeXeeXeeXeeX", -"XXXXXXXXXXXXX", -"XeeXeeXeeXeeX", -"XeeXeeXeeXeeX", -"XXXXXXXXXXXXX", -"XeeXeeXeeXeeX", -"XeeXeeXeeXeeX", -"XXXXXXXXXXXXX" -}; - -static char *folder_xpm[]={ -"32 32 161 2", -"Qt c None", -".b c #000000", -"aE c #503200", -"aD c #583700", -"aC c #5b3900", -"aA c #5e3c00", -"aB c #633f00", -"az c #664100", -"ax c #6a4400", -"ay c #6b4400", -"av c #6e4700", -"au c #734a00", -"aw c #774c00", -"as c #7a4f00", -"at c #7b4f00", -"ar c #7e5100", -".# c #808080", -"ap c #815400", -"aq c #865700", -"an c #895900", -"am c #8d5c00", -"ao c #966200", -".R c #a6caf0", -"aj c #c0c0c0", -".2 c #c5c5c5", -"#W c #c9c9c9", -".9 c #cbcbcb", -".8 c #cfcfcf", -"#h c #d2d2d2", -"al c #d4d47c", -"ak c #d5d57e", -"#X c #d5d5d5", -"af c #d6d680", -"ae c #d7d782", -"ad c #d8d884", -"#5 c #d8d885", -"#4 c #d9d987", -"#p c #d9d9d9", -"ac c #dada89", -"#3 c #dada8a", -"#U c #dbdb8a", -"#2 c #dbdb8c", -"#T c #dcdc8c", -"ab c #dcdc8e", -"#1 c #dcdc8f", -"#M c #dddd8f", -"#L c #dede91", -"#I c #dfdf94", -"#J c #dfdfdf", -"#H c #e0e096", -"#Y c #e0e0e0", -"#S c #e1e196", -"#G c #e1e199", -"#x c #e2e299", -"#w c #e3e39b", -"#F c #e3e39c", -"#K c #e3e3e3", -"#n c #e4e49e", -"#E c #e4e49f", -"#m c #e5e5a0", -"#D c #e5e5a1", -"#v c #e6e6a1", -"#f c #e6e6a3", -"#P c #e6e6e6", -"#u c #e7e7a4", -"#e c #e7e7a6", -"#l c #e8e8a6", -"#t c #e8e8a7", -".Z c #e9e9a8", -"#d c #e9e9a9", -"ag c #e9e9aa", -".Y c #eaeaab", -"#c c #eaeaac", -".V c #ebebac", -"#8 c #ebebae", -".U c #ececae", -"#b c #ececaf", -"#7 c #ececb0", -".P c #ededb1", -"#a c #ededb2", -"#O c #ededed", -".O c #eeeeb3", -"#6 c #eeeeb4", -".T c #efefb4", -"## c #efefb5", -".N c #efefb6", -".K c #f0f0b6", -".S c #f0f0b7", -".M c #f0f0b8", -".J c #f1f1b8", -"#N c #f1f1b9", -"#V c #f1f1ba", -".I c #f2f2ba", -".F c #f2f2bb", -".E c #f2f2bc", -".H c #f3f3bc", -".L c #f3f3bd", -".D c #f3f3be", -".G c #f4f4be", -"#y c #f4f4bf", -".C c #f4f4c0", -".x c #f5f5c0", -".w c #f5f5c1", -".B c #f5f5c2", -".v c #f6f6c2", -".A c #f6f6c3", -".u c #f7f7c4", -".r c #f7f7c5", -".q c #f7f7c6", -".7 c #f8f8c6", -".p c #f8f8c7", -".o c #f8f8c8", -".t c #f9f9c8", -".n c #f9f9c9", -".m c #f9f9ca", -".s c #fafaca", -".l c #fafacb", -".Q c #fafacc", -".k c #fbfbcc", -".j c #fbfbcd", -".y c #fbfbce", -".i c #fcfcce", -".h c #fcfccf", -".z c #fcfcd0", -".g c #fdfdd0", -".e c #fdfdd1", -".f c #fdfdd2", -".c c #fefed2", -".d c #fefed3", -".a c #ffffd4", -".0 c #ffffda", -".W c #ffffdb", -".X c #ffffdc", -".1 c #ffffdd", -".3 c #ffffde", -"#g c #ffffdf", -".4 c #ffffe0", -".5 c #ffffe1", -"#o c #ffffe2", -".6 c #ffffe3", -"#. c #ffffe4", -"#z c #ffffe5", -"#i c #ffffe6", -"#j c #ffffe7", -"#9 c #ffffe8", -"#q c #ffffe9", -"#r c #ffffea", -"#k c #ffffeb", -"#A c #ffffec", -"#B c #ffffed", -"#s c #ffffee", -"#Q c #ffffef", -"a. c #fffff0", -"#C c #fffff1", -"#Z c #fffff2", -"#R c #fffff3", -"#0 c #fffff4", -"a# c #fffff5", -"ah c #fffff6", -"aa c #fffff7", -"ai c #fffff8", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQt.#.#.#.#.#.#.#QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"Qt.#.a.a.a.a.a.a.a.bQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -".#.c.c.c.c.c.c.c.d.d.bQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -".#.e.e.e.e.e.f.f.c.c.c.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#Qt", -".#.g.g.g.g.e.e.e.c.c.c.c.d.d.d.a.a.c.e.g.h.i.j.k.l.m.n.o.p.q.r.b", -".#.i.i.i.h.h.g.g.e.e.e.c.c.d.d.a.a.c.e.h.i.k.l.s.t.p.r.u.v.w.x.b", -".#.j.j.y.y.h.h.z.g.e.e.f.c.d.d.a.a.c.g.i.k.l.n.p.r.A.B.C.D.E.F.b", -".#.k.k.j.j.i.i.h.g.g.e.e.c.c.d.a.a.e.h.j.l.n.p.r.v.x.G.H.I.J.K.b", -".#.s.s.l.k.k.j.i.h.h.g.e.e.c.#.#.#.#.#.b.m.p.r.v.C.L.F.M.N.O.P.b", -".#.n.n.m.l.Q.k.j.i.h.z.g.#.#.R.R.R.R.R.R.b.b.v.x.L.I.S.T.P.U.V.b", -".#.t.t.n.s.l.k.j.i.i.h.#.R.R.R.R.R.W.W.X.R.R.b.G.I.S.T.P.U.Y.Z.b", -".#.t.t.n.s.l.k.j.i.i.#.R.R.R.R.0.W.1.2.3.4.5.6.b.I.S.T.P.U.Y.Z.b", -".#.7.7.p.p.o.t.n.n.m.#.R.R.0.8.1.3.8.9.5.6#..2.b###a#b#c#d#e#f.b", -".#.r.r.r.r.r.r.r.q.#.R.R.R.X.8#g.5.6#h#.#i#j.8#k.b.V#d#l#f#m#n.b", -".#.u.A.A.A.A.v.v.v.#.R.R.3#g.2#o#.#i#p#j#q#r#p#s.b#t#u#v#n#w#x.b", -".#.A.B.w.w.C.C#y#y.#.R.R.5#o#p#z#j#q#p#r#A#B#p#C.b#D#E#F#G#H#I.b", -".#.w.C#y.D.L.E.F.I.#.R.R.5#o#p#z#j#q#J#r#A#B#K#C.b#F#x#H#I#L#M.b", -".#.x.G.L.H.I#N.J.S.#.R.R.6#.#O#j#q#k#P#A#s#Q#O#R.b#S#I#L#M#T#U.b", -".##y.L.F#V.M.K##.O.P.#.R.8.8#q#r#A#W#X#Y#C#Z#0.8.b#L#1#2#3#4#5.b", -".#.D.E#V.M.N#6#a#7#8.#.R#9#q#k#A#sa.a.#C#Ra#aa.bab#2ac#4adaeaf.b", -".#.L#V.M##.O.P.U.Vag#t.##k#A#s#Q#C#R#R#0ahai.baj.b#4#5aeafakal.b", -"Qt.b.b.b.b.b.b.b.b.b.b.b.b.b#C#Z#0ahahaa.b.bajajaj.b.b.b.b.b.bQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQt.b.b.b.b.b.b.b.#.#aj.#am.bQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.b.#.#anaoap.bQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.baqaoaraoas.bQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.bataoauaoav.bQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.bawaoauaoax.bQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.bayaoazaoaA.b", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.baBaoaCao.b", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.baDaoaE.b", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.b.b.bQt"}; - - -static char *fileopen_xpm[] = { -" 16 13 5 1", -". c #040404", -"# c #808304", -"a c None", -"b c #f3f704", -"c c #f3f7f3", -"aaaaaaaaa...aaaa", -"aaaaaaaa.aaa.a.a", -"aaaaaaaaaaaaa..a", -"a...aaaaaaaa...a", -".bcb.......aaaaa", -".cbcbcbcbc.aaaaa", -".bcbcbcbcb.aaaaa", -".cbcb...........", -".bcb.#########.a", -".cb.#########.aa", -".b.#########.aaa", -"..#########.aaaa", -"...........aaaaa" -}; - -static char *fileprint_xpm[] = { -" 16 14 6 1", -". c #000000", -"# c #848284", -"a c #c6c3c6", -"b c #ffff00", -"c c #ffffff", -"d c None", -"ddddd.........dd", -"dddd.cccccccc.dd", -"dddd.c.....c.ddd", -"ddd.cccccccc.ddd", -"ddd.c.....c....d", -"dd.cccccccc.a.a.", -"d..........a.a..", -".aaaaaaaaaa.a.a.", -".............aa.", -".aaaaaa###aa.a.d", -".aaaaaabbbaa...d", -".............a.d", -"d.aaaaaaaaa.a.dd", -"dd...........ddd" -}; - -/* XPM */ -static char *filesave_xpm[] = { -"14 15 54 1", -" c None", -". c #7393A7", -"+ c #12486B", -"@ c #104769", -"# c #BACDDA", -"$ c #AAB9C4", -"% c #FFFFFF", -"& c #104668", -"* c #90B1C5", -"= c #768FA1", -"- c #0D4365", -"; c #82A7BD", -"> c #648195", -", c #0B4163", -"' c #79A0B8", -") c #55778D", -"! c #083F60", -"~ c #709BB5", -"{ c #4B6E87", -"] c #063C5D", -"^ c #6C98B3", -"/ c #4B728C", -"( c #DEE4E8", -"_ c #003959", -": c #5D86A0", -"< c #436982", -"[ c #003656", -"} c #6B97B2", -"| c #003453", -"1 c #557C97", -"2 c #003151", -"3 c #709CB7", -"4 c #6F9BB6", -"5 c #486D86", -"6 c #CECED0", -"7 c #687782", -"8 c #E8E9EA", -"9 c #002F4E", -"0 c #7BA6C1", -"a c #7BA5C0", -"b c #557991", -"c c #D8D8DA", -"d c #74828D", -"e c #F2F3F3", -"f c #002C4B", -"g c #8CB6D0", -"h c #8BB5CF", -"i c #688AA1", -"j c #E6E6E8", -"k c #85939E", -"l c #CBCBCB", -"m c #002B49", -"n c #536D80", -"o c #E0E0E0", -".++++++++++++.", -"@#$%%%%%%%%$#@", -"&*=%%%%%%%%=*&", -"-;>%%%%%%%%>;-", -",')%%%%%%%%)',", -"!~{%%%%%%%%{~!", -"]^/(%%%%%%(/^]", -"_^:/<<<<< c #82A7BD", -", c #648195", -"' c #FACCCC", -") c #0B4163", -"! c #79A0B8", -"~ c #55778D", -"{ c #EF3A3A", -"] c #FCE1E1", -"^ c #083F60", -"/ c #709BB5", -"( c #4B6E87", -"_ c #F9C4C4", -": c #063C5D", -"< c #6C98B3", -"[ c #4B728C", -"} c #DEE4E8", -"| c #003959", -"1 c #5D86A0", -"2 c #436982", -"3 c #003656", -"4 c #6B97B2", -"5 c #003453", -"6 c #557C97", -"7 c #003151", -"8 c #709CB7", -"9 c #6F9BB6", -"0 c #486D86", -"a c #CECED0", -"b c #687782", -"c c #E8E9EA", -"d c #002F4E", -"e c #7BA6C1", -"f c #7BA5C0", -"g c #557991", -"h c #D8D8DA", -"i c #74828D", -"j c #F2F3F3", -"k c #002C4B", -"l c #8CB6D0", -"m c #8BB5CF", -"n c #688AA1", -"o c #E6E6E8", -"p c #85939E", -"q c #CBCBCB", -"r c #002B49", -"s c #536D80", -"t c #E0E0E0", -".++++++++++++.", -"@#$%%%%%%%%$#@", -"&*=%------%=*&", -";>,%''''''%,>;", -")!~%{{{{{]%~!)", -"^/(%_____%%(/^", -":<[}%%%%%%}[<:", -"|<1[222222[1<|", -"3<<<444444<<<3", -"5<<62222226<<5", -"7890aaabcc0987", -"defghhhijjgfed", -"klmnooop%%nmlk", -"qrrrrrrrrrrrrs", -" qqqqqqqqqqqqt"}; - -static char *erase_xpm[]={ -"29 28 256 2", -"Qt c None", -"aC c #000000", -".x c #000009", -"an c #000200", -"bt c #000300", -"#d c #000309", -"#W c #000400", -"b. c #00070d", -"#X c #00070f", -".0 c #000717", -"aV c #000803", -".l c #000a00", -"ao c #000e00", -".c c #00120f", -"#b c #00121e", -".h c #001308", -".X c #001b06", -".J c #001c00", -".e c #010007", -"bD c #010101", -"#I c #011412", -"bQ c #020202", -"aA c #030000", -"bZ c #040404", -".w c #040c0f", -"bk c #050505", -"bh c #060000", -"#e c #060002", -"ab c #070614", -"bL c #070707", -"aa c #070e06", -"#s c #0b0000", -"bW c #0b0b0b", -"aB c #0c130b", -".M c #0e0000", -".g c #0e0007", -"#a c #0f0000", -"bl c #0f0004", -"a9 c #0f0f0f", -"a3 c #10030a", -"aP c #10050d", -".L c #110015", -"b8 c #111111", -"bN c #131313", -"#c c #160e01", -"#t c #170700", -".y c #181d07", -".k c #190000", -".b c #190002", -".1 c #190c13", -".i c #1b0000", -".f c #1b0a12", -".j c #24081e", -".# c #25000e", -"aF c #260000", -".a c #290019", -".d c #38000b", -"bM c #6a6a6a", -"aE c #797979", -"bX c #7a7a7a", -"bj c #7b7b7b", -"bA c #7e7e7e", -"b9 c #7f7f7f", -"bH c #828282", -"az c #83767d", -"aD c #838383", -"bG c #898989", -"bz c #8d8d8d", -"bY c #969696", -"bU c #a7a7a7", -"#Q c #aa2b34", -"bS c #ababab", -"b3 c #b3b3b3", -"b7 c #b5b5b5", -"b4 c #bcbcbc", -"b1 c #c0c0c0", -"b0 c #c3c3c3", -"bR c #c8c8c8", -"bV c #c9c9c9", -"b6 c #cacaca", -"b5 c #cccccc", -"b2 c #cecece", -".S c #d51c17", -"bT c #d5d5d5", -"#L c #d5fff4", -"a2 c #d6f7ee", -"#w c #dc0419", -".G c #ddfff1", -"ax c #def7f3", -".s c #dffff3", -"aI c #e1f4d6", -".I c #e3f1f4", -"#P c #e3ffec", -"bO c #e4e4e4", -".N c #e4ffff", -"aH c #e5000d", -"#H c #e5dbdc", -"#r c #e5ffff", -".O c #e70000", -"#n c #e7ffea", -".r c #e7fffa", -"#Y c #e7fffd", -"bm c #e7ffff", -"#y c #e80014", -"bJ c #e8e8e8", -"aw c #e8fdf6", -"ar c #e8feff", -".A c #e9f8fd", -"bc c #e9fce0", -"ae c #e9ffec", -"#A c #ea001d", -"#3 c #eafdfb", -"#l c #eaffe8", -"a0 c #eafff8", -"a1 c #eaffff", -"b# c #ebf1ff", -"#m c #ebfff5", -"ai c #ebfffd", -"bd c #ebffff", -"a5 c #eceaeb", -".5 c #edfce7", -".V c #edfffd", -"aj c #edffff", -".2 c #eeeff4", -"ba c #eefdea", -".t c #eeffdf", -"#1 c #eefff8", -"#F c #eefffc", -"as c #ef0b0c", -"a8 c #efefef", -".B c #f01a00", -".R c #f0ffff", -".H c #f10018", -"aR c #f1f3f0", -"#f c #f1fffa", -"#8 c #f1ffff", -"#T c #f2f3f7", -"bv c #f2f9f1", -".3 c #f2fff6", -"a4 c #f3eaef", -"aN c #f4f5f9", -".E c #f4fff4", -"#Z c #f4ffff", -"#E c #f5f6f1", -"a7 c #f5fbf7", -"bb c #f5fbff", -".n c #f5fffd", -"ag c #f5ffff", -"bF c #f6f6f6", -".4 c #f6fafb", -"aS c #f6fff9", -"bK c #f7f7f7", -"aM c #f7fff3", -"#q c #f7fff5", -"av c #f7fffc", -"#C c #f80243", -"a# c #f8f2f2", -"bI c #f8f8f8", -"#9 c #f8fcff", -".8 c #f8fdf9", -"bw c #f8fefa", -"aG c #f8ffea", -".K c #f8fff6", -"bp c #f8fffb", -"#S c #f8fffd", -".u c #f8ffff", -".U c #f9002d", -"#J c #f9f4f8", -"bP c #f9f9f9", -"ak c #f9faff", -"ah c #f9fdff", -"#7 c #f9fff8", -"aX c #f9fffd", -".z c #fa000c", -"aU c #fafafa", -"#v c #fafee3", -"#u c #fb002c", -"aJ c #fb0e2a", -"#k c #fbeded", -"ay c #fbf6fd", -"bB c #fbfbfb", -"#4 c #fbffff", -"#O c #fc0013", -"aq c #fc0f00", -"bC c #fcfcfc", -".P c #fcfdff", -"bu c #fcfffa", -"aO c #fcffff", -".7 c #fdfdf3", -"#p c #fdfeff", -".D c #fe0100", -"#0 c #fef1de", -"#g c #fef8f8", -"aW c #fef9f5", -"bE c #fefefe", -"a6 c #fefffd", -"ap c #ff011c", -".F c #ff0227", -".W c #ff0233", -"#M c #ff0800", -".Q c #ff1106", -"#K c #ff1117", -"#5 c #ffdbda", -"aZ c #ffdff1", -"## c #ffe0f8", -"ad c #ffe1f4", -".9 c #ffe7e5", -"#R c #ffe7e6", -".T c #ffe7ed", -"#D c #ffe9f4", -"aK c #ffeae7", -".o c #ffebe3", -".C c #ffeeff", -"at c #ffefff", -"#N c #fff0f7", -"af c #fff1ec", -"#G c #fff1ff", -"#6 c #fff2eb", -".Y c #fff2ff", -".q c #fff3ea", -"ac c #fff4f7", -"a. c #fff4fb", -"by c #fff4ff", -"#. c #fff5d1", -"aY c #fff5f3", -"br c #fff5fa", -"bx c #fff6fa", -"#o c #fff6ff", -".v c #fff7e8", -"#h c #fff7f1", -"bs c #fff7f3", -".p c #fff7f7", -".6 c #fff8fc", -"bq c #fff9f2", -"bg c #fff9f9", -"bn c #fff9ff", -"aL c #fffae3", -"bo c #fffafa", -"al c #fffaff", -"#B c #fffbf0", -"be c #fffbf8", -"bf c #fffbfa", -"#U c #fffbff", -"#2 c #fffcef", -"#j c #fffcf3", -"am c #fffcfd", -"aQ c #fffcff", -"#x c #fffde3", -"#i c #fffdfa", -"#V c #fffefd", -"bi c #fffeff", -"#z c #ffffe3", -"au c #ffffec", -".Z c #ffffed", -".m c #fffff6", -"aT c #ffffff", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQt.#.a.b.c.d.e.f.g.h.i.j.kQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQt.l.m.n.o.p.q.r.s.t.u.v.w.xQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQt.y.z.A.B.C.D.E.F.G.H.I.J.K.LQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQt.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.0QtQtQtQtQtQtQtQtQtQt", -"QtQtQtQt.1.2.3.4.5.6.7.8.9#.##.M#a#b#c#dQtQtQtQtQtQtQtQtQt", -"QtQtQtQt#e#f#g#h#i#j#k.r#l#m#n#o#p#q#r#sQtQtQtQtQtQtQtQtQt", -"QtQtQtQt#t#u#v#w#x#y#z#A#B#C#D#E#F#G#H#IQtQtQtQtQtQtQtQtQt", -"QtQtQtQt.M#J#K#L#M#N#O#P#Q#R#j#S#T#U#V#WQtQtQtQtQtQtQtQtQt", -"QtQtQtQt#X#Y#Z#0#1#2#3#4#5#6#7#8#9a.a#aaQtQtQtQtQtQtQtQtQt", -"QtQtQtQtabacadae#Zafagah#j#7aiajakalamanQtQtQtQtQtQtQtQtQt", -"QtQtQtQtaoap.uaqarasatauavawaxagayazaAaBaCaCaDaEQtQtQtQtQt", -"QtQtQtQtaFaGaHaIaJaKaLaMaNaO#palaPaQaRaSaTaTaUaCQtQtQtQtQt", -"QtQtQtQtaVaWaXaYaZa0a1a2#Ualala3a4a5a6a7aTa8a9aCQtQtQtQtQt", -"QtQtQtQtb.b#babbbcbdbe.Rbfbgbh#Va6a6bi.6aUaCbjbkQtQtQtQtQt", -"QtQtQtQtblbmbnbobpbqbrbsaSbtbubvbpbwbxbyaCbzbAaCQtQtQtQtQt", -"QtQtQtQtaCaTaTaTbBaTaTbCbDbEbFaTbFaTaTaCbGbHaCQtQtQtQtQtQt", -"QtQtQtQtaCbIaTbJbEaTbKbLbKaTaTaTbFbEaCbAbMaCQtQtQtQtQtQtQt", -"QtQtQtQtbNaTbOaTbPaTbCbQbRbSbTbUbVbWbXbYbNQtQtQtQtQtQtQtQt", -"QtQtQtQtaCaCbLaCbZaCaCb0b1b2b3bRb4aCbXaCQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtaCb5b3b6bVb7b6aCbLQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtaCb8aCaCbLbWb9QtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt"}; - -static char *zoom_xpm[]={ -"20 20 106 2", -" c None", -". c #8D8C89", -"+ c #50504F", -"@ c #202121", -"# c #010101", -"$ c #1F2020", -"% c #4F4F4E", -"& c #3B3A3A", -"* c #222224", -"= c #6E777E", -"- c #95A0AA", -"; c #ABBAC9", -"> c #8998A6", -", c #606C77", -"' c #1D2022", -") c #393939", -"! c #111211", -"~ c #5F6368", -"{ c #D1DBE6", -"] c #D8E3ED", -"^ c #D5E0EB", -"/ c #CDDBE8", -"( c #C3D3E3", -"_ c #B7CBDE", -": c #A6BCD2", -"< c #48545E", -"[ c #101110", -"} c #DDE6EF", -"| c #E5ECF3", -"1 c #E6EDF3", -"2 c #000000", -"3 c #BED0E1", -"4 c #B1C6DB", -"5 c #A3BCD5", -"6 c #47535E", -"7 c #F1F5F8", -"8 c #F4F7FA", -"9 c #070606", -"0 c #E3C278", -"a c #C1D2E2", -"b c #B4C8DC", -"c c #A6BED6", -"d c #98B2CC", -"e c #1C1F22", -"f c #F9FAFC", -"g c #0C0B0B", -"h c #E6D2A2", -"i c #C2D3E3", -"j c #B4C9DC", -"k c #A6BFD6", -"l c #9DB8D2", -"m c #566573", -"n c #E5D5B2", -"o c #74899C", -"p c #1E2020", -"q c #E5C479", -"r c #EED9A8", -"s c #F2E1BC", -"t c #EDD5A0", -"u c #E3BF6F", -"v c #D9A636", -"w c #D1940C", -"x c #8CA4BB", -"y c #030303", -"z c #232425", -"A c #A9C1D7", -"B c #9FB9D3", -"C c #525252", -"D c #191D20", -"E c #434E5A", -"F c #080809", -"G c #ADACA8", -"H c #040405", -"I c #191919", -"J c #262625", -"K c #8BA3BA", -"L c #13161A", -"M c #050607", -"N c #1C1C1C", -"O c #737373", -"P c #252525", -"Q c #72716E", -"R c #131312", -"S c #050505", -"T c #262626", -"U c #727272", -"V c #272626", -"W c #2F2F2E", -"X c #090908", -"Y c #2F2F2F", -"Z c #6F6F6F", -"` c #2A2A29", -" . c #5C5B59", -".. c #080808", -"+. c #3A3A3A", -"@. c #6A6A6A", -"#. c #323231", -"$. c #8D8B88", -"%. c #444444", -"&. c #656565", -"*. c #3D3D3C", -"=. c #B3B1AD", -"-. c #4E4E4E", -";. c #585858", -">. c #30302F", -",. c #323232", -" . + @ # $ % . ", -" & * = - ; > , ' ) ", -" ! ~ { ] ^ / ( _ : < [ ", -" & ~ } | 1 # 2 2 3 4 5 6 ) ", -". * { | 7 8 9 0 2 a b c d e . ", -"+ = ] 1 8 f g h 2 i j k l m % ", -"@ - ^ 2 2 2 2 n 2 2 2 2 l o p ", -"# ; / 2 q r s t u v w 2 l x y ", -"$ > ( 2 2 2 2 u 2 2 2 2 l o z ", -"% , _ 3 a i 2 v 2 A B l l m C ", -". ' : 4 b j 2 w 2 B l l d D . ", -" ) < 5 c k 2 2 2 l l l E F G ", -" [ 6 d l l l l l d E H I J ", -" ) e m o K o m L M 2 N O P ", -" . % p # p % Q R S 2 T U V ", -" W X 2 Y Z ` ", -" ...2 +.@.#. ", -" $...# %.&.*.", -" =.R S -.;.", -" >.# ,."}; - -/* XPM */ -static char * log_xpm[] = { -"16 14 4 1", -" c None", -". c #000000", -"+ c #882F2A", -"@ c #FFFFFF", -"................", -".++++++++++++++.", -"................", -".@@@@@@@@@@@@@@.", -".@...@@...@@..@.", -".@@@@@@@@@@@@@@.", -".@............@.", -".@@@@@@@@@@@@@@.", -".@...@@...@@..@.", -".@@@@@@@@@@@@@@.", -".@...@@...@@..@.", -".@@@@@@@@@@@@@@.", -".@@@@@@@@@@@@@@.", -"................"}; - -static char *quit_xpm[]={ -"32 32 170 2", -"Qt c None", -".c c #000000", -"#3 c #573700", -"a# c #5c3a00", -"#n c #5e3c00", -"ar c #623e00", -"#x c #633f00", -"#d c #664100", -".W c #694300", -"#m c #6b4400", -"an c #6c4500", -".P c #6d4600", -"#w c #704800", -"aG c #714800", -".G c #734a00", -"aK c #744a00", -".Y c #744b00", -".F c #774c00", -"#l c #774d00", -"am c #794e00", -".7 c #7a4f00", -".x c #7c5000", -"#c c #7f5200", -".d c #808080", -".X c #815400", -"#W c #845500", -".6 c #865700", -"af c #8f5d00", -"aN c #925f00", -"aL c #946000", -"aJ c #966200", -"aI c #996300", -"aM c #996400", -"aH c #9b6500", -"aF c #9d6700", -"aE c #a06800", -".b c #a0a0a4", -"aD c #a26a00", -"az c #a46c00", -"ay c #a76d00", -"aq c #a96f00", -"al c #ab7100", -"ae c #ae7200", -"#9 c #b07400", -"ax c #b1aeac", -"ak c #b27600", -"#1 c #b37600", -".q c #b47700", -"ap c #b4b0ad", -"aw c #b4b1ad", -"#V c #b57700", -".w c #b77900", -"ao c #b7b3ae", -"aj c #b7b3af", -"av c #b7b4af", -"#K c #ba7a00", -".p c #ba7b00", -"ai c #bab6b0", -"ad c #bbb6b1", -"au c #bbb7b1", -".E c #bc7b00", -"#I c #bc7c00", -"ah c #bdb9b2", -".v c #be7d00", -"#Q c #be7e00", -"ac c #beb9b2", -"#8 c #beb9b3", -"at c #bebab3", -"#v c #bf7e00", -".K c #c07f00", -".a c #c0c0c0", -"#k c #c17f00", -"#0 c #c1bcb4", -"as c #c2bdb5", -".D c #c38000", -"#H c #c38100", -".O c #c48100", -"#Z c #c4beb5", -"#7 c #c4bfb6", -"#U c #c5bfb6", -".J c #c68300", -"#Y c #c7c1b7", -".V c #c88400", -"#T c #c8c1b7", -"#6 c #c8c2b7", -"#P c #c8c2b8", -".N c #cb8600", -"#O c #cbc4b9", -"#5 c #cbc5b9", -"#J c #cbc5ba", -"ab c #ccc5ba", -".5 c #cd8800", -".U c #cf8900", -"#u c #cfc8bc", -"#j c #d2cabd", -"#i c #d5ccbe", -"#b c #d5cdbf", -"#a c #d8cfc0", -".4 c #d9d0c1", -".u c #dad2c1", -".C c #dbd2c1", -".o c #dbd2c2", -"aA c #dc9200", -".3 c #dcd2c2", -".T c #dcd3c2", -".n c #ded5c3", -".S c #dfd5c3", -".I c #dfd5c4", -".t c #e1d8c5", -".m c #e2d8c5", -".2 c #e3d8c5", -".H c #e3d8c6", -".l c #e5dbc7", -".B c #e6dbc7", -".A c #e9dec8", -".k c #e9dec9", -".s c #ece1ca", -".z c #ede1ca", -".j c #ede1cb", -".i c #f0e4cc", -".M c #f1e4cc", -".r c #f3e7ce", -".h c #f4e7ce", -".g c #f7ead0", -".y c #f8ead0", -".f c #fbedd2", -"ag c #ff2700", -"aa c #ff2d00", -"#4 c #ff3400", -"#X c #ff3b00", -"#S c #ff4200", -"#N c #ff4800", -"#R c #ff4900", -"#M c #ff4f00", -"#G c #ff5000", -"#F c #ff5600", -"#L c #ff5c00", -"#E c #ff5d00", -"#t c #ff6300", -"#D c #ff6400", -"#s c #ff6a00", -"#r c #ff7100", -"#h c #ff7700", -"#C c #ff7800", -"#g c #ff7e00", -"#B c #ff7f00", -"#f c #ff8400", -"#q c #ff8500", -"#e c #ff8b00", -"## c #ff8c00", -"#. c #ff9200", -"#A c #ff9300", -".9 c #ff9900", -".1 c #ff9f00", -".8 c #ffa000", -".0 c #ffa600", -"#z c #ffa700", -".Z c #ffad00", -"#y c #ffae00", -".R c #ffb300", -"#p c #ffb400", -"aB c #ffb848", -".Q c #ffba00", -"#o c #ffbb00", -".L c #ffc800", -"aC c #ffe2b1", -".e c #fff0d4", -".# c #fffbf0", -"a. c #ffff8e", -"#2 c #ffffb1", -"QtQtQtQtQtQtQtQtQtQtQt.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.aQtQtQt", -"QtQtQtQtQtQtQtQtQtQt.b.#.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.a.dQtQt", -"QtQtQtQtQtQtQtQtQtQt.b.#.c.e.f.g.h.i.j.k.l.m.n.o.c.p.q.c.a.dQtQt", -"QtQtQtQtQtQtQtQtQtQt.b.#.c.f.g.r.i.s.k.l.t.n.u.c.v.w.x.c.a.dQtQt", -"QtQtQtQtQtQtQtQtQtQt.b.#.c.y.h.i.z.A.B.m.n.C.c.D.E.F.G.c.a.dQtQt", -"QtQtQtQtQtQtQtQtQt.c.c.#.c.h.i.z.k.B.H.I.o.c.J.K.G.G.G.c.a.dQtQt", -"QtQtQtQtQtQtQtQtQt.c.L.c.c.M.z.A.B.m.I.o.c.N.O.P.G.x.G.c.a.dQtQt", -"QtQtQtQtQtQtQtQtQt.c.Q.R.c.j.k.B.m.S.T.c.U.V.W.G.X.Y.G.c.a.dQtQt", -"QtQtQtQtQtQtQtQtQt.c.Z.0.1.c.B.2.I.3.4.c.5.J.G.6.7.P.G.c.a.dQtQt", -"QtQtQtQtQtQtQtQtQt.c.8.9#.##.c.S.o#a#b.c.N.O.G#c.G#d.G.c.a.dQtQt", -"QtQt.c.c.c.c.c.c.c.c#.#e#f#g#h.c#a#i#j.c.V#k.G#l#m#n.G.c.a.dQtQt", -"Qt.c#o#p.Z.0.8.9#.###q#g#h#r#s#t.c#j#u.c.J#v.G#w#x.G.x.c.a.dQtQt", -"Qt.c#y#z.8.9#A###q#B#C#r#s#D#E#F#G.c#u.c#H#I.G.W.G.X.Y.c.a.dQtQt", -"Qt.c#y#z.8.9#A###q#B#C#r#s#D#E#F#G.c#J.c#k#K.G.G.7.7.P.c.a.dQtQt", -"Qt.c.8.9#.#e#q#g#h#r#s#t#L#F#M#N.c#O#P.c#Q.w.G#c.G.G#d.c.a.dQtQt", -"QtQt.c.c.c.c.c.c.c.c#E#F#M#R#S.c#O#T#U.c#I#V#W.c.c#m#n.c.a.dQtQt", -"QtQtQt.b.b.b.b.b.b.c#M#N#S#X.c#O#Y#Z#0.c.p#1.c#2.c#x#3.c.a.dQtQt", -"QtQtQtQt.b.b.b.b.b.c#S#X#4.c#5#6#7#0#8.c.w#9.ca..ca#.G.c.a.dQtQt", -"QtQtQtQtQtQtQtQtQt.c#4aa.cab#P#U#0acad.c#Vaeaf.c.c.G.G.c.a.dQtQt", -"QtQtQtQtQtQtQtQtQt.cag.c.c#P#7#0ahaiaj.cakalaman.G.x.G.c.a.dQtQt", -"QtQtQtQtQtQtQtQtQt.c.c.a.c#U#0acaiaoap.c#9aqar.G.X.Y.G.c.a.dQtQt", -"QtQtQtQtQtQtQtQtQtQt.b.a.casatauavawax.caeay.G.6.7.P.G.c.a.dQtQt", -"QtQtQtQtQtQtQtQtQtQt.b.#.c.c.c.c.c.c.c.calaz.G#c.G#d.G.c.a.dQtQt", -"QtQtQtQtQtQtQtQtQtQt.b.#.caAaAaBaBaCaC.caqaD.G#l#m#n.G.c.a.dQtQt", -"QtQtQtQtQtQtQtQtQtQt.b.#.caBaBaCaCaCaB.cayaE.G#w#x.G.x.c.a.dQtQt", -".c.c.c.c.c.c.c.c.c.c.c.c.caCaCaCaBaBaC.cazaF.G.W.G.FaG.c.c.c.c.c", -"aBaCaCaCaBaBaCaCaCaBaBaCaCaCaBaBaCaCaC.caDaH.G.G.Gan.caAaAaBaBaC", -"aCaCaBaBaCaCaCaBaBaCaCaCaBaBaCaCaCaBaB.caEaI.Gam.G.caAaBaBaCaCaC", -"aBaBaCaCaCaBaBaCaCaCaBaBaCaCaCaBaBaCaC.caFaJaK.P.caBaBaCaCaCaBaB", -"aCaCaCaBaBaCaCaCaBaBaCaCaCaBaBaCaCaCaB.caHaL.W.caBaCaCaCaBaBaCaC", -"aCaCaBaCaCaCaBaBaCaCaCaBaBaCaCaCaBaBaC.caMaN.caCaCaCaBaBaCaCQtQt", -"QtQtQtaCaBaBaCaCaCaBaBaCaCaCaBaBaCaCaC.c.c.caCaCaBaBaCaCQtQtQtQt"}; - -/* XPM */ -static char * qtiplot_logo_xpm[] = { -"64 64 1304 2", -" c None", -". c #4A81AE", -"+ c #457798", -"@ c #487690", -"# c #5E89AC", -"$ c #7096BC", -"% c #88A5C4", -"& c #82A0C2", -"* c #608CB1", -"= c #447EAE", -"- c #4A80AA", -"; c #628CB0", -"> c #84A2C3", -", c #94AECA", -"' c #9EB6CD", -") c #A8BED0", -"! c #A4BACF", -"~ c #98B1CB", -"{ c #88A4C4", -"] c #6791B9", -"^ c #5589B1", -"/ c #5C89AB", -"( c #789DBF", -"_ c #95AEC9", -": c #A2B9CE", -"< c #AEC2D2", -"[ c #B8CAD6", -"} c #BFD0D9", -"| c #C6D4DC", -"1 c #C3D2DB", -"2 c #BACCD7", -"3 c #ABC0D2", -"4 c #9CB4CD", -"5 c #8AA6C6", -"6 c #6C94BA", -"7 c #5386B2", -"8 c #125E96", -"9 c #538AB1", -"0 c #588CB4", -"a c #B1C8D6", -"b c #C8D6DE", -"c c #D0DCE2", -"d c #D7E2E6", -"e c #DCE5E9", -"f c #E1E8EC", -"g c #DEE6EA", -"h c #D4DFE4", -"i c #C4D3DC", -"j c #B4C7D5", -"k c #9AB3CC", -"l c #5385B1", -"m c #4883B0", -"n c #20689E", -"o c #19639C", -"p c #D8E2E6", -"q c #B4CBD8", -"r c #5990B6", -"s c #6C9FC0", -"t c #D7E4EB", -"u c #F0F3F4", -"v c #F1F3F5", -"w c #F4F6F7", -"x c #EEF2F3", -"y c #E4EAED", -"z c #6F9CBC", -"A c #548CB4", -"B c #A8C5D6", -"C c #4178A1", -"D c #186299", -"E c #C5D4DC", -"F c #AEC6D4", -"G c #5E92B8", -"H c #76A5C5", -"I c #E2ECF2", -"J c #FCFCFC", -"K c #D9E4EB", -"L c #719FC0", -"M c #5C92B7", -"N c #A5C1D2", -"O c #C8D7DE", -"P c #40749D", -"Q c #6C8097", -"R c #166099", -"S c #B5C8D5", -"T c #A7BFD2", -"U c #6092B8", -"V c #518AB4", -"W c #5F92B8", -"X c #A8BFD2", -"Y c #B9CAD6", -"Z c #45769D", -"` c #748498", -" . c #146098", -".. c #A7BCCF", -"+. c #1E689F", -"@. c #AABFD1", -"#. c #48789E", -"$. c #7A8A99", -"%. c #125E97", -"&. c #9AB2CC", -"*. c #1C669E", -"=. c #9EB4CC", -"-. c #48779C", -";. c #7B8A99", -">. c #105D96", -",. c #8FAAC8", -"'. c #1A649C", -"). c #91ACC9", -"!. c #47769C", -"~. c #105C96", -"{. c #84A2C4", -"]. c #18639A", -"^. c #86A2C4", -"/. c #46759B", -"(. c #7A9ABE", -"_. c #16619A", -":. c #7D9CBF", -"<. c #45749A", -"[. c #0F5A94", -"}. c #6E93B8", -"|. c #146099", -"1. c #7294BA", -"2. c #44739A", -"3. c #648EB6", -"4. c #125E98", -"5. c #678FB6", -"6. c #437299", -"7. c #0E5892", -"8. c #5B88B1", -"9. c #5C88B2", -"0. c #105E97", -"a. c #5E89B2", -"b. c #427298", -"c. c #87A772", -"d. c #98BF90", -"e. c #8FB07D", -"f. c #267A7C", -"g. c #5080A4", -"h. c #5281AA", -"i. c #5483AE", -"j. c #5484AF", -"k. c #5484B0", -"l. c #5685B0", -"m. c #407198", -"n. c #7A985E", -"o. c #99BF94", -"p. c #B6D6B5", -"q. c #D2E3CD", -"r. c #D0E1CA", -"s. c #C6DCBF", -"t. c #AACFA8", -"u. c #6AAB86", -"v. c #408683", -"w. c #487C9C", -"x. c #4B7DA6", -"y. c #4C7EAA", -"z. c #4D7FAE", -"A. c #4E7FAE", -"B. c #0F5C96", -"C. c #5080AE", -"D. c #407098", -"E. c #7BB17B", -"F. c #AAC7A2", -"G. c #DAE8D8", -"H. c #E6EEE1", -"I. c #E6EDE1", -"J. c #E4ECDE", -"K. c #E0EADA", -"L. c #D6E4D0", -"M. c #CADEC3", -"N. c #BBD7B3", -"O. c #A4CB9F", -"P. c #67AC81", -"Q. c #3E887E", -"R. c #407896", -"S. c #4479A3", -"T. c #467AA8", -"U. c #0D5B94", -"V. c #487CAD", -"W. c #487CAE", -"X. c #326FA4", -"Y. c #155C95", -"Z. c #3D76A8", -"`. c #3F7097", -" + c #489349", -".+ c #7EBC88", -"++ c #DFEAD9", -"@+ c #E5EDDF", -"#+ c #EAF0E7", -"$+ c #EEF2EA", -"%+ c #F0F4ED", -"&+ c #F0F4EC", -"*+ c #EDF2EA", -"=+ c #DCE8D6", -"-+ c #D0E1CB", -";+ c #C3DABB", -">+ c #B2D3AA", -",+ c #9FC99A", -"'+ c #56A770", -")+ c #2F7D74", -"!+ c #3C7398", -"~+ c #085A91", -"{+ c #447AAB", -"]+ c #4479AB", -"^+ c #4278AA", -"/+ c #0D5690", -"(+ c #0B538D", -"_+ c #125992", -":+ c #3E6E96", -"<+ c #7C8A9A", -"[+ c #33A056", -"}+ c #93C9A0", -"|+ c #58B071", -"1+ c #9ECDA6", -"2+ c #E2ECDD", -"3+ c #EEF3EB", -"4+ c #F6F8F3", -"5+ c #F7F8F6", -"6+ c #F6F8F4", -"7+ c #F0F4EE", -"8+ c #EAF0E6", -"9+ c #CEE0C8", -"0+ c #A2CDA1", -"a+ c #5CAF70", -"b+ c #8AC59A", -"c+ c #328361", -"d+ c #30687E", -"e+ c #035687", -"f+ c #3D75A6", -"g+ c #3F76A8", -"h+ c #4076A8", -"i+ c #2B6BA1", -"j+ c #3B6B92", -"k+ c #7C8C9B", -"l+ c #35A058", -"m+ c #DAE7D4", -"n+ c #D8E6D2", -"o+ c #92C89D", -"p+ c #5FB276", -"q+ c #A4D0AD", -"r+ c #FAFCF9", -"s+ c #FDFDFB", -"t+ c #F8F9F6", -"u+ c #F2F4EE", -"v+ c #BEDBC1", -"w+ c #71B982", -"x+ c #8EC69A", -"y+ c #DAE8D5", -"z+ c #307E5B", -"A+ c #255B6A", -"B+ c #04527B", -"C+ c #3771A2", -"D+ c #3C72A7", -"E+ c #1C5F97", -"F+ c #0C538D", -"G+ c #3C6B92", -"H+ c #7F8E9C", -"I+ c #CCE0C7", -"J+ c #CCDFC7", -"K+ c #95C89D", -"L+ c #64B479", -"M+ c #A5D2AF", -"N+ c #F4F7F2", -"O+ c #C0DFC7", -"P+ c #76BC88", -"Q+ c #8EC698", -"R+ c #2C7B59", -"S+ c #1E5565", -"T+ c #045076", -"U+ c #336E9E", -"V+ c #3870A5", -"W+ c #3870A6", -"X+ c #3D6C92", -"Y+ c #81909D", -"Z+ c #448F57", -"`+ c #C0D8B8", -" @ c #98C89A", -".@ c #32A053", -"+@ c #91C497", -"@@ c #C2DABA", -"#@ c #C2DABB", -"$@ c #2A795A", -"%@ c #1E5468", -"&@ c #2F6C9C", -"*@ c #356EA4", -"=@ c #2A69A0", -"-@ c #0C548E", -";@ c #3E6D93", -">@ c #82919E", -",@ c #747066", -"'@ c #838785", -")@ c #619F75", -"!@ c #B4D4AC", -"~@ c #33A053", -"{@ c #B7D4AD", -"]@ c #28795A", -"^@ c #165168", -"/@ c #034E76", -"(@ c #2B6A9B", -"_@ c #326CA2", -":@ c #1A6098", -"<@ c #0A558F", -"[@ c #3C6C92", -"}@ c #808E9C", -"|@ c #877861", -"1@ c #717069", -"2@ c #8B8E8D", -"3@ c #B1B5B5", -"4@ c #B8BEBC", -"5@ c #6AAA7F", -"6@ c #A8CEA0", -"7@ c #309F50", -"8@ c #AACFA2", -"9@ c #26785A", -"0@ c #084863", -"a@ c #024D75", -"b@ c #146094", -"c@ c #2D6AA0", -"d@ c #0B5891", -"e@ c #0A568F", -"f@ c #38688D", -"g@ c #788693", -"h@ c #7C7262", -"i@ c #7C786E", -"j@ c #949898", -"k@ c #B6BABA", -"l@ c #BABEBE", -"m@ c #B8BEBD", -"n@ c #B5BAB9", -"o@ c #69A87C", -"p@ c #9AC796", -"q@ c #2E9E4E", -"r@ c #9EC998", -"s@ c #1A7255", -"t@ c #02435F", -"u@ c #024E75", -"v@ c #03568C", -"w@ c #0C5A94", -"x@ c #0A5792", -"y@ c #245478", -"z@ c #525E67", -"A@ c #726E64", -"B@ c #7C7B75", -"C@ c #9C9F9F", -"D@ c #B8BDBC", -"E@ c #B6BCBB", -"F@ c #B4BAB9", -"G@ c #B1B7B6", -"H@ c #65A67A", -"I@ c #90C28E", -"J@ c #2E9E4D", -"K@ c #93C390", -"L@ c #187154", -"M@ c #024460", -"N@ c #024F76", -"O@ c #02578D", -"P@ c #085893", -"Q@ c #085894", -"R@ c #306286", -"S@ c #56626D", -"T@ c #4B5861", -"U@ c #80807C", -"V@ c #A3A7A6", -"W@ c #BCBFBF", -"X@ c #B7BCBB", -"Y@ c #B5BBB9", -"Z@ c #B2B8B7", -"`@ c #B1B6B6", -" # c #ACB2B2", -".# c #63A477", -"+# c #86BD86", -"@# c #2B9D4C", -"## c #8ABE88", -"$# c #177254", -"%# c #024661", -"&# c #025076", -"*# c #02588E", -"=# c #085A94", -"-# c #095A94", -";# c #316288", -"># c #667380", -",# c #7D8B98", -"'# c #848B90", -")# c #6F7271", -"!# c #767165", -"~# c #838684", -"{# c #AAADAE", -"]# c #BDC0C0", -"^# c #BBBFBF", -"/# c #B9BEBE", -"(# c #B7BDBC", -"_# c #B3B9B8", -":# c #AFB4B4", -"<# c #ABB0B1", -"[# c #A8ADAD", -"}# c #60A074", -"|# c #7BB87C", -"1# c #51A962", -"2# c #6CB273", -"3# c #7EB87E", -"4# c #2A9C4B", -"5# c #80BA80", -"6# c #7BB87D", -"7# c #68B272", -"8# c #167254", -"9# c #024762", -"0# c #035278", -"a# c #025A90", -"b# c #075C96", -"c# c #306288", -"d# c #657280", -"e# c #7E8C98", -"f# c #A7B0B3", -"g# c #B5BABA", -"h# c #909393", -"i# c #71726B", -"j# c #737068", -"k# c #888C8B", -"l# c #B0B4B4", -"m# c #B0B5B5", -"n# c #A9AFAF", -"o# c #A6AAAB", -"p# c #A2A7A6", -"q# c #5D9D70", -"r# c #3DA256", -"s# c #1D9540", -"t# c #299A48", -"u# c #76B677", -"v# c #289C4A", -"w# c #78B77A", -"x# c #389F52", -"y# c #4EA860", -"z# c #167253", -"A# c #034863", -"B# c #025378", -"C# c #025C92", -"D# c #085D96", -"E# c #085E96", -"F# c #2E6288", -"G# c #63717E", -"H# c #7D8A96", -"I# c #A6AEB2", -"J# c #B6B8B9", -"K# c #8B8F8E", -"L# c #686C6B", -"M# c #807562", -"N# c #7D7669", -"O# c #8E9392", -"P# c #B6B9B8", -"Q# c #BCC0C0", -"R# c #B6BBBA", -"S# c #B4B9B8", -"T# c #AEB4B4", -"U# c #AAAFB0", -"V# c #A8ACAD", -"W# c #A4A9A9", -"X# c #A1A5A5", -"Y# c #9DA1A0", -"Z# c #57986B", -"`# c #1E9641", -" $ c #1D9641", -".$ c #56AA64", -"+$ c #6EB273", -"@$ c #279B48", -"#$ c #70B374", -"$$ c #62AE6C", -"%$ c #1E9642", -"&$ c #127151", -"*$ c #044966", -"=$ c #04547A", -"-$ c #065E94", -";$ c #0D6098", -">$ c #0E6098", -",$ c #2E6286", -"'$ c #616E7B", -")$ c #7A8895", -"!$ c #A3ACB0", -"~$ c #B6BCBC", -"{$ c #BEC2C0", -"]$ c #B4B8B7", -"^$ c #8A8E8E", -"/$ c #767064", -"($ c #7C7A72", -"_$ c #999D9C", -":$ c #BABFBE", -"<$ c #A9AEAE", -"[$ c #A6AAAA", -"}$ c #A2A7A7", -"|$ c #9FA3A4", -"1$ c #9DA0A0", -"2$ c #989C9C", -"3$ c #549668", -"4$ c #1F9641", -"5$ c #1F9642", -"6$ c #3CA154", -"7$ c #68B06E", -"8$ c #259B48", -"9$ c #6AB06F", -"0$ c #44A459", -"a$ c #127152", -"b$ c #0A4C6B", -"c$ c #095781", -"d$ c #116096", -"e$ c #1A629C", -"f$ c #2F6286", -"g$ c #5E6C78", -"h$ c #778491", -"i$ c #A0A8AC", -"j$ c #B4BABA", -"k$ c #BEC1C0", -"l$ c #9CA0A0", -"m$ c #8A8D8E", -"n$ c #7C7C76", -"o$ c #A2A6A4", -"p$ c #AEB3B4", -"q$ c #ABB0B0", -"r$ c #A1A6A5", -"s$ c #9EA2A2", -"t$ c #9C9D9C", -"u$ c #A9817E", -"v$ c #9C8480", -"w$ c #529062", -"x$ c #1F9440", -"y$ c #209541", -"z$ c #209641", -"A$ c #279A46", -"B$ c #64AE6A", -"C$ c #259A46", -"D$ c #2E9C4A", -"E$ c #209642", -"F$ c #177256", -"G$ c #135075", -"H$ c #0E598A", -"I$ c #1D629A", -"J$ c #22649C", -"K$ c #326186", -"L$ c #5C6A75", -"M$ c #74818E", -"N$ c #9DA5A9", -"O$ c #B1B7B7", -"P$ c #808484", -"Q$ c #A3A8A8", -"R$ c #8C7C62", -"S$ c #9A9F9E", -"T$ c #BFC3C0", -"U$ c #B6BCBA", -"V$ c #AEB2B4", -"W$ c #AAB0B0", -"X$ c #A7ACAC", -"Y$ c #A4A8A8", -"Z$ c #A0A4A4", -"`$ c #A2928F", -" % c #BB8A82", -".% c #DB9C8C", -"+% c #ECBEA8", -"@% c #E4A690", -"#% c #A67A5B", -"$% c #4B7437", -"%% c #258C3E", -"&% c #239340", -"*% c #229642", -"=% c #56A860", -"-% c #5DAB66", -";% c #249A46", -">% c #5EAC67", -",% c #5CAB65", -"'% c #239843", -")% c #229842", -"!% c #1B7458", -"~% c #1C547E", -"{% c #185C90", -"]% c #29669D", -"^% c #2C689F", -"/% c #336285", -"(% c #5B6873", -"_% c #727F8B", -":% c #99A2A6", -"<% c #B3B8B8", -"[% c #787C7C", -"}% c #9DA1A2", -"|% c #B5BBBA", -"1% c #B0B5B6", -"2% c #ADB2B2", -"3% c #AAAFAF", -"4% c #A4A6A6", -"5% c #B08B88", -"6% c #CE9D94", -"7% c #EAC1B1", -"8% c #EFD7C6", -"9% c #EED4C2", -"0% c #EED1BD", -"a% c #EDC6B1", -"b% c #EAB79F", -"c% c #DF9E84", -"d% c #AC7452", -"e% c #5D6E38", -"f% c #2C8A3D", -"g% c #439C50", -"h% c #59A75F", -"i% c #59A962", -"j% c #289A47", -"k% c #5BAA63", -"l% c #49A458", -"m% c #249844", -"n% c #20765A", -"o% c #255782", -"p% c #205F94", -"q% c #316AA0", -"r% c #356286", -"s% c #5A6772", -"t% c #6F7C88", -"u% c #969EA2", -"v% c #AAB0B1", -"w% c #B0B6B6", -"x% c #767A7A", -"y% c #9A9E9E", -"z% c #8B7C62", -"A% c #B0B4B5", -"B% c #AAA09F", -"C% c #BF928D", -"D% c #DFACA1", -"E% c #F0DCCF", -"F% c #F3E4D8", -"G% c #F4E6DA", -"H% c #F4E7DE", -"I% c #F2E4D9", -"J% c #F2E0D3", -"K% c #EED5C2", -"L% c #EECAB6", -"M% c #EBBEA7", -"N% c #E6AC93", -"O% c #DF967B", -"P% c #BB7152", -"Q% c #756D3E", -"R% c #599250", -"S% c #489C51", -"T% c #269744", -"U% c #50A55C", -"V% c #57A860", -"W% c #3A9F4F", -"X% c #289A45", -"Y% c #25785B", -"Z% c #2E5B83", -"`% c #286397", -" & c #3870A4", -".& c #3A72A6", -"+& c #386488", -"@& c #586672", -"#& c #6E7C88", -"$& c #959CA1", -"%& c #B9BEBD", -"&& c #9CA09F", -"*& c #BA6461", -"=& c #D85E57", -"-& c #E4A696", -";& c #EFD8C8", -">& c #F3E5DA", -",& c #F4EBE4", -"'& c #F7F0EA", -")& c #F7EFE9", -"!& c #F6EDE6", -"~& c #EFDBCB", -"{& c #EECFBC", -"]& c #ECC2AC", -"^& c #E9B098", -"/& c #DE8872", -"(& c #D45146", -"_& c #8C4E32", -":& c #397F3C", -"<& c #2D9041", -"[& c #369C4A", -"}& c #4AA357", -"|& c #2F9C47", -"1& c #2E9C46", -"2& c #29795C", -"3& c #365F86", -"4& c #2E6798", -"5& c #4074A7", -"6& c #4177A9", -"7& c #396688", -"8& c #586670", -"9& c #949BA0", -"0& c #A8ACAE", -"a& c #AEB2B3", -"b& c #9B9F9E", -"c& c #B2B6B6", -"d& c #A7ACAD", -"e& c #A5A9A9", -"f& c #BC6E68", -"g& c #EECEBA", -"h& c #E08578", -"i& c #D66057", -"j& c #E6A99D", -"k& c #F4E8DE", -"l& c #F8F2EE", -"m& c #FAF7F3", -"n& c #FAF6F3", -"o& c #F4E9DF", -"p& c #EFD9C8", -"q& c #E7AE9C", -"r& c #DA655A", -"s& c #DF8478", -"t& c #EED1C0", -"u& c #874933", -"v& c #3A6732", -"w& c #36823D", -"x& c #359746", -"y& c #349D49", -"z& c #349E49", -"A& c #2D7C5E", -"B& c #3D6487", -"C& c #356C9A", -"D& c #497AA9", -"E& c #4A7DAE", -"F& c #3C688A", -"G& c #6E7B87", -"H& c #ACB0B1", -"I& c #A8AEAE", -"J& c #A6AAAC", -"K& c #A4A7A8", -"L& c #BA6A64", -"M& c #ECC0AA", -"N& c #ECBEA7", -"O& c #DF8374", -"P& c #D8665E", -"Q& c #E8ADA8", -"R& c #FAF6F2", -"S& c #FEFCFA", -"T& c #FAF5F2", -"U& c #ECC5BE", -"V& c #DC766C", -"W& c #DF8375", -"X& c #ECC0AB", -"Y& c #ECC4B0", -"Z& c #854430", -"`& c #3B5C2E", -" * c #3A793A", -".* c #3C9647", -"+* c #3B9E4C", -"@* c #3A9E4D", -"#* c #317F5F", -"$* c #446889", -"%* c #3B709C", -"&* c #5280AC", -"** c #5483B0", -"=* c #426C8F", -"-* c #5D6A76", -";* c #6E7B88", -">* c #939A9E", -",* c #A6ABAC", -"'* c #B7BCBC", -")* c #75797A", -"!* c #999E9E", -"~* c #ABB1B1", -"{* c #A8ADAE", -"]* c #A3A7A7", -"^* c #BA6761", -"/* c #E7AC92", -"(* c #E2917C", -"_* c #E6A78E", -":* c #E7AB92", -"<* c #DE8370", -"[* c #D8665B", -"}* c #E59B97", -"|* c #DC756D", -"1* c #DE7E6D", -"2* c #E8B097", -"3* c #E9B298", -"4* c #E9B198", -"5* c #864630", -"6* c #3C5E30", -"7* c #3E773B", -"8* c #42964A", -"9* c #43A050", -"0* c #42A051", -"a* c #368262", -"b* c #4C6D8D", -"c* c #42759E", -"d* c #5C88B0", -"e* c #5F8AB3", -"f* c #386283", -"g* c #56626E", -"h* c #798693", -"i* c #98A0A5", -"j* c #A6ACAC", -"k* c #A6A9AA", -"l* c #A2A6A6", -"m* c #B9645E", -"n* c #D86857", -"o* c #C92623", -"p* c #D1483F", -"q* c #E1987E", -"r* c #CE3430", -"s* c #E29C83", -"t* c #D65E52", -"u* c #CB2B28", -"v* c #DC806C", -"w* c #874830", -"x* c #406234", -"y* c #43783D", -"z* c #48964E", -"A* c #49A155", -"B* c #4AA256", -"C* c #3B8564", -"D* c #547390", -"E* c #4C7BA1", -"F* c #6A8FB4", -"G* c #6C93B8", -"H* c #658FB6", -"I* c #45769C", -"J* c #4C6373", -"K* c #4D5963", -"L* c #556069", -"M* c #939B9E", -"N* c #B2B7B7", -"O* c #B2B7B6", -"P* c #757979", -"Q* c #999D9D", -"R* c #A7ABAD", -"S* c #A3A6A6", -"T* c #B9615C", -"U* c #CA2825", -"V* c #DD7962", -"W* c #E0886D", -"X* c #CE322E", -"Y* c #E08C70", -"Z* c #DE836A", -"`* c #CA2724", -" = c #CC312C", -".= c #88472F", -"+= c #446437", -"@= c #497A40", -"#= c #509A52", -"$= c #52A65B", -"%= c #52A65C", -"&= c #418867", -"*= c #5F7A96", -"== c #5582A4", -"-= c #7A98BB", -";= c #7C9BBE", -">= c #7999BE", -",= c #517EA5", -"'= c #4A687C", -")= c #5E676B", -"!= c #5B676E", -"~= c #616E79", -"{= c #76818B", -"]= c #7A7F82", -"^= c #7E8283", -"/= c #ABB0AF", -"(= c #B4BAB8", -"_= c #747979", -":= c #ACB1B1", -"<= c #949797", -"[= c #A44B47", -"}= c #CA2623", -"|= c #D45141", -"1= c #DE7C5E", -"2= c #CE312B", -"3= c #E07E62", -"4= c #D65847", -"5= c #CA2624", -"6= c #88462E", -"7= c #4A693B", -"8= c #4E7D43", -"9= c #599D59", -"0= c #5AAA62", -"a= c #5CAA64", -"b= c #488C6B", -"c= c #6A829B", -"d= c #6088AA", -"e= c #86A2C2", -"f= c #88A4C5", -"g= c #5D88AE", -"h= c #4A6B82", -"i= c #5E686C", -"j= c #5E686E", -"k= c #5F6C73", -"l= c #66727C", -"m= c #747E89", -"n= c #8A9297", -"o= c #9CA1A2", -"p= c #9CA2A1", -"q= c #7F8383", -"r= c #878B8B", -"s= c #B4B7B7", -"t= c #AFB3B4", -"u= c #ACB1B2", -"v= c #969B9B", -"w= c #7B7E7E", -"x= c #939696", -"y= c #BA605C", -"z= c #CA2824", -"A= c #CE382F", -"B= c #DA7256", -"C= c #CD2F29", -"D= c #DC7458", -"E= c #CF3C32", -"F= c #CA2723", -"G= c #8B4730", -"H= c #506C40", -"I= c #548048", -"J= c #63A060", -"K= c #66AE6A", -"L= c #67B06C", -"M= c #367959", -"N= c #456681", -"O= c #658BAC", -"P= c #6B93B4", -"Q= c #4C6F86", -"R= c #5E686D", -"S= c #5E696E", -"T= c #606B73", -"U= c #65727B", -"V= c #717C86", -"W= c #808991", -"X= c #90969B", -"Y= c #A1A7A6", -"Z= c #A2A8A7", -"`= c #A4A9A8", -" - c #7C8180", -".- c #8F9392", -"+- c #969A9A", -"@- c #76797A", -"#- c #999C9D", -"$- c #7C8080", -"%- c #B0B3B2", -"&- c #BC625C", -"*- c #CC2B24", -"=- c #CC2C24", -"-- c #D8664C", -";- c #D8694E", -">- c #CC2C28", -",- c #D86A50", -"'- c #D8694F", -")- c #CC2C26", -"!- c #CC2A24", -"~- c #8E4933", -"{- c #587046", -"]- c #5B844D", -"^- c #6DA468", -"/- c #71B273", -"(- c #71B474", -"_- c #48805B", -":- c #4D5860", -"<- c #405E74", -"[- c #556670", -"}- c #5E696F", -"|- c #65717A", -"1- c #6F7A84", -"2- c #7E8890", -"3- c #8E969A", -"4- c #9AA0A1", -"5- c #A1A4A6", -"6- c #959A9A", -"7- c #666A69", -"8- c #777B7B", -"9- c #9EA2A3", -"0- c #B1B4B4", -"a- c #BE645D", -"b- c #CC3026", -"c- c #D4513D", -"d- c #D76048", -"e- c #CC2F28", -"f- c #D76249", -"g- c #D45540", -"h- c #CC2E26", -"i- c #924C36", -"j- c #5F724A", -"k- c #628652", -"l- c #7AA970", -"m- c #7EB87D", -"n- c #7FBA7F", -"o- c #68AF71", -"p- c #527B61", -"q- c #5F6A6E", -"r- c #647078", -"s- c #67747C", -"t- c #6A7680", -"u- c #707C86", -"v- c #7D878F", -"w- c #8D9499", -"x- c #9A9FA2", -"y- c #A0A6A6", -"z- c #A4A9AA", -"A- c #85898A", -"B- c #696E6E", -"C- c #737778", -"D- c #7D8181", -"E- c #9B9F9F", -"F- c #BABDBD", -"G- c #B1B5B4", -"H- c #BF665E", -"I- c #CD382A", -"J- c #D14432", -"K- c #D65942", -"L- c #D6563F", -"M- c #CC3328", -"N- c #D65741", -"O- c #D65A43", -"P- c #D14634", -"Q- c #CD3628", -"R- c #974E3A", -"S- c #687651", -"T- c #6B8958", -"U- c #86AE7A", -"V- c #8BBE88", -"W- c #8CBE8A", -"X- c #7AB87E", -"Y- c #599267", -"Z- c #5E7266", -"`- c #66706C", -" ; c #6D7A76", -".; c #7C8787", -"+; c #848E92", -"@; c #899196", -"#; c #90979B", -"$; c #999FA2", -"%; c #A1A6A6", -"&; c #A8ACAC", -"*; c #898D8D", -"=; c #6A6F6F", -"-; c #707575", -";; c #808485", -">; c #949798", -",; c #ABAEAC", -"'; c #9EA2A1", -"); c #B3B8B6", -"!; c #C06760", -"~; c #D04230", -"{; c #D04331", -"]; c #D4503B", -"^; c #D24835", -"/; c #CE3A2C", -"(; c #D24936", -"_; c #D5543E", -":; c #D0402E", -"<; c #9B513E", -"[; c #727958", -"}; c #748C5F", -"|; c #95B685", -"1; c #9BC695", -"2; c #8EC28E", -"3; c #629D70", -"4; c #5A7665", -"5; c #666F6B", -"6; c #66746C", -"7; c #6C7B72", -"8; c #7A8A80", -"9; c #909A95", -"0; c #9CA2A2", -"a; c #A0A4A6", -"b; c #A3A7A8", -"c; c #A5A9AA", -"d; c #AAAEAF", -"e; c #8D9191", -"f; c #6C7070", -"g; c #707475", -"h; c #808585", -"i; c #A9ADAC", -"j; c #B2B4B2", -"k; c #6B6B65", -"l; c #828583", -"m; c #AFB3B2", -"n; c #B6BAB8", -"o; c #C16C64", -"p; c #D34C38", -"q; c #D14332", -"r; c #D24A36", -"s; c #D34A36", -"t; c #8E4A36", -"u; c #6A7654", -"v; c #7F9266", -"w; c #9EBB8D", -"x; c #70A878", -"y; c #587A65", -"z; c #66726C", -"A; c #6A7970", -"B; c #74847A", -"C; c #829187", -"D; c #929C96", -"E; c #9FA6A4", -"F; c #A5AAAA", -"G; c #909595", -"H; c #6C7171", -"I; c #707474", -"J; c #808586", -"K; c #A9ACAA", -"L; c #B4B5B0", -"M; c #A7A7A2", -"N; c #868A8A", -"O; c #B2B6B4", -"P; c #B8BCBA", -"Q; c #C47167", -"R; c #D44D3A", -"S; c #D65640", -"T; c #924539", -"U; c #4D503F", -"V; c #58724D", -"W; c #58785A", -"X; c #65706A", -"Y; c #65726C", -"Z; c #68786F", -"`; c #728378", -" > c #808F86", -".> c #909C95", -"+> c #9CA4A1", -"@> c #949999", -"#> c #6F7373", -"$> c #6F7474", -"%> c #808686", -"&> c #959899", -"*> c #AAADAC", -"=> c #B4B6B1", -"-> c #B4B3AE", -";> c #888C8C", -">> c #B5B8B8", -",> c #B8BDBB", -"'> c #BA938C", -")> c #CB5949", -"!> c #D8664D", -"~> c #D65944", -"{> c #D8644B", -"]> c #D25743", -"^> c #855248", -"/> c #61594C", -"(> c #666253", -"_> c #6A7366", -":> c #6D7C72", -"<> c #7E8E82", -"[> c #8E9B92", -"}> c #9CA4A0", -"|> c #A4AAAA", -"1> c #818586", -"2> c #949899", -"3> c #AAACAA", -"4> c #B5B7B3", -"5> c #7A7F7E", -"6> c #8E9292", -"7> c #B8BCBB", -"8> c #BBBEBE", -"9> c #B5B2AE", -"0> c #A59287", -"a> c #A96358", -"b> c #CE604D", -"c> c #DD785B", -"d> c #DE785C", -"e> c #D9664F", -"f> c #D86850", -"g> c #AB584E", -"h> c #766662", -"i> c #706962", -"j> c #786A5E", -"k> c #827A6D", -"l> c #878C80", -"m> c #88968B", -"n> c #909C94", -"o> c #9BA5A0", -"p> c #ABB1B0", -"q> c #ABB2B1", -"r> c #ADB3B3", -"s> c #989D9C", -"t> c #737777", -"u> c #818686", -"v> c #B4B5B1", -"w> c #B2B5B2", -"x> c #797D7D", -"y> c #BABEBD", -"z> c #B9BAB8", -"A> c #B0A7A0", -"B> c #A18F84", -"C> c #927E73", -"D> c #AC6258", -"E> c #D7725C", -"F> c #E08A6F", -"G> c #DC755C", -"H> c #E0866A", -"I> c #DE7C62", -"J> c #B96053", -"K> c #7F6562", -"L> c #716E6A", -"M> c #786E69", -"N> c #82746C", -"O> c #8E8076", -"P> c #9C958E", -"Q> c #A2A4A0", -"R> c #A3AAA8", -"S> c #A6ACAB", -"T> c #AAB0AF", -"U> c #ADB2B3", -"V> c #9BA09F", -"W> c #727676", -"X> c #AAADAB", -"Y> c #B4B6B2", -"Z> c #B2B4B4", -"`> c #999C9C", -" , c #787D7C", -"., c #B8B9B6", -"+, c #B2ADA7", -"@, c #A99D95", -"#, c #9B8B82", -"$, c #93766E", -"%, c #B2675B", -"&, c #DC8671", -"*, c #DE8670", -"=, c #E0977E", -"-, c #C46D5D", -";, c #8A625E", -">, c #74726E", -",, c #79726C", -"', c #83756D", -"), c #8E7F75", -"!, c #988D85", -"~, c #A29C97", -"{, c #AAA9A7", -"], c #ACB0B0", -"^, c #AFB4B5", -"/, c #9EA3A2", -"(, c #747878", -"_, c #828686", -":, c #959898", -"<, c #A7ABA8", -"[, c #B2B7B5", -"}, c #949796", -"|, c #7A7D7D", -"1, c #9FA2A0", -"2, c #B8B7B4", -"3, c #B1AAA4", -"4, c #A69990", -"5, c #9A887D", -"6, c #947369", -"7, c #B86258", -"8, c #996159", -"9, c #776E68", -"0, c #7B726C", -"a, c #84786F", -"b, c #908076", -"c, c #9B8D84", -"d, c #A49C97", -"e, c #AAA8A6", -"f, c #ACAFAE", -"g, c #AEB2B2", -"h, c #B4B8B5", -"i, c #A5A7A6", -"j, c #B6B5B1", -"k, c #B0A8A2", -"l, c #A6978D", -"m, c #97867C", -"n, c #8C7A70", -"o, c #8A796F", -"p, c #908077", -"q, c #9C8E85", -"r, c #A69E97", -"s, c #AEAAA7", -"t, c #B0B2B0", -"u, c #B1B6B5", -"v, c #A2A6A7", -"w, c #777C7B", -"x, c #828687", -"y, c #969999", -"z, c #B2B3AE", -"A, c #8A908E", -"B, c #7E8182", -"C, c #A4A6A5", -"D, c #B6B4B0", -"E, c #AFA7A1", -"F, c #A89A92", -"G, c #A6988F", -"H, c #AAA199", -"I, c #B0ACA8", -"J, c #B4B4B2", -"K, c #787C7D", -"L, c #95999A", -"M, c #A7AAA6", -"N, c #898D8B", -"O, c #7C7F80", -"P, c #B6B6B2", -"Q, c #B7B9B6", -"R, c #6E7373", -"S, c #838787", -"T, c #AAACA9", -"U, c #A7A8A4", -"V, c #858886", -"W, c #7F8282", -"X, c #ABAEAE", -"Y, c #6E7273", -"Z, c #838687", -"`, c #B3B4B0", -" ' c #A0A29F", -".' c #828482", -"+' c #818585", -"@' c #AEB1B1", -"#' c #787D7D", -"$' c #969899", -"%' c #AAAEAC", -"&' c #979894", -"*' c #7C7F7E", -"=' c #838888", -"-' c #727677", -";' c #838788", -">' c #959999", -",' c #B4B7B6", -"'' c #90908E", -")' c #969A9C", -" . + ", -" @ # $ % & * = ", -" - ; > , ' ) ! ~ { ] ^ ", -" / ( _ : < [ } | 1 2 3 4 5 6 7 ", -" 8 9 0 a b c d e f g h i j k l m n ", -" o p q r s t u v w x y i z A B g C ", -" D E E E F G H I J K L M N O O O P Q ", -" R S S S S S T U V W X Y Y Y Y Y Z ` ", -" ...............+.@.@.@.@.@.@.@.#.$. ", -" %.&.&.&.&.&.&.&.*.=.=.=.=.=.=.=.-.;. ", -" >.,.,.,.,.,.,.,.'.).).).).).).).!.;. ", -" ~.{.{.{.{.{.{.{.].^.^.^.^.^.^.^./.;. ", -" ~.(.(.(.(.(.(.(._.:.:.:.:.:.:.:.<.;. ", -" [.}.}.}.}.}.}.}.|.1.1.1.1.1.1.1.2.;. ", -" [.3.3.3.3.3.3.3.4.5.5.5.5.5.5.5.6.;. ", -" 7.8.9.9.9.9.9.9.0.a.a.a.a.a.a.a.b.;. ", -" c.d.e.f.g.h.i.j.k.k.k.>.l.l.l.l.l.l.l.m.;. ", -" n.o.p.q.r.s.t.u.v.w.x.y.z.A.B.C.C.C.C.C.C.C.D.;. ", -" E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.W.W.X.Y.Z.`.;. ", -" +.+++@+#+$+%+&+*+H.=+-+;+>+,+'+)+!+~+{+]+]+^+/+(+_+:+<+ ", -" [+}+|+1+2+3+4+5+6+7+8+++9+0+a+b+c+d+e+f+g+h+i+(+(+(+j+k+ ", -" l+m+n+o+p+q+%+r+s+t+u+v+w+x+y+K.z+A+B+C+D+D+E+F+F+F+G+H+ ", -" [+I+I+I+J+K+L+M+N+O+P+Q+9+r.r.r.R+S+T+U+V+W+/+F+F+F+X+Y+ ", -" Z+`+`+`+`+`+`+ @.@+@@@#@#@#@#@#@$@%@T+&@*@=@-@-@-@-@;@>@ ", -" ,@'@)@!@!@!@!@!@!@!@~@{@{@{@{@{@{@{@]@^@/@(@_@:@<@<@<@<@[@}@ ", -" |@1@2@3@4@5@6@6@6@6@6@6@6@7@8@8@8@8@8@8@8@9@0@a@b@c@d@e@e@e@e@f@g@ ", -" h@i@j@k@l@m@n@o@p@p@p@p@p@p@p@q@r@r@r@r@r@r@r@s@t@u@v@w@x@x@x@x@x@y@z@ ", -" A@B@C@l@l@D@E@F@G@H@I@I@I@I@I@I@I@J@K@K@K@K@K@K@K@L@M@N@O@P@Q@Q@Q@Q@Q@R@S@T@ ", -" h@U@V@W@l@D@X@Y@Z@`@ #.#+#+#+#+#+#+#+#@###############$#%#&#*#=#-#-#-#-#-#;#>#,#'#)# ", -" !#~#{#]#^#/#(#E@_#`@:#<#[#}#|#1#2#3#3#3#3#4#5#5#5#5#6#7#5#8#9#0#a#b#b#b#b#b#b#c#d#e#f#g#h#i# ", -" j#k#l#]#W@l@D@E@F@Z@m# #n#o#p#q#r#s#t#u#u#u#u#v#w#w#w#w#x#s#y#z#A#B#C#D#E#E#E#E#E#F#G#H#I#/#]#J#K#L# ", -" M#N#O#P#]#Q#^#m@(#R#S#`@T#U#V#W#X#Y#Z#`# $ $.$+$+$+$@$#$#$#$$$ $ $%$&$*$=$-$;$>$>$>$>$>$,$'$)$!$~$^#]#{$]$^$ ", -" /$($_$:${$]#W@l@D@(#Y@Z@m# #<$[$}$|$1$2$3$4$5$5$6$7$7$7$8$9$9$9$0$%$%$%$a$b$c$d$e$e$e$e$e$e$f$g$h$i$j$D@^#]#k$l$m$ ", -" n$o${${$]#]#W@l@D@E@S#`@p$q$V#W#r$s$t$u$v$w$x$y$z$A$B$B$B$C$B$B$B$D$E$E$E$F$G$H$I$J$J$J$J$J$J$K$L$M$N$O$E@m@W@]#l$P$Q$ ", -" R$S$T${$]#]#W@l@(#U$_#`@V$W$X$Y$Z$`$ %.%+%@%#%$%%%&%*%=%-%-%;%>%>%,%'%)%)%)%!%~%{%]%^%^%^%^%^%^%/%(%_%:%p$<%E@l@Q#l$[%}% ", -" R$S${${$]#^#l@(#|%Z@1%2%3%X$4%5%6%7%8%9%0%a%b%c%d%e%f%g%h%i%j%k%k%l%m%m%m%m%n%o%p%q%_@_@_@_@_@_@r%s%t%u%v%w%F@(#^#l$x%y% ", -" z%y%{$]#W@l@(#Y@Z@A%2%n#B%C%D%E%F%G%H%I%J%K%L%M%N%O%P%Q%R%S%T%U%V%W%X%X%X%X%Y%Z%`% &.&.&.&.&.&.&+&@&#&$&<$p$Z@U$%&&&x%y% ", -" z%y%{$]#l@D@U$<%w%2%n#X$*&=&-&;&>&,&'&)&!&>&~&{&]&^&/&(&_&:&<&[&}&|&1&1&1&1&2&3&4&5&6&6&6&6&6&6&7&8&#&9&0&a&`@n@D@b&x%y% ", -" z%y%k$W@D@E@_#c&p$W$d&e&f&g&h&i&j&k&l&m&n&'&o&p&q&r&s&t&u&v&w&x&y&z&z&z&z&z&A&B&C&D&E&E&E&E&E&E&F&8&G&9&X$H&1%_#(#y%x%y% ", -" z%y%]#l@(#Y@Z@m#2%I&J&K&L&M&M&N&O&P&Q&R&S&T&U&V&W&X&Y&Y&Z&`& *.*+*@*@*@*@*@*#*$*%*&*************=*-*;*>*,*q$A%<%'*y%)*!* ", -" z%y%Q#m@E@S#c&p$~*{*o#]*^*/*(*_*/*:*<*[*}*|*1*2*3*3*4*3*5*6*7*8*9*0*0*0*0*0*a*b*c*d*e*e*e*e*e*e*f*g*h*i*j*W$p$Z@E@y%)*!* ", -" z%y%Q#m@U$<%`@a&W$d&k*l*m*n*o*p*q*q*q*q*r*s*s*s*s*t*u*v*w*x*y*z*A*B*B*B*B*B*C*D*E*F*G*G*G*G*H*I*J*K*L*M*N*:#:#O*U$y%P*Q* ", -" z%y%^#D@|%Z@m#2%n#R*e&S*T*U*o*o*V*W*W*W*X*Y*Y*Y*Z*`*o* =.=+=@=#=$=%=%=%=%=%=&=*===-=;=;=>=,='=)=!=~={=]=^=/=R#(=E@y%_=Q* ", -" z%y%l@(#(=Z@A%:=I&V#W$<=[=}=}=}=|=1=1=1=2=3=3=3=4=5=5=5=6=7=8=9=0=a=a=a=a=a=b=c=d=e=f=g=h=i=j=k=l=m=n=o=p=q=r=s=l@b&P*Q* ", -" z%y%l@'*(=O*t=u=a&v=w=x=y=z=z=z=A=B=B=B=C=D=D=D=E=F=F=F=G=H=I=J=K=L=L=L=L=L=M=N=O=P=Q=R=S=T=U=V=W=X=o=Y=Z=`=l$ -.-+-@-y% ", -" z%y%l@'*(=N*O*#-$-+-G@%-&-*-*-*-=---;-;->-,-,-'-)-!-!-!-~-{-]-^-/-(-(-(-(-(-_-:-<-[-}-T=|-1-2-3-4-5-Q$`=k*k*o#{*6-7-8-9- ", -" z%y%l@(#|%y%$-2$|%(=Z@0-a-b-b-b-b-c-d-d-e-f-f-g-h-h-h-h-i-j-k-l-m-n-n-n-n-o-p-q-r-s-t-u-v-w-x-y-`=k*o#J&,*0&z-A-B-C-^$[# ", -" z%y%l@2$D-E-F-m@(#U$S#G-H-I-I-I-I-J-K-L-M-N-O-P-Q-Q-Q-Q-R-S-T-U-V-W-W-X-Y-Z-`- ;.;+;@;#;$;%;e&o#J&,*0&I&&;*;=;-;;;>;,; ", -" P$D-';Q#]#W@l@D@(#U$);!;~;~;~;~;{;];^;/;(;_;~;:;:;:;:;<;[;};|;1;2;3;4;5;6;7;8;9;0;a;b;c;J&R*0&I&d;U#e;f;g;h;j@i;j; ", -" k;l;m;{$]#]#W@l@m@(#n;o;p;p;p;p;p;p;p;q;r;s;r;r;r;r;r;t;u;v;w;x;y;5;z;A;B;C;D;E;F;,*d&0&I&<$q$2%G;H;I;J;j@K;L; ", -" M;q=N;O;]#]#W@^#/#P;Q;O-O-O-O-O-O-O-R;S;S;S;S;S;S;S;T;U;V;W;X;Y;Z;`; >.>+>`=d&{*I&<$3% #m#@>#>$>%>&>*>=> ", -" ->Z$$-;>>>]#Q#^#,>'>)>!>'-'-'-'-'-~>{>{>{>{>{>{>]>^>/>(>_>:>`;<>[>}>|>[#I&<$W$:=:#N*2$g;$>1>2>3>4> ", -" c&Z$5>6>7>]#8>9>0>a>b>c>d>d>d>e>D=D=D=D=f>g>h>i>j>k>l>m>n>o>|><$W$p>q>r>w%_#s>t>$>u>2>3>v> ", -" w>l$x>j@y>z>A>B>C>D>E>F>F>G>H>H>I>J>K>L>M>N>O>P>Q>R>S>T>:=u=U>:#N*g#V>W>$>;;j@X>Y> ", -" Z>`> ,_$.,+,@,#,$,%,&,*,=,-,;,>,,,',),!,~,{,],:=2%a&^,`@<%U$/,(,I;_,:,<,j; ", -" [,},|,1,2,3,4,5,6,7,8,9,0,a,b,c,d,e,f,g,p$^,w%O*(=D@Z$x%$>_,&>K;h, ", -" %-.-$-i,j,k,l,m,n,o,p,q,r,s,t,u,3@`@`@<%g#m@v,w,I;x,y,3>z, ", -" f,A,B,C,D,E,F,G,H,I,J,]$S#<%Z@F@U$%&Y$K,#>x,L,X>Y> ", -" M,N,O,i,2,P,Q,P;D@(#E@U$E@l@k*|,R,S,+-T,Y> ", -" U,V,W,X,]#Q#l@m@D@l@Y$8-Y,Z,+-X>`, ", -" '.'+'@'k$Q#[$#'R,x,$'%'Y> ", -" &'*'='$--';'>'W#,' ", -" '')'E-v, ", -" "}; - - -#endif === modified file 'qtiplot/python-includepath.py' --- qtiplot/python-includepath.py 2007-03-25 12:06:27 +0000 +++ qtiplot/python-includepath.py 2010-07-21 23:21:08 +0000 @@ -1,3 +1,31 @@ #!/usr/bin/python + +############################################################################ +# # +# File : python-includepath.py # +# Project : QtiPlot # +# Description : dump -I paths for Python and SIP # +# Copyright : (C) 2007-2009 Knut Franke (knut.franke*gmx.de) # +# (replace * with @ in the email address) # +# # +############################################################################ +# # +# This program is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software # +# Foundation, Inc., 51 Franklin Street, Fifth Floor, # +# Boston, MA 02110-1301 USA # +# # +############################################################################ + from distutils import sysconfig print sysconfig.get_python_inc() === modified file 'qtiplot/python-libs-win.py' --- qtiplot/python-libs-win.py 2009-11-18 10:33:29 +0000 +++ qtiplot/python-libs-win.py 2010-07-21 23:21:08 +0000 @@ -1,4 +1,32 @@ #!/usr/bin/python + +############################################################################ +# # +# File : python-libs-win.py # +# Project : QtiPlot # +# Description : dump -L/-l flags for linking to Python on Windows # +# Copyright : (C) 2007-2009 Knut Franke (knut.franke*gmx.de) # +# (replace * with @ in the email address) # +# # +############################################################################ +# # +# This program is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software # +# Foundation, Inc., 51 Franklin Street, Fifth Floor, # +# Boston, MA 02110-1301 USA # +# # +############################################################################ + from PyQt4 import pyqtconfig config = pyqtconfig.Configuration() === modified file 'qtiplot/python-sipcmd.py' --- qtiplot/python-sipcmd.py 2009-11-18 10:33:29 +0000 +++ qtiplot/python-sipcmd.py 2010-07-21 23:21:08 +0000 @@ -1,4 +1,32 @@ #!/usr/bin/python + +############################################################################ +# # +# File : python-sipcmd.py # +# Project : QtiPlot # +# Description : Auto-detect SIP/PyQt location; dump commandline # +# Copyright : (C) 2007-2010 Knut Franke (knut.franke*gmx.de) # +# (replace * with @ in the email address) # +# # +############################################################################ +# # +# This program is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software # +# Foundation, Inc., 51 Franklin Street, Fifth Floor, # +# Boston, MA 02110-1301 USA # +# # +############################################################################ + from PyQt4 import pyqtconfig config = pyqtconfig.Configuration() print " ".join([config.sip_bin, "-I", config.pyqt_sip_dir, config.pyqt_sip_flags]) === modified file 'qtiplot/qtiUtil.py' --- qtiplot/qtiUtil.py 2009-11-18 10:33:29 +0000 +++ qtiplot/qtiUtil.py 2010-07-21 23:21:08 +0000 @@ -1,3 +1,32 @@ +############################################################################ +# # +# File : qtiUtil.py # +# Project : QtiPlot # +# Description : Some Python utilities useful when doing data # +# analysis with QtiPlot # +# Copyright : (C) 2006 Knut Franke (knut.franke*gmx.de) # +# (C) 2006-2010 Ion Vasilief (ion_vasilief*yahoo.fr)# +# (replace * with @ in the email address) # +# # +############################################################################ +# # +# This program is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software # +# Foundation, Inc., 51 Franklin Street, Fifth Floor, # +# Boston, MA 02110-1301 USA # +# # +############################################################################ + """ Some classes and functions that are particularly useful when doing calculations in QtiPlot; maybe also outside of it. === modified file 'qtiplot/qti_wordlist.txt' --- qtiplot/qti_wordlist.txt 2009-11-18 10:33:29 +0000 +++ qtiplot/qti_wordlist.txt 2010-07-21 23:21:08 +0000 @@ -57,6 +57,7 @@ deleteRows text cell +cellData rowData colData setRowData @@ -64,6 +65,7 @@ setColData setText setCell +setCellData colName colNames setColName @@ -84,6 +86,7 @@ setColumnRole setColumnWidth hideColumn +scrollToCell Matrix ColumnRow XY @@ -213,6 +216,7 @@ addCurve removeCurve deleteFitCurves +dataCurve numCurves addFunction addPolarFunction @@ -220,6 +224,8 @@ addErrorBars addHistogram addArrow +arrowsList +numArrows remove addImage setTitleFont @@ -365,6 +371,9 @@ newNote plot importImage +importExcel +importOdfSpreadsheet +importWaveFile newPlot3D plot3D windows @@ -575,6 +584,7 @@ append objectName Spectrogram +spectrogram plotSpectrogram levels setLevelsNumber @@ -650,7 +660,9 @@ setFullRange updateData setVisible +isVisible clearLabels +plotImageProfiles waterfallPlot setWaterfallSideLines setWaterfallFillColor @@ -667,6 +679,7 @@ Default Decimal Scientific +Engineering skipSymbolsCount setSkipSymbolsCount changeCurveIndex @@ -680,3 +693,14 @@ currentEditor indexOf saveAs +resize +setGeometry +setCanvasSize +setCanvasGeometry +range +axisNumericFormat +axisNumericPrecision +setAxisNumericFormat +setXAxisNumericFormat +setYAxisNumericFormat +setZAxisNumericFormat === modified file 'qtiplot/qtiplot.pro' --- qtiplot/qtiplot.pro 2009-12-08 18:06:27 +0000 +++ qtiplot/qtiplot.pro 2010-07-21 23:41:22 +0000 @@ -9,30 +9,32 @@ ############################################################################# # local copy included -INCLUDEPATH += ../3rdparty/qwtplot3d/include -INCLUDEPATH += ../3rdparty/liborigin INCLUDEPATH += ../3rdparty/zlib INCLUDEPATH += ../3rdparty/QTeXEngine/src # configurable INCLUDEPATH += $$MUPARSER_INCLUDEPATH INCLUDEPATH += $$QWT_INCLUDEPATH +INCLUDEPATH += $$QWT3D_INCLUDEPATH INCLUDEPATH += $$GSL_INCLUDEPATH -INCLUDEPATH += $$BOOST_INCLUDEPATH # configurable libs LIBS += $$MUPARSER_LIBS LIBS += $$QWT_LIBS +LIBS += $$QWT3D_LIBS LIBS += $$GSL_LIBS -LIBS += $$BOOST_LIBS +LIBS += -lorigin2 ############################################################################# ###################### BASIC PROJECT PROPERTIES ############################# ############################################################################# QMAKE_PROJECT_DEPTH = 0 + +!contains(CONFIG, BrowserPlugin){ + TEMPLATE = app +} -TEMPLATE = app CONFIG += qt warn_on exceptions opengl thread CONFIG += assistant @@ -76,44 +78,45 @@ ###################### ICONS ################################################ INCLUDEPATH += icons/ -HEADERS += icons/pixmaps.h -HEADERS += icons/axes_icons.h win32:RC_FILE = icons/qtiplot.rc mac:RC_FILE = icons/qtiplot.icns +RESOURCES = ../manual/html/icons/icons.qrc ###################### TRANSLATIONS ######################################### TRANSLATIONS = translations/qtiplot_cn.ts \ translations/qtiplot_cz.ts \ translations/qtiplot_de.ts \ - translations/qtiplot_es.ts \ - translations/qtiplot_fr.ts \ - #translations/qtiplot_pt.ts \ - translations/qtiplot_ro.ts \ - translations/qtiplot_ru.ts \ - translations/qtiplot_ja.ts \ - translations/qtiplot_sv.ts + translations/qtiplot_es.ts \ + translations/qtiplot_fr.ts \ + #translations/qtiplot_pt.ts \ + translations/qtiplot_ro.ts \ + translations/qtiplot_ru.ts \ + translations/qtiplot_ja.ts \ + translations/qtiplot_sv.ts -translations.files += translations/qtiplot_de.qm \ - translations/qtiplot_es.qm \ - translations/qtiplot_fr.qm \ - #translations/qtiplot_pt.qm \ - translations/qtiplot_ru.qm \ - translations/qtiplot_ja.qm \ - translations/qtiplot_sv.qm +translations.files += translations/qtiplot_cn.qm \ + translations/qtiplot_cz.qm \ + translations/qtiplot_de.qm \ + translations/qtiplot_es.qm \ + translations/qtiplot_fr.qm \ + #translations/qtiplot_pt.qm \ + translations/qtiplot_ro.qm \ + translations/qtiplot_ru.qm \ + translations/qtiplot_ja.qm \ + translations/qtiplot_sv.qm isEmpty(LUPDATE): LUPDATE = lupdate -#system($$LUPDATE -verbose qtiplot.pro) +system($$LUPDATE -verbose qtiplot.pro) isEmpty(LRELEASE): LRELEASE = lrelease -#system($$LRELEASE -verbose qtiplot.pro) +system($$LRELEASE -verbose qtiplot.pro) ###################### DOCUMENTATION ######################################## manual.files += ../manual/html \ ../manual/qtiplot-manual-en.pdf -documentation.files += ../README.html \ - ../gpl_licence.txt +documentation.files += ../README.html unix: man.files += ../qtiplot.1 @@ -121,20 +124,18 @@ ##################### Compression (zlib-1.2.3) ################ ############################################################### -SOURCES += ../3rdparty/zlib/minigzip.c +SOURCES += ../minigzip.c ############################################################### ################# Default Modules ############################# ############################################################### -include(../3rdparty/qwtplot3d/qwtplot3d.pri) include(src/analysis/analysis.pri) include(src/core/core.pri) include(src/lib/libqti.pri) include(src/plot2D/plot2D.pri) include(src/plot3D/plot3D.pri) include(src/matrix/matrix.pri) -include(src/origin/origin.pri) include(src/table/table.pri) include(src/scripting/scripting.pri) @@ -158,7 +159,7 @@ qtiUtil.py \ qti_wordlist.txt \ - unix: pythonconfig.path = /usr/local/qtiplot + unix: pythonconfig.path = /usr/share/qtiplot win32: pythonconfig.path = $$INSTALLBASE DEFINES += PYTHON_CONFIG_PATH="\\\"$$replace(pythonconfig.path," ","\ ")\\\" } @@ -199,8 +200,42 @@ unix:LIBS += -lEMF } +# check if we have libxls +!isEmpty(XLS_LIBS) { + DEFINES += XLS_IMPORT + INCLUDEPATH += $$XLS_INCLUDEPATH + LIBS += $$XLS_LIBS +} + +# check if we have QuaZIP +!isEmpty(QUAZIP_LIBS) { + DEFINES += ODS_IMPORT + INCLUDEPATH += $$QUAZIP_INCLUDEPATH + LIBS += $$QUAZIP_LIBS +} + +# check if we have liborigin2 +!isEmpty(BOOST_LIBS) { + DEFINES += OPJ_IMPORT + INCLUDEPATH += $$BOOST_INCLUDEPATH + INCLUDEPATH += /usr/include/liborigin2 + LIBS += $$BOOST_LIBS + include(src/origin/origin.pri) +} + ############################################################### # At the very end: add global include- and lib path unix:INCLUDEPATH += $$SYS_INCLUDEPATH unix:LIBS += $$SYS_LIBS + +############################################################### +############### Building QtiPlot as a browser plugin ########## +############################################################### + +contains(CONFIG, BrowserPlugin){ + DEFINES += BROWSER_PLUGIN + win32: CONFIG += qaxserver + RC_FILE = qtiplot.rc + include(../3rdparty/QtSolutions/qtbrowserplugin/src/qtbrowserplugin.pri) +} === added file 'qtiplot/qtiplot.rc' --- qtiplot/qtiplot.rc 1970-01-01 00:00:00 +0000 +++ qtiplot/qtiplot.rc 2010-07-21 23:21:08 +0000 @@ -0,0 +1,40 @@ +1 TYPELIB "qtiplot.rc" + +1 VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "ProIndep Serv S.r.l.\0" + VALUE "FileDescription", "qtiplot\0" + VALUE "FileExtents", "qti\0" + VALUE "FileOpenName", "QtiPlot project file (*.qti)\0" + VALUE "FileVersion", "1, 0, 0, 1\0" + VALUE "InternalName", "qtiplot\0" + VALUE "LegalTrademarks", "\0" + VALUE "MIMEType", "application/x-qtiplot\0" + VALUE "OriginalFilename", "qtiplot.dll\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "QtiPlot browser plug-in\0" + VALUE "ProductVersion", "1, 0, 0, 1\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END === modified file 'qtiplot/qtiplotrc.py' --- qtiplot/qtiplotrc.py 2009-12-08 18:06:27 +0000 +++ qtiplot/qtiplotrc.py 2010-07-21 23:21:08 +0000 @@ -1,3 +1,32 @@ +############################################################################ +# # +# File : qtiplotrc.py # +# Project : QtiPlot # +# Description : default configuration file of QtiPlot' Python # +# environment # +# Copyright : (C) 2006-2007 Knut Franke (knut.franke*gmx.de) # +# (C) 2006-2010 Ion Vasilief (ion_vasilief*yahoo.fr)# +# (replace * with @ in the email address) # +# # +############################################################################ +# # +# This program is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software # +# Foundation, Inc., 51 Franklin Street, Fifth Floor, # +# Boston, MA 02110-1301 USA # +# # +############################################################################ + import __main__ def import_to_global(modname, attrs=None, math=False): @@ -127,9 +156,9 @@ "tableToMatrix", "matrixToTable", "openTemplate", "saveAsTemplate", "clone", "setWindowName", - "importImage", + "importImage", "importExcel", "importOdfSpreadsheet", "importWaveFile", "setPreferences", - "plot", "plot3D", "stemPlot", "waterfallPlot", + "plot", "plot3D", "stemPlot", "waterfallPlot", "plotImageProfiles", "activeFolder", "rootFolder", "addFolder", "deleteFolder", "changeFolder", "copyFolder", "saveFolder", "appendProject", "saveProjectAs", @@ -164,10 +193,9 @@ # create an empty TaggedList and append values later tl = rpy2.rlike.container.TaggedList([]) # cache row indices for later use - rowIndices = range(1, t.numRows()+1) - for c in range(1, t.numCols() + 1): - values = [t.cell(c, r) for r in rowIndices] - tl.append(rpy2.robjects.FloatVector(values), tag=t.colName(c)) + for colName in t.colNames(): + values = t.colData(colName) + tl.append(rpy2.robjects.FloatVector(values), tag=colName) # build an R dataframe return rpy2.robjects.RDataFrame(tl) # make it also avilable as a table instance method @@ -176,17 +204,9 @@ def newTableFromRDataFrame(df, name = "R result"): "create a new table from a R data frame" t = newTable(name, df.nrow(), df.ncol()) - col = 0 - for colname in df.colnames(): - col += 1 - t.setColName(col, colname) - col = 0 - for coldata in df: - row = 0 - col += 1 - for value in coldata: - row += 1 - t.setCell(col, row, value) + t.setColNames(df.colnames()) + for i, coldata in enumerate(df): + t.setColData(i+1, coldata) return t # make it also avilable as a function of qti.app setattr(app, "newTableFromRDataFrame", newTableFromRDataFrame) === modified file 'qtiplot/src/analysis/Convolution.cpp' --- qtiplot/src/analysis/Convolution.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/Convolution.cpp 2010-07-21 23:21:08 +0000 @@ -159,7 +159,7 @@ DataCurve *c = new DataCurve(d_table, d_table->colName(cols), d_table->colName(cols2)); c->setData(x_temp, d_x, d_n); - c->setPen(QPen(ColorBox::color(d_curveColorIndex), 1)); + c->setPen(QPen(d_curveColor, 1)); d_output_graph->insertPlotItem(c, Graph::Line); d_output_graph->updatePlot(); } === modified file 'qtiplot/src/analysis/Correlation.cpp' --- qtiplot/src/analysis/Correlation.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/Correlation.cpp 2010-07-21 23:21:08 +0000 @@ -188,7 +188,7 @@ DataCurve *c = new DataCurve(d_table, d_table->colName(cols), d_table->colName(cols2)); c->setData(x_temp, y_temp, d_n); - c->setPen(QPen(ColorBox::color(d_curveColorIndex), 1)); + c->setPen(QPen(d_curveColor, 1)); d_output_graph->insertPlotItem(c, Graph::Line); d_output_graph->updatePlot(); } === modified file 'qtiplot/src/analysis/FFT.cpp' --- qtiplot/src/analysis/FFT.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/FFT.cpp 2010-07-21 23:21:08 +0000 @@ -279,7 +279,7 @@ d_output_graph->setYAxisTitle(tr("Amplitude")); PlotCurve *c = d_output_graph->insertCurve(d_result_table, 0, tableName + "_" + tr("Amplitude"), 0); - c->setPen(QPen(ColorBox::color(d_curveColorIndex), 1)); + c->setPen(QPen(d_curveColor, 1)); d_output_graph->updatePlot(); } } === modified file 'qtiplot/src/analysis/Filter.cpp' --- qtiplot/src/analysis/Filter.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/Filter.cpp 2010-07-21 23:21:08 +0000 @@ -70,7 +70,7 @@ void Filter::init() { d_n = 0; - d_curveColorIndex = 1; + d_curveColor = Qt::red; d_tolerance = 1e-4; d_points = 100; d_max_iterations = 1000; @@ -212,21 +212,28 @@ return true; } +void Filter::setColor(int colorId) +{ + d_curveColor = ColorBox::defaultColor(colorId); +} + void Filter::setColor(const QString& colorName) { - QColor c = QColor(colorName); - if (colorName == "green") - c = QColor(Qt::green); - else if (colorName == "darkYellow") - c = QColor(Qt::darkYellow); - if (!ColorBox::isValidColor(c)){ - QMessageBox::critical((ApplicationWindow *)parent(), tr("QtiPlot - Color Name Error"), + QColor c = QColor(colorName); + if (d_curveColor == c) + return; + + d_curveColor = c; + if (colorName == "green") + d_curveColor = Qt::green; + else if (colorName == "darkYellow") + d_curveColor = Qt::darkYellow; + if (!ColorBox::isValidColor(c)){ + QMessageBox::critical((ApplicationWindow *)parent(), tr("QtiPlot - Color Name Error"), tr("The color name '%1' is not valid, a default color (red) will be used instead!").arg(colorName)); - d_curveColorIndex = 1; - return; - } - - d_curveColorIndex = ColorBox::colorIndex(c); + d_curveColor = Qt::red; + return; + } } void Filter::showLegend() @@ -261,29 +268,42 @@ QApplication::setOverrideCursor(Qt::WaitCursor); - output();//data analysis and output - ((ApplicationWindow *)parent())->updateLog(logInfo()); + output();//data analysis and output + ((ApplicationWindow *)parent())->updateLog(logInfo()); QApplication::restoreOverrideCursor(); - return true; + return true; } void Filter::output() { - double X[d_points], Y[d_points]; - calculateOutputData(X, Y); //does the data analysis - addResultCurve(X, Y); + double *x = (double *)malloc(d_points*sizeof(double)); + if (!x){ + memoryErrorMessage(); + return; + } + double *y = (double *)malloc(d_points*sizeof(double)); + if (!y){ + free(x); + memoryErrorMessage(); + return; + } + + calculateOutputData(x, y); //does the data analysis + addResultCurve(x, y); + free(x); + free(y); } int Filter::sortedCurveData(QwtPlotCurve *c, double start, double end, double **x, double **y) { - if (!c) - return 0; + if (!c) + return 0; int i_start = 0, i_end = 0; int n = curveRange(c, start, end, &i_start, &i_end); - (*x) = (double *)malloc(n*sizeof(double)); + (*x) = (double *)malloc(n*sizeof(double)); if (!x){ memoryErrorMessage(); return 0; @@ -296,25 +316,34 @@ return 0; } - double *xtemp = new double[n]; - double *ytemp = new double[n]; - - int j = 0; - for (int i = i_start; i <= i_end; i++){ - xtemp[j] = c->x(i); - ytemp[j++] = c->y(i); - } - size_t *p = new size_t[n]; - gsl_sort_index(p, xtemp, 1, n); - for (int i=0; icurveType() == QwtPlotCurve::Yfx){ + for (int i = i_start; i <= i_end; i++){ + xtemp[j] = c->x(i); + ytemp[j++] = c->y(i); + } + } else { + for (int i = i_start; i <= i_end; i++){ + xtemp[j] = c->y(i); + ytemp[j++] = c->x(i); + } + } + + size_t *p = new size_t[n]; + gsl_sort_index(p, xtemp, 1, n); + + for (int i = 0; i < n; i++){ + (*x)[i] = xtemp[p[i]]; + (*y)[i] = ytemp[p[i]]; + } + + delete[] xtemp; + delete[] ytemp; + delete[] p; + return n; } int Filter::curveData(QwtPlotCurve *c, double start, double end, double **x, double **y) @@ -338,12 +367,19 @@ return 0; } - int j = 0; - for (int i = i_start; i <= i_end; i++){ - (*x)[j] = c->x(i); - (*y)[j++] = c->y(i); - } - return n; + int j = 0; + if (c->curveType() == QwtPlotCurve::Yfx){ + for (int i = i_start; i <= i_end; i++){ + (*x)[j] = c->x(i); + (*y)[j++] = c->y(i); + } + } else { + for (int i = i_start; i <= i_end; i++){ + (*x)[j] = c->y(i); + (*y)[j++] = c->x(i); + } + } + return n; } int Filter::curveRange(QwtPlotCurve *c, double start, double end, int *iStart, int *iEnd) @@ -390,17 +426,20 @@ QwtPlotCurve* Filter::addResultCurve(double *x, double *y) { - ApplicationWindow *app = (ApplicationWindow *)parent(); - QLocale locale = app->locale(); - const QString tableName = app->generateUniqueName(QString(objectName())); + ApplicationWindow *app = (ApplicationWindow *)parent(); + QLocale locale = app->locale(); + const QString tableName = app->generateUniqueName(QString(objectName())); QString dataSet; if (d_curve) dataSet = d_curve->title().text(); else dataSet = d_y_col_name; - d_result_table = app->newHiddenTable(tableName, d_explanation + " " + tr("of") + " " + dataSet, d_points, 2); - for (int i=0; inewHiddenTable(tableName, d_explanation + " " + tr("of") + " " + dataSet, d_points, 2); + if (!d_result_table) + return 0; + + for (int i = 0; i < d_points; i++){ d_result_table->setText(i, 0, locale.toString(x[i], 'g', app->d_decimal_digits)); d_result_table->setText(i, 1, locale.toString(y[i], 'g', app->d_decimal_digits)); } @@ -408,14 +447,21 @@ DataCurve *c = 0; if (d_graphics_display){ c = new DataCurve(d_result_table, tableName + "_1", tableName + "_2"); - c->setData(x, y, d_points); - c->setPen(QPen(ColorBox::color(d_curveColorIndex), 1)); + if (d_curve){ + c->setCurveType(d_curve->curveType()); + c->setAxis(d_curve->xAxis(), d_curve->yAxis()); + } + if (c->curveType() == QwtPlotCurve::Yfx) + c->setData(x, y, d_points); + else + c->setData(y, x, d_points); + c->setPen(QPen(d_curveColor, 1)); if (!d_output_graph) createOutputGraph(); d_output_graph->insertPlotItem(c, Graph::Line); - d_output_graph->updatePlot(); + d_output_graph->updatePlot(); } return (QwtPlotCurve*)c; } @@ -533,9 +579,11 @@ { d_init_err = true; - QMessageBox::critical((ApplicationWindow *)parent(), - tr("QtiPlot") + " - " + tr("Memory Allocation Error"), - tr("Not enough memory, operation aborted!")); + QApplication::restoreOverrideCursor(); + + QMessageBox::critical((ApplicationWindow *)parent(), + tr("QtiPlot") + " - " + tr("Memory Allocation Error"), + tr("Not enough memory, operation aborted!")); } void Filter::freeMemory() === modified file 'qtiplot/src/analysis/Filter.h' --- qtiplot/src/analysis/Filter.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/Filter.h 2010-07-21 23:21:08 +0000 @@ -66,9 +66,10 @@ //! Sets the tolerance used by the GSL routines void setTolerance(double eps){d_tolerance = eps;}; + //! Obsolete: sets the color of the output fit curve. + void setColor(int colorId); //! Sets the color of the output fit curve. - void setColor(int colorId){d_curveColorIndex = colorId;}; - + void setColor(const QColor& color){d_curveColor = color;}; //! Sets the color of the output fit curve. Provided for convenience. To be used in scripts only! void setColor(const QString& colorName); @@ -161,7 +162,7 @@ int d_points; //! Color index of the result curve - int d_curveColorIndex; + QColor d_curveColor; //! Maximum number of iterations per fit int d_max_iterations; === modified file 'qtiplot/src/analysis/Fit.cpp' --- qtiplot/src/analysis/Fit.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/Fit.cpp 2010-07-21 23:21:08 +0000 @@ -71,7 +71,7 @@ d_x = 0; d_y = 0; d_w = 0; - d_curveColorIndex = 1; + d_curveColor = Qt::red; d_solver = ScaledLevenbergMarquardt; d_tolerance = 1e-4; d_gen_function = true; @@ -312,8 +312,7 @@ info +="\n"; info += tr("Weighting Method") + ": "; - switch(d_weighting) - { + switch(d_weighting){ case NoWeighting: info += tr("No weighting"); break; @@ -346,7 +345,8 @@ } info += tr("From x")+" = "+locale.toString(d_x[0], 'e', d_prec)+" "+tr("to x")+" = "+locale.toString(d_x[d_n-1], 'e', d_prec)+"\n"; - double chi_2_dof = chi_2/(d_n - d_p); + int dof = d_n - d_p; + double chi_2_dof = chi_2/dof; for (int i=0; i 1) + info += tr("Adjusted R^2") + " = " + locale.toString(d_adjusted_r_square, 'g', d_prec) + "\n"; + if (dof >= 1) + info += tr("RMSE (Root Mean Squared Error)") + " = " + locale.toString(sqrt(d_rss/dof), 'g', d_prec) + "\n"; info += tr("RSS (Residual Sum of Squares)") + " = " + locale.toString(d_rss, 'g', d_prec) + "\n"; info += "---------------------------------------------------------------------------------------\n"; if (is_non_linear){ @@ -530,7 +532,7 @@ if (t->numRows() < d_n){ QMessageBox::critical((ApplicationWindow *)parent(), tr("QtiPlot - Error"), - tr("The column %1 has less points than the fitted data set. Please choose another column!.").arg(colName)); + tr("The column %1 has less points than the fitted data set. Please choose another column!").arg(colName)); return false; } @@ -556,6 +558,9 @@ } d_param_table->setHeader(QStringList() << tr("Parameter") << tr("Value") << tr ("Error")); + + d_param_table->setColumnType(0, Table::Text); + d_param_table->setColPlotDesignation(0, Table::None); d_param_table->setColPlotDesignation(2, Table::yErr); d_param_table->setHeaderColType(); @@ -618,15 +623,15 @@ double *Fit::errors() { - if (!d_errors) { + if (!d_errors) d_errors = new double[d_p]; - double chi_2_dof = chi_2/(d_n - d_p); - for (int i = 0; i < d_p; i++){ - if (d_scale_errors) - d_errors[i] = sqrt(chi_2_dof*gsl_matrix_get(covar,i,i)); - else - d_errors[i] = sqrt(gsl_matrix_get(covar,i,i)); - } + + double chi_2_dof = chi_2/(d_n - d_p); + for (int i = 0; i < d_p; i++){ + if (d_scale_errors) + d_errors[i] = sqrt(chi_2_dof*gsl_matrix_get(covar,i,i)); + else + d_errors[i] = sqrt(gsl_matrix_get(covar,i,i)); } return d_errors; } @@ -675,7 +680,7 @@ QString tableName = outputTable->objectName(); DataCurve *c = new DataCurve(outputTable, tableName + "_1", tableName + "_residue"); c->setData(d_x, d_residuals, d_n); - c->setPen(QPen(ColorBox::color(d_curveColorIndex + 1), 1)); + c->setPen(QPen(ColorBox::color(ColorBox::colorIndex(d_curveColor) + 1), 1)); d_output_graph->insertPlotItem(c, Graph::Line); d_output_graph->updatePlot(); @@ -768,12 +773,12 @@ QString tableName = outputTable->objectName(); DataCurve *c = new DataCurve(outputTable, tableName + "_1", tableName + "_LCL"); c->setData(X, lcl, points); - c->setPen(QPen(ColorBox::color(d_curveColorIndex + 2), 1)); + c->setPen(QPen(ColorBox::color(ColorBox::colorIndex(d_curveColor) + 2), 1)); d_output_graph->insertPlotItem(c, Graph::Line); c = new DataCurve(outputTable, tableName + "_1", tableName + "_UCL"); c->setData(X, ucl, points); - c->setPen(QPen(ColorBox::color(d_curveColorIndex + 2), 1)); + c->setPen(QPen(ColorBox::color(ColorBox::colorIndex(d_curveColor) + 2), 1)); d_output_graph->insertPlotItem(c, Graph::Line); d_output_graph->updatePlot(); @@ -885,12 +890,12 @@ QString tableName = outputTable->objectName(); DataCurve *c = new DataCurve(outputTable, tableName + "_1", tableName + "_LPL"); c->setData(X, lcl, points); - c->setPen(QPen(ColorBox::color(d_curveColorIndex + 3), 1)); + c->setPen(QPen(ColorBox::color(ColorBox::colorIndex(d_curveColor) + 3), 1)); d_output_graph->insertPlotItem(c, Graph::Line); c = new DataCurve(outputTable, tableName + "_1", tableName + "_UPL"); c->setData(X, ucl, points); - c->setPen(QPen(ColorBox::color(d_curveColorIndex + 3), 1)); + c->setPen(QPen(ColorBox::color(ColorBox::colorIndex(d_curveColor) + 3), 1)); d_output_graph->insertPlotItem(c, Graph::Line); d_output_graph->updatePlot(); @@ -926,10 +931,11 @@ return; } + if (!removeDataSingularities()) + return; + QApplication::setOverrideCursor(Qt::WaitCursor); - removeDataSingularities(); - struct FitData d_data = {d_n, d_p, d_x, d_y, d_w, this}; int status, iterations = d_max_iterations; @@ -1019,11 +1025,15 @@ { QString title = d_output_graph->generateFunctionName(name); FunctionCurve *c = new FunctionCurve(FunctionCurve::Normal, title); - c->setPen(QPen(ColorBox::color(d_curveColorIndex), penWidth)); - c->setRange(d_from, d_to); + c->setPen(QPen(d_curveColor, penWidth)); + c->setRange(QMIN(d_from, d_to), QMAX(d_from, d_to)); c->setFormula(d_formula); + if (d_curve){ + c->setCurveType(d_curve->curveType()); + c->setAxis(d_curve->xAxis(), d_curve->yAxis()); + } - for (int j=0; jsetConstant(d_param_names[j], d_results[j]); if (updateData) === modified file 'qtiplot/src/analysis/Fit.h' --- qtiplot/src/analysis/Fit.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/Fit.h 2010-07-21 23:21:08 +0000 @@ -162,7 +162,7 @@ virtual void customizeFitResults(){}; //! Removes any data singularities before fitting - virtual void removeDataSingularities(){}; + virtual bool removeDataSingularities(){return true;}; protected: //! Allocates the memory for the fit workspace @@ -251,7 +251,7 @@ bool d_scale_errors; //! Table window used for the output of fit parameters - Table *d_param_table; + QPointer
d_param_table; //! Matrix window used for the output of covariance matrix Matrix *d_cov_matrix; === modified file 'qtiplot/src/analysis/Integration.cpp' --- qtiplot/src/analysis/Integration.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/Integration.cpp 2010-07-21 23:21:08 +0000 @@ -2,7 +2,7 @@ File : Integration.cpp Project : QtiPlot -------------------------------------------------------------------- - Copyright : (C) 2007 by Ion Vasilief + Copyright : (C) 2007 - 2010 by Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : Numerical integration of data sets @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -254,16 +255,23 @@ void Integration::output() { - if(d_integrand != AnalyticalFunction || d_init_err) - return; - - if (!d_output_graph) - return; - - FunctionCurve* c = d_output_graph->addFunction(QStringList(d_formula), d_from, d_to, d_points, - d_variable, FunctionCurve::Normal); - if (c){ - c->setBrush(QBrush(c->pen().color(), Qt::BDiagPattern)); - d_output_graph->replot(); - } + if(d_integrand != AnalyticalFunction || d_init_err) + return; + + if (!d_output_graph) + return; + + FunctionCurve* c = d_output_graph->addFunction(QStringList(d_formula), d_from, d_to, d_points, d_variable, FunctionCurve::Normal); + if (c){ + QColor color = c->pen().color(); + Qt::BrushStyle brushStyle = Qt::BDiagPattern; + ApplicationWindow *app = (ApplicationWindow *)parent(); + if (app){ + color.setAlpha(app->defaultCurveAlpha); + brushStyle = PatternBox::brushStyle(app->defaultCurveBrush); + } + + c->setBrush(QBrush(color, brushStyle)); + d_output_graph->replot(); + } } === modified file 'qtiplot/src/analysis/Interpolation.cpp' --- qtiplot/src/analysis/Interpolation.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/Interpolation.cpp 2010-07-21 23:21:08 +0000 @@ -195,95 +195,102 @@ int Interpolation::sortedCurveData(QwtPlotCurve *c, double start, double end, double **x, double **y) { - if (!c || c->rtti() != QwtPlotItem::Rtti_PlotCurve) - return 0; + if (!c || c->rtti() != QwtPlotItem::Rtti_PlotCurve) + return 0; int n = c->dataSize(); double *xtemp = (double *)malloc(n*sizeof(double)); if (!xtemp) - memoryErrorMessage(); - - double *ytemp = (double *)malloc(n*sizeof(double)); - if (!ytemp){ - free(xtemp); - memoryErrorMessage(); - } - - for (int i = 0; i < n; i++){ - xtemp[i] = c->x(i); - ytemp[i] = c->y(i); - } + memoryErrorMessage(); + + double *ytemp = (double *)malloc(n*sizeof(double)); + if (!ytemp){ + free(xtemp); + memoryErrorMessage(); + } + + if (c->curveType() == QwtPlotCurve::Yfx){ + for (int i = 0; i < n; i++){ + xtemp[i] = c->x(i); + ytemp[i] = c->y(i); + } + } else { + for (int i = 0; i < n; i++){ + xtemp[i] = c->y(i); + ytemp[i] = c->x(i); + } + } size_t *p = (size_t *)malloc(n*sizeof(size_t)); if (!p){ - free(xtemp); free(ytemp); - memoryErrorMessage(); - } - gsl_sort_index(p, xtemp, 1, n); + free(xtemp); free(ytemp); + memoryErrorMessage(); + } + gsl_sort_index(p, xtemp, 1, n); double *xtemp2 = (double *)malloc(n*sizeof(double)); - if (!xtemp2){ - free(xtemp); free(ytemp); free(p); - memoryErrorMessage(); - } - - double *ytemp2 = (double *)malloc(n*sizeof(double)); - if (!ytemp2){ - free(xtemp); free(ytemp); free(p); free(xtemp2); - memoryErrorMessage(); - } - - for (int i = 0; i < n; i++){ - xtemp2[i] = xtemp[p[i]]; - ytemp2[i] = ytemp[p[i]]; - } - free(xtemp); - free(ytemp); - free(p); + if (!xtemp2){ + free(xtemp); free(ytemp); free(p); + memoryErrorMessage(); + } + + double *ytemp2 = (double *)malloc(n*sizeof(double)); + if (!ytemp2){ + free(xtemp); free(ytemp); free(p); free(xtemp2); + memoryErrorMessage(); + } + + for (int i = 0; i < n; i++){ + xtemp2[i] = xtemp[p[i]]; + ytemp2[i] = ytemp[p[i]]; + } + free(xtemp); + free(ytemp); + free(p); int i_start = 0, i_end = n; - for (int i = 0; i < i_end; i++) - if (xtemp2[i] > start && i){ - i_start = i - 1; - break; - } - for (int i = i_end - 1; i >= 0; i--) - if (xtemp2[i] < end && i < n){ - i_end = i + 1; - break; - } + for (int i = 0; i < i_end; i++) + if (xtemp2[i] >= start){ + i_start = i; + break; + } + for (int i = i_end - 1; i >= 0; i--) + if (xtemp2[i] <= end){ + i_end = i; + break; + } - n = i_end - i_start + 1; - if (n > c->dataSize()) + n = i_end - i_start + 1; + if (n > c->dataSize()) n = c->dataSize(); - (*x) = (double *)malloc(n*sizeof(double)); - if (!x){ - free(xtemp2); free(ytemp2); - memoryErrorMessage(); - } - - (*y) = (double *)malloc(n*sizeof(double)); - if (!y){ - free(xtemp2); free(ytemp2); free(x); - memoryErrorMessage(); - } - - int j = 0; + (*x) = (double *)malloc(n*sizeof(double)); + if (!x){ + free(xtemp2); free(ytemp2); + memoryErrorMessage(); + } + + (*y) = (double *)malloc(n*sizeof(double)); + if (!y){ + free(xtemp2); free(ytemp2); free(x); + memoryErrorMessage(); + } + + int j = 0; for (int i = i_start; i <= i_end; i++){ - (*x)[j] = xtemp2[i]; - (*y)[j] = ytemp2[i]; - j++; - } - free(xtemp2); - free(ytemp2); + (*x)[j] = xtemp2[i]; + (*y)[j] = ytemp2[i]; + j++; + } + free(xtemp2); + free(ytemp2); - double pr_x = (*x)[0]; - for (int i = 1; i < n; i++){ - double xval = (*x)[i]; - if (xval <= pr_x) - return -1;//x values must be monotonically increasing in GSL interpolation routines - pr_x = xval; - } + double pr_x = (*x)[0]; + for (int i = 1; i < n; i++){ + double xval = (*x)[i]; + if (xval <= pr_x) + return -1;//x values must be monotonically increasing in GSL interpolation routines + pr_x = xval; + } return n; } === modified file 'qtiplot/src/analysis/MultiPeakFit.cpp' --- qtiplot/src/analysis/MultiPeakFit.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/MultiPeakFit.cpp 2010-07-21 23:21:08 +0000 @@ -228,7 +228,7 @@ QString title = tr("Peak") + QString::number(++index); FunctionCurve *c = new FunctionCurve(FunctionCurve::Normal, title); - c->setPen(QPen(ColorBox::color(d_peaks_color), 1)); + c->setPen(QPen(d_peaks_color, 1)); c->setRange(d_from, d_to); c->setFormula("y0 + " + peakFormula(peak + 1, d_profile)); c->setConstant(d_param_names[d_p - 1], d_results[d_p - 1]);//y0 - offset @@ -236,6 +236,10 @@ int p = 3*peak + j; c->setConstant(d_param_names[p], d_results[p]); } + if (d_curve){ + c->setCurveType(d_curve->curveType()); + c->setAxis(d_curve->xAxis(), d_curve->yAxis()); + } c->loadData(d_points); d_output_graph->insertPlotItem(c, Graph::Line); @@ -279,11 +283,17 @@ return; } - #ifdef Q_CC_MSVC - QVarLengthArray X(d_points), Y(d_points); - #else - double X[d_points], Y[d_points]; - #endif + double *X = (double *)malloc(d_points*sizeof(double)); + if (!X){ + memoryErrorMessage(); + return; + } + double *Y = (double *)malloc(d_points*sizeof(double)); + if (!Y){ + memoryErrorMessage(); + free(X); + return; + } QString tableName = app->generateUniqueName(tr("Fit")); QString dataSet; @@ -333,15 +343,20 @@ label = tableName + "_2"; DataCurve *c = new DataCurve(d_result_table, tableName + "_1", label); + if (d_curve){ + c->setCurveType(d_curve->curveType()); + c->setAxis(d_curve->xAxis(), d_curve->yAxis()); + } if (d_peaks > 1) - c->setPen(QPen(ColorBox::color(d_curveColorIndex), 2)); - else - c->setPen(QPen(ColorBox::color(d_curveColorIndex), 1)); -#ifdef Q_CC_MSVC - c->setData(X.data(), Y.data(), d_points); -#else - c->setData(X, Y, d_points); -#endif + c->setPen(QPen(d_curveColor, 2)); + else + c->setPen(QPen(d_curveColor, 1)); + + if (c->curveType() == QwtPlotCurve::Xfy) + c->setData(Y, X, d_points); + else + c->setData(X, Y, d_points); + d_output_graph->insertPlotItem(c, Graph::Line); d_output_graph->addFitCurve(c); @@ -352,12 +367,18 @@ label = tableName + "_" + tr("peak") + QString::number(i+1); c = new DataCurve(d_result_table, tableName + "_1", label); - c->setPen(QPen(ColorBox::color(d_peaks_color), 1)); -#ifdef Q_CC_MSVC - c->setData(X.data(), Y.data(), d_points); -#else - c->setData(X, Y, d_points); -#endif + c->setPen(QPen(d_peaks_color, 1)); + + if (d_curve){ + c->setCurveType(d_curve->curveType()); + c->setAxis(d_curve->xAxis(), d_curve->yAxis()); + } + + if (c->curveType() == QwtPlotCurve::Xfy) + c->setData(Y, X, d_points); + else + c->setData(X, Y, d_points); + d_output_graph->insertPlotItem(c, Graph::Line); d_output_graph->addFitCurve(c); } @@ -365,6 +386,8 @@ d_output_graph->replot(); } gsl_matrix_free(m); + free(X); + free(Y); } } @@ -415,6 +438,11 @@ return info; } +void MultiPeakFit::setPeakCurvesColor(int colorIndex) +{ + d_peaks_color = ColorBox::defaultColor(colorIndex); +} + /***************************************************************************** * * Class LorentzFit === modified file 'qtiplot/src/analysis/MultiPeakFit.h' --- qtiplot/src/analysis/MultiPeakFit.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/MultiPeakFit.h 2010-07-21 23:21:08 +0000 @@ -46,7 +46,8 @@ void setNumPeaks(int n); void enablePeakCurves(bool on){generate_peak_curves = on;}; - void setPeakCurvesColor(int colorIndex){d_peaks_color = colorIndex;}; + void setPeakCurvesColor(int colorIndex); + void setPeakCurvesColor(const QColor& color){d_peaks_color = color;}; static QString generateFormula(int order, PeakProfile profile); static QStringList generateParameterList(int order); @@ -76,8 +77,8 @@ //! Tells weather the peak curves should be displayed together with the best line fit. bool generate_peak_curves; - //! Color index for the peak curves - int d_peaks_color; + //! Color for the peak curves + QColor d_peaks_color; //! The peak profile PeakProfile d_profile; === modified file 'qtiplot/src/analysis/NonLinearFit.cpp' --- qtiplot/src/analysis/NonLinearFit.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/NonLinearFit.cpp 2010-07-21 23:21:08 +0000 @@ -273,7 +273,7 @@ return c; } -QStringList NonLinearFit::guessParameters(const QString& s, bool *error, string *errMsg) +QStringList NonLinearFit::guessParameters(const QString& s, bool *error, string *errMsg, const QString& var) { QString text = s; text.remove(QRegExp("\\s")).remove("."); @@ -283,6 +283,8 @@ MyParser parser; ParserTokenReader reader(&parser); + QLocale locale = QLocale(); + const char *formula = text.toAscii().data(); int length = text.toAscii().length(); reader.SetFormula (formula); @@ -291,9 +293,26 @@ while(pos < length){ ParserToken token = reader.ReadNextToken(); QString str = QString(token.GetAsString().c_str()); + + bool isNumber; + locale.toDouble(str, &isNumber); + if (token.GetCode () == cmVAR && str.contains(QRegExp("\\D")) - && str != "x" && !parList.contains(str)) - parList << str; + && str != var && !parList.contains(str) && !isNumber){ + if (str.endsWith("e", Qt::CaseInsensitive) && + str.count("e", Qt::CaseInsensitive) == 1){ + + QString aux = str; + aux.remove("e", Qt::CaseInsensitive); + + bool auxIsNumber; + locale.toDouble(aux, &auxIsNumber); + if (!auxIsNumber) + parList << str; + } else + parList << str; + } + pos = reader.GetPos(); } parList.sort(); @@ -309,7 +328,7 @@ return parList; } -void NonLinearFit::removeDataSingularities() +bool NonLinearFit::removeDataSingularities() { MyParser parser; for (int i = 0; i < d_p; i++){ @@ -327,18 +346,32 @@ parser.DefineVar("x", &xvar); parser.SetExpr(d_formula.ascii()); - for (int i = 0; i < d_n; i++){ - xvar = d_x[i]; - try { + bool confirm = true; + for (int i = 0; i < d_n; i++){ + xvar = d_x[i]; + try { parser.EvalRemoveSingularity(&xvar); - } catch(MyParser::Pole){ + } catch(MyParser::Pole){ QApplication::restoreOverrideCursor(); - QMessageBox::critical(0, QObject::tr("QtiPlot"), - QObject::tr("Ignored data point at x = %1.").arg(xvar)); - - removePole(i); - } - } + if(confirm){ + switch(QMessageBox::question((ApplicationWindow *)parent(), QObject::tr("QtiPlot"), + QObject::tr("Found non-removable singularity at x = %1.").arg(xvar) + "\n" + tr("Ignore") + "?", + QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::Cancel, + QMessageBox::Yes)){ + case QMessageBox::YesToAll: + confirm = false; + removePole(i); + break; + case QMessageBox::Cancel: + return false; + default: + removePole(i); + } + } else + removePole(i); + } + } + return true; } void NonLinearFit::removePole(int pole) === modified file 'qtiplot/src/analysis/NonLinearFit.h' --- qtiplot/src/analysis/NonLinearFit.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/NonLinearFit.h 2010-07-21 23:21:08 +0000 @@ -59,7 +59,7 @@ double constValue(const QString& name){return d_constants.value(name);}; virtual QString legendInfo(); - static QStringList guessParameters(const QString& s, bool *error = 0, string *errMsg = 0); + static QStringList guessParameters(const QString& s, bool *error = 0, string *errMsg = 0, const QString& var = "x"); protected: QString logFitInfo(int iterations, int status); @@ -68,7 +68,7 @@ private: void calculateFitCurveData(double *X, double *Y); void init(); - virtual void removeDataSingularities(); + virtual bool removeDataSingularities(); void removePole(int index); QMap d_constants; === modified file 'qtiplot/src/analysis/SmoothFilter.cpp' --- qtiplot/src/analysis/SmoothFilter.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/SmoothFilter.cpp 2010-07-21 23:21:08 +0000 @@ -115,7 +115,7 @@ smoothAverage(x, y); break; case 4: - d_explanation = QString::number(d_smooth_points) + " " + tr("points") + " " + tr("Lowess smoothing"); + d_explanation = tr("Lowess smoothing with f=%1 and %2 iterations").arg(d_f).arg(d_iterations); smoothLowess(x, y); break; } === added file 'qtiplot/src/analysis/analysis.pri' --- qtiplot/src/analysis/analysis.pri 1970-01-01 00:00:00 +0000 +++ qtiplot/src/analysis/analysis.pri 2010-07-21 23:21:08 +0000 @@ -0,0 +1,72 @@ +############################################################### +################# Module: Analysis ############################## +############################################################### + +INCLUDEPATH += src/analysis/ +INCLUDEPATH += src/analysis/dialogs/ + + HEADERS += src/analysis/Convolution.h \ + src/analysis/Correlation.h \ + src/analysis/Differentiation.h \ + src/analysis/ExponentialFit.h \ + src/analysis/FFTFilter.h \ + src/analysis/FFT.h \ + src/analysis/Filter.h \ + src/analysis/Fit.h \ + src/analysis/FitModelHandler.h \ + src/analysis/Integration.h \ + src/analysis/Interpolation.h \ + src/analysis/LogisticFit.h \ + src/analysis/MultiPeakFit.h \ + src/analysis/NonLinearFit.h \ + src/analysis/PluginFit.h \ + src/analysis/PolynomialFit.h \ + src/analysis/SigmoidalFit.h \ + src/analysis/SmoothFilter.h \ + src/analysis/fft2D.h \ + src/analysis/fit_gsl.h \ + src/analysis/nrutil.h \ + + SOURCES += src/analysis/Convolution.cpp \ + src/analysis/Correlation.cpp \ + src/analysis/Differentiation.cpp \ + src/analysis/ExponentialFit.cpp \ + src/analysis/FFTFilter.cpp \ + src/analysis/FFT.cpp \ + src/analysis/Filter.cpp \ + src/analysis/Fit.cpp \ + src/analysis/FitModelHandler.cpp \ + src/analysis/Integration.cpp \ + src/analysis/Interpolation.cpp \ + src/analysis/LogisticFit.cpp \ + src/analysis/MultiPeakFit.cpp \ + src/analysis/NonLinearFit.cpp \ + src/analysis/PluginFit.cpp \ + src/analysis/PolynomialFit.cpp \ + src/analysis/SigmoidalFit.cpp \ + src/analysis/SmoothFilter.cpp \ + src/analysis/fft2D.cpp \ + src/analysis/fit_gsl.cpp \ + src/analysis/nrutil.cpp \ + + HEADERS += src/analysis/dialogs/ExpDecayDialog.h \ + src/analysis/dialogs/FFTDialog.h \ + src/analysis/dialogs/FitDialog.h \ + src/analysis/dialogs/FilterDialog.h \ + src/analysis/dialogs/FrequencyCountDialog.h \ + src/analysis/dialogs/IntDialog.h \ + src/analysis/dialogs/InterpolationDialog.h \ + src/analysis/dialogs/PolynomFitDialog.h \ + src/analysis/dialogs/SmoothCurveDialog.h \ + src/analysis/dialogs/SubtractDataDialog.h \ + + SOURCES += src/analysis/dialogs/ExpDecayDialog.cpp \ + src/analysis/dialogs/FFTDialog.cpp \ + src/analysis/dialogs/FitDialog.cpp \ + src/analysis/dialogs/FilterDialog.cpp \ + src/analysis/dialogs/FrequencyCountDialog.cpp \ + src/analysis/dialogs/IntDialog.cpp \ + src/analysis/dialogs/InterpolationDialog.cpp \ + src/analysis/dialogs/PolynomFitDialog.cpp \ + src/analysis/dialogs/SmoothCurveDialog.cpp \ + src/analysis/dialogs/SubtractDataDialog.cpp \ === removed file 'qtiplot/src/analysis/analysis.pri' --- qtiplot/src/analysis/analysis.pri 2009-12-08 18:06:27 +0000 +++ qtiplot/src/analysis/analysis.pri 1970-01-01 00:00:00 +0000 @@ -1,70 +0,0 @@ -############################################################### -################# Module: Analysis ############################## -############################################################### - -INCLUDEPATH += src/analysis/ -INCLUDEPATH += src/analysis/dialogs/ - - HEADERS += src/analysis/Convolution.h \ - src/analysis/Correlation.h \ - src/analysis/Differentiation.h \ - src/analysis/ExponentialFit.h \ - src/analysis/FFTFilter.h \ - src/analysis/FFT.h \ - src/analysis/Filter.h \ - src/analysis/Fit.h \ - src/analysis/FitModelHandler.h \ - src/analysis/Integration.h \ - src/analysis/Interpolation.h \ - src/analysis/LogisticFit.h \ - src/analysis/MultiPeakFit.h \ - src/analysis/NonLinearFit.h \ - src/analysis/PluginFit.h \ - src/analysis/PolynomialFit.h \ - src/analysis/SigmoidalFit.h \ - src/analysis/SmoothFilter.h \ - src/analysis/fft2D.h \ - src/analysis/fit_gsl.h \ - src/analysis/nrutil.h \ - - SOURCES += src/analysis/Convolution.cpp \ - src/analysis/Correlation.cpp \ - src/analysis/Differentiation.cpp \ - src/analysis/ExponentialFit.cpp \ - src/analysis/FFTFilter.cpp \ - src/analysis/FFT.cpp \ - src/analysis/Filter.cpp \ - src/analysis/Fit.cpp \ - src/analysis/FitModelHandler.cpp \ - src/analysis/Integration.cpp \ - src/analysis/Interpolation.cpp \ - src/analysis/LogisticFit.cpp \ - src/analysis/MultiPeakFit.cpp \ - src/analysis/NonLinearFit.cpp \ - src/analysis/PluginFit.cpp \ - src/analysis/PolynomialFit.cpp \ - src/analysis/SigmoidalFit.cpp \ - src/analysis/SmoothFilter.cpp \ - src/analysis/fft2D.cpp \ - src/analysis/fit_gsl.cpp \ - src/analysis/nrutil.cpp \ - - HEADERS += src/analysis/dialogs/ExpDecayDialog.h \ - src/analysis/dialogs/FFTDialog.h \ - src/analysis/dialogs/FitDialog.h \ - src/analysis/dialogs/FilterDialog.h \ - src/analysis/dialogs/FrequencyCountDialog.h \ - src/analysis/dialogs/IntDialog.h \ - src/analysis/dialogs/InterpolationDialog.h \ - src/analysis/dialogs/PolynomFitDialog.h \ - src/analysis/dialogs/SmoothCurveDialog.h \ - - SOURCES += src/analysis/dialogs/ExpDecayDialog.cpp \ - src/analysis/dialogs/FFTDialog.cpp \ - src/analysis/dialogs/FitDialog.cpp \ - src/analysis/dialogs/FilterDialog.cpp \ - src/analysis/dialogs/FrequencyCountDialog.cpp \ - src/analysis/dialogs/IntDialog.cpp \ - src/analysis/dialogs/InterpolationDialog.cpp \ - src/analysis/dialogs/PolynomFitDialog.cpp \ - src/analysis/dialogs/SmoothCurveDialog.cpp \ === modified file 'qtiplot/src/analysis/dialogs/ExpDecayDialog.cpp' --- qtiplot/src/analysis/dialogs/ExpDecayDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/dialogs/ExpDecayDialog.cpp 2010-07-21 23:21:08 +0000 @@ -32,7 +32,8 @@ #include #include #include -#include +#include +#include #include #include @@ -47,6 +48,7 @@ setName( "ExpDecayDialog" ); setWindowTitle(tr("QtiPlot - Verify initial guesses")); setSizeGripEnabled( true ); + setAttribute(Qt::WA_DeleteOnClose); ApplicationWindow *app = (ApplicationWindow *)parent; int precision = app->fit_output_precision; @@ -123,8 +125,8 @@ gl1->addWidget(boxStart, 5, 1); gl1->addWidget(new QLabel(tr("Color")), 6, 0 ); - boxColor = new ColorBox(false); - boxColor->setColor(QColor(Qt::red)); + boxColor = new ColorButton(); + boxColor->setColor(Qt::red); gl1->addWidget(boxColor, 6, 1); gl1->setRowStretch(7, 1); @@ -156,25 +158,24 @@ if (!g) return; - fitter = 0; + fitter = 0; graph = g; boxName->addItems(graph->analysableCurvesList()); - QString selectedCurve = g->selectedCurveTitle(); - if (!selectedCurve.isEmpty()){ - int index = boxName->findText (selectedCurve); - boxName->setCurrentItem(index); - } - activateCurve(boxName->currentText()); - - connect (graph, SIGNAL(closedGraph()), this, SLOT(close())); - connect (graph, SIGNAL(dataRangeChanged()), this, SLOT(changeDataRange())); + QString selectedCurve = g->selectedCurveTitle(); + if (!selectedCurve.isEmpty()) + boxName->setCurrentIndex(boxName->findText (selectedCurve)); + + activateCurve(boxName->currentText()); + + connect (graph, SIGNAL(destroyed()), this, SLOT(close())); + connect (graph, SIGNAL(dataRangeChanged()), this, SLOT(changeDataRange())); } void ExpDecayDialog::activateCurve(const QString& curveName) { - QwtPlotCurve *c = graph->curve(curveName); + PlotCurve *c = graph->curve(curveName); if (!c) return; @@ -201,7 +202,7 @@ void ExpDecayDialog::fit() { QString curve = boxName->currentText(); - QwtPlotCurve *c = graph->curve(curve); + PlotCurve *c = graph->curve(curve); QStringList curvesList = graph->analysableCurvesList(); if (!c || !curvesList.contains(curve)){ QMessageBox::critical(this,tr("QtiPlot - Warning"), @@ -233,7 +234,7 @@ } if (fitter->setDataFromCurve(boxName->currentText(), boxStart->value(), c->maxXValue())){ - fitter->setColor(boxColor->currentItem()); + fitter->setColor(boxColor->color()); fitter->scaleErrors(app->fit_scale_errors); fitter->setOutputPrecision(app->fit_output_precision); fitter->generateFunction(app->generateUniformFitPoints, app->fitPoints); === modified file 'qtiplot/src/analysis/dialogs/ExpDecayDialog.h' --- qtiplot/src/analysis/dialogs/ExpDecayDialog.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/dialogs/ExpDecayDialog.h 2010-07-21 23:21:08 +0000 @@ -35,7 +35,7 @@ class QComboBox; class QLabel; class Graph; -class ColorBox; +class ColorButton; class Fit; class DoubleSpinBox; @@ -77,7 +77,7 @@ DoubleSpinBox* boxStart; DoubleSpinBox* boxYOffset; QLabel* thirdLabel, *dampingLabel; - ColorBox* boxColor; + ColorButton* boxColor; }; #endif === modified file 'qtiplot/src/analysis/dialogs/FFTDialog.cpp' --- qtiplot/src/analysis/dialogs/FFTDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/dialogs/FFTDialog.cpp 2010-07-21 23:21:08 +0000 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -52,6 +53,7 @@ { setWindowTitle(tr("QtiPlot - FFT Options")); setSizeGripEnabled( true ); + setAttribute(Qt::WA_DeleteOnClose); d_matrix = 0; d_table = 0; @@ -139,7 +141,7 @@ // signals and slots connections connect( buttonOK, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( close() ) ); } void FFTDialog::accept() @@ -173,6 +175,9 @@ void FFTDialog::setGraph(Graph *g) { + if (!g) + return; + graph = g; boxName->insertStringList (g->analysableCurvesList()); activateCurve(boxName->currentText()); @@ -181,7 +186,7 @@ void FFTDialog::activateCurve(const QString& curveName) { if (graph){ - QwtPlotCurve *c = graph->curve(curveName); + PlotCurve *c = graph->curve(curveName); if (!c) return; @@ -194,6 +199,9 @@ void FFTDialog::setTable(Table *t) { + if (!t) + return; + d_table = t; QStringList l = t->columnsList(); boxName->insertStringList (l); @@ -248,7 +256,7 @@ Matrix *mIm = app->matrix(boxImaginary->currentText()); if (!mIm) errors = true; - else if (mIm && mIm->numCols() != width || mIm->numRows() != height){ + else if (mIm && (mIm->numCols() != width || mIm->numRows() != height)){ errors = true; QMessageBox::warning(app, tr("QtiPlot"), tr("The two matrices have different dimensions, the imaginary part will be neglected!")); === modified file 'qtiplot/src/analysis/dialogs/FilterDialog.cpp' --- qtiplot/src/analysis/dialogs/FilterDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/dialogs/FilterDialog.cpp 2010-07-21 23:21:08 +0000 @@ -27,9 +27,9 @@ * * ***************************************************************************/ #include "FilterDialog.h" -#include "../FFTFilter.h" -#include "../../plot2D/Graph.h" -#include +#include "FFTFilter.h" +#include +#include #include #include @@ -46,6 +46,7 @@ setObjectName( "FilterDialog" ); setWindowTitle(tr("QtiPlot - Filter options")); setSizeGripEnabled( true ); + setAttribute(Qt::WA_DeleteOnClose); QGroupBox *gb1 = new QGroupBox(); QGridLayout *gl1 = new QGridLayout(gb1); @@ -68,8 +69,8 @@ boxStart->setMinimum(0.0); gl1->addWidget(boxStart, 1, 1); - boxColor = new ColorBox(false); - boxColor->setColor(QColor(Qt::red)); + boxColor = new ColorButton(); + boxColor->setColor(Qt::red); if (type >= FFTFilter::BandPass){ gl1->addWidget(new QLabel(tr("High Frequency (Hz)")), 2, 0); @@ -112,7 +113,7 @@ hb->addLayout(vl); connect( buttonFilter, SIGNAL( clicked() ), this, SLOT( filter() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( close() ) ); } void FilterDialog::filter() @@ -139,13 +140,15 @@ } else f->setCutoff(from); - f->setColor(boxColor->currentIndex()); + f->setColor(boxColor->color()); f->run(); delete f; } void FilterDialog::setGraph(Graph *g) { + if (!g) + return; graph = g; boxName->addItems (g->analysableCurvesList()); } === modified file 'qtiplot/src/analysis/dialogs/FilterDialog.h' --- qtiplot/src/analysis/dialogs/FilterDialog.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/dialogs/FilterDialog.h 2010-07-21 23:21:08 +0000 @@ -35,7 +35,7 @@ class QComboBox; class QCheckBox; class Graph; -class ColorBox; +class ColorButton; class DoubleSpinBox; //! Filter options dialog @@ -60,7 +60,7 @@ QCheckBox* boxOffset; DoubleSpinBox* boxStart; DoubleSpinBox* boxEnd; - ColorBox* boxColor; + ColorButton* boxColor; }; #endif === modified file 'qtiplot/src/analysis/dialogs/FitDialog.cpp' --- qtiplot/src/analysis/dialogs/FitDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/dialogs/FitDialog.cpp 2010-07-21 23:21:08 +0000 @@ -2,7 +2,7 @@ File : FitDialog.cpp Project : QtiPlot -------------------------------------------------------------------- - Copyright : (C) 2004-2007 by Ion Vasilief + Copyright : (C) 2004-2010 by Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : Fit Wizard @@ -37,10 +37,10 @@ #include #include #include -#include +#include #include #include -#include +#include #include #include @@ -66,29 +66,6 @@ using namespace std; -/* XPM */ -static const char * param_range_btn_xpm[] = { -"18 14 5 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #808000", -"# c #FFFF00", -"..+ ..+", -"..+ ..+", -"..+ @@+ @@+ ..+", -"..+ @#@+ @#@+ ..+", -"..+@##@+ @##@+..+", -"..@###@@@@@###@..+", -"..#############..+", -"..@###@@@@@###@..+", -"..+@##@+ @##@+..+", -"..++@#@+ @#@++..+", -"..+ +@@+ @@++ ..+", -"..+ +++ +++ ..+", -"..+ ..+", -"+++ +++"}; - FitDialog::FitDialog(Graph *g, QWidget* parent, Qt::WFlags fl ) : QDialog( parent, fl ) { @@ -168,10 +145,56 @@ hbox0->addWidget(lblFunction); - QGridLayout *gl1 = new QGridLayout(); + QGroupBox *gb1 = new QGroupBox(tr("Data Set")); + QGridLayout *gl1 = new QGridLayout(gb1); gl1->addWidget(new QLabel(tr("Curve")), 0, 0); boxCurve = new QComboBox(); gl1->addWidget(boxCurve, 0, 1); + gl1->setColumnStretch(1, 1); + + gl1->addWidget(new QLabel( tr("Color")), 1, 0); + boxColor = new ColorButton(); + boxColor->setColor(Qt::red); + gl1->addWidget(boxColor, 1, 1); + + gl1->addWidget(new QLabel(tr("From x=")), 0, 2); + + boxFrom = new DoubleSpinBox(); + boxFrom->setLocale(app->locale()); + boxFrom->setDecimals(app->d_decimal_digits); + connect(boxFrom, SIGNAL(valueChanged(double)), this, SLOT(updatePreview())); + gl1->addWidget(boxFrom, 0, 3); + + gl1->addWidget(new QLabel( tr("To x=")), 1, 2); + + boxTo = new DoubleSpinBox(); + boxTo->setLocale(app->locale()); + boxTo->setDecimals(app->d_decimal_digits); + connect(boxTo, SIGNAL(valueChanged(double)), this, SLOT(updatePreview())); + gl1->addWidget(boxTo, 1, 3); + gl1->setColumnStretch(3, 1); + + gl1->addWidget(new QLabel(tr("Weighting")), 2, 0); + boxWeighting = new QComboBox(); + boxWeighting->addItem(tr("No weighting")); + boxWeighting->addItem(tr("Instrumental")); + boxWeighting->addItem(tr("Statistical")); + boxWeighting->addItem(tr("Arbitrary Dataset")); + boxWeighting->addItem(tr("Direct Weighting")); + gl1->addWidget(boxWeighting, 2, 1); + gl1->addWidget(new QLabel(), 2, 2); + + QHBoxLayout *hbox2 = new QHBoxLayout(); + + tableNamesBox = new QComboBox(); + tableNamesBox->setVisible(false); + hbox2->addWidget(tableNamesBox); + + colNamesBox = new QComboBox(); + colNamesBox->setVisible(false); + hbox2->addWidget(colNamesBox); + + gl1->addLayout(hbox2, 2, 3); boxFunction = new QTextEdit(); boxFunction->setReadOnly(true); @@ -182,19 +205,31 @@ boxFunction->setMaximumHeight(50); QVBoxLayout *vb = new QVBoxLayout(); - vb->addWidget(new QLabel(tr("Initial guesses"))); btnSaveGuesses = new QPushButton(tr( "&Save" )); - btnSaveGuesses->setPixmap(QPixmap(filesave_xpm)); + btnSaveGuesses->setPixmap(QPixmap(":/filesave.png")); connect(btnSaveGuesses, SIGNAL(clicked()), this, SLOT(saveInitialGuesses())); vb->addWidget(btnSaveGuesses); - btnParamRange = new QPushButton(); - btnParamRange->setIcon(QIcon(QPixmap(param_range_btn_xpm))); + + btnLoadGuesses = new QPushButton(tr("Re&load" )); + btnLoadGuesses->setPixmap(QPixmap(":/reload.png")); + connect(btnLoadGuesses, SIGNAL(clicked()), this, SLOT(loadInitialGuesses())); + vb->addWidget(btnLoadGuesses); + + btnGuess = new QPushButton(tr( "&Guess" )); + btnGuess->setPixmap(QPixmap(":/help.png")); + connect(btnGuess, SIGNAL(clicked()), this, SLOT(guessInitialValues())); + vb->addWidget(btnGuess); + + btnParamRange = new QPushButton(tr("&Range" )); + btnParamRange->setIcon(QIcon(":/param_range_btn.png")); btnParamRange->setCheckable(true); connect(btnParamRange, SIGNAL(toggled(bool)), this, SLOT(showParameterRange(bool))); vb->addWidget(btnParamRange); vb->addStretch(); - gl1->addLayout(vb, 3, 0); + + QGroupBox *gb0 = new QGroupBox(tr("Initial guesses")); + QGridLayout *gl0 = new QGridLayout(gb0); boxParams = new QTableWidget(); boxParams->setColumnCount(6); @@ -212,89 +247,40 @@ boxParams->verticalHeader()->hide(); boxParams->hideColumn(1); boxParams->hideColumn(3); - gl1->addWidget(boxParams, 3, 1); - - gl1->addWidget(new QLabel( tr("Algorithm")), 4, 0 ); + + gl0->addWidget(boxParams, 0, 0); + gl0->addLayout(vb, 0, 1); + + QGroupBox *gb3 = new QGroupBox(tr("Algorithm")); + QGridLayout *gl3 = new QGridLayout(gb3); + boxAlgorithm = new QComboBox(); boxAlgorithm->addItem(tr("Scaled Levenberg-Marquardt")); boxAlgorithm->addItem(tr("Unscaled Levenberg-Marquardt")); boxAlgorithm->addItem(tr("Nelder-Mead Simplex")); - gl1->addWidget(boxAlgorithm, 4, 1); - - gl1->addWidget(new QLabel( tr("Color")), 5, 0); - boxColor = new ColorBox( false ); - boxColor->setColor(QColor(Qt::red)); - gl1->addWidget(boxColor, 5, 1); - - QGroupBox *gb1 = new QGroupBox(); - gb1->setLayout(gl1); - - QGridLayout *gl2 = new QGridLayout(); - gl2->addWidget(new QLabel(tr("From x=")), 0, 0); - - boxFrom = new DoubleSpinBox(); - boxFrom->setLocale(app->locale()); - boxFrom->setDecimals(app->d_decimal_digits); - connect(boxFrom, SIGNAL(valueChanged(double)), this, SLOT(updatePreview())); - gl2->addWidget(boxFrom, 0, 1); - - gl2->addWidget(new QLabel( tr("To x=")), 1, 0); - - boxTo = new DoubleSpinBox(); - boxTo->setLocale(app->locale()); - boxTo->setDecimals(app->d_decimal_digits); - connect(boxTo, SIGNAL(valueChanged(double)), this, SLOT(updatePreview())); - gl2->addWidget(boxTo, 1, 1); - - QGroupBox *gb2 = new QGroupBox(); - gb2->setLayout(gl2); - - QGridLayout *gl3 = new QGridLayout(); - gl3->addWidget(new QLabel(tr("Iterations")), 0, 0); + gl3->addWidget(boxAlgorithm, 0, 0); + + gl3->addWidget(new QLabel(tr("Iterations")), 0, 1); boxPoints = new QSpinBox(); boxPoints->setRange(10, 10000); boxPoints->setSingleStep(50); boxPoints->setValue(1000); - gl3->addWidget(boxPoints, 0, 1); - gl3->addWidget(new QLabel( tr("Tolerance")), 1, 0); + gl3->addWidget(boxPoints, 0, 2); + gl3->setColumnStretch(2, 1); + gl3->addWidget(new QLabel( tr("Tolerance")), 0, 3); boxTolerance = new DoubleSpinBox(); boxTolerance->setRange(0.0, 1.0); boxTolerance->setSingleStep(1e-4); boxTolerance->setLocale(app->locale()); boxTolerance->setDecimals(13); boxTolerance->setValue(1e-4); - gl3->addWidget(boxTolerance, 1, 1); - - QGroupBox *gb3 = new QGroupBox(); - gb3->setLayout(gl3); - - QHBoxLayout *hbox1 = new QHBoxLayout(); - hbox1->addWidget(gb2); - hbox1->addWidget(gb3); - - QHBoxLayout *hbox2 = new QHBoxLayout(); - hbox2->addWidget(new QLabel(tr( "Weighting Method" ))); - boxWeighting = new QComboBox(); - boxWeighting->addItem(tr("No weighting")); - boxWeighting->addItem(tr("Instrumental")); - boxWeighting->addItem(tr("Statistical")); - boxWeighting->addItem(tr("Arbitrary Dataset")); - boxWeighting->addItem(tr("Direct Weighting")); - hbox2->addWidget(boxWeighting); - QGroupBox *gb4 = new QGroupBox(); - gb4->setLayout(hbox2); - - tableNamesBox = new QComboBox(); - tableNamesBox->setEnabled(false); - hbox2->addWidget(tableNamesBox); - colNamesBox = new QComboBox(); - colNamesBox->setEnabled(false); - hbox2->addWidget(colNamesBox); + gl3->addWidget(boxTolerance, 0, 4); + gl3->setColumnStretch(4, 1); QHBoxLayout *hbox3 = new QHBoxLayout(); buttonCancel1 = new QPushButton(tr( "&Close" )); - buttonCancel1->setPixmap(QPixmap(delete_xpm)); + buttonCancel1->setPixmap(QPixmap(":/delete.png")); hbox3->addWidget(buttonCancel1); hbox3->addStretch(); previewBox = new QCheckBox(tr("&Preview")); @@ -304,9 +290,9 @@ btnDeleteFitCurves = new QPushButton(tr( "&Delete Fit Curves" )); hbox3->addWidget(btnDeleteFitCurves); - btnDeleteFitCurves->setPixmap(QPixmap(close_xpm)); + btnDeleteFitCurves->setPixmap(QPixmap(":/close.png")); buttonOk = new QPushButton(tr( "&Fit" ) ); - buttonOk->setPixmap(QPixmap(play_xpm)); + buttonOk->setPixmap(QPixmap(":/play.png")); buttonOk->setDefault( true ); hbox3->addWidget(buttonOk); @@ -328,7 +314,7 @@ frameLayout->addSpacing (space); buttonEdit = new QPushButton(); - buttonEdit->setIcon(QPixmap(prev_xpm)); + buttonEdit->setIcon(QIcon(":/prev.png")); buttonEdit->setToolTip(tr("Select Function")); QFrame *frame2 = new QFrame(); @@ -350,7 +336,7 @@ frameLayout->addSpacing (space); buttonAdvanced = new QPushButton(); - buttonAdvanced->setIcon(QPixmap(next_xpm)); + buttonAdvanced->setIcon(QIcon(":/next.png")); buttonAdvanced->setToolTip(tr("Custom Output")); QFrame *frame3 = new QFrame(); @@ -381,10 +367,9 @@ QVBoxLayout *vbox1 = new QVBoxLayout(); vbox1->addLayout(hbox0); vbox1->addWidget(boxFunction); - vbox1->addSpacing(20); + vbox1->addWidget(gb0); vbox1->addWidget(gb1); - vbox1->addLayout(hbox1); - vbox1->addWidget(gb4); + vbox1->addWidget(gb3); vbox1->addSpacing(10); vbox1->addLayout(hbox3); vbox1->addSpacing(10); @@ -412,7 +397,7 @@ connect( buttonAdvanced, SIGNAL(clicked()), this, SLOT(showAdvancedPage() ) ); connect( tableNamesBox, SIGNAL( activated(int) ), this, SLOT( selectSrcTable(int) ) ); - connect(boxColor, SIGNAL(activated(int)), this, SLOT(updatePreviewColor(int))); + connect(boxColor, SIGNAL(colorChanged(const QColor &)), this, SLOT(updatePreviewColor(const QColor &))); setFocusProxy(boxFunction); } @@ -474,6 +459,7 @@ hbox1->addWidget(polynomOrderBox); buttonPlugins = new QPushButton(tr( "Choose plug&ins folder..." ) ); + buttonPlugins->setIcon(QIcon(":/folder_open.png")); hbox1->addWidget(buttonPlugins); buttonPlugins->hide(); @@ -482,20 +468,21 @@ boxName = new QLineEdit(tr("user1")); gl2->addWidget(boxName, 0, 1); btnAddFunc = new QPushButton(tr( "&Save" )); + btnAddFunc->setPixmap(QPixmap(":/filesave.png")); gl2->addWidget(btnAddFunc, 0, 2); gl2->addWidget(new QLabel(tr("Parameters")), 1, 0); boxParam = new QLabel(); boxParam->setFrameStyle(QFrame::Box | QFrame::Sunken); gl2->addWidget(boxParam, 1, 1); btnDelFunc = new QPushButton( tr( "&Remove" )); + btnDelFunc->setPixmap(QPixmap(":/close.png")); gl2->addWidget(btnDelFunc, 1, 2); QGroupBox *gb = new QGroupBox(); gb->setLayout(gl2); - editBox = new QTextEdit(); - editBox->setTextFormat(Qt::PlainText); - editBox->setAcceptRichText(false); + editBox = new ScriptEdit(((ApplicationWindow *)parent())->scriptingEnv()); + editBox->enableShortcuts(); connect(editBox->document(), SIGNAL(contentsChange(int,int,int)), this, SLOT(guessParameters())); editBox->setFocus(); @@ -512,7 +499,7 @@ vbox1->addWidget(buttonClear); vbox1->addStretch(); buttonCancel2 = new QPushButton(tr( "&Close" )); - buttonCancel2->setPixmap(QPixmap(delete_xpm)); + buttonCancel2->setPixmap(QPixmap(":/delete.png")); vbox1->addWidget(buttonCancel2); QVBoxLayout *vb = new QVBoxLayout(); @@ -542,7 +529,7 @@ frameLayout->addSpacing (space); btnContinue = new QPushButton(); - btnContinue->setIcon(QPixmap(next_xpm)); + btnContinue->setIcon(QIcon(":/next.png")); btnContinue->setToolTip(tr("Start Fitting Session")); QFrame *frame2 = new QFrame(); @@ -602,7 +589,6 @@ connect( buttonCancel2, SIGNAL(clicked()), this, SLOT(close())); } - void FitDialog::initAdvancedPage() { ApplicationWindow *app = (ApplicationWindow *)this->parent(); @@ -696,7 +682,7 @@ QHBoxLayout *hbox1 = new QHBoxLayout(); buttonCancel3 = new QPushButton(tr( "&Close" )); - buttonCancel3->setPixmap(QPixmap(delete_xpm)); + buttonCancel3->setPixmap(QPixmap(":/delete.png")); hbox1->addWidget(buttonCancel3); hbox1->addStretch(); btnApply = new QPushButton(tr( "&Apply" )); @@ -737,7 +723,7 @@ btnBack = new QPushButton(); connect( btnBack, SIGNAL(clicked()), this, SLOT(returnToFitPage())); - btnBack->setIcon(QPixmap(prev_xpm)); + btnBack->setIcon(QIcon(":/prev.png")); btnBack->setToolTip(tr("Fitting Session")); QFrame *frame2 = new QFrame(); @@ -869,12 +855,11 @@ boxCurve->clear(); boxCurve->addItems(d_graph->analysableCurvesList()); - QString selectedCurve = g->selectedCurveTitle(); - if (!selectedCurve.isEmpty()){ - int index = boxCurve->findText (selectedCurve); - boxCurve->setCurrentItem(index); - } - activateCurve(boxCurve->currentText()); + QString selectedCurve = g->selectedCurveTitle(); + if (!selectedCurve.isEmpty()) + boxCurve->setCurrentIndex(boxCurve->findText (selectedCurve)); + + activateCurve(boxCurve->currentText()); connect (d_graph, SIGNAL(closedGraph()), this, SLOT(close())); connect (d_graph, SIGNAL(dataRangeChanged()), this, SLOT(changeDataRange())); @@ -942,7 +927,7 @@ QString filter = tr("QtiPlot fit model")+" (*.fit);;"; filter += tr("All files")+" (*.*)"; QString fn = ApplicationWindow::getFileName(app, tr("QtiPlot") + " - " + tr("Save Fit Model As"), - app->fitModelsPath + "/" + name, filter); + app->fitModelsPath + "/" + name, filter, 0, true, app->d_confirm_overwrite); if (!fn.isEmpty()){ QFileInfo fi(fn); app->fitModelsPath = fi.dir().absolutePath(); @@ -1031,11 +1016,13 @@ boxAlgorithm->setEnabled(false); boxPoints->setEnabled(false); boxTolerance->setEnabled(false); + btnGuess->setVisible(false); } else { btnParamRange->setEnabled(true); boxAlgorithm->setEnabled(true); boxPoints->setEnabled(true); boxTolerance->setEnabled(true); + btnGuess->setVisible(d_current_fit->type() == Fit::BuiltIn); } QStringList paramList = d_current_fit->parameterNames(); @@ -1111,7 +1098,7 @@ boxFunction->setText(formula); lblFunction->setText(boxName->text() +" (x, " + boxParam->text().simplified() + ")"); - tw->setCurrentWidget (fitPage); + tw->setCurrentWidget(fitPage); if (previewBox->isChecked()) updatePreview(); } @@ -1415,11 +1402,12 @@ QStringList parameters = QStringList(); MyParser parser; bool error = false; -#ifdef Q_CC_MSVC - QVarLengthArray paramsInit(n), paramRangeLeft(n), paramRangeRight(n); -#else - double paramsInit[n], paramRangeLeft[n], paramRangeRight[n]; -#endif + double *paramsInit = (double *)malloc(n*sizeof(double)); + double *paramRangeLeft = (double *)malloc(n*sizeof(double)); + double *paramRangeRight = (double *)malloc(n*sizeof(double)); + if (!paramsInit || !paramRangeLeft || !paramRangeRight) + return; + QString formula = boxFunction->text(); NonLinearFit *nlf = qobject_cast(d_current_fit); if (nlf) @@ -1469,22 +1457,14 @@ if (!error){ if (d_current_fit->type() == Fit::BuiltIn) -#ifdef Q_CC_MSVC - modifyGuesses (paramsInit.data()); -#else modifyGuesses (paramsInit); -#endif if (nlf){ if (!nlf->setParametersList(parameters)) return; if (!nlf->setFormula(formula, false)) return; } -#ifdef Q_CC_MSVC - d_current_fit->setInitialGuesses(paramsInit.data()); -#else d_current_fit->setInitialGuesses(paramsInit); -#endif if (!d_current_fit->setDataFromCurve(curve, start, end) || !d_current_fit->setWeightingData ((Fit::WeightingMethod)boxWeighting->currentIndex(), @@ -1498,7 +1478,7 @@ d_current_fit->setTolerance(eps); d_current_fit->setOutputPrecision(app->fit_output_precision); d_current_fit->setAlgorithm((Fit::Algorithm)boxAlgorithm->currentIndex()); - d_current_fit->setColor(boxColor->currentIndex()); + d_current_fit->setColor(boxColor->color()); d_current_fit->generateFunction(generatePointsBtn->isChecked(), generatePointsBox->value()); d_current_fit->setMaximumIterations(boxPoints->value()); if (!d_current_fit->isA("PolynomialFit") && !d_current_fit->isA("LinearFit") && !d_current_fit->isA("LinearSlopeFit")) @@ -1529,6 +1509,10 @@ if (previewBox->isChecked()) updatePreview(); + + free (paramsInit); + free (paramRangeLeft); + free (paramRangeRight); } } @@ -1583,13 +1567,10 @@ void FitDialog::enableWeightingParameters(int index) { - if (index == Fit::Dataset || index == Fit::Direct){ - tableNamesBox->setEnabled(true); - colNamesBox->setEnabled(true); - } else { - tableNamesBox->setEnabled(false); - colNamesBox->setEnabled(false); - } + bool on = (index == Fit::Dataset || index == Fit::Direct); + + tableNamesBox->setVisible(on); + colNamesBox->setVisible(on); } void FitDialog::closeEvent (QCloseEvent * e) @@ -1754,7 +1735,7 @@ QString filter = tr("QtiPlot fit model") + " (*.fit);;"; filter += tr("All files") + " (*.*)"; QString fn = ApplicationWindow::getFileName(app, tr("QtiPlot") + " - " + tr("Save Fit Model As"), - app->fitModelsPath + "/" + d_current_fit->objectName(), filter); + app->fitModelsPath + "/" + d_current_fit->objectName(), filter, 0, true, app->d_confirm_overwrite); if (!fn.isEmpty()){ QFileInfo fi(fn); QString baseName = fi.fileName(); @@ -1767,6 +1748,42 @@ } } +void FitDialog::loadInitialGuesses() +{ + if (!d_current_fit) + return; + if (!d_current_fit->load(d_current_fit->fileName())) + return; + + for (int i = 0; i < d_current_fit->numParameters(); i++){ + ((DoubleSpinBox*)boxParams->cellWidget(i, 2))->setValue(d_current_fit->initialGuess(i)); + boxParams->item(i, boxParams->columnCount() - 1)->setText("--"); + } + + if (previewBox->isChecked()) + updatePreview(); +} + +void FitDialog::guessInitialValues() +{ + if (!d_current_fit) + return; + + if (d_current_fit->type() == Fit::BuiltIn){ + d_current_fit->setDataFromCurve(boxCurve->currentText(), boxFrom->value(), boxTo->value()); + d_current_fit->guessInitialValues(); + //modifyGuesses (paramsInit); + } + + for (int i = 0; i < d_current_fit->numParameters(); i++){ + ((DoubleSpinBox*)boxParams->cellWidget(i, 2))->setValue(d_current_fit->initialGuess(i)); + boxParams->item(i, boxParams->columnCount() - 1)->setText("--"); + } + + if (previewBox->isChecked()) + updatePreview(); +} + QStringList FitDialog::plugInNames() { QStringList lst; @@ -1800,7 +1817,7 @@ d_preview_curve = new FunctionCurve(); d_preview_curve->attach(d_graph); d_preview_curve->setRenderHint(QwtPlotItem::RenderAntialiased, d_graph->antialiasing()); - d_preview_curve->setPen(QPen(ColorBox::color(boxColor->currentIndex()), 1)); + d_preview_curve->setPen(QPen(boxColor->color(), 1)); } bool changedVar = false; @@ -1844,12 +1861,12 @@ d_graph->replot(); } -void FitDialog::updatePreviewColor(int colorIndex) +void FitDialog::updatePreviewColor(const QColor &c) { if (!d_preview_curve) return; - d_preview_curve->setPen(QPen(ColorBox::color(colorIndex), 1)); + d_preview_curve->setPen(QPen(c, 1)); d_graph->replot(); } === modified file 'qtiplot/src/analysis/dialogs/FitDialog.h' --- qtiplot/src/analysis/dialogs/FitDialog.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/dialogs/FitDialog.h 2010-07-21 23:21:08 +0000 @@ -45,12 +45,13 @@ class QLabel; class QRadioButton; class QLineEdit; -class ColorBox; +class ColorButton; class Fit; class Table; class DoubleSpinBox; class FunctionCurve; class MdiSubWindow; +class ScriptEdit; //! Fit Wizard class FitDialog : public QDialog @@ -108,9 +109,11 @@ void enableApplyChanges(int = 0); void setNumPeaks(int peaks); void saveInitialGuesses(); + void loadInitialGuesses(); + void guessInitialValues(); void returnToFitPage(); void updatePreview(); - void updatePreviewColor(int); + void updatePreviewColor(const QColor &); void showPreview(bool on); void showParameterRange(bool); void guessParameters(); @@ -129,7 +132,7 @@ Fit *d_current_fit; Graph *d_graph; - Table *d_param_table; + QPointer
d_param_table; QList d_user_functions, d_built_in_functions, d_plugins; QList srcTables; FunctionCurve *d_preview_curve; @@ -144,7 +147,7 @@ QPushButton* buttonClear; QPushButton* buttonPlugins; QPushButton* btnBack; - QPushButton* btnSaveGuesses; + QPushButton* btnSaveGuesses, *btnLoadGuesses, *btnGuess; QComboBox* boxCurve; QComboBox* boxAlgorithm; QTableWidget* boxParams; @@ -153,14 +156,15 @@ DoubleSpinBox* boxTolerance; QSpinBox* boxPoints, *generatePointsBox, *boxPrecision, *polynomOrderBox; QWidget *fitPage, *editPage, *advancedPage; - QTextEdit *editBox, *explainBox, *boxFunction; + ScriptEdit *editBox; + QTextEdit *explainBox, *boxFunction; QListWidget *categoryBox, *funcBox; QLineEdit *boxName; QLabel *boxErrorMsg, *boxParam; QLabel *lblFunction, *lblPoints, *polynomOrderLabel; QPushButton *btnAddFunc, *btnDelFunc, *btnContinue, *btnApply; QPushButton *buttonEdit, *btnAddTxt, *btnAddName, *btnDeleteFitCurves; - ColorBox* boxColor; + ColorButton* boxColor; QComboBox *boxWeighting, *tableNamesBox, *colNamesBox; QRadioButton *generatePointsBtn, *samePointsBtn; QPushButton *btnParamTable, *btnCovMatrix, *btnParamRange; === modified file 'qtiplot/src/analysis/dialogs/FrequencyCountDialog.cpp' --- qtiplot/src/analysis/dialogs/FrequencyCountDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/dialogs/FrequencyCountDialog.cpp 2010-07-21 23:21:08 +0000 @@ -154,7 +154,7 @@ hb->addLayout(vl); connect( buttonApply, SIGNAL( clicked() ), this, SLOT( apply() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( close() ) ); connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); } === modified file 'qtiplot/src/analysis/dialogs/IntDialog.cpp' --- qtiplot/src/analysis/dialogs/IntDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/dialogs/IntDialog.cpp 2010-07-21 23:21:08 +0000 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -45,19 +46,19 @@ : QDialog( parent, fl), d_graph(g) { - setName( "IntegrationDialog" ); + setName( "IntegrationDialog" ); setAttribute(Qt::WA_DeleteOnClose); setWindowTitle(tr("QtiPlot - Integration Options")); setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); - QGroupBox *gb1 = new QGroupBox(); - QGridLayout *gl1 = new QGridLayout(gb1); + QGroupBox *gb1 = new QGroupBox(); + QGridLayout *gl1 = new QGridLayout(gb1); gl1->addWidget(new QLabel(tr("Function")), 0, 0); - boxName = new QTextEdit(); - boxName->setMaximumHeight(60); + boxName = new ScriptEdit(((ApplicationWindow *)parent)->scriptingEnv()); + boxName->enableShortcuts(); gl1->addWidget(boxName, 0, 1); - gl1->addWidget(new QLabel(tr("Variable")), 1, 0); + gl1->addWidget(new QLabel(tr("Variable")), 1, 0); boxVariable = new QLineEdit(); boxVariable->setText("x"); gl1->addWidget(boxVariable, 1, 1); @@ -93,38 +94,37 @@ boxEnd->setValue(1.0); gl1->addWidget(boxEnd, 6, 1); - boxPlot = new QCheckBox(tr("&Plot area")); + boxPlot = new QCheckBox(tr("&Plot area")); boxPlot->setChecked(true); - gl1->addWidget(boxPlot, 7, 1); - gl1->setRowStretch(8, 1); + gl1->addWidget(boxPlot, 7, 1); + gl1->setRowStretch(0, 1); buttonOk = new QPushButton(tr( "&Integrate" )); - buttonOk->setDefault( true ); - buttonCancel = new QPushButton(tr("&Close" )); + buttonOk->setDefault( true ); + buttonCancel = new QPushButton(tr("&Close" )); QVBoxLayout *vl = new QVBoxLayout(); - vl->addWidget(buttonOk); + vl->addWidget(buttonOk); vl->addWidget(buttonCancel); - vl->addStretch(); - - QHBoxLayout *hb = new QHBoxLayout(this); - hb->addWidget(gb1); - hb->addLayout(vl); - - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + vl->addStretch(); + + QHBoxLayout *hb = new QHBoxLayout(this); + hb->addWidget(gb1); + hb->addLayout(vl); + + connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); + connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); } void IntDialog::accept() { - QString formula = boxName->text().remove("\n"); - Integration *i = new Integration(formula, boxVariable->text(), - (ApplicationWindow *)this->parent(), d_graph, boxStart->value(), boxEnd->value()); + Integration *i = new Integration(boxName->text().simplified(), boxVariable->text(), + (ApplicationWindow *)this->parent(), d_graph, boxStart->value(), boxEnd->value()); i->setTolerance(boxTol->text().toDouble()); i->setMaximumIterations(boxSteps->value()); i->setMethodOrder(boxOrder->value()); if (d_graph && boxPlot->isChecked()) - i->enableGraphicsDisplay(true, d_graph); - i->run(); - delete i; + i->enableGraphicsDisplay(true, d_graph); + i->run(); + delete i; } === modified file 'qtiplot/src/analysis/dialogs/IntDialog.h' --- qtiplot/src/analysis/dialogs/IntDialog.h 2008-06-12 08:57:17 +0000 +++ qtiplot/src/analysis/dialogs/IntDialog.h 2010-07-21 23:21:08 +0000 @@ -34,7 +34,7 @@ class QPushButton; class QCheckBox; class QLineEdit; -class QTextEdit; +class ScriptEdit; class QSpinBox; class DoubleSpinBox; class Graph; @@ -56,7 +56,7 @@ QPushButton* buttonOk; QPushButton* buttonCancel; QCheckBox* boxPlot; - QTextEdit* boxName; + ScriptEdit* boxName; QLineEdit* boxVariable; QSpinBox* boxOrder; QSpinBox* boxSteps; === modified file 'qtiplot/src/analysis/dialogs/InterpolationDialog.cpp' --- qtiplot/src/analysis/dialogs/InterpolationDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/dialogs/InterpolationDialog.cpp 2010-07-21 23:21:08 +0000 @@ -27,9 +27,9 @@ * * ***************************************************************************/ #include "InterpolationDialog.h" -#include "../Interpolation.h" -#include "../../plot2D/Graph.h" -#include +#include +#include +#include #include #include @@ -64,7 +64,7 @@ gl1->addWidget(new QLabel(tr("Points")), 2, 0); boxPoints = new QSpinBox(); - boxPoints->setRange(3,100000); + boxPoints->setRange(3, 100000); boxPoints->setSingleStep(10); boxPoints->setValue(1000); gl1->addWidget(boxPoints, 2, 1); @@ -85,8 +85,8 @@ gl1->addWidget(new QLabel(tr("Color")), 5, 0); - boxColor = new ColorBox(false); - boxColor->setColor(QColor(Qt::red)); + boxColor = new ColorButton(); + boxColor->setColor(Qt::red); gl1->addWidget(boxColor, 5, 1); gl1->setRowStretch(6, 1); gl1->setColumnStretch(1, 1); @@ -106,7 +106,7 @@ connect( boxName, SIGNAL(activated(const QString&)), this, SLOT( activateCurve(const QString&))); connect( buttonFit, SIGNAL( clicked() ), this, SLOT( interpolate() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( close() ) ); } void InterpolationDialog::interpolate() @@ -129,35 +129,34 @@ return; } - Interpolation *i = new Interpolation((ApplicationWindow *)this->parent(), graph, curve, - from, to, boxMethod->currentIndex()); + Interpolation *i = new Interpolation((ApplicationWindow *)this->parent(), graph, curve, from, to, boxMethod->currentIndex()); i->setOutputPoints(boxPoints->value()); - i->setColor(boxColor->currentIndex()); + i->setColor(boxColor->color()); i->run(); delete i; } void InterpolationDialog::setGraph(Graph *g) { + if (!g) + return; + graph = g; boxName->addItems(g->analysableCurvesList()); - QString selectedCurve = g->selectedCurveTitle(); + QString selectedCurve = g->selectedCurveTitle(); if (!selectedCurve.isEmpty()) - { - int index = boxName->findText (selectedCurve); - boxName->setCurrentItem(index); - } - - activateCurve(boxName->currentText()); - - connect (graph, SIGNAL(closedGraph()), this, SLOT(close())); + boxName->setCurrentIndex(boxName->findText(selectedCurve)); + + activateCurve(boxName->currentText()); + + connect (graph, SIGNAL(destroyed()), this, SLOT(close())); connect (graph, SIGNAL(dataRangeChanged()), this, SLOT(changeDataRange())); }; void InterpolationDialog::activateCurve(const QString& curveName) { - QwtPlotCurve *c = graph->curve(curveName); + PlotCurve *c = graph->curve(curveName); if (!c) return; === modified file 'qtiplot/src/analysis/dialogs/InterpolationDialog.h' --- qtiplot/src/analysis/dialogs/InterpolationDialog.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/dialogs/InterpolationDialog.h 2010-07-21 23:21:08 +0000 @@ -35,7 +35,7 @@ class QComboBox; class QSpinBox; class Graph; -class ColorBox; +class ColorButton; class DoubleSpinBox; //! Interpolation options dialog @@ -61,7 +61,7 @@ QSpinBox* boxPoints; DoubleSpinBox* boxStart; DoubleSpinBox* boxEnd; - ColorBox* boxColor; + ColorButton* boxColor; }; #endif === modified file 'qtiplot/src/analysis/dialogs/PolynomFitDialog.cpp' --- qtiplot/src/analysis/dialogs/PolynomFitDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/dialogs/PolynomFitDialog.cpp 2010-07-21 23:21:08 +0000 @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include @@ -85,8 +85,8 @@ gl1->addWidget(boxEnd, 4, 1); gl1->addWidget(new QLabel( tr("Color")), 5, 0); - boxColor = new ColorBox( false); - boxColor->setColor(QColor(Qt::red)); + boxColor = new ColorButton(); + boxColor->setColor(Qt::red); gl1->addWidget(boxColor, 5, 1); boxShowFormula = new QCheckBox(tr( "Show Formula on Graph?" )); @@ -110,7 +110,7 @@ hlayout->addLayout(vl); connect( buttonFit, SIGNAL( clicked() ), this, SLOT( fit() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( close() ) ); connect( boxName, SIGNAL( activated(const QString&) ), this, SLOT(activateCurve(const QString&))); } @@ -130,7 +130,7 @@ ApplicationWindow *app = (ApplicationWindow *)this->parent(); PolynomialFit *fitter = new PolynomialFit(app, graph, boxOrder->value(), boxShowFormula->isChecked()); if (fitter->setDataFromCurve(curveName, boxStart->value(), boxEnd->value())){ - fitter->setColor(boxColor->currentItem()); + fitter->setColor(boxColor->color()); fitter->setOutputPrecision(app->fit_output_precision); fitter->generateFunction(app->generateUniformFitPoints, app->fitPoints); fitter->fit(); @@ -140,17 +140,19 @@ void PolynomFitDialog::setGraph(Graph *g) { + if (!g) + return; + graph = g; boxName->addItems (g->analysableCurvesList()); QString selectedCurve = g->selectedCurveTitle(); - if (!selectedCurve.isEmpty()){ - int index = boxName->findText (selectedCurve); - boxName->setCurrentItem(index); - } - activateCurve(boxName->currentText()); - - connect (graph, SIGNAL(closedGraph()), this, SLOT(close())); + if (!selectedCurve.isEmpty()) + boxName->setCurrentIndex(boxName->findText (selectedCurve)); + + activateCurve(boxName->currentText()); + + connect (graph, SIGNAL(destroyed()), this, SLOT(close())); connect (graph, SIGNAL(dataRangeChanged()), this, SLOT(changeDataRange())); }; === modified file 'qtiplot/src/analysis/dialogs/PolynomFitDialog.h' --- qtiplot/src/analysis/dialogs/PolynomFitDialog.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/dialogs/PolynomFitDialog.h 2010-07-21 23:21:08 +0000 @@ -36,7 +36,7 @@ class QPushButton; class QComboBox; class Graph; -class ColorBox; +class ColorButton; class DoubleSpinBox; //! Fit polynomial dialog @@ -64,7 +64,7 @@ QSpinBox* boxPoints; DoubleSpinBox* boxStart; DoubleSpinBox* boxEnd; - ColorBox* boxColor; + ColorButton* boxColor; }; #endif === modified file 'qtiplot/src/analysis/dialogs/SmoothCurveDialog.cpp' --- qtiplot/src/analysis/dialogs/SmoothCurveDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/dialogs/SmoothCurveDialog.cpp 2010-07-21 23:21:08 +0000 @@ -28,10 +28,11 @@ * * ***************************************************************************/ #include "SmoothCurveDialog.h" -#include "../SmoothFilter.h" +#include "SmoothFilter.h" #include +#include #include -#include +#include #include #include @@ -49,6 +50,7 @@ setObjectName( "SmoothCurveDialog" ); setWindowTitle(tr("QtiPlot - Smoothing Options")); setSizeGripEnabled( true ); + setAttribute(Qt::WA_DeleteOnClose); QGroupBox *gb1 = new QGroupBox(); QGridLayout *gl1 = new QGridLayout(gb1); @@ -57,8 +59,8 @@ boxName = new QComboBox(); gl1->addWidget(boxName, 0, 1); - boxColor = new ColorBox(); - boxColor->setColor(QColor(Qt::red)); + boxColor = new ColorButton(); + boxColor->setColor(Qt::red); if (method == SmoothFilter::SavitzkyGolay) { @@ -84,8 +86,7 @@ gl1->addWidget(boxColor, 4, 1); gl1->setRowStretch(5, 1); } - else - if (method == SmoothFilter::Lowess) + else if (method == SmoothFilter::Lowess) { gl1->addWidget(new QLabel(tr("f")), 1, 0); boxF = new QDoubleSpinBox(); @@ -133,7 +134,7 @@ hb->addLayout(vl); connect( btnSmooth, SIGNAL(clicked()), this, SLOT( smooth())); - connect( buttonCancel, SIGNAL(clicked()), this, SLOT( reject())); + connect( buttonCancel, SIGNAL(clicked()), this, SLOT( close())); connect( boxName, SIGNAL(activated(const QString&)), this, SLOT(activateCurve(const QString&))); } @@ -154,26 +155,28 @@ else sf->setSmoothPoints(boxPointsLeft->value()); - sf->setColor(boxColor->currentIndex()); - sf->run(); - delete sf; + sf->setColor(boxColor->color()); + sf->run(); + delete sf; } void SmoothCurveDialog::setGraph(Graph *g) { - graph = g; - boxName->addItems (g->analysableCurvesList()); - activateCurve(boxName->currentText()); + if (!g) + return; + + graph = g; + boxName->addItems (g->analysableCurvesList()); + activateCurve(boxName->currentText()); } void SmoothCurveDialog::activateCurve(const QString& curveName) { - if (smooth_method == SmoothFilter::Average) - { - QwtPlotCurve *c = graph->curve(curveName); - if (!c || c->rtti() != QwtPlotItem::Rtti_PlotCurve) - return; + if (smooth_method == SmoothFilter::Average){ + PlotCurve *c = graph->curve(curveName); + if (!c || c->rtti() != QwtPlotItem::Rtti_PlotCurve) + return; - boxPointsLeft->setMaxValue(c->dataSize()/2); + boxPointsLeft->setMaxValue(c->dataSize()/2); } } === modified file 'qtiplot/src/analysis/dialogs/SmoothCurveDialog.h' --- qtiplot/src/analysis/dialogs/SmoothCurveDialog.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/dialogs/SmoothCurveDialog.h 2010-07-21 23:21:08 +0000 @@ -36,15 +36,15 @@ class QSpinBox; class QDoubleSpinBox; class Graph; -class ColorBox; +class ColorButton; //! Smoothing options dialog class SmoothCurveDialog : public QDialog { - Q_OBJECT + Q_OBJECT public: - SmoothCurveDialog(int method, QWidget* parent = 0, Qt::WFlags fl = 0 ); + SmoothCurveDialog(int method, QWidget* parent = 0, Qt::WFlags fl = 0 ); public slots: void setGraph(Graph *g); @@ -58,8 +58,8 @@ QPushButton* buttonCancel; QComboBox* boxName; QSpinBox *boxPointsLeft, *boxPointsRight, *boxOrder; - QDoubleSpinBox *boxF; - ColorBox* boxColor; + QDoubleSpinBox *boxF; + ColorButton* boxColor; }; #endif === added file 'qtiplot/src/analysis/dialogs/SubtractDataDialog.cpp' --- qtiplot/src/analysis/dialogs/SubtractDataDialog.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/analysis/dialogs/SubtractDataDialog.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,337 @@ +/*************************************************************************** + File : SubtractDataDialog.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2010 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Subtract reference data dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +SubtractDataDialog::SubtractDataDialog( QWidget* parent, Qt::WFlags fl ) + : QDialog( parent, fl ) +{ + setObjectName( "SubtractDataDialog" ); + setWindowTitle(tr("QtiPlot") + " - " + tr("Math on Data Sets")); + setAttribute(Qt::WA_DeleteOnClose); + setSizeGripEnabled( true ); + + QGroupBox *gb1 = new QGroupBox(); + QGridLayout *gl1 = new QGridLayout(gb1); + QLabel *l1 = new QLabel(tr("Cu&rve")); + gl1->addWidget(l1, 0, 0); + + boxInputName = new QComboBox(); + l1->setBuddy(boxInputName); + gl1->addWidget(boxInputName, 0, 1); + + QLabel *l2 = new QLabel(tr("&Operator")); + gl1->addWidget(l2, 1, 0); + + boxOperation = new QComboBox(); + boxOperation->addItems(QStringList() << "+" << "-" << "/" << "*"); + boxOperation->setCurrentIndex(1); + l2->setBuddy(boxOperation); + gl1->addWidget(boxOperation, 1, 1); + + btnDataset = new QRadioButton(tr("&Data set")); + btnDataset->setChecked(true); + gl1->addWidget(btnDataset, 2, 0); + + boxReferenceName = new QComboBox(); + gl1->addWidget(boxReferenceName, 2, 1); + + boxColumnName = new QComboBox(); + gl1->addWidget(boxColumnName, 2, 2); + + boxCurrentFolder = new QCheckBox(tr("Current &folder")); + gl1->addWidget(boxCurrentFolder, 3, 1); + + ApplicationWindow *app = (ApplicationWindow *)parent; + boxReferenceName->addItems(app->tableNames()); + updateTableColumns(0); + + btnValue = new QRadioButton(tr("&Value")); + gl1->addWidget(btnValue, 4, 0); + + boxOffset = new DoubleSpinBox(); + boxOffset->setDecimals(app->d_decimal_digits); + boxOffset->setLocale(app->locale()); + boxOffset->setEnabled(false); + gl1->addWidget(boxOffset, 4, 1); + gl1->setRowStretch(5, 1); + + buttonApply = new QPushButton(tr( "&Apply" )); + buttonApply->setDefault( true ); + buttonCancel = new QPushButton(tr( "&Close" )); + + QVBoxLayout *vl = new QVBoxLayout(); + vl->addWidget(buttonApply); + vl->addWidget(buttonCancel); + vl->addStretch(); + + QHBoxLayout *hb = new QHBoxLayout(this); + hb->addWidget(gb1, 1); + hb->addLayout(vl); + + connect( btnDataset, SIGNAL( toggled(bool) ), boxOffset, SLOT( setDisabled(bool) ) ); + connect( btnDataset, SIGNAL( toggled(bool) ), boxReferenceName, SLOT( setEnabled(bool) ) ); + connect( btnDataset, SIGNAL( toggled(bool) ), boxColumnName, SLOT( setEnabled(bool) ) ); + connect( btnDataset, SIGNAL( toggled(bool) ), boxCurrentFolder, SLOT( setEnabled(bool) ) ); + + connect( btnValue, SIGNAL( toggled(bool) ), boxOffset, SLOT( setEnabled(bool) ) ); + connect( btnValue, SIGNAL( toggled(bool) ), boxReferenceName, SLOT( setDisabled(bool) ) ); + connect( btnValue, SIGNAL( toggled(bool) ), boxColumnName, SLOT( setDisabled(bool) ) ); + connect( btnValue, SIGNAL( toggled(bool) ), boxCurrentFolder, SLOT( setDisabled(bool) ) ); + + connect( boxCurrentFolder, SIGNAL( toggled(bool) ), this, SLOT( setCurrentFolder(bool) ) ); + connect( boxReferenceName, SIGNAL( activated(int) ), this, SLOT( updateTableColumns(int) ) ); + connect( buttonApply, SIGNAL( clicked() ), this, SLOT( interpolate() ) ); + connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( close() ) ); +} + +void SubtractDataDialog::setCurrentFolder(bool on) +{ + ApplicationWindow *app = (ApplicationWindow *)parent(); + if (!app) + return; + + boxReferenceName->clear(); + if (on){ + Folder *f = app->currentFolder(); + if (f){ + QStringList tables; + foreach (MdiSubWindow *w, f->windowsList()){ + if (w->inherits("Table")) + tables << w->objectName(); + } + boxReferenceName->addItems(tables); + } + } else + boxReferenceName->addItems(app->tableNames()); + + updateTableColumns(0); +} + +void SubtractDataDialog::updateTableColumns(int tabnr) +{ + boxColumnName->clear(); + + ApplicationWindow *app = (ApplicationWindow *)parent(); + if (!app) + return; + + Table *t = app->table(boxReferenceName->itemText(tabnr)); + if (!t) + return; + + QStringList columns; + for (int i = 0; i < t->numCols(); i++){ + if (t->colPlotDesignation(i) != Table::X) + columns << t->colLabel(i); + } + boxColumnName->addItems(columns); +} + +double SubtractDataDialog::combineValues(double v1, double v2) +{ + double res = v1; + switch(boxOperation->currentIndex()){ + case 0: + res += v2; + break; + case 1: + res -= v2; + break; + case 2: + res /= v2; + break; + case 3: + res *= v2; + break; + } + return res; +} + +void SubtractDataDialog::interpolate() +{ + if (!graph) + return; + + int index = graph->curveIndex(boxInputName->currentText()); + DataCurve *c = graph->dataCurve(index); + if (!c) + return; + + ApplicationWindow *app = (ApplicationWindow *)parent(); + if (!app) + return; + + Table *inputTable = c->table(); + if (!inputTable) + return; + + int inputPoints = inputTable->numRows(); + QString xColName = c->xColumnName(); + int xCol = inputTable->colIndex(xColName); + int yCol = inputTable->colIndex(c->title().text()); + if (btnValue->isChecked()){ + double offset = boxOffset->value(); + for (int i = 0; i < inputPoints; i++){ + if (!inputTable->text(i, yCol).isEmpty() && !inputTable->text(i, xCol).isEmpty()) + inputTable->setCell(i, yCol, combineValues(inputTable->cell(i, yCol), offset)); + } + inputTable->notifyChanges(c->title().text()); + return; + } + + Table *refTable = app->table(boxReferenceName->currentText()); + if (!refTable) + return; + + int refCol = refTable->colIndex(boxColumnName->currentText()); + if (refCol < 0) + return; + + int refXCol = refTable->colX(refCol); + if (refTable == inputTable && refXCol == xCol){//same X column + for (int i = 0; i < inputPoints; i++){ + if (!inputTable->text(i, yCol).isEmpty() && !inputTable->text(i, xCol).isEmpty()) + inputTable->setCell(i, yCol, combineValues(inputTable->cell(i, yCol), refTable->cell(i, refCol))); + } + inputTable->notifyChanges(c->title().text()); + return; + } + + int refPoints = refTable->numRows(); + int aux = 0; + for (int i = 0; i < refPoints; i++){//count valid reference data set points + if (!refTable->text(i, refXCol).isEmpty() && !refTable->text(i, refCol).isEmpty()) + aux++; + } + refPoints = aux; + if (refPoints < 2){ + QMessageBox::critical(app, tr("QtiPlot") + " - " + tr("Error"), + tr("Data set %1 must containt at least two valid data points in order to perform this operation!").arg(refTable->objectName() + "_" + boxColumnName->currentText())); + return; + } + + double *x = (double *)malloc(refPoints*sizeof(double)); + if (!x) + return; + + double *y = (double *)malloc(refPoints*sizeof(double)); + if (!y){ + free (x); + return; + } + + aux = 0; + for (int i = 0; i < refTable->numRows(); i++){ + if (!refTable->text(i, refXCol).isEmpty() && !refTable->text(i, refCol).isEmpty()){ + x[aux] = refTable->cell(i, refXCol); + y[aux] = refTable->cell(i, refCol); + aux++; + } + } + + //sort data with respect to x value + size_t *p = (size_t *)malloc(refPoints*sizeof(size_t)); + if (!p){ + free(x); free(y); + return; + } + + gsl_sort_index(p, x, 1, refPoints); + + double *xtemp = (double *)malloc(refPoints*sizeof(double)); + if (!xtemp){ + free(x); free(y); free(p); + return; + } + + double *ytemp = (double *)malloc(refPoints*sizeof(double)); + if (!ytemp){ + free(x); free(y); free(p); free(xtemp); + return; + } + + for (int i = 0; i < refPoints; i++){ + xtemp[i] = x[p[i]]; + ytemp[i] = y[p[i]]; + } + free(x); + free(y); + free(p); + + //make linear interpolation on sorted data + gsl_interp_accel *acc = gsl_interp_accel_alloc(); + gsl_spline *interp = gsl_spline_alloc(gsl_interp_linear, refPoints); + gsl_spline_init (interp, xtemp, ytemp, refPoints); + + for (int i = 0; i < inputPoints; i++){ + if (!inputTable->text(i, yCol).isEmpty() && !inputTable->text(i, xCol).isEmpty()) + inputTable->setCell(i, yCol, combineValues(inputTable->cell(i, yCol), gsl_spline_eval(interp, inputTable->cell(i, xCol), acc))); + } + inputTable->notifyChanges(c->title().text()); + + gsl_spline_free (interp); + gsl_interp_accel_free (acc); + free(xtemp); + free(ytemp); +} + +void SubtractDataDialog::setGraph(Graph *g) +{ + if (!g) + return; + + graph = g; + boxInputName->addItems(g->analysableCurvesList()); + + QString selectedCurve = g->selectedCurveTitle(); + if (!selectedCurve.isEmpty()) + boxInputName->setCurrentIndex(boxInputName->findText(selectedCurve)); + + connect (graph, SIGNAL(destroyed()), this, SLOT(close())); +} === added file 'qtiplot/src/analysis/dialogs/SubtractDataDialog.h' --- qtiplot/src/analysis/dialogs/SubtractDataDialog.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/analysis/dialogs/SubtractDataDialog.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,73 @@ +/*************************************************************************** + File : SubtractDataDialog.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2010 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Subtract reference data dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef SUBTRACT_DATA_DIALOG_H +#define SUBTRACT_DATA_DIALOG_H + +#include + +class QPushButton; +class QRadioButton; +class QComboBox; +class QCheckBox; +class QSpinBox; +class Graph; +class ColorButton; +class DoubleSpinBox; + +//! Subtract reference data dialog +class SubtractDataDialog : public QDialog +{ + Q_OBJECT + +public: + SubtractDataDialog( QWidget* parent = 0, Qt::WFlags fl = 0 ); + void setGraph(Graph *g); + +private slots: + void interpolate(); + void updateTableColumns(int tabnr); + void setCurrentFolder(bool); + +private: + double combineValues(double v1, double v2); + + Graph *graph; + QPushButton* buttonApply; + QPushButton* buttonCancel; + QComboBox* boxInputName; + QComboBox* boxReferenceName; + QComboBox* boxColumnName; + QComboBox* boxOperation; + QRadioButton *btnDataset; + QRadioButton *btnValue; + QCheckBox *boxCurrentFolder; + DoubleSpinBox* boxOffset; +}; + +#endif === modified file 'qtiplot/src/analysis/fit_gsl.cpp' --- qtiplot/src/analysis/fit_gsl.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/fit_gsl.cpp 2010-07-21 23:21:08 +0000 @@ -1,3 +1,35 @@ +/*************************************************************************** + File : fit_gsl.cpp + Project : QtiPlot + Description : Built-in data fit models for QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2004-2010 Ion Vasilief (ion_vasilief*yahoo.fr) + (replace * with @ in the email address) + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * As a special exception, you may omit the above copyright notice when * + * distributing modified copies of this file (for instance, when using it * + * as a template for your own fit plugin). * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + #include "fit_gsl.h" #include #include "NonLinearFit.h" === modified file 'qtiplot/src/analysis/fit_gsl.h' --- qtiplot/src/analysis/fit_gsl.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/analysis/fit_gsl.h 2010-07-21 23:21:08 +0000 @@ -1,3 +1,35 @@ +/*************************************************************************** + File : fit_gsl.h + Project : QtiPlot + Description : Built-in data fit models for QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2004-2010 Ion Vasilief (ion_vasilief*yahoo.fr) + (replace * with @ in the email address) + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * As a special exception, you may omit the above copyright notice when * + * distributing modified copies of this file (for instance, when using it * + * as a template for your own fit plugin). * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + #ifndef FIT_GSL_H #define FIT_GSL_H === modified file 'qtiplot/src/analysis/nrutil.cpp' --- qtiplot/src/analysis/nrutil.cpp 2008-06-12 08:57:17 +0000 +++ qtiplot/src/analysis/nrutil.cpp 2010-07-21 23:21:08 +0000 @@ -67,20 +67,6 @@ free((FREE_ARG) (v+nl-NR_END)); } -size_t *ivector(long nl, long nh) -{ -size_t *v; -v=(size_t *)malloc((size_t) ((nh-nl+1+NR_END)*sizeof(size_t))); -if (!v) nrerror("allocation failure in ivector()"); -return v-nl+NR_END; -} - -void free_ivector(size_t *v, long nl, long nh) -{ -(void)nh; -free((FREE_ARG) (v+nl-NR_END)); -} - int *intvector(long nl, long nh) { int *v; === modified file 'qtiplot/src/analysis/nrutil.h' --- qtiplot/src/analysis/nrutil.h 2008-06-12 08:57:17 +0000 +++ qtiplot/src/analysis/nrutil.h 2010-07-21 23:21:08 +0000 @@ -10,8 +10,6 @@ void free_matrix(double **m, long nrl, long nrh, long ncl, long nch); double *vector(long nl, long nh); void free_vector(double *v, long nl, long nh); -size_t *ivector(long nl, long nh); -void free_ivector(size_t *v, long nl, long nh); int *intvector(long nl, long nh); void free_intvector(int*v, long nl, long nh); === added directory 'qtiplot/src/core' === removed directory 'qtiplot/src/core' === added file 'qtiplot/src/core/ApplicationWindow.cpp' --- qtiplot/src/core/ApplicationWindow.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/ApplicationWindow.cpp 2010-07-21 23:41:23 +0000 @@ -0,0 +1,18381 @@ +/*************************************************************************** + File : ApplicationWindow.cpp + Project : QtiPlot +-------------------------------------------------------------------- + Copyright : (C) 2004 - 2010 by Ion Vasilief, + (C) 2006 - June 2007 Tilman Hoener zu Siederdissen, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : QtiPlot's main window + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "globals.h" +#include "ApplicationWindow.h" +#include + +#include "PlotWizard.h" +#include "ConfigDialog.h" +#include "RenameWindowDialog.h" +#include "ImportASCIIDialog.h" +#include "Folder.h" +#include "FindDialog.h" +#include "OpenProjectDialog.h" +#include "CustomActionDialog.h" +#include "MdiSubWindow.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// TODO: move tool-specific code to an extension manager +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +using namespace std; + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#ifdef XLS_IMPORT +extern "C" { + #include +} +#endif + +#ifdef ODS_IMPORT + #include + #include + #include + #include +#endif + +#ifdef OPJ_IMPORT + #include "importOPJ.h" +#endif + +using namespace Qwt3D; + +extern "C" +{ +void file_compress(char *file, char *mode); +void file_uncompress(char *file); +} + +ApplicationWindow::ApplicationWindow(bool factorySettings) +: QMainWindow(), scripted(ScriptingLangManager::newEnv(this)) +{ + setAttribute(Qt::WA_DeleteOnClose); + init(factorySettings); + ((QtiPlotApplication *)QCoreApplication::instance ())->append(this); +} + +void ApplicationWindow::init(bool factorySettings) +{ + setWindowTitle(tr("QtiPlot - untitled")); + setObjectName(tr("QtiPlot")); + initGlobalConstants(); + QPixmapCache::setCacheLimit(20*QPixmapCache::cacheLimit ()); + + tablesDepend = new QMenu(this); + + explorerWindow = new QDockWidget( this ); + explorerWindow->setWindowTitle(tr("Project Explorer")); + explorerWindow->setObjectName("explorerWindow"); // this is needed for QMainWindow::restoreState() + explorerWindow->setMinimumHeight(150); + addDockWidget( Qt::BottomDockWidgetArea, explorerWindow ); + + actionSaveProject = NULL; + folders = new FolderListView(this); + folders->header()->setClickEnabled( false ); + folders->addColumn( tr("Folder") ); + folders->setRootIsDecorated( true ); + folders->setResizeMode(Q3ListView::LastColumn); + folders->header()->hide(); + folders->setSelectionMode(Q3ListView::Single); + + connect(folders, SIGNAL(currentChanged(Q3ListViewItem *)), + this, SLOT(folderItemChanged(Q3ListViewItem *))); + connect(folders, SIGNAL(itemRenamed(Q3ListViewItem *, int, const QString &)), + this, SLOT(renameFolder(Q3ListViewItem *, int, const QString &))); + connect(folders, SIGNAL(contextMenuRequested(Q3ListViewItem *, const QPoint &, int)), + this, SLOT(showFolderPopupMenu(Q3ListViewItem *, const QPoint &, int))); + connect(folders, SIGNAL(dragItems(QList)), + this, SLOT(dragFolderItems(QList))); + connect(folders, SIGNAL(dropItems(Q3ListViewItem *)), + this, SLOT(dropFolderItems(Q3ListViewItem *))); + connect(folders, SIGNAL(renameItem(Q3ListViewItem *)), + this, SLOT(startRenameFolder(Q3ListViewItem *))); + connect(folders, SIGNAL(addFolderItem()), this, SLOT(addFolder())); + connect(folders, SIGNAL(deleteSelection()), this, SLOT(deleteSelectedItems())); + + current_folder = new Folder( 0, tr("UNTITLED")); + FolderListItem *fli = new FolderListItem(folders, current_folder); + current_folder->setFolderListItem(fli); + fli->setOpen( true ); + + lv = new FolderListView(); + lv->addColumn (tr("Name"),-1 ); + lv->addColumn (tr("Type"),-1 ); + lv->addColumn (tr("View"),-1 ); + lv->addColumn (tr("Size"),-1 ); + lv->addColumn (tr("Created"),-1); + lv->addColumn (tr("Label"),-1); + lv->setResizeMode(Q3ListView::LastColumn); + lv->setMinimumHeight(80); + lv->setSelectionMode(Q3ListView::Extended); + lv->setDefaultRenameAction (Q3ListView::Accept); + + explorerSplitter = new QSplitter(Qt::Horizontal, explorerWindow); + explorerSplitter->addWidget(folders); + explorerSplitter->addWidget(lv); + explorerWindow->setWidget(explorerSplitter); + + QList splitterSizes; + explorerSplitter->setSizes( splitterSizes << 45 << 45); + explorerWindow->hide(); + + logWindow = new QDockWidget(this); + logWindow->setObjectName("logWindow"); // this is needed for QMainWindow::restoreState() + logWindow->setWindowTitle(tr("Results Log")); + addDockWidget( Qt::TopDockWidgetArea, logWindow ); + + results=new QTextEdit(logWindow); + results->setReadOnly (true); + + logWindow->setWidget(results); + logWindow->hide(); + +#ifdef SCRIPTING_CONSOLE + consoleWindow = new QDockWidget(this); + consoleWindow->setObjectName("consoleWindow"); // this is needed for QMainWindow::restoreState() + consoleWindow->setWindowTitle(tr("Scripting Console")); + addDockWidget( Qt::TopDockWidgetArea, consoleWindow ); + console = new QTextEdit(consoleWindow); + console->setReadOnly(true); + consoleWindow->setWidget(console); + consoleWindow->hide(); +#endif + + undoStackWindow = new QDockWidget(this); + undoStackWindow->setObjectName("undoStackWindow"); // this is needed for QMainWindow::restoreState() + undoStackWindow->setWindowTitle(tr("Undo Stack")); + addDockWidget(Qt::RightDockWidgetArea, undoStackWindow); + + d_undo_view = new QUndoView(undoStackWindow); + d_undo_view->setCleanIcon(QIcon(":/filesave.png")); + undoStackWindow->setWidget(d_undo_view); + undoStackWindow->hide(); + + // Needs to be done after initialization of dock windows, + // because we now use QDockWidget::toggleViewAction() + createActions(); + initToolBars(); + initMainMenu(); + + d_workspace = new QMdiArea(); + d_workspace->setOption(QMdiArea::DontMaximizeSubWindowOnActivation); + d_workspace->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); + d_workspace->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); + d_workspace->setActivationOrder(QMdiArea::ActivationHistoryOrder); + setCentralWidget(d_workspace); + + setAcceptDrops(true); + + hiddenWindows = new QList(); + + scriptWindow = 0; + d_text_editor = NULL; + + renamedTables = QStringList(); + if (!factorySettings) + readSettings(); + createLanguagesList(); + insertTranslatedStrings(); + disableToolbars(); + + assistant = new QAssistantClient( QString(), this ); + + actionNextWindow = new QAction(QIcon(":/next.png"), tr("&Next","next window"), this); + actionNextWindow->setShortcut( tr("F5","next window shortcut") ); + connect(actionNextWindow, SIGNAL(activated()), d_workspace, SLOT(activateNextSubWindow())); + + actionPrevWindow = new QAction(QIcon(":/prev.png"), tr("&Previous","previous window"), this); + actionPrevWindow->setShortcut( tr("F6","previous window shortcut") ); + connect(actionPrevWindow, SIGNAL(activated()), d_workspace, SLOT(activatePreviousSubWindow())); + + connect(tablesDepend, SIGNAL(activated(int)), this, SLOT(showTable(int))); + + connect(this, SIGNAL(modified()),this, SLOT(modifiedProject())); + connect(d_workspace, SIGNAL(subWindowActivated(QMdiSubWindow *)), + this, SLOT(windowActivated(QMdiSubWindow*))); + connect(lv, SIGNAL(doubleClicked(Q3ListViewItem *)), + this, SLOT(maximizeWindow(Q3ListViewItem *))); + connect(lv, SIGNAL(doubleClicked(Q3ListViewItem *)), + this, SLOT(folderItemDoubleClicked(Q3ListViewItem *))); + connect(lv, SIGNAL(contextMenuRequested(Q3ListViewItem *, const QPoint &, int)), + this, SLOT(showWindowPopupMenu(Q3ListViewItem *, const QPoint &, int))); + connect(lv, SIGNAL(dragItems(QList)), + this, SLOT(dragFolderItems(QList))); + connect(lv, SIGNAL(dropItems(Q3ListViewItem *)), + this, SLOT(dropFolderItems(Q3ListViewItem *))); + connect(lv, SIGNAL(renameItem(Q3ListViewItem *)), + this, SLOT(startRenameFolder(Q3ListViewItem *))); + connect(lv, SIGNAL(addFolderItem()), this, SLOT(addFolder())); + connect(lv, SIGNAL(deleteSelection()), this, SLOT(deleteSelectedItems())); + connect(lv, SIGNAL(itemRenamed(Q3ListViewItem *, int, const QString &)), + this, SLOT(renameWindow(Q3ListViewItem *, int, const QString &))); + + connect(scriptEnv, SIGNAL(error(const QString&,const QString&,int)), + this, SLOT(scriptError(const QString&,const QString&,int))); + connect(scriptEnv, SIGNAL(print(const QString&)), this, SLOT(scriptPrint(const QString&))); + + connect(recent, SIGNAL(activated(int)), this, SLOT(openRecentProject(int))); + connect(explorerWindow, SIGNAL(dockLocationChanged (Qt::DockWidgetArea)), this, SLOT(updateExplorerWindowLayout(Qt::DockWidgetArea))); + + // this has to be done after connecting scriptEnv + scriptEnv->initialize(); + + //apply user settings + updateAppFonts(); + setScriptingLanguage(defaultScriptingLang); + setAppColors(workspaceColor, panelsColor, panelsTextColor, true); + + loadCustomActions(); + initCompleter(); +} + +void ApplicationWindow::updateExplorerWindowLayout(Qt::DockWidgetArea area) +{ + switch(area){ + case Qt::LeftDockWidgetArea: + case Qt::RightDockWidgetArea: + explorerSplitter->setOrientation(Qt::Vertical); + break; + + case Qt::TopDockWidgetArea: + case Qt::BottomDockWidgetArea: + case Qt::NoDockWidgetArea: + explorerSplitter->setOrientation(Qt::Horizontal); + break; + + default: + break; + } +} + +void ApplicationWindow::initWindow() +{ + switch(d_init_window_type){ + case TableWindow: + newTable(); + break; + case MatrixWindow: + newMatrix(); + break; + case MultiLayerWindow: + newGraph(); + break; + case NoteWindow: + newNote(); + break; + default: + break; + } + savedProject(); +} + +void ApplicationWindow::initGlobalConstants() +{ + d_indexed_colors = ColorBox::defaultColors(); + d_indexed_color_names = ColorBox::defaultColorNames(); + + d_symbols_list = SymbolBox::defaultSymbols(); + + d_latex_compiler = MathTran; + d_latex_compiler_path = QString::null; + d_mdi_windows_area = true; + d_open_project_filter = QString::null;//tr("QtiPlot project") + " (*.qti)"; + + d_comment_highlight_color = Qt::red; + d_class_highlight_color = Qt::darkMagenta; + d_numeric_highlight_color = Qt::darkGreen; + d_keyword_highlight_color = Qt::darkBlue; + d_function_highlight_color = Qt::blue; + d_quotation_highlight_color = Qt::darkYellow; + + d_notes_tab_length = 20; + d_completer = NULL; + d_completion = true; + d_note_line_numbers = true; + + d_auto_update_table_values = true; + d_active_window = NULL; + d_matrix_undo_stack_size = 10; + + d_opening_file = false; + d_is_appending_file = false; + d_in_place_editing = true; + + d_matrix_tool_bar = true; + d_file_tool_bar = true; + d_table_tool_bar = true; + d_column_tool_bar = true; + d_edit_tool_bar = true; + d_notes_tool_bar = true; + d_plot_tool_bar = true; + d_plot3D_tool_bar = true; + d_display_tool_bar = false; + d_format_tool_bar = true; + + appStyle = qApp->style()->objectName(); + d_app_rect = QRect(); + projectname = "untitled"; + lastCopiedLayer = 0; + d_enrichement_copy = NULL; + d_arrow_copy = NULL; + + savingTimerId = 0; + + autoSearchUpdatesRequest = false; + + show_windows_policy = ActiveFolder; + d_script_win_on_top = false; + d_script_win_rect = QRect(0, 0, 500, 300); + d_init_window_type = TableWindow; + + QString aux = qApp->applicationDirPath(); + workingDir = aux; + +#ifdef TRANSLATIONS_PATH + d_translations_folder = TRANSLATIONS_PATH; +#else + d_translations_folder = aux + "/translations"; +#endif + +#ifdef MANUAL_PATH + helpFilePath = MANUAL_PATH; + helpFilePath += "/index.html"; +#else + helpFilePath = aux + "/manual/index.html"; +#endif + +#ifdef PYTHON_CONFIG_PATH + d_python_config_folder = PYTHON_CONFIG_PATH; +#else + d_python_config_folder = aux; +#endif + + fitPluginsPath = aux + "fitPlugins"; + fitModelsPath = QString::null; + templatesDir = aux; + asciiDirPath = aux; + imagesDirPath = aux; + scriptsDirPath = aux; + customActionsDirPath = QString::null; + + appFont = QFont(); + d_notes_font = appFont; + + QString family = appFont.family(); + int pointSize = appFont.pointSize(); + tableTextFont = appFont; + tableHeaderFont = appFont; + plotAxesFont = QFont(family, pointSize, QFont::Bold, false); + plotNumbersFont = QFont(family, pointSize ); + plotLegendFont = appFont; + plotTitleFont = QFont(family, pointSize + 2, QFont::Bold,false); + + autoSearchUpdates = false; + appLanguage = QLocale::system().name().section('_',0,0); + show_windows_policy = ApplicationWindow::ActiveFolder; + + workspaceColor = QColor("darkGray"); + panelsColor = QColor("#ffffff"); + panelsTextColor = QColor("#000000"); + tableBkgdColor = QColor("#ffffff"); + tableTextColor = QColor("#000000"); + tableHeaderColor = QColor("#000000"); + + d_graph_background_color = Qt::white; + d_graph_canvas_color = Qt::white; + d_graph_border_color = Qt::black; + d_graph_background_opacity = 255; + d_graph_canvas_opacity = 255; + d_graph_border_width = 0; + d_graph_tick_labels_dist = 4; + d_graph_axes_labels_dist = 2; + + autoSave = true; + autoSaveTime = 15; + d_backup_files = true; + + defaultScriptingLang = "muParser"; +/*#ifdef SCRIPTING_PYTHON + defaultScriptingLang = "Python"; +#endif*/ + + d_decimal_digits = 13; + d_muparser_c_locale = true; + + d_extended_open_dialog = true; + d_extended_export_dialog = true; + d_extended_import_ASCII_dialog = true; + d_extended_plot_dialog = true; + + d_add_curves_dialog_size = QSize(700, 400); + d_show_current_folder = false; + + d_confirm_overwrite = true; + confirmCloseFolder = true; + confirmCloseTable = true; + confirmCloseMatrix = true; + confirmClosePlot2D = true; + confirmClosePlot3D = true; + confirmCloseNotes = true; + d_inform_rename_table = true; + + d_show_table_comments = false; + + titleOn = true; + d_show_axes = QVector (QwtPlot::axisCnt, true); + d_show_axes_labels = QVector (QwtPlot::axisCnt, true); + canvasFrameWidth = 0; + d_canvas_frame_color = Qt::black; + defaultPlotMargin = 0; + drawBackbones = true; + axesLineWidth = 1; + autoscale2DPlots = true; + autoScaleFonts = true; + autoResizeLayers = true; + antialiasing2DPlots = false; + d_scale_plots_on_print = false; + d_print_cropmarks = false; + d_graph_legend_display = Graph::ColumnName; + d_graph_axis_labeling = Graph::Default; + d_synchronize_graph_scales = true; + d_print_paper_size = QPrinter::A4; + d_printer_orientation = QPrinter::Landscape; + defaultCurveStyle = int(Graph::LineSymbols); + defaultCurveLineWidth = 1; + d_curve_line_style = 0;//Qt::SolidLine; + defaultCurveBrush = 0; + defaultCurveAlpha = 255; + defaultSymbolSize = 7; + defaultSymbolEdge = 1.0; + d_fill_symbols = true; + d_symbol_style = 0; + d_indexed_symbols = true; + d_keep_aspect_ration = true; + + majTicksStyle = int(ScaleDraw::Out); + minTicksStyle = int(ScaleDraw::Out); + minTicksLength = 5; + majTicksLength = 9; + + legendFrameStyle = int(LegendWidget::Line); + d_frame_widget_pen = QPen(Qt::black, 1, Qt::SolidLine); + legendTextColor = Qt::black; + legendBackground = Qt::white; + legendBackground.setAlpha(0); // transparent by default; + d_legend_default_angle = 0; + d_frame_geometry_unit = (int)FrameWidget::Scale; + d_layer_geometry_unit = (int)FrameWidget::Pixel; + d_layer_canvas_width = 400; + d_layer_canvas_height = 300; + + d_rect_default_background = Qt::white; + d_rect_default_brush = QBrush(Qt::white); + + defaultArrowLineWidth = 1; + defaultArrowColor = Qt::black; + defaultArrowHeadLength = 4; + defaultArrowHeadAngle = 45; + defaultArrowHeadFill = true; + defaultArrowLineStyle = Graph::getPenStyle("SolidLine"); + + d_3D_legend = true; + d_3D_projection = NOFLOOR; + d_3D_smooth_mesh = true; + d_3D_resolution = 1; + d_3D_orthogonal = false; + d_3D_autoscale = true; + d_3D_axes_font = QFont(family, pointSize, QFont::Normal, false); + d_3D_numbers_font = QFont(family, pointSize); + d_3D_title_font = QFont(family, pointSize + 2, QFont::Normal, false); + d_3D_color_map = QwtLinearColorMap(Qt::blue, Qt::red); + d_3D_mesh_color = Qt::black; + d_3D_axes_color = Qt::black; + d_3D_numbers_color = Qt::black; + d_3D_labels_color = Qt::black; + d_3D_background_color = Qt::white; + d_3D_grid_color = Qt::blue; + d_3D_minor_grid_color = Qt::lightGray; + d_3D_minor_grids = true; + d_3D_major_grids = true; + d_3D_major_style = Qwt3D::SOLID; + d_3D_minor_style = Qwt3D::DASH; + d_3D_major_width = 1.0; + d_3D_minor_width = 0.8; + + fit_output_precision = 13; + pasteFitResultsToPlot = false; + writeFitResultsToLog = true; + generateUniformFitPoints = true; + fitPoints = 100; + generatePeakCurves = true; + peakCurvesColor = Qt::green; + fit_scale_errors = true; + d_2_linear_fit_points = true; + d_multi_peak_messages = true; + + columnSeparator = "\t"; + ignoredLines = 0; + renameColumns = true; + strip_spaces = false; + simplify_spaces = false; + d_ASCII_file_filter = "*"; + d_ASCII_import_locale = QLocale::system().name(); + d_ASCII_import_mode = int(ImportASCIIDialog::NewTables); + d_ASCII_import_first_row_role = 0;//column names + d_ASCII_comment_string = "#"; + d_ASCII_import_comments = false; + d_ASCII_import_read_only = false; + d_ASCII_import_preview = true; + d_preview_lines = 100; + d_import_ASCII_dialog_size = QSize(); + d_ASCII_end_line = LF; + d_eol = LF; +#ifdef Q_OS_MAC + d_ASCII_end_line = CR; + d_eol = CR; +#endif + + d_export_col_separator = "\t"; + d_export_col_names = false; + d_export_col_comment = false; + d_export_table_selection = false; + d_export_ASCII_file_filter = ".dat"; + + d_scale_fonts_factor = 0.0; + d_image_export_filter = ".png"; + d_export_transparency = false; + d_export_quality = 100; + d_export_raster_size = QSizeF(); + d_export_size_unit = FrameWidget::Pixel; + d_export_vector_resolution = QWidget().logicalDpiX(); + d_export_bitmap_resolution = d_export_vector_resolution; + d_export_color = true; + d_export_escape_tex_strings = true; + d_export_tex_font_sizes = true; + d_3D_export_text_mode = 0; //VectorWriter::PIXEL + d_3D_export_sort = 1; //VectorWriter::SIMPLESORT +} + +void ApplicationWindow::initToolBars() +{ + initPlot3DToolBar(); + + setWindowIcon(QIcon(":/logo.png")); + QPixmap openIcon, saveIcon; + + fileTools = new QToolBar(tr( "File" ), this); + fileTools->setObjectName("fileTools"); // this is needed for QMainWindow::restoreState() + fileTools->setIconSize( QSize(18,20) ); + addToolBar( Qt::TopToolBarArea, fileTools ); + + fileTools->addAction(actionNewProject); + fileTools->addAction(actionNewFolder); + fileTools->addAction(actionNewTable); + fileTools->addAction(actionNewMatrix); + fileTools->addAction(actionNewNote); + fileTools->addAction(actionNewGraph); + fileTools->addAction(actionNewFunctionPlot); + fileTools->addAction(actionNewSurfacePlot); + fileTools->addSeparator (); + fileTools->addAction(actionOpen); + fileTools->addAction(actionOpenTemplate); +#ifdef XLS_IMPORT + fileTools->addAction(actionOpenExcel); +#endif +#ifdef ODS_IMPORT + fileTools->addAction(actionOpenOds); +#endif + fileTools->addAction(actionAppendProject); + fileTools->addAction(actionSaveProject); + fileTools->addAction(actionSaveTemplate); + fileTools->addSeparator (); + fileTools->addAction(actionLoad); + fileTools->addSeparator (); + fileTools->addAction(actionCopyWindow); + fileTools->addAction(actionPrint); + fileTools->addAction(actionPrintPreview); + fileTools->addAction(actionExportPDF); + fileTools->addSeparator(); + fileTools->addAction(actionShowExplorer); + fileTools->addAction(actionShowLog); +#ifdef SCRIPTING_PYTHON + fileTools->addAction(actionShowScriptWindow); +#endif + + editTools = new QToolBar(tr("Edit"), this); + editTools->setObjectName("editTools"); // this is needed for QMainWindow::restoreState() + editTools->setIconSize( QSize(18,20) ); + addToolBar( editTools ); + + editTools->addAction(actionUndo); + editTools->addAction(actionRedo); + editTools->addAction(actionCutSelection); + editTools->addAction(actionCopySelection); + editTools->addAction(actionPasteSelection); + editTools->addAction(actionClearSelection); + + noteTools = new QToolBar(tr("Notes"), this); + noteTools->setObjectName("noteTools"); // this is needed for QMainWindow::restoreState() + noteTools->setIconSize( QSize(18,20) ); +#ifdef SCRIPTING_PYTHON + noteTools->addAction(actionNoteExecuteAll); + noteTools->addAction(actionNoteExecute); + noteTools->addAction(actionCommentSelection); + noteTools->addAction(actionUncommentSelection); +#endif + noteTools->addAction(actionDecreaseIndent); + noteTools->addAction(actionIncreaseIndent); + noteTools->addAction(actionFind); + noteTools->addAction(actionFindPrev); + noteTools->addAction(actionFindNext); + noteTools->addAction(actionReplace); + addToolBar( noteTools ); + + plotTools = new QToolBar(tr("Plot"), this); + plotTools->setObjectName("plotTools"); // this is needed for QMainWindow::restoreState() + plotTools->setIconSize( QSize(16,20) ); + addToolBar( plotTools ); + + plotTools->addAction(actionAddLayer); + plotTools->addAction(actionAddInsetLayer); + plotTools->addAction(actionAddInsetCurveLayer); + plotTools->addSeparator(); + plotTools->addAction(actionShowLayerDialog); + plotTools->addAction(actionAutomaticLayout); + plotTools->addSeparator(); + plotTools->addAction(actionExtractLayers); + plotTools->addAction(actionExtractGraphs); + plotTools->addSeparator(); + plotTools->addAction(actionAddErrorBars); + plotTools->addAction(actionShowCurvesDialog); + plotTools->addAction(actionAddFunctionCurve); + plotTools->addAction(actionNewLegend); + plotTools->addSeparator (); + plotTools->addAction(actionUnzoom); + + dataTools = new QActionGroup( this ); + dataTools->setExclusive( true ); + + btnPointer = new QAction(tr("Disable &Tools"), this); + btnPointer->setActionGroup(dataTools); + btnPointer->setCheckable( true ); + btnPointer->setIcon(QIcon(":/pointer.png")); + btnPointer->setChecked(true); + plotTools->addAction(btnPointer); + + actionMagnify->setActionGroup(dataTools); + actionMagnify->setCheckable( true ); + + actionMagnifyHor->setActionGroup(dataTools); + actionMagnifyHor->setCheckable( true ); + + actionMagnifyVert->setActionGroup(dataTools); + actionMagnifyVert->setCheckable( true ); + + btnZoomIn = new QAction(tr("&Zoom In"), this); + btnZoomIn->setShortcut( tr("Ctrl++") ); + btnZoomIn->setActionGroup(dataTools); + btnZoomIn->setCheckable( true ); + btnZoomIn->setIcon(QIcon(":/zoom.png")); + + btnZoomOut = new QAction(tr("&Zoom Out"), this); + btnZoomOut->setShortcut( tr("Ctrl+-") ); + btnZoomOut->setActionGroup(dataTools); + btnZoomOut->setCheckable( true ); + btnZoomOut->setIcon(QIcon(":/zoomOut.png")); + + QMenu *menu_zoom = new QMenu(this); + menu_zoom->addAction(actionMagnify); + menu_zoom->addAction(actionMagnifyHor); + menu_zoom->addAction(actionMagnifyVert); + menu_zoom->addAction(btnZoomIn); + menu_zoom->addAction(btnZoomOut); + + QToolButton *btn_zoom = new QToolButton(this); + btn_zoom->setMenu(menu_zoom); + btn_zoom->setPopupMode(QToolButton::MenuButtonPopup); + btn_zoom->setDefaultAction(actionMagnify); + connect(menu_zoom, SIGNAL(triggered(QAction *)), btn_zoom, SLOT(setDefaultAction(QAction *))); + + plotTools->addWidget(btn_zoom); + + btnCursor = new QAction(tr("&Data Reader"), this); + btnCursor->setShortcut( tr("CTRL+D") ); + btnCursor->setActionGroup(dataTools); + btnCursor->setCheckable( true ); + btnCursor->setIcon(QIcon(":/select.png")); + plotTools->addAction(btnCursor); + + btnSelect = new QAction(tr("&Select Data Range"), this); + btnSelect->setShortcut( tr("ALT+S") ); + btnSelect->setActionGroup(dataTools); + btnSelect->setCheckable( true ); + btnSelect->setIcon(QIcon(":/cursors.png")); + plotTools->addAction(btnSelect); + + btnPicker = new QAction(tr("S&creen Reader"), this); + btnPicker->setActionGroup(dataTools); + btnPicker->setCheckable( true ); + btnPicker->setIcon(QIcon(":/cursor_16.png")); + plotTools->addAction(btnPicker); + + actionDrawPoints = new QAction(tr("&Draw Data Points"), this); + actionDrawPoints->setActionGroup(dataTools); + actionDrawPoints->setCheckable( true ); + actionDrawPoints->setIcon(QIcon(":/draw_points.png")); + plotTools->addAction(actionDrawPoints); + + btnMovePoints = new QAction(tr("&Move Data Points..."), this); + btnMovePoints->setShortcut( tr("Ctrl+ALT+M") ); + btnMovePoints->setActionGroup(dataTools); + btnMovePoints->setCheckable( true ); + btnMovePoints->setIcon(QIcon(":/hand.png")); + plotTools->addAction(btnMovePoints); + + btnRemovePoints = new QAction(tr("Remove &Bad Data Points..."), this); + btnRemovePoints->setShortcut( tr("Alt+B") ); + btnRemovePoints->setActionGroup(dataTools); + btnRemovePoints->setCheckable( true ); + btnRemovePoints->setIcon(QIcon(":/delete.png")); + plotTools->addAction(btnRemovePoints); + + actionDragCurve = new QAction(tr("Dra&g Curve"), this); + actionDragCurve->setActionGroup(dataTools); + actionDragCurve->setCheckable( true ); + actionDragCurve->setIcon(QIcon(":/drag_curve.png")); + plotTools->addAction(actionDragCurve); + + connect( dataTools, SIGNAL( triggered( QAction* ) ), this, SLOT( pickDataTool( QAction* ) ) ); + plotTools->addSeparator (); + + actionAddFormula = new QAction(tr("Add E&quation"), this); + actionAddFormula->setShortcut( tr("ALT+Q") ); + actionAddFormula->setCheckable(true); + actionAddFormula->setIcon(QIcon(":/equation.png")); + connect(actionAddFormula, SIGNAL(triggered()), this, SLOT(addTexFormula())); + plotTools->addAction(actionAddFormula); + + actionAddText = new QAction(tr("Add &Text"), this); + actionAddText->setShortcut( tr("ALT+T") ); + actionAddText->setIcon(QIcon(":/text.png")); + actionAddText->setCheckable(true); + connect(actionAddText, SIGNAL(triggered()), this, SLOT(addText())); + plotTools->addAction(actionAddText); + + btnArrow = new QAction(tr("Draw &Arrow"), this); + btnArrow->setShortcut( tr("CTRL+ALT+A") ); + btnArrow->setActionGroup(dataTools); + btnArrow->setCheckable( true ); + btnArrow->setIcon(QIcon(":/arrow.png")); + plotTools->addAction(btnArrow); + + btnLine = new QAction(tr("Draw &Line"), this); + btnLine->setShortcut( tr("CTRL+ALT+L") ); + btnLine->setActionGroup(dataTools); + btnLine->setCheckable( true ); + btnLine->setIcon(QIcon(":/lPlot.png")); + plotTools->addAction(btnLine); + + QPixmap pix = QPixmap(16, 16); + pix.fill(Qt::transparent); + QPainter p; + p.begin(&pix); + p.setBrush(Qt::lightGray); + p.drawRect(QRect(1, 2, 12, 10)); + + actionAddRectangle = new QAction(tr("Add &Rectangle"), this); + actionAddRectangle->setShortcut( tr("CTRL+ALT+R") ); + actionAddRectangle->setCheckable(true); + actionAddRectangle->setIcon(QIcon(pix)); + connect(actionAddRectangle, SIGNAL(triggered()), this, SLOT(addRectangle())); + plotTools->addAction(actionAddRectangle); + + pix.fill(Qt::transparent); + p.drawEllipse(QRect(0, 2, 15, 12)); + p.end(); + + actionAddEllipse = new QAction(tr("Add &Ellipse"), this); + actionAddEllipse->setShortcut( tr("CTRL+ALT+E") ); + actionAddEllipse->setCheckable(true); + actionAddEllipse->setIcon(QIcon(pix)); + connect(actionAddEllipse, SIGNAL(triggered()), this, SLOT(addEllipse())); + plotTools->addAction(actionAddEllipse); + + plotTools->addAction(actionTimeStamp); + plotTools->addAction(actionAddImage); + plotTools->hide(); + + tableTools = new QToolBar(tr("Table"), this); + tableTools->setObjectName("tableTools"); // this is needed for QMainWindow::restoreState() + tableTools->setIconSize( QSize(16, 20)); + addToolBar(Qt::TopToolBarArea, tableTools); + + QMenu *menuPlotLine = new QMenu(this); + menuPlotLine->addAction(actionPlotL); + menuPlotLine->addAction(actionPlotHorSteps); + menuPlotLine->addAction(actionPlotVertSteps); + + QToolButton *btnPlotLine = new QToolButton(this); + btnPlotLine->setMenu(menuPlotLine); + btnPlotLine->setPopupMode(QToolButton::MenuButtonPopup); + btnPlotLine->setDefaultAction(actionPlotL); + connect(menuPlotLine, SIGNAL(triggered(QAction *)), btnPlotLine, SLOT(setDefaultAction(QAction *))); + tableTools->addWidget(btnPlotLine); + + QMenu *menuPlotScatter = new QMenu(this); + menuPlotScatter->addAction(actionPlotP); + menuPlotScatter->addAction(actionPlotVerticalDropLines); + + QToolButton *btnPlotScatter = new QToolButton(this); + btnPlotScatter->setMenu(menuPlotScatter); + btnPlotScatter->setPopupMode(QToolButton::MenuButtonPopup); + btnPlotScatter->setDefaultAction(actionPlotP); + connect(menuPlotScatter, SIGNAL(triggered(QAction *)), btnPlotScatter, SLOT(setDefaultAction(QAction *))); + tableTools->addWidget(btnPlotScatter); + + QMenu *menuPlotLineSymbol = new QMenu(this); + menuPlotLineSymbol->addAction(actionPlotLP); + menuPlotLineSymbol->addAction(actionPlotSpline); + + QToolButton *btnPlotLineSymbol = new QToolButton(this); + btnPlotLineSymbol->setMenu(menuPlotLineSymbol); + btnPlotLineSymbol->setPopupMode(QToolButton::MenuButtonPopup); + btnPlotLineSymbol->setDefaultAction(actionPlotLP); + connect(menuPlotLineSymbol, SIGNAL(triggered(QAction *)), btnPlotLineSymbol, SLOT(setDefaultAction(QAction *))); + tableTools->addWidget(btnPlotLineSymbol); + + QMenu *menuPlotBars = new QMenu(this); + menuPlotBars->addAction(actionPlotVerticalBars); + menuPlotBars->addAction(actionPlotHorizontalBars); + menuPlotBars->addAction(actionStackColumns); + menuPlotBars->addAction(actionStackBars); + + QToolButton *btnPlotBars = new QToolButton(this); + btnPlotBars->setMenu(menuPlotBars); + btnPlotBars->setPopupMode(QToolButton::MenuButtonPopup); + btnPlotBars->setDefaultAction(actionPlotVerticalBars); + connect(menuPlotBars, SIGNAL(triggered(QAction *)), btnPlotBars, SLOT(setDefaultAction(QAction *))); + tableTools->addWidget(btnPlotBars); + + tableTools->addAction(actionPlotArea); + tableTools->addAction(actionPlotPie); + + QMenu *menuStatisticPlots = new QMenu(this); + menuStatisticPlots->addAction(actionBoxPlot); + menuStatisticPlots->addAction(actionPlotHistogram); + menuStatisticPlots->addAction(actionPlotStackedHistograms); + menuStatisticPlots->addAction(actionStemPlot); + + QToolButton *btnStatisticPlots = new QToolButton(this); + btnStatisticPlots->setMenu(menuStatisticPlots); + btnStatisticPlots->setPopupMode(QToolButton::MenuButtonPopup); + btnStatisticPlots->setDefaultAction(actionBoxPlot); + connect(menuStatisticPlots, SIGNAL(triggered(QAction *)), btnStatisticPlots, SLOT(setDefaultAction(QAction *))); + tableTools->addWidget(btnStatisticPlots); + + QMenu *menuVectorPlots = new QMenu(this); + menuVectorPlots->addAction(actionPlotVectXYXY); + menuVectorPlots->addAction(actionPlotVectXYAM); + + QToolButton *btnVectorPlots = new QToolButton(this); + btnVectorPlots->setMenu(menuVectorPlots); + btnVectorPlots->setPopupMode(QToolButton::MenuButtonPopup); + btnVectorPlots->setDefaultAction(actionPlotVectXYXY); + connect(menuVectorPlots, SIGNAL(triggered(QAction *)), btnVectorPlots, SLOT(setDefaultAction(QAction *))); + tableTools->addWidget(btnVectorPlots); + + QMenu *menuPlotSpecial = new QMenu(this); + menuPlotSpecial->addAction(actionPlotDoubleYAxis); + menuPlotSpecial->addAction(actionWaterfallPlot); + menuPlotSpecial->addAction(actionAddZoomPlot); + menuPlotSpecial->addAction(actionPlot2VerticalLayers); + menuPlotSpecial->addAction(actionPlot2HorizontalLayers); + menuPlotSpecial->addAction(actionPlot4Layers); + menuPlotSpecial->addAction(actionPlotStackedLayers); + menuPlotSpecial->addAction(actionCustomSharedAxisLayers); + + QToolButton *btnPlotSpecial = new QToolButton(this); + btnPlotSpecial->setMenu(menuPlotSpecial); + btnPlotSpecial->setPopupMode(QToolButton::MenuButtonPopup); + btnPlotSpecial->setDefaultAction(actionPlotDoubleYAxis); + connect(menuPlotSpecial, SIGNAL(triggered(QAction *)), btnPlotSpecial, SLOT(setDefaultAction(QAction *))); + tableTools->addWidget(btnPlotSpecial); + + tableTools->addSeparator (); + + QMenu *menu3DPlots = new QMenu(this); + menu3DPlots->addAction(actionPlot3DBars); + menu3DPlots->addAction(actionPlot3DRibbon); + menu3DPlots->addAction(actionPlot3DScatter); + menu3DPlots->addAction(actionPlot3DTrajectory); + + QToolButton *btn3DPlots = new QToolButton(this); + btn3DPlots->setMenu(menu3DPlots); + btn3DPlots->setPopupMode(QToolButton::MenuButtonPopup); + btn3DPlots->setDefaultAction(actionPlot3DBars); + connect(menu3DPlots, SIGNAL(triggered(QAction *)), btn3DPlots, SLOT(setDefaultAction(QAction *))); + tableTools->addWidget(btn3DPlots); + + tableTools->setEnabled(false); + tableTools->hide(); + + columnTools = new QToolBar(tr( "Column"), this); + columnTools->setObjectName("columnTools"); // this is needed for QMainWindow::restoreState() + columnTools->setIconSize(QSize(16, 20)); + addToolBar(Qt::TopToolBarArea, columnTools); + + columnTools->addAction(actionShowColumnValuesDialog); + columnTools->addAction(actionSetAscValues); + columnTools->addAction(actionSetRandomValues); + columnTools->addSeparator(); + columnTools->addAction(actionSortTable); + columnTools->addAction(actionShowColStatistics); + columnTools->addAction(actionShowRowStatistics); + columnTools->addSeparator(); + columnTools->addAction(actionSetXCol); + columnTools->addAction(actionSetYCol); + columnTools->addAction(actionSetZCol); + columnTools->addAction(actionSetYErrCol); + columnTools->addAction(actionSetLabelCol); + columnTools->addAction(actionDisregardCol); + columnTools->addSeparator(); + columnTools->addAction(actionMoveColFirst); + columnTools->addAction(actionMoveColLeft); + columnTools->addAction(actionMoveColRight); + columnTools->addAction(actionMoveColLast); + columnTools->addAction(actionSwapColumns); + columnTools->addSeparator(); + columnTools->addAction(actionAdjustColumnWidth); + columnTools->addAction(actionMoveRowUp); + columnTools->addAction(actionMoveRowDown); + columnTools->addSeparator(); + columnTools->addAction(actionAddColToTable); + columnTools->setEnabled(false); + columnTools->hide(); + + displayBar = new QToolBar( tr( "Data Display" ), this ); + displayBar->setAllowedAreas( Qt::TopToolBarArea | Qt::BottomToolBarArea ); + displayBar->setObjectName("displayBar"); // this is needed for QMainWindow::restoreState() + info = new QLineEdit( this ); + displayBar->addWidget( info ); + info->setReadOnly(true); + QPalette palette; + palette.setColor(QPalette::Text, QColor(Qt::green)); + palette.setColor(QPalette::HighlightedText, QColor(Qt::darkGreen)); + palette.setColor(QPalette::Base, QColor(Qt::black)); + info->setPalette(palette); + + addToolBar( Qt::TopToolBarArea, displayBar ); + displayBar->hide(); + + insertToolBarBreak (displayBar); + + plotMatrixBar = new QToolBar( tr( "Matrix Plot" ), this); + plotMatrixBar->setObjectName("plotMatrixBar"); + addToolBar(Qt::BottomToolBarArea, plotMatrixBar); + + QMenu *menu3DMatrix = new QMenu(this); + menu3DMatrix->addAction(actionPlot3DWireFrame); + menu3DMatrix->addAction(actionPlot3DHiddenLine); + menu3DMatrix->addAction(actionPlot3DWireSurface); + menu3DMatrix->addAction(actionPlot3DPolygons); + + QToolButton *btn3DMatrix = new QToolButton(this); + btn3DMatrix->setMenu(menu3DMatrix); + btn3DMatrix->setPopupMode(QToolButton::MenuButtonPopup); + btn3DMatrix->setDefaultAction(actionPlot3DWireSurface); + connect(menu3DMatrix, SIGNAL(triggered(QAction *)), btn3DMatrix, SLOT(setDefaultAction(QAction *))); + plotMatrixBar->addWidget(btn3DMatrix); + + actionPlot3DBars->addTo(plotMatrixBar); + actionPlot3DScatter->addTo(plotMatrixBar); + + plotMatrixBar->addSeparator(); + + QMenu *menuContourPlot = new QMenu(this); + menuContourPlot->addAction(actionColorMap); + menuContourPlot->addAction(actionContourMap); + menuContourPlot->addAction(actionGrayMap); + + QToolButton *btnContourPlot = new QToolButton(this); + btnContourPlot->setMenu(menuContourPlot); + btnContourPlot->setPopupMode(QToolButton::MenuButtonPopup); + btnContourPlot->setDefaultAction(actionColorMap); + connect(menuContourPlot, SIGNAL(triggered(QAction *)), btnContourPlot, SLOT(setDefaultAction(QAction *))); + plotMatrixBar->addWidget(btnContourPlot); + + actionImagePlot->addTo(plotMatrixBar); + actionImageProfilesPlot->addTo(plotMatrixBar); + actionPlotHistogram->addTo(plotMatrixBar); + plotMatrixBar->addSeparator(); + actionSetMatrixValues->addTo(plotMatrixBar); + actionFlipMatrixHorizontally->addTo(plotMatrixBar); + actionFlipMatrixVertically->addTo(plotMatrixBar); + actionRotateMatrix->addTo(plotMatrixBar); + actionRotateMatrixMinus->addTo(plotMatrixBar); + plotMatrixBar->addSeparator(); + plotMatrixBar->addAction(actionIncreasePrecision); + plotMatrixBar->addAction(actionDecreasePrecision); + plotMatrixBar->hide(); + + formatToolBar = new QToolBar(tr( "Format" ), this); + formatToolBar->setObjectName("formatToolBar"); + addToolBar(Qt::TopToolBarArea, formatToolBar); + + QFontComboBox *fb = new QFontComboBox(); + connect(fb, SIGNAL(currentFontChanged(const QFont &)), this, SLOT(setFontFamily(const QFont &))); + actionFontBox = formatToolBar->addWidget(fb); + + QSpinBox *sb = new QSpinBox(); + connect(sb, SIGNAL(valueChanged(int)), this, SLOT(setFontSize(int))); + actionFontSize = formatToolBar->addWidget(sb); + + actionFontBold->addTo(formatToolBar); + actionFontItalic->addTo(formatToolBar); + + actionUnderline->addTo(formatToolBar); + actionSuperscript->addTo(formatToolBar); + actionSubscript->addTo(formatToolBar); + actionGreekSymbol->addTo(formatToolBar); + actionGreekMajSymbol->addTo(formatToolBar); + actionMathSymbol->addTo(formatToolBar); + + formatToolBar->setEnabled(false); + formatToolBar->hide(); + + QList toolBars = toolBarsList(); + foreach (QToolBar *t, toolBars) + connect(t, SIGNAL(actionTriggered(QAction *)), this, SLOT(performCustomAction(QAction *))); +} + +void ApplicationWindow::insertTranslatedStrings() +{ + if (projectname == "untitled") + setWindowTitle(tr("QtiPlot - untitled")); + + lv->setColumnText (0, tr("Name")); + lv->setColumnText (1, tr("Type")); + lv->setColumnText (2, tr("View")); + lv->setColumnText (3, tr("Size")); + lv->setColumnText (4, tr("Created")); + lv->setColumnText (5, tr("Label")); + + if (scriptWindow) + scriptWindow->setWindowTitle(tr("QtiPlot - Script Window")); + explorerWindow->setWindowTitle(tr("Project Explorer")); + logWindow->setWindowTitle(tr("Results Log")); + undoStackWindow->setWindowTitle(tr("Undo Stack")); +#ifdef SCRIPTING_CONSOLE + consoleWindow->setWindowTitle(tr("Scripting Console")); +#endif + displayBar->setWindowTitle(tr("Data Display")); + tableTools->setWindowTitle(tr("Table")); + columnTools->setWindowTitle(tr("Column")); + plotTools->setWindowTitle(tr("Plot")); + fileTools->setWindowTitle(tr("File")); + editTools->setWindowTitle(tr("Edit")); + noteTools->setWindowTitle(tr("Notes")); + plotMatrixBar->setWindowTitle(tr("Matrix Plot")); + plot3DTools->setWindowTitle(tr("3D Surface")); + formatToolBar->setWindowTitle(tr("Format")); + + fileMenu->changeItem(recentMenuID, tr("&Recent Projects")); + fileMenu->setTitle(tr("&File")); + newMenu->setTitle(tr("&New")); + exportPlotMenu->setTitle(tr("&Export Graph")); + importMenu->setTitle(tr("&Import")); + edit->setTitle(tr("&Edit")); + view->setTitle(tr("&View")); + graphMenu->setTitle(tr("&Graph")); + plot3DMenu->setTitle(tr("3D &Plot")); + matrixMenu->setTitle(tr("&Matrix")); + plot2DMenu->setTitle(tr("&Plot")); + plotDataMenu->setTitle(tr("&Data")); + normMenu->setTitle(tr("&Normalize")); + fillMenu->setTitle(tr("&Fill Columns With")); + tableMenu->setTitle(tr("&Table")); + smoothMenu->setTitle(tr("&Smooth")); + filterMenu->setTitle(tr("&FFT filter")); + decayMenu->setTitle(tr("Fit E&xponential Decay")); + multiPeakMenu->setTitle(tr("Fit &Multi-peak")); + analysisMenu->setTitle(tr("&Analysis")); + format->setTitle(tr("F&ormat")); + scriptingMenu->setTitle(tr("&Scripting")); + windowsMenu->setTitle(tr("&Windows")); + help->setTitle(tr("&Help")); + + translateActionsStrings(); + customMenu(activeWindow()); +} + +void ApplicationWindow::initMainMenu() +{ + menuBar()->setObjectName("menuBar"); + + fileMenu = new QMenu(this); + fileMenu->setObjectName("fileMenu"); + connect(fileMenu, SIGNAL(aboutToShow()), this, SLOT(fileMenuAboutToShow())); + menuBar()->addMenu(fileMenu); + + recent = new QMenu(this); + newMenu = new QMenu(this); + newMenu->setObjectName("newMenu"); + exportPlotMenu = new QMenu(this); + exportPlotMenu->setObjectName("exportPlotMenu"); + importMenu = new QMenu(this); + importMenu->setObjectName("importMenu"); + + edit = new QMenu(this); + edit->setObjectName("editMenu"); + menuBar()->addMenu(edit); + + edit->addAction(actionUndo); + edit->addAction(actionRedo); + edit->insertSeparator(); + edit->addAction(actionCopySelection); + edit->addAction(actionPasteSelection); + edit->addAction(actionClearSelection); + edit->insertSeparator(); + edit->addAction(actionDeleteFitTables); + edit->addAction(actionClearLogInfo); + edit->insertSeparator(); + edit->addAction(actionShowConfigureDialog); + + connect(edit, SIGNAL(aboutToShow()), this, SLOT(editMenuAboutToShow())); + + view = new QMenu(this); + view->setObjectName("viewMenu"); + menuBar()->addMenu(view); + + view->setCheckable(true); + view->addAction(actionToolBars); + view->addAction(actionShowPlotWizard); + view->addAction(actionShowExplorer); + view->addAction(actionShowLog); + view->addAction(actionShowUndoStack); +#ifdef SCRIPTING_CONSOLE + view->addAction(actionShowConsole); +#endif + + scriptingMenu = new QMenu(this); + scriptingMenu->setObjectName("scriptingMenu"); + connect(scriptingMenu, SIGNAL(aboutToShow()), this, SLOT(scriptingMenuAboutToShow())); + menuBar()->addMenu(scriptingMenu); + + graphMenu = new QMenu(this); + graphMenu->setObjectName("graphMenu"); + graphMenu->setCheckable(true); + menuBar()->addMenu(graphMenu); + + graphMenu->addAction(actionShowCurvesDialog); + graphMenu->addAction(actionAddFunctionCurve); + graphMenu->addAction(actionAddErrorBars); + graphMenu->addAction(actionNewLegend); + graphMenu->addSeparator(); + graphMenu->addAction(actionAddFormula); + graphMenu->addAction(actionAddText); + graphMenu->addAction(btnArrow); + graphMenu->addAction(btnLine); + graphMenu->addAction(actionAddRectangle); + graphMenu->addAction(actionAddEllipse); + graphMenu->addAction(actionTimeStamp); + graphMenu->addAction(actionAddImage); + graphMenu->addSeparator();//layers section + graphMenu->addAction(actionAddLayer); + graphMenu->addAction(actionAddInsetLayer); + graphMenu->addAction(actionAddInsetCurveLayer); + graphMenu->addAction(actionShowLayerDialog); + graphMenu->addAction(actionAutomaticLayout); + graphMenu->addSeparator(); + graphMenu->addAction(actionExtractLayers); + graphMenu->addAction(actionExtractGraphs); + graphMenu->addSeparator(); + graphMenu->addAction(actionDeleteLayer); + + plot3DMenu = new QMenu(this); + plot3DMenu->setObjectName("plot3DMenu"); + plot3DMenu->addAction(actionPlot3DWireFrame); + plot3DMenu->addAction(actionPlot3DHiddenLine); + plot3DMenu->addAction(actionPlot3DPolygons); + plot3DMenu->addAction(actionPlot3DWireSurface); + plot3DMenu->insertSeparator(); + plot3DMenu->addAction(actionPlot3DBars); + plot3DMenu->addAction(actionPlot3DScatter); + plot3DMenu->insertSeparator(); + plot3DMenu->addAction(actionColorMap); + plot3DMenu->addAction(actionContourMap); + plot3DMenu->addAction(actionGrayMap); + plot3DMenu->insertSeparator(); + plot3DMenu->addAction(actionImagePlot); + plot3DMenu->addAction(actionImageProfilesPlot); + plot3DMenu->insertSeparator(); + plot3DMenu->addAction(actionPlotHistogram); + menuBar()->addMenu(plot3DMenu); + + matrixMenu = new QMenu(this); + matrixMenu->setObjectName("matrixMenu"); + connect(matrixMenu, SIGNAL(aboutToShow()), this, SLOT(matrixMenuAboutToShow())); + menuBar()->addMenu(matrixMenu); + + plot2DMenu = new QMenu(this); + plot2DMenu->setObjectName("plot2DMenu"); + connect(plot2DMenu, SIGNAL(aboutToShow()), this, SLOT(plotMenuAboutToShow())); + menuBar()->addMenu(plot2DMenu); + + plotDataMenu = new QMenu(this); + plotDataMenu->setObjectName("plotDataMenu"); + plotDataMenu->setCheckable(true); + connect(plotDataMenu, SIGNAL(aboutToShow()), this, SLOT(plotDataMenuAboutToShow())); + menuBar()->addMenu(plotDataMenu); + + normMenu = new QMenu(this); + normMenu->setObjectName("normMenu"); + + fillMenu = new QMenu(); + fillMenu->setObjectName("fillMenu"); + + analysisMenu = new QMenu(this); + analysisMenu->setObjectName("analysisMenu"); + connect(analysisMenu, SIGNAL(aboutToShow()), this, SLOT(analysisMenuAboutToShow())); + menuBar()->addMenu(analysisMenu); + + tableMenu = new QMenu(this); + tableMenu->setObjectName("tableMenu"); + connect(tableMenu, SIGNAL(aboutToShow()), this, SLOT(tableMenuAboutToShow())); + menuBar()->addMenu(tableMenu); + + smoothMenu = new QMenu(this); + smoothMenu->setObjectName("smoothMenu"); + + filterMenu = new QMenu(this); + filterMenu->setObjectName("filterMenu"); + + decayMenu = new QMenu(this); + decayMenu->setObjectName("decayMenu"); + + multiPeakMenu = new QMenu(this); + multiPeakMenu->setObjectName("multiPeakMenu"); + + format = new QMenu(this); + format->setObjectName("formatMenu"); + menuBar()->addMenu(format); + + windowsMenu = new QMenu(this); + windowsMenu->setObjectName("windowsMenu"); + windowsMenu->setCheckable(true); + connect(windowsMenu, SIGNAL(aboutToShow()), this, SLOT(windowsMenuAboutToShow())); + menuBar()->addMenu(windowsMenu); + + foldersMenu = new QMenu(this); + foldersMenu->setCheckable(true); + + help = new QMenu(this); + help->setObjectName("helpMenu"); + menuBar()->addMenu(help); + + help->addAction(actionShowHelp); + help->addAction(actionChooseHelpFolder); + help->insertSeparator(); + help->addAction(actionHomePage); + help->addAction(actionCheckUpdates); + help->addAction(actionDownloadManual); + help->addAction(actionTranslations); + help->insertSeparator(); + help->addAction(actionTechnicalSupport); + help->addAction(actionDonate); + help->addAction(actionHelpForums); + help->addAction(actionHelpBugReports); + help->insertSeparator(); + help->addAction(actionAbout); + + QList menus; + menus << windowsMenu << view << graphMenu << fileMenu << format << edit; + menus << help << plot2DMenu << analysisMenu; + menus << matrixMenu << plot3DMenu << plotDataMenu << scriptingMenu; + menus << tableMenu << newMenu << exportPlotMenu << importMenu; + + foreach (QMenu *m, menus) + connect(m, SIGNAL(triggered(QAction *)), this, SLOT(performCustomAction(QAction *))); + + disableActions(); +} + +void ApplicationWindow::tableMenuAboutToShow() +{ + tableMenu->clear(); + fillMenu->clear(); + + QMenu *setAsMenu = tableMenu->addMenu(tr("Set Columns &As")); + setAsMenu->addAction(actionSetXCol); + setAsMenu->addAction(actionSetYCol); + setAsMenu->addAction(actionSetZCol); + setAsMenu->insertSeparator(); + setAsMenu->addAction(actionSetLabelCol); + setAsMenu->addAction(actionDisregardCol); + setAsMenu->insertSeparator(); + setAsMenu->addAction(actionSetXErrCol); + setAsMenu->addAction(actionSetYErrCol); + setAsMenu->insertSeparator(); + setAsMenu->addAction(tr("&Read-only"), this, SLOT(setReadOnlyColumns())); + setAsMenu->addAction(tr("Read/&Write"), this, SLOT(setReadWriteColumns())); + + tableMenu->addAction(actionShowColumnOptionsDialog); + tableMenu->insertSeparator(); + + tableMenu->addAction(actionShowColumnValuesDialog); + tableMenu->addAction(actionTableRecalculate); + + fillMenu->addAction(actionSetAscValues); + fillMenu->addAction(actionSetRandomValues); + tableMenu->addMenu (fillMenu); + + tableMenu->addAction(actionClearTable); + tableMenu->insertSeparator(); + tableMenu->addAction(actionAddColToTable); + tableMenu->addAction(actionShowColsDialog); + tableMenu->insertSeparator(); + tableMenu->addAction(actionHideSelectedColumns); + tableMenu->addAction(actionShowAllColumns); + tableMenu->addAction(actionAdjustColumnWidth); + tableMenu->insertSeparator(); + tableMenu->addAction(actionMoveColFirst); + tableMenu->addAction(actionMoveColLeft); + tableMenu->addAction(actionMoveColRight); + tableMenu->addAction(actionMoveColLast); + tableMenu->addAction(actionSwapColumns); + tableMenu->insertSeparator(); + tableMenu->addAction(actionShowRowsDialog); + tableMenu->addAction(actionDeleteRows); + + QMenu *moveRowMenu = tableMenu->addMenu(tr("Move Row")); + moveRowMenu->addAction(actionMoveRowUp); + moveRowMenu->addAction(actionMoveRowDown); + + tableMenu->insertSeparator(); + tableMenu->addAction(actionGoToRow); + tableMenu->addAction(actionGoToColumn); + tableMenu->addAction(actionExtractTableData); + tableMenu->insertSeparator(); + + QMenu *convertToMatrixMenu = tableMenu->addMenu(tr("Convert to &Matrix")); + convertToMatrixMenu->addAction(actionConvertTableDirect); + convertToMatrixMenu->addAction(actionConvertTableBinning); + convertToMatrixMenu->addAction(actionConvertTableRegularXYZ); + + reloadCustomActions(); +} + +void ApplicationWindow::plotDataMenuAboutToShow() +{ + plotDataMenu->clear(); + plotDataMenu->addAction(btnPointer); + plotDataMenu->insertSeparator(); + plotDataMenu->addAction(actionMagnify); + plotDataMenu->addAction(actionMagnifyHor); + plotDataMenu->addAction(actionMagnifyVert); + plotDataMenu->addAction(btnZoomIn); + plotDataMenu->addAction(btnZoomOut); + plotDataMenu->addAction(actionUnzoom); + plotDataMenu->insertSeparator(); + plotDataMenu->addAction(btnCursor); + plotDataMenu->addAction(btnSelect); + plotDataMenu->addAction(btnPicker); + plotDataMenu->insertSeparator(); + plotDataMenu->addAction(actionDrawPoints); + plotDataMenu->addAction(btnMovePoints); + plotDataMenu->addAction(btnRemovePoints); + plotDataMenu->addAction(actionDragCurve); + + reloadCustomActions(); +} + +void ApplicationWindow::plotMenuAboutToShow() +{ + plot2DMenu->clear(); + + plot2DMenu->addAction(actionPlotL); + plot2DMenu->addAction(actionPlotP); + plot2DMenu->addAction(actionPlotLP); + + QMenu *specialPlotMenu = plot2DMenu->addMenu (tr("Special Line/Symb&ol")); + specialPlotMenu->addAction(actionPlotVerticalDropLines); + specialPlotMenu->addAction(actionPlotSpline); + specialPlotMenu->addAction(actionPlotVertSteps); + specialPlotMenu->addAction(actionPlotHorSteps); + specialPlotMenu->insertSeparator(); + specialPlotMenu->addAction(actionPlotDoubleYAxis); + specialPlotMenu->addAction(actionWaterfallPlot); + specialPlotMenu->addAction(actionAddZoomPlot); + + plot2DMenu->insertSeparator(); + plot2DMenu->addAction(actionPlotVerticalBars); + plot2DMenu->addAction(actionPlotHorizontalBars); + QMenu *specialBarMenu = plot2DMenu->addMenu (tr("Spec&ial Bar/Column")); + specialBarMenu->addAction(actionStackBars); + specialBarMenu->addAction(actionStackColumns); + + plot2DMenu->addAction(actionPlotArea); + plot2DMenu->addAction(actionPlotPie); + plot2DMenu->addAction(actionPlotVectXYXY); + plot2DMenu->addAction(actionPlotVectXYAM); + plot2DMenu->insertSeparator(); + + QMenu *statMenu = plot2DMenu->addMenu (tr("Statistical &Graphs")); + statMenu->addAction(actionBoxPlot); + statMenu->addAction(actionPlotHistogram); + statMenu->addAction(actionPlotStackedHistograms); + statMenu->insertSeparator(); + statMenu->addAction(actionStemPlot); + + QMenu *panelsMenu = plot2DMenu->addMenu (tr("Pa&nel")); + panelsMenu->addAction(actionPlot2VerticalLayers); + panelsMenu->addAction(actionPlot2HorizontalLayers); + panelsMenu->addAction(actionPlot4Layers); + panelsMenu->addAction(actionPlotStackedLayers); + panelsMenu->addAction(actionCustomLayout); + + QMenu *gridMenu = plot2DMenu->addMenu (tr("Shared A&xes Panel")); + gridMenu->addAction(actionVertSharedAxisLayers); + gridMenu->addAction(actionHorSharedAxisLayers); + gridMenu->addAction(actionSharedAxesLayers); + gridMenu->addAction(actionStackSharedAxisLayers); + gridMenu->addAction(actionCustomSharedAxisLayers); + + QMenu *plot3D = plot2DMenu->addMenu (tr("3&D Plot")); + plot3D->addAction(actionPlot3DRibbon); + plot3D->addAction(actionPlot3DBars); + plot3D->addAction(actionPlot3DScatter); + plot3D->addAction(actionPlot3DTrajectory); + + reloadCustomActions(); +} + +void ApplicationWindow::customMenu(QMdiSubWindow* w) +{ + analysisMenu->menuAction()->setVisible(false); + tableMenu->menuAction()->setVisible(false); + plotDataMenu->menuAction()->setVisible(false); + graphMenu->menuAction()->setVisible(false); + matrixMenu->menuAction()->setVisible(false); + format->menuAction()->setVisible(false); + plot2DMenu->menuAction()->setVisible(false); + plot3DMenu->menuAction()->setVisible(false); +#ifndef SCRIPTING_PYTHON + scriptingMenu->menuAction()->setVisible(false); +#endif + + // these use the same keyboard shortcut (Ctrl+Return) and should not be enabled at the same time + actionNoteEvaluate->setEnabled(false); + actionTableRecalculate->setEnabled(false); + // these use the same keyboard shortcut (Alt+C) and should not be enabled at the same time + actionShowCurvesDialog->setEnabled(false); + actionAddColToTable->setEnabled(false); + // these use the same keyboard shortcut (Alt+Q) and should not be enabled at the same time + actionAddFormula->setEnabled(false); + actionShowColumnValuesDialog->setEnabled(false); + actionSetMatrixValues->setEnabled(false); + // these use the same keyboard shortcut (Ctrl+Alt+F) and should not be enabled at the same time + actionAddFunctionCurve->setEnabled(false); + actionFind->setEnabled(false); + + // clear undo stack view (in case window is not a matrix) + d_undo_view->setStack(0); + actionUndo->setEnabled(false); + actionRedo->setEnabled(false); + + actionCopyWindow->setEnabled(w); + actionPrint->setEnabled(w); + actionPrintPreview->setEnabled(w); + actionExportPDF->setEnabled(w); + + if(w){ + actionPrintAllPlots->setEnabled(projectHas2DPlots()); + actionPrint->setEnabled(true); + actionCutSelection->setEnabled(true); + actionCopySelection->setEnabled(true); + actionPasteSelection->setEnabled(true); + actionClearSelection->setEnabled(true); + actionSaveTemplate->setEnabled(true); + QStringList tables = tableNames() + matrixNames(); + if (!tables.isEmpty()) + actionShowExportASCIIDialog->setEnabled(true); + else + actionShowExportASCIIDialog->setEnabled(false); + + if (w->isA("MultiLayer")) { + actionAddFunctionCurve->setEnabled(true); + actionShowCurvesDialog->setEnabled(true); + actionAddFormula->setEnabled(true); + + graphMenu->menuAction()->setVisible(true); + plotDataMenu->menuAction()->setVisible(true); + analysisMenu->menuAction()->setVisible(true); + format->menuAction()->setVisible(true); + format->clear(); + format->addAction(actionShowPlotDialog); + format->insertSeparator(); + format->addAction(actionShowScaleDialog); + format->addAction(actionShowAxisDialog); + actionShowAxisDialog->setEnabled(true); + format->insertSeparator(); + format->addAction(actionShowGridDialog); + format->addAction(actionShowTitleDialog); + } else if (w->isA("Graph3D")) { + disableActions(); + + actionPrint->setEnabled(true); + actionSaveTemplate->setEnabled(true); + + format->menuAction()->setVisible(true); + format->clear(); + format->addAction(actionShowPlotDialog); + format->addAction(actionShowScaleDialog); + format->addAction(actionShowAxisDialog); + format->addAction(actionShowTitleDialog); + if (((Graph3D*)w)->coordStyle() == Qwt3D::NOCOORD) + actionShowAxisDialog->setEnabled(false); + } else if (w->inherits("Table")) { + plot2DMenu->menuAction()->setVisible(true); + analysisMenu->menuAction()->setVisible(true); + tableMenu->menuAction()->setVisible(true); + + actionTableRecalculate->setEnabled(true); + actionAddColToTable->setEnabled(true); + actionShowColumnValuesDialog->setEnabled(true); + } else if (w->isA("Matrix")){ + actionTableRecalculate->setEnabled(true); + actionSetMatrixValues->setEnabled(true); + + plot3DMenu->menuAction()->setVisible(true); + analysisMenu->menuAction()->setVisible(true); + matrixMenu->menuAction()->setVisible(true); + + d_undo_view->setEmptyLabel(w->objectName() + ": " + tr("Empty Stack")); + QUndoStack *stack = ((Matrix *)w)->undoStack(); + d_undo_view->setStack(stack); + } else if (qobject_cast(w)){ + #ifndef SCRIPTING_PYTHON + scriptingMenu->menuAction()->setVisible(true); + #endif + actionSaveTemplate->setEnabled(false); + actionNoteEvaluate->setEnabled(true); + actionFind->setEnabled(true); + } else + disableActions(); + } else + disableActions(); + + reloadCustomActions(); +} + +void ApplicationWindow::disableActions() +{ + actionSaveTemplate->setEnabled(false); + actionPrintAllPlots->setEnabled(false); + actionPrint->setEnabled(false); + + actionCutSelection->setEnabled(false); + actionCopySelection->setEnabled(false); + actionPasteSelection->setEnabled(false); + actionClearSelection->setEnabled(false); +} + +void ApplicationWindow::customColumnActions() +{ + actionAdjustColumnWidth->setEnabled(false); + actionMoveColFirst->setEnabled(false); + actionMoveColLeft->setEnabled(false); + actionMoveColRight->setEnabled(false); + actionMoveColLast->setEnabled(false); + actionSetXCol->setEnabled(false); + actionSetYCol->setEnabled(false); + actionSetZCol->setEnabled(false); + actionSetLabelCol->setEnabled(false); + actionSetYErrCol->setEnabled(false); + actionDisregardCol->setEnabled(false); + actionSwapColumns->setEnabled(false); + actionSetAscValues->setEnabled(false); + actionSetRandomValues->setEnabled(false); + + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + int selectedCols = t->selectedColsNumber(); + if (selectedCols == 1){ + int col = t->selectedColumn(); + if (col > 0){ + actionMoveColFirst->setEnabled(true); + actionMoveColLeft->setEnabled(true); + } + + if (col < t->numCols() - 1){ + actionMoveColRight->setEnabled(true); + actionMoveColLast->setEnabled(true); + } + } + + if (selectedCols >= 1){ + actionSetAscValues->setEnabled(true); + actionSetRandomValues->setEnabled(true); + actionSetXCol->setEnabled(true); + actionSetYCol->setEnabled(true); + actionSetZCol->setEnabled(true); + actionSetYErrCol->setEnabled(true); + actionSetLabelCol->setEnabled(true); + actionDisregardCol->setEnabled(true); + actionAdjustColumnWidth->setEnabled(true); + } + + if (selectedCols == 2) + actionSwapColumns->setEnabled(true); +} + +void ApplicationWindow::customToolBars(QMdiSubWindow* w) +{ + disableToolbars(); + if (!w) + return; + + if (w->isA("MultiLayer") && d_plot_tool_bar){ + if(!plotTools->isVisible()) + plotTools->show(); + plotTools->setEnabled (true); + custom2DPlotTools((MultiLayer *)w); + if(d_format_tool_bar && !formatToolBar->isVisible()){ + formatToolBar->setEnabled (true); + formatToolBar->show(); + } + } else if (w->inherits("Table")){ + if(d_table_tool_bar){ + if(!tableTools->isVisible()) + tableTools->show(); + tableTools->setEnabled (true); + } + if (d_column_tool_bar){ + if(!columnTools->isVisible()) + columnTools->show(); + columnTools->setEnabled (true); + customColumnActions(); + } + } else if (w->isA("Matrix") && d_matrix_tool_bar){ + if(!plotMatrixBar->isVisible()) + plotMatrixBar->show(); + plotMatrixBar->setEnabled (true); + } else if (w->isA("Graph3D") && d_plot3D_tool_bar){ + if(!plot3DTools->isVisible()) + plot3DTools->show(); + + plot3DTools->setEnabled(((Graph3D*)w)->plotStyle() != Qwt3D::NOPLOT); + custom3DActions(w); + } else if (w->isA("Note")){ + if(d_format_tool_bar && !formatToolBar->isVisible()) + formatToolBar->show(); + if(d_notes_tool_bar && !noteTools->isVisible()) + noteTools->show(); + + formatToolBar->setEnabled (true); + noteTools->setEnabled (true); + setFormatBarFont(((Note*)w)->currentEditor()->currentFont()); + } +} + +void ApplicationWindow::disableToolbars() +{ + plotTools->setEnabled(false); + tableTools->setEnabled(false); + columnTools->setEnabled(false); + plot3DTools->setEnabled(false); + plotMatrixBar->setEnabled(false); + noteTools->setEnabled(false); +} + +void ApplicationWindow::plot3DRibbon() +{ + MdiSubWindow *w = activeWindow(TableWindow); + if (!w) + return; + + Table *table = static_cast(w); + if(table->selectedColumns().count() == 1){ + if (!validFor3DPlot(table)) + return; + plotXYZ(table, table->colName(table->selectedColumn()), Graph3D::Ribbon); + } else + QMessageBox::warning(this, tr("QtiPlot - Plot error"), tr("You must select exactly one column for plotting!")); +} + +void ApplicationWindow::plot3DWireframe() +{ + plot3DMatrix (0, Qwt3D::WIREFRAME); +} + +void ApplicationWindow::plot3DHiddenLine() +{ + plot3DMatrix (0, Qwt3D::HIDDENLINE); +} + +void ApplicationWindow::plot3DPolygons() +{ + plot3DMatrix (0, Qwt3D::FILLED); +} + +void ApplicationWindow::plot3DWireSurface() +{ + plot3DMatrix (0, Qwt3D::FILLEDMESH); +} + +void ApplicationWindow::plot3DBars() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (w->inherits("Table")){ + Table *table = static_cast
(w); + if (!validFor3DPlot(table)) + return; + + if(table->selectedColumns().count() == 1) + plotXYZ(table, table->colName(table->selectedColumn()), Graph3D::Bars); + else + QMessageBox::warning(this, tr("QtiPlot - Plot error"),tr("You must select exactly one column for plotting!")); + } + else if(w->inherits("Matrix")) + plot3DMatrix(0, Qwt3D::USER); +} + +void ApplicationWindow::plot3DScatter() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (w->inherits("Table")) + { + Table *table = static_cast
(w); + if (!validFor3DPlot(table)) + return; + + if(table->selectedColumns().count() == 1) + plotXYZ(table, table->colName(table->selectedColumn()), Graph3D::Scatter); + else + QMessageBox::warning(this, tr("QtiPlot - Plot error"),tr("You must select exactly one column for plotting!")); + } + else if(w->inherits("Matrix")) + plot3DMatrix (0, Qwt3D::POINTS); +} + +void ApplicationWindow::plot3DTrajectory() +{ + Table *table = (Table *)activeWindow(TableWindow); + if (!table) + return; + if (!validFor3DPlot(table)) + return; + + if(table->selectedColumns().count() == 1) + plotXYZ(table, table->colName(table->selectedColumn()), Graph3D::Trajectory); + else + QMessageBox::warning(this, tr("QtiPlot - Plot error"), tr("You must select exactly one column for plotting!")); +} + +void ApplicationWindow::plotBoxDiagram() +{ + generate2DGraph(Graph::Box); +} + +void ApplicationWindow::plotVerticalBars() +{ + generate2DGraph(Graph::VerticalBars); +} + +void ApplicationWindow::plotHorizontalBars() +{ + generate2DGraph(Graph::HorizontalBars); +} + +void ApplicationWindow::plotStackBar() +{ + generate2DGraph(Graph::StackBar); +} + +void ApplicationWindow::plotStackColumn() +{ + generate2DGraph(Graph::StackColumn); +} + +MultiLayer* ApplicationWindow::plotHistogram() +{ + return generate2DGraph(Graph::Histogram); +} + +MultiLayer* ApplicationWindow::plotHistogram(Matrix *m) +{ + if (!m){ + m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + } + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + MultiLayer* g = newGraph(); + if (g) + g->activeLayer()->addHistogram(m); + QApplication::restoreOverrideCursor(); + return g; +} + +void ApplicationWindow::plotArea() +{ + generate2DGraph(Graph::Area); +} + +void ApplicationWindow::plotPie() +{ + Table *table = (Table *)activeWindow(TableWindow); + if (!table) + return; + + if(table->selectedColumns().count() != 1){ + QMessageBox::warning(this, tr("QtiPlot - Plot error"), + tr("You must select exactly one column for plotting!")); + return; + } + + QStringList s = table->selectedColumns(); + if (s.count()>0){ + Q3TableSelection sel = table->getSelection(); + multilayerPlot(table, s, Graph::Pie, sel.topRow(), sel.bottomRow()); + } else + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select a column to plot!")); +} + +void ApplicationWindow::plotL() +{ + generate2DGraph(Graph::Line); +} + +void ApplicationWindow::plotP() +{ + generate2DGraph(Graph::Scatter); +} + +void ApplicationWindow::plotLP() +{ + generate2DGraph(Graph::LineSymbols); +} + +void ApplicationWindow::plotVerticalDropLines() +{ + generate2DGraph(Graph::VerticalDropLines); +} + +void ApplicationWindow::plotSpline() +{ + generate2DGraph(Graph::Spline); +} + +void ApplicationWindow::plotVertSteps() +{ + generate2DGraph(Graph::VerticalSteps); +} + +void ApplicationWindow::plotHorSteps() +{ + generate2DGraph(Graph::HorizontalSteps); +} + +void ApplicationWindow::plotVectXYXY() +{ + Table *table = (Table *)activeWindow(TableWindow); + if (!table) + return; + if (!validFor2DPlot(table, Graph::VectXYXY)) + return; + + QStringList s = table->selectedColumns(); + if (s.count() == 4) { + Q3TableSelection sel = table->getSelection(); + multilayerPlot(table, s, Graph::VectXYXY, sel.topRow(), sel.bottomRow()); + } else + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select four columns for this operation!")); +} + +void ApplicationWindow::plotVectXYAM() +{ + Table *table = (Table *)activeWindow(TableWindow); + if (!table) + return; + if (!validFor2DPlot(table, Graph::VectXYAM)) + return; + + QStringList s = table->selectedColumns(); + if (s.count() == 4){ + Q3TableSelection sel = table->getSelection(); + multilayerPlot(table, s, Graph::VectXYAM, sel.topRow(), sel.bottomRow()); + } else + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select four columns for this operation!")); +} + +void ApplicationWindow::renameListViewItem(const QString& oldName,const QString& newName) +{ + Q3ListViewItem *it=lv->findItem (oldName,0, Q3ListView::ExactMatch | Qt::CaseSensitive ); + if (it) + it->setText(0,newName); +} + +void ApplicationWindow::setListViewLabel(const QString& caption,const QString& label) +{ + Q3ListViewItem *it = lv->findItem ( caption, 0, Q3ListView::ExactMatch | Qt::CaseSensitive ); + if (it){ + QString s = label; + it->setText(5, s.replace("\n", " ")); + } +} + +void ApplicationWindow::setListViewDate(const QString& caption,const QString& date) +{ + Q3ListViewItem *it=lv->findItem ( caption, 0, Q3ListView::ExactMatch | Qt::CaseSensitive ); + if (it) + it->setText(4,date); +} + +void ApplicationWindow::setListView(const QString& caption,const QString& view) +{ + Q3ListViewItem *it=lv->findItem ( caption,0, Q3ListView::ExactMatch | Qt::CaseSensitive ); + if (it) + it->setText(2,view); +} + +void ApplicationWindow::setListViewSize(const QString& caption,const QString& size) +{ + Q3ListViewItem *it=lv->findItem ( caption,0, Q3ListView::ExactMatch | Qt::CaseSensitive ); + if (it) + it->setText(3,size); +} + +QString ApplicationWindow::listViewDate(const QString& caption) +{ + Q3ListViewItem *it=lv->findItem (caption,0, Q3ListView::ExactMatch | Qt::CaseSensitive ); + if (it) + return it->text(4); + else + return ""; +} + +void ApplicationWindow::updateTableNames(const QString& oldName, const QString& newName) +{ + QList windows = windowsList(); + foreach (MdiSubWindow *w, windows) { + if (w->isA("MultiLayer")) { + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers) + g->updateCurveNames(oldName, newName); + } else if (w->isA("Graph3D")) { + QString name = ((Graph3D*)w)->formula(); + if (name.contains(oldName, true)) { + name.replace(oldName,newName); + ((Graph3D*)w)->setPlotAssociation(name); + } + } + } +} + +void ApplicationWindow::updateColNames(const QString& oldName, const QString& newName) +{ + QList windows = windowsList(); + foreach (MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")){ + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers) + g->updateCurveNames(oldName, newName, false); + } + else if (w->isA("Graph3D")){ + QString name = ((Graph3D*)w)->formula(); + if (name.contains(oldName)){ + name.replace(oldName,newName); + ((Graph3D*)w)->setPlotAssociation(name); + } + } + } +} + +void ApplicationWindow::changeMatrixName(const QString& oldName, const QString& newName) +{ + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("Graph3D")) + { + QString s = ((Graph3D*)w)->formula(); + if (s.contains(oldName)) + { + s.replace(oldName, newName); + ((Graph3D*)w)->setPlotAssociation(s); + } + } + else if (w->isA("MultiLayer")) + { + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers){ + for (int i=0; icurveCount(); i++){ + QwtPlotItem *sp = (QwtPlotItem *)g->plotItem(i); + if (sp && sp->rtti() == QwtPlotItem::Rtti_PlotSpectrogram && sp->title().text() == oldName) + sp->setTitle(newName); + } + } + } + } +} + +void ApplicationWindow::remove3DMatrixPlots(Matrix *m) +{ + if (!m) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("Graph3D") && ((Graph3D*)w)->matrix() == m) + ((Graph3D*)w)->clearData(); + else if (w->isA("MultiLayer")){ + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers){ + QList curvesList = g->curvesList(); + foreach (QwtPlotItem *it, curvesList){ + if (it->rtti() == QwtPlotItem::Rtti_PlotSpectrogram){ + if (((Spectrogram *)it)->matrix() == m) + g->removeCurve(it); + } else if (((PlotCurve *)it)->type() == Graph::Histogram){ + if (((QwtHistogram *)it)->matrix() == m) + g->removeCurve(it); + } + } + g->updatePlot(); + } + } + } + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::updateMatrixPlots(Matrix *m) +{ + if (!m) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("Graph3D") && ((Graph3D*)w)->matrix() == m) + ((Graph3D*)w)->updateMatrixData(m); + else if (w->isA("MultiLayer")){ + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers){ + QList curvesList = g->curvesList(); + foreach (QwtPlotItem *it, curvesList){ + if (it->rtti() == QwtPlotItem::Rtti_PlotSpectrogram){ + Spectrogram *sp = (Spectrogram *)it; + if (sp->matrix() == m){ + sp->updateData(); + g->updatePlot(); + } + } else if (((PlotCurve *)it)->type() == Graph::Histogram){ + QwtHistogram *h = (QwtHistogram *)it; + if (h->matrix() == m){ + h->loadData(); + g->updatePlot(); + } + } + } + } + } + } + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::add3DData() +{ + if (!hasTable()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no tables available in this project.

" + "

Please create a table and try again!

")); + return; + } + + QStringList zColumns = columnsList(Table::Z); + if ((int)zColumns.count() <= 0){ + QMessageBox::critical(this,tr("QtiPlot - Warning"), + tr("There are no available columns with plot designation set to Z!")); + return; + } + + bool ok; + QString column = QInputDialog::getItem(this, tr("QtiPlot - Choose data set"), + tr("Column") + ": ", zColumns, 0, false, &ok); + if (ok && !column.isEmpty()) + insertNew3DData(column); +} + +void ApplicationWindow::change3DData() +{ + bool ok; + QString column = QInputDialog::getItem(this, tr("QtiPlot - Choose data set"), + tr("Column") + ": ", columnsList(Table::Z), 0, false, &ok); + if (ok && !column.isEmpty()) + change3DData(column); +} + +void ApplicationWindow::change3DMatrix() +{ + QStringList matrices = matrixNames(); + int currentIndex = 0; + Graph3D* g = (Graph3D*)activeWindow(Plot3DWindow); + if (g && g->matrix()) + currentIndex = matrices.indexOf(g->matrix()->objectName()); + + bool ok; + QString matrixName = QInputDialog::getItem(this, tr("QtiPlot - Choose matrix to plot"), + tr("Matrix") + ": ", matrices, currentIndex, false, &ok); + if (ok && !matrixName.isEmpty()) + change3DMatrix(matrixName); +} + +void ApplicationWindow::change3DMatrix(const QString& matrix_name) +{ + Graph3D *g = (Graph3D*)activeWindow(Plot3DWindow); + if (!g) + return; + + Matrix *m = matrix(matrix_name); + if (!m) + return; + + if (d_3D_autoscale) + g->addMatrixData(m); + else + g->addMatrixData(m, g->xStart(), g->xStop(), g->yStart(), g->yStop(), g->zStart(), g->zStop()); + + emit modified(); +} + +void ApplicationWindow::add3DMatrixPlot() +{ + QStringList matrices = matrixNames(); + if ((int)matrices.count() <= 0){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), + tr("

There are no matrices available in this project.

" + "

Please create a matrix and try again!

")); + return; + } + + bool ok; + QString matrixName = QInputDialog::getItem(this, tr("QtiPlot - Choose matrix to plot"), + tr("Matrix") + ": ", matrices, 0, false, &ok); + if (ok && !matrixName.isEmpty()) + insert3DMatrixPlot(matrixName); +} + +void ApplicationWindow::insert3DMatrixPlot(const QString& matrix_name) +{ + Graph3D *g = (Graph3D*)activeWindow(Plot3DWindow); + if (!g) + return; + + g->addMatrixData(matrix(matrix_name)); + emit modified(); +} + +void ApplicationWindow::insertNew3DData(const QString& colName) +{ + Graph3D *g = (Graph3D*)activeWindow(Plot3DWindow); + if (!g) + return; + + g->insertNewData(table(colName),colName); + emit modified(); +} + +void ApplicationWindow::change3DData(const QString& colName) +{ + Graph3D *g = (Graph3D*)activeWindow(Plot3DWindow); + if (!g) + return; + + g->changeDataColumn(table(colName), colName, g->tablePlotType()); + emit modified(); +} + +void ApplicationWindow::editSurfacePlot() +{ + Graph3D *g = (Graph3D*)activeWindow(Plot3DWindow); + if (!g) + return; + + SurfaceDialog* sd = new SurfaceDialog(this); + sd->setAttribute(Qt::WA_DeleteOnClose); + + if (g->hasData() && g->userFunction()) + sd->setFunction(g); + else if (g->hasData() && g->parametricSurface()) + sd->setParametricSurface(g); + else + sd->setGraph(g); + sd->exec(); +} + +void ApplicationWindow::newSurfacePlot() +{ + SurfaceDialog* sd = new SurfaceDialog(this); + sd->setAttribute(Qt::WA_DeleteOnClose); + sd->exec(); +} + +Graph3D* ApplicationWindow::plotSurface(const QString& formula, double xl, double xr, + double yl, double yr, double zl, double zr, int columns, int rows) +{ + Graph3D *plot = newPlot3D(); + if(!plot) + return 0; + + plot->addFunction(formula, xl, xr, yl, yr, zl, zr, columns, rows); + plot->setDataColorMap(d_3D_color_map); + plot->update(); + + emit modified(); + return plot; +} + +Graph3D* ApplicationWindow::plotParametricSurface(const QString& xFormula, const QString& yFormula, + const QString& zFormula, double ul, double ur, double vl, double vr, + int columns, int rows, bool uPeriodic, bool vPeriodic) +{ + Graph3D *plot = newPlot3D(); + if(!plot) + return 0; + plot->addParametricSurface(xFormula, yFormula, zFormula, ul, ur, vl, vr, + columns, rows, uPeriodic, vPeriodic); + plot->setDataColorMap(d_3D_color_map); + plot->update(); + + emit modified(); + return plot; +} + +void ApplicationWindow::updateSurfaceFuncList(const QString& s) +{ + surfaceFunc.remove(s); + surfaceFunc.push_front(s); + while ((int)surfaceFunc.size() > 10) + surfaceFunc.pop_back(); +} + +Graph3D* ApplicationWindow::addRibbon(const QString& caption, const QString& formula, + double xl, double xr, double yl, double yr, double zl, double zr) +{ + Table* t = table(formula.left(formula.find("_", 0))); + if (!t) + return 0; + + QString s = formula; + s.remove("(X)").remove("(Y)"); + QStringList l = s.split(","); + if (l.size() != 2) + return 0; + + Graph3D *plot = newPlot3D(caption); + if(!plot) + return 0; + + plot->addRibbon(t, l[0], l[1], xl, xr, yl, yr, zl, zr); + plot->setDataColorMap(d_3D_color_map); + plot->update(); + + return plot; +} + +Graph3D* ApplicationWindow::newPlot3D(const QString& title) +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QString label = title; + if (label.isEmpty() || alreadyUsedName(label)) + label = generateUniqueName(tr("Graph")); + + Graph3D *plot = new Graph3D("", this, 0); + plot->setWindowTitle(label); + plot->setName(label); + + initPlot3D(plot); + + emit modified(); + QApplication::restoreOverrideCursor(); + return plot; +} + +Graph3D* ApplicationWindow::plotXYZ(Table* table, const QString& zColName, int type) +{ + int zCol = table->colIndex(zColName); + if (zCol < 0) + return 0; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + Graph3D *plot = newPlot3D(); + if(!plot) + return 0; + + if (type == Graph3D::Ribbon) { + int ycol = table->colIndex(zColName); + plot->addRibbon(table, table->colName(table->colX(ycol)), zColName); + } else + plot->addData(table, table->colX(zCol), table->colY(zCol), zCol, type); + + plot->setDataColorMap(d_3D_color_map); + plot->update(); + + emit modified(); + QApplication::restoreOverrideCursor(); + return plot; +} + +void ApplicationWindow::initPlot3D(Graph3D *plot) +{ + if (d_mdi_windows_area) + d_workspace->addSubWindow(plot); + else + plot->setParent(0); + + connectSurfacePlot(plot); + + plot->setIcon(QPixmap(":/trajectory.png")); + plot->show(); + plot->setFocus(); + + addListViewItem(plot); + + if (!plot3DTools->isVisible()) + plot3DTools->show(); + + if (!plot3DTools->isEnabled()) + plot3DTools->setEnabled(true); + + customMenu(plot); + customToolBars(plot); +} + +void ApplicationWindow::exportMatrix(const QString& exportFilter) +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + ImageExportDialog *ied = new ImageExportDialog(m, this, d_extended_export_dialog); + ied->setDir(imagesDirPath); + ied->selectFile(m->objectName()); + if (exportFilter.isEmpty()) + ied->selectFilter(d_image_export_filter); + else + ied->selectFilter(exportFilter); + + if ( ied->exec() != QDialog::Accepted ) + return; + imagesDirPath = ied->directory().path(); + + QString selected_filter = ied->selectedFilter().remove("*"); + QString file_name = ied->selectedFiles()[0]; + if(!file_name.endsWith(selected_filter, Qt::CaseInsensitive)) + file_name.append(selected_filter); + + if (selected_filter.contains(".eps") || selected_filter.contains(".pdf") || selected_filter.contains(".ps")) + m->exportVector(file_name, ied->vectorResolution(), ied->color()); + else if (selected_filter.contains(".svg")) + m->exportSVG(file_name); +#ifdef EMF_OUTPUT + else if (selected_filter.contains(".emf")) + m->exportEMF(file_name); +#endif + else if (selected_filter.contains(".odf")) + m->exportRasterImage(file_name, ied->quality(), ied->bitmapResolution()); + else { + QList list = QImageWriter::supportedImageFormats(); + for (int i=0; i<(int)list.count(); i++){ + if (selected_filter.contains("." + (list[i]).lower())) + m->exportRasterImage(file_name, ied->quality(), ied->bitmapResolution()); + } + } +} + +Matrix* ApplicationWindow::importImage(const QString& fileName, bool newWindow) +{ + QString fn = fileName; + if (fn.isEmpty()){ + fn = getFileName(this, tr("QtiPlot - Import image from file"), imagesDirPath, imageFilter(), 0, false); + if ( !fn.isEmpty() ){ + QFileInfo fi(fn); + imagesDirPath = fi.dirPath(true); + } + } + + QImage image(fn); + if (image.isNull()) + return 0; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + MdiSubWindow *w = activeWindow(MatrixWindow); + Matrix* m = NULL; + if (w && !newWindow){ + m = (Matrix *)w; + m->importImage(fn); + } else { + m = new Matrix(scriptEnv, image, "", this); + initMatrix(m, generateUniqueName(tr("Matrix"))); + m->show(); + m->setWindowLabel(fn); + m->setCaptionPolicy(MdiSubWindow::Both); + } + + QApplication::restoreOverrideCursor(); + return m; +} + +QString ApplicationWindow::imageFilter() +{ + QList list = QImageReader::supportedImageFormats(); + QString filter = tr("Images") + " (", aux1, aux2; + for (int i = 0; i < (int)list.count(); i++){ + aux1 = " *." + list[i] + " "; + aux2 += " *." + list[i] + ";;"; + filter += aux1; + } + filter += ");;" + aux2; + return filter; +} + +void ApplicationWindow::loadImage() +{ + QString fn = getFileName(this, tr("QtiPlot - Load image from file"), imagesDirPath, imageFilter(), 0, false); + if ( !fn.isEmpty() ){ + loadImage(fn); + QFileInfo fi(fn); + imagesDirPath = fi.dirPath(true); + } +} + +void ApplicationWindow::loadImage(const QString& fn) +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + MultiLayer *plot = multilayerPlot(generateUniqueName(tr("Graph"))); + plot->setWindowLabel(fn); + plot->setCaptionPolicy(MdiSubWindow::Both); + + Graph *g = plot->activeLayer(); + g->setTitle(""); + for (int i=0; i<4; i++) + g->enableAxis(i, false); + g->addImage(fn); + QApplication::restoreOverrideCursor(); +} + +MultiLayer* ApplicationWindow::multilayerPlot(const QString& caption, int layers, int rows, int cols) +{ + MultiLayer* ml = new MultiLayer(this, layers, rows, cols); + initMultilayerPlot(ml, caption); + return ml; +} + +MultiLayer* ApplicationWindow::newGraph(const QString& caption) +{ + MultiLayer *ml = multilayerPlot(generateUniqueName(caption)); + if (ml){ + Graph *g = ml->activeLayer(); + if (g){ + setPreferences(g); + g->newLegend(); + } + ml->arrangeLayers(false, true); + } + + return ml; +} + +MultiLayer* ApplicationWindow::multilayerPlot(Table* w, const QStringList& colList, int style, int startRow, int endRow) +{//used when plotting selected columns + if (!w) + return 0; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + MultiLayer* g = multilayerPlot(generateUniqueName(tr("Graph"))); + Graph *ag = g->activeLayer(); + if (!ag) + return 0; + + setPreferences(ag); + ag->addCurves(w, colList, style, defaultCurveLineWidth, defaultSymbolSize, startRow, endRow); + ag->newLegend(); + + g->arrangeLayers(false, true); + QApplication::restoreOverrideCursor(); + return g; +} + +MultiLayer* ApplicationWindow::multilayerPlot(int c, int r, int style, const MultiLayer::AlignPolicy& align) +{//used when plotting from the panel menu + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return 0; + + if (!validFor2DPlot(t, (Graph::CurveType)style)) + return 0; + + QStringList list = t->drawableColumnSelection(); + if((int)list.count() < 1) { + QMessageBox::warning(this, tr("QtiPlot - Plot error"), tr("Please select a Y column to plot!")); + return 0; + } + + int curves = list.count(); + if (r < 0) + r = curves; + + int layers = c*r; + MultiLayer* g = multilayerPlot(generateUniqueName(tr("Graph")), layers, r, c); + QList layersList = g->layersList(); + int i = 0; + foreach(Graph *ag, layersList){ + setPreferences(ag); + if (i < curves){ + QStringList lst = QStringList() << list[i]; + for (int j = 0; j < curves; j++){ + int col = t->colIndex(list[j]); + if (t->colPlotDesignation(col) == Table::xErr || + t->colPlotDesignation(col) == Table::yErr || + t->colPlotDesignation(col) == Table::Label){ + lst << list[j]; + } + } + ag->addCurves(t, lst, style, defaultCurveLineWidth, defaultSymbolSize); + } + i++; + } + + if (align == MultiLayer::AlignCanvases){ + g->setAlignPolicy(align); + g->setSpacing(0, 0); + g->setCommonLayerAxes(); + connect(layersList.last(), SIGNAL(updatedLayout(Graph *)), g, SLOT(updateLayersLayout(Graph *))); + } else { + g->arrangeLayers(false, true); + foreach(Graph *ag, layersList){ + if (ag->curveCount()) + ag->newLegend(); + } + } + return g; +} + +MultiLayer* ApplicationWindow::waterfallPlot() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return 0; + + return waterfallPlot(t, t->selectedYColumns()); +} + +MultiLayer* ApplicationWindow::waterfallPlot(Table *t, const QStringList& list) +{ + if (!t) + return 0; + + int curves = list.count(); + if(curves < 1){ + QMessageBox::warning(this, tr("QtiPlot - Plot error"), + tr("Please select a Y column to plot!")); + return 0; + } + + MultiLayer* ml = new MultiLayer(this, curves, 1, 1); + QList layersList = ml->layersList(); + int i = 0; + foreach(Graph *g, layersList){ + DataCurve *cv = g->insertCurve(t, list[i], Graph::Line); + if (cv) + cv->setPen(QPen(d_indexed_colors[i], defaultCurveLineWidth)); + i++; + } + QString legend = QString(); + initMultilayerPlot(ml, QString()); + foreach(Graph *g, layersList){ + g->hide(); + legend += g->legendText(true) + "\n"; + setPreferences(g); + g->setCanvasFrame(0); + g->setTitle(QString::null); + g->setMargin(0); + g->setFrame(0); + g->raise(); + } + + ml->setWaterfallLayout(); + Graph *g = layersList.last(); + if (g) + g->newLegend(legend.trimmed())->move(QPoint(5, 5)); + return ml; +} + +void ApplicationWindow::initMultilayerPlot(MultiLayer* g, const QString& name) +{ + QString label = name; + while(alreadyUsedName(label)) + label = generateUniqueName(tr("Graph")); + + g->setWindowTitle(label); + g->setName(label); + g->setIcon(QPixmap(":/graph.png")); + g->setScaleLayersOnPrint(d_scale_plots_on_print); + g->printCropmarks(d_print_cropmarks); + + if (d_mdi_windows_area) + d_workspace->addSubWindow(g); + else + g->setParent(0); + + connectMultilayerPlot(g); + g->showNormal(); + + addListViewItem(g); +} + +void ApplicationWindow::setAutoUpdateTableValues(bool on) +{ + if (d_auto_update_table_values == on) + return; + + d_auto_update_table_values = on; + + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->inherits("Table")) + ((Table *)w)->setAutoUpdateValues(d_auto_update_table_values); + } + f = f->folderBelow(); + } +} + +void ApplicationWindow::customTable(Table* w) +{ + QColorGroup cg; + cg.setColor(QColorGroup::Base, tableBkgdColor); + cg.setColor(QColorGroup::Text, tableTextColor); + w->setPalette(QPalette(cg, cg, cg)); + + w->setHeaderColor(tableHeaderColor); + w->setTextFont(tableTextFont); + w->setHeaderFont(tableHeaderFont); + w->showComments(d_show_table_comments); + w->setNumericPrecision(d_decimal_digits); +} + +void ApplicationWindow::setPreferences(Graph* g) +{ + if (!g) + return; + + if (!g->isPiePlot()){ + for (int i = 0; i < QwtPlot::axisCnt; i++){ + bool show = d_show_axes[i]; + g->enableAxis(i, show); + if(show){ + ScaleDraw *sd = (ScaleDraw *)g->axisScaleDraw (i); + sd->enableComponent(QwtAbstractScaleDraw::Labels, d_show_axes_labels[i]); + sd->setSpacing(d_graph_tick_labels_dist); + if (i == QwtPlot::yRight && !d_show_axes_labels[i]) + g->setAxisTitle(i, tr(" ")); + } + } + + g->updateSecondaryAxis(QwtPlot::xTop); + g->updateSecondaryAxis(QwtPlot::yRight); + + QList ticksList; + ticksList<setMajorTicksType(ticksList); + ticksList.clear(); + ticksList<setMinorTicksType(ticksList); + + g->setTicksLength (minTicksLength, majTicksLength); + g->setAxesLinewidth(axesLineWidth); + g->drawAxesBackbones(drawBackbones); + g->setCanvasFrame(canvasFrameWidth, d_canvas_frame_color); + for (int i = 0; i < QwtPlot::axisCnt; i++) + g->setAxisTitleDistance(i, d_graph_axes_labels_dist); + } + + g->setAxisTitlePolicy(d_graph_axis_labeling); + g->setSynchronizedScaleDivisions(d_synchronize_graph_scales); + g->initFonts(plotAxesFont, plotNumbersFont); + g->initTitle(titleOn, plotTitleFont); + + g->setMargin(defaultPlotMargin); + g->enableAutoscaling(autoscale2DPlots); + g->setAutoscaleFonts(autoScaleFonts); + g->setAntialiasing(antialiasing2DPlots); + g->setFrame(d_graph_border_width, d_graph_border_color); + + QColor c = d_graph_background_color; + c.setAlpha(d_graph_background_opacity); + g->setBackgroundColor(c); + + c = d_graph_canvas_color; + c.setAlpha(d_graph_canvas_opacity); + g->setCanvasBackground(c); +} + +/* + * return the current Plot (used for the Python interface) + */ +MultiLayer* ApplicationWindow::currentPlot() +{ + MultiLayer* p = (MultiLayer*)activeWindow(MultiLayerWindow); + return p; +} + +/* + * return the current Table (used for the Python interface) + */ +Table* ApplicationWindow::currentTable() +{ + Table* w = (Table*)activeWindow(TableWindow); + return w; +} + +/* + *creates a new empty table + */ +Table* ApplicationWindow::newTable() +{ + Table* w = new Table(scriptEnv, 30, 2, "", this, 0); + initTable(w, generateUniqueName(tr("Table"))); + w->showNormal(); + return w; +} + +/* + *used when opening a project file + */ +Table* ApplicationWindow::newTable(const QString& caption, int r, int c) +{ + Table* w = new Table(scriptEnv, r, c, "", this, 0); + initTable(w, caption); + if (d_is_appending_file && w->objectName() != caption){//the table was renamed + renamedTables << caption << w->objectName(); + if (d_inform_rename_table){ + QApplication::restoreOverrideCursor(); + QMessageBox:: warning(this, tr("QtiPlot - Renamed Window"), + tr("The table '%1' already exists. It has been renamed '%2'.").arg(caption).arg(w->objectName())); + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + } + } + w->showNormal(); + return w; +} + +Table* ApplicationWindow::newTable(int r, int c, const QString& name, const QString& legend) +{ + Table* w = new Table(scriptEnv, r, c, legend, this, 0); + initTable(w, name); + return w; +} + +Table* ApplicationWindow::newHiddenTable(const QString& name, const QString& label, int r, int c, const QString& text) +{ + Table* w = new Table(scriptEnv, r, c, label, this, 0); + + if (!text.isEmpty()) { + QStringList rows = text.split("\n", QString::SkipEmptyParts); + QStringList list = rows[0].split("\t"); + w->setHeader(list); + + QString rlist; + for (int i=0; isetText(i, j, list[j]); + } + } + + initTable(w, name); + hideWindow(w); + return w; +} + +void ApplicationWindow::initTable(Table* w, const QString& caption) +{ + QString name = caption; + name = name.replace ("_","-"); + + while(name.isEmpty() || alreadyUsedName(name)) + name = generateUniqueName(tr("Table")); + + if (d_mdi_windows_area) + d_workspace->addSubWindow(w); + else + w->setParent(0); + + connectTable(w); + customTable(w); + + w->setName(name); + w->setIcon(QPixmap(":/worksheet.png") ); + addListViewItem(w); +} + +/* + * !creates a new table with type statistics on target columns/rows of table base + */ +TableStatistics *ApplicationWindow::newTableStatistics(Table *base, int type, QList target, const QString &caption) +{ + TableStatistics* s = new TableStatistics(scriptEnv, this, base, (TableStatistics::Type) type, target); + if (caption.isEmpty()) + initTable(s, s->objectName()); + else + initTable(s, caption); + s->showNormal(); + return s; +} + +/* + * return the current note (used for the Python interface) + */ +Note* ApplicationWindow::currentNote() +{ + Note* m = (Note*)activeWindow(NoteWindow); + return m; +} + +/* + *creates a new empty note window + */ +Note* ApplicationWindow::newNote(const QString& caption) +{ + Note* m = new Note(scriptEnv, "", this); + + QString name = caption; + while(name.isEmpty() || alreadyUsedName(name)) + name = generateUniqueName(tr("Notes")); + + m->setName(name); + m->setIcon(QPixmap(":/note.png")); + m->askOnCloseEvent(confirmCloseNotes); + + if (d_mdi_windows_area) + d_workspace->addSubWindow(m); + else + m->setParent(0); + + addListViewItem(m); + + connect(m, SIGNAL(modifiedWindow(MdiSubWindow*)), this, SLOT(modifiedProject(MdiSubWindow*))); + connect(m, SIGNAL(resizedWindow(MdiSubWindow*)),this,SLOT(modifiedProject(MdiSubWindow*))); + connect(m, SIGNAL(closedWindow(MdiSubWindow*)), this, SLOT(closeWindow(MdiSubWindow*))); + connect(m, SIGNAL(hiddenWindow(MdiSubWindow*)), this, SLOT(hideWindow(MdiSubWindow*))); + connect(m, SIGNAL(statusChanged(MdiSubWindow*)), this, SLOT(updateWindowStatus(MdiSubWindow*))); + connect(m, SIGNAL(dirPathChanged(const QString&)), this, SLOT(scriptsDirPathChanged(const QString&))); + connect(m, SIGNAL(currentEditorChanged()), this, SLOT(scriptingMenuAboutToShow())); + + m->showNormal(); + return m; +} + +void ApplicationWindow::connectScriptEditor(ScriptEdit *editor) +{ + if (!editor) + return; + + QTextDocument *doc = editor->document(); + actionUndo->setEnabled(doc->isUndoAvailable()); + actionRedo->setEnabled(doc->isRedoAvailable()); + + connect(editor, SIGNAL(undoAvailable(bool)), actionUndo, SLOT(setEnabled(bool))); + connect(editor, SIGNAL(redoAvailable(bool)), actionRedo, SLOT(setEnabled(bool))); +} + +/* + * return the current Matrix (used for the Python interface) + */ +Matrix* ApplicationWindow::currentMatrix() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + return m; +} + +Matrix* ApplicationWindow::newMatrix(int rows, int columns) +{ + Matrix* m = new Matrix(scriptEnv, rows, columns, "", this, 0); + initMatrix(m, generateUniqueName(tr("Matrix"))); + m->showNormal(); + return m; +} + +Matrix* ApplicationWindow::newMatrix(const QString& caption, int r, int c) +{ + Matrix* w = new Matrix(scriptEnv, r, c, "", this, 0); + initMatrix(w, caption); + if (d_is_appending_file && w->objectName() != caption){//the matrix was renamed + renamedTables << caption << w->objectName(); + if (d_inform_rename_table){ + QApplication::restoreOverrideCursor(); + QMessageBox:: warning(this, tr("QtiPlot - Renamed Window"), + tr("The table '%1' already exists. It has been renamed '%2'.").arg(caption).arg(w->objectName())); + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + } + } + + w->showNormal(); + return w; +} + +void ApplicationWindow::viewMatrixImage() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + m->undoStack()->push(new MatrixSetViewCommand(m, m->viewType(), Matrix::ImageView, tr("Set Image Mode"))); + m->setViewType(Matrix::ImageView); + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::viewMatrixTable() +{ + Matrix* m = static_cast(activeWindow(MatrixWindow)); + if (!m) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + m->undoStack()->push(new MatrixSetViewCommand(m, m->viewType(), Matrix::TableView, tr("Set Data Mode"))); + m->setViewType(Matrix::TableView); + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::viewMatrixXY() +{ + Matrix* m = static_cast(activeWindow(MatrixWindow)); + if (!m) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + m->undoStack()->push(new MatrixSetHeaderViewCommand(m, m->headerViewType(), Matrix::XY, tr("Show X/Y"))); + m->setHeaderViewType(Matrix::XY); + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::viewMatrixColumnRow() +{ + Matrix* m = static_cast(activeWindow(MatrixWindow)); + if (!m) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + m->undoStack()->push(new MatrixSetHeaderViewCommand(m, m->headerViewType(), Matrix::ColumnRow, tr("Show Column/Row"))); + m->setHeaderViewType(Matrix::ColumnRow); + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::setMatrixDefaultScale() +{ + Matrix* m = static_cast(activeWindow(MatrixWindow)); + if (!m) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + m->undoStack()->push(new MatrixSetColorMapCommand(m, m->colorMapType(), m->colorMap(), + Matrix::Default, QwtLinearColorMap(), tr("Set Default Palette"))); + m->setDefaultColorMap(); + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::setMatrixGrayScale() +{ + Matrix* m = static_cast(activeWindow(MatrixWindow)); + if (!m) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + m->undoStack()->push(new MatrixSetColorMapCommand(m, m->colorMapType(), m->colorMap(), + Matrix::GrayScale, QwtLinearColorMap(), tr("Set Gray Scale Palette"))); + m->setGrayScale(); + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::setMatrixRainbowScale() +{ + Matrix* m = static_cast(activeWindow(MatrixWindow)); + if (!m) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + m->undoStack()->push(new MatrixSetColorMapCommand(m, m->colorMapType(), m->colorMap(), + Matrix::Rainbow, QwtLinearColorMap(), tr("Set Rainbow Palette"))); + m->setRainbowColorMap(); + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::showColorMapDialog() +{ + Matrix* m = static_cast(activeWindow(MatrixWindow)); + if (!m) + return; + + ColorMapDialog *cmd = new ColorMapDialog(this); + cmd->setAttribute(Qt::WA_DeleteOnClose); + cmd->setMatrix(m); + cmd->exec(); +} + +void ApplicationWindow::transposeMatrix() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + m->transpose(); +} + +void ApplicationWindow::flipMatrixVertically() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + m->flipVertically(); +} + +void ApplicationWindow::flipMatrixHorizontally() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + m->flipHorizontally(); +} + +void ApplicationWindow::rotateMatrix90() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + m->rotate90(); +} + +void ApplicationWindow::rotateMatrixMinus90() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + m->rotate90(false); +} + +void ApplicationWindow::matrixDeterminant() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + QDateTime dt = QDateTime::currentDateTime (); + QString info=dt.toString(Qt::LocalDate); + info+= "\n" + tr("Determinant of ") + QString(m->objectName()) + ":\t"; + info+= "det = " + QString::number(m->determinant()) + "\n"; + info+="-------------------------------------------------------------\n"; + + current_folder->appendLogInfo(info); + + showResults(true); +} + +void ApplicationWindow::invertMatrix() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + m->invert(); +} + +Table* ApplicationWindow::convertMatrixToTableDirect() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + + return matrixToTable(m, Direct); +} + +Table* ApplicationWindow::convertMatrixToTableXYZ() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + + return matrixToTable(m, XYZ); +} + +Table* ApplicationWindow::convertMatrixToTableYXZ() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + + return matrixToTable(m, YXZ); +} + +Table* ApplicationWindow::matrixToTable(Matrix* m, MatrixToTableConversion conversionType) +{ + if (!m) + return 0; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + int rows = m->numRows(); + int cols = m->numCols(); + MatrixModel *mModel = m->matrixModel(); + + Table* w = NULL; + if (conversionType == Direct){ + w = new Table(scriptEnv, rows, cols, "", this, 0); + for (int i = 0; isetCell(i, j, m->cell(i,j)); + } + } else if (conversionType == XYZ){ + int tableRows = rows*cols; + w = new Table(scriptEnv, tableRows, 3, "", this, 0); + for (int i = 0; isetCell(cell, 0, mModel->x(j)); + w->setCell(cell, 1, mModel->y(i)); + w->setCell(cell, 2, mModel->cell(i, j)); + } + } + } else if (conversionType == YXZ){ + int tableRows = rows*cols; + w = new Table(scriptEnv, tableRows, 3, "", this, 0); + for (int i = 0; isetCell(cell, 0, mModel->x(i)); + w->setCell(cell, 1, mModel->y(j)); + w->setCell(cell, 2, mModel->cell(i, j)); + } + } + } + + + initTable(w, generateUniqueName(tr("Table"))); + w->setWindowLabel(m->windowLabel()); + w->setCaptionPolicy(m->captionPolicy()); + w->resize(m->size()); + w->showNormal(); + + QApplication::restoreOverrideCursor(); + return w; +} + +void ApplicationWindow::initMatrix(Matrix* m, const QString& caption) +{ + QString name = caption; + while(alreadyUsedName(name)){name = generateUniqueName(tr("Matrix"));} + + m->setWindowTitle(name); + m->setName(name); + m->setIcon( QPixmap(":/matrix.png") ); + m->askOnCloseEvent(confirmCloseMatrix); + m->setNumericPrecision(d_decimal_digits); + + if (d_mdi_windows_area) + d_workspace->addSubWindow(m); + else + m->setParent(0); + + addListViewItem(m); + + QUndoStack *stack = m->undoStack(); + connect(stack, SIGNAL(canUndoChanged(bool)), actionUndo, SLOT(setEnabled(bool))); + connect(stack, SIGNAL(canRedoChanged(bool)), actionRedo, SLOT(setEnabled(bool))); + connect(m, SIGNAL(modifiedWindow(MdiSubWindow*)), this, SLOT(modifiedProject(MdiSubWindow*))); + connect(m, SIGNAL(modifiedData(Matrix*)), this, SLOT(updateMatrixPlots(Matrix *))); + connect(m, SIGNAL(resizedWindow(MdiSubWindow*)),this,SLOT(modifiedProject(MdiSubWindow*))); + connect(m, SIGNAL(closedWindow(MdiSubWindow*)), this, SLOT(closeWindow(MdiSubWindow*))); + connect(m, SIGNAL(hiddenWindow(MdiSubWindow*)), this, SLOT(hideWindow(MdiSubWindow*))); + connect(m, SIGNAL(statusChanged(MdiSubWindow*)),this, SLOT(updateWindowStatus(MdiSubWindow*))); + connect(m, SIGNAL(showContextMenu()), this, SLOT(showWindowContextMenu())); + + emit modified(); +} + +void ApplicationWindow::showBinMatrixDialog() +{ + Table* t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + Q3TableSelection sel = t->getSelection(); + if (t->selectedYColumns().size() != 1 || fabs(sel.topRow() - sel.bottomRow()) < 2){ + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), + tr("You must select a single Y column that has an associated X column!")); + return; + } + + CreateBinMatrixDialog *cbmd = new CreateBinMatrixDialog(t, sel.topRow(), sel.bottomRow(), this); + cbmd->exec(); +} + +Matrix* ApplicationWindow::convertTableToMatrixRegularXYZ() +{ + Table* t = (Table*)activeWindow(TableWindow); + if (!t) + return 0; + + Q3TableSelection sel = t->getSelection(); + if (t->selectedColumns().size() != 1 || + t->colPlotDesignation(t->colIndex(t->selectedColumns()[0])) != Table::Z || + fabs(sel.topRow() - sel.bottomRow()) < 2){ + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), + tr("You must select exactly one Z column!")); + return 0; + } + + int zcol = t->colIndex(t->selectedColumns()[0]); + int ycol = t->colY(zcol); + int xcol = t->colX(ycol); + + int cells = 0; + int startRow = sel.topRow(); + int endRow = sel.bottomRow(); + for (int i = startRow; i <= endRow; i++){ + QString xs = t->text(i, xcol); + QString ys = t->text(i, ycol); + QString zs = t->text(i, zcol); + if (!xs.isEmpty() && !ys.isEmpty() && !zs.isEmpty()) + cells++; + } + + if (!cells) + return 0; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QLocale locale = this->locale(); + bool xVariesFirst = false; + int firstValidRow = sel.topRow(); + double x0 = 0.0, y0 = 0.0, xstart = 0.0, ystart = 0.0; + double tolerance = 0.15; + for (int i = startRow; i <= endRow; i++){ + QString xs = t->text(i, xcol); + QString ys = t->text(i, ycol); + QString zs = t->text(i, zcol); + if (!xs.isEmpty() && !ys.isEmpty() && !zs.isEmpty()){ + x0 = locale.toDouble(xs); + y0 = locale.toDouble(ys); + xstart = x0; + ystart = y0; + firstValidRow = i; + + for (int j = i + 1; j <= endRow; j++){ + xs = t->text(j, xcol); + ys = t->text(j, ycol); + zs = t->text(j, zcol); + if (!xs.isEmpty() && !ys.isEmpty() && !zs.isEmpty()){ + double x = locale.toDouble(xs); + double y = locale.toDouble(ys); + if (fabs(x - x0) > tolerance*x0 && fabs(y - y0) <= tolerance*y0) + xVariesFirst = true; + break; + } + } + break; + } + } + + int rows = 0; + int cols = 0; + for (int i = firstValidRow; i <= endRow; i++){ + QString xs = t->text(i, xcol); + QString ys = t->text(i, ycol); + QString zs = t->text(i, zcol); + if (!xs.isEmpty() && !ys.isEmpty() && !zs.isEmpty()){ + double x = locale.toDouble(xs); + double y = locale.toDouble(ys); + if (xVariesFirst){ + if (fabs(y - y0) <= tolerance*y0){ + cols++; + y0 = y; + } else + break; + } else { + if (fabs(x - x0) <= tolerance*x0){ + rows++; + x0 = x; + } else + break; + } + } + } + + if (rows) + cols = cells/rows; + else + rows = cells/cols; + + double xend = xstart, yend = ystart; + Matrix* m = newMatrix(rows, cols); + for (int i = startRow; i <= endRow; i++){ + QString xs = t->text(i, xcol); + QString ys = t->text(i, ycol); + QString zs = t->text(i, zcol); + if (!xs.isEmpty() && !ys.isEmpty() && !zs.isEmpty()){ + int row = 0, col = 0; + if (xVariesFirst){ + col = i%cols; + row = i/cols; + } else { + row = i%rows; + col = i/rows; + } + + double x = locale.toDouble(xs); + double y = locale.toDouble(ys); + if (x > xend) + xend = x; + if (y > yend) + yend = y; + + m->setCell(row, col, locale.toDouble(zs)); + } + } + + m->setCoordinates(QMIN(xstart, xend), QMAX(xstart, xend), QMIN(ystart, yend), QMAX(ystart, yend)); + + QApplication::restoreOverrideCursor(); + return m; +} + +Matrix* ApplicationWindow::convertTableToMatrix() +{ + Table* t = (Table*)activeWindow(TableWindow); + if (!t) + return 0; + + return tableToMatrix (t); +} + +Matrix* ApplicationWindow::tableToMatrix(Table* t) +{ + if (!t) + return 0; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + int rows = t->numRows(); + int cols = t->numCols(); + + Matrix* m = newMatrix(rows, cols); + for (int i = 0; isetCell(i, j, t->cell(i, j)); + } + + m->showNormal(); + + QApplication::restoreOverrideCursor(); + return m; +} + +MdiSubWindow* ApplicationWindow::window(const QString& name) +{ + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->objectName() == name) + return w; + } + return NULL; +} + +Table* ApplicationWindow::table(const QString& name) +{ + int pos = name.find("_", 0); + QString caption = name.left(pos); + + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->inherits("Table") && w->objectName() == caption) + return (Table*)w; + } + f = f->folderBelow(); + } + + return 0; +} + +Matrix* ApplicationWindow::matrix(const QString& name) +{ + QString caption = name; + if (d_is_appending_file && !renamedTables.isEmpty() && renamedTables.contains(caption)){ + int index = renamedTables.findIndex(caption); + caption = renamedTables[index + 1]; + } + + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->isA("Matrix") && w->objectName() == caption) + return (Matrix*)w; + } + f = f->folderBelow(); + } + return 0; +} + +MdiSubWindow *ApplicationWindow::activeWindow(WindowType type) +{ + if (!d_active_window){ + QList windows = current_folder->windowsList(); + if (!current_folder->activeWindow() && windows.size() > 0){ + d_active_window = windows[0]; + } else + return NULL; + } + + switch(type){ + case NoWindow: + break; + + case TableWindow: + if (d_active_window->inherits("Table")) + return d_active_window; + else + return NULL; + break; + + case MatrixWindow: + return qobject_cast(d_active_window); + break; + + case MultiLayerWindow: + return qobject_cast(d_active_window); + break; + + case NoteWindow: + return qobject_cast(d_active_window); + break; + + case Plot3DWindow: + return qobject_cast(d_active_window); + break; + } + return d_active_window; +} + +void ApplicationWindow::windowActivated(QMdiSubWindow *w) +{ + MdiSubWindow *window = qobject_cast(w); + if (!window) + return; + + if (d_active_window && d_active_window == window) + return; + + d_active_window = window; + + customToolBars(window); + customMenu(window); + + if (d_opening_file) + return; + + QList windows = current_folder->windowsList(); + foreach(MdiSubWindow *ow, windows){ + if (ow != window && ow->status() == MdiSubWindow::Maximized){ + ow->setNormal(); + break; + } + } + + Folder *f = window->folder(); + if (f) + f->setActiveWindow(window); + + emit modified(); +} + +void ApplicationWindow::addErrorBars() +{ + MdiSubWindow *w = activeWindow(MultiLayerWindow); + if (!w) + return; + + MultiLayer* plot = (MultiLayer*)w; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (!g) + return; + + if (!g->curveCount()){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), tr("There are no curves available on this plot!")); + return; + } + + if (g->isPiePlot()){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), tr("This functionality is not available for pie plots!")); + return; + } + + ErrDialog* ed = new ErrDialog(this); + connect (ed, SIGNAL(options(const QString&, int, double, int)), this, SLOT(defineErrorBars(const QString&, int, double, int))); + connect (ed, SIGNAL(options(const QString&, const QString&, int)), this, SLOT(defineErrorBars(const QString&, const QString&, int))); + + ed->setCurveNames(g->analysableCurvesList()); + ed->setSrcTables(tableList()); + ed->exec(); +} + +void ApplicationWindow::defineErrorBars(const QString& name, int type, double percent, int direction) +{ + MdiSubWindow *w = activeWindow(MultiLayerWindow); + if (!w) + return; + + Graph* g = ((MultiLayer*)w)->activeLayer(); + if (!g) + return; + + Table *t = table(name); + if (!t){//user defined function + QMessageBox::critical(this, tr("QtiPlot - Error bars error"), + tr("This feature is not available for user defined function curves!")); + return; + } + + DataCurve *master_curve = (DataCurve *)g->curve(name); + QString xColName = master_curve->xColumnName(); + if (xColName.isEmpty()) + return; + + if (direction == QwtErrorPlotCurve::Horizontal) + t->addCol(Table::xErr); + else + t->addCol(Table::yErr); + + int r = master_curve->dataSize(); + int rows = t->numRows(); + int c = t->numCols() - 1; + int ycol = t->colIndex(name); + if (!direction) + ycol = t->colIndex(xColName); + + QVarLengthArray Y(r); + if (direction == QwtErrorPlotCurve::Horizontal){ + for (int i = 0; i < r; i++) + Y[i] = master_curve->x(i); + } else { + for (int i = 0; i < r; i++) + Y[i] = master_curve->y(i); + } + + QString errColName = t->colName(c); + + if (type == 0){ + double prc = 0.01*percent; + int aux = 0; + for (int i = 0; i < rows; i++){ + if (!t->text(i, ycol).isEmpty() && aux < r){ + t->setCell(i, c, Y[aux]*prc); + aux++; + } + } + } else if (type == 1) { + double sd = gsl_stats_sd(Y.data(), 1, r); + for (int i = 0; i < rows; i++){ + if (!t->text(i, ycol).isEmpty()) + t->setCell(i, c, sd); + } + } + QwtErrorPlotCurve *er = g->addErrorBars(xColName, name, t, errColName, direction); + if (er){ + er->setColor(master_curve->pen().color()); + g->replot(); + emit modified(); + } +} + +void ApplicationWindow::defineErrorBars(const QString& curveName, const QString& errColumnName, int direction) +{ + Table *w = table(curveName); + if (!w){//user defined function --> no worksheet available + QMessageBox::critical(this,tr("QtiPlot - Error"), + tr("This feature is not available for user defined function curves!")); + return; + } + + Table *errTable = table(errColumnName); + if (w->numRows() != errTable->numRows()){ + QMessageBox::critical(this,tr("QtiPlot - Error"), tr("The selected columns have different numbers of rows!")); + addErrorBars(); + return; + } + + int errCol = errTable->colIndex(errColumnName); + if (errTable->isEmptyColumn(errCol)){ + QMessageBox::critical(this, tr("QtiPlot - Error"), tr("The selected error column is empty!")); + addErrorBars(); + return; + } + + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g) + return; + + QwtErrorPlotCurve *er = g->addErrorBars(curveName, errTable, errColumnName, direction); + if (er){ + DataCurve *mc = er->masterCurve(); + if (mc){ + er->setColor(mc->pen().color()); + g->replot(); + } + emit modified(); + } +} + +void ApplicationWindow::removeCurves(const QString& name) +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")){ + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers) + g->removeCurves(name); + } else if (w->isA("Graph3D")){ + if ( (((Graph3D*)w)->formula()).contains(name) ) + ((Graph3D*)w)->clearData(); + } + } + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::updateCurves(Table *t, const QString& name) +{ + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")){ + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers) + g->updateCurvesData(t, name); + } else if (w->isA("Graph3D")){ + Graph3D* g = (Graph3D*)w; + if ((g->formula()).contains(name)) + g->updateData(t); + } + } +} + +void ApplicationWindow::showPreferencesDialog() +{ + ConfigDialog* cd = new ConfigDialog(this); + cd->setColumnSeparator(columnSeparator); + cd->exec(); +} + +void ApplicationWindow::setSaveSettings(bool autoSaving, int min) +{ + if (autoSave==autoSaving && autoSaveTime==min) + return; + + autoSave=autoSaving; + autoSaveTime=min; + + killTimer(savingTimerId); + + if (autoSave) + savingTimerId=startTimer(autoSaveTime*60000); + else + savingTimerId=0; +} + +void ApplicationWindow::changeAppStyle(const QString& s) +{ + // style keys are case insensitive + if (appStyle.toLower() == s.toLower()) + return; + + qApp->setStyle(s); + appStyle = qApp->style()->objectName(); + + QPalette pal = qApp->palette(); + pal.setColor (QPalette::Active, QPalette::Base, QColor(panelsColor)); + qApp->setPalette(pal); + +} + +void ApplicationWindow::changeAppFont(const QFont& f) +{ + if (appFont == f) + return; + + appFont = f; + updateAppFonts(); +} + +void ApplicationWindow::updateAppFonts() +{ + qApp->setFont(appFont); + this->setFont(appFont); + info->setFont(QFont(appFont.family(), 2 + appFont.pointSize(), QFont::Bold,false)); +} + +void ApplicationWindow::updateConfirmOptions(bool askTables, bool askMatrices, bool askPlots2D, + bool askPlots3D, bool askNotes) +{ + QList windows = windowsList(); + + + if (confirmCloseTable != askTables){ + confirmCloseTable=askTables; + foreach(MdiSubWindow *w, windows){ + if (w->inherits("Table")) + w->askOnCloseEvent(confirmCloseTable); + } + } + + if (confirmCloseMatrix != askMatrices){ + confirmCloseMatrix = askMatrices; + foreach(MdiSubWindow *w, windows){ + if (w->isA("Matrix")) + w->askOnCloseEvent(confirmCloseMatrix); + } + } + + if (confirmClosePlot2D != askPlots2D){ + confirmClosePlot2D=askPlots2D; + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")) + w->askOnCloseEvent(confirmClosePlot2D); + } + } + + if (confirmClosePlot3D != askPlots3D){ + confirmClosePlot3D=askPlots3D; + foreach(MdiSubWindow *w, windows){ + if (w->isA("Graph3D")) + w->askOnCloseEvent(confirmClosePlot3D); + } + } + + if (confirmCloseNotes != askNotes){ + confirmCloseNotes = askNotes; + foreach(MdiSubWindow *w, windows){ + if (w->isA("Note")) + w->askOnCloseEvent(confirmCloseNotes); + } + } +} + +void ApplicationWindow::setGraphDefaultSettings(bool autoscale, bool scaleFonts, + bool resizeLayers, bool antialiasing) +{ + if (autoscale2DPlots == autoscale && + autoScaleFonts == scaleFonts && + autoResizeLayers != resizeLayers && + antialiasing2DPlots == antialiasing) + return; + + autoscale2DPlots = autoscale; + autoScaleFonts = scaleFonts; + autoResizeLayers = !resizeLayers; + antialiasing2DPlots = antialiasing; + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")){ + ((MultiLayer*)w)->setScaleLayersOnResize(autoResizeLayers); + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers){ + g->enableAutoscaling(autoscale2DPlots); + g->updateScale(); + g->setAutoscaleFonts(autoScaleFonts); + g->setAntialiasing(antialiasing2DPlots); + } + } + } +} + +void ApplicationWindow::setArrowDefaultSettings(double lineWidth, const QColor& c, Qt::PenStyle style, + int headLength, int headAngle, bool fillHead) +{ + if (defaultArrowLineWidth == lineWidth && + defaultArrowColor == c && + defaultArrowLineStyle == style && + defaultArrowHeadLength == headLength && + defaultArrowHeadAngle == headAngle && + defaultArrowHeadFill == fillHead) + return; + + defaultArrowLineWidth = lineWidth; + defaultArrowColor = c; + defaultArrowLineStyle = style; + defaultArrowHeadLength = headLength; + defaultArrowHeadAngle = headAngle; + defaultArrowHeadFill = fillHead; + saveSettings(); +} + +ApplicationWindow * ApplicationWindow::plotFile(const QString& fn) +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + ApplicationWindow *app = new ApplicationWindow(); + app->restoreApplicationGeometry(); + + QList lst = QImageReader::supportedImageFormats() << "JPG"; + QStringList tempList; + foreach(QByteArray temp,lst)// convert QList to QStringList to be able to 'filter' + tempList.append(QString(temp)); + + QFileInfo fi(fn); + QStringList l = tempList.filter(fi.suffix(), Qt::CaseInsensitive); + if (l.count() > 0) + app->importImage(fn); + else { + Table* t = app->newTable(); + if (!t) { + QApplication::restoreOverrideCursor(); + return NULL; + } + t->importASCII(fn, app->columnSeparator, 0, app->renameColumns, app->strip_spaces, app->simplify_spaces, + app->d_ASCII_import_comments, app->d_ASCII_comment_string, + app->d_ASCII_import_read_only, Table::Overwrite, app->d_ASCII_import_locale, app->d_ASCII_end_line); + t->setCaptionPolicy(MdiSubWindow::Both); + app->multilayerPlot(t, t->YColumns(), defaultCurveStyle); + } + + QApplication::restoreOverrideCursor(); + savedProject();//force saved state + close(); + return app; +} + +Table * ApplicationWindow::importOdfSpreadsheet(const QString& fileName, int sheet) +{ +#ifdef ODS_IMPORT + QString fn = fileName; + if (fn.isEmpty()){ + fn = getFileName(this, tr("Open ODF Spreadsheet File"), QString::null, "*.ods", 0, false); + if (fn.isEmpty()) + return NULL; + } + + QuaZipFile file(fn, "content.xml"); + if(!file.open(QIODevice::ReadOnly)){ + QMessageBox::critical(this, tr("QtiPlot"), tr("Couldn't open file %1").arg(fn)); + return NULL; + } + QTemporaryFile out; + if (out.open()){ + char c; + while(file.getChar(&c)) + out.putChar(c); + out.close(); + } + file.close(); + + OdsFileHandler handler(this, fn); + QXmlSimpleReader reader; + reader.setContentHandler(&handler); + reader.setErrorHandler(&handler); + + QXmlInputSource xmlInputSource(&out); + if (reader.parse(xmlInputSource)){ + int sheets = handler.sheetsCount(); + if (sheet > sheets){ + QMessageBox::critical(this, tr("QtiPlot"), tr("File %1 contains only %2 sheets!").arg(fn).arg(sheets)); + } else if (sheet > 0){ + Table *aux = NULL; + for (int i = 0; i < sheets; i++){ + Table *t = handler.sheet(i); + if (i == sheet - 1) + aux = t; + else { + t->askOnCloseEvent(false); + t->close(); + } + } + return aux; + } + return handler.sheet(sheets - 1); + } + return NULL; +#else + QMessageBox::critical(this, tr("QtiPlot"), tr("QtiPlot was built without ODF spreadsheet support!")); + return NULL; +#endif +} + +Table * ApplicationWindow::importExcel(const QString& fileName, int sheet) +{ +#ifdef XLS_IMPORT + QString fn = fileName; + if (fn.isEmpty()){ + fn = getFileName(this, tr("Open Excel File"), QString::null, "*.xls", 0, false); + if (fn.isEmpty()) + return NULL; + } + + // open workbook, choose standard conversion + xlsWorkBook* pWB = xls_open(fn.toAscii().data(), "iso-8859-15//TRANSLIT"); + if (!pWB) + return NULL; + + if (sheet > 0 && sheet > pWB->sheets.count){ + QMessageBox::critical(this, tr("QtiPlot"), tr("File %1 contains only %2 sheets, operation aborted!").arg(fn).arg(pWB->sheets.count)); + return NULL; + } + + Table *table = NULL; + for (int i = 0; i < pWB->sheets.count; i++){// process all sheets + int currentSheet = i + 1; + if (sheet > 0 && sheet != currentSheet) + continue; + + xlsWorkSheet* pWS = xls_getWorkSheet(pWB, i);// open and parse the sheet + xls_parseWorkSheet(pWS); + + int rows = pWS->rows.lastrow + 1; + int cols = pWS->rows.lastcol; + if (rows == 1 && !cols){ + if (sheet > 0 && sheet == currentSheet){ + QMessageBox::critical(this, tr("QtiPlot"), tr("Sheet %1 is empty, operation aborted!").arg(sheet)); + return NULL; + } else + continue; + } + + table = newTable(rows, cols, QString::null, fn + ", " + tr("sheet") + ": " + QString(pWB->sheets.sheet[i].name)); + QDate d1(1899, 12, 30);//start date in Excel files see(http://sc.openoffice.org/excelfileformat.pdf) + QTime t1(0, 0); + double daySeconds = 24*60*60; + for (int t = 0; t <= pWS->rows.lastrow; t++){// process all rows of the sheet + struct st_row::st_row_data* row = &pWS->rows.row[t]; + for (int tt = 0; tt <= pWS->rows.lastcol; tt++){ + st_cell::st_cell_data cell = row->cells.cell[tt]; + if (!cell.ishiden){ + // display the colspan as only one cell, but reject rowspans (they can't be converted to CSV) + if (cell.rowspan > 1){ + printf("%d,%d: rowspan=%i", tt, t, cell.rowspan); + continue; + } + // display the value of the cell (either numeric or string) + if (cell.id == 0x0BD){ // number + if (table->columnType(tt) == Table::Date){ + QDate d2 = d1.addDays(cell.d); + table->setText(t, tt, d2.toString("dd.MM.yyyy")); + } else if (table->columnType(tt) == Table::Time){ + QTime t2 = t1.addSecs(qRound(cell.d*daySeconds)); + table->setText(t, tt, t2.toString("hh:mm:ss")); + } else + table->setCell(t, tt, cell.d); + } else if (cell.id == 0x27e){//date + QDate d2 = d1.addDays(cell.d); + table->setDateFormat("dd.MM.yyyy", tt, false); + table->setText(t, tt, d2.toString("dd.MM.yyyy")); + } else if (cell.id == 0x203){//time + table->setTimeFormat("hh:mm:ss", tt, false); + QTime t2 = t1.addSecs(qRound(cell.d*daySeconds)); + table->setText(t, tt, t2.toString("hh:mm:ss")); + } else if (cell.id == 0x06 && cell.l == 0)//formula + table->setCell(t, tt, cell.d); + else if (cell.str != NULL) + table->setText(t, tt, QString(cell.str)); + } + } + } + table->showNormal(); + + if (sheet > 0 && sheet == currentSheet) + break; + } + xls_close(pWB); + + updateRecentProjectsList(fn); + return table; +#else + QMessageBox::critical(this, tr("QtiPlot"), tr("QtiPlot was built without libxls support!")); + return NULL; +#endif +} + +Table * ApplicationWindow::importWaveFile() +{ + QString fn = getFileName(this, tr("Open File"), QString::null, "*.wav", 0, false); + if (fn.isEmpty()) + return NULL; + + QString log = QDateTime::currentDateTime ().toString(Qt::LocalDate) + " - "; + log += tr("Imported sound file") + ": " + fn + "\n"; + ifstream file(fn, ios::in | ios::binary); + + file.seekg(4, ios::beg); + int chunkSize; + file.read( (char*) &chunkSize, 4 ); // read the ChunkSize + + file.seekg(16, ios::beg); + int subChunk1Size; + file.read( (char*) &subChunk1Size, 4 ); // read the SubChunk1Size + + short format; + file.read( (char*) &format, sizeof(short) ); // read the file format. This should be 1 for PCM + log += tr("Format") + ": "; + if (format != 1){ + QMessageBox::information(this, tr("QtiPlot"), + tr("This is not a PCM type WAV file, operation aborted!")); + log += QString::number(format) + "\n"; + showResults(log, true); + return NULL; + } else + log += tr("PCM") + "\n"; + + short channels; + file.read( (char*) &channels, sizeof(short) ); // read the # of channels (1 or 2) + QStringList header; + if (channels == 2) + header << tr("Time") << tr("Left") << tr("Right"); + else if (channels == 1) + header << tr("Time") << tr("Data"); + log += tr("Channels") + ": " + QString::number(channels) + "\n"; + + int sampleRate; + file.read( (char*) &sampleRate, sizeof(int) ); + log += tr("Sample Rate") + ": " + QString::number(sampleRate) + "\n"; + + int byteRate; + file.read( (char*) &byteRate, sizeof(int) ); + log += tr("Byte Rate") + ": " + QString::number(byteRate) + "\n"; + + short blockAlign; + file.read( (char*) &blockAlign, sizeof(short) ); + log += tr("Block Align") + ": " + QString::number(blockAlign) + "\n"; + + short bitsPerSample; + file.read( (char*) &bitsPerSample, sizeof(short) ); + log += tr("Bits Per Sample") + ": " + QString::number(bitsPerSample) + "\n"; + log += "__________________________________\n"; + showResults(log, true); + + int rows = (chunkSize - 36)/blockAlign; + Table *t = newTable(rows, int(channels + 1), QFileInfo(fn).baseName(), fn); + if (!t) + return NULL; + + t->setHeader(header); + + file.seekg(44, ios::beg); + + double dt = 1.0/(double)sampleRate; + int aux = 1; + if (bitsPerSample == 8){ + if (channels == 2) + file.seekg(46, ios::beg);//???Why??? + int size = 1; + uchar ch; + while(!file.eof()){ + int i = aux - 1; + t->setCell(i, 0, dt*aux); + for (int j = 1; j <= channels; j++){ + file.read((char*) &ch, size); + t->setText(i, j, QString::number(ch)); + } + aux++; + } + } else if (bitsPerSample == 16){ + int size = sizeof(short); + short ch; + while(!file.eof()){ + int i = aux - 1; + t->setCell(i, 0, dt*aux); + for (int j = 1; j <= channels; j++){ + file.read((char*) &ch, size); + t->setText(i, j, QString::number(ch)); + } + aux++; + } + } + + file.close(); + t->show(); + return t; +} + +void ApplicationWindow::importASCII() +{ + ImportASCIIDialog *import_dialog = new ImportASCIIDialog(!activeWindow(TableWindow) && !activeWindow(MatrixWindow), this, d_extended_import_ASCII_dialog); + import_dialog->setDirectory(asciiDirPath); + import_dialog->selectFilter(d_ASCII_file_filter); + if (d_import_ASCII_dialog_size.isValid()) + import_dialog->resize(d_import_ASCII_dialog_size); + if (import_dialog->exec() != QDialog::Accepted) + return; + + asciiDirPath = import_dialog->directory().path(); + d_ASCII_import_mode = import_dialog->importMode(); + columnSeparator = import_dialog->columnSeparator(); + ignoredLines = import_dialog->ignoredLines(); + renameColumns = import_dialog->useFirstRow(); + strip_spaces = import_dialog->stripSpaces(); + simplify_spaces = import_dialog->simplifySpaces(); + d_ASCII_import_locale = import_dialog->decimalSeparators(); + d_ASCII_comment_string = import_dialog->commentString(); + d_ASCII_import_comments = import_dialog->useSecondRow(); + d_ASCII_import_read_only = import_dialog->readOnly(); + d_ASCII_end_line = (EndLineChar)import_dialog->endLineChar(); + saveSettings(); + + importASCII(import_dialog->selectedFiles(), + import_dialog->importMode(), + import_dialog->columnSeparator(), + import_dialog->ignoredLines(), + import_dialog->renameColumns(), + import_dialog->stripSpaces(), + import_dialog->simplifySpaces(), + import_dialog->importComments(), + import_dialog->decimalSeparators(), + import_dialog->commentString(), + import_dialog->readOnly(), + import_dialog->endLineChar(), + import_dialog->columnTypes()); +} + +void ApplicationWindow::importASCII(const QStringList& files, int import_mode, const QString& local_column_separator, + int local_ignored_lines, bool local_rename_columns, bool local_strip_spaces, bool local_simplify_spaces, + bool local_import_comments, QLocale local_separators, const QString& local_comment_string, + bool import_read_only, int endLineChar, const QList& colTypes) +{ + if (files.isEmpty()) + return; + + switch(import_mode) { + case ImportASCIIDialog::NewTables: + { + int dx = 0, dy = 0; + QStringList sorted_files = files; + sorted_files.sort(); + int filesCount = sorted_files.size(); + for (int i=0; iimportASCII(sorted_files[i], local_column_separator, local_ignored_lines, + local_rename_columns, local_strip_spaces, local_simplify_spaces, + local_import_comments, local_comment_string, import_read_only, + Table::Overwrite, local_separators, endLineChar, -1, colTypes); + if (!w) continue; + w->setWindowLabel(sorted_files[i]); + w->setCaptionPolicy(MdiSubWindow::Both); + + QString name = QFileInfo(sorted_files[i]).baseName(); + if (!alreadyUsedName(name) && !name.contains(QRegExp("\\W"))) + setWindowName(w, name); + + if (i == 0){ + dx = w->verticalHeaderWidth(); + dy = w->frameGeometry().height() - w->widget()->height(); + } + if (filesCount > 1) + w->move(QPoint(i*dx, i*dy)); + } + modifiedProject(); + break; + } + case ImportASCIIDialog::NewMatrices: + { + int dx = 0, dy = 0; + QStringList sorted_files = files; + sorted_files.sort(); + int filesCount = sorted_files.size(); + for (int i=0; iimportASCII(sorted_files[i], local_column_separator, local_ignored_lines, + local_strip_spaces, local_simplify_spaces, local_comment_string, + Matrix::Overwrite, local_separators, endLineChar); + w->setWindowLabel(sorted_files[i]); + w->setCaptionPolicy(MdiSubWindow::Both); + + QString name = QFileInfo(sorted_files[i]).baseName(); + if (!alreadyUsedName(name) && !name.contains(QRegExp("\\W"))) + setWindowName(w, name); + + if (i == 0){ + dx = w->verticalHeaderWidth(); + dy = w->frameGeometry().height() - w->widget()->height(); + } + if (filesCount > 1) + w->move(QPoint(i*dx,i*dy)); + } + modifiedProject(); + break; + } + + case ImportASCIIDialog::NewColumns: + case ImportASCIIDialog::NewRows: + { + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (w->inherits("Table")){ + Table *t = (Table*)w; + for (int i = 0; i < files.size(); i++){ + t->importASCII(files[i], local_column_separator, local_ignored_lines, local_rename_columns, + local_strip_spaces, local_simplify_spaces, local_import_comments, + local_comment_string, import_read_only, (Table::ImportMode)(import_mode - 2), + local_separators, endLineChar, -1, colTypes); + } + t->notifyChanges(); + emit modifiedProject(t); + } else if (w->isA("Matrix")){ + Matrix *m = (Matrix *)w; + for (int i=0; iimportASCII(files[i], local_column_separator, local_ignored_lines, + local_strip_spaces, local_simplify_spaces, local_comment_string, + (Matrix::ImportMode)(import_mode - 2), local_separators, endLineChar); + } + } + w->setWindowLabel(files.join("; ")); + w->setCaptionPolicy(MdiSubWindow::Name); + break; + } + case ImportASCIIDialog::Overwrite: + { + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (w->inherits("Table")){ + Table *t = (Table *)w; + t->importASCII(files[0], local_column_separator, local_ignored_lines, local_rename_columns, + local_strip_spaces, local_simplify_spaces, local_import_comments, + local_comment_string, import_read_only, Table::Overwrite, local_separators, endLineChar, -1, colTypes); + t->notifyChanges(); + } else if (w->isA("Matrix")){ + Matrix *m = (Matrix *)w; + m->importASCII(files[0], local_column_separator, local_ignored_lines, + local_strip_spaces, local_simplify_spaces, local_comment_string, + Matrix::Overwrite, local_separators, endLineChar); + } + + w->setWindowLabel(files[0]); + w->setCaptionPolicy(MdiSubWindow::Both); + + QString name = QFileInfo(files[0]).baseName(); + if (!alreadyUsedName(name) && !name.contains(QRegExp("\\W"))) + setWindowName(w, name); + + modifiedProject(); + break; + } + } +} + +void ApplicationWindow::open() +{ + if (showSaveProjectMessage() == QMessageBox::Cancel) + return; + + OpenProjectDialog *open_dialog = new OpenProjectDialog(this, d_extended_open_dialog); + open_dialog->setDirectory(workingDir); + + if (open_dialog->exec() != QDialog::Accepted || open_dialog->selectedFiles().isEmpty()) + return; + workingDir = open_dialog->directory().path(); + + switch(open_dialog->openMode()) { + case OpenProjectDialog::NewProject: + { + QString fn = open_dialog->selectedFiles()[0]; + QFileInfo fi(fn); + + if (projectname != "untitled"){ + QFileInfo fi(projectname); + QString pn = fi.absFilePath(); + if (fn == pn){ + QMessageBox::warning(this, tr("QtiPlot - File openning error"), + tr("The file: %1 is the current file!").arg(fn)); + return; + } + } + + if (!fi.exists ()){ + QMessageBox::critical(this, tr("QtiPlot - File openning error"), + tr("The file: %1 doesn't exist!").arg(fn)); + return; + } + + saveSettings();//the recent projects must be saved + + #ifdef BROWSER_PLUGIN + if (isProjectFile(fn)) + closeProject(); + open(fn, false, false); + #else + ApplicationWindow *a = open (fn); + if (a){ + a->workingDir = workingDir; + if (isProjectFile(fn)) + this->close(); + } + #endif + + break; + } + case OpenProjectDialog::NewFolder: + appendProject(open_dialog->selectedFiles()[0]); + break; + } +} + +bool ApplicationWindow::isProjectFile(const QString& fn) +{ + if (fn.endsWith(".qti", Qt::CaseInsensitive) || fn.endsWith(".qti.gz", Qt::CaseInsensitive) || + fn.endsWith(".qti~", Qt::CaseInsensitive) || + fn.endsWith(".opj",Qt::CaseInsensitive) || fn.endsWith(".ogg",Qt::CaseInsensitive)) + return true; + return false; +} + +ApplicationWindow* ApplicationWindow::open(const QString& fn, bool factorySettings, bool newProject) +{ + QFileInfo fi(fn); + if (!fi.isReadable()){ + QMessageBox::critical(this, tr("QtiPlot - File openning error"), + tr("You don't have the permission to open this file: %1").arg(fn)); + return NULL; + } + +#ifdef OPJ_IMPORT + if (fn.endsWith(".opj", Qt::CaseInsensitive) || fn.endsWith(".ogm", Qt::CaseInsensitive) || + fn.endsWith(".ogw", Qt::CaseInsensitive) || fn.endsWith(".ogg", Qt::CaseInsensitive)) + return importOPJ(fn, factorySettings, newProject); + else +#endif + if (fn.endsWith(".py", Qt::CaseInsensitive)) + return loadScript(fn); + else if (fn.endsWith(".xls", Qt::CaseInsensitive)){ + importExcel(fn); + return this; + } else if (fn.endsWith(".ods", Qt::CaseInsensitive)){ + importOdfSpreadsheet(fn); + return this; + } + + QString fname = fn; + if (fn.endsWith(".qti.gz", Qt::CaseInsensitive)){//decompress using zlib + file_uncompress((char *)fname.ascii()); + fname = fname.left(fname.size() - 3); + } + + QFile f(fname); + QTextStream t( &f ); + f.open(QIODevice::ReadOnly); + QString s = t.readLine(); + f.close(); + + QStringList lst = s.split(QRegExp("\\s"), QString::SkipEmptyParts); + bool qtiProject = (lst.count() < 2 || lst[0] != "QtiPlot") ? false : true; + if (!qtiProject){ + if (QFile::exists(fname + "~")){ + int choice = QMessageBox::question(this, tr("QtiPlot - File opening error"), + tr("The file %1 is corrupted, but there exists a backup copy.
Do you want to open the backup instead?").arg(fn), + QMessageBox::Yes|QMessageBox::Default, QMessageBox::No|QMessageBox::Escape); + if (choice == QMessageBox::Yes) + return open(fname + "~"); + else + QMessageBox::critical(this, tr("QtiPlot - File opening error"), tr("The file: %1 was not created using QtiPlot!").arg(fn)); + return 0; + } + + return plotFile(fn); + } + + QStringList vl = lst[1].split(".", QString::SkipEmptyParts); + d_file_version = 100*(vl[0]).toInt()+10*(vl[1]).toInt()+(vl[2]).toInt(); + + ApplicationWindow* app = openProject(fname, factorySettings, newProject); + + f.close(); + return app; +} + +void ApplicationWindow::openRecentProject(int index) +{ + QString fn = recent->text(index); + int pos = fn.find(" ", 0); + fn = fn.right(fn.length() - pos - 1); + + if (projectname != "untitled"){ + QFileInfo fi(projectname); + QString pn = fi.absFilePath(); + + if (QDir::toNativeSeparators(fn) == QDir::toNativeSeparators(pn)){ + QMessageBox::warning(this, tr("QtiPlot - File openning error"), + tr("The file:

%1

is the current file!").arg(QDir::toNativeSeparators(fn))); + return; + } + } + + if (isProjectFile(fn)){ + if (showSaveProjectMessage() == QMessageBox::Cancel) + return; + } + + QFile f(fn); + if (!f.exists()){ + QMessageBox::critical(this, tr("QtiPlot - File Open Error"), + tr("The file: %1

does not exist anymore!" + "

It will be removed from the list.").arg(fn)); + + for (int i = 0; i < recentProjects.size(); i++){ + if (QDir::toNativeSeparators(recentProjects[i]) == fn){ + recentProjects.removeAt(i); + break; + } + } + updateRecentProjectsList(); + return; + } + + if (!fn.isEmpty()){ + saveSettings();//the recent projects must be saved + #ifdef BROWSER_PLUGIN + if (isProjectFile(fn)) + closeProject(); + open (fn, false, false); + #else + bool isSaved = saved; + ApplicationWindow * a = open (fn); + if (a){ + if (isSaved) + savedProject();//force saved state + if (isProjectFile(fn)) + close(); + else + modifiedProject(); + } + #endif + } +} + +ApplicationWindow* ApplicationWindow::openProject(const QString& fn, bool factorySettings, bool newProject) +{ + ApplicationWindow *app = this; + if (newProject) + app = new ApplicationWindow(factorySettings); + + app->projectname = fn; + app->d_file_version = d_file_version; + app->setWindowTitle(tr("QtiPlot") + " - " + fn); + app->d_opening_file = true; + app->d_workspace->blockSignals(true); + + QFile f(fn); + QTextStream t( &f ); + t.setEncoding(QTextStream::UnicodeUTF8); + f.open(QIODevice::ReadOnly); + + QFileInfo fi(fn); + QString baseName = fi.fileName(); + + t.readLine(); + if (d_file_version < 73) + t.readLine(); + + QString s = t.readLine(); + QStringList list=s.split("\t", QString::SkipEmptyParts); + if (list[0] == "") + { + if (!app->setScriptingLanguage(list[1])) + QMessageBox::warning(app, tr("QtiPlot - File opening error"), + tr("The file \"%1\" was created using \"%2\" as scripting language.\n\n"\ + "Initializing support for this language FAILED; I'm using \"%3\" instead.\n"\ + "Various parts of this file may not be displayed as expected.")\ + .arg(fn).arg(list[1]).arg(scriptEnv->name())); + + s = t.readLine(); + list=s.split("\t", QString::SkipEmptyParts); + } + int aux=0,widgets=list[1].toInt(); + + QString titleBase = tr("Window") + ": "; + QString title = titleBase + "1/" + QString::number(widgets) + " "; + + QProgressDialog progress(app); + progress.setWindowModality(Qt::WindowModal); + progress.setRange(0, widgets); + progress.setMinimumWidth(app->width()/2); + progress.setWindowTitle(tr("QtiPlot - Opening file") + ": " + baseName); + progress.setLabelText(title); + + Folder *cf = app->projectFolder(); + app->folders->blockSignals (true); + app->blockSignals (true); + + //rename project folder item + FolderListItem *item = (FolderListItem *)app->folders->firstChild(); + item->setText(0, fi.baseName()); + item->folder()->setObjectName(fi.baseName()); + + //process tables and matrix information + while ( !t.atEnd() && !progress.wasCanceled()){ + s = t.readLine(); + list.clear(); + if (s.left(8) == ""){ + list = s.split("\t"); + Folder *f = new Folder(app->current_folder, list[1]); + f->setBirthDate(list[2]); + f->setModificationDate(list[3]); + if(list.count() > 4) + if (list[4] == "current") + cf = f; + + FolderListItem *fli = new FolderListItem(app->current_folder->folderListItem(), f); + f->setFolderListItem(fli); + + app->current_folder = f; + } else if (s.contains("")) { + app->current_folder->folderListItem()->setOpen(s.remove("").remove("").toInt()); + } else if (s == "

") { + title = titleBase + QString::number(++aux)+"/"+QString::number(widgets); + progress.setLabelText(title); + QStringList lst; + while ( s!="
" ){ + s=t.readLine(); + lst<") { + QStringList lst; + while ( s!="" ){ + s=t.readLine(); + lst<openTableStatistics(lst); + } else if (s == "") { + title= titleBase + QString::number(++aux)+"/"+QString::number(widgets); + progress.setLabelText(title); + QStringList lst; + while ( s != "" ) { + s=t.readLine(); + lst<") { + title= titleBase + QString::number(++aux)+"/"+QString::number(widgets); + progress.setLabelText(title); + for (int i=0; i<3; i++){ + s = t.readLine(); + list << s; + } + Note* m = openNote(app,list); + QStringList cont; + while ( s != "" ){ + s = t.readLine(); + cont << s; + } + cont.pop_back(); + m->restore(cont); + progress.setValue(aux); + } else if (s == "
") + app->goToParentFolder(); + } + f.close(); + + if (progress.wasCanceled()){ + app->saved = true; + app->close(); + return 0; + } + + //process the rest + f.open(QIODevice::ReadOnly); + + MultiLayer *plot=0; + while ( !t.atEnd() && !progress.wasCanceled()){ + s=t.readLine(); + if (s.left(8) == ""){ + list = s.split("\t"); + if (app->current_folder && list.size() >= 2) + app->current_folder = app->current_folder->findSubfolder(list[1]); + } else if (s == ""){//process multilayers information + title = titleBase + QString::number(++aux) + "/" + QString::number(widgets); + progress.setLabelText(title); + + s = t.readLine(); + QStringList graph = s.split("\t"); + QString caption = graph[0]; + + plot = app->multilayerPlot(caption, 0, graph[2].toInt(), graph[1].toInt()); + + app->setListViewDate(caption, graph[3]); + plot->setBirthDate(graph[3]); + + restoreWindowGeometry(app, plot, t.readLine()); + plot->blockSignals(true); + + if (d_file_version > 71){ + QStringList lst=t.readLine().split("\t"); + plot->setWindowLabel(lst[1]); + plot->setCaptionPolicy((MdiSubWindow::CaptionPolicy)lst[2].toInt()); + } + if (d_file_version > 83){ + QStringList lst=t.readLine().split("\t", QString::SkipEmptyParts); + plot->setMargins(lst[1].toInt(),lst[2].toInt(),lst[3].toInt(),lst[4].toInt()); + lst=t.readLine().split("\t", QString::SkipEmptyParts); + plot->setSpacing(lst[1].toInt(),lst[2].toInt()); + lst=t.readLine().split("\t", QString::SkipEmptyParts); + plot->setLayerCanvasSize(lst[1].toInt(),lst[2].toInt()); + lst=t.readLine().split("\t", QString::SkipEmptyParts); + plot->setAlignement(lst[1].toInt(),lst[2].toInt()); + } + + while ( s != "" ){//open layers + s = t.readLine(); + if (s.contains("")){ + QStringList lst = s.trimmed().remove("").remove("").split(","); + if (lst.size() >= 2) + plot->setWaterfallOffset(lst[0].toInt(), lst[1].toInt()); + if (lst.size() >= 3) + plot->setWaterfallSideLines(lst[2].toInt()); + plot->createWaterfallBox(); + } + + if (s.left(7) == ""){ + list.clear(); + while ( s != "" ){ + s = t.readLine(); + list<")) + plot->linkXLayerAxes(s.trimmed().remove("").remove("").toInt()); + else if (s.contains("")) + plot->setAlignPolicy((MultiLayer::AlignPolicy)s.trimmed().remove("").remove("").toInt()); + } + plot->blockSignals(false); + progress.setValue(aux); + } else if (s == "") {//process 3D plots information + list.clear(); + title = titleBase + QString::number(++aux)+"/"+QString::number(widgets); + progress.setLabelText(title); + while ( s != "" ){ + s = t.readLine(); + list << s; + } + Graph3D::restore(app, list, d_file_version); + progress.setValue(aux); + } else if (s == "") + app->goToParentFolder(); + else if (s == ""){//process analysis information + s = t.readLine(); + QString log = s + "\n"; + while(s != ""){ + s = t.readLine(); + log += s + "\n"; + } + if (app->current_folder) + app->current_folder->appendLogInfo(log.remove("")); + } + } + f.close(); + + if (progress.wasCanceled()){ + app->saved = true; + app->close(); + return 0; + } + + QFileInfo fi2(f); + QString fileName = fi2.absFilePath(); + + app->updateRecentProjectsList(fileName); + + app->folders->setCurrentItem(cf->folderListItem()); + app->folders->blockSignals (false); + app->changeFolder(cf, true);//change folder to user defined current folder + app->blockSignals (false); + app->renamedTables.clear(); + + app->restoreApplicationGeometry(); + app->executeNotes(); + app->savedProject(); + app->d_opening_file = false; + app->d_workspace->blockSignals(false); + app->addWindowsListToCompleter(); + return app; +} + +void ApplicationWindow::executeNotes() +{ + QList lst = projectFolder()->windowsList(); + foreach(MdiSubWindow *widget, lst) + if (widget->isA("Note") && ((Note*)widget)->autoexec()) + ((Note*)widget)->executeAll(); +} + +void ApplicationWindow::scriptError(const QString &message, const QString &scriptName, int lineNumber) +{ + Q_UNUSED(scriptName); + Q_UNUSED(lineNumber); + + QMessageBox::critical(this, tr("QtiPlot") + " - "+ tr("Script Error"), message); +} + +void ApplicationWindow::scriptPrint(const QString &text) +{ +#ifdef SCRIPTING_CONSOLE + if(!text.stripWhiteSpace().isEmpty()) console->append(text); +#else + printf(text.ascii()); +#endif +} + +bool ApplicationWindow::setScriptingLanguage(const QString &lang, bool force) +{ + if (!force && lang == scriptEnv->name())return true; + if (lang.isEmpty()) return false; + + ScriptingEnv *newEnv = ScriptingLangManager::newEnv(lang, this); + if (!newEnv) + return false; + + connect(newEnv, SIGNAL(error(const QString&,const QString&,int)), + this, SLOT(scriptError(const QString&,const QString&,int))); + connect(newEnv, SIGNAL(print(const QString&)), this, SLOT(scriptPrint(const QString&))); + if (!newEnv->initialize()){ + delete newEnv; + return false; + } + + // notify everyone who might be interested + ScriptingChangeEvent *sce = new ScriptingChangeEvent(newEnv); + QApplication::sendEvent(this, sce); + delete sce; + + initCompleter(); + + foreach(QObject *i, findChildren()) + QApplication::postEvent(i, new ScriptingChangeEvent(newEnv)); + if (scriptWindow) + foreach(QObject *i, scriptWindow->findChildren()) + QApplication::postEvent(i, new ScriptingChangeEvent(newEnv)); + +#ifdef SCRIPTING_PYTHON + bool python = (lang == QString("Python")); + actionCommentSelection->setEnabled(python); + actionUncommentSelection->setEnabled(python); +#endif + + return true; +} + +void ApplicationWindow::showScriptingLangDialog() +{ + ScriptingLangDialog* d = new ScriptingLangDialog(scriptEnv, this); + d->exec(); +} + +void ApplicationWindow::restartScriptingEnv() +{ + if (setScriptingLanguage(scriptEnv->name(), true)) + executeNotes(); + else + QMessageBox::critical(this, tr("QtiPlot - Scripting Error"), + tr("Scripting language \"%1\" failed to initialize.").arg(scriptEnv->name())); +} + +void ApplicationWindow::openTemplate() +{ + QString filter = "QtiPlot 2D Graph Template (*.qpt);;"; + filter += "QtiPlot 3D Surface Template (*.qst);;"; + filter += "QtiPlot Table Template (*.qtt);;"; + filter += "QtiPlot Matrix Template (*.qmt);;"; + + QString fn = getFileName(this, tr("QtiPlot - Open Template File"), templatesDir, filter, 0, false); + if (!fn.isEmpty()){ + QFileInfo fi(fn); + templatesDir = fi.dirPath(true); + if (fn.contains(".qmt") || fn.contains(".qpt") || fn.contains(".qtt") || fn.contains(".qst")) + openTemplate(fn); + else { + QMessageBox::critical(this,tr("QtiPlot - File opening error"), + tr("The file: %1 is not a QtiPlot template file!").arg(fn)); + return; + } + } +} + +MdiSubWindow* ApplicationWindow::openTemplate(const QString& fn) +{ + if (fn.isEmpty() || !QFile::exists(fn)){ + QMessageBox::critical(this, tr("QtiPlot - File opening error"), + tr("The file: %1 doesn't exist!").arg(fn)); + return 0; + } + + QFile f(fn); + QTextStream t(&f); + t.setEncoding(QTextStream::UnicodeUTF8); + f.open(QIODevice::ReadOnly); + QStringList l=t.readLine().split(QRegExp("\\s"), QString::SkipEmptyParts); + QString fileType=l[0]; + if (fileType != "QtiPlot"){ + QMessageBox::critical(this,tr("QtiPlot - File opening error"), + tr("The file: %1 was not created using QtiPlot!").arg(fn)); + return 0; + } + + QStringList vl = l[1].split(".", QString::SkipEmptyParts); + d_file_version = 100*(vl[0]).toInt()+10*(vl[1]).toInt()+(vl[2]).toInt(); + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + MdiSubWindow *w = 0; + QString templateType; + t>>templateType; + + if (templateType == "") { + t.skipWhiteSpace(); + QStringList lst; + while (!t.atEnd()) + lst << t.readLine(); + w = Graph3D::restore(this, lst, d_file_version); + if (w) + ((Graph3D *)w)->clearData(); + } else { + int rows, cols; + t>>rows; t>>cols; + t.skipWhiteSpace(); + QString geometry = t.readLine(); + + if (templateType == ""){ + w = multilayerPlot(generateUniqueName(tr("Graph")), 0, rows, cols); + if (w){ + MultiLayer *ml = qobject_cast(w); + restoreWindowGeometry(this, w, geometry); + if (d_file_version > 83){ + QStringList lst=t.readLine().split("\t", QString::SkipEmptyParts); + ml->setMargins(lst[1].toInt(),lst[2].toInt(),lst[3].toInt(),lst[4].toInt()); + lst=t.readLine().split("\t", QString::SkipEmptyParts); + ml->setSpacing(lst[1].toInt(),lst[2].toInt()); + lst=t.readLine().split("\t", QString::SkipEmptyParts); + ml->setLayerCanvasSize(lst[1].toInt(),lst[2].toInt()); + lst=t.readLine().split("\t", QString::SkipEmptyParts); + ml->setAlignement(lst[1].toInt(),lst[2].toInt()); + } + while (!t.atEnd()){//open layers + QString s = t.readLine(); + if (s.contains("")){ + QStringList lst = s.trimmed().remove("").remove("").split(","); + if (lst.size() >= 2) + ml->setWaterfallOffset(lst[0].toInt(), lst[1].toInt()); + if (lst.size() >= 3) + ml->setWaterfallSideLines(lst[2].toInt()); + ml->createWaterfallBox(); + } + if (s.left(7) == ""){ + QStringList lst; + while ( s != "" ){ + s = t.readLine(); + lst << s; + } + openGraph(this, ml, lst); + } + if (s.contains("")) + ml->linkXLayerAxes(s.trimmed().remove("").remove("").toInt()); + else if (s.contains("")) + ml->setAlignPolicy((MultiLayer::AlignPolicy)s.trimmed().remove("").remove("").toInt()); + } + } + } else { + if (templateType == "") + w = newTable(tr("Table1"), rows, cols); + else if (templateType == "") + w = newMatrix(rows, cols); + if (w){ + QStringList lst; + while (!t.atEnd()) + lst << t.readLine(); + w->restore(lst); + restoreWindowGeometry(this, w, geometry); + } + } + } + + f.close(); + if (w){ + w->show(); + customMenu(w); + customToolBars(w); + } + + QApplication::restoreOverrideCursor(); + return w; +} + +void ApplicationWindow::readSettings() +{ +#ifdef Q_OS_MAC // Mac + QSettings settings(QSettings::IniFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); +#else + QSettings settings(QSettings::NativeFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); +#endif + + /* ---------------- group General --------------- */ + settings.beginGroup("/General"); + settings.beginGroup("/ApplicationGeometry");//main window geometry + d_app_rect = QRect(settings.value("/x", 0).toInt(), settings.value("/y", 0).toInt(), + settings.value("/width", 0).toInt(), settings.value("/height", 0).toInt()); + settings.endGroup(); + + autoSearchUpdates = settings.value("/AutoSearchUpdates", false).toBool(); + appLanguage = settings.value("/Language", QLocale::system().name().section('_',0,0)).toString(); + show_windows_policy = (ShowWindowsPolicy)settings.value("/ShowWindowsPolicy", ApplicationWindow::ActiveFolder).toInt(); + + recentProjects = settings.value("/RecentProjects").toStringList(); + //Follows an ugly hack added by Ion in order to fix Qt4 porting issues + //(only needed on Windows due to a Qt bug?) +#ifdef Q_OS_WIN + if (!recentProjects.isEmpty() && recentProjects[0].contains("^e")) + recentProjects = recentProjects[0].split("^e", QString::SkipEmptyParts); + else if (recentProjects.count() == 1){ + QString s = recentProjects[0]; + if (s.remove(QRegExp("\\s")).isEmpty()) + recentProjects = QStringList(); + } +#endif + + updateRecentProjectsList(); + + changeAppStyle(settings.value("/Style", appStyle).toString()); + autoSave = settings.value("/AutoSave",true).toBool(); + autoSaveTime = settings.value("/AutoSaveTime",15).toInt(); + d_backup_files = settings.value("/BackupProjects", true).toBool(); + d_init_window_type = (WindowType)settings.value("/InitWindow", TableWindow).toInt(); + d_completion = settings.value("/Completion", true).toBool(); + defaultScriptingLang = settings.value("/ScriptingLang","muParser").toString(); + + bool thousandsSep = settings.value("/ThousandsSeparator", true).toBool(); + QLocale loc = QLocale(settings.value("/Locale", QLocale::system().name()).toString()); + if (!thousandsSep) + loc.setNumberOptions(QLocale::OmitGroupSeparator); + setLocale(loc); + QLocale::setDefault(loc); + + d_decimal_digits = settings.value("/DecimalDigits", 13).toInt(); + d_clipboard_locale = QLocale(settings.value("/ClipboardLocale", QLocale::system().name()).toString()); + d_muparser_c_locale = settings.value("/MuParserCLocale", true).toBool(); + + d_matrix_undo_stack_size = settings.value("/MatrixUndoStackSize", 10).toInt(); + d_eol = (EndLineChar)settings.value("/EndOfLine", d_eol).toInt(); + + //restore dock windows and tool bars + restoreState(settings.value("/DockWindows").toByteArray()); + explorerSplitter->restoreState(settings.value("/ExplorerSplitter").toByteArray()); + QList lst = explorerSplitter->sizes(); + for (int i=0; i< lst.count(); i++){ + if (lst[i] == 0){ + lst[i] = 45; + explorerSplitter->setSizes(lst); + } + } + + QStringList applicationFont = settings.value("/Font").toStringList(); + if (applicationFont.size() == 4) + appFont=QFont (applicationFont[0],applicationFont[1].toInt(),applicationFont[2].toInt(),applicationFont[3].toInt()); + + QStringList colors = settings.value("/IndexedColors").toStringList(); + if (!colors.isEmpty()){ + d_indexed_colors.clear(); + for (int i = 0; i < colors.size(); i++) + d_indexed_colors << QColor(colors[i]); + } + d_indexed_color_names = settings.value("/IndexedColorNames", d_indexed_color_names).toStringList(); + + QStringList symbols = settings.value("/IndexedSymbolsList").toStringList(); + if (!symbols.isEmpty()){ + d_symbols_list.clear(); + for (int i = 0; i < symbols.size(); i++) + d_symbols_list << symbols[i].toInt(); + } + + settings.beginGroup("/Dialogs"); + d_extended_open_dialog = settings.value("/ExtendedOpenDialog", true).toBool(); + d_extended_export_dialog = settings.value("/ExtendedExportDialog", true).toBool(); + d_extended_import_ASCII_dialog = settings.value("/ExtendedImportAsciiDialog", true).toBool(); + d_extended_plot_dialog = settings.value("/ExtendedPlotDialog", true).toBool();//used by PlotDialog + + settings.beginGroup("/AddRemoveCurves"); + d_add_curves_dialog_size = QSize(settings.value("/Width", 700).toInt(), settings.value("/Height", 400).toInt()); + d_show_current_folder = settings.value("/ShowCurrentFolder", false).toBool(); + settings.endGroup(); // AddRemoveCurves Dialog + settings.endGroup(); // Dialogs + + settings.beginGroup("/Colors"); + workspaceColor = settings.value("/Workspace","darkGray").value(); + // see http://doc.trolltech.com/4.2/qvariant.html for instructions on qcolor <-> qvariant conversion + panelsColor = settings.value("/Panels","#ffffff").value(); + panelsTextColor = settings.value("/PanelsText","#000000").value(); + settings.endGroup(); // Colors + + settings.beginGroup("/Paths"); + QString appPath = qApp->applicationDirPath(); + workingDir = settings.value("/WorkingDir", appPath).toString(); +#ifdef Q_OS_WIN + fitPluginsPath = settings.value("/FitPlugins", "fitPlugins").toString(); + templatesDir = settings.value("/TemplatesDir", appPath).toString(); + asciiDirPath = settings.value("/ASCII", appPath).toString(); + imagesDirPath = settings.value("/Images", appPath).toString(); +#else + fitPluginsPath = settings.value("/FitPlugins", "/usr/lib/qtiplot/plugins").toString(); + templatesDir = settings.value("/TemplatesDir", QDir::homePath()).toString(); + asciiDirPath = settings.value("/ASCII", QDir::homePath()).toString(); + imagesDirPath = settings.value("/Images", QDir::homePath()).toString(); + workingDir = settings.value("/WorkingDir", QDir::homePath()).toString(); +#endif + scriptsDirPath = settings.value("/ScriptsDir", appPath).toString(); + fitModelsPath = settings.value("/FitModelsDir", "").toString(); + customActionsDirPath = settings.value("/CustomActionsDir", "").toString(); + helpFilePath = settings.value("/HelpFile", helpFilePath).toString(); + d_translations_folder = settings.value("/Translations", d_translations_folder).toString(); + d_python_config_folder = settings.value("/PythonConfigDir", d_python_config_folder).toString(); + d_latex_compiler_path = settings.value("/LaTeXCompiler", d_latex_compiler_path).toString(); + settings.endGroup(); // Paths + + d_open_project_filter = settings.value("/OpenProjectFilter", d_open_project_filter).toString(); + d_latex_compiler = settings.value("/TeXCompilerPolicy", d_latex_compiler).toInt(); + settings.endGroup(); + /* ------------- end group General ------------------- */ + + settings.beginGroup("/UserFunctions"); + if (100*maj_version + 10*min_version + patch_version == 91 && + settings.contains("/FitFunctions")){ + saveFitFunctions(settings.value("/FitFunctions").toStringList()); + settings.remove("/FitFunctions"); + } + surfaceFunc = settings.value("/SurfaceFunctions").toStringList(); + xFunctions = settings.value("/xFunctions").toStringList(); + yFunctions = settings.value("/yFunctions").toStringList(); + rFunctions = settings.value("/rFunctions").toStringList(); + thetaFunctions = settings.value("/thetaFunctions").toStringList(); + d_param_surface_func = settings.value("/ParametricSurfaces").toStringList(); + d_recent_functions = settings.value("/Functions").toStringList(); + settings.endGroup(); // UserFunctions + + settings.beginGroup("/Confirmations"); + confirmCloseFolder = settings.value("/Folder", true).toBool(); + confirmCloseTable = settings.value("/Table", true).toBool(); + confirmCloseMatrix = settings.value("/Matrix", true).toBool(); + confirmClosePlot2D = settings.value("/Plot2D", true).toBool(); + confirmClosePlot3D = settings.value("/Plot3D", true).toBool(); + confirmCloseNotes = settings.value("/Note", true).toBool(); + d_inform_rename_table = settings.value("/RenameTable", true).toBool(); + d_confirm_overwrite = settings.value("/Overwrite", true).toBool(); + settings.endGroup(); // Confirmations + + + /* ---------------- group Tables --------------- */ + settings.beginGroup("/Tables"); + d_show_table_comments = settings.value("/DisplayComments", false).toBool(); + d_auto_update_table_values = settings.value("/AutoUpdateValues", true).toBool(); + + QStringList tableFonts = settings.value("/Fonts").toStringList(); + if (tableFonts.size() == 8) + { + tableTextFont=QFont (tableFonts[0],tableFonts[1].toInt(),tableFonts[2].toInt(),tableFonts[3].toInt()); + tableHeaderFont=QFont (tableFonts[4],tableFonts[5].toInt(),tableFonts[6].toInt(),tableFonts[7].toInt()); + } + + settings.beginGroup("/Colors"); + tableBkgdColor = settings.value("/Background","#ffffff").value(); + tableTextColor = settings.value("/Text","#000000").value(); + tableHeaderColor = settings.value("/Header","#000000").value(); + settings.endGroup(); // Colors + settings.endGroup(); + /* --------------- end group Tables ------------------------ */ + + /* --------------- group 2D Plots ----------------------------- */ + settings.beginGroup("/2DPlots"); + settings.beginGroup("/General"); + titleOn = settings.value("/Title", true).toBool(); + canvasFrameWidth = settings.value("/CanvasFrameWidth", 0).toInt(); + defaultPlotMargin = settings.value("/Margin", 0).toInt(); + drawBackbones = settings.value("/AxesBackbones", true).toBool(); + axesLineWidth = settings.value("/AxesLineWidth", 1).toInt(); + autoscale2DPlots = settings.value("/Autoscale", true).toBool(); + autoScaleFonts = settings.value("/AutoScaleFonts", true).toBool(); + autoResizeLayers = settings.value("/AutoResizeLayers", true).toBool(); + antialiasing2DPlots = settings.value("/Antialiasing", antialiasing2DPlots).toBool(); + d_scale_plots_on_print = settings.value("/ScaleLayersOnPrint", false).toBool(); + d_print_cropmarks = settings.value("/PrintCropmarks", false).toBool(); + d_layer_geometry_unit = settings.value("/GeometryUnit", d_layer_geometry_unit).toInt(); + d_layer_canvas_width = settings.value("/LayerCanvasWidth", d_layer_canvas_width).toInt(); + d_layer_canvas_height = settings.value("/LayerCanvasHeight", d_layer_canvas_height).toInt(); + + QStringList graphFonts = settings.value("/Fonts").toStringList(); + if (graphFonts.size() == 16) { + plotAxesFont=QFont (graphFonts[0],graphFonts[1].toInt(),graphFonts[2].toInt(),graphFonts[3].toInt()); + plotNumbersFont=QFont (graphFonts[4],graphFonts[5].toInt(),graphFonts[6].toInt(),graphFonts[7].toInt()); + plotLegendFont=QFont (graphFonts[8],graphFonts[9].toInt(),graphFonts[10].toInt(),graphFonts[11].toInt()); + plotTitleFont=QFont (graphFonts[12],graphFonts[13].toInt(),graphFonts[14].toInt(),graphFonts[15].toInt()); + } + d_in_place_editing = settings.value("/InPlaceEditing", true).toBool(); + d_graph_background_color = settings.value("/BackgroundColor", d_graph_background_color).value(); + d_graph_canvas_color = settings.value("/CanvasColor", d_graph_canvas_color).value(); + d_graph_border_color = settings.value("/FrameColor", d_graph_border_color).value(); + d_graph_background_opacity = settings.value("/BackgroundOpacity", d_graph_background_opacity).toInt(); + d_graph_canvas_opacity = settings.value("/BackgroundOpacity", d_graph_canvas_opacity).toInt(); + d_graph_border_width = settings.value("/FrameWidth", d_graph_border_width).toInt(); + d_canvas_frame_color = settings.value("/FrameColor", Qt::black).value(); + d_graph_axes_labels_dist = settings.value("/LabelsAxesDist", d_graph_axes_labels_dist).toInt(); + d_graph_tick_labels_dist = settings.value("/TickLabelsDist", d_graph_tick_labels_dist).toInt(); + int size = settings.beginReadArray("EnabledAxes"); + for (int i = 0; i < size; ++i) { + settings.setArrayIndex(i); + d_show_axes[i] = settings.value("enabled", true).toBool(); + d_show_axes_labels[i] = settings.value("labels", true).toBool(); + } + settings.endArray(); + d_graph_legend_display = (Graph::LegendDisplayMode)settings.value("/LegendDisplayMode", d_graph_legend_display).toInt(); + d_graph_axis_labeling = (Graph::AxisTitlePolicy)settings.value("/AxisTitlePolicy", d_graph_axis_labeling).toInt(); + d_keep_aspect_ration = settings.value("/KeepAspectRatio", d_keep_aspect_ration).toBool(); + d_synchronize_graph_scales = settings.value("/SynchronizeScales", d_synchronize_graph_scales).toBool(); + settings.endGroup(); // General + + settings.beginGroup("/Curves"); + defaultCurveStyle = settings.value("/Style", Graph::LineSymbols).toInt(); + defaultCurveLineWidth = settings.value("/LineWidth", 1).toDouble(); + d_curve_line_style = settings.value("/LineType", d_curve_line_style).toInt(); + defaultSymbolSize = settings.value("/SymbolSize", 7).toInt(); + defaultSymbolEdge = settings.value("/SymbolEdge", defaultSymbolEdge).toDouble(); + d_fill_symbols = settings.value("/FillSymbols", d_fill_symbols).toBool(); + d_symbol_style = settings.value("/SymbolStyle", d_symbol_style).toInt(); + d_indexed_symbols = settings.value("/IndexedSymbols", d_indexed_symbols).toBool(); + defaultCurveBrush = settings.value("/BrushStyle", defaultCurveBrush).toInt(); + defaultCurveAlpha = settings.value("/BrushAlpha", defaultCurveAlpha).toInt(); + settings.endGroup(); // Curves + + settings.beginGroup("/Ticks"); + majTicksStyle = settings.value("/MajTicksStyle", ScaleDraw::Out).toInt(); + minTicksStyle = settings.value("/MinTicksStyle", ScaleDraw::Out).toInt(); + minTicksLength = settings.value("/MinTicksLength", 5).toInt(); + majTicksLength = settings.value("/MajTicksLength", 9).toInt(); + settings.endGroup(); // Ticks + + settings.beginGroup("/Legend"); + legendFrameStyle = settings.value("/FrameStyle", LegendWidget::Line).toInt(); + d_frame_widget_pen.setColor(settings.value("/FrameColor", Qt::black).value()); + d_frame_widget_pen.setWidthF(settings.value("/FrameWidth", 1).toDouble()); + d_frame_widget_pen.setStyle(PenStyleBox::penStyle(settings.value("/FramePenStyle", 0).toInt())); + + legendTextColor = settings.value("/TextColor", "#000000").value(); //default color Qt::black + legendBackground = settings.value("/BackgroundColor", Qt::white).value(); //default color Qt::white + legendBackground.setAlpha(settings.value("/Transparency", 0).toInt()); // transparent by default; + d_legend_default_angle = settings.value("/Angle", 0).toInt(); + d_frame_geometry_unit = settings.value("/DefaultGeometryUnit", FrameWidget::Scale).toInt(); + settings.endGroup(); // Legend + + settings.beginGroup("/Arrows"); + defaultArrowLineWidth = settings.value("/Width", 1).toDouble(); + defaultArrowColor = settings.value("/Color", "#000000").value();//default color Qt::black + defaultArrowHeadLength = settings.value("/HeadLength", 4).toInt(); + defaultArrowHeadAngle = settings.value("/HeadAngle", 45).toInt(); + defaultArrowHeadFill = settings.value("/HeadFill", true).toBool(); + defaultArrowLineStyle = Graph::getPenStyle(settings.value("/LineStyle", "SolidLine").toString()); + settings.endGroup(); // Arrows + + settings.beginGroup("/Rectangle"); + d_rect_default_background = settings.value("/BackgroundColor", Qt::white).value(); + d_rect_default_background.setAlpha(settings.value("/Transparency", 255).toInt()); + + d_rect_default_brush.setColor(settings.value("/BrushColor", d_rect_default_brush).value()); + d_rect_default_brush.setStyle(PatternBox::brushStyle(settings.value("/Pattern", 0).toInt())); + settings.endGroup(); // Rectangle + settings.endGroup(); + /* ----------------- end group 2D Plots --------------------------- */ + + /* ----------------- group 3D Plots --------------------------- */ + settings.beginGroup("/3DPlots"); + d_3D_legend = settings.value("/Legend",true).toBool(); + d_3D_projection = settings.value("/Projection", d_3D_projection).toInt(); + d_3D_smooth_mesh = settings.value("/Antialiasing", true).toBool(); + d_3D_resolution = settings.value ("/Resolution", 1).toInt(); + d_3D_orthogonal = settings.value("/Orthogonal", false).toBool(); + d_3D_autoscale = settings.value ("/Autoscale", true).toBool(); + + QStringList plot3DFonts = settings.value("/Fonts").toStringList(); + if (plot3DFonts.size() == 12){ + d_3D_title_font=QFont (plot3DFonts[0],plot3DFonts[1].toInt(),plot3DFonts[2].toInt(),plot3DFonts[3].toInt()); + d_3D_numbers_font=QFont (plot3DFonts[4],plot3DFonts[5].toInt(),plot3DFonts[6].toInt(),plot3DFonts[7].toInt()); + d_3D_axes_font=QFont (plot3DFonts[8],plot3DFonts[9].toInt(),plot3DFonts[10].toInt(),plot3DFonts[11].toInt()); + } + + settings.beginGroup("/Colors"); + QColor max_color = settings.value("/MaxData", Qt::red).value(); + d_3D_labels_color = settings.value("/Labels", d_3D_labels_color).value(); + d_3D_mesh_color = settings.value("/Mesh", d_3D_mesh_color).value(); + QColor min_color = settings.value("/MinData", Qt::blue).value(); + d_3D_numbers_color = settings.value("/Numbers", d_3D_numbers_color).value(); + d_3D_axes_color = settings.value("/Axes", d_3D_axes_color).value(); + d_3D_background_color = settings.value("/Background", d_3D_background_color).value(); + + d_3D_color_map = QwtLinearColorMap(min_color, max_color); + d_3D_color_map.setMode((QwtLinearColorMap::Mode)settings.value("/ColorMapMode", QwtLinearColorMap::ScaledColors).toInt()); + QList stop_values = settings.value("/ColorMapStops").toList(); + QStringList stop_colors = settings.value("/ColorMapColors").toStringList(); + for (int i = 0; i < stop_colors.size(); i++) + d_3D_color_map.addColorStop(stop_values[i].toDouble(), QColor(stop_colors[i])); + + settings.endGroup(); // Colors + + settings.beginGroup("/Grids"); + d_3D_major_grids = settings.value("/EnableMajor", d_3D_major_grids).toBool(); + d_3D_grid_color = settings.value("/MajorColor", d_3D_grid_color).value(); + d_3D_major_style = settings.value("/MajorStyle", d_3D_major_style).toInt(); + d_3D_major_width = settings.value("/MajorWidth", d_3D_major_width).toDouble(); + + d_3D_minor_grids = settings.value("/EnableMinor", d_3D_minor_grids).toBool(); + d_3D_minor_grid_color = settings.value("/MinorColor", d_3D_minor_grid_color).value(); + d_3D_minor_style = settings.value("/MinorStyle", d_3D_minor_style).toInt(); + d_3D_minor_width = settings.value("/MinorWidth", d_3D_minor_width).toDouble(); + settings.endGroup(); // Grids + + settings.endGroup(); + /* ----------------- end group 3D Plots --------------------------- */ + + settings.beginGroup("/Fitting"); + fit_output_precision = settings.value("/OutputPrecision", 15).toInt(); + pasteFitResultsToPlot = settings.value("/PasteResultsToPlot", false).toBool(); + writeFitResultsToLog = settings.value("/WriteResultsToLog", true).toBool(); + generateUniformFitPoints = settings.value("/GenerateFunction", true).toBool(); + fitPoints = settings.value("/Points", 100).toInt(); + generatePeakCurves = settings.value("/GeneratePeakCurves", true).toBool(); + peakCurvesColor = QColor(settings.value("/PeakColor", peakCurvesColor.name()).toString());//green color + fit_scale_errors = settings.value("/ScaleErrors", true).toBool(); + d_2_linear_fit_points = settings.value("/TwoPointsLinearFit", true).toBool(); + d_multi_peak_messages = settings.value("/MultiPeakToolMsg", d_multi_peak_messages).toBool(); + settings.endGroup(); // Fitting + + settings.beginGroup("/ImportASCII"); + columnSeparator = settings.value("/ColumnSeparator", "\\t").toString(); + columnSeparator.replace("\\t", "\t").replace("\\s", " "); + ignoredLines = settings.value("/IgnoreLines", 0).toInt(); + renameColumns = settings.value("/RenameColumns", true).toBool(); + strip_spaces = settings.value("/StripSpaces", false).toBool(); + simplify_spaces = settings.value("/SimplifySpaces", false).toBool(); + d_ASCII_file_filter = settings.value("/AsciiFileTypeFilter", "*").toString(); + d_ASCII_import_locale = settings.value("/AsciiImportLocale", QLocale::system().name()).toString(); + if (settings.value("/OmitGroupSeparator", false).toBool()) + d_ASCII_import_locale.setNumberOptions(QLocale::OmitGroupSeparator); + + d_ASCII_import_mode = settings.value("/ImportMode", ImportASCIIDialog::NewTables).toInt(); + d_ASCII_comment_string = settings.value("/CommentString", "#").toString(); + d_ASCII_import_comments = settings.value("/ImportComments", false).toBool(); + d_ASCII_import_read_only = settings.value("/ImportReadOnly", false).toBool(); + d_ASCII_import_preview = settings.value("/Preview", true).toBool(); + d_preview_lines = settings.value("/PreviewLines", 100).toInt(); + d_ASCII_end_line = (EndLineChar)settings.value("/EndLineCharacter", d_ASCII_end_line).toInt(); + d_ASCII_import_first_row_role = settings.value("/FirstLineRole", 0).toInt(); + d_import_ASCII_dialog_size = settings.value("/DialogSize", d_import_ASCII_dialog_size).toSize(); + settings.endGroup(); // Import ASCII + + settings.beginGroup("/ExportASCII"); + d_export_col_separator = settings.value("/ColumnSeparator", "\\t").toString(); + d_export_col_separator.replace("\\t", "\t").replace("\\s", " "); + d_export_col_names = settings.value("/ExportLabels", false).toBool(); + d_export_col_comment = settings.value("/ExportComments", false).toBool(); + d_export_table_selection = settings.value("/ExportSelection", false).toBool(); + d_export_ASCII_file_filter = settings.value("/ExportAsciiFilter", d_export_ASCII_file_filter).toString(); + settings.endGroup(); // ExportASCII + + settings.beginGroup("/ExportImage"); + d_image_export_filter = settings.value("/ImageFileTypeFilter", ".png").toString(); + d_export_transparency = settings.value("/ExportTransparency", false).toBool(); + d_export_quality = settings.value("/ImageQuality", 100).toInt(); + d_export_vector_resolution = settings.value("/Resolution", d_export_vector_resolution).toInt(); + d_export_color = settings.value("/ExportColor", true).toBool(); + d_3D_export_text_mode = settings.value("/3DTextMode", d_3D_export_text_mode).toInt(); + d_3D_export_sort = settings.value("/3DSortMode", d_3D_export_sort).toInt(); + d_export_bitmap_resolution = settings.value("/BitmapResolution", d_export_bitmap_resolution).toInt(); + d_export_raster_size = settings.value("/RasterSize", d_export_raster_size).toSizeF(); + d_export_size_unit = settings.value("/SizeUnit", d_export_size_unit).toInt(); + d_scale_fonts_factor = settings.value("/ScaleFontsFactor", d_scale_fonts_factor).toDouble(); + d_export_escape_tex_strings = settings.value("/EscapeTeXStrings", true).toBool(); + d_export_tex_font_sizes = settings.value("/ExportTeXFontSize", true).toBool(); + settings.endGroup(); // ExportImage + + settings.beginGroup("/ScriptWindow"); + d_script_win_on_top = settings.value("/AlwaysOnTop", false).toBool(); + d_script_win_rect = QRect(settings.value("/x", 0).toInt(), settings.value("/y", 0).toInt(), + settings.value("/width", 500).toInt(), settings.value("/height", 300).toInt()); + settings.endGroup(); + + settings.beginGroup("/ToolBars"); + d_file_tool_bar = settings.value("/FileToolBar", true).toBool(); + d_edit_tool_bar = settings.value("/EditToolBar", true).toBool(); + d_table_tool_bar = settings.value("/TableToolBar", true).toBool(); + d_column_tool_bar = settings.value("/ColumnToolBar", true).toBool(); + d_matrix_tool_bar = settings.value("/MatrixToolBar", true).toBool(); + d_plot_tool_bar = settings.value("/PlotToolBar", true).toBool(); + d_plot3D_tool_bar = settings.value("/Plot3DToolBar", true).toBool(); + d_display_tool_bar = settings.value("/DisplayToolBar", false).toBool(); + d_format_tool_bar = settings.value("/FormatToolBar", true).toBool(); + d_notes_tool_bar = settings.value("/NotesToolBar", true).toBool(); + settings.endGroup(); + + settings.beginGroup("/Notes"); + d_note_line_numbers = settings.value("/LineNumbers", true).toBool(); + d_notes_tab_length = settings.value("/TabLength", d_notes_tab_length).toInt(); + d_notes_font.setFamily(settings.value("/FontFamily", d_notes_font.family()).toString()); + d_notes_font.setPointSize(settings.value("/FontSize", d_notes_font.pointSize()).toInt()); + d_notes_font.setBold(settings.value("/FontBold", d_notes_font.bold()).toBool()); + d_notes_font.setItalic(settings.value("/FontItalic", d_notes_font.italic()).toBool()); + + settings.beginGroup("/SyntaxHighlighting"); + d_comment_highlight_color = settings.value("/Comments", d_comment_highlight_color).value(); + d_keyword_highlight_color = settings.value("/Keywords", d_keyword_highlight_color).value(); + d_quotation_highlight_color = settings.value("/Quotations", d_quotation_highlight_color).value(); + d_numeric_highlight_color = settings.value("/Numbers", d_numeric_highlight_color).value(); + d_function_highlight_color = settings.value("/Functions", d_function_highlight_color).value(); + d_class_highlight_color = settings.value("/QtClasses", d_class_highlight_color).value(); + settings.endGroup(); //end group SyntaxHighlighting + settings.endGroup(); // end group Notes + + settings.beginGroup("/PrintPreview"); + d_print_paper_size = (QPrinter::PaperSize)settings.value("/PaperSize", (int)d_print_paper_size).toInt(); + d_printer_orientation = (QPrinter::Orientation)settings.value("/Orientation", (int)d_printer_orientation).toInt(); + settings.endGroup();//PrintPreview + + settings.beginGroup("/Proxy"); + QNetworkProxy proxy; + proxy.setType(QNetworkProxy::NoProxy); + proxy.setHostName(settings.value("/Host", QString()).toString()); + proxy.setPort(settings.value("/Port", 8080).toInt()); + proxy.setUser(settings.value("/Username", QString()).toString()); + settings.endGroup(); + QNetworkProxy::setApplicationProxy(proxy); +} + +void ApplicationWindow::saveSettings() +{ +#ifdef Q_OS_MAC // Mac + QSettings settings(QSettings::IniFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); +#else + QSettings settings(QSettings::NativeFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); +#endif + + /* ---------------- group General --------------- */ + settings.beginGroup("/General"); + + settings.beginGroup("/ApplicationGeometry"); + d_app_rect = QRect(this->pos(), this->size()); + if (this->isMaximized()) + d_app_rect = QRect(); + + settings.setValue("/x", d_app_rect.x()); + settings.setValue("/y", d_app_rect.y()); + settings.setValue("/width", d_app_rect.width()); + settings.setValue("/height", d_app_rect.height()); + settings.endGroup(); + + settings.setValue("/AutoSearchUpdates", autoSearchUpdates); + settings.setValue("/Language", appLanguage); + settings.setValue("/ShowWindowsPolicy", show_windows_policy); + settings.setValue("/RecentProjects", recentProjects); + settings.setValue("/Style", appStyle); + settings.setValue("/AutoSave", autoSave); + settings.setValue("/AutoSaveTime", autoSaveTime); + settings.setValue("/BackupProjects", d_backup_files); + settings.setValue("/InitWindow", int(d_init_window_type)); + settings.setValue("/Completion", d_completion); + settings.setValue("/ScriptingLang", defaultScriptingLang); + + bool thousandsSep = (locale().numberOptions() & QLocale::OmitGroupSeparator) ? false : true; + settings.setValue("/ThousandsSeparator", thousandsSep); + + settings.setValue("/Locale", locale().name()); + settings.setValue("/DecimalDigits", d_decimal_digits); + settings.setValue("/ClipboardLocale", d_clipboard_locale.name()); + settings.setValue("/MuParserCLocale", d_muparser_c_locale); + + settings.setValue("/MatrixUndoStackSize", d_matrix_undo_stack_size); + settings.setValue("/EndOfLine", (int)d_eol); + settings.setValue("/DockWindows", saveState()); + settings.setValue("/ExplorerSplitter", explorerSplitter->saveState()); + + QStringList applicationFont; + applicationFont< stop_values; + QStringList stop_colors; + QwtArray colors = d_3D_color_map.colorStops(); + int stops = (int)colors.size() - 1; + for (int i = 1; i < stops; i++){ + stop_values << QVariant(colors[i]); + stop_colors << QColor(d_3D_color_map.rgb(QwtDoubleInterval(0, 1), colors[i])).name(); + } + settings.setValue("/ColorMapStops", QVariant(stop_values)); + settings.setValue("/ColorMapColors", stop_colors); + settings.endGroup(); // Colors + + settings.beginGroup("/Grids"); + settings.setValue("/EnableMajor", d_3D_major_grids); + settings.setValue("/MajorColor", d_3D_grid_color); + settings.setValue("/MajorStyle", d_3D_major_style); + settings.setValue("/MajorWidth", d_3D_major_width); + settings.setValue("/EnableMinor", d_3D_minor_grids); + settings.setValue("/MinorColor", d_3D_minor_grid_color); + settings.setValue("/MinorStyle", d_3D_minor_style); + settings.setValue("/MinorWidth", d_3D_minor_width); + settings.endGroup(); // Grids + + settings.endGroup(); + /* ----------------- end group 3D Plots -------- */ + + settings.beginGroup("/Fitting"); + settings.setValue("/OutputPrecision", fit_output_precision); + settings.setValue("/PasteResultsToPlot", pasteFitResultsToPlot); + settings.setValue("/WriteResultsToLog", writeFitResultsToLog); + settings.setValue("/GenerateFunction", generateUniformFitPoints); + settings.setValue("/Points", fitPoints); + settings.setValue("/GeneratePeakCurves", generatePeakCurves); + settings.setValue("/PeakColor", peakCurvesColor.name()); + settings.setValue("/ScaleErrors", fit_scale_errors); + settings.setValue("/TwoPointsLinearFit", d_2_linear_fit_points); + settings.setValue("/MultiPeakToolMsg", d_multi_peak_messages); + settings.endGroup(); // Fitting + + settings.beginGroup("/ImportASCII"); + QString sep = columnSeparator; + settings.setValue("/ColumnSeparator", sep.replace("\t", "\\t").replace(" ", "\\s")); + settings.setValue("/IgnoreLines", ignoredLines); + settings.setValue("/RenameColumns", renameColumns); + settings.setValue("/StripSpaces", strip_spaces); + settings.setValue("/SimplifySpaces", simplify_spaces); + settings.setValue("/AsciiFileTypeFilter", d_ASCII_file_filter); + settings.setValue("/AsciiImportLocale", d_ASCII_import_locale.name()); + + bool omitGroupSep = (d_ASCII_import_locale.numberOptions() & QLocale::OmitGroupSeparator) ? true : false; + settings.setValue("/OmitGroupSeparator", omitGroupSep); + + settings.setValue("/ImportMode", d_ASCII_import_mode); + settings.setValue("/CommentString", d_ASCII_comment_string); + settings.setValue("/ImportComments", d_ASCII_import_comments); + settings.setValue("/ImportReadOnly", d_ASCII_import_read_only); + settings.setValue("/Preview", d_ASCII_import_preview); + settings.setValue("/PreviewLines", d_preview_lines); + settings.setValue("/EndLineCharacter", (int)d_ASCII_end_line); + settings.setValue("/FirstLineRole", d_ASCII_import_first_row_role); + settings.setValue("/DialogSize", d_import_ASCII_dialog_size); + settings.endGroup(); // ImportASCII + + settings.beginGroup("/ExportASCII"); + sep = d_export_col_separator; + settings.setValue("/ColumnSeparator", sep.replace("\t", "\\t").replace(" ", "\\s")); + settings.setValue("/ExportLabels", d_export_col_names); + settings.setValue("/ExportComments", d_export_col_comment); + settings.setValue("/ExportSelection", d_export_table_selection); + settings.setValue("/ExportAsciiFilter", d_export_ASCII_file_filter); + settings.endGroup(); // ExportASCII + + settings.beginGroup("/ExportImage"); + settings.setValue("/ImageFileTypeFilter", d_image_export_filter); + settings.setValue("/ExportTransparency", d_export_transparency); + settings.setValue("/ImageQuality", d_export_quality); + settings.setValue("/Resolution", d_export_vector_resolution); + settings.setValue("/ExportColor", d_export_color); + settings.setValue("/3DTextMode", d_3D_export_text_mode); + settings.setValue("/3DSortMode", d_3D_export_sort); + settings.setValue("/BitmapResolution", d_export_bitmap_resolution); + settings.setValue("/RasterSize", d_export_raster_size); + settings.setValue("/SizeUnit", d_export_size_unit); + settings.setValue("/ScaleFontsFactor", d_scale_fonts_factor); + settings.setValue("/EscapeTeXStrings", d_export_escape_tex_strings); + settings.setValue("/ExportTeXFontSize", d_export_tex_font_sizes); + settings.endGroup(); // ExportImage + + settings.beginGroup("/ScriptWindow"); + settings.setValue("/AlwaysOnTop", d_script_win_on_top); + settings.setValue("/x", d_script_win_rect.x()); + settings.setValue("/y", d_script_win_rect.y()); + settings.setValue("/width", d_script_win_rect.width()); + settings.setValue("/height", d_script_win_rect.height()); + settings.endGroup();//ScriptWindow + + settings.beginGroup("/ToolBars"); + settings.setValue("/FileToolBar", d_file_tool_bar); + settings.setValue("/EditToolBar", d_edit_tool_bar); + settings.setValue("/TableToolBar", d_table_tool_bar); + settings.setValue("/ColumnToolBar", d_column_tool_bar); + settings.setValue("/MatrixToolBar", d_matrix_tool_bar); + settings.setValue("/PlotToolBar", d_plot_tool_bar); + settings.setValue("/Plot3DToolBar", d_plot3D_tool_bar); + settings.setValue("/DisplayToolBar", d_display_tool_bar); + settings.setValue("/FormatToolBar", d_format_tool_bar); + settings.setValue("/NotesToolBar", d_notes_tool_bar); + settings.endGroup();//ToolBars + + settings.beginGroup("/Notes"); + settings.setValue("/LineNumbers", d_note_line_numbers); + settings.setValue("/TabLength", d_notes_tab_length); + settings.setValue("/FontFamily", d_notes_font.family()); + settings.setValue("/FontSize", d_notes_font.pointSize()); + settings.setValue("/FontBold", d_notes_font.bold()); + settings.setValue("/FontItalic", d_notes_font.italic()); + settings.beginGroup("/SyntaxHighlighting"); + settings.setValue("/Comments", d_comment_highlight_color.name()); + settings.setValue("/Keywords", d_keyword_highlight_color.name()); + settings.setValue("/Quotations", d_quotation_highlight_color.name()); + settings.setValue("/Numbers", d_numeric_highlight_color.name()); + settings.setValue("/Functions", d_function_highlight_color.name()); + settings.setValue("/QtClasses", d_class_highlight_color.name()); + settings.endGroup();//SyntaxHighlighting + settings.endGroup();//Notes + + settings.beginGroup("/PrintPreview"); + settings.setValue("/PaperSize", (int)d_print_paper_size); + settings.setValue("/Orientation", (int)d_printer_orientation); + settings.endGroup();//PrintPreview + + QNetworkProxy proxy = QNetworkProxy::applicationProxy(); + if (!proxy.hostName().isEmpty()){ + settings.beginGroup("/Proxy"); + settings.setValue("/Host", proxy.hostName()); + settings.setValue("/Port", proxy.port()); + settings.setValue("/Username", proxy.user()); + settings.endGroup();//Proxy + } else + settings.remove("/Proxy"); +} + +void ApplicationWindow::exportGraph(const QString& exportFilter) +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + MultiLayer *plot2D = qobject_cast(w); + Graph3D *plot3D = qobject_cast(w); + if(plot2D && plot2D->isEmpty()){ + QMessageBox::critical(this, tr("QtiPlot - Export Error"), + tr("

There are no plot layers available in this window!

")); + return; + } + + if (!plot2D && !plot3D) + return; + + ImageExportDialog *ied = new ImageExportDialog(w, this, d_extended_export_dialog); + ied->setDirectory(imagesDirPath); + ied->selectFile(w->objectName()); + if (exportFilter.isEmpty()) + ied->selectFilter(d_image_export_filter); + else + ied->selectFilter(exportFilter); + + if ( ied->exec() != QDialog::Accepted ) + return; + imagesDirPath = ied->directory().path(); + + QString selected_filter = ied->selectedFilter().remove("*"); + QString file_name = ied->selectedFiles()[0]; + if(!file_name.endsWith(selected_filter, Qt::CaseInsensitive)) + file_name.append(selected_filter); + + if (plot3D && selected_filter.contains(".pgf")){ + plot3D->exportVector(file_name, ied->textExportMode(), ied->sortMode()); + return; + } + +#ifdef EMF_OUTPUT + if (plot2D && selected_filter.contains(".emf")){ + plot2D->exportEMF(file_name, ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + return; + } +#endif + + if (plot2D && selected_filter.contains(".tex")){ + plot2D->exportTeX(file_name, ied->color(), ied->escapeStrings(), ied->exportFontSizes(), ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + return; + } + + if (selected_filter.contains(".eps") || selected_filter.contains(".pdf") || + selected_filter.contains(".ps") || selected_filter.contains(".svg")) { + if (plot3D) + plot3D->exportVector(file_name, ied->textExportMode(), ied->sortMode(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + else if (plot2D){ + if (selected_filter.contains(".svg")) + plot2D->exportSVG(file_name, ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + else + plot2D->exportVector(file_name, ied->vectorResolution(), ied->color(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + } + } else if (selected_filter.contains(".odf")){ + if (plot2D) + plot2D->exportImage(file_name, ied->quality(), ied->transparency(), ied->bitmapResolution(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + else if (plot3D) + plot3D->exportImage(file_name, ied->quality(), ied->transparency(), ied->bitmapResolution(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + + } else { + QList list = QImageWriter::supportedImageFormats(); + for (int i=0; i<(int)list.count(); i++){ + if (selected_filter.contains("." + (list[i]).lower())) { + if (plot2D) + plot2D->exportImage(file_name, ied->quality(), ied->transparency(), + ied->bitmapResolution(), ied->customExportSize(), ied->sizeUnit(), + ied->scaleFontsFactor()); + else if (plot3D){ + plot3D->exportImage(file_name, ied->quality(), ied->transparency(), + ied->bitmapResolution(), ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + } + } + } + } +} + +void ApplicationWindow::exportLayer() +{ + MdiSubWindow *w = activeWindow(MultiLayerWindow); + if (!w) + return; + + Graph* g = ((MultiLayer*)w)->activeLayer(); + if (!g) + return; + + ImageExportDialog *ied = new ImageExportDialog(w, this, d_extended_export_dialog, g); + ied->setDir(imagesDirPath); + ied->selectFile(w->objectName()); + ied->selectFilter(d_image_export_filter); + if ( ied->exec() != QDialog::Accepted ) + return; + imagesDirPath = ied->directory().path(); + + QString file_name = ied->selectedFiles()[0]; + QString selected_filter = ied->selectedFilter().remove("*"); + if(!file_name.endsWith(selected_filter, Qt::CaseInsensitive)) + file_name.append(selected_filter); + + if (selected_filter.contains(".eps") || selected_filter.contains(".pdf") || selected_filter.contains(".ps")) + g->exportVector(file_name, ied->vectorResolution(), ied->color(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + else if (selected_filter.contains(".svg")) + g->exportSVG(file_name, ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); +#ifdef EMF_OUTPUT + else if (selected_filter.contains(".emf")) + g->exportEMF(file_name, ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); +#endif + else if (selected_filter.contains(".tex")) + g->exportTeX(file_name, ied->color(), ied->escapeStrings(), ied->exportFontSizes(), ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + else if (selected_filter.contains(".odf")) + g->exportImage(file_name, ied->quality(), ied->transparency(), ied->bitmapResolution(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + else { + QList list = QImageWriter::supportedImageFormats(); + for (int i=0; i<(int)list.count(); i++) + if (selected_filter.contains("."+(list[i]).lower())) + g->exportImage(file_name, ied->quality(), ied->transparency(), + ied->bitmapResolution(), ied->customExportSize(), ied->sizeUnit(), + ied->scaleFontsFactor()); + } +} + +void ApplicationWindow::exportPresentationODF() +{ + ImageExportDialog *ied = new ImageExportDialog(NULL, this, d_extended_export_dialog); + ied->setDir(imagesDirPath); + ied->setNameFilter("*.odf"); + + if ( ied->exec() != QDialog::Accepted ) + return; + imagesDirPath = ied->directory().path(); + + QString selected_filter = ied->selectedFilter().remove("*"); + QString file_name = ied->selectedFiles()[0]; + if(!file_name.endsWith(selected_filter, Qt::CaseInsensitive)) + file_name.append(selected_filter); + + QDialog *previewDlg = new QDialog(this); + previewDlg->setSizeGripEnabled(true); + previewDlg->setWindowTitle(tr("QtiPlot") + " - " + tr("Presentation Preview")); + previewDlg->resize(QSize(600, 400)); + + QHBoxLayout *bl = new QHBoxLayout(); + bl->addStretch(); + QPushButton *okBtn = new QPushButton(tr("&Save")); + connect(okBtn, SIGNAL(clicked()), previewDlg, SLOT(accept())); + bl->addWidget(okBtn); + + QPushButton *cancelBtn = new QPushButton(tr("&Cancel")); + connect(cancelBtn, SIGNAL(clicked()), previewDlg, SLOT(reject())); + bl->addWidget(cancelBtn); + bl->addStretch(); + + QVBoxLayout *vl = new QVBoxLayout(previewDlg); + QTextEdit *te = new QTextEdit(); + vl->addWidget(te); + vl->addLayout(bl); + + QTextDocument *document = te->document(); + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (qobject_cast(w)){ + MultiLayer *plot2D = qobject_cast(w); + if (!plot2D->isEmpty()) + plot2D->exportImage(document, ied->quality(), ied->transparency(), ied->bitmapResolution(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + } else if (qobject_cast(w)) + ((Graph3D *)w)->exportImage(document, ied->quality(), ied->transparency(), ied->bitmapResolution(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + } + + if (previewDlg->exec() == QDialog::Accepted){ + QTextDocumentWriter writer(file_name); + writer.write(document); + } +} + +void ApplicationWindow::exportAllGraphs() +{ + ImageExportDialog *ied = new ImageExportDialog(NULL, this, d_extended_export_dialog); + ied->setWindowTitle(tr("Choose a directory to export the graphs to")); + QStringList tmp = ied->filters(); + ied->setFileMode(QFileDialog::Directory); + ied->setFilters(tmp); + ied->setLabelText(QFileDialog::FileType, tr("Output format:")); + ied->setLabelText(QFileDialog::FileName, tr("Directory:")); + ied->setDir(imagesDirPath); + ied->selectFilter(d_image_export_filter); + + if ( ied->exec() != QDialog::Accepted ) + return; + imagesDirPath = ied->directory().path(); + if (ied->selectedFiles().isEmpty()) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QString output_dir = ied->selectedFiles()[0]; + QString file_suffix = ied->selectedFilter(); + file_suffix.lower(); + file_suffix.remove("*"); + + bool confirm_overwrite = d_confirm_overwrite; + MultiLayer *plot2D; + Graph3D *plot3D; + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")) { + plot3D = 0; + plot2D = (MultiLayer *)w; + if (plot2D->isEmpty()) { + QApplication::restoreOverrideCursor(); + QMessageBox::warning(this, tr("QtiPlot - Warning"), + tr("There are no plot layers available in window %1.
" + "Graph window not exported!").arg(plot2D->objectName())); + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + continue; + } + } else if (w->isA("Graph3D")) { + plot2D = 0; + plot3D = (Graph3D *)w; + } else + continue; + + QString file_name = output_dir + "/" + w->objectName() + file_suffix; + QFile f(file_name); + if (f.exists() && confirm_overwrite) { + QApplication::restoreOverrideCursor(); + + QString msg = tr("A file called:

%1

already exists. ""Do you want to overwrite it?").arg(file_name); + QMessageBox msgBox(QMessageBox::Question, tr("QtiPlot - Overwrite file?"), msg, + QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::Cancel, + (ApplicationWindow *)this); + msgBox.exec(); + switch(msgBox.standardButton(msgBox.clickedButton())){ + case QMessageBox::Yes: + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + break; + case QMessageBox::YesToAll: + confirm_overwrite = false; + break; + case QMessageBox::No: + confirm_overwrite = true; + continue; + break; + case QMessageBox::Cancel: + return; + break; + default: + break; + } + } + if ( !f.open( QIODevice::WriteOnly ) ) { + QApplication::restoreOverrideCursor(); + QMessageBox::critical(this, tr("QtiPlot - Export error"), + tr("Could not write to file:

%1

" + "Please verify that you have the right to write to this location!").arg(file_name)); + return; + } + f.close(); + +#ifdef EMF_OUTPUT + if (plot2D && file_suffix.contains(".emf")){ + plot2D->exportEMF(file_name, ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + return; + } +#endif + if (plot2D && file_suffix.contains(".tex")){ + plot2D->exportTeX(file_name, ied->color(), ied->escapeStrings(), ied->exportFontSizes(), ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + return; + } + + if (file_suffix.contains(".eps") || file_suffix.contains(".pdf") || + file_suffix.contains(".ps") || file_suffix.contains(".svg")) { + if (plot3D) + plot3D->exportVector(file_name, ied->textExportMode(), ied->sortMode(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + else if (plot2D){ + if (file_suffix.contains(".svg")) + plot2D->exportSVG(file_name, ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + else + plot2D->exportVector(file_name, ied->vectorResolution(), ied->color(), + ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + } + } else { + QList list = QImageWriter::supportedImageFormats(); + for (int i=0; i<(int)list.count(); i++){ + if (file_suffix.contains("." + (list[i]).lower())) { + if (plot2D) + plot2D->exportImage(file_name, ied->quality(), ied->transparency(), + ied->bitmapResolution(), ied->customExportSize(), ied->sizeUnit(), + ied->scaleFontsFactor()); + else if (plot3D) + plot3D->exportImage(file_name, ied->quality(), ied->transparency(), + ied->bitmapResolution(), ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); + } + } + } + } + QApplication::restoreOverrideCursor(); +} + +QString ApplicationWindow::windowGeometryInfo(MdiSubWindow *w) +{ + QString s = "geometry\t"; + if (w->status() == MdiSubWindow::Maximized){ + if (w == w->folder()->activeWindow()) + return s + "maximized\tactive\n"; + else + return s + "maximized\n"; + } + + s += QString::number(w->x()) + "\t"; + s += QString::number(w->y()) + "\t"; + + QSize minRestoreSize = w->minRestoreSize(); + if (w->status() == MdiSubWindow::Hidden && + minRestoreSize.width() > w->width() && + minRestoreSize.height() > w->height()){ + // the window was minimized and afterwards hidden + s += QString::number(minRestoreSize.width()) + "\t"; + s += QString::number(minRestoreSize.height()) + "\t"; + } else if (w->status() != MdiSubWindow::Minimized){ + s += QString::number(w->width()) + "\t"; + s += QString::number(w->height()) + "\t"; + } else { + s += QString::number(minRestoreSize.width()) + "\t"; + s += QString::number(minRestoreSize.height()) + "\t"; + s += "minimized\t"; + } + + bool hide = hidden(w); + if (w == w->folder()->activeWindow() && !hide) + s += "active\n"; + else if(hide) + s += "hidden\n"; + else + s += "\n"; + return s; +} + +void ApplicationWindow::restoreWindowGeometry(ApplicationWindow *app, MdiSubWindow *w, const QString s) +{ + if (qobject_cast(w)) + w->hide(); + + QString caption = w->objectName(); + if (s.contains ("minimized")) { + QStringList lst = s.split("\t"); + if (lst.count() > 4){ + int width = lst[3].toInt(); + int height = lst[4].toInt(); + if(width > 0 && height > 0) + w->resize(width, height); + } + w->setStatus(MdiSubWindow::Minimized); + app->setListView(caption, tr("Minimized")); + } else if (s.contains ("maximized")){ + w->setMaximized(); + } else { + QStringList lst = s.split("\t"); + if (lst.count() > 4){ + w->resize(lst[3].toInt(), lst[4].toInt()); + w->move(lst[1].toInt(), lst[2].toInt()); + } + w->setStatus(MdiSubWindow::Normal); + if (lst.count() > 5) { + if (lst[5] == "hidden") + app->hideWindow(w); + } + } + + if (s.contains ("active")) { + Folder *f = w->folder(); + if (f) + f->setActiveWindow(w); + } +} + +Folder* ApplicationWindow::projectFolder() +{ + return ((FolderListItem *)folders->firstChild())->folder(); +} + +bool ApplicationWindow::saveProject(bool compress) +{ + if (projectname == "untitled" || projectname.endsWith(".opj", Qt::CaseInsensitive) || + projectname.endsWith(".ogm", Qt::CaseInsensitive) || projectname.endsWith(".ogw", Qt::CaseInsensitive) + || projectname.endsWith(".ogg", Qt::CaseInsensitive)) + { + saveProjectAs(); + return false; + } + +#ifdef QTIPLOT_DEMO + showDemoVersionMessage(); + return false; +#endif + + saveFolder(projectFolder(), projectname, compress); + + setWindowTitle("QtiPlot - " + projectname); + savedProject(); + + if (autoSave){ + if (savingTimerId) + killTimer(savingTimerId); + savingTimerId=startTimer(autoSaveTime*60000); + } else + savingTimerId=0; + + QApplication::restoreOverrideCursor(); + return true; +} + +QString ApplicationWindow::getFileName(QWidget *parent, const QString & caption, const QString & dir, const QString & filter, + QString * selectedFilter, bool save, bool confirmOverwrite) +{ + QFileDialog fd(parent, caption, dir, filter); + if (save){ + fd.setAcceptMode(QFileDialog::AcceptSave); + fd.setConfirmOverwrite(confirmOverwrite); + } else + fd.setAcceptMode(QFileDialog::AcceptOpen); + + fd.setFileMode(QFileDialog::AnyFile); + + if (fd.exec() != QDialog::Accepted ) + return QString(); + + if (fd.selectedFiles().isEmpty()) + return QString(); + + if (selectedFilter) + *selectedFilter = fd.selectedNameFilter(); + return fd.selectedFiles()[0]; +} + +void ApplicationWindow::saveProjectAs(const QString& fileName, bool compress) +{ +#ifdef QTIPLOT_DEMO + showDemoVersionMessage(); + return; +#endif + + QString fn = fileName; + if (fileName.isEmpty()){ + QString filter = tr("QtiPlot project") + " (*.qti);;"; + filter += tr("Compressed QtiPlot project") + " (*.qti.gz)"; + + QString selectedFilter; + fn = getFileName(this, tr("Save Project As"), workingDir, filter, &selectedFilter, true, d_confirm_overwrite); + if (selectedFilter.contains(".gz")) + compress = true; + } + + if ( !fn.isEmpty() ){ + QFileInfo fi(fn); + workingDir = fi.dirPath(true); + if (!fn.endsWith(".qti", Qt::CaseInsensitive)) + fn.append(".qti"); + + projectname = fn; + if (saveProject(compress)){ + updateRecentProjectsList(projectname); + + QFileInfo fi(fn); + QString baseName = fi.baseName(); + FolderListItem *item = (FolderListItem *)folders->firstChild(); + item->setText(0, baseName); + item->folder()->setObjectName(baseName); + } + } +} + +void ApplicationWindow::saveNoteAs() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + w->exportASCII(); +} + +void ApplicationWindow::increaseNoteIndent() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + + w->setTabStopWidth(w->currentEditor()->tabStopWidth() + 5); + modifiedProject(); +} + +void ApplicationWindow::decreaseNoteIndent() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + + w->setTabStopWidth(w->currentEditor()->tabStopWidth() - 5); + modifiedProject(); +} + +void ApplicationWindow::showNoteLineNumbers(bool show) +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + w->showLineNumbers(show); + modifiedProject(); +} + +void ApplicationWindow::noteFindDialogue() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + + w->currentEditor()->showFindDialog(); +} + +void ApplicationWindow::noteFindNext() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + + w->currentEditor()->findNext(); +} + +void ApplicationWindow::noteFindPrev() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + + w->currentEditor()->findPrevious(); +} + +void ApplicationWindow::noteReplaceDialogue() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + + w->currentEditor()->showFindDialog(true); +} + +void ApplicationWindow::renameCurrentNoteTab() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + w->renameCurrentTab(); + modifiedProject(); +} + +void ApplicationWindow::addNoteTab() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + w->addTab(); + modifiedProject(); +} + +void ApplicationWindow::closeNoteTab() +{ + Note* w = (Note*)activeWindow(NoteWindow); + if (!w) + return; + w->removeTab(); + modifiedProject(); +} + +void ApplicationWindow::saveAsTemplate(MdiSubWindow* w, const QString& fileName) +{ + if (!w) { + w = activeWindow(); + if (!w) + return; + } + + QString fn = fileName; + if (fn.isEmpty()){ + QString filter; + if (w->isA("Matrix")) + filter = tr("QtiPlot Matrix Template")+" (*.qmt)"; + else if (w->isA("MultiLayer")) + filter = tr("QtiPlot 2D Graph Template")+" (*.qpt)"; + else if (w->inherits("Table")) + filter = tr("QtiPlot Table Template")+" (*.qtt)"; + else if (w->isA("Graph3D")) + filter = tr("QtiPlot 3D Surface Template")+" (*.qst)"; + + QString selectedFilter; + fn = getFileName(this, tr("Save Window As Template"), templatesDir + "/" + w->objectName(), filter, &selectedFilter, true, d_confirm_overwrite); + + if (!fn.isEmpty()){ + QFileInfo fi(fn); + templatesDir = fi.dirPath(true); + QString baseName = fi.fileName(); + if (!baseName.contains(".")){ + selectedFilter = selectedFilter.right(5).left(4); + fn.append(selectedFilter); + } + } else + return; + } + + QFile f(fn); + if ( !f.open( QIODevice::WriteOnly ) ){ + QMessageBox::critical(this, tr("QtiPlot - Export error"), + tr("Could not write to file:

%1

Please verify that you have the right to write to this location!").arg(fn)); + return; + } + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + QTextStream t( &f ); + t.setEncoding(QTextStream::UnicodeUTF8); + t << "QtiPlot " + QString::number(maj_version)+"."+ QString::number(min_version)+"."+ + QString::number(patch_version) + " template file\n"; + f.close(); + w->save(fn, windowGeometryInfo(w), true); + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::rename() +{ + MdiSubWindow* m = activeWindow(); + if (!m) + return; + + RenameWindowDialog *rwd = new RenameWindowDialog(this); + rwd->setAttribute(Qt::WA_DeleteOnClose); + rwd->setWidget(m); + rwd->exec(); +} + +void ApplicationWindow::renameWindow() +{ + WindowListItem *it = (WindowListItem *)lv->currentItem(); + MdiSubWindow *w = it->window(); + if (!w) + return; + + RenameWindowDialog *rwd = new RenameWindowDialog(this); + rwd->setAttribute(Qt::WA_DeleteOnClose); + rwd->setWidget(w); + rwd->exec(); +} + +void ApplicationWindow::renameWindow(Q3ListViewItem *item, int, const QString &text) +{ + if (!item) + return; + + MdiSubWindow *w = ((WindowListItem *)item)->window(); + if (!w || text == w->objectName()) + return; + + if(!setWindowName(w, text)) + item->setText(0, w->objectName()); +} + +bool ApplicationWindow::setWindowName(MdiSubWindow *w, const QString &text) +{ + if (!w) + return false; + + QString name = w->objectName(); + if (name == text) + return true; + + QString newName = text; + newName.replace("-", "_"); + if (newName.isEmpty()){ + QMessageBox::critical(this, tr("QtiPlot - Error"), tr("Please enter a valid name!")); + return false; + } else if (newName.contains(QRegExp("\\W"))){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("The name you chose is not valid: only letters and digits are allowed!")+ + "

" + tr("Please choose another name!")); + return false; + } + + if (w->inherits("Table")) + newName.replace("_", "-"); + + while(alreadyUsedName(newName)){ + QMessageBox::critical(this, tr("QtiPlot - Error"), tr("Name %1 already exists!").arg(newName)+ + "

"+tr("Please choose another name!")+ + "

"+tr("Warning: for internal consistency reasons the underscore character is replaced with a minus sign.")); + return false; + } + + if (w->inherits("Table")) + updateTableNames(name, newName); + else if (w->isA("Matrix")) + changeMatrixName(name, newName); + + w->setName(newName); + renameListViewItem(name, newName); + updateCompleter(name, false, newName); + return true; +} + +QStringList ApplicationWindow::columnsList(Table::PlotDesignation plotType) +{ + QStringList list; + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (!w->inherits("Table")) + continue; + + Table *t = (Table *)w; + for (int i=0; i < t->numCols(); i++) + { + if (t->colPlotDesignation(i) == plotType || plotType == Table::All) + list << QString(t->objectName()) + "_" + t->colLabel(i); + } + } + return list; +} + +void ApplicationWindow::showCurvesDialog() +{ + MdiSubWindow *w = activeWindow(MultiLayerWindow); + if (!w) + return; + + if (((MultiLayer*)w)->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Error"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + return; + } + + Graph* g = ((MultiLayer*)w)->activeLayer(); + if (!g) + return; + + if (g->isPiePlot()){ + QMessageBox::warning(this,tr("QtiPlot - Error"), + tr("This functionality is not available for pie plots!")); + } else { + CurvesDialog* crvDialog = new CurvesDialog(this); + crvDialog->setAttribute(Qt::WA_DeleteOnClose); + crvDialog->setGraph(g); + crvDialog->resize(d_add_curves_dialog_size); + crvDialog->setModal(true); + crvDialog->show(); + } +} + +bool ApplicationWindow::hasTable() +{ + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->inherits("Table")) + return true; + } + f = f->folderBelow(); + } + return false; +} + +QStringList ApplicationWindow::tableNames() +{ + QStringList lst = QStringList(); + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->inherits("Table")) + lst << w->objectName(); + } + f = f->folderBelow(); + } + return lst; +} + +QList ApplicationWindow::tableList() +{ + QList lst; + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->inherits("Table")) + lst << w; + } + f = f->folderBelow(); + } + return lst; +} + +AssociationsDialog* ApplicationWindow::showPlotAssociations(int curve) +{ + MdiSubWindow* w = activeWindow(MultiLayerWindow); + if (!w) + return 0; + + Graph *g = ((MultiLayer*)w)->activeLayer(); + if (!g) + return 0; + + AssociationsDialog* ad = new AssociationsDialog(this); + ad->setAttribute(Qt::WA_DeleteOnClose); + ad->setGraph(g); + ad->initTablesList(tableList(), curve); + ad->show(); + return ad; +} + +void ApplicationWindow::showTitleDialog() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (w->isA("MultiLayer")){ + Graph* g = ((MultiLayer*)w)->activeLayer(); + if (g){ + TextDialog* td= new TextDialog(TextDialog::LayerTitle, this,0); + td->setGraph(g); + td->exec(); + } + } else if (w->isA("Graph3D")) { + Plot3DDialog* pd = (Plot3DDialog*)showPlot3dDialog(); + if (pd) + pd->showTitleTab(); + } +} + +void ApplicationWindow::showAxisTitleDialog() +{ + MdiSubWindow* w = activeWindow(MultiLayerWindow); + if (!w) + return; + + Graph* g = ((MultiLayer*)w)->activeLayer(); + if (!g) + return; + + TextDialog* td = new TextDialog(TextDialog::AxisTitle, this, 0); + td->setGraph(g); + td->exec(); +} + +void ApplicationWindow::showExportASCIIDialog() +{ + MdiSubWindow* t = activeWindow(); + if (!t) + return; + if (!qobject_cast(t) && !t->inherits("Table")) + return; + + ExportDialog* ed = new ExportDialog(t, this, true); + ed->exec(); +} + +void ApplicationWindow::exportAllTables(const QString& dir, const QString& filter, const QString& sep, bool colNames, bool colComments, bool expSelection) +{ + if (dir.isEmpty()) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + workingDir = dir; + + bool confirmOverwrite = d_confirm_overwrite; + bool success = true; + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->inherits("Table") || w->isA("Matrix")){ + QString fileName = dir + "/" + w->objectName() + filter; + QFile f(fileName); + if (f.exists(fileName) && confirmOverwrite){ + QApplication::restoreOverrideCursor(); + switch(QMessageBox::question(this, tr("QtiPlot - Overwrite file?"), + tr("A file called:

%1

already exists. " + "Do you want to overwrite it?").arg(fileName), tr("&Yes"), tr("&All"), tr("&Cancel"), 0, 1)) + { + case 0: + if (w->inherits("Table")) + success = ((Table*)w)->exportASCII(fileName, sep, colNames, colComments, expSelection); + else if (w->isA("Matrix")) + success = ((Matrix*)w)->exportASCII(fileName, sep, expSelection); + break; + + case 1: + confirmOverwrite = false; + if (w->inherits("Table")) + success = ((Table*)w)->exportASCII(fileName, sep, colNames, colComments, expSelection); + else if (w->isA("Matrix")) + success = ((Matrix*)w)->exportASCII(fileName, sep, expSelection); + break; + + case 2: + return; + break; + } + } else if (w->inherits("Table")) + success = ((Table*)w)->exportASCII(fileName, sep, colNames, colComments, expSelection); + else if (w->isA("Matrix")) + success = ((Matrix*)w)->exportASCII(fileName, sep, expSelection); + + if (!success) + break; + } + } + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::showRowsDialog() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + bool ok; + int rows = QInputDialog::getInteger(this, tr("QtiPlot - Enter rows number"), tr("Rows"), + t->numRows(), 0, 1000000, 1, &ok); + if ( ok ) + t->resizeRows(rows); +} + +void ApplicationWindow::showDeleteRowsDialog() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + bool ok; + int start_row = QInputDialog::getInteger(this, tr("QtiPlot - Delete rows"), tr("Start row"), + 1, 1, t->numRows(), 1, &ok); + if (ok){ + int end_row = QInputDialog::getInteger(this, tr("QtiPlot - Delete rows"), tr("End row"), + t->numRows(), 1, t->numRows(), 1, &ok); + if (ok) + t->deleteRows(start_row, end_row); + } +} + +void ApplicationWindow::showColsDialog() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + bool ok; + int cols = QInputDialog::getInteger(this, tr("QtiPlot - Enter columns number"), tr("Columns"), + t->numCols(), 0, 1000000, 1, &ok); + if ( ok ) + t->resizeCols(cols); +} + +void ApplicationWindow::showColumnValuesDialog() +{ + Table *w = (Table*)activeWindow(TableWindow); + if (!w) + return; + + if (w->selectedColumns().count()>0 || w->table()->currentSelection() >= 0){ + SetColValuesDialog* vd = new SetColValuesDialog(scriptEnv, this); + vd->setTable(w); + if (d_completion) + vd->setCompleter(d_completer); + vd->exec(); + } else + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), tr("Please select a column first!")); +} + +void ApplicationWindow::showExtractDataDialog() +{ + Table *w = (Table*)activeWindow(TableWindow); + if (!w) + return; + + ExtractDataDialog* edd = new ExtractDataDialog(scriptEnv, this); + edd->setTable(w); + if (d_completion) + edd->setCompleter(d_completer); + edd->exec(); +} + +void ApplicationWindow::recalculateTable() +{ + MdiSubWindow* w = activeWindow(); + if (!w) + return; + + if (qobject_cast(w)) + ((TableStatistics*)w)->update(); + else if (qobject_cast

(w)) + ((Table*)w)->calculate(); + else if (qobject_cast(w)) + ((Matrix*)w)->calculate(); +} + +void ApplicationWindow::sortActiveTable() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + if ((int)t->selectedColumns().count()>0) + t->sortTableDialog(); + else + QMessageBox::warning(this, "QtiPlot - Column selection error","Please select a column first!"); +} + +void ApplicationWindow::sortSelection() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + t->sortColumnsDialog(); +} + +void ApplicationWindow::normalizeActiveTable() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + if (int(t->selectedColumns().count())>0) + t->normalize(); + else + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), tr("Please select a column first!")); +} + +void ApplicationWindow::normalizeSelection() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + if (int(t->selectedColumns().count())>0) + t->normalizeSelection(); + else + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), tr("Please select a column first!")); +} + +void ApplicationWindow::correlate() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + QStringList s = t->selectedColumns(); + if ((int)s.count() != 2){ + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select two columns for this operation!")); + return; + } + + Correlation *cor = new Correlation(this, t, s[0], s[1]); + cor->run(); + delete cor; +} + +void ApplicationWindow::autoCorrelate() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + QStringList s = t->selectedColumns(); + if ((int)s.count() != 1) + { + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select exactly one columns for this operation!")); + return; + } + + Correlation *cor = new Correlation(this, t, s[0], s[0]); + cor->run(); + delete cor; +} + +void ApplicationWindow::convolute() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + QStringList s = t->selectedColumns(); + if ((int)s.count() != 2) + { + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select two columns for this operation:\n the first represents the signal and the second the response function!")); + return; + } + + Convolution *cv = new Convolution(this, t, s[0], s[1]); + cv->run(); + delete cv; +} + +void ApplicationWindow::deconvolute() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + QStringList s = t->selectedColumns(); + if ((int)s.count() != 2) + { + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select two columns for this operation:\n the first represents the signal and the second the response function!")); + return; + } + + Deconvolution *dcv = new Deconvolution(this, t, s[0], s[1]); + dcv->run(); + delete dcv; +} + +void ApplicationWindow::showColStatistics() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + if (int(t->selectedColumns().count()) > 0) + { + QList targets; + for (int i=0; i < t->numCols(); i++) + if (t->isColumnSelected(i, true)) + targets << i; + newTableStatistics(t, TableStatistics::column, targets)->showNormal(); + } + else + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), + tr("Please select a column first!")); +} + +void ApplicationWindow::showRowStatistics() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + if (t->numSelectedRows() > 0){ + QList targets; + for (int i=0; i < t->numRows(); i++) + if (t->isRowSelected(i, true)) + targets << i; + newTableStatistics(t, TableStatistics::row, targets)->showNormal(); + } else + QMessageBox::warning(this, tr("QtiPlot - Row selection error"), + tr("Please select a row first!")); +} + +void ApplicationWindow::showColMenu(int c) +{ + Table *w = (Table*)activeWindow(TableWindow); + if (!w) + return; + + QMenu contextMenu(this); + QMenu plot(this); + QMenu specialPlot(this); + QMenu specialBarMenu(this); + QMenu fill(this); + QMenu sorting(this); + QMenu colType(this); + colType.setCheckable(true); + QMenu panels(this); + QMenu gridMenu(this); + QMenu stat(this); + QMenu norm(this); + + if ((int)w->selectedColumns().count() == 1){ + w->setSelectedCol(c); + plot.addAction(actionPlotL); + plot.addAction(actionPlotP); + plot.addAction(actionPlotLP); + + specialPlot.addAction(actionPlotVerticalDropLines); + specialPlot.addAction(actionPlotSpline); + specialPlot.addAction(actionPlotVertSteps); + specialPlot.addAction(actionPlotHorSteps); + specialPlot.insertSeparator(); + specialPlot.addAction(actionAddZoomPlot); + specialPlot.setTitle(tr("Special Line/Symb&ol")); + plot.addMenu(&specialPlot); + plot.insertSeparator(); + plot.addAction(actionPlotVerticalBars); + plot.addAction(actionPlotHorizontalBars); + specialBarMenu.addAction(actionStackBars); + specialBarMenu.addAction(actionStackColumns); + specialBarMenu.setTitle(tr("Spec&ial Bar/Column")); + plot.addMenu (&specialBarMenu); + plot.addAction(actionPlotArea); + plot.addAction(actionPlotPie); + plot.insertSeparator(); + + plot.addAction(actionPlot3DRibbon); + plot.addAction(actionPlot3DBars); + plot.addAction(actionPlot3DScatter); + plot.addAction(actionPlot3DTrajectory); + + plot.insertSeparator(); + + stat.addAction(actionBoxPlot); + stat.addAction(actionPlotHistogram); + stat.addAction(actionPlotStackedHistograms); + stat.insertSeparator(); + stat.addAction(actionStemPlot); + stat.setTitle(tr("Statistical &Graphs")); + plot.addMenu(&stat); + + plot.setTitle(tr("&Plot")); + contextMenu.addMenu(&plot); + contextMenu.insertSeparator(); + + contextMenu.addAction(QIcon(":/cut.png"),tr("Cu&t"), w, SLOT(cutSelection())); + contextMenu.addAction(QIcon(":/copy.png"),tr("&Copy"), w, SLOT(copySelection())); + contextMenu.addAction(QIcon(":/paste.png"),tr("Past&e"), w, SLOT(pasteSelection())); + contextMenu.insertSeparator(); + + QAction * xColID=colType.addAction(QIcon(":/x_col.png"), tr("&X"), this, SLOT(setXCol())); + xColID->setCheckable(true); + QAction * yColID=colType.addAction(QIcon(":/y_col.png"), tr("&Y"), this, SLOT(setYCol())); + yColID->setCheckable(true); + QAction * zColID=colType.addAction(QIcon(":/z_col.png"), tr("&Z"), this, SLOT(setZCol())); + zColID->setCheckable(true); + colType.insertSeparator(); + QAction * labelID = colType.addAction(QIcon(":/set_label_col.png"), tr("&Label"), this, SLOT(setLabelCol())); + labelID->setCheckable(true); + QAction * noneID=colType.addAction(QIcon(":/disregard_col.png"), tr("&None"), this, SLOT(disregardCol())); + noneID->setCheckable(true); + colType.insertSeparator(); + QAction * xErrColID =colType.addAction(tr("X E&rror"), this, SLOT(setXErrCol())); + xErrColID->setCheckable(true); + QAction * yErrColID = colType.addAction(QIcon(":/errors.png"), tr("Y &Error"), this, SLOT(setYErrCol())); + yErrColID->setCheckable(true); + colType.insertSeparator(); + + + if (w->colPlotDesignation(c) == Table::X) + xColID->setChecked(true); + else if (w->colPlotDesignation(c) == Table::Y) + yColID->setChecked(true); + else if (w->colPlotDesignation(c) == Table::Z) + zColID->setChecked(true); + else if (w->colPlotDesignation(c) == Table::xErr) + xErrColID->setChecked(true); + else if (w->colPlotDesignation(c) == Table::yErr) + yErrColID->setChecked(true); + else if (w->colPlotDesignation(c) == Table::Label) + labelID->setChecked(true); + else + noneID->setChecked(true); + + actionReadOnlyCol->addTo(&colType); + actionReadOnlyCol->setCheckable(true); + actionReadOnlyCol->setChecked(w->isReadOnlyColumn(c)); + + colType.setTitle(tr("Set As")); + contextMenu.addMenu(&colType); + + if (w){ + contextMenu.insertSeparator(); + + contextMenu.addAction(actionShowColumnValuesDialog); + contextMenu.addAction(actionTableRecalculate); + fill.addAction(actionSetAscValues); + fill.addAction(actionSetRandomValues); + fill.setTitle(tr("&Fill Column With")); + contextMenu.addMenu(&fill); + + norm.addAction(tr("&Column"), w, SLOT(normalizeSelection())); + norm.addAction(actionNormalizeTable); + norm.setTitle(tr("&Normalize")); + contextMenu.addMenu(& norm); + + contextMenu.insertSeparator(); + contextMenu.addAction(actionFrequencyCount); + contextMenu.addAction(actionShowColStatistics); + + contextMenu.insertSeparator(); + + contextMenu.addAction(QIcon(":/erase.png"), tr("Clea&r"), w, SLOT(clearSelection())); + contextMenu.addAction(QIcon(":/delete_column.png"), tr("&Delete"), w, SLOT(removeCol())); + contextMenu.addAction(actionHideSelectedColumns); + contextMenu.addAction(actionShowAllColumns); + contextMenu.insertSeparator(); + contextMenu.addAction(QIcon(":/insert_column.png"), tr("&Insert"), w, SLOT(insertCol())); + contextMenu.addAction(actionAddColToTable); + contextMenu.insertSeparator(); + + sorting.addAction(QIcon(":/sort_ascending.png"), tr("&Ascending"), w, SLOT(sortColAsc())); + sorting.addAction(QIcon(":/sort_descending.png"), tr("&Descending"), w, SLOT(sortColDesc())); + sorting.setTitle(tr("Sort Colu&mn")); + contextMenu.addMenu(&sorting); + + contextMenu.addAction(actionSortTable); + } + contextMenu.insertSeparator(); + contextMenu.addAction(actionAdjustColumnWidth); + contextMenu.addAction(actionShowColumnOptionsDialog); + } else if ((int)w->selectedColumns().count() > 1){ + plot.addAction(actionPlotL); + plot.addAction(actionPlotP); + plot.addAction(actionPlotLP); + + specialPlot.addAction(actionPlotVerticalDropLines); + specialPlot.addAction(actionPlotSpline); + specialPlot.addAction(actionPlotVertSteps); + specialPlot.addAction(actionPlotHorSteps); + specialPlot.insertSeparator(); + specialPlot.addAction(actionPlotDoubleYAxis); + specialPlot.addAction(actionWaterfallPlot); + specialPlot.addAction(actionAddZoomPlot); + specialPlot.setTitle(tr("Special Line/Symb&ol")); + plot.addMenu(&specialPlot); + plot.insertSeparator(); + plot.addAction(actionPlotVerticalBars); + plot.addAction(actionPlotHorizontalBars); + + specialBarMenu.addAction(actionStackBars); + specialBarMenu.addAction(actionStackColumns); + specialBarMenu.setTitle(tr("Spec&ial Bar/Column")); + plot.addMenu (&specialBarMenu);; + + plot.addAction(actionPlotArea); + plot.addAction(actionPlotVectXYXY); + plot.addAction(actionPlotVectXYAM); + plot.insertSeparator(); + stat.addAction(actionBoxPlot); + stat.addAction(actionPlotHistogram); + stat.addAction(actionPlotStackedHistograms); + stat.insertSeparator(); + stat.addAction(actionStemPlot); + stat.setTitle(tr("Statistical &Graphs")); + plot.addMenu(&stat); + + panels.addAction(actionPlot2VerticalLayers); + panels.addAction(actionPlot2HorizontalLayers); + panels.addAction(actionPlot4Layers); + panels.addAction(actionPlotStackedLayers); + panels.addAction(actionCustomLayout); + panels.setTitle(tr("Pa&nel")); + plot.addMenu(&panels); + + gridMenu.addAction(actionVertSharedAxisLayers); + gridMenu.addAction(actionHorSharedAxisLayers); + gridMenu.addAction(actionSharedAxesLayers); + gridMenu.addAction(actionStackSharedAxisLayers); + gridMenu.addAction(actionCustomSharedAxisLayers); + gridMenu.setTitle(tr("Shared A&xes Panel")); + plot.addMenu(&gridMenu); + + plot.setTitle(tr("&Plot")); + contextMenu.addMenu(&plot); + contextMenu.insertSeparator(); + contextMenu.addAction(QIcon(":/cut.png"),tr("Cu&t"), w, SLOT(cutSelection())); + contextMenu.addAction(QIcon(":/copy.png"),tr("&Copy"), w, SLOT(copySelection())); + contextMenu.addAction(QIcon(":/paste.png"),tr("Past&e"), w, SLOT(pasteSelection())); + contextMenu.insertSeparator(); + + if (w){ + contextMenu.addAction(QIcon(":/erase.png"),tr("Clea&r"), w, SLOT(clearSelection())); + contextMenu.addAction(QIcon(":/close.png"),tr("&Delete"), w, SLOT(removeCol())); + contextMenu.addAction(actionHideSelectedColumns); + contextMenu.addAction(actionShowAllColumns); + contextMenu.insertSeparator(); + contextMenu.addAction(tr("&Insert"), w, SLOT(insertCol())); + contextMenu.addAction(actionAddColToTable); + contextMenu.insertSeparator(); + } + + colType.addAction(actionSetXCol); + colType.addAction(actionSetYCol); + colType.addAction(actionSetZCol); + colType.insertSeparator(); + colType.addAction(actionSetLabelCol); + colType.addAction(actionDisregardCol); + colType.insertSeparator(); + colType.addAction(actionSetXErrCol); + colType.addAction(actionSetYErrCol); + colType.insertSeparator(); + colType.addAction(tr("&Read-only"), this, SLOT(setReadOnlyColumns())); + colType.addAction(tr("Read/&Write"), this, SLOT(setReadWriteColumns())); + colType.setTitle(tr("Set As")); + contextMenu.addMenu(&colType); + + if (w){ + contextMenu.insertSeparator(); + + fill.addAction(actionSetAscValues); + fill.addAction(actionSetRandomValues); + fill.setTitle(tr("&Fill Columns With")); + contextMenu.addMenu(&fill); + + norm.addAction(actionNormalizeSelection); + norm.addAction(actionNormalizeTable); + norm.setTitle(tr("&Normalize")); + contextMenu.addMenu(&norm); + + contextMenu.insertSeparator(); + contextMenu.addAction(actionSortSelection); + contextMenu.addAction(actionSortTable); + contextMenu.insertSeparator(); + contextMenu.addAction(actionShowColStatistics); + contextMenu.insertSeparator(); + contextMenu.addAction(actionAdjustColumnWidth); + } + } + + QPoint posMouse=QCursor::pos(); + contextMenu.exec(posMouse); +} + +void ApplicationWindow::plotVerticalSharedAxisLayers() +{ + multilayerPlot(1, 2, defaultCurveStyle, MultiLayer::AlignCanvases); +} + +void ApplicationWindow::plotHorizontalSharedAxisLayers() +{ + multilayerPlot(2, 1, defaultCurveStyle, MultiLayer::AlignCanvases); +} + +void ApplicationWindow::plotSharedAxesLayers() +{ + multilayerPlot(2, 2, defaultCurveStyle, MultiLayer::AlignCanvases); +} + +void ApplicationWindow::plotStackSharedAxisLayers() +{ + multilayerPlot(1, -1, defaultCurveStyle, MultiLayer::AlignCanvases); +} + +void ApplicationWindow::plotCustomLayout(bool sharedAxes) +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t || !validFor2DPlot(t, (Graph::CurveType)defaultCurveStyle)) + return; + + QStringList list = t->drawableColumnSelection(); + int curves = list.count(); + if(curves < 1){ + QMessageBox::warning(this, tr("QtiPlot - Plot error"), tr("Please select a Y column to plot!")); + return; + } + + LayerDialog *id = new LayerDialog(this, true); + id->setLayers(curves); + id->setRows(curves); + id->setMargins(5, 5, 5, 5); + id->setLayerCanvasSize(d_layer_canvas_width, d_layer_canvas_height, d_layer_geometry_unit); + if (sharedAxes) + id->setSharedAxes(); + id->exec(); +} + +void ApplicationWindow::plot2VerticalLayers() +{ + multilayerPlot(1, 2, defaultCurveStyle); +} + +void ApplicationWindow::plot2HorizontalLayers() +{ + multilayerPlot(2, 1, defaultCurveStyle); +} + +void ApplicationWindow::plot4Layers() +{ + multilayerPlot(2, 2, defaultCurveStyle); +} + +void ApplicationWindow::plotStackedLayers() +{ + multilayerPlot(1, -1, defaultCurveStyle); +} + +void ApplicationWindow::plotStackedHistograms() +{ + multilayerPlot(1, -1, Graph::Histogram); +} + +void ApplicationWindow::zoomRectanglePlot() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + QStringList lst = t->selectedYColumns(); + int cols = lst.size(); + if (cols < 1){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("You need to select at least one Y column for this operation!")); + return; + } + + Q3TableSelection sel = t->getSelection(); + MultiLayer *ml = multilayerPlot(t, lst, Graph::LineSymbols, sel.topRow(), sel.bottomRow()); + if (ml){ + Graph *ag = ml->activeLayer(); + ag->setTitle(""); + ag->setAxisTitle(QwtPlot::xBottom, " "); + ag->setAxisTitle(QwtPlot::yLeft, " "); + ag->setCanvasFrame(); + ag->drawAxesBackbones(false); + ag->showGrid(); + ag->removeLegend(); + + RectangleWidget *r = new RectangleWidget(ag); + QColor c = Qt::yellow; + c.setAlpha(100); + r->setBackgroundColor(c); + r->setFrameColor(Qt::blue); + ag->add(r, false); + + Graph *g = ml->addLayer(); + if (!g) + return; + + setPreferences(g); + g->setTitle(""); + g->setAxisTitle(QwtPlot::xBottom, " "); + g->setAxisTitle(QwtPlot::yLeft, " "); + g->copyCurves(ag); + g->drawAxesBackbones(false); + g->setCanvasFrame(); + g->setCanvasBackground(c); + + ml->setRows(2); + ml->setCols(1); + ml->arrangeLayers(false); + + QRect canvasRect = ag->canvas()->geometry(); + r->setRect(canvasRect.x(), canvasRect.bottom() - 50, 100, 50); + + g->setCanvasCoordinates(r->boundingRect()); + r->setLinkedLayer(1); + } +} + +void ApplicationWindow::plotDoubleYAxis() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + QStringList lst = t->selectedYColumns(); + int cols = lst.size(); + if (cols < 2){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("You need at least two columns for this operation!")); + return; + } + + Q3TableSelection sel = t->getSelection(); + MultiLayer *ml = multilayerPlot(t, lst, Graph::LineSymbols, sel.topRow(), sel.bottomRow()); + if (ml){ + Graph *g = ml->activeLayer(); + g->enableAxis(QwtPlot::yRight); + g->setAxisTitle(QwtPlot::yRight, tr("Y2 Axis Title")); + + QwtPlotCurve *c = g->curve(cols - 1); + if (c){ + c->setYAxis(QwtPlot::yRight); + g->setAutoScale(); + } + } +} + +void ApplicationWindow::showMatrixDialog() +{ + Matrix *m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + MatrixDialog* md = new MatrixDialog(this); + md->setMatrix (m); + md->exec(); +} + +void ApplicationWindow::showMatrixSizeDialog() +{ + Matrix *m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + MatrixSizeDialog* md = new MatrixSizeDialog(m, this); + md->exec(); +} + +void ApplicationWindow::showMatrixValuesDialog() +{ + Matrix *m = NULL; + MultiLayer *ml = (MultiLayer*)activeWindow(MultiLayerWindow); + if (ml){ + int curveIndex = actionSetMatrixValues->data().toInt(); + Graph *g = ml->activeLayer(); + if (g){ + Spectrogram *sp = (Spectrogram *)g->plotItem(curveIndex); + if (sp) + m = sp->matrix(); + } + } else + m = (Matrix*)activeWindow(MatrixWindow); + + if (!m) + return; + + MatrixValuesDialog* md = new MatrixValuesDialog(scriptEnv, this); + md->setMatrix(m); + if (d_completion) + md->setCompleter(d_completer); + md->exec(); +} + +void ApplicationWindow::showColumnOptionsDialog() +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + if(t->selectedColumns().count()>0) { + TableDialog* td = new TableDialog(t, this); + td->setAttribute(Qt::WA_DeleteOnClose); + td->exec(); + } else + QMessageBox::warning(this, tr("QtiPlot"), tr("Please select a column first!")); +} + +void ApplicationWindow::showGeneralPlotDialog() +{ + MdiSubWindow* plot = activeWindow(); + if (!plot) + return; + + if (plot->isA("MultiLayer") && ((MultiLayer*)plot)->numLayers()) + showPlotDialog(); + else if (plot->isA("Graph3D")){ + QDialog* gd = showScaleDialog(); + ((Plot3DDialog*)gd)->showGeneralTab(); + } +} + +void ApplicationWindow::showAxisDialog() +{ + MdiSubWindow* plot = activeWindow(); + if (!plot) + return; + + QDialog* gd = showScaleDialog(); + if (gd && plot->isA("MultiLayer") && ((MultiLayer*)plot)->numLayers()) + ((AxesDialog*)gd)->showAxesPage(); + else if (gd && plot->isA("Graph3D")) + ((Plot3DDialog*)gd)->showAxisTab(); +} + +void ApplicationWindow::showGridDialog() +{ + AxesDialog* gd = (AxesDialog*)showScaleDialog(); + if (gd) + gd->showGridPage(); +} + +QDialog* ApplicationWindow::showScaleDialog() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return 0; + + if (w->isA("MultiLayer")){ + if (((MultiLayer*)w)->isEmpty()) + return 0; + + Graph* g = ((MultiLayer*)w)->activeLayer(); + if (g->isPiePlot()){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), tr("This functionality is not available for pie plots!")); + return 0; + } + + AxesDialog* ad = new AxesDialog(this); + ad->setGraph(g); + ad->exec(); + return ad; + } else if (w->isA("Graph3D")) + return showPlot3dDialog(); + + return 0; +} + +AxesDialog* ApplicationWindow::showScalePageFromAxisDialog(int axisPos) +{ + AxesDialog* gd = (AxesDialog*)showScaleDialog(); + if (gd) + gd->setCurrentScale(axisPos); + + return gd; +} + +AxesDialog* ApplicationWindow::showAxisPageFromAxisDialog(int axisPos) +{ + AxesDialog* gd = (AxesDialog*)showScaleDialog(); + if (gd){ + gd->showAxesPage(); + gd->setCurrentScale(axisPos); + } + return gd; +} + +QDialog* ApplicationWindow::showPlot3dDialog() +{ + Graph3D *g = (Graph3D*)activeWindow(Plot3DWindow); + if (!g) + return 0; + + if (!g->hasData()){ + QApplication::restoreOverrideCursor(); + QMessageBox::warning(this, tr("QtiPlot - Warning"), + tr("Not available for empty 3D surface plots!")); + return 0; + } + + Plot3DDialog* pd = new Plot3DDialog(this); + pd->setPlot(g); + pd->show(); + return pd; +} + +void ApplicationWindow::showPlotDialog(int curveIndex) +{ + MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!w) + return; + + PlotDialog* pd = new PlotDialog(d_extended_plot_dialog, this); + pd->insertColumnsList(columnsList(Table::All)); + pd->setMultiLayer(w); + if (curveIndex >= 0){ + Graph *g = w->activeLayer(); + if (g) + pd->selectCurve(curveIndex); + } + pd->initFonts(plotTitleFont, plotAxesFont, plotNumbersFont, plotLegendFont); + pd->showAll(d_extended_plot_dialog); + pd->show(); + +} + +void ApplicationWindow::showCurvePlotDialog() +{ + showPlotDialog(actionShowCurvePlotDialog->data().toInt()); +} + +void ApplicationWindow::showCurveContextMenu(QwtPlotItem *cv) +{ + if (!cv || !cv->isVisible()) + return; + + MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!w) + return; + + Graph *g = w->activeLayer(); + if (!g) + return; + + int curveIndex = g->curveIndex(cv); + if (curveIndex < 0 || curveIndex >= g->curveCount()) + return; + + QMenu curveMenu(this); + curveMenu.addAction(cv->title().text(), this, SLOT(showCurvePlotDialog())); + curveMenu.insertSeparator(); + + curveMenu.addAction(actionHideCurve); + actionHideCurve->setData(curveIndex); + + int type = ((PlotCurve *)cv)->type(); + bool spectrogram = (cv->rtti() == QwtPlotItem::Rtti_PlotSpectrogram) ? true : false; + if (g->visibleCurves() > 1 && (type == Graph::Function || spectrogram)){ + curveMenu.addAction(actionHideOtherCurves); + actionHideOtherCurves->setData(curveIndex); + } else if (type != Graph::Function && !spectrogram) { + if ((g->visibleCurves() - ((DataCurve *)cv)->errorBarsList().count()) > 1) { + curveMenu.addAction(actionHideOtherCurves); + actionHideOtherCurves->setData(curveIndex); + } + } + + if (g->visibleCurves() != g->curveCount()) + curveMenu.addAction(actionShowAllCurves); + curveMenu.insertSeparator(); + + if (g->rangeSelectorsEnabled() || (g->activeTool() && + g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker)) + curveMenu.addAction(actionCopySelection); + if (spectrogram){ + curveMenu.insertSeparator(); + curveMenu.addAction(actionSetMatrixValues); + actionSetMatrixValues->setData(curveIndex); + } else if (type != Graph::Function && type != Graph::ErrorBars){ + if (g->rangeSelectorsEnabled() || (g->activeTool() && + g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker)){ + curveMenu.addAction(actionCutSelection); + curveMenu.addAction(actionPasteSelection); + if (g->activeTool() && g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker){ + DataPickerTool *dpt = (DataPickerTool *)g->activeTool(); + if (dpt){ + QAction *act = new QAction(tr("Paste Selection as Te&xt"), this); + connect(act, SIGNAL(activated()), dpt, SLOT(pasteSelectionAsLayerText())); + curveMenu.addAction(act); + } + } + + curveMenu.addAction(actionClearSelection); + curveMenu.insertSeparator(); + if (g->rangeSelectorsEnabled()){ + QAction *act = new QAction(tr("Set Display Range"), this); + connect(act, SIGNAL(activated()), g->rangeSelectorTool(), SLOT(setCurveRange())); + curveMenu.addAction(act); + } + } + + curveMenu.addAction(actionEditCurveRange); + actionEditCurveRange->setData(curveIndex); + + curveMenu.addAction(actionCurveFullRange); + if (((DataCurve *)cv)->isFullRange()) + actionCurveFullRange->setDisabled(true); + else + actionCurveFullRange->setEnabled(true); + actionCurveFullRange->setData(curveIndex); + + curveMenu.insertSeparator(); + } + + curveMenu.addAction(actionShowCurveWorksheet); + actionShowCurveWorksheet->setData(curveIndex); + + curveMenu.addAction(actionShowCurvePlotDialog); + actionShowCurvePlotDialog->setData(curveIndex); + + curveMenu.insertSeparator(); + + curveMenu.addAction(actionRemoveCurve); + actionRemoveCurve->setData(curveIndex); + curveMenu.exec(QCursor::pos()); +} + +void ApplicationWindow::showAllCurves() +{ + MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!w) + return; + + Graph* g = w->activeLayer(); + if (!g) + return; + + for(int i=0; i< g->curveCount(); i++) + g->showCurve(i); + g->replot(); +} + +void ApplicationWindow::hideOtherCurves() +{ + MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!w) + return; + + Graph* g = w->activeLayer(); + if (!g) + return; + + for(int i=0; i< g->curveCount(); i++) + g->showCurve(i, false); + + g->showCurve(actionHideOtherCurves->data().toInt()); + g->replot(); +} + +void ApplicationWindow::hideCurve() +{ + MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!w) + return; + + Graph* g = w->activeLayer(); + if (!g) + return; + + g->showCurve(actionHideCurve->data().toInt(), false); +} + +void ApplicationWindow::removeCurve() +{ + MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!w) + return; + + Graph* g = w->activeLayer(); + if (!g) + return; + + g->removeCurve(actionRemoveCurve->data().toInt()); + g->updatePlot(); +} + +void ApplicationWindow::showCurveWorksheet(Graph *g, int curveIndex) +{ + if (!g) + return; + + const QwtPlotItem *it = g->plotItem(curveIndex); + if (!it) + return; + + if (it->rtti() == QwtPlotItem::Rtti_PlotSpectrogram){ + Spectrogram *sp = (Spectrogram *)it; + if (sp->matrix()) + sp->matrix()->showMaximized(); + } else if (((PlotCurve *)it)->type() == Graph::Function) + g->createTable((PlotCurve *)it); + else { + showTable(it->title().text()); + if (g->activeTool() && g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker) + ((DataPickerTool *)g->activeTool())->selectTableRow(); + } +} + +void ApplicationWindow::showCurveWorksheet() +{ + MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!w) + return; + + Graph* g = w->activeLayer(); + if (!g) + return; + + showCurveWorksheet(g, actionShowCurveWorksheet->data().toInt()); +} + +void ApplicationWindow::magnify(int mode) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + if (plot->isEmpty()){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setOn(true); + return; + } + + QList layers = plot->layersList(); + foreach(Graph *g, layers) + g->enablePanningMagnifier(true, mode); +} + +void ApplicationWindow::zoomIn() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + if (plot->isEmpty()) + { + QMessageBox::warning(this, tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setOn(true); + return; + } + + if ((Graph*)plot->activeLayer()->isPiePlot()) + { + if (btnZoomIn->isOn()) + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("This functionality is not available for pie plots!")); + btnPointer->setOn(true); + return; + } + + QList layers = plot->layersList(); + foreach(Graph *g, layers){ + if (!g->isPiePlot()) + g->zoom(true); + } +} + +void ApplicationWindow::zoomOut() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + if (plot->isEmpty() || (Graph*)plot->activeLayer()->isPiePlot()) + return; + + ((Graph*)plot->activeLayer())->zoomOut(); + btnPointer->setOn(true); +} + +void ApplicationWindow::setAutoScale() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

")); + return; + } + + Graph *g = (Graph*)plot->activeLayer(); + if (g) + g->setAutoScale(); +} + +void ApplicationWindow::removePoints() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()) + { + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setChecked(true); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + { + btnPointer->setChecked(true); + return; + } + + if (g->isPiePlot()) + { + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("This functionality is not available for pie plots!")); + btnPointer->setChecked(true); + return; + } + else + { + switch(QMessageBox::warning (this,tr("QtiPlot"), + tr("This will modify the data in the worksheets!\nAre you sure you want to continue?"), + tr("Continue"),tr("Cancel"),0,1)) + { + case 0: + g->setActiveTool(new DataPickerTool(g, this, DataPickerTool::Remove, info, SLOT(setText(const QString&)))); + displayBar->show(); + break; + + case 1: + btnPointer->setChecked(true); + break; + } + } +} + +void ApplicationWindow::movePoints(bool wholeCurve) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setChecked(true); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (!g || !g->validCurvesDataSize()){ + btnPointer->setChecked(true); + return; + } + + if (g->isPiePlot()){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), + tr("This functionality is not available for pie plots!")); + + btnPointer->setChecked(true); + return; + } else { + switch(QMessageBox::warning (this, tr("QtiPlot"), + tr("This will modify the data in the worksheets!\nAre you sure you want to continue?"), + tr("Continue"), tr("Cancel"), 0, 1)) + { + case 0: + if (g){ + DataPickerTool *tool = new DataPickerTool(g, this, DataPickerTool::Move, info, SLOT(setText(const QString&))); + if (wholeCurve) + tool->setMode(DataPickerTool::MoveCurve); + g->setActiveTool(tool); + displayBar->show(); + } + break; + + case 1: + btnPointer->setChecked(true); + break; + } + } +} + +void ApplicationWindow::exportPDF() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if(qobject_cast(w) && ((MultiLayer *)w)->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

")); + return; + } + + if (qobject_cast(w) || qobject_cast(w)){ + exportGraph("*.pdf"); + return; + } else if (qobject_cast(w)){ + exportMatrix("*.pdf"); + return; + } + + QString fname = getFileName(this, tr("Choose a filename to save under"), + imagesDirPath + "/" + w->objectName(), "*.pdf", 0, true, d_confirm_overwrite); + if (!fname.isEmpty() ){ + QFileInfo fi(fname); + QString baseName = fi.fileName(); + if (!baseName.contains(".")) + fname.append(".pdf"); + + imagesDirPath = fi.dirPath(true); + + QFile f(fname); + if (!f.open(QIODevice::WriteOnly)){ + QMessageBox::critical(this, tr("QtiPlot - Export error"), + tr("Could not write to file:

%1

Please verify that you have the right to write to this location or that the file is not being used by another application!").arg(fname)); + return; + } + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + w->exportPDF(fname); + QApplication::restoreOverrideCursor(); + } +} + +//print active window +void ApplicationWindow::print() +{ + MdiSubWindow* w = activeWindow(); + if (!w) + return; + + if (w->isA("MultiLayer") && ((MultiLayer *)w)->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

")); + return; + } + w->print(); +} + +//print preview for active window +void ApplicationWindow::printPreview() +{ + MdiSubWindow* w = activeWindow(); + if (!w) + return; + + if (w->isA("MultiLayer") && ((MultiLayer *)w)->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

")); + return; + } + + QPrinter p; + p.setPaperSize(d_print_paper_size); + p.setOrientation(d_printer_orientation); + + QPrintPreviewDialog *preview = new QPrintPreviewDialog(&p, this, Qt::Window); + preview->setWindowTitle(tr("QtiPlot") + " - " + tr("Print preview of window: ") + w->objectName()); + connect(preview, SIGNAL(paintRequested(QPrinter *)), w, SLOT(print(QPrinter *))); + connect(preview, SIGNAL(paintRequested(QPrinter *)), this, SLOT(setPrintPreviewOptions(QPrinter *))); + + preview->exec(); +} + + +void ApplicationWindow::setPrintPreviewOptions(QPrinter *printer) +{ + if (!printer) + return; + + d_print_paper_size = printer->paperSize(); + d_printer_orientation = printer->orientation(); +} + +void ApplicationWindow::printAllPlots() +{ + QPrinter printer; + printer.setOrientation(QPrinter::Landscape); + printer.setColorMode (QPrinter::Color); + printer.setFullPage(true); + + if (printer.setup()) + { + QPainter *paint = new QPainter (&printer); + + int plots = 0; + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")) + plots++; + } + + printer.setMinMax (0, plots); + printer.setFromTo (0, plots); + + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer") && printer.newPage()) + ((MultiLayer*)w)->printAllLayers(paint); + } + paint->end(); + delete paint; + } +} + +void ApplicationWindow::showExpGrowthDialog() +{ + showExpDecayDialog(-1); +} + +void ApplicationWindow::showExpDecayDialog() +{ + showExpDecayDialog(1); +} + +void ApplicationWindow::showExpDecayDialog(int type) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + return; + + ExpDecayDialog *edd = new ExpDecayDialog(type, this); + edd->setGraph(g); + edd->show(); +} + +void ApplicationWindow::showTwoExpDecayDialog() +{ + showExpDecayDialog(2); +} + +void ApplicationWindow::showExpDecay3Dialog() +{ + showExpDecayDialog(3); +} + +void ApplicationWindow::showFitDialog() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + MultiLayer* plot = 0; + if(w->isA("MultiLayer")) + plot = (MultiLayer*)w; + else if(w->inherits("Table")){ + QStringList columnsLst = ((Table *)w)->drawableColumnSelection(); + if (columnsLst.isEmpty()){ + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), + tr("Please select a 'Y' column first!")); + return; + } + plot = multilayerPlot((Table *)w, columnsLst, Graph::LineSymbols); + } + + if (!plot) + return; + + Graph* g = (Graph*)plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + return; + + FitDialog *fd = new FitDialog(g, this); + connect (plot, SIGNAL(destroyed()), fd, SLOT(close())); + + fd->setSrcTables(tableList()); + fd->show(); + fd->resize(fd->minimumSize()); +} + +void ApplicationWindow::showFilterDialog(int filter) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if ( g && g->validCurvesDataSize()){ + FilterDialog *fd = new FilterDialog(filter, this); + fd->setGraph(g); + fd->exec(); + } +} + +void ApplicationWindow::lowPassFilterDialog() +{ + showFilterDialog(FFTFilter::LowPass); +} + +void ApplicationWindow::highPassFilterDialog() +{ + showFilterDialog(FFTFilter::HighPass); +} + +void ApplicationWindow::bandPassFilterDialog() +{ + showFilterDialog(FFTFilter::BandPass); +} + +void ApplicationWindow::bandBlockFilterDialog() +{ + showFilterDialog(FFTFilter::BandBlock); +} + +void ApplicationWindow::showFFTDialog() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + FFTDialog *sd = 0; + if (w->isA("MultiLayer")) { + Graph* g = ((MultiLayer*)w)->activeLayer(); + if ( g && g->validCurvesDataSize() ){ + sd = new FFTDialog(FFTDialog::onGraph, this); + sd->setGraph(g); + } + } else if (w->inherits("Table")) { + sd = new FFTDialog(FFTDialog::onTable, this); + sd->setTable((Table*)w); + } else if (w->inherits("Matrix")) { + sd = new FFTDialog(FFTDialog::onMatrix, this); + sd->setMatrix((Matrix*)w); + } + + if (sd) + sd->exec(); +} + +void ApplicationWindow::showSmoothDialog(int m) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + return; + + SmoothCurveDialog *sd = new SmoothCurveDialog(m, this); + sd->setGraph(g); + sd->exec(); +} + +void ApplicationWindow::showSmoothSavGolDialog() +{ + showSmoothDialog(SmoothFilter::SavitzkyGolay); +} + +void ApplicationWindow::showSmoothFFTDialog() +{ + showSmoothDialog(SmoothFilter::FFT); +} + +void ApplicationWindow::showSmoothAverageDialog() +{ + showSmoothDialog(SmoothFilter::Average); +} + +void ApplicationWindow::showSmoothLowessDialog() +{ + showSmoothDialog(SmoothFilter::Lowess); +} + +void ApplicationWindow::showInterpolationDialog() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + return; + + InterpolationDialog *id = new InterpolationDialog(this); + id->setGraph(g); + id->show(); +} + +void ApplicationWindow::showFitPolynomDialog() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + return; + + PolynomFitDialog *pfd = new PolynomFitDialog(this); + pfd->setGraph(g); + pfd->show(); +} + +void ApplicationWindow::updateLog(const QString& result) +{ + if ( !result.isEmpty() ){ + current_folder->appendLogInfo(result); + showResults(true); + emit modified(); + } +} + +void ApplicationWindow::showIntegrationDialog() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g) + return; + + IntDialog *id = new IntDialog(this, g); + id->exec(); +} + +void ApplicationWindow::showResults(bool ok) +{ + if (ok){ + if (!current_folder->logInfo().isEmpty()) + results->setText(current_folder->logInfo()); + else + results->setText(tr("Sorry, there are no results to display!")); + + logWindow->show(); + QTextCursor cur = results->textCursor(); + cur.movePosition(QTextCursor::End); + results->setTextCursor(cur); + } else + logWindow->hide(); +} + +void ApplicationWindow::showResults(const QString& s, bool ok) +{ + current_folder->appendLogInfo(s); + + QString logInfo = current_folder->logInfo(); + if (!logInfo.isEmpty()) + results->setText(logInfo); + showResults(ok); +} + +void ApplicationWindow::showScreenReader() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setChecked(true); + return; + } + + QList layers = plot->layersList(); + foreach(Graph *g, layers) + g->setActiveTool(new ScreenPickerTool(g, info, SLOT(setText(const QString&)))); + + displayBar->show(); +} + +void ApplicationWindow::drawPoints() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setChecked(true); + return; + } + + QList layers = plot->layersList(); + foreach(Graph *g, layers) + g->setActiveTool(new DrawPointTool(this, g, info, SLOT(setText(const QString&)))); + + displayBar->show(); +} + +void ApplicationWindow::showRangeSelectors() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), tr("There are no plot layers available in this window!")); + btnPointer->setChecked(true); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (!g) + return; + + if (!g->curveCount()){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), tr("There are no curves available on this plot!")); + btnPointer->setChecked(true); + return; + } else if (g->isPiePlot()) { + QMessageBox::warning(this, tr("QtiPlot - Warning"), tr("This functionality is not available for pie plots!")); + btnPointer->setChecked(true); + return; + } + + displayBar->show(); + g->enableRangeSelectors(info, SLOT(setText(const QString&))); +} + +void ApplicationWindow::showCursor() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setChecked(true); + return; + } + + if ((Graph*)plot->activeLayer()->isPiePlot()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("This functionality is not available for pie plots!")); + btnPointer->setChecked(true); + return; + } + + QList layers = plot->layersList(); + foreach(Graph *g, layers){ + if (g->isPiePlot() || !g->curveCount()) + continue; + if (g->validCurvesDataSize()) + g->setActiveTool(new DataPickerTool(g, this, DataPickerTool::Display, info, SLOT(setText(const QString&)))); + } + displayBar->show(); +} + +void ApplicationWindow::newLegend() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if ( g ) + g->newLegend(); +} + +void ApplicationWindow::addTimeStamp() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()) + { + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if ( g ) + g->addTimeStamp(); +} + +void ApplicationWindow::addRectangle() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph *g = (Graph*)plot->activeLayer(); + if (!g){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("There are no layers available on this plot. Operation aborted!")); + return; + } + + g->setActiveTool(new AddWidgetTool(AddWidgetTool::Rectangle, g, actionAddRectangle, info, SLOT(setText(const QString&)))); + btnPointer->setOn(false); +} + +void ApplicationWindow::addEllipse() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph *g = (Graph*)plot->activeLayer(); + if (!g){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("There are no layers available on this plot. Operation aborted!")); + return; + } + + g->setActiveTool(new AddWidgetTool(AddWidgetTool::Ellipse, g, actionAddEllipse, info, SLOT(setText(const QString&)))); + btnPointer->setOn(false); +} + +void ApplicationWindow::addTexFormula() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph *g = (Graph*)plot->activeLayer(); + if (!g){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("There are no layers available on this plot. Operation aborted!")); + return; + } + + g->setActiveTool(new AddWidgetTool(AddWidgetTool::TexEquation, g, actionAddFormula, info, SLOT(setText(const QString&)))); + btnPointer->setOn(false); +} + +void ApplicationWindow::addText() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + Graph *g = (Graph*)plot->activeLayer(); + if (g){ + g->setActiveTool(new AddWidgetTool(AddWidgetTool::Text, g, actionAddText, info, SLOT(setText(const QString&)))); + btnPointer->setOn(false); + } +} + +void ApplicationWindow::addImage() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (!g) + return; + + QString fn = getFileName(this, tr("QtiPlot - Insert image from file"), imagesDirPath, imageFilter(), 0, false); + if ( !fn.isEmpty() ){ + QFileInfo fi(fn); + imagesDirPath = fi.dirPath(true); + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + g->addImage(fn); + QApplication::restoreOverrideCursor(); + } +} + +void ApplicationWindow::drawLine() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()) + { + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + + btnPointer->setChecked(true); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (g) + { + g->drawLine(true); + emit modified(); + } +} + +void ApplicationWindow::drawArrow() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()) + { + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + + btnPointer->setOn(true); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (g){ + g->drawLine(true, 1); + emit modified(); + } +} + +void ApplicationWindow::showLayerDialog() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + if(plot->isEmpty()){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), + tr("There are no plot layers available in this window.")); + return; + } + + LayerDialog *id = new LayerDialog(this); + id->setMultiLayer(plot); + id->exec(); +} + +void ApplicationWindow::showEnrichementDialog() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g) + return; + + EnrichmentDialog::WidgetType wt = EnrichmentDialog::Frame; + LegendWidget *l = (LegendWidget *)g->activeText(); + if (l) + wt = EnrichmentDialog::Text; + else if (qobject_cast(g->activeEnrichment())) + wt = EnrichmentDialog::Image; + else if (qobject_cast(g->activeEnrichment())) + wt = EnrichmentDialog::Tex; + else if (qobject_cast(g->activeEnrichment())) + wt = EnrichmentDialog::Ellipse; + + EnrichmentDialog *ed = new EnrichmentDialog(wt, g, this); + ed->setWidget(g->activeEnrichment()); + ed->exec(); + + g->deselectMarker(); +} + +void ApplicationWindow::showLineDialog() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (g){ + ArrowMarker *lm = g->selectedArrow(); + if (!lm) + return; + + LineDialog *ld = new LineDialog(lm, this); + ld->exec(); + + g->deselectMarker(); + } +} + +void ApplicationWindow::addColToTable() +{ + Table* m = (Table*)activeWindow(TableWindow); + if ( m ) + m->addCol(); +} + +void ApplicationWindow::clearSelection() +{ + if(lv->hasFocus()){ + deleteSelectedItems(); + return; + } + + MdiSubWindow* m = activeWindow(); + if (!m) + return; + + if (m->inherits("Table")) + ((Table*)m)->clearSelection(); + else if (m->isA("Matrix")) + ((Matrix*)m)->clearSelection(); + else if (m->isA("MultiLayer")){ + Graph* g = ((MultiLayer*)m)->activeLayer(); + if (!g) + return; + + if (((MultiLayer*)m)->hasSelectedLayers()){ + ((MultiLayer*)m)->confirmRemoveLayer(); + emit modified(); + return; + } + + if (g->rangeSelectorsEnabled()) + g->rangeSelectorTool()->clearSelection(); + else if (g->activeTool() && g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker) + ((DataPickerTool *)g->activeTool())->removePoint(); + else if (g->titleSelected()) + g->clearTitle(); + else if (g->axisTitleSelected()){ + QwtScaleWidget *axis = g->currentScale(); + if (axis) + axis->setTitle(" "); + } else + g->removeMarker(); + } + else if (m->isA("Note")) + ((Note*)m)->currentEditor()->textCursor().removeSelectedText(); + emit modified(); +} + +void ApplicationWindow::copySelection() +{ + if(results->hasFocus()){ + results->copy(); + return; + } else if(info->hasFocus()) { + info->copy(); + return; + } + + MdiSubWindow* m = activeWindow(); + if (!m) + return; + + if (m->inherits("Table")) + ((Table*)m)->copySelection(); + else if (m->isA("Matrix")) + ((Matrix*)m)->copySelection(); + else if (m->isA("MultiLayer")){ + MultiLayer* plot = (MultiLayer*)m; + if (!plot || plot->numLayers() == 0) + return; + + Graph* g = (Graph*)plot->activeLayer(); + if (!g) + return; + + if (g->rangeSelectorsEnabled()) + g->rangeSelectorTool()->copySelection(); + else if (g->activeTool() && g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker) + ((DataPickerTool *)g->activeTool())->copySelection(); + else if (g->markerSelected()) + copyMarker(); + else + copyActiveLayer(); + } else if (m->isA("Note")) + ((Note*)m)->currentEditor()->copy(); +} + +void ApplicationWindow::cutSelection() +{ + MdiSubWindow* m = activeWindow(); + if (!m) + return; + + if (m->inherits("Table")) + ((Table*)m)->cutSelection(); + else if (m->isA("Matrix")) + ((Matrix*)m)->cutSelection(); + else if(m->isA("MultiLayer")){ + MultiLayer* plot = (MultiLayer*)m; + if (!plot || plot->numLayers() == 0) + return; + + Graph* g = (Graph*)plot->activeLayer(); + if (!g) + return; + + if (g->rangeSelectorsEnabled()) + g->rangeSelectorTool()->cutSelection(); + else if (g->activeTool() && g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker) + ((DataPickerTool *)g->activeTool())->cutSelection(); + else { + copyMarker(); + g->removeMarker(); + } + } else if (m->isA("Note")) + ((Note*)m)->currentEditor()->cut(); + + emit modified(); +} + +void ApplicationWindow::copyMarker() +{ + lastCopiedLayer = NULL; + + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (g && g->markerSelected()){ + d_enrichement_copy = NULL; + d_arrow_copy = NULL; + if (g->activeEnrichment()) + d_enrichement_copy = g->activeEnrichment(); + else if (g->arrowMarkerSelected()) + d_arrow_copy = g->selectedArrow(); + } +} + +void ApplicationWindow::pasteSelection() +{ + MdiSubWindow* m = activeWindow(); + if (!m) + return; + + if (m->inherits("Table")) + ((Table*)m)->pasteSelection(); + else if (m->isA("Matrix")) + ((Matrix*)m)->pasteSelection(); + else if (m->isA("Note")) + ((Note*)m)->currentEditor()->paste(); + else if (m->isA("MultiLayer")){ + MultiLayer* plot = (MultiLayer*)m; + if (!plot) + return; + + if (lastCopiedLayer){ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + Graph* g = plot->addLayer(); + g->copy(lastCopiedLayer); + QPoint pos = plot->canvas()->mapFromGlobal(QCursor::pos()); + g->setCanvasGeometry(pos.x(), pos.y(), lastCopiedLayer->canvas()->width(), lastCopiedLayer->canvas()->height()); + + QApplication::restoreOverrideCursor(); + } else { + if (plot->numLayers() == 0) + return; + + Graph* g = (Graph*)plot->activeLayer(); + if (!g) + return; + + if (g->rangeSelectorsEnabled()) + g->rangeSelectorTool()->pasteSelection(); + else if (g->activeTool() && g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker) + ((DataPickerTool *)g->activeTool())->pasteSelection(); + else if (d_enrichement_copy){ + FrameWidget *t = g->add(d_enrichement_copy); + QPoint pos = g->mapFromGlobal(QCursor::pos()); + if (g->geometry().contains(pos)) + t->move(pos); + else + t->move(g->pos()); + } else if (d_arrow_copy){ + ArrowMarker *a = g->addArrow(d_arrow_copy); + a->setStartPoint(d_arrow_copy->startPointCoord().x(), d_arrow_copy->startPointCoord().y()); + a->setEndPoint(d_arrow_copy->endPointCoord().x(), d_arrow_copy->endPointCoord().y()); + //translate the new arrow 10 pixels to the right; + a->setStartPoint(a->startPoint() + QPoint(10, 0)); + a->setEndPoint(a->endPoint() + QPoint(10, 0)); + g->replot(); + g->deselectMarker(); + } + } + } + emit modified(); +} + +MdiSubWindow* ApplicationWindow::clone(MdiSubWindow* w) +{ + if (!w) { + w = activeWindow(); + if (!w){ + QMessageBox::critical(this,tr("QtiPlot - Duplicate window error"), + tr("There are no windows available in this folder!")); + return 0; + } + } + + MdiSubWindow* nw = 0; + MdiSubWindow::Status status = w->status(); + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + if (w->isA("MultiLayer")){ + MultiLayer *g = (MultiLayer *)w; + nw = multilayerPlot(generateUniqueName(tr("Graph")), 0, g->getRows(), g->getCols()); + ((MultiLayer *)nw)->copy(g); + } else if (w->inherits("Table")){ + Table *t = (Table *)w; + QString caption = generateUniqueName(tr("Table")); + nw = newTable(caption, t->numRows(), t->numCols()); + ((Table *)nw)->copy(t); + } else if (w->isA("Graph3D")){ + Graph3D *g = (Graph3D *)w; + if (!g->hasData()){ + QApplication::restoreOverrideCursor(); + QMessageBox::warning(this, tr("QtiPlot - Duplicate error"), tr("Empty 3D surface plots cannot be duplicated!")); + return 0; + } + nw = newPlot3D(); + if (!nw) + return 0; + if (status == MdiSubWindow::Maximized) + nw->hide(); + ((Graph3D *)nw)->copy(g); + customToolBars(nw); + } else if (w->isA("Matrix")){ + nw = newMatrix(((Matrix *)w)->numRows(), ((Matrix *)w)->numCols()); + ((Matrix *)nw)->copy((Matrix *)w); + } else if (w->isA("Note")){ + nw = newNote(); + if (nw){ + ((Note*)nw)->setText(((Note*)w)->text()); + ((Note*)nw)->showLineNumbers(((Note*)w)->hasLineNumbers()); + } + } + + if (nw){ + if (w->isA("MultiLayer")){ + if (status == MdiSubWindow::Maximized) + nw->showMaximized(); + } else if (w->isA("Graph3D")){ + ((Graph3D*)nw)->setIgnoreFonts(true); + if (status != MdiSubWindow::Maximized){ + nw->resize(w->size()); + nw->showNormal(); + } else + nw->showMaximized(); + ((Graph3D*)nw)->setIgnoreFonts(false); + } else { + nw->resize(w->size()); + nw->showNormal(); + } + + nw->setWindowLabel(w->windowLabel()); + nw->setCaptionPolicy(w->captionPolicy()); + setListViewSize(nw->objectName(), w->sizeToString()); + } + QApplication::restoreOverrideCursor(); + customMenu(nw); + return nw; +} + +void ApplicationWindow::undo() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + if (qobject_cast(w)) + ((Note*)w)->currentEditor()->undo(); + else if (qobject_cast(w)){ + QUndoStack *stack = ((Matrix *)w)->undoStack(); + if (stack && stack->canUndo()) + stack->undo(); + } + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::redo() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + if (qobject_cast(w)) + ((Note*)w)->currentEditor()->redo(); + else if (qobject_cast(w)){ + QUndoStack *stack = ((Matrix *)w)->undoStack(); + if (stack && stack->canRedo()) + stack->redo(); + } + QApplication::restoreOverrideCursor(); +} + +bool ApplicationWindow::hidden(QWidget* window) +{ + if (hiddenWindows->contains(window)) + return true; + + return false; +} + +void ApplicationWindow::updateWindowStatus(MdiSubWindow* w) +{ + setListView(w->objectName(), w->aspect()); + if (w->status() == MdiSubWindow::Maximized){ + QList windows = current_folder->windowsList(); + foreach(MdiSubWindow *oldMaxWindow, windows){ + if (oldMaxWindow != w && oldMaxWindow->status() == MdiSubWindow::Maximized) + oldMaxWindow->setStatus(MdiSubWindow::Normal); + } + } + modifiedProject(); +} + +void ApplicationWindow::hideActiveWindow() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + hideWindow(w); +} + +void ApplicationWindow::hideWindow(MdiSubWindow* w) +{ + hiddenWindows->append(w); + w->setHidden(); + emit modified(); +} + +void ApplicationWindow::hideWindow() +{ + WindowListItem *it = (WindowListItem *)lv->currentItem(); + MdiSubWindow *w = it->window(); + if (!w) + return; + + hideWindow(w); +} + +void ApplicationWindow::resizeActiveWindow() +{ + MdiSubWindow* w = activeWindow(); + if (!w) + return; + + EnrichmentDialog *ed = new EnrichmentDialog(EnrichmentDialog::MDIWindow, NULL, this); + ed->setWidget(w); + ed->exec(); +} + +void ApplicationWindow::resizeWindow() +{ + WindowListItem *it = (WindowListItem *)lv->currentItem(); + MdiSubWindow *w = it->window(); + if (!w) + return; + + d_workspace->setActiveSubWindow(w); + + EnrichmentDialog *ed = new EnrichmentDialog(EnrichmentDialog::MDIWindow, NULL, this); + ed->setWidget(w); + ed->exec(); +} + +void ApplicationWindow::activateWindow() +{ + WindowListItem *it = (WindowListItem *)lv->currentItem(); + activateWindow(it->window()); +} + +void ApplicationWindow::activateWindow(MdiSubWindow *w) +{ + if (!w) + return; + + w->setNormal(); + d_workspace->setActiveSubWindow(w); + + updateWindowLists(w); + emit modified(); +} + +void ApplicationWindow::maximizeWindow(Q3ListViewItem * lbi) +{ + if (!lbi) + lbi = lv->currentItem(); + + if (!lbi || lbi->rtti() == FolderListItem::RTTI) + return; + + maximizeWindow(((WindowListItem*)lbi)->window()); +} + +void ApplicationWindow::maximizeWindow(MdiSubWindow *w) +{ + if (!w || w->status() == MdiSubWindow::Maximized) + return; + + QList windows = current_folder->windowsList(); + foreach(MdiSubWindow *ow, windows){ + if (ow != w && ow->status() == MdiSubWindow::Maximized){ + ow->setNormal(); + break; + } + } + + w->setMaximized(); + updateWindowLists(w); + emit modified(); +} + +void ApplicationWindow::minimizeWindow(MdiSubWindow *w) +{ + if (!w) + w = ((WindowListItem *)lv->currentItem())->window(); + + if (!w) + return; + + updateWindowLists(w); + w->setMinimized(); + emit modified(); +} + +void ApplicationWindow::updateWindowLists(MdiSubWindow *w) +{ + if (!w) + return; + + if (hiddenWindows->contains(w)) + hiddenWindows->takeAt(hiddenWindows->indexOf(w)); +} + +void ApplicationWindow::closeActiveWindow() +{ + MdiSubWindow *w = activeWindow(); + if (w) + w->close(); +} + +void ApplicationWindow::removeWindowFromLists(MdiSubWindow* w) +{ + if (!w) + return; + + QString caption = w->objectName(); + if (w->inherits("Table")){ + Table* m=(Table*)w; + for (int i=0; inumCols(); i++){ + QString name=m->colName(i); + removeCurves(name); + } + } else if (w->isA("MultiLayer")){ + MultiLayer *ml = (MultiLayer*)w; + Graph *g = ml->activeLayer(); + if (g) + btnPointer->setChecked(true); + } else if (w->isA("Matrix")) + remove3DMatrixPlots((Matrix*)w); + + if (hiddenWindows->contains(w)) + hiddenWindows->takeAt(hiddenWindows->indexOf(w)); + + updateCompleter(caption, true); +} + +void ApplicationWindow::closeWindow(MdiSubWindow* window) +{ + if (!window) + return; + + if (d_active_window == window) + d_active_window = NULL; + + removeWindowFromLists(window); + + Folder *f = window->folder(); + f->removeWindow(window); + + //update list view in project explorer + Q3ListViewItem *it = lv->findItem (window->objectName(), 0, Q3ListView::ExactMatch|Q3ListView::CaseSensitive); + if (it) + lv->takeItem(it); + + window->close(); + + if (show_windows_policy == ActiveFolder && !f->windowsList().count()){ + customMenu(0); + customToolBars(0); + } else if (show_windows_policy == SubFolders && !(current_folder->children()).isEmpty()){ + FolderListItem *fi = current_folder->folderListItem(); + FolderListItem *item = (FolderListItem *)fi->firstChild(); + int initial_depth = item->depth(); + bool emptyFolder = true; + while (item && item->depth() >= initial_depth){ + QList lst = item->folder()->windowsList(); + if (lst.count() > 0){ + emptyFolder = false; + break; + } + item = (FolderListItem *)item->itemBelow(); + } + if (emptyFolder){ + customMenu(0); + customToolBars(0); + } + } + emit modified(); +} + +QMessageBox * ApplicationWindow::about(bool dialog) +{ + if (dialog){ + QString text = "

"+ versionString() + "

"; + text += "

" + QString(copyright_string).replace("\n", "
") + "

"; + text += "

" + tr("Released") + ": " + QString(release_date) + "

"; + + QMessageBox *mb = new QMessageBox(); + mb->setAttribute(Qt::WA_DeleteOnClose); + mb->setWindowTitle (tr("About QtiPlot")); + mb->setWindowIcon(QIcon(":/logo.png")); + mb->setIconPixmap(QPixmap(":/logo.png")); + mb->setText(text); + mb->exec(); + return mb; + } else { + printf("%s\n", versionString().toAscii().constData()); + printf("%s\n", copyright_string); + printf("%s\n", (tr("Released") + ": " + QString(release_date)).toAscii().constData()); + exit(0); + } + return NULL; +} + +void ApplicationWindow::scriptingMenuAboutToShow() +{ + scriptingMenu->clear(); +#ifdef SCRIPTING_PYTHON + scriptingMenu->addAction(actionScriptingLang); + scriptingMenu->addAction(actionRestartScripting); + scriptingMenu->addAction(actionCustomActionDialog); + scriptingMenu->addAction(actionOpenQtDesignerUi); +#endif + + Note *note = (Note *)activeWindow(NoteWindow); + if (note){ + scriptingMenu->insertSeparator(); + + bool noteHasText = !note->text().isEmpty(); + noteTools->setEnabled(noteHasText); + if (noteHasText){ + if (scriptEnv->name() == QString("Python")){ + scriptingMenu->addAction(actionNoteExecute); + scriptingMenu->addAction(actionNoteExecuteAll); + } + scriptingMenu->addAction(actionNoteEvaluate); + + #ifdef SCRIPTING_PYTHON + if (scriptEnv->name() == QString("Python") && note->currentEditor() && note->currentEditor()->textCursor().hasSelection()){ + scriptingMenu->insertSeparator(); + scriptingMenu->addAction(actionCommentSelection); + scriptingMenu->addAction(actionUncommentSelection); + } + #endif + + scriptingMenu->insertSeparator(); + scriptingMenu->addAction(actionIncreaseIndent); + scriptingMenu->addAction(actionDecreaseIndent); + scriptingMenu->insertSeparator(); + scriptingMenu->addAction(actionFind); + scriptingMenu->addAction(actionFindNext); + scriptingMenu->addAction(actionFindPrev); + scriptingMenu->addAction(actionReplace); + scriptingMenu->insertSeparator(); + } + scriptingMenu->addAction(actionRenameNoteTab); + scriptingMenu->addAction(actionAddNoteTab); + if (note->tabs() > 1) + scriptingMenu->addAction(actionCloseNoteTab); + scriptingMenu->insertSeparator(); + actionShowNoteLineNumbers->setChecked(note->hasLineNumbers()); + scriptingMenu->addAction(actionShowNoteLineNumbers); + } + + reloadCustomActions(); +} + +void ApplicationWindow::analysisMenuAboutToShow() +{ + analysisMenu->clear(); + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (w->isA("MultiLayer")){ + QMenu *translateMenu = analysisMenu->addMenu (tr("&Translate")); + translateMenu->addAction(actionTranslateVert); + translateMenu->addAction(actionTranslateHor); + + QMenu *subtractMenu = analysisMenu->addMenu(tr("S&ubtract")); + subtractMenu->addAction(actionSubtractReference); + subtractMenu->addAction(actionSubtractLine); + + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionDifferentiate); + analysisMenu->addAction(actionIntegrate); + analysisMenu->addAction(actionShowIntDialog); + analysisMenu->insertSeparator(); + + smoothMenu->clear(); + analysisMenu->addMenu(smoothMenu); + smoothMenu->addAction(actionSmoothSavGol); + smoothMenu->addAction(actionSmoothAverage); + smoothMenu->addAction(actionSmoothLowess); + smoothMenu->addAction(actionSmoothFFT); + + filterMenu->clear(); + analysisMenu->addMenu(filterMenu); + filterMenu->addAction(actionLowPassFilter); + filterMenu->addAction(actionHighPassFilter); + filterMenu->addAction(actionBandPassFilter); + filterMenu->addAction(actionBandBlockFilter); + + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionInterpolate); + analysisMenu->addAction(actionFFT); + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionFitSlope); + analysisMenu->addAction(actionFitLinear); + analysisMenu->addAction(actionShowFitPolynomDialog); + analysisMenu->insertSeparator(); + + decayMenu->clear(); + analysisMenu->addMenu(decayMenu); + decayMenu->addAction(actionShowExpDecayDialog); + decayMenu->addAction(actionShowTwoExpDecayDialog); + decayMenu->addAction(actionShowExpDecay3Dialog); + + analysisMenu->addAction(actionFitExpGrowth); + analysisMenu->addAction(actionFitSigmoidal); + analysisMenu->addAction(actionFitGauss); + analysisMenu->addAction(actionFitLorentz); + + multiPeakMenu->clear(); + analysisMenu->addMenu(multiPeakMenu); + multiPeakMenu->addAction(actionMultiPeakGauss); + multiPeakMenu->addAction(actionMultiPeakLorentz); + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionShowFitDialog); + } else if (w->isA("Matrix")){ + analysisMenu->addAction(actionIntegrate); + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionFFT); + analysisMenu->addAction(actionMatrixFFTDirect); + analysisMenu->addAction(actionMatrixFFTInverse); + } else if (w->inherits("Table")){ + analysisMenu->addAction(actionShowColStatistics); + analysisMenu->addAction(actionShowRowStatistics); + analysisMenu->addAction(actionFrequencyCount); + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionSortSelection); + analysisMenu->addAction(actionSortTable); + + normMenu->clear(); + analysisMenu->addMenu(normMenu); + normMenu->addAction(actionNormalizeSelection); + normMenu->addAction(actionNormalizeTable); + + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionDifferentiate); + analysisMenu->addAction(actionIntegrate); + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionFFT); + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionCorrelate); + analysisMenu->addAction(actionAutoCorrelate); + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionConvolute); + analysisMenu->addAction(actionDeconvolute); + analysisMenu->insertSeparator(); + analysisMenu->addAction(actionFitSlope); + analysisMenu->addAction(actionFitLinear); + analysisMenu->addAction(actionShowFitDialog); + } + reloadCustomActions(); +} + +void ApplicationWindow::matrixMenuAboutToShow() +{ + matrixMenu->clear(); + matrixMenu->addAction(actionSetMatrixProperties); + matrixMenu->addAction(actionSetMatrixDimensions); + matrixMenu->insertSeparator(); + matrixMenu->addAction(actionSetMatrixValues); + matrixMenu->addAction(actionTableRecalculate); + matrixMenu->insertSeparator(); + matrixMenu->addAction(actionRotateMatrix); + matrixMenu->addAction(actionRotateMatrixMinus); + matrixMenu->addAction(actionFlipMatrixVertically); + matrixMenu->addAction(actionFlipMatrixHorizontally); + matrixMenu->insertSeparator(); + matrixMenu->addAction(actionTransposeMatrix); + matrixMenu->addAction(actionInvertMatrix); + matrixMenu->addAction(actionMatrixDeterminant); + matrixMenu->insertSeparator(); + matrixMenu->addAction(actionGoToRow); + matrixMenu->addAction(actionGoToColumn); + matrixMenu->insertSeparator(); + QMenu *matrixViewMenu = matrixMenu->addMenu (tr("Vie&w")); + matrixViewMenu->addAction(actionViewMatrixImage); + matrixViewMenu->addAction(actionViewMatrix); + QMenu *matrixPaletteMenu = matrixMenu->addMenu (tr("&Palette")); + matrixPaletteMenu->addAction(actionMatrixDefaultScale); + matrixPaletteMenu->addAction(actionMatrixGrayScale); + matrixPaletteMenu->addAction(actionMatrixRainbowScale); + matrixPaletteMenu->addAction(actionMatrixCustomScale); + matrixMenu->insertSeparator(); + matrixMenu->addAction(actionMatrixColumnRow); + matrixMenu->addAction(actionMatrixXY); + matrixMenu->insertSeparator(); + QMenu *convertToTableMenu = matrixMenu->addMenu (tr("&Convert to Spreadsheet")); + convertToTableMenu->addAction(actionConvertMatrixDirect); + convertToTableMenu->addAction(actionConvertMatrixXYZ); + convertToTableMenu->addAction(actionConvertMatrixYXZ); + + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + actionViewMatrixImage->setChecked(m->viewType() == Matrix::ImageView); + actionViewMatrix->setChecked(m->viewType() == Matrix::TableView); + actionMatrixColumnRow->setChecked(m->headerViewType() == Matrix::ColumnRow); + actionMatrixColumnRow->setEnabled(m->viewType() == Matrix::TableView); + actionMatrixXY->setChecked(m->headerViewType() == Matrix::XY); + actionMatrixXY->setEnabled(m->viewType() == Matrix::TableView); + + actionMatrixDefaultScale->setChecked(m->colorMapType() == Matrix::Default); + actionMatrixGrayScale->setChecked(m->colorMapType() == Matrix::GrayScale); + actionMatrixRainbowScale->setChecked(m->colorMapType() == Matrix::Rainbow); + actionMatrixCustomScale->setChecked(m->colorMapType() == Matrix::Custom); + + reloadCustomActions(); +} + +void ApplicationWindow::fileMenuAboutToShow() +{ + if (fileMenu) + fileMenu->clear(); + if (newMenu) + newMenu->clear(); + if (exportPlotMenu) + exportPlotMenu->clear(); + if (importMenu) + importMenu->clear(); + + fileMenu->addMenu(newMenu); + newMenu->addAction(actionNewProject); + newMenu->addAction(actionNewFolder); + newMenu->addAction(actionNewTable); + newMenu->addAction(actionNewMatrix); + newMenu->addAction(actionNewNote); + newMenu->addAction(actionNewGraph); + newMenu->addAction(actionNewFunctionPlot); + newMenu->addAction(actionNewSurfacePlot); + fileMenu->addAction(actionOpen); +#ifdef XLS_IMPORT + fileMenu->addAction(actionOpenExcel); +#endif +#ifdef ODS_IMPORT + fileMenu->addAction(actionOpenOds); +#endif + fileMenu->addAction(actionLoadImage); + fileMenu->addAction(actionAppendProject); + recentMenuID = fileMenu->insertItem(tr("&Recent Projects"), recent); + fileMenu->addAction(actionCloseProject); + fileMenu->insertSeparator(); + fileMenu->addAction(actionSaveProject); + fileMenu->addAction(actionSaveProjectAs); + fileMenu->insertSeparator(); + fileMenu->addAction(actionOpenTemplate); + fileMenu->addAction(actionSaveTemplate); + fileMenu->insertSeparator(); + fileMenu->addAction(actionPrint); + fileMenu->addAction(actionPrintPreview); + fileMenu->addAction(actionPrintAllPlots); + fileMenu->insertSeparator(); + + MdiSubWindow *w = activeWindow(); + if (w){ + if (w->isA("MultiLayer") || w->isA("Graph3D")){ + fileMenu->addMenu (exportPlotMenu); + exportPlotMenu->addAction(actionExportGraph); + exportPlotMenu->addAction(actionExportAllGraphs); + exportPlotMenu->addAction(actionPresentationODF); + } else if (w->inherits("Table")) + fileMenu->addAction(actionShowExportASCIIDialog); + else if (w->isA("Matrix")){ + QMenu *exportMatrixMenu = fileMenu->addMenu(tr("Export")); + exportMatrixMenu->addAction(actionShowExportASCIIDialog); + exportMatrixMenu->addAction(actionExportMatrix); + } + } + + fileMenu->addMenu(importMenu); + importMenu->addAction(actionLoad); + importMenu->addAction(actionImportSound); + importMenu->addAction(actionImportImage); + + fileMenu->insertSeparator(); + fileMenu->addAction(actionCloseAllWindows); + + reloadCustomActions(); +} + +void ApplicationWindow::editMenuAboutToShow() +{ + MdiSubWindow *w = activeWindow(); + if (!w){ + actionUndo->setEnabled(false); + actionRedo->setEnabled(false); + return; + } + + if (qobject_cast(w)){ + QTextDocument *doc = ((Note *)w)->currentEditor()->document(); + actionUndo->setEnabled(doc->isUndoAvailable()); + actionRedo->setEnabled(doc->isRedoAvailable()); + } else if (qobject_cast(w)){ + QUndoStack *stack = ((Matrix *)w)->undoStack(); + actionUndo->setEnabled(stack->canUndo()); + actionRedo->setEnabled(stack->canRedo()); + } else { + actionUndo->setEnabled(false); + actionRedo->setEnabled(false); + } +} + +void ApplicationWindow::windowsMenuAboutToShow() +{ + windowsMenu->clear(); + foldersMenu->clear(); + + int folder_param = 0; + Folder *f = projectFolder(); + while (f){ + int id; + if (folder_param < 9) + id = foldersMenu->insertItem("&" + QString::number(folder_param+1) + " " + f->path(), this, SLOT(foldersMenuActivated(int))); + else + id = foldersMenu->insertItem(f->path(), this, SLOT(foldersMenuActivated(int))); + + foldersMenu->setItemParameter(id, folder_param); + folder_param++; + foldersMenu->setItemChecked(id, f == current_folder); + + f = f->folderBelow(); + } + + windowsMenu->insertItem(tr("&Folders"), foldersMenu); + windowsMenu->insertSeparator(); + + QList windows = current_folder->windowsList(); + int n = int(windows.count()); + if (!n ){ + #ifdef SCRIPTING_PYTHON + windowsMenu->addAction(actionShowScriptWindow); + #endif + return; + } + + windowsMenu->insertItem(tr("&Cascade"), this, SLOT(cascade())); + windowsMenu->insertItem(tr("&Tile"), d_workspace, SLOT(tileSubWindows())); + windowsMenu->insertSeparator(); + windowsMenu->addAction(actionNextWindow); + windowsMenu->addAction(actionPrevWindow); + windowsMenu->insertSeparator(); + windowsMenu->addAction(actionFindWindow); + windowsMenu->addAction(actionRename); + windowsMenu->addAction(actionCopyWindow); + windowsMenu->insertSeparator(); +#ifdef SCRIPTING_PYTHON + windowsMenu->addAction(actionShowScriptWindow); + windowsMenu->insertSeparator(); +#endif + + windowsMenu->addAction(actionResizeActiveWindow); + windowsMenu->addAction(actionHideActiveWindow); + windowsMenu->insertItem(QPixmap(":/close.png"), tr("Close &Window"), this, SLOT(closeActiveWindow()), Qt::CTRL + Qt::Key_W); + + if (n > 0) + windowsMenu->insertSeparator(); + + bool moreWindows = (n >= 10); + if (moreWindows) + n = 9; + + for (int i = 0; i < n; ++i){ + MdiSubWindow *w = windows.at(i); + if (!w) + continue; + + int id = windowsMenu->insertItem("&" + QString::number(i + 1) + " " + w->windowTitle(), this, SLOT(windowsMenuActivated(int))); + windowsMenu->setItemParameter(id, i); + windowsMenu->setItemChecked(id, current_folder->activeWindow() == w); + } + + if (moreWindows){ + windowsMenu->insertSeparator(); + windowsMenu->insertItem(tr("More windows..."), this, SLOT(showMoreWindows())); + } + + reloadCustomActions(); +} + +void ApplicationWindow::showMarkerPopupMenu() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + QMenu markerMenu(this); + + if (g->imageMarkerSelected()){ + markerMenu.insertItem(QPixmap(":/pixelProfile.png"),tr("&View Pixel Line profile"),this, SLOT(pixelLineProfile())); + markerMenu.insertItem(tr("&Intensity Matrix"),this, SLOT(intensityTable())); + markerMenu.insertSeparator(); + } + if (!g->activeEnrichment()) + markerMenu.insertItem(QPixmap(":/cut.png"),tr("&Cut"),this, SLOT(cutSelection())); + markerMenu.insertItem(QPixmap(":/copy.png"), tr("&Copy"),this, SLOT(copySelection())); + markerMenu.insertItem(QPixmap(":/delete.png"), tr("&Delete"),this, SLOT(clearSelection())); + markerMenu.insertSeparator(); + if (g->arrowMarkerSelected()) + markerMenu.insertItem(tr("&Properties..."),this, SLOT(showLineDialog())); + else + markerMenu.insertItem(tr("&Properties..."),this, SLOT(showEnrichementDialog())); + + markerMenu.exec(QCursor::pos()); +} + +void ApplicationWindow::showMoreWindows() +{ + if (explorerWindow->isVisible()) + QMessageBox::information(this, "QtiPlot",tr("Please use the project explorer to select a window!")); + else + explorerWindow->show(); +} + +void ApplicationWindow::windowsMenuActivated( int id ) +{ + QList windows = current_folder->windowsList(); + MdiSubWindow* w = windows.at( id ); + if ( w ){ + w->showNormal(); + w->setFocus(); + if(hidden(w)){ + hiddenWindows->takeAt(hiddenWindows->indexOf(w)); + setListView(w->objectName(), tr("Normal")); + } + d_workspace->setActiveSubWindow(w); + } +} + +void ApplicationWindow::foldersMenuActivated( int id ) +{ + int folder_param = 0; + Folder *f = projectFolder(); + while (f){ + if (folder_param == id){ + changeFolder (f); + return; + } + + folder_param++; + f = f->folderBelow(); + } +} + +void ApplicationWindow::newProject() +{ + if (showSaveProjectMessage() == QMessageBox::Cancel) + return; + + saveSettings();//the recent projects must be saved + +#ifdef BROWSER_PLUGIN + closeProject(); + initWindow(); +#else + ApplicationWindow *ed = new ApplicationWindow(); + ed->restoreApplicationGeometry(); + ed->initWindow(); + close(); +#endif +} + +void ApplicationWindow::savedProject() +{ + //QCoreApplication::processEvents(); + + actionSaveProject->setEnabled(false); + saved = true; + + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->isA("Matrix")) + ((Matrix *)w)->undoStack()->setClean(); + } + f = f->folderBelow(); + } +} + +void ApplicationWindow::modifiedProject() +{ + if (saved == false) + return; + + if (actionSaveProject) + actionSaveProject->setEnabled(true); + saved = false; +} + +void ApplicationWindow::modifiedProject(MdiSubWindow *w) +{ + if (!w) + return; + + modifiedProject(); + + Q3ListViewItem *it = lv->findItem (w->objectName(), 0, Q3ListView::ExactMatch | Qt::CaseSensitive ); + if (it) + it->setText(3, w->sizeToString()); +} + +void ApplicationWindow::timerEvent ( QTimerEvent *e) +{ + if (e->timerId() == savingTimerId) + saveProject(); + else + QWidget::timerEvent(e); +} + +void ApplicationWindow::dropEvent( QDropEvent* e ) +{ + if (!e->mimeData()->hasImage() && !e->mimeData()->hasUrls()) + return; + + MdiSubWindow *destWindow = NULL; + QList windows = d_workspace->subWindowList(QMdiArea::StackingOrder); + QListIterator it(windows); + it.toBack(); + QPoint pos = d_workspace->mapFromGlobal(e->pos()); + while (it.hasPrevious()){ + QMdiSubWindow *w = it.previous(); + if (w->frameGeometry().contains(pos)){ + destWindow = (MdiSubWindow*)w; + break; + } + } + + if (e->mimeData()->hasImage()){ + QImage image = qvariant_cast(e->mimeData()->imageData()); + MultiLayer *ml = qobject_cast(destWindow); + if (ml){ + Graph *l = ml->layerAt(pos); + if (l) + l->addImage(image); + else if (ml->activeLayer()) + ml->activeLayer()->addImage(image); + else + ml->addLayer()->addImage(image); + return; + } + + Matrix *m = qobject_cast(destWindow); + if (m) + m->importImage(image); + else { + m = new Matrix(scriptEnv, image, "", this); + initMatrix(m, generateUniqueName(tr("Matrix"))); + m->show(); + } + return; + } + + if (e->mimeData()->hasUrls()){ + QList urls = e->mimeData()->urls(); + QStringList fileNames; + foreach(QUrl url, urls) + fileNames << url.toLocalFile(); + + QList lst = QImageReader::supportedImageFormats() << "JPG"; + QStringList asciiFiles; + + for(int i = 0; i<(int)fileNames.count(); i++){ + QString fn = fileNames[i]; + QFileInfo fi (fn); + QString ext = fi.extension(); + QStringList tempList; + // convert QList to QStringList to be able to 'filter' + foreach(QByteArray temp,lst) + tempList.append(QString(temp)); + QStringList l = tempList.filter(ext, Qt::CaseInsensitive); + if (l.count() > 0){ + MultiLayer *ml = qobject_cast(destWindow); + if (ml){ + Graph *l = ml->layerAt(pos); + if (l) + l->addImage(fn); + else if (ml->activeLayer()) + ml->activeLayer()->addImage(fn); + else + ml->addLayer()->addImage(fn); + } else { + Matrix *m = qobject_cast(destWindow); + if (m) + m->importImage(fn); + else + importImage(fn, true); + } + } else if ( ext == "opj" || ext == "qti") + open(fn); + else + asciiFiles << fn; + } + + importASCII(asciiFiles, ImportASCIIDialog::NewTables, columnSeparator, ignoredLines, + renameColumns, strip_spaces, simplify_spaces, d_ASCII_import_comments, + d_ASCII_import_locale, d_ASCII_comment_string, d_ASCII_import_read_only, d_ASCII_end_line); + } +} + +void ApplicationWindow::dragEnterEvent( QDragEnterEvent* e ) +{ + if (e->source()){ + e->ignore(); + return; + } + + e->accept(Q3UriDrag::canDecode(e)); +} + +void ApplicationWindow::closeEvent( QCloseEvent* ce ) +{ + #ifdef QTIPLOT_DEMO + showDemoVersionMessage(); + #endif + + switch(showSaveProjectMessage()){ + case QMessageBox::Yes: + if (!saveProject()){ + ce->ignore(); + break; + } + saveSettings(); + ce->accept(); + break; + + case QMessageBox::No: + default: + saveSettings(); + ce->accept(); + break; + + case QMessageBox::Cancel: + ce->ignore(); + break; + } + + if (ce->isAccepted()) + ((QtiPlotApplication *)QCoreApplication::instance ())->remove(this); +} + +QMessageBox::StandardButton ApplicationWindow::showSaveProjectMessage() +{ + if (!saved){ + QString s = tr("Save changes to project:

%1 ?").arg(projectname); + switch(QMessageBox::information(this, tr("QtiPlot"), s, QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel, QMessageBox::Yes)){ + case QMessageBox::Yes: + #ifdef QTIPLOT_DEMO + showDemoVersionMessage(); + return QMessageBox::Discard; + #else + saveProject(); + return QMessageBox::Yes; + #endif + break; + case QMessageBox::No: + default: + savedProject(); + return QMessageBox::No; + break; + case QMessageBox::Cancel: + return QMessageBox::Cancel; + break; + } + } + return QMessageBox::No; +} + +void ApplicationWindow::closeProject() +{ + if (showSaveProjectMessage() == QMessageBox::Cancel) + return; + + blockSignals(true); + + Folder *f = projectFolder(); + f->folderListItem()->setText(0, tr("UNTITLED")); + current_folder = f; + projectname = "untitled"; + + foreach(MdiSubWindow *w, f->windowsList()){ + w->askOnCloseEvent(false); + closeWindow(w); + } + + if (!(f->children()).isEmpty()){ + Folder *subFolder = f->folderBelow(); + int initial_depth = f->depth(); + while (subFolder && subFolder->depth() > initial_depth){ + foreach(MdiSubWindow *w, subFolder->windowsList()){ + removeWindowFromLists(w); + subFolder->removeWindow(w); + delete w; + } + delete subFolder->folderListItem(); + delete subFolder; + + subFolder = f->folderBelow(); + } + } + + blockSignals(false); + savedProject(); + setWindowTitle(tr("QtiPlot - untitled")); +} + +void ApplicationWindow::customEvent(QEvent *e) +{ + if (e->type() == SCRIPTING_CHANGE_EVENT) + scriptingChangeEvent((ScriptingChangeEvent*)e); +} + +void ApplicationWindow::deleteSelectedItems() +{ + if (folders->hasFocus() && folders->currentItem() != folders->firstChild()) + {//we never allow the user to delete the project folder item + deleteFolder(); + return; + } + + Q3ListViewItem *item; + QList lst; + for (item = lv->firstChild(); item; item = item->nextSibling()){ + if (item->isSelected()) + lst.append(item); + } + + folders->blockSignals(true); + foreach(item, lst){ + if (item->rtti() == FolderListItem::RTTI) + deleteFolder(((FolderListItem *)item)->folder()); + else + ((WindowListItem *)item)->window()->close(); + } + folders->blockSignals(false); +} + +void ApplicationWindow::showListViewSelectionMenu(const QPoint &p) +{ + QMenu cm(this); + cm.insertItem(tr("&Show All Windows"), this, SLOT(showSelectedWindows())); + cm.insertItem(tr("&Hide All Windows"), this, SLOT(hideSelectedWindows())); + cm.insertSeparator(); + cm.insertItem(tr("&Delete Selection"), this, SLOT(deleteSelectedItems()), Qt::Key_F8); + cm.exec(p); +} + +void ApplicationWindow::showListViewPopupMenu(const QPoint &p) +{ + QMenu cm(this); + QMenu window(this); + + window.addAction(actionNewTable); + window.addAction(actionNewMatrix); + window.addAction(actionNewNote); + window.addAction(actionNewGraph); + window.addAction(actionNewFunctionPlot); + window.addAction(actionNewSurfacePlot); + cm.insertItem(tr("New &Window"), &window); + + cm.addAction(actionNewFolder); + cm.insertSeparator(); + cm.insertItem(tr("Auto &Column Width"), lv, SLOT(adjustColumns())); + cm.exec(p); +} + +void ApplicationWindow::showWindowPopupMenu(Q3ListViewItem *it, const QPoint &p, int) +{ + if (folders->isRenaming()) + return; + + if (!it){ + showListViewPopupMenu(p); + return; + } + + Q3ListViewItem *item; + int selected = 0; + for (item = lv->firstChild(); item; item = item->nextSibling()){ + if (item->isSelected()) + selected++; + + if (selected>1){ + showListViewSelectionMenu(p); + return; + } + } + + if (it->rtti() == FolderListItem::RTTI){ + current_folder = ((FolderListItem *)it)->folder(); + showFolderPopupMenu(it, p, false); + return; + } + + MdiSubWindow *w = ((WindowListItem *)it)->window(); + if (w){ + QMenu cm(this); + QMenu plots(this); + + cm.addAction(actionActivateWindow); + cm.addAction(actionMinimizeWindow); + cm.addAction(actionMaximizeWindow); + cm.insertSeparator(); + if (!hidden(w)) + cm.addAction(actionHideWindow); + cm.insertItem(QPixmap(":/close.png"), tr("&Delete Window"), w, SLOT(close()), Qt::Key_F8); + cm.insertSeparator(); + cm.insertItem(tr("&Rename Window"), this, SLOT(renameWindow()), Qt::Key_F2); + cm.addAction(actionResizeWindow); + cm.insertSeparator(); + cm.insertItem(QPixmap(":/fileprint.png"), tr("&Print Window"), w, SLOT(print())); + cm.insertSeparator(); + cm.insertItem(tr("&Properties..."), this, SLOT(windowProperties())); + + if (w->inherits("Table")){ + QStringList graphs = dependingPlots(w->objectName()); + if (int(graphs.count())>0){ + cm.insertSeparator(); + for (int i=0;iisA("Matrix")){ + QStringList graphs = depending3DPlots((Matrix*)w); + if (int(graphs.count())>0){ + cm.insertSeparator(); + for (int i=0;iisA("MultiLayer")) { + tablesDepend->clear(); + QStringList tbls=multilayerDependencies(w); + int n = int(tbls.count()); + if (n > 0){ + cm.insertSeparator(); + for (int i=0; iinsertItem(tbls[i], i, -1); + + cm.insertItem(tr("D&epends on"), tablesDepend); + } + } else if (w->isA("Graph3D")) { + Graph3D *sp=(Graph3D*)w; + Matrix *m = sp->matrix(); + QString formula = sp->formula(); + if (!formula.isEmpty()){ + cm.insertSeparator(); + if (formula.contains("_")){ + QStringList tl = formula.split("_", QString::SkipEmptyParts); + tablesDepend->clear(); + tablesDepend->insertItem(tl[0], 0, -1); + cm.insertItem(tr("D&epends on"), tablesDepend); + } else if (m) { + plots.insertItem(m->objectName(), m, SLOT(showNormal())); + cm.insertItem(tr("D&epends on"),&plots); + } else { + plots.insertItem(formula, w, SLOT(showNormal())); + cm.insertItem(tr("Function"), &plots); + } + } + } + cm.exec(p); + } +} + +void ApplicationWindow::showTable(int i) +{ + Table *t = table(tablesDepend->text(i)); + if (!t) + return; + + updateWindowLists(t); + + t->showMaximized(); + Q3ListViewItem *it=lv->findItem (t->objectName(), 0, Q3ListView::ExactMatch | Qt::CaseSensitive ); + if (it) + it->setText(2,tr("Maximized")); +} + +void ApplicationWindow::showTable(const QString& curve) +{ + Table* w=table(curve); + if (!w) + return; + + updateWindowLists(w); + int colIndex = w->colIndex(curve); + w->setSelectedCol(colIndex); + w->table()->clearSelection(); + w->table()->selectColumn(colIndex); + w->showMaximized(); + Q3ListViewItem *it=lv->findItem (w->objectName(), 0, Q3ListView::ExactMatch | Qt::CaseSensitive ); + if (it) + it->setText(2,tr("Maximized")); + emit modified(); +} + +QStringList ApplicationWindow::depending3DPlots(Matrix *m) +{ + QStringList plots; + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("Graph3D") && ((Graph3D *)w)->matrix() == m) + plots << w->objectName(); + } + return plots; +} + +QStringList ApplicationWindow::dependingPlots(const QString& name) +{ + QStringList plots; + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")){ + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers){ + QStringList onPlot = g->curveNamesList(); + onPlot = onPlot.grep (name,TRUE); + if (int(onPlot.count()) && plots.contains(w->objectName())<=0) + plots << w->objectName(); + } + }else if (w->isA("Graph3D")){ + if ((((Graph3D*)w)->formula()).contains(name,TRUE) && plots.contains(w->objectName())<=0) + plots << w->objectName(); + } + } + return plots; +} + +QStringList ApplicationWindow::multilayerDependencies(QWidget *w) +{ + QStringList tables; + MultiLayer *g=(MultiLayer*)w; + QList layers = g->layersList(); + foreach(Graph *ag, layers){ + QStringList onPlot = ag->curveNamesList(); + for (int j=0; jactiveLayer(); + if (!ag) + return; + + QMenu cm(this); + + QMenu addMenu(this); + if (ag->isPiePlot()){ + cm.addAction(tr("Re&move Pie Curve"),ag, SLOT(removePie())); + addMenu.addAction(actionNewLegend); + } else { + if (ag->visibleCurves() != ag->curveCount()){ + cm.addAction(actionShowAllCurves); + cm.addSeparator(); + } + + addMenu.addAction(actionShowCurvesDialog); + addMenu.addAction(actionAddFunctionCurve); + addMenu.addAction(actionAddErrorBars); + addMenu.addAction(actionNewLegend); + addMenu.addSeparator(); + } + + addMenu.addAction(actionAddFormula); + addMenu.addAction(actionAddText); + addMenu.addAction(btnArrow); + addMenu.addAction(btnLine); + addMenu.addAction(actionAddRectangle); + addMenu.addAction(actionAddEllipse); + addMenu.addAction(actionTimeStamp); + addMenu.addAction(actionAddImage); + addMenu.addSeparator(); + addMenu.addAction(actionAddLayer); + addMenu.addAction(actionAddInsetLayer); + addMenu.addAction(actionAddInsetCurveLayer); + cm.insertItem(tr("&Add"), &addMenu); + + QMenu paletteMenu(this); + if (!ag->isPiePlot()){ + cm.insertItem(tr("Anal&yze"), analysisMenu); + cm.insertItem(tr("&Data"), plotDataMenu); + + paletteMenu.addAction(tr("&Gray Scale"), ag, SLOT(setGrayScale())); + paletteMenu.addAction(tr("&Indexed Colors"), ag, SLOT(setIndexedColors())); + cm.insertItem(tr("Pale&tte"), &paletteMenu); + cm.addSeparator(); + } + + QMenu copy(this); + copy.addAction(tr("&Layer"), this, SLOT(copyActiveLayer())); + copy.addAction(tr("&Window"), plot, SLOT(copyAllLayers())); + cm.insertItem(QPixmap(":/copy.png"), tr("&Copy"), ©); + + if (lastCopiedLayer) + cm.addAction(QPixmap(":/paste.png"), tr("&Paste Layer"), this, SLOT(pasteSelection())); + else if (d_enrichement_copy){ + if (qobject_cast(d_enrichement_copy)) + cm.addAction(QPixmap(":/paste.png"), tr("&Paste Text"), plot, SIGNAL(pasteMarker())); + else if (qobject_cast(d_enrichement_copy)) + cm.addAction(QPixmap(":/paste.png"), tr("&Paste Tex Formula"), plot, SIGNAL(pasteMarker())); + else if (qobject_cast(d_enrichement_copy)) + cm.addAction(QPixmap(":/paste.png"), tr("&Paste Image"), plot, SIGNAL(pasteMarker())); + else if (qobject_cast(d_enrichement_copy)) + cm.addAction(QPixmap(":/paste.png"), tr("&Paste Rectangle"), plot, SIGNAL(pasteMarker())); + else if (qobject_cast(d_enrichement_copy)) + cm.addAction(QPixmap(":/paste.png"), tr("&Paste Ellipse"), plot, SIGNAL(pasteMarker())); + } else if (d_arrow_copy) + cm.addAction(QPixmap(":/paste.png"), tr("&Paste Line/Arrow"), plot, SIGNAL(pasteMarker())); + + QMenu exports(this); + exports.addAction(tr("&Layer"), this, SLOT(exportLayer())); + exports.addAction(tr("&Window"), this, SLOT(exportGraph())); + cm.insertItem(tr("E&xport"),&exports); + + QMenu prints(this); + prints.addAction(tr("&Layer"), plot, SLOT(printActiveLayer())); + prints.addAction(tr("&Window"), plot, SLOT(print())); + cm.insertItem(QPixmap(":/fileprint.png"), tr("&Print"),&prints); + + cm.addSeparator(); + + cm.addAction(tr("P&roperties..."), this, SLOT(showGeneralPlotDialog())); + cm.addSeparator(); + cm.addAction(actionDeleteLayer); + cm.exec(QCursor::pos()); +} + +void ApplicationWindow::showWindowContextMenu() +{ + MdiSubWindow* w = activeWindow(); + if (!w) + return; + + QMenu cm(this); + QMenu plot3D(this); + if (w->isA("MultiLayer")){ + MultiLayer *g = (MultiLayer*)w; + if (lastCopiedLayer){ + cm.insertItem(QPixmap(":/paste.png"), tr("&Paste Layer"), this, SLOT(pasteSelection())); + cm.insertSeparator(); + } + + cm.addAction(actionAddLayer); + if (g->numLayers() != 0) + cm.addAction(actionDeleteLayer); + + cm.addAction(actionShowLayerDialog); + cm.insertSeparator(); + cm.addAction(actionRename); + cm.addAction(actionCopyWindow); + cm.insertSeparator(); + cm.insertItem(QPixmap(":/copy.png"),tr("&Copy Page"), g, SLOT(copyAllLayers())); + cm.insertItem(tr("E&xport Page"), this, SLOT(exportGraph())); + cm.addAction(actionPrint); + cm.insertSeparator(); + cm.addAction(actionCloseWindow); + } else if (w->isA("Graph3D")){ + Graph3D *g=(Graph3D*)w; + if (!g->hasData()){ + cm.insertItem(tr("3D &Plot"), &plot3D); + if (hasTable()) + plot3D.addAction(actionAdd3DData); + if (matrixNames().count()) + plot3D.insertItem(tr("&Matrix..."), this, SLOT(add3DMatrixPlot())); + plot3D.addAction(actionEditSurfacePlot); + } else { + if (g->table()) + cm.insertItem(tr("Choose &Data Set..."), this, SLOT(change3DData())); + else if (g->matrix()) + cm.insertItem(tr("Choose &Matrix..."), this, SLOT(change3DMatrix())); + else if (g->userFunction() || g->parametricSurface()) + cm.addAction(actionEditSurfacePlot); + cm.insertItem(QPixmap(":/erase.png"), tr("C&lear"), g, SLOT(clearData())); + } + cm.addMenu(format); + cm.insertSeparator(); + cm.addAction(actionRename); + cm.addAction(actionCopyWindow); + cm.insertSeparator(); + cm.insertItem(tr("&Copy Graph"), g, SLOT(copyImage())); + cm.insertItem(tr("&Export"), this, SLOT(exportGraph())); + cm.addAction(actionPrint); + cm.insertSeparator(); + cm.addAction(actionCloseWindow); + } else if (qobject_cast(w)){ + Matrix *t = (Matrix *)w; + cm.addMenu(plot3DMenu); + cm.insertSeparator(); + cm.addAction(actionSetMatrixProperties); + cm.addAction(actionSetMatrixDimensions); + cm.insertSeparator(); + cm.addAction(actionSetMatrixValues); + cm.addAction(actionTableRecalculate); + cm.insertSeparator(); + + if (t->viewType() == Matrix::TableView){ + cm.insertItem(QPixmap(":/cut.png"),tr("Cu&t"), t, SLOT(cutSelection())); + cm.insertItem(QPixmap(":/copy.png"),tr("&Copy"), t, SLOT(copySelection())); + cm.insertItem(QPixmap(":/paste.png"),tr("&Paste"), t, SLOT(pasteSelection())); + cm.insertSeparator(); + cm.insertItem(QPixmap(":/insert_row.png"), tr("&Insert Row"), t, SLOT(insertRow())); + cm.insertItem(QPixmap(":/insert_column.png"), tr("&Insert Column"), t, SLOT(insertColumn())); + if (t->numSelectedRows() > 0) + cm.insertItem(QPixmap(":/delete_row.png"), tr("&Delete Rows"), t, SLOT(deleteSelectedRows())); + else if (t->numSelectedColumns() > 0) + cm.insertItem(QPixmap(":/delete_column.png"), tr("&Delete Columns"), t, SLOT(deleteSelectedColumns())); + + cm.insertItem(QPixmap(":/erase.png"),tr("Clea&r"), t, SLOT(clearSelection())); + cm.insertSeparator(); + cm.addAction(actionViewMatrixImage); + } else if (t->viewType() == Matrix::ImageView){ + cm.addAction(actionImportImage); + cm.addAction(actionExportMatrix); + cm.insertSeparator(); + cm.addAction(actionRotateMatrix); + cm.addAction(actionRotateMatrixMinus); + cm.insertSeparator(); + cm.addAction(actionFlipMatrixVertically); + cm.addAction(actionFlipMatrixHorizontally); + cm.insertSeparator(); + cm.addAction(actionTransposeMatrix); + cm.addAction(actionInvertMatrix); + cm.insertSeparator(); + cm.addAction(actionViewMatrix); + } + } + cm.exec(QCursor::pos()); +} + +void ApplicationWindow::customWindowTitleBarMenu(MdiSubWindow *w, QMenu *menu) +{ + menu->addAction(actionHideActiveWindow); + menu->addSeparator(); + if (w->inherits("Table") || w->isA("Matrix")){ + menu->addAction(actionLoad); + menu->addAction(actionShowExportASCIIDialog); + menu->addSeparator(); + } + + if (w->isA("Note")) + menu->addAction(actionSaveNote); + else + menu->addAction(actionSaveTemplate); + menu->addAction(actionPrint); + menu->addSeparator(); + menu->addAction(actionRename); + menu->addAction(actionCopyWindow); + menu->addSeparator(); +} + +void ApplicationWindow::showTableContextMenu(bool selection) +{ + Table *t = (Table*)activeWindow(TableWindow); + if (!t) + return; + + QMenu cm(this); + QMenu moveRow(this); + if (selection){ + if ((int)t->selectedColumns().count() > 0){ + showColMenu(t->firstSelectedColumn()); + return; + } else if (t->numSelectedRows() == 1) { + cm.addAction(actionShowColumnValuesDialog); + cm.addAction(actionTableRecalculate); + cm.insertSeparator(); + cm.insertItem(QPixmap(":/cut.png"),tr("Cu&t"), t, SLOT(cutSelection())); + cm.insertItem(QPixmap(":/copy.png"),tr("&Copy"), t, SLOT(copySelection())); + cm.insertItem(QPixmap(":/paste.png"),tr("&Paste"), t, SLOT(pasteSelection())); + cm.insertSeparator(); + moveRow.addAction(actionMoveRowUp); + moveRow.addAction(actionMoveRowDown); + moveRow.setTitle(tr("Move Row")); + cm.addMenu (&moveRow); + cm.insertItem(QPixmap(":/insert_row.png"), tr("&Insert Row"), t, SLOT(insertRow())); + cm.insertItem(QPixmap(":/delete_row.png"), tr("&Delete Row"), t, SLOT(deleteSelectedRows())); + cm.insertItem(QPixmap(":/erase.png"), tr("Clea&r Row"), t, SLOT(clearSelection())); + cm.insertSeparator(); + cm.addAction(actionShowRowStatistics); + } else if (t->numSelectedRows() > 1) { + cm.addAction(actionShowColumnValuesDialog); + cm.insertItem(QPixmap(":/cut.png"),tr("Cu&t"), t, SLOT(cutSelection())); + cm.insertItem(QPixmap(":/copy.png"),tr("&Copy"), t, SLOT(copySelection())); + cm.insertItem(QPixmap(":/paste.png"),tr("&Paste"), t, SLOT(pasteSelection())); + cm.insertSeparator(); + cm.addAction(actionTableRecalculate); + cm.insertItem(QPixmap(":/delete_row.png"), tr("&Delete Rows"), t, SLOT(deleteSelectedRows())); + cm.insertItem(QPixmap(":/erase.png"),tr("Clea&r Rows"), t, SLOT(clearSelection())); + cm.insertSeparator(); + cm.addAction(actionShowRowStatistics); + } else if (t->numRows() > 0 && t->numCols() > 0){ + cm.addAction(actionShowColumnValuesDialog); + cm.insertItem(QPixmap(":/cut.png"),tr("Cu&t"), t, SLOT(cutSelection())); + cm.insertItem(QPixmap(":/copy.png"),tr("&Copy"), t, SLOT(copySelection())); + cm.insertItem(QPixmap(":/paste.png"),tr("&Paste"), t, SLOT(pasteSelection())); + cm.insertSeparator(); + cm.addAction(actionTableRecalculate); + cm.insertItem(QPixmap(":/erase.png"),tr("Clea&r"), t, SLOT(clearSelection())); + } + } else { + cm.addAction(actionShowExportASCIIDialog); + cm.insertSeparator(); + cm.addAction(actionAddColToTable); + cm.addAction(actionClearTable); + cm.insertSeparator(); + cm.addAction(actionGoToRow); + cm.addAction(actionGoToColumn); + } + cm.exec(QCursor::pos()); +} + +void ApplicationWindow::chooseHelpFolder() +{ + QFileInfo hfi(helpFilePath); + QString dir = QFileDialog::getExistingDirectory(this, tr("Choose the location of the QtiPlot help folder!"), + hfi.dir().absolutePath(), QFileDialog::ShowDirsOnly); + if (!dir.isEmpty()){ + helpFilePath = QDir(dir).absoluteFilePath ("index.html"); + if (!QFile(helpFilePath).exists()){ + QMessageBox::critical(this, tr("QtiPlot - index.html File Not Found!"), + tr("There is no file called index.html in this folder.
Please choose another folder!")); + } + } +} + +void ApplicationWindow::showStandAloneHelp() +{ +#ifdef Q_OS_MAC // Mac + QSettings settings(QSettings::IniFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); +#else + QSettings settings(QSettings::NativeFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); +#endif + + settings.beginGroup("/General"); + settings.beginGroup("/Paths"); + QString helpPath = settings.value("/HelpFile", qApp->applicationDirPath()+"/manual/index.html").toString(); + settings.endGroup(); + settings.endGroup(); + + QFile helpFile(helpPath); + if (!helpPath.isEmpty() && !helpFile.exists()) + { + QMessageBox::critical(0, tr("QtiPlot - Help Files Not Found!"), + tr("The manual can be downloaded from the following internet address:")+ + "

http://soft.proindependent.com/manuals.html

"); + exit(0); + } + + QFileInfo fi(helpPath); + QString profilePath = QString(fi.dirPath(true)+"/qtiplot.adp"); + if (!QFile(profilePath).exists()) + { + QMessageBox::critical(0, tr("QtiPlot - Help Profile Not Found!"), + tr("The assistant could not start because the file %1 was not found in the help file directory!").arg("qtiplot.adp")+"
"+ + tr("This file is provided with the QtiPlot manual which can be downloaded from the following internet address:")+ + "

http://soft.proindependent.com/manuals.html

"); + exit(0); + } + + QStringList cmdLst = QStringList() << "-profile" << profilePath; + QAssistantClient *assist = new QAssistantClient( QString(), 0); + assist->setArguments( cmdLst ); + assist->showPage(helpPath); + connect(assist, SIGNAL(assistantClosed()), qApp, SLOT(quit()) ); +} + +void ApplicationWindow::showHelp() +{ + QFile helpFile(helpFilePath); + if (!helpFile.exists()){ + QMessageBox::critical(this, tr("QtiPlot - Help Files Not Found!"), + tr("Please indicate the location of the help file!")+"
"+ + tr("The manual can be downloaded from the following internet address:")+ + "

http://soft.proindependent.com/manuals.html

"); + QString fn = getFileName(this, tr("QtiPlot - Help Files Not Found!"), QDir::currentDirPath(), "*.html", 0, false); + if (!fn.isEmpty()){ + QFileInfo fi(fn); + helpFilePath = fi.absFilePath(); + saveSettings(); + } + } + + QFileInfo fi(helpFilePath); + QString profilePath = QString(fi.dirPath(true)+"/qtiplot.adp"); + if (!QFile(profilePath).exists()) + { + QMessageBox::critical(this,tr("QtiPlot - Help Profile Not Found!"), + tr("The assistant could not start because the file %1 was not found in the help file directory!").arg("qtiplot.adp")+"
"+ + tr("This file is provided with the QtiPlot manual which can be downloaded from the following internet address:")+ + "

http://soft.proindependent.com/manuals.html

"); + return; + } + + QStringList cmdLst = QStringList() << "-profile" << profilePath; + assistant->setArguments( cmdLst ); + assistant->showPage(helpFilePath); +} + +void ApplicationWindow::showPlotWizard() +{ + QStringList lst = tableNames(); + if (lst.count() > 0){ + PlotWizard* pw = new PlotWizard(this); + pw->insertTablesList(lst); + pw->setColumnsList(columnsList(Table::All)); + pw->changeColumnsList(lst[0]); + pw->exec(); + } else + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no tables available in this project.

" + "

Please create a table and try again!

")); +} + +void ApplicationWindow::setCurveFullRange() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g) + return; + + g->setCurveFullRange(actionCurveFullRange->data().toInt()); +} + +void ApplicationWindow::showCurveRangeDialog() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g) + return; + + showCurveRangeDialog(g, actionEditCurveRange->data().toInt()); +} + +CurveRangeDialog* ApplicationWindow::showCurveRangeDialog(Graph *g, int curve) +{ + if (!g) + return 0; + + CurveRangeDialog* crd = new CurveRangeDialog(this); + crd->setAttribute(Qt::WA_DeleteOnClose); + crd->setCurveToModify(g, curve); + crd->exec(); + return crd; +} + +FunctionDialog* ApplicationWindow::showFunctionDialog(Graph *g, int curve) +{ + if ( !g ) + return 0; + + FunctionDialog* fd = functionDialog(); + fd->setWindowTitle(tr("QtiPlot - Edit function")); + fd->setCurveToModify(g, curve); + return fd; +} + +FunctionDialog* ApplicationWindow::functionDialog() +{ + FunctionDialog* fd = new FunctionDialog(this); + fd->setModal(true); + fd->show(); + fd->setActiveWindow(); + return fd; +} + +void ApplicationWindow::addFunctionCurve() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + return; + } + + Graph* g = plot->activeLayer(); + if ( g ) { + FunctionDialog* fd = functionDialog(); + if (fd) + fd->setGraph(g); + } +} + +void ApplicationWindow::updateFunctionLists(int type, QStringList &formulas) +{ + int maxListSize = 10; + if (type == 2 && formulas.size() >= 2){ + rFunctions.remove(formulas[0]); + rFunctions.push_front(formulas[0]); + + thetaFunctions.remove(formulas[1]); + thetaFunctions.push_front(formulas[1]); + + while ((int)rFunctions.size() > maxListSize) + rFunctions.pop_back(); + while ((int)thetaFunctions.size() > maxListSize) + thetaFunctions.pop_back(); + } else if (type == 1 && formulas.size() >= 2){ + xFunctions.remove(formulas[0]); + xFunctions.push_front(formulas[0]); + + yFunctions.remove(formulas[1]); + yFunctions.push_front(formulas[1]); + + while ((int)xFunctions.size() > maxListSize) + xFunctions.pop_back(); + while ((int)yFunctions.size() > maxListSize) + yFunctions.pop_back(); + } else if (type == 0 && formulas.size() >= 1){ + d_recent_functions.remove(formulas[0]); + d_recent_functions.push_front(formulas[0]); + + while ((int)d_recent_functions.size() > maxListSize) + d_recent_functions.pop_back(); + } +} + +MultiLayer* ApplicationWindow::newFunctionPlot(QStringList &formulas, double start, double end, int points, const QString& var, int type) +{ + MultiLayer *ml = newGraph(); + if (ml) + ml->activeLayer()->addFunction(formulas, start, end, points, var, type); + + updateFunctionLists(type, formulas); + return ml; +} + +void ApplicationWindow::clearLogInfo() +{ + if (!current_folder->logInfo().isEmpty()){ + current_folder->clearLogInfo(); + results->setText(""); + emit modified(); + } +} + +void ApplicationWindow::setFramed3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setFramed(); + actionShowAxisDialog->setEnabled(TRUE); +} + +void ApplicationWindow::setBoxed3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setBoxed(); + actionShowAxisDialog->setEnabled(TRUE); +} + +void ApplicationWindow::removeAxes3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setNoAxes(); + actionShowAxisDialog->setEnabled(false); +} + +void ApplicationWindow::removeGrid3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setPolygonStyle(); +} + +void ApplicationWindow::setHiddenLineGrid3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setHiddenLineStyle(); +} + +void ApplicationWindow::setPoints3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setDotStyle(); +} + +void ApplicationWindow::setCones3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setConeStyle(); +} + +void ApplicationWindow::setCrosses3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setCrossStyle(); +} + +void ApplicationWindow::setBars3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setBarStyle(); +} + +void ApplicationWindow::setLineGrid3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setWireframeStyle(); +} + +void ApplicationWindow::setFilledMesh3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setFilledMeshStyle(); +} + +void ApplicationWindow::setFloorData3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setFloorData(); +} + +void ApplicationWindow::setFloorIso3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setFloorIsolines(); +} + +void ApplicationWindow::setEmptyFloor3DPlot() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setEmptyFloor(); +} + +void ApplicationWindow::setFrontGrid3DPlot(bool on) +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setFrontGrid(on); +} + +void ApplicationWindow::setBackGrid3DPlot(bool on) +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setBackGrid(on); +} + +void ApplicationWindow::setFloorGrid3DPlot(bool on) +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setFloorGrid(on); +} + +void ApplicationWindow::setCeilGrid3DPlot(bool on) +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setCeilGrid(on); +} + +void ApplicationWindow::setRightGrid3DPlot(bool on) +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setRightGrid(on); +} + +void ApplicationWindow::setLeftGrid3DPlot(bool on) +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setLeftGrid(on); +} + +void ApplicationWindow::pickPlotStyle( QAction* action ) +{ + if (!action ) + return; + + if (action == polygon) + removeGrid3DPlot(); + else if (action == filledmesh) + setFilledMesh3DPlot(); + else if (action == wireframe) + setLineGrid3DPlot(); + else if (action == hiddenline) + setHiddenLineGrid3DPlot(); + else if (action == pointstyle) + setPoints3DPlot(); + else if (action == conestyle) + setCones3DPlot(); + else if (action == crossHairStyle) + setCrosses3DPlot(); + else if (action == barstyle) + setBars3DPlot(); + + emit modified(); +} + + +void ApplicationWindow::pickCoordSystem( QAction* action) +{ + if (!action) + return; + + if (action == Box || action == Frame) + { + if (action == Box) + setBoxed3DPlot(); + if (action == Frame) + setFramed3DPlot(); + grids->setEnabled(true); + } + else if (action == None) + { + removeAxes3DPlot(); + grids->setEnabled(false); + } + + emit modified(); +} + +void ApplicationWindow::pickFloorStyle( QAction* action ) +{ + if (!action) + return; + + if (action == floordata) + setFloorData3DPlot(); + else if (action == flooriso) + setFloorIso3DPlot(); + else + setEmptyFloor3DPlot(); + + emit modified(); +} + +void ApplicationWindow::custom3DActions(QMdiSubWindow *w) +{ + if (w && w->isA("Graph3D")) + { + Graph3D* plot = (Graph3D*)w; + actionAnimate->setOn(plot->isAnimated()); + actionPerspective->setOn(!plot->isOrthogonal()); + switch(plot->plotStyle()) + { + case FILLEDMESH: + wireframe->setChecked( false ); + hiddenline->setChecked( false ); + polygon->setChecked( false ); + filledmesh->setChecked( true ); + pointstyle->setChecked( false ); + barstyle->setChecked( false ); + conestyle->setChecked( false ); + crossHairStyle->setChecked( false ); + break; + + case FILLED: + wireframe->setChecked( false ); + hiddenline->setChecked( false ); + polygon->setChecked( true ); + filledmesh->setChecked( false ); + pointstyle->setChecked( false ); + barstyle->setChecked( false ); + conestyle->setChecked( false ); + crossHairStyle->setChecked( false ); + break; + + case Qwt3D::USER: + wireframe->setChecked( false ); + hiddenline->setChecked( false ); + polygon->setChecked( false ); + filledmesh->setChecked( false ); + + if (plot->pointType() == Graph3D::VerticalBars) + { + pointstyle->setChecked( false ); + conestyle->setChecked( false ); + crossHairStyle->setChecked( false ); + barstyle->setChecked( true ); + } + else if (plot->pointType() == Graph3D::Dots) + { + pointstyle->setChecked( true ); + barstyle->setChecked( false ); + conestyle->setChecked( false ); + crossHairStyle->setChecked( false ); + } + else if (plot->pointType() == Graph3D::HairCross) + { + pointstyle->setChecked( false ); + barstyle->setChecked( false ); + conestyle->setChecked( false ); + crossHairStyle->setChecked( true ); + } + else if (plot->pointType() == Graph3D::Cones) + { + pointstyle->setChecked( false ); + barstyle->setChecked( false ); + conestyle->setChecked( true ); + crossHairStyle->setChecked( false ); + } + break; + + case WIREFRAME: + wireframe->setChecked( true ); + hiddenline->setChecked( false ); + polygon->setChecked( false ); + filledmesh->setChecked( false ); + pointstyle->setChecked( false ); + barstyle->setChecked( false ); + conestyle->setChecked( false ); + crossHairStyle->setChecked( false ); + break; + + case HIDDENLINE: + wireframe->setChecked( false ); + hiddenline->setChecked( true ); + polygon->setChecked( false ); + filledmesh->setChecked( false ); + pointstyle->setChecked( false ); + barstyle->setChecked( false ); + conestyle->setChecked( false ); + crossHairStyle->setChecked( false ); + break; + + default: + break; + } + + switch(plot->coordStyle()) + { + case Qwt3D::NOCOORD: + None->setChecked( true ); + Box->setChecked( false ); + Frame->setChecked( false ); + break; + + case Qwt3D::BOX: + None->setChecked( false ); + Box->setChecked( true ); + Frame->setChecked( false ); + break; + + case Qwt3D::FRAME: + None->setChecked(false ); + Box->setChecked( false ); + Frame->setChecked(true ); + break; + } + + switch(plot->floorStyle()) + { + case NOFLOOR: + floornone->setChecked( true ); + flooriso->setChecked( false ); + floordata->setChecked( false ); + break; + + case FLOORISO: + floornone->setChecked( false ); + flooriso->setChecked( true ); + floordata->setChecked( false ); + break; + + case FLOORDATA: + floornone->setChecked(false ); + flooriso->setChecked( false ); + floordata->setChecked(true ); + break; + } + custom3DGrids(plot->grids()); + } +} + +void ApplicationWindow::custom3DGrids(int grids) +{ + if (Qwt3D::BACK & grids) + back->setChecked(true); + else + back->setChecked(false); + + if (Qwt3D::FRONT & grids) + front->setChecked(true); + else + front->setChecked(false); + + if (Qwt3D::CEIL & grids) + ceil->setChecked(true); + else + ceil->setChecked(false); + + if (Qwt3D::FLOOR & grids) + floor->setChecked(true); + else + floor->setChecked(false); + + if (Qwt3D::RIGHT & grids) + right->setChecked(true); + else + right->setChecked(false); + + if (Qwt3D::LEFT & grids) + left->setChecked(true); + else + left->setChecked(false); +} + +void ApplicationWindow::initPlot3DToolBar() +{ + plot3DTools = new QToolBar( tr( "3D Surface" ), this ); + plot3DTools->setObjectName("plot3DTools"); // this is needed for QMainWindow::restoreState() + plot3DTools->setIconSize( QSize(20,20) ); + addToolBarBreak( Qt::TopToolBarArea ); + addToolBar( Qt::TopToolBarArea, plot3DTools ); + + coord = new QActionGroup( this ); + Box = new QAction( coord ); + Box->setIcon(QIcon(":/box.png")); + Box->setCheckable(true); + + Frame = new QAction( coord ); + Frame->setIcon(QIcon(":/free_axes.png")); + Frame->setCheckable(true); + + None = new QAction( coord ); + None->setIcon(QIcon(":/no_axes.png")); + None->setCheckable(true); + + plot3DTools->addAction(Frame); + plot3DTools->addAction(Box); + plot3DTools->addAction(None); + Box->setChecked( true ); + + plot3DTools->addSeparator(); + + // grid actions + grids = new QActionGroup( this ); + grids->setEnabled( true ); + grids->setExclusive( false ); + front = new QAction( grids ); + front->setCheckable( true ); + front->setIcon(QIcon(":/frontGrid.png")); + back = new QAction( grids ); + back->setCheckable( true ); + back->setIcon(QIcon(":/backGrid.png")); + right = new QAction( grids ); + right->setCheckable( true ); + right->setIcon(QIcon(":/leftGrid.png")); + left = new QAction( grids ); + left->setCheckable( true ); + left->setIcon(QIcon(":/rightGrid.png")); + ceil = new QAction( grids ); + ceil->setCheckable( true ); + ceil->setIcon(QIcon(":/ceilGrid.png")); + floor = new QAction( grids ); + floor->setCheckable( true ); + floor->setIcon(QIcon(":/floorGrid.png")); + + plot3DTools->addAction(front); + plot3DTools->addAction(back); + plot3DTools->addAction(right); + plot3DTools->addAction(left); + plot3DTools->addAction(ceil); + plot3DTools->addAction(floor); + + plot3DTools->addSeparator(); + + actionPerspective = new QAction( this ); + actionPerspective->setToggleAction( TRUE ); + actionPerspective->setIconSet(QPixmap(":/perspective.png")); + actionPerspective->addTo( plot3DTools ); + actionPerspective->setOn(!d_3D_orthogonal); + connect(actionPerspective, SIGNAL(toggled(bool)), this, SLOT(togglePerspective(bool))); + + actionResetRotation = new QAction( this ); + actionResetRotation->setToggleAction( false ); + actionResetRotation->setIconSet(QPixmap(":/reset_rotation.png")); + actionResetRotation->addTo( plot3DTools ); + connect(actionResetRotation, SIGNAL(activated()), this, SLOT(resetRotation())); + + actionFitFrame = new QAction( this ); + actionFitFrame->setToggleAction( false ); + actionFitFrame->setIconSet(QPixmap(":/fit_frame.png")); + actionFitFrame->addTo( plot3DTools ); + connect(actionFitFrame, SIGNAL(activated()), this, SLOT(fitFrameToLayer())); + + plot3DTools->addSeparator(); + + //plot style actions + plotstyle = new QActionGroup( this ); + wireframe = new QAction( plotstyle ); + wireframe->setCheckable( true ); + wireframe->setEnabled( true ); + wireframe->setIcon(QIcon(":/lineMesh.png")); + hiddenline = new QAction( plotstyle ); + hiddenline->setCheckable( true ); + hiddenline->setEnabled( true ); + hiddenline->setIcon(QIcon(":/grid_only.png")); + polygon = new QAction( plotstyle ); + polygon->setCheckable( true ); + polygon->setEnabled( true ); + polygon->setIcon(QIcon(":/no_grid.png")); + filledmesh = new QAction( plotstyle ); + filledmesh->setCheckable( true ); + filledmesh->setIcon(QIcon(":/grid_poly.png")); + pointstyle = new QAction( plotstyle ); + pointstyle->setCheckable( true ); + pointstyle->setIcon(QIcon(":/pointsMesh.png")); + + conestyle = new QAction( plotstyle ); + conestyle->setCheckable( true ); + conestyle->setIcon(QIcon(":/cones.png")); + + crossHairStyle = new QAction( plotstyle ); + crossHairStyle->setCheckable( true ); + crossHairStyle->setIcon(QIcon(":/crosses.png")); + + barstyle = new QAction( plotstyle ); + barstyle->setCheckable( true ); + barstyle->setIcon(QIcon(":/plot_bars.png")); + + plot3DTools->addAction(barstyle); + plot3DTools->addAction(pointstyle); + + plot3DTools->addAction(conestyle); + plot3DTools->addAction(crossHairStyle); + plot3DTools->addSeparator(); + + plot3DTools->addAction(wireframe); + plot3DTools->addAction(hiddenline); + plot3DTools->addAction(polygon); + plot3DTools->addAction(filledmesh); + filledmesh->setChecked( true ); + + plot3DTools->addSeparator(); + + //floor actions + floorstyle = new QActionGroup( this ); + floordata = new QAction( floorstyle ); + floordata->setCheckable( true ); + floordata->setIcon(QIcon(":/floor.png")); + flooriso = new QAction( floorstyle ); + flooriso->setCheckable( true ); + flooriso->setIcon(QIcon(":/isolines.png")); + floornone = new QAction( floorstyle ); + floornone->setCheckable( true ); + floornone->setIcon(QIcon(":/no_floor.png")); + + plot3DTools->addAction(floordata); + plot3DTools->addAction(flooriso); + plot3DTools->addAction(floornone); + floornone->setChecked( true ); + + plot3DTools->addSeparator(); + + actionAnimate = new QAction( this ); + actionAnimate->setToggleAction( true ); + actionAnimate->setIconSet(QPixmap(":/movie.png")); + plot3DTools->addAction(actionAnimate); + + plot3DTools->hide(); + + connect(actionAnimate, SIGNAL(toggled(bool)), this, SLOT(toggle3DAnimation(bool))); + connect( coord, SIGNAL( triggered( QAction* ) ), this, SLOT( pickCoordSystem( QAction* ) ) ); + connect( floorstyle, SIGNAL( triggered( QAction* ) ), this, SLOT( pickFloorStyle( QAction* ) ) ); + connect( plotstyle, SIGNAL( triggered( QAction* ) ), this, SLOT( pickPlotStyle( QAction* ) ) ); + + connect( left, SIGNAL( triggered( bool ) ), this, SLOT( setLeftGrid3DPlot(bool) )); + connect( right, SIGNAL( triggered( bool ) ), this, SLOT( setRightGrid3DPlot( bool ) ) ); + connect( ceil, SIGNAL( triggered( bool ) ), this, SLOT( setCeilGrid3DPlot( bool ) ) ); + connect( floor, SIGNAL( triggered( bool ) ), this, SLOT(setFloorGrid3DPlot( bool ) ) ); + connect( back, SIGNAL( triggered( bool ) ), this, SLOT(setBackGrid3DPlot( bool ) ) ); + connect( front, SIGNAL( triggered( bool ) ), this, SLOT( setFrontGrid3DPlot( bool ) ) ); +} + +void ApplicationWindow::pixelLineProfile() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g) + return; + + bool ok; + int res = QInputDialog::getInteger( + tr("QtiPlot - Set the number of pixels to average"), tr("Number of averaged pixels"),1, 1, 2000, 2, + &ok, this ); + if ( !ok ) + return; + + LineProfileTool *lpt = new LineProfileTool(g, this, res); + g->setActiveTool(lpt); +} + +void ApplicationWindow::intensityTable() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (g){ + ImageWidget *im = qobject_cast(g->activeEnrichment()); + if (im){ + QString fn = im->fileName(); + if (!fn.isEmpty()) + importImage(fn); + } + } +} + +void ApplicationWindow::autoArrangeLayers() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + if (plot->isWaterfallPlot()) + plot->updateWaterfallLayout(); + else { + plot->setMargins(5, 5, 5, 5); + plot->setSpacing(5, 5); + plot->arrangeLayers(true, false); + } +} + +void ApplicationWindow::extractGraphs() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + if (plot->numLayers() < 2){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("You must have more than one layer in the active window!")); + return; + } + + QList lst = plot->layersList(); + foreach(Graph *g, lst){ + MultiLayer *nw = multilayerPlot(generateUniqueName(tr("Graph")), 0, plot->getRows(), plot->getCols()); + nw->resize(plot->size()); + Graph *ng = nw->addLayer(g->pos().x(), g->pos().y(), g->width(), g->height()); + if (ng) + ng->copy(g); + } +} + +void ApplicationWindow::extractLayers() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph *g = plot->activeLayer(); + if (!g) + return; + + int curves = g->curveCount(); + if (curves < 2){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("You must have more than one dataset in the active layer!")); + return; + } + + for(int i = 0; i < curves; i++){ + Graph *ng = plot->addLayer(g->pos().x(), g->pos().y(), g->width(), g->height()); + if (ng){ + ng->copy(g); + for(int j = 0; j < curves; j++){ + if (j != i) + ng->removeCurve(j); + } + } + } + plot->removeLayer(g); + plot->arrangeLayers(true, false); +} + +void ApplicationWindow::addInsetLayer(bool curves) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph *al = plot->activeLayer(); + if (!al) + return; + + QRect r = al->geometry(); + Graph *g = plot->addLayer(r.x() + r.width()/2, al->canvas()->y(), r.width()/2, r.height()/2, true); + if (g){ + g->setTitle(""); + g->setAxisTitle(QwtPlot::xBottom, ""); + g->setAxisTitle(QwtPlot::yLeft, ""); + g->enableAxis(QwtPlot::yRight, false); + g->enableAxis(QwtPlot::xTop, false); + + QColor c = Qt::white; + c.setAlpha(0); + g->setBackgroundColor(c); + g->setCanvasBackground(c); + if (curves) + g->copyCurves(al); + } +} + +void ApplicationWindow::addInsetCurveLayer() +{ + addInsetLayer(true); +} + +void ApplicationWindow::addLayer() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + if (plot->numLayers() == 0){ + setPreferences(plot->addLayer()); + return; + } + + switch(QMessageBox::information(this, + tr("QtiPlot - Guess best origin for the new layer?"), + tr("Do you want QtiPlot to guess the best position for the new layer?\n Warning: this will rearrange existing layers!"), + tr("&Guess"), tr("&Top-left corner"), tr("&Cancel"), 0, 2 ) ){ + case 0: + setPreferences(plot->addLayer()); + plot->arrangeLayers(true, true); + break; + + case 1: + setPreferences(plot->addLayer(0, 0, plot->canvasRect().width(), plot->canvasRect().height())); + break; + + case 2: + return; + break; + } +} + +void ApplicationWindow::deleteLayer() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + plot->confirmRemoveLayer(); +} + +Note* ApplicationWindow::openNote(ApplicationWindow* app, const QStringList &flist) +{ + QStringList lst = flist[0].split("\t", QString::SkipEmptyParts); + QString caption = lst[0]; + Note* w = app->newNote(caption); + if (lst.count() == 2){ + app->setListViewDate(caption, lst[1]); + w->setBirthDate(lst[1]); + } + + if (flist.size() >= 2) + restoreWindowGeometry(app, w, flist[1]); + + if (flist.size() >= 3){ + lst = flist[2].split("\t"); + if (lst.size() >= 3){ + w->setWindowLabel(lst[1]); + w->setCaptionPolicy((MdiSubWindow::CaptionPolicy)lst[2].toInt()); + } + } + return w; +} + +Matrix* ApplicationWindow::openMatrix(ApplicationWindow* app, const QStringList &flist) +{ + QStringList::const_iterator line = flist.begin(); + + QStringList list=(*line).split("\t"); + QString caption=list[0]; + int rows = list[1].toInt(); + int cols = list[2].toInt(); + + Matrix* w = app->newMatrix(caption, rows, cols); + app->setListViewDate(caption,list[3]); + w->setBirthDate(list[3]); + + for (line++; line!=flist.end(); line++) + { + QStringList fields = (*line).split("\t"); + if (fields[0] == "geometry") { + restoreWindowGeometry(app, w, *line); + } else if (fields[0] == "ColWidth") { + w->setColumnsWidth(fields[1].toInt()); + } else if (fields[0] == "Formula") { + w->setFormula(fields[1]); + } else if (fields[0] == "") { + QString formula; + for (line++; line!=flist.end() && *line != ""; line++) + formula += *line + "\n"; + formula.truncate(formula.length()-1); + w->setFormula(formula); + } else if (fields[0] == "TextFormat") { + if (fields[1] == "f") + w->setTextFormat('f', fields[2].toInt()); + else + w->setTextFormat('e', fields[2].toInt()); + } else if (fields[0] == "WindowLabel" && fields.size() >= 3) { // d_file_version > 71 + w->setWindowLabel(fields[1]); + w->setCaptionPolicy((MdiSubWindow::CaptionPolicy)fields[2].toInt()); + } else if (fields[0] == "Coordinates") { // d_file_version > 81 + w->setCoordinates(fields[1].toDouble(), fields[2].toDouble(), fields[3].toDouble(), fields[4].toDouble()); + } else if (fields[0] == "ViewType") { // d_file_version > 90 + w->setViewType((Matrix::ViewType)fields[1].toInt()); + } else if (fields[0] == "HeaderViewType") { // d_file_version > 90 + w->setHeaderViewType((Matrix::HeaderViewType)fields[1].toInt()); + } else if (fields[0] == "ColorPolicy"){// d_file_version > 90 + w->setColorMapType((Matrix::ColorMapType)fields[1].toInt()); + } else if (fields[0] == ""){// d_file_version > 90 + QStringList lst; + while ( *line != "" ){ + line++; + lst << *line; + } + lst.pop_back(); + w->setColorMap(lst); + } else // or values + break; + } + if (*line == "") line++; + + //read and set table values + for (; line!=flist.end() && *line != ""; line++){ + QStringList fields = (*line).split("\t"); + int row = fields[0].toInt(); + for (int col=0; colsetCell(row, col, QLocale::c().toDouble(cell)); + else if (d_file_version == 90) + w->setText(row, col, cell); + else + w->setCell(row, col, cell.toDouble()); + } + qApp->processEvents(QEventLoop::ExcludeUserInput); + } + w->resetView(); + return w; +} + +Table* ApplicationWindow::openTable(ApplicationWindow* app, const QStringList &flist) +{ + QStringList::const_iterator line = flist.begin(); + + QStringList list = (*line).split("\t"); + QString caption = list[0]; + int rows = list[1].toInt(); + int cols = list[2].toInt(); + + Table* w = app->newTable(caption, rows, cols); + app->setListViewDate(caption, list[3]); + w->setBirthDate(list[3]); + + for (line++; line!=flist.end(); line++) + { + QStringList fields = (*line).split("\t"); + if (fields[0] == "geometry" || fields[0] == "tgeometry") { + restoreWindowGeometry(app, w, *line); + } else if (fields[0] == "header") { + fields.pop_front(); + if (d_file_version >= 78) + w->loadHeader(fields); + else if (list.size() >= 7){ + w->setColPlotDesignation(list[4].toInt(), Table::X); + w->setColPlotDesignation(list[6].toInt(), Table::Y); + w->setHeader(fields); + } + } else if (fields[0] == "ColWidth") { + fields.pop_front(); + w->setColWidths(fields); + } else if (fields[0] == "com") { // legacy code + w->setCommands(*line); + } else if (fields[0] == "") { + for (line++; line!=flist.end() && *line != ""; line++) + { + int col = (*line).mid(9,(*line).length()-11).toInt(); + QString formula; + for (line++; line!=flist.end() && *line != ""; line++) + formula += *line + "\n"; + formula.truncate(formula.length()-1); + w->setCommand(col,formula); + } + } else if (fields[0] == "ColType") { // d_file_version > 65 + fields.pop_front(); + w->setColumnTypes(fields); + } else if (fields[0] == "Comments") { // d_file_version > 71 + fields.pop_front(); + w->setColComments(fields); + w->setHeaderColType(); + } else if (fields[0] == "WindowLabel" && fields.size() >= 3) { // d_file_version > 71 + w->setWindowLabel(fields[1]); + w->setCaptionPolicy((MdiSubWindow::CaptionPolicy)fields[2].toInt()); + } else if (fields[0] == "ReadOnlyColumn") { // d_file_version > 91 + fields.pop_front(); + for (int i=0; i < w->numCols(); i++) + w->setReadOnlyColumn(i, fields[i] == "1"); + } else if (fields[0] == "HiddenColumn") { // d_file_version >= 93 + fields.pop_front(); + for (int i=0; i < w->numCols(); i++) + w->hideColumn(i, fields[i] == "1"); + } else // or values + break; + } + + QApplication::setOverrideCursor(Qt::WaitCursor); + w->table()->blockSignals(true); + for (line++; line!=flist.end() && *line != ""; line++) + {//read and set table values + QStringList fields = (*line).split("\t"); + int row = fields[0].toInt(); + for (int col=0; col= col+2){ + QString cell = fields[col+1]; + if (cell.isEmpty()) + continue; + + if (w->columnType(col) == Table::Numeric){ + if (d_file_version < 90) + w->setCell(row, col, QLocale::c().toDouble(cell.replace(",", "."))); + else if (d_file_version == 90) + w->setText(row, col, cell); + else if (d_file_version >= 91) + w->setCell(row, col, cell.toDouble()); + } else + w->setText(row, col, cell); + } + } + QApplication::processEvents(QEventLoop::ExcludeUserInput); + } + QApplication::restoreOverrideCursor(); + + w->table()->blockSignals(false); + return w; +} + +TableStatistics* ApplicationWindow::openTableStatistics(const QStringList &flist) +{ + QStringList::const_iterator line = flist.begin(); + + QStringList list=(*line++).split("\t"); + QString caption=list[0]; + + QList targets; + for (int i=1; i <= (*line).count('\t'); i++) + targets << (*line).section('\t',i,i).toInt(); + + TableStatistics* w = newTableStatistics(table(list[1]), + list[2]=="row" ? TableStatistics::row : TableStatistics::column, targets, caption); + + setListViewDate(caption,list[3]); + w->setBirthDate(list[3]); + + for (line++; line!=flist.end(); line++){ + QStringList fields = (*line).split("\t"); + if (fields[0] == "geometry"){ + restoreWindowGeometry(this, w, *line);} + else if (fields[0] == "header"){ + fields.pop_front(); + + if (w->numCols() != fields.size()) + w->setNumCols(fields.size()); + + if (d_file_version >= 78) + w->loadHeader(fields); + else { + w->setColPlotDesignation(list[4].toInt(), Table::X); + w->setColPlotDesignation(list[6].toInt(), Table::Y); + w->setHeader(fields); + } + } else if (fields[0] == "ColWidth") { + fields.pop_front(); + w->setColWidths(fields); + } else if (fields[0] == "com") { // legacy code + w->setCommands(*line); + } else if (fields[0] == "") { + for (line++; line!=flist.end() && *line != ""; line++) + { + int col = (*line).mid(9,(*line).length()-11).toInt(); + QString formula; + for (line++; line!=flist.end() && *line != ""; line++) + formula += *line + "\n"; + formula.truncate(formula.length()-1); + w->setCommand(col,formula); + } + } else if (fields[0] == "ColType") { // d_file_version > 65 + fields.pop_front(); + w->setColumnTypes(fields); + } else if (fields[0] == "Comments") { // d_file_version > 71 + fields.pop_front(); + w->setColComments(fields); + } else if (fields[0] == "WindowLabel" && fields.size() >= 3) { // d_file_version > 71 + w->setWindowLabel(fields[1]); + w->setCaptionPolicy((MdiSubWindow::CaptionPolicy)fields[2].toInt()); + } + } + return w; +} + +Graph* ApplicationWindow::openGraph(ApplicationWindow* app, MultiLayer *plot, const QStringList &list) +{ + Graph* ag = 0; + int curveID = 0; + for (int j=0;j<(int)list.count()-1;j++){ + QString s=list[j]; + if (s.contains ("ggeometry")){ + QStringList fList = s.split("\t"); + ag = (Graph*)plot->addLayer(fList[1].toInt(), fList[2].toInt(), fList[3].toInt(), fList[4].toInt()); + ag->blockSignals(true); + ag->enableAutoscaling(autoscale2DPlots); + } + else if (s.left(10) == "Background"){ + QStringList fList = s.split("\t"); + QColor c = QColor(fList[1]); + if (fList.count() == 3) + c.setAlpha(fList[2].toInt()); + ag->setBackgroundColor(c); + } + else if (s.contains ("Margin")){ + QStringList fList=s.split("\t"); + ag->setMargin(fList[1].toInt()); + } + else if (s.contains ("Border")){ + QStringList fList=s.split("\t"); + ag->setFrame(fList[1].toInt(), QColor(fList[2])); + } + else if (s.contains ("EnabledAxes")){ + QStringList fList=s.split("\t"); + fList.pop_front(); + for (int i=0; i<(int)fList.count(); i++) + ag->enableAxis(i, fList[i].toInt()); + } + else if (s.contains ("AxesBaseline")){ + QStringList fList = s.split("\t", QString::SkipEmptyParts); + fList.pop_front(); + for (int i=0; i<(int)fList.count(); i++) + ag->setAxisMargin(i, fList[i].toInt()); + } + else if (s.contains ("EnabledTicks")) + {//version < 0.8.6 + QStringList fList=s.split("\t"); + fList.pop_front(); + fList.replaceInStrings("-1", "3"); + ag->setMajorTicksType(fList); + ag->setMinorTicksType(fList); + } + else if (s.contains ("MajorTicks")) + {//version >= 0.8.6 + QStringList fList=s.split("\t"); + fList.pop_front(); + ag->setMajorTicksType(fList); + } + else if (s.contains ("MinorTicks")) + {//version >= 0.8.6 + QStringList fList=s.split("\t"); + fList.pop_front(); + ag->setMinorTicksType(fList); + } + else if (s.contains ("TicksLength")){ + QStringList fList=s.split("\t"); + ag->setTicksLength(fList[1].toInt(), fList[2].toInt()); + } + else if (s.contains ("EnabledTickLabels")){ + QStringList fList=s.split("\t"); + fList.pop_front(); + for (int i=0; ienableAxisLabels(i, fList[i].toInt()); + } + else if (s.contains ("AxesColors")){ + QStringList fList = s.split("\t"); + fList.pop_front(); + for (int i=0; isetAxisColor(i, QColor(fList[i])); + } + else if (s.contains ("AxesNumberColors")){ + QStringList fList=QStringList::split ("\t",s,TRUE); + fList.pop_front(); + for (int i=0; isetAxisLabelsColor(i, QColor(fList[i])); + } + else if (s.left(5)=="grid\t"){ + ag->grid()->load(s.split("\t")); + } + else if (s.startsWith ("") && s.endsWith ("")){ + bool antialiasing = s.remove("").remove("").toInt(); + ag->setAntialiasing(antialiasing); + } + else if (s.contains ("PieCurve")){ + QStringList curve=s.split("\t"); + if (!app->renamedTables.isEmpty()){ + QString caption = (curve[1]).left((curve[1]).find("_",0)); + if (app->renamedTables.contains(caption)) + {//modify the name of the curve according to the new table name + int index = app->renamedTables.findIndex(caption); + QString newCaption = app->renamedTables[++index]; + curve.replaceInStrings(caption+"_", newCaption+"_"); + } + } + QPen pen = QPen(QColor(curve[3]), curve[2].toDouble(),Graph::getPenStyle(curve[4])); + + Table *table = app->table(curve[1]); + if (table){ + int startRow = 0; + int endRow = table->numRows() - 1; + int first_color = curve[7].toInt(); + bool visible = true; + if (d_file_version >= 90){ + startRow = curve[8].toInt(); + endRow = curve[9].toInt(); + visible = curve[10].toInt(); + } + + if (d_file_version <= 89) + first_color = convertOldToNewColorIndex(first_color); + + if (curve.size() >= 22){//version 0.9.3-rc3 + ag->plotPie(table, curve[1], pen, curve[5].toInt(), + curve[6].toInt(), first_color, startRow, endRow, visible, + curve[11].toDouble(), curve[12].toDouble(), curve[13].toDouble(), + curve[14].toDouble(), curve[15].toDouble(), curve[16].toInt(), + curve[17].toInt(), curve[18].toInt(), curve[19].toInt(), + curve[20].toInt(), curve[21].toInt()); + } else + ag->plotPie(table, curve[1], pen, curve[5].toInt(), + curve[6].toInt(), first_color, startRow, endRow, visible); + } + }else if (s.left(6)=="curve\t"){ + QStringList curve = s.split("\t", QString::SkipEmptyParts); + if (!app->renamedTables.isEmpty()){ + QString caption = (curve[2]).left((curve[2]).find("_",0)); + if (app->renamedTables.contains(caption)) + {//modify the name of the curve according to the new table name + int index = app->renamedTables.findIndex (caption); + QString newCaption = app->renamedTables[++index]; + curve.replaceInStrings(caption+"_", newCaption+"_"); + } + } + + CurveLayout cl; + cl.connectType=curve[4].toInt(); + cl.lCol = readColorFromProject(curve[5]); + cl.lStyle = curve[6].toInt(); + cl.lWidth = curve[7].toDouble(); + cl.sSize = curve[8].toInt(); + if (d_file_version <= 78) + cl.sType=Graph::obsoleteSymbolStyle(curve[9].toInt()); + else + cl.sType=curve[9].toInt(); + + cl.symCol = readColorFromProject(curve[10]); + cl.fillCol = readColorFromProject(curve[11]); + cl.filledArea = curve[12].toDouble(); + cl.aCol = readColorFromProject(curve[13]); + cl.aStyle = curve[14].toInt(); + if(curve.count() < 16) + cl.penWidth = cl.lWidth; + else if ((d_file_version >= 79) && (curve[3].toInt() == Graph::Box)) + cl.penWidth = curve[15].toDouble(); + else if ((d_file_version >= 78) && (curve[3].toInt() <= Graph::LineSymbols)) + cl.penWidth = curve[15].toDouble(); + else + cl.penWidth = cl.lWidth; + + int plotType = curve[3].toInt(); + Table *w = app->table(curve[2]); + PlotCurve *c = NULL; + if (w){ + if(plotType == Graph::VectXYXY || plotType == Graph::VectXYAM){ + QStringList colsList; + colsList<colName(curve[1].toInt())); + else + colsList.prepend(curve[1]); + + int startRow = 0; + int endRow = -1; + if (d_file_version >= 90){ + startRow = curve[curve.count()-3].toInt(); + endRow = curve[curve.count()-2].toInt(); + } + + c = (PlotCurve *)ag->plotVectorCurve(w, colsList, plotType, startRow, endRow); + + if (d_file_version <= 77){ + int temp_index = convertOldToNewColorIndex(curve[15].toInt()); + ag->updateVectorsLayout(curveID, ColorBox::defaultColor(temp_index), curve[16].toDouble(), curve[17].toInt(), + curve[18].toInt(), curve[19].toInt(), 0, curve[20], curve[21]); + } else { + if(plotType == Graph::VectXYXY) + ag->updateVectorsLayout(curveID, curve[15], curve[16].toDouble(), + curve[17].toInt(), curve[18].toInt(), curve[19].toInt(), 0); + else + ag->updateVectorsLayout(curveID, curve[15], curve[16].toDouble(), curve[17].toInt(), + curve[18].toInt(), curve[19].toInt(), curve[22].toInt()); + } + } else if (plotType == Graph::Box) + c = (PlotCurve *)ag->openBoxDiagram(w, curve, d_file_version); + else { + if (d_file_version < 72) + c = (PlotCurve *)ag->insertCurve(w, curve[1].toInt(), curve[2], plotType); + else if (d_file_version < 90) + c = (PlotCurve *)ag->insertCurve(w, curve[1], curve[2], plotType); + else { + int startRow = curve[curve.count()-3].toInt(); + int endRow = curve[curve.count()-2].toInt(); + c = (PlotCurve *)ag->insertCurve(w, curve[1], curve[2], plotType, startRow, endRow); + } + } + + if(plotType == Graph::Histogram){ + QwtHistogram *h = (QwtHistogram *)ag->curve(curveID); + if (d_file_version <= 76) + h->setBinning(curve[16].toInt(),curve[17].toDouble(),curve[18].toDouble(),curve[19].toDouble()); + else + h->setBinning(curve[17].toInt(),curve[18].toDouble(),curve[19].toDouble(),curve[20].toDouble()); + h->loadData(); + } + + if(plotType == Graph::VerticalBars || plotType == Graph::HorizontalBars || + plotType == Graph::Histogram){ + if (d_file_version <= 76) + ag->setBarsGap(curveID, curve[15].toInt(), 0); + else + ag->setBarsGap(curveID, curve[15].toInt(), curve[16].toInt()); + } + ag->updateCurveLayout(c, &cl); + if (d_file_version >= 88){ + if (c && c->rtti() == QwtPlotItem::Rtti_PlotCurve){ + if (d_file_version < 90) + c->setAxis(curve[curve.count()-2].toInt(), curve[curve.count()-1].toInt()); + else { + c->setAxis(curve[curve.count()-5].toInt(), curve[curve.count()-4].toInt()); + c->setVisible(curve.last().toInt()); + } + } + } + } else if(plotType == Graph::Histogram){//histograms from matrices + Matrix *m = app->matrix(curve[2]); + QwtHistogram *h = ag->restoreHistogram(m, curve); + ag->updateCurveLayout(h, &cl); + } + curveID++; + } else if (s == ""){ + QStringList lst; + while ( s!="" ){ + s = list[++j]; + lst << s; + } + lst.pop_back(); + ag->restoreCurveLabels(curveID - 1, lst); + } else if (s.contains("")){ + PlotCurve *c = (PlotCurve *)ag->curve(curveID - 1); + if (c) + c->setSkipSymbolsCount(s.remove("").remove("").toInt()); + } else if (s.contains("")){ + QwtBarCurve *b = (QwtBarCurve *)ag->curve(curveID - 1); + if (b) + b->setWhiteOut(); + } else if (s == ""){//version 0.9.5 + curveID++; + QStringList lst; + while ( s != "" ){ + s = list[++j]; + lst << s; + } + lst.pop_back(); + FunctionCurve::restore(ag, lst); + } else if (s.contains ("FunctionCurve")){ + QStringList curve = s.split("\t"); + CurveLayout cl; + cl.connectType = curve[6].toInt(); + cl.lCol = readColorFromProject(curve[7]); + cl.lStyle = curve[8].toInt(); + cl.lWidth=curve[9].toDouble(); + cl.sSize=curve[10].toInt(); + cl.sType=curve[11].toInt(); + cl.symCol = readColorFromProject(curve[12]); + cl.fillCol = readColorFromProject(curve[13]); + cl.filledArea = curve[14].toDouble(); + cl.aCol = readColorFromProject(curve[15]); + cl.aStyle=curve[16].toInt(); + int current_index = 17; + if(curve.count() < 16) + cl.penWidth = cl.lWidth; + else if ((d_file_version >= 79) && (curve[5].toInt() == Graph::Box)) + { + cl.penWidth = curve[17].toDouble(); + current_index++; + } + else if ((d_file_version >= 78) && (curve[5].toInt() <= Graph::LineSymbols)) + { + cl.penWidth = curve[17].toDouble(); + current_index++; + } + else + cl.penWidth = cl.lWidth; + + PlotCurve *c = (PlotCurve *)ag->insertFunctionCurve(curve[1], curve[2].toInt(), d_file_version); + c->setPlotStyle(curve[5].toInt()); + ag->updateCurveLayout(c, &cl); + if (d_file_version >= 88){ + QwtPlotCurve *c = ag->curve(curveID); + if (c){ + if(current_index + 1 < curve.size()) + c->setAxis(curve[current_index].toInt(), curve[current_index+1].toInt()); + if (d_file_version >= 90 && current_index+2 < curve.size()) + c->setVisible(curve.last().toInt()); + else + c->setVisible(true); + } + + } + curveID++; + } + else if (s.contains ("ErrorBars")){ + QStringList curve = s.split("\t", QString::SkipEmptyParts); + if (!app->renamedTables.isEmpty()){ + QString caption = (curve[4]).left((curve[4]).find("_",0)); + if (app->renamedTables.contains(caption)) + {//modify the name of the curve according to the new table name + int index = app->renamedTables.findIndex (caption); + QString newCaption = app->renamedTables[++index]; + curve.replaceInStrings(caption+"_", newCaption+"_"); + } + } + Table *w = app->table(curve[3]); + Table *errTable = app->table(curve[4]); + if (w && errTable){ + ag->addErrorBars(curve[2], curve[3], errTable, curve[4], curve[1].toInt(), + curve[5].toDouble(), curve[6].toInt(), QColor(curve[7]), + curve[8].toInt(), curve[10].toInt(), curve[9].toInt()); + } + curveID++; + } + else if (s == ""){ + curveID++; + QStringList lst; + while ( s!="" ){ + s = list[++j]; + lst << s; + } + lst.pop_back(); + ag->restoreSpectrogram(app, lst); + } + else if (s.left(6) == "scale\t"){ + QStringList scl = s.split("\t"); + scl.pop_front(); + int size = scl.count(); + if (d_file_version < 88){ + double step = scl[2].toDouble(); + if (scl[5] == "0") + step = 0.0; + ag->setScale(QwtPlot::xBottom, scl[0].toDouble(), scl[1].toDouble(), step, + scl[3].toInt(), scl[4].toInt(), scl[6].toInt(), bool(scl[7].toInt())); + ag->setScale(QwtPlot::xTop, scl[0].toDouble(), scl[1].toDouble(), step, + scl[3].toInt(), scl[4].toInt(), scl[6].toInt(), bool(scl[7].toInt())); + + step = scl[10].toDouble(); + if (scl[13] == "0") + step = 0.0; + ag->setScale(QwtPlot::yLeft, scl[8].toDouble(), scl[9].toDouble(), step, scl[11].toInt(), + scl[12].toInt(), scl[14].toInt(), bool(scl[15].toInt())); + ag->setScale(QwtPlot::yRight, scl[8].toDouble(), scl[9].toDouble(), step, scl[11].toInt(), + scl[12].toInt(), scl[14].toInt(), bool(scl[15].toInt())); + } else if (size == 8){ + ag->setScale(scl[0].toInt(), scl[1].toDouble(), scl[2].toDouble(), scl[3].toDouble(), + scl[4].toInt(), scl[5].toInt(), scl[6].toInt(), bool(scl[7].toInt())); + } else if (size == 18){ + ag->setScale(scl[0].toInt(), scl[1].toDouble(), scl[2].toDouble(), scl[3].toDouble(), + scl[4].toInt(), scl[5].toInt(), scl[6].toInt(), bool(scl[7].toInt()), scl[8].toDouble(), + scl[9].toDouble(), scl[10].toInt(), scl[11].toDouble(), scl[12].toDouble(), scl[13].toInt(), + scl[14].toInt(), bool(scl[15].toInt()), scl[16].toInt(), bool(scl[17].toInt())); + } + } + else if (s.contains ("PlotTitle")){ + QStringList fList=s.split("\t"); + ag->setTitle(fList[1]); + ag->setTitleColor(QColor(fList[2])); + ag->setTitleAlignment(fList[3].toInt()); + } + else if (s.contains ("TitleFont")){ + QStringList fList=s.split("\t"); + QFont fnt=QFont (fList[1],fList[2].toInt(),fList[3].toInt(),fList[4].toInt()); + fnt.setUnderline(fList[5].toInt()); + fnt.setStrikeOut(fList[6].toInt()); + ag->setTitleFont(fnt); + } + else if (s.contains ("AxesTitles")){ + QStringList lst=s.split("\t"); + lst.pop_front(); + for (int i=0; i<4; i++){ + if (lst.count() > i) + ag->setScaleTitle(i, lst[i]); + } + } + else if (s.contains ("AxesTitleColors")){ + QStringList colors = s.split("\t", QString::SkipEmptyParts); + colors.pop_front(); + for (int i=0; isetAxisTitleColor(i, colors[i]); + }else if (s.contains ("AxesTitleAlignment")){ + QStringList align=s.split("\t", QString::SkipEmptyParts); + align.pop_front(); + for (int i=0; i<(int)align.count(); i++) + ag->setAxisTitleAlignment(i, align[i].toInt()); + } else if (s.contains ("AxesTitleDistance")){ + QStringList align = s.split("\t", QString::SkipEmptyParts); + align.pop_front(); + for (int i=0; i<(int)align.count(); i++) + ag->setAxisTitleDistance(i, align[i].toInt()); + } else if (s.contains ("")){ + QwtScaleWidget *scale = ag->axisWidget(QwtPlot::yRight); + if (scale) + scale->setLayoutFlag(QwtScaleWidget::TitleInverted, true); + } else if (s.contains ("ScaleFont")){ + QStringList fList=s.split("\t"); + QFont fnt=QFont (fList[1],fList[2].toInt(),fList[3].toInt(),fList[4].toInt()); + fnt.setUnderline(fList[5].toInt()); + fnt.setStrikeOut(fList[6].toInt()); + + int axis=(fList[0].right(1)).toInt(); + ag->setAxisTitleFont(axis,fnt); + }else if (s.contains ("AxisFont")){ + QStringList fList=s.split("\t"); + QFont fnt=QFont (fList[1],fList[2].toInt(),fList[3].toInt(),fList[4].toInt()); + fnt.setUnderline(fList[5].toInt()); + fnt.setStrikeOut(fList[6].toInt()); + + int axis=(fList[0].right(1)).toInt(); + ag->setAxisFont(axis,fnt); + } + else if (s.contains ("AxesFormulas")) + { + QStringList fList=s.split("\t"); + fList.remove(fList.first()); + for (int i=0; i<(int)fList.count(); i++) + ag->setAxisFormula(i, fList[i]); + } + else if (s.startsWith("setAxisFormula(axis, formula); + } + else if (s.contains ("LabelsFormat")) + { + QStringList fList=s.split("\t"); + fList.pop_front(); + ag->setLabelsNumericFormat(fList); + } + else if (s.contains ("LabelsRotation")) + { + QStringList fList=s.split("\t"); + ag->setAxisLabelRotation(QwtPlot::xBottom, fList[1].toInt()); + ag->setAxisLabelRotation(QwtPlot::xTop, fList[2].toInt()); + } + else if (s.contains ("DrawAxesBackbone")) + { + ag->loadAxesOptions(s.split("\t")); + } + else if (s.contains ("AxesLineWidth")) + { + QStringList fList=s.split("\t"); + ag->loadAxesLinewidth(fList[1].toInt()); + } + else if (s.contains ("TickLabelsSpace")) + { + QStringList lst = s.split("\t"); + lst.removeFirst(); + for (int i = 0; i < QwtPlot::axisCnt; i++){ + QwtScaleDraw *sd = ag->axisScaleDraw (i); + if (sd && lst.count() > i) + sd->setSpacing(lst[i].toInt()); + } + } + else if (s.contains ("ShowTicksPolicy")) + { + QStringList lst = s.split("\t"); + lst.removeFirst(); + for (int i = 0; i < QwtPlot::axisCnt; i++){ + ScaleDraw *sd = (ScaleDraw *)ag->axisScaleDraw (i); + if (sd && lst.count() > i) + sd->setShowTicksPolicy((ScaleDraw::ShowTicksPolicy)lst[i].toInt()); + } + } + else if (s.contains ("CanvasFrame")){ + QStringList lst = s.split("\t"); + ag->setCanvasFrame(lst[1].toInt(), QColor(lst[2])); + } + else if (s.contains ("CanvasBackground")) + { + QStringList list = s.split("\t"); + QColor c = QColor(list[1]); + if (list.count() == 3) + c.setAlpha(list[2].toInt()); + ag->setCanvasBackground(c); + } + else if (s.startsWith ("Legend")) + {// version <= 0.8.9 + QStringList fList = QStringList::split ("\t",s, true); + ag->insertLegend(fList, d_file_version); + } + else if (s.startsWith ("") && s.endsWith ("")) + { + QStringList fList = QStringList::split ("\t", s.remove(""), true); + ag->insertLegend(fList, d_file_version); + } + else if (s.contains ("textMarker")) + {// version <= 0.8.9 + QStringList fList = QStringList::split ("\t",s, true); + ag->insertText(fList, d_file_version); + } + else if (s.startsWith ("") && s.endsWith ("")) + { + QStringList fList = QStringList::split ("\t", s.remove(""), true); + ag->insertText(fList, d_file_version); + } + else if (s.startsWith ("") && s.endsWith ("")) + { + QStringList fList = QStringList::split ("\t", s.remove(""), true); + ag->insertText(fList, d_file_version); + } else if (s == ""){//version 0.9.7 + QStringList lst; + while ( s != "" ){ + s = list[++j]; + lst << s; + } + lst.pop_back(); + PieLabel::restore(ag, lst); + } + else if (s.contains ("lineMarker")) + {// version <= 0.8.9 + QStringList fList=s.split("\t"); + ag->addArrow(fList, d_file_version); + } + else if (s.startsWith ("") && s.endsWith ("")) + { + QStringList fList=s.remove("").split("\t"); + ag->addArrow(fList, d_file_version); + } + else if (s.contains ("ImageMarker") || (s.startsWith ("") && s.endsWith (""))) + { + QStringList fList=s.remove("").split("\t"); + ag->insertImageMarker(fList, d_file_version); + } else if (s == ""){//version 0.9.7 + QStringList lst; + while ( s != "" ){ + s = list[++j]; + lst << s; + } + lst.pop_back(); + TexWidget::restore(ag, lst); + } else if (s == ""){//version 0.9.7 + QStringList lst; + while ( s != "" ){ + s = list[++j]; + lst << s; + } + lst.pop_back(); + ImageWidget::restore(ag, lst); + } else if (s == ""){//version 0.9.7 + QStringList lst; + while ( s != "" ){ + s = list[++j]; + lst << s; + } + lst.pop_back(); + LegendWidget::restore(ag, lst); + } else if (s == ""){//version 0.9.7 + QStringList lst; + while ( s != "" ){ + s = list[++j]; + lst << s; + } + lst.pop_back(); + RectangleWidget::restore(ag, lst); + } else if (s == ""){//version 0.9.7.2 + QStringList lst; + while ( s != "" ){ + s = list[++j]; + lst << s; + } + lst.pop_back(); + EllipseWidget::restore(ag, lst); + } + else if (s.contains("AxisType")) + { + QStringList fList = s.split("\t"); + for (int i=0; i<4; i++){ + QStringList lst = fList[i+1].split(";", QString::SkipEmptyParts); + int format = lst[0].toInt(); + if (format == ScaleDraw::Numeric) + continue; + if (format == ScaleDraw::Day) + ag->setLabelsDayFormat(i, lst[1].toInt()); + else if (format == ScaleDraw::Month) + ag->setLabelsMonthFormat(i, lst[1].toInt()); + else if (format == ScaleDraw::Time || format == ScaleDraw::Date) + ag->setLabelsDateTimeFormat(i, format, lst[1]+";"+lst[2]); + else if (lst.size() > 1) + ag->setLabelsTextFormat(i, format, lst[1], app->table(lst[1])); + } + } + else if (d_file_version < 69 && s.contains ("AxesTickLabelsCol")) + { + QStringList fList = s.split("\t"); + for (int i=0; i<4; i++){ + QString colName = fList[i+1]; + Table *nw = app->table(colName); + ag->setLabelsTextFormat(i, ag->axisType(i), colName, nw); + } + } else if (s.startsWith ("") && s.endsWith ("")){ + QStringList lst = s.remove("").remove("").split("\t"); + if (lst.size() == 2) + ag->enableDouglasPeukerSpeedMode(lst[0].toDouble(), lst[1].toInt()); + } else if (s.startsWith ("") && s.endsWith ("")){ + QStringList lst = s.remove("").remove("").split("\t"); + if (!lst.isEmpty()){ + Table *hort = 0, *vert = 0; + if (lst.size() >= 2) + hort = app->table(lst[1]); + if (lst.size() >= 3) + vert = app->table(lst[2]); + ag->setActiveTool(new ImageProfilesTool(app, ag, app->matrix(lst[0]), hort, vert, app->info, SLOT(setText(const QString&)))); + } + } else if (s.startsWith ("") && s.endsWith ("")){ + QStringList lst = s.remove("").remove("").split("\t"); + if (lst.size() == 2 && ag->activeTool()) + ((ImageProfilesTool *)ag->activeTool())->append(QwtDoublePoint(lst[0].toDouble(), lst[1].toDouble())); + } + } + ag->updateLayout(); + + ag->blockSignals(false); + ag->setAutoscaleFonts(app->autoScaleFonts); + return ag; +} + +void ApplicationWindow::copyActiveLayer() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph *g = plot->activeLayer(); + if (!g) + return; + + lastCopiedLayer = g; + connect (g, SIGNAL(destroyed()), this, SLOT(closedLastCopiedLayer())); + g->copyImage(); +} + +void ApplicationWindow::showDataSetDialog(Analysis operation) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph *g = plot->activeLayer(); + if (!g) + return; + + bool ok; + QString curve = QInputDialog::getItem(this, tr("QtiPlot - Choose data set"), + tr("Curve") + ": ", g->analysableCurvesList(), 0, false, &ok); + if (ok && !curve.isEmpty()) + analyzeCurve(g, operation, curve); +} + +void ApplicationWindow::analyzeCurve(Graph *g, Analysis operation, const QString& curveTitle) +{ + if (!g) + return; + + Fit *fitter = 0; + switch(operation){ + case NoAnalysis: + break; + case Integrate: + { + Integration *i = new Integration(this, g, curveTitle); + i->run(); + delete i; + } + break; + case Diff: + { + Differentiation *diff = new Differentiation(this, g, curveTitle); + diff->enableGraphicsDisplay(true); + diff->run(); + delete diff; + } + break; + case FitLinear: + fitter = new LinearFit (this, g); + break; + case FitLorentz: + fitter = new LorentzFit(this, g); + break; + case FitGauss: + fitter = new GaussFit(this, g); + break; + case FitSigmoidal: + { + QwtPlotCurve* c = g->curve(curveTitle); + if (c){ + ScaleEngine *se = (ScaleEngine *)g->axisScaleEngine(c->xAxis()); + if(se->type() == ScaleTransformation::Log10) + fitter = new LogisticFit (this, g); + else + fitter = new SigmoidalFit (this, g); + } + } + break; + case FitSlope: + fitter = new LinearSlopeFit (this, g); + break; + } + + if (!fitter) + return; + + if (fitter->setDataFromCurve(curveTitle)){ + if (operation != FitLinear && operation != FitSlope){ + fitter->guessInitialValues(); + fitter->scaleErrors(fit_scale_errors); + fitter->generateFunction(generateUniformFitPoints, fitPoints); + } else if (d_2_linear_fit_points) + fitter->generateFunction(generateUniformFitPoints, 2); + fitter->setOutputPrecision(fit_output_precision); + fitter->fit(); + if (pasteFitResultsToPlot) + fitter->showLegend(); + delete fitter; + } +} + +void ApplicationWindow::analysis(Analysis operation) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + return; + + QString curve_title = g->selectedCurveTitle(); + if (!curve_title.isNull()) { + analyzeCurve(g, operation, curve_title); + return; + } + + QStringList lst = g->analysableCurvesList(); + if (lst.count() == 1){ + const QwtPlotCurve *c = g->curve(lst[0]); + if (c) + analyzeCurve(g, operation, lst[0]); + } else + showDataSetDialog(operation); +} + +void ApplicationWindow::integrate() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (w->isA("MultiLayer")) + analysis(Integrate); + else if (w->isA("Matrix")){ + QDateTime dt = QDateTime::currentDateTime (); + QString info = dt.toString(Qt::LocalDate); + info += "\n" + tr("Integration of %1 from zero is").arg(QString(w->objectName())) + ":\t"; + info += QString::number(((Matrix *)w)->integrate()) + "\n"; + info += "-------------------------------------------------------------\n"; + current_folder->appendLogInfo(info); + showResults(true); + } else if (w->inherits("Table")){ + Table *t = (Table *)w; + QStringList lst = t->selectedYColumns(); + int cols = lst.size(); + if (!cols){ + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), + tr("Please select a 'Y' column first!")); + return; + } + + Table *result = newTable(cols, 2, "", tr("Integration of %1").arg(t->objectName())); + result->setColName(0, tr("Column")); + result->setColName(1, tr("Area")); + int aux = 0; + foreach (QString yCol, lst){ + int xCol = t->colX(t->colIndex(yCol)); + Integration *i = new Integration(this, t, t->colName(xCol), yCol); + i->run(); + result->setText(aux, 0, yCol); + result->setCell(aux, 1, i->area()); + aux++; + delete i; + } + result->show(); + } +} + +void ApplicationWindow::differentiate() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (qobject_cast(w)) + analysis(Diff); + else if (w->inherits("Table")){ + Table *t = qobject_cast
(w); + QStringList lst = t->selectedYColumns(); + int cols = lst.size(); + if (!cols){ + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), + tr("Please select a 'Y' column first!")); + return; + } + + Differentiation *diff = new Differentiation(this, NULL, "", ""); + int aux = 0; + foreach (QString yCol, lst){ + int xCol = t->colX(t->colIndex(yCol)); + diff->setDataFromTable(t, t->colName(xCol), yCol); + diff->run(); + Graph *g = diff->outputGraph(); + if (!g) + continue; + + QwtPlotCurve *c = g->curve(aux); + if (c){ + QPen pen = c->pen(); + pen.setColor(d_indexed_colors[aux]); + c->setPen(pen); + aux++; + } + } + delete diff; + } +} + +void ApplicationWindow::fitLinear() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (qobject_cast(w)) + analysis(FitLinear); + else if (w->inherits("Table")){ + Table *t = (Table *)w; + QStringList lst = t->selectedYColumns(); + int cols = lst.size(); + if (!cols){ + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), tr("Please select a 'Y' column first!")); + return; + } + + MultiLayer* g = multilayerPlot(t, t->drawableColumnSelection(), Graph::LineSymbols); + if (!g) + return; + + QString legend = tr("Linear Regression of %1").arg(t->objectName()); + g->setWindowLabel(legend); + + Table *result = newTable(cols, 5, "", legend); + result->setColName(0, tr("Column")); + result->setColName(1, tr("Slope")); + result->setColName(2, tr("Intercept")); + result->setColName(3, tr("Chi^2")); + result->setColName(4, tr("R^2")); + + LinearFit *lf = new LinearFit (this, g->activeLayer()); + if (d_2_linear_fit_points) + lf->generateFunction(generateUniformFitPoints, 2); + lf->setOutputPrecision(fit_output_precision); + + int aux = 0; + foreach (QString yCol, lst){ + if (!lf->setDataFromCurve(yCol)) + continue; + + lf->setColor(aux); + lf->fit(); + double *res = lf->results(); + result->setText(aux, 0, yCol); + result->setCell(aux, 1, res[1]); + result->setCell(aux, 2, res[0]); + result->setCell(aux, 3, lf->chiSquare()); + result->setCell(aux, 4, lf->rSquare()); + aux++; + } + for (int i = 0; i < result->numCols(); i++) + result->table()->adjustColumn(i); + result->show(); + delete lf; + } +} + +void ApplicationWindow::fitSlope() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + + if (qobject_cast(w)) + analysis(FitSlope); + else if (w->inherits("Table")){ + Table *t = (Table *)w; + QStringList lst = t->selectedYColumns(); + int cols = lst.size(); + if (!cols){ + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), tr("Please select a 'Y' column first!")); + return; + } + + MultiLayer* g = multilayerPlot(t, t->drawableColumnSelection(), Graph::LineSymbols); + if (!g) + return; + + QString legend = tr("Linear Regression of %1").arg(t->objectName()); + g->setWindowLabel(legend); + + Table *result = newTable(cols, 4, "", legend); + result->setColName(0, tr("Column")); + result->setColName(1, tr("Slope")); + result->setColName(2, tr("Chi^2")); + result->setColName(3, tr("R^2")); + + LinearSlopeFit *lf = new LinearSlopeFit (this, g->activeLayer()); + if (d_2_linear_fit_points) + lf->generateFunction(generateUniformFitPoints, 2); + lf->setOutputPrecision(fit_output_precision); + + int aux = 0; + foreach (QString yCol, lst){ + if (!lf->setDataFromCurve(yCol)) + continue; + + lf->setColor(aux); + lf->fit(); + double *res = lf->results(); + result->setText(aux, 0, yCol); + result->setCell(aux, 1, res[0]); + result->setCell(aux, 2, lf->chiSquare()); + result->setCell(aux, 3, lf->rSquare()); + aux++; + } + for (int i = 0; i < result->numCols(); i++) + result->table()->adjustColumn(i); + result->show(); + delete lf; + } +} + +void ApplicationWindow::fitSigmoidal() +{ + analysis(FitSigmoidal); +} + +void ApplicationWindow::fitGauss() +{ + analysis(FitGauss); +} + +void ApplicationWindow::fitLorentz() + +{ + analysis(FitLorentz); +} + +void ApplicationWindow::pickPointerCursor() +{ + btnPointer->setChecked(true); +} + +void ApplicationWindow::disableTools() +{ + if (displayBar && displayBar->isVisible()) + displayBar->hide(); + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")){ + QList layers = ((MultiLayer*)w)->layersList(); + foreach(Graph *g, layers) + g->disableTools(); + } + } +} + +void ApplicationWindow::pickDataTool( QAction* action ) +{ + if (!action) + return; + + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + QList layers = plot->layersList(); + foreach(Graph *g, layers) + g->disableTools(); + + if (action == btnCursor) + showCursor(); + else if (action == btnSelect) + showRangeSelectors(); + else if (action == btnPicker) + showScreenReader(); + else if (action == btnMovePoints) + movePoints(); + else if (action == actionDragCurve) + movePoints(true); + else if (action == btnRemovePoints) + removePoints(); + else if (action == actionDrawPoints) + drawPoints(); + else if (action == btnZoomIn) + zoomIn(); + else if (action == btnZoomOut) + zoomOut(); + else if (action == btnArrow) + drawArrow(); + else if (action == btnLine) + drawLine(); + else if (action == actionMagnify) + magnify(); + else if (action == actionMagnifyHor) + magnify(2); + else if (action == actionMagnifyVert) + magnify(1); +} + +void ApplicationWindow::custom2DPlotTools(MultiLayer *plot) +{ + if (!plot) + return; + + actionAddText->setChecked(false); + actionAddFormula->setChecked(false); + actionAddRectangle->setChecked(false); + actionAddEllipse->setChecked(false); + + QList layers = plot->layersList(); + foreach(Graph *g, layers){ + PlotToolInterface *active_tool = g->activeTool(); + if (active_tool){ + if (active_tool->rtti() == PlotToolInterface::Rtti_PlotTool){ + btnPicker->setChecked(true); + return; + } else if (active_tool->rtti() == PlotToolInterface::Rtti_DataPicker){ + switch(((DataPickerTool *)active_tool)->mode()){ + case DataPickerTool::Display: + btnCursor->setChecked(true); + break; + case DataPickerTool::Move: + btnMovePoints->setChecked(true); + break; + case DataPickerTool::Remove: + btnRemovePoints->setChecked(true); + break; + case DataPickerTool::MoveCurve: + actionDragCurve->setChecked(true); + break; + } + return; + } else if (active_tool->rtti() == PlotToolInterface::Rtti_DrawDataPoints){ + actionDrawPoints->setChecked(true); + return; + } else if (active_tool->rtti() == PlotToolInterface::Rtti_AddWidgetTool){ + switch(((AddWidgetTool *)active_tool)->widgetType()){ + case AddWidgetTool::Text: + actionAddText->setChecked(true); + break; + case AddWidgetTool::TexEquation: + actionAddFormula->setChecked(true); + break; + case AddWidgetTool::Rectangle: + actionAddRectangle->setChecked(true); + break; + case AddWidgetTool::Ellipse: + actionAddEllipse->setChecked(true); + break; + default: + break; + } + return; + } + } else if (g->hasPanningMagnifierEnabled()){ + QwtPlotMagnifier *magnifier = g->magnifyTool(); + if (!magnifier->isAxisEnabled(QwtPlot::xBottom) && !magnifier->isAxisEnabled(QwtPlot::xTop)) + actionMagnifyVert->setChecked(true); + else if (!magnifier->isAxisEnabled(QwtPlot::yLeft) && !magnifier->isAxisEnabled(QwtPlot::yRight)) + actionMagnifyHor->setChecked(true); + else + actionMagnify->setChecked(true); + return; + } else if (g->drawArrow()){ + btnArrow->setChecked(true); + return; + } else if (g->drawLineActive()){ + btnLine->setChecked(true); + return; + } else if (g->rangeSelectorsEnabled()){ + btnSelect->setChecked(true); + return; + } else if (g->zoomOn()){ + btnZoomIn->setChecked(true); + return; + } + } + btnPointer->setChecked(true); +} + +void ApplicationWindow::connectSurfacePlot(Graph3D *plot) +{ + connect (plot, SIGNAL(showContextMenu()), this,SLOT(showWindowContextMenu())); + connect (plot, SIGNAL(showOptionsDialog()), this,SLOT(showPlot3dDialog())); + connect (plot, SIGNAL(closedWindow(MdiSubWindow*)), this, SLOT(closeWindow(MdiSubWindow*))); + connect (plot, SIGNAL(hiddenWindow(MdiSubWindow*)), this, SLOT(hideWindow(MdiSubWindow*))); + connect (plot, SIGNAL(statusChanged(MdiSubWindow*)), this, SLOT(updateWindowStatus(MdiSubWindow*))); + connect (plot, SIGNAL(modified()), this, SIGNAL(modified())); + + plot->askOnCloseEvent(confirmClosePlot3D); +} + +void ApplicationWindow::connectMultilayerPlot(MultiLayer *g) +{ + connect (g,SIGNAL(showEnrichementDialog()),this,SLOT(showEnrichementDialog())); + connect (g,SIGNAL(showPlotDialog(int)),this,SLOT(showPlotDialog(int))); + connect (g,SIGNAL(showScaleDialog(int)), this, SLOT(showScalePageFromAxisDialog(int))); + connect (g,SIGNAL(showAxisDialog(int)), this, SLOT(showAxisPageFromAxisDialog(int))); + connect (g,SIGNAL(showCurveContextMenu(QwtPlotItem *)), this, SLOT(showCurveContextMenu(QwtPlotItem *))); + connect (g,SIGNAL(showContextMenu()),this,SLOT(showWindowContextMenu())); + connect (g,SIGNAL(showCurvesDialog()),this,SLOT(showCurvesDialog())); + connect (g,SIGNAL(drawLineEnded(bool)), btnPointer, SLOT(setOn(bool))); + connect (g, SIGNAL(showAxisTitleDialog()), this, SLOT(showAxisTitleDialog())); + + connect (g,SIGNAL(showMarkerPopupMenu()),this,SLOT(showMarkerPopupMenu())); + connect (g,SIGNAL(closedWindow(MdiSubWindow*)),this, SLOT(closeWindow(MdiSubWindow*))); + connect (g,SIGNAL(hiddenWindow(MdiSubWindow*)),this, SLOT(hideWindow(MdiSubWindow*))); + connect (g,SIGNAL(statusChanged(MdiSubWindow*)),this, SLOT(updateWindowStatus(MdiSubWindow*))); + connect (g,SIGNAL(cursorInfo(const QString&)),info,SLOT(setText(const QString&))); + connect (g,SIGNAL(viewTitleDialog()),this,SLOT(showTitleDialog())); + connect (g,SIGNAL(modifiedWindow(MdiSubWindow*)),this,SLOT(modifiedProject(MdiSubWindow*))); + connect (g,SIGNAL(modifiedPlot()), this, SLOT(modifiedProject())); + connect (g,SIGNAL(showLineDialog()),this, SLOT(showLineDialog())); + connect (g,SIGNAL(pasteMarker()),this,SLOT(pasteSelection())); + connect (g,SIGNAL(showGraphContextMenu()),this,SLOT(showGraphContextMenu())); + connect (g,SIGNAL(setPointerCursor()),this, SLOT(pickPointerCursor())); + connect (g,SIGNAL(currentFontChanged(const QFont&)), this, SLOT(setFormatBarFont(const QFont&))); + connect (g,SIGNAL(enableTextEditor(Graph *)), this, SLOT(enableTextEditor(Graph *))); + + g->askOnCloseEvent(confirmClosePlot2D); +} + +void ApplicationWindow::connectTable(Table* w) +{ + connect (w->table(), SIGNAL(selectionChanged()), this, SLOT(customColumnActions())); + connect (w,SIGNAL(statusChanged(MdiSubWindow*)),this, SLOT(updateWindowStatus(MdiSubWindow*))); + connect (w,SIGNAL(hiddenWindow(MdiSubWindow*)),this, SLOT(hideWindow(MdiSubWindow*))); + connect (w,SIGNAL(closedWindow(MdiSubWindow*)),this, SLOT(closeWindow(MdiSubWindow*))); + connect (w,SIGNAL(removedCol(const QString&)),this,SLOT(removeCurves(const QString&))); + connect (w,SIGNAL(modifiedData(Table *, const QString&)), + this, SLOT(updateCurves(Table *, const QString&))); + connect (w,SIGNAL(resizedWindow(MdiSubWindow*)),this,SLOT(modifiedProject(MdiSubWindow*))); + connect (w,SIGNAL(modifiedWindow(MdiSubWindow*)),this,SLOT(modifiedProject(MdiSubWindow*))); + connect (w,SIGNAL(optionsDialog()),this,SLOT(showColumnOptionsDialog())); + connect (w,SIGNAL(colValuesDialog()),this,SLOT(showColumnValuesDialog())); + connect (w,SIGNAL(showContextMenu(bool)),this,SLOT(showTableContextMenu(bool))); + connect (w,SIGNAL(changedColHeader(const QString&,const QString&)),this,SLOT(updateColNames(const QString&,const QString&))); + + w->askOnCloseEvent(confirmCloseTable); +} + +void ApplicationWindow::setAppColors(const QColor& wc, const QColor& pc, const QColor& tpc, bool force) +{ + if (force || workspaceColor != wc){ + workspaceColor = wc; + d_workspace->setBackground(wc); + } + + if (!force && panelsColor == pc && panelsTextColor == tpc) + return; + + panelsColor = pc; + panelsTextColor = tpc; + + QPalette palette; + palette.setColor(QPalette::Base, QColor(panelsColor)); + qApp->setPalette(palette); + + palette.setColor(QPalette::Text, QColor(panelsTextColor)); + palette.setColor(QPalette::WindowText, QColor(panelsTextColor)); + + lv->setPalette(palette); + results->setPalette(palette); + folders->setPalette(palette); +} + +void ApplicationWindow::setPlot3DOptions() +{ + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("Graph3D")){ + Graph3D *g = (Graph3D*)w; + g->setOrthogonal(d_3D_orthogonal); + g->setAutoscale(d_3D_autoscale); + g->setAntialiasing(d_3D_smooth_mesh); + } + } +} + +void ApplicationWindow::createActions() +{ + actionCustomActionDialog = new QAction(tr("Add &Custom Script Action..."), this); + connect(actionCustomActionDialog, SIGNAL(activated()), this, SLOT(showCustomActionDialog())); + + actionNewProject = new QAction(QIcon(":/new.png"), tr("New &Project"), this); + actionNewProject->setShortcut( tr("Ctrl+N") ); + connect(actionNewProject, SIGNAL(activated()), this, SLOT(newProject())); + + actionAppendProject = new QAction(QIcon(":/append_file.png"), tr("App&end Project..."), this); + connect(actionAppendProject, SIGNAL(activated()), this, SLOT(appendProject())); + + actionNewFolder = new QAction(QIcon(":/newfolder.png"), tr("New F&older"), this); + actionNewProject->setShortcut(Qt::Key_F7); + connect(actionNewFolder, SIGNAL(activated()), this, SLOT(addFolder())); + + actionNewGraph = new QAction(QIcon(":/new_graph.png"), tr("New &Graph"), this); + actionNewGraph->setShortcut( tr("Ctrl+G") ); + connect(actionNewGraph, SIGNAL(activated()), this, SLOT(newGraph())); + + actionNewNote = new QAction(QIcon(":/new_note.png"), tr("New &Note"), this); + connect(actionNewNote, SIGNAL(activated()), this, SLOT(newNote())); + + actionNewTable = new QAction(QIcon(":/table.png"), tr("New &Table"), this); + actionNewTable->setShortcut( tr("Ctrl+T") ); + connect(actionNewTable, SIGNAL(activated()), this, SLOT(newTable())); + + actionNewMatrix = new QAction(QIcon(":/new_matrix.png"), tr("New &Matrix"), this); + actionNewMatrix->setShortcut( tr("Ctrl+M") ); + connect(actionNewMatrix, SIGNAL(activated()), this, SLOT(newMatrix())); + + actionNewFunctionPlot = new QAction(QIcon(":/newF.png"), tr("New &Function Plot"), this); + actionNewFunctionPlot->setShortcut( tr("Ctrl+F") ); + connect(actionNewFunctionPlot, SIGNAL(activated()), this, SLOT(functionDialog())); + + actionNewSurfacePlot = new QAction(QIcon(":/newFxy.png"), tr("New 3D &Surface Plot"), this); + actionNewSurfacePlot->setShortcut( tr("Ctrl+ALT+Z") ); + connect(actionNewSurfacePlot, SIGNAL(activated()), this, SLOT(newSurfacePlot())); + + actionOpen = new QAction(QIcon(":/fileopen.png"), tr("&Open..."), this); + actionOpen->setShortcut( tr("Ctrl+O") ); + connect(actionOpen, SIGNAL(activated()), this, SLOT(open())); + +#ifdef XLS_IMPORT + actionOpenExcel = new QAction(QIcon(":/open_excel.png"), tr("Open Exce&l ..."), this); + actionOpenExcel->setShortcut( tr("Ctrl+Shift+E") ); + connect(actionOpenExcel, SIGNAL(activated()), this, SLOT(importExcel())); +#endif + +#ifdef ODS_IMPORT + actionOpenOds = new QAction(QIcon(":/ods_spreadsheet.png"), tr("Open ODF Spreads&heet..."), this); + actionOpenOds->setShortcut( tr("Ctrl+Alt+S") ); + connect(actionOpenOds, SIGNAL(activated()), this, SLOT(importOdfSpreadsheet())); +#endif + + actionLoadImage = new QAction(tr("Open Image &File..."), this); + actionLoadImage->setShortcut( tr("Ctrl+I") ); + connect(actionLoadImage, SIGNAL(activated()), this, SLOT(loadImage())); + + actionImportImage = new QAction(QPixmap(":/monalisa.png"), tr("Import I&mage..."), this); + connect(actionImportImage, SIGNAL(activated()), this, SLOT(importImage())); + + actionSaveProject = new QAction(QIcon(":/filesave.png"), tr("&Save Project"), this); + + actionSaveProject->setShortcut( tr("Ctrl+S") ); + connect(actionSaveProject, SIGNAL(activated()), this, SLOT(saveProject())); + + actionSaveProjectAs = new QAction(QIcon(":/filesaveas.png"), tr("Save Project &As..."), this); + actionSaveProjectAs->setShortcut( tr("Ctrl+Shift+S") ); + connect(actionSaveProjectAs, SIGNAL(activated()), this, SLOT(saveProjectAs())); + + actionOpenTemplate = new QAction(QIcon(":/open_template.png"),tr("Open Temp&late..."), this); + connect(actionOpenTemplate, SIGNAL(activated()), this, SLOT(openTemplate())); + + actionSaveTemplate = new QAction(QIcon(":/save_template.png"), tr("Save As &Template..."), this); + connect(actionSaveTemplate, SIGNAL(activated()), this, SLOT(saveAsTemplate())); + + actionSaveNote = new QAction(QIcon(":/filesaveas.png"), tr("Save Note As..."), this); + connect(actionSaveNote, SIGNAL(activated()), this, SLOT(saveNoteAs())); + + actionLoad = new QAction(QIcon(":/import.png"), tr("&Import ASCII..."), this); + connect(actionLoad, SIGNAL(activated()), this, SLOT(importASCII())); + + actionImportSound = new QAction(tr("&Sound (WAV)..."), this); + connect(actionImportSound, SIGNAL(activated()), this, SLOT(importWaveFile())); + + actionUndo = new QAction(QIcon(":/undo.png"), tr("&Undo"), this); + actionUndo->setShortcut( tr("Ctrl+Z") ); + connect(actionUndo, SIGNAL(activated()), this, SLOT(undo())); + + actionRedo = new QAction(QIcon(":/redo.png"), tr("&Redo"), this); + actionRedo->setShortcut(QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_Z)); + connect(actionRedo, SIGNAL(activated()), this, SLOT(redo())); + + actionCopyWindow = new QAction(QIcon(":/duplicate.png"), tr("&Duplicate"), this); + actionCopyWindow->setShortcut(tr("Ctrl+Alt+D")); + connect(actionCopyWindow, SIGNAL(activated()), this, SLOT(clone())); + + actionCutSelection = new QAction(QIcon(":/cut.png"), tr("Cu&t Selection"), this); + actionCutSelection->setShortcut( tr("Ctrl+X") ); + connect(actionCutSelection, SIGNAL(activated()), this, SLOT(cutSelection())); + + actionCopySelection = new QAction(QIcon(":/copy.png"), tr("&Copy Selection"), this); + actionCopySelection->setShortcut( tr("Ctrl+C") ); + connect(actionCopySelection, SIGNAL(activated()), this, SLOT(copySelection())); + + actionPasteSelection = new QAction(QIcon(":/paste.png"), tr("&Paste Selection"), this); + actionPasteSelection->setShortcut( tr("Ctrl+V") ); + connect(actionPasteSelection, SIGNAL(activated()), this, SLOT(pasteSelection())); + + actionClearSelection = new QAction(QIcon(":/erase.png"), tr("&Delete Selection"), this); + actionClearSelection->setShortcut( tr("Del","delete key") ); + connect(actionClearSelection, SIGNAL(activated()), this, SLOT(clearSelection())); + + actionShowExplorer = explorerWindow->toggleViewAction(); + actionShowExplorer->setIcon(QIcon(":/folder.png")); + actionShowExplorer->setShortcut( tr("Ctrl+E") ); + + actionFindWindow = new QAction(QIcon(":/find.png"), tr("&Find..."), this); + connect(actionFindWindow, SIGNAL(activated()), this, SLOT(showFindDialogue())); + + actionShowLog = logWindow->toggleViewAction(); + actionShowLog->setIcon(QIcon(":/log.png")); + + actionShowUndoStack = undoStackWindow->toggleViewAction(); + +#ifdef SCRIPTING_CONSOLE + actionShowConsole = consoleWindow->toggleViewAction(); +#endif + + actionAddLayer = new QAction(QIcon(":/newLayer.png"), tr("Add La&yer"), this); + actionAddLayer->setShortcut( tr("ALT+L") ); + connect(actionAddLayer, SIGNAL(activated()), this, SLOT(addLayer())); + + actionShowLayerDialog = new QAction(QIcon(":/arrangeLayers.png"), tr("Arran&ge Layers"), this); + actionShowLayerDialog->setShortcut( tr("Shift+A") ); + connect(actionShowLayerDialog, SIGNAL(activated()), this, SLOT(showLayerDialog())); + + actionAutomaticLayout = new QAction(QIcon(":/auto_layout.png"), tr("Automatic Layout"), this); + connect(actionAutomaticLayout, SIGNAL(activated()), this, SLOT(autoArrangeLayers())); + + actionExportGraph = new QAction(tr("&Current"), this); + actionExportGraph->setShortcut( tr("Ctrl+Alt+G") ); + connect(actionExportGraph, SIGNAL(activated()), this, SLOT(exportGraph())); + + actionExportAllGraphs = new QAction(tr("&All"), this); + actionExportAllGraphs->setShortcut( tr("Alt+X") ); + connect(actionExportAllGraphs, SIGNAL(activated()), this, SLOT(exportAllGraphs())); + + actionPresentationODF = new QAction(tr("Create Open &Document Presentation..."), this); + connect(actionPresentationODF, SIGNAL(activated()), this, SLOT(exportPresentationODF())); + + actionExportPDF = new QAction(QIcon(":/pdf.png"), tr("&Export PDF"), this); + actionExportPDF->setShortcut( tr("Ctrl+Alt+P") ); + connect(actionExportPDF, SIGNAL(activated()), this, SLOT(exportPDF())); + + actionPrint = new QAction(QIcon(":/fileprint.png"), tr("&Print..."), this); + actionPrint->setShortcut( tr("Ctrl+P") ); + connect(actionPrint, SIGNAL(activated()), this, SLOT(print())); + + actionPrintPreview = new QAction(QPixmap(":/preview.png"), tr("Print Pre&view..."), this); + connect(actionPrintPreview, SIGNAL(activated()), this, SLOT(printPreview())); + + actionPrintAllPlots = new QAction(tr("Print All Plo&ts"), this); + connect(actionPrintAllPlots, SIGNAL(activated()), this, SLOT(printAllPlots())); + + actionShowExportASCIIDialog = new QAction(tr("E&xport ASCII..."), this); + connect(actionShowExportASCIIDialog, SIGNAL(activated()), this, SLOT(showExportASCIIDialog())); + + actionCloseAllWindows = new QAction(QIcon(":/quit.png"), tr("&Quit"), this); + actionCloseAllWindows->setShortcut( tr("Ctrl+Q") ); + connect(actionCloseAllWindows, SIGNAL(activated()), qApp, SLOT(closeAllWindows())); + + actionCloseProject = new QAction(QIcon(":/delete.png"), tr("&Close"), this); +#ifdef BROWSER_PLUGIN + connect(actionCloseProject, SIGNAL(activated()), this, SLOT(closeProject())); +#else + connect(actionCloseProject, SIGNAL(activated()), this, SLOT(newProject())); +#endif + + actionClearLogInfo = new QAction(tr("Clear &Log Information"), this); + connect(actionClearLogInfo, SIGNAL(activated()), this, SLOT(clearLogInfo())); + + actionDeleteFitTables = new QAction(QIcon(":/close.png"), tr("Delete &Fit Tables"), this); + connect(actionDeleteFitTables, SIGNAL(activated()), this, SLOT(deleteFitTables())); + + actionShowPlotWizard = new QAction(QIcon(":/wizard.png"), tr("Plot &Wizard"), this); + actionShowPlotWizard->setShortcut( tr("Ctrl+Alt+W") ); + connect(actionShowPlotWizard, SIGNAL(activated()), this, SLOT(showPlotWizard())); + + actionShowConfigureDialog = new QAction(QIcon(":/configure.png"), tr("&Preferences..."), this); + connect(actionShowConfigureDialog, SIGNAL(activated()), this, SLOT(showPreferencesDialog())); + + actionShowCurvesDialog = new QAction(QIcon(":/curves.png"), tr("Add/Remove &Curve..."), this); + actionShowCurvesDialog->setShortcut( tr("ALT+C") ); + connect(actionShowCurvesDialog, SIGNAL(activated()), this, SLOT(showCurvesDialog())); + + actionAddErrorBars = new QAction(QIcon(":/errors.png"), tr("Add &Error Bars..."), this); + actionAddErrorBars->setShortcut( tr("Ctrl+B") ); + connect(actionAddErrorBars, SIGNAL(activated()), this, SLOT(addErrorBars())); + + actionAddFunctionCurve = new QAction(QIcon(":/fx.png"), tr("Add &Function..."), this); + actionAddFunctionCurve->setShortcut( tr("Ctrl+Alt+F") ); + connect(actionAddFunctionCurve, SIGNAL(activated()), this, SLOT(addFunctionCurve())); + + actionUnzoom = new QAction(QIcon(":/unzoom.png"), tr("&Rescale to Show All"), this); + actionUnzoom->setShortcut( tr("Ctrl+Shift+R") ); + connect(actionUnzoom, SIGNAL(activated()), this, SLOT(setAutoScale())); + + actionMagnify = new QAction(QIcon(":/magnifier.png"), tr("Zoom &In/Out and Drag Canvas"), this); + connect(actionMagnify, SIGNAL(activated()), this, SLOT(magnify())); + + actionMagnifyHor = new QAction(QIcon(":/magnifier_hor.png"), tr("Zoom/Drag Canvas &Horizontally"), this); + actionMagnifyVert = new QAction(QIcon(":/magnifier_vert.png"), tr("Zoom/Drag Canvas &Vertically"), this); + + actionNewLegend = new QAction(QIcon(":/legend.png"), tr("New &Legend"), this); + actionNewLegend->setShortcut( tr("Ctrl+L") ); + connect(actionNewLegend, SIGNAL(activated()), this, SLOT(newLegend())); + + actionTimeStamp = new QAction(QIcon(":/clock.png"), tr("Add Time Stamp"), this); + actionTimeStamp->setShortcut( tr("Ctrl+ALT+T") ); + connect(actionTimeStamp, SIGNAL(activated()), this, SLOT(addTimeStamp())); + + actionAddImage = new QAction(QIcon(":/monalisa.png"), tr("Add &Image"), this); + actionAddImage->setShortcut( tr("ALT+I") ); + connect(actionAddImage, SIGNAL(activated()), this, SLOT(addImage())); + + actionPlotL = new QAction(QIcon(":/lPlot.png"), tr("&Line"), this); + connect(actionPlotL, SIGNAL(activated()), this, SLOT(plotL())); + + actionPlotP = new QAction(QIcon(":/pPlot.png"), tr("&Scatter"), this); + connect(actionPlotP, SIGNAL(activated()), this, SLOT(plotP())); + + actionPlotLP = new QAction(QIcon(":/lpPlot.png"), tr("Line + S&ymbol"), this); + connect(actionPlotLP, SIGNAL(activated()), this, SLOT(plotLP())); + + actionPlotVerticalDropLines = new QAction(QIcon(":/dropLines.png"), tr("Vertical &Drop Lines"), this); + connect(actionPlotVerticalDropLines, SIGNAL(activated()), this, SLOT(plotVerticalDropLines())); + + actionPlotSpline = new QAction(QIcon(":/spline.png"), tr("&Spline"), this); + connect(actionPlotSpline, SIGNAL(activated()), this, SLOT(plotSpline())); + + actionPlotHorSteps = new QAction(QPixmap(":/hor_steps.png"), tr("&Horizontal Steps"), this); + connect(actionPlotHorSteps, SIGNAL(activated()), this, SLOT(plotHorSteps())); + + actionPlotVertSteps = new QAction(QIcon(":/vert_steps.png"), tr("&Vertical Steps"), this); + connect(actionPlotVertSteps, SIGNAL(activated()), this, SLOT(plotVertSteps())); + + actionPlotVerticalBars = new QAction(QIcon(":/vertBars.png"), tr("&Columns"), this); + connect(actionPlotVerticalBars, SIGNAL(activated()), this, SLOT(plotVerticalBars())); + + actionPlotHorizontalBars = new QAction(QIcon(":/hBars.png"), tr("&Rows"), this); + connect(actionPlotHorizontalBars, SIGNAL(activated()), this, SLOT(plotHorizontalBars())); + + actionStackBars = new QAction(QIcon(":/stack_bar.png"), tr("Stack &Bar"), this); + connect(actionStackBars, SIGNAL(activated()), this, SLOT(plotStackBar())); + + actionStackColumns = new QAction(QIcon(":/stack_column.png"), tr("Stack &Column"), this); + connect(actionStackColumns, SIGNAL(activated()), this, SLOT(plotStackColumn())); + + actionPlotArea = new QAction(QIcon(":/area.png"), tr("&Area"), this); + connect(actionPlotArea, SIGNAL(activated()), this, SLOT(plotArea())); + + actionPlotPie = new QAction(QIcon(":/pie.png"), tr("&Pie"), this); + connect(actionPlotPie, SIGNAL(activated()), this, SLOT(plotPie())); + + actionPlotVectXYAM = new QAction(QIcon(":/vectXYAM.png"), tr("Vectors XY&AM"), this); + connect(actionPlotVectXYAM, SIGNAL(activated()), this, SLOT(plotVectXYAM())); + + actionPlotVectXYXY = new QAction(QIcon(":/vectXYXY.png"), tr("&Vectors &XYXY"), this); + connect(actionPlotVectXYXY, SIGNAL(activated()), this, SLOT(plotVectXYXY())); + + actionPlotHistogram = new QAction(QIcon(":/histogram.png"), tr("&Histogram"), this); + connect(actionPlotHistogram, SIGNAL(activated()), this, SLOT(plotHistogram())); + + actionPlotStackedHistograms = new QAction(QIcon(":/stacked_hist.png"), tr("&Stacked Histogram"), this); + connect(actionPlotStackedHistograms, SIGNAL(activated()), this, SLOT(plotStackedHistograms())); + + actionStemPlot = new QAction(QIcon(":/leaf.png"), tr("Stem-and-&Leaf Plot"), this); + connect(actionStemPlot, SIGNAL(activated()), this, SLOT(newStemPlot())); + + actionPlot2VerticalLayers = new QAction(QIcon(":/panel_v2.png"), tr("&Vertical 2 Layers"), this); + connect(actionPlot2VerticalLayers, SIGNAL(activated()), this, SLOT(plot2VerticalLayers())); + + actionPlot2HorizontalLayers = new QAction(QIcon(":/panel_h2.png"), tr("&Horizontal 2 Layers"), this); + connect(actionPlot2HorizontalLayers, SIGNAL(activated()), this, SLOT(plot2HorizontalLayers())); + + actionPlot4Layers = new QAction(QIcon(":/panel_4.png"), tr("&4 Layers"), this); + connect(actionPlot4Layers, SIGNAL(activated()), this, SLOT(plot4Layers())); + + actionPlotStackedLayers = new QAction(QIcon(":/stacked.png"), tr("&Stacked Layers"), this); + connect(actionPlotStackedLayers, SIGNAL(activated()), this, SLOT(plotStackedLayers())); + + actionVertSharedAxisLayers = new QAction(QIcon(":/panel_v2.png"), tr("&Vertical 2 Layers"), this); + connect(actionVertSharedAxisLayers, SIGNAL(activated()), this, SLOT(plotVerticalSharedAxisLayers())); + + actionHorSharedAxisLayers = new QAction(QIcon(":/panel_h2.png"), tr("&Horizontal 2 Layers"), this); + connect(actionHorSharedAxisLayers, SIGNAL(activated()), this, SLOT(plotHorizontalSharedAxisLayers())); + + actionSharedAxesLayers = new QAction(QIcon(":/panel_4.png"), tr("&4 Layers"), this); + connect(actionSharedAxesLayers, SIGNAL(activated()), this, SLOT(plotSharedAxesLayers())); + + actionStackSharedAxisLayers = new QAction(QIcon(":/stacked.png"), tr("&Stacked Layers"), this); + connect(actionStackSharedAxisLayers, SIGNAL(activated()), this, SLOT(plotStackSharedAxisLayers())); + + actionCustomSharedAxisLayers = new QAction(QIcon(":/arrangeLayers.png"), tr("&Custom Layout..."), this); + connect(actionCustomSharedAxisLayers, SIGNAL(activated()), this, SLOT(plotCustomLayoutSharedAxes())); + + actionCustomLayout = new QAction(QIcon(":/arrangeLayers.png"), tr("&Custom Layout..."), this); + connect(actionCustomLayout, SIGNAL(activated()), this, SLOT(plotCustomLayout())); + + actionPlotDoubleYAxis = new QAction(QIcon(":/plot_double_y.png"), tr("D&ouble-Y"), this); + connect(actionPlotDoubleYAxis, SIGNAL(activated()), this, SLOT(plotDoubleYAxis())); + + actionAddZoomPlot = new QAction(QIcon(":/add_zoom_plot.png"), tr("&Zoom"), this); + connect(actionAddZoomPlot, SIGNAL(activated()), this, SLOT(zoomRectanglePlot())); + + actionWaterfallPlot = new QAction(QIcon(":/waterfall_plot.png"), tr("&Waterfall Plot"), this); + connect(actionWaterfallPlot, SIGNAL(activated()), this, SLOT(waterfallPlot())); + + actionExtractGraphs = new QAction(QIcon(":/extract_graphs.png"), tr("E&xtract to Graphs"), this); + connect(actionExtractGraphs, SIGNAL(activated()), this, SLOT(extractGraphs())); + + actionExtractLayers = new QAction(QIcon(":/extract_layers.png"), tr("Extract to &Layers"), this); + connect(actionExtractLayers, SIGNAL(activated()), this, SLOT(extractLayers())); + + actionAddInsetLayer = new QAction(QIcon(":/add_inset_layer.png"), tr("Add Inset Layer"), this); + connect(actionAddInsetLayer, SIGNAL(activated()), this, SLOT(addInsetLayer())); + + actionAddInsetCurveLayer = new QAction(QIcon(":/add_inset_curve_layer.png"), tr("Add Inset Layer"), this); + connect(actionAddInsetCurveLayer, SIGNAL(activated()), this, SLOT(addInsetCurveLayer())); + + actionPlot3DRibbon = new QAction(QIcon(":/ribbon.png"), tr("&Ribbon"), this); + connect(actionPlot3DRibbon, SIGNAL(activated()), this, SLOT(plot3DRibbon())); + + actionPlot3DBars = new QAction(QIcon(":/bars.png"), tr("&Bars"), this); + connect(actionPlot3DBars, SIGNAL(activated()), this, SLOT(plot3DBars())); + + actionPlot3DScatter = new QAction(QIcon(":/scatter.png"), tr("&Scatter"), this); + connect(actionPlot3DScatter, SIGNAL(activated()), this, SLOT(plot3DScatter())); + + actionPlot3DTrajectory = new QAction(QIcon(":/trajectory.png"), tr("&Trajectory"), this); + connect(actionPlot3DTrajectory, SIGNAL(activated()), this, SLOT(plot3DTrajectory())); + + actionShowColStatistics = new QAction(QIcon(":/col_stat.png"), tr("Statistics on &Columns"), this); + connect(actionShowColStatistics, SIGNAL(activated()), this, SLOT(showColStatistics())); + + actionShowRowStatistics = new QAction(QIcon(":/stat_rows.png"), tr("Statistics on &Rows"), this); + connect(actionShowRowStatistics, SIGNAL(activated()), this, SLOT(showRowStatistics())); + + actionIntegrate = new QAction(tr("&Integrate"), this); + connect(actionIntegrate, SIGNAL(activated()), this, SLOT(integrate())); + + actionShowIntDialog = new QAction(tr("Integr&ate Function..."), this); + connect(actionShowIntDialog, SIGNAL(activated()), this, SLOT(showIntegrationDialog())); + + actionInterpolate = new QAction(tr("Inte&rpolate ..."), this); + connect(actionInterpolate, SIGNAL(activated()), this, SLOT(showInterpolationDialog())); + + actionLowPassFilter = new QAction(tr("&Low Pass..."), this); + connect(actionLowPassFilter, SIGNAL(activated()), this, SLOT(lowPassFilterDialog())); + + actionHighPassFilter = new QAction(tr("&High Pass..."), this); + connect(actionHighPassFilter, SIGNAL(activated()), this, SLOT(highPassFilterDialog())); + + actionBandPassFilter = new QAction(tr("&Band Pass..."), this); + connect(actionBandPassFilter, SIGNAL(activated()), this, SLOT(bandPassFilterDialog())); + + actionBandBlockFilter = new QAction(tr("&Band Block..."), this); + connect(actionBandBlockFilter, SIGNAL(activated()), this, SLOT(bandBlockFilterDialog())); + + actionFFT = new QAction(tr("&FFT..."), this); + connect(actionFFT, SIGNAL(activated()), this, SLOT(showFFTDialog())); + + actionSmoothSavGol = new QAction(tr("&Savitzky-Golay..."), this); + connect(actionSmoothSavGol, SIGNAL(activated()), this, SLOT(showSmoothSavGolDialog())); + + actionSmoothFFT = new QAction(tr("&FFT Filter..."), this); + connect(actionSmoothFFT, SIGNAL(activated()), this, SLOT(showSmoothFFTDialog())); + + actionSmoothAverage = new QAction(tr("Moving Window &Average..."), this); + connect(actionSmoothAverage, SIGNAL(activated()), this, SLOT(showSmoothAverageDialog())); + + actionSmoothLowess = new QAction(tr("&Lowess..."), this); + connect(actionSmoothLowess, SIGNAL(activated()), this, SLOT(showSmoothLowessDialog())); + + actionDifferentiate = new QAction(tr("&Differentiate"), this); + connect(actionDifferentiate, SIGNAL(activated()), this, SLOT(differentiate())); + + actionFitSlope = new QAction(tr("Fit Slop&e"), this); + connect(actionFitSlope, SIGNAL(activated()), this, SLOT(fitSlope())); + + actionFitLinear = new QAction(tr("Fit &Linear"), this); + connect(actionFitLinear, SIGNAL(activated()), this, SLOT(fitLinear())); + + actionShowFitPolynomDialog = new QAction(tr("Fit &Polynomial ..."), this); + connect(actionShowFitPolynomDialog, SIGNAL(activated()), this, SLOT(showFitPolynomDialog())); + + actionShowExpDecayDialog = new QAction(tr("&First Order ..."), this); + connect(actionShowExpDecayDialog, SIGNAL(activated()), this, SLOT(showExpDecayDialog())); + + actionShowTwoExpDecayDialog = new QAction(tr("&Second Order ..."), this); + connect(actionShowTwoExpDecayDialog, SIGNAL(activated()), this, SLOT(showTwoExpDecayDialog())); + + actionShowExpDecay3Dialog = new QAction(tr("&Third Order ..."), this); + connect(actionShowExpDecay3Dialog, SIGNAL(activated()), this, SLOT(showExpDecay3Dialog())); + + actionFitExpGrowth = new QAction(tr("Fit Exponential Gro&wth ..."), this); + connect(actionFitExpGrowth, SIGNAL(activated()), this, SLOT(showExpGrowthDialog())); + + actionFitSigmoidal = new QAction(tr("Fit &Boltzmann (Sigmoidal)"), this); + connect(actionFitSigmoidal, SIGNAL(activated()), this, SLOT(fitSigmoidal())); + + actionFitGauss = new QAction(tr("Fit &Gaussian"), this); + connect(actionFitGauss, SIGNAL(activated()), this, SLOT(fitGauss())); + + actionFitLorentz = new QAction(tr("Fit Lorent&zian"), this); + connect(actionFitLorentz, SIGNAL(activated()), this, SLOT(fitLorentz())); + + actionShowFitDialog = new QAction(tr("Fit &Wizard..."), this); + actionShowFitDialog->setShortcut( tr("Ctrl+Y") ); + connect(actionShowFitDialog, SIGNAL(activated()), this, SLOT(showFitDialog())); + + actionShowPlotDialog = new QAction(tr("&Plot ..."), this); + connect(actionShowPlotDialog, SIGNAL(activated()), this, SLOT(showGeneralPlotDialog())); + + actionShowScaleDialog = new QAction(tr("&Scales..."), this); + connect(actionShowScaleDialog, SIGNAL(activated()), this, SLOT(showScaleDialog())); + + actionShowAxisDialog = new QAction(tr("&Axes..."), this); + connect(actionShowAxisDialog, SIGNAL(activated()), this, SLOT(showAxisDialog())); + + actionShowGridDialog = new QAction(tr("&Grid ..."), this); + connect(actionShowGridDialog, SIGNAL(activated()), this, SLOT(showGridDialog())); + + actionShowTitleDialog = new QAction(tr("&Title ..."), this); + connect(actionShowTitleDialog, SIGNAL(activated()), this, SLOT(showTitleDialog())); + + actionShowColumnOptionsDialog = new QAction(tr("Column &Options ..."), this); + actionShowColumnOptionsDialog->setShortcut(tr("Ctrl+Alt+O")); + connect(actionShowColumnOptionsDialog, SIGNAL(activated()), this, SLOT(showColumnOptionsDialog())); + + actionShowColumnValuesDialog = new QAction(QIcon(":/formula.png"), tr("Set Column &Values ..."), this); + connect(actionShowColumnValuesDialog, SIGNAL(activated()), this, SLOT(showColumnValuesDialog())); + actionShowColumnValuesDialog->setShortcut(tr("Alt+Q")); + + actionExtractTableData = new QAction(tr("&Extract Data..."), this); + connect(actionExtractTableData, SIGNAL(activated()), this, SLOT(showExtractDataDialog())); + + actionTableRecalculate = new QAction(tr("Recalculate"), this); + actionTableRecalculate->setShortcut(tr("Ctrl+Return")); + connect(actionTableRecalculate, SIGNAL(activated()), this, SLOT(recalculateTable())); + + actionHideSelectedColumns = new QAction(tr("&Hide Selected"), this); + connect(actionHideSelectedColumns, SIGNAL(activated()), this, SLOT(hideSelectedColumns())); + + actionShowAllColumns = new QAction(tr("Sho&w All Columns"), this); + connect(actionShowAllColumns, SIGNAL(activated()), this, SLOT(showAllColumns())); + + actionSwapColumns = new QAction(QIcon(":/swap_columns.png"), tr("&Swap columns"), this); + connect(actionSwapColumns, SIGNAL(activated()), this, SLOT(swapColumns())); + + actionMoveColRight = new QAction(QIcon(":/move_col_right.png"), tr("Move &Right"), this); + connect(actionMoveColRight, SIGNAL(activated()), this, SLOT(moveColumnRight())); + + actionMoveColLeft = new QAction(QIcon(":/move_col_left.png"), tr("Move &Left"), this); + connect(actionMoveColLeft, SIGNAL(activated()), this, SLOT(moveColumnLeft())); + + actionMoveColFirst = new QAction(QIcon(":/move_col_first.png"), tr("Move to F&irst"), this); + connect(actionMoveColFirst, SIGNAL(activated()), this, SLOT(moveColumnFirst())); + + actionMoveColLast = new QAction(QIcon(":/move_col_last.png"), tr("Move to Las&t"), this); + connect(actionMoveColLast, SIGNAL(activated()), this, SLOT(moveColumnLast())); + + actionAdjustColumnWidth = new QAction(QIcon(":/adjust_col_width.png"), tr("Ad&just Column Width"), this); + connect(actionAdjustColumnWidth, SIGNAL(activated()), this, SLOT(adjustColumnWidth())); + + actionShowColsDialog = new QAction(tr("&Columns..."), this); + connect(actionShowColsDialog, SIGNAL(activated()), this, SLOT(showColsDialog())); + + actionShowRowsDialog = new QAction(tr("&Rows..."), this); + connect(actionShowRowsDialog, SIGNAL(activated()), this, SLOT(showRowsDialog())); + + actionDeleteRows = new QAction(tr("&Delete Rows Interval..."), this); + connect(actionDeleteRows, SIGNAL(activated()), this, SLOT(showDeleteRowsDialog())); + + actionMoveRowUp = new QAction(QIcon(":/move_row_up.png"), tr("&Upward"), this); + connect(actionMoveRowUp, SIGNAL(activated()), this, SLOT(moveTableRowUp())); + + actionMoveRowDown = new QAction(QIcon(":/move_row_down.png"), tr("&Downward"), this); + connect(actionMoveRowDown, SIGNAL(activated()), this, SLOT(moveTableRowDown())); + + actionAbout = new QAction(tr("&About QtiPlot"), this); + actionAbout->setShortcut( tr("F1") ); + connect(actionAbout, SIGNAL(activated()), this, SLOT(about())); + + actionShowHelp = new QAction(tr("&Help"), this); + actionShowHelp->setShortcut( tr("Ctrl+H") ); + connect(actionShowHelp, SIGNAL(activated()), this, SLOT(showHelp())); + + actionChooseHelpFolder = new QAction(tr("&Choose Help Folder..."), this); + connect(actionChooseHelpFolder, SIGNAL(activated()), this, SLOT(chooseHelpFolder())); + + actionRename = new QAction(tr("&Rename Window"), this); + connect(actionRename, SIGNAL(activated()), this, SLOT(rename())); + + actionCloseWindow = new QAction(QIcon(":/close.png"), tr("Close &Window"), this); + actionCloseWindow->setShortcut( tr("Ctrl+W") ); + connect(actionCloseWindow, SIGNAL(activated()), this, SLOT(closeActiveWindow())); + + actionAddColToTable = new QAction(QIcon(":/addCol.png"), tr("Add Column"), this); + connect(actionAddColToTable, SIGNAL(activated()), this, SLOT(addColToTable())); + + actionGoToRow = new QAction(tr("&Go to Row..."), this); + actionGoToRow->setShortcut(tr("Ctrl+Alt+G")); + connect(actionGoToRow, SIGNAL(activated()), this, SLOT(goToRow())); + + actionGoToColumn = new QAction(tr("Go to Colum&n..."), this); + actionGoToColumn->setShortcut(tr("Ctrl+Alt+C")); + connect(actionGoToColumn, SIGNAL(activated()), this, SLOT(goToColumn())); + + actionClearTable = new QAction(QPixmap(":/erase.png"), tr("Clear"), this); + connect(actionClearTable, SIGNAL(activated()), this, SLOT(clearTable())); + + actionDeleteLayer = new QAction(QIcon(":/delete.png"), tr("&Remove Layer"), this); + actionDeleteLayer->setShortcut( tr("Alt+R") ); + connect(actionDeleteLayer, SIGNAL(activated()), this, SLOT(deleteLayer())); + + actionResizeActiveWindow = new QAction(QIcon(":/resize.png"), tr("Window &Geometry..."), this); + connect(actionResizeActiveWindow, SIGNAL(activated()), this, SLOT(resizeActiveWindow())); + + actionHideActiveWindow = new QAction(tr("&Hide Window"), this); + actionHideActiveWindow->setShortcut(tr("Ctrl+Alt+H")); + connect(actionHideActiveWindow, SIGNAL(activated()), this, SLOT(hideActiveWindow())); + + actionShowMoreWindows = new QAction(tr("More windows..."), this); + connect(actionShowMoreWindows, SIGNAL(activated()), this, SLOT(showMoreWindows())); + + actionPixelLineProfile = new QAction(QIcon(":/pixelProfile.png"), tr("&View Pixel Line Profile"), this); + connect(actionPixelLineProfile, SIGNAL(activated()), this, SLOT(pixelLineProfile())); + + actionIntensityTable = new QAction(tr("&Intensity Table"), this); + connect(actionIntensityTable, SIGNAL(activated()), this, SLOT(intensityTable())); + + actionShowLineDialog = new QAction(tr("&Properties"), this); + connect(actionShowLineDialog, SIGNAL(activated()), this, SLOT(showLineDialog())); + + actionShowTextDialog = new QAction(tr("&Properties"), this); + connect(actionShowTextDialog, SIGNAL(activated()), this, SLOT(showEnrichementDialog())); + + actionActivateWindow = new QAction(tr("&Activate Window"), this); + connect(actionActivateWindow, SIGNAL(activated()), this, SLOT(activateWindow())); + + actionMinimizeWindow = new QAction(tr("Mi&nimize Window"), this); + connect(actionMinimizeWindow, SIGNAL(activated()), this, SLOT(minimizeWindow())); + + actionMaximizeWindow = new QAction(tr("Ma&ximize Window"), this); + connect(actionMaximizeWindow, SIGNAL(activated()), this, SLOT(maximizeWindow())); + + actionHideWindow = new QAction(tr("&Hide Window"), this); + actionHideWindow->setShortcut(tr("Ctrl+Alt+H")); + connect(actionHideWindow, SIGNAL(activated()), this, SLOT(hideWindow())); + + actionResizeWindow = new QAction(QIcon(":/resize.png"), tr("Re&size Window..."), this); + connect(actionResizeWindow, SIGNAL(activated()), this, SLOT(resizeWindow())); + + actionEditSurfacePlot = new QAction(tr("&Surface..."), this); + connect(actionEditSurfacePlot, SIGNAL(activated()), this, SLOT(editSurfacePlot())); + + actionAdd3DData = new QAction(tr("&Data Set..."), this); + connect(actionAdd3DData, SIGNAL(activated()), this, SLOT(add3DData())); + + actionSetMatrixProperties = new QAction(tr("Set &Properties..."), this); + connect(actionSetMatrixProperties, SIGNAL(activated()), this, SLOT(showMatrixDialog())); + + actionSetMatrixDimensions = new QAction(tr("Set &Dimensions..."), this); + connect(actionSetMatrixDimensions, SIGNAL(activated()), this, SLOT(showMatrixSizeDialog())); + actionSetMatrixDimensions->setShortcut(tr("Ctrl+D")); + + actionSetMatrixValues = new QAction(QIcon(":/formula.png"), tr("Set &Values..."), this); + connect(actionSetMatrixValues, SIGNAL(activated()), this, SLOT(showMatrixValuesDialog())); + actionSetMatrixValues->setShortcut(tr("Alt+Q")); + + actionImagePlot = new QAction(QIcon(":/image_plot.png"), tr("&Image Plot"), this); + connect(actionImagePlot, SIGNAL(activated()), this, SLOT(plotImage())); + + actionImageProfilesPlot = new QAction(QIcon(":/image_profiles.png"), tr("&Image Profiles"), this); + connect(actionImageProfilesPlot, SIGNAL(activated()), this, SLOT(plotImageProfiles())); + + actionTransposeMatrix = new QAction(tr("&Transpose"), this); + connect(actionTransposeMatrix, SIGNAL(activated()), this, SLOT(transposeMatrix())); + + actionFlipMatrixVertically = new QAction(QIcon(":/flip_vertical.png"), tr("Flip &V"), this); + actionFlipMatrixVertically->setShortcut(tr("Ctrl+Shift+V")); + connect(actionFlipMatrixVertically, SIGNAL(activated()), this, SLOT(flipMatrixVertically())); + + actionFlipMatrixHorizontally = new QAction(QIcon(":/flip_horizontal.png"), tr("Flip &H"), this); + actionFlipMatrixHorizontally->setShortcut(tr("Ctrl+Shift+H")); + connect(actionFlipMatrixHorizontally, SIGNAL(activated()), this, SLOT(flipMatrixHorizontally())); + + actionRotateMatrix = new QAction(QIcon(":/rotate_clockwise.png"), tr("R&otate 90"), this); + actionRotateMatrix->setShortcut(tr("Ctrl+Shift+R")); + connect(actionRotateMatrix, SIGNAL(activated()), this, SLOT(rotateMatrix90())); + + actionRotateMatrixMinus = new QAction(QIcon(":/rotate_counterclockwise.png"), tr("Rotate &-90"), this); + actionRotateMatrixMinus->setShortcut(tr("Ctrl+Alt+R")); + connect(actionRotateMatrixMinus, SIGNAL(activated()), this, SLOT(rotateMatrixMinus90())); + + actionInvertMatrix = new QAction(tr("&Invert"), this); + connect(actionInvertMatrix, SIGNAL(activated()), this, SLOT(invertMatrix())); + + actionMatrixDeterminant = new QAction(tr("&Determinant"), this); + connect(actionMatrixDeterminant, SIGNAL(activated()), this, SLOT(matrixDeterminant())); + + actionViewMatrixImage = new QAction(tr("&Image mode"), this); + actionViewMatrixImage->setShortcut(tr("Ctrl+Shift+I")); + connect(actionViewMatrixImage, SIGNAL(activated()), this, SLOT(viewMatrixImage())); + actionViewMatrixImage->setCheckable(true); + + actionViewMatrix = new QAction(tr("&Data mode"), this); + actionViewMatrix->setShortcut(tr("Ctrl+Shift+D")); + connect(actionViewMatrix, SIGNAL(activated()), this, SLOT(viewMatrixTable())); + actionViewMatrix->setCheckable(true); + + actionMatrixXY = new QAction(tr("Show &X/Y"), this); + actionMatrixXY->setShortcut(tr("Ctrl+Shift+X")); + connect(actionMatrixXY, SIGNAL(activated()), this, SLOT(viewMatrixXY())); + actionMatrixXY->setCheckable(true); + + actionMatrixColumnRow = new QAction(tr("Show &Column/Row"), this); + actionMatrixColumnRow->setShortcut(tr("Ctrl+Shift+C")); + connect(actionMatrixColumnRow, SIGNAL(activated()), this, SLOT(viewMatrixColumnRow())); + actionMatrixColumnRow->setCheckable(true); + + actionMatrixGrayScale = new QAction(tr("&Gray Scale"), this); + connect(actionMatrixGrayScale, SIGNAL(activated()), this, SLOT(setMatrixGrayScale())); + actionMatrixGrayScale->setCheckable(true); + + actionMatrixDefaultScale = new QAction(tr("&Default"), this); + connect(actionMatrixDefaultScale, SIGNAL(activated()), this, SLOT(setMatrixDefaultScale())); + actionMatrixDefaultScale->setCheckable(true); + + actionMatrixRainbowScale = new QAction(tr("&Rainbow"), this); + connect(actionMatrixRainbowScale, SIGNAL(activated()), this, SLOT(setMatrixRainbowScale())); + actionMatrixRainbowScale->setCheckable(true); + + actionMatrixCustomScale = new QAction(tr("&Custom"), this); + connect(actionMatrixCustomScale, SIGNAL(activated()), this, SLOT(showColorMapDialog())); + actionMatrixCustomScale->setCheckable(true); + + actionExportMatrix = new QAction(tr("&Export Image ..."), this); + connect(actionExportMatrix, SIGNAL(activated()), this, SLOT(exportMatrix())); + + actionConvertMatrixDirect = new QAction(tr("&Direct"), this); + connect(actionConvertMatrixDirect, SIGNAL(activated()), this, SLOT(convertMatrixToTableDirect())); + + actionConvertMatrixXYZ = new QAction(tr("&XYZ Columns"), this); + connect(actionConvertMatrixXYZ, SIGNAL(activated()), this, SLOT(convertMatrixToTableXYZ())); + + actionConvertMatrixYXZ = new QAction(tr("&YXZ Columns"), this); + connect(actionConvertMatrixYXZ, SIGNAL(activated()), this, SLOT(convertMatrixToTableYXZ())); + + actionMatrixFFTDirect = new QAction(tr("&Forward FFT"), this); + connect(actionMatrixFFTDirect, SIGNAL(activated()), this, SLOT(matrixDirectFFT())); + + actionMatrixFFTInverse = new QAction(tr("&Inverse FFT"), this); + connect(actionMatrixFFTInverse, SIGNAL(activated()), this, SLOT(matrixInverseFFT())); + + actionConvertTableDirect= new QAction(tr("&Direct"), this); + connect(actionConvertTableDirect, SIGNAL(activated()), this, SLOT(convertTableToMatrix())); + + actionConvertTableBinning = new QAction(tr("2D &Binning"), this); + connect(actionConvertTableBinning, SIGNAL(activated()), this, SLOT(showBinMatrixDialog())); + + actionConvertTableRegularXYZ = new QAction(tr("&Regular XYZ"), this); + connect(actionConvertTableRegularXYZ, SIGNAL(activated()), this, SLOT(convertTableToMatrixRegularXYZ())); + + actionPlot3DWireFrame = new QAction(QIcon(":/lineMesh.png"), tr("3D &Wire Frame"), this); + connect(actionPlot3DWireFrame, SIGNAL(activated()), this, SLOT(plot3DWireframe())); + + actionPlot3DHiddenLine = new QAction(QIcon(":/grid_only.png"), tr("3D &Hidden Line"), this); + connect(actionPlot3DHiddenLine, SIGNAL(activated()), this, SLOT(plot3DHiddenLine())); + + actionPlot3DPolygons = new QAction(QIcon(":/no_grid.png"), tr("3D &Polygons"), this); + connect(actionPlot3DPolygons, SIGNAL(activated()), this, SLOT(plot3DPolygons())); + + actionPlot3DWireSurface = new QAction(QIcon(":/grid_poly.png"), tr("3D Wire &Surface"), this); + connect(actionPlot3DWireSurface, SIGNAL(activated()), this, SLOT(plot3DWireSurface())); + + actionColorMap = new QAction(QIcon(":/color_map.png"), tr("Contour - &Color Fill"), this); + connect(actionColorMap, SIGNAL(activated()), this, SLOT(plotColorMap())); + + actionContourMap = new QAction(QIcon(":/contour_map.png"), tr("Contour &Lines"), this); + connect(actionContourMap, SIGNAL(activated()), this, SLOT(plotContour())); + + actionGrayMap = new QAction(QIcon(":/gray_map.png"), tr("&Gray Scale Map"), this); + connect(actionGrayMap, SIGNAL(activated()), this, SLOT(plotGrayScale())); + + actionSortTable = new QAction(QPixmap(":/sort.png"), tr("Sort Ta&ble"), this); + connect(actionSortTable, SIGNAL(activated()), this, SLOT(sortActiveTable())); + + actionSortSelection = new QAction(tr("Sort Columns"), this); + connect(actionSortSelection, SIGNAL(activated()), this, SLOT(sortSelection())); + + actionNormalizeTable = new QAction(tr("&Table"), this); + connect(actionNormalizeTable, SIGNAL(activated()), this, SLOT(normalizeActiveTable())); + + actionNormalizeSelection = new QAction(tr("&Columns"), this); + connect(actionNormalizeSelection, SIGNAL(activated()), this, SLOT(normalizeSelection())); + + actionCorrelate = new QAction(tr("Co&rrelate"), this); + connect(actionCorrelate, SIGNAL(activated()), this, SLOT(correlate())); + + actionAutoCorrelate = new QAction(tr("&Autocorrelate"), this); + connect(actionAutoCorrelate, SIGNAL(activated()), this, SLOT(autoCorrelate())); + + actionConvolute = new QAction(tr("&Convolute"), this); + connect(actionConvolute, SIGNAL(activated()), this, SLOT(convolute())); + + actionDeconvolute = new QAction(tr("&Deconvolute"), this); + connect(actionDeconvolute, SIGNAL(activated()), this, SLOT(deconvolute())); + + actionTranslateHor = new QAction(tr("&Horizontal"), this); + connect(actionTranslateHor, SIGNAL(activated()), this, SLOT(translateCurveHor())); + + actionTranslateVert = new QAction(tr("&Vertical"), this); + connect(actionTranslateVert, SIGNAL(activated()), this, SLOT(translateCurve())); + + actionSetAscValues = new QAction(QIcon(":/rowNumbers.png"),tr("Ro&w Numbers"), this); + connect(actionSetAscValues, SIGNAL(activated()), this, SLOT(setAscValues())); + + actionSetRandomValues = new QAction(QIcon(":/randomNumbers.png"),tr("&Random Values"), this); + connect(actionSetRandomValues, SIGNAL(activated()), this, SLOT(setRandomValues())); + + actionFrequencyCount = new QAction(tr("&Frequency Count ..."), this); + connect(actionFrequencyCount, SIGNAL(activated()), this, SLOT(showFrequencyCountDialog())); + + actionReadOnlyCol = new QAction(tr("&Read Only"), this); + connect(actionReadOnlyCol, SIGNAL(activated()), this, SLOT(setReadOnlyCol())); + + actionSetXCol = new QAction(QIcon(":/x_col.png"), tr("&X"), this); + connect(actionSetXCol, SIGNAL(activated()), this, SLOT(setXCol())); + + actionSetYCol = new QAction(QIcon(":/y_col.png"), tr("&Y"), this); + connect(actionSetYCol, SIGNAL(activated()), this, SLOT(setYCol())); + + actionSetZCol = new QAction(QIcon(":/z_col.png"), tr("&Z"), this); + connect(actionSetZCol, SIGNAL(activated()), this, SLOT(setZCol())); + + actionSetXErrCol = new QAction(tr("X E&rror"), this); + connect(actionSetXErrCol, SIGNAL(activated()), this, SLOT(setXErrCol())); + + actionSetYErrCol = new QAction(QIcon(":/errors.png"), tr("Y &Error"), this); + connect(actionSetYErrCol, SIGNAL(activated()), this, SLOT(setYErrCol())); + + actionDisregardCol = new QAction(QIcon(":/disregard_col.png"), tr("&Disregard"), this); + connect(actionDisregardCol, SIGNAL(activated()), this, SLOT(disregardCol())); + + actionSetLabelCol = new QAction(QIcon(":/set_label_col.png"), tr("&Label"), this); + connect(actionSetLabelCol, SIGNAL(activated()), this, SLOT(setLabelCol())); + + actionBoxPlot = new QAction(QIcon(":/boxPlot.png"),tr("&Box Plot"), this); + connect(actionBoxPlot, SIGNAL(activated()), this, SLOT(plotBoxDiagram())); + + actionMultiPeakGauss = new QAction(tr("&Gaussian..."), this); + connect(actionMultiPeakGauss, SIGNAL(activated()), this, SLOT(fitMultiPeakGauss())); + + actionMultiPeakLorentz = new QAction(tr("&Lorentzian..."), this); + connect(actionMultiPeakLorentz, SIGNAL(activated()), this, SLOT(fitMultiPeakLorentz())); + + actionSubtractLine = new QAction(tr("&Straight Line..."), this); + connect(actionSubtractLine, SIGNAL(activated()), this, SLOT(subtractStraightLine())); + + actionSubtractReference = new QAction(tr("&Reference Data..."), this); + connect(actionSubtractReference, SIGNAL(activated()), this, SLOT(subtractReferenceData())); + + actionCheckUpdates = new QAction(tr("Search for &Updates"), this); + connect(actionCheckUpdates, SIGNAL(activated()), this, SLOT(searchForUpdates())); + + actionHomePage = new QAction(tr("&QtiPlot Homepage"), this); + connect(actionHomePage, SIGNAL(activated()), this, SLOT(showHomePage())); + + actionHelpForums = new QAction(tr("QtiPlot &Forums"), this); + connect(actionHelpForums, SIGNAL(triggered()), this, SLOT(showForums())); + + actionHelpBugReports = new QAction(tr("Report a &Bug"), this); + connect(actionHelpBugReports, SIGNAL(triggered()), this, SLOT(showBugTracker())); + + actionDownloadManual = new QAction(tr("Download &Manual"), this); + connect(actionDownloadManual, SIGNAL(activated()), this, SLOT(downloadManual())); + + actionTranslations = new QAction(tr("&Translations"), this); + connect(actionTranslations, SIGNAL(activated()), this, SLOT(downloadTranslation())); + + actionDonate = new QAction(tr("Make a &Donation"), this); + connect(actionDonate, SIGNAL(activated()), this, SLOT(showDonationsPage())); + + actionTechnicalSupport = new QAction(tr("Technical &Support"), this); + connect(actionTechnicalSupport, SIGNAL(activated()), this, SLOT(showSupportPage())); + +#ifdef SCRIPTING_PYTHON + actionScriptingLang = new QAction(tr("Scripting &language"), this); + connect(actionScriptingLang, SIGNAL(activated()), this, SLOT(showScriptingLangDialog())); + + actionCommentSelection = new QAction(QIcon(":/comment.png"), tr("Commen&t Selection"), this); + actionCommentSelection->setEnabled(false); + connect(actionCommentSelection, SIGNAL(activated()), this, SLOT(commentSelection())); + + actionUncommentSelection = new QAction(QIcon(":/uncomment.png"), tr("&Uncomment Selection"), this); + actionUncommentSelection->setEnabled(false); + connect(actionUncommentSelection, SIGNAL(activated()), this, SLOT(uncommentSelection())); +#endif + + actionRestartScripting = new QAction(tr("&Restart scripting"), this); + connect(actionRestartScripting, SIGNAL(activated()), this, SLOT(restartScriptingEnv())); + + actionNoteExecute = new QAction(QIcon(":/execute_selection.png"), tr("E&xecute"), this); + actionNoteExecute->setShortcut(tr("Ctrl+J")); + connect(actionNoteExecute, SIGNAL(activated()), this, SLOT(execute())); + + actionNoteExecuteAll = new QAction(QIcon(":/play.png"), tr("Execute &All"), this); + actionNoteExecuteAll->setShortcut(tr("Ctrl+Shift+J")); + connect(actionNoteExecuteAll, SIGNAL(activated()), this, SLOT(executeAll())); + + actionNoteEvaluate = new QAction(tr("&Evaluate Expression"), this); + actionNoteEvaluate->setShortcut(tr("Ctrl+Return")); + connect(actionNoteEvaluate, SIGNAL(activated()), this, SLOT(evaluate())); + + actionShowNoteLineNumbers = new QAction(tr("Show Line &Numbers"), this); + actionShowNoteLineNumbers->setCheckable(true); + connect(actionShowNoteLineNumbers, SIGNAL(toggled(bool)), this, SLOT(showNoteLineNumbers(bool))); + + actionFind = new QAction(QIcon(":/find.png"), tr("&Find..."), this); + actionFind->setShortcut(tr("Ctrl+Alt+F")); + connect(actionFind, SIGNAL(activated()), this, SLOT(noteFindDialogue())); + + actionFindNext = new QAction(QIcon(":/find_next.png"), tr("Find &Next"), this); + actionFindNext->setShortcut(tr("F3")); + connect(actionFindNext, SIGNAL(activated()), this, SLOT(noteFindNext())); + + actionFindPrev = new QAction(QIcon(":/find_previous.png"), tr("Find &Previous"), this); + actionFindPrev->setShortcut(tr("F4")); + connect(actionFindPrev, SIGNAL(activated()), this, SLOT(noteFindPrev())); + + actionReplace = new QAction(QIcon(":/replace.png"), tr("&Replace..."), this); + connect(actionReplace, SIGNAL(activated()), this, SLOT(noteReplaceDialogue())); + + actionIncreaseIndent = new QAction(QIcon(":/increase_indent.png"), tr("Increase Indent"), this); + connect(actionIncreaseIndent, SIGNAL(activated()), this, SLOT(increaseNoteIndent())); + + actionDecreaseIndent = new QAction(QIcon(":/decrease_indent.png"),tr("Decrease Indent"), this); + connect(actionDecreaseIndent, SIGNAL(activated()), this, SLOT(decreaseNoteIndent())); + + actionRenameNoteTab = new QAction(tr("Rena&me Tab..."), this); + connect(actionRenameNoteTab, SIGNAL(activated()), this, SLOT(renameCurrentNoteTab())); + + actionAddNoteTab = new QAction(QIcon(":/plus.png"), tr("A&dd Tab"), this); + connect(actionAddNoteTab, SIGNAL(activated()), this, SLOT(addNoteTab())); + + actionCloseNoteTab = new QAction(QIcon(":/delete.png"), tr("C&lose Tab"), this); + connect(actionCloseNoteTab, SIGNAL(activated()), this, SLOT(closeNoteTab())); + +#ifdef SCRIPTING_PYTHON + actionShowScriptWindow = new QAction(QPixmap(":/python.png"), tr("&Script Window"), this); + actionShowScriptWindow->setShortcut(QKeySequence(Qt::ALT + Qt::Key_F3)); + actionShowScriptWindow->setToggleAction( true ); + connect(actionShowScriptWindow, SIGNAL(activated()), this, SLOT(showScriptWindow())); + + actionOpenQtDesignerUi = new QAction(tr("Load Custom User &Interface..."), this); + connect(actionOpenQtDesignerUi, SIGNAL(activated()), this, SLOT(openQtDesignerUi())); +#endif + + actionShowCurvePlotDialog = new QAction(tr("&Plot details..."), this); + connect(actionShowCurvePlotDialog, SIGNAL(activated()), this, SLOT(showCurvePlotDialog())); + + actionShowCurveWorksheet = new QAction(tr("&Worksheet"), this); + connect(actionShowCurveWorksheet, SIGNAL(activated()), this, SLOT(showCurveWorksheet())); + + actionCurveFullRange = new QAction(tr("&Reset to Full Range"), this); + connect(actionCurveFullRange, SIGNAL(activated()), this, SLOT(setCurveFullRange())); + + actionEditCurveRange = new QAction(tr("Edit &Range..."), this); + connect(actionEditCurveRange, SIGNAL(activated()), this, SLOT(showCurveRangeDialog())); + + actionRemoveCurve = new QAction(QPixmap(":/close.png"), tr("&Delete"), this); + connect(actionRemoveCurve, SIGNAL(activated()), this, SLOT(removeCurve())); + + actionHideCurve = new QAction(tr("&Hide"), this); + connect(actionHideCurve, SIGNAL(activated()), this, SLOT(hideCurve())); + + actionHideOtherCurves = new QAction(tr("Hide &Other Curves"), this); + connect(actionHideOtherCurves, SIGNAL(activated()), this, SLOT(hideOtherCurves())); + + actionShowAllCurves = new QAction(tr("&Show All Curves"), this); + connect(actionShowAllCurves, SIGNAL(activated()), this, SLOT(showAllCurves())); + + actionToolBars = new QAction(tr("&Toolbars..."), this); + actionToolBars->setShortcut(tr("Ctrl+Shift+T")); + connect(actionToolBars, SIGNAL(activated()), this, SLOT(showToolBarsMenu())); + + actionFontBold = new QAction("B", this); + actionFontBold->setToolTip(tr("Bold")); + QFont font = appFont; + font.setBold(true); + actionFontBold->setFont(font); + actionFontBold->setCheckable(true); + connect(actionFontBold, SIGNAL(toggled(bool)), this, SLOT(setBoldFont(bool))); + + actionFontItalic = new QAction("It", this); + actionFontItalic->setToolTip(tr("Italic")); + font = appFont; + font.setItalic(true); + actionFontItalic->setFont(font); + actionFontItalic->setCheckable(true); + connect(actionFontItalic, SIGNAL(toggled(bool)), this, SLOT(setItalicFont(bool))); + + actionSuperscript = new QAction(QPixmap(":/exp.png"), tr("Superscript"), this); + connect(actionSuperscript, SIGNAL(activated()), this, SLOT(insertSuperscript())); + actionSuperscript->setEnabled(false); + + actionSubscript = new QAction(QPixmap(":/index.png"), tr("Subscript"), this); + connect(actionSubscript, SIGNAL(activated()), this, SLOT(insertSubscript())); + actionSubscript->setEnabled(false); + + actionUnderline = new QAction("U", this); + actionUnderline->setToolTip(tr("Underline (Ctrl+U)")); + actionUnderline->setShortcut(tr("Ctrl+U")); + font = appFont; + font.setUnderline(true); + actionUnderline->setFont(font); + connect(actionUnderline, SIGNAL(activated()), this, SLOT(underline())); + actionUnderline->setEnabled(false); + + actionGreekSymbol = new QAction(QString(QChar(0x3B1)) + QString(QChar(0x3B2)), this); + actionGreekSymbol->setToolTip(tr("Greek")); + connect(actionGreekSymbol, SIGNAL(activated()), this, SLOT(insertGreekSymbol())); + + actionGreekMajSymbol = new QAction(QString(QChar(0x393)), this); + actionGreekMajSymbol->setToolTip(tr("Greek")); + connect(actionGreekMajSymbol, SIGNAL(activated()), this, SLOT(insertGreekMajSymbol())); + + actionMathSymbol = new QAction(QString(QChar(0x222B)), this); + actionMathSymbol->setToolTip(tr("Mathematical Symbols")); + connect(actionMathSymbol, SIGNAL(activated()), this, SLOT(insertMathSymbol())); + + actionIncreasePrecision = new QAction(QPixmap(":/increase_decimals.png"), tr("Increase Precision"), this); + connect(actionIncreasePrecision, SIGNAL(activated()), this, SLOT(increasePrecision())); + + actionDecreasePrecision = new QAction(QPixmap(":/decrease_decimals.png"), tr("Decrease Precision"), this); + connect(actionDecreasePrecision, SIGNAL(activated()), this, SLOT(decreasePrecision())); +} + +void ApplicationWindow::translateActionsStrings() +{ + actionFontBold->setToolTip(tr("Bold")); + actionFontItalic->setToolTip(tr("Italic")); + actionUnderline->setStatusTip(tr("Underline (Ctrl+U)")); + actionUnderline->setShortcut(tr("Ctrl+U")); + actionGreekSymbol->setToolTip(tr("Greek")); + actionGreekMajSymbol->setToolTip(tr("Greek")); + actionMathSymbol->setToolTip(tr("Mathematical Symbols")); + + actionShowCurvePlotDialog->setMenuText(tr("&Plot details...")); + actionShowCurveWorksheet->setMenuText(tr("&Worksheet")); + actionRemoveCurve->setMenuText(tr("&Delete")); + + actionCurveFullRange->setMenuText(tr("&Reset to Full Range")); + actionEditCurveRange->setMenuText(tr("Edit &Range...")); + actionHideCurve->setMenuText(tr("&Hide")); + actionHideOtherCurves->setMenuText(tr("Hide &Other Curves")); + actionShowAllCurves->setMenuText(tr("&Show All Curves")); + + actionNewProject->setMenuText(tr("New &Project")); + actionNewProject->setToolTip(tr("Open a new project")); + actionNewProject->setShortcut(tr("Ctrl+N")); + + actionAppendProject->setMenuText(tr("App&end Project...")); + actionAppendProject->setToolTip(tr("Append a project to the current folder")); + actionAppendProject->setShortcut(tr("Ctrl+Alt+A")); + + actionNewFolder->setMenuText(tr("New F&older")); + actionNewFolder->setToolTip(tr("Create a new folder")); + actionNewFolder->setShortcut(Qt::Key_F7); + + actionNewGraph->setMenuText(tr("New &Graph")); + actionNewGraph->setToolTip(tr("Create an empty 2D plot")); + actionNewGraph->setShortcut(tr("Ctrl+G")); + + actionNewNote->setMenuText(tr("New &Note")); + actionNewNote->setToolTip(tr("Create an empty note window")); + + actionNewTable->setMenuText(tr("New &Table")); + actionNewTable->setShortcut(tr("Ctrl+T")); + actionNewTable->setToolTip(tr("New table")); + + actionNewMatrix->setMenuText(tr("New &Matrix")); + actionNewMatrix->setShortcut(tr("Ctrl+M")); + actionNewMatrix->setToolTip(tr("New matrix")); + + actionNewFunctionPlot->setMenuText(tr("New &Function Plot")); + actionNewFunctionPlot->setToolTip(tr("Create a new 2D function plot")); + actionNewFunctionPlot->setShortcut(tr("Ctrl+F")); + + actionNewSurfacePlot->setMenuText(tr("New 3D &Surface Plot")); + actionNewSurfacePlot->setToolTip(tr("Create a new 3D surface plot")); + actionNewSurfacePlot->setShortcut(tr("Ctrl+ALT+Z")); + + actionOpen->setMenuText(tr("&Open...")); + actionOpen->setShortcut(tr("Ctrl+O")); + actionOpen->setToolTip(tr("Open project")); + +#ifdef XLS_IMPORT + actionOpenExcel->setMenuText(tr("Open Exce&l ...")); + actionOpenExcel->setShortcut( tr("Ctrl+Shift+E") ); + actionOpenExcel->setToolTip(tr("Open Excel")); +#endif +#ifdef ODS_IMPORT + actionOpenOds->setMenuText(tr("Open ODF Spreads&heet...")); + actionOpenOds->setShortcut( tr("Ctrl+Alt+S") ); + actionOpenOds->setToolTip(tr("Open ODF Spreadsheet")); +#endif + actionLoadImage->setMenuText(tr("Open Image &File...")); + actionLoadImage->setShortcut(tr("Ctrl+I")); + + actionImportSound->setMenuText(tr("&Sound (WAV)...")); + actionImportImage->setMenuText(tr("Import I&mage...")); + + actionSaveProject->setMenuText(tr("&Save Project")); + actionSaveProject->setToolTip(tr("Save project")); + actionSaveProject->setShortcut(tr("Ctrl+S")); + + actionSaveProjectAs->setMenuText(tr("Save Project &As...")); + actionSaveProjectAs->setShortcut( tr("Ctrl+Shift+S") ); + + actionOpenTemplate->setMenuText(tr("Open Te&mplate...")); + actionOpenTemplate->setToolTip(tr("Open template")); + + actionSaveTemplate->setMenuText(tr("Save As &Template...")); + actionSaveTemplate->setToolTip(tr("Save window as template")); + + actionLoad->setMenuText(tr("&Import ASCII...")); + actionLoad->setToolTip(tr("Import data file(s)")); + actionLoad->setShortcut(tr("Ctrl+K")); + + actionUndo->setMenuText(tr("&Undo")); + actionUndo->setToolTip(tr("Undo changes")); + actionUndo->setShortcut(tr("Ctrl+Z")); + + actionRedo->setMenuText(tr("&Redo")); + actionRedo->setToolTip(tr("Redo changes")); + + actionCopyWindow->setMenuText(tr("&Duplicate")); + actionCopyWindow->setToolTip(tr("Duplicate window")); + actionCopyWindow->setShortcut(tr("Ctrl+Alt+D")); + + actionCutSelection->setMenuText(tr("Cu&t Selection")); + actionCutSelection->setToolTip(tr("Cut selection")); + actionCutSelection->setShortcut(tr("Ctrl+X")); + + actionCopySelection->setMenuText(tr("&Copy Selection")); + actionCopySelection->setToolTip(tr("Copy selection")); + actionCopySelection->setShortcut(tr("Ctrl+C")); + + actionPasteSelection->setMenuText(tr("&Paste Selection")); + actionPasteSelection->setToolTip(tr("Paste selection")); + actionPasteSelection->setShortcut(tr("Ctrl+V")); + + actionClearSelection->setMenuText(tr("&Delete Selection")); + actionClearSelection->setToolTip(tr("Delete selection")); + actionClearSelection->setShortcut(tr("Del","delete key")); + + actionShowExplorer->setMenuText(tr("Project &Explorer")); + actionShowExplorer->setShortcut(tr("Ctrl+E")); + actionShowExplorer->setToolTip(tr("Show project explorer")); + + actionFindWindow->setMenuText(tr("&Find...")); + + actionShowLog->setMenuText(tr("Results &Log")); + actionShowLog->setToolTip(tr("Show analysis results")); + + actionShowUndoStack->setMenuText(tr("&Undo/Redo Stack")); + actionShowUndoStack->setToolTip(tr("Show available undo/redo commands")); + +#ifdef SCRIPTING_CONSOLE + actionShowConsole->setMenuText(tr("&Console")); + actionShowConsole->setToolTip(tr("Show Scripting console")); +#endif + +#ifdef SCRIPTING_PYTHON + actionShowScriptWindow->setMenuText(tr("&Script Window")); + actionShowScriptWindow->setToolTip(tr("Script Window")); + actionOpenQtDesignerUi->setMenuText(tr("Load Custom User &Interface...")); +#endif + + actionCustomActionDialog->setMenuText(tr("Add &Custom Script Action...")); + + actionAddLayer->setMenuText(tr("Add La&yer")); + actionAddLayer->setToolTip(tr("Add Layer")); + actionAddLayer->setShortcut(tr("ALT+L")); + + actionShowLayerDialog->setMenuText(tr("Arran&ge Layers")); + actionShowLayerDialog->setToolTip(tr("Arrange Layers")); + actionShowLayerDialog->setShortcut(tr("Shift+A")); + + actionAutomaticLayout->setMenuText(tr("Automatic Layout")); + actionAutomaticLayout->setToolTip(tr("Automatic Layout")); + + actionExportGraph->setMenuText(tr("&Current")); + actionExportGraph->setShortcut(tr("Ctrl+Alt+G")); + actionExportGraph->setToolTip(tr("Export current graph")); + + actionExportAllGraphs->setMenuText(tr("&All")); + actionExportAllGraphs->setShortcut(tr("Alt+X")); + actionExportAllGraphs->setToolTip(tr("Export all graphs")); + + actionPresentationODF->setMenuText(tr("Create Open &Document Presentation...")); + + actionExportPDF->setMenuText(tr("&Export PDF")); + actionExportPDF->setShortcut(tr("Ctrl+Alt+P")); + actionExportPDF->setToolTip(tr("Export to PDF")); + + actionPrint->setMenuText(tr("&Print...")); + actionPrint->setShortcut(tr("Ctrl+P")); + actionPrint->setToolTip(tr("Print window")); + + actionPrintPreview->setMenuText(tr("Print Pre&view...")); + actionPrintPreview->setToolTip(tr("Print preview")); + + actionPrintAllPlots->setMenuText(tr("Print All Plo&ts")); + actionShowExportASCIIDialog->setMenuText(tr("E&xport ASCII...")); + + actionCloseAllWindows->setMenuText(tr("&Quit")); + actionCloseAllWindows->setShortcut(tr("Ctrl+Q")); + actionCloseProject->setMenuText(tr("&Close")); + + actionClearLogInfo->setMenuText(tr("Clear &Log Information")); + actionDeleteFitTables->setMenuText(tr("Delete &Fit Tables")); + + actionToolBars->setMenuText(tr("&Toolbars...")); + actionToolBars->setShortcut(tr("Ctrl+Shift+T")); + + actionShowPlotWizard->setMenuText(tr("Plot &Wizard")); + actionShowPlotWizard->setShortcut(tr("Ctrl+Alt+W")); + + actionShowConfigureDialog->setMenuText(tr("&Preferences...")); + + actionShowCurvesDialog->setMenuText(tr("Add/Remove &Curve...")); + actionShowCurvesDialog->setShortcut(tr("ALT+C")); + actionShowCurvesDialog->setToolTip(tr("Add curve to graph")); + + actionAddErrorBars->setMenuText(tr("Add &Error Bars...")); + actionAddErrorBars->setToolTip(tr("Add Error Bars...")); + actionAddErrorBars->setShortcut(tr("Ctrl+B")); + + actionAddFunctionCurve->setMenuText(tr("Add &Function...")); + actionAddFunctionCurve->setToolTip(tr("Add Function...")); + actionAddFunctionCurve->setShortcut(tr("Ctrl+Alt+F")); + + actionUnzoom->setMenuText(tr("&Rescale to Show All")); + actionUnzoom->setShortcut(tr("Ctrl+Shift+R")); + actionUnzoom->setToolTip(tr("Best fit")); + + actionNewLegend->setMenuText( tr("New &Legend")); + actionNewLegend->setShortcut(tr("Ctrl+L")); + actionNewLegend->setToolTip(tr("Add new legend")); + + actionTimeStamp->setMenuText(tr("Add Time Stamp")); + actionTimeStamp->setShortcut(tr("Ctrl+ALT+T")); + actionTimeStamp->setToolTip(tr("Date & time ")); + + actionAddImage->setMenuText(tr("Add &Image")); + actionAddImage->setToolTip(tr("Add Image")); + actionAddImage->setShortcut(tr("ALT+I")); + + actionPlotL->setMenuText(tr("&Line")); + actionPlotL->setToolTip(tr("Plot as line")); + + actionPlotP->setMenuText(tr("&Scatter")); + actionPlotP->setToolTip(tr("Plot as symbols")); + + actionPlotLP->setMenuText(tr("Line + S&ymbol")); + actionPlotLP->setToolTip(tr("Plot as line + symbols")); + + actionPlotVerticalDropLines->setMenuText(tr("Vertical &Drop Lines")); + + actionPlotSpline->setMenuText(tr("&Spline")); + actionPlotVertSteps->setMenuText(tr("&Vertical Steps")); + actionPlotHorSteps->setMenuText(tr("&Horizontal Steps")); + + actionPlotVerticalBars->setMenuText(tr("&Columns")); + actionPlotVerticalBars->setToolTip(tr("Plot with vertical bars")); + + actionPlotHorizontalBars->setMenuText(tr("&Rows")); + actionPlotHorizontalBars->setToolTip(tr("Plot with horizontal bars")); + + actionStackBars->setMenuText(tr("Stack &Bar")); + actionStackBars->setToolTip(tr("Plot stack bar")); + + actionStackColumns->setMenuText(tr("Stack &Column")); + actionStackColumns->setToolTip(tr("Plot stack column")); + + actionPlotArea->setMenuText(tr("&Area")); + actionPlotArea->setToolTip(tr("Plot area")); + + actionPlotPie->setMenuText(tr("&Pie")); + actionPlotPie->setToolTip(tr("Plot pie")); + + actionPlotVectXYXY->setMenuText(tr("&Vectors XYXY")); + actionPlotVectXYXY->setToolTip(tr("Vectors XYXY")); + + actionPlotVectXYAM->setMenuText(tr("Vectors XY&AM")); + actionPlotVectXYAM->setToolTip(tr("Vectors XYAM")); + + actionPlotHistogram->setMenuText( tr("&Histogram")); + actionPlotStackedHistograms->setMenuText(tr("&Stacked Histogram")); + + actionPlot2VerticalLayers->setMenuText(tr("&Vertical 2 Layers")); + actionPlot2HorizontalLayers->setMenuText(tr("&Horizontal 2 Layers")); + actionPlot4Layers->setMenuText(tr("&4 Layers")); + actionPlotStackedLayers->setMenuText(tr("&Stacked Layers")); + + actionVertSharedAxisLayers->setMenuText(tr("&Vertical 2 Layers")); + actionHorSharedAxisLayers->setMenuText(tr("&Horizontal 2 Layers")); + actionSharedAxesLayers->setMenuText(tr("&4 Layers")); + actionStackSharedAxisLayers->setMenuText(tr("&Stacked Layers")); + actionCustomSharedAxisLayers->setMenuText(tr("&Custom Layout...")); + actionCustomLayout->setMenuText(tr("&Custom Layout...")); + + actionStemPlot->setMenuText(tr("Stem-and-&Leaf Plot")); + actionStemPlot->setToolTip(tr("Stem-and-Leaf Plot")); + + actionPlotDoubleYAxis->setMenuText(tr("D&ouble-Y")); + actionPlotDoubleYAxis->setToolTip(tr("Double Y Axis")); + + actionAddZoomPlot->setMenuText(tr("&Zoom")); + actionAddZoomPlot->setToolTip(tr("Zoom")); + + actionWaterfallPlot->setMenuText(tr("&Waterfall Plot")); + actionWaterfallPlot->setToolTip(tr("Waterfall Plot")); + + actionExtractGraphs->setMenuText(tr("E&xtract to Graphs")); + actionExtractGraphs->setToolTip(tr("Extract to Graphs")); + + actionExtractLayers->setMenuText(tr("Extract to Layer&s")); + actionExtractLayers->setToolTip(tr("Extract to Layers")); + + actionPlot3DRibbon->setMenuText(tr("&Ribbon")); + actionPlot3DRibbon->setToolTip(tr("Plot 3D ribbon")); + + actionPlot3DBars->setMenuText(tr("&Bars")); + actionPlot3DBars->setToolTip(tr("Plot 3D bars")); + + actionPlot3DScatter->setMenuText(tr("&Scatter")); + actionPlot3DScatter->setToolTip(tr("Plot 3D scatter")); + + actionPlot3DTrajectory->setMenuText(tr("&Trajectory")); + actionPlot3DTrajectory->setToolTip(tr("Plot 3D trajectory")); + + actionColorMap->setMenuText(tr("Contour + &Color Fill")); + actionColorMap->setToolTip(tr("Contour Lines + Color Fill")); + + actionContourMap->setMenuText(tr("Contour &Lines")); + actionContourMap->setToolTip(tr("Contour Lines")); + + actionGrayMap->setMenuText(tr("&Gray Scale Map")); + actionGrayMap->setToolTip(tr("Gray Scale Map")); + + actionShowColStatistics->setMenuText(tr("Statistics on &Columns")); + actionShowColStatistics->setToolTip(tr("Selected columns statistics")); + + actionShowRowStatistics->setMenuText(tr("Statistics on &Rows")); + actionShowRowStatistics->setToolTip(tr("Selected rows statistics")); + actionShowIntDialog->setMenuText(tr("Integr&ate Function...")); + actionIntegrate->setMenuText(tr("&Integrate")); + actionInterpolate->setMenuText(tr("Inte&rpolate ...")); + actionLowPassFilter->setMenuText(tr("&Low Pass...")); + actionHighPassFilter->setMenuText(tr("&High Pass...")); + actionBandPassFilter->setMenuText(tr("&Band Pass...")); + actionBandBlockFilter->setMenuText(tr("&Band Block...")); + actionFFT->setMenuText(tr("&FFT...")); + actionSmoothSavGol->setMenuText(tr("&Savitzky-Golay...")); + actionSmoothFFT->setMenuText(tr("&FFT Filter...")); + actionSmoothAverage->setMenuText(tr("Moving Window &Average...")); + actionSmoothLowess->setMenuText(tr("&Lowess...")); + actionDifferentiate->setMenuText(tr("&Differentiate")); + actionFitLinear->setMenuText(tr("Fit &Linear")); + actionFitSlope->setMenuText(tr("Fit Slop&e")); + actionShowFitPolynomDialog->setMenuText(tr("Fit &Polynomial ...")); + actionShowExpDecayDialog->setMenuText(tr("&First Order ...")); + actionShowTwoExpDecayDialog->setMenuText(tr("&Second Order ...")); + actionShowExpDecay3Dialog->setMenuText(tr("&Third Order ...")); + actionFitExpGrowth->setMenuText(tr("Fit Exponential Gro&wth ...")); + actionFitSigmoidal->setMenuText(tr("Fit &Boltzmann (Sigmoidal)")); + actionFitGauss->setMenuText(tr("Fit &Gaussian")); + actionFitLorentz->setMenuText(tr("Fit Lorent&zian")); + + actionShowFitDialog->setMenuText(tr("Fit &Wizard...")); + actionShowFitDialog->setShortcut(tr("Ctrl+Y")); + + actionShowPlotDialog->setMenuText(tr("&Plot ...")); + actionShowScaleDialog->setMenuText(tr("&Scales...")); + actionShowAxisDialog->setMenuText(tr("&Axes...")); + actionShowGridDialog->setMenuText(tr("&Grid ...")); + actionShowTitleDialog->setMenuText(tr("&Title ...")); + actionShowColumnOptionsDialog->setMenuText(tr("Column &Options ...")); + actionShowColumnOptionsDialog->setShortcut(tr("Ctrl+Alt+O")); + actionShowColumnValuesDialog->setMenuText(tr("Set Column &Values ...")); + actionShowColumnValuesDialog->setShortcut(tr("Alt+Q")); + actionTableRecalculate->setMenuText(tr("Recalculate")); + actionTableRecalculate->setShortcut(tr("Ctrl+Return")); + actionHideSelectedColumns->setMenuText(tr("&Hide Selected")); + actionHideSelectedColumns->setToolTip(tr("Hide selected columns")); + actionShowAllColumns->setMenuText(tr("Sho&w All Columns")); + actionHideSelectedColumns->setToolTip(tr("Show all table columns")); + actionSwapColumns->setMenuText(tr("&Swap columns")); + actionSwapColumns->setToolTip(tr("Swap selected columns")); + actionMoveColRight->setMenuText(tr("Move &Right")); + actionMoveColRight->setToolTip(tr("Move Right")); + actionMoveColLeft->setMenuText(tr("Move &Left")); + actionMoveColLeft->setToolTip(tr("Move Left")); + actionMoveColFirst->setMenuText(tr("Move to F&irst")); + actionMoveColFirst->setToolTip(tr("Move to First")); + actionMoveColLast->setMenuText(tr("Move to Las&t")); + actionMoveColLast->setToolTip(tr("Move to Last")); + actionShowColsDialog->setMenuText(tr("&Columns...")); + actionShowRowsDialog->setMenuText(tr("&Rows...")); + actionDeleteRows->setMenuText(tr("&Delete Rows Interval...")); + actionMoveRowUp->setMenuText(tr("&Upward")); + actionMoveRowUp->setToolTip(tr("Move current row upward")); + actionMoveRowDown->setMenuText(tr("&Downward")); + actionMoveRowDown->setToolTip(tr("Move current row downward")); + actionAdjustColumnWidth->setMenuText(tr("Ad&just Column Width")); + actionAdjustColumnWidth->setToolTip(tr("Set optimal column width")); + + actionExtractTableData->setMenuText(tr("&Extract Data...")); + + actionAbout->setMenuText(tr("&About QtiPlot")); + actionAbout->setShortcut(tr("F1")); + + actionShowHelp->setMenuText(tr("&Help")); + actionShowHelp->setShortcut(tr("Ctrl+H")); + + actionChooseHelpFolder->setMenuText(tr("&Choose Help Folder...")); + actionRename->setMenuText(tr("&Rename Window")); + + actionCloseWindow->setMenuText(tr("Close &Window")); + actionCloseWindow->setShortcut(tr("Ctrl+W")); + + actionAddColToTable->setMenuText(tr("Add Column")); + actionAddColToTable->setToolTip(tr("Add Column")); + actionAddColToTable->setShortcut(tr("Alt+C")); + + actionClearTable->setMenuText(tr("Clear")); + actionGoToRow->setMenuText(tr("&Go to Row...")); + actionGoToRow->setShortcut(tr("Ctrl+Alt+G")); + + actionGoToColumn->setMenuText(tr("Go to Colum&n...")); + actionGoToColumn->setShortcut(tr("Ctrl+Alt+C")); + + actionDeleteLayer->setMenuText(tr("&Remove Layer")); + actionDeleteLayer->setShortcut(tr("Alt+R")); + + actionResizeActiveWindow->setMenuText(tr("Window &Geometry...")); + actionHideActiveWindow->setMenuText(tr("&Hide Window")); + actionHideActiveWindow->setShortcut(tr("Ctrl+Alt+H")); + actionShowMoreWindows->setMenuText(tr("More Windows...")); + actionPixelLineProfile->setMenuText(tr("&View Pixel Line Profile")); + actionIntensityTable->setMenuText(tr("&Intensity Table")); + actionShowLineDialog->setMenuText(tr("&Properties")); + actionShowTextDialog->setMenuText(tr("&Properties")); + actionActivateWindow->setMenuText(tr("&Activate Window")); + actionMinimizeWindow->setMenuText(tr("Mi&nimize Window")); + actionMaximizeWindow->setMenuText(tr("Ma&ximize Window")); + actionHideWindow->setMenuText(tr("&Hide Window")); + actionHideWindow->setShortcut(tr("Ctrl+Alt+H")); + actionResizeWindow->setMenuText(tr("Re&size Window...")); + actionEditSurfacePlot->setMenuText(tr("&Surface...")); + actionAdd3DData->setMenuText(tr("&Data Set...")); + actionSetMatrixProperties->setMenuText(tr("Set &Properties...")); + actionSetMatrixDimensions->setMenuText(tr("Set &Dimensions...")); + actionSetMatrixDimensions->setShortcut(tr("Ctrl+D")); + actionSetMatrixValues->setMenuText(tr("Set &Values...")); + actionSetMatrixValues->setToolTip(tr("Set Matrix Values")); + actionSetMatrixValues->setShortcut(tr("Alt+Q")); + actionImagePlot->setMenuText(tr("&Image Plot")); + actionImagePlot->setToolTip(tr("Image Plot")); + + actionImageProfilesPlot->setMenuText(tr("&Image Profiles")); + actionImageProfilesPlot->setToolTip(tr("Image Profiles")); + + actionTransposeMatrix->setMenuText(tr("&Transpose")); + actionRotateMatrix->setMenuText(tr("R&otate 90")); + actionRotateMatrix->setToolTip(tr("Rotate 90 Clockwise")); + actionRotateMatrixMinus->setMenuText(tr("Rotate &-90")); + actionRotateMatrixMinus->setToolTip(tr("Rotate 90 Counterclockwise")); + actionFlipMatrixVertically->setMenuText(tr("Flip &V")); + actionFlipMatrixVertically->setToolTip(tr("Flip Vertically")); + actionFlipMatrixHorizontally->setMenuText(tr("Flip &H")); + actionFlipMatrixHorizontally->setToolTip(tr("Flip Horizontally")); + + actionMatrixXY->setMenuText(tr("Show &X/Y")); + actionMatrixColumnRow->setMenuText(tr("Show &Column/Row")); + actionViewMatrix->setMenuText(tr("&Data mode")); + actionViewMatrixImage->setMenuText(tr("&Image mode")); + actionMatrixDefaultScale->setMenuText(tr("&Default")); + actionMatrixGrayScale->setMenuText(tr("&Gray Scale")); + actionMatrixRainbowScale->setMenuText(tr("&Rainbow")); + actionMatrixCustomScale->setMenuText(tr("&Custom")); + actionInvertMatrix->setMenuText(tr("&Invert")); + actionMatrixDeterminant->setMenuText(tr("&Determinant")); + actionConvertMatrixDirect->setMenuText(tr("&Direct")); + actionConvertMatrixXYZ->setMenuText(tr("&XYZ Columns")); + actionConvertMatrixYXZ->setMenuText(tr("&YXZ Columns")); + actionExportMatrix->setMenuText(tr("&Export Image ...")); + + actionConvertTableDirect->setMenuText(tr("&Direct")); + actionConvertTableBinning->setMenuText(tr("2D &Binning")); + actionConvertTableRegularXYZ->setMenuText(tr("&Regular XYZ")); + + actionPlot3DWireFrame->setMenuText(tr("3D &Wire Frame")); + actionPlot3DHiddenLine->setMenuText(tr("3D &Hidden Line")); + actionPlot3DPolygons->setMenuText(tr("3D &Polygons")); + actionPlot3DWireSurface->setMenuText(tr("3D Wire &Surface")); + actionSortTable->setMenuText(tr("Sort Ta&ble")); + actionSortSelection->setMenuText(tr("Sort Columns")); + actionNormalizeTable->setMenuText(tr("&Table")); + actionNormalizeSelection->setMenuText(tr("&Columns")); + actionCorrelate->setMenuText(tr("Co&rrelate")); + actionAutoCorrelate->setMenuText(tr("&Autocorrelate")); + actionConvolute->setMenuText(tr("&Convolute")); + actionDeconvolute->setMenuText(tr("&Deconvolute")); + actionTranslateHor->setMenuText(tr("&Horizontal")); + actionTranslateVert->setMenuText(tr("&Vertical")); + actionSetAscValues->setMenuText(tr("Ro&w Numbers")); + actionSetAscValues->setToolTip(tr("Fill selected columns with row numbers")); + actionSetRandomValues->setMenuText(tr("&Random Values")); + actionSetRandomValues->setToolTip(tr("Fill selected columns with random numbers")); + actionFrequencyCount->setMenuText(tr("&Frequency Count ...")); + actionSetXCol->setMenuText(tr("&X")); + actionSetXCol->setToolTip(tr("Set column as X")); + actionSetYCol->setMenuText(tr("&Y")); + actionSetYCol->setToolTip(tr("Set column as Y")); + actionSetZCol->setMenuText(tr("&Z")); + actionSetZCol->setToolTip(tr("Set column as Z")); + actionSetXErrCol->setMenuText(tr("X E&rror")); + actionSetYErrCol->setMenuText(tr("Y &Error")); + actionSetYErrCol->setToolTip(tr("Set as Y Error Bars")); + actionSetLabelCol->setMenuText(tr("&Label")); + actionSetLabelCol->setToolTip(tr("Set as Labels")); + actionDisregardCol->setMenuText(tr("&Disregard")); + actionDisregardCol->setToolTip(tr("Disregard Columns")); + actionReadOnlyCol->setMenuText(tr("&Read Only")); + + actionBoxPlot->setMenuText(tr("&Box Plot")); + actionBoxPlot->setToolTip(tr("Box and whiskers plot")); + + actionSubtractReference->setMenuText(tr("&Reference Data...")); + actionSubtractLine->setMenuText(tr("&Straight Line...")); + actionMultiPeakGauss->setMenuText(tr("&Gaussian...")); + actionMultiPeakLorentz->setMenuText(tr("&Lorentzian...")); + actionHomePage->setMenuText(tr("&QtiPlot Homepage")); + actionCheckUpdates->setMenuText(tr("Search for &Updates")); + actionHelpForums->setText(tr("Visit QtiPlot &Forums")); + actionHelpBugReports->setText(tr("Report a &Bug")); + actionDownloadManual->setMenuText(tr("Download &Manual")); + actionTranslations->setMenuText(tr("&Translations")); + actionDonate->setMenuText(tr("Make a &Donation")); + actionTechnicalSupport->setMenuText(tr("Technical &Support")); + +#ifdef SCRIPTING_PYTHON + actionScriptingLang->setMenuText(tr("Scripting &language")); + actionCommentSelection->setMenuText(tr("Commen&t Selection")); + actionCommentSelection->setToolTip(tr("Comment Selection")); + actionCommentSelection->setShortcut(tr("Ctrl+Shift+O")); + + actionUncommentSelection->setMenuText(tr("&Uncomment Selection")); + actionUncommentSelection->setToolTip(tr("Uncomment Selection")); + actionUncommentSelection->setShortcut(tr("Ctrl+Shift+U")); +#endif + actionRestartScripting->setMenuText(tr("&Restart scripting")); + + actionNoteExecute->setMenuText(tr("E&xecute")); + actionNoteExecute->setToolTip(tr("Execute Selected Lines")); + actionNoteExecute->setShortcut(tr("Ctrl+J")); + + actionNoteExecuteAll->setMenuText(tr("Execute &All")); + actionNoteExecuteAll->setShortcut(tr("Ctrl+Shift+J")); + + actionNoteEvaluate->setMenuText(tr("&Evaluate Expression")); + actionNoteEvaluate->setShortcut(tr("Ctrl+Return")); + + actionShowNoteLineNumbers->setMenuText(tr("Show Line &Numbers")); + actionRenameNoteTab->setMenuText(tr("Rena&me Tab...")); + actionAddNoteTab->setMenuText(tr("A&dd Tab")); + actionCloseNoteTab->setMenuText(tr("C&lose Tab")); + + actionFind->setMenuText(tr("&Find...")); + actionFind->setToolTip(tr("Show find dialog")); + actionFind->setShortcut(tr("Ctrl+Alt+F")); + + actionFindNext->setMenuText(tr("Find &Next")); + actionFindNext->setToolTip(tr("Find Next")); + actionFindNext->setShortcut(tr("F3")); + + actionFindPrev->setMenuText(tr("Find &Previous")); + actionFindPrev->setToolTip(tr("Find Previous")); + actionFindPrev->setShortcut(tr("F4")); + + actionReplace->setMenuText(tr("&Replace...")); + actionReplace->setToolTip(tr("Show replace dialog")); + actionReplace->setShortcut(tr("Ctrl+R")); + + actionIncreaseIndent->setToolTip(tr("Increase Indent")); + actionDecreaseIndent->setToolTip(tr("Decrease Indent")); + + btnPointer->setMenuText(tr("Disable &tools")); + btnPointer->setToolTip( tr( "Pointer" ) ); + + actionMagnify->setMenuText(tr("Zoom &In/Out and Drag Canvas")); + actionMagnify->setToolTip(tr("Zoom In (Shift++) or Out (-) and Drag Canvas")); + + actionMagnifyHor->setMenuText(tr("Zoom/Drag Canvas &Horizontally")); + actionMagnifyVert->setMenuText(tr("Zoom/Drag Canvas &Vertically")); + + actionMagnifyHor->setToolTip(tr("Zoom In/Out and Drag Canvas Horizontally")); + actionMagnifyVert->setToolTip(tr("Zoom In/Out and Drag Canvas Vertically")); + + btnZoomIn->setMenuText(tr("&Zoom In")); + btnZoomIn->setShortcut(tr("Ctrl++")); + btnZoomIn->setToolTip(tr("Zoom In")); + + btnZoomOut->setMenuText(tr("Zoom &Out")); + btnZoomOut->setShortcut(tr("Ctrl+-")); + btnZoomOut->setToolTip(tr("Zoom Out")); + + btnCursor->setMenuText(tr("&Data Reader")); + btnCursor->setShortcut(tr("CTRL+D")); + btnCursor->setToolTip(tr("Data reader")); + + btnSelect->setMenuText(tr("&Select Data Range")); + btnSelect->setShortcut(tr("ALT+S")); + btnSelect->setToolTip(tr("Select data range")); + + btnPicker->setMenuText(tr("S&creen Reader")); + btnPicker->setToolTip(tr("Screen reader")); + + actionDrawPoints->setMenuText(tr("&Draw Data Points")); + actionDrawPoints->setToolTip(tr("Draw Data Points")); + + btnMovePoints->setMenuText(tr("&Move Data Points...")); + btnMovePoints->setShortcut(tr("Ctrl+ALT+M")); + btnMovePoints->setToolTip(tr("Move data points")); + + actionDragCurve->setMenuText(tr("Dra&g Curve")); + actionDragCurve->setToolTip(tr("Drag Curve")); + + btnRemovePoints->setMenuText(tr("Remove &Bad Data Points...")); + btnRemovePoints->setShortcut(tr("Alt+B")); + btnRemovePoints->setToolTip(tr("Remove data points")); + + actionAddText->setMenuText(tr("Add &Text")); + actionAddText->setToolTip(tr("Add Text")); + actionAddText->setShortcut(tr("ALT+T")); + + actionAddFormula->setMenuText(tr("Add E&quation")); + actionAddFormula->setToolTip(tr("Add Equation")); + actionAddFormula->setShortcut( tr("ALT+Q") ); + + actionAddRectangle->setMenuText(tr("Add &Rectangle")); + actionAddRectangle->setToolTip(tr("Add Rectangle")); + actionAddRectangle->setShortcut( tr("CTRL+ALT+R") ); + + actionAddEllipse->setMenuText(tr("Add &Ellipse")); + actionAddEllipse->setToolTip(tr("Add Ellipse/Circle")); + actionAddEllipse->setShortcut( tr("CTRL+ALT+E") ); + + btnArrow->setMenuText(tr("Draw &Arrow")); + btnArrow->setShortcut(tr("CTRL+ALT+A")); + btnArrow->setToolTip(tr("Draw arrow")); + + btnLine->setMenuText(tr("Draw &Line")); + btnLine->setShortcut(tr("CTRL+ALT+L")); + btnLine->setToolTip(tr("Draw line")); + + // FIXME: is setText necessary for action groups? + // coord->setText( tr( "Coordinates" ) ); + // coord->setMenuText( tr( "&Coord" ) ); + // coord->setStatusTip( tr( "Coordinates" ) ); + Box->setText( tr( "Box" ) ); + Box->setMenuText( tr( "Box" ) ); + Box->setToolTip( tr( "Box" ) ); + Box->setStatusTip( tr( "Box" ) ); + Frame->setText( tr( "Frame" ) ); + Frame->setMenuText( tr( "&Frame" ) ); + Frame->setToolTip( tr( "Frame" ) ); + Frame->setStatusTip( tr( "Frame" ) ); + None->setText( tr( "No Axes" ) ); + None->setMenuText( tr( "No Axes" ) ); + None->setToolTip( tr( "No axes" ) ); + None->setStatusTip( tr( "No axes" ) ); + + front->setToolTip( tr( "Front grid" ) ); + back->setToolTip( tr( "Back grid" ) ); + right->setToolTip( tr( "Right grid" ) ); + left->setToolTip( tr( "Left grid" ) ); + ceil->setToolTip( tr( "Ceiling grid" ) ); + floor->setToolTip( tr( "Floor grid" ) ); + + wireframe->setText( tr( "Wireframe" ) ); + wireframe->setMenuText( tr( "Wireframe" ) ); + wireframe->setToolTip( tr( "Wireframe" ) ); + wireframe->setStatusTip( tr( "Wireframe" ) ); + hiddenline->setText( tr( "Hidden Line" ) ); + hiddenline->setMenuText( tr( "Hidden Line" ) ); + hiddenline->setToolTip( tr( "Hidden line" ) ); + hiddenline->setStatusTip( tr( "Hidden line" ) ); + polygon->setText( tr( "Polygon Only" ) ); + polygon->setMenuText( tr( "Polygon Only" ) ); + polygon->setToolTip( tr( "Polygon only" ) ); + polygon->setStatusTip( tr( "Polygon only" ) ); + filledmesh->setText( tr( "Mesh & Filled Polygons" ) ); + filledmesh->setMenuText( tr( "Mesh & Filled Polygons" ) ); + filledmesh->setToolTip( tr( "Mesh & filled Polygons" ) ); + filledmesh->setStatusTip( tr( "Mesh & filled Polygons" ) ); + pointstyle->setText( tr( "Dots" ) ); + pointstyle->setMenuText( tr( "Dots" ) ); + pointstyle->setToolTip( tr( "Dots" ) ); + pointstyle->setStatusTip( tr( "Dots" ) ); + barstyle->setText( tr( "Bars" ) ); + barstyle->setMenuText( tr( "Bars" ) ); + barstyle->setToolTip( tr( "Bars" ) ); + barstyle->setStatusTip( tr( "Bars" ) ); + conestyle->setText( tr( "Cones" ) ); + conestyle->setMenuText( tr( "Cones" ) ); + conestyle->setToolTip( tr( "Cones" ) ); + conestyle->setStatusTip( tr( "Cones" ) ); + crossHairStyle->setText( tr( "Crosshairs" ) ); + crossHairStyle->setMenuText( tr( "Crosshairs" ) ); + crossHairStyle->setToolTip( tr( "Crosshairs" ) ); + crossHairStyle->setStatusTip( tr( "Crosshairs" ) ); + + //floorstyle->setText( tr( "Floor Style" ) ); + //floorstyle->setMenuText( tr( "Floor Style" ) ); + //floorstyle->setStatusTip( tr( "Floor Style" ) ); + floordata->setText( tr( "Floor Data Projection" ) ); + floordata->setMenuText( tr( "Floor Data Projection" ) ); + floordata->setToolTip( tr( "Floor data projection" ) ); + floordata->setStatusTip( tr( "Floor data projection" ) ); + flooriso->setText( tr( "Floor Isolines" ) ); + flooriso->setMenuText( tr( "Floor Isolines" ) ); + flooriso->setToolTip( tr( "Floor isolines" ) ); + flooriso->setStatusTip( tr( "Floor isolines" ) ); + floornone->setText( tr( "Empty Floor" ) ); + floornone->setMenuText( tr( "Empty Floor" ) ); + floornone->setToolTip( tr( "Empty floor" ) ); + floornone->setStatusTip( tr( "Empty floor" ) ); + + actionAnimate->setText( tr( "Animation" ) ); + actionAnimate->setMenuText( tr( "Animation" ) ); + actionAnimate->setToolTip( tr( "Animation" ) ); + actionAnimate->setStatusTip( tr( "Animation" ) ); + + actionPerspective->setText( tr( "Enable perspective" ) ); + actionPerspective->setMenuText( tr( "Enable perspective" ) ); + actionPerspective->setToolTip( tr( "Enable perspective" ) ); + actionPerspective->setStatusTip( tr( "Enable perspective" ) ); + + actionResetRotation->setText( tr( "Reset rotation" ) ); + actionResetRotation->setMenuText( tr( "Reset rotation" ) ); + actionResetRotation->setToolTip( tr( "Reset rotation" ) ); + actionResetRotation->setStatusTip( tr( "Reset rotation" ) ); + + actionFitFrame->setText( tr( "Fit frame to window" ) ); + actionFitFrame->setMenuText( tr( "Fit frame to window" ) ); + actionFitFrame->setToolTip( tr( "Fit frame to window" ) ); + actionFitFrame->setStatusTip( tr( "Fit frame to window" ) ); +} + +Graph3D * ApplicationWindow::plot3DMatrix(Matrix *m, int style) +{ + if (!m) { + m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + } + + QApplication::setOverrideCursor(Qt::WaitCursor); + Graph3D *plot = newPlot3D(); + if(!plot) + return 0; + + plot->addMatrixData(m); + plot->customPlotStyle(style); + plot->setDataColorMap(m->colorMap()); + plot->update(); + + custom3DActions(plot); + emit modified(); + QApplication::restoreOverrideCursor(); + return plot; +} + +MultiLayer* ApplicationWindow::plotGrayScale(Matrix *m) +{ + if (!m) { + m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + } + + return plotSpectrogram(m, Graph::GrayScale); +} + +MultiLayer* ApplicationWindow::plotContour(Matrix *m) +{ + if (!m) { + m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + } + + return plotSpectrogram(m, Graph::Contour); +} + +MultiLayer* ApplicationWindow::plotColorMap(Matrix *m) +{ + if (!m) { + m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + } + + return plotSpectrogram(m, Graph::ColorMap); +} + +MultiLayer* ApplicationWindow::plotImage(Matrix *m) +{ + if (!m) { + m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + } + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + MultiLayer* g = multilayerPlot(generateUniqueName(tr("Graph"))); + Graph* plot = g->activeLayer(); + setPreferences(plot); + Spectrogram *s = plot->plotSpectrogram(m, Graph::GrayScale); + if (!s) + return 0; + + s->setAxis(QwtPlot::xTop, QwtPlot::yLeft); + plot->enableAxis(QwtPlot::xTop, true); + plot->setScale(QwtPlot::xTop, QMIN(m->xStart(), m->xEnd()), QMAX(m->xStart(), m->xEnd())); + plot->setScale(QwtPlot::xBottom, QMIN(m->xStart(), m->xEnd()), QMAX(m->xStart(), m->xEnd())); + plot->enableAxis(QwtPlot::xBottom, false); + plot->enableAxis(QwtPlot::yRight, false); + plot->setScale(QwtPlot::yLeft, QMIN(m->yStart(), m->yEnd()), QMAX(m->yStart(), m->yEnd()), + 0.0, 5, 5, Graph::Linear, true); + plot->setAxisTitle(QwtPlot::yLeft, QString::null); + plot->setAxisTitle(QwtPlot::xTop, QString::null); + plot->setTitle(QString::null); + + g->arrangeLayers(false, true); + + emit modified(); + QApplication::restoreOverrideCursor(); + return g; +} + +MultiLayer* ApplicationWindow::plotSpectrogram(Matrix *m, Graph::CurveType type) +{ + if (type == Graph::ImagePlot) + return plotImage(m); + else if (type == Graph::Histogram) + return plotHistogram(m); + + if (!m) + return 0; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + MultiLayer* g = multilayerPlot(generateUniqueName(tr("Graph"))); + Graph* plot = g->activeLayer(); + setPreferences(plot); + plot->plotSpectrogram(m, type); + g->arrangeLayers(false, true); + QApplication::restoreOverrideCursor(); + return g; +} + +MultiLayer* ApplicationWindow::plotImageProfiles(Matrix *m) +{ + if (!m) { + m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return 0; + } + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + MultiLayer* g = multilayerPlot(generateUniqueName(tr("Profiles")), 0); + g->resize(650, 600); + g->plotProfiles(m); + + Table *horTable = newHiddenTable(tr("Horizontal"), QString::null, m->numCols(), 2); + Table *verTable = newHiddenTable(tr("Vertical"), QString::null, m->numRows(), 2); + + Graph *sg = g->layer(1); + ImageProfilesTool *screener = new ImageProfilesTool(this, sg, m, horTable, verTable, info, SLOT(setText(const QString&))); + sg->setActiveTool(screener); + + if (horTable && g->layer(2)) + g->layer(2)->addCurves(horTable, QStringList(horTable->colName(1))); + + if (verTable && g->layer(3)){ + DataCurve *c = g->layer(3)->insertCurve(verTable, verTable->colName(1), verTable->colName(0), Graph::Line); + if (c){ + c->setAxis(QwtPlot::xTop, QwtPlot::yLeft); + c->setCurveType(QwtPlotCurve::Xfy); + } + } + + QApplication::restoreOverrideCursor(); + return g; +} + +#ifdef OPJ_IMPORT +ApplicationWindow* ApplicationWindow::importOPJ(const QString& filename, bool factorySettings, bool newProject) +{ + if (filename.endsWith(".opj", Qt::CaseInsensitive) || filename.endsWith(".ogg", Qt::CaseInsensitive)) + { + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + ApplicationWindow *app = this; + if (newProject) + app = new ApplicationWindow(factorySettings); + + app->setWindowTitle("QtiPlot - " + filename); + app->restoreApplicationGeometry(); + app->projectname = filename; + app->updateRecentProjectsList(filename); + + ImportOPJ(app, filename); + + QApplication::restoreOverrideCursor(); + return app; + } + else if (filename.endsWith(".ogm", Qt::CaseInsensitive) || filename.endsWith(".ogw", Qt::CaseInsensitive)) + { + ImportOPJ(this, filename); + updateRecentProjectsList(filename); + return this; + } + return 0; +} +#endif + +void ApplicationWindow::deleteFitTables() +{ + QList* mLst = new QList(); + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("MultiLayer")) + mLst->append(w); + } + + foreach(QWidget *ml, *mLst){ + if (ml->isA("MultiLayer")){ + QList layers = ((MultiLayer*)ml)->layersList(); + foreach(Graph *g, layers){ + QList curves = g->fitCurvesList(); + foreach(QwtPlotCurve *c, curves){ + if (((PlotCurve *)c)->type() != Graph::Function){ + Table *t = ((DataCurve *)c)->table(); + if (!t) + continue; + + t->askOnCloseEvent(false); + t->close(); + } + } + } + } + } + delete mLst; +} + +QList ApplicationWindow::windowsList() +{ + QList lst; + + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows) + lst << w; + f = f->folderBelow(); + } + return lst; +} + +void ApplicationWindow::updateRecentProjectsList(const QString& fn) +{ + QString nativeFileName = QDir::toNativeSeparators(fn); + if (!nativeFileName.isEmpty()){ + recentProjects.removeAll(nativeFileName); + recentProjects.push_front(nativeFileName); + } + + if (recentProjects.isEmpty()) + return; + + while ((int)recentProjects.size() > MaxRecentProjects) + recentProjects.pop_back(); + + recent->clear(); + + for (int i = 0; i<(int)recentProjects.size(); i++ ) + recent->insertItem("&" + QString::number(i+1) + " " + QDir::toNativeSeparators(recentProjects[i])); +} + +void ApplicationWindow::translateCurveHor() +{ + translateCurve(TranslateCurveTool::Horizontal); +} + +void ApplicationWindow::translateCurve(TranslateCurveTool::Direction direction) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setChecked(true); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (!g) + return; + + if (g->isPiePlot()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("This functionality is not available for pie plots!")); + + btnPointer->setChecked(true); + return; + } else if (g->validCurvesDataSize()) { + btnPointer->setChecked(true); + g->setActiveTool(new TranslateCurveTool(g, this, direction, info, SLOT(setText(const QString&)))); + displayBar->show(); + } +} + +void ApplicationWindow::setReadOnlyCol() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + QStringList list = t->selectedColumns(); + for (int i=0; i<(int) list.count(); i++) + t->setReadOnlyColumn(t->colIndex(list[i]), actionReadOnlyCol->isChecked()); +} + +void ApplicationWindow::setReadOnlyColumns() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + QStringList list = t->selectedColumns(); + for (int i=0; i<(int) list.count(); i++) + t->setReadOnlyColumn(t->colIndex(list[i])); +} + +void ApplicationWindow::setReadWriteColumns() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + QStringList list = t->selectedColumns(); + for (int i=0; i<(int) list.count(); i++) + t->setReadOnlyColumn(t->colIndex(list[i]), false); +} + +void ApplicationWindow::setAscValues() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + t->setAscValues(); +} + +void ApplicationWindow::setRandomValues() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + t->setRandomValues(); +} + +void ApplicationWindow::setXErrCol() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + t->setPlotDesignation(Table::xErr); +} + +void ApplicationWindow::setYErrCol() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + t->setPlotDesignation(Table::yErr); +} + +void ApplicationWindow::setXCol() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + t->setPlotDesignation(Table::X); +} + +void ApplicationWindow::setYCol() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + t->setPlotDesignation(Table::Y); +} + +void ApplicationWindow::setZCol() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + t->setPlotDesignation(Table::Z); +} + +void ApplicationWindow::setLabelCol() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + t->setPlotDesignation(Table::Label); +} + +void ApplicationWindow::disregardCol() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + t->setPlotDesignation(Table::None); +} + +void ApplicationWindow::fitMultiPeakGauss() +{ + fitMultiPeak((int)MultiPeakFit::Gauss); +} + +void ApplicationWindow::fitMultiPeakLorentz() +{ + fitMultiPeak((int)MultiPeakFit::Lorentz); +} + +void ApplicationWindow::fitMultiPeak(int profile) +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setChecked(true); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + return; + + if (g->isPiePlot()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("This functionality is not available for pie plots!")); + return; + } else { + bool ok; + int peaks = QInputDialog::getInteger(tr("QtiPlot - Enter the number of peaks"), + tr("Peaks"), 2, 2, 1000000, 1, &ok, this); + if (ok && peaks){ + g->setActiveTool(new MultiPeakFitTool(g, this, (MultiPeakFit::PeakProfile)profile, peaks, info, SLOT(setText(const QString&)))); + displayBar->show(); + } + } +} + +void ApplicationWindow::subtractStraightLine() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + if (plot->isEmpty()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("

There are no plot layers available in this window.

" + "

Please add a layer and try again!

")); + btnPointer->setChecked(true); + return; + } + + Graph* g = (Graph*)plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + return; + + if (g->isPiePlot()){ + QMessageBox::warning(this,tr("QtiPlot - Warning"), + tr("This functionality is not available for pie plots!")); + return; + } else { + g->setActiveTool(new SubtractLineTool(g, this, info, SLOT(setText(const QString&)))); + displayBar->show(); + } +} + +void ApplicationWindow::subtractReferenceData() +{ + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (!plot) + return; + + Graph* g = plot->activeLayer(); + if (!g || !g->validCurvesDataSize()) + return; + + SubtractDataDialog *sdd = new SubtractDataDialog(this); + sdd->setGraph(g); + sdd->exec(); +} + +void ApplicationWindow::showSupportPage() +{ + QDesktopServices::openUrl(QUrl("http://soft.proindependent.com/contracts.html")); +} + + +void ApplicationWindow::showDonationsPage() +{ + QDesktopServices::openUrl(QUrl("http://soft.proindependent.com/why_donate.html")); +} + +void ApplicationWindow::downloadManual() +{ + QDesktopServices::openUrl(QUrl("http://soft.proindependent.com/manuals.html")); +} + +void ApplicationWindow::downloadTranslation() +{ + QDesktopServices::openUrl(QUrl("http://soft.proindependent.com/translations.html")); +} + +void ApplicationWindow::showHomePage() +{ + QDesktopServices::openUrl(QUrl("http://www.qtiplot.ro")); +} + +void ApplicationWindow::showForums() +{ + QDesktopServices::openUrl(QUrl("https://developer.berlios.de/forum/?group_id=6626")); +} + +void ApplicationWindow::showBugTracker() +{ + QDesktopServices::openUrl(QUrl("https://developer.berlios.de/bugs/?group_id=6626")); +} + +#ifdef QTIPLOT_SUPPORT +void ApplicationWindow::showDonationDialog() +{ + QString s = tr("QtiPlot is open-source software and its development required hundreds of hours of work.

\ + If you like it, you're using it in your work and you would like to see it \ + constantly improved, please support its authors by making a donation.
"); + + QMessageBox *msg = new QMessageBox(this); + msg->setText(s); + msg->setWindowTitle(tr("Please support QtiPlot!")); + QPushButton *btn = msg->addButton(tr("Make a donation"), QMessageBox::AcceptRole); + msg->addButton(tr("Close"), QMessageBox::RejectRole); + msg->exec(); + if (msg->clickedButton() == btn) + showDonationsPage(); +} +#endif + +void ApplicationWindow::parseCommandLineArguments(const QStringList& args) +{ + int num_args = args.count(); + if(num_args == 0){ + initWindow(); + return; + } + + QString str; + bool exec = false; + bool noGui = false; + bool default_settings = false; + bool console = false; + foreach(str, args){ + if( (str == "-a" || str == "--about") || + (str == "-m" || str == "--manual") ){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr(" %1 : This command line option must be used without other arguments!").arg(str)); + } else if (str == "-c" || str == "--console") { + d_mdi_windows_area = false; + showScriptWindow(false); + setScriptingLanguage("Python"); + hide(); + console = true; + } + else if( (str == "-d" || str == "--default-settings")) + default_settings = true; + else if (str == "-v" || str == "--version"){ + QString s = versionString() + "\n"; + s += QString(copyright_string) + "\n"; + s += tr("Released") + ": " + release_date + "\n"; + #ifdef Q_OS_WIN + hide(); + QMessageBox::information(this, tr("QtiPlot") + " - " + tr("Version"), s); + #else + std::wcout << s.toStdWString(); + #endif + exit(0); + } + else if (str == "-h" || str == "--help"){ + QString s = "\n" + tr("Usage") + ": "; + s += "qtiplot [" + tr("options") + "] [" + tr("file") + "_" + tr("name") + "]\n\n"; + s += tr("Valid options are") + ":\n"; + s += "-a " + tr("or") + " --about: " + tr("show about dialog and exit") + "\n"; + s += "-c " + tr("or") + " --console: " + tr("show standalone scripting window") + "\n"; + s += "-d " + tr("or") + " --default-settings: " + tr("start QtiPlot with the default settings") + "\n"; + s += "-h " + tr("or") + " --help: " + tr("show command line options") + "\n"; + s += "-l=XX " + tr("or") + " --lang=XX: " + tr("start QtiPlot in language") + " XX ('en', 'fr', 'de', ...)\n"; + s += "-m " + tr("or") + " --manual: " + tr("show QtiPlot manual in a standalone window") + "\n"; + s += "-v " + tr("or") + " --version: " + tr("print QtiPlot version and release date") + "\n"; + s += "-x " + tr("or") + " --execute: " + tr("execute the script file given as argument") + "\n"; + s += "-X: " + tr("execute the script file given as argument without displying the user interface. Warning: 2D plots are not correctly handled in this functioning mode!") + "\n\n"; + s += "'" + tr("file") + "_" + tr("name") + "' " + tr("can be any .qti, qti.gz, .ods, .opj, .ogm, .ogw, .ogg, .py, .xls or ASCII file") + "\n"; + #ifdef Q_OS_WIN + hide(); + QMessageBox::information(this, tr("QtiPlot") + " - " + tr("Help"), s); + #else + std::wcout << s.toStdWString(); + #endif + exit(0); + } + else if (str.startsWith("--lang=") || str.startsWith("-l=")){ + QString locale = str.mid(str.find('=')+1); + if (locales.contains(locale)) + switchToLanguage(locale); + + if (!locales.contains(locale)) + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr(" %1 : Wrong locale option or no translation available!").arg(locale)); + } + else if (str.startsWith("--execute") || str.startsWith("-x")) + exec = true; + else if (str.startsWith("-X")) + noGui = true; + else if (str.startsWith("-") || str.startsWith("--")){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr(" %1 unknown command line option!").arg(str) + "\n" + tr("Type %1 to see the list of the valid options.").arg("'qtiplot -h'")); + } + } + + QString file_name = args[num_args-1]; // last argument + if(file_name.startsWith("-")){// no file name given + if (console) + return; + + initWindow(); + return; + } + + savedProject(); + + if (!file_name.isEmpty()){ + QFileInfo fi(file_name); + if (fi.isDir()){ + QMessageBox::critical(this, tr("QtiPlot - File openning error"), + tr("%1 is a directory, please specify a file name!").arg(file_name)); + return; + } else if (!fi.exists()){ + QMessageBox::critical(this, tr("QtiPlot - File openning error"), + tr("The file: %1 doesn't exist!").arg(file_name)); + return; + } else if (fi.exists() && !fi.isReadable()){ + QMessageBox::critical(this, tr("QtiPlot - File openning error"), + tr("You don't have the permission to open this file: %1").arg(file_name)); + return; + } + + workingDir = fi.dirPath(true); + saveSettings();//the recent projects must be saved + + if (console){ + scriptWindow->open(file_name); + if (exec) + scriptWindow->executeAll(); + } else if (exec || noGui) + loadScript(file_name, exec, noGui); + else { + ApplicationWindow *app = open(file_name, default_settings); + if (app && app != this) + close(); + } + } +} + +void ApplicationWindow::createLanguagesList() +{ + locales.clear(); + + appTranslator = new QTranslator(this); + qtTranslator = new QTranslator(this); + qApp->installTranslator(appTranslator); + qApp->installTranslator(qtTranslator); + + QString qmPath = d_translations_folder; + QDir dir(qmPath); + QStringList fileNames = dir.entryList("qtiplot_*.qm"); + for (int i=0; i < (int)fileNames.size(); i++) + { + QString locale = fileNames[i]; + locale = locale.mid(locale.find('_')+1); + locale.truncate(locale.find('.')); + locales.push_back(locale); + } + locales.push_back("en"); + locales.sort(); + + if (appLanguage != "en") + { + appTranslator->load("qtiplot_" + appLanguage, qmPath); + qtTranslator->load("qt_" + appLanguage, qmPath+"/qt"); + } +} + +void ApplicationWindow::switchToLanguage(int param) +{ + if (param < (int)locales.size()) + switchToLanguage(locales[param]); +} + +void ApplicationWindow::switchToLanguage(const QString& locale) +{ + if (!locales.contains(locale) || appLanguage == locale) + return; + + appLanguage = locale; + if (locale == "en") + { + qApp->removeTranslator(appTranslator); + qApp->removeTranslator(qtTranslator); + delete appTranslator; + delete qtTranslator; + appTranslator = new QTranslator(this); + qtTranslator = new QTranslator(this); + qApp->installTranslator(appTranslator); + qApp->installTranslator(qtTranslator); + } + else + { + QString qmPath = d_translations_folder; + appTranslator->load("qtiplot_" + locale, qmPath); + qtTranslator->load("qt_" + locale, qmPath+"/qt"); + } + insertTranslatedStrings(); +} + +QStringList ApplicationWindow::matrixNames() +{ + QStringList names; + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->isA("Matrix")) + names << w->objectName(); + } + f = f->folderBelow(); + } + return names; +} + +bool ApplicationWindow::alreadyUsedName(const QString& label) +{ + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->objectName() == label) + return true; + } + f = f->folderBelow(); + } + return false; +} + +bool ApplicationWindow::projectHas2DPlots() +{ + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->isA("MultiLayer")) + return true; + } + f = f->folderBelow(); + } + return false; +} + +void ApplicationWindow::appendProject() +{ + OpenProjectDialog *open_dialog = new OpenProjectDialog(this, false); + open_dialog->setDirectory(workingDir); + open_dialog->setExtensionWidget(0); + open_dialog->selectNameFilter(d_open_project_filter); + if (open_dialog->exec() != QDialog::Accepted || open_dialog->selectedFiles().isEmpty()) + return; + workingDir = open_dialog->directory().path(); + appendProject(open_dialog->selectedFiles()[0]); +} + +Folder* ApplicationWindow::appendProject(const QString& fn, Folder* parentFolder) +{ + if (fn.isEmpty()) + return 0; + + QFileInfo fi(fn); + workingDir = fi.dirPath(true); + + if (fn.endsWith(".qti") || fn.endsWith(".opj", Qt::CaseInsensitive) || fn.endsWith(".ogm", Qt::CaseInsensitive) || + fn.endsWith(".ogw", Qt::CaseInsensitive) || fn.endsWith(".ogg", Qt::CaseInsensitive) || + fn.endsWith(".xls", Qt::CaseInsensitive) || fn.endsWith(".ods", Qt::CaseInsensitive)){ + QFileInfo f(fn); + if (!f.exists ()){ + QMessageBox::critical(this, tr("QtiPlot - File opening error"), tr("The file: %1 doesn't exist!").arg(fn)); + return 0; + } + } else { + QMessageBox::critical(this,tr("QtiPlot - File opening error"), tr("The file: %1 is not a QtiPlot or Origin project file!").arg(fn)); + return 0; + } + + d_is_appending_file = true; + + if (fn != projectname) + updateRecentProjectsList(fn); + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QString fname = fn; + if (fn.contains(".qti.gz")){//decompress using zlib + file_uncompress((char *)fname.ascii()); + fname.remove(".gz"); + } + + Folder *cf = current_folder; + if (parentFolder) + changeFolder(parentFolder, true); + + FolderListItem *item = (FolderListItem *)current_folder->folderListItem(); + folders->blockSignals (true); + blockSignals (true); + + QString baseName = fi.baseName(); + QStringList lst = current_folder->subfolders(); + int n = lst.count(baseName); + if (n){//avoid identical subfolder names + while (lst.count(baseName + QString::number(n))) + n++; + baseName += QString::number(n); + } + + Folder *new_folder; + if (parentFolder) + new_folder = new Folder(parentFolder, baseName); + else + new_folder = new Folder(current_folder, baseName); + + current_folder = new_folder; + FolderListItem *fli = new FolderListItem(item, current_folder); + current_folder->setFolderListItem(fli); + +#ifdef OPJ_IMPORT + if (fn.contains(".opj", Qt::CaseInsensitive) || fn.contains(".ogm", Qt::CaseInsensitive) || + fn.contains(".ogw", Qt::CaseInsensitive) || fn.contains(".ogg", Qt::CaseInsensitive)) + ImportOPJ(this, fn); + else +#endif + if (fn.endsWith(".xls", Qt::CaseInsensitive)) + importExcel(fn); + else if (fn.endsWith(".ods", Qt::CaseInsensitive)) + importOdfSpreadsheet(fn); + else { + QFile f(fname); + QTextStream t( &f ); + t.setEncoding(QTextStream::UnicodeUTF8); + f.open(QIODevice::ReadOnly); + + QString s = t.readLine(); + lst = s.split(QRegExp("\\s"), QString::SkipEmptyParts); + QString version = lst[1]; + lst = version.split(".", QString::SkipEmptyParts); + d_file_version =100*(lst[0]).toInt()+10*(lst[1]).toInt()+(lst[2]).toInt(); + + t.readLine(); + if (d_file_version < 73) + t.readLine(); + + //process tables and matrix information + while ( !t.atEnd()){ + s = t.readLine(); + lst.clear(); + if (s.left(8) == ""){ + lst = s.split("\t"); + Folder *f = new Folder(current_folder, lst[1]); + f->setBirthDate(lst[2]); + f->setModificationDate(lst[3]); + if(lst.count() > 4) + if (lst[4] == "current") + cf = f; + + FolderListItem *fli = new FolderListItem(current_folder->folderListItem(), f); + fli->setText(0, lst[1]); + f->setFolderListItem(fli); + + current_folder = f; + }else if (s == "
"){ + while ( s!="
" ){ + s=t.readLine(); + lst<"){ + while ( s != "" ){ + s=t.readLine(); + lst<"){ + for (int i=0; i<3; i++){ + s = t.readLine(); + lst << s; + } + Note* m = openNote(this, lst); + QStringList cont; + while ( s != "" ){ + s = t.readLine(); + cont << s; + } + cont.pop_back(); + m->restore(cont); + } else if (s == "") + goToParentFolder(); + } + f.close(); + + //process the rest + f.open(QIODevice::ReadOnly); + + MultiLayer *plot=0; + while ( !t.atEnd()){ + s=t.readLine(); + if (s.left(8) == ""){ + lst = s.split("\t"); + if (current_folder && lst.size() >= 2) + current_folder = current_folder->findSubfolder(lst[1]); + }else if (s == ""){//process multilayers information + s=t.readLine(); + QStringList graph=s.split("\t"); + QString caption=graph[0]; + plot = multilayerPlot(caption, 0, graph[2].toInt(), graph[1].toInt()); + setListViewDate(caption, graph[3]); + plot->setBirthDate(graph[3]); + plot->blockSignals(true); + + restoreWindowGeometry(this, plot, t.readLine()); + + if (d_file_version > 71){ + QStringList lst = t.readLine().split("\t"); + if (lst.size() >= 3){ + plot->setWindowLabel(lst[1]); + plot->setCaptionPolicy((MdiSubWindow::CaptionPolicy)lst[2].toInt()); + } + } + + if (d_file_version > 83){ + QStringList lst=t.readLine().split("\t", QString::SkipEmptyParts); + plot->setMargins(lst[1].toInt(),lst[2].toInt(),lst[3].toInt(),lst[4].toInt()); + lst=t.readLine().split("\t", QString::SkipEmptyParts); + plot->setSpacing(lst[1].toInt(),lst[2].toInt()); + lst=t.readLine().split("\t", QString::SkipEmptyParts); + plot->setLayerCanvasSize(lst[1].toInt(),lst[2].toInt()); + lst=t.readLine().split("\t", QString::SkipEmptyParts); + plot->setAlignement(lst[1].toInt(),lst[2].toInt()); + } + + while ( s != "" ){//open layers + s = t.readLine(); + if (s.contains("")){ + QStringList lst = s.trimmed().remove("").remove("").split(","); + if (lst.size() >= 2) + plot->setWaterfallOffset(lst[0].toInt(), lst[1].toInt()); + if (lst.size() >= 3) + plot->setWaterfallSideLines(lst[2].toInt()); + plot->createWaterfallBox(); + } + if (s.left(7) == ""){ + lst.clear(); + while ( s != "" ){ + s = t.readLine(); + lst << s; + } + openGraph(this, plot, lst); + } + if (s.contains("")) + plot->linkXLayerAxes(s.trimmed().remove("").remove("").toInt()); + else if (s.contains("")) + plot->setAlignPolicy((MultiLayer::AlignPolicy)s.trimmed().remove("").remove("").toInt()); + } + plot->blockSignals(false); + }else if (s == ""){//process 3D plots information + lst.clear(); + while ( s!="" ){ + s = t.readLine(); + lst<") + goToParentFolder(); + } + f.close(); + } + + folders->blockSignals (false); + //change folder to user defined current folder + changeFolder(cf); + blockSignals (false); + renamedTables = QStringList(); + QApplication::restoreOverrideCursor(); + d_is_appending_file = false; + return new_folder; +} + +#ifdef QTIPLOT_DEMO +void ApplicationWindow::showDemoVersionMessage() +{ + saved = true; + QMessageBox::critical(this, tr("QtiPlot - Demo Version"), + tr("You are using the demonstration version of Qtiplot.\ + It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session.\ +

\ + If you want to have ready-to-use, fully functional binaries, please subscribe for a\ + single-user binaries maintenance contract.\ +

\ + QtiPlot is free software in the sense of free speech.\ + If you know how to use it, you can get\ + the source code\ + free of charge.\ + Nevertheless, you are welcome to\ + make a donation\ + in order to support the further development of QtiPlot.")); +} +#endif + +void ApplicationWindow::saveFolder(Folder *folder, const QString& fn, bool compress) +{ + QFile f( fn ); + if (d_backup_files && f.exists()) + {// make byte-copy of current file so that there's always a copy of the data on disk + while (!f.open(QIODevice::ReadOnly)){ + if (f.isOpen()) + f.close(); + int choice = QMessageBox::warning(this, tr("QtiPlot - File backup error"), + tr("Cannot make a backup copy of %1 (to %2).
If you ignore this, you run the risk of data loss.").arg(projectname).arg(projectname+"~"), + QMessageBox::Retry|QMessageBox::Default, QMessageBox::Abort|QMessageBox::Escape, QMessageBox::Ignore); + if (choice == QMessageBox::Abort) + return; + if (choice == QMessageBox::Ignore) + break; + } + + if (f.isOpen()){ + QString bfn = fn + "~"; + QFile::remove(bfn);//remove any existing backup + QFile::copy(fn, bfn); + f.close(); + } + } + + if ( !f.open( QIODevice::WriteOnly ) ){ + QMessageBox::about(this, tr("QtiPlot - File save error"), tr("The file:
%1 is opened in read-only mode").arg(fn)); + return; + } + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QList lst = folder->windowsList(); + int windows = lst.count(); + int initial_depth = folder->depth(); + Folder *dir = folder->folderBelow(); + while (dir && dir->depth() > initial_depth){ + windows += dir->windowsList().count(); + dir = dir->folderBelow(); + } + + QTextStream t( &f ); + t.setEncoding(QTextStream::UnicodeUTF8); + t << "QtiPlot " + QString::number(maj_version) + "." + QString::number(min_version) + "."+ + QString::number(patch_version) + " project file\n"; + t << "\t" + QString(scriptEnv->name()) + "\n"; + t << "\t" + QString::number(windows) + "\n"; + f.close(); + + foreach(MdiSubWindow *w, lst) + w->save(fn, windowGeometryInfo(w)); + + initial_depth = folder->depth(); + dir = folder->folderBelow(); + while (dir && dir->depth() > initial_depth){ + if (!f.isOpen()) + f.open(QIODevice::Append); + + t << "\t" + QString(dir->objectName()) + "\t" + dir->birthDate() + "\t" + dir->modificationDate(); + if (dir == current_folder) + t << "\tcurrent\n"; + else + t << "\n"; // FIXME: Having no 5th string here is not a good idea + t << "" + QString::number(dir->folderListItem()->isOpen()) + "\n"; + f.close(); + + lst = dir->windowsList(); + foreach(MdiSubWindow *w, lst) + w->save(fn, windowGeometryInfo(w)); + + if (!f.isOpen()) + f.open(QIODevice::Append); + + if (!dir->logInfo().isEmpty() ) + t << "\n" + dir->logInfo() + "\n" ; + + if ( (dir->children()).isEmpty() ) + t << "\n"; + + int depth = dir->depth(); + dir = dir->folderBelow(); + if (dir){ + int next_dir_depth = dir->depth(); + if (next_dir_depth < depth){ + int diff = depth - next_dir_depth; + for (int i = 0; i < diff; i++) + t << "
\n"; + } + } else { + int diff = depth - initial_depth - 1; + for (int i = 0; i < diff; i++) + t << "\n"; + } + } + + if (!f.isOpen()) + f.open(QIODevice::Append); + + t << "" + QString::number(folder->folderListItem()->isOpen()) + "\n"; + if (!folder->logInfo().isEmpty()) + t << "\n" + folder->logInfo() + "" ; + + f.close(); + + if (compress) + file_compress((char *)fn.ascii(), "wb9"); + + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::saveAsProject() +{ + saveFolderAsProject(current_folder); +} + +void ApplicationWindow::saveFolderAsProject(Folder *f) +{ +#ifdef QTIPLOT_DEMO + showDemoVersionMessage(); + return; +#endif + QString filter = tr("QtiPlot project")+" (*.qti);;"; + filter += tr("Compressed QtiPlot project")+" (*.qti.gz)"; + + QString selectedFilter; + QString fn = getFileName(this, tr("Save project as"), workingDir, filter, &selectedFilter, true, d_confirm_overwrite); + if ( !fn.isEmpty() ){ + QFileInfo fi(fn); + workingDir = fi.dirPath(true); + QString baseName = fi.fileName(); + if (!baseName.contains(".")) + fn.append(".qti"); + + saveFolder(f, fn, selectedFilter.contains(".gz")); + } +} + +void ApplicationWindow::showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, int) +{ + showFolderPopupMenu(it, p, true); +} + +void ApplicationWindow::showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, bool fromFolders) +{ + if (!it || folders->isRenaming()) + return; + + QMenu cm(this); + QMenu window(this); + QMenu viewWindowsMenu(this); + viewWindowsMenu.setCheckable ( true ); + + cm.addAction(actionFindWindow); + cm.insertSeparator(); + cm.addAction(actionAppendProject); + if (((FolderListItem *)it)->folder()->parent()) + cm.insertItem(QIcon(":/filesaveas.png"), tr("Save &As Project..."), this, SLOT(saveAsProject())); + else + cm.addAction(actionSaveProjectAs); + cm.insertSeparator(); + + if (fromFolders && show_windows_policy != HideAll) + { + cm.insertItem(tr("&Show All Windows"), this, SLOT(showAllFolderWindows())); + cm.insertItem(tr("&Hide All Windows"), this, SLOT(hideAllFolderWindows())); + cm.insertSeparator(); + } + + if (((FolderListItem *)it)->folder()->parent()) + { + cm.insertItem(QPixmap(":/close.png"), tr("&Delete Folder"), this, SLOT(deleteFolder()), Qt::Key_F8); + cm.insertItem(tr("&Rename"), this, SLOT(startRenameFolder()), Qt::Key_F2); + cm.insertSeparator(); + } + + if (fromFolders) + { + window.addAction(actionNewTable); + window.addAction(actionNewMatrix); + window.addAction(actionNewNote); + window.addAction(actionNewGraph); + window.addAction(actionNewFunctionPlot); + window.addAction(actionNewSurfacePlot); + cm.insertItem(tr("New &Window"), &window); + } + + cm.addAction(actionNewFolder); + cm.insertSeparator(); + + QStringList lst; + lst << tr("&None") << tr("&Windows in Active Folder") << tr("Windows in &Active Folder && Subfolders"); + for (int i = 0; i < 3; ++i) + { + int id = viewWindowsMenu.insertItem(lst[i],this, SLOT( setShowWindowsPolicy( int ) ) ); + viewWindowsMenu.setItemParameter( id, i ); + viewWindowsMenu.setItemChecked( id, show_windows_policy == i ); + } + cm.insertItem(tr("&View Windows"), &viewWindowsMenu); + cm.insertSeparator(); + cm.insertItem(tr("&Properties..."), this, SLOT(folderProperties())); + cm.exec(p); +} + +void ApplicationWindow::setShowWindowsPolicy(int p) +{ + if (show_windows_policy == (ShowWindowsPolicy)p) + return; + + show_windows_policy = (ShowWindowsPolicy)p; + if (show_windows_policy == HideAll){ + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + hiddenWindows->append(w); + w->hide(); + setListView(w->objectName(), tr("Hidden")); + } + } else + showAllFolderWindows(); +} + +void ApplicationWindow::showFindDialogue() +{ + FindDialog *fd = new FindDialog(this); + fd->exec(); +} + +void ApplicationWindow::startRenameFolder() +{ + FolderListItem *fi = current_folder->folderListItem(); + if (!fi) + return; + + disconnect(folders, SIGNAL(currentChanged(Q3ListViewItem *)), this, SLOT(folderItemChanged(Q3ListViewItem *))); + fi->setRenameEnabled (0, true); + fi->startRename (0); +} + +void ApplicationWindow::startRenameFolder(Q3ListViewItem *item) +{ + if (!item || item == folders->firstChild()) + return; + + if (item->listView() == lv && item->rtti() == FolderListItem::RTTI) { + disconnect(folders, SIGNAL(currentChanged(Q3ListViewItem *)), this, SLOT(folderItemChanged(Q3ListViewItem *))); + current_folder = ((FolderListItem *)item)->folder(); + FolderListItem *it = current_folder->folderListItem(); + it->setRenameEnabled (0, true); + it->startRename (0); + } else { + item->setRenameEnabled (0, true); + item->startRename (0); + } +} + +void ApplicationWindow::renameFolder(Q3ListViewItem *it, int col, const QString &text) +{ + Q_UNUSED(col) + + if (!it) + return; + + Folder *parent = (Folder *)current_folder->parent(); + if (!parent)//the parent folder is the project folder (it always exists) + parent = projectFolder(); + + while(text.isEmpty()){ + QMessageBox::critical(this,tr("QtiPlot - Error"), tr("Please enter a valid name!")); + it->setRenameEnabled (0, false); + it->setText(0, ((FolderListItem*)it)->folder()->objectName()); + return; + } + + QStringList lst = parent->subfolders(); + lst.remove(current_folder->objectName()); + while(lst.contains(text)){ + QMessageBox::critical(this,tr("QtiPlot - Error"), + tr("Name already exists!")+"\n"+tr("Please choose another name!")); + + it->setRenameEnabled (0, false); + it->setText(0, ((FolderListItem*)it)->folder()->objectName()); + return; + } + + current_folder->setObjectName(text); + it->setRenameEnabled (0, false); + connect(folders, SIGNAL(currentChanged(Q3ListViewItem *)), + this, SLOT(folderItemChanged(Q3ListViewItem *))); + folders->setCurrentItem(parent->folderListItem());//update the list views +} + +void ApplicationWindow::showAllFolderWindows() +{ + QList lst = current_folder->windowsList(); + foreach(MdiSubWindow *w, lst) + {//force show all windows in current folder + if (w) + { + updateWindowLists(w); + switch (w->status()) + { + case MdiSubWindow::Hidden: + w->showNormal(); + break; + + case MdiSubWindow::Normal: + w->showNormal(); + break; + + case MdiSubWindow::Minimized: + w->showMinimized(); + break; + + case MdiSubWindow::Maximized: + w->showMaximized(); + break; + } + } + } + + if ( (current_folder->children()).isEmpty() ) + return; + + FolderListItem *fi = current_folder->folderListItem(); + FolderListItem *item = (FolderListItem *)fi->firstChild(); + int initial_depth = item->depth(); + while (item && item->depth() >= initial_depth) + {// show/hide windows in all subfolders + lst = ((Folder *)item->folder())->windowsList(); + foreach(MdiSubWindow *w, lst){ + if (w && show_windows_policy == SubFolders){ + updateWindowLists(w); + switch (w->status()) + { + case MdiSubWindow::Hidden: + w->showNormal(); + break; + + case MdiSubWindow::Normal: + w->showNormal(); + break; + + case MdiSubWindow::Minimized: + w->showMinimized(); + break; + + case MdiSubWindow::Maximized: + w->showMaximized(); + break; + } + } + else + w->hide(); + } + + item = (FolderListItem *)item->itemBelow(); + } +} + +void ApplicationWindow::hideAllFolderWindows() +{ + QList lst = current_folder->windowsList(); + foreach(MdiSubWindow *w, lst) + hideWindow(w); + + if ( (current_folder->children()).isEmpty() ) + return; + + if (show_windows_policy == SubFolders) + { + FolderListItem *fi = current_folder->folderListItem(); + FolderListItem *item = (FolderListItem *)fi->firstChild(); + int initial_depth = item->depth(); + while (item && item->depth() >= initial_depth) + { + lst = item->folder()->windowsList(); + foreach(MdiSubWindow *w, lst) + hideWindow(w); + + item = (FolderListItem *)item->itemBelow(); + } + } +} + +void ApplicationWindow::projectProperties() +{ + QString s = QString(current_folder->objectName()) + "\n\n"; + s += "\n\n\n"; + s += tr("Type") + ": " + tr("Project")+"\n\n"; + if (projectname != "untitled") + { + s += tr("Path") + ": " + projectname + "\n\n"; + + QFileInfo fi(projectname); + s += tr("Size") + ": " + QString::number(fi.size()) + " " + tr("bytes")+ "\n\n"; + } + + s += tr("Contents") + ": " + QString::number(windowsList().size()) + " " + tr("windows"); + s += ", " + QString::number(current_folder->subfolders().count()) + " " + tr("folders") + "\n\n"; + s += "\n\n\n"; + + if (projectname != "untitled") + { + QFileInfo fi(projectname); + s += tr("Created") + ": " + fi.created().toString(Qt::LocalDate) + "\n\n"; + s += tr("Modified") + ": " + fi.lastModified().toString(Qt::LocalDate) + "\n\n"; + } + else + s += tr("Created") + ": " + current_folder->birthDate() + "\n\n"; + + QMessageBox *mbox = new QMessageBox ( tr("Properties"), s, QMessageBox::NoIcon, + QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton, this); + + mbox->setIconPixmap(QPixmap(":/qtiplot_logo.png" )); + mbox->show(); +} + +void ApplicationWindow::folderProperties() +{ + if (!current_folder->parent()) + { + projectProperties(); + return; + } + + QString s = QString(current_folder->objectName()) + "\n\n"; + s += "\n\n\n"; + s += tr("Type") + ": " + tr("Folder")+"\n\n"; + s += tr("Path") + ": " + current_folder->path() + "\n\n"; + s += tr("Size") + ": " + current_folder->sizeToString() + "\n\n"; + s += tr("Contents") + ": " + QString::number(current_folder->windowsList().count()) + " " + tr("windows"); + s += ", " + QString::number(current_folder->subfolders().count()) + " " + tr("folders") + "\n\n"; + //s += "\n\n\n"; + s += tr("Created") + ": " + current_folder->birthDate() + "\n\n"; + //s += tr("Modified") + ": " + current_folder->modificationDate() + "\n\n"; + + QMessageBox *mbox = new QMessageBox ( tr("Properties"), s, QMessageBox::NoIcon, + QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton, this); + + mbox->setIconPixmap(QPixmap(":/folder_open.png" )); + mbox->show(); +} + +void ApplicationWindow::addFolder() +{ + if (!explorerWindow->isVisible()) + explorerWindow->show(); + + QStringList lst = current_folder->subfolders(); + QString name = tr("New Folder"); + lst = lst.grep( name ); + if (!lst.isEmpty()) + name += " ("+ QString::number(lst.size()+1)+")"; + + Folder *f = new Folder(current_folder, name); + addFolderListViewItem(f); + + FolderListItem *fi = new FolderListItem(current_folder->folderListItem(), f); + if (fi){ + f->setFolderListItem(fi); + fi->setRenameEnabled (0, true); + fi->startRename(0); + } +} + +Folder* ApplicationWindow::addFolder(QString name, Folder* parent) +{ + if(!parent){ + if (current_folder) + parent = current_folder; + else + parent = projectFolder(); + } + + QStringList lst = parent->subfolders(); + lst = lst.grep( name ); + if (!lst.isEmpty()) + name += " ("+ QString::number(lst.size()+1)+")"; + + Folder *f = new Folder(parent, name); + addFolderListViewItem(f); + + FolderListItem *fi = new FolderListItem(parent->folderListItem(), f); + if (fi) + f->setFolderListItem(fi); + + return f; +} + +bool ApplicationWindow::deleteFolder(Folder *f) +{ + if (!f) + return false; + + if (confirmCloseFolder && QMessageBox::information(this, tr("QtiPlot - Delete folder?"), + tr("Delete folder '%1' and all the windows it contains?").arg(f->objectName()), + tr("Yes"), tr("No"), 0, 0)) + return false; + else { + Folder *parent = projectFolder(); + if (current_folder){ + if (current_folder->parent()) + parent = (Folder *)current_folder->parent(); + } + + folders->blockSignals(true); + + FolderListItem *fi = f->folderListItem(); + foreach(MdiSubWindow *w, f->windowsList()){ + w->askOnCloseEvent(false); + closeWindow(w); + } + + if (!(f->children()).isEmpty()){ + Folder *subFolder = f->folderBelow(); + int initial_depth = f->depth(); + while (subFolder && subFolder->depth() > initial_depth){ + foreach(MdiSubWindow *w, subFolder->windowsList()){ + removeWindowFromLists(w); + subFolder->removeWindow(w); + delete w; + } + delete subFolder->folderListItem(); + delete subFolder; + + subFolder = f->folderBelow(); + } + } + + delete f; + delete fi; + + current_folder = parent; + folders->setCurrentItem(parent->folderListItem()); + changeFolder(parent, true); + + folders->blockSignals(false); + folders->setFocus(); + return true; + } +} + +void ApplicationWindow::deleteFolder() +{ + Folder *parent = (Folder *)current_folder->parent(); + if (!parent) + parent = projectFolder(); + + folders->blockSignals(true); + + if (deleteFolder(current_folder)){ + current_folder = parent; + folders->setCurrentItem(parent->folderListItem()); + changeFolder(parent, true); + } + + folders->blockSignals(false); + folders->setFocus(); +} + +void ApplicationWindow::folderItemDoubleClicked(Q3ListViewItem *it) +{ + if (!it || it->rtti() != FolderListItem::RTTI) + return; + + FolderListItem *item = ((FolderListItem *)it)->folder()->folderListItem(); + folders->setCurrentItem(item); +} + +void ApplicationWindow::folderItemChanged(Q3ListViewItem *it) +{ + if (!it) + return; + + it->setOpen(true); + changeFolder (((FolderListItem *)it)->folder()); + folders->setFocus(); +} + +void ApplicationWindow::hideFolderWindows(Folder *f) +{ + if (!f) + return; + + QList lst = f->windowsList(); + foreach(MdiSubWindow *w, lst) + w->hide(); + + if ((f->children()).isEmpty()) + return; + + Folder *dir = f->folderBelow(); + int initial_depth = f->depth(); + while (dir && dir->depth() > initial_depth){ + lst = dir->windowsList(); + foreach(MdiSubWindow *w, lst) + w->hide(); + + dir = dir->folderBelow(); + } +} + +void ApplicationWindow::goToParentFolder() +{ + if (current_folder && current_folder->parent()) + current_folder = (Folder *)current_folder->parent(); + else + current_folder = projectFolder(); +} + +bool ApplicationWindow::changeFolder(Folder *newFolder, bool force) +{ + if (!newFolder) + return false; + + if (current_folder == newFolder && !force) + return false; + + disconnect(d_workspace, SIGNAL(subWindowActivated(QMdiSubWindow *)), + this, SLOT(windowActivated(QMdiSubWindow*))); + + desactivateFolders(); + newFolder->folderListItem()->setActive(true); + + Folder *oldFolder = current_folder; + MdiSubWindow::Status old_active_window_state = MdiSubWindow::Normal; + MdiSubWindow *old_active_window = oldFolder->activeWindow(); + if (old_active_window) + old_active_window_state = old_active_window->status(); + + MdiSubWindow::Status active_window_state = MdiSubWindow::Normal; + MdiSubWindow *active_window = newFolder->activeWindow(); + + if (active_window) + active_window_state = active_window->status(); + + hideFolderWindows(oldFolder); + current_folder = newFolder; + + results->setText(current_folder->logInfo()); + + lv->clear(); + + QObjectList folderLst = newFolder->children(); + if(!folderLst.isEmpty()){ + foreach(QObject *f, folderLst) + addFolderListViewItem(static_cast(f)); + } + + QList lst = newFolder->windowsList(); + foreach(MdiSubWindow *w, lst){ + if (!hiddenWindows->contains(w) && show_windows_policy != HideAll){ + //show only windows in the current folder which are not hidden by the user + if(w->status() == MdiSubWindow::Normal) + w->showNormal(); + else if(w->status() == MdiSubWindow::Minimized) + w->showMinimized(); + else if(w->status() == MdiSubWindow::Maximized) + w->showMaximized(); + } else + w->setStatus(MdiSubWindow::Hidden); + + addListViewItem(w); + } + + if (!(newFolder->children()).isEmpty()){ + Folder *f = newFolder->folderBelow(); + int initial_depth = newFolder->depth(); + while (f && f->depth() > initial_depth){//show/hide windows in subfolders + lst = f->windowsList(); + foreach(MdiSubWindow *w, lst){ + if (!hiddenWindows->contains(w)){ + if (show_windows_policy == SubFolders){ + if (w->status() == MdiSubWindow::Normal || w->status() == MdiSubWindow::Maximized) + w->showNormal(); + else if (w->status() == MdiSubWindow::Minimized) + w->showMinimized(); + } else + w->hide(); + } + } + f = f->folderBelow(); + } + } + + if (active_window){ + d_active_window = active_window; + d_workspace->setActiveSubWindow(active_window); + + if (active_window_state == MdiSubWindow::Minimized) + active_window->showMinimized();//ws->setActiveWindow() makes minimized windows to be shown normally + else if (active_window_state == MdiSubWindow::Maximized){ + if (active_window->isA("Graph3D")) + ((Graph3D *)active_window)->setIgnoreFonts(true); + active_window->showMaximized(); + if (active_window->isA("Graph3D")) + ((Graph3D *)active_window)->setIgnoreFonts(false); + } + } else + d_active_window = (MdiSubWindow *)d_workspace->activeSubWindow(); + + customMenu(d_active_window); + customToolBars(d_active_window); + + if (old_active_window){ + old_active_window->setStatus(old_active_window_state); + oldFolder->setActiveWindow(old_active_window); + } + + connect(d_workspace, SIGNAL(subWindowActivated(QMdiSubWindow *)), + this, SLOT(windowActivated(QMdiSubWindow*))); + + if (!d_opening_file) + modifiedProject(); + return true; +} + +void ApplicationWindow::desactivateFolders() +{ + FolderListItem *item = (FolderListItem *)folders->firstChild(); + while (item){ + item->setActive(false); + item = (FolderListItem *)item->itemBelow(); + } +} + +void ApplicationWindow::addListViewItem(MdiSubWindow *w) +{ + if (!w) + return; + + WindowListItem* it = new WindowListItem(lv, w); + if (w->isA("Matrix")){ + it->setPixmap(0, QPixmap(":/matrix.png")); + it->setText(1, tr("Matrix")); + } + else if (w->inherits("Table")){ + it->setPixmap(0, QPixmap(":/worksheet.png")); + it->setText(1, tr("Table")); + } + else if (w->isA("Note")){ + it->setPixmap(0, QPixmap(":/note.png")); + it->setText(1, tr("Note")); + } + else if (w->isA("MultiLayer")){ + it->setPixmap(0, QPixmap(":/graph.png")); + it->setText(1, tr("Graph")); + } + else if (w->isA("Graph3D")){ + it->setPixmap(0, QPixmap(":/trajectory.png")); + it->setText(1, tr("3D Graph")); + } + + it->setText(0, w->objectName()); + it->setText(2, w->aspect()); + it->setText(3, w->sizeToString()); + it->setText(4, w->birthDate()); + it->setText(5, w->windowLabel().replace("\n", " ")); + + updateCompleter(w->objectName()); +} + +void ApplicationWindow::windowProperties() +{ + WindowListItem *it = (WindowListItem *)lv->currentItem(); + MdiSubWindow *w = it->window(); + if (!w) + return; + + QMessageBox *mbox = new QMessageBox ( tr("Properties"), QString(), QMessageBox::NoIcon, + QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton, this); + + QString s = QString(w->objectName()) + "\n\n"; + s += "\n\n\n"; + + s += tr("Label") + ": " + ((MdiSubWindow *)w)->windowLabel() + "\n\n"; + + if (w->isA("Matrix")){ + mbox->setIconPixmap(QPixmap(":/matrix.png")); + s += tr("Type") + ": " + tr("Matrix") + "\n\n"; + }else if (w->inherits("Table")){ + mbox->setIconPixmap(QPixmap(":/worksheet.png")); + s += tr("Type") + ": " + tr("Table") + "\n\n"; + }else if (w->isA("Note")){ + mbox->setIconPixmap(QPixmap(":/note.png")); + s += tr("Type") + ": " + tr("Note") + "\n\n"; + }else if (w->isA("MultiLayer")){ + mbox->setIconPixmap(QPixmap(":/graph.png")); + s += tr("Type") + ": " + tr("Graph") + "\n\n"; + }else if (w->isA("Graph3D")){ + mbox->setIconPixmap(QPixmap(":/trajectory.png")); + s += tr("Type") + ": " + tr("3D Graph") + "\n\n"; + } + s += tr("Path") + ": " + current_folder->path() + "\n\n"; + s += tr("Size") + ": " + w->sizeToString() + "\n\n"; + s += tr("Created") + ": " + w->birthDate() + "\n\n"; + s += tr("Status") + ": " + it->text(2) + "\n\n"; + mbox->setText(s); + mbox->show(); +} + +void ApplicationWindow::addFolderListViewItem(Folder *f) +{ + if (!f) + return; + + FolderListItem* it = new FolderListItem(lv, f); + it->setActive(false); + it->setText(0, f->objectName()); + it->setText(1, tr("Folder")); + it->setText(3, f->sizeToString()); + it->setText(4, f->birthDate()); +} + +void ApplicationWindow::find(const QString& s, bool windowNames, bool labels, + bool folderNames, bool caseSensitive, bool partialMatch, bool subfolders) +{ + if (windowNames || labels){ + MdiSubWindow *w = current_folder->findWindow(s, windowNames, labels, caseSensitive, partialMatch); + if (w){ + activateWindow(w); + return; + } + + if (subfolders){ + FolderListItem *item = (FolderListItem *)folders->currentItem()->firstChild(); + while (item){ + Folder *f = item->folder(); + MdiSubWindow *w = f->findWindow(s,windowNames,labels,caseSensitive,partialMatch); + if (w){ + folders->setCurrentItem(f->folderListItem()); + activateWindow(w); + return; + } + item = (FolderListItem *)item->itemBelow(); + } + } + } + + if (folderNames){ + Folder *f = current_folder->findSubfolder(s, caseSensitive, partialMatch); + if (f){ + folders->setCurrentItem(f->folderListItem()); + return; + } + + if (subfolders){ + FolderListItem *item = (FolderListItem *)folders->currentItem()->firstChild(); + while (item){ + Folder *f = item->folder()->findSubfolder(s, caseSensitive, partialMatch); + if (f){ + folders->setCurrentItem(f->folderListItem()); + return; + } + + item = (FolderListItem *)item->itemBelow(); + } + } + } + + QMessageBox::warning(this, tr("QtiPlot - No match found"), + tr("Sorry, no match found for string: '%1'").arg(s)); +} + +void ApplicationWindow::dropFolderItems(Q3ListViewItem *dest) +{ + if (!dest || draggedItems.isEmpty ()) + return; + + Folder *dest_f = ((FolderListItem *)dest)->folder(); + + Q3ListViewItem *it; + QStringList subfolders = dest_f->subfolders(); + + foreach(it, draggedItems){ + if (it->rtti() == FolderListItem::RTTI){ + Folder *f = ((FolderListItem *)it)->folder(); + FolderListItem *src = f->folderListItem(); + if (dest_f == f){ + QMessageBox::critical(this, "QtiPlot - Error", tr("Cannot move an object to itself!")); + return; + } + + if (((FolderListItem *)dest)->isChildOf(src)){ + QMessageBox::critical(this,"QtiPlot - Error",tr("Cannot move a parent folder into a child folder!")); + draggedItems.clear(); + folders->setCurrentItem(current_folder->folderListItem()); + return; + } + + Folder *parent = (Folder *)f->parent(); + if (!parent) + parent = projectFolder(); + if (dest_f == parent) + return; + + if (subfolders.contains(f->objectName())){ + QMessageBox::critical(this, tr("QtiPlot") +" - " + tr("Skipped moving folder"), + tr("The destination folder already contains a folder called '%1'! Folder skipped!").arg(f->objectName())); + } else + moveFolder(src, (FolderListItem *)dest); + } else { + if (dest_f == current_folder) + return; + + hideFolderWindows(current_folder); + + MdiSubWindow *w = ((WindowListItem *)it)->window(); + if (w){ + current_folder->removeWindow(w); + w->hide(); + dest_f->addWindow(w); + dest_f->setActiveWindow(w); + delete it; + } + } + } + + draggedItems.clear(); + current_folder = dest_f; + folders->setCurrentItem(dest_f->folderListItem()); + changeFolder(dest_f, true); + folders->setFocus(); +} + +void ApplicationWindow::moveFolder(FolderListItem *src, FolderListItem *dest) +{ + folders->blockSignals(true); + if (copyFolder(src->folder(), dest->folder())){ + delete src->folder(); + delete src; + } + folders->blockSignals(false); +} + +bool ApplicationWindow::copyFolder(Folder *src, Folder *dest) +{ + if (!src || !dest) + return false; + + if (dest->subfolders().contains(src->objectName())){ + QMessageBox::critical(this, tr("QtiPlot") + " - " + tr("Error"), + tr("The destination folder already contains a folder called '%1'! Folder skipped!").arg(src->objectName())); + return false; + } + + Folder *dest_f = new Folder(dest, src->objectName()); + dest_f->setBirthDate(src->birthDate()); + dest_f->setModificationDate(src->modificationDate()); + + FolderListItem *copy_item = new FolderListItem(dest->folderListItem(), dest_f); + copy_item->setText(0, src->objectName()); + copy_item->setOpen(src->folderListItem()->isOpen()); + dest_f->setFolderListItem(copy_item); + + QList lst = QList(src->windowsList()); + foreach(MdiSubWindow *w, lst) + dest_f->addWindow(w); + + if (!(src->children()).isEmpty()){ + int initial_depth = src->depth(); + Folder *parentFolder = dest_f; + src = src->folderBelow(); + while (src && parentFolder && src->depth() > initial_depth){ + dest_f = new Folder(parentFolder, src->objectName()); + dest_f->setBirthDate(src->birthDate()); + dest_f->setModificationDate(src->modificationDate()); + + copy_item = new FolderListItem(parentFolder->folderListItem(), dest_f); + copy_item->setText(0, src->objectName()); + copy_item->setOpen(src->folderListItem()->isOpen()); + dest_f->setFolderListItem(copy_item); + + lst = QList(src->windowsList()); + foreach(MdiSubWindow *w, lst) + dest_f->addWindow(w); + + int depth = src->depth(); + src = src->folderBelow(); + if (src){ + int next_folder_depth = src->depth(); + if (next_folder_depth > depth) + parentFolder = dest_f; + else if (next_folder_depth < depth && next_folder_depth > initial_depth) + parentFolder = (Folder*)parentFolder->parent(); + } + } + } + return true; +} + +void ApplicationWindow::searchForUpdates() +{ + int choice = QMessageBox::question(this, tr("QtiPlot"), + tr("QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet!") + "\n" + + tr("Do you wish to continue?"), + QMessageBox::Yes|QMessageBox::Default, QMessageBox::No|QMessageBox::Escape); + + if (choice == QMessageBox::Yes){ + version_buffer.open(IO_WriteOnly); + http = new QHttp(this); + connect(http, SIGNAL(done(bool)), this, SLOT(receivedVersionFile(bool))); + + QNetworkProxy proxy = QNetworkProxy::applicationProxy(); + if (!proxy.hostName().isEmpty()) + http->setProxy(proxy.hostName(), proxy.port(), proxy.user(), proxy.password()); + + http->setHost("soft.proindependent.com"); + http->get("/version.txt", &version_buffer); + } +} + +void ApplicationWindow::receivedVersionFile(bool error) +{ + if (error){ + QMessageBox::warning(this, tr("QtiPlot - HTTP get version file"), + tr("Error while fetching version file with HTTP: %1.").arg(http->errorString())); + return; + } + + version_buffer.close(); + if (version_buffer.open(IO_ReadOnly)){ + QTextStream t( &version_buffer ); + t.setEncoding(QTextStream::UnicodeUTF8); + QString version = t.readLine(); + version_buffer.close(); + + QString currentVersion = QString::number(maj_version) + "." + QString::number(min_version) + + "." + QString::number(patch_version) + QString(extra_version); + + if (currentVersion != version){ + if(QMessageBox::question(this, tr("QtiPlot - Updates Available"), + tr("There is a newer version of QtiPlot (%1) available for download. Would you like to download it?").arg(version), + QMessageBox::Yes|QMessageBox::Default, QMessageBox::No|QMessageBox::Escape) == QMessageBox::Yes) + QDesktopServices::openUrl(QUrl("http://soft.proindependent.com/download.html")); + } else if (!autoSearchUpdatesRequest){ + QMessageBox::information(this, tr("QtiPlot - No Updates Available"), + tr("No updates available. Your current version %1 is the last version available!").arg(version)); + } + autoSearchUpdatesRequest = false; + } + http->abort(); + delete http; +} + +/*! + Turns 3D animation on or off + */ +void ApplicationWindow::toggle3DAnimation(bool on) +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->animate(on); +} + +QString ApplicationWindow::generateUniqueName(const QString& name, bool increment) +{ + int index = 0; + QStringList lst; + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + lst << QString(w->objectName()); + if (QString(w->objectName()).startsWith(name)) + index++; + } + f = f->folderBelow(); + } + + QString newName = name; + if (increment)//force return of a different name + newName += QString::number(++index); + else if (index>0) + newName += QString::number(index); + + while(lst.contains(newName)) + newName = name + QString::number(++index); + + return newName; +} + +void ApplicationWindow::clearTable() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + if (QMessageBox::question(this, tr("QtiPlot - Warning"), + tr("This will clear the contents of all the data associated with the table. Are you sure?"), + tr("&Yes"), tr("&No"), QString(), 0, 1 ) ) + return; + else + t->clear(); +} + +void ApplicationWindow::goToRow() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + if (!w->inherits("Table") && !w->isA("Matrix")) + return; + + int rows = 0; + if (w->inherits("Table")) + rows = ((Table *)w)->numRows(); + else if (w->isA("Matrix")) + rows = ((Matrix *)w)->numRows(); + + bool ok; + int row = QInputDialog::getInteger(this, tr("QtiPlot - Enter row number"), tr("Row"), + 1, 1, rows, 1, &ok, windowFlags() & ~Qt::WindowContextHelpButtonHint & ~Qt::WindowMinMaxButtonsHint ); + if ( !ok ) + return; + + if (w->inherits("Table")) + ((Table *)w)->goToRow(row); + else if (w->isA("Matrix")) + ((Matrix *)w)->goToRow(row); +} + +void ApplicationWindow::goToColumn() +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return; + if (!w->inherits("Table") && !w->isA("Matrix")) + return; + + int columns = 0; + if (w->inherits("Table")) + columns = ((Table *)w)->numCols(); + else if (w->isA("Matrix")) + columns = ((Matrix *)w)->numCols(); + + bool ok; + int col = QInputDialog::getInt (this, tr("QtiPlot - Enter column number"), tr("Column"), + 1, 1, columns, 1, &ok, windowFlags() & ~Qt::WindowContextHelpButtonHint & ~Qt::WindowMinMaxButtonsHint ); + if ( !ok ) + return; + + if (w->inherits("Table")) + ((Table *)w)->goToColumn(col); + else if (w->isA("Matrix")) + ((Matrix *)w)->goToColumn(col); +} + +void ApplicationWindow::showScriptWindow(bool parent) +{ + if (!scriptWindow){ + scriptWindow = new ScriptWindow(scriptEnv, this); + if (d_completion && d_completer) + scriptWindow->editor()->setCompleter(d_completer); + scriptWindow->showLineNumbers(d_note_line_numbers); + scriptWindow->editor()->setTabStopWidth(d_notes_tab_length); + scriptWindow->editor()->setCurrentFont(d_notes_font); + scriptWindow->resize(d_script_win_rect.size()); + scriptWindow->move(d_script_win_rect.topLeft()); + connect(scriptWindow, SIGNAL(visibilityChanged(bool)), actionShowScriptWindow, SLOT(setOn(bool))); + } + + if (!parent) + scriptWindow->setAttribute(Qt::WA_DeleteOnClose); + + if (!scriptWindow->isVisible()){ + Qt::WindowFlags flags = 0; + if (d_script_win_on_top) + flags |= Qt::WindowStaysOnTopHint; + scriptWindow->setWindowFlags(flags); + scriptWindow->show(); + scriptWindow->setFocus(); + } else + scriptWindow->hide(); +} + +/*! + Turns perspective mode on or off + */ +void ApplicationWindow::togglePerspective(bool on) +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setOrthogonal(!on); +} + +/*! + Resets rotation of 3D plots to default values + */ +void ApplicationWindow::resetRotation() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->setRotation(30, 0, 15); +} + +/*! + Finds best layout for the 3D plot + */ +void ApplicationWindow::fitFrameToLayer() +{ + Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); + if (!g) + return; + + g->findBestLayout(); +} + +ApplicationWindow::~ApplicationWindow() +{ + disableTools();//avoids crash if a plot tol is still active + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + MultiLayer *ml = qobject_cast(w); + if (ml && ml->hasSelectedLayers()) + delete ml; + } + + delete hiddenWindows; + + if (scriptWindow) + scriptWindow->close(); + + if (d_text_editor) + delete d_text_editor; + + QApplication::clipboard()->clear(QClipboard::Clipboard); + QApplication::restoreOverrideCursor(); +} + +QString ApplicationWindow::versionString() +{ + return "QtiPlot " + QString::number(maj_version) + "." + + QString::number(min_version) + "." + QString::number(patch_version) + extra_version; +} + + +int ApplicationWindow::convertOldToNewColorIndex(int cindex) +{ + if( (cindex == 13) || (cindex == 14) ) // white and light gray + return cindex + 4; + + if(cindex == 15) // dark gray + return cindex + 8; + + return cindex; +} + +void ApplicationWindow::cascade() +{ + const int xoffset = 13; + const int yoffset = 20; + int x = 0; + int y = 0; + QList windows = d_workspace->subWindowList(QMdiArea::StackingOrder); + foreach (QMdiSubWindow *w, windows){ + if (!w->isVisible()) + continue; + + w->setActiveWindow(); + ((MdiSubWindow *)w)->setNormal(); + w->setGeometry(x, y, w->geometry().width(), w->geometry().height()); + w->raise(); + x += xoffset; + y += yoffset; + } + modifiedProject(); +} + +ApplicationWindow * ApplicationWindow::loadScript(const QString& fn, bool execute, bool noGui) +{ +#ifdef SCRIPTING_PYTHON + if (noGui){ + hide(); + setScriptingLanguage("Python"); + + ScriptEdit *se = new ScriptEdit(scriptEnv, this); + se->importASCII(fn); + se->executeAll(); + + exit(0); + } else { + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + setScriptingLanguage("Python"); + restoreApplicationGeometry(); + + showScriptWindow(); + scriptWindow->open(fn); + + QApplication::restoreOverrideCursor(); + + if (execute){ + scriptWindow->hide(); + scriptWindow->executeAll(); + if (scriptWindow->editor()->error()) + showScriptWindow(); + } + return this; + } +#else + QMessageBox::critical(this, tr("QtiPlot") + " - " + tr("Error"), + tr("QtiPlot was not built with Python scripting support included!")); +#endif + return 0; +} + +bool ApplicationWindow::validFor2DPlot(Table *table, Graph::CurveType type) +{ + if (!table->selectedYColumns().count()){ + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select a Y column to plot!")); + return false; + } else if (type != Graph::Box && type != Graph::Histogram && type != Graph::Pie){ + if (table->numCols() < 2) { + QMessageBox::critical(this, tr("QtiPlot - Error"),tr("You need at least two columns for this operation!")); + return false; + } else if (table->noXColumn()) { + QMessageBox::critical(this, tr("QtiPlot - Error"), tr("Please set a default X column for this table, first!")); + return false; + } + } + return true; +} + +MultiLayer* ApplicationWindow::generate2DGraph(Graph::CurveType type) +{ + MdiSubWindow *w = activeWindow(); + if (!w) + return 0; + + if (w->inherits("Table")){ + Table *table = static_cast(w); + if (!validFor2DPlot(table, type)) + return 0; + + Q3TableSelection sel = table->getSelection(); + return multilayerPlot(table, table->drawableColumnSelection(), type, sel.topRow(), sel.bottomRow()); + } else if (w->isA("Matrix")){ + Matrix *m = static_cast(w); + return plotHistogram(m); + } + return 0; +} + +bool ApplicationWindow::validFor3DPlot(Table *table) +{ + if (table->numCols()<2){ + QMessageBox::critical(0,tr("QtiPlot - Error"),tr("You need at least two columns for this operation!")); + return false; + } + if (table->selectedColumn() < 0 || table->colPlotDesignation(table->selectedColumn()) != Table::Z){ + QMessageBox::critical(0,tr("QtiPlot - Error"),tr("Please select a Z column for this operation!")); + return false; + } + if (table->noXColumn()){ + QMessageBox::critical(0,tr("QtiPlot - Error"),tr("You need to define a X column first!")); + return false; + } + if (table->noYColumn()){ + QMessageBox::critical(0,tr("QtiPlot - Error"),tr("You need to define a Y column first!")); + return false; + } + return true; +} + +void ApplicationWindow::hideSelectedWindows() +{ + Q3ListViewItem *item; + QList lst; + for (item = lv->firstChild(); item; item = item->nextSibling()){ + if (item->isSelected()) + lst.append(item); + } + + folders->blockSignals(true); + foreach(item, lst){ + if (item->rtti() != FolderListItem::RTTI) + hideWindow(((WindowListItem *)item)->window()); + } + folders->blockSignals(false); +} + +void ApplicationWindow::showSelectedWindows() +{ + Q3ListViewItem *item; + QList lst; + for (item = lv->firstChild(); item; item = item->nextSibling()){ + if (item->isSelected()) + lst.append(item); + } + + folders->blockSignals(true); + foreach(item, lst){ + if (item->rtti() != FolderListItem::RTTI) + activateWindow(((WindowListItem *)item)->window()); + } + folders->blockSignals(false); +} + +void ApplicationWindow::swapColumns() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + QStringList lst = t->selectedColumns(); + if(lst.count() != 2) + return; + + t->swapColumns(t->colIndex(lst[0]), t->colIndex(lst[1])); +} + +void ApplicationWindow::moveColumnRight() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (t) + t->moveColumnBy(1); +} + +void ApplicationWindow::moveColumnLeft() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (t) + t->moveColumnBy(-1); +} + +void ApplicationWindow::moveColumnFirst() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (t) + t->moveColumnBy(-t->selectedColumn()); +} + +void ApplicationWindow::moveColumnLast() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (t) + t->moveColumnBy(t->numCols() - t->selectedColumn() - 1); +} + +void ApplicationWindow::adjustColumnWidth() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (t) + t->adjustColumnsWidth(); +} + +void ApplicationWindow::moveTableRowUp() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (t) + t->moveRow(); +} + +void ApplicationWindow::moveTableRowDown() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (t) + t->moveRow(false); +} + +void ApplicationWindow::restoreApplicationGeometry() +{ + if (d_app_rect.isNull()) + showMaximized(); + else { + resize(d_app_rect.size()); + move(d_app_rect.topLeft()); + show(); + } +} + +void ApplicationWindow::scriptsDirPathChanged(const QString& path) +{ + scriptsDirPath = path; + + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->isA("Note")) + ((Note*)w)->setDirPath(path); + } +} + +void ApplicationWindow::showToolBarsMenu() +{ + QMenu toolBarsMenu; + + QAction *actionFileTools = new QAction(fileTools->windowTitle(), this); + actionFileTools->setCheckable(true); + actionFileTools->setChecked(fileTools->isVisible()); + connect(actionFileTools, SIGNAL(toggled(bool)), fileTools, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionFileTools); + + QAction *actionEditTools = new QAction(editTools->windowTitle(), this); + actionEditTools->setCheckable(true); + actionEditTools->setChecked(editTools->isVisible()); + connect(actionEditTools, SIGNAL(toggled(bool)), editTools, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionEditTools); + + QAction *actionNoteTools = new QAction(noteTools->windowTitle(), this); + actionNoteTools->setCheckable(true); + actionNoteTools->setChecked(noteTools->isVisible()); + connect(actionNoteTools, SIGNAL(toggled(bool)), noteTools, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionNoteTools); + + QAction *actionTableTools = new QAction(tableTools->windowTitle(), this); + actionTableTools->setCheckable(true); + actionTableTools->setChecked(tableTools->isVisible()); + connect(actionTableTools, SIGNAL(toggled(bool)), tableTools, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionTableTools); + + QAction *actionColumnTools = new QAction(columnTools->windowTitle(), this); + actionColumnTools->setCheckable(true); + actionColumnTools->setChecked(columnTools->isVisible()); + connect(actionColumnTools, SIGNAL(toggled(bool)), columnTools, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionColumnTools); + + QAction *actionPlotTools = new QAction(plotTools->windowTitle(), this); + actionPlotTools->setCheckable(true); + actionPlotTools->setChecked(plotTools->isVisible()); + connect(actionPlotTools, SIGNAL(toggled(bool)), plotTools, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionPlotTools); + + QAction *actionMatrixTools = new QAction(plotMatrixBar->windowTitle(), this); + actionMatrixTools->setCheckable(true); + actionMatrixTools->setChecked(plotMatrixBar->isVisible()); + connect(actionMatrixTools, SIGNAL(toggled(bool)), plotMatrixBar, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionMatrixTools); + + QAction *actionPlot3DTools = new QAction(plot3DTools->windowTitle(), this); + actionPlot3DTools->setCheckable(true); + actionPlot3DTools->setChecked(plot3DTools->isVisible()); + connect(actionPlot3DTools, SIGNAL(toggled(bool)), plot3DTools, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionPlot3DTools); + + QAction *actionDisplayBar = new QAction(displayBar->windowTitle(), this); + actionDisplayBar->setCheckable(true); + actionDisplayBar->setChecked(displayBar->isVisible()); + connect(actionDisplayBar, SIGNAL(toggled(bool)), displayBar, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionDisplayBar); + + QAction *actionFormatToolBar = new QAction(formatToolBar->windowTitle(), this); + actionFormatToolBar->setCheckable(true); + actionFormatToolBar->setChecked(formatToolBar->isVisible()); + connect(actionFormatToolBar, SIGNAL(toggled(bool)), formatToolBar, SLOT(setVisible(bool))); + toolBarsMenu.addAction(actionFormatToolBar); + + QAction *action = toolBarsMenu.exec(QCursor::pos()); + if (!action) + return; + + MdiSubWindow *w = activeWindow(); + + if (action->text() == plotMatrixBar->windowTitle()){ + d_matrix_tool_bar = action->isChecked(); + plotMatrixBar->setEnabled(w && w->isA("Matrix")); + } else if (action->text() == tableTools->windowTitle()){ + d_table_tool_bar = action->isChecked(); + tableTools->setEnabled(w && w->inherits("Table")); + } else if (action->text() == columnTools->windowTitle()){ + d_column_tool_bar = action->isChecked(); + columnTools->setEnabled(w && w->inherits("Table")); + } else if (action->text() == plotTools->windowTitle()){ + d_plot_tool_bar = action->isChecked(); + plotTools->setEnabled(w && w->isA("MultiLayer")); + } else if (action->text() == plot3DTools->windowTitle()){ + d_plot3D_tool_bar = action->isChecked(); + plot3DTools->setEnabled(w && w->isA("Graph3D")); + } else if (action->text() == fileTools->windowTitle()){ + d_file_tool_bar = action->isChecked(); + } else if (action->text() == editTools->windowTitle()){ + d_edit_tool_bar = action->isChecked(); + } else if (action->text() == displayBar->windowTitle()){ + d_display_tool_bar = action->isChecked(); + } else if (action->text() == formatToolBar->windowTitle()){ + d_format_tool_bar = action->isChecked(); + } else if (action->text() == noteTools->windowTitle()){ + d_notes_tool_bar = action->isChecked(); + } +} + +void ApplicationWindow::saveFitFunctions(const QStringList& lst) +{ + if (!lst.count()) + return; + + QString explain = tr("Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location."); + explain += " " + tr("If you want to save your already defined models, please choose a destination folder."); + if (QMessageBox::Ok != QMessageBox::information(this, tr("QtiPlot") + " - " + tr("Import fit models"), explain, + QMessageBox::Ok, QMessageBox::Cancel)) return; + + QString dir = QFileDialog::getExistingDirectory(this, tr("Choose a directory to export the fit models to"), fitModelsPath, QFileDialog::ShowDirsOnly); + if (!dir.isEmpty()){ + fitModelsPath = dir; + + for (int i = 0; isetFormula(l[1]); + + fit->save(fitModelsPath + "/" + fit->objectName() + ".fit"); + } + } + } +} + +void ApplicationWindow::matrixDirectFFT() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + m->fft(); +} + +void ApplicationWindow::matrixInverseFFT() +{ + Matrix* m = (Matrix*)activeWindow(MatrixWindow); + if (!m) + return; + + m->fft(true); +} + +void ApplicationWindow::setFormatBarFont(const QFont& font) +{ + formatToolBar->setEnabled(true); + + QFontComboBox *fb = (QFontComboBox *)formatToolBar->widgetForAction(actionFontBox); + fb->blockSignals(true); + fb->setCurrentFont(font); + fb->blockSignals(false); + fb->setEnabled(true); + + QSpinBox *sb = (QSpinBox *)formatToolBar->widgetForAction(actionFontSize); + sb->blockSignals(true); + sb->setValue(font.pointSize()); + sb->blockSignals(false); + sb->setEnabled(true); + + actionFontBold->blockSignals(true); + actionFontBold->setChecked(font.bold()); + actionFontBold->blockSignals(false); + + actionFontItalic->blockSignals(true); + actionFontItalic->setChecked(font.italic()); + actionFontItalic->blockSignals(false); + + actionSubscript->setEnabled(false); + actionSuperscript->setEnabled(false); + actionUnderline->setEnabled(false); + actionGreekSymbol->setEnabled(false); + actionGreekMajSymbol->setEnabled(false); + actionMathSymbol->setEnabled(false); +} + +void ApplicationWindow::setFontSize(int size) +{ + QFontComboBox *fb = (QFontComboBox *)formatToolBar->widgetForAction(actionFontBox); + QFont f(fb->currentFont().family(), size); + f.setBold(actionFontBold->isChecked()); + f.setItalic(actionFontItalic->isChecked()); + + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (plot){ + Graph* g = plot->activeLayer(); + if (g) + g->setCurrentFont(f); + } + + Note *n = (Note *)activeWindow(NoteWindow); + if (n){ + d_notes_font = f; + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + Note *m = qobject_cast(w); + if (m) + m->setFont(f); + } + } +} + +void ApplicationWindow::setFontFamily(const QFont& font) +{ + QSpinBox *sb = (QSpinBox *)formatToolBar->widgetForAction(actionFontSize); + QFont f(font.family(), sb->value()); + f.setBold(actionFontBold->isChecked()); + f.setItalic(actionFontItalic->isChecked()); + + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (plot){ + Graph* g = plot->activeLayer(); + if (g) + g->setCurrentFont(f); + } + + Note *n = (Note *)activeWindow(NoteWindow); + if (n){ + d_notes_font = f; + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + Note *m = qobject_cast(w); + if (m) + m->setFont(f); + } + } +} + +void ApplicationWindow::setItalicFont(bool italic) +{ + QFontComboBox *fb = (QFontComboBox *)formatToolBar->widgetForAction(actionFontBox); + QSpinBox *sb = (QSpinBox *)formatToolBar->widgetForAction(actionFontSize); + QFont f(fb->currentFont().family(), sb->value()); + f.setBold(actionFontBold->isChecked()); + f.setItalic(italic); + + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (plot){ + Graph* g = plot->activeLayer(); + if (g) + g->setCurrentFont(f); + } + + Note *n = (Note *)activeWindow(NoteWindow); + if (n){ + d_notes_font = f; + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + Note *m = qobject_cast(w); + if (m) + m->setFont(f); + } + } +} + +void ApplicationWindow::setBoldFont(bool bold) +{ + QFontComboBox *fb = (QFontComboBox *)formatToolBar->widgetForAction(actionFontBox); + QSpinBox *sb = (QSpinBox *)formatToolBar->widgetForAction(actionFontSize); + QFont f(fb->currentFont().family(), sb->value()); + f.setBold(bold); + f.setItalic(actionFontItalic->isChecked()); + + MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); + if (plot){ + Graph* g = plot->activeLayer(); + if (g) + g->setCurrentFont(f); + } + + Note *n = (Note *)activeWindow(NoteWindow); + if (n){ + d_notes_font = f; + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows){ + Note *m = qobject_cast(w); + if (m) + m->setFont(f); + } + } +} + +void ApplicationWindow::enableTextEditor(Graph *g) +{ + if (!g){ + formatToolBar->setEnabled(false); + if (d_text_editor){ + d_text_editor->close(); + d_text_editor = NULL; + } + } else if (g) { + if (!g->activeText() && !g->selectedScale() && !g->titleSelected()) + return; + + d_text_editor = new TextEditor(g); + + formatToolBar->setEnabled(true); + actionSubscript->setEnabled(true); + actionSuperscript->setEnabled(true); + actionUnderline->setEnabled(true); + actionGreekSymbol->setEnabled(true); + actionGreekMajSymbol->setEnabled(true); + actionMathSymbol->setEnabled(true); + } +} + +void ApplicationWindow::insertSuperscript() +{ + if (!d_text_editor) + return; + + d_text_editor->formatText("",""); +} + +void ApplicationWindow::insertSubscript() +{ + if (!d_text_editor) + return; + + d_text_editor->formatText("",""); +} + +void ApplicationWindow::underline() +{ + if (!d_text_editor) + return; + + d_text_editor->formatText("",""); +} + +void ApplicationWindow::insertGreekSymbol() +{ + if (!d_text_editor) + return; + + SymbolDialog *greekLetters = new SymbolDialog(SymbolDialog::lowerGreek, this); + connect(greekLetters, SIGNAL(addLetter(const QString&)), d_text_editor, SLOT(addSymbol(const QString&))); + greekLetters->exec(); +} + +void ApplicationWindow::insertGreekMajSymbol() +{ + if (!d_text_editor) + return; + + SymbolDialog *greekLetters = new SymbolDialog(SymbolDialog::upperGreek, this); + connect(greekLetters, SIGNAL(addLetter(const QString&)), d_text_editor, SLOT(addSymbol(const QString&))); + greekLetters->exec(); +} + +void ApplicationWindow::insertMathSymbol() +{ + if (!d_text_editor) + return; + + SymbolDialog *ms = new SymbolDialog(SymbolDialog::mathSymbols, this); + connect(ms, SIGNAL(addLetter(const QString&)), d_text_editor, SLOT(addSymbol(const QString&))); + ms->exec(); +} + +void ApplicationWindow::showCustomActionDialog() +{ + CustomActionDialog *ad = new CustomActionDialog(this); + ad->setAttribute(Qt::WA_DeleteOnClose); + ad->show(); + ad->setFocus(); +} + +void ApplicationWindow::addCustomAction(QAction *action, const QString& parentName, int index) +{ + if (!action) + return; + + QList toolBars = toolBarsList(); + foreach (QToolBar *t, toolBars){ + if (t->objectName() == parentName){ + if (action->icon().isNull()){ + QPixmap icon = QPixmap(16, 16); + QRect r = QRect(0, 0, 15, 15); + icon.fill (Qt::white); + QPainter p; + p.begin(&icon); + p.setPen(QPen(Qt::red, 2)); + p.drawLine(0, 0, 15, 15); + p.drawLine(0, 15, 15, 0); + p.setPen(QPen(Qt::black)); + p.drawRect(r); + action->setIcon(QIcon(icon)); + action->setIconText(tr("No Icon")); + } + t->addAction(action); + if (index < 0) + d_user_actions << action; + else if (index >= 0 && index < d_user_actions.size()) + d_user_actions.replace(index, action); + return; + } + } + + QList menus = customizableMenusList(); + menus += d_user_menus; + foreach (QMenu *m, menus){ + if (m->objectName() == parentName){ + if (action->icon().isNull()) + action->setIconText(tr("No Icon")); + m->addAction(action); + if (index < 0) + d_user_actions << action; + else if (index >= 0 && index < d_user_actions.size()) + d_user_actions.replace(index, action); + return; + } + } +} + +void ApplicationWindow::reloadCustomActions() +{ + reloadCustomMenus(); + + QList menus = customizableMenusList(); + foreach(QAction *a, d_user_actions){ + if (!a->statusTip().isEmpty()){ + foreach (QMenu *m, menus){ + if (m->objectName() == a->statusTip()){ + QList lst = m->actions(); + if (!lst.contains(a)) + m->addAction(a); + + break; + } + } + } + } +} + +void ApplicationWindow::removeCustomAction(QAction *action) +{ + int index = d_user_actions.indexOf(action); + if (index >= 0 && index < d_user_actions.count()){ + d_user_actions.removeAt(index); + delete action; + } +} + +void ApplicationWindow::performCustomAction(QAction *action) +{ + if (!action || !d_user_actions.contains(action)) + return; + +#ifdef SCRIPTING_PYTHON + QString lang = scriptEnv->name(); + setScriptingLanguage("Python"); + + ScriptEdit *script = new ScriptEdit(scriptEnv, 0); + script->importASCII(action->data().toString()); + script->executeAll(); + delete script; + + setScriptingLanguage(lang);// reset old scripting language +#else + QMessageBox::critical(this, tr("QtiPlot") + " - " + tr("Error"), + tr("QtiPlot was not built with Python scripting support included!")); +#endif +} + +void ApplicationWindow::loadCustomActions() +{ + QString path = customActionsDirPath + "/"; + QDir dir(path); + QStringList lst = dir.entryList(QDir::Files|QDir::NoSymLinks, QDir::Name); + for (int i = 0; i < lst.count(); i++){// parse menu files first + QString fileName = path + lst[i]; + QFile file(fileName); + QFileInfo fi(file); + if (!file.open(QFile::ReadOnly | QFile::Text)) + continue; + + if (fi.completeSuffix () != "qcm") + continue; + + CustomMenuHandler handler; + QXmlSimpleReader reader; + reader.setContentHandler(&handler); + reader.setErrorHandler(&handler); + + QXmlInputSource xmlInputSource(&file); + if (reader.parse(xmlInputSource)) + addCustomMenu(handler.title(), handler.location()); + } + + for (int i = 0; i < lst.count(); i++){// parse action files + QString fileName = path + lst[i]; + QFile file(fileName); + QFileInfo fi(file); + if (!file.open(QFile::ReadOnly | QFile::Text)) + continue; + + if (fi.completeSuffix () != "qca") + continue; + + QAction *action = new QAction(this); + CustomActionHandler handler(action); + QXmlSimpleReader reader; + reader.setContentHandler(&handler); + reader.setErrorHandler(&handler); + + QXmlInputSource xmlInputSource(&file); + if (reader.parse(xmlInputSource)) + addCustomAction(action, handler.parentName()); + } +} + +QList ApplicationWindow::customizableMenusList() +{ + QList lst; + lst << windowsMenu << view << graphMenu << fileMenu << format << edit; + lst << help << plot2DMenu; + lst << analysisMenu << multiPeakMenu << smoothMenu << filterMenu << decayMenu << normMenu; + lst << matrixMenu << plot3DMenu << plotDataMenu << scriptingMenu; + lst << tableMenu << fillMenu << newMenu << exportPlotMenu << importMenu; + return lst; +} + +QList ApplicationWindow::menusList() +{ + QList lst; + QObjectList children = this->children(); + foreach (QObject *w, children){ + if (w->isA("QMenu")) + lst << (QMenu *)w; + } + return lst; +} + +QList ApplicationWindow::toolBarsList() +{ + QList lst; + QObjectList children = this->children(); + foreach (QObject *w, children){ + if (w->isA("QToolBar")) + lst << (QToolBar *)w; + } + return lst; +} + +void ApplicationWindow::hideSelectedColumns() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (t) + t->hideSelectedColumns(); +} + +void ApplicationWindow::showAllColumns() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (t) + t->showAllColumns(); +} + +void ApplicationWindow::setMatrixUndoStackSize(int size) +{ + if (d_matrix_undo_stack_size == size) + return; + + d_matrix_undo_stack_size = size; + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if (w->isA("Matrix")){ + QUndoStack *stack = ((Matrix *)w)->undoStack(); + if (!stack->count())// undo limit can only be changed for empty stacks + stack->setUndoLimit(size); + } + } + f = f->folderBelow(); + } +} + +QString ApplicationWindow::guessEndOfLine(const QString& sample) +{//Try to guess which end-of-line character is used: + if (sample.indexOf("\r\n") != -1)//Try \r\n first + return "\r\n"; + else if (sample.indexOf("\r") != -1)//then look for \r + return "\r"; + // use \n if neither \r\n nor \r have been found + return "\n"; +} + +QString ApplicationWindow::endOfLine() +{ + switch(d_eol){ + case LF: + return "\n"; + break; + case CRLF: + return "\r\n"; + break; + case CR: + return "\r"; + break; + } + return "\n"; +} + +void ApplicationWindow::initCompleter() +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QStringList words; +#ifdef SCRIPTING_PYTHON + if (scriptEnv->name() == QString("Python")){ + QString fn = "/usr/share/qtiplot/qti_wordlist.txt"; + QFile file(fn); + if (!file.open(QFile::ReadOnly)){ + QMessageBox::critical(this, tr("QtiPlot - Warning"), + tr("Couldn't load file: %1.\nAutocompletion will not be available!").arg(QFileInfo(file).absoluteFilePath())); + } else { + while (!file.atEnd()){ + QByteArray line = file.readLine(); + if (!line.isEmpty()){ + QString s = line.trimmed(); + if (!words.contains(s)) + words << s; + } + } + file.close(); + } + + words.append(PythonSyntaxHighlighter::keywordsList()); + + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows) + words << w->objectName(); + f = f->folderBelow(); + } + } +#endif + + QStringList functions = scriptEnv->mathFunctions(); + foreach(QString s, functions) + words.append(s); + + words.sort(); + + if (!d_completer){ + d_completer = new QCompleter(this); + d_completer->setModelSorting(QCompleter::CaseSensitivelySortedModel); + d_completer->setCompletionMode(QCompleter::PopupCompletion); + } + d_completer->setModel(new QStringListModel(words, d_completer)); + + QApplication::restoreOverrideCursor(); +} + +void ApplicationWindow::enableCompletion(bool on) +{ + if (!d_completer || d_completion == on) + return; + + d_completion = on; + + if (scriptWindow){ + if (d_completion) + scriptWindow->editor()->setCompleter(d_completer); + else + scriptWindow->editor()->setCompleter(0); + } + + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows){ + if(w->isA("Note")){ + if (d_completion) + ((Note *)w)->currentEditor()->setCompleter(d_completer); + else + ((Note *)w)->currentEditor()->setCompleter(0); + } + } + f = f->folderBelow(); + } +} + +void ApplicationWindow::showFrequencyCountDialog() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return; + + int validRows = 0; + int ts = t->table()->currentSelection(); + if (ts >= 0){ + Q3TableSelection sel = t->table()->selection(ts); + if (sel.numRows() > 1 && sel.numCols() == 1){ + int col = sel.leftCol(); + for (int i = sel.topRow(); i <= sel.bottomRow(); i++){ + if (!t->text(i, col).isEmpty()) + validRows++; + if (validRows > 1){ + FrequencyCountDialog *fcd = new FrequencyCountDialog(t, this); + fcd->exec(); + break; + } + } + } + } + if (validRows < 2) + QMessageBox::warning(this, tr("QtiPlot - Column selection error"), + tr("Please select exactly one column and more than one non empty cell!")); +} + +Note * ApplicationWindow::newStemPlot() +{ + Table *t = (Table *)activeWindow(TableWindow); + if (!t) + return NULL; + + int ts = t->table()->currentSelection(); + if (ts < 0) + return NULL; + + Note *n = newNote(); + if (!n) + return NULL; + n->hide(); + + ScriptEdit* editor = n->currentEditor(); + QStringList lst = t->selectedColumns(); + if (lst.isEmpty()){ + Q3TableSelection sel = t->table()->selection(ts); + for (int i = sel.leftCol(); i <= sel.rightCol(); i++) + editor->insertPlainText(stemPlot(t, t->colName(i), 1001, sel.topRow() + 1, sel.bottomRow() + 1) + "\n"); + } else { + for (int i = 0; i < lst.count(); i++) + editor->insertPlainText(stemPlot(t, lst[i], 1001) + "\n"); + } + + n->show(); + return n; +} + +QString ApplicationWindow::stemPlot(Table *t, const QString& colName, int power, int startRow, int endRow) +{ + if (!t) + return QString(); + + int col = t->colIndex(colName); + if (col < 0){ + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("Data set: %1 doesn't exist!").arg(colName)); + return QString(); + } + + startRow--; + endRow--; + if (startRow < 0 || startRow >= t->numRows()) + startRow = 0; + if (endRow < 0 || endRow >= t->numRows()) + endRow = t->numRows() - 1; + + QString result = tr("Stem and leaf plot of dataset") + ": " + colName + " "; + result += tr("from row") + ": " + QString::number(startRow + 1) + " "; + result += tr("to row") + ": " + QString::number(endRow + 1) + "\n"; + + int rows = 0; + for (int j = startRow; j <= endRow; j++){ + if (!t->text(j, col).isEmpty()) + rows++; + } + + if (rows >= 1){ + double *data = (double *)malloc(rows * sizeof (double)); + if (!data){ + result += tr("Not enough memory for this dataset!") + "\n"; + return result; + } + + result += "\n" + tr("Stem") + " | " + tr("Leaf"); + result += "\n---------------------\n"; + + int row = 0; + for (int j = startRow; j <= endRow; j++){ + if (!t->text(j, col).isEmpty()){ + data[row] = t->cell(j, col); + row++; + } + } + gsl_sort (data, 1, rows); + + if (power > 1e3){ + power = std::ceil(log10(data[rows - 1] - data[0]) - log10(rows - 1)); + bool ok; + int input = QInputDialog::getInteger(this, tr("Please confirm the stem unit!"), + tr("Data set") + ": " + colName + ", " + tr("stem unit") + " = 10n, n = ", + power, -1000, 1000, 1, &ok); + if (ok) + power = input; + } + + double stem_unit = pow(10.0, power); + double leaf_unit = stem_unit/10.0; + + int prev_stem = int(data[0]/stem_unit); + result += " " + QString::number(prev_stem) + " | "; + + for (int j = 0; j objectName()){ + QMenu *menu = menuBar()->addMenu(title); + if (menu){ + menu->setObjectName(title); + d_user_menus.append(menu); + connect(menu, SIGNAL(triggered(QAction *)), this, SLOT(performCustomAction(QAction *))); + return menu; + } + } + + QList menus = customizableMenusList(); + foreach (QMenu *m, menus){ + if (m->objectName() == parentName){ + QMenu *menu = m->addMenu(title); + if (menu){ + menu->setObjectName(title); + d_user_menus.append(menu); + return menu; + } + } + } + return NULL; +} + +void ApplicationWindow::removeCustomMenu(const QString& title) +{ + foreach (QMenu *m, d_user_menus){ + if (m->objectName() == title){ + int index = d_user_menus.indexOf(m); + if (index >= 0 && index < d_user_menus.count()){ + d_user_menus.removeAt(index); + delete m; + return; + } + } + } +} + +void ApplicationWindow::reloadCustomMenus() +{ + foreach(QMenu *m, d_user_menus){ + QWidget *parent = m->parentWidget(); + if (parent && !parent->children().contains(m)) + ((QMenu *)parent)->addMenu(m); + } +} + +QColor ApplicationWindow::readColorFromProject(const QString& name) +{ + QColor c = QColor(); + bool canConvertToInt = false; + int fillColIndex = name.toInt(&canConvertToInt); + if (canConvertToInt){ + if (fillColIndex < 0) + return c; + if (d_file_version <= 89) + fillColIndex = convertOldToNewColorIndex(fillColIndex); + c = ColorBox::defaultColor(fillColIndex); + } else + c = QColor(name); + + return c; +} + +void ApplicationWindow::enableMdiArea(bool on) +{ + if (d_mdi_windows_area == on) + return; + + d_mdi_windows_area = on; + + if (on){ + QList windows = windowsList(); + foreach(MdiSubWindow *w, windows) + d_workspace->addSubWindow(w); + } else { + QList windows = d_workspace->subWindowList(); + foreach(QMdiSubWindow *w, windows){ + d_workspace->removeSubWindow(w); + w->show(); + } + } +} + +void ApplicationWindow::memoryAllocationError() +{ + QMessageBox::critical(0, tr("QtiPlot") + " - " + tr("Memory Allocation Error"), + tr("Not enough memory, operation aborted!")); +} + +void ApplicationWindow::increasePrecision() +{ + Matrix *m = (Matrix *)activeWindow(MatrixWindow); + if (!m) + return; + + int oldPrec = m->precision(); + if (oldPrec == 13) + return; + + int prec = oldPrec + 1; + QChar format = m->textFormat(); + m->undoStack()->push(new MatrixSetPrecisionCommand(m, format, format, + oldPrec, prec, tr("Set Precision %1 digits").arg(prec))); + m->setNumericPrecision(prec); +} + +void ApplicationWindow::decreasePrecision() +{ + Matrix *m = (Matrix *)activeWindow(MatrixWindow); + if (!m) + return; + + int oldPrec = m->precision(); + if (oldPrec == 0) + return; + + int prec = oldPrec - 1; + QChar format = m->textFormat(); + m->undoStack()->push(new MatrixSetPrecisionCommand(m, format, format, + oldPrec, prec, tr("Set Precision %1 digits").arg(prec))); + m->setNumericPrecision(prec); +} + +void ApplicationWindow::commentSelection() +{ + Note *note = (Note *)activeWindow(NoteWindow); + if (!note || !note->currentEditor()) + return; + + note->currentEditor()->commentSelection(); +} + +void ApplicationWindow::uncommentSelection() +{ + Note *note = (Note *)activeWindow(NoteWindow); + if (!note || !note->currentEditor()) + return; + + note->currentEditor()->uncommentSelection(); +} + +void ApplicationWindow::execute() +{ + Note *note = (Note *)activeWindow(NoteWindow); + if (!note) + return; + + note->execute(); +} + +void ApplicationWindow::executeAll() +{ + Note *note = (Note *)activeWindow(NoteWindow); + if (!note) + return; + + note->executeAll(); +} + +void ApplicationWindow::evaluate() +{ + Note *note = (Note *)activeWindow(NoteWindow); + if (!note) + return; + + note->evaluate(); +} + +void ApplicationWindow::addWindowsListToCompleter() +{ +#ifdef SCRIPTING_PYTHON + if (scriptEnv->name() != QString("Python")) + return; + + if (!d_completer) + return; + + QStringListModel *model = qobject_cast (d_completer->model()); + if (!model) + return; + + QStringList lst = model->stringList(); + Folder *f = projectFolder(); + while (f){ + QList folderWindows = f->windowsList(); + foreach(MdiSubWindow *w, folderWindows) + lst << w->objectName(); + f = f->folderBelow(); + } + lst.sort(); + model->setStringList(lst); +#endif +} + +void ApplicationWindow::updateCompleter(const QString& windowName, bool remove, const QString& newName) +{ +#ifdef SCRIPTING_PYTHON + if (scriptEnv->name() != QString("Python")) + return; + + if (!d_completer || d_is_appending_file || d_opening_file) + return; + + QStringListModel *model = qobject_cast (d_completer->model()); + if (!model) + return; + + QStringList lst = model->stringList(); + + if (newName.isEmpty()){ + if (remove) + lst.removeAll(windowName); + else + lst.append(windowName); + } else { + int index = lst.indexOf(windowName); + if (index >= 0) + lst.replace(index, newName); + } + + lst.sort(); + model->setStringList(lst); +#endif +} + +#ifdef SCRIPTING_PYTHON +void ApplicationWindow::openQtDesignerUi() +{ + QString fn = getFileName(this, tr("QtiPlot") + " - " + tr("Choose custom user interface"), workingDir, "*.ui", 0, false); + if (!fn.isEmpty()){ + QFileInfo fi(fn); + workingDir = fi.dirPath(true); + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + setScriptingLanguage("Python"); + + QString script = "# " + tr("Custom user interfaces can be created using the QtDesigner application provided by the Qt framework") + ":\n"; + script += "# http://qt.nokia.com\n"; + script += "# " + tr("For more details about how to use .ui files in your Python scripts please read the PyQt4 documentation") + ":\n"; + script += "# http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#using-the-generated-code\n"; + script += "##############################################################################################\n"; + script += "from PyQt4 import uic\n"; + script += "global ui\n"; + script += "ui = uic.loadUi(\"" + fn + "\")\n"; + script += "ui.show()\n"; + + Note *note = newNote(); + note->setText(script); + note->executeAll(); + + QApplication::restoreOverrideCursor(); + } +} +#endif + +#ifdef BROWSER_PLUGIN +QTNPFACTORY_BEGIN("QtiPlot Browser Plugin", "A Qt-based NSAPI plug-in application that graphs numeric data"); + QTNPCLASS(ApplicationWindow) +QTNPFACTORY_END() +#endif + +#ifdef QAXSERVER +#include +QAXFACTORY_BEGIN("{89ab08da-df8c-4bd0-8327-72f73741c1a6}", "{082bd921-0832-4ca7-ab5a-ec06ca7f3350}") + QAXCLASS(ApplicationWindow) +QAXFACTORY_END() +#endif === removed file 'qtiplot/src/core/ApplicationWindow.cpp' --- qtiplot/src/core/ApplicationWindow.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/ApplicationWindow.cpp 1970-01-01 00:00:00 +0000 @@ -1,17557 +0,0 @@ -/*************************************************************************** - File : ApplicationWindow.cpp - Project : QtiPlot --------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, - Tilman Hoener zu Siederdissen, - Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net, - knut.franke*gmx.de - Description : QtiPlot's main window - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "globals.h" -#include "ApplicationWindow.h" -#include "pixmaps.h" -#include "PlotWizard.h" -#include "ConfigDialog.h" -#include "importOPJ.h" -#include "RenameWindowDialog.h" -#include "ImportASCIIDialog.h" -#include "Folder.h" -#include "FindDialog.h" -#include "OpenProjectDialog.h" -#include "CustomActionDialog.h" -#include "MdiSubWindow.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -// TODO: move tool-specific code to an extension manager -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -using namespace std; - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -using namespace Qwt3D; - -extern "C" -{ -void file_compress(char *file, char *mode); -void file_uncompress(char *file); -} - -ApplicationWindow::ApplicationWindow(bool factorySettings) -: QMainWindow(), scripted(ScriptingLangManager::newEnv(this)) -{ - setAttribute(Qt::WA_DeleteOnClose); - init(factorySettings); -} - -void ApplicationWindow::init(bool factorySettings) -{ - setWindowTitle(tr("QtiPlot - untitled")); - setObjectName("main application"); - initGlobalConstants(); - QPixmapCache::setCacheLimit(20*QPixmapCache::cacheLimit ()); - - tablesDepend = new QMenu(this); - - explorerWindow = new QDockWidget( this ); - explorerWindow->setWindowTitle(tr("Project Explorer")); - explorerWindow->setObjectName("explorerWindow"); // this is needed for QMainWindow::restoreState() - explorerWindow->setMinimumHeight(150); - addDockWidget( Qt::BottomDockWidgetArea, explorerWindow ); - - actionSaveProject = NULL; - folders = new FolderListView(this); - folders->header()->setClickEnabled( false ); - folders->addColumn( tr("Folder") ); - folders->setRootIsDecorated( true ); - folders->setResizeMode(Q3ListView::LastColumn); - folders->header()->hide(); - folders->setSelectionMode(Q3ListView::Single); - - connect(folders, SIGNAL(currentChanged(Q3ListViewItem *)), - this, SLOT(folderItemChanged(Q3ListViewItem *))); - connect(folders, SIGNAL(itemRenamed(Q3ListViewItem *, int, const QString &)), - this, SLOT(renameFolder(Q3ListViewItem *, int, const QString &))); - connect(folders, SIGNAL(contextMenuRequested(Q3ListViewItem *, const QPoint &, int)), - this, SLOT(showFolderPopupMenu(Q3ListViewItem *, const QPoint &, int))); - connect(folders, SIGNAL(dragItems(QList)), - this, SLOT(dragFolderItems(QList))); - connect(folders, SIGNAL(dropItems(Q3ListViewItem *)), - this, SLOT(dropFolderItems(Q3ListViewItem *))); - connect(folders, SIGNAL(renameItem(Q3ListViewItem *)), - this, SLOT(startRenameFolder(Q3ListViewItem *))); - connect(folders, SIGNAL(addFolderItem()), this, SLOT(addFolder())); - connect(folders, SIGNAL(deleteSelection()), this, SLOT(deleteSelectedItems())); - - current_folder = new Folder( 0, tr("UNTITLED")); - FolderListItem *fli = new FolderListItem(folders, current_folder); - current_folder->setFolderListItem(fli); - fli->setOpen( true ); - - lv = new FolderListView(); - lv->addColumn (tr("Name"),-1 ); - lv->addColumn (tr("Type"),-1 ); - lv->addColumn (tr("View"),-1 ); - lv->addColumn (tr("Size"),-1 ); - lv->addColumn (tr("Created"),-1); - lv->addColumn (tr("Label"),-1); - lv->setResizeMode(Q3ListView::LastColumn); - lv->setMinimumHeight(80); - lv->setSelectionMode(Q3ListView::Extended); - lv->setDefaultRenameAction (Q3ListView::Accept); - - explorerSplitter = new QSplitter(Qt::Horizontal, explorerWindow); - explorerSplitter->addWidget(folders); - explorerSplitter->addWidget(lv); - explorerWindow->setWidget(explorerSplitter); - - QList splitterSizes; - explorerSplitter->setSizes( splitterSizes << 45 << 45); - explorerWindow->hide(); - - logWindow = new QDockWidget(this); - logWindow->setObjectName("logWindow"); // this is needed for QMainWindow::restoreState() - logWindow->setWindowTitle(tr("Results Log")); - addDockWidget( Qt::TopDockWidgetArea, logWindow ); - - results=new QTextEdit(logWindow); - results->setReadOnly (true); - - logWindow->setWidget(results); - logWindow->hide(); - -#ifdef SCRIPTING_CONSOLE - consoleWindow = new QDockWidget(this); - consoleWindow->setObjectName("consoleWindow"); // this is needed for QMainWindow::restoreState() - consoleWindow->setWindowTitle(tr("Scripting Console")); - addDockWidget( Qt::TopDockWidgetArea, consoleWindow ); - console = new QTextEdit(consoleWindow); - console->setReadOnly(true); - consoleWindow->setWidget(console); - consoleWindow->hide(); -#endif - - undoStackWindow = new QDockWidget(this); - undoStackWindow->setObjectName("undoStackWindow"); // this is needed for QMainWindow::restoreState() - undoStackWindow->setWindowTitle(tr("Undo Stack")); - addDockWidget(Qt::RightDockWidgetArea, undoStackWindow); - - d_undo_view = new QUndoView(undoStackWindow); - d_undo_view->setCleanIcon(QIcon(QPixmap(filesave_xpm))); - undoStackWindow->setWidget(d_undo_view); - undoStackWindow->hide(); - - // Needs to be done after initialization of dock windows, - // because we now use QDockWidget::toggleViewAction() - createActions(); - initToolBars(); - initMainMenu(); - - d_workspace = new QMdiArea(); - d_workspace->setOption(QMdiArea::DontMaximizeSubWindowOnActivation); - d_workspace->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); - d_workspace->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); - setCentralWidget(d_workspace); - - setAcceptDrops(true); - - hiddenWindows = new QList(); - - scriptWindow = 0; - d_text_editor = NULL; - - renamedTables = QStringList(); - if (!factorySettings) - readSettings(); - createLanguagesList(); - insertTranslatedStrings(); - disableToolbars(); - - assistant = new QAssistantClient( QString(), this ); - - actionNextWindow = new QAction(QIcon(QPixmap(next_xpm)), tr("&Next","next window"), this); - actionNextWindow->setShortcut( tr("F5","next window shortcut") ); - connect(actionNextWindow, SIGNAL(activated()), d_workspace, SLOT(activateNextSubWindow())); - - actionPrevWindow = new QAction(QIcon(QPixmap(prev_xpm)), tr("&Previous","previous window"), this); - actionPrevWindow->setShortcut( tr("F6","previous window shortcut") ); - connect(actionPrevWindow, SIGNAL(activated()), d_workspace, SLOT(activatePreviousSubWindow())); - - connect(tablesDepend, SIGNAL(activated(int)), this, SLOT(showTable(int))); - - connect(this, SIGNAL(modified()),this, SLOT(modifiedProject())); - connect(d_workspace, SIGNAL(subWindowActivated(QMdiSubWindow *)), - this, SLOT(windowActivated(QMdiSubWindow*))); - connect(lv, SIGNAL(doubleClicked(Q3ListViewItem *)), - this, SLOT(maximizeWindow(Q3ListViewItem *))); - connect(lv, SIGNAL(doubleClicked(Q3ListViewItem *)), - this, SLOT(folderItemDoubleClicked(Q3ListViewItem *))); - connect(lv, SIGNAL(contextMenuRequested(Q3ListViewItem *, const QPoint &, int)), - this, SLOT(showWindowPopupMenu(Q3ListViewItem *, const QPoint &, int))); - connect(lv, SIGNAL(dragItems(QList)), - this, SLOT(dragFolderItems(QList))); - connect(lv, SIGNAL(dropItems(Q3ListViewItem *)), - this, SLOT(dropFolderItems(Q3ListViewItem *))); - connect(lv, SIGNAL(renameItem(Q3ListViewItem *)), - this, SLOT(startRenameFolder(Q3ListViewItem *))); - connect(lv, SIGNAL(addFolderItem()), this, SLOT(addFolder())); - connect(lv, SIGNAL(deleteSelection()), this, SLOT(deleteSelectedItems())); - connect(lv, SIGNAL(itemRenamed(Q3ListViewItem *, int, const QString &)), - this, SLOT(renameWindow(Q3ListViewItem *, int, const QString &))); - - connect(scriptEnv, SIGNAL(error(const QString&,const QString&,int)), - this, SLOT(scriptError(const QString&,const QString&,int))); - connect(scriptEnv, SIGNAL(print(const QString&)), this, SLOT(scriptPrint(const QString&))); - - connect(recent, SIGNAL(activated(int)), this, SLOT(openRecentProject(int))); - - // this has to be done after connecting scriptEnv - scriptEnv->initialize(); - - //apply user settings - updateAppFonts(); - setScriptingLanguage(defaultScriptingLang); - setAppColors(workspaceColor, panelsColor, panelsTextColor, true); - - loadCustomActions(); - initCompleter(); -} - -void ApplicationWindow::initWindow() -{ - switch(d_init_window_type){ - case TableWindow: - newTable(); - break; - case MatrixWindow: - newMatrix(); - break; - case MultiLayerWindow: - newGraph(); - break; - case NoteWindow: - newNote(); - break; - default: - break; - } -} - -void ApplicationWindow::initGlobalConstants() -{ - d_latex_compiler = MathTran; - d_latex_compiler_path = QString::null; - d_mdi_windows_area = true; - d_open_project_filter = QString::null;//tr("QtiPlot project") + " (*.qti)"; - - d_comment_highlight_color = Qt::red; - d_class_highlight_color = Qt::darkMagenta; - d_numeric_highlight_color = Qt::darkGreen; - d_keyword_highlight_color = Qt::darkBlue; - d_function_highlight_color = Qt::blue; - d_quotation_highlight_color = Qt::darkYellow; - - d_notes_tab_length = 20; - d_completer = NULL; - d_completion = true; - d_note_line_numbers = true; - - d_auto_update_table_values = true; - d_active_window = NULL; - d_matrix_undo_stack_size = 10; - - d_opening_file = false; - d_is_appending_file = false; - d_in_place_editing = true; - - d_matrix_tool_bar = true; - d_file_tool_bar = true; - d_table_tool_bar = true; - d_column_tool_bar = true; - d_edit_tool_bar = true; - d_notes_tool_bar = true; - d_plot_tool_bar = true; - d_plot3D_tool_bar = true; - d_display_tool_bar = false; - d_format_tool_bar = true; - - appStyle = qApp->style()->objectName(); - d_app_rect = QRect(); - projectname = "untitled"; - lastCopiedLayer = 0; - d_enrichement_copy = NULL; - d_arrow_copy = NULL; - - savingTimerId = 0; - - #ifdef QTIPLOT_DEMO - QTimer::singleShot(600000, this, SLOT(close())); - #endif - - autoSearchUpdatesRequest = false; - - show_windows_policy = ActiveFolder; - d_script_win_on_top = false; - d_script_win_rect = QRect(0, 0, 500, 300); - d_init_window_type = TableWindow; - - QString aux = qApp->applicationDirPath(); - workingDir = aux; - -#ifdef TRANSLATIONS_PATH - d_translations_folder = TRANSLATIONS_PATH; -#else - d_translations_folder = aux + "/translations"; -#endif - -#ifdef MANUAL_PATH - helpFilePath = MANUAL_PATH; - helpFilePath += "/index.html"; -#else - helpFilePath = aux + "/manual/index.html"; -#endif - -#ifdef PYTHON_CONFIG_PATH - d_python_config_folder = PYTHON_CONFIG_PATH; -#else - d_python_config_folder = aux; -#endif - - fitPluginsPath = aux + "fitPlugins"; - fitModelsPath = QString::null; - templatesDir = aux; - asciiDirPath = aux; - imagesDirPath = aux; - scriptsDirPath = aux; - customActionsDirPath = QString::null; - - appFont = QFont(); - d_notes_font = appFont; - - QString family = appFont.family(); - int pointSize = appFont.pointSize(); - tableTextFont = appFont; - tableHeaderFont = appFont; - plotAxesFont = QFont(family, pointSize, QFont::Bold, false); - plotNumbersFont = QFont(family, pointSize ); - plotLegendFont = appFont; - plotTitleFont = QFont(family, pointSize + 2, QFont::Bold,false); - - autoSearchUpdates = false; - appLanguage = QLocale::system().name().section('_',0,0); - show_windows_policy = ApplicationWindow::ActiveFolder; - - workspaceColor = QColor("darkGray"); - panelsColor = QColor("#ffffff"); - panelsTextColor = QColor("#000000"); - tableBkgdColor = QColor("#ffffff"); - tableTextColor = QColor("#000000"); - tableHeaderColor = QColor("#000000"); - - d_graph_background_color = Qt::white; - d_graph_canvas_color = Qt::white; - d_graph_border_color = Qt::black; - d_graph_background_opacity = 255; - d_graph_canvas_opacity = 255; - d_graph_border_width = 0; - d_graph_axes_labels_dist = 2; - - autoSave = true; - autoSaveTime = 15; - d_backup_files = true; - - defaultScriptingLang = "muParser"; -/*#ifdef SCRIPTING_PYTHON - defaultScriptingLang = "Python"; -#endif*/ - - d_decimal_digits = 13; - - d_extended_open_dialog = true; - d_extended_export_dialog = true; - d_extended_import_ASCII_dialog = true; - d_extended_plot_dialog = true; - - d_add_curves_dialog_size = QSize(700, 400); - d_show_current_folder = false; - - confirmCloseFolder = true; - confirmCloseTable = true; - confirmCloseMatrix = true; - confirmClosePlot2D = true; - confirmClosePlot3D = true; - confirmCloseNotes = true; - d_inform_rename_table = true; - - d_show_table_comments = false; - - titleOn = true; - d_show_axes = QVector (QwtPlot::axisCnt, true); - d_show_axes_labels = QVector (QwtPlot::axisCnt, true); - canvasFrameWidth = 0; - d_canvas_frame_color = Qt::black; - defaultPlotMargin = 0; - drawBackbones = true; - axesLineWidth = 1; - autoscale2DPlots = true; - autoScaleFonts = true; - autoResizeLayers = true; - antialiasing2DPlots = false; - d_scale_plots_on_print = false; - d_print_cropmarks = false; - d_graph_legend_display = Graph::ColumnName; - - defaultCurveStyle = int(Graph::LineSymbols); - defaultCurveLineWidth = 1; - defaultSymbolSize = 7; - - majTicksStyle = int(ScaleDraw::Out); - minTicksStyle = int(ScaleDraw::Out); - minTicksLength = 5; - majTicksLength = 9; - - legendFrameStyle = int(LegendWidget::Line); - d_frame_widget_pen = QPen(Qt::black, 1, Qt::SolidLine); - legendTextColor = Qt::black; - legendBackground = Qt::white; - legendBackground.setAlpha(0); // transparent by default; - d_legend_default_angle = 0; - d_frame_geometry_unit = (int)FrameWidget::Scale; - d_layer_geometry_unit = (int)FrameWidget::Pixel; - - d_rect_default_background = Qt::white; - d_rect_default_brush = QBrush(Qt::white); - - defaultArrowLineWidth = 1; - defaultArrowColor = Qt::black; - defaultArrowHeadLength = 4; - defaultArrowHeadAngle = 45; - defaultArrowHeadFill = true; - defaultArrowLineStyle = Graph::getPenStyle("SolidLine"); - - d_3D_legend = true; - d_3D_projection = NOFLOOR; - d_3D_smooth_mesh = true; - d_3D_resolution = 1; - d_3D_orthogonal = false; - d_3D_autoscale = true; - d_3D_axes_font = QFont(family, pointSize, QFont::Bold, false); - d_3D_numbers_font = QFont(family, pointSize); - d_3D_title_font = QFont(family, pointSize + 2, QFont::Bold, false); - d_3D_color_map = QwtLinearColorMap(Qt::blue, Qt::red); - d_3D_mesh_color = Qt::black; - d_3D_axes_color = Qt::black; - d_3D_numbers_color = Qt::black; - d_3D_labels_color = Qt::black; - d_3D_background_color = Qt::white; - d_3D_grid_color = Qt::blue; - d_3D_minor_grid_color = Qt::lightGray; - d_3D_minor_grids = true; - d_3D_major_grids = true; - d_3D_major_style = Qwt3D::SOLID; - d_3D_minor_style = Qwt3D::DASH; - d_3D_major_width = 1.0; - d_3D_minor_width = 0.8; - - fit_output_precision = 13; - pasteFitResultsToPlot = false; - writeFitResultsToLog = true; - generateUniformFitPoints = true; - fitPoints = 100; - generatePeakCurves = true; - peakCurvesColor = 2; - fit_scale_errors = true; - d_2_linear_fit_points = true; - - columnSeparator = "\t"; - ignoredLines = 0; - renameColumns = true; - strip_spaces = false; - simplify_spaces = false; - d_ASCII_file_filter = "*"; - d_ASCII_import_locale = QLocale::system().name(); - d_ASCII_import_mode = int(ImportASCIIDialog::NewTables); - d_ASCII_import_first_row_role = 0;//column names - d_ASCII_comment_string = "#"; - d_ASCII_import_comments = false; - d_ASCII_import_read_only = false; - d_ASCII_import_preview = true; - d_preview_lines = 100; - d_ASCII_end_line = LF; - d_eol = LF; -#ifdef Q_OS_MAC - d_ASCII_end_line = CR; - d_eol = CR; -#endif - - d_export_col_separator = "\t"; - d_export_col_names = false; - d_export_col_comment = false; - d_export_table_selection = false; - d_export_ASCII_file_filter = ".dat"; - - d_scale_fonts_factor = 0.0; - d_image_export_filter = ".png"; - d_export_transparency = false; - d_export_quality = 100; - d_export_raster_size = QSizeF(); - d_export_size_unit = FrameWidget::Pixel; - d_export_vector_resolution = QWidget().logicalDpiX(); - d_export_bitmap_resolution = d_export_vector_resolution; - d_export_color = true; - d_export_escape_tex_strings = true; - d_export_tex_font_sizes = true; - d_3D_export_text_mode = 0; //VectorWriter::PIXEL - d_3D_export_sort = 1; //VectorWriter::SIMPLESORT -} - -void ApplicationWindow::initToolBars() -{ - initPlot3DToolBar(); - - setWindowIcon(QIcon(QPixmap(logo_xpm))); - QPixmap openIcon, saveIcon; - - fileTools = new QToolBar(tr( "File" ), this); - fileTools->setObjectName("fileTools"); // this is needed for QMainWindow::restoreState() - fileTools->setIconSize( QSize(18,20) ); - addToolBar( Qt::TopToolBarArea, fileTools ); - - fileTools->addAction(actionNewProject); - fileTools->addAction(actionNewFolder); - fileTools->addAction(actionNewTable); - fileTools->addAction(actionNewMatrix); - fileTools->addAction(actionNewNote); - fileTools->addAction(actionNewGraph); - fileTools->addAction(actionNewFunctionPlot); - fileTools->addAction(actionNewSurfacePlot); - fileTools->addSeparator (); - fileTools->addAction(actionOpen); - fileTools->addAction(actionOpenTemplate); - fileTools->addAction(actionAppendProject); - fileTools->addAction(actionSaveProject); - fileTools->addAction(actionSaveTemplate); - fileTools->addSeparator (); - fileTools->addAction(actionLoad); - fileTools->addSeparator (); - fileTools->addAction(actionCopyWindow); - fileTools->addAction(actionPrint); - fileTools->addAction(actionPrintPreview); - fileTools->addAction(actionExportPDF); - fileTools->addSeparator(); - fileTools->addAction(actionShowExplorer); - fileTools->addAction(actionShowLog); -#ifdef SCRIPTING_PYTHON - fileTools->addAction(actionShowScriptWindow); -#endif - - editTools = new QToolBar(tr("Edit"), this); - editTools->setObjectName("editTools"); // this is needed for QMainWindow::restoreState() - editTools->setIconSize( QSize(18,20) ); - addToolBar( editTools ); - - editTools->addAction(actionUndo); - editTools->addAction(actionRedo); - editTools->addAction(actionCutSelection); - editTools->addAction(actionCopySelection); - editTools->addAction(actionPasteSelection); - editTools->addAction(actionClearSelection); - - noteTools = new QToolBar(tr("Notes"), this); - noteTools->setObjectName("noteTools"); // this is needed for QMainWindow::restoreState() - noteTools->setIconSize( QSize(18,20) ); - noteTools->addAction(actionNoteExecuteAll); - noteTools->addAction(actionDecreaseIndent); - noteTools->addAction(actionIncreaseIndent); - noteTools->addAction(actionFind); - noteTools->addAction(actionFindPrev); - noteTools->addAction(actionFindNext); - noteTools->addAction(actionReplace); - addToolBar( noteTools ); - - plotTools = new QToolBar(tr("Plot"), this); - plotTools->setObjectName("plotTools"); // this is needed for QMainWindow::restoreState() - plotTools->setIconSize( QSize(16,20) ); - addToolBar( plotTools ); - - plotTools->addAction(actionAddLayer); - plotTools->addAction(actionAddInsetLayer); - plotTools->addAction(actionAddInsetCurveLayer); - plotTools->addSeparator(); - plotTools->addAction(actionShowLayerDialog); - plotTools->addAction(actionAutomaticLayout); - plotTools->addSeparator(); - plotTools->addAction(actionExtractLayers); - plotTools->addAction(actionExtractGraphs); - plotTools->addSeparator(); - plotTools->addAction(actionAddErrorBars); - plotTools->addAction(actionShowCurvesDialog); - plotTools->addAction(actionAddFunctionCurve); - plotTools->addAction(actionNewLegend); - plotTools->addSeparator (); - plotTools->addAction(actionUnzoom); - - dataTools = new QActionGroup( this ); - dataTools->setExclusive( true ); - - btnPointer = new QAction(tr("Disable &Tools"), this); - btnPointer->setActionGroup(dataTools); - btnPointer->setCheckable( true ); - btnPointer->setIcon(QIcon(QPixmap(pointer_xpm)) ); - btnPointer->setChecked(true); - plotTools->addAction(btnPointer); - - actionMagnify->setActionGroup(dataTools); - actionMagnify->setCheckable( true ); - plotTools->addAction(actionMagnify); - - btnZoomIn = new QAction(tr("&Zoom In"), this); - btnZoomIn->setShortcut( tr("Ctrl++") ); - btnZoomIn->setActionGroup(dataTools); - btnZoomIn->setCheckable( true ); - btnZoomIn->setIcon(QIcon(QPixmap(zoom_xpm)) ); - plotTools->addAction(btnZoomIn); - - btnZoomOut = new QAction(tr("&Zoom Out"), this); - btnZoomOut->setShortcut( tr("Ctrl+-") ); - btnZoomOut->setActionGroup(dataTools); - btnZoomOut->setCheckable( true ); - btnZoomOut->setIcon(QIcon(QPixmap(zoomOut_xpm)) ); - plotTools->addAction(btnZoomOut); - - btnCursor = new QAction(tr("&Data Reader"), this); - btnCursor->setShortcut( tr("CTRL+D") ); - btnCursor->setActionGroup(dataTools); - btnCursor->setCheckable( true ); - btnCursor->setIcon(QIcon(QPixmap(select_xpm)) ); - plotTools->addAction(btnCursor); - - btnSelect = new QAction(tr("&Select Data Range"), this); - btnSelect->setShortcut( tr("ALT+S") ); - btnSelect->setActionGroup(dataTools); - btnSelect->setCheckable( true ); - btnSelect->setIcon(QIcon(QPixmap(cursors_xpm)) ); - plotTools->addAction(btnSelect); - - btnPicker = new QAction(tr("S&creen Reader"), this); - btnPicker->setActionGroup(dataTools); - btnPicker->setCheckable( true ); - btnPicker->setIcon(QIcon(QPixmap(cursor_16)) ); - plotTools->addAction(btnPicker); - - actionDrawPoints = new QAction(tr("&Draw Data Points"), this); - actionDrawPoints->setActionGroup(dataTools); - actionDrawPoints->setCheckable( true ); - actionDrawPoints->setIcon(QIcon(QPixmap(draw_points_xpm)) ); - plotTools->addAction(actionDrawPoints); - - btnMovePoints = new QAction(tr("&Move Data Points..."), this); - btnMovePoints->setShortcut( tr("Ctrl+ALT+M") ); - btnMovePoints->setActionGroup(dataTools); - btnMovePoints->setCheckable( true ); - btnMovePoints->setIcon(QIcon(QPixmap(hand_xpm)) ); - plotTools->addAction(btnMovePoints); - - btnRemovePoints = new QAction(tr("Remove &Bad Data Points..."), this); - btnRemovePoints->setShortcut( tr("Alt+B") ); - btnRemovePoints->setActionGroup(dataTools); - btnRemovePoints->setCheckable( true ); - btnRemovePoints->setIcon(QIcon(QPixmap(delete_xpm))); - plotTools->addAction(btnRemovePoints); - - actionDragCurve = new QAction(tr("Dra&g Curve"), this); - actionDragCurve->setActionGroup(dataTools); - actionDragCurve->setCheckable( true ); - actionDragCurve->setIcon(QIcon(QPixmap(drag_curve_xpm)) ); - plotTools->addAction(actionDragCurve); - - connect( dataTools, SIGNAL( triggered( QAction* ) ), this, SLOT( pickDataTool( QAction* ) ) ); - plotTools->addSeparator (); - - actionAddFormula = new QAction(tr("Add E&quation"), this); - actionAddFormula->setShortcut( tr("ALT+Q") ); - actionAddFormula->setCheckable(true); - actionAddFormula->setIcon(QIcon(QPixmap(equation_xpm))); - connect(actionAddFormula, SIGNAL(triggered()), this, SLOT(addTexFormula())); - plotTools->addAction(actionAddFormula); - - actionAddText = new QAction(tr("Add &Text"), this); - actionAddText->setShortcut( tr("ALT+T") ); - actionAddText->setIcon(QIcon(QPixmap(text_xpm))); - actionAddText->setCheckable(true); - connect(actionAddText, SIGNAL(triggered()), this, SLOT(addText())); - plotTools->addAction(actionAddText); - - btnArrow = new QAction(tr("Draw &Arrow"), this); - btnArrow->setShortcut( tr("CTRL+ALT+A") ); - btnArrow->setActionGroup(dataTools); - btnArrow->setCheckable( true ); - btnArrow->setIcon(QIcon(QPixmap(arrow_xpm)) ); - plotTools->addAction(btnArrow); - - btnLine = new QAction(tr("Draw &Line"), this); - btnLine->setShortcut( tr("CTRL+ALT+L") ); - btnLine->setActionGroup(dataTools); - btnLine->setCheckable( true ); - btnLine->setIcon(QIcon(QPixmap(lPlot_xpm)) ); - plotTools->addAction(btnLine); - - QPixmap pix = QPixmap(16, 16); - pix.fill(Qt::transparent); - QPainter p; - p.begin(&pix); - p.setBrush(Qt::lightGray); - p.drawRect(QRect(1, 2, 12, 10)); - - actionAddRectangle = new QAction(tr("Add &Rectangle"), this); - actionAddRectangle->setShortcut( tr("CTRL+ALT+R") ); - actionAddRectangle->setCheckable(true); - actionAddRectangle->setIcon(QIcon(pix)); - connect(actionAddRectangle, SIGNAL(triggered()), this, SLOT(addRectangle())); - plotTools->addAction(actionAddRectangle); - - pix.fill(Qt::transparent); - p.drawEllipse(QRect(0, 2, 15, 12)); - p.end(); - - actionAddEllipse = new QAction(tr("Add &Ellipse"), this); - actionAddEllipse->setShortcut( tr("CTRL+ALT+E") ); - actionAddEllipse->setCheckable(true); - actionAddEllipse->setIcon(QIcon(pix)); - connect(actionAddEllipse, SIGNAL(triggered()), this, SLOT(addEllipse())); - plotTools->addAction(actionAddEllipse); - - plotTools->addAction(actionTimeStamp); - plotTools->addAction(actionAddImage); - plotTools->hide(); - - tableTools = new QToolBar(tr("Table"), this); - tableTools->setObjectName("tableTools"); // this is needed for QMainWindow::restoreState() - tableTools->setIconSize( QSize(16, 20)); - addToolBar(Qt::TopToolBarArea, tableTools); - - tableTools->addAction(actionPlotL); - tableTools->addAction(actionPlotP); - tableTools->addAction(actionPlotLP); - tableTools->addAction(actionPlotVerticalBars); - tableTools->addAction(actionPlotHorizontalBars); - tableTools->addAction(actionPlotArea); - tableTools->addAction(actionPlotPie); - tableTools->addAction(actionPlotHistogram); - tableTools->addAction(actionStemPlot); - tableTools->addAction(actionBoxPlot); - tableTools->addAction(actionPlotVectXYXY); - tableTools->addAction(actionPlotVectXYAM); - tableTools->addAction(actionPlotDoubleYAxis); - tableTools->addAction(actionWaterfallPlot); - tableTools->addAction(actionAddZoomPlot); - tableTools->addSeparator (); - tableTools->addAction(actionPlot3DRibbon); - tableTools->addAction(actionPlot3DBars); - tableTools->addAction(actionPlot3DScatter); - tableTools->addAction(actionPlot3DTrajectory); - tableTools->addSeparator(); - tableTools->addAction(actionAddColToTable); - tableTools->addAction(actionShowColStatistics); - tableTools->addAction(actionShowRowStatistics); - tableTools->addSeparator(); - tableTools->addAction(actionMoveRowUp); - tableTools->addAction(actionMoveRowDown); - tableTools->setEnabled(false); - tableTools->hide(); - - columnTools = new QToolBar(tr( "Column"), this); - columnTools->setObjectName("columnTools"); // this is needed for QMainWindow::restoreState() - columnTools->setIconSize(QSize(16, 20)); - addToolBar(Qt::TopToolBarArea, columnTools); - - columnTools->addAction(actionShowColumnValuesDialog); - columnTools->addAction(actionSetAscValues); - columnTools->addAction(actionSetRandomValues); - columnTools->addSeparator(); - columnTools->addAction(actionSetXCol); - columnTools->addAction(actionSetYCol); - columnTools->addAction(actionSetZCol); - columnTools->addAction(actionSetYErrCol); - columnTools->addAction(actionSetLabelCol); - columnTools->addAction(actionDisregardCol); - columnTools->addSeparator(); - columnTools->addAction(actionMoveColFirst); - columnTools->addAction(actionMoveColLeft); - columnTools->addAction(actionMoveColRight); - columnTools->addAction(actionMoveColLast); - columnTools->addAction(actionSwapColumns); - columnTools->addSeparator(); - columnTools->addAction(actionAdjustColumnWidth); - columnTools->setEnabled(false); - columnTools->hide(); - - displayBar = new QToolBar( tr( "Data Display" ), this ); - displayBar->setAllowedAreas( Qt::TopToolBarArea | Qt::BottomToolBarArea ); - displayBar->setObjectName("displayBar"); // this is needed for QMainWindow::restoreState() - info = new QLineEdit( this ); - displayBar->addWidget( info ); - info->setReadOnly(true); - QPalette palette; - palette.setColor(QPalette::Text, QColor(Qt::green)); - palette.setColor(QPalette::HighlightedText, QColor(Qt::darkGreen)); - palette.setColor(QPalette::Base, QColor(Qt::black)); - info->setPalette(palette); - - addToolBar( Qt::TopToolBarArea, displayBar ); - displayBar->hide(); - - insertToolBarBreak (displayBar); - - plotMatrixBar = new QToolBar( tr( "Matrix Plot" ), this); - plotMatrixBar->setObjectName("plotMatrixBar"); - addToolBar(Qt::BottomToolBarArea, plotMatrixBar); - - actionPlot3DWireFrame->addTo(plotMatrixBar); - actionPlot3DHiddenLine->addTo(plotMatrixBar); - - actionPlot3DPolygons->addTo(plotMatrixBar); - actionPlot3DWireSurface->addTo(plotMatrixBar); - - plotMatrixBar->addSeparator(); - - actionPlot3DBars->addTo(plotMatrixBar); - actionPlot3DScatter->addTo(plotMatrixBar); - - plotMatrixBar->addSeparator(); - actionColorMap->addTo(plotMatrixBar); - actionContourMap->addTo(plotMatrixBar); - actionGrayMap->addTo(plotMatrixBar); - actionImagePlot->addTo(plotMatrixBar); - actionPlotHistogram->addTo(plotMatrixBar); - plotMatrixBar->addSeparator(); - actionSetMatrixValues->addTo(plotMatrixBar); - actionFlipMatrixHorizontally->addTo(plotMatrixBar); - actionFlipMatrixVertically->addTo(plotMatrixBar); - actionRotateMatrix->addTo(plotMatrixBar); - actionRotateMatrixMinus->addTo(plotMatrixBar); - plotMatrixBar->addSeparator(); - plotMatrixBar->addAction(actionIncreasePrecision); - plotMatrixBar->addAction(actionDecreasePrecision); - plotMatrixBar->hide(); - - formatToolBar = new QToolBar(tr( "Format" ), this); - formatToolBar->setObjectName("formatToolBar"); - addToolBar(Qt::TopToolBarArea, formatToolBar); - - QFontComboBox *fb = new QFontComboBox(); - connect(fb, SIGNAL(currentFontChanged(const QFont &)), this, SLOT(setFontFamily(const QFont &))); - actionFontBox = formatToolBar->addWidget(fb); - - QSpinBox *sb = new QSpinBox(); - connect(sb, SIGNAL(valueChanged(int)), this, SLOT(setFontSize(int))); - actionFontSize = formatToolBar->addWidget(sb); - - actionFontBold->addTo(formatToolBar); - actionFontItalic->addTo(formatToolBar); - - actionUnderline->addTo(formatToolBar); - actionSuperscript->addTo(formatToolBar); - actionSubscript->addTo(formatToolBar); - actionGreekSymbol->addTo(formatToolBar); - actionGreekMajSymbol->addTo(formatToolBar); - actionMathSymbol->addTo(formatToolBar); - - formatToolBar->setEnabled(false); - formatToolBar->hide(); - - QList toolBars = toolBarsList(); - foreach (QToolBar *t, toolBars) - connect(t, SIGNAL(actionTriggered(QAction *)), this, SLOT(performCustomAction(QAction *))); -} - -void ApplicationWindow::insertTranslatedStrings() -{ - if (projectname == "untitled") - setWindowTitle(tr("QtiPlot - untitled")); - - lv->setColumnText (0, tr("Name")); - lv->setColumnText (1, tr("Type")); - lv->setColumnText (2, tr("View")); - lv->setColumnText (3, tr("Size")); - lv->setColumnText (4, tr("Created")); - lv->setColumnText (5, tr("Label")); - - if (scriptWindow) - scriptWindow->setWindowTitle(tr("QtiPlot - Script Window")); - explorerWindow->setWindowTitle(tr("Project Explorer")); - logWindow->setWindowTitle(tr("Results Log")); - undoStackWindow->setWindowTitle(tr("Undo Stack")); -#ifdef SCRIPTING_CONSOLE - consoleWindow->setWindowTitle(tr("Scripting Console")); -#endif - displayBar->setWindowTitle(tr("Data Display")); - tableTools->setWindowTitle(tr("Table")); - columnTools->setWindowTitle(tr("Column")); - plotTools->setWindowTitle(tr("Plot")); - fileTools->setWindowTitle(tr("File")); - editTools->setWindowTitle(tr("Edit")); - noteTools->setWindowTitle(tr("Notes")); - plotMatrixBar->setWindowTitle(tr("Matrix Plot")); - plot3DTools->setWindowTitle(tr("3D Surface")); - formatToolBar->setWindowTitle(tr("Format")); - - fileMenu->changeItem(recentMenuID, tr("&Recent Projects")); - fileMenu->setTitle(tr("&File")); - newMenu->setTitle(tr("&New")); - exportPlotMenu->setTitle(tr("&Export Graph")); - importMenu->setTitle(tr("&Import")); - edit->setTitle(tr("&Edit")); - view->setTitle(tr("&View")); - graphMenu->setTitle(tr("&Graph")); - plot3DMenu->setTitle(tr("3D &Plot")); - matrixMenu->setTitle(tr("&Matrix")); - plot2DMenu->setTitle(tr("&Plot")); - plotDataMenu->setTitle(tr("&Data")); - normMenu->setTitle(tr("&Normalize")); - fillMenu->setTitle(tr("&Fill Columns With")); - tableMenu->setTitle(tr("&Table")); - smoothMenu->setTitle(tr("&Smooth")); - filterMenu->setTitle(tr("&FFT filter")); - decayMenu->setTitle(tr("Fit E&xponential Decay")); - multiPeakMenu->setTitle(tr("Fit &Multi-peak")); - analysisMenu->setTitle(tr("&Analysis")); - format->setTitle(tr("F&ormat")); - scriptingMenu->setTitle(tr("&Scripting")); - windowsMenu->setTitle(tr("&Windows")); - help->setTitle(tr("&Help")); - - translateActionsStrings(); - customMenu(activeWindow()); -} - -void ApplicationWindow::initMainMenu() -{ - menuBar()->setObjectName("menuBar"); - - fileMenu = new QMenu(this); - fileMenu->setObjectName("fileMenu"); - connect(fileMenu, SIGNAL(aboutToShow()), this, SLOT(fileMenuAboutToShow())); - menuBar()->addMenu(fileMenu); - - recent = new QMenu(this); - newMenu = new QMenu(this); - newMenu->setObjectName("newMenu"); - exportPlotMenu = new QMenu(this); - exportPlotMenu->setObjectName("exportPlotMenu"); - importMenu = new QMenu(this); - importMenu->setObjectName("importMenu"); - - edit = new QMenu(this); - edit->setObjectName("editMenu"); - menuBar()->addMenu(edit); - - edit->addAction(actionUndo); - edit->addAction(actionRedo); - edit->insertSeparator(); - edit->addAction(actionCopySelection); - edit->addAction(actionPasteSelection); - edit->addAction(actionClearSelection); - edit->insertSeparator(); - edit->addAction(actionDeleteFitTables); - edit->addAction(actionClearLogInfo); - edit->insertSeparator(); - edit->addAction(actionShowConfigureDialog); - - connect(edit, SIGNAL(aboutToShow()), this, SLOT(editMenuAboutToShow())); - - view = new QMenu(this); - view->setObjectName("viewMenu"); - menuBar()->addMenu(view); - - view->setCheckable(true); - view->addAction(actionToolBars); - view->addAction(actionShowPlotWizard); - view->addAction(actionShowExplorer); - view->addAction(actionShowLog); - view->addAction(actionShowUndoStack); -#ifdef SCRIPTING_CONSOLE - view->addAction(actionShowConsole); -#endif - - scriptingMenu = new QMenu(this); - scriptingMenu->setObjectName("scriptingMenu"); - connect(scriptingMenu, SIGNAL(aboutToShow()), this, SLOT(scriptingMenuAboutToShow())); - menuBar()->addMenu(scriptingMenu); - - graphMenu = new QMenu(this); - graphMenu->setObjectName("graphMenu"); - graphMenu->setCheckable(true); - menuBar()->addMenu(graphMenu); - - graphMenu->addAction(actionShowCurvesDialog); - graphMenu->addAction(actionAddFunctionCurve); - graphMenu->addAction(actionAddErrorBars); - graphMenu->addAction(actionNewLegend); - graphMenu->addSeparator(); - graphMenu->addAction(actionAddFormula); - graphMenu->addAction(actionAddText); - graphMenu->addAction(btnArrow); - graphMenu->addAction(btnLine); - graphMenu->addAction(actionAddRectangle); - graphMenu->addAction(actionAddEllipse); - graphMenu->addAction(actionTimeStamp); - graphMenu->addAction(actionAddImage); - graphMenu->addSeparator();//layers section - graphMenu->addAction(actionAddLayer); - graphMenu->addAction(actionAddInsetLayer); - graphMenu->addAction(actionAddInsetCurveLayer); - graphMenu->addAction(actionShowLayerDialog); - graphMenu->addAction(actionAutomaticLayout); - graphMenu->addSeparator(); - graphMenu->addAction(actionExtractLayers); - graphMenu->addAction(actionExtractGraphs); - graphMenu->addSeparator(); - graphMenu->addAction(actionDeleteLayer); - - plot3DMenu = new QMenu(this); - plot3DMenu->setObjectName("plot3DMenu"); - plot3DMenu->addAction(actionPlot3DWireFrame); - plot3DMenu->addAction(actionPlot3DHiddenLine); - plot3DMenu->addAction(actionPlot3DPolygons); - plot3DMenu->addAction(actionPlot3DWireSurface); - plot3DMenu->insertSeparator(); - plot3DMenu->addAction(actionPlot3DBars); - plot3DMenu->addAction(actionPlot3DScatter); - plot3DMenu->insertSeparator(); - plot3DMenu->addAction(actionImagePlot); - plot3DMenu->addAction(actionColorMap); - plot3DMenu->addAction(actionContourMap); - plot3DMenu->addAction(actionGrayMap); - plot3DMenu->insertSeparator(); - plot3DMenu->addAction(actionPlotHistogram); - menuBar()->addMenu(plot3DMenu); - - matrixMenu = new QMenu(this); - matrixMenu->setObjectName("matrixMenu"); - connect(matrixMenu, SIGNAL(aboutToShow()), this, SLOT(matrixMenuAboutToShow())); - menuBar()->addMenu(matrixMenu); - - plot2DMenu = new QMenu(this); - plot2DMenu->setObjectName("plot2DMenu"); - connect(plot2DMenu, SIGNAL(aboutToShow()), this, SLOT(plotMenuAboutToShow())); - menuBar()->addMenu(plot2DMenu); - - plotDataMenu = new QMenu(this); - plotDataMenu->setObjectName("plotDataMenu"); - plotDataMenu->setCheckable(true); - connect(plotDataMenu, SIGNAL(aboutToShow()), this, SLOT(plotDataMenuAboutToShow())); - menuBar()->addMenu(plotDataMenu); - - normMenu = new QMenu(this); - normMenu->setObjectName("normMenu"); - - fillMenu = new QMenu(); - fillMenu->setObjectName("fillMenu"); - - analysisMenu = new QMenu(this); - analysisMenu->setObjectName("analysisMenu"); - connect(analysisMenu, SIGNAL(aboutToShow()), this, SLOT(analysisMenuAboutToShow())); - menuBar()->addMenu(analysisMenu); - - tableMenu = new QMenu(this); - tableMenu->setObjectName("tableMenu"); - connect(tableMenu, SIGNAL(aboutToShow()), this, SLOT(tableMenuAboutToShow())); - menuBar()->addMenu(tableMenu); - - smoothMenu = new QMenu(this); - smoothMenu->setObjectName("smoothMenu"); - - filterMenu = new QMenu(this); - filterMenu->setObjectName("filterMenu"); - - decayMenu = new QMenu(this); - decayMenu->setObjectName("decayMenu"); - - multiPeakMenu = new QMenu(this); - multiPeakMenu->setObjectName("multiPeakMenu"); - - format = new QMenu(this); - format->setObjectName("formatMenu"); - menuBar()->addMenu(format); - - windowsMenu = new QMenu(this); - windowsMenu->setObjectName("windowsMenu"); - windowsMenu->setCheckable(true); - connect(windowsMenu, SIGNAL(aboutToShow()), this, SLOT(windowsMenuAboutToShow())); - menuBar()->addMenu(windowsMenu); - - foldersMenu = new QMenu(this); - foldersMenu->setCheckable(true); - - help = new QMenu(this); - help->setObjectName("helpMenu"); - menuBar()->addMenu(help); - - help->addAction(actionShowHelp); - help->addAction(actionChooseHelpFolder); - help->insertSeparator(); - help->addAction(actionHomePage); - help->addAction(actionCheckUpdates); - help->addAction(actionDownloadManual); - help->addAction(actionTranslations); - help->insertSeparator(); - help->addAction(actionTechnicalSupport); - help->addAction(actionDonate); - help->addAction(actionHelpForums); - help->addAction(actionHelpBugReports); - help->insertSeparator(); - help->addAction(actionAbout); - - QList menus; - menus << windowsMenu << view << graphMenu << fileMenu << format << edit; - menus << help << plot2DMenu << analysisMenu; - menus << matrixMenu << plot3DMenu << plotDataMenu << scriptingMenu; - menus << tableMenu << newMenu << exportPlotMenu << importMenu; - - foreach (QMenu *m, menus) - connect(m, SIGNAL(triggered(QAction *)), this, SLOT(performCustomAction(QAction *))); - - disableActions(); -} - -void ApplicationWindow::tableMenuAboutToShow() -{ - tableMenu->clear(); - fillMenu->clear(); - - QMenu *setAsMenu = tableMenu->addMenu(tr("Set Columns &As")); - setAsMenu->addAction(actionSetXCol); - setAsMenu->addAction(actionSetYCol); - setAsMenu->addAction(actionSetZCol); - setAsMenu->insertSeparator(); - setAsMenu->addAction(actionSetLabelCol); - setAsMenu->addAction(actionDisregardCol); - setAsMenu->insertSeparator(); - setAsMenu->addAction(actionSetXErrCol); - setAsMenu->addAction(actionSetYErrCol); - setAsMenu->insertSeparator(); - setAsMenu->addAction(tr("&Read-only"), this, SLOT(setReadOnlyColumns())); - setAsMenu->addAction(tr("Read/&Write"), this, SLOT(setReadWriteColumns())); - - tableMenu->addAction(actionShowColumnOptionsDialog); - tableMenu->insertSeparator(); - - tableMenu->addAction(actionShowColumnValuesDialog); - tableMenu->addAction(actionTableRecalculate); - - fillMenu->addAction(actionSetAscValues); - fillMenu->addAction(actionSetRandomValues); - tableMenu->addMenu (fillMenu); - - tableMenu->addAction(actionClearTable); - tableMenu->insertSeparator(); - tableMenu->addAction(actionAddColToTable); - tableMenu->addAction(actionShowColsDialog); - tableMenu->insertSeparator(); - tableMenu->addAction(actionHideSelectedColumns); - tableMenu->addAction(actionShowAllColumns); - tableMenu->addAction(actionAdjustColumnWidth); - tableMenu->insertSeparator(); - tableMenu->addAction(actionMoveColFirst); - tableMenu->addAction(actionMoveColLeft); - tableMenu->addAction(actionMoveColRight); - tableMenu->addAction(actionMoveColLast); - tableMenu->addAction(actionSwapColumns); - tableMenu->insertSeparator(); - tableMenu->addAction(actionShowRowsDialog); - tableMenu->addAction(actionDeleteRows); - - QMenu *moveRowMenu = tableMenu->addMenu(tr("Move Row")); - moveRowMenu->addAction(actionMoveRowUp); - moveRowMenu->addAction(actionMoveRowDown); - - tableMenu->insertSeparator(); - tableMenu->addAction(actionGoToRow); - tableMenu->addAction(actionGoToColumn); - tableMenu->insertSeparator(); - - QMenu *convertToMatrixMenu = tableMenu->addMenu(tr("Convert to &Matrix")); - convertToMatrixMenu->addAction(actionConvertTableDirect); - convertToMatrixMenu->addAction(actionConvertTableBinning); - convertToMatrixMenu->addAction(actionConvertTableRegularXYZ); - - reloadCustomActions(); -} - -void ApplicationWindow::plotDataMenuAboutToShow() -{ - plotDataMenu->clear(); - plotDataMenu->addAction(btnPointer); - plotDataMenu->insertSeparator(); - plotDataMenu->addAction(actionMagnify); - plotDataMenu->addAction(btnZoomIn); - plotDataMenu->addAction(btnZoomOut); - plotDataMenu->addAction(actionUnzoom); - plotDataMenu->insertSeparator(); - plotDataMenu->addAction(btnCursor); - plotDataMenu->addAction(btnSelect); - plotDataMenu->addAction(btnPicker); - plotDataMenu->insertSeparator(); - plotDataMenu->addAction(actionDrawPoints); - plotDataMenu->addAction(btnMovePoints); - plotDataMenu->addAction(btnRemovePoints); - plotDataMenu->addAction(actionDragCurve); - - reloadCustomActions(); -} - -void ApplicationWindow::plotMenuAboutToShow() -{ - plot2DMenu->clear(); - - plot2DMenu->addAction(actionPlotL); - plot2DMenu->addAction(actionPlotP); - plot2DMenu->addAction(actionPlotLP); - - QMenu *specialPlotMenu = plot2DMenu->addMenu (tr("Special Line/Symb&ol")); - specialPlotMenu->addAction(actionPlotVerticalDropLines); - specialPlotMenu->addAction(actionPlotSpline); - specialPlotMenu->addAction(actionPlotVertSteps); - specialPlotMenu->addAction(actionPlotHorSteps); - specialPlotMenu->insertSeparator(); - specialPlotMenu->addAction(actionPlotDoubleYAxis); - specialPlotMenu->addAction(actionWaterfallPlot); - specialPlotMenu->addAction(actionAddZoomPlot); - - plot2DMenu->insertSeparator(); - plot2DMenu->addAction(actionPlotVerticalBars); - plot2DMenu->addAction(actionPlotHorizontalBars); - QMenu *specialBarMenu = plot2DMenu->addMenu (tr("Spec&ial Bar/Column")); - specialBarMenu->addAction(actionStackBars); - specialBarMenu->addAction(actionStackColumns); - - plot2DMenu->addAction(actionPlotArea); - plot2DMenu->addAction(actionPlotPie); - plot2DMenu->addAction(actionPlotVectXYXY); - plot2DMenu->addAction(actionPlotVectXYAM); - plot2DMenu->insertSeparator(); - - QMenu *statMenu = plot2DMenu->addMenu (tr("Statistical &Graphs")); - statMenu->addAction(actionBoxPlot); - statMenu->addAction(actionPlotHistogram); - statMenu->addAction(actionPlotStackedHistograms); - statMenu->insertSeparator(); - statMenu->addAction(actionStemPlot); - - QMenu *panelsMenu = plot2DMenu->addMenu (tr("Pa&nel")); - panelsMenu->addAction(actionPlot2VerticalLayers); - panelsMenu->addAction(actionPlot2HorizontalLayers); - panelsMenu->addAction(actionPlot4Layers); - panelsMenu->addAction(actionPlotStackedLayers); - - QMenu *plot3D = plot2DMenu->addMenu (tr("3&D Plot")); - plot3D->addAction(actionPlot3DRibbon); - plot3D->addAction(actionPlot3DBars); - plot3D->addAction(actionPlot3DScatter); - plot3D->addAction(actionPlot3DTrajectory); - - reloadCustomActions(); -} - -void ApplicationWindow::customMenu(QMdiSubWindow* w) -{ - analysisMenu->menuAction()->setVisible(false); - tableMenu->menuAction()->setVisible(false); - plotDataMenu->menuAction()->setVisible(false); - graphMenu->menuAction()->setVisible(false); - matrixMenu->menuAction()->setVisible(false); - format->menuAction()->setVisible(false); - plot2DMenu->menuAction()->setVisible(false); - plot3DMenu->menuAction()->setVisible(false); - - // these use the same keyboard shortcut (Ctrl+Return) and should not be enabled at the same time - actionNoteEvaluate->setEnabled(false); - actionTableRecalculate->setEnabled(false); - - // clear undo stack view (in case window is not a matrix) - d_undo_view->setStack(0); - actionUndo->setEnabled(false); - actionRedo->setEnabled(false); - - actionCopyWindow->setEnabled(w); - actionPrint->setEnabled(w); - actionPrintPreview->setEnabled(w); - actionExportPDF->setEnabled(w); - - if(w){ - actionPrintAllPlots->setEnabled(projectHas2DPlots()); - actionPrint->setEnabled(true); - actionCutSelection->setEnabled(true); - actionCopySelection->setEnabled(true); - actionPasteSelection->setEnabled(true); - actionClearSelection->setEnabled(true); - actionSaveTemplate->setEnabled(true); - QStringList tables = tableNames() + matrixNames(); - if (!tables.isEmpty()) - actionShowExportASCIIDialog->setEnabled(true); - else - actionShowExportASCIIDialog->setEnabled(false); - - if (w->isA("MultiLayer")) { - graphMenu->menuAction()->setVisible(true); - plotDataMenu->menuAction()->setVisible(true); - analysisMenu->menuAction()->setVisible(true); - format->menuAction()->setVisible(true); - format->clear(); - format->addAction(actionShowPlotDialog); - format->insertSeparator(); - format->addAction(actionShowScaleDialog); - format->addAction(actionShowAxisDialog); - actionShowAxisDialog->setEnabled(true); - format->insertSeparator(); - format->addAction(actionShowGridDialog); - format->addAction(actionShowTitleDialog); - } else if (w->isA("Graph3D")) { - disableActions(); - - actionPrint->setEnabled(true); - actionSaveTemplate->setEnabled(true); - - format->menuAction()->setVisible(true); - format->clear(); - format->addAction(actionShowPlotDialog); - format->addAction(actionShowScaleDialog); - format->addAction(actionShowAxisDialog); - format->addAction(actionShowTitleDialog); - if (((Graph3D*)w)->coordStyle() == Qwt3D::NOCOORD) - actionShowAxisDialog->setEnabled(false); - } else if (w->inherits("Table")) { - plot2DMenu->menuAction()->setVisible(true); - analysisMenu->menuAction()->setVisible(true); - tableMenu->menuAction()->setVisible(true); - - actionTableRecalculate->setEnabled(true); - } else if (w->isA("Matrix")){ - actionTableRecalculate->setEnabled(true); - - plot3DMenu->menuAction()->setVisible(true); - analysisMenu->menuAction()->setVisible(true); - matrixMenu->menuAction()->setVisible(true); - - d_undo_view->setEmptyLabel(w->objectName() + ": " + tr("Empty Stack")); - QUndoStack *stack = ((Matrix *)w)->undoStack(); - d_undo_view->setStack(stack); - } else if (qobject_cast(w)){ - actionSaveTemplate->setEnabled(false); - actionNoteEvaluate->setEnabled(true); - } else - disableActions(); - } else - disableActions(); - - reloadCustomActions(); -} - -void ApplicationWindow::disableActions() -{ - actionSaveTemplate->setEnabled(false); - actionPrintAllPlots->setEnabled(false); - actionPrint->setEnabled(false); - - actionCutSelection->setEnabled(false); - actionCopySelection->setEnabled(false); - actionPasteSelection->setEnabled(false); - actionClearSelection->setEnabled(false); -} - -void ApplicationWindow::customColumnActions() -{ - actionAdjustColumnWidth->setEnabled(false); - actionMoveColFirst->setEnabled(false); - actionMoveColLeft->setEnabled(false); - actionMoveColRight->setEnabled(false); - actionMoveColLast->setEnabled(false); - actionSetXCol->setEnabled(false); - actionSetYCol->setEnabled(false); - actionSetZCol->setEnabled(false); - actionSetLabelCol->setEnabled(false); - actionSetYErrCol->setEnabled(false); - actionDisregardCol->setEnabled(false); - actionSwapColumns->setEnabled(false); - actionSetAscValues->setEnabled(false); - actionSetRandomValues->setEnabled(false); - - Table *t = (Table*)activeWindow(TableWindow); - if (!t) - return; - - int selectedCols = t->selectedColsNumber(); - if (selectedCols == 1){ - int col = t->selectedColumn(); - if (col > 0){ - actionMoveColFirst->setEnabled(true); - actionMoveColLeft->setEnabled(true); - } - - if (col < t->numCols() - 1){ - actionMoveColRight->setEnabled(true); - actionMoveColLast->setEnabled(true); - } - } - - if (selectedCols >= 1){ - actionSetAscValues->setEnabled(true); - actionSetRandomValues->setEnabled(true); - actionSetXCol->setEnabled(true); - actionSetYCol->setEnabled(true); - actionSetZCol->setEnabled(true); - actionSetYErrCol->setEnabled(true); - actionSetLabelCol->setEnabled(true); - actionDisregardCol->setEnabled(true); - actionAdjustColumnWidth->setEnabled(true); - } - - if (selectedCols == 2) - actionSwapColumns->setEnabled(true); -} - -void ApplicationWindow::customToolBars(QMdiSubWindow* w) -{ - disableToolbars(); - if (!w) - return; - - if (w->isA("MultiLayer") && d_plot_tool_bar){ - if(!plotTools->isVisible()) - plotTools->show(); - plotTools->setEnabled (true); - custom2DPlotTools((MultiLayer *)w); - if(d_format_tool_bar && !formatToolBar->isVisible()){ - formatToolBar->setEnabled (true); - formatToolBar->show(); - } - } else if (w->inherits("Table")){ - if(d_table_tool_bar){ - if(!tableTools->isVisible()) - tableTools->show(); - tableTools->setEnabled (true); - } - if (d_column_tool_bar){ - if(!columnTools->isVisible()) - columnTools->show(); - columnTools->setEnabled (true); - customColumnActions(); - } - } else if (w->isA("Matrix") && d_matrix_tool_bar){ - if(!plotMatrixBar->isVisible()) - plotMatrixBar->show(); - plotMatrixBar->setEnabled (true); - } else if (w->isA("Graph3D") && d_plot3D_tool_bar){ - if(!plot3DTools->isVisible()) - plot3DTools->show(); - - if (((Graph3D*)w)->plotStyle() == Qwt3D::NOPLOT) - plot3DTools->setEnabled(false); - else - plot3DTools->setEnabled(true); - custom3DActions(w); - } else if (w->isA("Note")){ - if(d_format_tool_bar && !formatToolBar->isVisible()) - formatToolBar->show(); - if(d_notes_tool_bar && !noteTools->isVisible()) - noteTools->show(); - - formatToolBar->setEnabled (true); - noteTools->setEnabled (true); - setFormatBarFont(((Note*)w)->currentEditor()->currentFont()); - } -} - -void ApplicationWindow::disableToolbars() -{ - plotTools->setEnabled(false); - tableTools->setEnabled(false); - columnTools->setEnabled(false); - plot3DTools->setEnabled(false); - plotMatrixBar->setEnabled(false); - noteTools->setEnabled(false); -} - -void ApplicationWindow::plot3DRibbon() -{ - MdiSubWindow *w = activeWindow(TableWindow); - if (!w) - return; - - Table *table = static_cast(w); - if(table->selectedColumns().count() == 1){ - if (!validFor3DPlot(table)) - return; - plotXYZ(table, table->colName(table->selectedColumn()), Graph3D::Ribbon); - } else - QMessageBox::warning(this, tr("QtiPlot - Plot error"), tr("You must select exactly one column for plotting!")); -} - -void ApplicationWindow::plot3DWireframe() -{ - plot3DMatrix (0, Qwt3D::WIREFRAME); -} - -void ApplicationWindow::plot3DHiddenLine() -{ - plot3DMatrix (0, Qwt3D::HIDDENLINE); -} - -void ApplicationWindow::plot3DPolygons() -{ - plot3DMatrix (0, Qwt3D::FILLED); -} - -void ApplicationWindow::plot3DWireSurface() -{ - plot3DMatrix (0, Qwt3D::FILLEDMESH); -} - -void ApplicationWindow::plot3DBars() -{ - MdiSubWindow *w = activeWindow(); - if (!w) - return; - - if (w->inherits("Table")){ - Table *table = static_cast
(w); - if (!validFor3DPlot(table)) - return; - - if(table->selectedColumns().count() == 1) - plotXYZ(table, table->colName(table->selectedColumn()), Graph3D::Bars); - else - QMessageBox::warning(this, tr("QtiPlot - Plot error"),tr("You must select exactly one column for plotting!")); - } - else if(w->inherits("Matrix")) - plot3DMatrix(0, Qwt3D::USER); -} - -void ApplicationWindow::plot3DScatter() -{ - MdiSubWindow *w = activeWindow(); - if (!w) - return; - - if (w->inherits("Table")) - { - Table *table = static_cast
(w); - if (!validFor3DPlot(table)) - return; - - if(table->selectedColumns().count() == 1) - plotXYZ(table, table->colName(table->selectedColumn()), Graph3D::Scatter); - else - QMessageBox::warning(this, tr("QtiPlot - Plot error"),tr("You must select exactly one column for plotting!")); - } - else if(w->inherits("Matrix")) - plot3DMatrix (0, Qwt3D::POINTS); -} - -void ApplicationWindow::plot3DTrajectory() -{ - Table *table = (Table *)activeWindow(TableWindow); - if (!table) - return; - if (!validFor3DPlot(table)) - return; - - if(table->selectedColumns().count() == 1) - plotXYZ(table, table->colName(table->selectedColumn()), Graph3D::Trajectory); - else - QMessageBox::warning(this, tr("QtiPlot - Plot error"), tr("You must select exactly one column for plotting!")); -} - -void ApplicationWindow::plotBoxDiagram() -{ - generate2DGraph(Graph::Box); -} - -void ApplicationWindow::plotVerticalBars() -{ - generate2DGraph(Graph::VerticalBars); -} - -void ApplicationWindow::plotHorizontalBars() -{ - generate2DGraph(Graph::HorizontalBars); -} - -void ApplicationWindow::plotStackBar() -{ - generate2DGraph(Graph::StackBar); -} - -void ApplicationWindow::plotStackColumn() -{ - generate2DGraph(Graph::StackColumn); -} - -MultiLayer* ApplicationWindow::plotHistogram() -{ - return generate2DGraph(Graph::Histogram); -} - -MultiLayer* ApplicationWindow::plotHistogram(Matrix *m) -{ - if (!m){ - m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return 0; - } - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - MultiLayer* g = newGraph(); - if (g) - g->activeLayer()->addHistogram(m); - QApplication::restoreOverrideCursor(); - return g; -} - -void ApplicationWindow::plotArea() -{ - generate2DGraph(Graph::Area); -} - -void ApplicationWindow::plotPie() -{ - Table *table = (Table *)activeWindow(TableWindow); - if (!table) - return; - - if(table->selectedColumns().count() != 1){ - QMessageBox::warning(this, tr("QtiPlot - Plot error"), - tr("You must select exactly one column for plotting!")); - return; - } - - QStringList s = table->selectedColumns(); - if (s.count()>0){ - Q3TableSelection sel = table->getSelection(); - multilayerPlot(table, s, Graph::Pie, sel.topRow(), sel.bottomRow()); - } else - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select a column to plot!")); -} - -void ApplicationWindow::plotL() -{ - generate2DGraph(Graph::Line); -} - -void ApplicationWindow::plotP() -{ - generate2DGraph(Graph::Scatter); -} - -void ApplicationWindow::plotLP() -{ - generate2DGraph(Graph::LineSymbols); -} - -void ApplicationWindow::plotVerticalDropLines() -{ - generate2DGraph(Graph::VerticalDropLines); -} - -void ApplicationWindow::plotSpline() -{ - generate2DGraph(Graph::Spline); -} - -void ApplicationWindow::plotVertSteps() -{ - generate2DGraph(Graph::VerticalSteps); -} - -void ApplicationWindow::plotHorSteps() -{ - generate2DGraph(Graph::HorizontalSteps); -} - -void ApplicationWindow::plotVectXYXY() -{ - Table *table = (Table *)activeWindow(TableWindow); - if (!table) - return; - if (!validFor2DPlot(table, Graph::VectXYXY)) - return; - - QStringList s = table->selectedColumns(); - if (s.count() == 4) { - Q3TableSelection sel = table->getSelection(); - multilayerPlot(table, s, Graph::VectXYXY, sel.topRow(), sel.bottomRow()); - } else - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select four columns for this operation!")); -} - -void ApplicationWindow::plotVectXYAM() -{ - Table *table = (Table *)activeWindow(TableWindow); - if (!table) - return; - if (!validFor2DPlot(table, Graph::VectXYAM)) - return; - - QStringList s = table->selectedColumns(); - if (s.count() == 4){ - Q3TableSelection sel = table->getSelection(); - multilayerPlot(table, s, Graph::VectXYAM, sel.topRow(), sel.bottomRow()); - } else - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select four columns for this operation!")); -} - -void ApplicationWindow::renameListViewItem(const QString& oldName,const QString& newName) -{ - Q3ListViewItem *it=lv->findItem (oldName,0, Q3ListView::ExactMatch | Qt::CaseSensitive ); - if (it) - it->setText(0,newName); -} - -void ApplicationWindow::setListViewLabel(const QString& caption,const QString& label) -{ - Q3ListViewItem *it=lv->findItem ( caption, 0, Q3ListView::ExactMatch | Qt::CaseSensitive ); - if (it) - it->setText(5,label); -} - -void ApplicationWindow::setListViewDate(const QString& caption,const QString& date) -{ - Q3ListViewItem *it=lv->findItem ( caption, 0, Q3ListView::ExactMatch | Qt::CaseSensitive ); - if (it) - it->setText(4,date); -} - -void ApplicationWindow::setListView(const QString& caption,const QString& view) -{ - Q3ListViewItem *it=lv->findItem ( caption,0, Q3ListView::ExactMatch | Qt::CaseSensitive ); - if (it) - it->setText(2,view); -} - -void ApplicationWindow::setListViewSize(const QString& caption,const QString& size) -{ - Q3ListViewItem *it=lv->findItem ( caption,0, Q3ListView::ExactMatch | Qt::CaseSensitive ); - if (it) - it->setText(3,size); -} - -QString ApplicationWindow::listViewDate(const QString& caption) -{ - Q3ListViewItem *it=lv->findItem (caption,0, Q3ListView::ExactMatch | Qt::CaseSensitive ); - if (it) - return it->text(4); - else - return ""; -} - -void ApplicationWindow::updateTableNames(const QString& oldName, const QString& newName) -{ - QList windows = windowsList(); - foreach (MdiSubWindow *w, windows) { - if (w->isA("MultiLayer")) { - QList layers = ((MultiLayer*)w)->layersList(); - foreach(Graph *g, layers) - g->updateCurveNames(oldName, newName); - } else if (w->isA("Graph3D")) { - QString name = ((Graph3D*)w)->formula(); - if (name.contains(oldName, true)) { - name.replace(oldName,newName); - ((Graph3D*)w)->setPlotAssociation(name); - } - } - } -} - -void ApplicationWindow::updateColNames(const QString& oldName, const QString& newName) -{ - QList windows = windowsList(); - foreach (MdiSubWindow *w, windows){ - if (w->isA("MultiLayer")){ - QList layers = ((MultiLayer*)w)->layersList(); - foreach(Graph *g, layers) - g->updateCurveNames(oldName, newName, false); - } - else if (w->isA("Graph3D")){ - QString name = ((Graph3D*)w)->formula(); - if (name.contains(oldName)){ - name.replace(oldName,newName); - ((Graph3D*)w)->setPlotAssociation(name); - } - } - } -} - -void ApplicationWindow::changeMatrixName(const QString& oldName, const QString& newName) -{ - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - if (w->isA("Graph3D")) - { - QString s = ((Graph3D*)w)->formula(); - if (s.contains(oldName)) - { - s.replace(oldName, newName); - ((Graph3D*)w)->setPlotAssociation(s); - } - } - else if (w->isA("MultiLayer")) - { - QList layers = ((MultiLayer*)w)->layersList(); - foreach(Graph *g, layers){ - for (int i=0; icurveCount(); i++){ - QwtPlotItem *sp = (QwtPlotItem *)g->plotItem(i); - if (sp && sp->rtti() == QwtPlotItem::Rtti_PlotSpectrogram && sp->title().text() == oldName) - sp->setTitle(newName); - } - } - } - } -} - -void ApplicationWindow::remove3DMatrixPlots(Matrix *m) -{ - if (!m) - return; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - if (w->isA("Graph3D") && ((Graph3D*)w)->matrix() == m) - ((Graph3D*)w)->clearData(); - else if (w->isA("MultiLayer")){ - QList layers = ((MultiLayer*)w)->layersList(); - foreach(Graph *g, layers){ - QList curvesList = g->curvesList(); - foreach (QwtPlotItem *it, curvesList){ - if (it->rtti() == QwtPlotItem::Rtti_PlotSpectrogram){ - if (((Spectrogram *)it)->matrix() == m) - g->removeCurve(it); - } else if (((PlotCurve *)it)->type() == Graph::Histogram){ - if (((QwtHistogram *)it)->matrix() == m) - g->removeCurve(it); - } - } - g->updatePlot(); - } - } - } - QApplication::restoreOverrideCursor(); -} - -void ApplicationWindow::updateMatrixPlots(Matrix *m) -{ - if (!m) - return; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - if (w->isA("Graph3D") && ((Graph3D*)w)->matrix() == m) - ((Graph3D*)w)->updateMatrixData(m); - else if (w->isA("MultiLayer")){ - QList layers = ((MultiLayer*)w)->layersList(); - foreach(Graph *g, layers){ - QList curvesList = g->curvesList(); - foreach (QwtPlotItem *it, curvesList){ - if (it->rtti() == QwtPlotItem::Rtti_PlotSpectrogram){ - Spectrogram *sp = (Spectrogram *)it; - if (sp->matrix() == m){ - sp->updateData(); - g->updatePlot(); - } - } else if (((PlotCurve *)it)->type() == Graph::Histogram){ - QwtHistogram *h = (QwtHistogram *)it; - if (h->matrix() == m){ - h->loadData(); - g->updatePlot(); - } - } - } - } - } - } - QApplication::restoreOverrideCursor(); -} - -void ApplicationWindow::add3DData() -{ - if (!hasTable()){ - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no tables available in this project.

" - "

Please create a table and try again!

")); - return; - } - - QStringList zColumns = columnsList(Table::Z); - if ((int)zColumns.count() <= 0){ - QMessageBox::critical(this,tr("QtiPlot - Warning"), - tr("There are no available columns with plot designation set to Z!")); - return; - } - - bool ok; - QString column = QInputDialog::getItem(this, tr("QtiPlot - Choose data set"), - tr("Column") + ": ", zColumns, 0, false, &ok); - if (ok && !column.isEmpty()) - insertNew3DData(column); -} - -void ApplicationWindow::change3DData() -{ - bool ok; - QString column = QInputDialog::getItem(this, tr("QtiPlot - Choose data set"), - tr("Column") + ": ", columnsList(Table::Z), 0, false, &ok); - if (ok && !column.isEmpty()) - change3DData(column); -} - -void ApplicationWindow::change3DMatrix() -{ - QStringList matrices = matrixNames(); - int currentIndex = 0; - Graph3D* g = (Graph3D*)activeWindow(Plot3DWindow); - if (g && g->matrix()) - currentIndex = matrices.indexOf(g->matrix()->objectName()); - - bool ok; - QString matrixName = QInputDialog::getItem(this, tr("QtiPlot - Choose matrix to plot"), - tr("Matrix") + ": ", matrices, currentIndex, false, &ok); - if (ok && !matrixName.isEmpty()) - change3DMatrix(matrixName); -} - -void ApplicationWindow::change3DMatrix(const QString& matrix_name) -{ - Graph3D *g = (Graph3D*)activeWindow(Plot3DWindow); - if (!g) - return; - - Matrix *m = matrix(matrix_name); - if (!m) - return; - - if (d_3D_autoscale) - g->addMatrixData(m); - else - g->addMatrixData(m, g->xStart(), g->xStop(), g->yStart(), g->yStop(), g->zStart(), g->zStop()); - - emit modified(); -} - -void ApplicationWindow::add3DMatrixPlot() -{ - QStringList matrices = matrixNames(); - if ((int)matrices.count() <= 0){ - QMessageBox::warning(this, tr("QtiPlot - Warning"), - tr("

There are no matrices available in this project.

" - "

Please create a matrix and try again!

")); - return; - } - - bool ok; - QString matrixName = QInputDialog::getItem(this, tr("QtiPlot - Choose matrix to plot"), - tr("Matrix") + ": ", matrices, 0, false, &ok); - if (ok && !matrixName.isEmpty()) - insert3DMatrixPlot(matrixName); -} - -void ApplicationWindow::insert3DMatrixPlot(const QString& matrix_name) -{ - Graph3D *g = (Graph3D*)activeWindow(Plot3DWindow); - if (!g) - return; - - g->addMatrixData(matrix(matrix_name)); - emit modified(); -} - -void ApplicationWindow::insertNew3DData(const QString& colName) -{ - Graph3D *g = (Graph3D*)activeWindow(Plot3DWindow); - if (!g) - return; - - g->insertNewData(table(colName),colName); - emit modified(); -} - -void ApplicationWindow::change3DData(const QString& colName) -{ - Graph3D *g = (Graph3D*)activeWindow(Plot3DWindow); - if (!g) - return; - - g->changeDataColumn(table(colName), colName, g->tablePlotType()); - emit modified(); -} - -void ApplicationWindow::editSurfacePlot() -{ - Graph3D *g = (Graph3D*)activeWindow(Plot3DWindow); - if (!g) - return; - - SurfaceDialog* sd = new SurfaceDialog(this); - sd->setAttribute(Qt::WA_DeleteOnClose); - - if (g->hasData() && g->userFunction()) - sd->setFunction(g); - else if (g->hasData() && g->parametricSurface()) - sd->setParametricSurface(g); - else - sd->setGraph(g); - sd->exec(); -} - -void ApplicationWindow::newSurfacePlot() -{ - SurfaceDialog* sd = new SurfaceDialog(this); - sd->setAttribute(Qt::WA_DeleteOnClose); - sd->exec(); -} - -Graph3D* ApplicationWindow::plotSurface(const QString& formula, double xl, double xr, - double yl, double yr, double zl, double zr, int columns, int rows) -{ - Graph3D *plot = newPlot3D(); - if(!plot) - return 0; - - plot->addFunction(formula, xl, xr, yl, yr, zl, zr, columns, rows); - plot->setDataColorMap(d_3D_color_map); - plot->update(); - - emit modified(); - return plot; -} - -Graph3D* ApplicationWindow::plotParametricSurface(const QString& xFormula, const QString& yFormula, - const QString& zFormula, double ul, double ur, double vl, double vr, - int columns, int rows, bool uPeriodic, bool vPeriodic) -{ - Graph3D *plot = newPlot3D(); - if(!plot) - return 0; - plot->addParametricSurface(xFormula, yFormula, zFormula, ul, ur, vl, vr, - columns, rows, uPeriodic, vPeriodic); - plot->setDataColorMap(d_3D_color_map); - plot->update(); - - emit modified(); - return plot; -} - -void ApplicationWindow::updateSurfaceFuncList(const QString& s) -{ - surfaceFunc.remove(s); - surfaceFunc.push_front(s); - while ((int)surfaceFunc.size() > 10) - surfaceFunc.pop_back(); -} - -Graph3D* ApplicationWindow::addRibbon(const QString& caption, const QString& formula, - double xl, double xr, double yl, double yr, double zl, double zr) -{ - Table* t = table(formula.left(formula.find("_", 0))); - if (!t) - return 0; - - QString s = formula; - s.remove("(X)").remove("(Y)"); - QStringList l = s.split(","); - if (l.size() != 2) - return 0; - - Graph3D *plot = newPlot3D(caption); - if(!plot) - return 0; - - plot->addRibbon(t, l[0], l[1], xl, xr, yl, yr, zl, zr); - plot->setDataColorMap(d_3D_color_map); - plot->update(); - - return plot; -} - -Graph3D* ApplicationWindow::newPlot3D(const QString& title) -{ - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - QString label = title; - if (label.isEmpty() || alreadyUsedName(label)) - label = generateUniqueName(tr("Graph")); - - Graph3D *plot = new Graph3D("", this, 0); - plot->setWindowTitle(label); - plot->setName(label); - - initPlot3D(plot); - - emit modified(); - QApplication::restoreOverrideCursor(); - return plot; -} - -Graph3D* ApplicationWindow::plotXYZ(Table* table, const QString& zColName, int type) -{ - int zCol = table->colIndex(zColName); - if (zCol < 0) - return 0; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - Graph3D *plot = newPlot3D(); - if(!plot) - return 0; - - if (type == Graph3D::Ribbon) { - int ycol = table->colIndex(zColName); - plot->addRibbon(table, table->colName(table->colX(ycol)), zColName); - } else - plot->addData(table, table->colX(zCol), table->colY(zCol), zCol, type); - - plot->setDataColorMap(d_3D_color_map); - plot->update(); - - emit modified(); - QApplication::restoreOverrideCursor(); - return plot; -} - -void ApplicationWindow::initPlot3D(Graph3D *plot) -{ - if (d_mdi_windows_area) - d_workspace->addSubWindow(plot); - else - plot->setParent(0); - - connectSurfacePlot(plot); - - plot->setIcon(QPixmap(trajectory_xpm)); - plot->show(); -#ifdef Q_OS_MAC // otherwise crash on Mac OS X - plot->surface()->resize(plot->size()); -#endif - plot->setFocus(); - - addListViewItem(plot); - - if (!plot3DTools->isVisible()) - plot3DTools->show(); - - if (!plot3DTools->isEnabled()) - plot3DTools->setEnabled(true); - - customMenu(plot); - customToolBars(plot); -} - -void ApplicationWindow::exportMatrix(const QString& exportFilter) -{ - Matrix* m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return; - - ImageExportDialog *ied = new ImageExportDialog(m, this, d_extended_export_dialog); - ied->setDir(imagesDirPath); - ied->selectFile(m->objectName()); - if (exportFilter.isEmpty()) - ied->selectFilter(d_image_export_filter); - else - ied->selectFilter(exportFilter); - - if ( ied->exec() != QDialog::Accepted ) - return; - imagesDirPath = ied->directory().path(); - if (ied->selectedFiles().isEmpty()) - return; - - QString selected_filter = ied->selectedFilter().remove("*"); - QString file_name = ied->selectedFiles()[0]; - if(!file_name.endsWith(selected_filter, Qt::CaseInsensitive)) - file_name.append(selected_filter); - - QFile file(file_name); - if (!file.open( QIODevice::WriteOnly )){ - QMessageBox::critical(this, tr("QtiPlot - Export error"), - tr("Could not write to file:

%1

Please verify that you have the right to write to this location!").arg(file_name)); - return; - } - file.close(); - - if (selected_filter.contains(".eps") || selected_filter.contains(".pdf") || selected_filter.contains(".ps")) - m->exportVector(file_name, ied->vectorResolution(), ied->color()); - else if (selected_filter.contains(".svg")) - m->exportSVG(file_name); -#ifdef EMF_OUTPUT - else if (selected_filter.contains(".emf")) - m->exportEMF(file_name); -#endif - else if (selected_filter.contains(".odf")) - m->exportRasterImage(file_name, ied->quality(), ied->bitmapResolution()); - else { - QList list = QImageWriter::supportedImageFormats(); - for (int i=0; i<(int)list.count(); i++){ - if (selected_filter.contains("." + (list[i]).lower())) - m->exportRasterImage(file_name, ied->quality(), ied->bitmapResolution()); - } - } -} - -Matrix* ApplicationWindow::importImage(const QString& fileName, bool newWindow) -{ - QString fn = fileName; - if (fn.isEmpty()){ - fn = getFileName(this, tr("QtiPlot - Import image from file"), imagesDirPath, imageFilter(), 0, false); - if ( !fn.isEmpty() ){ - QFileInfo fi(fn); - imagesDirPath = fi.dirPath(true); - } - } - - QImage image(fn); - if (image.isNull()) - return 0; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - MdiSubWindow *w = activeWindow(MatrixWindow); - Matrix* m = NULL; - if (w && !newWindow){ - m = (Matrix *)w; - m->importImage(fn); - } else { - m = new Matrix(scriptEnv, image, "", this); - initMatrix(m, generateUniqueName(tr("Matrix"))); - m->show(); - m->setWindowLabel(fn); - m->setCaptionPolicy(MdiSubWindow::Both); - } - - QApplication::restoreOverrideCursor(); - return m; -} - -QString ApplicationWindow::imageFilter() -{ - QList list = QImageReader::supportedImageFormats(); - QString filter = tr("Images") + " (", aux1, aux2; - for (int i = 0; i < (int)list.count(); i++){ - aux1 = " *." + list[i] + " "; - aux2 += " *." + list[i] + ";;"; - filter += aux1; - } - filter += ");;" + aux2; - return filter; -} - -void ApplicationWindow::loadImage() -{ - QString fn = getFileName(this, tr("QtiPlot - Load image from file"), imagesDirPath, imageFilter(), 0, false); - if ( !fn.isEmpty() ){ - loadImage(fn); - QFileInfo fi(fn); - imagesDirPath = fi.dirPath(true); - } -} - -void ApplicationWindow::loadImage(const QString& fn) -{ - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - MultiLayer *plot = multilayerPlot(generateUniqueName(tr("Graph"))); - plot->setWindowLabel(fn); - plot->setCaptionPolicy(MdiSubWindow::Both); - - Graph *g = plot->activeLayer(); - g->setTitle(""); - for (int i=0; i<4; i++) - g->enableAxis(i, false); - g->addImage(fn); - QApplication::restoreOverrideCursor(); -} - -MultiLayer* ApplicationWindow::multilayerPlot(const QString& caption, int layers, int rows, int cols) -{ - MultiLayer* ml = new MultiLayer(this, layers, rows, cols); - QString label = caption; - initMultilayerPlot(ml, label.replace(QRegExp("_"), "-")); - ml->arrangeLayers(false, false); - return ml; -} - -MultiLayer* ApplicationWindow::newGraph(const QString& caption) -{ - MultiLayer *ml = multilayerPlot(generateUniqueName(caption)); - if (ml){ - Graph *g = ml->activeLayer(); - setPreferences(g); - g->newLegend(); - } - return ml; -} - -MultiLayer* ApplicationWindow::multilayerPlot(Table* w, const QStringList& colList, int style, int startRow, int endRow) -{//used when plotting selected columns - if (!w) - return 0; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - MultiLayer* g = multilayerPlot(generateUniqueName(tr("Graph"))); - Graph *ag = g->activeLayer(); - if (!ag) - return 0; - - setPreferences(ag); - ag->addCurves(w, colList, style, defaultCurveLineWidth, defaultSymbolSize, startRow, endRow); - - ag->newLegend(); - - QApplication::restoreOverrideCursor(); - return g; -} - -MultiLayer* ApplicationWindow::multilayerPlot(int c, int r, int style) -{//used when plotting from the panel menu - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return 0; - - if (!validFor2DPlot(t, (Graph::CurveType)style)) - return 0; - - QStringList list = t->selectedYColumns(); - if((int)list.count() < 1) { - QMessageBox::warning(this, tr("QtiPlot - Plot error"), tr("Please select a Y column to plot!")); - return 0; - } - - int curves = list.count(); - if (r < 0) - r = curves; - - int layers = c*r; - MultiLayer* g = multilayerPlot(generateUniqueName(tr("Graph")), layers, r, c); - QList layersList = g->layersList(); - int i = 0; - foreach(Graph *ag, layersList){ - setPreferences(ag); - if (i < curves) - ag->addCurves(t, QStringList(list[i]), style, defaultCurveLineWidth, defaultSymbolSize); - ag->newLegend(); - i++; - } - return g; -} - -MultiLayer* ApplicationWindow::multilayerPlot(const QStringList& colList) -{//used when plotting from wizard - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - MultiLayer* g = multilayerPlot(generateUniqueName(tr("Graph"))); - Graph *ag = g->activeLayer(); - setPreferences(ag); - int curves = (int)colList.count(); - int errorBars = 0; - for (int i=0; icolIndex(xColName); - - posX = s.find(",", posX); - int posY = s.find("(Y)", posX); - QString yColName = caption+s.mid(posX+2, posY-posX-2); - - PlotCurve *c = NULL; - if (s.contains("(yErr)") || s.contains("(xErr)")){ - posY = s.find(",", posY); - int posErr, errType; - if (s.contains("(yErr)")){ - errType = QwtErrorPlotCurve::Vertical; - posErr = s.find("(yErr)", posY); - } else { - errType = QwtErrorPlotCurve::Horizontal; - posErr = s.find("(xErr)",posY); - } - - QString errColName = caption+s.mid(posY+2, posErr-posY-2); - c = (PlotCurve *)ag->addErrorBars(xColName, yColName, w, errColName, errType); - } else - c = (PlotCurve *)ag->insertCurve(w, xCol, yColName, defaultCurveStyle); - - CurveLayout cl = ag->initCurveLayout(defaultCurveStyle, curves - errorBars); - cl.lWidth = defaultCurveLineWidth; - cl.sSize = defaultSymbolSize; - ag->updateCurveLayout(c, &cl); - } - ag->newLegend(); - QApplication::restoreOverrideCursor(); - return g; -} - -MultiLayer* ApplicationWindow::waterfallPlot() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return 0; - - return waterfallPlot(t, t->selectedYColumns()); -} - -MultiLayer* ApplicationWindow::waterfallPlot(Table *t, const QStringList& list) -{ - if (!t) - return 0; - - int curves = list.count(); - if(curves < 1){ - QMessageBox::warning(this, tr("QtiPlot - Plot error"), - tr("Please select a Y column to plot!")); - return 0; - } - - MultiLayer* ml = new MultiLayer(this, curves, 1, 1); - QList layersList = ml->layersList(); - int i = 0; - foreach(Graph *g, layersList){ - DataCurve *cv = g->insertCurve(t, list[i], Graph::Line); - if (cv) - cv->setPen(QPen(ColorBox::color(i), defaultCurveLineWidth)); - i++; - } - QString legend = QString(); - initMultilayerPlot(ml, QString()); - foreach(Graph *g, layersList){ - g->hide(); - legend += g->legendText(true) + "\n"; - setPreferences(g); - g->setCanvasFrame(0); - g->setTitle(QString::null); - g->setMargin(0); - g->setFrame(0); - g->raise(); - } - - ml->setWaterfallLayout(); - Graph *g = layersList.last(); - if (g) - g->newLegend(legend.trimmed())->move(QPoint(5, 5)); - return ml; -} - -void ApplicationWindow::initMultilayerPlot(MultiLayer* g, const QString& name) -{ - QString label = name; - while(alreadyUsedName(label)) - label = generateUniqueName(tr("Graph")); - - g->setWindowTitle(label); - g->setName(label); - g->setIcon(QPixmap(graph_xpm)); - g->setScaleLayersOnPrint(d_scale_plots_on_print); - g->printCropmarks(d_print_cropmarks); - - if (d_mdi_windows_area) - d_workspace->addSubWindow(g); - else - g->setParent(0); - - connectMultilayerPlot(g); - g->showNormal(); - - addListViewItem(g); -} - -void ApplicationWindow::setAutoUpdateTableValues(bool on) -{ - if (d_auto_update_table_values == on) - return; - - d_auto_update_table_values = on; - - Folder *f = projectFolder(); - while (f){ - QList folderWindows = f->windowsList(); - foreach(MdiSubWindow *w, folderWindows){ - if (w->inherits("Table")) - ((Table *)w)->setAutoUpdateValues(d_auto_update_table_values); - } - f = f->folderBelow(); - } -} - -void ApplicationWindow::customTable(Table* w) -{ - QColorGroup cg; - cg.setColor(QColorGroup::Base, tableBkgdColor); - cg.setColor(QColorGroup::Text, tableTextColor); - w->setPalette(QPalette(cg, cg, cg)); - - w->setHeaderColor(tableHeaderColor); - w->setTextFont(tableTextFont); - w->setHeaderFont(tableHeaderFont); - w->showComments(d_show_table_comments); - w->setNumericPrecision(d_decimal_digits); -} - -void ApplicationWindow::setPreferences(Graph* g) -{ - if (!g->isPiePlot()){ - for (int i = 0; i < QwtPlot::axisCnt; i++){ - bool show = d_show_axes[i]; - g->enableAxis(i, show); - if(show){ - ScaleDraw *sd = (ScaleDraw *)g->axisScaleDraw (i); - sd->enableComponent(QwtAbstractScaleDraw::Labels, d_show_axes_labels[i]); - } - } - - g->updateSecondaryAxis(QwtPlot::xTop); - g->updateSecondaryAxis(QwtPlot::yRight); - - QList ticksList; - ticksList<setMajorTicksType(ticksList); - ticksList.clear(); - ticksList<setMinorTicksType(ticksList); - - g->setTicksLength (minTicksLength, majTicksLength); - g->setAxesLinewidth(axesLineWidth); - g->drawAxesBackbones(drawBackbones); - g->setCanvasFrame(canvasFrameWidth, d_canvas_frame_color); - for (int i = 0; i < QwtPlot::axisCnt; i++) - g->setAxisTitleDistance(i, d_graph_axes_labels_dist); - } - - g->initFonts(plotAxesFont, plotNumbersFont); - g->initTitle(titleOn, plotTitleFont); - - g->setMargin(defaultPlotMargin); - g->enableAutoscaling(autoscale2DPlots); - g->setAutoscaleFonts(autoScaleFonts); - g->setAntialiasing(antialiasing2DPlots); - g->setFrame(d_graph_border_width, d_graph_border_color); - - QColor c = d_graph_background_color; - c.setAlpha(d_graph_background_opacity); - g->setBackgroundColor(c); - - c = d_graph_canvas_color; - c.setAlpha(d_graph_canvas_opacity); - g->setCanvasBackground(c); -} - -/* - * return the current Plot (used for the Python interface) - */ -MultiLayer* ApplicationWindow::currentPlot() -{ - MultiLayer* p = (MultiLayer*)activeWindow(MultiLayerWindow); - return p; -} - -/* - * return the current Table (used for the Python interface) - */ -Table* ApplicationWindow::currentTable() -{ - Table* w = (Table*)activeWindow(TableWindow); - return w; -} - -/* - *creates a new empty table - */ -Table* ApplicationWindow::newTable() -{ - Table* w = new Table(scriptEnv, 30, 2, "", this, 0); - initTable(w, generateUniqueName(tr("Table"))); - w->showNormal(); - return w; -} - -/* - *used when opening a project file - */ -Table* ApplicationWindow::newTable(const QString& caption, int r, int c) -{ - Table* w = new Table(scriptEnv, r, c, "", this, 0); - initTable(w, caption); - if (d_is_appending_file && w->objectName() != caption){//the table was renamed - renamedTables << caption << w->objectName(); - if (d_inform_rename_table){ - QApplication::restoreOverrideCursor(); - QMessageBox:: warning(this, tr("QtiPlot - Renamed Window"), - tr("The table '%1' already exists. It has been renamed '%2'.").arg(caption).arg(w->objectName())); - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - } - } - w->showNormal(); - return w; -} - -Table* ApplicationWindow::newTable(int r, int c, const QString& name, const QString& legend) -{ - Table* w = new Table(scriptEnv, r, c, legend, this, 0); - initTable(w, name); - return w; -} - -Table* ApplicationWindow::newTable(const QString& caption, int r, int c, const QString& text) -{ - QStringList lst = caption.split("\t", QString::SkipEmptyParts); - QString legend = QString(); - if (lst.count() == 2) - legend = lst[1]; - - Table* w = new Table(scriptEnv, r, c, legend, this, 0); - - QStringList rows = text.split("\n", QString::SkipEmptyParts); - QString rlist = rows[0]; - QStringList list = rlist.split("\t"); - w->setHeader(list); - - for (int i=0; isetText(i, j, list[j]); - } - - initTable(w, lst[0]); - w->showNormal(); - return w; -} - -Table* ApplicationWindow::newHiddenTable(const QString& name, const QString& label, int r, int c, const QString& text) -{ - Table* w = new Table(scriptEnv, r, c, label, this, 0); - - if (!text.isEmpty()) { - QStringList rows = text.split("\n", QString::SkipEmptyParts); - QStringList list = rows[0].split("\t"); - w->setHeader(list); - - QString rlist; - for (int i=0; isetText(i, j, list[j]); - } - } - - initTable(w, name); - hideWindow(w); - return w; -} - -void ApplicationWindow::initTable(Table* w, const QString& caption) -{ - QString name = caption; - name = name.replace ("_","-"); - - while(name.isEmpty() || alreadyUsedName(name)) - name = generateUniqueName(tr("Table")); - - if (d_mdi_windows_area) - d_workspace->addSubWindow(w); - else - w->setParent(0); - - connectTable(w); - customTable(w); - - w->setName(name); - w->setIcon( QPixmap(worksheet_xpm) ); - addListViewItem(w); -} - -/* - * !creates a new table with type statistics on target columns/rows of table base - */ -TableStatistics *ApplicationWindow::newTableStatistics(Table *base, int type, QList target, const QString &caption) -{ - TableStatistics* s = new TableStatistics(scriptEnv, this, base, (TableStatistics::Type) type, target); - if (caption.isEmpty()) - initTable(s, s->objectName()); - else - initTable(s, caption); - s->showNormal(); - return s; -} - -/* - * return the current note (used for the Python interface) - */ -Note* ApplicationWindow::currentNote() -{ - Note* m = (Note*)activeWindow(NoteWindow); - return m; -} - -/* - *creates a new empty note window - */ -Note* ApplicationWindow::newNote(const QString& caption) -{ - Note* m = new Note(scriptEnv, "", this); - - QString name = caption; - while(name.isEmpty() || alreadyUsedName(name)) - name = generateUniqueName(tr("Notes")); - - m->setName(name); - m->setIcon(QPixmap(note_xpm)); - m->askOnCloseEvent(confirmCloseNotes); - - if (d_mdi_windows_area) - d_workspace->addSubWindow(m); - else - m->setParent(0); - - addListViewItem(m); - - connect(m, SIGNAL(modifiedWindow(MdiSubWindow*)), this, SLOT(modifiedProject(MdiSubWindow*))); - connect(m, SIGNAL(resizedWindow(MdiSubWindow*)),this,SLOT(modifiedProject(MdiSubWindow*))); - connect(m, SIGNAL(closedWindow(MdiSubWindow*)), this, SLOT(closeWindow(MdiSubWindow*))); - connect(m, SIGNAL(hiddenWindow(MdiSubWindow*)), this, SLOT(hideWindow(MdiSubWindow*))); - connect(m, SIGNAL(statusChanged(MdiSubWindow*)), this, SLOT(updateWindowStatus(MdiSubWindow*))); - connect(m, SIGNAL(dirPathChanged(const QString&)), this, SLOT(scriptsDirPathChanged(const QString&))); - connect(m, SIGNAL(currentEditorChanged()), this, SLOT(scriptingMenuAboutToShow())); - - m->showNormal(); - return m; -} -/* - * return the current Matrix (used for the Python interface) - */ -Matrix* ApplicationWindow::currentMatrix() -{ - Matrix* m = (Matrix*)activeWindow(MatrixWindow); - return m; -} - -Matrix* ApplicationWindow::newMatrix(int rows, int columns) -{ - Matrix* m = new Matrix(scriptEnv, rows, columns, "", this, 0); - initMatrix(m, generateUniqueName(tr("Matrix"))); - m->showNormal(); - return m; -} - -Matrix* ApplicationWindow::newMatrix(const QString& caption, int r, int c) -{ - Matrix* w = new Matrix(scriptEnv, r, c, "", this, 0); - initMatrix(w, caption); - if (d_is_appending_file && w->objectName() != caption){//the matrix was renamed - renamedTables << caption << w->objectName(); - if (d_inform_rename_table){ - QApplication::restoreOverrideCursor(); - QMessageBox:: warning(this, tr("QtiPlot - Renamed Window"), - tr("The table '%1' already exists. It has been renamed '%2'.").arg(caption).arg(w->objectName())); - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - } - } - - w->showNormal(); - return w; -} - -void ApplicationWindow::viewMatrixImage() -{ - Matrix* m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - m->undoStack()->push(new MatrixSetViewCommand(m, m->viewType(), Matrix::ImageView, tr("Set Image Mode"))); - m->setViewType(Matrix::ImageView); - QApplication::restoreOverrideCursor(); -} - -void ApplicationWindow::viewMatrixTable() -{ - Matrix* m = static_cast(activeWindow(MatrixWindow)); - if (!m) - return; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - m->undoStack()->push(new MatrixSetViewCommand(m, m->viewType(), Matrix::TableView, tr("Set Data Mode"))); - m->setViewType(Matrix::TableView); - QApplication::restoreOverrideCursor(); -} - -void ApplicationWindow::viewMatrixXY() -{ - Matrix* m = static_cast(activeWindow(MatrixWindow)); - if (!m) - return; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - m->undoStack()->push(new MatrixSetHeaderViewCommand(m, m->headerViewType(), Matrix::XY, tr("Show X/Y"))); - m->setHeaderViewType(Matrix::XY); - QApplication::restoreOverrideCursor(); -} - -void ApplicationWindow::viewMatrixColumnRow() -{ - Matrix* m = static_cast(activeWindow(MatrixWindow)); - if (!m) - return; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - m->undoStack()->push(new MatrixSetHeaderViewCommand(m, m->headerViewType(), Matrix::ColumnRow, tr("Show Column/Row"))); - m->setHeaderViewType(Matrix::ColumnRow); - QApplication::restoreOverrideCursor(); -} - -void ApplicationWindow::setMatrixDefaultScale() -{ - Matrix* m = static_cast(activeWindow(MatrixWindow)); - if (!m) - return; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - m->undoStack()->push(new MatrixSetColorMapCommand(m, m->colorMapType(), m->colorMap(), - Matrix::Default, QwtLinearColorMap(), tr("Set Default Palette"))); - m->setDefaultColorMap(); - QApplication::restoreOverrideCursor(); -} - -void ApplicationWindow::setMatrixGrayScale() -{ - Matrix* m = static_cast(activeWindow(MatrixWindow)); - if (!m) - return; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - m->undoStack()->push(new MatrixSetColorMapCommand(m, m->colorMapType(), m->colorMap(), - Matrix::GrayScale, QwtLinearColorMap(), tr("Set Gray Scale Palette"))); - m->setGrayScale(); - QApplication::restoreOverrideCursor(); -} - -void ApplicationWindow::setMatrixRainbowScale() -{ - Matrix* m = static_cast(activeWindow(MatrixWindow)); - if (!m) - return; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - m->undoStack()->push(new MatrixSetColorMapCommand(m, m->colorMapType(), m->colorMap(), - Matrix::Rainbow, QwtLinearColorMap(), tr("Set Rainbow Palette"))); - m->setRainbowColorMap(); - QApplication::restoreOverrideCursor(); -} - -void ApplicationWindow::showColorMapDialog() -{ - Matrix* m = static_cast(activeWindow(MatrixWindow)); - if (!m) - return; - - ColorMapDialog *cmd = new ColorMapDialog(this); - cmd->setAttribute(Qt::WA_DeleteOnClose); - cmd->setMatrix(m); - cmd->exec(); -} - -void ApplicationWindow::transposeMatrix() -{ - Matrix* m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return; - - m->transpose(); -} - -void ApplicationWindow::flipMatrixVertically() -{ - Matrix* m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return; - - m->flipVertically(); -} - -void ApplicationWindow::flipMatrixHorizontally() -{ - Matrix* m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return; - - m->flipHorizontally(); -} - -void ApplicationWindow::rotateMatrix90() -{ - Matrix* m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return; - - m->rotate90(); -} - -void ApplicationWindow::rotateMatrixMinus90() -{ - Matrix* m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return; - - m->rotate90(false); -} - -void ApplicationWindow::matrixDeterminant() -{ - Matrix* m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return; - - QDateTime dt = QDateTime::currentDateTime (); - QString info=dt.toString(Qt::LocalDate); - info+= "\n" + tr("Determinant of ") + QString(m->objectName()) + ":\t"; - info+= "det = " + QString::number(m->determinant()) + "\n"; - info+="-------------------------------------------------------------\n"; - - current_folder->appendLogInfo(info); - - showResults(true); -} - -void ApplicationWindow::invertMatrix() -{ - Matrix* m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return; - - m->invert(); -} - -Table* ApplicationWindow::convertMatrixToTableDirect() -{ - Matrix* m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return 0; - - return matrixToTable(m, Direct); -} - -Table* ApplicationWindow::convertMatrixToTableXYZ() -{ - Matrix* m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return 0; - - return matrixToTable(m, XYZ); -} - -Table* ApplicationWindow::convertMatrixToTableYXZ() -{ - Matrix* m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return 0; - - return matrixToTable(m, YXZ); -} - -Table* ApplicationWindow::matrixToTable(Matrix* m, MatrixToTableConversion conversionType) -{ - if (!m) - return 0; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - int rows = m->numRows(); - int cols = m->numCols(); - MatrixModel *mModel = m->matrixModel(); - - Table* w = NULL; - if (conversionType == Direct){ - w = new Table(scriptEnv, rows, cols, "", this, 0); - for (int i = 0; isetCell(i, j, m->cell(i,j)); - } - } else if (conversionType == XYZ){ - int tableRows = rows*cols; - w = new Table(scriptEnv, tableRows, 3, "", this, 0); - for (int i = 0; isetCell(cell, 0, mModel->x(j)); - w->setCell(cell, 1, mModel->y(i)); - w->setCell(cell, 2, mModel->cell(i, j)); - } - } - } else if (conversionType == YXZ){ - int tableRows = rows*cols; - w = new Table(scriptEnv, tableRows, 3, "", this, 0); - for (int i = 0; isetCell(cell, 0, mModel->x(i)); - w->setCell(cell, 1, mModel->y(j)); - w->setCell(cell, 2, mModel->cell(i, j)); - } - } - } - - - initTable(w, generateUniqueName(tr("Table"))); - w->setWindowLabel(m->windowLabel()); - w->setCaptionPolicy(m->captionPolicy()); - w->resize(m->size()); - w->showNormal(); - - QApplication::restoreOverrideCursor(); - return w; -} - -void ApplicationWindow::initMatrix(Matrix* m, const QString& caption) -{ - QString name = caption; - while(alreadyUsedName(name)){name = generateUniqueName(tr("Matrix"));} - - m->setWindowTitle(name); - m->setName(name); - m->setIcon( QPixmap(matrix_xpm) ); - m->askOnCloseEvent(confirmCloseMatrix); - m->setNumericPrecision(d_decimal_digits); - - if (d_mdi_windows_area) - d_workspace->addSubWindow(m); - else - m->setParent(0); - - addListViewItem(m); - - QUndoStack *stack = m->undoStack(); - connect(stack, SIGNAL(canUndoChanged(bool)), actionUndo, SLOT(setEnabled(bool))); - connect(stack, SIGNAL(canRedoChanged(bool)), actionRedo, SLOT(setEnabled(bool))); - connect(m, SIGNAL(modifiedWindow(MdiSubWindow*)), this, SLOT(modifiedProject(MdiSubWindow*))); - connect(m, SIGNAL(modifiedData(Matrix*)), this, SLOT(updateMatrixPlots(Matrix *))); - connect(m, SIGNAL(resizedWindow(MdiSubWindow*)),this,SLOT(modifiedProject(MdiSubWindow*))); - connect(m, SIGNAL(closedWindow(MdiSubWindow*)), this, SLOT(closeWindow(MdiSubWindow*))); - connect(m, SIGNAL(hiddenWindow(MdiSubWindow*)), this, SLOT(hideWindow(MdiSubWindow*))); - connect(m, SIGNAL(statusChanged(MdiSubWindow*)),this, SLOT(updateWindowStatus(MdiSubWindow*))); - connect(m, SIGNAL(showContextMenu()), this, SLOT(showWindowContextMenu())); - - emit modified(); -} - -void ApplicationWindow::showBinMatrixDialog() -{ - Table* t = (Table*)activeWindow(TableWindow); - if (!t) - return; - - Q3TableSelection sel = t->getSelection(); - if (t->selectedYColumns().size() != 1 || fabs(sel.topRow() - sel.bottomRow()) < 2){ - QMessageBox::warning(this, tr("QtiPlot - Column selection error"), - tr("You must select a single Y column that has an associated X column!")); - return; - } - - CreateBinMatrixDialog *cbmd = new CreateBinMatrixDialog(t, sel.topRow(), sel.bottomRow(), this); - cbmd->exec(); -} - -Matrix* ApplicationWindow::convertTableToMatrixRegularXYZ() -{ - Table* t = (Table*)activeWindow(TableWindow); - if (!t) - return 0; - - Q3TableSelection sel = t->getSelection(); - if (t->selectedColumns().size() != 1 || - t->colPlotDesignation(t->colIndex(t->selectedColumns()[0])) != Table::Z || - fabs(sel.topRow() - sel.bottomRow()) < 2){ - QMessageBox::warning(this, tr("QtiPlot - Column selection error"), - tr("You must select exactly one Z column!")); - return 0; - } - - int zcol = t->colIndex(t->selectedColumns()[0]); - int ycol = t->colY(zcol); - int xcol = t->colX(ycol); - - int cells = 0; - int startRow = sel.topRow(); - int endRow = sel.bottomRow(); - for (int i = startRow; i <= endRow; i++){ - QString xs = t->text(i, xcol); - QString ys = t->text(i, ycol); - QString zs = t->text(i, zcol); - if (!xs.isEmpty() && !ys.isEmpty() && !zs.isEmpty()) - cells++; - } - - if (!cells) - return 0; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - QLocale locale = this->locale(); - bool xVariesFirst = false; - int firstValidRow = sel.topRow(); - double x0 = 0.0, y0 = 0.0, xstart = 0.0, ystart = 0.0; - double tolerance = 0.15; - for (int i = startRow; i <= endRow; i++){ - QString xs = t->text(i, xcol); - QString ys = t->text(i, ycol); - QString zs = t->text(i, zcol); - if (!xs.isEmpty() && !ys.isEmpty() && !zs.isEmpty()){ - x0 = locale.toDouble(xs); - y0 = locale.toDouble(ys); - xstart = x0; - ystart = y0; - firstValidRow = i; - - for (int j = i + 1; j <= endRow; j++){ - xs = t->text(j, xcol); - ys = t->text(j, ycol); - zs = t->text(j, zcol); - if (!xs.isEmpty() && !ys.isEmpty() && !zs.isEmpty()){ - double x = locale.toDouble(xs); - double y = locale.toDouble(ys); - if (fabs(x - x0) > tolerance*x0 && fabs(y - y0) <= tolerance*y0) - xVariesFirst = true; - break; - } - } - break; - } - } - - int rows = 0; - int cols = 0; - for (int i = firstValidRow; i <= endRow; i++){ - QString xs = t->text(i, xcol); - QString ys = t->text(i, ycol); - QString zs = t->text(i, zcol); - if (!xs.isEmpty() && !ys.isEmpty() && !zs.isEmpty()){ - double x = locale.toDouble(xs); - double y = locale.toDouble(ys); - if (xVariesFirst){ - if (fabs(y - y0) <= tolerance*y0){ - cols++; - y0 = y; - } else - break; - } else { - if (fabs(x - x0) <= tolerance*x0){ - rows++; - x0 = x; - } else - break; - } - } - } - - if (rows) - cols = cells/rows; - else - rows = cells/cols; - - double xend = xstart, yend = ystart; - Matrix* m = newMatrix(rows, cols); - for (int i = startRow; i <= endRow; i++){ - QString xs = t->text(i, xcol); - QString ys = t->text(i, ycol); - QString zs = t->text(i, zcol); - if (!xs.isEmpty() && !ys.isEmpty() && !zs.isEmpty()){ - int row = 0, col = 0; - if (xVariesFirst){ - col = i%cols; - row = i/cols; - } else { - row = i%rows; - col = i/rows; - } - - double x = locale.toDouble(xs); - double y = locale.toDouble(ys); - if (x > xend) - xend = x; - if (y > yend) - yend = y; - - m->setCell(row, col, locale.toDouble(zs)); - } - } - - m->setCoordinates(QMIN(xstart, xend), QMAX(xstart, xend), QMIN(ystart, yend), QMAX(ystart, yend)); - - QApplication::restoreOverrideCursor(); - return m; -} - -Matrix* ApplicationWindow::convertTableToMatrix() -{ - Table* t = (Table*)activeWindow(TableWindow); - if (!t) - return 0; - - return tableToMatrix (t); -} - -Matrix* ApplicationWindow::tableToMatrix(Table* t) -{ - if (!t) - return 0; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - int rows = t->numRows(); - int cols = t->numCols(); - - Matrix* m = newMatrix(rows, cols); - for (int i = 0; isetCell(i, j, t->cell(i, j)); - } - - m->showNormal(); - - QApplication::restoreOverrideCursor(); - return m; -} - -MdiSubWindow* ApplicationWindow::window(const QString& name) -{ - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - if (w->objectName() == name) - return w; - } - return NULL; -} - -Table* ApplicationWindow::table(const QString& name) -{ - int pos = name.find("_", 0); - QString caption = name.left(pos); - - Folder *f = projectFolder(); - while (f){ - QList folderWindows = f->windowsList(); - foreach(MdiSubWindow *w, folderWindows){ - if (w->inherits("Table") && w->objectName() == caption) - return (Table*)w; - } - f = f->folderBelow(); - } - - return 0; -} - -Matrix* ApplicationWindow::matrix(const QString& name) -{ - QString caption = name; - if (d_is_appending_file && !renamedTables.isEmpty() && renamedTables.contains(caption)){ - int index = renamedTables.findIndex(caption); - caption = renamedTables[index + 1]; - } - - Folder *f = projectFolder(); - while (f){ - QList folderWindows = f->windowsList(); - foreach(MdiSubWindow *w, folderWindows){ - if (w->isA("Matrix") && w->objectName() == caption) - return (Matrix*)w; - } - f = f->folderBelow(); - } - return 0; -} - -MdiSubWindow *ApplicationWindow::activeWindow(WindowType type) -{ - if (!d_active_window){ - QList windows = current_folder->windowsList(); - if (!current_folder->activeWindow() && windows.size() > 0) - d_active_window = windows[0]; - else - return NULL; - } - - switch(type){ - case NoWindow: - break; - - case TableWindow: - if (d_active_window->inherits("Table")) - return d_active_window; - else - return NULL; - break; - - case MatrixWindow: - return qobject_cast(d_active_window); - break; - - case MultiLayerWindow: - return qobject_cast(d_active_window); - break; - - case NoteWindow: - return qobject_cast(d_active_window); - break; - - case Plot3DWindow: - return qobject_cast(d_active_window); - break; - } - return d_active_window; -} - -void ApplicationWindow::windowActivated(QMdiSubWindow *w) -{ - if (!w || (d_active_window && d_active_window == (MdiSubWindow *)w)) - return; - - d_active_window = (MdiSubWindow *)w; - - customToolBars(w); - customMenu(w); - - if (d_opening_file) - return; - - QList windows = current_folder->windowsList(); - foreach(MdiSubWindow *ow, windows){ - if (ow != w && ow->status() == MdiSubWindow::Maximized){ - ow->setNormal(); - break; - } - } - - Folder *f = ((MdiSubWindow *)w)->folder(); - if (f) - f->setActiveWindow((MdiSubWindow *)w); - - emit modified(); -} - -void ApplicationWindow::addErrorBars() -{ - MdiSubWindow *w = activeWindow(MultiLayerWindow); - if (!w) - return; - - MultiLayer* plot = (MultiLayer*)w; - if (plot->isEmpty()){ - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

" - "

Please add a layer and try again!

")); - return; - } - - Graph* g = (Graph*)plot->activeLayer(); - if (!g) - return; - - if (!g->curveCount()){ - QMessageBox::warning(this, tr("QtiPlot - Warning"), tr("There are no curves available on this plot!")); - return; - } - - if (g->isPiePlot()){ - QMessageBox::warning(this, tr("QtiPlot - Warning"), tr("This functionality is not available for pie plots!")); - return; - } - - ErrDialog* ed = new ErrDialog(this); - connect (ed, SIGNAL(options(const QString&, int, double, int)), this, SLOT(defineErrorBars(const QString&, int, double, int))); - connect (ed, SIGNAL(options(const QString&, const QString&, int)), this, SLOT(defineErrorBars(const QString&, const QString&, int))); - - ed->setCurveNames(g->analysableCurvesList()); - ed->setSrcTables(tableList()); - ed->exec(); -} - -void ApplicationWindow::defineErrorBars(const QString& name, int type, double percent, int direction) -{ - MdiSubWindow *w = activeWindow(MultiLayerWindow); - if (!w) - return; - - Graph* g = ((MultiLayer*)w)->activeLayer(); - if (!g) - return; - - Table *t = table(name); - if (!t){//user defined function - QMessageBox::critical(this, tr("QtiPlot - Error bars error"), - tr("This feature is not available for user defined function curves!")); - return; - } - - DataCurve *master_curve = (DataCurve *)g->curve(name); - QString xColName = master_curve->xColumnName(); - if (xColName.isEmpty()) - return; - - if (direction == QwtErrorPlotCurve::Horizontal) - t->addCol(Table::xErr); - else - t->addCol(Table::yErr); - - int r = master_curve->dataSize(); - int rows = t->numRows(); - int c = t->numCols() - 1; - int ycol = t->colIndex(name); - if (!direction) - ycol = t->colIndex(xColName); - - QVarLengthArray Y(r); - if (direction == QwtErrorPlotCurve::Horizontal){ - for (int i = 0; i < r; i++) - Y[i] = master_curve->x(i); - } else { - for (int i = 0; i < r; i++) - Y[i] = master_curve->y(i); - } - - QString errColName = t->colName(c); - - if (type == 0){ - double prc = 0.01*percent; - int aux = 0; - for (int i = 0; i < rows; i++){ - if (!t->text(i, ycol).isEmpty() && aux < r){ - t->setCell(i, c, Y[aux]*prc); - aux++; - } - } - } else if (type == 1) { - double sd = gsl_stats_sd(Y.data(), 1, r); - for (int i = 0; i < rows; i++){ - if (!t->text(i, ycol).isEmpty()) - t->setCell(i, c, sd); - } - } - QwtErrorPlotCurve *er = g->addErrorBars(xColName, name, t, errColName, direction); - if (er){ - er->setColor(master_curve->pen().color()); - g->replot(); - emit modified(); - } -} - -void ApplicationWindow::defineErrorBars(const QString& curveName, const QString& errColumnName, int direction) -{ - Table *w = table(curveName); - if (!w){//user defined function --> no worksheet available - QMessageBox::critical(this,tr("QtiPlot - Error"), - tr("This feature is not available for user defined function curves!")); - return; - } - - Table *errTable = table(errColumnName); - if (w->numRows() != errTable->numRows()){ - QMessageBox::critical(this,tr("QtiPlot - Error"), tr("The selected columns have different numbers of rows!")); - addErrorBars(); - return; - } - - int errCol = errTable->colIndex(errColumnName); - if (errTable->isEmptyColumn(errCol)){ - QMessageBox::critical(this, tr("QtiPlot - Error"), tr("The selected error column is empty!")); - addErrorBars(); - return; - } - - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph* g = plot->activeLayer(); - if (!g) - return; - - QwtErrorPlotCurve *er = g->addErrorBars(curveName, errTable, errColumnName, direction); - if (er){ - DataCurve *mc = er->masterCurve(); - if (mc){ - er->setColor(mc->pen().color()); - g->replot(); - } - emit modified(); - } -} - -void ApplicationWindow::removeCurves(const QString& name) -{ - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - if (w->isA("MultiLayer")){ - QList layers = ((MultiLayer*)w)->layersList(); - foreach(Graph *g, layers) - g->removeCurves(name); - } else if (w->isA("Graph3D")){ - if ( (((Graph3D*)w)->formula()).contains(name) ) - ((Graph3D*)w)->clearData(); - } - } - QApplication::restoreOverrideCursor(); -} - -void ApplicationWindow::updateCurves(Table *t, const QString& name) -{ - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - if (w->isA("MultiLayer")){ - QList layers = ((MultiLayer*)w)->layersList(); - foreach(Graph *g, layers) - g->updateCurvesData(t, name); - } else if (w->isA("Graph3D")){ - Graph3D* g = (Graph3D*)w; - if ((g->formula()).contains(name)) - g->updateData(t); - } - } -} - -void ApplicationWindow::showPreferencesDialog() -{ - ConfigDialog* cd = new ConfigDialog(this); - cd->setColumnSeparator(columnSeparator); - cd->exec(); -} - -void ApplicationWindow::setSaveSettings(bool autoSaving, int min) -{ - if (autoSave==autoSaving && autoSaveTime==min) - return; - - autoSave=autoSaving; - autoSaveTime=min; - - killTimer(savingTimerId); - - if (autoSave) - savingTimerId=startTimer(autoSaveTime*60000); - else - savingTimerId=0; -} - -void ApplicationWindow::changeAppStyle(const QString& s) -{ - // style keys are case insensitive - if (appStyle.toLower() == s.toLower()) - return; - - qApp->setStyle(s); - appStyle = qApp->style()->objectName(); - - QPalette pal = qApp->palette(); - pal.setColor (QPalette::Active, QPalette::Base, QColor(panelsColor)); - qApp->setPalette(pal); - -} - -void ApplicationWindow::changeAppFont(const QFont& f) -{ - if (appFont == f) - return; - - appFont = f; - updateAppFonts(); -} - -void ApplicationWindow::updateAppFonts() -{ - qApp->setFont(appFont); - this->setFont(appFont); - info->setFont(QFont(appFont.family(), 2 + appFont.pointSize(), QFont::Bold,false)); -} - -void ApplicationWindow::updateConfirmOptions(bool askTables, bool askMatrices, bool askPlots2D, - bool askPlots3D, bool askNotes) -{ - QList windows = windowsList(); - - - if (confirmCloseTable != askTables){ - confirmCloseTable=askTables; - foreach(MdiSubWindow *w, windows){ - if (w->inherits("Table")) - w->askOnCloseEvent(confirmCloseTable); - } - } - - if (confirmCloseMatrix != askMatrices){ - confirmCloseMatrix = askMatrices; - foreach(MdiSubWindow *w, windows){ - if (w->isA("Matrix")) - w->askOnCloseEvent(confirmCloseMatrix); - } - } - - if (confirmClosePlot2D != askPlots2D){ - confirmClosePlot2D=askPlots2D; - foreach(MdiSubWindow *w, windows){ - if (w->isA("MultiLayer")) - w->askOnCloseEvent(confirmClosePlot2D); - } - } - - if (confirmClosePlot3D != askPlots3D){ - confirmClosePlot3D=askPlots3D; - foreach(MdiSubWindow *w, windows){ - if (w->isA("Graph3D")) - w->askOnCloseEvent(confirmClosePlot3D); - } - } - - if (confirmCloseNotes != askNotes){ - confirmCloseNotes = askNotes; - foreach(MdiSubWindow *w, windows){ - if (w->isA("Note")) - w->askOnCloseEvent(confirmCloseNotes); - } - } -} - -void ApplicationWindow::setGraphDefaultSettings(bool autoscale, bool scaleFonts, - bool resizeLayers, bool antialiasing) -{ - if (autoscale2DPlots == autoscale && - autoScaleFonts == scaleFonts && - autoResizeLayers != resizeLayers && - antialiasing2DPlots == antialiasing) - return; - - autoscale2DPlots = autoscale; - autoScaleFonts = scaleFonts; - autoResizeLayers = !resizeLayers; - antialiasing2DPlots = antialiasing; - - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - if (w->isA("MultiLayer")){ - ((MultiLayer*)w)->setScaleLayersOnResize(autoResizeLayers); - QList layers = ((MultiLayer*)w)->layersList(); - foreach(Graph *g, layers){ - g->enableAutoscaling(autoscale2DPlots); - g->updateScale(); - g->setAutoscaleFonts(autoScaleFonts); - g->setAntialiasing(antialiasing2DPlots); - } - } - } -} - -void ApplicationWindow::setArrowDefaultSettings(double lineWidth, const QColor& c, Qt::PenStyle style, - int headLength, int headAngle, bool fillHead) -{ - if (defaultArrowLineWidth == lineWidth && - defaultArrowColor == c && - defaultArrowLineStyle == style && - defaultArrowHeadLength == headLength && - defaultArrowHeadAngle == headAngle && - defaultArrowHeadFill == fillHead) - return; - - defaultArrowLineWidth = lineWidth; - defaultArrowColor = c; - defaultArrowLineStyle = style; - defaultArrowHeadLength = headLength; - defaultArrowHeadAngle = headAngle; - defaultArrowHeadFill = fillHead; - saveSettings(); -} - -ApplicationWindow * ApplicationWindow::plotFile(const QString& fn) -{ - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - ApplicationWindow *app = new ApplicationWindow(); - app->restoreApplicationGeometry(); - - QList lst = QImageReader::supportedImageFormats() << "JPG"; - QStringList tempList; - foreach(QByteArray temp,lst)// convert QList to QStringList to be able to 'filter' - tempList.append(QString(temp)); - - QFileInfo fi(fn); - QStringList l = tempList.filter(fi.suffix(), Qt::CaseInsensitive); - if (l.count() > 0) - app->importImage(fn); - else { - Table* t = app->newTable(); - if (!t) { - QApplication::restoreOverrideCursor(); - return NULL; - } - t->importASCII(fn, app->columnSeparator, 0, app->renameColumns, app->strip_spaces, app->simplify_spaces, - app->d_ASCII_import_comments, app->d_ASCII_comment_string, - app->d_ASCII_import_read_only, Table::Overwrite, app->d_ASCII_end_line); - t->setCaptionPolicy(MdiSubWindow::Both); - app->multilayerPlot(t, t->YColumns(), defaultCurveStyle); - } - - QApplication::restoreOverrideCursor(); - savedProject();//force saved state - close(); - return app; -} - -void ApplicationWindow::importWaveFile() -{ - QString fn = getFileName(this, tr("Open File"), QString::null, "*.wav", 0, false); - if (fn.isEmpty()) - return; - - QString log = QDateTime::currentDateTime ().toString(Qt::LocalDate) + " - "; - log += tr("Imported sound file") + ": " + fn + "\n"; - ifstream file(fn, ios::in | ios::binary); - - file.seekg(4, ios::beg); - int chunkSize; - file.read( (char*) &chunkSize, 4 ); // read the ChunkSize - - file.seekg(16, ios::beg); - int subChunk1Size; - file.read( (char*) &subChunk1Size, 4 ); // read the SubChunk1Size - - short format; - file.read( (char*) &format, sizeof(short) ); // read the file format. This should be 1 for PCM - log += tr("Format") + ": "; - if (format != 1){ - QMessageBox::information(this, tr("QtiPlot"), - tr("This is not a PCM type WAV file, operation aborted!")); - log += QString::number(format) + "\n"; - showResults(log, true); - return; - } else - log += tr("PCM") + "\n"; - - short channels; - file.read( (char*) &channels, sizeof(short) ); // read the # of channels (1 or 2) - QStringList header; - if (channels == 2) - header << tr("Time") << tr("Left") << tr("Right"); - else if (channels == 1) - header << tr("Time") << tr("Data"); - log += tr("Channels") + ": " + QString::number(channels) + "\n"; - - int sampleRate; - file.read( (char*) &sampleRate, sizeof(int) ); - log += tr("Sample Rate") + ": " + QString::number(sampleRate) + "\n"; - - int byteRate; - file.read( (char*) &byteRate, sizeof(int) ); - log += tr("Byte Rate") + ": " + QString::number(byteRate) + "\n"; - - short blockAlign; - file.read( (char*) &blockAlign, sizeof(short) ); - log += tr("Block Align") + ": " + QString::number(blockAlign) + "\n"; - - short bitsPerSample; - file.read( (char*) &bitsPerSample, sizeof(short) ); - log += tr("Bits Per Sample") + ": " + QString::number(bitsPerSample) + "\n"; - log += "__________________________________\n"; - showResults(log, true); - - int rows = (chunkSize - 36)/blockAlign; - Table *t = newTable(rows, int(channels + 1), QFileInfo(fn).baseName(), fn); - if (!t) - return; - - t->setHeader(header); - - file.seekg(44, ios::beg); - - double dt = 1.0/(double)sampleRate; - int aux = 1; - if (bitsPerSample == 8){ - if (channels == 2) - file.seekg(46, ios::beg);//???Why??? - int size = 1; - uchar ch; - while(!file.eof()){ - int i = aux - 1; - t->setCell(i, 0, dt*aux); - for (int j = 1; j <= channels; j++){ - file.read((char*) &ch, size); - t->setText(i, j, QString::number(ch)); - } - aux++; - } - } else if (bitsPerSample == 16){ - int size = sizeof(short); - short ch; - while(!file.eof()){ - int i = aux - 1; - t->setCell(i, 0, dt*aux); - for (int j = 1; j <= channels; j++){ - file.read((char*) &ch, size); - t->setText(i, j, QString::number(ch)); - } - aux++; - } - } - - file.close(); - t->show(); -} - -void ApplicationWindow::importASCII() -{ - ImportASCIIDialog *import_dialog = new ImportASCIIDialog(!activeWindow(TableWindow) && !activeWindow(MatrixWindow), this, d_extended_import_ASCII_dialog); - import_dialog->setDir(asciiDirPath); - import_dialog->selectFilter(d_ASCII_file_filter); - if (import_dialog->exec() != QDialog::Accepted) - return; - - asciiDirPath = import_dialog->directory().path(); - d_ASCII_import_mode = import_dialog->importMode(); - columnSeparator = import_dialog->columnSeparator(); - ignoredLines = import_dialog->ignoredLines(); - renameColumns = import_dialog->useFirstRow(); - strip_spaces = import_dialog->stripSpaces(); - simplify_spaces = import_dialog->simplifySpaces(); - d_ASCII_import_locale = import_dialog->decimalSeparators(); - d_ASCII_comment_string = import_dialog->commentString(); - d_ASCII_import_comments = import_dialog->useSecondRow(); - d_ASCII_import_read_only = import_dialog->readOnly(); - d_ASCII_end_line = (EndLineChar)import_dialog->endLineChar(); - saveSettings(); - - importASCII(import_dialog->selectedFiles(), - import_dialog->importMode(), - import_dialog->columnSeparator(), - import_dialog->ignoredLines(), - import_dialog->renameColumns(), - import_dialog->stripSpaces(), - import_dialog->simplifySpaces(), - import_dialog->importComments(), - import_dialog->decimalSeparators(), - import_dialog->commentString(), - import_dialog->readOnly(), - import_dialog->endLineChar()); -} - -void ApplicationWindow::importASCII(const QStringList& files, int import_mode, const QString& local_column_separator, - int local_ignored_lines, bool local_rename_columns, bool local_strip_spaces, bool local_simplify_spaces, - bool local_import_comments, QLocale local_separators, const QString& local_comment_string, - bool import_read_only, int endLineChar) -{ - if (files.isEmpty()) - return; - - switch(import_mode) { - case ImportASCIIDialog::NewTables: - { - int dx = 0, dy = 0; - QStringList sorted_files = files; - sorted_files.sort(); - int filesCount = sorted_files.size(); - for (int i=0; iimportASCII(sorted_files[i], local_column_separator, local_ignored_lines, - local_rename_columns, local_strip_spaces, local_simplify_spaces, - local_import_comments, local_comment_string, import_read_only, - Table::Overwrite, endLineChar); - if (!w) continue; - w->setWindowLabel(sorted_files[i]); - w->setCaptionPolicy(MdiSubWindow::Both); - if (i == 0){ - dx = w->verticalHeaderWidth(); - dy = w->frameGeometry().height() - w->widget()->height(); - } - if (filesCount > 1) - w->move(QPoint(i*dx, i*dy)); - - w->updateDecimalSeparators(local_separators); - } - modifiedProject(); - break; - } - case ImportASCIIDialog::NewMatrices: - { - int dx = 0, dy = 0; - QStringList sorted_files = files; - sorted_files.sort(); - int filesCount = sorted_files.size(); - for (int i=0; iimportASCII(sorted_files[i], local_column_separator, local_ignored_lines, - local_strip_spaces, local_simplify_spaces, local_comment_string, - Matrix::Overwrite, local_separators, endLineChar); - w->setWindowLabel(sorted_files[i]); - w->setCaptionPolicy(MdiSubWindow::Both); - if (i == 0){ - dx = w->verticalHeaderWidth(); - dy = w->frameGeometry().height() - w->widget()->height(); - } - if (filesCount > 1) - w->move(QPoint(i*dx,i*dy)); - } - modifiedProject(); - break; - } - - case ImportASCIIDialog::NewColumns: - case ImportASCIIDialog::NewRows: - { - MdiSubWindow *w = activeWindow(); - if (!w) - return; - - if (w->inherits("Table")){ - Table *t = (Table*)w; - for (int i = 0; i < files.size(); i++){ - t->importASCII(files[i], local_column_separator, local_ignored_lines, local_rename_columns, - local_strip_spaces, local_simplify_spaces, local_import_comments, - local_comment_string, import_read_only, (Table::ImportMode)(import_mode - 2), endLineChar); - } - t->updateDecimalSeparators(local_separators); - t->notifyChanges(); - emit modifiedProject(t); - } else if (w->isA("Matrix")){ - Matrix *m = (Matrix *)w; - for (int i=0; iimportASCII(files[i], local_column_separator, local_ignored_lines, - local_strip_spaces, local_simplify_spaces, local_comment_string, - (Matrix::ImportMode)(import_mode - 2), local_separators, endLineChar); - } - } - w->setWindowLabel(files.join("; ")); - w->setCaptionPolicy(MdiSubWindow::Name); - break; - } - case ImportASCIIDialog::Overwrite: - { - MdiSubWindow *w = activeWindow(); - if (!w) - return; - - if (w->inherits("Table")){ - Table *t = (Table *)w; - t->importASCII(files[0], local_column_separator, local_ignored_lines, local_rename_columns, - local_strip_spaces, local_simplify_spaces, local_import_comments, - local_comment_string, import_read_only, Table::Overwrite, endLineChar); - t->updateDecimalSeparators(local_separators); - t->notifyChanges(); - } else if (w->isA("Matrix")){ - Matrix *m = (Matrix *)w; - m->importASCII(files[0], local_column_separator, local_ignored_lines, - local_strip_spaces, local_simplify_spaces, local_comment_string, - Matrix::Overwrite, local_separators, endLineChar); - } - - w->setWindowLabel(files[0]); - w->setCaptionPolicy(MdiSubWindow::Both); - modifiedProject(); - break; - } - } -} - -void ApplicationWindow::open() -{ - OpenProjectDialog *open_dialog = new OpenProjectDialog(this, d_extended_open_dialog); - open_dialog->setDirectory(workingDir); - open_dialog->selectNameFilter(d_open_project_filter); - - if (open_dialog->exec() != QDialog::Accepted || open_dialog->selectedFiles().isEmpty()) - return; - workingDir = open_dialog->directory().path(); - - switch(open_dialog->openMode()) { - case OpenProjectDialog::NewProject: - { - QString fn = open_dialog->selectedFiles()[0]; - QFileInfo fi(fn); - - if (projectname != "untitled"){ - QFileInfo fi(projectname); - QString pn = fi.absFilePath(); - if (fn == pn){ - QMessageBox::warning(this, tr("QtiPlot - File openning error"), - tr("The file: %1 is the current file!").arg(fn)); - return; - } - } - - if (!fi.exists ()){ - QMessageBox::critical(this, tr("QtiPlot - File openning error"), - tr("The file: %1 doesn't exist!").arg(fn)); - return; - } - - saveSettings();//the recent projects must be saved - - ApplicationWindow *a = open (fn); - if (a){ - a->workingDir = workingDir; - if (!(fn.endsWith(".ogm",Qt::CaseInsensitive) || - fn.endsWith(".ogw",Qt::CaseInsensitive))) this->close(); - } - break; - } - case OpenProjectDialog::NewFolder: - appendProject(open_dialog->selectedFiles()[0]); - break; - } -} - -ApplicationWindow* ApplicationWindow::open(const QString& fn, bool factorySettings, bool newProject) -{ - QFileInfo fi(fn); - if (!fi.isReadable()){ - QMessageBox::critical(this, tr("QtiPlot - File openning error"), - tr("You don't have the permission to open this file: %1").arg(fn)); - return NULL; - } - - if (fn.endsWith(".opj", Qt::CaseInsensitive) || fn.endsWith(".ogm", Qt::CaseInsensitive) || - fn.endsWith(".ogw", Qt::CaseInsensitive) || fn.endsWith(".ogg", Qt::CaseInsensitive)) - return importOPJ(fn, factorySettings, newProject); - else if (fn.endsWith(".py", Qt::CaseInsensitive)) - return loadScript(fn); - - QString fname = fn; - if (fn.endsWith(".qti.gz", Qt::CaseInsensitive)){//decompress using zlib - file_uncompress((char *)fname.ascii()); - fname = fname.left(fname.size() - 3); - } - - QFile f(fname); - QTextStream t( &f ); - f.open(QIODevice::ReadOnly); - QString s = t.readLine(); - f.close(); - - QStringList lst = s.split(QRegExp("\\s"), QString::SkipEmptyParts); - bool qtiProject = (lst.count() < 2 || lst[0] != "QtiPlot") ? false : true; - if (!qtiProject){ - if (QFile::exists(fname + "~")){ - int choice = QMessageBox::question(this, tr("QtiPlot - File opening error"), - tr("The file %1 is corrupted, but there exists a backup copy.
Do you want to open the backup instead?").arg(fn), - QMessageBox::Yes|QMessageBox::Default, QMessageBox::No|QMessageBox::Escape); - if (choice == QMessageBox::Yes) - return open(fname + "~"); - else - QMessageBox::critical(this, tr("QtiPlot - File opening error"), tr("The file: %1 was not created using QtiPlot!").arg(fn)); - return 0; - } - - return plotFile(fn); - } - - QStringList vl = lst[1].split(".", QString::SkipEmptyParts); - d_file_version = 100*(vl[0]).toInt()+10*(vl[1]).toInt()+(vl[2]).toInt(); - - ApplicationWindow* app = openProject(fname, factorySettings, newProject); - - f.close(); - return app; -} - -void ApplicationWindow::openRecentProject(int index) -{ - QString fn = recent->text(index); - int pos = fn.find(" ", 0); - fn = fn.right(fn.length() - pos - 1); - - QFile f(fn); - if (!f.exists()){ - QMessageBox::critical(this, tr("QtiPlot - File Open Error"), - tr("The file: %1

does not exist anymore!" - "

It will be removed from the list.").arg(fn)); - - for (int i = 0; i < recentProjects.size(); i++){ - if (QDir::toNativeSeparators(recentProjects[i]) == fn){ - recentProjects.removeAt(i); - break; - } - } - updateRecentProjectsList(); - return; - } - - if (projectname != "untitled"){ - QFileInfo fi(projectname); - QString pn = fi.absFilePath(); - - if (QDir::toNativeSeparators(fn) == QDir::toNativeSeparators(pn)){ - QMessageBox::warning(this, tr("QtiPlot - File openning error"), - tr("The file:

%1

is the current file!").arg(QDir::toNativeSeparators(fn))); - return; - } - } - - if (!fn.isEmpty()){ - saveSettings();//the recent projects must be saved - bool isSaved = saved; - ApplicationWindow * a = open (fn); - if (a){ - if (isSaved) - savedProject();//force saved state - if (!(fn.endsWith(".ogm", Qt::CaseInsensitive) || fn.endsWith(".ogw",Qt::CaseInsensitive))) - close(); - else - modifiedProject(); - } - } -} - -ApplicationWindow* ApplicationWindow::openProject(const QString& fn, bool factorySettings, bool newProject) -{ - ApplicationWindow *app = this; - if (newProject) - app = new ApplicationWindow(factorySettings); - - app->projectname = fn; - app->d_file_version = d_file_version; - app->setWindowTitle(tr("QtiPlot") + " - " + fn); - app->d_opening_file = true; - app->d_workspace->blockSignals(true); - - QFile f(fn); - QTextStream t( &f ); - t.setEncoding(QTextStream::UnicodeUTF8); - f.open(QIODevice::ReadOnly); - - QFileInfo fi(fn); - QString baseName = fi.fileName(); - - t.readLine(); - if (d_file_version < 73) - t.readLine(); - - QString s = t.readLine(); - QStringList list=s.split("\t", QString::SkipEmptyParts); - if (list[0] == "") - { - if (!app->setScriptingLanguage(list[1])) - QMessageBox::warning(app, tr("QtiPlot - File opening error"), - tr("The file \"%1\" was created using \"%2\" as scripting language.\n\n"\ - "Initializing support for this language FAILED; I'm using \"%3\" instead.\n"\ - "Various parts of this file may not be displayed as expected.")\ - .arg(fn).arg(list[1]).arg(scriptEnv->name())); - - s = t.readLine(); - list=s.split("\t", QString::SkipEmptyParts); - } - int aux=0,widgets=list[1].toInt(); - - QString titleBase = tr("Window") + ": "; - QString title = titleBase + "1/" + QString::number(widgets) + " "; - - QProgressDialog progress(this); - progress.setWindowModality(Qt::WindowModal); - progress.setRange(0, widgets); - progress.setMinimumWidth(app->width()/2); - progress.setWindowTitle(tr("QtiPlot - Opening file") + ": " + baseName); - progress.setLabelText(title); - - Folder *cf = app->projectFolder(); - app->folders->blockSignals (true); - app->blockSignals (true); - - //rename project folder item - FolderListItem *item = (FolderListItem *)app->folders->firstChild(); - item->setText(0, fi.baseName()); - item->folder()->setObjectName(fi.baseName()); - - //process tables and matrix information - while ( !t.atEnd() && !progress.wasCanceled()){ - s = t.readLine(); - list.clear(); - if (s.left(8) == ""){ - list = s.split("\t"); - Folder *f = new Folder(app->current_folder, list[1]); - f->setBirthDate(list[2]); - f->setModificationDate(list[3]); - if(list.count() > 4) - if (list[4] == "current") - cf = f; - - FolderListItem *fli = new FolderListItem(app->current_folder->folderListItem(), f); - f->setFolderListItem(fli); - - app->current_folder = f; - } else if (s.contains("")) { - app->current_folder->folderListItem()->setOpen(s.remove("").remove("").toInt()); - } else if (s == "

") { - title = titleBase + QString::number(++aux)+"/"+QString::number(widgets); - progress.setLabelText(title); - QStringList lst; - while ( s!="
" ){ - s=t.readLine(); - lst<") { - QStringList lst; - while ( s!="" ){ - s=t.readLine(); - lst<openTableStatistics(lst); - } else if (s == "") { - title= titleBase + QString::number(++aux)+"/"+QString::number(widgets); - progress.setLabelText(title); - QStringList lst; - while ( s != "" ) { - s=t.readLine(); - lst<") { - title= titleBase + QString::number(++aux)+"/"+QString::number(widgets); - progress.setLabelText(title); - for (int i=0; i<3; i++){ - s = t.readLine(); - list << s; - } - Note* m = openNote(app,list); - QStringList cont; - while ( s != "" ){ - s=t.readLine(); - cont << s; - } - cont.pop_back(); - m->restore(cont); - progress.setValue(aux); - } else if (s == "
") { - Folder *parent = (Folder *)app->current_folder->parent(); - if (!parent) - app->current_folder = app->projectFolder(); - else - app->current_folder = parent; - } - } - f.close(); - - if (progress.wasCanceled()){ - app->saved = true; - app->close(); - return 0; - } - - //process the rest - f.open(QIODevice::ReadOnly); - - MultiLayer *plot=0; - while ( !t.atEnd() && !progress.wasCanceled()){ - s=t.readLine(); - if (s.left(8) == ""){ - list = s.split("\t"); - app->current_folder = app->current_folder->findSubfolder(list[1]); - } else if (s == ""){//process multilayers information - title = titleBase + QString::number(++aux) + "/" + QString::number(widgets); - progress.setLabelText(title); - - s = t.readLine(); - QStringList graph = s.split("\t"); - QString caption = graph[0]; - - plot = app->multilayerPlot(caption, 0, graph[2].toInt(), graph[1].toInt()); - - app->setListViewDate(caption, graph[3]); - plot->setBirthDate(graph[3]); - - restoreWindowGeometry(app, plot, t.readLine()); - plot->blockSignals(true); - - if (d_file_version > 71) - { - QStringList lst=t.readLine().split("\t"); - plot->setWindowLabel(lst[1]); - plot->setCaptionPolicy((MdiSubWindow::CaptionPolicy)lst[2].toInt()); - } - if (d_file_version > 83) - { - QStringList lst=t.readLine().split("\t", QString::SkipEmptyParts); - plot->setMargins(lst[1].toInt(),lst[2].toInt(),lst[3].toInt(),lst[4].toInt()); - lst=t.readLine().split("\t", QString::SkipEmptyParts); - plot->setSpacing(lst[1].toInt(),lst[2].toInt()); - lst=t.readLine().split("\t", QString::SkipEmptyParts); - plot->setLayerCanvasSize(lst[1].toInt(),lst[2].toInt()); - lst=t.readLine().split("\t", QString::SkipEmptyParts); - plot->setAlignement(lst[1].toInt(),lst[2].toInt()); - } - - while ( s != "" ){//open layers - s = t.readLine(); - if (s.contains("")){ - QStringList lst = s.trimmed().remove("").remove("").split(","); - if (lst.size() >= 2) - plot->setWaterfallOffset(lst[0].toInt(), lst[1].toInt()); - if (lst.size() >= 3) - plot->setWaterfallSideLines(lst[2].toInt()); - plot->createWaterfallBox(); - } - - if (s.left(7) == ""){ - list.clear(); - while ( s != "" ){ - s = t.readLine(); - list<blockSignals(false); - progress.setValue(aux); - } - else if (s == "") - {//process 3D plots information - list.clear(); - title = titleBase + QString::number(++aux)+"/"+QString::number(widgets); - progress.setLabelText(title); - while ( s != "" ){ - s = t.readLine(); - list << s; - } - Graph3D::restore(app, list, d_file_version); - progress.setValue(aux); - } - else if (s == "") - { - Folder *parent = (Folder *)app->current_folder->parent(); - if (!parent) - app->current_folder = projectFolder(); - else - app->current_folder = parent; - } - else if (s == "") - {//process analysis information - s = t.readLine(); - QString log = s + "\n"; - while(s != ""){ - s = t.readLine(); - log += s + "\n"; - } - app->current_folder->appendLogInfo(log.remove("")); - } - } - f.close(); - - if (progress.wasCanceled()) - { - app->saved = true; - app->close(); - return 0; - } - - QFileInfo fi2(f); - QString fileName = fi2.absFilePath(); - - app->recentProjects.removeAll(fileName); - app->recentProjects.push_front(fileName); - app->updateRecentProjectsList(); - - app->folders->setCurrentItem(cf->folderListItem()); - app->folders->blockSignals (false); - //change folder to user defined current folder - app->changeFolder(cf, true); - - app->blockSignals (false); - app->renamedTables.clear(); - - app->restoreApplicationGeometry(); - app->executeNotes(); - app->savedProject(); - app->d_opening_file = false; - app->d_workspace->blockSignals(false); - app->addWindowsListToCompleter(); - return app; -} - -void ApplicationWindow::executeNotes() -{ - QList lst = projectFolder()->windowsList(); - foreach(MdiSubWindow *widget, lst) - if (widget->isA("Note") && ((Note*)widget)->autoexec()) - ((Note*)widget)->executeAll(); -} - -void ApplicationWindow::scriptError(const QString &message, const QString &scriptName, int lineNumber) -{ - Q_UNUSED(scriptName); - Q_UNUSED(lineNumber); - - QMessageBox::critical(this, tr("QtiPlot") + " - "+ tr("Script Error"), message); -} - -void ApplicationWindow::scriptPrint(const QString &text) -{ -#ifdef SCRIPTING_CONSOLE - if(!text.stripWhiteSpace().isEmpty()) console->append(text); -#else - printf(text.ascii()); -#endif -} - -bool ApplicationWindow::setScriptingLanguage(const QString &lang, bool force) -{ - if (!force && lang == scriptEnv->name())return true; - if (lang.isEmpty()) return false; - - ScriptingEnv *newEnv = ScriptingLangManager::newEnv(lang, this); - if (!newEnv) - return false; - - connect(newEnv, SIGNAL(error(const QString&,const QString&,int)), - this, SLOT(scriptError(const QString&,const QString&,int))); - connect(newEnv, SIGNAL(print(const QString&)), this, SLOT(scriptPrint(const QString&))); - if (!newEnv->initialize()){ - delete newEnv; - return false; - } - - // notify everyone who might be interested - ScriptingChangeEvent *sce = new ScriptingChangeEvent(newEnv); - QApplication::sendEvent(this, sce); - delete sce; - - initCompleter(); - - foreach(QObject *i, findChildren()) - QApplication::postEvent(i, new ScriptingChangeEvent(newEnv)); - if (scriptWindow) - foreach(QObject *i, scriptWindow->findChildren()) - QApplication::postEvent(i, new ScriptingChangeEvent(newEnv)); - - return true; -} - -void ApplicationWindow::showScriptingLangDialog() -{ - ScriptingLangDialog* d = new ScriptingLangDialog(scriptEnv, this); - d->exec(); -} - -void ApplicationWindow::restartScriptingEnv() -{ - if (setScriptingLanguage(scriptEnv->name(), true)) - executeNotes(); - else - QMessageBox::critical(this, tr("QtiPlot - Scripting Error"), - tr("Scripting language \"%1\" failed to initialize.").arg(scriptEnv->name())); -} - -void ApplicationWindow::openTemplate() -{ - QString filter = "QtiPlot 2D Graph Template (*.qpt);;"; - filter += "QtiPlot 3D Surface Template (*.qst);;"; - filter += "QtiPlot Table Template (*.qtt);;"; - filter += "QtiPlot Matrix Template (*.qmt);;"; - - QString fn = getFileName(this, tr("QtiPlot - Open Template File"), templatesDir, filter, 0, false); - if (!fn.isEmpty()){ - QFileInfo fi(fn); - templatesDir = fi.dirPath(true); - if (fn.contains(".qmt") || fn.contains(".qpt") || fn.contains(".qtt") || fn.contains(".qst")) - openTemplate(fn); - else { - QMessageBox::critical(this,tr("QtiPlot - File opening error"), - tr("The file: %1 is not a QtiPlot template file!").arg(fn)); - return; - } - } -} - -MdiSubWindow* ApplicationWindow::openTemplate(const QString& fn) -{ - if (fn.isEmpty() || !QFile::exists(fn)){ - QMessageBox::critical(this, tr("QtiPlot - File opening error"), - tr("The file: %1 doesn't exist!").arg(fn)); - return 0; - } - - QFile f(fn); - QTextStream t(&f); - t.setEncoding(QTextStream::UnicodeUTF8); - f.open(QIODevice::ReadOnly); - QStringList l=t.readLine().split(QRegExp("\\s"), QString::SkipEmptyParts); - QString fileType=l[0]; - if (fileType != "QtiPlot"){ - QMessageBox::critical(this,tr("QtiPlot - File opening error"), - tr("The file: %1 was not created using QtiPlot!").arg(fn)); - return 0; - } - - QStringList vl = l[1].split(".", QString::SkipEmptyParts); - d_file_version = 100*(vl[0]).toInt()+10*(vl[1]).toInt()+(vl[2]).toInt(); - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - MdiSubWindow *w = 0; - QString templateType; - t>>templateType; - - if (templateType == "") { - t.skipWhiteSpace(); - QStringList lst; - while (!t.atEnd()) - lst << t.readLine(); - w = Graph3D::restore(this, lst, d_file_version); - if (w) - ((Graph3D *)w)->clearData(); - } else { - int rows, cols; - t>>rows; t>>cols; - t.skipWhiteSpace(); - QString geometry = t.readLine(); - - if (templateType == ""){ - w = multilayerPlot(generateUniqueName(tr("Graph")), 0, rows, cols); - if (w){ - MultiLayer *ml = qobject_cast(w); - restoreWindowGeometry(this, w, geometry); - if (d_file_version > 83){ - QStringList lst=t.readLine().split("\t", QString::SkipEmptyParts); - ml->setMargins(lst[1].toInt(),lst[2].toInt(),lst[3].toInt(),lst[4].toInt()); - lst=t.readLine().split("\t", QString::SkipEmptyParts); - ml->setSpacing(lst[1].toInt(),lst[2].toInt()); - lst=t.readLine().split("\t", QString::SkipEmptyParts); - ml->setLayerCanvasSize(lst[1].toInt(),lst[2].toInt()); - lst=t.readLine().split("\t", QString::SkipEmptyParts); - ml->setAlignement(lst[1].toInt(),lst[2].toInt()); - } - while (!t.atEnd()){//open layers - QString s = t.readLine(); - if (s.contains("")){ - QStringList lst = s.trimmed().remove("").remove("").split(","); - if (lst.size() >= 2) - ml->setWaterfallOffset(lst[0].toInt(), lst[1].toInt()); - if (lst.size() >= 3) - ml->setWaterfallSideLines(lst[2].toInt()); - ml->createWaterfallBox(); - } - if (s.left(7) == ""){ - QStringList lst; - while ( s != "" ){ - s = t.readLine(); - lst << s; - } - openGraph(this, ml, lst); - } - } - } - } else { - if (templateType == "") - w = newTable(tr("Table1"), rows, cols); - else if (templateType == "") - w = newMatrix(rows, cols); - if (w){ - QStringList lst; - while (!t.atEnd()) - lst << t.readLine(); - w->restore(lst); - restoreWindowGeometry(this, w, geometry); - } - } - } - - f.close(); - if (w){ - w->show(); - customMenu(w); - customToolBars(w); - } - - QApplication::restoreOverrideCursor(); - return w; -} - -void ApplicationWindow::readSettings() -{ -#ifdef Q_OS_MAC // Mac - QSettings settings(QSettings::IniFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); -#else - QSettings settings(QSettings::NativeFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); -#endif - - /* ---------------- group General --------------- */ - settings.beginGroup("/General"); - settings.beginGroup("/ApplicationGeometry");//main window geometry - d_app_rect = QRect(settings.value("/x", 0).toInt(), settings.value("/y", 0).toInt(), - settings.value("/width", 0).toInt(), settings.value("/height", 0).toInt()); - settings.endGroup(); - - autoSearchUpdates = settings.value("/AutoSearchUpdates", false).toBool(); - appLanguage = settings.value("/Language", QLocale::system().name().section('_',0,0)).toString(); - show_windows_policy = (ShowWindowsPolicy)settings.value("/ShowWindowsPolicy", ApplicationWindow::ActiveFolder).toInt(); - - recentProjects = settings.value("/RecentProjects").toStringList(); - //Follows an ugly hack added by Ion in order to fix Qt4 porting issues - //(only needed on Windows due to a Qt bug?) -#ifdef Q_OS_WIN - if (!recentProjects.isEmpty() && recentProjects[0].contains("^e")) - recentProjects = recentProjects[0].split("^e", QString::SkipEmptyParts); - else if (recentProjects.count() == 1){ - QString s = recentProjects[0]; - if (s.remove(QRegExp("\\s")).isEmpty()) - recentProjects = QStringList(); - } -#endif - - updateRecentProjectsList(); - - changeAppStyle(settings.value("/Style", appStyle).toString()); - autoSave = settings.value("/AutoSave",true).toBool(); - autoSaveTime = settings.value("/AutoSaveTime",15).toInt(); - d_backup_files = settings.value("/BackupProjects", true).toBool(); - d_init_window_type = (WindowType)settings.value("/InitWindow", TableWindow).toInt(); - d_completion = settings.value("/Completion", true).toBool(); - defaultScriptingLang = settings.value("/ScriptingLang","muParser").toString(); - - bool thousandsSep = settings.value("/ThousandsSeparator", true).toBool(); - QLocale loc = QLocale(settings.value("/Locale", QLocale::system().name()).toString()); - if (!thousandsSep) - loc.setNumberOptions(QLocale::OmitGroupSeparator); - setLocale(loc); - - d_decimal_digits = settings.value("/DecimalDigits", 13).toInt(); - d_clipboard_locale = QLocale(settings.value("/ClipboardLocale", QLocale::system().name()).toString()); - - d_matrix_undo_stack_size = settings.value("/MatrixUndoStackSize", 10).toInt(); - d_eol = (EndLineChar)settings.value("/EndOfLine", d_eol).toInt(); - - //restore dock windows and tool bars - restoreState(settings.value("/DockWindows").toByteArray()); - explorerSplitter->restoreState(settings.value("/ExplorerSplitter").toByteArray()); - QList lst = explorerSplitter->sizes(); - for (int i=0; i< lst.count(); i++){ - if (lst[i] == 0){ - lst[i] = 45; - explorerSplitter->setSizes(lst); - } - } - - QStringList applicationFont = settings.value("/Font").toStringList(); - if (applicationFont.size() == 4) - appFont=QFont (applicationFont[0],applicationFont[1].toInt(),applicationFont[2].toInt(),applicationFont[3].toInt()); - - settings.beginGroup("/Dialogs"); - d_extended_open_dialog = settings.value("/ExtendedOpenDialog", true).toBool(); - d_extended_export_dialog = settings.value("/ExtendedExportDialog", true).toBool(); - d_extended_import_ASCII_dialog = settings.value("/ExtendedImportAsciiDialog", true).toBool(); - d_extended_plot_dialog = settings.value("/ExtendedPlotDialog", true).toBool();//used by PlotDialog - - settings.beginGroup("/AddRemoveCurves"); - d_add_curves_dialog_size = QSize(settings.value("/Width", 700).toInt(), - settings.value("/Height", 400).toInt()); - d_show_current_folder = settings.value("/ShowCurrentFolder", false).toBool(); - settings.endGroup(); // AddRemoveCurves Dialog - settings.endGroup(); // Dialogs - - settings.beginGroup("/Colors"); - workspaceColor = settings.value("/Workspace","darkGray").value(); - // see http://doc.trolltech.com/4.2/qvariant.html for instructions on qcolor <-> qvariant conversion - panelsColor = settings.value("/Panels","#ffffff").value(); - panelsTextColor = settings.value("/PanelsText","#000000").value(); - settings.endGroup(); // Colors - - settings.beginGroup("/Paths"); - QString appPath = qApp->applicationDirPath(); - workingDir = settings.value("/WorkingDir", appPath).toString(); -#ifdef Q_OS_WIN - fitPluginsPath = settings.value("/FitPlugins", "fitPlugins").toString(); - templatesDir = settings.value("/TemplatesDir", appPath).toString(); - asciiDirPath = settings.value("/ASCII", appPath).toString(); - imagesDirPath = settings.value("/Images", appPath).toString(); -#else - fitPluginsPath = settings.value("/FitPlugins", "/usr/lib/qtiplot/plugins").toString(); - templatesDir = settings.value("/TemplatesDir", QDir::homePath()).toString(); - asciiDirPath = settings.value("/ASCII", QDir::homePath()).toString(); - imagesDirPath = settings.value("/Images", QDir::homePath()).toString(); - workingDir = settings.value("/WorkingDir", QDir::homePath()).toString(); -#endif - scriptsDirPath = settings.value("/ScriptsDir", appPath).toString(); - fitModelsPath = settings.value("/FitModelsDir", "").toString(); - customActionsDirPath = settings.value("/CustomActionsDir", "").toString(); - helpFilePath = settings.value("/HelpFile", helpFilePath).toString(); - d_translations_folder = settings.value("/Translations", d_translations_folder).toString(); - d_python_config_folder = settings.value("/PythonConfigDir", d_python_config_folder).toString(); - d_latex_compiler_path = settings.value("/LaTeXCompiler", d_latex_compiler_path).toString(); - settings.endGroup(); // Paths - - d_open_project_filter = settings.value("/OpenProjectFilter", d_open_project_filter).toString(); - d_latex_compiler = settings.value("/TeXCompilerPolicy", d_latex_compiler).toInt(); - settings.endGroup(); - /* ------------- end group General ------------------- */ - - settings.beginGroup("/UserFunctions"); - if (100*maj_version + 10*min_version + patch_version == 91 && - settings.contains("/FitFunctions")){ - saveFitFunctions(settings.value("/FitFunctions").toStringList()); - settings.remove("/FitFunctions"); - } - surfaceFunc = settings.value("/SurfaceFunctions").toStringList(); - xFunctions = settings.value("/xFunctions").toStringList(); - yFunctions = settings.value("/yFunctions").toStringList(); - rFunctions = settings.value("/rFunctions").toStringList(); - thetaFunctions = settings.value("/thetaFunctions").toStringList(); - d_param_surface_func = settings.value("/ParametricSurfaces").toStringList(); - settings.endGroup(); // UserFunctions - - settings.beginGroup("/Confirmations"); - confirmCloseFolder = settings.value("/Folder", true).toBool(); - confirmCloseTable = settings.value("/Table", true).toBool(); - confirmCloseMatrix = settings.value("/Matrix", true).toBool(); - confirmClosePlot2D = settings.value("/Plot2D", true).toBool(); - confirmClosePlot3D = settings.value("/Plot3D", true).toBool(); - confirmCloseNotes = settings.value("/Note", true).toBool(); - d_inform_rename_table = settings.value("/RenameTable", true).toBool(); - settings.endGroup(); // Confirmations - - - /* ---------------- group Tables --------------- */ - settings.beginGroup("/Tables"); - d_show_table_comments = settings.value("/DisplayComments", false).toBool(); - d_auto_update_table_values = settings.value("/AutoUpdateValues", true).toBool(); - - QStringList tableFonts = settings.value("/Fonts").toStringList(); - if (tableFonts.size() == 8) - { - tableTextFont=QFont (tableFonts[0],tableFonts[1].toInt(),tableFonts[2].toInt(),tableFonts[3].toInt()); - tableHeaderFont=QFont (tableFonts[4],tableFonts[5].toInt(),tableFonts[6].toInt(),tableFonts[7].toInt()); - } - - settings.beginGroup("/Colors"); - tableBkgdColor = settings.value("/Background","#ffffff").value(); - tableTextColor = settings.value("/Text","#000000").value(); - tableHeaderColor = settings.value("/Header","#000000").value(); - settings.endGroup(); // Colors - settings.endGroup(); - /* --------------- end group Tables ------------------------ */ - - /* --------------- group 2D Plots ----------------------------- */ - settings.beginGroup("/2DPlots"); - settings.beginGroup("/General"); - titleOn = settings.value("/Title", true).toBool(); - canvasFrameWidth = settings.value("/CanvasFrameWidth", 0).toInt(); - defaultPlotMargin = settings.value("/Margin", 0).toInt(); - drawBackbones = settings.value("/AxesBackbones", true).toBool(); - axesLineWidth = settings.value("/AxesLineWidth", 1).toInt(); - autoscale2DPlots = settings.value("/Autoscale", true).toBool(); - autoScaleFonts = settings.value("/AutoScaleFonts", true).toBool(); - autoResizeLayers = settings.value("/AutoResizeLayers", true).toBool(); - antialiasing2DPlots = settings.value("/Antialiasing", true).toBool(); - d_scale_plots_on_print = settings.value("/ScaleLayersOnPrint", false).toBool(); - d_print_cropmarks = settings.value("/PrintCropmarks", false).toBool(); - d_layer_geometry_unit = settings.value("/GeometryUnit", d_layer_geometry_unit).toInt(); - - QStringList graphFonts = settings.value("/Fonts").toStringList(); - if (graphFonts.size() == 16) { - plotAxesFont=QFont (graphFonts[0],graphFonts[1].toInt(),graphFonts[2].toInt(),graphFonts[3].toInt()); - plotNumbersFont=QFont (graphFonts[4],graphFonts[5].toInt(),graphFonts[6].toInt(),graphFonts[7].toInt()); - plotLegendFont=QFont (graphFonts[8],graphFonts[9].toInt(),graphFonts[10].toInt(),graphFonts[11].toInt()); - plotTitleFont=QFont (graphFonts[12],graphFonts[13].toInt(),graphFonts[14].toInt(),graphFonts[15].toInt()); - } - d_in_place_editing = settings.value("/InPlaceEditing", true).toBool(); - d_graph_background_color = settings.value("/BackgroundColor", d_graph_background_color).value(); - d_graph_canvas_color = settings.value("/CanvasColor", d_graph_canvas_color).value(); - d_graph_border_color = settings.value("/FrameColor", d_graph_border_color).value(); - d_graph_background_opacity = settings.value("/BackgroundOpacity", d_graph_background_opacity).toInt(); - d_graph_canvas_opacity = settings.value("/BackgroundOpacity", d_graph_canvas_opacity).toInt(); - d_graph_border_width = settings.value("/FrameWidth", d_graph_border_width).toInt(); - d_canvas_frame_color = settings.value("/FrameColor", Qt::black).value(); - d_graph_axes_labels_dist = settings.value("/LabelsAxesDist", d_graph_axes_labels_dist).toInt(); - int size = settings.beginReadArray("EnabledAxes"); - for (int i = 0; i < size; ++i) { - settings.setArrayIndex(i); - d_show_axes[i] = settings.value("enabled", true).toBool(); - d_show_axes_labels[i] = settings.value("labels", true).toBool(); - } - settings.endArray(); - d_graph_legend_display = (Graph::LegendDisplayMode)settings.value("/LegendDisplayMode", d_graph_legend_display).toInt(); - settings.endGroup(); // General - - settings.beginGroup("/Curves"); - defaultCurveStyle = settings.value("/Style", Graph::LineSymbols).toInt(); - defaultCurveLineWidth = settings.value("/LineWidth", 1).toDouble(); - defaultSymbolSize = settings.value("/SymbolSize", 7).toInt(); - settings.endGroup(); // Curves - - settings.beginGroup("/Ticks"); - majTicksStyle = settings.value("/MajTicksStyle", ScaleDraw::Out).toInt(); - minTicksStyle = settings.value("/MinTicksStyle", ScaleDraw::Out).toInt(); - minTicksLength = settings.value("/MinTicksLength", 5).toInt(); - majTicksLength = settings.value("/MajTicksLength", 9).toInt(); - settings.endGroup(); // Ticks - - settings.beginGroup("/Legend"); - legendFrameStyle = settings.value("/FrameStyle", LegendWidget::Line).toInt(); - d_frame_widget_pen.setColor(settings.value("/FrameColor", Qt::black).value()); - d_frame_widget_pen.setWidthF(settings.value("/FrameWidth", 1).toDouble()); - d_frame_widget_pen.setStyle(PenStyleBox::penStyle(settings.value("/FramePenStyle", 0).toInt())); - - legendTextColor = settings.value("/TextColor", "#000000").value(); //default color Qt::black - legendBackground = settings.value("/BackgroundColor", Qt::white).value(); //default color Qt::white - legendBackground.setAlpha(settings.value("/Transparency", 0).toInt()); // transparent by default; - d_legend_default_angle = settings.value("/Angle", 0).toInt(); - d_frame_geometry_unit = settings.value("/DefaultGeometryUnit", FrameWidget::Scale).toInt(); - settings.endGroup(); // Legend - - settings.beginGroup("/Arrows"); - defaultArrowLineWidth = settings.value("/Width", 1).toDouble(); - defaultArrowColor = settings.value("/Color", "#000000").value();//default color Qt::black - defaultArrowHeadLength = settings.value("/HeadLength", 4).toInt(); - defaultArrowHeadAngle = settings.value("/HeadAngle", 45).toInt(); - defaultArrowHeadFill = settings.value("/HeadFill", true).toBool(); - defaultArrowLineStyle = Graph::getPenStyle(settings.value("/LineStyle", "SolidLine").toString()); - settings.endGroup(); // Arrows - - settings.beginGroup("/Rectangle"); - d_rect_default_background = settings.value("/BackgroundColor", Qt::white).value(); - d_rect_default_background.setAlpha(settings.value("/Transparency", 255).toInt()); - - d_rect_default_brush.setColor(settings.value("/BrushColor", d_rect_default_brush).value()); - d_rect_default_brush.setStyle(PatternBox::brushStyle(settings.value("/Pattern", 0).toInt())); - settings.endGroup(); // Rectangle - settings.endGroup(); - /* ----------------- end group 2D Plots --------------------------- */ - - /* ----------------- group 3D Plots --------------------------- */ - settings.beginGroup("/3DPlots"); - d_3D_legend = settings.value("/Legend",true).toBool(); - d_3D_projection = settings.value("/Projection", d_3D_projection).toInt(); - d_3D_smooth_mesh = settings.value("/Antialiasing", true).toBool(); - d_3D_resolution = settings.value ("/Resolution", 1).toInt(); - d_3D_orthogonal = settings.value("/Orthogonal", false).toBool(); - d_3D_autoscale = settings.value ("/Autoscale", true).toBool(); - - QStringList plot3DFonts = settings.value("/Fonts").toStringList(); - if (plot3DFonts.size() == 12){ - d_3D_title_font=QFont (plot3DFonts[0],plot3DFonts[1].toInt(),plot3DFonts[2].toInt(),plot3DFonts[3].toInt()); - d_3D_numbers_font=QFont (plot3DFonts[4],plot3DFonts[5].toInt(),plot3DFonts[6].toInt(),plot3DFonts[7].toInt()); - d_3D_axes_font=QFont (plot3DFonts[8],plot3DFonts[9].toInt(),plot3DFonts[10].toInt(),plot3DFonts[11].toInt()); - } - - settings.beginGroup("/Colors"); - QColor max_color = settings.value("/MaxData", Qt::red).value(); - d_3D_labels_color = settings.value("/Labels", d_3D_labels_color).value(); - d_3D_mesh_color = settings.value("/Mesh", d_3D_mesh_color).value(); - QColor min_color = settings.value("/MinData", Qt::blue).value(); - d_3D_numbers_color = settings.value("/Numbers", d_3D_numbers_color).value(); - d_3D_axes_color = settings.value("/Axes", d_3D_axes_color).value(); - d_3D_background_color = settings.value("/Background", d_3D_background_color).value(); - - d_3D_color_map = QwtLinearColorMap(min_color, max_color); - d_3D_color_map.setMode((QwtLinearColorMap::Mode)settings.value("/ColorMapMode", QwtLinearColorMap::ScaledColors).toInt()); - QList stop_values = settings.value("/ColorMapStops").toList(); - QStringList stop_colors = settings.value("/ColorMapColors").toStringList(); - for (int i = 0; i < stop_colors.size(); i++) - d_3D_color_map.addColorStop(stop_values[i].toDouble(), QColor(stop_colors[i])); - - settings.endGroup(); // Colors - - settings.beginGroup("/Grids"); - d_3D_major_grids = settings.value("/EnableMajor", d_3D_major_grids).toBool(); - d_3D_grid_color = settings.value("/MajorColor", d_3D_grid_color).value(); - d_3D_major_style = settings.value("/MajorStyle", d_3D_major_style).toInt(); - d_3D_major_width = settings.value("/MajorWidth", d_3D_major_width).toDouble(); - - d_3D_minor_grids = settings.value("/EnableMinor", d_3D_minor_grids).toBool(); - d_3D_minor_grid_color = settings.value("/MinorColor", d_3D_minor_grid_color).value(); - d_3D_minor_style = settings.value("/MinorStyle", d_3D_minor_style).toInt(); - d_3D_minor_width = settings.value("/MinorWidth", d_3D_minor_width).toDouble(); - settings.endGroup(); // Grids - - settings.endGroup(); - /* ----------------- end group 3D Plots --------------------------- */ - - settings.beginGroup("/Fitting"); - fit_output_precision = settings.value("/OutputPrecision", 15).toInt(); - pasteFitResultsToPlot = settings.value("/PasteResultsToPlot", false).toBool(); - writeFitResultsToLog = settings.value("/WriteResultsToLog", true).toBool(); - generateUniformFitPoints = settings.value("/GenerateFunction", true).toBool(); - fitPoints = settings.value("/Points", 100).toInt(); - generatePeakCurves = settings.value("/GeneratePeakCurves", true).toBool(); - peakCurvesColor = settings.value("/PeaksColor", 2).toInt();//green color - fit_scale_errors = settings.value("/ScaleErrors", true).toBool(); - d_2_linear_fit_points = settings.value("/TwoPointsLinearFit", true).toBool(); - settings.endGroup(); // Fitting - - settings.beginGroup("/ImportASCII"); - columnSeparator = settings.value("/ColumnSeparator", "\\t").toString(); - columnSeparator.replace("\\t", "\t").replace("\\s", " "); - ignoredLines = settings.value("/IgnoreLines", 0).toInt(); - renameColumns = settings.value("/RenameColumns", true).toBool(); - strip_spaces = settings.value("/StripSpaces", false).toBool(); - simplify_spaces = settings.value("/SimplifySpaces", false).toBool(); - d_ASCII_file_filter = settings.value("/AsciiFileTypeFilter", "*").toString(); - d_ASCII_import_locale = settings.value("/AsciiImportLocale", QLocale::system().name()).toString(); - if (settings.value("/OmitGroupSeparator", false).toBool()) - d_ASCII_import_locale.setNumberOptions(QLocale::OmitGroupSeparator); - - d_ASCII_import_mode = settings.value("/ImportMode", ImportASCIIDialog::NewTables).toInt(); - d_ASCII_comment_string = settings.value("/CommentString", "#").toString(); - d_ASCII_import_comments = settings.value("/ImportComments", false).toBool(); - d_ASCII_import_read_only = settings.value("/ImportReadOnly", false).toBool(); - d_ASCII_import_preview = settings.value("/Preview", true).toBool(); - d_preview_lines = settings.value("/PreviewLines", 100).toInt(); - d_ASCII_end_line = (EndLineChar)settings.value("/EndLineCharacter", d_ASCII_end_line).toInt(); - d_ASCII_import_first_row_role = settings.value("/FirstLineRole", 0).toInt(); - settings.endGroup(); // Import ASCII - - settings.beginGroup("/ExportASCII"); - d_export_col_separator = settings.value("/ColumnSeparator", "\\t").toString(); - d_export_col_separator.replace("\\t", "\t").replace("\\s", " "); - d_export_col_names = settings.value("/ExportLabels", false).toBool(); - d_export_col_comment = settings.value("/ExportComments", false).toBool(); - d_export_table_selection = settings.value("/ExportSelection", false).toBool(); - d_export_ASCII_file_filter = settings.value("/ExportAsciiFilter", d_export_ASCII_file_filter).toString(); - settings.endGroup(); // ExportASCII - - settings.beginGroup("/ExportImage"); - d_image_export_filter = settings.value("/ImageFileTypeFilter", ".png").toString(); - d_export_transparency = settings.value("/ExportTransparency", false).toBool(); - d_export_quality = settings.value("/ImageQuality", 100).toInt(); - d_export_vector_resolution = settings.value("/Resolution", d_export_vector_resolution).toInt(); - d_export_color = settings.value("/ExportColor", true).toBool(); - d_3D_export_text_mode = settings.value("/3DTextMode", d_3D_export_text_mode).toInt(); - d_3D_export_sort = settings.value("/3DSortMode", d_3D_export_sort).toInt(); - d_export_bitmap_resolution = settings.value("/BitmapResolution", d_export_bitmap_resolution).toInt(); - d_export_raster_size = settings.value("/RasterSize", d_export_raster_size).toSizeF(); - d_export_size_unit = settings.value("/SizeUnit", d_export_size_unit).toInt(); - d_scale_fonts_factor = settings.value("/ScaleFontsFactor", d_scale_fonts_factor).toDouble(); - d_export_escape_tex_strings = settings.value("/EscapeTeXStrings", true).toBool(); - d_export_tex_font_sizes = settings.value("/ExportTeXFontSize", true).toBool(); - settings.endGroup(); // ExportImage - - settings.beginGroup("/ScriptWindow"); - d_script_win_on_top = settings.value("/AlwaysOnTop", false).toBool(); - d_script_win_rect = QRect(settings.value("/x", 0).toInt(), settings.value("/y", 0).toInt(), - settings.value("/width", 500).toInt(), settings.value("/height", 300).toInt()); - settings.endGroup(); - - settings.beginGroup("/ToolBars"); - d_file_tool_bar = settings.value("/FileToolBar", true).toBool(); - d_edit_tool_bar = settings.value("/EditToolBar", true).toBool(); - d_table_tool_bar = settings.value("/TableToolBar", true).toBool(); - d_column_tool_bar = settings.value("/ColumnToolBar", true).toBool(); - d_matrix_tool_bar = settings.value("/MatrixToolBar", true).toBool(); - d_plot_tool_bar = settings.value("/PlotToolBar", true).toBool(); - d_plot3D_tool_bar = settings.value("/Plot3DToolBar", true).toBool(); - d_display_tool_bar = settings.value("/DisplayToolBar", false).toBool(); - d_format_tool_bar = settings.value("/FormatToolBar", true).toBool(); - d_notes_tool_bar = settings.value("/NotesToolBar", true).toBool(); - settings.endGroup(); - - settings.beginGroup("/Notes"); - d_note_line_numbers = settings.value("/LineNumbers", true).toBool(); - d_notes_tab_length = settings.value("/TabLength", d_notes_tab_length).toInt(); - d_notes_font.setFamily(settings.value("/FontFamily", d_notes_font.family()).toString()); - d_notes_font.setPointSize(settings.value("/FontSize", d_notes_font.pointSize()).toInt()); - d_notes_font.setBold(settings.value("/FontBold", d_notes_font.bold()).toBool()); - d_notes_font.setItalic(settings.value("/FontItalic", d_notes_font.italic()).toBool()); - - settings.beginGroup("/SyntaxHighlighting"); - d_comment_highlight_color = settings.value("/Comments", d_comment_highlight_color).value(); - d_keyword_highlight_color = settings.value("/Keywords", d_keyword_highlight_color).value(); - d_quotation_highlight_color = settings.value("/Quotations", d_quotation_highlight_color).value(); - d_numeric_highlight_color = settings.value("/Numbers", d_numeric_highlight_color).value(); - d_function_highlight_color = settings.value("/Functions", d_function_highlight_color).value(); - d_class_highlight_color = settings.value("/QtClasses", d_class_highlight_color).value(); - settings.endGroup(); //end group SyntaxHighlighting - settings.endGroup(); // end group Notes - - settings.beginGroup("/Proxy"); - QNetworkProxy proxy; - proxy.setType(QNetworkProxy::NoProxy); - proxy.setHostName(settings.value("/Host", QString()).toString()); - proxy.setPort(settings.value("/Port", 8080).toInt()); - proxy.setUser(settings.value("/Username", QString()).toString()); - settings.endGroup(); - QNetworkProxy::setApplicationProxy(proxy); -} - -void ApplicationWindow::saveSettings() -{ -#ifdef Q_OS_MAC // Mac - QSettings settings(QSettings::IniFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); -#else - QSettings settings(QSettings::NativeFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); -#endif - - /* ---------------- group General --------------- */ - settings.beginGroup("/General"); - - settings.beginGroup("/ApplicationGeometry"); - d_app_rect = QRect(this->pos(), this->size()); - if (this->isMaximized()) - d_app_rect = QRect(); - - settings.setValue("/x", d_app_rect.x()); - settings.setValue("/y", d_app_rect.y()); - settings.setValue("/width", d_app_rect.width()); - settings.setValue("/height", d_app_rect.height()); - settings.endGroup(); - - settings.setValue("/AutoSearchUpdates", autoSearchUpdates); - settings.setValue("/Language", appLanguage); - settings.setValue("/ShowWindowsPolicy", show_windows_policy); - settings.setValue("/RecentProjects", recentProjects); - settings.setValue("/Style", appStyle); - settings.setValue("/AutoSave", autoSave); - settings.setValue("/AutoSaveTime", autoSaveTime); - settings.setValue("/BackupProjects", d_backup_files); - settings.setValue("/InitWindow", int(d_init_window_type)); - settings.setValue("/Completion", d_completion); - settings.setValue("/ScriptingLang", defaultScriptingLang); - - bool thousandsSep = (locale().numberOptions() & QLocale::OmitGroupSeparator) ? false : true; - settings.setValue("/ThousandsSeparator", thousandsSep); - - settings.setValue("/Locale", locale().name()); - settings.setValue("/DecimalDigits", d_decimal_digits); - settings.setValue("/ClipboardLocale", d_clipboard_locale.name()); - settings.setValue("/MatrixUndoStackSize", d_matrix_undo_stack_size); - settings.setValue("/EndOfLine", (int)d_eol); - settings.setValue("/DockWindows", saveState()); - settings.setValue("/ExplorerSplitter", explorerSplitter->saveState()); - - QStringList applicationFont; - applicationFont< stop_values; - QStringList stop_colors; - QwtArray colors = d_3D_color_map.colorStops(); - int stops = (int)colors.size() - 1; - for (int i = 1; i < stops; i++){ - stop_values << QVariant(colors[i]); - stop_colors << QColor(d_3D_color_map.rgb(QwtDoubleInterval(0, 1), colors[i])).name(); - } - settings.setValue("/ColorMapStops", QVariant(stop_values)); - settings.setValue("/ColorMapColors", stop_colors); - settings.endGroup(); // Colors - - settings.beginGroup("/Grids"); - settings.setValue("/EnableMajor", d_3D_major_grids); - settings.setValue("/MajorColor", d_3D_grid_color); - settings.setValue("/MajorStyle", d_3D_major_style); - settings.setValue("/MajorWidth", d_3D_major_width); - settings.setValue("/EnableMinor", d_3D_minor_grids); - settings.setValue("/MinorColor", d_3D_minor_grid_color); - settings.setValue("/MinorStyle", d_3D_minor_style); - settings.setValue("/MinorWidth", d_3D_minor_width); - settings.endGroup(); // Grids - - settings.endGroup(); - /* ----------------- end group 3D Plots -------- */ - - settings.beginGroup("/Fitting"); - settings.setValue("/OutputPrecision", fit_output_precision); - settings.setValue("/PasteResultsToPlot", pasteFitResultsToPlot); - settings.setValue("/WriteResultsToLog", writeFitResultsToLog); - settings.setValue("/GenerateFunction", generateUniformFitPoints); - settings.setValue("/Points", fitPoints); - settings.setValue("/GeneratePeakCurves", generatePeakCurves); - settings.setValue("/PeaksColor", peakCurvesColor); - settings.setValue("/ScaleErrors", fit_scale_errors); - settings.setValue("/TwoPointsLinearFit", d_2_linear_fit_points); - settings.endGroup(); // Fitting - - settings.beginGroup("/ImportASCII"); - QString sep = columnSeparator; - settings.setValue("/ColumnSeparator", sep.replace("\t", "\\t").replace(" ", "\\s")); - settings.setValue("/IgnoreLines", ignoredLines); - settings.setValue("/RenameColumns", renameColumns); - settings.setValue("/StripSpaces", strip_spaces); - settings.setValue("/SimplifySpaces", simplify_spaces); - settings.setValue("/AsciiFileTypeFilter", d_ASCII_file_filter); - settings.setValue("/AsciiImportLocale", d_ASCII_import_locale.name()); - - bool omitGroupSep = (d_ASCII_import_locale.numberOptions() & QLocale::OmitGroupSeparator) ? true : false; - settings.setValue("/OmitGroupSeparator", omitGroupSep); - - settings.setValue("/ImportMode", d_ASCII_import_mode); - settings.setValue("/CommentString", d_ASCII_comment_string); - settings.setValue("/ImportComments", d_ASCII_import_comments); - settings.setValue("/ImportReadOnly", d_ASCII_import_read_only); - settings.setValue("/Preview", d_ASCII_import_preview); - settings.setValue("/PreviewLines", d_preview_lines); - settings.setValue("/EndLineCharacter", (int)d_ASCII_end_line); - settings.setValue("/FirstLineRole", d_ASCII_import_first_row_role); - settings.endGroup(); // ImportASCII - - settings.beginGroup("/ExportASCII"); - sep = d_export_col_separator; - settings.setValue("/ColumnSeparator", sep.replace("\t", "\\t").replace(" ", "\\s")); - settings.setValue("/ExportLabels", d_export_col_names); - settings.setValue("/ExportComments", d_export_col_comment); - settings.setValue("/ExportSelection", d_export_table_selection); - settings.setValue("/ExportAsciiFilter", d_export_ASCII_file_filter); - settings.endGroup(); // ExportASCII - - settings.beginGroup("/ExportImage"); - settings.setValue("/ImageFileTypeFilter", d_image_export_filter); - settings.setValue("/ExportTransparency", d_export_transparency); - settings.setValue("/ImageQuality", d_export_quality); - settings.setValue("/Resolution", d_export_vector_resolution); - settings.setValue("/ExportColor", d_export_color); - settings.setValue("/3DTextMode", d_3D_export_text_mode); - settings.setValue("/3DSortMode", d_3D_export_sort); - settings.setValue("/BitmapResolution", d_export_bitmap_resolution); - settings.setValue("/RasterSize", d_export_raster_size); - settings.setValue("/SizeUnit", d_export_size_unit); - settings.setValue("/ScaleFontsFactor", d_scale_fonts_factor); - settings.setValue("/EscapeTeXStrings", d_export_escape_tex_strings); - settings.setValue("/ExportTeXFontSize", d_export_tex_font_sizes); - settings.endGroup(); // ExportImage - - settings.beginGroup("/ScriptWindow"); - settings.setValue("/AlwaysOnTop", d_script_win_on_top); - settings.setValue("/x", d_script_win_rect.x()); - settings.setValue("/y", d_script_win_rect.y()); - settings.setValue("/width", d_script_win_rect.width()); - settings.setValue("/height", d_script_win_rect.height()); - settings.endGroup();//ScriptWindow - - settings.beginGroup("/ToolBars"); - settings.setValue("/FileToolBar", d_file_tool_bar); - settings.setValue("/EditToolBar", d_edit_tool_bar); - settings.setValue("/TableToolBar", d_table_tool_bar); - settings.setValue("/ColumnToolBar", d_column_tool_bar); - settings.setValue("/MatrixToolBar", d_matrix_tool_bar); - settings.setValue("/PlotToolBar", d_plot_tool_bar); - settings.setValue("/Plot3DToolBar", d_plot3D_tool_bar); - settings.setValue("/DisplayToolBar", d_display_tool_bar); - settings.setValue("/FormatToolBar", d_format_tool_bar); - settings.setValue("/NotesToolBar", d_notes_tool_bar); - settings.endGroup();//ToolBars - - settings.beginGroup("/Notes"); - settings.setValue("/LineNumbers", d_note_line_numbers); - settings.setValue("/TabLength", d_notes_tab_length); - settings.setValue("/FontFamily", d_notes_font.family()); - settings.setValue("/FontSize", d_notes_font.pointSize()); - settings.setValue("/FontBold", d_notes_font.bold()); - settings.setValue("/FontItalic", d_notes_font.italic()); - settings.beginGroup("/SyntaxHighlighting"); - settings.setValue("/Comments", d_comment_highlight_color.name()); - settings.setValue("/Keywords", d_keyword_highlight_color.name()); - settings.setValue("/Quotations", d_quotation_highlight_color.name()); - settings.setValue("/Numbers", d_numeric_highlight_color.name()); - settings.setValue("/Functions", d_function_highlight_color.name()); - settings.setValue("/QtClasses", d_class_highlight_color.name()); - settings.endGroup();//SyntaxHighlighting - settings.endGroup();//Notes - - QNetworkProxy proxy = QNetworkProxy::applicationProxy(); - if (!proxy.hostName().isEmpty()){ - settings.beginGroup("/Proxy"); - settings.setValue("/Host", proxy.hostName()); - settings.setValue("/Port", proxy.port()); - settings.setValue("/Username", proxy.user()); - settings.endGroup();//Proxy - } else - settings.remove("/Proxy"); -} - -void ApplicationWindow::exportGraph(const QString& exportFilter) -{ - MdiSubWindow *w = activeWindow(); - if (!w) - return; - - MultiLayer *plot2D = qobject_cast(w); - Graph3D *plot3D = qobject_cast(w); - if(plot2D && plot2D->isEmpty()){ - QMessageBox::critical(this, tr("QtiPlot - Export Error"), - tr("

There are no plot layers available in this window!

")); - return; - } - - if (!plot2D && !plot3D) - return; - - ImageExportDialog *ied = new ImageExportDialog(w, this, d_extended_export_dialog); - ied->setDirectory(imagesDirPath); - ied->selectFile(w->objectName()); - if (exportFilter.isEmpty()) - ied->selectFilter(d_image_export_filter); - else - ied->selectFilter(exportFilter); - - if ( ied->exec() != QDialog::Accepted ) - return; - imagesDirPath = ied->directory().path(); - if (ied->selectedFiles().isEmpty()) - return; - - QString selected_filter = ied->selectedFilter().remove("*"); - QString file_name = ied->selectedFiles()[0]; - if(!file_name.endsWith(selected_filter, Qt::CaseInsensitive)) - file_name.append(selected_filter); - - QFile file(file_name); - if (!file.open( QIODevice::WriteOnly )){ - QMessageBox::critical(this, tr("QtiPlot - Export error"), - tr("Could not write to file:

%1

Please verify that you have the right to write to this location!").arg(file_name)); - return; - } - file.close(); - - if (plot3D && selected_filter.contains(".pgf")){ - plot3D->exportVector(file_name, ied->textExportMode(), ied->sortMode()); - return; - } - -#ifdef EMF_OUTPUT - if (plot2D && selected_filter.contains(".emf")){ - plot2D->exportEMF(file_name, ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); - return; - } -#endif - - if (plot2D && selected_filter.contains(".tex")){ - plot2D->exportTeX(file_name, ied->color(), ied->escapeStrings(), ied->exportFontSizes(), ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); - return; - } - - if (selected_filter.contains(".eps") || selected_filter.contains(".pdf") || - selected_filter.contains(".ps") || selected_filter.contains(".svg")) { - if (plot3D) - plot3D->exportVector(file_name, ied->textExportMode(), ied->sortMode(), - ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); - else if (plot2D){ - if (selected_filter.contains(".svg")) - plot2D->exportSVG(file_name, ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); - else - plot2D->exportVector(file_name, ied->vectorResolution(), ied->color(), - ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); - } - } else if (selected_filter.contains(".odf")){ - if (plot2D) - plot2D->exportImage(file_name, ied->quality(), ied->transparency(), ied->bitmapResolution(), - ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); - else if (plot3D) - plot3D->exportImage(file_name, ied->quality(), ied->transparency(), ied->bitmapResolution(), - ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); - - } else { - QList list = QImageWriter::supportedImageFormats(); - for (int i=0; i<(int)list.count(); i++){ - if (selected_filter.contains("." + (list[i]).lower())) { - if (plot2D) - plot2D->exportImage(file_name, ied->quality(), ied->transparency(), - ied->bitmapResolution(), ied->customExportSize(), ied->sizeUnit(), - ied->scaleFontsFactor()); - else if (plot3D){ - plot3D->exportImage(file_name, ied->quality(), ied->transparency(), - ied->bitmapResolution(), ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); - } - } - } - } -} - -void ApplicationWindow::exportLayer() -{ - MdiSubWindow *w = activeWindow(MultiLayerWindow); - if (!w) - return; - - Graph* g = ((MultiLayer*)w)->activeLayer(); - if (!g) - return; - - ImageExportDialog *ied = new ImageExportDialog(w, this, d_extended_export_dialog, g); - ied->setDir(imagesDirPath); - ied->selectFile(w->objectName()); - ied->selectFilter(d_image_export_filter); - if ( ied->exec() != QDialog::Accepted ) - return; - imagesDirPath = ied->directory().path(); - if (ied->selectedFiles().isEmpty()) - return; - - QString selected_filter = ied->selectedFilter().remove("*"); - QString file_name = ied->selectedFiles()[0]; - if(!file_name.endsWith(selected_filter, Qt::CaseInsensitive)) - file_name.append(selected_filter); - - QFile file(file_name); - if ( !file.open( QIODevice::WriteOnly ) ){ - QMessageBox::critical(this, tr("QtiPlot - Export error"), - tr("Could not write to file:

%1

Please verify that you have the right to write to this location!").arg(file_name)); - return; - } - file.close(); - - if (selected_filter.contains(".eps") || selected_filter.contains(".pdf") || selected_filter.contains(".ps")) - g->exportVector(file_name, ied->vectorResolution(), ied->color(), - ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); - else if (selected_filter.contains(".svg")) - g->exportSVG(file_name, ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); -#ifdef EMF_OUTPUT - else if (selected_filter.contains(".emf")) - g->exportEMF(file_name, ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); -#endif - else if (selected_filter.contains(".tex")) - g->exportTeX(file_name, ied->color(), ied->escapeStrings(), ied->exportFontSizes(), ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); - else if (selected_filter.contains(".odf")) - g->exportImage(file_name, ied->quality(), ied->transparency(), ied->bitmapResolution(), - ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); - else { - QList list = QImageWriter::supportedImageFormats(); - for (int i=0; i<(int)list.count(); i++) - if (selected_filter.contains("."+(list[i]).lower())) - g->exportImage(file_name, ied->quality(), ied->transparency(), - ied->bitmapResolution(), ied->customExportSize(), ied->sizeUnit(), - ied->scaleFontsFactor()); - } -} - -void ApplicationWindow::exportPresentationODF() -{ - ImageExportDialog *ied = new ImageExportDialog(NULL, this, d_extended_export_dialog); - ied->setDir(imagesDirPath); - ied->setNameFilter("*.odf"); - - if ( ied->exec() != QDialog::Accepted ) - return; - imagesDirPath = ied->directory().path(); - if (ied->selectedFiles().isEmpty()) - return; - - QString selected_filter = ied->selectedFilter().remove("*"); - QString file_name = ied->selectedFiles()[0]; - if(!file_name.endsWith(selected_filter, Qt::CaseInsensitive)) - file_name.append(selected_filter); - - QDialog *previewDlg = new QDialog(this); - previewDlg->setSizeGripEnabled(true); - previewDlg->setWindowTitle(tr("QtiPlot") + " - " + tr("Presentation Preview")); - previewDlg->resize(QSize(600, 400)); - - QHBoxLayout *bl = new QHBoxLayout(); - bl->addStretch(); - QPushButton *okBtn = new QPushButton(tr("&Save")); - connect(okBtn, SIGNAL(clicked()), previewDlg, SLOT(accept())); - bl->addWidget(okBtn); - - QPushButton *cancelBtn = new QPushButton(tr("&Cancel")); - connect(cancelBtn, SIGNAL(clicked()), previewDlg, SLOT(reject())); - bl->addWidget(cancelBtn); - bl->addStretch(); - - QVBoxLayout *vl = new QVBoxLayout(previewDlg); - QTextEdit *te = new QTextEdit(); - vl->addWidget(te); - vl->addLayout(bl); - - QTextDocument *document = te->document(); - - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - if (qobject_cast(w)){ - MultiLayer *plot2D = qobject_cast(w); - if (!plot2D->isEmpty()) - plot2D->exportImage(document, ied->quality(), ied->transparency(), ied->bitmapResolution(), - ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); - } else if (qobject_cast(w)) - ((Graph3D *)w)->exportImage(document, ied->quality(), ied->transparency(), ied->bitmapResolution(), - ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); - } - - if (previewDlg->exec()){ - QFile file(file_name); - if (!file.open( QIODevice::WriteOnly)){ - QMessageBox::critical(this, tr("QtiPlot - Export error"), - tr("Could not write to file:

%1

Please verify that you have the right to write to this location!").arg(file_name)); - return; - } - file.close(); - - QTextDocumentWriter writer(file_name); - writer.write(document); - } -} - -void ApplicationWindow::exportAllGraphs() -{ - ImageExportDialog *ied = new ImageExportDialog(NULL, this, d_extended_export_dialog); - ied->setWindowTitle(tr("Choose a directory to export the graphs to")); - QStringList tmp = ied->filters(); - ied->setFileMode(QFileDialog::Directory); - ied->setFilters(tmp); - ied->setLabelText(QFileDialog::FileType, tr("Output format:")); - ied->setLabelText(QFileDialog::FileName, tr("Directory:")); - ied->setDir(imagesDirPath); - ied->selectFilter(d_image_export_filter); - - if ( ied->exec() != QDialog::Accepted ) - return; - imagesDirPath = ied->directory().path(); - if (ied->selectedFiles().isEmpty()) - return; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - QString output_dir = ied->selectedFiles()[0]; - QString file_suffix = ied->selectedFilter(); - file_suffix.lower(); - file_suffix.remove("*"); - - bool confirm_overwrite = true; - MultiLayer *plot2D; - Graph3D *plot3D; - - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - if (w->isA("MultiLayer")) { - plot3D = 0; - plot2D = (MultiLayer *)w; - if (plot2D->isEmpty()) { - QApplication::restoreOverrideCursor(); - QMessageBox::warning(this, tr("QtiPlot - Warning"), - tr("There are no plot layers available in window %1.
" - "Graph window not exported!").arg(plot2D->objectName())); - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - continue; - } - } else if (w->isA("Graph3D")) { - plot2D = 0; - plot3D = (Graph3D *)w; - } else - continue; - - QString file_name = output_dir + "/" + w->objectName() + file_suffix; - QFile f(file_name); - if (f.exists() && confirm_overwrite) { - QApplication::restoreOverrideCursor(); - - QString msg = tr("A file called:

%1

already exists. ""Do you want to overwrite it?").arg(file_name); - QMessageBox msgBox(QMessageBox::Question, tr("QtiPlot - Overwrite file?"), msg, - QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::Cancel, - (ApplicationWindow *)this); - msgBox.exec(); - switch(msgBox.standardButton(msgBox.clickedButton())){ - case QMessageBox::Yes: - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - break; - case QMessageBox::YesToAll: - confirm_overwrite = false; - break; - case QMessageBox::No: - confirm_overwrite = true; - continue; - break; - case QMessageBox::Cancel: - return; - break; - default: - break; - } - } - if ( !f.open( QIODevice::WriteOnly ) ) { - QApplication::restoreOverrideCursor(); - QMessageBox::critical(this, tr("QtiPlot - Export error"), - tr("Could not write to file:

%1

" - "Please verify that you have the right to write to this location!").arg(file_name)); - return; - } - f.close(); - -#ifdef EMF_OUTPUT - if (plot2D && file_suffix.contains(".emf")){ - plot2D->exportEMF(file_name, ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); - return; - } -#endif - if (plot2D && file_suffix.contains(".tex")){ - plot2D->exportTeX(file_name, ied->color(), ied->escapeStrings(), ied->exportFontSizes(), ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); - return; - } - - if (file_suffix.contains(".eps") || file_suffix.contains(".pdf") || - file_suffix.contains(".ps") || file_suffix.contains(".svg")) { - if (plot3D) - plot3D->exportVector(file_name, ied->textExportMode(), ied->sortMode(), - ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); - else if (plot2D){ - if (file_suffix.contains(".svg")) - plot2D->exportSVG(file_name, ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); - else - plot2D->exportVector(file_name, ied->vectorResolution(), ied->color(), - ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); - } - } else { - QList list = QImageWriter::supportedImageFormats(); - for (int i=0; i<(int)list.count(); i++){ - if (file_suffix.contains("." + (list[i]).lower())) { - if (plot2D) - plot2D->exportImage(file_name, ied->quality(), ied->transparency(), - ied->bitmapResolution(), ied->customExportSize(), ied->sizeUnit(), - ied->scaleFontsFactor()); - else if (plot3D) - plot3D->exportImage(file_name, ied->quality(), ied->transparency(), - ied->bitmapResolution(), ied->customExportSize(), ied->sizeUnit(), ied->scaleFontsFactor()); - } - } - } - } - QApplication::restoreOverrideCursor(); -} - -QString ApplicationWindow::windowGeometryInfo(MdiSubWindow *w) -{ - QString s = "geometry\t"; - if (w->status() == MdiSubWindow::Maximized){ - if (w == w->folder()->activeWindow()) - return s + "maximized\tactive\n"; - else - return s + "maximized\n"; - } - - s += QString::number(w->x()) + "\t"; - s += QString::number(w->y()) + "\t"; - - QSize minRestoreSize = w->minRestoreSize(); - if (w->status() == MdiSubWindow::Hidden && - minRestoreSize.width() > w->width() && - minRestoreSize.height() > w->height()){ - // the window was minimized and afterwards hidden - s += QString::number(minRestoreSize.width()) + "\t"; - s += QString::number(minRestoreSize.height()) + "\t"; - } else if (w->status() != MdiSubWindow::Minimized){ - s += QString::number(w->width()) + "\t"; - s += QString::number(w->height()) + "\t"; - } else { - s += QString::number(minRestoreSize.width()) + "\t"; - s += QString::number(minRestoreSize.height()) + "\t"; - s += "minimized\t"; - } - - bool hide = hidden(w); - if (w == w->folder()->activeWindow() && !hide) - s += "active\n"; - else if(hide) - s += "hidden\n"; - else - s += "\n"; - return s; -} - -void ApplicationWindow::restoreWindowGeometry(ApplicationWindow *app, MdiSubWindow *w, const QString s) -{ - if (qobject_cast(w)) - w->hide(); - - QString caption = w->objectName(); - if (s.contains ("minimized")) { - QStringList lst = s.split("\t"); - if (lst.count() > 4){ - int width = lst[3].toInt(); - int height = lst[4].toInt(); - if(width > 0 && height > 0) - w->resize(width, height); - } - w->setStatus(MdiSubWindow::Minimized); - app->setListView(caption, tr("Minimized")); - } else if (s.contains ("maximized")){ - w->setMaximized(); - } else { - QStringList lst = s.split("\t"); - if (lst.count() > 4){ - w->resize(lst[3].toInt(), lst[4].toInt()); - w->move(lst[1].toInt(), lst[2].toInt()); - } - w->setStatus(MdiSubWindow::Normal); - if (lst.count() > 5) { - if (lst[5] == "hidden") - app->hideWindow(w); - } - } - - if (s.contains ("active")) { - Folder *f = w->folder(); - if (f) - f->setActiveWindow(w); - } -} - -Folder* ApplicationWindow::projectFolder() -{ - return ((FolderListItem *)folders->firstChild())->folder(); -} - -bool ApplicationWindow::saveProject(bool compress) -{ - if (projectname == "untitled" || projectname.endsWith(".opj", Qt::CaseInsensitive) || - projectname.endsWith(".ogm", Qt::CaseInsensitive) || projectname.endsWith(".ogw", Qt::CaseInsensitive) - || projectname.endsWith(".ogg", Qt::CaseInsensitive)) - { - saveProjectAs(); - return false; - } - -#ifdef QTIPLOT_DEMO - showDemoVersionMessage(); - return false; -#endif - - saveFolder(projectFolder(), projectname, compress); - - setWindowTitle("QtiPlot - " + projectname); - savedProject(); - - if (autoSave){ - if (savingTimerId) - killTimer(savingTimerId); - savingTimerId=startTimer(autoSaveTime*60000); - } else - savingTimerId=0; - - QApplication::restoreOverrideCursor(); - return true; -} - -QString ApplicationWindow::getFileName(QWidget *parent, const QString & caption, - const QString & dir, const QString & filter, QString * selectedFilter, bool save) -{ - QFileDialog fd(parent, caption, dir, filter); - if (save){ - fd.setAcceptMode(QFileDialog::AcceptSave); - fd.setConfirmOverwrite(true); - } else - fd.setAcceptMode(QFileDialog::AcceptOpen); - - fd.setFileMode(QFileDialog::AnyFile); - - if (fd.exec() != QDialog::Accepted ) - return QString(); - - if (fd.selectedFiles().isEmpty()) - return QString(); - - if (selectedFilter) - *selectedFilter = fd.selectedNameFilter(); - return fd.selectedFiles()[0]; -} - -void ApplicationWindow::saveProjectAs(const QString& fileName, bool compress) -{ -#ifdef QTIPLOT_DEMO - showDemoVersionMessage(); - return; -#endif - - QString fn = fileName; - if (fileName.isEmpty()){ - QString filter = tr("QtiPlot project") + " (*.qti);;"; - filter += tr("Compressed QtiPlot project") + " (*.qti.gz)"; - - QString selectedFilter; - fn = getFileName(this, tr("Save Project As"), workingDir, filter, &selectedFilter); - if (selectedFilter.contains(".gz")) - compress = true; - } - - if ( !fn.isEmpty() ){ - QFileInfo fi(fn); - workingDir = fi.dirPath(true); - if (!fn.endsWith(".qti", Qt::CaseInsensitive)) - fn.append(".qti"); - - projectname = fn; - if (saveProject(compress)){ - recentProjects.removeAll(projectname); - recentProjects.push_front(projectname); - updateRecentProjectsList(); - - QFileInfo fi(fn); - QString baseName = fi.baseName(); - FolderListItem *item = (FolderListItem *)folders->firstChild(); - item->setText(0, baseName); - item->folder()->setObjectName(baseName); - } - } -} - -void ApplicationWindow::saveNoteAs() -{ - Note* w = (Note*)activeWindow(NoteWindow); - if (!w) - return; - w->exportASCII(); -} - -void ApplicationWindow::increaseNoteIndent() -{ - Note* w = (Note*)activeWindow(NoteWindow); - if (!w) - return; - - w->setTabStopWidth(w->currentEditor()->tabStopWidth() + 5); - modifiedProject(); -} - -void ApplicationWindow::decreaseNoteIndent() -{ - Note* w = (Note*)activeWindow(NoteWindow); - if (!w) - return; - - w->setTabStopWidth(w->currentEditor()->tabStopWidth() - 5); - modifiedProject(); -} - -void ApplicationWindow::showNoteLineNumbers(bool show) -{ - Note* w = (Note*)activeWindow(NoteWindow); - if (!w) - return; - w->showLineNumbers(show); - modifiedProject(); -} - -void ApplicationWindow::noteFindDialogue() -{ - Note* w = (Note*)activeWindow(NoteWindow); - if (!w) - return; - - w->currentEditor()->showFindDialog(); -} - -void ApplicationWindow::noteFindNext() -{ - Note* w = (Note*)activeWindow(NoteWindow); - if (!w) - return; - - w->currentEditor()->findNext(); -} - -void ApplicationWindow::noteFindPrev() -{ - Note* w = (Note*)activeWindow(NoteWindow); - if (!w) - return; - - w->currentEditor()->findPrevious(); -} - -void ApplicationWindow::noteReplaceDialogue() -{ - Note* w = (Note*)activeWindow(NoteWindow); - if (!w) - return; - - w->currentEditor()->showFindDialog(true); -} - -void ApplicationWindow::renameCurrentNoteTab() -{ - Note* w = (Note*)activeWindow(NoteWindow); - if (!w) - return; - w->renameCurrentTab(); - modifiedProject(); -} - -void ApplicationWindow::addNoteTab() -{ - Note* w = (Note*)activeWindow(NoteWindow); - if (!w) - return; - w->addTab(); - modifiedProject(); -} - -void ApplicationWindow::closeNoteTab() -{ - Note* w = (Note*)activeWindow(NoteWindow); - if (!w) - return; - w->removeTab(); - modifiedProject(); -} - -void ApplicationWindow::saveAsTemplate(MdiSubWindow* w, const QString& fileName) -{ - if (!w) { - w = activeWindow(); - if (!w) - return; - } - - QString fn = fileName; - if (fn.isEmpty()){ - QString filter; - if (w->isA("Matrix")) - filter = tr("QtiPlot Matrix Template")+" (*.qmt)"; - else if (w->isA("MultiLayer")) - filter = tr("QtiPlot 2D Graph Template")+" (*.qpt)"; - else if (w->inherits("Table")) - filter = tr("QtiPlot Table Template")+" (*.qtt)"; - else if (w->isA("Graph3D")) - filter = tr("QtiPlot 3D Surface Template")+" (*.qst)"; - - QString selectedFilter; - fn = getFileName(this, tr("Save Window As Template"), templatesDir + "/" + w->objectName(), filter, &selectedFilter); - - if (!fn.isEmpty()){ - QFileInfo fi(fn); - templatesDir = fi.dirPath(true); - QString baseName = fi.fileName(); - if (!baseName.contains(".")){ - selectedFilter = selectedFilter.right(5).left(4); - fn.append(selectedFilter); - } - } else - return; - } - - QFile f(fn); - if ( !f.open( QIODevice::WriteOnly ) ){ - QMessageBox::critical(this, tr("QtiPlot - Export error"), - tr("Could not write to file:

%1

Please verify that you have the right to write to this location!").arg(fn)); - return; - } - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - QTextStream t( &f ); - t.setEncoding(QTextStream::UnicodeUTF8); - t << "QtiPlot " + QString::number(maj_version)+"."+ QString::number(min_version)+"."+ - QString::number(patch_version) + " template file\n"; - f.close(); - w->save(fn, windowGeometryInfo(w), true); - QApplication::restoreOverrideCursor(); -} - -void ApplicationWindow::rename() -{ - MdiSubWindow* m = activeWindow(); - if (!m) - return; - - RenameWindowDialog *rwd = new RenameWindowDialog(this); - rwd->setAttribute(Qt::WA_DeleteOnClose); - rwd->setWidget(m); - rwd->exec(); -} - -void ApplicationWindow::renameWindow() -{ - WindowListItem *it = (WindowListItem *)lv->currentItem(); - MdiSubWindow *w = it->window(); - if (!w) - return; - - RenameWindowDialog *rwd = new RenameWindowDialog(this); - rwd->setAttribute(Qt::WA_DeleteOnClose); - rwd->setWidget(w); - rwd->exec(); -} - -void ApplicationWindow::renameWindow(Q3ListViewItem *item, int, const QString &text) -{ - if (!item) - return; - - MdiSubWindow *w = ((WindowListItem *)item)->window(); - if (!w || text == w->objectName()) - return; - - if(!setWindowName(w, text)) - item->setText(0, w->objectName()); -} - -bool ApplicationWindow::setWindowName(MdiSubWindow *w, const QString &text) -{ - if (!w) - return false; - - QString name = w->objectName(); - if (name == text) - return true; - - QString newName = text; - newName.replace("-", "_"); - if (newName.isEmpty()){ - QMessageBox::critical(this, tr("QtiPlot - Error"), tr("Please enter a valid name!")); - return false; - } else if (newName.contains(QRegExp("\\W"))){ - QMessageBox::critical(this, tr("QtiPlot - Error"), - tr("The name you chose is not valid: only letters and digits are allowed!")+ - "

" + tr("Please choose another name!")); - return false; - } - - newName.replace("_", "-"); - - while(alreadyUsedName(newName)){ - QMessageBox::critical(this, tr("QtiPlot - Error"), tr("Name %1 already exists!").arg(newName)+ - "

"+tr("Please choose another name!")+ - "

"+tr("Warning: for internal consistency reasons the underscore character is replaced with a minus sign.")); - return false; - } - - if (w->inherits("Table")) - updateTableNames(name, newName); - else if (w->isA("Matrix")) - changeMatrixName(name, newName); - - w->setCaptionPolicy(w->captionPolicy()); - w->setName(newName); - renameListViewItem(name, newName); - updateCompleter(name, false, newName); - return true; -} - -QStringList ApplicationWindow::columnsList(Table::PlotDesignation plotType) -{ - QStringList list; - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - if (!w->inherits("Table")) - continue; - - Table *t = (Table *)w; - for (int i=0; i < t->numCols(); i++) - { - if (t->colPlotDesignation(i) == plotType || plotType == Table::All) - list << QString(t->objectName()) + "_" + t->colLabel(i); - } - } - return list; -} - -void ApplicationWindow::showCurvesDialog() -{ - MdiSubWindow *w = activeWindow(MultiLayerWindow); - if (!w) - return; - - if (((MultiLayer*)w)->isEmpty()){ - QMessageBox::warning(this,tr("QtiPlot - Error"), - tr("

There are no plot layers available in this window.

" - "

Please add a layer and try again!

")); - return; - } - - Graph* g = ((MultiLayer*)w)->activeLayer(); - if (!g) - return; - - if (g->isPiePlot()){ - QMessageBox::warning(this,tr("QtiPlot - Error"), - tr("This functionality is not available for pie plots!")); - } else { - CurvesDialog* crvDialog = new CurvesDialog(this); - crvDialog->setAttribute(Qt::WA_DeleteOnClose); - crvDialog->setGraph(g); - crvDialog->resize(d_add_curves_dialog_size); - crvDialog->setModal(true); - crvDialog->show(); - } -} - -bool ApplicationWindow::hasTable() -{ - Folder *f = projectFolder(); - while (f){ - QList folderWindows = f->windowsList(); - foreach(MdiSubWindow *w, folderWindows){ - if (w->inherits("Table")) - return true; - } - f = f->folderBelow(); - } - return false; -} - -QStringList ApplicationWindow::tableNames() -{ - QStringList lst = QStringList(); - Folder *f = projectFolder(); - while (f){ - QList folderWindows = f->windowsList(); - foreach(MdiSubWindow *w, folderWindows){ - if (w->inherits("Table")) - lst << w->objectName(); - } - f = f->folderBelow(); - } - return lst; -} - -QList ApplicationWindow::tableList() -{ - QList lst; - Folder *f = projectFolder(); - while (f){ - QList folderWindows = f->windowsList(); - foreach(MdiSubWindow *w, folderWindows){ - if (w->inherits("Table")) - lst << w; - } - f = f->folderBelow(); - } - return lst; -} - -AssociationsDialog* ApplicationWindow::showPlotAssociations(int curve) -{ - MdiSubWindow* w = activeWindow(MultiLayerWindow); - if (!w) - return 0; - - Graph *g = ((MultiLayer*)w)->activeLayer(); - if (!g) - return 0; - - AssociationsDialog* ad = new AssociationsDialog(this); - ad->setAttribute(Qt::WA_DeleteOnClose); - ad->setGraph(g); - ad->initTablesList(tableList(), curve); - ad->show(); - return ad; -} - -void ApplicationWindow::showTitleDialog() -{ - MdiSubWindow *w = activeWindow(); - if (!w) - return; - - if (w->isA("MultiLayer")){ - Graph* g = ((MultiLayer*)w)->activeLayer(); - if (g){ - TextDialog* td= new TextDialog(TextDialog::LayerTitle, this,0); - td->setGraph(g); - td->exec(); - } - } else if (w->isA("Graph3D")) { - Plot3DDialog* pd = (Plot3DDialog*)showPlot3dDialog(); - if (pd) - pd->showTitleTab(); - } -} - -void ApplicationWindow::showAxisTitleDialog() -{ - MdiSubWindow* w = activeWindow(MultiLayerWindow); - if (!w) - return; - - Graph* g = ((MultiLayer*)w)->activeLayer(); - if (!g) - return; - - TextDialog* td = new TextDialog(TextDialog::AxisTitle, this, 0); - td->setGraph(g); - td->exec(); -} - -void ApplicationWindow::showExportASCIIDialog() -{ - MdiSubWindow* t = activeWindow(); - if (!t) - return; - if (!qobject_cast(t) && !t->inherits("Table")) - return; - - ExportDialog* ed = new ExportDialog(t, this, true); - ed->exec(); -} - -void ApplicationWindow::exportAllTables(const QString& dir, const QString& filter, const QString& sep, bool colNames, bool colComments, bool expSelection) -{ - if (dir.isEmpty()) - return; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - workingDir = dir; - - bool confirmOverwrite = true; - bool success = true; - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - if (w->inherits("Table") || w->isA("Matrix")){ - QString fileName = dir + "/" + w->objectName() + filter; - QFile f(fileName); - if (f.exists(fileName) && confirmOverwrite){ - QApplication::restoreOverrideCursor(); - switch(QMessageBox::question(this, tr("QtiPlot - Overwrite file?"), - tr("A file called:

%1

already exists. " - "Do you want to overwrite it?").arg(fileName), tr("&Yes"), tr("&All"), tr("&Cancel"), 0, 1)) - { - case 0: - if (w->inherits("Table")) - success = ((Table*)w)->exportASCII(fileName, sep, colNames, colComments, expSelection); - else if (w->isA("Matrix")) - success = ((Matrix*)w)->exportASCII(fileName, sep, expSelection); - break; - - case 1: - confirmOverwrite = false; - if (w->inherits("Table")) - success = ((Table*)w)->exportASCII(fileName, sep, colNames, colComments, expSelection); - else if (w->isA("Matrix")) - success = ((Matrix*)w)->exportASCII(fileName, sep, expSelection); - break; - - case 2: - return; - break; - } - } else if (w->inherits("Table")) - success = ((Table*)w)->exportASCII(fileName, sep, colNames, colComments, expSelection); - else if (w->isA("Matrix")) - success = ((Matrix*)w)->exportASCII(fileName, sep, expSelection); - - if (!success) - break; - } - } - QApplication::restoreOverrideCursor(); -} - -void ApplicationWindow::showRowsDialog() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return; - - bool ok; - int rows = QInputDialog::getInteger(this, tr("QtiPlot - Enter rows number"), tr("Rows"), - t->numRows(), 0, 1000000, 1, &ok); - if ( ok ) - t->resizeRows(rows); -} - -void ApplicationWindow::showDeleteRowsDialog() -{ - Table *t = (Table*)activeWindow(TableWindow); - if (!t) - return; - - bool ok; - int start_row = QInputDialog::getInteger(this, tr("QtiPlot - Delete rows"), tr("Start row"), - 1, 1, t->numRows(), 1, &ok); - if (ok){ - int end_row = QInputDialog::getInteger(this, tr("QtiPlot - Delete rows"), tr("End row"), - t->numRows(), 1, t->numRows(), 1, &ok); - if (ok) - t->deleteRows(start_row, end_row); - } -} - -void ApplicationWindow::showColsDialog() -{ - Table *t = (Table*)activeWindow(TableWindow); - if (!t) - return; - - bool ok; - int cols = QInputDialog::getInteger(this, tr("QtiPlot - Enter columns number"), tr("Columns"), - t->numCols(), 0, 1000000, 1, &ok); - if ( ok ) - t->resizeCols(cols); -} - -void ApplicationWindow::showColumnValuesDialog() -{ - Table *w = (Table*)activeWindow(TableWindow); - if (!w) - return; - - if (w->selectedColumns().count()>0 || w->table()->currentSelection() >= 0){ - SetColValuesDialog* vd = new SetColValuesDialog(scriptEnv, this); - vd->setTable(w); - if (d_completion) - vd->setCompleter(d_completer); - vd->exec(); - } else - QMessageBox::warning(this, tr("QtiPlot - Column selection error"), tr("Please select a column first!")); -} - -void ApplicationWindow::recalculateTable() -{ - MdiSubWindow* w = activeWindow(); - if (!w) - return; - - if (qobject_cast(w)) - ((TableStatistics*)w)->update(); - else if (qobject_cast

(w)) - ((Table*)w)->calculate(); - else if (qobject_cast(w)) - ((Matrix*)w)->calculate(); -} - -void ApplicationWindow::sortActiveTable() -{ - Table *t = (Table*)activeWindow(TableWindow); - if (!t) - return; - - if ((int)t->selectedColumns().count()>0) - t->sortTableDialog(); - else - QMessageBox::warning(this, "QtiPlot - Column selection error","Please select a column first!"); -} - -void ApplicationWindow::sortSelection() -{ - Table *t = (Table*)activeWindow(TableWindow); - if (!t) - return; - - t->sortColumnsDialog(); -} - -void ApplicationWindow::normalizeActiveTable() -{ - Table *t = (Table*)activeWindow(TableWindow); - if (!t) - return; - - if (int(t->selectedColumns().count())>0) - t->normalize(); - else - QMessageBox::warning(this, tr("QtiPlot - Column selection error"), tr("Please select a column first!")); -} - -void ApplicationWindow::normalizeSelection() -{ - Table *t = (Table*)activeWindow(TableWindow); - if (!t) - return; - - if (int(t->selectedColumns().count())>0) - t->normalizeSelection(); - else - QMessageBox::warning(this, tr("QtiPlot - Column selection error"), tr("Please select a column first!")); -} - -void ApplicationWindow::correlate() -{ - Table *t = (Table*)activeWindow(TableWindow); - if (!t) - return; - - QStringList s = t->selectedColumns(); - if ((int)s.count() != 2){ - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select two columns for this operation!")); - return; - } - - Correlation *cor = new Correlation(this, t, s[0], s[1]); - cor->run(); - delete cor; -} - -void ApplicationWindow::autoCorrelate() -{ - Table *t = (Table*)activeWindow(TableWindow); - if (!t) - return; - - QStringList s = t->selectedColumns(); - if ((int)s.count() != 1) - { - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select exactly one columns for this operation!")); - return; - } - - Correlation *cor = new Correlation(this, t, s[0], s[0]); - cor->run(); - delete cor; -} - -void ApplicationWindow::convolute() -{ - Table *t = (Table*)activeWindow(TableWindow); - if (!t) - return; - - QStringList s = t->selectedColumns(); - if ((int)s.count() != 2) - { - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select two columns for this operation:\n the first represents the signal and the second the response function!")); - return; - } - - Convolution *cv = new Convolution(this, t, s[0], s[1]); - cv->run(); - delete cv; -} - -void ApplicationWindow::deconvolute() -{ - Table *t = (Table*)activeWindow(TableWindow); - if (!t) - return; - - QStringList s = t->selectedColumns(); - if ((int)s.count() != 2) - { - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select two columns for this operation:\n the first represents the signal and the second the response function!")); - return; - } - - Deconvolution *dcv = new Deconvolution(this, t, s[0], s[1]); - dcv->run(); - delete dcv; -} - -void ApplicationWindow::showColStatistics() -{ - Table *t = (Table*)activeWindow(TableWindow); - if (!t) - return; - - if (int(t->selectedColumns().count()) > 0) - { - QList targets; - for (int i=0; i < t->numCols(); i++) - if (t->isColumnSelected(i, true)) - targets << i; - newTableStatistics(t, TableStatistics::column, targets)->showNormal(); - } - else - QMessageBox::warning(this, tr("QtiPlot - Column selection error"), - tr("Please select a column first!")); -} - -void ApplicationWindow::showRowStatistics() -{ - Table *t = (Table*)activeWindow(TableWindow); - if (!t) - return; - - if (t->numSelectedRows() > 0){ - QList targets; - for (int i=0; i < t->numRows(); i++) - if (t->isRowSelected(i, true)) - targets << i; - newTableStatistics(t, TableStatistics::row, targets)->showNormal(); - } else - QMessageBox::warning(this, tr("QtiPlot - Row selection error"), - tr("Please select a row first!")); -} - -void ApplicationWindow::showColMenu(int c) -{ - Table *w = (Table*)activeWindow(TableWindow); - if (!w) - return; - - QMenu contextMenu(this); - QMenu plot(this); - QMenu specialPlot(this); - QMenu specialBarMenu(this); - QMenu fill(this); - QMenu sorting(this); - QMenu colType(this); - colType.setCheckable(true); - QMenu panels(this); - QMenu stat(this); - QMenu norm(this); - - if ((int)w->selectedColumns().count() == 1){ - w->setSelectedCol(c); - plot.addAction(actionPlotL); - plot.addAction(actionPlotP); - plot.addAction(actionPlotLP); - - specialPlot.addAction(actionPlotVerticalDropLines); - specialPlot.addAction(actionPlotSpline); - specialPlot.addAction(actionPlotVertSteps); - specialPlot.addAction(actionPlotHorSteps); - specialPlot.insertSeparator(); - specialPlot.addAction(actionAddZoomPlot); - specialPlot.setTitle(tr("Special Line/Symb&ol")); - plot.addMenu(&specialPlot); - plot.insertSeparator(); - plot.addAction(actionPlotVerticalBars); - plot.addAction(actionPlotHorizontalBars); - specialBarMenu.addAction(actionStackBars); - specialBarMenu.addAction(actionStackColumns); - specialBarMenu.setTitle(tr("Spec&ial Bar/Column")); - plot.addMenu (&specialBarMenu); - plot.addAction(actionPlotArea); - plot.addAction(actionPlotPie); - plot.insertSeparator(); - - plot.addAction(actionPlot3DRibbon); - plot.addAction(actionPlot3DBars); - plot.addAction(actionPlot3DScatter); - plot.addAction(actionPlot3DTrajectory); - - plot.insertSeparator(); - - stat.addAction(actionBoxPlot); - stat.addAction(actionPlotHistogram); - stat.addAction(actionPlotStackedHistograms); - stat.insertSeparator(); - stat.addAction(actionStemPlot); - stat.setTitle(tr("Statistical &Graphs")); - plot.addMenu(&stat); - - plot.setTitle(tr("&Plot")); - contextMenu.addMenu(&plot); - contextMenu.insertSeparator(); - - contextMenu.addAction(QIcon(QPixmap(cut_xpm)),tr("Cu&t"), w, SLOT(cutSelection())); - contextMenu.addAction(QIcon(QPixmap(copy_xpm)),tr("&Copy"), w, SLOT(copySelection())); - contextMenu.addAction(QIcon(QPixmap(paste_xpm)),tr("Past&e"), w, SLOT(pasteSelection())); - contextMenu.insertSeparator(); - - QAction * xColID=colType.addAction(QIcon(QPixmap(x_col_xpm)), tr("&X"), this, SLOT(setXCol())); - xColID->setCheckable(true); - QAction * yColID=colType.addAction(QIcon(QPixmap(y_col_xpm)), tr("&Y"), this, SLOT(setYCol())); - yColID->setCheckable(true); - QAction * zColID=colType.addAction(QIcon(QPixmap(z_col_xpm)), tr("&Z"), this, SLOT(setZCol())); - zColID->setCheckable(true); - colType.insertSeparator(); - QAction * labelID = colType.addAction(QIcon(QPixmap(set_label_col_xpm)), tr("&Label"), this, SLOT(setLabelCol())); - labelID->setCheckable(true); - QAction * noneID=colType.addAction(QIcon(QPixmap(disregard_col_xpm)), tr("&None"), this, SLOT(disregardCol())); - noneID->setCheckable(true); - colType.insertSeparator(); - QAction * xErrColID =colType.addAction(tr("X E&rror"), this, SLOT(setXErrCol())); - xErrColID->setCheckable(true); - QAction * yErrColID = colType.addAction(QIcon(QPixmap(errors_xpm)), tr("Y &Error"), this, SLOT(setYErrCol())); - yErrColID->setCheckable(true); - colType.insertSeparator(); - - - if (w->colPlotDesignation(c) == Table::X) - xColID->setChecked(true); - else if (w->colPlotDesignation(c) == Table::Y) - yColID->setChecked(true); - else if (w->colPlotDesignation(c) == Table::Z) - zColID->setChecked(true); - else if (w->colPlotDesignation(c) == Table::xErr) - xErrColID->setChecked(true); - else if (w->colPlotDesignation(c) == Table::yErr) - yErrColID->setChecked(true); - else if (w->colPlotDesignation(c) == Table::Label) - labelID->setChecked(true); - else - noneID->setChecked(true); - - actionReadOnlyCol->addTo(&colType); - actionReadOnlyCol->setCheckable(true); - actionReadOnlyCol->setChecked(w->isReadOnlyColumn(c)); - - colType.setTitle(tr("Set As")); - contextMenu.addMenu(&colType); - - if (w){ - contextMenu.insertSeparator(); - - contextMenu.addAction(actionShowColumnValuesDialog); - contextMenu.addAction(actionTableRecalculate); - fill.addAction(actionSetAscValues); - fill.addAction(actionSetRandomValues); - fill.setTitle(tr("&Fill Column With")); - contextMenu.addMenu(&fill); - - norm.addAction(tr("&Column"), w, SLOT(normalizeSelection())); - norm.addAction(actionNormalizeTable); - norm.setTitle(tr("&Normalize")); - contextMenu.addMenu(& norm); - - contextMenu.insertSeparator(); - contextMenu.addAction(actionFrequencyCount); - contextMenu.addAction(actionShowColStatistics); - - contextMenu.insertSeparator(); - - contextMenu.addAction(QIcon(QPixmap(erase_xpm)), tr("Clea&r"), w, SLOT(clearSelection())); - contextMenu.addAction(QIcon(QPixmap(delete_column_xpm)), tr("&Delete"), w, SLOT(removeCol())); - contextMenu.addAction(actionHideSelectedColumns); - contextMenu.addAction(actionShowAllColumns); - contextMenu.insertSeparator(); - contextMenu.addAction(QPixmap(insert_column_xpm), tr("&Insert"), w, SLOT(insertCol())); - contextMenu.addAction(actionAddColToTable); - contextMenu.insertSeparator(); - - sorting.addAction(QIcon(QPixmap(sort_ascending_xpm)), tr("&Ascending"), w, SLOT(sortColAsc())); - sorting.addAction(QIcon(QPixmap(sort_descending_xpm)), tr("&Descending"), w, SLOT(sortColDesc())); - sorting.setTitle(tr("Sort Colu&mn")); - contextMenu.addMenu(&sorting); - - contextMenu.addAction(actionSortTable); - } - contextMenu.insertSeparator(); - contextMenu.addAction(actionAdjustColumnWidth); - contextMenu.addAction(actionShowColumnOptionsDialog); - } else if ((int)w->selectedColumns().count() > 1){ - plot.addAction(actionPlotL); - plot.addAction(actionPlotP); - plot.addAction(actionPlotLP); - - specialPlot.addAction(actionPlotVerticalDropLines); - specialPlot.addAction(actionPlotSpline); - specialPlot.addAction(actionPlotVertSteps); - specialPlot.addAction(actionPlotHorSteps); - specialPlot.insertSeparator(); - specialPlot.addAction(actionPlotDoubleYAxis); - specialPlot.addAction(actionWaterfallPlot); - specialPlot.addAction(actionAddZoomPlot); - specialPlot.setTitle(tr("Special Line/Symb&ol")); - plot.addMenu(&specialPlot); - plot.insertSeparator(); - plot.addAction(actionPlotVerticalBars); - plot.addAction(actionPlotHorizontalBars); - - specialBarMenu.addAction(actionStackBars); - specialBarMenu.addAction(actionStackColumns); - specialBarMenu.setTitle(tr("Spec&ial Bar/Column")); - plot.addMenu (&specialBarMenu);; - - plot.addAction(actionPlotArea); - plot.addAction(actionPlotVectXYXY); - plot.addAction(actionPlotVectXYAM); - plot.insertSeparator(); - stat.addAction(actionBoxPlot); - stat.addAction(actionPlotHistogram); - stat.addAction(actionPlotStackedHistograms); - stat.insertSeparator(); - stat.addAction(actionStemPlot); - stat.setTitle(tr("Statistical &Graphs")); - plot.addMenu(&stat); - - panels.addAction(actionPlot2VerticalLayers); - panels.addAction(actionPlot2HorizontalLayers); - panels.addAction(actionPlot4Layers); - panels.addAction(actionPlotStackedLayers); - panels.setTitle(tr("Pa&nel")); - plot.addMenu(&panels); - - plot.setTitle(tr("&Plot")); - contextMenu.addMenu(&plot); - contextMenu.insertSeparator(); - contextMenu.addAction(QIcon(QPixmap(cut_xpm)),tr("Cu&t"), w, SLOT(cutSelection())); - contextMenu.addAction(QIcon(QPixmap(copy_xpm)),tr("&Copy"), w, SLOT(copySelection())); - contextMenu.addAction(QIcon(QPixmap(paste_xpm)),tr("Past&e"), w, SLOT(pasteSelection())); - contextMenu.insertSeparator(); - - if (w){ - contextMenu.addAction(QIcon(QPixmap(erase_xpm)),tr("Clea&r"), w, SLOT(clearSelection())); - contextMenu.addAction(QIcon(QPixmap(close_xpm)),tr("&Delete"), w, SLOT(removeCol())); - contextMenu.addAction(actionHideSelectedColumns); - contextMenu.addAction(actionShowAllColumns); - contextMenu.insertSeparator(); - contextMenu.addAction(tr("&Insert"), w, SLOT(insertCol())); - contextMenu.addAction(actionAddColToTable); - contextMenu.insertSeparator(); - } - - colType.addAction(actionSetXCol); - colType.addAction(actionSetYCol); - colType.addAction(actionSetZCol); - colType.insertSeparator(); - colType.addAction(actionSetLabelCol); - colType.addAction(actionDisregardCol); - colType.insertSeparator(); - colType.addAction(actionSetXErrCol); - colType.addAction(actionSetYErrCol); - colType.insertSeparator(); - colType.addAction(tr("&Read-only"), this, SLOT(setReadOnlyColumns())); - colType.addAction(tr("Read/&Write"), this, SLOT(setReadWriteColumns())); - colType.setTitle(tr("Set As")); - contextMenu.addMenu(&colType); - - if (w){ - contextMenu.insertSeparator(); - - fill.addAction(actionSetAscValues); - fill.addAction(actionSetRandomValues); - fill.setTitle(tr("&Fill Columns With")); - contextMenu.addMenu(&fill); - - norm.addAction(actionNormalizeSelection); - norm.addAction(actionNormalizeTable); - norm.setTitle(tr("&Normalize")); - contextMenu.addMenu(&norm); - - contextMenu.insertSeparator(); - contextMenu.addAction(actionSortSelection); - contextMenu.addAction(actionSortTable); - contextMenu.insertSeparator(); - contextMenu.addAction(actionShowColStatistics); - contextMenu.insertSeparator(); - contextMenu.addAction(actionAdjustColumnWidth); - } - } - - QPoint posMouse=QCursor::pos(); - contextMenu.exec(posMouse); -} - -void ApplicationWindow::plot2VerticalLayers() -{ - multilayerPlot(1, 2, defaultCurveStyle); -} - -void ApplicationWindow::plot2HorizontalLayers() -{ - multilayerPlot(2, 1, defaultCurveStyle); -} - -void ApplicationWindow::plot4Layers() -{ - multilayerPlot(2, 2, defaultCurveStyle); -} - -void ApplicationWindow::plotStackedLayers() -{ - multilayerPlot(1, -1, defaultCurveStyle); -} - -void ApplicationWindow::plotStackedHistograms() -{ - multilayerPlot(1, -1, Graph::Histogram); -} - -void ApplicationWindow::zoomRectanglePlot() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return; - - QStringList lst = t->selectedYColumns(); - int cols = lst.size(); - if (cols < 1){ - QMessageBox::critical(this, tr("QtiPlot - Error"), - tr("You need to select at least one Y column for this operation!")); - return; - } - - Q3TableSelection sel = t->getSelection(); - MultiLayer *ml = multilayerPlot(t, lst, Graph::LineSymbols, sel.topRow(), sel.bottomRow()); - if (ml){ - Graph *ag = ml->activeLayer(); - ag->setTitle(""); - ag->setAxisTitle(QwtPlot::xBottom, " "); - ag->setAxisTitle(QwtPlot::yLeft, " "); - ag->setCanvasFrame(); - ag->drawAxesBackbones(false); - ag->showGrid(); - ag->removeLegend(); - - RectangleWidget *r = new RectangleWidget(ag); - QColor c = Qt::yellow; - c.setAlpha(100); - r->setBackgroundColor(c); - r->setFrameColor(Qt::blue); - ag->add(r, false); - - Graph *g = ml->addLayer(); - if (!g) - return; - - setPreferences(g); - g->setTitle(""); - g->setAxisTitle(QwtPlot::xBottom, " "); - g->setAxisTitle(QwtPlot::yLeft, " "); - g->copyCurves(ag); - g->drawAxesBackbones(false); - g->setCanvasFrame(); - g->setCanvasBackground(c); - - ml->setRows(2); - ml->setCols(1); - ml->arrangeLayers(false); - - QRect canvasRect = ag->canvas()->geometry(); - r->setRect(canvasRect.x(), canvasRect.bottom() - 50, 100, 50); - - g->setCanvasCoordinates(r->boundingRect()); - r->setLinkedLayer(1); - } -} - -void ApplicationWindow::plotDoubleYAxis() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return; - - QStringList lst = t->selectedYColumns(); - int cols = lst.size(); - if (cols < 2){ - QMessageBox::critical(this, tr("QtiPlot - Error"), - tr("You need at least two columns for this operation!")); - return; - } - - Q3TableSelection sel = t->getSelection(); - MultiLayer *ml = multilayerPlot(t, lst, Graph::LineSymbols, sel.topRow(), sel.bottomRow()); - if (ml){ - Graph *g = ml->activeLayer(); - g->enableAxis(QwtPlot::yRight); - g->setAxisTitle(QwtPlot::yRight, tr("Y2 Axis Title")); - - QwtPlotCurve *c = g->curve(cols - 1); - if (c){ - c->setYAxis(QwtPlot::yRight); - g->setAutoScale(); - } - } -} - -void ApplicationWindow::showMatrixDialog() -{ - Matrix *m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return; - - MatrixDialog* md = new MatrixDialog(this); - md->setMatrix (m); - md->exec(); -} - -void ApplicationWindow::showMatrixSizeDialog() -{ - Matrix *m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return; - - MatrixSizeDialog* md = new MatrixSizeDialog(m, this); - md->exec(); -} - -void ApplicationWindow::showMatrixValuesDialog() -{ - Matrix *m = NULL; - MultiLayer *ml = (MultiLayer*)activeWindow(MultiLayerWindow); - if (ml){ - int curveIndex = actionSetMatrixValues->data().toInt(); - Graph *g = ml->activeLayer(); - if (g){ - Spectrogram *sp = (Spectrogram *)g->plotItem(curveIndex); - if (sp) - m = sp->matrix(); - } - } else - m = (Matrix*)activeWindow(MatrixWindow); - - if (!m) - return; - - MatrixValuesDialog* md = new MatrixValuesDialog(scriptEnv, this); - md->setMatrix(m); - if (d_completion) - md->setCompleter(d_completer); - md->exec(); -} - -void ApplicationWindow::showColumnOptionsDialog() -{ - Table *t = (Table*)activeWindow(TableWindow); - if (!t) - return; - - if(t->selectedColumns().count()>0) { - TableDialog* td = new TableDialog(t, this); - td->setAttribute(Qt::WA_DeleteOnClose); - td->exec(); - } else - QMessageBox::warning(this, tr("QtiPlot"), tr("Please select a column first!")); -} - -void ApplicationWindow::showGeneralPlotDialog() -{ - MdiSubWindow* plot = activeWindow(); - if (!plot) - return; - - if (plot->isA("MultiLayer") && ((MultiLayer*)plot)->numLayers()) - showPlotDialog(); - else if (plot->isA("Graph3D")){ - QDialog* gd = showScaleDialog(); - ((Plot3DDialog*)gd)->showGeneralTab(); - } -} - -void ApplicationWindow::showAxisDialog() -{ - MdiSubWindow* plot = activeWindow(); - if (!plot) - return; - - QDialog* gd = showScaleDialog(); - if (gd && plot->isA("MultiLayer") && ((MultiLayer*)plot)->numLayers()) - ((AxesDialog*)gd)->showAxesPage(); - else if (gd && plot->isA("Graph3D")) - ((Plot3DDialog*)gd)->showAxisTab(); -} - -void ApplicationWindow::showGridDialog() -{ - AxesDialog* gd = (AxesDialog*)showScaleDialog(); - if (gd) - gd->showGridPage(); -} - -QDialog* ApplicationWindow::showScaleDialog() -{ - MdiSubWindow *w = activeWindow(); - if (!w) - return 0; - - if (w->isA("MultiLayer")){ - if (((MultiLayer*)w)->isEmpty()) - return 0; - - Graph* g = ((MultiLayer*)w)->activeLayer(); - if (g->isPiePlot()){ - QMessageBox::warning(this, tr("QtiPlot - Warning"), tr("This functionality is not available for pie plots!")); - return 0; - } - - AxesDialog* ad = new AxesDialog(this); - ad->setGraph(g); - ad->exec(); - return ad; - } else if (w->isA("Graph3D")) - return showPlot3dDialog(); - - return 0; -} - -AxesDialog* ApplicationWindow::showScalePageFromAxisDialog(int axisPos) -{ - AxesDialog* gd = (AxesDialog*)showScaleDialog(); - if (gd) - gd->setCurrentScale(axisPos); - - return gd; -} - -AxesDialog* ApplicationWindow::showAxisPageFromAxisDialog(int axisPos) -{ - AxesDialog* gd = (AxesDialog*)showScaleDialog(); - if (gd){ - gd->showAxesPage(); - gd->setCurrentScale(axisPos); - } - return gd; -} - -QDialog* ApplicationWindow::showPlot3dDialog() -{ - Graph3D *g = (Graph3D*)activeWindow(Plot3DWindow); - if (!g) - return 0; - - if (!g->hasData()){ - QApplication::restoreOverrideCursor(); - QMessageBox::warning(this, tr("QtiPlot - Warning"), - tr("Not available for empty 3D surface plots!")); - return 0; - } - - Plot3DDialog* pd = new Plot3DDialog(this); - pd->setPlot(g); - pd->show(); - return pd; -} - -void ApplicationWindow::showPlotDialog(int curveIndex) -{ - MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!w) - return; - - PlotDialog* pd = new PlotDialog(d_extended_plot_dialog, this); - pd->insertColumnsList(columnsList(Table::All)); - pd->setMultiLayer(w); - if (curveIndex >= 0){ - Graph *g = w->activeLayer(); - if (g) - pd->selectCurve(curveIndex); - } - pd->initFonts(plotTitleFont, plotAxesFont, plotNumbersFont, plotLegendFont); - pd->showAll(d_extended_plot_dialog); - pd->show(); - -} - -void ApplicationWindow::showCurvePlotDialog() -{ - showPlotDialog(actionShowCurvePlotDialog->data().toInt()); -} - -void ApplicationWindow::showCurveContextMenu(QwtPlotItem *cv) -{ - if (!cv || !cv->isVisible()) - return; - - MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!w) - return; - - Graph *g = w->activeLayer(); - if (!g) - return; - - int curveIndex = g->curveIndex(cv); - if (curveIndex < 0 || curveIndex >= g->curveCount()) - return; - - QMenu curveMenu(this); - curveMenu.addAction(cv->title().text(), this, SLOT(showCurvePlotDialog())); - curveMenu.insertSeparator(); - - curveMenu.addAction(actionHideCurve); - actionHideCurve->setData(curveIndex); - - int type = ((PlotCurve *)cv)->type(); - bool spectrogram = (cv->rtti() == QwtPlotItem::Rtti_PlotSpectrogram) ? true : false; - if (g->visibleCurves() > 1 && (type == Graph::Function || spectrogram)){ - curveMenu.addAction(actionHideOtherCurves); - actionHideOtherCurves->setData(curveIndex); - } else if (type != Graph::Function && !spectrogram) { - if ((g->visibleCurves() - ((DataCurve *)cv)->errorBarsList().count()) > 1) { - curveMenu.addAction(actionHideOtherCurves); - actionHideOtherCurves->setData(curveIndex); - } - } - - if (g->visibleCurves() != g->curveCount()) - curveMenu.addAction(actionShowAllCurves); - curveMenu.insertSeparator(); - - if (g->rangeSelectorsEnabled() || (g->activeTool() && - g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker)) - curveMenu.addAction(actionCopySelection); - - if (spectrogram){ - curveMenu.insertSeparator(); - curveMenu.addAction(actionSetMatrixValues); - actionSetMatrixValues->setData(curveIndex); - } else { - if (type == Graph::Function){ - curveMenu.insertSeparator(); - curveMenu.addAction(actionEditFunction); - actionEditFunction->setData(curveIndex); - } else if (type != Graph::ErrorBars){ - if (g->rangeSelectorsEnabled() || (g->activeTool() && - g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker)){ - curveMenu.addAction(actionCutSelection); - curveMenu.addAction(actionPasteSelection); - curveMenu.addAction(actionClearSelection); - curveMenu.insertSeparator(); - if (g->rangeSelectorsEnabled()){ - QAction *act = new QAction(tr("Set Display Range"), this); - connect(act, SIGNAL(activated()), g->rangeSelectorTool(), SLOT(setCurveRange())); - curveMenu.addAction(act); - } - } - - curveMenu.addAction(actionEditCurveRange); - actionEditCurveRange->setData(curveIndex); - - curveMenu.addAction(actionCurveFullRange); - if (((DataCurve *)cv)->isFullRange()) - actionCurveFullRange->setDisabled(true); - else - actionCurveFullRange->setEnabled(true); - actionCurveFullRange->setData(curveIndex); - - curveMenu.insertSeparator(); - } - } - - curveMenu.addAction(actionShowCurveWorksheet); - actionShowCurveWorksheet->setData(curveIndex); - - curveMenu.addAction(actionShowCurvePlotDialog); - actionShowCurvePlotDialog->setData(curveIndex); - - curveMenu.insertSeparator(); - - curveMenu.addAction(actionRemoveCurve); - actionRemoveCurve->setData(curveIndex); - curveMenu.exec(QCursor::pos()); -} - -void ApplicationWindow::showAllCurves() -{ - MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!w) - return; - - Graph* g = w->activeLayer(); - if (!g) - return; - - for(int i=0; i< g->curveCount(); i++) - g->showCurve(i); - g->replot(); -} - -void ApplicationWindow::hideOtherCurves() -{ - MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!w) - return; - - Graph* g = w->activeLayer(); - if (!g) - return; - - for(int i=0; i< g->curveCount(); i++) - g->showCurve(i, false); - - g->showCurve(actionHideOtherCurves->data().toInt()); - g->replot(); -} - -void ApplicationWindow::hideCurve() -{ - MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!w) - return; - - Graph* g = w->activeLayer(); - if (!g) - return; - - g->showCurve(actionHideCurve->data().toInt(), false); -} - -void ApplicationWindow::removeCurve() -{ - MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!w) - return; - - Graph* g = w->activeLayer(); - if (!g) - return; - - g->removeCurve(actionRemoveCurve->data().toInt()); - g->updatePlot(); -} - -void ApplicationWindow::showCurveWorksheet(Graph *g, int curveIndex) -{ - if (!g) - return; - - const QwtPlotItem *it = g->plotItem(curveIndex); - if (!it) - return; - - if (it->rtti() == QwtPlotItem::Rtti_PlotSpectrogram){ - Spectrogram *sp = (Spectrogram *)it; - if (sp->matrix()) - sp->matrix()->showMaximized(); - } else if (((PlotCurve *)it)->type() == Graph::Function) - g->createTable((PlotCurve *)it); - else { - showTable(it->title().text()); - if (g->activeTool() && g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker) - ((DataPickerTool *)g->activeTool())->selectTableRow(); - } -} - -void ApplicationWindow::showCurveWorksheet() -{ - MultiLayer *w = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!w) - return; - - Graph* g = w->activeLayer(); - if (!g) - return; - - showCurveWorksheet(g, actionShowCurveWorksheet->data().toInt()); -} - -void ApplicationWindow::magnify() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - if (plot->isEmpty()){ - QMessageBox::warning(this, tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

" - "

Please add a layer and try again!

")); - btnPointer->setOn(true); - return; - } - - QList layers = plot->layersList(); - foreach(Graph *g, layers) - g->enablePanningMagnifier(); -} - -void ApplicationWindow::zoomIn() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - if (plot->isEmpty()) - { - QMessageBox::warning(this, tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

" - "

Please add a layer and try again!

")); - btnPointer->setOn(true); - return; - } - - if ((Graph*)plot->activeLayer()->isPiePlot()) - { - if (btnZoomIn->isOn()) - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("This functionality is not available for pie plots!")); - btnPointer->setOn(true); - return; - } - - QList layers = plot->layersList(); - foreach(Graph *g, layers){ - if (!g->isPiePlot()) - g->zoom(true); - } -} - -void ApplicationWindow::zoomOut() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - if (plot->isEmpty() || (Graph*)plot->activeLayer()->isPiePlot()) - return; - - ((Graph*)plot->activeLayer())->zoomOut(); - btnPointer->setOn(true); -} - -void ApplicationWindow::setAutoScale() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - if (plot->isEmpty()){ - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

")); - return; - } - - Graph *g = (Graph*)plot->activeLayer(); - if (g) - g->setAutoScale(); -} - -void ApplicationWindow::removePoints() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - if (plot->isEmpty()) - { - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

" - "

Please add a layer and try again!

")); - btnPointer->setChecked(true); - return; - } - - Graph* g = (Graph*)plot->activeLayer(); - if (!g || !g->validCurvesDataSize()) - { - btnPointer->setChecked(true); - return; - } - - if (g->isPiePlot()) - { - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("This functionality is not available for pie plots!")); - btnPointer->setChecked(true); - return; - } - else - { - switch(QMessageBox::warning (this,tr("QtiPlot"), - tr("This will modify the data in the worksheets!\nAre you sure you want to continue?"), - tr("Continue"),tr("Cancel"),0,1)) - { - case 0: - g->setActiveTool(new DataPickerTool(g, this, DataPickerTool::Remove, info, SLOT(setText(const QString&)))); - displayBar->show(); - break; - - case 1: - btnPointer->setChecked(true); - break; - } - } -} - -void ApplicationWindow::movePoints(bool wholeCurve) -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - if (plot->isEmpty()){ - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

" - "

Please add a layer and try again!

")); - btnPointer->setChecked(true); - return; - } - - Graph* g = (Graph*)plot->activeLayer(); - if (!g || !g->validCurvesDataSize()){ - btnPointer->setChecked(true); - return; - } - - if (g->isPiePlot()){ - QMessageBox::warning(this, tr("QtiPlot - Warning"), - tr("This functionality is not available for pie plots!")); - - btnPointer->setChecked(true); - return; - } else { - switch(QMessageBox::warning (this, tr("QtiPlot"), - tr("This will modify the data in the worksheets!\nAre you sure you want to continue?"), - tr("Continue"), tr("Cancel"), 0, 1)) - { - case 0: - if (g){ - DataPickerTool *tool = new DataPickerTool(g, this, DataPickerTool::Move, info, SLOT(setText(const QString&))); - if (wholeCurve) - tool->setMode(DataPickerTool::MoveCurve); - g->setActiveTool(tool); - displayBar->show(); - } - break; - - case 1: - btnPointer->setChecked(true); - break; - } - } -} - -void ApplicationWindow::exportPDF() -{ - MdiSubWindow *w = activeWindow(); - if (!w) - return; - - if(qobject_cast(w) && ((MultiLayer *)w)->isEmpty()){ - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

")); - return; - } - - if (qobject_cast(w) || qobject_cast(w)){ - exportGraph("*.pdf"); - return; - } else if (qobject_cast(w)){ - exportMatrix("*.pdf"); - return; - } - - QString fname = getFileName(this, tr("Choose a filename to save under"), - imagesDirPath + "/" + w->objectName(), "*.pdf"); - if (!fname.isEmpty() ){ - QFileInfo fi(fname); - QString baseName = fi.fileName(); - if (!baseName.contains(".")) - fname.append(".pdf"); - - imagesDirPath = fi.dirPath(true); - - QFile f(fname); - if (!f.open(QIODevice::WriteOnly)){ - QMessageBox::critical(this, tr("QtiPlot - Export error"), - tr("Could not write to file:

%1

Please verify that you have the right to write to this location or that the file is not being used by another application!").arg(fname)); - return; - } - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - w->exportPDF(fname); - QApplication::restoreOverrideCursor(); - } -} - -//print active window -void ApplicationWindow::print() -{ - MdiSubWindow* w = activeWindow(); - if (!w) - return; - - if (w->isA("MultiLayer") && ((MultiLayer *)w)->isEmpty()){ - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

")); - return; - } - w->print(); -} - -//print preview for active window -void ApplicationWindow::printPreview() -{ - MdiSubWindow* w = activeWindow(); - if (!w) - return; - - if (w->isA("MultiLayer") && ((MultiLayer *)w)->isEmpty()){ - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

")); - return; - } - QPrintPreviewDialog *preview = new QPrintPreviewDialog(this); - preview->setWindowTitle(tr("QtiPlot") + " - " + tr("Print preview of window: ") + w->objectName()); - connect(preview, SIGNAL(paintRequested(QPrinter *)), w, SLOT(print(QPrinter *))); - preview->exec(); -} - -void ApplicationWindow::printAllPlots() -{ - QPrinter printer; - printer.setOrientation(QPrinter::Landscape); - printer.setColorMode (QPrinter::Color); - printer.setFullPage(true); - - if (printer.setup()) - { - QPainter *paint = new QPainter (&printer); - - int plots = 0; - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - if (w->isA("MultiLayer")) - plots++; - } - - printer.setMinMax (0, plots); - printer.setFromTo (0, plots); - - foreach(MdiSubWindow *w, windows){ - if (w->isA("MultiLayer") && printer.newPage()) - ((MultiLayer*)w)->printAllLayers(paint); - } - paint->end(); - delete paint; - } -} - -void ApplicationWindow::showExpGrowthDialog() -{ - showExpDecayDialog(-1); -} - -void ApplicationWindow::showExpDecayDialog() -{ - showExpDecayDialog(1); -} - -void ApplicationWindow::showExpDecayDialog(int type) -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph* g = plot->activeLayer(); - if (!g || !g->validCurvesDataSize()) - return; - - ExpDecayDialog *edd = new ExpDecayDialog(type, this); - edd->setAttribute(Qt::WA_DeleteOnClose); - connect (g, SIGNAL(destroyed()), edd, SLOT(close())); - - edd->setGraph(g); - edd->show(); -} - -void ApplicationWindow::showTwoExpDecayDialog() -{ - showExpDecayDialog(2); -} - -void ApplicationWindow::showExpDecay3Dialog() -{ - showExpDecayDialog(3); -} - -void ApplicationWindow::showFitDialog() -{ - MdiSubWindow *w = activeWindow(); - if (!w) - return; - - MultiLayer* plot = 0; - if(w->isA("MultiLayer")) - plot = (MultiLayer*)w; - else if(w->inherits("Table")){ - QStringList columnsLst = ((Table *)w)->drawableColumnSelection(); - if (columnsLst.isEmpty()){ - QMessageBox::warning(this, tr("QtiPlot - Column selection error"), - tr("Please select a 'Y' column first!")); - return; - } - plot = multilayerPlot((Table *)w, columnsLst, Graph::LineSymbols); - } - - if (!plot) - return; - - Graph* g = (Graph*)plot->activeLayer(); - if (!g || !g->validCurvesDataSize()) - return; - - FitDialog *fd = new FitDialog(g, this); - connect (plot, SIGNAL(destroyed()), fd, SLOT(close())); - - fd->setSrcTables(tableList()); - fd->show(); - fd->resize(fd->minimumSize()); -} - -void ApplicationWindow::showFilterDialog(int filter) -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph* g = plot->activeLayer(); - if ( g && g->validCurvesDataSize()) - { - FilterDialog *fd = new FilterDialog(filter, this); - fd->setAttribute(Qt::WA_DeleteOnClose); - fd->setGraph(g); - fd->exec(); - } -} - -void ApplicationWindow::lowPassFilterDialog() -{ - showFilterDialog(FFTFilter::LowPass); -} - -void ApplicationWindow::highPassFilterDialog() -{ - showFilterDialog(FFTFilter::HighPass); -} - -void ApplicationWindow::bandPassFilterDialog() -{ - showFilterDialog(FFTFilter::BandPass); -} - -void ApplicationWindow::bandBlockFilterDialog() -{ - showFilterDialog(FFTFilter::BandBlock); -} - -void ApplicationWindow::showFFTDialog() -{ - MdiSubWindow *w = activeWindow(); - if (!w) - return; - - FFTDialog *sd = 0; - if (w->isA("MultiLayer")) { - Graph* g = ((MultiLayer*)w)->activeLayer(); - if ( g && g->validCurvesDataSize() ){ - sd = new FFTDialog(FFTDialog::onGraph, this); - sd->setAttribute(Qt::WA_DeleteOnClose); - sd->setGraph(g); - } - } else if (w->inherits("Table")) { - sd = new FFTDialog(FFTDialog::onTable, this); - sd->setAttribute(Qt::WA_DeleteOnClose); - sd->setTable((Table*)w); - } else if (w->inherits("Matrix")) { - sd = new FFTDialog(FFTDialog::onMatrix, this); - sd->setAttribute(Qt::WA_DeleteOnClose); - sd->setMatrix((Matrix*)w); - } - - if (sd) - sd->exec(); -} - -void ApplicationWindow::showSmoothDialog(int m) -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph* g = plot->activeLayer(); - if (!g || !g->validCurvesDataSize()) - return; - - SmoothCurveDialog *sd = new SmoothCurveDialog(m, this); - sd->setAttribute(Qt::WA_DeleteOnClose); - sd->setGraph(g); - sd->exec(); -} - -void ApplicationWindow::showSmoothSavGolDialog() -{ - showSmoothDialog(SmoothFilter::SavitzkyGolay); -} - -void ApplicationWindow::showSmoothFFTDialog() -{ - showSmoothDialog(SmoothFilter::FFT); -} - -void ApplicationWindow::showSmoothAverageDialog() -{ - showSmoothDialog(SmoothFilter::Average); -} - -void ApplicationWindow::showSmoothLowessDialog() -{ - showSmoothDialog(SmoothFilter::Lowess); -} - -void ApplicationWindow::showInterpolationDialog() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph* g = plot->activeLayer(); - if (!g || !g->validCurvesDataSize()) - return; - - InterpolationDialog *id = new InterpolationDialog(this); - connect (g, SIGNAL(destroyed()), id, SLOT(close())); - id->setGraph(g); - id->show(); -} - -void ApplicationWindow::showFitPolynomDialog() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph* g = plot->activeLayer(); - if (!g || !g->validCurvesDataSize()) - return; - - PolynomFitDialog *pfd = new PolynomFitDialog(this); - connect(g, SIGNAL(destroyed()), pfd, SLOT(close())); - pfd->setGraph(g); - pfd->show(); -} - -void ApplicationWindow::updateLog(const QString& result) -{ - if ( !result.isEmpty() ){ - current_folder->appendLogInfo(result); - showResults(true); - emit modified(); - } -} - -void ApplicationWindow::showIntegrationDialog() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph* g = plot->activeLayer(); - if (!g) - return; - - IntDialog *id = new IntDialog(this, g); - id->exec(); -} - -void ApplicationWindow::showResults(bool ok) -{ - if (ok){ - if (!current_folder->logInfo().isEmpty()) - results->setText(current_folder->logInfo()); - else - results->setText(tr("Sorry, there are no results to display!")); - - logWindow->show(); - QTextCursor cur = results->textCursor(); - cur.movePosition(QTextCursor::End); - results->setTextCursor(cur); - } else - logWindow->hide(); -} - -void ApplicationWindow::showResults(const QString& s, bool ok) -{ - current_folder->appendLogInfo(s); - - QString logInfo = current_folder->logInfo(); - if (!logInfo.isEmpty()) - results->setText(logInfo); - showResults(ok); -} - -void ApplicationWindow::showScreenReader() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - if (plot->isEmpty()){ - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

" - "

Please add a layer and try again!

")); - btnPointer->setChecked(true); - return; - } - - QList layers = plot->layersList(); - foreach(Graph *g, layers) - g->setActiveTool(new ScreenPickerTool(g, info, SLOT(setText(const QString&)))); - - displayBar->show(); -} - -void ApplicationWindow::drawPoints() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - if (plot->isEmpty()){ - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

" - "

Please add a layer and try again!

")); - btnPointer->setChecked(true); - return; - } - - QList layers = plot->layersList(); - foreach(Graph *g, layers) - g->setActiveTool(new DrawPointTool(this, g, info, SLOT(setText(const QString&)))); - - displayBar->show(); -} - -void ApplicationWindow::showRangeSelectors() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - if (plot->isEmpty()){ - QMessageBox::warning(this, tr("QtiPlot - Warning"), tr("There are no plot layers available in this window!")); - btnPointer->setChecked(true); - return; - } - - Graph* g = (Graph*)plot->activeLayer(); - if (!g) - return; - - if (!g->curveCount()){ - QMessageBox::warning(this, tr("QtiPlot - Warning"), tr("There are no curves available on this plot!")); - btnPointer->setChecked(true); - return; - } else if (g->isPiePlot()) { - QMessageBox::warning(this, tr("QtiPlot - Warning"), tr("This functionality is not available for pie plots!")); - btnPointer->setChecked(true); - return; - } - - displayBar->show(); - g->enableRangeSelectors(info, SLOT(setText(const QString&))); -} - -void ApplicationWindow::showCursor() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - if (plot->isEmpty()){ - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

" - "

Please add a layer and try again!

")); - btnPointer->setChecked(true); - return; - } - - if ((Graph*)plot->activeLayer()->isPiePlot()){ - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("This functionality is not available for pie plots!")); - btnPointer->setChecked(true); - return; - } - - QList layers = plot->layersList(); - foreach(Graph *g, layers){ - if (g->isPiePlot() || !g->curveCount()) - continue; - if (g->validCurvesDataSize()) - g->setActiveTool(new DataPickerTool(g, this, DataPickerTool::Display, info, SLOT(setText(const QString&)))); - } - displayBar->show(); -} - -void ApplicationWindow::newLegend() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - if (plot->isEmpty()){ - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

" - "

Please add a layer and try again!

")); - return; - } - - Graph* g = (Graph*)plot->activeLayer(); - if ( g ) - g->newLegend(); -} - -void ApplicationWindow::addTimeStamp() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - if (plot->isEmpty()) - { - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

" - "

Please add a layer and try again!

")); - return; - } - - Graph* g = (Graph*)plot->activeLayer(); - if ( g ) - g->addTimeStamp(); -} - -void ApplicationWindow::addRectangle() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph *g = (Graph*)plot->activeLayer(); - if (!g){ - QMessageBox::critical(this, tr("QtiPlot - Error"), - tr("There are no layers available on this plot. Operation aborted!")); - return; - } - - g->setActiveTool(new AddWidgetTool(AddWidgetTool::Rectangle, g, actionAddRectangle, info, SLOT(setText(const QString&)))); - btnPointer->setOn(false); -} - -void ApplicationWindow::addEllipse() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph *g = (Graph*)plot->activeLayer(); - if (!g){ - QMessageBox::critical(this, tr("QtiPlot - Error"), - tr("There are no layers available on this plot. Operation aborted!")); - return; - } - - g->setActiveTool(new AddWidgetTool(AddWidgetTool::Ellipse, g, actionAddEllipse, info, SLOT(setText(const QString&)))); - btnPointer->setOn(false); -} - -void ApplicationWindow::addTexFormula() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph *g = (Graph*)plot->activeLayer(); - if (!g){ - QMessageBox::critical(this, tr("QtiPlot - Error"), - tr("There are no layers available on this plot. Operation aborted!")); - return; - } - - g->setActiveTool(new AddWidgetTool(AddWidgetTool::TexEquation, g, actionAddFormula, info, SLOT(setText(const QString&)))); - btnPointer->setOn(false); -} - -void ApplicationWindow::addText() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - Graph *g = (Graph*)plot->activeLayer(); - if (g){ - g->setActiveTool(new AddWidgetTool(AddWidgetTool::Text, g, actionAddText, info, SLOT(setText(const QString&)))); - btnPointer->setOn(false); - } -} - -void ApplicationWindow::addImage() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - if (plot->isEmpty()){ - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

" - "

Please add a layer and try again!

")); - return; - } - - Graph* g = (Graph*)plot->activeLayer(); - if (!g) - return; - - QString fn = getFileName(this, tr("QtiPlot - Insert image from file"), imagesDirPath, imageFilter(), 0, false); - if ( !fn.isEmpty() ){ - QFileInfo fi(fn); - imagesDirPath = fi.dirPath(true); - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - g->addImage(fn); - QApplication::restoreOverrideCursor(); - } -} - -void ApplicationWindow::drawLine() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - if (plot->isEmpty()) - { - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

" - "

Please add a layer and try again!

")); - - btnPointer->setChecked(true); - return; - } - - Graph* g = (Graph*)plot->activeLayer(); - if (g) - { - g->drawLine(true); - emit modified(); - } -} - -void ApplicationWindow::drawArrow() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - if (plot->isEmpty()) - { - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

" - "

Please add a layer and try again!

")); - - btnPointer->setOn(true); - return; - } - - Graph* g = (Graph*)plot->activeLayer(); - if (g){ - g->drawLine(true, 1); - emit modified(); - } -} - -void ApplicationWindow::showLayerDialog() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - if(plot->isEmpty()) - { - QMessageBox::warning(this, tr("QtiPlot - Warning"), - tr("There are no plot layers available in this window.")); - return; - } - - LayerDialog *id=new LayerDialog(this); - id->setAttribute(Qt::WA_DeleteOnClose); - id->setMultiLayer(plot); - id->exec(); -} - -void ApplicationWindow::showEnrichementDialog() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph* g = plot->activeLayer(); - if (!g) - return; - - EnrichmentDialog::WidgetType wt = EnrichmentDialog::Frame; - LegendWidget *l = (LegendWidget *)g->activeText(); - if (l) - wt = EnrichmentDialog::Text; - else if (qobject_cast(g->activeEnrichment())) - wt = EnrichmentDialog::Image; - else if (qobject_cast(g->activeEnrichment())) - wt = EnrichmentDialog::Tex; - else if (qobject_cast(g->activeEnrichment())) - wt = EnrichmentDialog::Ellipse; - - EnrichmentDialog *ed = new EnrichmentDialog(wt, g, this); - ed->setWidget(g->activeEnrichment()); - ed->exec(); - - g->deselectMarker(); -} - -void ApplicationWindow::showLineDialog() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph* g = plot->activeLayer(); - if (g){ - ArrowMarker *lm = (ArrowMarker *) g->selectedMarker(); - if (!lm) - return; - - LineDialog *ld = new LineDialog(lm, this); - ld->exec(); - - g->deselectMarker(); - } -} - -void ApplicationWindow::addColToTable() -{ - Table* m = (Table*)activeWindow(TableWindow); - if ( m ) - m->addCol(); -} - -void ApplicationWindow::clearSelection() -{ - if(lv->hasFocus()){ - deleteSelectedItems(); - return; - } - - MdiSubWindow* m = activeWindow(); - if (!m) - return; - - if (m->inherits("Table")) - ((Table*)m)->clearSelection(); - else if (m->isA("Matrix")) - ((Matrix*)m)->clearSelection(); - else if (m->isA("MultiLayer")){ - Graph* g = ((MultiLayer*)m)->activeLayer(); - if (!g) - return; - - if (((MultiLayer*)m)->hasSelectedLayers()){ - ((MultiLayer*)m)->confirmRemoveLayer(); - emit modified(); - return; - } - - if (g->rangeSelectorsEnabled()) - g->rangeSelectorTool()->clearSelection(); - else if (g->activeTool() && g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker) - ((DataPickerTool *)g->activeTool())->removePoint(); - else if (g->titleSelected()) - g->clearTitle(); - else if (g->axisTitleSelected()){ - QwtScaleWidget *axis = g->currentScale(); - if (axis) - axis->setTitle(" "); - } else - g->removeMarker(); - } - else if (m->isA("Note")) - ((Note*)m)->currentEditor()->textCursor().removeSelectedText(); - emit modified(); -} - -void ApplicationWindow::copySelection() -{ - if(results->hasFocus()){ - results->copy(); - return; - } else if(info->hasFocus()) { - info->copy(); - return; - } - - MdiSubWindow* m = activeWindow(); - if (!m) - return; - - if (m->inherits("Table")) - ((Table*)m)->copySelection(); - else if (m->isA("Matrix")) - ((Matrix*)m)->copySelection(); - else if (m->isA("MultiLayer")){ - MultiLayer* plot = (MultiLayer*)m; - if (!plot || plot->numLayers() == 0) - return; - - Graph* g = (Graph*)plot->activeLayer(); - if (!g) - return; - - if (g->rangeSelectorsEnabled()) - g->rangeSelectorTool()->copySelection(); - else if (g->activeTool() && g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker) - ((DataPickerTool *)g->activeTool())->copySelection(); - else if (g->markerSelected()) - copyMarker(); - else - copyActiveLayer(); - } else if (m->isA("Note")) - ((Note*)m)->currentEditor()->copy(); -} - -void ApplicationWindow::cutSelection() -{ - MdiSubWindow* m = activeWindow(); - if (!m) - return; - - if (m->inherits("Table")) - ((Table*)m)->cutSelection(); - else if (m->isA("Matrix")) - ((Matrix*)m)->cutSelection(); - else if(m->isA("MultiLayer")){ - MultiLayer* plot = (MultiLayer*)m; - if (!plot || plot->numLayers() == 0) - return; - - Graph* g = (Graph*)plot->activeLayer(); - if (!g) - return; - - if (g->rangeSelectorsEnabled()) - g->rangeSelectorTool()->cutSelection(); - else if (g->activeTool() && g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker) - ((DataPickerTool *)g->activeTool())->cutSelection(); - else { - copyMarker(); - g->removeMarker(); - } - } else if (m->isA("Note")) - ((Note*)m)->currentEditor()->cut(); - - emit modified(); -} - -void ApplicationWindow::copyMarker() -{ - lastCopiedLayer = NULL; - - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph* g = plot->activeLayer(); - if (g && g->markerSelected()){ - d_enrichement_copy = NULL; - d_arrow_copy = NULL; - if (g->activeEnrichment()) - d_enrichement_copy = g->activeEnrichment(); - else if (g->arrowMarkerSelected()) - d_arrow_copy = (ArrowMarker *) g->selectedMarker(); - } -} - -void ApplicationWindow::pasteSelection() -{ - MdiSubWindow* m = activeWindow(); - if (!m) - return; - - if (m->inherits("Table")) - ((Table*)m)->pasteSelection(); - else if (m->isA("Matrix")) - ((Matrix*)m)->pasteSelection(); - else if (m->isA("Note")) - ((Note*)m)->currentEditor()->paste(); - else if (m->isA("MultiLayer")){ - MultiLayer* plot = (MultiLayer*)m; - if (!plot) - return; - - if (lastCopiedLayer){ - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - Graph* g = plot->addLayer(); - g->copy(lastCopiedLayer); - QPoint pos = plot->mapFromGlobal(QCursor::pos()); - plot->setGraphGeometry(pos.x(), pos.y()-20, lastCopiedLayer->width(), lastCopiedLayer->height()); - - QApplication::restoreOverrideCursor(); - } else { - if (plot->numLayers() == 0) - return; - - Graph* g = (Graph*)plot->activeLayer(); - if (!g) - return; - - if (g->rangeSelectorsEnabled()) - g->rangeSelectorTool()->pasteSelection(); - else if (g->activeTool() && g->activeTool()->rtti() == PlotToolInterface::Rtti_DataPicker) - ((DataPickerTool *)g->activeTool())->pasteSelection(); - else if (d_enrichement_copy){ - FrameWidget *t = g->add(d_enrichement_copy); - QPoint pos = g->mapFromGlobal(QCursor::pos()); - if (g->geometry().contains(pos)) - t->move(pos); - else - t->move(g->pos()); - } else if (d_arrow_copy){ - ArrowMarker *a = g->addArrow(d_arrow_copy); - a->setStartPoint(d_arrow_copy->startPointCoord().x(), d_arrow_copy->startPointCoord().y()); - a->setEndPoint(d_arrow_copy->endPointCoord().x(), d_arrow_copy->endPointCoord().y()); - //translate the new arrow 10 pixels to the right; - a->setStartPoint(a->startPoint() + QPoint(10, 0)); - a->setEndPoint(a->endPoint() + QPoint(10, 0)); - g->replot(); - g->deselectMarker(); - } - } - } - emit modified(); -} - -MdiSubWindow* ApplicationWindow::clone(MdiSubWindow* w) -{ - if (!w) { - w = activeWindow(); - if (!w){ - QMessageBox::critical(this,tr("QtiPlot - Duplicate window error"), - tr("There are no windows available in this folder!")); - return 0; - } - } - - MdiSubWindow* nw = 0; - MdiSubWindow::Status status = w->status(); - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - if (w->isA("MultiLayer")){ - MultiLayer *g = (MultiLayer *)w; - nw = multilayerPlot(generateUniqueName(tr("Graph")), 0, g->getRows(), g->getCols()); - ((MultiLayer *)nw)->copy(g); - } else if (w->inherits("Table")){ - Table *t = (Table *)w; - QString caption = generateUniqueName(tr("Table")); - nw = newTable(caption, t->numRows(), t->numCols()); - ((Table *)nw)->copy(t); - } else if (w->isA("Graph3D")){ - Graph3D *g = (Graph3D *)w; - if (!g->hasData()){ - QApplication::restoreOverrideCursor(); - QMessageBox::warning(this, tr("QtiPlot - Duplicate error"), tr("Empty 3D surface plots cannot be duplicated!")); - return 0; - } - nw = newPlot3D(); - if (!nw) - return 0; - if (status == MdiSubWindow::Maximized) - nw->hide(); - ((Graph3D *)nw)->copy(g); - customToolBars(nw); - } else if (w->isA("Matrix")){ - nw = newMatrix(((Matrix *)w)->numRows(), ((Matrix *)w)->numCols()); - ((Matrix *)nw)->copy((Matrix *)w); - } else if (w->isA("Note")){ - nw = newNote(); - if (nw){ - ((Note*)nw)->setText(((Note*)w)->text()); - ((Note*)nw)->showLineNumbers(((Note*)w)->hasLineNumbers()); - } - } - - if (nw){ - if (w->isA("MultiLayer")){ - if (status == MdiSubWindow::Maximized) - nw->showMaximized(); - } else if (w->isA("Graph3D")){ - ((Graph3D*)nw)->setIgnoreFonts(true); - if (status != MdiSubWindow::Maximized){ - nw->resize(w->size()); - nw->showNormal(); - } else - nw->showMaximized(); - ((Graph3D*)nw)->setIgnoreFonts(false); - } else { - nw->resize(w->size()); - nw->showNormal(); - } - - nw->setWindowLabel(w->windowLabel()); - nw->setCaptionPolicy(w->captionPolicy()); - setListViewSize(nw->objectName(), w->sizeToString()); - } - QApplication::restoreOverrideCursor(); - customMenu(nw); - return nw; -} - -void ApplicationWindow::undo() -{ - MdiSubWindow *w = activeWindow(); - if (!w) - return; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - if (qobject_cast(w)) - ((Note*)w)->currentEditor()->undo(); - else if (qobject_cast(w)){ - QUndoStack *stack = ((Matrix *)w)->undoStack(); - if (stack && stack->canUndo()) - stack->undo(); - } - QApplication::restoreOverrideCursor(); -} - -void ApplicationWindow::redo() -{ - MdiSubWindow *w = activeWindow(); - if (!w) - return; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - if (qobject_cast(w)) - ((Note*)w)->currentEditor()->redo(); - else if (qobject_cast(w)){ - QUndoStack *stack = ((Matrix *)w)->undoStack(); - if (stack && stack->canRedo()) - stack->redo(); - } - QApplication::restoreOverrideCursor(); -} - -bool ApplicationWindow::hidden(QWidget* window) -{ - if (hiddenWindows->contains(window)) - return true; - - return false; -} - -void ApplicationWindow::updateWindowStatus(MdiSubWindow* w) -{ - setListView(w->objectName(), w->aspect()); - if (w->status() == MdiSubWindow::Maximized){ - QList windows = current_folder->windowsList(); - foreach(MdiSubWindow *oldMaxWindow, windows){ - if (oldMaxWindow != w && oldMaxWindow->status() == MdiSubWindow::Maximized) - oldMaxWindow->setStatus(MdiSubWindow::Normal); - } - } - modifiedProject(); -} - -void ApplicationWindow::hideActiveWindow() -{ - MdiSubWindow *w = activeWindow(); - if (!w) - return; - - hideWindow(w); -} - -void ApplicationWindow::hideWindow(MdiSubWindow* w) -{ - hiddenWindows->append(w); - w->setHidden(); - emit modified(); -} - -void ApplicationWindow::hideWindow() -{ - WindowListItem *it = (WindowListItem *)lv->currentItem(); - MdiSubWindow *w = it->window(); - if (!w) - return; - - hideWindow(w); -} - -void ApplicationWindow::resizeActiveWindow() -{ - MdiSubWindow* w = activeWindow(); - if (!w) - return; - - EnrichmentDialog *ed = new EnrichmentDialog(EnrichmentDialog::MDIWindow, NULL, this); - ed->setWidget(w); - ed->exec(); -} - -void ApplicationWindow::resizeWindow() -{ - WindowListItem *it = (WindowListItem *)lv->currentItem(); - MdiSubWindow *w = it->window(); - if (!w) - return; - - d_workspace->setActiveSubWindow(w); - - EnrichmentDialog *ed = new EnrichmentDialog(EnrichmentDialog::MDIWindow, NULL, this); - ed->setWidget(w); - ed->exec(); -} - -void ApplicationWindow::activateWindow() -{ - WindowListItem *it = (WindowListItem *)lv->currentItem(); - activateWindow(it->window()); -} - -void ApplicationWindow::activateWindow(MdiSubWindow *w) -{ - if (!w) - return; - - w->setNormal(); - d_workspace->setActiveSubWindow(w); - - updateWindowLists(w); - emit modified(); -} - -void ApplicationWindow::maximizeWindow(Q3ListViewItem * lbi) -{ - if (!lbi) - lbi = lv->currentItem(); - - if (!lbi || lbi->rtti() == FolderListItem::RTTI) - return; - - maximizeWindow(((WindowListItem*)lbi)->window()); -} - -void ApplicationWindow::maximizeWindow(MdiSubWindow *w) -{ - if (!w || w->status() == MdiSubWindow::Maximized) - return; - - QList windows = current_folder->windowsList(); - foreach(MdiSubWindow *ow, windows){ - if (ow != w && ow->status() == MdiSubWindow::Maximized){ - ow->setNormal(); - break; - } - } - - w->setMaximized(); - updateWindowLists(w); - emit modified(); -} - -void ApplicationWindow::minimizeWindow(MdiSubWindow *w) -{ - if (!w) - w = ((WindowListItem *)lv->currentItem())->window(); - - if (!w) - return; - - updateWindowLists(w); - w->setMinimized(); - emit modified(); -} - -void ApplicationWindow::updateWindowLists(MdiSubWindow *w) -{ - if (!w) - return; - - if (hiddenWindows->contains(w)) - hiddenWindows->takeAt(hiddenWindows->indexOf(w)); -} - -void ApplicationWindow::closeActiveWindow() -{ - MdiSubWindow *w = activeWindow(); - if (w) - w->close(); -} - -void ApplicationWindow::removeWindowFromLists(MdiSubWindow* w) -{ - if (!w) - return; - - QString caption = w->objectName(); - if (w->inherits("Table")){ - Table* m=(Table*)w; - for (int i=0; inumCols(); i++){ - QString name=m->colName(i); - removeCurves(name); - } - } else if (w->isA("MultiLayer")){ - MultiLayer *ml = (MultiLayer*)w; - Graph *g = ml->activeLayer(); - if (g) - btnPointer->setChecked(true); - } else if (w->isA("Matrix")) - remove3DMatrixPlots((Matrix*)w); - - if (hiddenWindows->contains(w)) - hiddenWindows->takeAt(hiddenWindows->indexOf(w)); - - updateCompleter(caption, true); -} - -void ApplicationWindow::closeWindow(MdiSubWindow* window) -{ - if (!window) - return; - - if (d_active_window == window) - d_active_window = NULL; - - removeWindowFromLists(window); - - Folder *f = window->folder(); - f->removeWindow(window); - - //update list view in project explorer - Q3ListViewItem *it = lv->findItem (window->objectName(), 0, Q3ListView::ExactMatch|Q3ListView::CaseSensitive); - if (it) - lv->takeItem(it); - - window->close(); - - QList windows = f->windowsList(); - if (!windows.isEmpty()){ - MdiSubWindow *w = windows.first(); - d_workspace->setActiveSubWindow(w); - d_active_window = w; - f->setActiveWindow(w); - } - - if (show_windows_policy == ActiveFolder && !f->windowsList().count()){ - customMenu(0); - customToolBars(0); - } else if (show_windows_policy == SubFolders && !(current_folder->children()).isEmpty()){ - FolderListItem *fi = current_folder->folderListItem(); - FolderListItem *item = (FolderListItem *)fi->firstChild(); - int initial_depth = item->depth(); - bool emptyFolder = true; - while (item && item->depth() >= initial_depth){ - QList lst = item->folder()->windowsList(); - if (lst.count() > 0){ - emptyFolder = false; - break; - } - item = (FolderListItem *)item->itemBelow(); - } - if (emptyFolder){ - customMenu(0); - customToolBars(0); - } - } - emit modified(); -} - -void ApplicationWindow::about() -{ - QString text = "

"+ versionString() + "

"; - text += "

" + QString(copyright_string).replace("\n", "
") + "

"; - text += "

" + tr("Released") + ": " + QString(release_date) + "

"; - - QMessageBox *mb = new QMessageBox(); - mb->setWindowTitle (tr("About QtiPlot")); - mb->setWindowIcon (QPixmap(logo_xpm)); - mb->setIconPixmap(QPixmap(logo_xpm)); - mb->setText(text); - mb->exec(); -} - -void ApplicationWindow::scriptingMenuAboutToShow() -{ - scriptingMenu->clear(); -#ifdef SCRIPTING_DIALOG - scriptingMenu->addAction(actionScriptingLang); -#endif - scriptingMenu->addAction(actionRestartScripting); - scriptingMenu->addAction(actionCustomActionDialog); -#ifdef SCRIPTING_PYTHON - scriptingMenu->addAction(actionOpenQtDesignerUi); -#endif - - Note *note = (Note *)activeWindow(NoteWindow); - if (note){ - scriptingMenu->insertSeparator(); - - bool noteHasText = !note->text().isEmpty(); - noteTools->setEnabled(noteHasText); - if (noteHasText){ - scriptingMenu->addAction(actionNoteExecute); - scriptingMenu->addAction(actionNoteExecuteAll); - scriptingMenu->addAction(actionNoteEvaluate); - scriptingMenu->insertSeparator(); - scriptingMenu->addAction(actionIncreaseIndent); - scriptingMenu->addAction(actionDecreaseIndent); - scriptingMenu->insertSeparator(); - scriptingMenu->addAction(actionFind); - scriptingMenu->addAction(actionFindNext); - scriptingMenu->addAction(actionFindPrev); - scriptingMenu->addAction(actionReplace); - scriptingMenu->insertSeparator(); - } - scriptingMenu->addAction(actionRenameNoteTab); - scriptingMenu->addAction(actionAddNoteTab); - if (note->tabs() > 1) - scriptingMenu->addAction(actionCloseNoteTab); - scriptingMenu->insertSeparator(); - actionShowNoteLineNumbers->setChecked(note->hasLineNumbers()); - scriptingMenu->addAction(actionShowNoteLineNumbers); - } - - reloadCustomActions(); -} - -void ApplicationWindow::analysisMenuAboutToShow() -{ - analysisMenu->clear(); - MdiSubWindow *w = activeWindow(); - if (!w) - return; - - if (w->isA("MultiLayer")){ - QMenu *translateMenu = analysisMenu->addMenu (tr("&Translate")); - translateMenu->addAction(actionTranslateVert); - translateMenu->addAction(actionTranslateHor); - analysisMenu->insertSeparator(); - analysisMenu->addAction(actionDifferentiate); - analysisMenu->addAction(actionIntegrate); - analysisMenu->addAction(actionShowIntDialog); - analysisMenu->insertSeparator(); - - smoothMenu->clear(); - analysisMenu->addMenu(smoothMenu); - smoothMenu->addAction(actionSmoothSavGol); - smoothMenu->addAction(actionSmoothAverage); - smoothMenu->addAction(actionSmoothLowess); - smoothMenu->addAction(actionSmoothFFT); - - filterMenu->clear(); - analysisMenu->addMenu(filterMenu); - filterMenu->addAction(actionLowPassFilter); - filterMenu->addAction(actionHighPassFilter); - filterMenu->addAction(actionBandPassFilter); - filterMenu->addAction(actionBandBlockFilter); - - analysisMenu->insertSeparator(); - analysisMenu->addAction(actionInterpolate); - analysisMenu->addAction(actionFFT); - analysisMenu->insertSeparator(); - analysisMenu->addAction(actionFitSlope); - analysisMenu->addAction(actionFitLinear); - analysisMenu->addAction(actionShowFitPolynomDialog); - analysisMenu->insertSeparator(); - - decayMenu->clear(); - analysisMenu->addMenu(decayMenu); - decayMenu->addAction(actionShowExpDecayDialog); - decayMenu->addAction(actionShowTwoExpDecayDialog); - decayMenu->addAction(actionShowExpDecay3Dialog); - - analysisMenu->addAction(actionFitExpGrowth); - analysisMenu->addAction(actionFitSigmoidal); - analysisMenu->addAction(actionFitGauss); - analysisMenu->addAction(actionFitLorentz); - - multiPeakMenu->clear(); - analysisMenu->addMenu(multiPeakMenu); - multiPeakMenu->addAction(actionMultiPeakGauss); - multiPeakMenu->addAction(actionMultiPeakLorentz); - analysisMenu->insertSeparator(); - analysisMenu->addAction(actionShowFitDialog); - } else if (w->isA("Matrix")){ - analysisMenu->addAction(actionIntegrate); - analysisMenu->insertSeparator(); - analysisMenu->addAction(actionFFT); - analysisMenu->addAction(actionMatrixFFTDirect); - analysisMenu->addAction(actionMatrixFFTInverse); - } else if (w->inherits("Table")){ - analysisMenu->addAction(actionShowColStatistics); - analysisMenu->addAction(actionShowRowStatistics); - analysisMenu->addAction(actionFrequencyCount); - analysisMenu->insertSeparator(); - analysisMenu->addAction(actionSortSelection); - analysisMenu->addAction(actionSortTable); - - normMenu->clear(); - analysisMenu->addMenu(normMenu); - normMenu->addAction(actionNormalizeSelection); - normMenu->addAction(actionNormalizeTable); - - analysisMenu->insertSeparator(); - analysisMenu->addAction(actionDifferentiate); - analysisMenu->addAction(actionIntegrate); - analysisMenu->insertSeparator(); - analysisMenu->addAction(actionFFT); - analysisMenu->insertSeparator(); - analysisMenu->addAction(actionCorrelate); - analysisMenu->addAction(actionAutoCorrelate); - analysisMenu->insertSeparator(); - analysisMenu->addAction(actionConvolute); - analysisMenu->addAction(actionDeconvolute); - analysisMenu->insertSeparator(); - analysisMenu->addAction(actionFitSlope); - analysisMenu->addAction(actionFitLinear); - analysisMenu->addAction(actionShowFitDialog); - } - reloadCustomActions(); -} - -void ApplicationWindow::matrixMenuAboutToShow() -{ - matrixMenu->clear(); - matrixMenu->addAction(actionSetMatrixProperties); - matrixMenu->addAction(actionSetMatrixDimensions); - matrixMenu->insertSeparator(); - matrixMenu->addAction(actionSetMatrixValues); - matrixMenu->addAction(actionTableRecalculate); - matrixMenu->insertSeparator(); - matrixMenu->addAction(actionRotateMatrix); - matrixMenu->addAction(actionRotateMatrixMinus); - matrixMenu->addAction(actionFlipMatrixVertically); - matrixMenu->addAction(actionFlipMatrixHorizontally); - matrixMenu->insertSeparator(); - matrixMenu->addAction(actionTransposeMatrix); - matrixMenu->addAction(actionInvertMatrix); - matrixMenu->addAction(actionMatrixDeterminant); - matrixMenu->insertSeparator(); - matrixMenu->addAction(actionGoToRow); - matrixMenu->addAction(actionGoToColumn); - matrixMenu->insertSeparator(); - QMenu *matrixViewMenu = matrixMenu->addMenu (tr("Vie&w")); - matrixViewMenu->addAction(actionViewMatrixImage); - matrixViewMenu->addAction(actionViewMatrix); - QMenu *matrixPaletteMenu = matrixMenu->addMenu (tr("&Palette")); - matrixPaletteMenu->addAction(actionMatrixDefaultScale); - matrixPaletteMenu->addAction(actionMatrixGrayScale); - matrixPaletteMenu->addAction(actionMatrixRainbowScale); - matrixPaletteMenu->addAction(actionMatrixCustomScale); - matrixMenu->insertSeparator(); - matrixMenu->addAction(actionMatrixColumnRow); - matrixMenu->addAction(actionMatrixXY); - matrixMenu->insertSeparator(); - QMenu *convertToTableMenu = matrixMenu->addMenu (tr("&Convert to Spreadsheet")); - convertToTableMenu->addAction(actionConvertMatrixDirect); - convertToTableMenu->addAction(actionConvertMatrixXYZ); - convertToTableMenu->addAction(actionConvertMatrixYXZ); - - Matrix* m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return; - - actionViewMatrixImage->setChecked(m->viewType() == Matrix::ImageView); - actionViewMatrix->setChecked(m->viewType() == Matrix::TableView); - actionMatrixColumnRow->setChecked(m->headerViewType() == Matrix::ColumnRow); - actionMatrixColumnRow->setEnabled(m->viewType() == Matrix::TableView); - actionMatrixXY->setChecked(m->headerViewType() == Matrix::XY); - actionMatrixXY->setEnabled(m->viewType() == Matrix::TableView); - - actionMatrixDefaultScale->setChecked(m->colorMapType() == Matrix::Default); - actionMatrixGrayScale->setChecked(m->colorMapType() == Matrix::GrayScale); - actionMatrixRainbowScale->setChecked(m->colorMapType() == Matrix::Rainbow); - actionMatrixCustomScale->setChecked(m->colorMapType() == Matrix::Custom); - - reloadCustomActions(); -} - -void ApplicationWindow::fileMenuAboutToShow() -{ - if (fileMenu) - fileMenu->clear(); - if (newMenu) - newMenu->clear(); - if (exportPlotMenu) - exportPlotMenu->clear(); - if (importMenu) - importMenu->clear(); - - fileMenu->addMenu(newMenu); - newMenu->addAction(actionNewProject); - newMenu->addAction(actionNewFolder); - newMenu->addAction(actionNewTable); - newMenu->addAction(actionNewMatrix); - newMenu->addAction(actionNewNote); - newMenu->addAction(actionNewGraph); - newMenu->addAction(actionNewFunctionPlot); - newMenu->addAction(actionNewSurfacePlot); - fileMenu->addAction(actionOpen); - fileMenu->addAction(actionAppendProject); - - recentMenuID = fileMenu->insertItem(tr("&Recent Projects"), recent); - - fileMenu->addAction(actionCloseProject); - fileMenu->insertSeparator(); - fileMenu->addAction(actionLoadImage); - fileMenu->addAction(actionImportImage); - - MdiSubWindow *w = activeWindow(); - if (w && w->isA("Matrix")) - fileMenu->addAction(actionExportMatrix); - - fileMenu->insertSeparator(); - fileMenu->addAction(actionSaveProject); - fileMenu->addAction(actionSaveProjectAs); - fileMenu->insertSeparator(); - fileMenu->addAction(actionOpenTemplate); - fileMenu->addAction(actionSaveTemplate); - fileMenu->insertSeparator(); - - if (w && (w->isA("MultiLayer") || w->isA("Graph3D"))){ - fileMenu->addMenu (exportPlotMenu); - exportPlotMenu->addAction(actionExportGraph); - exportPlotMenu->addAction(actionExportAllGraphs); - fileMenu->addAction(actionPresentationODF); - } - - fileMenu->insertSeparator(); - fileMenu->addAction(actionPrint); - fileMenu->addAction(actionPrintPreview); - fileMenu->addAction(actionPrintAllPlots); - fileMenu->insertSeparator(); - fileMenu->addAction(actionShowExportASCIIDialog); - - fileMenu->addMenu(importMenu); - importMenu->addAction(actionLoad); - importMenu->addAction(actionImportSound); - - fileMenu->insertSeparator(); - fileMenu->addAction(actionCloseAllWindows); - - reloadCustomActions(); -} - -void ApplicationWindow::editMenuAboutToShow() -{ - MdiSubWindow *w = activeWindow(); - if (!w){ - actionUndo->setEnabled(false); - actionRedo->setEnabled(false); - return; - } - - if (qobject_cast(w)){ - QTextDocument *doc = ((Note *)w)->currentEditor()->document(); - actionUndo->setEnabled(doc->isUndoAvailable()); - actionRedo->setEnabled(doc->isRedoAvailable()); - } else if (qobject_cast(w)){ - QUndoStack *stack = ((Matrix *)w)->undoStack(); - actionUndo->setEnabled(stack->canUndo()); - actionRedo->setEnabled(stack->canRedo()); - } else { - actionUndo->setEnabled(false); - actionRedo->setEnabled(false); - } -} - -void ApplicationWindow::windowsMenuAboutToShow() -{ - windowsMenu->clear(); - foldersMenu->clear(); - - int folder_param = 0; - Folder *f = projectFolder(); - while (f){ - int id; - if (folder_param < 9) - id = foldersMenu->insertItem("&" + QString::number(folder_param+1) + " " + f->path(), this, SLOT(foldersMenuActivated(int))); - else - id = foldersMenu->insertItem(f->path(), this, SLOT(foldersMenuActivated(int))); - - foldersMenu->setItemParameter(id, folder_param); - folder_param++; - foldersMenu->setItemChecked(id, f == current_folder); - - f = f->folderBelow(); - } - - windowsMenu->insertItem(tr("&Folders"), foldersMenu); - windowsMenu->insertSeparator(); - - QList windows = current_folder->windowsList(); - int n = int(windows.count()); - if (!n ){ - #ifdef SCRIPTING_PYTHON - windowsMenu->addAction(actionShowScriptWindow); - #endif - return; - } - - windowsMenu->insertItem(tr("&Cascade"), this, SLOT(cascade())); - windowsMenu->insertItem(tr("&Tile"), d_workspace, SLOT(tileSubWindows())); - windowsMenu->insertSeparator(); - windowsMenu->addAction(actionNextWindow); - windowsMenu->addAction(actionPrevWindow); - windowsMenu->insertSeparator(); - windowsMenu->addAction(actionFindWindow); - windowsMenu->addAction(actionRename); - windowsMenu->addAction(actionCopyWindow); - windowsMenu->insertSeparator(); -#ifdef SCRIPTING_PYTHON - windowsMenu->addAction(actionShowScriptWindow); - windowsMenu->insertSeparator(); -#endif - - windowsMenu->addAction(actionResizeActiveWindow); - windowsMenu->addAction(actionHideActiveWindow); - windowsMenu->insertItem(QPixmap(close_xpm), tr("Close &Window"), - this, SLOT(closeActiveWindow()), Qt::CTRL+Qt::Key_W ); - - if (n>0 && n<10){ - windowsMenu->insertSeparator(); - for (int i = 0; iinsertItem(windows.at(i)->objectName(), - this, SLOT( windowsMenuActivated( int ) ) ); - windowsMenu->setItemParameter( id, i ); - windowsMenu->setItemChecked( id, current_folder->activeWindow() == windows.at(i)); - } - } else if (n>=10) { - windowsMenu->insertSeparator(); - for ( int i = 0; i<9; ++i ){ - int id = windowsMenu->insertItem(windows.at(i)->objectName(), - this, SLOT( windowsMenuActivated( int ) ) ); - windowsMenu->setItemParameter( id, i ); - windowsMenu->setItemChecked( id, activeWindow() == windows.at(i) ); - } - windowsMenu->insertSeparator(); - windowsMenu->insertItem(tr("More windows..."),this, SLOT(showMoreWindows())); - } - reloadCustomActions(); -} - -void ApplicationWindow::showMarkerPopupMenu() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph* g = plot->activeLayer(); - QMenu markerMenu(this); - - if (g->imageMarkerSelected()){ - markerMenu.insertItem(QPixmap(pixelProfile_xpm),tr("&View Pixel Line profile"),this, SLOT(pixelLineProfile())); - markerMenu.insertItem(tr("&Intensity Matrix"),this, SLOT(intensityTable())); - markerMenu.insertSeparator(); - } - if (!g->activeEnrichment()) - markerMenu.insertItem(QPixmap(cut_xpm),tr("&Cut"),this, SLOT(cutSelection())); - markerMenu.insertItem(QPixmap(copy_xpm), tr("&Copy"),this, SLOT(copySelection())); - markerMenu.insertItem(QPixmap(delete_xpm), tr("&Delete"),this, SLOT(clearSelection())); - markerMenu.insertSeparator(); - if (g->arrowMarkerSelected()) - markerMenu.insertItem(tr("&Properties..."),this, SLOT(showLineDialog())); - else - markerMenu.insertItem(tr("&Properties..."),this, SLOT(showEnrichementDialog())); - - markerMenu.exec(QCursor::pos()); -} - -void ApplicationWindow::showMoreWindows() -{ - if (explorerWindow->isVisible()) - QMessageBox::information(this, "QtiPlot",tr("Please use the project explorer to select a window!")); - else - explorerWindow->show(); -} - -void ApplicationWindow::windowsMenuActivated( int id ) -{ - QList windows = current_folder->windowsList(); - MdiSubWindow* w = windows.at( id ); - if ( w ){ - w->showNormal(); - w->setFocus(); - if(hidden(w)){ - hiddenWindows->takeAt(hiddenWindows->indexOf(w)); - setListView(w->objectName(), tr("Normal")); - } - d_workspace->setActiveSubWindow(w); - } -} - -void ApplicationWindow::foldersMenuActivated( int id ) -{ - int folder_param = 0; - Folder *f = projectFolder(); - while (f){ - if (folder_param == id){ - changeFolder (f); - return; - } - - folder_param++; - f = f->folderBelow(); - } -} - -void ApplicationWindow::newProject() -{ - saveSettings();//the recent projects must be saved - - ApplicationWindow *ed = new ApplicationWindow(); - ed->restoreApplicationGeometry(); - ed->initWindow(); - ed->savedProject(); - - close(); -} - -void ApplicationWindow::savedProject() -{ - QCoreApplication::processEvents(); - - actionSaveProject->setEnabled(false); - saved = true; - - Folder *f = projectFolder(); - while (f){ - QList folderWindows = f->windowsList(); - foreach(MdiSubWindow *w, folderWindows){ - if (w->isA("Matrix")) - ((Matrix *)w)->undoStack()->setClean(); - } - f = f->folderBelow(); - } -} - -void ApplicationWindow::modifiedProject() -{ - if (saved == false) - return; - - if (actionSaveProject) - actionSaveProject->setEnabled(true); - saved = false; -} - -void ApplicationWindow::modifiedProject(MdiSubWindow *w) -{ - if (!w) - return; - - modifiedProject(); - - Q3ListViewItem *it = lv->findItem (w->objectName(), 0, Q3ListView::ExactMatch | Qt::CaseSensitive ); - if (it) - it->setText(3, w->sizeToString()); -} - -void ApplicationWindow::timerEvent ( QTimerEvent *e) -{ - if (e->timerId() == savingTimerId) - saveProject(); - else - QWidget::timerEvent(e); -} - -void ApplicationWindow::dropEvent( QDropEvent* e ) -{ - if (!e->mimeData()->hasImage() && !e->mimeData()->hasUrls()) - return; - - MdiSubWindow *destWindow = NULL; - QList windows = d_workspace->subWindowList(QMdiArea::StackingOrder); - QListIterator it(windows); - it.toBack(); - QPoint pos = d_workspace->mapFromGlobal(e->pos()); - while (it.hasPrevious()){ - QMdiSubWindow *w = it.previous(); - if (w->frameGeometry().contains(pos)){ - destWindow = (MdiSubWindow*)w; - break; - } - } - - if (e->mimeData()->hasImage()){ - QImage image = qvariant_cast(e->mimeData()->imageData()); - MultiLayer *ml = qobject_cast(destWindow); - if (ml){ - Graph *l = ml->layerAt(pos); - if (l) - l->addImage(image); - else if (ml->activeLayer()) - ml->activeLayer()->addImage(image); - else - ml->addLayer()->addImage(image); - return; - } - - Matrix *m = qobject_cast(destWindow); - if (m) - m->importImage(image); - else { - m = new Matrix(scriptEnv, image, "", this); - initMatrix(m, generateUniqueName(tr("Matrix"))); - m->show(); - } - return; - } - - if (e->mimeData()->hasUrls()){ - QList urls = e->mimeData()->urls(); - QStringList fileNames; - foreach(QUrl url, urls) - fileNames << url.toLocalFile(); - - QList lst = QImageReader::supportedImageFormats() << "JPG"; - QStringList asciiFiles; - - for(int i = 0; i<(int)fileNames.count(); i++){ - QString fn = fileNames[i]; - QFileInfo fi (fn); - QString ext = fi.extension(); - QStringList tempList; - // convert QList to QStringList to be able to 'filter' - foreach(QByteArray temp,lst) - tempList.append(QString(temp)); - QStringList l = tempList.filter(ext, Qt::CaseInsensitive); - if (l.count() > 0){ - MultiLayer *ml = qobject_cast(destWindow); - if (ml){ - Graph *l = ml->layerAt(pos); - if (l) - l->addImage(fn); - else if (ml->activeLayer()) - ml->activeLayer()->addImage(fn); - else - ml->addLayer()->addImage(fn); - } else { - Matrix *m = qobject_cast(destWindow); - if (m) - m->importImage(fn); - else - importImage(fn, true); - } - } else if ( ext == "opj" || ext == "qti") - open(fn); - else - asciiFiles << fn; - } - - importASCII(asciiFiles, ImportASCIIDialog::NewTables, columnSeparator, ignoredLines, - renameColumns, strip_spaces, simplify_spaces, d_ASCII_import_comments, - d_ASCII_import_locale, d_ASCII_comment_string, d_ASCII_import_read_only, d_ASCII_end_line); - } -} - -void ApplicationWindow::dragEnterEvent( QDragEnterEvent* e ) -{ - if (e->source()){ - e->ignore(); - return; - } - - e->accept(Q3UriDrag::canDecode(e)); -} - -void ApplicationWindow::closeEvent( QCloseEvent* ce ) -{ - #ifdef QTIPLOT_DEMO - showDemoVersionMessage(); - #endif - - if (!saved){ - QString s = tr("Save changes to project:

%1 ?").arg(projectname); - switch( QMessageBox::information(this, tr("QtiPlot"), s, tr("Yes"), tr("No"), - tr("Cancel"), 0, 2 ) ){ - case 0: - if (!saveProject()){ - ce->ignore(); - break; - } - saveSettings(); - ce->accept(); - break; - - case 1: - default: - saveSettings(); - ce->accept(); - break; - - case 2: - ce->ignore(); - break; - } - } else { - saveSettings(); - ce->accept(); - } -} - -void ApplicationWindow::customEvent(QEvent *e) -{ - if (e->type() == SCRIPTING_CHANGE_EVENT) - scriptingChangeEvent((ScriptingChangeEvent*)e); -} - -void ApplicationWindow::deleteSelectedItems() -{ - if (folders->hasFocus() && folders->currentItem() != folders->firstChild()) - {//we never allow the user to delete the project folder item - deleteFolder(); - return; - } - - Q3ListViewItem *item; - QList lst; - for (item = lv->firstChild(); item; item = item->nextSibling()){ - if (item->isSelected()) - lst.append(item); - } - - folders->blockSignals(true); - foreach(item, lst){ - if (item->rtti() == FolderListItem::RTTI) - deleteFolder(((FolderListItem *)item)->folder()); - else - ((WindowListItem *)item)->window()->close(); - } - folders->blockSignals(false); -} - -void ApplicationWindow::showListViewSelectionMenu(const QPoint &p) -{ - QMenu cm(this); - cm.insertItem(tr("&Show All Windows"), this, SLOT(showSelectedWindows())); - cm.insertItem(tr("&Hide All Windows"), this, SLOT(hideSelectedWindows())); - cm.insertSeparator(); - cm.insertItem(tr("&Delete Selection"), this, SLOT(deleteSelectedItems()), Qt::Key_F8); - cm.exec(p); -} - -void ApplicationWindow::showListViewPopupMenu(const QPoint &p) -{ - QMenu cm(this); - QMenu window(this); - - window.addAction(actionNewTable); - window.addAction(actionNewMatrix); - window.addAction(actionNewNote); - window.addAction(actionNewGraph); - window.addAction(actionNewFunctionPlot); - window.addAction(actionNewSurfacePlot); - cm.insertItem(tr("New &Window"), &window); - - cm.insertItem(QPixmap(newfolder_xpm), tr("New F&older"), this, SLOT(addFolder()), Qt::Key_F7); - cm.insertSeparator(); - cm.insertItem(tr("Auto &Column Width"), lv, SLOT(adjustColumns())); - cm.exec(p); -} - -void ApplicationWindow::showWindowPopupMenu(Q3ListViewItem *it, const QPoint &p, int) -{ - if (folders->isRenaming()) - return; - - if (!it){ - showListViewPopupMenu(p); - return; - } - - Q3ListViewItem *item; - int selected = 0; - for (item = lv->firstChild(); item; item = item->nextSibling()){ - if (item->isSelected()) - selected++; - - if (selected>1){ - showListViewSelectionMenu(p); - return; - } - } - - if (it->rtti() == FolderListItem::RTTI){ - current_folder = ((FolderListItem *)it)->folder(); - showFolderPopupMenu(it, p, false); - return; - } - - MdiSubWindow *w = ((WindowListItem *)it)->window(); - if (w){ - QMenu cm(this); - QMenu plots(this); - - cm.addAction(actionActivateWindow); - cm.addAction(actionMinimizeWindow); - cm.addAction(actionMaximizeWindow); - cm.insertSeparator(); - if (!hidden(w)) - cm.addAction(actionHideWindow); - cm.insertItem(QPixmap(close_xpm), tr("&Delete Window"), w, SLOT(close()), Qt::Key_F8); - cm.insertSeparator(); - cm.insertItem(tr("&Rename Window"), this, SLOT(renameWindow()), Qt::Key_F2); - cm.addAction(actionResizeWindow); - cm.insertSeparator(); - cm.insertItem(QPixmap(fileprint_xpm), tr("&Print Window"), w, SLOT(print())); - cm.insertSeparator(); - cm.insertItem(tr("&Properties..."), this, SLOT(windowProperties())); - - if (w->inherits("Table")){ - QStringList graphs = dependingPlots(w->objectName()); - if (int(graphs.count())>0){ - cm.insertSeparator(); - for (int i=0;iisA("Matrix")){ - QStringList graphs = depending3DPlots((Matrix*)w); - if (int(graphs.count())>0){ - cm.insertSeparator(); - for (int i=0;iisA("MultiLayer")) { - tablesDepend->clear(); - QStringList tbls=multilayerDependencies(w); - int n = int(tbls.count()); - if (n > 0){ - cm.insertSeparator(); - for (int i=0; iinsertItem(tbls[i], i, -1); - - cm.insertItem(tr("D&epends on"), tablesDepend); - } - } else if (w->isA("Graph3D")) { - Graph3D *sp=(Graph3D*)w; - Matrix *m = sp->matrix(); - QString formula = sp->formula(); - if (!formula.isEmpty()){ - cm.insertSeparator(); - if (formula.contains("_")){ - QStringList tl = formula.split("_", QString::SkipEmptyParts); - tablesDepend->clear(); - tablesDepend->insertItem(tl[0], 0, -1); - cm.insertItem(tr("D&epends on"), tablesDepend); - } else if (m) { - plots.insertItem(m->objectName(), m, SLOT(showNormal())); - cm.insertItem(tr("D&epends on"),&plots); - } else { - plots.insertItem(formula, w, SLOT(showNormal())); - cm.insertItem(tr("Function"), &plots); - } - } - } - cm.exec(p); - } -} - -void ApplicationWindow::showTable(int i) -{ - Table *t = table(tablesDepend->text(i)); - if (!t) - return; - - updateWindowLists(t); - - t->showMaximized(); - Q3ListViewItem *it=lv->findItem (t->objectName(), 0, Q3ListView::ExactMatch | Qt::CaseSensitive ); - if (it) - it->setText(2,tr("Maximized")); -} - -void ApplicationWindow::showTable(const QString& curve) -{ - Table* w=table(curve); - if (!w) - return; - - updateWindowLists(w); - int colIndex = w->colIndex(curve); - w->setSelectedCol(colIndex); - w->table()->clearSelection(); - w->table()->selectColumn(colIndex); - w->showMaximized(); - Q3ListViewItem *it=lv->findItem (w->objectName(), 0, Q3ListView::ExactMatch | Qt::CaseSensitive ); - if (it) - it->setText(2,tr("Maximized")); - emit modified(); -} - -QStringList ApplicationWindow::depending3DPlots(Matrix *m) -{ - QStringList plots; - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - if (w->isA("Graph3D") && ((Graph3D *)w)->matrix() == m) - plots << w->objectName(); - } - return plots; -} - -QStringList ApplicationWindow::dependingPlots(const QString& name) -{ - QStringList plots; - - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - if (w->isA("MultiLayer")){ - QList layers = ((MultiLayer*)w)->layersList(); - foreach(Graph *g, layers){ - QStringList onPlot = g->curveNamesList(); - onPlot = onPlot.grep (name,TRUE); - if (int(onPlot.count()) && plots.contains(w->objectName())<=0) - plots << w->objectName(); - } - }else if (w->isA("Graph3D")){ - if ((((Graph3D*)w)->formula()).contains(name,TRUE) && plots.contains(w->objectName())<=0) - plots << w->objectName(); - } - } - return plots; -} - -QStringList ApplicationWindow::multilayerDependencies(QWidget *w) -{ - QStringList tables; - MultiLayer *g=(MultiLayer*)w; - QList layers = g->layersList(); - foreach(Graph *ag, layers){ - QStringList onPlot = ag->curveNamesList(); - for (int j=0; jactiveLayer(); - if (!ag) - return; - - QMenu cm(this); - - QMenu addMenu(this); - if (ag->isPiePlot()){ - cm.addAction(tr("Re&move Pie Curve"),ag, SLOT(removePie())); - addMenu.addAction(actionNewLegend); - } else { - if (ag->visibleCurves() != ag->curveCount()){ - cm.addAction(actionShowAllCurves); - cm.addSeparator(); - } - - addMenu.addAction(actionShowCurvesDialog); - addMenu.addAction(actionAddFunctionCurve); - addMenu.addAction(actionAddErrorBars); - addMenu.addAction(actionNewLegend); - addMenu.addSeparator(); - } - - addMenu.addAction(actionAddFormula); - addMenu.addAction(actionAddText); - addMenu.addAction(btnArrow); - addMenu.addAction(btnLine); - addMenu.addAction(actionAddRectangle); - addMenu.addAction(actionAddEllipse); - addMenu.addAction(actionTimeStamp); - addMenu.addAction(actionAddImage); - addMenu.addSeparator(); - addMenu.addAction(actionAddLayer); - addMenu.addAction(actionAddInsetLayer); - addMenu.addAction(actionAddInsetCurveLayer); - cm.insertItem(tr("&Add"), &addMenu); - - QMenu paletteMenu(this); - if (!ag->isPiePlot()){ - cm.insertItem(tr("Anal&yze"), analysisMenu); - cm.insertItem(tr("&Data"), plotDataMenu); - - paletteMenu.addAction(tr("&Gray Scale"), ag, SLOT(setGrayScale())); - paletteMenu.addAction(tr("&Indexed Colors"), ag, SLOT(setIndexedColors())); - cm.insertItem(tr("Pale&tte"), &paletteMenu); - cm.addSeparator(); - } - - QMenu copy(this); - copy.addAction(tr("&Layer"), this, SLOT(copyActiveLayer())); - copy.addAction(tr("&Window"), plot, SLOT(copyAllLayers())); - cm.insertItem(QPixmap(copy_xpm), tr("&Copy"), ©); - - if (lastCopiedLayer) - cm.addAction(QPixmap(paste_xpm), tr("&Paste Layer"), this, SLOT(pasteSelection())); - else if (d_enrichement_copy){ - if (qobject_cast(d_enrichement_copy)) - cm.addAction(QPixmap(paste_xpm), tr("&Paste Text"), plot, SIGNAL(pasteMarker())); - else if (qobject_cast(d_enrichement_copy)) - cm.addAction(QPixmap(paste_xpm), tr("&Paste Tex Formula"), plot, SIGNAL(pasteMarker())); - else if (qobject_cast(d_enrichement_copy)) - cm.addAction(QPixmap(paste_xpm), tr("&Paste Image"), plot, SIGNAL(pasteMarker())); - else if (qobject_cast(d_enrichement_copy)) - cm.addAction(QPixmap(paste_xpm), tr("&Paste Rectangle"), plot, SIGNAL(pasteMarker())); - else if (qobject_cast(d_enrichement_copy)) - cm.addAction(QPixmap(paste_xpm), tr("&Paste Ellipse"), plot, SIGNAL(pasteMarker())); - } else if (d_arrow_copy) - cm.addAction(QPixmap(paste_xpm), tr("&Paste Line/Arrow"), plot, SIGNAL(pasteMarker())); - - QMenu exports(this); - exports.addAction(tr("&Layer"), this, SLOT(exportLayer())); - exports.addAction(tr("&Window"), this, SLOT(exportGraph())); - cm.insertItem(tr("E&xport"),&exports); - - QMenu prints(this); - prints.addAction(tr("&Layer"), plot, SLOT(printActiveLayer())); - prints.addAction(tr("&Window"), plot, SLOT(print())); - cm.insertItem(QPixmap(fileprint_xpm), tr("&Print"),&prints); - - cm.addSeparator(); - - cm.addAction(tr("P&roperties..."), this, SLOT(showGeneralPlotDialog())); - cm.addSeparator(); - cm.addAction(actionDeleteLayer); - cm.exec(QCursor::pos()); -} - -void ApplicationWindow::showWindowContextMenu() -{ - MdiSubWindow* w = activeWindow(); - if (!w) - return; - - QMenu cm(this); - QMenu plot3D(this); - if (w->isA("MultiLayer")){ - MultiLayer *g = (MultiLayer*)w; - if (lastCopiedLayer){ - cm.insertItem(QPixmap(paste_xpm), tr("&Paste Layer"), this, SLOT(pasteSelection())); - cm.insertSeparator(); - } - - cm.addAction(actionAddLayer); - if (g->numLayers() != 0) - cm.addAction(actionDeleteLayer); - - cm.addAction(actionShowLayerDialog); - cm.insertSeparator(); - cm.addAction(actionRename); - cm.addAction(actionCopyWindow); - cm.insertSeparator(); - cm.insertItem(QPixmap(copy_xpm),tr("&Copy Page"), g, SLOT(copyAllLayers())); - cm.insertItem(tr("E&xport Page"), this, SLOT(exportGraph())); - cm.addAction(actionPrint); - cm.insertSeparator(); - cm.addAction(actionCloseWindow); - } else if (w->isA("Graph3D")){ - Graph3D *g=(Graph3D*)w; - if (!g->hasData()){ - cm.insertItem(tr("3D &Plot"), &plot3D); - plot3D.addAction(actionAdd3DData); - plot3D.insertItem(tr("&Matrix..."), this, SLOT(add3DMatrixPlot())); - plot3D.addAction(actionEditSurfacePlot); - } else { - if (g->table()) - cm.insertItem(tr("Choose &Data Set..."), this, SLOT(change3DData())); - else if (g->matrix()) - cm.insertItem(tr("Choose &Matrix..."), this, SLOT(change3DMatrix())); - else if (g->userFunction() || g->parametricSurface()) - cm.addAction(actionEditSurfacePlot); - cm.insertItem(QPixmap(erase_xpm), tr("C&lear"), g, SLOT(clearData())); - } - cm.addMenu(format); - cm.insertSeparator(); - cm.addAction(actionRename); - cm.addAction(actionCopyWindow); - cm.insertSeparator(); - cm.insertItem(tr("&Copy Graph"), g, SLOT(copyImage())); - cm.insertItem(tr("&Export"), this, SLOT(exportGraph())); - cm.addAction(actionPrint); - cm.insertSeparator(); - cm.addAction(actionCloseWindow); - } else if (qobject_cast(w)){ - Matrix *t = (Matrix *)w; - cm.addMenu(plot3DMenu); - cm.insertSeparator(); - cm.addAction(actionSetMatrixProperties); - cm.addAction(actionSetMatrixDimensions); - cm.insertSeparator(); - cm.addAction(actionSetMatrixValues); - cm.addAction(actionTableRecalculate); - cm.insertSeparator(); - - if (t->viewType() == Matrix::TableView){ - cm.insertItem(QPixmap(cut_xpm),tr("Cu&t"), t, SLOT(cutSelection())); - cm.insertItem(QPixmap(copy_xpm),tr("&Copy"), t, SLOT(copySelection())); - cm.insertItem(QPixmap(paste_xpm),tr("&Paste"), t, SLOT(pasteSelection())); - cm.insertSeparator(); - cm.insertItem(QPixmap(insert_row_xpm), tr("&Insert Row"), t, SLOT(insertRow())); - cm.insertItem(QPixmap(insert_column_xpm), tr("&Insert Column"), t, SLOT(insertColumn())); - if (t->numSelectedRows() > 0) - cm.insertItem(QPixmap(delete_row_xpm), tr("&Delete Rows"), t, SLOT(deleteSelectedRows())); - else if (t->numSelectedColumns() > 0) - cm.insertItem(QPixmap(delete_column_xpm), tr("&Delete Columns"), t, SLOT(deleteSelectedColumns())); - - cm.insertItem(QPixmap(erase_xpm),tr("Clea&r"), t, SLOT(clearSelection())); - cm.insertSeparator(); - cm.addAction(actionViewMatrixImage); - } else if (t->viewType() == Matrix::ImageView){ - cm.addAction(actionImportImage); - cm.addAction(actionExportMatrix); - cm.insertSeparator(); - cm.addAction(actionRotateMatrix); - cm.addAction(actionRotateMatrixMinus); - cm.insertSeparator(); - cm.addAction(actionFlipMatrixVertically); - cm.addAction(actionFlipMatrixHorizontally); - cm.insertSeparator(); - cm.addAction(actionTransposeMatrix); - cm.addAction(actionInvertMatrix); - cm.insertSeparator(); - cm.addAction(actionViewMatrix); - } - } - cm.exec(QCursor::pos()); -} - -void ApplicationWindow::customWindowTitleBarMenu(MdiSubWindow *w, QMenu *menu) -{ - menu->addAction(actionHideActiveWindow); - menu->addSeparator(); - if (w->inherits("Table") || w->isA("Matrix")){ - menu->addAction(actionLoad); - menu->addAction(actionShowExportASCIIDialog); - menu->addSeparator(); - } - - if (w->isA("Note")) - menu->addAction(actionSaveNote); - else - menu->addAction(actionSaveTemplate); - menu->addAction(actionPrint); - menu->addSeparator(); - menu->addAction(actionRename); - menu->addAction(actionCopyWindow); - menu->addSeparator(); -} - -void ApplicationWindow::showTableContextMenu(bool selection) -{ - Table *t = (Table*)activeWindow(TableWindow); - if (!t) - return; - - QMenu cm(this); - QMenu moveRow(this); - if (selection){ - if ((int)t->selectedColumns().count() > 0){ - showColMenu(t->firstSelectedColumn()); - return; - } else if (t->numSelectedRows() == 1) { - cm.addAction(actionShowColumnValuesDialog); - cm.addAction(actionTableRecalculate); - cm.insertSeparator(); - cm.insertItem(QPixmap(cut_xpm),tr("Cu&t"), t, SLOT(cutSelection())); - cm.insertItem(QPixmap(copy_xpm),tr("&Copy"), t, SLOT(copySelection())); - cm.insertItem(QPixmap(paste_xpm),tr("&Paste"), t, SLOT(pasteSelection())); - cm.insertSeparator(); - moveRow.addAction(actionMoveRowUp); - moveRow.addAction(actionMoveRowDown); - moveRow.setTitle(tr("Move Row")); - cm.addMenu (&moveRow); - cm.insertItem(QPixmap(insert_row_xpm), tr("&Insert Row"), t, SLOT(insertRow())); - cm.insertItem(QPixmap(delete_row_xpm), tr("&Delete Row"), t, SLOT(deleteSelectedRows())); - cm.insertItem(QPixmap(erase_xpm), tr("Clea&r Row"), t, SLOT(clearSelection())); - cm.insertSeparator(); - cm.addAction(actionShowRowStatistics); - } else if (t->numSelectedRows() > 1) { - cm.addAction(actionShowColumnValuesDialog); - cm.insertItem(QPixmap(cut_xpm),tr("Cu&t"), t, SLOT(cutSelection())); - cm.insertItem(QPixmap(copy_xpm),tr("&Copy"), t, SLOT(copySelection())); - cm.insertItem(QPixmap(paste_xpm),tr("&Paste"), t, SLOT(pasteSelection())); - cm.insertSeparator(); - cm.addAction(actionTableRecalculate); - cm.insertItem(QPixmap(delete_row_xpm), tr("&Delete Rows"), t, SLOT(deleteSelectedRows())); - cm.insertItem(QPixmap(erase_xpm),tr("Clea&r Rows"), t, SLOT(clearSelection())); - cm.insertSeparator(); - cm.addAction(actionShowRowStatistics); - } else if (t->numRows() > 0 && t->numCols() > 0){ - cm.addAction(actionShowColumnValuesDialog); - cm.insertItem(QPixmap(cut_xpm),tr("Cu&t"), t, SLOT(cutSelection())); - cm.insertItem(QPixmap(copy_xpm),tr("&Copy"), t, SLOT(copySelection())); - cm.insertItem(QPixmap(paste_xpm),tr("&Paste"), t, SLOT(pasteSelection())); - cm.insertSeparator(); - cm.addAction(actionTableRecalculate); - cm.insertItem(QPixmap(erase_xpm),tr("Clea&r"), t, SLOT(clearSelection())); - } - } else { - cm.addAction(actionShowExportASCIIDialog); - cm.insertSeparator(); - cm.addAction(actionAddColToTable); - cm.addAction(actionClearTable); - cm.insertSeparator(); - cm.addAction(actionGoToRow); - cm.addAction(actionGoToColumn); - } - cm.exec(QCursor::pos()); -} - -void ApplicationWindow::chooseHelpFolder() -{ - QFileInfo hfi(helpFilePath); - QString dir = QFileDialog::getExistingDirectory(this, tr("Choose the location of the QtiPlot help folder!"), - hfi.dir().absolutePath(), !QFileDialog::ShowDirsOnly); - - if (!dir.isEmpty()){ - helpFilePath = dir + "index.html"; - - QFile helpFile(helpFilePath); - if (!helpFile.exists()){ - QMessageBox::critical(this, tr("QtiPlot - index.html File Not Found!"), - tr("There is no file called index.html in this folder.
Please choose another folder!")); - } - } -} - -void ApplicationWindow::showStandAloneHelp() -{ -#ifdef Q_OS_MAC // Mac - QSettings settings(QSettings::IniFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); -#else - QSettings settings(QSettings::NativeFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); -#endif - - settings.beginGroup("/General"); - settings.beginGroup("/Paths"); - QString helpPath = settings.value("/HelpFile", qApp->applicationDirPath()+"/manual/index.html").toString(); - settings.endGroup(); - settings.endGroup(); - - QFile helpFile(helpPath); - if (!helpPath.isEmpty() && !helpFile.exists()) - { - QMessageBox::critical(0, tr("QtiPlot - Help Files Not Found!"), - tr("The manual can be downloaded from the following internet address:")+ - "

http://soft.proindependent.com/manuals.html

"); - exit(0); - } - - QFileInfo fi(helpPath); - QString profilePath = QString(fi.dirPath(true)+"/qtiplot.adp"); - if (!QFile(profilePath).exists()) - { - QMessageBox::critical(0, tr("QtiPlot - Help Profile Not Found!"), - tr("The assistant could not start because the file %1 was not found in the help file directory!").arg("qtiplot.adp")+"
"+ - tr("This file is provided with the QtiPlot manual which can be downloaded from the following internet address:")+ - "

http://soft.proindependent.com/manuals.html

"); - exit(0); - } - - QStringList cmdLst = QStringList() << "-profile" << profilePath; - QAssistantClient *assist = new QAssistantClient( QString(), 0); - assist->setArguments( cmdLst ); - assist->showPage(helpPath); - connect(assist, SIGNAL(assistantClosed()), qApp, SLOT(quit()) ); -} - -void ApplicationWindow::showHelp() -{ - QFile helpFile(helpFilePath); - if (!helpFile.exists()){ - QMessageBox::critical(this, tr("QtiPlot - Help Files Not Found!"), - tr("Please indicate the location of the help file!")+"
"+ - tr("The manual can be downloaded from the following internet address:")+ - "

http://soft.proindependent.com/manuals.html

"); - QString fn = getFileName(this, tr("QtiPlot - Help Files Not Found!"), QDir::currentDirPath(), "*.html", 0, false); - if (!fn.isEmpty()){ - QFileInfo fi(fn); - helpFilePath = fi.absFilePath(); - saveSettings(); - } - } - - QFileInfo fi(helpFilePath); - QString profilePath = QString(fi.dirPath(true)+"/qtiplot.adp"); - if (!QFile(profilePath).exists()) - { - QMessageBox::critical(this,tr("QtiPlot - Help Profile Not Found!"), - tr("The assistant could not start because the file %1 was not found in the help file directory!").arg("qtiplot.adp")+"
"+ - tr("This file is provided with the QtiPlot manual which can be downloaded from the following internet address:")+ - "

http://soft.proindependent.com/manuals.html

"); - return; - } - - QStringList cmdLst = QStringList() << "-profile" << profilePath; - assistant->setArguments( cmdLst ); - assistant->showPage(helpFilePath); -} - -void ApplicationWindow::showPlotWizard() -{ - QStringList lst = tableNames(); - if (lst.count() > 0){ - PlotWizard* pw = new PlotWizard(this, 0); - pw->setAttribute(Qt::WA_DeleteOnClose); - connect (pw,SIGNAL(plot(const QStringList&)),this,SLOT(multilayerPlot(const QStringList&))); - - pw->insertTablesList(lst); - pw->setColumnsList(columnsList(Table::All)); - pw->changeColumnsList(lst[0]); - pw->exec(); - } else - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no tables available in this project.

" - "

Please create a table and try again!

")); -} - -void ApplicationWindow::setCurveFullRange() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph* g = plot->activeLayer(); - if (!g) - return; - - g->setCurveFullRange(actionCurveFullRange->data().toInt()); -} - -void ApplicationWindow::showCurveRangeDialog() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph* g = plot->activeLayer(); - if (!g) - return; - - showCurveRangeDialog(g, actionEditCurveRange->data().toInt()); -} - -CurveRangeDialog* ApplicationWindow::showCurveRangeDialog(Graph *g, int curve) -{ - if (!g) - return 0; - - CurveRangeDialog* crd = new CurveRangeDialog(this); - crd->setAttribute(Qt::WA_DeleteOnClose); - crd->setCurveToModify(g, curve); - crd->exec(); - return crd; -} - -FunctionDialog* ApplicationWindow::showFunctionDialog() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return 0; - - Graph* g = plot->activeLayer(); - if (!g) - return 0; - - return showFunctionDialog(g, actionEditFunction->data().toInt()); -} - -FunctionDialog* ApplicationWindow::showFunctionDialog(Graph *g, int curve) -{ - if ( !g ) - return 0; - - FunctionDialog* fd = functionDialog(); - fd->setWindowTitle(tr("QtiPlot - Edit function")); - fd->setCurveToModify(g, curve); - return fd; -} - -FunctionDialog* ApplicationWindow::functionDialog() -{ - FunctionDialog* fd = new FunctionDialog(this); - connect (fd,SIGNAL(clearParamFunctionsList()),this,SLOT(clearParamFunctionsList())); - connect (fd,SIGNAL(clearPolarFunctionsList()),this,SLOT(clearPolarFunctionsList())); - - fd->insertParamFunctionsList(xFunctions, yFunctions); - fd->insertPolarFunctionsList(rFunctions, thetaFunctions); - fd->setModal(true); - fd->show(); - fd->setActiveWindow(); - return fd; -} - -void ApplicationWindow::addFunctionCurve() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - if (plot->isEmpty()){ - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

" - "

Please add a layer and try again!

")); - return; - } - - Graph* g = plot->activeLayer(); - if ( g ) { - FunctionDialog* fd = functionDialog(); - if (fd) - fd->setGraph(g); - } -} - -void ApplicationWindow::updateFunctionLists(int type, QStringList &formulas) -{ - int maxListSize = 10; - if (type == 2) - { - rFunctions.remove(formulas[0]); - rFunctions.push_front(formulas[0]); - - thetaFunctions.remove(formulas[1]); - thetaFunctions.push_front(formulas[1]); - - while ((int)rFunctions.size() > maxListSize) - rFunctions.pop_back(); - while ((int)thetaFunctions.size() > maxListSize) - thetaFunctions.pop_back(); - } - else if (type == 1) - { - xFunctions.remove(formulas[0]); - xFunctions.push_front(formulas[0]); - - yFunctions.remove(formulas[1]); - yFunctions.push_front(formulas[1]); - - while ((int)xFunctions.size() > maxListSize) - xFunctions.pop_back(); - while ((int)yFunctions.size() > maxListSize) - yFunctions.pop_back(); - } -} - -MultiLayer * ApplicationWindow::newFunctionPlot(QStringList &formulas, double start, double end, int points, const QString& var, int type) -{ - MultiLayer *ml = newGraph(); - if (ml) - ml->activeLayer()->addFunction(formulas, start, end, points, var, type); - - updateFunctionLists(type, formulas); - return ml; -} - -void ApplicationWindow::clearLogInfo() -{ - if (!current_folder->logInfo().isEmpty()){ - current_folder->clearLogInfo(); - results->setText(""); - emit modified(); - } -} - -void ApplicationWindow::clearParamFunctionsList() -{ - xFunctions.clear(); - yFunctions.clear(); -} - -void ApplicationWindow::clearPolarFunctionsList() -{ - rFunctions.clear(); - thetaFunctions.clear(); -} - -void ApplicationWindow::clearSurfaceFunctionsList() -{ - surfaceFunc.clear(); -} - -void ApplicationWindow::setFramed3DPlot() -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setFramed(); - actionShowAxisDialog->setEnabled(TRUE); -} - -void ApplicationWindow::setBoxed3DPlot() -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setBoxed(); - actionShowAxisDialog->setEnabled(TRUE); -} - -void ApplicationWindow::removeAxes3DPlot() -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setNoAxes(); - actionShowAxisDialog->setEnabled(false); -} - -void ApplicationWindow::removeGrid3DPlot() -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setPolygonStyle(); -} - -void ApplicationWindow::setHiddenLineGrid3DPlot() -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setHiddenLineStyle(); -} - -void ApplicationWindow::setPoints3DPlot() -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setDotStyle(); -} - -void ApplicationWindow::setCones3DPlot() -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setConeStyle(); -} - -void ApplicationWindow::setCrosses3DPlot() -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setCrossStyle(); -} - -void ApplicationWindow::setBars3DPlot() -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setBarStyle(); -} - -void ApplicationWindow::setLineGrid3DPlot() -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setWireframeStyle(); -} - -void ApplicationWindow::setFilledMesh3DPlot() -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setFilledMeshStyle(); -} - -void ApplicationWindow::setFloorData3DPlot() -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setFloorData(); -} - -void ApplicationWindow::setFloorIso3DPlot() -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setFloorIsolines(); -} - -void ApplicationWindow::setEmptyFloor3DPlot() -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setEmptyFloor(); -} - -void ApplicationWindow::setFrontGrid3DPlot(bool on) -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setFrontGrid(on); -} - -void ApplicationWindow::setBackGrid3DPlot(bool on) -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setBackGrid(on); -} - -void ApplicationWindow::setFloorGrid3DPlot(bool on) -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setFloorGrid(on); -} - -void ApplicationWindow::setCeilGrid3DPlot(bool on) -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setCeilGrid(on); -} - -void ApplicationWindow::setRightGrid3DPlot(bool on) -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setRightGrid(on); -} - -void ApplicationWindow::setLeftGrid3DPlot(bool on) -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setLeftGrid(on); -} - -void ApplicationWindow::pickPlotStyle( QAction* action ) -{ - if (!action ) - return; - - if (action == polygon) - removeGrid3DPlot(); - else if (action == filledmesh) - setFilledMesh3DPlot(); - else if (action == wireframe) - setLineGrid3DPlot(); - else if (action == hiddenline) - setHiddenLineGrid3DPlot(); - else if (action == pointstyle) - setPoints3DPlot(); - else if (action == conestyle) - setCones3DPlot(); - else if (action == crossHairStyle) - setCrosses3DPlot(); - else if (action == barstyle) - setBars3DPlot(); - - emit modified(); -} - - -void ApplicationWindow::pickCoordSystem( QAction* action) -{ - if (!action) - return; - - if (action == Box || action == Frame) - { - if (action == Box) - setBoxed3DPlot(); - if (action == Frame) - setFramed3DPlot(); - grids->setEnabled(true); - } - else if (action == None) - { - removeAxes3DPlot(); - grids->setEnabled(false); - } - - emit modified(); -} - -void ApplicationWindow::pickFloorStyle( QAction* action ) -{ - if (!action) - return; - - if (action == floordata) - setFloorData3DPlot(); - else if (action == flooriso) - setFloorIso3DPlot(); - else - setEmptyFloor3DPlot(); - - emit modified(); -} - -void ApplicationWindow::custom3DActions(QMdiSubWindow *w) -{ - if (w && w->isA("Graph3D")) - { - Graph3D* plot = (Graph3D*)w; - actionAnimate->setOn(plot->isAnimated()); - actionPerspective->setOn(!plot->isOrthogonal()); - switch(plot->plotStyle()) - { - case FILLEDMESH: - wireframe->setChecked( false ); - hiddenline->setChecked( false ); - polygon->setChecked( false ); - filledmesh->setChecked( true ); - pointstyle->setChecked( false ); - barstyle->setChecked( false ); - conestyle->setChecked( false ); - crossHairStyle->setChecked( false ); - break; - - case FILLED: - wireframe->setChecked( false ); - hiddenline->setChecked( false ); - polygon->setChecked( true ); - filledmesh->setChecked( false ); - pointstyle->setChecked( false ); - barstyle->setChecked( false ); - conestyle->setChecked( false ); - crossHairStyle->setChecked( false ); - break; - - case Qwt3D::USER: - wireframe->setChecked( false ); - hiddenline->setChecked( false ); - polygon->setChecked( false ); - filledmesh->setChecked( false ); - - if (plot->pointType() == Graph3D::VerticalBars) - { - pointstyle->setChecked( false ); - conestyle->setChecked( false ); - crossHairStyle->setChecked( false ); - barstyle->setChecked( true ); - } - else if (plot->pointType() == Graph3D::Dots) - { - pointstyle->setChecked( true ); - barstyle->setChecked( false ); - conestyle->setChecked( false ); - crossHairStyle->setChecked( false ); - } - else if (plot->pointType() == Graph3D::HairCross) - { - pointstyle->setChecked( false ); - barstyle->setChecked( false ); - conestyle->setChecked( false ); - crossHairStyle->setChecked( true ); - } - else if (plot->pointType() == Graph3D::Cones) - { - pointstyle->setChecked( false ); - barstyle->setChecked( false ); - conestyle->setChecked( true ); - crossHairStyle->setChecked( false ); - } - break; - - case WIREFRAME: - wireframe->setChecked( true ); - hiddenline->setChecked( false ); - polygon->setChecked( false ); - filledmesh->setChecked( false ); - pointstyle->setChecked( false ); - barstyle->setChecked( false ); - conestyle->setChecked( false ); - crossHairStyle->setChecked( false ); - break; - - case HIDDENLINE: - wireframe->setChecked( false ); - hiddenline->setChecked( true ); - polygon->setChecked( false ); - filledmesh->setChecked( false ); - pointstyle->setChecked( false ); - barstyle->setChecked( false ); - conestyle->setChecked( false ); - crossHairStyle->setChecked( false ); - break; - - default: - break; - } - - switch(plot->coordStyle()) - { - case Qwt3D::NOCOORD: - None->setChecked( true ); - Box->setChecked( false ); - Frame->setChecked( false ); - break; - - case Qwt3D::BOX: - None->setChecked( false ); - Box->setChecked( true ); - Frame->setChecked( false ); - break; - - case Qwt3D::FRAME: - None->setChecked(false ); - Box->setChecked( false ); - Frame->setChecked(true ); - break; - } - - switch(plot->floorStyle()) - { - case NOFLOOR: - floornone->setChecked( true ); - flooriso->setChecked( false ); - floordata->setChecked( false ); - break; - - case FLOORISO: - floornone->setChecked( false ); - flooriso->setChecked( true ); - floordata->setChecked( false ); - break; - - case FLOORDATA: - floornone->setChecked(false ); - flooriso->setChecked( false ); - floordata->setChecked(true ); - break; - } - custom3DGrids(plot->grids()); - } -} - -void ApplicationWindow::custom3DGrids(int grids) -{ - if (Qwt3D::BACK & grids) - back->setChecked(true); - else - back->setChecked(false); - - if (Qwt3D::FRONT & grids) - front->setChecked(true); - else - front->setChecked(false); - - if (Qwt3D::CEIL & grids) - ceil->setChecked(true); - else - ceil->setChecked(false); - - if (Qwt3D::FLOOR & grids) - floor->setChecked(true); - else - floor->setChecked(false); - - if (Qwt3D::RIGHT & grids) - right->setChecked(true); - else - right->setChecked(false); - - if (Qwt3D::LEFT & grids) - left->setChecked(true); - else - left->setChecked(false); -} - -void ApplicationWindow::initPlot3DToolBar() -{ - plot3DTools = new QToolBar( tr( "3D Surface" ), this ); - plot3DTools->setObjectName("plot3DTools"); // this is needed for QMainWindow::restoreState() - plot3DTools->setIconSize( QSize(20,20) ); - addToolBarBreak( Qt::TopToolBarArea ); - addToolBar( Qt::TopToolBarArea, plot3DTools ); - - coord = new QActionGroup( this ); - Box = new QAction( coord ); - Box->setIcon(QIcon(QPixmap(box_xpm))); - Box->setCheckable(true); - - Frame = new QAction( coord ); - Frame->setIcon(QIcon(QPixmap(free_axes_xpm)) ); - Frame->setCheckable(true); - - None = new QAction( coord ); - None->setIcon(QIcon(QPixmap(no_axes_xpm)) ); - None->setCheckable(true); - - plot3DTools->addAction(Frame); - plot3DTools->addAction(Box); - plot3DTools->addAction(None); - Box->setChecked( true ); - - plot3DTools->addSeparator(); - - // grid actions - grids = new QActionGroup( this ); - grids->setEnabled( true ); - grids->setExclusive( false ); - front = new QAction( grids ); - front->setCheckable( true ); - front->setIcon(QIcon(QPixmap(frontGrid_xpm)) ); - back = new QAction( grids ); - back->setCheckable( true ); - back->setIcon(QIcon(QPixmap(backGrid_xpm))); - right = new QAction( grids ); - right->setCheckable( true ); - right->setIcon(QIcon(QPixmap(leftGrid_xpm)) ); - left = new QAction( grids ); - left->setCheckable( true ); - left->setIcon(QIcon(QPixmap(rightGrid_xpm))); - ceil = new QAction( grids ); - ceil->setCheckable( true ); - ceil->setIcon(QIcon(QPixmap(ceilGrid_xpm)) ); - floor = new QAction( grids ); - floor->setCheckable( true ); - floor->setIcon(QIcon(QPixmap(floorGrid_xpm)) ); - - plot3DTools->addAction(front); - plot3DTools->addAction(back); - plot3DTools->addAction(right); - plot3DTools->addAction(left); - plot3DTools->addAction(ceil); - plot3DTools->addAction(floor); - - plot3DTools->addSeparator(); - - actionPerspective = new QAction( this ); - actionPerspective->setToggleAction( TRUE ); - actionPerspective->setIconSet(QPixmap(perspective_xpm) ); - actionPerspective->addTo( plot3DTools ); - actionPerspective->setOn(!d_3D_orthogonal); - connect(actionPerspective, SIGNAL(toggled(bool)), this, SLOT(togglePerspective(bool))); - - actionResetRotation = new QAction( this ); - actionResetRotation->setToggleAction( false ); - actionResetRotation->setIconSet(QPixmap(reset_rotation_xpm)); - actionResetRotation->addTo( plot3DTools ); - connect(actionResetRotation, SIGNAL(activated()), this, SLOT(resetRotation())); - - actionFitFrame = new QAction( this ); - actionFitFrame->setToggleAction( false ); - actionFitFrame->setIconSet(QPixmap(fit_frame_xpm)); - actionFitFrame->addTo( plot3DTools ); - connect(actionFitFrame, SIGNAL(activated()), this, SLOT(fitFrameToLayer())); - - plot3DTools->addSeparator(); - - //plot style actions - plotstyle = new QActionGroup( this ); - wireframe = new QAction( plotstyle ); - wireframe->setCheckable( true ); - wireframe->setEnabled( true ); - wireframe->setIcon(QIcon(QPixmap(lineMesh_xpm)) ); - hiddenline = new QAction( plotstyle ); - hiddenline->setCheckable( true ); - hiddenline->setEnabled( true ); - hiddenline->setIcon(QIcon(QPixmap(grid_only_xpm)) ); - polygon = new QAction( plotstyle ); - polygon->setCheckable( true ); - polygon->setEnabled( true ); - polygon->setIcon(QIcon(QPixmap(no_grid_xpm))); - filledmesh = new QAction( plotstyle ); - filledmesh->setCheckable( true ); - filledmesh->setIcon(QIcon(QPixmap(grid_poly_xpm)) ); - pointstyle = new QAction( plotstyle ); - pointstyle->setCheckable( true ); - pointstyle->setIcon(QIcon(QPixmap(pointsMesh_xpm)) ); - - conestyle = new QAction( plotstyle ); - conestyle->setCheckable( true ); - conestyle->setIcon(QIcon(QPixmap(cones_xpm)) ); - - crossHairStyle = new QAction( plotstyle ); - crossHairStyle->setCheckable( true ); - crossHairStyle->setIcon(QIcon(QPixmap(crosses_xpm)) ); - - barstyle = new QAction( plotstyle ); - barstyle->setCheckable( true ); - barstyle->setIcon(QIcon(QPixmap(plot_bars_xpm)) ); - - plot3DTools->addAction(barstyle); - plot3DTools->addAction(pointstyle); - - plot3DTools->addAction(conestyle); - plot3DTools->addAction(crossHairStyle); - plot3DTools->addSeparator(); - - plot3DTools->addAction(wireframe); - plot3DTools->addAction(hiddenline); - plot3DTools->addAction(polygon); - plot3DTools->addAction(filledmesh); - filledmesh->setChecked( true ); - - plot3DTools->addSeparator(); - - //floor actions - floorstyle = new QActionGroup( this ); - floordata = new QAction( floorstyle ); - floordata->setCheckable( true ); - floordata->setIcon(QIcon(QPixmap(floor_xpm)) ); - flooriso = new QAction( floorstyle ); - flooriso->setCheckable( true ); - flooriso->setIcon(QIcon(QPixmap(isolines_xpm)) ); - floornone = new QAction( floorstyle ); - floornone->setCheckable( true ); - floornone->setIcon(QIcon(QPixmap(no_floor_xpm))); - - plot3DTools->addAction(floordata); - plot3DTools->addAction(flooriso); - plot3DTools->addAction(floornone); - floornone->setChecked( true ); - - plot3DTools->addSeparator(); - - actionAnimate = new QAction( this ); - actionAnimate->setToggleAction( true ); - actionAnimate->setIconSet(QPixmap(movie_xpm)); - plot3DTools->addAction(actionAnimate); - - plot3DTools->hide(); - - connect(actionAnimate, SIGNAL(toggled(bool)), this, SLOT(toggle3DAnimation(bool))); - connect( coord, SIGNAL( triggered( QAction* ) ), this, SLOT( pickCoordSystem( QAction* ) ) ); - connect( floorstyle, SIGNAL( triggered( QAction* ) ), this, SLOT( pickFloorStyle( QAction* ) ) ); - connect( plotstyle, SIGNAL( triggered( QAction* ) ), this, SLOT( pickPlotStyle( QAction* ) ) ); - - connect( left, SIGNAL( triggered( bool ) ), this, SLOT( setLeftGrid3DPlot(bool) )); - connect( right, SIGNAL( triggered( bool ) ), this, SLOT( setRightGrid3DPlot( bool ) ) ); - connect( ceil, SIGNAL( triggered( bool ) ), this, SLOT( setCeilGrid3DPlot( bool ) ) ); - connect( floor, SIGNAL( triggered( bool ) ), this, SLOT(setFloorGrid3DPlot( bool ) ) ); - connect( back, SIGNAL( triggered( bool ) ), this, SLOT(setBackGrid3DPlot( bool ) ) ); - connect( front, SIGNAL( triggered( bool ) ), this, SLOT( setFrontGrid3DPlot( bool ) ) ); -} - -void ApplicationWindow::pixelLineProfile() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph* g = plot->activeLayer(); - if (!g) - return; - - bool ok; - int res = QInputDialog::getInteger( - tr("QtiPlot - Set the number of pixels to average"), tr("Number of averaged pixels"),1, 1, 2000, 2, - &ok, this ); - if ( !ok ) - return; - - LineProfileTool *lpt = new LineProfileTool(g, this, res); - g->setActiveTool(lpt); -} - -void ApplicationWindow::intensityTable() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph* g = plot->activeLayer(); - if (g){ - ImageWidget *im = qobject_cast(g->activeEnrichment()); - if (im){ - QString fn = im->fileName(); - if (!fn.isEmpty()) - importImage(fn); - } - } -} - -void ApplicationWindow::autoArrangeLayers() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - if (plot->isWaterfallPlot()) - plot->updateWaterfallLayout(); - else { - plot->setMargins(5, 5, 5, 5); - plot->setSpacing(5, 5); - plot->arrangeLayers(true, false); - } -} - -void ApplicationWindow::extractGraphs() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - if (plot->numLayers() < 2){ - QMessageBox::critical(this, tr("QtiPlot - Error"), - tr("You must have more than one layer in the active window!")); - return; - } - - QList lst = plot->layersList(); - foreach(Graph *g, lst){ - MultiLayer *nw = multilayerPlot(generateUniqueName(tr("Graph")), 0, plot->getRows(), plot->getCols()); - nw->resize(plot->size()); - Graph *ng = nw->addLayer(g->pos().x(), g->pos().y(), g->width(), g->height()); - if (ng) - ng->copy(g); - } -} - -void ApplicationWindow::extractLayers() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph *g = plot->activeLayer(); - if (!g) - return; - - int curves = g->curveCount(); - if (curves < 2){ - QMessageBox::critical(this, tr("QtiPlot - Error"), - tr("You must have more than one dataset in the active layer!")); - return; - } - - for(int i = 0; i < curves; i++){ - Graph *ng = plot->addLayer(g->pos().x(), g->pos().y(), g->width(), g->height()); - if (ng){ - ng->copy(g); - for(int j = 0; j < curves; j++){ - if (j != i) - ng->removeCurve(j); - } - } - } - plot->removeLayer(g); - plot->arrangeLayers(true, false); -} - -void ApplicationWindow::addInsetLayer(bool curves) -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph *al = plot->activeLayer(); - if (!al) - return; - - QRect r = al->geometry(); - Graph *g = plot->addLayer(r.x() + r.width()/2, al->canvas()->y(), r.width()/2, r.height()/2); - if (g){ - setPreferences(g); - - g->setTitle(""); - g->setAxisTitle(QwtPlot::xBottom, ""); - g->setAxisTitle(QwtPlot::yLeft, ""); - g->enableAxis(QwtPlot::yRight, false); - g->enableAxis(QwtPlot::xTop, false); - - QColor c = Qt::white; - c.setAlpha(0); - g->setBackgroundColor(c); - g->setCanvasBackground(c); - if (curves) - g->copyCurves(al); - } -} - -void ApplicationWindow::addInsetCurveLayer() -{ - addInsetLayer(true); -} - -void ApplicationWindow::addLayer() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - if (plot->numLayers() == 0){ - setPreferences(plot->addLayer()); - return; - } - - switch(QMessageBox::information(this, - tr("QtiPlot - Guess best origin for the new layer?"), - tr("Do you want QtiPlot to guess the best position for the new layer?\n Warning: this will rearrange existing layers!"), - tr("&Guess"), tr("&Top-left corner"), tr("&Cancel"), 0, 2 ) ){ - case 0: - setPreferences(plot->addLayer()); - plot->arrangeLayers(true, false); - break; - - case 1: - setPreferences(plot->addLayer(0, 0, plot->canvasRect().width(), plot->canvasRect().height())); - break; - - case 2: - return; - break; - } -} - -void ApplicationWindow::deleteLayer() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - plot->confirmRemoveLayer(); -} - -Note* ApplicationWindow::openNote(ApplicationWindow* app, const QStringList &flist) -{ - QStringList lst = flist[0].split("\t", QString::SkipEmptyParts); - QString caption = lst[0]; - Note* w = app->newNote(caption); - if (lst.count() == 2){ - app->setListViewDate(caption, lst[1]); - w->setBirthDate(lst[1]); - } - restoreWindowGeometry(app, w, flist[1]); - - lst=flist[2].split("\t"); - w->setWindowLabel(lst[1]); - w->setCaptionPolicy((MdiSubWindow::CaptionPolicy)lst[2].toInt()); - return w; -} - -Matrix* ApplicationWindow::openMatrix(ApplicationWindow* app, const QStringList &flist) -{ - QStringList::const_iterator line = flist.begin(); - - QStringList list=(*line).split("\t"); - QString caption=list[0]; - int rows = list[1].toInt(); - int cols = list[2].toInt(); - - Matrix* w = app->newMatrix(caption, rows, cols); - app->setListViewDate(caption,list[3]); - w->setBirthDate(list[3]); - - for (line++; line!=flist.end(); line++) - { - QStringList fields = (*line).split("\t"); - if (fields[0] == "geometry") { - restoreWindowGeometry(app, w, *line); - } else if (fields[0] == "ColWidth") { - w->setColumnsWidth(fields[1].toInt()); - } else if (fields[0] == "Formula") { - w->setFormula(fields[1]); - } else if (fields[0] == "") { - QString formula; - for (line++; line!=flist.end() && *line != ""; line++) - formula += *line + "\n"; - formula.truncate(formula.length()-1); - w->setFormula(formula); - } else if (fields[0] == "TextFormat") { - if (fields[1] == "f") - w->setTextFormat('f', fields[2].toInt()); - else - w->setTextFormat('e', fields[2].toInt()); - } else if (fields[0] == "WindowLabel") { // d_file_version > 71 - w->setWindowLabel(fields[1]); - w->setCaptionPolicy((MdiSubWindow::CaptionPolicy)fields[2].toInt()); - } else if (fields[0] == "Coordinates") { // d_file_version > 81 - w->setCoordinates(fields[1].toDouble(), fields[2].toDouble(), fields[3].toDouble(), fields[4].toDouble()); - } else if (fields[0] == "ViewType") { // d_file_version > 90 - w->setViewType((Matrix::ViewType)fields[1].toInt()); - } else if (fields[0] == "HeaderViewType") { // d_file_version > 90 - w->setHeaderViewType((Matrix::HeaderViewType)fields[1].toInt()); - } else if (fields[0] == "ColorPolicy"){// d_file_version > 90 - w->setColorMapType((Matrix::ColorMapType)fields[1].toInt()); - } else if (fields[0] == ""){// d_file_version > 90 - QStringList lst; - while ( *line != "" ){ - line++; - lst << *line; - } - lst.pop_back(); - w->setColorMap(lst); - } else // or values - break; - } - if (*line == "") line++; - - //read and set table values - for (; line!=flist.end() && *line != ""; line++){ - QStringList fields = (*line).split("\t"); - int row = fields[0].toInt(); - for (int col=0; colsetCell(row, col, QLocale::c().toDouble(cell)); - else if (d_file_version == 90) - w->setText(row, col, cell); - else - w->setCell(row, col, cell.toDouble()); - } - qApp->processEvents(QEventLoop::ExcludeUserInput); - } - w->resetView(); - return w; -} - -Table* ApplicationWindow::openTable(ApplicationWindow* app, const QStringList &flist) -{ - QStringList::const_iterator line = flist.begin(); - - QStringList list = (*line).split("\t"); - QString caption = list[0]; - int rows = list[1].toInt(); - int cols = list[2].toInt(); - - Table* w = app->newTable(caption, rows, cols); - app->setListViewDate(caption, list[3]); - w->setBirthDate(list[3]); - - for (line++; line!=flist.end(); line++) - { - QStringList fields = (*line).split("\t"); - if (fields[0] == "geometry" || fields[0] == "tgeometry") { - restoreWindowGeometry(app, w, *line); - } else if (fields[0] == "header") { - fields.pop_front(); - if (d_file_version >= 78) - w->loadHeader(fields); - else - { - w->setColPlotDesignation(list[4].toInt(), Table::X); - w->setColPlotDesignation(list[6].toInt(), Table::Y); - w->setHeader(fields); - } - } else if (fields[0] == "ColWidth") { - fields.pop_front(); - w->setColWidths(fields); - } else if (fields[0] == "com") { // legacy code - w->setCommands(*line); - } else if (fields[0] == "") { - for (line++; line!=flist.end() && *line != ""; line++) - { - int col = (*line).mid(9,(*line).length()-11).toInt(); - QString formula; - for (line++; line!=flist.end() && *line != ""; line++) - formula += *line + "\n"; - formula.truncate(formula.length()-1); - w->setCommand(col,formula); - } - } else if (fields[0] == "ColType") { // d_file_version > 65 - fields.pop_front(); - w->setColumnTypes(fields); - } else if (fields[0] == "Comments") { // d_file_version > 71 - fields.pop_front(); - w->setColComments(fields); - w->setHeaderColType(); - } else if (fields[0] == "WindowLabel") { // d_file_version > 71 - w->setWindowLabel(fields[1]); - w->setCaptionPolicy((MdiSubWindow::CaptionPolicy)fields[2].toInt()); - } else if (fields[0] == "ReadOnlyColumn") { // d_file_version > 91 - fields.pop_front(); - for (int i=0; i < w->numCols(); i++) - w->setReadOnlyColumn(i, fields[i] == "1"); - } else if (fields[0] == "HiddenColumn") { // d_file_version >= 93 - fields.pop_front(); - for (int i=0; i < w->numCols(); i++) - w->hideColumn(i, fields[i] == "1"); - } else // or values - break; - } - - QApplication::setOverrideCursor(Qt::WaitCursor); - w->table()->blockSignals(true); - for (line++; line!=flist.end() && *line != ""; line++) - {//read and set table values - QStringList fields = (*line).split("\t"); - int row = fields[0].toInt(); - for (int col=0; col= col+2){ - QString cell = fields[col+1]; - if (cell.isEmpty()) - continue; - - if (w->columnType(col) == Table::Numeric){ - if (d_file_version < 90) - w->setCell(row, col, QLocale::c().toDouble(cell.replace(",", "."))); - else if (d_file_version == 90) - w->setText(row, col, cell); - else if (d_file_version >= 91) - w->setCell(row, col, cell.toDouble()); - } else - w->setText(row, col, cell); - } - } - QApplication::processEvents(QEventLoop::ExcludeUserInput); - } - QApplication::restoreOverrideCursor(); - -// w->setSpecifications(w->saveToString("geometry\n")); - w->table()->blockSignals(false); - return w; -} - -TableStatistics* ApplicationWindow::openTableStatistics(const QStringList &flist) -{ - QStringList::const_iterator line = flist.begin(); - - QStringList list=(*line++).split("\t"); - QString caption=list[0]; - - QList targets; - for (int i=1; i <= (*line).count('\t'); i++) - targets << (*line).section('\t',i,i).toInt(); - - TableStatistics* w = newTableStatistics(table(list[1]), - list[2]=="row" ? TableStatistics::row : TableStatistics::column, targets, caption); - - setListViewDate(caption,list[3]); - w->setBirthDate(list[3]); - - for (line++; line!=flist.end(); line++){ - QStringList fields = (*line).split("\t"); - if (fields[0] == "geometry"){ - restoreWindowGeometry(this, w, *line);} - else if (fields[0] == "header"){ - fields.pop_front(); - - if (w->numCols() != fields.size()) - w->setNumCols(fields.size()); - - if (d_file_version >= 78) - w->loadHeader(fields); - else { - w->setColPlotDesignation(list[4].toInt(), Table::X); - w->setColPlotDesignation(list[6].toInt(), Table::Y); - w->setHeader(fields); - } - } else if (fields[0] == "ColWidth") { - fields.pop_front(); - w->setColWidths(fields); - } else if (fields[0] == "com") { // legacy code - w->setCommands(*line); - } else if (fields[0] == "") { - for (line++; line!=flist.end() && *line != ""; line++) - { - int col = (*line).mid(9,(*line).length()-11).toInt(); - QString formula; - for (line++; line!=flist.end() && *line != ""; line++) - formula += *line + "\n"; - formula.truncate(formula.length()-1); - w->setCommand(col,formula); - } - } else if (fields[0] == "ColType") { // d_file_version > 65 - fields.pop_front(); - w->setColumnTypes(fields); - } else if (fields[0] == "Comments") { // d_file_version > 71 - fields.pop_front(); - w->setColComments(fields); - } else if (fields[0] == "WindowLabel") { // d_file_version > 71 - w->setWindowLabel(fields[1]); - w->setCaptionPolicy((MdiSubWindow::CaptionPolicy)fields[2].toInt()); - } - } - return w; -} - -Graph* ApplicationWindow::openGraph(ApplicationWindow* app, MultiLayer *plot, - const QStringList &list) -{ - Graph* ag = 0; - int curveID = 0; - for (int j=0;j<(int)list.count()-1;j++){ - QString s=list[j]; - if (s.contains ("ggeometry")){ - QStringList fList = s.split("\t"); - ag = (Graph*)plot->addLayer(fList[1].toInt(), fList[2].toInt(), - fList[3].toInt(), fList[4].toInt()); - ag->blockSignals(true); - ag->enableAutoscaling(autoscale2DPlots); - } - else if (s.left(10) == "Background"){ - QStringList fList = s.split("\t"); - QColor c = QColor(fList[1]); - if (fList.count() == 3) - c.setAlpha(fList[2].toInt()); - ag->setBackgroundColor(c); - } - else if (s.contains ("Margin")){ - QStringList fList=s.split("\t"); - ag->setMargin(fList[1].toInt()); - } - else if (s.contains ("Border")){ - QStringList fList=s.split("\t"); - ag->setFrame(fList[1].toInt(), QColor(fList[2])); - } - else if (s.contains ("EnabledAxes")){ - QStringList fList=s.split("\t"); - fList.pop_front(); - for (int i=0; i<(int)fList.count(); i++) - ag->enableAxis(i, fList[i].toInt()); - } - else if (s.contains ("AxesBaseline")){ - QStringList fList = s.split("\t", QString::SkipEmptyParts); - fList.pop_front(); - for (int i=0; i<(int)fList.count(); i++) - ag->setAxisMargin(i, fList[i].toInt()); - } - else if (s.contains ("EnabledTicks")) - {//version < 0.8.6 - QStringList fList=s.split("\t"); - fList.pop_front(); - fList.replaceInStrings("-1", "3"); - ag->setMajorTicksType(fList); - ag->setMinorTicksType(fList); - } - else if (s.contains ("MajorTicks")) - {//version >= 0.8.6 - QStringList fList=s.split("\t"); - fList.pop_front(); - ag->setMajorTicksType(fList); - } - else if (s.contains ("MinorTicks")) - {//version >= 0.8.6 - QStringList fList=s.split("\t"); - fList.pop_front(); - ag->setMinorTicksType(fList); - } - else if (s.contains ("TicksLength")){ - QStringList fList=s.split("\t"); - ag->setTicksLength(fList[1].toInt(), fList[2].toInt()); - } - else if (s.contains ("EnabledTickLabels")){ - QStringList fList=s.split("\t"); - fList.pop_front(); - for (int i=0; ienableAxisLabels(i, fList[i].toInt()); - } - else if (s.contains ("AxesColors")){ - QStringList fList = s.split("\t"); - fList.pop_front(); - for (int i=0; isetAxisColor(i, QColor(fList[i])); - } - else if (s.contains ("AxesNumberColors")){ - QStringList fList=QStringList::split ("\t",s,TRUE); - fList.pop_front(); - for (int i=0; isetAxisLabelsColor(i, QColor(fList[i])); - } - else if (s.left(5)=="grid\t"){ - ag->grid()->load(s.split("\t")); - } - else if (s.startsWith ("") && s.endsWith ("")){ - bool antialiasing = s.remove("").remove("").toInt(); - ag->setAntialiasing(antialiasing); - } - else if (s.contains ("PieCurve")){ - QStringList curve=s.split("\t"); - if (!app->renamedTables.isEmpty()){ - QString caption = (curve[1]).left((curve[1]).find("_",0)); - if (app->renamedTables.contains(caption)) - {//modify the name of the curve according to the new table name - int index = app->renamedTables.findIndex(caption); - QString newCaption = app->renamedTables[++index]; - curve.replaceInStrings(caption+"_", newCaption+"_"); - } - } - QPen pen = QPen(QColor(curve[3]), curve[2].toDouble(),Graph::getPenStyle(curve[4])); - - Table *table = app->table(curve[1]); - if (table){ - int startRow = 0; - int endRow = table->numRows() - 1; - int first_color = curve[7].toInt(); - bool visible = true; - if (d_file_version >= 90){ - startRow = curve[8].toInt(); - endRow = curve[9].toInt(); - visible = curve[10].toInt(); - } - - if (d_file_version <= 89) - first_color = convertOldToNewColorIndex(first_color); - - if (curve.size() >= 22){//version 0.9.3-rc3 - ag->plotPie(table, curve[1], pen, curve[5].toInt(), - curve[6].toInt(), first_color, startRow, endRow, visible, - curve[11].toDouble(), curve[12].toDouble(), curve[13].toDouble(), - curve[14].toDouble(), curve[15].toDouble(), curve[16].toInt(), - curve[17].toInt(), curve[18].toInt(), curve[19].toInt(), - curve[20].toInt(), curve[21].toInt()); - } else - ag->plotPie(table, curve[1], pen, curve[5].toInt(), - curve[6].toInt(), first_color, startRow, endRow, visible); - } - }else if (s.left(6)=="curve\t"){ - QStringList curve = s.split("\t", QString::SkipEmptyParts); - if (!app->renamedTables.isEmpty()){ - QString caption = (curve[2]).left((curve[2]).find("_",0)); - if (app->renamedTables.contains(caption)) - {//modify the name of the curve according to the new table name - int index = app->renamedTables.findIndex (caption); - QString newCaption = app->renamedTables[++index]; - curve.replaceInStrings(caption+"_", newCaption+"_"); - } - } - - CurveLayout cl; - cl.connectType=curve[4].toInt(); - cl.lCol = readColorFromProject(curve[5]); - cl.lStyle = curve[6].toInt(); - cl.lWidth = curve[7].toDouble(); - cl.sSize = curve[8].toInt(); - if (d_file_version <= 78) - cl.sType=Graph::obsoleteSymbolStyle(curve[9].toInt()); - else - cl.sType=curve[9].toInt(); - - cl.symCol = readColorFromProject(curve[10]); - cl.fillCol = readColorFromProject(curve[11]); - cl.filledArea = curve[12].toInt(); - cl.aCol = readColorFromProject(curve[13]); - cl.aStyle = curve[14].toInt(); - if(curve.count() < 16) - cl.penWidth = cl.lWidth; - else if ((d_file_version >= 79) && (curve[3].toInt() == Graph::Box)) - cl.penWidth = curve[15].toDouble(); - else if ((d_file_version >= 78) && (curve[3].toInt() <= Graph::LineSymbols)) - cl.penWidth = curve[15].toDouble(); - else - cl.penWidth = cl.lWidth; - - int plotType = curve[3].toInt(); - Table *w = app->table(curve[2]); - PlotCurve *c = NULL; - if (w){ - if(plotType == Graph::VectXYXY || plotType == Graph::VectXYAM){ - QStringList colsList; - colsList<colName(curve[1].toInt())); - else - colsList.prepend(curve[1]); - - int startRow = 0; - int endRow = -1; - if (d_file_version >= 90){ - startRow = curve[curve.count()-3].toInt(); - endRow = curve[curve.count()-2].toInt(); - } - - c = (PlotCurve *)ag->plotVectorCurve(w, colsList, plotType, startRow, endRow); - - if (d_file_version <= 77){ - int temp_index = convertOldToNewColorIndex(curve[15].toInt()); - ag->updateVectorsLayout(curveID, ColorBox::color(temp_index), curve[16].toDouble(), curve[17].toInt(), - curve[18].toInt(), curve[19].toInt(), 0, curve[20], curve[21]); - } else { - if(plotType == Graph::VectXYXY) - ag->updateVectorsLayout(curveID, curve[15], curve[16].toDouble(), - curve[17].toInt(), curve[18].toInt(), curve[19].toInt(), 0); - else - ag->updateVectorsLayout(curveID, curve[15], curve[16].toDouble(), curve[17].toInt(), - curve[18].toInt(), curve[19].toInt(), curve[22].toInt()); - } - } else if (plotType == Graph::Box) - c = (PlotCurve *)ag->openBoxDiagram(w, curve, d_file_version); - else { - if (d_file_version < 72) - c = (PlotCurve *)ag->insertCurve(w, curve[1].toInt(), curve[2], plotType); - else if (d_file_version < 90) - c = (PlotCurve *)ag->insertCurve(w, curve[1], curve[2], plotType); - else { - int startRow = curve[curve.count()-3].toInt(); - int endRow = curve[curve.count()-2].toInt(); - c = (PlotCurve *)ag->insertCurve(w, curve[1], curve[2], plotType, startRow, endRow); - } - } - - if(plotType == Graph::Histogram){ - QwtHistogram *h = (QwtHistogram *)ag->curve(curveID); - if (d_file_version <= 76) - h->setBinning(curve[16].toInt(),curve[17].toDouble(),curve[18].toDouble(),curve[19].toDouble()); - else - h->setBinning(curve[17].toInt(),curve[18].toDouble(),curve[19].toDouble(),curve[20].toDouble()); - h->loadData(); - } - - if(plotType == Graph::VerticalBars || plotType == Graph::HorizontalBars || - plotType == Graph::Histogram){ - if (d_file_version <= 76) - ag->setBarsGap(curveID, curve[15].toInt(), 0); - else - ag->setBarsGap(curveID, curve[15].toInt(), curve[16].toInt()); - } - ag->updateCurveLayout(c, &cl); - if (d_file_version >= 88){ - if (c && c->rtti() == QwtPlotItem::Rtti_PlotCurve){ - if (d_file_version < 90) - c->setAxis(curve[curve.count()-2].toInt(), curve[curve.count()-1].toInt()); - else { - c->setAxis(curve[curve.count()-5].toInt(), curve[curve.count()-4].toInt()); - c->setVisible(curve.last().toInt()); - } - } - } - } else if(plotType == Graph::Histogram){//histograms from matrices - Matrix *m = app->matrix(curve[2]); - QwtHistogram *h = ag->restoreHistogram(m, curve); - ag->updateCurveLayout(h, &cl); - } - curveID++; - } else if (s == ""){ - QStringList lst; - while ( s!="" ){ - s = list[++j]; - lst << s; - } - lst.pop_back(); - ag->restoreCurveLabels(curveID - 1, lst); - } else if (s.contains("")){ - PlotCurve *c = (PlotCurve *)ag->curve(curveID - 1); - if (c) - c->setSkipSymbolsCount(s.remove("").remove("").toInt()); - } else if (s.contains("")){ - QwtBarCurve *b = (QwtBarCurve *)ag->curve(curveID - 1); - if (b) - b->setWhiteOut(); - } else if (s == ""){//version 0.9.5 - curveID++; - QStringList lst; - while ( s != "" ){ - s = list[++j]; - lst << s; - } - lst.pop_back(); - FunctionCurve::restore(ag, lst); - } else if (s.contains ("FunctionCurve")){ - QStringList curve = s.split("\t"); - CurveLayout cl; - cl.connectType = curve[6].toInt(); - cl.lCol = readColorFromProject(curve[7]); - cl.lStyle = curve[8].toInt(); - cl.lWidth=curve[9].toDouble(); - cl.sSize=curve[10].toInt(); - cl.sType=curve[11].toInt(); - cl.symCol = readColorFromProject(curve[12]); - cl.fillCol = readColorFromProject(curve[13]); - cl.filledArea=curve[14].toInt(); - cl.aCol = readColorFromProject(curve[15]); - cl.aStyle=curve[16].toInt(); - int current_index = 17; - if(curve.count() < 16) - cl.penWidth = cl.lWidth; - else if ((d_file_version >= 79) && (curve[5].toInt() == Graph::Box)) - { - cl.penWidth = curve[17].toDouble(); - current_index++; - } - else if ((d_file_version >= 78) && (curve[5].toInt() <= Graph::LineSymbols)) - { - cl.penWidth = curve[17].toDouble(); - current_index++; - } - else - cl.penWidth = cl.lWidth; - - PlotCurve *c = (PlotCurve *)ag->insertFunctionCurve(curve[1], curve[2].toInt(), d_file_version); - c->setPlotStyle(curve[5].toInt()); - ag->updateCurveLayout(c, &cl); - if (d_file_version >= 88){ - QwtPlotCurve *c = ag->curve(curveID); - if (c){ - if(current_index + 1 < curve.size()) - c->setAxis(curve[current_index].toInt(), curve[current_index+1].toInt()); - if (d_file_version >= 90 && current_index+2 < curve.size()) - c->setVisible(curve.last().toInt()); - else - c->setVisible(true); - } - - } - curveID++; - } - else if (s.contains ("ErrorBars")){ - QStringList curve = s.split("\t", QString::SkipEmptyParts); - if (!app->renamedTables.isEmpty()){ - QString caption = (curve[4]).left((curve[4]).find("_",0)); - if (app->renamedTables.contains(caption)) - {//modify the name of the curve according to the new table name - int index = app->renamedTables.findIndex (caption); - QString newCaption = app->renamedTables[++index]; - curve.replaceInStrings(caption+"_", newCaption+"_"); - } - } - Table *w = app->table(curve[3]); - Table *errTable = app->table(curve[4]); - if (w && errTable){ - ag->addErrorBars(curve[2], curve[3], errTable, curve[4], curve[1].toInt(), - curve[5].toDouble(), curve[6].toInt(), QColor(curve[7]), - curve[8].toInt(), curve[10].toInt(), curve[9].toInt()); - } - curveID++; - } - else if (s == ""){ - curveID++; - QStringList lst; - while ( s!="" ){ - s = list[++j]; - lst << s; - } - lst.pop_back(); - ag->restoreSpectrogram(app, lst); - } - else if (s.left(6) == "scale\t"){ - QStringList scl = s.split("\t"); - scl.pop_front(); - int size = scl.count(); - if (d_file_version < 88){ - double step = scl[2].toDouble(); - if (scl[5] == "0") - step = 0.0; - ag->setScale(QwtPlot::xBottom, scl[0].toDouble(), scl[1].toDouble(), step, - scl[3].toInt(), scl[4].toInt(), scl[6].toInt(), bool(scl[7].toInt())); - ag->setScale(QwtPlot::xTop, scl[0].toDouble(), scl[1].toDouble(), step, - scl[3].toInt(), scl[4].toInt(), scl[6].toInt(), bool(scl[7].toInt())); - - step = scl[10].toDouble(); - if (scl[13] == "0") - step = 0.0; - ag->setScale(QwtPlot::yLeft, scl[8].toDouble(), scl[9].toDouble(), step, scl[11].toInt(), - scl[12].toInt(), scl[14].toInt(), bool(scl[15].toInt())); - ag->setScale(QwtPlot::yRight, scl[8].toDouble(), scl[9].toDouble(), step, scl[11].toInt(), - scl[12].toInt(), scl[14].toInt(), bool(scl[15].toInt())); - } else if (size == 8){ - ag->setScale(scl[0].toInt(), scl[1].toDouble(), scl[2].toDouble(), scl[3].toDouble(), - scl[4].toInt(), scl[5].toInt(), scl[6].toInt(), bool(scl[7].toInt())); - } else if (size == 18){ - ag->setScale(scl[0].toInt(), scl[1].toDouble(), scl[2].toDouble(), scl[3].toDouble(), - scl[4].toInt(), scl[5].toInt(), scl[6].toInt(), bool(scl[7].toInt()), scl[8].toDouble(), - scl[9].toDouble(), scl[10].toInt(), scl[11].toDouble(), scl[12].toDouble(), scl[13].toInt(), - scl[14].toInt(), bool(scl[15].toInt()), scl[16].toInt(), bool(scl[17].toInt())); - } - } - else if (s.contains ("PlotTitle")){ - QStringList fList=s.split("\t"); - ag->setTitle(fList[1]); - ag->setTitleColor(QColor(fList[2])); - ag->setTitleAlignment(fList[3].toInt()); - } - else if (s.contains ("TitleFont")){ - QStringList fList=s.split("\t"); - QFont fnt=QFont (fList[1],fList[2].toInt(),fList[3].toInt(),fList[4].toInt()); - fnt.setUnderline(fList[5].toInt()); - fnt.setStrikeOut(fList[6].toInt()); - ag->setTitleFont(fnt); - } - else if (s.contains ("AxesTitles")){ - QStringList lst=s.split("\t"); - lst.pop_front(); - for (int i=0; i<4; i++){ - if (lst.count() > i) - ag->setScaleTitle(i, lst[i]); - } - } - else if (s.contains ("AxesTitleColors")){ - QStringList colors = s.split("\t", QString::SkipEmptyParts); - colors.pop_front(); - for (int i=0; isetAxisTitleColor(i, colors[i]); - }else if (s.contains ("AxesTitleAlignment")){ - QStringList align=s.split("\t", QString::SkipEmptyParts); - align.pop_front(); - for (int i=0; i<(int)align.count(); i++) - ag->setAxisTitleAlignment(i, align[i].toInt()); - } else if (s.contains ("AxesTitleDistance")){ - QStringList align = s.split("\t", QString::SkipEmptyParts); - align.pop_front(); - for (int i=0; i<(int)align.count(); i++) - ag->setAxisTitleDistance(i, align[i].toInt()); - } else if (s.contains ("")){ - QwtScaleWidget *scale = ag->axisWidget(QwtPlot::yRight); - if (scale) - scale->setLayoutFlag(QwtScaleWidget::TitleInverted, true); - } else if (s.contains ("ScaleFont")){ - QStringList fList=s.split("\t"); - QFont fnt=QFont (fList[1],fList[2].toInt(),fList[3].toInt(),fList[4].toInt()); - fnt.setUnderline(fList[5].toInt()); - fnt.setStrikeOut(fList[6].toInt()); - - int axis=(fList[0].right(1)).toInt(); - ag->setAxisTitleFont(axis,fnt); - }else if (s.contains ("AxisFont")){ - QStringList fList=s.split("\t"); - QFont fnt=QFont (fList[1],fList[2].toInt(),fList[3].toInt(),fList[4].toInt()); - fnt.setUnderline(fList[5].toInt()); - fnt.setStrikeOut(fList[6].toInt()); - - int axis=(fList[0].right(1)).toInt(); - ag->setAxisFont(axis,fnt); - } - else if (s.contains ("AxesFormulas")) - { - QStringList fList=s.split("\t"); - fList.remove(fList.first()); - for (int i=0; i<(int)fList.count(); i++) - ag->setAxisFormula(i, fList[i]); - } - else if (s.startsWith("setAxisFormula(axis, formula); - } - else if (s.contains ("LabelsFormat")) - { - QStringList fList=s.split("\t"); - fList.pop_front(); - ag->setLabelsNumericFormat(fList); - } - else if (s.contains ("LabelsRotation")) - { - QStringList fList=s.split("\t"); - ag->setAxisLabelRotation(QwtPlot::xBottom, fList[1].toInt()); - ag->setAxisLabelRotation(QwtPlot::xTop, fList[2].toInt()); - } - else if (s.contains ("DrawAxesBackbone")) - { - QStringList fList=s.split("\t"); - ag->loadAxesOptions(fList[1]); - } - else if (s.contains ("AxesLineWidth")) - { - QStringList fList=s.split("\t"); - ag->loadAxesLinewidth(fList[1].toInt()); - } - else if (s.contains ("CanvasFrame")){ - QStringList lst = s.split("\t"); - ag->setCanvasFrame(lst[1].toInt(), QColor(lst[2])); - } - else if (s.contains ("CanvasBackground")) - { - QStringList list = s.split("\t"); - QColor c = QColor(list[1]); - if (list.count() == 3) - c.setAlpha(list[2].toInt()); - ag->setCanvasBackground(c); - } - else if (s.startsWith ("Legend")) - {// version <= 0.8.9 - QStringList fList = QStringList::split ("\t",s, true); - ag->insertLegend(fList, d_file_version); - } - else if (s.startsWith ("") && s.endsWith ("")) - { - QStringList fList = QStringList::split ("\t", s.remove(""), true); - ag->insertLegend(fList, d_file_version); - } - else if (s.contains ("textMarker")) - {// version <= 0.8.9 - QStringList fList = QStringList::split ("\t",s, true); - ag->insertText(fList, d_file_version); - } - else if (s.startsWith ("") && s.endsWith ("")) - { - QStringList fList = QStringList::split ("\t", s.remove(""), true); - ag->insertText(fList, d_file_version); - } - else if (s.startsWith ("") && s.endsWith ("")) - { - QStringList fList = QStringList::split ("\t", s.remove(""), true); - ag->insertText(fList, d_file_version); - } else if (s == ""){//version 0.9.7 - QStringList lst; - while ( s != "" ){ - s = list[++j]; - lst << s; - } - lst.pop_back(); - PieLabel::restore(ag, lst); - } - else if (s.contains ("lineMarker")) - {// version <= 0.8.9 - QStringList fList=s.split("\t"); - ag->addArrow(fList, d_file_version); - } - else if (s.startsWith ("") && s.endsWith ("")) - { - QStringList fList=s.remove("").split("\t"); - ag->addArrow(fList, d_file_version); - } - else if (s.contains ("ImageMarker") || (s.startsWith ("") && s.endsWith (""))) - { - QStringList fList=s.remove("").split("\t"); - ag->insertImageMarker(fList, d_file_version); - } else if (s == ""){//version 0.9.7 - QStringList lst; - while ( s != "" ){ - s = list[++j]; - lst << s; - } - lst.pop_back(); - TexWidget::restore(ag, lst); - } else if (s == ""){//version 0.9.7 - QStringList lst; - while ( s != "" ){ - s = list[++j]; - lst << s; - } - lst.pop_back(); - ImageWidget::restore(ag, lst); - } else if (s == ""){//version 0.9.7 - QStringList lst; - while ( s != "" ){ - s = list[++j]; - lst << s; - } - lst.pop_back(); - LegendWidget::restore(ag, lst); - } else if (s == ""){//version 0.9.7 - QStringList lst; - while ( s != "" ){ - s = list[++j]; - lst << s; - } - lst.pop_back(); - RectangleWidget::restore(ag, lst); - } else if (s == ""){//version 0.9.7.2 - QStringList lst; - while ( s != "" ){ - s = list[++j]; - lst << s; - } - lst.pop_back(); - EllipseWidget::restore(ag, lst); - } - else if (s.contains("AxisType")) - { - QStringList fList = s.split("\t"); - for (int i=0; i<4; i++){ - QStringList lst = fList[i+1].split(";", QString::SkipEmptyParts); - int format = lst[0].toInt(); - if (format == ScaleDraw::Numeric) - continue; - if (format == ScaleDraw::Day) - ag->setLabelsDayFormat(i, lst[1].toInt()); - else if (format == ScaleDraw::Month) - ag->setLabelsMonthFormat(i, lst[1].toInt()); - else if (format == ScaleDraw::Time || format == ScaleDraw::Date) - ag->setLabelsDateTimeFormat(i, format, lst[1]+";"+lst[2]); - else if (lst.size() > 1) - ag->setLabelsTextFormat(i, format, lst[1], app->table(lst[1])); - } - } - else if (d_file_version < 69 && s.contains ("AxesTickLabelsCol")) - { - QStringList fList = s.split("\t"); - for (int i=0; i<4; i++){ - QString colName = fList[i+1]; - Table *nw = app->table(colName); - ag->setLabelsTextFormat(i, ag->axisType(i), colName, nw); - } - } else if (s.startsWith ("") && s.endsWith ("")){ - QStringList lst = s.remove("").remove("").split("\t"); - if (lst.size() == 2) - ag->enableDouglasPeukerSpeedMode(lst[0].toDouble(), lst[1].toInt()); - } - } - ag->updateLayout(); - - ag->blockSignals(false); - ag->setAutoscaleFonts(app->autoScaleFonts); - return ag; -} - -void ApplicationWindow::copyActiveLayer() -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph *g = plot->activeLayer(); - if (!g) - return; - - lastCopiedLayer = g; - connect (g, SIGNAL(destroyed()), this, SLOT(closedLastCopiedLayer())); - g->copyImage(); -} - -void ApplicationWindow::showDataSetDialog(Analysis operation) -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph *g = plot->activeLayer(); - if (!g) - return; - - bool ok; - QString curve = QInputDialog::getItem(this, tr("QtiPlot - Choose data set"), - tr("Curve") + ": ", g->analysableCurvesList(), 0, false, &ok); - if (ok && !curve.isEmpty()) - analyzeCurve(g, operation, curve); -} - -void ApplicationWindow::analyzeCurve(Graph *g, Analysis operation, const QString& curveTitle) -{ - if (!g) - return; - - Fit *fitter = 0; - switch(operation){ - case NoAnalysis: - break; - case Integrate: - { - Integration *i = new Integration(this, g, curveTitle); - i->run(); - delete i; - } - break; - case Diff: - { - Differentiation *diff = new Differentiation(this, g, curveTitle); - diff->enableGraphicsDisplay(true); - diff->run(); - delete diff; - } - break; - case FitLinear: - fitter = new LinearFit (this, g); - break; - case FitLorentz: - fitter = new LorentzFit(this, g); - break; - case FitGauss: - fitter = new GaussFit(this, g); - break; - case FitSigmoidal: - { - QwtPlotCurve* c = g->curve(curveTitle); - if (c){ - ScaleEngine *se = (ScaleEngine *)g->axisScaleEngine(c->xAxis()); - if(se->type() == ScaleTransformation::Log10) - fitter = new LogisticFit (this, g); - else - fitter = new SigmoidalFit (this, g); - } - } - break; - case FitSlope: - fitter = new LinearSlopeFit (this, g); - break; - } - - if (!fitter) - return; - - if (fitter->setDataFromCurve(curveTitle)){ - if (operation != FitLinear && operation != FitSlope){ - fitter->guessInitialValues(); - fitter->scaleErrors(fit_scale_errors); - fitter->generateFunction(generateUniformFitPoints, fitPoints); - } else if (d_2_linear_fit_points) - fitter->generateFunction(generateUniformFitPoints, 2); - fitter->setOutputPrecision(fit_output_precision); - fitter->fit(); - if (pasteFitResultsToPlot) - fitter->showLegend(); - delete fitter; - } -} - -void ApplicationWindow::analysis(Analysis operation) -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - Graph* g = plot->activeLayer(); - if (!g || !g->validCurvesDataSize()) - return; - - QString curve_title = g->selectedCurveTitle(); - if (!curve_title.isNull()) { - analyzeCurve(g, operation, curve_title); - return; - } - - QStringList lst = g->analysableCurvesList(); - if (lst.count() == 1){ - const QwtPlotCurve *c = g->curve(lst[0]); - if (c) - analyzeCurve(g, operation, lst[0]); - } else - showDataSetDialog(operation); -} - -void ApplicationWindow::integrate() -{ - MdiSubWindow *w = activeWindow(); - if (!w) - return; - - if (w->isA("MultiLayer")) - analysis(Integrate); - else if (w->isA("Matrix")){ - QDateTime dt = QDateTime::currentDateTime (); - QString info = dt.toString(Qt::LocalDate); - info += "\n" + tr("Integration of %1 from zero is").arg(QString(w->objectName())) + ":\t"; - info += QString::number(((Matrix *)w)->integrate()) + "\n"; - info += "-------------------------------------------------------------\n"; - current_folder->appendLogInfo(info); - showResults(true); - } else if (w->inherits("Table")){ - Table *t = (Table *)w; - QStringList lst = t->selectedYColumns(); - int cols = lst.size(); - if (!cols){ - QMessageBox::warning(this, tr("QtiPlot - Column selection error"), - tr("Please select a 'Y' column first!")); - return; - } - - Table *result = newTable(cols, 2, "", tr("Integration of %1").arg(t->objectName())); - result->setColName(0, tr("Column")); - result->setColName(1, tr("Area")); - int aux = 0; - foreach (QString yCol, lst){ - int xCol = t->colX(t->colIndex(yCol)); - Integration *i = new Integration(this, t, t->colName(xCol), yCol); - i->run(); - result->setText(aux, 0, yCol); - result->setCell(aux, 1, i->area()); - aux++; - delete i; - } - result->show(); - } -} - -void ApplicationWindow::differentiate() -{ - MdiSubWindow *w = activeWindow(); - if (!w) - return; - - if (qobject_cast(w)) - analysis(Diff); - else if (w->inherits("Table")){ - Table *t = qobject_cast
(w); - QStringList lst = t->selectedYColumns(); - int cols = lst.size(); - if (!cols){ - QMessageBox::warning(this, tr("QtiPlot - Column selection error"), - tr("Please select a 'Y' column first!")); - return; - } - - Differentiation *diff = new Differentiation(this, NULL, "", ""); - int aux = 0; - foreach (QString yCol, lst){ - int xCol = t->colX(t->colIndex(yCol)); - diff->setDataFromTable(t, t->colName(xCol), yCol); - diff->run(); - Graph *g = diff->outputGraph(); - if (!g) - continue; - - QwtPlotCurve *c = g->curve(aux); - if (c){ - QPen pen = c->pen(); - pen.setColor(ColorBox::color(aux)); - c->setPen(pen); - aux++; - } - } - delete diff; - } -} - -void ApplicationWindow::fitLinear() -{ - MdiSubWindow *w = activeWindow(); - if (!w) - return; - - if (qobject_cast(w)) - analysis(FitLinear); - else if (w->inherits("Table")){ - Table *t = (Table *)w; - QStringList lst = t->selectedYColumns(); - int cols = lst.size(); - if (!cols){ - QMessageBox::warning(this, tr("QtiPlot - Column selection error"), tr("Please select a 'Y' column first!")); - return; - } - - MultiLayer* g = multilayerPlot(t, t->drawableColumnSelection(), Graph::LineSymbols); - if (!g) - return; - - QString legend = tr("Linear Regression of %1").arg(t->objectName()); - g->setWindowLabel(legend); - - Table *result = newTable(cols, 5, "", legend); - result->setColName(0, tr("Column")); - result->setColName(1, tr("Slope")); - result->setColName(2, tr("Intercept")); - result->setColName(3, tr("Chi^2")); - result->setColName(4, tr("R^2")); - - LinearFit *lf = new LinearFit (this, g->activeLayer()); - if (d_2_linear_fit_points) - lf->generateFunction(generateUniformFitPoints, 2); - lf->setOutputPrecision(fit_output_precision); - - int aux = 0; - foreach (QString yCol, lst){ - if (!lf->setDataFromCurve(yCol)) - continue; - - lf->setColor(aux); - lf->fit(); - double *res = lf->results(); - result->setText(aux, 0, yCol); - result->setCell(aux, 1, res[1]); - result->setCell(aux, 2, res[0]); - result->setCell(aux, 3, lf->chiSquare()); - result->setCell(aux, 4, lf->rSquare()); - aux++; - } - for (int i = 0; i < result->numCols(); i++) - result->table()->adjustColumn(i); - result->show(); - delete lf; - } -} - -void ApplicationWindow::fitSlope() -{ - MdiSubWindow *w = activeWindow(); - if (!w) - return; - - if (qobject_cast(w)) - analysis(FitSlope); - else if (w->inherits("Table")){ - Table *t = (Table *)w; - QStringList lst = t->selectedYColumns(); - int cols = lst.size(); - if (!cols){ - QMessageBox::warning(this, tr("QtiPlot - Column selection error"), tr("Please select a 'Y' column first!")); - return; - } - - MultiLayer* g = multilayerPlot(t, t->drawableColumnSelection(), Graph::LineSymbols); - if (!g) - return; - - QString legend = tr("Linear Regression of %1").arg(t->objectName()); - g->setWindowLabel(legend); - - Table *result = newTable(cols, 4, "", legend); - result->setColName(0, tr("Column")); - result->setColName(1, tr("Slope")); - result->setColName(2, tr("Chi^2")); - result->setColName(3, tr("R^2")); - - LinearSlopeFit *lf = new LinearSlopeFit (this, g->activeLayer()); - if (d_2_linear_fit_points) - lf->generateFunction(generateUniformFitPoints, 2); - lf->setOutputPrecision(fit_output_precision); - - int aux = 0; - foreach (QString yCol, lst){ - if (!lf->setDataFromCurve(yCol)) - continue; - - lf->setColor(aux); - lf->fit(); - double *res = lf->results(); - result->setText(aux, 0, yCol); - result->setCell(aux, 1, res[0]); - result->setCell(aux, 2, lf->chiSquare()); - result->setCell(aux, 3, lf->rSquare()); - aux++; - } - for (int i = 0; i < result->numCols(); i++) - result->table()->adjustColumn(i); - result->show(); - delete lf; - } -} - -void ApplicationWindow::fitSigmoidal() -{ - analysis(FitSigmoidal); -} - -void ApplicationWindow::fitGauss() -{ - analysis(FitGauss); -} - -void ApplicationWindow::fitLorentz() - -{ - analysis(FitLorentz); -} - -void ApplicationWindow::pickPointerCursor() -{ - btnPointer->setChecked(true); -} - -void ApplicationWindow::disableTools() -{ - if (displayBar && displayBar->isVisible()) - displayBar->hide(); - - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - if (w->isA("MultiLayer")){ - QList layers = ((MultiLayer*)w)->layersList(); - foreach(Graph *g, layers) - g->disableTools(); - } - } -} - -void ApplicationWindow::pickDataTool( QAction* action ) -{ - if (!action) - return; - - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - - QList layers = plot->layersList(); - foreach(Graph *g, layers) - g->disableTools(); - - if (action == btnCursor) - showCursor(); - else if (action == btnSelect) - showRangeSelectors(); - else if (action == btnPicker) - showScreenReader(); - else if (action == btnMovePoints) - movePoints(); - else if (action == actionDragCurve) - movePoints(true); - else if (action == btnRemovePoints) - removePoints(); - else if (action == actionDrawPoints) - drawPoints(); - else if (action == btnZoomIn) - zoomIn(); - else if (action == btnZoomOut) - zoomOut(); - else if (action == btnArrow) - drawArrow(); - else if (action == btnLine) - drawLine(); - else if (action == actionMagnify) - magnify(); -} - -void ApplicationWindow::custom2DPlotTools(MultiLayer *plot) -{ - if (!plot) - return; - - actionAddText->setChecked(false); - actionAddFormula->setChecked(false); - actionAddRectangle->setChecked(false); - actionAddEllipse->setChecked(false); - - QList layers = plot->layersList(); - foreach(Graph *g, layers){ - PlotToolInterface *active_tool = g->activeTool(); - if (active_tool){ - if (active_tool->rtti() == PlotToolInterface::Rtti_PlotTool){ - btnPicker->setChecked(true); - return; - } else if (active_tool->rtti() == PlotToolInterface::Rtti_DataPicker){ - switch(((DataPickerTool *)active_tool)->mode()){ - case DataPickerTool::Display: - btnCursor->setChecked(true); - break; - case DataPickerTool::Move: - btnMovePoints->setChecked(true); - break; - case DataPickerTool::Remove: - btnRemovePoints->setChecked(true); - break; - case DataPickerTool::MoveCurve: - actionDragCurve->setChecked(true); - break; - } - return; - } else if (active_tool->rtti() == PlotToolInterface::Rtti_DrawDataPoints){ - actionDrawPoints->setChecked(true); - return; - } else if (active_tool->rtti() == PlotToolInterface::Rtti_AddWidgetTool){ - switch(((AddWidgetTool *)active_tool)->widgetType()){ - case AddWidgetTool::Text: - actionAddText->setChecked(true); - break; - case AddWidgetTool::TexEquation: - actionAddFormula->setChecked(true); - break; - case AddWidgetTool::Rectangle: - actionAddRectangle->setChecked(true); - break; - case AddWidgetTool::Ellipse: - actionAddEllipse->setChecked(true); - break; - default: - break; - } - return; - } - } else if (g->hasPanningMagnifierEnabled()){ - actionMagnify->setChecked(true); - return; - } else if (g->drawArrow()){ - btnArrow->setChecked(true); - return; - } else if (g->drawLineActive()){ - btnLine->setChecked(true); - return; - } else if (g->rangeSelectorsEnabled()){ - btnSelect->setChecked(true); - return; - } else if (g->zoomOn()){ - btnZoomIn->setChecked(true); - return; - } - } - btnPointer->setChecked(true); -} - -void ApplicationWindow::connectSurfacePlot(Graph3D *plot) -{ - connect (plot, SIGNAL(showContextMenu()), this,SLOT(showWindowContextMenu())); - connect (plot, SIGNAL(showOptionsDialog()), this,SLOT(showPlot3dDialog())); - connect (plot, SIGNAL(closedWindow(MdiSubWindow*)), this, SLOT(closeWindow(MdiSubWindow*))); - connect (plot, SIGNAL(hiddenWindow(MdiSubWindow*)), this, SLOT(hideWindow(MdiSubWindow*))); - connect (plot, SIGNAL(statusChanged(MdiSubWindow*)), this, SLOT(updateWindowStatus(MdiSubWindow*))); - connect (plot, SIGNAL(modified()), this, SIGNAL(modified())); - - plot->askOnCloseEvent(confirmClosePlot3D); -} - -void ApplicationWindow::connectMultilayerPlot(MultiLayer *g) -{ - connect (g,SIGNAL(showEnrichementDialog()),this,SLOT(showEnrichementDialog())); - connect (g,SIGNAL(showPlotDialog(int)),this,SLOT(showPlotDialog(int))); - connect (g,SIGNAL(showScaleDialog(int)), this, SLOT(showScalePageFromAxisDialog(int))); - connect (g,SIGNAL(showAxisDialog(int)), this, SLOT(showAxisPageFromAxisDialog(int))); - connect (g,SIGNAL(showCurveContextMenu(QwtPlotItem *)), this, SLOT(showCurveContextMenu(QwtPlotItem *))); - connect (g,SIGNAL(showContextMenu()),this,SLOT(showWindowContextMenu())); - connect (g,SIGNAL(showCurvesDialog()),this,SLOT(showCurvesDialog())); - connect (g,SIGNAL(drawLineEnded(bool)), btnPointer, SLOT(setOn(bool))); - connect (g, SIGNAL(showAxisTitleDialog()), this, SLOT(showAxisTitleDialog())); - - connect (g,SIGNAL(showMarkerPopupMenu()),this,SLOT(showMarkerPopupMenu())); - connect (g,SIGNAL(closedWindow(MdiSubWindow*)),this, SLOT(closeWindow(MdiSubWindow*))); - connect (g,SIGNAL(hiddenWindow(MdiSubWindow*)),this, SLOT(hideWindow(MdiSubWindow*))); - connect (g,SIGNAL(statusChanged(MdiSubWindow*)),this, SLOT(updateWindowStatus(MdiSubWindow*))); - connect (g,SIGNAL(cursorInfo(const QString&)),info,SLOT(setText(const QString&))); - connect (g,SIGNAL(createTable(const QString&,int,int,const QString&)), - this,SLOT(newTable(const QString&,int,int,const QString&))); - connect (g,SIGNAL(viewTitleDialog()),this,SLOT(showTitleDialog())); - connect (g,SIGNAL(modifiedWindow(MdiSubWindow*)),this,SLOT(modifiedProject(MdiSubWindow*))); - connect (g,SIGNAL(modifiedPlot()), this, SLOT(modifiedProject())); - connect (g,SIGNAL(showLineDialog()),this, SLOT(showLineDialog())); - connect (g,SIGNAL(pasteMarker()),this,SLOT(pasteSelection())); - connect (g,SIGNAL(showGraphContextMenu()),this,SLOT(showGraphContextMenu())); - connect (g,SIGNAL(setPointerCursor()),this, SLOT(pickPointerCursor())); - connect (g,SIGNAL(currentFontChanged(const QFont&)), this, SLOT(setFormatBarFont(const QFont&))); - connect (g,SIGNAL(enableTextEditor(Graph *)), this, SLOT(enableTextEditor(Graph *))); - - g->askOnCloseEvent(confirmClosePlot2D); -} - -void ApplicationWindow::connectTable(Table* w) -{ - connect (w->table(), SIGNAL(selectionChanged()), this, SLOT(customColumnActions())); - connect (w,SIGNAL(statusChanged(MdiSubWindow*)),this, SLOT(updateWindowStatus(MdiSubWindow*))); - connect (w,SIGNAL(hiddenWindow(MdiSubWindow*)),this, SLOT(hideWindow(MdiSubWindow*))); - connect (w,SIGNAL(closedWindow(MdiSubWindow*)),this, SLOT(closeWindow(MdiSubWindow*))); - connect (w,SIGNAL(removedCol(const QString&)),this,SLOT(removeCurves(const QString&))); - connect (w,SIGNAL(modifiedData(Table *, const QString&)), - this, SLOT(updateCurves(Table *, const QString&))); - connect (w,SIGNAL(resizedWindow(MdiSubWindow*)),this,SLOT(modifiedProject(MdiSubWindow*))); - connect (w,SIGNAL(modifiedWindow(MdiSubWindow*)),this,SLOT(modifiedProject(MdiSubWindow*))); - connect (w,SIGNAL(optionsDialog()),this,SLOT(showColumnOptionsDialog())); - connect (w,SIGNAL(colValuesDialog()),this,SLOT(showColumnValuesDialog())); - connect (w,SIGNAL(showContextMenu(bool)),this,SLOT(showTableContextMenu(bool))); - connect (w,SIGNAL(changedColHeader(const QString&,const QString&)),this,SLOT(updateColNames(const QString&,const QString&))); - connect (w,SIGNAL(createTable(const QString&,int,int,const QString&)),this,SLOT(newTable(const QString&,int,int,const QString&))); - - w->askOnCloseEvent(confirmCloseTable); -} - -void ApplicationWindow::setAppColors(const QColor& wc, const QColor& pc, const QColor& tpc, bool force) -{ - if (force || workspaceColor != wc){ - workspaceColor = wc; - d_workspace->setBackground(wc); - } - - if (!force && panelsColor == pc && panelsTextColor == tpc) - return; - - panelsColor = pc; - panelsTextColor = tpc; - - QPalette palette; - palette.setColor(QPalette::Base, QColor(panelsColor)); - qApp->setPalette(palette); - - palette.setColor(QPalette::Text, QColor(panelsTextColor)); - palette.setColor(QPalette::WindowText, QColor(panelsTextColor)); - - lv->setPalette(palette); - results->setPalette(palette); - folders->setPalette(palette); -} - -void ApplicationWindow::setPlot3DOptions() -{ - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - if (w->isA("Graph3D")){ - Graph3D *g = (Graph3D*)w; - g->setOrthogonal(d_3D_orthogonal); - g->setAutoscale(d_3D_autoscale); - g->setAntialiasing(d_3D_smooth_mesh); - } - } -} - -void ApplicationWindow::createActions() -{ - actionCustomActionDialog = new QAction(tr("Add &Custom Script Action..."), this); - connect(actionCustomActionDialog, SIGNAL(activated()), this, SLOT(showCustomActionDialog())); - - actionNewProject = new QAction(QIcon(QPixmap(new_xpm)), tr("New &Project"), this); - actionNewProject->setShortcut( tr("Ctrl+N") ); - connect(actionNewProject, SIGNAL(activated()), this, SLOT(newProject())); - - actionAppendProject = new QAction(QIcon(QPixmap(append_file_xpm)), tr("App&end Project..."), this); - connect(actionAppendProject, SIGNAL(activated()), this, SLOT(appendProject())); - - actionNewFolder = new QAction(QIcon(QPixmap(newFolder_xpm)), tr("New &Project"), this); - actionNewProject->setShortcut(Qt::Key_F7); - connect(actionNewFolder, SIGNAL(activated()), this, SLOT(addFolder())); - - actionNewGraph = new QAction(QIcon(QPixmap(new_graph_xpm)), tr("New &Graph"), this); - actionNewGraph->setShortcut( tr("Ctrl+G") ); - connect(actionNewGraph, SIGNAL(activated()), this, SLOT(newGraph())); - - actionNewNote = new QAction(QIcon(QPixmap(new_note_xpm)), tr("New &Note"), this); - connect(actionNewNote, SIGNAL(activated()), this, SLOT(newNote())); - - actionNewTable = new QAction(QIcon(QPixmap(table_xpm)), tr("New &Table"), this); - actionNewTable->setShortcut( tr("Ctrl+T") ); - connect(actionNewTable, SIGNAL(activated()), this, SLOT(newTable())); - - actionNewMatrix = new QAction(QIcon(QPixmap(new_matrix_xpm)), tr("New &Matrix"), this); - actionNewMatrix->setShortcut( tr("Ctrl+M") ); - connect(actionNewMatrix, SIGNAL(activated()), this, SLOT(newMatrix())); - - actionNewFunctionPlot = new QAction(QIcon(QPixmap(newF_xpm)), tr("New &Function Plot"), this); - actionNewFunctionPlot->setShortcut( tr("Ctrl+F") ); - connect(actionNewFunctionPlot, SIGNAL(activated()), this, SLOT(functionDialog())); - - actionNewSurfacePlot = new QAction(QIcon(QPixmap(newFxy_xpm)), tr("New 3D &Surface Plot"), this); - actionNewSurfacePlot->setShortcut( tr("Ctrl+ALT+Z") ); - connect(actionNewSurfacePlot, SIGNAL(activated()), this, SLOT(newSurfacePlot())); - - actionOpen = new QAction(QIcon(QPixmap(fileopen_xpm)), tr("&Open"), this); - actionOpen->setShortcut( tr("Ctrl+O") ); - connect(actionOpen, SIGNAL(activated()), this, SLOT(open())); - - actionLoadImage = new QAction(tr("Open Image &File"), this); - actionLoadImage->setShortcut( tr("Ctrl+I") ); - connect(actionLoadImage, SIGNAL(activated()), this, SLOT(loadImage())); - - actionImportImage = new QAction(tr("Import I&mage..."), this); - connect(actionImportImage, SIGNAL(activated()), this, SLOT(importImage())); - - actionSaveProject = new QAction(QIcon(QPixmap(filesave_xpm)), tr("&Save Project"), this); - actionSaveProject->setShortcut( tr("Ctrl+S") ); - connect(actionSaveProject, SIGNAL(activated()), this, SLOT(saveProject())); - - actionSaveProjectAs = new QAction(QIcon(QPixmap(filesaveas_xpm)), tr("Save Project &As..."), this); - actionSaveProjectAs->setShortcut( tr("Ctrl+Shift+S") ); - connect(actionSaveProjectAs, SIGNAL(activated()), this, SLOT(saveProjectAs())); - - actionOpenTemplate = new QAction(QIcon(QPixmap(open_template_xpm)),tr("Open Temp&late..."), this); - connect(actionOpenTemplate, SIGNAL(activated()), this, SLOT(openTemplate())); - - actionSaveTemplate = new QAction(QIcon(QPixmap(save_template_xpm)), tr("Save As &Template..."), this); - connect(actionSaveTemplate, SIGNAL(activated()), this, SLOT(saveAsTemplate())); - - actionSaveNote = new QAction(QIcon(QPixmap(filesaveas_xpm)), tr("Save Note As..."), this); - connect(actionSaveNote, SIGNAL(activated()), this, SLOT(saveNoteAs())); - - actionLoad = new QAction(QIcon(QPixmap(import_xpm)), tr("&Import ASCII..."), this); - connect(actionLoad, SIGNAL(activated()), this, SLOT(importASCII())); - - actionImportSound = new QAction(tr("&Sound (WAV)..."), this); - connect(actionImportSound, SIGNAL(activated()), this, SLOT(importWaveFile())); - - actionUndo = new QAction(QIcon(QPixmap(undo_xpm)), tr("&Undo"), this); - actionUndo->setShortcut( tr("Ctrl+Z") ); - connect(actionUndo, SIGNAL(activated()), this, SLOT(undo())); - - actionRedo = new QAction(QIcon(QPixmap(redo_xpm)), tr("&Redo"), this); - actionRedo->setShortcut(QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_Z)); - connect(actionRedo, SIGNAL(activated()), this, SLOT(redo())); - - actionCopyWindow = new QAction(QIcon(QPixmap(duplicate_xpm)), tr("&Duplicate"), this); - actionCopyWindow->setShortcut(tr("Ctrl+Alt+D")); - connect(actionCopyWindow, SIGNAL(activated()), this, SLOT(clone())); - - actionCutSelection = new QAction(QIcon(QPixmap(cut_xpm)), tr("Cu&t Selection"), this); - actionCutSelection->setShortcut( tr("Ctrl+X") ); - connect(actionCutSelection, SIGNAL(activated()), this, SLOT(cutSelection())); - - actionCopySelection = new QAction(QIcon(QPixmap(copy_xpm)), tr("&Copy Selection"), this); - actionCopySelection->setShortcut( tr("Ctrl+C") ); - connect(actionCopySelection, SIGNAL(activated()), this, SLOT(copySelection())); - - actionPasteSelection = new QAction(QIcon(QPixmap(paste_xpm)), tr("&Paste Selection"), this); - actionPasteSelection->setShortcut( tr("Ctrl+V") ); - connect(actionPasteSelection, SIGNAL(activated()), this, SLOT(pasteSelection())); - - actionClearSelection = new QAction(QIcon(QPixmap(erase_xpm)), tr("&Delete Selection"), this); - actionClearSelection->setShortcut( tr("Del","delete key") ); - connect(actionClearSelection, SIGNAL(activated()), this, SLOT(clearSelection())); - - actionShowExplorer = explorerWindow->toggleViewAction(); - actionShowExplorer->setIcon(QPixmap(folder_xpm)); - actionShowExplorer->setShortcut( tr("Ctrl+E") ); - - actionFindWindow = new QAction(QIcon(QPixmap(find_xpm)), tr("&Find..."), this); - connect(actionFindWindow, SIGNAL(activated()), this, SLOT(showFindDialogue())); - - actionShowLog = logWindow->toggleViewAction(); - actionShowLog->setIcon(QPixmap(log_xpm)); - - actionShowUndoStack = undoStackWindow->toggleViewAction(); - -#ifdef SCRIPTING_CONSOLE - actionShowConsole = consoleWindow->toggleViewAction(); -#endif - - actionAddLayer = new QAction(QIcon(QPixmap(newLayer_xpm)), tr("Add La&yer"), this); - actionAddLayer->setShortcut( tr("ALT+L") ); - connect(actionAddLayer, SIGNAL(activated()), this, SLOT(addLayer())); - - actionShowLayerDialog = new QAction(QIcon(QPixmap(arrangeLayers_xpm)), tr("Arran&ge Layers"), this); - actionShowLayerDialog->setShortcut( tr("Shift+A") ); - connect(actionShowLayerDialog, SIGNAL(activated()), this, SLOT(showLayerDialog())); - - actionAutomaticLayout = new QAction(QIcon(QPixmap(auto_layout_xpm)), tr("Automatic Layout"), this); - connect(actionAutomaticLayout, SIGNAL(activated()), this, SLOT(autoArrangeLayers())); - - actionExportGraph = new QAction(tr("&Current"), this); - actionExportGraph->setShortcut( tr("Ctrl+Alt+G") ); - connect(actionExportGraph, SIGNAL(activated()), this, SLOT(exportGraph())); - - actionExportAllGraphs = new QAction(tr("&All"), this); - actionExportAllGraphs->setShortcut( tr("Alt+X") ); - connect(actionExportAllGraphs, SIGNAL(activated()), this, SLOT(exportAllGraphs())); - - actionPresentationODF = new QAction(tr("Create Open &Document Presentation..."), this); - connect(actionPresentationODF, SIGNAL(activated()), this, SLOT(exportPresentationODF())); - - actionExportPDF = new QAction(QIcon(QPixmap(pdf_xpm)), tr("&Export PDF"), this); - actionExportPDF->setShortcut( tr("Ctrl+Alt+P") ); - connect(actionExportPDF, SIGNAL(activated()), this, SLOT(exportPDF())); - - actionPrint = new QAction(QIcon(QPixmap(fileprint_xpm)), tr("&Print"), this); - actionPrint->setShortcut( tr("Ctrl+P") ); - connect(actionPrint, SIGNAL(activated()), this, SLOT(print())); - - actionPrintPreview = new QAction(QPixmap(preview_xpm), tr("Print Pre&view"), this); - connect(actionPrintPreview, SIGNAL(activated()), this, SLOT(printPreview())); - - actionPrintAllPlots = new QAction(tr("Print All Plo&ts"), this); - connect(actionPrintAllPlots, SIGNAL(activated()), this, SLOT(printAllPlots())); - - actionShowExportASCIIDialog = new QAction(tr("E&xport ASCII"), this); - connect(actionShowExportASCIIDialog, SIGNAL(activated()), this, SLOT(showExportASCIIDialog())); - - actionCloseAllWindows = new QAction(QIcon(QPixmap(quit_xpm)), tr("&Quit"), this); - actionCloseAllWindows->setShortcut( tr("Ctrl+Q") ); - connect(actionCloseAllWindows, SIGNAL(activated()), qApp, SLOT(closeAllWindows())); - - actionCloseProject = new QAction(QIcon(QPixmap(delete_xpm)), tr("&Close"), this); - connect(actionCloseProject, SIGNAL(activated()), this, SLOT(newProject())); - - actionClearLogInfo = new QAction(tr("Clear &Log Information"), this); - connect(actionClearLogInfo, SIGNAL(activated()), this, SLOT(clearLogInfo())); - - actionDeleteFitTables = new QAction(QIcon(QPixmap(close_xpm)), tr("Delete &Fit Tables"), this); - connect(actionDeleteFitTables, SIGNAL(activated()), this, SLOT(deleteFitTables())); - - actionShowPlotWizard = new QAction(QIcon(QPixmap(wizard_xpm)), tr("Plot &Wizard"), this); - actionShowPlotWizard->setShortcut( tr("Ctrl+Alt+W") ); - connect(actionShowPlotWizard, SIGNAL(activated()), this, SLOT(showPlotWizard())); - - actionShowConfigureDialog = new QAction(QIcon(QPixmap(configure_xpm)), tr("&Preferences..."), this); - connect(actionShowConfigureDialog, SIGNAL(activated()), this, SLOT(showPreferencesDialog())); - - actionShowCurvesDialog = new QAction(QIcon(QPixmap(curves_xpm)), tr("Add/Remove &Curve..."), this); - actionShowCurvesDialog->setShortcut( tr("ALT+C") ); - connect(actionShowCurvesDialog, SIGNAL(activated()), this, SLOT(showCurvesDialog())); - - actionAddErrorBars = new QAction(QIcon(QPixmap(errors_xpm)), tr("Add &Error Bars..."), this); - actionAddErrorBars->setShortcut( tr("Ctrl+B") ); - connect(actionAddErrorBars, SIGNAL(activated()), this, SLOT(addErrorBars())); - - actionAddFunctionCurve = new QAction(QIcon(QPixmap(fx_xpm)), tr("Add &Function..."), this); - actionAddFunctionCurve->setShortcut( tr("Ctrl+Alt+F") ); - connect(actionAddFunctionCurve, SIGNAL(activated()), this, SLOT(addFunctionCurve())); - - actionUnzoom = new QAction(QIcon(QPixmap(unzoom_xpm)), tr("&Rescale to Show All"), this); - actionUnzoom->setShortcut( tr("Ctrl+Shift+R") ); - connect(actionUnzoom, SIGNAL(activated()), this, SLOT(setAutoScale())); - - actionMagnify = new QAction(QIcon(QPixmap(magnifier_xpm)), tr("Zoom &In/Out and Drag Canvas"), this); - connect(actionMagnify, SIGNAL(activated()), this, SLOT(magnify())); - - actionNewLegend = new QAction(QIcon(QPixmap(legend_xpm)), tr("New &Legend"), this); - actionNewLegend->setShortcut( tr("Ctrl+L") ); - connect(actionNewLegend, SIGNAL(activated()), this, SLOT(newLegend())); - - actionTimeStamp = new QAction(QIcon(QPixmap(clock_xpm)), tr("Add Time Stamp"), this); - actionTimeStamp->setShortcut( tr("Ctrl+ALT+T") ); - connect(actionTimeStamp, SIGNAL(activated()), this, SLOT(addTimeStamp())); - - actionAddImage = new QAction(QIcon(QPixmap(monalisa_xpm)), tr("Add &Image"), this); - actionAddImage->setShortcut( tr("ALT+I") ); - connect(actionAddImage, SIGNAL(activated()), this, SLOT(addImage())); - - actionPlotL = new QAction(QIcon(QPixmap(lPlot_xpm)), tr("&Line"), this); - connect(actionPlotL, SIGNAL(activated()), this, SLOT(plotL())); - - actionPlotP = new QAction(QIcon(QPixmap(pPlot_xpm)), tr("&Scatter"), this); - connect(actionPlotP, SIGNAL(activated()), this, SLOT(plotP())); - - actionPlotLP = new QAction(QIcon(QPixmap(lpPlot_xpm)), tr("Line + S&ymbol"), this); - connect(actionPlotLP, SIGNAL(activated()), this, SLOT(plotLP())); - - actionPlotVerticalDropLines = new QAction(QIcon(QPixmap(dropLines_xpm)), tr("Vertical &Drop Lines"), this); - connect(actionPlotVerticalDropLines, SIGNAL(activated()), this, SLOT(plotVerticalDropLines())); - - actionPlotSpline = new QAction(QIcon(QPixmap(spline_xpm)), tr("&Spline"), this); - connect(actionPlotSpline, SIGNAL(activated()), this, SLOT(plotSpline())); - - actionPlotHorSteps = new QAction(QPixmap(hor_steps_xpm), tr("&Horizontal Steps"), this); - connect(actionPlotHorSteps, SIGNAL(activated()), this, SLOT(plotHorSteps())); - - actionPlotVertSteps = new QAction(QIcon(QPixmap(vert_steps_xpm)), tr("&Vertical Steps"), this); - connect(actionPlotVertSteps, SIGNAL(activated()), this, SLOT(plotVertSteps())); - - actionPlotVerticalBars = new QAction(QIcon(QPixmap(vertBars_xpm)), tr("&Columns"), this); - connect(actionPlotVerticalBars, SIGNAL(activated()), this, SLOT(plotVerticalBars())); - - actionPlotHorizontalBars = new QAction(QIcon(QPixmap(hBars_xpm)), tr("&Rows"), this); - connect(actionPlotHorizontalBars, SIGNAL(activated()), this, SLOT(plotHorizontalBars())); - - actionStackBars = new QAction(QIcon(QPixmap(stack_bar_xpm)), tr("Stack &Bar"), this); - connect(actionStackBars, SIGNAL(activated()), this, SLOT(plotStackBar())); - - actionStackColumns = new QAction(QIcon(QPixmap(stack_column_xpm)), tr("Stack &Column"), this); - connect(actionStackColumns, SIGNAL(activated()), this, SLOT(plotStackColumn())); - - actionPlotArea = new QAction(QIcon(QPixmap(area_xpm)), tr("&Area"), this); - connect(actionPlotArea, SIGNAL(activated()), this, SLOT(plotArea())); - - actionPlotPie = new QAction(QIcon(QPixmap(pie_xpm)), tr("&Pie"), this); - connect(actionPlotPie, SIGNAL(activated()), this, SLOT(plotPie())); - - actionPlotVectXYAM = new QAction(QIcon(QPixmap(vectXYAM_xpm)), tr("Vectors XY&AM"), this); - connect(actionPlotVectXYAM, SIGNAL(activated()), this, SLOT(plotVectXYAM())); - - actionPlotVectXYXY = new QAction(QIcon(QPixmap(vectXYXY_xpm)), tr("&Vectors &XYXY"), this); - connect(actionPlotVectXYXY, SIGNAL(activated()), this, SLOT(plotVectXYXY())); - - actionPlotHistogram = new QAction(QIcon(QPixmap(histogram_xpm)), tr("&Histogram"), this); - connect(actionPlotHistogram, SIGNAL(activated()), this, SLOT(plotHistogram())); - - actionPlotStackedHistograms = new QAction(QIcon(QPixmap(stacked_hist_xpm)), tr("&Stacked Histogram"), this); - connect(actionPlotStackedHistograms, SIGNAL(activated()), this, SLOT(plotStackedHistograms())); - - actionStemPlot = new QAction(QIcon(QPixmap(leaf_xpm)), tr("Stem-and-&Leaf Plot"), this); - connect(actionStemPlot, SIGNAL(activated()), this, SLOT(newStemPlot())); - - actionPlot2VerticalLayers = new QAction(QIcon(QPixmap(panel_v2_xpm)), tr("&Vertical 2 Layers"), this); - connect(actionPlot2VerticalLayers, SIGNAL(activated()), this, SLOT(plot2VerticalLayers())); - - actionPlot2HorizontalLayers = new QAction(QIcon(QPixmap(panel_h2_xpm)), tr("&Horizontal 2 Layers"), this); - connect(actionPlot2HorizontalLayers, SIGNAL(activated()), this, SLOT(plot2HorizontalLayers())); - - actionPlot4Layers = new QAction(QIcon(QPixmap(panel_4_xpm)), tr("&4 Layers"), this); - connect(actionPlot4Layers, SIGNAL(activated()), this, SLOT(plot4Layers())); - - actionPlotStackedLayers = new QAction(QIcon(QPixmap(stacked_xpm)), tr("&Stacked Layers"), this); - connect(actionPlotStackedLayers, SIGNAL(activated()), this, SLOT(plotStackedLayers())); - - actionPlotDoubleYAxis = new QAction(QIcon(QPixmap(plot_double_y_xpm)), tr("D&ouble-Y"), this); - connect(actionPlotDoubleYAxis, SIGNAL(activated()), this, SLOT(plotDoubleYAxis())); - - actionAddZoomPlot = new QAction(QIcon(QPixmap(add_zoom_plot_xpm)), tr("&Zoom"), this); - connect(actionAddZoomPlot, SIGNAL(activated()), this, SLOT(zoomRectanglePlot())); - - actionWaterfallPlot = new QAction(QIcon(QPixmap(waterfall_plot_xpm)), tr("&Waterfall Plot"), this); - connect(actionWaterfallPlot, SIGNAL(activated()), this, SLOT(waterfallPlot())); - - actionExtractGraphs = new QAction(QIcon(QPixmap(extract_graphs_xpm)), tr("E&xtract to Graphs"), this); - connect(actionExtractGraphs, SIGNAL(activated()), this, SLOT(extractGraphs())); - - actionExtractLayers = new QAction(QIcon(QPixmap(extract_layers_xpm)), tr("Extract to &Layers"), this); - connect(actionExtractLayers, SIGNAL(activated()), this, SLOT(extractLayers())); - - actionAddInsetLayer = new QAction(QIcon(QPixmap(add_inset_layer_xpm)), tr("Add Inset Layer"), this); - connect(actionAddInsetLayer, SIGNAL(activated()), this, SLOT(addInsetLayer())); - - actionAddInsetCurveLayer = new QAction(QIcon(QPixmap(add_inset_curve_layer_xpm)), tr("Add Inset Layer"), this); - connect(actionAddInsetCurveLayer, SIGNAL(activated()), this, SLOT(addInsetCurveLayer())); - - actionPlot3DRibbon = new QAction(QIcon(QPixmap(ribbon_xpm)), tr("&Ribbon"), this); - connect(actionPlot3DRibbon, SIGNAL(activated()), this, SLOT(plot3DRibbon())); - - actionPlot3DBars = new QAction(QIcon(QPixmap(bars_xpm)), tr("&Bars"), this); - connect(actionPlot3DBars, SIGNAL(activated()), this, SLOT(plot3DBars())); - - actionPlot3DScatter = new QAction(QIcon(QPixmap(scatter_xpm)), tr("&Scatter"), this); - connect(actionPlot3DScatter, SIGNAL(activated()), this, SLOT(plot3DScatter())); - - actionPlot3DTrajectory = new QAction(QIcon(QPixmap(trajectory_xpm)), tr("&Trajectory"), this); - connect(actionPlot3DTrajectory, SIGNAL(activated()), this, SLOT(plot3DTrajectory())); - - actionShowColStatistics = new QAction(QIcon(QPixmap(col_stat_xpm)), tr("Statistics on &Columns"), this); - connect(actionShowColStatistics, SIGNAL(activated()), this, SLOT(showColStatistics())); - - actionShowRowStatistics = new QAction(QIcon(QPixmap(stat_rows_xpm)), tr("Statistics on &Rows"), this); - connect(actionShowRowStatistics, SIGNAL(activated()), this, SLOT(showRowStatistics())); - - actionIntegrate = new QAction(tr("&Integrate"), this); - connect(actionIntegrate, SIGNAL(activated()), this, SLOT(integrate())); - - actionShowIntDialog = new QAction(tr("Integr&ate Function..."), this); - connect(actionShowIntDialog, SIGNAL(activated()), this, SLOT(showIntegrationDialog())); - - actionInterpolate = new QAction(tr("Inte&rpolate ..."), this); - connect(actionInterpolate, SIGNAL(activated()), this, SLOT(showInterpolationDialog())); - - actionLowPassFilter = new QAction(tr("&Low Pass..."), this); - connect(actionLowPassFilter, SIGNAL(activated()), this, SLOT(lowPassFilterDialog())); - - actionHighPassFilter = new QAction(tr("&High Pass..."), this); - connect(actionHighPassFilter, SIGNAL(activated()), this, SLOT(highPassFilterDialog())); - - actionBandPassFilter = new QAction(tr("&Band Pass..."), this); - connect(actionBandPassFilter, SIGNAL(activated()), this, SLOT(bandPassFilterDialog())); - - actionBandBlockFilter = new QAction(tr("&Band Block..."), this); - connect(actionBandBlockFilter, SIGNAL(activated()), this, SLOT(bandBlockFilterDialog())); - - actionFFT = new QAction(tr("&FFT..."), this); - connect(actionFFT, SIGNAL(activated()), this, SLOT(showFFTDialog())); - - actionSmoothSavGol = new QAction(tr("&Savitzky-Golay..."), this); - connect(actionSmoothSavGol, SIGNAL(activated()), this, SLOT(showSmoothSavGolDialog())); - - actionSmoothFFT = new QAction(tr("&FFT Filter..."), this); - connect(actionSmoothFFT, SIGNAL(activated()), this, SLOT(showSmoothFFTDialog())); - - actionSmoothAverage = new QAction(tr("Moving Window &Average..."), this); - connect(actionSmoothAverage, SIGNAL(activated()), this, SLOT(showSmoothAverageDialog())); - - actionSmoothLowess = new QAction(tr("&Lowess..."), this); - connect(actionSmoothLowess, SIGNAL(activated()), this, SLOT(showSmoothLowessDialog())); - - actionDifferentiate = new QAction(tr("&Differentiate"), this); - connect(actionDifferentiate, SIGNAL(activated()), this, SLOT(differentiate())); - - actionFitSlope = new QAction(tr("Fit Slop&e"), this); - connect(actionFitSlope, SIGNAL(activated()), this, SLOT(fitSlope())); - - actionFitLinear = new QAction(tr("Fit &Linear"), this); - connect(actionFitLinear, SIGNAL(activated()), this, SLOT(fitLinear())); - - actionShowFitPolynomDialog = new QAction(tr("Fit &Polynomial ..."), this); - connect(actionShowFitPolynomDialog, SIGNAL(activated()), this, SLOT(showFitPolynomDialog())); - - actionShowExpDecayDialog = new QAction(tr("&First Order ..."), this); - connect(actionShowExpDecayDialog, SIGNAL(activated()), this, SLOT(showExpDecayDialog())); - - actionShowTwoExpDecayDialog = new QAction(tr("&Second Order ..."), this); - connect(actionShowTwoExpDecayDialog, SIGNAL(activated()), this, SLOT(showTwoExpDecayDialog())); - - actionShowExpDecay3Dialog = new QAction(tr("&Third Order ..."), this); - connect(actionShowExpDecay3Dialog, SIGNAL(activated()), this, SLOT(showExpDecay3Dialog())); - - actionFitExpGrowth = new QAction(tr("Fit Exponential Gro&wth ..."), this); - connect(actionFitExpGrowth, SIGNAL(activated()), this, SLOT(showExpGrowthDialog())); - - actionFitSigmoidal = new QAction(tr("Fit &Boltzmann (Sigmoidal)"), this); - connect(actionFitSigmoidal, SIGNAL(activated()), this, SLOT(fitSigmoidal())); - - actionFitGauss = new QAction(tr("Fit &Gaussian"), this); - connect(actionFitGauss, SIGNAL(activated()), this, SLOT(fitGauss())); - - actionFitLorentz = new QAction(tr("Fit Lorent&zian"), this); - connect(actionFitLorentz, SIGNAL(activated()), this, SLOT(fitLorentz())); - - actionShowFitDialog = new QAction(tr("Fit &Wizard..."), this); - actionShowFitDialog->setShortcut( tr("Ctrl+Y") ); - connect(actionShowFitDialog, SIGNAL(activated()), this, SLOT(showFitDialog())); - - actionShowPlotDialog = new QAction(tr("&Plot ..."), this); - connect(actionShowPlotDialog, SIGNAL(activated()), this, SLOT(showGeneralPlotDialog())); - - actionShowScaleDialog = new QAction(tr("&Scales..."), this); - connect(actionShowScaleDialog, SIGNAL(activated()), this, SLOT(showScaleDialog())); - - actionShowAxisDialog = new QAction(tr("&Axes..."), this); - connect(actionShowAxisDialog, SIGNAL(activated()), this, SLOT(showAxisDialog())); - - actionShowGridDialog = new QAction(tr("&Grid ..."), this); - connect(actionShowGridDialog, SIGNAL(activated()), this, SLOT(showGridDialog())); - - actionShowTitleDialog = new QAction(tr("&Title ..."), this); - connect(actionShowTitleDialog, SIGNAL(activated()), this, SLOT(showTitleDialog())); - - actionShowColumnOptionsDialog = new QAction(tr("Column &Options ..."), this); - actionShowColumnOptionsDialog->setShortcut(tr("Ctrl+Alt+O")); - connect(actionShowColumnOptionsDialog, SIGNAL(activated()), this, SLOT(showColumnOptionsDialog())); - - actionShowColumnValuesDialog = new QAction(QIcon(QPixmap(formula_xpm)), tr("Set Column &Values ..."), this); - connect(actionShowColumnValuesDialog, SIGNAL(activated()), this, SLOT(showColumnValuesDialog())); - actionShowColumnValuesDialog->setShortcut(tr("Alt+Q")); - - actionTableRecalculate = new QAction(tr("Recalculate"), this); - actionTableRecalculate->setShortcut(tr("Ctrl+Return")); - connect(actionTableRecalculate, SIGNAL(activated()), this, SLOT(recalculateTable())); - - actionHideSelectedColumns = new QAction(tr("&Hide Selected"), this); - connect(actionHideSelectedColumns, SIGNAL(activated()), this, SLOT(hideSelectedColumns())); - - actionShowAllColumns = new QAction(tr("Sho&w All Columns"), this); - connect(actionShowAllColumns, SIGNAL(activated()), this, SLOT(showAllColumns())); - - actionSwapColumns = new QAction(QIcon(QPixmap(swap_columns_xpm)), tr("&Swap columns"), this); - connect(actionSwapColumns, SIGNAL(activated()), this, SLOT(swapColumns())); - - actionMoveColRight = new QAction(QIcon(QPixmap(move_col_right_xpm)), tr("Move &Right"), this); - connect(actionMoveColRight, SIGNAL(activated()), this, SLOT(moveColumnRight())); - - actionMoveColLeft = new QAction(QIcon(QPixmap(move_col_left_xpm)), tr("Move &Left"), this); - connect(actionMoveColLeft, SIGNAL(activated()), this, SLOT(moveColumnLeft())); - - actionMoveColFirst = new QAction(QIcon(QPixmap(move_col_first_xpm)), tr("Move to F&irst"), this); - connect(actionMoveColFirst, SIGNAL(activated()), this, SLOT(moveColumnFirst())); - - actionMoveColLast = new QAction(QIcon(QPixmap(move_col_last_xpm)), tr("Move to Las&t"), this); - connect(actionMoveColLast, SIGNAL(activated()), this, SLOT(moveColumnLast())); - - actionAdjustColumnWidth = new QAction(QIcon(QPixmap(adjust_col_width_xpm)), tr("Ad&just Column Width"), this); - connect(actionAdjustColumnWidth, SIGNAL(activated()), this, SLOT(adjustColumnWidth())); - - actionShowColsDialog = new QAction(tr("&Columns..."), this); - connect(actionShowColsDialog, SIGNAL(activated()), this, SLOT(showColsDialog())); - - actionShowRowsDialog = new QAction(tr("&Rows..."), this); - connect(actionShowRowsDialog, SIGNAL(activated()), this, SLOT(showRowsDialog())); - - actionDeleteRows = new QAction(tr("&Delete Rows Interval..."), this); - connect(actionDeleteRows, SIGNAL(activated()), this, SLOT(showDeleteRowsDialog())); - - actionMoveRowUp = new QAction(QIcon(QPixmap(move_row_up_xpm)), tr("&Upward"), this); - connect(actionMoveRowUp, SIGNAL(activated()), this, SLOT(moveTableRowUp())); - - actionMoveRowDown = new QAction(QIcon(QPixmap(move_row_down_xpm)), tr("&Downward"), this); - connect(actionMoveRowDown, SIGNAL(activated()), this, SLOT(moveTableRowDown())); - - actionAbout = new QAction(tr("&About QtiPlot"), this); - actionAbout->setShortcut( tr("F1") ); - connect(actionAbout, SIGNAL(activated()), this, SLOT(about())); - - actionShowHelp = new QAction(tr("&Help"), this); - actionShowHelp->setShortcut( tr("Ctrl+H") ); - connect(actionShowHelp, SIGNAL(activated()), this, SLOT(showHelp())); - - actionChooseHelpFolder = new QAction(tr("&Choose Help Folder..."), this); - connect(actionChooseHelpFolder, SIGNAL(activated()), this, SLOT(chooseHelpFolder())); - - actionRename = new QAction(tr("&Rename Window"), this); - connect(actionRename, SIGNAL(activated()), this, SLOT(rename())); - - actionCloseWindow = new QAction(QIcon(QPixmap(close_xpm)), tr("Close &Window"), this); - actionCloseWindow->setShortcut( tr("Ctrl+W") ); - connect(actionCloseWindow, SIGNAL(activated()), this, SLOT(closeActiveWindow())); - - actionAddColToTable = new QAction(QIcon(QPixmap(addCol_xpm)), tr("Add Column"), this); - connect(actionAddColToTable, SIGNAL(activated()), this, SLOT(addColToTable())); - - actionGoToRow = new QAction(tr("&Go to Row..."), this); - actionGoToRow->setShortcut(tr("Ctrl+Alt+G")); - connect(actionGoToRow, SIGNAL(activated()), this, SLOT(goToRow())); - - actionGoToColumn = new QAction(tr("Go to Colum&n..."), this); - actionGoToColumn->setShortcut(tr("Ctrl+Alt+C")); - connect(actionGoToColumn, SIGNAL(activated()), this, SLOT(goToColumn())); - - actionClearTable = new QAction(QPixmap(erase_xpm), tr("Clear"), this); - connect(actionClearTable, SIGNAL(activated()), this, SLOT(clearTable())); - - actionDeleteLayer = new QAction(QIcon(QPixmap(delete_xpm)), tr("&Remove Layer"), this); - actionDeleteLayer->setShortcut( tr("Alt+R") ); - connect(actionDeleteLayer, SIGNAL(activated()), this, SLOT(deleteLayer())); - - actionResizeActiveWindow = new QAction(QIcon(QPixmap(resize_xpm)), tr("Window &Geometry..."), this); - connect(actionResizeActiveWindow, SIGNAL(activated()), this, SLOT(resizeActiveWindow())); - - actionHideActiveWindow = new QAction(tr("&Hide Window"), this); - actionHideActiveWindow->setShortcut(tr("Ctrl+Alt+H")); - connect(actionHideActiveWindow, SIGNAL(activated()), this, SLOT(hideActiveWindow())); - - actionShowMoreWindows = new QAction(tr("More windows..."), this); - connect(actionShowMoreWindows, SIGNAL(activated()), this, SLOT(showMoreWindows())); - - actionPixelLineProfile = new QAction(QIcon(QPixmap(pixelProfile_xpm)), tr("&View Pixel Line Profile"), this); - connect(actionPixelLineProfile, SIGNAL(activated()), this, SLOT(pixelLineProfile())); - - actionIntensityTable = new QAction(tr("&Intensity Table"), this); - connect(actionIntensityTable, SIGNAL(activated()), this, SLOT(intensityTable())); - - actionShowLineDialog = new QAction(tr("&Properties"), this); - connect(actionShowLineDialog, SIGNAL(activated()), this, SLOT(showLineDialog())); - - actionShowTextDialog = new QAction(tr("&Properties"), this); - connect(actionShowTextDialog, SIGNAL(activated()), this, SLOT(showEnrichementDialog())); - - actionActivateWindow = new QAction(tr("&Activate Window"), this); - connect(actionActivateWindow, SIGNAL(activated()), this, SLOT(activateWindow())); - - actionMinimizeWindow = new QAction(tr("Mi&nimize Window"), this); - connect(actionMinimizeWindow, SIGNAL(activated()), this, SLOT(minimizeWindow())); - - actionMaximizeWindow = new QAction(tr("Ma&ximize Window"), this); - connect(actionMaximizeWindow, SIGNAL(activated()), this, SLOT(maximizeWindow())); - - actionHideWindow = new QAction(tr("&Hide Window"), this); - actionHideWindow->setShortcut(tr("Ctrl+Alt+H")); - connect(actionHideWindow, SIGNAL(activated()), this, SLOT(hideWindow())); - - actionResizeWindow = new QAction(QIcon(QPixmap(resize_xpm)), tr("Re&size Window..."), this); - connect(actionResizeWindow, SIGNAL(activated()), this, SLOT(resizeWindow())); - - actionEditSurfacePlot = new QAction(tr("&Surface..."), this); - connect(actionEditSurfacePlot, SIGNAL(activated()), this, SLOT(editSurfacePlot())); - - actionAdd3DData = new QAction(tr("&Data Set..."), this); - connect(actionAdd3DData, SIGNAL(activated()), this, SLOT(add3DData())); - - actionSetMatrixProperties = new QAction(tr("Set &Properties..."), this); - connect(actionSetMatrixProperties, SIGNAL(activated()), this, SLOT(showMatrixDialog())); - - actionSetMatrixDimensions = new QAction(tr("Set &Dimensions..."), this); - connect(actionSetMatrixDimensions, SIGNAL(activated()), this, SLOT(showMatrixSizeDialog())); - actionSetMatrixDimensions->setShortcut(tr("Ctrl+D")); - - actionSetMatrixValues = new QAction(QIcon(QPixmap(formula_xpm)), tr("Set &Values..."), this); - connect(actionSetMatrixValues, SIGNAL(activated()), this, SLOT(showMatrixValuesDialog())); - actionSetMatrixValues->setShortcut(tr("Alt+Q")); - - actionImagePlot = new QAction(QIcon(QPixmap(image_plot_xpm)), tr("&Image Plot"), this); - connect(actionImagePlot, SIGNAL(activated()), this, SLOT(plotImage())); - - actionTransposeMatrix = new QAction(tr("&Transpose"), this); - connect(actionTransposeMatrix, SIGNAL(activated()), this, SLOT(transposeMatrix())); - - actionFlipMatrixVertically = new QAction(QIcon(QPixmap(flip_vertical_xpm)), tr("Flip &V"), this); - actionFlipMatrixVertically->setShortcut(tr("Ctrl+Shift+V")); - connect(actionFlipMatrixVertically, SIGNAL(activated()), this, SLOT(flipMatrixVertically())); - - actionFlipMatrixHorizontally = new QAction(QIcon(QPixmap(flip_horizontal_xpm)), tr("Flip &H"), this); - actionFlipMatrixHorizontally->setShortcut(tr("Ctrl+Shift+H")); - connect(actionFlipMatrixHorizontally, SIGNAL(activated()), this, SLOT(flipMatrixHorizontally())); - - actionRotateMatrix = new QAction(QIcon(QPixmap(rotate_clockwise_xpm)), tr("R&otate 90"), this); - actionRotateMatrix->setShortcut(tr("Ctrl+Shift+R")); - connect(actionRotateMatrix, SIGNAL(activated()), this, SLOT(rotateMatrix90())); - - actionRotateMatrixMinus = new QAction(QIcon(QPixmap(rotate_counterclockwise_xpm)), tr("Rotate &-90"), this); - actionRotateMatrixMinus->setShortcut(tr("Ctrl+Alt+R")); - connect(actionRotateMatrixMinus, SIGNAL(activated()), this, SLOT(rotateMatrixMinus90())); - - actionInvertMatrix = new QAction(tr("&Invert"), this); - connect(actionInvertMatrix, SIGNAL(activated()), this, SLOT(invertMatrix())); - - actionMatrixDeterminant = new QAction(tr("&Determinant"), this); - connect(actionMatrixDeterminant, SIGNAL(activated()), this, SLOT(matrixDeterminant())); - - actionViewMatrixImage = new QAction(tr("&Image mode"), this); - actionViewMatrixImage->setShortcut(tr("Ctrl+Shift+I")); - connect(actionViewMatrixImage, SIGNAL(activated()), this, SLOT(viewMatrixImage())); - actionViewMatrixImage->setCheckable(true); - - actionViewMatrix = new QAction(tr("&Data mode"), this); - actionViewMatrix->setShortcut(tr("Ctrl+Shift+D")); - connect(actionViewMatrix, SIGNAL(activated()), this, SLOT(viewMatrixTable())); - actionViewMatrix->setCheckable(true); - - actionMatrixXY = new QAction(tr("Show &X/Y"), this); - actionMatrixXY->setShortcut(tr("Ctrl+Shift+X")); - connect(actionMatrixXY, SIGNAL(activated()), this, SLOT(viewMatrixXY())); - actionMatrixXY->setCheckable(true); - - actionMatrixColumnRow = new QAction(tr("Show &Column/Row"), this); - actionMatrixColumnRow->setShortcut(tr("Ctrl+Shift+C")); - connect(actionMatrixColumnRow, SIGNAL(activated()), this, SLOT(viewMatrixColumnRow())); - actionMatrixColumnRow->setCheckable(true); - - actionMatrixGrayScale = new QAction(tr("&Gray Scale"), this); - connect(actionMatrixGrayScale, SIGNAL(activated()), this, SLOT(setMatrixGrayScale())); - actionMatrixGrayScale->setCheckable(true); - - actionMatrixDefaultScale = new QAction(tr("&Default"), this); - connect(actionMatrixDefaultScale, SIGNAL(activated()), this, SLOT(setMatrixDefaultScale())); - actionMatrixDefaultScale->setCheckable(true); - - actionMatrixRainbowScale = new QAction(tr("&Rainbow"), this); - connect(actionMatrixRainbowScale, SIGNAL(activated()), this, SLOT(setMatrixRainbowScale())); - actionMatrixRainbowScale->setCheckable(true); - - actionMatrixCustomScale = new QAction(tr("&Custom"), this); - connect(actionMatrixCustomScale, SIGNAL(activated()), this, SLOT(showColorMapDialog())); - actionMatrixCustomScale->setCheckable(true); - - actionExportMatrix = new QAction(tr("&Export Image ..."), this); - connect(actionExportMatrix, SIGNAL(activated()), this, SLOT(exportMatrix())); - - actionConvertMatrixDirect = new QAction(tr("&Direct"), this); - connect(actionConvertMatrixDirect, SIGNAL(activated()), this, SLOT(convertMatrixToTableDirect())); - - actionConvertMatrixXYZ = new QAction(tr("&XYZ Columns"), this); - connect(actionConvertMatrixXYZ, SIGNAL(activated()), this, SLOT(convertMatrixToTableXYZ())); - - actionConvertMatrixYXZ = new QAction(tr("&YXZ Columns"), this); - connect(actionConvertMatrixYXZ, SIGNAL(activated()), this, SLOT(convertMatrixToTableYXZ())); - - actionMatrixFFTDirect = new QAction(tr("&Forward FFT"), this); - connect(actionMatrixFFTDirect, SIGNAL(activated()), this, SLOT(matrixDirectFFT())); - - actionMatrixFFTInverse = new QAction(tr("&Inverse FFT"), this); - connect(actionMatrixFFTInverse, SIGNAL(activated()), this, SLOT(matrixInverseFFT())); - - actionConvertTableDirect= new QAction(tr("&Direct"), this); - connect(actionConvertTableDirect, SIGNAL(activated()), this, SLOT(convertTableToMatrix())); - - actionConvertTableBinning = new QAction(tr("2D &Binning"), this); - connect(actionConvertTableBinning, SIGNAL(activated()), this, SLOT(showBinMatrixDialog())); - - actionConvertTableRegularXYZ = new QAction(tr("&Regular XYZ"), this); - connect(actionConvertTableRegularXYZ, SIGNAL(activated()), this, SLOT(convertTableToMatrixRegularXYZ())); - - actionPlot3DWireFrame = new QAction(QIcon(QPixmap(lineMesh_xpm)), tr("3D &Wire Frame"), this); - connect(actionPlot3DWireFrame, SIGNAL(activated()), this, SLOT(plot3DWireframe())); - - actionPlot3DHiddenLine = new QAction(QIcon(QPixmap(grid_only_xpm)), tr("3D &Hidden Line"), this); - connect(actionPlot3DHiddenLine, SIGNAL(activated()), this, SLOT(plot3DHiddenLine())); - - actionPlot3DPolygons = new QAction(QIcon(QPixmap(no_grid_xpm)), tr("3D &Polygons"), this); - connect(actionPlot3DPolygons, SIGNAL(activated()), this, SLOT(plot3DPolygons())); - - actionPlot3DWireSurface = new QAction(QIcon(QPixmap(grid_poly_xpm)), tr("3D Wire &Surface"), this); - connect(actionPlot3DWireSurface, SIGNAL(activated()), this, SLOT(plot3DWireSurface())); - - actionColorMap = new QAction(QIcon(QPixmap(color_map_xpm)), tr("Contour - &Color Fill"), this); - connect(actionColorMap, SIGNAL(activated()), this, SLOT(plotColorMap())); - - actionContourMap = new QAction(QIcon(QPixmap(contour_map_xpm)), tr("Contour &Lines"), this); - connect(actionContourMap, SIGNAL(activated()), this, SLOT(plotContour())); - - actionGrayMap = new QAction(QIcon(QPixmap(gray_map_xpm)), tr("&Gray Scale Map"), this); - connect(actionGrayMap, SIGNAL(activated()), this, SLOT(plotGrayScale())); - - actionSortTable = new QAction(tr("Sort Ta&ble"), this); - connect(actionSortTable, SIGNAL(activated()), this, SLOT(sortActiveTable())); - - actionSortSelection = new QAction(tr("Sort Columns"), this); - connect(actionSortSelection, SIGNAL(activated()), this, SLOT(sortSelection())); - - actionNormalizeTable = new QAction(tr("&Table"), this); - connect(actionNormalizeTable, SIGNAL(activated()), this, SLOT(normalizeActiveTable())); - - actionNormalizeSelection = new QAction(tr("&Columns"), this); - connect(actionNormalizeSelection, SIGNAL(activated()), this, SLOT(normalizeSelection())); - - actionCorrelate = new QAction(tr("Co&rrelate"), this); - connect(actionCorrelate, SIGNAL(activated()), this, SLOT(correlate())); - - actionAutoCorrelate = new QAction(tr("&Autocorrelate"), this); - connect(actionAutoCorrelate, SIGNAL(activated()), this, SLOT(autoCorrelate())); - - actionConvolute = new QAction(tr("&Convolute"), this); - connect(actionConvolute, SIGNAL(activated()), this, SLOT(convolute())); - - actionDeconvolute = new QAction(tr("&Deconvolute"), this); - connect(actionDeconvolute, SIGNAL(activated()), this, SLOT(deconvolute())); - - actionTranslateHor = new QAction(tr("&Horizontal"), this); - connect(actionTranslateHor, SIGNAL(activated()), this, SLOT(translateCurveHor())); - - actionTranslateVert = new QAction(tr("&Vertical"), this); - connect(actionTranslateVert, SIGNAL(activated()), this, SLOT(translateCurve())); - - actionSetAscValues = new QAction(QIcon(QPixmap(rowNumbers_xpm)),tr("Ro&w Numbers"), this); - connect(actionSetAscValues, SIGNAL(activated()), this, SLOT(setAscValues())); - - actionSetRandomValues = new QAction(QIcon(QPixmap(randomNumbers_xpm)),tr("&Random Values"), this); - connect(actionSetRandomValues, SIGNAL(activated()), this, SLOT(setRandomValues())); - - actionFrequencyCount = new QAction(tr("&Frequency Count ..."), this); - connect(actionFrequencyCount, SIGNAL(activated()), this, SLOT(showFrequencyCountDialog())); - - actionReadOnlyCol = new QAction(tr("&Read Only"), this); - connect(actionReadOnlyCol, SIGNAL(activated()), this, SLOT(setReadOnlyCol())); - - actionSetXCol = new QAction(QIcon(QPixmap(x_col_xpm)), tr("&X"), this); - connect(actionSetXCol, SIGNAL(activated()), this, SLOT(setXCol())); - - actionSetYCol = new QAction(QIcon(QPixmap(y_col_xpm)), tr("&Y"), this); - connect(actionSetYCol, SIGNAL(activated()), this, SLOT(setYCol())); - - actionSetZCol = new QAction(QIcon(QPixmap(z_col_xpm)), tr("&Z"), this); - connect(actionSetZCol, SIGNAL(activated()), this, SLOT(setZCol())); - - actionSetXErrCol = new QAction(tr("X E&rror"), this); - connect(actionSetXErrCol, SIGNAL(activated()), this, SLOT(setXErrCol())); - - actionSetYErrCol = new QAction(QIcon(QPixmap(errors_xpm)), tr("Y &Error"), this); - connect(actionSetYErrCol, SIGNAL(activated()), this, SLOT(setYErrCol())); - - actionDisregardCol = new QAction(QIcon(QPixmap(disregard_col_xpm)), tr("&Disregard"), this); - connect(actionDisregardCol, SIGNAL(activated()), this, SLOT(disregardCol())); - - actionSetLabelCol = new QAction(QIcon(QPixmap(set_label_col_xpm)), tr("&Label"), this); - connect(actionSetLabelCol, SIGNAL(activated()), this, SLOT(setLabelCol())); - - actionBoxPlot = new QAction(QIcon(QPixmap(boxPlot_xpm)),tr("&Box Plot"), this); - connect(actionBoxPlot, SIGNAL(activated()), this, SLOT(plotBoxDiagram())); - - actionMultiPeakGauss = new QAction(tr("&Gaussian..."), this); - connect(actionMultiPeakGauss, SIGNAL(activated()), this, SLOT(fitMultiPeakGauss())); - - actionMultiPeakLorentz = new QAction(tr("&Lorentzian..."), this); - connect(actionMultiPeakLorentz, SIGNAL(activated()), this, SLOT(fitMultiPeakLorentz())); - - actionCheckUpdates = new QAction(tr("Search for &Updates"), this); - connect(actionCheckUpdates, SIGNAL(activated()), this, SLOT(searchForUpdates())); - - actionHomePage = new QAction(tr("&QtiPlot Homepage"), this); - connect(actionHomePage, SIGNAL(activated()), this, SLOT(showHomePage())); - - actionHelpForums = new QAction(tr("QtiPlot &Forums"), this); - connect(actionHelpForums, SIGNAL(triggered()), this, SLOT(showForums())); - - actionHelpBugReports = new QAction(tr("Report a &Bug"), this); - connect(actionHelpBugReports, SIGNAL(triggered()), this, SLOT(showBugTracker())); - - actionDownloadManual = new QAction(tr("Download &Manual"), this); - connect(actionDownloadManual, SIGNAL(activated()), this, SLOT(downloadManual())); - - actionTranslations = new QAction(tr("&Translations"), this); - connect(actionTranslations, SIGNAL(activated()), this, SLOT(downloadTranslation())); - - actionDonate = new QAction(tr("Make a &Donation"), this); - connect(actionDonate, SIGNAL(activated()), this, SLOT(showDonationsPage())); - - actionTechnicalSupport = new QAction(tr("Technical &Support"), this); - connect(actionTechnicalSupport, SIGNAL(activated()), this, SLOT(showSupportPage())); - -#ifdef SCRIPTING_DIALOG - actionScriptingLang = new QAction(tr("Scripting &language"), this); - connect(actionScriptingLang, SIGNAL(activated()), this, SLOT(showScriptingLangDialog())); -#endif - - actionRestartScripting = new QAction(tr("&Restart scripting"), this); - connect(actionRestartScripting, SIGNAL(activated()), this, SLOT(restartScriptingEnv())); - - actionNoteExecute = new QAction(tr("E&xecute"), this); - actionNoteExecute->setShortcut(tr("Ctrl+J")); - connect(actionNoteExecute, SIGNAL(activated()), this, SLOT(execute())); - - actionNoteExecuteAll = new QAction(QIcon(QPixmap(play_xpm)), tr("Execute &All"), this); - actionNoteExecuteAll->setShortcut(tr("Ctrl+Shift+J")); - connect(actionNoteExecuteAll, SIGNAL(activated()), this, SLOT(executeAll())); - - actionNoteEvaluate = new QAction(tr("&Evaluate Expression"), this); - actionNoteEvaluate->setShortcut(tr("Ctrl+Return")); - connect(actionNoteEvaluate, SIGNAL(activated()), this, SLOT(evaluate())); - - actionShowNoteLineNumbers = new QAction(tr("Show Line &Numbers"), this); - actionShowNoteLineNumbers->setCheckable(true); - connect(actionShowNoteLineNumbers, SIGNAL(toggled(bool)), this, SLOT(showNoteLineNumbers(bool))); - - actionFind = new QAction(QIcon(QPixmap(find_xpm)), tr("&Find..."), this); - actionFind->setShortcut(tr("Ctrl+Alt+F")); - connect(actionFind, SIGNAL(activated()), this, SLOT(noteFindDialogue())); - - actionFindNext = new QAction(QIcon(QPixmap(find_next_xpm)), tr("Find &Next"), this); - actionFindNext->setShortcut(tr("F3")); - connect(actionFindNext, SIGNAL(activated()), this, SLOT(noteFindNext())); - - actionFindPrev = new QAction(QIcon(QPixmap(find_previous_xpm)), tr("Find &Previous"), this); - actionFindPrev->setShortcut(tr("F4")); - connect(actionFindPrev, SIGNAL(activated()), this, SLOT(noteFindPrev())); - - actionReplace = new QAction(QIcon(QPixmap(replace_xpm)), tr("&Replace..."), this); - connect(actionReplace, SIGNAL(activated()), this, SLOT(noteReplaceDialogue())); - - actionIncreaseIndent = new QAction(QIcon(QPixmap(increase_indent_xpm)), tr("Increase Indent"), this); - connect(actionIncreaseIndent, SIGNAL(activated()), this, SLOT(increaseNoteIndent())); - - actionDecreaseIndent = new QAction(QIcon(QPixmap(decrease_indent_xpm)),tr("Decrease Indent"), this); - connect(actionDecreaseIndent, SIGNAL(activated()), this, SLOT(decreaseNoteIndent())); - - actionRenameNoteTab = new QAction(tr("Rena&me Tab..."), this); - connect(actionRenameNoteTab, SIGNAL(activated()), this, SLOT(renameCurrentNoteTab())); - - actionAddNoteTab = new QAction(QIcon(QPixmap(plus_xpm)), tr("A&dd Tab"), this); - connect(actionAddNoteTab, SIGNAL(activated()), this, SLOT(addNoteTab())); - - actionCloseNoteTab = new QAction(QIcon(QPixmap(delete_xpm)), tr("C&lose Tab"), this); - connect(actionCloseNoteTab, SIGNAL(activated()), this, SLOT(closeNoteTab())); - -#ifdef SCRIPTING_PYTHON - actionShowScriptWindow = new QAction(QPixmap(python_xpm), tr("&Script Window"), this); - actionShowScriptWindow->setShortcut(QKeySequence(Qt::ALT + Qt::Key_F3)); - actionShowScriptWindow->setToggleAction( true ); - connect(actionShowScriptWindow, SIGNAL(activated()), this, SLOT(showScriptWindow())); - - actionOpenQtDesignerUi = new QAction(tr("Load Custom User &Interface..."), this); - connect(actionOpenQtDesignerUi, SIGNAL(activated()), this, SLOT(openQtDesignerUi())); -#endif - - actionShowCurvePlotDialog = new QAction(tr("&Plot details..."), this); - connect(actionShowCurvePlotDialog, SIGNAL(activated()), this, SLOT(showCurvePlotDialog())); - - actionShowCurveWorksheet = new QAction(tr("&Worksheet"), this); - connect(actionShowCurveWorksheet, SIGNAL(activated()), this, SLOT(showCurveWorksheet())); - - actionCurveFullRange = new QAction(tr("&Reset to Full Range"), this); - connect(actionCurveFullRange, SIGNAL(activated()), this, SLOT(setCurveFullRange())); - - actionEditCurveRange = new QAction(tr("Edit &Range..."), this); - connect(actionEditCurveRange, SIGNAL(activated()), this, SLOT(showCurveRangeDialog())); - - actionRemoveCurve = new QAction(QPixmap(close_xpm), tr("&Delete"), this); - connect(actionRemoveCurve, SIGNAL(activated()), this, SLOT(removeCurve())); - - actionHideCurve = new QAction(tr("&Hide"), this); - connect(actionHideCurve, SIGNAL(activated()), this, SLOT(hideCurve())); - - actionHideOtherCurves = new QAction(tr("Hide &Other Curves"), this); - connect(actionHideOtherCurves, SIGNAL(activated()), this, SLOT(hideOtherCurves())); - - actionShowAllCurves = new QAction(tr("&Show All Curves"), this); - connect(actionShowAllCurves, SIGNAL(activated()), this, SLOT(showAllCurves())); - - actionEditFunction = new QAction(tr("&Edit Function..."), this); - connect(actionEditFunction, SIGNAL(activated()), this, SLOT(showFunctionDialog())); - - actionToolBars = new QAction(tr("&Toolbars..."), this); - actionToolBars->setShortcut(tr("Ctrl+Shift+T")); - connect(actionToolBars, SIGNAL(activated()), this, SLOT(showToolBarsMenu())); - - actionFontBold = new QAction("B", this); - actionFontBold->setToolTip(tr("Bold")); - QFont font = appFont; - font.setBold(true); - actionFontBold->setFont(font); - actionFontBold->setCheckable(true); - connect(actionFontBold, SIGNAL(toggled(bool)), this, SLOT(setBoldFont(bool))); - - actionFontItalic = new QAction("It", this); - actionFontItalic->setToolTip(tr("Italic")); - font = appFont; - font.setItalic(true); - actionFontItalic->setFont(font); - actionFontItalic->setCheckable(true); - connect(actionFontItalic, SIGNAL(toggled(bool)), this, SLOT(setItalicFont(bool))); - - actionSuperscript = new QAction(QPixmap(exp_xpm), tr("Superscript"), this); - connect(actionSuperscript, SIGNAL(activated()), this, SLOT(insertSuperscript())); - actionSuperscript->setEnabled(false); - - actionSubscript = new QAction(QPixmap(index_xpm), tr("Subscript"), this); - connect(actionSubscript, SIGNAL(activated()), this, SLOT(insertSubscript())); - actionSubscript->setEnabled(false); - - actionUnderline = new QAction("U", this); - actionUnderline->setToolTip(tr("Underline (Ctrl+U)")); - actionUnderline->setShortcut(tr("Ctrl+U")); - font = appFont; - font.setUnderline(true); - actionUnderline->setFont(font); - connect(actionUnderline, SIGNAL(activated()), this, SLOT(underline())); - actionUnderline->setEnabled(false); - - actionGreekSymbol = new QAction(QString(QChar(0x3B1)) + QString(QChar(0x3B2)), this); - actionGreekSymbol->setToolTip(tr("Greek")); - connect(actionGreekSymbol, SIGNAL(activated()), this, SLOT(insertGreekSymbol())); - - actionGreekMajSymbol = new QAction(QString(QChar(0x393)), this); - actionGreekMajSymbol->setToolTip(tr("Greek")); - connect(actionGreekMajSymbol, SIGNAL(activated()), this, SLOT(insertGreekMajSymbol())); - - actionMathSymbol = new QAction(QString(QChar(0x222B)), this); - actionMathSymbol->setToolTip(tr("Mathematical Symbols")); - connect(actionMathSymbol, SIGNAL(activated()), this, SLOT(insertMathSymbol())); - - actionIncreasePrecision = new QAction(QPixmap(increase_decimals_xpm), tr("Increase Precision"), this); - connect(actionIncreasePrecision, SIGNAL(activated()), this, SLOT(increasePrecision())); - - actionDecreasePrecision = new QAction(QPixmap(decrease_decimals_xpm), tr("Decrease Precision"), this); - connect(actionDecreasePrecision, SIGNAL(activated()), this, SLOT(decreasePrecision())); -} - -void ApplicationWindow::translateActionsStrings() -{ - actionFontBold->setToolTip(tr("Bold")); - actionFontItalic->setToolTip(tr("Italic")); - actionUnderline->setStatusTip(tr("Underline (Ctrl+U)")); - actionUnderline->setShortcut(tr("Ctrl+U")); - actionGreekSymbol->setToolTip(tr("Greek")); - actionGreekMajSymbol->setToolTip(tr("Greek")); - actionMathSymbol->setToolTip(tr("Mathematical Symbols")); - - actionShowCurvePlotDialog->setMenuText(tr("&Plot details...")); - actionShowCurveWorksheet->setMenuText(tr("&Worksheet")); - actionRemoveCurve->setMenuText(tr("&Delete")); - actionEditFunction->setMenuText(tr("&Edit Function...")); - - actionCurveFullRange->setMenuText(tr("&Reset to Full Range")); - actionEditCurveRange->setMenuText(tr("Edit &Range...")); - actionHideCurve->setMenuText(tr("&Hide")); - actionHideOtherCurves->setMenuText(tr("Hide &Other Curves")); - actionShowAllCurves->setMenuText(tr("&Show All Curves")); - - actionNewProject->setMenuText(tr("New &Project")); - actionNewProject->setToolTip(tr("Open a new project")); - actionNewProject->setShortcut(tr("Ctrl+N")); - - actionAppendProject->setMenuText(tr("App&end Project...")); - actionAppendProject->setToolTip(tr("Append a project to the current folder")); - actionAppendProject->setShortcut(tr("Ctrl+Alt+A")); - - actionNewFolder->setMenuText(tr("New Fol&der")); - actionNewFolder->setToolTip(tr("Create a new folder")); - actionNewFolder->setShortcut(Qt::Key_F7); - - actionNewGraph->setMenuText(tr("New &Graph")); - actionNewGraph->setToolTip(tr("Create an empty 2D plot")); - actionNewGraph->setShortcut(tr("Ctrl+G")); - - actionNewNote->setMenuText(tr("New &Note")); - actionNewNote->setToolTip(tr("Create an empty note window")); - - actionNewTable->setMenuText(tr("New &Table")); - actionNewTable->setShortcut(tr("Ctrl+T")); - actionNewTable->setToolTip(tr("New table")); - - actionNewMatrix->setMenuText(tr("New &Matrix")); - actionNewMatrix->setShortcut(tr("Ctrl+M")); - actionNewMatrix->setToolTip(tr("New matrix")); - - actionNewFunctionPlot->setMenuText(tr("New &Function Plot")); - actionNewFunctionPlot->setToolTip(tr("Create a new 2D function plot")); - actionNewFunctionPlot->setShortcut(tr("Ctrl+F")); - - actionNewSurfacePlot->setMenuText(tr("New 3D &Surface Plot")); - actionNewSurfacePlot->setToolTip(tr("Create a new 3D surface plot")); - actionNewSurfacePlot->setShortcut(tr("Ctrl+ALT+Z")); - - actionOpen->setMenuText(tr("&Open")); - actionOpen->setShortcut(tr("Ctrl+O")); - actionOpen->setToolTip(tr("Open project")); - - actionLoadImage->setMenuText(tr("Open Image &File")); - actionLoadImage->setShortcut(tr("Ctrl+I")); - - actionImportSound->setMenuText(tr("&Sound (WAV)...")); - actionImportImage->setMenuText(tr("Import I&mage...")); - - actionSaveProject->setMenuText(tr("&Save Project")); - actionSaveProject->setToolTip(tr("Save project")); - actionSaveProject->setShortcut(tr("Ctrl+S")); - - actionSaveProjectAs->setMenuText(tr("Save Project &As...")); - actionSaveProjectAs->setShortcut( tr("Ctrl+Shift+S") ); - - actionOpenTemplate->setMenuText(tr("Open Te&mplate...")); - actionOpenTemplate->setToolTip(tr("Open template")); - - actionSaveTemplate->setMenuText(tr("Save As &Template...")); - actionSaveTemplate->setToolTip(tr("Save window as template")); - - actionLoad->setMenuText(tr("&Import ASCII...")); - actionLoad->setToolTip(tr("Import data file(s)")); - actionLoad->setShortcut(tr("Ctrl+K")); - - actionUndo->setMenuText(tr("&Undo")); - actionUndo->setToolTip(tr("Undo changes")); - actionUndo->setShortcut(tr("Ctrl+Z")); - - actionRedo->setMenuText(tr("&Redo")); - actionRedo->setToolTip(tr("Redo changes")); - - actionCopyWindow->setMenuText(tr("&Duplicate")); - actionCopyWindow->setToolTip(tr("Duplicate window")); - actionCopyWindow->setShortcut(tr("Ctrl+Alt+D")); - - actionCutSelection->setMenuText(tr("Cu&t Selection")); - actionCutSelection->setToolTip(tr("Cut selection")); - actionCutSelection->setShortcut(tr("Ctrl+X")); - - actionCopySelection->setMenuText(tr("&Copy Selection")); - actionCopySelection->setToolTip(tr("Copy selection")); - actionCopySelection->setShortcut(tr("Ctrl+C")); - - actionPasteSelection->setMenuText(tr("&Paste Selection")); - actionPasteSelection->setToolTip(tr("Paste selection")); - actionPasteSelection->setShortcut(tr("Ctrl+V")); - - actionClearSelection->setMenuText(tr("&Delete Selection")); - actionClearSelection->setToolTip(tr("Delete selection")); - actionClearSelection->setShortcut(tr("Del","delete key")); - - actionShowExplorer->setMenuText(tr("Project &Explorer")); - actionShowExplorer->setShortcut(tr("Ctrl+E")); - actionShowExplorer->setToolTip(tr("Show project explorer")); - - actionFindWindow->setMenuText(tr("&Find...")); - - actionShowLog->setMenuText(tr("Results &Log")); - actionShowLog->setToolTip(tr("Show analysis results")); - - actionShowUndoStack->setMenuText(tr("&Undo/Redo Stack")); - actionShowUndoStack->setToolTip(tr("Show available undo/redo commands")); - -#ifdef SCRIPTING_CONSOLE - actionShowConsole->setMenuText(tr("&Console")); - actionShowConsole->setToolTip(tr("Show Scripting console")); -#endif - -#ifdef SCRIPTING_PYTHON - actionShowScriptWindow->setMenuText(tr("&Script Window")); - actionShowScriptWindow->setToolTip(tr("Script Window")); - actionOpenQtDesignerUi->setMenuText(tr("Load Custom User &Interface...")); -#endif - - actionCustomActionDialog->setMenuText(tr("Add &Custom Script Action...")); - - actionAddLayer->setMenuText(tr("Add La&yer")); - actionAddLayer->setToolTip(tr("Add Layer")); - actionAddLayer->setShortcut(tr("ALT+L")); - - actionShowLayerDialog->setMenuText(tr("Arran&ge Layers")); - actionShowLayerDialog->setToolTip(tr("Arrange Layers")); - actionShowLayerDialog->setShortcut(tr("Shift+A")); - - actionAutomaticLayout->setMenuText(tr("Automatic Layout")); - actionAutomaticLayout->setToolTip(tr("Automatic Layout")); - - actionExportGraph->setMenuText(tr("&Current")); - actionExportGraph->setShortcut(tr("Ctrl+Alt+G")); - actionExportGraph->setToolTip(tr("Export current graph")); - - actionExportAllGraphs->setMenuText(tr("&All")); - actionExportAllGraphs->setShortcut(tr("Alt+X")); - actionExportAllGraphs->setToolTip(tr("Export all graphs")); - - actionPresentationODF->setMenuText(tr("Create Open &Document Presentation...")); - - actionExportPDF->setMenuText(tr("&Export PDF")); - actionExportPDF->setShortcut(tr("Ctrl+Alt+P")); - actionExportPDF->setToolTip(tr("Export to PDF")); - - actionPrint->setMenuText(tr("&Print")); - actionPrint->setShortcut(tr("Ctrl+P")); - actionPrint->setToolTip(tr("Print window")); - - actionPrintPreview->setMenuText(tr("Print Pre&view")); - actionPrintPreview->setToolTip(tr("Print preview")); - - actionPrintAllPlots->setMenuText(tr("Print All Plo&ts")); - actionShowExportASCIIDialog->setMenuText(tr("E&xport ASCII")); - - actionCloseAllWindows->setMenuText(tr("&Quit")); - actionCloseAllWindows->setShortcut(tr("Ctrl+Q")); - actionCloseProject->setMenuText(tr("&Close")); - - actionClearLogInfo->setMenuText(tr("Clear &Log Information")); - actionDeleteFitTables->setMenuText(tr("Delete &Fit Tables")); - - actionToolBars->setMenuText(tr("&Toolbars...")); - actionToolBars->setShortcut(tr("Ctrl+Shift+T")); - - actionShowPlotWizard->setMenuText(tr("Plot &Wizard")); - actionShowPlotWizard->setShortcut(tr("Ctrl+Alt+W")); - - actionShowConfigureDialog->setMenuText(tr("&Preferences...")); - - actionShowCurvesDialog->setMenuText(tr("Add/Remove &Curve...")); - actionShowCurvesDialog->setShortcut(tr("ALT+C")); - actionShowCurvesDialog->setToolTip(tr("Add curve to graph")); - - actionAddErrorBars->setMenuText(tr("Add &Error Bars...")); - actionAddErrorBars->setToolTip(tr("Add Error Bars...")); - actionAddErrorBars->setShortcut(tr("Ctrl+B")); - - actionAddFunctionCurve->setMenuText(tr("Add &Function...")); - actionAddFunctionCurve->setToolTip(tr("Add Function...")); - actionAddFunctionCurve->setShortcut(tr("Ctrl+Alt+F")); - - actionUnzoom->setMenuText(tr("&Rescale to Show All")); - actionUnzoom->setShortcut(tr("Ctrl+Shift+R")); - actionUnzoom->setToolTip(tr("Best fit")); - - actionNewLegend->setMenuText( tr("New &Legend")); - actionNewLegend->setShortcut(tr("Ctrl+L")); - actionNewLegend->setToolTip(tr("Add new legend")); - - actionTimeStamp->setMenuText(tr("Add Time Stamp")); - actionTimeStamp->setShortcut(tr("Ctrl+ALT+T")); - actionTimeStamp->setToolTip(tr("Date & time ")); - - actionAddImage->setMenuText(tr("Add &Image")); - actionAddImage->setToolTip(tr("Add Image")); - actionAddImage->setShortcut(tr("ALT+I")); - - actionPlotL->setMenuText(tr("&Line")); - actionPlotL->setToolTip(tr("Plot as line")); - - actionPlotP->setMenuText(tr("&Scatter")); - actionPlotP->setToolTip(tr("Plot as symbols")); - - actionPlotLP->setMenuText(tr("Line + S&ymbol")); - actionPlotLP->setToolTip(tr("Plot as line + symbols")); - - actionPlotVerticalDropLines->setMenuText(tr("Vertical &Drop Lines")); - - actionPlotSpline->setMenuText(tr("&Spline")); - actionPlotVertSteps->setMenuText(tr("&Vertical Steps")); - actionPlotHorSteps->setMenuText(tr("&Horizontal Steps")); - - actionPlotVerticalBars->setMenuText(tr("&Columns")); - actionPlotVerticalBars->setToolTip(tr("Plot with vertical bars")); - - actionPlotHorizontalBars->setMenuText(tr("&Rows")); - actionPlotHorizontalBars->setToolTip(tr("Plot with horizontal bars")); - - actionStackBars->setMenuText(tr("Stack &Bar")); - actionStackBars->setToolTip(tr("Plot stack bar")); - - actionStackColumns->setMenuText(tr("Stack &Column")); - actionStackColumns->setToolTip(tr("Plot stack column")); - - actionPlotArea->setMenuText(tr("&Area")); - actionPlotArea->setToolTip(tr("Plot area")); - - actionPlotPie->setMenuText(tr("&Pie")); - actionPlotPie->setToolTip(tr("Plot pie")); - - actionPlotVectXYXY->setMenuText(tr("&Vectors XYXY")); - actionPlotVectXYXY->setToolTip(tr("Vectors XYXY")); - - actionPlotVectXYAM->setMenuText(tr("Vectors XY&AM")); - actionPlotVectXYAM->setToolTip(tr("Vectors XYAM")); - - actionPlotHistogram->setMenuText( tr("&Histogram")); - actionPlotStackedHistograms->setMenuText(tr("&Stacked Histogram")); - actionPlot2VerticalLayers->setMenuText(tr("&Vertical 2 Layers")); - actionPlot2HorizontalLayers->setMenuText(tr("&Horizontal 2 Layers")); - actionPlot4Layers->setMenuText(tr("&4 Layers")); - actionPlotStackedLayers->setMenuText(tr("&Stacked Layers")); - actionStemPlot->setMenuText(tr("Stem-and-&Leaf Plot")); - actionStemPlot->setToolTip(tr("Stem-and-Leaf Plot")); - - actionPlotDoubleYAxis->setMenuText(tr("D&ouble-Y")); - actionPlotDoubleYAxis->setToolTip(tr("Double Y Axis")); - - actionAddZoomPlot->setMenuText(tr("&Zoom")); - actionAddZoomPlot->setToolTip(tr("Zoom")); - - actionExtractGraphs->setMenuText(tr("E&xtract to Graphs")); - actionExtractGraphs->setToolTip(tr("Extract to Graphs")); - - actionExtractLayers->setMenuText(tr("Extract to Layer&s")); - actionExtractLayers->setToolTip(tr("Extract to Layers")); - - actionPlot3DRibbon->setMenuText(tr("&Ribbon")); - actionPlot3DRibbon->setToolTip(tr("Plot 3D ribbon")); - - actionPlot3DBars->setMenuText(tr("&Bars")); - actionPlot3DBars->setToolTip(tr("Plot 3D bars")); - - actionPlot3DScatter->setMenuText(tr("&Scatter")); - actionPlot3DScatter->setToolTip(tr("Plot 3D scatter")); - - actionPlot3DTrajectory->setMenuText(tr("&Trajectory")); - actionPlot3DTrajectory->setToolTip(tr("Plot 3D trajectory")); - - actionColorMap->setMenuText(tr("Contour + &Color Fill")); - actionColorMap->setToolTip(tr("Contour Lines + Color Fill")); - - actionContourMap->setMenuText(tr("Contour &Lines")); - actionContourMap->setToolTip(tr("Contour Lines")); - - actionGrayMap->setMenuText(tr("&Gray Scale Map")); - actionGrayMap->setToolTip(tr("Gray Scale Map")); - - actionShowColStatistics->setMenuText(tr("Statistics on &Columns")); - actionShowColStatistics->setToolTip(tr("Selected columns statistics")); - - actionShowRowStatistics->setMenuText(tr("Statistics on &Rows")); - actionShowRowStatistics->setToolTip(tr("Selected rows statistics")); - actionShowIntDialog->setMenuText(tr("Integr&ate Function...")); - actionIntegrate->setMenuText(tr("&Integrate")); - actionInterpolate->setMenuText(tr("Inte&rpolate ...")); - actionLowPassFilter->setMenuText(tr("&Low Pass...")); - actionHighPassFilter->setMenuText(tr("&High Pass...")); - actionBandPassFilter->setMenuText(tr("&Band Pass...")); - actionBandBlockFilter->setMenuText(tr("&Band Block...")); - actionFFT->setMenuText(tr("&FFT...")); - actionSmoothSavGol->setMenuText(tr("&Savitzky-Golay...")); - actionSmoothFFT->setMenuText(tr("&FFT Filter...")); - actionSmoothAverage->setMenuText(tr("Moving Window &Average...")); - actionSmoothLowess->setMenuText(tr("&Lowess...")); - actionDifferentiate->setMenuText(tr("&Differentiate")); - actionFitLinear->setMenuText(tr("Fit &Linear")); - actionFitSlope->setMenuText(tr("Fit Slop&e")); - actionShowFitPolynomDialog->setMenuText(tr("Fit &Polynomial ...")); - actionShowExpDecayDialog->setMenuText(tr("&First Order ...")); - actionShowTwoExpDecayDialog->setMenuText(tr("&Second Order ...")); - actionShowExpDecay3Dialog->setMenuText(tr("&Third Order ...")); - actionFitExpGrowth->setMenuText(tr("Fit Exponential Gro&wth ...")); - actionFitSigmoidal->setMenuText(tr("Fit &Boltzmann (Sigmoidal)")); - actionFitGauss->setMenuText(tr("Fit &Gaussian")); - actionFitLorentz->setMenuText(tr("Fit Lorent&zian")); - - actionShowFitDialog->setMenuText(tr("Fit &Wizard...")); - actionShowFitDialog->setShortcut(tr("Ctrl+Y")); - - actionShowPlotDialog->setMenuText(tr("&Plot ...")); - actionShowScaleDialog->setMenuText(tr("&Scales...")); - actionShowAxisDialog->setMenuText(tr("&Axes...")); - actionShowGridDialog->setMenuText(tr("&Grid ...")); - actionShowTitleDialog->setMenuText(tr("&Title ...")); - actionShowColumnOptionsDialog->setMenuText(tr("Column &Options ...")); - actionShowColumnOptionsDialog->setShortcut(tr("Ctrl+Alt+O")); - actionShowColumnValuesDialog->setMenuText(tr("Set Column &Values ...")); - actionShowColumnValuesDialog->setShortcut(tr("Alt+Q")); - actionTableRecalculate->setMenuText(tr("Recalculate")); - actionTableRecalculate->setShortcut(tr("Ctrl+Return")); - actionHideSelectedColumns->setMenuText(tr("&Hide Selected")); - actionHideSelectedColumns->setToolTip(tr("Hide selected columns")); - actionShowAllColumns->setMenuText(tr("Sho&w All Columns")); - actionHideSelectedColumns->setToolTip(tr("Show all table columns")); - actionSwapColumns->setMenuText(tr("&Swap columns")); - actionSwapColumns->setToolTip(tr("Swap selected columns")); - actionMoveColRight->setMenuText(tr("Move &Right")); - actionMoveColRight->setToolTip(tr("Move Right")); - actionMoveColLeft->setMenuText(tr("Move &Left")); - actionMoveColLeft->setToolTip(tr("Move Left")); - actionMoveColFirst->setMenuText(tr("Move to F&irst")); - actionMoveColFirst->setToolTip(tr("Move to First")); - actionMoveColLast->setMenuText(tr("Move to Las&t")); - actionMoveColLast->setToolTip(tr("Move to Last")); - actionShowColsDialog->setMenuText(tr("&Columns...")); - actionShowRowsDialog->setMenuText(tr("&Rows...")); - actionDeleteRows->setMenuText(tr("&Delete Rows Interval...")); - actionMoveRowUp->setMenuText(tr("&Upward")); - actionMoveRowUp->setToolTip(tr("Move current row upward")); - actionMoveRowDown->setMenuText(tr("&Downward")); - actionMoveRowDown->setToolTip(tr("Move current row downward")); - actionAdjustColumnWidth->setMenuText(tr("Ad&just Column Width")); - actionAdjustColumnWidth->setToolTip(tr("Set optimal column width")); - - actionAbout->setMenuText(tr("&About QtiPlot")); - actionAbout->setShortcut(tr("F1")); - - actionShowHelp->setMenuText(tr("&Help")); - actionShowHelp->setShortcut(tr("Ctrl+H")); - - actionChooseHelpFolder->setMenuText(tr("&Choose Help Folder...")); - actionRename->setMenuText(tr("&Rename Window")); - - actionCloseWindow->setMenuText(tr("Close &Window")); - actionCloseWindow->setShortcut(tr("Ctrl+W")); - - actionAddColToTable->setMenuText(tr("Add Column")); - actionAddColToTable->setToolTip(tr("Add Column")); - actionAddColToTable->setShortcut(tr("Alt+C")); - - actionClearTable->setMenuText(tr("Clear")); - actionGoToRow->setMenuText(tr("&Go to Row...")); - actionGoToRow->setShortcut(tr("Ctrl+Alt+G")); - - actionGoToColumn->setMenuText(tr("Go to Colum&n...")); - actionGoToColumn->setShortcut(tr("Ctrl+Alt+C")); - - actionDeleteLayer->setMenuText(tr("&Remove Layer")); - actionDeleteLayer->setShortcut(tr("Alt+R")); - - actionResizeActiveWindow->setMenuText(tr("Window &Geometry...")); - actionHideActiveWindow->setMenuText(tr("&Hide Window")); - actionHideActiveWindow->setShortcut(tr("Ctrl+Alt+H")); - actionShowMoreWindows->setMenuText(tr("More Windows...")); - actionPixelLineProfile->setMenuText(tr("&View Pixel Line Profile")); - actionIntensityTable->setMenuText(tr("&Intensity Table")); - actionShowLineDialog->setMenuText(tr("&Properties")); - actionShowTextDialog->setMenuText(tr("&Properties")); - actionActivateWindow->setMenuText(tr("&Activate Window")); - actionMinimizeWindow->setMenuText(tr("Mi&nimize Window")); - actionMaximizeWindow->setMenuText(tr("Ma&ximize Window")); - actionHideWindow->setMenuText(tr("&Hide Window")); - actionHideWindow->setShortcut(tr("Ctrl+Alt+H")); - actionResizeWindow->setMenuText(tr("Re&size Window...")); - actionEditSurfacePlot->setMenuText(tr("&Surface...")); - actionAdd3DData->setMenuText(tr("&Data Set...")); - actionSetMatrixProperties->setMenuText(tr("Set &Properties...")); - actionSetMatrixDimensions->setMenuText(tr("Set &Dimensions...")); - actionSetMatrixDimensions->setShortcut(tr("Ctrl+D")); - actionSetMatrixValues->setMenuText(tr("Set &Values...")); - actionSetMatrixValues->setToolTip(tr("Set Matrix Values")); - actionSetMatrixValues->setShortcut(tr("Alt+Q")); - actionImagePlot->setMenuText(tr("&Image Plot")); - actionImagePlot->setToolTip(tr("Image Plot")); - actionTransposeMatrix->setMenuText(tr("&Transpose")); - actionRotateMatrix->setMenuText(tr("R&otate 90")); - actionRotateMatrix->setToolTip(tr("Rotate 90 Clockwise")); - actionRotateMatrixMinus->setMenuText(tr("Rotate &-90")); - actionRotateMatrixMinus->setToolTip(tr("Rotate 90 Counterclockwise")); - actionFlipMatrixVertically->setMenuText(tr("Flip &V")); - actionFlipMatrixVertically->setToolTip(tr("Flip Vertically")); - actionFlipMatrixHorizontally->setMenuText(tr("Flip &H")); - actionFlipMatrixHorizontally->setToolTip(tr("Flip Horizontally")); - - actionMatrixXY->setMenuText(tr("Show &X/Y")); - actionMatrixColumnRow->setMenuText(tr("Show &Column/Row")); - actionViewMatrix->setMenuText(tr("&Data mode")); - actionViewMatrixImage->setMenuText(tr("&Image mode")); - actionMatrixDefaultScale->setMenuText(tr("&Default")); - actionMatrixGrayScale->setMenuText(tr("&Gray Scale")); - actionMatrixRainbowScale->setMenuText(tr("&Rainbow")); - actionMatrixCustomScale->setMenuText(tr("&Custom")); - actionInvertMatrix->setMenuText(tr("&Invert")); - actionMatrixDeterminant->setMenuText(tr("&Determinant")); - actionConvertMatrixDirect->setMenuText(tr("&Direct")); - actionConvertMatrixXYZ->setMenuText(tr("&XYZ Columns")); - actionConvertMatrixYXZ->setMenuText(tr("&YXZ Columns")); - actionExportMatrix->setMenuText(tr("&Export Image ...")); - - actionConvertTableDirect->setMenuText(tr("&Direct")); - actionConvertTableBinning->setMenuText(tr("2D &Binning")); - actionConvertTableRegularXYZ->setMenuText(tr("&Regular XYZ")); - - actionPlot3DWireFrame->setMenuText(tr("3D &Wire Frame")); - actionPlot3DHiddenLine->setMenuText(tr("3D &Hidden Line")); - actionPlot3DPolygons->setMenuText(tr("3D &Polygons")); - actionPlot3DWireSurface->setMenuText(tr("3D Wire &Surface")); - actionSortTable->setMenuText(tr("Sort Ta&ble")); - actionSortSelection->setMenuText(tr("Sort Columns")); - actionNormalizeTable->setMenuText(tr("&Table")); - actionNormalizeSelection->setMenuText(tr("&Columns")); - actionCorrelate->setMenuText(tr("Co&rrelate")); - actionAutoCorrelate->setMenuText(tr("&Autocorrelate")); - actionConvolute->setMenuText(tr("&Convolute")); - actionDeconvolute->setMenuText(tr("&Deconvolute")); - actionTranslateHor->setMenuText(tr("&Horizontal")); - actionTranslateVert->setMenuText(tr("&Vertical")); - actionSetAscValues->setMenuText(tr("Ro&w Numbers")); - actionSetAscValues->setToolTip(tr("Fill selected columns with row numbers")); - actionSetRandomValues->setMenuText(tr("&Random Values")); - actionSetRandomValues->setToolTip(tr("Fill selected columns with random numbers")); - actionFrequencyCount->setMenuText(tr("&Frequency Count ...")); - actionSetXCol->setMenuText(tr("&X")); - actionSetXCol->setToolTip(tr("Set column as X")); - actionSetYCol->setMenuText(tr("&Y")); - actionSetYCol->setToolTip(tr("Set column as Y")); - actionSetZCol->setMenuText(tr("&Z")); - actionSetZCol->setToolTip(tr("Set column as Z")); - actionSetXErrCol->setMenuText(tr("X E&rror")); - actionSetYErrCol->setMenuText(tr("Y &Error")); - actionSetYErrCol->setToolTip(tr("Set as Y Error Bars")); - actionSetLabelCol->setMenuText(tr("&Label")); - actionSetLabelCol->setToolTip(tr("Set as Labels")); - actionDisregardCol->setMenuText(tr("&Disregard")); - actionDisregardCol->setToolTip(tr("Disregard Columns")); - actionReadOnlyCol->setMenuText(tr("&Read Only")); - - actionBoxPlot->setMenuText(tr("&Box Plot")); - actionBoxPlot->setToolTip(tr("Box and whiskers plot")); - - actionMultiPeakGauss->setMenuText(tr("&Gaussian...")); - actionMultiPeakLorentz->setMenuText(tr("&Lorentzian...")); - actionHomePage->setMenuText(tr("&QtiPlot Homepage")); - actionCheckUpdates->setMenuText(tr("Search for &Updates")); - actionHelpForums->setText(tr("Visit QtiPlot &Forums")); - actionHelpBugReports->setText(tr("Report a &Bug")); - actionDownloadManual->setMenuText(tr("Download &Manual")); - actionTranslations->setMenuText(tr("&Translations")); - actionDonate->setMenuText(tr("Make a &Donation")); - actionTechnicalSupport->setMenuText(tr("Technical &Support")); - -#ifdef SCRIPTING_DIALOG - actionScriptingLang->setMenuText(tr("Scripting &language")); -#endif - actionRestartScripting->setMenuText(tr("&Restart scripting")); - - actionNoteExecute->setMenuText(tr("E&xecute")); - actionNoteExecute->setShortcut(tr("Ctrl+J")); - - actionNoteExecuteAll->setMenuText(tr("Execute &All")); - actionNoteExecuteAll->setShortcut(tr("Ctrl+Shift+J")); - - actionNoteEvaluate->setMenuText(tr("&Evaluate Expression")); - actionNoteEvaluate->setShortcut(tr("Ctrl+Return")); - - actionShowNoteLineNumbers->setMenuText(tr("Show Line &Numbers")); - actionRenameNoteTab->setMenuText(tr("Rena&me Tab...")); - actionAddNoteTab->setMenuText(tr("A&dd Tab")); - actionCloseNoteTab->setMenuText(tr("C&lose Tab")); - - actionFind->setMenuText(tr("&Find...")); - actionFind->setToolTip(tr("Show find dialog")); - actionFind->setShortcut(tr("Ctrl+Alt+F")); - - actionFindNext->setMenuText(tr("Find &Next")); - actionFindNext->setToolTip(tr("Find Next")); - actionFindNext->setShortcut(tr("F3")); - - actionFindPrev->setMenuText(tr("Find &Previous")); - actionFindPrev->setToolTip(tr("Find Previous")); - actionFindPrev->setShortcut(tr("F4")); - - actionReplace->setMenuText(tr("&Replace...")); - actionReplace->setToolTip(tr("Show replace dialog")); - actionReplace->setShortcut(tr("Ctrl+Alt+R")); - - actionIncreaseIndent->setToolTip(tr("Increase Indent")); - actionDecreaseIndent->setToolTip(tr("Decrease Indent")); - - btnPointer->setMenuText(tr("Disable &tools")); - btnPointer->setToolTip( tr( "Pointer" ) ); - - actionMagnify->setMenuText(tr("Zoom &In/Out and Drag Canvas")); - actionMagnify->setToolTip(tr("Zoom In (Shift++) or Out (-) and Drag Canvas")); - - btnZoomIn->setMenuText(tr("&Zoom In")); - btnZoomIn->setShortcut(tr("Ctrl++")); - btnZoomIn->setToolTip(tr("Zoom In")); - - btnZoomOut->setMenuText(tr("Zoom &Out")); - btnZoomOut->setShortcut(tr("Ctrl+-")); - btnZoomOut->setToolTip(tr("Zoom Out")); - - btnCursor->setMenuText(tr("&Data Reader")); - btnCursor->setShortcut(tr("CTRL+D")); - btnCursor->setToolTip(tr("Data reader")); - - btnSelect->setMenuText(tr("&Select Data Range")); - btnSelect->setShortcut(tr("ALT+S")); - btnSelect->setToolTip(tr("Select data range")); - - btnPicker->setMenuText(tr("S&creen Reader")); - btnPicker->setToolTip(tr("Screen reader")); - - actionDrawPoints->setMenuText(tr("&Draw Data Points")); - actionDrawPoints->setToolTip(tr("Draw Data Points")); - - btnMovePoints->setMenuText(tr("&Move Data Points...")); - btnMovePoints->setShortcut(tr("Ctrl+ALT+M")); - btnMovePoints->setToolTip(tr("Move data points")); - - actionDragCurve->setMenuText(tr("Dra&g Curve")); - actionDragCurve->setToolTip(tr("Drag Curve")); - - btnRemovePoints->setMenuText(tr("Remove &Bad Data Points...")); - btnRemovePoints->setShortcut(tr("Alt+B")); - btnRemovePoints->setToolTip(tr("Remove data points")); - - actionAddText->setMenuText(tr("Add &Text")); - actionAddText->setToolTip(tr("Add Text")); - actionAddText->setShortcut(tr("ALT+T")); - - actionAddFormula->setMenuText(tr("Add E&quation")); - actionAddFormula->setToolTip(tr("Add Equation")); - actionAddFormula->setShortcut( tr("ALT+Q") ); - - actionAddRectangle->setMenuText(tr("Add &Rectangle")); - actionAddRectangle->setToolTip(tr("Add Rectangle")); - actionAddRectangle->setShortcut( tr("CTRL+ALT+R") ); - - actionAddEllipse->setMenuText(tr("Add &Ellipse")); - actionAddEllipse->setToolTip(tr("Add Ellipse/Circle")); - actionAddEllipse->setShortcut( tr("CTRL+ALT+E") ); - - btnArrow->setMenuText(tr("Draw &Arrow")); - btnArrow->setShortcut(tr("CTRL+ALT+A")); - btnArrow->setToolTip(tr("Draw arrow")); - - btnLine->setMenuText(tr("Draw &Line")); - btnLine->setShortcut(tr("CTRL+ALT+L")); - btnLine->setToolTip(tr("Draw line")); - - // FIXME: is setText necessary for action groups? - // coord->setText( tr( "Coordinates" ) ); - // coord->setMenuText( tr( "&Coord" ) ); - // coord->setStatusTip( tr( "Coordinates" ) ); - Box->setText( tr( "Box" ) ); - Box->setMenuText( tr( "Box" ) ); - Box->setToolTip( tr( "Box" ) ); - Box->setStatusTip( tr( "Box" ) ); - Frame->setText( tr( "Frame" ) ); - Frame->setMenuText( tr( "&Frame" ) ); - Frame->setToolTip( tr( "Frame" ) ); - Frame->setStatusTip( tr( "Frame" ) ); - None->setText( tr( "No Axes" ) ); - None->setMenuText( tr( "No Axes" ) ); - None->setToolTip( tr( "No axes" ) ); - None->setStatusTip( tr( "No axes" ) ); - - front->setToolTip( tr( "Front grid" ) ); - back->setToolTip( tr( "Back grid" ) ); - right->setToolTip( tr( "Right grid" ) ); - left->setToolTip( tr( "Left grid" ) ); - ceil->setToolTip( tr( "Ceiling grid" ) ); - floor->setToolTip( tr( "Floor grid" ) ); - - wireframe->setText( tr( "Wireframe" ) ); - wireframe->setMenuText( tr( "Wireframe" ) ); - wireframe->setToolTip( tr( "Wireframe" ) ); - wireframe->setStatusTip( tr( "Wireframe" ) ); - hiddenline->setText( tr( "Hidden Line" ) ); - hiddenline->setMenuText( tr( "Hidden Line" ) ); - hiddenline->setToolTip( tr( "Hidden line" ) ); - hiddenline->setStatusTip( tr( "Hidden line" ) ); - polygon->setText( tr( "Polygon Only" ) ); - polygon->setMenuText( tr( "Polygon Only" ) ); - polygon->setToolTip( tr( "Polygon only" ) ); - polygon->setStatusTip( tr( "Polygon only" ) ); - filledmesh->setText( tr( "Mesh & Filled Polygons" ) ); - filledmesh->setMenuText( tr( "Mesh & Filled Polygons" ) ); - filledmesh->setToolTip( tr( "Mesh & filled Polygons" ) ); - filledmesh->setStatusTip( tr( "Mesh & filled Polygons" ) ); - pointstyle->setText( tr( "Dots" ) ); - pointstyle->setMenuText( tr( "Dots" ) ); - pointstyle->setToolTip( tr( "Dots" ) ); - pointstyle->setStatusTip( tr( "Dots" ) ); - barstyle->setText( tr( "Bars" ) ); - barstyle->setMenuText( tr( "Bars" ) ); - barstyle->setToolTip( tr( "Bars" ) ); - barstyle->setStatusTip( tr( "Bars" ) ); - conestyle->setText( tr( "Cones" ) ); - conestyle->setMenuText( tr( "Cones" ) ); - conestyle->setToolTip( tr( "Cones" ) ); - conestyle->setStatusTip( tr( "Cones" ) ); - crossHairStyle->setText( tr( "Crosshairs" ) ); - crossHairStyle->setMenuText( tr( "Crosshairs" ) ); - crossHairStyle->setToolTip( tr( "Crosshairs" ) ); - crossHairStyle->setStatusTip( tr( "Crosshairs" ) ); - - //floorstyle->setText( tr( "Floor Style" ) ); - //floorstyle->setMenuText( tr( "Floor Style" ) ); - //floorstyle->setStatusTip( tr( "Floor Style" ) ); - floordata->setText( tr( "Floor Data Projection" ) ); - floordata->setMenuText( tr( "Floor Data Projection" ) ); - floordata->setToolTip( tr( "Floor data projection" ) ); - floordata->setStatusTip( tr( "Floor data projection" ) ); - flooriso->setText( tr( "Floor Isolines" ) ); - flooriso->setMenuText( tr( "Floor Isolines" ) ); - flooriso->setToolTip( tr( "Floor isolines" ) ); - flooriso->setStatusTip( tr( "Floor isolines" ) ); - floornone->setText( tr( "Empty Floor" ) ); - floornone->setMenuText( tr( "Empty Floor" ) ); - floornone->setToolTip( tr( "Empty floor" ) ); - floornone->setStatusTip( tr( "Empty floor" ) ); - - actionAnimate->setText( tr( "Animation" ) ); - actionAnimate->setMenuText( tr( "Animation" ) ); - actionAnimate->setToolTip( tr( "Animation" ) ); - actionAnimate->setStatusTip( tr( "Animation" ) ); - - actionPerspective->setText( tr( "Enable perspective" ) ); - actionPerspective->setMenuText( tr( "Enable perspective" ) ); - actionPerspective->setToolTip( tr( "Enable perspective" ) ); - actionPerspective->setStatusTip( tr( "Enable perspective" ) ); - - actionResetRotation->setText( tr( "Reset rotation" ) ); - actionResetRotation->setMenuText( tr( "Reset rotation" ) ); - actionResetRotation->setToolTip( tr( "Reset rotation" ) ); - actionResetRotation->setStatusTip( tr( "Reset rotation" ) ); - - actionFitFrame->setText( tr( "Fit frame to window" ) ); - actionFitFrame->setMenuText( tr( "Fit frame to window" ) ); - actionFitFrame->setToolTip( tr( "Fit frame to window" ) ); - actionFitFrame->setStatusTip( tr( "Fit frame to window" ) ); -} - -Graph3D * ApplicationWindow::plot3DMatrix(Matrix *m, int style) -{ - if (!m) { - m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return 0; - } - - QApplication::setOverrideCursor(Qt::WaitCursor); - Graph3D *plot = newPlot3D(); - if(!plot) - return 0; - - plot->addMatrixData(m); - plot->customPlotStyle(style); - plot->setDataColorMap(m->colorMap()); - plot->update(); - - emit modified(); - QApplication::restoreOverrideCursor(); - return plot; -} - -MultiLayer* ApplicationWindow::plotGrayScale(Matrix *m) -{ - if (!m) { - m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return 0; - } - - return plotSpectrogram(m, Graph::GrayScale); -} - -MultiLayer* ApplicationWindow::plotContour(Matrix *m) -{ - if (!m) { - m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return 0; - } - - return plotSpectrogram(m, Graph::Contour); -} - -MultiLayer* ApplicationWindow::plotColorMap(Matrix *m) -{ - if (!m) { - m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return 0; - } - - return plotSpectrogram(m, Graph::ColorMap); -} - -MultiLayer* ApplicationWindow::plotImage(Matrix *m) -{ - if (!m) { - m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return 0; - } - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - MultiLayer* g = multilayerPlot(generateUniqueName(tr("Graph"))); - Graph* plot = g->activeLayer(); - setPreferences(plot); - - Spectrogram *s = plot->plotSpectrogram(m, Graph::GrayScale); - if (!s) - return 0; - - s->setAxis(QwtPlot::xTop, QwtPlot::yLeft); - plot->enableAxis(QwtPlot::xTop, true); - plot->setScale(QwtPlot::xTop, QMIN(m->xStart(), m->xEnd()), QMAX(m->xStart(), m->xEnd())); - plot->enableAxis(QwtPlot::xBottom, false); - plot->enableAxis(QwtPlot::yRight, false); - plot->setScale(QwtPlot::yLeft, QMIN(m->yStart(), m->yEnd()), QMAX(m->yStart(), m->yEnd()), - 0.0, 5, 5, Graph::Linear, true); - plot->setAxisTitle(QwtPlot::yLeft, QString::null); - plot->setAxisTitle(QwtPlot::xTop, QString::null); - plot->setTitle(QString::null); - - emit modified(); - QApplication::restoreOverrideCursor(); - return g; -} - -MultiLayer* ApplicationWindow::plotSpectrogram(Matrix *m, Graph::CurveType type) -{ - if (type == Graph::ImagePlot) - return plotImage(m); - else if (type == Graph::Histogram) - return plotHistogram(m); - - if (!m) - return 0; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - MultiLayer* g = multilayerPlot(generateUniqueName(tr("Graph"))); - Graph* plot = g->activeLayer(); - setPreferences(plot); - - plot->plotSpectrogram(m, type); - QApplication::restoreOverrideCursor(); - return g; -} - -ApplicationWindow* ApplicationWindow::importOPJ(const QString& filename, bool factorySettings, bool newProject) -{ - if (filename.endsWith(".opj", Qt::CaseInsensitive) || filename.endsWith(".ogg", Qt::CaseInsensitive)) - { - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - ApplicationWindow *app = this; - if (newProject) - app = new ApplicationWindow(factorySettings); - - app->setWindowTitle("QtiPlot - " + filename); - app->restoreApplicationGeometry(); - app->projectname = filename; - app->recentProjects.removeAll(filename); - app->recentProjects.push_front(filename); - app->updateRecentProjectsList(); - - ImportOPJ(app, filename); - - QApplication::restoreOverrideCursor(); - return app; - } - else if (filename.endsWith(".ogm", Qt::CaseInsensitive) || filename.endsWith(".ogw", Qt::CaseInsensitive)) - { - ImportOPJ(this, filename); - recentProjects.removeAll(filename); - recentProjects.push_front(filename); - updateRecentProjectsList(); - return this; - } - return 0; -} - -void ApplicationWindow::deleteFitTables() -{ - QList* mLst = new QList(); - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - if (w->isA("MultiLayer")) - mLst->append(w); - } - - foreach(QWidget *ml, *mLst){ - if (ml->isA("MultiLayer")){ - QList layers = ((MultiLayer*)ml)->layersList(); - foreach(Graph *g, layers){ - QList curves = g->fitCurvesList(); - foreach(QwtPlotCurve *c, curves){ - if (((PlotCurve *)c)->type() != Graph::Function){ - Table *t = ((DataCurve *)c)->table(); - if (!t) - continue; - - t->askOnCloseEvent(false); - t->close(); - } - } - } - } - } - delete mLst; -} - -QList ApplicationWindow::windowsList() -{ - QList lst; - - Folder *f = projectFolder(); - while (f){ - QList folderWindows = f->windowsList(); - foreach(MdiSubWindow *w, folderWindows) - lst << w; - f = f->folderBelow(); - } - return lst; -} - -void ApplicationWindow::updateRecentProjectsList() -{ - if (recentProjects.isEmpty()) - return; - - while ((int)recentProjects.size() > MaxRecentProjects) - recentProjects.pop_back(); - - recent->clear(); - - for (int i = 0; i<(int)recentProjects.size(); i++ ) - recent->insertItem("&" + QString::number(i+1) + " " + QDir::toNativeSeparators(recentProjects[i])); -} - -void ApplicationWindow::translateCurveHor() -{ - translateCurve(TranslateCurveTool::Horizontal); -} - -void ApplicationWindow::translateCurve(TranslateCurveTool::Direction direction) -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - if (plot->isEmpty()){ - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

" - "

Please add a layer and try again!

")); - btnPointer->setChecked(true); - return; - } - - Graph* g = (Graph*)plot->activeLayer(); - if (!g) - return; - - if (g->isPiePlot()){ - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("This functionality is not available for pie plots!")); - - btnPointer->setChecked(true); - return; - } else if (g->validCurvesDataSize()) { - btnPointer->setChecked(true); - g->setActiveTool(new TranslateCurveTool(g, this, direction, info, SLOT(setText(const QString&)))); - displayBar->show(); - } -} - -void ApplicationWindow::setReadOnlyCol() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return; - QStringList list = t->selectedColumns(); - for (int i=0; i<(int) list.count(); i++) - t->setReadOnlyColumn(t->colIndex(list[i]), actionReadOnlyCol->isChecked()); -} - -void ApplicationWindow::setReadOnlyColumns() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return; - QStringList list = t->selectedColumns(); - for (int i=0; i<(int) list.count(); i++) - t->setReadOnlyColumn(t->colIndex(list[i])); -} - -void ApplicationWindow::setReadWriteColumns() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return; - QStringList list = t->selectedColumns(); - for (int i=0; i<(int) list.count(); i++) - t->setReadOnlyColumn(t->colIndex(list[i]), false); -} - -void ApplicationWindow::setAscValues() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return; - - t->setAscValues(); -} - -void ApplicationWindow::setRandomValues() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return; - - t->setRandomValues(); -} - -void ApplicationWindow::setXErrCol() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return; - - t->setPlotDesignation(Table::xErr); -} - -void ApplicationWindow::setYErrCol() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return; - - t->setPlotDesignation(Table::yErr); -} - -void ApplicationWindow::setXCol() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return; - - t->setPlotDesignation(Table::X); -} - -void ApplicationWindow::setYCol() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return; - - t->setPlotDesignation(Table::Y); -} - -void ApplicationWindow::setZCol() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return; - - t->setPlotDesignation(Table::Z); -} - -void ApplicationWindow::setLabelCol() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return; - - t->setPlotDesignation(Table::Label); -} - -void ApplicationWindow::disregardCol() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return; - - t->setPlotDesignation(Table::None); -} - -void ApplicationWindow::fitMultiPeakGauss() -{ - fitMultiPeak((int)MultiPeakFit::Gauss); -} - -void ApplicationWindow::fitMultiPeakLorentz() -{ - fitMultiPeak((int)MultiPeakFit::Lorentz); -} - -void ApplicationWindow::fitMultiPeak(int profile) -{ - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (!plot) - return; - if (plot->isEmpty()){ - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("

There are no plot layers available in this window.

" - "

Please add a layer and try again!

")); - btnPointer->setChecked(true); - return; - } - - Graph* g = (Graph*)plot->activeLayer(); - if (!g || !g->validCurvesDataSize()) - return; - - if (g->isPiePlot()){ - QMessageBox::warning(this,tr("QtiPlot - Warning"), - tr("This functionality is not available for pie plots!")); - return; - } else { - bool ok; - int peaks = QInputDialog::getInteger(tr("QtiPlot - Enter the number of peaks"), - tr("Peaks"), 2, 2, 1000000, 1, &ok, this); - if (ok && peaks){ - g->setActiveTool(new MultiPeakFitTool(g, this, (MultiPeakFit::PeakProfile)profile, peaks, info, SLOT(setText(const QString&)))); - displayBar->show(); - } - } -} - -void ApplicationWindow::showSupportPage() -{ - QDesktopServices::openUrl(QUrl("http://soft.proindependent.com/contracts.html")); -} - - -void ApplicationWindow::showDonationsPage() -{ - QDesktopServices::openUrl(QUrl("http://soft.proindependent.com/why_donate.html")); -} - -void ApplicationWindow::downloadManual() -{ - QDesktopServices::openUrl(QUrl("http://soft.proindependent.com/manuals.html")); -} - -void ApplicationWindow::downloadTranslation() -{ - QDesktopServices::openUrl(QUrl("http://soft.proindependent.com/translations.html")); -} - -void ApplicationWindow::showHomePage() -{ - QDesktopServices::openUrl(QUrl("http://www.qtiplot.ro")); -} - -void ApplicationWindow::showForums() -{ - QDesktopServices::openUrl(QUrl("https://developer.berlios.de/forum/?group_id=6626")); -} - -void ApplicationWindow::showBugTracker() -{ - QDesktopServices::openUrl(QUrl("https://developer.berlios.de/bugs/?group_id=6626")); -} - -#ifdef QTIPLOT_SUPPORT -void ApplicationWindow::showDonationDialog() -{ - QString s = tr("QtiPlot is open-source software and its development required hundreds of hours of work.

\ - If you like it, you're using it in your work and you would like to see it \ - constantly improved, please support its authors by making a donation.
"); - - QMessageBox *msg = new QMessageBox(this); - msg->setText(s); - msg->setWindowTitle(tr("Please support QtiPlot!")); - QPushButton *btn = msg->addButton(tr("Make a donation"), QMessageBox::AcceptRole); - msg->addButton(tr("Close"), QMessageBox::RejectRole); - msg->exec(); - if (msg->clickedButton() == btn) - showDonationsPage(); -} -#endif - -void ApplicationWindow::parseCommandLineArguments(const QStringList& args) -{ - int num_args = args.count(); - if(num_args == 0){ - initWindow(); - savedProject(); - return; - } - - QString str; - bool exec = false; - bool noGui = false; - bool default_settings = false; - bool console = false; - foreach(str, args){ - if( (str == "-a" || str == "--about") || - (str == "-m" || str == "--manual") ){ - QMessageBox::critical(this, tr("QtiPlot - Error"), - tr(" %1 : This command line option must be used without other arguments!").arg(str)); - } else if (str == "-c" || str == "--console") { - d_mdi_windows_area = false; - showScriptWindow(false); - setScriptingLanguage("Python"); - hide(); - console = true; - } - else if( (str == "-d" || str == "--default-settings")) - default_settings = true; - else if (str == "-v" || str == "--version"){ - QString s = versionString() + "\n"; - s += QString(copyright_string) + "\n"; - s += tr("Released") + ": " + release_date + "\n"; - #ifdef Q_OS_WIN - hide(); - QMessageBox::information(this, tr("QtiPlot") + " - " + tr("Version"), s); - #else - std::wcout << s.toStdWString(); - #endif - exit(0); - } - else if (str == "-h" || str == "--help"){ - QString s = "\n" + tr("Usage") + ": "; - s += "qtiplot [" + tr("options") + "] [" + tr("file") + "_" + tr("name") + "]\n\n"; - s += tr("Valid options are") + ":\n"; - s += "-a " + tr("or") + " --about: " + tr("show about dialog and exit") + "\n"; - s += "-c " + tr("or") + " --console: " + tr("show standalone scripting window") + "\n"; - s += "-d " + tr("or") + " --default-settings: " + tr("start QtiPlot with the default settings") + "\n"; - s += "-h " + tr("or") + " --help: " + tr("show command line options") + "\n"; - s += "-l=XX " + tr("or") + " --lang=XX: " + tr("start QtiPlot in language") + " XX ('en', 'fr', 'de', ...)\n"; - s += "-m " + tr("or") + " --manual: " + tr("show QtiPlot manual in a standalone window") + "\n"; - s += "-v " + tr("or") + " --version: " + tr("print QtiPlot version and release date") + "\n"; - s += "-x " + tr("or") + " --execute: " + tr("execute the script file given as argument") + "\n"; - s += "-X: " + tr("execute the script file given as argument without displying the user interface. Warning: 2D plots are not correctly handled in this functioning mode!") + "\n\n"; - s += "'" + tr("file") + "_" + tr("name") + "' " + tr("can be any .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py or ASCII file") + "\n"; - #ifdef Q_OS_WIN - hide(); - QMessageBox::information(this, tr("QtiPlot") + " - " + tr("Help"), s); - #else - std::wcout << s.toStdWString(); - #endif - exit(0); - } - else if (str.startsWith("--lang=") || str.startsWith("-l=")){ - QString locale = str.mid(str.find('=')+1); - if (locales.contains(locale)) - switchToLanguage(locale); - - if (!locales.contains(locale)) - QMessageBox::critical(this, tr("QtiPlot - Error"), - tr(" %1 : Wrong locale option or no translation available!").arg(locale)); - } - else if (str.startsWith("--execute") || str.startsWith("-x")) - exec = true; - else if (str.startsWith("-X")) - noGui = true; - else if (str.startsWith("-") || str.startsWith("--")){ - QMessageBox::critical(this, tr("QtiPlot - Error"), - tr(" %1 unknown command line option!").arg(str) + "\n" + tr("Type %1 to see the list of the valid options.").arg("'qtiplot -h'")); - } - } - - QString file_name = args[num_args-1]; // last argument - if(file_name.startsWith("-")){// no file name given - if (console) - return; - - initWindow(); - savedProject(); - return; - } - - savedProject(); - - if (!file_name.isEmpty()){ - QFileInfo fi(file_name); - if (fi.isDir()){ - QMessageBox::critical(this, tr("QtiPlot - File openning error"), - tr("%1 is a directory, please specify a file name!").arg(file_name)); - return; - } else if (!fi.exists()){ - QMessageBox::critical(this, tr("QtiPlot - File openning error"), - tr("The file: %1 doesn't exist!").arg(file_name)); - return; - } else if (fi.exists() && !fi.isReadable()){ - QMessageBox::critical(this, tr("QtiPlot - File openning error"), - tr("You don't have the permission to open this file: %1").arg(file_name)); - return; - } - - workingDir = fi.dirPath(true); - saveSettings();//the recent projects must be saved - - if (console){ - scriptWindow->open(file_name); - if (exec) - scriptWindow->executeAll(); - } else if (exec || noGui) - loadScript(file_name, exec, noGui, default_settings); - else { - ApplicationWindow *app = open(file_name, default_settings); - if (app && app != this) - close(); - } - } -} - -void ApplicationWindow::createLanguagesList() -{ - locales.clear(); - - appTranslator = new QTranslator(this); - qtTranslator = new QTranslator(this); - qApp->installTranslator(appTranslator); - qApp->installTranslator(qtTranslator); - - QString qmPath = d_translations_folder; - QDir dir(qmPath); - QStringList fileNames = dir.entryList("qtiplot_*.qm"); - for (int i=0; i < (int)fileNames.size(); i++) - { - QString locale = fileNames[i]; - locale = locale.mid(locale.find('_')+1); - locale.truncate(locale.find('.')); - locales.push_back(locale); - } - locales.push_back("en"); - locales.sort(); - - if (appLanguage != "en") - { - appTranslator->load("qtiplot_" + appLanguage, qmPath); - qtTranslator->load("qt_" + appLanguage, qmPath+"/qt"); - } -} - -void ApplicationWindow::switchToLanguage(int param) -{ - if (param < (int)locales.size()) - switchToLanguage(locales[param]); -} - -void ApplicationWindow::switchToLanguage(const QString& locale) -{ - if (!locales.contains(locale) || appLanguage == locale) - return; - - appLanguage = locale; - if (locale == "en") - { - qApp->removeTranslator(appTranslator); - qApp->removeTranslator(qtTranslator); - delete appTranslator; - delete qtTranslator; - appTranslator = new QTranslator(this); - qtTranslator = new QTranslator(this); - qApp->installTranslator(appTranslator); - qApp->installTranslator(qtTranslator); - } - else - { - QString qmPath = d_translations_folder; - appTranslator->load("qtiplot_" + locale, qmPath); - qtTranslator->load("qt_" + locale, qmPath+"/qt"); - } - insertTranslatedStrings(); -} - -QStringList ApplicationWindow::matrixNames() -{ - QStringList names; - Folder *f = projectFolder(); - while (f){ - QList folderWindows = f->windowsList(); - foreach(MdiSubWindow *w, folderWindows){ - if (w->isA("Matrix")) - names << w->objectName(); - } - f = f->folderBelow(); - } - return names; -} - -bool ApplicationWindow::alreadyUsedName(const QString& label) -{ - Folder *f = projectFolder(); - while (f){ - QList folderWindows = f->windowsList(); - foreach(MdiSubWindow *w, folderWindows){ - if (w->objectName() == label) - return true; - } - f = f->folderBelow(); - } - return false; -} - -bool ApplicationWindow::projectHas2DPlots() -{ - Folder *f = projectFolder(); - while (f){ - QList folderWindows = f->windowsList(); - foreach(MdiSubWindow *w, folderWindows){ - if (w->isA("MultiLayer")) - return true; - } - f = f->folderBelow(); - } - return false; -} - -void ApplicationWindow::appendProject() -{ - OpenProjectDialog *open_dialog = new OpenProjectDialog(this, false); - open_dialog->setDirectory(workingDir); - open_dialog->setExtensionWidget(0); - open_dialog->selectNameFilter(d_open_project_filter); - if (open_dialog->exec() != QDialog::Accepted || open_dialog->selectedFiles().isEmpty()) - return; - workingDir = open_dialog->directory().path(); - appendProject(open_dialog->selectedFiles()[0]); -} - -Folder* ApplicationWindow::appendProject(const QString& fn, Folder* parentFolder) -{ - if (fn.isEmpty()) - return 0; - - QFileInfo fi(fn); - workingDir = fi.dirPath(true); - - if (fn.contains(".qti") || fn.contains(".opj", Qt::CaseInsensitive) || - fn.contains(".ogm", Qt::CaseInsensitive) || fn.contains(".ogw", Qt::CaseInsensitive) || - fn.contains(".ogg", Qt::CaseInsensitive)){ - QFileInfo f(fn); - if (!f.exists ()){ - QMessageBox::critical(this, tr("QtiPlot - File opening error"), - tr("The file: %1 doesn't exist!").arg(fn)); - return 0; - } - } else { - QMessageBox::critical(this,tr("QtiPlot - File opening error"), - tr("The file: %1 is not a QtiPlot or Origin project file!").arg(fn)); - return 0; - } - - d_is_appending_file = true; - - if (fn != projectname){ - recentProjects.removeAll(fn); - recentProjects.push_front(fn); - updateRecentProjectsList(); - } - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - QString fname = fn; - if (fn.contains(".qti.gz")){//decompress using zlib - file_uncompress((char *)fname.ascii()); - fname.remove(".gz"); - } - - Folder *cf = current_folder; - if (parentFolder) - changeFolder(parentFolder, true); - - FolderListItem *item = (FolderListItem *)current_folder->folderListItem(); - folders->blockSignals (true); - blockSignals (true); - - QString baseName = fi.baseName(); - QStringList lst = current_folder->subfolders(); - int n = lst.count(baseName); - if (n){//avoid identical subfolder names - while (lst.count(baseName + QString::number(n))) - n++; - baseName += QString::number(n); - } - - Folder *new_folder; - if (parentFolder) - new_folder = new Folder(parentFolder, baseName); - else - new_folder = new Folder(current_folder, baseName); - - current_folder = new_folder; - FolderListItem *fli = new FolderListItem(item, current_folder); - current_folder->setFolderListItem(fli); - - if (fn.contains(".opj", Qt::CaseInsensitive) || fn.contains(".ogm", Qt::CaseInsensitive) || - fn.contains(".ogw", Qt::CaseInsensitive) || fn.contains(".ogg", Qt::CaseInsensitive)) - ImportOPJ(this, fn); - else{ - QFile f(fname); - QTextStream t( &f ); - t.setEncoding(QTextStream::UnicodeUTF8); - f.open(QIODevice::ReadOnly); - - QString s = t.readLine(); - lst = s.split(QRegExp("\\s"), QString::SkipEmptyParts); - QString version = lst[1]; - lst = version.split(".", QString::SkipEmptyParts); - d_file_version =100*(lst[0]).toInt()+10*(lst[1]).toInt()+(lst[2]).toInt(); - - t.readLine(); - if (d_file_version < 73) - t.readLine(); - - //process tables and matrix information - while ( !t.atEnd()){ - s = t.readLine(); - lst.clear(); - if (s.left(8) == ""){ - lst = s.split("\t"); - Folder *f = new Folder(current_folder, lst[1]); - f->setBirthDate(lst[2]); - f->setModificationDate(lst[3]); - if(lst.count() > 4) - if (lst[4] == "current") - cf = f; - - FolderListItem *fli = new FolderListItem(current_folder->folderListItem(), f); - fli->setText(0, lst[1]); - f->setFolderListItem(fli); - - current_folder = f; - }else if (s == "
"){ - while ( s!="
" ){ - s=t.readLine(); - lst<"){ - while ( s != "" ){ - s=t.readLine(); - lst<"){ - for (int i=0; i<3; i++){ - s = t.readLine(); - lst << s; - } - Note* m = openNote(this, lst); - QStringList cont; - while ( s != "" ){ - s=t.readLine(); - cont << s; - } - cont.pop_back(); - m->restore(cont); - }else if (s == ""){ - Folder *parent = (Folder *)current_folder->parent(); - if (!parent) - current_folder = projectFolder(); - else - current_folder = parent; - } - } - f.close(); - - //process the rest - f.open(QIODevice::ReadOnly); - - MultiLayer *plot=0; - while ( !t.atEnd()){ - s=t.readLine(); - if (s.left(8) == ""){ - lst = s.split("\t"); - current_folder = current_folder->findSubfolder(lst[1]); - }else if (s == ""){//process multilayers information - s=t.readLine(); - QStringList graph=s.split("\t"); - QString caption=graph[0]; - plot = multilayerPlot(caption, 0, graph[2].toInt(), graph[1].toInt()); - setListViewDate(caption, graph[3]); - plot->setBirthDate(graph[3]); - plot->blockSignals(true); - - restoreWindowGeometry(this, plot, t.readLine()); - - if (d_file_version > 71){ - QStringList lst=t.readLine().split("\t"); - plot->setWindowLabel(lst[1]); - plot->setCaptionPolicy((MdiSubWindow::CaptionPolicy)lst[2].toInt()); - } - - if (d_file_version > 83){ - QStringList lst=t.readLine().split("\t", QString::SkipEmptyParts); - plot->setMargins(lst[1].toInt(),lst[2].toInt(),lst[3].toInt(),lst[4].toInt()); - lst=t.readLine().split("\t", QString::SkipEmptyParts); - plot->setSpacing(lst[1].toInt(),lst[2].toInt()); - lst=t.readLine().split("\t", QString::SkipEmptyParts); - plot->setLayerCanvasSize(lst[1].toInt(),lst[2].toInt()); - lst=t.readLine().split("\t", QString::SkipEmptyParts); - plot->setAlignement(lst[1].toInt(),lst[2].toInt()); - } - - while ( s != "" ){//open layers - s = t.readLine(); - if (s.contains("")){ - QStringList lst = s.trimmed().remove("").remove("").split(","); - if (lst.size() >= 2) - plot->setWaterfallOffset(lst[0].toInt(), lst[1].toInt()); - if (lst.size() >= 3) - plot->setWaterfallSideLines(lst[2].toInt()); - plot->createWaterfallBox(); - } - if (s.left(7) == ""){ - lst.clear(); - while ( s != "" ){ - s = t.readLine(); - lst << s; - } - openGraph(this, plot, lst); - } - } - plot->blockSignals(false); - }else if (s == ""){//process 3D plots information - lst.clear(); - while ( s!="" ){ - s = t.readLine(); - lst<"){ - Folder *parent = (Folder *)current_folder->parent(); - if (!parent) - current_folder = projectFolder(); - else - current_folder = parent; - } - } - f.close(); - } - - folders->blockSignals (false); - //change folder to user defined current folder - changeFolder(cf); - blockSignals (false); - renamedTables = QStringList(); - QApplication::restoreOverrideCursor(); - d_is_appending_file = false; - return new_folder; -} - -#ifdef QTIPLOT_DEMO -void ApplicationWindow::showDemoVersionMessage() -{ - saved = true; - QMessageBox::critical(this, tr("QtiPlot - Demo Version"), - tr("You are using the demonstration version of Qtiplot.\ - It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session.\ -

\ - If you want to have ready-to-use, fully functional binaries, please subscribe for a\ - single-user binaries maintenance contract.\ -

\ - QtiPlot is free software in the sense of free speech.\ - If you know how to use it, you can get\ - the source code\ - free of charge.\ - Nevertheless, you are welcome to\ - make a donation\ - in order to support the further development of QtiPlot.")); -} -#endif - -void ApplicationWindow::saveFolder(Folder *folder, const QString& fn, bool compress) -{ - QFile f( fn ); - if (d_backup_files && f.exists()) - {// make byte-copy of current file so that there's always a copy of the data on disk - while (!f.open(QIODevice::ReadOnly)){ - if (f.isOpen()) - f.close(); - int choice = QMessageBox::warning(this, tr("QtiPlot - File backup error"), - tr("Cannot make a backup copy of %1 (to %2).
If you ignore this, you run the risk of data loss.").arg(projectname).arg(projectname+"~"), - QMessageBox::Retry|QMessageBox::Default, QMessageBox::Abort|QMessageBox::Escape, QMessageBox::Ignore); - if (choice == QMessageBox::Abort) - return; - if (choice == QMessageBox::Ignore) - break; - } - - if (f.isOpen()){ - QString bfn = fn + "~"; - QFile::remove(bfn);//remove any existing backup - QFile::copy(fn, bfn); - f.close(); - } - } - - if ( !f.open( QIODevice::WriteOnly ) ){ - QMessageBox::about(this, tr("QtiPlot - File save error"), tr("The file:
%1 is opened in read-only mode").arg(fn)); - return; - } - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - QList lst = folder->windowsList(); - int windows = lst.count(); - int initial_depth = folder->depth(); - Folder *dir = folder->folderBelow(); - while (dir && dir->depth() > initial_depth){ - windows += dir->windowsList().count(); - dir = dir->folderBelow(); - } - - QTextStream t( &f ); - t.setEncoding(QTextStream::UnicodeUTF8); - t << "QtiPlot " + QString::number(maj_version) + "." + QString::number(min_version) + "."+ - QString::number(patch_version) + " project file\n"; - t << "\t" + QString(scriptEnv->name()) + "\n"; - t << "\t" + QString::number(windows) + "\n"; - f.close(); - - foreach(MdiSubWindow *w, lst) - w->save(fn, windowGeometryInfo(w)); - - initial_depth = folder->depth(); - dir = folder->folderBelow(); - while (dir && dir->depth() > initial_depth){ - if (!f.isOpen()) - f.open(QIODevice::Append); - - t << "\t" + QString(dir->objectName()) + "\t" + dir->birthDate() + "\t" + dir->modificationDate(); - if (dir == current_folder) - t << "\tcurrent\n"; - else - t << "\n"; // FIXME: Having no 5th string here is not a good idea - t << "" + QString::number(dir->folderListItem()->isOpen()) + "\n"; - f.close(); - - lst = dir->windowsList(); - foreach(MdiSubWindow *w, lst) - w->save(fn, windowGeometryInfo(w)); - - if (!f.isOpen()) - f.open(QIODevice::Append); - - if (!dir->logInfo().isEmpty() ) - t << "\n" + dir->logInfo() + "\n" ; - - if ( (dir->children()).isEmpty() ) - t << "\n"; - - int depth = dir->depth(); - dir = dir->folderBelow(); - if (dir){ - int next_dir_depth = dir->depth(); - if (next_dir_depth < depth){ - int diff = depth - next_dir_depth; - for (int i = 0; i < diff; i++) - t << "
\n"; - } - } else { - int diff = depth - initial_depth - 1; - for (int i = 0; i < diff; i++) - t << "\n"; - } - } - - if (!f.isOpen()) - f.open(QIODevice::Append); - - t << "" + QString::number(folder->folderListItem()->isOpen()) + "\n"; - if (!folder->logInfo().isEmpty()) - t << "\n" + folder->logInfo() + "" ; - - f.close(); - - if (compress) - file_compress((char *)fn.ascii(), "wb9"); - - QApplication::restoreOverrideCursor(); -} - -void ApplicationWindow::saveAsProject() -{ - saveFolderAsProject(current_folder); -} - -void ApplicationWindow::saveFolderAsProject(Folder *f) -{ -#ifdef QTIPLOT_DEMO - showDemoVersionMessage(); - return; -#endif - QString filter = tr("QtiPlot project")+" (*.qti);;"; - filter += tr("Compressed QtiPlot project")+" (*.qti.gz)"; - - QString selectedFilter; - QString fn = getFileName(this, tr("Save project as"), workingDir, filter, &selectedFilter); - if ( !fn.isEmpty() ){ - QFileInfo fi(fn); - workingDir = fi.dirPath(true); - QString baseName = fi.fileName(); - if (!baseName.contains(".")) - fn.append(".qti"); - - saveFolder(f, fn, selectedFilter.contains(".gz")); - } -} - -void ApplicationWindow::showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, int) -{ - showFolderPopupMenu(it, p, true); -} - -void ApplicationWindow::showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, bool fromFolders) -{ - if (!it || folders->isRenaming()) - return; - - QMenu cm(this); - QMenu window(this); - QMenu viewWindowsMenu(this); - viewWindowsMenu.setCheckable ( true ); - - cm.addAction(actionFindWindow); - cm.insertSeparator(); - cm.addAction(actionAppendProject); - if (((FolderListItem *)it)->folder()->parent()) - cm.insertItem(QIcon(QPixmap(filesaveas_xpm)), tr("Save &As Project..."), this, SLOT(saveAsProject())); - else - cm.addAction(actionSaveProjectAs); - cm.insertSeparator(); - - if (fromFolders && show_windows_policy != HideAll) - { - cm.insertItem(tr("&Show All Windows"), this, SLOT(showAllFolderWindows())); - cm.insertItem(tr("&Hide All Windows"), this, SLOT(hideAllFolderWindows())); - cm.insertSeparator(); - } - - if (((FolderListItem *)it)->folder()->parent()) - { - cm.insertItem(QPixmap(close_xpm), tr("&Delete Folder"), this, SLOT(deleteFolder()), Qt::Key_F8); - cm.insertItem(tr("&Rename"), this, SLOT(startRenameFolder()), Qt::Key_F2); - cm.insertSeparator(); - } - - if (fromFolders) - { - window.addAction(actionNewTable); - window.addAction(actionNewMatrix); - window.addAction(actionNewNote); - window.addAction(actionNewGraph); - window.addAction(actionNewFunctionPlot); - window.addAction(actionNewSurfacePlot); - cm.insertItem(tr("New &Window"), &window); - } - - cm.insertItem(QPixmap(newfolder_xpm), tr("New F&older"), this, SLOT(addFolder()), Qt::Key_F7); - cm.insertSeparator(); - - QStringList lst; - lst << tr("&None") << tr("&Windows in Active Folder") << tr("Windows in &Active Folder && Subfolders"); - for (int i = 0; i < 3; ++i) - { - int id = viewWindowsMenu.insertItem(lst[i],this, SLOT( setShowWindowsPolicy( int ) ) ); - viewWindowsMenu.setItemParameter( id, i ); - viewWindowsMenu.setItemChecked( id, show_windows_policy == i ); - } - cm.insertItem(tr("&View Windows"), &viewWindowsMenu); - cm.insertSeparator(); - cm.insertItem(tr("&Properties..."), this, SLOT(folderProperties())); - cm.exec(p); -} - -void ApplicationWindow::setShowWindowsPolicy(int p) -{ - if (show_windows_policy == (ShowWindowsPolicy)p) - return; - - show_windows_policy = (ShowWindowsPolicy)p; - if (show_windows_policy == HideAll){ - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - hiddenWindows->append(w); - w->hide(); - setListView(w->objectName(), tr("Hidden")); - } - } else - showAllFolderWindows(); -} - -void ApplicationWindow::showFindDialogue() -{ - FindDialog *fd = new FindDialog(this); - fd->exec(); -} - -void ApplicationWindow::startRenameFolder() -{ - FolderListItem *fi = current_folder->folderListItem(); - if (!fi) - return; - - disconnect(folders, SIGNAL(currentChanged(Q3ListViewItem *)), this, SLOT(folderItemChanged(Q3ListViewItem *))); - fi->setRenameEnabled (0, true); - fi->startRename (0); -} - -void ApplicationWindow::startRenameFolder(Q3ListViewItem *item) -{ - if (!item || item == folders->firstChild()) - return; - - if (item->listView() == lv && item->rtti() == FolderListItem::RTTI) { - disconnect(folders, SIGNAL(currentChanged(Q3ListViewItem *)), this, SLOT(folderItemChanged(Q3ListViewItem *))); - current_folder = ((FolderListItem *)item)->folder(); - FolderListItem *it = current_folder->folderListItem(); - it->setRenameEnabled (0, true); - it->startRename (0); - } else { - item->setRenameEnabled (0, true); - item->startRename (0); - } -} - -void ApplicationWindow::renameFolder(Q3ListViewItem *it, int col, const QString &text) -{ - Q_UNUSED(col) - - if (!it) - return; - - Folder *parent = (Folder *)current_folder->parent(); - if (!parent)//the parent folder is the project folder (it always exists) - parent = projectFolder(); - - while(text.isEmpty()){ - QMessageBox::critical(this,tr("QtiPlot - Error"), tr("Please enter a valid name!")); - it->setRenameEnabled (0, false); - it->setText(0, ((FolderListItem*)it)->folder()->objectName()); - return; - } - - QStringList lst = parent->subfolders(); - lst.remove(current_folder->objectName()); - while(lst.contains(text)){ - QMessageBox::critical(this,tr("QtiPlot - Error"), - tr("Name already exists!")+"\n"+tr("Please choose another name!")); - - it->setRenameEnabled (0, false); - it->setText(0, ((FolderListItem*)it)->folder()->objectName()); - return; - } - - current_folder->setObjectName(text); - it->setRenameEnabled (0, false); - connect(folders, SIGNAL(currentChanged(Q3ListViewItem *)), - this, SLOT(folderItemChanged(Q3ListViewItem *))); - folders->setCurrentItem(parent->folderListItem());//update the list views -} - -void ApplicationWindow::showAllFolderWindows() -{ - QList lst = current_folder->windowsList(); - foreach(MdiSubWindow *w, lst) - {//force show all windows in current folder - if (w) - { - updateWindowLists(w); - switch (w->status()) - { - case MdiSubWindow::Hidden: - w->showNormal(); - break; - - case MdiSubWindow::Normal: - w->showNormal(); - break; - - case MdiSubWindow::Minimized: - w->showMinimized(); - break; - - case MdiSubWindow::Maximized: - w->showMaximized(); - break; - } - } - } - - if ( (current_folder->children()).isEmpty() ) - return; - - FolderListItem *fi = current_folder->folderListItem(); - FolderListItem *item = (FolderListItem *)fi->firstChild(); - int initial_depth = item->depth(); - while (item && item->depth() >= initial_depth) - {// show/hide windows in all subfolders - lst = ((Folder *)item->folder())->windowsList(); - foreach(MdiSubWindow *w, lst){ - if (w && show_windows_policy == SubFolders){ - updateWindowLists(w); - switch (w->status()) - { - case MdiSubWindow::Hidden: - w->showNormal(); - break; - - case MdiSubWindow::Normal: - w->showNormal(); - break; - - case MdiSubWindow::Minimized: - w->showMinimized(); - break; - - case MdiSubWindow::Maximized: - w->showMaximized(); - break; - } - } - else - w->hide(); - } - - item = (FolderListItem *)item->itemBelow(); - } -} - -void ApplicationWindow::hideAllFolderWindows() -{ - QList lst = current_folder->windowsList(); - foreach(MdiSubWindow *w, lst) - hideWindow(w); - - if ( (current_folder->children()).isEmpty() ) - return; - - if (show_windows_policy == SubFolders) - { - FolderListItem *fi = current_folder->folderListItem(); - FolderListItem *item = (FolderListItem *)fi->firstChild(); - int initial_depth = item->depth(); - while (item && item->depth() >= initial_depth) - { - lst = item->folder()->windowsList(); - foreach(MdiSubWindow *w, lst) - hideWindow(w); - - item = (FolderListItem *)item->itemBelow(); - } - } -} - -void ApplicationWindow::projectProperties() -{ - QString s = QString(current_folder->objectName()) + "\n\n"; - s += "\n\n\n"; - s += tr("Type") + ": " + tr("Project")+"\n\n"; - if (projectname != "untitled") - { - s += tr("Path") + ": " + projectname + "\n\n"; - - QFileInfo fi(projectname); - s += tr("Size") + ": " + QString::number(fi.size()) + " " + tr("bytes")+ "\n\n"; - } - - s += tr("Contents") + ": " + QString::number(windowsList().size()) + " " + tr("windows"); - s += ", " + QString::number(current_folder->subfolders().count()) + " " + tr("folders") + "\n\n"; - s += "\n\n\n"; - - if (projectname != "untitled") - { - QFileInfo fi(projectname); - s += tr("Created") + ": " + fi.created().toString(Qt::LocalDate) + "\n\n"; - s += tr("Modified") + ": " + fi.lastModified().toString(Qt::LocalDate) + "\n\n"; - } - else - s += tr("Created") + ": " + current_folder->birthDate() + "\n\n"; - - QMessageBox *mbox = new QMessageBox ( tr("Properties"), s, QMessageBox::NoIcon, - QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton, this); - - mbox->setIconPixmap(QPixmap( qtiplot_logo_xpm )); - mbox->show(); -} - -void ApplicationWindow::folderProperties() -{ - if (!current_folder->parent()) - { - projectProperties(); - return; - } - - QString s = QString(current_folder->objectName()) + "\n\n"; - s += "\n\n\n"; - s += tr("Type") + ": " + tr("Folder")+"\n\n"; - s += tr("Path") + ": " + current_folder->path() + "\n\n"; - s += tr("Size") + ": " + current_folder->sizeToString() + "\n\n"; - s += tr("Contents") + ": " + QString::number(current_folder->windowsList().count()) + " " + tr("windows"); - s += ", " + QString::number(current_folder->subfolders().count()) + " " + tr("folders") + "\n\n"; - //s += "\n\n\n"; - s += tr("Created") + ": " + current_folder->birthDate() + "\n\n"; - //s += tr("Modified") + ": " + current_folder->modificationDate() + "\n\n"; - - QMessageBox *mbox = new QMessageBox ( tr("Properties"), s, QMessageBox::NoIcon, - QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton, this); - - mbox->setIconPixmap(QPixmap( folder_open_xpm )); - mbox->show(); -} - -void ApplicationWindow::addFolder() -{ - if (!explorerWindow->isVisible()) - explorerWindow->show(); - - QStringList lst = current_folder->subfolders(); - QString name = tr("New Folder"); - lst = lst.grep( name ); - if (!lst.isEmpty()) - name += " ("+ QString::number(lst.size()+1)+")"; - - Folder *f = new Folder(current_folder, name); - addFolderListViewItem(f); - - FolderListItem *fi = new FolderListItem(current_folder->folderListItem(), f); - if (fi){ - f->setFolderListItem(fi); - fi->setRenameEnabled (0, true); - fi->startRename(0); - } -} - -Folder* ApplicationWindow::addFolder(QString name, Folder* parent) -{ - if(!parent){ - if (current_folder) - parent = current_folder; - else - parent = projectFolder(); - } - - QStringList lst = parent->subfolders(); - lst = lst.grep( name ); - if (!lst.isEmpty()) - name += " ("+ QString::number(lst.size()+1)+")"; - - Folder *f = new Folder(parent, name); - addFolderListViewItem(f); - - FolderListItem *fi = new FolderListItem(parent->folderListItem(), f); - if (fi) - f->setFolderListItem(fi); - - return f; -} - -bool ApplicationWindow::deleteFolder(Folder *f) -{ - if (!f) - return false; - - if (confirmCloseFolder && QMessageBox::information(this, tr("QtiPlot - Delete folder?"), - tr("Delete folder '%1' and all the windows it contains?").arg(f->objectName()), - tr("Yes"), tr("No"), 0, 0)) - return false; - else { - Folder *parent = projectFolder(); - if (current_folder){ - if (current_folder->parent()) - parent = (Folder *)current_folder->parent(); - } - - folders->blockSignals(true); - - FolderListItem *fi = f->folderListItem(); - foreach(MdiSubWindow *w, f->windowsList()){ - w->askOnCloseEvent(false); - closeWindow(w); - } - - if (!(f->children()).isEmpty()){ - Folder *subFolder = f->folderBelow(); - int initial_depth = f->depth(); - while (subFolder && subFolder->depth() > initial_depth){ - foreach(MdiSubWindow *w, subFolder->windowsList()){ - removeWindowFromLists(w); - subFolder->removeWindow(w); - delete w; - } - delete subFolder->folderListItem(); - delete subFolder; - - subFolder = f->folderBelow(); - } - } - - delete f; - delete fi; - - current_folder = parent; - folders->setCurrentItem(parent->folderListItem()); - changeFolder(parent, true); - - folders->blockSignals(false); - folders->setFocus(); - return true; - } -} - -void ApplicationWindow::deleteFolder() -{ - Folder *parent = (Folder *)current_folder->parent(); - if (!parent) - parent = projectFolder(); - - folders->blockSignals(true); - - if (deleteFolder(current_folder)){ - current_folder = parent; - folders->setCurrentItem(parent->folderListItem()); - changeFolder(parent, true); - } - - folders->blockSignals(false); - folders->setFocus(); -} - -void ApplicationWindow::folderItemDoubleClicked(Q3ListViewItem *it) -{ - if (!it || it->rtti() != FolderListItem::RTTI) - return; - - FolderListItem *item = ((FolderListItem *)it)->folder()->folderListItem(); - folders->setCurrentItem(item); -} - -void ApplicationWindow::folderItemChanged(Q3ListViewItem *it) -{ - if (!it) - return; - - it->setOpen(true); - changeFolder (((FolderListItem *)it)->folder()); - folders->setFocus(); -} - -void ApplicationWindow::hideFolderWindows(Folder *f) -{ - if (!f) - return; - - QList lst = f->windowsList(); - foreach(MdiSubWindow *w, lst) - w->hide(); - - if ((f->children()).isEmpty()) - return; - - Folder *dir = f->folderBelow(); - int initial_depth = f->depth(); - while (dir && dir->depth() > initial_depth){ - lst = dir->windowsList(); - foreach(MdiSubWindow *w, lst) - w->hide(); - - dir = dir->folderBelow(); - } -} - -bool ApplicationWindow::changeFolder(Folder *newFolder, bool force) -{ - if (!newFolder) - return false; - - if (current_folder == newFolder && !force) - return false; - - disconnect(d_workspace, SIGNAL(subWindowActivated(QMdiSubWindow *)), - this, SLOT(windowActivated(QMdiSubWindow*))); - - desactivateFolders(); - newFolder->folderListItem()->setActive(true); - - Folder *oldFolder = current_folder; - MdiSubWindow::Status old_active_window_state = MdiSubWindow::Normal; - MdiSubWindow *old_active_window = oldFolder->activeWindow(); - if (old_active_window) - old_active_window_state = old_active_window->status(); - - MdiSubWindow::Status active_window_state = MdiSubWindow::Normal; - MdiSubWindow *active_window = newFolder->activeWindow(); - - if (active_window) - active_window_state = active_window->status(); - - hideFolderWindows(oldFolder); - current_folder = newFolder; - - results->setText(current_folder->logInfo()); - - lv->clear(); - - QObjectList folderLst = newFolder->children(); - if(!folderLst.isEmpty()){ - foreach(QObject *f, folderLst) - addFolderListViewItem(static_cast(f)); - } - - QList lst = newFolder->windowsList(); - foreach(MdiSubWindow *w, lst){ - if (!hiddenWindows->contains(w) && show_windows_policy != HideAll){ - //show only windows in the current folder which are not hidden by the user - if(w->status() == MdiSubWindow::Normal) - w->showNormal(); - else if(w->status() == MdiSubWindow::Minimized) - w->showMinimized(); - else if(w->status() == MdiSubWindow::Maximized) - w->showMaximized(); - } else - w->setStatus(MdiSubWindow::Hidden); - - addListViewItem(w); - } - - if (!(newFolder->children()).isEmpty()){ - Folder *f = newFolder->folderBelow(); - int initial_depth = newFolder->depth(); - while (f && f->depth() > initial_depth){//show/hide windows in subfolders - lst = f->windowsList(); - foreach(MdiSubWindow *w, lst){ - if (!hiddenWindows->contains(w)){ - if (show_windows_policy == SubFolders){ - if (w->status() == MdiSubWindow::Normal || w->status() == MdiSubWindow::Maximized) - w->showNormal(); - else if (w->status() == MdiSubWindow::Minimized) - w->showMinimized(); - } else - w->hide(); - } - } - f = f->folderBelow(); - } - } - - if (active_window){ - d_active_window = active_window; - d_workspace->setActiveSubWindow(active_window); - - if (active_window_state == MdiSubWindow::Minimized) - active_window->showMinimized();//ws->setActiveWindow() makes minimized windows to be shown normally - else if (active_window_state == MdiSubWindow::Maximized){ - if (active_window->isA("Graph3D")) - ((Graph3D *)active_window)->setIgnoreFonts(true); - active_window->showMaximized(); - if (active_window->isA("Graph3D")) - ((Graph3D *)active_window)->setIgnoreFonts(false); - } - } else - d_active_window = (MdiSubWindow *)d_workspace->activeSubWindow(); - - customMenu(d_active_window); - customToolBars(d_active_window); - - if (old_active_window){ - old_active_window->setStatus(old_active_window_state); - oldFolder->setActiveWindow(old_active_window); - } - - connect(d_workspace, SIGNAL(subWindowActivated(QMdiSubWindow *)), - this, SLOT(windowActivated(QMdiSubWindow*))); - - if (!d_opening_file) - modifiedProject(); - return true; -} - -void ApplicationWindow::desactivateFolders() -{ - FolderListItem *item = (FolderListItem *)folders->firstChild(); - while (item){ - item->setActive(false); - item = (FolderListItem *)item->itemBelow(); - } -} - -void ApplicationWindow::addListViewItem(MdiSubWindow *w) -{ - if (!w) - return; - - WindowListItem* it = new WindowListItem(lv, w); - if (w->isA("Matrix")){ - it->setPixmap(0, QPixmap(matrix_xpm)); - it->setText(1, tr("Matrix")); - } - else if (w->inherits("Table")){ - it->setPixmap(0, QPixmap(worksheet_xpm)); - it->setText(1, tr("Table")); - } - else if (w->isA("Note")){ - it->setPixmap(0, QPixmap(note_xpm)); - it->setText(1, tr("Note")); - } - else if (w->isA("MultiLayer")){ - it->setPixmap(0, QPixmap(graph_xpm)); - it->setText(1, tr("Graph")); - } - else if (w->isA("Graph3D")){ - it->setPixmap(0, QPixmap(trajectory_xpm)); - it->setText(1, tr("3D Graph")); - } - - it->setText(0, w->objectName()); - it->setText(2, w->aspect()); - it->setText(3, w->sizeToString()); - it->setText(4, w->birthDate()); - it->setText(5, w->windowLabel()); - - updateCompleter(w->objectName()); -} - -void ApplicationWindow::windowProperties() -{ - WindowListItem *it = (WindowListItem *)lv->currentItem(); - MdiSubWindow *w = it->window(); - if (!w) - return; - - QMessageBox *mbox = new QMessageBox ( tr("Properties"), QString(), QMessageBox::NoIcon, - QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton, this); - - QString s = QString(w->objectName()) + "\n\n"; - s += "\n\n\n"; - - s += tr("Label") + ": " + ((MdiSubWindow *)w)->windowLabel() + "\n\n"; - - if (w->isA("Matrix")){ - mbox->setIconPixmap(QPixmap(matrix_xpm)); - s += tr("Type") + ": " + tr("Matrix") + "\n\n"; - }else if (w->inherits("Table")){ - mbox->setIconPixmap(QPixmap(worksheet_xpm)); - s += tr("Type") + ": " + tr("Table") + "\n\n"; - }else if (w->isA("Note")){ - mbox->setIconPixmap(QPixmap(note_xpm)); - s += tr("Type") + ": " + tr("Note") + "\n\n"; - }else if (w->isA("MultiLayer")){ - mbox->setIconPixmap(QPixmap(graph_xpm)); - s += tr("Type") + ": " + tr("Graph") + "\n\n"; - }else if (w->isA("Graph3D")){ - mbox->setIconPixmap(QPixmap(trajectory_xpm)); - s += tr("Type") + ": " + tr("3D Graph") + "\n\n"; - } - s += tr("Path") + ": " + current_folder->path() + "\n\n"; - s += tr("Size") + ": " + w->sizeToString() + "\n\n"; - s += tr("Created") + ": " + w->birthDate() + "\n\n"; - s += tr("Status") + ": " + it->text(2) + "\n\n"; - mbox->setText(s); - mbox->show(); -} - -void ApplicationWindow::addFolderListViewItem(Folder *f) -{ - if (!f) - return; - - FolderListItem* it = new FolderListItem(lv, f); - it->setActive(false); - it->setText(0, f->objectName()); - it->setText(1, tr("Folder")); - it->setText(3, f->sizeToString()); - it->setText(4, f->birthDate()); -} - -void ApplicationWindow::find(const QString& s, bool windowNames, bool labels, - bool folderNames, bool caseSensitive, bool partialMatch, bool subfolders) -{ - if (windowNames || labels){ - MdiSubWindow *w = current_folder->findWindow(s, windowNames, labels, caseSensitive, partialMatch); - if (w){ - activateWindow(w); - return; - } - - if (subfolders){ - FolderListItem *item = (FolderListItem *)folders->currentItem()->firstChild(); - while (item){ - Folder *f = item->folder(); - MdiSubWindow *w = f->findWindow(s,windowNames,labels,caseSensitive,partialMatch); - if (w){ - folders->setCurrentItem(f->folderListItem()); - activateWindow(w); - return; - } - item = (FolderListItem *)item->itemBelow(); - } - } - } - - if (folderNames){ - Folder *f = current_folder->findSubfolder(s, caseSensitive, partialMatch); - if (f){ - folders->setCurrentItem(f->folderListItem()); - return; - } - - if (subfolders){ - FolderListItem *item = (FolderListItem *)folders->currentItem()->firstChild(); - while (item){ - Folder *f = item->folder()->findSubfolder(s, caseSensitive, partialMatch); - if (f){ - folders->setCurrentItem(f->folderListItem()); - return; - } - - item = (FolderListItem *)item->itemBelow(); - } - } - } - - QMessageBox::warning(this, tr("QtiPlot - No match found"), - tr("Sorry, no match found for string: '%1'").arg(s)); -} - -void ApplicationWindow::dropFolderItems(Q3ListViewItem *dest) -{ - if (!dest || draggedItems.isEmpty ()) - return; - - Folder *dest_f = ((FolderListItem *)dest)->folder(); - - Q3ListViewItem *it; - QStringList subfolders = dest_f->subfolders(); - - foreach(it, draggedItems){ - if (it->rtti() == FolderListItem::RTTI){ - Folder *f = ((FolderListItem *)it)->folder(); - FolderListItem *src = f->folderListItem(); - if (dest_f == f){ - QMessageBox::critical(this, "QtiPlot - Error", tr("Cannot move an object to itself!")); - return; - } - - if (((FolderListItem *)dest)->isChildOf(src)){ - QMessageBox::critical(this,"QtiPlot - Error",tr("Cannot move a parent folder into a child folder!")); - draggedItems.clear(); - folders->setCurrentItem(current_folder->folderListItem()); - return; - } - - Folder *parent = (Folder *)f->parent(); - if (!parent) - parent = projectFolder(); - if (dest_f == parent) - return; - - if (subfolders.contains(f->objectName())){ - QMessageBox::critical(this, tr("QtiPlot") +" - " + tr("Skipped moving folder"), - tr("The destination folder already contains a folder called '%1'! Folder skipped!").arg(f->objectName())); - } else - moveFolder(src, (FolderListItem *)dest); - } else { - if (dest_f == current_folder) - return; - - hideFolderWindows(current_folder); - - MdiSubWindow *w = ((WindowListItem *)it)->window(); - if (w){ - current_folder->removeWindow(w); - w->hide(); - dest_f->addWindow(w); - dest_f->setActiveWindow(w); - delete it; - } - } - } - - draggedItems.clear(); - current_folder = dest_f; - folders->setCurrentItem(dest_f->folderListItem()); - changeFolder(dest_f, true); - folders->setFocus(); -} - -void ApplicationWindow::moveFolder(FolderListItem *src, FolderListItem *dest) -{ - folders->blockSignals(true); - if (copyFolder(src->folder(), dest->folder())){ - delete src->folder(); - delete src; - } - folders->blockSignals(false); -} - -bool ApplicationWindow::copyFolder(Folder *src, Folder *dest) -{ - if (!src || !dest) - return false; - - if (dest->subfolders().contains(src->objectName())){ - QMessageBox::critical(this, tr("QtiPlot") + " - " + tr("Error"), - tr("The destination folder already contains a folder called '%1'! Folder skipped!").arg(src->objectName())); - return false; - } - - Folder *dest_f = new Folder(dest, src->objectName()); - dest_f->setBirthDate(src->birthDate()); - dest_f->setModificationDate(src->modificationDate()); - - FolderListItem *copy_item = new FolderListItem(dest->folderListItem(), dest_f); - copy_item->setText(0, src->objectName()); - copy_item->setOpen(src->folderListItem()->isOpen()); - dest_f->setFolderListItem(copy_item); - - QList lst = QList(src->windowsList()); - foreach(MdiSubWindow *w, lst) - dest_f->addWindow(w); - - if (!(src->children()).isEmpty()){ - int initial_depth = src->depth(); - Folder *parentFolder = dest_f; - src = src->folderBelow(); - while (src && parentFolder && src->depth() > initial_depth){ - dest_f = new Folder(parentFolder, src->objectName()); - dest_f->setBirthDate(src->birthDate()); - dest_f->setModificationDate(src->modificationDate()); - - copy_item = new FolderListItem(parentFolder->folderListItem(), dest_f); - copy_item->setText(0, src->objectName()); - copy_item->setOpen(src->folderListItem()->isOpen()); - dest_f->setFolderListItem(copy_item); - - lst = QList(src->windowsList()); - foreach(MdiSubWindow *w, lst) - dest_f->addWindow(w); - - int depth = src->depth(); - src = src->folderBelow(); - if (src){ - int next_folder_depth = src->depth(); - if (next_folder_depth > depth) - parentFolder = dest_f; - else if (next_folder_depth < depth && next_folder_depth > initial_depth) - parentFolder = (Folder*)parentFolder->parent(); - } - } - } - return true; -} - -void ApplicationWindow::searchForUpdates() -{ - int choice = QMessageBox::question(this, tr("QtiPlot"), - tr("QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet!") + "\n" + - tr("Do you wish to continue?"), - QMessageBox::Yes|QMessageBox::Default, QMessageBox::No|QMessageBox::Escape); - - if (choice == QMessageBox::Yes){ - version_buffer.open(IO_WriteOnly); - http = new QHttp(this); - connect(http, SIGNAL(done(bool)), this, SLOT(receivedVersionFile(bool))); - - QNetworkProxy proxy = QNetworkProxy::applicationProxy(); - if (!proxy.hostName().isEmpty()) - http->setProxy(proxy.hostName(), proxy.port(), proxy.user(), proxy.password()); - - http->setHost("soft.proindependent.com"); - http->get("/version.txt", &version_buffer); - } -} - -void ApplicationWindow::receivedVersionFile(bool error) -{ - if (error){ - QMessageBox::warning(this, tr("QtiPlot - HTTP get version file"), - tr("Error while fetching version file with HTTP: %1.").arg(http->errorString())); - return; - } - - version_buffer.close(); - if (version_buffer.open(IO_ReadOnly)){ - QTextStream t( &version_buffer ); - t.setEncoding(QTextStream::UnicodeUTF8); - QString version = t.readLine(); - version_buffer.close(); - - QString currentVersion = QString::number(maj_version) + "." + QString::number(min_version) + - "." + QString::number(patch_version) + QString(extra_version); - - if (currentVersion != version){ - if(QMessageBox::question(this, tr("QtiPlot - Updates Available"), - tr("There is a newer version of QtiPlot (%1) available for download. Would you like to download it?").arg(version), - QMessageBox::Yes|QMessageBox::Default, QMessageBox::No|QMessageBox::Escape) == QMessageBox::Yes) - QDesktopServices::openUrl(QUrl("http://soft.proindependent.com/download.html")); - } else if (!autoSearchUpdatesRequest){ - QMessageBox::information(this, tr("QtiPlot - No Updates Available"), - tr("No updates available. Your current version %1 is the last version available!").arg(version)); - } - autoSearchUpdatesRequest = false; - } - http->abort(); - delete http; -} - -/*! - Turns 3D animation on or off - */ -void ApplicationWindow::toggle3DAnimation(bool on) -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->animate(on); -} - -QString ApplicationWindow::generateUniqueName(const QString& name, bool increment) -{ - int index = 0; - QStringList lst; - Folder *f = projectFolder(); - while (f){ - QList folderWindows = f->windowsList(); - foreach(MdiSubWindow *w, folderWindows){ - lst << QString(w->objectName()); - if (QString(w->objectName()).startsWith(name)) - index++; - } - f = f->folderBelow(); - } - - QString newName = name; - if (increment)//force return of a different name - newName += QString::number(++index); - else if (index>0) - newName += QString::number(index); - - while(lst.contains(newName)) - newName = name + QString::number(++index); - - return newName; -} - -void ApplicationWindow::clearTable() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return; - - if (QMessageBox::question(this, tr("QtiPlot - Warning"), - tr("This will clear the contents of all the data associated with the table. Are you sure?"), - tr("&Yes"), tr("&No"), QString(), 0, 1 ) ) - return; - else - t->clear(); -} - -void ApplicationWindow::goToRow() -{ - MdiSubWindow *w = activeWindow(); - if (!w) - return; - - if (w->inherits("Table") || w->isA("Matrix")){ - bool ok; - int row = QInputDialog::getInteger(this, tr("QtiPlot - Enter row number"), tr("Row"), - 1, 0, 1000000, 1, &ok, windowFlags() & ~Qt::WindowContextHelpButtonHint & ~Qt::WindowMinMaxButtonsHint ); - if ( !ok ) - return; - - if (w->inherits("Table")) - ((Table *)w)->goToRow(row); - else if (w->isA("Matrix")) - ((Matrix *)w)->goToRow(row); - } -} - -void ApplicationWindow::goToColumn() -{ - MdiSubWindow *w = activeWindow(); - if (!w) - return; - - if (w->inherits("Table") || w->isA("Matrix")){ - bool ok; - int col = QInputDialog::getInteger(this, tr("QtiPlot - Enter column number"), tr("Column"), - 1, 0, 1000000, 1, &ok, windowFlags() & ~Qt::WindowContextHelpButtonHint & ~Qt::WindowMinMaxButtonsHint ); - if ( !ok ) - return; - - if (w->inherits("Table")) - ((Table *)w)->goToColumn(col); - else if (w->isA("Matrix")) - ((Matrix *)w)->goToColumn(col); - } -} - -void ApplicationWindow::showScriptWindow(bool parent) -{ - if (!scriptWindow){ - scriptWindow = new ScriptWindow(scriptEnv, this); - if (d_completion && d_completer) - scriptWindow->editor()->setCompleter(d_completer); - scriptWindow->showLineNumbers(d_note_line_numbers); - scriptWindow->editor()->setTabStopWidth(d_notes_tab_length); - scriptWindow->editor()->setCurrentFont(d_notes_font); - scriptWindow->resize(d_script_win_rect.size()); - scriptWindow->move(d_script_win_rect.topLeft()); - connect(scriptWindow, SIGNAL(visibilityChanged(bool)), actionShowScriptWindow, SLOT(setOn(bool))); - } - - if (!parent) - scriptWindow->setAttribute(Qt::WA_DeleteOnClose); - - if (!scriptWindow->isVisible()){ - Qt::WindowFlags flags = 0; - if (d_script_win_on_top) - flags |= Qt::WindowStaysOnTopHint; - scriptWindow->setWindowFlags(flags); - scriptWindow->show(); - scriptWindow->setFocus(); - } else - scriptWindow->hide(); -} - -/*! - Turns perspective mode on or off - */ -void ApplicationWindow::togglePerspective(bool on) -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setOrthogonal(!on); -} - -/*! - Resets rotation of 3D plots to default values - */ -void ApplicationWindow::resetRotation() -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->setRotation(30, 0, 15); -} - -/*! - Finds best layout for the 3D plot - */ -void ApplicationWindow::fitFrameToLayer() -{ - Graph3D *g = (Graph3D *)activeWindow(Plot3DWindow); - if (!g) - return; - - g->findBestLayout(); -} - -ApplicationWindow::~ApplicationWindow() -{ - disableTools();//avoids crash if a plot tol is still active - - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - MultiLayer *ml = qobject_cast(w); - if (ml && ml->hasSelectedLayers()) - delete ml; - } - - delete hiddenWindows; - - if (scriptWindow) - scriptWindow->close(); - - if (d_text_editor) - delete d_text_editor; - - QApplication::clipboard()->clear(QClipboard::Clipboard); - QApplication::restoreOverrideCursor(); -} - -QString ApplicationWindow::versionString() -{ - return "QtiPlot " + QString::number(maj_version) + "." + - QString::number(min_version) + "." + QString::number(patch_version) + extra_version; -} - - -int ApplicationWindow::convertOldToNewColorIndex(int cindex) -{ - if( (cindex == 13) || (cindex == 14) ) // white and light gray - return cindex + 4; - - if(cindex == 15) // dark gray - return cindex + 8; - - return cindex; -} - -void ApplicationWindow::cascade() -{ - const int xoffset = 13; - const int yoffset = 20; - int x = 0; - int y = 0; - QList windows = d_workspace->subWindowList(QMdiArea::StackingOrder); - foreach (QMdiSubWindow *w, windows){ - if (!w->isVisible()) - continue; - - w->setActiveWindow(); - ((MdiSubWindow *)w)->setNormal(); - w->setGeometry(x, y, w->geometry().width(), w->geometry().height()); - w->raise(); - x += xoffset; - y += yoffset; - } - modifiedProject(); -} - -ApplicationWindow * ApplicationWindow::loadScript(const QString& fn, bool execute, bool noGui, bool factorySettings) -{ -#ifdef SCRIPTING_PYTHON - if (noGui){ - hide(); - setScriptingLanguage("Python"); - - ScriptEdit *se = new ScriptEdit(scriptEnv, this); - se->importASCII(fn); - se->executeAll(); - - exit(0); - } else { - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - setScriptingLanguage("Python"); - restoreApplicationGeometry(); - - showScriptWindow(); - scriptWindow->open(fn); - - QApplication::restoreOverrideCursor(); - - if (execute){ - scriptWindow->hide(); - scriptWindow->executeAll(); - if (scriptWindow->editor()->error()) - showScriptWindow(); - } - return this; - } -#else - QMessageBox::critical(this, tr("QtiPlot") + " - " + tr("Error"), - tr("QtiPlot was not built with Python scripting support included!")); -#endif - return 0; -} - -bool ApplicationWindow::validFor2DPlot(Table *table, Graph::CurveType type) -{ - if (!table->selectedYColumns().count()){ - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Please select a Y column to plot!")); - return false; - } else if (type != Graph::Box && type != Graph::Histogram && type != Graph::Pie){ - if (table->numCols() < 2) { - QMessageBox::critical(this, tr("QtiPlot - Error"),tr("You need at least two columns for this operation!")); - return false; - } else if (table->noXColumn()) { - QMessageBox::critical(this, tr("QtiPlot - Error"), tr("Please set a default X column for this table, first!")); - return false; - } - } - return true; -} - -MultiLayer* ApplicationWindow::generate2DGraph(Graph::CurveType type) -{ - MdiSubWindow *w = activeWindow(); - if (!w) - return 0; - - if (w->inherits("Table")){ - Table *table = static_cast(w); - if (!validFor2DPlot(table, type)) - return 0; - - Q3TableSelection sel = table->getSelection(); - return multilayerPlot(table, table->drawableColumnSelection(), type, sel.topRow(), sel.bottomRow()); - } else if (w->isA("Matrix")){ - Matrix *m = static_cast(w); - return plotHistogram(m); - } - return 0; -} - -bool ApplicationWindow::validFor3DPlot(Table *table) -{ - if (table->numCols()<2){ - QMessageBox::critical(0,tr("QtiPlot - Error"),tr("You need at least two columns for this operation!")); - return false; - } - if (table->selectedColumn() < 0 || table->colPlotDesignation(table->selectedColumn()) != Table::Z){ - QMessageBox::critical(0,tr("QtiPlot - Error"),tr("Please select a Z column for this operation!")); - return false; - } - if (table->noXColumn()){ - QMessageBox::critical(0,tr("QtiPlot - Error"),tr("You need to define a X column first!")); - return false; - } - if (table->noYColumn()){ - QMessageBox::critical(0,tr("QtiPlot - Error"),tr("You need to define a Y column first!")); - return false; - } - return true; -} - -void ApplicationWindow::hideSelectedWindows() -{ - Q3ListViewItem *item; - QList lst; - for (item = lv->firstChild(); item; item = item->nextSibling()){ - if (item->isSelected()) - lst.append(item); - } - - folders->blockSignals(true); - foreach(item, lst){ - if (item->rtti() != FolderListItem::RTTI) - hideWindow(((WindowListItem *)item)->window()); - } - folders->blockSignals(false); -} - -void ApplicationWindow::showSelectedWindows() -{ - Q3ListViewItem *item; - QList lst; - for (item = lv->firstChild(); item; item = item->nextSibling()){ - if (item->isSelected()) - lst.append(item); - } - - folders->blockSignals(true); - foreach(item, lst){ - if (item->rtti() != FolderListItem::RTTI) - activateWindow(((WindowListItem *)item)->window()); - } - folders->blockSignals(false); -} - -void ApplicationWindow::swapColumns() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return; - QStringList lst = t->selectedColumns(); - if(lst.count() != 2) - return; - - t->swapColumns(t->colIndex(lst[0]), t->colIndex(lst[1])); -} - -void ApplicationWindow::moveColumnRight() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (t) - t->moveColumnBy(1); -} - -void ApplicationWindow::moveColumnLeft() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (t) - t->moveColumnBy(-1); -} - -void ApplicationWindow::moveColumnFirst() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (t) - t->moveColumnBy(-t->selectedColumn()); -} - -void ApplicationWindow::moveColumnLast() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (t) - t->moveColumnBy(t->numCols() - t->selectedColumn() - 1); -} - -void ApplicationWindow::adjustColumnWidth() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (t) - t->adjustColumnsWidth(); -} - -void ApplicationWindow::moveTableRowUp() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (t) - t->moveRow(); -} - -void ApplicationWindow::moveTableRowDown() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (t) - t->moveRow(false); -} - -void ApplicationWindow::restoreApplicationGeometry() -{ - if (d_app_rect.isNull()) - showMaximized(); - else { - resize(d_app_rect.size()); - move(d_app_rect.topLeft()); - show(); - } -} - -void ApplicationWindow::scriptsDirPathChanged(const QString& path) -{ - scriptsDirPath = path; - - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - if (w->isA("Note")) - ((Note*)w)->setDirPath(path); - } -} - -void ApplicationWindow::showToolBarsMenu() -{ - QMenu toolBarsMenu; - - QAction *actionFileTools = new QAction(fileTools->windowTitle(), this); - actionFileTools->setCheckable(true); - actionFileTools->setChecked(fileTools->isVisible()); - connect(actionFileTools, SIGNAL(toggled(bool)), fileTools, SLOT(setVisible(bool))); - toolBarsMenu.addAction(actionFileTools); - - QAction *actionEditTools = new QAction(editTools->windowTitle(), this); - actionEditTools->setCheckable(true); - actionEditTools->setChecked(editTools->isVisible()); - connect(actionEditTools, SIGNAL(toggled(bool)), editTools, SLOT(setVisible(bool))); - toolBarsMenu.addAction(actionEditTools); - - QAction *actionNoteTools = new QAction(noteTools->windowTitle(), this); - actionNoteTools->setCheckable(true); - actionNoteTools->setChecked(noteTools->isVisible()); - connect(actionNoteTools, SIGNAL(toggled(bool)), noteTools, SLOT(setVisible(bool))); - toolBarsMenu.addAction(actionNoteTools); - - QAction *actionTableTools = new QAction(tableTools->windowTitle(), this); - actionTableTools->setCheckable(true); - actionTableTools->setChecked(tableTools->isVisible()); - connect(actionTableTools, SIGNAL(toggled(bool)), tableTools, SLOT(setVisible(bool))); - toolBarsMenu.addAction(actionTableTools); - - QAction *actionColumnTools = new QAction(columnTools->windowTitle(), this); - actionColumnTools->setCheckable(true); - actionColumnTools->setChecked(columnTools->isVisible()); - connect(actionColumnTools, SIGNAL(toggled(bool)), columnTools, SLOT(setVisible(bool))); - toolBarsMenu.addAction(actionColumnTools); - - QAction *actionPlotTools = new QAction(plotTools->windowTitle(), this); - actionPlotTools->setCheckable(true); - actionPlotTools->setChecked(plotTools->isVisible()); - connect(actionPlotTools, SIGNAL(toggled(bool)), plotTools, SLOT(setVisible(bool))); - toolBarsMenu.addAction(actionPlotTools); - - QAction *actionMatrixTools = new QAction(plotMatrixBar->windowTitle(), this); - actionMatrixTools->setCheckable(true); - actionMatrixTools->setChecked(plotMatrixBar->isVisible()); - connect(actionMatrixTools, SIGNAL(toggled(bool)), plotMatrixBar, SLOT(setVisible(bool))); - toolBarsMenu.addAction(actionMatrixTools); - - QAction *actionPlot3DTools = new QAction(plot3DTools->windowTitle(), this); - actionPlot3DTools->setCheckable(true); - actionPlot3DTools->setChecked(plot3DTools->isVisible()); - connect(actionPlot3DTools, SIGNAL(toggled(bool)), plot3DTools, SLOT(setVisible(bool))); - toolBarsMenu.addAction(actionPlot3DTools); - - QAction *actionDisplayBar = new QAction(displayBar->windowTitle(), this); - actionDisplayBar->setCheckable(true); - actionDisplayBar->setChecked(displayBar->isVisible()); - connect(actionDisplayBar, SIGNAL(toggled(bool)), displayBar, SLOT(setVisible(bool))); - toolBarsMenu.addAction(actionDisplayBar); - - QAction *actionFormatToolBar = new QAction(formatToolBar->windowTitle(), this); - actionFormatToolBar->setCheckable(true); - actionFormatToolBar->setChecked(formatToolBar->isVisible()); - connect(actionFormatToolBar, SIGNAL(toggled(bool)), formatToolBar, SLOT(setVisible(bool))); - toolBarsMenu.addAction(actionFormatToolBar); - - QAction *action = toolBarsMenu.exec(QCursor::pos()); - if (!action) - return; - - MdiSubWindow *w = activeWindow(); - - if (action->text() == plotMatrixBar->windowTitle()){ - d_matrix_tool_bar = action->isChecked(); - plotMatrixBar->setEnabled(w && w->isA("Matrix")); - } else if (action->text() == tableTools->windowTitle()){ - d_table_tool_bar = action->isChecked(); - tableTools->setEnabled(w && w->inherits("Table")); - } else if (action->text() == columnTools->windowTitle()){ - d_column_tool_bar = action->isChecked(); - columnTools->setEnabled(w && w->inherits("Table")); - } else if (action->text() == plotTools->windowTitle()){ - d_plot_tool_bar = action->isChecked(); - plotTools->setEnabled(w && w->isA("MultiLayer")); - } else if (action->text() == plot3DTools->windowTitle()){ - d_plot3D_tool_bar = action->isChecked(); - plot3DTools->setEnabled(w && w->isA("Graph3D")); - } else if (action->text() == fileTools->windowTitle()){ - d_file_tool_bar = action->isChecked(); - } else if (action->text() == editTools->windowTitle()){ - d_edit_tool_bar = action->isChecked(); - } else if (action->text() == displayBar->windowTitle()){ - d_display_tool_bar = action->isChecked(); - } else if (action->text() == formatToolBar->windowTitle()){ - d_format_tool_bar = action->isChecked(); - } else if (action->text() == noteTools->windowTitle()){ - d_notes_tool_bar = action->isChecked(); - } -} - -void ApplicationWindow::saveFitFunctions(const QStringList& lst) -{ - if (!lst.count()) - return; - - QString explain = tr("Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location."); - explain += " " + tr("If you want to save your already defined models, please choose a destination folder."); - if (QMessageBox::Ok != QMessageBox::information(this, tr("QtiPlot") + " - " + tr("Import fit models"), explain, - QMessageBox::Ok, QMessageBox::Cancel)) return; - - QString dir = QFileDialog::getExistingDirectory(this, tr("Choose a directory to export the fit models to"), fitModelsPath, QFileDialog::ShowDirsOnly); - if (!dir.isEmpty()){ - fitModelsPath = dir; - - for (int i = 0; isetFormula(l[1]); - - fit->save(fitModelsPath + "/" + fit->objectName() + ".fit"); - } - } - } -} - -void ApplicationWindow::matrixDirectFFT() -{ - Matrix* m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return; - - m->fft(); -} - -void ApplicationWindow::matrixInverseFFT() -{ - Matrix* m = (Matrix*)activeWindow(MatrixWindow); - if (!m) - return; - - m->fft(true); -} - -void ApplicationWindow::setFormatBarFont(const QFont& font) -{ - formatToolBar->setEnabled(true); - - QFontComboBox *fb = (QFontComboBox *)formatToolBar->widgetForAction(actionFontBox); - fb->blockSignals(true); - fb->setCurrentFont(font); - fb->blockSignals(false); - fb->setEnabled(true); - - QSpinBox *sb = (QSpinBox *)formatToolBar->widgetForAction(actionFontSize); - sb->blockSignals(true); - sb->setValue(font.pointSize()); - sb->blockSignals(false); - sb->setEnabled(true); - - actionFontBold->blockSignals(true); - actionFontBold->setChecked(font.bold()); - actionFontBold->blockSignals(false); - - actionFontItalic->blockSignals(true); - actionFontItalic->setChecked(font.italic()); - actionFontItalic->blockSignals(false); - - actionSubscript->setEnabled(false); - actionSuperscript->setEnabled(false); - actionUnderline->setEnabled(false); - actionGreekSymbol->setEnabled(false); - actionGreekMajSymbol->setEnabled(false); - actionMathSymbol->setEnabled(false); -} - -void ApplicationWindow::setFontSize(int size) -{ - QFontComboBox *fb = (QFontComboBox *)formatToolBar->widgetForAction(actionFontBox); - QFont f(fb->currentFont().family(), size); - f.setBold(actionFontBold->isChecked()); - f.setItalic(actionFontItalic->isChecked()); - - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (plot){ - Graph* g = plot->activeLayer(); - if (g) - g->setCurrentFont(f); - } - - Note *n = (Note *)activeWindow(NoteWindow); - if (n){ - d_notes_font = f; - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - Note *m = qobject_cast(w); - if (m) - m->setFont(f); - } - } -} - -void ApplicationWindow::setFontFamily(const QFont& font) -{ - QSpinBox *sb = (QSpinBox *)formatToolBar->widgetForAction(actionFontSize); - QFont f(font.family(), sb->value()); - f.setBold(actionFontBold->isChecked()); - f.setItalic(actionFontItalic->isChecked()); - - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (plot){ - Graph* g = plot->activeLayer(); - if (g) - g->setCurrentFont(f); - } - - Note *n = (Note *)activeWindow(NoteWindow); - if (n){ - d_notes_font = f; - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - Note *m = qobject_cast(w); - if (m) - m->setFont(f); - } - } -} - -void ApplicationWindow::setItalicFont(bool italic) -{ - QFontComboBox *fb = (QFontComboBox *)formatToolBar->widgetForAction(actionFontBox); - QSpinBox *sb = (QSpinBox *)formatToolBar->widgetForAction(actionFontSize); - QFont f(fb->currentFont().family(), sb->value()); - f.setBold(actionFontBold->isChecked()); - f.setItalic(italic); - - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (plot){ - Graph* g = plot->activeLayer(); - if (g) - g->setCurrentFont(f); - } - - Note *n = (Note *)activeWindow(NoteWindow); - if (n){ - d_notes_font = f; - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - Note *m = qobject_cast(w); - if (m) - m->setFont(f); - } - } -} - -void ApplicationWindow::setBoldFont(bool bold) -{ - QFontComboBox *fb = (QFontComboBox *)formatToolBar->widgetForAction(actionFontBox); - QSpinBox *sb = (QSpinBox *)formatToolBar->widgetForAction(actionFontSize); - QFont f(fb->currentFont().family(), sb->value()); - f.setBold(bold); - f.setItalic(actionFontItalic->isChecked()); - - MultiLayer *plot = (MultiLayer *)activeWindow(MultiLayerWindow); - if (plot){ - Graph* g = plot->activeLayer(); - if (g) - g->setCurrentFont(f); - } - - Note *n = (Note *)activeWindow(NoteWindow); - if (n){ - d_notes_font = f; - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows){ - Note *m = qobject_cast(w); - if (m) - m->setFont(f); - } - } -} - -void ApplicationWindow::enableTextEditor(Graph *g) -{ - if (!g){ - formatToolBar->setEnabled(false); - if (d_text_editor){ - d_text_editor->close(); - d_text_editor = NULL; - } - } else if (g) { - if (!g->activeText() && !g->selectedScale() && !g->titleSelected()) - return; - - d_text_editor = new TextEditor(g); - - formatToolBar->setEnabled(true); - actionSubscript->setEnabled(true); - actionSuperscript->setEnabled(true); - actionUnderline->setEnabled(true); - actionGreekSymbol->setEnabled(true); - actionGreekMajSymbol->setEnabled(true); - actionMathSymbol->setEnabled(true); - } -} - -void ApplicationWindow::insertSuperscript() -{ - if (!d_text_editor) - return; - - d_text_editor->formatText("",""); -} - -void ApplicationWindow::insertSubscript() -{ - if (!d_text_editor) - return; - - d_text_editor->formatText("",""); -} - -void ApplicationWindow::underline() -{ - if (!d_text_editor) - return; - - d_text_editor->formatText("",""); -} - -void ApplicationWindow::insertGreekSymbol() -{ - if (!d_text_editor) - return; - - SymbolDialog *greekLetters = new SymbolDialog(SymbolDialog::lowerGreek, this); - connect(greekLetters, SIGNAL(addLetter(const QString&)), d_text_editor, SLOT(addSymbol(const QString&))); - greekLetters->exec(); -} - -void ApplicationWindow::insertGreekMajSymbol() -{ - if (!d_text_editor) - return; - - SymbolDialog *greekLetters = new SymbolDialog(SymbolDialog::upperGreek, this); - connect(greekLetters, SIGNAL(addLetter(const QString&)), d_text_editor, SLOT(addSymbol(const QString&))); - greekLetters->exec(); -} - -void ApplicationWindow::insertMathSymbol() -{ - if (!d_text_editor) - return; - - SymbolDialog *ms = new SymbolDialog(SymbolDialog::mathSymbols, this); - connect(ms, SIGNAL(addLetter(const QString&)), d_text_editor, SLOT(addSymbol(const QString&))); - ms->exec(); -} - -void ApplicationWindow::showCustomActionDialog() -{ - CustomActionDialog *ad = new CustomActionDialog(this); - ad->setAttribute(Qt::WA_DeleteOnClose); - ad->show(); - ad->setFocus(); -} - -void ApplicationWindow::addCustomAction(QAction *action, const QString& parentName, int index) -{ - if (!action) - return; - - QList toolBars = toolBarsList(); - foreach (QToolBar *t, toolBars){ - if (t->objectName() == parentName){ - if (action->icon().isNull()){ - QPixmap icon = QPixmap(16, 16); - QRect r = QRect(0, 0, 15, 15); - icon.fill (Qt::white); - QPainter p; - p.begin(&icon); - p.setPen(QPen(Qt::red, 2)); - p.drawLine(0, 0, 15, 15); - p.drawLine(0, 15, 15, 0); - p.setPen(QPen(Qt::black)); - p.drawRect(r); - action->setIcon(QIcon(icon)); - action->setIconText(tr("No Icon")); - } - t->addAction(action); - if (index < 0) - d_user_actions << action; - else if (index >= 0 && index < d_user_actions.size()) - d_user_actions.replace(index, action); - return; - } - } - - QList menus = customizableMenusList(); - menus += d_user_menus; - foreach (QMenu *m, menus){ - if (m->objectName() == parentName){ - if (action->icon().isNull()) - action->setIconText(tr("No Icon")); - m->addAction(action); - if (index < 0) - d_user_actions << action; - else if (index >= 0 && index < d_user_actions.size()) - d_user_actions.replace(index, action); - return; - } - } -} - -void ApplicationWindow::reloadCustomActions() -{ - reloadCustomMenus(); - - QList menus = customizableMenusList(); - foreach(QAction *a, d_user_actions){ - if (!a->statusTip().isEmpty()){ - foreach (QMenu *m, menus){ - if (m->objectName() == a->statusTip()){ - QList lst = m->actions(); - if (!lst.contains(a)) - m->addAction(a); - - break; - } - } - } - } -} - -void ApplicationWindow::removeCustomAction(QAction *action) -{ - int index = d_user_actions.indexOf(action); - if (index >= 0 && index < d_user_actions.count()){ - d_user_actions.removeAt(index); - delete action; - } -} - -void ApplicationWindow::performCustomAction(QAction *action) -{ - if (!action || !d_user_actions.contains(action)) - return; - -#ifdef SCRIPTING_PYTHON - QString lang = scriptEnv->name(); - setScriptingLanguage("Python"); - - ScriptEdit *script = new ScriptEdit(scriptEnv, 0); - script->importASCII(action->data().toString()); - script->executeAll(); - delete script; - - setScriptingLanguage(lang);// reset old scripting language -#else - QMessageBox::critical(this, tr("QtiPlot") + " - " + tr("Error"), - tr("QtiPlot was not built with Python scripting support included!")); -#endif -} - -void ApplicationWindow::loadCustomActions() -{ - QString path = customActionsDirPath + "/"; - QDir dir(path); - QStringList lst = dir.entryList(QDir::Files|QDir::NoSymLinks, QDir::Name); - for (int i = 0; i < lst.count(); i++){// parse menu files first - QString fileName = path + lst[i]; - QFile file(fileName); - QFileInfo fi(file); - if (!file.open(QFile::ReadOnly | QFile::Text)) - continue; - - if (fi.completeSuffix () != "qcm") - continue; - - CustomMenuHandler handler; - QXmlSimpleReader reader; - reader.setContentHandler(&handler); - reader.setErrorHandler(&handler); - - QXmlInputSource xmlInputSource(&file); - if (reader.parse(xmlInputSource)) - addCustomMenu(handler.title(), handler.location()); - } - - for (int i = 0; i < lst.count(); i++){// parse action files - QString fileName = path + lst[i]; - QFile file(fileName); - QFileInfo fi(file); - if (!file.open(QFile::ReadOnly | QFile::Text)) - continue; - - if (fi.completeSuffix () != "qca") - continue; - - QAction *action = new QAction(this); - CustomActionHandler handler(action); - QXmlSimpleReader reader; - reader.setContentHandler(&handler); - reader.setErrorHandler(&handler); - - QXmlInputSource xmlInputSource(&file); - if (reader.parse(xmlInputSource)) - addCustomAction(action, handler.parentName()); - } -} - -QList ApplicationWindow::customizableMenusList() -{ - QList lst; - lst << windowsMenu << view << graphMenu << fileMenu << format << edit; - lst << help << plot2DMenu; - lst << analysisMenu << multiPeakMenu << smoothMenu << filterMenu << decayMenu << normMenu; - lst << matrixMenu << plot3DMenu << plotDataMenu << scriptingMenu; - lst << tableMenu << fillMenu << newMenu << exportPlotMenu << importMenu; - return lst; -} - -QList ApplicationWindow::menusList() -{ - QList lst; - QObjectList children = this->children(); - foreach (QObject *w, children){ - if (w->isA("QMenu")) - lst << (QMenu *)w; - } - return lst; -} - -QList ApplicationWindow::toolBarsList() -{ - QList lst; - QObjectList children = this->children(); - foreach (QObject *w, children){ - if (w->isA("QToolBar")) - lst << (QToolBar *)w; - } - return lst; -} - -void ApplicationWindow::hideSelectedColumns() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (t) - t->hideSelectedColumns(); -} - -void ApplicationWindow::showAllColumns() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (t) - t->showAllColumns(); -} - -void ApplicationWindow::setMatrixUndoStackSize(int size) -{ - if (d_matrix_undo_stack_size == size) - return; - - d_matrix_undo_stack_size = size; - Folder *f = projectFolder(); - while (f){ - QList folderWindows = f->windowsList(); - foreach(MdiSubWindow *w, folderWindows){ - if (w->isA("Matrix")){ - QUndoStack *stack = ((Matrix *)w)->undoStack(); - if (!stack->count())// undo limit can only be changed for empty stacks - stack->setUndoLimit(size); - } - } - f = f->folderBelow(); - } -} - -QString ApplicationWindow::guessEndOfLine(const QString& sample) -{//Try to guess which end-of-line character is used: - if (sample.indexOf("\r\n") != -1)//Try \r\n first - return "\r\n"; - else if (sample.indexOf("\r") != -1)//then look for \r - return "\r"; - // use \n if neither \r\n nor \r have been found - return "\n"; -} - -QString ApplicationWindow::endOfLine() -{ - switch(d_eol){ - case LF: - return "\n"; - break; - case CRLF: - return "\r\n"; - break; - case CR: - return "\r"; - break; - } - return "\n"; -} - -void ApplicationWindow::initCompleter() -{ - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - QStringList words; -#ifdef SCRIPTING_PYTHON - if (scriptEnv->name() == QString("Python")){ - QString fn = d_python_config_folder + "/qti_wordlist.txt"; - QFile file(fn); - if (!file.open(QFile::ReadOnly)){ - QMessageBox::critical(this, tr("QtiPlot - Warning"), - tr("Couldn't load file: %1.\nAutocompletion will not be available!").arg(QFileInfo(file).absoluteFilePath())); - } else { - while (!file.atEnd()){ - QByteArray line = file.readLine(); - if (!line.isEmpty()){ - QString s = line.trimmed(); - if (!words.contains(s)) - words << s; - } - } - file.close(); - } - - words.append(PythonSyntaxHighlighter::keywordsList()); - - Folder *f = projectFolder(); - while (f){ - QList folderWindows = f->windowsList(); - foreach(MdiSubWindow *w, folderWindows) - words << w->objectName(); - f = f->folderBelow(); - } - } -#endif - - QStringList functions = scriptEnv->mathFunctions(); - foreach(QString s, functions) - words.append(s + "()"); - - words.sort(); - - if (!d_completer){ - d_completer = new QCompleter(this); - d_completer->setModelSorting(QCompleter::CaseSensitivelySortedModel); - d_completer->setCompletionMode(QCompleter::PopupCompletion); - } - d_completer->setModel(new QStringListModel(words, d_completer)); - - QApplication::restoreOverrideCursor(); -} - -void ApplicationWindow::enableCompletion(bool on) -{ - if (!d_completer || d_completion == on) - return; - - d_completion = on; - - if (scriptWindow){ - if (d_completion) - scriptWindow->editor()->setCompleter(d_completer); - else - scriptWindow->editor()->setCompleter(0); - } - - Folder *f = projectFolder(); - while (f){ - QList folderWindows = f->windowsList(); - foreach(MdiSubWindow *w, folderWindows){ - if(w->isA("Note")){ - if (d_completion) - ((Note *)w)->currentEditor()->setCompleter(d_completer); - else - ((Note *)w)->currentEditor()->setCompleter(0); - } - } - f = f->folderBelow(); - } -} - -void ApplicationWindow::showFrequencyCountDialog() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return; - - int validRows = 0; - int ts = t->table()->currentSelection(); - if (ts >= 0){ - Q3TableSelection sel = t->table()->selection(ts); - if (sel.numRows() > 1 && sel.numCols() == 1){ - int col = sel.leftCol(); - for (int i = sel.topRow(); i <= sel.bottomRow(); i++){ - if (!t->text(i, col).isEmpty()) - validRows++; - if (validRows > 1){ - FrequencyCountDialog *fcd = new FrequencyCountDialog(t, this); - fcd->exec(); - break; - } - } - } - } - if (validRows < 2) - QMessageBox::warning(this, tr("QtiPlot - Column selection error"), - tr("Please select exactly one column and more than one non empty cell!")); -} - -Note * ApplicationWindow::newStemPlot() -{ - Table *t = (Table *)activeWindow(TableWindow); - if (!t) - return NULL; - - int ts = t->table()->currentSelection(); - if (ts < 0) - return NULL; - - Note *n = newNote(); - if (!n) - return NULL; - n->hide(); - - ScriptEdit* editor = n->currentEditor(); - QStringList lst = t->selectedColumns(); - if (lst.isEmpty()){ - Q3TableSelection sel = t->table()->selection(ts); - for (int i = sel.leftCol(); i <= sel.rightCol(); i++) - editor->insertPlainText(stemPlot(t, t->colName(i), 1001, sel.topRow() + 1, sel.bottomRow() + 1) + "\n"); - } else { - for (int i = 0; i < lst.count(); i++) - editor->insertPlainText(stemPlot(t, lst[i], 1001) + "\n"); - } - - n->show(); - return n; -} - -QString ApplicationWindow::stemPlot(Table *t, const QString& colName, int power, int startRow, int endRow) -{ - if (!t) - return QString(); - - int col = t->colIndex(colName); - if (col < 0){ - QMessageBox::critical(this, tr("QtiPlot - Error"), - tr("Data set: %1 doesn't exist!").arg(colName)); - return QString(); - } - - startRow--; - endRow--; - if (startRow < 0 || startRow >= t->numRows()) - startRow = 0; - if (endRow < 0 || endRow >= t->numRows()) - endRow = t->numRows() - 1; - - QString result = tr("Stem and leaf plot of dataset") + ": " + colName + " "; - result += tr("from row") + ": " + QString::number(startRow + 1) + " "; - result += tr("to row") + ": " + QString::number(endRow + 1) + "\n"; - - int rows = 0; - for (int j = startRow; j <= endRow; j++){ - if (!t->text(j, col).isEmpty()) - rows++; - } - - if (rows >= 1){ - double *data = (double *)malloc(rows * sizeof (double)); - if (!data){ - result += tr("Not enough memory for this dataset!") + "\n"; - return result; - } - - result += "\n" + tr("Stem") + " | " + tr("Leaf"); - result += "\n---------------------\n"; - - int row = 0; - for (int j = startRow; j <= endRow; j++){ - if (!t->text(j, col).isEmpty()){ - data[row] = t->cell(j, col); - row++; - } - } - gsl_sort (data, 1, rows); - - if (power > 1e3){ - power = std::ceil(log10(data[rows - 1] - data[0]) - log10(rows - 1)); - bool ok; - int input = QInputDialog::getInteger(this, tr("Please confirm the stem unit!"), - tr("Data set") + ": " + colName + ", " + tr("stem unit") + " = 10n, n = ", - power, -1000, 1000, 1, &ok); - if (ok) - power = input; - } - - double stem_unit = pow(10.0, power); - double leaf_unit = stem_unit/10.0; - - int prev_stem = int(data[0]/stem_unit); - result += " " + QString::number(prev_stem) + " | "; - - for (int j = 0; j objectName()){ - QMenu *menu = menuBar()->addMenu(title); - if (menu){ - menu->setObjectName(title); - d_user_menus.append(menu); - connect(menu, SIGNAL(triggered(QAction *)), this, SLOT(performCustomAction(QAction *))); - return menu; - } - } - - QList menus = customizableMenusList(); - foreach (QMenu *m, menus){ - if (m->objectName() == parentName){ - QMenu *menu = m->addMenu(title); - if (menu){ - menu->setObjectName(title); - d_user_menus.append(menu); - return menu; - } - } - } - return NULL; -} - -void ApplicationWindow::removeCustomMenu(const QString& title) -{ - foreach (QMenu *m, d_user_menus){ - if (m->objectName() == title){ - int index = d_user_menus.indexOf(m); - if (index >= 0 && index < d_user_menus.count()){ - d_user_menus.removeAt(index); - delete m; - return; - } - } - } -} - -void ApplicationWindow::reloadCustomMenus() -{ - foreach(QMenu *m, d_user_menus){ - QWidget *parent = m->parentWidget(); - if (parent && !parent->children().contains(m)) - ((QMenu *)parent)->addMenu(m); - } -} - -QColor ApplicationWindow::readColorFromProject(const QString& name) -{ - QColor c = QColor(); - bool canConvertToInt = false; - int fillColIndex = name.toInt(&canConvertToInt); - if (canConvertToInt){ - if (fillColIndex < 0) - return c; - if (d_file_version <= 89) - fillColIndex = convertOldToNewColorIndex(fillColIndex); - c = ColorBox::color(fillColIndex); - } else - c = QColor(name); - - return c; -} - -void ApplicationWindow::enableMdiArea(bool on) -{ - if (d_mdi_windows_area == on) - return; - - d_mdi_windows_area = on; - - if (on){ - QList windows = windowsList(); - foreach(MdiSubWindow *w, windows) - d_workspace->addSubWindow(w); - } else { - QList windows = d_workspace->subWindowList(); - foreach(QMdiSubWindow *w, windows){ - d_workspace->removeSubWindow(w); - w->show(); - } - } -} - -void ApplicationWindow::memoryAllocationError() -{ - QMessageBox::critical(0, tr("QtiPlot") + " - " + tr("Memory Allocation Error"), - tr("Not enough memory, operation aborted!")); -} - -void ApplicationWindow::increasePrecision() -{ - Matrix *m = (Matrix *)activeWindow(MatrixWindow); - if (!m) - return; - - int oldPrec = m->precision(); - if (oldPrec == 13) - return; - - int prec = oldPrec + 1; - QChar format = m->textFormat(); - m->undoStack()->push(new MatrixSetPrecisionCommand(m, format, format, - oldPrec, prec, tr("Set Precision %1 digits").arg(prec))); - m->setNumericPrecision(prec); -} - -void ApplicationWindow::decreasePrecision() -{ - Matrix *m = (Matrix *)activeWindow(MatrixWindow); - if (!m) - return; - - int oldPrec = m->precision(); - if (oldPrec == 0) - return; - - int prec = oldPrec - 1; - QChar format = m->textFormat(); - m->undoStack()->push(new MatrixSetPrecisionCommand(m, format, format, - oldPrec, prec, tr("Set Precision %1 digits").arg(prec))); - m->setNumericPrecision(prec); -} - -void ApplicationWindow::execute() -{ - Note *note = (Note *)activeWindow(NoteWindow); - if (!note) - return; - - note->execute(); -} - -void ApplicationWindow::executeAll() -{ - Note *note = (Note *)activeWindow(NoteWindow); - if (!note) - return; - - note->executeAll(); -} - -void ApplicationWindow::evaluate() -{ - Note *note = (Note *)activeWindow(NoteWindow); - if (!note) - return; - - note->evaluate(); -} - -void ApplicationWindow::addWindowsListToCompleter() -{ -#ifdef SCRIPTING_PYTHON - if (scriptEnv->name() != QString("Python")) - return; - - if (!d_completer) - return; - - QStringListModel *model = qobject_cast (d_completer->model()); - if (!model) - return; - - QStringList lst = model->stringList(); - Folder *f = projectFolder(); - while (f){ - QList folderWindows = f->windowsList(); - foreach(MdiSubWindow *w, folderWindows) - lst << w->objectName(); - f = f->folderBelow(); - } - lst.sort(); - model->setStringList(lst); -#endif -} - -void ApplicationWindow::updateCompleter(const QString& windowName, bool remove, const QString& newName) -{ -#ifdef SCRIPTING_PYTHON - if (scriptEnv->name() != QString("Python")) - return; - - if (!d_completer || d_is_appending_file || d_opening_file) - return; - - QStringListModel *model = qobject_cast (d_completer->model()); - if (!model) - return; - - QStringList lst = model->stringList(); - - if (newName.isEmpty()){ - if (remove) - lst.removeAll(windowName); - else - lst.append(windowName); - } else { - int index = lst.indexOf(windowName); - if (index >= 0) - lst.replace(index, newName); - } - - lst.sort(); - model->setStringList(lst); -#endif -} - -#ifdef SCRIPTING_PYTHON -void ApplicationWindow::openQtDesignerUi() -{ - QString fn = getFileName(this, tr("QtiPlot") + " - " + tr("Choose custom user interface"), workingDir, "*.ui", 0, false); - if (!fn.isEmpty()){ - QFileInfo fi(fn); - workingDir = fi.dirPath(true); - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - setScriptingLanguage("Python"); - - QString script = "# " + tr("Custom user interfaces can be created using the QtDesigner application provided by the Qt framework") + ":\n"; - script += "# http://qt.nokia.com\n"; - script += "# " + tr("For more details about how to use .ui files in your Python scripts please read the PyQt4 documentation") + ":\n"; - script += "# http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#using-the-generated-code\n"; - script += "##############################################################################################\n"; - script += "from PyQt4 import uic\n"; - script += "global ui\n"; - script += "ui = uic.loadUi(\"" + fn + "\")\n"; - script += "ui.show()\n"; - - Note *note = newNote(); - note->setText(script); - note->executeAll(); - - QApplication::restoreOverrideCursor(); - } -} -#endif === added file 'qtiplot/src/core/ApplicationWindow.h' --- qtiplot/src/core/ApplicationWindow.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/ApplicationWindow.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,1488 @@ +/*************************************************************************** + File : ApplicationWindow.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2004 - 2010 by Ion Vasilief, + (C) 2006 - june 2007 Tilman Hoener zu Siederdissen, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : QtiPlot's main window + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef APPLICATION_H +#define APPLICATION_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#ifdef BROWSER_PLUGIN +#include +#endif + +#ifdef QAXSERVER +#include +#include +#include +#endif + +class QPixmap; +class QCloseEvent; +class QDropEvent; +class QTimerEvent; +class QDragEnterEvent; +class QTranslator; +class QDockWidget; +class QAction; +class QActionGroup; +class QTranslator; +class QToolButton; +class QShortcut; +class QMenu; +class QToolBar; +class QAssistantClient; +class QLocale; +class QMdiArea; +class QUndoView; +class QCompleter; + +class Matrix; +class Table; +class ScalePicker; +class Graph3D; +class Note; +class FunctionDialog; +class Folder; +class FolderListItem; +class FolderListView; +class ScriptWindow; +class Plot3DDialog; +class TableStatistics; +class CurveRangeDialog; +class LegendWidget; +class ArrowMarker; +class TextEditor; +class AssociationsDialog; +class ScriptEdit; + +/** + * \brief QtiPlot's main window. + * + * This class contains the main part of the user interface as well as the central project management facilities. + * + * It manages all MdiSubWindow MDI Windows in a project, knows about their organization in Folder objects + * and contains the parts of the project explorer not implemented in Folder, FolderListItem or FolderListView. + * + * Furthermore, it is responsible for displaying most MDI Windows' context menus and opening all sorts of dialogs. + * + * \section future Future Plans + * Split out the project management part into a new Project class. + * If MdiSubWindow maintains a reference to its parent Project, it should be possible to have its subclasses + * display their own context menus and dialogs. + * This is necessary for implementing new plot types or even completely new MdiSubWindow subclasses in plug-ins. + * It will also make ApplicationWindow more manageable by removing those parts not directly related to the main window. + * + * Project would also take care of basic project file reading/writing (using Qt's XML framework), but delegate most of + * the work to MdiSubWindow and its subclasses. This is necessary for providing save/restore of classes implemented in + * plug-ins. Support for foreign formats on the other hand could go into import/export classes (which could also be + * implemented in plug-ins). Those would interface directly with Project and the MyWidgets it manages. Thus, in addition + * to supporting QtXML-based save/restore, Project, MdiSubWindow and subclasses will also have to provide generalized + * save/restore methods/constructors. + * + * Maybe split out the project explorer into a new ProjectExplorer class, depending on how much code is left + * in ApplicationWindow after the above reorganizations. Think about whether a Model/View approach can be + * used for Project/ProjectExplorer. + */ + +class ApplicationWindow: public QMainWindow, public scripted +#ifdef BROWSER_PLUGIN + , public QtNPBindable +#endif +#ifdef QAXSERVER + , public QAxBindable +#endif +{ + Q_OBJECT + +#ifdef BROWSER_PLUGIN + Q_CLASSINFO("ClassID", "{2e5b2715-46b2-4831-ba9b-6a3b195d5ec8}") + Q_CLASSINFO("InterfaceID", "{94581136-3c0c-46cc-97a1-066061356d43}") + Q_CLASSINFO("EventsID", "{8c191b77-1894-45c7-9d6b-201dede95410}") + + Q_CLASSINFO("MIME", "application/x-qtiplot") +#endif + +public: + ApplicationWindow(bool factorySettings = false); + ApplicationWindow(const QStringList& l); + ~ApplicationWindow(); + + enum ShowWindowsPolicy{HideAll, ActiveFolder, SubFolders}; + enum WindowType{NoWindow, TableWindow, MatrixWindow, MultiLayerWindow, NoteWindow, Plot3DWindow}; + enum MatrixToTableConversion{Direct, XYZ, YXZ}; + enum EndLineChar{LF, CRLF, CR}; + enum Analysis{NoAnalysis, Integrate, Diff, FitLinear, FitGauss, FitLorentz, FitSigmoidal, FitSlope}; + enum LaTeXCompiler{MathTran, Local}; + + FolderListView *lv, *folders; + QDockWidget *logWindow; + + /*! Generates a new unique name starting with string /param name. + You can force the output to be a name different from /param name, + even if 'name' is not used in the project, by setting /param increment = true (the default) + */ + QString generateUniqueName(const QString& name, bool increment = true); + void saveFitFunctions(const QStringList& lst); + + //! \name User custom actions + //@{ + void loadCustomActions(); + void reloadCustomActions(); + void removeCustomAction(QAction *); + void addCustomAction(QAction *, const QString& parentName, int index = -1); + QList customActionsList(){return d_user_actions;}; + QList customizableMenusList(); + + void reloadCustomMenus(); + QMenu* addCustomMenu(const QString& title, const QString& parentName); + void removeCustomMenu(const QString& title); + QList customMenusList(){return d_user_menus;}; + //@} + + QList menusList(); + QList toolBarsList(); + + MdiSubWindow *activeWindow(WindowType type = NoWindow); + void setActiveWindow(MdiSubWindow *w){d_active_window = w;}; + QMdiArea* workspace(){return d_workspace;}; + + int matrixUndoStackSize(){return d_matrix_undo_stack_size;}; + void setMatrixUndoStackSize(int size); + + QString endOfLine(); + static QString guessEndOfLine(const QString& sample); + bool autoUpdateTableValues(){return d_auto_update_table_values;}; + void setAutoUpdateTableValues(bool on = true); + + QCompleter* completer(){return d_completer;}; + void enableCompletion(bool on = true); + void addWindowsListToCompleter(); + + QLocale clipboardLocale(){return d_clipboard_locale;}; + void setClipboardLocale(const QLocale& locale){d_clipboard_locale = locale;}; + + QTextEdit *resultsLog(){return results;}; +#ifdef SCRIPTING_CONSOLE + QTextEdit *scriptingConsole(){return console;}; +#endif + + static QString imageFilter(); + static QString getFileName(QWidget *parent = 0, const QString & caption = QString(), + const QString & dir = QString(), const QString & filter = QString(), + QString * selectedFilter = 0, bool save = true, bool confirmOverwrite = true); + + static void memoryAllocationError(); + QColor readColorFromProject(const QString& name); + + void enableMdiArea(bool on = true); + bool isMdiAreaEnabled(){return d_mdi_windows_area;}; + + void displayInfo(const QString& text){info->setText(text);}; + QLineEdit *displayInfoLineEdit(){return info;}; + + QList indexedColors(){return d_indexed_colors;}; + void setIndexedColors(const QList& lst){d_indexed_colors = lst;}; + + QList indexedSymbols(){return d_symbols_list;}; + void setIndexedSymbols(const QList& lst){d_symbols_list = lst;}; + + QStringList indexedColorNames(){return d_indexed_color_names;}; + void setIndexedColorNames(const QStringList& lst){d_indexed_color_names = lst;}; + + void connectScriptEditor(ScriptEdit *); + +public slots: + //! \name Projects and Project Files + //@{ + void open(); + ApplicationWindow* open(const QString& fn, bool factorySettings = false, bool newProject = true); + ApplicationWindow* openProject(const QString& fn, bool factorySettings = false, bool newProject = true); +#ifdef OPJ_IMPORT + ApplicationWindow* importOPJ(const QString& fn, bool factorySettings = false, bool newProject = true); +#endif + void closeProject(); + + /** + * \brief Create a new project from a data file. + * + * \param fn is read as a data file with the default column separator (as set by the user) + * and inserted as a table into a new, empty project. + * This table is then plotted with the Graph::LineSymbols style. + */ + ApplicationWindow * plotFile(const QString& fn); + + /** + * \brief Create a new project from a script file. + * + * \param fn is read as a Python script file and loaded in the command script window. + * \param execute specifies if the script should be executed after opening. + */ + ApplicationWindow * loadScript(const QString& fn, bool execute = false, bool noGui = false); + + QList windowsList(); + void updateWindowLists(MdiSubWindow *w); + /*! + Arranges all the visible project windows in a cascade pattern. + */ + void cascade(); + + void saveProjectAs(const QString& fileName = QString(), bool compress = false); + bool saveProject(bool compress = false); + + //! Set the project status to modifed + void modifiedProject(); + //! Set the project status to saved (not modified) + void savedProject(); + //! Set the project status to modified and save 'w' as the last modified widget + void modifiedProject(MdiSubWindow *w); + //@} + + //! \name Settings + //@{ + void readSettings(); + void saveSettings(); + void setSaveSettings(bool autoSaving, int min); + void changeAppStyle(const QString& s); + void changeAppFont(const QFont& f); + void updateAppFonts(); + void setAppColors(const QColor& wc,const QColor& pc,const QColor& tpc, bool force = false); + + void initWindow(); + //@} + + //! \name Multilayer Plots + //@{ + //! Creates a new empty multilayer plot + MultiLayer* newGraph(const QString& caption = tr("Graph")); + MultiLayer* multilayerPlot(int c, int r, int style, const MultiLayer::AlignPolicy& align = MultiLayer::AlignLayers); + MultiLayer* multilayerPlot(Table* w, const QStringList& colList, int style, int startRow = 0, int endRow = -1); + //! used when restoring a plot from a project file + MultiLayer* multilayerPlot(const QString& caption, int layers = 1, int rows = 1, int cols = 1); + MultiLayer* waterfallPlot(); + MultiLayer* waterfallPlot(Table *t, const QStringList& list); + void connectMultilayerPlot(MultiLayer *g); + void addLayer(); + void addInsetLayer(bool curves = false); + void addInsetCurveLayer(); + void deleteLayer(); + void extractGraphs(); + void extractLayers(); + + //! Creates a new spectrogram graph + MultiLayer* plotSpectrogram(Matrix *m, Graph::CurveType type); + MultiLayer* plotGrayScale(Matrix *m = 0); + MultiLayer* plotContour(Matrix *m = 0); + MultiLayer* plotColorMap(Matrix *m = 0); + MultiLayer* plotImage(Matrix *m = 0); + MultiLayer* plotImageProfiles(Matrix *m = 0); + + //! Rearrange the layersin order to fit to the size of the plot window + void autoArrangeLayers(); + void initMultilayerPlot(MultiLayer* g, const QString& name); + void plot2VerticalLayers(); + void plot2HorizontalLayers(); + void plot4Layers(); + void plotStackedLayers(); + void plotStackedHistograms(); + + void plotStackSharedAxisLayers(); + void plotVerticalSharedAxisLayers(); + void plotHorizontalSharedAxisLayers(); + void plotSharedAxesLayers(); + void plotCustomLayout(bool sharedAxes = false); + void plotCustomLayoutSharedAxes(){plotCustomLayout(true);}; + //@} + + //! \name 3D Data Plots + //@{ + Graph3D* newPlot3D(const QString& title = QString()); + Graph3D* plotXYZ(Table* table,const QString& zColName, int type); + Graph3D* addRibbon(const QString& caption, const QString& formula, + double xl, double xr, double yl, double yr, double zl, double zr); + //@} + + //! \name Surface Plots + //@{ + Graph3D* plotSurface(const QString& formula, double xl, double xr, + double yl, double yr, double zl, double zr, int columns = 40, int rows = 30); + Graph3D* plotParametricSurface(const QString& xFormula, const QString& yFormula, + const QString& zFormula, double ul, double ur, double vl, double vr, + int columns, int rows, bool uPeriodic, bool vPeriodic); + + void connectSurfacePlot(Graph3D *plot); + void newSurfacePlot(); + void editSurfacePlot(); + void remove3DMatrixPlots(Matrix *m); + void updateMatrixPlots(Matrix *); + void add3DData(); + void change3DData(); + void change3DData(const QString& colName); + void change3DMatrix(); + void change3DMatrix(const QString& matrix_name); + void insertNew3DData(const QString& colName); + void add3DMatrixPlot(); + void insert3DMatrixPlot(const QString& matrix_name); + + void plot3DWireframe(); + void plot3DHiddenLine(); + void plot3DPolygons(); + void plot3DWireSurface(); + + Graph3D* plot3DMatrix(Matrix *m = 0, int style = 5); + + void plot3DRibbon(); + void plot3DScatter(); + void plot3DTrajectory(); + void plot3DBars(); + //@} + + //! \name User-defined Functions + //@{ + MultiLayer * newFunctionPlot(QStringList &formulas, double start, double end, int points = 100, const QString& var = "x", int type = 0); + + FunctionDialog* functionDialog(); + FunctionDialog* showFunctionDialog(Graph * g, int curve); + void addFunctionCurve(); + void clearLogInfo(); + void updateFunctionLists(int type, QStringList &formulas); + void updateSurfaceFuncList(const QString& s); + //@} + + //! \name Matrices + //@{ + //! Creates a new empty matrix + Matrix* newMatrix(int rows = 32, int columns = 32); + //! To be used when opening a project file only! + Matrix* newMatrix(const QString& caption, int r, int c); + Matrix* matrix(const QString& name); + Matrix* convertTableToMatrix(); + Matrix* tableToMatrix(Table* t); + Matrix* convertTableToMatrixRegularXYZ(); + void showBinMatrixDialog(); + void initMatrix(Matrix* m, const QString& caption); + void transposeMatrix(); + void invertMatrix(); + void matrixDeterminant(); + void flipMatrixVertically(); + void flipMatrixHorizontally(); + void rotateMatrix90(); + void rotateMatrixMinus90(); + void viewMatrixImage(); + void viewMatrixTable(); + void exportMatrix(const QString& exportFilter = QString::null); + void setMatrixDefaultScale(); + void setMatrixGrayScale(); + void setMatrixRainbowScale(); + void viewMatrixColumnRow(); + void viewMatrixXY(); + void matrixDirectFFT(); + void matrixInverseFFT(); + //@} + + //! \name Tables + //@{ + //! Creates an empty table + Table* newTable(); + + // getCurrent... functions for python interface + Table* currentTable(); + MultiLayer* currentPlot(); + Note* currentNote(); + Matrix* currentMatrix(); + + //! Used when loading a table from a project file + Table* newTable(const QString& caption,int r, int c); + Table* newTable(int r, int c, const QString& name = QString(),const QString& legend = QString()); + /** + * \brief Create a Table which is initially hidden; used to return the result of an analysis operation. + * + * \param name window name (compare MdiSubWindow::MdiSubWindow) + * \param label window label (compare MdiSubWindow::MdiSubWindow) + * \param r number of rows + * \param c number of columns + * \param text tab/newline - seperated initial content; may be empty + */ + Table* newHiddenTable(const QString& name, const QString& label, int r, int c, const QString& text=QString()); + Table* table(const QString& name); + Table* convertMatrixToTableDirect(); + Table* convertMatrixToTableXYZ(); + Table* convertMatrixToTableYXZ(); + Table* matrixToTable(Matrix* m, MatrixToTableConversion conversionType = Direct); + QList tableList(); + //! Returns true if the project contains tables + bool hasTable(); + //! Returns a list containing the names of all tables in the project + QStringList tableNames(); + + void connectTable(Table* w); + void initTable(Table* w, const QString& caption); + void customTable(Table* w); + Table* importOdfSpreadsheet(const QString& = QString::null, int sheet = -1); + Table* importExcel(const QString& = QString::null, int sheet = -1); + Table* importWaveFile(); + void importASCII(); + void importASCII(const QStringList& files, int import_mode, const QString& local_column_separator, int local_ignored_lines, bool local_rename_columns, + bool local_strip_spaces, bool local_simplify_spaces, bool local_import_comments, + QLocale local_separators, const QString& local_comment_string, bool import_read_only, int endLineChar, const QList& colTypes = QList()); + void exportAllTables(const QString& dir, const QString& filter, const QString& sep, bool colNames, bool colComments, bool expSelection); + + //! recalculate selected cells of current table + void recalculateTable(); + + TableStatistics *newTableStatistics(Table *base, int type, QList, + const QString &caption=QString::null); + //@} + + //! \name Graphs + //@{ + void setPreferences(Graph* g); + void setGraphDefaultSettings(bool autoscale,bool scaleFonts,bool resizeLayers,bool antialiasing); + void setArrowDefaultSettings(double lineWidth, const QColor& c, Qt::PenStyle style, + int headLength, int headAngle, bool fillHead); + + void plotL(); + void plotP(); + void plotLP(); + void plotPie(); + void plotVerticalBars(); + void plotHorizontalBars(); + void plotStackBar(); + void plotStackColumn(); + void plotArea(); + void plotVertSteps(); + void plotHorSteps(); + void plotSpline(); + void plotVerticalDropLines(); + MultiLayer* plotHistogram(); + MultiLayer* plotHistogram(Matrix *m); + void plotVectXYXY(); + void plotVectXYAM(); + void plotBoxDiagram(); + void plotDoubleYAxis(); + void zoomRectanglePlot(); + QString stemPlot(Table *t = 0, const QString& colName = QString(), int power = 0, int startRow = 0, int endRow = -1); + Note *newStemPlot(); + + //! Check whether a table is valid for a 3D plot and display an appropriate error if not + bool validFor3DPlot(Table *table); + //! Check whether a table is valid for a 2D plot and display an appropriate error if not + bool validFor2DPlot(Table *table, Graph::CurveType type); + //! Generate a new 2D graph + MultiLayer* generate2DGraph(Graph::CurveType type); + //@} + + //! \name Image Analysis + //@{ + void intensityTable(); + void pixelLineProfile(); + void loadImage(); + void loadImage(const QString& fn); + Matrix* importImage(const QString& = QString(), bool newWindow = false); + //@} + + //! \name Export and Print + //@{ + void exportLayer(); + void exportGraph(const QString& exportFilter = QString::null); + void exportAllGraphs(); + void exportPresentationODF(); + void exportPDF(); + void print(); + void printPreview(); + void setPrintPreviewOptions(QPrinter *); + void printAllPlots(); + //@} + + QStringList columnsList(Table::PlotDesignation plotType = Table::All); + + void undo(); + void redo(); + + //! \name MDI Windows + //@{ + MdiSubWindow* clone(MdiSubWindow* w = 0); + void rename(); + void renameWindow(); + + //! Called when the user presses F2 and an item is selected in lv. + void renameWindow(Q3ListViewItem *item, int, const QString &s); + + //! Checks weather the new window name is valid and modifies the name. + bool setWindowName(MdiSubWindow *w, const QString &text); + + void maximizeWindow(Q3ListViewItem * lbi = 0); + void maximizeWindow(MdiSubWindow *w); + void minimizeWindow(MdiSubWindow *w = 0); + + void updateWindowStatus(MdiSubWindow* ); + + bool hidden(QWidget* window); + void closeActiveWindow(); + void closeWindow(MdiSubWindow* window); + + //! Does all the cleaning work before actually deleting a window! + void removeWindowFromLists(MdiSubWindow* w); + + void hideWindow(MdiSubWindow* window); + void hideWindow(); + void hideActiveWindow(); + void activateWindow(); + void activateWindow(MdiSubWindow *); + //@} + + //! Show about dialog + static QMessageBox* about(bool dialog = true); + //! Return a version string ("QtiPlot x.y.z") + static QString versionString(); + void removeCurves(const QString& name); + QStringList dependingPlots(const QString& caption); + QStringList depending3DPlots(Matrix *m); + QStringList multilayerDependencies(QWidget *w); + + void saveAsTemplate(MdiSubWindow* w = 0, const QString& = QString()); + void openTemplate(); + MdiSubWindow* openTemplate(const QString& fn); + + QString windowGeometryInfo(MdiSubWindow *w); + static void restoreWindowGeometry(ApplicationWindow *app, MdiSubWindow *w, const QString s); + void restoreApplicationGeometry(); + void resizeActiveWindow(); + void resizeWindow(); + + //! \name List View in Project Explorer + //@{ + void setListView(const QString& caption,const QString& view); + void renameListViewItem(const QString& oldName,const QString& newName); + void setListViewDate(const QString& caption,const QString& date); + QString listViewDate(const QString& caption); + void setListViewSize(const QString& caption,const QString& size); + void setListViewLabel(const QString& caption,const QString& label); + //@} + + void updateColNames(const QString& oldName, const QString& newName); + void updateTableNames(const QString& oldName, const QString& newName); + void changeMatrixName(const QString& oldName, const QString& newName); + void updateCurves(Table *t, const QString& name); + + void showTable(const QString& curve); + void showTable(int i); + + void addColToTable(); + void cutSelection(); + void copySelection(); + void copyMarker(); + void pasteSelection(); + void clearSelection(); + void copyActiveLayer(); + + void newProject(); + + //! \name Reading from a Project File + //@{ + Matrix* openMatrix(ApplicationWindow* app, const QStringList &flist); + Table* openTable(ApplicationWindow* app, const QStringList &flist); + TableStatistics* openTableStatistics(const QStringList &flist); + Graph* openGraph(ApplicationWindow* app, MultiLayer *plot, const QStringList &list); + + void openRecentProject(int index); + //@} + + //! \name Table Tools + //@{ + void sortSelection(); + void sortActiveTable(); + void normalizeSelection(); + void normalizeActiveTable(); + void correlate(); + void autoCorrelate(); + void convolute(); + void deconvolute(); + void clearTable(); + void goToRow(); + void goToColumn(); + void moveTableRowUp(); + void moveTableRowDown(); + void adjustColumnWidth(); + //@} + + //! \name Plot Tools + //@{ + void newLegend(); + void addTimeStamp(); + void drawLine(); + void drawArrow(); + void drawPoints(); + void addText(); + void addTexFormula(); + void addRectangle(); + void addEllipse(); + void addImage(); + void zoomIn(); + void zoomOut(); + void magnify(int mode = 0); + void setAutoScale(); + void showRangeSelectors(); + void showCursor(); + void showScreenReader(); + void pickPointerCursor(); + void disableTools(); + void pickDataTool( QAction* action ); + + void updateLog(const QString& result); + //@} + + //! \name Fitting + //@{ + void deleteFitTables(); + void fitLinear(); + void fitSigmoidal(); + void fitGauss(); + void fitLorentz(); + void fitMultiPeak(int profile); + void fitMultiPeakGauss(); + void fitMultiPeakLorentz(); + void fitSlope(); + //@} + + //! \name Calculus + //@{ + void integrate(); + void differentiate(); + void analysis(Analysis operation); + void analyzeCurve(Graph *g, Analysis operation, const QString& curveTitle); + void showDataSetDialog(Analysis operation); + //@} + + void addErrorBars(); + void defineErrorBars(const QString& name, int type, double percent, int direction); + void defineErrorBars(const QString& curveName, const QString& errColumnName, int direction); + void movePoints(bool wholeCurve = false); + void removePoints(); + + //! \name Event Handlers + //@{ + void closeEvent( QCloseEvent*); + void timerEvent ( QTimerEvent *e); + void dragEnterEvent( QDragEnterEvent* e ); + void dropEvent( QDropEvent* e ); + void customEvent( QEvent* e); + //@} + + //! \name Dialogs + //@{ + void showFindDialogue(); + //! Show plot style dialog for the active MultiLayer / activeLayer / specified curve or the activeLayer options dialog if no curve is specified (curveKey = -1). + void showPlotDialog(int curveKey = -1); + QDialog* showScaleDialog(); + QDialog* showPlot3dDialog(); + AxesDialog* showScalePageFromAxisDialog(int axisPos); + AxesDialog* showAxisPageFromAxisDialog(int axisPos); + void showAxisDialog(); + void showGridDialog(); + void showGeneralPlotDialog(); + void showResults(bool ok); + void showResults(const QString& s, bool ok=true); + void showEnrichementDialog(); + void showLineDialog(); + void showTitleDialog(); + void showExportASCIIDialog(); + void showCurvesDialog(); + void showCurveRangeDialog(); + CurveRangeDialog* showCurveRangeDialog(Graph *g, int curve); + AssociationsDialog* showPlotAssociations(int curve); + + void showAxisTitleDialog(); + void showColumnOptionsDialog(); + void showRowsDialog(); + void showDeleteRowsDialog(); + void showColsDialog(); + void showColMenu(int c); + void showColumnValuesDialog(); + void showExtractDataDialog(); + + void showGraphContextMenu(); + void showTableContextMenu(bool selection); + void showWindowContextMenu(); + void customWindowTitleBarMenu(MdiSubWindow *w, QMenu *menu); + void showCurveContextMenu(QwtPlotItem *); + void showCurvePlotDialog(); + void showCurveWorksheet(); + void showCurveWorksheet(Graph *g, int curveIndex); + void showWindowPopupMenu(Q3ListViewItem *it, const QPoint &p, int); + + //! Connected to the context menu signal from lv; it's called when there are several items selected in the list + void showListViewSelectionMenu(const QPoint &p); + + //! Connected to the context menu signal from lv; it's called when there are no items selected in the list + void showListViewPopupMenu(const QPoint &p); + + void showScriptWindow(bool parent = true); + void showMoreWindows(); + void showMarkerPopupMenu(); + void showHelp(); + static void showStandAloneHelp(); + void chooseHelpFolder(); + void showPlotWizard(); + void showFitPolynomDialog(); + void showFrequencyCountDialog(); + void showIntegrationDialog(); + void showInterpolationDialog(); + void showExpGrowthDialog(); + void showExpDecayDialog(); + void showExpDecayDialog(int type); + void showTwoExpDecayDialog(); + void showExpDecay3Dialog(); + void showRowStatistics(); + void showColStatistics(); + void showFitDialog(); + void showLayerDialog(); + void showPreferencesDialog(); + void showMatrixDialog(); + void showMatrixSizeDialog(); + void showMatrixValuesDialog(); + void showSmoothSavGolDialog(); + void showSmoothFFTDialog(); + void showSmoothAverageDialog(); + void showSmoothLowessDialog(); + void showSmoothDialog(int m); + void showFilterDialog(int filter); + void lowPassFilterDialog(); + void highPassFilterDialog(); + void bandPassFilterDialog(); + void bandBlockFilterDialog(); + void showFFTDialog(); + void showColorMapDialog(); + //@} + + void subtractReferenceData(); + void subtractStraightLine(); + void translateCurveHor(); + void translateCurve(TranslateCurveTool::Direction direction = TranslateCurveTool::Vertical); + + //! Removes the curve identified by a key stored in the data() of actionRemoveCurve. + void removeCurve(); + void hideCurve(); + void hideOtherCurves(); + void showAllCurves(); + void setCurveFullRange(); + + void setAscValues(); + void setRandomValues(); + void setXCol(); + void setYCol(); + void setZCol(); + void setXErrCol(); + void setYErrCol(); + void setLabelCol(); + void disregardCol(); + void setReadOnlyCol(); + void setReadOnlyColumns(); + void setReadWriteColumns(); + void swapColumns(); + void moveColumnRight(); + void moveColumnLeft(); + void moveColumnFirst(); + void moveColumnLast(); + + void updateConfirmOptions(bool askTables, bool askMatrixes, bool askPlots2D, bool askPlots3D, bool askNotes); + + //! \name Plot3D Tools + //@{ + void toggle3DAnimation(bool on = true); + //! Turns perspective mode on or off + void togglePerspective(bool on = true); + //! Resets rotation of 3D plots to default values + void resetRotation(); + //! Finds best layout for the 3D plot + void fitFrameToLayer(); + void setFramed3DPlot(); + void setBoxed3DPlot(); + void removeAxes3DPlot(); + void removeGrid3DPlot(); + void setHiddenLineGrid3DPlot(); + void setLineGrid3DPlot(); + void setPoints3DPlot(); + void setCrosses3DPlot(); + void setCones3DPlot(); + void setBars3DPlot(); + void setFilledMesh3DPlot(); + void setEmptyFloor3DPlot(); + void setFloorData3DPlot(); + void setFloorIso3DPlot(); + void setFloorGrid3DPlot(bool on); + void setCeilGrid3DPlot(bool on); + void setRightGrid3DPlot(bool on); + void setLeftGrid3DPlot(bool on); + void setFrontGrid3DPlot(bool on); + void setBackGrid3DPlot(bool on); + void pickPlotStyle( QAction* action ); + void pickCoordSystem( QAction* action); + void pickFloorStyle( QAction* action); + void custom3DActions(QMdiSubWindow *w); + void custom3DGrids(int grids); + //@} + + void updateRecentProjectsList(const QString& fn = QString::null); + + //! connected to the done(bool) signal of the http object + void receivedVersionFile(bool error); + //! called when the user presses the actionCheckUpdates + void searchForUpdates(); +#ifdef QTIPLOT_SUPPORT + void showDonationDialog(); +#endif + //! Open support page in external browser + void showSupportPage(); + //! Open donation page in external browser + void showDonationsPage(); + //! Open QtiPlot homepage in external browser + void showHomePage(); + //! Open forums page at berliOS in external browser + void showForums(); + //! Open bug tracking system at berliOS in external browser + void showBugTracker(); + //! Show download page in external browser + void downloadManual(); + //! Show translations page in external browser + void downloadTranslation(); +#ifdef QTIPLOT_DEMO + //! Shown when the user tries to save the project. + void showDemoVersionMessage(); +#endif + + void parseCommandLineArguments(const QStringList& args); + void createLanguagesList(); + void switchToLanguage(int param); + void switchToLanguage(const QString& locale); + + bool alreadyUsedName(const QString& label); + bool projectHas2DPlots(); + + //! Returns a pointer to the window named "name" + MdiSubWindow* window(const QString& name); + + //! Returns a list with the names of all the matrices in the project + QStringList matrixNames(); + + //! \name Notes + //@{ + //! Creates a new empty note window + Note* newNote(const QString& caption = QString()); + Note* openNote(ApplicationWindow* app, const QStringList &flist); + void saveNoteAs(); + void showNoteLineNumbers(bool show = true); + void increaseNoteIndent(); + void decreaseNoteIndent(); + void noteFindDialogue(); + void noteFindNext(); + void noteFindPrev(); + void noteReplaceDialogue(); + void renameCurrentNoteTab(); + void addNoteTab(); + void closeNoteTab(); + void execute(); + void executeAll(); + void evaluate(); + void commentSelection(); + void uncommentSelection(); + //@} + + //! \name Folders + //@{ + //! Returns a pointer to the current folder in the project + Folder* currentFolder(){return current_folder;}; + //! Adds a new folder to the project + void addFolder(); + Folder* addFolder(QString name, Folder* parent = NULL); + //! Deletes the current folder + void deleteFolder(); + + //! Ask confirmation from user, deletes the folder f if user confirms and returns true, otherwise returns false; + bool deleteFolder(Folder *f); + + //! Deletes the currently selected items from the list view #lv. + void deleteSelectedItems(); + //! Hides the currently selected windows from the list view #lv. + void hideSelectedWindows(); + //! Show the currently selected windows from the list view #lv. + void showSelectedWindows(); + + //! Sets all items in the folders list view to be desactivated (QPixmap = folder_closed_xpm) + void desactivateFolders(); + + //! Changes the current folder. Returns true if successfull + bool changeFolder(Folder *newFolder, bool force = false); + + //! Changes the current folder when the user changes the current item in the QListView "folders" + void folderItemChanged(Q3ListViewItem *it); + //! Changes the current folder when the user double-clicks on a folder item in the QListView "lv" + void folderItemDoubleClicked(Q3ListViewItem *it); + + //! creates and opens the context menu of a folder list view item + /** + * \param it list view item + * \param p mouse global position + * \param fromFolders: true means that the user clicked right mouse buttom on an item from QListView "folders" + * false means that the user clicked right mouse buttom on an item from QListView "lv" + */ + void showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, bool fromFolders); + + //! connected to the SIGNAL contextMenuRequested from the list views + void showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, int); + + //! starts renaming the selected folder by creating a built-in text editor + void startRenameFolder(); + + //! starts renaming the selected folder by creating a built-in text editor + void startRenameFolder(Q3ListViewItem *item); + + //! checks weather the new folder name is valid and modifies the name + void renameFolder(Q3ListViewItem *it, int col, const QString &text); + + //! forces showing all windows in the current folder and subfolders, depending on the user's viewing policy + void showAllFolderWindows(); + + //! forces hidding all windows in the current folder and subfolders, depending on the user's viewing policy + void hideAllFolderWindows(); + + //! hides all windows in folder f + void hideFolderWindows(Folder *f); + + //! pops up folder information + void folderProperties(); + + //! pops up information about the selected window item + void windowProperties(); + + //! pops up information about the current project + void projectProperties(); + + //! Pops up a file dialog and invokes appendProject(const QString&) on the result. + void appendProject(); + //! Open the specified project file and add it as a subfolder to the parentFolder or to the current folder if no parent folder is specified. + Folder* appendProject(const QString& file_name, Folder* parentFolder = 0); + void saveAsProject(); + void saveFolderAsProject(Folder *f); + void saveFolder(Folder *folder, const QString& fn, bool compress = false); + + //! adds a folder list item to the list view "lv" + void addFolderListViewItem(Folder *f); + + //! adds a widget list item to the list view "lv" + void addListViewItem(MdiSubWindow *w); + + //! hides or shows windows in the current folder and changes the view windows policy + void setShowWindowsPolicy(int p); + + //! returns a pointer to the root project folder + Folder* projectFolder(); + + //! used by the findDialog + void find(const QString& s, bool windowNames, bool labels, bool folderNames, + bool caseSensitive, bool partialMatch, bool subfolders); + + //! initializes the list of items dragged by the user + void dragFolderItems(QList items){draggedItems = items;}; + + //! Drop the objects in the list draggedItems to the folder of the destination item + void dropFolderItems(Q3ListViewItem *dest); + + //! moves a folder item to another + /** + * \param src source folder item + * \param dest destination folder item + */ + void moveFolder(FolderListItem *src, FolderListItem *dest); + //! copies a folder to another + /** + * \param src source folder + * \param dest destination folder + */ + bool copyFolder(Folder *src, Folder *dest); + + void foldersMenuActivated( int id ); + //@} + + //! \name Scripting + //@{ + //! notify the user that an error occured in the scripting system + void scriptError(const QString &message, const QString &scriptName, int lineNumber); + //! execute all notes marked auto-exec + void executeNotes(); + //! show scripting language selection dialog + void showScriptingLangDialog(); + //! create a new environment for the current scripting language + void restartScriptingEnv(); + //! print to scripting console (if available) or to stdout + void scriptPrint(const QString &text); + //! switches to the given scripting language; if this is the same as the current one and force is true, restart it + bool setScriptingLanguage(const QString &lang, bool force=false); + + void scriptsDirPathChanged(const QString& path); + //@} + + void showToolBarsMenu(); + void setFormatBarFont(const QFont &); + +signals: + void modified(); + +private: + //! \name Initialization + //@{ + void init(bool factorySettings = false); + void initCompleter(); + void initGlobalConstants(); + void createActions(); + void initMainMenu(); + void initToolBars(); + void initPlot3DToolBar(); + void initPlot3D(Graph3D *plot); + void insertTranslatedStrings(); + void translateActionsStrings(); + //@} + virtual QMenu * createPopupMenu(){return NULL;}; + void updateCompleter(const QString& windowName, bool remove = false, const QString& newName = QString::null); + QMessageBox::StandardButton showSaveProjectMessage(); + void goToParentFolder(); + bool isProjectFile(const QString& fn); + +private slots: + void disableActions(); + void customColumnActions(); + void disableToolbars(); + void customToolBars(QMdiSubWindow* w); + void customMenu(QMdiSubWindow* w); + void windowActivated(QMdiSubWindow *w); + void custom2DPlotTools(MultiLayer *); + void updateExplorerWindowLayout(Qt::DockWidgetArea); + + void analysisMenuAboutToShow(); + void scriptingMenuAboutToShow(); + void fileMenuAboutToShow(); + void editMenuAboutToShow(); + void matrixMenuAboutToShow(); + void plotMenuAboutToShow(); + void plotDataMenuAboutToShow(); + void tableMenuAboutToShow(); + void windowsMenuAboutToShow(); + void windowsMenuActivated( int id ); + + //! \name Font Format Functions + //@{ + void enableTextEditor(Graph *g); + void setFontSize(int); + void setFontFamily(const QFont &); + void setItalicFont(bool); + void setBoldFont(bool); + void insertSuperscript(); + void insertSubscript(); + void underline(); + void insertGreekSymbol(); + void insertGreekMajSymbol(); + void insertMathSymbol(); + //@} + + void showCustomActionDialog(); + void performCustomAction(QAction *); + + void hideSelectedColumns(); + void showAllColumns(); + void closedLastCopiedLayer(){lastCopiedLayer = NULL;}; + + void increasePrecision(); + void decreasePrecision(); + +#ifdef SCRIPTING_PYTHON + void openQtDesignerUi(); +#endif + +// TODO: a lot of this stuff should be private +public: + bool d_keep_aspect_ration; + QPrinter::PaperSize d_print_paper_size; + QPrinter::Orientation d_printer_orientation; + bool d_muparser_c_locale; + Graph::LegendDisplayMode d_graph_legend_display; + Graph::AxisTitlePolicy d_graph_axis_labeling; + bool d_synchronize_graph_scales; + int d_latex_compiler; + QString d_latex_compiler_path; + //! Last selected filter in open project dialog + QString d_open_project_filter; + //! Default geometry unit to be displayed in the EnrichmentDialog. + int d_frame_geometry_unit; + //! Default geometry unit to be displayed in the PlotDialog. + int d_layer_geometry_unit; + int d_layer_canvas_width, d_layer_canvas_height; + int d_notes_tab_length; + QFont d_notes_font; + //! End of line convention used for copy/paste operations and when exporting tables/matrices to ASCII files. + EndLineChar d_eol; + //! Flag telling if the in-place editing of 2D plot labels is enabled + bool d_in_place_editing; + //! Flag telling if completion hints are enabled + bool d_completion; + //! Flag telling if line numbers are displayed in note windows + bool d_note_line_numbers; + QString d_python_config_folder; + QString d_translations_folder; + //! Flag telling if the application is opening a project file or not + bool d_opening_file; + //! Flag telling if the application is appending a project file or not + bool d_is_appending_file; + QString customActionsDirPath; + bool d_matrix_tool_bar, d_file_tool_bar, d_table_tool_bar, d_column_tool_bar, d_edit_tool_bar; + bool d_plot_tool_bar, d_plot3D_tool_bar, d_display_tool_bar, d_format_tool_bar, d_notes_tool_bar; + bool d_backup_files; + WindowType d_init_window_type; + QRect d_script_win_rect, d_app_rect; + bool d_script_win_on_top; + bool d_inform_rename_table; + QString d_export_col_separator; + bool d_export_col_names, d_export_table_selection, d_export_col_comment; + //! Last selected filter in export image dialog + QString d_image_export_filter, d_export_ASCII_file_filter; + double d_scale_fonts_factor; + bool d_export_transparency; + int d_export_quality; + int d_export_vector_resolution, d_export_bitmap_resolution, d_export_size_unit; + QSizeF d_export_raster_size; + bool d_export_color; + bool d_export_escape_tex_strings; + bool d_export_tex_font_sizes; + int d_3D_export_text_mode, d_3D_export_sort; + //! Locale used to specify the decimal separators in imported ASCII files + QLocale d_clipboard_locale; + //! Locale used to specify the decimal separators in imported ASCII files + QLocale d_ASCII_import_locale; + //! End of line convention used to import ASCII files. + EndLineChar d_ASCII_end_line; + //! Last selected filter in import ASCII dialog + QString d_ASCII_file_filter, d_ASCII_comment_string; + bool d_ASCII_import_comments, d_ASCII_import_read_only, d_ASCII_import_preview; + int d_ASCII_import_mode, d_preview_lines; + int d_ASCII_import_first_row_role; + QSize d_import_ASCII_dialog_size; + //! Specifies if only the Tables/Matrices in the current folder should be displayed in the Add/remove curve dialog. + bool d_show_current_folder; + bool d_scale_plots_on_print, d_print_cropmarks; + bool d_show_table_comments; + bool d_extended_plot_dialog; + bool d_extended_import_ASCII_dialog; + bool d_extended_export_dialog; + bool d_extended_open_dialog; + bool generateUniformFitPoints; + bool generatePeakCurves; + QColor peakCurvesColor; + bool d_multi_peak_messages; + //! User defined size for the Add/Remove curves dialog + QSize d_add_curves_dialog_size; + + //! Scale the errors output in fit operations with reduced chi^2 + bool fit_scale_errors; + + //! Number of points in a generated fit curve + int fitPoints; + + //! Calculate only 2 points in a generated linear fit function curve + bool d_2_linear_fit_points; + + bool pasteFitResultsToPlot; + + //! Write fit output information to Result Log + bool writeFitResultsToLog; + + //! precision used for the output of the fit operations + int fit_output_precision; + + //! default precision to be used for all other operations than fitting + int d_decimal_digits; + + //! pointer to the current folder in the project + Folder *current_folder; + //! Describes which windows are shown when the folder becomes the current folder + ShowWindowsPolicy show_windows_policy; + enum {MaxRecentProjects = 10}; + //! File version code used when opening project files (= maj * 100 + min * 10 + patch) + int d_file_version; + + QColor d_rect_default_background; + QBrush d_rect_default_brush; + QColor workspaceColor, panelsColor, panelsTextColor; + QColor d_graph_background_color, d_graph_canvas_color, d_graph_border_color, d_canvas_frame_color; + int d_graph_background_opacity, d_graph_canvas_opacity, d_graph_border_width; + QString appStyle, workingDir; + + //! Path to the folder where the last template file was opened/saved + QString templatesDir; + bool autoScaleFonts, autoResizeLayers, autoSearchUpdates; + bool confirmCloseTable, confirmCloseMatrix, confirmClosePlot2D, confirmClosePlot3D; + bool confirmCloseFolder, confirmCloseNotes, d_confirm_overwrite; + bool titleOn, autoSave, autoscale2DPlots, antialiasing2DPlots; + //! \name User preferences for axes in new 2D plot layers + //@{ + //! Axes to be shown + QVector d_show_axes; + //! Axes with labels enabled + QVector d_show_axes_labels; + //! Draw axes backbones + bool drawBackbones; + //! Default distance between the ticks and the tick labels + int d_graph_tick_labels_dist; + //! Distance between the axes title and the backbone + int d_graph_axes_labels_dist; + //! Default axes linewidth + int axesLineWidth; + //@} + int majTicksStyle, minTicksStyle, legendFrameStyle, autoSaveTime, canvasFrameWidth; + QColor legendBackground, legendTextColor, defaultArrowColor; + int defaultArrowHeadLength, defaultArrowHeadAngle, d_legend_default_angle, d_symbol_style; + double defaultArrowLineWidth, defaultCurveLineWidth, defaultSymbolEdge; + bool defaultArrowHeadFill, d_fill_symbols, d_indexed_symbols; + int defaultCurveBrush, defaultCurveAlpha, d_curve_line_style; + Qt::PenStyle defaultArrowLineStyle; + QPen d_frame_widget_pen; + int majTicksLength, minTicksLength, defaultPlotMargin; + int defaultCurveStyle, defaultSymbolSize; + QFont appFont; + QFont tableTextFont, tableHeaderFont, plotAxesFont, plotLegendFont, plotNumbersFont, plotTitleFont; + QColor tableBkgdColor, tableTextColor, tableHeaderColor; + QString projectname,columnSeparator, helpFilePath, appLanguage; + QString configFilePath, fitPluginsPath, fitModelsPath, asciiDirPath, imagesDirPath, scriptsDirPath; + int ignoredLines, savingTimerId, recentMenuID; + bool renameColumns, strip_spaces, simplify_spaces; + QStringList recentProjects; + bool saved; + QStringList locales; + QStringList d_recent_functions; //user-defined functions; + QStringList xFunctions, yFunctions, rFunctions, thetaFunctions; // user functions for parametric and polar plots + QStringList surfaceFunc; //user-defined surface functions; + QStringList d_param_surface_func; //user-defined parametric surface functions; + //! List of tables and matrices renamed in order to avoid conflicts when appending a project to a folder + QStringList renamedTables; + + //! \name variables used when user copy/paste markers + //@{ + FrameWidget *d_enrichement_copy; + ArrowMarker *d_arrow_copy; + //@} + + //! Equals true if an automatical search for updates was performed on start-up otherwise is set to false; + bool autoSearchUpdatesRequest; + + //! The scripting language to use for new projects. + QString defaultScriptingLang; + + //! User custom colors used for Python syntax highlighting + QColor d_comment_highlight_color, d_class_highlight_color, d_numeric_highlight_color; + QColor d_keyword_highlight_color, d_function_highlight_color, d_quotation_highlight_color; + + //! \name user custom values for 3D plots look + //@{ + bool d_3D_smooth_mesh, d_3D_legend, d_3D_orthogonal, d_3D_autoscale; + int d_3D_resolution, d_3D_projection; + QFont d_3D_title_font, d_3D_numbers_font, d_3D_axes_font; + QwtLinearColorMap d_3D_color_map; + QColor d_3D_mesh_color; + QColor d_3D_axes_color; + QColor d_3D_numbers_color; + QColor d_3D_labels_color; + QColor d_3D_background_color; + QColor d_3D_grid_color, d_3D_minor_grid_color; + bool d_3D_minor_grids, d_3D_major_grids; + int d_3D_major_style, d_3D_minor_style; + double d_3D_major_width, d_3D_minor_width; + + void setPlot3DOptions(); + //@} + +private: + bool d_mdi_windows_area; + MdiSubWindow *d_active_window; + TextEditor *d_text_editor; + // Flag telling if table values should be automatically recalculated when values in a column are modified. + bool d_auto_update_table_values; + int d_matrix_undo_stack_size; + + //! Workaround for the new colors introduced in rev 447 + int convertOldToNewColorIndex(int cindex); + + //! Stores the pointers to the dragged items from the FolderListViews objects + QList draggedItems; + + //! Used when checking for new versions + QHttp *http; + //! Used when checking for new versions + QBuffer version_buffer; + + Graph *lastCopiedLayer; + QSplitter *explorerSplitter; + + QAssistantClient *assistant; + ScriptWindow *scriptWindow; + QTranslator *appTranslator, *qtTranslator; + QDockWidget *explorerWindow, *undoStackWindow; + QTextEdit *results; +#ifdef SCRIPTING_CONSOLE + QDockWidget *consoleWindow; + QTextEdit *console; +#endif + QMdiArea *d_workspace; + + QToolBar *fileTools, *plotTools, *tableTools, *columnTools, *plot3DTools, *displayBar, *editTools, *plotMatrixBar; + QToolBar *formatToolBar, *noteTools; + QToolButton *btnResults; + QWidgetList *hiddenWindows; + QLineEdit *info; + //! Completer used in notes and in the script window + QCompleter *d_completer; + + QMenu *windowsMenu, *foldersMenu, *view, *graphMenu, *fileMenu, *format, *edit, *recent; + QMenu *help, *plot2DMenu, *analysisMenu, *multiPeakMenu; + QMenu *matrixMenu, *plot3DMenu, *plotDataMenu, *tablesDepend, *scriptingMenu; + QMenu *tableMenu, *fillMenu, *normMenu, *newMenu, *exportPlotMenu, *smoothMenu, *filterMenu, *decayMenu, *importMenu; + + QAction *actionEditCurveRange, *actionCurveFullRange, *actionShowAllCurves, *actionHideCurve, *actionHideOtherCurves; + QAction *actionRemoveCurve, *actionShowCurveWorksheet, *actionShowCurvePlotDialog; + QAction *actionNewProject, *actionAppendProject, *actionNewNote, *actionNewTable, *actionNewFunctionPlot; + QAction *actionNewSurfacePlot, *actionNewMatrix, *actionNewGraph, *actionNewFolder; + QAction *actionOpen, *actionLoadImage, *actionSaveProject, *actionSaveProjectAs, *actionImportImage; + QAction *actionLoad, *actionUndo, *actionRedo, *actionImportSound; +#ifdef ODS_IMPORT + QAction *actionOpenOds; +#endif +#ifdef XLS_IMPORT + QAction *actionOpenExcel; +#endif + QAction *actionCopyWindow, *actionShowAllColumns, *actionHideSelectedColumns; + QAction *actionCutSelection, *actionCopySelection, *actionPasteSelection, *actionClearSelection; + QAction *actionShowExplorer, *actionShowLog, *actionAddLayer, *actionShowLayerDialog, *actionAutomaticLayout; +#ifdef SCRIPTING_CONSOLE + QAction *actionShowConsole; +#endif +#ifdef SCRIPTING_PYTHON + QAction *actionOpenQtDesignerUi, *actionCommentSelection, *actionUncommentSelection; +#endif + QAction *actionSwapColumns, *actionMoveColRight, *actionMoveColLeft, *actionMoveColFirst, *actionMoveColLast, *actionShowScriptWindow; + QAction *actionExportGraph, *actionExportAllGraphs, *actionPrint, *actionPrintAllPlots, *actionShowExportASCIIDialog; + QAction *actionExportPDF, *actionReadOnlyCol, *actionStemPlot; + QAction *actionCloseAllWindows, *actionCloseProject, *actionClearLogInfo, *actionShowPlotWizard, *actionShowConfigureDialog; + QAction *actionShowCurvesDialog, *actionAddErrorBars, *actionAddFunctionCurve, *actionUnzoom, *actionNewLegend, *actionAddImage, *actionAddText; + QAction *actionPlotL, *actionPlotP, *actionPlotLP, *actionPlotVerticalDropLines, *actionPlotSpline; + QAction *actionPlotVertSteps, *actionPlotHorSteps, *actionPlotVerticalBars, *actionStackBars, *actionStackColumns; + QAction *actionPlotHorizontalBars, *actionPlotArea, *actionPlotPie, *actionPlotVectXYAM, *actionPlotVectXYXY; + QAction *actionPlotHistogram, *actionPlotStackedHistograms, *actionPlot2VerticalLayers, *actionPlot2HorizontalLayers, *actionPlot4Layers, *actionPlotStackedLayers; + QAction *actionPlot3DRibbon, *actionPlot3DBars, *actionPlot3DScatter, *actionPlot3DTrajectory; + QAction *actionPlotDoubleYAxis, *actionAddInsetLayer, *actionAddInsetCurveLayer; + QAction *actionShowColStatistics, *actionShowRowStatistics, *actionShowIntDialog, *actionIntegrate; + QAction *actionDifferentiate, *actionFitLinear, *actionFitSlope, *actionShowFitPolynomDialog; + QAction *actionShowExpDecayDialog, *actionShowTwoExpDecayDialog, *actionShowExpDecay3Dialog; + QAction *actionFitExpGrowth, *actionFitSigmoidal, *actionFitGauss, *actionFitLorentz, *actionShowFitDialog; + QAction *actionShowAxisDialog, *actionShowTitleDialog; + QAction *actionShowColumnOptionsDialog, *actionShowColumnValuesDialog, *actionShowColsDialog, *actionShowRowsDialog; + QAction *actionTableRecalculate, *actionExtractGraphs, *actionExtractLayers; + QAction *actionAbout, *actionShowHelp, *actionChooseHelpFolder; + QAction *actionRename, *actionCloseWindow; + QAction *actionConvertTableDirect, *actionConvertTableBinning, *actionConvertTableRegularXYZ; + QAction *actionAddColToTable, *actionDeleteLayer, *actionInterpolate; + QAction *actionResizeActiveWindow, *actionHideActiveWindow; + QAction *actionShowMoreWindows, *actionPixelLineProfile, *actionIntensityTable; + QAction *actionShowLineDialog, *actionShowTextDialog; + QAction *actionActivateWindow, *actionMinimizeWindow, *actionMaximizeWindow, *actionHideWindow, *actionResizeWindow; + QAction *actionEditSurfacePlot, *actionAdd3DData; + QAction *actionMatrixDeterminant, *actionSetMatrixProperties, *actionConvertMatrixXYZ, *actionConvertMatrixYXZ; + QAction *actionSetMatrixDimensions, *actionConvertMatrixDirect, *actionSetMatrixValues, *actionTransposeMatrix, *actionInvertMatrix; + QAction *actionPlot3DWireFrame, *actionPlot3DHiddenLine, *actionPlot3DPolygons, *actionPlot3DWireSurface; + QAction *actionColorMap, *actionContourMap, *actionGrayMap; + QAction *actionDeleteFitTables, *actionShowGridDialog, *actionTimeStamp; + QAction *actionSmoothSavGol, *actionSmoothFFT, *actionSmoothAverage, *actionSmoothLowess, *actionFFT; + QAction *actionLowPassFilter, *actionHighPassFilter, *actionBandPassFilter, *actionBandBlockFilter; + QAction *actionSortTable, *actionSortSelection, *actionNormalizeSelection; + QAction *actionNormalizeTable, *actionConvolute, *actionDeconvolute, *actionCorrelate, *actionAutoCorrelate; + QAction *actionTranslateHor, *actionTranslateVert, *actionSetAscValues, *actionSetRandomValues; + QAction *actionSetXCol, *actionSetYCol, *actionSetZCol, *actionSetLabelCol, *actionDisregardCol, *actionSetXErrCol, *actionSetYErrCol; + QAction *actionBoxPlot, *actionMultiPeakGauss, *actionMultiPeakLorentz, *actionCheckUpdates; + QAction *actionDonate, *actionHomePage, *actionDownloadManual, *actionTechnicalSupport, *actionTranslations; + QAction *actionHelpForums, *actionHelpBugReports; + QAction *actionShowPlotDialog, *actionShowScaleDialog, *actionOpenTemplate, *actionSaveTemplate; + QAction *actionNextWindow, *actionPrevWindow; + QAction *actionScriptingLang, *actionRestartScripting, *actionClearTable, *actionGoToRow, *actionGoToColumn; + QAction *actionNoteExecute, *actionNoteExecuteAll, *actionNoteEvaluate, *actionSaveNote, *actionFrequencyCount; + QAction *actionAnimate, *actionPerspective, *actionFitFrame, *actionResetRotation; + QAction *actionDeleteRows, *actionDrawPoints, *actionAddZoomPlot; + QAction *btnCursor, *btnSelect, *btnPicker, *btnRemovePoints, *btnMovePoints, *actionDragCurve; + QAction *btnZoomIn, *btnZoomOut, *btnPointer, *btnLine, *btnArrow; + QAction *actionFlipMatrixVertically, *actionFlipMatrixHorizontally, *actionRotateMatrix; + QAction *actionViewMatrixImage, *actionViewMatrix, *actionExportMatrix, *actionMatrixDefaultScale; + QAction *actionMatrixGrayScale, *actionMatrixRainbowScale, *actionMatrixCustomScale, *actionRotateMatrixMinus; + QAction *actionMatrixXY, *actionMatrixColumnRow, *actionImagePlot, *actionToolBars, *actionImageProfilesPlot; + QAction *actionMatrixFFTDirect, *actionMatrixFFTInverse; + QAction *actionFontBold, *actionFontItalic, *actionFontBox, *actionFontSize; + QAction *actionSuperscript, *actionSubscript, *actionUnderline, *actionGreekSymbol, *actionCustomActionDialog; + QAction *actionGreekMajSymbol, *actionMathSymbol; + QAction *Box, *Frame, *None; + QAction *front, *back, *right, *left, *ceil, *floor, *floordata, *flooriso, *floornone; + QAction *wireframe, *hiddenline, *polygon, *filledmesh, *pointstyle, *barstyle, *conestyle, *crossHairStyle; + QAction *actionShowUndoStack, *actionShowNoteLineNumbers, *actionAddFormula, *actionAddRectangle, *actionAddEllipse; + QActionGroup *coord, *floorstyle, *grids, *plotstyle, *dataTools; + QAction *actionMagnify, *actionFindWindow, *actionWaterfallPlot, *actionMagnifyHor, *actionMagnifyVert; + QAction *actionMoveRowUp, *actionMoveRowDown, *actionAdjustColumnWidth; + QAction *actionPresentationODF, *actionRenameNoteTab, *actionAddNoteTab, *actionCloseNoteTab; + QAction *actionIncreaseIndent, *actionDecreaseIndent, *actionFind, *actionFindNext, *actionFindPrev, *actionReplace; + QAction *actionIncreasePrecision, *actionDecreasePrecision, *actionPrintPreview; + QAction *actionVertSharedAxisLayers, *actionHorSharedAxisLayers, *actionSharedAxesLayers, *actionStackSharedAxisLayers; + QAction *actionCustomSharedAxisLayers, *actionCustomLayout, *actionExtractTableData, *actionSubtractLine, *actionSubtractReference; + + QList d_user_actions; + QUndoView *d_undo_view; + QList d_user_menus; + + QList d_indexed_colors; + QStringList d_indexed_color_names; + QList d_symbols_list; +}; +#endif === removed file 'qtiplot/src/core/ApplicationWindow.h' --- qtiplot/src/core/ApplicationWindow.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/ApplicationWindow.h 1970-01-01 00:00:00 +0000 @@ -1,1411 +0,0 @@ -/*************************************************************************** - File : ApplicationWindow.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, - Tilman Hoener zu Siederdissen, - Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net, - knut.franke*gmx.de - Description : QtiPlot's main window - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef APPLICATION_H -#define APPLICATION_H - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -class QPixmap; -class QCloseEvent; -class QDropEvent; -class QTimerEvent; -class QDragEnterEvent; -class QTranslator; -class QDockWidget; -class QAction; -class QActionGroup; -class QTranslator; -class QToolButton; -class QShortcut; -class QMenu; -class QToolBar; -class QAssistantClient; -class QLocale; -class QMdiArea; -class QUndoView; -class QCompleter; - -class Matrix; -class Table; -class ScalePicker; -class Graph3D; -class Note; -class MultiLayer; -class FunctionDialog; -class Folder; -class FolderListItem; -class FolderListView; -class ScriptWindow; -class Plot3DDialog; -class TableStatistics; -class CurveRangeDialog; -class LegendWidget; -class ArrowMarker; -class TextEditor; -class AssociationsDialog; - -/** - * \brief QtiPlot's main window. - * - * This class contains the main part of the user interface as well as the central project management facilities. - * - * It manages all MdiSubWindow MDI Windows in a project, knows about their organization in Folder objects - * and contains the parts of the project explorer not implemented in Folder, FolderListItem or FolderListView. - * - * Furthermore, it is responsible for displaying most MDI Windows' context menus and opening all sorts of dialogs. - * - * \section future Future Plans - * Split out the project management part into a new Project class. - * If MdiSubWindow maintains a reference to its parent Project, it should be possible to have its subclasses - * display their own context menus and dialogs. - * This is necessary for implementing new plot types or even completely new MdiSubWindow subclasses in plug-ins. - * It will also make ApplicationWindow more manageable by removing those parts not directly related to the main window. - * - * Project would also take care of basic project file reading/writing (using Qt's XML framework), but delegate most of - * the work to MdiSubWindow and its subclasses. This is necessary for providing save/restore of classes implemented in - * plug-ins. Support for foreign formats on the other hand could go into import/export classes (which could also be - * implemented in plug-ins). Those would interface directly with Project and the MyWidgets it manages. Thus, in addition - * to supporting QtXML-based save/restore, Project, MdiSubWindow and subclasses will also have to provide generalized - * save/restore methods/constructors. - * - * Maybe split out the project explorer into a new ProjectExplorer class, depending on how much code is left - * in ApplicationWindow after the above reorganizations. Think about whether a Model/View approach can be - * used for Project/ProjectExplorer. - */ -class ApplicationWindow: public QMainWindow, public scripted -{ - Q_OBJECT - -public: - ApplicationWindow(bool factorySettings = false); - ApplicationWindow(const QStringList& l); - ~ApplicationWindow(); - - enum ShowWindowsPolicy{HideAll, ActiveFolder, SubFolders}; - enum WindowType{NoWindow, TableWindow, MatrixWindow, MultiLayerWindow, NoteWindow, Plot3DWindow}; - enum MatrixToTableConversion{Direct, XYZ, YXZ}; - enum EndLineChar{LF, CRLF, CR}; - enum Analysis{NoAnalysis, Integrate, Diff, FitLinear, FitGauss, FitLorentz, FitSigmoidal, FitSlope}; - enum LaTeXCompiler{MathTran, Local}; - - FolderListView *lv, *folders; - QDockWidget *logWindow; - - /*! Generates a new unique name starting with string /param name. - You can force the output to be a name different from /param name, - even if 'name' is not used in the project, by setting /param increment = true (the default) - */ - QString generateUniqueName(const QString& name, bool increment = true); - void saveFitFunctions(const QStringList& lst); - - //! \name User custom actions - //@{ - void loadCustomActions(); - void reloadCustomActions(); - void removeCustomAction(QAction *); - void addCustomAction(QAction *, const QString& parentName, int index = -1); - QList customActionsList(){return d_user_actions;}; - QList customizableMenusList(); - - void reloadCustomMenus(); - QMenu* addCustomMenu(const QString& title, const QString& parentName); - void removeCustomMenu(const QString& title); - QList customMenusList(){return d_user_menus;}; - //@} - - QList menusList(); - QList toolBarsList(); - - MdiSubWindow *activeWindow(WindowType type = NoWindow); - void setActiveWindow(MdiSubWindow *w){d_active_window = w;}; - QMdiArea* workspace(){return d_workspace;}; - - int matrixUndoStackSize(){return d_matrix_undo_stack_size;}; - void setMatrixUndoStackSize(int size); - - QString endOfLine(); - static QString guessEndOfLine(const QString& sample); - bool autoUpdateTableValues(){return d_auto_update_table_values;}; - void setAutoUpdateTableValues(bool on = true); - - QCompleter* completer(){return d_completer;}; - void enableCompletion(bool on = true); - void addWindowsListToCompleter(); - - QLocale clipboardLocale(){return d_clipboard_locale;}; - void setClipboardLocale(const QLocale& locale){d_clipboard_locale = locale;}; - - QTextEdit *resultsLog(){return results;}; -#ifdef SCRIPTING_CONSOLE - QTextEdit *scriptingConsole(){return console;}; -#endif - - static QString imageFilter(); - static QString getFileName(QWidget *parent = 0, const QString & caption = QString(), - const QString & dir = QString(), const QString & filter = QString(), - QString * selectedFilter = 0, bool save = true); - - static void memoryAllocationError(); - QColor readColorFromProject(const QString& name); - - void enableMdiArea(bool on = true); - bool isMdiAreaEnabled(){return d_mdi_windows_area;}; - - void displayInfo(const QString& text){info->setText(text);}; - -public slots: - //! \name Projects and Project Files - //@{ - void open(); - ApplicationWindow* open(const QString& fn, bool factorySettings = false, bool newProject = true); - ApplicationWindow* openProject(const QString& fn, bool factorySettings = false, bool newProject = true); - ApplicationWindow* importOPJ(const QString& fn, bool factorySettings = false, bool newProject = true); - - /** - * \brief Create a new project from a data file. - * - * \param fn is read as a data file with the default column separator (as set by the user) - * and inserted as a table into a new, empty project. - * This table is then plotted with the Graph::LineSymbols style. - */ - ApplicationWindow * plotFile(const QString& fn); - - /** - * \brief Create a new project from a script file. - * - * \param fn is read as a Python script file and loaded in the command script window. - * \param execute specifies if the script should be executed after opening. - */ - ApplicationWindow * loadScript(const QString& fn, bool execute = false, bool noGui = false, bool factorySettings = false); - - QList windowsList(); - void updateWindowLists(MdiSubWindow *w); - /*! - Arranges all the visible project windows in a cascade pattern. - */ - void cascade(); - - void saveProjectAs(const QString& fileName = QString(), bool compress = false); - bool saveProject(bool compress = false); - - //! Set the project status to modifed - void modifiedProject(); - //! Set the project status to saved (not modified) - void savedProject(); - //! Set the project status to modified and save 'w' as the last modified widget - void modifiedProject(MdiSubWindow *w); - //@} - - //! \name Settings - //@{ - void readSettings(); - void saveSettings(); - void setSaveSettings(bool autoSaving, int min); - void changeAppStyle(const QString& s); - void changeAppFont(const QFont& f); - void updateAppFonts(); - void setAppColors(const QColor& wc,const QColor& pc,const QColor& tpc, bool force = false); - - void initWindow(); - //@} - - //! \name Multilayer Plots - //@{ - //! Creates a new empty multilayer plot - MultiLayer* newGraph(const QString& caption = tr("Graph")); - MultiLayer* multilayerPlot(int c, int r, int style); - MultiLayer* multilayerPlot(Table* w, const QStringList& colList, int style, int startRow = 0, int endRow = -1); - //! used when restoring a plot from a project file - MultiLayer* multilayerPlot(const QString& caption, int layers = 1, int rows = 1, int cols = 1); - //! used by the plot wizard - MultiLayer* multilayerPlot(const QStringList& colList); - MultiLayer* waterfallPlot(); - MultiLayer* waterfallPlot(Table *t, const QStringList& list); - void connectMultilayerPlot(MultiLayer *g); - void addLayer(); - void addInsetLayer(bool curves = false); - void addInsetCurveLayer(); - void deleteLayer(); - void extractGraphs(); - void extractLayers(); - - //! Creates a new spectrogram graph - MultiLayer* plotSpectrogram(Matrix *m, Graph::CurveType type); - MultiLayer* plotGrayScale(Matrix *m = 0); - MultiLayer* plotContour(Matrix *m = 0); - MultiLayer* plotColorMap(Matrix *m = 0); - MultiLayer* plotImage(Matrix *m = 0); - - //! Rearrange the layersin order to fit to the size of the plot window - void autoArrangeLayers(); - void initMultilayerPlot(MultiLayer* g, const QString& name); - void plot2VerticalLayers(); - void plot2HorizontalLayers(); - void plot4Layers(); - void plotStackedLayers(); - void plotStackedHistograms(); - //@} - - //! \name 3D Data Plots - //@{ - Graph3D* newPlot3D(const QString& title = QString()); - Graph3D* plotXYZ(Table* table,const QString& zColName, int type); - Graph3D* addRibbon(const QString& caption, const QString& formula, - double xl, double xr, double yl, double yr, double zl, double zr); - //@} - - //! \name Surface Plots - //@{ - Graph3D* plotSurface(const QString& formula, double xl, double xr, - double yl, double yr, double zl, double zr, int columns = 40, int rows = 30); - Graph3D* plotParametricSurface(const QString& xFormula, const QString& yFormula, - const QString& zFormula, double ul, double ur, double vl, double vr, - int columns, int rows, bool uPeriodic, bool vPeriodic); - - void connectSurfacePlot(Graph3D *plot); - void newSurfacePlot(); - void editSurfacePlot(); - void remove3DMatrixPlots(Matrix *m); - void updateMatrixPlots(Matrix *); - void add3DData(); - void change3DData(); - void change3DData(const QString& colName); - void change3DMatrix(); - void change3DMatrix(const QString& matrix_name); - void insertNew3DData(const QString& colName); - void add3DMatrixPlot(); - void insert3DMatrixPlot(const QString& matrix_name); - - void plot3DWireframe(); - void plot3DHiddenLine(); - void plot3DPolygons(); - void plot3DWireSurface(); - - Graph3D* plot3DMatrix(Matrix *m = 0, int style = 5); - - void plot3DRibbon(); - void plot3DScatter(); - void plot3DTrajectory(); - void plot3DBars(); - //@} - - //! \name User-defined Functions - //@{ - MultiLayer * newFunctionPlot(QStringList &formulas, double start, double end, int points = 100, const QString& var = "x", int type = 0); - - FunctionDialog* functionDialog(); - FunctionDialog* showFunctionDialog(); - FunctionDialog* showFunctionDialog(Graph * g, int curve); - void addFunctionCurve(); - void clearSurfaceFunctionsList(); - void clearLogInfo(); - void clearParamFunctionsList(); - void clearPolarFunctionsList(); - void updateFunctionLists(int type, QStringList &formulas); - void updateSurfaceFuncList(const QString& s); - //@} - - //! \name Matrices - //@{ - //! Creates a new empty matrix - Matrix* newMatrix(int rows = 32, int columns = 32); - //! To be used when opening a project file only! - Matrix* newMatrix(const QString& caption, int r, int c); - Matrix* matrix(const QString& name); - Matrix* convertTableToMatrix(); - Matrix* tableToMatrix(Table* t); - Matrix* convertTableToMatrixRegularXYZ(); - void showBinMatrixDialog(); - void initMatrix(Matrix* m, const QString& caption); - void transposeMatrix(); - void invertMatrix(); - void matrixDeterminant(); - void flipMatrixVertically(); - void flipMatrixHorizontally(); - void rotateMatrix90(); - void rotateMatrixMinus90(); - void viewMatrixImage(); - void viewMatrixTable(); - void exportMatrix(const QString& exportFilter = QString::null); - void setMatrixDefaultScale(); - void setMatrixGrayScale(); - void setMatrixRainbowScale(); - void viewMatrixColumnRow(); - void viewMatrixXY(); - void matrixDirectFFT(); - void matrixInverseFFT(); - //@} - - //! \name Tables - //@{ - //! Creates an empty table - Table* newTable(); - - // getCurrent... functions for python interface - Table* currentTable(); - MultiLayer* currentPlot(); - Note* currentNote(); - Matrix* currentMatrix(); - - //! Used when loading a table from a project file - Table* newTable(const QString& caption,int r, int c); - Table* newTable(int r, int c, const QString& name = QString(),const QString& legend = QString()); - Table* newTable(const QString& caption, int r, int c, const QString& text); - /** - * \brief Create a Table which is initially hidden; used to return the result of an analysis operation. - * - * \param name window name (compare MdiSubWindow::MdiSubWindow) - * \param label window label (compare MdiSubWindow::MdiSubWindow) - * \param r number of rows - * \param c number of columns - * \param text tab/newline - seperated initial content; may be empty - */ - Table* newHiddenTable(const QString& name, const QString& label, int r, int c, const QString& text=QString()); - Table* table(const QString& name); - Table* convertMatrixToTableDirect(); - Table* convertMatrixToTableXYZ(); - Table* convertMatrixToTableYXZ(); - Table* matrixToTable(Matrix* m, MatrixToTableConversion conversionType = Direct); - QList tableList(); - //! Returns true if the project contains tables - bool hasTable(); - //! Returns a list containing the names of all tables in the project - QStringList tableNames(); - - void connectTable(Table* w); - void initTable(Table* w, const QString& caption); - void customTable(Table* w); - - void importWaveFile(); - void importASCII(); - void importASCII(const QStringList& files, int import_mode, const QString& local_column_separator, int local_ignored_lines, bool local_rename_columns, - bool local_strip_spaces, bool local_simplify_spaces, bool local_import_comments, - QLocale local_separators, const QString& local_comment_string, bool import_read_only, int endLineChar); - void exportAllTables(const QString& dir, const QString& filter, const QString& sep, bool colNames, bool colComments, bool expSelection); - - //! recalculate selected cells of current table - void recalculateTable(); - - TableStatistics *newTableStatistics(Table *base, int type, QList, - const QString &caption=QString::null); - //@} - - //! \name Graphs - //@{ - void setPreferences(Graph* g); - void setGraphDefaultSettings(bool autoscale,bool scaleFonts,bool resizeLayers,bool antialiasing); - void setArrowDefaultSettings(double lineWidth, const QColor& c, Qt::PenStyle style, - int headLength, int headAngle, bool fillHead); - - void plotL(); - void plotP(); - void plotLP(); - void plotPie(); - void plotVerticalBars(); - void plotHorizontalBars(); - void plotStackBar(); - void plotStackColumn(); - void plotArea(); - void plotVertSteps(); - void plotHorSteps(); - void plotSpline(); - void plotVerticalDropLines(); - MultiLayer* plotHistogram(); - MultiLayer* plotHistogram(Matrix *m); - void plotVectXYXY(); - void plotVectXYAM(); - void plotBoxDiagram(); - void plotDoubleYAxis(); - void zoomRectanglePlot(); - QString stemPlot(Table *t = 0, const QString& colName = QString(), int power = 0, int startRow = 0, int endRow = -1); - Note *newStemPlot(); - - //! Check whether a table is valid for a 3D plot and display an appropriate error if not - bool validFor3DPlot(Table *table); - //! Check whether a table is valid for a 2D plot and display an appropriate error if not - bool validFor2DPlot(Table *table, Graph::CurveType type); - //! Generate a new 2D graph - MultiLayer* generate2DGraph(Graph::CurveType type); - //@} - - //! \name Image Analysis - //@{ - void intensityTable(); - void pixelLineProfile(); - void loadImage(); - void loadImage(const QString& fn); - Matrix* importImage(const QString& = QString(), bool newWindow = false); - //@} - - //! \name Export and Print - //@{ - void exportLayer(); - void exportGraph(const QString& exportFilter = QString::null); - void exportAllGraphs(); - void exportPresentationODF(); - void exportPDF(); - void print(); - void printPreview(); - void printAllPlots(); - //@} - - QStringList columnsList(Table::PlotDesignation plotType = Table::All); - - void undo(); - void redo(); - - //! \name MDI Windows - //@{ - MdiSubWindow* clone(MdiSubWindow* w = 0); - void rename(); - void renameWindow(); - - //! Called when the user presses F2 and an item is selected in lv. - void renameWindow(Q3ListViewItem *item, int, const QString &s); - - //! Checks weather the new window name is valid and modifies the name. - bool setWindowName(MdiSubWindow *w, const QString &text); - - void maximizeWindow(Q3ListViewItem * lbi = 0); - void maximizeWindow(MdiSubWindow *w); - void minimizeWindow(MdiSubWindow *w = 0); - - void updateWindowStatus(MdiSubWindow* ); - - bool hidden(QWidget* window); - void closeActiveWindow(); - void closeWindow(MdiSubWindow* window); - - //! Does all the cleaning work before actually deleting a window! - void removeWindowFromLists(MdiSubWindow* w); - - void hideWindow(MdiSubWindow* window); - void hideWindow(); - void hideActiveWindow(); - void activateWindow(); - void activateWindow(MdiSubWindow *); - //@} - - //! Show about dialog - static void about(); - //! Return a version string ("QtiPlot x.y.z") - static QString versionString(); - void removeCurves(const QString& name); - QStringList dependingPlots(const QString& caption); - QStringList depending3DPlots(Matrix *m); - QStringList multilayerDependencies(QWidget *w); - - void saveAsTemplate(MdiSubWindow* w = 0, const QString& = QString()); - void openTemplate(); - MdiSubWindow* openTemplate(const QString& fn); - - QString windowGeometryInfo(MdiSubWindow *w); - static void restoreWindowGeometry(ApplicationWindow *app, MdiSubWindow *w, const QString s); - void restoreApplicationGeometry(); - void resizeActiveWindow(); - void resizeWindow(); - - //! \name List View in Project Explorer - //@{ - void setListView(const QString& caption,const QString& view); - void renameListViewItem(const QString& oldName,const QString& newName); - void setListViewDate(const QString& caption,const QString& date); - QString listViewDate(const QString& caption); - void setListViewSize(const QString& caption,const QString& size); - void setListViewLabel(const QString& caption,const QString& label); - //@} - - void updateColNames(const QString& oldName, const QString& newName); - void updateTableNames(const QString& oldName, const QString& newName); - void changeMatrixName(const QString& oldName, const QString& newName); - void updateCurves(Table *t, const QString& name); - - void showTable(const QString& curve); - void showTable(int i); - - void addColToTable(); - void cutSelection(); - void copySelection(); - void copyMarker(); - void pasteSelection(); - void clearSelection(); - void copyActiveLayer(); - - void newProject(); - - //! \name Reading from a Project File - //@{ - Matrix* openMatrix(ApplicationWindow* app, const QStringList &flist); - Table* openTable(ApplicationWindow* app, const QStringList &flist); - TableStatistics* openTableStatistics(const QStringList &flist); - Graph* openGraph(ApplicationWindow* app, MultiLayer *plot, const QStringList &list); - - void openRecentProject(int index); - //@} - - //! \name Table Tools - //@{ - void sortSelection(); - void sortActiveTable(); - void normalizeSelection(); - void normalizeActiveTable(); - void correlate(); - void autoCorrelate(); - void convolute(); - void deconvolute(); - void clearTable(); - void goToRow(); - void goToColumn(); - void moveTableRowUp(); - void moveTableRowDown(); - void adjustColumnWidth(); - //@} - - //! \name Plot Tools - //@{ - void newLegend(); - void addTimeStamp(); - void drawLine(); - void drawArrow(); - void drawPoints(); - void addText(); - void addTexFormula(); - void addRectangle(); - void addEllipse(); - void addImage(); - void zoomIn(); - void zoomOut(); - void magnify(); - void setAutoScale(); - void showRangeSelectors(); - void showCursor(); - void showScreenReader(); - void pickPointerCursor(); - void disableTools(); - void pickDataTool( QAction* action ); - - void updateLog(const QString& result); - //@} - - //! \name Fitting - //@{ - void deleteFitTables(); - void fitLinear(); - void fitSigmoidal(); - void fitGauss(); - void fitLorentz(); - void fitMultiPeak(int profile); - void fitMultiPeakGauss(); - void fitMultiPeakLorentz(); - void fitSlope(); - //@} - - //! \name Calculus - //@{ - void integrate(); - void differentiate(); - void analysis(Analysis operation); - void analyzeCurve(Graph *g, Analysis operation, const QString& curveTitle); - void showDataSetDialog(Analysis operation); - //@} - - void addErrorBars(); - void defineErrorBars(const QString& name, int type, double percent, int direction); - void defineErrorBars(const QString& curveName, const QString& errColumnName, int direction); - void movePoints(bool wholeCurve = false); - void removePoints(); - - //! \name Event Handlers - //@{ - void closeEvent( QCloseEvent*); - void timerEvent ( QTimerEvent *e); - void dragEnterEvent( QDragEnterEvent* e ); - void dropEvent( QDropEvent* e ); - void customEvent( QEvent* e); - //@} - - //! \name Dialogs - //@{ - void showFindDialogue(); - //! Show plot style dialog for the active MultiLayer / activeLayer / specified curve or the activeLayer options dialog if no curve is specified (curveKey = -1). - void showPlotDialog(int curveKey = -1); - QDialog* showScaleDialog(); - QDialog* showPlot3dDialog(); - AxesDialog* showScalePageFromAxisDialog(int axisPos); - AxesDialog* showAxisPageFromAxisDialog(int axisPos); - void showAxisDialog(); - void showGridDialog(); - void showGeneralPlotDialog(); - void showResults(bool ok); - void showResults(const QString& s, bool ok=true); - void showEnrichementDialog(); - void showLineDialog(); - void showTitleDialog(); - void showExportASCIIDialog(); - void showCurvesDialog(); - void showCurveRangeDialog(); - CurveRangeDialog* showCurveRangeDialog(Graph *g, int curve); - AssociationsDialog* showPlotAssociations(int curve); - - void showAxisTitleDialog(); - void showColumnOptionsDialog(); - void showRowsDialog(); - void showDeleteRowsDialog(); - void showColsDialog(); - void showColMenu(int c); - void showColumnValuesDialog(); - - void showGraphContextMenu(); - void showTableContextMenu(bool selection); - void showWindowContextMenu(); - void customWindowTitleBarMenu(MdiSubWindow *w, QMenu *menu); - void showCurveContextMenu(QwtPlotItem *); - void showCurvePlotDialog(); - void showCurveWorksheet(); - void showCurveWorksheet(Graph *g, int curveIndex); - void showWindowPopupMenu(Q3ListViewItem *it, const QPoint &p, int); - - //! Connected to the context menu signal from lv; it's called when there are several items selected in the list - void showListViewSelectionMenu(const QPoint &p); - - //! Connected to the context menu signal from lv; it's called when there are no items selected in the list - void showListViewPopupMenu(const QPoint &p); - - void showScriptWindow(bool parent = true); - void showMoreWindows(); - void showMarkerPopupMenu(); - void showHelp(); - static void showStandAloneHelp(); - void chooseHelpFolder(); - void showPlotWizard(); - void showFitPolynomDialog(); - void showFrequencyCountDialog(); - void showIntegrationDialog(); - void showInterpolationDialog(); - void showExpGrowthDialog(); - void showExpDecayDialog(); - void showExpDecayDialog(int type); - void showTwoExpDecayDialog(); - void showExpDecay3Dialog(); - void showRowStatistics(); - void showColStatistics(); - void showFitDialog(); - void showLayerDialog(); - void showPreferencesDialog(); - void showMatrixDialog(); - void showMatrixSizeDialog(); - void showMatrixValuesDialog(); - void showSmoothSavGolDialog(); - void showSmoothFFTDialog(); - void showSmoothAverageDialog(); - void showSmoothLowessDialog(); - void showSmoothDialog(int m); - void showFilterDialog(int filter); - void lowPassFilterDialog(); - void highPassFilterDialog(); - void bandPassFilterDialog(); - void bandBlockFilterDialog(); - void showFFTDialog(); - void showColorMapDialog(); - //@} - - void translateCurveHor(); - void translateCurve(TranslateCurveTool::Direction direction = TranslateCurveTool::Vertical); - - //! Removes the curve identified by a key stored in the data() of actionRemoveCurve. - void removeCurve(); - void hideCurve(); - void hideOtherCurves(); - void showAllCurves(); - void setCurveFullRange(); - - void setAscValues(); - void setRandomValues(); - void setXCol(); - void setYCol(); - void setZCol(); - void setXErrCol(); - void setYErrCol(); - void setLabelCol(); - void disregardCol(); - void setReadOnlyCol(); - void setReadOnlyColumns(); - void setReadWriteColumns(); - void swapColumns(); - void moveColumnRight(); - void moveColumnLeft(); - void moveColumnFirst(); - void moveColumnLast(); - - void updateConfirmOptions(bool askTables, bool askMatrixes, bool askPlots2D, bool askPlots3D, bool askNotes); - - //! \name Plot3D Tools - //@{ - void toggle3DAnimation(bool on = true); - //! Turns perspective mode on or off - void togglePerspective(bool on = true); - //! Resets rotation of 3D plots to default values - void resetRotation(); - //! Finds best layout for the 3D plot - void fitFrameToLayer(); - void setFramed3DPlot(); - void setBoxed3DPlot(); - void removeAxes3DPlot(); - void removeGrid3DPlot(); - void setHiddenLineGrid3DPlot(); - void setLineGrid3DPlot(); - void setPoints3DPlot(); - void setCrosses3DPlot(); - void setCones3DPlot(); - void setBars3DPlot(); - void setFilledMesh3DPlot(); - void setEmptyFloor3DPlot(); - void setFloorData3DPlot(); - void setFloorIso3DPlot(); - void setFloorGrid3DPlot(bool on); - void setCeilGrid3DPlot(bool on); - void setRightGrid3DPlot(bool on); - void setLeftGrid3DPlot(bool on); - void setFrontGrid3DPlot(bool on); - void setBackGrid3DPlot(bool on); - void pickPlotStyle( QAction* action ); - void pickCoordSystem( QAction* action); - void pickFloorStyle( QAction* action); - void custom3DActions(QMdiSubWindow *w); - void custom3DGrids(int grids); - //@} - - void updateRecentProjectsList(); - - //! connected to the done(bool) signal of the http object - void receivedVersionFile(bool error); - //! called when the user presses the actionCheckUpdates - void searchForUpdates(); -#ifdef QTIPLOT_SUPPORT - void showDonationDialog(); -#endif - //! Open support page in external browser - void showSupportPage(); - //! Open donation page in external browser - void showDonationsPage(); - //! Open QtiPlot homepage in external browser - void showHomePage(); - //! Open forums page at berliOS in external browser - void showForums(); - //! Open bug tracking system at berliOS in external browser - void showBugTracker(); - //! Show download page in external browser - void downloadManual(); - //! Show translations page in external browser - void downloadTranslation(); -#ifdef QTIPLOT_DEMO - //! Shown when the user tries to save the project. - void showDemoVersionMessage(); -#endif - - void parseCommandLineArguments(const QStringList& args); - void createLanguagesList(); - void switchToLanguage(int param); - void switchToLanguage(const QString& locale); - - bool alreadyUsedName(const QString& label); - bool projectHas2DPlots(); - - //! Returns a pointer to the window named "name" - MdiSubWindow* window(const QString& name); - - //! Returns a list with the names of all the matrices in the project - QStringList matrixNames(); - - //! \name Notes - //@{ - //! Creates a new empty note window - Note* newNote(const QString& caption = QString()); - Note* openNote(ApplicationWindow* app, const QStringList &flist); - void saveNoteAs(); - void showNoteLineNumbers(bool show = true); - void increaseNoteIndent(); - void decreaseNoteIndent(); - void noteFindDialogue(); - void noteFindNext(); - void noteFindPrev(); - void noteReplaceDialogue(); - void renameCurrentNoteTab(); - void addNoteTab(); - void closeNoteTab(); - void execute(); - void executeAll(); - void evaluate(); - //@} - - //! \name Folders - //@{ - //! Returns a pointer to the current folder in the project - Folder* currentFolder(){return current_folder;}; - //! Adds a new folder to the project - void addFolder(); - Folder* addFolder(QString name, Folder* parent = NULL); - //! Deletes the current folder - void deleteFolder(); - - //! Ask confirmation from user, deletes the folder f if user confirms and returns true, otherwise returns false; - bool deleteFolder(Folder *f); - - //! Deletes the currently selected items from the list view #lv. - void deleteSelectedItems(); - //! Hides the currently selected windows from the list view #lv. - void hideSelectedWindows(); - //! Show the currently selected windows from the list view #lv. - void showSelectedWindows(); - - //! Sets all items in the folders list view to be desactivated (QPixmap = folder_closed_xpm) - void desactivateFolders(); - - //! Changes the current folder. Returns true if successfull - bool changeFolder(Folder *newFolder, bool force = false); - - //! Changes the current folder when the user changes the current item in the QListView "folders" - void folderItemChanged(Q3ListViewItem *it); - //! Changes the current folder when the user double-clicks on a folder item in the QListView "lv" - void folderItemDoubleClicked(Q3ListViewItem *it); - - //! creates and opens the context menu of a folder list view item - /** - * \param it list view item - * \param p mouse global position - * \param fromFolders: true means that the user clicked right mouse buttom on an item from QListView "folders" - * false means that the user clicked right mouse buttom on an item from QListView "lv" - */ - void showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, bool fromFolders); - - //! connected to the SIGNAL contextMenuRequested from the list views - void showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, int); - - //! starts renaming the selected folder by creating a built-in text editor - void startRenameFolder(); - - //! starts renaming the selected folder by creating a built-in text editor - void startRenameFolder(Q3ListViewItem *item); - - //! checks weather the new folder name is valid and modifies the name - void renameFolder(Q3ListViewItem *it, int col, const QString &text); - - //! forces showing all windows in the current folder and subfolders, depending on the user's viewing policy - void showAllFolderWindows(); - - //! forces hidding all windows in the current folder and subfolders, depending on the user's viewing policy - void hideAllFolderWindows(); - - //! hides all windows in folder f - void hideFolderWindows(Folder *f); - - //! pops up folder information - void folderProperties(); - - //! pops up information about the selected window item - void windowProperties(); - - //! pops up information about the current project - void projectProperties(); - - //! Pops up a file dialog and invokes appendProject(const QString&) on the result. - void appendProject(); - //! Open the specified project file and add it as a subfolder to the parentFolder or to the current folder if no parent folder is specified. - Folder* appendProject(const QString& file_name, Folder* parentFolder = 0); - void saveAsProject(); - void saveFolderAsProject(Folder *f); - void saveFolder(Folder *folder, const QString& fn, bool compress = false); - - //! adds a folder list item to the list view "lv" - void addFolderListViewItem(Folder *f); - - //! adds a widget list item to the list view "lv" - void addListViewItem(MdiSubWindow *w); - - //! hides or shows windows in the current folder and changes the view windows policy - void setShowWindowsPolicy(int p); - - //! returns a pointer to the root project folder - Folder* projectFolder(); - - //! used by the findDialog - void find(const QString& s, bool windowNames, bool labels, bool folderNames, - bool caseSensitive, bool partialMatch, bool subfolders); - - //! initializes the list of items dragged by the user - void dragFolderItems(QList items){draggedItems = items;}; - - //! Drop the objects in the list draggedItems to the folder of the destination item - void dropFolderItems(Q3ListViewItem *dest); - - //! moves a folder item to another - /** - * \param src source folder item - * \param dest destination folder item - */ - void moveFolder(FolderListItem *src, FolderListItem *dest); - //! copies a folder to another - /** - * \param src source folder - * \param dest destination folder - */ - bool copyFolder(Folder *src, Folder *dest); - - void foldersMenuActivated( int id ); - //@} - - //! \name Scripting - //@{ - //! notify the user that an error occured in the scripting system - void scriptError(const QString &message, const QString &scriptName, int lineNumber); - //! execute all notes marked auto-exec - void executeNotes(); - //! show scripting language selection dialog - void showScriptingLangDialog(); - //! create a new environment for the current scripting language - void restartScriptingEnv(); - //! print to scripting console (if available) or to stdout - void scriptPrint(const QString &text); - //! switches to the given scripting language; if this is the same as the current one and force is true, restart it - bool setScriptingLanguage(const QString &lang, bool force=false); - - void scriptsDirPathChanged(const QString& path); - //@} - - void showToolBarsMenu(); - void setFormatBarFont(const QFont &); - -signals: - void modified(); - -private: - //! \name Initialization - //@{ - void init(bool factorySettings = false); - void initCompleter(); - void initGlobalConstants(); - void createActions(); - void initMainMenu(); - void initToolBars(); - void initPlot3DToolBar(); - void initPlot3D(Graph3D *plot); - void insertTranslatedStrings(); - void translateActionsStrings(); - //@} - virtual QMenu * createPopupMenu(){return NULL;}; - void updateCompleter(const QString& windowName, bool remove = false, const QString& newName = QString::null); - -private slots: - void disableActions(); - void customColumnActions(); - void disableToolbars(); - void customToolBars(QMdiSubWindow* w); - void customMenu(QMdiSubWindow* w); - void windowActivated(QMdiSubWindow *w); - void custom2DPlotTools(MultiLayer *); - - void analysisMenuAboutToShow(); - void scriptingMenuAboutToShow(); - void fileMenuAboutToShow(); - void editMenuAboutToShow(); - void matrixMenuAboutToShow(); - void plotMenuAboutToShow(); - void plotDataMenuAboutToShow(); - void tableMenuAboutToShow(); - void windowsMenuAboutToShow(); - void windowsMenuActivated( int id ); - - //! \name Font Format Functions - //@{ - void enableTextEditor(Graph *g); - void setFontSize(int); - void setFontFamily(const QFont &); - void setItalicFont(bool); - void setBoldFont(bool); - void insertSuperscript(); - void insertSubscript(); - void underline(); - void insertGreekSymbol(); - void insertGreekMajSymbol(); - void insertMathSymbol(); - //@} - - void showCustomActionDialog(); - void performCustomAction(QAction *); - - void hideSelectedColumns(); - void showAllColumns(); - void closedLastCopiedLayer(){lastCopiedLayer = NULL;}; - - void increasePrecision(); - void decreasePrecision(); - -#ifdef SCRIPTING_PYTHON - void openQtDesignerUi(); -#endif - -// TODO: a lot of this stuff should be private -public: - Graph::LegendDisplayMode d_graph_legend_display; - int d_latex_compiler; - QString d_latex_compiler_path; - //! Last selected filter in open project dialog - QString d_open_project_filter; - //! Default geometry unit to be displayed in the EnrichmentDialog. - int d_frame_geometry_unit; - //! Default geometry unit to be displayed in the PlotDialog. - int d_layer_geometry_unit; - int d_notes_tab_length; - QFont d_notes_font; - //! End of line convention used for copy/paste operations and when exporting tables/matrices to ASCII files. - EndLineChar d_eol; - //! Flag telling if the in-place editing of 2D plot labels is enabled - bool d_in_place_editing; - //! Flag telling if completion hints are enabled - bool d_completion; - //! Flag telling if line numbers are displayed in note windows - bool d_note_line_numbers; - QString d_python_config_folder; - QString d_translations_folder; - //! Flag telling if the application is opening a project file or not - bool d_opening_file; - //! Flag telling if the application is appending a project file or not - bool d_is_appending_file; - QString customActionsDirPath; - bool d_matrix_tool_bar, d_file_tool_bar, d_table_tool_bar, d_column_tool_bar, d_edit_tool_bar; - bool d_plot_tool_bar, d_plot3D_tool_bar, d_display_tool_bar, d_format_tool_bar, d_notes_tool_bar; - bool d_backup_files; - WindowType d_init_window_type; - QRect d_script_win_rect, d_app_rect; - bool d_script_win_on_top; - bool d_inform_rename_table; - QString d_export_col_separator; - bool d_export_col_names, d_export_table_selection, d_export_col_comment; - //! Last selected filter in export image dialog - QString d_image_export_filter, d_export_ASCII_file_filter; - double d_scale_fonts_factor; - bool d_export_transparency; - int d_export_quality; - int d_export_vector_resolution, d_export_bitmap_resolution, d_export_size_unit; - QSizeF d_export_raster_size; - bool d_export_color; - bool d_export_escape_tex_strings; - bool d_export_tex_font_sizes; - int d_3D_export_text_mode, d_3D_export_sort; - //! Locale used to specify the decimal separators in imported ASCII files - QLocale d_clipboard_locale; - //! Locale used to specify the decimal separators in imported ASCII files - QLocale d_ASCII_import_locale; - //! End of line convention used to import ASCII files. - EndLineChar d_ASCII_end_line; - //! Last selected filter in import ASCII dialog - QString d_ASCII_file_filter, d_ASCII_comment_string; - bool d_ASCII_import_comments, d_ASCII_import_read_only, d_ASCII_import_preview; - int d_ASCII_import_mode, d_preview_lines; - int d_ASCII_import_first_row_role; - //! Specifies if only the Tables/Matrices in the current folder should be displayed in the Add/remove curve dialog. - bool d_show_current_folder; - bool d_scale_plots_on_print, d_print_cropmarks; - bool d_show_table_comments; - bool d_extended_plot_dialog; - bool d_extended_import_ASCII_dialog; - bool d_extended_export_dialog; - bool d_extended_open_dialog; - bool generateUniformFitPoints; - bool generatePeakCurves; - int peakCurvesColor; - //! User defined size for the Add/Remove curves dialog - QSize d_add_curves_dialog_size; - - //! Scale the errors output in fit operations with reduced chi^2 - bool fit_scale_errors; - - //! Number of points in a generated fit curve - int fitPoints; - - //! Calculate only 2 points in a generated linear fit function curve - bool d_2_linear_fit_points; - - bool pasteFitResultsToPlot; - - //! Write fit output information to Result Log - bool writeFitResultsToLog; - - //! precision used for the output of the fit operations - int fit_output_precision; - - //! default precision to be used for all other operations than fitting - int d_decimal_digits; - - //! pointer to the current folder in the project - Folder *current_folder; - //! Describes which windows are shown when the folder becomes the current folder - ShowWindowsPolicy show_windows_policy; - enum {MaxRecentProjects = 10}; - //! File version code used when opening project files (= maj * 100 + min * 10 + patch) - int d_file_version; - - QColor d_rect_default_background; - QBrush d_rect_default_brush; - QColor workspaceColor, panelsColor, panelsTextColor; - QColor d_graph_background_color, d_graph_canvas_color, d_graph_border_color, d_canvas_frame_color; - int d_graph_background_opacity, d_graph_canvas_opacity, d_graph_border_width; - QString appStyle, workingDir; - - //! Path to the folder where the last template file was opened/saved - QString templatesDir; - bool autoScaleFonts, autoResizeLayers, autoSearchUpdates; - bool confirmCloseTable, confirmCloseMatrix, confirmClosePlot2D, confirmClosePlot3D; - bool confirmCloseFolder, confirmCloseNotes; - bool titleOn, autoSave, autoscale2DPlots, antialiasing2DPlots; - //! \name User preferences for axes in new 2D plot layers - //@{ - //! Axes to be shown - QVector d_show_axes; - //! Axes with labels enabled - QVector d_show_axes_labels; - //! Draw axes backbones - bool drawBackbones; - //! Distance between the axes title and the backbone - int d_graph_axes_labels_dist; - //! Default axes linewidth - int axesLineWidth; - //@} - int majTicksStyle, minTicksStyle, legendFrameStyle, autoSaveTime, canvasFrameWidth; - QColor legendBackground, legendTextColor, defaultArrowColor; - int defaultArrowHeadLength, defaultArrowHeadAngle, d_legend_default_angle; - double defaultArrowLineWidth, defaultCurveLineWidth; - bool defaultArrowHeadFill; - Qt::PenStyle defaultArrowLineStyle; - QPen d_frame_widget_pen; - int majTicksLength, minTicksLength, defaultPlotMargin; - int defaultCurveStyle, defaultSymbolSize; - QFont appFont; - QFont tableTextFont, tableHeaderFont, plotAxesFont, plotLegendFont, plotNumbersFont, plotTitleFont; - QColor tableBkgdColor, tableTextColor, tableHeaderColor; - QString projectname,columnSeparator, helpFilePath, appLanguage; - QString configFilePath, fitPluginsPath, fitModelsPath, asciiDirPath, imagesDirPath, scriptsDirPath; - int ignoredLines, savingTimerId, recentMenuID; - bool renameColumns, strip_spaces, simplify_spaces; - QStringList recentProjects; - bool saved; - QStringList locales; - QStringList functions; //user-defined functions; - QStringList xFunctions, yFunctions, rFunctions, thetaFunctions; // user functions for parametric and polar plots - QStringList surfaceFunc; //user-defined surface functions; - QStringList d_param_surface_func; //user-defined parametric surface functions; - //! List of tables and matrices renamed in order to avoid conflicts when appending a project to a folder - QStringList renamedTables; - - //! \name variables used when user copy/paste markers - //@{ - FrameWidget *d_enrichement_copy; - ArrowMarker *d_arrow_copy; - //@} - - //! Equals true if an automatical search for updates was performed on start-up otherwise is set to false; - bool autoSearchUpdatesRequest; - - //! The scripting language to use for new projects. - QString defaultScriptingLang; - - //! User custom colors used for Python syntax highlighting - QColor d_comment_highlight_color, d_class_highlight_color, d_numeric_highlight_color; - QColor d_keyword_highlight_color, d_function_highlight_color, d_quotation_highlight_color; - - //! \name user custom values for 3D plots look - //@{ - bool d_3D_smooth_mesh, d_3D_legend, d_3D_orthogonal, d_3D_autoscale; - int d_3D_resolution, d_3D_projection; - QFont d_3D_title_font, d_3D_numbers_font, d_3D_axes_font; - QwtLinearColorMap d_3D_color_map; - QColor d_3D_mesh_color; - QColor d_3D_axes_color; - QColor d_3D_numbers_color; - QColor d_3D_labels_color; - QColor d_3D_background_color; - QColor d_3D_grid_color, d_3D_minor_grid_color; - bool d_3D_minor_grids, d_3D_major_grids; - int d_3D_major_style, d_3D_minor_style; - double d_3D_major_width, d_3D_minor_width; - - void setPlot3DOptions(); - //@} - -private: - bool d_mdi_windows_area; - MdiSubWindow *d_active_window; - TextEditor *d_text_editor; - // Flag telling if table values should be automatically recalculated when values in a column are modified. - bool d_auto_update_table_values; - int d_matrix_undo_stack_size; - - //! Workaround for the new colors introduced in rev 447 - int convertOldToNewColorIndex(int cindex); - - //! Stores the pointers to the dragged items from the FolderListViews objects - QList draggedItems; - - //! Used when checking for new versions - QHttp *http; - //! Used when checking for new versions - QBuffer version_buffer; - - Graph *lastCopiedLayer; - QSplitter *explorerSplitter; - - QAssistantClient *assistant; - ScriptWindow *scriptWindow; - QTranslator *appTranslator, *qtTranslator; - QDockWidget *explorerWindow, *undoStackWindow; - QTextEdit *results; -#ifdef SCRIPTING_CONSOLE - QDockWidget *consoleWindow; - QTextEdit *console; -#endif - QMdiArea *d_workspace; - - QToolBar *fileTools, *plotTools, *tableTools, *columnTools, *plot3DTools, *displayBar, *editTools, *plotMatrixBar; - QToolBar *formatToolBar, *noteTools; - QToolButton *btnResults; - QWidgetList *hiddenWindows; - QLineEdit *info; - //! Completer used in notes and in the script window - QCompleter *d_completer; - - QMenu *windowsMenu, *foldersMenu, *view, *graphMenu, *fileMenu, *format, *edit, *recent; - QMenu *help, *plot2DMenu, *analysisMenu, *multiPeakMenu; - QMenu *matrixMenu, *plot3DMenu, *plotDataMenu, *tablesDepend, *scriptingMenu; - QMenu *tableMenu, *fillMenu, *normMenu, *newMenu, *exportPlotMenu, *smoothMenu, *filterMenu, *decayMenu, *importMenu; - - QAction *actionEditCurveRange, *actionCurveFullRange, *actionShowAllCurves, *actionHideCurve, *actionHideOtherCurves; - QAction *actionEditFunction, *actionRemoveCurve, *actionShowCurveWorksheet, *actionShowCurvePlotDialog; - QAction *actionNewProject, *actionAppendProject, *actionNewNote, *actionNewTable, *actionNewFunctionPlot; - QAction *actionNewSurfacePlot, *actionNewMatrix, *actionNewGraph, *actionNewFolder; - QAction *actionOpen, *actionLoadImage, *actionSaveProject, *actionSaveProjectAs, *actionImportImage; - QAction *actionLoad, *actionUndo, *actionRedo, *actionImportSound; - QAction *actionCopyWindow, *actionShowAllColumns, *actionHideSelectedColumns; - QAction *actionCutSelection, *actionCopySelection, *actionPasteSelection, *actionClearSelection; - QAction *actionShowExplorer, *actionShowLog, *actionAddLayer, *actionShowLayerDialog, *actionAutomaticLayout; -#ifdef SCRIPTING_CONSOLE - QAction *actionShowConsole; -#endif -#ifdef SCRIPTING_PYTHON - QAction *actionOpenQtDesignerUi, *actionShowScriptWindow; -#endif - QAction *actionSwapColumns, *actionMoveColRight, *actionMoveColLeft, *actionMoveColFirst, *actionMoveColLast; - QAction *actionExportGraph, *actionExportAllGraphs, *actionPrint, *actionPrintAllPlots, *actionShowExportASCIIDialog; - QAction *actionExportPDF, *actionReadOnlyCol, *actionStemPlot; - QAction *actionCloseAllWindows, *actionCloseProject, *actionClearLogInfo, *actionShowPlotWizard, *actionShowConfigureDialog; - QAction *actionShowCurvesDialog, *actionAddErrorBars, *actionAddFunctionCurve, *actionUnzoom, *actionNewLegend, *actionAddImage, *actionAddText; - QAction *actionPlotL, *actionPlotP, *actionPlotLP, *actionPlotVerticalDropLines, *actionPlotSpline; - QAction *actionPlotVertSteps, *actionPlotHorSteps, *actionPlotVerticalBars, *actionStackBars, *actionStackColumns; - QAction *actionPlotHorizontalBars, *actionPlotArea, *actionPlotPie, *actionPlotVectXYAM, *actionPlotVectXYXY; - QAction *actionPlotHistogram, *actionPlotStackedHistograms, *actionPlot2VerticalLayers, *actionPlot2HorizontalLayers, *actionPlot4Layers, *actionPlotStackedLayers; - QAction *actionPlot3DRibbon, *actionPlot3DBars, *actionPlot3DScatter, *actionPlot3DTrajectory; - QAction *actionPlotDoubleYAxis, *actionAddInsetLayer, *actionAddInsetCurveLayer; - QAction *actionShowColStatistics, *actionShowRowStatistics, *actionShowIntDialog, *actionIntegrate; - QAction *actionDifferentiate, *actionFitLinear, *actionFitSlope, *actionShowFitPolynomDialog; - QAction *actionShowExpDecayDialog, *actionShowTwoExpDecayDialog, *actionShowExpDecay3Dialog; - QAction *actionFitExpGrowth, *actionFitSigmoidal, *actionFitGauss, *actionFitLorentz, *actionShowFitDialog; - QAction *actionShowAxisDialog, *actionShowTitleDialog; - QAction *actionShowColumnOptionsDialog, *actionShowColumnValuesDialog, *actionShowColsDialog, *actionShowRowsDialog; - QAction *actionTableRecalculate, *actionExtractGraphs, *actionExtractLayers; - QAction *actionAbout, *actionShowHelp, *actionChooseHelpFolder; - QAction *actionRename, *actionCloseWindow; - QAction *actionConvertTableDirect, *actionConvertTableBinning, *actionConvertTableRegularXYZ; - QAction *actionAddColToTable, *actionDeleteLayer, *actionInterpolate; - QAction *actionResizeActiveWindow, *actionHideActiveWindow; - QAction *actionShowMoreWindows, *actionPixelLineProfile, *actionIntensityTable; - QAction *actionShowLineDialog, *actionShowTextDialog; - QAction *actionActivateWindow, *actionMinimizeWindow, *actionMaximizeWindow, *actionHideWindow, *actionResizeWindow; - QAction *actionEditSurfacePlot, *actionAdd3DData; - QAction *actionMatrixDeterminant, *actionSetMatrixProperties, *actionConvertMatrixXYZ, *actionConvertMatrixYXZ; - QAction *actionSetMatrixDimensions, *actionConvertMatrixDirect, *actionSetMatrixValues, *actionTransposeMatrix, *actionInvertMatrix; - QAction *actionPlot3DWireFrame, *actionPlot3DHiddenLine, *actionPlot3DPolygons, *actionPlot3DWireSurface; - QAction *actionColorMap, *actionContourMap, *actionGrayMap; - QAction *actionDeleteFitTables, *actionShowGridDialog, *actionTimeStamp; - QAction *actionSmoothSavGol, *actionSmoothFFT, *actionSmoothAverage, *actionSmoothLowess, *actionFFT; - QAction *actionLowPassFilter, *actionHighPassFilter, *actionBandPassFilter, *actionBandBlockFilter; - QAction *actionSortTable, *actionSortSelection, *actionNormalizeSelection; - QAction *actionNormalizeTable, *actionConvolute, *actionDeconvolute, *actionCorrelate, *actionAutoCorrelate; - QAction *actionTranslateHor, *actionTranslateVert, *actionSetAscValues, *actionSetRandomValues; - QAction *actionSetXCol, *actionSetYCol, *actionSetZCol, *actionSetLabelCol, *actionDisregardCol, *actionSetXErrCol, *actionSetYErrCol; - QAction *actionBoxPlot, *actionMultiPeakGauss, *actionMultiPeakLorentz, *actionCheckUpdates; - QAction *actionDonate, *actionHomePage, *actionDownloadManual, *actionTechnicalSupport, *actionTranslations; - QAction *actionHelpForums, *actionHelpBugReports; - QAction *actionShowPlotDialog, *actionShowScaleDialog, *actionOpenTemplate, *actionSaveTemplate; - QAction *actionNextWindow, *actionPrevWindow; - QAction *actionScriptingLang, *actionRestartScripting, *actionClearTable, *actionGoToRow, *actionGoToColumn; - QAction *actionNoteExecute, *actionNoteExecuteAll, *actionNoteEvaluate, *actionSaveNote, *actionFrequencyCount; - QAction *actionAnimate, *actionPerspective, *actionFitFrame, *actionResetRotation; - QAction *actionDeleteRows, *actionDrawPoints, *actionAddZoomPlot; - QAction *btnCursor, *btnSelect, *btnPicker, *btnRemovePoints, *btnMovePoints, *actionDragCurve; - QAction *btnZoomIn, *btnZoomOut, *btnPointer, *btnLine, *btnArrow; - QAction *actionFlipMatrixVertically, *actionFlipMatrixHorizontally, *actionRotateMatrix; - QAction *actionViewMatrixImage, *actionViewMatrix, *actionExportMatrix, *actionMatrixDefaultScale; - QAction *actionMatrixGrayScale, *actionMatrixRainbowScale, *actionMatrixCustomScale, *actionRotateMatrixMinus; - QAction *actionMatrixXY, *actionMatrixColumnRow, *actionImagePlot, *actionToolBars; - QAction *actionMatrixFFTDirect, *actionMatrixFFTInverse; - QAction *actionFontBold, *actionFontItalic, *actionFontBox, *actionFontSize; - QAction *actionSuperscript, *actionSubscript, *actionUnderline, *actionGreekSymbol, *actionCustomActionDialog; - QAction *actionGreekMajSymbol, *actionMathSymbol; - QAction *Box, *Frame, *None; - QAction *front, *back, *right, *left, *ceil, *floor, *floordata, *flooriso, *floornone; - QAction *wireframe, *hiddenline, *polygon, *filledmesh, *pointstyle, *barstyle, *conestyle, *crossHairStyle; - QAction *actionShowUndoStack, *actionShowNoteLineNumbers, *actionAddFormula, *actionAddRectangle, *actionAddEllipse; - QActionGroup *coord, *floorstyle, *grids, *plotstyle, *dataTools; - QAction *actionMagnify, *actionFindWindow, *actionWaterfallPlot; - QAction *actionMoveRowUp, *actionMoveRowDown, *actionAdjustColumnWidth; - QAction *actionPresentationODF, *actionRenameNoteTab, *actionAddNoteTab, *actionCloseNoteTab; - QAction *actionIncreaseIndent, *actionDecreaseIndent, *actionFind, *actionFindNext, *actionFindPrev, *actionReplace; - QAction *actionIncreasePrecision, *actionDecreasePrecision, *actionPrintPreview; - QList d_user_actions; - QUndoView *d_undo_view; - QList d_user_menus; -}; -#endif === added file 'qtiplot/src/core/ConfigDialog.cpp' --- qtiplot/src/core/ConfigDialog.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/ConfigDialog.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,2888 @@ +/*************************************************************************** + File : ConfigDialog.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Preferences dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "ConfigDialog.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +ConfigDialog::ConfigDialog( QWidget* parent, Qt::WFlags fl ) + : QDialog( parent, fl ) +{ + setAttribute(Qt::WA_DeleteOnClose); + setSizeGripEnabled(true); + + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + d_3D_title_font = app->d_3D_title_font; + d_3D_numbers_font = app->d_3D_numbers_font; + d_3D_axes_font = app->d_3D_axes_font; + textFont = app->tableTextFont; + headerFont = app->tableHeaderFont; + appFont = app->appFont; + axesFont = app->plotAxesFont; + numbersFont = app->plotNumbersFont; + legendFont = app->plotLegendFont; + titleFont = app->plotTitleFont; + + generalDialog = new QStackedWidget(); + itemsList = new QListWidget(); + itemsList->setSpacing(10); + itemsList->setIconSize(QSize(32, 32)); + + initAppPage(); + initTablesPage(); + initPlotsPage(); + initPlots3DPage(); + initNotesPage(); + initFittingPage(); + + generalDialog->addWidget(appTabWidget); + generalDialog->addWidget(tables); + generalDialog->addWidget(plotsTabWidget); + generalDialog->addWidget(plots3D); + generalDialog->addWidget(notesPage); + generalDialog->addWidget(fitPage); + + QVBoxLayout * rightLayout = new QVBoxLayout(); + lblPageHeader = new QLabel(); + QFont fnt = this->font(); + fnt.setPointSize(fnt.pointSize() + 3); + fnt.setBold(true); + lblPageHeader->setFont(fnt); + lblPageHeader->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); + + QPalette pal = lblPageHeader->palette(); + pal.setColor( QPalette::Window, app->panelsColor ); + lblPageHeader->setPalette(pal); + lblPageHeader->setAutoFillBackground( true ); + + rightLayout->setSpacing(10); + rightLayout->addWidget( lblPageHeader ); + rightLayout->addWidget( generalDialog ); + + QHBoxLayout * topLayout = new QHBoxLayout(); + topLayout->setSpacing(5); + topLayout->setMargin(5); + topLayout->addWidget(itemsList, 0); + topLayout->addLayout(rightLayout, 1); + topLayout->addStretch(); + + QHBoxLayout * bottomButtons = new QHBoxLayout(); + bottomButtons->addStretch(); + buttonApply = new QPushButton(); + buttonApply->setAutoDefault( true ); + bottomButtons->addWidget( buttonApply ); + + buttonOk = new QPushButton(); + buttonOk->setAutoDefault( true ); + buttonOk->setDefault( true ); + bottomButtons->addWidget( buttonOk ); + + buttonCancel = new QPushButton(); + buttonCancel->setAutoDefault( true ); + bottomButtons->addWidget( buttonCancel ); + + QVBoxLayout * mainLayout = new QVBoxLayout( this ); + mainLayout->addLayout(topLayout); + mainLayout->addLayout(bottomButtons); + + languageChange(); + + // signals and slots connections + connect( itemsList, SIGNAL(currentRowChanged(int)), this, SLOT(setCurrentPage(int))); + connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); + connect( buttonApply, SIGNAL( clicked() ), this, SLOT( apply() ) ); + connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( buttonTextFont, SIGNAL( clicked() ), this, SLOT( pickTextFont() ) ); + connect( buttonHeaderFont, SIGNAL( clicked() ), this, SLOT( pickHeaderFont() ) ); + + setCurrentPage(0); +} + +void ConfigDialog::setCurrentPage(int index) +{ + generalDialog->setCurrentIndex(index); + if(itemsList->currentItem()) + lblPageHeader->setText(itemsList->currentItem()->text()); +} + +void ConfigDialog::initTablesPage() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + tables = new QWidget(); + + QHBoxLayout * topLayout = new QHBoxLayout(); + topLayout->setSpacing(5); + + lblSeparator = new QLabel(); + topLayout->addWidget( lblSeparator ); + boxSeparator = new QComboBox(); + boxSeparator->setEditable( true ); + topLayout->addWidget( boxSeparator ); + + QString help = tr("The column separator can be customized. \nThe following special codes can be used:\n\\t for a TAB character \n\\s for a SPACE"); + help += "\n"+tr("The separator must not contain the following characters: \n0-9eE.+-"); + + boxSeparator->setWhatsThis(help); + boxSeparator->setToolTip(help); + lblSeparator->setWhatsThis(help); + lblSeparator->setToolTip(help); + + groupBoxTableCol = new QGroupBox(); + QGridLayout * colorsLayout = new QGridLayout(groupBoxTableCol); + + lblTableBackground = new QLabel(); + colorsLayout->addWidget( lblTableBackground, 0, 0 ); + buttonBackground= new ColorButton(); + buttonBackground->setColor(app->tableBkgdColor); + colorsLayout->addWidget( buttonBackground, 0, 1 ); + + lblTextColor = new QLabel(); + colorsLayout->addWidget( lblTextColor, 1, 0 ); + buttonText = new ColorButton(); + buttonText->setColor(app->tableTextColor); + colorsLayout->addWidget( buttonText, 1, 1 ); + + lblHeaderColor = new QLabel(); + colorsLayout->addWidget( lblHeaderColor, 2, 0 ); + buttonHeader= new ColorButton(); + buttonHeader->setColor(app->tableHeaderColor); + colorsLayout->addWidget( buttonHeader, 2, 1 ); + + groupBoxTableFonts = new QGroupBox(); + QHBoxLayout * bottomLayout = new QHBoxLayout( groupBoxTableFonts ); + + buttonTextFont= new QPushButton(); + bottomLayout->addWidget( buttonTextFont ); + buttonHeaderFont= new QPushButton(); + bottomLayout->addWidget( buttonHeaderFont ); + + boxTableComments = new QCheckBox(); + boxTableComments->setChecked(app->d_show_table_comments); + + boxUpdateTableValues = new QCheckBox(); + boxUpdateTableValues->setChecked(app->autoUpdateTableValues()); + + QVBoxLayout * tablesPageLayout = new QVBoxLayout( tables ); + tablesPageLayout->addLayout(topLayout,1); + tablesPageLayout->addWidget(groupBoxTableCol); + tablesPageLayout->addWidget(groupBoxTableFonts); + tablesPageLayout->addWidget(boxTableComments); + tablesPageLayout->addWidget(boxUpdateTableValues); + tablesPageLayout->addStretch(); +} + +void ConfigDialog::initPlotsPage() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + + plotsTabWidget = new QTabWidget(); + plotOptions = new QWidget(); + + QVBoxLayout * optionsTabLayout = new QVBoxLayout( plotOptions ); + optionsTabLayout->setSpacing(5); + + QGroupBox * groupBoxOptions = new QGroupBox(); + optionsTabLayout->addWidget( groupBoxOptions ); + + QGridLayout * optionsLayout = new QGridLayout( groupBoxOptions ); + + boxAutoscaling = new QCheckBox(); + boxAutoscaling->setChecked(app->autoscale2DPlots); + optionsLayout->addWidget( boxAutoscaling, 0, 0); + + boxScaleFonts = new QCheckBox(); + boxScaleFonts->setChecked(app->autoScaleFonts); + optionsLayout->addWidget( boxScaleFonts, 0, 1); + + boxAntialiasing = new QCheckBox(); + boxAntialiasing->setChecked(app->antialiasing2DPlots); + optionsLayout->addWidget( boxAntialiasing, 1, 1); + + boxTitle = new QCheckBox(); + boxTitle->setChecked(app->titleOn); + optionsLayout->addWidget(boxTitle, 1, 0); + + boxFrame = new QCheckBox(); + boxFrame->setChecked(app->canvasFrameWidth > 0); + optionsLayout->addWidget(boxFrame, 3, 0 ); + + labelFrameWidth = new QLabel(); + optionsLayout->addWidget(labelFrameWidth, 4, 0); + boxFrameWidth= new QSpinBox(); + optionsLayout->addWidget(boxFrameWidth, 4, 1); + boxFrameWidth->setRange(1, 100); + boxFrameWidth->setValue(app->canvasFrameWidth); + if (!app->canvasFrameWidth){ + labelFrameWidth->hide(); + boxFrameWidth->hide(); + } + + lblMargin = new QLabel(); + optionsLayout->addWidget(lblMargin, 5, 0); + boxMargin = new QSpinBox(); + boxMargin->setRange(0, 1000); + boxMargin->setSingleStep(5); + boxMargin->setValue(app->defaultPlotMargin); + optionsLayout->addWidget(boxMargin, 5, 1); + + legendDisplayLabel = new QLabel; + optionsLayout->addWidget(legendDisplayLabel, 6, 0); + legendDisplayBox = new QComboBox; + optionsLayout->addWidget(legendDisplayBox, 6, 1); + + lblAxisLabeling = new QLabel; + optionsLayout->addWidget(lblAxisLabeling, 7, 0); + axisLabelingBox = new QComboBox; + optionsLayout->addWidget(axisLabelingBox, 7, 1); + + optionsLayout->setRowStretch(8, 1); + + groupBackgroundOptions = new QGroupBox(tr("Background")); + optionsTabLayout->addWidget( groupBackgroundOptions ); + QGridLayout *graphBackgroundLayout = new QGridLayout( groupBackgroundOptions ); + + labelGraphBkgColor = new QLabel(tr("Background Color")); + graphBackgroundLayout->addWidget(labelGraphBkgColor, 0, 0 ); + boxBackgroundColor = new ColorButton(); + boxBackgroundColor->setColor(app->d_graph_background_color); + graphBackgroundLayout->addWidget(boxBackgroundColor, 0, 1 ); + + labelGraphBkgOpacity = new QLabel(tr( "Opacity" )); + graphBackgroundLayout->addWidget(labelGraphBkgOpacity, 0, 2 ); + boxBackgroundTransparency = new QSpinBox(); + boxBackgroundTransparency->setRange(0, 255); + boxBackgroundTransparency->setSingleStep(5); + boxBackgroundTransparency->setWrapping(true); + boxBackgroundTransparency->setValue(app->d_graph_background_opacity); + graphBackgroundLayout->addWidget(boxBackgroundTransparency, 0, 3 ); + + labelGraphCanvasColor = new QLabel(tr("Canvas Color" )); + graphBackgroundLayout->addWidget(labelGraphCanvasColor, 1, 0); + boxCanvasColor = new ColorButton(); + boxCanvasColor->setColor(app->d_graph_canvas_color); + graphBackgroundLayout->addWidget( boxCanvasColor, 1, 1 ); + + labelGraphCanvasOpacity = new QLabel(tr("Opacity")); + graphBackgroundLayout->addWidget(labelGraphCanvasOpacity, 1, 2 ); + boxCanvasTransparency = new QSpinBox(); + boxCanvasTransparency->setRange(0, 255); + boxCanvasTransparency->setSingleStep(5); + boxCanvasTransparency->setWrapping(true); + boxCanvasTransparency->setValue(app->d_graph_canvas_opacity); + graphBackgroundLayout->addWidget(boxCanvasTransparency, 1, 3 ); + + labelGraphFrameColor = new QLabel(tr("Border Color")); + graphBackgroundLayout->addWidget(labelGraphFrameColor, 2, 0); + boxBorderColor = new ColorButton(); + boxBorderColor->setColor(app->d_graph_border_color); + graphBackgroundLayout->addWidget(boxBorderColor, 2, 1); + + labelGraphFrameWidth = new QLabel(tr( "Width" )); + graphBackgroundLayout->addWidget(labelGraphFrameWidth, 2, 2); + boxBorderWidth = new QSpinBox(); + boxBorderWidth->setValue(app->d_graph_border_width); + graphBackgroundLayout->addWidget(boxBorderWidth, 2, 3); + + graphBackgroundLayout->setRowStretch(4, 1); + + boxResize = new QCheckBox(); + boxResize->setChecked(!app->autoResizeLayers); + optionsTabLayout->addWidget( boxResize ); + + boxLabelsEditing = new QCheckBox(); + boxLabelsEditing->setChecked(!app->d_in_place_editing); + optionsTabLayout->addWidget(boxLabelsEditing); + + plotsTabWidget->addTab( plotOptions, QString() ); + + initCurvesPage(); + plotsTabWidget->addTab( curves, QString() ); + + initAxesPage(); + plotsTabWidget->addTab( axesPage, QString() ); + + plotTicks = new QWidget(); + QVBoxLayout * plotTicksLayout = new QVBoxLayout( plotTicks ); + + QGroupBox * ticksGroupBox = new QGroupBox(); + QGridLayout * ticksLayout = new QGridLayout( ticksGroupBox ); + plotTicksLayout->addWidget( ticksGroupBox ); + + lblMajTicks = new QLabel(); + ticksLayout->addWidget( lblMajTicks, 0, 0 ); + boxMajTicks = new QComboBox(); + ticksLayout->addWidget( boxMajTicks, 0, 1 ); + + lblMajTicksLength = new QLabel(); + ticksLayout->addWidget( lblMajTicksLength, 0, 2 ); + boxMajTicksLength = new QSpinBox(); + boxMajTicksLength->setRange(0, 100); + boxMajTicksLength->setValue(app->majTicksLength); + ticksLayout->addWidget( boxMajTicksLength, 0, 3 ); + + lblMinTicks = new QLabel(); + ticksLayout->addWidget( lblMinTicks, 1, 0 ); + boxMinTicks = new QComboBox(); + ticksLayout->addWidget( boxMinTicks, 1, 1 ); + + lblMinTicksLength = new QLabel(); + ticksLayout->addWidget( lblMinTicksLength, 1, 2 ); + boxMinTicksLength = new QSpinBox(); + boxMinTicksLength->setRange(0, 100); + boxMinTicksLength->setValue(app->minTicksLength); + ticksLayout->addWidget( boxMinTicksLength, 1, 3 ); + + ticksLayout->setRowStretch( 4, 1 ); + + plotsTabWidget->addTab( plotTicks, QString() ); + + initLayerGeometryPage(); + plotsTabWidget->addTab(plotGeometryPage, QString()); + + plotFonts = new QWidget(); + QVBoxLayout * plotFontsLayout = new QVBoxLayout( plotFonts ); + + QGroupBox * groupBox2DFonts = new QGroupBox(); + plotFontsLayout->addWidget( groupBox2DFonts ); + QVBoxLayout * fontsLayout = new QVBoxLayout( groupBox2DFonts ); + buttonTitleFont= new QPushButton(); + fontsLayout->addWidget( buttonTitleFont ); + buttonLegendFont= new QPushButton(); + fontsLayout->addWidget( buttonLegendFont ); + buttonAxesFont= new QPushButton(); + fontsLayout->addWidget( buttonAxesFont ); + buttonNumbersFont= new QPushButton(); + fontsLayout->addWidget( buttonNumbersFont ); + fontsLayout->addStretch(); + + plotsTabWidget->addTab( plotFonts, QString() ); + + plotPrint = new QWidget(); + QVBoxLayout *printLayout = new QVBoxLayout( plotPrint ); + + boxScaleLayersOnPrint = new QCheckBox(); + boxScaleLayersOnPrint->setChecked(app->d_scale_plots_on_print); + printLayout->addWidget( boxScaleLayersOnPrint ); + + boxPrintCropmarks = new QCheckBox(); + boxPrintCropmarks->setChecked(app->d_print_cropmarks); + printLayout->addWidget( boxPrintCropmarks ); + printLayout->addStretch(); + plotsTabWidget->addTab(plotPrint, QString()); + + connect( boxFrame, SIGNAL( toggled(bool) ), this, SLOT( showFrameWidth(bool) ) ); + connect( buttonAxesFont, SIGNAL( clicked() ), this, SLOT( pickAxesFont() ) ); + connect( buttonNumbersFont, SIGNAL( clicked() ), this, SLOT( pickNumbersFont() ) ); + connect( buttonLegendFont, SIGNAL( clicked() ), this, SLOT( pickLegendFont() ) ); + connect( buttonTitleFont, SIGNAL( clicked() ), this, SLOT( pickTitleFont() ) ); +} + +void ConfigDialog::showFrameWidth(bool ok) +{ + if (!ok) + { + boxFrameWidth->hide(); + labelFrameWidth->hide(); + } + else + { + boxFrameWidth->show(); + labelFrameWidth->show(); + } +} + +void ConfigDialog::initPlots3DPage() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + plots3D = new QWidget(); + + QGroupBox * topBox = new QGroupBox(); + QGridLayout * topLayout = new QGridLayout( topBox ); + topLayout->setSpacing(5); + + lblResolution = new QLabel(); + topLayout->addWidget( lblResolution, 0, 0 ); + boxResolution = new QSpinBox(); + boxResolution->setRange(1, 100); + boxResolution->setValue(app->d_3D_resolution); + topLayout->addWidget( boxResolution, 0, 1 ); + lblResolution->setBuddy(boxResolution); + + lblFloorStyle = new QLabel(); + topLayout->addWidget( lblFloorStyle, 1, 0 ); + + boxProjection = new QComboBox(); + boxProjection->setCurrentIndex(app->d_3D_projection); + topLayout->addWidget(boxProjection, 1, 1); + lblFloorStyle->setBuddy(boxProjection); + + boxShowLegend = new QCheckBox(); + boxShowLegend->setChecked(app->d_3D_legend); + topLayout->addWidget(boxShowLegend, 2, 0); + + boxSmoothMesh = new QCheckBox(); + boxSmoothMesh->setChecked(app->d_3D_smooth_mesh); + topLayout->addWidget(boxSmoothMesh, 2, 1); + + boxOrthogonal = new QCheckBox(); + boxOrthogonal->setChecked(app->d_3D_orthogonal); + topLayout->addWidget(boxOrthogonal, 3, 1); + + boxAutoscale3DPlots = new QCheckBox(); + boxAutoscale3DPlots->setChecked(app->d_3D_autoscale); + topLayout->addWidget(boxAutoscale3DPlots, 3, 0); + + colorMapBox = new QGroupBox(); + QHBoxLayout *colorMapLayout = new QHBoxLayout( colorMapBox ); + colorMapLayout->setMargin(0); + colorMapLayout->setSpacing(0); + + colorMapEditor = new ColorMapEditor(app->locale()); + colorMapEditor->setColorMap(app->d_3D_color_map); + colorMapLayout->addWidget(colorMapEditor); + + groupBox3DCol = new QGroupBox(); + QGridLayout * middleLayout = new QGridLayout( groupBox3DCol ); + btnAxes = new ColorButton(); + btnAxes->setColor(app->d_3D_axes_color); + middleLayout->addWidget(btnAxes, 0, 0); + btnLabels = new ColorButton(); + btnLabels->setColor(app->d_3D_labels_color); + middleLayout->addWidget(btnLabels, 0, 1); + btnNumbers = new ColorButton(); + btnNumbers->setColor(app->d_3D_numbers_color); + middleLayout->addWidget(btnNumbers, 0, 2); + btnMesh = new ColorButton(); + btnMesh->setColor(app->d_3D_mesh_color); + middleLayout->addWidget(btnMesh, 1, 0); + btnBackground3D = new ColorButton(); + btnBackground3D->setColor(app->d_3D_background_color); + middleLayout->addWidget(btnBackground3D, 1, 1); + + groupBox3DFonts = new QGroupBox(); + QGridLayout * fl = new QGridLayout( groupBox3DFonts ); + btnTitleFnt = new QPushButton(); + fl->addWidget( btnTitleFnt, 0, 0); + btnLabelsFnt = new QPushButton(); + fl->addWidget( btnLabelsFnt, 0, 1); + btnNumFnt = new QPushButton(); + fl->addWidget( btnNumFnt, 0, 2); + fl->setRowStretch(1, 1); + + groupBox3DGrids = new QGroupBox(tr("Grids")); + QGridLayout *gl1 = new QGridLayout(groupBox3DGrids); + + boxMajorGrids = new QCheckBox(tr("Ma&jor Grids")); + boxMajorGrids->setChecked(app->d_3D_major_grids); + connect(boxMajorGrids, SIGNAL(toggled(bool)), this, SLOT(enableMajorGrids(bool))); + gl1->addWidget(boxMajorGrids, 0, 1); + + boxMinorGrids = new QCheckBox(tr("Mi&nor Grids")); + boxMinorGrids->setChecked(app->d_3D_minor_grids); + connect(boxMinorGrids, SIGNAL(toggled(bool)), this, SLOT(enableMinorGrids(bool))); + gl1->addWidget(boxMinorGrids, 0, 2); + + label3DGridsColor = new QLabel(tr("Color")); + gl1->addWidget(label3DGridsColor, 1, 0); + + btnGrid = new ColorButton(); + btnGrid->setColor(app->d_3D_grid_color); + gl1->addWidget(btnGrid, 1, 1); + + btnGridMinor = new ColorButton(); + btnGridMinor->setColor(app->d_3D_minor_grid_color); + gl1->addWidget(btnGridMinor, 1, 2); + + label3DGridsStyle = new QLabel(tr("Style")); + gl1->addWidget(label3DGridsStyle, 2, 0); + + boxMajorGridStyle = new QComboBox(); + gl1->addWidget(boxMajorGridStyle, 2, 1); + + boxMinorGridStyle = new QComboBox(); + gl1->addWidget(boxMinorGridStyle, 2, 2); + + label3DGridsWidth = new QLabel(tr("Width")); + gl1->addWidget(label3DGridsWidth, 3, 0); + + boxMajorGridWidth = new DoubleSpinBox(); + boxMajorGridWidth->setLocale(app->locale()); + boxMajorGridWidth->setMinimum(0.0); + boxMajorGridWidth->setValue(app->d_3D_major_width); + gl1->addWidget(boxMajorGridWidth, 3, 1); + + boxMinorGridWidth = new DoubleSpinBox(); + boxMinorGridWidth->setLocale(app->locale()); + boxMinorGridWidth->setMinimum(0.0); + boxMinorGridWidth->setValue(app->d_3D_minor_width); + gl1->addWidget(boxMinorGridWidth, 3, 2); + + gl1->setRowStretch(4, 1); + gl1->setColumnStretch(3, 1); + + enableMajorGrids(app->d_3D_major_grids); + enableMinorGrids(app->d_3D_minor_grids); + + QVBoxLayout *vl = new QVBoxLayout(); + vl->addWidget(groupBox3DCol); + vl->addWidget(groupBox3DFonts); + vl->addWidget(groupBox3DGrids); + + QHBoxLayout *hb = new QHBoxLayout(); + hb->addWidget(colorMapBox); + hb->addLayout(vl); + + QVBoxLayout * plots3DPageLayout = new QVBoxLayout( plots3D ); + plots3DPageLayout->addWidget(topBox); + plots3DPageLayout->addLayout(hb); + + connect( btnNumFnt, SIGNAL( clicked() ), this, SLOT(pick3DNumbersFont() ) ); + connect( btnTitleFnt, SIGNAL( clicked() ), this, SLOT(pick3DTitleFont() ) ); + connect( btnLabelsFnt, SIGNAL( clicked() ), this, SLOT(pick3DAxesFont() ) ); +} + +void ConfigDialog::initAppPage() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + + appTabWidget = new QTabWidget(generalDialog); + appTabWidget->setUsesScrollButtons(false); + + application = new QWidget(); + QVBoxLayout * applicationLayout = new QVBoxLayout( application ); + QGroupBox * groupBoxApp = new QGroupBox(); + applicationLayout->addWidget(groupBoxApp); + QGridLayout * topBoxLayout = new QGridLayout( groupBoxApp ); + + lblLanguage = new QLabel(); + topBoxLayout->addWidget( lblLanguage, 0, 0 ); + boxLanguage = new QComboBox(); + insertLanguagesList(); + topBoxLayout->addWidget( boxLanguage, 0, 1 ); + + lblStyle = new QLabel(); + topBoxLayout->addWidget( lblStyle, 1, 0 ); + boxStyle = new QComboBox(); + topBoxLayout->addWidget( boxStyle, 1, 1 ); + QStringList styles = QStyleFactory::keys(); + styles.sort(); + boxStyle->addItems(styles); + boxStyle->setCurrentIndex(boxStyle->findText(app->appStyle,Qt::MatchWildcard)); + + lblFonts = new QLabel(); + topBoxLayout->addWidget( lblFonts, 2, 0 ); + fontsBtn= new QPushButton(); + topBoxLayout->addWidget( fontsBtn, 2, 1 ); + + lblScriptingLanguage = new QLabel(); + topBoxLayout->addWidget( lblScriptingLanguage, 3, 0 ); + boxScriptingLanguage = new QComboBox(); + QStringList llist = ScriptingLangManager::languages(); + boxScriptingLanguage->insertStringList(llist); + boxScriptingLanguage->setCurrentItem(llist.findIndex(app->defaultScriptingLang)); + topBoxLayout->addWidget( boxScriptingLanguage, 3, 1 ); + + lblUndoStackSize = new QLabel(); + topBoxLayout->addWidget( lblUndoStackSize, 4, 0 ); + undoStackSizeBox = new QSpinBox(); + undoStackSizeBox->setValue(app->matrixUndoStackSize()); + topBoxLayout->addWidget( undoStackSizeBox, 4, 1 ); + + lblEndOfLine = new QLabel(); + topBoxLayout->addWidget(lblEndOfLine, 5, 0 ); + boxEndLine = new QComboBox(); + boxEndLine->addItem(tr("LF (Unix)")); + boxEndLine->addItem(tr("CRLF (Windows)")); + boxEndLine->addItem(tr("CR (Mac)")); + boxEndLine->setCurrentIndex((int)app->d_eol); + topBoxLayout->addWidget(boxEndLine, 5, 1); + + lblInitWindow = new QLabel(); + topBoxLayout->addWidget( lblInitWindow, 6, 0 ); + boxInitWindow = new QComboBox(); + topBoxLayout->addWidget( boxInitWindow, 6, 1 ); + + boxSave= new QCheckBox(); + boxSave->setChecked(app->autoSave); + topBoxLayout->addWidget( boxSave, 7, 0 ); + + boxMinutes = new QSpinBox(); + boxMinutes->setRange(1, 100); + boxMinutes->setValue(app->autoSaveTime); + boxMinutes->setEnabled(app->autoSave); + topBoxLayout->addWidget( boxMinutes, 7, 1 ); + + boxBackupProject = new QCheckBox(); + boxBackupProject->setChecked(app->d_backup_files); + topBoxLayout->addWidget( boxBackupProject, 8, 0, 1, 2 ); + + boxSearchUpdates = new QCheckBox(); + boxSearchUpdates->setChecked(app->autoSearchUpdates); + topBoxLayout->addWidget( boxSearchUpdates, 9, 0, 1, 2 ); + + completionBox = new QCheckBox(); + completionBox->setChecked(app->d_completion); + topBoxLayout->addWidget(completionBox, 10, 0); + + topBoxLayout->setRowStretch(11, 1); + + appTabWidget->addTab(application, QString()); + + initConfirmationsPage(); + + appTabWidget->addTab( confirm, QString() ); + + appColors = new QWidget(); + QVBoxLayout * appColorsLayout = new QVBoxLayout( appColors ); + QGroupBox * groupBoxAppCol = new QGroupBox(); + appColorsLayout->addWidget( groupBoxAppCol ); + QGridLayout * colorsBoxLayout = new QGridLayout( groupBoxAppCol ); + + lblWorkspace = new QLabel(); + colorsBoxLayout->addWidget( lblWorkspace, 0, 0 ); + btnWorkspace = new ColorButton(); + btnWorkspace->setColor(app->workspaceColor); + colorsBoxLayout->addWidget( btnWorkspace, 0, 1 ); + + lblPanels = new QLabel(); + colorsBoxLayout->addWidget( lblPanels, 1, 0 ); + btnPanels = new ColorButton(); + colorsBoxLayout->addWidget( btnPanels, 1, 1 ); + btnPanels->setColor(app->panelsColor); + + lblPanelsText = new QLabel(); + colorsBoxLayout->addWidget( lblPanelsText, 2, 0 ); + btnPanelsText = new ColorButton(); + colorsBoxLayout->addWidget( btnPanelsText, 2, 1 ); + btnPanelsText->setColor(app->panelsTextColor); + + colorsBoxLayout->setRowStretch( 3, 1 ); + + appTabWidget->addTab( appColors, QString() ); + + numericFormatPage = new QWidget(); + QVBoxLayout *numLayout = new QVBoxLayout( numericFormatPage ); + QGroupBox *numericFormatBox = new QGroupBox(); + numLayout->addWidget( numericFormatBox ); + QGridLayout *numericFormatLayout = new QGridLayout( numericFormatBox ); + + lblAppPrecision = new QLabel(); + numericFormatLayout->addWidget(lblAppPrecision, 0, 0); + boxAppPrecision = new QSpinBox(); + boxAppPrecision->setRange(0, 14); + boxAppPrecision->setValue(app->d_decimal_digits); + numericFormatLayout->addWidget(boxAppPrecision, 0, 1); + + lblDecimalSeparator = new QLabel(); + numericFormatLayout->addWidget(lblDecimalSeparator, 1, 0 ); + boxDecimalSeparator = new QComboBox(); + boxDecimalSeparator->addItem(tr("System Locale Setting")); + boxDecimalSeparator->addItem("1,000.0"); + boxDecimalSeparator->addItem("1.000,0"); + boxDecimalSeparator->addItem("1 000,0"); + + numericFormatLayout->addWidget(boxDecimalSeparator, 1, 1); + + boxThousandsSeparator = new QCheckBox(); + boxThousandsSeparator->setChecked(app->locale().numberOptions() & QLocale::OmitGroupSeparator); + numericFormatLayout->addWidget(boxThousandsSeparator, 1, 2); + + lblClipboardSeparator = new QLabel(); + numericFormatLayout->addWidget(lblClipboardSeparator, 2, 0 ); + boxClipboardLocale = new QComboBox(); + boxClipboardLocale->addItem(tr("System Locale Setting")); + boxClipboardLocale->addItem("1,000.0"); + boxClipboardLocale->addItem("1.000,0"); + boxClipboardLocale->addItem("1 000,0"); + numericFormatLayout->addWidget(boxClipboardLocale, 2, 1); + + boxMuParserCLocale = new QCheckBox(); + boxMuParserCLocale->setChecked(app->d_muparser_c_locale); + numericFormatLayout->addWidget(boxMuParserCLocale, 3, 0); + + numericFormatLayout->setRowStretch(4, 1); + appTabWidget->addTab( numericFormatPage, QString() ); + + initFileLocationsPage(); + initProxyPage(); + + connect( boxLanguage, SIGNAL( activated(int) ), this, SLOT( switchToLanguage(int) ) ); + connect( fontsBtn, SIGNAL( clicked() ), this, SLOT( pickApplicationFont() ) ); + connect( boxSave, SIGNAL( toggled(bool) ), boxMinutes, SLOT( setEnabled(bool) ) ); +} + +void ConfigDialog::initNotesPage() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + notesPage = new QWidget(); + + QGroupBox *gb1 = new QGroupBox(); + QGridLayout * gl1 = new QGridLayout(gb1); + gl1->setSpacing(5); + + labelTabLength = new QLabel(); + gl1->addWidget(labelTabLength, 0, 0); + + boxTabLength = new QSpinBox(); + boxTabLength->setRange(0, 1000); + boxTabLength->setSingleStep(5); + boxTabLength->setValue(app->d_notes_tab_length); + connect(boxTabLength, SIGNAL(valueChanged(int)), this, SLOT(customizeNotes())); + gl1->addWidget(boxTabLength, 0, 1); + + labelNotesFont = new QLabel(); + gl1->addWidget(labelNotesFont, 1, 0); + + boxFontFamily = new QFontComboBox(); + boxFontFamily->setCurrentFont(app->d_notes_font); + connect(boxFontFamily, SIGNAL(activated(int)), this, SLOT(customizeNotes())); + gl1->addWidget(boxFontFamily, 1, 1); + + boxFontSize = new QSpinBox(); + boxFontSize->setRange(0, 1000); + boxFontSize->setValue(app->d_notes_font.pointSize()); + connect(boxFontSize, SIGNAL(valueChanged(int)), this, SLOT(customizeNotes())); + gl1->addWidget(boxFontSize, 1, 2); + + buttonBoldFont = new QPushButton(tr("&B")); + QFont font = QFont(); + font.setBold(true); + buttonBoldFont->setFont(font); + buttonBoldFont->setCheckable(true); + buttonBoldFont->setChecked(app->d_notes_font.bold()); + connect(buttonBoldFont, SIGNAL(clicked()), this, SLOT(customizeNotes())); + gl1->addWidget(buttonBoldFont, 1, 3); + + buttonItalicFont = new QPushButton(tr("&It")); + font = QFont(); + font.setItalic(true); + buttonItalicFont->setFont(font); + buttonItalicFont->setCheckable(true); + buttonItalicFont->setChecked(app->d_notes_font.italic()); + connect(buttonItalicFont, SIGNAL(clicked()), this, SLOT(customizeNotes())); + gl1->addWidget(buttonItalicFont, 1, 4); + + lineNumbersBox = new QCheckBox(); + lineNumbersBox->setChecked(app->d_note_line_numbers); + connect(lineNumbersBox, SIGNAL(toggled(bool)), this, SLOT(customizeNotes())); + gl1->addWidget(lineNumbersBox, 2, 0); + gl1->setColumnStretch(5, 1); + + QVBoxLayout* vl = new QVBoxLayout(notesPage); + vl->addWidget(gb1); + + groupSyntaxHighlighter = new QGroupBox(); + QGridLayout *gl = new QGridLayout(groupSyntaxHighlighter); + + buttonCommentLabel = new QLabel; + gl->addWidget(buttonCommentLabel, 0, 0); + + buttonCommentColor = new ColorButton(); + buttonCommentColor->setColor(app->d_comment_highlight_color); + connect(buttonCommentColor, SIGNAL(colorChanged()), this, SLOT(rehighlight())); + gl->addWidget(buttonCommentColor, 0, 1); + buttonCommentLabel->setBuddy (buttonCommentColor); + + buttonKeywordLabel = new QLabel; + gl->addWidget(buttonKeywordLabel, 1, 0); + + buttonKeywordColor = new ColorButton(); + buttonKeywordColor->setColor(app->d_keyword_highlight_color); + connect(buttonKeywordColor, SIGNAL(colorChanged()), this, SLOT(rehighlight())); + gl->addWidget(buttonKeywordColor, 1, 1); + buttonKeywordLabel->setBuddy (buttonKeywordColor); + + buttonQuotationLabel = new QLabel; + gl->addWidget(buttonQuotationLabel, 2, 0); + + buttonQuotationColor = new ColorButton(); + buttonQuotationColor->setColor(app->d_quotation_highlight_color); + connect(buttonQuotationColor, SIGNAL(colorChanged()), this, SLOT(rehighlight())); + gl->addWidget(buttonQuotationColor, 2, 1); + buttonQuotationLabel->setBuddy (buttonQuotationColor); + + buttonNumericLabel = new QLabel; + gl->addWidget(buttonNumericLabel, 3, 0); + + buttonNumericColor = new ColorButton(); + buttonNumericColor->setColor(app->d_numeric_highlight_color); + connect(buttonNumericColor, SIGNAL(colorChanged()), this, SLOT(rehighlight())); + gl->addWidget(buttonNumericColor, 3, 1); + buttonNumericLabel->setBuddy (buttonNumericColor); + + buttonFunctionLabel = new QLabel; + gl->addWidget(buttonFunctionLabel, 4, 0); + + buttonFunctionColor = new ColorButton(); + buttonFunctionColor->setColor(app->d_function_highlight_color); + connect(buttonFunctionColor, SIGNAL(colorChanged()), this, SLOT(rehighlight())); + gl->addWidget(buttonFunctionColor, 4, 1); + buttonFunctionLabel->setBuddy (buttonFunctionColor); + + buttonClassLabel = new QLabel; + gl->addWidget(buttonClassLabel, 5, 0); + + buttonClassColor = new ColorButton(); + buttonClassColor->setColor(app->d_class_highlight_color); + connect(buttonClassColor, SIGNAL(colorChanged()), this, SLOT(rehighlight())); + gl->addWidget(buttonClassColor, 5, 1); + buttonClassLabel->setBuddy (buttonClassColor); + gl->setRowStretch(6, 1); + + vl->addWidget(groupSyntaxHighlighter); + + vl->addStretch(); +} + +void ConfigDialog::initFittingPage() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + fitPage = new QWidget(); + + groupBoxFittingCurve = new QGroupBox(); + QGridLayout * fittingCurveLayout = new QGridLayout(groupBoxFittingCurve); + fittingCurveLayout->setSpacing(5); + + generatePointsBtn = new QRadioButton(); + generatePointsBtn->setChecked(app->generateUniformFitPoints); + fittingCurveLayout->addWidget(generatePointsBtn, 0, 0); + + lblPoints = new QLabel(); + fittingCurveLayout->addWidget(lblPoints, 0, 1); + generatePointsBox = new QSpinBox(); + generatePointsBox->setRange(0, 1000000); + generatePointsBox->setSingleStep(10); + generatePointsBox->setValue(app->fitPoints); + fittingCurveLayout->addWidget(generatePointsBox, 0, 2); + + linearFit2PointsBox = new QCheckBox(); + linearFit2PointsBox->setChecked(app->d_2_linear_fit_points); + fittingCurveLayout->addWidget(linearFit2PointsBox, 0, 3); + + showPointsBox(!app->generateUniformFitPoints); + + samePointsBtn = new QRadioButton(); + samePointsBtn->setChecked(!app->generateUniformFitPoints); + fittingCurveLayout->addWidget(samePointsBtn, 1, 0); + + groupBoxMultiPeak = new QGroupBox(); + groupBoxMultiPeak->setCheckable(true); + groupBoxMultiPeak->setChecked(app->generatePeakCurves); + + QHBoxLayout * multiPeakLayout = new QHBoxLayout(groupBoxMultiPeak); + + lblPeaksColor = new QLabel(); + multiPeakLayout->addWidget(lblPeaksColor); + boxPeaksColor = new ColorButton(); + boxPeaksColor->setColor(app->peakCurvesColor); + multiPeakLayout->addWidget(boxPeaksColor); + + groupBoxFitParameters = new QGroupBox(); + QGridLayout * fitParamsLayout = new QGridLayout(groupBoxFitParameters); + + lblPrecision = new QLabel(); + fitParamsLayout->addWidget(lblPrecision, 0, 0); + boxPrecision = new QSpinBox(); + fitParamsLayout->addWidget(boxPrecision, 0, 1); + boxPrecision->setValue(app->fit_output_precision); + + logBox = new QCheckBox(); + logBox->setChecked(app->writeFitResultsToLog); + fitParamsLayout->addWidget(logBox, 1, 0); + + plotLabelBox = new QCheckBox(); + plotLabelBox->setChecked(app->pasteFitResultsToPlot); + fitParamsLayout->addWidget(plotLabelBox, 2, 0); + + scaleErrorsBox = new QCheckBox(); + fitParamsLayout->addWidget(scaleErrorsBox, 3, 0); + scaleErrorsBox->setChecked(app->fit_scale_errors); + + boxMultiPeakMsgs = new QCheckBox(); + boxMultiPeakMsgs->setChecked(app->d_multi_peak_messages); + + QVBoxLayout* fitPageLayout = new QVBoxLayout(fitPage); + fitPageLayout->addWidget(groupBoxFittingCurve); + fitPageLayout->addWidget(groupBoxMultiPeak); + fitPageLayout->addWidget(groupBoxFitParameters); + fitPageLayout->addWidget(boxMultiPeakMsgs); + fitPageLayout->addStretch(); + + connect(samePointsBtn, SIGNAL(toggled(bool)), this, SLOT(showPointsBox(bool))); + connect(generatePointsBtn, SIGNAL(toggled(bool)), this, SLOT(showPointsBox(bool))); +} + +void ConfigDialog::initLayerGeometryPage() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + + plotGeometryPage = new QWidget(); + + QGroupBox * gb = new QGroupBox(); + QGridLayout * gl = new QGridLayout( gb ); + + unitBoxLabel = new QLabel(); + gl->addWidget(unitBoxLabel, 0, 0); + + unitBox = new QComboBox(); + connect(unitBox, SIGNAL(activated(int)), this, SLOT(updateCanvasSize(int))); + gl->addWidget(unitBox, 0, 1); + + QLocale locale = QLocale(); + + canvasWidthLabel = new QLabel(); + gl->addWidget(canvasWidthLabel, 1, 0); + + FrameWidget::Unit unit = (FrameWidget::Unit)app->d_layer_geometry_unit; + + boxCanvasWidth = new DoubleSpinBox(); + boxCanvasWidth->setRange(0, 10000); + boxCanvasWidth->setLocale(locale); + boxCanvasWidth->setDecimals(6); + //boxCanvasWidth->setValue(convertFromPixels(app->d_layer_canvas_width, unit,0)); + connect(boxCanvasWidth, SIGNAL(valueChanged (double)), this, SLOT(adjustCanvasHeight(double))); + gl->addWidget(boxCanvasWidth, 1, 1); + + canvasHeightLabel = new QLabel(); + gl->addWidget(canvasHeightLabel, 2, 0); + + boxCanvasHeight = new DoubleSpinBox(); + boxCanvasHeight->setRange(0, 10000); + boxCanvasHeight->setLocale(locale); + boxCanvasHeight->setDecimals(6); + //boxCanvasHeight->setValue(convertFromPixels(app->d_layer_canvas_height, unit, 1)); + connect(boxCanvasHeight, SIGNAL(valueChanged (double)), this, SLOT(adjustCanvasWidth(double))); + gl->addWidget(boxCanvasHeight, 2, 1); + + keepRatioBox = new QCheckBox(tr("&Keep aspect ratio")); + keepRatioBox->setChecked(true); + gl->addWidget(keepRatioBox, 3, 1); + + gl->setRowStretch(4, 1); + + updateCanvasSize(unit); + + QHBoxLayout * hl = new QHBoxLayout(plotGeometryPage); + hl->addWidget(gb); +} + +void ConfigDialog::initCurvesPage() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + + curves = new QWidget(); + + curvesGroupBox = new QGroupBox(); + QGridLayout * curvesBoxLayout = new QGridLayout( curvesGroupBox ); + + lblCurveStyle = new QLabel(); + curvesBoxLayout->addWidget( lblCurveStyle, 0, 0 ); + boxCurveStyle = new QComboBox(); + curvesBoxLayout->addWidget( boxCurveStyle, 0, 1 ); + + lblLineWidth = new QLabel(); + curvesBoxLayout->addWidget( lblLineWidth, 1, 0 ); + boxCurveLineWidth = new DoubleSpinBox('f'); + boxCurveLineWidth->setLocale(app->locale()); + boxCurveLineWidth->setSingleStep(0.1); + boxCurveLineWidth->setRange(0.1, 100); + boxCurveLineWidth->setValue(app->defaultCurveLineWidth); + curvesBoxLayout->addWidget( boxCurveLineWidth, 1, 1 ); + + lblLineStyle = new QLabel(); + curvesBoxLayout->addWidget(lblLineStyle, 2, 0); + lineStyleBox = new PenStyleBox(); + lineStyleBox->setCurrentIndex(app->d_curve_line_style); + curvesBoxLayout->addWidget(lineStyleBox, 2, 1); + + fillCurvesGroupBox = new QGroupBox(); + QGridLayout * fillCurvesBoxLayout = new QGridLayout( fillCurvesGroupBox ); + + lblPattern = new QLabel(); + fillCurvesBoxLayout->addWidget(lblPattern, 0, 0); + patternBox = new PatternBox(); + patternBox->setCurrentIndex(app->defaultCurveBrush); + fillCurvesBoxLayout->addWidget(patternBox, 0, 1); + + lblCurveAlpha = new QLabel(); + fillCurvesBoxLayout->addWidget(lblCurveAlpha, 1, 0); + curveAlphaBox = new QSpinBox(); + curveAlphaBox->setRange(0, 255); + curveAlphaBox->setSingleStep(5); + curveAlphaBox->setWrapping(true); + curveAlphaBox->setSpecialValueText(tr("Transparent")); + curveAlphaBox->setValue(app->defaultCurveAlpha); + fillCurvesBoxLayout->addWidget(curveAlphaBox, 1, 1); + + QHBoxLayout *hl0 = new QHBoxLayout(); + hl0->addWidget(curvesGroupBox); + hl0->addWidget(fillCurvesGroupBox); + + symbolGroupBox = new QGroupBox(); + QGridLayout * symbLayout = new QGridLayout(symbolGroupBox); + + lblSymbBox = new QLabel(); + symbLayout->addWidget(lblSymbBox, 0, 0); + + symbolBox = new SymbolBox(); + symbolBox->setCurrentIndex(app->d_symbol_style); + symbolBox->setDisabled(app->d_indexed_symbols); + symbLayout->addWidget(symbolBox, 0, 1); + + lblSymbSize = new QLabel(); + symbLayout->addWidget( lblSymbSize, 1, 0 ); + boxSymbolSize = new QSpinBox(); + boxSymbolSize->setRange(1,100); + boxSymbolSize->setValue(app->defaultSymbolSize/2); + symbLayout->addWidget( boxSymbolSize, 1, 1 ); + + lblSymbEdge = new QLabel(); + symbLayout->addWidget(lblSymbEdge, 0, 2); + + symbolEdgeBox = new DoubleSpinBox('f'); + symbolEdgeBox->setLocale(app->locale()); + symbolEdgeBox->setSingleStep(0.1); + symbolEdgeBox->setRange(0.1, 100); + symbolEdgeBox->setValue(app->defaultSymbolEdge); + symbLayout->addWidget(symbolEdgeBox, 0, 3); + + fillSymbolsBox = new QCheckBox(); + fillSymbolsBox->setChecked(app->d_fill_symbols); + symbLayout->addWidget(fillSymbolsBox, 1, 3); + + QVBoxLayout *curvesPageLayout = new QVBoxLayout(curves); + curvesPageLayout->addLayout(hl0); + curvesPageLayout->addWidget(symbolGroupBox); + + colorsList = new QTableWidget(); + colorsList->setColumnCount(2); + colorsList->horizontalHeader()->setClickable(false); + colorsList->horizontalHeader()->setResizeMode (0, QHeaderView::ResizeToContents); + colorsList->horizontalHeader()->setResizeMode (1, QHeaderView::Stretch); + colorsList->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); + + connect(colorsList, SIGNAL(cellClicked(int, int)), this, SLOT(showColorDialog(int, int))); + connect(colorsList, SIGNAL(cellChanged(int, int)), this, SLOT(changeColorName(int, int))); + + d_indexed_colors = app->indexedColors(); + d_indexed_color_names = app->indexedColorNames(); + setColorsList(d_indexed_colors, d_indexed_color_names); + + QHBoxLayout *hl2 = new QHBoxLayout(); + hl2->setSpacing(0); + hl2->addStretch(); + btnNewColor = new QPushButton(QIcon(":/plus.png"), QString::null); + connect(btnNewColor, SIGNAL(clicked()), this, SLOT(newColor())); + hl2->addWidget(btnNewColor); + + btnRemoveColor = new QPushButton(QIcon(":/delete.png"), QString::null); + connect(btnRemoveColor, SIGNAL(clicked()), this, SLOT(removeColor())); + hl2->addWidget(btnRemoveColor); + + btnColorUp = new QPushButton(QIcon(":/arrow_up.png"), QString::null); + connect(btnColorUp, SIGNAL(clicked()), this, SLOT(moveColor())); + hl2->addWidget(btnColorUp); + + btnColorDown = new QPushButton(QIcon(":/arrow_down.png"), QString::null); + connect(btnColorDown, SIGNAL(clicked()), this, SLOT(moveColorDown())); + hl2->addWidget(btnColorDown); + + btnLoadDefaultColors = new QPushButton(); + connect(btnLoadDefaultColors, SIGNAL(clicked()), this, SLOT(loadDefaultColors())); + hl2->addWidget(btnLoadDefaultColors); + + hl2->addStretch(); + + groupIndexedColors = new QGroupBox(); + QVBoxLayout *vl = new QVBoxLayout(groupIndexedColors); + vl->addWidget(colorsList); + vl->addLayout(hl2); + + symbolsList = new QTableWidget(); + symbolsList->setColumnCount(1); + symbolsList->horizontalHeader()->setClickable(false); + symbolsList->horizontalHeader()->setResizeMode (0, QHeaderView::Stretch); + symbolsList->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); + + d_indexed_symbols = app->indexedSymbols(); + setSymbolsList(d_indexed_symbols); + + groupIndexedSymbols = new QGroupBox(); + groupIndexedSymbols->setCheckable(true); + groupIndexedSymbols->setChecked(app->d_indexed_symbols); + connect(groupIndexedSymbols, SIGNAL(clicked(bool)), symbolBox, SLOT(setDisabled(bool))); + + QVBoxLayout *vl2 = new QVBoxLayout(groupIndexedSymbols); + vl2->addWidget(symbolsList); + + btnSymbolUp = new QPushButton(QIcon(":/arrow_up.png"), QString::null); + connect(btnSymbolUp, SIGNAL(clicked()), this, SLOT(moveSymbol())); + + btnSymbolDown = new QPushButton(QIcon(":/arrow_down.png"), QString::null); + connect(btnSymbolDown, SIGNAL(clicked()), this, SLOT(moveSymbolDown())); + + btnLoadDefaultSymbols = new QPushButton(); + connect(btnLoadDefaultSymbols, SIGNAL(clicked()), this, SLOT(loadDefaultSymbols())); + + QHBoxLayout *hl4 = new QHBoxLayout(); + hl4->setSpacing(0); + hl4->addStretch(); + hl4->addWidget(btnSymbolUp); + hl4->addWidget(btnSymbolDown); + hl4->addWidget(btnLoadDefaultSymbols); + hl4->addStretch(); + vl2->addLayout(hl4); + + QHBoxLayout *hl3 = new QHBoxLayout(); + hl3->addWidget(groupIndexedColors); + hl3->addWidget(groupIndexedSymbols); + + curvesPageLayout->addLayout(hl3); +} + +void ConfigDialog::setSymbolsList(const QList& symbList) +{ + symbolsList->clearContents(); + int rows = symbList.size(); + symbolsList->setRowCount(rows); + for (int i = 0; i < rows; i++){ + SymbolBox *sb = new SymbolBox(false); + sb->setCurrentIndex(symbList[i]); + connect(sb, SIGNAL(activated(SymbolBox *)), this, SLOT(setCurrentSymbol(SymbolBox *))); + connect(sb, SIGNAL(activated(int)), this, SLOT(updateSymbolsList(int))); + symbolsList->setCellWidget(i, 0, sb); + } +} + +void ConfigDialog::loadDefaultSymbols() +{ + d_indexed_symbols = SymbolBox::defaultSymbols(); + setSymbolsList(d_indexed_symbols); +} + +void ConfigDialog::setCurrentSymbol(SymbolBox *sb) +{ + if (!sb) + return; + + int rows = symbolsList->rowCount(); + for (int i = 0; i < rows; i++){ + SymbolBox *b = (SymbolBox*)symbolsList->cellWidget(i, 0); + if (b && sb == b){ + symbolsList->setCurrentCell(i, 0); + break; + } + } +} + +void ConfigDialog::updateSymbolsList(int style) +{ + int row = symbolsList->currentRow(); + if (row >= 0 && row < d_indexed_symbols.size()) + d_indexed_symbols[row] = style; +} + +void ConfigDialog::moveSymbol(bool up) +{ + int row = symbolsList->currentRow(); + if (row < 0 || row >= d_indexed_symbols.size()) + return; + + int destRow = up ? row - 1 : row + 1; + if (destRow < 0 || destRow >= d_indexed_symbols.size()) + return; + + d_indexed_symbols.swap(row, destRow); + setSymbolsList(d_indexed_symbols); + + symbolsList->selectRow(destRow); +} + +void ConfigDialog::setColorsList(const QList& colList, const QStringList& colNames) +{ + colorsList->clearContents(); + + int colors = colList.size(); + colorsList->setRowCount(colors); + for (int i = 0; i < colors; i++){ + QTableWidgetItem *it = new QTableWidgetItem(); + it->setFlags(!Qt::ItemIsEditable); + it->setBackground(QBrush(colList[i])); + colorsList->setItem(i, 0, it); + + it = new QTableWidgetItem(colNames[i]); + it->setForeground(Qt::black); + colorsList->setItem(i, 1, it); + } +} + +void ConfigDialog::moveColor(bool up) +{ + int row = colorsList->currentRow(); + if (row < 0 || row >= d_indexed_colors.size()) + return; + + int destRow = up ? row - 1 : row + 1; + if (destRow < 0 || destRow >= d_indexed_colors.size()) + return; + + d_indexed_colors.swap(row, destRow); + d_indexed_color_names.swap(row, destRow); + setColorsList(d_indexed_colors, d_indexed_color_names); + + colorsList->selectRow(destRow); +} + +void ConfigDialog::moveColorDown() +{ + moveColor(false); +} + +void ConfigDialog::removeColor() +{ + int row = colorsList->currentRow(); + if (row < 0 || row >= d_indexed_colors.size()) + return; + + d_indexed_colors.removeAt(row); + d_indexed_color_names.removeAt(row); + setColorsList(d_indexed_colors, d_indexed_color_names); + + colorsList->selectRow(row); +} + +void ConfigDialog::newColor() +{ + d_indexed_colors << Qt::black; + d_indexed_color_names << tr("New Color"); + setColorsList(d_indexed_colors, d_indexed_color_names); + + int row = colorsList->rowCount() - 1; + colorsList->selectRow(row); + showColorDialog(row, 0); +} + +void ConfigDialog::loadDefaultColors() +{ + d_indexed_colors = ColorBox::defaultColors(); + d_indexed_color_names = ColorBox::defaultColorNames(); + setColorsList(d_indexed_colors, d_indexed_color_names); + colorsList->selectRow(0); +} + +void ConfigDialog::showColorDialog(int row, int col) +{ + if (col) + return; + + QColor c = QColor(d_indexed_colors[row]); + QColor color = QColorDialog::getColor(c, this); + if (!color.isValid() || color == c) + return; + + d_indexed_colors[row] = color; + setColorsList(d_indexed_colors, d_indexed_color_names); +} + +void ConfigDialog::changeColorName(int row, int col) +{ + if (col != 1) + return; + + QTableWidgetItem *it = colorsList->item(row, 1); + if (!it) + return; + + d_indexed_color_names[row] = it->text(); +} + +void ConfigDialog::initAxesPage() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + if (!app) + return; + + axesPage = new QWidget(); + + QGroupBox * axisOptions = new QGroupBox(); + QGridLayout * axisOptionsLayout = new QGridLayout( axisOptions ); + + boxBackbones = new QCheckBox(); + boxBackbones->setChecked(app->drawBackbones); + axisOptionsLayout->addWidget(boxBackbones, 0, 0); + + boxSynchronizeScales = new QCheckBox(); + boxSynchronizeScales->setChecked(app->d_synchronize_graph_scales); + axisOptionsLayout->addWidget(boxSynchronizeScales, 0, 1); + + lblAxesLineWidth = new QLabel(); + axisOptionsLayout->addWidget(lblAxesLineWidth, 1, 0); + boxLineWidth= new QSpinBox(); + boxLineWidth->setRange(0, 100); + boxLineWidth->setValue(app->axesLineWidth); + axisOptionsLayout->addWidget(boxLineWidth, 1, 1); + + labelGraphAxesLabelsDist = new QLabel(); + axisOptionsLayout->addWidget(labelGraphAxesLabelsDist, 2, 0); + boxAxesLabelsDist = new QSpinBox(); + boxAxesLabelsDist->setRange(0, 1000); + boxAxesLabelsDist->setValue(app->d_graph_axes_labels_dist); + axisOptionsLayout->addWidget(boxAxesLabelsDist, 2, 1); + + labelTickLabelsDist = new QLabel(); + axisOptionsLayout->addWidget(labelTickLabelsDist, 3, 0); + boxTickLabelsDist = new QSpinBox(); + boxTickLabelsDist->setRange(0, 1000); + boxTickLabelsDist->setValue(app->d_graph_tick_labels_dist); + axisOptionsLayout->addWidget(boxTickLabelsDist, 3, 1); + axisOptionsLayout->setRowStretch(4, 1); + + enabledAxesGroupBox = new QGroupBox(); + enabledAxesGrid = new QGridLayout( enabledAxesGroupBox ); + + enableAxisLabel = new QLabel(); + enabledAxesGrid->addWidget(enableAxisLabel, 0, 2); + showNumbersLabel = new QLabel(); + enabledAxesGrid->addWidget(showNumbersLabel, 0, 3); + + QLabel *pixLabel = new QLabel(); + pixLabel->setPixmap (QPixmap (":/left_axis.png")); + enabledAxesGrid->addWidget(pixLabel, 1, 0); + yLeftLabel = new QLabel(); + enabledAxesGrid->addWidget(yLeftLabel, 1, 1); + + pixLabel = new QLabel(); + pixLabel->setPixmap (QPixmap (":/right_axis.png")); + enabledAxesGrid->addWidget(pixLabel, 2, 0); + yRightLabel = new QLabel(); + enabledAxesGrid->addWidget(yRightLabel, 2, 1); + + pixLabel = new QLabel(); + pixLabel->setPixmap (QPixmap (":/bottom_axis.png")); + enabledAxesGrid->addWidget(pixLabel, 3, 0); + xBottomLabel = new QLabel(); + enabledAxesGrid->addWidget(xBottomLabel, 3, 1); + + pixLabel = new QLabel(); + pixLabel->setPixmap (QPixmap (":/top_axis.png")); + enabledAxesGrid->addWidget(pixLabel, 4, 0); + xTopLabel = new QLabel(); + enabledAxesGrid->addWidget(xTopLabel, 4, 1); + + for (int i = 0; i < QwtPlot::axisCnt; i++){ + QCheckBox *box1 = new QCheckBox(); + int row = i + 1; + + enabledAxesGrid->addWidget(box1, row, 2); + bool enabledAxis = app->d_show_axes[i]; + box1->setChecked(enabledAxis); + + QCheckBox *box2 = new QCheckBox(); + enabledAxesGrid->addWidget(box2, row, 3); + box2->setChecked(app->d_show_axes_labels[i]); + box2->setEnabled(enabledAxis); + + connect(box1, SIGNAL(toggled(bool)), box2, SLOT(setEnabled(bool))); + } + enabledAxesGrid->setColumnStretch (0, 0); + enabledAxesGrid->setColumnStretch (1, 1); + enabledAxesGrid->setColumnStretch (2, 1); + + QVBoxLayout * axesPageLayout = new QVBoxLayout( axesPage ); + axesPageLayout->addWidget(axisOptions); + axesPageLayout->addWidget(enabledAxesGroupBox); +} + +void ConfigDialog::initConfirmationsPage() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + confirm = new QWidget(); + + groupBoxConfirm = new QGroupBox(); + QVBoxLayout * layout = new QVBoxLayout( groupBoxConfirm ); + + boxFolders = new QCheckBox(); + boxFolders->setChecked(app->confirmCloseFolder); + layout->addWidget( boxFolders ); + + boxTables = new QCheckBox(); + boxTables->setChecked(app->confirmCloseTable); + layout->addWidget( boxTables ); + + boxMatrices = new QCheckBox(); + boxMatrices->setChecked(app->confirmCloseMatrix); + layout->addWidget( boxMatrices ); + + boxPlots2D = new QCheckBox(); + boxPlots2D->setChecked(app->confirmClosePlot2D); + layout->addWidget( boxPlots2D ); + + boxPlots3D = new QCheckBox(); + boxPlots3D->setChecked(app->confirmClosePlot3D); + layout->addWidget( boxPlots3D ); + + boxNotes = new QCheckBox(); + boxNotes->setChecked(app->confirmCloseNotes); + layout->addWidget( boxNotes ); + layout->addStretch(); + + boxPromptRenameTables = new QCheckBox(); + boxPromptRenameTables->setChecked(app->d_inform_rename_table); + + boxConfirmOverwrite = new QCheckBox(); + boxConfirmOverwrite->setChecked(app->d_confirm_overwrite); + + QVBoxLayout * confirmPageLayout = new QVBoxLayout( confirm ); + confirmPageLayout->addWidget(groupBoxConfirm); + confirmPageLayout->addWidget(boxPromptRenameTables); + confirmPageLayout->addWidget(boxConfirmOverwrite); + confirmPageLayout->addStretch(); +} + +void ConfigDialog::initFileLocationsPage() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + fileLocationsPage = new QWidget(); + + QCompleter *completer = new QCompleter(this); + completer->setModel(new QDirModel(completer)); + completer->setModelSorting(QCompleter::CaseSensitivelySortedModel); + completer->setCompletionMode(QCompleter::InlineCompletion); + + QGroupBox *gb = new QGroupBox(); + QGridLayout *gl = new QGridLayout(gb); + + lblTranslationsPath = new QLabel(tr("Translations")); + gl->addWidget(lblTranslationsPath , 0, 0); + + translationsPathLine = new QLineEdit(); + translationsPathLine->setText(QDir::toNativeSeparators(app->d_translations_folder)); + translationsPathLine->setCompleter(completer); + gl->addWidget(translationsPathLine, 0, 1); + + QPushButton *browseTranslationsBtn = new QPushButton(); + browseTranslationsBtn->setIcon(QIcon(":/folder_open.png")); + gl->addWidget(browseTranslationsBtn, 0, 2); + + lblHelpPath = new QLabel(tr("Help")); + gl->addWidget(lblHelpPath, 1, 0 ); + + QFileInfo hfi(app->helpFilePath); + helpPathLine = new QLineEdit(QDir::toNativeSeparators(hfi.dir().absolutePath())); + helpPathLine->setCompleter(completer); + gl->addWidget( helpPathLine, 1, 1); + + QPushButton *browseHelpBtn = new QPushButton(); + browseHelpBtn->setIcon(QIcon(":/folder_open.png")); + gl->addWidget(browseHelpBtn, 1, 2); + + texCompilerLabel = new QLabel(tr("LaTeX Compiler")); + gl->addWidget(texCompilerLabel, 2, 0); + + texCompilerPathBox = new QLineEdit(QDir::toNativeSeparators(app->d_latex_compiler_path)); + texCompilerPathBox->setCompleter(completer); + connect(texCompilerPathBox, SIGNAL(editingFinished ()), this, SLOT(validateTexCompiler())); + + gl->addWidget(texCompilerPathBox, 2, 1); + + browseTexCompilerBtn = new QPushButton; + browseTexCompilerBtn->setIcon(QIcon(":/folder_open.png")); + connect(browseTexCompilerBtn, SIGNAL(clicked()), this, SLOT(chooseTexCompiler())); + + gl->addWidget(browseTexCompilerBtn, 2, 2); + gl->setRowStretch(3, 1); + +#ifdef SCRIPTING_PYTHON + lblPythonConfigDir = new QLabel(tr("Python Configuration Files")); + gl->addWidget(lblPythonConfigDir, 3, 0); + + pythonConfigDirLine = new QLineEdit(QDir::toNativeSeparators(app->d_python_config_folder)); + pythonConfigDirLine->setCompleter(completer); + gl->addWidget(pythonConfigDirLine, 3, 1); + + QPushButton *browsePythonConfigBtn = new QPushButton(); + browsePythonConfigBtn->setIcon(QIcon(":/folder_open.png")); + connect(browsePythonConfigBtn, SIGNAL(clicked()), this, SLOT(choosePythonConfigFolder())); + gl->addWidget(browsePythonConfigBtn, 3, 2); + gl->setRowStretch(4, 1); +#endif + + + QVBoxLayout *vl = new QVBoxLayout(fileLocationsPage); + vl->addWidget(gb); + + appTabWidget->addTab(fileLocationsPage, QString()); + + connect(browseTranslationsBtn, SIGNAL(clicked()), this, SLOT(chooseTranslationsFolder())); + connect(browseHelpBtn, SIGNAL(clicked()), this, SLOT(chooseHelpFolder())); +} + +void ConfigDialog::languageChange() +{ + setWindowTitle( tr( "QtiPlot - Choose default settings" ) ); + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + + // pages list + itemsList->clear(); + itemsList->addItem( tr( "General" ) ); + itemsList->addItem( tr( "Tables" ) ); + itemsList->addItem( tr( "2D Plots" ) ); + itemsList->addItem( tr( "3D Plots" ) ); + itemsList->addItem( tr( "Notes" ) ); + itemsList->addItem( tr( "Fitting" ) ); + itemsList->setCurrentRow(0); + itemsList->item(0)->setIcon(QIcon(":/general.png")); + itemsList->item(1)->setIcon(QIcon(":/configTable.png")); + itemsList->item(2)->setIcon(QIcon(":/config_curves.png")); + itemsList->item(3)->setIcon(QIcon(":/logo.png")); + itemsList->item(4)->setIcon(QIcon(":/notes_32.png")); + itemsList->item(5)->setIcon(QIcon(":/fit.png")); + + //plots 2D page + plotsTabWidget->setTabText(plotsTabWidget->indexOf(plotOptions), tr("Options")); + plotsTabWidget->setTabText(plotsTabWidget->indexOf(curves), tr("Curves")); + plotsTabWidget->setTabText(plotsTabWidget->indexOf(axesPage), tr("Axes")); + plotsTabWidget->setTabText(plotsTabWidget->indexOf(plotTicks), tr("Ticks")); + plotsTabWidget->setTabText(plotsTabWidget->indexOf(plotGeometryPage), tr("Geometry")); + plotsTabWidget->setTabText(plotsTabWidget->indexOf(plotFonts), tr("Fonts")); + + boxResize->setText(tr("Do not &resize layers when window size changes")); + boxLabelsEditing->setText(tr("&Disable in-place editing")); + lblMinTicksLength->setText(tr("Length")); + + lblMajTicksLength->setText(tr("Length" )); + lblMajTicks->setText(tr("Major Ticks" )); + lblMinTicks->setText(tr("Minor Ticks" )); + + lblMargin->setText(tr("Margin" )); + labelGraphAxesLabelsDist->setText(tr("Axes title space" )); + labelTickLabelsDist->setText(tr("Ticks - Labels space" )); + boxAxesLabelsDist->setSuffix(" " + tr("pixels")); + boxTickLabelsDist->setSuffix(" " + tr("pixels")); + labelFrameWidth->setText(tr("Frame width" )); + boxFrame->setText(tr("Canvas Fra&me")); + boxTitle->setText(tr("Show &Title")); + boxScaleFonts->setText(tr("Scale &Fonts")); + boxAutoscaling->setText(tr("Auto&scaling")); + boxAntialiasing->setText(tr("Antia&liasing")); + + legendDisplayLabel->setText(tr("Legend display" )); + legendDisplayBox->clear(); + legendDisplayBox->addItem(tr("Column name")); + legendDisplayBox->addItem(tr("Column comment")); + legendDisplayBox->addItem(tr("Table name")); + legendDisplayBox->addItem(tr("Table legend")); + legendDisplayBox->setCurrentIndex(app->d_graph_legend_display); + + lblAxisLabeling->setText(tr("Axis title" )); + axisLabelingBox->clear(); + axisLabelingBox->addItem(tr("Default")); + axisLabelingBox->addItem(tr("Column name")); + axisLabelingBox->addItem(tr("Column comment")); + axisLabelingBox->addItem(tr("Column name") + " (" + tr("Column comment") + ")"); + axisLabelingBox->setCurrentIndex(app->d_graph_axis_labeling); + + groupBackgroundOptions->setTitle(tr("Background")); + labelGraphBkgColor->setText(tr("Background Color")); + labelGraphBkgOpacity->setText(tr( "Opacity" )); + labelGraphCanvasColor->setText(tr("Canvas Color" )); + labelGraphCanvasOpacity->setText(tr("Opacity")); + labelGraphFrameColor->setText(tr("Border Color")); + labelGraphFrameWidth->setText(tr( "Width" )); + boxBackgroundTransparency->setSpecialValueText(tr("Transparent")); + boxCanvasTransparency->setSpecialValueText(tr("Transparent")); + + unitBoxLabel->setText(tr("Unit")); + unitBox->clear(); + unitBox->insertItem(tr("inch")); + unitBox->insertItem(tr("mm")); + unitBox->insertItem(tr("cm")); + unitBox->insertItem(tr("point")); + unitBox->insertItem(tr("pixel")); + unitBox->setCurrentIndex(app->d_layer_geometry_unit); + + canvasWidthLabel->setText(tr("Canvas Width")); + canvasHeightLabel->setText(tr("Canvas Height")); + keepRatioBox->setText(tr("&Keep aspect ratio")); + + // axes page + boxBackbones->setText(tr("Axes &backbones")); + boxSynchronizeScales->setText(tr("Synchronize scale &divisions")); + lblAxesLineWidth->setText(tr("Axes linewidth" )); + + yLeftLabel->setText(tr("Left")); + yRightLabel->setText(tr("Right")); + xBottomLabel->setText(tr("Bottom")); + xTopLabel->setText(tr("Top")); + + enabledAxesGroupBox->setTitle(tr("Enabled axes" )); + enableAxisLabel->setText(tr( "Show" )); + showNumbersLabel->setText(tr( "Labels" )); + + boxMajTicks->clear(); + boxMajTicks->addItem(tr("None")); + boxMajTicks->addItem(tr("Out")); + boxMajTicks->addItem(tr("In & Out")); + boxMajTicks->addItem(tr("In")); + + boxMinTicks->clear(); + boxMinTicks->addItem(tr("None")); + boxMinTicks->addItem(tr("Out")); + boxMinTicks->addItem(tr("In & Out")); + boxMinTicks->addItem(tr("In")); + + boxMajTicks->setCurrentIndex(app->majTicksStyle); + boxMinTicks->setCurrentIndex(app->minTicksStyle); + + plotsTabWidget->setTabText(plotsTabWidget->indexOf(plotPrint), tr("Print")); + boxPrintCropmarks->setText(tr("Print Crop&marks")); + boxScaleLayersOnPrint->setText(tr("&Scale layers to paper size")); + + //confirmations page + groupBoxConfirm->setTitle(tr("Prompt on closing")); + boxFolders->setText(tr("Folders")); + boxTables->setText(tr("Tables")); + boxPlots3D->setText(tr("3D Plots")); + boxPlots2D->setText(tr("2D Plots")); + boxMatrices->setText(tr("Matrices")); + boxNotes->setText(tr("&Notes")); + + buttonOk->setText( tr( "&OK" ) ); + buttonCancel->setText( tr( "&Cancel" ) ); + buttonApply->setText( tr( "&Apply" ) ); + buttonTextFont->setText( tr( "&Text Font" ) ); + buttonHeaderFont->setText( tr( "&Labels Font" ) ); + buttonAxesFont->setText( tr( "A&xes Labels" ) ); + buttonNumbersFont->setText( tr( "Axes &Numbers" ) ); + buttonLegendFont->setText( tr( "&Legend" ) ); + buttonTitleFont->setText( tr( "T&itle" ) ); + boxPromptRenameTables->setText( tr( "Prompt on &renaming tables when appending projects" ) ); + boxConfirmOverwrite->setText( tr( "Ask before over&writing files" ) ); + + //application page + appTabWidget->setTabText(appTabWidget->indexOf(application), tr("Application")); + appTabWidget->setTabText(appTabWidget->indexOf(confirm), tr("Confirmations")); + appTabWidget->setTabText(appTabWidget->indexOf(appColors), tr("Colors")); + appTabWidget->setTabText(appTabWidget->indexOf(numericFormatPage), tr("Numeric Format")); + appTabWidget->setTabText(appTabWidget->indexOf(fileLocationsPage), tr("File Locations")); + appTabWidget->setTabText(appTabWidget->indexOf(proxyPage), tr("&Internet Connection")); + + lblLanguage->setText(tr("Language")); + lblStyle->setText(tr("Style")); + lblFonts->setText(tr("Main Font")); + fontsBtn->setText(tr("Choose &font")); + lblWorkspace->setText(tr("Workspace")); + lblPanelsText->setText(tr("Panels text")); + lblPanels->setText(tr("Panels")); + boxSave->setText(tr("Save every")); + boxBackupProject->setText(tr("&Backup project before saving")); + boxSearchUpdates->setText(tr("Check for new versions at startup")); + boxMinutes->setSuffix(tr(" minutes")); + lblScriptingLanguage->setText(tr("Default scripting language")); + lblUndoStackSize->setText(tr("Matrix Undo Stack Size")); + lblEndOfLine->setText(tr("Endline character")); + lblInitWindow->setText(tr("Start New Project")); + boxInitWindow->clear(); + boxInitWindow->addItem(tr("Empty")); + boxInitWindow->addItem(tr("Table")); + boxInitWindow->addItem(tr("Matrix")); + boxInitWindow->addItem(tr("Empty Graph")); + boxInitWindow->addItem(tr("Note")); + boxInitWindow->setCurrentIndex((int)app->d_init_window_type); + completionBox->setText(tr("&Enable autocompletion (Ctrl+U)")); + + lblAppPrecision->setText(tr("Number of Decimal Digits")); + lblDecimalSeparator->setText(tr("Decimal Separators")); + boxDecimalSeparator->clear(); + boxDecimalSeparator->addItem(tr("System Locale Setting")); + boxDecimalSeparator->addItem("1,000.0"); + boxDecimalSeparator->addItem("1.000,0"); + boxDecimalSeparator->addItem("1 000,0"); + boxThousandsSeparator->setText(tr("Omit &Thousands Separator")); + boxMuParserCLocale->setText(tr("mu&Parser uses C locale settings")); + + QLocale locale = app->locale(); + if (locale.name() == QLocale::c().name()) + boxDecimalSeparator->setCurrentIndex(1); + else if (locale.name() == QLocale(QLocale::German).name()) + boxDecimalSeparator->setCurrentIndex(2); + else if (locale.name() == QLocale(QLocale::French).name()) + boxDecimalSeparator->setCurrentIndex(3); + + lblClipboardSeparator->setText(tr("Clipboard Decimal Separators")); + boxClipboardLocale->clear(); + boxClipboardLocale->addItem(tr("System Locale Setting")); + boxClipboardLocale->addItem("1,000.0"); + boxClipboardLocale->addItem("1.000,0"); + boxClipboardLocale->addItem("1 000,0"); + + if (app->clipboardLocale().name() == QLocale::c().name()) + boxClipboardLocale->setCurrentIndex(1); + else if (app->clipboardLocale().name() == QLocale(QLocale::German).name()) + boxClipboardLocale->setCurrentIndex(2); + else if (app->clipboardLocale().name() == QLocale(QLocale::French).name()) + boxClipboardLocale->setCurrentIndex(3); + + lblTranslationsPath->setText(tr("Translations")); + lblHelpPath->setText(tr("Help")); +#ifdef SCRIPTING_PYTHON + lblPythonConfigDir->setText(tr("Python Configuration Files")); +#endif + + //proxy tab + proxyGroupBox->setTitle(tr("&Proxy")); + proxyHostLabel->setText(tr("Host")); + proxyPortLabel->setText(tr("Port")); + proxyUserLabel->setText(tr("Username")); + proxyPasswordLabel->setText(tr("Password")); + + //tables page + boxUpdateTableValues->setText(tr("Automatically &Recalculate Column Values")); + boxTableComments->setText(tr("&Display Comments in Header")); + groupBoxTableCol->setTitle(tr("Colors")); + lblSeparator->setText(tr("Default Column Separator")); + boxSeparator->clear(); + boxSeparator->addItem(tr("TAB")); + boxSeparator->addItem(tr("SPACE")); + boxSeparator->addItem(";" + tr("TAB")); + boxSeparator->addItem("," + tr("TAB")); + boxSeparator->addItem(";" + tr("SPACE")); + boxSeparator->addItem("," + tr("SPACE")); + boxSeparator->addItem(";"); + boxSeparator->addItem(","); + setColumnSeparator(app->columnSeparator); + + lblTableBackground->setText(tr( "Background" )); + lblTextColor->setText(tr( "Text" )); + lblHeaderColor->setText(tr("Labels")); + groupBoxTableFonts->setTitle(tr("Fonts")); + + //curves page + lblCurveStyle->setText(tr( "Default curve style" )); + lblLineWidth->setText(tr( "Line width" )); + lblSymbSize->setText(tr( "Symbol size" )); + btnLoadDefaultColors->setText(tr("&Load Default")); + btnNewColor->setToolTip(tr("New Color")); + btnRemoveColor->setToolTip(tr("Delete Color")); + btnColorUp->setToolTip(tr("Move Color Up")); + btnColorDown->setToolTip(tr("Move Color Down")); + groupIndexedColors->setTitle(tr("Indexed Colors")); + groupIndexedSymbols->setTitle(tr("Inde&xed Symbols")); + btnLoadDefaultSymbols->setText(tr("&Load Default")); + btnSymbolUp->setToolTip(tr("Move Symbol Up")); + btnSymbolDown->setToolTip(tr("Move Symbol Down")); + lblPattern->setText(tr("Pattern")); + lblCurveAlpha->setText(tr("Opacity")); + lblLineStyle->setText(tr("Line style")); + fillCurvesGroupBox->setTitle(tr("Fill area under curve")); + curvesGroupBox->setTitle(tr("Default Line Style")); + + symbolGroupBox->setTitle(tr("Default Symbol")); + lblSymbBox->setText(tr("Style")); + lblSymbEdge->setText(tr("Edge width")); + fillSymbolsBox->setText(tr("&Fill Symbol")); + + QStringList header = QStringList() << tr("Color") << tr("Name"); + colorsList->setHorizontalHeaderLabels(header); + header = QStringList() << tr("Symbol"); + symbolsList->setHorizontalHeaderLabels(header); + + boxCurveStyle->clear(); + boxCurveStyle->addItem( QPixmap(":/lPlot.png"), tr( " Line" ) ); + boxCurveStyle->addItem( QPixmap(":/pPlot.png"), tr( " Scatter" ) ); + boxCurveStyle->addItem( QPixmap(":/lpPlot.png"), tr( " Line + Symbol" ) ); + boxCurveStyle->addItem( QPixmap(":/dropLines.png"), tr( " Vertical drop lines" ) ); + boxCurveStyle->addItem( QPixmap(":/spline.png"), tr( " Spline" ) ); + boxCurveStyle->addItem( QPixmap(":/vert_steps.png"), tr( " Vertical steps" ) ); + boxCurveStyle->addItem( QPixmap(":/hor_steps.png"), tr( " Horizontal steps" ) ); + boxCurveStyle->addItem( QPixmap(":/area.png"), tr( " Area" ) ); + boxCurveStyle->addItem( QPixmap(":/vertBars.png"), tr( " Vertical Bars" ) ); + boxCurveStyle->addItem( QPixmap(":/hBars.png"), tr( " Horizontal Bars" ) ); + + int style = app->defaultCurveStyle; + if (style == Graph::Line) + boxCurveStyle->setCurrentItem(0); + else if (style == Graph::Scatter) + boxCurveStyle->setCurrentItem(1); + else if (style == Graph::LineSymbols) + boxCurveStyle->setCurrentItem(2); + else if (style == Graph::VerticalDropLines) + boxCurveStyle->setCurrentItem(3); + else if (style == Graph::Spline) + boxCurveStyle->setCurrentItem(4); + else if (style == Graph::VerticalSteps) + boxCurveStyle->setCurrentItem(5); + else if (style == Graph::HorizontalSteps) + boxCurveStyle->setCurrentItem(6); + else if (style == Graph::Area) + boxCurveStyle->setCurrentItem(7); + else if (style == Graph::VerticalBars) + boxCurveStyle->setCurrentItem(8); + else if (style == Graph::HorizontalBars) + boxCurveStyle->setCurrentItem(9); + + //plots 3D + lblResolution->setText(tr("&Resolution")); + boxResolution->setSpecialValueText( "1 " + tr("(all data shown)") ); + boxShowLegend->setText(tr( "&Show Legend" )); + lblFloorStyle->setText(tr( "&Floor style" )); + boxProjection->clear(); + boxProjection->addItem(tr( "Empty" )); + boxProjection->addItem(tr( "Isolines" )); + boxProjection->addItem(tr( "Projection" )); + boxProjection->setCurrentIndex(app->d_3D_projection); + + boxSmoothMesh->setText(tr( "Smoot&h Line" )); + boxOrthogonal->setText(tr( "O&rthogonal" )); + btnLabels->setText( tr( "Lab&els" ) ); + btnMesh->setText( tr( "&Mesh" ) ); + btnGrid->setText( tr( "&Grid" ) ); + btnNumbers->setText( tr( "&Numbers" ) ); + btnAxes->setText( tr( "A&xes" ) ); + btnBackground3D->setText( tr( "&Background" ) ); + groupBox3DCol->setTitle(tr("Colors" )); + colorMapBox->setTitle(tr("Default Color Map" )); + + groupBox3DFonts->setTitle(tr("Fonts" )); + btnTitleFnt->setText( tr( "&Title" ) ); + btnLabelsFnt->setText( tr( "&Axes Labels" ) ); + btnNumFnt->setText( tr( "&Numbers" ) ); + boxAutoscale3DPlots->setText( tr( "Autosca&ling" ) ); + + groupBox3DGrids->setTitle(tr("Grids")); + boxMajorGrids->setText(tr("Ma&jor Grids")); + boxMinorGrids->setText(tr("Mi&nor Grids")); + + boxMajorGridStyle->clear(); + boxMajorGridStyle->addItem(tr("Solid")); + boxMajorGridStyle->addItem(tr("Dash")); + boxMajorGridStyle->addItem(tr("Dot")); + boxMajorGridStyle->addItem(tr("Dash Dot")); + boxMajorGridStyle->addItem(tr("Dash Dot Dot")); + boxMajorGridStyle->addItem(tr("Short Dash")); + boxMajorGridStyle->addItem(tr("Short Dot")); + boxMajorGridStyle->addItem(tr("Short Dash Dot")); + boxMajorGridStyle->setCurrentIndex(app->d_3D_major_style); + + boxMinorGridStyle->clear(); + boxMinorGridStyle->addItem(tr("Solid")); + boxMinorGridStyle->addItem(tr("Dash")); + boxMinorGridStyle->addItem(tr("Dot")); + boxMinorGridStyle->addItem(tr("Dash Dot")); + boxMinorGridStyle->addItem(tr("Dash Dot Dot")); + boxMinorGridStyle->addItem(tr("Short Dash")); + boxMinorGridStyle->addItem(tr("Short Dot")); + boxMinorGridStyle->addItem(tr("Short Dash Dot")); + boxMinorGridStyle->setCurrentIndex(app->d_3D_minor_style); + + label3DGridsColor->setText(tr("Color")); + label3DGridsWidth->setText(tr("Width")); + label3DGridsStyle->setText(tr("Style")); + + //Notes page + labelTabLength->setText(tr("Tab length (pixels)")); + labelNotesFont->setText(tr("Font")); + lineNumbersBox->setText(tr("&Display line numbers")); + + groupSyntaxHighlighter->setTitle(tr("Syntax Highlighting")); + buttonCommentLabel->setText(tr("Co&mments")); + buttonKeywordLabel->setText(tr("&Keywords")); + buttonNumericLabel->setText(tr("&Numbers")); + buttonQuotationLabel->setText(tr("&Quotations")); + buttonFunctionLabel->setText(tr("&Functions")); + buttonClassLabel->setText(tr("Q&t Classes")); + + //Fitting page + groupBoxFittingCurve->setTitle(tr("Generated Fit Curve")); + generatePointsBtn->setText(tr("Uniform X Function")); + lblPoints->setText( tr("Points") ); + samePointsBtn->setText( tr( "Same X as Fitting Data" ) ); + linearFit2PointsBox->setText( tr( "2 points for linear fits" ) ); + + groupBoxMultiPeak->setTitle(tr("Display Peak Curves for Multi-peak Fits")); + + groupBoxFitParameters->setTitle(tr("Parameters Output")); + lblPrecision->setText(tr("Significant Digits")); + logBox->setText(tr("Write Parameters to Result Log")); + plotLabelBox->setText(tr("Paste Parameters to Plot")); + scaleErrorsBox->setText(tr("Scale Errors with sqrt(Chi^2/doF)")); + groupBoxMultiPeak->setTitle(tr("Display Peak Curves for Multi-peak Fits")); + lblPeaksColor->setText(tr("Peaks Color")); + + boxMultiPeakMsgs->setText(tr("Display Confirmation &Messages for Multi-peak Fits")); + + updateMenuList(); +} + +void ConfigDialog::accept() +{ + apply(); + close(); +} + +void ConfigDialog::apply() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + if (!app) + return; + + // tables page + QString sep = boxSeparator->currentText(); + sep.replace(tr("TAB"), "\t", false); + sep.replace("\\t", "\t"); + sep.replace(tr("SPACE"), " "); + sep.replace("\\s", " "); + + if (sep.contains(QRegExp("[0-9.eE+-]"))!=0){ + QMessageBox::warning(0, tr("QtiPlot - Import options error"), + tr("The separator must not contain the following characters: 0-9eE.+-")); + return; + } + + app->columnSeparator = sep; + app->setAutoUpdateTableValues(boxUpdateTableValues->isChecked()); + + app->tableBkgdColor = buttonBackground->color(); + app->tableTextColor = buttonText->color(); + app->tableHeaderColor = buttonHeader->color(); + app->tableTextFont = textFont; + app->tableHeaderFont = headerFont; + app->d_show_table_comments = boxTableComments->isChecked(); + + QColorGroup cg; + cg.setColor(QColorGroup::Base, buttonBackground->color()); + cg.setColor(QColorGroup::Text, buttonText->color()); + QPalette palette(cg, cg, cg); + + QList windows = app->windowsList(); + foreach(MdiSubWindow *w, windows){ + if (w->inherits("Table")){ + Table *t = (Table*)w; + w->setPalette(palette); + t->setHeaderColor(buttonHeader->color()); + t->setTextFont(textFont); + t->setHeaderFont(headerFont); + t->showComments(boxTableComments->isChecked()); + } + } + + app->d_graph_background_color = boxBackgroundColor->color(); + app->d_graph_background_opacity = boxBackgroundTransparency->value(); + app->d_graph_canvas_color = boxCanvasColor->color(); + app->d_graph_canvas_opacity = boxCanvasTransparency->value(); + app->d_graph_border_color = boxBorderColor->color(); + app->d_graph_border_width = boxBorderWidth->value(); + + // 2D plots page: options tab + app->d_in_place_editing = !boxLabelsEditing->isChecked(); + app->titleOn = boxTitle->isChecked(); + + if (boxFrame->isChecked()) + app->canvasFrameWidth = boxFrameWidth->value(); + else + app->canvasFrameWidth = 0; + + app->defaultPlotMargin = boxMargin->value(); + app->d_graph_axes_labels_dist = boxAxesLabelsDist->value(); + app->d_graph_tick_labels_dist = boxTickLabelsDist->value(); + app->d_graph_legend_display = (Graph::LegendDisplayMode)legendDisplayBox->currentIndex(); + app->d_graph_axis_labeling = (Graph::AxisTitlePolicy)axisLabelingBox->currentIndex(); + app->setGraphDefaultSettings(boxAutoscaling->isChecked(), boxScaleFonts->isChecked(), + boxResize->isChecked(), boxAntialiasing->isChecked()); + // 2D plots page: curves tab + app->defaultCurveStyle = curveStyle(); + app->defaultCurveLineWidth = boxCurveLineWidth->value(); + app->defaultSymbolSize = 2*boxSymbolSize->value() + 1; + app->setIndexedColors(d_indexed_colors); + app->setIndexedColorNames(d_indexed_color_names); + app->d_indexed_symbols = groupIndexedSymbols->isChecked(); + app->d_fill_symbols = fillSymbolsBox->isChecked(); + app->defaultSymbolEdge = symbolEdgeBox->value(); + app->d_symbol_style = symbolBox->currentIndex(); + app->setIndexedSymbols(d_indexed_symbols); + app->defaultCurveBrush = patternBox->currentIndex(); + app->defaultCurveAlpha = curveAlphaBox->value(); + app->d_curve_line_style = lineStyleBox->currentIndex(); + + // 2D plots page: axes tab + if (generalDialog->currentWidget() == plotsTabWidget && + plotsTabWidget->currentWidget() == axesPage){ + app->drawBackbones = boxBackbones->isChecked(); + app->axesLineWidth = boxLineWidth->value(); + app->d_synchronize_graph_scales = boxSynchronizeScales->isChecked(); + + for (int i = 0; i < QwtPlot::axisCnt; i++){ + int row = i + 1; + QLayoutItem *item = enabledAxesGrid->itemAtPosition(row, 2); + QCheckBox *box = qobject_cast(item->widget()); + app->d_show_axes[i] = box->isChecked(); + + item = enabledAxesGrid->itemAtPosition(row, 3); + box = qobject_cast(item->widget()); + app->d_show_axes_labels[i] = box->isChecked(); + } + } + + if (generalDialog->currentWidget() == plotsTabWidget && + plotsTabWidget->currentWidget() == plotGeometryPage){ + app->d_layer_geometry_unit = unitBox->currentIndex(); + FrameWidget::Unit unit = (FrameWidget::Unit)unitBox->currentIndex(); + app->d_layer_canvas_width = convertToPixels(boxCanvasWidth->value(), unit, 0); + app->d_layer_canvas_height = convertToPixels(boxCanvasHeight->value(), unit, 1); + } + + // 2D plots page: ticks tab + app->majTicksLength = boxMajTicksLength->value(); + app->minTicksLength = boxMinTicksLength->value(); + app->majTicksStyle = boxMajTicks->currentItem(); + app->minTicksStyle = boxMinTicks->currentItem(); + // 2D plots page: fonts tab + app->plotAxesFont=axesFont; + app->plotNumbersFont=numbersFont; + app->plotLegendFont=legendFont; + app->plotTitleFont=titleFont; + // 2D plots page: print tab + app->d_print_cropmarks = boxPrintCropmarks->isChecked(); + app->d_scale_plots_on_print = boxScaleLayersOnPrint->isChecked(); + foreach(MdiSubWindow *w, windows){ + MultiLayer *ml = qobject_cast(w); + if (ml){ + ml->setScaleLayersOnPrint(boxScaleLayersOnPrint->isChecked()); + ml->printCropmarks(boxPrintCropmarks->isChecked()); + foreach(Graph *g, ml->layersList()){ + g->setSynchronizedScaleDivisions(app->d_synchronize_graph_scales); + g->setAxisTitlePolicy(app->d_graph_axis_labeling); + } + } + } + // general page: application tab + app->changeAppFont(appFont); + setFont(appFont); + app->changeAppStyle(boxStyle->currentText()); + app->autoSearchUpdates = boxSearchUpdates->isChecked(); + app->setSaveSettings(boxSave->isChecked(), boxMinutes->value()); + app->d_backup_files = boxBackupProject->isChecked(); + app->defaultScriptingLang = boxScriptingLanguage->currentText(); + app->d_init_window_type = (ApplicationWindow::WindowType)boxInitWindow->currentIndex(); + app->setMatrixUndoStackSize(undoStackSizeBox->value()); + app->d_eol = (ApplicationWindow::EndLineChar)boxEndLine->currentIndex(); + app->enableCompletion(completionBox->isChecked()); + + // general page: numeric format tab + app->d_decimal_digits = boxAppPrecision->value(); + QLocale locale; + switch (boxDecimalSeparator->currentIndex()){ + case 0: + locale = QLocale::system(); + break; + case 1: + locale = QLocale::c(); + break; + case 2: + locale = QLocale(QLocale::German); + break; + case 3: + locale = QLocale(QLocale::French); + break; + } + if (boxThousandsSeparator->isChecked()) + locale.setNumberOptions(QLocale::OmitGroupSeparator); + + QLocale oldLocale = app->locale(); + app->setLocale(locale); + QLocale::setDefault(locale); + app->d_muparser_c_locale = boxMuParserCLocale->isChecked(); + + if (generalDialog->currentWidget() == appTabWidget && + appTabWidget->currentWidget() == numericFormatPage){ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + QList windows = app->windowsList(); + foreach(MdiSubWindow *w, windows){ + w->setLocale(locale); + + if(w->isA("Table")) + ((Table *)w)->updateDecimalSeparators(oldLocale); + else if(w->isA("Matrix")) + ((Matrix *)w)->resetView(); + } + + switch (boxClipboardLocale->currentIndex()){ + case 0: + app->setClipboardLocale(QLocale::system()); + break; + case 1: + app->setClipboardLocale(QLocale::c()); + break; + case 2: + app->setClipboardLocale(QLocale(QLocale::German)); + break; + case 3: + app->setClipboardLocale(QLocale(QLocale::French)); + break; + } + + app->modifiedProject(); + QApplication::restoreOverrideCursor(); + } + + // general page: file locations tab + if (generalDialog->currentWidget() == appTabWidget && + appTabWidget->currentWidget() == fileLocationsPage){ + QString path = translationsPathLine->text(); + if (path != app->d_translations_folder && validFolderPath(path)){ + app->d_translations_folder = QFileInfo(path).absoluteFilePath(); + app->createLanguagesList(); + insertLanguagesList(); + } + + if (validFolderPath(helpPathLine->text())){ + path = helpPathLine->text() + "/index.html"; + if (path != app->helpFilePath){ + QFileInfo fi(path); + if (fi.exists() && fi.isFile()) + app->helpFilePath = fi.absoluteFilePath(); + else + QMessageBox::critical(this, tr("QtiPlot - index.html File Not Found!"), + tr("There is no file called index.html in folder %1.
Please choose another folder!"). + arg(helpPathLine->text())); + } + } + +#ifdef SCRIPTING_PYTHON + path = pythonConfigDirLine->text(); + if (path != app->d_python_config_folder && validFolderPath(path)) + app->d_python_config_folder = QFileInfo(path).absoluteFilePath(); +#endif + } + + if (generalDialog->currentWidget() == appTabWidget && + appTabWidget->currentWidget() == proxyPage){ + setApplicationCustomProxy(); + } + + // general page: confirmations tab + app->d_inform_rename_table = boxPromptRenameTables->isChecked(); + app->d_confirm_overwrite = boxConfirmOverwrite->isChecked(); + app->confirmCloseFolder = boxFolders->isChecked(); + app->updateConfirmOptions(boxTables->isChecked(), boxMatrices->isChecked(), + boxPlots2D->isChecked(), boxPlots3D->isChecked(), + boxNotes->isChecked()); + // general page: colors tab + app->setAppColors(btnWorkspace->color(), btnPanels->color(), btnPanelsText->color()); + // 3D plots page + app->d_3D_color_map = colorMapEditor->colorMap(); + app->d_3D_axes_color = btnAxes->color(); + app->d_3D_numbers_color = btnNumbers->color(); + app->d_3D_grid_color = btnGrid->color(); + app->d_3D_mesh_color = btnMesh->color(); + app->d_3D_background_color = btnBackground3D->color(); + app->d_3D_labels_color = btnLabels->color(); + app->d_3D_legend = boxShowLegend->isChecked(); + app->d_3D_projection = boxProjection->currentIndex(); + app->d_3D_resolution = boxResolution->value(); + app->d_3D_title_font = d_3D_title_font; + app->d_3D_numbers_font = d_3D_numbers_font; + app->d_3D_axes_font = d_3D_axes_font; + app->d_3D_orthogonal = boxOrthogonal->isChecked(); + app->d_3D_smooth_mesh = boxSmoothMesh->isChecked(); + app->d_3D_autoscale = boxAutoscale3DPlots->isChecked(); + app->setPlot3DOptions(); + + app->d_3D_grid_color = btnGrid->color(); + app->d_3D_minor_grid_color = btnGridMinor->color(); + app->d_3D_minor_grids = boxMajorGrids->isChecked(); + app->d_3D_major_grids = boxMinorGrids->isChecked(); + app->d_3D_major_style = boxMajorGridStyle->currentIndex(); + app->d_3D_minor_style = boxMinorGridStyle->currentIndex(); + app->d_3D_major_width = boxMajorGridWidth->value(); + app->d_3D_minor_width = boxMinorGridWidth->value(); + + // fitting page + app->fit_output_precision = boxPrecision->value(); + app->pasteFitResultsToPlot = plotLabelBox->isChecked(); + app->writeFitResultsToLog = logBox->isChecked(); + app->fitPoints = generatePointsBox->value(); + app->generateUniformFitPoints = generatePointsBtn->isChecked(); + app->generatePeakCurves = groupBoxMultiPeak->isChecked(); + app->peakCurvesColor = boxPeaksColor->color(); + app->fit_scale_errors = scaleErrorsBox->isChecked(); + app->d_2_linear_fit_points = linearFit2PointsBox->isChecked(); + app->d_multi_peak_messages = boxMultiPeakMsgs->isChecked(); + app->saveSettings(); + + updateMenuList(); +} + +int ConfigDialog::curveStyle() +{ + int style = 0; + switch (boxCurveStyle->currentItem()) + { + case 0: + style = Graph::Line; + break; + case 1: + style = Graph::Scatter; + break; + case 2: + style = Graph::LineSymbols; + break; + case 3: + style = Graph::VerticalDropLines; + break; + case 4: + style = Graph::Spline; + break; + case 5: + style = Graph::VerticalSteps; + break; + case 6: + style = Graph::HorizontalSteps; + break; + case 7: + style = Graph::Area; + break; + case 8: + style = Graph::VerticalBars; + break; + case 9: + style = Graph::HorizontalBars; + break; + } + return style; +} + +void ConfigDialog::pickTextFont() +{ + bool ok; + QFont font = QFontDialog::getFont(&ok,textFont,this); + if ( ok ) { + textFont = font; + } else { + return; + } +} + +void ConfigDialog::pickHeaderFont() +{ + bool ok; + QFont font = QFontDialog::getFont(&ok,headerFont,this); + if ( ok ) { + headerFont = font; + } else { + return; + } +} + +void ConfigDialog::pickLegendFont() +{ + bool ok; + QFont font = QFontDialog::getFont(&ok,legendFont,this); + if ( ok ) { + legendFont = font; + } else { + return; + } +} + +void ConfigDialog::pickAxesFont() +{ + bool ok; + QFont font = QFontDialog::getFont(&ok,axesFont,this); + if ( ok ) { + axesFont = font; + } else { + return; + } +} + +void ConfigDialog::pickNumbersFont() +{ + bool ok; + QFont font = QFontDialog::getFont(&ok,numbersFont,this); + if ( ok ) { + numbersFont = font; + } else { + return; + } +} + +void ConfigDialog::pickTitleFont() +{ + bool ok; + QFont font = QFontDialog::getFont(&ok,titleFont,this); + if ( ok ) + titleFont = font; + else + return; +} + +void ConfigDialog::pickApplicationFont() +{ + bool ok; + QFont font = QFontDialog::getFont(&ok, appFont,this); + if ( ok ) + appFont = font; + else + return; + + ((ApplicationWindow *)parentWidget())->changeAppFont(appFont); +} + +void ConfigDialog::pick3DTitleFont() +{ + bool ok; + QFont font = QFontDialog::getFont(&ok, d_3D_title_font,this); + if ( ok ) + d_3D_title_font = font; + else + return; +} + +void ConfigDialog::pick3DNumbersFont() +{ + bool ok; + QFont font = QFontDialog::getFont(&ok, d_3D_numbers_font,this); + if ( ok ) + d_3D_numbers_font = font; + else + return; +} + +void ConfigDialog::pick3DAxesFont() +{ + bool ok; + QFont font = QFontDialog::getFont(&ok, d_3D_axes_font,this); + if ( ok ) + d_3D_axes_font = font; + else + return; +} + +void ConfigDialog::setColumnSeparator(const QString& sep) +{ + if (sep=="\t") + boxSeparator->setCurrentIndex(0); + else if (sep==" ") + boxSeparator->setCurrentIndex(1); + else if (sep==";\t") + boxSeparator->setCurrentIndex(2); + else if (sep==",\t") + boxSeparator->setCurrentIndex(3); + else if (sep=="; ") + boxSeparator->setCurrentIndex(4); + else if (sep==", ") + boxSeparator->setCurrentIndex(5); + else if (sep==";") + boxSeparator->setCurrentIndex(6); + else if (sep==",") + boxSeparator->setCurrentIndex(7); + else + { + QString separator = sep; + boxSeparator->setEditText(separator.replace(" ","\\s").replace("\t","\\t")); + } +} + +void ConfigDialog::switchToLanguage(int param) +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + app->switchToLanguage(param); + languageChange(); +} + +void ConfigDialog::insertLanguagesList() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + if(!app) + return; + + boxLanguage->clear(); + QString qmPath = app->d_translations_folder; + QDir dir(qmPath); + QStringList locales = app->locales; + QStringList languages; + int lang = 0; + for (int i=0; i < (int)locales.size(); i++) + { + if (locales[i] == "en") + languages.push_back("English"); + else + { + QTranslator translator; + translator.load("qtiplot_"+locales[i], qmPath); + + QString language = translator.translate("ApplicationWindow", "English"); + if (!language.isEmpty()) + languages.push_back(language); + else + languages.push_back(locales[i]); + } + + if (locales[i] == app->appLanguage) + lang = i; + } + boxLanguage->addItems(languages); + boxLanguage->setCurrentIndex(lang); +} + + +void ConfigDialog::showPointsBox(bool) +{ + if (generatePointsBtn->isChecked()){ + lblPoints->show(); + generatePointsBox->show(); + linearFit2PointsBox->show(); + } else { + lblPoints->hide(); + generatePointsBox->hide(); + linearFit2PointsBox->hide(); + } +} + +void ConfigDialog::chooseTranslationsFolder() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + if (!app) + return; + + QFileInfo tfi(app->d_translations_folder); + QString dir = QFileDialog::getExistingDirectory(this, tr("Choose the location of the QtiPlot translations folder!"), + tfi.absoluteFilePath(), QFileDialog::ShowDirsOnly); + if (!dir.isEmpty()){ + app->d_translations_folder = QDir::toNativeSeparators(dir); + translationsPathLine->setText(app->d_translations_folder); + app->createLanguagesList(); + insertLanguagesList(); + } +} + +void ConfigDialog::chooseHelpFolder() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + if (!app) + return; + + QFileInfo hfi(app->helpFilePath); + QString dir = QFileDialog::getExistingDirectory(this, tr("Choose the location of the QtiPlot help folder!"), + hfi.dir().absolutePath(), QFileDialog::ShowDirsOnly); + if (!dir.isEmpty()){ + QString helpFilePath = QDir(dir).absoluteFilePath ("index.html"); + if (!QFile(helpFilePath).exists()){ + QMessageBox::critical(this, tr("QtiPlot - index.html File Not Found!"), + tr("There is no file called index.html in this folder.
Please choose another folder!")); + } else + app->helpFilePath = helpFilePath; + } + + helpPathLine->setText(QDir::toNativeSeparators(QFileInfo(app->helpFilePath).dir().absolutePath())); +} + +#ifdef SCRIPTING_PYTHON +void ConfigDialog::choosePythonConfigFolder() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + if (!app) + return; + + QFileInfo tfi(app->d_python_config_folder); + QString dir = QFileDialog::getExistingDirectory(this, tr("Choose the location of the Python configuration files!"), + tfi.absoluteFilePath(), QFileDialog::ShowDirsOnly); + if (!dir.isEmpty()){ + app->d_python_config_folder = QDir::toNativeSeparators(dir); + pythonConfigDirLine->setText(app->d_python_config_folder); + + if (app->scriptingEnv()->name() == QString("Python")) + app->setScriptingLanguage(QString("Python"), true); + } +} +#endif + +void ConfigDialog::rehighlight() +{ + if (generalDialog->currentWidget() != notesPage) + return; + + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + if (!app) + return; + + app->d_comment_highlight_color = buttonCommentColor->color(); + app->d_keyword_highlight_color = buttonKeywordColor->color(); + app->d_quotation_highlight_color = buttonQuotationColor->color(); + app->d_numeric_highlight_color = buttonNumericColor->color(); + app->d_function_highlight_color = buttonFunctionColor->color(); + app->d_class_highlight_color = buttonClassColor->color(); + + QList windows = app->windowsList(); + foreach(MdiSubWindow *w, windows){ + Note *n = qobject_cast(w); + if (n){ + for (int i = 0; i < n->tabs(); i++) + n->editor(i)->rehighlight(); + } + } +} + +void ConfigDialog::customizeNotes() +{ + if (generalDialog->currentWidget() != notesPage) + return; + + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + if (!app) + return; + + app->d_note_line_numbers = lineNumbersBox->isChecked(); + app->d_notes_tab_length = boxTabLength->value(); + QFont f = QFont(boxFontFamily->currentFont().family(), boxFontSize->value()); + f.setBold(buttonBoldFont->isChecked()); + f.setItalic(buttonItalicFont->isChecked()); + app->d_notes_font = f; + QList windows = app->windowsList(); + foreach(MdiSubWindow *w, windows){ + Note *n = qobject_cast(w); + if (n){ + n->showLineNumbers(app->d_note_line_numbers); + n->setTabStopWidth(app->d_notes_tab_length); + n->setFont(f); + } + } + app->setFormatBarFont(f); +} + +void ConfigDialog::updateMenuList() +{ + QFontMetrics fm(itemsList->font()); + int width = 0; + for(int i = 0; icount() ; i++){ + int itemWidth = fm.boundingRect(itemsList->item(i)->text()).width(); + if(itemWidth > width) + width = itemWidth; + } + + itemsList->setFixedWidth(itemsList->iconSize().width() + width + 50); +} + +bool ConfigDialog::validFolderPath(const QString& path) +{ + QFileInfo fi(path); + if (!fi.exists()){ + QMessageBox::critical(this, tr("QtiPlot - Folder Not Found!"), + tr("The folder %1 doesn't exist.
Please choose another folder!").arg(path)); + return false; + } + + if (!fi.isDir()){ + QMessageBox::critical(this, tr("QtiPlot - Folder Not Found!"), + tr("%1 is not a folder.
Please choose another folder!").arg(path)); + return false; + } + + if (!fi.isReadable()){ + QMessageBox::critical(this, tr("QtiPlot"), + tr("You don't have read access rights to folder %1.
Please choose another folder!").arg(path)); + return false; + } + return true; +} + +void ConfigDialog::initProxyPage() +{ + QNetworkProxy proxy = QNetworkProxy::applicationProxy(); + + proxyPage = new QWidget(); + + proxyGroupBox = new QGroupBox (tr("&Proxy")); + proxyGroupBox->setCheckable(true); + proxyGroupBox->setChecked(!proxy.hostName().isEmpty()); + + QGridLayout *gl = new QGridLayout(proxyGroupBox); + + proxyHostLabel = new QLabel( tr("Host")); + gl->addWidget(proxyHostLabel, 0, 0); + proxyHostLine = new QLineEdit(proxy.hostName ()); + gl->addWidget(proxyHostLine, 0, 1); + + proxyPortLabel = new QLabel( tr("Port")); + gl->addWidget(proxyPortLabel, 1, 0); + proxyPortBox = new QSpinBox; + proxyPortBox->setMaximum(10000000); + proxyPortBox->setValue(proxy.port()); + gl->addWidget(proxyPortBox, 1, 1); + + proxyUserLabel = new QLabel( tr("Username")); + gl->addWidget(proxyUserLabel, 2, 0); + proxyUserNameLine = new QLineEdit(proxy.user()); + gl->addWidget(proxyUserNameLine, 2, 1); + + proxyPasswordLabel = new QLabel( tr("Password")); + gl->addWidget(proxyPasswordLabel, 3, 0); + proxyPasswordLine = new QLineEdit; + + gl->addWidget(proxyPasswordLine, 3, 1); + + gl->setRowStretch(4, 1); + + QVBoxLayout *layout = new QVBoxLayout(proxyPage); + layout->addWidget(proxyGroupBox); + + appTabWidget->addTab(proxyPage, tr( "&Internet Connection" ) ); +} + +QNetworkProxy ConfigDialog::setApplicationCustomProxy() +{ + QNetworkProxy proxy; + proxy.setType(QNetworkProxy::NoProxy); + if (proxyGroupBox->isChecked()) + proxy.setHostName(proxyHostLine->text()); + else + proxy.setHostName(QString::null); + + proxy.setPort(proxyPortBox->value()); + proxy.setUser(proxyUserNameLine->text()); + proxy.setPassword(proxyPasswordLine->text()); + QNetworkProxy::setApplicationProxy(proxy); + return proxy; +} + +void ConfigDialog::chooseTexCompiler() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + if (!app) + return; + + QFileInfo tfi(app->d_latex_compiler_path); + QString compiler = ApplicationWindow::getFileName(this, tr("Choose the location of the LaTeX compiler!"), + app->d_latex_compiler_path, QString(), 0, false); + + if (!compiler.isEmpty()){ + app->d_latex_compiler_path = QDir::toNativeSeparators(compiler); + texCompilerPathBox->setText(app->d_latex_compiler_path); + } +} + +bool ConfigDialog::validateTexCompiler() +{ + QString path = texCompilerPathBox->text(); + if (path.isEmpty()) + return false; + + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + QFileInfo fi(path); + if (!fi.exists()){ + QMessageBox::critical(this, tr("QtiPlot - File Not Found!"), + tr("The file %1 doesn't exist.
Please choose another file!").arg(path)); + texCompilerPathBox->setText(app->d_latex_compiler_path); + return false; + } + + if (fi.isDir()){ + QMessageBox::critical(this, tr("QtiPlot - File Not Found!"), + tr("%1 is a folder.
Please choose a file!").arg(path)); + texCompilerPathBox->setText(app->d_latex_compiler_path); + return false; + } + + if (!fi.isReadable()){ + QMessageBox::critical(this, tr("QtiPlot"), + tr("You don't have read access rights to file %1.
Please choose another file!").arg(path)); + texCompilerPathBox->setText(app->d_latex_compiler_path); + return false; + } + + app->d_latex_compiler_path = QDir::toNativeSeparators(path); + texCompilerPathBox->setText(app->d_latex_compiler_path); + return true; +} + +void ConfigDialog::enableMajorGrids(bool on) +{ + btnGrid->setEnabled(on); + boxMajorGridStyle->setEnabled(on); + boxMajorGridWidth->setEnabled(on); +} + +void ConfigDialog::enableMinorGrids(bool on) +{ + btnGridMinor->setEnabled(on); + boxMinorGridStyle->setEnabled(on); + boxMinorGridWidth->setEnabled(on); +} + +int ConfigDialog::convertToPixels(double w, FrameWidget::Unit unit, int dimension) +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + if (!app) + return qRound(w); + + double dpi = (double)app->logicalDpiX(); + if (dimension) + dpi = (double)app->logicalDpiY(); + + switch(unit){ + case FrameWidget::Pixel: + default: + return qRound(w); + break; + case FrameWidget::Inch: + return qRound(w*dpi); + break; + case FrameWidget::Millimeter: + return qRound(w*dpi/25.4); + break; + case FrameWidget::Centimeter: + return qRound(w*dpi/2.54); + break; + case FrameWidget::Point: + return qRound(w*dpi/72.0); + break; + } + return qRound(w); +} + +double ConfigDialog::convertFromPixels(int w, FrameWidget::Unit unit, int dimension) +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + if (!app) + return w; + + double dpi = (double)app->logicalDpiX(); + if (dimension) + dpi = (double)app->logicalDpiY(); + + double val = 0.0; + switch(unit){ + case FrameWidget::Pixel: + default: + val = w; + break; + case FrameWidget::Inch: + val = (double)w/dpi; + break; + case FrameWidget::Millimeter: + val = 25.4*w/dpi; + break; + case FrameWidget::Centimeter: + val = 2.54*w/dpi; + break; + case FrameWidget::Point: + val = 72.0*w/dpi; + break; + } + return val; +} + +void ConfigDialog::updateCanvasSize(int unit) +{ + if (unit == FrameWidget::Pixel || unit == FrameWidget::Point){ + boxCanvasWidth->setFormat('f', 0); + boxCanvasHeight->setFormat('f', 0); + + boxCanvasWidth->setSingleStep(1.0); + boxCanvasHeight->setSingleStep(1.0); + } else { + boxCanvasWidth->setFormat('g', 6); + boxCanvasHeight->setFormat('g', 6); + + boxCanvasWidth->setSingleStep(0.1); + boxCanvasHeight->setSingleStep(0.1); + } + + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + if (!app) + return; + + aspect_ratio = (double)app->d_layer_canvas_width/(double)app->d_layer_canvas_height; + + boxCanvasWidth->setValue(convertFromPixels(app->d_layer_canvas_width, (FrameWidget::Unit)unit, 0)); + boxCanvasHeight->setValue(convertFromPixels(app->d_layer_canvas_height, (FrameWidget::Unit)unit, 1)); +} + +void ConfigDialog::adjustCanvasHeight(double width) +{ + if (keepRatioBox->isChecked()){ + boxCanvasHeight->blockSignals(true); + boxCanvasHeight->setValue(width/aspect_ratio); + boxCanvasHeight->blockSignals(false); + } else + aspect_ratio = width/boxCanvasHeight->value(); +} + +void ConfigDialog::adjustCanvasWidth(double height) +{ + if (keepRatioBox->isChecked()){ + boxCanvasWidth->blockSignals(true); + boxCanvasWidth->setValue(height*aspect_ratio); + boxCanvasWidth->blockSignals(false); + } else + aspect_ratio = boxCanvasWidth->value()/height; +} === removed file 'qtiplot/src/core/ConfigDialog.cpp' --- qtiplot/src/core/ConfigDialog.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/ConfigDialog.cpp 1970-01-01 00:00:00 +0000 @@ -1,2736 +0,0 @@ -/*************************************************************************** - File : ConfigDialog.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Preferences dialog - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "ConfigDialog.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static const char * notes_32_xpm[] = { -"32 32 343 2", -" c None", -". c #3D3939", -"+ c #191414", -"@ c #000000", -"# c #191111", -"$ c #403838", -"% c #474141", -"& c #171111", -"* c #1F1414", -"= c #433838", -"- c #221B1B", -"; c #474747", -"> c #3F3F3F", -", c #1E1E1E", -"' c #1C1C1C", -") c #202020", -"! c #212121", -"~ c #302020", -"{ c #464F4F", -"] c #506B6B", -"^ c #416F6F", -"/ c #307070", -"( c #2F7373", -"_ c #347474", -": c #447070", -"< c #416C6C", -"[ c #436C6C", -"} c #257979", -"| c #1C7979", -"1 c #165353", -"2 c #122C2C", -"3 c #142121", -"4 c #303030", -"5 c #476060", -"6 c #609F9F", -"7 c #66C9C9", -"8 c #60DFDF", -"9 c #45CCCC", -"0 c #30AFAF", -"a c #45A0A0", -"b c #66C1C1", -"c c #69C1C1", -"d c #2DD0D0", -"e c #00AFAF", -"f c #138888", -"g c #305F5F", -"h c #2B3A3A", -"i c #173C3C", -"j c #2D6969", -"k c #479595", -"l c #62C5C5", -"m c #6BE5E5", -"n c #69F4F4", -"o c #58E8E8", -"p c #4AD5D5", -"q c #55CCCC", -"r c #65CCCC", -"s c #6BE1E1", -"t c #54C9C9", -"u c #6CDCDC", -"v c #69EDED", -"w c #3AD0D0", -"x c #14A9A9", -"y c #389393", -"z c #607A7A", -"A c #4B5151", -"B c #2F2F2F", -"C c #145050", -"D c #4BD2D2", -"E c #63E2E2", -"F c #63E4E4", -"G c #42B7B7", -"H c #308F8F", -"I c #629090", -"J c #909090", -"K c #6E6868", -"L c #404040", -"M c #170F0F", -"N c #2C6565", -"O c #48CFCF", -"P c #59ECEC", -"Q c #60E7E7", -"R c #55C8C8", -"S c #48A7A7", -"T c #48A4A4", -"U c #4BAAAA", -"V c #4AABAB", -"W c #48ABAB", -"X c #48A9A9", -"Y c #48A2A2", -"Z c #4BA6A6", -"` c #57C4C4", -" . c #60E3E3", -".. c #57EEEE", -"+. c #48E4E4", -"@. c #31A7A7", -"#. c #2D7272", -"$. c #738E8E", -"%. c #AEABAB", -"&. c #807A7A", -"*. c #424242", -"=. c #2A1A1A", -"-. c #478282", -";. c #66F1F1", -">. c #306F6F", -",. c #2D6868", -"'. c #4BA7A7", -"). c #4BEEEE", -"!. c #30DFDF", -"~. c #249999", -"{. c #809090", -"]. c #C0C0C0", -"^. c #898686", -"/. c #183C3C", -"(. c #4BADAD", -"_. c #68DBDB", -":. c #60BBBB", -"<. c #458C8C", -"[. c #2A6161", -"}. c #275B5B", -"|. c #2A5F5F", -"1. c #266D6D", -"2. c #2A8585", -"3. c #4AB7B7", -"4. c #63DFDF", -"5. c #48D7D7", -"6. c #2DBABA", -"7. c #3C8F8F", -"8. c #5F7474", -"9. c #9C9F9F", -"0. c #C3C3C3", -"a. c #888787", -"b. c #4BD6D6", -"c. c #66C5C5", -"d. c #488383", -"e. c #2D6C6C", -"f. c #306B6B", -"g. c #2D8C8C", -"h. c #4BD0D0", -"i. c #45BABA", -"j. c #5A8888", -"k. c #B6B0B0", -"l. c #838383", -"m. c #57E6E6", -"n. c #63CFCF", -"o. c #54AFAF", -"p. c #46A6A6", -"q. c #48A5A5", -"r. c #48B7B7", -"s. c #48CBCB", -"t. c #4AE1E1", -"u. c #33A9A9", -"v. c #2C7171", -"w. c #617D7D", -"x. c #9E9B9B", -"y. c #BEB8B8", -"z. c #828282", -"A. c #63EAEA", -"B. c #48E7E7", -"C. c #269B9B", -"D. c #667676", -"E. c #A0A0A0", -"F. c #BEBCBC", -"G. c #BFBFBF", -"H. c #818181", -"I. c #4BABAB", -"J. c #65E7E7", -"K. c #60E1E1", -"L. c #62E5E5", -"M. c #63E6E6", -"N. c #68E6E6", -"O. c #66E2E2", -"P. c #48D3D3", -"Q. c #338686", -"R. c #4B6060", -"S. c #747777", -"T. c #9D9D9D", -"U. c #BAB9B9", -"V. c #BDBDBD", -"W. c #808080", -"X. c #44B9B9", -"Y. c #4A7878", -"Z. c #707070", -"`. c #8A8484", -" + c #BABABA", -".+ c #57E4E4", -"++ c #62E0E0", -"@+ c #62DFDF", -"#+ c #56E9E9", -"$+ c #31A8A8", -"%+ c #2B7070", -"&+ c #607C7C", -"*+ c #C2C2C2", -"=+ c #D5D5D5", -"-+ c #D1D1D1", -";+ c #898989", -">+ c #768686", -",+ c #D8D6D6", -"'+ c #DFDFDF", -")+ c #EBEBEB", -"!+ c #1E4141", -"~+ c #337070", -"{+ c #4DACAC", -"]+ c #66E3E3", -"^+ c #68E9E9", -"/+ c #63E0E0", -"(+ c #66E5E5", -"_+ c #46D5D5", -":+ c #2EBBBB", -"<+ c #398C8C", -"[+ c #566A6A", -"}+ c #868989", -"|+ c #B5B5B5", -"1+ c #CAC9C9", -"2+ c #D3D3D3", -"3+ c #DDDDDD", -"4+ c #888888", -"5+ c #155454", -"6+ c #43B8B8", -"7+ c #538080", -"8+ c #938D8D", -"9+ c #B2B2B2", -"0+ c #C9C9C9", -"a+ c #176363", -"b+ c #33D4D4", -"c+ c #43EBEB", -"d+ c #4BE4E4", -"e+ c #4CE5E5", -"f+ c #4AE3E3", -"g+ c #48E1E1", -"h+ c #46DFDF", -"i+ c #45DEDE", -"j+ c #45E0E0", -"k+ c #46D0D0", -"l+ c #288888", -"m+ c #1E6363", -"n+ c #567474", -"o+ c #939090", -"p+ c #9C9696", -"q+ c #9A9A9A", -"r+ c #AAAAAA", -"s+ c #B9B9B9", -"t+ c #C4C4C4", -"u+ c #BBBBBB", -"v+ c #7E7E7E", -"w+ c #186868", -"x+ c #30CFCF", -"y+ c #33DCDC", -"z+ c #30D3D3", -"A+ c #31B3B3", -"B+ c #206666", -"C+ c #204F4F", -"D+ c #A6A3A3", -"E+ c #B0B0B0", -"F+ c #104444", -"G+ c #166565", -"H+ c #146060", -"I+ c #125F5F", -"J+ c #1E6D6D", -"K+ c #2B7C7C", -"L+ c #388989", -"M+ c #419292", -"N+ c #429494", -"O+ c #3F9393", -"P+ c #4D8E8E", -"Q+ c #5C8A8A", -"R+ c #648484", -"S+ c #718686", -"T+ c #939C9C", -"U+ c #B4B4B4", -"V+ c #BDBCBC", -"W+ c #D4D4D4", -"X+ c #E3E3E3", -"Y+ c #E5E5E5", -"Z+ c #878787", -"`+ c #151515", -" @ c #4B4B4B", -".@ c #606060", -"+@ c #636363", -"@@ c #5D5D5D", -"#@ c #757575", -"$@ c #ABABAB", -"%@ c #C1C1C1", -"&@ c #CECECE", -"*@ c #F3F3F3", -"=@ c #FFFFFF", -"-@ c #FBFBFB", -";@ c #8E8E8E", -">@ c #403636", -",@ c #635959", -"'@ c #837979", -")@ c #877D7D", -"!@ c #817777", -"~@ c #8F8787", -"{@ c #9E9898", -"]@ c #AEAAAA", -"^@ c #BAB7B7", -"/@ c #B6B4B4", -"(@ c #DEDEDE", -"_@ c #E4E4E4", -":@ c #505050", -"<@ c #767676", -"[@ c #A5A5A5", -"}@ c #9E9E9E", -"|@ c #C7C7C7", -"1@ c #9F9F9F", -"2@ c #9C9C9C", -"3@ c #979797", -"4@ c #989898", -"5@ c #A9A9A9", -"6@ c #B7B7B7", -"7@ c #BCBCBC", -"8@ c #666666", -"9@ c #939393", -"0@ c #C5C5C5", -"a@ c #CACACA", -"b@ c #CBCBCB", -"c@ c #E8E8E8", -"d@ c #E0E0E0", -"e@ c #858585", -"f@ c #6F6F6F", -"g@ c #A4A4A4", -"h@ c #E6E6E6", -"i@ c #EFEFEF", -"j@ c #F0F0F0", -"k@ c #CFCFCF", -"l@ c #848484", -"m@ c #363636", -"n@ c #727272", -"o@ c #CDCDCD", -"p@ c #CCCCCC", -"q@ c #D7D7D7", -"r@ c #3A3A3A", -"s@ c #A2A2A2", -"t@ c #A1A1A1", -"u@ c #575757", -"v@ c #1F1F1F", -"w@ c #454545", -"x@ c #4C4C4C", -"y@ c #4D4D4D", -"z@ c #4A4A4A", -"A@ c #484848", -"B@ c #444444", -" . + @ # $ % . & @ # $ % . & @ * = - @ ", -" ; > , @ ' > ; > ' @ ' > ; > ' @ ) > ! @ @ ", -" ~ { ] ^ / ( _ : ] < / ( _ : ] [ / } | 1 2 3 ' ", -" 4 5 6 7 8 9 0 a 6 b 8 9 0 a 6 c 8 d e f g h ) ", -" i j k l m n o p q r s n o p t l u v w x y z A B ", -" C 0 D 8 E 8 8 8 8 8 8 8 8 8 8 8 F 8 G H I J K L ", -" M N O P Q R S T U V W X S Y Z ` ...+.@.#.$.%.&.*.", -" =.4 -.8 ;.8 S >.,.>.>.>.>.>.,.>.'.8 ).!.~.g {.].^.L ", -" /./ (.E _.:.<.[.}.[.[.[.|.[.1.2.3.4.5.6.7.8.9.0.a.L ", -" @ C 0 b.8 c.6 d.>.e.>.>.>.f.>.g.0 h.8 i.H j.J k.].l.L ", -" M N O m.8 n.:.o.S p.S S S q.S r.s.t.+.u.v.w.x.y.].z.L ", -" =.4 -.8 A.8 8 8 8 8 8 8 8 8 8 8 4.8 B.!.C.g D.E.F.G.H.L ", -" /./ I.E J.8 K. .L.M.M.M.M.M.M.M.N.O.P.6.Q.R.S.T.U.V.W.L ", -" @ C 0 D 8 E 8 8 8 8 8 8 8 8 8 8 8 F 8 X.H Y.Z.`.E. +G.H.L ", -" M N O .+8 ++8 8 8 8 8 8 8 8 8 @+8 #++.$+%+&+x.k.*+=+-+;+L ", -" =.4 -.8 A.8 8 8 8 8 8 8 8 8 8 8 4.8 B.!.~.g >+].,+'+)+'+J L ", -" !+~+{+]+^+/+/+/+/+/+/+/+/+/+/+/+(+F _+:+<+[+}+|+1+2+3+-+4+L ", -" @ 5+0 D 8 E 8 8 8 8 8 8 8 8 8 8 8 F 8 6+H 7+W.8+E.9+G.0+G.W.L ", -" @ a+b+c+d+e+d+d+d+f+g+h+i+i+i+j+i+k+G l+m+n+o+p+q+r+s+t+u+v+L ", -" @ w+x+y+x+x+x+x+x+x+x+x+x+x+x+z+x+A+H B+C+8.E.D+E.E+G.0+G.W.L ", -" @ F+a+G+H+H+H+I+H+J+K+L+M+N+M+O+M+P+Q+R+S+T+U+V+*+W+X+Y+-+Z+L ", -" @ @ @ @ @ @ @ @ `+4 @.@+@.@@@.@#@J $@].%@].&@'+*@=@-@'+;@L ", -" >@,@'@)@'@!@'@~@{@]@^@/@9+%@2+(@X+_@-+Z+L ", -" :@<@E.[@E.E.E.E.E.E.E.}@E.E+G.%@G.|@G.W.L ", -" :@#@E.[@E.E.E.1@T.2@q+3@4@5@s+ +6@%@7@v+L ", -" :@<@E.[@E.E.E.E.E.E.E.}@E.E+G.%@G.|@G.W.L ", -" 8@9@0@a@0.0.0.0.0.*+0.b@=+(@Y+c@Y+d@b@e@*.", -" f@g@'+h@'+'+'+'+'+3+'+i@=@=@=@=@=@j@k@l@L ", -" m@n@u+o@o@k@o@o@o@p@o@q@'+d@(@d@(@=+ +Z.B ", -" @ r@W.4@E.s@E.E.E.E.E.E.E.E.E.t@E.1@J u@) ", -" @ v@r@w@x@y@x@x@x@x@x@ @z@z@z@z@z@A@B@m@' ", -" @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ "}; - -static const char* choose_folder_xpm[]={ - "16 16 11 1", - "# c #000000", - "g c #c0c0c0", - "e c #303030", - "a c #ffa858", - "b c #808080", - "d c #a0a0a4", - "f c #585858", - "c c #ffdca8", - "h c #dcdcdc", - "i c #ffffff", - ". c None", - "....###.........", - "....#ab##.......", - "....#acab####...", - "###.#acccccca#..", - "#ddefaaaccccca#.", - "#bdddbaaaacccab#", - ".eddddbbaaaacab#", - ".#bddggdbbaaaab#", - "..edgdggggbbaab#", - "..#bgggghghdaab#", - "...ebhggghicfab#", - "....#edhhiiidab#", - "......#egiiicfb#", - "........#egiibb#", - "..........#egib#", - "............#ee#"}; - -ConfigDialog::ConfigDialog( QWidget* parent, Qt::WFlags fl ) - : QDialog( parent, fl ) -{ - setAttribute(Qt::WA_DeleteOnClose); - setSizeGripEnabled(true); - - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - d_3D_title_font = app->d_3D_title_font; - d_3D_numbers_font = app->d_3D_numbers_font; - d_3D_axes_font = app->d_3D_axes_font; - textFont = app->tableTextFont; - headerFont = app->tableHeaderFont; - appFont = app->appFont; - axesFont = app->plotAxesFont; - numbersFont = app->plotNumbersFont; - legendFont = app->plotLegendFont; - titleFont = app->plotTitleFont; - - generalDialog = new QStackedWidget(); - itemsList = new QListWidget(); - itemsList->setSpacing(10); - itemsList->setIconSize(QSize(32, 32)); - - initAppPage(); - initTablesPage(); - initPlotsPage(); - initPlots3DPage(); - initNotesPage(); - initFittingPage(); - - generalDialog->addWidget(appTabWidget); - generalDialog->addWidget(tables); - generalDialog->addWidget(plotsTabWidget); - generalDialog->addWidget(plots3D); - generalDialog->addWidget(notesPage); - generalDialog->addWidget(fitPage); - - QVBoxLayout * rightLayout = new QVBoxLayout(); - lblPageHeader = new QLabel(); - QFont fnt = this->font(); - fnt.setPointSize(fnt.pointSize() + 3); - fnt.setBold(true); - lblPageHeader->setFont(fnt); - lblPageHeader->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); - - QPalette pal = lblPageHeader->palette(); - pal.setColor( QPalette::Window, app->panelsColor ); - lblPageHeader->setPalette(pal); - lblPageHeader->setAutoFillBackground( true ); - - rightLayout->setSpacing(10); - rightLayout->addWidget( lblPageHeader ); - rightLayout->addWidget( generalDialog ); - - QHBoxLayout * topLayout = new QHBoxLayout(); - topLayout->setSpacing(5); - topLayout->setMargin(5); - topLayout->addWidget(itemsList, 0); - topLayout->addLayout(rightLayout, 1); - topLayout->addStretch(); - - QHBoxLayout * bottomButtons = new QHBoxLayout(); - bottomButtons->addStretch(); - buttonApply = new QPushButton(); - buttonApply->setAutoDefault( true ); - bottomButtons->addWidget( buttonApply ); - - buttonOk = new QPushButton(); - buttonOk->setAutoDefault( true ); - buttonOk->setDefault( true ); - bottomButtons->addWidget( buttonOk ); - - buttonCancel = new QPushButton(); - buttonCancel->setAutoDefault( true ); - bottomButtons->addWidget( buttonCancel ); - - QVBoxLayout * mainLayout = new QVBoxLayout( this ); - mainLayout->addLayout(topLayout); - mainLayout->addLayout(bottomButtons); - - languageChange(); - - // signals and slots connections - connect( itemsList, SIGNAL(currentRowChanged(int)), this, SLOT(setCurrentPage(int))); - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonApply, SIGNAL( clicked() ), this, SLOT( apply() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); - connect( buttonTextFont, SIGNAL( clicked() ), this, SLOT( pickTextFont() ) ); - connect( buttonHeaderFont, SIGNAL( clicked() ), this, SLOT( pickHeaderFont() ) ); - - setCurrentPage(0); -} - -void ConfigDialog::setCurrentPage(int index) -{ - generalDialog->setCurrentIndex(index); - if(itemsList->currentItem()) - lblPageHeader->setText(itemsList->currentItem()->text()); -} - -void ConfigDialog::initTablesPage() -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - tables = new QWidget(); - - QHBoxLayout * topLayout = new QHBoxLayout(); - topLayout->setSpacing(5); - - lblSeparator = new QLabel(); - topLayout->addWidget( lblSeparator ); - boxSeparator = new QComboBox(); - boxSeparator->setEditable( true ); - topLayout->addWidget( boxSeparator ); - - QString help = tr("The column separator can be customized. \nThe following special codes can be used:\n\\t for a TAB character \n\\s for a SPACE"); - help += "\n"+tr("The separator must not contain the following characters: \n0-9eE.+-"); - - boxSeparator->setWhatsThis(help); - boxSeparator->setToolTip(help); - lblSeparator->setWhatsThis(help); - lblSeparator->setToolTip(help); - - groupBoxTableCol = new QGroupBox(); - QGridLayout * colorsLayout = new QGridLayout(groupBoxTableCol); - - lblTableBackground = new QLabel(); - colorsLayout->addWidget( lblTableBackground, 0, 0 ); - buttonBackground= new ColorButton(); - buttonBackground->setColor(app->tableBkgdColor); - colorsLayout->addWidget( buttonBackground, 0, 1 ); - - lblTextColor = new QLabel(); - colorsLayout->addWidget( lblTextColor, 1, 0 ); - buttonText = new ColorButton(); - buttonText->setColor(app->tableTextColor); - colorsLayout->addWidget( buttonText, 1, 1 ); - - lblHeaderColor = new QLabel(); - colorsLayout->addWidget( lblHeaderColor, 2, 0 ); - buttonHeader= new ColorButton(); - buttonHeader->setColor(app->tableHeaderColor); - colorsLayout->addWidget( buttonHeader, 2, 1 ); - - groupBoxTableFonts = new QGroupBox(); - QHBoxLayout * bottomLayout = new QHBoxLayout( groupBoxTableFonts ); - - buttonTextFont= new QPushButton(); - bottomLayout->addWidget( buttonTextFont ); - buttonHeaderFont= new QPushButton(); - bottomLayout->addWidget( buttonHeaderFont ); - - boxTableComments = new QCheckBox(); - boxTableComments->setChecked(app->d_show_table_comments); - - boxUpdateTableValues = new QCheckBox(); - boxUpdateTableValues->setChecked(app->autoUpdateTableValues()); - - QVBoxLayout * tablesPageLayout = new QVBoxLayout( tables ); - tablesPageLayout->addLayout(topLayout,1); - tablesPageLayout->addWidget(groupBoxTableCol); - tablesPageLayout->addWidget(groupBoxTableFonts); - tablesPageLayout->addWidget(boxTableComments); - tablesPageLayout->addWidget(boxUpdateTableValues); - tablesPageLayout->addStretch(); -} - -void ConfigDialog::initPlotsPage() -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - - plotsTabWidget = new QTabWidget(); - plotOptions = new QWidget(); - - QVBoxLayout * optionsTabLayout = new QVBoxLayout( plotOptions ); - optionsTabLayout->setSpacing(5); - - QGroupBox * groupBoxOptions = new QGroupBox(); - optionsTabLayout->addWidget( groupBoxOptions ); - - QGridLayout * optionsLayout = new QGridLayout( groupBoxOptions ); - - boxAutoscaling = new QCheckBox(); - boxAutoscaling->setChecked(app->autoscale2DPlots); - optionsLayout->addWidget( boxAutoscaling, 0, 0); - - boxScaleFonts = new QCheckBox(); - boxScaleFonts->setChecked(app->autoScaleFonts); - optionsLayout->addWidget( boxScaleFonts, 0, 1); - - boxAntialiasing = new QCheckBox(); - boxAntialiasing->setChecked(app->antialiasing2DPlots); - optionsLayout->addWidget( boxAntialiasing, 1, 1); - - boxTitle = new QCheckBox(); - boxTitle->setChecked(app->titleOn); - optionsLayout->addWidget(boxTitle, 1, 0); - - boxFrame = new QCheckBox(); - boxFrame->setChecked(app->canvasFrameWidth > 0); - optionsLayout->addWidget(boxFrame, 3, 0 ); - - labelFrameWidth = new QLabel(); - optionsLayout->addWidget(labelFrameWidth, 4, 0); - boxFrameWidth= new QSpinBox(); - optionsLayout->addWidget(boxFrameWidth, 4, 1); - boxFrameWidth->setRange(1, 100); - boxFrameWidth->setValue(app->canvasFrameWidth); - if (!app->canvasFrameWidth){ - labelFrameWidth->hide(); - boxFrameWidth->hide(); - } - - lblMargin = new QLabel(); - optionsLayout->addWidget(lblMargin, 5, 0); - boxMargin = new QSpinBox(); - boxMargin->setRange(0, 1000); - boxMargin->setSingleStep(5); - boxMargin->setValue(app->defaultPlotMargin); - optionsLayout->addWidget(boxMargin, 5, 1); - - legendDisplayLabel = new QLabel; - optionsLayout->addWidget(legendDisplayLabel, 6, 0); - legendDisplayBox = new QComboBox; - optionsLayout->addWidget(legendDisplayBox, 6, 1); - - optionsLayout->setRowStretch(7, 1); - - groupBackgroundOptions = new QGroupBox(tr("Background")); - optionsTabLayout->addWidget( groupBackgroundOptions ); - QGridLayout *graphBackgroundLayout = new QGridLayout( groupBackgroundOptions ); - - labelGraphBkgColor = new QLabel(tr("Background Color")); - graphBackgroundLayout->addWidget(labelGraphBkgColor, 0, 0 ); - boxBackgroundColor = new ColorButton(); - boxBackgroundColor->setColor(app->d_graph_background_color); - graphBackgroundLayout->addWidget(boxBackgroundColor, 0, 1 ); - - labelGraphBkgOpacity = new QLabel(tr( "Opacity" )); - graphBackgroundLayout->addWidget(labelGraphBkgOpacity, 0, 2 ); - boxBackgroundTransparency = new QSpinBox(); - boxBackgroundTransparency->setRange(0, 255); - boxBackgroundTransparency->setSingleStep(5); - boxBackgroundTransparency->setWrapping(true); - boxBackgroundTransparency->setValue(app->d_graph_background_opacity); - graphBackgroundLayout->addWidget(boxBackgroundTransparency, 0, 3 ); - - labelGraphCanvasColor = new QLabel(tr("Canvas Color" )); - graphBackgroundLayout->addWidget(labelGraphCanvasColor, 1, 0); - boxCanvasColor = new ColorButton(); - boxCanvasColor->setColor(app->d_graph_canvas_color); - graphBackgroundLayout->addWidget( boxCanvasColor, 1, 1 ); - - labelGraphCanvasOpacity = new QLabel(tr("Opacity")); - graphBackgroundLayout->addWidget(labelGraphCanvasOpacity, 1, 2 ); - boxCanvasTransparency = new QSpinBox(); - boxCanvasTransparency->setRange(0, 255); - boxCanvasTransparency->setSingleStep(5); - boxCanvasTransparency->setWrapping(true); - boxCanvasTransparency->setValue(app->d_graph_canvas_opacity); - graphBackgroundLayout->addWidget(boxCanvasTransparency, 1, 3 ); - - labelGraphFrameColor = new QLabel(tr("Border Color")); - graphBackgroundLayout->addWidget(labelGraphFrameColor, 2, 0); - boxBorderColor = new ColorButton(); - boxBorderColor->setColor(app->d_graph_border_color); - graphBackgroundLayout->addWidget(boxBorderColor, 2, 1); - - labelGraphFrameWidth = new QLabel(tr( "Width" )); - graphBackgroundLayout->addWidget(labelGraphFrameWidth, 2, 2); - boxBorderWidth = new QSpinBox(); - boxBorderWidth->setValue(app->d_graph_border_width); - graphBackgroundLayout->addWidget(boxBorderWidth, 2, 3); - - graphBackgroundLayout->setRowStretch(4, 1); - - boxResize = new QCheckBox(); - boxResize->setChecked(!app->autoResizeLayers); - optionsTabLayout->addWidget( boxResize ); - - boxLabelsEditing = new QCheckBox(); - boxLabelsEditing->setChecked(!app->d_in_place_editing); - optionsTabLayout->addWidget(boxLabelsEditing); - - plotsTabWidget->addTab( plotOptions, QString() ); - - initCurvesPage(); - plotsTabWidget->addTab( curves, QString() ); - - initAxesPage(); - plotsTabWidget->addTab( axesPage, QString() ); - - plotTicks = new QWidget(); - QVBoxLayout * plotTicksLayout = new QVBoxLayout( plotTicks ); - - QGroupBox * ticksGroupBox = new QGroupBox(); - QGridLayout * ticksLayout = new QGridLayout( ticksGroupBox ); - plotTicksLayout->addWidget( ticksGroupBox ); - - lblMajTicks = new QLabel(); - ticksLayout->addWidget( lblMajTicks, 0, 0 ); - boxMajTicks = new QComboBox(); - ticksLayout->addWidget( boxMajTicks, 0, 1 ); - - lblMajTicksLength = new QLabel(); - ticksLayout->addWidget( lblMajTicksLength, 0, 2 ); - boxMajTicksLength = new QSpinBox(); - boxMajTicksLength->setRange(0, 100); - boxMajTicksLength->setValue(app->majTicksLength); - ticksLayout->addWidget( boxMajTicksLength, 0, 3 ); - - lblMinTicks = new QLabel(); - ticksLayout->addWidget( lblMinTicks, 1, 0 ); - boxMinTicks = new QComboBox(); - ticksLayout->addWidget( boxMinTicks, 1, 1 ); - - lblMinTicksLength = new QLabel(); - ticksLayout->addWidget( lblMinTicksLength, 1, 2 ); - boxMinTicksLength = new QSpinBox(); - boxMinTicksLength->setRange(0, 100); - boxMinTicksLength->setValue(app->minTicksLength); - ticksLayout->addWidget( boxMinTicksLength, 1, 3 ); - - ticksLayout->setRowStretch( 4, 1 ); - - plotsTabWidget->addTab( plotTicks, QString() ); - - plotFonts = new QWidget(); - QVBoxLayout * plotFontsLayout = new QVBoxLayout( plotFonts ); - - QGroupBox * groupBox2DFonts = new QGroupBox(); - plotFontsLayout->addWidget( groupBox2DFonts ); - QVBoxLayout * fontsLayout = new QVBoxLayout( groupBox2DFonts ); - buttonTitleFont= new QPushButton(); - fontsLayout->addWidget( buttonTitleFont ); - buttonLegendFont= new QPushButton(); - fontsLayout->addWidget( buttonLegendFont ); - buttonAxesFont= new QPushButton(); - fontsLayout->addWidget( buttonAxesFont ); - buttonNumbersFont= new QPushButton(); - fontsLayout->addWidget( buttonNumbersFont ); - fontsLayout->addStretch(); - - plotsTabWidget->addTab( plotFonts, QString() ); - - plotPrint = new QWidget(); - QVBoxLayout *printLayout = new QVBoxLayout( plotPrint ); - - boxScaleLayersOnPrint = new QCheckBox(); - boxScaleLayersOnPrint->setChecked(app->d_scale_plots_on_print); - printLayout->addWidget( boxScaleLayersOnPrint ); - - boxPrintCropmarks = new QCheckBox(); - boxPrintCropmarks->setChecked(app->d_print_cropmarks); - printLayout->addWidget( boxPrintCropmarks ); - printLayout->addStretch(); - plotsTabWidget->addTab(plotPrint, QString()); - - connect( boxFrame, SIGNAL( toggled(bool) ), this, SLOT( showFrameWidth(bool) ) ); - connect( buttonAxesFont, SIGNAL( clicked() ), this, SLOT( pickAxesFont() ) ); - connect( buttonNumbersFont, SIGNAL( clicked() ), this, SLOT( pickNumbersFont() ) ); - connect( buttonLegendFont, SIGNAL( clicked() ), this, SLOT( pickLegendFont() ) ); - connect( buttonTitleFont, SIGNAL( clicked() ), this, SLOT( pickTitleFont() ) ); -} - -void ConfigDialog::showFrameWidth(bool ok) -{ - if (!ok) - { - boxFrameWidth->hide(); - labelFrameWidth->hide(); - } - else - { - boxFrameWidth->show(); - labelFrameWidth->show(); - } -} - -void ConfigDialog::initPlots3DPage() -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - plots3D = new QWidget(); - - QGroupBox * topBox = new QGroupBox(); - QGridLayout * topLayout = new QGridLayout( topBox ); - topLayout->setSpacing(5); - - lblResolution = new QLabel(); - topLayout->addWidget( lblResolution, 0, 0 ); - boxResolution = new QSpinBox(); - boxResolution->setRange(1, 100); - boxResolution->setValue(app->d_3D_resolution); - topLayout->addWidget( boxResolution, 0, 1 ); - lblResolution->setBuddy(boxResolution); - - lblFloorStyle = new QLabel(); - topLayout->addWidget( lblFloorStyle, 1, 0 ); - - boxProjection = new QComboBox(); - boxProjection->setCurrentIndex(app->d_3D_projection); - topLayout->addWidget(boxProjection, 1, 1); - lblFloorStyle->setBuddy(boxProjection); - - boxShowLegend = new QCheckBox(); - boxShowLegend->setChecked(app->d_3D_legend); - topLayout->addWidget(boxShowLegend, 2, 0); - - boxSmoothMesh = new QCheckBox(); - boxSmoothMesh->setChecked(app->d_3D_smooth_mesh); - topLayout->addWidget(boxSmoothMesh, 2, 1); - - boxOrthogonal = new QCheckBox(); - boxOrthogonal->setChecked(app->d_3D_orthogonal); - topLayout->addWidget(boxOrthogonal, 3, 1); - - boxAutoscale3DPlots = new QCheckBox(); - boxAutoscale3DPlots->setChecked(app->d_3D_autoscale); - topLayout->addWidget(boxAutoscale3DPlots, 3, 0); - - colorMapBox = new QGroupBox(); - QHBoxLayout *colorMapLayout = new QHBoxLayout( colorMapBox ); - colorMapLayout->setMargin(0); - colorMapLayout->setSpacing(0); - - colorMapEditor = new ColorMapEditor(app->locale()); - colorMapEditor->setColorMap(app->d_3D_color_map); - colorMapLayout->addWidget(colorMapEditor); - - groupBox3DCol = new QGroupBox(); - QGridLayout * middleLayout = new QGridLayout( groupBox3DCol ); - btnAxes = new ColorButton(); - btnAxes->setColor(app->d_3D_axes_color); - middleLayout->addWidget(btnAxes, 0, 0); - btnLabels = new ColorButton(); - btnLabels->setColor(app->d_3D_labels_color); - middleLayout->addWidget(btnLabels, 0, 1); - btnNumbers = new ColorButton(); - btnNumbers->setColor(app->d_3D_numbers_color); - middleLayout->addWidget(btnNumbers, 0, 2); - btnMesh = new ColorButton(); - btnMesh->setColor(app->d_3D_mesh_color); - middleLayout->addWidget(btnMesh, 1, 0); - btnBackground3D = new ColorButton(); - btnBackground3D->setColor(app->d_3D_background_color); - middleLayout->addWidget(btnBackground3D, 1, 1); - - groupBox3DFonts = new QGroupBox(); - QGridLayout * fl = new QGridLayout( groupBox3DFonts ); - btnTitleFnt = new QPushButton(); - fl->addWidget( btnTitleFnt, 0, 0); - btnLabelsFnt = new QPushButton(); - fl->addWidget( btnLabelsFnt, 0, 1); - btnNumFnt = new QPushButton(); - fl->addWidget( btnNumFnt, 0, 2); - fl->setRowStretch(1, 1); - - groupBox3DGrids = new QGroupBox(tr("Grids")); - QGridLayout *gl1 = new QGridLayout(groupBox3DGrids); - - boxMajorGrids = new QCheckBox(tr("Ma&jor Grids")); - boxMajorGrids->setChecked(app->d_3D_major_grids); - connect(boxMajorGrids, SIGNAL(toggled(bool)), this, SLOT(enableMajorGrids(bool))); - gl1->addWidget(boxMajorGrids, 0, 1); - - boxMinorGrids = new QCheckBox(tr("Mi&nor Grids")); - boxMinorGrids->setChecked(app->d_3D_minor_grids); - connect(boxMinorGrids, SIGNAL(toggled(bool)), this, SLOT(enableMinorGrids(bool))); - gl1->addWidget(boxMinorGrids, 0, 2); - - label3DGridsColor = new QLabel(tr("Color")); - gl1->addWidget(label3DGridsColor, 1, 0); - - btnGrid = new ColorButton(); - btnGrid->setColor(app->d_3D_grid_color); - gl1->addWidget(btnGrid, 1, 1); - - btnGridMinor = new ColorButton(); - btnGridMinor->setColor(app->d_3D_minor_grid_color); - gl1->addWidget(btnGridMinor, 1, 2); - - label3DGridsStyle = new QLabel(tr("Style")); - gl1->addWidget(label3DGridsStyle, 2, 0); - - boxMajorGridStyle = new QComboBox(); - gl1->addWidget(boxMajorGridStyle, 2, 1); - - boxMinorGridStyle = new QComboBox(); - gl1->addWidget(boxMinorGridStyle, 2, 2); - - label3DGridsWidth = new QLabel(tr("Width")); - gl1->addWidget(label3DGridsWidth, 3, 0); - - boxMajorGridWidth = new DoubleSpinBox(); - boxMajorGridWidth->setLocale(app->locale()); - boxMajorGridWidth->setMinimum(0.0); - boxMajorGridWidth->setValue(app->d_3D_major_width); - gl1->addWidget(boxMajorGridWidth, 3, 1); - - boxMinorGridWidth = new DoubleSpinBox(); - boxMinorGridWidth->setLocale(app->locale()); - boxMinorGridWidth->setMinimum(0.0); - boxMinorGridWidth->setValue(app->d_3D_minor_width); - gl1->addWidget(boxMinorGridWidth, 3, 2); - - gl1->setRowStretch(4, 1); - gl1->setColumnStretch(3, 1); - - enableMajorGrids(app->d_3D_major_grids); - enableMinorGrids(app->d_3D_minor_grids); - - QVBoxLayout *vl = new QVBoxLayout(); - vl->addWidget(groupBox3DCol); - vl->addWidget(groupBox3DFonts); - vl->addWidget(groupBox3DGrids); - - QHBoxLayout *hb = new QHBoxLayout(); - hb->addWidget(colorMapBox); - hb->addLayout(vl); - - QVBoxLayout * plots3DPageLayout = new QVBoxLayout( plots3D ); - plots3DPageLayout->addWidget(topBox); - plots3DPageLayout->addLayout(hb); - - connect( btnNumFnt, SIGNAL( clicked() ), this, SLOT(pick3DNumbersFont() ) ); - connect( btnTitleFnt, SIGNAL( clicked() ), this, SLOT(pick3DTitleFont() ) ); - connect( btnLabelsFnt, SIGNAL( clicked() ), this, SLOT(pick3DAxesFont() ) ); -} - -void ConfigDialog::initAppPage() -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - - appTabWidget = new QTabWidget(generalDialog); - appTabWidget->setUsesScrollButtons(false); - - application = new QWidget(); - QVBoxLayout * applicationLayout = new QVBoxLayout( application ); - QGroupBox * groupBoxApp = new QGroupBox(); - applicationLayout->addWidget(groupBoxApp); - QGridLayout * topBoxLayout = new QGridLayout( groupBoxApp ); - - lblLanguage = new QLabel(); - topBoxLayout->addWidget( lblLanguage, 0, 0 ); - boxLanguage = new QComboBox(); - insertLanguagesList(); - topBoxLayout->addWidget( boxLanguage, 0, 1 ); - - lblStyle = new QLabel(); - topBoxLayout->addWidget( lblStyle, 1, 0 ); - boxStyle = new QComboBox(); - topBoxLayout->addWidget( boxStyle, 1, 1 ); - QStringList styles = QStyleFactory::keys(); - styles.sort(); - boxStyle->addItems(styles); - boxStyle->setCurrentIndex(boxStyle->findText(app->appStyle,Qt::MatchWildcard)); - - lblFonts = new QLabel(); - topBoxLayout->addWidget( lblFonts, 2, 0 ); - fontsBtn= new QPushButton(); - topBoxLayout->addWidget( fontsBtn, 2, 1 ); - - lblScriptingLanguage = new QLabel(); - topBoxLayout->addWidget( lblScriptingLanguage, 3, 0 ); - boxScriptingLanguage = new QComboBox(); - QStringList llist = ScriptingLangManager::languages(); - boxScriptingLanguage->insertStringList(llist); - boxScriptingLanguage->setCurrentItem(llist.findIndex(app->defaultScriptingLang)); - topBoxLayout->addWidget( boxScriptingLanguage, 3, 1 ); - - lblUndoStackSize = new QLabel(); - topBoxLayout->addWidget( lblUndoStackSize, 4, 0 ); - undoStackSizeBox = new QSpinBox(); - undoStackSizeBox->setValue(app->matrixUndoStackSize()); - topBoxLayout->addWidget( undoStackSizeBox, 4, 1 ); - - lblEndOfLine = new QLabel(); - topBoxLayout->addWidget(lblEndOfLine, 5, 0 ); - boxEndLine = new QComboBox(); - boxEndLine->addItem(tr("LF (Unix)")); - boxEndLine->addItem(tr("CRLF (Windows)")); - boxEndLine->addItem(tr("CR (Mac)")); - boxEndLine->setCurrentIndex((int)app->d_eol); - topBoxLayout->addWidget(boxEndLine, 5, 1); - - lblInitWindow = new QLabel(); - topBoxLayout->addWidget( lblInitWindow, 6, 0 ); - boxInitWindow = new QComboBox(); - topBoxLayout->addWidget( boxInitWindow, 6, 1 ); - - boxSave= new QCheckBox(); - boxSave->setChecked(app->autoSave); - topBoxLayout->addWidget( boxSave, 7, 0 ); - - boxMinutes = new QSpinBox(); - boxMinutes->setRange(1, 100); - boxMinutes->setValue(app->autoSaveTime); - boxMinutes->setEnabled(app->autoSave); - topBoxLayout->addWidget( boxMinutes, 7, 1 ); - - boxBackupProject = new QCheckBox(); - boxBackupProject->setChecked(app->d_backup_files); - topBoxLayout->addWidget( boxBackupProject, 8, 0, 1, 2 ); - - boxSearchUpdates = new QCheckBox(); - boxSearchUpdates->setChecked(app->autoSearchUpdates); - topBoxLayout->addWidget( boxSearchUpdates, 9, 0, 1, 2 ); - - completionBox = new QCheckBox(); - completionBox->setChecked(app->d_completion); - topBoxLayout->addWidget(completionBox, 10, 0); - - topBoxLayout->setRowStretch(11, 1); - - appTabWidget->addTab(application, QString()); - - initConfirmationsPage(); - - appTabWidget->addTab( confirm, QString() ); - - appColors = new QWidget(); - QVBoxLayout * appColorsLayout = new QVBoxLayout( appColors ); - QGroupBox * groupBoxAppCol = new QGroupBox(); - appColorsLayout->addWidget( groupBoxAppCol ); - QGridLayout * colorsBoxLayout = new QGridLayout( groupBoxAppCol ); - - lblWorkspace = new QLabel(); - colorsBoxLayout->addWidget( lblWorkspace, 0, 0 ); - btnWorkspace = new ColorButton(); - btnWorkspace->setColor(app->workspaceColor); - colorsBoxLayout->addWidget( btnWorkspace, 0, 1 ); - - lblPanels = new QLabel(); - colorsBoxLayout->addWidget( lblPanels, 1, 0 ); - btnPanels = new ColorButton(); - colorsBoxLayout->addWidget( btnPanels, 1, 1 ); - btnPanels->setColor(app->panelsColor); - - lblPanelsText = new QLabel(); - colorsBoxLayout->addWidget( lblPanelsText, 2, 0 ); - btnPanelsText = new ColorButton(); - colorsBoxLayout->addWidget( btnPanelsText, 2, 1 ); - btnPanelsText->setColor(app->panelsTextColor); - - colorsBoxLayout->setRowStretch( 3, 1 ); - - appTabWidget->addTab( appColors, QString() ); - - numericFormatPage = new QWidget(); - QVBoxLayout *numLayout = new QVBoxLayout( numericFormatPage ); - QGroupBox *numericFormatBox = new QGroupBox(); - numLayout->addWidget( numericFormatBox ); - QGridLayout *numericFormatLayout = new QGridLayout( numericFormatBox ); - - lblAppPrecision = new QLabel(); - numericFormatLayout->addWidget(lblAppPrecision, 0, 0); - boxAppPrecision = new QSpinBox(); - boxAppPrecision->setRange(0, 14); - boxAppPrecision->setValue(app->d_decimal_digits); - numericFormatLayout->addWidget(boxAppPrecision, 0, 1); - - lblDecimalSeparator = new QLabel(); - numericFormatLayout->addWidget(lblDecimalSeparator, 1, 0 ); - boxDecimalSeparator = new QComboBox(); - boxDecimalSeparator->addItem(tr("System Locale Setting")); - boxDecimalSeparator->addItem("1,000.0"); - boxDecimalSeparator->addItem("1.000,0"); - boxDecimalSeparator->addItem("1 000,0"); - - numericFormatLayout->addWidget(boxDecimalSeparator, 1, 1); - - boxThousandsSeparator = new QCheckBox(); - boxThousandsSeparator->setChecked(app->locale().numberOptions() & QLocale::OmitGroupSeparator); - numericFormatLayout->addWidget(boxThousandsSeparator, 1, 2); - - lblClipboardSeparator = new QLabel(); - numericFormatLayout->addWidget(lblClipboardSeparator, 2, 0 ); - boxClipboardLocale = new QComboBox(); - boxClipboardLocale->addItem(tr("System Locale Setting")); - boxClipboardLocale->addItem("1,000.0"); - boxClipboardLocale->addItem("1.000,0"); - boxClipboardLocale->addItem("1 000,0"); - numericFormatLayout->addWidget(boxClipboardLocale, 2, 1); - - numericFormatLayout->setRowStretch(3, 1); - appTabWidget->addTab( numericFormatPage, QString() ); - - initFileLocationsPage(); - initProxyPage(); - - connect( boxLanguage, SIGNAL( activated(int) ), this, SLOT( switchToLanguage(int) ) ); - connect( fontsBtn, SIGNAL( clicked() ), this, SLOT( pickApplicationFont() ) ); - connect( boxSave, SIGNAL( toggled(bool) ), boxMinutes, SLOT( setEnabled(bool) ) ); -} - -void ConfigDialog::initNotesPage() -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - notesPage = new QWidget(); - - QGroupBox *gb1 = new QGroupBox(); - QGridLayout * gl1 = new QGridLayout(gb1); - gl1->setSpacing(5); - - labelTabLength = new QLabel(); - gl1->addWidget(labelTabLength, 0, 0); - - boxTabLength = new QSpinBox(); - boxTabLength->setRange(0, 1000); - boxTabLength->setSingleStep(5); - boxTabLength->setValue(app->d_notes_tab_length); - connect(boxTabLength, SIGNAL(valueChanged(int)), this, SLOT(customizeNotes())); - gl1->addWidget(boxTabLength, 0, 1); - - labelNotesFont = new QLabel(); - gl1->addWidget(labelNotesFont, 1, 0); - - boxFontFamily = new QFontComboBox(); - boxFontFamily->setCurrentFont(app->d_notes_font); - connect(boxFontFamily, SIGNAL(activated(int)), this, SLOT(customizeNotes())); - gl1->addWidget(boxFontFamily, 1, 1); - - boxFontSize = new QSpinBox(); - boxFontSize->setRange(0, 1000); - boxFontSize->setValue(app->d_notes_font.pointSize()); - connect(boxFontSize, SIGNAL(valueChanged(int)), this, SLOT(customizeNotes())); - gl1->addWidget(boxFontSize, 1, 2); - - buttonBoldFont = new QPushButton(tr("&B")); - QFont font = QFont(); - font.setBold(true); - buttonBoldFont->setFont(font); - buttonBoldFont->setCheckable(true); - buttonBoldFont->setChecked(app->d_notes_font.bold()); - connect(buttonBoldFont, SIGNAL(clicked()), this, SLOT(customizeNotes())); - gl1->addWidget(buttonBoldFont, 1, 3); - - buttonItalicFont = new QPushButton(tr("&It")); - font = QFont(); - font.setItalic(true); - buttonItalicFont->setFont(font); - buttonItalicFont->setCheckable(true); - buttonItalicFont->setChecked(app->d_notes_font.italic()); - connect(buttonItalicFont, SIGNAL(clicked()), this, SLOT(customizeNotes())); - gl1->addWidget(buttonItalicFont, 1, 4); - - lineNumbersBox = new QCheckBox(); - lineNumbersBox->setChecked(app->d_note_line_numbers); - connect(lineNumbersBox, SIGNAL(toggled(bool)), this, SLOT(customizeNotes())); - gl1->addWidget(lineNumbersBox, 2, 0); - gl1->setColumnStretch(5, 1); - - QVBoxLayout* vl = new QVBoxLayout(notesPage); - vl->addWidget(gb1); - - groupSyntaxHighlighter = new QGroupBox(); - QGridLayout *gl = new QGridLayout(groupSyntaxHighlighter); - - buttonCommentLabel = new QLabel; - gl->addWidget(buttonCommentLabel, 0, 0); - - buttonCommentColor = new ColorButton(); - buttonCommentColor->setColor(app->d_comment_highlight_color); - connect(buttonCommentColor, SIGNAL(colorChanged()), this, SLOT(rehighlight())); - gl->addWidget(buttonCommentColor, 0, 1); - buttonCommentLabel->setBuddy (buttonCommentColor); - - buttonKeywordLabel = new QLabel; - gl->addWidget(buttonKeywordLabel, 1, 0); - - buttonKeywordColor = new ColorButton(); - buttonKeywordColor->setColor(app->d_keyword_highlight_color); - connect(buttonKeywordColor, SIGNAL(colorChanged()), this, SLOT(rehighlight())); - gl->addWidget(buttonKeywordColor, 1, 1); - buttonKeywordLabel->setBuddy (buttonKeywordColor); - - buttonQuotationLabel = new QLabel; - gl->addWidget(buttonQuotationLabel, 2, 0); - - buttonQuotationColor = new ColorButton(); - buttonQuotationColor->setColor(app->d_quotation_highlight_color); - connect(buttonQuotationColor, SIGNAL(colorChanged()), this, SLOT(rehighlight())); - gl->addWidget(buttonQuotationColor, 2, 1); - buttonQuotationLabel->setBuddy (buttonQuotationColor); - - buttonNumericLabel = new QLabel; - gl->addWidget(buttonNumericLabel, 3, 0); - - buttonNumericColor = new ColorButton(); - buttonNumericColor->setColor(app->d_numeric_highlight_color); - connect(buttonNumericColor, SIGNAL(colorChanged()), this, SLOT(rehighlight())); - gl->addWidget(buttonNumericColor, 3, 1); - buttonNumericLabel->setBuddy (buttonNumericColor); - - buttonFunctionLabel = new QLabel; - gl->addWidget(buttonFunctionLabel, 4, 0); - - buttonFunctionColor = new ColorButton(); - buttonFunctionColor->setColor(app->d_function_highlight_color); - connect(buttonFunctionColor, SIGNAL(colorChanged()), this, SLOT(rehighlight())); - gl->addWidget(buttonFunctionColor, 4, 1); - buttonFunctionLabel->setBuddy (buttonFunctionColor); - - buttonClassLabel = new QLabel; - gl->addWidget(buttonClassLabel, 5, 0); - - buttonClassColor = new ColorButton(); - buttonClassColor->setColor(app->d_class_highlight_color); - connect(buttonClassColor, SIGNAL(colorChanged()), this, SLOT(rehighlight())); - gl->addWidget(buttonClassColor, 5, 1); - buttonClassLabel->setBuddy (buttonClassColor); - gl->setRowStretch(6, 1); - - vl->addWidget(groupSyntaxHighlighter); - - vl->addStretch(); -} - -void ConfigDialog::initFittingPage() -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - fitPage = new QWidget(); - - groupBoxFittingCurve = new QGroupBox(); - QGridLayout * fittingCurveLayout = new QGridLayout(groupBoxFittingCurve); - fittingCurveLayout->setSpacing(5); - - generatePointsBtn = new QRadioButton(); - generatePointsBtn->setChecked(app->generateUniformFitPoints); - fittingCurveLayout->addWidget(generatePointsBtn, 0, 0); - - lblPoints = new QLabel(); - fittingCurveLayout->addWidget(lblPoints, 0, 1); - generatePointsBox = new QSpinBox(); - generatePointsBox->setRange(0, 1000000); - generatePointsBox->setSingleStep(10); - generatePointsBox->setValue(app->fitPoints); - fittingCurveLayout->addWidget(generatePointsBox, 0, 2); - - linearFit2PointsBox = new QCheckBox(); - linearFit2PointsBox->setChecked(app->d_2_linear_fit_points); - fittingCurveLayout->addWidget(linearFit2PointsBox, 0, 3); - - showPointsBox(!app->generateUniformFitPoints); - - samePointsBtn = new QRadioButton(); - samePointsBtn->setChecked(!app->generateUniformFitPoints); - fittingCurveLayout->addWidget(samePointsBtn, 1, 0); - - groupBoxMultiPeak = new QGroupBox(); - groupBoxMultiPeak->setCheckable(true); - groupBoxMultiPeak->setChecked(app->generatePeakCurves); - - QHBoxLayout * multiPeakLayout = new QHBoxLayout(groupBoxMultiPeak); - - lblPeaksColor = new QLabel(); - multiPeakLayout->addWidget(lblPeaksColor); - boxPeaksColor = new ColorBox(0); - boxPeaksColor->setCurrentItem(app->peakCurvesColor); - multiPeakLayout->addWidget(boxPeaksColor); - - groupBoxFitParameters = new QGroupBox(); - QGridLayout * fitParamsLayout = new QGridLayout(groupBoxFitParameters); - - lblPrecision = new QLabel(); - fitParamsLayout->addWidget(lblPrecision, 0, 0); - boxPrecision = new QSpinBox(); - fitParamsLayout->addWidget(boxPrecision, 0, 1); - boxPrecision->setValue(app->fit_output_precision); - - logBox = new QCheckBox(); - logBox->setChecked(app->writeFitResultsToLog); - fitParamsLayout->addWidget(logBox, 1, 0); - - plotLabelBox = new QCheckBox(); - plotLabelBox->setChecked(app->pasteFitResultsToPlot); - fitParamsLayout->addWidget(plotLabelBox, 2, 0); - - scaleErrorsBox = new QCheckBox(); - fitParamsLayout->addWidget(scaleErrorsBox, 3, 0); - scaleErrorsBox->setChecked(app->fit_scale_errors); - - QVBoxLayout* fitPageLayout = new QVBoxLayout(fitPage); - fitPageLayout->addWidget(groupBoxFittingCurve); - fitPageLayout->addWidget(groupBoxMultiPeak); - fitPageLayout->addWidget(groupBoxFitParameters); - fitPageLayout->addStretch(); - - connect(samePointsBtn, SIGNAL(toggled(bool)), this, SLOT(showPointsBox(bool))); - connect(generatePointsBtn, SIGNAL(toggled(bool)), this, SLOT(showPointsBox(bool))); -} - - -void ConfigDialog::initCurvesPage() -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - - curves = new QWidget(); - - QGroupBox * curvesGroupBox = new QGroupBox(); - QGridLayout * curvesBoxLayout = new QGridLayout( curvesGroupBox ); - - lblCurveStyle = new QLabel(); - curvesBoxLayout->addWidget( lblCurveStyle, 0, 0 ); - boxCurveStyle = new QComboBox(); - curvesBoxLayout->addWidget( boxCurveStyle, 0, 1 ); - - lblLineWidth = new QLabel(); - curvesBoxLayout->addWidget( lblLineWidth, 1, 0 ); - boxCurveLineWidth = new DoubleSpinBox('f'); - boxCurveLineWidth->setLocale(app->locale()); - boxCurveLineWidth->setSingleStep(0.1); - boxCurveLineWidth->setRange(0.1, 100); - boxCurveLineWidth->setValue(app->defaultCurveLineWidth); - curvesBoxLayout->addWidget( boxCurveLineWidth, 1, 1 ); - - lblSymbSize = new QLabel(); - curvesBoxLayout->addWidget( lblSymbSize, 2, 0 ); - boxSymbolSize = new QSpinBox(); - boxSymbolSize->setRange(1,100); - boxSymbolSize->setValue(app->defaultSymbolSize/2); - curvesBoxLayout->addWidget( boxSymbolSize, 2, 1 ); - - curvesBoxLayout->setRowStretch( 3, 1 ); - - QHBoxLayout * curvesPageLayout = new QHBoxLayout( curves ); - curvesPageLayout->addWidget( curvesGroupBox ); -} - -void ConfigDialog::initAxesPage() -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - if (!app) - return; - - axesPage = new QWidget(); - - QGroupBox * axisOptions = new QGroupBox(); - QGridLayout * axisOptionsLayout = new QGridLayout( axisOptions ); - - boxBackbones= new QCheckBox(); - boxBackbones->setChecked(app->drawBackbones); - axisOptionsLayout->addWidget(boxBackbones, 0, 0); - - lblAxesLineWidth = new QLabel(); - axisOptionsLayout->addWidget(lblAxesLineWidth, 1, 0); - boxLineWidth= new QSpinBox(); - boxLineWidth->setRange(0, 100); - boxLineWidth->setValue(app->axesLineWidth); - axisOptionsLayout->addWidget(boxLineWidth, 1, 1); - - labelGraphAxesLabelsDist = new QLabel(); - axisOptionsLayout->addWidget(labelGraphAxesLabelsDist, 2, 0); - boxAxesLabelsDist = new QSpinBox(); - boxAxesLabelsDist->setRange(0, 1000); - boxAxesLabelsDist->setValue(app->d_graph_axes_labels_dist); - axisOptionsLayout->addWidget(boxAxesLabelsDist, 2, 1); - axisOptionsLayout->setRowStretch(3, 1); - - enabledAxesGroupBox = new QGroupBox(); - enabledAxesGrid = new QGridLayout( enabledAxesGroupBox ); - - enableAxisLabel = new QLabel(); - enabledAxesGrid->addWidget(enableAxisLabel, 0, 2); - showNumbersLabel = new QLabel(); - enabledAxesGrid->addWidget(showNumbersLabel, 0, 3); - - QLabel *pixLabel = new QLabel(); - pixLabel->setPixmap (QPixmap ( ( const char** ) left_axis_xpm )); - enabledAxesGrid->addWidget(pixLabel, 1, 0); - yLeftLabel = new QLabel(); - enabledAxesGrid->addWidget(yLeftLabel, 1, 1); - - pixLabel = new QLabel(); - pixLabel->setPixmap (QPixmap ( ( const char** ) right_axis_xpm )); - enabledAxesGrid->addWidget(pixLabel, 2, 0); - yRightLabel = new QLabel(); - enabledAxesGrid->addWidget(yRightLabel, 2, 1); - - pixLabel = new QLabel(); - pixLabel->setPixmap (QPixmap ( ( const char** ) bottom_axis_xpm )); - enabledAxesGrid->addWidget(pixLabel, 3, 0); - xBottomLabel = new QLabel(); - enabledAxesGrid->addWidget(xBottomLabel, 3, 1); - - pixLabel = new QLabel(); - pixLabel->setPixmap (QPixmap ( ( const char** ) top_axis_xpm )); - enabledAxesGrid->addWidget(pixLabel, 4, 0); - xTopLabel = new QLabel(); - enabledAxesGrid->addWidget(xTopLabel, 4, 1); - - for (int i = 0; i < QwtPlot::axisCnt; i++){ - QCheckBox *box1 = new QCheckBox(); - int row = i + 1; - - enabledAxesGrid->addWidget(box1, row, 2); - bool enabledAxis = app->d_show_axes[i]; - box1->setChecked(enabledAxis); - - QCheckBox *box2 = new QCheckBox(); - enabledAxesGrid->addWidget(box2, row, 3); - box2->setChecked(app->d_show_axes_labels[i]); - box2->setEnabled(enabledAxis); - - connect(box1, SIGNAL(toggled(bool)), box2, SLOT(setEnabled(bool))); - } - enabledAxesGrid->setColumnStretch (0, 0); - enabledAxesGrid->setColumnStretch (1, 1); - enabledAxesGrid->setColumnStretch (2, 1); - - QVBoxLayout * axesPageLayout = new QVBoxLayout( axesPage ); - axesPageLayout->addWidget(axisOptions); - axesPageLayout->addWidget(enabledAxesGroupBox); -} - -void ConfigDialog::initConfirmationsPage() -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - confirm = new QWidget(); - - groupBoxConfirm = new QGroupBox(); - QVBoxLayout * layout = new QVBoxLayout( groupBoxConfirm ); - - boxFolders = new QCheckBox(); - boxFolders->setChecked(app->confirmCloseFolder); - layout->addWidget( boxFolders ); - - boxTables = new QCheckBox(); - boxTables->setChecked(app->confirmCloseTable); - layout->addWidget( boxTables ); - - boxMatrices = new QCheckBox(); - boxMatrices->setChecked(app->confirmCloseMatrix); - layout->addWidget( boxMatrices ); - - boxPlots2D = new QCheckBox(); - boxPlots2D->setChecked(app->confirmClosePlot2D); - layout->addWidget( boxPlots2D ); - - boxPlots3D = new QCheckBox(); - boxPlots3D->setChecked(app->confirmClosePlot3D); - layout->addWidget( boxPlots3D ); - - boxNotes = new QCheckBox(); - boxNotes->setChecked(app->confirmCloseNotes); - layout->addWidget( boxNotes ); - layout->addStretch(); - - boxPromptRenameTables = new QCheckBox(); - boxPromptRenameTables->setChecked(app->d_inform_rename_table); - - QVBoxLayout * confirmPageLayout = new QVBoxLayout( confirm ); - confirmPageLayout->addWidget(groupBoxConfirm); - confirmPageLayout->addWidget(boxPromptRenameTables); - confirmPageLayout->addStretch(); -} - -void ConfigDialog::initFileLocationsPage() -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - fileLocationsPage = new QWidget(); - - QCompleter *completer = new QCompleter(this); - completer->setModel(new QDirModel(completer)); - completer->setModelSorting(QCompleter::CaseSensitivelySortedModel); - completer->setCompletionMode(QCompleter::InlineCompletion); - - QGroupBox *gb = new QGroupBox(); - QGridLayout *gl = new QGridLayout(gb); - - lblTranslationsPath = new QLabel(tr("Translations")); - gl->addWidget(lblTranslationsPath , 0, 0); - - translationsPathLine = new QLineEdit(); - translationsPathLine->setText(QDir::toNativeSeparators(app->d_translations_folder)); - translationsPathLine->setCompleter(completer); - gl->addWidget(translationsPathLine, 0, 1); - - QPushButton *browseTranslationsBtn = new QPushButton(); - browseTranslationsBtn->setIcon(QIcon(QPixmap(choose_folder_xpm))); - gl->addWidget(browseTranslationsBtn, 0, 2); - - lblHelpPath = new QLabel(tr("Help")); - gl->addWidget(lblHelpPath, 1, 0 ); - - QFileInfo hfi(app->helpFilePath); - helpPathLine = new QLineEdit(QDir::toNativeSeparators(hfi.dir().absolutePath())); - helpPathLine->setCompleter(completer); - gl->addWidget( helpPathLine, 1, 1); - - QPushButton *browseHelpBtn = new QPushButton(); - browseHelpBtn->setIcon(QIcon(QPixmap(choose_folder_xpm))); - gl->addWidget(browseHelpBtn, 1, 2); - - texCompilerLabel = new QLabel(tr("LaTeX Compiler")); - gl->addWidget(texCompilerLabel, 2, 0); - - texCompilerPathBox = new QLineEdit(QDir::toNativeSeparators(app->d_latex_compiler_path)); - texCompilerPathBox->setCompleter(completer); - connect(texCompilerPathBox, SIGNAL(editingFinished ()), this, SLOT(validateTexCompiler())); - - gl->addWidget(texCompilerPathBox, 2, 1); - - browseTexCompilerBtn = new QPushButton; - browseTexCompilerBtn->setIcon(QIcon(QPixmap(choose_folder_xpm))); - connect(browseTexCompilerBtn, SIGNAL(clicked()), this, SLOT(chooseTexCompiler())); - - gl->addWidget(browseTexCompilerBtn, 2, 2); - gl->setRowStretch(3, 1); - -#ifdef SCRIPTING_PYTHON - lblPythonConfigDir = new QLabel(tr("Python Configuration Files")); - gl->addWidget(lblPythonConfigDir, 3, 0); - - pythonConfigDirLine = new QLineEdit(QDir::toNativeSeparators(app->d_python_config_folder)); - pythonConfigDirLine->setCompleter(completer); - gl->addWidget(pythonConfigDirLine, 3, 1); - - QPushButton *browsePythonConfigBtn = new QPushButton(); - browsePythonConfigBtn->setIcon(QIcon(QPixmap(choose_folder_xpm))); - connect(browsePythonConfigBtn, SIGNAL(clicked()), this, SLOT(choosePythonConfigFolder())); - gl->addWidget(browsePythonConfigBtn, 3, 2); - gl->setRowStretch(4, 1); -#endif - - - QVBoxLayout *vl = new QVBoxLayout(fileLocationsPage); - vl->addWidget(gb); - - appTabWidget->addTab(fileLocationsPage, QString()); - - connect(browseTranslationsBtn, SIGNAL(clicked()), this, SLOT(chooseTranslationsFolder())); - connect(browseHelpBtn, SIGNAL(clicked()), this, SLOT(chooseHelpFolder())); -} - -void ConfigDialog::languageChange() -{ - setWindowTitle( tr( "QtiPlot - Choose default settings" ) ); - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - - // pages list - itemsList->clear(); - itemsList->addItem( tr( "General" ) ); - itemsList->addItem( tr( "Tables" ) ); - itemsList->addItem( tr( "2D Plots" ) ); - itemsList->addItem( tr( "3D Plots" ) ); - itemsList->addItem( tr( "Notes" ) ); - itemsList->addItem( tr( "Fitting" ) ); - itemsList->setCurrentRow(0); - itemsList->item(0)->setIcon(QIcon(QPixmap(general_xpm))); - itemsList->item(1)->setIcon(QIcon(QPixmap(configTable_xpm))); - itemsList->item(2)->setIcon(QIcon(QPixmap(config_curves_xpm))); - itemsList->item(3)->setIcon(QIcon(QPixmap(logo_xpm))); - itemsList->item(4)->setIcon(QIcon(QPixmap(notes_32_xpm))); - itemsList->item(5)->setIcon(QIcon(QPixmap(fit_xpm))); - - //plots 2D page - plotsTabWidget->setTabText(plotsTabWidget->indexOf(plotOptions), tr("Options")); - plotsTabWidget->setTabText(plotsTabWidget->indexOf(curves), tr("Curves")); - plotsTabWidget->setTabText(plotsTabWidget->indexOf(axesPage), tr("Axes")); - plotsTabWidget->setTabText(plotsTabWidget->indexOf(plotTicks), tr("Ticks")); - plotsTabWidget->setTabText(plotsTabWidget->indexOf(plotFonts), tr("Fonts")); - - boxResize->setText(tr("Do not &resize layers when window size changes")); - boxLabelsEditing->setText(tr("&Disable in-place editing")); - lblMinTicksLength->setText(tr("Length")); - - lblMajTicksLength->setText(tr("Length" )); - lblMajTicks->setText(tr("Major Ticks" )); - lblMinTicks->setText(tr("Minor Ticks" )); - - lblMargin->setText(tr("Margin" )); - labelGraphAxesLabelsDist->setText(tr("Axes title space" )); - labelFrameWidth->setText(tr("Frame width" )); - boxFrame->setText(tr("Canvas Fra&me")); - boxTitle->setText(tr("Show &Title")); - boxScaleFonts->setText(tr("Scale &Fonts")); - boxAutoscaling->setText(tr("Auto&scaling")); - boxAntialiasing->setText(tr("Antia&liasing")); - - legendDisplayLabel->setText(tr("Legend display" )); - legendDisplayBox->clear(); - legendDisplayBox->addItem(tr("Column name")); - legendDisplayBox->addItem(tr("Column comment")); - legendDisplayBox->addItem(tr("Table name")); - legendDisplayBox->addItem(tr("Table legend")); - legendDisplayBox->setCurrentIndex(app->d_graph_legend_display); - - groupBackgroundOptions->setTitle(tr("Background")); - labelGraphBkgColor->setText(tr("Background Color")); - labelGraphBkgOpacity->setText(tr( "Opacity" )); - labelGraphCanvasColor->setText(tr("Canvas Color" )); - labelGraphCanvasOpacity->setText(tr("Opacity")); - labelGraphFrameColor->setText(tr("Border Color")); - labelGraphFrameWidth->setText(tr( "Width" )); - boxBackgroundTransparency->setSpecialValueText(tr("Transparent")); - boxCanvasTransparency->setSpecialValueText(tr("Transparent")); - - // axes page - boxBackbones->setText(tr("Axes &backbones")); - lblAxesLineWidth->setText(tr("Axes linewidth" )); - - yLeftLabel->setText(tr("Left")); - yRightLabel->setText(tr("Right")); - xBottomLabel->setText(tr("Bottom")); - xTopLabel->setText(tr("Top")); - - enabledAxesGroupBox->setTitle(tr("Enabled axes" )); - enableAxisLabel->setText(tr( "Show" )); - showNumbersLabel->setText(tr( "Labels" )); - - boxMajTicks->clear(); - boxMajTicks->addItem(tr("None")); - boxMajTicks->addItem(tr("Out")); - boxMajTicks->addItem(tr("In & Out")); - boxMajTicks->addItem(tr("In")); - - boxMinTicks->clear(); - boxMinTicks->addItem(tr("None")); - boxMinTicks->addItem(tr("Out")); - boxMinTicks->addItem(tr("In & Out")); - boxMinTicks->addItem(tr("In")); - - boxMajTicks->setCurrentIndex(app->majTicksStyle); - boxMinTicks->setCurrentIndex(app->minTicksStyle); - - plotsTabWidget->setTabText(plotsTabWidget->indexOf(plotPrint), tr("Print")); - boxPrintCropmarks->setText(tr("Print Crop&marks")); - boxScaleLayersOnPrint->setText(tr("&Scale layers to paper size")); - - //confirmations page - groupBoxConfirm->setTitle(tr("Prompt on closing")); - boxFolders->setText(tr("Folders")); - boxTables->setText(tr("Tables")); - boxPlots3D->setText(tr("3D Plots")); - boxPlots2D->setText(tr("2D Plots")); - boxMatrices->setText(tr("Matrices")); - boxNotes->setText(tr("&Notes")); - - buttonOk->setText( tr( "&OK" ) ); - buttonCancel->setText( tr( "&Cancel" ) ); - buttonApply->setText( tr( "&Apply" ) ); - buttonTextFont->setText( tr( "&Text Font" ) ); - buttonHeaderFont->setText( tr( "&Labels Font" ) ); - buttonAxesFont->setText( tr( "A&xes Labels" ) ); - buttonNumbersFont->setText( tr( "Axes &Numbers" ) ); - buttonLegendFont->setText( tr( "&Legend" ) ); - buttonTitleFont->setText( tr( "T&itle" ) ); - boxPromptRenameTables->setText( tr( "Prompt on &renaming tables when appending projects" ) ); - - //application page - appTabWidget->setTabText(appTabWidget->indexOf(application), tr("Application")); - appTabWidget->setTabText(appTabWidget->indexOf(confirm), tr("Confirmations")); - appTabWidget->setTabText(appTabWidget->indexOf(appColors), tr("Colors")); - appTabWidget->setTabText(appTabWidget->indexOf(numericFormatPage), tr("Numeric Format")); - appTabWidget->setTabText(appTabWidget->indexOf(fileLocationsPage), tr("File Locations")); - appTabWidget->setTabText(appTabWidget->indexOf(proxyPage), tr("&Internet Connection")); - - lblLanguage->setText(tr("Language")); - lblStyle->setText(tr("Style")); - lblFonts->setText(tr("Main Font")); - fontsBtn->setText(tr("Choose &font")); - lblWorkspace->setText(tr("Workspace")); - lblPanelsText->setText(tr("Panels text")); - lblPanels->setText(tr("Panels")); - boxSave->setText(tr("Save every")); - boxBackupProject->setText(tr("&Backup project before saving")); - boxSearchUpdates->setText(tr("Check for new versions at startup")); - boxMinutes->setSuffix(tr(" minutes")); - lblScriptingLanguage->setText(tr("Default scripting language")); - lblUndoStackSize->setText(tr("Matrix Undo Stack Size")); - lblEndOfLine->setText(tr("Endline character")); - lblInitWindow->setText(tr("Start New Project")); - boxInitWindow->clear(); - boxInitWindow->addItem(tr("Empty")); - boxInitWindow->addItem(tr("Table")); - boxInitWindow->addItem(tr("Matrix")); - boxInitWindow->addItem(tr("Empty Graph")); - boxInitWindow->addItem(tr("Note")); - boxInitWindow->setCurrentIndex((int)app->d_init_window_type); - completionBox->setText(tr("&Enable autocompletion (Ctrl+U)")); - - lblAppPrecision->setText(tr("Number of Decimal Digits")); - lblDecimalSeparator->setText(tr("Decimal Separators")); - boxDecimalSeparator->clear(); - boxDecimalSeparator->addItem(tr("System Locale Setting")); - boxDecimalSeparator->addItem("1,000.0"); - boxDecimalSeparator->addItem("1.000,0"); - boxDecimalSeparator->addItem("1 000,0"); - boxThousandsSeparator->setText(tr("Omit &Thousands Separator")); - - QLocale locale = app->locale(); - if (locale.name() == QLocale::c().name()) - boxDecimalSeparator->setCurrentIndex(1); - else if (locale.name() == QLocale(QLocale::German).name()) - boxDecimalSeparator->setCurrentIndex(2); - else if (locale.name() == QLocale(QLocale::French).name()) - boxDecimalSeparator->setCurrentIndex(3); - - lblClipboardSeparator->setText(tr("Clipboard Decimal Separators")); - boxClipboardLocale->clear(); - boxClipboardLocale->addItem(tr("System Locale Setting")); - boxClipboardLocale->addItem("1,000.0"); - boxClipboardLocale->addItem("1.000,0"); - boxClipboardLocale->addItem("1 000,0"); - - if (app->clipboardLocale().name() == QLocale::c().name()) - boxClipboardLocale->setCurrentIndex(1); - else if (app->clipboardLocale().name() == QLocale(QLocale::German).name()) - boxClipboardLocale->setCurrentIndex(2); - else if (app->clipboardLocale().name() == QLocale(QLocale::French).name()) - boxClipboardLocale->setCurrentIndex(3); - - lblTranslationsPath->setText(tr("Translations")); - lblHelpPath->setText(tr("Help")); -#ifdef SCRIPTING_PYTHON - lblPythonConfigDir->setText(tr("Python Configuration Files")); -#endif - - //proxy tab - proxyGroupBox->setTitle(tr("&Proxy")); - proxyHostLabel->setText(tr("Host")); - proxyPortLabel->setText(tr("Port")); - proxyUserLabel->setText(tr("Username")); - proxyPasswordLabel->setText(tr("Password")); - - //tables page - boxUpdateTableValues->setText(tr("Automatically &Recalculate Column Values")); - boxTableComments->setText(tr("&Display Comments in Header")); - groupBoxTableCol->setTitle(tr("Colors")); - lblSeparator->setText(tr("Default Column Separator")); - boxSeparator->clear(); - boxSeparator->addItem(tr("TAB")); - boxSeparator->addItem(tr("SPACE")); - boxSeparator->addItem(";" + tr("TAB")); - boxSeparator->addItem("," + tr("TAB")); - boxSeparator->addItem(";" + tr("SPACE")); - boxSeparator->addItem("," + tr("SPACE")); - boxSeparator->addItem(";"); - boxSeparator->addItem(","); - setColumnSeparator(app->columnSeparator); - - lblTableBackground->setText(tr( "Background" )); - lblTextColor->setText(tr( "Text" )); - lblHeaderColor->setText(tr("Labels")); - groupBoxTableFonts->setTitle(tr("Fonts")); - - //curves page - lblCurveStyle->setText(tr( "Default curve style" )); - lblLineWidth->setText(tr( "Line width" )); - lblSymbSize->setText(tr( "Symbol size" )); - - boxCurveStyle->clear(); - boxCurveStyle->addItem( QPixmap(lPlot_xpm), tr( " Line" ) ); - boxCurveStyle->addItem( QPixmap(pPlot_xpm), tr( " Scatter" ) ); - boxCurveStyle->addItem( QPixmap(lpPlot_xpm), tr( " Line + Symbol" ) ); - boxCurveStyle->addItem( QPixmap(dropLines_xpm), tr( " Vertical drop lines" ) ); - boxCurveStyle->addItem( QPixmap(spline_xpm), tr( " Spline" ) ); - boxCurveStyle->addItem( QPixmap(vert_steps_xpm), tr( " Vertical steps" ) ); - boxCurveStyle->addItem( QPixmap(hor_steps_xpm), tr( " Horizontal steps" ) ); - boxCurveStyle->addItem( QPixmap(area_xpm), tr( " Area" ) ); - boxCurveStyle->addItem( QPixmap(vertBars_xpm), tr( " Vertical Bars" ) ); - boxCurveStyle->addItem( QPixmap(hBars_xpm), tr( " Horizontal Bars" ) ); - - int style = app->defaultCurveStyle; - if (style == Graph::Line) - boxCurveStyle->setCurrentItem(0); - else if (style == Graph::Scatter) - boxCurveStyle->setCurrentItem(1); - else if (style == Graph::LineSymbols) - boxCurveStyle->setCurrentItem(2); - else if (style == Graph::VerticalDropLines) - boxCurveStyle->setCurrentItem(3); - else if (style == Graph::Spline) - boxCurveStyle->setCurrentItem(4); - else if (style == Graph::VerticalSteps) - boxCurveStyle->setCurrentItem(5); - else if (style == Graph::HorizontalSteps) - boxCurveStyle->setCurrentItem(6); - else if (style == Graph::Area) - boxCurveStyle->setCurrentItem(7); - else if (style == Graph::VerticalBars) - boxCurveStyle->setCurrentItem(8); - else if (style == Graph::HorizontalBars) - boxCurveStyle->setCurrentItem(9); - - //plots 3D - lblResolution->setText(tr("&Resolution")); - boxResolution->setSpecialValueText( "1 " + tr("(all data shown)") ); - boxShowLegend->setText(tr( "&Show Legend" )); - lblFloorStyle->setText(tr( "&Floor style" )); - boxProjection->addItem(tr( "Empty" )); - boxProjection->addItem(tr( "Isolines" )); - boxProjection->addItem(tr( "Projection" )); - boxProjection->setCurrentIndex(app->d_3D_projection); - - boxSmoothMesh->setText(tr( "Smoot&h Line" )); - boxOrthogonal->setText(tr( "O&rthogonal" )); - btnLabels->setText( tr( "Lab&els" ) ); - btnMesh->setText( tr( "&Mesh" ) ); - btnGrid->setText( tr( "&Grid" ) ); - btnNumbers->setText( tr( "&Numbers" ) ); - btnAxes->setText( tr( "A&xes" ) ); - btnBackground3D->setText( tr( "&Background" ) ); - groupBox3DCol->setTitle(tr("Colors" )); - colorMapBox->setTitle(tr("Default Color Map" )); - - groupBox3DFonts->setTitle(tr("Fonts" )); - btnTitleFnt->setText( tr( "&Title" ) ); - btnLabelsFnt->setText( tr( "&Axes Labels" ) ); - btnNumFnt->setText( tr( "&Numbers" ) ); - boxAutoscale3DPlots->setText( tr( "Autosca&ling" ) ); - - groupBox3DGrids->setTitle(tr("Grids")); - boxMajorGrids->setText(tr("Ma&jor Grids")); - boxMinorGrids->setText(tr("Mi&nor Grids")); - - boxMajorGridStyle->clear(); - boxMajorGridStyle->addItem(tr("Solid")); - boxMajorGridStyle->addItem(tr("Dash")); - boxMajorGridStyle->addItem(tr("Dot")); - boxMajorGridStyle->addItem(tr("Dash Dot")); - boxMajorGridStyle->addItem(tr("Dash Dot Dot")); - boxMajorGridStyle->addItem(tr("Short Dash")); - boxMajorGridStyle->addItem(tr("Short Dot")); - boxMajorGridStyle->addItem(tr("Short Dash Dot")); - boxMajorGridStyle->setCurrentIndex(app->d_3D_major_style); - - boxMinorGridStyle->clear(); - boxMinorGridStyle->addItem(tr("Solid")); - boxMinorGridStyle->addItem(tr("Dash")); - boxMinorGridStyle->addItem(tr("Dot")); - boxMinorGridStyle->addItem(tr("Dash Dot")); - boxMinorGridStyle->addItem(tr("Dash Dot Dot")); - boxMinorGridStyle->addItem(tr("Short Dash")); - boxMinorGridStyle->addItem(tr("Short Dot")); - boxMinorGridStyle->addItem(tr("Short Dash Dot")); - boxMinorGridStyle->setCurrentIndex(app->d_3D_minor_style); - - label3DGridsColor->setText(tr("Color")); - label3DGridsWidth->setText(tr("Width")); - label3DGridsStyle->setText(tr("Style")); - - //Notes page - labelTabLength->setText(tr("Tab length (pixels)")); - labelNotesFont->setText(tr("Font")); - lineNumbersBox->setText(tr("&Display line numbers")); - - groupSyntaxHighlighter->setTitle(tr("Syntax Highlighting")); - buttonCommentLabel->setText(tr("Co&mments")); - buttonKeywordLabel->setText(tr("&Keywords")); - buttonNumericLabel->setText(tr("&Numbers")); - buttonQuotationLabel->setText(tr("&Quotations")); - buttonFunctionLabel->setText(tr("&Functions")); - buttonClassLabel->setText(tr("Q&t Classes")); - - //Fitting page - groupBoxFittingCurve->setTitle(tr("Generated Fit Curve")); - generatePointsBtn->setText(tr("Uniform X Function")); - lblPoints->setText( tr("Points") ); - samePointsBtn->setText( tr( "Same X as Fitting Data" ) ); - linearFit2PointsBox->setText( tr( "2 points for linear fits" ) ); - - groupBoxMultiPeak->setTitle(tr("Display Peak Curves for Multi-peak Fits")); - - groupBoxFitParameters->setTitle(tr("Parameters Output")); - lblPrecision->setText(tr("Significant Digits")); - logBox->setText(tr("Write Parameters to Result Log")); - plotLabelBox->setText(tr("Paste Parameters to Plot")); - scaleErrorsBox->setText(tr("Scale Errors with sqrt(Chi^2/doF)")); - groupBoxMultiPeak->setTitle(tr("Display Peak Curves for Multi-peak Fits")); - lblPeaksColor->setText(tr("Peaks Color")); - - updateMenuList(); -} - -void ConfigDialog::accept() -{ - apply(); - close(); -} - -void ConfigDialog::apply() -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - if (!app) - return; - - // tables page - QString sep = boxSeparator->currentText(); - sep.replace(tr("TAB"), "\t", false); - sep.replace("\\t", "\t"); - sep.replace(tr("SPACE"), " "); - sep.replace("\\s", " "); - - if (sep.contains(QRegExp("[0-9.eE+-]"))!=0){ - QMessageBox::warning(0, tr("QtiPlot - Import options error"), - tr("The separator must not contain the following characters: 0-9eE.+-")); - return; - } - - app->columnSeparator = sep; - app->setAutoUpdateTableValues(boxUpdateTableValues->isChecked()); - - app->tableBkgdColor = buttonBackground->color(); - app->tableTextColor = buttonText->color(); - app->tableHeaderColor = buttonHeader->color(); - app->tableTextFont = textFont; - app->tableHeaderFont = headerFont; - app->d_show_table_comments = boxTableComments->isChecked(); - - QColorGroup cg; - cg.setColor(QColorGroup::Base, buttonBackground->color()); - cg.setColor(QColorGroup::Text, buttonText->color()); - QPalette palette(cg, cg, cg); - - QList windows = app->windowsList(); - foreach(MdiSubWindow *w, windows){ - if (w->inherits("Table")){ - Table *t = (Table*)w; - w->setPalette(palette); - t->setHeaderColor(buttonHeader->color()); - t->setTextFont(textFont); - t->setHeaderFont(headerFont); - t->showComments(boxTableComments->isChecked()); - } - } - - app->d_graph_background_color = boxBackgroundColor->color(); - app->d_graph_background_opacity = boxBackgroundTransparency->value(); - app->d_graph_canvas_color = boxCanvasColor->color(); - app->d_graph_canvas_opacity = boxCanvasTransparency->value(); - app->d_graph_border_color = boxBorderColor->color(); - app->d_graph_border_width = boxBorderWidth->value(); - - // 2D plots page: options tab - app->d_in_place_editing = !boxLabelsEditing->isChecked(); - app->titleOn = boxTitle->isChecked(); - - if (boxFrame->isChecked()) - app->canvasFrameWidth = boxFrameWidth->value(); - else - app->canvasFrameWidth = 0; - - app->defaultPlotMargin = boxMargin->value(); - app->d_graph_axes_labels_dist = boxAxesLabelsDist->value(); - app->d_graph_legend_display = (Graph::LegendDisplayMode)legendDisplayBox->currentIndex(); - app->setGraphDefaultSettings(boxAutoscaling->isChecked(), boxScaleFonts->isChecked(), - boxResize->isChecked(), boxAntialiasing->isChecked()); - // 2D plots page: curves tab - app->defaultCurveStyle = curveStyle(); - app->defaultCurveLineWidth = boxCurveLineWidth->value(); - app->defaultSymbolSize = 2*boxSymbolSize->value() + 1; - // 2D plots page: axes tab - if (generalDialog->currentWidget() == plotsTabWidget && - plotsTabWidget->currentWidget() == axesPage){ - app->drawBackbones = boxBackbones->isChecked(); - app->axesLineWidth = boxLineWidth->value(); - - for (int i = 0; i < QwtPlot::axisCnt; i++){ - int row = i + 1; - QLayoutItem *item = enabledAxesGrid->itemAtPosition(row, 2); - QCheckBox *box = qobject_cast(item->widget()); - app->d_show_axes[i] = box->isChecked(); - - item = enabledAxesGrid->itemAtPosition(row, 3); - box = qobject_cast(item->widget()); - app->d_show_axes_labels[i] = box->isChecked(); - } - } - - // 2D plots page: ticks tab - app->majTicksLength = boxMajTicksLength->value(); - app->minTicksLength = boxMinTicksLength->value(); - app->majTicksStyle = boxMajTicks->currentItem(); - app->minTicksStyle = boxMinTicks->currentItem(); - // 2D plots page: fonts tab - app->plotAxesFont=axesFont; - app->plotNumbersFont=numbersFont; - app->plotLegendFont=legendFont; - app->plotTitleFont=titleFont; - // 2D plots page: print tab - app->d_print_cropmarks = boxPrintCropmarks->isChecked(); - app->d_scale_plots_on_print = boxScaleLayersOnPrint->isChecked(); - foreach(MdiSubWindow *w, windows){ - MultiLayer *ml = qobject_cast(w); - if (ml){ - ml->setScaleLayersOnPrint(boxScaleLayersOnPrint->isChecked()); - ml->printCropmarks(boxPrintCropmarks->isChecked()); - } - } - // general page: application tab - app->changeAppFont(appFont); - setFont(appFont); - app->changeAppStyle(boxStyle->currentText()); - app->autoSearchUpdates = boxSearchUpdates->isChecked(); - app->setSaveSettings(boxSave->isChecked(), boxMinutes->value()); - app->d_backup_files = boxBackupProject->isChecked(); - app->defaultScriptingLang = boxScriptingLanguage->currentText(); - app->d_init_window_type = (ApplicationWindow::WindowType)boxInitWindow->currentIndex(); - app->setMatrixUndoStackSize(undoStackSizeBox->value()); - app->d_eol = (ApplicationWindow::EndLineChar)boxEndLine->currentIndex(); - app->enableCompletion(completionBox->isChecked()); - - // general page: numeric format tab - app->d_decimal_digits = boxAppPrecision->value(); - QLocale locale; - switch (boxDecimalSeparator->currentIndex()){ - case 0: - locale = QLocale::system(); - break; - case 1: - locale = QLocale::c(); - break; - case 2: - locale = QLocale(QLocale::German); - break; - case 3: - locale = QLocale(QLocale::French); - break; - } - if (boxThousandsSeparator->isChecked()) - locale.setNumberOptions(QLocale::OmitGroupSeparator); - - QLocale oldLocale = app->locale(); - app->setLocale(locale); - - if (generalDialog->currentWidget() == appTabWidget && - appTabWidget->currentWidget() == numericFormatPage){ - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - QList windows = app->windowsList(); - foreach(MdiSubWindow *w, windows){ - w->setLocale(locale); - - if(w->isA("Table")) - ((Table *)w)->updateDecimalSeparators(oldLocale); - else if(w->isA("Matrix")) - ((Matrix *)w)->resetView(); - } - - switch (boxClipboardLocale->currentIndex()){ - case 0: - app->setClipboardLocale(QLocale::system()); - break; - case 1: - app->setClipboardLocale(QLocale::c()); - break; - case 2: - app->setClipboardLocale(QLocale(QLocale::German)); - break; - case 3: - app->setClipboardLocale(QLocale(QLocale::French)); - break; - } - - app->modifiedProject(); - QApplication::restoreOverrideCursor(); - } - - // general page: file locations tab - if (generalDialog->currentWidget() == appTabWidget && - appTabWidget->currentWidget() == fileLocationsPage){ - QString path = translationsPathLine->text(); - if (path != app->d_translations_folder && validFolderPath(path)){ - app->d_translations_folder = QFileInfo(path).absoluteFilePath(); - app->createLanguagesList(); - insertLanguagesList(); - } - - if (validFolderPath(helpPathLine->text())){ - path = helpPathLine->text() + "/index.html"; - if (path != app->helpFilePath){ - QFileInfo fi(path); - if (fi.exists() && fi.isFile()) - app->helpFilePath = fi.absoluteFilePath(); - else - QMessageBox::critical(this, tr("QtiPlot - index.html File Not Found!"), - tr("There is no file called index.html in folder %1.
Please choose another folder!"). - arg(helpPathLine->text())); - } - } - -#ifdef SCRIPTING_PYTHON - path = pythonConfigDirLine->text(); - if (path != app->d_python_config_folder && validFolderPath(path)) - app->d_python_config_folder = QFileInfo(path).absoluteFilePath(); -#endif - } - - if (generalDialog->currentWidget() == appTabWidget && - appTabWidget->currentWidget() == proxyPage){ - setApplicationCustomProxy(); - } - - // general page: confirmations tab - app->d_inform_rename_table = boxPromptRenameTables->isChecked(); - app->confirmCloseFolder = boxFolders->isChecked(); - app->updateConfirmOptions(boxTables->isChecked(), boxMatrices->isChecked(), - boxPlots2D->isChecked(), boxPlots3D->isChecked(), - boxNotes->isChecked()); - // general page: colors tab - app->setAppColors(btnWorkspace->color(), btnPanels->color(), btnPanelsText->color()); - // 3D plots page - app->d_3D_color_map = colorMapEditor->colorMap(); - app->d_3D_axes_color = btnAxes->color(); - app->d_3D_numbers_color = btnNumbers->color(); - app->d_3D_grid_color = btnGrid->color(); - app->d_3D_mesh_color = btnMesh->color(); - app->d_3D_background_color = btnBackground3D->color(); - app->d_3D_labels_color = btnLabels->color(); - app->d_3D_legend = boxShowLegend->isChecked(); - app->d_3D_projection = boxProjection->currentIndex(); - app->d_3D_resolution = boxResolution->value(); - app->d_3D_title_font = d_3D_title_font; - app->d_3D_numbers_font = d_3D_numbers_font; - app->d_3D_axes_font = d_3D_axes_font; - app->d_3D_orthogonal = boxOrthogonal->isChecked(); - app->d_3D_smooth_mesh = boxSmoothMesh->isChecked(); - app->d_3D_autoscale = boxAutoscale3DPlots->isChecked(); - app->setPlot3DOptions(); - - app->d_3D_grid_color = btnGrid->color(); - app->d_3D_minor_grid_color = btnGridMinor->color(); - app->d_3D_minor_grids = boxMajorGrids->isChecked(); - app->d_3D_major_grids = boxMinorGrids->isChecked(); - app->d_3D_major_style = boxMajorGridStyle->currentIndex(); - app->d_3D_minor_style = boxMinorGridStyle->currentIndex(); - app->d_3D_major_width = boxMajorGridWidth->value(); - app->d_3D_minor_width = boxMinorGridWidth->value(); - - // fitting page - app->fit_output_precision = boxPrecision->value(); - app->pasteFitResultsToPlot = plotLabelBox->isChecked(); - app->writeFitResultsToLog = logBox->isChecked(); - app->fitPoints = generatePointsBox->value(); - app->generateUniformFitPoints = generatePointsBtn->isChecked(); - app->generatePeakCurves = groupBoxMultiPeak->isChecked(); - app->peakCurvesColor = boxPeaksColor->currentIndex(); - app->fit_scale_errors = scaleErrorsBox->isChecked(); - app->d_2_linear_fit_points = linearFit2PointsBox->isChecked(); - app->saveSettings(); - - updateMenuList(); -} - -int ConfigDialog::curveStyle() -{ - int style = 0; - switch (boxCurveStyle->currentItem()) - { - case 0: - style = Graph::Line; - break; - case 1: - style = Graph::Scatter; - break; - case 2: - style = Graph::LineSymbols; - break; - case 3: - style = Graph::VerticalDropLines; - break; - case 4: - style = Graph::Spline; - break; - case 5: - style = Graph::VerticalSteps; - break; - case 6: - style = Graph::HorizontalSteps; - break; - case 7: - style = Graph::Area; - break; - case 8: - style = Graph::VerticalBars; - break; - case 9: - style = Graph::HorizontalBars; - break; - } - return style; -} - -void ConfigDialog::pickTextFont() -{ - bool ok; - QFont font = QFontDialog::getFont(&ok,textFont,this); - if ( ok ) { - textFont = font; - } else { - return; - } -} - -void ConfigDialog::pickHeaderFont() -{ - bool ok; - QFont font = QFontDialog::getFont(&ok,headerFont,this); - if ( ok ) { - headerFont = font; - } else { - return; - } -} - -void ConfigDialog::pickLegendFont() -{ - bool ok; - QFont font = QFontDialog::getFont(&ok,legendFont,this); - if ( ok ) { - legendFont = font; - } else { - return; - } -} - -void ConfigDialog::pickAxesFont() -{ - bool ok; - QFont font = QFontDialog::getFont(&ok,axesFont,this); - if ( ok ) { - axesFont = font; - } else { - return; - } -} - -void ConfigDialog::pickNumbersFont() -{ - bool ok; - QFont font = QFontDialog::getFont(&ok,numbersFont,this); - if ( ok ) { - numbersFont = font; - } else { - return; - } -} - -void ConfigDialog::pickTitleFont() -{ - bool ok; - QFont font = QFontDialog::getFont(&ok,titleFont,this); - if ( ok ) - titleFont = font; - else - return; -} - -void ConfigDialog::pickApplicationFont() -{ - bool ok; - QFont font = QFontDialog::getFont(&ok, appFont,this); - if ( ok ) - appFont = font; - else - return; - - ((ApplicationWindow *)parentWidget())->changeAppFont(appFont); -} - -void ConfigDialog::pick3DTitleFont() -{ - bool ok; - QFont font = QFontDialog::getFont(&ok, d_3D_title_font,this); - if ( ok ) - d_3D_title_font = font; - else - return; -} - -void ConfigDialog::pick3DNumbersFont() -{ - bool ok; - QFont font = QFontDialog::getFont(&ok, d_3D_numbers_font,this); - if ( ok ) - d_3D_numbers_font = font; - else - return; -} - -void ConfigDialog::pick3DAxesFont() -{ - bool ok; - QFont font = QFontDialog::getFont(&ok, d_3D_axes_font,this); - if ( ok ) - d_3D_axes_font = font; - else - return; -} - -void ConfigDialog::setColumnSeparator(const QString& sep) -{ - if (sep=="\t") - boxSeparator->setCurrentIndex(0); - else if (sep==" ") - boxSeparator->setCurrentIndex(1); - else if (sep==";\t") - boxSeparator->setCurrentIndex(2); - else if (sep==",\t") - boxSeparator->setCurrentIndex(3); - else if (sep=="; ") - boxSeparator->setCurrentIndex(4); - else if (sep==", ") - boxSeparator->setCurrentIndex(5); - else if (sep==";") - boxSeparator->setCurrentIndex(6); - else if (sep==",") - boxSeparator->setCurrentIndex(7); - else - { - QString separator = sep; - boxSeparator->setEditText(separator.replace(" ","\\s").replace("\t","\\t")); - } -} - -void ConfigDialog::switchToLanguage(int param) -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - app->switchToLanguage(param); - languageChange(); -} - -void ConfigDialog::insertLanguagesList() -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - if(!app) - return; - - boxLanguage->clear(); - QString qmPath = app->d_translations_folder; - QDir dir(qmPath); - QStringList locales = app->locales; - QStringList languages; - int lang = 0; - for (int i=0; i < (int)locales.size(); i++) - { - if (locales[i] == "en") - languages.push_back("English"); - else - { - QTranslator translator; - translator.load("qtiplot_"+locales[i], qmPath); - - QString language = translator.translate("ApplicationWindow", "English"); - if (!language.isEmpty()) - languages.push_back(language); - else - languages.push_back(locales[i]); - } - - if (locales[i] == app->appLanguage) - lang = i; - } - boxLanguage->addItems(languages); - boxLanguage->setCurrentIndex(lang); -} - - -void ConfigDialog::showPointsBox(bool) -{ - if (generatePointsBtn->isChecked()){ - lblPoints->show(); - generatePointsBox->show(); - linearFit2PointsBox->show(); - } else { - lblPoints->hide(); - generatePointsBox->hide(); - linearFit2PointsBox->hide(); - } -} - -void ConfigDialog::chooseTranslationsFolder() -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - if (!app) - return; - - QFileInfo tfi(app->d_translations_folder); - QString dir = QFileDialog::getExistingDirectory(this, tr("Choose the location of the QtiPlot translations folder!"), -#ifdef Q_CC_MSVC - tfi.dir().absolutePath(), 0); -#else - tfi.dir().absolutePath(), !QFileDialog::ShowDirsOnly); -#endif - - if (!dir.isEmpty()){ - app->d_translations_folder = QDir::toNativeSeparators(dir); - translationsPathLine->setText(app->d_translations_folder); - app->createLanguagesList(); - insertLanguagesList(); - } -} - -void ConfigDialog::chooseHelpFolder() -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - if (!app) - return; - - QFileInfo hfi(app->helpFilePath); - QString dir = QFileDialog::getExistingDirectory(this, tr("Choose the location of the QtiPlot help folder!"), -#ifdef Q_CC_MSVC - hfi.dir().absolutePath(), 0); -#else - hfi.dir().absolutePath(), !QFileDialog::ShowDirsOnly); -#endif - - if (!dir.isEmpty()){ - QString helpFilePath = dir + "index.html"; - QFile helpFile(helpFilePath); - if (!helpFile.exists()){ - QMessageBox::critical(this, tr("QtiPlot - index.html File Not Found!"), - tr("There is no file called index.html in this folder.
Please choose another folder!")); - } else - app->helpFilePath = helpFilePath; - } - - helpPathLine->setText(QDir::toNativeSeparators(QFileInfo(app->helpFilePath).dir().absolutePath())); -} - -#ifdef SCRIPTING_PYTHON -void ConfigDialog::choosePythonConfigFolder() -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - if (!app) - return; - - QFileInfo tfi(app->d_python_config_folder); - QString dir = QFileDialog::getExistingDirectory(this, tr("Choose the location of the Python configuration files!"), -#ifdef Q_CC_MSVC - tfi.dir().absolutePath(), 0); -#else - tfi.dir().absolutePath(), !QFileDialog::ShowDirsOnly); -#endif - - if (!dir.isEmpty()){ - app->d_python_config_folder = QDir::toNativeSeparators(dir); - pythonConfigDirLine->setText(app->d_python_config_folder); - - if (app->scriptingEnv()->name() == QString("Python")) - app->setScriptingLanguage(QString("Python"), true); - } -} -#endif - -void ConfigDialog::rehighlight() -{ - if (generalDialog->currentWidget() != notesPage) - return; - - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - if (!app) - return; - - app->d_comment_highlight_color = buttonCommentColor->color(); - app->d_keyword_highlight_color = buttonKeywordColor->color(); - app->d_quotation_highlight_color = buttonQuotationColor->color(); - app->d_numeric_highlight_color = buttonNumericColor->color(); - app->d_function_highlight_color = buttonFunctionColor->color(); - app->d_class_highlight_color = buttonClassColor->color(); - - QList windows = app->windowsList(); - foreach(MdiSubWindow *w, windows){ - Note *n = qobject_cast(w); - if (n){ - for (int i = 0; i < n->tabs(); i++) - n->editor(i)->rehighlight(); - } - } -} - -void ConfigDialog::customizeNotes() -{ - if (generalDialog->currentWidget() != notesPage) - return; - - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - if (!app) - return; - - app->d_note_line_numbers = lineNumbersBox->isChecked(); - app->d_notes_tab_length = boxTabLength->value(); - QFont f = QFont(boxFontFamily->currentFont().family(), boxFontSize->value()); - f.setBold(buttonBoldFont->isChecked()); - f.setItalic(buttonItalicFont->isChecked()); - app->d_notes_font = f; - QList windows = app->windowsList(); - foreach(MdiSubWindow *w, windows){ - Note *n = qobject_cast(w); - if (n){ - n->showLineNumbers(app->d_note_line_numbers); - n->setTabStopWidth(app->d_notes_tab_length); - n->setFont(f); - } - } - app->setFormatBarFont(f); -} - -void ConfigDialog::updateMenuList() -{ - QFontMetrics fm(itemsList->font()); - int width = 0; - for(int i = 0; icount() ; i++){ - int itemWidth = fm.boundingRect(itemsList->item(i)->text()).width(); - if(itemWidth > width) - width = itemWidth; - } - - itemsList->setFixedWidth(itemsList->iconSize().width() + width + 50); -} - -bool ConfigDialog::validFolderPath(const QString& path) -{ - QFileInfo fi(path); - if (!fi.exists()){ - QMessageBox::critical(this, tr("QtiPlot - Folder Not Found!"), - tr("The folder %1 doesn't exist.
Please choose another folder!").arg(path)); - return false; - } - - if (!fi.isDir()){ - QMessageBox::critical(this, tr("QtiPlot - Folder Not Found!"), - tr("%1 is not a folder.
Please choose another folder!").arg(path)); - return false; - } - - if (!fi.isReadable()){ - QMessageBox::critical(this, tr("QtiPlot"), - tr("You don't have read access rights to folder %1.
Please choose another folder!").arg(path)); - return false; - } - return true; -} - -void ConfigDialog::initProxyPage() -{ - QNetworkProxy proxy = QNetworkProxy::applicationProxy(); - - proxyPage = new QWidget(); - - proxyGroupBox = new QGroupBox (tr("&Proxy")); - proxyGroupBox->setCheckable(true); - proxyGroupBox->setChecked(!proxy.hostName().isEmpty()); - - QGridLayout *gl = new QGridLayout(proxyGroupBox); - - proxyHostLabel = new QLabel( tr("Host")); - gl->addWidget(proxyHostLabel, 0, 0); - proxyHostLine = new QLineEdit(proxy.hostName ()); - gl->addWidget(proxyHostLine, 0, 1); - - proxyPortLabel = new QLabel( tr("Port")); - gl->addWidget(proxyPortLabel, 1, 0); - proxyPortBox = new QSpinBox; - proxyPortBox->setMaximum(10000000); - proxyPortBox->setValue(proxy.port()); - gl->addWidget(proxyPortBox, 1, 1); - - proxyUserLabel = new QLabel( tr("Username")); - gl->addWidget(proxyUserLabel, 2, 0); - proxyUserNameLine = new QLineEdit(proxy.user()); - gl->addWidget(proxyUserNameLine, 2, 1); - - proxyPasswordLabel = new QLabel( tr("Password")); - gl->addWidget(proxyPasswordLabel, 3, 0); - proxyPasswordLine = new QLineEdit; - - gl->addWidget(proxyPasswordLine, 3, 1); - - gl->setRowStretch(4, 1); - - QVBoxLayout *layout = new QVBoxLayout(proxyPage); - layout->addWidget(proxyGroupBox); - - appTabWidget->addTab(proxyPage, tr( "&Internet Connection" ) ); -} - -QNetworkProxy ConfigDialog::setApplicationCustomProxy() -{ - QNetworkProxy proxy; - proxy.setType(QNetworkProxy::NoProxy); - if (proxyGroupBox->isChecked()) - proxy.setHostName(proxyHostLine->text()); - else - proxy.setHostName(QString::null); - - proxy.setPort(proxyPortBox->value()); - proxy.setUser(proxyUserNameLine->text()); - proxy.setPassword(proxyPasswordLine->text()); - QNetworkProxy::setApplicationProxy(proxy); - return proxy; -} - -void ConfigDialog::chooseTexCompiler() -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - if (!app) - return; - - QFileInfo tfi(app->d_latex_compiler_path); - QString compiler = ApplicationWindow::getFileName(this, tr("Choose the location of the LaTeX compiler!"), - app->d_latex_compiler_path, QString(), 0, false); - - if (!compiler.isEmpty()){ - app->d_latex_compiler_path = QDir::toNativeSeparators(compiler); - texCompilerPathBox->setText(app->d_latex_compiler_path); - } -} - -bool ConfigDialog::validateTexCompiler() -{ - QString path = texCompilerPathBox->text(); - if (path.isEmpty()) - return false; - - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - QFileInfo fi(path); - if (!fi.exists()){ - QMessageBox::critical(this, tr("QtiPlot - File Not Found!"), - tr("The file %1 doesn't exist.
Please choose another file!").arg(path)); - texCompilerPathBox->setText(app->d_latex_compiler_path); - return false; - } - - if (fi.isDir()){ - QMessageBox::critical(this, tr("QtiPlot - File Not Found!"), - tr("%1 is a folder.
Please choose a file!").arg(path)); - texCompilerPathBox->setText(app->d_latex_compiler_path); - return false; - } - - if (!fi.isReadable()){ - QMessageBox::critical(this, tr("QtiPlot"), - tr("You don't have read access rights to file %1.
Please choose another file!").arg(path)); - texCompilerPathBox->setText(app->d_latex_compiler_path); - return false; - } - - app->d_latex_compiler_path = QDir::toNativeSeparators(path); - texCompilerPathBox->setText(app->d_latex_compiler_path); - return true; -} - -void ConfigDialog::enableMajorGrids(bool on) -{ - btnGrid->setEnabled(on); - boxMajorGridStyle->setEnabled(on); - boxMajorGridWidth->setEnabled(on); -} - -void ConfigDialog::enableMinorGrids(bool on) -{ - btnGridMinor->setEnabled(on); - boxMinorGridStyle->setEnabled(on); - boxMinorGridWidth->setEnabled(on); -} === added file 'qtiplot/src/core/ConfigDialog.h' --- qtiplot/src/core/ConfigDialog.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/ConfigDialog.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,287 @@ +/*************************************************************************** + File : ConfigDialog.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Preferences dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef ConfigDialog_H +#define ConfigDialog_H + +#include + +#include +#include + +class QNetworkProxy; +class QLineEdit; +class QGroupBox; +class QGridLayout; +class QPushButton; +class QTabWidget; +class QStackedWidget; +class QWidget; +class QComboBox; +class QSpinBox; +class QLabel; +class QRadioButton; +class QListWidget; +class ColorButton; +class DoubleSpinBox; +class QFontComboBox; +class ColorMapEditor; +class QTableWidget; +class SymbolBox; +class PatternBox; +class PenStyleBox; + +//! Preferences dialog +class ConfigDialog : public QDialog +{ + Q_OBJECT + +public: + //! Constructor + /** + * \param parent parent widget (must be the application window!= + * \param fl window flags + */ + ConfigDialog( QWidget* parent, Qt::WFlags fl = 0 ); + void setColumnSeparator(const QString& sep); + +private slots: + virtual void languageChange(); + void insertLanguagesList(); + + void accept(); + void apply(); + + void setCurrentPage(int index); + + //table fonts + void pickTextFont(); + void pickHeaderFont(); + + //graph fonts + void pickAxesFont(); + void pickNumbersFont(); + void pickLegendFont(); + void pickTitleFont(); + + void showFrameWidth(bool ok); + + //application + void pickApplicationFont(); + + //2D curves + int curveStyle(); + void pick3DTitleFont(); + void pick3DNumbersFont(); + void pick3DAxesFont(); + + //Fitting + void showPointsBox(bool); + + void switchToLanguage(int param); + + void chooseTranslationsFolder(); + void chooseHelpFolder(); +#ifdef SCRIPTING_PYTHON + void choosePythonConfigFolder(); +#endif + void rehighlight(); + void customizeNotes(); + void chooseTexCompiler(); + bool validateTexCompiler(); + + void enableMajorGrids(bool on); + void enableMinorGrids(bool on); + + void updateCanvasSize(int unit); + void adjustCanvasHeight(double width); + void adjustCanvasWidth(double height); + + void moveColor(bool up = true); + void moveColorDown(); + void removeColor(); + void newColor(); + void loadDefaultColors(); + void showColorDialog(int, int); + void changeColorName(int, int); + void updateSymbolsList(int); + void setCurrentSymbol(SymbolBox *); + void loadDefaultSymbols(); + void moveSymbol(bool up = true); + void moveSymbolDown(){moveSymbol(false);}; + +private: + void setSymbolsList(const QList& symbList); + void setColorsList(const QList& colList, const QStringList& colNames); + void initPlotsPage(); + void initAppPage(); + void initCurvesPage(); + void initAxesPage(); + void initPlots3DPage(); + void initTablesPage(); + void initConfirmationsPage(); + void initFileLocationsPage(); + void initFittingPage(); + void initNotesPage(); + void initProxyPage(); + void initLayerGeometryPage(); + //! Calculates a sensible width for the items list + void updateMenuList(); + bool validFolderPath(const QString& path); + QNetworkProxy setApplicationCustomProxy(); + int convertToPixels(double w, FrameWidget::Unit unit, int dimension); + double convertFromPixels(int w, FrameWidget::Unit unit, int dimension); + + QFont textFont, headerFont, axesFont, numbersFont, legendFont, titleFont, appFont; + QFont d_3D_title_font, d_3D_numbers_font, d_3D_axes_font; + + QCheckBox *boxScaleLayersOnPrint, *boxPrintCropmarks, *linearFit2PointsBox; + QTabWidget *plotsTabWidget, *appTabWidget; + ColorButton *btnBackground3D, *btnMesh, *btnAxes, *btnLabels, *btnNumbers; + QGroupBox *colorMapBox; + ColorMapEditor *colorMapEditor; + QPushButton *btnTitleFnt, *btnLabelsFnt, *btnNumFnt; + ColorButton *buttonBackground, *buttonText, *buttonHeader; + QPushButton *buttonOk, *buttonCancel, *buttonApply; + QPushButton* buttonTextFont, *buttonHeaderFont; + QStackedWidget * generalDialog; + QWidget *appColors, *tables, *plotOptions, *plotTicks, *plotFonts, *confirm, *plotPrint; + QWidget *application, *curves, *axesPage, *plots3D, *fitPage, *numericFormatPage, *notesPage, *plotGeometryPage; + QPushButton* buttonAxesFont, *buttonNumbersFont, *buttonLegendFont, *buttonTitleFont, *fontsBtn; + QCheckBox *boxSearchUpdates, *boxOrthogonal, *logBox, *plotLabelBox, *scaleErrorsBox; + QCheckBox *boxTitle, *boxFrame, *boxPlots3D, *boxPlots2D, *boxTables, *boxNotes, *boxFolders; + QCheckBox *boxSave, *boxBackbones, *boxShowLegend, *boxSmoothMesh; + QCheckBox *boxAutoscaling, *boxMatrices, *boxScaleFonts, *boxResize; + QComboBox *boxMajTicks, *boxMinTicks, *boxStyle, *boxCurveStyle, *boxSeparator, *boxLanguage, *boxDecimalSeparator; + QComboBox *boxClipboardLocale, *boxProjection; + QLabel *lblClipboardSeparator, *lblFloorStyle; + QSpinBox *boxMinutes, *boxLineWidth, *boxFrameWidth, *boxResolution, *boxMargin, *boxPrecision, *boxAppPrecision; + QSpinBox *boxSymbolSize, *boxMinTicksLength, *boxMajTicksLength, *generatePointsBox; + DoubleSpinBox *boxCurveLineWidth; + ColorButton *btnWorkspace, *btnPanels, *btnPanelsText; + QListWidget * itemsList; + QLabel *labelFrameWidth, *lblLanguage, *lblWorkspace, *lblPanels, *lblPageHeader; + QLabel *lblPanelsText, *lblFonts, *lblStyle, *lblDecimalSeparator, *lblAppPrecision; + QGroupBox *groupBoxConfirm; + QGroupBox *groupBoxTableFonts, *groupBoxTableCol; + QLabel *lblSeparator, *lblTableBackground, *lblTextColor, *lblHeaderColor; + QLabel *lblSymbSize, *lblAxesLineWidth, *lblCurveStyle, *lblResolution, *lblPrecision; + QGroupBox *groupBox3DFonts, *groupBox3DCol; + QLabel *lblMargin, *lblMajTicks, *lblMajTicksLength, *lblLineWidth, *lblMinTicks, *lblMinTicksLength, *lblPoints, *lblPeaksColor; + QGroupBox *groupBoxFittingCurve, *groupBoxFitParameters; + QRadioButton *samePointsBtn, *generatePointsBtn; + QGroupBox *groupBoxMultiPeak; + ColorButton *boxPeaksColor; + QLabel *lblScriptingLanguage, *lblInitWindow; + QComboBox *boxScriptingLanguage, *boxInitWindow; + QCheckBox *boxAntialiasing, *boxAutoscale3DPlots, *boxTableComments, *boxThousandsSeparator; + QCheckBox *boxPromptRenameTables, *boxBackupProject, *boxLabelsEditing; + QWidget *fileLocationsPage; + QLabel *lblTranslationsPath, *lblHelpPath, *lblUndoStackSize, *lblEndOfLine; + QLineEdit *translationsPathLine, *helpPathLine; + QSpinBox *undoStackSizeBox; + QComboBox *boxEndLine; +#ifdef SCRIPTING_PYTHON + QLabel *lblPythonConfigDir; + QLineEdit *pythonConfigDirLine; +#endif + QCheckBox *boxUpdateTableValues; + QGroupBox *groupBackgroundOptions; + QLabel *labelGraphFrameColor, *labelGraphFrameWidth; + QLabel *labelGraphBkgColor, *labelGraphCanvasColor; + QLabel *labelGraphBkgOpacity, *labelGraphCanvasOpacity; + ColorButton *boxBackgroundColor, *boxCanvasColor, *boxBorderColor; + QSpinBox *boxBackgroundTransparency, *boxCanvasTransparency, *boxBorderWidth, *boxTabLength; + QCheckBox *completionBox, *lineNumbersBox; + QLabel *labelTabLength, *labelNotesFont; + QFontComboBox *boxFontFamily; + QSpinBox *boxFontSize; + QPushButton *buttonItalicFont, *buttonBoldFont; + QLabel *labelGraphAxesLabelsDist, *labelTickLabelsDist; + QSpinBox *boxAxesLabelsDist, *boxTickLabelsDist; + QLabel *xBottomLabel, *xTopLabel, *yLeftLabel, *yRightLabel, *enableAxisLabel, *showNumbersLabel; + QCheckBox *boxEnableAxis, *boxShowAxisLabels; + QGroupBox * enabledAxesGroupBox; + QGridLayout *enabledAxesGrid; + + QWidget *proxyPage; + QGroupBox *proxyGroupBox; + QLineEdit *proxyHostLine, *proxyUserNameLine, *proxyPasswordLine; + QSpinBox *proxyPortBox; + QLabel *proxyHostLabel, *proxyPortLabel, *proxyUserLabel, *proxyPasswordLabel; + + QLineEdit *texCompilerPathBox; + QPushButton *browseTexCompilerBtn; + QLabel *texCompilerLabel; + + QComboBox *legendDisplayBox; + QLabel *legendDisplayLabel; + + DoubleSpinBox *boxMajorGridWidth, *boxMinorGridWidth; + QComboBox *boxMajorGridStyle, *boxMinorGridStyle; + QCheckBox *boxMajorGrids, *boxMinorGrids; + ColorButton *btnGrid, *btnGridMinor; + QLabel *label3DGridsColor, *label3DGridsWidth, *label3DGridsStyle; + QGroupBox *groupBox3DGrids; + + QGroupBox *groupSyntaxHighlighter; + ColorButton *buttonCommentColor, *buttonNumericColor, *buttonQuotationColor; + ColorButton *buttonKeywordColor, *buttonFunctionColor, *buttonClassColor; + QLabel *buttonCommentLabel, *buttonNumericLabel, *buttonQuotationLabel; + QLabel *buttonKeywordLabel, *buttonFunctionLabel, *buttonClassLabel; + + QCheckBox *boxMuParserCLocale, *boxConfirmOverwrite; + DoubleSpinBox *boxCanvasHeight, *boxCanvasWidth; + QComboBox *unitBox; + QLabel *unitBoxLabel, *canvasWidthLabel, *canvasHeightLabel; + QCheckBox *keepRatioBox, *boxMultiPeakMsgs; + + double aspect_ratio; + + QGroupBox *groupIndexedColors, *symbolGroupBox, *groupIndexedSymbols, *fillCurvesGroupBox; + QTableWidget *colorsList, *symbolsList; + QPushButton *btnColorUp, *btnColorDown, *btnRemoveColor, *btnNewColor, *btnLoadDefaultColors; + QList d_indexed_colors; + QStringList d_indexed_color_names; + QCheckBox *fillSymbolsBox; + DoubleSpinBox *symbolEdgeBox; + QLabel *lblSymbEdge, *lblSymbBox; + SymbolBox *symbolBox; + QList d_indexed_symbols; + QPushButton *btnLoadDefaultSymbols, *btnSymbolUp, *btnSymbolDown; + PatternBox *patternBox; + QLabel *lblPattern, *lblCurveAlpha, *lblLineStyle; + QSpinBox *curveAlphaBox; + PenStyleBox *lineStyleBox; + QGroupBox * curvesGroupBox; + QLabel *lblAxisLabeling; + QComboBox *axisLabelingBox; + QCheckBox *boxSynchronizeScales; +}; + +#endif // CONFIGDIALOG_H === removed file 'qtiplot/src/core/ConfigDialog.h' --- qtiplot/src/core/ConfigDialog.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/ConfigDialog.h 1970-01-01 00:00:00 +0000 @@ -1,232 +0,0 @@ -/*************************************************************************** - File : ConfigDialog.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Preferences dialog - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef ConfigDialog_H -#define ConfigDialog_H - -#include -#include - -class QNetworkProxy; -class QLineEdit; -class QGroupBox; -class QGridLayout; -class QPushButton; -class QTabWidget; -class QStackedWidget; -class QWidget; -class QComboBox; -class QSpinBox; -class QLabel; -class QRadioButton; -class QListWidget; -class ColorButton; -class ColorBox; -class DoubleSpinBox; -class QFontComboBox; -class ColorMapEditor; - -//! Preferences dialog -class ConfigDialog : public QDialog -{ - Q_OBJECT - -public: - //! Constructor - /** - * \param parent parent widget (must be the application window!= - * \param fl window flags - */ - ConfigDialog( QWidget* parent, Qt::WFlags fl = 0 ); - void setColumnSeparator(const QString& sep); - -private slots: - virtual void languageChange(); - void insertLanguagesList(); - - void accept(); - void apply(); - - void setCurrentPage(int index); - - //table fonts - void pickTextFont(); - void pickHeaderFont(); - - //graph fonts - void pickAxesFont(); - void pickNumbersFont(); - void pickLegendFont(); - void pickTitleFont(); - - void showFrameWidth(bool ok); - - //application - void pickApplicationFont(); - - //2D curves - int curveStyle(); - void pick3DTitleFont(); - void pick3DNumbersFont(); - void pick3DAxesFont(); - - //Fitting - void showPointsBox(bool); - - void switchToLanguage(int param); - - void chooseTranslationsFolder(); - void chooseHelpFolder(); -#ifdef SCRIPTING_PYTHON - void choosePythonConfigFolder(); -#endif - void rehighlight(); - void customizeNotes(); - void chooseTexCompiler(); - bool validateTexCompiler(); - - void enableMajorGrids(bool on); - void enableMinorGrids(bool on); - -private: - void initPlotsPage(); - void initAppPage(); - void initCurvesPage(); - void initAxesPage(); - void initPlots3DPage(); - void initTablesPage(); - void initConfirmationsPage(); - void initFileLocationsPage(); - void initFittingPage(); - void initNotesPage(); - void initProxyPage(); - //! Calculates a sensible width for the items list - void updateMenuList(); - bool validFolderPath(const QString& path); - QNetworkProxy setApplicationCustomProxy(); - - QFont textFont, headerFont, axesFont, numbersFont, legendFont, titleFont, appFont; - QFont d_3D_title_font, d_3D_numbers_font, d_3D_axes_font; - - QCheckBox *boxScaleLayersOnPrint, *boxPrintCropmarks, *linearFit2PointsBox; - QTabWidget *plotsTabWidget, *appTabWidget; - ColorButton *btnBackground3D, *btnMesh, *btnAxes, *btnLabels, *btnNumbers; - QGroupBox *colorMapBox; - ColorMapEditor *colorMapEditor; - QPushButton *btnTitleFnt, *btnLabelsFnt, *btnNumFnt; - ColorButton *buttonBackground, *buttonText, *buttonHeader; - QPushButton *buttonOk, *buttonCancel, *buttonApply; - QPushButton* buttonTextFont, *buttonHeaderFont; - QStackedWidget * generalDialog; - QWidget *appColors, *tables, *plotOptions, *plotTicks, *plotFonts, *confirm, *plotPrint; - QWidget *application, *curves, *axesPage, *plots3D, *fitPage, *numericFormatPage, *notesPage; - QPushButton* buttonAxesFont, *buttonNumbersFont, *buttonLegendFont, *buttonTitleFont, *fontsBtn; - QCheckBox *boxSearchUpdates, *boxOrthogonal, *logBox, *plotLabelBox, *scaleErrorsBox; - QCheckBox *boxTitle, *boxFrame, *boxPlots3D, *boxPlots2D, *boxTables, *boxNotes, *boxFolders; - QCheckBox *boxSave, *boxBackbones, *boxShowLegend, *boxSmoothMesh; - QCheckBox *boxAutoscaling, *boxMatrices, *boxScaleFonts, *boxResize; - QComboBox *boxMajTicks, *boxMinTicks, *boxStyle, *boxCurveStyle, *boxSeparator, *boxLanguage, *boxDecimalSeparator; - QComboBox *boxClipboardLocale, *boxProjection; - QLabel *lblClipboardSeparator, *lblFloorStyle; - QSpinBox *boxMinutes, *boxLineWidth, *boxFrameWidth, *boxResolution, *boxMargin, *boxPrecision, *boxAppPrecision; - QSpinBox *boxSymbolSize, *boxMinTicksLength, *boxMajTicksLength, *generatePointsBox; - DoubleSpinBox *boxCurveLineWidth; - ColorButton *btnWorkspace, *btnPanels, *btnPanelsText; - QListWidget * itemsList; - QLabel *labelFrameWidth, *lblLanguage, *lblWorkspace, *lblPanels, *lblPageHeader; - QLabel *lblPanelsText, *lblFonts, *lblStyle, *lblDecimalSeparator, *lblAppPrecision; - QGroupBox *groupBoxConfirm; - QGroupBox *groupBoxTableFonts, *groupBoxTableCol; - QLabel *lblSeparator, *lblTableBackground, *lblTextColor, *lblHeaderColor; - QLabel *lblSymbSize, *lblAxesLineWidth, *lblCurveStyle, *lblResolution, *lblPrecision; - QGroupBox *groupBox3DFonts, *groupBox3DCol; - QLabel *lblMargin, *lblMajTicks, *lblMajTicksLength, *lblLineWidth, *lblMinTicks, *lblMinTicksLength, *lblPoints, *lblPeaksColor; - QGroupBox *groupBoxFittingCurve, *groupBoxFitParameters; - QRadioButton *samePointsBtn, *generatePointsBtn; - QGroupBox *groupBoxMultiPeak; - ColorBox *boxPeaksColor; - QLabel *lblScriptingLanguage, *lblInitWindow; - QComboBox *boxScriptingLanguage, *boxInitWindow; - QCheckBox *boxAntialiasing, *boxAutoscale3DPlots, *boxTableComments, *boxThousandsSeparator; - QCheckBox *boxPromptRenameTables, *boxBackupProject, *boxLabelsEditing; - QWidget *fileLocationsPage; - QLabel *lblTranslationsPath, *lblHelpPath, *lblUndoStackSize, *lblEndOfLine; - QLineEdit *translationsPathLine, *helpPathLine; - QSpinBox *undoStackSizeBox; - QComboBox *boxEndLine; -#ifdef SCRIPTING_PYTHON - QLabel *lblPythonConfigDir; - QLineEdit *pythonConfigDirLine; -#endif - QCheckBox *boxUpdateTableValues; - QGroupBox *groupBackgroundOptions; - QLabel *labelGraphFrameColor, *labelGraphFrameWidth; - QLabel *labelGraphBkgColor, *labelGraphCanvasColor; - QLabel *labelGraphBkgOpacity, *labelGraphCanvasOpacity; - ColorButton *boxBackgroundColor, *boxCanvasColor, *boxBorderColor; - QSpinBox *boxBackgroundTransparency, *boxCanvasTransparency, *boxBorderWidth, *boxTabLength; - QCheckBox *completionBox, *lineNumbersBox; - QLabel *labelTabLength, *labelNotesFont; - QFontComboBox *boxFontFamily; - QSpinBox *boxFontSize; - QPushButton *buttonItalicFont, *buttonBoldFont; - QLabel *labelGraphAxesLabelsDist; - QSpinBox *boxAxesLabelsDist; - QLabel *xBottomLabel, *xTopLabel, *yLeftLabel, *yRightLabel, *enableAxisLabel, *showNumbersLabel; - QCheckBox *boxEnableAxis, *boxShowAxisLabels; - QGroupBox * enabledAxesGroupBox; - QGridLayout *enabledAxesGrid; - - QWidget *proxyPage; - QGroupBox *proxyGroupBox; - QLineEdit *proxyHostLine, *proxyUserNameLine, *proxyPasswordLine; - QSpinBox *proxyPortBox; - QLabel *proxyHostLabel, *proxyPortLabel, *proxyUserLabel, *proxyPasswordLabel; - - QLineEdit *texCompilerPathBox; - QPushButton *browseTexCompilerBtn; - QLabel *texCompilerLabel; - - QComboBox *legendDisplayBox; - QLabel *legendDisplayLabel; - - DoubleSpinBox *boxMajorGridWidth, *boxMinorGridWidth; - QComboBox *boxMajorGridStyle, *boxMinorGridStyle; - QCheckBox *boxMajorGrids, *boxMinorGrids; - ColorButton *btnGrid, *btnGridMinor; - QLabel *label3DGridsColor, *label3DGridsWidth, *label3DGridsStyle; - QGroupBox *groupBox3DGrids; - - QGroupBox *groupSyntaxHighlighter; - ColorButton *buttonCommentColor, *buttonNumericColor, *buttonQuotationColor; - ColorButton *buttonKeywordColor, *buttonFunctionColor, *buttonClassColor; - QLabel *buttonCommentLabel, *buttonNumericLabel, *buttonQuotationLabel; - QLabel *buttonKeywordLabel, *buttonFunctionLabel, *buttonClassLabel; -}; - -#endif // CONFIGDIALOG_H === renamed file 'qtiplot/src/core/CreateBinMatrixDialog.cpp' => 'qtiplot/src/core/CreateBinMatrixDialog.cpp' === renamed file 'qtiplot/src/core/CreateBinMatrixDialog.h' => 'qtiplot/src/core/CreateBinMatrixDialog.h' === added file 'qtiplot/src/core/CustomActionDialog.cpp' --- qtiplot/src/core/CustomActionDialog.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/CustomActionDialog.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,787 @@ +/*************************************************************************** + File : CustomActionDialog.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2007 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Custom Action dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "CustomActionDialog.h" +#include "ApplicationWindow.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +CustomActionDialog::CustomActionDialog(QWidget* parent, Qt::WFlags fl) + : QDialog(parent, fl) +{ + setWindowTitle(tr("QtiPlot") + " - " + tr("Add Custom Action")); + + itemsList = new QListWidget(); + itemsList->setSelectionMode(QAbstractItemView::SingleSelection); + itemsList->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred)); + itemsList->setSpacing(2); + + QGroupBox *gb1 = new QGroupBox(); + gb1->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred)); + + QGridLayout *gl1 = new QGridLayout(gb1); + + gl1->addWidget(new QLabel(tr("Folder")), 0, 0); + folderBox = new QLineEdit(); + + gl1->addWidget(folderBox, 0, 1); + folderBtn = new QPushButton(tr("Choose &Folder")); + gl1->addWidget(folderBtn, 0, 2); + + gl1->addWidget(new QLabel(tr("Script File")), 1, 0); + fileBox = new QLineEdit(); + + gl1->addWidget(fileBox, 1, 1); + fileBtn = new QPushButton(tr("Choose &Script")); + gl1->addWidget(fileBtn, 1, 2); + + gl1->addWidget(new QLabel(tr("Icon")), 2, 0); + iconBox = new QLineEdit(); + gl1->addWidget(iconBox, 2, 1); + iconBtn = new QPushButton(tr("Choose &Icon")); + gl1->addWidget(iconBtn, 2, 2); + + gl1->addWidget(new QLabel(tr("Text")), 3, 0); + textBox = new QLineEdit(); + gl1->addWidget(textBox, 3, 1); + + gl1->addWidget(new QLabel(tr("Tool Tip Text")), 4, 0); + toolTipBox = new QLineEdit(); + gl1->addWidget(toolTipBox, 4, 1); + + gl1->addWidget(new QLabel(tr("Shortcut")), 5, 0); + shortcutBox = new QLineEdit(); + gl1->addWidget(shortcutBox, 5, 1); + + menuBtn = new QRadioButton(tr("&Menu")); + gl1->addWidget(menuBtn, 6, 0); + menuBox = new QComboBox(); + gl1->addWidget(menuBox, 6, 1); + + newMenuBtn = new QPushButton(tr("&New Menu...")); + gl1->addWidget(newMenuBtn, 6, 2); + + removeMenuBtn = new QPushButton(tr("&Delete Menu")); + gl1->addWidget(removeMenuBtn, 6, 3); + + toolBarBtn = new QRadioButton(tr("&Tool Bar")); + toolBarBtn->setChecked(true); + gl1->addWidget(toolBarBtn, 7, 0); + toolBarBox = new QComboBox(); + gl1->addWidget(toolBarBox, 7, 1); + gl1->setRowStretch(8, 1); + gl1->setColumnStretch(1, 10); + + QHBoxLayout * bottomButtons = new QHBoxLayout(); + bottomButtons->addStretch(); + buttonSave = new QPushButton(tr("&Save")); + buttonSave->setAutoDefault( true ); + bottomButtons->addWidget(buttonSave); + + buttonAdd = new QPushButton(tr("&Add")); + buttonAdd->setAutoDefault( true ); + bottomButtons->addWidget(buttonAdd); + + buttonRemove = new QPushButton(tr("&Remove")); + buttonRemove->setAutoDefault(true); + bottomButtons->addWidget(buttonRemove); + + buttonCancel = new QPushButton(tr("&Close")); + buttonCancel->setAutoDefault( true ); + bottomButtons->addWidget( buttonCancel ); + + QHBoxLayout *vl = new QHBoxLayout(); + vl->addWidget(itemsList); + vl->addWidget(gb1); + + QVBoxLayout *mainLayout = new QVBoxLayout(this); + mainLayout->addLayout(vl); + mainLayout->addLayout(bottomButtons); + + init(); + + QShortcut *accelRemove = new QShortcut(QKeySequence(Qt::Key_Delete), this); + connect(accelRemove, SIGNAL(activated()), this, SLOT(removeAction())); + + connect(newMenuBtn, SIGNAL(clicked()), this, SLOT(addMenu())); + connect(removeMenuBtn, SIGNAL(clicked()), this, SLOT(removeMenu())); + connect(menuBox, SIGNAL(currentIndexChanged (const QString &)), + this, SLOT(enableDeleteMenuBtn(const QString &))); + + connect(buttonSave, SIGNAL(clicked()), this, SLOT(saveCurrentAction())); + connect(buttonAdd, SIGNAL(clicked()), this, SLOT(addAction())); + connect(buttonRemove, SIGNAL(clicked()), this, SLOT(removeAction())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(iconBtn, SIGNAL(clicked()), this, SLOT(chooseIcon())); + connect(fileBtn, SIGNAL(clicked()), this, SLOT(chooseFile())); + connect(folderBtn, SIGNAL(clicked()), this, SLOT(chooseFolder())); + connect(itemsList, SIGNAL(currentRowChanged(int)), this, SLOT(setCurrentAction(int))); +} + +void CustomActionDialog::init() +{ + ApplicationWindow *app = (ApplicationWindow *)parent(); + folderBox->setText(app->customActionsDirPath); + + d_menus = app->customizableMenusList(); + d_app_toolbars = app->toolBarsList(); + QList d_app_menus = app->menusList(); + + QStringList toolBars, menus; + foreach (QMenu *m, d_menus + app->customMenusList()){ + if (!m->title().isEmpty()){ + menus << m->title().remove("&"); + } + } + menus.sort(); + menuBox->addItems(menus); + + //Build the list of shortcut key sequences and keep it to memory to improve speed! + foreach (QMenu *m, d_app_menus){ + QList actionsList = m->actions(); + foreach (QAction *a, actionsList){ + QString shortcut = a->shortcut().toString(); + if (!shortcut.isEmpty() && !d_app_shortcut_keys.contains(shortcut)) + d_app_shortcut_keys << shortcut; + } + } + + foreach (QToolBar *t, d_app_toolbars){ + toolBars << t->windowTitle(); + QList actionsList = t->actions(); + foreach (QAction *a, actionsList){ + QString shortcut = a->shortcut().toString(); + if (!shortcut.isEmpty() && !d_app_shortcut_keys.contains(shortcut)) + d_app_shortcut_keys << shortcut; + } + } + toolBars.sort(); + toolBarBox->addItems(toolBars); + + updateDisplayList(); + enableDeleteMenuBtn(menuBox->currentText()); +} + +void CustomActionDialog::updateDisplayList() +{ + itemsList->clear(); + + QList actionsList = ((ApplicationWindow *)parentWidget())->customActionsList(); + foreach(QAction *action, actionsList){//add existing actions to the list widget + QString text = action->text(); + QString shortcut = action->shortcut().toString(); + if (!shortcut.isEmpty()) + text += " (" + shortcut + ")"; + + QListWidgetItem *it = new QListWidgetItem(text, itemsList); + if (!action->icon().isNull()) + it->setIcon(action->icon()); + itemsList->addItem(it); + } + itemsList->setCurrentRow(0); + setCurrentAction(0); +} + +QAction* CustomActionDialog::addAction() +{ + QAction *action = NULL; + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + if (!app) + return action; + + if (validUserInput()){ + action = new QAction(app); + customizeAction(action); + + if (toolBarBtn->isChecked()){ + foreach (QToolBar *t, d_app_toolbars){ + if (t->windowTitle() == toolBarBox->currentText()){ + app->addCustomAction(action, t->objectName()); + break; + } + } + } else { + foreach (QMenu *m, d_menus + app->customMenusList()){ + if (m->title().remove("&") == menuBox->currentText()){ + action->setStatusTip(m->objectName()); + app->addCustomAction(action, m->objectName()); + break; + } + } + } + + QString text = action->text(); + QString shortcut = action->shortcut().toString(); + if (!shortcut.isEmpty()) + text += " (" + shortcut + ")"; + + QListWidgetItem *it = new QListWidgetItem(text, itemsList); + if (!action->icon().isNull()) + it->setIcon(action->icon()); + itemsList->addItem(it); + itemsList->setCurrentItem(it); + + saveAction(action); + } + return action; +} + +bool CustomActionDialog::validUserInput() +{ + QString folder = folderBox->text(); + while (folder.isEmpty() || !QFileInfo(folder).exists() || !QFileInfo(folder).isReadable()){ + chooseFolder(); + folder = folderBox->text(); + } + + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + QListactions = app->customActionsList(); + + if (textBox->text().isEmpty()){ + QMessageBox::critical(app, tr("QtiPlot") + " - " + tr("Error"), + tr("Please provide a description for your custom action!")); + textBox->setFocus(); + return false; + } else if (textBox->text().contains(".")){ + QMessageBox::critical(app, tr("QtiPlot") + " - " + tr("Error"), + tr("Dot characters are not allowed in the description text!")); + textBox->setFocus(); + textBox->setText(textBox->text().remove(".").simplified()); + return false; + } + + QString text = textBox->text().remove(".").simplified(); + foreach(QAction *action, actions){ + if(action->text() == text){ + QMessageBox::critical(app, tr("QtiPlot") + " - " + tr("Error"), + tr("You have already defined an action having description: %1
Please provide a different description text!").arg(textBox->text())); + textBox->setFocus(); + return false; + } + } + + QString file = fileBox->text(); + QFileInfo fi(file); + if (file.isEmpty() || !fi.exists()){ + QMessageBox::critical(app, tr("QtiPlot") + " - " + tr("Error"), + tr("The file you have specified doesn't exist, please choose a valid script file!")); + fileBox->setFocus(); + return false; + } + + QString iconPath = iconBox->text(); + QFileInfo iconInfo(iconPath); + if (!iconPath.isEmpty() && (!iconInfo.exists() || !iconInfo.isFile() || !iconInfo.isReadable())){ + iconPath = QString(); + QMessageBox::critical(app, tr("QtiPlot") + " - " + tr("Error"), + tr("The image file you have specified doesn't exist or can't be read, please choose another file!")); + iconBox->setFocus(); + return false; + } + + QStringList shortcuts = d_app_shortcut_keys; + foreach (QAction *a, actions){ + QString shortcut = a->shortcut().toString(); + if (!shortcut.isEmpty() && !shortcuts.contains(shortcut)) + shortcuts << shortcut; + } + + shortcuts.sort(); + QString s; + int i = 0, n = shortcuts.count(); + while(i < n-5){ + s += shortcuts[i] + "\t" + shortcuts[i+1] + "\t" + shortcuts[i+2]; + s += "\t" + shortcuts[i+3] + "\t" + shortcuts[i+4] + "\n"; + i += 5; + } + + if (shortcuts.contains(shortcutBox->text().remove(QRegExp("\\s")))){ + QMessageBox::critical(app, tr("QtiPlot") + " - " + tr("Error"), + tr("Please provide a different key sequence! The following shortcut key sequences are already assigned:") + + "\n\n" + s); + shortcutBox->setFocus(); + return false; + } + + return true; +} + +void CustomActionDialog::customizeAction(QAction *action) +{ + if (!action) + return; + + action->setText(textBox->text().remove(".").simplified()); + action->setData(QFileInfo(fileBox->text()).absoluteFilePath()); + + QString iconPath = iconBox->text(); + QFileInfo iconInfo(iconPath); + if (!iconPath.isEmpty() && iconInfo.exists() && iconInfo.isFile()){ + action->setIcon(QIcon(iconPath)); + action->setIconText(iconInfo.absoluteFilePath()); + } + + if (!toolTipBox->text().isEmpty()) + action->setToolTip(toolTipBox->text().simplified()); + + if (!shortcutBox->text().isEmpty()) + action->setShortcut(shortcutBox->text().remove(QRegExp("\\s"))); +} + +void CustomActionDialog::removeAction() +{ + int row = itemsList->currentRow(); + QAction *action = actionAt(row); + if (!action) + return; + + QString s = tr("Are you sure you want to remove this action?"); + if (QMessageBox::Yes != QMessageBox::question(this, tr("QtiPlot") + " - " + tr("Remove Action"), s, QMessageBox::Yes, QMessageBox::Cancel)) + return; + + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + QFile f(app->customActionsDirPath + "/" + action->text() + ".qca"); + f.remove(); + + app->removeCustomAction(action); + + itemsList->takeItem(row); + QListWidgetItem *item = itemsList->item(row); + if (item) + itemsList->removeItemWidget(item); + + if (itemsList->count()) + setCurrentAction(0); +} + +void CustomActionDialog::saveCurrentAction() +{ + int row = itemsList->currentRow(); + QAction *action = actionAt(row); + if (!action) + return; + + QList list = action->associatedWidgets(); + QWidget *w = list[0]; + QString parentName = w->objectName(); + if ((toolBarBtn->isChecked() && w->objectName() != toolBarBox->currentText()) || + (menuBtn->isChecked() && w->objectName() != menuBox->currentText())){ + //relocate action: create a new one and delete the old + ApplicationWindow *app = (ApplicationWindow *)parent(); + QAction *newAction = new QAction(app); + customizeAction(newAction); + if (toolBarBtn->isChecked()){ + foreach (QToolBar *t, d_app_toolbars){ + if (t->windowTitle() == toolBarBox->currentText()){ + app->addCustomAction(newAction, t->objectName(), row); + break; + } + } + } else { + foreach (QMenu *m, d_menus + app->customMenusList()){ + if (m->title().remove("&") == menuBox->currentText()){ + newAction->setStatusTip(m->objectName()); + app->addCustomAction(newAction, m->objectName(), row); + break; + } + } + } + saveAction(newAction); + app->removeCustomAction(action); + delete action; + } else { + customizeAction(action); + saveAction(action); + } + + updateDisplayList(); + itemsList->setCurrentRow(row); +} + +void CustomActionDialog::saveAction(QAction *action) +{ + if (!action) + return; + + ApplicationWindow *app = (ApplicationWindow *)parent(); + QString fileName = app->customActionsDirPath + "/" + action->text() + ".qca"; + QFile f(fileName); + if (!f.open( QIODevice::WriteOnly)){ + QApplication::restoreOverrideCursor(); + QMessageBox::critical(app, tr("QtiPlot") + " - " + tr("File Save Error"), + tr("Could not write to file:

%1

Please verify that you have the right to write to this location!").arg(fileName)); + return; + } + + QTextStream out( &f ); + out.setCodec("UTF-8"); + out << "\n" + << "\n" + << "\n"; + + out << "" + action->text() + "\n"; + out << "" + action->data().toString() + "\n"; + out << "" + action->iconText() + "\n"; + out << "" + action->toolTip() + "\n"; + out << "" + action->shortcut().toString() + "\n"; + + QList list = action->associatedWidgets(); + QWidget *w = list[0]; + out << "" + w->objectName() + "\n"; + out << "\n"; +} + +void CustomActionDialog::chooseIcon() +{ + QString fn = ApplicationWindow::getFileName(this, tr("QtiPlot - Load icon from file"), + iconBox->text(), ApplicationWindow::imageFilter(), 0, false); + if (!fn.isEmpty()) + iconBox->setText(fn); +} + +void CustomActionDialog::chooseFile() +{ + QString filter = tr("Python Script") + " (*.py);;"; + filter += tr("Text") + " (*.txt *.TXT);;"; + filter += tr("All Files")+" (*)"; + + QString fileName = ApplicationWindow::getFileName(this, tr("Choose script file"), + ((ApplicationWindow *)parentWidget())->customActionsDirPath, filter, 0, false); + if (!fileName.isEmpty()) + fileBox->setText(fileName); +} + +void CustomActionDialog::chooseFolder() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + + QString dir = QFileDialog::getExistingDirectory(this, tr("Choose the custom actions folder"), app->customActionsDirPath); + if (!dir.isEmpty() && QFileInfo(dir).isReadable()){ + QList actionsList = app->customActionsList(); + foreach (QAction *a, actionsList) + app->removeCustomAction(a); + + app->customActionsDirPath = dir; + app->loadCustomActions(); + updateDisplayList(); + folderBox->setText(dir); + } +} + +QAction * CustomActionDialog::actionAt(int row) +{ + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + QListactions = app->customActionsList(); + if (actions.isEmpty() || row < 0 || row >= actions.count()) + return 0; + + return actions.at(row); +} + +void CustomActionDialog::setCurrentAction(int row) +{ + QAction *action = actionAt(row); + if (!action) + return; + + fileBox->setText(action->data().toString()); + textBox->setText(action->text()); + iconBox->setText(action->iconText()); + toolTipBox->setText(action->toolTip()); + shortcutBox->setText(action->shortcut().toString()); + + QList list = action->associatedWidgets(); + QWidget *w = NULL; + if (!list.isEmpty()) + w = list[0]; + if (!w) + return; + + if (w->isA("QToolBar")){ + int index = toolBarBox->findText(((QToolBar*)w)->windowTitle()); + if (index >= 0){ + toolBarBox->setCurrentIndex(index); + toolBarBtn->setChecked(true); + } + } else { + int index = menuBox->findText(((QMenu*)w)->title().remove("&")); + if (index >= 0){ + menuBox->setCurrentIndex(index); + menuBtn->setChecked(true); + } + } +} + +void CustomActionDialog::addMenu() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + + bool ok; + QString text = QInputDialog::getText(this, tr("Add menu"), + tr("Menu title:"), QLineEdit::Normal, QString(), &ok); + if (ok && !text.isEmpty() && menuBox->findText(text) == -1){ + QStringList menus; + foreach (QMenu *m, d_menus) + menus << m->title().remove("&"); + + menus.sort(); + menus.prepend(tr("Menu Bar")); + QString parentName = QInputDialog::getItem(this, + tr("Please, choose the location of the new menu"), + tr("Menu:"), menus, 0, false, &ok); + if (ok && !parentName.isEmpty()){ + if (parentName == tr("Menu Bar")) + parentName = app->menuBar()->objectName(); + else { + foreach (QMenu *m, d_menus){ + if (m->title().remove("&") == parentName) + parentName = m->objectName(); + } + } + + text.remove("&"); + saveMenu(app->addCustomMenu(text, parentName)); + menuBox->addItem(text); + menuBox->setCurrentIndex(menuBox->findText(text)); + } + } else { + QMessageBox::critical(app, tr("Error"), + tr("There's already a menu item with this title, please choose another title!")); + } +} + +void CustomActionDialog::removeMenu() +{ + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + QString title = menuBox->currentText(); + if (QMessageBox::question(app, tr("QtiPlot") + " - " + tr("Remove Menu"), + tr("Are you sure you want to remove menu '%1' and all its actions?").arg(title), + QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel) == QMessageBox::Yes){ + + QMenu *menu = NULL; + QList userMenus = app->customMenusList(); + foreach(QMenu *m, userMenus){ + if(m->title().remove("&") == title){ + menu = m; + break; + } + } + + if (!menu) + return; + + QList actionsList = app->customActionsList(); + foreach (QAction *a, actionsList){ + if (a->statusTip() == menu->objectName()){ + QFile f(app->customActionsDirPath + "/" + a->text() + ".qca"); + f.remove(); + + QList lst = itemsList->findItems(a->text(), Qt::MatchExactly | Qt::MatchCaseSensitive); + foreach(QListWidgetItem * item, lst){ + itemsList->takeItem(itemsList->row(item)); + itemsList->removeItemWidget(item); + } + + app->removeCustomAction(a); + } + } + + title = menu->objectName(); + app->removeCustomMenu(title); + QFile f(app->customActionsDirPath + "/" + title + ".qcm"); + f.remove(); + menuBox->removeItem(menuBox->findText(title)); + } + setCurrentAction(0); +} + +void CustomActionDialog::enableDeleteMenuBtn(const QString & title) +{ + bool userMenu = true; + foreach (QMenu *m, d_menus){ + if (m->title().remove("&") == title){ + userMenu = false; + break; + } + } + removeMenuBtn->setEnabled(userMenu); +} + +void CustomActionDialog::saveMenu(QMenu *menu) +{ + if (!menu) + return; + + ApplicationWindow *app = (ApplicationWindow *)parent(); + QString fileName = app->customActionsDirPath + "/" + menu->objectName() + ".qcm"; + QFile f(fileName); + if (!f.open( QIODevice::WriteOnly)){ + QApplication::restoreOverrideCursor(); + QMessageBox::critical(app, tr("QtiPlot") + " - " + tr("File Save Error"), + tr("Could not write to file:

%1

Please verify that you have the right to write to this location!").arg(fileName)); + return; + } + + QTextStream out( &f ); + out.setCodec("UTF-8"); + out << "\n" + << "\n" + << "

\n"; + + out << "" + menu->title() + "\n"; + out << "" + menu->parentWidget()->objectName() + "\n"; + out << "\n"; +} + +/***************************************************************************** + * + * Class CustomActionHandler + * + *****************************************************************************/ + +CustomActionHandler::CustomActionHandler(QAction *action) + : d_action(action) + { + metFitTag = false; + filePath = QString(); + d_widget_name = QString(); + } + +bool CustomActionHandler::startElement(const QString & /* namespaceURI */, + const QString & /* localName */, + const QString &qName, + const QXmlAttributes &attributes) +{ + if (!metFitTag && qName != "action") { + errorStr = QObject::tr("The file is not a QtiPlot custom action file."); + return false; + } + + if (qName == "action") { + QString version = attributes.value("version"); + if (!version.isEmpty() && version != "1.0") { + errorStr = QObject::tr("The file is not an QtiPlot custom action version 1.0 file."); + return false; + } + metFitTag = true; + } + + currentText.clear(); + return true; +} + +bool CustomActionHandler::endElement(const QString & /* namespaceURI */, + const QString & /* localName */, + const QString &qName) +{ + if (qName == "text") + d_action->setText(currentText); + else if (qName == "file") + filePath = currentText; + else if (qName == "icon" && !currentText.isEmpty() && QFile::exists(currentText)){ + d_action->setIcon(QIcon(currentText)); + d_action->setIconText(currentText); + } else if (qName == "tooltip") + d_action->setToolTip(currentText); + else if (qName == "shortcut") + d_action->setShortcut(currentText); + else if (qName == "location"){ + d_widget_name = currentText; + //use status tip to store the name of the destination menu (ugly hack!) + d_action->setStatusTip(currentText); + } else if (qName == "action") + d_action->setData(filePath); + + return true; +} + +/***************************************************************************** + * + * Class CustomMenuHandler + * + *****************************************************************************/ + +CustomMenuHandler::CustomMenuHandler() + { + metFitTag = false; + d_title = QString(); + d_location = QString(); + } + +bool CustomMenuHandler::startElement(const QString & /* namespaceURI */, + const QString & /* localName */, + const QString &qName, + const QXmlAttributes &attributes) +{ + if (!metFitTag && qName != "menu") { + errorStr = QObject::tr("The file is not a QtiPlot custom menu file."); + return false; + } + + if (qName == "menu") { + QString version = attributes.value("version"); + if (!version.isEmpty() && version != "1.0") { + errorStr = QObject::tr("The file is not a QtiPlot custom menu version 1.0 file."); + return false; + } + metFitTag = true; + } + + currentText.clear(); + return true; +} + +bool CustomMenuHandler::endElement(const QString & /* namespaceURI */, + const QString & /* localName */, + const QString &qName) +{ + if (qName == "title") + d_title = currentText; + else if (qName == "location") + d_location = currentText; + + return true; +} === removed file 'qtiplot/src/core/CustomActionDialog.cpp' --- qtiplot/src/core/CustomActionDialog.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/CustomActionDialog.cpp 1970-01-01 00:00:00 +0000 @@ -1,787 +0,0 @@ -/*************************************************************************** - File : CustomActionDialog.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2007 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Custom Action dialog - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "CustomActionDialog.h" -#include "ApplicationWindow.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -CustomActionDialog::CustomActionDialog(QWidget* parent, Qt::WFlags fl) - : QDialog(parent, fl) -{ - setWindowTitle(tr("QtiPlot") + " - " + tr("Add Custom Action")); - - itemsList = new QListWidget(); - itemsList->setSelectionMode(QAbstractItemView::SingleSelection); - itemsList->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred)); - itemsList->setSpacing(2); - - QGroupBox *gb1 = new QGroupBox(); - gb1->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred)); - - QGridLayout *gl1 = new QGridLayout(gb1); - - gl1->addWidget(new QLabel(tr("Folder")), 0, 0); - folderBox = new QLineEdit(); - - gl1->addWidget(folderBox, 0, 1); - folderBtn = new QPushButton(tr("Choose &Folder")); - gl1->addWidget(folderBtn, 0, 2); - - gl1->addWidget(new QLabel(tr("Script File")), 1, 0); - fileBox = new QLineEdit(); - - gl1->addWidget(fileBox, 1, 1); - fileBtn = new QPushButton(tr("Choose &Script")); - gl1->addWidget(fileBtn, 1, 2); - - gl1->addWidget(new QLabel(tr("Icon")), 2, 0); - iconBox = new QLineEdit(); - gl1->addWidget(iconBox, 2, 1); - iconBtn = new QPushButton(tr("Choose &Icon")); - gl1->addWidget(iconBtn, 2, 2); - - gl1->addWidget(new QLabel(tr("Text")), 3, 0); - textBox = new QLineEdit(); - gl1->addWidget(textBox, 3, 1); - - gl1->addWidget(new QLabel(tr("Tool Tip Text")), 4, 0); - toolTipBox = new QLineEdit(); - gl1->addWidget(toolTipBox, 4, 1); - - gl1->addWidget(new QLabel(tr("Shortcut")), 5, 0); - shortcutBox = new QLineEdit(); - gl1->addWidget(shortcutBox, 5, 1); - - menuBtn = new QRadioButton(tr("&Menu")); - gl1->addWidget(menuBtn, 6, 0); - menuBox = new QComboBox(); - gl1->addWidget(menuBox, 6, 1); - - newMenuBtn = new QPushButton(tr("&New Menu...")); - gl1->addWidget(newMenuBtn, 6, 2); - - removeMenuBtn = new QPushButton(tr("&Delete Menu")); - gl1->addWidget(removeMenuBtn, 6, 3); - - toolBarBtn = new QRadioButton(tr("&Tool Bar")); - toolBarBtn->setChecked(true); - gl1->addWidget(toolBarBtn, 7, 0); - toolBarBox = new QComboBox(); - gl1->addWidget(toolBarBox, 7, 1); - gl1->setRowStretch(8, 1); - gl1->setColumnStretch(1, 10); - - QHBoxLayout * bottomButtons = new QHBoxLayout(); - bottomButtons->addStretch(); - buttonSave = new QPushButton(tr("&Save")); - buttonSave->setAutoDefault( true ); - bottomButtons->addWidget(buttonSave); - - buttonAdd = new QPushButton(tr("&Add")); - buttonAdd->setAutoDefault( true ); - bottomButtons->addWidget(buttonAdd); - - buttonRemove = new QPushButton(tr("&Remove")); - buttonRemove->setAutoDefault(true); - bottomButtons->addWidget(buttonRemove); - - buttonCancel = new QPushButton(tr("&Close")); - buttonCancel->setAutoDefault( true ); - bottomButtons->addWidget( buttonCancel ); - - QHBoxLayout *vl = new QHBoxLayout(); - vl->addWidget(itemsList); - vl->addWidget(gb1); - - QVBoxLayout *mainLayout = new QVBoxLayout(this); - mainLayout->addLayout(vl); - mainLayout->addLayout(bottomButtons); - - init(); - - QShortcut *accelRemove = new QShortcut(QKeySequence(Qt::Key_Delete), this); - connect(accelRemove, SIGNAL(activated()), this, SLOT(removeAction())); - - connect(newMenuBtn, SIGNAL(clicked()), this, SLOT(addMenu())); - connect(removeMenuBtn, SIGNAL(clicked()), this, SLOT(removeMenu())); - connect(menuBox, SIGNAL(currentIndexChanged (const QString &)), - this, SLOT(enableDeleteMenuBtn(const QString &))); - - connect(buttonSave, SIGNAL(clicked()), this, SLOT(saveCurrentAction())); - connect(buttonAdd, SIGNAL(clicked()), this, SLOT(addAction())); - connect(buttonRemove, SIGNAL(clicked()), this, SLOT(removeAction())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); - connect(iconBtn, SIGNAL(clicked()), this, SLOT(chooseIcon())); - connect(fileBtn, SIGNAL(clicked()), this, SLOT(chooseFile())); - connect(folderBtn, SIGNAL(clicked()), this, SLOT(chooseFolder())); - connect(itemsList, SIGNAL(currentRowChanged(int)), this, SLOT(setCurrentAction(int))); -} - -void CustomActionDialog::init() -{ - ApplicationWindow *app = (ApplicationWindow *)parent(); - folderBox->setText(app->customActionsDirPath); - - d_menus = app->customizableMenusList(); - d_app_toolbars = app->toolBarsList(); - QList d_app_menus = app->menusList(); - - QStringList toolBars, menus; - foreach (QMenu *m, d_menus + app->customMenusList()){ - if (!m->title().isEmpty()){ - menus << m->title().remove("&"); - } - } - menus.sort(); - menuBox->addItems(menus); - - //Build the list of shortcut key sequences and keep it to memory to improve speed! - foreach (QMenu *m, d_app_menus){ - QList actionsList = m->actions(); - foreach (QAction *a, actionsList){ - QString shortcut = a->shortcut().toString(); - if (!shortcut.isEmpty() && !d_app_shortcut_keys.contains(shortcut)) - d_app_shortcut_keys << shortcut; - } - } - - foreach (QToolBar *t, d_app_toolbars){ - toolBars << t->windowTitle(); - QList actionsList = t->actions(); - foreach (QAction *a, actionsList){ - QString shortcut = a->shortcut().toString(); - if (!shortcut.isEmpty() && !d_app_shortcut_keys.contains(shortcut)) - d_app_shortcut_keys << shortcut; - } - } - toolBars.sort(); - toolBarBox->addItems(toolBars); - - updateDisplayList(); - enableDeleteMenuBtn(menuBox->currentText()); -} - -void CustomActionDialog::updateDisplayList() -{ - itemsList->clear(); - - QList actionsList = ((ApplicationWindow *)parentWidget())->customActionsList(); - foreach(QAction *action, actionsList){//add existing actions to the list widget - QString text = action->text(); - QString shortcut = action->shortcut().toString(); - if (!shortcut.isEmpty()) - text += " (" + shortcut + ")"; - - QListWidgetItem *it = new QListWidgetItem(text, itemsList); - if (!action->icon().isNull()) - it->setIcon(action->icon()); - itemsList->addItem(it); - } - itemsList->setCurrentRow(0); - setCurrentAction(0); -} - -QAction* CustomActionDialog::addAction() -{ - QAction *action = NULL; - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - if (!app) - return action; - - if (validUserInput()){ - action = new QAction(app); - customizeAction(action); - - if (toolBarBtn->isChecked()){ - foreach (QToolBar *t, d_app_toolbars){ - if (t->windowTitle() == toolBarBox->currentText()){ - app->addCustomAction(action, t->objectName()); - break; - } - } - } else { - foreach (QMenu *m, d_menus + app->customMenusList()){ - if (m->title().remove("&") == menuBox->currentText()){ - action->setStatusTip(m->objectName()); - app->addCustomAction(action, m->objectName()); - break; - } - } - } - - QString text = action->text(); - QString shortcut = action->shortcut().toString(); - if (!shortcut.isEmpty()) - text += " (" + shortcut + ")"; - - QListWidgetItem *it = new QListWidgetItem(text, itemsList); - if (!action->icon().isNull()) - it->setIcon(action->icon()); - itemsList->addItem(it); - itemsList->setCurrentItem(it); - - saveAction(action); - } - return action; -} - -bool CustomActionDialog::validUserInput() -{ - QString folder = folderBox->text(); - while (folder.isEmpty() || !QFileInfo(folder).exists() || !QFileInfo(folder).isReadable()){ - chooseFolder(); - folder = folderBox->text(); - } - - ApplicationWindow *app = (ApplicationWindow *)this->parent(); - QListactions = app->customActionsList(); - - if (textBox->text().isEmpty()){ - QMessageBox::critical(app, tr("QtiPlot") + " - " + tr("Error"), - tr("Please provide a description for your custom action!")); - textBox->setFocus(); - return false; - } else if (textBox->text().contains(".")){ - QMessageBox::critical(app, tr("QtiPlot") + " - " + tr("Error"), - tr("Dot characters are not allowed in the description text!")); - textBox->setFocus(); - textBox->setText(textBox->text().remove(".").simplified()); - return false; - } - - QString text = textBox->text().remove(".").simplified(); - foreach(QAction *action, actions){ - if(action->text() == text){ - QMessageBox::critical(app, tr("QtiPlot") + " - " + tr("Error"), - tr("You have already defined an action having description: %1
Please provide a different description text!").arg(textBox->text())); - textBox->setFocus(); - return false; - } - } - - QString file = fileBox->text(); - QFileInfo fi(file); - if (file.isEmpty() || !fi.exists()){ - QMessageBox::critical(app, tr("QtiPlot") + " - " + tr("Error"), - tr("The file you have specified doesn't exist, please choose a valid script file!")); - fileBox->setFocus(); - return false; - } - - QString iconPath = iconBox->text(); - QFileInfo iconInfo(iconPath); - if (!iconPath.isEmpty() && (!iconInfo.exists() || !iconInfo.isFile() || !iconInfo.isReadable())){ - iconPath = QString(); - QMessageBox::critical(app, tr("QtiPlot") + " - " + tr("Error"), - tr("The image file you have specified doesn't exist or can't be read, please choose another file!")); - iconBox->setFocus(); - return false; - } - - QStringList shortcuts = d_app_shortcut_keys; - foreach (QAction *a, actions){ - QString shortcut = a->shortcut().toString(); - if (!shortcut.isEmpty() && !shortcuts.contains(shortcut)) - shortcuts << shortcut; - } - - shortcuts.sort(); - QString s; - int i = 0, n = shortcuts.count(); - while(i < n-5){ - s += shortcuts[i] + "\t" + shortcuts[i+1] + "\t" + shortcuts[i+2]; - s += "\t" + shortcuts[i+3] + "\t" + shortcuts[i+4] + "\n"; - i += 5; - } - - if (shortcuts.contains(shortcutBox->text().remove(QRegExp("\\s")))){ - QMessageBox::critical(app, tr("QtiPlot") + " - " + tr("Error"), - tr("Please provide a different key sequence! The following shortcut key sequences are already assigned:") + - "\n\n" + s); - shortcutBox->setFocus(); - return false; - } - - return true; -} - -void CustomActionDialog::customizeAction(QAction *action) -{ - if (!action) - return; - - action->setText(textBox->text().remove(".").simplified()); - action->setData(QFileInfo(fileBox->text()).absoluteFilePath()); - - QString iconPath = iconBox->text(); - QFileInfo iconInfo(iconPath); - if (!iconPath.isEmpty() && iconInfo.exists() && iconInfo.isFile()){ - action->setIcon(QIcon(iconPath)); - action->setIconText(iconInfo.absoluteFilePath()); - } - - if (!toolTipBox->text().isEmpty()) - action->setToolTip(toolTipBox->text().simplified()); - - if (!shortcutBox->text().isEmpty()) - action->setShortcut(shortcutBox->text().remove(QRegExp("\\s"))); -} - -void CustomActionDialog::removeAction() -{ - QString s = tr("Are you sure you want to remove this action?"); - if (QMessageBox::Yes != QMessageBox::question(this, tr("QtiPlot") + " - " + tr("Remove Action"), s, QMessageBox::Yes, QMessageBox::Cancel)) - return; - - int row = itemsList->currentRow(); - QAction *action = actionAt(row); - if (!action) - return; - - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - QFile f(app->customActionsDirPath + "/" + action->text() + ".qca"); - f.remove(); - - app->removeCustomAction(action); - - itemsList->takeItem(row); - QListWidgetItem *item = itemsList->item(row); - if (item) - itemsList->removeItemWidget(item); - - if (itemsList->count()) - setCurrentAction(0); -} - -void CustomActionDialog::saveCurrentAction() -{ - int row = itemsList->currentRow(); - QAction *action = actionAt(row); - if (!action) - return; - - QList list = action->associatedWidgets(); - QWidget *w = list[0]; - QString parentName = w->objectName(); - if ((toolBarBtn->isChecked() && w->objectName() != toolBarBox->currentText()) || - (menuBtn->isChecked() && w->objectName() != menuBox->currentText())){ - //relocate action: create a new one and delete the old - ApplicationWindow *app = (ApplicationWindow *)parent(); - QAction *newAction = new QAction(app); - customizeAction(newAction); - if (toolBarBtn->isChecked()){ - foreach (QToolBar *t, d_app_toolbars){ - if (t->windowTitle() == toolBarBox->currentText()){ - app->addCustomAction(newAction, t->objectName(), row); - break; - } - } - } else { - foreach (QMenu *m, d_menus + app->customMenusList()){ - if (m->title().remove("&") == menuBox->currentText()){ - newAction->setStatusTip(m->objectName()); - app->addCustomAction(newAction, m->objectName(), row); - break; - } - } - } - saveAction(newAction); - app->removeCustomAction(action); - delete action; - } else { - customizeAction(action); - saveAction(action); - } - - updateDisplayList(); - itemsList->setCurrentRow(row); -} - -void CustomActionDialog::saveAction(QAction *action) -{ - if (!action) - return; - - ApplicationWindow *app = (ApplicationWindow *)parent(); - QString fileName = app->customActionsDirPath + "/" + action->text() + ".qca"; - QFile f(fileName); - if (!f.open( QIODevice::WriteOnly)){ - QApplication::restoreOverrideCursor(); - QMessageBox::critical(app, tr("QtiPlot") + " - " + tr("File Save Error"), - tr("Could not write to file:

%1

Please verify that you have the right to write to this location!").arg(fileName)); - return; - } - - QTextStream out( &f ); - out.setCodec("UTF-8"); - out << "\n" - << "\n" - << "\n"; - - out << "" + action->text() + "\n"; - out << "" + action->data().toString() + "\n"; - out << "" + action->iconText() + "\n"; - out << "" + action->toolTip() + "\n"; - out << "" + action->shortcut().toString() + "\n"; - - QList list = action->associatedWidgets(); - QWidget *w = list[0]; - out << "" + w->objectName() + "\n"; - out << "\n"; -} - -void CustomActionDialog::chooseIcon() -{ - QString fn = ApplicationWindow::getFileName(this, tr("QtiPlot - Load icon from file"), - iconBox->text(), ApplicationWindow::imageFilter(), 0, false); - if (!fn.isEmpty()) - iconBox->setText(fn); -} - -void CustomActionDialog::chooseFile() -{ - QString filter = tr("Python Script") + " (*.py);;"; - filter += tr("Text") + " (*.txt *.TXT);;"; - filter += tr("All Files")+" (*)"; - - QString fileName = ApplicationWindow::getFileName(this, tr("Choose script file"), - ((ApplicationWindow *)parentWidget())->customActionsDirPath, filter, 0, false); - if (!fileName.isEmpty()) - fileBox->setText(fileName); -} - -void CustomActionDialog::chooseFolder() -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - - QString dir = QFileDialog::getExistingDirectory(this, tr("Choose the custom actions folder"), app->customActionsDirPath); - if (!dir.isEmpty() && QFileInfo(dir).isReadable()){ - QList actionsList = app->customActionsList(); - foreach (QAction *a, actionsList) - app->removeCustomAction(a); - - app->customActionsDirPath = dir; - app->loadCustomActions(); - updateDisplayList(); - folderBox->setText(dir); - } -} - -QAction * CustomActionDialog::actionAt(int row) -{ - ApplicationWindow *app = (ApplicationWindow *)this->parent(); - QListactions = app->customActionsList(); - if (actions.isEmpty() || row < 0 || row >= actions.count()) - return 0; - - return actions.at(row); -} - -void CustomActionDialog::setCurrentAction(int row) -{ - QAction *action = actionAt(row); - if (!action) - return; - - fileBox->setText(action->data().toString()); - textBox->setText(action->text()); - iconBox->setText(action->iconText()); - toolTipBox->setText(action->toolTip()); - shortcutBox->setText(action->shortcut().toString()); - - QList list = action->associatedWidgets(); - QWidget *w = NULL; - if (!list.isEmpty()) - w = list[0]; - if (!w) - return; - - if (w->isA("QToolBar")){ - int index = toolBarBox->findText(((QToolBar*)w)->windowTitle()); - if (index >= 0){ - toolBarBox->setCurrentIndex(index); - toolBarBtn->setChecked(true); - } - } else { - int index = menuBox->findText(((QMenu*)w)->title().remove("&")); - if (index >= 0){ - menuBox->setCurrentIndex(index); - menuBtn->setChecked(true); - } - } -} - -void CustomActionDialog::addMenu() -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - - bool ok; - QString text = QInputDialog::getText(this, tr("Add menu"), - tr("Menu title:"), QLineEdit::Normal, QString(), &ok); - if (ok && !text.isEmpty() && menuBox->findText(text) == -1){ - QStringList menus; - foreach (QMenu *m, d_menus) - menus << m->title().remove("&"); - - menus.sort(); - menus.prepend(tr("Menu Bar")); - QString parentName = QInputDialog::getItem(this, - tr("Please, choose the location of the new menu"), - tr("Menu:"), menus, 0, false, &ok); - if (ok && !parentName.isEmpty()){ - if (parentName == tr("Menu Bar")) - parentName = app->menuBar()->objectName(); - else { - foreach (QMenu *m, d_menus){ - if (m->title().remove("&") == parentName) - parentName = m->objectName(); - } - } - - text.remove("&"); - saveMenu(app->addCustomMenu(text, parentName)); - menuBox->addItem(text); - menuBox->setCurrentIndex(menuBox->findText(text)); - } - } else { - QMessageBox::critical(app, tr("Error"), - tr("There's already a menu item with this title, please choose another title!")); - } -} - -void CustomActionDialog::removeMenu() -{ - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - QString title = menuBox->currentText(); - if (QMessageBox::question(app, tr("QtiPlot") + " - " + tr("Remove Menu"), - tr("Are you sure you want to remove menu '%1' and all its actions?").arg(title), - QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel) == QMessageBox::Yes){ - - QMenu *menu = NULL; - QList userMenus = app->customMenusList(); - foreach(QMenu *m, userMenus){ - if(m->title().remove("&") == title){ - menu = m; - break; - } - } - - if (!menu) - return; - - QList actionsList = app->customActionsList(); - foreach (QAction *a, actionsList){ - if (a->statusTip() == menu->objectName()){ - QFile f(app->customActionsDirPath + "/" + a->text() + ".qca"); - f.remove(); - - QList lst = itemsList->findItems(a->text(), Qt::MatchExactly | Qt::MatchCaseSensitive); - foreach(QListWidgetItem * item, lst){ - itemsList->takeItem(itemsList->row(item)); - itemsList->removeItemWidget(item); - } - - app->removeCustomAction(a); - } - } - - title = menu->objectName(); - app->removeCustomMenu(title); - QFile f(app->customActionsDirPath + "/" + title + ".qcm"); - f.remove(); - menuBox->removeItem(menuBox->findText(title)); - } - setCurrentAction(0); -} - -void CustomActionDialog::enableDeleteMenuBtn(const QString & title) -{ - bool userMenu = true; - foreach (QMenu *m, d_menus){ - if (m->title().remove("&") == title){ - userMenu = false; - break; - } - } - removeMenuBtn->setEnabled(userMenu); -} - -void CustomActionDialog::saveMenu(QMenu *menu) -{ - if (!menu) - return; - - ApplicationWindow *app = (ApplicationWindow *)parent(); - QString fileName = app->customActionsDirPath + "/" + menu->objectName() + ".qcm"; - QFile f(fileName); - if (!f.open( QIODevice::WriteOnly)){ - QApplication::restoreOverrideCursor(); - QMessageBox::critical(app, tr("QtiPlot") + " - " + tr("File Save Error"), - tr("Could not write to file:

%1

Please verify that you have the right to write to this location!").arg(fileName)); - return; - } - - QTextStream out( &f ); - out.setCodec("UTF-8"); - out << "\n" - << "\n" - << "

\n"; - - out << "" + menu->title() + "\n"; - out << "" + menu->parentWidget()->objectName() + "\n"; - out << "\n"; -} - -/***************************************************************************** - * - * Class CustomActionHandler - * - *****************************************************************************/ - -CustomActionHandler::CustomActionHandler(QAction *action) - : d_action(action) - { - metFitTag = false; - filePath = QString(); - d_widget_name = QString(); - } - -bool CustomActionHandler::startElement(const QString & /* namespaceURI */, - const QString & /* localName */, - const QString &qName, - const QXmlAttributes &attributes) -{ - if (!metFitTag && qName != "action") { - errorStr = QObject::tr("The file is not a QtiPlot custom action file."); - return false; - } - - if (qName == "action") { - QString version = attributes.value("version"); - if (!version.isEmpty() && version != "1.0") { - errorStr = QObject::tr("The file is not an QtiPlot custom action version 1.0 file."); - return false; - } - metFitTag = true; - } - - currentText.clear(); - return true; -} - -bool CustomActionHandler::endElement(const QString & /* namespaceURI */, - const QString & /* localName */, - const QString &qName) -{ - if (qName == "text") - d_action->setText(currentText); - else if (qName == "file") - filePath = currentText; - else if (qName == "icon" && !currentText.isEmpty() && QFile::exists(currentText)){ - d_action->setIcon(QIcon(currentText)); - d_action->setIconText(currentText); - } else if (qName == "tooltip") - d_action->setToolTip(currentText); - else if (qName == "shortcut") - d_action->setShortcut(currentText); - else if (qName == "location"){ - d_widget_name = currentText; - //use status tip to store the name of the destination menu (ugly hack!) - d_action->setStatusTip(currentText); - } else if (qName == "action") - d_action->setData(filePath); - - return true; -} - -/***************************************************************************** - * - * Class CustomMenuHandler - * - *****************************************************************************/ - -CustomMenuHandler::CustomMenuHandler() - { - metFitTag = false; - d_title = QString(); - d_location = QString(); - } - -bool CustomMenuHandler::startElement(const QString & /* namespaceURI */, - const QString & /* localName */, - const QString &qName, - const QXmlAttributes &attributes) -{ - if (!metFitTag && qName != "menu") { - errorStr = QObject::tr("The file is not a QtiPlot custom menu file."); - return false; - } - - if (qName == "menu") { - QString version = attributes.value("version"); - if (!version.isEmpty() && version != "1.0") { - errorStr = QObject::tr("The file is not a QtiPlot custom menu version 1.0 file."); - return false; - } - metFitTag = true; - } - - currentText.clear(); - return true; -} - -bool CustomMenuHandler::endElement(const QString & /* namespaceURI */, - const QString & /* localName */, - const QString &qName) -{ - if (qName == "title") - d_title = currentText; - else if (qName == "location") - d_location = currentText; - - return true; -} === added file 'qtiplot/src/core/CustomActionDialog.h' --- qtiplot/src/core/CustomActionDialog.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/CustomActionDialog.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,135 @@ +/*************************************************************************** + File : CustomActionDialog.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2007 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Custom Action dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef CustomActionDialog_H +#define CustomActionDialog_H + +#include +#include + +class QGroupBox; +class QPushButton; +class QRadioButton; +class QComboBox; +class QListWidget; +class QLineEdit; +class QMenu; +class QToolBar; + +class CustomActionDialog : public QDialog +{ + Q_OBJECT + +public: + //! Constructor + /** + * \param parent parent widget (must be the application window!= + * \param fl window flags + */ + CustomActionDialog( QWidget* parent, Qt::WFlags fl = 0 ); + +private slots: + void chooseIcon(); + void chooseFile(); + void chooseFolder(); + QAction* addAction(); + void removeAction(); + void setCurrentAction(int); + void saveCurrentAction(); + void addMenu(); + void removeMenu(); + void enableDeleteMenuBtn(const QString &); + +private: + void init(); + void updateDisplayList(); + QAction* actionAt(int row); + void saveAction(QAction *action); + void customizeAction(QAction *action); + bool validUserInput(); + void saveMenu(QMenu *menu); + + QStringList d_app_shortcut_keys; + + QList d_menus; + QList d_app_toolbars; + + QListWidget *itemsList; + QPushButton *buttonCancel, *buttonAdd, *buttonRemove, *buttonSave; + QPushButton *folderBtn, *fileBtn, *iconBtn; + QLineEdit *folderBox, *fileBox, *iconBox, *textBox, *toolTipBox, *shortcutBox; + QRadioButton *menuBtn, *toolBarBtn; + QComboBox *menuBox, *toolBarBox; + QPushButton *newMenuBtn, *removeMenuBtn; +}; + +class CustomActionHandler : public QXmlDefaultHandler +{ +public: + CustomActionHandler(QAction *action); + + bool startElement(const QString &namespaceURI, const QString &localName, + const QString &qName, const QXmlAttributes &attributes); + bool endElement(const QString &namespaceURI, const QString &localName, + const QString &qName); + bool characters(const QString &str){currentText += str; return true;}; + bool fatalError(const QXmlParseException &){return false;}; + QString errorString() const {return errorStr;}; + QString parentName(){return d_widget_name;}; + +private: + bool metFitTag; + QString currentText; + QString errorStr; + QString filePath; + QString d_widget_name; + QAction *d_action; +}; + +class CustomMenuHandler : public QXmlDefaultHandler +{ +public: + CustomMenuHandler(); + + bool startElement(const QString &namespaceURI, const QString &localName, + const QString &qName, const QXmlAttributes &attributes); + bool endElement(const QString &namespaceURI, const QString &localName, + const QString &qName); + bool characters(const QString &str){currentText += str; return true;}; + bool fatalError(const QXmlParseException &){return false;}; + QString errorString() const {return errorStr;}; + QString location(){return d_location;}; + QString title(){return d_title;}; + +private: + bool metFitTag; + QString currentText; + QString errorStr; + QString d_location, d_title; +}; +#endif === removed file 'qtiplot/src/core/CustomActionDialog.h' --- qtiplot/src/core/CustomActionDialog.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/CustomActionDialog.h 1970-01-01 00:00:00 +0000 @@ -1,135 +0,0 @@ -/*************************************************************************** - File : CustomActionDialog.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2007 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Custom Action dialog - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef CustomActionDialog_H -#define CustomActionDialog_H - -#include -#include - -class QGroupBox; -class QPushButton; -class QRadioButton; -class QComboBox; -class QListWidget; -class QLineEdit; -class QMenu; -class QToolBar; - -class CustomActionDialog : public QDialog -{ - Q_OBJECT - -public: - //! Constructor - /** - * \param parent parent widget (must be the application window!= - * \param fl window flags - */ - CustomActionDialog( QWidget* parent, Qt::WFlags fl = 0 ); - -private slots: - void chooseIcon(); - void chooseFile(); - void chooseFolder(); - QAction* addAction(); - void removeAction(); - void setCurrentAction(int); - void saveCurrentAction(); - void addMenu(); - void removeMenu(); - void enableDeleteMenuBtn(const QString &); - -private: - void init(); - void updateDisplayList(); - QAction* actionAt(int row); - void saveAction(QAction *action); - void customizeAction(QAction *action); - bool validUserInput(); - void saveMenu(QMenu *menu); - - QStringList d_app_shortcut_keys; - - QList d_menus; - QList d_app_toolbars; - - QListWidget *itemsList; - QPushButton *buttonCancel, *buttonAdd, *buttonRemove, *buttonSave; - QPushButton *folderBtn, *fileBtn, *iconBtn; - QLineEdit *folderBox, *fileBox, *iconBox, *textBox, *toolTipBox, *shortcutBox; - QRadioButton *menuBtn, *toolBarBtn; - QComboBox *menuBox, *toolBarBox; - QPushButton *newMenuBtn, *removeMenuBtn; -}; - -class CustomActionHandler : public QXmlDefaultHandler -{ -public: - CustomActionHandler(QAction *action); - - bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &attributes); - bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - bool characters(const QString &str){currentText += str; return true;}; - bool fatalError(const QXmlParseException &){return false;}; - QString errorString() const {return errorStr;}; - QString parentName(){return d_widget_name;}; - -private: - bool metFitTag; - QString currentText; - QString errorStr; - QString filePath; - QString d_widget_name; - QAction *d_action; -}; - -class CustomMenuHandler : public QXmlDefaultHandler -{ -public: - CustomMenuHandler(); - - bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &attributes); - bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - bool characters(const QString &str){currentText += str; return true;}; - bool fatalError(const QXmlParseException &){return false;}; - QString errorString() const {return errorStr;}; - QString location(){return d_location;}; - QString title(){return d_title;}; - -private: - bool metFitTag; - QString currentText; - QString errorStr; - QString d_location, d_title; -}; -#endif === added file 'qtiplot/src/core/FindDialog.cpp' --- qtiplot/src/core/FindDialog.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/FindDialog.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,144 @@ +/*************************************************************************** + File : FindDialog.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Find dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "FindDialog.h" +#include "ApplicationWindow.h" +#include "Folder.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +FindDialog::FindDialog( QWidget* parent, Qt::WFlags fl ) + : QDialog( parent, fl ) +{ + setWindowTitle (tr("QtiPlot") + " - " + tr("Find")); + setSizeGripEnabled( true ); + setAttribute(Qt::WA_DeleteOnClose); + + QGridLayout * topLayout = new QGridLayout(); + QGridLayout * bottomLayout = new QGridLayout(); + + topLayout->addWidget( new QLabel(tr( "Start From" )), 0, 0 ); + labelStart = new QLabel(); + labelStart->setFrameStyle(QFrame::Panel | QFrame::Sunken); + labelStart->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); + topLayout->addWidget( labelStart, 0, 1, 1, 4 ); + + topLayout->addWidget( new QLabel(tr( "Find" )), 1, 0 ); + boxFind = new QComboBox(); + boxFind->setEditable(true); + boxFind->setDuplicatesEnabled(false); + boxFind->setInsertPolicy( QComboBox::InsertAtTop ); + boxFind->setAutoCompletion(true); + boxFind->setMaxCount ( 10 ); + boxFind->setMaxVisibleItems ( 10 ); + boxFind->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); + topLayout->addWidget( boxFind, 1, 1, 1, 4 ); + + QGroupBox * groupBox = new QGroupBox(tr("Search in")); + QVBoxLayout * groupBoxLayout = new QVBoxLayout( groupBox ); + + boxWindowNames = new QCheckBox(tr("&Window Names")); + boxWindowNames->setChecked(true); + groupBoxLayout->addWidget(boxWindowNames); + + boxWindowLabels = new QCheckBox(tr("Window &Labels")); + boxWindowLabels->setChecked( false ); + groupBoxLayout->addWidget(boxWindowLabels); + + boxFolderNames = new QCheckBox(tr("Folder &Names")); + boxFolderNames->setChecked( false ); + groupBoxLayout->addWidget(boxFolderNames); + + bottomLayout->addWidget( groupBox, 0, 0, 3, 1 ); + + boxCaseSensitive = new QCheckBox(tr("Case &Sensitive")); + boxCaseSensitive->setChecked(false); + bottomLayout->addWidget( boxCaseSensitive, 0, 1 ); + + boxPartialMatch = new QCheckBox(tr("&Partial Match Allowed")); + boxPartialMatch->setChecked(true); + bottomLayout->addWidget( boxPartialMatch, 1, 1 ); + + boxSubfolders = new QCheckBox(tr("&Include Subfolders")); + boxSubfolders->setChecked(true); + bottomLayout->addWidget( boxSubfolders, 2, 1 ); + + buttonFind = new QPushButton(tr("&Find")); + buttonFind->setDefault( true ); + bottomLayout->addWidget( buttonFind, 0, 2 ); + + buttonReset = new QPushButton(tr("&Update Start Path")); + bottomLayout->addWidget( buttonReset, 1, 2 ); + buttonCancel = new QPushButton(tr("&Close")); + bottomLayout->addWidget( buttonCancel, 2, 2 ); + bottomLayout->setColumnStretch(4, 1); + + QVBoxLayout* mainLayout = new QVBoxLayout(this); + mainLayout->addLayout(topLayout); + mainLayout->addLayout(bottomLayout); + mainLayout->addStretch(); + + setStartPath(); + + // signals and slots connections + connect( buttonFind, SIGNAL( clicked() ), this, SLOT( accept() ) ); + connect( buttonReset, SIGNAL( clicked() ), this, SLOT( setStartPath() ) ); + connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); +} + +void FindDialog::setStartPath() +{ + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + labelStart->setText(app->current_folder->path()); +} + +void FindDialog::accept() +{ + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + app->find(boxFind->currentText(), boxWindowNames->isChecked(), boxWindowLabels->isChecked(), + boxFolderNames->isChecked(), boxCaseSensitive->isChecked(), boxPartialMatch->isChecked(), + boxSubfolders->isChecked()); + // add the combo box's current text to the list when the find button is pressed + QString text = boxFind->currentText(); + if(!text.isEmpty() && boxFind->findText(text) == -1){ // no duplicates + boxFind->insertItem(0, text); + boxFind->setCurrentIndex(0); + } +} + +FindDialog::~FindDialog() +{ +} === removed file 'qtiplot/src/core/FindDialog.cpp' --- qtiplot/src/core/FindDialog.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/FindDialog.cpp 1970-01-01 00:00:00 +0000 @@ -1,144 +0,0 @@ -/*************************************************************************** - File : FindDialog.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Find dialog - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "FindDialog.h" -#include "ApplicationWindow.h" -#include "Folder.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -FindDialog::FindDialog( QWidget* parent, Qt::WFlags fl ) - : QDialog( parent, fl ) -{ - setWindowTitle (tr("QtiPlot") + " - " + tr("Find")); - setSizeGripEnabled( true ); - setAttribute(Qt::WA_DeleteOnClose); - - QGridLayout * topLayout = new QGridLayout(); - QGridLayout * bottomLayout = new QGridLayout(); - - topLayout->addWidget( new QLabel(tr( "Start From" )), 0, 0 ); - labelStart = new QLabel(); - labelStart->setFrameStyle(QFrame::Panel | QFrame::Sunken); - labelStart->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); - topLayout->addWidget( labelStart, 0, 1, 1, 4 ); - - topLayout->addWidget( new QLabel(tr( "Find" )), 1, 0 ); - boxFind = new QComboBox(); - boxFind->setEditable(true); - boxFind->setDuplicatesEnabled(false); - boxFind->setInsertPolicy( QComboBox::InsertAtTop ); - boxFind->setAutoCompletion(true); - boxFind->setMaxCount ( 10 ); - boxFind->setMaxVisibleItems ( 10 ); - boxFind->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); - topLayout->addWidget( boxFind, 1, 1, 1, 4 ); - - QGroupBox * groupBox = new QGroupBox(tr("Search in")); - QVBoxLayout * groupBoxLayout = new QVBoxLayout( groupBox ); - - boxWindowNames = new QCheckBox(tr("&Window Names")); - boxWindowNames->setChecked(true); - groupBoxLayout->addWidget(boxWindowNames); - - boxWindowLabels = new QCheckBox(tr("Window &Labels")); - boxWindowLabels->setChecked( false ); - groupBoxLayout->addWidget(boxWindowLabels); - - boxFolderNames = new QCheckBox(tr("Folder &Names")); - boxFolderNames->setChecked( false ); - groupBoxLayout->addWidget(boxFolderNames); - - bottomLayout->addWidget( groupBox, 0, 0, 3, 1 ); - - boxCaseSensitive = new QCheckBox(tr("Case &Sensitive")); - boxCaseSensitive->setChecked(false); - bottomLayout->addWidget( boxCaseSensitive, 0, 1 ); - - boxPartialMatch = new QCheckBox(tr("&Partial Match Allowed")); - boxPartialMatch->setChecked(true); - bottomLayout->addWidget( boxPartialMatch, 1, 1 ); - - boxSubfolders = new QCheckBox(tr("&Include Subfolders")); - boxSubfolders->setChecked(true); - bottomLayout->addWidget( boxSubfolders, 2, 1 ); - - buttonFind = new QPushButton(tr("&Find")); - buttonFind->setDefault( true ); - bottomLayout->addWidget( buttonFind, 0, 2 ); - - buttonReset = new QPushButton(tr("&Update Start Path")); - bottomLayout->addWidget( buttonReset, 1, 2 ); - buttonCancel = new QPushButton(tr("&Close")); - bottomLayout->addWidget( buttonCancel, 2, 2 ); - bottomLayout->setColumnStretch(4, 1); - - QVBoxLayout* mainLayout = new QVBoxLayout(this); - mainLayout->addLayout(topLayout); - mainLayout->addLayout(bottomLayout); - mainLayout->addStretch(); - - setStartPath(); - - // signals and slots connections - connect( buttonFind, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonReset, SIGNAL( clicked() ), this, SLOT( setStartPath() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); -} - -void FindDialog::setStartPath() -{ - ApplicationWindow *app = (ApplicationWindow *)this->parent(); - labelStart->setText(app->current_folder->path()); -} - -void FindDialog::accept() -{ - ApplicationWindow *app = (ApplicationWindow *)this->parent(); - app->find(boxFind->currentText(), boxWindowNames->isChecked(), boxWindowLabels->isChecked(), - boxFolderNames->isChecked(), boxCaseSensitive->isChecked(), boxPartialMatch->isChecked(), - boxSubfolders->isChecked()); - // add the combo box's current text to the list when the find button is pressed - QString text = boxFind->currentText(); - if(!text.isEmpty() && boxFind->findText(text) == -1){ // no duplicates - boxFind->insertItem(0, text); - boxFind->setCurrentIndex(0); - } -} - -FindDialog::~FindDialog() -{ -} === added file 'qtiplot/src/core/FindDialog.h' --- qtiplot/src/core/FindDialog.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/FindDialog.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,75 @@ +/*************************************************************************** + File : FindDialog.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Find dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef FINDDIALOG_H +#define FINDDIALOG_H + +#include +#include + +class QPushButton; +class QCheckBox; +class QComboBox; +class QLabel; + +//! Find dialog +class FindDialog : public QDialog +{ + Q_OBJECT + +public: + FindDialog( QWidget* parent = 0, Qt::WFlags fl = 0 ); + ~FindDialog(); + +private: + QPushButton* buttonFind; + QPushButton* buttonCancel; + QPushButton* buttonReset; + + QLabel *labelStart; + QComboBox* boxFind; + + QCheckBox* boxWindowNames; + QCheckBox* boxWindowLabels; + QCheckBox* boxFolderNames; + + QCheckBox* boxCaseSensitive; + QCheckBox* boxPartialMatch; + QCheckBox* boxSubfolders; + +public slots: + + //! Displays the project current folder path + void setStartPath(); + +protected slots: + + void accept(); +}; + +#endif // exportDialog_H === removed file 'qtiplot/src/core/FindDialog.h' --- qtiplot/src/core/FindDialog.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/FindDialog.h 1970-01-01 00:00:00 +0000 @@ -1,75 +0,0 @@ -/*************************************************************************** - File : FindDialog.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Find dialog - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef FINDDIALOG_H -#define FINDDIALOG_H - -#include -#include - -class QPushButton; -class QCheckBox; -class QComboBox; -class QLabel; - -//! Find dialog -class FindDialog : public QDialog -{ - Q_OBJECT - -public: - FindDialog( QWidget* parent = 0, Qt::WFlags fl = 0 ); - ~FindDialog(); - -private: - QPushButton* buttonFind; - QPushButton* buttonCancel; - QPushButton* buttonReset; - - QLabel *labelStart; - QComboBox* boxFind; - - QCheckBox* boxWindowNames; - QCheckBox* boxWindowLabels; - QCheckBox* boxFolderNames; - - QCheckBox* boxCaseSensitive; - QCheckBox* boxPartialMatch; - QCheckBox* boxSubfolders; - -public slots: - - //! Displays the project current folder path - void setStartPath(); - -protected slots: - - void accept(); -}; - -#endif // exportDialog_H === added file 'qtiplot/src/core/Folder.cpp' --- qtiplot/src/core/Folder.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/Folder.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,437 @@ +/*************************************************************************** + File : Folder.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de + Description : Folder for the project explorer + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "Folder.h" +#include "ApplicationWindow.h" + +#include +#include + +Folder::Folder( Folder *parent, const QString &name ) + : QObject(parent), d_log_info(QString()), d_active_window(0) +{ + birthdate = QDateTime::currentDateTime ().toString(Qt::LocalDate); + setObjectName(name); +} + +QList Folder::folders() +{ + QList lst; + foreach(QObject *f, children()) + lst.append((Folder*) f); + return lst; +} + +QStringList Folder::subfolders() +{ + QStringList list = QStringList(); + QObjectList folderList = children(); + if (!folderList.isEmpty()){ + QObject * f; + foreach(f,folderList) + list << static_cast(f)->objectName(); + } + return list; +} + +QString Folder::path() +{ + QString s = "/" + QString(objectName()) + "/"; + Folder *parentFolder = (Folder *)parent(); + while (parentFolder){ + s.prepend("/" + QString(parentFolder->objectName())); + parentFolder = (Folder *)parentFolder->parent(); + } + return s; +} + +int Folder::depth() +{ + int d = 0; + Folder *parentFolder = (Folder *)parent(); + while (parentFolder){ + ++d; + parentFolder = (Folder *)parentFolder->parent(); + } + return d; +} + +Folder* Folder::folderBelow() +{ + QList lst = folders(); + if (!lst.isEmpty()) + return lst.first(); + + Folder *parentFolder = (Folder *)parent(); + Folder *childFolder = this; + while (parentFolder && childFolder){ + lst = parentFolder->folders(); + int pos = lst.indexOf(childFolder) + 1; + if (pos < lst.size()) + return lst.at(pos); + + childFolder = parentFolder; + parentFolder = (Folder *)parentFolder->parent(); + } + return NULL; +} + +Folder* Folder::findSubfolder(const QString& s, bool caseSensitive, bool partialMatch) +{ + QObjectList folderList = children(); + if (!folderList.isEmpty()){ + QObject * f; + foreach(f,folderList){ + QString name = static_cast(f)->objectName(); + if (partialMatch){ + if (caseSensitive && name.startsWith(s,Qt::CaseSensitive)) + return static_cast(f); + else if (!caseSensitive && name.startsWith(s,Qt::CaseInsensitive)) + return static_cast(f); + } else {// partialMatch == false + if (caseSensitive && name == s) + return static_cast(f); + else if ( !caseSensitive && (name.toLower() == s.toLower()) ) + return static_cast(f); + } + + Folder* folder = ((Folder*)f)->findSubfolder(s, caseSensitive, partialMatch); + if(folder) + return folder; + } + } + return 0; +} + +MdiSubWindow* Folder::findWindow(const QString& s, bool windowNames, bool labels, + bool caseSensitive, bool partialMatch) +{ + MdiSubWindow* w; + foreach(w,lstWindows){ + if (windowNames){ + QString name = w->objectName(); + if (partialMatch && name.contains(s, caseSensitive)) + return w; + else if (caseSensitive && name == s) + return w; + else { + QString text = s; + if (name == text.lower()) + return w; + } + } + + if (labels){ + QString label = w->windowLabel(); + if (partialMatch && label.contains(s, caseSensitive)) + return w; + else if (caseSensitive && label == s) + return w; + else { + QString text = s; + if (label == text.lower()) + return w; + } + } + } + return 0; +} + +MdiSubWindow *Folder::window(const QString &name, const char *cls, bool recursive) +{ + foreach (MdiSubWindow *w, lstWindows){ + if (w->inherits(cls) && name == w->objectName()) + return w; + } + + if (!recursive) return NULL; + foreach (QObject *f, children()){ + MdiSubWindow *w = ((Folder*)f)->window(name, cls, true); + if (w) return w; + } + return NULL; +} + +void Folder::addWindow( MdiSubWindow *w ) +{ + if (w) { + lstWindows.append( w ); + w->setFolder(this); + } +} + +void Folder::removeWindow( MdiSubWindow *w ) +{ + if (!w) + return; + + if (d_active_window && d_active_window == w) + d_active_window = NULL; + + int index = lstWindows.indexOf(w); + if (index >= 0 && index < lstWindows.size()) + lstWindows.removeAt(index); +} + +QString Folder::sizeToString() +{ + int size = 0; + + QObjectList folderList = children(); + if (!folderList.isEmpty()){ + QObject *f; + foreach(f,folderList) + size += sizeof(static_cast(f)); // FIXME: Doesn't this function add the size of pointers together? For what? + } + + MdiSubWindow * w; + foreach(w, lstWindows) + size += sizeof(w); + + return QString::number(8*size/1024.0,'f',1)+" "+tr("kB")+" ("+QString::number(8*size)+" "+tr("bytes")+")"; +} + +Folder* Folder::rootFolder() +{ + Folder *i = this; + while(i->parent()) + i = (Folder*)i->parent(); + return i; +} + +/***************************************************************************** + * + * Class FolderListItem + * + *****************************************************************************/ + +FolderListItem::FolderListItem( Q3ListView *parent, Folder *f ) + : Q3ListViewItem( parent ) +{ + myFolder = f; + + setText(0, f->objectName()); + setOpen(true); + setActive(true); + setDragEnabled (true); + setDropEnabled (true); +} + +FolderListItem::FolderListItem( FolderListItem *parent, Folder *f ) + : Q3ListViewItem( parent ) +{ + myFolder = f; + + setText(0, f->objectName()); + setOpen(true); + setActive(true); +} + +void FolderListItem::setActive( bool o ) +{ + if (o) + setPixmap(0, QPixmap(":/folder_open.png")); + else + setPixmap(0, QPixmap(":/folder_closed.png")); + + setSelected(o); +} + +bool FolderListItem::isChildOf(FolderListItem *src) +{ + FolderListItem *parent = (FolderListItem *)this->parent(); + while (parent){ + if (parent == src) + return true; + + parent = (FolderListItem *)parent->parent(); + } + return false; +} + +/***************************************************************************** + * + * Class FolderListView + * + *****************************************************************************/ + +FolderListView::FolderListView( QWidget *parent, const char *name ) + : Q3ListView( parent, name ), mousePressed( false ) +{ + setAcceptDrops( true ); + viewport()->setAcceptDrops( true ); + + if (parent){ + connect(this, SIGNAL(collapsed(Q3ListViewItem *)), (ApplicationWindow *)parent, SLOT(modifiedProject())); + connect(this, SIGNAL(expanded(Q3ListViewItem *)), (ApplicationWindow *)parent, SLOT(modifiedProject())); + connect(this, SIGNAL(expanded(Q3ListViewItem *)), this, SLOT(expandedItem(Q3ListViewItem *))); + } +} + +void FolderListView::expandedItem(Q3ListViewItem *item) +{ + Q3ListViewItem *next = item->itemBelow(); + if (next) + setSelected (next, false); +} + +void FolderListView::startDrag() +{ +Q3ListViewItem *item = currentItem(); +if (!item) + return; + +if (item == firstChild() && item->listView()->rootIsDecorated()) + return;//it's the project folder so we don't want the user to move it + +QPoint orig = viewportToContents( viewport()->mapFromGlobal( QCursor::pos() ) ); + +QPixmap pix; +if (item->rtti() == FolderListItem::RTTI) + pix = QPixmap(":/folder_closed.png"); +else + pix = *item->pixmap (0); + +Q3IconDrag *drag = new Q3IconDrag(viewport()); +drag->setPixmap(pix, QPoint(pix.width()/2, pix.height()/2 ) ); + +QList lst; +for (item = firstChild(); item; item = item->itemBelow()) + { + if (item->isSelected()) + lst.append(item); + } + +emit dragItems(lst); +drag->drag(); +} + +void FolderListView::contentsDropEvent( QDropEvent *e ) +{ +Q3ListViewItem *dest = itemAt( contentsToViewport(e->pos()) ); +if ( dest && dest->rtti() == FolderListItem::RTTI) + { + emit dropItems(dest); + e->accept(); + } +else + e->ignore(); +} + +void FolderListView::keyPressEvent ( QKeyEvent * e ) +{ + if (isRenaming()){ + e->ignore(); + return; + } + + Q3ListViewItem *item = currentItem(); + if (!item) { + Q3ListView::keyPressEvent ( e ); + return; + } + + if (item->rtti() == FolderListItem::RTTI && + (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return)){ + emit doubleClicked(item); + e->accept(); + } else if (e->key() == Qt::Key_F2) { + if (item) + emit renameItem(item); + e->accept(); + } else if(e->key() == Qt::Key_A && e->state() == Qt::ControlModifier){ + selectAll(true); + e->accept(); + } else if(e->key() == Qt::Key_F7) { + emit addFolderItem(); + e->accept(); + } else if(e->key() == Qt::Key_F8){ + emit deleteSelection(); + e->accept(); + } else + Q3ListView::keyPressEvent ( e ); +} + +void FolderListView::contentsMouseDoubleClickEvent( QMouseEvent* e ) +{ + if (isRenaming()) + { + e->ignore(); + return; + } + + Q3ListView::contentsMouseDoubleClickEvent( e ); +} + +void FolderListView::contentsMousePressEvent( QMouseEvent* e ) +{ + Q3ListView::contentsMousePressEvent(e); + QPoint p( contentsToViewport( e->pos() ) ); + Q3ListViewItem *i = itemAt( p ); + if ( i ) + {// if the user clicked into the root decoration of the item, don't try to start a drag! + if ( p.x() > header()->cellPos( header()->mapToActual( 0 ) ) + + treeStepSize() * ( i->depth() + ( rootIsDecorated() ? 1 : 0) ) + itemMargin() || + p.x() < header()->cellPos( header()->mapToActual( 0 ) ) ) + { + presspos = e->pos(); + mousePressed = true; + } + } +} + +void FolderListView::contentsMouseMoveEvent( QMouseEvent* e ) +{ +if ( mousePressed && ( presspos - e->pos() ).manhattanLength() > QApplication::startDragDistance() ) + { + mousePressed = false; + Q3ListViewItem *item = itemAt( contentsToViewport(presspos) ); + if ( item ) + startDrag(); + } +} + +void FolderListView::adjustColumns() +{ +for (int i=0; i < columns (); i++) + adjustColumn(i); +} + +/***************************************************************************** + * + * Class WindowListItem + * + *****************************************************************************/ + +WindowListItem::WindowListItem( Q3ListView *parent, MdiSubWindow *w ) + : Q3ListViewItem( parent ) +{ + myWindow = w; + + setDragEnabled ( true ); +} === removed file 'qtiplot/src/core/Folder.cpp' --- qtiplot/src/core/Folder.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/Folder.cpp 1970-01-01 00:00:00 +0000 @@ -1,495 +0,0 @@ -/*************************************************************************** - File : Folder.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de - Description : Folder for the project explorer - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "Folder.h" -#include "ApplicationWindow.h" - -#include -#include - -static const char* folder_closed_xpm[]={ - "16 16 9 1", - "g c #808080", - "b c #c0c000", - "e c #c0c0c0", - "# c #000000", - "c c #ffff00", - ". c None", - "a c #585858", - "f c #a0a0a4", - "d c #ffffff", - "..###...........", - ".#abc##.........", - ".#daabc#####....", - ".#ddeaabbccc#...", - ".#dedeeabbbba...", - ".#edeeeeaaaab#..", - ".#deeeeeeefe#ba.", - ".#eeeeeeefef#ba.", - ".#eeeeeefeff#ba.", - ".#eeeeefefff#ba.", - ".##geefeffff#ba.", - "...##gefffff#ba.", - ".....##fffff#ba.", - ".......##fff#b##", - ".........##f#b##", - "...........####."}; - -static const char* folder_open_xpm[]={ - "16 16 11 1", - "# c #000000", - "g c #c0c0c0", - "e c #303030", - "a c #ffa858", - "b c #808080", - "d c #a0a0a4", - "f c #585858", - "c c #ffdca8", - "h c #dcdcdc", - "i c #ffffff", - ". c None", - "....###.........", - "....#ab##.......", - "....#acab####...", - "###.#acccccca#..", - "#ddefaaaccccca#.", - "#bdddbaaaacccab#", - ".eddddbbaaaacab#", - ".#bddggdbbaaaab#", - "..edgdggggbbaab#", - "..#bgggghghdaab#", - "...ebhggghicfab#", - "....#edhhiiidab#", - "......#egiiicfb#", - "........#egiibb#", - "..........#egib#", - "............#ee#"}; - -Folder::Folder( Folder *parent, const QString &name ) - : QObject(parent), d_log_info(QString()), d_active_window(0) -{ - birthdate = QDateTime::currentDateTime ().toString(Qt::LocalDate); - setObjectName(name); -} - -QList Folder::folders() -{ - QList lst; - foreach(QObject *f, children()) - lst.append((Folder*) f); - return lst; -} - -QStringList Folder::subfolders() -{ - QStringList list = QStringList(); - QObjectList folderList = children(); - if (!folderList.isEmpty()){ - QObject * f; - foreach(f,folderList) - list << static_cast(f)->objectName(); - } - return list; -} - -QString Folder::path() -{ - QString s = "/" + QString(objectName()) + "/"; - Folder *parentFolder = (Folder *)parent(); - while (parentFolder){ - s.prepend("/" + QString(parentFolder->objectName())); - parentFolder = (Folder *)parentFolder->parent(); - } - return s; -} - -int Folder::depth() -{ - int d = 0; - Folder *parentFolder = (Folder *)parent(); - while (parentFolder){ - ++d; - parentFolder = (Folder *)parentFolder->parent(); - } - return d; -} - -Folder* Folder::folderBelow() -{ - QList lst = folders(); - if (!lst.isEmpty()) - return lst.first(); - - Folder *parentFolder = (Folder *)parent(); - Folder *childFolder = this; - while (parentFolder && childFolder){ - lst = parentFolder->folders(); - int pos = lst.indexOf(childFolder) + 1; - if (pos < lst.size()) - return lst.at(pos); - - childFolder = parentFolder; - parentFolder = (Folder *)parentFolder->parent(); - } - return NULL; -} - -Folder* Folder::findSubfolder(const QString& s, bool caseSensitive, bool partialMatch) -{ - QObjectList folderList = children(); - if (!folderList.isEmpty()){ - QObject * f; - foreach(f,folderList){ - QString name = static_cast(f)->objectName(); - if (partialMatch){ - if (caseSensitive && name.startsWith(s,Qt::CaseSensitive)) - return static_cast(f); - else if (!caseSensitive && name.startsWith(s,Qt::CaseInsensitive)) - return static_cast(f); - } else {// partialMatch == false - if (caseSensitive && name == s) - return static_cast(f); - else if ( !caseSensitive && (name.toLower() == s.toLower()) ) - return static_cast(f); - } - - Folder* folder = ((Folder*)f)->findSubfolder(s, caseSensitive, partialMatch); - if(folder) - return folder; - } - } - return 0; -} - -MdiSubWindow* Folder::findWindow(const QString& s, bool windowNames, bool labels, - bool caseSensitive, bool partialMatch) -{ - MdiSubWindow* w; - foreach(w,lstWindows){ - if (windowNames){ - QString name = w->objectName(); - if (partialMatch && name.contains(s, caseSensitive)) - return w; - else if (caseSensitive && name == s) - return w; - else { - QString text = s; - if (name == text.lower()) - return w; - } - } - - if (labels){ - QString label = w->windowLabel(); - if (partialMatch && label.contains(s, caseSensitive)) - return w; - else if (caseSensitive && label == s) - return w; - else { - QString text = s; - if (label == text.lower()) - return w; - } - } - } - return 0; -} - -MdiSubWindow *Folder::window(const QString &name, const char *cls, bool recursive) -{ - foreach (MdiSubWindow *w, lstWindows){ - if (w->inherits(cls) && name == w->objectName()) - return w; - } - - if (!recursive) return NULL; - foreach (QObject *f, children()){ - MdiSubWindow *w = ((Folder*)f)->window(name, cls, true); - if (w) return w; - } - return NULL; -} - -void Folder::addWindow( MdiSubWindow *w ) -{ - if (w) { - lstWindows.append( w ); - w->setFolder(this); - } -} - -void Folder::removeWindow( MdiSubWindow *w ) -{ - if (!w) - return; - - if (d_active_window && d_active_window == w) - d_active_window = NULL; - - int index = lstWindows.indexOf(w); - if (index >= 0 && index < lstWindows.size()) - lstWindows.removeAt(index); -} - -QString Folder::sizeToString() -{ - int size = 0; - - QObjectList folderList = children(); - if (!folderList.isEmpty()){ - QObject *f; - foreach(f,folderList) - size += sizeof(static_cast(f)); // FIXME: Doesn't this function add the size of pointers together? For what? - } - - MdiSubWindow * w; - foreach(w, lstWindows) - size += sizeof(w); - - return QString::number(8*size/1024.0,'f',1)+" "+tr("kB")+" ("+QString::number(8*size)+" "+tr("bytes")+")"; -} - -Folder* Folder::rootFolder() -{ - Folder *i = this; - while(i->parent()) - i = (Folder*)i->parent(); - return i; -} - -/***************************************************************************** - * - * Class FolderListItem - * - *****************************************************************************/ - -FolderListItem::FolderListItem( Q3ListView *parent, Folder *f ) - : Q3ListViewItem( parent ) -{ - myFolder = f; - - setText(0, f->objectName()); - setOpen(true); - setActive(true); - setDragEnabled (true); - setDropEnabled (true); -} - -FolderListItem::FolderListItem( FolderListItem *parent, Folder *f ) - : Q3ListViewItem( parent ) -{ - myFolder = f; - - setText(0, f->objectName()); - setOpen(true); - setActive(true); -} - -void FolderListItem::setActive( bool o ) -{ - if (o) - setPixmap(0, QPixmap( folder_open_xpm ) ); - else - setPixmap(0, QPixmap( folder_closed_xpm ) ); - - setSelected(o); -} - -bool FolderListItem::isChildOf(FolderListItem *src) -{ - FolderListItem *parent = (FolderListItem *)this->parent(); - while (parent){ - if (parent == src) - return true; - - parent = (FolderListItem *)parent->parent(); - } - return false; -} - -/***************************************************************************** - * - * Class FolderListView - * - *****************************************************************************/ - -FolderListView::FolderListView( QWidget *parent, const char *name ) - : Q3ListView( parent, name ), mousePressed( false ) -{ - setAcceptDrops( true ); - viewport()->setAcceptDrops( true ); - - if (parent){ - connect(this, SIGNAL(collapsed(Q3ListViewItem *)), (ApplicationWindow *)parent, SLOT(modifiedProject())); - connect(this, SIGNAL(expanded(Q3ListViewItem *)), (ApplicationWindow *)parent, SLOT(modifiedProject())); - connect(this, SIGNAL(expanded(Q3ListViewItem *)), this, SLOT(expandedItem(Q3ListViewItem *))); - } -} - -void FolderListView::expandedItem(Q3ListViewItem *item) -{ - Q3ListViewItem *next = item->itemBelow(); - if (next) - setSelected (next, false); -} - -void FolderListView::startDrag() -{ -Q3ListViewItem *item = currentItem(); -if (!item) - return; - -if (item == firstChild() && item->listView()->rootIsDecorated()) - return;//it's the project folder so we don't want the user to move it - -QPoint orig = viewportToContents( viewport()->mapFromGlobal( QCursor::pos() ) ); - -QPixmap pix; -if (item->rtti() == FolderListItem::RTTI) - pix = QPixmap( folder_closed_xpm ); -else - pix = *item->pixmap (0); - -Q3IconDrag *drag = new Q3IconDrag(viewport()); -drag->setPixmap(pix, QPoint(pix.width()/2, pix.height()/2 ) ); - -QList lst; -for (item = firstChild(); item; item = item->itemBelow()) - { - if (item->isSelected()) - lst.append(item); - } - -emit dragItems(lst); -drag->drag(); -} - -void FolderListView::contentsDropEvent( QDropEvent *e ) -{ -Q3ListViewItem *dest = itemAt( contentsToViewport(e->pos()) ); -if ( dest && dest->rtti() == FolderListItem::RTTI) - { - emit dropItems(dest); - e->accept(); - } -else - e->ignore(); -} - -void FolderListView::keyPressEvent ( QKeyEvent * e ) -{ - if (isRenaming()){ - e->ignore(); - return; - } - - Q3ListViewItem *item = currentItem(); - if (!item) { - Q3ListView::keyPressEvent ( e ); - return; - } - - if (item->rtti() == FolderListItem::RTTI && - (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return)){ - emit doubleClicked(item); - e->accept(); - } else if (e->key() == Qt::Key_F2) { - if (item) - emit renameItem(item); - e->accept(); - } else if(e->key() == Qt::Key_A && e->state() == Qt::ControlModifier){ - selectAll(true); - e->accept(); - } else if(e->key() == Qt::Key_F7) { - emit addFolderItem(); - e->accept(); - } else if(e->key() == Qt::Key_F8){ - emit deleteSelection(); - e->accept(); - } else - Q3ListView::keyPressEvent ( e ); -} - -void FolderListView::contentsMouseDoubleClickEvent( QMouseEvent* e ) -{ - if (isRenaming()) - { - e->ignore(); - return; - } - - Q3ListView::contentsMouseDoubleClickEvent( e ); -} - -void FolderListView::contentsMousePressEvent( QMouseEvent* e ) -{ - Q3ListView::contentsMousePressEvent(e); - QPoint p( contentsToViewport( e->pos() ) ); - Q3ListViewItem *i = itemAt( p ); - if ( i ) - {// if the user clicked into the root decoration of the item, don't try to start a drag! - if ( p.x() > header()->cellPos( header()->mapToActual( 0 ) ) + - treeStepSize() * ( i->depth() + ( rootIsDecorated() ? 1 : 0) ) + itemMargin() || - p.x() < header()->cellPos( header()->mapToActual( 0 ) ) ) - { - presspos = e->pos(); - mousePressed = true; - } - } -} - -void FolderListView::contentsMouseMoveEvent( QMouseEvent* e ) -{ -if ( mousePressed && ( presspos - e->pos() ).manhattanLength() > QApplication::startDragDistance() ) - { - mousePressed = false; - Q3ListViewItem *item = itemAt( contentsToViewport(presspos) ); - if ( item ) - startDrag(); - } -} - -void FolderListView::adjustColumns() -{ -for (int i=0; i < columns (); i++) - adjustColumn(i); -} - -/***************************************************************************** - * - * Class WindowListItem - * - *****************************************************************************/ - -WindowListItem::WindowListItem( Q3ListView *parent, MdiSubWindow *w ) - : Q3ListViewItem( parent ) -{ - myWindow = w; - - setDragEnabled ( true ); -} === added file 'qtiplot/src/core/Folder.h' --- qtiplot/src/core/Folder.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/Folder.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,226 @@ +/*************************************************************************** + File : Folder.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Folder for the project explorer + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef FOLDER_H +#define FOLDER_H + +#include +#include +#include +#include + +#include "MdiSubWindow.h" + +class FolderListItem; +class Table; +class Matrix; +class MultiLayer; +class Note; +class Graph3D; + +class QDragEnterEvent; +class QDragMoveEvent; +class QDragLeaveEvent; +class QDropEvent; +class Q3DragObject; + +//! Folder for the project explorer +class Folder : public QObject +{ + Q_OBJECT + +public: + Folder( Folder *parent, const QString &name ); + + QList windowsList(){return lstWindows;}; + + void addWindow( MdiSubWindow *w ); + void removeWindow( MdiSubWindow *w ); + + //! The list of subfolder names, including first generation children only + QStringList subfolders(); + + //! The list of subfolders + QList folders(); + + //! Pointer to the subfolder called s + Folder* findSubfolder(const QString& s, bool caseSensitive = true, bool partialMatch = false); + + //! Pointer to the first window matching the search criteria + MdiSubWindow* findWindow(const QString& s, bool windowNames, bool labels, + bool caseSensitive, bool partialMatch); + + //! get a window by name + /** + * Returns the first window with given name that inherits class cls; + * NULL on failure. If recursive is true, do a depth-first recursive + * search. + */ + MdiSubWindow *window(const QString &name, const char *cls="MdiSubWindow", bool recursive=false); + //! Return table named name or NULL + Table *table(const QString &name, bool recursive=false) { return (Table*) window(name, "Table", recursive); } + //! Return matrix named name or NULL + Matrix *matrix(const QString &name, bool recursive=false) { return (Matrix*) window(name, "Matrix", recursive); } + //! Return graph named name or NULL + MultiLayer *graph(const QString &name, bool recursive=false) { return (MultiLayer*) window(name, "MultiLayer", recursive); } + //! Return note named name or NULL + Note *note(const QString &name, bool recursive=false) { return (Note*) window(name, "Note", recursive); } + //! Return plot 3D named name or NULL + Graph3D *plot3D(const QString &name, bool recursive=false) { return (Graph3D*) window(name, "Graph3D", recursive); } + + //! The complete path of the folder in the project tree + QString path(); + + //! The depth of the folder in the project tree + int depth(); + + Folder *folderBelow(); + + //! The root of the hierarchy this folder belongs to. + Folder* rootFolder(); + + //! Size of the folder as a string + QString sizeToString(); + + QString birthDate(){return birthdate;}; + void setBirthDate(const QString& s){birthdate = s;}; + + QString modificationDate(){return modifDate;}; + void setModificationDate(const QString& s){modifDate = s;}; + + //! Pointer to the corresponding QListViewItem in the main application + FolderListItem * folderListItem(){return myFolderListItem;}; + void setFolderListItem(FolderListItem *it){myFolderListItem = it;}; + + MdiSubWindow *activeWindow(){return d_active_window;}; + void setActiveWindow(MdiSubWindow *w){d_active_window = w;}; + + QString logInfo(){return d_log_info;}; + void appendLogInfo(const QString& text){d_log_info += text;}; + void clearLogInfo(){d_log_info = QString();}; + +protected: + QString birthdate, modifDate; + QString d_log_info; + QList lstWindows; + FolderListItem *myFolderListItem; + + //! Pointer to the active window in the folder + MdiSubWindow *d_active_window; +}; + +/***************************************************************************** + * + * Class WindowListItem + * + *****************************************************************************/ +//! Windows list item class +class WindowListItem : public Q3ListViewItem +{ +public: + WindowListItem( Q3ListView *parent, MdiSubWindow *w ); + + MdiSubWindow *window() { return myWindow; }; + +protected: + MdiSubWindow *myWindow; +}; + +/***************************************************************************** + * + * Class FolderListItem + * + *****************************************************************************/ +//! Folders list item class +class FolderListItem : public Q3ListViewItem +{ +public: + FolderListItem( Q3ListView *parent, Folder *f ); + FolderListItem( FolderListItem *parent, Folder *f ); + + enum {RTTI = 1001}; + + void setActive( bool o ); + + virtual int rtti() const {return (int)RTTI;}; + + Folder *folder() { return myFolder; }; + + //! Checks weather the folder item is a grandchild of the source folder + /** + * \param src source folder item + */ + bool isChildOf(FolderListItem *src); + +protected: + Folder *myFolder; +}; + +/***************************************************************************** + * + * Class FolderListView + * + *****************************************************************************/ +//! Folder list view class +class FolderListView : public Q3ListView +{ + Q_OBJECT + +public: + FolderListView( QWidget *parent = 0, const char *name = 0 ); + +public slots: + void adjustColumns(); + +protected slots: + void expandedItem(Q3ListViewItem *item); + +protected: + void startDrag(); + + void contentsDropEvent( QDropEvent *e ); + void contentsMouseMoveEvent( QMouseEvent *e ); + void contentsMousePressEvent( QMouseEvent *e ); + void contentsMouseDoubleClickEvent( QMouseEvent* e ); + void keyPressEvent ( QKeyEvent * e ); + void contentsMouseReleaseEvent( QMouseEvent *){mousePressed = false;}; + void enterEvent(QEvent *){mousePressed = false;}; + +signals: + void dragItems(QList items); + void dropItems(Q3ListViewItem *dest); + void renameItem(Q3ListViewItem *item); + void addFolderItem(); + void deleteSelection(); + +private: + bool mousePressed; + QPoint presspos; +}; + +#endif === removed file 'qtiplot/src/core/Folder.h' --- qtiplot/src/core/Folder.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/Folder.h 1970-01-01 00:00:00 +0000 @@ -1,226 +0,0 @@ -/*************************************************************************** - File : Folder.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Folder for the project explorer - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef FOLDER_H -#define FOLDER_H - -#include -#include -#include -#include - -#include "MdiSubWindow.h" - -class FolderListItem; -class Table; -class Matrix; -class MultiLayer; -class Note; -class Graph3D; - -class QDragEnterEvent; -class QDragMoveEvent; -class QDragLeaveEvent; -class QDropEvent; -class Q3DragObject; - -//! Folder for the project explorer -class Folder : public QObject -{ - Q_OBJECT - -public: - Folder( Folder *parent, const QString &name ); - - QList windowsList(){return lstWindows;}; - - void addWindow( MdiSubWindow *w ); - void removeWindow( MdiSubWindow *w ); - - //! The list of subfolder names, including first generation children only - QStringList subfolders(); - - //! The list of subfolders - QList folders(); - - //! Pointer to the subfolder called s - Folder* findSubfolder(const QString& s, bool caseSensitive = true, bool partialMatch = false); - - //! Pointer to the first window matching the search criteria - MdiSubWindow* findWindow(const QString& s, bool windowNames, bool labels, - bool caseSensitive, bool partialMatch); - - //! get a window by name - /** - * Returns the first window with given name that inherits class cls; - * NULL on failure. If recursive is true, do a depth-first recursive - * search. - */ - MdiSubWindow *window(const QString &name, const char *cls="MdiSubWindow", bool recursive=false); - //! Return table named name or NULL - Table *table(const QString &name, bool recursive=false) { return (Table*) window(name, "Table", recursive); } - //! Return matrix named name or NULL - Matrix *matrix(const QString &name, bool recursive=false) { return (Matrix*) window(name, "Matrix", recursive); } - //! Return graph named name or NULL - MultiLayer *graph(const QString &name, bool recursive=false) { return (MultiLayer*) window(name, "MultiLayer", recursive); } - //! Return note named name or NULL - Note *note(const QString &name, bool recursive=false) { return (Note*) window(name, "Note", recursive); } - //! Return plot 3D named name or NULL - Graph3D *plot3D(const QString &name, bool recursive=false) { return (Graph3D*) window(name, "Graph3D", recursive); } - - //! The complete path of the folder in the project tree - QString path(); - - //! The depth of the folder in the project tree - int depth(); - - Folder *folderBelow(); - - //! The root of the hierarchy this folder belongs to. - Folder* rootFolder(); - - //! Size of the folder as a string - QString sizeToString(); - - QString birthDate(){return birthdate;}; - void setBirthDate(const QString& s){birthdate = s;}; - - QString modificationDate(){return modifDate;}; - void setModificationDate(const QString& s){modifDate = s;}; - - //! Pointer to the corresponding QListViewItem in the main application - FolderListItem * folderListItem(){return myFolderListItem;}; - void setFolderListItem(FolderListItem *it){myFolderListItem = it;}; - - MdiSubWindow *activeWindow(){return d_active_window;}; - void setActiveWindow(MdiSubWindow *w){d_active_window = w;}; - - QString logInfo(){return d_log_info;}; - void appendLogInfo(const QString& text){d_log_info += text;}; - void clearLogInfo(){d_log_info = QString();}; - -protected: - QString birthdate, modifDate; - QString d_log_info; - QList lstWindows; - FolderListItem *myFolderListItem; - - //! Pointer to the active window in the folder - MdiSubWindow *d_active_window; -}; - -/***************************************************************************** - * - * Class WindowListItem - * - *****************************************************************************/ -//! Windows list item class -class WindowListItem : public Q3ListViewItem -{ -public: - WindowListItem( Q3ListView *parent, MdiSubWindow *w ); - - MdiSubWindow *window() { return myWindow; }; - -protected: - MdiSubWindow *myWindow; -}; - -/***************************************************************************** - * - * Class FolderListItem - * - *****************************************************************************/ -//! Folders list item class -class FolderListItem : public Q3ListViewItem -{ -public: - FolderListItem( Q3ListView *parent, Folder *f ); - FolderListItem( FolderListItem *parent, Folder *f ); - - enum {RTTI = 1001}; - - void setActive( bool o ); - - virtual int rtti() const {return (int)RTTI;}; - - Folder *folder() { return myFolder; }; - - //! Checks weather the folder item is a grandchild of the source folder - /** - * \param src source folder item - */ - bool isChildOf(FolderListItem *src); - -protected: - Folder *myFolder; -}; - -/***************************************************************************** - * - * Class FolderListView - * - *****************************************************************************/ -//! Folder list view class -class FolderListView : public Q3ListView -{ - Q_OBJECT - -public: - FolderListView( QWidget *parent = 0, const char *name = 0 ); - -public slots: - void adjustColumns(); - -protected slots: - void expandedItem(Q3ListViewItem *item); - -protected: - void startDrag(); - - void contentsDropEvent( QDropEvent *e ); - void contentsMouseMoveEvent( QMouseEvent *e ); - void contentsMousePressEvent( QMouseEvent *e ); - void contentsMouseDoubleClickEvent( QMouseEvent* e ); - void keyPressEvent ( QKeyEvent * e ); - void contentsMouseReleaseEvent( QMouseEvent *){mousePressed = false;}; - void enterEvent(QEvent *){mousePressed = false;}; - -signals: - void dragItems(QList items); - void dropItems(Q3ListViewItem *dest); - void renameItem(Q3ListViewItem *item); - void addFolderItem(); - void deleteSelection(); - -private: - bool mousePressed; - QPoint presspos; -}; - -#endif === added file 'qtiplot/src/core/ImportASCIIDialog.cpp' --- qtiplot/src/core/ImportASCIIDialog.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/ImportASCIIDialog.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,875 @@ +/*************************************************************************** + File : ImportASCIIDialog.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2004 - 2010 by Ion Vasilief, + (C) 2006 - June 2007 by Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de + Description : Import ASCII file(s) dialog + + ***************************************************************************/ + + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + +#include "ImportASCIIDialog.h" +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +ImportASCIIDialog::ImportASCIIDialog(bool new_windows_only, QWidget * parent, bool extended, Qt::WFlags flags ) +: ExtensibleFileDialog(parent, extended, flags ) +{ + setWindowTitle(tr("QtiPlot - Import ASCII File(s)")); + setFileMode( QFileDialog::ExistingFiles ); + + d_current_path = QString::null; + + initAdvancedOptions(); + setNewWindowsOnly(new_windows_only); + setExtensionWidget(d_advanced_options); + + // get rembered option values + ApplicationWindow *app = (ApplicationWindow *)parent; + setLocale(app->locale()); + + d_strip_spaces->setChecked(app->strip_spaces); + d_simplify_spaces->setChecked(app->simplify_spaces); + d_ignored_lines->setValue(app->ignoredLines); + d_rename_columns->setChecked(app->renameColumns); + setColumnSeparator(app->columnSeparator); + d_comment_string->setText(app->d_ASCII_comment_string); + d_import_comments->setChecked(app->d_ASCII_import_comments); + d_first_line_role->setCurrentIndex(app->d_ASCII_import_first_row_role); + d_read_only->setChecked(app->d_ASCII_import_read_only); + + if (app->d_ASCII_import_locale.name() == QLocale::c().name()) + boxDecimalSeparator->setCurrentIndex(1); + else if (app->d_ASCII_import_locale.name() == QLocale(QLocale::German).name()) + boxDecimalSeparator->setCurrentIndex(2); + else if (app->d_ASCII_import_locale.name() == QLocale(QLocale::French).name()) + boxDecimalSeparator->setCurrentIndex(3); + + QLocale::NumberOptions groupSep = app->d_ASCII_import_locale.numberOptions(); + d_omit_thousands_sep->setChecked(groupSep & QLocale::OmitGroupSeparator); + + connect(d_import_mode, SIGNAL(currentIndexChanged(int)), this, SLOT(updateImportMode(int))); + if (app->d_ASCII_import_mode < d_import_mode->count()) + d_import_mode->setCurrentIndex(app->d_ASCII_import_mode); + + d_preview_lines_box->setValue(app->d_preview_lines); + d_preview_button->setChecked(app->d_ASCII_import_preview); + + boxEndLine->setCurrentIndex((int)app->d_ASCII_end_line); + + if (!app->d_ASCII_import_preview) + d_preview_stack->hide(); + + initPreview(d_import_mode->currentIndex()); + + connect(d_preview_lines_box, SIGNAL(valueChanged(int)), this, SLOT(preview())); + connect(d_rename_columns, SIGNAL(clicked()), this, SLOT(preview())); + connect(d_import_comments, SIGNAL(clicked()), this, SLOT(preview())); + connect(d_strip_spaces, SIGNAL(clicked()), this, SLOT(preview())); + connect(d_simplify_spaces, SIGNAL(clicked()), this, SLOT(preview())); + connect(d_ignored_lines, SIGNAL(valueChanged(int)), this, SLOT(preview())); + connect(d_omit_thousands_sep, SIGNAL(clicked()), this, SLOT(preview())); + connect(d_column_separator, SIGNAL(currentIndexChanged(int)), this, SLOT(preview())); + connect(boxDecimalSeparator, SIGNAL(currentIndexChanged(int)), this, SLOT(preview())); + connect(d_comment_string, SIGNAL(textChanged(const QString&)), this, SLOT(preview())); + connect(this, SIGNAL(currentChanged(const QString&)), this, SLOT(changePreviewFile(const QString&))); +} + +void ImportASCIIDialog::initAdvancedOptions() +{ + d_advanced_options = new QGroupBox(); + QVBoxLayout *main_layout = new QVBoxLayout(d_advanced_options); + QGridLayout *advanced_layout = new QGridLayout(); + main_layout->addLayout(advanced_layout); + + advanced_layout->addWidget(new QLabel(tr("Import each file as: ")), 0, 0); + d_import_mode = new QComboBox(); + d_import_mode->addItem(tr("New Table")); + d_import_mode->addItem(tr("New Matrix")); + d_import_mode->addItem(tr("New Columns")); + d_import_mode->addItem(tr("New Rows")); + d_import_mode->addItem(tr("Overwrite Current Window")); + advanced_layout->addWidget(d_import_mode, 0, 1); + + QLabel *label_column_separator = new QLabel(tr("Separator:")); + advanced_layout->addWidget(label_column_separator, 1, 0); + d_column_separator = new QComboBox(); + d_column_separator->addItem(tr("TAB")); + d_column_separator->addItem(tr("SPACE")); + d_column_separator->addItem(";" + tr("TAB")); + d_column_separator->addItem("," + tr("TAB")); + d_column_separator->addItem(";" + tr("SPACE")); + d_column_separator->addItem("," + tr("SPACE")); + d_column_separator->addItem(";"); + d_column_separator->addItem(","); + d_column_separator->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + d_column_separator->setEditable( true ); + advanced_layout->addWidget(d_column_separator, 1, 1); + // context-sensitive help + QString help_column_separator = tr("The column separator can be customized. \nThe following special codes can be used:\n\\t for a TAB character \n\\s for a SPACE"); + help_column_separator += "\n"+tr("The separator must not contain the following characters: \n0-9eE.+-"); + d_column_separator->setWhatsThis(help_column_separator); + label_column_separator->setToolTip(help_column_separator); + d_column_separator->setToolTip(help_column_separator); + label_column_separator->setWhatsThis(help_column_separator); + + QLabel *label_ignore_lines = new QLabel(tr( "Ignore first" )); + advanced_layout->addWidget(label_ignore_lines, 2, 0); + d_ignored_lines = new QSpinBox(); + d_ignored_lines->setRange( 0, 10000 ); + d_ignored_lines->setSuffix(" " + tr("lines")); + d_ignored_lines->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + advanced_layout->addWidget(d_ignored_lines, 2, 1); + + advanced_layout->addWidget(new QLabel(tr("Ignore lines starting with")), 3, 0); + d_comment_string = new QLineEdit(); + advanced_layout->addWidget(d_comment_string, 3, 1); + + QHBoxLayout *renameBox = new QHBoxLayout; + d_rename_columns = new QCheckBox(tr("Use first row &as")); + connect(d_rename_columns, SIGNAL(toggled(bool)), this, SLOT(enableComments())); + renameBox->addWidget(d_rename_columns); + + d_first_line_role = new QComboBox(); + d_first_line_role->addItem(tr("Column Names")); + d_first_line_role->addItem(tr("Column Comments")); + connect(d_first_line_role, SIGNAL(activated(int)), this, SLOT(enableComments())); + connect(d_first_line_role, SIGNAL(activated(int)), this, SLOT(preview())); + renameBox->addWidget(d_first_line_role); + advanced_layout->addLayout(renameBox, 0, 2, 1, 2); + + d_import_comments = new QCheckBox(tr("Use second row as &comments")); + advanced_layout->addWidget(d_import_comments, 1, 2, 1, 2); + + d_strip_spaces = new QCheckBox(tr("&Remove white spaces from line ends")); + advanced_layout->addWidget(d_strip_spaces, 2, 2, 1, 2); + // context-sensitive help + QString help_strip_spaces = tr("By checking this option all white spaces will be \nremoved from the beginning and the end of \nthe lines in the ASCII file.","when translating this check the what's this functions and tool tips to place the '\\n's correctly"); + help_strip_spaces +="\n\n"+tr("Warning: checking this option leads to column \noverlaping if the columns in the ASCII file don't \nhave the same number of rows."); + help_strip_spaces +="\n"+tr("To avoid this problem you should precisely \ndefine the column separator using TAB and \nSPACE characters.","when translating this check the what's this functions and tool tips to place the '\\n's correctly"); + d_strip_spaces->setWhatsThis(help_strip_spaces); + d_strip_spaces->setToolTip(help_strip_spaces); + + d_simplify_spaces = new QCheckBox(tr("&Simplify white spaces" )); + advanced_layout->addWidget(d_simplify_spaces, 3, 2, 1, 2); + // context-sensitive help + QString help_simplify_spaces = tr("By checking this option all white spaces will be \nremoved from the beginning and the end of the \nlines and each sequence of internal \nwhitespaces (including the TAB character) will \nbe replaced with a single space.","when translating this check the what's this functions and tool tips to place the '\\n's correctly"); + help_simplify_spaces +="\n\n"+tr("Warning: checking this option leads to column \noverlaping if the columns in the ASCII file don't \nhave the same number of rows.","when translating this check the what's this functions and tool tips to place the '\\n's correctly"); + help_simplify_spaces +="\n"+tr("To avoid this problem you should precisely \ndefine the column separator using TAB and \nSPACE characters.","when translating this check the what's this functions and tool tips to place the '\\n's correctly"); + d_simplify_spaces->setWhatsThis(help_simplify_spaces); + d_simplify_spaces->setToolTip(help_simplify_spaces); + + advanced_layout->addWidget(new QLabel(tr("Decimal Separators")), 4, 0); + boxDecimalSeparator = new QComboBox(); + boxDecimalSeparator->addItem(tr("System Locale Setting")); + boxDecimalSeparator->addItem("1,000.0"); + boxDecimalSeparator->addItem("1.000,0"); + boxDecimalSeparator->addItem("1 000,0"); + advanced_layout->addWidget(boxDecimalSeparator, 4, 1); + + d_omit_thousands_sep = new QCheckBox(tr("Omit &thousands separator")); + advanced_layout->addWidget(d_omit_thousands_sep, 4, 2, 1, 2); + + advanced_layout->addWidget(new QLabel(tr("Endline character")), 5, 0); + boxEndLine = new QComboBox(); + boxEndLine->addItem(tr("LF (Unix)")); + boxEndLine->addItem(tr("CRLF (Windows)")); + boxEndLine->addItem(tr("CR (Mac)")); + connect(boxEndLine, SIGNAL(activated(int)), this, SLOT(preview())); + advanced_layout->addWidget(boxEndLine, 5, 1); + + d_read_only = new QCheckBox(tr("Import as &read-only")); + advanced_layout->addWidget(d_read_only, 5, 2); + + d_preview_button = new QCheckBox(tr("&Preview Lines")); + connect(d_preview_button, SIGNAL(clicked()), this, SLOT(preview())); + advanced_layout->addWidget(d_preview_button, 6, 0); + + d_preview_lines_box = new QSpinBox(); + d_preview_lines_box->setMaximum (INT_MAX); + d_preview_lines_box->setValue(100); + d_preview_lines_box->setSingleStep(10); + d_preview_lines_box->setSpecialValueText(tr("All")); + advanced_layout->addWidget(d_preview_lines_box, 6, 1); + + d_help_button = new QPushButton(tr("&Help")); + connect(d_help_button, SIGNAL(clicked()), this, SLOT(displayHelp())); + advanced_layout->addWidget(d_help_button, 6, 2); + + d_preview_table = NULL; + d_preview_matrix = NULL; + d_preview_stack = new QStackedWidget(); + main_layout->addWidget(d_preview_stack); +} + +void ImportASCIIDialog::initPreview(int previewMode) +{ + if (previewMode < NewTables || previewMode > Overwrite) + return; + + ApplicationWindow *app = (ApplicationWindow *)parent(); + if (!app) + return; + + if (d_preview_table){ + delete d_preview_table; + d_preview_table = NULL; + } + + if (d_preview_matrix){ + delete d_preview_matrix; + d_preview_matrix = NULL; + } + + switch(previewMode){ + case NewTables: + d_preview_table = new PreviewTable(30, 2, this); + d_preview_table->setNumericPrecision(app->d_decimal_digits); + d_preview_stack->addWidget(d_preview_table); + connect(d_preview_table, SIGNAL(modifiedColumnType()), this, SLOT(preview())); + enableTableOptions(true); + break; + + case NewMatrices: + d_preview_matrix = new PreviewMatrix(app); + d_preview_stack->addWidget(d_preview_matrix); + enableTableOptions(false); + break; + + case NewColumns: + case NewRows: + case Overwrite: + MdiSubWindow *w = app->activeWindow(); + if (!w) + return; + + if (w->inherits("Table")){ + d_preview_table = new PreviewTable(30, ((Table*)w)->numCols(), this); + d_preview_table->setNumericPrecision(app->d_decimal_digits); + d_preview_stack->addWidget(d_preview_table); + connect(d_preview_table, SIGNAL(modifiedColumnType()), this, SLOT(preview())); + enableTableOptions(true); + } else if (w->isA("Matrix")){ + d_preview_matrix = new PreviewMatrix(app, (Matrix *)w); + d_preview_stack->addWidget(d_preview_matrix); + enableTableOptions(false); + } + break; + } + preview(); +} + +void ImportASCIIDialog::enableTableOptions(bool on) +{ + d_rename_columns->setEnabled(on); + d_import_comments->setEnabled(on && d_rename_columns->isChecked()); + d_read_only->setEnabled(on); +} + +void ImportASCIIDialog::setColumnSeparator(const QString& sep) +{ + if (sep=="\t") + d_column_separator->setCurrentIndex(0); + else if (sep==" ") + d_column_separator->setCurrentIndex(1); + else if (sep==";\t") + d_column_separator->setCurrentIndex(2); + else if (sep==",\t") + d_column_separator->setCurrentIndex(3); + else if (sep=="; ") + d_column_separator->setCurrentIndex(4); + else if (sep==", ") + d_column_separator->setCurrentIndex(5); + else if (sep==";") + d_column_separator->setCurrentIndex(6); + else if (sep==",") + d_column_separator->setCurrentIndex(7); + else { + QString separator = sep; + d_column_separator->setEditText(separator.replace(" ","\\s").replace("\t","\\t")); + } +} + +const QString ImportASCIIDialog::columnSeparator() const +{ + QString sep = d_column_separator->currentText(); + + if (d_simplify_spaces->isChecked()) + sep.replace(tr("TAB"), " ", Qt::CaseInsensitive); + else + sep.replace(tr("TAB"), "\t", Qt::CaseInsensitive); + + sep.replace(tr("SPACE"), " ", Qt::CaseInsensitive); + sep.replace("\\s", " "); + sep.replace("\\t", "\t"); + + /* TODO + if (sep.contains(QRegExp("[0-9.eE+-]"))) + QMessageBox::warning(this, tr("QtiPlot - Import options error"), + tr("The separator must not contain the following characters: 0-9eE.+-")); + */ + + return sep; +} + +void ImportASCIIDialog::displayHelp() +{ + QString s = tr("The column separator can be customized. The following special codes can be used:\n\\t for a TAB character \n\\s for a SPACE"); + s += "\n"+tr("The separator must not contain the following characters: 0-9eE.+-") + "\n\n"; + s += tr( "Remove white spaces from line ends" )+ ":\n"; + s += tr("By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file.") + "\n\n"; + s += tr( "Simplify white spaces" )+ ":\n"; + s += tr("By checking this option each sequence of internal whitespaces (including the TAB character) will be replaced with a single space."); + s += tr("By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal whitespaces (including the TAB character) will be replaced with a single space."); + + s +="\n\n"+tr("Warning: using these two last options leads to column overlaping if the columns in the ASCII file don't have the same number of rows."); + s +="\n"+tr("To avoid this problem you should precisely define the column separator using TAB and SPACE characters."); + + QMessageBox::about(this, tr("QtiPlot - Help"), s); +} + +void ImportASCIIDialog::updateImportMode(int mode) +{ + setUpdatesEnabled(false); + + if (mode == Overwrite) + setFileMode( QFileDialog::ExistingFile ); + else + setFileMode( QFileDialog::ExistingFiles ); + + initPreview(mode); + + setUpdatesEnabled(true); + repaint(); +} + +void ImportASCIIDialog::closeEvent(QCloseEvent* e) +{ + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + if (app){ + app->d_extended_import_ASCII_dialog = this->isExtended(); + app->d_ASCII_file_filter = this->selectedFilter(); + app->d_ASCII_import_preview = d_preview_button->isChecked(); + app->d_preview_lines = d_preview_lines_box->value(); + app->d_ASCII_import_first_row_role = d_first_line_role->currentIndex(); + app->d_import_ASCII_dialog_size = size(); + } + + e->accept(); +} + +QLocale ImportASCIIDialog::decimalSeparators() +{ + QLocale locale; + switch (boxDecimalSeparator->currentIndex()){ + case 0: + locale = QLocale::system(); + break; + case 1: + locale = QLocale::c(); + break; + case 2: + locale = QLocale(QLocale::German); + break; + case 3: + locale = QLocale(QLocale::French); + break; + } + + if (d_omit_thousands_sep->isChecked()) + locale.setNumberOptions(QLocale::OmitGroupSeparator); + + return locale; +} + +void ImportASCIIDialog::preview() +{ + if (!d_preview_button->isChecked()){ + d_preview_stack->hide(); + return; + } else + d_preview_stack->show(); + + if (d_preview_table) + previewTable(); + else if (d_preview_matrix) + previewMatrix(); +} + +void ImportASCIIDialog::previewTable() +{ + if (!d_preview_table) + return; + + if (!d_preview_table->isVisible()) + d_preview_table->show(); + + if (d_current_path.trimmed().isEmpty()){ + d_preview_table->clear(); + d_preview_table->resetHeader(); + return; + } + + int importMode = d_import_mode->currentIndex(); + if (importMode == NewTables) + importMode = Table::Overwrite; + else + importMode -= 2; + + d_preview_table->resetHeader(); + + d_preview_table->importASCII(d_current_path, columnSeparator(), d_ignored_lines->value(), + renameColumns(), d_strip_spaces->isChecked(), + d_simplify_spaces->isChecked(), importComments(), + d_comment_string->text(), (Table::ImportMode)importMode, decimalSeparators(), + boxEndLine->currentIndex(), d_preview_lines_box->value()); + + if (!d_preview_table->isVisible()) + d_preview_table->show(); +} + +void ImportASCIIDialog::previewMatrix() +{ + if (!d_preview_matrix) + return; + + if (d_current_path.trimmed().isEmpty()){ + d_preview_matrix->clear(); + return; + } + + int importMode = d_import_mode->currentIndex(); + if (importMode == NewMatrices) + importMode = Matrix::Overwrite; + else + importMode -= 2; + + d_preview_matrix->importASCII(d_current_path, columnSeparator(), d_ignored_lines->value(), + d_strip_spaces->isChecked(), d_simplify_spaces->isChecked(), + d_comment_string->text(), importMode, decimalSeparators(), + boxEndLine->currentIndex(), d_preview_lines_box->value()); + d_preview_matrix->resizeColumnsToContents(); +} + +void ImportASCIIDialog::changePreviewFile(const QString& path) +{ + if (path.isEmpty()) + return; + + if (d_current_path.isEmpty()){//avoid importing the first file which is by default selected in the file dialog + d_current_path = path; + return; + } + + QFileInfo fi(path); + if (!fi.exists() || fi.isDir() || !fi.isFile()) + return; + + if (!fi.isReadable()){ + QMessageBox::critical(this, tr("QtiPlot - File openning error"), + tr("You don't have the permission to open this file: %1").arg(path)); + return; + } + + d_current_path = path; + preview(); +} + +void ImportASCIIDialog::setNewWindowsOnly(bool on) +{ + if (on){ + d_import_mode->clear(); + d_import_mode->addItem(tr("New Table")); + d_import_mode->addItem(tr("New Matrice")); + } + + d_preview_button->setChecked(false); +} + +bool ImportASCIIDialog::importComments() +{ + if (!d_rename_columns->isChecked()) + return false; + + return (d_first_line_role->currentIndex() == 1) || + (d_import_comments->isChecked() && d_import_comments->isEnabled()); + +} + +void ImportASCIIDialog::enableComments() +{ + d_import_comments->setEnabled(d_rename_columns->isChecked() && + !d_first_line_role->currentIndex()); +} + +void ImportASCIIDialog::selectFilter(const QString & filter) +{ + QStringList filters; + filters << tr("All files") + " (*)"; + filters << tr("Text files") + " (*.TXT *.txt)"; + filters << tr("Data files") + " (*.DAT *.dat)"; + filters << tr("Comma Separated Values") + " (*.CSV *.csv)"; + + if (!filters.contains(filter)) + filters << filter; + + setFilters(filters); + setEditableFilter(); + + QFileDialog::selectFilter(filter); +} + +/***************************************************************************** + * + * Class PreviewTable + * + *****************************************************************************/ + +PreviewTable::PreviewTable(int numRows, int numCols, QWidget * parent, const char * name) +:Q3Table(numRows, numCols, parent, name) +{ + setAttribute(Qt::WA_DeleteOnClose); + setSelectionMode(Q3Table::NoSelection); + setReadOnly(true); + setRowMovingEnabled(false); + setColumnMovingEnabled(false); + verticalHeader()->setResizeEnabled(false); + horizontalHeader()->installEventFilter(this); + horizontalHeader()->setResizeEnabled(true); + horizontalHeader()->setMovingEnabled (false); + + for (int i = 0; i < numCols; i++){ + comments << ""; + col_label << QString::number(i + 1); + colTypes << Table::Numeric; + } + + d_start_col = numCols; + setHeader(); + setMinimumHeight(2*horizontalHeader()->height()); + connect(horizontalHeader(), SIGNAL(sizeChange(int, int, int)), this, SLOT(setHeader())); +} + +void PreviewTable::importASCII(const QString &fname, const QString &sep, int ignoredLines, bool renameCols, + bool stripSpaces, bool simplifySpaces, bool importComments, const QString& commentString, + int importMode, const QLocale& importLocale, int endLine, int maxRows) +{ + int rows; + QString name = MdiSubWindow::parseAsciiFile(fname, commentString, endLine, ignoredLines, maxRows, rows); + if (name.isEmpty()) + return; + + QFile f(name); + if (!f.open(QIODevice::ReadOnly)) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QLocale locale = this->locale(); + bool updateDecimalSeparators = (importLocale != locale) ? true : false; + + QTextStream t(&f); + QString s = t.readLine();//read first line + if (simplifySpaces) + s = s.simplifyWhiteSpace(); + else if (stripSpaces) + s = s.stripWhiteSpace(); + + QStringList line = s.split(sep); + int cols = line.size(); + + bool allNumbers = true; + for (int i=0; iprocessEvents(QEventLoop::ExcludeUserInput); + } + + if ((!renameCols || allNumbers)&& !importComments && rows > 0){ + //put values in the first line of the table + for (int i = 0; i cols) { + addColumns(lc - cols); + cols = lc; + } + for (int j = 0; j < cols && j < lc; j++){ + bool ok; + double val = importLocale.toDouble(line[j], &ok); + if (colTypes[j] == Table::Numeric && ok && updateDecimalSeparators) + setText(row, startCol + j, locale.toString(val, 'g', d_numeric_precision)); + else + setText(row, startCol + j, line[j]); + } + + row++; + qApp->processEvents(QEventLoop::ExcludeUserInput); + } + blockSignals(false); + f.remove(); +} + +void PreviewTable::resetHeader() +{ + for (int i=0; ifontMetrics().boundingRect("_").width(); + head->setLabel(i, s.remove("\n") + "\n" + QString(lines, '_') + "\n" + comments[i]); + } +} + +void PreviewTable::addColumns(int c) +{ + int max=0, cols = numCols(); + for (int i=0; imax) + max=index; + } + } + max++; + insertColumns(cols, c); + for (int i = 0; i < c; i++){ + comments << QString(); + col_label << QString::number(max+i); + colTypes << Table::Numeric; + } +} + +bool PreviewTable::eventFilter(QObject *object, QEvent *e) +{ + Q3Header *hheader = horizontalHeader(); + if (e->type() == QEvent::MouseButtonPress && object == (QObject*)hheader) { + const QMouseEvent *me = (const QMouseEvent *)e; + clearSelection(); + int col = hheader->sectionAt (me->pos().x() + hheader->offset()); + if (col >= 0 && col < numCols()){ + QRect rect = hheader->sectionRect(col); + rect.setLeft(rect.left() + 2); + rect.setRight(rect.right() - 2); + if (rect.contains (me->pos())){ + selectColumn(col); + d_selected_column = col; + showColTypeDialog(); + return true; + } + } + } + return Q3Table::eventFilter(object, e); +} + +void PreviewTable::showColTypeDialog() +{ + QStringList items; + items << tr("Numeric") << tr("Text") << tr("Date") << tr("Time") << tr("Month") << tr("Day"); + + bool ok; + QString item = QInputDialog::getItem(this, tr("Choose column type"), tr("Column type:"), items, colTypes[d_selected_column], false, &ok); + if (ok && !item.isEmpty()){ + colTypes[d_selected_column] = (Table::ColType)items.indexOf(item); + modifiedColumnType(); + } +} +/***************************************************************************** + * + * Class PreviewMatrix + * + *****************************************************************************/ + +PreviewMatrix::PreviewMatrix(QWidget *parent, Matrix * m):QTableView(parent) +{ + d_matrix_model = new MatrixModel(32, 32, m); + if (!m){ + ApplicationWindow *app = (ApplicationWindow *)parent; + if (app){ + d_matrix_model->setLocale(app->locale()); + d_matrix_model->setNumericFormat('f', app->d_decimal_digits); + } + } + setModel(d_matrix_model); + + setAttribute(Qt::WA_DeleteOnClose); + setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); + setSelectionMode(QAbstractItemView::NoSelection); + setEditTriggers(QAbstractItemView::NoEditTriggers); + setFocusPolicy(Qt::NoFocus); + + QPalette pal = palette(); + pal.setColor(QColorGroup::Base, QColor(255, 255, 128)); + setPalette(pal); + + // set header properties + horizontalHeader()->setMovable(false); + horizontalHeader()->setResizeMode(QHeaderView::Fixed); + for(int i=0; icolumnCount(); i++) + setColumnWidth(i, 100); + + verticalHeader()->setMovable(false); + verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); + + setMinimumHeight(4*horizontalHeader()->height()); +} + +void PreviewMatrix::importASCII(const QString &fname, const QString &sep, int ignoredLines, + bool stripSpaces, bool simplifySpaces, const QString& commentString, + int importAs, const QLocale& locale, int endLine, int maxRows) +{ + d_matrix_model->importASCII(fname, sep, ignoredLines, stripSpaces, + simplifySpaces, commentString, importAs, locale, endLine, maxRows); +} + +void PreviewMatrix::clear() +{ + d_matrix_model->clear(); + reset(); +} === removed file 'qtiplot/src/core/ImportASCIIDialog.cpp' --- qtiplot/src/core/ImportASCIIDialog.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/ImportASCIIDialog.cpp 1970-01-01 00:00:00 +0000 @@ -1,811 +0,0 @@ -/*************************************************************************** - File : ImportASCIIDialog.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006,2007 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de - Description : Import ASCII file(s) dialog - - ***************************************************************************/ - - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#include "ImportASCIIDialog.h" -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -ImportASCIIDialog::ImportASCIIDialog(bool new_windows_only, QWidget * parent, bool extended, Qt::WFlags flags ) -: ExtensibleFileDialog(parent, extended, flags ) -{ - setWindowTitle(tr("QtiPlot - Import ASCII File(s)")); - - QStringList filters; - filters << tr("All files") + " (*)"; - filters << tr("Text files") + " (*.TXT *.txt)"; - filters << tr("Data files") + " (*.DAT *.dat)"; - filters << tr("Comma Separated Values") + " (*.CSV *.csv)"; - setFilters( filters ); - - setFileMode( QFileDialog::ExistingFiles ); - - d_current_path = QString::null; - - initAdvancedOptions(); - setNewWindowsOnly(new_windows_only); - setExtensionWidget(d_advanced_options); - - // get rembered option values - ApplicationWindow *app = (ApplicationWindow *)parent; - setLocale(app->locale()); - - d_strip_spaces->setChecked(app->strip_spaces); - d_simplify_spaces->setChecked(app->simplify_spaces); - d_ignored_lines->setValue(app->ignoredLines); - d_rename_columns->setChecked(app->renameColumns); - setColumnSeparator(app->columnSeparator); - d_comment_string->setText(app->d_ASCII_comment_string); - d_import_comments->setChecked(app->d_ASCII_import_comments); - d_first_line_role->setCurrentIndex(app->d_ASCII_import_first_row_role); - d_read_only->setChecked(app->d_ASCII_import_read_only); - - if (app->d_ASCII_import_locale.name() == QLocale::c().name()) - boxDecimalSeparator->setCurrentIndex(1); - else if (app->d_ASCII_import_locale.name() == QLocale(QLocale::German).name()) - boxDecimalSeparator->setCurrentIndex(2); - else if (app->d_ASCII_import_locale.name() == QLocale(QLocale::French).name()) - boxDecimalSeparator->setCurrentIndex(3); - - QLocale::NumberOptions groupSep = app->d_ASCII_import_locale.numberOptions(); - d_omit_thousands_sep->setChecked(groupSep & QLocale::OmitGroupSeparator); - - connect(d_import_mode, SIGNAL(currentIndexChanged(int)), this, SLOT(updateImportMode(int))); - if (app->d_ASCII_import_mode < d_import_mode->count()) - d_import_mode->setCurrentIndex(app->d_ASCII_import_mode); - - d_preview_lines_box->setValue(app->d_preview_lines); - d_preview_button->setChecked(app->d_ASCII_import_preview); - - boxEndLine->setCurrentIndex((int)app->d_ASCII_end_line); - - if (!app->d_ASCII_import_preview) - d_preview_stack->hide(); - - initPreview(d_import_mode->currentIndex()); - - connect(d_preview_lines_box, SIGNAL(valueChanged(int)), this, SLOT(preview())); - connect(d_rename_columns, SIGNAL(clicked()), this, SLOT(preview())); - connect(d_import_comments, SIGNAL(clicked()), this, SLOT(preview())); - connect(d_strip_spaces, SIGNAL(clicked()), this, SLOT(preview())); - connect(d_simplify_spaces, SIGNAL(clicked()), this, SLOT(preview())); - connect(d_ignored_lines, SIGNAL(valueChanged(int)), this, SLOT(preview())); - connect(d_omit_thousands_sep, SIGNAL(clicked()), this, SLOT(preview())); - connect(d_column_separator, SIGNAL(currentIndexChanged(int)), this, SLOT(preview())); - connect(boxDecimalSeparator, SIGNAL(currentIndexChanged(int)), this, SLOT(preview())); - connect(d_comment_string, SIGNAL(textChanged(const QString&)), this, SLOT(preview())); - connect(this, SIGNAL(currentChanged(const QString&)), this, SLOT(changePreviewFile(const QString&))); -} - -void ImportASCIIDialog::initAdvancedOptions() -{ - d_advanced_options = new QGroupBox(); - QVBoxLayout *main_layout = new QVBoxLayout(d_advanced_options); - QGridLayout *advanced_layout = new QGridLayout(); - main_layout->addLayout(advanced_layout); - - advanced_layout->addWidget(new QLabel(tr("Import each file as: ")), 0, 0); - d_import_mode = new QComboBox(); - // Important: Keep this in sync with the ImportMode enum. - d_import_mode->addItem(tr("New Table")); - d_import_mode->addItem(tr("New Matrice")); - d_import_mode->addItem(tr("New Columns")); - d_import_mode->addItem(tr("New Rows")); - d_import_mode->addItem(tr("Overwrite Current Window")); - advanced_layout->addWidget(d_import_mode, 0, 1); - - QLabel *label_column_separator = new QLabel(tr("Separator:")); - advanced_layout->addWidget(label_column_separator, 1, 0); - d_column_separator = new QComboBox(); - d_column_separator->addItem(tr("TAB")); - d_column_separator->addItem(tr("SPACE")); - d_column_separator->addItem(";" + tr("TAB")); - d_column_separator->addItem("," + tr("TAB")); - d_column_separator->addItem(";" + tr("SPACE")); - d_column_separator->addItem("," + tr("SPACE")); - d_column_separator->addItem(";"); - d_column_separator->addItem(","); - d_column_separator->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - d_column_separator->setEditable( true ); - advanced_layout->addWidget(d_column_separator, 1, 1); - // context-sensitive help - QString help_column_separator = tr("The column separator can be customized. \nThe following special codes can be used:\n\\t for a TAB character \n\\s for a SPACE"); - help_column_separator += "\n"+tr("The separator must not contain the following characters: \n0-9eE.+-"); - d_column_separator->setWhatsThis(help_column_separator); - label_column_separator->setToolTip(help_column_separator); - d_column_separator->setToolTip(help_column_separator); - label_column_separator->setWhatsThis(help_column_separator); - - QLabel *label_ignore_lines = new QLabel(tr( "Ignore first" )); - advanced_layout->addWidget(label_ignore_lines, 2, 0); - d_ignored_lines = new QSpinBox(); - d_ignored_lines->setRange( 0, 10000 ); - d_ignored_lines->setSuffix(" " + tr("lines")); - d_ignored_lines->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - advanced_layout->addWidget(d_ignored_lines, 2, 1); - - advanced_layout->addWidget(new QLabel(tr("Ignore lines starting with")), 3, 0); - d_comment_string = new QLineEdit(); - advanced_layout->addWidget(d_comment_string, 3, 1); - - QHBoxLayout *renameBox = new QHBoxLayout; - d_rename_columns = new QCheckBox(tr("Use first row &as")); - connect(d_rename_columns, SIGNAL(toggled(bool)), this, SLOT(enableComments())); - renameBox->addWidget(d_rename_columns); - - d_first_line_role = new QComboBox(); - d_first_line_role->addItem(tr("Column Names")); - d_first_line_role->addItem(tr("Column Comments")); - connect(d_first_line_role, SIGNAL(activated(int)), this, SLOT(enableComments())); - connect(d_first_line_role, SIGNAL(activated(int)), this, SLOT(preview())); - renameBox->addWidget(d_first_line_role); - advanced_layout->addLayout(renameBox, 0, 2, 1, 2); - - d_import_comments = new QCheckBox(tr("Use second row as &comments")); - advanced_layout->addWidget(d_import_comments, 1, 2, 1, 2); - - d_strip_spaces = new QCheckBox(tr("&Remove white spaces from line ends")); - advanced_layout->addWidget(d_strip_spaces, 2, 2, 1, 2); - // context-sensitive help - QString help_strip_spaces = tr("By checking this option all white spaces will be \nremoved from the beginning and the end of \nthe lines in the ASCII file.","when translating this check the what's this functions and tool tips to place the '\\n's correctly"); - help_strip_spaces +="\n\n"+tr("Warning: checking this option leads to column \noverlaping if the columns in the ASCII file don't \nhave the same number of rows."); - help_strip_spaces +="\n"+tr("To avoid this problem you should precisely \ndefine the column separator using TAB and \nSPACE characters.","when translating this check the what's this functions and tool tips to place the '\\n's correctly"); - d_strip_spaces->setWhatsThis(help_strip_spaces); - d_strip_spaces->setToolTip(help_strip_spaces); - - d_simplify_spaces = new QCheckBox(tr("&Simplify white spaces" )); - advanced_layout->addWidget(d_simplify_spaces, 3, 2, 1, 2); - // context-sensitive help - QString help_simplify_spaces = tr("By checking this option all white spaces will be \nremoved from the beginning and the end of the \nlines and each sequence of internal \nwhitespaces (including the TAB character) will \nbe replaced with a single space.","when translating this check the what's this functions and tool tips to place the '\\n's correctly"); - help_simplify_spaces +="\n\n"+tr("Warning: checking this option leads to column \noverlaping if the columns in the ASCII file don't \nhave the same number of rows.","when translating this check the what's this functions and tool tips to place the '\\n's correctly"); - help_simplify_spaces +="\n"+tr("To avoid this problem you should precisely \ndefine the column separator using TAB and \nSPACE characters.","when translating this check the what's this functions and tool tips to place the '\\n's correctly"); - d_simplify_spaces->setWhatsThis(help_simplify_spaces); - d_simplify_spaces->setToolTip(help_simplify_spaces); - - advanced_layout->addWidget(new QLabel(tr("Decimal Separators")), 4, 0); - boxDecimalSeparator = new QComboBox(); - boxDecimalSeparator->addItem(tr("System Locale Setting")); - boxDecimalSeparator->addItem("1,000.0"); - boxDecimalSeparator->addItem("1.000,0"); - boxDecimalSeparator->addItem("1 000,0"); - advanced_layout->addWidget(boxDecimalSeparator, 4, 1); - - d_omit_thousands_sep = new QCheckBox(tr("Omit &thousands separator")); - advanced_layout->addWidget(d_omit_thousands_sep, 4, 2, 1, 2); - - advanced_layout->addWidget(new QLabel(tr("Endline character")), 5, 0); - boxEndLine = new QComboBox(); - boxEndLine->addItem(tr("LF (Unix)")); - boxEndLine->addItem(tr("CRLF (Windows)")); - boxEndLine->addItem(tr("CR (Mac)")); - connect(boxEndLine, SIGNAL(activated(int)), this, SLOT(preview())); - advanced_layout->addWidget(boxEndLine, 5, 1); - - d_read_only = new QCheckBox(tr("Import as &read-only")); - advanced_layout->addWidget(d_read_only, 5, 2); - - d_preview_button = new QCheckBox(tr("&Preview Lines")); - connect(d_preview_button, SIGNAL(clicked()), this, SLOT(preview())); - advanced_layout->addWidget(d_preview_button, 6, 0); - - d_preview_lines_box = new QSpinBox(); - d_preview_lines_box->setMaximum (INT_MAX); - d_preview_lines_box->setValue(100); - d_preview_lines_box->setSingleStep(10); - d_preview_lines_box->setSpecialValueText(tr("All")); - advanced_layout->addWidget(d_preview_lines_box, 6, 1); - - d_help_button = new QPushButton(tr("&Help")); - connect(d_help_button, SIGNAL(clicked()), this, SLOT(displayHelp())); - advanced_layout->addWidget(d_help_button, 6, 2); - - d_preview_table = NULL; - d_preview_matrix = NULL; - d_preview_stack = new QStackedWidget(); - main_layout->addWidget(d_preview_stack); -} - -void ImportASCIIDialog::initPreview(int previewMode) -{ - if (previewMode < NewTables || previewMode > Overwrite) - return; - - ApplicationWindow *app = (ApplicationWindow *)parent(); - if (!app) - return; - - if (d_preview_table){ - delete d_preview_table; - d_preview_table = NULL; - } - - if (d_preview_matrix){ - delete d_preview_matrix; - d_preview_matrix = NULL; - } - - switch(previewMode){ - case NewTables: - d_preview_table = new PreviewTable(30, 2, this); - d_preview_table->setNumericPrecision(app->d_decimal_digits); - d_preview_stack->addWidget(d_preview_table); - enableTableOptions(true); - break; - - case NewMatrices: - d_preview_matrix = new PreviewMatrix(app); - d_preview_stack->addWidget(d_preview_matrix); - enableTableOptions(false); - break; - - case NewColumns: - case NewRows: - case Overwrite: - MdiSubWindow *w = app->activeWindow(); - if (!w) - return; - - if (w->inherits("Table")){ - d_preview_table = new PreviewTable(30, 2, this); - d_preview_table->setNumericPrecision(app->d_decimal_digits); - d_preview_stack->addWidget(d_preview_table); - enableTableOptions(true); - } else if (w->isA("Matrix")){ - d_preview_matrix = new PreviewMatrix(app, (Matrix *)w); - d_preview_stack->addWidget(d_preview_matrix); - enableTableOptions(false); - } - break; - } - preview(); -} - -void ImportASCIIDialog::enableTableOptions(bool on) -{ - d_rename_columns->setEnabled(on); - d_import_comments->setEnabled(on && d_rename_columns->isChecked()); - d_read_only->setEnabled(on); -} - -void ImportASCIIDialog::setColumnSeparator(const QString& sep) -{ - if (sep=="\t") - d_column_separator->setCurrentIndex(0); - else if (sep==" ") - d_column_separator->setCurrentIndex(1); - else if (sep==";\t") - d_column_separator->setCurrentIndex(2); - else if (sep==",\t") - d_column_separator->setCurrentIndex(3); - else if (sep=="; ") - d_column_separator->setCurrentIndex(4); - else if (sep==", ") - d_column_separator->setCurrentIndex(5); - else if (sep==";") - d_column_separator->setCurrentIndex(6); - else if (sep==",") - d_column_separator->setCurrentIndex(7); - else { - QString separator = sep; - d_column_separator->setEditText(separator.replace(" ","\\s").replace("\t","\\t")); - } -} - -const QString ImportASCIIDialog::columnSeparator() const -{ - QString sep = d_column_separator->currentText(); - - if (d_simplify_spaces->isChecked()) - sep.replace(tr("TAB"), " ", Qt::CaseInsensitive); - else - sep.replace(tr("TAB"), "\t", Qt::CaseInsensitive); - - sep.replace(tr("SPACE"), " ", Qt::CaseInsensitive); - sep.replace("\\s", " "); - sep.replace("\\t", "\t"); - - /* TODO - if (sep.contains(QRegExp("[0-9.eE+-]"))) - QMessageBox::warning(this, tr("QtiPlot - Import options error"), - tr("The separator must not contain the following characters: 0-9eE.+-")); - */ - - return sep; -} - -void ImportASCIIDialog::displayHelp() -{ - QString s = tr("The column separator can be customized. The following special codes can be used:\n\\t for a TAB character \n\\s for a SPACE"); - s += "\n"+tr("The separator must not contain the following characters: 0-9eE.+-") + "\n\n"; - s += tr( "Remove white spaces from line ends" )+ ":\n"; - s += tr("By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file.") + "\n\n"; - s += tr( "Simplify white spaces" )+ ":\n"; - s += tr("By checking this option each sequence of internal whitespaces (including the TAB character) will be replaced with a single space."); - s += tr("By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal whitespaces (including the TAB character) will be replaced with a single space."); - - s +="\n\n"+tr("Warning: using these two last options leads to column overlaping if the columns in the ASCII file don't have the same number of rows."); - s +="\n"+tr("To avoid this problem you should precisely define the column separator using TAB and SPACE characters."); - - QMessageBox::about(this, tr("QtiPlot - Help"), s); -} - -void ImportASCIIDialog::updateImportMode(int mode) -{ - if (mode == Overwrite) - setFileMode( QFileDialog::ExistingFile ); - else - setFileMode( QFileDialog::ExistingFiles ); - - initPreview(mode); -} - -void ImportASCIIDialog::closeEvent(QCloseEvent* e) -{ - ApplicationWindow *app = (ApplicationWindow *)this->parent(); - if (app){ - app->d_extended_import_ASCII_dialog = this->isExtended(); - app->d_ASCII_file_filter = this->selectedFilter(); - app->d_ASCII_import_preview = d_preview_button->isChecked(); - app->d_preview_lines = d_preview_lines_box->value(); - app->d_ASCII_import_first_row_role = d_first_line_role->currentIndex(); - } - - e->accept(); -} - -QLocale ImportASCIIDialog::decimalSeparators() -{ - QLocale locale; - switch (boxDecimalSeparator->currentIndex()){ - case 0: - locale = QLocale::system(); - break; - case 1: - locale = QLocale::c(); - break; - case 2: - locale = QLocale(QLocale::German); - break; - case 3: - locale = QLocale(QLocale::French); - break; - } - - if (d_omit_thousands_sep->isChecked()) - locale.setNumberOptions(QLocale::OmitGroupSeparator); - - return locale; -} - -void ImportASCIIDialog::preview() -{ - if (!d_preview_button->isChecked()){ - d_preview_stack->hide(); - return; - } else - d_preview_stack->show(); - - if (d_preview_table) - previewTable(); - else if (d_preview_matrix) - previewMatrix(); -} - -void ImportASCIIDialog::previewTable() -{ - if (!d_preview_table) - return; - - if (!d_preview_table->isVisible()) - d_preview_table->show(); - - if (d_current_path.trimmed().isEmpty()){ - d_preview_table->clear(); - d_preview_table->resetHeader(); - return; - } - - int importMode = d_import_mode->currentIndex(); - if (importMode == NewTables) - importMode = Table::Overwrite; - else - importMode -= 2; - - d_preview_table->resetHeader(); - d_preview_table->importASCII(d_current_path, columnSeparator(), d_ignored_lines->value(), - renameColumns(), d_strip_spaces->isChecked(), - d_simplify_spaces->isChecked(), importComments(), - d_comment_string->text(), (Table::ImportMode)importMode, - boxEndLine->currentIndex(), d_preview_lines_box->value()); - - d_preview_table->updateDecimalSeparators(decimalSeparators()); - - if (!d_preview_table->isVisible()) - d_preview_table->show(); -} - -void ImportASCIIDialog::previewMatrix() -{ - if (!d_preview_matrix) - return; - - if (d_current_path.trimmed().isEmpty()){ - d_preview_matrix->clear(); - return; - } - - int importMode = d_import_mode->currentIndex(); - if (importMode == NewMatrices) - importMode = Matrix::Overwrite; - else - importMode -= 2; - - d_preview_matrix->importASCII(d_current_path, columnSeparator(), d_ignored_lines->value(), - d_strip_spaces->isChecked(), d_simplify_spaces->isChecked(), - d_comment_string->text(), importMode, decimalSeparators(), - boxEndLine->currentIndex(), d_preview_lines_box->value()); - d_preview_matrix->resizeColumnsToContents(); -} - -void ImportASCIIDialog::changePreviewFile(const QString& path) -{ - if (path.isEmpty()) - return; - - QFileInfo fi(path); - if (!fi.exists() || fi.isDir() || !fi.isFile()) - return; - - if (!fi.isReadable()){ - QMessageBox::critical(this, tr("QtiPlot - File openning error"), - tr("You don't have the permission to open this file: %1").arg(path)); - return; - } - - d_current_path = path; - preview(); -} - -void ImportASCIIDialog::setNewWindowsOnly(bool on) -{ - if (on){ - d_import_mode->clear(); - d_import_mode->addItem(tr("New Table")); - d_import_mode->addItem(tr("New Matrice")); - } - - d_preview_button->setChecked(false); -} - -bool ImportASCIIDialog::importComments() -{ - if (!d_rename_columns->isChecked()) - return false; - - return (d_first_line_role->currentIndex() == 1) || - (d_import_comments->isChecked() && d_import_comments->isEnabled()); - -} - -void ImportASCIIDialog::enableComments() -{ - d_import_comments->setEnabled(d_rename_columns->isChecked() && - !d_first_line_role->currentIndex()); -} - -/***************************************************************************** - * - * Class PreviewTable - * - *****************************************************************************/ - -PreviewTable::PreviewTable(int numRows, int numCols, QWidget * parent, const char * name) -:Q3Table(numRows, numCols, parent, name) -{ - setAttribute(Qt::WA_DeleteOnClose); - setSelectionMode(Q3Table::NoSelection); - setReadOnly(true); - setRowMovingEnabled(false); - setColumnMovingEnabled(false); - verticalHeader()->setResizeEnabled(false); - - for (int i=0; iheight()); - connect(horizontalHeader(), SIGNAL(sizeChange(int, int, int)), this, SLOT(setHeader())); -} - -void PreviewTable::importASCII(const QString &fname, const QString &sep, int ignoredLines, bool renameCols, - bool stripSpaces, bool simplifySpaces, bool importComments, const QString& commentString, - int importMode, int endLine, int maxRows) -{ - int rows; - QString name = MdiSubWindow::parseAsciiFile(fname, commentString, endLine, ignoredLines, maxRows, rows); - if (name.isEmpty()) - return; - - QFile f(name); - if (!f.open(QIODevice::ReadOnly)) - return; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - QTextStream t(&f); - QString s = t.readLine();//read first line - if (simplifySpaces) - s = s.simplifyWhiteSpace(); - else if (stripSpaces) - s = s.stripWhiteSpace(); - - QStringList line = s.split(sep); - int cols = line.size(); - - bool allNumbers = true; - for (int i=0; iprocessEvents(QEventLoop::ExcludeUserInput); - } - - if ((!renameCols || allNumbers)&& !importComments && rows > 0){ - //put values in the first line of the table - for (int i = 0; i cols) { - addColumns(lc - cols); - cols = lc; - } - for (int j=0; jprocessEvents(QEventLoop::ExcludeUserInput); - } - blockSignals(false); - f.remove(); -} - -void PreviewTable::resetHeader() -{ - for (int i=0; ilocale(); - if (locale == oldSeparators) - return; - - for (int i=0; ifontMetrics().boundingRect("_").width(); - head->setLabel(i, s.remove("\n") + "\n" + QString(lines, '_') + "\n" + comments[i]); - } -} - -void PreviewTable::addColumns(int c) -{ - int max=0, cols = numCols(); - for (int i=0; imax) - max=index; - } - } - max++; - insertColumns(cols, c); - for (int i=0; isetLocale(app->locale()); - d_matrix_model->setNumericFormat('f', app->d_decimal_digits); - } - } - setModel(d_matrix_model); - - setAttribute(Qt::WA_DeleteOnClose); - setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); - setSelectionMode(QAbstractItemView::NoSelection); - setEditTriggers(QAbstractItemView::NoEditTriggers); - setFocusPolicy(Qt::NoFocus); - - QPalette pal = palette(); - pal.setColor(QColorGroup::Base, QColor(255, 255, 128)); - setPalette(pal); - - // set header properties - horizontalHeader()->setMovable(false); - horizontalHeader()->setResizeMode(QHeaderView::Fixed); - for(int i=0; icolumnCount(); i++) - setColumnWidth(i, 100); - - verticalHeader()->setMovable(false); - verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); - - setMinimumHeight(4*horizontalHeader()->height()); -} - -void PreviewMatrix::importASCII(const QString &fname, const QString &sep, int ignoredLines, - bool stripSpaces, bool simplifySpaces, const QString& commentString, - int importAs, const QLocale& locale, int endLine, int maxRows) -{ - d_matrix_model->importASCII(fname, sep, ignoredLines, stripSpaces, - simplifySpaces, commentString, importAs, locale, endLine, maxRows); -} - -void PreviewMatrix::clear() -{ - d_matrix_model->clear(); - reset(); -} === added file 'qtiplot/src/core/ImportASCIIDialog.h' --- qtiplot/src/core/ImportASCIIDialog.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/ImportASCIIDialog.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,200 @@ +/*************************************************************************** + File : ImportASCIIDialog.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006,2007 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de + Description : Import ASCII file(s) dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef IMPORTFILESDIALOG_H +#define IMPORTFILESDIALOG_H + +#include + +#include +#include +#include +#include +#include + +class QGroupBox; +class QPushButton; +class QStackedWidget; +class Matrix; +class MatrixModel; + +#include +#include + +class PreviewTable : public Q3Table +{ + Q_OBJECT + +public: + PreviewTable(int numRows, int numCols, QWidget * parent = 0, const char * name = 0); + + void importASCII(const QString &fname, const QString &sep, int ignoredLines, bool renameCols, + bool stripSpaces, bool simplifySpaces, bool importComments, const QString& commentString, + int importMode, const QLocale& importLocale, int endLine, int maxRows); + + void resetHeader(); + void clear(); + void setNumericPrecision(int prec) {d_numeric_precision = prec;}; + QList columnTypes(){return colTypes;}; + +signals: + void modifiedColumnType(); + +private slots: + void setHeader(); + bool eventFilter(QObject *object, QEvent *e); + +private: + void showColTypeDialog(); + void addColumns(int c); + QStringList comments, col_label; + int d_numeric_precision, d_start_col; + QList colTypes; + int d_selected_column; +}; + +class PreviewMatrix : public QTableView +{ +public: + PreviewMatrix(QWidget *parent, Matrix * m = 0); + + void importASCII(const QString &fname, const QString &sep, int ignoredLines, + bool stripSpaces, bool simplifySpaces, const QString& commentString, + int importAs, const QLocale& locale, int endLine, int maxRows); + + void clear(); + +private: + MatrixModel *d_matrix_model; +}; + +//! Import ASCII file(s) dialog +class ImportASCIIDialog: public ExtensibleFileDialog +{ + Q_OBJECT + +public: + //! Possible destinations for the imported data. + /** + * Important: Keep this in sync with the initialization of #d_import_mode in initAdvancedOptions(). + */ + enum ImportMode { + NewTables, //!< create a new table for each file (default) + NewMatrices, //!< create a new matrix for each file + NewColumns, //!< add each file as new columns to the current table + NewRows, //!< add each file as new rows to the current table + Overwrite //!< replace content of current table with the selected file (like importing a single file in previous versions of QtiPlot) + }; + + //! Constructor + /** + * \param importModeEnabled flag: enable/disable import mode combo box + * \param parent parent widget (only affects placement of the dialog) + * \param extended flag: show/hide the advanced options on start-up + * \param flags window flags + */ + ImportASCIIDialog(bool new_windows_only, QWidget * parent = 0, bool extended = true, Qt::WFlags flags = 0 ); + + //! Return the selected import mode + /** + * \sa ImportMode + */ + ImportMode importMode() const { return (ImportMode) d_import_mode->currentIndex(); } + //! Return the selected column separator. + const QString columnSeparator() const; + //! Return the number of lines to be skipped at the start of each file. + int ignoredLines() const { return d_ignored_lines->value(); } + //! Whether to rename columns based on the first (non-skipped) line. + bool renameColumns() const { return d_rename_columns->isChecked() && !d_first_line_role->currentIndex(); }; + bool useFirstRow() const { return d_rename_columns->isChecked();}; + //! Whether to replace sequences of whitespace charecters with a single space. + bool simplifySpaces() const { return d_simplify_spaces->isChecked(); }; + //! Whether to remove whitespace from beginning and end of lines. + bool stripSpaces() const { return d_strip_spaces->isChecked(); }; + //! Whether the user wants the import options to be saved. + bool readOnly() const {return d_read_only->isChecked(); }; + + //! Set the selected columns separator. + void setColumnSeparator(const QString &sep); + + //! Returns a locale having the decimal separators set to user custom settings. + QLocale decimalSeparators(); + + //! Returns a string used to comment lines when importing ASCII files + QString commentString(){return d_comment_string->text();}; + + //! Returns true if the second line of the ASCII file should be used to set comments in table + bool importComments(); + bool useSecondRow() const { return d_import_comments->isChecked();}; + + //! Returns the convention used for the end line character! + inline int endLineChar(){return boxEndLine->currentIndex();}; + + void selectFilter(const QString & filter); + + QList columnTypes(){return d_preview_table->columnTypes();}; + +private slots: + //! Display help for advanced options. + void displayHelp(); + //! For #Overwrite mode, allow only one file to be selected. + void updateImportMode(int mode); + void preview(); + void changePreviewFile(const QString& path); + //! Enable/Disable options which are only available for tables. + void enableTableOptions(bool on); + void enableComments(); + +private: + void initPreview(int previewMode); + void previewTable(); + void previewMatrix(); + + void closeEvent(QCloseEvent*); + //! Initialise #d_advanced_options and everything it contains. + void initAdvancedOptions(); + void setNewWindowsOnly(bool on); + + //! Container widget for all advanced options. + QGroupBox *d_advanced_options; + QCheckBox *d_read_only, *d_omit_thousands_sep; + QPushButton *d_help_button; + // the actual options + QComboBox *d_import_mode, *d_column_separator, *boxDecimalSeparator, *boxEndLine; + QSpinBox *d_ignored_lines, *d_preview_lines_box; + QCheckBox *d_rename_columns, *d_simplify_spaces, *d_strip_spaces, *d_import_comments; + QLineEdit *d_comment_string; + PreviewTable *d_preview_table; + PreviewMatrix *d_preview_matrix; + QCheckBox *d_preview_button; + QStackedWidget *d_preview_stack; + QString d_current_path; + QComboBox *d_first_line_role; +}; + +#endif === removed file 'qtiplot/src/core/ImportASCIIDialog.h' --- qtiplot/src/core/ImportASCIIDialog.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/ImportASCIIDialog.h 1970-01-01 00:00:00 +0000 @@ -1,189 +0,0 @@ -/*************************************************************************** - File : ImportASCIIDialog.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006,2007 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de - Description : Import ASCII file(s) dialog - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef IMPORTFILESDIALOG_H -#define IMPORTFILESDIALOG_H - -#include - -#include -#include -#include -#include -#include - -class QGroupBox; -class QPushButton; -class QStackedWidget; -class Matrix; -class MatrixModel; - -#include -#include - -class PreviewTable : public Q3Table -{ - Q_OBJECT - -public: - PreviewTable(int numRows, int numCols, QWidget * parent = 0, const char * name = 0); - - void importASCII(const QString &fname, const QString &sep, int ignoredLines, bool renameCols, - bool stripSpaces, bool simplifySpaces, bool importComments, const QString& commentString, - int importMode, int endLine, int maxRows); - - void resetHeader(); - void clear(); - void updateDecimalSeparators(const QLocale& oldSeparators); - void setNumericPrecision(int prec) {d_numeric_precision = prec;}; - -private slots: - void setHeader(); - -private: - void addColumns(int c); - QStringList comments, col_label; - int d_numeric_precision; -}; - -class PreviewMatrix : public QTableView -{ -public: - PreviewMatrix(QWidget *parent, Matrix * m = 0); - - void importASCII(const QString &fname, const QString &sep, int ignoredLines, - bool stripSpaces, bool simplifySpaces, const QString& commentString, - int importAs, const QLocale& locale, int endLine, int maxRows); - - void clear(); - -private: - MatrixModel *d_matrix_model; -}; - -//! Import ASCII file(s) dialog -class ImportASCIIDialog: public ExtensibleFileDialog -{ - Q_OBJECT - -public: - //! Possible destinations for the imported data. - /** - * Important: Keep this in sync with the initialization of #d_import_mode in initAdvancedOptions(). - */ - enum ImportMode { - NewTables, //!< create a new table for each file (default) - NewMatrices, //!< create a new matrix for each file - NewColumns, //!< add each file as new columns to the current table - NewRows, //!< add each file as new rows to the current table - Overwrite //!< replace content of current table with the selected file (like importing a single file in previous versions of QtiPlot) - }; - - //! Constructor - /** - * \param importModeEnabled flag: enable/disable import mode combo box - * \param parent parent widget (only affects placement of the dialog) - * \param extended flag: show/hide the advanced options on start-up - * \param flags window flags - */ - ImportASCIIDialog(bool new_windows_only, QWidget * parent = 0, bool extended = true, Qt::WFlags flags = 0 ); - - //! Return the selected import mode - /** - * \sa ImportMode - */ - ImportMode importMode() const { return (ImportMode) d_import_mode->currentIndex(); } - //! Return the selected column separator. - const QString columnSeparator() const; - //! Return the number of lines to be skipped at the start of each file. - int ignoredLines() const { return d_ignored_lines->value(); } - //! Whether to rename columns based on the first (non-skipped) line. - bool renameColumns() const { return d_rename_columns->isChecked() && !d_first_line_role->currentIndex(); }; - bool useFirstRow() const { return d_rename_columns->isChecked();}; - //! Whether to replace sequences of whitespace charecters with a single space. - bool simplifySpaces() const { return d_simplify_spaces->isChecked(); }; - //! Whether to remove whitespace from beginning and end of lines. - bool stripSpaces() const { return d_strip_spaces->isChecked(); }; - //! Whether the user wants the import options to be saved. - bool readOnly() const {return d_read_only->isChecked(); }; - - //! Set the selected columns separator. - void setColumnSeparator(const QString &sep); - - //! Returns a locale having the decimal separators set to user custom settings. - QLocale decimalSeparators(); - - //! Returns a string used to comment lines when importing ASCII files - QString commentString(){return d_comment_string->text();}; - - //! Returns true if the second line of the ASCII file should be used to set comments in table - bool importComments(); - bool useSecondRow() const { return d_import_comments->isChecked();}; - - //! Returns the convention used for the end line character! - inline int endLineChar(){return boxEndLine->currentIndex();}; - -private slots: - //! Display help for advanced options. - void displayHelp(); - //! For #Overwrite mode, allow only one file to be selected. - void updateImportMode(int mode); - void preview(); - void changePreviewFile(const QString& path); - //! Enable/Disable options which are only available for tables. - void enableTableOptions(bool on); - void enableComments(); - -private: - void initPreview(int previewMode); - void previewTable(); - void previewMatrix(); - - void closeEvent(QCloseEvent*); - //! Initialise #d_advanced_options and everything it contains. - void initAdvancedOptions(); - void setNewWindowsOnly(bool on); - - //! Container widget for all advanced options. - QGroupBox *d_advanced_options; - QCheckBox *d_read_only, *d_omit_thousands_sep; - QPushButton *d_help_button; - // the actual options - QComboBox *d_import_mode, *d_column_separator, *boxDecimalSeparator, *boxEndLine; - QSpinBox *d_ignored_lines, *d_preview_lines_box; - QCheckBox *d_rename_columns, *d_simplify_spaces, *d_strip_spaces, *d_import_comments; - QLineEdit *d_comment_string; - PreviewTable *d_preview_table; - PreviewMatrix *d_preview_matrix; - QCheckBox *d_preview_button; - QStackedWidget *d_preview_stack; - QString d_current_path; - QComboBox *d_first_line_role; -}; - -#endif === added file 'qtiplot/src/core/MdiSubWindow.cpp' --- qtiplot/src/core/MdiSubWindow.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/MdiSubWindow.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,344 @@ +/*************************************************************************** + File : MdiSubWindow.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de + Description : MDI sub window + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "MdiSubWindow.h" +#include "Folder.h" +#include "ApplicationWindow.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +using std::ifstream; +using std::string; + +MdiSubWindow::MdiSubWindow(const QString& label, ApplicationWindow *app, const QString& name, Qt::WFlags f): + QMdiSubWindow (app, f), + d_app(app), + d_folder(app->currentFolder()), + d_label(label), + d_status(Normal), + d_caption_policy(Both), + d_confirm_close(true), + d_birthdate(QDateTime::currentDateTime ().toString(Qt::LocalDate)), + d_min_restore_size(QSize()) +{ + setObjectName(name); + setAttribute(Qt::WA_DeleteOnClose); + setLocale(app->locale()); + if (d_folder) + d_folder->addWindow(this); +} + +void MdiSubWindow::updateCaption() +{ +switch (d_caption_policy) + { + case Name: + setWindowTitle(objectName()); + break; + + case Label: + if (!d_label.isEmpty()) + setWindowTitle(d_label); + else + setWindowTitle(objectName()); + break; + + case Both: + if (!d_label.isEmpty()) + setWindowTitle(objectName() + " - " + d_label); + else + setWindowTitle(objectName()); + break; + } + + d_app->setListViewLabel(objectName(), d_label); +}; + +void MdiSubWindow::resizeEvent( QResizeEvent* e ) +{ + emit resizedWindow(this); + QMdiSubWindow::resizeEvent( e ); +} + +void MdiSubWindow::closeEvent( QCloseEvent *e ) +{ + if (d_confirm_close){ + switch( QMessageBox::information(this, tr("QtiPlot"), + tr("Do you want to hide or delete") + "

'" + objectName() + "' ?", + tr("Delete"), tr("Hide"), tr("Cancel"), 0, 2)){ + case 0: + emit closedWindow(this); + e->accept(); + break; + + case 1: + e->ignore(); + emit hiddenWindow(this); + break; + + case 2: + e->ignore(); + break; + } + } else { + emit closedWindow(this); + e->accept(); + } +} + +QString MdiSubWindow::aspect() +{ +QString s = tr("Normal"); +switch (d_status) + { + case Normal: + break; + + case Minimized: + return tr("Minimized"); + break; + + case Maximized: + return tr("Maximized"); + break; + + case Hidden: + return tr("Hidden"); + break; + } +return s; +} + +QString MdiSubWindow::sizeToString() +{ +return QString::number(sizeof(MdiSubWindow), 'f', 1) + " " + tr("B"); +} + +void MdiSubWindow::changeEvent(QEvent *event) +{ + if (!isHidden() && event->type() == QEvent::WindowStateChange){ + Status oldStatus = d_status; + Status newStatus = Normal; + if( windowState() & Qt::WindowMinimized ){ + if (oldStatus != Minimized) + d_min_restore_size = frameSize(); + newStatus = Minimized; + } else if ( windowState() & Qt::WindowMaximized ) + newStatus = Maximized; + + if (newStatus != oldStatus){ + d_status = newStatus; + emit statusChanged (this); + } + } + QMdiSubWindow::changeEvent(event); +} + +bool MdiSubWindow::eventFilter(QObject *object, QEvent *e) +{ + if (e->type() == QEvent::ContextMenu && object == widget()){ + emit showContextMenu(); + return true; + } + + if (e->type() == QEvent::Move && object == widget()){ + QObjectList lst = children(); + foreach(QObject *o, lst){ + if (o->isA("QMenu") && d_app){ + d_app->customWindowTitleBarMenu(this, (QMenu *)o); + break; + } + } + } + + if (e->type() == QEvent::WindowActivate && object == widget() && !parent()){ + d_app->setActiveWindow(this); + if (d_folder) + d_folder->setActiveWindow(this); + } + return QMdiSubWindow::eventFilter(object, e); +} + +void MdiSubWindow::setStatus(Status s) +{ + if (d_status == s) + return; + + d_status = s; + emit statusChanged (this); +} + +void MdiSubWindow::setHidden() +{ + d_status = Hidden; + emit statusChanged (this); + hide(); +} + +void MdiSubWindow::setNormal() +{ + showNormal(); + d_status = Normal; + emit statusChanged (this); +} + +void MdiSubWindow::setMinimized() +{ + d_status = Minimized; + emit statusChanged (this); + showMinimized(); +} + +void MdiSubWindow::setMaximized() +{ + showMaximized(); + d_status = Maximized; + emit statusChanged (this); +} + +QString MdiSubWindow::parseAsciiFile(const QString& fname, const QString &commentString, + int endLine, int ignoreFirstLines, int maxRows, int& rows) +{ + if (endLine == ApplicationWindow::CR) + return parseMacAsciiFile(fname, commentString, ignoreFirstLines, maxRows, rows); + + //QTextStream replaces '\r\n' with '\n', therefore we don't need a special treatement in this case! + + QFile f(fname); + if(!f.open(QIODevice::ReadOnly)) + return QString::null; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + QTextStream t(&f); + + QTemporaryFile tempFile; + tempFile.open(); + QTextStream temp(&tempFile); + + for (int i = 0; i < ignoreFirstLines; i++)//skip first 'ignoreFirstLines' lines + t.readLine(); + + bool validCommentString = !commentString.isEmpty(); + rows = 0; + if (maxRows <= 0){//read all valid lines + while(!t.atEnd()){//count the number of valid rows + QString s = t.readLine(); + if (validCommentString && s.startsWith(commentString)) + continue; + + rows++; + temp << s + "\n"; + qApp->processEvents(QEventLoop::ExcludeUserInput); + } + } else {//we write only 'maxRows' valid rows to the temp file + while(!t.atEnd() && rows < maxRows){ + QString s = t.readLine(); + if (validCommentString && s.startsWith(commentString)) + continue; + + rows++; + temp << s + "\n"; + qApp->processEvents(QEventLoop::ExcludeUserInput); + } + } + f.close(); + + tempFile.setAutoRemove(false); + QString path = tempFile.fileName(); + tempFile.close(); + + QApplication::restoreOverrideCursor(); + return path; +} + +QString MdiSubWindow::parseMacAsciiFile(const QString& fname, const QString &commentString, + int ignoreFirstLines, int maxRows, int& rows) +{ + ifstream f; + f.open(fname.toAscii()); + if(!f) + return QString::null; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QTemporaryFile tempFile; + tempFile.open(); + QTextStream temp(&tempFile); + + for (int i = 0; i < ignoreFirstLines; i++){//skip first 'ignoreFirstLines' lines + string s; + getline(f, s, '\r'); + } + + bool validCommentString = !commentString.isEmpty(); + string comment = commentString.ascii(); + int commentLength = comment.size(); + rows = 0; + if (maxRows <= 0){//read all valid lines + while(f.good() && !f.eof()){//count the number of valid rows + string s; + getline(f, s, '\r'); + if (validCommentString && s.compare(0, commentLength, comment) == 0) + continue; + + rows++; + temp << QString(s.c_str()) + "\n"; + qApp->processEvents(QEventLoop::ExcludeUserInput); + } + } else {//we write only 'maxRows' valid rows to the temp file + while(f.good() && !f.eof() && rows < maxRows){ + string s; + getline(f, s, '\r'); + if (validCommentString && s.compare(0, commentLength, comment) == 0) + continue; + + rows++; + temp << QString(s.c_str()) + "\n"; + qApp->processEvents(QEventLoop::ExcludeUserInput); + } + } + f.close(); + + tempFile.setAutoRemove(false); + QString path = tempFile.fileName(); + tempFile.close(); + + QApplication::restoreOverrideCursor(); + return path; +} === removed file 'qtiplot/src/core/MdiSubWindow.cpp' --- qtiplot/src/core/MdiSubWindow.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/MdiSubWindow.cpp 1970-01-01 00:00:00 +0000 @@ -1,344 +0,0 @@ -/*************************************************************************** - File : MdiSubWindow.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de - Description : MDI sub window - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "MdiSubWindow.h" -#include "Folder.h" -#include "ApplicationWindow.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -using std::ifstream; -using std::string; - -MdiSubWindow::MdiSubWindow(const QString& label, ApplicationWindow *app, const QString& name, Qt::WFlags f): - QMdiSubWindow (app, f), - d_app(app), - d_folder(app->currentFolder()), - d_label(label), - d_status(Normal), - d_caption_policy(Both), - d_confirm_close(true), - d_birthdate(QDateTime::currentDateTime ().toString(Qt::LocalDate)), - d_min_restore_size(QSize()) -{ - setObjectName(name); - setAttribute(Qt::WA_DeleteOnClose); - setLocale(app->locale()); - if (d_folder) - d_folder->addWindow(this); -} - -void MdiSubWindow::updateCaption() -{ -switch (d_caption_policy) - { - case Name: - setWindowTitle(objectName()); - break; - - case Label: - if (!d_label.isEmpty()) - setWindowTitle(d_label); - else - setWindowTitle(objectName()); - break; - - case Both: - if (!d_label.isEmpty()) - setWindowTitle(objectName() + " - " + d_label); - else - setWindowTitle(objectName()); - break; - } - - d_app->setListViewLabel(objectName(), d_label); -}; - -void MdiSubWindow::resizeEvent( QResizeEvent* e ) -{ - emit resizedWindow(this); - QMdiSubWindow::resizeEvent( e ); -} - -void MdiSubWindow::closeEvent( QCloseEvent *e ) -{ - if (d_confirm_close){ - switch( QMessageBox::information(this, tr("QtiPlot"), - tr("Do you want to hide or delete") + "

'" + objectName() + "' ?", - tr("Delete"), tr("Hide"), tr("Cancel"), 0, 2)){ - case 0: - emit closedWindow(this); - e->accept(); - break; - - case 1: - e->ignore(); - emit hiddenWindow(this); - break; - - case 2: - e->ignore(); - break; - } - } else { - emit closedWindow(this); - e->accept(); - } -} - -QString MdiSubWindow::aspect() -{ -QString s = tr("Normal"); -switch (d_status) - { - case Normal: - break; - - case Minimized: - return tr("Minimized"); - break; - - case Maximized: - return tr("Maximized"); - break; - - case Hidden: - return tr("Hidden"); - break; - } -return s; -} - -QString MdiSubWindow::sizeToString() -{ -return QString::number(sizeof(MdiSubWindow), 'f', 1) + " " + tr("B"); -} - -void MdiSubWindow::changeEvent(QEvent *event) -{ - if (!isHidden() && event->type() == QEvent::WindowStateChange){ - Status oldStatus = d_status; - Status newStatus = Normal; - if( windowState() & Qt::WindowMinimized ){ - if (oldStatus != Minimized) - d_min_restore_size = frameSize(); - newStatus = Minimized; - } else if ( windowState() & Qt::WindowMaximized ) - newStatus = Maximized; - - if (newStatus != oldStatus){ - d_status = newStatus; - emit statusChanged (this); - } - } - QMdiSubWindow::changeEvent(event); -} - -bool MdiSubWindow::eventFilter(QObject *object, QEvent *e) -{ - if (e->type() == QEvent::ContextMenu && object == widget()){ - emit showContextMenu(); - return true; - } - - if (e->type() == QEvent::Move && object == widget()){ - QObjectList lst = children(); - foreach(QObject *o, lst){ - if (o->isA("QMenu") && d_app){ - d_app->customWindowTitleBarMenu(this, (QMenu *)o); - break; - } - } - } - - if (e->type() == QEvent::WindowActivate && object == widget() && !parent()){ - d_app->setActiveWindow(this); - if (d_folder) - d_folder->setActiveWindow(this); - } - return QMdiSubWindow::eventFilter(object, e); -} - -void MdiSubWindow::setStatus(Status s) -{ - if (d_status == s) - return; - - d_status = s; - emit statusChanged (this); -} - -void MdiSubWindow::setHidden() -{ - d_status = Hidden; - emit statusChanged (this); - hide(); -} - -void MdiSubWindow::setNormal() -{ - showNormal(); - d_status = Normal; - emit statusChanged (this); -} - -void MdiSubWindow::setMinimized() -{ - d_status = Minimized; - emit statusChanged (this); - showMinimized(); -} - -void MdiSubWindow::setMaximized() -{ - showMaximized(); - d_status = Maximized; - emit statusChanged (this); -} - -QString MdiSubWindow::parseAsciiFile(const QString& fname, const QString &commentString, - int endLine, int ignoreFirstLines, int maxRows, int& rows) -{ - if (endLine == ApplicationWindow::CR) - return parseMacAsciiFile(fname, commentString, ignoreFirstLines, maxRows, rows); - - //QTextStream replaces '\r\n' with '\n', therefore we don't need a special treatement in this case! - - QFile f(fname); - if(!f.open(QIODevice::ReadOnly)) - return QString::null; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - QTextStream t(&f); - - QTemporaryFile tempFile; - tempFile.open(); - QTextStream temp(&tempFile); - - for (int i = 0; i < ignoreFirstLines; i++)//skip first 'ignoreFirstLines' lines - t.readLine(); - - bool validCommentString = !commentString.isEmpty(); - rows = 0; - if (maxRows <= 0){//read all valid lines - while(!t.atEnd()){//count the number of valid rows - QString s = t.readLine(); - if (validCommentString && s.startsWith(commentString)) - continue; - - rows++; - temp << s + "\n"; - qApp->processEvents(QEventLoop::ExcludeUserInput); - } - } else {//we write only 'maxRows' valid rows to the temp file - while(!t.atEnd() && rows < maxRows){ - QString s = t.readLine(); - if (validCommentString && s.startsWith(commentString)) - continue; - - rows++; - temp << s + "\n"; - qApp->processEvents(QEventLoop::ExcludeUserInput); - } - } - f.close(); - - tempFile.setAutoRemove(false); - QString path = tempFile.fileName(); - tempFile.close(); - - QApplication::restoreOverrideCursor(); - return path; -} - -QString MdiSubWindow::parseMacAsciiFile(const QString& fname, const QString &commentString, - int ignoreFirstLines, int maxRows, int& rows) -{ - ifstream f; - f.open(fname.toAscii()); - if(!f) - return QString::null; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - QTemporaryFile tempFile; - tempFile.open(); - QTextStream temp(&tempFile); - - for (int i = 0; i < ignoreFirstLines; i++){//skip first 'ignoreFirstLines' lines - string s; - getline(f, s, '\r'); - } - - bool validCommentString = !commentString.isEmpty(); - string comment = commentString.ascii(); - int commentLength = comment.size(); - rows = 0; - if (maxRows <= 0){//read all valid lines - while(f.good() && !f.eof()){//count the number of valid rows - string s; - getline(f, s, '\r'); - if (validCommentString && s.compare(0, commentLength, comment) == 0) - continue; - - rows++; - temp << QString(s.c_str()) + "\n"; - qApp->processEvents(QEventLoop::ExcludeUserInput); - } - } else {//we write only 'maxRows' valid rows to the temp file - while(f.good() && !f.eof() && rows < maxRows){ - string s; - getline(f, s, '\r'); - if (validCommentString && s.compare(0, commentLength, comment) == 0) - continue; - - rows++; - temp << QString(s.c_str()) + "\n"; - qApp->processEvents(QEventLoop::ExcludeUserInput); - } - } - f.close(); - - tempFile.setAutoRemove(false); - QString path = tempFile.fileName(); - tempFile.close(); - - QApplication::restoreOverrideCursor(); - return path; -} === added file 'qtiplot/src/core/MdiSubWindow.h' --- qtiplot/src/core/MdiSubWindow.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/MdiSubWindow.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,205 @@ +/*************************************************************************** + File : MdiSubWindow.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de + Description : MDI sub window + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef MdiSubWindow_H +#define MdiSubWindow_H + +#include + +class QEvent; +class QCloseEvent; +class QString; +class Folder; +class ApplicationWindow; + +/** + * \brief Base class of all MDI client windows. + * + * These are the main objects of every Qtiplot project. + * All content (apart from the directory structure) is managed by subclasses of MdiSubWindow. + * + * \section future Future Plans + * Rename to Aspect. + * + * \sa Folder, ApplicationWindow + */ +class MdiSubWindow: public QMdiSubWindow +{ + Q_OBJECT + +public: + + //! Constructor + /** + * \param label window label + * \param parent parent widget + * \param name window name + * \param f window flags + * \sa setCaptionPolicy(), captionPolicy() + */ + MdiSubWindow(const QString& label = QString(), ApplicationWindow *app = 0, const QString& name = QString(), Qt::WFlags f = 0); + + //! Possible window captions. + enum CaptionPolicy{ + Name = 0, //!< caption determined by the window name + Label = 1, //!< caption detemined by the window label + Both = 2 //!< caption = "name - label" + }; + enum Status{Hidden = -1, Normal = 0, Minimized = 1, Maximized = 2}; + + //! Returns a pointer to the parent application + ApplicationWindow *applicationWindow(){return d_app;}; + + //! Return the window label + QString windowLabel(){return QString(d_label);}; + //! Set the window label + void setWindowLabel(const QString& s) { d_label = s; updateCaption();}; + + //! Return the window name + QString name(){return objectName();}; + //! Set the window name + void setName(const QString& s){setObjectName(s); updateCaption();}; + + //! Return the caption policy + CaptionPolicy captionPolicy(){return d_caption_policy;}; + //! Set the caption policy + void setCaptionPolicy(CaptionPolicy policy) { d_caption_policy = policy; updateCaption(); } + + //! Return the creation date + QString birthDate(){return d_birthdate;}; + //! Set the creation date + void setBirthDate(const QString& s){d_birthdate = s;}; + + //! Return the window status as a string + QString aspect(); + //! Return the window status flag (hidden, normal, minimized or maximized) + Status status(){return d_status;}; + //! Set the window status flag (hidden, normal, minimized or maximized) + void setStatus(Status s); + + // TODO: + //! Not implemented yet + virtual void restore(const QStringList& ){}; + virtual void save(const QString&, const QString &, bool = false){}; + virtual void exportPDF(const QString&){}; + + // TODO: make this return something useful + //! Size of the widget as a string + virtual QString sizeToString(); + + //!Notifies that a window was hidden by a direct user action + virtual void setHidden(); + + //event handlers + //! Close event handler + /** + * Ask the user "delete, hide, or cancel?" if the + * "ask on close" flag is set. + */ + void closeEvent( QCloseEvent *); + void resizeEvent( QResizeEvent* ); + + //! Toggle the "ask on close" flag + void askOnCloseEvent(bool ask){d_confirm_close = ask;}; + //! Filters other object's events (customizes title bar's context menu) + bool eventFilter(QObject *object, QEvent *e); + //! Returns the pointer to the parent folder of the window + Folder* folder(){return d_folder;}; + + //! Initializes the pointer to the parent folder of the window + void setFolder(Folder* f){d_folder = f;}; + + void setNormal(); + void setMinimized(); + void setMaximized(); + + //! Returns the size the window had before a change state event to minimized. + QSize minRestoreSize(){return d_min_restore_size;}; + + //! Static function used as a workaround for ASCII files having end line char != '\n'. + /* + * It counts the number of valid rows to be imported and the number of first lines to be ignored. + * It creates a temporary file with '\n' terminated lines which can be correctly read by QTextStream + * and returnes a path to this file. + */ + static QString parseAsciiFile(const QString& fname, const QString &commentString, int endLine, + int ignoreFirstLines, int maxRows, int& rows); + +public slots: + virtual void print(){}; + virtual void print(QPrinter *){}; + //! Notifies the main application that the window has been modified + void notifyChanges(){emit modifiedWindow(this);}; + +signals: + //! Emitted when the window was closed + void closedWindow(MdiSubWindow *); + //! Emitted when the window was hidden + void hiddenWindow(MdiSubWindow *); + void modifiedWindow(MdiSubWindow *); + void resizedWindow(MdiSubWindow *); + //! Emitted when the window status changed + void statusChanged(MdiSubWindow *); + //! Show the context menu + void showContextMenu(); + +protected: + //! Catches status changes + virtual void changeEvent(QEvent *event); + +private: + //! Used to parse ASCII files with carriage return ('\r') endline. + static QString parseMacAsciiFile(const QString& fname, const QString &commentString, + int ignoreFirstLines, int maxRows, int& rows); + //! Set caption according to current CaptionPolicy, name and label + void updateCaption(); + //!Pointer to the application window + ApplicationWindow *d_app; + //!Pointer to the parent folder of the window + Folder *d_folder; + //! The window label + /** + * \sa setWindowLabel(), windowLabel(), setCaptionPolicy() + */ + QString d_label; + //! The window status + Status d_status; + //! The caption policy + /** + * \sa setCaptionPolicy(), captionPolicy() + */ + CaptionPolicy d_caption_policy; + //! Toggle on/off: Ask the user "delete, hide, or cancel?" on a close event + bool d_confirm_close; + //! The creation date + QString d_birthdate; + //! Stores the size the window had before a change state event to minimized. + QSize d_min_restore_size; +}; + +#endif === removed file 'qtiplot/src/core/MdiSubWindow.h' --- qtiplot/src/core/MdiSubWindow.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/MdiSubWindow.h 1970-01-01 00:00:00 +0000 @@ -1,205 +0,0 @@ -/*************************************************************************** - File : MdiSubWindow.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de - Description : MDI sub window - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef MdiSubWindow_H -#define MdiSubWindow_H - -#include - -class QEvent; -class QCloseEvent; -class QString; -class Folder; -class ApplicationWindow; - -/** - * \brief Base class of all MDI client windows. - * - * These are the main objects of every Qtiplot project. - * All content (apart from the directory structure) is managed by subclasses of MdiSubWindow. - * - * \section future Future Plans - * Rename to Aspect. - * - * \sa Folder, ApplicationWindow - */ -class MdiSubWindow: public QMdiSubWindow -{ - Q_OBJECT - -public: - - //! Constructor - /** - * \param label window label - * \param parent parent widget - * \param name window name - * \param f window flags - * \sa setCaptionPolicy(), captionPolicy() - */ - MdiSubWindow(const QString& label = QString(), ApplicationWindow *app = 0, const QString& name = QString(), Qt::WFlags f = 0); - - //! Possible window captions. - enum CaptionPolicy{ - Name = 0, //!< caption determined by the window name - Label = 1, //!< caption detemined by the window label - Both = 2 //!< caption = "name - label" - }; - enum Status{Hidden = -1, Normal = 0, Minimized = 1, Maximized = 2}; - - //! Returns a pointer to the parent application - ApplicationWindow *applicationWindow(){return d_app;}; - - //! Return the window label - QString windowLabel(){return QString(d_label);}; - //! Set the window label - void setWindowLabel(const QString& s) { d_label = s; updateCaption();}; - - //! Return the window name - QString name(){return objectName();}; - //! Set the window name - void setName(const QString& s){setObjectName(s); updateCaption();}; - - //! Return the caption policy - CaptionPolicy captionPolicy(){return d_caption_policy;}; - //! Set the caption policy - void setCaptionPolicy(CaptionPolicy policy) { d_caption_policy = policy; updateCaption(); } - - //! Return the creation date - QString birthDate(){return d_birthdate;}; - //! Set the creation date - void setBirthDate(const QString& s){d_birthdate = s;}; - - //! Return the window status as a string - QString aspect(); - //! Return the window status flag (hidden, normal, minimized or maximized) - Status status(){return d_status;}; - //! Set the window status flag (hidden, normal, minimized or maximized) - void setStatus(Status s); - - // TODO: - //! Not implemented yet - virtual void restore(const QStringList& ){}; - virtual void save(const QString&, const QString &, bool = false){}; - virtual void exportPDF(const QString&){}; - - // TODO: make this return something useful - //! Size of the widget as a string - virtual QString sizeToString(); - - //!Notifies that a window was hidden by a direct user action - virtual void setHidden(); - - //event handlers - //! Close event handler - /** - * Ask the user "delete, hide, or cancel?" if the - * "ask on close" flag is set. - */ - void closeEvent( QCloseEvent *); - void resizeEvent( QResizeEvent* ); - - //! Toggle the "ask on close" flag - void askOnCloseEvent(bool ask){d_confirm_close = ask;}; - //! Filters other object's events (customizes title bar's context menu) - bool eventFilter(QObject *object, QEvent *e); - //! Returns the pointer to the parent folder of the window - Folder* folder(){return d_folder;}; - - //! Initializes the pointer to the parent folder of the window - void setFolder(Folder* f){d_folder = f;}; - - void setNormal(); - void setMinimized(); - void setMaximized(); - - //! Returns the size the window had before a change state event to minimized. - QSize minRestoreSize(){return d_min_restore_size;}; - - //! Static function used as a workaround for ASCII files having end line char != '\n'. - /* - * It counts the number of valid rows to be imported and the number of first lines to be ignored. - * It creates a temporary file with '\n' terminated lines which can be correctly read by QTextStream - * and returnes a path to this file. - */ - static QString parseAsciiFile(const QString& fname, const QString &commentString, int endLine, - int ignoreFirstLines, int maxRows, int& rows); - -public slots: - virtual void print(){}; - virtual void print(QPrinter *){}; - //! Notifies the main application that the window has been modified - void notifyChanges(){emit modifiedWindow(this);}; - -signals: - //! Emitted when the window was closed - void closedWindow(MdiSubWindow *); - //! Emitted when the window was hidden - void hiddenWindow(MdiSubWindow *); - void modifiedWindow(MdiSubWindow *); - void resizedWindow(MdiSubWindow *); - //! Emitted when the window status changed - void statusChanged(MdiSubWindow *); - //! Show the context menu - void showContextMenu(); - -protected: - //! Catches status changes - virtual void changeEvent(QEvent *event); - -private: - //! Used to parse ASCII files with carriage return ('\r') endline. - static QString parseMacAsciiFile(const QString& fname, const QString &commentString, - int ignoreFirstLines, int maxRows, int& rows); - //! Set caption according to current CaptionPolicy, name and label - void updateCaption(); - //!Pointer to the application window - ApplicationWindow *d_app; - //!Pointer to the parent folder of the window - Folder *d_folder; - //! The window label - /** - * \sa setWindowLabel(), windowLabel(), setCaptionPolicy() - */ - QString d_label; - //! The window status - Status d_status; - //! The caption policy - /** - * \sa setCaptionPolicy(), captionPolicy() - */ - CaptionPolicy d_caption_policy; - //! Toggle on/off: Ask the user "delete, hide, or cancel?" on a close event - bool d_confirm_close; - //! The creation date - QString d_birthdate; - //! Stores the size the window had before a change state event to minimized. - QSize d_min_restore_size; -}; - -#endif === added file 'qtiplot/src/core/MultiPeakFitTool.cpp' --- qtiplot/src/core/MultiPeakFitTool.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/MultiPeakFitTool.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,150 @@ +/*************************************************************************** + File : MultiPeakFitTool.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006,2007 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de + Description : Plot tool for doing multi-peak fitting. + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "MultiPeakFitTool.h" +#include "RangeSelectorTool.h" +#include "ApplicationWindow.h" +#include "DataPickerTool.h" +#include "cursors.h" + +#include +#include + +#include + +MultiPeakFitTool::MultiPeakFitTool(Graph *graph, ApplicationWindow *app, MultiPeakFit::PeakProfile profile, int num_peaks, const QObject *status_target, const char *status_slot) + : PlotToolInterface(graph), + d_profile(profile), + d_num_peaks(num_peaks) +{ + d_selected_peaks = 0; + d_curve = 0; + + d_fit = new MultiPeakFit(app, d_graph, d_profile, d_num_peaks); + d_fit->enablePeakCurves(app->generatePeakCurves); + d_fit->setPeakCurvesColor(app->peakCurvesColor); + d_fit->generateFunction(app->generateUniformFitPoints, app->fitPoints); + + if (status_target) + connect(this, SIGNAL(statusText(const QString&)), status_target, status_slot); + d_picker_tool = new DataPickerTool(d_graph, app, DataPickerTool::Display, this, SIGNAL(statusText(const QString&))); + d_graph->canvas()->setCursor(QCursor(QPixmap(cursor_xpm), -1, -1)); + + connect(d_picker_tool, SIGNAL(selected(QwtPlotCurve*,int)), this, SLOT(selectPeak(QwtPlotCurve*,int))); + d_graph->canvas()->grabMouse(); + + emit statusText(tr("Move cursor and click to select a point and double-click/press 'Enter' to set the position of a peak!")); +} + +MultiPeakFitTool::~MultiPeakFitTool() +{ + if (d_picker_tool) + delete d_picker_tool; + if (d_fit) + delete d_fit; +} + +void MultiPeakFitTool::selectPeak(QwtPlotCurve *curve, int point_index) +{ + // TODO: warn user + if (!curve || (d_curve && d_curve != curve)) + return; + d_curve = curve; + + d_fit->setInitialGuess(3*d_selected_peaks, curve->y(point_index)); + d_fit->setInitialGuess(3*d_selected_peaks+1, curve->x(point_index)); + + QwtPlotMarker *m = new QwtPlotMarker(); + m->setLineStyle(QwtPlotMarker::VLine); + m->setLinePen(QPen(Qt::green, 2, Qt::DashLine)); + m->setXValue(curve->x(point_index)); + d_graph->insertMarker(m); + d_graph->replot(); + + d_selected_peaks++; + if (d_selected_peaks == d_num_peaks) + finalize(); + else + emit statusText( + tr("Peak %1 selected! Click to select a point and double-click/press 'Enter' to set the position of the next peak!") + .arg(QString::number(d_selected_peaks))); +} + +void MultiPeakFitTool::finalize() +{ + delete d_picker_tool; d_picker_tool = NULL; + d_graph->canvas()->releaseMouse(); + + if (d_fit->setDataFromCurve(d_curve->title().text())){ + QApplication::setOverrideCursor(Qt::WaitCursor); + + double *y = d_fit->y(); + int n = d_fit->dataSize(); + + size_t imin, imax; + gsl_stats_minmax_index(&imin, &imax, y, 1, n); + double temp[n]; + for (int i = 0; i < n; i++) + temp[i] = fabs(y[i]); + size_t imax_temp = gsl_stats_max_index(temp, 1, n); + double offset = 0.0; + if (imax_temp == imax) + offset = y[imin]; + else + offset = y[imax]; + d_fit->setInitialGuess(3*d_selected_peaks, offset); + + double w = 2*gsl_stats_sd(d_fit->x(), 1, n)/(double)d_selected_peaks; + for (int i = 0; i < d_selected_peaks; i++){ + int aux = 3*i; + d_fit->setInitialGuess(aux + 2, w); + double yc = d_fit->initialGuess(aux); + if (d_profile == MultiPeakFit::Lorentz) + d_fit->setInitialGuess(aux, (yc - offset)*M_PI_2*w); + else + d_fit->setInitialGuess(aux, (yc - offset)*sqrt(M_PI_2)*w); + } + + d_fit->fit(); + delete d_fit; d_fit = NULL; + QApplication::restoreOverrideCursor(); + } + + //remove peak line markers + QListmrks = d_graph->markerKeys(); + int n=(int)mrks.count(); + for (int i=0; iremoveMarker(mrks[n-i-1]); + + d_graph->replot(); + if (d_graph->activeTool() && d_graph->activeTool()->rtti() == PlotToolInterface::Rtti_RangeSelector){ + ((RangeSelectorTool *)d_graph->activeTool())->setEnabled(); + } else + d_graph->canvas()->unsetCursor(); + delete this; +} === removed file 'qtiplot/src/core/MultiPeakFitTool.cpp' --- qtiplot/src/core/MultiPeakFitTool.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/MultiPeakFitTool.cpp 1970-01-01 00:00:00 +0000 @@ -1,150 +0,0 @@ -/*************************************************************************** - File : MultiPeakFitTool.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006,2007 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de - Description : Plot tool for doing multi-peak fitting. - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "MultiPeakFitTool.h" -#include "RangeSelectorTool.h" -#include "ApplicationWindow.h" -#include "DataPickerTool.h" -#include "cursors.h" - -#include -#include - -#include - -MultiPeakFitTool::MultiPeakFitTool(Graph *graph, ApplicationWindow *app, MultiPeakFit::PeakProfile profile, int num_peaks, const QObject *status_target, const char *status_slot) - : PlotToolInterface(graph), - d_profile(profile), - d_num_peaks(num_peaks) -{ - d_selected_peaks = 0; - d_curve = 0; - - d_fit = new MultiPeakFit(app, d_graph, d_profile, d_num_peaks); - d_fit->enablePeakCurves(app->generatePeakCurves); - d_fit->setPeakCurvesColor(app->peakCurvesColor); - d_fit->generateFunction(app->generateUniformFitPoints, app->fitPoints); - - if (status_target) - connect(this, SIGNAL(statusText(const QString&)), status_target, status_slot); - d_picker_tool = new DataPickerTool(d_graph, app, DataPickerTool::Display, this, SIGNAL(statusText(const QString&))); - d_graph->canvas()->setCursor(QCursor(QPixmap(cursor_xpm), -1, -1)); - - connect(d_picker_tool, SIGNAL(selected(QwtPlotCurve*,int)), this, SLOT(selectPeak(QwtPlotCurve*,int))); - d_graph->canvas()->grabMouse(); - - emit statusText(tr("Move cursor and click to select a point and double-click/press 'Enter' to set the position of a peak!")); -} - -MultiPeakFitTool::~MultiPeakFitTool() -{ - if (d_picker_tool) - delete d_picker_tool; - if (d_fit) - delete d_fit; -} - -void MultiPeakFitTool::selectPeak(QwtPlotCurve *curve, int point_index) -{ - // TODO: warn user - if (!curve || (d_curve && d_curve != curve)) - return; - d_curve = curve; - - d_fit->setInitialGuess(3*d_selected_peaks, curve->y(point_index)); - d_fit->setInitialGuess(3*d_selected_peaks+1, curve->x(point_index)); - - QwtPlotMarker *m = new QwtPlotMarker(); - m->setLineStyle(QwtPlotMarker::VLine); - m->setLinePen(QPen(Qt::green, 2, Qt::DashLine)); - m->setXValue(curve->x(point_index)); - d_graph->insertMarker(m); - d_graph->replot(); - - d_selected_peaks++; - if (d_selected_peaks == d_num_peaks) - finalize(); - else - emit statusText( - tr("Peak %1 selected! Click to select a point and double-click/press 'Enter' to set the position of the next peak!") - .arg(QString::number(d_selected_peaks))); -} - -void MultiPeakFitTool::finalize() -{ - delete d_picker_tool; d_picker_tool = NULL; - d_graph->canvas()->releaseMouse(); - - if (d_fit->setDataFromCurve(d_curve->title().text())){ - QApplication::setOverrideCursor(Qt::WaitCursor); - - double *y = d_fit->y(); - int n = d_fit->dataSize(); - - size_t imin, imax; - gsl_stats_minmax_index(&imin, &imax, y, 1, n); - double temp[n]; - for (int i = 0; i < n; i++) - temp[i] = fabs(y[i]); - size_t imax_temp = gsl_stats_max_index(temp, 1, n); - double offset = 0.0; - if (imax_temp == imax) - offset = y[imin]; - else - offset = y[imax]; - d_fit->setInitialGuess(3*d_selected_peaks, offset); - - double w = 2*gsl_stats_sd(d_fit->x(), 1, n)/(double)d_selected_peaks; - for (int i = 0; i < d_selected_peaks; i++){ - int aux = 3*i; - d_fit->setInitialGuess(aux + 2, w); - double yc = d_fit->initialGuess(aux); - if (d_profile == MultiPeakFit::Lorentz) - d_fit->setInitialGuess(aux, (yc - offset)*M_PI_2*w); - else - d_fit->setInitialGuess(aux, (yc - offset)*sqrt(M_PI_2)*w); - } - - d_fit->fit(); - delete d_fit; d_fit = NULL; - QApplication::restoreOverrideCursor(); - } - - //remove peak line markers - QListmrks = d_graph->markerKeys(); - int n=(int)mrks.count(); - for (int i=0; iremoveMarker(mrks[n-i-1]); - - d_graph->replot(); - if (d_graph->activeTool() && d_graph->activeTool()->rtti() == PlotToolInterface::Rtti_RangeSelector){ - ((RangeSelectorTool *)d_graph->activeTool())->setEnabled(); - } else - d_graph->canvas()->unsetCursor(); - delete this; -} === added file 'qtiplot/src/core/MultiPeakFitTool.h' --- qtiplot/src/core/MultiPeakFitTool.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/MultiPeakFitTool.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,74 @@ +/*************************************************************************** + File : MultiPeakFitTool.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006,2007 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de + Description : Plot tool for doing multi-peak fitting. + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef MULTI_PEAK_FIT_TOOL +#define MULTI_PEAK_FIT_TOOL + +#include "PlotToolInterface.h" +#include "MultiPeakFit.h" +#include + +class DataPickerTool; +class ApplicationWindow; +class QwtPlotCurve; + +/*! Plot tool for doing multi-peak fitting. + * + * This class can be seen as a user-interface wrapper around MultiPeakFit, providing functionality for visually + * selecting estimated peak positions and finally executing the fit. + * + * Maybe some other parts of the multi-peak fitting process (namely, specifying the number of peaks and optionally + * the peak profile) could be moved here as well. + */ +class MultiPeakFitTool : public QObject, public PlotToolInterface +{ + Q_OBJECT + public: + MultiPeakFitTool(Graph *graph, ApplicationWindow *app, MultiPeakFit::PeakProfile profile, int num_peaks, const QObject *status_target, const char *status_slot); + virtual ~MultiPeakFitTool(); + + virtual int rtti() const {return PlotToolInterface::Rtti_MultiPeakFitTool;}; + signals: + /*! Emitted whenever a new message should be presented to the user. + * + * You don't have to connect to this signal if you alreay specified a reciever during initialization. + */ + void statusText(const QString&); + protected slots: + void selectPeak(QwtPlotCurve *curve, int point_index); + private: + void finalize(); + MultiPeakFit::PeakProfile d_profile; + int d_num_peaks, d_selected_peaks; + DataPickerTool *d_picker_tool; + MultiPeakFit *d_fit; + QwtPlotCurve *d_curve; +}; + +#endif // ifndef MULTI_PEAK_FIT_TOOL + === removed file 'qtiplot/src/core/MultiPeakFitTool.h' --- qtiplot/src/core/MultiPeakFitTool.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/MultiPeakFitTool.h 1970-01-01 00:00:00 +0000 @@ -1,74 +0,0 @@ -/*************************************************************************** - File : MultiPeakFitTool.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006,2007 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de - Description : Plot tool for doing multi-peak fitting. - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef MULTI_PEAK_FIT_TOOL -#define MULTI_PEAK_FIT_TOOL - -#include "PlotToolInterface.h" -#include "MultiPeakFit.h" -#include - -class DataPickerTool; -class ApplicationWindow; -class QwtPlotCurve; - -/*! Plot tool for doing multi-peak fitting. - * - * This class can be seen as a user-interface wrapper around MultiPeakFit, providing functionality for visually - * selecting estimated peak positions and finally executing the fit. - * - * Maybe some other parts of the multi-peak fitting process (namely, specifying the number of peaks and optionally - * the peak profile) could be moved here as well. - */ -class MultiPeakFitTool : public QObject, public PlotToolInterface -{ - Q_OBJECT - public: - MultiPeakFitTool(Graph *graph, ApplicationWindow *app, MultiPeakFit::PeakProfile profile, int num_peaks, const QObject *status_target, const char *status_slot); - virtual ~MultiPeakFitTool(); - - virtual int rtti() const {return PlotToolInterface::Rtti_MultiPeakFitTool;}; - signals: - /*! Emitted whenever a new message should be presented to the user. - * - * You don't have to connect to this signal if you alreay specified a reciever during initialization. - */ - void statusText(const QString&); - protected slots: - void selectPeak(QwtPlotCurve *curve, int point_index); - private: - void finalize(); - MultiPeakFit::PeakProfile d_profile; - int d_num_peaks, d_selected_peaks; - DataPickerTool *d_picker_tool; - MultiPeakFit *d_fit; - QwtPlotCurve *d_curve; -}; - -#endif // ifndef MULTI_PEAK_FIT_TOOL - === added file 'qtiplot/src/core/OdsFileHandler.cpp' --- qtiplot/src/core/OdsFileHandler.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/OdsFileHandler.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,165 @@ +/*************************************************************************** + File : OdsFileHandler.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2009 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : An XML handler for parsing Open Document Format Spreadsheets (.ods) + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "OdsFileHandler.h" +#include "ApplicationWindow.h" + +OdsFileHandler::OdsFileHandler(ApplicationWindow *app, const QString& odsFileName) : +d_app(app), +d_ods_file_name(odsFileName) + { + d_rows = 0; + d_col = 0; + d_last_column = 0; + } + + bool OdsFileHandler::startElement(const QString & /* namespaceURI */, + const QString & /* localName */, + const QString &qName, + const QXmlAttributes &attributes) + { + if (qName == "table:table" && !attributes.value("table:name").isEmpty()) + d_sheet_names << attributes.value("table:name"); + + if (qName == "table:table-row"){ + if (!attributes.value("table:number-rows-repeated").isEmpty()) + d_rows += attributes.value("table:number-rows-repeated").toInt(); + else + d_rows++; + } + + if (qName == "table:table-cell"){ + cell_data cell = {d_rows - 1, 0, 0.0, "", EmptyCell}; + QString type = attributes.value("office:value-type"); + if (type == QString("float")){ + cell.d = attributes.value("office:value").toDouble(); + cell.type = Float; + } else if (type == QString("percentage")){ + cell.d = attributes.value("office:value").toDouble(); + cell.type = Percent; + } else if (type == QString("currency")){ + cell.d = attributes.value("office:value").toDouble(); + cell.type = Currency; + } else if (type == QString("boolean")){ + cell.d = attributes.value("office:value").toDouble(); + cell.type = Boolean; + } else if (type == QString("date")){ + cell.type = Date; + } else if (type == QString("time")){ + cell.type = Time; + } else if (type == QString("string")) + cell.type = String; + + cell.col = d_col; + + int repeatCols = 1; + if (!attributes.value("table:number-columns-repeated").isEmpty()) + repeatCols = attributes.value("table:number-columns-repeated").toInt(); + + int spannedCols = 1; + if (!attributes.value("table:number-columns-spanned").isEmpty()) + spannedCols = attributes.value("table:number-columns-spanned").toInt(); + + if (cell.type != EmptyCell){ + for (int i = 0; i < repeatCols; i++){ + cell.col = d_col + i; + cells.push_back(cell); + } + } + + if (repeatCols > 1) + d_col += repeatCols; + else + d_col++; + + if (spannedCols > 1) + d_col += spannedCols - 1; + } + + currentText.clear(); + return true; + } + +bool OdsFileHandler::endElement(const QString & /* namespaceURI */, + const QString & /* localName */, + const QString &qName) +{ + if (qName == "table:table-row"){ + int col = 0; + if (!cells.empty()) + col = cells[cells.size() - 1].col; + + if (col > d_last_column) + d_last_column = col; + + d_col = 0; //reset column index to 0 + } + + if (qName == "text:p") + cells[cells.size() - 1].str = currentText; + + if (qName == "table:table"){ + if (!cells.empty() && (d_last_column > 1 || d_rows > 1)){ + Table *t = d_app->newTable(d_rows, d_last_column + 1, QString::null, d_ods_file_name + ", " + d_sheet_names.last()); + int n = cells.size(); + for (int i = 0; i < n; i++){ + cell_data cell = cells[i]; + if (cell.type == Float) + t->setCell(cell.row, cell.col, cell.d); + else + t->setText(cell.row, cell.col, cell.str); + } + t->showNormal(); + d_tables << t; + } else + d_sheet_names.removeLast(); + + d_last_column = 0; + d_rows = 0; + cells.clear(); + } + return true; + } + + bool OdsFileHandler::characters(const QString &str) + { + currentText += str; + return true; + } + + QString OdsFileHandler::errorString() const + { + return errorStr; + } + + Table *OdsFileHandler::sheet(int index) + { + if (index >= 0 && index < d_tables.size()) + return d_tables[index]; + return NULL; + } === added file 'qtiplot/src/core/OdsFileHandler.h' --- qtiplot/src/core/OdsFileHandler.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/OdsFileHandler.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,82 @@ +/*************************************************************************** + File : OdsFileHandler.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2009 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : An XML handler for parsing Open Document Format Spreadsheets (.ods) + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef OdsFileHandler_H +#define OdsFileHandler_H + +#include +#include + +class ApplicationWindow; +class Table; + +class OdsFileHandler : public QXmlDefaultHandler +{ +public: + OdsFileHandler(ApplicationWindow *app, const QString& odsFileName); + + bool startElement(const QString &namespaceURI, const QString &localName, + const QString &qName, const QXmlAttributes &attributes); + bool endElement(const QString &namespaceURI, const QString &localName, + const QString &qName); + bool characters(const QString &str); + bool fatalError(const QXmlParseException &){return false;}; + QString errorString() const; + + Table *sheet(int index); + int sheetsCount(){return d_tables.size();}; + +private: + ApplicationWindow * d_app; + QString d_ods_file_name; + QString currentText; + QString errorStr; + //Index of the last non-empty cell in a sheet + int d_last_column; + //Total number of rows in a sheet + int d_rows; + //Current column in a row + int d_col; + + enum CellType {EmptyCell = 0, Float, String, Date, Time, Boolean, Currency, Percent}; + + struct cell_data{ + int row; + int col; + double d; + QString str; + CellType type; + }; + + std::vector cells; + + QStringList d_sheet_names; + QList

d_tables; +}; + +#endif === added file 'qtiplot/src/core/OpenProjectDialog.cpp' --- qtiplot/src/core/OpenProjectDialog.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/OpenProjectDialog.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,110 @@ +/*************************************************************************** + File : OpenProjectDialog.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2007 by Knut Franke, Ion Vasilief + Email (use @ for *) : knut.franke*gmx.de, ion_vasilief*yahoo.fr + Description : Dialog for opening project files. + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + +#include "OpenProjectDialog.h" +#include "ApplicationWindow.h" + +#include +#include +#include + +OpenProjectDialog::OpenProjectDialog(QWidget *parent, bool extended, Qt::WFlags flags) + : ExtensibleFileDialog(parent, extended, flags) +{ + setCaption(tr("QtiPlot - Open Project")); + setFileMode(ExistingFile); + QStringList filters; + filters << tr("QtiPlot project") + " (*.qti)" + << tr("Compressed QtiPlot project") + " (*.qti.gz)" +#ifdef OPJ_IMPORT + << tr("Origin project") + " (*.opj *.OPJ)" + << tr("Origin matrix") + " (*.ogm *.OGM)" + << tr("Origin worksheet") + " (*.ogw *.OGW)" + << tr("Origin graph") + " (*.ogg *.OGG)" +#endif + << tr("Backup files") + " (*.qti~)" +#ifdef XLS_IMPORT + << tr("Excel") + " (*.xls)" +#endif +#ifdef ODS_IMPORT + << tr("ODF Spreadsheet") + " (*.ods)" +#endif + << tr("All files") + " (*)"; + setFilters(filters); + + QWidget *advanced_options = new QWidget(); + QHBoxLayout *advanced_layout = new QHBoxLayout(); + advanced_options->setLayout(advanced_layout); + advanced_layout->addWidget(new QLabel(tr("Open As"))); + d_open_mode = new QComboBox(); + // Important: Keep this is sync with enum OpenMode. + d_open_mode->addItem(tr("New Project Window")); + d_open_mode->addItem(tr("New Folder")); + advanced_layout->addWidget(d_open_mode); + setExtensionWidget(advanced_options); + +#if QT_VERSION >= 0x040300 + connect(this, SIGNAL(filterSelected ( const QString & )), + this, SLOT(updateAdvancedOptions ( const QString & ))); +#else + QList combo_boxes = findChildren(); + if (combo_boxes.size() >= 2) + connect(combo_boxes[1], SIGNAL(currentIndexChanged ( const QString & )), + this, SLOT(updateAdvancedOptions ( const QString & ))); +#endif + + ApplicationWindow *app = qobject_cast(parent); + if (app){ + selectNameFilter(app->d_open_project_filter); + updateAdvancedOptions(app->d_open_project_filter); + } +} + +void OpenProjectDialog::updateAdvancedOptions (const QString & filter) +{ + if (filter.contains("*.ogm") || filter.contains("*.ogw") || filter.contains("*.xls")) { + d_extension_toggle->setChecked(false); + d_extension_toggle->setEnabled(false); + return; + } + d_extension_toggle->setEnabled(true); +} + +void OpenProjectDialog::closeEvent(QCloseEvent* e) +{ + if (isExtendable()){ + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + if (app){ + app->d_extended_open_dialog = this->isExtended(); + app->d_open_project_filter = selectedNameFilter(); + } + } + + e->accept(); +} === removed file 'qtiplot/src/core/OpenProjectDialog.cpp' --- qtiplot/src/core/OpenProjectDialog.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/OpenProjectDialog.cpp 1970-01-01 00:00:00 +0000 @@ -1,98 +0,0 @@ -/*************************************************************************** - File : OpenProjectDialog.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2007 by Knut Franke, Ion Vasilief - Email (use @ for *) : knut.franke*gmx.de, ion_vasilief*yahoo.fr - Description : Dialog for opening project files. - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#include "OpenProjectDialog.h" -#include "ApplicationWindow.h" - -#include -#include -#include - -OpenProjectDialog::OpenProjectDialog(QWidget *parent, bool extended, Qt::WFlags flags) - : ExtensibleFileDialog(parent, extended, flags) -{ - setCaption(tr("QtiPlot - Open Project")); - setFileMode(ExistingFile); - QStringList filters; - filters << tr("QtiPlot project") + " (*.qti)" - << tr("Compressed QtiPlot project") + " (*.qti.gz)" - << tr("Origin project") + " (*.opj *.OPJ)" - << tr("Origin matrix") + " (*.ogm *.OGM)" - << tr("Origin worksheet") + " (*.ogw *.OGW)" - << tr("Origin graph") + " (*.ogg *.OGG)" - << tr("Backup files") + " (*.qti~)" - //<< tr("Python Source") + " (*.py *.PY)" - << tr("All files") + " (*)"; - setFilters(filters); - - QWidget *advanced_options = new QWidget(); - QHBoxLayout *advanced_layout = new QHBoxLayout(); - advanced_options->setLayout(advanced_layout); - advanced_layout->addWidget(new QLabel(tr("Open As"))); - d_open_mode = new QComboBox(); - // Important: Keep this is sync with enum OpenMode. - d_open_mode->addItem(tr("New Project Window")); - d_open_mode->addItem(tr("New Folder")); - advanced_layout->addWidget(d_open_mode); - setExtensionWidget(advanced_options); - -#if QT_VERSION >= 0x040300 - connect(this, SIGNAL(filterSelected ( const QString & )), - this, SLOT(updateAdvancedOptions ( const QString & ))); -#else - QList combo_boxes = findChildren(); - if (combo_boxes.size() >= 2) - connect(combo_boxes[1], SIGNAL(currentIndexChanged ( const QString & )), - this, SLOT(updateAdvancedOptions ( const QString & ))); -#endif - updateAdvancedOptions(selectedFilter()); -} - -void OpenProjectDialog::updateAdvancedOptions (const QString & filter) -{ - if (filter.contains("*.ogm") || filter.contains("*.ogw")) { - d_extension_toggle->setChecked(false); - d_extension_toggle->setEnabled(false); - return; - } - d_extension_toggle->setEnabled(true); -} - -void OpenProjectDialog::closeEvent(QCloseEvent* e) -{ - if (isExtendable()){ - ApplicationWindow *app = (ApplicationWindow *)this->parent(); - if (app){ - app->d_extended_open_dialog = this->isExtended(); - app->d_open_project_filter = selectedNameFilter(); - } - } - - e->accept(); -} === added file 'qtiplot/src/core/OpenProjectDialog.h' --- qtiplot/src/core/OpenProjectDialog.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/OpenProjectDialog.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,53 @@ +/*************************************************************************** + File : OpenProjectDialog.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2007 by Knut Franke, Ion Vasilief + Email (use @ for *) : knut.franke*gmx.de, ion_vasilief*yahoo.fr + Description : Dialog for opening project files. + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef OPEN_PROJECT_DIALOG_H +#define OPEN_PROJECT_DIALOG_H + +#include + +#include + +class OpenProjectDialog : public ExtensibleFileDialog +{ + Q_OBJECT + public: + enum OpenMode { NewProject, NewFolder }; + OpenProjectDialog(QWidget *parent=0, bool extended = true, Qt::WFlags flags=0); + OpenMode openMode() const { return (OpenMode) d_open_mode->currentIndex(); } + + private: + QComboBox *d_open_mode; + + protected slots: + void closeEvent(QCloseEvent* ); + //! Update which options are visible and enabled based on the output format. + void updateAdvancedOptions (const QString &filter); +}; + +#endif // ifndef OPEN_PROJECT_DIALOG_H === removed file 'qtiplot/src/core/OpenProjectDialog.h' --- qtiplot/src/core/OpenProjectDialog.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/OpenProjectDialog.h 1970-01-01 00:00:00 +0000 @@ -1,53 +0,0 @@ -/*************************************************************************** - File : OpenProjectDialog.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2007 by Knut Franke, Ion Vasilief - Email (use @ for *) : knut.franke*gmx.de, ion_vasilief*yahoo.fr - Description : Dialog for opening project files. - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef OPEN_PROJECT_DIALOG_H -#define OPEN_PROJECT_DIALOG_H - -#include - -#include - -class OpenProjectDialog : public ExtensibleFileDialog -{ - Q_OBJECT - public: - enum OpenMode { NewProject, NewFolder }; - OpenProjectDialog(QWidget *parent=0, bool extended = true, Qt::WFlags flags=0); - OpenMode openMode() const { return (OpenMode) d_open_mode->currentIndex(); } - - private: - QComboBox *d_open_mode; - - protected slots: - void closeEvent(QCloseEvent* ); - //! Update which options are visible and enabled based on the output format. - void updateAdvancedOptions (const QString &filter); -}; - -#endif // ifndef OPEN_PROJECT_DIALOG_H === added file 'qtiplot/src/core/PlotWizard.cpp' --- qtiplot/src/core/PlotWizard.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/PlotWizard.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,466 @@ +/*************************************************************************** + File : PlotWizard.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2004 - 2010 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : A wizard type dialog to create new plots + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "PlotWizard.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +PlotWizard::PlotWizard( QWidget* parent, Qt::WFlags fl ) +: QDialog( parent, fl ) +{ + setWindowTitle( tr("QtiPlot - Select Columns to Plot") ); + setAttribute(Qt::WA_DeleteOnClose); + setSizeGripEnabled( true ); + + // top part starts here + groupBox1 = new QGroupBox(); + + QGridLayout *gl1 = new QGridLayout(); + buttonX = new QPushButton("<->" + tr("&X")); + buttonX->setAutoDefault( false ); + gl1->addWidget( buttonX, 0, 0); + + buttonXErr = new QPushButton("<->" + tr("x&Err")); + buttonXErr->setAutoDefault( false ); + gl1->addWidget( buttonXErr, 0, 1); + + buttonY = new QPushButton("<->" + tr("&Y")); + buttonY->setAutoDefault( false ); + gl1->addWidget( buttonY, 1, 0); + + buttonYErr = new QPushButton("<->" + tr("yE&rr")); + buttonYErr->setAutoDefault( false ); + gl1->addWidget( buttonYErr, 1, 1); + + buttonZ = new QPushButton("<->" + tr("&Z")); + buttonZ->setAutoDefault( false ); + gl1->addWidget( buttonZ, 2, 0); + gl1->setRowStretch(3,1); + + QHBoxLayout *hl2 = new QHBoxLayout(); + buttonNew = new QPushButton(tr("&New curve")); + buttonNew->setDefault( true ); + buttonNew->setAutoDefault( true ); + hl2->addWidget(buttonNew); + + buttonDelete = new QPushButton(tr("&Delete curve")); + buttonDelete->setAutoDefault( false ); + hl2->addWidget(buttonDelete); + + QVBoxLayout *vl = new QVBoxLayout(); + vl->addLayout(gl1); + vl->addStretch(); + vl->addLayout(hl2); + + QGridLayout *gl2 = new QGridLayout(groupBox1); + gl2->addWidget(new QLabel(tr( "Worksheet" )), 0, 0); + boxTables = new QComboBox(); + gl2->addWidget(boxTables, 0, 1); + columnsList = new QListWidget(); + gl2->addWidget(columnsList, 1, 0); + gl2->addLayout(vl, 1, 1); + + // middle part is only one widget + plotAssociations = new QListWidget(); + + // bottom part starts here + QHBoxLayout * bottomLayout = new QHBoxLayout(); + bottomLayout->addStretch(); + + buttonOk = new QPushButton(tr("&Plot")); + buttonOk->setAutoDefault( false ); + bottomLayout->addWidget( buttonOk ); + + buttonCancel = new QPushButton(tr("&Close")); + buttonCancel->setAutoDefault( false ); + bottomLayout->addWidget( buttonCancel ); + + QVBoxLayout* vlayout = new QVBoxLayout( this ); + vlayout->addWidget( groupBox1 ); + vlayout->addWidget( plotAssociations ); + vlayout->addLayout( bottomLayout ); + + // signals and slots connections + connect( boxTables, SIGNAL(activated(const QString &)),this, SLOT(changeColumnsList(const QString &))); + connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); + connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( buttonNew, SIGNAL( clicked() ), this, SLOT( addCurve() ) ); + connect( buttonDelete, SIGNAL( clicked() ), this, SLOT( removeCurve() ) ); + connect( buttonX, SIGNAL( clicked() ), this, SLOT(addXCol())); + connect( buttonY, SIGNAL( clicked() ), this, SLOT(addYCol())); + connect( buttonXErr, SIGNAL( clicked() ), this, SLOT(addXErrCol())); + connect( buttonYErr, SIGNAL( clicked() ), this, SLOT(addYErrCol())); + connect( buttonZ, SIGNAL( clicked() ), this, SLOT(addZCol())); +} + +QSize PlotWizard::sizeHint() const +{ + return QSize(350, 400); +} + +void PlotWizard::accept() +{ + QStringList curves, curves3D, ribbons; + for (int i=0; i < plotAssociations->count(); i++) + { + QString text = plotAssociations->item(i)->text(); + if (text.endsWith("(X)")) + { + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("Please define a Y column for the following curve") + ":\n\n" + text); + return; + } + + if ( text.contains("(Z)") ) + { + if ( text.contains("(Y)") && !curves3D.contains(text) ) + curves3D << text; + else if ( !text.contains("(Y)") && !ribbons.contains(text) ) + ribbons << text; + } + else if ( text.contains("(xErr)") || text.contains("(yErr)")) + { + QStringList lst = text.split(",", QString::SkipEmptyParts); + lst.pop_back(); + QString master_curve = lst.join(","); + + if (!curves.contains(master_curve)) + curves.prepend(master_curve); + + if (!curves.contains(text)) + curves << text; //add error bars at the end of the list. + } + else if (!curves.contains(text)) + curves.prepend(text); + } + + if (curves.count()>0) + plot2D(curves); + + if (curves3D.count()>0) + plot3D(curves3D); + + if (ribbons.count()>0) + plot3DRibbon(ribbons); + + if(!noCurves()) + close(); +} + +void PlotWizard::changeColumnsList(const QString &table) +{ + QStringList newList; + + for( int i=0 ; icurrentItem()->text(); + if ( text.contains("(X)") ) + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You have already defined a X column!")); + else + { + plotAssociations->currentItem()->setText(text+columnsList->currentItem()->text()+"(X)"); + } +} + +void PlotWizard::addYCol() +{ + if (noCurves()) + return; + + QString text = plotAssociations->currentItem()->text(); + if ( !text.contains("(X)") ) + QMessageBox::warning(this, tr("QtiPlot - Error"),tr("You must define a X column first!")); + else if ( text.contains("(Y)") ) + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You have already defined a Y column!")); + else + { + plotAssociations->currentItem()->setText(text+", "+columnsList->currentItem()->text()+"(Y)"); + } +} + +void PlotWizard::addZCol() +{ + if (noCurves()) + return; + + QString text = plotAssociations->currentItem()->text(); + if ( text.contains("(xErr)") || text.contains("(yErr)") ) + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("This kind of curve is not handled by QtiPlot!")); + else if ( !text.contains("(X)") ) + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You must define a X column first!")); + else if ( text.contains("(Z)") ) + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You have already defined a Z column!")); + else + { + plotAssociations->currentItem()->setText(text+", "+columnsList->currentItem()->text()+"(Z)"); + } +} + +void PlotWizard::addXErrCol() +{ + if (noCurves()) + return; + + QString text = plotAssociations->currentItem()->text(); + if ( text.contains("(Z)") ) + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("This kind of curve is not handled by QtiPlot!")); + else if ( !text.contains("(X)") ) + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You must define a X column first!")); + else if ( !text.contains("(Y)") ) + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You must define a Y column first!")); + else if ( text.contains("(xErr)") || text.contains("(yErr)") ) + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You have already defined an error-bars column!")); + else + { + plotAssociations->currentItem()->setText(text+", "+columnsList->currentItem()->text()+"(xErr)"); + } +} + +void PlotWizard::addYErrCol() +{ + if (noCurves()) + return; + + QString text = plotAssociations->currentItem()->text(); + if ( text.contains("(Z)") ) + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("This kind of curve is not handled by QtiPlot!")); + else if ( !text.contains("(X)") ) + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You must define a X column first!")); + else if ( !text.contains("(Y)") ) + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You must define a Y column first!")); + else if ( text.contains("(xErr)") || text.contains("(yErr)") ) + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You have already defined an error-bars column!")); + else + { + plotAssociations->currentItem()->setText(text+", "+columnsList->currentItem()->text()+"(yErr)"); + } +} + +void PlotWizard::addCurve() +{ + plotAssociations->addItem( boxTables->currentText() + ": " ); + plotAssociations->setCurrentRow( plotAssociations->count()-1 ); +} + +void PlotWizard::removeCurve() +{ + plotAssociations->takeItem( plotAssociations->currentRow() ); +} + +void PlotWizard::insertTablesList(const QStringList& tables) +{ + boxTables->addItems(tables); +} + +void PlotWizard::setColumnsListBoxContents(const QStringList& cols) +{ + columnsList->clear(); + columnsList->insertItems(0, cols); + columnsList->setCurrentRow(0); +} + +void PlotWizard::setColumnsList(const QStringList& cols) +{ + columns = cols; +} + +bool PlotWizard::noCurves() +{ + if ( plotAssociations->count() == 0 ) + { + QMessageBox::warning(0, tr("QtiPlot - Error"), tr("You must add a new curve first!")); + return true; + } + else + return false; +} + +void PlotWizard::plot3DRibbon(const QStringList& lst) +{ + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + if (!app) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + for (int i=0; i< lst.count(); i++) + { + QString s = lst[i]; + int pos = s.find(":", 0); + QString table_name = s.left(pos) + "_"; + Table *t = app->table(table_name); + if (t) + { + int posX = s.find("(", pos); + QString xColName = table_name + s.mid(pos+2, posX-pos-2); + + posX = s.find(",", posX); + int posY = s.find("(", posX); + QString yColName = table_name + s.mid(posX+2, posY-posX-2); + + Graph3D *g = app->newPlot3D(); + if (g) { + g->addRibbon(t, xColName, yColName); + g->setDataColorMap(app->d_3D_color_map); + g->update(); + } + } + } + QApplication::restoreOverrideCursor(); +} + +void PlotWizard::plot3D(const QStringList& lst) +{ + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + if (!app) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + for (int i=0; i< lst.count(); i++) + { + QString s = lst[i]; + int pos = s.find(":", 0); + QString table_name = s.left(pos) + "_"; + Table *t = app->table(table_name); + if (t) + { + int posX = s.find("(", pos); + QString xColName = table_name + s.mid(pos+2, posX-pos-2); + + posX = s.find(",", posX); + int posY = s.find("(", posX); + QString yColName = table_name + s.mid(posX+2, posY-posX-2); + + posY = s.find(",", posY); + int posZ = s.find("(", posY); + QString zColName = table_name + s.mid(posY+2, posZ-posY-2); + + int xCol = t->colIndex(xColName); + int yCol = t->colIndex(yColName); + int zCol = t->colIndex(zColName); + if (xCol >= 0 && yCol >= 0 && zCol >= 0) { + Graph3D *g = app->newPlot3D(); + if (g) + g->addData(t, xCol, yCol, zCol, 1); + } + } + } + QApplication::restoreOverrideCursor(); +} + +void PlotWizard::plot2D(const QStringList& colList) +{ + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + if (!app) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + MultiLayer* g = new MultiLayer(app); + app->initMultilayerPlot(g, ""); + + Graph *ag = g->activeLayer(); + app->setPreferences(ag); + + int curves = (int)colList.count(); + int errorBars = 0; + for (int i = 0; i < curves; i++) { + if (colList[i].contains("(yErr)") || colList[i].contains("(xErr)")) + errorBars++; + } + + for (int i = 0; i < curves; i++){ + QString s = colList[i]; + int pos = s.find(":", 0); + QString caption = s.left(pos) + "_"; + Table *w = (Table *)app->table(caption); + + int posX = s.find("(X)", pos); + QString xColName = caption + s.mid(pos+2, posX-pos-2); + + posX = s.find(",", posX); + int posY = s.find("(Y)", posX); + QString yColName = caption+s.mid(posX+2, posY-posX-2); + + PlotCurve *c = NULL; + if (s.contains("(yErr)") || s.contains("(xErr)")){ + posY = s.find(",", posY); + int posErr, errType; + if (s.contains("(yErr)")){ + errType = QwtErrorPlotCurve::Vertical; + posErr = s.find("(yErr)", posY); + } else { + errType = QwtErrorPlotCurve::Horizontal; + posErr = s.find("(xErr)",posY); + } + + QString errColName = caption+s.mid(posY+2, posErr-posY-2); + c = (PlotCurve *)ag->addErrorBars(xColName, yColName, w, errColName, errType); + } else + c = (PlotCurve *)ag->insertCurve(w, xColName, yColName, app->defaultCurveStyle); + + CurveLayout cl = ag->initCurveLayout(app->defaultCurveStyle, curves - errorBars); + cl.lWidth = app->defaultCurveLineWidth; + cl.sSize = app->defaultSymbolSize; + ag->updateCurveLayout(c, &cl); + } + ag->updatePlot(); + ag->newLegend(); + g->arrangeLayers(false, true); + QApplication::restoreOverrideCursor(); +} === removed file 'qtiplot/src/core/PlotWizard.cpp' --- qtiplot/src/core/PlotWizard.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/PlotWizard.cpp 1970-01-01 00:00:00 +0000 @@ -1,400 +0,0 @@ -/*************************************************************************** - File : PlotWizard.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : A wizard type dialog to create new plots - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "PlotWizard.h" -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -PlotWizard::PlotWizard( QWidget* parent, Qt::WFlags fl ) -: QDialog( parent, fl ) -{ - setWindowTitle( tr("QtiPlot - Select Columns to Plot") ); - - setSizeGripEnabled( true ); - - // top part starts here - groupBox1 = new QGroupBox(); - - QGridLayout *gl1 = new QGridLayout(); - buttonX = new QPushButton("<->" + tr("&X")); - buttonX->setAutoDefault( false ); - gl1->addWidget( buttonX, 0, 0); - - buttonXErr = new QPushButton("<->" + tr("x&Err")); - buttonXErr->setAutoDefault( false ); - gl1->addWidget( buttonXErr, 0, 1); - - buttonY = new QPushButton("<->" + tr("&Y")); - buttonY->setAutoDefault( false ); - gl1->addWidget( buttonY, 1, 0); - - buttonYErr = new QPushButton("<->" + tr("yE&rr")); - buttonYErr->setAutoDefault( false ); - gl1->addWidget( buttonYErr, 1, 1); - - buttonZ = new QPushButton("<->" + tr("&Z")); - buttonZ->setAutoDefault( false ); - gl1->addWidget( buttonZ, 2, 0); - gl1->setRowStretch(3,1); - - QHBoxLayout *hl2 = new QHBoxLayout(); - buttonNew = new QPushButton(tr("&New curve")); - buttonNew->setDefault( true ); - buttonNew->setAutoDefault( true ); - hl2->addWidget(buttonNew); - - buttonDelete = new QPushButton(tr("&Delete curve")); - buttonDelete->setAutoDefault( false ); - hl2->addWidget(buttonDelete); - - QVBoxLayout *vl = new QVBoxLayout(); - vl->addLayout(gl1); - vl->addStretch(); - vl->addLayout(hl2); - - QGridLayout *gl2 = new QGridLayout(groupBox1); - gl2->addWidget(new QLabel(tr( "Worksheet" )), 0, 0); - boxTables = new QComboBox(); - gl2->addWidget(boxTables, 0, 1); - columnsList = new QListWidget(); - gl2->addWidget(columnsList, 1, 0); - gl2->addLayout(vl, 1, 1); - - // middle part is only one widget - plotAssociations = new QListWidget(); - - // bottom part starts here - QHBoxLayout * bottomLayout = new QHBoxLayout(); - bottomLayout->addStretch(); - - buttonOk = new QPushButton(tr("&Plot")); - buttonOk->setAutoDefault( false ); - bottomLayout->addWidget( buttonOk ); - - buttonCancel = new QPushButton(tr("&Close")); - buttonCancel->setAutoDefault( false ); - bottomLayout->addWidget( buttonCancel ); - - QVBoxLayout* vlayout = new QVBoxLayout( this ); - vlayout->addWidget( groupBox1 ); - vlayout->addWidget( plotAssociations ); - vlayout->addLayout( bottomLayout ); - - // signals and slots connections - connect( boxTables, SIGNAL(activated(const QString &)),this, SLOT(changeColumnsList(const QString &))); - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); - connect( buttonNew, SIGNAL( clicked() ), this, SLOT( addCurve() ) ); - connect( buttonDelete, SIGNAL( clicked() ), this, SLOT( removeCurve() ) ); - connect( buttonX, SIGNAL( clicked() ), this, SLOT(addXCol())); - connect( buttonY, SIGNAL( clicked() ), this, SLOT(addYCol())); - connect( buttonXErr, SIGNAL( clicked() ), this, SLOT(addXErrCol())); - connect( buttonYErr, SIGNAL( clicked() ), this, SLOT(addYErrCol())); - connect( buttonZ, SIGNAL( clicked() ), this, SLOT(addZCol())); -} - -QSize PlotWizard::sizeHint() const -{ - return QSize(350, 400); -} - -void PlotWizard::accept() -{ - QStringList curves, curves3D, ribbons; - for (int i=0; i < plotAssociations->count(); i++) - { - QString text = plotAssociations->item(i)->text(); - if (text.endsWith("(X)")) - { - QMessageBox::critical(this, tr("QtiPlot - Error"), - tr("Please define a Y column for the following curve") + ":\n\n" + text); - return; - } - - if ( text.contains("(Z)") ) - { - if ( text.contains("(Y)") && !curves3D.contains(text) ) - curves3D << text; - else if ( !text.contains("(Y)") && !ribbons.contains(text) ) - ribbons << text; - } - else if ( text.contains("(xErr)") || text.contains("(yErr)")) - { - QStringList lst = text.split(",", QString::SkipEmptyParts); - lst.pop_back(); - QString master_curve = lst.join(","); - - if (!curves.contains(master_curve)) - curves.prepend(master_curve); - - if (!curves.contains(text)) - curves << text; //add error bars at the end of the list. - } - else if (!curves.contains(text)) - curves.prepend(text); - } - - if (curves.count()>0) - emit plot(curves); - - if (curves3D.count()>0) - plot3D(curves3D); - - if (ribbons.count()>0) - plot3DRibbon(ribbons); - - if(!noCurves()) - close(); -} - -void PlotWizard::changeColumnsList(const QString &table) -{ - QStringList newList; - - for( int i=0 ; icurrentItem()->text(); - if ( text.contains("(X)") ) - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You have already defined a X column!")); - else - { - plotAssociations->currentItem()->setText(text+columnsList->currentItem()->text()+"(X)"); - } -} - -void PlotWizard::addYCol() -{ - if (noCurves()) - return; - - QString text = plotAssociations->currentItem()->text(); - if ( !text.contains("(X)") ) - QMessageBox::warning(this, tr("QtiPlot - Error"),tr("You must define a X column first!")); - else if ( text.contains("(Y)") ) - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You have already defined a Y column!")); - else - { - plotAssociations->currentItem()->setText(text+", "+columnsList->currentItem()->text()+"(Y)"); - } -} - -void PlotWizard::addZCol() -{ - if (noCurves()) - return; - - QString text = plotAssociations->currentItem()->text(); - if ( text.contains("(xErr)") || text.contains("(yErr)") ) - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("This kind of curve is not handled by QtiPlot!")); - else if ( !text.contains("(X)") ) - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You must define a X column first!")); - else if ( text.contains("(Z)") ) - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You have already defined a Z column!")); - else - { - plotAssociations->currentItem()->setText(text+", "+columnsList->currentItem()->text()+"(Z)"); - } -} - -void PlotWizard::addXErrCol() -{ - if (noCurves()) - return; - - QString text = plotAssociations->currentItem()->text(); - if ( text.contains("(Z)") ) - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("This kind of curve is not handled by QtiPlot!")); - else if ( !text.contains("(X)") ) - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You must define a X column first!")); - else if ( !text.contains("(Y)") ) - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You must define a Y column first!")); - else if ( text.contains("(xErr)") || text.contains("(yErr)") ) - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You have already defined an error-bars column!")); - else - { - plotAssociations->currentItem()->setText(text+", "+columnsList->currentItem()->text()+"(xErr)"); - } -} - -void PlotWizard::addYErrCol() -{ - if (noCurves()) - return; - - QString text = plotAssociations->currentItem()->text(); - if ( text.contains("(Z)") ) - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("This kind of curve is not handled by QtiPlot!")); - else if ( !text.contains("(X)") ) - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You must define a X column first!")); - else if ( !text.contains("(Y)") ) - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You must define a Y column first!")); - else if ( text.contains("(xErr)") || text.contains("(yErr)") ) - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You have already defined an error-bars column!")); - else - { - plotAssociations->currentItem()->setText(text+", "+columnsList->currentItem()->text()+"(yErr)"); - } -} - -void PlotWizard::addCurve() -{ - plotAssociations->addItem( boxTables->currentText() + ": " ); - plotAssociations->setCurrentRow( plotAssociations->count()-1 ); -} - -void PlotWizard::removeCurve() -{ - plotAssociations->takeItem( plotAssociations->currentRow() ); -} - -void PlotWizard::insertTablesList(const QStringList& tables) -{ - boxTables->addItems(tables); -} - -void PlotWizard::setColumnsListBoxContents(const QStringList& cols) -{ - columnsList->clear(); - columnsList->insertItems(0, cols); - columnsList->setCurrentRow(0); -} - -void PlotWizard::setColumnsList(const QStringList& cols) -{ - columns = cols; -} - -bool PlotWizard::noCurves() -{ - if ( plotAssociations->count() == 0 ) - { - QMessageBox::warning(0, tr("QtiPlot - Error"), tr("You must add a new curve first!")); - return true; - } - else - return false; -} - -void PlotWizard::plot3DRibbon(const QStringList& lst) -{ - ApplicationWindow *app = (ApplicationWindow *)this->parent(); - if (!app) - return; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - for (int i=0; i< lst.count(); i++) - { - QString s = lst[i]; - int pos = s.find(":", 0); - QString table_name = s.left(pos) + "_"; - Table *t = app->table(table_name); - if (t) - { - int posX = s.find("(", pos); - QString xColName = table_name + s.mid(pos+2, posX-pos-2); - - posX = s.find(",", posX); - int posY = s.find("(", posX); - QString yColName = table_name + s.mid(posX+2, posY-posX-2); - - Graph3D *g = app->newPlot3D(); - if (g) { - g->addRibbon(t, xColName, yColName); - g->setDataColorMap(app->d_3D_color_map); - g->update(); - } - } - } - QApplication::restoreOverrideCursor(); -} - -void PlotWizard::plot3D(const QStringList& lst) -{ - ApplicationWindow *app = (ApplicationWindow *)this->parent(); - if (!app) - return; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - for (int i=0; i< lst.count(); i++) - { - QString s = lst[i]; - int pos = s.find(":", 0); - QString table_name = s.left(pos) + "_"; - Table *t = app->table(table_name); - if (t) - { - int posX = s.find("(", pos); - QString xColName = table_name + s.mid(pos+2, posX-pos-2); - - posX = s.find(",", posX); - int posY = s.find("(", posX); - QString yColName = table_name + s.mid(posX+2, posY-posX-2); - - posY = s.find(",", posY); - int posZ = s.find("(", posY); - QString zColName = table_name + s.mid(posY+2, posZ-posY-2); - - int xCol = t->colIndex(xColName); - int yCol = t->colIndex(yColName); - int zCol = t->colIndex(zColName); - if (xCol >= 0 && yCol >= 0 && zCol >= 0) { - Graph3D *g = app->newPlot3D(); - if (g) - g->addData(t, xCol, yCol, zCol, 1); - } - } - } - QApplication::restoreOverrideCursor(); -} === added file 'qtiplot/src/core/PlotWizard.h' --- qtiplot/src/core/PlotWizard.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/PlotWizard.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,123 @@ +/*************************************************************************** + File : PlotWizard.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2004 - 2010 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : A wizard type dialog to create new plots + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + + +#ifndef PLOTWIZARD_H +#define PLOTWIZARD_H + +#include +class QGroupBox; +class QPushButton; +class QListWidget; +class QComboBox; + +//! A wizard type dialog class to create new plots +class PlotWizard : public QDialog +{ + Q_OBJECT + +public: + //! Constructor + /** + * \param parent parent widget + * \param fl Qt window flags + */ + PlotWizard( QWidget* parent = 0, Qt::WFlags fl = 0 ); + +private: + //! Button "Plot" + QPushButton* buttonOk, + //! Button "<->xErr" + *buttonXErr, + //! Button "<->yErr" + *buttonYErr, + //! Button "Delete curve" + *buttonDelete; + //! Button "cancel" + QPushButton* buttonCancel, + //! Button "<->X" + *buttonX, + //! Button "<->Y" + *buttonY, + //! Button "New curve" + *buttonNew, + //! Button "<->Z" + *buttonZ; + //! Button group defining the layout + QGroupBox* groupBox1, + //! Button group defining the layout + *groupBox2, + //! Button group defining the layout + *groupBox3; + //! Combo box to select the table + QComboBox* boxTables; + //! List of the columns in the selected table + QListWidget *columnsList, + //! List of the plots to generate + *plotAssociations; + + //! Internal list of columns (contains all columns in all tables) + QStringList columns; + +public slots: + //! Update the columns list box to contain the columns of 'table' + void changeColumnsList(const QString &table); + //! Insert a list of tables into the tables combo box + void insertTablesList(const QStringList& tables); + //! Set the contents of the columns list box to the strings in 'cols' + void setColumnsListBoxContents(const QStringList& cols); + //! Set the internal columns list to 'cols' + void setColumnsList(const QStringList& cols); + //! Add new curve + void addCurve(); + //! Delete selected curve + void removeCurve(); + //! Add column as X + void addXCol(); + //! Add column as Y + void addYCol(); + //! Add column as X error + void addXErrCol(); + //! Add column as Y error + void addYErrCol(); + //! Accept settings, close the dialog + void accept(); + //! Add column as Z + void addZCol(); + +private: + void plot2D(const QStringList&); + void plot3D(const QStringList&); + void plot3DRibbon(const QStringList&); + //! Display a warning that a new curve must be added first before the selection of the columns + bool noCurves(); + QSize sizeHint() const; +}; + +#endif // PLOTWIZARD_H === removed file 'qtiplot/src/core/PlotWizard.h' --- qtiplot/src/core/PlotWizard.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/PlotWizard.h 1970-01-01 00:00:00 +0000 @@ -1,126 +0,0 @@ -/*************************************************************************** - File : PlotWizard.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : A wizard type dialog to create new plots - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - - -#ifndef PLOTWIZARD_H -#define PLOTWIZARD_H - -#include -class QGroupBox; -class QPushButton; -class QListWidget; -class QComboBox; - -//! A wizard type dialog class to create new plots -class PlotWizard : public QDialog -{ - Q_OBJECT - -public: - //! Constructor - /** - * \param parent parent widget - * \param fl Qt window flags - */ - PlotWizard( QWidget* parent = 0, Qt::WFlags fl = 0 ); - -private: - //! Button "Plot" - QPushButton* buttonOk, - //! Button "<->xErr" - *buttonXErr, - //! Button "<->yErr" - *buttonYErr, - //! Button "Delete curve" - *buttonDelete; - //! Button "cancel" - QPushButton* buttonCancel, - //! Button "<->X" - *buttonX, - //! Button "<->Y" - *buttonY, - //! Button "New curve" - *buttonNew, - //! Button "<->Z" - *buttonZ; - //! Button group defining the layout - QGroupBox* groupBox1, - //! Button group defining the layout - *groupBox2, - //! Button group defining the layout - *groupBox3; - //! Combo box to select the table - QComboBox* boxTables; - //! List of the columns in the selected table - QListWidget *columnsList, - //! List of the plots to generate - *plotAssociations; - - //! Internal list of columns (contains all columns in all tables) - QStringList columns; - -public slots: - //! Update the columns list box to contain the columns of 'table' - void changeColumnsList(const QString &table); - //! Insert a list of tables into the tables combo box - void insertTablesList(const QStringList& tables); - //! Set the contents of the columns list box to the strings in 'cols' - void setColumnsListBoxContents(const QStringList& cols); - //! Set the internal columns list to 'cols' - void setColumnsList(const QStringList& cols); - //! Add new curve - void addCurve(); - //! Delete selected curve - void removeCurve(); - //! Add column as X - void addXCol(); - //! Add column as Y - void addYCol(); - //! Add column as X error - void addXErrCol(); - //! Add column as Y error - void addYErrCol(); - //! Accept settings, close the dialog - void accept(); - //! Add column as Z - void addZCol(); - -private: - void plot3D(const QStringList& lst); - void plot3DRibbon(const QStringList& lst); - //! Display a warning that a new curve must be added first before the selection of the columns - bool noCurves(); - QSize sizeHint() const; - -signals: - //! Emitted when new plots need to be created - void plot (const QStringList&); -}; - -#endif // PLOTWIZARD_H === added file 'qtiplot/src/core/QtiPlotApplication.cpp' --- qtiplot/src/core/QtiPlotApplication.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/QtiPlotApplication.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,124 @@ +/*************************************************************************** + File : QtiPlotApplication.cpp + Project : QtiPlot +-------------------------------------------------------------------- + Copyright : (C) 2010 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : QtiPlot application + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + +#include +#include +#include +#include + +#ifdef Q_WS_MAC + void qt_mac_set_menubar_merge(bool enable); +#endif + +QtiPlotApplication::QtiPlotApplication( int & argc, char ** argv) : QApplication( argc, argv) +{ + QStringList args = arguments(); + args.removeFirst(); // remove application name + + if( (args.count() == 1) && (args[0] == "-m" || args[0] == "--manual") ) + ApplicationWindow::showStandAloneHelp(); + else if ( (args.count() == 1) && (args[0] == "-a" || args[0] == "--about") ) { + #ifdef Q_OS_WIN + QMessageBox *msg = ApplicationWindow::about(); + connect(msg, SIGNAL(destroyed()), this, SLOT(quit())); + #else + ApplicationWindow::about(false); + #endif + } else { + bool factorySettings = false; + if (args.contains("-d") || args.contains("--default-settings")) + factorySettings = true; + + ApplicationWindow *mw = new ApplicationWindow(factorySettings); + mw->restoreApplicationGeometry(); + #ifdef QTIPLOT_SUPPORT + mw->showDonationDialog(); + #endif + if (mw->autoSearchUpdates){ + mw->autoSearchUpdatesRequest = true; + mw->searchForUpdates(); + } + mw->parseCommandLineArguments(args); + } + + #ifdef QTIPLOT_DEMO + QTimer::singleShot(600000, this, SLOT(close())); + #endif + + #ifdef Q_WS_MAC + qt_mac_set_menubar_merge(false); + #endif +} + +#ifdef QTIPLOT_DEMO +void QtiPlotApplication::close() +{ + ApplicationWindow *mw = d_windows.last(); + if (mw) + mw->showDemoVersionMessage(); + + quit(); +} +#endif + +bool QtiPlotApplication::event(QEvent *event) +{ + switch (event->type()) { + case QEvent::FileOpen: + { + QString file = static_cast(event)->file(); + if (!d_windows.isEmpty()){ + foreach(ApplicationWindow *w, d_windows){ + if (w->projectname == file){ + if (!w->isActiveWindow() && d_windows.count() > 1){ + w->hide(); + w->show(); + } + return true; + } + } + + ApplicationWindow *mw = d_windows.last(); + if (mw){ + ApplicationWindow *app = mw->open(file, false, true); + if (mw->projectname == "untitled"){ + mw->close(); + d_windows.removeAll(mw); + } + if (app) + d_windows << app; + } + } + return true; + } + + default: + return QApplication::event(event); + } +} === added file 'qtiplot/src/core/QtiPlotApplication.h' --- qtiplot/src/core/QtiPlotApplication.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/QtiPlotApplication.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,57 @@ +/*************************************************************************** + File : QtiPlotApplication.h + Project : QtiPlot +-------------------------------------------------------------------- + Copyright : (C) 2010 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : QtiPlot application + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + +#ifndef QTIPLOTAPPLICATION_H +#define QTIPLOTAPPLICATION_H + +#include + +class ApplicationWindow; + +class QtiPlotApplication : public QApplication +{ + Q_OBJECT +public: + QtiPlotApplication( int & argc, char ** argv); + void remove(ApplicationWindow *w){d_windows.removeAll(w);}; + void append(ApplicationWindow *w){if (w) d_windows.append(w);}; + +protected: + bool event(QEvent *); + +private: + QList d_windows; + +#ifdef QTIPLOT_DEMO +private slots: + void close(); +#endif +}; + +#endif // QTIPLOTAPPLICATION_H === added file 'qtiplot/src/core/RenameWindowDialog.cpp' --- qtiplot/src/core/RenameWindowDialog.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/RenameWindowDialog.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,154 @@ +/*************************************************************************** + File : RenameWindowDialog.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Rename window dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "RenameWindowDialog.h" +#include "ApplicationWindow.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +RenameWindowDialog::RenameWindowDialog(QWidget* parent, Qt::WFlags fl ) + : QDialog( parent, fl ) +{ + setWindowTitle(tr("QtiPlot - Rename Window")); + + QGridLayout * leftLayout = new QGridLayout(); + QVBoxLayout * rightLayout = new QVBoxLayout(); + + groupBox1 = new QGroupBox(tr("Window Title")); + groupBox1->setLayout(leftLayout); + + boxName = new QRadioButton(tr("&Name (single word)")); + leftLayout->addWidget(boxName, 0, 0); + boxNameLine = new QLineEdit(); + leftLayout->addWidget(boxNameLine, 0, 1); + setFocusProxy(boxNameLine); + + boxLabel = new QRadioButton(tr("&Label")); + leftLayout->addWidget(boxLabel, 2, 0); + boxLabelEdit = new QTextEdit(); + leftLayout->addWidget(boxLabelEdit, 1, 1, 3, 1); + boxLabelEdit->setMaximumHeight(100); + boxLabelEdit->setMinimumHeight(100); + + boxBoth = new QRadioButton(tr("&Both Name and Label")); + leftLayout->addWidget(boxBoth, 4, 0); + + buttons = new QButtonGroup(this); + buttons->addButton(boxName); + buttons->addButton(boxLabel); + buttons->addButton(boxBoth); + + buttonOk = new QPushButton(tr( "&OK" )); + buttonOk->setAutoDefault( true ); + buttonOk->setDefault( true ); + rightLayout->addWidget(buttonOk); + + buttonCancel = new QPushButton(tr( "&Cancel" )); + buttonCancel->setAutoDefault( true ); + rightLayout->addWidget(buttonCancel); + rightLayout->addStretch(); + + QHBoxLayout * mainLayout = new QHBoxLayout(this); + mainLayout->addWidget(groupBox1); + mainLayout->addLayout(rightLayout); + + // signals and slots connections + connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); + connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); +} + +void RenameWindowDialog::setWidget(MdiSubWindow *w) +{ + window = w; + boxNameLine->setText(w->objectName()); + boxLabelEdit->setText(w->windowLabel()); + switch (w->captionPolicy()) + { + case MdiSubWindow::Name: + boxName->setChecked(true); + break; + + case MdiSubWindow::Label: + boxLabel->setChecked(true); + break; + + case MdiSubWindow::Both: + boxBoth->setChecked(true); + break; + } +} + +MdiSubWindow::CaptionPolicy RenameWindowDialog::getCaptionPolicy() +{ + MdiSubWindow::CaptionPolicy policy = MdiSubWindow::Name; + if (boxLabel->isChecked()) + policy = MdiSubWindow::Label; + else if (boxBoth->isChecked()) + policy = MdiSubWindow::Both; + + return policy; +} + +void RenameWindowDialog::accept() +{ + QString name = window->name(); + QString text = boxNameLine->text().remove("=").remove(QRegExp("\\s")); + QString label = boxLabelEdit->text(); + + MdiSubWindow::CaptionPolicy policy = getCaptionPolicy(); + if (text == name && label == window->windowLabel() && window->captionPolicy() == policy) + close(); + + ApplicationWindow *app = (ApplicationWindow *)parentWidget(); + if (!app) + return; + + if (text.contains("_")){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), + tr("For internal consistency reasons the underscore character is replaced with a minus sign."));} + + if (text.replace("_", "-") != name){ + if(!app->setWindowName(window, text)) + return; + } + + label.replace("\n"," ").replace("\t"," "); + window->setWindowLabel(label); + window->setCaptionPolicy(policy); + app->modifiedProject(window); + close(); +} === removed file 'qtiplot/src/core/RenameWindowDialog.cpp' --- qtiplot/src/core/RenameWindowDialog.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/RenameWindowDialog.cpp 1970-01-01 00:00:00 +0000 @@ -1,154 +0,0 @@ -/*************************************************************************** - File : RenameWindowDialog.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Rename window dialog - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "RenameWindowDialog.h" -#include "ApplicationWindow.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -RenameWindowDialog::RenameWindowDialog(QWidget* parent, Qt::WFlags fl ) - : QDialog( parent, fl ) -{ - setWindowTitle(tr("QtiPlot - Rename Window")); - - QGridLayout * leftLayout = new QGridLayout(); - QVBoxLayout * rightLayout = new QVBoxLayout(); - - groupBox1 = new QGroupBox(tr("Window Title")); - groupBox1->setLayout(leftLayout); - - boxName = new QRadioButton(tr("&Name (single word)")); - leftLayout->addWidget(boxName, 0, 0); - boxNameLine = new QLineEdit(); - leftLayout->addWidget(boxNameLine, 0, 1); - setFocusProxy(boxNameLine); - - boxLabel = new QRadioButton(tr("&Label")); - leftLayout->addWidget(boxLabel, 2, 0); - boxLabelEdit = new QTextEdit(); - leftLayout->addWidget(boxLabelEdit, 1, 1, 3, 1); - boxLabelEdit->setMaximumHeight(100); - boxLabelEdit->setMinimumHeight(100); - - boxBoth = new QRadioButton(tr("&Both Name and Label")); - leftLayout->addWidget(boxBoth, 4, 0); - - buttons = new QButtonGroup(this); - buttons->addButton(boxName); - buttons->addButton(boxLabel); - buttons->addButton(boxBoth); - - buttonOk = new QPushButton(tr( "&OK" )); - buttonOk->setAutoDefault( true ); - buttonOk->setDefault( true ); - rightLayout->addWidget(buttonOk); - - buttonCancel = new QPushButton(tr( "&Cancel" )); - buttonCancel->setAutoDefault( true ); - rightLayout->addWidget(buttonCancel); - rightLayout->addStretch(); - - QHBoxLayout * mainLayout = new QHBoxLayout(this); - mainLayout->addWidget(groupBox1); - mainLayout->addLayout(rightLayout); - - // signals and slots connections - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); -} - -void RenameWindowDialog::setWidget(MdiSubWindow *w) -{ - window = w; - boxNameLine->setText(w->objectName()); - boxLabelEdit->setText(w->windowLabel()); - switch (w->captionPolicy()) - { - case MdiSubWindow::Name: - boxName->setChecked(true); - break; - - case MdiSubWindow::Label: - boxLabel->setChecked(true); - break; - - case MdiSubWindow::Both: - boxBoth->setChecked(true); - break; - } -} - -MdiSubWindow::CaptionPolicy RenameWindowDialog::getCaptionPolicy() -{ - MdiSubWindow::CaptionPolicy policy = MdiSubWindow::Name; - if (boxLabel->isChecked()) - policy = MdiSubWindow::Label; - else if (boxBoth->isChecked()) - policy = MdiSubWindow::Both; - - return policy; -} - -void RenameWindowDialog::accept() -{ - QString name = window->name(); - QString text = boxNameLine->text().remove("=").remove(QRegExp("\\s")); - QString label = boxLabelEdit->text(); - - MdiSubWindow::CaptionPolicy policy = getCaptionPolicy(); - if (text == name && label == window->windowLabel() && window->captionPolicy() == policy) - close(); - - ApplicationWindow *app = (ApplicationWindow *)parentWidget(); - if (!app) - return; - - if (text.contains("_")){ - QMessageBox::warning(this, tr("QtiPlot - Warning"), - tr("For internal consistency reasons the underscore character is replaced with a minus sign."));} - - if (text.replace("_", "-") != name){ - if(!app->setWindowName(window, text)) - return; - } - - label.replace("\n"," ").replace("\t"," "); - window->setWindowLabel(label); - window->setCaptionPolicy(policy); - app->modifiedProject(window); - close(); -} === added file 'qtiplot/src/core/RenameWindowDialog.h' --- qtiplot/src/core/RenameWindowDialog.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/RenameWindowDialog.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,75 @@ +/*************************************************************************** + File : RenameWindowDialog.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Rename window dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef RENAMEDIALOG_H +#define RENAMEDIALOG_H + +#include +#include + +#include "MdiSubWindow.h" + +class QGroupBox; +class QPushButton; +class QLineEdit; +class QRadioButton; +class QTextEdit; +class MdiSubWindow; +class QButtonGroup; + +//! Rename window dialog +class RenameWindowDialog : public QDialog +{ + Q_OBJECT + +public: + RenameWindowDialog(QWidget* parent = 0, Qt::WFlags fl = 0 ); + +private: + QPushButton * buttonOk; + QPushButton * buttonCancel; + QGroupBox * groupBox1; + QButtonGroup * buttons; + QRadioButton * boxName; + QRadioButton * boxLabel; + QRadioButton * boxBoth; + QLineEdit * boxNameLine; + QTextEdit * boxLabelEdit; + +public slots: + void setWidget(MdiSubWindow *w); + MdiSubWindow::CaptionPolicy getCaptionPolicy(); + void accept(); + +signals: + +private: + MdiSubWindow *window; +}; + +#endif // EXPORTDIALOG_H === removed file 'qtiplot/src/core/RenameWindowDialog.h' --- qtiplot/src/core/RenameWindowDialog.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/RenameWindowDialog.h 1970-01-01 00:00:00 +0000 @@ -1,75 +0,0 @@ -/*************************************************************************** - File : RenameWindowDialog.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Rename window dialog - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef RENAMEDIALOG_H -#define RENAMEDIALOG_H - -#include -#include - -#include "MdiSubWindow.h" - -class QGroupBox; -class QPushButton; -class QLineEdit; -class QRadioButton; -class QTextEdit; -class MdiSubWindow; -class QButtonGroup; - -//! Rename window dialog -class RenameWindowDialog : public QDialog -{ - Q_OBJECT - -public: - RenameWindowDialog(QWidget* parent = 0, Qt::WFlags fl = 0 ); - -private: - QPushButton * buttonOk; - QPushButton * buttonCancel; - QGroupBox * groupBox1; - QButtonGroup * buttons; - QRadioButton * boxName; - QRadioButton * boxLabel; - QRadioButton * boxBoth; - QLineEdit * boxNameLine; - QTextEdit * boxLabelEdit; - -public slots: - void setWidget(MdiSubWindow *w); - MdiSubWindow::CaptionPolicy getCaptionPolicy(); - void accept(); - -signals: - -private: - MdiSubWindow *window; -}; - -#endif // EXPORTDIALOG_H === added file 'qtiplot/src/core/core.pri' --- qtiplot/src/core/core.pri 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/core.pri 2010-07-21 23:21:08 +0000 @@ -0,0 +1,38 @@ +###################### HEADERS ############################################## +INCLUDEPATH += src/core/ + +HEADERS += src/core/ApplicationWindow.h \ + src/core/ConfigDialog.h \ + src/core/CreateBinMatrixDialog.h \ + src/core/CustomActionDialog.h \ + src/core/Folder.h\ + src/core/FindDialog.h\ + src/core/ImportASCIIDialog.h \ + src/core/MdiSubWindow.h \ + src/core/OdsFileHandler.h\ + src/core/OpenProjectDialog.h\ + src/core/PlotWizard.h \ + src/core/QtiPlotApplication.h \ + src/core/RenameWindowDialog.h \ + src/core/globals.h\ + + +###################### SOURCES ############################################## + +!contains(CONFIG, BrowserPlugin){ + SOURCES += src/core/main.cpp +} + +SOURCES += src/core/ApplicationWindow.cpp \ + src/core/ConfigDialog.cpp \ + src/core/CreateBinMatrixDialog.cpp \ + src/core/CustomActionDialog.cpp \ + src/core/Folder.cpp\ + src/core/FindDialog.cpp\ + src/core/ImportASCIIDialog.cpp \ + src/core/MdiSubWindow.cpp \ + src/core/OdsFileHandler.cpp\ + src/core/OpenProjectDialog.cpp\ + src/core/PlotWizard.cpp \ + src/core/QtiPlotApplication.cpp \ + src/core/RenameWindowDialog.cpp \ === removed file 'qtiplot/src/core/core.pri' --- qtiplot/src/core/core.pri 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/core.pri 1970-01-01 00:00:00 +0000 @@ -1,31 +0,0 @@ -###################### HEADERS ############################################## -INCLUDEPATH += src/core/ - -HEADERS += src/core/ApplicationWindow.h \ - src/core/ConfigDialog.h \ - src/core/CreateBinMatrixDialog.h \ - src/core/CustomActionDialog.h \ - src/core/Folder.h\ - src/core/FindDialog.h\ - src/core/ImportASCIIDialog.h \ - src/core/MdiSubWindow.h \ - src/core/OpenProjectDialog.h\ - src/core/PlotWizard.h \ - src/core/RenameWindowDialog.h \ - src/core/globals.h\ - - -###################### SOURCES ############################################## - -SOURCES += src/core/main.cpp \ - src/core/ApplicationWindow.cpp \ - src/core/ConfigDialog.cpp \ - src/core/CreateBinMatrixDialog.cpp \ - src/core/CustomActionDialog.cpp \ - src/core/Folder.cpp\ - src/core/FindDialog.cpp\ - src/core/ImportASCIIDialog.cpp \ - src/core/MdiSubWindow.cpp \ - src/core/OpenProjectDialog.cpp\ - src/core/PlotWizard.cpp \ - src/core/RenameWindowDialog.cpp \ === added file 'qtiplot/src/core/globals.h' --- qtiplot/src/core/globals.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/globals.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,41 @@ +/*************************************************************************** + File : globals.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief, Tilman Hoener zu Siederdissen + Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net + Description : Definition of global constants + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +// Don't forget to change the Doxyfile when changing these! +//! Major version number +const int maj_version = 0; +//! Minor version number (0..9) +const int min_version = 9; +//! Patch version number (0..9) +const int patch_version = 7; +//! Extra version information string (like "alpha", "-2", etc...) +const char * extra_version = ".14"; +//! Copyright string containing the author names +const char * copyright_string = "Copyright (C) 2004-2010 Ion Vasilief"; +//! Release date as a string +const char * release_date = " 2010/04/22"; === removed file 'qtiplot/src/core/globals.h' --- qtiplot/src/core/globals.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/globals.h 1970-01-01 00:00:00 +0000 @@ -1,41 +0,0 @@ -/*************************************************************************** - File : globals.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, Tilman Hoener zu Siederdissen - Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net - Description : Definition of global constants - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -// Don't forget to change the Doxyfile when changing these! -//! Major version number -const int maj_version = 0; -//! Minor version number (0..9) -const int min_version = 9; -//! Patch version number (0..9) -const int patch_version = 7; -//! Extra version information string (like "alpha", "-2", etc...) -const char * extra_version = ".10"; -//! Copyright string containing the author names -const char * copyright_string = "Copyright (C) 2004-2009 Ion Vasilief"; -//! Release date as a string -const char * release_date = " 2009/10/08"; === added file 'qtiplot/src/core/main.cpp' --- qtiplot/src/core/main.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/core/main.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,127 @@ +/*************************************************************************** + File : main.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : QtiPlot main function + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include +#include "ApplicationWindow.h" +#include + +// The following stuff is for the doxygen title page +/*! \mainpage QtiPlot - Data analysis and scientific plotting - API documentation + + \section description Program description: +Scientists often need to use data analysis and plotting software. +For Windows systems there is a well known and widely used software +called Origin, which is not +free, of course. The purpose of this project is to develop +a free (open source), platform independent alternative to +Origin. QtiPlot is still far from this goal, but +there's a "wish to" list we are constantly working on. +All suggestions and contributions are most welcome! +If you want to contribute code, please read the notes on \ref style "coding style" first. +
+ + The QtiPlot web page can be found at
+ http://soft.proindependent.com/qtiplot.html
+ + \section libs QtiPlot uses the following libraries: + Qt, + Qwt (5.0.0), + QwtPlot3D, + GSL, + muParser, + zlib (1.2.3), + and liborigin. +
+ + \page future Future Plans + + - Make QtiPlot easier to extend and maintain by modularizing it. For + example, ideally it should be possible to implement new plot or marker + types without modifying existing classes (think of plug-ins here). + - Unify naming of some methods and variables with class names. + - Add generic plug-in support, support for implementing extensions in + Python, a full-featured multi-level undo/redo framework (-> visitor pattern). + [ undo/redo assigned to thzs; plug-in/Python extension support assigned to knut ] + - Revise some internal APIs that use undocumented protocols for the + strings that get passed around. Wherever possible, consistency should be + checked at compile-time. This would also probably eliminate the need to + place restrictions on object/column names. + - Switch file format to a completely XML-based one so we can write a + more robust parser based on Qt's XML support. Legacy support for the old + format could be a plug-in. + See whether we can make use of the XML save/restore interface planned for Qwt. + Wait for the new XML reader in Qt 4.3 or use SAX? + - Document as much as possible using doxygen and write simple demo + plug-ins. + - Modularize the build process so that Python support could use SIP's + build system instead of the current hacks. Support for muParser, + liborigin and zlib could also be split out into plug-ins on the basis + that you shouldn't have to install libraries you don't use. Also reduces + compile times during bugfixing. + [ assigned to knut ] + - Change some internal APIs that depend on the notion of a selected/current item. + This will lead to a cleaner and simpler interface for plug-ins and Python scripts. + . + + %Note about modularization: this is mainly about internal reorganizations. + Most of the current features should remain part of the main executable, but use interfaces similar or + identical to those used by plug-ins. This should ease maintanance and make adding new features + to the core application a no-brainer once they're available as plug-ins. + Support for Python, liborigin and zlib could be real, external plug-ins since many people probably + don't need them, but this can be decided shortly before distribution and ideally by + modifying just a few lines in a build script. + + \section features Features + - Waterfall plots + - Polar charts + - Ternary plots + - Improved data analysis: base-line detection tool, more built-in fit functions... + - Improved import of Origin project files + - More import/export filters including Open Document spreadsheets (plugin) + + \sa ApplicationWindow, MultiLayer, Graph, Graph3D, ImageMarker, Legend, MyWidget, SelectionMoveResizer, MyParser, Note, ScriptEdit, Table + + \page style Coding Style + The following rules are not used everywhere (yet), but are intended as guidelines for new code and eventually + old code should be adapted as well. + + - Files use Unix-style line endings ("\n"). + - Class names start with a capital letter, object/variable names with a lower case letter. + - Methods and functions are named likeThis(), variables like_this and instance variables are prefixed with "d_". + - Property access methods use Qt style: property() and setProperty(). + - Every file should be named exactly like the class inside and there should be only one class per file, with the exception of + really short classes like LayerButton. + - For indentations, tabs are preferred because they allow everyone to choose the indentation depth for him/herself. +*/ + +int main( int argc, char ** argv ) +{ + QtiPlotApplication app( argc, argv ); + app.connect( &app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()) ); + return app.exec(); +} === removed file 'qtiplot/src/core/main.cpp' --- qtiplot/src/core/main.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/core/main.cpp 1970-01-01 00:00:00 +0000 @@ -1,151 +0,0 @@ -/*************************************************************************** - File : main.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : QtiPlot main function - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include -#include "ApplicationWindow.h" - -// The following stuff is for the doxygen title page -/*! \mainpage QtiPlot - Data analysis and scientific plotting - API documentation - - \section description Program description: -Scientists often need to use data analysis and plotting software. -For Windows systems there is a well known and widely used software -called Origin, which is not -free, of course. The purpose of this project is to develop -a free (open source), platform independent alternative to -Origin. QtiPlot is still far from this goal, but -there's a "wish to" list we are constantly working on. -All suggestions and contributions are most welcome! -If you want to contribute code, please read the notes on \ref style "coding style" first. -
- - The QtiPlot web page can be found at
- http://soft.proindependent.com/qtiplot.html
- - \section libs QtiPlot uses the following libraries: - Qt, - Qwt (5.0.0), - QwtPlot3D, - GSL, - muParser, - zlib (1.2.3), - and liborigin. -
- - \page future Future Plans - - - Make QtiPlot easier to extend and maintain by modularizing it. For - example, ideally it should be possible to implement new plot or marker - types without modifying existing classes (think of plug-ins here). - - Unify naming of some methods and variables with class names. - - Add generic plug-in support, support for implementing extensions in - Python, a full-featured multi-level undo/redo framework (-> visitor pattern). - [ undo/redo assigned to thzs; plug-in/Python extension support assigned to knut ] - - Revise some internal APIs that use undocumented protocols for the - strings that get passed around. Wherever possible, consistency should be - checked at compile-time. This would also probably eliminate the need to - place restrictions on object/column names. - - Switch file format to a completely XML-based one so we can write a - more robust parser based on Qt's XML support. Legacy support for the old - format could be a plug-in. - See whether we can make use of the XML save/restore interface planned for Qwt. - Wait for the new XML reader in Qt 4.3 or use SAX? - - Document as much as possible using doxygen and write simple demo - plug-ins. - - Modularize the build process so that Python support could use SIP's - build system instead of the current hacks. Support for muParser, - liborigin and zlib could also be split out into plug-ins on the basis - that you shouldn't have to install libraries you don't use. Also reduces - compile times during bugfixing. - [ assigned to knut ] - - Change some internal APIs that depend on the notion of a selected/current item. - This will lead to a cleaner and simpler interface for plug-ins and Python scripts. - . - - %Note about modularization: this is mainly about internal reorganizations. - Most of the current features should remain part of the main executable, but use interfaces similar or - identical to those used by plug-ins. This should ease maintanance and make adding new features - to the core application a no-brainer once they're available as plug-ins. - Support for Python, liborigin and zlib could be real, external plug-ins since many people probably - don't need them, but this can be decided shortly before distribution and ideally by - modifying just a few lines in a build script. - - \section features Features - - Waterfall plots - - Polar charts - - Ternary plots - - Improved data analysis: base-line detection tool, more built-in fit functions... - - Improved import of Origin project files - - More import/export filters including Open Document spreadsheets (plugin) - - \sa ApplicationWindow, MultiLayer, Graph, Graph3D, ImageMarker, Legend, MyWidget, SelectionMoveResizer, MyParser, Note, ScriptEdit, Table - - \page style Coding Style - The following rules are not used everywhere (yet), but are intended as guidelines for new code and eventually - old code should be adapted as well. - - - Files use Unix-style line endings ("\n"). - - Class names start with a capital letter, object/variable names with a lower case letter. - - Methods and functions are named likeThis(), variables like_this and instance variables are prefixed with "d_". - - Property access methods use Qt style: property() and setProperty(). - - Every file should be named exactly like the class inside and there should be only one class per file, with the exception of - really short classes like LayerButton. - - For indentations, tabs are preferred because they allow everyone to choose the indentation depth for him/herself. -*/ - -int main( int argc, char ** argv ) -{ - QApplication app( argc, argv ); - - QStringList args = app.arguments(); - args.removeFirst(); // remove application name - - if( (args.count() == 1) && (args[0] == "-m" || args[0] == "--manual") ) - ApplicationWindow::showStandAloneHelp(); - else if ( (args.count() == 1) && (args[0] == "-a" || args[0] == "--about") ) { - ApplicationWindow::about(); - exit(0); - } else { - bool factorySettings = false; - if (args.contains("-d") || args.contains("--default-settings")) - factorySettings = true; - - ApplicationWindow *mw = new ApplicationWindow(factorySettings); - mw->restoreApplicationGeometry(); - #ifdef QTIPLOT_SUPPORT - mw->showDonationDialog(); - #endif - if (mw->autoSearchUpdates){ - mw->autoSearchUpdatesRequest = true; - mw->searchForUpdates(); - } - mw->parseCommandLineArguments(args); - } - app.connect( &app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()) ); - return app.exec(); -} === added directory 'qtiplot/src/lib' === removed directory 'qtiplot/src/lib' === added directory 'qtiplot/src/lib/3rdparty' === removed directory 'qtiplot/src/lib/3rdparty' === added directory 'qtiplot/src/lib/3rdparty/qtcolorpicker' === removed directory 'qtiplot/src/lib/3rdparty/qtcolorpicker' === added file 'qtiplot/src/lib/3rdparty/qtcolorpicker/LGPL_EXCEPTION.txt' --- qtiplot/src/lib/3rdparty/qtcolorpicker/LGPL_EXCEPTION.txt 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/3rdparty/qtcolorpicker/LGPL_EXCEPTION.txt 2010-07-21 23:21:08 +0000 @@ -0,0 +1,10 @@ +Nokia Qt LGPL Exception version 1.0 + +As a special exception to the GNU Lesser General Public License +version 2.1, the object code form of a "work that uses the Library" +may incorporate material from a header file that is part of the +Library. You may distribute such object code under terms of your +choice, provided that the incorporated material (i) does not exceed +more than 5% of the total size of the Library; and (ii) is limited to +numerical parameters, data structure layouts, accessors, macros, +inline functions and templates. === removed file 'qtiplot/src/lib/3rdparty/qtcolorpicker/LGPL_EXCEPTION.txt' --- qtiplot/src/lib/3rdparty/qtcolorpicker/LGPL_EXCEPTION.txt 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/3rdparty/qtcolorpicker/LGPL_EXCEPTION.txt 1970-01-01 00:00:00 +0000 @@ -1,10 +0,0 @@ -Nokia Qt LGPL Exception version 1.0 - -As a special exception to the GNU Lesser General Public License -version 2.1, the object code form of a "work that uses the Library" -may incorporate material from a header file that is part of the -Library. You may distribute such object code under terms of your -choice, provided that the incorporated material (i) does not exceed -more than 5% of the total size of the Library; and (ii) is limited to -numerical parameters, data structure layouts, accessors, macros, -inline functions and templates. === added file 'qtiplot/src/lib/3rdparty/qtcolorpicker/LICENSE.GPL3' --- qtiplot/src/lib/3rdparty/qtcolorpicker/LICENSE.GPL3 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/3rdparty/qtcolorpicker/LICENSE.GPL3 2010-07-21 23:21:08 +0000 @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. === removed file 'qtiplot/src/lib/3rdparty/qtcolorpicker/LICENSE.GPL3' --- qtiplot/src/lib/3rdparty/qtcolorpicker/LICENSE.GPL3 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/3rdparty/qtcolorpicker/LICENSE.GPL3 1970-01-01 00:00:00 +0000 @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. === added file 'qtiplot/src/lib/3rdparty/qtcolorpicker/LICENSE.LGPL' --- qtiplot/src/lib/3rdparty/qtcolorpicker/LICENSE.LGPL 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/3rdparty/qtcolorpicker/LICENSE.LGPL 2010-07-21 23:21:08 +0000 @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + === removed file 'qtiplot/src/lib/3rdparty/qtcolorpicker/LICENSE.LGPL' --- qtiplot/src/lib/3rdparty/qtcolorpicker/LICENSE.LGPL 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/3rdparty/qtcolorpicker/LICENSE.LGPL 1970-01-01 00:00:00 +0000 @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - === added file 'qtiplot/src/lib/3rdparty/qtcolorpicker/README.TXT' --- qtiplot/src/lib/3rdparty/qtcolorpicker/README.TXT 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/3rdparty/qtcolorpicker/README.TXT 2010-07-21 23:21:08 +0000 @@ -0,0 +1,7 @@ +Color Picker v2.6 + +A widget that lets the user select colors from a grid of +predefined colors. + + + === removed file 'qtiplot/src/lib/3rdparty/qtcolorpicker/README.TXT' --- qtiplot/src/lib/3rdparty/qtcolorpicker/README.TXT 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/3rdparty/qtcolorpicker/README.TXT 1970-01-01 00:00:00 +0000 @@ -1,7 +0,0 @@ -Color Picker v2.6 - -A widget that lets the user select colors from a grid of -predefined colors. - - - === added directory 'qtiplot/src/lib/3rdparty/qtcolorpicker/src' === removed directory 'qtiplot/src/lib/3rdparty/qtcolorpicker/src' === added file 'qtiplot/src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.cpp' --- qtiplot/src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,1144 @@ +/**************************************************************************** +** +** This file is part of a Qt Solutions component. +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Solutions Commercial License Agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** Please note Third Party Software included with Qt Solutions may impose +** additional restrictions and it is the user's responsibility to ensure +** that they have met the licensing requirements of the GPL, LGPL, or Qt +** Solutions Commercial license and the relevant license of the Third +** Party Software they are using. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "qtcolorpicker.h" + +/*! \class QtColorPicker + + \brief The QtColorPicker class provides a widget for selecting + colors from a popup color grid. + + Users can invoke the color picker by clicking on it, or by + navigating to it and pressing Space. They can use the mouse or + arrow keys to navigate between colors on the grid, and select a + color by clicking or by pressing Enter or Space. The + colorChanged() signal is emitted whenever the color picker's color + changes. + + The widget also supports negative selection: Users can click and + hold the mouse button on the QtColorPicker widget, then move the + mouse over the color grid and release the mouse button over the + color they wish to select. + + The color grid shows a customized selection of colors. An optional + ellipsis "..." button (signifying "more") can be added at the + bottom of the grid; if the user presses this, a QColorDialog pops + up and lets them choose any color they like. This button is made + available by using setColorDialogEnabled(). + + When a color is selected, the QtColorPicker widget shows the color + and its name. If the name cannot be determined, the translatable + name "Custom" is used. + + The QtColorPicker object is optionally initialized with the number + of columns in the color grid. Colors are then added left to right, + top to bottom using insertColor(). If the number of columns is not + set, QtColorPicker calculates the number of columns and rows that + will make the grid as square as possible. + + \code + DrawWidget::DrawWidget(QWidget *parent, const char *name) + { + QtColorPicker *picker = new QtColorPicker(this); + picker->insertColor(red, "Red")); + picker->insertColor(QColor("green"), "Green")); + picker->insertColor(QColor(0, 0, 255), "Blue")); + picker->insertColor(white); + + connect(colors, SIGNAL(colorChanged(const QColor &)), SLOT(setCurrentColor(const QColor &))); + } + \endcode + + An alternative to adding colors manually is to initialize the grid + with QColorDialog's standard colors using setStandardColors(). + + QtColorPicker also provides a the static function getColor(), + which pops up the grid of standard colors at any given point. + + \img colorpicker1.png + \img colorpicker2.png + + \sa QColorDialog +*/ + +/*! \fn QtColorPicker::colorChanged(const QColor &color) + + This signal is emitted when the QtColorPicker's color is changed. + \a color is the new color. + + To obtain the color's name, use text(). +*/ + +/* + A class that acts very much like a QPushButton. It's not styled, + so we can expect the exact same look, feel and geometry + everywhere. Also, this button always emits clicked on + mouseRelease, even if the mouse button was not pressed inside the + widget. +*/ +class ColorPickerButton : public QFrame +{ + Q_OBJECT + +public: + ColorPickerButton(QWidget *parent); + +signals: + void clicked(); + +protected: + void mousePressEvent(QMouseEvent *e); + void mouseMoveEvent(QMouseEvent *e); + void mouseReleaseEvent(QMouseEvent *e); + void keyPressEvent(QKeyEvent *e); + void keyReleaseEvent(QKeyEvent *e); + void paintEvent(QPaintEvent *e); + void focusInEvent(QFocusEvent *e); + void focusOutEvent(QFocusEvent *e); +}; + +/* + This class represents each "color" or item in the color grid. +*/ +class ColorPickerItem : public QFrame +{ + Q_OBJECT + +public: + ColorPickerItem(const QColor &color = Qt::white, const QString &text = QString::null, + QWidget *parent = 0); + ~ColorPickerItem(); + + QColor color() const; + QString text() const; + + void setSelected(bool); + bool isSelected() const; +signals: + void clicked(); + void selected(); + +public slots: + void setColor(const QColor &color, const QString &text = QString()); + +protected: + void mousePressEvent(QMouseEvent *e); + void mouseReleaseEvent(QMouseEvent *e); + void mouseMoveEvent(QMouseEvent *e); + void paintEvent(QPaintEvent *e); + +private: + QColor c; + QString t; + bool sel; +}; + +/* + +*/ +class ColorPickerPopup : public QFrame +{ + Q_OBJECT + +public: + ColorPickerPopup(int width, bool withColorDialog, + QWidget *parent = 0); + ~ColorPickerPopup(); + + void insertColor(const QColor &col, const QString &text, int index); + void exec(); + + void setExecFlag(); + + QColor lastSelected() const; + + ColorPickerItem *find(const QColor &col) const; + QColor color(int index) const; + +signals: + void selected(const QColor &); + void hid(); + +public slots: + void getColorFromDialog(); + +protected slots: + void updateSelected(); + +protected: + void keyPressEvent(QKeyEvent *e); + void showEvent(QShowEvent *e); + void hideEvent(QHideEvent *e); + void mouseReleaseEvent(QMouseEvent *e); + + void regenerateGrid(); + +private: + QMap > widgetAt; + QList items; + QGridLayout *grid; + ColorPickerButton *moreButton; + QEventLoop *eventLoop; + + int lastPos; + int cols; + QColor lastSel; +}; + +/*! + Constructs a QtColorPicker widget. The popup will display a grid + with \a cols columns, or if \a cols is -1, the number of columns + will be calculated automatically. + + If \a enableColorDialog is true, the popup will also have a "More" + button (signified by an ellipsis "...") that presents a + QColorDialog when clicked. + + After constructing a QtColorPicker, call insertColor() to add + individual colors to the popup grid, or call setStandardColors() + to add all the standard colors in one go. + + The \a parent argument is passed to QFrame's constructor. + + \sa QFrame +*/ +QtColorPicker::QtColorPicker(QWidget *parent, + int cols, bool enableColorDialog) + : QPushButton(parent), popup(0), withColorDialog(enableColorDialog) +{ + setFocusPolicy(Qt::StrongFocus); + setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); + setAutoDefault(false); + setAutoFillBackground(true); + setCheckable(true); + + // Set text + setText(tr("Black")); + firstInserted = false; + + // Create and set icon + col = Qt::black; + dirty = true; + + // Create color grid popup and connect to it. + popup = new ColorPickerPopup(cols, withColorDialog, this); + connect(popup, SIGNAL(selected(const QColor &)), + SLOT(setCurrentColor(const QColor &))); + connect(popup, SIGNAL(hid()), SLOT(popupClosed())); + + // Connect this push button's pressed() signal. + connect(this, SIGNAL(toggled(bool)), SLOT(buttonPressed(bool))); +} + +/*! + Destructs the QtColorPicker. +*/ +QtColorPicker::~QtColorPicker() +{ +} + +/*! \internal + + Pops up the color grid, and makes sure the status of + QtColorPicker's button is right. +*/ +void QtColorPicker::buttonPressed(bool toggled) +{ + if (!toggled) + return; + + const QRect desktop = QApplication::desktop()->geometry(); + // Make sure the popup is inside the desktop. + QPoint pos = mapToGlobal(rect().bottomLeft()); + if (pos.x() < desktop.left()) + pos.setX(desktop.left()); + if (pos.y() < desktop.top()) + pos.setY(desktop.top()); + + if ((pos.x() + popup->sizeHint().width()) > desktop.width()) + pos.setX(desktop.width() - popup->sizeHint().width()); + if ((pos.y() + popup->sizeHint().height()) > desktop.bottom()) + pos.setY(desktop.bottom() - popup->sizeHint().height()); + popup->move(pos); + + if (ColorPickerItem *item = popup->find(col)) + item->setSelected(true); + + // Remove focus from this widget, preventing the focus rect + // from showing when the popup is shown. Order an update to + // make sure the focus rect is cleared. + clearFocus(); + update(); + + // Allow keyboard navigation as soon as the popup shows. + popup->setFocus(); + + // Execute the popup. The popup will enter the event loop. + popup->show(); +} + +/*! + \internal +*/ +void QtColorPicker::paintEvent(QPaintEvent *e) +{ + if (dirty) { + int iconSize = style()->pixelMetric(QStyle::PM_SmallIconSize); + QPixmap pix(iconSize, iconSize); + pix.fill(palette().button().color()); + + QPainter p(&pix); + + int w = pix.width(); // width of cell in pixels + int h = pix.height(); // height of cell in pixels + p.setPen(QPen(Qt::gray)); + p.setBrush(col); + p.drawRect(2, 2, w - 5, h - 5); + setIcon(QIcon(pix)); + + dirty = false; + } + QPushButton::paintEvent(e); +} + +/*! \internal + + Makes sure the button isn't pressed when the popup hides. +*/ +void QtColorPicker::popupClosed() +{ + setChecked(false); + setFocus(); +} + +/*! + Returns the currently selected color. + + \sa text() +*/ +QColor QtColorPicker::currentColor() const +{ + return col; +} + +/*! + Returns the color at position \a index. +*/ +QColor QtColorPicker::color(int index) const +{ + return popup->color(index); +} + +/*! + Adds the 17 predefined colors from the Qt namespace. + + (The names given to the colors, "Black", "White", "Red", etc., are + all translatable.) + + \sa insertColor() +*/ +void QtColorPicker::setStandardColors() +{ + insertColor(Qt::black, tr("Black")); + insertColor(Qt::white, tr("White")); + insertColor(Qt::red, tr("Red")); + insertColor(Qt::darkRed, tr("Dark red")); + insertColor(Qt::green, tr("Green")); + insertColor(Qt::darkGreen, tr("Dark green")); + insertColor(Qt::blue, tr("Blue")); + insertColor(Qt::darkBlue, tr("Dark blue")); + insertColor(Qt::cyan, tr("Cyan")); + insertColor(Qt::darkCyan, tr("Dark cyan")); + insertColor(Qt::magenta, tr("Magenta")); + insertColor(Qt::darkMagenta, tr("Dark magenta")); + insertColor(Qt::yellow, tr("Yellow")); + insertColor(Qt::darkYellow, tr("Dark yellow")); + insertColor(Qt::gray, tr("Gray")); + insertColor(Qt::darkGray, tr("Dark gray")); + insertColor(Qt::lightGray, tr("Light gray")); +} + + +/*! + Makes \a color current. If \a color is not already in the color grid, it + is inserted with the text "Custom". + + This function emits the colorChanged() signal if the new color is + valid, and different from the old one. +*/ +void QtColorPicker::setCurrentColor(const QColor &color) +{ + if (col == color || !color.isValid()) + return; + + ColorPickerItem *item = popup->find(color); + if (!item) { + insertColor(color, tr("Custom")); + item = popup->find(color); + } + + col = color; + setText(item->text()); + + dirty = true; + + popup->hide(); + repaint(); + + item->setSelected(true); + emit colorChanged(color); +} + +/*! + Adds the color \a color with the name \a text to the color grid, + at position \a index. If index is -1, the color is assigned + automatically assigned a position, starting from left to right, + top to bottom. +*/ +void QtColorPicker::insertColor(const QColor &color, const QString &text, int index) +{ + popup->insertColor(color, text, index); + if (!firstInserted) { + col = color; + setText(text); + firstInserted = true; + } +} + +/*! \property QtColorPicker::colorDialog + \brief Whether the ellipsis "..." (more) button is available. + + If this property is set to TRUE, the color grid popup will include + a "More" button (signified by an ellipsis, "...") which pops up a + QColorDialog when clicked. The user will then be able to select + any custom color they like. +*/ +void QtColorPicker::setColorDialogEnabled(bool enabled) +{ + withColorDialog = enabled; +} +bool QtColorPicker::colorDialogEnabled() const +{ + return withColorDialog; +} + +/*! + Pops up a color grid with Qt default colors at \a point, using + global coordinates. If \a allowCustomColors is true, there will + also be a button on the popup that invokes QColorDialog. + + For example: + + \code + void Drawer::mouseReleaseEvent(QMouseEvent *e) + { + if (e->button() & RightButton) { + QColor color = QtColorPicker::getColor(mapToGlobal(e->pos())); + } + } + \endcode +*/ +QColor QtColorPicker::getColor(const QPoint &point, bool allowCustomColors) +{ + ColorPickerPopup popup(-1, allowCustomColors); + + popup.insertColor(Qt::black, tr("Black"), 0); + popup.insertColor(Qt::white, tr("White"), 1); + popup.insertColor(Qt::red, tr("Red"), 2); + popup.insertColor(Qt::darkRed, tr("Dark red"), 3); + popup.insertColor(Qt::green, tr("Green"), 4); + popup.insertColor(Qt::darkGreen, tr("Dark green"), 5); + popup.insertColor(Qt::blue, tr("Blue"), 6); + popup.insertColor(Qt::darkBlue, tr("Dark blue"), 7); + popup.insertColor(Qt::cyan, tr("Cyan"), 8); + popup.insertColor(Qt::darkCyan, tr("Dark cyan"), 9); + popup.insertColor(Qt::magenta, tr("Magenta"), 10); + popup.insertColor(Qt::darkMagenta, tr("Dark magenta"), 11); + popup.insertColor(Qt::yellow, tr("Yellow"), 12); + popup.insertColor(Qt::darkYellow, tr("Dark yellow"), 13); + popup.insertColor(Qt::gray, tr("Gray"), 14); + popup.insertColor(Qt::darkGray, tr("Dark gray"), 15); + popup.insertColor(Qt::lightGray, tr("Light gray"), 16); + + popup.move(point); + popup.exec(); + return popup.lastSelected(); +} + +/*! \internal + + Constructs the popup widget. +*/ +ColorPickerPopup::ColorPickerPopup(int width, bool withColorDialog, + QWidget *parent) + : QFrame(parent, Qt::Popup) +{ + setFrameStyle(QFrame::StyledPanel); + setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + + setFocusPolicy(Qt::StrongFocus); + setMouseTracking(true); + cols = width; + + if (withColorDialog) { + moreButton = new ColorPickerButton(this); + moreButton->setFixedWidth(24); + moreButton->setFixedHeight(21); + moreButton->setFrameRect(QRect(2, 2, 20, 17)); + connect(moreButton, SIGNAL(clicked()), SLOT(getColorFromDialog())); + } else { + moreButton = 0; + } + + eventLoop = 0; + grid = 0; + regenerateGrid(); +} + + +/*! \internal + + Destructs the popup widget. +*/ +ColorPickerPopup::~ColorPickerPopup() +{ + if (eventLoop) + eventLoop->exit(); +} + +/*! \internal + + If there is an item whole color is equal to \a col, returns a + pointer to this item; otherwise returns 0. +*/ +ColorPickerItem *ColorPickerPopup::find(const QColor &col) const +{ + for (int i = 0; i < items.size(); ++i) { + if (items.at(i) && items.at(i)->color() == col) + return items.at(i); + } + + return 0; +} + +/*! \internal + + Adds \a item to the grid. The items are added from top-left to + bottom-right. +*/ +void ColorPickerPopup::insertColor(const QColor &col, const QString &text, int index) +{ + // Don't add colors that we have already. + ColorPickerItem *existingItem = find(col); + ColorPickerItem *lastSelectedItem = find(lastSelected()); + + if (existingItem) { + if (lastSelectedItem && existingItem != lastSelectedItem) + lastSelectedItem->setSelected(false); + existingItem->setFocus(); + existingItem->setSelected(true); + return; + } + + ColorPickerItem *item = new ColorPickerItem(col, text, this); + + if (lastSelectedItem) { + lastSelectedItem->setSelected(false); + } + else { + item->setSelected(true); + lastSel = col; + } + item->setFocus(); + + connect(item, SIGNAL(selected()), SLOT(updateSelected())); + + if (index == -1) + index = items.count(); + + items.insert((unsigned int)index, item); + regenerateGrid(); + + update(); +} + +/*! \internal + +*/ +QColor ColorPickerPopup::color(int index) const +{ + if (index < 0 || index > (int) items.count() - 1) + return QColor(); + + ColorPickerPopup *that = (ColorPickerPopup *)this; + return that->items.at(index)->color(); +} + +/*! \internal + +*/ +void ColorPickerPopup::exec() +{ + show(); + + QEventLoop e; + eventLoop = &e; + (void) e.exec(); + eventLoop = 0; +} + +/*! \internal + +*/ +void ColorPickerPopup::updateSelected() +{ + QLayoutItem *layoutItem; + int i = 0; + while ((layoutItem = grid->itemAt(i)) != 0) { + QWidget *w = layoutItem->widget(); + if (w && w->inherits("ColorPickerItem")) { + ColorPickerItem *litem = reinterpret_cast(layoutItem->widget()); + if (litem != sender()) + litem->setSelected(false); + } + ++i; + } + + if (sender() && sender()->inherits("ColorPickerItem")) { + ColorPickerItem *item = (ColorPickerItem *)sender(); + lastSel = item->color(); + emit selected(item->color()); + } + + hide(); +} + +/*! \internal + +*/ +void ColorPickerPopup::mouseReleaseEvent(QMouseEvent *e) +{ + if (!rect().contains(e->pos())) + hide(); +} + +/*! \internal + + Controls keyboard navigation and selection on the color grid. +*/ +void ColorPickerPopup::keyPressEvent(QKeyEvent *e) +{ + int curRow = 0; + int curCol = 0; + + bool foundFocus = false; + for (int j = 0; !foundFocus && j < grid->rowCount(); ++j) { + for (int i = 0; !foundFocus && i < grid->columnCount(); ++i) { + if (widgetAt[j][i] && widgetAt[j][i]->hasFocus()) { + curRow = j; + curCol = i; + foundFocus = true; + break; + } + } + } + + switch (e->key()) { + case Qt::Key_Left: + if (curCol > 0) --curCol; + else if (curRow > 0) { --curRow; curCol = grid->columnCount() - 1; } + break; + case Qt::Key_Right: + if (curCol < grid->columnCount() - 1 && widgetAt[curRow][curCol + 1]) ++curCol; + else if (curRow < grid->rowCount() - 1) { ++curRow; curCol = 0; } + break; + case Qt::Key_Up: + if (curRow > 0) --curRow; + else curCol = 0; + break; + case Qt::Key_Down: + if (curRow < grid->rowCount() - 1) { + QWidget *w = widgetAt[curRow + 1][curCol]; + if (w) { + ++curRow; + } else for (int i = 1; i < grid->columnCount(); ++i) { + if (!widgetAt[curRow + 1][i]) { + curCol = i - 1; + ++curRow; + break; + } + } + } + break; + case Qt::Key_Space: + case Qt::Key_Return: + case Qt::Key_Enter: { + QWidget *w = widgetAt[curRow][curCol]; + if (w && w->inherits("ColorPickerItem")) { + ColorPickerItem *wi = reinterpret_cast(w); + wi->setSelected(true); + + QLayoutItem *layoutItem; + int i = 0; + while ((layoutItem = grid->itemAt(i)) != 0) { + QWidget *w = layoutItem->widget(); + if (w && w->inherits("ColorPickerItem")) { + ColorPickerItem *litem + = reinterpret_cast(layoutItem->widget()); + if (litem != wi) + litem->setSelected(false); + } + ++i; + } + + lastSel = wi->color(); + emit selected(wi->color()); + hide(); + } else if (w && w->inherits("QPushButton")) { + ColorPickerItem *wi = reinterpret_cast(w); + wi->setSelected(true); + + QLayoutItem *layoutItem; + int i = 0; + while ((layoutItem = grid->itemAt(i)) != 0) { + QWidget *w = layoutItem->widget(); + if (w && w->inherits("ColorPickerItem")) { + ColorPickerItem *litem + = reinterpret_cast(layoutItem->widget()); + if (litem != wi) + litem->setSelected(false); + } + ++i; + } + + lastSel = wi->color(); + emit selected(wi->color()); + hide(); + } + } + break; + case Qt::Key_Escape: + hide(); + break; + default: + e->ignore(); + break; + } + + widgetAt[curRow][curCol]->setFocus(); +} + +/*! \internal + +*/ +void ColorPickerPopup::hideEvent(QHideEvent *e) +{ + if (eventLoop) { + eventLoop->exit(); + } + + setFocus(); + + emit hid(); + QFrame::hideEvent(e); +} + +/*! \internal + +*/ +QColor ColorPickerPopup::lastSelected() const +{ + return lastSel; +} + +/*! \internal + + Sets focus on the popup to enable keyboard navigation. Draws + focusRect and selection rect. +*/ +void ColorPickerPopup::showEvent(QShowEvent *) +{ + bool foundSelected = false; + for (int i = 0; i < grid->columnCount(); ++i) { + for (int j = 0; j < grid->rowCount(); ++j) { + QWidget *w = widgetAt[j][i]; + if (w && w->inherits("ColorPickerItem")) { + if (((ColorPickerItem *)w)->isSelected()) { + w->setFocus(); + foundSelected = true; + break; + } + } + } + } + + if (!foundSelected) { + if (items.count() == 0) + setFocus(); + else + widgetAt[0][0]->setFocus(); + } +} + +/*! + +*/ +void ColorPickerPopup::regenerateGrid() +{ + widgetAt.clear(); + + int columns = cols; + if (columns == -1) + columns = (int) ceil(sqrt((float) items.count())); + + // When the number of columns grows, the number of rows will + // fall. There's no way to shrink a grid, so we create a new + // one. + if (grid) delete grid; + grid = new QGridLayout(this); + grid->setMargin(1); + grid->setSpacing(0); + + int ccol = 0, crow = 0; + for (int i = 0; i < items.size(); ++i) { + if (items.at(i)) { + widgetAt[crow][ccol] = items.at(i); + grid->addWidget(items.at(i), crow, ccol++); + if (ccol == columns) { + ++crow; + ccol = 0; + } + } + } + + if (moreButton) { + grid->addWidget(moreButton, crow, ccol); + widgetAt[crow][ccol] = moreButton; + } + updateGeometry(); +} + +/*! \internal + + Copies the color dialog's currently selected item and emits + itemSelected(). +*/ +void ColorPickerPopup::getColorFromDialog() +{ + bool ok; + QRgb rgb = QColorDialog::getRgba(lastSel.rgba(), &ok, parentWidget()); + if (!ok) + return; + + QColor col = QColor::fromRgba(rgb); + insertColor(col, tr("Custom"), -1); + lastSel = col; + emit selected(col); +} + +/*! + Constructs a ColorPickerItem whose color is set to \a color, and + whose name is set to \a text. +*/ +ColorPickerItem::ColorPickerItem(const QColor &color, const QString &text, + QWidget *parent) + : QFrame(parent), c(color), t(text), sel(false) +{ + setToolTip(t); + setFixedWidth(24); + setFixedHeight(21); +} + +/*! + Destructs a ColorPickerItem. + */ +ColorPickerItem::~ColorPickerItem() +{ +} + +/*! + Returns the item's color. + + \sa text() +*/ +QColor ColorPickerItem::color() const +{ + return c; +} + +/*! + Returns the item's text. + + \sa color() +*/ +QString ColorPickerItem::text() const +{ + return t; +} + +/*! + +*/ +bool ColorPickerItem::isSelected() const +{ + return sel; +} + +/*! + +*/ +void ColorPickerItem::setSelected(bool selected) +{ + sel = selected; + update(); +} + +/*! + Sets the item's color to \a color, and its name to \a text. +*/ +void ColorPickerItem::setColor(const QColor &color, const QString &text) +{ + c = color; + t = text; + setToolTip(t); + update(); +} + +/*! + +*/ +void ColorPickerItem::mouseMoveEvent(QMouseEvent *) +{ + setFocus(); + update(); +} + +/*! + +*/ +void ColorPickerItem::mouseReleaseEvent(QMouseEvent *) +{ + sel = true; + emit selected(); +} + +/*! + +*/ +void ColorPickerItem::mousePressEvent(QMouseEvent *) +{ + setFocus(); + update(); +} + +/*! + +*/ +void ColorPickerItem::paintEvent(QPaintEvent *) +{ + QPainter p(this); + int w = width(); // width of cell in pixels + int h = height(); // height of cell in pixels + + p.setPen( QPen( Qt::gray, 0, Qt::SolidLine ) ); + + if (sel) + p.drawRect(1, 1, w - 3, h - 3); + + p.setPen( QPen( Qt::black, 0, Qt::SolidLine ) ); + p.drawRect(3, 3, w - 7, h - 7); + p.fillRect(QRect(4, 4, w - 8, h - 8), QBrush(c)); + + if (hasFocus()) + p.drawRect(0, 0, w - 1, h - 1); +} + +/*! + +*/ +ColorPickerButton::ColorPickerButton(QWidget *parent) + : QFrame(parent) +{ + setFrameStyle(StyledPanel); +} + +/*! + +*/ +void ColorPickerButton::mousePressEvent(QMouseEvent *) +{ + setFrameShadow(Sunken); + update(); +} + +/*! + +*/ +void ColorPickerButton::mouseMoveEvent(QMouseEvent *) +{ + setFocus(); + update(); +} + +/*! + +*/ +void ColorPickerButton::mouseReleaseEvent(QMouseEvent *) +{ + setFrameShadow(Raised); + repaint(); + emit clicked(); +} + +/*! + +*/ +void ColorPickerButton::keyPressEvent(QKeyEvent *e) +{ + if (e->key() == Qt::Key_Up + || e->key() == Qt::Key_Down + || e->key() == Qt::Key_Left + || e->key() == Qt::Key_Right) { + qApp->sendEvent(parent(), e); + } else if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Space || e->key() == Qt::Key_Return) { + setFrameShadow(Sunken); + update(); + } else { + QFrame::keyPressEvent(e); + } +} + +/*! + +*/ +void ColorPickerButton::keyReleaseEvent(QKeyEvent *e) +{ + if (e->key() == Qt::Key_Up + || e->key() == Qt::Key_Down + || e->key() == Qt::Key_Left + || e->key() == Qt::Key_Right) { + qApp->sendEvent(parent(), e); + } else if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Space || e->key() == Qt::Key_Return) { + setFrameShadow(Raised); + repaint(); + emit clicked(); + } else { + QFrame::keyReleaseEvent(e); + } + +} + +/*! + +*/ +void ColorPickerButton::focusInEvent(QFocusEvent *e) +{ + setFrameShadow(Raised); + update(); + QFrame::focusOutEvent(e); +} + +/*! + +*/ +void ColorPickerButton::focusOutEvent(QFocusEvent *e) +{ + setFrameShadow(Raised); + update(); + QFrame::focusOutEvent(e); +} + +/*! + +*/ +void ColorPickerButton::paintEvent(QPaintEvent *e) +{ + QFrame::paintEvent(e); + + QPainter p(this); + p.fillRect(contentsRect(), palette().button()); + + QRect r = rect(); + + int offset = frameShadow() == Sunken ? 1 : 0; + + QPen pen(palette().buttonText(), 1); + p.setPen(pen); + + p.drawRect(r.center().x() + offset - 4, r.center().y() + offset, 1, 1); + p.drawRect(r.center().x() + offset , r.center().y() + offset, 1, 1); + p.drawRect(r.center().x() + offset + 4, r.center().y() + offset, 1, 1); + if (hasFocus()) { + p.setPen( QPen( Qt::black, 0, Qt::SolidLine ) ); + p.drawRect(0, 0, width() - 1, height() - 1); + } + + p.end(); + +} + +#include "qtcolorpicker.moc" + === removed file 'qtiplot/src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.cpp' --- qtiplot/src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.cpp 1970-01-01 00:00:00 +0000 @@ -1,1144 +0,0 @@ -/**************************************************************************** -** -** This file is part of a Qt Solutions component. -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Qt Software Information (qt-info@nokia.com) -** -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Solutions Commercial License Agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** Please note Third Party Software included with Qt Solutions may impose -** additional restrictions and it is the user's responsibility to ensure -** that they have met the licensing requirements of the GPL, LGPL, or Qt -** Solutions Commercial license and the relevant license of the Third -** Party Software they are using. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** -****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "qtcolorpicker.h" - -/*! \class QtColorPicker - - \brief The QtColorPicker class provides a widget for selecting - colors from a popup color grid. - - Users can invoke the color picker by clicking on it, or by - navigating to it and pressing Space. They can use the mouse or - arrow keys to navigate between colors on the grid, and select a - color by clicking or by pressing Enter or Space. The - colorChanged() signal is emitted whenever the color picker's color - changes. - - The widget also supports negative selection: Users can click and - hold the mouse button on the QtColorPicker widget, then move the - mouse over the color grid and release the mouse button over the - color they wish to select. - - The color grid shows a customized selection of colors. An optional - ellipsis "..." button (signifying "more") can be added at the - bottom of the grid; if the user presses this, a QColorDialog pops - up and lets them choose any color they like. This button is made - available by using setColorDialogEnabled(). - - When a color is selected, the QtColorPicker widget shows the color - and its name. If the name cannot be determined, the translatable - name "Custom" is used. - - The QtColorPicker object is optionally initialized with the number - of columns in the color grid. Colors are then added left to right, - top to bottom using insertColor(). If the number of columns is not - set, QtColorPicker calculates the number of columns and rows that - will make the grid as square as possible. - - \code - DrawWidget::DrawWidget(QWidget *parent, const char *name) - { - QtColorPicker *picker = new QtColorPicker(this); - picker->insertColor(red, "Red")); - picker->insertColor(QColor("green"), "Green")); - picker->insertColor(QColor(0, 0, 255), "Blue")); - picker->insertColor(white); - - connect(colors, SIGNAL(colorChanged(const QColor &)), SLOT(setCurrentColor(const QColor &))); - } - \endcode - - An alternative to adding colors manually is to initialize the grid - with QColorDialog's standard colors using setStandardColors(). - - QtColorPicker also provides a the static function getColor(), - which pops up the grid of standard colors at any given point. - - \img colorpicker1.png - \img colorpicker2.png - - \sa QColorDialog -*/ - -/*! \fn QtColorPicker::colorChanged(const QColor &color) - - This signal is emitted when the QtColorPicker's color is changed. - \a color is the new color. - - To obtain the color's name, use text(). -*/ - -/* - A class that acts very much like a QPushButton. It's not styled, - so we can expect the exact same look, feel and geometry - everywhere. Also, this button always emits clicked on - mouseRelease, even if the mouse button was not pressed inside the - widget. -*/ -class ColorPickerButton : public QFrame -{ - Q_OBJECT - -public: - ColorPickerButton(QWidget *parent); - -signals: - void clicked(); - -protected: - void mousePressEvent(QMouseEvent *e); - void mouseMoveEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *e); - void keyPressEvent(QKeyEvent *e); - void keyReleaseEvent(QKeyEvent *e); - void paintEvent(QPaintEvent *e); - void focusInEvent(QFocusEvent *e); - void focusOutEvent(QFocusEvent *e); -}; - -/* - This class represents each "color" or item in the color grid. -*/ -class ColorPickerItem : public QFrame -{ - Q_OBJECT - -public: - ColorPickerItem(const QColor &color = Qt::white, const QString &text = QString::null, - QWidget *parent = 0); - ~ColorPickerItem(); - - QColor color() const; - QString text() const; - - void setSelected(bool); - bool isSelected() const; -signals: - void clicked(); - void selected(); - -public slots: - void setColor(const QColor &color, const QString &text = QString()); - -protected: - void mousePressEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *e); - void mouseMoveEvent(QMouseEvent *e); - void paintEvent(QPaintEvent *e); - -private: - QColor c; - QString t; - bool sel; -}; - -/* - -*/ -class ColorPickerPopup : public QFrame -{ - Q_OBJECT - -public: - ColorPickerPopup(int width, bool withColorDialog, - QWidget *parent = 0); - ~ColorPickerPopup(); - - void insertColor(const QColor &col, const QString &text, int index); - void exec(); - - void setExecFlag(); - - QColor lastSelected() const; - - ColorPickerItem *find(const QColor &col) const; - QColor color(int index) const; - -signals: - void selected(const QColor &); - void hid(); - -public slots: - void getColorFromDialog(); - -protected slots: - void updateSelected(); - -protected: - void keyPressEvent(QKeyEvent *e); - void showEvent(QShowEvent *e); - void hideEvent(QHideEvent *e); - void mouseReleaseEvent(QMouseEvent *e); - - void regenerateGrid(); - -private: - QMap > widgetAt; - QList items; - QGridLayout *grid; - ColorPickerButton *moreButton; - QEventLoop *eventLoop; - - int lastPos; - int cols; - QColor lastSel; -}; - -/*! - Constructs a QtColorPicker widget. The popup will display a grid - with \a cols columns, or if \a cols is -1, the number of columns - will be calculated automatically. - - If \a enableColorDialog is true, the popup will also have a "More" - button (signified by an ellipsis "...") that presents a - QColorDialog when clicked. - - After constructing a QtColorPicker, call insertColor() to add - individual colors to the popup grid, or call setStandardColors() - to add all the standard colors in one go. - - The \a parent argument is passed to QFrame's constructor. - - \sa QFrame -*/ -QtColorPicker::QtColorPicker(QWidget *parent, - int cols, bool enableColorDialog) - : QPushButton(parent), popup(0), withColorDialog(enableColorDialog) -{ - setFocusPolicy(Qt::StrongFocus); - setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); - setAutoDefault(false); - setAutoFillBackground(true); - setCheckable(true); - - // Set text - setText(tr("Black")); - firstInserted = false; - - // Create and set icon - col = Qt::black; - dirty = true; - - // Create color grid popup and connect to it. - popup = new ColorPickerPopup(cols, withColorDialog, this); - connect(popup, SIGNAL(selected(const QColor &)), - SLOT(setCurrentColor(const QColor &))); - connect(popup, SIGNAL(hid()), SLOT(popupClosed())); - - // Connect this push button's pressed() signal. - connect(this, SIGNAL(toggled(bool)), SLOT(buttonPressed(bool))); -} - -/*! - Destructs the QtColorPicker. -*/ -QtColorPicker::~QtColorPicker() -{ -} - -/*! \internal - - Pops up the color grid, and makes sure the status of - QtColorPicker's button is right. -*/ -void QtColorPicker::buttonPressed(bool toggled) -{ - if (!toggled) - return; - - const QRect desktop = QApplication::desktop()->geometry(); - // Make sure the popup is inside the desktop. - QPoint pos = mapToGlobal(rect().bottomLeft()); - if (pos.x() < desktop.left()) - pos.setX(desktop.left()); - if (pos.y() < desktop.top()) - pos.setY(desktop.top()); - - if ((pos.x() + popup->sizeHint().width()) > desktop.width()) - pos.setX(desktop.width() - popup->sizeHint().width()); - if ((pos.y() + popup->sizeHint().height()) > desktop.bottom()) - pos.setY(desktop.bottom() - popup->sizeHint().height()); - popup->move(pos); - - if (ColorPickerItem *item = popup->find(col)) - item->setSelected(true); - - // Remove focus from this widget, preventing the focus rect - // from showing when the popup is shown. Order an update to - // make sure the focus rect is cleared. - clearFocus(); - update(); - - // Allow keyboard navigation as soon as the popup shows. - popup->setFocus(); - - // Execute the popup. The popup will enter the event loop. - popup->show(); -} - -/*! - \internal -*/ -void QtColorPicker::paintEvent(QPaintEvent *e) -{ - if (dirty) { - int iconSize = style()->pixelMetric(QStyle::PM_SmallIconSize); - QPixmap pix(iconSize, iconSize); - pix.fill(palette().button().color()); - - QPainter p(&pix); - - int w = pix.width(); // width of cell in pixels - int h = pix.height(); // height of cell in pixels - p.setPen(QPen(Qt::gray)); - p.setBrush(col); - p.drawRect(2, 2, w - 5, h - 5); - setIcon(QIcon(pix)); - - dirty = false; - } - QPushButton::paintEvent(e); -} - -/*! \internal - - Makes sure the button isn't pressed when the popup hides. -*/ -void QtColorPicker::popupClosed() -{ - setChecked(false); - setFocus(); -} - -/*! - Returns the currently selected color. - - \sa text() -*/ -QColor QtColorPicker::currentColor() const -{ - return col; -} - -/*! - Returns the color at position \a index. -*/ -QColor QtColorPicker::color(int index) const -{ - return popup->color(index); -} - -/*! - Adds the 17 predefined colors from the Qt namespace. - - (The names given to the colors, "Black", "White", "Red", etc., are - all translatable.) - - \sa insertColor() -*/ -void QtColorPicker::setStandardColors() -{ - insertColor(Qt::black, tr("Black")); - insertColor(Qt::white, tr("White")); - insertColor(Qt::red, tr("Red")); - insertColor(Qt::darkRed, tr("Dark red")); - insertColor(Qt::green, tr("Green")); - insertColor(Qt::darkGreen, tr("Dark green")); - insertColor(Qt::blue, tr("Blue")); - insertColor(Qt::darkBlue, tr("Dark blue")); - insertColor(Qt::cyan, tr("Cyan")); - insertColor(Qt::darkCyan, tr("Dark cyan")); - insertColor(Qt::magenta, tr("Magenta")); - insertColor(Qt::darkMagenta, tr("Dark magenta")); - insertColor(Qt::yellow, tr("Yellow")); - insertColor(Qt::darkYellow, tr("Dark yellow")); - insertColor(Qt::gray, tr("Gray")); - insertColor(Qt::darkGray, tr("Dark gray")); - insertColor(Qt::lightGray, tr("Light gray")); -} - - -/*! - Makes \a color current. If \a color is not already in the color grid, it - is inserted with the text "Custom". - - This function emits the colorChanged() signal if the new color is - valid, and different from the old one. -*/ -void QtColorPicker::setCurrentColor(const QColor &color) -{ - if (col == color || !color.isValid()) - return; - - ColorPickerItem *item = popup->find(color); - if (!item) { - insertColor(color, tr("Custom")); - item = popup->find(color); - } - - col = color; - setText(item->text()); - - dirty = true; - - popup->hide(); - repaint(); - - item->setSelected(true); - emit colorChanged(color); -} - -/*! - Adds the color \a color with the name \a text to the color grid, - at position \a index. If index is -1, the color is assigned - automatically assigned a position, starting from left to right, - top to bottom. -*/ -void QtColorPicker::insertColor(const QColor &color, const QString &text, int index) -{ - popup->insertColor(color, text, index); - if (!firstInserted) { - col = color; - setText(text); - firstInserted = true; - } -} - -/*! \property QtColorPicker::colorDialog - \brief Whether the ellipsis "..." (more) button is available. - - If this property is set to TRUE, the color grid popup will include - a "More" button (signified by an ellipsis, "...") which pops up a - QColorDialog when clicked. The user will then be able to select - any custom color they like. -*/ -void QtColorPicker::setColorDialogEnabled(bool enabled) -{ - withColorDialog = enabled; -} -bool QtColorPicker::colorDialogEnabled() const -{ - return withColorDialog; -} - -/*! - Pops up a color grid with Qt default colors at \a point, using - global coordinates. If \a allowCustomColors is true, there will - also be a button on the popup that invokes QColorDialog. - - For example: - - \code - void Drawer::mouseReleaseEvent(QMouseEvent *e) - { - if (e->button() & RightButton) { - QColor color = QtColorPicker::getColor(mapToGlobal(e->pos())); - } - } - \endcode -*/ -QColor QtColorPicker::getColor(const QPoint &point, bool allowCustomColors) -{ - ColorPickerPopup popup(-1, allowCustomColors); - - popup.insertColor(Qt::black, tr("Black"), 0); - popup.insertColor(Qt::white, tr("White"), 1); - popup.insertColor(Qt::red, tr("Red"), 2); - popup.insertColor(Qt::darkRed, tr("Dark red"), 3); - popup.insertColor(Qt::green, tr("Green"), 4); - popup.insertColor(Qt::darkGreen, tr("Dark green"), 5); - popup.insertColor(Qt::blue, tr("Blue"), 6); - popup.insertColor(Qt::darkBlue, tr("Dark blue"), 7); - popup.insertColor(Qt::cyan, tr("Cyan"), 8); - popup.insertColor(Qt::darkCyan, tr("Dark cyan"), 9); - popup.insertColor(Qt::magenta, tr("Magenta"), 10); - popup.insertColor(Qt::darkMagenta, tr("Dark magenta"), 11); - popup.insertColor(Qt::yellow, tr("Yellow"), 12); - popup.insertColor(Qt::darkYellow, tr("Dark yellow"), 13); - popup.insertColor(Qt::gray, tr("Gray"), 14); - popup.insertColor(Qt::darkGray, tr("Dark gray"), 15); - popup.insertColor(Qt::lightGray, tr("Light gray"), 16); - - popup.move(point); - popup.exec(); - return popup.lastSelected(); -} - -/*! \internal - - Constructs the popup widget. -*/ -ColorPickerPopup::ColorPickerPopup(int width, bool withColorDialog, - QWidget *parent) - : QFrame(parent, Qt::Popup) -{ - setFrameStyle(QFrame::StyledPanel); - setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - - setFocusPolicy(Qt::StrongFocus); - setMouseTracking(true); - cols = width; - - if (withColorDialog) { - moreButton = new ColorPickerButton(this); - moreButton->setFixedWidth(24); - moreButton->setFixedHeight(21); - moreButton->setFrameRect(QRect(2, 2, 20, 17)); - connect(moreButton, SIGNAL(clicked()), SLOT(getColorFromDialog())); - } else { - moreButton = 0; - } - - eventLoop = 0; - grid = 0; - regenerateGrid(); -} - - -/*! \internal - - Destructs the popup widget. -*/ -ColorPickerPopup::~ColorPickerPopup() -{ - if (eventLoop) - eventLoop->exit(); -} - -/*! \internal - - If there is an item whole color is equal to \a col, returns a - pointer to this item; otherwise returns 0. -*/ -ColorPickerItem *ColorPickerPopup::find(const QColor &col) const -{ - for (int i = 0; i < items.size(); ++i) { - if (items.at(i) && items.at(i)->color() == col) - return items.at(i); - } - - return 0; -} - -/*! \internal - - Adds \a item to the grid. The items are added from top-left to - bottom-right. -*/ -void ColorPickerPopup::insertColor(const QColor &col, const QString &text, int index) -{ - // Don't add colors that we have already. - ColorPickerItem *existingItem = find(col); - ColorPickerItem *lastSelectedItem = find(lastSelected()); - - if (existingItem) { - if (lastSelectedItem && existingItem != lastSelectedItem) - lastSelectedItem->setSelected(false); - existingItem->setFocus(); - existingItem->setSelected(true); - return; - } - - ColorPickerItem *item = new ColorPickerItem(col, text, this); - - if (lastSelectedItem) { - lastSelectedItem->setSelected(false); - } - else { - item->setSelected(true); - lastSel = col; - } - item->setFocus(); - - connect(item, SIGNAL(selected()), SLOT(updateSelected())); - - if (index == -1) - index = items.count(); - - items.insert((unsigned int)index, item); - regenerateGrid(); - - update(); -} - -/*! \internal - -*/ -QColor ColorPickerPopup::color(int index) const -{ - if (index < 0 || index > (int) items.count() - 1) - return QColor(); - - ColorPickerPopup *that = (ColorPickerPopup *)this; - return that->items.at(index)->color(); -} - -/*! \internal - -*/ -void ColorPickerPopup::exec() -{ - show(); - - QEventLoop e; - eventLoop = &e; - (void) e.exec(); - eventLoop = 0; -} - -/*! \internal - -*/ -void ColorPickerPopup::updateSelected() -{ - QLayoutItem *layoutItem; - int i = 0; - while ((layoutItem = grid->itemAt(i)) != 0) { - QWidget *w = layoutItem->widget(); - if (w && w->inherits("ColorPickerItem")) { - ColorPickerItem *litem = reinterpret_cast(layoutItem->widget()); - if (litem != sender()) - litem->setSelected(false); - } - ++i; - } - - if (sender() && sender()->inherits("ColorPickerItem")) { - ColorPickerItem *item = (ColorPickerItem *)sender(); - lastSel = item->color(); - emit selected(item->color()); - } - - hide(); -} - -/*! \internal - -*/ -void ColorPickerPopup::mouseReleaseEvent(QMouseEvent *e) -{ - if (!rect().contains(e->pos())) - hide(); -} - -/*! \internal - - Controls keyboard navigation and selection on the color grid. -*/ -void ColorPickerPopup::keyPressEvent(QKeyEvent *e) -{ - int curRow = 0; - int curCol = 0; - - bool foundFocus = false; - for (int j = 0; !foundFocus && j < grid->rowCount(); ++j) { - for (int i = 0; !foundFocus && i < grid->columnCount(); ++i) { - if (widgetAt[j][i] && widgetAt[j][i]->hasFocus()) { - curRow = j; - curCol = i; - foundFocus = true; - break; - } - } - } - - switch (e->key()) { - case Qt::Key_Left: - if (curCol > 0) --curCol; - else if (curRow > 0) { --curRow; curCol = grid->columnCount() - 1; } - break; - case Qt::Key_Right: - if (curCol < grid->columnCount() - 1 && widgetAt[curRow][curCol + 1]) ++curCol; - else if (curRow < grid->rowCount() - 1) { ++curRow; curCol = 0; } - break; - case Qt::Key_Up: - if (curRow > 0) --curRow; - else curCol = 0; - break; - case Qt::Key_Down: - if (curRow < grid->rowCount() - 1) { - QWidget *w = widgetAt[curRow + 1][curCol]; - if (w) { - ++curRow; - } else for (int i = 1; i < grid->columnCount(); ++i) { - if (!widgetAt[curRow + 1][i]) { - curCol = i - 1; - ++curRow; - break; - } - } - } - break; - case Qt::Key_Space: - case Qt::Key_Return: - case Qt::Key_Enter: { - QWidget *w = widgetAt[curRow][curCol]; - if (w && w->inherits("ColorPickerItem")) { - ColorPickerItem *wi = reinterpret_cast(w); - wi->setSelected(true); - - QLayoutItem *layoutItem; - int i = 0; - while ((layoutItem = grid->itemAt(i)) != 0) { - QWidget *w = layoutItem->widget(); - if (w && w->inherits("ColorPickerItem")) { - ColorPickerItem *litem - = reinterpret_cast(layoutItem->widget()); - if (litem != wi) - litem->setSelected(false); - } - ++i; - } - - lastSel = wi->color(); - emit selected(wi->color()); - hide(); - } else if (w && w->inherits("QPushButton")) { - ColorPickerItem *wi = reinterpret_cast(w); - wi->setSelected(true); - - QLayoutItem *layoutItem; - int i = 0; - while ((layoutItem = grid->itemAt(i)) != 0) { - QWidget *w = layoutItem->widget(); - if (w && w->inherits("ColorPickerItem")) { - ColorPickerItem *litem - = reinterpret_cast(layoutItem->widget()); - if (litem != wi) - litem->setSelected(false); - } - ++i; - } - - lastSel = wi->color(); - emit selected(wi->color()); - hide(); - } - } - break; - case Qt::Key_Escape: - hide(); - break; - default: - e->ignore(); - break; - } - - widgetAt[curRow][curCol]->setFocus(); -} - -/*! \internal - -*/ -void ColorPickerPopup::hideEvent(QHideEvent *e) -{ - if (eventLoop) { - eventLoop->exit(); - } - - setFocus(); - - emit hid(); - QFrame::hideEvent(e); -} - -/*! \internal - -*/ -QColor ColorPickerPopup::lastSelected() const -{ - return lastSel; -} - -/*! \internal - - Sets focus on the popup to enable keyboard navigation. Draws - focusRect and selection rect. -*/ -void ColorPickerPopup::showEvent(QShowEvent *) -{ - bool foundSelected = false; - for (int i = 0; i < grid->columnCount(); ++i) { - for (int j = 0; j < grid->rowCount(); ++j) { - QWidget *w = widgetAt[j][i]; - if (w && w->inherits("ColorPickerItem")) { - if (((ColorPickerItem *)w)->isSelected()) { - w->setFocus(); - foundSelected = true; - break; - } - } - } - } - - if (!foundSelected) { - if (items.count() == 0) - setFocus(); - else - widgetAt[0][0]->setFocus(); - } -} - -/*! - -*/ -void ColorPickerPopup::regenerateGrid() -{ - widgetAt.clear(); - - int columns = cols; - if (columns == -1) - columns = (int) ceil(sqrt((float) items.count())); - - // When the number of columns grows, the number of rows will - // fall. There's no way to shrink a grid, so we create a new - // one. - if (grid) delete grid; - grid = new QGridLayout(this); - grid->setMargin(1); - grid->setSpacing(0); - - int ccol = 0, crow = 0; - for (int i = 0; i < items.size(); ++i) { - if (items.at(i)) { - widgetAt[crow][ccol] = items.at(i); - grid->addWidget(items.at(i), crow, ccol++); - if (ccol == columns) { - ++crow; - ccol = 0; - } - } - } - - if (moreButton) { - grid->addWidget(moreButton, crow, ccol); - widgetAt[crow][ccol] = moreButton; - } - updateGeometry(); -} - -/*! \internal - - Copies the color dialog's currently selected item and emits - itemSelected(). -*/ -void ColorPickerPopup::getColorFromDialog() -{ - bool ok; - QRgb rgb = QColorDialog::getRgba(lastSel.rgba(), &ok, parentWidget()); - if (!ok) - return; - - QColor col = QColor::fromRgba(rgb); - insertColor(col, tr("Custom"), -1); - lastSel = col; - emit selected(col); -} - -/*! - Constructs a ColorPickerItem whose color is set to \a color, and - whose name is set to \a text. -*/ -ColorPickerItem::ColorPickerItem(const QColor &color, const QString &text, - QWidget *parent) - : QFrame(parent), c(color), t(text), sel(false) -{ - setToolTip(t); - setFixedWidth(24); - setFixedHeight(21); -} - -/*! - Destructs a ColorPickerItem. - */ -ColorPickerItem::~ColorPickerItem() -{ -} - -/*! - Returns the item's color. - - \sa text() -*/ -QColor ColorPickerItem::color() const -{ - return c; -} - -/*! - Returns the item's text. - - \sa color() -*/ -QString ColorPickerItem::text() const -{ - return t; -} - -/*! - -*/ -bool ColorPickerItem::isSelected() const -{ - return sel; -} - -/*! - -*/ -void ColorPickerItem::setSelected(bool selected) -{ - sel = selected; - update(); -} - -/*! - Sets the item's color to \a color, and its name to \a text. -*/ -void ColorPickerItem::setColor(const QColor &color, const QString &text) -{ - c = color; - t = text; - setToolTip(t); - update(); -} - -/*! - -*/ -void ColorPickerItem::mouseMoveEvent(QMouseEvent *) -{ - setFocus(); - update(); -} - -/*! - -*/ -void ColorPickerItem::mouseReleaseEvent(QMouseEvent *) -{ - sel = true; - emit selected(); -} - -/*! - -*/ -void ColorPickerItem::mousePressEvent(QMouseEvent *) -{ - setFocus(); - update(); -} - -/*! - -*/ -void ColorPickerItem::paintEvent(QPaintEvent *) -{ - QPainter p(this); - int w = width(); // width of cell in pixels - int h = height(); // height of cell in pixels - - p.setPen( QPen( Qt::gray, 0, Qt::SolidLine ) ); - - if (sel) - p.drawRect(1, 1, w - 3, h - 3); - - p.setPen( QPen( Qt::black, 0, Qt::SolidLine ) ); - p.drawRect(3, 3, w - 7, h - 7); - p.fillRect(QRect(4, 4, w - 8, h - 8), QBrush(c)); - - if (hasFocus()) - p.drawRect(0, 0, w - 1, h - 1); -} - -/*! - -*/ -ColorPickerButton::ColorPickerButton(QWidget *parent) - : QFrame(parent) -{ - setFrameStyle(StyledPanel); -} - -/*! - -*/ -void ColorPickerButton::mousePressEvent(QMouseEvent *) -{ - setFrameShadow(Sunken); - update(); -} - -/*! - -*/ -void ColorPickerButton::mouseMoveEvent(QMouseEvent *) -{ - setFocus(); - update(); -} - -/*! - -*/ -void ColorPickerButton::mouseReleaseEvent(QMouseEvent *) -{ - setFrameShadow(Raised); - repaint(); - emit clicked(); -} - -/*! - -*/ -void ColorPickerButton::keyPressEvent(QKeyEvent *e) -{ - if (e->key() == Qt::Key_Up - || e->key() == Qt::Key_Down - || e->key() == Qt::Key_Left - || e->key() == Qt::Key_Right) { - qApp->sendEvent(parent(), e); - } else if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Space || e->key() == Qt::Key_Return) { - setFrameShadow(Sunken); - update(); - } else { - QFrame::keyPressEvent(e); - } -} - -/*! - -*/ -void ColorPickerButton::keyReleaseEvent(QKeyEvent *e) -{ - if (e->key() == Qt::Key_Up - || e->key() == Qt::Key_Down - || e->key() == Qt::Key_Left - || e->key() == Qt::Key_Right) { - qApp->sendEvent(parent(), e); - } else if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Space || e->key() == Qt::Key_Return) { - setFrameShadow(Raised); - repaint(); - emit clicked(); - } else { - QFrame::keyReleaseEvent(e); - } - -} - -/*! - -*/ -void ColorPickerButton::focusInEvent(QFocusEvent *e) -{ - setFrameShadow(Raised); - update(); - QFrame::focusOutEvent(e); -} - -/*! - -*/ -void ColorPickerButton::focusOutEvent(QFocusEvent *e) -{ - setFrameShadow(Raised); - update(); - QFrame::focusOutEvent(e); -} - -/*! - -*/ -void ColorPickerButton::paintEvent(QPaintEvent *e) -{ - QFrame::paintEvent(e); - - QPainter p(this); - p.fillRect(contentsRect(), palette().button()); - - QRect r = rect(); - - int offset = frameShadow() == Sunken ? 1 : 0; - - QPen pen(palette().buttonText(), 1); - p.setPen(pen); - - p.drawRect(r.center().x() + offset - 4, r.center().y() + offset, 1, 1); - p.drawRect(r.center().x() + offset , r.center().y() + offset, 1, 1); - p.drawRect(r.center().x() + offset + 4, r.center().y() + offset, 1, 1); - if (hasFocus()) { - p.setPen( QPen( Qt::black, 0, Qt::SolidLine ) ); - p.drawRect(0, 0, width() - 1, height() - 1); - } - - p.end(); - -} - -#include "qtcolorpicker.moc" - === added file 'qtiplot/src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.h' --- qtiplot/src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,121 @@ +/**************************************************************************** +** +** This file is part of a Qt Solutions component. +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Solutions Commercial License Agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** Please note Third Party Software included with Qt Solutions may impose +** additional restrictions and it is the user's responsibility to ensure +** that they have met the licensing requirements of the GPL, LGPL, or Qt +** Solutions Commercial license and the relevant license of the Third +** Party Software they are using. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +****************************************************************************/ + +#ifndef QTCOLORPICKER_H +#define QTCOLORPICKER_H +#include +#include +#include + +#include +#include +#include + +#if defined(Q_WS_WIN) +# if !defined(QT_QTCOLORPICKER_EXPORT) && !defined(QT_QTCOLORPICKER_IMPORT) +# define QT_QTCOLORPICKER_EXPORT +# elif defined(QT_QTCOLORPICKER_IMPORT) +# if defined(QT_QTCOLORPICKER_EXPORT) +# undef QT_QTCOLORPICKER_EXPORT +# endif +# define QT_QTCOLORPICKER_EXPORT __declspec(dllimport) +# elif defined(QT_QTCOLORPICKER_EXPORT) +# undef QT_QTCOLORPICKER_EXPORT +# define QT_QTCOLORPICKER_EXPORT __declspec(dllexport) +# endif +#else +# define QT_QTCOLORPICKER_EXPORT +#endif + +class ColorPickerPopup; + +class QT_QTCOLORPICKER_EXPORT QtColorPicker : public QPushButton +{ + Q_OBJECT + + Q_PROPERTY(bool colorDialog READ colorDialogEnabled WRITE setColorDialogEnabled) + +public: + QtColorPicker(QWidget *parent = 0, + int columns = -1, bool enableColorDialog = true); + + ~QtColorPicker(); + + void insertColor(const QColor &color, const QString &text = QString::null, int index = -1); + + QColor currentColor() const; + + QColor color(int index) const; + + void setColorDialogEnabled(bool enabled); + bool colorDialogEnabled() const; + + void setStandardColors(); + + static QColor getColor(const QPoint &pos, bool allowCustomColors = true); + +public Q_SLOTS: + void setCurrentColor(const QColor &col); + +Q_SIGNALS: + void colorChanged(const QColor &); + +protected: + void paintEvent(QPaintEvent *e); + +private Q_SLOTS: + void buttonPressed(bool toggled); + void popupClosed(); + +private: + ColorPickerPopup *popup; + QColor col; + bool withColorDialog; + bool dirty; + bool firstInserted; +}; + +#endif === removed file 'qtiplot/src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.h' --- qtiplot/src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.h 1970-01-01 00:00:00 +0000 @@ -1,121 +0,0 @@ -/**************************************************************************** -** -** This file is part of a Qt Solutions component. -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Qt Software Information (qt-info@nokia.com) -** -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Solutions Commercial License Agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** Please note Third Party Software included with Qt Solutions may impose -** additional restrictions and it is the user's responsibility to ensure -** that they have met the licensing requirements of the GPL, LGPL, or Qt -** Solutions Commercial license and the relevant license of the Third -** Party Software they are using. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** -****************************************************************************/ - -#ifndef QTCOLORPICKER_H -#define QTCOLORPICKER_H -#include -#include -#include - -#include -#include -#include - -#if defined(Q_WS_WIN) -# if !defined(QT_QTCOLORPICKER_EXPORT) && !defined(QT_QTCOLORPICKER_IMPORT) -# define QT_QTCOLORPICKER_EXPORT -# elif defined(QT_QTCOLORPICKER_IMPORT) -# if defined(QT_QTCOLORPICKER_EXPORT) -# undef QT_QTCOLORPICKER_EXPORT -# endif -# define QT_QTCOLORPICKER_EXPORT __declspec(dllimport) -# elif defined(QT_QTCOLORPICKER_EXPORT) -# undef QT_QTCOLORPICKER_EXPORT -# define QT_QTCOLORPICKER_EXPORT __declspec(dllexport) -# endif -#else -# define QT_QTCOLORPICKER_EXPORT -#endif - -class ColorPickerPopup; - -class QT_QTCOLORPICKER_EXPORT QtColorPicker : public QPushButton -{ - Q_OBJECT - - Q_PROPERTY(bool colorDialog READ colorDialogEnabled WRITE setColorDialogEnabled) - -public: - QtColorPicker(QWidget *parent = 0, - int columns = -1, bool enableColorDialog = true); - - ~QtColorPicker(); - - void insertColor(const QColor &color, const QString &text = QString::null, int index = -1); - - QColor currentColor() const; - - QColor color(int index) const; - - void setColorDialogEnabled(bool enabled); - bool colorDialogEnabled() const; - - void setStandardColors(); - - static QColor getColor(const QPoint &pos, bool allowCustomColors = true); - -public Q_SLOTS: - void setCurrentColor(const QColor &col); - -Q_SIGNALS: - void colorChanged(const QColor &); - -protected: - void paintEvent(QPaintEvent *e); - -private Q_SLOTS: - void buttonPressed(bool toggled); - void popupClosed(); - -private: - ColorPickerPopup *popup; - QColor col; - bool withColorDialog; - bool dirty; - bool firstInserted; -}; - -#endif === added file 'qtiplot/src/lib/CHANGES.txt' --- qtiplot/src/lib/CHANGES.txt 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/CHANGES.txt 2010-07-21 23:21:08 +0000 @@ -0,0 +1,14 @@ +Release 0.0.2 +=================== + +Bug Fixes +--------- +1. ColorMapEditor: + the level values are now displayed using DoubleSpinBox objects + +2. DoubleSpinBox: + stepBy problem fixed + +Release 0.0.1 +=================== +Initial release. === removed file 'qtiplot/src/lib/CHANGES.txt' --- qtiplot/src/lib/CHANGES.txt 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/CHANGES.txt 1970-01-01 00:00:00 +0000 @@ -1,14 +0,0 @@ -Release 0.0.2 -=================== - -Bug Fixes ---------- -1. ColorMapEditor: - the level values are now displayed using DoubleSpinBox objects - -2. DoubleSpinBox: - stepBy problem fixed - -Release 0.0.1 -=================== -Initial release. === added file 'qtiplot/src/lib/INSTALL' --- qtiplot/src/lib/INSTALL 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/INSTALL 2010-07-21 23:21:08 +0000 @@ -0,0 +1,37 @@ +Introduction +============ + +Qti uses qmake to build all its components and examples. +qmake is part of a Qt distribution. + +qmake reads project files, that contain the options and rules how to +build a certain project. A project file ends with the suffix "*.pro". + +You need Qt4 and Qwt 5.1 installed on your system. + +A) Unix Qt4 +========================== + +qmake +make + +If you have installed a shared library it's path has to be known to +the run-time linker of your operating system. On Linux systems read +"man ldconfig" ( or google for it ). Another option is to use +the LD_LIBRARY_PATH (on some systems LIBPATH is used instead, on MacOSX +it is called DYLD_LIBRARY_PATH) environment variable. + +B) Win32/MSVC Qt4 +===================== + +Please read the qmake documentation how to convert +your *.pro files into your development environment. + +F.e MSVC with nmake: +qmake qti.pro +nmake + +C) Win32/MinGW Qt4 +================== +qmake qti.pro +make === removed file 'qtiplot/src/lib/INSTALL' --- qtiplot/src/lib/INSTALL 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/INSTALL 1970-01-01 00:00:00 +0000 @@ -1,37 +0,0 @@ -Introduction -============ - -Qti uses qmake to build all its components and examples. -qmake is part of a Qt distribution. - -qmake reads project files, that contain the options and rules how to -build a certain project. A project file ends with the suffix "*.pro". - -You need Qt4 and Qwt 5.1 installed on your system. - -A) Unix Qt4 -========================== - -qmake -make - -If you have installed a shared library it's path has to be known to -the run-time linker of your operating system. On Linux systems read -"man ldconfig" ( or google for it ). Another option is to use -the LD_LIBRARY_PATH (on some systems LIBPATH is used instead, on MacOSX -it is called DYLD_LIBRARY_PATH) environment variable. - -B) Win32/MSVC Qt4 -===================== - -Please read the qmake documentation how to convert -your *.pro files into your development environment. - -F.e MSVC with nmake: -qmake qti.pro -nmake - -C) Win32/MinGW Qt4 -================== -qmake qti.pro -make === added file 'qtiplot/src/lib/README' --- qtiplot/src/lib/README 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/README 2010-07-21 23:21:08 +0000 @@ -0,0 +1,25 @@ + +The Qti Widget Library +---------------------- + + Qti is an extension to the Qt GUI library from Troll Tech AS. + The Qti library contains widgets and components which were + primarily developed for the QtiPlot software. + +Installation +------------ + + Read INSTALL file in order to find out how to build the Qti library. + +Copyright +--------- + + Qti Widget Library + Copyright (C) 2008 Ion Vasilief + + Qti is published under the GPL License, Version 3.0. + You should have received a copy of this licence in the file gpl-3.0.txt. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. === removed file 'qtiplot/src/lib/README' --- qtiplot/src/lib/README 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/README 1970-01-01 00:00:00 +0000 @@ -1,25 +0,0 @@ - -The Qti Widget Library ----------------------- - - Qti is an extension to the Qt GUI library from Troll Tech AS. - The Qti library contains widgets and components which were - primarily developed for the QtiPlot software. - -Installation ------------- - - Read INSTALL file in order to find out how to build the Qti library. - -Copyright ---------- - - Qti Widget Library - Copyright (C) 2008 Ion Vasilief - - Qti is published under the GPL License, Version 3.0. - You should have received a copy of this licence in the file gpl-3.0.txt. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. === added directory 'qtiplot/src/lib/doc' === removed directory 'qtiplot/src/lib/doc' === added file 'qtiplot/src/lib/doc/Doxyfile' --- qtiplot/src/lib/doc/Doxyfile 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/doc/Doxyfile 2010-07-21 23:21:08 +0000 @@ -0,0 +1,236 @@ +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = Qti +PROJECT_NUMBER = 0.0.2 +OUTPUT_DIRECTORY = . +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = YES +INHERIT_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 4 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = YES +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = YES +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = .. +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.dox \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.txt \ + *.CC \ + *.C++ \ + *.HH \ + *.H++ \ + *.C \ + *.H +RECURSIVE = yes +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = *moc_* +EXAMPLE_PATH = ../INSTALL ../gpl-3.0.txt +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +# recommendation: install graphviz and use HAVE_DOT = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO === removed file 'qtiplot/src/lib/doc/Doxyfile' --- qtiplot/src/lib/doc/Doxyfile 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/doc/Doxyfile 1970-01-01 00:00:00 +0000 @@ -1,236 +0,0 @@ -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = Qti -PROJECT_NUMBER = 0.0.2 -OUTPUT_DIRECTORY = . -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = YES -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = YES -INHERIT_DOCS = YES -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 4 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = NO -OPTIMIZE_OUTPUT_JAVA = NO -SUBGROUPING = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = YES -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = YES -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = .. -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.dox \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.txt \ - *.CC \ - *.C++ \ - *.HH \ - *.H++ \ - *.C \ - *.H -RECURSIVE = yes -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = *moc_* -EXAMPLE_PATH = ../INSTALL ../gpl-3.0.txt -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -VERBATIM_HEADERS = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = YES -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = NO -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -# recommendation: install graphviz and use HAVE_DOT = YES -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 1000 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO === added directory 'qtiplot/src/lib/doc/html' === removed directory 'qtiplot/src/lib/doc/html' === added directory 'qtiplot/src/lib/doc/html/images' === removed directory 'qtiplot/src/lib/doc/html/images' === added file 'qtiplot/src/lib/doc/html/images/color_map_editor.png' Binary files qtiplot/src/lib/doc/html/images/color_map_editor.png 1970-01-01 00:00:00 +0000 and qtiplot/src/lib/doc/html/images/color_map_editor.png 2010-07-21 23:21:08 +0000 differ === removed file 'qtiplot/src/lib/doc/html/images/color_map_editor.png' Binary files qtiplot/src/lib/doc/html/images/color_map_editor.png 2009-12-08 18:06:27 +0000 and qtiplot/src/lib/doc/html/images/color_map_editor.png 1970-01-01 00:00:00 +0000 differ === added file 'qtiplot/src/lib/doc/html/images/symbol_box.png' Binary files qtiplot/src/lib/doc/html/images/symbol_box.png 1970-01-01 00:00:00 +0000 and qtiplot/src/lib/doc/html/images/symbol_box.png 2010-07-21 23:21:08 +0000 differ === removed file 'qtiplot/src/lib/doc/html/images/symbol_box.png' Binary files qtiplot/src/lib/doc/html/images/symbol_box.png 2009-12-08 18:06:27 +0000 and qtiplot/src/lib/doc/html/images/symbol_box.png 1970-01-01 00:00:00 +0000 differ === added file 'qtiplot/src/lib/doc/qti.dox' --- qtiplot/src/lib/doc/qti.dox 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/doc/qti.dox 2010-07-21 23:21:08 +0000 @@ -0,0 +1,60 @@ +/*! + \mainpage Qti - Qt widgets for QtiPlot + +The Qti library contains GUI Components and utility classes which were primarily +developed for QtiPlot, a scientific plotting and data analysis software. + + \image html images/color_map_editor.png + + \section license License + + Qti is distributed under the terms of the \ref gpllicense. + + \section platforms Platforms + + Qti might be usable in all environments where you find + Qt 4. + + \section dependencies Dependencies + + Qti depends on the following libraries: + Qt 4, + Qwt 5.1.\n + + \section downloads Downloads + libqti.zip + + \section installonmainpage Installation + + Have a look at the qti.pro project file. It is prepared for building + static libraries in Win32 and Unix/X11 environments. + If you don't know what to do with it, read the file \ref qtiinstall and/or + Trolltechs qmake manual. + + \section support Support + If you are looking for individual support, or need someone who implements + your Qti component/application contact ion.vasilief@proindependent.com. + + \section relatedprojects Related Projects + + Qwt, Qt Widgets for Technical Applications.\n + QtiPlot, data analysis and scientific plotting tool. + + \section credits Credits: + \par Authors: + Ion Vasilief + \par Contributors: + Knut Franke, Tomomasa Ohkubo + \par Project admin: + Ion Vasilief \ +*/ + +/*! + \page gpllicense GPL License, Version 3 + \include "gpl-3.0.txt" +*/ + +/*! + \page qtiinstall INSTALL + \include "INSTALL" +*/ === removed file 'qtiplot/src/lib/doc/qti.dox' --- qtiplot/src/lib/doc/qti.dox 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/doc/qti.dox 1970-01-01 00:00:00 +0000 @@ -1,60 +0,0 @@ -/*! - \mainpage Qti - Qt widgets for QtiPlot - -The Qti library contains GUI Components and utility classes which were primarily -developed for QtiPlot, a scientific plotting and data analysis software. - - \image html images/color_map_editor.png - - \section license License - - Qti is distributed under the terms of the \ref gpllicense. - - \section platforms Platforms - - Qti might be usable in all environments where you find - Qt 4. - - \section dependencies Dependencies - - Qti depends on the following libraries: - Qt 4, - Qwt 5.1.\n - - \section downloads Downloads - libqti.zip - - \section installonmainpage Installation - - Have a look at the qti.pro project file. It is prepared for building - static libraries in Win32 and Unix/X11 environments. - If you don't know what to do with it, read the file \ref qtiinstall and/or - Trolltechs qmake manual. - - \section support Support - If you are looking for individual support, or need someone who implements - your Qti component/application contact ion.vasilief@proindependent.com. - - \section relatedprojects Related Projects - - Qwt, Qt Widgets for Technical Applications.\n - QtiPlot, data analysis and scientific plotting tool. - - \section credits Credits: - \par Authors: - Ion Vasilief - \par Contributors: - Knut Franke, Tomomasa Ohkubo - \par Project admin: - Ion Vasilief \ -*/ - -/*! - \page gpllicense GPL License, Version 3 - \include "gpl-3.0.txt" -*/ - -/*! - \page qtiinstall INSTALL - \include "INSTALL" -*/ === added file 'qtiplot/src/lib/gpl-3.0.txt' --- qtiplot/src/lib/gpl-3.0.txt 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/gpl-3.0.txt 2010-07-21 23:21:08 +0000 @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. === removed file 'qtiplot/src/lib/gpl-3.0.txt' --- qtiplot/src/lib/gpl-3.0.txt 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/gpl-3.0.txt 1970-01-01 00:00:00 +0000 @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. === added directory 'qtiplot/src/lib/include' === removed directory 'qtiplot/src/lib/include' === added file 'qtiplot/src/lib/include/ColorBox.h' --- qtiplot/src/lib/include/ColorBox.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/include/ColorBox.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,80 @@ +/*************************************************************************** + File : ColorBox.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : A combo box to select a standard color + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef COLORBOX_H +#define COLORBOX_H + +#include + +//! A modified QComboBox used for color selection. +/** + * It contains a list of 24 predefined colors. + */ +class ColorBox : public QComboBox +{ + Q_OBJECT + +public: + //! Constructor + /** + * \param parent parent widget + */ + ColorBox(QWidget *parent = 0); + //! Set the current color + void setColor(const QColor& c); + //! Return the current color + QColor color() const; + //! Return the list of colors + static QList colorList(); + //! Returns the color names + static QStringList colorNames(); + //! Return the index for a given color + static int colorIndex(const QColor& c); + //! Return the color at index 'colorIndex' + static QColor color(int colorIndex); + //! Return the default color at index 'colorIndex' + static QColor defaultColor(int colorIndex); + //! Returns TRUE if the color is included in the color box, otherwise returns FALSE. + static bool isValidColor(const QColor& color); + //! Returns the number of predefined colors + static int numPredefinedColors(); + //! Returns the color name for the predefined colors + static QStringList defaultColorNames(); + //! Returns the list of predefined colors + static QList defaultColors(); + +protected: + //! Internal initialization function + void init(); + //! The number of predefined colors + static const int colors_count = 24; + //! Array containing the 24 predefined colors + static const QColor colors[]; +}; + +#endif === removed file 'qtiplot/src/lib/include/ColorBox.h' --- qtiplot/src/lib/include/ColorBox.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/include/ColorBox.h 1970-01-01 00:00:00 +0000 @@ -1,73 +0,0 @@ -/*************************************************************************** - File : ColorBox.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : A combo box to select a standard color - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef COLORBOX_H -#define COLORBOX_H - -#include - -//! A modified QComboBox used for color selection. -/** - * It contains a list of 24 predefined colors. - */ -class ColorBox : public QComboBox -{ - Q_OBJECT - -public: - //! Constructor - /** - * \param parent parent widget - */ - ColorBox(QWidget *parent = 0); - //! Set the current color - void setColor(const QColor& c); - //! Return the current color - QColor color() const; - - //! Return the index for a given color - static int colorIndex(const QColor& c); - //! Return the color at index 'colorindex' - static QColor color(int colorIndex); - //! Returns TRUE if the color is included in the color box, otherwise returns FALSE. - static bool isValidColor(const QColor& color); - //! Returns the number of predefined colors - static int numPredefinedColors(); - //! Returns the color name for the predefined colors - static QStringList colorNames(); - -protected: - //! Internal initialization function - void init(); - //! The number of predefined colors - static const int colors_count = 24; - //! Array containing the 24 predefined colors - static const QColor colors[]; -}; - -#endif === added file 'qtiplot/src/lib/include/ColorButton.h' --- qtiplot/src/lib/include/ColorButton.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/include/ColorButton.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,58 @@ +/*************************************************************************** + File : ColorButton.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2009 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : A wrapper around QtColorPicker from QtSolutions + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + +#ifndef COLORBUTTON_H +#define COLORBUTTON_H + +#include + +//! A customized QtColorPicker used for color selection. +/** + * + */ +class ColorButton : public QtColorPicker +{ + Q_OBJECT + +public: + //! Constructor. + /** + * \param parent parent widget (only affects placement of the widget) + */ + ColorButton(QWidget *parent = 0); + //! Set the current color to be displayed + void setColor(const QColor& c){setCurrentColor (c);}; + //! Get the current color + QColor color(){return currentColor();}; + +signals: + void colorChanged(); +}; + +#endif === removed file 'qtiplot/src/lib/include/ColorButton.h' --- qtiplot/src/lib/include/ColorButton.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/include/ColorButton.h 1970-01-01 00:00:00 +0000 @@ -1,58 +0,0 @@ -/*************************************************************************** - File : ColorButton.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2009 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : A wrapper around QtColorPicker from QtSolutions - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#ifndef COLORBUTTON_H -#define COLORBUTTON_H - -#include - -//! A customized QtColorPicker used for color selection. -/** - * - */ -class ColorButton : public QtColorPicker -{ - Q_OBJECT - -public: - //! Constructor. - /** - * \param parent parent widget (only affects placement of the widget) - */ - ColorButton(QWidget *parent = 0); - //! Set the current color to be displayed - void setColor(const QColor& c){setCurrentColor (c);}; - //! Get the current color - QColor color(){return currentColor();}; - -signals: - void colorChanged(); -}; - -#endif === added file 'qtiplot/src/lib/include/ColorMapEditor.h' --- qtiplot/src/lib/include/ColorMapEditor.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/include/ColorMapEditor.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,96 @@ +/*************************************************************************** + File : ColorMapEditor.h + Project : QtiPlot +-------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : A QwtLinearColorMap Editor Widget + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef COLORMAPEDITOR_H +#define COLORMAPEDITOR_H + +#include +#include +#include + +class QPushButton; +class QTableWidget; +class QCheckBox; +class DoubleSpinBox; + +//! A complex widget allowing to customize a QwtLinearColorMap. +/** + * It uses a QTableWidget to display the values in one column and their corresponding colors in a second column. + * A click on a table color pops-up a QColorDialog allowing to customize it. + + \image html images/color_map_editor.png + */ +class ColorMapEditor: public QWidget +{ + Q_OBJECT + +public: + //! Constructor. + /** + * \param parent parent widget (only affects placement of the widget) + */ + ColorMapEditor(const QLocale& locale = QLocale::system(), int precision = 6, QWidget* parent = 0); + //! Returns the customized color map. + QwtLinearColorMap colorMap(){return color_map;}; + //! Use this function to initialize the color map to be edited. + void setColorMap(const QwtLinearColorMap& map); + //! Use this function to initialize the values range. + void setRange(double min, double max); + //! Exports the map to a pseudo-XML string + static QString saveToXmlString(const QwtLinearColorMap& color_map); + +signals: + void scalingChanged(); + +protected slots: + void updateColorMap(); + void enableButtons(int row); + void showColorDialog(int row, int col); + void insertLevel(); + void deleteLevel(); + void setScaledColors(bool scale = true); + void spinBoxActivated(DoubleSpinBox *); + + bool eventFilter(QObject *object, QEvent *e); + +private: + //! Table displaying the values ranges in the first column and their corresponding colors in the second column + QTableWidget *table; + QPushButton *insertBtn, *deleteBtn; + QCheckBox *scaleColorsBox; + + //! Color map object + QwtLinearColorMap color_map; + //! Levels range + double min_val, max_val; + //! Locale settings used to display level values + QLocale d_locale; + //! Precision used to display level values + int d_precision; +}; + +#endif === removed file 'qtiplot/src/lib/include/ColorMapEditor.h' --- qtiplot/src/lib/include/ColorMapEditor.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/include/ColorMapEditor.h 1970-01-01 00:00:00 +0000 @@ -1,96 +0,0 @@ -/*************************************************************************** - File : ColorMapEditor.h - Project : QtiPlot --------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : A QwtLinearColorMap Editor Widget - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef COLORMAPEDITOR_H -#define COLORMAPEDITOR_H - -#include -#include -#include - -class QPushButton; -class QTableWidget; -class QCheckBox; -class DoubleSpinBox; - -//! A complex widget allowing to customize a QwtLinearColorMap. -/** - * It uses a QTableWidget to display the values in one column and their corresponding colors in a second column. - * A click on a table color pops-up a QColorDialog allowing to customize it. - - \image html images/color_map_editor.png - */ -class ColorMapEditor: public QWidget -{ - Q_OBJECT - -public: - //! Constructor. - /** - * \param parent parent widget (only affects placement of the widget) - */ - ColorMapEditor(const QLocale& locale = QLocale::system(), int precision = 6, QWidget* parent = 0); - //! Returns the customized color map. - QwtLinearColorMap colorMap(){return color_map;}; - //! Use this function to initialize the color map to be edited. - void setColorMap(const QwtLinearColorMap& map); - //! Use this function to initialize the values range. - void setRange(double min, double max); - //! Exports the map to a pseudo-XML string - static QString saveToXmlString(const QwtLinearColorMap& color_map); - -signals: - void scalingChanged(); - -protected slots: - void updateColorMap(); - void enableButtons(int row); - void showColorDialog(int row, int col); - void insertLevel(); - void deleteLevel(); - void setScaledColors(bool scale = true); - void spinBoxActivated(DoubleSpinBox *); - - bool eventFilter(QObject *object, QEvent *e); - -private: - //! Table displaying the values ranges in the first column and their corresponding colors in the second column - QTableWidget *table; - QPushButton *insertBtn, *deleteBtn; - QCheckBox *scaleColorsBox; - - //! Color map object - QwtLinearColorMap color_map; - //! Levels range - double min_val, max_val; - //! Locale settings used to display level values - QLocale d_locale; - //! Precision used to display level values - int d_precision; -}; - -#endif === added file 'qtiplot/src/lib/include/DoubleSpinBox.h' --- qtiplot/src/lib/include/DoubleSpinBox.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/include/DoubleSpinBox.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,105 @@ +/*************************************************************************** + File : DoubleSpinBox.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2007-2008 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : A Double Spin Box + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef DoubleSpinBox_H +#define DoubleSpinBox_H + +#include +#include + +//! A QDoubleSpinBox allowing to customize numbers display with respect to locale settings. +/** + * It allows the user to specify a custom display format. + */ +class DoubleSpinBox : public QAbstractSpinBox +{ + Q_OBJECT + +public: + //! Constructor. + /** + * \param format format used to display numbers: has the same meaning as in QLocale::toString ( double i, char f = 'g', int prec = 6 ) + * \param parent parent widget (only affects placement of the dialog) + */ + DoubleSpinBox(const char format = 'g', QWidget * parent = 0); + + void setSingleStep(double val); + void setMaximum(double max); + void setMinimum(double min); + void setRange(double min, double max); + + int decimals(){return d_prec;}; + void setDecimals(int prec){if (prec >= 0) d_prec = prec;}; + + double value(){interpretText(); return d_value;}; + bool setValue(double val); + + void setFormat(const char format, int prec = 1){d_format = format; setDecimals(prec);}; + + QString textFromValue ( double value ) const; + virtual QValidator::State validate ( QString & input, int & pos ) const; + +signals: + void valueChanged ( double d ); + //! Signal emitted when the spin box gains focus + void activated(DoubleSpinBox *); + +private slots: + void interpretText(); + +protected: + void stepBy ( int steps ); + StepEnabled stepEnabled () const; + void focusInEvent(QFocusEvent *); + +private: + char d_format; + double d_min_val; + double d_max_val; + double d_value; + double d_step; + int d_prec; +}; + +//! A checkable DoubleSpinBox that can be used to select the limits of a double interval. +class RangeLimitBox : public QWidget +{ +public: + enum LimitType{LeftLimit, RightLimit}; + + RangeLimitBox(LimitType type, QWidget * parent = 0); + void setDecimals(int prec){d_spin_box->setDecimals(prec);}; + double value(); + bool isChecked(){return d_checkbox->isChecked();}; + +private: + DoubleSpinBox *d_spin_box; + QCheckBox *d_checkbox; + LimitType d_type; +}; +#endif // FITDIALOG_H === removed file 'qtiplot/src/lib/include/DoubleSpinBox.h' --- qtiplot/src/lib/include/DoubleSpinBox.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/include/DoubleSpinBox.h 1970-01-01 00:00:00 +0000 @@ -1,105 +0,0 @@ -/*************************************************************************** - File : DoubleSpinBox.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2007-2008 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : A Double Spin Box - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef DoubleSpinBox_H -#define DoubleSpinBox_H - -#include -#include - -//! A QDoubleSpinBox allowing to customize numbers display with respect to locale settings. -/** - * It allows the user to specify a custom display format. - */ -class DoubleSpinBox : public QAbstractSpinBox -{ - Q_OBJECT - -public: - //! Constructor. - /** - * \param format format used to display numbers: has the same meaning as in QLocale::toString ( double i, char f = 'g', int prec = 6 ) - * \param parent parent widget (only affects placement of the dialog) - */ - DoubleSpinBox(const char format = 'g', QWidget * parent = 0); - - void setSingleStep(double val); - void setMaximum(double max); - void setMinimum(double min); - void setRange(double min, double max); - - int decimals(){return d_prec;}; - void setDecimals(int prec){if (prec >= 0) d_prec = prec;}; - - double value(){return d_value;}; - bool setValue(double val); - - void setFormat(const char format, int prec = 1){d_format = format; setDecimals(prec);}; - - QString textFromValue ( double value ) const; - virtual QValidator::State validate ( QString & input, int & pos ) const; - -signals: - void valueChanged ( double d ); - //! Signal emitted when the spin box gains focus - void activated(DoubleSpinBox *); - -private slots: - void interpretText(); - -protected: - void stepBy ( int steps ); - StepEnabled stepEnabled () const; - void focusInEvent(QFocusEvent *); - -private: - char d_format; - double d_min_val; - double d_max_val; - double d_value; - double d_step; - int d_prec; -}; - -//! A checkable DoubleSpinBox that can be used to select the limits of a double interval. -class RangeLimitBox : public QWidget -{ -public: - enum LimitType{LeftLimit, RightLimit}; - - RangeLimitBox(LimitType type, QWidget * parent = 0); - void setDecimals(int prec){d_spin_box->setDecimals(prec);}; - double value(); - bool isChecked(){return d_checkbox->isChecked();}; - -private: - DoubleSpinBox *d_spin_box; - QCheckBox *d_checkbox; - LimitType d_type; -}; -#endif // FITDIALOG_H === added file 'qtiplot/src/lib/include/ExtensibleFileDialog.h' --- qtiplot/src/lib/include/ExtensibleFileDialog.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/include/ExtensibleFileDialog.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,80 @@ +/*************************************************************************** + File : ExtensibleFileDialog.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2007 by Knut Franke, Ion Vasilief + Email (use @ for *) : knut.franke*gmx.de, ion_vasilief*yahoo.fr + Description : QFileDialog plus generic extension support + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef EXTENSIBLE_FILE_DIALOG_H +#define EXTENSIBLE_FILE_DIALOG_H + +#include +#include + +//! QFileDialog plus generic extension support. +/** + * This is a simple hack on top of QFileDialog that allows a custom extension widget to be added to + * the bottom of the dialog. A button is provided for toggling display of this widget on/off. + * + * For the placement of button and extension widget, it is assumed that QFileDialog uses a + * QGridLayout as its top-level layout. Other layouts will probably lead to a strange outlook, + * although the functionality should stay intact. + */ +class ExtensibleFileDialog : public QFileDialog +{ + Q_OBJECT + + public: + //! Constructor. + /** + * \param parent parent widget (only affects placement of the dialog) + * \param extended flag: show/hide the advanced options on start-up + * \param flags window flags + */ + ExtensibleFileDialog(QWidget *parent=0, bool extended = true, Qt::WFlags flags=0); + //! Set the extension widget to be displayed when the user presses the toggle button. + void setExtensionWidget(QWidget *extension); + + //! Tells weather the dialog has a valid extension widget + bool isExtendable(){return d_extension != NULL;}; + bool isExtended(){return d_extension_toggle->isChecked();}; + //! Toggle extension widget on/off + void setExtended(bool extended){if (extended) d_extension_toggle->toggle();}; + //! Sets the text to be displayed in the toggle button + void setExtentionToggleButtonText(const QString& text){d_extension_toggle->setText(text);}; + //! Enables/Disables editing of the file type filter + void setEditableFilter(bool on = true); + + protected: + //! Button for toggling display of extension on/off. + QPushButton *d_extension_toggle; + + private: + //! The extension widget + QWidget *d_extension; + //! The layout row (of the assumed QGridLayout) used for extensions + int d_extension_row; +}; + +#endif // ifndef EXTENSIBLE_FILE_DIALOG_H === removed file 'qtiplot/src/lib/include/ExtensibleFileDialog.h' --- qtiplot/src/lib/include/ExtensibleFileDialog.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/include/ExtensibleFileDialog.h 1970-01-01 00:00:00 +0000 @@ -1,78 +0,0 @@ -/*************************************************************************** - File : ExtensibleFileDialog.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2007 by Knut Franke, Ion Vasilief - Email (use @ for *) : knut.franke*gmx.de, ion_vasilief*yahoo.fr - Description : QFileDialog plus generic extension support - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef EXTENSIBLE_FILE_DIALOG_H -#define EXTENSIBLE_FILE_DIALOG_H - -#include -#include - -//! QFileDialog plus generic extension support. -/** - * This is a simple hack on top of QFileDialog that allows a custom extension widget to be added to - * the bottom of the dialog. A button is provided for toggling display of this widget on/off. - * - * For the placement of button and extension widget, it is assumed that QFileDialog uses a - * QGridLayout as its top-level layout. Other layouts will probably lead to a strange outlook, - * although the functionality should stay intact. - */ -class ExtensibleFileDialog : public QFileDialog -{ - Q_OBJECT - - public: - //! Constructor. - /** - * \param parent parent widget (only affects placement of the dialog) - * \param extended flag: show/hide the advanced options on start-up - * \param flags window flags - */ - ExtensibleFileDialog(QWidget *parent=0, bool extended = true, Qt::WFlags flags=0); - //! Set the extension widget to be displayed when the user presses the toggle button. - void setExtensionWidget(QWidget *extension); - - //! Tells weather the dialog has a valid extension widget - bool isExtendable(){return d_extension != NULL;}; - bool isExtended(){return d_extension_toggle->isChecked();}; - //! Toggle extension widget on/off - void setExtended(bool extended){if (extended) d_extension_toggle->toggle();}; - //! Sets the text to be displayed in the toggle button - void setExtentionToggleButtonText(const QString& text){d_extension_toggle->setText(text);}; - - protected: - //! Button for toggling display of extension on/off. - QPushButton *d_extension_toggle; - - private: - //! The extension widget - QWidget *d_extension; - //! The layout row (of the assumed QGridLayout) used for extensions - int d_extension_row; -}; - -#endif // ifndef EXTENSIBLE_FILE_DIALOG_H === added file 'qtiplot/src/lib/include/LineNumberDisplay.h' --- qtiplot/src/lib/include/LineNumberDisplay.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/include/LineNumberDisplay.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,61 @@ +/*************************************************************************** + File : LineNumberDisplay.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2008 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : A widget displaying line numbers for a QTextEdit + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef LineNumberDisplay_H +#define LineNumberDisplay_H + +#include + +//! A QTextEdit displaying line numbers. +/** + * It must be used in connection with another "source" QTextEdit. + */ +class LineNumberDisplay: public QTextEdit +{ + Q_OBJECT + +public: + //! Constructor + /** + * \param te the "source" QTextEdit for which we want to display the line numbers + * \param parent parent widget (only affects placement of the dialog) + */ + LineNumberDisplay(QTextEdit *te, QWidget *parent = 0); + +public slots: + void updateLineNumbers(bool force = false); + void updateDocumentSelection(); + +private slots: + void changeCharFormat (const QTextCharFormat &); + +private: + void showEvent(QShowEvent *); + QTextEdit *d_text_edit; +}; +#endif === removed file 'qtiplot/src/lib/include/LineNumberDisplay.h' --- qtiplot/src/lib/include/LineNumberDisplay.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/include/LineNumberDisplay.h 1970-01-01 00:00:00 +0000 @@ -1,61 +0,0 @@ -/*************************************************************************** - File : LineNumberDisplay.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2008 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : A widget displaying line numbers for a QTextEdit - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef LineNumberDisplay_H -#define LineNumberDisplay_H - -#include - -//! A QTextEdit displaying line numbers. -/** - * It must be used in connection with another "source" QTextEdit. - */ -class LineNumberDisplay: public QTextEdit -{ - Q_OBJECT - -public: - //! Constructor - /** - * \param te the "source" QTextEdit for which we want to display the line numbers - * \param parent parent widget (only affects placement of the dialog) - */ - LineNumberDisplay(QTextEdit *te, QWidget *parent = 0); - -public slots: - void updateLineNumbers(bool force = false); - void updateDocumentSelection(); - -private slots: - void changeCharFormat (const QTextCharFormat &); - -private: - void showEvent(QShowEvent *); - QTextEdit *d_text_edit; -}; -#endif === added file 'qtiplot/src/lib/include/PatternBox.h' --- qtiplot/src/lib/include/PatternBox.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/include/PatternBox.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,61 @@ +/*************************************************************************** + File : PatternBox.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Tomomasa Ohkubo, Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Pattern combo box + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef PATTERNBOX_H +#define PATTERNBOX_H + +#include + +//! A modified QComboBox allowing to choose a Qt::BrushStyle style. +/** + * This is a simple hack on top of the QComboBox class. + */ +class PatternBox : public QComboBox +{ + Q_OBJECT + +public: + //! Constructor. + /** + * \param parent parent widget (only affects placement of the widget) + */ + PatternBox(QWidget *parent = 0); + void setPattern(const Qt::BrushStyle& c); + Qt::BrushStyle getSelectedPattern() const; + + static int patternIndex(const Qt::BrushStyle& style); + static Qt::BrushStyle brushStyle(int index); + +protected: + void init(); + +private: + static const Qt::BrushStyle patterns[]; +}; + +#endif === removed file 'qtiplot/src/lib/include/PatternBox.h' --- qtiplot/src/lib/include/PatternBox.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/include/PatternBox.h 1970-01-01 00:00:00 +0000 @@ -1,61 +0,0 @@ -/*************************************************************************** - File : PatternBox.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Tomomasa Ohkubo, Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Pattern combo box - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef PATTERNBOX_H -#define PATTERNBOX_H - -#include - -//! A modified QComboBox allowing to choose a Qt::BrushStyle style. -/** - * This is a simple hack on top of the QComboBox class. - */ -class PatternBox : public QComboBox -{ - Q_OBJECT - -public: - //! Constructor. - /** - * \param parent parent widget (only affects placement of the widget) - */ - PatternBox(QWidget *parent = 0); - void setPattern(const Qt::BrushStyle& c); - Qt::BrushStyle getSelectedPattern() const; - - static int patternIndex(const Qt::BrushStyle& style); - static Qt::BrushStyle brushStyle(int index); - -protected: - void init(); - -private: - static const Qt::BrushStyle patterns[]; -}; - -#endif === added file 'qtiplot/src/lib/include/PenStyleBox.h' --- qtiplot/src/lib/include/PenStyleBox.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/include/PenStyleBox.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,58 @@ +/*************************************************************************** + File : PenStyleBox.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2008 Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Pen style combo box + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef PEN_STYLE_BOX_H +#define PEN_STYLE_BOX_H + +#include + +//! A modified QComboBox allowing to choose a Qt::PenStyle. +/** + * This is a simple hack on top of the QComboBox class. + */ +class PenStyleBox : public QComboBox +{ + Q_OBJECT + +public: + //! Constructor. + /** + * \param parent parent widget (only affects placement of the widget) + */ + PenStyleBox(QWidget *parent = 0); + void setStyle(const Qt::PenStyle& style); + Qt::PenStyle style() const; + + static int styleIndex(const Qt::PenStyle& style); + static Qt::PenStyle penStyle(int index); + +private: + static const Qt::PenStyle patterns[]; +}; + +#endif === removed file 'qtiplot/src/lib/include/PenStyleBox.h' --- qtiplot/src/lib/include/PenStyleBox.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/include/PenStyleBox.h 1970-01-01 00:00:00 +0000 @@ -1,58 +0,0 @@ -/*************************************************************************** - File : PenStyleBox.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2008 Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Pen style combo box - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef PEN_STYLE_BOX_H -#define PEN_STYLE_BOX_H - -#include - -//! A modified QComboBox allowing to choose a Qt::PenStyle. -/** - * This is a simple hack on top of the QComboBox class. - */ -class PenStyleBox : public QComboBox -{ - Q_OBJECT - -public: - //! Constructor. - /** - * \param parent parent widget (only affects placement of the widget) - */ - PenStyleBox(QWidget *parent = 0); - void setStyle(const Qt::PenStyle& style); - Qt::PenStyle style() const; - - static int styleIndex(const Qt::PenStyle& style); - static Qt::PenStyle penStyle(int index); - -private: - static const Qt::PenStyle patterns[]; -}; - -#endif === added file 'qtiplot/src/lib/include/SymbolBox.h' --- qtiplot/src/lib/include/SymbolBox.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/include/SymbolBox.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,69 @@ +/*************************************************************************** + File : SymbolBox.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Plot symbol combo box + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef SYMBOLBOX_H +#define SYMBOLBOX_H + +#include +#include + +//! A modified QComboBox allowing to choose a QwtSmbol style. +/** + * This is a simple hack on top of the QComboBox class. + \image html images/symbol_box.png + */ +class SymbolBox : public QComboBox +{ + Q_OBJECT +public: + //! Constructor. + /** + * \param parent parent widget (only affects placement of the widget) + */ + SymbolBox(bool showNoSymbol = true, QWidget *parent = 0); + + void setStyle(const QwtSymbol::Style& c); + QwtSymbol::Style selectedSymbol() const; + + static QwtSymbol::Style style(int index); + static int symbolIndex(const QwtSymbol::Style& style); + static QList defaultSymbols(); + +signals: + //! Signal emitted when the box gains focus + void activated(SymbolBox *); + +protected: + void init(bool showNoSymbol); + void focusInEvent(QFocusEvent *); + +private: + static const QwtSymbol::Style symbols[]; +}; + +#endif === removed file 'qtiplot/src/lib/include/SymbolBox.h' --- qtiplot/src/lib/include/SymbolBox.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/include/SymbolBox.h 1970-01-01 00:00:00 +0000 @@ -1,63 +0,0 @@ -/*************************************************************************** - File : SymbolBox.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Plot symbol combo box - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef SYMBOLBOX_H -#define SYMBOLBOX_H - -#include -#include - -//! A modified QComboBox allowing to choose a QwtSmbol style. -/** - * This is a simple hack on top of the QComboBox class. - \image html images/symbol_box.png - */ -class SymbolBox : public QComboBox -{ - Q_OBJECT -public: - //! Constructor. - /** - * \param parent parent widget (only affects placement of the widget) - */ - SymbolBox(QWidget *parent); - - void setStyle(const QwtSymbol::Style& c); - QwtSymbol::Style selectedSymbol() const; - - static QwtSymbol::Style style(int index); - static int symbolIndex(const QwtSymbol::Style& style); - -protected: - void init(); - -private: - static const QwtSymbol::Style symbols[]; -}; - -#endif === added file 'qtiplot/src/lib/include/SymbolDialog.h' --- qtiplot/src/lib/include/SymbolDialog.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/include/SymbolDialog.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,106 @@ +/*************************************************************************** + File : SymbolDialog.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief, Tilman Hoener zu Siederdissen + Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net + Description : Tool window to select special text characters + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef SYMBOLDIALOG_H +#define SYMBOLDIALOG_H + +#include +class QPushButton; +class QSizePolicy; +class QGroupBox; +class QShortcut; +class QHBoxLayout; +class QVBoxLayout; +class QGridLayout; +class QButtonGroup; + +//! Tools window to select special text characters +class SymbolDialog : public QDialog +{ + Q_OBJECT + +public: + //! Character set + enum CharSet{ + lowerGreek = 0, /*!< lower case Greek letters */ + upperGreek = 1, /*!< upper case Greek letters */ + mathSymbols = 2, /*!< mathematical symbols */ + arrowSymbols = 3, /*!< arrow symbols */ + numberSymbols = 4, /*!< number symbols (e.g. 1/2, vi)*/ + latexArrowSymbols = 5, /*!< default LaTeX arrow symbols */ + latexMathSymbols = 6 /*!< default LaTeX math symbols */ + }; + + //! Constructor + /** + * \param charSet character set (lower- or uppercase) + * \param parent parent widget + * \param fl window flags + */ + SymbolDialog(CharSet charSet, QWidget* parent = 0, Qt::WFlags fl = 0 ); + +private: + //! Show lowercase Greek characters + void initLowerGreekChars(); + //! Show uppercase Greek characters + void initUpperGreekChars(); + //! Show mathematical symbols + void initMathSymbols(); + //! Show arrow symbols + void initArrowSymbols(); + //! Show number symbols + void initNumberSymbols(); + //! Show default LaTeX arrow symbols + void initLatexArrowSymbols(); + //! Show default LaTeX math symbols + void initLatexMathSymbols(); + + QButtonGroup * buttons; + QPushButton * closeButton; + int numButtons; + QVBoxLayout * mainLayout; + QGridLayout * gridLayout; + +protected: + //! Event handler: When the dialog gets the focus the first button is set to react on [return] + void focusInEvent( QFocusEvent * event ); + +public slots: + //! Change language (reset title) + virtual void languageChange(); + //! Find and emit char from pressed button + void getChar(int btnIndex); + //! Find and emit char from current button ([return] pressed) + void addCurrentChar(); + +signals: + //! Emitted when a letter is to be added + void addLetter(const QString&); +}; + +#endif // exportDialog_H === removed file 'qtiplot/src/lib/include/SymbolDialog.h' --- qtiplot/src/lib/include/SymbolDialog.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/include/SymbolDialog.h 1970-01-01 00:00:00 +0000 @@ -1,106 +0,0 @@ -/*************************************************************************** - File : SymbolDialog.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, Tilman Hoener zu Siederdissen - Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net - Description : Tool window to select special text characters - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef SYMBOLDIALOG_H -#define SYMBOLDIALOG_H - -#include -class QPushButton; -class QSizePolicy; -class QGroupBox; -class QShortcut; -class QHBoxLayout; -class QVBoxLayout; -class QGridLayout; -class QButtonGroup; - -//! Tools window to select special text characters -class SymbolDialog : public QDialog -{ - Q_OBJECT - -public: - //! Character set - enum CharSet{ - lowerGreek = 0, /*!< lower case Greek letters */ - upperGreek = 1, /*!< upper case Greek letters */ - mathSymbols = 2, /*!< mathematical symbols */ - arrowSymbols = 3, /*!< arrow symbols */ - numberSymbols = 4, /*!< number symbols (e.g. 1/2, vi)*/ - latexArrowSymbols = 5, /*!< default LaTeX arrow symbols */ - latexMathSymbols = 6 /*!< default LaTeX math symbols */ - }; - - //! Constructor - /** - * \param charSet character set (lower- or uppercase) - * \param parent parent widget - * \param fl window flags - */ - SymbolDialog(CharSet charSet, QWidget* parent = 0, Qt::WFlags fl = 0 ); - -private: - //! Show lowercase Greek characters - void initLowerGreekChars(); - //! Show uppercase Greek characters - void initUpperGreekChars(); - //! Show mathematical symbols - void initMathSymbols(); - //! Show arrow symbols - void initArrowSymbols(); - //! Show number symbols - void initNumberSymbols(); - //! Show default LaTeX arrow symbols - void initLatexArrowSymbols(); - //! Show default LaTeX math symbols - void initLatexMathSymbols(); - - QButtonGroup * buttons; - QPushButton * closeButton; - int numButtons; - QVBoxLayout * mainLayout; - QGridLayout * gridLayout; - -protected: - //! Event handler: When the dialog gets the focus the first button is set to react on [return] - void focusInEvent( QFocusEvent * event ); - -public slots: - //! Change language (reset title) - virtual void languageChange(); - //! Find and emit char from pressed button - void getChar(int btnIndex); - //! Find and emit char from current button ([return] pressed) - void addCurrentChar(); - -signals: - //! Emitted when a letter is to be added - void addLetter(const QString&); -}; - -#endif // exportDialog_H === added file 'qtiplot/src/lib/include/TextFormatButtons.h' --- qtiplot/src/lib/include/TextFormatButtons.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/include/TextFormatButtons.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,90 @@ +/*************************************************************************** + File : TextFormatButtons.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief, Tilman Hoener zu Siederdissen + Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net + Description : Widget with text format buttons (connected to a QTextEdit) + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + +#ifndef TEXTFORMATBUTTONS_H +#define TEXTFORMATBUTTONS_H + +#include +class QTextEdit; +class QPushButton; + +//! Widget with text format buttons (connected to a QTextEdit) +class TextFormatButtons : public QWidget +{ + Q_OBJECT + +public: + enum Buttons{Plot3D, AxisLabel, Legend, Equation, TexLegend}; + + //! Constructor + /** + * \param textEdit the QTextEdit that the buttons shall affect + * \param parent parent widget + */ + TextFormatButtons(QTextEdit * textEdit, Buttons buttons = Plot3D, QWidget * parent=0); + void setButtons(Buttons btns); + +private: + QTextEdit *connectedTextEdit; + Buttons d_buttons; + //! Internal function: format selected text with prefix and postfix + void formatText(const QString & prefix, const QString & postfix); + void init(Buttons btns); + +private slots: + //! Format seleted text to fraction + void addFraction(); + //! Format seleted text to square root + void addSquareRoot(); + //! Format seleted text to subscript + void addSubscript(); + //! Format seleted text to superscript + void addSuperscript(); + //! Format seleted text to underlined + void addUnderline(); + //! Format seleted text to italics + void addItalics(); + //! Format seleted text to bold + void addBold(); + //! Insert curve marker into the text + void addCurve(); + + //! Let the user insert lower case greek letters + void showLowerGreek(); + //! Let the user insert capital greek letters + void showUpperGreek(); + //! Let the user insert mathematical symbols + void showMathSymbols(); + //! Let the user insert arrow symbols + void showArrowSymbols(); + //! Insert 'letter' into the text + void addSymbol(const QString& letter); +}; + +#endif // TEXTFORMATBUTTONS_H === removed file 'qtiplot/src/lib/include/TextFormatButtons.h' --- qtiplot/src/lib/include/TextFormatButtons.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/include/TextFormatButtons.h 1970-01-01 00:00:00 +0000 @@ -1,90 +0,0 @@ -/*************************************************************************** - File : TextFormatButtons.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, Tilman Hoener zu Siederdissen - Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net - Description : Widget with text format buttons (connected to a QTextEdit) - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#ifndef TEXTFORMATBUTTONS_H -#define TEXTFORMATBUTTONS_H - -#include -class QTextEdit; -class QPushButton; - -//! Widget with text format buttons (connected to a QTextEdit) -class TextFormatButtons : public QWidget -{ - Q_OBJECT - -public: - enum Buttons{Plot3D, AxisLabel, Legend, Equation, TexLegend}; - - //! Constructor - /** - * \param textEdit the QTextEdit that the buttons shall affect - * \param parent parent widget - */ - TextFormatButtons(QTextEdit * textEdit, Buttons buttons = Plot3D, QWidget * parent=0); - void setButtons(Buttons btns); - -private: - QTextEdit *connectedTextEdit; - Buttons d_buttons; - //! Internal function: format selected text with prefix and postfix - void formatText(const QString & prefix, const QString & postfix); - void init(Buttons btns); - -private slots: - //! Format seleted text to fraction - void addFraction(); - //! Format seleted text to square root - void addSquareRoot(); - //! Format seleted text to subscript - void addSubscript(); - //! Format seleted text to superscript - void addSuperscript(); - //! Format seleted text to underlined - void addUnderline(); - //! Format seleted text to italics - void addItalics(); - //! Format seleted text to bold - void addBold(); - //! Insert curve marker into the text - void addCurve(); - - //! Let the user insert lower case greek letters - void showLowerGreek(); - //! Let the user insert capital greek letters - void showUpperGreek(); - //! Let the user insert mathematical symbols - void showMathSymbols(); - //! Let the user insert arrow symbols - void showArrowSymbols(); - //! Insert 'letter' into the text - void addSymbol(const QString& letter); -}; - -#endif // TEXTFORMATBUTTONS_H === added file 'qtiplot/src/lib/libqti.pri' --- qtiplot/src/lib/libqti.pri 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/libqti.pri 2010-07-21 23:21:08 +0000 @@ -0,0 +1,37 @@ +############################################################### +##################### libqti ################################## +############################################################### + +INCLUDEPATH += src/lib/include + +HEADERS += src/lib/include/ColorBox.h \ + src/lib/include/ColorButton.h \ + src/lib/include/ColorMapEditor.h \ + src/lib/include/DoubleSpinBox.h \ + src/lib/include/ExtensibleFileDialog.h \ + src/lib/include/LineNumberDisplay.h \ + src/lib/include/PatternBox.h \ + src/lib/include/PenStyleBox.h \ + src/lib/include/SymbolBox.h \ + src/lib/include/SymbolDialog.h \ + src/lib/include/TextFormatButtons.h \ + +SOURCES += src/lib/src/ColorBox.cpp \ + src/lib/src/ColorButton.cpp \ + src/lib/src/ColorMapEditor.cpp \ + src/lib/src/DoubleSpinBox.cpp \ + src/lib/src/ExtensibleFileDialog.cpp \ + src/lib/src/LineNumberDisplay.cpp \ + src/lib/src/PatternBox.cpp \ + src/lib/src/PenStyleBox.cpp \ + src/lib/src/SymbolBox.cpp \ + src/lib/src/SymbolDialog.cpp \ + src/lib/src/TextFormatButtons.cpp \ + +############################################################### +##################### 3rdparty Qt Solutions ################### +############################################################### + +INCLUDEPATH += src/lib/3rdparty/qtcolorpicker/src +HEADERS += src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.h +SOURCES += src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.cpp === removed file 'qtiplot/src/lib/libqti.pri' --- qtiplot/src/lib/libqti.pri 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/libqti.pri 1970-01-01 00:00:00 +0000 @@ -1,37 +0,0 @@ -############################################################### -##################### libqti ################################## -############################################################### - -INCLUDEPATH += src/lib/include - -HEADERS += src/lib/include/ColorBox.h \ - src/lib/include/ColorButton.h \ - src/lib/include/ColorMapEditor.h \ - src/lib/include/DoubleSpinBox.h \ - src/lib/include/ExtensibleFileDialog.h \ - src/lib/include/LineNumberDisplay.h \ - src/lib/include/PatternBox.h \ - src/lib/include/PenStyleBox.h \ - src/lib/include/SymbolBox.h \ - src/lib/include/SymbolDialog.h \ - src/lib/include/TextFormatButtons.h \ - -SOURCES += src/lib/src/ColorBox.cpp \ - src/lib/src/ColorButton.cpp \ - src/lib/src/ColorMapEditor.cpp \ - src/lib/src/DoubleSpinBox.cpp \ - src/lib/src/ExtensibleFileDialog.cpp \ - src/lib/src/LineNumberDisplay.cpp \ - src/lib/src/PatternBox.cpp \ - src/lib/src/PenStyleBox.cpp \ - src/lib/src/SymbolBox.cpp \ - src/lib/src/SymbolDialog.cpp \ - src/lib/src/TextFormatButtons.cpp \ - -############################################################### -##################### 3rdparty Qt Solutions ################### -############################################################### - -INCLUDEPATH += src/lib/3rdparty/qtcolorpicker/src -HEADERS += src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.h -SOURCES += src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.cpp === added file 'qtiplot/src/lib/qti.pro' --- qtiplot/src/lib/qti.pro 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/qti.pro 2010-07-21 23:21:08 +0000 @@ -0,0 +1,50 @@ +QMAKE_PROJECT_DEPTH = 0 +linux-g++-64: libsuff=64 + +TARGET = qti +TEMPLATE = lib + +VERSION = 0.0.1 + +CONFIG += thread +CONFIG += warn_on +CONFIG += release +CONFIG += staticlib + +MOC_DIR = ./tmp/ +OBJECTS_DIR = ./tmp/ +DESTDIR = ./ + +INCLUDEPATH += ./include/ +INCLUDEPATH += ../../../3rdparty/qwt/src + +##################### Linux (Mac OS X) ###################################### + +# statically link against Qwt library in 3rdparty +unix:LIBS += ../3rdparty/qwt/lib/libqwt.a + +# dynamically link against dependencies if they are installed system-wide +#unix:LIBS += -lqwt + +##################### Windows ############################################### +win32:LIBS += ../3rdparty/qwt/lib/libqwt.a + +HEADERS += include/ColorBox.h \ + include/ColorButton.h \ + include/ColorMapEditor.h \ + include/DoubleSpinBox.h \ + include/ExtensibleFileDialog.h \ + include/LineNumberDisplay.h \ + include/PatternBox.h \ + include/PenStyleBox.h \ + include/SymbolBox.h \ + +SOURCES += src/ColorBox.cpp \ + src/ColorButton.cpp \ + src/ColorMapEditor.cpp \ + src/DoubleSpinBox.cpp \ + src/ExtensibleFileDialog.cpp \ + src/LineNumberDisplay.cpp \ + src/PatternBox.cpp \ + src/PenStyleBox.cpp \ + src/SymbolBox.cpp \ === removed file 'qtiplot/src/lib/qti.pro' --- qtiplot/src/lib/qti.pro 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/qti.pro 1970-01-01 00:00:00 +0000 @@ -1,50 +0,0 @@ -QMAKE_PROJECT_DEPTH = 0 -linux-g++-64: libsuff=64 - -TARGET = qti -TEMPLATE = lib - -VERSION = 0.0.1 - -CONFIG += thread -CONFIG += warn_on -CONFIG += release -CONFIG += staticlib - -MOC_DIR = ./tmp/ -OBJECTS_DIR = ./tmp/ -DESTDIR = ./ - -INCLUDEPATH += ./include/ -INCLUDEPATH += ../../../3rdparty/qwt/src - -##################### Linux (Mac OS X) ###################################### - -# statically link against Qwt library in 3rdparty -unix:LIBS += ../3rdparty/qwt/lib/libqwt.a - -# dynamically link against dependencies if they are installed system-wide -#unix:LIBS += -lqwt - -##################### Windows ############################################### -win32:LIBS += ../3rdparty/qwt/lib/libqwt.a - -HEADERS += include/ColorBox.h \ - include/ColorButton.h \ - include/ColorMapEditor.h \ - include/DoubleSpinBox.h \ - include/ExtensibleFileDialog.h \ - include/LineNumberDisplay.h \ - include/PatternBox.h \ - include/PenStyleBox.h \ - include/SymbolBox.h \ - -SOURCES += src/ColorBox.cpp \ - src/ColorButton.cpp \ - src/ColorMapEditor.cpp \ - src/DoubleSpinBox.cpp \ - src/ExtensibleFileDialog.cpp \ - src/LineNumberDisplay.cpp \ - src/PatternBox.cpp \ - src/PenStyleBox.cpp \ - src/SymbolBox.cpp \ === added directory 'qtiplot/src/lib/src' === removed directory 'qtiplot/src/lib/src' === added file 'qtiplot/src/lib/src/ColorBox.cpp' --- qtiplot/src/lib/src/ColorBox.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/src/ColorBox.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,205 @@ +/*************************************************************************** + File : ColorBox.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006-2010 by Ion Vasilief, Alex Kargovsky + Email (use @ for *) : ion_vasilief*yahoo.fr, kargovsky*yumr.phys.msu.su + Description : A combo box to select a standard color + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "ColorBox.h" + +#include +#include +#include +#include + +const QColor ColorBox::colors[] = { + QColor(Qt::black), + QColor(Qt::red), + QColor(Qt::green), + QColor(Qt::blue), + QColor(Qt::cyan), + QColor(Qt::magenta), + QColor(Qt::yellow), + QColor(Qt::darkYellow), + QColor(Qt::darkBlue), + QColor(Qt::darkMagenta), + QColor(Qt::darkRed), + QColor(Qt::darkGreen), + QColor(Qt::darkCyan), + QColor("#0000A0"), + QColor("#FF8000"), + QColor("#8000FF"), + QColor("#FF0080"), + QColor(Qt::white), + QColor(Qt::lightGray), + QColor(Qt::gray), + QColor("#FFFF80"), + QColor("#80FFFF"), + QColor("#FF80FF"), + QColor(Qt::darkGray), +}; + +ColorBox::ColorBox(QWidget *parent) : QComboBox(parent) +{ + setEditable(false); + init(); +} + +void ColorBox::init() +{ + QList indexedColors = colorList(); + QStringList color_names = colorNames(); + + QPixmap icon = QPixmap(28, 16); + QRect r = QRect(0, 0, 27, 15); + + QPainter p; + p.begin(&icon); + + for (int i = 0; i < indexedColors.size(); i++){ + p.setBrush(QBrush(indexedColors[i])); + p.drawRect(r); + this->addItem(icon, color_names[i]); + } + p.end(); +} + +void ColorBox::setColor(const QColor& c) +{ + setCurrentIndex(colorIndex(c)); +} + +QColor ColorBox::color() const +{ + return color(this->currentIndex()); +} + +int ColorBox::colorIndex(const QColor& c) +{ + if (!isValidColor(c)) + return 0; + + return colorList().indexOf(c); +} + +QColor ColorBox::color(int colorIndex) +{ + QList colorsList = colorList(); + if (colorIndex >= 0 && colorIndex < colorsList.size()) + return colorsList[colorIndex]; + + return Qt::black; // default color is black. +} + +QList ColorBox::colorList() +{ +#ifdef Q_OS_MAC + QSettings settings(QSettings::IniFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); +#else + QSettings settings(QSettings::NativeFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); +#endif + settings.beginGroup("/General"); + + QList indexedColors; + QStringList lst = settings.value("/IndexedColors").toStringList(); + if (!lst.isEmpty()){ + for (int i = 0; i < lst.size(); i++) + indexedColors << QColor(lst[i]); + } else { + for (int i = 0; i < colors_count; i++) + indexedColors << colors[i]; + } + settings.endGroup(); + + return indexedColors; +} + +QStringList ColorBox::colorNames() +{ +#ifdef Q_OS_MAC + QSettings settings(QSettings::IniFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); +#else + QSettings settings(QSettings::NativeFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); +#endif + settings.beginGroup("/General"); + QStringList color_names = settings.value("/IndexedColorNames", defaultColorNames()).toStringList(); + settings.endGroup(); + return color_names; +} + +QColor ColorBox::defaultColor(int colorIndex) +{ + if (colorIndex >= 0 && colorIndex < (int)sizeof(colors)) + return colors[colorIndex]; + + return Qt::black; // default color is black. +} + +bool ColorBox::isValidColor(const QColor& color) +{ + return colorList().contains(color); +} + +int ColorBox::numPredefinedColors() +{ + return colors_count; +} + +QStringList ColorBox::defaultColorNames() +{ + QStringList color_names = QStringList() << tr( "black" ); + color_names << tr( "red" ); + color_names << tr( "green" ); + color_names << tr( "blue" ); + color_names << tr( "cyan" ); + color_names << tr( "magenta" ); + color_names << tr( "yellow" ); + color_names << tr( "dark yellow" ); + color_names << tr( "navy" ); + color_names << tr( "purple" ); + color_names << tr( "wine" ); + color_names << tr( "olive" ); + color_names << tr( "dark cyan" ); + color_names << tr( "royal" ); + color_names << tr( "orange" ); + color_names << tr( "violet" ); + color_names << tr( "pink" ); + color_names << tr( "white" ); + color_names << tr( "light gray" ); + color_names << tr( "gray" ); + color_names << tr( "light yellow" ); + color_names << tr( "light cyan" ); + color_names << tr( "light magenta" ); + color_names << tr( "dark gray" ); + return color_names; +} + +QList ColorBox::defaultColors() +{ + QList lst; + for (int i = 0; i < colors_count; i++) + lst << colors[i]; + + return lst; +} === removed file 'qtiplot/src/lib/src/ColorBox.cpp' --- qtiplot/src/lib/src/ColorBox.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/src/ColorBox.cpp 1970-01-01 00:00:00 +0000 @@ -1,160 +0,0 @@ -/*************************************************************************** - File : ColorBox.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006-2009 by Ion Vasilief, Alex Kargovsky - Email (use @ for *) : ion_vasilief*yahoo.fr, kargovsky*yumr.phys.msu.su - Description : A combo box to select a standard color - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "ColorBox.h" - -#include -#include -#include - -const QColor ColorBox::colors[] = { - QColor(Qt::black), - QColor(Qt::red), - QColor(Qt::green), - QColor(Qt::blue), - QColor(Qt::cyan), - QColor(Qt::magenta), - QColor(Qt::yellow), - QColor(Qt::darkYellow), - QColor(Qt::darkBlue), - QColor(Qt::darkMagenta), - QColor(Qt::darkRed), - QColor(Qt::darkGreen), - QColor(Qt::darkCyan), - QColor("#0000A0"), - QColor("#FF8000"), - QColor("#8000FF"), - QColor("#FF0080"), - QColor(Qt::white), - QColor(Qt::lightGray), - QColor(Qt::gray), - QColor("#FFFF80"), - QColor("#80FFFF"), - QColor("#FF80FF"), - QColor(Qt::darkGray), -}; - -ColorBox::ColorBox(QWidget *parent) : QComboBox(parent) -{ - setEditable(false); - init(); -} - -void ColorBox::init() -{ - QPixmap icon = QPixmap(28, 16); - QRect r = QRect(0, 0, 27, 15); - - QPainter p; - p.begin(&icon); - QStringList color_names = colorNames(); - for (int i = 0; i < colors_count; i++){ - p.setBrush(QBrush(colors[i])); - p.drawRect(r); - this->addItem(icon, color_names[i]); - } - p.end(); -} - -void ColorBox::setColor(const QColor& c) -{ - const QColor *ite = std::find(colors, colors + sizeof(colors), c); - if (ite == colors + sizeof(colors)) - this->setCurrentIndex(0); // default color is black. - else - this->setCurrentIndex(ite - colors); -} - -QColor ColorBox::color() const -{ - size_t i = this->currentIndex(); - if (i >= 0 && i < sizeof(colors)) - return colors[this->currentIndex()]; - - return QColor(Qt::black); // default color is black. -} - -int ColorBox::colorIndex(const QColor& c) -{ - if (!isValidColor(c)) - return 0; - - const QColor *ite = std::find(colors, colors + sizeof(colors), c); - return (ite - colors); -} - -QColor ColorBox::color(int colorIndex) -{ - if (colorIndex >= 0 && colorIndex < (int)sizeof(colors)) - return colors[colorIndex]; - - return QColor(Qt::black); // default color is black. -} - -bool ColorBox::isValidColor(const QColor& color) -{ - for (int i = 0; i < colors_count; i++){ - if (color == colors[i]) - return true; - } - return false; -} - -int ColorBox::numPredefinedColors() -{ - return colors_count; -} - -QStringList ColorBox::colorNames () -{ - QStringList color_names = QStringList() << tr( "black" ); - color_names << tr( "red" ); - color_names << tr( "green" ); - color_names << tr( "blue" ); - color_names << tr( "cyan" ); - color_names << tr( "magenta" ); - color_names << tr( "yellow" ); - color_names << tr( "dark yellow" ); - color_names << tr( "navy" ); - color_names << tr( "purple" ); - color_names << tr( "wine" ); - color_names << tr( "olive" ); - color_names << tr( "dark cyan" ); - color_names << tr( "royal" ); - color_names << tr( "orange" ); - color_names << tr( "violet" ); - color_names << tr( "pink" ); - color_names << tr( "white" ); - color_names << tr( "light gray" ); - color_names << tr( "gray" ); - color_names << tr( "light yellow" ); - color_names << tr( "light cyan" ); - color_names << tr( "light magenta" ); - color_names << tr( "dark gray" ); - return color_names; -} === added file 'qtiplot/src/lib/src/ColorButton.cpp' --- qtiplot/src/lib/src/ColorButton.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/src/ColorButton.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,49 @@ +/*************************************************************************** + File : ColorButton.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2009 - 2010 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : A wrapper around QtColorPicker from QtSolutions + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "ColorButton.h" +#include "ColorBox.h" +#include + +ColorButton::ColorButton(QWidget *parent) : QtColorPicker(parent) +{ + QStringList color_names = ColorBox::defaultColorNames(); + QList defaultColors = ColorBox::defaultColors(); + for (int i = 0; i < ColorBox::numPredefinedColors(); i++) + insertColor(defaultColors[i], color_names[i]); + + QList colors = ColorBox::colorList(); + color_names = ColorBox::colorNames(); + for (int i = 0; i < colors.count(); i++){ + QColor c = colors[i]; + if (!defaultColors.contains(c)) + insertColor(c, color_names[i]); + } + + connect(this, SIGNAL(colorChanged(const QColor & )), this, SIGNAL(colorChanged())); +} === removed file 'qtiplot/src/lib/src/ColorButton.cpp' --- qtiplot/src/lib/src/ColorButton.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/src/ColorButton.cpp 1970-01-01 00:00:00 +0000 @@ -1,43 +0,0 @@ -/*************************************************************************** - File : ColorButton.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2009 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : A wrapper around QtColorPicker from QtSolutions - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "ColorButton.h" -#include "ColorBox.h" -#include - -ColorButton::ColorButton(QWidget *parent) : QtColorPicker(parent) -{ - QStringList color_names = ColorBox::colorNames(); - for (int i = 0; i < ColorBox::numPredefinedColors(); i++) - insertColor(ColorBox::color(i), color_names[i]); - - for (int i = 0; i < QColorDialog::customCount(); i++) - insertColor(QColorDialog::customColor(i), tr("Custom")); - - connect(this, SIGNAL(colorChanged(const QColor & )), this, SIGNAL(colorChanged())); -} === added file 'qtiplot/src/lib/src/ColorMapEditor.cpp' --- qtiplot/src/lib/src/ColorMapEditor.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/src/ColorMapEditor.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,310 @@ +/*************************************************************************** + File : ColorMapEditor.cpp + Project : QtiPlot +-------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : A QwtLinearColorMap Editor Widget + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "ColorMapEditor.h" +#include "DoubleSpinBox.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +ColorMapEditor::ColorMapEditor(const QLocale& locale, int precision, QWidget* parent) + : QWidget(parent), + color_map(QwtLinearColorMap()), + min_val(0), + max_val(1), + d_locale(locale), + d_precision(precision) +{ +table = new QTableWidget(); +table->setColumnCount(2); +table->setSelectionMode(QAbstractItemView::SingleSelection); +table->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); +table->verticalHeader()->hide(); +table->horizontalHeader()->setClickable( false ); +table->horizontalHeader()->setResizeMode(QHeaderView::Stretch); +table->viewport()->setMouseTracking(true); +table->viewport()->installEventFilter(this); +table->setHorizontalHeaderLabels(QStringList() << tr("Level") << tr("Color")); +table->setMinimumHeight(6*table->horizontalHeader()->height() + 2); +table->installEventFilter(this); + +connect(table, SIGNAL(cellClicked (int, int)), this, SLOT(showColorDialog(int, int))); + +insertBtn = new QPushButton(tr("&Insert")); +insertBtn->setEnabled(false); +connect(insertBtn, SIGNAL(clicked()), this, SLOT(insertLevel())); + +deleteBtn = new QPushButton(tr("&Delete")); +deleteBtn->setEnabled(false); +connect(deleteBtn, SIGNAL(clicked()), this, SLOT(deleteLevel())); + +QHBoxLayout* hb = new QHBoxLayout(); +hb->addWidget(insertBtn); +hb->addWidget(deleteBtn); + +scaleColorsBox = new QCheckBox(tr("&Scale Colors")); +scaleColorsBox->setChecked(true); +connect(scaleColorsBox, SIGNAL(toggled(bool)), this, SLOT(setScaledColors(bool))); + +QVBoxLayout* vl = new QVBoxLayout(this); +vl->setSpacing(0); +vl->addWidget(table); +vl->addLayout(hb); +vl->addWidget(scaleColorsBox); + +setFocusProxy(table); +setMaximumWidth(200); +} + +void ColorMapEditor::updateColorMap() +{ + int rows = table->rowCount(); + QColor c_min = QColor(table->item(0, 1)->text()); + QColor c_max = QColor(table->item(rows - 1, 1)->text()); + QwtLinearColorMap map(c_min, c_max); + for (int i = 1; i < rows-1; i++){ + QwtDoubleInterval range = QwtDoubleInterval(min_val, max_val); + double val = (((DoubleSpinBox*)table->cellWidget(i, 0))->value() - min_val)/range.width(); + map.addColorStop (val, QColor(table->item(i, 1)->text())); + } + + color_map = map; + setScaledColors(scaleColorsBox->isChecked()); +} + +void ColorMapEditor::setColorMap(const QwtLinearColorMap& map) +{ + scaleColorsBox->setChecked(map.mode() == QwtLinearColorMap::ScaledColors); + + QwtArray colors = map.colorStops(); + int rows = (int)colors.size(); + table->setRowCount(rows); + table->blockSignals(true); + + QwtDoubleInterval range = QwtDoubleInterval(min_val, max_val); + for (int i = 0; i < rows; i++){ + DoubleSpinBox *sb = new DoubleSpinBox(); + sb->setLocale(d_locale); + sb->setDecimals(d_precision); + sb->setValue(min_val + colors[i] * range.width()); + + if (i == 0) + sb->setRange(min_val, min_val); + else if (i == rows -1) + sb->setRange(max_val, max_val); + else + sb->setRange(min_val, max_val); + + connect(sb, SIGNAL(valueChanged(double)), this, SLOT(updateColorMap())); + connect(sb, SIGNAL(activated(DoubleSpinBox *)), this, SLOT(spinBoxActivated(DoubleSpinBox *))); + table->setCellWidget(i, 0, sb); + + QColor c = QColor(map.rgb(QwtDoubleInterval(0, 1), colors[i])); + QTableWidgetItem *it = new QTableWidgetItem(c.name()); + #ifdef Q_CC_MSVC + it->setFlags(it->flags() & (~Qt::ItemIsEditable)); + #else + it->setFlags(!Qt::ItemIsEditable); + #endif + it->setBackground(QBrush(c)); + it->setForeground(QBrush(c)); + table->setItem(i, 1, it); + } + table->blockSignals(false); + + color_map = map; +} + +void ColorMapEditor::setRange(double min, double max) +{ + min_val = min; + max_val = max; +} + +void ColorMapEditor::insertLevel() +{ + int row = table->currentRow(); + DoubleSpinBox *sb = (DoubleSpinBox*)table->cellWidget(row, 0); + if (!sb) + return; + + double current_value = sb->value(); + double previous_value = min_val; + sb = (DoubleSpinBox*)table->cellWidget(row - 1, 0); + if (sb) + previous_value = sb->value(); + + double val = 0.5*(current_value + previous_value); + QwtDoubleInterval range = QwtDoubleInterval(min_val, max_val); + double mapped_val = (val - min_val)/range.width(); + + QColor c = QColor(color_map.rgb(QwtDoubleInterval(0, 1), mapped_val)); + + table->blockSignals(true); + table->insertRow(row); + + sb = new DoubleSpinBox(); + sb->setLocale(d_locale); + sb->setDecimals(d_precision); + sb->setValue(val); + sb->setRange(min_val, max_val); + connect(sb, SIGNAL(valueChanged(double)), this, SLOT(updateColorMap())); + connect(sb, SIGNAL(activated(DoubleSpinBox *)), this, SLOT(spinBoxActivated(DoubleSpinBox *))); + table->setCellWidget(row, 0, sb); + + QTableWidgetItem *it = new QTableWidgetItem(c.name()); +#ifdef Q_CC_MSVC + it->setFlags(it->flags() & (~Qt::ItemIsEditable)); +#else + it->setFlags(!Qt::ItemIsEditable); +#endif + it->setBackground(QBrush(c)); + it->setForeground(QBrush(c)); + table->setItem(row, 1, it); + table->blockSignals(false); + + enableButtons(table->currentRow()); + updateColorMap(); +} + +void ColorMapEditor::deleteLevel() +{ + table->removeRow (table->currentRow()); + enableButtons(table->currentRow()); + updateColorMap(); +} + +void ColorMapEditor::showColorDialog(int row, int col) +{ + if (col != 1) + return; + + enableButtons(row); + + QColor c = QColor(table->item(row, 1)->text()); + QColor color = QColorDialog::getColor(c, this); + if (!color.isValid() || color == c) + return; + + table->item(row, 1)->setText(color.name()); + table->item(row, 1)->setForeground(QBrush(color)); + table->item(row, 1)->setBackground(QBrush(color)); + + updateColorMap(); +} + +bool ColorMapEditor::eventFilter(QObject *object, QEvent *e) +{ + if (e->type() == QEvent::MouseMove && object == table->viewport()){ + const QMouseEvent *me = (const QMouseEvent *)e; + QPoint pos = table->viewport()->mapToParent(me->pos()); + int row = table->rowAt(pos.y() - table->horizontalHeader()->height()); + if (table->columnAt(pos.x()) == 1 && row >= 0 && row < table->rowCount()) + setCursor(QCursor(Qt::PointingHandCursor)); + else + setCursor(QCursor(Qt::ArrowCursor)); + return true; + } else if (e->type() == QEvent::Leave && object == table->viewport()){ + setCursor(QCursor(Qt::ArrowCursor)); + return true; + } else if (e->type() == QEvent::KeyPress && object == table){ + QKeyEvent *ke = (QKeyEvent *)e; + if (ke->key() == Qt::Key_Return && table->currentColumn() == 1){ + showColorDialog(table->currentRow(), 1); + return true; + } + return false; + } + return QObject::eventFilter(object, e); +} + +void ColorMapEditor::enableButtons(int row) +{ + if (row < 0) + return; + + if (row == 0 || row == table->rowCount()-1) + deleteBtn->setEnabled(false); + else + deleteBtn->setEnabled(true); + + if (!row) + insertBtn->setEnabled(false); + else + insertBtn->setEnabled(true); +} + +void ColorMapEditor::setScaledColors(bool scale) +{ + if (scale) + color_map.setMode(QwtLinearColorMap::ScaledColors); + else + color_map.setMode(QwtLinearColorMap::FixedColors); + + scalingChanged(); +} + +QString ColorMapEditor::saveToXmlString(const QwtLinearColorMap& color_map) +{ + QString s = "\n"; + s += "\t" + QString::number(color_map.mode()) + "\n"; + s += "\t" + color_map.color1().name() + "\n"; + s += "\t" + color_map.color2().name() + "\n"; + QwtArray colors = color_map.colorStops(); + int stops = (int)colors.size(); + s += "\t" + QString::number(stops - 2) + "\n"; + for (int i = 1; i < stops - 1; i++) + { + s += "\t" + QString::number(colors[i]) + "\t"; + s += QColor(color_map.rgb(QwtDoubleInterval(0,1), colors[i])).name(); + s += "\n"; + } + return s += "\n"; +} + +void ColorMapEditor::spinBoxActivated(DoubleSpinBox *sb) +{ + if (!sb) + return; + + int rows = table->rowCount(); + for (int i = 0; i < rows; i++){ + DoubleSpinBox *box = (DoubleSpinBox*)table->cellWidget(i, 0); + if (box && box == sb){ + table->setCurrentCell(i, 0); + enableButtons(i); + return; + } + } +} === removed file 'qtiplot/src/lib/src/ColorMapEditor.cpp' --- qtiplot/src/lib/src/ColorMapEditor.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/src/ColorMapEditor.cpp 1970-01-01 00:00:00 +0000 @@ -1,308 +0,0 @@ -/*************************************************************************** - File : ColorMapEditor.cpp - Project : QtiPlot --------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : A QwtLinearColorMap Editor Widget - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "ColorMapEditor.h" -#include "DoubleSpinBox.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -ColorMapEditor::ColorMapEditor(const QLocale& locale, int precision, QWidget* parent) - : QWidget(parent), - color_map(QwtLinearColorMap()), - min_val(0), - max_val(1), - d_locale(locale), - d_precision(precision) -{ -table = new QTableWidget(); -table->setColumnCount(2); -table->setSelectionMode(QAbstractItemView::SingleSelection); -table->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); -table->verticalHeader()->hide(); -table->horizontalHeader()->setClickable( false ); -table->horizontalHeader()->setResizeMode(QHeaderView::Stretch); -table->viewport()->setMouseTracking(true); -table->viewport()->installEventFilter(this); -table->setHorizontalHeaderLabels(QStringList() << tr("Level") << tr("Color")); -table->setMinimumHeight(6*table->horizontalHeader()->height() + 2); -table->installEventFilter(this); - -connect(table, SIGNAL(cellClicked (int, int)), this, SLOT(showColorDialog(int, int))); - -insertBtn = new QPushButton(tr("&Insert")); -insertBtn->setEnabled(false); -connect(insertBtn, SIGNAL(clicked()), this, SLOT(insertLevel())); - -deleteBtn = new QPushButton(tr("&Delete")); -deleteBtn->setEnabled(false); -connect(deleteBtn, SIGNAL(clicked()), this, SLOT(deleteLevel())); - -QHBoxLayout* hb = new QHBoxLayout(); -hb->addWidget(insertBtn); -hb->addWidget(deleteBtn); - -scaleColorsBox = new QCheckBox(tr("&Scale Colors")); -scaleColorsBox->setChecked(true); -connect(scaleColorsBox, SIGNAL(toggled(bool)), this, SLOT(setScaledColors(bool))); - -QVBoxLayout* vl = new QVBoxLayout(this); -vl->setSpacing(0); -vl->addWidget(table); -vl->addLayout(hb); -vl->addWidget(scaleColorsBox); - -setFocusProxy(table); -setMaximumWidth(200); -} - -void ColorMapEditor::updateColorMap() -{ - int rows = table->rowCount(); - QColor c_min = QColor(table->item(0, 1)->text()); - QColor c_max = QColor(table->item(rows - 1, 1)->text()); - QwtLinearColorMap map(c_min, c_max); - for (int i = 1; i < rows-1; i++){ - QwtDoubleInterval range = QwtDoubleInterval(min_val, max_val); - double val = (((DoubleSpinBox*)table->cellWidget(i, 0))->value() - min_val)/range.width(); - map.addColorStop (val, QColor(table->item(i, 1)->text())); - } - - color_map = map; - setScaledColors(scaleColorsBox->isChecked()); -} - -void ColorMapEditor::setColorMap(const QwtLinearColorMap& map) -{ - scaleColorsBox->setChecked(map.mode() == QwtLinearColorMap::ScaledColors); - - QwtArray colors = map.colorStops(); - int rows = (int)colors.size(); - table->setRowCount(rows); - table->blockSignals(true); - - QwtDoubleInterval range = QwtDoubleInterval(min_val, max_val); - for (int i = 0; i < rows; i++){ - DoubleSpinBox *sb = new DoubleSpinBox(); - sb->setLocale(d_locale); - sb->setDecimals(d_precision); - sb->setValue(min_val + colors[i] * range.width()); - if (i == 0) - sb->setRange(min_val, min_val); - else if (i == rows -1) - sb->setRange(max_val, max_val); - else - sb->setRange(min_val, max_val); - connect(sb, SIGNAL(valueChanged(double)), this, SLOT(updateColorMap())); - connect(sb, SIGNAL(activated(DoubleSpinBox *)), this, SLOT(spinBoxActivated(DoubleSpinBox *))); - table->setCellWidget(i, 0, sb); - - QColor c = QColor(map.rgb(QwtDoubleInterval(0, 1), colors[i])); - QTableWidgetItem *it = new QTableWidgetItem(c.name()); - #ifdef Q_CC_MSVC - it->setFlags(it->flags() & (~Qt::ItemIsEditable)); - #else - it->setFlags(!Qt::ItemIsEditable); - #endif - it->setBackground(QBrush(c)); - it->setForeground(QBrush(c)); - table->setItem(i, 1, it); - } - table->blockSignals(false); - - color_map = map; -} - -void ColorMapEditor::setRange(double min, double max) -{ - min_val = min; - max_val = max; -} - -void ColorMapEditor::insertLevel() -{ - int row = table->currentRow(); - DoubleSpinBox *sb = (DoubleSpinBox*)table->cellWidget(row, 0); - if (!sb) - return; - - double current_value = sb->value(); - double previous_value = min_val; - sb = (DoubleSpinBox*)table->cellWidget(row - 1, 0); - if (sb) - previous_value = sb->value(); - - double val = 0.5*(current_value + previous_value); - QwtDoubleInterval range = QwtDoubleInterval(min_val, max_val); - double mapped_val = (val - min_val)/range.width(); - - QColor c = QColor(color_map.rgb(QwtDoubleInterval(0, 1), mapped_val)); - - table->blockSignals(true); - table->insertRow(row); - - sb = new DoubleSpinBox(); - sb->setLocale(d_locale); - sb->setDecimals(d_precision); - sb->setValue(val); - sb->setRange(min_val, max_val); - connect(sb, SIGNAL(valueChanged(double)), this, SLOT(updateColorMap())); - connect(sb, SIGNAL(activated(DoubleSpinBox *)), this, SLOT(spinBoxActivated(DoubleSpinBox *))); - table->setCellWidget(row, 0, sb); - - QTableWidgetItem *it = new QTableWidgetItem(c.name()); -#ifdef Q_CC_MSVC - it->setFlags(it->flags() & (~Qt::ItemIsEditable)); -#else - it->setFlags(!Qt::ItemIsEditable); -#endif - it->setBackground(QBrush(c)); - it->setForeground(QBrush(c)); - table->setItem(row, 1, it); - table->blockSignals(false); - - enableButtons(table->currentRow()); - updateColorMap(); -} - -void ColorMapEditor::deleteLevel() -{ - table->removeRow (table->currentRow()); - enableButtons(table->currentRow()); - updateColorMap(); -} - -void ColorMapEditor::showColorDialog(int row, int col) -{ - if (col != 1) - return; - - enableButtons(row); - - QColor c = QColor(table->item(row, 1)->text()); - QColor color = QColorDialog::getColor(c, this); - if (!color.isValid() || color == c) - return; - - table->item(row, 1)->setText(color.name()); - table->item(row, 1)->setForeground(QBrush(color)); - table->item(row, 1)->setBackground(QBrush(color)); - - updateColorMap(); -} - -bool ColorMapEditor::eventFilter(QObject *object, QEvent *e) -{ - if (e->type() == QEvent::MouseMove && object == table->viewport()){ - const QMouseEvent *me = (const QMouseEvent *)e; - QPoint pos = table->viewport()->mapToParent(me->pos()); - int row = table->rowAt(pos.y() - table->horizontalHeader()->height()); - if (table->columnAt(pos.x()) == 1 && row >= 0 && row < table->rowCount()) - setCursor(QCursor(Qt::PointingHandCursor)); - else - setCursor(QCursor(Qt::ArrowCursor)); - return true; - } else if (e->type() == QEvent::Leave && object == table->viewport()){ - setCursor(QCursor(Qt::ArrowCursor)); - return true; - } else if (e->type() == QEvent::KeyPress && object == table){ - QKeyEvent *ke = (QKeyEvent *)e; - if (ke->key() == Qt::Key_Return && table->currentColumn() == 1){ - showColorDialog(table->currentRow(), 1); - return true; - } - return false; - } - return QObject::eventFilter(object, e); -} - -void ColorMapEditor::enableButtons(int row) -{ - if (row < 0) - return; - - if (row == 0 || row == table->rowCount()-1) - deleteBtn->setEnabled(false); - else - deleteBtn->setEnabled(true); - - if (!row) - insertBtn->setEnabled(false); - else - insertBtn->setEnabled(true); -} - -void ColorMapEditor::setScaledColors(bool scale) -{ - if (scale) - color_map.setMode(QwtLinearColorMap::ScaledColors); - else - color_map.setMode(QwtLinearColorMap::FixedColors); - - scalingChanged(); -} - -QString ColorMapEditor::saveToXmlString(const QwtLinearColorMap& color_map) -{ - QString s = "\n"; - s += "\t" + QString::number(color_map.mode()) + "\n"; - s += "\t" + color_map.color1().name() + "\n"; - s += "\t" + color_map.color2().name() + "\n"; - QwtArray colors = color_map.colorStops(); - int stops = (int)colors.size(); - s += "\t" + QString::number(stops - 2) + "\n"; - for (int i = 1; i < stops - 1; i++) - { - s += "\t" + QString::number(colors[i]) + "\t"; - s += QColor(color_map.rgb(QwtDoubleInterval(0,1), colors[i])).name(); - s += "\n"; - } - return s += "\n"; -} - -void ColorMapEditor::spinBoxActivated(DoubleSpinBox *sb) -{ - if (!sb) - return; - - int rows = table->rowCount(); - for (int i = 0; i < rows; i++){ - DoubleSpinBox *box = (DoubleSpinBox*)table->cellWidget(i, 0); - if (box && box == sb){ - table->setCurrentCell(i, 0); - enableButtons(i); - return; - } - } -} === added file 'qtiplot/src/lib/src/DoubleSpinBox.cpp' --- qtiplot/src/lib/src/DoubleSpinBox.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/src/DoubleSpinBox.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,204 @@ +/*************************************************************************** + File : DoubleSpinBox.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2007-2008 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : A Double Spin Box + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "DoubleSpinBox.h" +#include +#include +#include +#include +#include +#include + +DoubleSpinBox::DoubleSpinBox(const char format, QWidget * parent) +:QAbstractSpinBox(parent), +d_format(format), +d_min_val(-DBL_MAX), +d_max_val(DBL_MAX), +d_value(0.0), +d_step(0.1), +d_prec(14) +{ + if (format == 'f') + d_prec = 1; + + setFocusPolicy(Qt::StrongFocus); + lineEdit()->setText(locale().toString(d_value, d_format, d_prec)); + setWrapping(false); + connect(this, SIGNAL(editingFinished()), this, SLOT(interpretText())); +} + +void DoubleSpinBox::setSingleStep(double val) +{ + if (d_step != val && val < d_max_val) + d_step = val; +} + +void DoubleSpinBox::setMaximum(double max) +{ + if (max == d_max_val || max > DBL_MAX) + return; + + d_max_val = max; +} + +void DoubleSpinBox::setMinimum(double min) +{ + if (min == d_min_val || min < -DBL_MAX) + return; + + d_min_val = min; +} + +void DoubleSpinBox::setRange(double min, double max) +{ + setMinimum(min); + setMaximum(max); +} + +void DoubleSpinBox::interpretText() +{ + bool ok = false; + QString s = text(); + double value = locale().toDouble(s, &ok); + if (ok && value == d_value) + return; + + if (!ok){ + MyParser parser; + parser.setLocale(QLocale()); + parser.addGSLConstants(); + try { + parser.SetExpr(s.toAscii().constData()); + value = parser.Eval(); + } catch (mu::ParserError &e){ + lineEdit()->setText(textFromValue(d_value)); + return; + } + } + + if (setValue(value)) + emit valueChanged(d_value); + else + lineEdit()->setText(textFromValue(d_value)); +} + +void DoubleSpinBox::stepBy ( int steps ) +{ + double val = d_value + steps*d_step; + if (fabs(fabs(d_value) - d_step) < 1e-14 && d_value * steps < 0)//possible zero + val = 0.0; + + if (setValue(val)) + emit valueChanged(d_value); +} + +QAbstractSpinBox::StepEnabled DoubleSpinBox::stepEnabled () const +{ + QAbstractSpinBox::StepEnabled stepDown = QAbstractSpinBox::StepNone; + if (d_value > d_min_val) + stepDown = StepDownEnabled; + + QAbstractSpinBox::StepEnabled stepUp = QAbstractSpinBox::StepNone; + if (d_value < d_max_val) + stepUp = StepUpEnabled; + + return stepDown | stepUp; +} + +bool DoubleSpinBox::setValue(double val) +{ + if (val >= d_min_val && val <= d_max_val){ + d_value = val; + lineEdit()->setText(textFromValue(d_value)); + return true; + } + + lineEdit()->setText(textFromValue(d_value)); + return false; +} + +QString DoubleSpinBox::textFromValue (double value) const +{ + if (!specialValueText().isEmpty() && value == d_min_val) + return specialValueText(); + + if (d_prec <= 14) + return locale().toString(value, d_format, d_prec); + + return locale().toString(value, d_format, 6); +} + +QValidator::State DoubleSpinBox::validate(QString & , int & ) const +{ + return QValidator::Acceptable; +} + +void DoubleSpinBox::focusInEvent(QFocusEvent * e) +{ + emit activated(this); + return QAbstractSpinBox::focusInEvent(e); +} + +/***************************************************************************** + * + * Class RangeLimitBox + * + *****************************************************************************/ + +RangeLimitBox::RangeLimitBox(LimitType type, QWidget * parent) +:QWidget(parent), +d_type(type) +{ + d_checkbox = new QCheckBox(); + d_spin_box = new DoubleSpinBox(); + d_spin_box->setSpecialValueText(" "); + d_spin_box->setValue(-DBL_MAX); + d_spin_box->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + d_spin_box->setEnabled(false); + + QHBoxLayout *l = new QHBoxLayout(this); + l->setMargin(0); + l->setSpacing(0); + l->addWidget(d_checkbox); + l->addWidget(d_spin_box); + + setFocusPolicy(Qt::StrongFocus); + setFocusProxy(d_spin_box); + connect(d_checkbox, SIGNAL(toggled(bool)), d_spin_box, SLOT(setEnabled(bool))); +} + +double RangeLimitBox::value() +{ + if (d_checkbox->isChecked()) + return d_spin_box->value(); + + double val = -DBL_MAX; + if (d_type == RightLimit) + return DBL_MAX; + return val; +} === removed file 'qtiplot/src/lib/src/DoubleSpinBox.cpp' --- qtiplot/src/lib/src/DoubleSpinBox.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/src/DoubleSpinBox.cpp 1970-01-01 00:00:00 +0000 @@ -1,207 +0,0 @@ -/*************************************************************************** - File : DoubleSpinBox.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2007-2008 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : A Double Spin Box - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "DoubleSpinBox.h" -#include -#include -#include -#include -#include -#include - -DoubleSpinBox::DoubleSpinBox(const char format, QWidget * parent) -:QAbstractSpinBox(parent), -d_format(format), -d_min_val(-DBL_MAX), -d_max_val(DBL_MAX), -d_value(0.0), -d_step(0.1), -d_prec(14) -{ - if (format == 'f') - d_prec = 1; - - setFocusPolicy(Qt::StrongFocus); - lineEdit()->setText(locale().toString(d_value, d_format, d_prec)); - setKeyboardTracking(false); - setWrapping(false); - connect(this, SIGNAL(editingFinished()), this, SLOT(interpretText())); -} - -void DoubleSpinBox::setSingleStep(double val) -{ - if (d_step != val && val < d_max_val) - d_step = val; -} - -void DoubleSpinBox::setMaximum(double max) -{ - if (max == d_max_val || max > DBL_MAX) - return; - - d_max_val = max; -} - -void DoubleSpinBox::setMinimum(double min) -{ - if (min == d_min_val || min < -DBL_MAX) - return; - - d_min_val = min; -} - -void DoubleSpinBox::setRange(double min, double max) -{ - setMinimum(min); - setMaximum(max); -} - -void DoubleSpinBox::interpretText() -{ - bool ok = false; - QString s = text(); - double value = locale().toDouble(s, &ok); - if (ok && value == d_value) - return; - - if (!ok){ - MyParser parser; - try { - parser.SetExpr(s.toAscii().constData()); - parser.SetDecSep(locale().decimalPoint().toAscii()); - if (locale().numberOptions () != QLocale::OmitGroupSeparator) - parser.SetThousandsSep(locale().groupSeparator().toAscii()); - - value = parser.Eval(); - } catch (mu::ParserError &e){ - lineEdit()->setText(textFromValue(d_value)); - return; - } - } - - if (setValue(value)) - emit valueChanged(d_value); - else - lineEdit()->setText(textFromValue(d_value)); -} - -void DoubleSpinBox::stepBy ( int steps ) -{ - double val = d_value + steps*d_step; - if (fabs(fabs(d_value) - d_step) < 1e-14 && d_value * steps < 0)//possible zero - val = 0.0; - - if (setValue(val)) - emit valueChanged(d_value); -} - -QAbstractSpinBox::StepEnabled DoubleSpinBox::stepEnabled () const -{ - QAbstractSpinBox::StepEnabled stepDown = QAbstractSpinBox::StepNone; - if (d_value > d_min_val) - stepDown = StepDownEnabled; - - QAbstractSpinBox::StepEnabled stepUp = QAbstractSpinBox::StepNone; - if (d_value < d_max_val) - stepUp = StepUpEnabled; - - return stepDown | stepUp; -} - -bool DoubleSpinBox::setValue(double val) -{ - if (val >= d_min_val && val <= d_max_val){ - d_value = val; - lineEdit()->setText(textFromValue(d_value)); - return true; - } - - lineEdit()->setText(textFromValue(d_value)); - return false; -} - -QString DoubleSpinBox::textFromValue (double value) const -{ - if (!specialValueText().isEmpty() && value == d_min_val) - return specialValueText(); - - if (d_prec <= 14) - return locale().toString(value, d_format, d_prec); - - return locale().toString(value, d_format, 6); -} - -QValidator::State DoubleSpinBox::validate(QString & , int & ) const -{ - return QValidator::Acceptable; -} - -void DoubleSpinBox::focusInEvent(QFocusEvent * e) -{ - emit activated(this); - return QAbstractSpinBox::focusInEvent(e); -} - -/***************************************************************************** - * - * Class RangeLimitBox - * - *****************************************************************************/ - -RangeLimitBox::RangeLimitBox(LimitType type, QWidget * parent) -:QWidget(parent), -d_type(type) -{ - d_checkbox = new QCheckBox(); - d_spin_box = new DoubleSpinBox(); - d_spin_box->setSpecialValueText(" "); - d_spin_box->setValue(-DBL_MAX); - d_spin_box->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - d_spin_box->setEnabled(false); - - QHBoxLayout *l = new QHBoxLayout(this); - l->setMargin(0); - l->setSpacing(0); - l->addWidget(d_checkbox); - l->addWidget(d_spin_box); - - setFocusPolicy(Qt::StrongFocus); - setFocusProxy(d_spin_box); - connect(d_checkbox, SIGNAL(toggled(bool)), d_spin_box, SLOT(setEnabled(bool))); -} - -double RangeLimitBox::value() -{ - if (d_checkbox->isChecked()) - return d_spin_box->value(); - - double val = -DBL_MAX; - if (d_type == RightLimit) - return DBL_MAX; - return val; -} === added file 'qtiplot/src/lib/src/ExtensibleFileDialog.cpp' --- qtiplot/src/lib/src/ExtensibleFileDialog.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/src/ExtensibleFileDialog.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,105 @@ +/*************************************************************************** + File : ExtensibleFileDialog.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2007 by Knut Franke + (C) 2007 - 2010 by Ion Vasilief + Email (use @ for *) : knut.franke*gmx.de, ion_vasilief*yahoo.fr + Description : QFileDialog plus generic extension support + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + +#include "ExtensibleFileDialog.h" +#include +#include +#include +#include + +ExtensibleFileDialog::ExtensibleFileDialog(QWidget *parent, bool extended, Qt::WFlags flags) + : QFileDialog(parent, flags) +{ + d_extension = 0; + + d_extension_toggle = new QPushButton(tr("<< &Advanced")); + d_extension_toggle->setCheckable(true); + if (extended) + d_extension_toggle->toggle(); + d_extension_toggle->hide(); // show only for d_extension != 0 + + QGridLayout *main_layout = qobject_cast(layout()); + if (main_layout) { + d_extension_row = main_layout->rowCount(); + main_layout->addWidget(d_extension_toggle, d_extension_row, main_layout->columnCount()-1); + main_layout->setRowStretch(d_extension_row, 0); + main_layout->setRowStretch(d_extension_row+1, 0); + } else { + // fallback in case QFileDialog uses a different layout in the future (=> main_layout==0) + // would probably look a mess, but at least all functions would be accessible + layout()->addWidget(d_extension_toggle); + } + + connect(this, SIGNAL(accepted()), this, SLOT(close())); + connect(this, SIGNAL(rejected()), this, SLOT(close())); +} + +void ExtensibleFileDialog::setExtensionWidget(QWidget *extension) +{ + if (d_extension == extension) + return; + if (d_extension) { + d_extension->hide(); + disconnect(d_extension_toggle, SIGNAL(toggled(bool))); + } + d_extension = extension; + if (!d_extension) { + d_extension_toggle->hide(); + return; + } + d_extension_toggle->show(); + + QGridLayout *main_layout = qobject_cast(layout()); + if (main_layout) + main_layout->addWidget(d_extension, d_extension_row, 0, 2, main_layout->columnCount()-1); + else + layout()->addWidget(d_extension); + + d_extension->setVisible(d_extension_toggle->isChecked()); + connect(d_extension_toggle, SIGNAL(toggled(bool)), d_extension, SLOT(setVisible(bool))); +} + +void ExtensibleFileDialog::setEditableFilter(bool on) +{ + QLayout *main_layout = layout(); + if (!main_layout) + return; + + for (int i = 0; i < main_layout->count(); i++){ + QLayoutItem *item = main_layout->itemAt(i); + if (!item) + continue; + QComboBox *filterBox = qobject_cast(item->widget()); + if (filterBox){ + filterBox->setEditable(on); + return; + } + } +} === removed file 'qtiplot/src/lib/src/ExtensibleFileDialog.cpp' --- qtiplot/src/lib/src/ExtensibleFileDialog.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/src/ExtensibleFileDialog.cpp 1970-01-01 00:00:00 +0000 @@ -1,85 +0,0 @@ -/*************************************************************************** - File : ExtensibleFileDialog.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2007 by Knut Franke, Ion Vasilief - Email (use @ for *) : knut.franke*gmx.de, ion_vasilief*yahoo.fr - Description : QFileDialog plus generic extension support - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#include "ExtensibleFileDialog.h" -#include -#include -#include - -ExtensibleFileDialog::ExtensibleFileDialog(QWidget *parent, bool extended, Qt::WFlags flags) - : QFileDialog(parent, flags) -{ - d_extension = 0; - - d_extension_toggle = new QPushButton(tr("<< &Advanced")); - d_extension_toggle->setCheckable(true); - if (extended) - d_extension_toggle->toggle(); - d_extension_toggle->hide(); // show only for d_extension != 0 - - QGridLayout *main_layout = qobject_cast(layout()); - if (main_layout) { - d_extension_row = main_layout->rowCount(); - main_layout->addWidget(d_extension_toggle, d_extension_row, main_layout->columnCount()-1); - main_layout->setRowStretch(d_extension_row, 0); - main_layout->setRowStretch(d_extension_row+1, 0); - } else { - // fallback in case QFileDialog uses a different layout in the future (=> main_layout==0) - // would probably look a mess, but at least all functions would be accessible - layout()->addWidget(d_extension_toggle); - } - - connect(this, SIGNAL(accepted()), this, SLOT(close())); - connect(this, SIGNAL(rejected()), this, SLOT(close())); -} - -void ExtensibleFileDialog::setExtensionWidget(QWidget *extension) -{ - if (d_extension == extension) - return; - if (d_extension) { - d_extension->hide(); - disconnect(d_extension_toggle, SIGNAL(toggled(bool))); - } - d_extension = extension; - if (!d_extension) { - d_extension_toggle->hide(); - return; - } - d_extension_toggle->show(); - - QGridLayout *main_layout = qobject_cast(layout()); - if (main_layout) - main_layout->addWidget(d_extension, d_extension_row, 0, 2, main_layout->columnCount()-1); - else - layout()->addWidget(d_extension); - - d_extension->setVisible(d_extension_toggle->isChecked()); - connect(d_extension_toggle, SIGNAL(toggled(bool)), d_extension, SLOT(setVisible(bool))); -} === added file 'qtiplot/src/lib/src/LineNumberDisplay.cpp' --- qtiplot/src/lib/src/LineNumberDisplay.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/src/LineNumberDisplay.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,118 @@ +/*************************************************************************** + File : LineNumberDisplay.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2008 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : A widget displaying line numbers for a QTextEdit + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "LineNumberDisplay.h" +#include +#include +#include + +LineNumberDisplay::LineNumberDisplay(QTextEdit *te, QWidget *parent) + : QTextEdit(parent), d_text_edit(te) +{ + setReadOnly(true); + setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + setFrameStyle(QFrame::Panel | QFrame::Raised); + setMaximumWidth(0); + setLineWidth(0); + setFocusPolicy(Qt::NoFocus); + setCurrentFont(te->currentFont()); + viewport()->setCursor(Qt::ArrowCursor); + + QPalette palette = this->palette(); + palette.setColor(QPalette::Highlight, palette.color(QPalette::Base)); + setPalette(palette); + + if (te){ + connect(this, SIGNAL(selectionChanged()), this, SLOT(updateDocumentSelection())); + + connect(te->document(), SIGNAL(contentsChanged()), this, SLOT(updateLineNumbers())); + connect((QObject *)te->verticalScrollBar(), SIGNAL(valueChanged(int)), + (QObject *)verticalScrollBar(), SLOT(setValue(int))); + connect(te, SIGNAL(currentCharFormatChanged (const QTextCharFormat &)), + this, SLOT(changeCharFormat (const QTextCharFormat &))); + } +} + +void LineNumberDisplay::updateDocumentSelection() +{ + if (!isVisible() || !d_text_edit) + return; + + QTextCursor c = textCursor(); + int selectionStart = document()->findBlock(c.selectionStart()).firstLineNumber(); + int selectionEnd = document()->findBlock(c.selectionEnd()).firstLineNumber(); + int selectedLines = abs(selectionEnd - selectionStart); + + QTextCursor cursor(d_text_edit->textCursor()); + cursor.movePosition(QTextCursor::Start); + for (int i = 0; i < selectionStart; i++) + cursor.movePosition(QTextCursor::Down); + + for (int i = 0; i < selectedLines; i++) + cursor.movePosition(QTextCursor::Down, QTextCursor::KeepAnchor); + + cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); + + if (selectionEnd == d_text_edit->document()->blockCount() - 1) + cursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor); + + d_text_edit->setTextCursor(cursor); +} + +void LineNumberDisplay::updateLineNumbers(bool force) +{ + if (!isVisible() || !d_text_edit) + return; + + int lines = d_text_edit->document()->blockCount(); + if (document()->blockCount() - 1 == lines && !force) + return; + + QString aux; + for(int i = 0; i < lines; i++) + aux += QString::number(i + 1) + "\n"; + + setPlainText(aux); + + QFontMetrics fm(d_text_edit->currentFont(), this); + setMaximumWidth(2*fm.boundingRect(QString::number(lines)).width()); + verticalScrollBar()->setValue(d_text_edit->verticalScrollBar()->value()); +} + +void LineNumberDisplay::showEvent(QShowEvent *e) +{ + e->accept(); + if (isVisible()) + updateLineNumbers(); +} + +void LineNumberDisplay::changeCharFormat (const QTextCharFormat &f) +{ + setCurrentFont(f.font()); +} === removed file 'qtiplot/src/lib/src/LineNumberDisplay.cpp' --- qtiplot/src/lib/src/LineNumberDisplay.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/src/LineNumberDisplay.cpp 1970-01-01 00:00:00 +0000 @@ -1,118 +0,0 @@ -/*************************************************************************** - File : LineNumberDisplay.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2008 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : A widget displaying line numbers for a QTextEdit - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "LineNumberDisplay.h" -#include -#include -#include - -LineNumberDisplay::LineNumberDisplay(QTextEdit *te, QWidget *parent) - : QTextEdit(parent), d_text_edit(te) -{ - setReadOnly(true); - setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - setFrameStyle(QFrame::Panel | QFrame::Raised); - setMaximumWidth(0); - setLineWidth(0); - setFocusPolicy(Qt::NoFocus); - setCurrentFont(te->currentFont()); - viewport()->setCursor(Qt::ArrowCursor); - - QPalette palette = this->palette(); - palette.setColor(QPalette::Highlight, palette.color(QPalette::Base)); - setPalette(palette); - - if (te){ - connect(this, SIGNAL(selectionChanged()), this, SLOT(updateDocumentSelection())); - - connect(te->document(), SIGNAL(contentsChanged()), this, SLOT(updateLineNumbers())); - connect((QObject *)te->verticalScrollBar(), SIGNAL(valueChanged(int)), - (QObject *)verticalScrollBar(), SLOT(setValue(int))); - connect(te, SIGNAL(currentCharFormatChanged (const QTextCharFormat &)), - this, SLOT(changeCharFormat (const QTextCharFormat &))); - } -} - -void LineNumberDisplay::updateDocumentSelection() -{ - if (!isVisible() || !d_text_edit) - return; - - QTextCursor c = textCursor(); - int selectionStart = document()->findBlock(c.selectionStart()).firstLineNumber(); - int selectionEnd = document()->findBlock(c.selectionEnd()).firstLineNumber(); - int selectedLines = abs(selectionEnd - selectionStart); - - QTextCursor cursor(d_text_edit->textCursor()); - cursor.movePosition(QTextCursor::Start); - for (int i = 0; i < selectionStart; i++) - cursor.movePosition(QTextCursor::Down); - - for (int i = 0; i < selectedLines; i++) - cursor.movePosition(QTextCursor::Down, QTextCursor::KeepAnchor); - - cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); - - if (selectionEnd == d_text_edit->document()->blockCount() - 1) - cursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor); - - d_text_edit->setTextCursor(cursor); -} - -void LineNumberDisplay::updateLineNumbers(bool force) -{ - if (!isVisible() || !d_text_edit) - return; - - int lines = d_text_edit->document()->blockCount(); - if (document()->blockCount() - 1 == lines && !force) - return; - - QString aux; - for(int i = 0; i < lines; i++) - aux += QString::number(i + 1) + "\n"; - - setPlainText(aux); - - QFontMetrics fm(d_text_edit->currentFont(), this); - setMaximumWidth(2*fm.boundingRect(QString::number(lines)).width()); - verticalScrollBar()->setValue(d_text_edit->verticalScrollBar()->value()); -} - -void LineNumberDisplay::showEvent(QShowEvent *e) -{ - e->accept(); - if (isVisible()) - updateLineNumbers(); -} - -void LineNumberDisplay::changeCharFormat (const QTextCharFormat &f) -{ - setCurrentFont(f.font()); -} === added file 'qtiplot/src/lib/src/PatternBox.cpp' --- qtiplot/src/lib/src/PatternBox.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/src/PatternBox.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,187 @@ +/*************************************************************************** + File : PatternBox.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Tomomasa Ohkubo, Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Pattern combox box + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "PatternBox.h" + +#include +#include +#include + +const Qt::BrushStyle PatternBox::patterns[] = { + Qt::SolidPattern, + Qt::HorPattern, + Qt::VerPattern, + Qt::CrossPattern, + Qt::BDiagPattern, + Qt::FDiagPattern, + Qt::DiagCrossPattern, + Qt::Dense1Pattern, + Qt::Dense2Pattern, + Qt::Dense3Pattern, + Qt::Dense4Pattern, + Qt::Dense5Pattern, + Qt::Dense6Pattern, + Qt::Dense7Pattern, + Qt::NoBrush +}; + +PatternBox::PatternBox(QWidget *parent) : QComboBox(parent) +{ + init(); +} + +void PatternBox::init() +{ + + QPixmap icon = QPixmap(28, 14); + icon.fill ( QColor (Qt::white) ); + const QRect r = QRect(0, 0, 27, 13); + QPainter p(&icon); + QBrush br = QBrush(QColor(Qt::darkGray), Qt::SolidPattern); + p.fillRect(r, br); + p.drawRect(r); + this->addItem(icon, tr( "Solid" ) ); + + br = QBrush(QColor(Qt::darkGray), Qt::HorPattern); + p.eraseRect(r); + p.fillRect(r, br); + p.drawRect(r); + this->addItem(icon, tr( "Horizontal" ) ); + + br = QBrush(QColor(Qt::darkGray), Qt::VerPattern); + p.eraseRect(r); + p.fillRect(r, br); + p.drawRect(r); + this->addItem(icon, tr( "Vertical" ) ); + + br = QBrush(QColor(Qt::darkGray), Qt::CrossPattern); + p.eraseRect(r); + p.fillRect(r, br); + p.drawRect(r); + this->addItem(icon, tr( "Cross" ) ); + + br = QBrush(QColor(Qt::darkGray), Qt::BDiagPattern); + p.eraseRect(r); + p.fillRect(r, br); + p.drawRect(r); + this->addItem(icon, tr( "BDiagonal" ) ); + + br = QBrush(QColor(Qt::darkGray), Qt::FDiagPattern); + p.eraseRect(r); + p.fillRect(r, br); + p.drawRect(r); + this->addItem(icon, tr( "FDiagonal" ) ); + + br = QBrush(QColor(Qt::darkGray), Qt::DiagCrossPattern); + p.eraseRect(r); + p.fillRect(r, br); + p.drawRect(r); + this->addItem(icon, tr( "DiagCross" ) ); + + br = QBrush(QColor(Qt::darkGray), Qt::Dense1Pattern); + p.eraseRect(r); + p.fillRect(r, br); + p.drawRect(r); + this->addItem(icon, tr( "Dense1" ) ); + + br = QBrush(QColor(Qt::darkGray), Qt::Dense2Pattern); + p.eraseRect(r); + p.fillRect(r, br); + p.drawRect(r); + this->addItem(icon, tr( "Dense2" ) ); + + br = QBrush(QColor(Qt::darkGray), Qt::Dense3Pattern); + p.eraseRect(r); + p.fillRect(r, br); + p.drawRect(r); + this->addItem(icon, tr( "Dense3" ) ); + + br = QBrush(QColor(Qt::darkGray), Qt::Dense4Pattern); + p.eraseRect(r); + p.fillRect(r, br); + p.drawRect(r); + this->addItem(icon, tr( "Dense4" ) ); + + br = QBrush(QColor(Qt::darkGray), Qt::Dense5Pattern); + p.eraseRect(r); + p.fillRect(r, br); + p.drawRect(r); + this->addItem(icon, tr( "Dense5" ) ); + + br = QBrush(QColor(Qt::darkGray), Qt::Dense6Pattern); + p.eraseRect(r); + p.fillRect(r, br); + p.drawRect(r); + this->addItem(icon, tr( "Dense6" ) ); + + br = QBrush(QColor(Qt::darkGray), Qt::Dense7Pattern); + p.eraseRect(r); + p.fillRect(r, br); + p.drawRect(r); + this->addItem(icon, tr( "Dense7" ) ); + + p.eraseRect(r); + p.drawRect(r); + this->addItem(icon, tr( "None" ) ); + p.end(); +} + +void PatternBox::setPattern(const Qt::BrushStyle& style) +{ + const Qt::BrushStyle*ite = std::find(patterns, patterns + sizeof(patterns), style); + if (ite == patterns + sizeof(patterns)) + this->setCurrentIndex(14); // default pattern is none. + else + this->setCurrentIndex(ite - patterns); +} + +Qt::BrushStyle PatternBox::brushStyle(int index) +{ + if (index < (int)sizeof(patterns)) + return patterns[index]; + else + return Qt::NoBrush; // default patterns is none. +} + +Qt::BrushStyle PatternBox::getSelectedPattern() const +{ + size_t i = this->currentIndex(); + if (i < sizeof(patterns)) + return patterns[i]; + else + return Qt::NoBrush; // default patterns is none. +} + +int PatternBox::patternIndex(const Qt::BrushStyle& style) +{ + const Qt::BrushStyle*ite = std::find(patterns, patterns + sizeof(patterns), style); + if (ite == patterns + sizeof(patterns)) + return 14; // default pattern is none. + else + return (ite - patterns); +} === removed file 'qtiplot/src/lib/src/PatternBox.cpp' --- qtiplot/src/lib/src/PatternBox.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/src/PatternBox.cpp 1970-01-01 00:00:00 +0000 @@ -1,187 +0,0 @@ -/*************************************************************************** - File : PatternBox.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Tomomasa Ohkubo, Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Pattern combox box - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "PatternBox.h" - -#include -#include -#include - -const Qt::BrushStyle PatternBox::patterns[] = { - Qt::SolidPattern, - Qt::HorPattern, - Qt::VerPattern, - Qt::CrossPattern, - Qt::BDiagPattern, - Qt::FDiagPattern, - Qt::DiagCrossPattern, - Qt::Dense1Pattern, - Qt::Dense2Pattern, - Qt::Dense3Pattern, - Qt::Dense4Pattern, - Qt::Dense5Pattern, - Qt::Dense6Pattern, - Qt::Dense7Pattern, - Qt::NoBrush -}; - -PatternBox::PatternBox(QWidget *parent) : QComboBox(parent) -{ - init(); -} - -void PatternBox::init() -{ - - QPixmap icon = QPixmap(28, 14); - icon.fill ( QColor (Qt::white) ); - const QRect r = QRect(0, 0, 27, 13); - QPainter p(&icon); - QBrush br = QBrush(QColor(Qt::darkGray), Qt::SolidPattern); - p.fillRect(r, br); - p.drawRect(r); - this->addItem(icon, tr( "Solid" ) ); - - br = QBrush(QColor(Qt::darkGray), Qt::HorPattern); - p.eraseRect(r); - p.fillRect(r, br); - p.drawRect(r); - this->addItem(icon, tr( "Horizontal" ) ); - - br = QBrush(QColor(Qt::darkGray), Qt::VerPattern); - p.eraseRect(r); - p.fillRect(r, br); - p.drawRect(r); - this->addItem(icon, tr( "Vertical" ) ); - - br = QBrush(QColor(Qt::darkGray), Qt::CrossPattern); - p.eraseRect(r); - p.fillRect(r, br); - p.drawRect(r); - this->addItem(icon, tr( "Cross" ) ); - - br = QBrush(QColor(Qt::darkGray), Qt::BDiagPattern); - p.eraseRect(r); - p.fillRect(r, br); - p.drawRect(r); - this->addItem(icon, tr( "BDiagonal" ) ); - - br = QBrush(QColor(Qt::darkGray), Qt::FDiagPattern); - p.eraseRect(r); - p.fillRect(r, br); - p.drawRect(r); - this->addItem(icon, tr( "FDiagonal" ) ); - - br = QBrush(QColor(Qt::darkGray), Qt::DiagCrossPattern); - p.eraseRect(r); - p.fillRect(r, br); - p.drawRect(r); - this->addItem(icon, tr( "DiagCross" ) ); - - br = QBrush(QColor(Qt::darkGray), Qt::Dense1Pattern); - p.eraseRect(r); - p.fillRect(r, br); - p.drawRect(r); - this->addItem(icon, tr( "Dense1" ) ); - - br = QBrush(QColor(Qt::darkGray), Qt::Dense2Pattern); - p.eraseRect(r); - p.fillRect(r, br); - p.drawRect(r); - this->addItem(icon, tr( "Dense2" ) ); - - br = QBrush(QColor(Qt::darkGray), Qt::Dense3Pattern); - p.eraseRect(r); - p.fillRect(r, br); - p.drawRect(r); - this->addItem(icon, tr( "Dense3" ) ); - - br = QBrush(QColor(Qt::darkGray), Qt::Dense4Pattern); - p.eraseRect(r); - p.fillRect(r, br); - p.drawRect(r); - this->addItem(icon, tr( "Dense4" ) ); - - br = QBrush(QColor(Qt::darkGray), Qt::Dense5Pattern); - p.eraseRect(r); - p.fillRect(r, br); - p.drawRect(r); - this->addItem(icon, tr( "Dense5" ) ); - - br = QBrush(QColor(Qt::darkGray), Qt::Dense6Pattern); - p.eraseRect(r); - p.fillRect(r, br); - p.drawRect(r); - this->addItem(icon, tr( "Dense6" ) ); - - br = QBrush(QColor(Qt::darkGray), Qt::Dense7Pattern); - p.eraseRect(r); - p.fillRect(r, br); - p.drawRect(r); - this->addItem(icon, tr( "Dense7" ) ); - - p.eraseRect(r); - p.drawRect(r); - this->addItem(icon, tr( "None" ) ); - p.end(); -} - -void PatternBox::setPattern(const Qt::BrushStyle& style) -{ - const Qt::BrushStyle*ite = std::find(patterns, patterns + sizeof(patterns), style); - if (ite == patterns + sizeof(patterns)) - this->setCurrentIndex(14); // default pattern is none. - else - this->setCurrentIndex(ite - patterns); -} - -Qt::BrushStyle PatternBox::brushStyle(int index) -{ - if (index < (int)sizeof(patterns)) - return patterns[index]; - else - return Qt::NoBrush; // default patterns is none. -} - -Qt::BrushStyle PatternBox::getSelectedPattern() const -{ - size_t i = this->currentIndex(); - if (i < sizeof(patterns)) - return patterns[i]; - else - return Qt::NoBrush; // default patterns is none. -} - -int PatternBox::patternIndex(const Qt::BrushStyle& style) -{ - const Qt::BrushStyle*ite = std::find(patterns, patterns + sizeof(patterns), style); - if (ite == patterns + sizeof(patterns)) - return 14; // default pattern is none. - else - return (ite - patterns); -} === added file 'qtiplot/src/lib/src/PenStyleBox.cpp' --- qtiplot/src/lib/src/PenStyleBox.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/src/PenStyleBox.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,84 @@ +/*************************************************************************** + File : PenStyleBox.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2008 Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Pen style combox box + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "PenStyleBox.h" + +#include + +const Qt::PenStyle PenStyleBox::patterns[] = { + Qt::SolidLine, + Qt::DashLine, + Qt::DotLine, + Qt::DashDotLine, + Qt::DashDotDotLine +}; + +PenStyleBox::PenStyleBox(QWidget *parent) : QComboBox(parent) +{ + setEditable(false); + addItem("_____"); + addItem("_ _ _"); + addItem("....."); + addItem("_._._"); + addItem("_.._.."); +} + +void PenStyleBox::setStyle(const Qt::PenStyle& style) +{ + const Qt::PenStyle*ite = std::find(patterns, patterns + sizeof(patterns), style); + if (ite == patterns + sizeof(patterns)) + this->setCurrentIndex(0); // default style is solid. + else + this->setCurrentIndex(ite - patterns); +} + +Qt::PenStyle PenStyleBox::penStyle(int index) +{ + if (index < (int)sizeof(patterns)) + return patterns[index]; + else + return Qt::SolidLine; // default style is solid. +} + +Qt::PenStyle PenStyleBox::style() const +{ + size_t i = this->currentIndex(); + if (i < sizeof(patterns)) + return patterns[i]; + else + return Qt::SolidLine; // default style is solid. +} + +int PenStyleBox::styleIndex(const Qt::PenStyle& style) +{ + const Qt::PenStyle*ite = std::find(patterns, patterns + sizeof(patterns), style); + if (ite == patterns + sizeof(patterns)) + return 0; // default style is solid. + else + return (ite - patterns); +} === removed file 'qtiplot/src/lib/src/PenStyleBox.cpp' --- qtiplot/src/lib/src/PenStyleBox.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/src/PenStyleBox.cpp 1970-01-01 00:00:00 +0000 @@ -1,84 +0,0 @@ -/*************************************************************************** - File : PenStyleBox.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2008 Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Pen style combox box - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "PenStyleBox.h" - -#include - -const Qt::PenStyle PenStyleBox::patterns[] = { - Qt::SolidLine, - Qt::DashLine, - Qt::DotLine, - Qt::DashDotLine, - Qt::DashDotDotLine -}; - -PenStyleBox::PenStyleBox(QWidget *parent) : QComboBox(parent) -{ - setEditable(false); - addItem("_____"); - addItem("_ _ _"); - addItem("....."); - addItem("_._._"); - addItem("_.._.."); -} - -void PenStyleBox::setStyle(const Qt::PenStyle& style) -{ - const Qt::PenStyle*ite = std::find(patterns, patterns + sizeof(patterns), style); - if (ite == patterns + sizeof(patterns)) - this->setCurrentIndex(0); // default style is solid. - else - this->setCurrentIndex(ite - patterns); -} - -Qt::PenStyle PenStyleBox::penStyle(int index) -{ - if (index < (int)sizeof(patterns)) - return patterns[index]; - else - return Qt::SolidLine; // default style is solid. -} - -Qt::PenStyle PenStyleBox::style() const -{ - size_t i = this->currentIndex(); - if (i < sizeof(patterns)) - return patterns[i]; - else - return Qt::SolidLine; // default style is solid. -} - -int PenStyleBox::styleIndex(const Qt::PenStyle& style) -{ - const Qt::PenStyle*ite = std::find(patterns, patterns + sizeof(patterns), style); - if (ite == patterns + sizeof(patterns)) - return 0; // default style is solid. - else - return (ite - patterns); -} === added file 'qtiplot/src/lib/src/SymbolBox.cpp' --- qtiplot/src/lib/src/SymbolBox.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/src/SymbolBox.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,198 @@ +/*************************************************************************** + File : SymbolBox.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Plot symbol combo box + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "SymbolBox.h" +#include + +#include +#include + +const QwtSymbol::Style SymbolBox::symbols[] = { + QwtSymbol::NoSymbol, + QwtSymbol::Ellipse, + QwtSymbol::Rect, + QwtSymbol::Diamond, + QwtSymbol::Triangle, + QwtSymbol::DTriangle, + QwtSymbol::UTriangle, + QwtSymbol::LTriangle, + QwtSymbol::RTriangle, + QwtSymbol::Cross, + QwtSymbol::XCross, + QwtSymbol::HLine, + QwtSymbol::VLine, + QwtSymbol::Star1, + QwtSymbol::Star2, + QwtSymbol::Hexagon +}; + +SymbolBox::SymbolBox(bool showNoSymbol, QWidget *parent) : QComboBox(parent) +{ + init(showNoSymbol); +} + +void SymbolBox::init(bool showNoSymbol) +{ + QPixmap icon = QPixmap(15, 15); + QColor c = QColor (Qt::gray); + icon.fill(c); + const QRect r = QRect(1, 1, 14, 14); + QPainter p(&icon); + p.setRenderHint(QPainter::Antialiasing); + QwtSymbol symb; + p.setBrush(QBrush(QColor(Qt::white))); + + if (showNoSymbol) + this->addItem(tr("No Symbol" )); + + symb.setStyle (QwtSymbol::Ellipse); + symb.draw(&p, r); + this->addItem(icon, tr("Ellipse" )); + + symb.setStyle (QwtSymbol::Rect); + icon.fill(c); + symb.draw(&p, r.adjusted(0, 0, -1, -1)); + this->addItem(icon,tr("Rectangle")); + + symb.setStyle (QwtSymbol::Diamond); + icon.fill(c); + symb.draw(&p, r); + this->addItem(icon,tr("Diamond")); + + symb.setStyle (QwtSymbol::Triangle); + icon.fill(c); + symb.draw(&p, r); + this->addItem(icon,tr("Triangle")); + + symb.setStyle (QwtSymbol::DTriangle); + icon.fill(c); + symb.draw(&p, r); + this->addItem(icon,tr("Down Triangle")); + + symb.setStyle (QwtSymbol::UTriangle); + icon.fill(c); + symb.draw(&p, r); + this->addItem(icon,tr("Up Triangle")); + + symb.setStyle (QwtSymbol::LTriangle); + icon.fill(c); + symb.draw(&p, r); + this->addItem(icon,tr("Left Triangle")); + + symb.setStyle (QwtSymbol::RTriangle); + icon.fill(c); + symb.draw(&p, r); + this->addItem(icon,tr("Right Triangle")); + + symb.setStyle (QwtSymbol::Cross); + icon.fill(c); + symb.draw(&p, r); + this->addItem(icon,tr("Cross")); + + symb.setStyle (QwtSymbol::XCross); + icon.fill(c); + symb.draw(&p, r); + this->addItem(icon,tr("Diagonal Cross")); + + symb.setStyle (QwtSymbol::HLine); + icon.fill(c); + symb.draw(&p, r); + this->addItem(icon,tr("Horizontal Line")); + + symb.setStyle (QwtSymbol::VLine); + p.eraseRect ( r ); + symb.draw(&p, r); + this->addItem(icon,tr("Vertical Line")); + + symb.setStyle (QwtSymbol::Star1); + icon.fill(c); + symb.draw(&p, r); + this->addItem(icon,tr("Star 1")); + + symb.setStyle (QwtSymbol::Star2); + icon.fill(c); + symb.draw(&p, r); + this->addItem(icon,tr("Star 2")); + + symb.setStyle (QwtSymbol::Hexagon); + icon.fill(c); + symb.draw(&p, r); + this->addItem(icon,tr("Hexagon")); + + p.end(); +} + +void SymbolBox::setStyle(const QwtSymbol::Style& style) +{ + const QwtSymbol::Style*ite = std::find(symbols, symbols + sizeof(symbols), style); + if (ite == symbols + sizeof(symbols)) + this->setCurrentIndex(0); + else + this->setCurrentIndex(ite - symbols); +} + +QwtSymbol::Style SymbolBox::selectedSymbol() const +{ + size_t i = this->currentIndex(); + if (i < sizeof(symbols)) + return symbols[this->currentIndex()]; + + return QwtSymbol::NoSymbol; +} + +int SymbolBox::symbolIndex(const QwtSymbol::Style& style) +{ + const QwtSymbol::Style*ite = std::find(symbols, symbols + sizeof(symbols), style); + if (ite == symbols + sizeof(symbols)) + return 0; + + return (ite - symbols); +} + +QwtSymbol::Style SymbolBox::style(int index) +{ + if (index >= 0 && index < (int)sizeof(symbols)) + return symbols[index]; + + return QwtSymbol::NoSymbol; +} + +QList SymbolBox::defaultSymbols() +{ + QList lst; + for (int i = 0; i < QwtSymbol::StyleCnt; i++) + lst << i; + + return lst; +} + +void SymbolBox::focusInEvent(QFocusEvent * e) +{ + emit activated(this); + return QComboBox::focusInEvent(e); +} === removed file 'qtiplot/src/lib/src/SymbolBox.cpp' --- qtiplot/src/lib/src/SymbolBox.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/src/SymbolBox.cpp 1970-01-01 00:00:00 +0000 @@ -1,182 +0,0 @@ -/*************************************************************************** - File : SymbolBox.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Plot symbol combo box - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "SymbolBox.h" -#include - -#include -#include - -const QwtSymbol::Style SymbolBox::symbols[] = { - QwtSymbol::NoSymbol, - QwtSymbol::Ellipse, - QwtSymbol::Rect, - QwtSymbol::Diamond, - QwtSymbol::Triangle, - QwtSymbol::DTriangle, - QwtSymbol::UTriangle, - QwtSymbol::LTriangle, - QwtSymbol::RTriangle, - QwtSymbol::Cross, - QwtSymbol::XCross, - QwtSymbol::HLine, - QwtSymbol::VLine, - QwtSymbol::Star1, - QwtSymbol::Star2, - QwtSymbol::Hexagon -}; - -SymbolBox::SymbolBox(QWidget *parent) : QComboBox(parent) -{ - init(); -} - -void SymbolBox::init() -{ - QPixmap icon = QPixmap(15, 15); - QColor c = QColor (Qt::gray); - icon.fill(c); - const QRect r = QRect(1, 1, 14, 14); - QPainter p(&icon); - p.setRenderHint(QPainter::Antialiasing); - QwtSymbol symb; - p.setBrush(QBrush(QColor(Qt::white))); - - this->addItem(tr("No Symbol" )); - - symb.setStyle (QwtSymbol::Ellipse); - symb.draw(&p, r); - this->addItem(icon, tr("Ellipse" )); - - symb.setStyle (QwtSymbol::Rect); - icon.fill(c); - symb.draw(&p, r.adjusted(0, 0, -1, -1)); - this->addItem(icon,tr("Rectangle")); - - symb.setStyle (QwtSymbol::Diamond); - icon.fill(c); - symb.draw(&p, r); - this->addItem(icon,tr("Diamond")); - - symb.setStyle (QwtSymbol::Triangle); - icon.fill(c); - symb.draw(&p, r); - this->addItem(icon,tr("Triangle")); - - symb.setStyle (QwtSymbol::DTriangle); - icon.fill(c); - symb.draw(&p, r); - this->addItem(icon,tr("Down Triangle")); - - symb.setStyle (QwtSymbol::UTriangle); - icon.fill(c); - symb.draw(&p, r); - this->addItem(icon,tr("Up Triangle")); - - symb.setStyle (QwtSymbol::LTriangle); - icon.fill(c); - symb.draw(&p, r); - this->addItem(icon,tr("Left Triangle")); - - symb.setStyle (QwtSymbol::RTriangle); - icon.fill(c); - symb.draw(&p, r); - this->addItem(icon,tr("Right Triangle")); - - symb.setStyle (QwtSymbol::Cross); - icon.fill(c); - symb.draw(&p, r); - this->addItem(icon,tr("Cross")); - - symb.setStyle (QwtSymbol::XCross); - icon.fill(c); - symb.draw(&p, r); - this->addItem(icon,tr("Diagonal Cross")); - - symb.setStyle (QwtSymbol::HLine); - icon.fill(c); - symb.draw(&p, r); - this->addItem(icon,tr("Horizontal Line")); - - symb.setStyle (QwtSymbol::VLine); - p.eraseRect ( r ); - symb.draw(&p, r); - this->addItem(icon,tr("Vertical Line")); - - symb.setStyle (QwtSymbol::Star1); - icon.fill(c); - symb.draw(&p, r); - this->addItem(icon,tr("Star 1")); - - symb.setStyle (QwtSymbol::Star2); - icon.fill(c); - symb.draw(&p, r); - this->addItem(icon,tr("Star 2")); - - symb.setStyle (QwtSymbol::Hexagon); - icon.fill(c); - symb.draw(&p, r); - this->addItem(icon,tr("Hexagon")); - - p.end(); -} - -void SymbolBox::setStyle(const QwtSymbol::Style& style) -{ - const QwtSymbol::Style*ite = std::find(symbols, symbols + sizeof(symbols), style); - if (ite == symbols + sizeof(symbols)) - this->setCurrentIndex(0); - else - this->setCurrentIndex(ite - symbols); -} - -QwtSymbol::Style SymbolBox::selectedSymbol() const -{ - size_t i = this->currentIndex(); - if (i < sizeof(symbols)) - return symbols[this->currentIndex()]; - else - return QwtSymbol::NoSymbol; -} - -int SymbolBox::symbolIndex(const QwtSymbol::Style& style) -{ - const QwtSymbol::Style*ite = std::find(symbols, symbols + sizeof(symbols), style); - if (ite == symbols + sizeof(symbols)) - return 0; - else - return (ite - symbols); -} - -QwtSymbol::Style SymbolBox::style(int index) -{ - if (index < (int)sizeof(symbols)) - return symbols[index]; - else - return QwtSymbol::NoSymbol; -} === added file 'qtiplot/src/lib/src/SymbolDialog.cpp' --- qtiplot/src/lib/src/SymbolDialog.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/src/SymbolDialog.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,694 @@ +/*************************************************************************** + File : SymbolDialog.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2004 - 2010 by Ion Vasilief, + (C) 2006 - June 2007 by Tilman Hoener zu Siederdissen + Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net + Description : Tool window to select special text characters + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "SymbolDialog.h" +#include +#include +#include +#include +#include +#include +#include +#include + +SymbolDialog::SymbolDialog(CharSet charSet, QWidget* parent, Qt::WFlags fl ) +: QDialog( parent, fl ) +{ + setAttribute(Qt::WA_DeleteOnClose); + setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); + setSizeGripEnabled( false ); + + buttons = new QButtonGroup(this); + mainLayout = new QVBoxLayout(this); + gridLayout = new QGridLayout(); + + switch(charSet){ + case lowerGreek: + initLowerGreekChars(); + break; + case upperGreek: + initUpperGreekChars(); + break; + case mathSymbols: + initMathSymbols(); + break; + case arrowSymbols: + initArrowSymbols(); + break; + case numberSymbols: + initNumberSymbols(); + break; + case latexArrowSymbols: + initLatexArrowSymbols(); + break; + case latexMathSymbols: + initLatexMathSymbols(); + break; + } + + closeButton = new QPushButton(tr("&Close"), this); + + mainLayout->addLayout( gridLayout ); + mainLayout->addStretch(); + mainLayout->addWidget( closeButton ); + + languageChange(); + + connect(buttons, SIGNAL(buttonClicked(int)), this, SLOT(getChar(int))); + connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); + QShortcut *shortcut = new QShortcut(Qt::Key_Return, this); + connect( shortcut , SIGNAL(activated()), this, SLOT(addCurrentChar()) ); +} + +void SymbolDialog::initLowerGreekChars() +{ + int counter = 0; + for (int i=0 ; i <= (0x3C9-0x3B1) ; i++,counter++ ){ + QPushButton *btn = new QPushButton(QString(QChar(i+0x3B1))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/5,counter%5); + } +} + +void SymbolDialog::initUpperGreekChars() +{ + int i, counter = 0; + for ( i=0; i <= (0x394-0x393); i++,counter++ ){ + QPushButton *btn = new QPushButton(QString(QChar(i+0x393))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn, counter + 1); + gridLayout->addWidget(btn, counter/5,counter%5); + } + + for ( i=0; i <= (0x3A0-0x398); i+=3,counter++ ){ + QPushButton *btn = new QPushButton(QString(QChar(i+0x398))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn, counter + 1); + gridLayout->addWidget(btn, counter/5,counter%5); + } + + for ( i=0; i <= (0x3A6-0x3A0); i+=3,counter++ ){ + QPushButton *btn = new QPushButton(QString(QChar(i+0x3A0))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn, counter + 1); + gridLayout->addWidget(btn, counter/5,counter%5); + } + + + for ( i=0 ; i <= (0x3A9-0x3A8) ; i++,counter++ ){ + QPushButton *btn = new QPushButton(QString(QChar(i+0x3A8))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/5,counter%5); + } + + numButtons = counter; +} + +void SymbolDialog::initNumberSymbols() +{ + int i, counter = 0; + for ( i=0 ; i <= (0x216B-0x2153) ; i++,counter++ ){ + QPushButton *btn = new QPushButton(QString(QChar(i+0x2153))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + for ( i=0 ; i <= (0x217B-0x2170) ; i++,counter++ ){ + QPushButton *btn = new QPushButton(QString(QChar(i+0x2170))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + numButtons = counter; +} + +void SymbolDialog::initMathSymbols() +{ + int i, counter = 0; + for ( i=0 ; i <= (0x220D-0x2200) ; i++,counter++ ){ + QPushButton *btn = new QPushButton(QString(QChar(i+0x2200))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + for ( i=0 ; i <= (0x2211-0x220F) ; i++,counter++ ){ + QPushButton *btn = new QPushButton(QString(QChar(i+0x220F))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + for ( i=0 ; i <= (0x00B1-0x00B1) ; i++,counter++ ){ + QPushButton *btn = new QPushButton(QString(QChar(i+0x00B1))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + for ( i=0 ; i <= (0x2213-0x2213) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x2213))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + // MULTIPLICATION SIGN + for ( i=0; i <= (0x00D7-0x00D7) ; i++,counter++ ){ + QPushButton *btn = new QPushButton(QString(QChar(i+0x00D7))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + + for ( i=0 ; i <= (0x221E - 0x2217) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x2217))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + for ( i=0 ; i <= (0x2222-0x2222) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x2222))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + for ( i=0 ; i <= (0x2230-0x2227) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x2227))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + for ( i=0 ; i <= (0x223F-0x223F) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x223F))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + + for ( i=0 ; i <= (0x2245-0x2245) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x2245))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + for ( i=0 ; i <= (0x2248-0x2248) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x2248))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + for ( i=0 ; i <= (0x2259-0x2259) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x2259))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + + for ( i=0 ; i <= (0x2255-0x2254) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x2254))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + + for ( i=0 ; i <= (0x2267-0x225F) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x225F))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + + // < SIGN + for ( i=0; i < 1 ; i++,counter++ ){ + QPushButton *btn = new QPushButton(QString("<")); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + + for ( i=0 ; i <= (0x226B-0x226A) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x226A))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + + for ( i=0 ; i <= (0x2289-0x2282) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x2282))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + + // h bar + for ( i=0 ; i <= (0x210F-0x210F) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x210F))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + + // angstrom + for ( i=0 ; i <= (0x212B-0x212B) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x212B))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + // per mille and per ten thousand (thanks to Knut Franke) + for ( i=0; i <= (0x2031-0x2030) ; i++,counter++ ){ + QPushButton *btn = new QPushButton(QString(QChar(i+0x2030))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/8,counter%8); + } + numButtons = counter; +} + +void SymbolDialog::initLatexMathSymbols() +{ + int i, counter = 0; + for ( i=0 ; i <= (0x2200-0x2200) ; i++,counter++ ){ + QPushButton *btn = new QPushButton(QString(QChar(i+0x2200))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/7,counter%7); + } + for ( i=0 ; i <= (0x2209-0x2202) ; i++,counter++ ){ + QPushButton *btn = new QPushButton(QString(QChar(i+0x2202))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/7,counter%7); + } + for ( i=0 ; i <= (0x220C-0x220B) ; i++,counter++ ){ + QPushButton *btn = new QPushButton(QString(QChar(i+0x220B))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/7,counter%7); + } + for ( i=0 ; i <= (0x2211-0x220F) ; i++,counter++ ){ + QPushButton *btn = new QPushButton(QString(QChar(i+0x220F))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/7,counter%7); + } + for ( i=0 ; i <= (0x00B1-0x00B1) ; i++,counter++ ){ + QPushButton *btn = new QPushButton(QString(QChar(i+0x00B1))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/7,counter%7); + } + for ( i=0 ; i <= (0x2213-0x2213) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x2213))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/7,counter%7); + } + // MULTIPLICATION SIGN + for ( i=0; i <= (0x00D7-0x00D7) ; i++,counter++ ){ + QPushButton *btn = new QPushButton(QString(QChar(i+0x00D7))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/7,counter%7); + } + + for ( i=0 ; i <= (0x221E - 0x2217) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x2217))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/7,counter%7); + } + for ( i=0 ; i < (0x222F-0x2227) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x2227))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/7,counter%7); + } + for ( i=0 ; i <= (0x223F-0x223F) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x223F))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/7,counter%7); + } + for ( i=0 ; i <= (0x2245-0x2245) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x2245))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/7,counter%7); + } + for ( i=0 ; i <= (0x2248-0x2248) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x2248))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/7,counter%7); + } + for ( i=0 ; i <= (0x2265-0x2260) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x2260))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/7,counter%7); + } + for ( i=0 ; i <= (0x226B-0x226A) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x226A))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/7,counter%7); + } + for ( i=0 ; i <= (0x2289-0x2282) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x2282))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/7,counter%7); + } + + // h bar + for ( i=0 ; i <= (0x210F-0x210F) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x210F))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/7,counter%7); + } + + // angstrom + for ( i=0 ; i <= (0x212B-0x212B) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x212B))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/7,counter%7); + } + numButtons = counter; + + QFont font = this->font(); + QStringList families = QFontDatabase().families(); + foreach(QString f, families){ + if (f.contains("Unicode")){ + font.setFamily(f); + + for(int i = 0; i < numButtons; i++){ + QWidget *w = gridLayout->itemAt(i)->widget(); + if (w) + w->setFont(font); + } + break; + } + } +} + +void SymbolDialog::initArrowSymbols() +{ + int i, counter = 0; + for ( i=0 ; i <= (0x219B-0x2190) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x2190))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/6,counter%6); + } + for ( i=0 ; i <= (0x21A7-0x21A4) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x21A4))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/6,counter%6); + } + for ( i=0 ; i <= (0x21D5-0x21CD) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x21CD))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/6,counter%6); + } + for ( i=0 ; i <= (0x21E9-0x21E6) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x21E6))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/6,counter%6); + } + numButtons = counter; +} + +void SymbolDialog::initLatexArrowSymbols() +{ + QFont font = this->font(); + QStringList families = QFontDatabase().families(); + foreach(QString f, families){ + if (f.contains("Unicode")){ + font.setFamily(f); + break; + } + } + + int i, counter = 0; + for ( i=0 ; i <= (0x2199-0x2190) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x2190))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setFont(font); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/6,counter%6); + } + + for ( i=0 ; i <= (0x21AA-0x21A9) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x21A9))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setFont(font); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/6,counter%6); + } + + for ( i=0 ; i <= (0x21D5-0x21D0) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x21D0))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setFont(font); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/6,counter%6); + } + + for ( i=0 ; i <= (0x21BD-0x21BC) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x21BC))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setFont(font); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/6,counter%6); + } + + for ( i=0 ; i <= (0x21C1-0x21C0) ; i++,counter++ ) + { + QPushButton *btn = new QPushButton(QString(QChar(i+0x21C0))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setFont(font); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/6,counter%6); + } + + QPushButton *btn = new QPushButton(QString(QChar(0x21CC))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setFont(font); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/6,counter%6); + + counter++; + + btn = new QPushButton(QString(QChar(0x21A6))); + btn->setMaximumWidth(40); + btn->setFlat ( true ); + btn->setFont(font); + btn->setAutoDefault (false); + buttons->addButton(btn,counter+1); + gridLayout->addWidget(btn,counter/6,counter%6); + + numButtons = counter; +} + +void SymbolDialog::addCurrentChar() +{ + for (int i=1; i < numButtons; i++) + { + QPushButton *btn = (QPushButton *) buttons->button(i); + if (btn && btn->hasFocus()) + emit addLetter(btn->text()); + } +} + +void SymbolDialog::getChar(int btnIndex) +{ + QPushButton * btn = (QPushButton *)buttons->button( btnIndex ); + if(btn) + emit addLetter(btn->text().replace("<", "<")); +} + + +void SymbolDialog::languageChange() +{ + setWindowTitle( tr( "QtiPlot - Choose Symbol" ) ); +} + + +void SymbolDialog::focusInEvent( QFocusEvent * event ) +{ + Q_UNUSED(event) + // select the first button as default (in case [return] is pressed) + ((QPushButton *)buttons->button(1))->setFocus(Qt::TabFocusReason); +} === removed file 'qtiplot/src/lib/src/SymbolDialog.cpp' --- qtiplot/src/lib/src/SymbolDialog.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/src/SymbolDialog.cpp 1970-01-01 00:00:00 +0000 @@ -1,678 +0,0 @@ -/*************************************************************************** - File : SymbolDialog.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, Tilman Hoener zu Siederdissen - Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net - Description : Tool window to select special text characters - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "SymbolDialog.h" -#include -#include -#include -#include -#include -#include -#include -#include - -SymbolDialog::SymbolDialog(CharSet charSet, QWidget* parent, Qt::WFlags fl ) -: QDialog( parent, fl ) -{ - setAttribute(Qt::WA_DeleteOnClose); - setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); - setSizeGripEnabled( false ); - - buttons = new QButtonGroup(this); - mainLayout = new QVBoxLayout(this); - gridLayout = new QGridLayout(); - - switch(charSet){ - case lowerGreek: - initLowerGreekChars(); - break; - case upperGreek: - initUpperGreekChars(); - break; - case mathSymbols: - initMathSymbols(); - break; - case arrowSymbols: - initArrowSymbols(); - break; - case numberSymbols: - initNumberSymbols(); - break; - case latexArrowSymbols: - initLatexArrowSymbols(); - break; - case latexMathSymbols: - initLatexMathSymbols(); - break; - } - - closeButton = new QPushButton(tr("&Close"), this); - - mainLayout->addLayout( gridLayout ); - mainLayout->addStretch(); - mainLayout->addWidget( closeButton ); - - languageChange(); - - connect(buttons, SIGNAL(buttonClicked(int)), this, SLOT(getChar(int))); - connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); - QShortcut *shortcut = new QShortcut(Qt::Key_Return, this); - connect( shortcut , SIGNAL(activated()), this, SLOT(addCurrentChar()) ); -} - -void SymbolDialog::initLowerGreekChars() -{ - int counter = 0; - for (int i=0 ; i <= (0x3C9-0x3B1) ; i++,counter++ ){ - QPushButton *btn = new QPushButton(QString(QChar(i+0x3B1))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/5,counter%5); - } -} - -void SymbolDialog::initUpperGreekChars() -{ - int i, counter = 0; - for ( i=0; i <= (0x394-0x393); i++,counter++ ){ - QPushButton *btn = new QPushButton(QString(QChar(i+0x393))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn, counter + 1); - gridLayout->addWidget(btn, counter/5,counter%5); - } - - for ( i=0; i <= (0x3A0-0x398); i+=3,counter++ ){ - QPushButton *btn = new QPushButton(QString(QChar(i+0x398))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn, counter + 1); - gridLayout->addWidget(btn, counter/5,counter%5); - } - - for ( i=0; i <= (0x3A6-0x3A0); i+=3,counter++ ){ - QPushButton *btn = new QPushButton(QString(QChar(i+0x3A0))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn, counter + 1); - gridLayout->addWidget(btn, counter/5,counter%5); - } - - - for ( i=0 ; i <= (0x3A9-0x3A8) ; i++,counter++ ){ - QPushButton *btn = new QPushButton(QString(QChar(i+0x3A8))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/5,counter%5); - } - - numButtons = counter; -} - -void SymbolDialog::initNumberSymbols() -{ - int i, counter = 0; - for ( i=0 ; i <= (0x216B-0x2153) ; i++,counter++ ){ - QPushButton *btn = new QPushButton(QString(QChar(i+0x2153))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - for ( i=0 ; i <= (0x217B-0x2170) ; i++,counter++ ){ - QPushButton *btn = new QPushButton(QString(QChar(i+0x2170))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - numButtons = counter; -} - -void SymbolDialog::initMathSymbols() -{ - int i, counter = 0; - for ( i=0 ; i <= (0x220D-0x2200) ; i++,counter++ ){ - QPushButton *btn = new QPushButton(QString(QChar(i+0x2200))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - for ( i=0 ; i <= (0x2211-0x220F) ; i++,counter++ ){ - QPushButton *btn = new QPushButton(QString(QChar(i+0x220F))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - for ( i=0 ; i <= (0x00B1-0x00B1) ; i++,counter++ ){ - QPushButton *btn = new QPushButton(QString(QChar(i+0x00B1))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - for ( i=0 ; i <= (0x2213-0x2213) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x2213))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - // MULTIPLICATION SIGN - for ( i=0; i <= (0x00D7-0x00D7) ; i++,counter++ ){ - QPushButton *btn = new QPushButton(QString(QChar(i+0x00D7))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - - for ( i=0 ; i <= (0x221E - 0x2217) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x2217))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - for ( i=0 ; i <= (0x2222-0x2222) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x2222))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - for ( i=0 ; i <= (0x2230-0x2227) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x2227))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - for ( i=0 ; i <= (0x223F-0x223F) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x223F))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - for ( i=0 ; i <= (0x2245-0x2245) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x2245))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - for ( i=0 ; i <= (0x2248-0x2248) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x2248))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - for ( i=0 ; i <= (0x2259-0x2259) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x2259))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - for ( i=0 ; i <= (0x2255-0x2254) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x2254))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - for ( i=0 ; i <= (0x2267-0x225F) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x225F))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - for ( i=0 ; i <= (0x226B-0x226A) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x226A))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - for ( i=0 ; i <= (0x2289-0x2282) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x2282))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - - // h bar - for ( i=0 ; i <= (0x210F-0x210F) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x210F))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - - // angstrom - for ( i=0 ; i <= (0x212B-0x212B) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x212B))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - // per mille and per ten thousand (thanks to Knut Franke) - for ( i=0; i <= (0x2031-0x2030) ; i++,counter++ ){ - QPushButton *btn = new QPushButton(QString(QChar(i+0x2030))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/8,counter%8); - } - numButtons = counter; -} - -void SymbolDialog::initLatexMathSymbols() -{ - int i, counter = 0; - for ( i=0 ; i <= (0x2200-0x2200) ; i++,counter++ ){ - QPushButton *btn = new QPushButton(QString(QChar(i+0x2200))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/7,counter%7); - } - for ( i=0 ; i <= (0x2209-0x2202) ; i++,counter++ ){ - QPushButton *btn = new QPushButton(QString(QChar(i+0x2202))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/7,counter%7); - } - for ( i=0 ; i <= (0x220C-0x220B) ; i++,counter++ ){ - QPushButton *btn = new QPushButton(QString(QChar(i+0x220B))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/7,counter%7); - } - for ( i=0 ; i <= (0x2211-0x220F) ; i++,counter++ ){ - QPushButton *btn = new QPushButton(QString(QChar(i+0x220F))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/7,counter%7); - } - for ( i=0 ; i <= (0x00B1-0x00B1) ; i++,counter++ ){ - QPushButton *btn = new QPushButton(QString(QChar(i+0x00B1))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/7,counter%7); - } - for ( i=0 ; i <= (0x2213-0x2213) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x2213))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/7,counter%7); - } - // MULTIPLICATION SIGN - for ( i=0; i <= (0x00D7-0x00D7) ; i++,counter++ ){ - QPushButton *btn = new QPushButton(QString(QChar(i+0x00D7))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/7,counter%7); - } - - for ( i=0 ; i <= (0x221E - 0x2217) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x2217))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/7,counter%7); - } - for ( i=0 ; i < (0x222F-0x2227) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x2227))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/7,counter%7); - } - for ( i=0 ; i <= (0x223F-0x223F) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x223F))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/7,counter%7); - } - for ( i=0 ; i <= (0x2245-0x2245) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x2245))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/7,counter%7); - } - for ( i=0 ; i <= (0x2248-0x2248) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x2248))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/7,counter%7); - } - for ( i=0 ; i <= (0x2265-0x2260) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x2260))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/7,counter%7); - } - for ( i=0 ; i <= (0x226B-0x226A) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x226A))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/7,counter%7); - } - for ( i=0 ; i <= (0x2289-0x2282) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x2282))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/7,counter%7); - } - - // h bar - for ( i=0 ; i <= (0x210F-0x210F) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x210F))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/7,counter%7); - } - - // angstrom - for ( i=0 ; i <= (0x212B-0x212B) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x212B))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/7,counter%7); - } - numButtons = counter; - - QFont font = this->font(); - QStringList families = QFontDatabase().families(); - foreach(QString f, families){ - if (f.contains("Unicode")){ - font.setFamily(f); - - for(int i = 0; i < numButtons; i++){ - QWidget *w = gridLayout->itemAt(i)->widget(); - if (w) - w->setFont(font); - } - break; - } - } -} - -void SymbolDialog::initArrowSymbols() -{ - int i, counter = 0; - for ( i=0 ; i <= (0x219B-0x2190) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x2190))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/6,counter%6); - } - for ( i=0 ; i <= (0x21A7-0x21A4) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x21A4))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/6,counter%6); - } - for ( i=0 ; i <= (0x21D5-0x21CD) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x21CD))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/6,counter%6); - } - for ( i=0 ; i <= (0x21E9-0x21E6) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x21E6))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/6,counter%6); - } - numButtons = counter; -} - -void SymbolDialog::initLatexArrowSymbols() -{ - QFont font = this->font(); - QStringList families = QFontDatabase().families(); - foreach(QString f, families){ - if (f.contains("Unicode")){ - font.setFamily(f); - break; - } - } - - int i, counter = 0; - for ( i=0 ; i <= (0x2199-0x2190) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x2190))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setFont(font); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/6,counter%6); - } - - for ( i=0 ; i <= (0x21AA-0x21A9) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x21A9))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setFont(font); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/6,counter%6); - } - - for ( i=0 ; i <= (0x21D5-0x21D0) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x21D0))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setFont(font); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/6,counter%6); - } - - for ( i=0 ; i <= (0x21BD-0x21BC) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x21BC))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setFont(font); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/6,counter%6); - } - - for ( i=0 ; i <= (0x21C1-0x21C0) ; i++,counter++ ) - { - QPushButton *btn = new QPushButton(QString(QChar(i+0x21C0))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setFont(font); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/6,counter%6); - } - - QPushButton *btn = new QPushButton(QString(QChar(0x21CC))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setFont(font); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/6,counter%6); - - counter++; - - btn = new QPushButton(QString(QChar(0x21A6))); - btn->setMaximumWidth(40); - btn->setFlat ( true ); - btn->setFont(font); - btn->setAutoDefault (false); - buttons->addButton(btn,counter+1); - gridLayout->addWidget(btn,counter/6,counter%6); - - numButtons = counter; -} - -void SymbolDialog::addCurrentChar() -{ - for (int i=1; i < numButtons; i++) - { - QPushButton *btn = (QPushButton *) buttons->button(i); - if (btn && btn->hasFocus()) - emit addLetter(btn->text()); - } -} - -void SymbolDialog::getChar(int btnIndex) -{ - QPushButton * btn = (QPushButton *)buttons->button( btnIndex ); - if(btn) - emit addLetter(btn->text()); -} - - -void SymbolDialog::languageChange() -{ - setWindowTitle( tr( "QtiPlot - Choose Symbol" ) ); -} - - -void SymbolDialog::focusInEvent( QFocusEvent * event ) -{ - Q_UNUSED(event) - // select the first button as default (in case [return] is pressed) - ((QPushButton *)buttons->button(1))->setFocus(Qt::TabFocusReason); -} === added file 'qtiplot/src/lib/src/TextFormatButtons.cpp' --- qtiplot/src/lib/src/TextFormatButtons.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/lib/src/TextFormatButtons.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,554 @@ +/*************************************************************************** + File : TextFormatButtons.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief, Tilman Hoener zu Siederdissen + Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net + Description : Widget with text format buttons (connected to a QTextEdit) + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + +#include "TextFormatButtons.h" +#include "SymbolDialog.h" +#include +#include +#include +#include + +TextFormatButtons::TextFormatButtons(QTextEdit * textEdit, Buttons buttons, QWidget * parent) +: QWidget(parent), +connectedTextEdit(textEdit), +d_buttons(buttons) +{ + QHBoxLayout * layout = new QHBoxLayout(this); + layout->setMargin(0); + layout->setSpacing(0); + + init(buttons); +} + +void TextFormatButtons::init(Buttons buttons) +{ + QHBoxLayout *layout = (QHBoxLayout*)this->layout(); + QLayoutItem *child; + while ((child = layout->takeAt(0)) != 0){ + if (child->widget()) + delete child->widget(); + } + + QFont font = QFont(); + int btnSize = 32; +#ifdef Q_OS_MAC + btnSize = 38; +#endif + if (buttons == Legend || buttons == TexLegend){ + QPushButton *buttonCurve = new QPushButton( QPixmap(":/lineSymbol.png"), QString()); + buttonCurve->setFixedWidth(btnSize); + buttonCurve->setFixedHeight(btnSize); + buttonCurve->setFont(font); + layout->addWidget(buttonCurve); + connect( buttonCurve, SIGNAL(clicked()), this, SLOT(addCurve()) ); + } + + QPushButton *buttonSubscript = new QPushButton(QPixmap(":/index.png"), QString()); + buttonSubscript->setFixedWidth(btnSize); + buttonSubscript->setFixedHeight(btnSize); + buttonSubscript->setFont(font); + layout->addWidget(buttonSubscript); + connect( buttonSubscript, SIGNAL(clicked()), this, SLOT(addSubscript()) ); + + QPushButton *buttonSuperscript = new QPushButton(QPixmap(":/exp.png"), QString()); + buttonSuperscript->setFixedWidth(btnSize); + buttonSuperscript->setFixedHeight(btnSize); + buttonSuperscript->setFont(font); + layout->addWidget(buttonSuperscript); + connect( buttonSuperscript, SIGNAL(clicked()), this, SLOT(addSuperscript())); + + if (buttons == Equation || buttons == TexLegend){ + QPushButton *buttonFraction = new QPushButton(QPixmap(":/fraction.png"), QString()); + buttonFraction->setFixedWidth(btnSize); + buttonFraction->setFixedHeight(btnSize); + buttonFraction->setFont(font); + layout->addWidget(buttonFraction); + connect(buttonFraction, SIGNAL(clicked()), this, SLOT(addFraction())); + + QPushButton *buttonSquareRoot = new QPushButton(QPixmap(":/square_root.png"), QString()); + buttonSquareRoot->setFixedWidth(btnSize); + buttonSquareRoot->setFixedHeight(btnSize); + buttonSquareRoot->setFont(font); + layout->addWidget(buttonSquareRoot); + connect(buttonSquareRoot, SIGNAL(clicked()), this, SLOT(addSquareRoot())); + } + + QPushButton *buttonLowerGreek = new QPushButton(QString(QChar(0x3B1))); + buttonLowerGreek->setFont(font); + buttonLowerGreek->setFixedWidth(btnSize); + buttonLowerGreek->setFixedHeight(btnSize); + layout->addWidget(buttonLowerGreek); + connect( buttonLowerGreek, SIGNAL(clicked()), this, SLOT(showLowerGreek())); + + QPushButton *buttonUpperGreek = new QPushButton(QString(QChar(0x393))); + buttonUpperGreek->setFont(font); + buttonUpperGreek->setFixedWidth(btnSize); + buttonUpperGreek->setFixedHeight(btnSize); + layout->addWidget(buttonUpperGreek); + connect( buttonUpperGreek, SIGNAL(clicked()), this, SLOT(showUpperGreek())); + + QPushButton *buttonArrowSymbols = new QPushButton(QString(QChar(0x2192))); + buttonArrowSymbols->setFont(font); + buttonArrowSymbols->setFixedWidth(btnSize); + buttonArrowSymbols->setFixedHeight(btnSize); + layout->addWidget(buttonArrowSymbols); + connect( buttonArrowSymbols, SIGNAL(clicked()), this, SLOT(showArrowSymbols())); + + QPushButton *buttonMathSymbols = new QPushButton(QString(QChar(0x222B))); + buttonMathSymbols->setFont(font); + buttonMathSymbols->setFixedWidth(btnSize); + buttonMathSymbols->setFixedHeight(btnSize); + layout->addWidget(buttonMathSymbols); + connect( buttonMathSymbols, SIGNAL(clicked()), this, SLOT(showMathSymbols())); + + if (buttons != Plot3D && buttons != Equation && buttons != TexLegend){ + font = this->font(); + font.setBold(true); + + QPushButton *buttonBold = new QPushButton(tr("B","Button bold")); + buttonBold->setFont(font); + buttonBold->setFixedWidth(btnSize); + buttonBold->setFixedHeight(btnSize); + layout->addWidget(buttonBold); + connect( buttonBold, SIGNAL(clicked()), this, SLOT(addBold())); + + font = this->font(); + font.setItalic(true); + + QPushButton *buttonItalics = new QPushButton(tr("It","Button italics")); + buttonItalics->setFont(font); + buttonItalics->setFixedWidth(btnSize); + buttonItalics->setFixedHeight(btnSize); + layout->addWidget(buttonItalics); + connect( buttonItalics, SIGNAL(clicked()), this, SLOT(addItalics())); + + font = this->font(); + font.setUnderline(true); + + QPushButton *buttonUnderline = new QPushButton(tr("U","Button underline")); + buttonUnderline->setFont(font); + buttonUnderline->setFixedWidth(btnSize); + buttonUnderline->setFixedHeight(btnSize); + layout->addWidget(buttonUnderline); + layout->addStretch(); + connect( buttonUnderline, SIGNAL(clicked()), this, SLOT(addUnderline())); + } else + layout->addStretch(); +} + +void TextFormatButtons::showLowerGreek() +{ + SymbolDialog *greekLetters = new SymbolDialog(SymbolDialog::lowerGreek, this, Qt::Tool|Qt::WindowStaysOnTopHint); + greekLetters->setAttribute(Qt::WA_DeleteOnClose); + QFont f = connectedTextEdit->font(); + f.setPointSize(12); + greekLetters->setFont(f); + connect(greekLetters, SIGNAL(addLetter(const QString&)), this, SLOT(addSymbol(const QString&))); + greekLetters->show(); + greekLetters->setFocus(); +} + +void TextFormatButtons::showUpperGreek() +{ + SymbolDialog *greekLetters = new SymbolDialog(SymbolDialog::upperGreek, this, Qt::Tool|Qt::WindowStaysOnTopHint); + greekLetters->setAttribute(Qt::WA_DeleteOnClose); + QFont f = connectedTextEdit->font(); + f.setPointSize(12); + greekLetters->setFont(f); + connect(greekLetters, SIGNAL(addLetter(const QString&)), this, SLOT(addSymbol(const QString&))); + greekLetters->show(); + greekLetters->setFocus(); +} + +void TextFormatButtons::showMathSymbols() +{ + SymbolDialog::CharSet charSet = SymbolDialog::mathSymbols; + if (d_buttons == Equation || d_buttons == TexLegend) + charSet = SymbolDialog::latexMathSymbols; + + SymbolDialog *mathSymbols = new SymbolDialog(charSet, this, Qt::Tool|Qt::WindowStaysOnTopHint); + mathSymbols->setAttribute(Qt::WA_DeleteOnClose); + QFont f = connectedTextEdit->font(); + f.setPointSize(12); + mathSymbols->setFont(f); + connect(mathSymbols, SIGNAL(addLetter(const QString&)), this, SLOT(addSymbol(const QString&))); + mathSymbols->show(); + mathSymbols->setFocus(); +} + +void TextFormatButtons::showArrowSymbols() +{ + SymbolDialog::CharSet charSet = SymbolDialog::arrowSymbols; + if (d_buttons == Equation || d_buttons == TexLegend) + charSet = SymbolDialog::latexArrowSymbols; + + SymbolDialog *arrowSymbols = new SymbolDialog(charSet, this, Qt::Tool|Qt::WindowStaysOnTopHint); + arrowSymbols->setAttribute(Qt::WA_DeleteOnClose); + arrowSymbols->setFont(connectedTextEdit->font()); + QFont f = connectedTextEdit->font(); + f.setPointSize(12); + arrowSymbols->setFont(f); + connect(arrowSymbols, SIGNAL(addLetter(const QString&)), this, SLOT(addSymbol(const QString&))); + arrowSymbols->show(); + arrowSymbols->setFocus(); +} + +void TextFormatButtons::addSymbol(const QString & letter) +{ + if (d_buttons == Equation || d_buttons == TexLegend){ + int s = 0x3B1; + if (letter == QString(QChar(s))) + connectedTextEdit->textCursor().insertText("\\alpha"); + else if (letter == QString(QChar(1 + s))) + connectedTextEdit->textCursor().insertText("\\beta"); + else if (letter == QString(QChar(2 + s))) + connectedTextEdit->textCursor().insertText("\\gamma"); + else if (letter == QString(QChar(3 + s))) + connectedTextEdit->textCursor().insertText("\\delta"); + else if (letter == QString(QChar(4 + s))) + connectedTextEdit->textCursor().insertText("\\epsilon"); + else if (letter == QString(QChar(5 + s))) + connectedTextEdit->textCursor().insertText("\\zeta"); + else if (letter == QString(QChar(6 + s))) + connectedTextEdit->textCursor().insertText("\\eta"); + else if (letter == QString(QChar(7 + s))) + connectedTextEdit->textCursor().insertText("\\theta"); + else if (letter == QString(QChar(8 + s))) + connectedTextEdit->textCursor().insertText("\\iota"); + else if (letter == QString(QChar(9 + s))) + connectedTextEdit->textCursor().insertText("\\kappa"); + else if (letter == QString(QChar(10 + s))) + connectedTextEdit->textCursor().insertText("\\lambda"); + else if (letter == QString(QChar(11 + s))) + connectedTextEdit->textCursor().insertText("\\mu"); + else if (letter == QString(QChar(12 + s))) + connectedTextEdit->textCursor().insertText("\\nu"); + else if (letter == QString(QChar(13 + s))) + connectedTextEdit->textCursor().insertText("\\xi"); + else if (letter == QString(QChar(14 + s))) + connectedTextEdit->textCursor().insertText("\\\\o"); + else if (letter == QString(QChar(15 + s))) + connectedTextEdit->textCursor().insertText("\\pi"); + else if (letter == QString(QChar(16 + s))) + connectedTextEdit->textCursor().insertText("\\rho"); + else if (letter == QString(QChar(17 + s))) + connectedTextEdit->textCursor().insertText("\\varsigma"); + else if (letter == QString(QChar(18 + s))) + connectedTextEdit->textCursor().insertText("\\sigma"); + else if (letter == QString(QChar(19 + s))) + connectedTextEdit->textCursor().insertText("\\tau"); + else if (letter == QString(QChar(20 + s))) + connectedTextEdit->textCursor().insertText("\\upsilon"); + else if (letter == QString(QChar(21 + s))) + connectedTextEdit->textCursor().insertText("\\varphi"); + else if (letter == QString(QChar(22 + s))) + connectedTextEdit->textCursor().insertText("\\chi"); + else if (letter == QString(QChar(23 + s))) + connectedTextEdit->textCursor().insertText("\\psi"); + else if (letter == QString(QChar(24 + s))) + connectedTextEdit->textCursor().insertText("\\omega"); + + s = 0x393; + if (letter == QString(QChar(s))) + connectedTextEdit->textCursor().insertText("\\Gamma"); + else if (letter == QString(QChar(1 + s))) + connectedTextEdit->textCursor().insertText("\\Delta"); + else if (letter == QString(QChar(5 + s))) + connectedTextEdit->textCursor().insertText("\\Theta"); + else if (letter == QString(QChar(8 + s))) + connectedTextEdit->textCursor().insertText("\\Lambda"); + else if (letter == QString(QChar(11 + s))) + connectedTextEdit->textCursor().insertText("\\Xi"); + else if (letter == QString(QChar(13 + s))) + connectedTextEdit->textCursor().insertText("\\Pi"); + else if (letter == QString(QChar(16 + s))) + connectedTextEdit->textCursor().insertText("\\Sigma"); + else if (letter == QString(QChar(19 + s))) + connectedTextEdit->textCursor().insertText("\\Phi"); + else if (letter == QString(QChar(21 + s))) + connectedTextEdit->textCursor().insertText("\\Psi"); + else if (letter == QString(QChar(22 + s))) + connectedTextEdit->textCursor().insertText("\\Omega"); + + s = 0x2190; + if (letter == QString(QChar(s))) + connectedTextEdit->textCursor().insertText("\\leftarrow"); + else if (letter == QString(QChar(1 + s))) + connectedTextEdit->textCursor().insertText("\\uparrow"); + else if (letter == QString(QChar(2 + s))) + connectedTextEdit->textCursor().insertText("\\rightarrow"); + else if (letter == QString(QChar(3 + s))) + connectedTextEdit->textCursor().insertText("\\downarrow"); + else if (letter == QString(QChar(4 + s))) + connectedTextEdit->textCursor().insertText("\\leftrightarrow"); + else if (letter == QString(QChar(5 + s))) + connectedTextEdit->textCursor().insertText("\\updownarrow"); + else if (letter == QString(QChar(6 + s))) + connectedTextEdit->textCursor().insertText("\\nwarrow"); + else if (letter == QString(QChar(7 + s))) + connectedTextEdit->textCursor().insertText("\\nearrow"); + else if (letter == QString(QChar(8 + s))) + connectedTextEdit->textCursor().insertText("\\searrow"); + else if (letter == QString(QChar(9 + s))) + connectedTextEdit->textCursor().insertText("\\swarrow"); + + s = 0x21D0; + if (letter == QString(QChar(s))) + connectedTextEdit->textCursor().insertText("\\Leftarrow"); + else if (letter == QString(QChar(1 + s))) + connectedTextEdit->textCursor().insertText("\\Uparrow"); + else if (letter == QString(QChar(2 + s))) + connectedTextEdit->textCursor().insertText("\\Rightarrow"); + else if (letter == QString(QChar(3 + s))) + connectedTextEdit->textCursor().insertText("\\Downarrow"); + else if (letter == QString(QChar(4 + s))) + connectedTextEdit->textCursor().insertText("\\Leftrightarrow"); + else if (letter == QString(QChar(5 + s))) + connectedTextEdit->textCursor().insertText("\\Updownarrow"); + + if (letter == QString(QChar(0x21A6))) + connectedTextEdit->textCursor().insertText("\\mapsto"); + else if (letter == QString(QChar(0x21A9))) + connectedTextEdit->textCursor().insertText("\\hookleftarrow"); + else if (letter == QString(QChar(0x21AA))) + connectedTextEdit->textCursor().insertText("\\hookrightarrow"); + else if (letter == QString(QChar(0x21BC))) + connectedTextEdit->textCursor().insertText("\\leftharpoonup"); + else if (letter == QString(QChar(0x21BD))) + connectedTextEdit->textCursor().insertText("\\leftharpoondown"); + else if (letter == QString(QChar(0x21C0))) + connectedTextEdit->textCursor().insertText("\\rightharpoonup"); + else if (letter == QString(QChar(0x21C1))) + connectedTextEdit->textCursor().insertText("\\rightharpoondown"); + else if (letter == QString(QChar(0x21CC))) + connectedTextEdit->textCursor().insertText("\\rightleftharpoons"); + + s = 0x2200; + if (letter == QString(QChar(s))) + connectedTextEdit->textCursor().insertText("\\forall"); + else if (letter == QString(QChar(2 + s))) + connectedTextEdit->textCursor().insertText("\\partial"); + else if (letter == QString(QChar(3 + s))) + connectedTextEdit->textCursor().insertText("\\exists"); + else if (letter == QString(QChar(4 + s))) + connectedTextEdit->textCursor().insertText("\\not\\exists"); + else if (letter == QString(QChar(5 + s))) + connectedTextEdit->textCursor().insertText("\\oslash"); + else if (letter == QString(QChar(6 + s))) + connectedTextEdit->textCursor().insertText("\\Delta"); + else if (letter == QString(QChar(7 + s))) + connectedTextEdit->textCursor().insertText("\\nabla"); + else if (letter == QString(QChar(8 + s))) + connectedTextEdit->textCursor().insertText("\\in"); + else if (letter == QString(QChar(9 + s))) + connectedTextEdit->textCursor().insertText("\\notin"); + else if (letter == QString(QChar(11 + s))) + connectedTextEdit->textCursor().insertText("\\ni"); + else if (letter == QString(QChar(12 + s))) + connectedTextEdit->textCursor().insertText("\\not\\ni"); + + s = 0x220F; + if (letter == QString(QChar(s))) + connectedTextEdit->textCursor().insertText("\\prod"); + else if (letter == QString(QChar(1 + s))) + connectedTextEdit->textCursor().insertText("\\coprod"); + else if (letter == QString(QChar(2 + s))) + connectedTextEdit->textCursor().insertText("\\sum"); + + if (letter == QString(QChar(0x00B1))) + connectedTextEdit->textCursor().insertText("\\pm"); + else if (letter == QString(QChar(0x2213))) + connectedTextEdit->textCursor().insertText("\\mp"); + else if (letter == QString(QChar(0x00D7))) + connectedTextEdit->textCursor().insertText("\\times"); + + s = 0x2217; + if (letter == QString(QChar(s))) + connectedTextEdit->textCursor().insertText("\\ast"); + else if (letter == QString(QChar(1 + s))) + connectedTextEdit->textCursor().insertText("\\circ"); + else if (letter == QString(QChar(2 + s))) + connectedTextEdit->textCursor().insertText("\\bullet"); + else if (letter == QString(QChar(3 + s))) + connectedTextEdit->textCursor().insertText("\\surd"); + else if (letter == QString(QChar(4 + s))) + connectedTextEdit->textCursor().insertText("\\sqrt[3]{}"); + else if (letter == QString(QChar(5 + s))) + connectedTextEdit->textCursor().insertText("\\sqrt[4]{}"); + else if (letter == QString(QChar(6 + s))) + connectedTextEdit->textCursor().insertText("\\propto"); + else if (letter == QString(QChar(7 + s))) + connectedTextEdit->textCursor().insertText("\\infty"); + + s = 0x2227; + if (letter == QString(QChar(s))) + connectedTextEdit->textCursor().insertText("\\wedge"); + else if (letter == QString(QChar(1 + s))) + connectedTextEdit->textCursor().insertText("\\vee"); + else if (letter == QString(QChar(2 + s))) + connectedTextEdit->textCursor().insertText("\\cap"); + else if (letter == QString(QChar(3 + s))) + connectedTextEdit->textCursor().insertText("\\cup"); + else if (letter == QString(QChar(4 + s))) + connectedTextEdit->textCursor().insertText("\\int"); + else if (letter == QString(QChar(5 + s))) + connectedTextEdit->textCursor().insertText("\\int \\!\\!\\! \\int"); + else if (letter == QString(QChar(6 + s))) + connectedTextEdit->textCursor().insertText("\\int \\!\\!\\! \\int \\!\\!\\! \\int"); + else if (letter == QString(QChar(7 + s))) + connectedTextEdit->textCursor().insertText("\\oint"); + + if (letter == QString(QChar(0x223F))) + connectedTextEdit->textCursor().insertText("\\sim"); + else if (letter == QString(QChar(0x2245))) + connectedTextEdit->textCursor().insertText("\\cong"); + else if (letter == QString(QChar(0x2248))) + connectedTextEdit->textCursor().insertText("\\approx"); + + s = 0x2260; + if (letter == QString(QChar(s))) + connectedTextEdit->textCursor().insertText("\\not="); + else if (letter == QString(QChar(1 + s))) + connectedTextEdit->textCursor().insertText("\\equiv"); + else if (letter == QString(QChar(2 + s))) + connectedTextEdit->textCursor().insertText("\\not\\equiv"); + + s = 0x2264; + if (letter == QString(QChar(s))) + connectedTextEdit->textCursor().insertText("\\le"); + else if (letter == QString(QChar(1 + s))) + connectedTextEdit->textCursor().insertText("\\ge"); + + s = 0x226A; + if (letter == QString(QChar(s))) + connectedTextEdit->textCursor().insertText("\\ll"); + else if (letter == QString(QChar(1 + s))) + connectedTextEdit->textCursor().insertText("\\gg"); + + s = 0x2282; + if (letter == QString(QChar(s))) + connectedTextEdit->textCursor().insertText("\\subset"); + else if (letter == QString(QChar(1 + s))) + connectedTextEdit->textCursor().insertText("\\supset"); + else if (letter == QString(QChar(2 + s))) + connectedTextEdit->textCursor().insertText("\\not\\subset"); + else if (letter == QString(QChar(3 + s))) + connectedTextEdit->textCursor().insertText("\\not\\supset"); + else if (letter == QString(QChar(4 + s))) + connectedTextEdit->textCursor().insertText("\\subseteq"); + else if (letter == QString(QChar(5 + s))) + connectedTextEdit->textCursor().insertText("\\supseteq"); + else if (letter == QString(QChar(6 + s))) + connectedTextEdit->textCursor().insertText("\\not\\subseteq"); + else if (letter == QString(QChar(7 + s))) + connectedTextEdit->textCursor().insertText("\\not\\supseteq"); + + if (letter == QString(QChar(0x210F))) + connectedTextEdit->textCursor().insertText("\\hbar"); + else if (letter == QString(QChar(0x212B))) + connectedTextEdit->textCursor().insertText("\\AA"); + } else + connectedTextEdit->textCursor().insertText(letter); +} + +void TextFormatButtons::addCurve() +{ + formatText("\\l(",")"); +} + +void TextFormatButtons::addUnderline() +{ + formatText("",""); +} + +void TextFormatButtons::addItalics() +{ + formatText("",""); +} + +void TextFormatButtons::addBold() +{ + formatText("",""); +} + +void TextFormatButtons::addSubscript() +{ + if (d_buttons == TexLegend || d_buttons == Equation || d_buttons == Plot3D) + formatText("_{","}"); + else + formatText("",""); +} + +void TextFormatButtons::addSuperscript() +{ + if (d_buttons == TexLegend || d_buttons == Equation || d_buttons == Plot3D) + formatText("^{","}"); + else + formatText("",""); +} + +void TextFormatButtons::addFraction() +{ + if (d_buttons == TexLegend || d_buttons == Equation) + formatText("\\frac{","}{}"); +} + +void TextFormatButtons::addSquareRoot() +{ + if (d_buttons == TexLegend || d_buttons == Equation) + formatText("\\sqrt{","}"); +} + +void TextFormatButtons::formatText(const QString & prefix, const QString & postfix) +{ + QTextCursor cursor = connectedTextEdit->textCursor(); + QString markedText = cursor.selectedText(); + cursor.insertText(prefix+markedText+postfix); + if(markedText.isEmpty()) + { + // if no text is marked, place cursor inside the <..> statement + // instead of after it + cursor.movePosition(QTextCursor::PreviousCharacter,QTextCursor::MoveAnchor,postfix.size()); + // the next line makes the selection visible to the user + // (the line above only changes the selection in the + // underlying QTextDocument) + connectedTextEdit->setTextCursor(cursor); + } + // give focus back to text edit + connectedTextEdit->setFocus(); +} + +void TextFormatButtons::setButtons(Buttons btns) +{ + if (btns == d_buttons) + return; + + d_buttons = btns; + init(d_buttons); +} === removed file 'qtiplot/src/lib/src/TextFormatButtons.cpp' --- qtiplot/src/lib/src/TextFormatButtons.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/lib/src/TextFormatButtons.cpp 1970-01-01 00:00:00 +0000 @@ -1,639 +0,0 @@ -/*************************************************************************** - File : TextFormatButtons.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, Tilman Hoener zu Siederdissen - Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net - Description : Widget with text format buttons (connected to a QTextEdit) - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#include "TextFormatButtons.h" -#include "SymbolDialog.h" -#include "pixmaps.h" -#include -#include -#include -#include - -static const char * lineSymbol_xpm[] = { -"16 16 4 1", -" c None", -". c #8C2727", -"+ c #272787", -"@ c #FFFFFF", -" ", -" ", -" ", -" ... ", -" ............ ", -" ... ", -" ", -" ", -" ", -" +++ ", -" +++++@++++++ ", -" +++ ", -" ", -" ", -" ", -" "}; - -/* XPM */ -static const char * fraction_xpm[] = { -"18 21 5 1", -" c None", -". c #000000", -"+ c #121212", -"@ c #090909", -"# c #FC0F0F", -" .. .. ", -" + .@@... ", -" @ @. . ", -" .. ", -" .. ", -" @ @@ . ", -" @.@@.. . ", -" @. .. ", -" ", -"##################", -" ", -" .@@ .@ ", -" . .@ .@ ", -" . .@ ", -" .. .@ ", -" . .@ ", -" .@ .. ", -" .... ", -" @ @ ", -" .. .. ", -" ..@ "}; - -/* XPM */ -static const char * square_root_xpm[] = { -"22 19 8 1", -" c None", -". c #FC0F0F", -"+ c #000000", -"@ c #1A1A1A", -"# c #060606", -"$ c #010101", -"% c #070707", -"& c #090909", -" .............", -" .. .", -" . .", -" .. ", -" .. ", -" .. +@++ +++ ", -" . +# ++++ $+ ", -" . .. + ++ ++ ", -" .. .. +# ", -".... .. + ", -". .. . #+ ", -" . .. ++ %+ + ", -" .. .. ++ ++++ ++ ", -" .. .. +++ +++& ", -" . . ", -" ... ", -" ... ", -" . ", -" . "}; - -TextFormatButtons::TextFormatButtons(QTextEdit * textEdit, Buttons buttons, QWidget * parent) -: QWidget(parent), -connectedTextEdit(textEdit), -d_buttons(buttons) -{ - QHBoxLayout * layout = new QHBoxLayout(this); - layout->setMargin(0); - layout->setSpacing(0); - - init(buttons); -} - -void TextFormatButtons::init(Buttons buttons) -{ - QHBoxLayout *layout = (QHBoxLayout*)this->layout(); - QLayoutItem *child; - while ((child = layout->takeAt(0)) != 0){ - if (child->widget()) - delete child->widget(); - } - - QFont font = QFont(); - int btnSize = 32; -#ifdef Q_OS_MAC - btnSize = 38; -#endif - if (buttons == Legend || buttons == TexLegend){ - QPushButton *buttonCurve = new QPushButton( QPixmap(lineSymbol_xpm), QString()); - buttonCurve->setFixedWidth(btnSize); - buttonCurve->setFixedHeight(btnSize); - buttonCurve->setFont(font); - layout->addWidget(buttonCurve); - connect( buttonCurve, SIGNAL(clicked()), this, SLOT(addCurve()) ); - } - - QPushButton *buttonSubscript = new QPushButton(QPixmap(index_xpm), QString()); - buttonSubscript->setFixedWidth(btnSize); - buttonSubscript->setFixedHeight(btnSize); - buttonSubscript->setFont(font); - layout->addWidget(buttonSubscript); - connect( buttonSubscript, SIGNAL(clicked()), this, SLOT(addSubscript()) ); - - QPushButton *buttonSuperscript = new QPushButton(QPixmap(exp_xpm), QString()); - buttonSuperscript->setFixedWidth(btnSize); - buttonSuperscript->setFixedHeight(btnSize); - buttonSuperscript->setFont(font); - layout->addWidget(buttonSuperscript); - connect( buttonSuperscript, SIGNAL(clicked()), this, SLOT(addSuperscript())); - - if (buttons == Equation || buttons == TexLegend){ - QPushButton *buttonFraction = new QPushButton(QPixmap(fraction_xpm), QString()); - buttonFraction->setFixedWidth(btnSize); - buttonFraction->setFixedHeight(btnSize); - buttonFraction->setFont(font); - layout->addWidget(buttonFraction); - connect(buttonFraction, SIGNAL(clicked()), this, SLOT(addFraction())); - - QPushButton *buttonSquareRoot = new QPushButton(QPixmap(square_root_xpm), QString()); - buttonSquareRoot->setFixedWidth(btnSize); - buttonSquareRoot->setFixedHeight(btnSize); - buttonSquareRoot->setFont(font); - layout->addWidget(buttonSquareRoot); - connect(buttonSquareRoot, SIGNAL(clicked()), this, SLOT(addSquareRoot())); - } - - QPushButton *buttonLowerGreek = new QPushButton(QString(QChar(0x3B1))); - buttonLowerGreek->setFont(font); - buttonLowerGreek->setFixedWidth(btnSize); - buttonLowerGreek->setFixedHeight(btnSize); - layout->addWidget(buttonLowerGreek); - connect( buttonLowerGreek, SIGNAL(clicked()), this, SLOT(showLowerGreek())); - - QPushButton *buttonUpperGreek = new QPushButton(QString(QChar(0x393))); - buttonUpperGreek->setFont(font); - buttonUpperGreek->setFixedWidth(btnSize); - buttonUpperGreek->setFixedHeight(btnSize); - layout->addWidget(buttonUpperGreek); - connect( buttonUpperGreek, SIGNAL(clicked()), this, SLOT(showUpperGreek())); - - QPushButton *buttonArrowSymbols = new QPushButton(QString(QChar(0x2192))); - buttonArrowSymbols->setFont(font); - buttonArrowSymbols->setFixedWidth(btnSize); - buttonArrowSymbols->setFixedHeight(btnSize); - layout->addWidget(buttonArrowSymbols); - connect( buttonArrowSymbols, SIGNAL(clicked()), this, SLOT(showArrowSymbols())); - - QPushButton *buttonMathSymbols = new QPushButton(QString(QChar(0x222B))); - buttonMathSymbols->setFont(font); - buttonMathSymbols->setFixedWidth(btnSize); - buttonMathSymbols->setFixedHeight(btnSize); - layout->addWidget(buttonMathSymbols); - connect( buttonMathSymbols, SIGNAL(clicked()), this, SLOT(showMathSymbols())); - - if (buttons != Plot3D && buttons != Equation && buttons != TexLegend){ - font = this->font(); - font.setBold(true); - - QPushButton *buttonBold = new QPushButton(tr("B","Button bold")); - buttonBold->setFont(font); - buttonBold->setFixedWidth(btnSize); - buttonBold->setFixedHeight(btnSize); - layout->addWidget(buttonBold); - connect( buttonBold, SIGNAL(clicked()), this, SLOT(addBold())); - - font = this->font(); - font.setItalic(true); - - QPushButton *buttonItalics = new QPushButton(tr("It","Button italics")); - buttonItalics->setFont(font); - buttonItalics->setFixedWidth(btnSize); - buttonItalics->setFixedHeight(btnSize); - layout->addWidget(buttonItalics); - connect( buttonItalics, SIGNAL(clicked()), this, SLOT(addItalics())); - - font = this->font(); - font.setUnderline(true); - - QPushButton *buttonUnderline = new QPushButton(tr("U","Button underline")); - buttonUnderline->setFont(font); - buttonUnderline->setFixedWidth(btnSize); - buttonUnderline->setFixedHeight(btnSize); - layout->addWidget(buttonUnderline); - layout->addStretch(); - connect( buttonUnderline, SIGNAL(clicked()), this, SLOT(addUnderline())); - } else - layout->addStretch(); -} - -void TextFormatButtons::showLowerGreek() -{ - SymbolDialog *greekLetters = new SymbolDialog(SymbolDialog::lowerGreek, this, Qt::Tool); - greekLetters->setAttribute(Qt::WA_DeleteOnClose); - QFont f = connectedTextEdit->font(); - f.setPointSize(12); - greekLetters->setFont(f); - connect(greekLetters, SIGNAL(addLetter(const QString&)), this, SLOT(addSymbol(const QString&))); - greekLetters->show(); - greekLetters->setFocus(); -} - -void TextFormatButtons::showUpperGreek() -{ - SymbolDialog *greekLetters = new SymbolDialog(SymbolDialog::upperGreek, this, Qt::Tool); - greekLetters->setAttribute(Qt::WA_DeleteOnClose); - QFont f = connectedTextEdit->font(); - f.setPointSize(12); - greekLetters->setFont(f); - connect(greekLetters, SIGNAL(addLetter(const QString&)), this, SLOT(addSymbol(const QString&))); - greekLetters->show(); - greekLetters->setFocus(); -} - -void TextFormatButtons::showMathSymbols() -{ - SymbolDialog::CharSet charSet = SymbolDialog::mathSymbols; - if (d_buttons == Equation || d_buttons == TexLegend) - charSet = SymbolDialog::latexMathSymbols; - - SymbolDialog *mathSymbols = new SymbolDialog(charSet, this, Qt::Tool); - mathSymbols->setAttribute(Qt::WA_DeleteOnClose); - QFont f = connectedTextEdit->font(); - f.setPointSize(12); - mathSymbols->setFont(f); - connect(mathSymbols, SIGNAL(addLetter(const QString&)), this, SLOT(addSymbol(const QString&))); - mathSymbols->show(); - mathSymbols->setFocus(); -} - -void TextFormatButtons::showArrowSymbols() -{ - SymbolDialog::CharSet charSet = SymbolDialog::arrowSymbols; - if (d_buttons == Equation || d_buttons == TexLegend) - charSet = SymbolDialog::latexArrowSymbols; - - SymbolDialog *arrowSymbols = new SymbolDialog(charSet, this, Qt::Tool); - arrowSymbols->setAttribute(Qt::WA_DeleteOnClose); - arrowSymbols->setFont(connectedTextEdit->font()); - QFont f = connectedTextEdit->font(); - f.setPointSize(12); - arrowSymbols->setFont(f); - connect(arrowSymbols, SIGNAL(addLetter(const QString&)), this, SLOT(addSymbol(const QString&))); - arrowSymbols->show(); - arrowSymbols->setFocus(); -} - -void TextFormatButtons::addSymbol(const QString & letter) -{ - if (d_buttons == Equation || d_buttons == TexLegend){ - int s = 0x3B1; - if (letter == QString(QChar(s))) - connectedTextEdit->textCursor().insertText("\\alpha"); - else if (letter == QString(QChar(1 + s))) - connectedTextEdit->textCursor().insertText("\\beta"); - else if (letter == QString(QChar(2 + s))) - connectedTextEdit->textCursor().insertText("\\gamma"); - else if (letter == QString(QChar(3 + s))) - connectedTextEdit->textCursor().insertText("\\delta"); - else if (letter == QString(QChar(4 + s))) - connectedTextEdit->textCursor().insertText("\\epsilon"); - else if (letter == QString(QChar(5 + s))) - connectedTextEdit->textCursor().insertText("\\zeta"); - else if (letter == QString(QChar(6 + s))) - connectedTextEdit->textCursor().insertText("\\eta"); - else if (letter == QString(QChar(7 + s))) - connectedTextEdit->textCursor().insertText("\\theta"); - else if (letter == QString(QChar(8 + s))) - connectedTextEdit->textCursor().insertText("\\iota"); - else if (letter == QString(QChar(9 + s))) - connectedTextEdit->textCursor().insertText("\\kappa"); - else if (letter == QString(QChar(10 + s))) - connectedTextEdit->textCursor().insertText("\\lambda"); - else if (letter == QString(QChar(11 + s))) - connectedTextEdit->textCursor().insertText("\\mu"); - else if (letter == QString(QChar(12 + s))) - connectedTextEdit->textCursor().insertText("\\nu"); - else if (letter == QString(QChar(13 + s))) - connectedTextEdit->textCursor().insertText("\\xi"); - else if (letter == QString(QChar(14 + s))) - connectedTextEdit->textCursor().insertText("\\\\o"); - else if (letter == QString(QChar(15 + s))) - connectedTextEdit->textCursor().insertText("\\pi"); - else if (letter == QString(QChar(16 + s))) - connectedTextEdit->textCursor().insertText("\\rho"); - else if (letter == QString(QChar(17 + s))) - connectedTextEdit->textCursor().insertText("\\varsigma"); - else if (letter == QString(QChar(18 + s))) - connectedTextEdit->textCursor().insertText("\\sigma"); - else if (letter == QString(QChar(19 + s))) - connectedTextEdit->textCursor().insertText("\\tau"); - else if (letter == QString(QChar(20 + s))) - connectedTextEdit->textCursor().insertText("\\upsilon"); - else if (letter == QString(QChar(21 + s))) - connectedTextEdit->textCursor().insertText("\\varphi"); - else if (letter == QString(QChar(22 + s))) - connectedTextEdit->textCursor().insertText("\\chi"); - else if (letter == QString(QChar(23 + s))) - connectedTextEdit->textCursor().insertText("\\psi"); - else if (letter == QString(QChar(24 + s))) - connectedTextEdit->textCursor().insertText("\\omega"); - - s = 0x393; - if (letter == QString(QChar(s))) - connectedTextEdit->textCursor().insertText("\\Gamma"); - else if (letter == QString(QChar(1 + s))) - connectedTextEdit->textCursor().insertText("\\Delta"); - else if (letter == QString(QChar(5 + s))) - connectedTextEdit->textCursor().insertText("\\Theta"); - else if (letter == QString(QChar(8 + s))) - connectedTextEdit->textCursor().insertText("\\Lambda"); - else if (letter == QString(QChar(11 + s))) - connectedTextEdit->textCursor().insertText("\\Xi"); - else if (letter == QString(QChar(13 + s))) - connectedTextEdit->textCursor().insertText("\\Pi"); - else if (letter == QString(QChar(16 + s))) - connectedTextEdit->textCursor().insertText("\\Sigma"); - else if (letter == QString(QChar(19 + s))) - connectedTextEdit->textCursor().insertText("\\Phi"); - else if (letter == QString(QChar(21 + s))) - connectedTextEdit->textCursor().insertText("\\Psi"); - else if (letter == QString(QChar(22 + s))) - connectedTextEdit->textCursor().insertText("\\Omega"); - - s = 0x2190; - if (letter == QString(QChar(s))) - connectedTextEdit->textCursor().insertText("\\leftarrow"); - else if (letter == QString(QChar(1 + s))) - connectedTextEdit->textCursor().insertText("\\uparrow"); - else if (letter == QString(QChar(2 + s))) - connectedTextEdit->textCursor().insertText("\\rightarrow"); - else if (letter == QString(QChar(3 + s))) - connectedTextEdit->textCursor().insertText("\\downarrow"); - else if (letter == QString(QChar(4 + s))) - connectedTextEdit->textCursor().insertText("\\leftrightarrow"); - else if (letter == QString(QChar(5 + s))) - connectedTextEdit->textCursor().insertText("\\updownarrow"); - else if (letter == QString(QChar(6 + s))) - connectedTextEdit->textCursor().insertText("\\nwarrow"); - else if (letter == QString(QChar(7 + s))) - connectedTextEdit->textCursor().insertText("\\nearrow"); - else if (letter == QString(QChar(8 + s))) - connectedTextEdit->textCursor().insertText("\\searrow"); - else if (letter == QString(QChar(9 + s))) - connectedTextEdit->textCursor().insertText("\\swarrow"); - - s = 0x21D0; - if (letter == QString(QChar(s))) - connectedTextEdit->textCursor().insertText("\\Leftarrow"); - else if (letter == QString(QChar(1 + s))) - connectedTextEdit->textCursor().insertText("\\Uparrow"); - else if (letter == QString(QChar(2 + s))) - connectedTextEdit->textCursor().insertText("\\Rightarrow"); - else if (letter == QString(QChar(3 + s))) - connectedTextEdit->textCursor().insertText("\\Downarrow"); - else if (letter == QString(QChar(4 + s))) - connectedTextEdit->textCursor().insertText("\\Leftrightarrow"); - else if (letter == QString(QChar(5 + s))) - connectedTextEdit->textCursor().insertText("\\Updownarrow"); - - if (letter == QString(QChar(0x21A6))) - connectedTextEdit->textCursor().insertText("\\mapsto"); - else if (letter == QString(QChar(0x21A9))) - connectedTextEdit->textCursor().insertText("\\hookleftarrow"); - else if (letter == QString(QChar(0x21AA))) - connectedTextEdit->textCursor().insertText("\\hookrightarrow"); - else if (letter == QString(QChar(0x21BC))) - connectedTextEdit->textCursor().insertText("\\leftharpoonup"); - else if (letter == QString(QChar(0x21BD))) - connectedTextEdit->textCursor().insertText("\\leftharpoondown"); - else if (letter == QString(QChar(0x21C0))) - connectedTextEdit->textCursor().insertText("\\rightharpoonup"); - else if (letter == QString(QChar(0x21C1))) - connectedTextEdit->textCursor().insertText("\\rightharpoondown"); - else if (letter == QString(QChar(0x21CC))) - connectedTextEdit->textCursor().insertText("\\rightleftharpoons"); - - s = 0x2200; - if (letter == QString(QChar(s))) - connectedTextEdit->textCursor().insertText("\\forall"); - else if (letter == QString(QChar(2 + s))) - connectedTextEdit->textCursor().insertText("\\partial"); - else if (letter == QString(QChar(3 + s))) - connectedTextEdit->textCursor().insertText("\\exists"); - else if (letter == QString(QChar(4 + s))) - connectedTextEdit->textCursor().insertText("\\not\\exists"); - else if (letter == QString(QChar(5 + s))) - connectedTextEdit->textCursor().insertText("\\oslash"); - else if (letter == QString(QChar(6 + s))) - connectedTextEdit->textCursor().insertText("\\Delta"); - else if (letter == QString(QChar(7 + s))) - connectedTextEdit->textCursor().insertText("\\nabla"); - else if (letter == QString(QChar(8 + s))) - connectedTextEdit->textCursor().insertText("\\in"); - else if (letter == QString(QChar(9 + s))) - connectedTextEdit->textCursor().insertText("\\notin"); - else if (letter == QString(QChar(11 + s))) - connectedTextEdit->textCursor().insertText("\\ni"); - else if (letter == QString(QChar(12 + s))) - connectedTextEdit->textCursor().insertText("\\not\\ni"); - - s = 0x220F; - if (letter == QString(QChar(s))) - connectedTextEdit->textCursor().insertText("\\prod"); - else if (letter == QString(QChar(1 + s))) - connectedTextEdit->textCursor().insertText("\\coprod"); - else if (letter == QString(QChar(2 + s))) - connectedTextEdit->textCursor().insertText("\\sum"); - - if (letter == QString(QChar(0x00B1))) - connectedTextEdit->textCursor().insertText("\\pm"); - else if (letter == QString(QChar(0x2213))) - connectedTextEdit->textCursor().insertText("\\mp"); - else if (letter == QString(QChar(0x00D7))) - connectedTextEdit->textCursor().insertText("\\times"); - - s = 0x2217; - if (letter == QString(QChar(s))) - connectedTextEdit->textCursor().insertText("\\ast"); - else if (letter == QString(QChar(1 + s))) - connectedTextEdit->textCursor().insertText("\\circ"); - else if (letter == QString(QChar(2 + s))) - connectedTextEdit->textCursor().insertText("\\bullet"); - else if (letter == QString(QChar(3 + s))) - connectedTextEdit->textCursor().insertText("\\surd"); - else if (letter == QString(QChar(4 + s))) - connectedTextEdit->textCursor().insertText("\\sqrt[3]{}"); - else if (letter == QString(QChar(5 + s))) - connectedTextEdit->textCursor().insertText("\\sqrt[4]{}"); - else if (letter == QString(QChar(6 + s))) - connectedTextEdit->textCursor().insertText("\\propto"); - else if (letter == QString(QChar(7 + s))) - connectedTextEdit->textCursor().insertText("\\infty"); - - s = 0x2227; - if (letter == QString(QChar(s))) - connectedTextEdit->textCursor().insertText("\\wedge"); - else if (letter == QString(QChar(1 + s))) - connectedTextEdit->textCursor().insertText("\\vee"); - else if (letter == QString(QChar(2 + s))) - connectedTextEdit->textCursor().insertText("\\cap"); - else if (letter == QString(QChar(3 + s))) - connectedTextEdit->textCursor().insertText("\\cup"); - else if (letter == QString(QChar(4 + s))) - connectedTextEdit->textCursor().insertText("\\int"); - else if (letter == QString(QChar(5 + s))) - connectedTextEdit->textCursor().insertText("\\int \\!\\!\\! \\int"); - else if (letter == QString(QChar(6 + s))) - connectedTextEdit->textCursor().insertText("\\int \\!\\!\\! \\int \\!\\!\\! \\int"); - else if (letter == QString(QChar(7 + s))) - connectedTextEdit->textCursor().insertText("\\oint"); - - if (letter == QString(QChar(0x223F))) - connectedTextEdit->textCursor().insertText("\\sim"); - else if (letter == QString(QChar(0x2245))) - connectedTextEdit->textCursor().insertText("\\cong"); - else if (letter == QString(QChar(0x2248))) - connectedTextEdit->textCursor().insertText("\\approx"); - - s = 0x2260; - if (letter == QString(QChar(s))) - connectedTextEdit->textCursor().insertText("\\not="); - else if (letter == QString(QChar(1 + s))) - connectedTextEdit->textCursor().insertText("\\equiv"); - else if (letter == QString(QChar(2 + s))) - connectedTextEdit->textCursor().insertText("\\not\\equiv"); - - s = 0x2264; - if (letter == QString(QChar(s))) - connectedTextEdit->textCursor().insertText("\\le"); - else if (letter == QString(QChar(1 + s))) - connectedTextEdit->textCursor().insertText("\\ge"); - - s = 0x226A; - if (letter == QString(QChar(s))) - connectedTextEdit->textCursor().insertText("\\ll"); - else if (letter == QString(QChar(1 + s))) - connectedTextEdit->textCursor().insertText("\\gg"); - - s = 0x2282; - if (letter == QString(QChar(s))) - connectedTextEdit->textCursor().insertText("\\subset"); - else if (letter == QString(QChar(1 + s))) - connectedTextEdit->textCursor().insertText("\\supset"); - else if (letter == QString(QChar(2 + s))) - connectedTextEdit->textCursor().insertText("\\not\\subset"); - else if (letter == QString(QChar(3 + s))) - connectedTextEdit->textCursor().insertText("\\not\\supset"); - else if (letter == QString(QChar(4 + s))) - connectedTextEdit->textCursor().insertText("\\subseteq"); - else if (letter == QString(QChar(5 + s))) - connectedTextEdit->textCursor().insertText("\\supseteq"); - else if (letter == QString(QChar(6 + s))) - connectedTextEdit->textCursor().insertText("\\not\\subseteq"); - else if (letter == QString(QChar(7 + s))) - connectedTextEdit->textCursor().insertText("\\not\\supseteq"); - - if (letter == QString(QChar(0x210F))) - connectedTextEdit->textCursor().insertText("\\hbar"); - else if (letter == QString(QChar(0x212B))) - connectedTextEdit->textCursor().insertText("\\AA"); - } else - connectedTextEdit->textCursor().insertText(letter); -} - -void TextFormatButtons::addCurve() -{ - formatText("\\l(",")"); -} - -void TextFormatButtons::addUnderline() -{ - formatText("",""); -} - -void TextFormatButtons::addItalics() -{ - formatText("",""); -} - -void TextFormatButtons::addBold() -{ - formatText("",""); -} - -void TextFormatButtons::addSubscript() -{ - if (d_buttons == TexLegend || d_buttons == Equation || d_buttons == Plot3D) - formatText("_{","}"); - else - formatText("",""); -} - -void TextFormatButtons::addSuperscript() -{ - if (d_buttons == TexLegend || d_buttons == Equation || d_buttons == Plot3D) - formatText("^{","}"); - else - formatText("",""); -} - -void TextFormatButtons::addFraction() -{ - if (d_buttons == TexLegend || d_buttons == Equation) - formatText("\\frac{","}{}"); -} - -void TextFormatButtons::addSquareRoot() -{ - if (d_buttons == TexLegend || d_buttons == Equation) - formatText("\\sqrt{","}"); -} - -void TextFormatButtons::formatText(const QString & prefix, const QString & postfix) -{ - QTextCursor cursor = connectedTextEdit->textCursor(); - QString markedText = cursor.selectedText(); - cursor.insertText(prefix+markedText+postfix); - if(markedText.isEmpty()) - { - // if no text is marked, place cursor inside the <..> statement - // instead of after it - cursor.movePosition(QTextCursor::PreviousCharacter,QTextCursor::MoveAnchor,postfix.size()); - // the next line makes the selection visible to the user - // (the line above only changes the selection in the - // underlying QTextDocument) - connectedTextEdit->setTextCursor(cursor); - } - // give focus back to text edit - connectedTextEdit->setFocus(); -} - -void TextFormatButtons::setButtons(Buttons btns) -{ - if (btns == d_buttons) - return; - - d_buttons = btns; - init(d_buttons); -} === added file 'qtiplot/src/matrix/ColorMapDialog.cpp' --- qtiplot/src/matrix/ColorMapDialog.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/matrix/ColorMapDialog.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,89 @@ +/*************************************************************************** + File : ColorMapDialog.cpp + Project : QtiPlot +-------------------------------------------------------------------- + Copyright : (C) 2007 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : A QwtLinearColorMap Editor Dialog + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "ColorMapDialog.h" +#include "ColorMapEditor.h" +#include +#include +#include + +#include +#include + +ColorMapDialog::ColorMapDialog(QWidget* parent, Qt::WFlags fl) + : QDialog(parent, fl) +{ +setObjectName( "ColorMapDialog" ); +setWindowTitle(tr("QtiPlot") + " - " + tr("Custom Color Map")); + +ApplicationWindow *app = qobject_cast(parent); +if (app) + editor = new ColorMapEditor(app->locale()); +else + editor = new ColorMapEditor(); + +applyBtn = new QPushButton(tr("&Apply")); +connect(applyBtn, SIGNAL(clicked()), this, SLOT(apply())); + +closeBtn = new QPushButton(tr("&Close")); +connect(closeBtn, SIGNAL(clicked()), this, SLOT(reject())); + +QHBoxLayout* hb = new QHBoxLayout(); +hb->setSpacing(5); +hb->addStretch(); +hb->addWidget(applyBtn); +hb->addWidget(closeBtn); +hb->addStretch(); + +QVBoxLayout* vl = new QVBoxLayout(this); +vl->setSpacing(0); +vl->addWidget(editor); +vl->addLayout(hb); + +setMaximumWidth(editor->width() + 20); +} + +void ColorMapDialog::setMatrix(Matrix *m) +{ + if (!m) + return; + + d_matrix = m; + + double minValue = 0.0, maxValue = 0.0; + m->range(&minValue, &maxValue); + + editor->setRange(minValue, maxValue); + editor->setColorMap(m->colorMap()); +} + +void ColorMapDialog::apply() +{ + d_matrix->undoStack()->push(new MatrixSetColorMapCommand(d_matrix, d_matrix->colorMapType(), + d_matrix->colorMap(), Matrix::Custom, editor->colorMap(), tr("Set Custom Palette"))); + d_matrix->setColorMap(editor->colorMap()); +} === removed file 'qtiplot/src/matrix/ColorMapDialog.cpp' --- qtiplot/src/matrix/ColorMapDialog.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/matrix/ColorMapDialog.cpp 1970-01-01 00:00:00 +0000 @@ -1,89 +0,0 @@ -/*************************************************************************** - File : ColorMapDialog.cpp - Project : QtiPlot --------------------------------------------------------------------- - Copyright : (C) 2007 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : A QwtLinearColorMap Editor Dialog - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "ColorMapDialog.h" -#include "ColorMapEditor.h" -#include -#include -#include - -#include -#include - -ColorMapDialog::ColorMapDialog(QWidget* parent, Qt::WFlags fl) - : QDialog(parent, fl) -{ -setObjectName( "ColorMapDialog" ); -setWindowTitle(tr("QtiPlot") + " - " + tr("Custom Color Map")); - -ApplicationWindow *app = qobject_cast(parent); -if (app) - editor = new ColorMapEditor(app->locale()); -else - editor = new ColorMapEditor(); - -applyBtn = new QPushButton(tr("&Apply")); -connect(applyBtn, SIGNAL(clicked()), this, SLOT(apply())); - -closeBtn = new QPushButton(tr("&Close")); -connect(closeBtn, SIGNAL(clicked()), this, SLOT(reject())); - -QHBoxLayout* hb = new QHBoxLayout(); -hb->setSpacing(5); -hb->addStretch(); -hb->addWidget(applyBtn); -hb->addWidget(closeBtn); -hb->addStretch(); - -QVBoxLayout* vl = new QVBoxLayout(this); -vl->setSpacing(0); -vl->addWidget(editor); -vl->addLayout(hb); - -setMaximumWidth(editor->width() + 20); -} - -void ColorMapDialog::setMatrix(Matrix *m) -{ - if (!m) - return; - - d_matrix = m; - - double minValue = 0.0, maxValue = 0.0; - m->range(&minValue, &maxValue); - - editor->setRange(minValue, maxValue); - editor->setColorMap(m->colorMap()); -} - -void ColorMapDialog::apply() -{ - d_matrix->undoStack()->push(new MatrixSetColorMapCommand(d_matrix, d_matrix->colorMapType(), - d_matrix->colorMap(), Matrix::Custom, editor->colorMap(), tr("Set Custom Palette"))); - d_matrix->setColorMap(editor->colorMap()); -} === added file 'qtiplot/src/matrix/ColorMapDialog.h' --- qtiplot/src/matrix/ColorMapDialog.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/matrix/ColorMapDialog.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,54 @@ +/*************************************************************************** + File : ColorMapDialog.h + Project : QtiPlot +-------------------------------------------------------------------- + Copyright : (C) 2007 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : A QwtLinearColorMap Editor Dialog + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef COLORMAPDIALOG_H +#define COLORMAPDIALOG_H + +#include + +class QPushButton; +class ColorMapEditor; +class Matrix; + +class ColorMapDialog: public QDialog +{ + Q_OBJECT + +public: + ColorMapDialog(QWidget* parent=0, Qt::WFlags fl = 0); + void setMatrix(Matrix *m); + +protected slots: + void apply(); + +private: + QPushButton *applyBtn, *closeBtn; + ColorMapEditor *editor; + Matrix *d_matrix; +}; + +#endif === removed file 'qtiplot/src/matrix/ColorMapDialog.h' --- qtiplot/src/matrix/ColorMapDialog.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/matrix/ColorMapDialog.h 1970-01-01 00:00:00 +0000 @@ -1,54 +0,0 @@ -/*************************************************************************** - File : ColorMapDialog.h - Project : QtiPlot --------------------------------------------------------------------- - Copyright : (C) 2007 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : A QwtLinearColorMap Editor Dialog - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef COLORMAPDIALOG_H -#define COLORMAPDIALOG_H - -#include - -class QPushButton; -class ColorMapEditor; -class Matrix; - -class ColorMapDialog: public QDialog -{ - Q_OBJECT - -public: - ColorMapDialog(QWidget* parent=0, Qt::WFlags fl = 0); - void setMatrix(Matrix *m); - -protected slots: - void apply(); - -private: - QPushButton *applyBtn, *closeBtn; - ColorMapEditor *editor; - Matrix *d_matrix; -}; - -#endif === modified file 'qtiplot/src/matrix/Matrix.cpp' --- qtiplot/src/matrix/Matrix.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/matrix/Matrix.cpp 2010-07-21 23:21:08 +0000 @@ -140,6 +140,11 @@ } else imageLabel->resize(500, 500); + x_start = 0.0; + x_end = w - 1.0; + y_start = 0.0; + y_end = h - 1.0; + displayImage(image); } @@ -1100,6 +1105,16 @@ } #endif +bool Matrix::isEmpty() +{ + double min, max; + range(&min, &max); + if (gsl_isnan(min) && gsl_isnan(max)) + return true; + + return false; +} + void Matrix::range(double *min, double *max) { double d_min = cell(0, 0); @@ -1251,14 +1266,14 @@ if (d_view_type == ImageView){ delete d_table_view; delete d_select_all_shortcut; - initImageView(); + initImageView(); if (renderImage) displayImage(d_matrix_model->renderImage()); d_stack->setCurrentWidget(imageLabel); } else if (d_view_type == TableView){ delete imageLabel; - initTableView(); - d_stack->setCurrentWidget(d_table_view); + initTableView(); + d_stack->setCurrentWidget(d_table_view); } emit modifiedWindow(this); } @@ -1319,6 +1334,11 @@ if (image.isNull()) return; + x_start = 0.0; + x_end = image.width() - 1.0; + y_start = 0.0; + y_end = image.height() - 1.0; + double *buffer = d_matrix_model->dataCopy(); if (buffer){ d_undo_stack->push(new MatrixSetImageCommand(d_matrix_model, image, d_view_type, 0, @@ -1332,6 +1352,7 @@ emit modifiedWindow(this); modifiedData(this); } + setWindowLabel(fn); } === modified file 'qtiplot/src/matrix/Matrix.h' --- qtiplot/src/matrix/Matrix.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/matrix/Matrix.h 2010-07-21 23:21:08 +0000 @@ -279,6 +279,8 @@ //! Min and max values of the matrix. void range(double *min, double *max); + //! Returns true if no data values were set for this matrix + bool isEmpty(); //! Scroll to row (row starts with 1) void goToRow(int row); === modified file 'qtiplot/src/matrix/MatrixValuesDialog.cpp' --- qtiplot/src/matrix/MatrixValuesDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/matrix/MatrixValuesDialog.cpp 2010-07-21 23:21:08 +0000 @@ -29,6 +29,7 @@ #include "MatrixValuesDialog.h" #include "MatrixCommand.h" #include +#include "muParserScripting.h" #include #include @@ -70,6 +71,7 @@ gl1->addWidget(endCol, 1, 3); functions = new QComboBox(false); + functions->addItems(scriptEnv->mathFunctions()); btnAddFunction = new QPushButton(tr( "Add &Function" )); btnAddCell = new QPushButton(tr( "Add Ce&ll" )); @@ -120,13 +122,14 @@ if (scriptEnv->name() != QString("muParser")){ boxMuParser = new QCheckBox(tr("Use built-in muParser (much faster)")); boxMuParser->setChecked(true); + connect(boxMuParser, SIGNAL(toggled(bool)), this, SLOT(updateFunctionsList(bool))); + updateFunctionsList(true); vbox3->addWidget(boxMuParser); } #endif vbox3->addWidget(new QLabel(tr( "Cell(i,j)=" ))); vbox3->addLayout(hbox3); - functions->insertStringList(scriptEnv->mathFunctions(), -1); insertExplain(0); connect(btnAddCell, SIGNAL(clicked()), this, SLOT(addCell())); @@ -201,7 +204,14 @@ void MatrixValuesDialog::insertExplain(int index) { +#ifdef SCRIPTING_PYTHON + if (boxMuParser && boxMuParser->isChecked()) + explain->setText(muParserScripting::explainFunction(functions->text(index))); + else + explain->setText(scriptEnv->mathFunctionDoc(functions->text(index))); +#else explain->setText(scriptEnv->mathFunctionDoc(functions->text(index))); +#endif } void MatrixValuesDialog::insertFunction() @@ -221,3 +231,17 @@ commands->setCompleter(completer); } + +#ifdef SCRIPTING_PYTHON +void MatrixValuesDialog::updateFunctionsList(bool muParser) +{ + functions->clear(); + if (muParser) + functions->addItems(muParserScripting::functionsList()); + else + functions->addItems(scriptingEnv()->mathFunctions()); + + if (functions->count() > 0) + insertExplain(0); +} +#endif === modified file 'qtiplot/src/matrix/MatrixValuesDialog.h' --- qtiplot/src/matrix/MatrixValuesDialog.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/matrix/MatrixValuesDialog.h 2010-07-21 23:21:08 +0000 @@ -61,6 +61,9 @@ void addCell(); void insertFunction(); void insertExplain(int index); +#ifdef SCRIPTING_PYTHON + void updateFunctionsList(bool); +#endif private: Matrix *matrix; === added file 'qtiplot/src/matrix/matrix.pri' --- qtiplot/src/matrix/matrix.pri 1970-01-01 00:00:00 +0000 +++ qtiplot/src/matrix/matrix.pri 2010-07-21 23:21:08 +0000 @@ -0,0 +1,21 @@ +############################################################### +################# Module: Matrix ############################## +############################################################### + +INCLUDEPATH += src/matrix/ + +HEADERS += src/matrix/ColorMapDialog.h \ + src/matrix/Matrix.h \ + src/matrix/MatrixCommand.h \ + src/matrix/MatrixDialog.h \ + src/matrix/MatrixModel.h \ + src/matrix/MatrixSizeDialog.h \ + src/matrix/MatrixValuesDialog.h \ + +SOURCES += src/matrix/ColorMapDialog.cpp \ + src/matrix/Matrix.cpp \ + src/matrix/MatrixCommand.cpp \ + src/matrix/MatrixDialog.cpp \ + src/matrix/MatrixModel.cpp \ + src/matrix/MatrixSizeDialog.cpp \ + src/matrix/MatrixValuesDialog.cpp \ === removed file 'qtiplot/src/matrix/matrix.pri' --- qtiplot/src/matrix/matrix.pri 2009-12-08 18:06:27 +0000 +++ qtiplot/src/matrix/matrix.pri 1970-01-01 00:00:00 +0000 @@ -1,21 +0,0 @@ -############################################################### -################# Module: Matrix ############################## -############################################################### - -INCLUDEPATH += src/matrix/ - -HEADERS += src/matrix/ColorMapDialog.h \ - src/matrix/Matrix.h \ - src/matrix/MatrixCommand.h \ - src/matrix/MatrixDialog.h \ - src/matrix/MatrixModel.h \ - src/matrix/MatrixSizeDialog.h \ - src/matrix/MatrixValuesDialog.h \ - -SOURCES += src/matrix/ColorMapDialog.cpp \ - src/matrix/Matrix.cpp \ - src/matrix/MatrixCommand.cpp \ - src/matrix/MatrixDialog.cpp \ - src/matrix/MatrixModel.cpp \ - src/matrix/MatrixSizeDialog.cpp \ - src/matrix/MatrixValuesDialog.cpp \ === added directory 'qtiplot/src/origin' === removed directory 'qtiplot/src/origin' === added file 'qtiplot/src/origin/importOPJ.cpp' --- qtiplot/src/origin/importOPJ.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/origin/importOPJ.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,2137 @@ +/*************************************************************************** + File : importOPJ.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006-2010 by Ion Vasilief, Alex Kargovsky + Email (use @ for *) : ion_vasilief*yahoo.fr, kargovsky*yumr.phys.msu.su + Description : Origin project import class + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "importOPJ.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "qwt_plot_canvas.h" +#include "qwt_plot_layout.h" +#include "qwt_scale_widget.h" + +#include + +#include "boost/date_time/posix_time/posix_time.hpp" +using namespace boost::posix_time; + +#define OBJECTXOFFSET 200 + +QMap ImportOPJ::lineStyles; +QMap ImportOPJ::line3DStyles; +QMap ImportOPJ::patternStyles; +QMap ImportOPJ::classes; +QMap ImportOPJ::scaleTypes; + +QString strreverse(const QString &str) //QString reversing +{ + QString out=""; + for(int i=str.length()-1; i>=0; --i) + { + out+=str[i]; + } + return out; +} + +QString posixTimeToString(ptime pt) +{ + stringstream ss; + ss.imbue(locale(locale::classic(), new time_facet("%d.%m.%Y %H:%M:%S"))); + ss << pt; + return QString::fromStdString(ss.str()); +} + +ImportOPJ::ImportOPJ(ApplicationWindow *app, const QString& filename) : + mw(app) +{ + //////////////////////Origin params to QtiPlot mapping//////////////////// + classes[Origin::ProjectNode::SpreadSheet] = "Table"; + classes[Origin::ProjectNode::Matrix] = "Matrix"; + classes[Origin::ProjectNode::Graph] = "MultiLayer"; + classes[Origin::ProjectNode::Graph3D] = "Graph3D"; + classes[Origin::ProjectNode::Note] = "Note"; + + lineStyles[Origin::GraphCurve::Solid] = Qt::SolidLine; + lineStyles[Origin::GraphCurve::Dash] = Qt::DashLine; + lineStyles[Origin::GraphCurve::ShortDash] = Qt::DashLine; + lineStyles[Origin::GraphCurve::Dot] = Qt::DotLine; + lineStyles[Origin::GraphCurve::ShortDot] = Qt::DotLine; + lineStyles[Origin::GraphCurve::DashDot] = Qt::DashDotLine; + lineStyles[Origin::GraphCurve::ShortDashDot] = Qt::DashDotLine; + lineStyles[Origin::GraphCurve::DashDotDot] = Qt::DashDotDotLine; + + line3DStyles[Origin::GraphCurve::Solid] = Qwt3D::SOLID; + line3DStyles[Origin::GraphCurve::Dash] = Qwt3D::DASH; + line3DStyles[Origin::GraphCurve::ShortDash] = Qwt3D::SHORTDASH; + line3DStyles[Origin::GraphCurve::Dot] = Qwt3D::DOT; + line3DStyles[Origin::GraphCurve::ShortDot] = Qwt3D::SHORTDOT; + line3DStyles[Origin::GraphCurve::DashDot] = Qwt3D::DASHDOT; + line3DStyles[Origin::GraphCurve::ShortDashDot] = Qwt3D::SHORTDASHDOT; + line3DStyles[Origin::GraphCurve::DashDotDot] = Qwt3D::DASHDOTDOT; + + scaleTypes[Origin::GraphAxis::Linear] = ScaleTransformation::Linear; + scaleTypes[Origin::GraphAxis::Log10] = ScaleTransformation::Log10; + scaleTypes[Origin::GraphAxis::Probability] = ScaleTransformation::Probability; + scaleTypes[Origin::GraphAxis::Probit] = ScaleTransformation::Probability; + scaleTypes[Origin::GraphAxis::Reciprocal] = ScaleTransformation::Reciprocal; + scaleTypes[Origin::GraphAxis::OffsetReciprocal] = ScaleTransformation::Reciprocal; + scaleTypes[Origin::GraphAxis::Logit] = ScaleTransformation::Logit; + scaleTypes[Origin::GraphAxis::Ln] = ScaleTransformation::Ln; + scaleTypes[Origin::GraphAxis::Log2] = ScaleTransformation::Log2; + + patternStyles[Origin::NoFill] = 255; + patternStyles[Origin::BDiagDense] = 4; + patternStyles[Origin::BDiagMedium] = 4; + patternStyles[Origin::BDiagSparse] = 4; + patternStyles[Origin::FDiagDense] = 5; + patternStyles[Origin::FDiagMedium] = 5; + patternStyles[Origin::FDiagSparse] = 5; + patternStyles[Origin::DiagCrossDense] = 6; + patternStyles[Origin::DiagCrossMedium] = 6; + patternStyles[Origin::DiagCrossSparse] = 6; + patternStyles[Origin::HorizontalDense] = 1; + patternStyles[Origin::HorizontalMedium] = 1; + patternStyles[Origin::HorizontalSparse] = 1; + patternStyles[Origin::VerticalDense] = 2; + patternStyles[Origin::VerticalMedium] = 2; + patternStyles[Origin::VerticalSparse] = 2; + patternStyles[Origin::CrossDense] = 3; + patternStyles[Origin::CrossMedium] = 3; + patternStyles[Origin::CrossSparse] = 3; + + ////////////////////////////////////////////////////////////////////////// + xoffset=0; + try + { + OriginFile opj((const char *)filename.toLocal8Bit()); + parse_error = opj.parse(); + importTables(opj); + importGraphs(opj); + importNotes(opj); + if(filename.endsWith(".opj", Qt::CaseInsensitive)) + createProjectTree(opj); + mw->showResults(opj.resultsLogString().c_str(), mw->logWindow->isVisible()); + } + catch(const std::logic_error& er) + { + QApplication::restoreOverrideCursor(); + QMessageBox::critical(mw, "Origin Project Import Error", QString(er.what())); + } +} + +inline uint qHash(const tree::iterator &key) +{ + return qHash(key->name.c_str()); +} + +QColor originToQtColor(const Origin::Color& color) +{ + if (color.type == Origin::Color::None) + return QColor(); + + return (color.type == Origin::Color::Regular ? ColorBox::defaultColor(color.regular) : QColor(color.custom[0], color.custom[1], color.custom[2])); +} + +bool ImportOPJ::createProjectTree(const OriginFile& opj) +{ + const tree* projectTree = opj.project(); + tree::iterator root = projectTree->begin(projectTree->begin()); + if(!root.node) + return false; + FolderListItem* item = (FolderListItem*)mw->folders->firstChild(); + item->setText(0, root->name.c_str()); + item->folder()->setName(root->name.c_str()); + Folder* projectFolder = mw->projectFolder(); + QHash::iterator, Folder*> parent; + parent[root] = projectFolder; + for(tree::iterator sib = projectTree->begin(root); sib != projectTree->end(root); ++sib) + { + if(sib->type == Origin::ProjectNode::Folder){ + parent[sib] = mw->addFolder(sib->name.c_str(), parent.value(projectTree->parent(sib))); + parent[sib]->setBirthDate(posixTimeToString(sib->creationDate)); + parent[sib]->setModificationDate(posixTimeToString(sib->modificationDate)); + } else { + QString name = sib->name.c_str(); + if(sib->type == Origin::ProjectNode::Note){ + QRegExp rx("^@\\((\\S+)\\)$"); + if(rx.indexIn(name) == 0) + name = rx.cap(1); + } + + MdiSubWindow* w = projectFolder->window(name, classes[sib->type]); + if(w){ + Folder *f = parent.value(projectTree->parent(sib)); + if (f){ + f->addWindow(w); + projectFolder->removeWindow(w); + f->setActiveWindow(w); + } + } + } + } + mw->changeFolder(projectFolder, true); + return true; +} + +bool ImportOPJ::importTables(const OriginFile& opj) +{ + int visible_count = 0; + int QtiPlot_scaling_factor = 10; //in Origin width is measured in characters while in QtiPlot - pixels --- need to be accurate + for(unsigned int s = 0; s < opj.spreadCount(); ++s) + { + Origin::SpreadSheet spread = opj.spread(s); + int columnCount = spread.columns.size(); + int maxrows = spread.maxRows; + if(!columnCount) //remove tables without cols + continue; + + Table *table = (spread.hidden || spread.loose) && opj.version() >= 6.0 ? mw->newHiddenTable(spread.name.c_str(), spread.label.c_str(), maxrows, columnCount) + : mw->newTable(spread.name.c_str(), maxrows, columnCount); + if (!table) + return false; + + Origin::Rect windowRect; + if(opj.version() >= 6.0) + { + windowRect = spread.frameRect; + table->resize(windowRect.width() - (table->frameGeometry().width() - table->width()), + windowRect.height() - (table->frameGeometry().height() - table->height())); + } + + table->setCaptionPolicy((MdiSubWindow::CaptionPolicy)spread.title); + table->setBirthDate(posixTimeToString(spread.creationDate)); + + QLocale locale = mw->locale(); + table->setWindowLabel(spread.label.c_str()); + for(int j = 0; j < columnCount; ++j) + { + Origin::SpreadColumn column = spread.columns[j]; + QString name(column.name.c_str()); + table->setColName(j, name.replace(QRegExp(".*_"), ""), false, false); + table->setCommand(j, QString(column.command.c_str())); + table->setColComment(j, QString(column.comment.c_str())); + table->setColumnWidth(j, column.width * QtiPlot_scaling_factor); + + switch(column.type) + { + case Origin::SpreadColumn::X: + table->setColPlotDesignation(j, Table::X); + break; + case Origin::SpreadColumn::Y: + table->setColPlotDesignation(j, Table::Y); + break; + case Origin::SpreadColumn::Z: + table->setColPlotDesignation(j, Table::Z); + break; + case Origin::SpreadColumn::XErr: + table->setColPlotDesignation(j, Table::xErr); + break; + case Origin::SpreadColumn::YErr: + table->setColPlotDesignation(j, Table::yErr); + break; + case Origin::SpreadColumn::Label: + table->setColPlotDesignation(j, Table::Label); + break; + default: + table->setColPlotDesignation(j, Table::None); + } + + table->setHeaderColType();//update header + + double **d_cells = new double* [columnCount]; + for(int i = 0; i < columnCount; ++i) + d_cells[i] = new double [table->numRows()]; + + bool set_text_column = false; + for(unsigned int i = 0; i < column.data.size(); ++i){ + Origin::variant value = column.data[i]; + if(column.valueType != Origin::Text){// number + if(value.type() == typeid(string)){//Origin::TextNumeric column should be set to Text + //set_text_column = true; + table->setText(i, j, QString(boost::get(value).c_str())); + } + + if(value.type() != typeid(double)) + continue; + + double val = boost::get(value); + if(fabs(val)>0 && fabs(val)<2.0e-300)// empty entry + continue; + + table->setText(i, j, locale.toString(val, 'g', 16)); + d_cells[j][i] = val; + } else {// label? doesn't seem to work + table->setText(i, j, QString(value.type() == typeid(string) ? boost::get(value).c_str() : "")); + } + } + + table->saveToMemory(d_cells); + + QString format; + switch(column.valueType) + { + case Origin::Numeric: + case Origin::TextNumeric: + if (set_text_column){ + table->setTextFormat(j); + break; + } + + int f; + if(column.numericDisplayType == 0) + f = 0; + else + switch(column.valueTypeSpecification) + { + case 0: //Decimal 1000 + f=1; + break; + case 1: //Scientific + f=2; + break; + case 2: //Engeneering + case 3: //Decimal 1,000 + f=0; + break; + } + table->setColNumericFormat(f, column.decimalPlaces, j); + break; + case Origin::Text: + table->setTextFormat(j); + break; + case Origin::Date: + switch(column.valueTypeSpecification) + { + case -128: + format="dd/MM/yyyy"; + break; + case -119: + format="dd/MM/yyyy HH:mm"; + break; + case -118: + format="dd/MM/yyyy HH:mm:ss"; + break; + case 0: + case 9: + case 10: + format="dd.MM.yyyy"; + break; + case 2: + format="MMM d"; + break; + case 3: + format="M/d"; + break; + case 4: + format="d"; + break; + case 5: + case 6: + format="ddd"; + break; + case 7: + format="yyyy"; + break; + case 8: + format="yy"; + break; + case 11: + case 12: + case 13: + case 14: + case 15: + format="yyMMdd"; + break; + case 16: + case 17: + format="MMM"; + break; + case 19: + format="M-d-yyyy"; + break; + default: + format="dd.MM.yyyy"; + } + table->setDateFormat(format, j); + break; + case Origin::Time: + switch(column.valueTypeSpecification + 128) + { + case 0: + format="hh:mm"; + break; + case 1: + format="hh"; + break; + case 2: + format="hh:mm:ss"; + break; + case 3: + format="hh:mm:ss.zzz"; + break; + case 4: + format="hh ap"; + break; + case 5: + format="hh:mm ap"; + break; + case 6: + format="mm:ss"; + break; + case 7: + format="mm:ss.zzz"; + break; + case 8: + format="hhmm"; + break; + case 9: + format="hhmmss"; + break; + case 10: + format="hh:mm:ss.zzz"; + break; + } + table->setTimeFormat(format, j); + break; + case Origin::Month: + switch(column.valueTypeSpecification) + { + case 0: + format = "MMM"; + break; + case 1: + format = "MMMM"; + break; + case 2: + format = "M"; + break; + } + table->setMonthFormat(format, j); + break; + case Origin::Day: + switch(column.valueTypeSpecification) + { + case 0: + format = "ddd"; + break; + case 1: + format = "dddd"; + break; + case 2: + format = "d"; + break; + } + table->setDayFormat(format, j); + break; + } + table->freeMemory(); + } + + + if(!(spread.hidden || spread.loose) || opj.version() != 7.5){ + switch(spread.state){ + case Origin::Window::Minimized: + mw->minimizeWindow(table); + break; + case Origin::Window::Maximized: + mw->maximizeWindow(table); + break; + default: + table->showNormal(); + } + + //cascade the tables + if (opj.version() >= 6.0) + table->move(QPoint(windowRect.left, windowRect.top)); + else { + int dx = table->verticalHeaderWidth(); + int dy = table->frameGeometry().height() - table->height(); + table->move(QPoint(visible_count*dx + xoffset*OBJECTXOFFSET, visible_count*dy)); + ++visible_count; + } + } + } + +//Import matrices + for(unsigned int s = 0; s < opj.matrixCount(); ++s){ + Origin::Matrix matrix = opj.matrix(s); + int columnCount = matrix.columnCount; + int rowCount = matrix.rowCount; + + Matrix* Matrix = mw->newMatrix(matrix.name.c_str(), rowCount, columnCount); + if (!Matrix) + return false; + + Origin::Rect windowRect; + if(opj.version() >= 6.0){ + windowRect = matrix.frameRect; + Matrix->resize(windowRect.width() - (Matrix->frameGeometry().width() - Matrix->width()), + windowRect.height() - (Matrix->frameGeometry().height() - Matrix->height())); + } + + Matrix->setCoordinates(matrix.coordinates[3], matrix.coordinates[1], matrix.coordinates[2], matrix.coordinates[0]); + Matrix->setCaptionPolicy((MdiSubWindow::CaptionPolicy)matrix.title); + Matrix->setBirthDate(posixTimeToString(matrix.creationDate)); + + Matrix->setWindowLabel(matrix.label.c_str()); + Matrix->setFormula(matrix.command.c_str()); + Matrix->setColumnsWidth(matrix.width * QtiPlot_scaling_factor); + if(matrix.view == Origin::Matrix::ImageView){ + Matrix->setViewType(Matrix::ImageView); + if(opj.version() > 7.5) + Matrix->setGrayScale(); + else { + Origin::ColorMap colorMap = matrix.colorMap; + colorMap.levels.pop_back(); + Matrix->setColorMap(qwtColorMap(colorMap)); + } + } + + if(matrix.header == Origin::Matrix::XY) + Matrix->setHeaderViewType(Matrix::XY); + + vector* data = &matrix.data; + double* matrix_data = Matrix->matrixModel()->dataVector(); + int size = Matrix->numRows()*Matrix->numCols(); + for(int i=0; i < size; ++i) + { + matrix_data[i] = fabs(data->at(i)) < 2.0e-300 && fabs(data->at(i)) > 0 ? GSL_NAN : data->at(i); + } + + QChar format; + int prec = 6; + switch(matrix.valueTypeSpecification) + { + case 0: //Decimal 1000 + format='f'; + prec = matrix.decimalPlaces; + break; + case 1: //Scientific + format='e'; + prec = matrix.decimalPlaces; + break; + case 2: //Engineering + case 3: //Decimal 1,000 + format='g'; + prec = matrix.significantDigits; + break; + } + Matrix->setNumericFormat(format, prec); + + if(!matrix.hidden || opj.version() != 7.5) + { + switch(matrix.state) + { + case Origin::Window::Minimized: + mw->minimizeWindow(Matrix); + break; + case Origin::Window::Maximized: + mw->maximizeWindow(Matrix); + break; + default: + Matrix->showNormal(); + } + + //cascade the matrices + if(opj.version() >= 6.0) + Matrix->move(QPoint(windowRect.left, windowRect.top)); + else { + int dx = Matrix->verticalHeaderWidth(); + int dy = Matrix->frameGeometry().height() - Matrix->height(); + Matrix->move(QPoint(visible_count*dx + xoffset*OBJECTXOFFSET, visible_count*dy)); + ++visible_count; + } + } + } + + if(visible_count > 0) + ++xoffset; + + return true; +} + +bool ImportOPJ::importNotes(const OriginFile& opj) +{ + for(unsigned int n = 0; n < opj.noteCount(); ++n){ + Origin::Note _note = opj.note(n); + QString name = _note.name.c_str(); + QRegExp rx("^@\\((\\S+)\\)$"); + if(rx.indexIn(name) == 0) + name = rx.cap(1); + + Note* note = mw->newNote(name); + if(!note) + return false; + + note->setName(name); + + note->setWindowLabel(_note.label.c_str()); + note->setText(QString(_note.text.c_str())); + note->setCaptionPolicy((MdiSubWindow::CaptionPolicy)_note.title); + note->setBirthDate(posixTimeToString(_note.creationDate)); + + Origin::Rect windowRect; + windowRect = _note.frameRect; + note->resize(windowRect.width() - (note->frameGeometry().width() - note->width()), + windowRect.height() - (note->frameGeometry().height() - note->height())); + + note->move(QPoint(windowRect.left, windowRect.top)); + + switch(_note.state){ + case Origin::Window::Minimized: + mw->minimizeWindow(note); + break; + case Origin::Window::Maximized: + mw->maximizeWindow(note); + break; + default: + note->showNormal(); + } + + if(_note.hidden) + mw->hideWindow(note); + } + + return true; +} + +bool ImportOPJ::importGraphs(const OriginFile& opj) +{ + double pi = M_PI; + int tickTypeMap[]={0,3,1,2}; + + Origin::Rect maximazedFrame, standardFrame; + if (opj.graphCount()){ + MultiLayer* fake = mw->multilayerPlot("fake", 0); + fake->setParent(0); + frameWidth = fake->frameGeometry().width() - fake->geometry().width(); + frameHeight = fake->frameGeometry().height() - fake->geometry().height(); + standardFrame = Origin::Rect(fake->geometry().width(), fake->geometry().height()); + fake->setMaximized(); + maximazedFrame = Origin::Rect(fake->geometry().width(), fake->geometry().height()); + fake->askOnCloseEvent(false); + fake->close(); + } + + for(unsigned int g = 0; g < opj.graphCount(); ++g){ + Origin::Graph _graph = opj.graph(g); + MultiLayer *ml = mw->multilayerPlot(_graph.name.c_str(), 0); + if (!ml) + return false; + + ml->setCaptionPolicy((MdiSubWindow::CaptionPolicy)_graph.title); + ml->setBirthDate(posixTimeToString(_graph.creationDate)); + ml->setWindowLabel(_graph.label.c_str()); + + Origin::Rect graphRect(_graph.width, _graph.height); + Origin::Rect graphWindowRect = _graph.frameRect.isValid() ? _graph.frameRect : (_graph.state == Origin::Window::Maximized ? maximazedFrame : standardFrame); + double ratio = (double)(graphWindowRect.width() - frameWidth)/(double)(graphWindowRect.height() - frameHeight); + + int width = _graph.width; + int height = _graph.height; + if((double)(_graph.width)/(double)(_graph.height) < ratio) + width = height * ratio; + else + height = width / ratio; + + //ml->resize(width, height); + + int yOffset = LayerButton::btnSize(); + + ml->resize(graphWindowRect.width(), graphWindowRect.height()); + + double fScale = (double)(graphWindowRect.width() - frameWidth)/(double)width; + double fWindowFactor = QMIN((double)graphWindowRect.width()/500.0, (double)graphWindowRect.height()/350.0); + double fFontScaleFactor = 0.4; + double fVectorArrowScaleFactor = 0.08*fWindowFactor; + + bool imageProfileTool = false; + bool boxWhiskersPlot = false; + for(unsigned int l = 0; l < _graph.layers.size(); ++l){ + Origin::GraphLayer& layer = _graph.layers[l]; + if(layer.is3D() || layer.isXYY3D){ + importGraph3D(opj, g, l); + continue; + } + + Graph *graph = ml->addLayer(); + if(!graph) + return false; + + graph->setAxisTitlePolicy(mw->d_graph_axis_labeling); + graph->setAutoscaleFonts(false); + + Origin::Rect layerRect = layer.clientRect; + + QColor bkg = originToQtColor(layer.backgroundColor); + if(layer.backgroundColor.type == Origin::Color::None) + bkg.setAlpha(0); + graph->setCanvasBackground(bkg); + + int auto_color = -1; + int style = 0; + bool matrixImage = false; + for(unsigned int c = 0; c < layer.curves.size(); ++c){ + Origin::GraphCurve& _curve = layer.curves[c]; + try { + QString data(_curve.dataName.c_str()); + int color = 0; + switch(_curve.type){ + case Origin::GraphCurve::Line: + style = Graph::Line; + break; + case Origin::GraphCurve::Scatter: + style = Graph::Scatter; + break; + case Origin::GraphCurve::LineSymbol: + style = Graph::LineSymbols; + break; + case Origin::GraphCurve::ErrorBar: + case Origin::GraphCurve::XErrorBar: + style = Graph::ErrorBars; + break; + case Origin::GraphCurve::Column: + style = Graph::VerticalBars; + break; + case Origin::GraphCurve::Bar: + style = Graph::HorizontalBars; + break; + case Origin::GraphCurve::Histogram: + style = Graph::Histogram; + break; + case Origin::GraphCurve::Pie: + style = Graph::Pie; + break; + case Origin::GraphCurve::Box: + style = Graph::Box; + break; + case Origin::GraphCurve::FlowVector: + style = Graph::VectXYXY; + break; + case Origin::GraphCurve::Vector: + style = Graph::VectXYAM; + break; + case Origin::GraphCurve::Area: + case Origin::GraphCurve::AreaStack: + style = Graph::Area; + break; + case Origin::GraphCurve::TextPlot: + style = Origin::GraphCurve::TextPlot; + break; + case Origin::GraphCurve::Contour: + style = Origin::GraphCurve::Contour; + break; + case Origin::GraphCurve::MatrixImage: + style = Origin::GraphCurve::MatrixImage; + break; + default: + continue; + } + + QString tableName; + QStringList formulas; + double start, end; + int s; + PlotCurve* curve = NULL; + Origin::Function function; + + switch(data[0].toAscii()){ + case 'T': + tableName = data.right(data.length()-2); + if(style==Graph::ErrorBars){ + int flags=_curve.symbolType; + curve = (PlotCurve*)graph->addErrorBars(QString("%1_%2").arg(tableName, _curve.xColumnName.c_str()), mw->table(tableName), QString("%1_%2").arg(tableName, _curve.yColumnName.c_str()), + ((flags&0x10)==0x10?0:1), ceil(_curve.lineWidth), ceil(_curve.symbolSize), QColor(Qt::black), + (flags&0x40)==0x40, (flags&2)==2, (flags&1)==1); + } else if(style==Graph::Histogram) + curve = (PlotCurve*)graph->insertCurve(mw->table(tableName), QString("%1_%2").arg(tableName, _curve.yColumnName.c_str()), style); + else if(style==Graph::Pie || style==Graph::Box){ + QStringList names; + names << QString("%1_%2").arg(tableName, _curve.yColumnName.c_str()); + graph->addCurves(mw->table(tableName), names, style); + + if(style == Graph::Box){ + curve = graph->curve(c); + ((BoxCurve *)curve)->setBoxWidth(_curve.boxWidth); + boxWhiskersPlot = true; + } + } else if(style==Graph::VectXYXY){ + QStringList names; + Origin::VectorProperties vector = _curve.vector; + names << QString("%1_%2").arg(tableName, _curve.xColumnName.c_str()) + << QString("%1_%2").arg(tableName, _curve.yColumnName.c_str()) + << (tableName + "_" + QString(vector.endXColumnName.c_str())) + << (tableName + "_" + QString(vector.endYColumnName.c_str())); + + graph->addCurves(mw->table(tableName), names, style); + } else if(style==Graph::VectXYAM){ + QStringList names; + Origin::VectorProperties vector = _curve.vector; + names << QString("%1_%2").arg(tableName, _curve.xColumnName.c_str()) + << QString("%1_%2").arg(tableName, _curve.yColumnName.c_str()) + << (tableName + "_" + QString(vector.angleColumnName.c_str())) + << (tableName + "_" + QString(vector.magnitudeColumnName.c_str())); + + graph->addCurves(mw->table(tableName), names, style); + } else if(style == Origin::GraphCurve::TextPlot){ + Table* table = mw->table(tableName); + QString labelsCol(_curve.yColumnName.c_str()); + int xcol = table->colX(table->colIndex(labelsCol)); + int ycol = table->colY(table->colIndex(labelsCol)); + if (xcol < 0 || ycol < 0) + return false; + + DataCurve* mc = graph->masterCurve(table->colName(xcol), table->colName(ycol)); + if(mc){ + graph->replot(); + mc->setLabelsColumnName(labelsCol); + mc->setLabelsRotation(_curve.text.rotation); + mc->setLabelsWhiteOut(_curve.text.whiteOut); + mc->setLabelsOffset(_curve.text.xOffset, _curve.text.yOffset); + mc->setLabelsColor(originToQtColor(_curve.text.color)); + int align = -1; + switch(_curve.text.justify){ + case Origin::TextProperties::Center: + align = Qt::AlignHCenter; + break; + + case Origin::TextProperties::Left: + align = Qt::AlignLeft; + break; + + case Origin::TextProperties::Right: + align = Qt::AlignRight; + break; + } + mc->setLabelsAlignment(align); + QFont fnt = mc->labelsFont(); + fnt.setBold(_curve.text.fontBold); + fnt.setItalic(_curve.text.fontItalic); + fnt.setUnderline(_curve.text.fontUnderline); + fnt.setPointSizeF(_curve.text.fontSize*fFontScaleFactor); + mc->setLabelsFont(fnt); + } + } + else + curve = (PlotCurve *)graph->insertCurve(mw->table(tableName), QString("%1_%2").arg(tableName, _curve.xColumnName.c_str()), QString("%1_%2").arg(tableName, _curve.yColumnName.c_str()), style); + break; + case 'M':{ + QString matrixName = data.right(data.length()-2); + Matrix* m = mw->matrix(matrixName); + if (!m) + break; + + if(_curve.type == Origin::GraphCurve::Contour){ + curve = (PlotCurve*)graph->plotSpectrogram(m, Graph::ColorMap); + Spectrogram* sp = (Spectrogram*) curve; + sp->setCustomColorMap(qwtColorMap(_curve.colorMap)); + QwtValueList levels; + QList penList; + bool labelsOn = false; + for(Origin::ColorMapVector::const_iterator it = _curve.colorMap.levels.begin() + 1; it != _curve.colorMap.levels.end(); ++it){ + if(it->second.lineVisible){ + Origin::ColorMapVector::const_iterator next = it; + ++next; + if (next != _curve.colorMap.levels.end()){ + levels.push_back(it->first); + penList << QPen(originToQtColor(next->second.lineColor), next->second.lineWidth, lineStyles[(Origin::GraphCurve::LineStyle)next->second.lineStyle]); + if(next->second.labelVisible) + labelsOn = true; + } + + sp->setDisplayMode(QwtPlotSpectrogram::ContourMode, true); + } + } + + Origin::ColorMapVector::const_iterator it = _curve.colorMap.levels.begin() + 1; + penList << QPen(originToQtColor(it->second.lineColor), it->second.lineWidth, lineStyles[(Origin::GraphCurve::LineStyle)it->second.lineStyle]); + + sp->setDisplayMode(QwtPlotSpectrogram::ImageMode, _curve.colorMap.fillEnabled); + sp->setContourLevels(levels); + sp->setContourPenList(penList); + sp->showContourLineLabels(labelsOn); + if (labelsOn){ + sp->setLabelsWhiteOut(_curve.text.whiteOut); + sp->setLabelsColor(originToQtColor(_curve.text.color)); + QFont fnt = sp->labelsFont(); + fnt.setBold(_curve.text.fontBold); + fnt.setItalic(_curve.text.fontItalic); + fnt.setUnderline(_curve.text.fontUnderline); + fnt.setPointSizeF(_curve.text.fontSize*fFontScaleFactor); + sp->setLabelsFont(fnt); + } + } else if(style == Origin::GraphCurve::MatrixImage){ + Spectrogram* sp = graph->plotSpectrogram(m, Graph::GrayScale); + if (!sp) + break; + sp->setGrayScale(); + matrixImage = true; + } else if (style == Graph::Histogram) + curve = (PlotCurve*)graph->addHistogram(m); + + break; + } + + case 'F': + s = opj.functionIndex(data.right(data.length()-2).toStdString()); + function = opj.function(s); + + int type; + if(function.type == Origin::Function::Polar){ + type = 2; + formulas << function.formula.c_str() << "x"; + start = pi/180 * function.begin; + end = pi/180 * function.end; + } else { + type = 0; + formulas << function.formula.c_str(); + start = function.begin; + end = function.end; + } + curve = (PlotCurve*)graph->addFunction(formulas, start, end, function.totalPoints, "x", type, function.name.c_str()); + + mw->updateFunctionLists(type, formulas); + break; + default: + continue; + } + + CurveLayout cl = graph->initCurveLayout(style, layer.curves.size()); + + color=_curve.lineColor.regular; + cl.lCol = ColorBox::defaultColor(_curve.lineColor.type==Origin::Color::Automatic?0:color); //0xF7 -Automatic color + + cl.sSize = ceil(_curve.symbolSize*0.5); + cl.penWidth=_curve.symbolThickness; + color=_curve.symbolColor.regular; + + cl.symCol = ColorBox::defaultColor(_curve.symbolColor.regular); + if((style==Graph::Scatter || style==Graph::LineSymbols || style==Graph::Area || style==Graph::Box)&&_curve.symbolColor.type == Origin::Color::Automatic)//0xF7 -Automatic color + cl.symCol = cl.lCol; + + switch(_curve.symbolType&0xFF){ + case 0: //NoSymbol + cl.sType=0; + break; + case 1: //Rect + cl.sType=2; + break; + case 2: //Ellipse + case 20://Sphere + cl.sType=1; + break; + case 3: //UTriangle + cl.sType=6; + break; + case 4: //DTriangle + cl.sType=5; + break; + case 5: //Diamond + cl.sType=3; + break; + case 6: //Cross + + cl.sType=9; + break; + case 7: //Cross x + cl.sType=10; + break; + case 8: //Snow + cl.sType=13; + break; + case 9: //Horizontal - + cl.sType=11; + break; + case 10: //Vertical | + cl.sType=12; + break; + case 15: //LTriangle + cl.sType=7; + break; + case 16: //RTriangle + cl.sType=8; + break; + case 17: //Hexagon + case 19: //Pentagon + cl.sType=15; + break; + case 18: //Star + cl.sType=14; + break; + default: + cl.sType=0; + } + + switch(_curve.symbolType>>8){ + case 0: + cl.fillCol = ColorBox::defaultColor(_curve.symbolFillColor.regular); + if((style==Graph::Scatter || style==Graph::LineSymbols || style==Graph::Area || style==Graph::Box)&& + (_curve.symbolFillColor.type == Origin::Color::Automatic || _curve.symbolFillColor.type == Origin::Color::None)) + cl.fillCol = cl.symCol; + break; + case 1: + case 2: + case 8: + case 9: + case 10: + case 11: + color =_curve.symbolFillColor.regular; + if((style==Graph::Scatter || style==Graph::LineSymbols || style==Graph::Area || style==Graph::Box)&&_curve.symbolFillColor.type==Origin::Color::Automatic)//0xF7 -Automatic color + color=17;// depend on Origin settings - not stored in file + cl.fillCol = ColorBox::defaultColor(color); + if (_curve.symbolFillColor.type==Origin::Color::None) + cl.fillCol = QColor(); + break; + default: + cl.fillCol = QColor(); + } + + cl.lWidth = _curve.lineWidth; + int linestyle=_curve.lineStyle; + cl.filledArea=(_curve.fillArea || style==Graph::VerticalBars || style==Graph::HorizontalBars || style==Graph::Histogram || style == Graph::Pie || style == Graph::Box) ? 1 : 0; + if(cl.filledArea){ + Origin::Color color; + cl.aStyle = _curve.fillAreaPattern == Origin::NoFill ? 0 : patternStyles[(Origin::FillPattern)_curve.fillAreaPattern]; + color = (cl.aStyle == 0 ? _curve.fillAreaColor : _curve.fillAreaPatternColor); + cl.aCol = (color.type == Origin::Color::Automatic ? 0 : color.regular); //0xF7 -Automatic color + if(style == Graph::VerticalBars || style == Graph::HorizontalBars || style == Graph::Histogram || style == Graph::Pie || style == Graph::Box){ + color = _curve.fillAreaPatternBorderColor; + cl.lCol = ColorBox::defaultColor(color.type == Origin::Color::Automatic ? 0 : color.regular); //0xF7 -Automatic color + color = (cl.aStyle == 0 ? _curve.fillAreaColor : _curve.fillAreaPatternColor); + if (!originToQtColor(_curve.fillAreaColor).isValid() && !cl.aStyle) + cl.filledArea = 0; + + cl.aCol = (color.type == Origin::Color::Automatic ? cl.lCol : ColorBox::defaultColor(color.regular)); //0xF7 -Automatic color + cl.lWidth = _curve.fillAreaPatternBorderWidth; + linestyle = _curve.fillAreaPatternBorderStyle; + } + } + cl.lStyle = lineStyles[(Origin::GraphCurve::LineStyle)linestyle] - 1; + + if(style != Origin::GraphCurve::Contour) + graph->updateCurveLayout(curve, &cl); + + if(style == Graph::VerticalBars || style == Graph::HorizontalBars){ + QwtBarCurve *b = (QwtBarCurve*)graph->curve(c); + if (b) + b->setGap(qRound(100-_curve.symbolSize*10)); + } else if(style == Graph::Histogram){ + QwtHistogram *h = (QwtHistogram*)graph->curve(c); + if(h){ + h->setBinning(false, layer.histogramBin, layer.histogramBegin, layer.histogramEnd); + h->loadData(); + } + } else if(style == Graph::Pie){ + QwtPieCurve *p = (QwtPieCurve *)graph->curve(c); + cl.lStyle = lineStyles[(Origin::GraphCurve::LineStyle)linestyle]; + p->setPen(QPen(cl.lCol, cl.lWidth, (Qt::PenStyle)cl.lStyle)); + p->setBrushStyle(PatternBox::brushStyle(cl.aStyle)); + if(_curve.fillAreaColor.type == Origin::Color::Increment) + p->setFirstColor(_curve.fillAreaColor.starting); + //geometry + p->setRadius(_curve.pie.radius); + p->setThickness(_curve.pie.thickness); + p->setViewAngle(_curve.pie.viewAngle); + p->setStartAzimuth(_curve.pie.rotation); + p->setCounterClockwise(_curve.pie.clockwiseRotation); + p->setHorizontalOffset(_curve.pie.horizontalOffset); + //labels + p->setLabelsEdgeDistance(_curve.pie.distance); + p->setLabelsAutoFormat(_curve.pie.formatAutomatic); + p->setLabelPercentagesFormat(_curve.pie.formatPercentages); + p->setLabelValuesFormat(_curve.pie.formatValues); + p->setLabelCategories(_curve.pie.formatCategories); + p->setFixedLabelsPosition(_curve.pie.positionAssociate); + + graph->setFrame(0); + } else if(style == Graph::VectXYXY || style == Graph::VectXYAM){ + graph->updateVectorsLayout(c, cl.symCol, _curve.vector.width, + floor(_curve.vector.arrowLenght*fVectorArrowScaleFactor + 0.5), _curve.vector.arrowAngle, _curve.vector.arrowClosed, _curve.vector.position); + } + + switch(_curve.lineConnect){ + case Origin::GraphCurve::NoLine: + graph->setCurveStyle(c, QwtPlotCurve::NoCurve); + break; + case Origin::GraphCurve::Straight: + graph->setCurveStyle(c, QwtPlotCurve::Lines); + break; + case Origin::GraphCurve::BSpline: + case Origin::GraphCurve::Bezier: + case Origin::GraphCurve::Spline: + graph->setCurveStyle(c, 5); + break; + case Origin::GraphCurve::StepHorizontal: + case Origin::GraphCurve::StepHCenter: + graph->setCurveStyle(c, QwtPlotCurve::Steps); + break; + case Origin::GraphCurve::StepVertical: + case Origin::GraphCurve::StepVCenter: + graph->setCurveStyle(c, 6); + break; + } + + } + catch(...) + {} + } + if (style == Graph::HorizontalBars){ + graph->setScale(0,layer.xAxis.min,layer.xAxis.max,layer.xAxis.step,layer.xAxis.majorTicks,layer.xAxis.minorTicks,layer.xAxis.scale); + graph->setScale(2,layer.yAxis.min,layer.yAxis.max,layer.yAxis.step,layer.yAxis.majorTicks,layer.yAxis.minorTicks,layer.yAxis.scale); + } else { + Origin::GraphAxisBreak breakX = layer.xAxisBreak; + Origin::GraphAxisBreak breakY = layer.yAxisBreak; + bool invert = (layer.xAxis.min > layer.xAxis.max); + if(style != Graph::Box){ + if(breakX.show) + graph->setScale(2,layer.xAxis.min,layer.xAxis.max,layer.xAxis.step,layer.xAxis.majorTicks,layer.xAxis.minorTicks,scaleTypes[(Origin::GraphAxis::Scale)layer.xAxis.scale], + invert, + breakX.from, breakX.to, + breakX.position, + breakX.scaleIncrementBefore, breakX.scaleIncrementAfter, + breakX.minorTicksBefore, breakX.minorTicksAfter, breakX.log10); + else + graph->setScale(2,layer.xAxis.min,layer.xAxis.max,layer.xAxis.step,layer.xAxis.majorTicks,layer.xAxis.minorTicks,scaleTypes[(Origin::GraphAxis::Scale)layer.xAxis.scale], invert); + } + + invert = (layer.yAxis.min > layer.yAxis.max) || matrixImage; + if(breakY.show) + graph->setScale(0,layer.yAxis.min,layer.yAxis.max,layer.yAxis.step,layer.yAxis.majorTicks,layer.yAxis.minorTicks,scaleTypes[(Origin::GraphAxis::Scale)layer.xAxis.scale], //??xAxis?? + invert, + breakY.from, breakY.to, + breakY.position, + breakY.scaleIncrementBefore, breakY.scaleIncrementAfter, + breakY.minorTicksBefore, breakY.minorTicksAfter, breakY.log10); + else + graph->setScale(0,layer.yAxis.min,layer.yAxis.max,layer.yAxis.step,layer.yAxis.majorTicks,layer.yAxis.minorTicks,scaleTypes[(Origin::GraphAxis::Scale)layer.yAxis.scale], invert); + } + + //grid + Grid *grid = graph->grid(); + grid->enableX(!layer.xAxis.majorGrid.hidden); + grid->enableXMin(!layer.xAxis.minorGrid.hidden); + grid->enableY(!layer.yAxis.majorGrid.hidden); + grid->enableYMin(!layer.yAxis.minorGrid.hidden); + + grid->setMajPenX(QPen(ColorBox::defaultColor(layer.xAxis.majorGrid.color), ceil(layer.xAxis.majorGrid.width), + lineStyles[(Origin::GraphCurve::LineStyle)layer.xAxis.majorGrid.style])); + grid->setMinPenX(QPen(ColorBox::defaultColor(layer.xAxis.minorGrid.color), ceil(layer.xAxis.minorGrid.width), + lineStyles[(Origin::GraphCurve::LineStyle)layer.xAxis.minorGrid.style])); + grid->setMajPenY(QPen(ColorBox::defaultColor(layer.yAxis.majorGrid.color), ceil(layer.yAxis.majorGrid.width), + lineStyles[(Origin::GraphCurve::LineStyle)layer.yAxis.majorGrid.style])); + grid->setMinPenY(QPen(ColorBox::defaultColor(layer.yAxis.minorGrid.color), ceil(layer.yAxis.minorGrid.width), + lineStyles[(Origin::GraphCurve::LineStyle)layer.yAxis.minorGrid.style])); + + grid->setAxis(2, 0); + grid->enableZeroLineX(0); + grid->enableZeroLineY(0); + + vector formats; + formats.push_back(layer.yAxis.formatAxis[0]); //bottom + formats.push_back(layer.yAxis.formatAxis[1]); //top + formats.push_back(layer.xAxis.formatAxis[0]); //left + formats.push_back(layer.xAxis.formatAxis[1]); //right + + vector ticks; + ticks.push_back(layer.yAxis.tickAxis[0]); //bottom + ticks.push_back(layer.yAxis.tickAxis[1]); //top + ticks.push_back(layer.xAxis.tickAxis[0]); //left + ticks.push_back(layer.xAxis.tickAxis[1]); //right + + if (matrixImage){ + formats.clear(); + formats.push_back(layer.yAxis.formatAxis[0]); //bottom + formats.push_back(layer.yAxis.formatAxis[1]); //top + formats.push_back(layer.xAxis.formatAxis[1]); //left + formats.push_back(layer.xAxis.formatAxis[0]); //right + + ticks.clear(); + ticks.push_back(layer.yAxis.tickAxis[0]); //bottom + ticks.push_back(layer.yAxis.tickAxis[1]); //top + ticks.push_back(layer.xAxis.tickAxis[1]); //left + ticks.push_back(layer.xAxis.tickAxis[0]); //right + } + + for(int i = 0; i < 4; ++i){ + QString data(ticks[i].dataName.c_str()); + QString tableName = data.right(data.length()-2) + "_" + ticks[i].columnName.c_str(); + + QString formatInfo; + int format = 0; + int type = 0; + int prec = ticks[i].decimalPlaces; + int precisionNeeded = 0; + if(prec == -1){ + foreach(double value, graph->axisScaleDiv(i)->ticks(QwtScaleDiv::MajorTick)){ + QStringList decimals = QString::number(value).split("."); + if(decimals.size() > 1){ + int p = decimals[1].length(); + if(p > precisionNeeded) + precisionNeeded = p; + } + } + } + switch(ticks[i].valueType){ + case Origin::Numeric: + type = ScaleDraw::Numeric; + switch(ticks[i].valueTypeSpecification){ + case 0: //Decimal 1000 + case 3: //Decimal 1,000 + format = 1; + prec = (prec != -1 ? prec : precisionNeeded); + break; + case 1: //Scientific + format=2; + break; + case 2: //Engeneering + format=0; + break; + } + if(prec == -1) + prec = 2; + break; + case Origin::Text: //Text + type=ScaleDraw::Text; + break; + case 2: // Date + type=ScaleDraw::Date; + break; + case 3: // Time + type=ScaleDraw::Time; + break; + case Origin::Month: // Month + type=ScaleDraw::Month; + format=ticks[i].valueTypeSpecification; + break; + case Origin::Day: // Day + type=ScaleDraw::Day; + format=ticks[i].valueTypeSpecification; + break; + case Origin::ColumnHeading: + type=ScaleDraw::ColHeader; + switch(ticks[i].valueTypeSpecification){ + case 0: //Decimal 1000 + format=1; + break; + case 1: //Scientific + format=2; + break; + case 2: //Engeneering + case 3: //Decimal 1,000 + format=0; + break; + } + prec=2; + break; + default: + type=ScaleDraw::Numeric; + format=0; + prec=2; + } + + graph->showAxis(i, type, tableName, mw->table(tableName), !(formats[i].hidden), + tickTypeMap[formats[i].majorTicksType], tickTypeMap[formats[i].minorTicksType], + !(ticks[i].hidden), ColorBox::defaultColor(formats[i].color), format, prec, + -ticks[i].rotation, 0, "", (ticks[i].color == 0xF7 ? ColorBox::defaultColor(formats[i].color) : ColorBox::defaultColor(ticks[i].color))); + + QFont fnt = graph->axisTitleFont(i); + int fontSize = formats[i].label.fontSize; + if (fontSize > 0){ + fnt.setPointSizeF(fontSize*fFontScaleFactor); + fnt.setBold(false); + graph->setAxisTitleFont(i, fnt); + } + + graph->setAxisTitle(i, parseOriginText(QString::fromLocal8Bit(formats[i].label.text.c_str()))); + graph->setAxisTitleColor(i, originToQtColor(formats[i].label.color)); + + fnt = graph->axisFont(i); + fnt.setPointSizeF(ticks[i].fontSize*fFontScaleFactor); + graph->setAxisFont(i, fnt); + + if (_graph.isLayout) + graph->enableAxis(i, false); + } + + graph->setCanvasGeometry(QRect(layerRect.left*fScale, layerRect.top*fScale - yOffset, + layerRect.width()*fScale, layerRect.height()*fScale)); + graph->updateLayout(); + graph->updateCurveLabels(); + + if(!layer.legend.text.empty()) + addText(layer.legend, graph, fFontScaleFactor, fScale); + + //add texts + if(style != Graph::Pie){ + for(unsigned int i = 0; i < layer.texts.size(); ++i) + addText(layer.texts[i], graph, fFontScaleFactor, fScale); + } + + for(unsigned int i = 0; i < layer.lines.size(); ++i){ + ArrowMarker mrk; + mrk.setStartPoint(layer.lines[i].begin.x, layer.lines[i].begin.y); + mrk.setEndPoint(layer.lines[i].end.x, layer.lines[i].end.y); + mrk.drawStartArrow(layer.lines[i].begin.shapeType > 0); + mrk.drawEndArrow(layer.lines[i].end.shapeType > 0); + mrk.setHeadLength(layer.lines[i].end.shapeLength); + mrk.setHeadAngle(arrowAngle(layer.lines[i].end.shapeLength, layer.lines[i].end.shapeWidth)); + mrk.setColor(originToQtColor(layer.lines[i].color)); + mrk.setWidth(layer.lines[i].width); + mrk.setStyle(lineStyles[(Origin::GraphCurve::LineStyle)layer.lines[i].style]); + graph->addArrow(&mrk); + } + + for(unsigned int i = 0; i < layer.figures.size(); ++i){ + FrameWidget* fw; + switch(layer.figures[i].type){ + case Origin::Figure::Rectangle: + fw = new RectangleWidget(graph); + break; + case Origin::Figure::Circle: + fw = new EllipseWidget(graph); + break; + } + + double lw = layer.figures[i].width; + fw->setSize(layer.figures[i].clientRect.width()*fScale + 2*lw, layer.figures[i].clientRect.height()*fScale + 2*lw); + fw->move(QPoint(layer.figures[i].clientRect.left*fScale, layer.figures[i].clientRect.top*fScale - yOffset)); + fw->setFrameColor(originToQtColor(layer.figures[i].color)); + fw->setFrameWidth(lw); + fw->setFrameLineStyle(lineStyles[(Origin::GraphCurve::LineStyle)layer.figures[i].style]); + + QColor bkg = originToQtColor(layer.figures[i].fillAreaColor); + if (!bkg.isValid()) + bkg.setAlpha(0); + fw->setBackgroundColor(bkg); + fw->setBrush(QBrush(originToQtColor(layer.figures[i].useBorderColor ? layer.figures[i].color : layer.figures[i].fillAreaPatternColor), PatternBox::brushStyle(patternStyles[(Origin::FillPattern)layer.figures[i].fillAreaPattern]))); + graph->add(fw, false); + } + + for(unsigned int i = 0; i < layer.bitmaps.size(); ++i){ + QPixmap bmp; + QString windowName = QString::null; + if (layer.bitmaps[i].size > 0) + bmp.loadFromData(layer.bitmaps[i].data, layer.bitmaps[i].size, "BMP"); + else { + windowName = QString(layer.bitmaps[i].windowName.c_str()); + bmp = ImageWidget::windowPixmap(mw, windowName, QSize(layer.bitmaps[i].clientRect.width()*fScale, layer.bitmaps[i].clientRect.height()*fScale)); + } + + QTemporaryFile file; + file.setFileTemplate(QDir::tempPath() + "/XXXXXX.bmp"); + if(file.open()){ + bmp.save(file.fileName(), "BMP"); + ImageWidget* img = graph->addImage(file.fileName()); + img->setSaveInternally(); + if (!windowName.isEmpty()) + img->setWindowName(windowName); + img->setRect(layer.bitmaps[i].clientRect.left*fScale, layer.bitmaps[i].clientRect.top*fScale - yOffset, layer.bitmaps[i].clientRect.width()*fScale, layer.bitmaps[i].clientRect.height()*fScale); + + int bkg = 0; + switch(layer.bitmaps[i].borderType){ + case Origin::BlackLine: + case Origin::DarkMarble: + bkg = 1; + break; + case Origin::Shadow: + bkg = 2; + break; + default: + bkg = 0; + break; + } + img->setFrameStyle(bkg); + } + } + + if (layer.imageProfileTool) + imageProfileTool = true; + + if (boxWhiskersPlot){ + QStringList curveNames; + for (unsigned int i = 0; i < graph->curveCount(); i++){ + BoxCurve *box = (BoxCurve *)graph->curve(i); + if (!box || box->type() != Graph::Box) + continue; + Table *t = box->table(); + if (t) + curveNames << box->title().text().remove(t->objectName() + "_"); + box->setData(QwtSingleArrayData(double(i + 1), QwtArray(), 0)); + + int b_style = 0; + if (layer.percentile.diamondBox) + b_style = BoxCurve::Diamond; + else { + switch(layer.percentile.boxRange){ + case 0: + b_style = BoxCurve::NoBox; + break; + case 4: + b_style = BoxCurve::WindBox; + break; + case 6: + b_style = BoxCurve::Notch; + break; + default: + b_style = BoxCurve::Rect; + break; + } + } + box->setBoxStyle(b_style); + + int b_range = 0; + switch(layer.percentile.boxRange){ + case 1: + b_range = BoxCurve::SE; + break; + case 2: + b_range = BoxCurve::SD; + break; + case 3: + b_range = BoxCurve::r25_75; + break; + case 4: + b_range = BoxCurve::r10_90; + break; + case 6: + b_range = BoxCurve::r25_75; + break; + default: + b_range = BoxCurve::UserDef; + break; + } + box->setBoxRange(b_range, layer.percentile.boxCoeff); + + int w_range = 0; + switch(layer.percentile.whiskersRange){ + case 0: + w_range = BoxCurve::None; + break; + case 1: + w_range = BoxCurve::r10_90; + break; + case 2: + w_range = BoxCurve::r5_95; + break; + case 3: + w_range = BoxCurve::r1_99; + break; + case 4: + w_range = BoxCurve::SD; + break; + case 5: + w_range = BoxCurve::SE; + break; + case 7: + w_range = BoxCurve::MinMax; + break; + case 8: + w_range = BoxCurve::UserDef; + break; + default: + w_range = BoxCurve::UserDef; + break; + } + box->setWhiskersRange(w_range, layer.percentile.whiskersCoeff); + + box->loadData(); + + unsigned short size = layer.percentile.symbolSize; + QColor fillColor = originToQtColor(layer.percentile.symbolFillColor); + QBrush brush = QBrush(); + if (fillColor.isValid()) + brush = QBrush(fillColor); + + QPen pen = box->pen(); + QColor color = originToQtColor(layer.percentile.symbolColor); + if (color.isValid() && layer.percentile.symbolColor.type != Origin::Color::Automatic) + pen = QPen(color, 1); + + box->setSymbol(QwtSymbol(QwtSymbol::NoSymbol, brush, pen, QSize(size, size))); + box->setP99Style(originToQwtSymbolStyle(layer.percentile.p99SymbolType)); + box->setMeanStyle(originToQwtSymbolStyle(layer.percentile.meanSymbolType)); + box->setMaxStyle(originToQwtSymbolStyle(layer.percentile.maxSymbolType)); + box->setMinStyle(originToQwtSymbolStyle(layer.percentile.minSymbolType)); + box->setP1Style(originToQwtSymbolStyle(layer.percentile.p1SymbolType)); + } + ScaleDraw *sd = (ScaleDraw *)graph->axisScaleDraw(QwtPlot::xBottom); + sd->setLabelsList(curveNames); + sd->setShowTicksPolicy(ScaleDraw::HideBeginEnd); + graph->setAxisScaleDraw(QwtPlot::xBottom, sd); + + sd = (ScaleDraw *)graph->axisScaleDraw(QwtPlot::xTop); + sd->setShowTicksPolicy(ScaleDraw::HideBeginEnd); + graph->setAxisScaleDraw(QwtPlot::xTop, sd); + graph->replot(); + } + } + + if (imageProfileTool){ + Graph *graph = ml->layer(1); + if (graph){ + Spectrogram *sp = (Spectrogram *) graph->plotItem(0); + if (sp){ + Table *vt = NULL; + Table *ht = NULL; + Graph *g = ml->layer(2); + if (g){ + DataCurve *c = g->dataCurve(0); + if (c) + ht = c->table(); + } + g = ml->layer(3); + if (g){ + DataCurve *c = g->dataCurve(0); + if (c) + vt = c->table(); + } + + ImageProfilesTool *tool = new ImageProfilesTool(mw, graph, sp->matrix(), ht, vt, mw->displayInfoLineEdit(), SLOT(setText(const QString&))); + graph->setActiveTool(tool); + + Origin::GraphLayer& layer = _graph.layers[0]; + double x = layer.vLine * (layer.xAxis.max - layer.xAxis.min) + layer.xAxis.min; + double y = layer.hLine * (layer.yAxis.max - layer.yAxis.min) + layer.yAxis.min; + tool->append(QwtDoublePoint(x, y)); + } + } + } + + //ml->resize(graphWindowRect.width() - frameWidth, graphWindowRect.height() - frameWidth); + //cascade the graphs + if(ml->numLayers() > 0){ + if(!_graph.hidden){ + ml->move(QPoint(graphWindowRect.left, graphWindowRect.top)); + + switch(_graph.state){ + case Origin::Window::Minimized: + ml->setMinimized(); + break; + case Origin::Window::Maximized: + ml->show(); // to correct scaling with maximize + ml->setScaleLayersOnResize(true); + ml->setMaximized(); + break; + default: + ml->setScaleLayersOnResize(false); + ml->show(); + ml->setScaleLayersOnResize(mw->autoResizeLayers); + } + } else { + ml->show(); + mw->hideWindow(ml); + } + + foreach (Graph *g, ml->layersList()) + g->setAutoscaleFonts(mw->autoScaleFonts && _graph.state != Origin::Window::Maximized); + } else { + ml->askOnCloseEvent(false); + ml->close(); + } + } + + return true; +} + +bool ImportOPJ::importGraph3D(const OriginFile& opj, unsigned int g, unsigned int l) +{ + static QVector xAxes, yAxes, zAxes; + xAxes << Qwt3D::X1 << Qwt3D::X2 << Qwt3D::X3 << Qwt3D::X4; + yAxes << Qwt3D::Y1 << Qwt3D::Y2 << Qwt3D::Y3 << Qwt3D::Y4; + zAxes << Qwt3D::Z1 << Qwt3D::Z2 << Qwt3D::Z3 << Qwt3D::Z4; + + int auto_color = -1; + int type = 0; + Origin::Graph _graph = opj.graph(g); + Origin::GraphLayer& layer = _graph.layers[l]; + for(unsigned int c = 0; c < layer.curves.size(); ++c){ + Origin::GraphCurve& _curve = layer.curves[c]; + QString data(_curve.dataName.c_str()); + int color = 0; + double fFontScaleFactor = 2.0; + switch(_curve.type){ + case Origin::GraphCurve::Line3D: + type = _curve.connectSymbols ? Graph3D::Trajectory : Graph3D::Scatter; + break; + case Origin::GraphCurve::LineSymbol: + case Origin::GraphCurve::Area: + type = Graph3D::Ribbon; + break; + case Origin::GraphCurve::Column: + type = Graph3D::Bars; + break; + case Origin::GraphCurve::Mesh3D: + break; + default: + continue; + } + + Graph3D *plot = mw->newPlot3D(); + if (!plot) + return false; + + plot->setName(_graph.name.c_str()); + plot->setWindowLabel(_graph.label.c_str()); + + plot->setCaptionPolicy((MdiSubWindow::CaptionPolicy)_graph.title); + plot->setBirthDate(posixTimeToString(_graph.creationDate)); + plot->hide();//!hack used in order to avoid resize and repaint events + + Origin::Rect graphRect(_graph.width, _graph.height); + Origin::Rect graphWindowRect = _graph.frameRect;{ + double ratio = (double)(graphWindowRect.width() - frameWidth)/(double)(graphWindowRect.height() - frameHeight); + int width = _graph.width; + int height = _graph.height; + if((double)(_graph.width)/(double)(_graph.height) < ratio) + width = height * ratio; + else + height = width / ratio; + + //plot->resize(graphWindowRect.width(), graphWindowRect.height()); + + double fScale = (double)(graphWindowRect.width() - frameWidth)/(double)width; + fFontScaleFactor *= 170.0*fScale/72.0*1.3; //Ion: empirically decreased if from 300*... + } + + Origin::Rect layerRect = layer.clientRect; + + QFont font = plot->xAxisLabelFont(); + font.setPointSize(floor(layer.xAxis.formatAxis[0].label.fontSize*fFontScaleFactor + 0.5)); + QString label = parseOriginText(QString::fromLocal8Bit(layer.xAxis.formatAxis[0].label.text.c_str())); + RGBA xLabelColor = Qt2GL(originToQtColor(layer.xAxis.formatAxis[0].label.color)); + if (label.isEmpty()){ + label = parseOriginText(QString::fromLocal8Bit(layer.xAxis.formatAxis[1].label.text.c_str())); + xLabelColor = Qt2GL(originToQtColor(layer.xAxis.formatAxis[1].label.color)); + font.setPointSize(floor(layer.xAxis.formatAxis[1].label.fontSize*fFontScaleFactor + 0.5)); + } + plot->setXAxisLabel(label); + plot->setXAxisLabelFont(font); + + label = parseOriginText(QString::fromLocal8Bit(layer.yAxis.formatAxis[0].label.text.c_str())); + font.setPointSize(floor(layer.yAxis.formatAxis[0].label.fontSize*fFontScaleFactor + 0.5)); + RGBA yLabelColor = Qt2GL(originToQtColor(layer.yAxis.formatAxis[0].label.color)); + if (label.isEmpty()){ + label = parseOriginText(QString::fromLocal8Bit(layer.yAxis.formatAxis[1].label.text.c_str())); + yLabelColor = Qt2GL(originToQtColor(layer.yAxis.formatAxis[1].label.color)); + font.setPointSize(floor(layer.yAxis.formatAxis[1].label.fontSize*fFontScaleFactor + 0.5)); + } + plot->setYAxisLabel(label); + plot->setYAxisLabelFont(font); + + label = parseOriginText(QString::fromLocal8Bit(layer.zAxis.formatAxis[0].label.text.c_str())); + font.setPointSize(floor(layer.zAxis.formatAxis[0].label.fontSize*fFontScaleFactor + 0.5)); + RGBA zLabelColor = Qt2GL(originToQtColor(layer.zAxis.formatAxis[0].label.color)); + if (label.isEmpty()){ + label = parseOriginText(QString::fromLocal8Bit(layer.zAxis.formatAxis[1].label.text.c_str())); + zLabelColor = Qt2GL(originToQtColor(layer.zAxis.formatAxis[1].label.color)); + font.setPointSize(floor(layer.zAxis.formatAxis[1].label.fontSize*fFontScaleFactor + 0.5)); + } + plot->setZAxisLabel(label); + plot->setZAxisLabelFont(font); + + double majorTickLength = layer.xAxis.formatAxis[(layer.xAxis.position == Origin::GraphAxis::Bottom ? 0 : 1)].majorTickLength; + plot->setXAxisTickLength(majorTickLength, majorTickLength*0.6); + majorTickLength = layer.yAxis.formatAxis[(layer.yAxis.position == Origin::GraphAxis::Left ? 0 : 1)].majorTickLength; + plot->setYAxisTickLength(majorTickLength, majorTickLength*0.6); + majorTickLength = layer.zAxis.formatAxis[(layer.zAxis.position == Origin::GraphAxis::Front ? 0 : 1)].majorTickLength; + plot->setZAxisTickLength(majorTickLength, majorTickLength*0.6); + + if(layer.backgroundColor.type != Origin::Color::None) + plot->setBackgroundColor(originToQtColor(layer.backgroundColor)); + + plot->coordinateSystem()->setGridLines(true, true, Qwt3D::LEFT | Qwt3D::FLOOR | Qwt3D::BACK); + + RGBA axisColor = Qt2GL(ColorBox::defaultColor(layer.xAxis.formatAxis[(layer.xAxis.position == Origin::GraphAxis::Bottom ? 0 : 1)].color)); + RGBA numberColor = layer.xAxis.tickAxis[(layer.xAxis.position == Origin::GraphAxis::Bottom ? 0 : 1)].color == 0xF7 ? axisColor : Qt2GL(ColorBox::defaultColor(layer.xAxis.tickAxis[(layer.xAxis.position == Origin::GraphAxis::Bottom ? 0 : 1)].color)); + Qwt3D::GridLine majorGrid(!layer.xAxis.majorGrid.hidden, Qt2GL(ColorBox::defaultColor(layer.xAxis.majorGrid.color)), line3DStyles[(Origin::GraphCurve::LineStyle)layer.xAxis.majorGrid.style], layer.xAxis.majorGrid.width); + Qwt3D::GridLine minorGrid(!layer.xAxis.majorGrid.hidden, Qt2GL(ColorBox::defaultColor(layer.xAxis.majorGrid.color)), line3DStyles[(Origin::GraphCurve::LineStyle)layer.xAxis.majorGrid.style], layer.xAxis.majorGrid.width); + double width = layer.xAxis.formatAxis[(layer.xAxis.position == Origin::GraphAxis::Bottom ? 0 : 1)].thickness; + font = plot->numbersFont(); + font.setBold(layer.xAxis.tickAxis[(layer.xAxis.position == Origin::GraphAxis::Bottom ? 0 : 1)].fontBold); + font.setPointSize(floor(layer.xAxis.tickAxis[(layer.xAxis.position == Origin::GraphAxis::Bottom ? 0 : 1)].fontSize*fFontScaleFactor + 0.5)); + foreach(Qwt3D::AXIS axis, xAxes){ + plot->coordinateSystem()->axes[axis].setColor(axisColor); + plot->coordinateSystem()->axes[axis].setNumberColor(numberColor); + plot->coordinateSystem()->axes[axis].setLabelColor(xLabelColor); + plot->coordinateSystem()->setMajorGridLines(axis, majorGrid); + plot->coordinateSystem()->setMinorGridLines(axis, minorGrid); + plot->coordinateSystem()->axes[axis].setMinors(layer.xAxis.minorTicks + 1); + plot->coordinateSystem()->axes[axis].setLineWidth(width); + plot->setNumbersFont(font); + } + + axisColor = Qt2GL(ColorBox::defaultColor(layer.yAxis.formatAxis[(layer.yAxis.position == Origin::GraphAxis::Left ? 0 : 1)].color)); + numberColor = layer.yAxis.tickAxis[(layer.yAxis.position == Origin::GraphAxis::Left ? 0 : 1)].color == 0xF7 ? axisColor : Qt2GL(ColorBox::defaultColor(layer.yAxis.tickAxis[(layer.yAxis.position == Origin::GraphAxis::Left ? 0 : 1)].color)); + majorGrid = Qwt3D::GridLine(!layer.yAxis.majorGrid.hidden, Qt2GL(ColorBox::defaultColor(layer.yAxis.majorGrid.color)), line3DStyles[(Origin::GraphCurve::LineStyle)layer.yAxis.majorGrid.style], layer.yAxis.majorGrid.width); + minorGrid = Qwt3D::GridLine(!layer.yAxis.minorGrid.hidden, Qt2GL(ColorBox::defaultColor(layer.yAxis.minorGrid.color)), line3DStyles[(Origin::GraphCurve::LineStyle)layer.yAxis.minorGrid.style], layer.yAxis.minorGrid.width); + width = layer.yAxis.formatAxis[(layer.yAxis.position == Origin::GraphAxis::Left ? 0 : 1)].thickness; + font.setBold(layer.yAxis.tickAxis[(layer.yAxis.position == Origin::GraphAxis::Left ? 0 : 1)].fontBold); + font.setPointSize(floor(layer.yAxis.tickAxis[(layer.yAxis.position == Origin::GraphAxis::Left ? 0 : 1)].fontSize*fFontScaleFactor + 0.5)); + foreach(Qwt3D::AXIS axis, yAxes){ + plot->coordinateSystem()->axes[axis].setColor(axisColor); + plot->coordinateSystem()->axes[axis].setNumberColor(numberColor); + plot->coordinateSystem()->axes[axis].setLabelColor(yLabelColor); + plot->coordinateSystem()->setMajorGridLines(axis, majorGrid); + plot->coordinateSystem()->setMinorGridLines(axis, minorGrid); + plot->coordinateSystem()->axes[axis].setMinors(layer.yAxis.minorTicks + 1); + plot->coordinateSystem()->axes[axis].setLineWidth(width); + plot->setNumbersFont(font); + } + + axisColor = Qt2GL(ColorBox::defaultColor(layer.zAxis.formatAxis[(layer.zAxis.position == Origin::GraphAxis::Front ? 0 : 1)].color)); + numberColor = layer.zAxis.tickAxis[(layer.zAxis.position == Origin::GraphAxis::Front ? 0 : 1)].color == 0xF7 ? axisColor : Qt2GL(ColorBox::defaultColor(layer.zAxis.tickAxis[(layer.zAxis.position == Origin::GraphAxis::Front ? 0 : 1)].color)); + majorGrid = Qwt3D::GridLine(!layer.zAxis.majorGrid.hidden, Qt2GL(ColorBox::defaultColor(layer.zAxis.majorGrid.color)), line3DStyles[(Origin::GraphCurve::LineStyle)layer.zAxis.majorGrid.style], layer.zAxis.majorGrid.width); + minorGrid = Qwt3D::GridLine(!layer.zAxis.minorGrid.hidden, Qt2GL(ColorBox::defaultColor(layer.zAxis.minorGrid.color)), line3DStyles[(Origin::GraphCurve::LineStyle)layer.zAxis.minorGrid.style], layer.zAxis.minorGrid.width); + width = layer.zAxis.formatAxis[(layer.zAxis.position == Origin::GraphAxis::Front ? 0 : 1)].thickness; + font.setBold(layer.zAxis.tickAxis[(layer.zAxis.position == Origin::GraphAxis::Front ? 0 : 1)].fontBold); + font.setPointSize(floor(layer.zAxis.tickAxis[(layer.zAxis.position == Origin::GraphAxis::Front ? 0 : 1)].fontSize*fFontScaleFactor + 0.5)); + foreach(Qwt3D::AXIS axis, zAxes){ + plot->coordinateSystem()->axes[axis].setColor(axisColor); + plot->coordinateSystem()->axes[axis].setNumberColor(numberColor); + plot->coordinateSystem()->axes[axis].setLabelColor(zLabelColor); + plot->coordinateSystem()->setMajorGridLines(axis, majorGrid); + plot->coordinateSystem()->setMinorGridLines(axis, minorGrid); + plot->coordinateSystem()->axes[axis].setMinors(layer.zAxis.minorTicks + 1); + plot->coordinateSystem()->axes[axis].setLineWidth(width); + plot->setNumbersFont(font); + } + + QStringList formulas; + double start, end; + + plot->showColorLegend(false); + plot->setFramed(); + + QColor clr = (_curve.symbolColor.type == Origin::Color::Automatic ? ColorBox::defaultColor(++auto_color) : originToQtColor(_curve.symbolColor)); + plot->setDataColors(clr, clr); + + bool smooth; + switch(_curve.symbolType&0xFF){ + case 2: //Ellipse + case 20://Sphere + smooth = true; + break; + default: + smooth = false; + } + plot->setDotOptions(ceil(_curve.symbolSize), smooth); + + switch(data[0].toAscii()){ + case 'T':{ + Table* t = mw->table(data.right(data.length()-2)); + if (_curve.zColumnName.empty()){ + plot->addRibbon(t, t->objectName() + "_" + _curve.xColumnName.c_str(), t->objectName() + "_" + _curve.yColumnName.c_str()); + QColor color = originToQtColor(_curve.surface.frontColor); + plot->setDataColorMap(QwtLinearColorMap(color, color)); + plot->setMeshColor(_curve.lineColor.type == Origin::Color::Automatic ? ColorBox::defaultColor(0) : originToQtColor(_curve.fillAreaPatternBorderColor)); + } else { + plot->addData(t, t->colIndex(_curve.xColumnName.c_str()), t->colIndex(_curve.yColumnName.c_str()), t->colIndex(_curve.zColumnName.c_str()), type); + plot->setMeshColor(_curve.lineColor.type == Origin::Color::Automatic ? ColorBox::defaultColor(0) : originToQtColor(_curve.lineColor)); + } + + plot->setMeshLineWidth(_curve.lineWidth); + } + break; + case 'M':{ + Matrix* matrix = mw->matrix(data.right(data.length()-2)); + plot->addMatrixData(matrix); + switch(_curve.surface.type){ + case Origin::SurfaceProperties::ColorMap3D:{ + if(_curve.surface.surface.fill && _curve.surface.grids != Origin::SurfaceProperties::None) + plot->customPlotStyle(Qwt3D::FILLEDMESH); + else if(_curve.surface.surface.fill) + plot->customPlotStyle(Qwt3D::FILLED); + else if(_curve.surface.grids != Origin::SurfaceProperties::None) + plot->customPlotStyle(Qwt3D::WIREFRAME); + + ColorVector colors; + for(Origin::ColorMapVector::const_iterator it = _curve.surface.colorMap.levels.begin() + 1; it != _curve.surface.colorMap.levels.end() - 1; ++it) + colors.push_back(Qt2GL(originToQtColor(it->second.fillColor))); + plot->setDataColorMap(colors, qwtColorMap(_curve.surface.colorMap)); + + if(_curve.surface.bottomContour.fill) + plot->setFloorData(); + else if(_curve.surface.bottomContour.contour) + plot->setFloorIsolines(); + } + break; + case Origin::SurfaceProperties::ColorFill:{ + if(_curve.surface.grids != Origin::SurfaceProperties::None) + plot->customPlotStyle(Qwt3D::FILLEDMESH); + else + plot->customPlotStyle(Qwt3D::FILLED); + + QColor color = originToQtColor(_curve.surface.frontColor); + plot->setDataColorMap(QwtLinearColorMap(color, color)); + } + break; + case Origin::SurfaceProperties::WireFrame:{ + if(_curve.surface.grids != Origin::SurfaceProperties::None) + plot->customPlotStyle(Qwt3D::WIREFRAME); + else + plot->customPlotStyle(Qwt3D::HIDDENLINE); + } + break; + case Origin::SurfaceProperties::Bars:{ + plot->customPlotStyle(Qwt3D::USER); + ColorVector colors; + for(Origin::ColorMapVector::const_iterator it = _curve.surface.colorMap.levels.begin() + 1; it != _curve.surface.colorMap.levels.end(); ++it) + colors.push_back(Qt2GL(originToQtColor(it->second.fillColor))); + plot->setDataColorMap(colors, qwtColorMap(_curve.surface.colorMap)); + } + break; + default: + break; + } + plot->setMeshColor(originToQtColor(_curve.surface.gridColor)); + plot->setMeshLineWidth(_curve.surface.gridLineWidth); + } + break; + default: + continue; + } + + /*if(_curve.connectSymbols) + plot->setWireframeStyle(); + else + plot->setDotStyle();*/ + //plot->setScales(layer.xAxis.min, layer.xAxis.max, layer.yAxis.min, layer.yAxis.max, layer.zAxis.min, layer.zAxis.max); + + if (!layer.isXYY3D){ + int majorTicks = ceil((layer.xAxis.max - layer.xAxis.min)/layer.xAxis.step); + plot->setScale(0, layer.xAxis.min, layer.xAxis.max, majorTicks, layer.xAxis.minorTicks, (Qwt3D::SCALETYPE)scaleTypes[(Origin::GraphAxis::Scale)layer.xAxis.scale]); + + majorTicks = ceil((layer.yAxis.max - layer.yAxis.min)/layer.yAxis.step); + plot->setScale(1, layer.yAxis.min, layer.yAxis.max, majorTicks, layer.yAxis.minorTicks, (Qwt3D::SCALETYPE)scaleTypes[(Origin::GraphAxis::Scale)layer.yAxis.scale]); + + majorTicks = ceil((layer.zAxis.max - layer.zAxis.min)/layer.zAxis.step); + plot->setScale(2, layer.zAxis.min, layer.zAxis.max, majorTicks, layer.zAxis.minorTicks, (Qwt3D::SCALETYPE)scaleTypes[(Origin::GraphAxis::Scale)layer.zAxis.scale]); + } + plot->resetAxesLabels(); + + if(!_graph.hidden){ + plot->move(QPoint(graphWindowRect.left, graphWindowRect.top)); + + switch(_graph.state){ + case Origin::Window::Minimized: + mw->minimizeWindow(plot); + break; + case Origin::Window::Maximized: + plot->show(); // to correct scaling with maximize + mw->maximizeWindow(plot); + break; + default: + plot->show(); + } + } else { + plot->show(); + mw->hideWindow(plot); + } + } + + return true; +} + +void ImportOPJ::addText(const Origin::TextBox& text, Graph* graph, double fFontScaleFactor, double fScale) +{ + int bkg; + QColor bkgColor = Qt::white; + switch(text.borderType){ + case Origin::BlackLine: + bkg = 1; + break; + case Origin::Shadow: + bkg = 2; + break; + case Origin::DarkMarble: + bkg = 1; + bkgColor = Qt::darkGray; + break; + case Origin::BlackOut: + bkg = 0; + bkgColor = Qt::black; + break; + default: + bkg = 0; + bkgColor.setAlpha(0); + break; + } + + QString s = parseOriginText(QString::fromLocal8Bit(text.text.c_str())); + LegendWidget* txt = graph->newLegend(s); + + QFont font(mw->plotLegendFont); + font.setPointSizeF(text.fontSize*fFontScaleFactor); + txt->setFont(font); + txt->setAngle(text.rotation); + txt->setTextColor(originToQtColor(text.color)); + txt->setFrameStyle(bkg); + txt->setBackgroundColor(bkgColor); + + QFont font2(mw->plotLegendFont); + font2.setPointSize(text.fontSize); + QFontMetrics fm(font2, graph); + txt->move(QPoint(qRound(text.clientRect.left*fScale - fm.averageCharWidth()*fFontScaleFactor - txt->framePen().width()), + qRound((text.clientRect.top - fm.lineSpacing())*fScale) - LayerButton::btnSize() - txt->framePen().width())); + + if (text.rotation == 90)//TODO: better take into account the rotation + txt->move(QPoint(txt->x(), txt->y() - txt->width())); + + txt->setAttachPolicy(FrameWidget::Scales); +} + +QString ImportOPJ::parseOriginText(const QString &str) +{ + QStringList lines = str.trimmed().split("\n"); + QString text = ""; + for(int i = 0; i < lines.size(); ++i){ + if(i > 0) + text.append("\n"); + text.append(parseOriginTags(lines[i])); + } + return text; +} + +QString ImportOPJ::parseOriginTags(const QString &str) +{ + QString line=str; + //Lookbehind conditions are not supported - so need to reverse string + QRegExp rx("\\)[^\\)\\(]*\\((?!\\s*[buig\\+\\-]\\s*\\\\)"); + QRegExp rxfont("\\)[^\\)\\(]*\\((?![^\\:]*\\:f\\s*\\\\)"); + QString linerev = strreverse(line); + QString lBracket=strreverse("&lbracket;"); + QString rBracket=strreverse("&rbracket;"); + QString ltagBracket=strreverse("<agbracket;"); + QString rtagBracket=strreverse("&rtagbracket;"); + int pos1=rx.indexIn(linerev); + int pos2=rxfont.indexIn(linerev); + + while (pos1>-1 || pos2>-1) { + if(pos1==pos2) + { + QString value = rx.cap(0); + int len=value.length(); + value=rBracket+value.mid(1,len-2)+lBracket; + linerev.replace(pos1, len, value); + } + else if ((pos1>pos2&&pos2!=-1)||pos1==-1) + { + QString value = rxfont.cap(0); + int len=value.length(); + value=rtagBracket+value.mid(1,len-2)+ltagBracket; + linerev.replace(pos2, len, value); + } + else if ((pos2>pos1&&pos1!=-1)||pos2==-1) + { + QString value = rx.cap(0); + int len=value.length(); + value=rtagBracket+value.mid(1,len-2)+ltagBracket; + linerev.replace(pos1, len, value); + } + + pos1=rx.indexIn(linerev); + pos2=rxfont.indexIn(linerev); + } + linerev.replace(ltagBracket, "("); + linerev.replace(rtagBracket, ")"); + + line = strreverse(linerev); + + //replace \b(...), \i(...), \u(...), \g(...), \+(...), \-(...), \f:font(...) tags + QString rxstr[]={ + "\\\\\\s*b\\s*\\(", + "\\\\\\s*i\\s*\\(", + "\\\\\\s*u\\s*\\(", + "\\\\\\s*g\\s*\\(", + "\\\\\\s*\\+\\s*\\(", + "\\\\\\s*\\-\\s*\\(", + "\\\\\\s*f\\:[^\\(]*\\("}; + int postag[]={0,0,0,0,0,0,0}; + QString ltag[]={"","","","","","",""}; + QString rtag[]={"","","","","","",""}; + QRegExp rxtags[7]; + for(int i=0; i<7; ++i) + rxtags[i].setPattern(rxstr[i]+"[^\\(\\)]*\\)"); + + bool flag=true; + while(flag) { + for(int i=0; i<7; ++i) + { + postag[i] = rxtags[i].indexIn(line); + while (postag[i] > -1) { + QString value = rxtags[i].cap(0); + int len=value.length(); + int pos2=value.indexOf("("); + if(i<6) + value=ltag[i]+value.mid(pos2+1,len-pos2-2)+rtag[i]; + else + { + int posfont=value.indexOf("f:"); + value=ltag[i].arg(value.mid(posfont+2,pos2-posfont-2))+value.mid(pos2+1,len-pos2-2)+rtag[i]; + } + line.replace(postag[i], len, value); + postag[i] = rxtags[i].indexIn(line); + } + } + flag=false; + for(int i=0; i<7; ++i) + { + if(rxtags[i].indexIn(line)>-1) + { + flag=true; + break; + } + } + } + + //replace unclosed tags + for(int i=0; i<6; ++i) + line.replace(QRegExp(rxstr[i]), ltag[i]); + rxfont.setPattern(rxstr[6]); + int pos = rxfont.indexIn(line); + while (pos > -1) { + QString value = rxfont.cap(0); + int len=value.length(); + int posfont=value.indexOf("f:"); + value=ltag[6].arg(value.mid(posfont+2,len-posfont-3)); + line.replace(pos, len, value); + pos = rxfont.indexIn(line); + } + + line.replace("&lbracket;", "("); + line.replace("&rbracket;", ")"); + + return line; +} + +QwtLinearColorMap ImportOPJ::qwtColorMap(const Origin::ColorMap& colorMap) +{ + Origin::ColorMapVector::const_iterator it = colorMap.levels.begin(); + QColor color1 = originToQtColor(it->second.fillColor); + double level1 = it->first; + + it = colorMap.levels.end() - 2; + QColor color2 = originToQtColor(it->second.fillColor); + double level2 = it->first; + + QwtLinearColorMap qwt_color_map = QwtLinearColorMap(color1, color2); + qwt_color_map.setMode(QwtLinearColorMap::FixedColors); + + double dl = fabs(level2 - level1); + for(it = colorMap.levels.begin() + 1; it != colorMap.levels.end() - 2; ++it) + qwt_color_map.addColorStop(it->first/dl, originToQtColor(it->second.fillColor)); + + return qwt_color_map; +} + +QwtSymbol::Style ImportOPJ::originToQwtSymbolStyle(unsigned char type) +{ + int sType = 0; + switch(type){ + case 0: //NoSymbol + sType=0; + break; + case 1: //Rect + sType=2; + break; + case 2: //Ellipse + case 20://Sphere + sType=1; + break; + case 3: //UTriangle + sType=6; + break; + case 4: //DTriangle + sType=5; + break; + case 5: //Diamond + sType=3; + break; + case 6: //Cross + + sType=9; + break; + case 7: //Cross x + sType=10; + break; + case 8: //Snow + sType=13; + break; + case 9: //Horizontal - + sType=11; + break; + case 10: //Vertical | + sType=12; + break; + case 15: //LTriangle + sType=7; + break; + case 16: //RTriangle + sType=8; + break; + case 17: //Hexagon + case 19: //Pentagon + sType=15; + break; + case 18: //Star + sType=14; + break; + default: + sType=0; + } + return SymbolBox::style(sType); +} +//TODO: bug in grid dialog +// scale/minor ticks checkbox +// histogram: autobin export +// if prec not setted - automac+4digits === removed file 'qtiplot/src/origin/importOPJ.cpp' --- qtiplot/src/origin/importOPJ.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/origin/importOPJ.cpp 1970-01-01 00:00:00 +0000 @@ -1,1873 +0,0 @@ -/*************************************************************************** - File : importOPJ.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006-2008 by Ion Vasilief, Alex Kargovsky - Email (use @ for *) : ion_vasilief*yahoo.fr, kargovsky*yumr.phys.msu.su - Description : Origin project import class - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "importOPJ.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "qwt_plot_canvas.h" -#include "qwt_plot_layout.h" -#include "qwt_scale_widget.h" - -#include - -#include "boost/date_time/posix_time/posix_time.hpp" -using namespace boost::posix_time; - -#define OBJECTXOFFSET 200 - -QMap ImportOPJ::lineStyles; -QMap ImportOPJ::line3DStyles; -QMap ImportOPJ::patternStyles; -QMap ImportOPJ::classes; -QMap ImportOPJ::scaleTypes; - -QString strreverse(const QString &str) //QString reversing -{ - QString out=""; - for(int i=str.length()-1; i>=0; --i) - { - out+=str[i]; - } - return out; -} - -QString posixTimeToString(ptime pt) -{ - stringstream ss; - ss.imbue(locale(locale::classic(), new time_facet("%d.%m.%Y %H:%M:%S"))); - ss << pt; - return QString::fromStdString(ss.str()); -} - -ImportOPJ::ImportOPJ(ApplicationWindow *app, const QString& filename) : - mw(app) -{ - //////////////////////Origin params to QtiPlot mapping//////////////////// - classes[Origin::ProjectNode::SpreadSheet] = "Table"; - classes[Origin::ProjectNode::Matrix] = "Matrix"; - classes[Origin::ProjectNode::Graph] = "MultiLayer"; - classes[Origin::ProjectNode::Note] = "Note"; - - lineStyles[Origin::GraphCurve::Solid] = Qt::SolidLine; - lineStyles[Origin::GraphCurve::Dash] = Qt::DashLine; - lineStyles[Origin::GraphCurve::ShortDash] = Qt::DashLine; - lineStyles[Origin::GraphCurve::Dot] = Qt::DotLine; - lineStyles[Origin::GraphCurve::ShortDot] = Qt::DotLine; - lineStyles[Origin::GraphCurve::DashDot] = Qt::DashDotLine; - lineStyles[Origin::GraphCurve::ShortDashDot] = Qt::DashDotLine; - lineStyles[Origin::GraphCurve::DashDotDot] = Qt::DashDotDotLine; - - line3DStyles[Origin::GraphCurve::Solid] = Qwt3D::SOLID; - line3DStyles[Origin::GraphCurve::Dash] = Qwt3D::DASH; - line3DStyles[Origin::GraphCurve::ShortDash] = Qwt3D::SHORTDASH; - line3DStyles[Origin::GraphCurve::Dot] = Qwt3D::DOT; - line3DStyles[Origin::GraphCurve::ShortDot] = Qwt3D::SHORTDOT; - line3DStyles[Origin::GraphCurve::DashDot] = Qwt3D::DASHDOT; - line3DStyles[Origin::GraphCurve::ShortDashDot] = Qwt3D::SHORTDASHDOT; - line3DStyles[Origin::GraphCurve::DashDotDot] = Qwt3D::DASHDOTDOT; - - scaleTypes[Origin::GraphAxis::Linear] = Qwt3D::LINEARSCALE; - scaleTypes[Origin::GraphAxis::Log10] = Qwt3D::LOG10SCALE; - scaleTypes[Origin::GraphAxis::Probability] = Qwt3D::LINEARSCALE; - scaleTypes[Origin::GraphAxis::Probit] = Qwt3D::LINEARSCALE; - scaleTypes[Origin::GraphAxis::Reciprocal] = Qwt3D::LINEARSCALE; - scaleTypes[Origin::GraphAxis::OffsetReciprocal] = Qwt3D::LINEARSCALE; - scaleTypes[Origin::GraphAxis::Logit] = Qwt3D::LINEARSCALE; - scaleTypes[Origin::GraphAxis::Ln] = Qwt3D::LOG10SCALE; - scaleTypes[Origin::GraphAxis::Log2] = Qwt3D::LOG10SCALE; - - patternStyles[Origin::NoFill] = 255; - patternStyles[Origin::BDiagDense] = 4; - patternStyles[Origin::BDiagMedium] = 4; - patternStyles[Origin::BDiagSparse] = 4; - patternStyles[Origin::FDiagDense] = 5; - patternStyles[Origin::FDiagMedium] = 5; - patternStyles[Origin::FDiagSparse] = 5; - patternStyles[Origin::DiagCrossDense] = 6; - patternStyles[Origin::DiagCrossMedium] = 6; - patternStyles[Origin::DiagCrossSparse] = 6; - patternStyles[Origin::HorizontalDense] = 1; - patternStyles[Origin::HorizontalMedium] = 1; - patternStyles[Origin::HorizontalSparse] = 1; - patternStyles[Origin::VerticalDense] = 2; - patternStyles[Origin::VerticalMedium] = 2; - patternStyles[Origin::VerticalSparse] = 2; - patternStyles[Origin::CrossDense] = 3; - patternStyles[Origin::CrossMedium] = 3; - patternStyles[Origin::CrossSparse] = 3; - - ////////////////////////////////////////////////////////////////////////// - xoffset=0; - try - { - OriginFile opj((const char *)filename.toLocal8Bit()); - parse_error = opj.parse(); - importTables(opj); - importGraphs(opj); - importNotes(opj); - if(filename.endsWith(".opj", Qt::CaseInsensitive)) - createProjectTree(opj); - mw->showResults(opj.resultsLogString().c_str(), mw->logWindow->isVisible()); - } - catch(const std::logic_error& er) - { - QApplication::restoreOverrideCursor(); - QMessageBox::critical(mw, "Origin Project Import Error", QString(er.what())); - } -} - -inline uint qHash(const tree::iterator &key) -{ - return qHash(key->name.c_str()); -} - -QColor originToQtColor(const Origin::Color& color) -{ - return (color.type == Origin::Color::Regular ? ColorBox::color(color.regular) : QColor(color.custom[0], color.custom[1], color.custom[2])); -} - -bool ImportOPJ::createProjectTree(const OriginFile& opj) -{ - const tree* projectTree = opj.project(); - tree::iterator root = projectTree->begin(projectTree->begin()); - if(!root.node) - return false; - FolderListItem* item = (FolderListItem*)mw->folders->firstChild(); - item->setText(0, root->name.c_str()); - item->folder()->setName(root->name.c_str()); - Folder* projectFolder = mw->projectFolder(); - QHash::iterator, Folder*> parent; - parent[root] = projectFolder; - for(tree::iterator sib = projectTree->begin(root); sib != projectTree->end(root); ++sib) - { - if(sib->type == Origin::ProjectNode::Folder) - { - parent[sib] = mw->addFolder(sib->name.c_str(), parent.value(projectTree->parent(sib))); - parent[sib]->setBirthDate(posixTimeToString(sib->creationDate)); - parent[sib]->setModificationDate(posixTimeToString(sib->modificationDate)); - } - else - { - QString name = sib->name.c_str(); - if(sib->type == Origin::ProjectNode::Note) - { - QRegExp rx("^@\\((\\S+)\\)$"); - if(rx.indexIn(name) == 0) - name = rx.cap(1); - } - - MdiSubWindow* w = projectFolder->window(name, classes[sib->type]); - if(w) - { - Folder *f = parent.value(projectTree->parent(sib)); - if (f){ - f->addWindow(w); - projectFolder->removeWindow(w); - f->setActiveWindow(w); - } - } - } - } - mw->changeFolder(projectFolder, true); - return true; -} - -bool ImportOPJ::importTables(const OriginFile& opj) -{ - int visible_count = 0; - int QtiPlot_scaling_factor = 10; //in Origin width is measured in characters while in QtiPlot - pixels --- need to be accurate - for(unsigned int s = 0; s < opj.spreadCount(); ++s) - { - Origin::SpreadSheet spread = opj.spread(s); - int columnCount = spread.columns.size(); - int maxrows = spread.maxRows; - if(!columnCount) //remove tables without cols - continue; - - Table *table = (spread.hidden || spread.loose) && opj.version() == 7.5 ? mw->newHiddenTable(spread.name.c_str(), spread.label.c_str(), maxrows, columnCount) - : mw->newTable(spread.name.c_str(), maxrows, columnCount); - if (!table) - return false; - - Origin::Rect windowRect; - if(opj.version() == 7.5) - { - windowRect = spread.frameRect; - table->resize(windowRect.width() - (table->frameGeometry().width() - table->width()), - windowRect.height() - (table->frameGeometry().height() - table->height())); - } - - table->setCaptionPolicy((MdiSubWindow::CaptionPolicy)spread.title); - table->setBirthDate(posixTimeToString(spread.creationDate)); - - QLocale locale = mw->locale(); - table->setWindowLabel(spread.label.c_str()); - for(int j = 0; j < columnCount; ++j) - { - Origin::SpreadColumn column = spread.columns[j]; - QString name(column.name.c_str()); - table->setColName(j, name.replace(QRegExp(".*_"),"")); - table->setCommand(j, QString(column.command.c_str())); - table->setColComment(j, QString(column.comment.c_str())); - table->setColumnWidth(j, column.width * QtiPlot_scaling_factor); - - switch(column.type) - { - case Origin::SpreadColumn::X: - table->setColPlotDesignation(j, Table::X); - break; - case Origin::SpreadColumn::Y: - table->setColPlotDesignation(j, Table::Y); - break; - case Origin::SpreadColumn::Z: - table->setColPlotDesignation(j, Table::Z); - break; - case Origin::SpreadColumn::XErr: - table->setColPlotDesignation(j, Table::xErr); - break; - case Origin::SpreadColumn::YErr: - table->setColPlotDesignation(j, Table::yErr); - break; - case Origin::SpreadColumn::Label: - table->setColPlotDesignation(j, Table::Label); - break; - default: - table->setColPlotDesignation(j, Table::None); - } - - table->setHeaderColType();//update header - - double **d_cells = new double* [columnCount]; - for(int i = 0; i < columnCount; ++i) - d_cells[i] = new double [table->numRows()]; - - bool set_text_column = false; - for(unsigned int i = 0; i < column.data.size(); ++i) - { - Origin::variant value = column.data[i]; - if(column.type != Origin::SpreadColumn::Label && column.valueType != Origin::Text) - {// number - if(value.type() == typeid(string)){//Origin::TextNumeric column should be set to Text - set_text_column = true; - table->setText(i, j, QString(boost::get(value).c_str())); - } - - if(value.type() != typeid(double)) - continue; - - double val = boost::get(value); - if(fabs(val)>0 && fabs(val)<2.0e-300)// empty entry - continue; - - table->setText(i, j, locale.toString(val, 'g', 16)); - d_cells[j][i] = val; - } - else// label? doesn't seem to work - { - table->setText(i, j, QString(value.type() == typeid(string) ? boost::get(value).c_str() : "")); - } - } - - table->saveToMemory(d_cells); - - QString format; - switch(column.valueType) - { - case Origin::Numeric: - case Origin::TextNumeric: - if (set_text_column){ - table->setTextFormat(j); - break; - } - - int f; - if(column.numericDisplayType == 0) - f = 0; - else - switch(column.valueTypeSpecification) - { - case 0: //Decimal 1000 - f=1; - break; - case 1: //Scientific - f=2; - break; - case 2: //Engeneering - case 3: //Decimal 1,000 - f=0; - break; - } - table->setColNumericFormat(f, column.decimalPlaces, j); - break; - case Origin::Text: - table->setTextFormat(j); - break; - case Origin::Date: - switch(column.valueTypeSpecification) - { - case -128: - format="dd/MM/yyyy"; - break; - case -119: - format="dd/MM/yyyy HH:mm"; - break; - case -118: - format="dd/MM/yyyy HH:mm:ss"; - break; - case 0: - case 9: - case 10: - format="dd.MM.yyyy"; - break; - case 2: - format="MMM d"; - break; - case 3: - format="M/d"; - break; - case 4: - format="d"; - break; - case 5: - case 6: - format="ddd"; - break; - case 7: - format="yyyy"; - break; - case 8: - format="yy"; - break; - case 11: - case 12: - case 13: - case 14: - case 15: - format="yyMMdd"; - break; - case 16: - case 17: - format="MMM"; - break; - case 19: - format="M-d-yyyy"; - break; - default: - format="dd.MM.yyyy"; - } - table->setDateFormat(format, j); - break; - case Origin::Time: - switch(column.valueTypeSpecification + 128) - { - case 0: - format="hh:mm"; - break; - case 1: - format="hh"; - break; - case 2: - format="hh:mm:ss"; - break; - case 3: - format="hh:mm:ss.zzz"; - break; - case 4: - format="hh ap"; - break; - case 5: - format="hh:mm ap"; - break; - case 6: - format="mm:ss"; - break; - case 7: - format="mm:ss.zzz"; - break; - case 8: - format="hhmm"; - break; - case 9: - format="hhmmss"; - break; - case 10: - format="hh:mm:ss.zzz"; - break; - } - table->setTimeFormat(format, j); - break; - case Origin::Month: - switch(column.valueTypeSpecification) - { - case 0: - format = "MMM"; - break; - case 1: - format = "MMMM"; - break; - case 2: - format = "M"; - break; - } - table->setMonthFormat(format, j); - break; - case Origin::Day: - switch(column.valueTypeSpecification) - { - case 0: - format = "ddd"; - break; - case 1: - format = "dddd"; - break; - case 2: - format = "d"; - break; - } - table->setDayFormat(format, j); - break; - } - table->freeMemory(); - } - - - if(!(spread.hidden || spread.loose) || opj.version() != 7.5) - { - switch(spread.state) - { - case Origin::Window::Minimized: - mw->minimizeWindow(table); - break; - case Origin::Window::Maximized: - mw->maximizeWindow(table); - break; - default: - table->showNormal(); - } - - //cascade the tables - if(opj.version() == 7.5) - { - table->move(QPoint(windowRect.left, windowRect.top)); - } - else - { - int dx = table->verticalHeaderWidth(); - int dy = table->frameGeometry().height() - table->height(); - table->move(QPoint(visible_count*dx + xoffset*OBJECTXOFFSET, visible_count*dy)); - ++visible_count; - } - } - } - -//Import matrices - for(unsigned int s = 0; s < opj.matrixCount(); ++s) - { - Origin::Matrix matrix = opj.matrix(s); - int columnCount = matrix.columnCount; - int rowCount = matrix.rowCount; - - Matrix* Matrix = mw->newMatrix(matrix.name.c_str(), rowCount, columnCount); - if (!Matrix) - return false; - - Origin::Rect windowRect; - if(opj.version() == 7.5) - { - windowRect = matrix.frameRect; - Matrix->resize(windowRect.width() - (Matrix->frameGeometry().width() - Matrix->width()), - windowRect.height() - (Matrix->frameGeometry().height() - Matrix->height())); - } - - Matrix->setCaptionPolicy((MdiSubWindow::CaptionPolicy)matrix.title); - Matrix->setBirthDate(posixTimeToString(matrix.creationDate)); - - Matrix->setWindowLabel(matrix.label.c_str()); - Matrix->setFormula(matrix.command.c_str()); - Matrix->setColumnsWidth(matrix.width * QtiPlot_scaling_factor); - if(matrix.view == Origin::Matrix::ImageView) - { - Matrix->setViewType(Matrix::ImageView); - Origin::ColorMap colorMap = matrix.colorMap; - colorMap.levels.pop_back(); - Matrix->setColorMap(qwtColorMap(colorMap)); - } - - if(matrix.header == Origin::Matrix::XY) - Matrix->setHeaderViewType(Matrix::XY); - - vector* data = &matrix.data; - double* matrix_data = Matrix->matrixModel()->dataVector(); - int size = Matrix->numRows()*Matrix->numCols(); - for(int i=0; i < size; ++i) - { - matrix_data[i] = fabs(data->at(i)) < 2.0e-300 && fabs(data->at(i)) > 0 ? GSL_NAN : data->at(i); - } - - QChar format; - switch(matrix.valueTypeSpecification) - { - case 0: //Decimal 1000 - format='f'; - break; - case 1: //Scientific - format='e'; - break; - case 2: //Engeneering - case 3: //Decimal 1,000 - format='g'; - break; - } - Matrix->setNumericFormat(format, matrix.significantDigits); - - if(!matrix.hidden || opj.version() != 7.5) - { - switch(matrix.state) - { - case Origin::Window::Minimized: - mw->minimizeWindow(Matrix); - break; - case Origin::Window::Maximized: - mw->maximizeWindow(Matrix); - break; - default: - Matrix->showNormal(); - } - - //cascade the matrices - if(opj.version() == 7.5) - { - Matrix->move(QPoint(windowRect.left, windowRect.top)); - } - else - { - int dx = Matrix->verticalHeaderWidth(); - int dy = Matrix->frameGeometry().height() - Matrix->height(); - Matrix->move(QPoint(visible_count*dx + xoffset*OBJECTXOFFSET, visible_count*dy)); - ++visible_count; - } - } - } - - if(visible_count > 0) - ++xoffset; - - return true; -} - -bool ImportOPJ::importNotes(const OriginFile& opj) -{ - for(unsigned int n = 0; n < opj.noteCount(); ++n) - { - Origin::Note _note = opj.note(n); - QString name = _note.name.c_str(); - QRegExp rx("^@\\((\\S+)\\)$"); - if(rx.indexIn(name) == 0) - name = rx.cap(1); - - Note* note = mw->newNote(name); - if(!note) - return false; - - note->setName(name); - - note->setWindowLabel(_note.label.c_str()); - note->setText(QString(_note.text.c_str())); - note->setCaptionPolicy((MdiSubWindow::CaptionPolicy)_note.title); - note->setBirthDate(posixTimeToString(_note.creationDate)); - - Origin::Rect windowRect; - windowRect = _note.frameRect; - note->resize(windowRect.width() - (note->frameGeometry().width() - note->width()), - windowRect.height() - (note->frameGeometry().height() - note->height())); - - note->move(QPoint(windowRect.left, windowRect.top)); - - /*switch(_note.state) - { - case Origin::Window::Minimized: - mw->minimizeWindow(note); - break; - case Origin::Window::Maximized: - mw->maximizeWindow(note); - break; - default: - note->showNormal(); - }*/ - - if(_note.hidden) - mw->hideWindow(note); - } - - return true; -} - -bool ImportOPJ::importGraphs(const OriginFile& opj) -{ - double pi=3.141592653589793; - int tickTypeMap[]={0,3,1,2}; - - MultiLayer* fake = mw->multilayerPlot("fake", 0); - fake->setParent(0); - frameWidth = fake->frameGeometry().width() - fake->geometry().width(); - frameHeight = fake->frameGeometry().height() - fake->geometry().height(); - Origin::Rect standardFrame(fake->geometry().width(), fake->geometry().height()); - fake->setMaximized(); - Origin::Rect maximazedFrame(fake->geometry().width(), fake->geometry().height()); - fake->askOnCloseEvent(false); - fake->close(); - - for(unsigned int g = 0; g < opj.graphCount(); ++g) - { - Origin::Graph _graph = opj.graph(g); - MultiLayer *ml = mw->multilayerPlot(_graph.name.c_str(), 0); - if (!ml) - return false; - - ml->setCaptionPolicy((MdiSubWindow::CaptionPolicy)_graph.title); - ml->setBirthDate(posixTimeToString(_graph.creationDate)); - ml->hide();//!hack used in order to avoid resize and repaint events - ml->setWindowLabel(_graph.label.c_str()); - - Origin::Rect graphRect(_graph.width, _graph.height); - Origin::Rect graphWindowRect = _graph.frameRect.isValid() ? _graph.frameRect : (_graph.state == Origin::Window::Maximized ? maximazedFrame : standardFrame); - double ratio = (double)(graphWindowRect.width() - frameWidth)/(double)(graphWindowRect.height() - frameHeight); - - int width = _graph.width; - int height = _graph.height; - if((double)(_graph.width)/(double)(_graph.height) < ratio) - { - width = height * ratio; - } - else - { - height = width / ratio; - } - - //ml->resize(width, height); - - int yOffset = LayerButton::btnSize(); - - ml->resize(graphWindowRect.width(), graphWindowRect.height()); - - double fScale = (double)(graphWindowRect.width() - frameWidth)/(double)width; - - double fWindowFactor = QMIN((double)graphWindowRect.width()/500.0, (double)graphWindowRect.height()/350.0); - double fFontScaleFactor = 300*fScale/72;//0.37*fWindowFactor; - double fVectorArrowScaleFactor = 0.08*fWindowFactor; - - for(unsigned int l = 0; l < _graph.layers.size(); ++l) - { - Origin::GraphLayer& layer = _graph.layers[l]; - if(layer.is3D()) - { - importGraph3D(opj, g, l); - continue; - } - - Graph *graph = ml->addLayer(); - if(!graph) - return false; - - Origin::Rect layerRect = layer.clientRect; - - graph->setXAxisTitle(parseOriginText(QString::fromLocal8Bit(layer.xAxis.label.text.c_str()))); - graph->setYAxisTitle(parseOriginText(QString::fromLocal8Bit(layer.yAxis.label.text.c_str()))); - - if(layer.backgroundColor.type != Origin::Color::None) - graph->setCanvasBackground(originToQtColor(layer.backgroundColor)); - - int auto_color = -1; - int style = 0; - for(unsigned int c = 0; c < layer.curves.size(); ++c) - { - Origin::GraphCurve& _curve = layer.curves[c]; - try - { - QString data(_curve.dataName.c_str()); - int color = 0; - switch(_curve.type) - { - case Origin::GraphCurve::Line: - style = Graph::Line; - break; - case Origin::GraphCurve::Scatter: - style = Graph::Scatter; - break; - case Origin::GraphCurve::LineSymbol: - style = Graph::LineSymbols; - break; - case Origin::GraphCurve::ErrorBar: - case Origin::GraphCurve::XErrorBar: - style = Graph::ErrorBars; - break; - case Origin::GraphCurve::Column: - style = Graph::VerticalBars; - break; - case Origin::GraphCurve::Bar: - style = Graph::HorizontalBars; - break; - case Origin::GraphCurve::Histogram: - style = Graph::Histogram; - break; - case Origin::GraphCurve::Pie: - style = Graph::Pie; - break; - case Origin::GraphCurve::Box: - style = Graph::Box; - break; - case Origin::GraphCurve::FlowVector: - style = Graph::VectXYXY; - break; - case Origin::GraphCurve::Vector: - style = Graph::VectXYAM; - break; - case Origin::GraphCurve::Area: - case Origin::GraphCurve::AreaStack: - style = Graph::Area; - break; - case Origin::GraphCurve::TextPlot: - style = Origin::GraphCurve::TextPlot; - break; - case Origin::GraphCurve::Contour: - style = Origin::GraphCurve::Contour; - break; - default: - continue; - } - - QString tableName; - QStringList formulas; - double start, end; - int s; - PlotCurve* curve = NULL; - Origin::Function function; - switch(data[0].toAscii()) - { - case 'T': - tableName = data.right(data.length()-2); - if(style==Graph::ErrorBars) - { - int flags=_curve.symbolType; - curve = (PlotCurve*)graph->addErrorBars(QString("%1_%2").arg(tableName, _curve.xColumnName.c_str()), mw->table(tableName), QString("%1_%2").arg(tableName, _curve.yColumnName.c_str()), - ((flags&0x10)==0x10?0:1), ceil(_curve.lineWidth), ceil(_curve.symbolSize), QColor(Qt::black), - (flags&0x40)==0x40, (flags&2)==2, (flags&1)==1); - } - else if(style==Graph::Histogram) - curve = (PlotCurve*)graph->insertCurve(mw->table(tableName), QString("%1_%2").arg(tableName, _curve.yColumnName.c_str()), style); - else if(style==Graph::Pie || style==Graph::Box) - { - QStringList names; - names << QString("%1_%2").arg(tableName, _curve.yColumnName.c_str()); - graph->addCurves(mw->table(tableName), names, style); - } - else if(style==Graph::VectXYXY) - { - QStringList names; - Origin::VectorProperties vector = _curve.vector; - names << QString("%1_%2").arg(tableName, _curve.xColumnName.c_str()) - << QString("%1_%2").arg(tableName, _curve.yColumnName.c_str()) - << (tableName + "_" + QString(vector.endXColumnName.c_str())) - << (tableName + "_" + QString(vector.endYColumnName.c_str())); - - graph->addCurves(mw->table(tableName), names, style); - } - else if(style==Graph::VectXYAM) - { - QStringList names; - Origin::VectorProperties vector = _curve.vector; - names << QString("%1_%2").arg(tableName, _curve.xColumnName.c_str()) - << QString("%1_%2").arg(tableName, _curve.yColumnName.c_str()) - << (tableName + "_" + QString(vector.angleColumnName.c_str())) - << (tableName + "_" + QString(vector.magnitudeColumnName.c_str())); - - graph->addCurves(mw->table(tableName), names, style); - } - else if(style == Origin::GraphCurve::TextPlot) - { - Table* table = mw->table(tableName); - QString labelsCol(_curve.yColumnName.c_str()); - int xcol = table->colX(table->colIndex(labelsCol)); - int ycol = table->colY(table->colIndex(labelsCol)); - if (xcol < 0 || ycol < 0) - return false; - - DataCurve* mc = graph->masterCurve(table->colName(xcol), table->colName(ycol)); - if(mc) - { - graph->replot(); - mc->setLabelsColumnName(labelsCol); - mc->setLabelsRotation(_curve.text.rotation); - mc->setLabelsWhiteOut(_curve.text.whiteOut); - mc->setLabelsOffset(_curve.text.xOffset, _curve.text.yOffset); - mc->setLabelsColor(originToQtColor(_curve.text.color)); - int align = -1; - switch(_curve.text.justify) - { - case Origin::TextProperties::Center: - align = Qt::AlignHCenter; - break; - - case Origin::TextProperties::Left: - align = Qt::AlignLeft; - break; - - case Origin::TextProperties::Right: - align = Qt::AlignRight; - break; - } - mc->setLabelsAlignment(align); - QFont fnt = mc->labelsFont(); - fnt.setBold(_curve.text.fontBold); - fnt.setItalic(_curve.text.fontItalic); - fnt.setUnderline(_curve.text.fontUnderline); - fnt.setPointSize(floor(_curve.text.fontSize*fFontScaleFactor + 0.5)); - mc->setLabelsFont(fnt); - } - } - else - curve = (PlotCurve *)graph->insertCurve(mw->table(tableName), QString("%1_%2").arg(tableName, _curve.xColumnName.c_str()), QString("%1_%2").arg(tableName, _curve.yColumnName.c_str()), style); - break; - case 'M': - if(style == Origin::GraphCurve::Contour) - { - QString matrixName = data.right(data.length()-2); - Matrix* matrix = mw->matrix(matrixName); - curve = (PlotCurve*)graph->plotSpectrogram(matrix, Graph::ColorMap); - Spectrogram* sp = (Spectrogram*) curve; - sp->setCustomColorMap(qwtColorMap(_curve.colorMap)); - QwtValueList levels; - QPen pen; - for(Origin::ColorMapVector::const_iterator it = _curve.colorMap.levels.begin() + 1; it != _curve.colorMap.levels.end(); ++it) - { - if(it->second.lineVisible) - { - levels.push_back(it->first); - pen = QPen(originToQtColor(it->second.lineColor), ceil(it->second.lineWidth), lineStyles[(Origin::GraphCurve::LineStyle)it->second.lineStyle]); - sp->setDisplayMode(QwtPlotSpectrogram::ContourMode, true); - } - } - sp->setDisplayMode(QwtPlotSpectrogram::ImageMode, _curve.colorMap.fillEnabled); - sp->setContourLevels(levels); - sp->setDefaultContourPen(pen); - } - break; - case 'F': - s = opj.functionIndex(data.right(data.length()-2).toStdString()); - function = opj.function(s); - - int type; - if(function.type == Origin::Function::Polar)//Polar - { - type = 2; - formulas << function.formula.c_str() << "x"; - start = pi/180 * function.begin; - end = pi/180 * function.end; - } - else - { - type = 0; - formulas << function.formula.c_str(); - start = function.begin; - end = function.end; - } - curve = (PlotCurve*)graph->addFunction(formulas, start, end, function.totalPoints, "x", type, function.name.c_str()); - - mw->updateFunctionLists(type, formulas); - break; - default: - continue; - } - - CurveLayout cl = graph->initCurveLayout(style, layer.curves.size()); - cl.sSize = ceil(_curve.symbolSize); - cl.penWidth=_curve.symbolThickness; - color=_curve.symbolColor.regular; - if((style==Graph::Scatter || style==Graph::LineSymbols || style==Graph::Area)&&_curve.symbolColor.type == Origin::Color::Automatic)//0xF7 -Automatic color - color=++auto_color; - cl.symCol = ColorBox::color(color); - switch(_curve.symbolType&0xFF) - { - case 0: //NoSymbol - cl.sType=0; - break; - case 1: //Rect - cl.sType=2; - break; - case 2: //Ellipse - case 20://Sphere - cl.sType=1; - break; - case 3: //UTriangle - cl.sType=6; - break; - case 4: //DTriangle - cl.sType=5; - break; - case 5: //Diamond - cl.sType=3; - break; - case 6: //Cross + - cl.sType=9; - break; - case 7: //Cross x - cl.sType=10; - break; - case 8: //Snow - cl.sType=13; - break; - case 9: //Horizontal - - cl.sType=11; - break; - case 10: //Vertical | - cl.sType=12; - break; - case 15: //LTriangle - cl.sType=7; - break; - case 16: //RTriangle - cl.sType=8; - break; - case 17: //Hexagon - case 19: //Pentagon - cl.sType=15; - break; - case 18: //Star - cl.sType=14; - break; - default: - cl.sType=0; - } - - switch(_curve.symbolType>>8) - { - case 0: - cl.fillCol = ColorBox::color(color); - break; - case 1: - case 2: - case 8: - case 9: - case 10: - case 11: - color=_curve.symbolFillColor.regular; - if((style==Graph::Scatter || style==Graph::LineSymbols || style==Graph::Area)&&_curve.symbolFillColor.type==Origin::Color::Automatic)//0xF7 -Automatic color - color=17;// depend on Origin settings - not stored in file - cl.fillCol = ColorBox::color(color); - break; - default: - cl.fillCol = QColor(); - } - - cl.lWidth = ceil(_curve.lineWidth); - color=_curve.lineColor.regular; - cl.lCol = ColorBox::color(_curve.lineColor.type==Origin::Color::Automatic?0:color); //0xF7 -Automatic color - int linestyle=_curve.lineStyle; - cl.filledArea=(_curve.fillArea || style==Graph::VerticalBars || style==Graph::HorizontalBars || style==Graph::Histogram || style == Graph::Pie) ? 1 : 0; - if(cl.filledArea) - { - Origin::Color color; - cl.aStyle = _curve.fillAreaPattern == Origin::NoFill ? 0 : patternStyles[(Origin::FillPattern)_curve.fillAreaPattern]; - color = (cl.aStyle == 0 ? _curve.fillAreaColor : _curve.fillAreaPatternColor); - cl.aCol = (color.type == Origin::Color::Automatic ? 0 : color.regular); //0xF7 -Automatic color - if(style == Graph::VerticalBars || style == Graph::HorizontalBars || style == Graph::Histogram || style == Graph::Pie) - { - color = _curve.fillAreaPatternBorderColor; - cl.lCol = ColorBox::color(color.type == Origin::Color::Automatic ? 0 : color.regular); //0xF7 -Automatic color - color = (cl.aStyle == 0 ? _curve.fillAreaColor : _curve.fillAreaPatternColor); - cl.aCol = (color.type == Origin::Color::Automatic ? cl.lCol : ColorBox::color(color.regular)); //0xF7 -Automatic color - cl.lWidth = ceil(_curve.fillAreaPatternBorderWidth); - linestyle = _curve.fillAreaPatternBorderStyle; - } - } - cl.lStyle = lineStyles[(Origin::GraphCurve::LineStyle)linestyle] - 1; - - if(style != Origin::GraphCurve::Contour) - graph->updateCurveLayout(curve, &cl); - - if(style == Graph::VerticalBars || style == Graph::HorizontalBars) - { - QwtBarCurve *b = (QwtBarCurve*)graph->curve(c); - if (b) - b->setGap(qRound(100-_curve.symbolSize*10)); - } - else if(style == Graph::Histogram) - { - QwtHistogram *h = (QwtHistogram*)graph->curve(c); - if(h) - { - h->setBinning(false, layer.histogramBin, layer.histogramBegin, layer.histogramEnd); - h->loadData(); - } - } - else if(style == Graph::Pie) - { - QwtPieCurve *p = (QwtPieCurve*)graph->curve(c); - cl.lStyle = lineStyles[(Origin::GraphCurve::LineStyle)linestyle]; - p->setPen(QPen(cl.lCol, cl.lWidth, (Qt::PenStyle)cl.lStyle)); - if(_curve.fillAreaColor.type == Origin::Color::Increment) - p->setFirstColor(_curve.fillAreaColor.starting); - //geometry - p->setRadius(_curve.pie.radius); - p->setThickness(_curve.pie.thickness); - p->setViewAngle(_curve.pie.viewAngle); - p->setStartAzimuth(_curve.pie.rotation); - p->setCounterClockwise(_curve.pie.clockwiseRotation); - p->setHorizontalOffset(_curve.pie.horizontalOffset); - //labels - p->setLabelsEdgeDistance(_curve.pie.distance); - p->setLabelsAutoFormat(_curve.pie.formatAutomatic); - p->setLabelPercentagesFormat(_curve.pie.formatPercentages); - p->setLabelValuesFormat(_curve.pie.formatValues); - p->setLabelCategories(_curve.pie.formatCategories); - p->setFixedLabelsPosition(_curve.pie.positionAssociate); - - graph->setFrame(0); - } - else if(style == Graph::VectXYXY || style == Graph::VectXYAM) - { - graph->updateVectorsLayout(c, cl.symCol, ceil(_curve.vector.width), - floor(_curve.vector.arrowLenght*fVectorArrowScaleFactor + 0.5), _curve.vector.arrowAngle, _curve.vector.arrowClosed, _curve.vector.position); - } - - switch(_curve.lineConnect) - { - case Origin::GraphCurve::NoLine: - graph->setCurveStyle(c, QwtPlotCurve::NoCurve); - break; - case Origin::GraphCurve::Straight: - graph->setCurveStyle(c, QwtPlotCurve::Lines); - break; - case Origin::GraphCurve::BSpline: - case Origin::GraphCurve::Bezier: - case Origin::GraphCurve::Spline: - graph->setCurveStyle(c, 5); - break; - case Origin::GraphCurve::StepHorizontal: - case Origin::GraphCurve::StepHCenter: - graph->setCurveStyle(c, QwtPlotCurve::Steps); - break; - case Origin::GraphCurve::StepVertical: - case Origin::GraphCurve::StepVCenter: - graph->setCurveStyle(c, 6); - break; - } - - } - catch(...) - { - } - } - if(style == Graph::HorizontalBars) - { - graph->setScale(0,layer.xAxis.min,layer.xAxis.max,layer.xAxis.step,layer.xAxis.majorTicks,layer.xAxis.minorTicks,layer.xAxis.scale); - graph->setScale(2,layer.yAxis.min,layer.yAxis.max,layer.yAxis.step,layer.yAxis.majorTicks,layer.yAxis.minorTicks,layer.yAxis.scale); - } - else if(style != Graph::Box) - { - Origin::GraphAxisBreak breakX = layer.xAxisBreak; - Origin::GraphAxisBreak breakY = layer.yAxisBreak; - if(breakX.show) - graph->setScale(2,layer.xAxis.min,layer.xAxis.max,layer.xAxis.step,layer.xAxis.majorTicks,layer.xAxis.minorTicks,layer.xAxis.scale, - false, - breakX.from, breakX.to, - breakX.position, - breakX.scaleIncrementBefore, breakX.scaleIncrementAfter, - breakX.minorTicksBefore, breakX.minorTicksAfter, breakX.log10); - else - graph->setScale(2,layer.xAxis.min,layer.xAxis.max,layer.xAxis.step,layer.xAxis.majorTicks,layer.xAxis.minorTicks,layer.xAxis.scale); - - if(breakY.show) - graph->setScale(0,layer.yAxis.min,layer.yAxis.max,layer.yAxis.step,layer.yAxis.majorTicks,layer.yAxis.minorTicks,layer.xAxis.scale, //??xAxis?? - false, - breakY.from, breakY.to, - breakY.position, - breakY.scaleIncrementBefore, breakY.scaleIncrementAfter, - breakY.minorTicksBefore, breakY.minorTicksAfter, breakY.log10); - else - graph->setScale(0,layer.yAxis.min,layer.yAxis.max,layer.yAxis.step,layer.yAxis.majorTicks,layer.yAxis.minorTicks,layer.yAxis.scale); - } - - //grid - Grid *grid = graph->grid(); - grid->enableX(!layer.xAxis.majorGrid.hidden); - grid->enableXMin(!layer.xAxis.minorGrid.hidden); - grid->enableY(!layer.yAxis.majorGrid.hidden); - grid->enableYMin(!layer.yAxis.minorGrid.hidden); - - grid->setMajPenX(QPen(ColorBox::color(layer.xAxis.majorGrid.color), ceil(layer.xAxis.majorGrid.width), - lineStyles[(Origin::GraphCurve::LineStyle)layer.xAxis.majorGrid.style])); - grid->setMinPenX(QPen(ColorBox::color(layer.xAxis.minorGrid.color), ceil(layer.xAxis.minorGrid.width), - lineStyles[(Origin::GraphCurve::LineStyle)layer.xAxis.minorGrid.style])); - grid->setMajPenY(QPen(ColorBox::color(layer.yAxis.majorGrid.color), ceil(layer.yAxis.majorGrid.width), - lineStyles[(Origin::GraphCurve::LineStyle)layer.yAxis.majorGrid.style])); - grid->setMinPenY(QPen(ColorBox::color(layer.yAxis.minorGrid.color), ceil(layer.yAxis.minorGrid.width), - lineStyles[(Origin::GraphCurve::LineStyle)layer.yAxis.minorGrid.style])); - - grid->setAxis(2, 0); - grid->enableZeroLineX(0); - grid->enableZeroLineY(0); - - vector formats; - formats.push_back(layer.yAxis.formatAxis[0]); //bottom - formats.push_back(layer.yAxis.formatAxis[1]); //top - formats.push_back(layer.xAxis.formatAxis[0]); //left - formats.push_back(layer.xAxis.formatAxis[1]); //right - - vector ticks; - ticks.push_back(layer.yAxis.tickAxis[0]); //bottom - ticks.push_back(layer.yAxis.tickAxis[1]); //top - ticks.push_back(layer.xAxis.tickAxis[0]); //left - ticks.push_back(layer.xAxis.tickAxis[1]); //right - - for(int i = 0; i < 4; ++i) - { - QString data(ticks[i].dataName.c_str()); - QString tableName=data.right(data.length()-2) + "_" + ticks[i].columnName.c_str(); - - QString formatInfo; - int format = 0; - int type = 0; - int prec = ticks[i].decimalPlaces; - int precisionNeeded = 0; - if(prec == -1) - { - foreach(double value, graph->axisScaleDiv(i)->ticks(QwtScaleDiv::MajorTick)) - { - QStringList decimals = QString::number(value).split("."); - if(decimals.size() > 1) - { - int p = decimals[1].length(); - if(p > precisionNeeded) - precisionNeeded = p; - } - } - } - switch(ticks[i].valueType) - { - case Origin::Numeric: - type = ScaleDraw::Numeric; - switch(ticks[i].valueTypeSpecification) - { - case 0: //Decimal 1000 - case 3: //Decimal 1,000 - format = 1; - prec = (prec != -1 ? prec : precisionNeeded); - break; - case 1: //Scientific - format=2; - break; - case 2: //Engeneering - format=0; - break; - } - if(prec == -1) - prec = 2; - break; - case Origin::Text: //Text - type=ScaleDraw::Text; - break; - case 2: // Date - type=ScaleDraw::Date; - break; - case 3: // Time - type=ScaleDraw::Time; - break; - case Origin::Month: // Month - type=ScaleDraw::Month; - format=ticks[i].valueTypeSpecification; - break; - case Origin::Day: // Day - type=ScaleDraw::Day; - format=ticks[i].valueTypeSpecification; - break; - case Origin::ColumnHeading: - type=ScaleDraw::ColHeader; - switch(ticks[i].valueTypeSpecification) - { - case 0: //Decimal 1000 - format=1; - break; - case 1: //Scientific - format=2; - break; - case 2: //Engeneering - case 3: //Decimal 1,000 - format=0; - break; - } - prec=2; - break; - default: - type=ScaleDraw::Numeric; - format=0; - prec=2; - } - - graph->showAxis(i, type, tableName, mw->table(tableName), !(formats[i].hidden), - tickTypeMap[formats[i].majorTicksType], tickTypeMap[formats[i].minorTicksType], - !(ticks[i].hidden), ColorBox::color(formats[i].color), format, prec, - -ticks[i].rotation, 0, "", (ticks[i].color==0xF7 ? ColorBox::color(formats[i].color) : ColorBox::color(ticks[i].color))); - - QFont fnt = graph->axisTitleFont(i); - int fontSize = 0; - switch(i) - { - case 0: - case 1: - fontSize = layer.yAxis.label.fontSize; - break; - case 2: - case 3: - fontSize = layer.xAxis.label.fontSize; - break; - } - if(fontSize > 0) - { - fnt.setPointSize(floor(fontSize*fFontScaleFactor + 0.5)); - fnt.setBold(false); - graph->setAxisTitleFont(i, fnt); - } - - fnt = graph->axisFont(i); - fnt.setPointSize(floor(ticks[i].fontSize*fFontScaleFactor + 0.5)); - graph->setAxisFont(i, fnt); - } - - graph->setAutoscaleFonts(true); - - int nXDelta = graph->width() - graph->canvas()->width(); - int nYDelta = graph->height() - graph->canvas()->height(); - QPoint posCanvas = graph->canvas()->pos(); - - graph->resize(layerRect.width()*fScale + nXDelta, layerRect.height()*fScale + nYDelta); - graph->updateLayout(); - graph->updateCurveLabels(); - - //int newXGraphPos = layerRect.left*fScale - posCanvas.x() - ml->x(); - //int newYGraphPos = layerRect.top*fScale - posCanvas.y() - yOffset - ml->y(); - //graph->move((newXGraphPos > 0 ? newXGraphPos : 0), (newYGraphPos > 0 ? newYGraphPos : 0)); - graph->move(layerRect.left*fScale - posCanvas.x(), layerRect.top*fScale - posCanvas.y() - yOffset); - - if(!layer.legend.text.empty()) - { - addText(layer.legend, graph, fFontScaleFactor, fScale); - } - //add texts - if(style != Graph::Pie) - { - for(unsigned int i = 0; i < layer.texts.size(); ++i) - { - addText(layer.texts[i], graph, fFontScaleFactor, fScale); - } - } - - for(unsigned int i = 0; i < layer.lines.size(); ++i) - { - ArrowMarker mrk; - mrk.setStartPoint(layer.lines[i].begin.x, layer.lines[i].begin.y); - mrk.setEndPoint(layer.lines[i].end.x, layer.lines[i].end.y); - mrk.drawStartArrow(layer.lines[i].begin.shapeType > 0); - mrk.drawEndArrow(layer.lines[i].end.shapeType > 0); - mrk.setHeadLength(layer.lines[i].end.shapeLength); - mrk.setHeadAngle(arrowAngle(layer.lines[i].end.shapeLength, layer.lines[i].end.shapeWidth)); - mrk.setColor(originToQtColor(layer.lines[i].color)); - mrk.setWidth((int)layer.lines[i].width); - mrk.setStyle(lineStyles[(Origin::GraphCurve::LineStyle)layer.lines[i].style]); - graph->addArrow(&mrk); - } - - for(unsigned int i = 0; i < layer.figures.size(); ++i) - { - FrameWidget* fw; - switch(layer.figures[i].type) - { - case Origin::Figure::Rectangle: - fw = new RectangleWidget(graph); - break; - case Origin::Figure::Circle: - fw = new EllipseWidget(graph); - break; - } - - fw->setSize(layer.figures[i].clientRect.width()*fScale, layer.figures[i].clientRect.height()*fScale); - fw->move(QPoint(layer.figures[i].clientRect.left*fScale, layer.figures[i].clientRect.top*fScale - yOffset)); - fw->setFrameColor(originToQtColor(layer.figures[i].color)); - fw->setFrameWidth(layer.figures[i].width); - fw->setFrameLineStyle(lineStyles[(Origin::GraphCurve::LineStyle)layer.figures[i].style]); - fw->setBackgroundColor(originToQtColor(layer.figures[i].fillAreaColor)); - fw->setBrush(QBrush(originToQtColor(layer.figures[i].useBorderColor ? layer.figures[i].color : layer.figures[i].fillAreaPatternColor), PatternBox::brushStyle(patternStyles[(Origin::FillPattern)layer.figures[i].fillAreaPattern]))); - graph->add(fw, false); - } - - for(unsigned int i = 0; i < layer.bitmaps.size(); ++i) - { - QPixmap bmp; - bmp.loadFromData(layer.bitmaps[i].data, layer.bitmaps[i].size, "BMP"); - QTemporaryFile file; - file.setFileTemplate(QDir::tempPath() + "/XXXXXX.bmp"); - if(file.open()) - { - bmp.save(file.fileName(), "BMP"); - ImageWidget* mrk = graph->addImage(file.fileName()); - mrk->setRect(layer.bitmaps[i].clientRect.left*fScale, layer.bitmaps[i].clientRect.top*fScale - yOffset, layer.bitmaps[i].clientRect.width()*fScale, layer.bitmaps[i].clientRect.height()*fScale); - } - } - } - - //ml->resize(graphWindowRect.width() - frameWidth, graphWindowRect.height() - frameWidth); - //cascade the graphs - if(ml->numLayers() > 0) - { - if(!_graph.hidden) - { - ml->move(QPoint(graphWindowRect.left, graphWindowRect.top)); - - switch(_graph.state) - { - case Origin::Window::Minimized: - mw->minimizeWindow(ml); - break; - case Origin::Window::Maximized: - ml->show(); // to correct scaling with maximize - mw->maximizeWindow(ml); - break; - default: - ml->setScaleLayersOnResize(false); - ml->show(); - ml->setScaleLayersOnResize(true); - } - } - else - { - ml->show(); - //ml->arrangeLayers(true,true); - mw->hideWindow(ml); - } - } - else - { - ml->askOnCloseEvent(false); - ml->close(); - } - } - - return true; -} - -bool ImportOPJ::importGraph3D(const OriginFile& opj, unsigned int g, unsigned int l) -{ - static QVector xAxes, yAxes, zAxes; - xAxes << Qwt3D::X1 << Qwt3D::X2 << Qwt3D::X3 << Qwt3D::X4; - yAxes << Qwt3D::Y1 << Qwt3D::Y2 << Qwt3D::Y3 << Qwt3D::Y4; - zAxes << Qwt3D::Z1 << Qwt3D::Z2 << Qwt3D::Z3 << Qwt3D::Z4; - - int auto_color = -1; - int type = 0; - Origin::Graph _graph = opj.graph(g); - Origin::GraphLayer& layer = _graph.layers[l]; - for(unsigned int c = 0; c < layer.curves.size(); ++c){ - Origin::GraphCurve& _curve = layer.curves[c]; - QString data(_curve.dataName.c_str()); - int color = 0; - double fFontScaleFactor = 1.0; - switch(_curve.type) - { - case Origin::GraphCurve::Line3D: - type = _curve.connectSymbols ? Graph3D::Trajectory : Graph3D::Scatter; - break; - /*case Origin::GraphCurve::Column: - type = Graph3D::Bars; - break;*/ - case Origin::GraphCurve::Mesh3D: - fFontScaleFactor = 2.0; - break; - default: - continue; - } - - Graph3D *plot = mw->newPlot3D(); - if (!plot) - return false; - - plot->setName(_graph.name.c_str()); - plot->setWindowLabel(_graph.label.c_str()); - - plot->setCaptionPolicy((MdiSubWindow::CaptionPolicy)_graph.title); - plot->setBirthDate(posixTimeToString(_graph.creationDate)); - plot->hide();//!hack used in order to avoid resize and repaint events - - Origin::Rect graphRect(_graph.width, _graph.height); - Origin::Rect graphWindowRect = _graph.frameRect; - { - double ratio = (double)(graphWindowRect.width() - frameWidth)/(double)(graphWindowRect.height() - frameHeight); - int width = _graph.width; - int height = _graph.height; - if((double)(_graph.width)/(double)(_graph.height) < ratio) - { - width = height * ratio; - } - else - { - height = width / ratio; - } - - //plot->resize(graphWindowRect.width(), graphWindowRect.height()); - - double fScale = (double)(graphWindowRect.width() - frameWidth)/(double)width; - fFontScaleFactor *= 100*fScale/72*1.3; //Ion: empirically decresed if from 300*... - } - - Origin::Rect layerRect = layer.clientRect; - - plot->setXAxisLabel(parseOriginText(QString::fromLocal8Bit(layer.xAxis.label.text.c_str()))); - plot->setYAxisLabel(parseOriginText(QString::fromLocal8Bit(layer.yAxis.label.text.c_str()))); - plot->setZAxisLabel(parseOriginText(QString::fromLocal8Bit(layer.zAxis.label.text.c_str()))); - - QFont font = plot->xAxisLabelFont(); - font.setPointSize(floor(layer.xAxis.label.fontSize*fFontScaleFactor + 0.5)); - plot->setXAxisLabelFont(font); - font.setPointSize(floor(layer.yAxis.label.fontSize*fFontScaleFactor + 0.5)); - plot->setYAxisLabelFont(font); - font.setPointSize(floor(layer.zAxis.label.fontSize*fFontScaleFactor + 0.5)); - plot->setZAxisLabelFont(font); - - double majorTickLength = layer.xAxis.formatAxis[(layer.xAxis.position == Origin::GraphAxis::Bottom ? 0 : 1)].majorTickLength; - plot->setXAxisTickLength(majorTickLength, majorTickLength*0.6); - majorTickLength = layer.yAxis.formatAxis[(layer.yAxis.position == Origin::GraphAxis::Left ? 0 : 1)].majorTickLength; - plot->setYAxisTickLength(majorTickLength, majorTickLength*0.6); - majorTickLength = layer.zAxis.formatAxis[(layer.zAxis.position == Origin::GraphAxis::Front ? 0 : 1)].majorTickLength; - plot->setZAxisTickLength(majorTickLength, majorTickLength*0.6); - - if(layer.backgroundColor.type != Origin::Color::None) - plot->setBackgroundColor(originToQtColor(layer.backgroundColor)); - - plot->coordinateSystem()->setGridLines(true, true, Qwt3D::LEFT | Qwt3D::FLOOR | Qwt3D::BACK); - - RGBA axisColor = Qt2GL(ColorBox::color(layer.xAxis.formatAxis[(layer.xAxis.position == Origin::GraphAxis::Bottom ? 0 : 1)].color)); - RGBA numberColor = layer.xAxis.tickAxis[(layer.xAxis.position == Origin::GraphAxis::Bottom ? 0 : 1)].color == 0xF7 ? axisColor : Qt2GL(ColorBox::color(layer.xAxis.tickAxis[(layer.xAxis.position == Origin::GraphAxis::Bottom ? 0 : 1)].color)); - RGBA labelColor = Qt2GL(originToQtColor(layer.xAxis.label.color)); - Qwt3D::GridLine majorGrid(!layer.xAxis.majorGrid.hidden, Qt2GL(ColorBox::color(layer.xAxis.majorGrid.color)), line3DStyles[(Origin::GraphCurve::LineStyle)layer.xAxis.majorGrid.style], layer.xAxis.majorGrid.width); - Qwt3D::GridLine minorGrid(!layer.xAxis.majorGrid.hidden, Qt2GL(ColorBox::color(layer.xAxis.majorGrid.color)), line3DStyles[(Origin::GraphCurve::LineStyle)layer.xAxis.majorGrid.style], layer.xAxis.majorGrid.width); - double width = layer.xAxis.formatAxis[(layer.xAxis.position == Origin::GraphAxis::Bottom ? 0 : 1)].thickness; - font = plot->numbersFont(); - font.setBold(layer.xAxis.tickAxis[(layer.xAxis.position == Origin::GraphAxis::Bottom ? 0 : 1)].fontBold); - font.setPointSize(floor(layer.xAxis.tickAxis[(layer.xAxis.position == Origin::GraphAxis::Bottom ? 0 : 1)].fontSize*fFontScaleFactor + 0.5)); - foreach(Qwt3D::AXIS axis, xAxes) - { - plot->coordinateSystem()->axes[axis].setColor(axisColor); - plot->coordinateSystem()->axes[axis].setNumberColor(numberColor); - plot->coordinateSystem()->axes[axis].setLabelColor(labelColor); - plot->coordinateSystem()->setMajorGridLines(axis, majorGrid); - plot->coordinateSystem()->setMinorGridLines(axis, minorGrid); - plot->coordinateSystem()->axes[axis].setLineWidth(width); - plot->setNumbersFont(font); - } - - axisColor = Qt2GL(ColorBox::color(layer.yAxis.formatAxis[(layer.yAxis.position == Origin::GraphAxis::Left ? 0 : 1)].color)); - numberColor = layer.yAxis.tickAxis[(layer.yAxis.position == Origin::GraphAxis::Left ? 0 : 1)].color == 0xF7 ? axisColor : Qt2GL(ColorBox::color(layer.yAxis.tickAxis[(layer.yAxis.position == Origin::GraphAxis::Left ? 0 : 1)].color)); - labelColor = Qt2GL(originToQtColor(layer.yAxis.label.color)); - majorGrid = Qwt3D::GridLine(!layer.yAxis.majorGrid.hidden, Qt2GL(ColorBox::color(layer.yAxis.majorGrid.color)), line3DStyles[(Origin::GraphCurve::LineStyle)layer.yAxis.majorGrid.style], layer.yAxis.majorGrid.width); - minorGrid = Qwt3D::GridLine(!layer.yAxis.minorGrid.hidden, Qt2GL(ColorBox::color(layer.yAxis.minorGrid.color)), line3DStyles[(Origin::GraphCurve::LineStyle)layer.yAxis.minorGrid.style], layer.yAxis.minorGrid.width); - width = layer.yAxis.formatAxis[(layer.yAxis.position == Origin::GraphAxis::Left ? 0 : 1)].thickness; - font.setBold(layer.yAxis.tickAxis[(layer.yAxis.position == Origin::GraphAxis::Left ? 0 : 1)].fontBold); - font.setPointSize(floor(layer.yAxis.tickAxis[(layer.yAxis.position == Origin::GraphAxis::Left ? 0 : 1)].fontSize*fFontScaleFactor + 0.5)); - foreach(Qwt3D::AXIS axis, yAxes) - { - plot->coordinateSystem()->axes[axis].setColor(axisColor); - plot->coordinateSystem()->axes[axis].setNumberColor(numberColor); - plot->coordinateSystem()->axes[axis].setLabelColor(labelColor); - plot->coordinateSystem()->setMajorGridLines(axis, majorGrid); - plot->coordinateSystem()->setMinorGridLines(axis, minorGrid); - plot->coordinateSystem()->axes[axis].setLineWidth(width); - plot->setNumbersFont(font); - } - - axisColor = Qt2GL(ColorBox::color(layer.zAxis.formatAxis[(layer.zAxis.position == Origin::GraphAxis::Front ? 0 : 1)].color)); - numberColor = layer.zAxis.tickAxis[(layer.zAxis.position == Origin::GraphAxis::Front ? 0 : 1)].color == 0xF7 ? axisColor : Qt2GL(ColorBox::color(layer.zAxis.tickAxis[(layer.zAxis.position == Origin::GraphAxis::Front ? 0 : 1)].color)); - labelColor = Qt2GL(originToQtColor(layer.zAxis.label.color)); - majorGrid = Qwt3D::GridLine(!layer.zAxis.majorGrid.hidden, Qt2GL(ColorBox::color(layer.zAxis.majorGrid.color)), line3DStyles[(Origin::GraphCurve::LineStyle)layer.zAxis.majorGrid.style], layer.zAxis.majorGrid.width); - minorGrid = Qwt3D::GridLine(!layer.zAxis.minorGrid.hidden, Qt2GL(ColorBox::color(layer.zAxis.minorGrid.color)), line3DStyles[(Origin::GraphCurve::LineStyle)layer.zAxis.minorGrid.style], layer.zAxis.minorGrid.width); - width = layer.zAxis.formatAxis[(layer.zAxis.position == Origin::GraphAxis::Front ? 0 : 1)].thickness; - font.setBold(layer.zAxis.tickAxis[(layer.zAxis.position == Origin::GraphAxis::Front ? 0 : 1)].fontBold); - font.setPointSize(floor(layer.zAxis.tickAxis[(layer.zAxis.position == Origin::GraphAxis::Front ? 0 : 1)].fontSize*fFontScaleFactor + 0.5)); - foreach(Qwt3D::AXIS axis, zAxes) - { - plot->coordinateSystem()->axes[axis].setColor(axisColor); - plot->coordinateSystem()->axes[axis].setNumberColor(numberColor); - plot->coordinateSystem()->axes[axis].setLabelColor(labelColor); - plot->coordinateSystem()->setMajorGridLines(axis, majorGrid); - plot->coordinateSystem()->setMinorGridLines(axis, minorGrid); - plot->coordinateSystem()->axes[axis].setLineWidth(width); - plot->setNumbersFont(font); - } - - QStringList formulas; - double start, end; - - plot->showColorLegend(false); - plot->setFramed(); - - QColor clr = (_curve.symbolColor.type == Origin::Color::Automatic ? ColorBox::color(++auto_color) : originToQtColor(_curve.symbolColor)); - plot->setDataColors(clr, clr); - - bool smooth; - switch(_curve.symbolType&0xFF) - { - case 2: //Ellipse - case 20://Sphere - smooth = true; - break; - default: - smooth = false; - } - plot->setDotOptions(ceil(_curve.symbolSize), smooth); - plot->setMeshColor(_curve.lineColor.type == Origin::Color::Automatic ? ColorBox::color(0) : originToQtColor(_curve.lineColor)); - plot->setMeshLineWidth(_curve.lineWidth); - - switch(data[0].toAscii()) - { - case 'T': - { - Table* table = mw->table(data.right(data.length()-2)); - plot->addData(table, table->colIndex(_curve.xColumnName.c_str()), table->colIndex(_curve.yColumnName.c_str()), table->colIndex(_curve.zColumnName.c_str()), type); - } - break; - case 'M': - { - Matrix* matrix = mw->matrix(data.right(data.length()-2)); - plot->addMatrixData(matrix); - switch(_curve.surface.type) - { - case Origin::SurfaceProperties::ColorMap3D: - { - if(_curve.surface.surface.fill && _curve.surface.grids != Origin::SurfaceProperties::None) - plot->customPlotStyle(Qwt3D::FILLEDMESH); - else if(_curve.surface.surface.fill) - plot->customPlotStyle(Qwt3D::FILLED); - else if(_curve.surface.grids != Origin::SurfaceProperties::None) - plot->customPlotStyle(Qwt3D::WIREFRAME); - - ColorVector colors; - for(Origin::ColorMapVector::const_iterator it = _curve.surface.colorMap.levels.begin() + 1; it != _curve.surface.colorMap.levels.end(); ++it) - { - colors.push_back(Qt2GL(originToQtColor(it->second.fillColor))); - } - plot->setDataColorMap(colors, qwtColorMap(_curve.surface.colorMap)); - - if(_curve.surface.bottomContour.fill) - plot->setFloorData(); - else if(_curve.surface.bottomContour.contour) - plot->setFloorIsolines(); - } - break; - case Origin::SurfaceProperties::ColorFill: - { - if(_curve.surface.grids != Origin::SurfaceProperties::None) - plot->customPlotStyle(Qwt3D::FILLEDMESH); - else - plot->customPlotStyle(Qwt3D::FILLED); - - QColor color = originToQtColor(_curve.surface.frontColor); - plot->setDataColorMap(QwtLinearColorMap(color, color)); - } - break; - case Origin::SurfaceProperties::WireFrame: - { - if(_curve.surface.grids != Origin::SurfaceProperties::None) - plot->customPlotStyle(Qwt3D::WIREFRAME); - else - plot->customPlotStyle(Qwt3D::HIDDENLINE); - } - break; - case Origin::SurfaceProperties::Bars: - { - plot->customPlotStyle(Qwt3D::USER); - ColorVector colors; - for(Origin::ColorMapVector::const_iterator it = _curve.surface.colorMap.levels.begin() + 1; it != _curve.surface.colorMap.levels.end(); ++it) - { - colors.push_back(Qt2GL(originToQtColor(it->second.fillColor))); - } - plot->setDataColorMap(colors, qwtColorMap(_curve.surface.colorMap)); - } - break; - default: - break; - } - - plot->setMeshColor(originToQtColor(_curve.surface.gridColor)); - plot->setMeshLineWidth(_curve.surface.gridLineWidth); - } - break; - default: - continue; - } - - /*if(_curve.connectSymbols) - plot->setWireframeStyle(); - else - plot->setDotStyle();*/ - //plot->setScales(layer.xAxis.min, layer.xAxis.max, layer.yAxis.min, layer.yAxis.max, layer.zAxis.min, layer.zAxis.max); - plot->setScale(0, layer.xAxis.min, layer.xAxis.max, layer.xAxis.majorTicks, layer.xAxis.minorTicks, scaleTypes[(Origin::GraphAxis::Scale)layer.xAxis.scale]); - plot->setScale(1, layer.yAxis.min, layer.yAxis.max, layer.yAxis.majorTicks, layer.yAxis.minorTicks, scaleTypes[(Origin::GraphAxis::Scale)layer.yAxis.scale]); - plot->setScale(2, layer.zAxis.min, layer.zAxis.max, layer.zAxis.majorTicks, layer.zAxis.minorTicks, scaleTypes[(Origin::GraphAxis::Scale)layer.zAxis.scale]); - - if(!_graph.hidden){ - plot->move(QPoint(graphWindowRect.left, graphWindowRect.top)); - - switch(_graph.state) - { - case Origin::Window::Minimized: - mw->minimizeWindow(plot); - break; - case Origin::Window::Maximized: - plot->show(); // to correct scaling with maximize - mw->maximizeWindow(plot); - break; - default: - plot->show(); - } - } else { - plot->show(); - mw->hideWindow(plot); - } - } - - return true; -} - - -void ImportOPJ::addText(const Origin::TextBox& text, Graph* graph, double fFontScaleFactor, double fScale) -{ - int bkg; - switch(text.borderType) - { - case Origin::BlackLine: - bkg = 1; - break; - case Origin::Shadow: - case Origin::DarkMarble: - bkg = 2; - break; - default: - bkg = 0; - break; - } - - LegendWidget* txt=graph->newLegend(parseOriginText(QString::fromLocal8Bit(text.text.c_str()))); - - QFont font(mw->plotLegendFont); - font.setPointSize(floor(text.fontSize*fFontScaleFactor + 0.5)); - txt->setAngle(text.rotation); - txt->setTextColor(originToQtColor(text.color)); - txt->setFont(font); - txt->setFrameStyle(bkg); - - //Origin::Rect txtRect=_text.clientRect; - //int x=(txtRect.left>layerRect.left ? txtRect.left-layerRect.left : 0); - //int y=(txtRect.top>layerRect.top ? txtRect.top-layerRect.top : 0); - //txt->move(QPoint((_text.clientRect.left+_text.clientRect.width()/2)*fScale - txt->width()/2, (_text.clientRect.top+_text.clientRect.height()/2)*fScale - LayerButton::btnSize() - txt->height()/2)); - //txt->setRect(_text.clientRect.left*fScale, _text.clientRect.top*fScale - LayerButton::btnSize(), _text.clientRect.width()*fScale, _text.clientRect.height()*fScale); - txt->move(QPoint(text.clientRect.left*fScale, text.clientRect.top*fScale - LayerButton::btnSize())); -} - -QString ImportOPJ::parseOriginText(const QString &str) -{ - QStringList lines=str.split("\n"); - QString text=""; - for(int i=0; i0) - text.append("\n"); - text.append(parseOriginTags(lines[i])); - } - return text; -} - -QString ImportOPJ::parseOriginTags(const QString &str) -{ - QString line=str; - //Lookbehind conditions are not supported - so need to reverse string - QRegExp rx("\\)[^\\)\\(]*\\((?!\\s*[buig\\+\\-]\\s*\\\\)"); - QRegExp rxfont("\\)[^\\)\\(]*\\((?![^\\:]*\\:f\\s*\\\\)"); - QString linerev = strreverse(line); - QString lBracket=strreverse("&lbracket;"); - QString rBracket=strreverse("&rbracket;"); - QString ltagBracket=strreverse("<agbracket;"); - QString rtagBracket=strreverse("&rtagbracket;"); - int pos1=rx.indexIn(linerev); - int pos2=rxfont.indexIn(linerev); - - while (pos1>-1 || pos2>-1) { - if(pos1==pos2) - { - QString value = rx.cap(0); - int len=value.length(); - value=rBracket+value.mid(1,len-2)+lBracket; - linerev.replace(pos1, len, value); - } - else if ((pos1>pos2&&pos2!=-1)||pos1==-1) - { - QString value = rxfont.cap(0); - int len=value.length(); - value=rtagBracket+value.mid(1,len-2)+ltagBracket; - linerev.replace(pos2, len, value); - } - else if ((pos2>pos1&&pos1!=-1)||pos2==-1) - { - QString value = rx.cap(0); - int len=value.length(); - value=rtagBracket+value.mid(1,len-2)+ltagBracket; - linerev.replace(pos1, len, value); - } - - pos1=rx.indexIn(linerev); - pos2=rxfont.indexIn(linerev); - } - linerev.replace(ltagBracket, "("); - linerev.replace(rtagBracket, ")"); - - line = strreverse(linerev); - - //replace \b(...), \i(...), \u(...), \g(...), \+(...), \-(...), \f:font(...) tags - QString rxstr[]={ - "\\\\\\s*b\\s*\\(", - "\\\\\\s*i\\s*\\(", - "\\\\\\s*u\\s*\\(", - "\\\\\\s*g\\s*\\(", - "\\\\\\s*\\+\\s*\\(", - "\\\\\\s*\\-\\s*\\(", - "\\\\\\s*f\\:[^\\(]*\\("}; - int postag[]={0,0,0,0,0,0,0}; - QString ltag[]={"","","","","","",""}; - QString rtag[]={"","","","","","",""}; - QRegExp rxtags[7]; - for(int i=0; i<7; ++i) - rxtags[i].setPattern(rxstr[i]+"[^\\(\\)]*\\)"); - - bool flag=true; - while(flag) { - for(int i=0; i<7; ++i) - { - postag[i] = rxtags[i].indexIn(line); - while (postag[i] > -1) { - QString value = rxtags[i].cap(0); - int len=value.length(); - int pos2=value.indexOf("("); - if(i<6) - value=ltag[i]+value.mid(pos2+1,len-pos2-2)+rtag[i]; - else - { - int posfont=value.indexOf("f:"); - value=ltag[i].arg(value.mid(posfont+2,pos2-posfont-2))+value.mid(pos2+1,len-pos2-2)+rtag[i]; - } - line.replace(postag[i], len, value); - postag[i] = rxtags[i].indexIn(line); - } - } - flag=false; - for(int i=0; i<7; ++i) - { - if(rxtags[i].indexIn(line)>-1) - { - flag=true; - break; - } - } - } - - //replace unclosed tags - for(int i=0; i<6; ++i) - line.replace(QRegExp(rxstr[i]), ltag[i]); - rxfont.setPattern(rxstr[6]); - int pos = rxfont.indexIn(line); - while (pos > -1) { - QString value = rxfont.cap(0); - int len=value.length(); - int posfont=value.indexOf("f:"); - value=ltag[6].arg(value.mid(posfont+2,len-posfont-3)); - line.replace(pos, len, value); - pos = rxfont.indexIn(line); - } - - line.replace("&lbracket;", "("); - line.replace("&rbracket;", ")"); - - return line; -} - -QwtLinearColorMap ImportOPJ::qwtColorMap(const Origin::ColorMap& colorMap) -{ - Origin::ColorMapVector::const_iterator it = colorMap.levels.begin() + 1; - QColor color1 = originToQtColor(it->second.fillColor); - double level1 = it->first; - - it = colorMap.levels.end() - 1; - QColor color2 = originToQtColor(it->second.fillColor); - double level2 = it->first; - - QwtLinearColorMap qwt_color_map = QwtLinearColorMap(color1, color2); - qwt_color_map.setMode(QwtLinearColorMap::FixedColors); - - double dl = fabs(level2 - level1); - for(it = colorMap.levels.begin() + 2; it != colorMap.levels.end() - 1; ++it) - qwt_color_map.addColorStop((it->first - level1)/dl, originToQtColor(it->second.fillColor)); - return qwt_color_map; -} - -//TODO: bug in grid dialog -// scale/minor ticks checkbox -// histogram: autobin export -// if prec not setted - automac+4digits === added file 'qtiplot/src/origin/importOPJ.h' --- qtiplot/src/origin/importOPJ.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/origin/importOPJ.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,72 @@ +/*************************************************************************** + File : importOPJ.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006-2007 by Ion Vasilief, Alex Kargovsky + Email (use @ for *) : ion_vasilief*yahoo.fr, kargovsky*yumr.phys.msu.su + Description : Origin project import class + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef IMPORTOPJ_H +#define IMPORTOPJ_H + +#include "ApplicationWindow.h" +#include +#include +#include "qwt3d_types.h" +#include "qwt3d_coordsys.h" +#include + +//! Origin project import class +class ImportOPJ +{ +public: + ImportOPJ(ApplicationWindow *app, const QString& filename); + + bool createProjectTree(const OriginFile& opj); + bool importTables(const OriginFile& opj); + bool importGraphs(const OriginFile& opj); + bool importNotes(const OriginFile& opj); + bool importGraph3D(const OriginFile& opj, unsigned int graph, unsigned int layer); + int error(){return parse_error;}; + +private: + QwtSymbol::Style originToQwtSymbolStyle(unsigned char type); + QwtLinearColorMap qwtColorMap(const Origin::ColorMap& colorMap); + int arrowAngle(double length, double width){return ceil(45*atan(0.5*width/length)/atan(1.0));}; + QString parseOriginText(const QString &str); + QString parseOriginTags(const QString &str); + void addText(const Origin::TextBox& text, Graph* graph, double fFontScaleFactor, double fScale); + int parse_error; + int xoffset; + int frameWidth; + int frameHeight; + ApplicationWindow *mw; + + static QMap lineStyles; + static QMap line3DStyles; + static QMapscaleTypes; + static QMap patternStyles; + static QMap classes; +}; + +#endif //IMPORTOPJ_H === removed file 'qtiplot/src/origin/importOPJ.h' --- qtiplot/src/origin/importOPJ.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/origin/importOPJ.h 1970-01-01 00:00:00 +0000 @@ -1,69 +0,0 @@ -/*************************************************************************** - File : importOPJ.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006-2007 by Ion Vasilief, Alex Kargovsky - Email (use @ for *) : ion_vasilief*yahoo.fr, kargovsky*yumr.phys.msu.su - Description : Origin project import class - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef IMPORTOPJ_H -#define IMPORTOPJ_H - -#include "ApplicationWindow.h" -#include -#include "qwt3d_types.h" -#include "qwt3d_coordsys.h" - -//! Origin project import class -class ImportOPJ -{ -public: - ImportOPJ(ApplicationWindow *app, const QString& filename); - - bool createProjectTree(const OriginFile& opj); - bool importTables(const OriginFile& opj); - bool importGraphs(const OriginFile& opj); - bool importNotes(const OriginFile& opj); - bool importGraph3D(const OriginFile& opj, unsigned int graph, unsigned int layer); - int error(){return parse_error;}; - -private: - QwtLinearColorMap qwtColorMap(const Origin::ColorMap& colorMap); - int arrowAngle(double length, double width){return ceil(45*atan(0.5*width/length)/atan(1.0));}; - QString parseOriginText(const QString &str); - QString parseOriginTags(const QString &str); - void addText(const Origin::TextBox& text, Graph* graph, double fFontScaleFactor, double fScale); - int parse_error; - int xoffset; - int frameWidth; - int frameHeight; - ApplicationWindow *mw; - - static QMap lineStyles; - static QMap line3DStyles; - static QMap scaleTypes; - static QMap patternStyles; - static QMap classes; -}; - -#endif //IMPORTOPJ_H === added file 'qtiplot/src/origin/origin.pri' --- qtiplot/src/origin/origin.pri 1970-01-01 00:00:00 +0000 +++ qtiplot/src/origin/origin.pri 2010-07-21 23:41:22 +0000 @@ -0,0 +1,8 @@ +############################################################### +################# Origin Import (liborigin) ################### +############################################################### +INCLUDEPATH += src/origin/ /usr/include/liborigin2 + +HEADERS += src/origin/importOPJ.h + +SOURCES += src/origin/importOPJ.cpp === removed file 'qtiplot/src/origin/origin.pri' --- qtiplot/src/origin/origin.pri 2009-12-08 18:06:27 +0000 +++ qtiplot/src/origin/origin.pri 1970-01-01 00:00:00 +0000 @@ -1,17 +0,0 @@ -############################################################### -################# Origin Import (liborigin) ################### -############################################################### -INCLUDEPATH += src/origin/ - -HEADERS += src/origin/importOPJ.h -HEADERS += ../3rdparty/liborigin/OriginObj.h -HEADERS += ../3rdparty/liborigin/OriginFile.h -HEADERS += ../3rdparty/liborigin/OriginParser.h -HEADERS += ../3rdparty/liborigin/OriginDefaultParser.h -HEADERS += ../3rdparty/liborigin/Origin750Parser.h - -SOURCES += src/origin/importOPJ.cpp -SOURCES += ../3rdparty/liborigin/OriginFile.cpp -SOURCES += ../3rdparty/liborigin/OriginParser.cpp -SOURCES += ../3rdparty/liborigin/OriginDefaultParser.cpp -SOURCES += ../3rdparty/liborigin/Origin750Parser.cpp === modified file 'qtiplot/src/plot2D/BoxCurve.cpp' --- qtiplot/src/plot2D/BoxCurve.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/BoxCurve.cpp 2010-07-21 23:21:08 +0000 @@ -100,9 +100,9 @@ const QwtScaleMap &yMap, double *dat, int size) const { const int px = xMap.transform(x(0)); - const int px_min = xMap.transform(x(0) - 0.5); - const int px_max = xMap.transform(x(0) + 0.5); - const int box_width = 1+(px_max - px_min)*b_width/100; + const int px_min = xMap.transform(x(0) - 0.4); + const int px_max = xMap.transform(x(0) + 0.4); + const int box_width = 1 + (px_max - px_min)*b_width/100; const int hbw = box_width/2; const int median = yMap.transform(gsl_stats_median_from_sorted_data (dat, 1, size)); int b_lowerq, b_upperq; === modified file 'qtiplot/src/plot2D/BoxCurve.h' --- qtiplot/src/plot2D/BoxCurve.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/BoxCurve.h 2010-07-21 23:21:08 +0000 @@ -73,7 +73,7 @@ double whiskersRange(){return w_coeff;}; int whiskersRangeType(){return w_range;}; - void setWhiskersRange(int type, double coeff); + void setWhiskersRange(int type, double coeff = 0.0); void loadData(); === modified file 'qtiplot/src/plot2D/CanvasPicker.cpp' --- qtiplot/src/plot2D/CanvasPicker.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/CanvasPicker.cpp 2010-07-21 23:21:08 +0000 @@ -55,7 +55,7 @@ return false; Graph *g = plot(); - QList lines = g->linesList(); + QList lines = g->arrowsList(); switch(e->type()) { case QEvent::MouseButtonPress: @@ -109,8 +109,8 @@ { if (d_editing_marker) { return d_editing_marker->eventFilter(g->canvas(), e); - } else if (g->selectedMarker()) { - if (lines.contains(g->selectedMarker())){ + } else if (g->selectedArrow()) { + if (lines.contains(g->selectedArrow())){ emit viewLineDialog(); return true; } @@ -192,7 +192,7 @@ { int key = ((const QKeyEvent *)e)->key(); - QwtPlotMarker *selectedMarker = g->selectedMarker(); + ArrowMarker *selectedMarker = g->selectedArrow(); if (lines.contains(selectedMarker) && (key == Qt::Key_Enter || key == Qt::Key_Return)){ emit viewLineDialog(); @@ -243,25 +243,24 @@ { Graph *g = plot(); const QPoint point = e->pos(); - QList lines = g->linesList(); - foreach(QwtPlotMarker *i, lines){ - ArrowMarker* mrkL = (ArrowMarker*)i; - int d = qRound(mrkL->width() + floor(mrkL->headLength()*tan(M_PI*mrkL->headAngle()/180.0)+0.5)); - double dist = mrkL->dist(point.x(), point.y()); + QList lines = g->arrowsList(); + foreach(ArrowMarker *i, lines){ + int d = qRound(i->width() + floor(i->headLength()*tan(M_PI*i->headAngle()/180.0)+0.5)); + double dist = i->dist(point.x(), point.y()); if (dist <= d){ disableEditing(); if (e->modifiers() & Qt::ShiftModifier) { - plot()->setSelectedMarker(i, true); + plot()->setSelectedArrow(i, true); return true; } else if (e->button() == Qt::RightButton) { - mrkL->setEditable(false); - g->setSelectedMarker(i, true); + i->setEditable(false); + g->setSelectedArrow(i, true); return true; } g->deselectMarker(); - mrkL->setEditable(true); - g->setSelectedMarker(i, false); - d_editing_marker = mrkL; + i->setEditable(true); + g->setSelectedArrow(i, false); + d_editing_marker = i; return true; } } === modified file 'qtiplot/src/plot2D/DataPickerTool.cpp' --- qtiplot/src/plot2D/DataPickerTool.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/DataPickerTool.cpp 2010-07-21 23:21:08 +0000 @@ -28,12 +28,13 @@ ***************************************************************************/ #include "DataPickerTool.h" #include "Graph.h" -#include #include "FunctionCurve.h" #include "PlotCurve.h" #include "QwtErrorPlotCurve.h" #include #include +#include + #include #include @@ -62,7 +63,7 @@ d_graph->canvas()->setCursor(Qt::PointingHandCursor); } else { setSelectionFlags(QwtPicker::PointSelection | QwtPicker::ClickSelection); - d_graph->canvas()->setCursor(QCursor(QPixmap(vizor_xpm), -1, -1)); + d_graph->canvas()->setCursor(QCursor(QPixmap(":/vizor.png"), -1, -1)); } if (status_target) @@ -251,10 +252,10 @@ case Qt::Key_Plus: if (d_selected_curve) { int n_points = d_selected_curve->dataSize(); - if (ke->modifiers () == Qt::ShiftModifier) - setSelection(d_selected_curve, (d_selected_point + 10) % n_points); - else if (ke->modifiers () == Qt::NoModifier) - setSelection(d_selected_curve, (d_selected_point + 1) % n_points); + if (ke->modifiers () & Qt::ShiftModifier) + setSelection(d_selected_curve, (d_selected_point + 10) % n_points); + else + setSelection(d_selected_curve, (d_selected_point + 1) % n_points); d_graph->replot(); } else setSelection(d_graph->curve(0), 0); @@ -264,10 +265,10 @@ case Qt::Key_Minus: if (d_selected_curve) { int n_points = d_selected_curve->dataSize(); - if (ke->modifiers () == Qt::ShiftModifier) - setSelection(d_selected_curve, (d_selected_point - 10 + n_points) % n_points); - else if (ke->modifiers () == Qt::NoModifier) - setSelection(d_selected_curve, (d_selected_point - 1 + n_points) % n_points); + if (ke->modifiers () & Qt::ShiftModifier) + setSelection(d_selected_curve, (d_selected_point - 10 + n_points) % n_points); + else + setSelection(d_selected_curve, (d_selected_point - 1 + n_points) % n_points); d_graph->replot(); } else setSelection(d_graph->curve(d_graph->curveCount()-1), 0); @@ -485,49 +486,64 @@ QApplication::clipboard()->setText(text); } +void DataPickerTool::pasteSelectionAsLayerText() +{ + double x = d_selected_curve->x(d_selected_point); + double y = d_selected_curve->y(d_selected_point); + + QString text = d_app->locale().toString(x, 'G', 16) + "/" + d_app->locale().toString(y, 'G', 16); + LegendWidget *l = d_graph->newLegend(text); + l->setAttachPolicy(FrameWidget::Scales); + l->setFrameStyle(FrameWidget::None); + l->setOriginCoord(x, y); +} + void DataPickerTool::pasteSelection() { + if (!d_selected_curve) + return; + QString text = QApplication::clipboard()->text(); if (text.isEmpty()) return; - if (((PlotCurve *)d_selected_curve)->type() == Graph::Function) - return; + if (((PlotCurve *)d_selected_curve)->type() == Graph::Function) + return; - Table *t = ((DataCurve*)d_selected_curve)->table(); - if (!t) - return; + Table *t = ((DataCurve*)d_selected_curve)->table(); + if (!t) + return; QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); QTextStream ts( &text, QIODevice::ReadOnly ); - int row = ((DataCurve*)d_selected_curve)->tableRow(d_selected_point); - int col = t->colIndex(d_selected_curve->title().text()); - - int prec; char f; - t->columnNumericFormat(col, &f, &prec); - QLocale locale = d_app->locale(); - QStringList cellTexts = ts.readLine().split("\t"); - if (cellTexts.count() >= 2){ - bool numeric; - double value = locale.toDouble(cellTexts[1], &numeric); - if (numeric){ - t->setText(row, col, locale.toString(value, f, prec)); - - double x_val = d_selected_curve->x(d_selected_point); - d_selection_marker.setValue(x_val, value); - if (d_selection_marker.plot() == NULL) - d_selection_marker.attach(d_graph); - - t->notifyChanges(); - - emit statusText(QString("%1[%2]: x=%3; y=%4") - .arg(d_selected_curve->title().text()) - .arg(row + 1) - .arg(locale.toString(x_val, 'G', d_app->d_decimal_digits)) - .arg(cellTexts[1])); - } - } + int row = ((DataCurve*)d_selected_curve)->tableRow(d_selected_point); + int col = t->colIndex(d_selected_curve->title().text()); + + int prec; char f; + t->columnNumericFormat(col, &f, &prec); + QLocale locale = d_app->locale(); + QStringList cellTexts = ts.readLine().split("\t"); + if (cellTexts.count() >= 2){ + bool numeric; + double value = locale.toDouble(cellTexts[1], &numeric); + if (numeric){ + t->setText(row, col, locale.toString(value, f, prec)); + + double x_val = d_selected_curve->x(d_selected_point); + d_selection_marker.setValue(x_val, value); + if (d_selection_marker.plot() == NULL) + d_selection_marker.attach(d_graph); + + t->notifyChanges(); + + emit statusText(QString("%1[%2]: x=%3; y=%4") + .arg(d_selected_curve->title().text()) + .arg(row + 1) + .arg(locale.toString(x_val, 'G', d_app->d_decimal_digits)) + .arg(cellTexts[1])); + } + } QApplication::restoreOverrideCursor(); } === modified file 'qtiplot/src/plot2D/DataPickerTool.h' --- qtiplot/src/plot2D/DataPickerTool.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/DataPickerTool.h 2010-07-21 23:21:08 +0000 @@ -49,6 +49,7 @@ virtual bool eventFilter(QObject *obj, QEvent *event); bool keyEventFilter(QKeyEvent *ke); QwtPlotCurve *selectedCurve() const { return d_selected_curve; } + int selectedPointIndex(){return d_selected_point;}; void copySelection(); void cutSelection(); @@ -66,6 +67,11 @@ void selectTableRow(); + ApplicationWindow *applicationWindow(){return d_app;}; + + public slots: + void pasteSelectionAsLayerText(); + signals: /*! Emitted whenever a new message should be presented to the user. * === added file 'qtiplot/src/plot2D/EllipseWidget.cpp' --- qtiplot/src/plot2D/EllipseWidget.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/plot2D/EllipseWidget.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,140 @@ +/*************************************************************************** + File : EllipseWidget.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2008 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : A widget displaying ellipses/circles in 2D plots + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "EllipseWidget.h" +#include +#include +#include + +#include +#include +#include + +#include + +EllipseWidget::EllipseWidget(Graph *plot):FrameWidget(plot) +{ + setFrameStyle(Line); +} + +void EllipseWidget::clone(EllipseWidget* r) +{ + d_frame = r->frameStyle(); + setFramePen(r->framePen()); + setBackgroundColor(r->backgroundColor()); + setBrush(r->brush()); + setCoordinates(r->xValue(), r->yValue(), r->right(), r->bottom()); +} + +QString EllipseWidget::saveToString() +{ + QString s = "\n"; + s += FrameWidget::saveToString(); + QColor bc = backgroundColor(); + s += "" + bc.name() + "\n"; + s += "" + QString::number(bc.alpha()) + "\n"; + s += "" + d_brush.color().name() + "\n"; + s += "" + QString::number(PatternBox::patternIndex(d_brush.style())) + "\n"; + return s + "\n"; +} + +void EllipseWidget::restore(Graph *g, const QStringList& lst) +{ + double x = 0.0, y = 0.0, right = 0.0, bottom = 0.0; + QStringList::const_iterator line; + QColor backgroundColor = Qt::white; + QBrush brush = QBrush(); + EllipseWidget *r = new EllipseWidget(g); + if (!r) + return; + + for (line = lst.begin(); line != lst.end(); line++){ + QString s = *line; + if (s.contains("")) + r->setFrameStyle(s.remove("").remove("").toInt()); + else if (s.contains("")) + r->setFrameColor(QColor(s.remove("").remove(""))); + else if (s.contains("")) + r->setFrameWidth(s.remove("").remove("").toDouble()); + else if (s.contains("")) + r->setFrameLineStyle(PenStyleBox::penStyle(s.remove("").remove("").toInt())); + else if (s.contains("")) + x = s.remove("").remove("").toDouble(); + else if (s.contains("")) + y = s.remove("").remove("").toDouble(); + else if (s.contains("")) + right = s.remove("").remove("").toDouble(); + else if (s.contains("")) + bottom = s.remove("").remove("").toDouble(); + else if (s.contains("")) + r->setAttachPolicy((FrameWidget::AttachPolicy)s.remove("").remove("").toInt()); + else if (s.contains("")) + backgroundColor = QColor(s.remove("").remove("")); + else if (s.contains("")) + backgroundColor.setAlpha(s.remove("").remove("").toInt()); + else if (s.contains("")) + brush.setColor(QColor(s.remove("").remove(""))); + else if (s.contains("")) + brush.setStyle(PatternBox::brushStyle((s.remove("").remove("")).toInt())); + } + + r->setBackgroundColor(backgroundColor); + r->setBrush(brush); + r->setCoordinates(x, y, right, bottom); + g->add(r, false); +} + +void EllipseWidget::drawFrame(QPainter *p, const QRect& rect) +{ + p->save(); + if (d_plot->antialiasing()) + p->setRenderHints(QPainter::Antialiasing); + + QPainterPath ellipse; + if (d_frame == Line){ + QPen pen = QwtPainter::scaledPen(d_frame_pen); + p->setPen(pen); + + int lw = pen.width()/2; + QRect r = rect.adjusted(lw + 1, lw + 1, -lw - 1, -lw - 1); + + ellipse.addEllipse(r); + p->fillPath(ellipse, palette().color(QPalette::Window)); + if (d_brush.style() != Qt::NoBrush) + p->setBrush(d_brush); + + p->drawEllipse(r); + } else { + ellipse.addEllipse(rect); + p->fillPath(ellipse, palette().color(QPalette::Window)); + if (d_brush.style() != Qt::NoBrush) + p->fillPath(ellipse, d_brush); + } + + p->restore(); +} === removed file 'qtiplot/src/plot2D/EllipseWidget.cpp' --- qtiplot/src/plot2D/EllipseWidget.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/plot2D/EllipseWidget.cpp 1970-01-01 00:00:00 +0000 @@ -1,140 +0,0 @@ -/*************************************************************************** - File : EllipseWidget.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2008 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : A widget displaying ellipses/circles in 2D plots - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "EllipseWidget.h" -#include -#include -#include - -#include -#include -#include - -#include - -EllipseWidget::EllipseWidget(Graph *plot):FrameWidget(plot) -{ - setFrameStyle(Line); -} - -void EllipseWidget::clone(EllipseWidget* r) -{ - d_frame = r->frameStyle(); - setFramePen(r->framePen()); - setBackgroundColor(r->backgroundColor()); - setBrush(r->brush()); - setCoordinates(r->xValue(), r->yValue(), r->right(), r->bottom()); -} - -QString EllipseWidget::saveToString() -{ - QString s = "\n"; - s += FrameWidget::saveToString(); - QColor bc = backgroundColor(); - s += "" + bc.name() + "\n"; - s += "" + QString::number(bc.alpha()) + "\n"; - s += "" + d_brush.color().name() + "\n"; - s += "" + QString::number(PatternBox::patternIndex(d_brush.style())) + "\n"; - return s + "\n"; -} - -void EllipseWidget::restore(Graph *g, const QStringList& lst) -{ - double x = 0.0, y = 0.0, right = 0.0, bottom = 0.0; - QStringList::const_iterator line; - QColor backgroundColor = Qt::white; - QBrush brush = QBrush(); - EllipseWidget *r = new EllipseWidget(g); - if (!r) - return; - - for (line = lst.begin(); line != lst.end(); line++){ - QString s = *line; - if (s.contains("")) - r->setFrameStyle(s.remove("").remove("").toInt()); - else if (s.contains("")) - r->setFrameColor(QColor(s.remove("").remove(""))); - else if (s.contains("")) - r->setFrameWidth(s.remove("").remove("").toDouble()); - else if (s.contains("")) - r->setFrameLineStyle(PenStyleBox::penStyle(s.remove("").remove("").toInt())); - else if (s.contains("")) - x = s.remove("").remove("").toDouble(); - else if (s.contains("")) - y = s.remove("").remove("").toDouble(); - else if (s.contains("")) - right = s.remove("").remove("").toDouble(); - else if (s.contains("")) - bottom = s.remove("").remove("").toDouble(); - else if (s.contains("")) - r->setAttachPolicy((FrameWidget::AttachPolicy)s.remove("").remove("").toInt()); - else if (s.contains("")) - backgroundColor = QColor(s.remove("").remove("")); - else if (s.contains("")) - backgroundColor.setAlpha(s.remove("").remove("").toInt()); - else if (s.contains("")) - brush.setColor(QColor(s.remove("").remove(""))); - else if (s.contains("")) - brush.setStyle(PatternBox::brushStyle((s.remove("").remove("")).toInt())); - } - - r->setBackgroundColor(backgroundColor); - r->setBrush(brush); - r->setCoordinates(x, y, right, bottom); - g->add(r, false); -} - -void EllipseWidget::drawFrame(QPainter *p, const QRect& rect) -{ - p->save(); - if (d_plot->antialiasing()) - p->setRenderHints(QPainter::Antialiasing); - - QPainterPath ellipse; - if (d_frame == Line){ - QPen pen = QwtPainter::scaledPen(d_frame_pen); - p->setPen(pen); - - int lw = pen.width()/2; - QRect r = rect.adjusted(lw + 1, lw + 1, -lw - 1, -lw - 1); - - ellipse.addEllipse(r); - p->fillPath(ellipse, palette().color(QPalette::Window)); - if (d_brush.style() != Qt::NoBrush) - p->setBrush(d_brush); - - p->drawEllipse(r); - } else { - ellipse.addEllipse(rect); - p->fillPath(ellipse, palette().color(QPalette::Window)); - if (d_brush.style() != Qt::NoBrush) - p->fillPath(ellipse, d_brush); - } - - p->restore(); -} === added file 'qtiplot/src/plot2D/EllipseWidget.h' --- qtiplot/src/plot2D/EllipseWidget.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/plot2D/EllipseWidget.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,50 @@ +/*************************************************************************** + File : RectangleWidget.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2008 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : A widget displaying ellipses/circles in 2D plots + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef ELLIPSE_WIDGET_H +#define ELLIPSE_WIDGET_H + +#include "FrameWidget.h" + +class EllipseWidget: public FrameWidget +{ + Q_OBJECT + +public: + EllipseWidget(Graph *); + + virtual QString saveToString(); + + void clone(EllipseWidget* t); + static void restore(Graph *g, const QStringList& lst); + +private: + void drawFrame(QPainter *p, const QRect& rect); +}; + +#endif === removed file 'qtiplot/src/plot2D/EllipseWidget.h' --- qtiplot/src/plot2D/EllipseWidget.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/plot2D/EllipseWidget.h 1970-01-01 00:00:00 +0000 @@ -1,50 +0,0 @@ -/*************************************************************************** - File : RectangleWidget.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2008 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : A widget displaying ellipses/circles in 2D plots - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef ELLIPSE_WIDGET_H -#define ELLIPSE_WIDGET_H - -#include "FrameWidget.h" - -class EllipseWidget: public FrameWidget -{ - Q_OBJECT - -public: - EllipseWidget(Graph *); - - virtual QString saveToString(); - - void clone(EllipseWidget* t); - static void restore(Graph *g, const QStringList& lst); - -private: - void drawFrame(QPainter *p, const QRect& rect); -}; - -#endif === modified file 'qtiplot/src/plot2D/FunctionCurve.cpp' --- qtiplot/src/plot2D/FunctionCurve.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/FunctionCurve.cpp 2010-07-21 23:21:08 +0000 @@ -31,6 +31,8 @@ #include #include +#include + #include FunctionCurve::FunctionCurve(const QString& name): @@ -144,15 +146,16 @@ c->setFormulas(formulas); c->setVariable(var); c->setConstants(constants); - c->loadData(points, logScale); c->setPlotStyle(style); g->insertCurve(c); g->setCurveStyle(g->curveIndex(c), lineStyle); QStringList l; for (line++; line != lst.end(); line++) - l << *line; + l << *line; c->restoreCurveLayout(l); + + c->loadData(points, logScale); g->updatePlot(); } @@ -174,47 +177,83 @@ return label; } -void FunctionCurve::loadData(int points, bool xLog10Scale) +bool FunctionCurve::loadData(int points, bool xLog10Scale) { if (!points) points = dataSize(); double *X = (double *)malloc(points*sizeof(double)); if (!X){ - QMessageBox::critical(0, "QtiPlot - Memory Allocation Error", - "Not enough memory, operation aborted!"); - return; + QMessageBox::critical(0, QObject::tr("QtiPlot - Memory Allocation Error"), + QObject::tr("Not enough memory, operation aborted!")); + return false; } double *Y = (double *)malloc(points*sizeof(double)); if (!Y){ - QMessageBox::critical(0, "QtiPlot - Memory Allocation Error", - "Not enough memory, operation aborted!"); + QMessageBox::critical(0, QObject::tr("QtiPlot - Memory Allocation Error"), + QObject::tr("Not enough memory, operation aborted!")); free(X); - return; + return false; } - double step = (d_to - d_from)/(double)(points - 1); - bool error = false; - + double step = (d_to - d_from)/(double)(points - 1.0); if (d_function_type == Normal){ MyParser parser; - double x; + double x = d_from; try { parser.DefineVar(d_variable.ascii(), &x); QMapIterator i(d_constants); - while (i.hasNext()){ - i.next(); + while (i.hasNext()){ + i.next(); parser.DefineConst(i.key().ascii(), i.value()); - } + } parser.SetExpr(d_formulas[0].ascii()); - X[0] = d_from; - x = d_from; + int lastButOne = points - 1; try { - Y[0] = parser.EvalRemoveSingularity(&x, false); - } catch (MyParser::Pole) { - error = true; - } + double xl = x, xr; + double y = parser.EvalRemoveSingularity(&x, false); + bool wellDefinedFunction = true; + if (!gsl_finite(y)){// try to find a first well defined point (might help for some not really bad functions) + wellDefinedFunction = false; + for (int i = 0; i < lastButOne; i++){ + xl = x; + x += step; + xr = x; + y = parser.Eval(); + if (gsl_finite(y)){ + wellDefinedFunction = true; + int iter = 0; + double x0 = x, y0 = y; + while(fabs(xr - xl)/step > 1e-15 && iter < points){ + x = 0.5*(xl + xr); + y = parser.Eval(); + if (gsl_finite(y)){ + xr = x; + x0 = x; + y0 = y; + } else + xl = x; + iter++; + } + d_from = x0; + X[0] = x0; + Y[0] = y0; + step = (d_to - d_from)/(double)(lastButOne); + break; + } + } + if (!wellDefinedFunction){ + QMessageBox::critical(0, QObject::tr("QtiPlot"), + QObject::tr("The function %1 is not defined in the specified interval!").arg(d_formulas[0])); + free(X); free(Y); + return false; + } + } else { + X[0] = d_from; + Y[0] = y; + } + } catch (MyParser::Pole) {} ScaleEngine *sc_engine = 0; if (plot()) @@ -223,29 +262,29 @@ if (xLog10Scale || (d_from > 0 && d_to > 0 && sc_engine && sc_engine->type() == ScaleTransformation::Log10)){ step = log10(d_to/d_from)/(double)(points - 1); - for (int i = 1; i < points; i++ ){ + for (int i = 1; i < lastButOne; i++ ){ x = d_from*pow(10, i*step); X[i] = x; try { Y[i] = parser.EvalRemoveSingularity(&x, false); - } catch (MyParser::Pole){ - error = true; - } + } catch (MyParser::Pole){} } } else { - for (int i = 1; i < points; i++ ){ + for (int i = 1; i < lastButOne; i++ ){ x += step; X[i] = x; try { Y[i] = parser.EvalRemoveSingularity(&x, false); - } catch (MyParser::Pole){ - error = true; - } + } catch (MyParser::Pole){} } } - } catch(mu::ParserError &e) { - error = true; - } + //the last point might be outside the interval, therefore we calculate it separately at its precise value + x = d_to; + X[lastButOne] = x; + try { + Y[lastButOne] = parser.EvalRemoveSingularity(&x, false); + } catch (MyParser::Pole){} + } catch(mu::ParserError &e) {} } else if (d_function_type == Parametric || d_function_type == Polar) { QStringList aux = d_formulas; MyParser xparser; @@ -258,6 +297,13 @@ } try { + QMapIterator i(d_constants); + while (i.hasNext()){ + i.next(); + xparser.DefineConst(i.key().ascii(), i.value()); + yparser.DefineConst(i.key().ascii(), i.value()); + } + xparser.DefineVar(d_variable.ascii(), &par); yparser.DefineVar(d_variable.ascii(), &par); xparser.SetExpr(aux[0].ascii()); @@ -268,11 +314,13 @@ Y[i] = yparser.Eval(); par += step; } - } catch(mu::ParserError &) { - error = true; - } + } catch(mu::ParserError &) {} } - setData(X, Y, points); + if (curveType() == QwtPlotCurve::Yfx) + setData(X, Y, points); + else + setData(Y, X, points); free(X); free(Y); + return true; } === modified file 'qtiplot/src/plot2D/FunctionCurve.h' --- qtiplot/src/plot2D/FunctionCurve.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/FunctionCurve.h 2010-07-21 23:21:08 +0000 @@ -68,7 +68,7 @@ //! Returns a string that can be displayed in a plot legend QString legend(); - void loadData(int points = 0, bool xLog10Scale = false); + bool loadData(int points = 0, bool xLog10Scale = false); QMap constants(){return d_constants;}; void setConstants(const QMap& map){d_constants = map;}; === modified file 'qtiplot/src/plot2D/Graph.cpp' --- qtiplot/src/plot2D/Graph.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/Graph.cpp 2010-07-21 23:21:08 +0000 @@ -2,7 +2,7 @@ File : Graph.cpp Project : QtiPlot -------------------------------------------------------------------- - Copyright : (C) 2004-2008 by Ion Vasilief + Copyright : (C) 2004-2010 by Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : Graph widget @@ -29,128 +29,7 @@ #include #include - -/* XPM */ -static char * delete_xpm[] = { -"11 12 40 1", -" c None", -". c #ECBCBC", -"+ c #BB0000", -"@ c #DD8989", -"# c #B60000", -"$ c #FFCBCB", -"% c #DB8989", -"& c #AF0000", -"* c #FF7C7C", -"= c #FFB4B4", -"- c #D88989", -"; c #BC6D6D", -"> c #A70000", -", c #FF4949", -"' c #FF9A9A", -") c #B86D6D", -"! c #9E0000", -"~ c #FF1D1D", -"{ c #FF8787", -"] c #B36D6D", -"^ c #940000", -"/ c #FF0000", -"( c #C68989", -"_ c #890000", -": c #FF7E7E", -"< c #C28989", -"[ c #7E0000", -"} c #FF7F7F", -"| c #FF0606", -"1 c #740000", -"2 c #FF8686", -"3 c #FF1C1C", -"4 c #A46D6D", -"5 c #6B0000", -"6 c #FF3434", -"7 c #9F6D6D", -"8 c #B19696", -"9 c #630000", -"0 c #9B6D6D", -"a c #CBCBCB", -".++@ @++.", -"#$$#% %#$$#", -"&**=&-&=**&", -";>,,'>',,>;", -" )!~~{~~!) ", -" ]^///^] ", -" (_:///:_( ", -"<[}||[||}[<", -"12331413321", -"56657 75665", -"8990 0998", -" aa aa "}; - -static const char *cut_xpm[]={ -"18 18 3 1", -". c None", -"# c #000000", -"a c #00007f", -"..................", -"..................", -"..................", -".......#...#......", -".......#...#......", -".......#...#......", -".......##.##......", -"........#.#.......", -"........###.......", -".........#........", -"........a#a.......", -"........a.aaa.....", -"......aaa.a..a....", -".....a..a.a..a....", -".....a..a.a..a....", -".....a..a..aa.....", -"......aa..........", -".................."}; - -static const char *copy_xpm[]={ -"15 13 4 1", -"# c None", -". c #000000", -"b c #00007f", -"a c #ffffff", -"......#########", -".aaaa..########", -".aaaa.a.#######", -".a..a.bbbbbb###", -".aaaaabaaaabb##", -".a....baaaabab#", -".aaaaaba..abbbb", -".a....baaaaaaab", -".aaaaaba.....ab", -"......baaaaaaab", -"######ba.....ab", -"######baaaaaaab", -"######bbbbbbbbb"}; - -static const char *unzoom_xpm[]={ -"18 17 2 1", -". c None", -"# c #000000", -"..................", -"...#..............", -"..###.............", -".#.#.#.......##...", -"...#.....##..##...", -"...#..##.##.......", -"...#..##....##....", -"...#........##....", -"...#...##.........", -"...#...##.##.##...", -".#.#.#....##.##...", -"..###.............", -"...#...#......#...", -"...#..#........#..", -"...##############.", -"......#........#..", -".......#......#..."}; +#include #include "Graph.h" #include "MultiLayer.h" @@ -160,7 +39,6 @@ #include "TexWidget.h" #include "LegendWidget.h" #include "ArrowMarker.h" -#include #include "ScalePicker.h" #include "TitlePicker.h" #include "QwtPieCurve.h" @@ -237,20 +115,20 @@ d_range_selector = NULL; d_peak_fit_tool = NULL; d_active_enrichment = NULL; - d_selected_marker = NULL; + d_selected_arrow = NULL; drawLineOn = false; drawArrowOn = false; drawAxesBackbone = true; d_auto_scale = true; autoScaleFonts = false; d_antialiasing = false; - d_scale_on_print = true; - d_print_cropmarks = false; d_is_printing = false; d_is_exporting_tex = false; d_tex_escape_strings = true; + d_axis_title_policy = Default; d_Douglas_Peuker_tolerance = 0; d_speed_mode_points = 3000; + d_synchronize_scales = true; d_user_step = QVector(QwtPlot::axisCnt); for (int i=0; isetEditable(false); + if (d_selected_arrow && d_lines.contains(d_selected_arrow)) + d_selected_arrow->setEditable(false); + + deselect(d_active_enrichment); + d_active_enrichment = NULL; + d_selected_arrow = NULL; + + if (d_markers_selector){ + delete d_markers_selector; + d_markers_selector = NULL; } - deselect(d_active_enrichment); - d_active_enrichment = NULL; - d_selected_marker = NULL; - if (d_markers_selector) - delete d_markers_selector; - - emit enableTextEditor(NULL); + emit enableTextEditor(NULL); cp->disableEditing(); setFocus(); @@ -426,6 +305,11 @@ return texts; } +void Graph::selectorDeleted() +{ + d_markers_selector = NULL; +} + void Graph::select(QWidget *l, bool add) { if (!l){ @@ -451,7 +335,8 @@ d_markers_selector->add(l); else { d_markers_selector = new SelectionMoveResizer(l); - connect(d_markers_selector, SIGNAL(targetsChanged()), this, SIGNAL(modifiedGraph())); + connect(d_markers_selector, SIGNAL(targetsChanged()), this, SIGNAL(modifiedGraph())); + connect(d_markers_selector, SIGNAL(destroyed(QObject*)), this, SLOT(selectorDeleted())); } } else { if (d_markers_selector) @@ -459,6 +344,7 @@ d_markers_selector = new SelectionMoveResizer(l); connect(d_markers_selector, SIGNAL(targetsChanged()), this, SIGNAL(modifiedGraph())); + connect(d_markers_selector, SIGNAL(destroyed(QObject*)), this, SLOT(selectorDeleted())); } } @@ -471,14 +357,14 @@ void Graph::deselect(QWidget *l) { - if(!l) - return; + if(!l) + return; - if (d_markers_selector && d_markers_selector->contains(l)) - d_markers_selector->removeAll(l); + if (d_markers_selector && d_markers_selector->contains(l)) + d_markers_selector->removeAll(l); } -void Graph::setSelectedMarker(QwtPlotMarker *mrk, bool add) +void Graph::setSelectedArrow(ArrowMarker *mrk, bool add) { if (!mrk) return; @@ -486,32 +372,32 @@ selectTitle(false); scalePicker->deselect(); - d_selected_marker = mrk; + d_selected_arrow = mrk; if (add){ if (d_markers_selector){ if (d_lines.contains(mrk)) - d_markers_selector->add((ArrowMarker*)mrk); + d_markers_selector->add(mrk); else return; } else { if (d_lines.contains(mrk)) - d_markers_selector = new SelectionMoveResizer((ArrowMarker*)mrk); + d_markers_selector = new SelectionMoveResizer(mrk); else return; connect(d_markers_selector, SIGNAL(targetsChanged()), this, SIGNAL(modifiedGraph())); } } else { if (d_lines.contains(mrk)){ - if (((ArrowMarker*)mrk)->editable()){ + if (mrk->editable()){ if (d_markers_selector) delete d_markers_selector; return; } - if (d_markers_selector && d_markers_selector->contains((ArrowMarker*)mrk)) + if (d_markers_selector && d_markers_selector->contains(mrk)) return; else - d_markers_selector = new SelectionMoveResizer((ArrowMarker*)mrk); + d_markers_selector = new SelectionMoveResizer(mrk); } else return; connect(d_markers_selector, SIGNAL(targetsChanged()), this, SIGNAL(modifiedGraph())); @@ -603,57 +489,83 @@ QString Graph::saveTicksType() { - QList ticksTypeList=getMajorTicksType(); - QString s="MajorTicks\t"; - for (int i=0; i<4; i++) - s+=QString::number(ticksTypeList[i])+"\t"; + QList ticksTypeList = getMajorTicksType(); + QString s = "MajorTicks"; + for (int i = 0; i < 4; i++) + s += "\t" + QString::number(ticksTypeList[i]); s += "\n"; - ticksTypeList=getMinorTicksType(); - s += "MinorTicks\t"; - for (int i=0; i<4; i++) - s+=QString::number(ticksTypeList[i])+"\t"; + ticksTypeList = getMinorTicksType(); + s += "MinorTicks"; + for (int i = 0; i < 4; i++) + s += "\t" + QString::number(ticksTypeList[i]); - return s+"\n"; + return s + "\n"; } QString Graph::saveEnabledTickLabels() { - QString s="EnabledTickLabels\t"; - for (int axis=0; axishasComponent(QwtAbstractScaleDraw::Labels))+"\t"; + s += "\t" + QString::number(sd->hasComponent(QwtAbstractScaleDraw::Labels)); } - return s+"\n"; + return s + "\n"; } QString Graph::saveLabelsFormat() { - QString s="LabelsFormat\t"; - for (int axis=0; axismargin()) + "\t"; + s += QString::number(scale->margin()) + "\t"; else - s+= "0\t"; - } - return s+"\n"; + s += "0\t"; + } + return s + "\n"; +} + +QString Graph::saveAxesBackbones() +{ + QString s = "DrawAxesBackbone\t" + QString::number(drawAxesBackbone); + for (int i = 0; i < QwtPlot::axisCnt; i++){ + const QwtScaleDraw *sd = axisScaleDraw (i); + s += "\t" + QString::number(sd->hasComponent(QwtAbstractScaleDraw::Backbone)); + } + return s + "\n"; +} + +QString Graph::saveTickLabelsSpace() +{ + QString s = "TickLabelsSpace"; + for (int i = 0; i < QwtPlot::axisCnt; i++){ + const QwtScaleDraw *sd = axisScaleDraw (i); + s += "\t" + QString::number(sd->spacing()); + } + s += "\n"; + + s += "ShowTicksPolicy"; + for (int axis = 0; axis < QwtPlot::axisCnt; axis++){ + ScaleDraw *sd = (ScaleDraw *)axisScaleDraw (axis); + s += "\t" + QString::number(sd->showTicksPolicy()); + } + return s + "\n"; } QString Graph::saveLabelsRotation() { - QString s="LabelsRotation\t"; + QString s = "LabelsRotation\t"; s+=QString::number(labelsRotation(QwtPlot::xBottom))+"\t"; s+=QString::number(labelsRotation(QwtPlot::xTop))+"\n"; return s; @@ -773,7 +685,7 @@ void Graph::showAxis(int axis, int type, const QString& formatInfo, Table *table, bool axisOn, int majTicksType, int minTicksType, bool labelsOn, const QColor& c, int format, int prec, int rotation, int baselineDist, - const QString& formula, const QColor& labelsColor) + const QString& formula, const QColor& labelsColor, int spacing, bool backbone, const ScaleDraw::ShowTicksPolicy& showTicks) { enableAxis(axis, axisOn); if (!axisOn) @@ -797,7 +709,10 @@ sd->formatString() == formatInfo && sd->formula() == formula && scale->margin() == baselineDist && - sd->hasComponent (QwtAbstractScaleDraw::Labels) == labelsOn) + sd->hasComponent(QwtAbstractScaleDraw::Labels) == labelsOn && + sd->spacing() == spacing && + sd->hasComponent(QwtAbstractScaleDraw::Backbone) == backbone && + sd->showTicksPolicy() == showTicks) return; scale->setMargin(baselineDist); @@ -836,12 +751,14 @@ } sd = (ScaleDraw *)axisScaleDraw (axis); - sd->enableComponent(QwtAbstractScaleDraw::Backbone, drawAxesBackbone); + sd->enableComponent(QwtAbstractScaleDraw::Backbone, backbone); + sd->setSpacing(spacing); + sd->setShowTicksPolicy(showTicks); setAxisTicksLength(axis, majTicksType, minTicksType, minorTickLength(), majorTickLength()); - if (axisOn && (axis == QwtPlot::xTop || axis == QwtPlot::yRight)) + if (d_synchronize_scales && axisOn && (axis == QwtPlot::xTop || axis == QwtPlot::yRight)) updateSecondaryAxis(axis);//synchronize scale divisions scalePicker->refresh(); @@ -872,6 +789,10 @@ if (type != ScaleDraw::Text && type != ScaleDraw::ColHeader) return; + ScaleDraw *sd = (ScaleDraw *)axisScaleDraw(axis); + if (sd && sd->scaleType() == type && sd->labelsList() == lst && sd->format() == name) + return; + setAxisScaleDraw(axis, new ScaleDraw(this, lst, name, (ScaleDraw::ScaleType)type)); } @@ -1166,9 +1087,68 @@ setAxisTitle(a, text); } +QString Graph::parseAxisTitle(const QString& text) +{ + QString s = text; + QString name = QString::null; + QString comment = QString::null; + if (s == "%(?Y)"){// parse Origin tag + PlotCurve *c = curve(0); + if (c){ + name = c->title().text(); + int pos = name.lastIndexOf("_"); + if (pos > 0) + name = name.right(name.length() - pos - 1); + + if (d_axis_title_policy > 1){ + DataCurve *dc = dataCurve(0); + if (dc){ + Table *t = dc->table(); + if (t) + comment = t->comment(t->colIndex(name)).trimmed().replace("\n", " "); + } + } + } else + s = tr("Y Axis Title"); + } else if (s == "%(?X)"){ + DataCurve *c = dataCurve(0); + if (c){ + name = c->xColumnName(); + int pos = name.lastIndexOf("_"); + if (pos > 0) + name = name.right(name.length() - pos - 1); + + if (d_axis_title_policy > 1){ + Table *t = c->table(); + if (t) + comment = t->comment(t->colIndex(c->xColumnName())).trimmed().replace("\n", " "); + } + } else + s = tr("X Axis Title"); + } + + switch(d_axis_title_policy){ + case ColName: + return name; + break; + case ColComment: + if (!comment.isEmpty()) + return comment; + break; + case NameAndComment: + if (!comment.isEmpty()) + name += " (" + comment + ")"; + return name; + break; + default: + break; + } + return s; +} + void Graph::setAxisTitle(int axis, const QString& text) { - ((QwtPlot *)this)->setAxisTitle(axis, text); + ((QwtPlot *)this)->setAxisTitle(axis, parseAxisTitle(text)); replot(); emit modifiedGraph(); } @@ -1223,27 +1203,27 @@ QwtDoubleInterval Graph::axisBoundingInterval(int axis) { - // Find bounding interval of the plot data + // Find bounding interval of the plot data - QwtDoubleInterval intv; - const QwtPlotItemList& itmList = itemList(); - QwtPlotItemIterator it; - for ( it = itmList.begin(); it != itmList.end(); ++it ){ - const QwtPlotItem *item = *it; - if (item->rtti() != QwtPlotItem::Rtti_PlotCurve) - continue; + QwtDoubleInterval intv; + const QwtPlotItemList& itmList = itemList(); + QwtPlotItemIterator it; + for ( it = itmList.begin(); it != itmList.end(); ++it ){ + const QwtPlotItem *item = *it; + if (item->rtti() != QwtPlotItem::Rtti_PlotCurve) + continue; if(axis != item->xAxis() && axis != item->yAxis()) - continue; - - const QwtDoubleRect rect = item->boundingRect(); - - if (axis == QwtPlot::xBottom || axis == QwtPlot::xTop) - intv |= QwtDoubleInterval(rect.left(), rect.right()); - else - intv |= QwtDoubleInterval(rect.top(), rect.bottom()); - } - return intv; + continue; + + const QwtDoubleRect rect = item->boundingRect(); + + if (axis == QwtPlot::xBottom || axis == QwtPlot::xTop) + intv |= QwtDoubleInterval(rect.left(), rect.right()); + else + intv |= QwtDoubleInterval(rect.top(), rect.bottom()); + } + return intv; } void Graph::setScale(int axis, double start, double end, double step, @@ -1286,6 +1266,11 @@ start = intv.minValue(); else end = intv.minValue(); + + if (start <= 0.0) + start = 1e-4; + if (end <= 0.0) + end = 1e-3; } int max_min_intervals = minorTicks; @@ -1307,10 +1292,10 @@ d_user_step[axis] = step; - if (axis == QwtPlot::xBottom || axis == QwtPlot::yLeft){ - updateSecondaryAxis(QwtPlot::xTop); - updateSecondaryAxis(QwtPlot::yRight); - } + if (d_synchronize_scales && (axis == QwtPlot::xBottom || axis == QwtPlot::yLeft)){ + updateSecondaryAxis(QwtPlot::xTop); + updateSecondaryAxis(QwtPlot::yRight); + } replot(); @@ -1388,11 +1373,14 @@ #endif } -QPixmap Graph::graphPixmap(const QSize& size, double scaleFontsFactor) +QPixmap Graph::graphPixmap(const QSize& size, double scaleFontsFactor, bool transparent) { if (!size.isValid()){ QPixmap pixmap(boundingRect().size()); - pixmap.fill(Qt::white); + if (transparent) + pixmap.fill(Qt::transparent); + else + pixmap.fill(); QPainter p(&pixmap); print(&p, rect()); p.end(); @@ -1414,7 +1402,10 @@ scaleFonts(scaleFontsFactor); QPixmap pixmap(size); - pixmap.fill(Qt::white); + if (transparent) + pixmap.fill(Qt::transparent); + else + pixmap.fill(); QPainter p(&pixmap); print(&p, r); p.end(); @@ -1468,28 +1459,8 @@ if (customSize.isValid()) size = customPrintSize(customSize, unit, dpi); - QPixmap pic = graphPixmap(size, fontsFactor); + QPixmap pic = graphPixmap(size, fontsFactor, transparent); QImage image = pic.toImage(); - - if (transparent){ - QBitmap mask(size); - mask.fill(Qt::color1); - QPainter p(&mask); - p.setPen(Qt::color0); - - QRgb backgroundPixel = QColor(Qt::white).rgb (); - for (int y = 0; y < image.height(); y++){ - for (int x = 0; x < image.width(); x++){ - QRgb rgb = image.pixel(x, y); - if (rgb == backgroundPixel) // we want the frame transparent - p.drawPoint(x, y); - } - } - p.end(); - pic.setMask(mask); - image = pic.toImage(); - } - int dpm = (int)ceil(100.0/2.54*dpi); image.setDotsPerMeterX(dpm); image.setDotsPerMeterY(dpm); @@ -1515,7 +1486,7 @@ { if (fileName.isEmpty()){ QMessageBox::critical(this, tr("QtiPlot - Error"), tr("Please provide a valid file name!")); - return; + return; } QPrinter printer; @@ -1523,7 +1494,8 @@ printer.setResolution(logicalDpiX());//we set screen resolution as default printer.setDocName(multiLayer()->objectName()); - printer.setCreator("QtiPlot"); + printer.setFontEmbeddingEnabled(true); + printer.setCreator("QtiPlot"); printer.setFullPage(true); QRect r = rect(); QRect br = boundingRect(); @@ -1558,11 +1530,11 @@ } else printer.setPaperSize (QSizeF(br.size()), QPrinter::DevicePixel); - printer.setOutputFileName(fileName); - if (fileName.contains(".eps")) - printer.setOutputFormat(QPrinter::PostScriptFormat); + printer.setOutputFileName(fileName); + if (fileName.contains(".eps")) + printer.setOutputFormat(QPrinter::PostScriptFormat); - if (color) + if (color) printer.setColorMode(QPrinter::Color); else printer.setColorMode(QPrinter::GrayScale); @@ -1571,7 +1543,7 @@ scaleFonts(fontsFactor); - QPainter paint(&printer); + QPainter paint(&printer); print(&paint, r); scaleFonts(1.0/fontsFactor); @@ -1606,7 +1578,7 @@ QRect plotRect = rect(); QRect paperRect = printer.paperRect(); - if (d_scale_on_print){ + if (multiLayer()->scaleLayersOnPrint()){ int dpiy = printer.logicalDpiY(); int margin = (int) ((2/2.54)*dpiy ); // 2 cm margins @@ -1625,7 +1597,7 @@ } QPainter paint(&printer); - if (d_print_cropmarks){ + if (multiLayer()->printCropmarksEnabled()){ QRect cr = plotRect; // cropmarks rectangle cr.addCoords(-1, -1, 2, 2); paint.save(); @@ -1644,6 +1616,9 @@ void Graph::exportSVG(const QString& fname, const QSizeF& customSize, int unit, double fontsFactor) { int res = 96; +#ifdef Q_OS_MAC + res = 72; +#endif QSize size = boundingRect().size(); if (customSize.isValid()) @@ -1733,7 +1708,7 @@ bool Graph::markerSelected() { - if (d_selected_marker) + if (d_selected_arrow) return true; if (d_active_enrichment) return true; @@ -1742,8 +1717,8 @@ void Graph::removeMarker() { - if (d_selected_marker && d_lines.contains(d_selected_marker)) - remove((ArrowMarker*)d_selected_marker); + if (d_selected_arrow && d_lines.contains(d_selected_arrow)) + remove(d_selected_arrow); else if (d_active_enrichment) remove(d_active_enrichment); } @@ -1764,8 +1739,8 @@ d_lines.removeAt(index); } - if (arrow == d_selected_marker) - d_selected_marker = NULL; + if (arrow == d_selected_arrow) + d_selected_arrow = NULL; arrow->detach(); replot(); @@ -1794,7 +1769,7 @@ bool Graph::arrowMarkerSelected() { - return (d_selected_marker && d_lines.contains(d_selected_marker)); + return (d_selected_arrow && d_lines.contains(d_selected_arrow)); } bool Graph::imageMarkerSelected() @@ -1808,7 +1783,7 @@ void Graph::deselect() { deselectMarker(); - scalePicker->deselect(); + scalePicker->deselect(); titlePicker->setSelected(false); deselectCurves(); } @@ -1991,6 +1966,7 @@ updated_curves++; } } + if (updated_curves){ for (int i = 0; i < QwtPlot::axisCnt; i++){ QwtScaleWidget *scale = axisWidget(i); @@ -2059,21 +2035,30 @@ emit modifiedGraph(); } -void Graph::loadAxesOptions(const QString& s) +void Graph::loadAxesOptions(const QStringList& lst) { - if (s == "1") + if (lst.size() < 2) return; - drawAxesBackbone = false; + drawAxesBackbone = (lst[1] == "1"); - for (int i=0; ienableComponent (QwtAbstractScaleDraw::Backbone, false); - scale->repaint(); + if (lst.size() == 6){ + for (int i = 0; ienableComponent (QwtAbstractScaleDraw::Backbone, lst[i + 2].toInt()); + scale->repaint(); + } + } + } else if (!drawAxesBackbone){ + for (int i=0; ienableComponent (QwtAbstractScaleDraw::Backbone, false); + scale->repaint(); + } } } } @@ -2381,12 +2366,14 @@ s += QString::number(-1) + "\t"; bool filled = c->brush().style() == Qt::NoBrush ? false : true; - s+=QString::number(filled)+"\t"; - + if (filled) + s += QString::number(c->brush().color().alphaF()) + "\t"; + else + s += "0\t"; s += c->brush().color().name() + "\t"; - s+=QString::number(PatternBox::patternIndex(c->brush().style()))+"\t"; + s += QString::number(PatternBox::patternIndex(c->brush().style()))+"\t"; if (style <= LineSymbols || style == Box) - s+=QString::number(symbol.pen().widthF())+"\t"; + s += QString::number(symbol.pen().widthF())+"\t"; } if(style == VerticalBars || style == HorizontalBars || style == Histogram){ @@ -2756,15 +2743,24 @@ return d_curves.at(index); } -QwtPlotCurve *Graph::curve(int index) +PlotCurve *Graph::curve(int index) { int curves = d_curves.size(); - if (!curves || index >= curves || index < 0) + if (!curves || index >= curves || index < 0) return 0; QwtPlotItem *it = d_curves.at(index); - if (it && it->rtti() != QwtPlotItem::Rtti_PlotSpectrogram) - return (QwtPlotCurve*)it; + if (it && it->rtti() != QwtPlotItem::Rtti_PlotSpectrogram) + return (PlotCurve*)it; + + return 0; +} + +DataCurve * Graph::dataCurve(int index) +{ + PlotCurve *c = curve(index); + if (c && c->type() != Function) + return (DataCurve*)c; return 0; } @@ -2793,16 +2789,32 @@ if (!c) return 0; - if (d_range_selector && d_range_selector->isVisible() && - d_range_selector->selectedCurve() == c) { - *start = d_range_selector->minXValue(); - *end = d_range_selector->maxXValue(); - return d_range_selector->dataSize(); + if (c->curveType() == QwtPlotCurve::Yfx){ + if (d_range_selector && d_range_selector->isVisible() && + d_range_selector->selectedCurve() == c) { + *start = d_range_selector->minXValue(); + *end = d_range_selector->maxXValue(); + return d_range_selector->dataSize(); + } else { + const QwtData *data = &(c->data()); + *start = data->boundingRect().left(); + *end = data->boundingRect().right(); + return c->dataSize(); + } } else { - *start = c->minXValue(); - *end = c->maxXValue(); - return c->dataSize(); + if (d_range_selector && d_range_selector->isVisible() && + d_range_selector->selectedCurve() == c) { + *start = d_range_selector->minYValue(); + *end = d_range_selector->maxYValue(); + return d_range_selector->dataSize(); + } else { + const QwtData *data = &(c->data()); + *start = data->boundingRect().bottom(); + *end = data->boundingRect().top(); + return c->dataSize(); + } } + return 0; } CurveLayout Graph::initCurveLayout() @@ -2825,17 +2837,43 @@ CurveLayout Graph::initCurveLayout(int style, int curves, bool guessLayout) { - int i = d_curves.size() - 1; + int i = d_curves.size() - 1; CurveLayout cl = initCurveLayout(); - cl.sType = 1; - int color = 0; + int color = 0, sIndex = 0; if (guessLayout) - guessUniqueCurveLayout(color, cl.sType); - - cl.lCol = ColorBox::color(color); + guessUniqueCurveLayout(color, sIndex); + + QList indexedColors = ColorBox::defaultColors(); + MultiLayer *ml = multiLayer(); + ApplicationWindow *app = 0; + if (ml){ + app = ml->applicationWindow(); + if (app){ + indexedColors = app->indexedColors(); + if (app->d_indexed_symbols){ + QList indexedSymbols = app->indexedSymbols(); + if (sIndex >= 0 && sIndex < indexedSymbols.size()) + cl.sType = indexedSymbols[sIndex] + 1; + } else + cl.sType = app->d_symbol_style; + + if (style == Area || style == VerticalBars || style == HorizontalBars || style == StackBar || style == StackColumn || style == Histogram){ + cl.aStyle = app->defaultCurveBrush; + cl.filledArea = (double)app->defaultCurveAlpha/255.0; + } + + cl.lStyle = app->d_curve_line_style; + } + } + int colorsCount = indexedColors.size(); + + if (color >= 0 && color < colorsCount) + cl.lCol = indexedColors[color]; cl.symCol = cl.lCol; - cl.fillCol = cl.lCol; + cl.fillCol = (app && app->d_fill_symbols) ? cl.lCol : QColor(); + if (app) + cl.penWidth = app->defaultSymbolEdge; if (style == Line) cl.sType = 0; @@ -2849,9 +2887,9 @@ } else if (style == Spline) cl.connectType = 5; else if (curves && (style == VerticalBars || style == HorizontalBars)){ - cl.filledArea = 1; cl.lCol = Qt::black; - cl.aCol = ColorBox::color(i + 1); + if (i >= 0 && i < colorsCount) + cl.aCol = indexedColors[i]; cl.sType = 0; QwtBarCurve *b = (QwtBarCurve*)curve(i); if (b && (b->type() == VerticalBars || b->type() == HorizontalBars)){ @@ -2859,18 +2897,16 @@ b->setOffset(-50*(curves-1) + i*100); } } else if (style == StackBar || style == StackColumn){ - cl.filledArea = 1; cl.lCol = Qt::black; - cl.aCol = ColorBox::color(i + 1); + if (i >= 0 && i < colorsCount) + cl.aCol = indexedColors[i]; cl.sType = 0; } else if (style == Histogram){ - cl.filledArea = 1; - cl.lCol = ColorBox::color(i + 1);//start with red color pen - cl.aCol = cl.lCol; //start with red fill color - cl.aStyle = 4; + if (i >= 0 && i < colorsCount) + cl.lCol = indexedColors[i]; + cl.aCol = cl.lCol; cl.sType = 0; } else if (style == Area){ - cl.filledArea = 1; cl.aCol = cl.lCol; cl.sType = 0; cl.connectType = 1; @@ -2887,14 +2923,14 @@ if (d_curves.size() < index) return; - QPen pen = QPen(cL->symCol, cL->penWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin); + QPen pen = QPen(cL->symCol, cL->penWidth, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin); pen.setCosmetic(true); if (cL->fillCol.isValid()) c->setSymbol(QwtSymbol(SymbolBox::style(cL->sType), QBrush(cL->fillCol), pen, QSize(cL->sSize, cL->sSize))); else c->setSymbol(QwtSymbol(SymbolBox::style(cL->sType), QBrush(), pen, QSize(cL->sSize, cL->sSize))); - pen = QPen(cL->lCol, cL->lWidth, getPenStyle(cL->lStyle), Qt::FlatCap, Qt::MiterJoin); + pen = QPen(cL->lCol, cL->lWidth, getPenStyle(cL->lStyle), Qt::SquareCap, Qt::MiterJoin); pen.setCosmetic(true); c->setPen(pen); @@ -2916,10 +2952,14 @@ } QBrush brush = QBrush(cL->aCol); - if (cL->filledArea) + if (cL->filledArea){ brush.setStyle(PatternBox::brushStyle(cL->aStyle)); - else + QColor color = brush.color(); + color.setAlphaF(cL->filledArea); + brush.setColor(color); + }else brush.setStyle(Qt::NoBrush); + c->setBrush(brush); } @@ -3098,8 +3138,7 @@ int curves = names.count(); int errCurves = 0; QStringList lst = QStringList(); - for (int i=0; icolIndex(names[i]); if (w->colPlotDesignation(j) == Table::xErr || w->colPlotDesignation(j) == Table::yErr || w->colPlotDesignation(j) == Table::Label){ @@ -3109,19 +3148,20 @@ lst.prepend(names[i]); } - for (int i=0; icolIndex(names[i]); PlotCurve *c = NULL; if (w->colPlotDesignation(j) == Table::xErr || w->colPlotDesignation(j) == Table::yErr){ - int ycol = w->colY(w->colIndex(names[i])); - if (ycol < 0) + int xcol = w->colX(j); + int ycol = w->colY(j, xcol); + if (xcol < 0 || ycol < 0) return false; QwtErrorPlotCurve *er = NULL; if (w->colPlotDesignation(j) == Table::xErr) - er = addErrorBars(w->colName(ycol), w, names[i], (int)QwtErrorPlotCurve::Horizontal); + er = addErrorBars(w->colName(xcol), w->colName(ycol), w, names[i], (int)QwtErrorPlotCurve::Horizontal); else - er = addErrorBars(w->colName(ycol), w, names[i]); + er = addErrorBars(w->colName(xcol), w->colName(ycol), w, names[i]); if (!er) continue; @@ -3132,7 +3172,7 @@ } else if (w->colPlotDesignation(j) == Table::Label){ QString labelsCol = names[i]; int xcol = w->colX(w->colIndex(labelsCol)); - int ycol = w->colY(w->colIndex(labelsCol)); + int ycol = w->colY(w->colIndex(labelsCol), xcol); if (xcol < 0 || ycol < 0) return false; @@ -3159,6 +3199,8 @@ updateSecondaryAxis(QwtPlot::xTop, true); updateSecondaryAxis(QwtPlot::yRight, true); + updateAxesTitles(); + replot(); d_zoomer[0]->setZoomBase(); @@ -3213,8 +3255,8 @@ int r = abs(endRow - startRow) + 1; QVector X(r), Y(r); if (xColType == Table::Time){ - for (int i = startRow; i<=endRow; i++ ){ - QString xval=w->text(i,xcol); + for (int i = startRow; i <= endRow; i++ ){ + QString xval = w->text(i, xcol); if (!xval.isEmpty()){ time0 = QTime::fromString (xval, date_time_fmt); if (time0.isValid()) @@ -3222,8 +3264,8 @@ } } } else if (xColType == Table::Date){ - for (int i = startRow; i<=endRow; i++ ){ - QString xval=w->text(i,xcol); + for (int i = startRow; i <= endRow; i++ ){ + QString xval = w->text(i, xcol); if (!xval.isEmpty()){ date0 = QDateTime::fromString(xval, date_time_fmt); if (date0.isValid()) @@ -3423,6 +3465,14 @@ emit modifiedGraph(); } +void Graph::updateAxesTitles() +{ + if (d_axis_title_policy != Default){ + ((QwtPlot *)this)->setAxisTitle(QwtPlot::xBottom, parseAxisTitle("%(?X)")); + ((QwtPlot *)this)->setAxisTitle(QwtPlot::yLeft, parseAxisTitle("%(?Y)")); + } +} + void Graph::updatePlot() { if (d_auto_scale && !zoomOn() && d_active_tool == NULL){ @@ -3447,8 +3497,11 @@ replot(); updateMarkersBoundingRect(); - updateSecondaryAxis(QwtPlot::xTop); - updateSecondaryAxis(QwtPlot::yRight); + + if (d_synchronize_scales){ + updateSecondaryAxis(QwtPlot::xTop); + updateSecondaryAxis(QwtPlot::yRight); + } replot();//TODO: avoid 2nd replot! d_zoomer[0]->setZoomBase(); @@ -3635,7 +3688,7 @@ void Graph::contextMenuEvent(QContextMenuEvent *e) { - if (d_selected_marker) { + if (d_selected_arrow) { emit showMarkerPopupMenu(); return; } @@ -3683,7 +3736,7 @@ } if (on) - canvas()->setCursor(QCursor(QPixmap(lens_xpm), -1, -1)); + canvas()->setCursor(QCursor(QPixmap(":/lens.png"), -1, -1)); else canvas()->setCursor(Qt::arrowCursor); } @@ -3693,11 +3746,13 @@ d_zoomer[0]->zoom(-1); d_zoomer[1]->zoom(-1); - updateSecondaryAxis(QwtPlot::xTop); - updateSecondaryAxis(QwtPlot::yRight); + if (d_synchronize_scales){ + updateSecondaryAxis(QwtPlot::xTop); + updateSecondaryAxis(QwtPlot::yRight); + } } -void Graph::enablePanningMagnifier(bool on) +void Graph::enablePanningMagnifier(bool on, int mode) { if (d_magnifier) delete d_magnifier; @@ -3727,6 +3782,20 @@ d_panner->setAxisEnabled (axis, false); } } + + if (mode == 1){ + cnvs->setCursor(Qt::SizeVerCursor); + d_magnifier->setAxisEnabled (QwtPlot::xBottom, false); + d_magnifier->setAxisEnabled (QwtPlot::xTop, false); + d_panner->setAxisEnabled (QwtPlot::xBottom, false); + d_panner->setAxisEnabled (QwtPlot::xTop, false); + } else if (mode == 2){ + cnvs->setCursor(Qt::SizeHorCursor); + d_magnifier->setAxisEnabled (QwtPlot::yLeft, false); + d_magnifier->setAxisEnabled (QwtPlot::yRight, false); + d_panner->setAxisEnabled (QwtPlot::yLeft, false); + d_panner->setAxisEnabled (QwtPlot::yRight, false); + } } else { for (int i = 0; i < QwtPlot::axisCnt; i++){ QwtScaleWidget *scale = axisWidget(i); @@ -3818,13 +3887,20 @@ if (!c) return; - if (c->functionType() == type && - c->variable() == var && - c->formulas() == formulas && - c->startRange() == start && - c->endRange() == end && - c->dataSize() == points && - c->constants() == constants) + QString oldVar = c->variable(); + QStringList oldFormulas = c->formulas(); + const QMap oldConstants = c->constants(); + double oldStartRange = c->startRange(); + double oldEndRange = c->endRange(); + int oldPoints = c->dataSize(); + int oldType = c->functionType(); + if (oldType == type && + oldVar == var && + oldFormulas == formulas && + oldStartRange == start && + oldEndRange == end && + oldPoints == points && + oldConstants == constants) return; QString oldLegend = c->legend(); @@ -3834,7 +3910,14 @@ c->setFormulas(formulas); c->setVariable(var); c->setConstants(constants); - c->loadData(points); + if (!c->loadData(points)){ + c->setFunctionType((FunctionCurve::FunctionType)oldType); + c->setRange(oldStartRange, oldEndRange); + c->setFormulas(oldFormulas); + c->setVariable(oldVar); + c->setConstants(oldConstants); + return; + } foreach(FrameWidget *fw, d_enrichments){ LegendWidget *l = qobject_cast(fw); @@ -3885,7 +3968,7 @@ int colorIndex = 0, symbolIndex; guessUniqueCurveLayout(colorIndex, symbolIndex); - c->setPen(QPen(ColorBox::color(colorIndex), 1.0)); + c->setPen(QPen(ColorBox::defaultColor(colorIndex), 1.0)); addLegendItem(); updatePlot(); @@ -3961,15 +4044,21 @@ if (!curve) return; - int size = curve->dataSize(); - QString text = "1\t2\n"; - for (int i=0; ix(i))+"\t"; - text += QString::number(curve->y(i))+"\n"; - } - QString legend = tr("Data set generated from curve") + ": " + curve->title().text(); - emit createTable(tr("Table") + "1" + "\t" + legend, size, 2, text); + MultiLayer *plot = multiLayer(); + if (!plot) + return; + + ApplicationWindow *app = plot->applicationWindow(); + if (!app) + return; + + int size = curve->dataSize(); + Table *t = app->newTable(size, 2, QString::null, tr("Data set generated from curve") + ": " + curve->title().text()); + for (int i = 0; i < size; i++){ + t->setCell(i, 0, curve->x(i)); + t->setCell(i, 1, curve->y(i)); + } + t->showNormal(); } QString Graph::saveToString(bool saveAsTemplate) @@ -4006,26 +4095,48 @@ s+=saveAxesLabelsType(); s+=saveTicksType(); s+="TicksLength\t"+QString::number(minorTickLength())+"\t"+QString::number(majorTickLength())+"\n"; - s+="DrawAxesBackbone\t"+QString::number(drawAxesBackbone)+"\n"; + s+=saveAxesBackbones(); s+="AxesLineWidth\t"+QString::number(axesLinewidth())+"\n"; s+=saveLabelsRotation(); + s+=saveTickLabelsSpace(); s+=saveMarkers(); if (d_Douglas_Peuker_tolerance > 0.0){ s += "" + QString::number(d_Douglas_Peuker_tolerance) + "\t"; s += QString::number(d_speed_mode_points) + "\n"; } - s+="\n"; + + if (d_active_tool && d_active_tool->rtti() == PlotToolInterface::Rtti_ImageProfilesTool){ + ImageProfilesTool *ipt = (ImageProfilesTool *)d_active_tool; + if (ipt){ + s += "" + ipt->matrix()->objectName(); + if (!ipt->horizontalTable().isNull()) + s += "\t" + ipt->horizontalTable()->objectName(); + if (!ipt->verticalTable().isNull()) + s += "\t" + ipt->verticalTable()->objectName(); + s += "\n"; + s += ""; + s += QString::number(ipt->xValue()) + "\t" + QString::number(ipt->yValue()); + s += "\n"; + } + } + s += "\n"; return s; } -void Graph::updateMarkersBoundingRect() +void Graph::updateMarkersBoundingRect(bool rescaleEvent) { - foreach(FrameWidget *f, d_enrichments){ - if (f->attachPolicy() == FrameWidget::Scales) + foreach(FrameWidget *f, d_enrichments){ + if (!rescaleEvent && qobject_cast(f)){ + f->resetOrigin(); + continue; + } + + if (f->attachPolicy() == FrameWidget::Scales) f->resetCoordinates(); - else + else if (rescaleEvent) f->updateCoordinates(); - } + } + replot(); if (!d_lines.size()) return; @@ -4033,7 +4144,7 @@ foreach (QwtPlotMarker *i, d_lines) ((ArrowMarker*)i)->updateBoundingRect(); - replot(); + replot(); } void Graph::resizeEvent ( QResizeEvent *e ) @@ -4042,26 +4153,22 @@ if (size.height() <= 0) size.setHeight(e->oldSize().height()); - if (autoScaleFonts){ - QSize oldSize = e->oldSize(); - - resize(size); - updateLayout(); - if(oldSize.isValid() && size.isValid()) - scaleFonts((double)size.height()/(double)oldSize.height()); - } else { - resize(size); - updateLayout(); - updateCurveLabels(); - } - + resize(size); + updateLayout(); + updateCurveLabels(); + + bool layerSelected = multiLayer()->hasSelectedLayers(); foreach(FrameWidget *f, d_enrichments){ - TexWidget *tw = qobject_cast(f); - LegendWidget *l = qobject_cast(f); - if (tw || l) - f->resetOrigin(); - else - f->resetCoordinates(); + if (layerSelected && f->attachPolicy() == FrameWidget::Page) + f->updateCoordinates(); + else { + TexWidget *tw = qobject_cast(f); + LegendWidget *l = qobject_cast(f); + if (tw || l) + f->resetOrigin(); + else + f->resetCoordinates(); + } } } @@ -4218,10 +4325,10 @@ void Graph::showTitleContextMenu() { QMenu titleMenu(this); - titleMenu.insertItem(QPixmap(cut_xpm), tr("Cu&t"),this, SLOT(cutTitle())); - titleMenu.insertItem(QPixmap(copy_xpm), tr("&Copy"),this, SLOT(copyTitle())); + titleMenu.insertItem(QPixmap(":/cut.png"), tr("Cu&t"),this, SLOT(cutTitle())); + titleMenu.insertItem(QPixmap(":/copy.png"), tr("&Copy"),this, SLOT(copyTitle())); titleMenu.insertItem(tr("C&lear"),this, SLOT(clearTitle())); - titleMenu.insertItem(QPixmap(delete_xpm), tr("&Delete"),this, SLOT(removeTitle())); + titleMenu.insertItem(QPixmap(":/delete.png"), tr("&Delete"),this, SLOT(removeTitle())); titleMenu.insertSeparator(); titleMenu.insertItem(tr("&Properties..."), this, SIGNAL(viewTitleDialog())); titleMenu.exec(QCursor::pos()); @@ -4271,10 +4378,10 @@ void Graph::showAxisTitleMenu() { QMenu titleMenu(this); - titleMenu.insertItem(QPixmap(cut_xpm), tr("Cu&t"), this, SLOT(cutAxisTitle())); - titleMenu.insertItem(QPixmap(copy_xpm), tr("&Copy"), this, SLOT(copyAxisTitle())); + titleMenu.insertItem(QPixmap(":/cut.png"), tr("Cu&t"), this, SLOT(cutAxisTitle())); + titleMenu.insertItem(QPixmap(":/copy.png"), tr("&Copy"), this, SLOT(copyAxisTitle())); titleMenu.insertItem(tr("C&lear"),this, SLOT(clearAxisTitle())); - titleMenu.insertItem(QPixmap(delete_xpm), tr("&Delete"),this, SLOT(removeAxisTitle())); + titleMenu.insertItem(QPixmap(":/delete.png"), tr("&Delete"),this, SLOT(removeAxisTitle())); titleMenu.insertSeparator(); titleMenu.insertItem(tr("&Properties..."), this, SIGNAL(showAxisTitleDialog())); titleMenu.exec(QCursor::pos()); @@ -4284,7 +4391,7 @@ { QMenu menu(this); menu.setCheckable(true); - menu.insertItem(QPixmap(unzoom_xpm), tr("&Rescale to show all"), this, SLOT(setAutoScale()), tr("Ctrl+Shift+R")); + menu.insertItem(QPixmap(":/unzoom.png"), tr("&Rescale to show all"), this, SLOT(setAutoScale()), tr("Ctrl+Shift+R")); menu.insertSeparator(); menu.insertItem(tr("&Hide axis"), this, SLOT(hideSelectedAxis())); @@ -4400,7 +4507,7 @@ d_Douglas_Peuker_tolerance = g->getDouglasPeukerTolerance(); - copyCurves(g); + copyCurves(g); for (int i=0; iaxisWidget(i); @@ -4423,10 +4530,8 @@ ScaleDraw *sd = (ScaleDraw *)g->axisScaleDraw(i); setAxisScaleDraw(i, new ScaleDraw(this, sd->labelsList(), sd->formatString(), sd->scaleType())); } - } else { - ScaleDraw *sd = (ScaleDraw *)axisScaleDraw (i); - sd->enableComponent (QwtAbstractScaleDraw::Labels, false); - } + } else + axisScaleDraw (i)->enableComponent (QwtAbstractScaleDraw::Labels, false); } for (int i=0; iaxisScaleEngine(i); @@ -4452,11 +4557,22 @@ setAxisScaleDiv (i, div); } - drawAxesBackbones(g->drawAxesBackbone); setMajorTicksType(g->getMajorTicksType()); setMinorTicksType(g->getMinorTicksType()); setTicksLength(g->minorTickLength(), g->majorTickLength()); + for (int i = 0; i < QwtPlot::axisCnt; i++){ + QwtScaleWidget *sc = g->axisWidget(i); + if (!sc) + continue; + + ScaleDraw *sd = (ScaleDraw *)axisScaleDraw(i); + ScaleDraw *sdg = (ScaleDraw *)g->axisScaleDraw (i); + sd->enableComponent (QwtAbstractScaleDraw::Backbone, sdg->hasComponent(QwtAbstractScaleDraw::Backbone)); + sd->setSpacing(sdg->spacing()); + sd->setShowTicksPolicy(sdg->showTicksPolicy()); + } + setAxisLabelRotation(QwtPlot::xBottom, g->labelsRotation(QwtPlot::xBottom)); setAxisLabelRotation(QwtPlot::xTop, g->labelsRotation(QwtPlot::xTop)); @@ -4474,12 +4590,18 @@ add(e); } - QList lines = g->linesList(); - foreach (QwtPlotMarker *i, lines) - addArrow((ArrowMarker*)i); + QList lines = g->arrowsList(); + foreach (ArrowMarker *a, lines) + addArrow(a); setAntialiasing(g->antialiasing(), true); autoScaleFonts = g->autoscaleFonts(); + + if (g->activeTool() && g->activeTool()->rtti() == PlotToolInterface::Rtti_ImageProfilesTool){ + ImageProfilesTool *ipt = (ImageProfilesTool *)g->activeTool(); + if (ipt) + d_active_tool = ipt->clone(this); + } } void Graph::copyCurves(Graph* g) @@ -4596,14 +4718,25 @@ if (endRow < 0) endRow = w->numRows() - 1; + QList indexedColors = ColorBox::defaultColors(); + MultiLayer *ml = multiLayer(); + if (ml){ + ApplicationWindow *app = ml->applicationWindow(); + if (app) + indexedColors = app->indexedColors(); + } + + QColor color = Qt::black; for (int j = 0; j <(int)names.count(); j++){ BoxCurve *c = new BoxCurve(w, names[j], startRow, endRow); insertCurve(c); + if (j < indexedColors.size()) + color = indexedColors[j]; c->setData(QwtSingleArrayData(double(j+1), QwtArray(), 0)); c->loadData(); - c->setPen(QPen(ColorBox::color(j), 1)); - c->setSymbol(QwtSymbol(QwtSymbol::NoSymbol, QBrush(), QPen(ColorBox::color(j), 1), QSize(7,7))); + c->setPen(QPen(color, 1)); + c->setSymbol(QwtSymbol(QwtSymbol::NoSymbol, QBrush(), QPen(color, 1), QSize(7,7))); } foreach(FrameWidget *fw, d_enrichments){ @@ -4612,12 +4745,14 @@ l->setText(legendText()); } - setAxisScaleDraw (QwtPlot::xBottom, new ScaleDraw(this, w->selectedYLabels(), w->objectName(), ScaleDraw::ColHeader)); - setAxisMaxMajor(QwtPlot::xBottom, names.count()+1); + ScaleDraw *sd = new ScaleDraw(this, w->selectedYLabels(), w->objectName(), ScaleDraw::ColHeader); + sd->setShowTicksPolicy(ScaleDraw::HideBeginEnd); + setAxisScaleDraw (QwtPlot::xBottom, sd); + setAxisMaxMajor(QwtPlot::xBottom, names.count() + 1); setAxisMaxMinor(QwtPlot::xBottom, 0); setAxisScaleDraw (QwtPlot::xTop, new ScaleDraw(this, w->selectedYLabels(), w->objectName(), ScaleDraw::ColHeader)); - setAxisMaxMajor(QwtPlot::xTop, names.count()+1); + setAxisMaxMajor(QwtPlot::xTop, names.count() + 1); setAxisMaxMinor(QwtPlot::xTop, 0); } @@ -4767,6 +4902,17 @@ colorIndex = 0; symbolIndex = 0; + QList indexedColors = ColorBox::defaultColors(); + QList indexedSymbols = SymbolBox::defaultSymbols(); + MultiLayer *ml = multiLayer(); + if (ml){ + ApplicationWindow *app = ml->applicationWindow(); + if (app){ + indexedColors = app->indexedColors(); + indexedSymbols = app->indexedSymbols(); + } + } + int curve_index = d_curves.size() - 1; if (curve_index >= 0){// find out the pen color of the master curve PlotCurve *c = (PlotCurve *)curve(curve_index); @@ -4774,7 +4920,7 @@ QwtErrorPlotCurve *er = (QwtErrorPlotCurve *)c; DataCurve *master_curve = er->masterCurve(); if (master_curve){ - colorIndex = ColorBox::colorIndex(master_curve->pen().color()); + colorIndex = indexedColors.indexOf(master_curve->pen().color()); return; } } @@ -4783,13 +4929,15 @@ foreach (QwtPlotItem *it, d_curves){ if (it->rtti() == QwtPlotItem::Rtti_PlotCurve){ const QwtPlotCurve *c = (QwtPlotCurve *)it; - int index = ColorBox::colorIndex(c->pen().color()); + int index = indexedColors.indexOf(c->pen().color()); if (index > colorIndex) colorIndex = index; QwtSymbol symb = c->symbol(); - index = SymbolBox::symbolIndex(symb.style()); - if (index > symbolIndex) + index = indexedSymbols.indexOf(int(symb.style())); + if (index < 0) + symbolIndex = 0; + else if (index > symbolIndex) symbolIndex = index; } } @@ -4797,12 +4945,10 @@ colorIndex = (++colorIndex)%16; symbolIndex = (++symbolIndex)%15; } else - symbolIndex = symbolIndex%15; + symbolIndex = 0; + if (colorIndex == 13) //avoid white invisible curves colorIndex = 0; - - if (!symbolIndex) - symbolIndex = 1; } void Graph::addFitCurve(QwtPlotCurve *c) @@ -4819,13 +4965,29 @@ replot(); } +//! Returns a pointer to the spectrogram which data source is matrix m (the pointer can be NULL) +Spectrogram* Graph::spectrogram(Matrix *m) +{ + if (!m) + return NULL; + + foreach (QwtPlotItem *item, d_curves){ + if(item && item->rtti() == QwtPlotItem::Rtti_PlotSpectrogram){ + Spectrogram *s = (Spectrogram *)item; + if (s && s->matrix() == m) + return s; + } + } + return NULL; +} + Spectrogram* Graph::plotSpectrogram(Matrix *m, CurveType type) { if (!m || (type != GrayScale && type != ColorMap && type != Contour)) return 0; if (plotItemsList().contains(m->objectName())) - return 0; + return spectrogram(m); Spectrogram *d_spectrogram = new Spectrogram(this, m); insertCurve(d_spectrogram); @@ -4881,7 +5043,11 @@ QString s = *line; if (s.contains("") && (s.trimmed().remove("").remove("")).toInt()) sp->setUseMatrixFormula(true); - else if (s.contains("")){ + else if (s.contains("")){ + sp->setXAxis(s.trimmed().remove("").remove("").toInt()); + } else if (s.contains("")){ + sp->setYAxis(s.trimmed().remove("").remove("").toInt()); + } else if (s.contains("")){ int color_policy = s.remove("").remove("").stripWhiteSpace().toInt(); if (color_policy == Spectrogram::GrayScale) sp->setGrayScale(); @@ -5074,8 +5240,8 @@ if (markers < 1 && enrichments < 1) return false; - if (d_selected_marker){ - int next = d_lines.indexOf(d_selected_marker) + 1; + if (d_selected_arrow){ + int next = d_lines.indexOf(d_selected_arrow) + 1; if (next >= 0 && next < markers){//select next arrow cp->disableEditing(); deselectMarker(); @@ -5155,7 +5321,19 @@ QwtPlotCurve *c = curve(curveIndex); if (c){ QPen pen = c->pen(); - pen.setColor(ColorBox::color(colorIndex)); + pen.setColor(ColorBox::defaultColor(colorIndex)); + c->setPen(pen); + replot(); + emit modifiedGraph(); + } +} + +void Graph::setCurveLineColor(int curveIndex, QColor qColor) +{ + QwtPlotCurve *c = curve(curveIndex); + if (c){ + QPen pen = c->pen(); + pen.setColor(qColor); c->setPen(pen); replot(); emit modifiedGraph(); @@ -5261,7 +5439,7 @@ continue; QPen pen = c->pen(); - QColor color = ColorBox::color(i); + QColor color = ColorBox::defaultColor(i); pen.setColor(color); c->setPen(pen); @@ -5485,16 +5663,16 @@ void Graph::drawItems (QPainter *painter, const QRect &rect, const QwtScaleMap map[axisCnt], const QwtPlotPrintFilter &pfilter) const { - painter->save(); - painter->setRenderHint(QPainter::Antialiasing); - for (int i=0; isave(); + painter->setRenderHint(QPainter::Antialiasing); + for (int i=0; irestore(); + drawBreak(painter, rect, map[i], i); + } + painter->restore(); - for (int i=0; isetRenderHint(QPainter::TextAntialiasing); + + double minz = -1.0; + foreach (QwtPlotItem *it, d_curves){ + double z = it->z(); + if (minz < z) + minz = z; + } + if (d_grid->z() >= minz) + d_grid->setZ(minz - 10.0); + QwtPlot::drawItems(painter, rect, map, pfilter); for (int i=0; iactivate(this, contentsRect()); - // resize and show the visible widgets + plotLayout()->activate(this, contentsRect()); + // resize and show the visible widgets - if (!titleLabel()->text().isEmpty()){ - titleLabel()->setGeometry(plotLayout()->titleRect()); - if (!titleLabel()->isVisible()) - titleLabel()->show(); - } else + if (!titleLabel()->text().isEmpty()){ + titleLabel()->setGeometry(plotLayout()->titleRect()); + if (!titleLabel()->isVisible()) + titleLabel()->show(); + } else titleLabel()->hide(); - for (int axisId = 0; axisId < axisCnt; axisId++ ){ - if (axisEnabled(axisId) ){ - axisWidget(axisId)->setGeometry(plotLayout()->scaleRect(axisId)); - if (!axisWidget(axisId)->isVisible()) - axisWidget(axisId)->show(); - } else - axisWidget(axisId)->hide(); - } - - canvas()->setUpdatesEnabled(false); - canvas()->setGeometry(plotLayout()->canvasRect()); - canvas()->setUpdatesEnabled(true); + for (int axisId = 0; axisId < axisCnt; axisId++){ + if (axisEnabled(axisId) ){ + axisWidget(axisId)->setGeometry(plotLayout()->scaleRect(axisId)); + if (!axisWidget(axisId)->isVisible()) + axisWidget(axisId)->show(); + } else + axisWidget(axisId)->hide(); + } + + canvas()->setUpdatesEnabled(false); + canvas()->setGeometry(plotLayout()->canvasRect()); + canvas()->setUpdatesEnabled(true); + + updatedLayout(this); } /*! \brief Adjust plot content to its canvas size. \param cr The new geometry of the canvas. */ -void Graph::adjustGeometryToCanvas(const QRect &cr) -{ - bool scaleFonts = autoScaleFonts; - autoScaleFonts = false; - - QRect rect = geometry(); - QRect ocr = plotLayout()->canvasRect().translated(pos());//old canvas geometry - - rect.adjust(cr.x() - ocr.x(), cr.y() - ocr.y(), - cr.right() - ocr.right(), cr.bottom() - ocr.bottom()); - - setGeometry(rect); - autoScaleFonts = scaleFonts; +void Graph::setCanvasGeometry(const QRect &cr) +{ + bool scaleFonts = autoScaleFonts; + autoScaleFonts = false; + + QRect ocr = plotLayout()->canvasRect().translated(pos());//old canvas geometry + + QRect rect = geometry(); + rect.adjust(cr.x() - ocr.x(), cr.y() - ocr.y(), cr.right() - ocr.right(), cr.bottom() - ocr.bottom()); + setGeometry(rect); + + updateMarkersBoundingRect(false); + autoScaleFonts = scaleFonts; +} + +/*! + \brief Adjust plot content to its canvas size. + \param cr The new size of the canvas. +*/ +void Graph::setCanvasSize(const QSize &size) +{ + bool scaleFonts = autoScaleFonts; + autoScaleFonts = false; + + QRect ocr = plotLayout()->canvasRect().translated(pos());//old canvas geometry + + QRect rect = geometry(); + rect.adjust(0, 0, size.width() - ocr.width(), size.height() - ocr.height()); + setGeometry(rect); + + updateMarkersBoundingRect(false); + autoScaleFonts = scaleFonts; } const QColor & Graph::paletteBackgroundColor() const @@ -5997,8 +6206,7 @@ { int axisId; - if ( painter == 0 || !painter->isActive() || - !plotRect.isValid() || size().isNull() ) + if (painter == 0 || !painter->isActive() || !plotRect.isValid() || size().isNull()) return; deselect(); === modified file 'qtiplot/src/plot2D/Graph.h' --- qtiplot/src/plot2D/Graph.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/Graph.h 2010-07-21 23:21:08 +0000 @@ -80,7 +80,7 @@ QColor lCol; //!< line color float lWidth; //!< line width int lStyle; //!< line style - int filledArea; //!< flag: toggles area filling under curve + double filledArea; //!< flag: toggles area filling under curve; if > 0 it containts the alphaF value of the brush color QColor aCol; //!< curve area color int aStyle; //!< area filling style QColor symCol; //!< symbol outline color @@ -136,6 +136,7 @@ Box, VectXYAM, VerticalSteps, ColorMap, GrayScale, Contour, Function, ImagePlot, StackBar, StackColumn}; enum LegendDisplayMode{ColumnName, ColumnComment, TableName, TableLegend}; + enum AxisTitlePolicy{Default, ColName, ColComment, NameAndComment}; //! Returns a pointer to the parent MultiLayer object. MultiLayer *multiLayer(); @@ -193,7 +194,12 @@ void print(QPainter *, const QRect &rect, const QwtPlotPrintFilter & = QwtPlotPrintFilter()); void updateLayout(); - void adjustGeometryToCanvas(const QRect &canvasRect); + void setCanvasGeometry(const QRect &canvasRect); + //!Convenience function for scripts + void setCanvasGeometry(int x, int y, int w, int h){setCanvasGeometry(QRect(x, y, w, h));}; + void setCanvasSize(const QSize &size); + //!Convenience function for scripts + void setCanvasSize(int w, int h){setCanvasSize(QSize(w, h));}; void updateCurveLabels(); @@ -207,8 +213,9 @@ void addLegendItem(); bool isPrinting(){return d_is_printing;}; - void enablePanningMagnifier(bool on = true); - bool hasPanningMagnifierEnabled(){if (d_magnifier && d_panner) return true; return false;} + void enablePanningMagnifier(bool on = true, int mode = 0); + bool hasPanningMagnifierEnabled(){if (d_magnifier && d_panner) return true; return false;}; + QwtPlotMagnifier* magnifyTool(){return d_magnifier;}; static QString escapeTeXSpecialCharacters(const QString &); static QString texSuperscripts(const QString &); @@ -219,6 +226,9 @@ int speedModeMaxPoints(){return d_speed_mode_points;}; double getDouglasPeukerTolerance(){return d_Douglas_Peuker_tolerance;}; + void setAxisTitlePolicy(const AxisTitlePolicy& policy){d_axis_title_policy = policy;}; + void setSynchronizedScaleDivisions(bool on){d_synchronize_scales = on;}; + public slots: void copy(Graph* g); void copyCurves(Graph* g); @@ -275,12 +285,13 @@ //! Map curve pointer to index. int curveIndex(QwtPlotItem *c){return d_curves.indexOf(c);}; //! map curve title to index - int curveIndex(const QString &title){return plotItemsList().findIndex(title);} - //! get curve by index - QwtPlotCurve* curve(int index); - //! get curve by name - QwtPlotCurve* curve(const QString &title){return curve(curveIndex(title));}; - //! get curve title string by inde (convenience function for scripts) + int curveIndex(const QString &title){return plotItemsList().findIndex(title);} + DataCurve* dataCurve(int index); + //! get curve by index + PlotCurve* curve(int index); + //! get curve by name + PlotCurve* curve(const QString &title){return curve(curveIndex(title));}; + //! get curve title string by inde (convenience function for scripts) QString curveTitle(int index); //! Returns the names of all the curves suitable for data analysis, as a string list. The list excludes error bars and spectrograms. @@ -299,6 +310,7 @@ void setCurveStyle(int index, int s); void setCurveFullRange(int curveIndex); void setCurveLineColor(int curveIndex, int colorIndex); + void setCurveLineColor(int curveIndex, QColor qColor); void setCurveLineStyle(int curveIndex, Qt::PenStyle style); void setCurveLineWidth(int curveIndex, double width); void setGrayScale(); @@ -308,11 +320,8 @@ //! \name Output: Copy/Export/Print //@{ void print(); - void setScaleOnPrint(bool on){d_scale_on_print = on;}; - void printCropmarks(bool on){d_print_cropmarks = on;}; - void copyImage(); - QPixmap graphPixmap(const QSize& size = QSize(), double scaleFontsFactor = 1.0); + QPixmap graphPixmap(const QSize& size = QSize(), double scaleFontsFactor = 1.0, bool transparent = false); //! Provided for convenience in scripts void exportToFile(const QString& fileName); void exportSVG(const QString& fname, const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, double fontsFactor = 1.0); @@ -332,6 +341,7 @@ bool isExportingTeX(){return d_is_exporting_tex;}; void setTeXExportingMode(bool on = true){d_is_exporting_tex = on;}; + bool escapeTeXStrings(){return d_tex_escape_strings;}; void setEscapeTeXStringsMode(bool on = true){d_tex_escape_strings = on;}; //@} @@ -414,6 +424,8 @@ QString saveAxesLabelsType(); QString saveAxesBaseline(); QString saveAxesFormulas(); + QString saveAxesBackbones(); + QString saveTickLabelsSpace(); //@} //! \name Texts @@ -445,7 +457,8 @@ //! Used when opening a project file void addArrow(QStringList list, int fileVersion); - QList linesList(){return d_lines;}; + QList arrowsList(){return d_lines;}; + int numArrows(){return d_lines.count();}; //!Draws a line/arrow depending on the value of "arrow" void drawLine(bool on, bool arrow = false); @@ -468,16 +481,16 @@ //@{ void removeMarker(); //! Keep the markers on screen each time the scales are modified by adding/removing curves - void updateMarkersBoundingRect(); + void updateMarkersBoundingRect(bool rescaleEvent = true); - /*!\brief Set the selected marker. - * \param mrk key of the marker to be selected. - * \param add whether the marker is to be added to an existing selection. + /*!\brief Set the selected arrow. + * \param mrk key of the arrow to be selected. + * \param add whether the arrow is to be added to an existing selection. * If add is false (the default) or there is no existing selection, a new SelectionMoveResizer is * created and stored in #d_markers_selector. */ - void setSelectedMarker(QwtPlotMarker* mrk, bool add = false); - QwtPlotMarker* selectedMarker(){return d_selected_marker;}; + void setSelectedArrow(ArrowMarker* mrk, bool add = false); + ArrowMarker* selectedArrow(){return d_selected_arrow;}; bool markerSelected(); //! Reset any selection states on markers. void deselectMarker(); @@ -499,6 +512,7 @@ QString axisTitleString(int axis){return axisTitle(axis).text();}; void setAxisTitle(int axis, const QString& text); + void updateAxesTitles(); //! TODO: eliminate this function in version 0.9.1 (used only when restoring project files) void setScaleTitle(int axis, const QString& text); @@ -525,7 +539,8 @@ void showAxis(int axis, int type, const QString& formatInfo, Table *table, bool axisOn, int majTicksType, int minTicksType, bool labelsOn, const QColor& c, int format, - int prec, int rotation, int baselineDist, const QString& formula, const QColor& labelsColor); + int prec, int rotation, int baselineDist, const QString& formula, const QColor& labelsColor, + int spacing = 4, bool backbone = true, const ScaleDraw::ShowTicksPolicy& showTicks = ScaleDraw::ShowAll); void enableAxis(int axis, bool on = true); void enableAxisLabels(int axis, bool on = true); @@ -539,7 +554,7 @@ void drawAxesBackbones(bool yes); bool axesBackbones(){return drawAxesBackbone;}; //! used when opening a project file - void loadAxesOptions(const QString& s); + void loadAxesOptions(const QStringList& lst); void setAxisMargin(int axis, int margin); @@ -702,6 +717,8 @@ void showAxisDialog(); void showScaleDialog(); + //! Returns a pointer to the spectrogram which data source is matrix m (the pointer can be NULL) + Spectrogram* spectrogram(Matrix *m); //! Add a spectrogram to the graph Spectrogram* plotSpectrogram(Matrix *m, CurveType type); //! Restores a spectrogram. Used when opening a project file. @@ -725,7 +742,6 @@ void drawLineEnded(bool); void cursorInfo(const QString&); void showPlotDialog(int); - void createTable(const QString&,int,int,const QString&); void viewLineDialog(); void viewTitleDialog(); @@ -746,12 +762,17 @@ void currentFontChanged(const QFont&); void enableTextEditor(Graph *); void axisDivChanged(Graph *, int); + void updatedLayout(Graph *); + + private slots: + void selectorDeleted(); private: + QString parseAxisTitle(const QString& text); QList stackingOrderEnrichmentsList(); - //! Finds bounding interval of the plot data. - QwtDoubleInterval axisBoundingInterval(int axis); - void deselectCurves(); + //! Finds bounding interval of the plot data. + QwtDoubleInterval axisBoundingInterval(int axis); + void deselectCurves(); void dropEvent(QDropEvent*); void dragEnterEvent(QDragEnterEvent*); @@ -781,16 +802,15 @@ //! Render hint for plot items. bool d_antialiasing; bool autoScaleFonts; - bool d_scale_on_print, d_print_cropmarks; bool drawLineOn, drawArrowOn, drawAxesBackbone; //! Flag telling if we are performing a print operation bool d_is_printing; //! Stores the step the user specified for the four scale. If step = 0.0, the step will be calculated automatically by the Qwt scale engine. QVector d_user_step; //! Arrows/lines on plot - QList d_lines; + QList d_lines; //! Pointer to the currently selected line/image - QwtPlotMarker* d_selected_marker; + ArrowMarker* d_selected_arrow; //! The markers selected for move/resize operations or NULL if none are selected. QPointer d_markers_selector; //! The current curve selection, or NULL if none is active. @@ -811,5 +831,7 @@ double d_Douglas_Peuker_tolerance; int d_speed_mode_points; + AxisTitlePolicy d_axis_title_policy; + bool d_synchronize_scales; }; #endif // GRAPH_H === modified file 'qtiplot/src/plot2D/Grid.cpp' --- qtiplot/src/plot2D/Grid.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/Grid.cpp 2010-07-21 23:21:08 +0000 @@ -164,8 +164,8 @@ setRenderHint(QwtPlotItem::RenderAntialiased, grid[21].toInt()); } else { // older versions of QtiPlot (<= 0.9rc3) - majPenX = QPen(ColorBox::color(grid[5].toInt()), grid[7].toDouble(), Graph::getPenStyle(grid[6].toInt())); - minPenX = QPen(ColorBox::color(grid[8].toInt()), grid[10].toDouble(), Graph::getPenStyle(grid[9].toInt())); + majPenX = QPen(ColorBox::defaultColor(grid[5].toInt()), grid[7].toDouble(), Graph::getPenStyle(grid[6].toInt())); + minPenX = QPen(ColorBox::defaultColor(grid[8].toInt()), grid[10].toDouble(), Graph::getPenStyle(grid[9].toInt())); majPenY = majPenX; minPenY = minPenX; === modified file 'qtiplot/src/plot2D/ImageWidget.cpp' --- qtiplot/src/plot2D/ImageWidget.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/ImageWidget.cpp 2010-07-21 23:21:08 +0000 @@ -2,7 +2,7 @@ File : ImageWidget.cpp Project : QtiPlot -------------------------------------------------------------------- - Copyright : (C) 2008 by Ion Vasilief + Copyright : (C) 2008 - 2010 by Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : A widget displaying images in 2D plots @@ -29,6 +29,9 @@ #include "ImageWidget.h" #include "MultiLayer.h" #include +#include +#include +#include #include #include @@ -41,7 +44,8 @@ #include ImageWidget::ImageWidget(Graph *plot, const QString& fn):FrameWidget(plot), -d_save_xpm(false) +d_save_xpm(false), +d_window_name(QString::null) { if (load(fn, false)){ QSize picSize = d_pix.size(); @@ -59,7 +63,8 @@ } ImageWidget::ImageWidget(Graph *plot, const QImage& image):FrameWidget(plot), -d_save_xpm(true) +d_save_xpm(true), +d_window_name(QString::null) { d_pix = QPixmap::fromImage(image); @@ -108,10 +113,39 @@ return false; } +QPixmap ImageWidget::windowPixmap(ApplicationWindow *mw, const QString& name, const QSize& size) +{ + if (!mw || name.isEmpty()) + return QPixmap(); + + MdiSubWindow *w = mw->window(name); + MultiLayer *ml = qobject_cast (w); + if (ml) + return ml->canvasPixmap(size); + + Graph3D *g = qobject_cast (w); + if (g) + return g->surface()->renderPixmap(size.width(), size.height()); + + Table *t = qobject_cast
(w); + if (t) + return QPixmap::grabWidget(t->table()); + + return QPixmap(); +} + void ImageWidget::paintEvent(QPaintEvent *e) { - if (d_pix.isNull()) - return; + if (d_pix.isNull()){ + if (!d_window_name.isEmpty()){ + ApplicationWindow *mw = plot()->multiLayer()->applicationWindow(); + if (!mw) + return; + + d_pix = windowPixmap(mw, d_window_name, size()); + } else + return; + } QPainter p(this); draw(&p, rect()); === modified file 'qtiplot/src/plot2D/ImageWidget.h' --- qtiplot/src/plot2D/ImageWidget.h 2008-08-17 19:43:31 +0000 +++ qtiplot/src/plot2D/ImageWidget.h 2010-07-21 23:21:08 +0000 @@ -2,7 +2,7 @@ File : ImageWidget.h Project : QtiPlot -------------------------------------------------------------------- - Copyright : (C) 2008 by Ion Vasilief + Copyright : (C) 2008 - 2010 by Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : A widget displaying images in 2D plots @@ -32,6 +32,8 @@ #include #include "FrameWidget.h" +class ApplicationWindow; + class ImageWidget: public FrameWidget { Q_OBJECT @@ -60,6 +62,12 @@ void clone(ImageWidget* t); static void restore(Graph *g, const QStringList& lst); + //! Return d_window_name. + QString windowName(){return d_window_name;}; + void setWindowName(const QString& name){d_window_name = name;}; + + static QPixmap windowPixmap(ApplicationWindow *mw, const QString& name, const QSize& size); + private: void draw(QPainter *painter, const QRect& r); void paintEvent(QPaintEvent *e); @@ -68,6 +76,8 @@ QString d_file_name; //! Flag telling if the pixmap must be saved in the .qti project as XPM bool d_save_xpm; + //! The window whos image is drawn. + QString d_window_name; }; #endif === modified file 'qtiplot/src/plot2D/LegendWidget.cpp' --- qtiplot/src/plot2D/LegendWidget.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/LegendWidget.cpp 2010-07-21 23:21:08 +0000 @@ -168,7 +168,9 @@ if (d_plot->antialiasing()) p->setRenderHints(QPainter::Antialiasing); - p->setPen(QwtPainter::scaledPen(v->vectorPen())); + QPen pen = v->vectorPen(); + pen.setCosmetic(false); + p->setPen(QwtPainter::scaledPen(pen)); p->drawLine(x, y, x + l, y); p->translate(x + l, y); @@ -191,18 +193,21 @@ void LegendWidget::drawSymbol(PlotCurve *c, int point, QPainter *p, int x, int y, int l) { - if (!c || c->rtti() == QwtPlotItem::Rtti_PlotSpectrogram) - return; + if (!c || c->rtti() == QwtPlotItem::Rtti_PlotSpectrogram) + return; - if (c->type() == Graph::VectXYXY || c->type() == Graph::VectXYAM){ - drawVector(c, p, x, y, l); - return; - } + if (c->type() == Graph::VectXYXY || c->type() == Graph::VectXYAM){ + drawVector(c, p, x, y, l); + return; + } if (c->type() == Graph::Pie){ QwtPieCurve *pie = (QwtPieCurve *)c; const QBrush br = QBrush(pie->color(point), pie->pattern()); - QPen pen = QwtPainter::scaledPen(pie->pen()); + QPen pen = pie->pen(); + pen.setCosmetic(false); + pen = QwtPainter::scaledPen(pen); + p->save(); p->setPen (QPen(pen.color(), pen.widthF(), Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); QRect lr = QRect(x, y - l/4, l, l/2); @@ -212,27 +217,37 @@ return; } - p->save(); - if (c->style() != 0){ - p->setPen (QwtPainter::scaledPen(c->pen())); + p->save(); + if (c->style() != 0){ + QPen pen = c->pen(); + pen.setCosmetic(false); + p->setPen (QwtPainter::scaledPen(pen)); if (c->type() == Graph::VerticalBars || c->type() == Graph::HorizontalBars || c->type() == Graph::Histogram || c->type() == Graph::Box){ QRect lr = QRect(x, y - l/4, l, l/2); - p->setBrush(c->brush()); - QwtPainter::drawRect(p, lr); - } else - QwtPainter::drawLine(p, x, y, x + l, y); - } + p->setBrush(c->brush()); + QwtPainter::drawRect(p, lr); + + p->restore(); + return; + } else + QwtPainter::drawLine(p, x, y, x + l, y); + } QwtSymbol symb = c->symbol(); - int symb_size = symb.size().width(); - if (symb_size > 15) - symb_size = 15; - else if (symb_size < 3) - symb_size = 3; - symb.setSize(symb_size); - symb.draw(p, x + l/2, y); - p->restore(); + int symb_size = symb.size().width(); + if (symb_size > 15) + symb_size = 15; + else if (symb_size < 3) + symb_size = 3; + symb.setSize(symb_size); + + QPen pen = symb.pen(); + pen.setCosmetic(false); + symb.setPen(pen); + + symb.draw(p, x + l/2, y); + p->restore(); } void LegendWidget::drawText(QPainter *p, const QRect& rect, @@ -658,7 +673,7 @@ } if (plot()->isExportingTeX()){ - if (!d_tex_output) + if (!d_tex_output && plot()->escapeTeXStrings()) s = Graph::escapeTeXSpecialCharacters(s); s = Graph::texSuperscripts(s); @@ -719,6 +734,7 @@ setFont(t->font()); setText(t->text()); setOriginCoord(t->xValue(), t->yValue()); + setAttachPolicy(t->attachPolicy()); } QString LegendWidget::saveToString() === modified file 'qtiplot/src/plot2D/LineProfileTool.cpp' --- qtiplot/src/plot2D/LineProfileTool.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/LineProfileTool.cpp 2010-07-21 23:21:08 +0000 @@ -51,8 +51,13 @@ if (!d_target) QMessageBox::critical(d_graph->window(), tr("QtiPlot - Pixel selection warning"), tr("Please select an image marker first.")); + else + setParent(d_target); + d_graph->deselectMarker(); + setGeometry(0, 0, parentWidget()->width(), parentWidget()->height()); + setCursor(Qt::PointingHandCursor); show(); setFocus(); } @@ -87,11 +92,10 @@ y2 = int(y2*ratioY); } - QString text = tr("pixel") + "\tx\ty\t" + tr("intensity") + "\n"; + QString text = + "\n"; //uses the fast Bresenham's line-drawing algorithm #define sgn(x) ((x<0)?-1:((x>0)?1:0)) - int i = 0, n = 0; int dx = x2 - x1; //the horizontal distance of the line int dy = y2 - y1; //the vertical distance of the line int dxabs = abs(dx); @@ -103,39 +107,41 @@ int px = x1; int py = y1; - if (dxabs>=dyabs){ //the line is more horizontal than vertical - for(i=0;i=dxabs){ - y-=dxabs; - py+=sdy; + int n = (dxabs >= dyabs) ? dxabs : dyabs; + Table *t = d_app->newTable(n, 4, QString::null, QString::null); + t->setHeader(QStringList() << tr("pixel") << tr("x") << tr("y") << tr("intensity")); + + if (dxabs >= dyabs){ //the line is more horizontal than vertical + for(int i = 0; i< dxabs; i++){ + y += dyabs; + if (y >= dxabs){ + y -= dxabs; + py += sdy; } - px+=sdx; + px += sdx; - n=dxabs; - text+=QString::number(i)+"\t"; - text+=QString::number(px)+"\t"; - text+=QString::number(py)+"\t"; - text+=QString::number(averageImagePixel(image, px, py, true))+"\n"; + t->setText(i, 0, QString::number(i)); + t->setText(i, 1, QString::number(px)); + t->setText(i, 2, QString::number(py)); + t->setCell(i, 3, averageImagePixel(image, px, py, true)); } } else {// the line is more vertical than horizontal - for(i=0;i=dyabs){ - x-=dyabs; - px+=sdx; + for(int i = 0; i < dyabs; i++){ + x += dxabs; + if (x >= dyabs){ + x -= dyabs; + px += sdx; } - py+=sdy; + py += sdy; - n=dyabs; - text+=QString::number(i)+"\t"; - text+=QString::number(px)+"\t"; - text+=QString::number(py)+"\t"; - text+=QString::number(averageImagePixel(image, px, py, false))+"\n"; + t->setText(i, 0, QString::number(i)); + t->setText(i, 1, QString::number(px)); + t->setText(i, 2, QString::number(py)); + t->setCell(i, 3, averageImagePixel(image, px, py, true)); } } + t->showNormal(); - Table *t = d_app->newTable(tr("Table") + "1", n, 4, text); MultiLayer* plot = d_app->multilayerPlot(t, QStringList(QString(t->objectName())+"_intensity"), 0); Graph *g = (Graph*)plot->activeLayer(); if (g){ @@ -146,7 +152,7 @@ } -int LineProfileTool::averageImagePixel(const QImage& image, int px, int py, bool moreHorizontal) +double LineProfileTool::averageImagePixel(const QImage& image, int px, int py, bool moreHorizontal) { QRgb pixel; int sum=0,start,i; @@ -164,7 +170,7 @@ sum+=qGray(pixel); } } - return sum/d_average_pixels; + return (double)sum/(double)d_average_pixels; } void LineProfileTool::paintEvent(QPaintEvent *) @@ -186,6 +192,13 @@ { d_op_dp = e->pos() - d_op_start; repaint(); + + QRect rect = d_target->geometry(); + if (!rect.contains(e->pos())) + setCursor(Qt::ArrowCursor); + else + setCursor(Qt::PointingHandCursor); + e->accept(); } === modified file 'qtiplot/src/plot2D/LineProfileTool.h' --- qtiplot/src/plot2D/LineProfileTool.h 2008-08-17 19:43:31 +0000 +++ qtiplot/src/plot2D/LineProfileTool.h 2010-07-21 23:21:08 +0000 @@ -77,7 +77,7 @@ void statusText(const QString&); protected: - int averageImagePixel(const QImage &image, int px, int py, bool moreHorizontal); + double averageImagePixel(const QImage &image, int px, int py, bool moreHorizontal); /*!\brief Draw line during operation. */ virtual void paintEvent(QPaintEvent *e); === modified file 'qtiplot/src/plot2D/LnScaleEngine.cpp' --- qtiplot/src/plot2D/LnScaleEngine.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/LnScaleEngine.cpp 2010-07-21 23:21:08 +0000 @@ -177,7 +177,7 @@ } QwtValueList LnScaleEngine::buildMinorTicks(const QwtValueList &majorTicks, - int maxMinSteps, double stepSize) const + int maxMinSteps, double) const { if ( maxMinSteps < 1 ) return QwtValueList(); === modified file 'qtiplot/src/plot2D/LogitScaleEngine.cpp' --- qtiplot/src/plot2D/LogitScaleEngine.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/LogitScaleEngine.cpp 2010-07-21 23:21:08 +0000 @@ -93,7 +93,7 @@ QwtScaleDiv scaleDiv; if ( stepSize != 0.0 ){ QwtValueList ticks[QwtScaleDiv::NTickTypes]; - buildTicks(interval, stepSize, ticks); + buildTicks(interval, (int)stepSize, ticks); scaleDiv = QwtScaleDiv(interval, ticks); } === modified file 'qtiplot/src/plot2D/MultiLayer.cpp' --- qtiplot/src/plot2D/MultiLayer.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/MultiLayer.cpp 2010-07-21 23:21:08 +0000 @@ -2,7 +2,7 @@ File : MultiLayer.cpp Project : QtiPlot -------------------------------------------------------------------- - Copyright : (C) 2006 - 2009 by Ion Vasilief + Copyright : (C) 2006 - 2010 by Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : Multi layer widget @@ -68,8 +68,10 @@ #include "Spectrogram.h" #include "SelectionMoveResizer.h" #include +#include #include -#include +#include + #include LayerButton::LayerButton(const QString& text, QWidget* parent) @@ -109,8 +111,8 @@ right_margin(5), top_margin(5), bottom_margin(5), -l_canvas_width(400), -l_canvas_height(300), +l_canvas_width(parent->d_layer_canvas_width), +l_canvas_height(parent->d_layer_canvas_height), hor_align(HCenter), vert_align(VCenter), d_scale_on_print(true), @@ -120,7 +122,11 @@ d_waterfall_offset_y(3), d_is_waterfall_plot(false), d_side_lines(false), -d_waterfall_fill_color(QColor()) +d_waterfall_fill_color(QColor()), +d_canvas_size(QSize()), +d_align_policy(AlignLayers), +d_size_policy(UserSize), +d_link_x_axes(false) { layerButtonsBox = new QHBoxLayout(); waterfallBox = new QHBoxLayout(); @@ -128,7 +134,7 @@ d_add_layer_btn = new QPushButton(); d_add_layer_btn->setToolTip(tr("Add layer")); - d_add_layer_btn->setIcon(QIcon(QPixmap(plus_xpm))); + d_add_layer_btn->setIcon(QIcon(":/plus.png")); d_add_layer_btn->setMaximumWidth(LayerButton::btnSize()); d_add_layer_btn->setMaximumHeight(LayerButton::btnSize()); connect (d_add_layer_btn, SIGNAL(clicked()), this->applicationWindow(), SLOT(addLayer())); @@ -136,7 +142,7 @@ d_remove_layer_btn = new QPushButton(); d_remove_layer_btn->setToolTip(tr("Remove active layer")); - d_remove_layer_btn->setIcon(QIcon(QPixmap(delete_xpm))); + d_remove_layer_btn->setIcon(QIcon(":/delete.png")); d_remove_layer_btn->setMaximumWidth(LayerButton::btnSize()); d_remove_layer_btn->setMaximumHeight(LayerButton::btnSize()); connect (d_remove_layer_btn, SIGNAL(clicked()), this, SLOT(confirmRemoveLayer())); @@ -165,11 +171,11 @@ layout->setSpacing(0); setWidget(mainWidget); - int canvas_width = graph_width + left_margin + right_margin; - int canvas_height = graph_height + top_margin + bottom_margin; + int canvas_width = graph_width + left_margin + right_margin; + int canvas_height = graph_height + top_margin + bottom_margin; resize(canvas_width, canvas_height + LayerButton::btnSize()); - d_canvas->resize(canvas_width, canvas_height); + d_canvas->resize(canvas_width, canvas_height); d_canvas->installEventFilter(this); QPalette pal = palette(); @@ -207,7 +213,7 @@ return button; } -Graph* MultiLayer::addLayer(int x, int y, int width, int height) +Graph* MultiLayer::addLayer(int x, int y, int width, int height, bool setPreferences) { addLayerButton(); if (!width && !height){ @@ -228,6 +234,9 @@ graphsList.append(g); active_graph = g; + if (setPreferences) + applicationWindow()->setPreferences(g); + connectLayer(g); return g; } @@ -309,12 +318,13 @@ if (size.height() <= 0) size.setHeight(oldSize.height()); - bool scaleLayerFonts = false; if(!oldSize.isValid()){// The old size is invalid when maximizing a window (why?) - QRect r = canvasChildrenRect(); - oldSize = QSize(r.width() + left_margin + right_margin, - r.height() + top_margin + bottom_margin); - scaleLayerFonts = true; + if (d_canvas_size.isValid()) + oldSize = d_canvas_size; + else { + QRect r = canvasChildrenRect(); + oldSize = QSize(r.width() + left_margin + right_margin, r.height() + top_margin + bottom_margin); + } } double w_ratio = (double)size.width()/(double)oldSize.width(); @@ -325,11 +335,12 @@ int gy = qRound(g->y()*h_ratio); int gw = qRound(g->width()*w_ratio); int gh = qRound(g->height()*h_ratio); - g->setGeometry(QRect(gx, gy, gw, gh)); + g->setGeometry(gx, gy, gw, gh); - if (scaleLayerFonts && g->autoscaleFonts()) + if (g->autoscaleFonts()) g->scaleFonts(h_ratio); } + emit modifiedPlot(); } @@ -451,6 +462,11 @@ QSize MultiLayer::arrangeLayers(bool userSize) { + if (userSize) + d_size_policy = UserSize; + else + d_size_policy = Expanding; + int layers = graphsList.size(); const QRect rect = d_canvas->geometry(); @@ -549,7 +565,6 @@ return QSize(); QSize size = QSize(l_canvas_width, l_canvas_height); - for (int i=0; i= d_rows ) @@ -561,39 +576,54 @@ const int w = int (l_canvas_width*(1 + gsl_vector_get(yLeftR, i) + gsl_vector_get(yRightR, i))); const int h = int (l_canvas_height*(1 + gsl_vector_get(xTopR, i) + gsl_vector_get(xBottomR, i))); - int x = left_margin + col*colsSpace; - if (hor_align == HCenter) - x += int (l_canvas_width*(gsl_vector_get(X, col) + gsl_vector_get(maxYLeftWidth, col) - gsl_vector_get(yLeftR, i))); - else if (hor_align == Left) - x += int(l_canvas_width*gsl_vector_get(X, col)); - else if (hor_align == Right) - x += int(l_canvas_width*(gsl_vector_get(X, col) + gsl_vector_get(maxYLeftWidth, col) - gsl_vector_get(yLeftR, i)+ - gsl_vector_get(maxYRightWidth, col) - gsl_vector_get(yRightR, i))); - - int y = top_margin + row*rowsSpace; - if (vert_align == VCenter) - y += int(l_canvas_height*(gsl_vector_get(Y, row) + gsl_vector_get(maxXTopHeight, row) - gsl_vector_get(xTopR, i))); - else if (vert_align == Top) - y += int(l_canvas_height*gsl_vector_get(Y, row)); - else if (vert_align == Bottom) - y += int(l_canvas_height*(gsl_vector_get(Y, row) + gsl_vector_get(maxXTopHeight, row) - gsl_vector_get(xTopR, i)+ - + gsl_vector_get(maxXBottomHeight, row) - gsl_vector_get(xBottomR, i))); + int x = left_margin; + int y = top_margin; + + Graph *lg = 0; + if (col){ + int index = i - 1; + if (index >= 0){ + lg = graphsList.at(index);//left neighbour + if (lg) + x = lg->x() + lg->width() + colsSpace; + } + } + + Graph *tg = 0; + if (row){ + int index = i - d_cols; + if (index >= 0){ + tg = graphsList.at(index);//top neighbour + if (tg) + y = tg->y() + tg->height() + rowsSpace; + } + } //resizes and moves layers Graph *g = (Graph *)graphsList.at(i); - bool autoscaleFonts = false; - if (!userSize){//When the user specifies the layer d_canvas size, the window is resized - //and the fonts must be scaled accordingly. If the size is calculated - //automatically we don't rescale the fonts in order to prevent problems - //with too small fonts when the user adds new layers or when removing layers - - autoscaleFonts = g->autoscaleFonts();//save user settings - g->setAutoscaleFonts(false); + bool autoscaleFonts = g->autoscaleFonts();//save user font settings + g->setAutoscaleFonts(false); + + if (userSize) + g->setCanvasSize(size); + else + g->resize(w, h); + + g->move(x, y); + + if (d_align_policy == AlignCanvases){ + QPoint pos = g->mapTo(d_canvas, g->canvas()->pos()); + if (col && lg){ + pos.setX(lg->mapTo(d_canvas, lg->canvas()->pos()).x() + lg->canvas()->width() + colsSpace); + pos.setY(lg->mapTo(d_canvas, lg->canvas()->pos()).y()); + } else if (row && tg){ + pos.setX(tg->mapTo(d_canvas, tg->canvas()->pos()).x()); + pos.setY(tg->mapTo(d_canvas, tg->canvas()->pos()).y() + tg->canvas()->height() + rowsSpace); + } + g->setCanvasGeometry(QRect(pos, size)); } - g->setGeometry(QRect(x, y, w, h)); - if (!userSize) - g->setAutoscaleFonts(autoscaleFonts);//restore user settings + g->setAutoscaleFonts(autoscaleFonts);//restore user font settings } //free memory @@ -602,9 +632,91 @@ gsl_vector_free (xTopR); gsl_vector_free (xBottomR); gsl_vector_free (yLeftR); gsl_vector_free (yRightR); gsl_vector_free (X); gsl_vector_free (Y); + + if (!graphsList.isEmpty()){ + Graph *g = graphsList[0]; + if (g){ + size = g->canvas()->size();//return the real size of the canvas + l_canvas_width = size.width(); + l_canvas_height = size.height(); + } + } return size; } +void MultiLayer::setCommonLayerAxes(bool verticalAxis, bool horizontalAxis) +{ + int layers = graphsList.size(); + for (int i=0; i= d_rows ) + row = d_rows - 1; + + int col = i % d_cols; + + int index = i - 1; //left neighbour + if (verticalAxis && col && index >= 0){ + Graph *aux = graphsList.at(index); + if (aux){ + QwtScaleWidget *scale = aux->axisWidget(QwtPlot::yRight); + if (scale){ + scale->setTitle(QString::null); + QwtScaleDraw *sd = aux->axisScaleDraw(QwtPlot::yRight); + if (sd) + sd->enableComponent(QwtAbstractScaleDraw::Labels, false); + } + } + } + + index = i - d_cols; + if (horizontalAxis && row && index >= 0){ + Graph *aux = graphsList.at(index);//top neighbour + if (aux){ + QwtScaleWidget *scale = aux->axisWidget(QwtPlot::xBottom); + if (scale){ + scale->setTitle(QString::null); + QwtScaleDraw *sd = aux->axisScaleDraw(QwtPlot::xBottom); + if (sd) + sd->enableComponent(QwtAbstractScaleDraw::Labels, false); + } + } + } + + Graph *g = (Graph *)graphsList.at(i); + if (!g) + continue; + + QColor c = Qt::white; + c.setAlpha(0); + g->setBackgroundColor(c); + g->setCanvasBackground(c); + + if (horizontalAxis && row && !g->title().text().isEmpty()) + g->setTitle(QString::null); + + if (verticalAxis && col){ + QwtScaleWidget *scale = g->axisWidget(QwtPlot::yLeft); + if (scale){ + scale->setTitle(QString::null); + QwtScaleDraw *sd = g->axisScaleDraw(QwtPlot::yLeft); + if (sd) + sd->enableComponent(QwtAbstractScaleDraw::Labels, false); + } + } + + if (horizontalAxis && row){ + QwtScaleWidget *scale = g->axisWidget(QwtPlot::xTop); + if (scale){ + scale->setTitle(QString::null); + QwtScaleDraw *sd = g->axisScaleDraw(QwtPlot::xTop); + if (sd) + sd->enableComponent(QwtAbstractScaleDraw::Labels, false); + } + } + g->updateLayout(); + } +} + void MultiLayer::findBestLayout(int &d_rows, int &d_cols) { int layers = graphsList.size(); @@ -630,9 +742,10 @@ if (fit) findBestLayout(d_rows, d_cols); - //the d_canvas sizes of all layers become equal only after several - //resize iterations, due to the way Qwt handles the plot layout - int iterations = 0; + bool minimized = isMinimized(); + if (minimized) + showNormal(); + QSize size = arrangeLayers(userSize); if (!size.isValid()){ QApplication::restoreOverrideCursor(); @@ -640,27 +753,40 @@ return false; } - QSize canvas_size = QSize(1,1); - while (canvas_size != size && iterations < 10){ - iterations++; - canvas_size = size; - size = arrangeLayers(userSize); - if (!size.isValid()){ - QApplication::restoreOverrideCursor(); - setEqualSizedLayers(); - return false; + int fw = width() - d_canvas->width();//frame width + int fh = height() - d_canvas->height();//frame height + + if (!userSize){ + //the d_canvas sizes of all layers become equal only after several + //resize iterations, due to the way Qwt handles the plot layout + int iterations = 0; + QSize canvas_size = QSize(1, 1); + while (canvas_size != size && iterations < 10){ + iterations++; + canvas_size = size; + size = arrangeLayers(userSize); + if (!size.isValid()){ + QApplication::restoreOverrideCursor(); + setEqualSizedLayers(); + return false; + } } - } + } else if (!this->isMaximized()){//resize window to fit new dimensions of the layers + bool resizeLayers = d_scale_layers; + d_scale_layers = false; - if (userSize){//resize window - this->showNormal(); QSize size = d_canvas->childrenRect().size(); - this->resize(d_canvas->x() + size.width() + left_margin + 2*right_margin, - d_canvas->y() + size.height() + bottom_margin + 2*LayerButton::btnSize()); + resize(d_canvas->x() + size.width() + left_margin + right_margin + fw, d_canvas->y() + size.height() + fh - bottom_margin); + + d_scale_layers = resizeLayers; } + if (minimized) + showMinimized(); + emit modifiedPlot(); QApplication::restoreOverrideCursor(); + return true; } @@ -676,18 +802,32 @@ d_rows = r; } -QPixmap MultiLayer::canvasPixmap(const QSize& size, double scaleFontsFactor) +QList MultiLayer::stackOrderedLayersList() +{ + QList gLst; + QObjectList lst = d_canvas->children();//! this list is sorted according to the stack order + foreach (QObject *o, lst){ + Graph *g = qobject_cast(o); + if (g) + gLst << g; + } + return gLst; +} + +QPixmap MultiLayer::canvasPixmap(const QSize& size, double scaleFontsFactor, bool transparent) { if (!size.isValid()){ QPixmap pic(d_canvas->size()); - pic.fill(); + if (transparent) + pic.fill(Qt::transparent); + else + pic.fill(); QPainter p(&pic); - QObjectList lst = d_canvas->children();//! this list is sorted according to the stack order - foreach (QObject *o, lst){ - Graph *g = qobject_cast(o); - if (g) - g->print(&p, g->geometry()); - } + + QList lst = stackOrderedLayersList(); + foreach (Graph *g, lst) + g->print(&p, g->geometry()); + p.end(); return pic; } @@ -699,14 +839,14 @@ scaleFontsFactor = scaleFactorY; QPixmap pic(size); - pic.fill(); + if (transparent) + pic.fill(Qt::transparent); + else + pic.fill(); QPainter p(&pic); - QObjectList lst = d_canvas->children(); - foreach (QObject *o, lst){ - Graph *g = qobject_cast(o); - if (!g) - continue; + QList lst = stackOrderedLayersList(); + foreach (Graph *g, lst){ QPoint pos = g->pos(); pos = QPoint(int(pos.x()*scaleFactorX), int(pos.y()*scaleFactorY)); @@ -766,28 +906,8 @@ if (customSize.isValid()) size = Graph::customPrintSize(customSize, unit, dpi); - QPixmap pic = canvasPixmap(size, fontsFactor); + QPixmap pic = canvasPixmap(size, fontsFactor, transparent); QImage image = pic.toImage(); - - if (transparent){ - QBitmap mask(size); - mask.fill(Qt::color1); - QPainter p(&mask); - p.setPen(Qt::color0); - - QRgb backgroundPixel = QColor(Qt::white).rgb (); - for (int y = 0; y < image.height(); y++){ - for (int x = 0; x < image.width(); x++){ - QRgb rgb = image.pixel(x, y); - if (rgb == backgroundPixel) // we want the frame transparent - p.drawPoint(x, y); - } - } - p.end(); - pic.setMask(mask); - image = pic.toImage(); - } - int dpm = (int)ceil(100.0/2.54*dpi); image.setDotsPerMeterX(dpm); image.setDotsPerMeterY(dpm); @@ -871,6 +991,7 @@ printer.setResolution(logicalDpiX());//we set screen resolution as default printer.setDocName (objectName()); + printer.setFontEmbeddingEnabled(true); printer.setCreator("QtiPlot"); printer.setFullPage(true); printer.setOutputFileName(fileName); @@ -889,11 +1010,8 @@ printer.setResolution(res); printer.setPaperSize (QSizeF(size), QPrinter::DevicePixel); QPainter paint(&printer); - QObjectList lst = d_canvas->children(); - foreach (QObject *o, lst){ - Graph *g = qobject_cast(o); - if (!g) - continue; + QList lst = stackOrderedLayersList(); + foreach (Graph *g, lst){ QRect r = g->geometry(); double wfactor = (double)size.width()/(double)d_canvas->width(); double hfactor = (double)size.height()/(double)d_canvas->height(); @@ -911,29 +1029,21 @@ double wfactor = (double)res/(double)logicalDpiX(); double hfactor = (double)res/(double)logicalDpiY(); printer.setResolution(res); - QRect cr = canvasChildrenRect(); - printer.setPaperSize (QSizeF(cr.width()*wfactor*1.05, cr.height()*hfactor), QPrinter::DevicePixel); + printer.setPaperSize (QSizeF(d_canvas->width()*wfactor*1.05, d_canvas->height()*hfactor), QPrinter::DevicePixel); QPainter paint(&printer); - QObjectList lst = d_canvas->children(); - foreach (QObject *o, lst){ - Graph *g = qobject_cast(o); - if (!g) - continue; + QList lst = stackOrderedLayersList(); + foreach (Graph *g, lst){ QRect r = g->geometry(); r.setSize(QSize(int(r.width()*wfactor), int(r.height()*hfactor))); r.moveTo(int(r.x()*wfactor), int(r.y()*hfactor)); g->print(&paint, r); } } else { - QRect cr = canvasChildrenRect(); - printer.setPaperSize(QSizeF(cr.width(), cr.height()), QPrinter::DevicePixel); + printer.setPaperSize(QSizeF(d_canvas->width(), d_canvas->height()), QPrinter::DevicePixel); QPainter paint(&printer); - QObjectList lst = d_canvas->children(); - foreach (QObject *o, lst){ - Graph *g = qobject_cast(o); - if (g) - g->print(&paint, g->geometry()); - } + QList lst = stackOrderedLayersList(); + foreach (Graph *g, lst) + g->print(&paint, g->geometry()); } } @@ -945,11 +1055,8 @@ if (customSize.isValid()){ QSize size = Graph::customPrintSize(customSize, unit, res); - QObjectList lst = d_canvas->children(); - foreach (QObject *o, lst){ - Graph *g = qobject_cast(o); - if (!g) - continue; + QList lst = stackOrderedLayersList(); + foreach (Graph *g, lst){ QRect r = g->geometry(); double wfactor = (double)size.width()/(double)d_canvas->width(); double hfactor = (double)size.height()/(double)d_canvas->height(); @@ -964,12 +1071,9 @@ g->scaleFonts(1.0/fontsFactor); } } else { - QObjectList lst = d_canvas->children(); - foreach (QObject *o, lst){ - Graph *g = qobject_cast(o); - if (g) - g->print(&paint, g->geometry()); - } + QList lst = stackOrderedLayersList(); + foreach (Graph *g, lst) + g->print(&paint, g->geometry()); } paint.end(); QApplication::restoreOverrideCursor(); @@ -978,10 +1082,13 @@ void MultiLayer::exportSVG(const QString& fname, const QSizeF& customSize, int unit, double fontsFactor) { int res = 96; +#ifdef Q_OS_MAC + res = 72; +#endif QSvgGenerator svg; svg.setFileName(fname); - svg.setSize(canvasChildrenRect().size()); + svg.setSize(d_canvas->size()); svg.setResolution(res); if (customSize.isValid()){ @@ -996,7 +1103,7 @@ void MultiLayer::exportEMF(const QString& fname, const QSizeF& customSize, int unit, double fontsFactor) { int res = logicalDpiX(); - QSize size = canvasChildrenRect().size(); + QSize size = d_canvas->size(); if (customSize.isValid()) size = Graph::customPrintSize(customSize, unit, res); @@ -1008,7 +1115,7 @@ void MultiLayer::exportTeX(const QString& fname, bool color, bool escapeStrings, bool fontSizes, const QSizeF& customSize, int unit, double fontsFactor) { int res = logicalDpiX(); - QSize size = canvasChildrenRect().size(); + QSize size = d_canvas->size(); if (customSize.isValid()) size = Graph::customPrintSize(customSize, unit, res); @@ -1070,11 +1177,8 @@ void MultiLayer::printActiveLayer() { - if (active_graph){ - active_graph->setScaleOnPrint(d_scale_on_print); - active_graph->printCropmarks(d_print_cropmarks); + if (active_graph) active_graph->print(); - } } void MultiLayer::print() @@ -1086,15 +1190,15 @@ printer.setOutputFileName(objectName()); #endif - QRect canvasRect = d_canvas->rect(); - double aspect = double(canvasRect.width())/double(canvasRect.height()); - if (aspect < 1) - printer.setOrientation(QPrinter::Portrait); - else - printer.setOrientation(QPrinter::Landscape); + QRect canvasRect = d_canvas->rect(); + double aspect = double(canvasRect.width())/double(canvasRect.height()); + if (aspect < 1) + printer.setOrientation(QPrinter::Portrait); + else + printer.setOrientation(QPrinter::Landscape); - QPrintDialog printDialog(&printer, applicationWindow()); - if (printDialog.exec() == QDialog::Accepted){ + QPrintDialog printDialog(&printer, applicationWindow()); + if (printDialog.exec() == QDialog::Accepted){ #ifdef Q_OS_LINUX if (printDialog.enabledOptions() & QAbstractPrintDialog::PrintToFile){ QString fn = printer.outputFileName(); @@ -1208,8 +1312,6 @@ { connect (g,SIGNAL(drawLineEnded(bool)), this, SIGNAL(drawLineEnded(bool))); connect (g,SIGNAL(showPlotDialog(int)),this,SIGNAL(showPlotDialog(int))); - connect (g,SIGNAL(createTable(const QString&,int,int,const QString&)), - this,SIGNAL(createTable(const QString&,int,int,const QString&))); connect (g,SIGNAL(viewLineDialog()),this,SIGNAL(showLineDialog())); connect (g,SIGNAL(showContextMenu()),this,SIGNAL(showGraphContextMenu())); connect (g,SIGNAL(showAxisDialog(int)),this,SIGNAL(showAxisDialog(int))); @@ -1223,7 +1325,9 @@ connect (g,SIGNAL(modifiedGraph()),this,SLOT(notifyChanges())); connect (g,SIGNAL(selectedGraph(Graph*)),this, SLOT(setActiveLayer(Graph*))); connect (g,SIGNAL(currentFontChanged(const QFont&)), this, SIGNAL(currentFontChanged(const QFont&))); - connect (g,SIGNAL(enableTextEditor(Graph *)), this, SIGNAL(enableTextEditor(Graph *))); + connect (g,SIGNAL(enableTextEditor(Graph *)), this, SIGNAL(enableTextEditor(Graph *))); + if (d_link_x_axes) + connect(g, SIGNAL(axisDivChanged(Graph *, int)), this, SLOT(updateLayerAxes(Graph *, int))); } bool MultiLayer::eventFilter(QObject *object, QEvent *e) @@ -1232,6 +1336,7 @@ d_canvas->setUpdatesEnabled(false); resizeLayers((QResizeEvent *)e); d_canvas->setUpdatesEnabled(true); + d_canvas_size = d_canvas->size(); } else if (e->type() == QEvent::MouseButtonPress && object == (QObject *)d_canvas){ const QMouseEvent *me = (const QMouseEvent *)e; if (me->button() == Qt::RightButton) @@ -1243,11 +1348,13 @@ QPoint pos = d_canvas->mapFromParent(me->pos()); // iterate backwards, so layers on top are preferred for selection QList::iterator i = graphsList.end(); - while (i != graphsList.begin()) { + while (i != graphsList.begin()){ --i; Graph *g = *i; - if (g->hasSeletedItems()) + if (g->hasSeletedItems()){ + g->deselect(); return true; + } QRect igeo = (*i)->frameGeometry(); if (igeo.contains(pos)) { @@ -1278,8 +1385,13 @@ void MultiLayer::keyPressEvent(QKeyEvent * e) { - if (e->key() == Qt::Key_Escape && d_layers_selector){ - delete d_layers_selector; + if (e->key() == Qt::Key_Escape){ + if (d_layers_selector) + delete d_layers_selector; + else { + foreach (Graph *g, graphsList) + g->deselect(); + } return; } @@ -1396,6 +1508,7 @@ t << "Spacing\t"+QString::number(rowsSpace)+"\t"+QString::number(colsSpace)+"\n"; t << "LayerCanvasSize\t"+QString::number(l_canvas_width)+"\t"+QString::number(l_canvas_height)+"\n"; t << "Alignement\t"+QString::number(hor_align)+"\t"+QString::number(vert_align)+"\n"; + t << "" + QString::number(d_align_policy) + "\n"; foreach (Graph *g, graphsList) t << g->saveToString(saveAsTemplate); @@ -1406,6 +1519,7 @@ t << QString::number(d_side_lines) + "\n"; } + t << "" + QString::number(d_link_x_axes) + "\n"; t << "\n"; } @@ -1485,7 +1599,7 @@ break; } } - }else{ + } else { for (int i = 0; i < abs(dn); i++) addLayer(); } @@ -1495,18 +1609,19 @@ void MultiLayer::copy(MultiLayer* ml) { - hide();//FIXME: find a better way to avoid a resize event resize(ml->size()); setSpacing(ml->rowsSpacing(), ml->colsSpacing()); setAlignement(ml->horizontalAlignement(), ml->verticalAlignement()); setMargins(ml->leftMargin(), ml->rightMargin(), ml->topMargin(), ml->bottomMargin()); - - QObjectList lst = ml->canvas()->children(); - foreach (QObject *o, lst){ - Graph *g = qobject_cast(o); - if (!g) - continue; + d_size_policy = ml->sizePolicy(); + d_align_policy = ml->alignPolicy(); + + d_scale_on_print = ml->scaleLayersOnPrint(); + d_print_cropmarks = ml->printCropmarksEnabled(); + + QList lst = ml->stackOrderedLayersList(); + foreach (Graph *g, lst){ Graph* g2 = addLayer(g->pos().x(), g->pos().y(), g->width(), g->height()); g2->setAutoscaleFonts(false); g2->copy(g); @@ -1520,7 +1635,8 @@ setWaterfallSideLines(ml->sideLinesEnabled()); } - show(); + d_scale_layers = ml->scaleLayersOnResize(); + linkXLayerAxes(ml->hasLinkedXLayerAxes()); } bool MultiLayer::swapLayers(int src, int dest) @@ -1783,11 +1899,22 @@ QList lst; foreach(Graph *g, graphsList){ + QList texts = g->textsList(); + QList autoUpdateLegends; + foreach (LegendWidget *l, texts){ + autoUpdateLegends << l->isAutoUpdateEnabled(); + l->setAutoUpdate(false); + } + QwtPlotItem *c = g->curve(0); if (c){ lst << c; g->removeCurve(c); } + + texts = g->textsList(); + foreach (LegendWidget *l, texts) + l->setAutoUpdate(autoUpdateLegends[texts.indexOf(l)]); } if (lst.isEmpty()) @@ -1859,11 +1986,8 @@ d_side_lines = on; - QObjectList lst = d_canvas->children(); - foreach (QObject *o, lst){ - Graph *g = qobject_cast(o); - if (!g) - continue; + QList lst = stackOrderedLayersList(); + foreach (Graph *g, lst){ PlotCurve *cv = (PlotCurve *)g->curve(0); if (cv){ cv->enableSideLines(on); @@ -1880,11 +2004,8 @@ d_waterfall_fill_color = c; - QObjectList lst = d_canvas->children(); - foreach (QObject *o, lst){ - Graph *g = qobject_cast(o); - if (!g) - continue; + QList lst = stackOrderedLayersList(); + foreach (Graph *g, lst){ QwtPlotCurve *cv = (QwtPlotCurve *)g->curve(0); if (cv){ cv->setBrush(QBrush(c)); @@ -1896,11 +2017,8 @@ void MultiLayer::updateWaterfallFill(bool on) { - QObjectList lst = d_canvas->children(); - foreach (QObject *o, lst){ - Graph *g = qobject_cast(o); - if (!g) - continue; + QList lst = stackOrderedLayersList(); + foreach (Graph *g, lst){ PlotCurve *cv = (PlotCurve *)g->curve(0); if (cv){ if (on) @@ -1943,11 +2061,131 @@ clone->copy(g); } +void MultiLayer::plotProfiles(Matrix* m) +{ + if (!m) + return; + + double mmin, mmax; + m->range(&mmin, &mmax); + Graph* g = addLayer(); + + Spectrogram *s = g->plotSpectrogram(m, Graph::GrayScale); + if (!s) + return; + + s->setAxis(QwtPlot::xTop, QwtPlot::yLeft); + g->enableAxis(QwtPlot::xTop, true); + g->setScale(QwtPlot::xTop, QMIN(m->xStart(), m->xEnd()), QMAX(m->xStart(), m->xEnd())); + g->setScale(QwtPlot::xBottom, QMIN(m->xStart(), m->xEnd()), QMAX(m->xStart(), m->xEnd())); + g->enableAxis(QwtPlot::xBottom, false); + g->enableAxis(QwtPlot::yRight, false); + g->setScale(QwtPlot::yLeft, QMIN(m->yStart(), m->yEnd()), QMAX(m->yStart(), m->yEnd()), + 0.0, 5, 5, Graph::Linear, true); + g->setAxisTitle(QwtPlot::yLeft, QString::null); + g->setAxisTitle(QwtPlot::xTop, QString::null); + g->setTitle(QString::null); + g->enableAutoscaling(false); + g->setCanvasGeometry(QRect(60, 150, 400, 400)); + + g = addLayer(); + + g->enableAxis(QwtPlot::xTop, false); + g->enableAxis(QwtPlot::xBottom, true); + g->setScale(QwtPlot::xBottom, QMIN(m->xStart(), m->xEnd()), QMAX(m->xStart(), m->xEnd())); + g->enableAxisLabels(QwtPlot::xBottom, false); + + g->enableAxis(QwtPlot::yRight, false); + g->setScale(QwtPlot::yLeft, mmin, mmax); + g->setAxisTitle(QwtPlot::yLeft, QString::null); + g->setAxisTitle(QwtPlot::xBottom, QString::null); + g->setTitle(QString::null); + g->enableAutoscaling(false); + g->setCanvasGeometry(QRect(60, 0, 400, 100)); + + g = addLayer(); + + g->enableAxis(QwtPlot::xTop, true); + g->setScale(QwtPlot::xTop, mmin, mmax); + g->setAxisLabelRotation(QwtPlot::xTop, 90); + g->setScale(QwtPlot::xBottom, mmin, mmax); + g->enableAxis(QwtPlot::xBottom, false); + g->enableAxis(QwtPlot::yRight, false); + g->setScale(QwtPlot::yLeft, QMIN(m->yStart(), m->yEnd()), QMAX(m->yStart(), m->yEnd()), + 0.0, 5, 5, Graph::Linear, true); + + g->setAxisTitle(QwtPlot::yLeft, QString::null); + g->setAxisTitle(QwtPlot::xTop, QString::null); + g->setTitle(QString::null); + g->enableAutoscaling(false); + g->setCanvasGeometry(QRect(500, 150, 110, 400)); + + QColor color = Qt::white; + color.setAlpha(0); + foreach(Graph *g, graphsList) + g->setBackgroundColor(color); +} + +void MultiLayer::linkXLayerAxes(bool link) +{ + d_link_x_axes = link; + + if (link){ + foreach(Graph *g, graphsList) + connect(g, SIGNAL(axisDivChanged(Graph *, int)), this, SLOT(updateLayerAxes(Graph *, int))); + } else { + foreach(Graph *g, graphsList) + disconnect(g, SIGNAL(axisDivChanged(Graph *, int)), this, SLOT(updateLayerAxes(Graph *, int))); + } +} + +void MultiLayer::updateLayerAxes(Graph *g, int axis) +{ + if (!g || (axis != Graph::xBottom && axis != Graph::xTop)) + return; + + ScaleEngine *se = (ScaleEngine *)g->axisScaleEngine (axis); + const QwtScaleDiv *sd = g->axisScaleDiv(axis); + if (!se || !sd) + return; + + int majorTicks = g->axisMaxMajor(axis); + int minorTicks = g->axisMaxMinor(axis); + double step = g->axisStep(axis); + + foreach(Graph *l, graphsList){ + if (l == g) + continue; + + l->blockSignals(true); + l->setScale(axis, sd->lowerBound(), sd->upperBound(), step, majorTicks, minorTicks, + se->type(), se->testAttribute(QwtScaleEngine::Inverted), + se->axisBreakLeft(), se->axisBreakRight(), se->breakPosition(), + se->stepBeforeBreak(), se->stepAfterBreak(), se->minTicksBeforeBreak(), + se->minTicksAfterBreak(), se->log10ScaleAfterBreak(), se->breakWidth(), se->hasBreakDecoration()); + l->replot(); + l->blockSignals(false); + } +} + +void MultiLayer::updateLayersLayout(Graph *g) +{ + if (!g || g != graphsList.last()) + return; + + disconnect (g, SIGNAL(updatedLayout(Graph *)), this, SLOT(updateLayersLayout(Graph *))); + arrangeLayers(false, true); + foreach(Graph *ag, graphsList){ + if (ag->curveCount()) + ag->newLegend(); + } +} + MultiLayer::~MultiLayer() { if(d_layers_selector) - d_layers_selector->setParent(NULL); + d_layers_selector->setParent(NULL); foreach(Graph *g, graphsList) - delete g; + delete g; } === modified file 'qtiplot/src/plot2D/MultiLayer.h' --- qtiplot/src/plot2D/MultiLayer.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/MultiLayer.h 2010-07-21 23:21:08 +0000 @@ -42,6 +42,7 @@ class LegendWidget; class Graph; class QwtPlotCurve; +class Matrix; /** * \brief An MDI window (MdiSubWindow) managing one or more Graph objects. @@ -69,6 +70,7 @@ ~MultiLayer(); QList layersList(){return graphsList;}; + QList stackOrderedLayersList(); Graph *layer(int num); int layerIndex(Graph *g){return graphsList.indexOf(g);}; @@ -79,6 +81,8 @@ enum HorAlignement{HCenter, Left, Right}; enum VertAlignement{VCenter, Top, Bottom}; + enum AlignPolicy{AlignLayers = 0, AlignCanvases}; + enum SizePolicy{Expanding = 0, UserSize}; bool scaleLayersOnPrint(){return d_scale_on_print;}; void setScaleLayersOnPrint(bool on){d_scale_on_print = on;}; @@ -104,8 +108,22 @@ void setEqualSizedLayers(); + void plotProfiles(Matrix* m); + + QHBoxLayout *toolBox(){return toolbuttonsBox;}; + + AlignPolicy alignPolicy(){return d_align_policy;}; + void setAlignPolicy(const AlignPolicy& policy){d_align_policy = policy;}; + + SizePolicy sizePolicy(){return d_size_policy;}; + void setSizePolicy(const SizePolicy& policy){d_size_policy = policy;}; + + void setCommonLayerAxes(bool verticalAxis = true, bool horizontalAxis = true); + void linkXLayerAxes(bool link = true); + bool hasLinkedXLayerAxes(){return d_link_x_axes;}; + public slots: - Graph* addLayer(int x = 0, int y = 0, int width = 0, int height = 0); + Graph* addLayer(int x = 0, int y = 0, int width = 0, int height = 0, bool = false); bool isEmpty(); bool removeLayer(Graph *g); @@ -126,6 +144,7 @@ bool arrangeLayers(bool fit, bool userSize); bool swapLayers(int src, int dest); void adjustSize(); + void updateLayersLayout(Graph *); int getRows(){return d_rows;}; void setRows(int r); @@ -152,7 +171,7 @@ //! \name Print and Export //@{ - QPixmap canvasPixmap(const QSize& size = QSize(), double scaleFontsFactor = 1.0); + QPixmap canvasPixmap(const QSize& size = QSize(), double scaleFontsFactor = 1.0, bool transparent = false); void exportToFile(const QString& fileName); void exportImage(QTextDocument *document, int quality = 100, bool transparent = false, int dpi = 0, const QSizeF& customSize = QSizeF (), int unit = FrameWidget::Pixel, double fontsFactor = 1.0); @@ -201,6 +220,8 @@ void updateWaterfallScales(Graph *g, int axis); //@} + void updateLayerAxes(Graph *g, int axis); + signals: void showEnrichementDialog(); void showPlotDialog(int); @@ -216,7 +237,6 @@ void cursorInfo(const QString&); void showLineDialog(); void viewTitleDialog(); - void createTable(const QString&,int,int,const QString&); void pasteMarker(); void setPointerCursor(); void currentFontChanged(const QFont&); @@ -259,6 +279,12 @@ QColor d_waterfall_fill_color; QPushButton *d_add_layer_btn, *d_remove_layer_btn; + + QSize d_canvas_size; + + AlignPolicy d_align_policy; + SizePolicy d_size_policy; + bool d_link_x_axes; }; //! Button with layer number === modified file 'qtiplot/src/plot2D/MultiPeakFitTool.cpp' --- qtiplot/src/plot2D/MultiPeakFitTool.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/MultiPeakFitTool.cpp 2010-07-21 23:21:08 +0000 @@ -30,7 +30,6 @@ #include "RangeSelectorTool.h" #include #include "DataPickerTool.h" -#include #include #include @@ -52,12 +51,15 @@ if (status_target) connect(this, SIGNAL(statusText(const QString&)), status_target, status_slot); d_picker_tool = new DataPickerTool(d_graph, app, DataPickerTool::Display, this, SIGNAL(statusText(const QString&))); - d_graph->canvas()->setCursor(QCursor(QPixmap(cursor_xpm), -1, -1)); + d_graph->canvas()->setCursor(QCursor(QPixmap(":/cursor.png"), -1, -1)); + + QString msg = tr("Move cursor and click to select a point and double-click/press 'Enter' to set the position of a peak!"); + if (app->d_multi_peak_messages) + QMessageBox::information(app, app->objectName(), msg); + emit statusText(msg); connect(d_picker_tool, SIGNAL(selected(QwtPlotCurve*,int)), this, SLOT(selectPeak(QwtPlotCurve*,int))); d_graph->canvas()->grabMouse(); - - emit statusText(tr("Move cursor and click to select a point and double-click/press 'Enter' to set the position of a peak!")); } MultiPeakFitTool::~MultiPeakFitTool() @@ -76,18 +78,25 @@ void MultiPeakFitTool::selectPeak(QwtPlotCurve *curve, int point_index) { - // TODO: warn user if (!curve || (d_curve && d_curve != curve)) return; d_curve = curve; - d_fit->setInitialGuess(3*d_selected_peaks, curve->y(point_index)); - d_fit->setInitialGuess(3*d_selected_peaks+1, curve->x(point_index)); - QwtPlotMarker *m = new QwtPlotMarker(); - m->setLineStyle(QwtPlotMarker::VLine); + m->setXAxis(curve->xAxis()); m->setLinePen(QPen(Qt::green, 2, Qt::DashLine)); - m->setXValue(curve->x(point_index)); + + if (curve->curveType() == QwtPlotCurve::Xfy){ + m->setLineStyle(QwtPlotMarker::HLine); + d_fit->setInitialGuess(3*d_selected_peaks, curve->x(point_index)); + d_fit->setInitialGuess(3*d_selected_peaks+1, curve->y(point_index)); + } else { + m->setLineStyle(QwtPlotMarker::VLine); + d_fit->setInitialGuess(3*d_selected_peaks, curve->y(point_index)); + d_fit->setInitialGuess(3*d_selected_peaks+1, curve->x(point_index)); + } + + m->setValue(curve->x(point_index), curve->y(point_index)); d_graph->insertMarker(m); d_lines.append(m); d_graph->replot(); @@ -95,10 +104,16 @@ d_selected_peaks++; if (d_selected_peaks == d_fit->peaks()) finalize(); - else - emit statusText( - tr("Peak %1 selected! Click to select a point and double-click/press 'Enter' to set the position of the next peak!") - .arg(QString::number(d_selected_peaks))); + else { + QString msg = tr("Peak %1 selected! Click to select a point and double-click/press 'Enter' to set the position of the next peak!").arg(QString::number(d_selected_peaks)); + ApplicationWindow *app = d_picker_tool->applicationWindow(); + if (app && app->d_multi_peak_messages){ + d_graph->canvas()->releaseMouse(); + QMessageBox::information(app, app->objectName(), msg); + d_graph->canvas()->grabMouse(); + } + emit statusText(msg); + } } void MultiPeakFitTool::finalize() === modified file 'qtiplot/src/plot2D/PlotCurve.cpp' --- qtiplot/src/plot2D/PlotCurve.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/PlotCurve.cpp 2010-07-21 23:21:08 +0000 @@ -60,12 +60,30 @@ double percent = 0.01; double dw = percent*fabs(r.right() - r.left()); - r.setLeft(r.left() - dw); + double left = r.left() - dw; + if (left <= 0.0){ + ScaleEngine *sc_engine = (ScaleEngine *)this->plot()->axisScaleEngine(xAxis()); + if (sc_engine && (sc_engine->type() == ScaleTransformation::Log10 || + sc_engine->type() == ScaleTransformation::Log2 || + sc_engine->type() == ScaleTransformation::Ln)) + left = r.left(); + } + + r.setLeft(left); r.setRight(r.right() + dw); double dh = percent*fabs(r.top() - r.bottom()); r.setBottom(r.bottom() + dh); - r.setTop(r.top() - dh); + + double top = r.top() - dh; + if (top <= 0.0){ + ScaleEngine *sc_engine = (ScaleEngine *)this->plot()->axisScaleEngine(yAxis()); + if (sc_engine && (sc_engine->type() == ScaleTransformation::Log10 || + sc_engine->type() == ScaleTransformation::Log2 || + sc_engine->type() == ScaleTransformation::Ln)) + top = r.top(); + } + r.setTop(top); return r; } @@ -93,6 +111,7 @@ if (brush.style() != Qt::NoBrush){ s += "\n"; s += "\t" + brush.color().name() + "\n"; + s += "\t" + QString::number(brush.color().alpha()) + "\n"; s += "\t\n"; s += "\n"; } @@ -119,6 +138,7 @@ } s += "" + QString::number(xAxis()) + "\n"; s += "" + QString::number(yAxis()) + "\n"; + s += "" + QString::number(curveType()) + "\n"; s += "" + QString::number(isVisible()) + "\n"; return s; } @@ -147,7 +167,11 @@ s = (*(++line)).stripWhiteSpace(); if (s.contains("")) brush.setColor(QColor(s.remove("").remove(""))); - else if (s.contains("").toInt())); } setBrush(brush); @@ -189,6 +213,8 @@ setXAxis(s.remove("").remove("").toInt()); else if (s.contains("")) setYAxis(s.remove("").remove("").toInt()); + else if (s.contains("")) + setCurveType((QwtPlotCurve::CurveType)s.remove("").remove("").toInt()); else if (s.contains("")) setVisible(s.remove("").remove("").toInt()); } === modified file 'qtiplot/src/plot2D/PlotToolInterface.h' --- qtiplot/src/plot2D/PlotToolInterface.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/PlotToolInterface.h 2010-07-21 23:21:08 +0000 @@ -72,17 +72,20 @@ Rtti_LineProfileTool, Rtti_AddWidgetTool, Rtti_DrawDataPoints, - + Rtti_ImageProfilesTool, + Rtti_SubtractLineTool, Rtti_PlotUserTool = 1000 }; - PlotToolInterface(Graph *graph, const QObject *status_target = NULL, const char *status_slot = "") {Q_UNUSED(status_target); Q_UNUSED(status_slot); d_graph = graph;}; + PlotToolInterface(Graph *graph, const QObject *status_target = NULL, const char *status_slot = "") {d_status_target = status_target; d_status_slot = status_slot; d_graph = graph;}; virtual ~PlotToolInterface() {}; virtual int rtti() const { return Rtti_PlotTool;}; protected: Graph *d_graph; + const QObject *d_status_target; + const char *d_status_slot; }; #endif // ifndef PLOT_TOOL_INTERFACE_H === modified file 'qtiplot/src/plot2D/ProbabilityScaleEngine.cpp' --- qtiplot/src/plot2D/ProbabilityScaleEngine.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/ProbabilityScaleEngine.cpp 2010-07-21 23:21:08 +0000 @@ -94,7 +94,7 @@ QwtScaleDiv scaleDiv; if ( stepSize != 0.0 ){ QwtValueList ticks[QwtScaleDiv::NTickTypes]; - buildTicks(interval, stepSize, ticks); + buildTicks(interval, (int)stepSize, ticks); scaleDiv = QwtScaleDiv(interval, ticks); } === modified file 'qtiplot/src/plot2D/QwtBarCurve.cpp' --- qtiplot/src/plot2D/QwtBarCurve.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/QwtBarCurve.cpp 2010-07-21 23:21:08 +0000 @@ -39,7 +39,7 @@ { bar_style = style; - QPen pen = QPen(Qt::black, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin); + QPen pen = QPen(Qt::black, 1, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin); pen.setCosmetic(true); setPen(pen); setBrush(QBrush(Qt::red)); === modified file 'qtiplot/src/plot2D/QwtErrorPlotCurve.cpp' --- qtiplot/src/plot2D/QwtErrorPlotCurve.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/QwtErrorPlotCurve.cpp 2010-07-21 23:21:08 +0000 @@ -123,9 +123,13 @@ const int xi = xMap.transform(x(i) + d_xOffset); const int yi = yMap.transform(y(i) + d_yOffset); + double error = err[i]; + if (error == 0.0) + continue; + if (type == Vertical){ - const int yh = yMap.transform(y(i) + err[i]); - const int yl = yMap.transform(y(i) - err[i]); + const int yh = yMap.transform(y(i) + error); + const int yl = yMap.transform(y(i) - error); const int yhl = yi - sh2; const int ylh = yi + sh2; const int cap2 = qRound(d_cap_length*0.5*x_factor); @@ -141,8 +145,8 @@ if (through && (plus || minus)) QwtPainter::drawLine(painter, xi, yhl, xi, ylh); } else if (type == Horizontal) { - const int xp = xMap.transform(x(i) + err[i]); - const int xm = xMap.transform(x(i) - err[i]); + const int xp = xMap.transform(x(i) + error); + const int xm = xMap.transform(x(i) - error); const int xpm = xi + sw2; const int xmp = xi - sw2; const int cap2 = qRound(d_cap_length*0.5*y_factor); @@ -284,14 +288,16 @@ QString xval = mt->text(i, xcol); QString yval = mt->text(i, ycol); QString errval = d_table->text(i, errcol); - if (!xval.isEmpty() && !yval.isEmpty() && !errval.isEmpty()){ + if (!xval.isEmpty() && !yval.isEmpty()){ X[data_size] = d_master_curve->x(data_size); Y[data_size] = d_master_curve->y(data_size); - bool ok = true; - err[data_size] = locale.toDouble(errval, &ok); - if (ok) - data_size++; + if (!errval.isEmpty()) + err[data_size] = locale.toDouble(errval); + else + err[data_size] = 0.0; + + data_size++; } } === modified file 'qtiplot/src/plot2D/QwtHistogram.cpp' --- qtiplot/src/plot2D/QwtHistogram.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/QwtHistogram.cpp 2010-07-21 23:21:08 +0000 @@ -178,9 +178,12 @@ d_begin = floor(min); d_end = ceil(max); + if (d_end == max) + d_end += 1.0; + d_bin_size = (d_end - d_begin)/(double)n; - gsl_histogram_set_ranges_uniform (h, floor(min), ceil(max)); + gsl_histogram_set_ranges_uniform (h, d_begin, d_end); } else { n = int((d_end - d_begin)/d_bin_size + 1); h = gsl_histogram_alloc (n); === modified file 'qtiplot/src/plot2D/RangeSelectorTool.cpp' --- qtiplot/src/plot2D/RangeSelectorTool.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/RangeSelectorTool.cpp 2010-07-21 23:21:08 +0000 @@ -31,7 +31,6 @@ #include "PlotCurve.h" #include "MultiLayer.h" #include -#include #include #include @@ -88,7 +87,7 @@ setTrackerMode(QwtPicker::AlwaysOn); setSelectionFlags(QwtPicker::PointSelection | QwtPicker::ClickSelection); - d_graph->canvas()->setCursor(QCursor(QPixmap(vizor_xpm), -1, -1)); + d_graph->canvas()->setCursor(QCursor(QPixmap(":/vizor.png"), -1, -1)); d_graph->canvas()->setFocus(); d_graph->replot(); @@ -641,7 +640,7 @@ { d_enabled = on; if (on) - d_graph->canvas()->setCursor(QCursor(QPixmap(vizor_xpm), -1, -1)); + d_graph->canvas()->setCursor(QCursor(QPixmap(":/vizor.png"), -1, -1)); } void RangeSelectorTool::setVisible(bool on) @@ -653,7 +652,7 @@ if (on){ setTrackerMode(QwtPicker::AlwaysOn); - d_graph->canvas()->setCursor(QCursor(QPixmap(vizor_xpm), -1, -1)); + d_graph->canvas()->setCursor(QCursor(QPixmap(":/vizor.png"), -1, -1)); d_active_marker.attach(d_graph); d_inactive_marker.attach(d_graph); } else { === modified file 'qtiplot/src/plot2D/RangeSelectorTool.h' --- qtiplot/src/plot2D/RangeSelectorTool.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/RangeSelectorTool.h 2010-07-21 23:21:08 +0000 @@ -62,6 +62,8 @@ virtual ~RangeSelectorTool(); double minXValue() const { return QMIN(d_active_marker.xValue(), d_inactive_marker.xValue()); } double maxXValue() const { return QMAX(d_active_marker.xValue(), d_inactive_marker.xValue()); } + double minYValue() const { return QMIN(d_active_marker.yValue(), d_inactive_marker.yValue()); } + double maxYValue() const { return QMAX(d_active_marker.yValue(), d_inactive_marker.yValue()); } int dataSize() const { return qAbs(d_active_point - d_inactive_point); } virtual bool eventFilter(QObject *obj, QEvent *event); bool keyEventFilter(QKeyEvent *ke); === modified file 'qtiplot/src/plot2D/ScaleDraw.cpp' --- qtiplot/src/plot2D/ScaleDraw.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/ScaleDraw.cpp 2010-07-21 23:21:08 +0000 @@ -58,7 +58,8 @@ d_name_format(ShortName), d_date_time_origin(QDateTime::currentDateTime()), d_format_info("YYYY-MM-DDTHH:MM:SS"), - d_text_labels(QStringList()) + d_text_labels(QStringList()), + d_show_ticks_policy(ShowAll) {} ScaleDraw::ScaleDraw(Graph *plot, const QStringList& labels, const QString& format, ScaleType type): @@ -92,6 +93,7 @@ d_date_time_origin = sd->d_date_time_origin; d_format_info = sd->d_format_info; d_text_labels = sd->d_text_labels; + d_show_ticks_policy = sd->showTicksPolicy(); setLabelAlignment(sd->labelAlignment()); setLabelRotation(sd->labelRotation()); @@ -105,7 +107,7 @@ QLocale locale = d_plot->locale(); if (d_plot->parent()) locale = d_plot->multiLayer()->locale(); - if (d_numeric_format == Superscripts){ + if ((d_numeric_format == Superscripts)||(d_numeric_format == SuperscriptsGER)){ QString txt = locale.toString(transformValue(value), 'e', d_prec); QStringList list = txt.split("e", QString::SkipEmptyParts); if (list[0].toDouble() == 0.0) @@ -126,78 +128,53 @@ if (list[0] == "1") return QwtText("10" + s + ""); - else - return QwtText(list[0] + "x10" + s + ""); - - } - else if (d_numeric_format == Engineering){ - + else{ + if (d_numeric_format == SuperscriptsGER) + return QwtText(list[0] + "10" + s + ""); + else + return QwtText(list[0] + "x10" + s + ""); + } + } else if (d_numeric_format == Engineering){ QString eng_suff; - bool ok; - double new_value = QString("%1").arg(value, 0, 'e', d_prec).toDouble(&ok); + double new_value = value; - if(fabs(new_value) >= 1e18) - { + if(fabs(new_value) >= 1e18){ eng_suff = 'E'; new_value /= 1e18; - } - else if(fabs(new_value) >= 1e15) - { + } else if(fabs(new_value) >= 1e15){ eng_suff = 'P'; new_value /= 1e15; - } - else if(fabs(new_value) >= 1e12) - { + } else if(fabs(new_value) >= 1e12){ eng_suff = 'T'; new_value /= 1e12; - } - else if(fabs(new_value) >= 1e9) - { + } else if(fabs(new_value) >= 1e9){ eng_suff = 'G'; new_value /= 1e9; - } - else if(fabs(new_value) >= 1e6) - { + } else if(fabs(new_value) >= 1e6){ eng_suff = 'M'; new_value /= 1e6; - } - else if(fabs(new_value) >= 1e3) - { + } else if(fabs(new_value) >= 1e3){ eng_suff = 'k'; new_value /= 1e3; - } - else if(fabs(new_value) >= 1) - { + } else if(fabs(new_value) >= 1){ eng_suff = ""; - new_value /= 1; - } - else if(fabs(new_value) >= 1e-3) - { + new_value /= 1.0; + } else if(fabs(new_value) >= 1e-3){ eng_suff = 'm'; new_value /= 1e-3; - } - else if(fabs(new_value) >= 1e-6) - { + } else if(fabs(new_value) >= 1e-6){ eng_suff = ''; new_value /= 1e-6; - } - else if(fabs(new_value) >= 1e-9) - { + } else if(fabs(new_value) >= 1e-9){ eng_suff = 'n'; new_value /= 1e-9; - } - else if(fabs(new_value) >= 1e-12) - { + } else if(fabs(new_value) >= 1e-12){ eng_suff = 'p'; new_value /= 1e-12; - } - else if(fabs(new_value) >= 1e-15) - { + } else if(fabs(new_value) >= 1e-15){ eng_suff = 'f'; new_value /= 1e-15; - } - else - { + } else { eng_suff = 'a'; new_value /= 1e-18; } @@ -208,7 +185,6 @@ return QwtText("0"); return QwtText(txt + eng_suff); - } else return QwtText(locale.toString(transformValue(value), d_fmt, d_prec)); break; @@ -263,8 +239,16 @@ } case Time: - return QwtText(d_date_time_origin.time().addMSecs((int)value).toString(d_format_info)); + { + QTime time = d_date_time_origin.time().addMSecs((int)value); + if (d_format_info == "M") + return QwtText(QString::number(60*time.hour() + time.minute())); + else if (d_format_info == "S") + return QwtText(QString::number(3600*time.hour() + 60*time.minute() + time.second())); + + return QwtText(time.toString(d_format_info)); break; + } case Date: return QwtText(d_date_time_origin.addSecs((int)value).toString(d_format_info)); @@ -349,6 +333,27 @@ return; } + QwtValueList majTicks = scaleDiv().ticks(QwtScaleDiv::MajorTick); + if (majTicks.contains(value)){ + switch (d_show_ticks_policy){ + case ShowAll: + break; + + case HideBegin: + if (majTicks.first() == value) + return; + break; + case HideEnd: + if (majTicks.last() == value) + return; + break; + case HideBeginEnd: + if (majTicks.first() == value || majTicks.last() == value) + return; + break; + } + } + QwtText lbl = tickLabel(painter->font(), value); if ( lbl.isEmpty() ) return; @@ -428,6 +433,8 @@ case Engineering: d_fmt = 'f'; break; + case SuperscriptsGER: + d_fmt = 'f'; } } @@ -489,9 +496,29 @@ } QwtScaleDiv scDiv = scaleDiv(); - QwtValueList majTicks = scDiv.ticks(QwtScaleDiv::MajorTick); - if (majTicks.contains(value) && (d_majTicks == In || d_majTicks == None)) - return; + QwtValueList majTicks = scDiv.ticks(QwtScaleDiv::MajorTick); + if (majTicks.contains(value)){ + if (d_majTicks == In || d_majTicks == None) + return; + + switch (d_show_ticks_policy){ + case ShowAll: + break; + + case HideBegin: + if (majTicks.first() == value) + return; + break; + case HideEnd: + if (majTicks.last() == value) + return; + break; + case HideBeginEnd: + if (majTicks.first() == value || majTicks.last() == value) + return; + break; + } + } QwtValueList medTicks = scDiv.ticks(QwtScaleDiv::MediumTick); if (medTicks.contains(value) && (d_minTicks == In || d_minTicks == None)) === modified file 'qtiplot/src/plot2D/ScaleDraw.h' --- qtiplot/src/plot2D/ScaleDraw.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/ScaleDraw.h 2010-07-21 23:21:08 +0000 @@ -43,8 +43,9 @@ public: enum TicksStyle{None = 0, Out = 1, Both = 2, In = 3}; enum ScaleType{Numeric = 0, Text = 1, Day = 2, Month = 3, Time = 4, Date = 5, ColHeader = 6}; - enum NumericFormat{Automatic, Decimal, Scientific, Superscripts, Engineering}; + enum NumericFormat{Automatic, Decimal, Scientific, Superscripts, Engineering, SuperscriptsGER}; enum NameFormat{ShortName, LongName, Initial}; + enum ShowTicksPolicy{ShowAll = 0, HideBegin = 1, HideEnd = 2, HideBeginEnd = 3}; //! Constructs a new scale draw which is a clone of sd. ScaleDraw(Graph *plot, ScaleDraw *sd); @@ -60,15 +61,18 @@ double transformValue(double value) const; virtual QwtText label(double value) const; - int labelNumericPrecision(){return d_prec;}; + int labelNumericPrecision()const {return d_prec;}; void setNumericPrecision(int prec){d_prec = prec;}; - int majorTicksStyle(){return d_majTicks;}; + int majorTicksStyle()const {return d_majTicks;}; void setMajorTicksStyle(TicksStyle type){d_majTicks = type;}; - int minorTicksStyle(){return d_minTicks;}; + int minorTicksStyle()const {return d_minTicks;}; void setMinorTicksStyle(TicksStyle type){d_minTicks = type;}; + ShowTicksPolicy showTicksPolicy(){return d_show_ticks_policy;}; + void setShowTicksPolicy(const ShowTicksPolicy& policy){d_show_ticks_policy = policy;}; + void setSelected(bool select = true){d_selected = select;}; int axis() const; @@ -90,6 +94,7 @@ void setDateTimeOrigin(const QDateTime& d){d_date_time_origin = d;}; QStringList labelsList(){return d_text_labels;}; + void setLabelsList(const QStringList& list){d_text_labels = list;}; NameFormat nameFormat(){return d_name_format;}; @@ -130,5 +135,7 @@ QString d_format_info; //! Stores the labels for Txt scales QStringList d_text_labels; + + ShowTicksPolicy d_show_ticks_policy; }; #endif === modified file 'qtiplot/src/plot2D/ScaleEngine.cpp' --- qtiplot/src/plot2D/ScaleEngine.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/plot2D/ScaleEngine.cpp 2010-07-21 23:21:08 +0000 @@ -296,19 +296,19 @@ void ScaleEngine::clone(const ScaleEngine *engine) { - d_type = engine->type(); + d_type = engine->type(); d_break_left = engine->axisBreakLeft(); d_break_right = engine->axisBreakRight(); - d_break_pos = engine->breakPosition(); + d_break_pos = engine->breakPosition(); d_step_before = engine->stepBeforeBreak(); d_step_after = engine->stepAfterBreak(); d_minor_ticks_before = engine->minTicksBeforeBreak(); d_minor_ticks_after = engine->minTicksAfterBreak(); - d_log10_scale_after = engine->log10ScaleAfterBreak(); - d_break_width = engine->breakWidth(); + d_log10_scale_after = engine->log10ScaleAfterBreak(); + d_break_width = engine->breakWidth(); d_break_decoration = engine->hasBreakDecoration(); setAttributes(engine->attributes()); - setMargins(engine->lowerMargin(), engine->upperMargin()); + setMargins(engine->lowerMargin(), engine->upperMargin()); } QwtScaleDiv ScaleEngine::divideScale(double x1, double x2, int maxMajSteps, @@ -376,8 +376,16 @@ if (!hasBreak() || testAttribute(QwtScaleEngine::Inverted)){ QwtScaleEngine *engine = newScaleEngine(); engine->setAttributes(attributes()); - engine->setReference(reference()); - engine->setMargins(lowerMargin(), upperMargin()); + engine->setReference(reference()); + engine->setMargins(lowerMargin(), upperMargin()); + + if (type() == ScaleTransformation::Log10 || type() == ScaleTransformation::Ln || type() == ScaleTransformation::Log2){ + if (x1 <= 0.0) + x1 = 1e-4; + if (x2 <= 0.0) + x2 = 1e-3; + } + engine->autoScale(maxNumSteps, x1, x2, stepSize); delete engine; } else { === modified file 'qtiplot/src/plot2D/ScalePicker.cpp' --- qtiplot/src/plot2D/ScalePicker.cpp 2008-08-17 19:43:31 +0000 +++ qtiplot/src/plot2D/ScalePicker.cpp 2010-07-21 23:21:08 +0000 @@ -57,8 +57,8 @@ if ( e->type() == QEvent::MouseButtonDblClick ){ mouseDblClicked(scale, ((QMouseEvent *)e)->pos()); - return true; - } + return true; + } if ( e->type() == QEvent::MouseButtonPress){ const QMouseEvent *me = (const QMouseEvent *)e; @@ -67,19 +67,19 @@ scale->setFocus(); emit clicked(); - deselect(); + deselect(); if (titleRect(scale).contains(pos)) - selectTitle(scale); - else if (!scaleTicksRect(scale).contains(pos)) + selectTitle(scale); + else if (!scaleTicksRect(scale).contains(pos)) selectLabels(scale); return !(me->modifiers() & Qt::ShiftModifier) && !scaleTicksRect(scale).contains(pos); - } else if (me->button() == Qt::RightButton){ + } else if (me->button() == Qt::RightButton){ mouseRightClicked(scale, pos); return true; - } - } + } + } return QObject::eventFilter(object, e); } @@ -140,11 +140,11 @@ void ScalePicker::refresh() { - for ( uint i = 0; i < QwtPlot::axisCnt; i++ ){ - QwtScaleWidget *scale = (QwtScaleWidget *)plot()->axisWidget(i); - if ( scale ) - scale->installEventFilter(this); - } + for ( uint i = 0; i < QwtPlot::axisCnt; i++ ){ + QwtScaleWidget *scale = (QwtScaleWidget *)plot()->axisWidget(i); + if ( scale ) + scale->installEventFilter(this); + } } QRect ScalePicker::scaleTicksRect(const QwtScaleWidget *scale) const === modified file 'qtiplot/src/plot2D/ScreenPickerTool.cpp' --- qtiplot/src/plot2D/ScreenPickerTool.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/ScreenPickerTool.cpp 2010-07-21 23:21:08 +0000 @@ -29,23 +29,26 @@ #include "ScreenPickerTool.h" #include #include +#include #include "Graph.h" #include "PlotCurve.h" #include -#include #include #include +#include + +#include ScreenPickerTool::ScreenPickerTool(Graph *graph, const QObject *status_target, const char *status_slot) : QwtPlotPicker(graph->canvas()), - PlotToolInterface(graph), + PlotToolInterface(graph, status_target, status_slot), d_move_restriction(NoRestriction) { d_selection_marker.setLineStyle(QwtPlotMarker::Cross); d_selection_marker.setLinePen(QPen(Qt::red,1)); setTrackerMode(QwtPicker::AlwaysOn); setSelectionFlags(QwtPicker::PointSelection | QwtPicker::ClickSelection); - d_graph->canvas()->setCursor(QCursor(QPixmap(cursor_xpm), -1, -1)); + d_graph->canvas()->setCursor(QCursor(QPixmap(":/cursor.png"), -1, -1)); if (status_target) connect(this, SIGNAL(statusText(const QString&)), status_target, status_slot); @@ -150,8 +153,11 @@ if (!d_app) return; - QString info; - emit statusText(info.sprintf("x=%g; y=%g", pos.x(), pos.y())); + QLocale locale = d_app->locale(); + int prec = d_app->d_decimal_digits; + emit statusText(QString("x=%1; y=%2") + .arg(locale.toString(pos.x(), 'G', prec)) + .arg(locale.toString(pos.y(), 'G', prec))); if (!d_table){ d_table = d_app->newHiddenTable(d_app->generateUniqueName(tr("Draw")), "", 30, 2, ""); @@ -214,3 +220,208 @@ } return QwtPlotPicker::eventFilter(obj, event); } + +ImageProfilesTool::ImageProfilesTool(ApplicationWindow *app, Graph *graph, Matrix *m, Table *horTable, Table *verTable, + const QObject *status_target, const char *status_slot) + : ScreenPickerTool(graph, status_target, status_slot), + d_app(app), + d_matrix(m), + d_hor_table(horTable), + d_ver_table(verTable) +{ + d_selection_marker.setAxis(QwtPlot::xTop, QwtPlot::yLeft); + + if (d_matrix){ + double xVal = 0.5*(m->xStart() + m->xEnd()); + double yVal = 0.5*(m->yStart() + m->yEnd()); + if (d_graph){ + connect(d_matrix, SIGNAL(destroyed()), d_graph, SLOT(disableTools())); + connect(d_matrix, SIGNAL(modifiedData(Matrix *)), this, SLOT(modifiedMatrix(Matrix *))); + + horSpinBox = new DoubleSpinBox('g'); + horSpinBox->setMinimumWidth(80); + horSpinBox->setSingleStep(1.0); + horSpinBox->setLocale(QLocale()); + horSpinBox->setDecimals(6); + + vertSpinBox = new DoubleSpinBox('g'); + vertSpinBox->setMinimumWidth(80); + vertSpinBox->setSingleStep(1.0); + vertSpinBox->setLocale(QLocale()); + vertSpinBox->setDecimals(6); + + zLabel = new QLabel(); + zLabel->setMinimumWidth(80); + zLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken); + + append(QwtDoublePoint(xVal, yVal)); + + connect(horSpinBox, SIGNAL(valueChanged(double)), this, SLOT(updateCursorPosition())); + connect(vertSpinBox, SIGNAL(valueChanged(double)), this, SLOT(updateCursorPosition())); + + MultiLayer *plot = d_graph->multiLayer(); + if (plot){ + QPalette pal = plot->palette(); + pal.setColor(QPalette::Window, QColor(Qt::lightGray)); + plot->setPalette(pal); + + QHBoxLayout *box = new QHBoxLayout(); + box->setSpacing(5); + box->addWidget(new QLabel(tr("Position") + ": " + tr("x"))); + box->addWidget(horSpinBox); + box->addWidget(new QLabel(tr("y"))); + box->addWidget(vertSpinBox); + box->addWidget(new QLabel(tr("Z-Value"))); + box->addWidget(zLabel); + + plot->toolBox()->insertLayout(0, box); + } + } + + MatrixModel *mm = d_matrix->matrixModel(); + if (d_hor_table){ + for (int i = 0; i < d_hor_table->numRows(); i++) + d_hor_table->setCell(i, 0, mm->x(i)); + } + if (d_ver_table){ + for (int i = 0; i < d_ver_table->numRows(); i++) + d_ver_table->setCell(i, 0, mm->y(i)); + } + } +} + +void ImageProfilesTool::updateCursorPosition() +{ + append(QwtDoublePoint(horSpinBox->value(), vertSpinBox->value())); + + if (d_graph) + d_graph->replot(); +} + +void ImageProfilesTool::modifiedMatrix(Matrix *m) +{ + if (!m) + return; + + double mmin, mmax; + m->range(&mmin, &mmax); + + if (d_hor_table){ + d_hor_table->setNumRows(m->numCols()); + for (int i = 0; i < d_hor_table->numRows(); i++) + d_hor_table->setText(i, 0, QString::number(i)); + } + if (d_ver_table){ + d_ver_table->setNumRows(m->numRows()); + for (int i = 0; i < d_ver_table->numRows(); i++) + d_ver_table->setText(i, 0, QString::number(i)); + } + + if (d_graph){ + d_graph->setScale(QwtPlot::yLeft, QMIN(m->yStart(), m->yEnd()), QMAX(m->yStart(), m->yEnd()), + 0.0, 5, 5, Graph::Linear, true); + d_graph->setScale(QwtPlot::xTop, QMIN(m->xStart(), m->xEnd()), QMAX(m->xStart(), m->xEnd())); + d_graph->replot(); + + MultiLayer *plot = d_graph->multiLayer(); + Graph *gHor = plot->layer(2); + if (gHor){ + gHor->setScale(QwtPlot::xBottom, QMIN(m->xStart(), m->xEnd()), QMAX(m->xStart(), m->xEnd())); + gHor->setScale(QwtPlot::yLeft, mmin, mmax); + gHor->replot(); + } + + Graph *gVert = plot->layer(3); + if (gVert){ + gVert->setScale(QwtPlot::xTop, mmin, mmax); + gVert->setScale(QwtPlot::yLeft, QMIN(m->yStart(), m->yEnd()), QMAX(m->yStart(), m->yEnd()), + 0.0, 5, 5, Graph::Linear, true); + gVert->replot(); + } + } + + append(QwtDoublePoint(d_selection_marker.xValue(), d_selection_marker.yValue())); +} + +ImageProfilesTool* ImageProfilesTool::clone(Graph *g) +{ + if (d_hor_table) + d_hor_table->blockSignals(true); + if (d_ver_table) + d_ver_table->blockSignals(true); + + ImageProfilesTool *tool = new ImageProfilesTool(d_app, g, d_matrix, d_hor_table, d_ver_table, d_status_target, d_status_slot); + tool->append(QwtDoublePoint(xValue(), yValue())); + + if (d_hor_table) + d_hor_table->blockSignals(false); + if (d_ver_table) + d_ver_table->blockSignals(false); + return tool; +} + +void ImageProfilesTool::append(const QwtDoublePoint &pos) +{ + ScreenPickerTool::append(pos); + + if (!d_app || !d_matrix) + return; + + MultiLayer *plot = d_graph->multiLayer(); + Graph *gHor = plot->layer(2); + if (gHor) + gHor->enableAutoscaling(false); + Graph *gVert = plot->layer(3); + if (gVert){ + gVert->enableAutoscaling(false); + QwtPlotCurve *c = gVert->curve(0); + if (c) + c->setCurveType(QwtPlotCurve::Xfy); + } + + double x = pos.x(); + double y = pos.y(); + + horSpinBox->setValue(x); + vertSpinBox->setValue(y); + + x += 0.5*d_matrix->dx(); + y -= 0.5*d_matrix->dy(); + + int row = qRound(fabs((y - d_matrix->yStart())/d_matrix->dy())); + int col = qRound(fabs((x - d_matrix->xStart())/d_matrix->dx())); + + zLabel->setText(QLocale().toString(d_matrix->cell(row, col))); + + if (d_hor_table){ + for (int i = 0; i < d_matrix->numCols(); i++) + d_hor_table->setCell(i, 1, d_matrix->cell(row, i)); + d_hor_table->notifyChanges(); + } + + if (d_ver_table){ + for (int i = 0; i < d_matrix->numRows(); i++) + d_ver_table->setCell(i, 1, d_matrix->cell(i, col)); + d_ver_table->notifyChanges(); + } + + QLocale locale = d_app->locale(); + int prec = d_app->d_decimal_digits; + emit statusText(QString("x=%1; y=%2; z=%3") + .arg(locale.toString(pos.x(), 'G', prec)) + .arg(locale.toString(pos.y(), 'G', prec)) + .arg(locale.toString(d_matrix->cell(row, col), 'G', prec))); +} + +ImageProfilesTool::~ImageProfilesTool() +{ + if (d_hor_table){ + d_hor_table->askOnCloseEvent(false); + d_hor_table->close(); + } + + if (d_ver_table){ + d_ver_table->askOnCloseEvent(false); + d_ver_table->close(); + } +} === modified file 'qtiplot/src/plot2D/ScreenPickerTool.h' --- qtiplot/src/plot2D/ScreenPickerTool.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/ScreenPickerTool.h 2010-07-21 23:21:08 +0000 @@ -31,12 +31,17 @@ #include "PlotToolInterface.h" #include +#include +#include +#include + #include #include #include class ApplicationWindow; class Table; +class Matrix; class DataCurve; /*!Plot tool for selecting arbitrary points. @@ -51,9 +56,12 @@ enum MoveRestriction { NoRestriction, Vertical, Horizontal }; ScreenPickerTool(Graph *graph, const QObject *status_target=NULL, const char *status_slot=""); virtual ~ScreenPickerTool(); - void append(const QwtDoublePoint &pos); + virtual void append(const QwtDoublePoint &pos); void setMoveRestriction(ScreenPickerTool::MoveRestriction r){d_move_restriction = r;}; + double xValue(){return d_selection_marker.xValue();}; + double yValue(){return d_selection_marker.yValue();}; + signals: /*! Emitted whenever a new message should be presented to the user. * @@ -85,4 +93,37 @@ ApplicationWindow *d_app; }; +/*!Plot tool for image analysis. + * + */ +class ImageProfilesTool : public ScreenPickerTool +{ + Q_OBJECT + public: + ImageProfilesTool(ApplicationWindow *app, Graph *graph, Matrix *m, Table *horTable, Table *verTable, + const QObject *status_target=NULL, const char *status_slot=""); + + ImageProfilesTool* clone(Graph *g); + + virtual ~ImageProfilesTool(); + virtual void append(const QwtDoublePoint &pos); + virtual int rtti() const { return Rtti_ImageProfilesTool;}; + + + QPointer matrix(){return d_matrix;}; + QPointer
horizontalTable(){return d_hor_table;}; + QPointer
verticalTable(){return d_ver_table;}; + + private slots: + void modifiedMatrix(Matrix *); + void updateCursorPosition(); + + protected: + ApplicationWindow *d_app; + QPointer d_matrix; + QPointer
d_hor_table, d_ver_table; + DoubleSpinBox *horSpinBox, *vertSpinBox; + QLabel *zLabel; +}; + #endif // ifndef SCREEN_PICKER_TOOL_H === modified file 'qtiplot/src/plot2D/SelectionMoveResizer.cpp' --- qtiplot/src/plot2D/SelectionMoveResizer.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/SelectionMoveResizer.cpp 2010-07-21 23:21:08 +0000 @@ -70,6 +70,7 @@ setMouseTracking(true); parentWidget()->installEventFilter(this); show(); + setFocusPolicy (Qt::StrongFocus); setFocus(); } @@ -83,8 +84,8 @@ } } - if (parentWidget()) - parentWidget()->removeEventFilter(this); + if (parentWidget()) + parentWidget()->removeEventFilter(this); } void SelectionMoveResizer::add(ArrowMarker *target) @@ -281,7 +282,7 @@ foreach(QWidget *i, d_widgets){ QwtPlotCanvas *canvas = qobject_cast(i); if (canvas){ - ((Graph *)canvas->plot())->adjustGeometryToCanvas(operateOn(d_bounding_rect)); + ((Graph *)canvas->plot())->setCanvasGeometry(operateOn(d_bounding_rect)); continue; } @@ -348,7 +349,7 @@ return; } - if (me->button() == Qt::LeftButton){ + if (me->button() == Qt::LeftButton && !d_widgets.isEmpty()){ FrameWidget *fw = qobject_cast(d_widgets[0]); if (fw && fw->plot()){ QList lst = fw->plot()->enrichmentsList(); === modified file 'qtiplot/src/plot2D/Spectrogram.cpp' --- qtiplot/src/plot2D/Spectrogram.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/Spectrogram.cpp 2010-07-21 23:21:08 +0000 @@ -75,7 +75,8 @@ return; setData(MatrixData(d_matrix, d_use_matrix_formula)); - setLevelsNumber(levels()); + if(testDisplayMode(QwtPlotSpectrogram::ContourMode)) + setLevelsNumber(levels()); QwtScaleWidget *colorAxis = d_graph->axisWidget(color_axis); if (colorAxis) @@ -122,14 +123,17 @@ void Spectrogram::setLevelsNumber(int levels) { -double step = fabs(data().range().maxValue() - data().range().minValue())/(double)levels; - -QwtValueList contourLevels; -for ( double level = data().range().minValue() + 0.5*step; - level < data().range().maxValue(); level += step ) - contourLevels += level; - -setContourLevels(contourLevels); + if (levels <= 0) + return; + + double step = fabs(data().range().maxValue() - data().range().minValue())/(double)levels; + + QwtValueList contourLevels; + for ( double level = data().range().minValue() + 0.5*step; + level < data().range().maxValue(); level += step ) + contourLevels += level; + + setContourLevels(contourLevels); } void Spectrogram::setContourLevels (const QwtValueList & levels) @@ -232,7 +236,6 @@ new_s->d_labels_font = d_labels_font; new_s->d_labels_x_offset = d_labels_x_offset; new_s->d_labels_y_offset = d_labels_y_offset; - new_s->setContourLevels(contourLevels()); if (defaultContourPen().style() == Qt::NoPen && !d_color_map_pen) @@ -240,6 +243,11 @@ else new_s->d_color_map_pen = d_color_map_pen; + if (d_labels_list.isEmpty()){ + new_s->clearLabels(); + return new_s; + } + QList lst = new_s->labelsList(); int count = lst.size(); for(int i = 0; i < count; i++){ @@ -248,6 +256,7 @@ if (m && mrk) m->setLabelOffset(mrk->xLabelOffset(), mrk->yLabelOffset()); } + return new_s; } @@ -298,6 +307,8 @@ QString s = "\n"; s += "\t" + QString(d_matrix->objectName()) + "\n"; s += "\t" + QString::number(d_use_matrix_formula) + "\n"; +s += "\t" + QString::number(xAxis()) + "\n"; +s += "\t" + QString::number(yAxis()) + "\n"; if (color_map_policy != Custom) s += "\t" + QString::number(color_map_policy) + "\n"; === added file 'qtiplot/src/plot2D/SubtractLineTool.cpp' --- qtiplot/src/plot2D/SubtractLineTool.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/plot2D/SubtractLineTool.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,122 @@ +/*************************************************************************** + File : SubtractLineTool.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2010 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Plot tool for substracting a straight line + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "SubtractLineTool.h" +#include "RangeSelectorTool.h" +#include +#include + +#include +#include +#include +#include + +#include + +SubtractLineTool::SubtractLineTool(Graph *graph, ApplicationWindow *app, const QObject *status_target, const char *status_slot) + : PlotToolInterface(graph) +{ + d_selected_points = 0; + if (status_target) + connect(this, SIGNAL(statusText(const QString&)), status_target, status_slot); + d_picker_tool = new ScreenPickerTool(d_graph, this, SIGNAL(statusText(const QString&))); + d_graph->canvas()->setCursor(QCursor(QPixmap(":/cursor.png"), -1, -1)); + + QString msg = tr("Move cursor and click to select and double-click/press 'Enter' to set the position of the first point!"); + emit statusText(msg); + + connect(d_picker_tool, SIGNAL(selected(const QwtDoublePoint &)), this, SLOT(selectPoint(const QwtDoublePoint &))); + d_graph->canvas()->grabMouse(); +} + +SubtractLineTool::~SubtractLineTool() +{ + d_graph->canvas()->releaseMouse(); + + if (d_picker_tool) + delete d_picker_tool; +} + +void SubtractLineTool::selectPoint(const QwtDoublePoint &pos) +{ + d_selected_points++; + if (d_selected_points == 2){ + d_line.setP2(QPointF(pos.x(), pos.y())); + finalize(); + } else { + d_line.setP1(QPointF(pos.x(), pos.y())); + + d_first_point_marker = new QwtPlotMarker(); + d_first_point_marker->setLinePen(QPen(Qt::red, 1, Qt::DashLine)); + d_first_point_marker->setLineStyle(QwtPlotMarker::Cross); + d_first_point_marker->setSymbol(QwtSymbol(QwtSymbol::Ellipse, QBrush(), QPen(Qt::red, 1), QSize(12, 12))); + d_first_point_marker->setValue(pos.x(), pos.y()); + d_first_point_marker->attach(d_graph); + d_graph->replot(); + + QString msg = tr("First point selected! Click to select and double-click/press 'Enter' to set the position of the 2nd point!"); + emit statusText(msg); + } +} + +void SubtractLineTool::finalize() +{ + delete d_picker_tool; d_picker_tool = NULL; + d_graph->canvas()->releaseMouse(); + d_first_point_marker->detach(); + delete d_first_point_marker; + + if (d_graph->activeTool() && d_graph->activeTool()->rtti() == PlotToolInterface::Rtti_RangeSelector){ + ((RangeSelectorTool *)d_graph->activeTool())->setEnabled(); + } else + d_graph->canvas()->unsetCursor(); + + double den = d_line.x2() - d_line.x1(); + double slope = 0.0; + double intercept = 0.0; + if (den != 0.0){ + slope = (d_line.y2() - d_line.y1())/den; + intercept = d_line.y1() - slope*d_line.x1(); + } + + for (int i = 0; i < d_graph->curveCount(); i++){ + DataCurve *c = d_graph->dataCurve(i); + if (!c) + continue; + + Table *t = c->table(); + int yCol = t->colIndex(c->title().text()); + int n = c->dataSize(); + for (int j = 0; j < n; j++){ + if (!t->text(j, yCol).isEmpty()) + t->setCell(j, yCol, c->y(j) - (c->x(j)*slope + intercept)); + } + t->notifyChanges(c->title().text()); + } + d_graph->setActiveTool(NULL); +} === added file 'qtiplot/src/plot2D/SubtractLineTool.h' --- qtiplot/src/plot2D/SubtractLineTool.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/plot2D/SubtractLineTool.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,69 @@ +/*************************************************************************** + File : SubtractLineTool.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2010 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Plot tool for substracting a straight line + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef SUBSTRACT_LINE_TOOL +#define SUBSTRACT_LINE_TOOL + +#include "PlotToolInterface.h" +#include +#include + +#include "ScreenPickerTool.h" + +class ApplicationWindow; +class QwtPlotCurve; +class QwtPlotMarker; + +/*! Plot tool for substracting a straight line. + */ +class SubtractLineTool : public QObject, public PlotToolInterface +{ + Q_OBJECT + public: + SubtractLineTool(Graph *graph, ApplicationWindow *app, const QObject *status_target, const char *status_slot); + virtual ~SubtractLineTool(); + + virtual int rtti() const {return PlotToolInterface::Rtti_SubtractLineTool;}; + signals: + /*! Emitted whenever a new message should be presented to the user. + * + * You don't have to connect to this signal if you alreay specified a reciever during initialization. + */ + void statusText(const QString&); + protected slots: + void selectPoint(const QwtDoublePoint &pos); + + private: + void finalize(); + int d_selected_points; + ScreenPickerTool *d_picker_tool; + QwtPlotMarker *d_first_point_marker; + QLineF d_line; +}; + +#endif === modified file 'qtiplot/src/plot2D/TranslateCurveTool.cpp' --- qtiplot/src/plot2D/TranslateCurveTool.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/TranslateCurveTool.cpp 2010-07-21 23:21:08 +0000 @@ -31,7 +31,6 @@ #include "PlotCurve.h" #include "FunctionCurve.h" #include -#include #include "DataPickerTool.h" #include "ScreenPickerTool.h" #include === modified file 'qtiplot/src/plot2D/VectorCurve.cpp' --- qtiplot/src/plot2D/VectorCurve.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/VectorCurve.cpp 2010-07-21 23:21:08 +0000 @@ -150,7 +150,7 @@ p->rotate(-t); double pi = 4*atan(-1.0); - double headLength = d_headLength*(double)p->device()->logicalDpiX()/(double)plot()->logicalDpiX(); + int headLength = qRound(d_headLength*(double)p->device()->logicalDpiX()/(double)plot()->logicalDpiX()); int d = qRound(headLength*tan(pi*(double)d_headAngle/180.0)); QPolygon endArray(3); === removed file 'qtiplot/src/plot2D/cursors.h' --- qtiplot/src/plot2D/cursors.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/plot2D/cursors.h 1970-01-01 00:00:00 +0000 @@ -1,142 +0,0 @@ -/*************************************************************************** - File : cursors.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Various cursor bitmaps (XPMs) - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -static const char *cursor_xpm[]={ -"32 32 2 1", -". c None", -"# c #000000", -"................................", -"................................", -"................................", -"................................", -"................................", -"................................", -"................................", -"................................", -"...............##...............", -"...............##...............", -"...............##...............", -"...............##...............", -"...............##...............", -"...........##########...........", -"...........##......##...........", -"...........##......##...........", -".....########......#########....", -"...........##......##...........", -"...........##......##...........", -"...........##########...........", -"...............##...............", -"...............##...............", -"...............##...............", -"...............##...............", -"...............##...............", -"................................", -"................................", -"................................", -"................................", -"................................", -"................................", -"................................"}; - -static const char *vizor_xpm[]={ -"32 32 3 1", -". c None", -"# c #000000", -"o c #ffffff", -"................................", -"................................", -".oooooooooooooooooooooooooooooo.", -".o############################o.", -".o#ooooooooooooo#oooooooooooo#o.", -".o#o...........o#o..........o#o.", -".o#o...........o#o..........o#o.", -".o#o...........o#o..........o#o.", -".o#o...........o#o..........o#o.", -".o#o...........o#o..........o#o.", -".o#o...........o#o..........o#o.", -".o#o...........o#o..........o#o.", -".o#o...........ooo..........o#o.", -".o#o........................o#o.", -".o#oooooooooooo...ooooooooooo#o.", -".o############o...o###########o.", -".o#oooooooooooo...ooooooooooo#o.", -".o#o........................o#o.", -".o#o...........ooo..........o#o.", -".o#o...........o#o..........o#o.", -".o#o...........o#o..........o#o.", -".o#o...........o#o..........o#o.", -".o#o...........o#o..........o#o.", -".o#o...........o#o..........o#o.", -".o#o...........o#o..........o#o.", -".o#o...........o#o..........o#o.", -".o#ooooooooooooo#oooooooooooo#o.", -".o############################o.", -".oooooooooooooooooooooooooooooo.", -"................................", -"................................", -"................................"}; - -static const char *lens_xpm[]={ -"32 32 4 1", -". c None", -"# c None", -"a c #000000", -"b c #ffffff", -"..................##############", -".###############..##############", -".###############..##############", -".###############..##############", -".###############..##############", -".###############..##############", -".###############..##############", -".###############..##############", -".########...............########", -".########...aaaa........########", -".########..a....a.......########", -".########.a......a......########", -".########a........a.....########", -".########a.a......a.....########", -".########a.aa.....a.....########", -".########a.baa....a.....########", -".########.abbaa..a......########", -"...........a....aaa.....########", -"............aaaa.aaa....########", -"#########.........aaa...########", -"#########..........aaa..########", -"#########...........aaa.########", -"#########............aaa########", -"#########.............aaa#######", -"#######################aaa######", -"########################a#######", -"################################", -"################################", -"################################", -"################################", -"################################", -"################################"}; - === modified file 'qtiplot/src/plot2D/dialogs/AxesDialog.cpp' --- qtiplot/src/plot2D/dialogs/AxesDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/dialogs/AxesDialog.cpp 2010-07-21 23:21:08 +0000 @@ -2,7 +2,8 @@ File : AxesDialog.cpp Project : QtiPlot -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, Tilman Hoener zu Siederdissen + Copyright : (C) 2004 - 2010 by Ion Vasilief, + (C) 2006 - June 2007 Tilman Hoener zu Siederdissen Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net Description : General plot options dialog @@ -38,10 +39,8 @@ #include #include #include -#include #include #include -#include #include #include @@ -105,8 +104,7 @@ connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( buttonApply, SIGNAL( clicked() ), this, SLOT(updatePlot() ) ); - connect( generalDialog, SIGNAL( currentChanged ( QWidget * ) ), - this, SLOT(pageChanged ( QWidget * ) ) ); + connect( generalDialog, SIGNAL( currentChanged ( QWidget * ) ), this, SLOT(pageChanged( QWidget *))); } void AxesDialog::initScalesPage() @@ -150,13 +148,13 @@ boxScaleTypeLabel = new QLabel(tr( "Type" )); boxScaleType = new QComboBox(); boxScaleType->setIconSize(QSize(27, 16)); - boxScaleType->addItem(QIcon(QPixmap(liniar_scale_xpm)), tr( "Linear" )); - boxScaleType->addItem(QIcon(QPixmap(log10_xpm)), tr( "Log10" )); - boxScaleType->addItem(QIcon(QPixmap(ln_scale_xpm)), tr( "ln" )); - boxScaleType->addItem(QIcon(QPixmap(log2_scale_xpm)), tr( "Log2" )); - boxScaleType->addItem(QIcon(QPixmap(reciprocal_scale_xpm)), tr( "Reciprocal" )); - boxScaleType->addItem(QIcon(QPixmap(probability_scale_xpm)), tr( "Probability" )); - boxScaleType->addItem(QIcon(QPixmap(logit_scale_xpm)), tr( "Logit" )); + boxScaleType->addItem(QIcon(":/liniar_scale.png"), tr( "Linear" )); + boxScaleType->addItem(QIcon(":/log10.png"), tr( "Log10" )); + boxScaleType->addItem(QIcon(":/ln_scale.png"), tr( "ln" )); + boxScaleType->addItem(QIcon(":/log2_scale.png"), tr( "Log2" )); + boxScaleType->addItem(QIcon(":/reciprocal_scale.png"), tr( "Reciprocal" )); + boxScaleType->addItem(QIcon(":/probability_scale.png"), tr( "Probability" )); + boxScaleType->addItem(QIcon(":/logit_scale.png"), tr( "Logit" )); middleLayout->addWidget( boxScaleTypeLabel, 2, 0); middleLayout->addWidget( boxScaleType, 2, 1); @@ -276,10 +274,10 @@ vl->addLayout(hl); vl->addWidget(boxAxesBreaks); - QPixmap image0( ( const char** ) bottom_scl_xpm ); - QPixmap image1( ( const char** ) left_scl_xpm ); - QPixmap image2( ( const char** ) top_scl_xpm ); - QPixmap image3( ( const char** ) right_scl_xpm ); + QPixmap image0(":/bottom_scl.png"); + QPixmap image1(":/left_scl.png"); + QPixmap image2(":/top_scl.png"); + QPixmap image3(":/right_scl.png"); axesList = new QListWidget(); axesList->addItem( new QListWidgetItem(image0, tr( "Bottom" ))); @@ -334,10 +332,10 @@ rightLayout->addWidget( new QLabel(tr( "Line Color" )), 1, 0 ); - boxColorMajor = new ColorBox(0); + boxColorMajor = new ColorButton(); rightLayout->addWidget( boxColorMajor, 1, 1); - boxColorMinor = new ColorBox(0); + boxColorMinor = new ColorButton(); boxColorMinor->setDisabled(true); rightLayout->addWidget( boxColorMinor, 1, 2); @@ -400,8 +398,8 @@ rightLayout->setRowStretch(7, 1); rightLayout->setColumnStretch(4, 1); - QPixmap image2( ( const char** ) image2_data ); - QPixmap image3( ( const char** ) image3_data ); + QPixmap image2(":/vertical_grid.png"); + QPixmap image3(":/horizontal_grid.png"); axesGridList = new QListWidget(); axesGridList->addItem( new QListWidgetItem(image3, tr( "Horizontal" )) ); @@ -433,8 +431,8 @@ connect(boxMajorGrid,SIGNAL(toggled(bool)), this, SLOT(majorGridEnabled(bool))); connect(boxMinorGrid,SIGNAL(toggled(bool)), this, SLOT(minorGridEnabled(bool))); connect(boxAntialiseGrid,SIGNAL(toggled(bool)), this, SLOT(updateGrid())); - connect(boxColorMajor,SIGNAL(activated(int)),this, SLOT(updateGrid())); - connect(boxColorMinor,SIGNAL(activated(int)),this, SLOT(updateGrid())); + connect(boxColorMajor, SIGNAL(colorChanged(const QColor &)),this, SLOT(updateGrid())); + connect(boxColorMinor, SIGNAL(colorChanged(const QColor &)),this, SLOT(updateGrid())); connect(boxTypeMajor,SIGNAL(activated(int)),this, SLOT(updateGrid())); connect(boxTypeMinor,SIGNAL(activated(int)),this, SLOT(updateGrid())); connect(boxWidthMajor,SIGNAL(valueChanged(double)),this, SLOT(updateGrid())); @@ -446,10 +444,10 @@ void AxesDialog::initAxesPage() { //axes page - QPixmap bottom_axis_pic( ( const char** ) bottom_axis_xpm ); - QPixmap left_axis_pic( ( const char** ) left_axis_xpm ); - QPixmap top_axis_pic( ( const char** ) top_axis_xpm ); - QPixmap right_axis_pic( ( const char** ) right_axis_xpm ); + QPixmap bottom_axis_pic(":/bottom_axis.png"); + QPixmap left_axis_pic(":/left_axis.png"); + QPixmap top_axis_pic(":/top_axis.png"); + QPixmap right_axis_pic(":/right_axis.png"); axesPage = new QWidget(); @@ -498,6 +496,7 @@ hl->addWidget(new QLabel(tr("Distance to axis"))); boxLabelsDistance = new QSpinBox(); boxLabelsDistance->setRange(0, 1000); + boxLabelsDistance->setSuffix(" " + tr("pixels")); connect(boxLabelsDistance, SIGNAL(valueChanged(int)), this, SLOT(updatePlot())); hl->addWidget(boxLabelsDistance); @@ -551,34 +550,56 @@ leftBoxLayout->addWidget( new QLabel(tr( "Minor Ticks" )), 4, 0 ); - boxMinorTicksType= new QComboBox(); + boxMinorTicksType = new QComboBox(); boxMinorTicksType->addItem(tr( "None" ) ); boxMinorTicksType->addItem(tr( "Out" ) ); boxMinorTicksType->addItem(tr( "In & Out" ) ); boxMinorTicksType->addItem(tr( "In" ) ); leftBoxLayout->addWidget( boxMinorTicksType, 4, 1); - leftBoxLayout->addWidget( new QLabel(tr("Stand-off")), 5, 0); + leftBoxLayout->addWidget( new QLabel(tr( "Hide Ticks" )), 5, 0 ); + showTicksPolicyBox = new QComboBox(); + showTicksPolicyBox->addItem(tr("None")); + showTicksPolicyBox->addItem(tr("At Axis Begin")); + showTicksPolicyBox->addItem(tr("At Axis End")); + showTicksPolicyBox->addItem(tr("At Axis Begin & End")); + leftBoxLayout->addWidget(showTicksPolicyBox, 5, 1); + + leftBoxLayout->addWidget( new QLabel(tr("Labels space")), 6, 0); + boxTickLabelDistance = new QSpinBox(); + boxTickLabelDistance->setRange( 0, 10000); + boxTickLabelDistance->setSuffix(" " + tr("pixels")); + leftBoxLayout->addWidget(boxTickLabelDistance, 6, 1); + + leftBoxLayout->addWidget( new QLabel(tr("Stand-off")), 7, 0); boxBaseline = new QSpinBox(); boxBaseline->setRange( 0, 1000 ); - leftBoxLayout->addWidget(boxBaseline, 5, 1); + boxBaseline->setSuffix(" " + tr("pixels")); + leftBoxLayout->addWidget(boxBaseline, 7, 1); QLabel *l = new QLabel(tr("Apply &to")); - leftBoxLayout->addWidget(l, 6, 0); + leftBoxLayout->addWidget(l, 8, 0); axisFormatApplyToBox = new QComboBox(); axisFormatApplyToBox->insertItem(tr("Axis")); axisFormatApplyToBox->insertItem(tr("Layer")); axisFormatApplyToBox->insertItem(tr("Window")); axisFormatApplyToBox->insertItem(tr("All Windows")); - leftBoxLayout->addWidget(axisFormatApplyToBox, 6, 1); + leftBoxLayout->addWidget(axisFormatApplyToBox, 8, 1); l->setBuddy(axisFormatApplyToBox); boxShowLabels = new QGroupBox(tr("Show Labels")); boxShowLabels->setCheckable(true); boxShowLabels->setChecked(true); - bottomLayout->addWidget( boxShowLabels ); + boxAxisBackbone = new QCheckBox(tr("Show &backbone")); + + QVBoxLayout *vb = new QVBoxLayout; + vb->addWidget( boxShowLabels ); + vb->addWidget( boxAxisBackbone ); + + bottomLayout->addLayout( vb ); + QGridLayout *rightBoxLayout = new QGridLayout( boxShowLabels ); label1 = new QLabel(tr("Column")); @@ -652,6 +673,7 @@ connect(axesTitlesList,SIGNAL(currentRowChanged(int)), this, SLOT(setAxisType(int))); connect(axesTitlesList,SIGNAL(currentRowChanged(int)), this, SLOT(setBaselineDist(int))); connect(axesTitlesList,SIGNAL(currentRowChanged(int)), this, SLOT(updateLabelsFormat(int))); + connect(axesTitlesList,SIGNAL(currentRowChanged(int)), this, SLOT(updateCurrentAxis())); connect(boxShowLabels,SIGNAL(clicked(bool)), this, SLOT(updateTickLabelsList(bool))); @@ -659,7 +681,10 @@ connect(boxAxisNumColor, SIGNAL(colorChanged()), this, SLOT(updatePlot())); connect(boxMajorTicksType, SIGNAL(activated(int)), this, SLOT(updatePlot())); connect(boxMinorTicksType, SIGNAL(activated(int)), this, SLOT(updatePlot())); + connect(showTicksPolicyBox, SIGNAL(activated(int)), this, SLOT(updatePlot())); connect(boxBaseline, SIGNAL(valueChanged(int)), this, SLOT(updatePlot())); + connect(boxAxisBackbone, SIGNAL(clicked(bool)), this, SLOT(updatePlot())); + connect(boxTickLabelDistance, SIGNAL(valueChanged(int)), this, SLOT(updatePlot())); connect(boxShowFormula, SIGNAL(clicked()), this, SLOT(showFormulaBox())); connect(boxShowAxis, SIGNAL(clicked()), this, SLOT(showAxis())); @@ -787,6 +812,7 @@ boxFormat->insertItem(tr( "Scientific: 1e4" ) ); boxFormat->insertItem(tr( "Scientific: 1x10^4" ) ); boxFormat->insertItem(tr( "Engineering: 10k" ) ); + boxFormat->insertItem(tr( "Scientific: 110^4" ) ); boxFormat->setCurrentIndex(d_graph->axisLabelFormat(axis)); label3->show(); @@ -843,19 +869,23 @@ originDateTimeBox->setDateTime (scaleDraw->dateTimeOrigin()); } - boxFormat->insertItem("h"); - boxFormat->insertItem("h ap"); - boxFormat->insertItem("h AP"); - boxFormat->insertItem("h:mm"); - boxFormat->insertItem("h:mm ap"); - boxFormat->insertItem("hh:mm"); - boxFormat->insertItem("h:mm:ss"); - boxFormat->insertItem("h:mm:ss.zzz"); - boxFormat->insertItem("mm:ss"); - boxFormat->insertItem("mm:ss.zzz"); - boxFormat->insertItem("hmm"); - boxFormat->insertItem("hmmss"); - boxFormat->insertItem("hhmmss"); + boxFormat->insertItem("h"); + boxFormat->insertItem("h ap"); + boxFormat->insertItem("h AP"); + boxFormat->insertItem("M"); + boxFormat->insertItem("S"); + boxFormat->insertItem("h:mm"); + boxFormat->insertItem("h:mm ap"); + boxFormat->insertItem("hh:mm"); + boxFormat->insertItem("h:mm:ss"); + boxFormat->insertItem("h:mm:ss.zzz"); + boxFormat->insertItem("m"); + boxFormat->insertItem("mm"); + boxFormat->insertItem("mm:ss"); + boxFormat->insertItem("mm:ss.zzz"); + boxFormat->insertItem("hmm"); + boxFormat->insertItem("hmmss"); + boxFormat->insertItem("hhmmss"); } break; @@ -908,6 +938,7 @@ axisFormatBox->setEnabled(ok); boxShowLabels->setEnabled(ok); labelBox->setEnabled(ok); + boxAxisBackbone->setEnabled(ok); int axis = -1; int a = axesTitlesList->currentRow(); @@ -952,7 +983,8 @@ showAxis(axis, boxAxisType->currentIndex(), boxColName->currentText(),ok, boxMajorTicksType->currentIndex(), boxMinorTicksType->currentIndex(), boxShowLabels->isChecked(), boxAxisColor->color(), boxFormat->currentIndex(), - boxPrecision->value(), boxAngle->value(), boxBaseline->value(), formula, boxAxisNumColor->color()); + boxPrecision->value(), boxAngle->value(), boxBaseline->value(), formula, boxAxisNumColor->color(), + boxTickLabelDistance->value(), boxAxisBackbone->isChecked(), showTicksPolicyBox->currentIndex()); } void AxesDialog::updateShowBox(int axis) @@ -1108,18 +1140,14 @@ grid->enableX(boxMajorGrid->isChecked()); grid->enableXMin(boxMinorGrid->isChecked()); - grid->setMajPenX(QPen(ColorBox::color(boxColorMajor->currentIndex()), boxWidthMajor->value(), - boxTypeMajor->style())); - grid->setMinPenX(QPen(ColorBox::color(boxColorMinor->currentIndex()), boxWidthMinor->value(), - boxTypeMinor->style())); + grid->setMajPenX(QPen(boxColorMajor->color(), boxWidthMajor->value(), boxTypeMajor->style())); + grid->setMinPenX(QPen(boxColorMinor->color(), boxWidthMinor->value(), boxTypeMinor->style())); } else { grid->enableY(boxMajorGrid->isChecked()); grid->enableYMin(boxMinorGrid->isChecked()); - grid->setMajPenY(QPen(ColorBox::color(boxColorMajor->currentIndex()), boxWidthMajor->value(), - boxTypeMajor->style())); - grid->setMinPenY(QPen(ColorBox::color(boxColorMinor->currentIndex()), boxWidthMinor->value(), - boxTypeMinor->style())); + grid->setMajPenY(QPen(boxColorMajor->color(), boxWidthMajor->value(), boxTypeMajor->style())); + grid->setMinPenY(QPen(boxColorMinor->color(), boxWidthMinor->value(), boxTypeMinor->style())); } grid->enableZeroLineX(boxXLine->isChecked()); @@ -1241,10 +1269,13 @@ boxAxisNumColor->blockSignals(false); } -bool AxesDialog::updatePlot() +bool AxesDialog::updatePlot(QWidget *page) { - if (generalDialog->currentWidget()==(QWidget*)scalesPage) - { + QWidget *currentWidget = generalDialog->currentWidget(); + if (page) + currentWidget = page; + + if (currentWidget == scalesPage){ int a = mapToQwtAxis(axesList->currentRow()); ScaleDraw::ScaleType type = d_graph->axisType(a); @@ -1307,11 +1338,9 @@ boxMinorTicksBeforeBreak->currentText().toInt(), boxMinorTicksAfterBreak->currentText().toInt(), boxLog10AfterBreak->isChecked(), boxBreakWidth->value(), boxBreakDecoration->isChecked()); d_graph->notifyChanges(); - } - else if (generalDialog->currentWidget() == gridPage) + } else if (currentWidget == gridPage) updateGrid(); - else if (generalDialog->currentWidget() == (QWidget*)axesPage) - { + else if (currentWidget == axesPage){ int axis = mapToQwtAxisId(); int format = boxAxisType->currentIndex(); @@ -1358,7 +1387,7 @@ d_graph->setAxisTitle(axis, boxTitle->text()); d_graph->setAxisTitleDistance(axis, boxLabelsDistance->value()); - + if (axis == QwtPlot::xBottom) xBottomLabelsRotation = boxAngle->value(); else if (axis == QwtPlot::xTop) @@ -1369,7 +1398,8 @@ formula = QString(); showAxis(axis, format, formatInfo, boxShowAxis->isChecked(), boxMajorTicksType->currentIndex(), boxMinorTicksType->currentIndex(), boxShowLabels->isChecked(), boxAxisColor->color(), boxFormat->currentIndex(), - boxPrecision->value(), boxAngle->value(), baseline, formula, boxAxisNumColor->color()); + boxPrecision->value(), boxAngle->value(), baseline, formula, boxAxisNumColor->color(), + boxTickLabelDistance->value(), boxAxisBackbone->isChecked(), showTicksPolicyBox->currentIndex()); if (axis == QwtPlot::yRight){ QwtScaleWidget *scale = d_graph->axisWidget(axis); @@ -1378,9 +1408,8 @@ scale->repaint(); } } - - applyAxisFormat(); - } else if (generalDialog->currentWidget() == (QWidget*)frame) + applyAxisFormat(); + } else if (currentWidget == frame) applyCanvasFormat(); return true; @@ -1634,7 +1663,24 @@ void AxesDialog::setBaselineDist(int) { - boxBaseline->setValue(axesBaseline[mapToQwtAxisId()]); + boxBaseline->setValue(axesBaseline[mapToQwtAxisId()]); +} + +void AxesDialog::updateCurrentAxis() +{ + int axis = mapToQwtAxisId(); + ScaleDraw *sd = (ScaleDraw *)d_graph->axisScaleDraw (axis); + if (sd){ + boxAxisBackbone->setChecked(sd->hasComponent(QwtAbstractScaleDraw::Backbone)); + + boxTickLabelDistance->blockSignals(true); + boxTickLabelDistance->setValue(sd->spacing()); + boxTickLabelDistance->blockSignals(false); + + showTicksPolicyBox->blockSignals(true); + showTicksPolicyBox->setCurrentIndex(sd->showTicksPolicy()); + showTicksPolicyBox->blockSignals(false); + } } void AxesDialog::setTicksType(int) @@ -1677,7 +1723,8 @@ showAxis(axis, type, formatInfo, boxShowAxis->isChecked(), boxMajorTicksType->currentIndex(), boxMinorTicksType->currentIndex(), boxShowLabels->isChecked(), boxAxisColor->color(), boxFormat->currentIndex(), boxPrecision->value(), - boxAngle->value(), boxBaseline->value(), formula, boxAxisNumColor->color()); + boxAngle->value(), boxBaseline->value(), formula, boxAxisNumColor->color(), + boxTickLabelDistance->value(), boxAxisBackbone->isChecked(), showTicksPolicyBox->currentIndex()); } void AxesDialog::setCurrentScale(int axisPos) @@ -1745,7 +1792,8 @@ showAxis(axis, type, formatInfo, boxShowAxis->isChecked(), boxMajorTicksType->currentIndex(), boxMinorTicksType->currentIndex(), boxShowLabels->isChecked(), boxAxisColor->color(), - format, prec, boxAngle->value(), boxBaseline->value(), formula, boxAxisNumColor->color()); + format, prec, boxAngle->value(), boxBaseline->value(), formula, boxAxisNumColor->color(), + boxTickLabelDistance->value(), boxAxisBackbone->isChecked(), showTicksPolicyBox->currentIndex()); } void AxesDialog::showAxisFormula(int axis) @@ -1813,14 +1861,19 @@ void AxesDialog::pageChanged ( QWidget *page ) { - if (lastPage == scalesPage && page == axesPage){ - axesTitlesList->setCurrentRow(axesList->currentRow()); - lastPage = page; - }else if (lastPage == axesPage && page == scalesPage){ - axesList->setCurrentRow(axesTitlesList->currentRow()); - updateScale(); - lastPage = page; - } + updatePlot(lastPage); + + if (lastPage == scalesPage && page == axesPage){ + axesTitlesList->setCurrentRow(axesList->currentRow()); + } else if (lastPage == axesPage && page == scalesPage){ + axesList->setCurrentRow(axesTitlesList->currentRow()); + updateScale(); + } + + if (page == axesPage) + updateCurrentAxis(); + + lastPage = page; } int AxesDialog::exec() @@ -1868,7 +1921,8 @@ void AxesDialog::showAxis(int axis, int type, const QString& labelsColName, bool axisOn, int majTicksType, int minTicksType, bool labelsOn, const QColor& c, int format, - int prec, int rotation, int baselineDist, const QString& formula, const QColor& labelsColor) + int prec, int rotation, int baselineDist, const QString& formula, const QColor& labelsColor, + int spacing, bool backbone, int showTicks) { ApplicationWindow *app = (ApplicationWindow *)this->parent(); if (!app) @@ -1881,7 +1935,7 @@ if (!d_graph) return; d_graph->showAxis(axis, type, labelsColName, w, axisOn, majTicksType, minTicksType, labelsOn, - c, format, prec, rotation, baselineDist, formula, labelsColor); + c, format, prec, rotation, baselineDist, formula, labelsColor, spacing, backbone, (ScaleDraw::ShowTicksPolicy)showTicks); } void AxesDialog::applyCanvasFormatTo(Graph *g) @@ -1961,12 +2015,12 @@ void AxesDialog::applyAxisFormatToLayer(Graph *g) { - if (!g) - return; + if (!g) + return; - for (int i=0; iaxisEnabled(i)) - continue; + for (int i = 0; iaxisEnabled(i)) + continue; QwtScaleWidget *axis = g->axisWidget(i); if (!axis) @@ -1983,10 +2037,16 @@ g->setAxisTicksLength(i, boxMajorTicksType->currentIndex(), boxMinorTicksType->currentIndex(), boxMinorTicksLength->value(), boxMajorTicksLength->value()); g->setAxisFont(i, d_graph->axisFont(mapToQwtAxisId())); + + ScaleDraw *sd = (ScaleDraw *)g->axisScaleDraw(i); + sd->setSpacing(boxTickLabelDistance->value()); + sd->enableComponent (QwtAbstractScaleDraw::Backbone, boxAxisBackbone->isChecked()); + sd->setShowTicksPolicy((ScaleDraw::ShowTicksPolicy)showTicksPolicyBox->currentIndex()); + axis->repaint(); } g->updateLayout(); - g->replot(); + g->replot(); } void AxesDialog::applyAxisFormat() @@ -2028,7 +2088,13 @@ app->modifiedProject(); } -void AxesDialog::setDisplayDateTimeFormat( const QString & format) +void AxesDialog::setDisplayDateTimeFormat(const QString & format) { + ScaleDraw *scaleDraw = (ScaleDraw *) d_graph->axisScaleDraw(mapToQwtAxisId()); + if (scaleDraw && scaleDraw->scaleType() == ScaleDraw::Time && (format == "M" || format == "S")){ + originDateTimeBox->setDisplayFormat("hh:mm:ss"); + return; + } + originDateTimeBox->setDisplayFormat(format); } === modified file 'qtiplot/src/plot2D/dialogs/AxesDialog.h' --- qtiplot/src/plot2D/dialogs/AxesDialog.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/dialogs/AxesDialog.h 2010-07-21 23:21:08 +0000 @@ -48,7 +48,6 @@ class QTabWidget; class QWidget; class QStringList; -class ColorBox; class ColorButton; class Graph; class TextFormatButtons; @@ -94,7 +93,7 @@ void setAxisType(int axis); void updateAxisType(int axis); void updateTitleBox(int axis); - bool updatePlot(); + bool updatePlot(QWidget *page = NULL); void updateScale(); void stepEnabled(); void stepDisabled(); @@ -119,12 +118,12 @@ void changeMinorTicksLength (int minLength); void changeMajorTicksLength (int majLength); void pageChanged ( QWidget *page); - void showAxis(int, int, const QString&, bool, int, int, bool, - const QColor&, int, int, int, int, const QString&, const QColor&); + void showAxis(int, int, const QString&, bool, int, int, bool, const QColor&, int, int, int, int, const QString&, const QColor&, int, bool, int); void applyCanvasFormat(); void setFrameDefaultValues(); void applyAxisFormat(); void setDisplayDateTimeFormat( const QString &); + void updateCurrentAxis(); protected: void applyCanvasFormatTo(Graph *g); @@ -160,8 +159,8 @@ QCheckBox* boxMajorGrid; QCheckBox* boxMinorGrid; PenStyleBox* boxTypeMajor; - ColorBox* boxColorMinor; - ColorBox* boxColorMajor; + ColorButton* boxColorMinor; + ColorButton* boxColorMajor; ColorButton *boxCanvasColor; DoubleSpinBox* boxWidthMajor; PenStyleBox* boxTypeMinor; @@ -212,6 +211,10 @@ QComboBox *axisFormatApplyToBox; QDateTimeEdit *originDateTimeBox; QCheckBox *invertTitleBox; + QCheckBox* boxAxisBackbone; + QSpinBox *boxTickLabelDistance; + + QComboBox *showTicksPolicyBox; }; #endif === added file 'qtiplot/src/plot2D/dialogs/ContourLinesEditor.cpp' --- qtiplot/src/plot2D/dialogs/ContourLinesEditor.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/plot2D/dialogs/ContourLinesEditor.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,412 @@ +/*************************************************************************** + File : ContourLinesEditor.cpp + Project : QtiPlot +-------------------------------------------------------------------- + Copyright : (C) 2009 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : A Contour Lines Editor Widget + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "ContourLinesEditor.h" +#include "DoubleSpinBox.h" +#include "Spectrogram.h" +#include "PenStyleBox.h" +#include "ColorButton.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +ContourLinesEditor::ContourLinesEditor(const QLocale& locale, int precision, QWidget* parent) + : QWidget(parent), + d_spectrogram(NULL), + d_locale(locale), + d_precision(precision) +{ + table = new QTableWidget(); + table->setColumnCount(2); + table->hideColumn(1); + table->setSelectionMode(QAbstractItemView::SingleSelection); + table->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); + table->horizontalHeader()->setClickable( false ); + table->horizontalHeader()->setResizeMode(QHeaderView::Stretch); + table->viewport()->setMouseTracking(true); + table->viewport()->installEventFilter(this); + table->setHorizontalHeaderLabels(QStringList() << tr("Level") << tr("Pen")); + table->setMinimumHeight(6*table->horizontalHeader()->height() + 2); + table->installEventFilter(this); + + connect(table, SIGNAL(cellClicked (int, int)), this, SLOT(showPenDialog(int, int))); + + insertBtn = new QPushButton(tr("&Insert")); + insertBtn->setEnabled(false); + connect(insertBtn, SIGNAL(clicked()), this, SLOT(insertLevel())); + + deleteBtn = new QPushButton(tr("&Delete")); + deleteBtn->setEnabled(false); + connect(deleteBtn, SIGNAL(clicked()), this, SLOT(deleteLevel())); + + QHBoxLayout* hb = new QHBoxLayout(); + hb->addWidget(insertBtn); + hb->addWidget(deleteBtn); + + QVBoxLayout* vl = new QVBoxLayout(this); + vl->setSpacing(0); + vl->addWidget(table); + vl->addLayout(hb); + + setFocusProxy(table); + setMaximumWidth(200); + + penDialog = NULL; +} + +void ContourLinesEditor::updateContourLevels() +{ + if (!d_spectrogram) + return; + + int rows = table->rowCount(); + QwtValueList levels; + for (int i = 0; i < rows; i++) + levels << ((DoubleSpinBox*)table->cellWidget(i, 0))->value(); + + d_spectrogram->setContourLevels(levels); +} + +void ContourLinesEditor::updateContourPens() +{ + if (!d_spectrogram) + return; + + if (!table->isColumnHidden(1)) + d_spectrogram->setContourPenList(d_pen_list); +} + +void ContourLinesEditor::setSpectrogram(Spectrogram *sp) +{ + if (!sp || d_spectrogram == sp) + return; + + d_spectrogram = sp; + updateContents(); +} + +void ContourLinesEditor::updateContents() +{ + if (!d_spectrogram) + return; + + QwtValueList levels = d_spectrogram->contourLevels (); + + int rows = (int)levels.size(); + table->setRowCount(rows); + table->blockSignals(true); + + QwtDoubleInterval range = d_spectrogram->data().range(); + for (int i = 0; i < rows; i++){ + DoubleSpinBox *sb = new DoubleSpinBox(); + sb->setLocale(d_locale); + sb->setDecimals(d_precision); + sb->setValue(levels[i]); + sb->setRange(range.minValue (), range.maxValue ()); + connect(sb, SIGNAL(activated(DoubleSpinBox *)), this, SLOT(spinBoxActivated(DoubleSpinBox *))); + table->setCellWidget(i, 0, sb); + + QPen pen = d_spectrogram->defaultContourPen(); + if (pen.style() == Qt::NoPen) + pen = d_spectrogram->contourPen (levels[i]); + + int width = 80; + int height = 20; + QPixmap pix(width, height); + pix.fill(Qt::white); + QPainter paint(&pix); + paint.setRenderHint(QPainter::Antialiasing); + paint.setPen(pen); + paint.drawLine(0, height/2, width, height/2); + paint.end(); + + QLabel *lbl = new QLabel(); + lbl->setPixmap(pix); + + table->setCellWidget(i, 1, lbl); + + d_pen_list << pen; + } + table->blockSignals(false); +} + +void ContourLinesEditor::insertLevel() +{ + if (!d_spectrogram) + return; + + int row = table->currentRow(); + DoubleSpinBox *sb = (DoubleSpinBox*)table->cellWidget(row, 0); + if (!sb) + return; + + QwtDoubleInterval range = d_spectrogram->data().range(); + double current_value = sb->value(); + double previous_value = range.minValue (); + sb = (DoubleSpinBox*)table->cellWidget(row - 1, 0); + if (sb) + previous_value = sb->value(); + + double val = 0.5*(current_value + previous_value); + + table->blockSignals(true); + table->insertRow(row); + + sb = new DoubleSpinBox(); + sb->setLocale(d_locale); + sb->setDecimals(d_precision); + sb->setValue(val); + sb->setRange(range.minValue (), range.maxValue ()); + connect(sb, SIGNAL(activated(DoubleSpinBox *)), this, SLOT(spinBoxActivated(DoubleSpinBox *))); + table->setCellWidget(row, 0, sb); + + QPen pen = d_spectrogram->defaultContourPen(); + if (pen.style() == Qt::NoPen) + pen = d_spectrogram->contourPen (val); + + int width = 80; + int height = 20; + QPixmap pix(width, height); + pix.fill(Qt::white); + QPainter paint(&pix); + paint.setRenderHint(QPainter::Antialiasing); + paint.setPen(pen); + paint.drawLine(0, height/2, width, height/2); + paint.end(); + + QLabel *lbl = new QLabel(); + lbl->setPixmap(pix); + + table->setCellWidget(row, 1, lbl); + table->blockSignals(false); + + enableButtons(table->currentRow()); + d_pen_list.insert(row, pen); +} + +void ContourLinesEditor::deleteLevel() +{ + int index = table->currentRow(); + table->removeRow (index); + + if (index >=0 && index < d_pen_list.size()) + d_pen_list.removeAt(index); +} + +void ContourLinesEditor::showPenDialog(int row, int col) +{ + if (!d_spectrogram || col != 1) + return; + + enableButtons(row); + + QPen pen = d_pen_list[row]; + + if (!penDialog){ + penDialog = new QDialog(this); + penDialog->setWindowTitle(tr("QtiPlot - Edit pen")); + + QGroupBox *gb1 = new QGroupBox(); + QGridLayout *hl1 = new QGridLayout(gb1); + + hl1->addWidget(new QLabel(tr("Color")), 0, 0); + penColorBox = new ColorButton(); + penColorBox->setColor(pen.color()); + hl1->addWidget(penColorBox, 0, 1); + + applyAllColorBox = new QCheckBox(tr("Apply to all")); + hl1->addWidget(applyAllColorBox, 0, 2); + + hl1->addWidget(new QLabel(tr("Style")), 1, 0); + penStyleBox = new PenStyleBox; + penStyleBox->setStyle(pen.style()); + hl1->addWidget(penStyleBox, 1, 1); + + applyAllStyleBox = new QCheckBox(tr("Apply to all")); + hl1->addWidget(applyAllStyleBox, 1, 2); + + hl1->addWidget(new QLabel(tr("Width")), 2, 0); + penWidthBox = new DoubleSpinBox(); + penWidthBox->setValue(pen.widthF()); + hl1->addWidget(penWidthBox, 2, 1); + hl1->setRowStretch(3, 1); + + applyAllWidthBox = new QCheckBox(tr("Apply to all")); + hl1->addWidget(applyAllWidthBox, 2, 2); + + QPushButton *acceptPenBtn = new QPushButton(tr("&Ok")); + connect(acceptPenBtn, SIGNAL(clicked()), this, SLOT(updatePen())); + + QPushButton *closeBtn = new QPushButton(tr("&Close")); + connect(closeBtn, SIGNAL(clicked()), penDialog, SLOT(reject())); + + QHBoxLayout *hl2 = new QHBoxLayout(); + hl2->addStretch(); + hl2->addWidget(acceptPenBtn); + hl2->addWidget(closeBtn); + + QVBoxLayout *vl = new QVBoxLayout(penDialog); + vl->addWidget(gb1); + vl->addLayout(hl2); + } else { + penColorBox->setColor(pen.color()); + penStyleBox->setStyle(pen.style()); + penWidthBox->setValue(pen.widthF()); + } + + d_pen_index = row; + penDialog->exec(); +} + +void ContourLinesEditor::updatePenColumn() +{ + table->blockSignals(true); + for (int i = 0; i < table->rowCount(); i++){ + int width = 80; + int height = 20; + QPixmap pix(width, height); + pix.fill(Qt::white); + QPainter paint(&pix); + paint.setRenderHint(QPainter::Antialiasing); + paint.setPen(d_pen_list[i]); + paint.drawLine(0, height/2, width, height/2); + paint.end(); + + QLabel *lbl = new QLabel(); + lbl->setPixmap(pix); + + table->setCellWidget(i, 1, lbl); + } + table->blockSignals(false); +} + +void ContourLinesEditor::updatePen() +{ + QPen pen = QPen(penColorBox->color(), penWidthBox->value(), penStyleBox->style()); + + d_pen_list[d_pen_index] = pen; + + if (applyAllColorBox->isChecked()){ + for (int i = 0; i < d_pen_list.size(); i++){ + QPen p = d_pen_list[i]; + p.setColor(penColorBox->color()); + d_pen_list[i] = p; + } + } + + if (applyAllStyleBox->isChecked()){ + for (int i = 0; i < d_pen_list.size(); i++){ + QPen p = d_pen_list[i]; + p.setStyle(penStyleBox->style()); + d_pen_list[i] = p; + } + } + + if (applyAllWidthBox->isChecked()){ + for (int i = 0; i < d_pen_list.size(); i++){ + QPen p = d_pen_list[i]; + p.setWidthF(penWidthBox->value()); + d_pen_list[i] = p; + } + } + + updatePenColumn(); + penDialog->close(); +} + +bool ContourLinesEditor::eventFilter(QObject *object, QEvent *e) +{ + if (e->type() == QEvent::MouseMove && object == table->viewport()){ + const QMouseEvent *me = (const QMouseEvent *)e; + QPoint pos = table->viewport()->mapToParent(me->pos()); + int row = table->rowAt(pos.y() - table->horizontalHeader()->height()); + if (table->columnAt(pos.x()) == 1 && row >= 0 && row < table->rowCount()) + setCursor(QCursor(Qt::PointingHandCursor)); + else + setCursor(QCursor(Qt::ArrowCursor)); + return true; + } else if (e->type() == QEvent::Leave && object == table->viewport()){ + setCursor(QCursor(Qt::ArrowCursor)); + return true; + } else if (e->type() == QEvent::KeyPress && object == table){ + QKeyEvent *ke = (QKeyEvent *)e; + if (ke->key() == Qt::Key_Return && table->currentColumn() == 1){ + showPenDialog(table->currentRow(), 1); + return true; + } + return false; + } + return QObject::eventFilter(object, e); +} + +void ContourLinesEditor::enableButtons(int row) +{ + if (row < 0) + return; + + deleteBtn->setEnabled(true); + insertBtn->setEnabled(true); +} + +void ContourLinesEditor::spinBoxActivated(DoubleSpinBox *sb) +{ + if (!sb) + return; + + int rows = table->rowCount(); + for (int i = 0; i < rows; i++){ + DoubleSpinBox *box = (DoubleSpinBox*)table->cellWidget(i, 0); + if (box && box == sb){ + table->setCurrentCell(i, 0); + enableButtons(i); + return; + } + } +} + +void ContourLinesEditor::showPenColumn(bool on) +{ + if (on) + table->showColumn(1); + else + table->hideColumn(1); +} + +ContourLinesEditor::~ContourLinesEditor() +{ + if(penDialog) + delete penDialog; +} === removed file 'qtiplot/src/plot2D/dialogs/ContourLinesEditor.cpp' --- qtiplot/src/plot2D/dialogs/ContourLinesEditor.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/plot2D/dialogs/ContourLinesEditor.cpp 1970-01-01 00:00:00 +0000 @@ -1,412 +0,0 @@ -/*************************************************************************** - File : ContourLinesEditor.cpp - Project : QtiPlot --------------------------------------------------------------------- - Copyright : (C) 2009 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : A Contour Lines Editor Widget - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "ContourLinesEditor.h" -#include "DoubleSpinBox.h" -#include "Spectrogram.h" -#include "PenStyleBox.h" -#include "ColorButton.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -ContourLinesEditor::ContourLinesEditor(const QLocale& locale, int precision, QWidget* parent) - : QWidget(parent), - d_spectrogram(NULL), - d_locale(locale), - d_precision(precision) -{ - table = new QTableWidget(); - table->setColumnCount(2); - table->hideColumn(1); - table->setSelectionMode(QAbstractItemView::SingleSelection); - table->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); - table->horizontalHeader()->setClickable( false ); - table->horizontalHeader()->setResizeMode(QHeaderView::Stretch); - table->viewport()->setMouseTracking(true); - table->viewport()->installEventFilter(this); - table->setHorizontalHeaderLabels(QStringList() << tr("Level") << tr("Pen")); - table->setMinimumHeight(6*table->horizontalHeader()->height() + 2); - table->installEventFilter(this); - - connect(table, SIGNAL(cellClicked (int, int)), this, SLOT(showPenDialog(int, int))); - - insertBtn = new QPushButton(tr("&Insert")); - insertBtn->setEnabled(false); - connect(insertBtn, SIGNAL(clicked()), this, SLOT(insertLevel())); - - deleteBtn = new QPushButton(tr("&Delete")); - deleteBtn->setEnabled(false); - connect(deleteBtn, SIGNAL(clicked()), this, SLOT(deleteLevel())); - - QHBoxLayout* hb = new QHBoxLayout(); - hb->addWidget(insertBtn); - hb->addWidget(deleteBtn); - - QVBoxLayout* vl = new QVBoxLayout(this); - vl->setSpacing(0); - vl->addWidget(table); - vl->addLayout(hb); - - setFocusProxy(table); - setMaximumWidth(200); - - penDialog = NULL; -} - -void ContourLinesEditor::updateContourLevels() -{ - if (!d_spectrogram) - return; - - int rows = table->rowCount(); - QwtValueList levels; - for (int i = 0; i < rows; i++) - levels << ((DoubleSpinBox*)table->cellWidget(i, 0))->value(); - - d_spectrogram->setContourLevels(levels); -} - -void ContourLinesEditor::updateContourPens() -{ - if (!d_spectrogram) - return; - - if (!table->isColumnHidden(1)) - d_spectrogram->setContourPenList(d_pen_list); -} - -void ContourLinesEditor::setSpectrogram(Spectrogram *sp) -{ - if (!sp || d_spectrogram == sp) - return; - - d_spectrogram = sp; - updateContents(); -} - -void ContourLinesEditor::updateContents() -{ - if (!d_spectrogram) - return; - - QwtValueList levels = d_spectrogram->contourLevels (); - - int rows = (int)levels.size(); - table->setRowCount(rows); - table->blockSignals(true); - - QwtDoubleInterval range = d_spectrogram->data().range(); - for (int i = 0; i < rows; i++){ - DoubleSpinBox *sb = new DoubleSpinBox(); - sb->setLocale(d_locale); - sb->setDecimals(d_precision); - sb->setValue(levels[i]); - sb->setRange(range.minValue (), range.maxValue ()); - connect(sb, SIGNAL(activated(DoubleSpinBox *)), this, SLOT(spinBoxActivated(DoubleSpinBox *))); - table->setCellWidget(i, 0, sb); - - QPen pen = d_spectrogram->defaultContourPen(); - if (pen.style() == Qt::NoPen) - pen = d_spectrogram->contourPen (levels[i]); - - int width = 80; - int height = 20; - QPixmap pix(width, height); - pix.fill(Qt::white); - QPainter paint(&pix); - paint.setRenderHint(QPainter::Antialiasing); - paint.setPen(pen); - paint.drawLine(0, height/2, width, height/2); - paint.end(); - - QLabel *lbl = new QLabel(); - lbl->setPixmap(pix); - - table->setCellWidget(i, 1, lbl); - - d_pen_list << pen; - } - table->blockSignals(false); -} - -void ContourLinesEditor::insertLevel() -{ - if (!d_spectrogram) - return; - - int row = table->currentRow(); - DoubleSpinBox *sb = (DoubleSpinBox*)table->cellWidget(row, 0); - if (!sb) - return; - - QwtDoubleInterval range = d_spectrogram->data().range(); - double current_value = sb->value(); - double previous_value = range.minValue (); - sb = (DoubleSpinBox*)table->cellWidget(row - 1, 0); - if (sb) - previous_value = sb->value(); - - double val = 0.5*(current_value + previous_value); - - table->blockSignals(true); - table->insertRow(row); - - sb = new DoubleSpinBox(); - sb->setLocale(d_locale); - sb->setDecimals(d_precision); - sb->setValue(val); - sb->setRange(range.minValue (), range.maxValue ()); - connect(sb, SIGNAL(activated(DoubleSpinBox *)), this, SLOT(spinBoxActivated(DoubleSpinBox *))); - table->setCellWidget(row, 0, sb); - - QPen pen = d_spectrogram->defaultContourPen(); - if (pen.style() == Qt::NoPen) - pen = d_spectrogram->contourPen (val); - - int width = 80; - int height = 20; - QPixmap pix(width, height); - pix.fill(Qt::white); - QPainter paint(&pix); - paint.setRenderHint(QPainter::Antialiasing); - paint.setPen(pen); - paint.drawLine(0, height/2, width, height/2); - paint.end(); - - QLabel *lbl = new QLabel(); - lbl->setPixmap(pix); - - table->setCellWidget(row, 1, lbl); - table->blockSignals(false); - - enableButtons(table->currentRow()); - d_pen_list.insert(row, pen); -} - -void ContourLinesEditor::deleteLevel() -{ - int index = table->currentRow(); - table->removeRow (index); - - if (index >=0 && index < d_pen_list.size()) - d_pen_list.removeAt(index); -} - -void ContourLinesEditor::showPenDialog(int row, int col) -{ - if (!d_spectrogram || col != 1) - return; - - enableButtons(row); - - QPen pen = d_pen_list[row]; - - if (!penDialog){ - penDialog = new QDialog(this); - penDialog->setWindowTitle(tr("QtiPlot - Edit pen")); - - QGroupBox *gb1 = new QGroupBox(); - QGridLayout *hl1 = new QGridLayout(gb1); - - hl1->addWidget(new QLabel(tr("Color")), 0, 0); - penColorBox = new ColorButton(); - penColorBox->setColor(pen.color()); - hl1->addWidget(penColorBox, 0, 1); - - applyAllColorBox = new QCheckBox(tr("Apply to all")); - hl1->addWidget(applyAllColorBox, 0, 2); - - hl1->addWidget(new QLabel(tr("Style")), 1, 0); - penStyleBox = new PenStyleBox; - penStyleBox->setStyle(pen.style()); - hl1->addWidget(penStyleBox, 1, 1); - - applyAllStyleBox = new QCheckBox(tr("Apply to all")); - hl1->addWidget(applyAllStyleBox, 1, 2); - - hl1->addWidget(new QLabel(tr("Width")), 2, 0); - penWidthBox = new DoubleSpinBox(); - penWidthBox->setValue(pen.widthF()); - hl1->addWidget(penWidthBox, 2, 1); - hl1->setRowStretch(3, 1); - - applyAllWidthBox = new QCheckBox(tr("Apply to all")); - hl1->addWidget(applyAllWidthBox, 2, 2); - - QPushButton *acceptPenBtn = new QPushButton(tr("&Ok")); - connect(acceptPenBtn, SIGNAL(clicked()), this, SLOT(updatePen())); - - QPushButton *closeBtn = new QPushButton(tr("&Close")); - connect(closeBtn, SIGNAL(clicked()), penDialog, SLOT(reject())); - - QHBoxLayout *hl2 = new QHBoxLayout(); - hl2->addStretch(); - hl2->addWidget(acceptPenBtn); - hl2->addWidget(closeBtn); - - QVBoxLayout *vl = new QVBoxLayout(penDialog); - vl->addWidget(gb1); - vl->addLayout(hl2); - } else { - penColorBox->setColor(pen.color()); - penStyleBox->setStyle(pen.style()); - penWidthBox->setValue(pen.widthF()); - } - - d_pen_index = row; - penDialog->exec(); -} - -void ContourLinesEditor::updatePenColumn() -{ - table->blockSignals(true); - for (int i = 0; i < table->rowCount(); i++){ - int width = 80; - int height = 20; - QPixmap pix(width, height); - pix.fill(Qt::white); - QPainter paint(&pix); - paint.setRenderHint(QPainter::Antialiasing); - paint.setPen(d_pen_list[i]); - paint.drawLine(0, height/2, width, height/2); - paint.end(); - - QLabel *lbl = new QLabel(); - lbl->setPixmap(pix); - - table->setCellWidget(i, 1, lbl); - } - table->blockSignals(false); -} - -void ContourLinesEditor::updatePen() -{ - QPen pen = QPen(penColorBox->color(), penWidthBox->value(), penStyleBox->style()); - - d_pen_list[d_pen_index] = pen; - - if (applyAllColorBox->isChecked()){ - for (int i = 0; i < d_pen_list.size(); i++){ - QPen p = d_pen_list[i]; - p.setColor(penColorBox->color()); - d_pen_list[i] = p; - } - } - - if (applyAllStyleBox->isChecked()){ - for (int i = 0; i < d_pen_list.size(); i++){ - QPen p = d_pen_list[i]; - p.setStyle(penStyleBox->style()); - d_pen_list[i] = p; - } - } - - if (applyAllWidthBox->isChecked()){ - for (int i = 0; i < d_pen_list.size(); i++){ - QPen p = d_pen_list[i]; - p.setWidthF(penWidthBox->value()); - d_pen_list[i] = p; - } - } - - updatePenColumn(); - penDialog->close(); -} - -bool ContourLinesEditor::eventFilter(QObject *object, QEvent *e) -{ - if (e->type() == QEvent::MouseMove && object == table->viewport()){ - const QMouseEvent *me = (const QMouseEvent *)e; - QPoint pos = table->viewport()->mapToParent(me->pos()); - int row = table->rowAt(pos.y() - table->horizontalHeader()->height()); - if (table->columnAt(pos.x()) == 1 && row >= 0 && row < table->rowCount()) - setCursor(QCursor(Qt::PointingHandCursor)); - else - setCursor(QCursor(Qt::ArrowCursor)); - return true; - } else if (e->type() == QEvent::Leave && object == table->viewport()){ - setCursor(QCursor(Qt::ArrowCursor)); - return true; - } else if (e->type() == QEvent::KeyPress && object == table){ - QKeyEvent *ke = (QKeyEvent *)e; - if (ke->key() == Qt::Key_Return && table->currentColumn() == 1){ - showPenDialog(table->currentRow(), 1); - return true; - } - return false; - } - return QObject::eventFilter(object, e); -} - -void ContourLinesEditor::enableButtons(int row) -{ - if (row < 0) - return; - - deleteBtn->setEnabled(true); - insertBtn->setEnabled(true); -} - -void ContourLinesEditor::spinBoxActivated(DoubleSpinBox *sb) -{ - if (!sb) - return; - - int rows = table->rowCount(); - for (int i = 0; i < rows; i++){ - DoubleSpinBox *box = (DoubleSpinBox*)table->cellWidget(i, 0); - if (box && box == sb){ - table->setCurrentCell(i, 0); - enableButtons(i); - return; - } - } -} - -void ContourLinesEditor::showPenColumn(bool on) -{ - if (on) - table->showColumn(1); - else - table->hideColumn(1); -} - -ContourLinesEditor::~ContourLinesEditor() -{ - if(penDialog) - delete penDialog; -} === added file 'qtiplot/src/plot2D/dialogs/ContourLinesEditor.h' --- qtiplot/src/plot2D/dialogs/ContourLinesEditor.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/plot2D/dialogs/ContourLinesEditor.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,102 @@ +/*************************************************************************** + File : ContourLinesEditor.h + Project : QtiPlot +-------------------------------------------------------------------- + Copyright : (C) 2009 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : A Contour Lines Editor Widget + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef CONTOURLINESEDITOR_H +#define CONTOURLINESEDITOR_H + +#include +#include + +class QPushButton; +class QTableWidget; +class QCheckBox; +class DoubleSpinBox; +class Spectrogram; +class ColorButton; +class PenStyleBox; + +//! A complex widget allowing to customize contour line plots. +/** + * It uses a QTableWidget to display the values in one column and their corresponding pen in a second column. + * A click on a table color pops-up a dialog allowing to customize the pen. + + \image html images/color_map_editor.png + */ +class ContourLinesEditor: public QWidget +{ + Q_OBJECT + +public: + //! Constructor. + /** + * \param parent parent widget (only affects placement of the widget) + */ + ContourLinesEditor(const QLocale& locale = QLocale::system(), int precision = 6, QWidget* parent = 0); + ~ContourLinesEditor(); + //! Use this function to initialize the values. + void setSpectrogram(Spectrogram *sp); + //! Updates levels in the target spectrogram and replots it. + void updateContourLevels(); + void updateContourPens(); + //! Updates cell items when spectrogram contour lines changed. + void updateContents(); + void showPenColumn(bool on = true); + +protected slots: + void enableButtons(int row); + void showPenDialog(int row, int col); + void insertLevel(); + void deleteLevel(); + void spinBoxActivated(DoubleSpinBox *); + void updatePen(); + + bool eventFilter(QObject *object, QEvent *e); + +private: + void updatePenColumn(); + + //! Table displaying the values ranges in the first column and their corresponding pens in the second column + QTableWidget *table; + QPushButton *insertBtn, *deleteBtn; + Spectrogram *d_spectrogram; + + //! Locale settings used to display level values + QLocale d_locale; + //! Precision used to display level values + int d_precision; + + QDialog *penDialog; + ColorButton *penColorBox; + PenStyleBox *penStyleBox; + DoubleSpinBox *penWidthBox; + QCheckBox *applyAllColorBox, *applyAllWidthBox, *applyAllStyleBox; + + int d_pen_index; + QList d_pen_list; +}; + +#endif === removed file 'qtiplot/src/plot2D/dialogs/ContourLinesEditor.h' --- qtiplot/src/plot2D/dialogs/ContourLinesEditor.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/plot2D/dialogs/ContourLinesEditor.h 1970-01-01 00:00:00 +0000 @@ -1,102 +0,0 @@ -/*************************************************************************** - File : ContourLinesEditor.h - Project : QtiPlot --------------------------------------------------------------------- - Copyright : (C) 2009 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : A Contour Lines Editor Widget - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef CONTOURLINESEDITOR_H -#define CONTOURLINESEDITOR_H - -#include -#include - -class QPushButton; -class QTableWidget; -class QCheckBox; -class DoubleSpinBox; -class Spectrogram; -class ColorButton; -class PenStyleBox; - -//! A complex widget allowing to customize contour line plots. -/** - * It uses a QTableWidget to display the values in one column and their corresponding pen in a second column. - * A click on a table color pops-up a dialog allowing to customize the pen. - - \image html images/color_map_editor.png - */ -class ContourLinesEditor: public QWidget -{ - Q_OBJECT - -public: - //! Constructor. - /** - * \param parent parent widget (only affects placement of the widget) - */ - ContourLinesEditor(const QLocale& locale = QLocale::system(), int precision = 6, QWidget* parent = 0); - ~ContourLinesEditor(); - //! Use this function to initialize the values. - void setSpectrogram(Spectrogram *sp); - //! Updates levels in the target spectrogram and replots it. - void updateContourLevels(); - void updateContourPens(); - //! Updates cell items when spectrogram contour lines changed. - void updateContents(); - void showPenColumn(bool on = true); - -protected slots: - void enableButtons(int row); - void showPenDialog(int row, int col); - void insertLevel(); - void deleteLevel(); - void spinBoxActivated(DoubleSpinBox *); - void updatePen(); - - bool eventFilter(QObject *object, QEvent *e); - -private: - void updatePenColumn(); - - //! Table displaying the values ranges in the first column and their corresponding pens in the second column - QTableWidget *table; - QPushButton *insertBtn, *deleteBtn; - Spectrogram *d_spectrogram; - - //! Locale settings used to display level values - QLocale d_locale; - //! Precision used to display level values - int d_precision; - - QDialog *penDialog; - ColorButton *penColorBox; - PenStyleBox *penStyleBox; - DoubleSpinBox *penWidthBox; - QCheckBox *applyAllColorBox, *applyAllWidthBox, *applyAllStyleBox; - - int d_pen_index; - QList d_pen_list; -}; - -#endif === modified file 'qtiplot/src/plot2D/dialogs/CurvesDialog.cpp' --- qtiplot/src/plot2D/dialogs/CurvesDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/dialogs/CurvesDialog.cpp 2010-07-21 23:21:08 +0000 @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -65,24 +64,24 @@ hl->addWidget(new QLabel(tr("New curves style"))); boxStyle = new QComboBox(); - boxStyle->addItem( QPixmap(lPlot_xpm), tr( " Line" ) ); - boxStyle->addItem( QPixmap(pPlot_xpm), tr( " Scatter" ) ); - boxStyle->addItem( QPixmap(lpPlot_xpm), tr( " Line + Symbol" ) ); - boxStyle->addItem( QPixmap(dropLines_xpm), tr( " Vertical drop lines" ) ); - boxStyle->addItem( QPixmap(spline_xpm), tr( " Spline" ) ); - boxStyle->addItem( QPixmap(vert_steps_xpm), tr( " Vertical steps" ) ); - boxStyle->addItem( QPixmap(hor_steps_xpm), tr( " Horizontal steps" ) ); - boxStyle->addItem( QPixmap(area_xpm), tr( " Area" ) ); - boxStyle->addItem( QPixmap(vertBars_xpm), tr( " Vertical Bars" ) ); - boxStyle->addItem( QPixmap(hBars_xpm), tr( " Horizontal Bars" ) ); - boxStyle->addItem( QPixmap(histogram_xpm), tr( " Histogram" ) ); + boxStyle->addItem( QPixmap(":/lPlot.png"), tr( " Line" ) ); + boxStyle->addItem( QPixmap(":/pPlot.png"), tr( " Scatter" ) ); + boxStyle->addItem( QPixmap(":/lpPlot.png"), tr( " Line + Symbol" ) ); + boxStyle->addItem( QPixmap(":/dropLines.png"), tr( " Vertical drop lines" ) ); + boxStyle->addItem( QPixmap(":/spline.png"), tr( " Spline" ) ); + boxStyle->addItem( QPixmap(":/vert_steps.png"), tr( " Vertical steps" ) ); + boxStyle->addItem( QPixmap(":/hor_steps.png"), tr( " Horizontal steps" ) ); + boxStyle->addItem( QPixmap(":/area.png"), tr( " Area" ) ); + boxStyle->addItem( QPixmap(":/vertBars.png"), tr( " Vertical Bars" ) ); + boxStyle->addItem( QPixmap(":/hBars.png"), tr( " Horizontal Bars" ) ); + boxStyle->addItem( QPixmap(":/histogram.png"), tr( " Histogram" ) ); hl->addWidget(boxStyle); boxMatrixStyle = new QComboBox(); - boxMatrixStyle->addItem( QPixmap(color_map_xpm), tr("Contour - Color Fill")); - boxMatrixStyle->addItem( QPixmap(contour_map_xpm), tr("Contour Lines")); - boxMatrixStyle->addItem( QPixmap(gray_map_xpm), tr("Gray Scale Map")); - boxMatrixStyle->addItem( QPixmap(histogram_xpm), tr("Histogram")); + boxMatrixStyle->addItem( QPixmap(":/color_map.png"), tr("Contour - Color Fill")); + boxMatrixStyle->addItem( QPixmap(":/contour_map.png"), tr("Contour Lines")); + boxMatrixStyle->addItem( QPixmap(":/gray_map.png"), tr("Gray Scale Map")); + boxMatrixStyle->addItem( QPixmap(":/histogram.png"), tr("Histogram")); hl->addWidget(boxMatrixStyle); hl->addStretch(); @@ -93,11 +92,11 @@ hbc->addWidget(new QLabel( tr( "Graph contents" ))); btnUp = new QPushButton(); - btnUp->setIcon(QPixmap(arrow_up_xpm)); + btnUp->setIcon(QPixmap(":/arrow_up.png")); btnUp->setMaximumWidth(20); hbc->addWidget(btnUp); btnDown = new QPushButton(); - btnDown->setIcon(QPixmap(arrow_down_xpm)); + btnDown->setIcon(QPixmap(":/arrow_down.png")); btnDown->setMaximumWidth(20); hbc->addWidget(btnDown); hbc->addStretch(); @@ -112,13 +111,13 @@ QVBoxLayout* vl1 = new QVBoxLayout(); btnAdd = new QPushButton(); - btnAdd->setPixmap( QPixmap(next_xpm) ); + btnAdd->setPixmap( QPixmap(":/next.png") ); btnAdd->setFixedWidth (35); btnAdd->setFixedHeight (30); vl1->addWidget(btnAdd); btnRemove = new QPushButton(); - btnRemove->setPixmap( QPixmap(prev_xpm) ); + btnRemove->setPixmap( QPixmap(":/prev.png") ); btnRemove->setFixedWidth (35); btnRemove->setFixedHeight(30); vl1->addWidget(btnRemove); @@ -194,8 +193,7 @@ if (!it) return; - if (it->rtti() == QwtPlotItem::Rtti_PlotSpectrogram) - { + if (it->rtti() == QwtPlotItem::Rtti_PlotSpectrogram){ btnEditFunction->setEnabled(false); btnAssociations->setEnabled(false); btnRange->setEnabled(false); @@ -203,19 +201,11 @@ } PlotCurve *c = (PlotCurve *)it; - if (c->type() == Graph::Function) - { - btnEditFunction->setEnabled(true); - btnAssociations->setEnabled(false); - btnRange->setEnabled(false); - return; - } - - btnAssociations->setEnabled(true); - - btnRange->setEnabled(true); - if (c->type() == Graph::ErrorBars) - btnRange->setEnabled(false); + if (c){ + btnEditFunction->setEnabled(c->type() == Graph::Function); + btnRange->setEnabled(c->type() != Graph::Function && c->type() != Graph::ErrorBars); + btnAssociations->setEnabled(c->type() != Graph::Function); + } } void CurvesDialog::showCurveRangeDialog() @@ -377,6 +367,7 @@ } } + d_graph->updateAxesTitles(); d_graph->updatePlot(); Graph::showPlotErrorMessage(this, emptyColumns); @@ -434,30 +425,47 @@ return false; CurveLayout cl = Graph::initCurveLayout(); - int color, symbol; - d_graph->guessUniqueCurveLayout(color, symbol); + int cIndex, sIndex; + d_graph->guessUniqueCurveLayout(cIndex, sIndex); - cl.lCol = ColorBox::color(color); + QList indexedColors = app->indexedColors(); + if (cIndex >= 0 && cIndex < indexedColors.size()) + cl.lCol = indexedColors[cIndex]; cl.symCol = cl.lCol; - cl.fillCol = cl.lCol; + + cl.fillCol = app->d_fill_symbols ? cl.lCol : QColor(); + cl.penWidth = app->defaultSymbolEdge; + cl.lWidth = app->defaultCurveLineWidth; + cl.lStyle = app->d_curve_line_style; cl.sSize = app->defaultSymbolSize; - cl.sType = symbol; + if (style == Graph::Area || style == Graph::VerticalBars || style == Graph::HorizontalBars || + style == Graph::StackBar || style == Graph::StackColumn || style == Graph::Histogram){ + cl.aStyle = app->defaultCurveBrush; + cl.filledArea = (double)app->defaultCurveAlpha/255.0; + } + + if (app->d_indexed_symbols){ + QList indexedSymbols = app->indexedSymbols(); + if (sIndex >= 0 && sIndex < indexedSymbols.size()) + cl.sType = indexedSymbols[sIndex] + 1; + } else + cl.sType = app->d_symbol_style; if (style == Graph::Line) cl.sType = 0; else if (style == Graph::Histogram){ - cl.filledArea = 1; cl.aCol = cl.lCol; - cl.aStyle = 4; cl.sType = 0; } else if (style == Graph::VerticalBars || style == Graph::HorizontalBars){ - cl.filledArea = 1; cl.aCol = cl.lCol; cl.lCol = Qt::black; + int i = d_graph->curveCount() - 1; + if (i >= 0 && i < indexedColors.size()) + cl.aCol = indexedColors[i]; + cl.sType = 0; } else if (style == Graph::Area){ - cl.filledArea = 1; cl.aCol = cl.lCol; cl.sType = 0; } else if (style == Graph::VerticalDropLines) @@ -605,7 +613,7 @@ else folderItem = new QTreeWidgetItem(available, QStringList(f->objectName()), FolderItem); - folderItem->setIcon(0, QIcon(QPixmap(folder_open))); + folderItem->setIcon(0, QIcon(":/folder_open.png")); folderItem->setExpanded(true); available->addTopLevelItem(folderItem); @@ -630,7 +638,7 @@ tableItem = new QTreeWidgetItem(available, QStringList(t->objectName()), TableItem); else tableItem = new QTreeWidgetItem(parent, QStringList(t->objectName()), TableItem); - tableItem->setIcon(0, QIcon(QPixmap(worksheet_xpm))); + tableItem->setIcon(0, QIcon(QPixmap(":/worksheet.png"))); available->addTopLevelItem(tableItem); for (int i=0; i < t->numCols(); i++){ @@ -649,7 +657,7 @@ item = new QTreeWidgetItem(available, QStringList(m->objectName()), MatrixItem); else item = new QTreeWidgetItem(parent, QStringList(m->objectName()), MatrixItem); - item->setIcon(0, QIcon(QPixmap(matrix_xpm))); + item->setIcon(0, QIcon(QPixmap(":/matrix.png"))); available->addTopLevelItem(item); } } === modified file 'qtiplot/src/plot2D/dialogs/EnrichmentDialog.cpp' --- qtiplot/src/plot2D/dialogs/EnrichmentDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/dialogs/EnrichmentDialog.cpp 2010-07-21 23:21:08 +0000 @@ -48,37 +48,6 @@ #include #include #include -#include - -static const char* choose_folder_xpm[]={ - "16 16 11 1", - "# c #000000", - "g c #c0c0c0", - "e c #303030", - "a c #ffa858", - "b c #808080", - "d c #a0a0a4", - "f c #585858", - "c c #ffdca8", - "h c #dcdcdc", - "i c #ffffff", - ". c None", - "....###.........", - "....#ab##.......", - "....#acab####...", - "###.#acccccca#..", - "#ddefaaaccccca#.", - "#bdddbaaaacccab#", - ".eddddbbaaaacab#", - ".#bddggdbbaaaab#", - "..edgdggggbbaab#", - "..#bgggghghdaab#", - "...ebhggghicfab#", - "....#edhhiiidab#", - "......#egiiicfb#", - "........#egiibb#", - "..........#egib#", - "............#ee#"}; EnrichmentDialog::EnrichmentDialog(WidgetType wt, Graph *g, QWidget *parent) : QDialog(parent), d_plot(g), d_widget(NULL), d_widget_type(wt) @@ -272,7 +241,7 @@ QPushButton *browseBtn = new QPushButton(); connect(browseBtn, SIGNAL(clicked()), this, SLOT(chooseImageFile())); - browseBtn->setIcon(QIcon(QPixmap(choose_folder_xpm))); + browseBtn->setIcon(QIcon(":/folder_open.png")); gl->addWidget(browseBtn, 0, 2); boxSaveImagesInternally = new QCheckBox(tr("&Save internally")); @@ -433,8 +402,12 @@ attachToBox->insertItem(tr("Layer Scales")); //attachToBox->setCurrentIndex((int)lm->attachPolicy()); - bl1->addWidget(new QLabel(tr( "Attach to" )), 0, 0); + if (d_widget_type != MDIWindow) + bl1->addWidget(new QLabel(tr( "Attach to" )), 0, 0); + bl1->addWidget(attachToBox, 0, 1); + if (d_widget_type == MDIWindow) + attachToBox->hide(); unitBox = new QComboBox(); unitBox->insertItem(tr("inch")); @@ -788,14 +761,17 @@ if (!app) return; + ImageWidget *i = qobject_cast(d_widget); + if (!i) + return; + QString path = fn; if (path.isEmpty()) - path = ApplicationWindow::getFileName(this, tr("QtiPlot - Import image from file"), app->imagesDirPath, + path = ApplicationWindow::getFileName(this, tr("QtiPlot - Import image from file"), i->fileName(), ApplicationWindow::imageFilter(), 0, false); if (!path.isEmpty()){ - ImageWidget *i = qobject_cast(d_widget); - if (i && i->load(path)){ + if (i->load(path)){ imagePathBox->setText(path); QFileInfo fi(path); app->imagesDirPath = fi.dirPath(true); @@ -832,14 +808,14 @@ double left = xBox->value(); double top = yBox->value(); FrameWidget *fw = qobject_cast(d_widget); - if (fw) - fw->setCoordinates(left, top, left + widthBox->value(), top - heightBox->value()); + if (fw) + fw->setCoordinates(left, top, left + widthBox->value(), top - heightBox->value()); } else FrameWidget::setRect(d_widget, xBox->value(), yBox->value(), - widthBox->value(), heightBox->value(), (FrameWidget::Unit)unit); + widthBox->value(), heightBox->value(), (FrameWidget::Unit)unit); - if (d_plot) - d_plot->multiLayer()->notifyChanges(); + if (d_plot) + d_plot->multiLayer()->notifyChanges(); ApplicationWindow *app = (ApplicationWindow *)parentWidget(); if (app) === modified file 'qtiplot/src/plot2D/dialogs/ErrDialog.cpp' --- qtiplot/src/plot2D/dialogs/ErrDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/dialogs/ErrDialog.cpp 2010-07-21 23:21:08 +0000 @@ -28,7 +28,6 @@ ***************************************************************************/ #include "ErrDialog.h" #include -#include #include #include @@ -91,7 +90,7 @@ valueBox = new DoubleSpinBox(); valueBox->setMinimum(0.0); - valueBox->setLocale(((ApplicationWindow *)parent)->locale()); + valueBox->setLocale(QLocale()); valueBox->setValue(5); valueBox->setAlignment( Qt::AlignHCenter ); valueBox->setEnabled(false); === modified file 'qtiplot/src/plot2D/dialogs/FunctionDialog.cpp' --- qtiplot/src/plot2D/dialogs/FunctionDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/dialogs/FunctionDialog.cpp 2010-07-21 23:21:08 +0000 @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include @@ -46,22 +48,24 @@ #include #include #include +#include +#include +#include +#include -FunctionDialog::FunctionDialog( QWidget* parent, Qt::WFlags fl ) -: QDialog( parent, fl ) +FunctionDialog::FunctionDialog(ApplicationWindow* parent, bool standAlone, Qt::WFlags fl ) +: QDialog( parent, fl ), d_app(parent), d_active_editor(0), d_stand_alone(standAlone) { - ApplicationWindow *app = (ApplicationWindow *)parent; QLocale locale = QLocale(); int prec = 6; - if (app){ - locale = app->locale(); - prec = app->d_decimal_digits; + if (d_app){ + locale = d_app->locale(); + prec = d_app->d_decimal_digits; } setObjectName( "FunctionDialog" ); - setWindowTitle( tr( "QtiPlot - Add function curve" ) ); - setSizeGripEnabled(true); - setAttribute(Qt::WA_DeleteOnClose); + QString recentTip = tr("Click here to select a recently typed expression"); + QString recentBtnText = tr("Rece&nt"); QHBoxLayout *hbox1 = new QHBoxLayout(); hbox1->addWidget(new QLabel(tr( "Curve type " ))); @@ -75,14 +79,25 @@ optionStack->setFrameShape( QFrame::StyledPanel ); optionStack->setFrameShadow( QStackedWidget::Plain ); + QVBoxLayout *vl = new QVBoxLayout(); + vl->addWidget(new QLabel(tr( "f(x)= " ))); + + buttonFunctionLog = new QPushButton(recentBtnText); + buttonFunctionLog->setToolTip(recentTip); + connect(buttonFunctionLog, SIGNAL(clicked()), this, SLOT(showFunctionLog())); + vl->addWidget(buttonFunctionLog); + vl->addStretch(); + QGridLayout *gl1 = new QGridLayout(); - gl1->addWidget(new QLabel(tr( "f(x)= " )), 0, 0); - boxFunction = new QTextEdit(); - boxFunction->setMinimumWidth(350); + gl1->addLayout(vl, 0, 0); + + boxFunction = new ScriptEdit(d_app->scriptingEnv()); + boxFunction->enableShortcuts(); + connect(boxFunction, SIGNAL(textChanged()), this, SLOT(guessConstants())); gl1->addWidget(boxFunction, 0, 1); + gl1->addWidget(new QLabel(tr( "From x= " )), 1, 0); boxFrom = new DoubleSpinBox(); - boxFrom->setValue(0); boxFrom->setLocale(locale); boxFrom->setDecimals(prec); gl1->addWidget(boxFrom, 1, 1); @@ -115,8 +130,6 @@ QHBoxLayout *hb = new QHBoxLayout(functionPage); hb->addLayout(gl1); - hb->addWidget(boxConstants); - optionStack->addWidget( functionPage ); QGridLayout *gl2 = new QGridLayout(); @@ -124,25 +137,59 @@ boxParameter = new QLineEdit(); boxParameter->setText("m"); gl2->addWidget(boxParameter, 0, 1); - gl2->addWidget(new QLabel(tr( "From" )), 1, 0); - boxParFrom = new QLineEdit(); - boxParFrom->setText("0"); - gl2->addWidget(boxParFrom, 1, 1); - gl2->addWidget(new QLabel(tr( "To" )), 2, 0); - boxParTo = new QLineEdit(); - boxParTo->setText("1"); - gl2->addWidget(boxParTo, 2, 1); - gl2->addWidget(new QLabel(tr( "x = " )), 3, 0); - boxXFunction = new QComboBox( ); - boxXFunction->setEditable ( true ); - gl2->addWidget(boxXFunction, 3, 1); - gl2->addWidget(new QLabel(tr( "y = " )), 4, 0); - boxYFunction = new QComboBox( ); - boxYFunction->setEditable ( true ); - gl2->addWidget(boxYFunction, 4, 1); + + int maxH = 80; + + boxXFunction = new ScriptEdit(d_app->scriptingEnv()); + boxXFunction->setMaximumHeight(maxH); + boxXFunction->enableShortcuts(); + connect(boxXFunction, SIGNAL(activated(ScriptEdit *)), this, SLOT(setActiveEditor(ScriptEdit *))); + connect(boxXFunction, SIGNAL(textChanged()), this, SLOT(guessConstants())); + gl2->addWidget(boxXFunction, 1, 1); + + buttonXParLog = new QPushButton(recentBtnText); + buttonXParLog->setToolTip(recentTip); + connect(buttonXParLog, SIGNAL(clicked()), this, SLOT(showXParLog())); + + QVBoxLayout *vlxpar = new QVBoxLayout(); + vlxpar->addWidget(new QLabel(tr( "x = " ))); + vlxpar->addWidget(buttonXParLog); + vlxpar->addStretch(); + gl2->addLayout(vlxpar, 1, 0); + + boxYFunction = new ScriptEdit(d_app->scriptingEnv()); + boxYFunction->setMaximumHeight(maxH); + boxYFunction->enableShortcuts(); + connect(boxYFunction, SIGNAL(activated(ScriptEdit *)), this, SLOT(setActiveEditor(ScriptEdit *))); + connect(boxYFunction, SIGNAL(textChanged()), this, SLOT(guessConstants())); + gl2->addWidget(boxYFunction, 2, 1); + + buttonYParLog = new QPushButton(recentBtnText); + buttonYParLog->setToolTip(recentTip); + connect(buttonYParLog, SIGNAL(clicked()), this, SLOT(showYParLog())); + + QVBoxLayout *vlypar = new QVBoxLayout(); + vlypar->addWidget(new QLabel(tr( "y = " ))); + vlypar->addWidget(buttonYParLog); + vlypar->addStretch(); + gl2->addLayout(vlypar, 2, 0); + + gl2->addWidget(new QLabel(tr( "From" )), 3, 0); + boxParFrom = new DoubleSpinBox(); + boxParFrom->setLocale(locale); + boxParFrom->setDecimals(prec); + gl2->addWidget(boxParFrom, 3, 1); + + gl2->addWidget(new QLabel(tr( "To" )), 4, 0); + boxParTo = new DoubleSpinBox(); + boxParTo->setValue(1); + boxParTo->setLocale(locale); + boxParTo->setDecimals(prec); + gl2->addWidget(boxParTo, 4, 1); + gl2->addWidget(new QLabel(tr( "Points" )), 5, 0); boxParPoints = new QSpinBox(); - boxParPoints->setRange(2, 1000000); + boxParPoints->setRange(2, INT_MAX); boxParPoints->setSingleStep(100); boxParPoints->setValue(100); gl2->addWidget(boxParPoints, 5, 1); @@ -157,29 +204,61 @@ boxPolarParameter = new QLineEdit(); boxPolarParameter->setText ("t"); gl3->addWidget(boxPolarParameter, 0, 1); - gl3->addWidget(new QLabel(tr( "From" )), 2, 0); - boxPolarFrom = new QLineEdit(); - boxPolarFrom->setText("0"); - gl3->addWidget(boxPolarFrom, 2, 1); - gl3->addWidget(new QLabel(tr( "To" )), 3, 0); - boxPolarTo = new QLineEdit(); - boxPolarTo->setText("pi"); - gl3->addWidget(boxPolarTo, 3, 1); - gl3->addWidget(new QLabel(tr( "R =" )), 4, 0); - boxPolarRadius = new QComboBox(); - boxPolarRadius->setEditable ( true ); - gl3->addWidget(boxPolarRadius, 4, 1); - gl3->addWidget(new QLabel(tr( "Theta =" )), 5, 0); - boxPolarTheta = new QComboBox(); - boxPolarTheta->setEditable ( true ); - gl3->addWidget(boxPolarTheta, 5, 1); - gl3->addWidget(new QLabel(tr( "Points" )), 6, 0); + + boxPolarRadius = new ScriptEdit(d_app->scriptingEnv()); + boxPolarRadius->setMaximumHeight(maxH); + boxPolarRadius->enableShortcuts(); + connect(boxPolarRadius, SIGNAL(activated(ScriptEdit *)), this, SLOT(setActiveEditor(ScriptEdit *))); + connect(boxPolarRadius, SIGNAL(textChanged()), this, SLOT(guessConstants())); + gl3->addWidget(boxPolarRadius, 1, 1); + + buttonPolarRadiusLog = new QPushButton(recentBtnText); + buttonPolarRadiusLog->setToolTip(recentTip); + connect(buttonPolarRadiusLog, SIGNAL(clicked()), this, SLOT(showPolarRadiusLog())); + + QVBoxLayout *vlrpar = new QVBoxLayout(); + vlrpar->addWidget(new QLabel(tr( "R =" ))); + vlrpar->addWidget(buttonPolarRadiusLog); + vlrpar->addStretch(); + gl3->addLayout(vlrpar, 1, 0); + + boxPolarTheta = new ScriptEdit(d_app->scriptingEnv()); + boxPolarTheta->setMaximumHeight(maxH); + boxPolarTheta->enableShortcuts(); + connect(boxPolarTheta, SIGNAL(activated(ScriptEdit *)), this, SLOT(setActiveEditor(ScriptEdit *))); + connect(boxPolarTheta, SIGNAL(textChanged()), this, SLOT(guessConstants())); + gl3->addWidget(boxPolarTheta, 2, 1); + + buttonPolarRThetaLog = new QPushButton(recentBtnText); + buttonPolarRThetaLog->setToolTip(recentTip); + connect(buttonPolarRThetaLog, SIGNAL(clicked()), this, SLOT(showPolarThetaLog())); + + QVBoxLayout *vltpar = new QVBoxLayout(); + vltpar->addWidget(new QLabel(tr( "Theta =" ))); + vltpar->addWidget(buttonPolarRThetaLog); + vltpar->addStretch(); + gl3->addLayout(vltpar, 2, 0); + + gl3->addWidget(new QLabel(tr( "From" )), 3, 0); + boxPolarFrom = new DoubleSpinBox(); + boxPolarFrom->setLocale(locale); + boxPolarFrom->setDecimals(prec); + gl3->addWidget(boxPolarFrom, 3, 1); + + gl3->addWidget(new QLabel(tr( "To" )), 4, 0); + boxPolarTo = new DoubleSpinBox(); + boxPolarTo->setValue(M_PI); + boxPolarTo->setLocale(locale); + boxPolarTo->setDecimals(prec); + gl3->addWidget(boxPolarTo, 4, 1); + + gl3->addWidget(new QLabel(tr( "Points" )), 5, 0); boxPolarPoints = new QSpinBox(); - boxPolarPoints->setRange(2, 1000000); + boxPolarPoints->setRange(2, INT_MAX); boxPolarPoints->setSingleStep(100); boxPolarPoints->setValue(100); - gl3->addWidget(boxPolarPoints, 6, 1); - gl3->setRowStretch(7, 1); + gl3->addWidget(boxPolarPoints, 5, 1); + gl3->setRowStretch(6, 1); polarPage = new QWidget(); polarPage->setLayout(gl3); @@ -187,7 +266,7 @@ boxFunctionExplain = new QTextEdit; boxFunctionExplain->setReadOnly(true); - boxFunctionExplain->setMaximumHeight(50); + boxFunctionExplain->setMaximumHeight(80); QPalette palette = boxFunctionExplain->palette(); palette.setColor(QPalette::Active, QPalette::Base, Qt::lightGray); boxFunctionExplain->setPalette(palette); @@ -205,36 +284,52 @@ vbox->addWidget(boxMathFunctions); vbox->addWidget(addFunctionBtn); + buttonClear = new QPushButton(tr( "Clea&r Function" )); + connect( buttonClear, SIGNAL( clicked() ), this, SLOT(clearList())); + vbox->addWidget(buttonClear); + vbox->addStretch(); + QHBoxLayout *hbox3 = new QHBoxLayout(); hbox3->addWidget(boxFunctionExplain); hbox3->addLayout(vbox); - buttonClear = new QPushButton(tr( "Clea&r Function" )); - buttonClear->setAutoDefault(false); - buttonOk = new QPushButton(tr( "&Ok" )); - buttonOk->setDefault(true); - buttonCancel = new QPushButton(tr( "&Close" )); - buttonCancel->setAutoDefault(false); - - QHBoxLayout *hbox2 = new QHBoxLayout(); - hbox2->addWidget(buttonClear); - hbox2->addWidget(buttonOk); - hbox2->addWidget(buttonCancel); - hbox2->addStretch(); - - QVBoxLayout *vbox1 = new QVBoxLayout(); - vbox1->addLayout(hbox1); - vbox1->addWidget(optionStack); - vbox1->addLayout(hbox3); - vbox1->addLayout(hbox2); - - setLayout(vbox1); + QVBoxLayout *vbox2 = new QVBoxLayout(); + vbox2->addLayout(hbox3); + vbox2->addStretch(); + + hb = new QHBoxLayout(); + hb->addWidget(optionStack); + hb->addWidget(boxConstants); + + QVBoxLayout *vbox1 = new QVBoxLayout(this); + vbox1->addLayout(hbox1); + vbox1->addLayout(hb); + vbox1->addLayout(vbox2); + vbox1->addStretch(); + + if (standAlone){ + buttonOk = new QPushButton(tr( "&Ok" )); + buttonOk->setDefault(true); + connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); + + buttonCancel = new QPushButton(tr( "&Close" )); + buttonCancel->setAutoDefault(false); + connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + + QHBoxLayout *hbox2 = new QHBoxLayout(); + hbox2->addWidget(buttonOk); + hbox2->addWidget(buttonCancel); + hbox2->addStretch(); + + vbox1->addLayout(hbox2); + + setSizeGripEnabled(true); + setWindowTitle( tr( "QtiPlot - Add function curve" ) ); + setAttribute(Qt::WA_DeleteOnClose); + } + setFocusProxy (boxFunction); - connect( boxType, SIGNAL( activated(int) ), this, SLOT( raiseWidget(int) ) ); - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); - connect( buttonClear, SIGNAL( clicked() ), this, SLOT(clearList() ) ); curveID = -1; graph = 0; @@ -242,12 +337,17 @@ void FunctionDialog::raiseWidget(int index) { - if (index) - buttonClear->setText( tr( "Clear list" ) ); - else - buttonClear->setText( tr( "Clear Function" ) ); - optionStack->setCurrentIndex(index); + guessConstants(); +} + +void FunctionDialog::setCurveToModify(FunctionCurve *c) +{ + Graph *g = (Graph *)c->plot(); + if (!g) + return; + + setCurveToModify(g, g->curveIndex(c)); } void FunctionDialog::setCurveToModify(Graph *g, int curve) @@ -269,7 +369,6 @@ boxConstants->clearContents(); boxConstants->setRowCount(constants.size()); boxConstants->show(); - ApplicationWindow *app = (ApplicationWindow *)parent(); QMapIterator i(constants); int row = 0; while (i.hasNext()) { @@ -277,46 +376,57 @@ boxConstants->setItem(row, 0, new QTableWidgetItem(i.key())); DoubleSpinBox *sb = new DoubleSpinBox(); - sb->setLocale(app->locale()); - sb->setDecimals(app->fit_output_precision); + sb->setLocale(QLocale()); sb->setValue(i.value()); boxConstants->setCellWidget(row, 1, sb); - connect(sb, SIGNAL(valueChanged(double)), this, SLOT(acceptFunction())); + connect(sb, SIGNAL(valueChanged(double)), this, SLOT(accept())); row++; } - } + } else + boxConstants->hide(); if (c->functionType() == FunctionCurve::Normal){ + boxFunction->blockSignals(true); boxFunction->setText(formulas[0]); - boxFrom->setValue(c->startRange()); - boxTo->setValue(c->endRange()); + boxFunction->blockSignals(false); + + boxFrom->setValue(QMIN(c->startRange(), c->endRange())); + boxTo->setValue(QMAX(c->startRange(), c->endRange())); boxPoints->setValue(c->dataSize()); } else if (c->functionType() == FunctionCurve::Polar) { - optionStack->setCurrentIndex(2); - boxType->setCurrentItem(2); - - boxPolarRadius->setCurrentText(formulas[0]); - boxPolarTheta->setCurrentText(formulas[1]); + boxPolarRadius->blockSignals(true); + boxPolarRadius->setText(formulas[0]); + boxPolarRadius->blockSignals(false); + + boxPolarTheta->blockSignals(true); + boxPolarTheta->setText(formulas[1]); + boxPolarTheta->blockSignals(false); + boxPolarParameter->setText(c->variable()); - boxPolarFrom->setText(QString::number(c->startRange(), 'g', 15)); - boxPolarTo->setText(QString::number(c->endRange(), 'g', 15)); + boxPolarFrom->setValue(c->startRange()); + boxPolarTo->setValue(c->endRange()); boxPolarPoints->setValue(c->dataSize()); } else if (c->functionType() == FunctionCurve::Parametric) { - boxType->setCurrentItem(1); - optionStack->setCurrentIndex(1); - - boxXFunction->setCurrentText(formulas[0]); - boxYFunction->setCurrentText(formulas[1]); + boxXFunction->blockSignals(true); + boxXFunction->setText(formulas[0]); + boxXFunction->blockSignals(false); + + boxYFunction->blockSignals(true); + boxYFunction->setText(formulas[1]); + boxYFunction->blockSignals(false); + boxParameter->setText(c->variable()); - boxParFrom->setText(QString::number(c->startRange(), 'g', 15)); - boxParTo->setText(QString::number(c->endRange(), 'g', 15)); + boxParFrom->setValue(c->startRange()); + boxParTo->setValue(c->endRange()); boxParPoints->setValue(c->dataSize()); } + boxType->setCurrentIndex(c->functionType()); + optionStack->setCurrentIndex(c->functionType()); } void FunctionDialog::clearList() { - int type=boxType->currentItem(); + int type = boxType->currentItem(); switch (type) { case 0: @@ -326,13 +436,11 @@ case 1: boxXFunction->clear(); boxYFunction->clear(); - emit clearParamFunctionsList(); break; case 2: boxPolarTheta->clear(); boxPolarRadius->clear(); - emit clearPolarFunctionsList(); break; } } @@ -378,57 +486,29 @@ int type = boxType->currentItem(); QStringList formulas; formulas += formula; - if (!error){ - ApplicationWindow *app = (ApplicationWindow *)this->parent(); - app->updateFunctionLists(type,formulas); + if (!error && d_app){ + d_app->updateFunctionLists(type, formulas); if (!graph){ - MultiLayer *plot = app->newFunctionPlot(formulas, start, end, boxPoints->value(), "x", type); - if (plot) + MultiLayer *plot = d_app->newFunctionPlot(formulas, start, end, boxPoints->value(), "x", type); + if (plot){ graph = plot->activeLayer(); + setConstants((FunctionCurve *)graph->curve(graph->curveCount() - 1), constants); + } } else { if (curveID >= 0) graph->modifyFunctionCurve(curveID, type, formulas, "x", start, end, boxPoints->value(), constants); else - graph->addFunction(formulas, start, end, boxPoints->value(), "x", type); + setConstants(graph->addFunction(formulas, start, end, boxPoints->value(), "x", type), constants); } } +} -} void FunctionDialog::acceptParametric() { - QString from=boxParFrom->text().lower(); - QString to=boxParTo->text().lower(); - QString points=boxParPoints->text().lower(); - - double start = 0.0, end = 0.0; - try - { - MyParser parser; - parser.SetExpr(from.ascii()); - start = parser.Eval(); - } - catch(mu::ParserError &e) - { - QMessageBox::critical(this, tr("QtiPlot - Start limit error"), QString::fromStdString(e.GetMsg())); - boxParFrom->setFocus(); - return; - } - - try - { - MyParser parser; - parser.SetExpr(to.ascii()); - end=parser.Eval(); - } - catch(mu::ParserError &e) - { - QMessageBox::critical(this, tr("QtiPlot - End limit error"), QString::fromStdString(e.GetMsg())); - boxParTo->setFocus(); - return; - } - - if (start>=end) - { + double start = boxParFrom->value(); + double end = boxParTo->value(); + + if (start >= end){ QMessageBox::critical(this, tr("QtiPlot - Input error"), tr("Please enter parameter limits that satisfy: from < end!")); boxParTo->setFocus(); @@ -436,100 +516,83 @@ } double parameter; - QString xformula=boxXFunction->currentText(); - QString yformula=boxYFunction->currentText(); - bool error=false; - - try - { + QString xformula = boxXFunction->text().simplified(); + QString yformula = boxYFunction->text().simplified(); + bool error = false; + + QMap constants; + + try { MyParser parser; parser.DefineVar((boxParameter->text()).ascii(), ¶meter); + for (int i = 0; i < boxConstants->rowCount(); i++){ + double val = ((DoubleSpinBox*)boxConstants->cellWidget(i, 1))->value(); + QString constName = boxConstants->item(i, 0)->text(); + if (!constName.isEmpty()){ + constants.insert(constName, val); + parser.DefineConst(constName.ascii(), val); + } + } parser.SetExpr(xformula.ascii()); - parameter=start; - parser.Eval(); - parameter=end; - parser.Eval(); - } - catch(mu::ParserError &e) - { + parameter = start; + parser.Eval(); + parameter = end; + parser.Eval(); + } catch(mu::ParserError &e) { QMessageBox::critical(this, tr("QtiPlot - Input function error"), QString::fromStdString(e.GetMsg())); boxXFunction->setFocus(); - error=true; + error = true; } - try - { + + try { MyParser parser; parser.DefineVar((boxParameter->text()).ascii(), ¶meter); + + for (int i = 0; i < boxConstants->rowCount(); i++){ + double val = ((DoubleSpinBox*)boxConstants->cellWidget(i, 1))->value(); + QString constName = boxConstants->item(i, 0)->text(); + if (!constName.isEmpty()) + parser.DefineConst(constName.ascii(), val); + } parser.SetExpr(yformula.ascii()); - parameter=start; - parser.Eval(); - parameter=end; - parser.Eval(); - } - catch(mu::ParserError &e) - { + parameter = start; + parser.Eval(); + parameter = end; + parser.Eval(); + } catch(mu::ParserError &e) { QMessageBox::critical(this, tr("QtiPlot - Input function error"), QString::fromStdString(e.GetMsg())); boxYFunction->setFocus(); - error=true; + error = true; } // Collecting all the information int type = boxType->currentItem(); QStringList formulas; formulas += xformula; formulas += yformula; - if (!error){ - ApplicationWindow *app = (ApplicationWindow *)this->parent(); - app->updateFunctionLists(type,formulas); + if (!error && d_app){ + d_app->updateFunctionLists(type, formulas); if (!graph){ - MultiLayer *plot = app->newFunctionPlot(formulas, start, end, boxParPoints->value(), boxParameter->text(), type); - if (plot) + MultiLayer *plot = d_app->newFunctionPlot(formulas, start, end, boxParPoints->value(), boxParameter->text(), type); + if (plot){ graph = plot->activeLayer(); + setConstants((FunctionCurve *)graph->curve(graph->curveCount() - 1), constants); + } } else { if (curveID >= 0) - graph->modifyFunctionCurve(curveID, type, formulas, boxParameter->text(), start, end, boxParPoints->value(), QMap()); + graph->modifyFunctionCurve(curveID, type, formulas, boxParameter->text(), start, end, boxParPoints->value(), constants); else - graph->addFunction(formulas, start, end, boxParPoints->value(), boxParameter->text(), type); + setConstants(graph->addFunction(formulas, start, end, boxParPoints->value(), boxParameter->text(), type), constants); } } } void FunctionDialog::acceptPolar() { - QString from=boxPolarFrom->text().lower(); - QString to=boxPolarTo->text().lower(); - QString points=boxPolarPoints->text().lower(); - - double start = 0, end = 0; - try - { - MyParser parser; - parser.SetExpr(from.ascii()); - start=parser.Eval(); - } - catch(mu::ParserError &e) - { - QMessageBox::critical(this, tr("QtiPlot - Start limit error"), QString::fromStdString(e.GetMsg())); - boxPolarFrom->setFocus(); - return; - } - - try - { - MyParser parser; - parser.SetExpr(to.ascii()); - end=parser.Eval(); - } - catch(mu::ParserError &e) - { - QMessageBox::critical(this, tr("QtiPlot - End limit error"), QString::fromStdString(e.GetMsg())); - boxPolarTo->setFocus(); - return; - } - - if (start>=end) - { + double start = boxPolarFrom->value(); + double end = boxPolarTo->value(); + if (start >= end){ QMessageBox::critical(this, tr("QtiPlot - Input error"), tr("Please enter parameter limits that satisfy: from < end!")); boxPolarTo->setFocus(); @@ -537,62 +600,74 @@ } double parameter; - QString rformula=boxPolarRadius->currentText(); - QString tformula=boxPolarTheta->currentText(); - bool error=false; - - try - { + QString rformula = boxPolarRadius->text().simplified(); + QString tformula = boxPolarTheta->text().simplified(); + bool error = false; + + QMap constants; + + try { MyParser parser; parser.DefineVar((boxPolarParameter->text()).ascii(), ¶meter); + for (int i = 0; i < boxConstants->rowCount(); i++){ + double val = ((DoubleSpinBox*)boxConstants->cellWidget(i, 1))->value(); + QString constName = boxConstants->item(i, 0)->text(); + if (!constName.isEmpty()){ + constants.insert(constName, val); + parser.DefineConst(constName.ascii(), val); + } + } parser.SetExpr(rformula.ascii()); - parameter=start; - parser.Eval(); - parameter=end; - parser.Eval(); - } - catch(mu::ParserError &e) - { + parameter = start; + parser.Eval(); + parameter = end; + parser.Eval(); + } catch(mu::ParserError &e) { QMessageBox::critical(this, tr("QtiPlot - Input function error"), QString::fromStdString(e.GetMsg())); boxPolarRadius->setFocus(); - error=true; + error = true; } - try - { + + try { MyParser parser; parser.DefineVar((boxPolarParameter->text()).ascii(), ¶meter); + for (int i = 0; i < boxConstants->rowCount(); i++){ + double val = ((DoubleSpinBox*)boxConstants->cellWidget(i, 1))->value(); + QString constName = boxConstants->item(i, 0)->text(); + if (!constName.isEmpty()) + parser.DefineConst(constName.ascii(), val); + } parser.SetExpr(tformula.ascii()); - parameter=start; - parser.Eval(); - parameter=end; - parser.Eval(); - } - catch(mu::ParserError &e) - { + parameter = start; + parser.Eval(); + parameter = end; + parser.Eval(); + } catch(mu::ParserError &e) { QMessageBox::critical(this, tr("QtiPlot - Input function error"), QString::fromStdString(e.GetMsg())); boxPolarTheta->setFocus(); - error=true; + error = true; } // Collecting all the information int type = boxType->currentItem(); QStringList formulas; - formulas+=rformula; - formulas+=tformula; - if (!error){ - ApplicationWindow *app = (ApplicationWindow *)this->parent(); - app->updateFunctionLists(type,formulas); + formulas += rformula; + formulas += tformula; + if (!error && d_app){ + d_app->updateFunctionLists(type, formulas); if (!graph){ - MultiLayer *plot = app->newFunctionPlot(formulas, start, end, boxPolarPoints->value(), boxPolarParameter->text(), type); - if (plot) + MultiLayer *plot = d_app->newFunctionPlot(formulas, start, end, boxPolarPoints->value(), boxPolarParameter->text(), type); + if (plot){ graph = plot->activeLayer(); + setConstants((FunctionCurve *)graph->curve(graph->curveCount() - 1), constants); + } } else { if (curveID >= 0) - graph->modifyFunctionCurve(curveID, type, formulas, boxPolarParameter->text(), start, end, boxPolarPoints->value(), QMap()); + graph->modifyFunctionCurve(curveID, type, formulas, boxPolarParameter->text(), start, end, boxPolarPoints->value(), constants); else - graph->addFunction(formulas, start, end, boxPolarPoints->value(), boxPolarParameter->text(), type); + setConstants(graph->addFunction(formulas, start, end, boxPolarPoints->value(), boxPolarParameter->text(), type), constants); } } } @@ -615,41 +690,110 @@ } } -void FunctionDialog::insertParamFunctionsList(const QStringList& xList, const QStringList& yList) -{ - boxXFunction->insertItems (0, xList); - boxYFunction->insertItems (0, yList); -} - -void FunctionDialog::insertPolarFunctionsList(const QStringList& rList, const QStringList& thetaList) -{ - boxPolarRadius->insertItems (0, rList); - boxPolarTheta->insertItems (0, thetaList); +void FunctionDialog::showFunctionLog() +{ + if (!d_app) + return; + + if (d_app->d_recent_functions.isEmpty()){ + QMessageBox::information(this, tr("QtiPlot"), tr("Sorry, there are no recent expressions available!")); + return; + } + + bool ok; + QString s = QInputDialog::getItem(this, tr("QtiPlot") + " - " + tr("Recent Functions"), tr("Please, choose a function:"), d_app->d_recent_functions, 0, false, &ok); + if (ok && !s.isEmpty()) + boxFunction->setText(s); +} + +void FunctionDialog::showXParLog() +{ + if (!d_app) + return; + + if (d_app->xFunctions.isEmpty()){ + QMessageBox::information(this, tr("QtiPlot"), tr("Sorry, there are no recent expressions available!")); + return; + } + + bool ok; + QString s = QInputDialog::getItem(this, tr("QtiPlot") + " - " + tr("Recent Functions"), tr("Please, choose a function:"), d_app->xFunctions, 0, false, &ok); + if (ok && !s.isEmpty()) + boxXFunction->setText(s); +} + + +void FunctionDialog::showYParLog() +{ + if (!d_app) + return; + + if (d_app->yFunctions.isEmpty()){ + QMessageBox::information(this, tr("QtiPlot"), tr("Sorry, there are no recent expressions available!")); + return; + } + + bool ok; + QString s = QInputDialog::getItem(this, tr("QtiPlot") + " - " + tr("Recent Functions"), tr("Please, choose a function:"), d_app->yFunctions, 0, false, &ok); + if (ok && !s.isEmpty()) + boxYFunction->setText(s); +} + +void FunctionDialog::showPolarRadiusLog() +{ + if (!d_app) + return; + + if (d_app->rFunctions.isEmpty()){ + QMessageBox::information(this, tr("QtiPlot"), tr("Sorry, there are no recent expressions available!")); + return; + } + + bool ok; + QString s = QInputDialog::getItem(this, tr("QtiPlot") + " - " + tr("Recent Functions"), tr("Please, choose a function:"), d_app->rFunctions, 0, false, &ok); + if (ok && !s.isEmpty()) + boxPolarRadius->setText(s); +} + + +void FunctionDialog::showPolarThetaLog() +{ + if (!d_app) + return; + + if (d_app->thetaFunctions.isEmpty()){ + QMessageBox::information(this, tr("QtiPlot"), tr("Sorry, there are no recent expressions available!")); + return; + } + + bool ok; + QString s = QInputDialog::getItem(this, tr("QtiPlot") + " - " + tr("Recent Functions"), tr("Please, choose a function:"), d_app->thetaFunctions, 0, false, &ok); + if (ok && !s.isEmpty()) + boxPolarTheta->setText(s); } void FunctionDialog::insertFunction() { - QString fname = boxMathFunctions->currentText(); + QString fname = boxMathFunctions->currentText().remove("(").remove(")").remove(",").remove(";"); if (optionStack->currentWidget () == functionPage){ - QTextCursor cursor = boxFunction->textCursor(); - QString markedText = cursor.selectedText(); - if(markedText.isEmpty()){ - cursor.insertText(fname); - cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::MoveAnchor,1); - } else - cursor.insertText(fname.remove(")").remove(",") + markedText + ")"); - - boxFunction->setTextCursor(cursor); + boxFunction->insertFunction(fname); + boxFunction->setFocus(); } else if (optionStack->currentWidget () == parametricPage){ - if (boxYFunction->lineEdit()->hasFocus()) - boxYFunction->lineEdit()->insert(fname); - else - boxXFunction->lineEdit()->insert(fname); + if (d_active_editor == boxYFunction){ + boxYFunction->insertFunction(fname); + boxYFunction->setFocus(); + } else if (d_active_editor == boxXFunction){ + boxXFunction->insertFunction(fname); + boxXFunction->setFocus(); + } } else if (optionStack->currentWidget () == polarPage){ - if (boxPolarRadius->lineEdit()->hasFocus()) - boxPolarRadius->lineEdit()->insert(fname); - else - boxPolarTheta->lineEdit()->insert(fname); + if (d_active_editor == boxPolarRadius){ + boxPolarRadius->insertFunction(fname); + boxPolarRadius->setFocus(); + } else if (d_active_editor == boxPolarTheta){ + boxPolarTheta->insertFunction(fname); + boxPolarTheta->setFocus(); + } } } @@ -657,3 +801,82 @@ { boxFunctionExplain->setText(MyParser::explainFunction(index)); } + +void FunctionDialog::guessConstants() +{ + QString text; + QString var = "x"; + switch (boxType->currentIndex()){ + case 0: + text = boxFunction->text().remove(QRegExp("\\s")).remove("."); + break; + + case 1: + text = boxXFunction->text().remove(QRegExp("\\s")).remove("."); + text += "+" + boxYFunction->text().remove(QRegExp("\\s")).remove("."); + var = boxParameter->text(); + break; + + case 2: + text = boxPolarRadius->text().remove(QRegExp("\\s")).remove("."); + text += "+" + boxPolarTheta->text().remove(QRegExp("\\s")).remove("."); + var = boxPolarParameter->text(); + break; + } + + bool error = false; + string errMsg; + QStringList lst = NonLinearFit::guessParameters(text, &error, &errMsg, var); + if (error) + return; + + QStringList constants; + QList values; + for (int i = 0; i < boxConstants->rowCount(); i++){ + constants << boxConstants->item(i, 0)->text(); + values << ((DoubleSpinBox*)boxConstants->cellWidget(i, 1))->value(); + } + + if (lst == constants) + return; + + boxConstants->setRowCount(lst.size()); + + int row = 0; + foreach(QString s, lst){ + boxConstants->setItem(row, 0, new QTableWidgetItem(s)); + + DoubleSpinBox *sb = new DoubleSpinBox(); + sb->setLocale(QLocale()); + boxConstants->setCellWidget(row, 1, sb); + if (constants.contains(s)){ + int index = constants.indexOf(s); + if (index >= 0 && index < values.size()) + sb->setValue(values[index]); + } + if (!d_stand_alone) + connect(sb, SIGNAL(valueChanged(double)), this, SLOT(accept())); + row++; + } + + if (!lst.size()) + boxConstants->hide(); + else if (!boxConstants->isVisible()) + boxConstants->show(); +} + +void FunctionDialog::setConstants(FunctionCurve *c, const QMap& constants) +{ + if (!c || constants.isEmpty()) + return; + + c->setConstants(constants); + c->loadData(); + if (graph){ + graph->replot(); + graph->updateMarkersBoundingRect(); + graph->updateSecondaryAxis(QwtPlot::xTop); + graph->updateSecondaryAxis(QwtPlot::yRight); + graph->replot(); + } +} === modified file 'qtiplot/src/plot2D/dialogs/FunctionDialog.h' --- qtiplot/src/plot2D/dialogs/FunctionDialog.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/dialogs/FunctionDialog.h 2010-07-21 23:21:08 +0000 @@ -41,6 +41,8 @@ class QLabel; class QTextEdit; class DoubleSpinBox; +class ScriptEdit; +class ApplicationWindow; //! Function dialog class FunctionDialog : public QDialog @@ -48,46 +50,51 @@ Q_OBJECT public: - FunctionDialog( QWidget* parent = 0, Qt::WFlags fl = 0 ); + FunctionDialog(ApplicationWindow* parent, bool standAlone = true, Qt::WFlags fl = 0 ); + + void setCurveToModify(Graph *g, int curve); + void setCurveToModify(FunctionCurve *c); + void setGraph(Graph *g){graph = g;}; protected slots: void raiseWidget(int index); void insertFunction(); void updateFunctionExplain(int); - -public slots: - void accept(); void acceptFunction(); void acceptParametric(); void acceptPolar(); - void setCurveToModify(Graph *g, int curve); - void insertParamFunctionsList(const QStringList& xList, const QStringList& yList); - void insertPolarFunctionsList(const QStringList& rList, const QStringList& thetaList); + void showFunctionLog(); + void showXParLog(); + void showYParLog(); + void showPolarRadiusLog(); + void showPolarThetaLog(); + void setActiveEditor(ScriptEdit *edit){d_active_editor = edit;}; + void guessConstants(); + +public slots: + void accept(); void clearList(); - void setGraph(Graph *g){graph = g;}; - -signals: - void clearParamFunctionsList(); - void clearPolarFunctionsList(); private: + void setConstants(FunctionCurve *c, const QMap& constants); + Graph *graph; int curveID; - QComboBox* boxXFunction; - QComboBox* boxYFunction; - QComboBox* boxPolarRadius; - QComboBox* boxPolarTheta; + ScriptEdit* boxXFunction; + ScriptEdit* boxYFunction; + ScriptEdit* boxPolarRadius; + ScriptEdit* boxPolarTheta; QComboBox* boxType; QLabel* textFunction; DoubleSpinBox* boxFrom; DoubleSpinBox* boxTo; QLineEdit* boxParameter; - QLineEdit* boxParFrom; - QLineEdit* boxParTo; + DoubleSpinBox* boxParFrom; + DoubleSpinBox* boxParTo; QLineEdit* boxPolarParameter; - QLineEdit* boxPolarFrom; - QLineEdit* boxPolarTo; + DoubleSpinBox* boxPolarFrom; + DoubleSpinBox* boxPolarTo; QPushButton* buttonClear; QPushButton* buttonCancel; QPushButton* buttonOk; @@ -95,7 +102,7 @@ QSpinBox* boxParPoints; QSpinBox* boxPolarPoints; QStackedWidget* optionStack; - QTextEdit* boxFunction; + ScriptEdit* boxFunction; QWidget* functionPage; QWidget* polarPage; QWidget* parametricPage; @@ -103,6 +110,11 @@ QPushButton *addFunctionBtn; QComboBox* boxMathFunctions; QTextEdit* boxFunctionExplain; + QPushButton *buttonFunctionLog, *buttonXParLog, *buttonYParLog, *buttonPolarRadiusLog, *buttonPolarRThetaLog; + + ApplicationWindow *d_app; + ScriptEdit *d_active_editor; + bool d_stand_alone; }; #endif // FUNCTIONDIALOG_H === modified file 'qtiplot/src/plot2D/dialogs/ImageExportDialog.cpp' --- qtiplot/src/plot2D/dialogs/ImageExportDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/dialogs/ImageExportDialog.cpp 2010-07-21 23:21:08 +0000 @@ -47,6 +47,7 @@ { setWindowTitle( tr( "QtiPlot - Choose a filename to save under" ) ); setAcceptMode(QFileDialog::AcceptSave); + setConfirmOverwrite(false); QList list = QImageWriter::supportedImageFormats(); list << "EPS"; @@ -111,7 +112,7 @@ vector_layout->addWidget(d_color, 2, 1); d_escape_tex_strings = new QCheckBox(); - d_escape_tex_strings->setText(tr("&Escape special characters in title/axis labels")); + d_escape_tex_strings->setText(tr("&Escape special characters in texts")); d_escape_tex_strings->setChecked(app->d_export_escape_tex_strings); vector_layout->addWidget(d_escape_tex_strings, 3, 1); d_escape_tex_strings->hide(); @@ -399,3 +400,35 @@ heightBox->blockSignals(false); } } + +void ImageExportDialog::accept() +{ + if (selectedFiles().isEmpty()) + return; + + if (fileMode() == QFileDialog::Directory) + return QFileDialog::accept(); + + QString file_name = selectedFiles()[0]; + QString selected_filter = selectedFilter().remove("*"); + if(!file_name.endsWith(selected_filter, Qt::CaseInsensitive)) + file_name.append(selected_filter); + + ApplicationWindow *app = qobject_cast(this->parent()); + if (app && app->d_confirm_overwrite && QFileInfo(file_name).exists() && + QMessageBox::warning(this, tr("QtiPlot") + " - " + tr("Overwrite file?"), + tr("%1 already exists.").arg(file_name) + "\n" + tr("Do you want to replace it?"), + QMessageBox::Yes|QMessageBox::No) == QMessageBox::No) + return; + + QFile file(file_name); + if(!file.open( QIODevice::WriteOnly ) ){ + QMessageBox::critical(this, tr("QtiPlot - Export error"), + tr("Could not write to file:

%1

Please verify that you have the right to write to this location!").arg(file_name)); + return; + } + file.close(); + file.remove(); + + return QFileDialog::accept(); +} === modified file 'qtiplot/src/plot2D/dialogs/ImageExportDialog.h' --- qtiplot/src/plot2D/dialogs/ImageExportDialog.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/dialogs/ImageExportDialog.h 2010-07-21 23:21:08 +0000 @@ -122,6 +122,9 @@ //! Return the scale fonts factor double scaleFontsFactor(); +public slots: + void accept(); + protected slots: void closeEvent(QCloseEvent*); //! Update which options are visible and enabled based on the output format. === modified file 'qtiplot/src/plot2D/dialogs/LayerDialog.cpp' --- qtiplot/src/plot2D/dialogs/LayerDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/dialogs/LayerDialog.cpp 2010-07-21 23:21:08 +0000 @@ -2,7 +2,7 @@ File : LayerDialog.cpp Project : QtiPlot -------------------------------------------------------------------- - Copyright : (C) 2004-2007 by Ion Vasilief + Copyright : (C) 2004-2010 by Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : Arrange layers dialog @@ -28,31 +28,38 @@ ***************************************************************************/ #include "LayerDialog.h" #include +#include #include -#include #include #include #include #include +#include #include #include #include #include -LayerDialog::LayerDialog( QWidget* parent, Qt::WFlags fl ) -: QDialog( parent, fl ) +LayerDialog::LayerDialog( QWidget* parent, bool okMode, Qt::WFlags fl ) +: QDialog(parent, fl), +multi_layer(NULL) { - setName("LayerDialog"); + setName("LayerDialog"); setWindowTitle(tr( "QtiPlot - Arrange Layers" )); + setAttribute(Qt::WA_DeleteOnClose); - QGroupBox *gb1 = new QGroupBox(tr("Layers")); + QGroupBox *gb1 = new QGroupBox(tr("Layers")); QGridLayout *gl1 = new QGridLayout(gb1); gl1->addWidget(new QLabel(tr("Number")), 0, 0); layersBox = new QSpinBox(); layersBox->setRange(0, 100); gl1->addWidget(layersBox, 0, 1); + linkXAxesBox = new QCheckBox(tr("Link &X axes")); + linkXAxesBox->setChecked(false); + gl1->addWidget(linkXAxesBox, 1, 0); + fitBox = new QCheckBox(tr("Automatic &layout")); fitBox->setChecked(false); gl1->addWidget(fitBox, 1, 1); @@ -86,77 +93,116 @@ boxY = new QSpinBox(); boxY->setRange(1, 100); gl3->addWidget(boxY, 1, 1); + gl3->setRowStretch(2, 1); GroupCanvasSize = new QGroupBox(tr("&Layer Canvas Size")); GroupCanvasSize->setCheckable(true); GroupCanvasSize->setChecked(false); QGridLayout *gl5 = new QGridLayout(GroupCanvasSize); - gl5->addWidget(new QLabel(tr("Width")), 0, 0); - boxCanvasWidth = new QSpinBox(); + + gl5->addWidget(new QLabel(tr("Unit")), 0, 0); + + unitBox = new QComboBox(); + unitBox->insertItem(tr("inch")); + unitBox->insertItem(tr("mm")); + unitBox->insertItem(tr("cm")); + unitBox->insertItem(tr("point")); + unitBox->insertItem(tr("pixel")); + gl5->addWidget(unitBox, 0, 1); + + QLocale locale = QLocale(); + gl5->addWidget(new QLabel(tr("Width")), 1, 0); + boxCanvasWidth = new DoubleSpinBox(); boxCanvasWidth->setRange(0, 10000); - boxCanvasWidth->setSingleStep(50); - boxCanvasWidth->setSuffix(tr(" pixels")); - gl5->addWidget(boxCanvasWidth, 0, 1); - gl5->addWidget(new QLabel( tr( "Height" )), 1, 0); - boxCanvasHeight = new QSpinBox(); + boxCanvasWidth->setLocale(locale); + boxCanvasWidth->setDecimals(6); + gl5->addWidget(boxCanvasWidth, 1, 1); + + gl5->addWidget(new QLabel( tr( "Height" )), 2, 0); + boxCanvasHeight = new DoubleSpinBox(); boxCanvasHeight->setRange(0, 10000); - boxCanvasHeight->setSingleStep(50); - boxCanvasHeight->setSuffix(tr(" pixels")); - gl5->addWidget(boxCanvasHeight, 1, 1); + boxCanvasHeight->setLocale(locale); + boxCanvasHeight->setDecimals(6); + gl5->addWidget(boxCanvasHeight, 2, 1); + + keepRatioBox = new QCheckBox(tr("&Keep aspect ratio")); + keepRatioBox->setChecked(((ApplicationWindow*)parent)->d_keep_aspect_ration); + gl5->addWidget(keepRatioBox, 3, 1); + + fixedSizeBox = new QCheckBox(tr("&Fixed size")); + gl5->addWidget(fixedSizeBox, 3, 0); QGroupBox *gb4 = new QGroupBox(tr("Spacing")); QGridLayout *gl4 = new QGridLayout(gb4); - gl4->addWidget(new QLabel(tr("Columns gap")), 0, 0); + + gl4->addWidget(new QLabel(tr("Align")), 0, 0); + alignPolicyBox = new QComboBox(); + alignPolicyBox->addItem(tr("Layers")); + alignPolicyBox->addItem(tr("Canvases")); + gl4->addWidget(alignPolicyBox, 0, 1); + + gl4->addWidget(new QLabel(tr("Columns gap")), 1, 0); boxColsGap = new QSpinBox(); boxColsGap->setRange(0, 1000); boxColsGap->setSingleStep(5); boxColsGap->setSuffix(tr(" pixels")); - gl4->addWidget(boxColsGap, 0, 1); - gl4->addWidget(new QLabel( tr( "Rows gap" )), 1, 0); + gl4->addWidget(boxColsGap, 1, 1); + gl4->addWidget(new QLabel( tr( "Rows gap" )), 2, 0); boxRowsGap = new QSpinBox(); boxRowsGap->setRange(0, 1000); boxRowsGap->setSingleStep(5); boxRowsGap->setSuffix(tr(" pixels")); - gl4->addWidget(boxRowsGap, 1, 1); - gl4->addWidget(new QLabel( tr( "Left margin" )), 2, 0); + gl4->addWidget(boxRowsGap, 2, 1); + + commonAxesBox = new QCheckBox(tr("Co&mmon axes")); + commonAxesBox->setDisabled(true); + gl4->addWidget(commonAxesBox, 3, 1); + + QGroupBox *gb7 = new QGroupBox(tr("Margins")); + gl4 = new QGridLayout(gb7); + gl4->addWidget(new QLabel( tr( "Left margin" )), 0, 0); boxLeftSpace = new QSpinBox(); boxLeftSpace->setRange(0, 1000); boxLeftSpace->setSingleStep(5); boxLeftSpace->setSuffix(tr(" pixels")); - gl4->addWidget(boxLeftSpace, 2, 1); - gl4->addWidget(new QLabel( tr( "Right margin" )), 3, 0); + gl4->addWidget(boxLeftSpace, 0, 1); + gl4->addWidget(new QLabel( tr( "Right margin" )), 1, 0); boxRightSpace = new QSpinBox(); boxRightSpace->setRange(0, 1000); boxRightSpace->setSingleStep(5); boxRightSpace->setSuffix(tr(" pixels")); - gl4->addWidget(boxRightSpace, 3, 1); - gl4->addWidget(new QLabel( tr( "Top margin" )), 4, 0); + gl4->addWidget(boxRightSpace, 1, 1); + gl4->addWidget(new QLabel( tr( "Top margin" )), 2, 0); boxTopSpace = new QSpinBox(); boxTopSpace->setRange(0, 1000); boxTopSpace->setSingleStep(5); boxTopSpace->setSuffix(tr(" pixels")); - gl4->addWidget(boxTopSpace, 4, 1); - gl4->addWidget(new QLabel( tr( "Bottom margin") ), 5, 0); + gl4->addWidget(boxTopSpace, 2, 1); + gl4->addWidget(new QLabel( tr( "Bottom margin") ), 3, 0); boxBottomSpace = new QSpinBox(); boxBottomSpace->setRange(0, 1000); boxBottomSpace->setSingleStep(5); boxBottomSpace->setSuffix(tr(" pixels")); - gl4->addWidget(boxBottomSpace, 5, 1); - - QVBoxLayout *vbox1 = new QVBoxLayout(); - vbox1->addWidget(GroupGrid); - vbox1->addWidget(GroupCanvasSize); - - buttonApply = new QPushButton(tr( "&Apply" )); + gl4->addWidget(boxBottomSpace, 3, 1); + gl4->setRowStretch(4, 1); + buttonOk = new QPushButton(tr( "&OK" )); buttonCancel = new QPushButton(tr( "&Cancel" )); + buttonApply = NULL; QHBoxLayout *hbox1 = new QHBoxLayout(); - hbox1->addStretch(); - hbox1->addWidget(buttonApply); + hbox1->addStretch(); + + if (!okMode){ + buttonApply = new QPushButton(tr( "&Apply" )); + connect( buttonApply, SIGNAL( clicked() ), this, SLOT(update() ) ); + hbox1->addWidget(buttonApply); + } + hbox1->addWidget(buttonOk); hbox1->addWidget(buttonCancel); + hbox1->addStretch(); QGroupBox *gb5 = new QGroupBox(tr("Swap Layers")); QHBoxLayout *hbox2 = new QHBoxLayout(gb5); @@ -175,9 +221,11 @@ QGridLayout *gl6 = new QGridLayout(); gl6->addWidget(gb1, 0, 0); gl6->addWidget(gb2, 0, 1); - gl6->addLayout(vbox1, 1, 0); + gl6->addWidget(GroupGrid, 1, 0); gl6->addWidget(gb4, 1, 1); - gl6->setRowStretch(2, 1); + gl6->addWidget(GroupCanvasSize, 2, 0); + gl6->addWidget(gb7, 2, 1); + gl6->setRowStretch(3, 1); QVBoxLayout *vbox2 = new QVBoxLayout(this); vbox2->addLayout(gl6); @@ -187,9 +235,15 @@ connect( buttonSwapLayers, SIGNAL( clicked() ), this, SLOT( swapLayers() ) ); connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonApply, SIGNAL( clicked() ), this, SLOT(update() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( fitBox, SIGNAL( toggled(bool) ), this, SLOT(enableLayoutOptions(bool) ) ); + connect(unitBox, SIGNAL(activated(int)), this, SLOT(updateSizes(int))); + connect(boxCanvasWidth, SIGNAL(valueChanged (double)), this, SLOT(adjustCanvasHeight(double))); + connect(boxCanvasHeight, SIGNAL(valueChanged (double)), this, SLOT(adjustCanvasWidth(double))); + + connect(boxColsGap, SIGNAL(valueChanged(int)), this, SLOT(showCommonAxesBox())); + connect(boxRowsGap, SIGNAL(valueChanged(int)), this, SLOT(showCommonAxesBox())); + connect(alignPolicyBox, SIGNAL(activated(int)), this, SLOT(showCommonAxesBox())); } void LayerDialog::enableLayoutOptions(bool ok) @@ -200,96 +254,140 @@ void LayerDialog::setMultiLayer(MultiLayer *g) { + if (!g) + return; + multi_layer = g; layersBox->setValue(g->numLayers()); boxX->setValue(g->getCols()); boxY->setValue(g->getRows()); + + linkXAxesBox->setChecked(g->hasLinkedXLayerAxes()); + + alignPolicyBox->setCurrentIndex(g->alignPolicy()); boxColsGap->setValue(g->colsSpacing()); boxRowsGap->setValue(g->rowsSpacing()); boxLeftSpace->setValue(g->leftMargin()); boxRightSpace->setValue(g->rightMargin()); boxTopSpace->setValue(g->topMargin()); boxBottomSpace->setValue(g->bottomMargin()); - boxCanvasWidth->setValue(g->layerCanvasSize().width()); - boxCanvasHeight->setValue(g->layerCanvasSize().height()); + + FrameWidget::Unit unit = (FrameWidget::Unit)g->applicationWindow()->d_layer_geometry_unit; + unitBox->blockSignals(true); + unitBox->setCurrentIndex(unit); + unitBox->blockSignals(false); + + updateSizes(unit); + + GroupCanvasSize->setChecked(g->sizePolicy() == MultiLayer::UserSize); + + fixedSizeBox->setChecked(!g->scaleLayersOnResize()); + alignHorBox->setCurrentItem(g->horizontalAlignement()); alignVertBox->setCurrentItem(g->verticalAlignement()); boxLayerSrc->setRange(1, g->numLayers()); boxLayerDest->setRange(1, g->numLayers()); boxLayerDest->setValue(g->numLayers()); + + showCommonAxesBox(); } void LayerDialog::update() { - int graphs = layersBox->value(); - int old_graphs = multi_layer->numLayers(); - int dn = multi_layer->numLayers() - graphs; - if (dn > 0 && QMessageBox::question(0, tr("QtiPlot - Delete Layers?"), - tr("You are about to delete %1 existing layers.").arg(dn)+"\n"+ - tr("Are you sure you want to continue this operation?"), - tr("&Continue"), tr("&Cancel"), QString(), 0, 1 )) return; - - multi_layer->setNumLayers(graphs); - - if (!graphs) - return; - - if (dn < 0) - {// Customize new layers with user default settings - ApplicationWindow *app = (ApplicationWindow *)this->parent(); - for (int i = old_graphs+1; i <= graphs; i++) - app->setPreferences(multi_layer->layer(i)); - } - - int cols=boxX->value(); - int rows=boxY->value(); - - if (cols>graphs && !fitBox->isChecked()) - { - QMessageBox::about(this, tr("QtiPlot - Columns input error"), - tr("The number of columns you've entered is greater than the number of graphs (%1)!").arg(graphs)); - boxX->setFocus(); - return; - } - - if (rows>graphs && !fitBox->isChecked()) - { - QMessageBox::about(this, tr("QtiPlot - Rows input error"), - tr("The number of rows you've entered is greater than the number of graphs (%1)!").arg(graphs)); - boxY->setFocus(); - return; - } - - if (!fitBox->isChecked()) - { - multi_layer->setCols(cols); - multi_layer->setRows(rows); - } - - if (GroupCanvasSize->isChecked()) - multi_layer->setLayerCanvasSize(boxCanvasWidth->value(), boxCanvasHeight->value()); - - multi_layer->setAlignement(alignHorBox->currentItem(), alignVertBox->currentItem()); - - multi_layer->setMargins(boxLeftSpace->value(), boxRightSpace->value(), - boxTopSpace->value(), boxBottomSpace->value()); - - multi_layer->setSpacing(boxRowsGap->value(), boxColsGap->value()); - multi_layer->arrangeLayers(fitBox->isChecked(), GroupCanvasSize->isChecked()); - - if (!GroupCanvasSize->isChecked()) - {//show new layer canvas size - boxCanvasWidth->setValue(multi_layer->layerCanvasSize().width()); - boxCanvasHeight->setValue(multi_layer->layerCanvasSize().height()); - } - - if (fitBox->isChecked()) - {//show new grid settings - boxX->setValue(multi_layer->getCols()); - boxY->setValue(multi_layer->getRows()); - } + if (!multi_layer){ + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + multi_layer = app->multilayerPlot(1, -1, app->defaultCurveStyle, MultiLayer::AlignLayers); + QList layersList = multi_layer->layersList(); + foreach(Graph *g, layersList) + g->removeLegend(); + } + + int graphs = layersBox->value(); + int old_graphs = multi_layer->numLayers(); + int dn = multi_layer->numLayers() - graphs; + if (dn > 0 && QMessageBox::question(0, tr("QtiPlot - Delete Layers?"), + tr("You are about to delete %1 existing layers.").arg(dn)+"\n"+ + tr("Are you sure you want to continue this operation?"), + tr("&Continue"), tr("&Cancel"), QString(), 0, 1 )) return; + + multi_layer->setNumLayers(graphs); + + if (!graphs) + return; + + if (dn < 0){// Customize new layers with user default settings + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + for (int i = old_graphs+1; i <= graphs; i++) + app->setPreferences(multi_layer->layer(i)); + } + + int cols = boxX->value(); + int rows = boxY->value(); + + if (cols>graphs && !fitBox->isChecked()){ + QMessageBox::about(this, tr("QtiPlot - Columns input error"), + tr("The number of columns you've entered is greater than the number of graphs (%1)!").arg(graphs)); + boxX->setFocus(); + return; + } + + if (rows>graphs && !fitBox->isChecked()){ + QMessageBox::about(this, tr("QtiPlot - Rows input error"), + tr("The number of rows you've entered is greater than the number of graphs (%1)!").arg(graphs)); + boxY->setFocus(); + return; + } + + if (!fitBox->isChecked()){ + multi_layer->setCols(cols); + multi_layer->setRows(rows); + } + + FrameWidget::Unit unit = (FrameWidget::Unit)unitBox->currentIndex(); + if (GroupCanvasSize->isChecked()){ + ApplicationWindow *app = multi_layer->applicationWindow(); + if (app) + app->d_layer_geometry_unit = unitBox->currentIndex(); + + multi_layer->setLayerCanvasSize(convertToPixels(boxCanvasWidth->value(), unit, 0), convertToPixels(boxCanvasHeight->value(), unit, 1)); + } + + if (commonAxesBox->isEnabled() && commonAxesBox->isChecked()) + multi_layer->setCommonLayerAxes(boxColsGap->value() == 0, boxRowsGap->value() == 0); + + multi_layer->setAlignement(alignHorBox->currentItem(), alignVertBox->currentItem()); + + multi_layer->setMargins(boxLeftSpace->value(), boxRightSpace->value(), + boxTopSpace->value(), boxBottomSpace->value()); + + multi_layer->setScaleLayersOnResize(!fixedSizeBox->isChecked()); + multi_layer->linkXLayerAxes(linkXAxesBox->isChecked()); + + multi_layer->setAlignPolicy((MultiLayer::AlignPolicy)alignPolicyBox->currentIndex()); + multi_layer->setSpacing(boxRowsGap->value(), boxColsGap->value()); + multi_layer->arrangeLayers(fitBox->isChecked(), GroupCanvasSize->isChecked()); + if (!buttonApply){ + QList layersList = multi_layer->layersList(); + foreach(Graph *g, layersList) + g->newLegend(); + } + + if (!GroupCanvasSize->isChecked()){//show new layer canvas size + boxCanvasWidth->blockSignals(true); + boxCanvasWidth->setValue(convertFromPixels(multi_layer->layerCanvasSize().width(), unit, 0)); + boxCanvasWidth->blockSignals(false); + + boxCanvasHeight->blockSignals(true); + boxCanvasHeight->setValue(convertFromPixels(multi_layer->layerCanvasSize().height(), unit, 1)); + boxCanvasHeight->blockSignals(false); + } + + if (fitBox->isChecked()){//show new grid settings + boxX->setValue(multi_layer->getCols()); + boxY->setValue(multi_layer->getRows()); + } } void LayerDialog::accept() @@ -308,3 +406,171 @@ multi_layer->swapLayers(boxLayerSrc->value(), boxLayerDest->value()); } + +int LayerDialog::convertToPixels(double w, FrameWidget::Unit unit, int dimension) +{ + if (!multi_layer) + return qRound(w); + + double dpi = (double)multi_layer->logicalDpiX(); + if (dimension) + dpi = (double)multi_layer->logicalDpiY(); + + switch(unit){ + case FrameWidget::Pixel: + default: + return qRound(w); + break; + case FrameWidget::Inch: + return qRound(w*dpi); + break; + case FrameWidget::Millimeter: + return qRound(w*dpi/25.4); + break; + case FrameWidget::Centimeter: + return qRound(w*dpi/2.54); + break; + case FrameWidget::Point: + return qRound(w*dpi/72.0); + break; + } + return qRound(w); +} + +double LayerDialog::convertFromPixels(int w, FrameWidget::Unit unit, int dimension) +{ + if (!multi_layer) + return w; + + double dpi = (double)multi_layer->logicalDpiX(); + if (dimension) + dpi = (double)multi_layer->logicalDpiY(); + + double val = 0.0; + switch(unit){ + case FrameWidget::Pixel: + default: + val = w; + break; + case FrameWidget::Inch: + val = (double)w/dpi; + break; + case FrameWidget::Millimeter: + val = 25.4*w/dpi; + break; + case FrameWidget::Centimeter: + val = 2.54*w/dpi; + break; + case FrameWidget::Point: + val = 72.0*w/dpi; + break; + } + return val; +} + +void LayerDialog::updateSizes(int unit) +{ + if (unit == FrameWidget::Pixel || unit == FrameWidget::Point){ + boxCanvasWidth->setFormat('f', 0); + boxCanvasHeight->setFormat('f', 0); + + boxCanvasWidth->setSingleStep(1.0); + boxCanvasHeight->setSingleStep(1.0); + } else { + boxCanvasWidth->setFormat('g', 6); + boxCanvasHeight->setFormat('g', 6); + + boxCanvasWidth->setSingleStep(0.1); + boxCanvasHeight->setSingleStep(0.1); + } + + if (!multi_layer) + return; + + aspect_ratio = (double)multi_layer->layerCanvasSize().width()/(double)multi_layer->layerCanvasSize().height(); + + boxCanvasWidth->setValue(convertFromPixels(multi_layer->layerCanvasSize().width(), (FrameWidget::Unit)unit, 0)); + boxCanvasHeight->setValue(convertFromPixels(multi_layer->layerCanvasSize().height(), (FrameWidget::Unit)unit, 1)); +} + +void LayerDialog::adjustCanvasHeight(double width) +{ + if (keepRatioBox->isChecked()){ + boxCanvasHeight->blockSignals(true); + boxCanvasHeight->setValue(width/aspect_ratio); + boxCanvasHeight->blockSignals(false); + } else + aspect_ratio = width/boxCanvasHeight->value(); +} + +void LayerDialog::adjustCanvasWidth(double height) +{ + if (keepRatioBox->isChecked()){ + boxCanvasWidth->blockSignals(true); + boxCanvasWidth->setValue(height*aspect_ratio); + boxCanvasWidth->blockSignals(false); + } else + aspect_ratio = boxCanvasWidth->value()/height; +} + +void LayerDialog::showCommonAxesBox() +{ + commonAxesBox->setEnabled(alignPolicyBox->currentIndex() == MultiLayer::AlignCanvases && + (boxColsGap->value() == 0 || boxRowsGap->value() == 0)); +} + +void LayerDialog::setLayers(int layers) +{ + layersBox->setValue(layers); +} + +void LayerDialog::setLayerCanvasSize(int w, int h, int unit) +{ + boxCanvasWidth->blockSignals(true); + boxCanvasWidth->setValue(convertFromPixels(w, (FrameWidget::Unit)unit, 0)); + boxCanvasWidth->blockSignals(false); + boxCanvasHeight->blockSignals(true); + boxCanvasHeight->setValue(convertFromPixels(h, (FrameWidget::Unit)unit, 1)); + boxCanvasHeight->blockSignals(false); + unitBox->blockSignals(true); + unitBox->setCurrentIndex(unit); + unitBox->blockSignals(false); + aspect_ratio = boxCanvasWidth->value()/boxCanvasHeight->value(); + GroupCanvasSize->setChecked(true); +} + +void LayerDialog::setRows(int r) +{ + boxY->setValue(r); +} + +void LayerDialog::setColumns(int c) +{ + boxX->setValue(c); +} + +void LayerDialog::setMargins(int l, int t, int r, int b) +{ + boxLeftSpace->setValue(l); + boxRightSpace->setValue(r); + boxTopSpace->setValue(t); + boxBottomSpace->setValue(b); +} + +void LayerDialog::setSharedAxes(bool on) +{ + alignPolicyBox->setCurrentIndex(MultiLayer::AlignCanvases); + commonAxesBox->setChecked(on); + commonAxesBox->setEnabled(true); + boxColsGap->setValue(0); + boxRowsGap->setValue(0); +} + +void LayerDialog::closeEvent(QCloseEvent* e) +{ + ApplicationWindow *app = qobject_cast(this->parent()); + if (app) + app->d_keep_aspect_ration = keepRatioBox->isChecked(); + + e->accept(); +} === modified file 'qtiplot/src/plot2D/dialogs/LayerDialog.h' --- qtiplot/src/plot2D/dialogs/LayerDialog.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/dialogs/LayerDialog.h 2010-07-21 23:21:08 +0000 @@ -2,7 +2,7 @@ File : LayerDialog.h Project : QtiPlot -------------------------------------------------------------------- - Copyright : (C) 2004-2007 by Ion Vasilief + Copyright : (C) 2004-2010 by Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : Arrange layers dialog @@ -33,6 +33,7 @@ #include +class DoubleSpinBox; class QGroupBox; class QPushButton; class QSpinBox; @@ -45,16 +46,30 @@ Q_OBJECT public: - LayerDialog( QWidget* parent = 0, Qt::WFlags fl = 0 ); + LayerDialog(QWidget* parent, bool okMode = false, Qt::WFlags fl = 0); void setMultiLayer(MultiLayer *g); + void setLayers(int layers); + void setLayerCanvasSize(int w, int h, int unit); + void setMargins(int, int, int, int); + void setRows(int); + void setColumns(int); + void setSharedAxes(bool = true); protected slots: void accept(); void update(); void enableLayoutOptions(bool ok); void swapLayers(); + void updateSizes(int unit); + void adjustCanvasHeight(double width); + void adjustCanvasWidth(double height); + void showCommonAxesBox(); private: + void closeEvent(QCloseEvent*); + int convertToPixels(double w, FrameWidget::Unit unit, int dimension); + double convertFromPixels(int w, FrameWidget::Unit unit, int dimension); + MultiLayer *multi_layer; QPushButton* buttonOk; @@ -64,10 +79,19 @@ QGroupBox *GroupCanvasSize, *GroupGrid; QSpinBox *boxX, *boxY, *boxColsGap, *boxRowsGap; QSpinBox *boxRightSpace, *boxLeftSpace, *boxTopSpace, *boxBottomSpace; - QSpinBox *boxCanvasWidth, *boxCanvasHeight, *layersBox; + DoubleSpinBox *boxCanvasWidth, *boxCanvasHeight; + QSpinBox *layersBox; QSpinBox *boxLayerDest, *boxLayerSrc; QCheckBox *fitBox; QComboBox *alignHorBox, *alignVertBox; + QComboBox *unitBox; + QCheckBox *keepRatioBox; + QComboBox *alignPolicyBox; + QCheckBox *commonAxesBox; + QCheckBox *fixedSizeBox; + QCheckBox *linkXAxesBox; + + double aspect_ratio; }; #endif === modified file 'qtiplot/src/plot2D/dialogs/PlotDialog.cpp' --- qtiplot/src/plot2D/dialogs/PlotDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/dialogs/PlotDialog.cpp 2010-07-21 23:21:08 +0000 @@ -2,7 +2,7 @@ File : PlotDialog.cpp Project : QtiPlot -------------------------------------------------------------------- - Copyright : (C) 2006-2009 by Ion Vasilief + Copyright : (C) 2006-2010 by Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : Custom curves dialog @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include @@ -68,6 +68,9 @@ #include #include #include +#include + +#include PlotDialog::PlotDialog(bool showExtended, QWidget* parent, Qt::WFlags fl ) : QDialog(parent, fl), @@ -118,8 +121,10 @@ initLayerSpeedPage(); initFontsPage(); initPrintPage(); + initMiscPage(); initLabelsPage(); - + initFunctionPage(); + initPlotGeometryPage(); clearTabWidget(); QHBoxLayout* hb2 = new QHBoxLayout(); @@ -205,11 +210,7 @@ } hide(); - if (((PlotCurve *)it)->type() == Graph::Function){ - FunctionDialog *fd = app->showFunctionDialog(((CurveTreeItem *)item)->graph(), ((CurveTreeItem *)item)->plotItemIndex()); - if (fd) - connect((QObject *)fd, SIGNAL(destroyed()), this, SLOT(show())); - } else { + if (((PlotCurve *)it)->type() != Graph::Function){ AssociationsDialog* ad = app->showPlotAssociations(((CurveTreeItem *)item)->plotItemIndex()); if (ad) connect((QObject *)ad, SIGNAL(destroyed()), this, SLOT(show())); @@ -258,7 +259,7 @@ if (!graph) return; - int curveType = item->plotItemType(); + int curveType = item->plotItemStyle(); if (curveType == Graph::ColorMap || curveType == Graph::Contour || curveType == Graph::GrayScale) clearTabWidget(); else if (curveType == Graph::VectXYAM || curveType == Graph::VectXYXY){ @@ -310,12 +311,39 @@ acceptParams(); } +void PlotDialog::initMiscPage() +{ + miscPage = new QWidget(); + QGridLayout *gl = new QGridLayout(miscPage); + + boxLinkXAxes = new QCheckBox(tr( "Link &X axes")); + gl->addWidget(boxLinkXAxes, 0, 0); + + QLabel *l = new QLabel(tr("Apply &to...")); + + QHBoxLayout *hl = new QHBoxLayout(); + hl->addWidget(l); + + boxLinkAllXAxes = new QComboBox(); + boxLinkAllXAxes->addItem(tr("Window")); + boxLinkAllXAxes->addItem(tr("All Windows")); + hl->addWidget(boxLinkAllXAxes); + hl->addStretch(); + + l->setBuddy(boxLinkAllXAxes); + + gl->addLayout(hl, 0, 1); + gl->setRowStretch(1, 1); + + privateTabWidget->addTab(miscPage, tr("Miscellaneous")); +} + void PlotDialog::initFontsPage() { - QGroupBox *boxFonts = new QGroupBox(); - QGridLayout *fl = new QGridLayout(boxFonts); + QGroupBox *boxFonts = new QGroupBox(); + QGridLayout *fl = new QGridLayout(boxFonts); - btnTitle = new QPushButton(tr("Titles")); + btnTitle = new QPushButton(tr("Titles")); btnAxesLabels = new QPushButton(tr("Axes Labels")); btnAxesNumbers = new QPushButton(tr("Axes Numbers")); btnLegend = new QPushButton(tr("Legends")); @@ -328,11 +356,12 @@ fl->setColumnStretch(4, 1); fontsPage = new QWidget(); - QHBoxLayout *hl = new QHBoxLayout(fontsPage); - hl->addWidget(boxFonts); - privateTabWidget->addTab(fontsPage, tr( "Fonts" ) ); - - connect( btnTitle, SIGNAL( clicked() ), this, SLOT( setTitlesFont() ) ); + QVBoxLayout *vl = new QVBoxLayout(fontsPage); + vl->addWidget(boxFonts); + + privateTabWidget->addTab(fontsPage, tr( "Fonts")); + + connect( btnTitle, SIGNAL( clicked() ), this, SLOT( setTitlesFont() ) ); connect( btnAxesLabels, SIGNAL( clicked() ), this, SLOT( setAxesLabelsFont() ) ); connect( btnAxesNumbers, SIGNAL( clicked() ), this, SLOT( setAxesNumbersFont() ) ); connect( btnLegend, SIGNAL( clicked() ), this, SLOT( setLegendsFont() ) ); @@ -384,7 +413,10 @@ boxMargin->setSingleStep(5); boxBkgLayout->addWidget( boxMargin, 3, 3); - boxBkgLayout->setRowStretch(4, 1); + layerScaleFonts = new QCheckBox(tr("Scale &Fonts")); + boxBkgLayout->addWidget(layerScaleFonts, 4, 0); + + boxBkgLayout->setRowStretch(5, 1); QVBoxLayout *vl = new QVBoxLayout(); @@ -420,9 +452,88 @@ connect(boxBorderWidth, SIGNAL(valueChanged (int)), this, SLOT(applyLayerFormat())); } + +void PlotDialog::initPlotGeometryPage() +{ + ApplicationWindow *app = (ApplicationWindow *)parent(); + QLocale locale = QLocale(); + if (app) + locale = app->locale(); + + plotUnitBox = new QComboBox(); + plotUnitBox->insertItem(tr("inch")); + plotUnitBox->insertItem(tr("mm")); + plotUnitBox->insertItem(tr("cm")); + plotUnitBox->insertItem(tr("point")); + plotUnitBox->insertItem(tr("pixel")); + plotUnitBox->setCurrentIndex(app->d_layer_geometry_unit); + + QHBoxLayout *bl1 = new QHBoxLayout(); + bl1->addWidget(new QLabel(tr( "Unit" ))); + bl1->addWidget(plotUnitBox); + + QGroupBox *gb1 = new QGroupBox(tr("Origin")); + boxPlotX = new DoubleSpinBox(); + boxPlotX->setLocale(locale); + boxPlotX->setDecimals(6); + + boxPlotY = new DoubleSpinBox(); + boxPlotY->setLocale(locale); + boxPlotY->setDecimals(6); + + QGridLayout *gl1 = new QGridLayout(gb1); + gl1->addWidget(new QLabel( tr("X= ")), 0, 0); + gl1->addWidget(boxPlotX, 0, 1); + gl1->addWidget(new QLabel(tr("Y= ")), 1, 0); + gl1->addWidget(boxPlotY, 1, 1); + gl1->setRowStretch(2, 1); + + QGroupBox *gb2 = new QGroupBox(tr("Size")); + boxPlotWidth = new DoubleSpinBox(); + boxPlotWidth->setMinimum(0); + boxPlotWidth->setLocale(locale); + boxPlotWidth->setDecimals(6); + + boxPlotHeight = new DoubleSpinBox(); + boxPlotHeight->setMinimum(0); + boxPlotHeight->setLocale(locale); + boxPlotHeight->setDecimals(6); + + QGridLayout *gl2 = new QGridLayout(gb2); + gl2->addWidget(new QLabel( tr("width= ")), 0, 0); + gl2->addWidget(boxPlotWidth, 0, 1); + + gl2->addWidget(new QLabel(tr("height= ")), 2, 0); + gl2->addWidget(boxPlotHeight, 2, 1); + + keepPlotRatioBox = new QCheckBox(tr("Keep aspect ratio")); + keepPlotRatioBox->setChecked(app->d_keep_aspect_ration); + gl2->addWidget(keepRatioBox, 3, 1); + + gl2->setRowStretch(4, 1); + + QHBoxLayout *bl2 = new QHBoxLayout(); + bl2->addWidget(gb1); + bl2->addWidget(gb2); + + plotGeometryPage = new QWidget(); + QVBoxLayout * vl = new QVBoxLayout(plotGeometryPage); + vl->addLayout(bl1); + vl->addLayout(bl2); + + boxResizeLayers = new QCheckBox(tr("Do not &resize layers when window size changes")); + vl->addWidget(boxResizeLayers); + + privateTabWidget->addTab(plotGeometryPage, tr("Dimensions")); + + connect(boxPlotWidth, SIGNAL(valueChanged (double)), this, SLOT(adjustPlotHeight(double))); + connect(boxPlotHeight, SIGNAL(valueChanged (double)), this, SLOT(adjustPlotWidth(double))); + connect(plotUnitBox, SIGNAL(activated(int)), this, SLOT(displayPlotCoordinates(int))); +} + void PlotDialog::initLayerGeometryPage() { - layerGeometryPage = new QWidget(); + layerGeometryPage = new QWidget(); ApplicationWindow *app = (ApplicationWindow *)parent(); QLocale locale = QLocale(); @@ -449,15 +560,15 @@ boxY->setLocale(locale); boxY->setDecimals(6); - QGridLayout *gl1 = new QGridLayout(gb1); - gl1->addWidget(new QLabel( tr("X= ")), 0, 0); - gl1->addWidget(boxX, 0, 1); - gl1->addWidget(new QLabel(tr("Y= ")), 1, 0); - gl1->addWidget(boxY, 1, 1); - gl1->setRowStretch(2, 1); + QGridLayout *gl1 = new QGridLayout(gb1); + gl1->addWidget(new QLabel( tr("X= ")), 0, 0); + gl1->addWidget(boxX, 0, 1); + gl1->addWidget(new QLabel(tr("Y= ")), 1, 0); + gl1->addWidget(boxY, 1, 1); + gl1->setRowStretch(2, 1); - QGroupBox *gb2 = new QGroupBox(tr("Size")); - boxLayerWidth = new DoubleSpinBox(); + QGroupBox *gb2 = new QGroupBox(tr("Size")); + boxLayerWidth = new DoubleSpinBox(); boxLayerWidth->setMinimum(0); boxLayerWidth->setLocale(locale); boxLayerWidth->setDecimals(6); @@ -467,28 +578,39 @@ boxLayerHeight->setLocale(locale); boxLayerHeight->setDecimals(6); - QGridLayout *gl2 = new QGridLayout(gb2); - gl2->addWidget(new QLabel( tr("width= ")), 0, 0); - gl2->addWidget(boxLayerWidth, 0, 1); + QGridLayout *gl2 = new QGridLayout(gb2); + gl2->addWidget(new QLabel( tr("width= ")), 0, 0); + gl2->addWidget(boxLayerWidth, 0, 1); - gl2->addWidget(new QLabel(tr("height= ")), 2, 0); - gl2->addWidget(boxLayerHeight, 2, 1); + gl2->addWidget(new QLabel(tr("height= ")), 2, 0); + gl2->addWidget(boxLayerHeight, 2, 1); keepRatioBox = new QCheckBox(tr("Keep aspect ratio")); - keepRatioBox->setChecked(true); - gl2->addWidget(keepRatioBox, 3, 1); - - gl2->setRowStretch(4, 1); - - QBoxLayout *bl2 = new QBoxLayout (QBoxLayout::LeftToRight); + keepRatioBox->setChecked(app->d_keep_aspect_ration); + gl2->addWidget(keepRatioBox, 3, 1); + + QLabel *l = new QLabel(tr("Apply &to...")); + gl2->addWidget(l, 4, 0); + + sizeApplyToBox = new QComboBox(); + sizeApplyToBox->insertItem(tr("Layer")); + sizeApplyToBox->insertItem(tr("Window")); + sizeApplyToBox->insertItem(tr("All Windows")); + gl2->addWidget(sizeApplyToBox, 4, 1); + + l->setBuddy(sizeApplyToBox); + + gl2->setRowStretch(5, 1); + + QBoxLayout *bl2 = new QBoxLayout (QBoxLayout::LeftToRight); bl2->addWidget(gb1); bl2->addWidget(gb2); - QVBoxLayout * vl = new QVBoxLayout( layerGeometryPage ); - vl->addLayout(bl1); + QVBoxLayout * vl = new QVBoxLayout( layerGeometryPage ); + vl->addLayout(bl1); vl->addLayout(bl2); - privateTabWidget->addTab(layerGeometryPage, tr("Geometry")); + privateTabWidget->addTab(layerGeometryPage, tr("Geometry")); connect(boxLayerWidth, SIGNAL(valueChanged (double)), this, SLOT(adjustLayerHeight(double))); connect(boxLayerHeight, SIGNAL(valueChanged (double)), this, SLOT(adjustLayerWidth(double))); @@ -510,7 +632,7 @@ boxMaxPoints->setValue(3000); QGridLayout *gl1 = new QGridLayout(speedModeBox); - gl1->addWidget(new QLabel(tr("Apply to curves with more than:")), 0, 0); + gl1->addWidget(new QLabel(tr("Apply to curves with more than:")), 0, 0); gl1->addWidget(boxMaxPoints, 0, 1); ApplicationWindow *app = (ApplicationWindow *)parent(); @@ -520,7 +642,10 @@ boxDouglasPeukerTolerance = new DoubleSpinBox(); boxDouglasPeukerTolerance->setLocale(locale); - gl1->addWidget(new QLabel(tr("Tolerance (Douglas Peuker algorithm)")), 1, 0); + boxDouglasPeukerTolerance->setMinimum(0.0); + boxDouglasPeukerTolerance->setSpecialValueText(tr("0 (all data points)")); + + gl1->addWidget(new QLabel(tr("Tolerance (Douglas-Peucker algorithm)")), 1, 0); gl1->addWidget(boxDouglasPeukerTolerance, 1, 1); gl1->setRowStretch(2, 1); @@ -560,7 +685,7 @@ QGridLayout *gl2 = new QGridLayout(); gl2->addWidget(new QLabel( tr( "First color" )), 0, 0); - boxFirstColor = new ColorBox(false); + boxFirstColor = new ColorBox(); gl2->addWidget(boxFirstColor, 0, 1); gl2->addWidget(new QLabel( tr( "Pattern" )), 1, 0); @@ -698,6 +823,20 @@ privateTabWidget->addTab(printPage, tr( "Print" ) ); } +void PlotDialog::initFunctionPage() +{ + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + if (!app) + return; + + functionEdit = new FunctionDialog(app, false);//in order to have correct locale settings, parent must be app window + + functionPage = new QWidget(); + QVBoxLayout* vl = new QVBoxLayout(functionPage); + vl->addWidget(functionEdit); + vl->addStretch(); +} + void PlotDialog::initLabelsPage() { labelsGroupBox = new QGroupBox(tr("&Show")); @@ -772,6 +911,7 @@ boxXAxis->addItem(tr("Bottom")); boxXAxis->addItem(tr("Top")); gl->addWidget(boxXAxis, 0, 1); + gl->addWidget(new QLabel( tr( "y Axis" )), 1, 0); boxYAxis = new QComboBox(); boxYAxis->setEditable(false); @@ -838,10 +978,24 @@ gl2->addWidget(new QLabel(tr( "Fill color" )), 0, 0); boxAreaColor = new ColorButton(); gl2->addWidget(boxAreaColor, 0, 1); - gl2->addWidget(new QLabel(tr( "Pattern" )), 1, 0); + + gl2->addWidget(new QLabel(tr( "Opacity" )), 1, 0); + boxCurveOpacity = new QSpinBox(); + boxCurveOpacity->setRange(0, 255); + boxCurveOpacity->setSingleStep(5); + boxCurveOpacity->setWrapping(true); + boxCurveOpacity->setSpecialValueText(tr("Transparent")); + gl2->addWidget(boxCurveOpacity, 1, 1); + + curveOpacitySlider = new QSlider(); + curveOpacitySlider->setOrientation(Qt::Horizontal); + curveOpacitySlider->setRange(0, 255); + gl2->addWidget(curveOpacitySlider, 1, 2); + + gl2->addWidget(new QLabel(tr( "Pattern" )), 2, 0); boxPattern = new PatternBox(false); - gl2->addWidget(boxPattern, 1, 1); - gl2->setRowStretch (2, 1); + gl2->addWidget(boxPattern, 2, 1); + gl2->setRowStretch (3, 1); linePage = new QWidget(); QHBoxLayout* hlayout = new QHBoxLayout(linePage); @@ -857,6 +1011,9 @@ connect(boxPattern, SIGNAL(activated(int)), this, SLOT(acceptParams())); connect(fillGroupBox, SIGNAL(toggled(bool)), this, SLOT(showAreaColor(bool))); connect(fillGroupBox, SIGNAL(clicked()), this, SLOT(acceptParams())); + connect(boxCurveOpacity, SIGNAL(valueChanged(int)), this, SLOT(acceptParams())); + connect(curveOpacitySlider, SIGNAL(valueChanged(int)), boxCurveOpacity, SLOT(setValue(int))); + connect(boxCurveOpacity, SIGNAL(valueChanged(int)), curveOpacitySlider, SLOT(setValue(int))); } void PlotDialog::initSymbolsPage() @@ -864,7 +1021,7 @@ QGroupBox *gb = new QGroupBox(); QGridLayout *gl = new QGridLayout(gb); gl->addWidget(new QLabel(tr( "Style" )), 0, 0); - boxSymbolStyle = new SymbolBox(false); + boxSymbolStyle = new SymbolBox(); gl->addWidget(boxSymbolStyle, 0, 1); gl->addWidget(new QLabel(tr( "Size" )), 1, 0); boxSymbolSize = new QSpinBox(); @@ -1026,23 +1183,23 @@ QGridLayout *gl1 = new QGridLayout(gb1); gl1->addWidget(new QLabel(tr( "Max" )), 0, 0); - boxMaxStyle = new SymbolBox(false); + boxMaxStyle = new SymbolBox(); gl1->addWidget(boxMaxStyle, 0, 1); gl1->addWidget(new QLabel(tr( "99%" )), 1, 0); - box99Style = new SymbolBox(false); + box99Style = new SymbolBox(); gl1->addWidget(box99Style, 1, 1); gl1->addWidget(new QLabel(tr( "Mean" )), 2, 0); - boxMeanStyle = new SymbolBox( false); + boxMeanStyle = new SymbolBox(); gl1->addWidget(boxMeanStyle, 2, 1); gl1->addWidget(new QLabel(tr( "1%" )), 3, 0); - box1Style = new SymbolBox(false); + box1Style = new SymbolBox(); gl1->addWidget(box1Style, 3, 1); gl1->addWidget(new QLabel(tr( "Min" )), 4, 0); - boxMinStyle = new SymbolBox(false); + boxMinStyle = new SymbolBox(); gl1->addWidget(boxMinStyle, 4, 1); gl1->setRowStretch(5, 1); @@ -1476,12 +1633,16 @@ return; d_ml = ml; + displayPlotCoordinates(ml->applicationWindow()->d_layer_geometry_unit); + boxResizeLayers->setChecked(!ml->scaleLayersOnResize()); + + boxLinkXAxes->setChecked(d_ml->hasLinkedXLayerAxes()); boxScaleLayers->setChecked(d_ml->scaleLayersOnPrint()); boxPrintCrops->setChecked(d_ml->printCropmarksEnabled()); QTreeWidgetItem *item = new QTreeWidgetItem(listBox, QStringList(ml->name())); - item->setIcon(0, QIcon(folder_open)); + item->setIcon(0, QIcon(":/folder_open.png")); listBox->addTopLevelItem(item); listBox->setCurrentItem(item); @@ -1587,12 +1748,8 @@ if (rect.contains(pos)){ QMenu contextMenu(this); contextMenu.insertItem(tr("&Delete"), this, SLOT(removeSelectedCurve())); - if (it->rtti() == QwtPlotItem::Rtti_PlotCurve){ - if (((PlotCurve *)it)->type() == Graph::Function) - contextMenu.insertItem(tr("&Edit..."), this, SLOT(editCurve())); - else - contextMenu.insertItem(tr("&Plot Associations..."), this, SLOT(editCurve())); - } + if (it->rtti() == QwtPlotItem::Rtti_PlotCurve && ((PlotCurve *)it)->type() != Graph::Function) + contextMenu.insertItem(tr("&Plot Associations..."), this, SLOT(editCurve())); contextMenu.exec(QCursor::pos()); } e->accept(); @@ -1685,6 +1842,7 @@ if (currentItem->type() == CurveTreeItem::PlotCurveTreeItem){ CurveTreeItem *curveItem = (CurveTreeItem *)currentItem; if (previousItem->type() != CurveTreeItem::PlotCurveTreeItem || + ((CurveTreeItem *)previousItem)->plotItemStyle() != curveItem->plotItemStyle() || ((CurveTreeItem *)previousItem)->plotItemType() != curveItem->plotItemType() || forceClearTabs){ clearTabWidget(); @@ -1706,9 +1864,11 @@ setActiveLayer((LayerItem *)currentItem); } else { clearTabWidget(); + privateTabWidget->addTab(plotGeometryPage, tr("Dimensions")); privateTabWidget->addTab(printPage, tr("Print")); privateTabWidget->addTab(fontsPage, tr("Fonts")); - privateTabWidget->showPage(printPage); + privateTabWidget->addTab(miscPage, tr("Miscellaneous")); + privateTabWidget->showPage(plotGeometryPage); curvePlotTypeBox->hide(); btnWorksheet->hide(); @@ -1782,11 +1942,21 @@ if (!item || item->type() != CurveTreeItem::PlotCurveTreeItem) return; - DataCurve *c = (DataCurve *)((CurveTreeItem *)item)->plotItem(); - if (c && c->type() != Graph::Function && c->type() != Graph::ErrorBars){ - privateTabWidget->addTab (labelsPage, tr("Labels")); - if (c->hasSelectedLabels()) - privateTabWidget->showPage(labelsPage); + PlotCurve *fc = (PlotCurve *)((CurveTreeItem *)item)->plotItem(); + if (fc->type() == Graph::Function){ + privateTabWidget->addTab(functionPage, tr("&Function")); + Graph *g = qobject_cast(fc->plot()); + if (g){ + functionEdit->setCurveToModify(g, g->curveIndex(fc)); + privateTabWidget->showPage(functionPage); + } + } else { + DataCurve *c = (DataCurve *)((CurveTreeItem *)item)->plotItem(); + if (c && c->type() != Graph::Function && c->type() != Graph::ErrorBars){ + privateTabWidget->addTab (labelsPage, tr("Labels")); + if (c->hasSelectedLabels()) + privateTabWidget->showPage(labelsPage); + } } } @@ -1813,6 +1983,9 @@ privateTabWidget->removeTab(privateTabWidget->indexOf(speedPage)); privateTabWidget->removeTab(privateTabWidget->indexOf(fontsPage)); privateTabWidget->removeTab(privateTabWidget->indexOf(printPage)); + privateTabWidget->removeTab(privateTabWidget->indexOf(miscPage)); + privateTabWidget->removeTab(privateTabWidget->indexOf(functionPage)); + privateTabWidget->removeTab(privateTabWidget->indexOf(plotGeometryPage)); } void PlotDialog::quit() @@ -1839,7 +2012,7 @@ int PlotDialog::setPlotType(CurveTreeItem *item) { - int curveType = item->plotItemType(); + int curveType = item->plotItemStyle(); if (curveType >= 0){ boxPlotType->clear(); @@ -1927,6 +2100,7 @@ boxCanvasColor->setColor(c); boxAntialiasing->setChecked(g->antialiasing()); + layerScaleFonts->setChecked(g->autoscaleFonts()); boxLayerWidth->blockSignals(true); boxLayerHeight->blockSignals(true); @@ -1936,7 +2110,7 @@ boxLayerWidth->blockSignals(false); boxLayerHeight->blockSignals(false); - aspect_ratio = (double)g->width()/(double)g->height(); + aspect_ratio = (double)g->canvas()->width()/(double)g->canvas()->height(); boxBackgroundTransparency->blockSignals(false); boxCanvasTransparency->blockSignals(false); @@ -2001,7 +2175,8 @@ defaultScaleBox->setChecked(sp->colorMapPolicy() == Spectrogram::Default); customScaleBox->setChecked(sp->colorMapPolicy() == Spectrogram::Custom); - colorMapEditor->setRange(sp->data().range().minValue(), sp->data().range().maxValue()); + //colorMapEditor->setRange(sp->data().range().minValue(), sp->data().range().maxValue()); + colorMapEditor->setRange(0, sp->data().range().maxValue()); colorMapEditor->setColorMap((const QwtLinearColorMap &)sp->colorMap()); levelsGroupBox->setChecked(sp->testDisplayMode(QwtPlotSpectrogram::ContourMode)); @@ -2050,12 +2225,9 @@ } PlotCurve *c = (PlotCurve*)i; - if (c->type() == Graph::Function) - btnEditCurve->setText(tr("&Edit...")); - else - btnEditCurve->setText(tr("&Plot Associations...")); + btnEditCurve->setVisible(c->type() != Graph::Function); - int curveType = item->plotItemType(); + int curveType = item->plotItemStyle(); if (curveType == Graph::Pie){ QwtPieCurve *pie = (QwtPieCurve*)i; boxPiePattern->setPattern(pie->pattern()); @@ -2112,10 +2284,20 @@ fillGroupBox->blockSignals(true); fillGroupBox->setChecked(c->brush().style() != Qt::NoBrush ); fillGroupBox->blockSignals(false); - boxAreaColor->blockSignals(true); - boxAreaColor->setColor(c->brush().color()); - boxAreaColor->blockSignals(false); - boxPattern->setPattern(c->brush().style()); + + QColor ac = c->brush().color(); + boxCurveOpacity->blockSignals(true); + boxCurveOpacity->setValue(ac.alpha()); + curveOpacitySlider->setValue(ac.alpha()); + boxCurveOpacity->blockSignals(false); + + ac.setAlpha(255); + + boxAreaColor->blockSignals(true); + boxAreaColor->setColor(ac); + boxAreaColor->blockSignals(false); + + boxPattern->setPattern(c->brush().style()); //symbol page const QwtSymbol s = c->symbol(); @@ -2135,8 +2317,10 @@ boxSkipSymbols->setMaximum(c->dataSize()); boxSkipSymbols->blockSignals(false); - if (c->type() == Graph::Function) + if (c->type() == Graph::Function){ + functionEdit->setCurveToModify((FunctionCurve *)c); return; + } if (curveType == Graph::VerticalBars || curveType == Graph::HorizontalBars || curveType == Graph::Histogram){//spacing page @@ -2227,8 +2411,8 @@ setBoxType(boxType->currentIndex()); if (b->boxRangeType() == BoxCurve::SD || b->boxRangeType() == BoxCurve::SE) boxCnt->setValue(b->boxRange()); - else - boxCoef->setValue((int)b->boxRange()); + else + boxCoef->setValue((int)b->boxRange()); boxWhiskersRange->setCurrentIndex (b->whiskersRangeType()); setWhiskersRange(boxWhiskersRange->currentIndex()); @@ -2307,6 +2491,53 @@ yEndBox->setCurrentText(table + "_" + cols[3].remove("(Y)").remove("(M)")); } +void PlotDialog::applyCanvasSize() +{ + if (privateTabWidget->currentWidget() != layerGeometryPage) + return; + + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + switch(sizeApplyToBox->currentIndex()){ + case 1://this window + { + QSize size = QSize(); + QList layersLst = d_ml->layersList(); + foreach(Graph *g, layersLst){ + size = layerCanvasRect(g, boxX->value(), boxY->value(), boxLayerWidth->value(), + boxLayerHeight->value(), (FrameWidget::Unit)unitBox->currentIndex()).size(); + g->setCanvasSize(size); + } + if (size.isValid()) + d_ml->setLayerCanvasSize(size.width(), size.height()); + } + break; + + case 2://all windows + { + QList windows = app->windowsList(); + foreach(MdiSubWindow *w, windows){ + MultiLayer *ml = qobject_cast(w); + if (!ml) + continue; + + QSize size = QSize(); + QList layersLst = ml->layersList(); + foreach(Graph *g, layersLst){ + size = layerCanvasRect(g, boxX->value(), boxY->value(), boxLayerWidth->value(), + boxLayerHeight->value(), (FrameWidget::Unit)unitBox->currentIndex()).size(); + g->setCanvasSize(size); + } + if (size.isValid()) + ml->setLayerCanvasSize(size.width(), size.height()); + } + } + break; + + default: + break; + } +} + void PlotDialog::applyLayerFormat() { if (privateTabWidget->currentWidget() != layerPage) @@ -2374,18 +2605,39 @@ g->setCanvasBackground(c); g->setAntialiasing(boxAntialiasing->isChecked()); + g->setAutoscaleFonts(layerScaleFonts->isChecked()); } bool PlotDialog::acceptParams() { - if (privateTabWidget->currentWidget() == fontsPage){ + if (privateTabWidget->currentWidget() == plotGeometryPage){ + FrameWidget::setRect(d_ml, boxPlotX->value(), boxPlotY->value(), boxPlotWidth->value(), + boxPlotHeight->value(), (FrameWidget::Unit)plotUnitBox->currentIndex()); + d_ml->setScaleLayersOnResize(!boxResizeLayers->isChecked()); + return true; + } else if (privateTabWidget->currentWidget() == fontsPage){ d_ml->setFonts(titleFont, axesFont, numbersFont, legendFont); return true; } else if (privateTabWidget->currentWidget() == printPage){ d_ml->setScaleLayersOnPrint(boxScaleLayers->isChecked()); d_ml->printCropmarks(boxPrintCrops->isChecked()); return true; - } else if (privateTabWidget->currentWidget() == layerPage){ + } else if (privateTabWidget->currentWidget() == miscPage){ + d_ml->linkXLayerAxes(boxLinkXAxes->isChecked()); + if (boxLinkAllXAxes->currentIndex() == 1){ + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + if (app){ + QList windows = app->windowsList(); + foreach(MdiSubWindow *w, windows){ + MultiLayer *ml = qobject_cast(w); + if (ml) + ml->linkXLayerAxes(boxLinkXAxes->isChecked()); + } + } + } + d_ml->notifyChanges(); + return true; + } else if (privateTabWidget->currentWidget() == layerPage){ applyLayerFormat(); return true; } else if (privateTabWidget->currentWidget() == layerGeometryPage){ @@ -2396,10 +2648,11 @@ if (!g) return false; - FrameWidget::setRect(g, boxX->value(), boxY->value(), boxLayerWidth->value(), - boxLayerHeight->value(), (FrameWidget::Unit)unitBox->currentIndex()); + g->setCanvasGeometry(layerCanvasRect(g, boxX->value(), boxY->value(), boxLayerWidth->value(), + boxLayerHeight->value(), (FrameWidget::Unit)unitBox->currentIndex())); + g->notifyChanges(); - d_ml->repaint(); + applyCanvasSize(); ApplicationWindow *app = (ApplicationWindow *)this->parent(); if (app) @@ -2471,8 +2724,8 @@ sp->setColorBarWidth(colorScaleWidthBox->value()); //Update axes page - boxXAxis->setCurrentItem(sp->xAxis()-2); - boxYAxis->setCurrentItem(sp->yAxis()); + boxXAxis->setCurrentIndex(sp->xAxis() - 2); + boxYAxis->setCurrentIndex(sp->yAxis()); } else if (privateTabWidget->currentPage() == contourLinesPage){ Spectrogram *sp = (Spectrogram *)plotItem; if (!sp || sp->rtti() != QwtPlotItem::Rtti_PlotSpectrogram) @@ -2489,16 +2742,22 @@ contourLinesEditor->updateContourLevels(); sp->setDisplayMode(QwtPlotSpectrogram::ContourMode, levelsGroupBox->isChecked()); - labelsGroupBox->setChecked(levelsGroupBox->isChecked()); + labelsGroupBox->setEnabled(levelsGroupBox->isChecked()); - sp->showContourLineLabels(levelsGroupBox->isChecked()); + + if (!levelsGroupBox->isChecked()){ + labelsGroupBox->setChecked(false); + sp->showContourLineLabels(false); + } } else if (privateTabWidget->currentPage() == linePage){ graph->setCurveStyle(item->plotItemIndex(), boxConnect->currentIndex()); - QBrush br = QBrush(boxAreaColor->color(), boxPattern->getSelectedPattern()); + + QColor col = boxAreaColor->color(); + col.setAlpha(boxCurveOpacity->value()); + QBrush br = QBrush(col, boxPattern->getSelectedPattern()); if (!fillGroupBox->isChecked()) br = QBrush(); - QPen pen = QPen(boxLineColor->color(), boxLineWidth->value(), - boxLineStyle->style(), Qt::FlatCap, Qt::MiterJoin); + QPen pen = QPen(boxLineColor->color(), boxLineWidth->value(), boxLineStyle->style(), Qt::SquareCap, Qt::MiterJoin); pen.setCosmetic(true); QwtPlotCurve *curve = (QwtPlotCurve *)plotItem; curve->setPen(pen); @@ -2551,11 +2810,6 @@ if (!err) return false; - /*graph->updateErrorBars(err, xBox->isChecked(), widthBox->value(), - capBox->currentText().toInt(), colorBox->color(), plusBox->isChecked(), minusBox->isChecked(), - throughBox->isChecked()); - err->setSkipSymbolsCount(boxSkipErrorBars->value());*/ - applyErrorBarFormat(err); } else if (privateTabWidget->currentPage() == piePage){ @@ -2652,7 +2906,10 @@ c->setLabelsColor(boxLabelsColor->color()); c->setLabelsAlignment(labelsAlignment()); } + } else if (privateTabWidget->currentPage() == functionPage){ + functionEdit->accept(); } + graph->replot(); graph->notifyChanges(); return true; @@ -2897,9 +3154,9 @@ return; if (item->isExpanded()) - item->setIcon(0, QIcon(folder_open)); + item->setIcon(0, QIcon(":/folder_open.png")); else - item->setIcon(0, QIcon(folder_closed)); + item->setIcon(0, QIcon(":/folder_closed.png")); } void PlotDialog::updateBackgroundTransparency(int alpha) @@ -2974,11 +3231,33 @@ aspect_ratio = boxLayerWidth->value()/height; } +void PlotDialog::adjustPlotHeight(double width) +{ + if (keepPlotRatioBox->isChecked()){ + boxPlotHeight->blockSignals(true); + boxPlotHeight->setValue(width/plot_aspect_ratio); + boxPlotHeight->blockSignals(false); + } else + plot_aspect_ratio = width/boxPlotHeight->value(); +} + +void PlotDialog::adjustPlotWidth(double height) +{ + if (keepPlotRatioBox->isChecked()){ + boxPlotWidth->blockSignals(true); + boxPlotWidth->setValue(height*plot_aspect_ratio); + boxPlotWidth->blockSignals(false); + } else + plot_aspect_ratio = boxPlotWidth->value()/height; +} + void PlotDialog::closeEvent(QCloseEvent* e) { - ApplicationWindow *app = (ApplicationWindow *)this->parent(); - if (app) + ApplicationWindow *app = qobject_cast(this->parent()); + if (app){ app->d_extended_plot_dialog = btnMore->isChecked (); + app->d_keep_aspect_ration = keepRatioBox->isChecked() || keepPlotRatioBox->isChecked(); + } e->accept(); } @@ -3035,6 +3314,38 @@ return align; } +void PlotDialog::displayPlotCoordinates(int unit) +{ + if (unit == FrameWidget::Pixel || unit == FrameWidget::Point){ + boxPlotX->setFormat('f', 0); + boxPlotY->setFormat('f', 0); + boxPlotWidth->setFormat('f', 0); + boxPlotHeight->setFormat('f', 0); + + boxPlotX->setSingleStep(1.0); + boxPlotY->setSingleStep(1.0); + boxPlotWidth->setSingleStep(1.0); + boxPlotHeight->setSingleStep(1.0); + } else { + boxPlotX->setFormat('g', 6); + boxPlotY->setFormat('g', 6); + boxPlotWidth->setFormat('g', 6); + boxPlotHeight->setFormat('g', 6); + + boxPlotX->setSingleStep(0.1); + boxPlotY->setSingleStep(0.1); + boxPlotWidth->setSingleStep(0.1); + boxPlotHeight->setSingleStep(0.1); + } + + plot_aspect_ratio = (double)d_ml->width()/(double)d_ml->height(); + + boxPlotX->setValue(FrameWidget::xIn(d_ml, (FrameWidget::Unit)unit) + FrameWidget::xIn(d_ml, (FrameWidget::Unit)unit)); + boxPlotY->setValue(FrameWidget::yIn(d_ml, (FrameWidget::Unit)unit) + FrameWidget::yIn(d_ml, (FrameWidget::Unit)unit)); + boxPlotWidth->setValue(FrameWidget::widthIn(d_ml, (FrameWidget::Unit)unit)); + boxPlotHeight->setValue(FrameWidget::heightIn(d_ml, (FrameWidget::Unit)unit)); +} + void PlotDialog::displayCoordinates(int unit, Graph *g) { if (!g){ @@ -3068,12 +3379,13 @@ boxLayerHeight->setSingleStep(0.1); } - boxX->setValue(FrameWidget::xIn(g, (FrameWidget::Unit)unit)); - boxY->setValue(FrameWidget::yIn(g, (FrameWidget::Unit)unit)); - boxLayerWidth->setValue(FrameWidget::widthIn(g, (FrameWidget::Unit)unit)); - boxLayerHeight->setValue(FrameWidget::heightIn(g, (FrameWidget::Unit)unit)); + QwtPlotCanvas *canvas = g->canvas(); + aspect_ratio = (double)canvas->width()/(double)canvas->height(); - aspect_ratio = boxLayerWidth->value()/boxLayerHeight->value(); + boxX->setValue(FrameWidget::xIn(canvas, (FrameWidget::Unit)unit) + FrameWidget::xIn(g, (FrameWidget::Unit)unit)); + boxY->setValue(FrameWidget::yIn(canvas, (FrameWidget::Unit)unit) + FrameWidget::yIn(g, (FrameWidget::Unit)unit)); + boxLayerWidth->setValue(FrameWidget::widthIn(canvas, (FrameWidget::Unit)unit)); + boxLayerHeight->setValue(FrameWidget::heightIn(canvas, (FrameWidget::Unit)unit)); } void PlotDialog::setLayerDefaultValues() @@ -3150,7 +3462,7 @@ continue; QPen pen = QPen(c->pen().color(), boxLineWidth->value(), - boxLineStyle->style(), Qt::FlatCap, Qt::MiterJoin); + boxLineStyle->style(), Qt::SquareCap, Qt::MiterJoin); pen.setCosmetic(true); c->setPen(pen); @@ -3367,6 +3679,35 @@ app->modifiedProject(); } +QRect PlotDialog::layerCanvasRect(QWidget *widget, double x, double y, double w, double h, FrameWidget::Unit unit) +{ + if (!widget) + return QRect(qRound(x), qRound(y), qRound(w), qRound(h)); + + int dpiX = widget->logicalDpiX(); + int dpiY = widget->logicalDpiY(); + + switch(unit){ + case FrameWidget::Pixel: + default: + return QRect(qRound(x), qRound(y), qRound(w), qRound(h)); + break; + case FrameWidget::Inch: + return QRect(qRound(x*dpiX), qRound(y*dpiY), qRound(w*dpiX), qRound(h*dpiY)); + break; + case FrameWidget::Millimeter: + return QRect(qRound(x*dpiX/25.4), qRound(y*dpiY/25.4), qRound(w*dpiX/25.4), qRound(h*dpiY/25.4)); + break; + case FrameWidget::Centimeter: + return QRect(qRound(x*dpiX/2.54), qRound(y*dpiY/2.54), qRound(w*dpiX/2.54), qRound(h*dpiY/2.54)); + break; + case FrameWidget::Point: + return QRect(qRound(x*dpiX/72.0), qRound(y*dpiY/72.0), qRound(w*dpiX/72.0), qRound(h*dpiY/72.0)); + break; + } + return QRect(qRound(x), qRound(y), qRound(w), qRound(h)); +} + /***************************************************************************** * * Class LayerItem @@ -3377,7 +3718,7 @@ : QTreeWidgetItem( parent, QStringList(s), LayerTreeItem ), d_graph(g) { - setIcon(0, QPixmap(layer_disabled_xpm)); + setIcon(0, QPixmap(":/layer_disabled.png")); if (g) insertCurvesList(); } @@ -3385,9 +3726,9 @@ void LayerItem::setActive(bool on) { if (on) - setIcon(0, QPixmap(layer_enabled_xpm)); + setIcon(0, QPixmap(":/layer_enabled.png")); else - setIcon(0, QPixmap(layer_disabled_xpm)); + setIcon(0, QPixmap(":/layer_disabled.png")); } void LayerItem::insertCurvesList() @@ -3423,15 +3764,15 @@ : QTreeWidgetItem( parent, QStringList(s), PlotCurveTreeItem ), d_curve(curve) { - setIcon(0, QPixmap(graph_disabled_xpm)); + setIcon(0, QPixmap(":/graph_disabled.png")); } void CurveTreeItem::setActive(bool on) { if (on) - setIcon(0, QPixmap(graph_enabled_xpm)); + setIcon(0, QPixmap(":/graph_enabled.png")); else - setIcon(0, QPixmap(graph_disabled_xpm)); + setIcon(0, QPixmap(":/graph_disabled.png")); } int CurveTreeItem::plotItemIndex() @@ -3444,10 +3785,20 @@ return itemsList.indexOf(d_curve); } +int CurveTreeItem::plotItemStyle() +{ + if (d_curve->rtti() != QwtPlotItem::Rtti_PlotSpectrogram) + return ((PlotCurve *)d_curve)->plotStyle(); + else + return Graph::ColorMap; + + return -1; +} + int CurveTreeItem::plotItemType() { if (d_curve->rtti() != QwtPlotItem::Rtti_PlotSpectrogram) - return ((PlotCurve *)d_curve)->plotStyle(); + return ((PlotCurve *)d_curve)->type(); else return Graph::ColorMap; === modified file 'qtiplot/src/plot2D/dialogs/PlotDialog.h' --- qtiplot/src/plot2D/dialogs/PlotDialog.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot2D/dialogs/PlotDialog.h 2010-07-21 23:21:08 +0000 @@ -47,6 +47,7 @@ class QDoubleSpinBox; class QRadioButton; class QTreeWidget; +class QSlider; class LayerItem; class CurveTreeItem; @@ -62,121 +63,7 @@ class Spectrogram; class QwtErrorPlotCurve; class ContourLinesEditor; - -static const char* folder_closed[]={ - "16 16 9 1", - "g c #808080", - "b c #c0c000", - "e c #c0c0c0", - "# c #000000", - "c c #ffff00", - ". c None", - "a c #585858", - "f c #a0a0a4", - "d c #ffffff", - "..###...........", - ".#abc##.........", - ".#daabc#####....", - ".#ddeaabbccc#...", - ".#dedeeabbbba...", - ".#edeeeeaaaab#..", - ".#deeeeeeefe#ba.", - ".#eeeeeeefef#ba.", - ".#eeeeeefeff#ba.", - ".#eeeeefefff#ba.", - ".##geefeffff#ba.", - "...##gefffff#ba.", - ".....##fffff#ba.", - ".......##fff#b##", - ".........##f#b##", - "...........####."}; - -static const char * layer_disabled_xpm[] = { -"14 14 3 1", -" c None", -". c #666666", -"+ c #FFFFFF", -"..............", -".++++++++++++.", -".+..+++++++++.", -".+..+++++++++.", -".+..+++++++++.", -".+..+++++++++.", -".+..+++++++++.", -".+..+++++++++.", -".+..+++++++++.", -".+..+++++++++.", -".+..........+.", -".+..........+.", -".++++++++++++.", -".............."}; - -/* XPM */ -static const char * layer_enabled_xpm[] = { -"14 14 4 1", -" c None", -". c #1A1A1A", -"+ c #FFFFFF", -"@ c #CB1D08", -"..............", -".++++++++++++.", -".+@@+++++++++.", -".+@@+++++++++.", -".+@@+++++++++.", -".+@@+++++++++.", -".+@@+++++++++.", -".+@@+++++++++.", -".+@@+++++++++.", -".+@@+++++++++.", -".+@@@@@@@@@@+.", -".+@@@@@@@@@@+.", -".++++++++++++.", -".............."}; - -static const char * graph_disabled_xpm[] = { -"14 14 5 1", -" c None", -". c #666666", -"+ c #FFFFFF", -"@ c #999999", -"# c #747474", -"..............", -".++++@@++++++.", -".++++@@++++++.", -".+++@++@+++++.", -".++@++++@@+++.", -".+@+++++@@++#.", -".++++##+++@+#.", -".++++##++++#+.", -".+++#++#++#+@.", -".++#++++##+++.", -".+#+++++##+++.", -".++++++++++++.", -".++++++++++++.", -".............."}; - -static const char * graph_enabled_xpm[] = { -"14 14 6 1", -" c None", -". c #030003", -"+ c #FFFFFF", -"@ c #FC0D00", -"# c #2F28EF", -"$ c #0000FC", -"..............", -".++++@@++++++.", -".++++@@++++++.", -".+++@++@+++++.", -".++@++++@@+++.", -".+@+++++@@++#.", -".++++##+++@+#.", -".++++##++++$+.", -".+++#++#++$+@.", -".++#++++##+++.", -".+#+++++##+++.", -".++++++++++++.", -".++++++++++++.", -".............."}; +class FunctionDialog; //! Custom plot/curves dialog class PlotDialog : public QDialog @@ -233,6 +120,10 @@ void adjustLayerHeight(double width); void adjustLayerWidth(double height); void displayCoordinates(int unit, Graph *g = 0); + //plot window geometry + void displayPlotCoordinates(int unit); + void adjustPlotWidth(double height); + void adjustPlotHeight(double width); protected slots: void setActiveLayer(LayerItem *item); @@ -251,6 +142,8 @@ void showCustomPenColumn(bool on); private: + void applyCanvasSize(); + void applyFormatToLayer(Graph *g); void applySymbolsFormatToCurve(QwtPlotCurve *c, bool fillColor = true, bool penColor = true); void applySymbolsFormatToLayer(Graph *g); @@ -281,18 +174,22 @@ void initContourLinesPage(); void initLayerPage(); void initLayerGeometryPage(); + void initPlotGeometryPage(); void initLayerSpeedPage(); void initFontsPage(); + void initMiscPage(); void initPiePage(); void initPieGeometryPage(); void initPieLabelsPage(); void initPrintPage(); void initLabelsPage(); + void initFunctionPage(); void contextMenuEvent(QContextMenuEvent *e); void showAllLabelControls(bool show = true); void updateContourLevelsDisplay(Spectrogram *sp); + QRect layerCanvasRect(QWidget *widget, double x, double y, double w, double h, FrameWidget::Unit unit); - double aspect_ratio; + double aspect_ratio, plot_aspect_ratio; QFont titleFont, legendFont, axesFont, numbersFont; @@ -304,7 +201,7 @@ QPushButton *btnTitle, *btnAxesLabels, *btnAxesNumbers, *btnLegend; ColorMapEditor *colorMapEditor; - QWidget *curvePlotTypeBox, *layerPage, *layerGeometryPage, *piePage, *fontsPage, *printPage, *speedPage; + QWidget *curvePlotTypeBox, *layerPage, *layerGeometryPage, *piePage, *fontsPage, *printPage, *speedPage, *functionPage; QTreeWidget* listBox; QCheckBox *boxAntialiasing, *boxScaleLayers, *boxPrintCrops; ColorButton *boxBorderColor, *boxBackgroundColor, *boxCanvasColor; @@ -400,10 +297,22 @@ QRadioButton *customPenBtn; QSpinBox *boxSkipSymbols, *boxSkipErrorBars; - QComboBox *symbolsFormatApplyToBox, *lineFormatApplyToBox, *errorBarsFormatApplyToBox; + QComboBox *symbolsFormatApplyToBox, *lineFormatApplyToBox, *errorBarsFormatApplyToBox, *sizeApplyToBox; QSpinBox *boxMaxPoints; DoubleSpinBox *boxDouglasPeukerTolerance; QGroupBox *speedModeBox; + + QWidget *miscPage, *plotGeometryPage; + QCheckBox *boxLinkXAxes; + QComboBox *boxLinkAllXAxes; + + FunctionDialog *functionEdit; + QSpinBox *boxCurveOpacity; + QSlider *curveOpacitySlider; + + DoubleSpinBox *boxPlotX, *boxPlotY, *boxPlotWidth, *boxPlotHeight; + QComboBox *plotUnitBox; + QCheckBox *boxResizeLayers, *keepPlotRatioBox, *layerScaleFonts; }; /***************************************************************************** @@ -443,6 +352,7 @@ const QwtPlotItem *plotItem() { return d_curve; }; int plotItemType(); + int plotItemStyle(); int plotItemIndex(); protected: === added file 'qtiplot/src/plot2D/plot2D.pri' --- qtiplot/src/plot2D/plot2D.pri 1970-01-01 00:00:00 +0000 +++ qtiplot/src/plot2D/plot2D.pri 2010-07-21 23:21:08 +0000 @@ -0,0 +1,115 @@ +############################################################### +################# Module: Plot 2D ############################# +############################################################### + + INCLUDEPATH += src/plot2D/ + INCLUDEPATH += src/plot2D/dialogs/ + + HEADERS += src/plot2D/AddWidgetTool.h \ + src/plot2D/ArrowMarker.h \ + src/plot2D/BoxCurve.h \ + src/plot2D/CanvasPicker.h \ + src/plot2D/DataPickerTool.h \ + src/plot2D/EllipseWidget.h \ + src/plot2D/FrameWidget.h \ + src/plot2D/FunctionCurve.h \ + src/plot2D/Graph.h \ + src/plot2D/Grid.h \ + src/plot2D/ImageWidget.h \ + src/plot2D/LegendWidget.h \ + src/plot2D/LineProfileTool.h \ + src/plot2D/LnScaleEngine.h \ + src/plot2D/Log2ScaleEngine.h \ + src/plot2D/LogitScaleEngine.h \ + src/plot2D/MultiLayer.h \ + src/plot2D/MultiPeakFitTool.h \ + src/plot2D/PlotCurve.h \ + src/plot2D/PlotToolInterface.h \ + src/plot2D/ProbabilityScaleEngine.h \ + src/plot2D/QwtBarCurve.h \ + src/plot2D/QwtErrorPlotCurve.h \ + src/plot2D/QwtHistogram.h \ + src/plot2D/QwtPieCurve.h \ + src/plot2D/RangeSelectorTool.h \ + src/plot2D/ReciprocalScaleEngine.h \ + src/plot2D/RectangleWidget.h \ + src/plot2D/ScaleDraw.h \ + src/plot2D/ScaleEngine.h \ + src/plot2D/ScalePicker.h \ + src/plot2D/ScreenPickerTool.h \ + src/plot2D/SelectionMoveResizer.h \ + src/plot2D/Spectrogram.h \ + src/plot2D/SubtractLineTool.h \ + src/plot2D/TexWidget.h \ + src/plot2D/TitlePicker.h \ + src/plot2D/TranslateCurveTool.h \ + src/plot2D/VectorCurve.h \ + + SOURCES += src/plot2D/AddWidgetTool.cpp \ + src/plot2D/ArrowMarker.cpp \ + src/plot2D/BoxCurve.cpp \ + src/plot2D/CanvasPicker.cpp \ + src/plot2D/DataPickerTool.cpp \ + src/plot2D/EllipseWidget.cpp \ + src/plot2D/FrameWidget.cpp \ + src/plot2D/FunctionCurve.cpp \ + src/plot2D/Graph.cpp \ + src/plot2D/Grid.cpp \ + src/plot2D/ImageWidget.cpp \ + src/plot2D/LegendWidget.cpp \ + src/plot2D/LineProfileTool.cpp \ + src/plot2D/LnScaleEngine.cpp \ + src/plot2D/Log2ScaleEngine.cpp \ + src/plot2D/LogitScaleEngine.cpp \ + src/plot2D/MultiLayer.cpp \ + src/plot2D/MultiPeakFitTool.cpp \ + src/plot2D/PlotCurve.cpp \ + src/plot2D/ProbabilityScaleEngine.cpp \ + src/plot2D/QwtBarCurve.cpp \ + src/plot2D/QwtErrorPlotCurve.cpp \ + src/plot2D/QwtHistogram.cpp \ + src/plot2D/QwtPieCurve.cpp \ + src/plot2D/RangeSelectorTool.cpp \ + src/plot2D/ReciprocalScaleEngine.cpp \ + src/plot2D/RectangleWidget.cpp \ + src/plot2D/ScaleDraw.cpp \ + src/plot2D/ScaleEngine.cpp \ + src/plot2D/ScalePicker.cpp \ + src/plot2D/ScreenPickerTool.cpp \ + src/plot2D/SelectionMoveResizer.cpp \ + src/plot2D/Spectrogram.cpp \ + src/plot2D/SubtractLineTool.cpp \ + src/plot2D/TexWidget.cpp \ + src/plot2D/TitlePicker.cpp \ + src/plot2D/TranslateCurveTool.cpp \ + src/plot2D/VectorCurve.cpp \ + + HEADERS += src/plot2D/dialogs/AssociationsDialog.h \ + src/plot2D/dialogs/AxesDialog.h \ + src/plot2D/dialogs/ContourLinesEditor.h \ + src/plot2D/dialogs/CurvesDialog.h \ + src/plot2D/dialogs/CurveRangeDialog.h \ + src/plot2D/dialogs/EnrichmentDialog.h \ + src/plot2D/dialogs/ErrDialog.h \ + src/plot2D/dialogs/FunctionDialog.h \ + src/plot2D/dialogs/ImageExportDialog.h \ + src/plot2D/dialogs/LayerDialog.h \ + src/plot2D/dialogs/LineDialog.h \ + src/plot2D/dialogs/PlotDialog.h \ + src/plot2D/dialogs/TextDialog.h \ + src/plot2D/dialogs/TextEditor.h \ + + SOURCES += src/plot2D/dialogs/AssociationsDialog.cpp \ + src/plot2D/dialogs/AxesDialog.cpp \ + src/plot2D/dialogs/ContourLinesEditor.cpp \ + src/plot2D/dialogs/CurvesDialog.cpp \ + src/plot2D/dialogs/CurveRangeDialog.cpp \ + src/plot2D/dialogs/EnrichmentDialog.cpp \ + src/plot2D/dialogs/ErrDialog.cpp \ + src/plot2D/dialogs/FunctionDialog.cpp \ + src/plot2D/dialogs/ImageExportDialog.cpp \ + src/plot2D/dialogs/LayerDialog.cpp \ + src/plot2D/dialogs/LineDialog.cpp \ + src/plot2D/dialogs/PlotDialog.cpp \ + src/plot2D/dialogs/TextDialog.cpp \ + src/plot2D/dialogs/TextEditor.cpp \ === removed file 'qtiplot/src/plot2D/plot2D.pri' --- qtiplot/src/plot2D/plot2D.pri 2009-12-08 18:06:27 +0000 +++ qtiplot/src/plot2D/plot2D.pri 1970-01-01 00:00:00 +0000 @@ -1,114 +0,0 @@ -############################################################### -################# Module: Plot 2D ############################# -############################################################### - - INCLUDEPATH += src/plot2D/ - INCLUDEPATH += src/plot2D/dialogs/ - - HEADERS += src/plot2D/AddWidgetTool.h \ - src/plot2D/ArrowMarker.h \ - src/plot2D/BoxCurve.h \ - src/plot2D/CanvasPicker.h \ - src/plot2D/DataPickerTool.h \ - src/plot2D/EllipseWidget.h \ - src/plot2D/FrameWidget.h \ - src/plot2D/FunctionCurve.h \ - src/plot2D/Graph.h \ - src/plot2D/Grid.h \ - src/plot2D/ImageWidget.h \ - src/plot2D/LegendWidget.h \ - src/plot2D/LineProfileTool.h \ - src/plot2D/LnScaleEngine.h \ - src/plot2D/Log2ScaleEngine.h \ - src/plot2D/LogitScaleEngine.h \ - src/plot2D/MultiLayer.h \ - src/plot2D/MultiPeakFitTool.h \ - src/plot2D/PlotCurve.h \ - src/plot2D/PlotToolInterface.h \ - src/plot2D/ProbabilityScaleEngine.h \ - src/plot2D/QwtBarCurve.h \ - src/plot2D/QwtErrorPlotCurve.h \ - src/plot2D/QwtHistogram.h \ - src/plot2D/QwtPieCurve.h \ - src/plot2D/RangeSelectorTool.h \ - src/plot2D/ReciprocalScaleEngine.h \ - src/plot2D/RectangleWidget.h \ - src/plot2D/ScaleDraw.h \ - src/plot2D/ScaleEngine.h \ - src/plot2D/ScalePicker.h \ - src/plot2D/ScreenPickerTool.h \ - src/plot2D/SelectionMoveResizer.h \ - src/plot2D/Spectrogram.h \ - src/plot2D/TexWidget.h \ - src/plot2D/TitlePicker.h \ - src/plot2D/TranslateCurveTool.h \ - src/plot2D/VectorCurve.h \ - src/plot2D/cursors.h \ - - SOURCES += src/plot2D/AddWidgetTool.cpp \ - src/plot2D/ArrowMarker.cpp \ - src/plot2D/BoxCurve.cpp \ - src/plot2D/CanvasPicker.cpp \ - src/plot2D/DataPickerTool.cpp \ - src/plot2D/EllipseWidget.cpp \ - src/plot2D/FrameWidget.cpp \ - src/plot2D/FunctionCurve.cpp \ - src/plot2D/Graph.cpp \ - src/plot2D/Grid.cpp \ - src/plot2D/ImageWidget.cpp \ - src/plot2D/LegendWidget.cpp \ - src/plot2D/LineProfileTool.cpp \ - src/plot2D/LnScaleEngine.cpp \ - src/plot2D/Log2ScaleEngine.cpp \ - src/plot2D/LogitScaleEngine.cpp \ - src/plot2D/MultiLayer.cpp \ - src/plot2D/MultiPeakFitTool.cpp \ - src/plot2D/PlotCurve.cpp \ - src/plot2D/ProbabilityScaleEngine.cpp \ - src/plot2D/QwtBarCurve.cpp \ - src/plot2D/QwtErrorPlotCurve.cpp \ - src/plot2D/QwtHistogram.cpp \ - src/plot2D/QwtPieCurve.cpp \ - src/plot2D/RangeSelectorTool.cpp \ - src/plot2D/ReciprocalScaleEngine.cpp \ - src/plot2D/RectangleWidget.cpp \ - src/plot2D/ScaleDraw.cpp \ - src/plot2D/ScaleEngine.cpp \ - src/plot2D/ScalePicker.cpp \ - src/plot2D/ScreenPickerTool.cpp \ - src/plot2D/SelectionMoveResizer.cpp \ - src/plot2D/Spectrogram.cpp \ - src/plot2D/TexWidget.cpp \ - src/plot2D/TitlePicker.cpp \ - src/plot2D/TranslateCurveTool.cpp \ - src/plot2D/VectorCurve.cpp \ - - HEADERS += src/plot2D/dialogs/AssociationsDialog.h \ - src/plot2D/dialogs/AxesDialog.h \ - src/plot2D/dialogs/ContourLinesEditor.h \ - src/plot2D/dialogs/CurvesDialog.h \ - src/plot2D/dialogs/CurveRangeDialog.h \ - src/plot2D/dialogs/EnrichmentDialog.h \ - src/plot2D/dialogs/ErrDialog.h \ - src/plot2D/dialogs/FunctionDialog.h \ - src/plot2D/dialogs/ImageExportDialog.h \ - src/plot2D/dialogs/LayerDialog.h \ - src/plot2D/dialogs/LineDialog.h \ - src/plot2D/dialogs/PlotDialog.h \ - src/plot2D/dialogs/TextDialog.h \ - src/plot2D/dialogs/TextEditor.h \ - - SOURCES += src/plot2D/dialogs/AssociationsDialog.cpp \ - src/plot2D/dialogs/AxesDialog.cpp \ - src/plot2D/dialogs/ContourLinesEditor.cpp \ - src/plot2D/dialogs/CurvesDialog.cpp \ - src/plot2D/dialogs/CurveRangeDialog.cpp \ - src/plot2D/dialogs/EnrichmentDialog.cpp \ - src/plot2D/dialogs/ErrDialog.cpp \ - src/plot2D/dialogs/FunctionDialog.cpp \ - src/plot2D/dialogs/ImageExportDialog.cpp \ - src/plot2D/dialogs/LayerDialog.cpp \ - src/plot2D/dialogs/LineDialog.cpp \ - src/plot2D/dialogs/PlotDialog.cpp \ - src/plot2D/dialogs/TextDialog.cpp \ - src/plot2D/dialogs/TextEditor.cpp \ === modified file 'qtiplot/src/plot3D/Bar.cpp' --- qtiplot/src/plot3D/Bar.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot3D/Bar.cpp 2010-07-21 23:21:08 +0000 @@ -2,7 +2,7 @@ File : Bar.cpp Project : QtiPlot -------------------------------------------------------------------- - Copyright : (C) 2006 - 2008 by Ion Vasilief + Copyright : (C) 2006 - 2010 by Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : 3D bars (modifed enrichment from QwtPlot3D) @@ -28,6 +28,7 @@ ***************************************************************************/ #include +#include #include #include #include "Bar.h" @@ -69,7 +70,7 @@ else glDisable(GL_LINE_SMOOTH); - glPolygonOffset(1,1); + glPolygonOffset(1, 1); } void Bar::drawEnd() @@ -80,40 +81,45 @@ { GLdouble minz = plot->hull().minVertex.z; + double xl = pos.x - diag_; + double xr = pos.x + diag_; + double yl = pos.y - diag_; + double yr = pos.y + diag_; + if (d_filled_bars){ RGBA rgbat = (*plot->dataColor())(pos); glColor4d(rgbat.r,rgbat.g,rgbat.b,rgbat.a); - + glBegin(GL_QUADS); - glVertex3d(pos.x-diag_,pos.y-diag_,minz); - glVertex3d(pos.x+diag_,pos.y-diag_,minz); - glVertex3d(pos.x+diag_,pos.y+diag_,minz); - glVertex3d(pos.x-diag_,pos.y+diag_,minz); - - glVertex3d(pos.x-diag_,pos.y-diag_,pos.z); - glVertex3d(pos.x+diag_,pos.y-diag_,pos.z); - glVertex3d(pos.x+diag_,pos.y+diag_,pos.z); - glVertex3d(pos.x-diag_,pos.y+diag_,pos.z); - - glVertex3d(pos.x-diag_,pos.y-diag_,minz); - glVertex3d(pos.x+diag_,pos.y-diag_,minz); - glVertex3d(pos.x+diag_,pos.y-diag_,pos.z); - glVertex3d(pos.x-diag_,pos.y-diag_,pos.z); - - glVertex3d(pos.x-diag_,pos.y+diag_,minz); - glVertex3d(pos.x+diag_,pos.y+diag_,minz); - glVertex3d(pos.x+diag_,pos.y+diag_,pos.z); - glVertex3d(pos.x-diag_,pos.y+diag_,pos.z); - - glVertex3d(pos.x-diag_,pos.y-diag_,minz); - glVertex3d(pos.x-diag_,pos.y+diag_,minz); - glVertex3d(pos.x-diag_,pos.y+diag_,pos.z); - glVertex3d(pos.x-diag_,pos.y-diag_,pos.z); - - glVertex3d(pos.x+diag_,pos.y-diag_,minz); - glVertex3d(pos.x+diag_,pos.y+diag_,minz); - glVertex3d(pos.x+diag_,pos.y+diag_,pos.z); - glVertex3d(pos.x+diag_,pos.y-diag_,pos.z); + glVertex3d(xl,yl,minz); + glVertex3d(xr,yl,minz); + glVertex3d(xr,yr,minz); + glVertex3d(xl,yr,minz); + + glVertex3d(xl,yl,pos.z); + glVertex3d(xr,yl,pos.z); + glVertex3d(xr,yr,pos.z); + glVertex3d(xl,yr,pos.z); + + glVertex3d(xl,yl,minz); + glVertex3d(xr,yl,minz); + glVertex3d(xr,yl,pos.z); + glVertex3d(xl,yl,pos.z); + + glVertex3d(xl,yr,minz); + glVertex3d(xr,yr,minz); + glVertex3d(xr,yr,pos.z); + glVertex3d(xl,yr,pos.z); + + glVertex3d(xl,yl,minz); + glVertex3d(xl,yr,minz); + glVertex3d(xl,yr,pos.z); + glVertex3d(xl,yl,pos.z); + + glVertex3d(xr,yl,minz); + glVertex3d(xr,yr,minz); + glVertex3d(xr,yr,pos.z); + glVertex3d(xr,yl,pos.z); glEnd(); } @@ -124,19 +130,19 @@ glColor3d(meshCol.r, meshCol.g, meshCol.b); glBegin(GL_LINES); - glVertex3d(pos.x-diag_,pos.y-diag_,minz); glVertex3d(pos.x+diag_,pos.y-diag_,minz); - glVertex3d(pos.x-diag_,pos.y-diag_,pos.z); glVertex3d(pos.x+diag_,pos.y-diag_,pos.z); - glVertex3d(pos.x-diag_,pos.y+diag_,pos.z); glVertex3d(pos.x+diag_,pos.y+diag_,pos.z); - glVertex3d(pos.x-diag_,pos.y+diag_,minz); glVertex3d(pos.x+diag_,pos.y+diag_,minz); - - glVertex3d(pos.x-diag_,pos.y-diag_,minz); glVertex3d(pos.x-diag_,pos.y+diag_,minz); - glVertex3d(pos.x+diag_,pos.y-diag_,minz); glVertex3d(pos.x+diag_,pos.y+diag_,minz); - glVertex3d(pos.x+diag_,pos.y-diag_,pos.z); glVertex3d(pos.x+diag_,pos.y+diag_,pos.z); - glVertex3d(pos.x-diag_,pos.y-diag_,pos.z); glVertex3d(pos.x-diag_,pos.y+diag_,pos.z); - - glVertex3d(pos.x-diag_,pos.y-diag_,minz); glVertex3d(pos.x-diag_,pos.y-diag_,pos.z); - glVertex3d(pos.x+diag_,pos.y-diag_,minz); glVertex3d(pos.x+diag_,pos.y-diag_,pos.z); - glVertex3d(pos.x+diag_,pos.y+diag_,minz); glVertex3d(pos.x+diag_,pos.y+diag_,pos.z); - glVertex3d(pos.x-diag_,pos.y+diag_,minz); glVertex3d(pos.x-diag_,pos.y+diag_,pos.z); + glVertex3d(xl,yl,minz); glVertex3d(xr,yl,minz); + glVertex3d(xl,yl,pos.z); glVertex3d(xr,yl,pos.z); + glVertex3d(xl,yr,pos.z); glVertex3d(xr,yr,pos.z); + glVertex3d(xl,yr,minz); glVertex3d(xr,yr,minz); + + glVertex3d(xl,yl,minz); glVertex3d(xl,yr,minz); + glVertex3d(xr,yl,minz); glVertex3d(xr,yr,minz); + glVertex3d(xr,yl,pos.z); glVertex3d(xr,yr,pos.z); + glVertex3d(xl,yl,pos.z); glVertex3d(xl,yr,pos.z); + + glVertex3d(xl,yl,minz); glVertex3d(xl,yl,pos.z); + glVertex3d(xr,yl,minz); glVertex3d(xr,yl,pos.z); + glVertex3d(xr,yr,minz); glVertex3d(xr,yr,pos.z); + glVertex3d(xl,yr,minz); glVertex3d(xl,yr,pos.z); glEnd(); } === added file 'qtiplot/src/plot3D/ColorMapPreviewDialog.cpp' --- qtiplot/src/plot3D/ColorMapPreviewDialog.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/plot3D/ColorMapPreviewDialog.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,95 @@ +/*************************************************************************** + File : ColorMapPreviewDialog.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2008 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Open file dialog providing a color map preview. + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + +#include "ColorMapPreviewDialog.h" +#include "Graph3D.h" + +#include +#include +#include + +ColorMapPreviewDialog::ColorMapPreviewDialog(QWidget *parent, Qt::WFlags flags) + : ExtensibleFileDialog(parent, flags) +{ + setCaption(tr("QtiPlot - Color Map Preview Dialog")); + setFileMode(ExistingFile); + QStringList filters; + filters << tr("Colormap files") + " (*.map *.MAP)" << tr("All files") + " (*)"; + setFilters(filters); + + setExtentionToggleButtonText(tr("<< &Preview")); + setExtended(true); + + QWidget *advanced_options = new QWidget(); + QHBoxLayout *advanced_layout = new QHBoxLayout(); + advanced_options->setLayout(advanced_layout); + + d_preview_label = new QLabel(tr("None")); + d_preview_label->setScaledContents(true); + d_preview_label->setFrameShape( QFrame::StyledPanel ); + d_preview_label->setFrameShadow( QFrame::Sunken ); + advanced_layout->addWidget(d_preview_label); + + setExtensionWidget(advanced_options); + connect(this, SIGNAL(currentChanged(const QString&)), + this, SLOT(updatePreview(const QString&))); +} + +void ColorMapPreviewDialog::updatePreview(const QString& fileName) +{ + if (fileName.isEmpty()){ + d_preview_label->setText(tr("None")); + return; + } + + QFileInfo fi(fileName); + if (!fi.isFile () || !fi.isReadable ()){ + d_preview_label->setText(tr("None")); + return; + } + + ColorVector cv; + if (!Graph3D::openColorMapFile(cv, fileName)){ + d_preview_label->setText(tr("None")); + return; + } + + int height = 40; + QPixmap pix; + pix.resize(cv.size(), height); + QPainter p(&pix); + for (unsigned i = 0; i != cv.size(); ++i){ + RGBA rgb = cv[i]; + p.setPen(GL2Qt(rgb.r, rgb.g, rgb.b)); + p.drawLine(QPoint(0, 0), QPoint(0, height)); + p.translate(1, 0); + } + p.end(); + d_preview_label->setPixmap(pix); +} === removed file 'qtiplot/src/plot3D/ColorMapPreviewDialog.cpp' --- qtiplot/src/plot3D/ColorMapPreviewDialog.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/plot3D/ColorMapPreviewDialog.cpp 1970-01-01 00:00:00 +0000 @@ -1,95 +0,0 @@ -/*************************************************************************** - File : ColorMapPreviewDialog.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2008 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Open file dialog providing a color map preview. - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#include "ColorMapPreviewDialog.h" -#include "Graph3D.h" - -#include -#include -#include - -ColorMapPreviewDialog::ColorMapPreviewDialog(QWidget *parent, Qt::WFlags flags) - : ExtensibleFileDialog(parent, flags) -{ - setCaption(tr("QtiPlot - Color Map Preview Dialog")); - setFileMode(ExistingFile); - QStringList filters; - filters << tr("Colormap files") + " (*.map *.MAP)" << tr("All files") + " (*)"; - setFilters(filters); - - setExtentionToggleButtonText(tr("<< &Preview")); - setExtended(true); - - QWidget *advanced_options = new QWidget(); - QHBoxLayout *advanced_layout = new QHBoxLayout(); - advanced_options->setLayout(advanced_layout); - - d_preview_label = new QLabel(tr("None")); - d_preview_label->setScaledContents(true); - d_preview_label->setFrameShape( QFrame::StyledPanel ); - d_preview_label->setFrameShadow( QFrame::Sunken ); - advanced_layout->addWidget(d_preview_label); - - setExtensionWidget(advanced_options); - connect(this, SIGNAL(currentChanged(const QString&)), - this, SLOT(updatePreview(const QString&))); -} - -void ColorMapPreviewDialog::updatePreview(const QString& fileName) -{ - if (fileName.isEmpty()){ - d_preview_label->setText(tr("None")); - return; - } - - QFileInfo fi(fileName); - if (!fi.isFile () || !fi.isReadable ()){ - d_preview_label->setText(tr("None")); - return; - } - - ColorVector cv; - if (!Graph3D::openColorMapFile(cv, fileName)){ - d_preview_label->setText(tr("None")); - return; - } - - int height = 40; - QPixmap pix; - pix.resize(cv.size(), height); - QPainter p(&pix); - for (unsigned i = 0; i != cv.size(); ++i){ - RGBA rgb = cv[i]; - p.setPen(GL2Qt(rgb.r, rgb.g, rgb.b)); - p.drawLine(QPoint(0, 0), QPoint(0, height)); - p.translate(1, 0); - } - p.end(); - d_preview_label->setPixmap(pix); -} === added file 'qtiplot/src/plot3D/ColorMapPreviewDialog.h' --- qtiplot/src/plot3D/ColorMapPreviewDialog.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/plot3D/ColorMapPreviewDialog.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,49 @@ +/*************************************************************************** + File : ColorMapPreviewDialog.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2008 Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Open file dialog providing a color map preview. + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef ColorMapPreviewDialog_H +#define ColorMapPreviewDialog_H + +#include + +#include + +class ColorMapPreviewDialog : public ExtensibleFileDialog +{ + Q_OBJECT + public: + ColorMapPreviewDialog(QWidget *parent = 0, Qt::WFlags flags=0); + + public slots: + void updatePreview(const QString&); + + private: + QLabel *d_preview_label; +}; + +#endif === removed file 'qtiplot/src/plot3D/ColorMapPreviewDialog.h' --- qtiplot/src/plot3D/ColorMapPreviewDialog.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/plot3D/ColorMapPreviewDialog.h 1970-01-01 00:00:00 +0000 @@ -1,49 +0,0 @@ -/*************************************************************************** - File : ColorMapPreviewDialog.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2008 Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Open file dialog providing a color map preview. - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef ColorMapPreviewDialog_H -#define ColorMapPreviewDialog_H - -#include - -#include - -class ColorMapPreviewDialog : public ExtensibleFileDialog -{ - Q_OBJECT - public: - ColorMapPreviewDialog(QWidget *parent = 0, Qt::WFlags flags=0); - - public slots: - void updatePreview(const QString&); - - private: - QLabel *d_preview_label; -}; - -#endif === modified file 'qtiplot/src/plot3D/Cone3D.cpp' --- qtiplot/src/plot3D/Cone3D.cpp 2008-06-12 08:57:17 +0000 +++ qtiplot/src/plot3D/Cone3D.cpp 2010-07-21 23:21:08 +0000 @@ -29,6 +29,7 @@ #include #include "qwt3d_color.h" #include "qwt3d_plot.h" +#include #include "Cone3D.h" using namespace Qwt3D; === modified file 'qtiplot/src/plot3D/Graph3D.cpp' --- qtiplot/src/plot3D/Graph3D.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot3D/Graph3D.cpp 2010-07-21 23:21:08 +0000 @@ -2,7 +2,7 @@ File : Graph3D.cpp Project : QtiPlot -------------------------------------------------------------------- - Copyright : (C) 2004-2007 by Ion Vasilief + Copyright : (C) 2004-2010 by Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : 3D graph widget @@ -54,7 +54,7 @@ #include #include -UserFunction::UserFunction(const QString& s, SurfacePlot& pw) +UserFunction::UserFunction(const QString& s, Qwt3D::Curve *pw) : Function(pw), formula(s) {} @@ -88,7 +88,7 @@ } UserParametricSurface::UserParametricSurface(const QString& xFormula, const QString& yFormula, - const QString& zFormula, SurfacePlot& pw) + const QString& zFormula, Qwt3D::Curve *pw) : ParametricSurface(pw), d_x_formula(xFormula), d_y_formula(yFormula), @@ -152,6 +152,8 @@ { setAcceptDrops(true); + d_active_curve = NULL; + d_table = 0; d_table_plot_type = NoTable; d_matrix = 0; @@ -162,11 +164,12 @@ connect(d_timer, SIGNAL(timeout()), this, SLOT(rotate())); ignoreFonts = false; - resize(500, 400); - ApplicationWindow *app = applicationWindow(); - sp = new SurfacePlot(this); + d_scale_on_print = app->d_scale_plots_on_print; + d_print_cropmarks = app->d_print_cropmarks; + + sp = new Plot3D(this); sp->installEventFilter(this); sp->setRotation(30, 0, 15); sp->setScale(1, 1, 1); @@ -174,21 +177,20 @@ sp->setZoom(0.9); sp->setOrtho(app->d_3D_orthogonal); sp->setSmoothMesh(app->d_3D_smooth_mesh); - sp->setResolution(app->d_3D_resolution); sp->setFloorStyle((Qwt3D::FLOORSTYLE)app->d_3D_projection); sp->setLocale(app->locale()); setWidget(sp); +#ifdef Q_OS_MAC + show(); +#endif + resize(500, 400); + d_autoscale = app->d_3D_autoscale; title = QString::null; - sp->setTitle(title); - titleCol = Qt::black; - sp->setTitleColor(Qt2GL(titleCol)); - titleFnt = app->d_3D_title_font; - sp->setTitleFont(titleFnt.family(), titleFnt.pointSize(), titleFnt.weight(), titleFnt.italic()); col_ = 0; d_color_map_file = QString::null; @@ -196,9 +198,6 @@ legendOn = app->d_3D_legend; legendMajorTicks = 5; - sp->showColorLegend(legendOn); - sp->legend()->setAutoScale(true); - sp->legend()->setMajors(legendMajorTicks) ; labelsDist = 0; @@ -218,14 +217,11 @@ crossHairSmooth = true, crossHairBoxed = false; conesQuality = 32; conesRad = 0.5; - style_ = NOPLOT; + style_ = Qwt3D::FILLEDMESH; initCoord(); sp->coordinates()->setLineSmooth(app->d_3D_smooth_mesh); setNumbersFont(app->d_3D_numbers_font); - setXAxisLabelFont(app->d_3D_axes_font); - setYAxisLabelFont(app->d_3D_axes_font); - setZAxisLabelFont(app->d_3D_axes_font); setMeshColor(app->d_3D_mesh_color); setAxesColor(app->d_3D_axes_color); @@ -238,6 +234,7 @@ for (int i = 0; i < 12; i++){ sp->coordinates()->setMajorGridLines((Qwt3D::AXIS)i, majorGrid); sp->coordinates()->setMinorGridLines((Qwt3D::AXIS)i, minorGrid); + sp->coordinates()->axes[i].setLabelFont(app->d_3D_axes_font); } connect(sp,SIGNAL(rotationChanged(double, double, double)),this,SLOT(rotationChanged(double, double, double))); @@ -279,20 +276,53 @@ sp->coordinates()->setAutoScale(false); } +Curve* Graph3D::addCurve() +{ + removeCurve(); + + ApplicationWindow *app = applicationWindow(); + + d_active_curve = new Curve(sp); + sp->addCurve(d_active_curve); + + d_active_curve->setSmoothMesh(app->d_3D_smooth_mesh); + d_active_curve->setDataProjection(false); + d_active_curve->setProjection(BASE); + d_active_curve->setProjection(FACE, false); + d_active_curve->setProjection(SIDE, false); + d_active_curve->setResolution(app->d_3D_resolution); + + if (!title.isEmpty() && d_active_curve->title()->string() != title) + setTitle(title, titleCol, titleFnt); + + return d_active_curve; +} + +void Graph3D::removeCurve() +{ + if (d_surface){ + delete d_surface; + d_surface = 0; + } else if (d_func){ + delete d_func; + d_func = 0; + } + + if (d_active_curve){ + delete d_active_curve; + d_active_curve = 0; + } +} + void Graph3D::addFunction(const QString& s, double xl, double xr, double yl, double yr, double zl, double zr, int columns, int rows) { - if (d_surface){ - delete d_surface; - d_surface = 0; - } else if (d_func){ - delete d_func; - d_func = 0; - } - sp->makeCurrent(); - d_func = new UserFunction(s, *sp); + if (!d_active_curve) + d_active_curve = addCurve(); + + d_func = new UserFunction(s, d_active_curve); d_func->setMesh(columns, rows); d_func->setDomain(xl, xr, yl, yr); @@ -300,11 +330,12 @@ d_func->setMaxZ(zr); d_func->create(); - sp->legend()->setLimits(zl, zr); - sp->legend()->setMajors(legendMajorTicks); + d_active_curve->legend()->setLimits(zl, zr); + d_active_curve->legend()->setMajors(legendMajorTicks); + d_active_curve->showColorLegend(legendOn); - if (sp->plotStyle() == NOPLOT){ - sp->setPlotStyle(FILLED); + if (d_active_curve->plotStyle() == NOPLOT){ + d_active_curve->setPlotStyle(FILLED); style_=FILLED; pointStyle = None; } @@ -317,17 +348,12 @@ const QString& zFormula, double ul, double ur, double vl, double vr, int columns, int rows, bool uPeriodic, bool vPeriodic) { - if (d_surface){ - delete d_surface; - d_surface = 0; - } else if (d_func){ - delete d_func; - d_func = 0; - } - sp->makeCurrent(); - d_surface = new UserParametricSurface(xFormula, yFormula, zFormula, *sp); + if (!d_active_curve) + d_active_curve = addCurve(); + + d_surface = new UserParametricSurface(xFormula, yFormula, zFormula, d_active_curve); d_surface->setMesh(columns, rows); d_surface->setDomain(ul, ur, vl, vr); d_surface->setPeriodic(uPeriodic, vPeriodic); @@ -335,11 +361,12 @@ double zl, zr; sp->coordinates()->axes[Z1].limits(zl, zr); - sp->legend()->setLimits(zl, zr); - sp->legend()->setMajors(legendMajorTicks); + d_active_curve->showColorLegend(legendOn); + d_active_curve->legend()->setLimits(zl, zr); + d_active_curve->legend()->setMajors(legendMajorTicks); - if (sp->plotStyle() == NOPLOT){ - sp->setPlotStyle(FILLED); + if (d_active_curve->plotStyle() == NOPLOT){ + d_active_curve->setPlotStyle(FILLED); style_=FILLED; pointStyle = None; } @@ -353,19 +380,19 @@ return; int xcol = table->colIndex(xColName); - int ycol = table->colIndex(yColName); + int ycol = table->colIndex(yColName); if (xcol < 0 || ycol < 0) return; - bool empty = !sp->hasData(); + bool empty = !sp->hasData(); - plotAssociation = xColName+"(X)," + yColName+"(Y)"; + plotAssociation = xColName + "(X)," + yColName + "(Y)"; d_table = table; d_table_plot_type = Ribbon; - int r=table->numRows(); - int i, xmesh=0, ymesh=2; - for (i = 0; i < r; i++){ + int r = table->numRows(); + int xmesh = 0, ymesh = 2; + for (int i = 0; i < r; i++){ if (!table->text(i,xcol).isEmpty() && !table->text(i,ycol).isEmpty()) xmesh++; } @@ -374,12 +401,12 @@ xmesh++; double **data = Matrix::allocateMatrixData(xmesh, ymesh); - gsl_vector * x = gsl_vector_alloc (xmesh); - gsl_vector * y = gsl_vector_alloc (xmesh); + gsl_vector *x = gsl_vector_alloc (xmesh); + gsl_vector *y = gsl_vector_alloc (xmesh); for (int j = 0; j < ymesh; j++){ - int k=0; - for (i = 0; i < r; i++){ + int k = 0; + for (int i = 0; i < r; i++){ if (!table->text(i,xcol).isEmpty() && !table->text(i,ycol).isEmpty()){ gsl_vector_set (x, k, table->cell(i, xcol)); @@ -394,8 +421,12 @@ double maxy = gsl_vector_max(y); double maxz = 0.6*maxy; sp->makeCurrent(); - sp->legend()->setLimits(gsl_vector_min(y), maxy); - sp->loadFromData(data, xmesh, ymesh, gsl_vector_min(x), gsl_vector_max(x), 0, maxz); + if (!d_active_curve) + d_active_curve = addCurve(); + d_active_curve->showColorLegend(legendOn); + d_active_curve->legend()->setLimits(gsl_vector_min(y), maxy); + d_active_curve->legend()->setMajors(legendMajorTicks); + d_active_curve->loadFromData(data, xmesh, ymesh, gsl_vector_min(x), gsl_vector_max(x), 0, maxz); if (empty || d_autoscale) findBestLayout(); @@ -451,17 +482,20 @@ } } sp->makeCurrent(); - sp->loadFromData(data, xmesh, ymesh, xl, xr, yl, yr); + if (!d_active_curve) + d_active_curve = addCurve(); + d_active_curve->loadFromData(data, xmesh, ymesh, xl, xr, yl, yr); sp->createCoordinateSystem(Triple(xl, yl, zl), Triple(xr, yr, zr)); - sp->legend()->setLimits(zl, zr); - sp->legend()->setMajors(legendMajorTicks); + d_active_curve->showColorLegend(legendOn); + d_active_curve->legend()->setLimits(zl, zr); + d_active_curve->legend()->setMajors(legendMajorTicks); Matrix::freeMatrixData(data, xmesh); } void Graph3D::addMatrixData(Matrix* m) { - if (!m || d_matrix == m) + if (!m || d_matrix == m || m->isEmpty()) return; d_table = NULL; @@ -483,12 +517,15 @@ } sp->makeCurrent(); - sp->loadFromData(data_matrix, cols, rows, m->xStart(), m->xEnd(), m->yStart(), m->yEnd()); + if (!d_active_curve) + d_active_curve = addCurve(); + d_active_curve->loadFromData(data_matrix, cols, rows, m->xStart(), m->xEnd(), m->yStart(), m->yEnd()); double start, end; sp->coordinates()->axes[Z1].limits (start, end); - sp->legend()->setLimits(start, end); - sp->legend()->setMajors(legendMajorTicks); + d_active_curve->showColorLegend(legendOn); + d_active_curve->legend()->setLimits(start, end); + d_active_curve->legend()->setMajors(legendMajorTicks); Matrix::freeMatrixData(data_matrix, cols); @@ -500,7 +537,7 @@ void Graph3D::addMatrixData(Matrix* m, double xl, double xr, double yl, double yr, double zl, double zr) { - if (!m) + if (!m || m->isEmpty()) return; d_matrix = m; @@ -605,20 +642,29 @@ Qwt3D::Cell cell; cell.push_back(index); if (index > 0) - cell.push_back(index-1); + cell.push_back(index-1); cells.push_back (cell); index ++; } } + if (!index){ + clearData(); + return; + } + sp->makeCurrent(); - sp->loadFromData (data, cells); + + if (!d_active_curve) + d_active_curve = addCurve(); + d_active_curve->loadFromData (data, cells); if (check_limits) sp->createCoordinateSystem(Triple(xl, yl, zl), Triple(xr, yr, zr)); double start, end; sp->coordinates()->axes[Z1].limits (start, end); - sp->legend()->setLimits(start, end); - sp->legend()->setMajors(legendMajorTicks); + d_active_curve->showColorLegend(legendOn); + d_active_curve->legend()->setLimits(start, end); + d_active_curve->legend()->setMajors(legendMajorTicks); } void Graph3D::updateData(Table* table) @@ -703,9 +749,12 @@ sp->makeCurrent(); resetNonEmptyStyle(); sp->coordinates()->axes[Y1].limits (miny,maxy); //actual Y scale limits - sp->loadFromData(data, xmesh, ymesh, minx, maxx, miny, maxy); - sp->legend()->setLimits(minz,maxz); - sp->legend()->setMajors(legendMajorTicks); + if (!d_active_curve) + d_active_curve = addCurve(); + d_active_curve->loadFromData(data, xmesh, ymesh, minx, maxx, miny, maxy); + d_active_curve->showColorLegend(legendOn); + d_active_curve->legend()->setLimits(minz,maxz); + d_active_curve->legend()->setMajors(legendMajorTicks); gsl_vector_free (x);gsl_vector_free (y); Matrix::freeMatrixData(data, xmesh); @@ -713,15 +762,25 @@ void Graph3D::updateMatrixData(Matrix* m) { - int cols=m->numCols(); - int rows=m->numRows(); + if (!m) + return; + + if (m->isEmpty()){ + clearData(); + return; + } + + int cols = m->numCols(); + int rows = m->numRows(); double **data = Matrix::allocateMatrixData(cols, rows); for (int i = 0; i < cols; i++ ){ for (int j = 0; j < rows; j++) data[i][j] = m->cell(j, i); } - sp->loadFromData(data, cols, rows, m->xStart(), m->xEnd(), m->yStart(), m->yEnd()); + if (!d_active_curve) + d_active_curve = addCurve(); + d_active_curve->loadFromData(data, cols, rows, m->xStart(), m->xEnd(), m->yStart(), m->yEnd()); Qwt3D::Axis z_axis = sp->coordinates()->axes[Z1]; double start, end; @@ -729,8 +788,9 @@ z_axis.setMajors(z_axis.majors()); z_axis.setMajors(z_axis.minors()); - sp->legend()->setLimits(start, end); - sp->legend()->setMajors(legendMajorTicks); + d_active_curve->showColorLegend(legendOn); + d_active_curve->legend()->setLimits(start, end); + d_active_curve->legend()->setMajors(legendMajorTicks); Matrix::freeMatrixData(data, cols); if (d_autoscale) @@ -740,7 +800,7 @@ void Graph3D::resetNonEmptyStyle() { - if (sp->plotStyle() != Qwt3D::NOPLOT ) + if (!d_active_curve || d_active_curve->plotStyle() != Qwt3D::NOPLOT ) return; // the plot was not previousely emptied if (style_== Qwt3D::USER) @@ -751,24 +811,35 @@ break; case Dots : - sp->setPlotStyle(Dot(d_point_size, d_smooth_points)); + { + Dot dot = Dot(d_point_size, d_smooth_points); + d_active_curve->setPlotStyle(dot); break; + } case VerticalBars : - sp->setPlotStyle(Bar(d_bars_rad)); + { + Bar bar = Bar(d_bars_rad); + d_active_curve->setPlotStyle(bar); break; + } case HairCross : - sp->setPlotStyle(CrossHair(crossHairRad, crossHairLineWidth, crossHairSmooth, crossHairBoxed)); + { + CrossHair cross = CrossHair(crossHairRad, crossHairLineWidth, crossHairSmooth, crossHairBoxed); + d_active_curve->setPlotStyle(cross); break; + } case Cones : - sp->setPlotStyle(Cone3D(conesRad, conesQuality)); + { + Cone3D cone = Cone3D(conesRad, conesQuality); + d_active_curve->setPlotStyle(cone); break; + } } - } - else - sp->setPlotStyle(style_); + } else if (d_active_curve) + d_active_curve->setPlotStyle(style_); } void Graph3D::update() @@ -778,7 +849,6 @@ resetAxesLabels(); sp->updateData(); - sp->updateGL(); } void Graph3D::setLabelsDistance(int val) @@ -800,7 +870,8 @@ void Graph3D::setNumbersFont(const QFont& font) { sp->coordinates()->setNumberFont (font); - sp->legend()->axis()->setNumberFont (font); + if (d_active_curve) + d_active_curve->legend()->axis()->setNumberFont (font); sp->makeCurrent(); sp->updateGL(); } @@ -1001,20 +1072,53 @@ void Graph3D::resetAxesLabels() { - sp->coordinates()->axes[X1].setLabelString(labels[0]); - sp->coordinates()->axes[X2].setLabelString(labels[0]); - sp->coordinates()->axes[X3].setLabelString(labels[0]); - sp->coordinates()->axes[X4].setLabelString(labels[0]); - - sp->coordinates()->axes[Y1].setLabelString(labels[1]); - sp->coordinates()->axes[Y2].setLabelString(labels[1]); - sp->coordinates()->axes[Y3].setLabelString(labels[1]); - sp->coordinates()->axes[Y4].setLabelString(labels[1]); - - sp->coordinates()->axes[Z1].setLabelString(labels[2]); - sp->coordinates()->axes[Z2].setLabelString(labels[2]); - sp->coordinates()->axes[Z3].setLabelString(labels[2]); - sp->coordinates()->axes[Z4].setLabelString(labels[2]); + QString s = labels[0]; + if (s == "%(?X)"){ + QStringList lst = plotAssociation.split(","); + if (!lst.isEmpty()){ + s = lst[0].remove("(X)"); + int pos = s.lastIndexOf("_"); + if (pos > 0) + s = s.right(s.length() - pos - 1); + } + } + + sp->coordinates()->axes[X1].setLabelString(s); + sp->coordinates()->axes[X2].setLabelString(s); + sp->coordinates()->axes[X3].setLabelString(s); + sp->coordinates()->axes[X4].setLabelString(s); + + s = labels[1]; + if (s == "%(?Y)"){ + QStringList lst = plotAssociation.split(","); + if (!lst.isEmpty()){ + s = lst[1].remove("(Y)"); + int pos = s.lastIndexOf("_"); + if (pos > 0) + s = s.right(s.length() - pos - 1); + } + } + + sp->coordinates()->axes[Y1].setLabelString(s); + sp->coordinates()->axes[Y2].setLabelString(s); + sp->coordinates()->axes[Y3].setLabelString(s); + sp->coordinates()->axes[Y4].setLabelString(s); + + s = labels[2]; + if (s == "%(?Z)"){ + QStringList lst = plotAssociation.split(","); + if (!lst.isEmpty()){ + s = lst[2].remove("(Z)"); + int pos = s.lastIndexOf("_"); + if (pos > 0) + s = s.right(s.length() - pos - 1); + } + } + + sp->coordinates()->axes[Z1].setLabelString(s); + sp->coordinates()->axes[Z2].setLabelString(s); + sp->coordinates()->axes[Z3].setLabelString(s); + sp->coordinates()->axes[Z4].setLabelString(s); } void Graph3D::setAxesLabels(const QStringList& l) @@ -1045,12 +1149,12 @@ void Graph3D::setXAxisLabel(const QString& label) { - if (labels[0] != label){ - sp->coordinates()->axes[X1].setLabelString(label); - sp->coordinates()->axes[X2].setLabelString(label); - sp->coordinates()->axes[X3].setLabelString(label); - sp->coordinates()->axes[X4].setLabelString(label); - labels[0]=label; + if (labels[0] != label){ + sp->coordinates()->axes[X1].setLabelString(label); + sp->coordinates()->axes[X2].setLabelString(label); + sp->coordinates()->axes[X3].setLabelString(label); + sp->coordinates()->axes[X4].setLabelString(label); + labels[0] = label; } sp->makeCurrent(); @@ -1168,6 +1272,41 @@ return limits; } +int Graph3D::axisNumericFormat(int axis) +{ + return (int)sp->coordinates()->axes[axis].numericFormat(); +} + +int Graph3D::axisNumericPrecision(int axis) +{ + return sp->coordinates()->axes[axis].numericPrecision(); +} + +void Graph3D::setAxisNumericFormat(int axis, int format, int precision) +{ + int axis1 = X1, axis2 = X2, axis3 = X3, axis4 = X4; + + sp->makeCurrent(); + switch(axis){ + case 0: + break; + case 1: + axis1 = Y1, axis2 = Y2, axis3 = Y3, axis4 = Y4; + break; + case 2: + axis1 = Z1, axis2 = Z2, axis3 = Z3, axis4 = Z4; + break; + } + + sp->coordinates()->axes[axis1].setNumericFormat((Qwt3D::Scale::NumericFormat)format, precision); + sp->coordinates()->axes[axis2].setNumericFormat((Qwt3D::Scale::NumericFormat)format, precision); + sp->coordinates()->axes[axis3].setNumericFormat((Qwt3D::Scale::NumericFormat)format, precision); + sp->coordinates()->axes[axis4].setNumericFormat((Qwt3D::Scale::NumericFormat)format, precision); + + update(); + emit modified(); +} + void Graph3D::setScale(int axis, double start, double end, int majorTicks, int minorTicks, Qwt3D::SCALETYPE type) { double left, right; @@ -1257,6 +1396,9 @@ sp->coordinates()->axes[axis].setTicLength(majorTicLength, minorTicLength); + if (d_active_curve) + d_active_curve->updateColorLegend(legendMajorTicks, 2); + update(); emit modified(); } @@ -1265,8 +1407,6 @@ { QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - sp->hide();//in order to avoid flickering, due to changes in tick length - double *majorTicLengths = new double[12]; double *minorTicLengths = new double[12]; for (int i = 0; i < 12; i++) @@ -1280,6 +1420,7 @@ d_func->setMaxZ(zr); d_func->create (); sp->createCoordinateSystem(Triple(xl, yl, zl), Triple(xr, yr, zr)); + d_active_curve->legend()->setLimits(zl, zr); } else if (d_table){ QString name = plotAssociation; @@ -1304,7 +1445,8 @@ updateScales(xl, xr, yl, yr, zl, zr, xCol, yCol); } resetAxesLabels(); - findBestLayout(); + if (d_autoscale) + findBestLayout(); for (int i = 0; i < 12; i++) sp->coordinates()->axes[i].setTicLength(majorTicLengths[i], minorTicLengths[i]); @@ -1312,61 +1454,62 @@ delete [] majorTicLengths; delete [] minorTicLengths; - sp->show(); - QApplication::restoreOverrideCursor(); } void Graph3D::updateScalesFromMatrix(double xl, double xr, double yl, double yr, double zl, double zr) { + double zmin = qMin(zl, zr); + double zmax = qMax(zl, zr); + double xStart = qMin(d_matrix->xStart(), d_matrix->xEnd()); double xEnd = qMax(d_matrix->xStart(), d_matrix->xEnd()); double yStart = qMin(d_matrix->yStart(), d_matrix->yEnd()); double yEnd = qMax(d_matrix->yStart(), d_matrix->yEnd()); double dx = d_matrix->dx(); double dy = d_matrix->dy(); - double x_begin = qMin(xl, xr); + double x_begin = qMin(xl, xr); double y_begin = qMin(yl, yr); - int nc = int(fabs(xr - xl)/dx) + 1;// new number of columns - int nr = int(fabs(yr - yl)/dy) + 1;// new number of rows + + int nc = qRound(fabs(xr - xl)/dx) + 1;// new number of columns + int nr = qRound(fabs(yr - yl)/dy) + 1;// new number of rows + double **data_matrix = Matrix::allocateMatrixData(nc, nr); for (int i = 0; i < nc; i++){ double x = x_begin + i*dx; if (x < xStart || x > xEnd){ for (int j = 0; j < nr; j++) - data_matrix[i][j] = GSL_NAN; - continue; + data_matrix[i][j] = zmin; } - double dli, dlf; - dlf = modf(fabs((x - xStart)/dx), &dli); - int l = int(dli); if (dlf > 0.5) l++; + double dli, dlf; + dlf = modf(fabs((x - xStart)/dx), &dli); + int l = qRound(dli); if (dlf > 0.5) l++; for (int j = 0; j < nr; j++){ double y = y_begin + j*dy; - if (y < yStart || y > yEnd){ - data_matrix[i][j] = GSL_NAN; - continue; - } + if (y < yStart || y > yEnd) + data_matrix[i][j] = zmin; double dki, dkf; dkf = modf(fabs((y - yStart)/dy), &dki); - int k = int(dki); if (dkf > 0.5) k++; + int k = qRound(dki); if (dkf > 0.5) k++; double val = d_matrix->cell(k, l); - - if (val > zr) - data_matrix[i][j] = zr; - else if (val < zl) - data_matrix[i][j] = zl; + if (val > zmax) + data_matrix[i][j] = zmax; + else if (val < zmin) + data_matrix[i][j] = zmin; else data_matrix[i][j] = val; } } - sp->loadFromData(data_matrix, nc, nr, xl, xr, yl, yr); + if (!d_active_curve) + d_active_curve = addCurve(); + d_active_curve->loadFromData(data_matrix, nc, nr, xl, xr, yl, yr); Matrix::freeMatrixData(data_matrix, nc); - sp->coordinates()->setPosition(Triple(xl, yl, zl), Triple(xr, yr, zr)); - sp->legend()->setLimits(zl, zr); - sp->legend()->setMajors(legendMajorTicks); + sp->createCoordinateSystem(Triple(xl, yl, zmin), Triple(xr, yr, zmax)); + d_active_curve->legend()->setLimits(zmin, zmax); + d_active_curve->legend()->setMajors(legendMajorTicks); update(); } @@ -1410,7 +1553,8 @@ } } - sp->loadFromData(data, xmesh, ymesh, xl, xr, yl, yr); + if (d_active_curve) + d_active_curve->loadFromData(data, xmesh, ymesh, xl, xr, yl, yr); sp->createCoordinateSystem(Triple(xl, yl, zl), Triple(xr, yr, zr)); Matrix::freeMatrixData(data, xmesh); } @@ -1515,7 +1659,8 @@ void Graph3D::setNumbersColor(const QColor& numColor) { if(numCol != numColor){ - sp->legend()->axis()->setNumberColor(Qt2GL(numColor)); + if (d_active_curve) + d_active_curve->legend()->axis()->setNumberColor(Qt2GL(numColor)); sp->coordinates()->setNumberColor(Qt2GL(numColor)); numCol = numColor; } @@ -1561,7 +1706,8 @@ QFont font = sp->coordinates()->axes[X1].numberFont(); font.setPointSizeFloat(font.pointSizeFloat()*factor); sp->coordinates()->setNumberFont (font); - sp->legend()->axis()->setNumberFont (font); + if (d_active_curve) + d_active_curve->legend()->axis()->setNumberFont (font); titleFnt.setPointSizeFloat(factor*titleFnt.pointSizeFloat()); sp->setTitleFont(titleFnt.family(),titleFnt.pointSize(),titleFnt.weight(),titleFnt.italic()); @@ -1619,12 +1765,11 @@ void Graph3D::setPolygonStyle() { - if (sp->plotStyle() == FILLED) + if (!d_active_curve || d_active_curve->plotStyle() == FILLED) return; sp->makeCurrent(); - sp->setPlotStyle(FILLED); - sp->updateData(); + d_active_curve->setPlotStyle(FILLED); sp->updateGL(); style_=FILLED; @@ -1633,12 +1778,11 @@ void Graph3D::setFilledMeshStyle() { - if (sp->plotStyle() == FILLEDMESH) + if (!d_active_curve || d_active_curve->plotStyle() == FILLEDMESH) return; sp->makeCurrent(); - sp->setPlotStyle(FILLEDMESH); - sp->updateData(); + d_active_curve->setPlotStyle(FILLEDMESH); sp->updateGL(); style_=FILLEDMESH; @@ -1647,13 +1791,12 @@ void Graph3D::setHiddenLineStyle() { - if (sp->plotStyle() == HIDDENLINE) + if (!d_active_curve || d_active_curve->plotStyle() == HIDDENLINE) return; sp->makeCurrent(); - sp->setPlotStyle(HIDDENLINE); + d_active_curve->setPlotStyle(HIDDENLINE); sp->showColorLegend(false); - sp->updateData(); sp->updateGL(); style_=HIDDENLINE; @@ -1663,13 +1806,12 @@ void Graph3D::setWireframeStyle() { - if (sp->plotStyle() == WIREFRAME) + if (!d_active_curve || d_active_curve->plotStyle() == WIREFRAME) return; sp->makeCurrent(); - sp->setPlotStyle(WIREFRAME); + d_active_curve->setPlotStyle(WIREFRAME); sp->showColorLegend(false); - sp->updateData(); sp->updateGL(); pointStyle = None; @@ -1679,25 +1821,31 @@ void Graph3D::setDotStyle() { + if (!d_active_curve) + return; + pointStyle=Dots; style_=Qwt3D::USER; sp->makeCurrent(); - sp->setPlotStyle(Dot(d_point_size, d_smooth_points)); - sp->updateData(); + Dot dot = Dot(d_point_size, d_smooth_points); + d_active_curve->setPlotStyle(dot); sp->updateGL(); } void Graph3D::setConeStyle() { + if (!d_active_curve) + return; + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); pointStyle=Cones; style_=Qwt3D::USER; sp->makeCurrent(); - sp->setPlotStyle(Cone3D(conesRad, conesQuality)); - sp->updateData(); + Cone3D cone = Cone3D(conesRad, conesQuality); + d_active_curve->setPlotStyle(cone); sp->updateGL(); QApplication::restoreOverrideCursor(); @@ -1705,12 +1853,15 @@ void Graph3D::setCrossStyle() { + if (!d_active_curve) + return; + pointStyle=HairCross; style_=Qwt3D::USER; sp->makeCurrent(); - sp->setPlotStyle(CrossHair(crossHairRad, crossHairLineWidth,crossHairSmooth,crossHairBoxed)); - sp->updateData(); + CrossHair cross = CrossHair(crossHairRad, crossHairLineWidth,crossHairSmooth,crossHairBoxed); + d_active_curve->setPlotStyle(cross); sp->updateGL(); } @@ -1720,21 +1871,21 @@ d_matrix = 0; else if (d_table) d_table = 0; - else if (d_func){ - delete d_func; - d_func = 0; - } + + removeCurve(); + plotAssociation = QString(); d_table_plot_type = NoTable; sp->makeCurrent(); - sp->loadFromData (0, 0, 0, false, false); - sp->updateData(); - sp->updateGL(); + sp->updateData(false); } void Graph3D::setBarStyle() { + if (!d_active_curve) + return; + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); d_table_plot_type = Bars; @@ -1742,53 +1893,50 @@ style_ = Qwt3D::USER; sp->makeCurrent(); - sp->setPlotStyle(Bar(d_bars_rad, d_bar_lines, d_filled_bars, applicationWindow()->d_3D_smooth_mesh)); - sp->updateData(); + + Bar bar = Bar(d_bars_rad, d_bar_lines, d_filled_bars, applicationWindow()->d_3D_smooth_mesh); + d_active_curve->setPlotStyle(bar); sp->updateGL(); QApplication::restoreOverrideCursor(); } void Graph3D::setFloorData() { - if (sp->floorStyle() == FLOORDATA) + if (!d_active_curve || d_active_curve->floorStyle() == FLOORDATA) return; sp->makeCurrent(); - sp->setFloorStyle(FLOORDATA); - sp->updateData(); + d_active_curve->setFloorStyle(FLOORDATA); sp->updateGL(); } void Graph3D::setFloorIsolines() { - if (sp->floorStyle() == FLOORISO) + if (!d_active_curve || d_active_curve->floorStyle() == FLOORISO) return; sp->makeCurrent(); - sp->setFloorStyle(FLOORISO); - sp->updateData(); + d_active_curve->setFloorStyle(FLOORISO); sp->updateGL(); } void Graph3D::setEmptyFloor() { - if (sp->floorStyle() == NOFLOOR) + if (!d_active_curve || d_active_curve->floorStyle() == NOFLOOR) return; sp->makeCurrent(); - sp->setFloorStyle(NOFLOOR); - sp->updateData(); + d_active_curve->setFloorStyle(NOFLOOR); sp->updateGL(); } void Graph3D::setMeshLineWidth(double lw) { - if (sp->meshLineWidth() == lw) + if (!d_active_curve || d_active_curve->meshLineWidth() == lw) return; sp->makeCurrent(); - sp->setMeshLineWidth(lw); - sp->updateData(); + d_active_curve->setMeshLineWidth(lw); sp->updateGL(); } @@ -1797,7 +1945,7 @@ return sp->coordinates()->grids(); } -void Graph3D::setGrid(Qwt3D::SIDE s, bool b) +void Graph3D::setGrid(int s, bool b) { if (!sp) return; @@ -1865,9 +2013,48 @@ if (!printer) return; - QRect rect = printer->pageRect(); + //printing should preserve plot aspect ratio, if possible + double aspect = double(width())/double(height()); + if (aspect < 1) + printer->setOrientation(QPrinter::Portrait); + else + printer->setOrientation(QPrinter::Landscape); + + QRect plotRect = rect(); + QRect paperRect = printer->paperRect(); + if (d_scale_on_print){ + int dpiy = printer->logicalDpiY(); + int margin = (int) ((2/2.54)*dpiy ); // 2 cm margins + + int width = qRound(aspect*printer->height()) - 2*margin; + int x = qRound(abs(printer->width()- width)*0.5); + + plotRect = QRect(x, margin, width, printer->height() - 2*margin); + if (x < margin){ + plotRect.setLeft(margin); + plotRect.setWidth(printer->width() - 2*margin); + } + } else { + int x_margin = (paperRect.width() - plotRect.width())/2; + int y_margin = (paperRect.height() - plotRect.height())/2; + plotRect.moveTo(x_margin, y_margin); + } + QPainter paint(printer); - paint.drawPixmap(rect, sp->renderPixmap(rect.width(), rect.height())); + paint.drawPixmap(plotRect, sp->renderPixmap(plotRect.width(), plotRect.height())); + + if (d_print_cropmarks){ + QRect cr = plotRect; // cropmarks rectangle + cr.addCoords(-1, -1, 2, 2); + paint.save(); + paint.setPen(QPen(QColor(Qt::black), 0.5, Qt::DashLine)); + paint.drawLine(paperRect.left(), cr.top(), paperRect.right(), cr.top()); + paint.drawLine(paperRect.left(), cr.bottom(), paperRect.right(), cr.bottom()); + paint.drawLine(cr.left(), paperRect.top(), cr.left(), paperRect.bottom()); + paint.drawLine(cr.right(), paperRect.top(), cr.right(), paperRect.bottom()); + paint.restore(); + } + paint.end(); } @@ -1917,20 +2104,7 @@ QImage image = pic.toImage(); if (transparent){ - QBitmap mask(size); - mask.fill(Qt::color1); - QPainter p(&mask); - p.setPen(Qt::color0); - - QRgb backgroundPixel = QColor(Qt::white).rgb (); - for (int y = 0; y < image.height(); y++){ - for (int x = 0; x < image.width(); x++){ - QRgb rgb = image.pixel(x, y); - if (rgb == backgroundPixel) // we want the frame transparent - p.drawPoint(x, y); - } - } - p.end(); + QBitmap mask = pic.createMaskFromColor (QColor(Qt::white).rgb ()); pic.setMask(mask); image = pic.toImage(); } @@ -1979,20 +2153,7 @@ QImage image = pic.toImage(); if (transparent){ - QBitmap mask(size); - mask.fill(Qt::color1); - QPainter p(&mask); - p.setPen(Qt::color0); - - QRgb backgroundPixel = QColor(Qt::white).rgb (); - for (int y = 0; y < image.height(); y++){ - for (int x = 0; x < image.width(); x++){ - QRgb rgb = image.pixel(x, y); - if (rgb == backgroundPixel) // we want the frame transparent - p.drawPoint(x, y); - } - } - p.end(); + QBitmap mask = pic.createMaskFromColor (QColor(Qt::white).rgb()); pic.setMask(mask); image = pic.toImage(); } @@ -2094,7 +2255,10 @@ double Graph3D::barsRadius() { - if (sp->plotStyle() == Qwt3D::USER && sp->plotStyle() != Qwt3D::POINTS) + if (!d_active_curve) + return 0.0; + + if (d_active_curve->plotStyle() == Qwt3D::USER && d_active_curve->plotStyle() != Qwt3D::POINTS) return d_bars_rad; else return 0.0; @@ -2201,14 +2365,14 @@ void Graph3D::customPlotStyle(int style) { sp->makeCurrent(); - if (sp->plotStyle() == style) + if (!d_active_curve || d_active_curve->plotStyle() == style) return; switch (style) { case WIREFRAME : { - sp->setPlotStyle(WIREFRAME); + d_active_curve->setPlotStyle(WIREFRAME); style_= WIREFRAME ; pointStyle = None; @@ -2219,7 +2383,7 @@ case FILLED : { - sp->setPlotStyle(FILLED ); + d_active_curve->setPlotStyle(FILLED ); style_= FILLED; pointStyle = None; break; @@ -2227,7 +2391,7 @@ case FILLEDMESH : { - sp->setPlotStyle(FILLEDMESH); + d_active_curve->setPlotStyle(FILLEDMESH); style_= FILLEDMESH; pointStyle = None; break; @@ -2235,7 +2399,7 @@ case HIDDENLINE: { - sp->setPlotStyle(HIDDENLINE); + d_active_curve->setPlotStyle(HIDDENLINE); style_= HIDDENLINE; pointStyle = None; legendOn = false; @@ -2251,7 +2415,7 @@ style_ = Qwt3D::USER; Dot d(d_point_size, d_smooth_points); - sp->setPlotStyle(d); + d_active_curve->setPlotStyle(d); break; } @@ -2259,12 +2423,12 @@ { pointStyle = VerticalBars; style_ = Qwt3D::USER; - sp->setPlotStyle(Bar(d_bars_rad)); + Bar bar = Bar(d_bars_rad); + d_active_curve->setPlotStyle(bar); break; } } - sp->updateData(); sp->updateGL(); } @@ -2296,12 +2460,18 @@ Qwt3D::PLOTSTYLE Graph3D::plotStyle() { - return sp->plotStyle(); + if (!d_active_curve) + return style_; + + return d_active_curve->plotStyle(); } Qwt3D::FLOORSTYLE Graph3D::floorStyle() { - return sp->floorStyle(); + if (d_active_curve) + return d_active_curve->floorStyle(); + + return Qwt3D::NOFLOOR; } Qwt3D::COORDSTYLE Graph3D::coordStyle() @@ -2371,7 +2541,7 @@ st="frame"; t << "Style\t" + st + "\t"; - switch(sp->floorStyle ()) + switch(floorStyle()) { case NOFLOOR: st="nofloor"; @@ -2387,8 +2557,7 @@ } t << st+"\t"; - switch(sp->plotStyle()) - { + switch(plotStyle()){ case USER: if (pointStyle == VerticalBars) { st = "bars\t" + QString::number(d_bars_rad); @@ -2427,6 +2596,7 @@ default: ; } + t << st + "\n"; t << "grids\t"; t << QString::number(sp->coordinates()->grids())+"\n"; @@ -2463,7 +2633,7 @@ t << "options\t"; t << QString::number(legendOn)+"\t"; - t << QString::number(sp->resolution())+"\t"; + t << QString::number(resolution())+"\t"; t << QString::number(labelsDist)+"\n"; t << "numbersFont\t"; @@ -2513,16 +2683,15 @@ t << QString::number(sp->zShift())+"\n"; t << "LineWidth\t"; - t << QString::number(sp->meshLineWidth())+"\n"; + t << QString::number(meshLineWidth())+"\n"; t << "WindowLabel\t" + windowLabel() + "\t" + QString::number(captionPolicy()) + "\n"; t << "Orthogonal\t" + QString::number(sp->ortho())+"\n"; if (d_color_map_file.isEmpty()) t << ColorMapEditor::saveToXmlString(d_color_map); - t << "axisType\t" << scaleType[0] << "\t" << scaleType[1] << "\t" << scaleType[2] << "\n"; - Qwt3D::GridLine gridLine = sp->coordinates()->majorGridLine(Qwt3D::X1); + Qwt3D::GridLine gridLine = sp->coordinates()->majorGridLines()[Qwt3D::X1]; RGBA color = gridLine.color_; QColor c = GL2Qt(color.r, color.g, color.b); @@ -2530,13 +2699,19 @@ t << "\t" + QString::number(gridLine.visible_) + "\t" + c.name() + "\t"; t << QString::number(gridLine.style_) + "\t" + QString::number(gridLine.width_) + "\n"; - gridLine = sp->coordinates()->minorGridLine(Qwt3D::X1); + gridLine = sp->coordinates()->minorGridLines()[Qwt3D::X1]; color = gridLine.color_; c = GL2Qt(color.r, color.g, color.b); t << "\t" + QString::number(gridLine.visible_) + "\t" + c.name() + "\t"; t << QString::number(gridLine.style_) + "\t" + QString::number(gridLine.width_) + "\n"; t << "\n"; + t << ""; + for (int i = 0; i < 3; i++){ + t << QString::number(axisNumericFormat(i)) + "\t"; + t << QString::number(axisNumericPrecision(i)) + "\t"; + } + t << "\n"; t << "\n"; } @@ -2554,60 +2729,57 @@ void Graph3D::setResolution(int r) { - if (sp->resolution() == r) + if (!d_active_curve || (int)d_active_curve->resolution() == r) return; sp->makeCurrent(); - sp->setResolution(r); + d_active_curve->setResolution(r); sp->updateData(); - sp->updateGL(); emit modified(); } void Graph3D::setTitle(const QStringList& lst) { - title=lst[1]; + if (lst.size() < 7) + return; + + setTitle(lst[1], QColor(lst[2]), QFont(lst[3], lst[4].toInt(), lst[5].toInt(), lst[6].toInt())); +} + +void Graph3D::setTitle(const QString& s, const QColor& color, const QFont& font) +{ + title = s; sp->setTitle(title); - titleCol=QColor(lst[2]); - sp->setTitleColor(Qt2GL(titleCol)); - - titleFnt=QFont(lst[3],lst[4].toInt(),lst[5].toInt(),lst[6].toInt()); - sp->setTitleFont(titleFnt.family(),titleFnt.pointSize(),titleFnt.weight(),titleFnt.italic()); -} - -void Graph3D::setTitle(const QString& s,const QColor& color,const QFont& font) -{ - if (title != s){ - title=s; - sp->setTitle(title); - } - - titleCol=color; + titleCol = color; sp->setTitleColor(Qt2GL(color)); + titleFnt = font; + sp->setTitleFont(font.family(), font.pointSize(), font.weight(), font.italic()); +} + +void Graph3D::setTitleFont(const QFont& font) +{ if (titleFnt != font){ - titleFnt=font; - sp->setTitleFont(font.family(),font.pointSize(),font.weight(),font.italic()); - } -} - -void Graph3D::setTitleFont(const QFont& font) -{ - if (titleFnt != font) - { - titleFnt=font; - sp->setTitleFont(font.family(),font.pointSize(),font.weight(),font.italic()); + titleFnt = font; + sp->setTitleFont(font.family(), font.pointSize(), font.weight(), font.italic()); } } void Graph3D::setOptions(const QStringList& lst) { - legendOn=false; + if (lst.size() < 3) + return; + + legendOn = false; if (lst[1].toInt() == 1) - legendOn=true; - sp->showColorLegend(legendOn); - sp->setResolution(lst[2].toInt()); + legendOn = true; + + if (d_active_curve){ + d_active_curve->showColorLegend(legendOn); + d_active_curve->setResolution(lst[2].toInt()); + } + setLabelsDistance(lst[3].toInt()); } @@ -2615,12 +2787,16 @@ { sp->showColorLegend(legend); legendOn = legend; - sp->setResolution(r); + if (d_active_curve) + d_active_curve->setResolution(r); setLabelsDistance(dist); } void Graph3D::setDataColorMap(const QwtLinearColorMap& colorMap) { + if (!d_active_curve) + return; + d_color_map = colorMap; d_color_map_file = QString::null; @@ -2638,7 +2814,7 @@ cv.push_back(rgb); } - col_ = new StandardColor(sp); + col_ = new StandardColor(d_active_curve); col_->setColorVector(cv); sp->setDataColor(col_); @@ -2658,28 +2834,33 @@ void Graph3D::changeTransparency(double t) { + if (!d_active_curve) + return; + if (d_alpha == t) return; d_alpha = t; - Qwt3D::StandardColor* color=(StandardColor*) sp->dataColor (); + Qwt3D::StandardColor* color = (StandardColor*)d_active_curve->dataColor (); color->setAlpha(t); sp->showColorLegend(legendOn); - sp->updateData(); sp->updateGL(); emit modified(); } void Graph3D::setTransparency(double t) { + if (!d_active_curve) + return; + if (d_alpha == t) return; d_alpha = t; - Qwt3D::StandardColor* color=(StandardColor*) sp->dataColor (); + Qwt3D::StandardColor* color = (StandardColor*)d_active_curve->dataColor (); color->setAlpha(t); } @@ -2693,15 +2874,13 @@ void Graph3D::setAntialiasing(bool smooth) { - sp->makeCurrent(); + sp->makeCurrent(); sp->setSmoothMesh(smooth); sp->coordinates()->setLineSmooth(smooth); if (d_table_plot_type == Bars && pointStyle == VerticalBars) - setBarStyle(); - else { - sp->updateData(); - sp->updateGL(); - } + setBarStyle(); + else + sp->updateGL(); } /*! @@ -2738,7 +2917,10 @@ void Graph3D::setDataColorMap(const ColorVector& colors) { - col_ = new StandardColor(sp); + if (!d_active_curve) + return; + + col_ = new StandardColor(d_active_curve); col_->setColorVector(colors); sp->setDataColor(col_); @@ -2840,30 +3022,43 @@ if (g->plotStyle() == Qwt3D::USER ){ switch (pointStyle){ case None : - sp->setPlotStyle(g->plotStyle()); + if (d_active_curve) + d_active_curve->setPlotStyle(g->plotStyle()); break; case Dots : d_point_size = g->pointsSize(); d_smooth_points = g->smoothPoints(); - sp->setPlotStyle(Dot(d_point_size, d_smooth_points)); + if (d_active_curve){ + Dot dot = Dot(d_point_size, d_smooth_points); + d_active_curve->setPlotStyle(dot); + } break; case VerticalBars : setBarRadius(g->barsRadius()); d_bar_lines = g->barLines(); d_filled_bars = g->filledBars(); - sp->setPlotStyle(Bar(d_bars_rad, d_bar_lines, d_filled_bars)); + if (d_active_curve){ + Bar bar = Bar(d_bars_rad, d_bar_lines, d_filled_bars); + d_active_curve->setPlotStyle(bar); + } break; case HairCross : setCrossOptions(g->crossHairRadius(), g->crossHairLinewidth(), g->smoothCrossHair(), g->boxedCrossHair()); - sp->setPlotStyle(CrossHair(crossHairRad, crossHairLineWidth, crossHairSmooth, crossHairBoxed)); + if (d_active_curve){ + CrossHair cross = CrossHair(crossHairRad, crossHairLineWidth, crossHairSmooth, crossHairBoxed); + d_active_curve->setPlotStyle(cross); + } break; case Cones : setConeOptions(g->coneRadius(), g->coneQuality()); - sp->setPlotStyle(Cone3D(conesRad, conesQuality)); + if (d_active_curve){ + Cone3D cone = Cone3D(conesRad, conesQuality); + d_active_curve->setPlotStyle(cone); + } break; } } else @@ -2910,6 +3105,7 @@ for (int i = 0; i < 12; i++){ coord->axes[i].setMajors(gcoord->axes[i].majors()); coord->axes[i].setMinors(gcoord->axes[i].minors()); + coord->axes[i].setNumericFormat(gcoord->axes[i].numericFormat(), gcoord->axes[i].numericPrecision()); Qwt3D::AXIS axis = (Qwt3D::AXIS)i; coord->setMajorGridLines(axis, gcoord->majorGridLine(axis)); @@ -2923,8 +3119,10 @@ setOrthogonal(g->isOrthogonal()); sp->updateData(); - sp->updateGL(); animate(g->isAnimated()); + + d_scale_on_print = g->scaleOnPrint(); + d_print_cropmarks = g->printCropmarksEnabled(); } void Graph3D::setAxisType(int axis, int type) @@ -2978,54 +3176,56 @@ if (date.isEmpty()) date = QDateTime::currentDateTime().toString(Qt::LocalDate); - fList=lst[2].split("\t", QString::SkipEmptyParts); + fList = lst[2].split("\t"); Graph3D *plot = app->newPlot3D(caption); ApplicationWindow::restoreWindowGeometry(app, plot, lst[1]); QString formula = fList[1]; - if (formula.endsWith("(Y)",true)){//Ribbon plot - Table* t = app->table(formula.left(formula.find("_", 0))); - if (!t) - return 0; - - formula.remove("(X)").remove("(Y)"); - QStringList l = formula.split(","); - if (l.size() == 2) - plot->addRibbon(t, l[0], l[1], fList[2].toDouble(), fList[3].toDouble(), - fList[4].toDouble(), fList[5].toDouble(), fList[6].toDouble(), fList[7].toDouble()); - } else if (formula.contains("(Z)",true) > 0){ - Table* t = app->table(formula.left(formula.find("_", 0))); - if (!t) - return 0; - - plot->show(); - formula.remove("(X)").remove("(Y)").remove("(Z)"); - QStringList l = formula.split(","); - if (l.size() == 3) - plot->loadData(t, t->colIndex(l[0]), t->colIndex(l[1]), t->colIndex(l[2]), - fList[2].toDouble(),fList[3].toDouble(), fList[4].toDouble(), - fList[5].toDouble(),fList[6].toDouble(),fList[7].toDouble()); - } else if (formula.startsWith("matrix<",true) && fList[1].endsWith(">",false)){ - formula.remove("matrix<", true).remove(">"); - Matrix* m = app->matrix(formula); - if (!m) - return 0; - - plot->addMatrixData(m, fList[2].toDouble(),fList[3].toDouble(), - fList[4].toDouble(),fList[5].toDouble(),fList[6].toDouble(),fList[7].toDouble()); - } else if (formula.contains(",")){ - QStringList l = formula.split(",", QString::SkipEmptyParts); - plot->addParametricSurface(l[0], l[1], l[2], l[3].toDouble(), l[4].toDouble(), - l[5].toDouble(), l[6].toDouble(), l[7].toInt(), l[8].toInt(), l[9].toInt(), l[10].toInt()); - } else { - QStringList l = formula.split(";", QString::SkipEmptyParts); - if (l.count() == 1) - plot->addFunction(formula, fList[2].toDouble(), fList[3].toDouble(), + if (!formula.isEmpty()){ + if (formula.endsWith("(Y)",true)){//Ribbon plot + Table* t = app->table(formula.left(formula.find("_", 0))); + if (!t) + return 0; + + formula.remove("(X)").remove("(Y)"); + QStringList l = formula.split(","); + if (l.size() == 2) + plot->addRibbon(t, l[0], l[1], fList[2].toDouble(), fList[3].toDouble(), fList[4].toDouble(), fList[5].toDouble(), fList[6].toDouble(), fList[7].toDouble()); - else if (l.count() == 3) - plot->addFunction(l[0], fList[2].toDouble(), fList[3].toDouble(), fList[4].toDouble(), - fList[5].toDouble(), fList[6].toDouble(), fList[7].toDouble(), l[1].toInt(), l[2].toInt()); + } else if (formula.contains("(Z)",true) > 0){ + Table* t = app->table(formula.left(formula.find("_", 0))); + if (!t) + return 0; + + plot->show(); + formula.remove("(X)").remove("(Y)").remove("(Z)"); + QStringList l = formula.split(","); + if (l.size() == 3) + plot->loadData(t, t->colIndex(l[0]), t->colIndex(l[1]), t->colIndex(l[2]), + fList[2].toDouble(),fList[3].toDouble(), fList[4].toDouble(), + fList[5].toDouble(),fList[6].toDouble(),fList[7].toDouble()); + } else if (formula.startsWith("matrix<",true) && fList[1].endsWith(">",false)){ + formula.remove("matrix<", true).remove(">"); + Matrix* m = app->matrix(formula); + if (!m) + return 0; + + plot->addMatrixData(m, fList[2].toDouble(),fList[3].toDouble(), + fList[4].toDouble(),fList[5].toDouble(),fList[6].toDouble(),fList[7].toDouble()); + } else if (formula.contains(",")){ + QStringList l = formula.split(",", QString::SkipEmptyParts); + plot->addParametricSurface(l[0], l[1], l[2], l[3].toDouble(), l[4].toDouble(), + l[5].toDouble(), l[6].toDouble(), l[7].toInt(), l[8].toInt(), l[9].toInt(), l[10].toInt()); + } else { + QStringList l = formula.split(";", QString::SkipEmptyParts); + if (l.count() == 1) + plot->addFunction(formula, fList[2].toDouble(), fList[3].toDouble(), + fList[4].toDouble(), fList[5].toDouble(), fList[6].toDouble(), fList[7].toDouble()); + else if (l.count() == 3) + plot->addFunction(l[0], fList[2].toDouble(), fList[3].toDouble(), fList[4].toDouble(), + fList[5].toDouble(), fList[6].toDouble(), fList[7].toDouble(), l[1].toInt(), l[2].toInt()); + } } if (!plot) @@ -3035,7 +3235,7 @@ plot->setBirthDate(date); plot->setIgnoreFonts(true); - fList=lst[4].split("\t", QString::SkipEmptyParts); + fList = lst[4].split("\t", QString::SkipEmptyParts); plot->setGrid(fList[1].toInt()); plot->setTitle(lst[5].split("\t")); @@ -3087,9 +3287,11 @@ plot->setMeshLineWidth(fList[1].toDouble()); if (fileVersion > 71){ - fList=lst[20].split("\t"); // using QString::SkipEmptyParts here causes a crash for empty window labels - plot->setWindowLabel(fList[1]); - plot->setCaptionPolicy((MdiSubWindow::CaptionPolicy)fList[2].toInt()); + fList = lst[20].split("\t"); // using QString::SkipEmptyParts here causes a crash for empty window labels + if (fList.size() >= 3){ + plot->setWindowLabel(fList[1]); + plot->setCaptionPolicy((MdiSubWindow::CaptionPolicy)fList[2].toInt()); + } } if (fileVersion >= 88){ @@ -3159,6 +3361,19 @@ plot->coordinateSystem()->setMinorGridLines((Qwt3D::AXIS)i, line); } } + line.next(); + } + } + + if (line.hasNext()){ + s = line.next(); + if (s.contains("")){ + fList = s.remove("").remove("").split("\t"); + for (int i = 0; i < 3; i++){ + int aux = 2*i + 1; + if (aux < fList.size()) + plot->setAxisNumericFormat(i, fList[2*i].toInt(), fList[aux].toInt()); + } } } === modified file 'qtiplot/src/plot3D/Graph3D.h' --- qtiplot/src/plot3D/Graph3D.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot3D/Graph3D.h 2010-07-21 23:21:08 +0000 @@ -2,7 +2,7 @@ File : Graph3D.h Project : QtiPlot -------------------------------------------------------------------- - Copyright : (C) 2004-2007 by Ion Vasilief + Copyright : (C) 2004-2010 by Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : 3D graph widget @@ -29,6 +29,7 @@ #ifndef GRAPH3D_H #define GRAPH3D_H +#include #include #include #include @@ -67,9 +68,17 @@ enum PlotType{NoTable = -1, Scatter = 0, Trajectory = 1, Bars = 2, Ribbon = 3}; enum PointStyle{None = 0, Dots = 1, VerticalBars = 2, HairCross = 3, Cones = 4}; + enum AxisNumericFormat{Default = 0, Decimal = 1, Scientific = 2, Engineering = 3}; + static Graph3D* restore(ApplicationWindow* app, const QStringList &lst, int fileVersion); - Qwt3D::SurfacePlot* surface(){return sp;}; + Qwt3D::Plot3D* surface(){return sp;}; + + bool scaleOnPrint(){return d_scale_on_print;}; + void setScaleOnPrint(bool on){d_scale_on_print = on;}; + + bool printCropmarksEnabled(){return d_print_cropmarks;}; + void printCropmarks(bool on){d_print_cropmarks = on;}; public slots: void copy(Graph3D* g); @@ -166,6 +175,10 @@ int axisType(int axis){return scaleType[axis];}; void setAxisType(int axis, int type); + int axisNumericFormat(int axis); + int axisNumericPrecision(int axis); + void setAxisNumericFormat(int axis, int format, int precision); + void setScales(double xl, double xr, double yl, double yr, double zl, double zr); void updateScales(double xl, double xr, double yl, double yr, double zl, double zr, int xcol, int ycol); @@ -199,13 +212,13 @@ void setEmptyFloor(); void setMeshLineWidth(double lw); - double meshLineWidth(){return sp->meshLineWidth();}; + double meshLineWidth(){if (d_active_curve) return d_active_curve->meshLineWidth(); return 0.0;}; //@} //! \name Grid //@{ int grids(); - void setGrid(Qwt3D::SIDE s, bool b); + void setGrid(int s, bool b); void setGrid(int grids); void setLeftGrid(bool b = true); @@ -308,7 +321,7 @@ //! \name Resolution //@{ void setResolution(int r); - int resolution(){return sp->resolution();}; + int resolution(){if (d_active_curve) return d_active_curve->resolution(); return 0;}; //@} //! \name Legend @@ -357,7 +370,7 @@ void setPlotAssociation(const QString& s){plotAssociation = s;}; void setAntialiasing(bool smooth = true); - bool antialiasing(){return sp->smoothDataMesh();}; + bool antialiasing(){if (d_active_curve) return d_active_curve->smoothDataMesh(); return false;}; //! Used for the animation: rotates the scene with 1/360 degrees void rotate(); @@ -377,6 +390,9 @@ void modified(); private: + Curve* addCurve(); + void removeCurve(); + void resetAxesType(); //! Wait this many msecs before redraw 3D plot (used for animations) int animation_redraw_wait; @@ -389,6 +405,7 @@ QStringList labels; QFont titleFnt; bool legendOn, d_autoscale; + bool d_scale_on_print, d_print_cropmarks; QVector scaleType; QColor axesCol, labelsCol, titleCol, meshCol, bgCol, numCol, gridCol; int labelsDist, legendMajorTicks; @@ -411,18 +428,19 @@ PointStyle pointStyle; Table *d_table; Matrix *d_matrix; - Qwt3D::SurfacePlot* sp; + Qwt3D::Plot3D* sp; UserFunction *d_func; UserParametricSurface *d_surface; Qwt3D::PLOTSTYLE style_; PlotType d_table_plot_type; + Curve * d_active_curve; }; //! Class for user defined surfaces class UserFunction : public Function { public: - UserFunction(const QString& s, SurfacePlot& pw); + UserFunction(const QString& s, Qwt3D::Curve *pw); double operator()(double x, double y); QString function(){return formula;}; @@ -441,7 +459,7 @@ { public: UserParametricSurface(const QString& xFormula, const QString& yFormula, - const QString& zFormula, SurfacePlot& pw); + const QString& zFormula, Qwt3D::Curve *pw); Triple operator()(double u, double v); unsigned int rows(){return d_rows;}; === modified file 'qtiplot/src/plot3D/Plot3DDialog.cpp' --- qtiplot/src/plot3D/Plot3DDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot3D/Plot3DDialog.cpp 2010-07-21 23:21:08 +0000 @@ -55,36 +55,6 @@ #include -static const char* choose_folder_xpm[]={ - "16 16 11 1", - "# c #000000", - "g c #c0c0c0", - "e c #303030", - "a c #ffa858", - "b c #808080", - "d c #a0a0a4", - "f c #585858", - "c c #ffdca8", - "h c #dcdcdc", - "i c #ffffff", - ". c None", - "....###.........", - "....#ab##.......", - "....#acab####...", - "###.#acccccca#..", - "#ddefaaaccccca#.", - "#bdddbaaaacccab#", - ".eddddbbaaaacab#", - ".#bddggdbbaaaab#", - "..edgdggggbbaab#", - "..#bgggghghdaab#", - "...ebhggghicfab#", - "....#edhhiiidab#", - "......#egiiicfb#", - "........#egiibb#", - "..........#egib#", - "............#ee#"}; - Plot3DDialog::Plot3DDialog( QWidget* parent, Qt::WFlags fl ) : QDialog( parent, fl ) { @@ -114,6 +84,7 @@ initTitlePage(); initColorsPage(); initGeneralPage(); + initPrintPage(); QVBoxLayout* vl = new QVBoxLayout(this); vl->addWidget(generalDialog); @@ -125,6 +96,21 @@ connect( btnTable, SIGNAL( clicked() ), this, SLOT(worksheet() ) ); } +void Plot3DDialog::initPrintPage() +{ + printPage = new QWidget(); + QVBoxLayout *printLayout = new QVBoxLayout( printPage ); + + boxScaleOnPrint = new QCheckBox(tr("Scale to paper si&ze")); + printLayout->addWidget( boxScaleOnPrint ); + + boxPrintCropmarks = new QCheckBox(tr("Print Crop&marks")); + printLayout->addWidget( boxPrintCropmarks ); + printLayout->addStretch(); + + generalDialog->addTab(printPage, tr( "&Print" ) ); +} + void Plot3DDialog::initScalesPage() { axesList = new QListWidget(); @@ -136,49 +122,69 @@ ApplicationWindow *app = (ApplicationWindow *)parent(); - QGridLayout *gl1 = new QGridLayout(); - gl1->addWidget(new QLabel(tr("From")), 0, 0); + QGridLayout *gl1 = new QGridLayout(); + gl1->addWidget(new QLabel(tr("From")), 0, 0); boxFrom = new DoubleSpinBox(); boxFrom->setLocale(app->locale()); - boxFrom->setDecimals(app->d_decimal_digits); - gl1->addWidget(boxFrom, 0, 1); + boxFrom->setDecimals(app->d_decimal_digits); + gl1->addWidget(boxFrom, 0, 1); - gl1->addWidget(new QLabel(tr("To")), 1, 0); + gl1->addWidget(new QLabel(tr("To")), 1, 0); boxTo = new DoubleSpinBox(); boxTo->setLocale(app->locale()); - boxTo->setDecimals(app->d_decimal_digits); - gl1->addWidget(boxTo, 1, 1); + boxTo->setDecimals(app->d_decimal_digits); + gl1->addWidget(boxTo, 1, 1); - gl1->addWidget(new QLabel(tr("Type")), 2, 0); + gl1->addWidget(new QLabel(tr("Type")), 2, 0); boxType=new QComboBox(); boxType->addItem(tr("linear")); boxType->addItem(tr("logarithmic")); boxType->setMaximumWidth(150); - gl1->addWidget(boxType, 2, 1); - gl1->setRowStretch(3, 1); - - QGroupBox *gb1 = new QGroupBox(); - gb1->setLayout(gl1); - - QGridLayout *gl2 = new QGridLayout(); - gl2->addWidget(new QLabel(tr("Major Ticks")), 0, 0); + gl1->addWidget(boxType, 2, 1); + gl1->setRowStretch(3, 1); + + QGroupBox *gb1 = new QGroupBox(); + gb1->setLayout(gl1); + + QGridLayout *gl2 = new QGridLayout(); + gl2->addWidget(new QLabel(tr("Major Ticks")), 0, 0); boxMajors = new QSpinBox(); - gl2->addWidget(boxMajors, 0, 1); - gl2->addWidget(new QLabel(tr("Minor Ticks")), 1, 0); + gl2->addWidget(boxMajors, 0, 1); + gl2->addWidget(new QLabel(tr("Minor Ticks")), 1, 0); boxMinors = new QSpinBox(); - gl2->addWidget(boxMinors, 1, 1); - gl2->setRowStretch(2, 1); - - TicksGroupBox = new QGroupBox(); - TicksGroupBox->setLayout(gl2); + gl2->addWidget(boxMinors, 1, 1); + gl2->setRowStretch(2, 1); + + TicksGroupBox = new QGroupBox(); + TicksGroupBox->setLayout(gl2); + + QGroupBox *tickLabelsGroupBox = new QGroupBox(tr("Tick Labels")); + QGridLayout *gl3 = new QGridLayout(tickLabelsGroupBox); + gl3->addWidget(new QLabel(tr("Format")), 0, 0); + boxTickLabelsFormat = new QComboBox(); + boxTickLabelsFormat->insertItem(tr("Automatic")); + boxTickLabelsFormat->insertItem(tr("Decimal: 10000.0")); + boxTickLabelsFormat->insertItem(tr("Scientific: 1e4")); + boxTickLabelsFormat->insertItem(tr("Engineering: 10k")); + + gl3->addWidget(boxTickLabelsFormat, 0, 1); + gl3->addWidget(new QLabel(tr("Precision")), 1, 0); + boxPrecision = new QSpinBox(); + boxPrecision->setMaximum(14); + gl3->addWidget(boxPrecision, 1, 1); + gl3->setRowStretch(2, 1); + + QVBoxLayout* vb = new QVBoxLayout(); + vb->addWidget(TicksGroupBox); + vb->addWidget(tickLabelsGroupBox); QHBoxLayout* hb = new QHBoxLayout(); hb->addWidget(axesList); hb->addWidget(gb1, 1); - hb->addWidget(TicksGroupBox, 1); + hb->addLayout(vb, 1); - scale = new QWidget(); - scale->setLayout(hb); + scale = new QWidget(); + scale->setLayout(hb); generalDialog->insertTab(scale, tr( "&Scale" ) ); } @@ -293,7 +299,7 @@ QGridLayout* layout = new QGridLayout(colorMapFileGroupBox); btnColorMap = new QPushButton(); - btnColorMap->setIcon(QIcon(QPixmap(choose_folder_xpm))); + btnColorMap->setIcon(QIcon(":/folder_open.png")); layout->addWidget(btnColorMap, 0, 0); colorMapPreviewLabel = new QLabel(tr("None")); @@ -379,7 +385,7 @@ boxMeshLineWidth = new QDoubleSpinBox(); boxMeshLineWidth->setDecimals(1); boxMeshLineWidth->setSingleStep(0.1); - boxMeshLineWidth->setRange(1, 100); + boxMeshLineWidth->setRange(0, 100); gl1->addWidget(boxMeshLineWidth, 1, 1); gl1->addWidget(new QLabel( tr( "Resolution" )), 2, 0); @@ -697,6 +703,7 @@ zAxisFont = g->zAxisLabelFont(); viewScaleLimits(0); + viewAxisOptions(0); boxDistance->setValue(g->labelsDistance()); numbersFont = g->numbersFont(); @@ -757,6 +764,9 @@ else if (g->matrix()) btnTable->setText(tr("&Matrix")); + boxPrintCropmarks->setChecked(g->printCropmarksEnabled()); + boxScaleOnPrint->setChecked(g->scaleOnPrint()); + initConnections(); } @@ -767,6 +777,8 @@ connect(boxTo, SIGNAL(valueChanged(double)), this, SLOT(updatePlot())); connect(boxMajors, SIGNAL(valueChanged(int)), this, SLOT(updatePlot())); connect(boxMinors, SIGNAL(valueChanged(int)), this, SLOT(updatePlot())); + connect(boxPrecision, SIGNAL(valueChanged(int)), this, SLOT(updatePlot())); + connect(boxTickLabelsFormat, SIGNAL(activated(int)), this, SLOT(updatePlot())); connect(axesList, SIGNAL(currentRowChanged(int)), this, SLOT(viewScaleLimits(int))); // axes page connections @@ -822,6 +834,7 @@ boxBarsRad->setLocale(app->locale()); boxBarsRad->setDecimals(app->d_decimal_digits); boxBarsRad->setValue(d_plot->barsRadius()); + boxBarsRad->setMinimum(0.0); hb->addWidget(boxBarsRad, 0, 1); boxBarLines = new QCheckBox(tr("Draw lines")); @@ -946,6 +959,13 @@ boxMinorLength->blockSignals(false); axesList->setCurrentRow(axis); + + boxTickLabelsFormat->blockSignals(true); + boxTickLabelsFormat->setCurrentIndex(d_plot->axisNumericFormat(axis)); + boxTickLabelsFormat->blockSignals(false); + boxPrecision->blockSignals(true); + boxPrecision->setValue(d_plot->axisNumericPrecision(axis)); + boxPrecision->blockSignals(false); } void Plot3DDialog::viewScaleLimits(int axis) @@ -1061,9 +1081,13 @@ d_plot->setNumbersFont(numbersFont); d_plot->setZoom(zoom*boxZoom->value()*0.01); d_plot->setScale(xScale*boxXScale->value()*0.01, yScale*boxYScale->value()*0.01, zScale*boxZScale->value()*0.01); - } else if (generalDialog->currentPage()==(QWidget*)scale){ - d_plot->setScale(axesList->currentRow(), boxFrom->value(), boxTo->value(), boxMajors->value(), + } else if (generalDialog->currentPage() == (QWidget*)scale){ + double start = qMin(boxFrom->value(), boxTo->value()); + double end = qMax(boxFrom->value(), boxTo->value()); + d_plot->setScale(axesList->currentRow(), start, end, boxMajors->value(), boxMinors->value(), (Qwt3D::SCALETYPE)boxType->currentIndex()); + + d_plot->setAxisNumericFormat(axesList->currentRow(), boxTickLabelsFormat->currentIndex(), boxPrecision->value()); } else if (generalDialog->currentPage() == axes){ int axis = axesList2->currentRow(); labels[axis] = boxLabel->text(); @@ -1086,6 +1110,9 @@ d_plot->setZAxisTickLength(boxMajorLength->text().toDouble(), boxMinorLength->text().toDouble()); break; } + } else if (generalDialog->currentPage() == printPage){ + d_plot->printCropmarks(boxPrintCropmarks->isChecked()); + d_plot->setScaleOnPrint(boxScaleOnPrint->isChecked()); } d_plot->update(); === modified file 'qtiplot/src/plot3D/Plot3DDialog.h' --- qtiplot/src/plot3D/Plot3DDialog.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot3D/Plot3DDialog.h 2010-07-21 23:21:08 +0000 @@ -97,6 +97,7 @@ void initGridPage(); void initColorsPage(); void initGeneralPage(); + void initPrintPage(); void setColorMapPreview(const QString& fileName); void showBarsTab(); @@ -118,7 +119,7 @@ ColorButton *btnBackground, *btnMesh, *btnAxes, *btnTitleColor, *btnLabels, *btnNumbers, *btnGrid, *btnGridMinor; ColorMapEditor *d_color_map_editor; QTabWidget* generalDialog; - QWidget *scale, *colors, *general, *axes, *title, *bars, *points, *gridPage; + QWidget *scale, *colors, *general, *axes, *title, *bars, *points, *gridPage, *printPage; DoubleSpinBox *boxFrom, *boxTo; QTextEdit *boxTitle, *boxLabel; QSpinBox *boxMajors, *boxMinors; @@ -128,16 +129,16 @@ QListWidget *axesList, *axesList2; QComboBox *boxType, *boxPointStyle; DoubleSpinBox *boxMajorLength, *boxMinorLength, *boxConesRad; - QSpinBox *boxZoom, *boxXScale, *boxYScale, *boxZScale, *boxQuality; + QSpinBox *boxZoom, *boxXScale, *boxYScale, *boxZScale, *boxQuality, *boxPrecision; DoubleSpinBox *boxSize, *boxBarsRad, *boxCrossRad, *boxCrossLinewidth; QStackedWidget *optionStack; QWidget *dotsPage, *conesPage, *crossPage; - QCheckBox *boxBarLines, *boxFilledBars; + QCheckBox *boxBarLines, *boxFilledBars, *boxScaleOnPrint, *boxPrintCropmarks; TextFormatButtons *titleFormatButtons, *axisTitleFormatButtons; double zoom, xScale, yScale, zScale; QString d_color_map_file; DoubleSpinBox *boxMajorGridWidth, *boxMinorGridWidth; - QComboBox *boxMajorGridStyle, *boxMinorGridStyle; + QComboBox *boxMajorGridStyle, *boxMinorGridStyle, *boxTickLabelsFormat; QCheckBox *boxMajorGrids, *boxMinorGrids; }; === modified file 'qtiplot/src/plot3D/SurfaceDialog.cpp' --- qtiplot/src/plot3D/SurfaceDialog.cpp 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot3D/SurfaceDialog.cpp 2010-07-21 23:21:08 +0000 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -44,6 +45,7 @@ #include #include #include +#include SurfaceDialog::SurfaceDialog( QWidget* parent, Qt::WFlags fl ) : QDialog( parent, fl ) @@ -65,7 +67,7 @@ initFunctionPage(); initParametricSurfacePage(); - buttonClear = new QPushButton(tr("Clear &list")); + buttonClear = new QPushButton(tr("Clea&r")); buttonOk = new QPushButton(tr("&OK")); buttonOk->setDefault(true); buttonCancel = new QPushButton(tr("&Close")); @@ -81,39 +83,40 @@ vl->addWidget(optionStack); vl->addLayout(bl2); - ApplicationWindow *app = (ApplicationWindow *)parent; - if (app){ - boxFunction->insertItems(0, app->surfaceFunc); - boxX->setCompleter (new QCompleter(app->d_param_surface_func)); - boxY->setCompleter (new QCompleter(app->d_param_surface_func)); - boxZ->setCompleter (new QCompleter(app->d_param_surface_func)); - } - d_graph = 0; setFocusProxy(boxFunction); connect( boxType, SIGNAL(activated(int)), optionStack, SLOT(setCurrentIndex(int))); - connect( buttonClear, SIGNAL(clicked()), this, SLOT(clearList())); + connect( buttonClear, SIGNAL(clicked()), this, SLOT(clearFunction())); connect( buttonOk, SIGNAL(clicked()), this, SLOT(accept())); connect( buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); } void SurfaceDialog::initFunctionPage() { - boxFunction = new QComboBox(); - boxFunction->setEditable(true); + ApplicationWindow *app = (ApplicationWindow *)parent(); + QLocale locale = QLocale(); + + boxFunction = new ScriptEdit(app->scriptingEnv()); + boxFunction->enableShortcuts(); + boxFunction->setFocus(); QBoxLayout *bl1 = new QBoxLayout (QBoxLayout::LeftToRight); - bl1->addWidget(new QLabel( tr("f(x,y)=")), 1); + + QVBoxLayout *vl1 = new QVBoxLayout(); + vl1->addWidget(new QLabel( tr("f(x,y)="))); + + buttonRecentFunc = new QPushButton(tr("Rece&nt")); + buttonRecentFunc->setToolTip(tr("Click here to select a recently typed expression")); + connect(buttonRecentFunc, SIGNAL(clicked()), this, SLOT(showFunctionLog())); + vl1->addWidget(buttonRecentFunc); + vl1->addStretch(); + + bl1->addLayout(vl1, 1); bl1->addWidget(boxFunction, 10); QGroupBox *gb1 = new QGroupBox(tr("X - axis")); - ApplicationWindow *app = (ApplicationWindow *)parent(); - QLocale locale = QLocale(); - if (app) - locale = app->locale(); - boxXFrom = new DoubleSpinBox(); boxXFrom->setLocale(locale); @@ -127,6 +130,7 @@ gl1->addWidget(new QLabel(tr("To")), 1, 0); gl1->addWidget(boxXTo, 1, 1); gl1->setRowStretch(2, 1); + gl1->setColumnStretch(1, 10); gb1->setLayout(gl1); QGroupBox *gb2 = new QGroupBox(tr("Y - axis")); @@ -142,6 +146,7 @@ gl2->addWidget(new QLabel(tr("To")), 1, 0); gl2->addWidget(boxYTo, 1, 1); gl2->setRowStretch(2, 1); + gl2->setColumnStretch(1, 10); gb2->setLayout(gl2); QGroupBox *gb3 = new QGroupBox(tr("Z - axis")); @@ -157,6 +162,7 @@ gl3->addWidget(new QLabel(tr("To")), 1, 0); gl3->addWidget(boxZTo, 1, 1); gl3->setRowStretch(2, 1); + gl3->setColumnStretch(1, 10); gb3->setLayout(gl3); QBoxLayout *bl2 = new QBoxLayout (QBoxLayout::LeftToRight); @@ -182,34 +188,76 @@ functionPage = new QWidget(); QVBoxLayout* vl = new QVBoxLayout(functionPage); - vl->addLayout(bl1); + vl->addLayout(bl1); vl->addLayout(bl2); vl->addWidget(gb4); + vl->addStretch(); optionStack->addWidget(functionPage); } void SurfaceDialog::initParametricSurfacePage() { - boxX = new QLineEdit(); - boxY = new QLineEdit(); - boxZ = new QLineEdit(); + ApplicationWindow *app = (ApplicationWindow *)parent(); + QLocale locale = QLocale(); + int prec = 6; + if (app) + prec = app->d_decimal_digits; + + int maxH = 80; + boxX = new ScriptEdit(app->scriptingEnv()); + boxX->setMaximumHeight(maxH); + boxX->enableShortcuts(); + + boxY = new ScriptEdit(app->scriptingEnv()); + boxY->setMaximumHeight(maxH); + boxY->enableShortcuts(); + + boxZ = new ScriptEdit(app->scriptingEnv()); + boxZ->setMaximumHeight(maxH); + boxZ->enableShortcuts(); + + QString recentTip = tr("Click here to select a recently typed expression"); + QString recentBtnText = tr("Rece&nt"); + + buttonXLog = new QPushButton(recentBtnText); + buttonXLog->setToolTip(recentTip); + connect(buttonXLog, SIGNAL(clicked()), this, SLOT(showXLog())); + + buttonYLog = new QPushButton(recentBtnText); + buttonYLog->setToolTip(recentTip); + connect(buttonYLog, SIGNAL(clicked()), this, SLOT(showYLog())); + + buttonZLog = new QPushButton(recentBtnText); + buttonZLog->setToolTip(recentTip); + connect(buttonZLog, SIGNAL(clicked()), this, SLOT(showZLog())); QGroupBox *gb = new QGroupBox(tr("Equations")); QGridLayout *gl = new QGridLayout(gb); gl->addWidget(new QLabel( tr("X(u,v)=")), 0, 0); gl->addWidget(boxX, 0, 1); + gl->addWidget(buttonXLog, 0, 2); + gl->addWidget(new QLabel(tr("Y(u,v)=")), 1, 0); gl->addWidget(boxY, 1, 1); + gl->addWidget(buttonYLog, 1, 2); + gl->addWidget(new QLabel(tr("Z(u,v)=")), 2, 0); gl->addWidget(boxZ, 2, 1); + gl->addWidget(buttonZLog, 2, 2); + gl->setRowStretch(3, 1); QGroupBox *gb1 = new QGroupBox(tr("u")); - boxUFrom = new QLineEdit(); - boxUFrom->setText("0"); - boxUTo = new QLineEdit(); - boxUTo->setText("pi"); + boxUFrom = new DoubleSpinBox(); + boxUFrom->setDecimals(prec); + boxUFrom->setLocale(locale); + + boxUTo = new DoubleSpinBox(); + boxUTo->setLocale(locale); + boxUTo->setDecimals(prec); + boxUTo->setValue(M_PI); + QGridLayout *gl1 = new QGridLayout(); gl1->addWidget(new QLabel( tr("From")), 0, 0); gl1->addWidget(boxUFrom, 0, 1); @@ -218,14 +266,18 @@ boxUPeriodic = new QCheckBox(tr("Periodic")); gl1->addWidget(boxUPeriodic, 2, 1); gl1->setRowStretch(3, 1); + gl1->setColumnStretch(1, 10); gb1->setLayout(gl1); QGroupBox *gb2 = new QGroupBox(tr("v")); - boxVFrom = new QLineEdit(); - boxVFrom->setText("0"); + boxVFrom = new DoubleSpinBox(); + boxVFrom->setDecimals(prec); + boxVFrom->setLocale(locale); - boxVTo = new QLineEdit(); - boxVTo->setText("pi"); + boxVTo = new DoubleSpinBox(); + boxVTo->setLocale(locale); + boxVTo->setDecimals(prec); + boxVTo->setValue(M_PI); QGridLayout *gl2 = new QGridLayout(); gl2->addWidget(new QLabel( tr("From")), 0, 0); @@ -235,6 +287,7 @@ boxVPeriodic = new QCheckBox(tr("Periodic")); gl2->addWidget(boxVPeriodic, 2, 1); gl2->setRowStretch(3, 1); + gl2->setColumnStretch(1, 10); gb2->setLayout(gl2); QGroupBox *gb3 = new QGroupBox(tr("Mesh")); @@ -268,17 +321,14 @@ optionStack->addWidget(parametricPage); } -void SurfaceDialog::clearList() +void SurfaceDialog::clearFunction() { - ApplicationWindow *app = (ApplicationWindow *)this->parent(); - - if (app && boxType->currentIndex()) - app->d_param_surface_func.clear(); - else { - boxFunction->clear(); - if (app) - app->clearSurfaceFunctionsList(); - } + if (boxType->currentIndex()){ + boxX->clear(); + boxY->clear(); + boxZ->clear(); + } else + boxFunction->clear(); } void SurfaceDialog::setFunction(Graph3D *g) @@ -291,7 +341,7 @@ if (!f) return; - boxFunction->setCurrentText(f->function()); + boxFunction->setText(f->function()); boxFuncColumns->setValue(f->columns()); boxFuncRows->setValue(f->rows()); boxXFrom->setValue(g->xStart()); @@ -320,7 +370,7 @@ parser.DefineVar("v", &v); int list_size = 15; - QString x_formula = boxX->text(); + QString x_formula = boxX->text().simplified(); try { parser.SetExpr(x_formula.ascii()); parser.Eval(); @@ -335,7 +385,7 @@ while ((int)app->d_param_surface_func.size() > list_size) app->d_param_surface_func.pop_back(); - QString y_formula = boxY->text(); + QString y_formula = boxY->text().simplified(); try { parser.SetExpr(y_formula.ascii()); parser.Eval(); @@ -350,7 +400,7 @@ while ((int)app->d_param_surface_func.size() > list_size) app->d_param_surface_func.pop_back(); - QString z_formula = boxZ->text(); + QString z_formula = boxZ->text().simplified(); try { parser.SetExpr(z_formula.ascii()); parser.Eval(); @@ -365,50 +415,10 @@ while ((int)app->d_param_surface_func.size() > list_size) app->d_param_surface_func.pop_back(); - QString ufrom = boxUFrom->text().lower(); - QString uto = boxUTo->text().lower(); - QString vfrom = boxVFrom->text().lower(); - QString vto = boxVTo->text().lower(); - double ul, ur, vl, vr; - try{ - parser.SetExpr(ufrom.ascii()); - ul = parser.Eval(); - } - catch(mu::ParserError &e){ - QMessageBox::critical(app, tr("QtiPlot - u start limit error"), QString::fromStdString(e.GetMsg())); - boxUFrom->setFocus(); - return; - } - - try{ - parser.SetExpr(uto.ascii()); - ur = parser.Eval(); - } - catch(mu::ParserError &e){ - QMessageBox::critical(app, tr("QtiPlot - u end limit error"), QString::fromStdString(e.GetMsg())); - boxUTo->setFocus(); - return; - } - - try{ - parser.SetExpr(vfrom.ascii()); - vl = parser.Eval(); - } - catch(mu::ParserError &e){ - QMessageBox::critical(app, tr("QtiPlot - v start limit error"), QString::fromStdString(e.GetMsg())); - boxVFrom->setFocus(); - return; - } - - try{ - parser.SetExpr(vto.ascii()); - vr = parser.Eval(); - } - catch(mu::ParserError &e){ - QMessageBox::critical(app, tr("QtiPlot - u end limit error"), QString::fromStdString(e.GetMsg())); - boxVTo->setFocus(); - return; - } + double ul = boxUFrom->value(); + double ur = boxUTo->value(); + double vl = boxVFrom->value(); + double vr = boxVTo->value(); QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); if (!d_graph) @@ -441,7 +451,7 @@ return; } - QString formula = boxFunction->currentText(); + QString formula = boxFunction->text().simplified(); bool error = false; try{ MyParser parser; @@ -463,13 +473,13 @@ if (!error){ QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); if (!d_graph) - app->plotSurface(boxFunction->currentText(), fromX, toX, fromY, toY, fromZ, toZ, + app->plotSurface(formula, fromX, toX, fromY, toY, fromZ, toZ, boxFuncColumns->value(), boxFuncRows->value()); else - d_graph->addFunction(boxFunction->currentText(),fromX, toX, fromY, toY, fromZ, toZ, + d_graph->addFunction(formula,fromX, toX, fromY, toY, fromZ, toZ, boxFuncColumns->value(), boxFuncRows->value()); - app->updateSurfaceFuncList(boxFunction->currentText()); + app->updateSurfaceFuncList(formula); QApplication::restoreOverrideCursor(); close(); } @@ -490,10 +500,10 @@ boxY->setText(s->yFormula()); boxZ->setText(s->zFormula()); - boxUFrom->setText(QString::number(s->uStart())); - boxUTo->setText(QString::number(s->uEnd())); - boxVFrom->setText(QString::number(s->vStart())); - boxVTo->setText(QString::number(s->vEnd())); + boxUFrom->setValue(s->uStart()); + boxUTo->setValue(s->uEnd()); + boxVFrom->setValue(s->vStart()); + boxVTo->setValue(s->vEnd()); boxColumns->setValue(s->columns()); boxRows->setValue(s->rows()); @@ -501,3 +511,71 @@ boxUPeriodic->setChecked(s->uPeriodic()); boxVPeriodic->setChecked(s->vPeriodic()); } + +void SurfaceDialog::showFunctionLog() +{ + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + if (!app) + return; + + if (app->surfaceFunc.isEmpty()){ + QMessageBox::information(this, tr("QtiPlot"), tr("Sorry, there are no recent expressions available!")); + return; + } + + bool ok; + QString s = QInputDialog::getItem(this, tr("QtiPlot") + " - " + tr("Recent Functions"), tr("Please, choose a function:"), app->surfaceFunc, 0, false, &ok); + if (ok && !s.isEmpty()) + boxFunction->setText(s); +} + +void SurfaceDialog::showXLog() +{ + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + if (!app) + return; + + if (app->d_param_surface_func.isEmpty()){ + QMessageBox::information(this, tr("QtiPlot"), tr("Sorry, there are no recent expressions available!")); + return; + } + + bool ok; + QString s = QInputDialog::getItem(this, tr("QtiPlot") + " - " + tr("Recent Functions"), tr("Please, choose a function:"), app->d_param_surface_func, 0, false, &ok); + if (ok && !s.isEmpty()) + boxX->setText(s); +} + +void SurfaceDialog::showYLog() +{ + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + if (!app) + return; + + if (app->d_param_surface_func.isEmpty()){ + QMessageBox::information(this, tr("QtiPlot"), tr("Sorry, there are no recent expressions available!")); + return; + } + + bool ok; + QString s = QInputDialog::getItem(this, tr("QtiPlot") + " - " + tr("Recent Functions"), tr("Please, choose a function:"), app->d_param_surface_func, 0, false, &ok); + if (ok && !s.isEmpty()) + boxY->setText(s); +} + +void SurfaceDialog::showZLog() +{ + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + if (!app) + return; + + if (app->d_param_surface_func.isEmpty()){ + QMessageBox::information(this, tr("QtiPlot"), tr("Sorry, there are no recent expressions available!")); + return; + } + + bool ok; + QString s = QInputDialog::getItem(this, tr("QtiPlot") + " - " + tr("Recent Functions"), tr("Please, choose a function:"), app->d_param_surface_func, 0, false, &ok); + if (ok && !s.isEmpty()) + boxZ->setText(s); +} === modified file 'qtiplot/src/plot3D/SurfaceDialog.h' --- qtiplot/src/plot3D/SurfaceDialog.h 2009-11-18 10:33:29 +0000 +++ qtiplot/src/plot3D/SurfaceDialog.h 2010-07-21 23:21:08 +0000 @@ -39,6 +39,7 @@ class QSpinBox; class Graph3D; class QLineEdit; +class ScriptEdit; //! Define surface plot dialog class SurfaceDialog : public QDialog @@ -54,8 +55,12 @@ void setGraph(Graph3D *g){d_graph = g;}; private slots: - void clearList(); + void clearFunction(); void accept(); + void showFunctionLog(); + void showXLog(); + void showYLog(); + void showZLog(); private: Graph3D *d_graph; @@ -72,7 +77,7 @@ QPushButton* buttonCancel; QPushButton* buttonClear; QComboBox* boxType; - QComboBox* boxFunction; + ScriptEdit* boxFunction; DoubleSpinBox* boxXFrom; DoubleSpinBox* boxXTo; DoubleSpinBox* boxYFrom; @@ -80,17 +85,18 @@ DoubleSpinBox* boxZFrom; DoubleSpinBox* boxZTo; - QLineEdit* boxX; - QLineEdit* boxY; - QLineEdit* boxZ; + ScriptEdit* boxX; + ScriptEdit* boxY; + ScriptEdit* boxZ; - QLineEdit* boxUFrom; - QLineEdit* boxUTo; - QLineEdit* boxVFrom; - QLineEdit* boxVTo; + DoubleSpinBox* boxUFrom; + DoubleSpinBox* boxUTo; + DoubleSpinBox* boxVFrom; + DoubleSpinBox* boxVTo; QCheckBox *boxUPeriodic, *boxVPeriodic; QSpinBox *boxColumns, *boxRows, *boxFuncColumns, *boxFuncRows; + QPushButton *buttonRecentFunc, *buttonXLog, *buttonYLog, *buttonZLog; }; #endif === added file 'qtiplot/src/plot3D/plot3D.pri' --- qtiplot/src/plot3D/plot3D.pri 1970-01-01 00:00:00 +0000 +++ qtiplot/src/plot3D/plot3D.pri 2010-07-21 23:21:08 +0000 @@ -0,0 +1,19 @@ +############################################################### +################# Module: Plot 3D ############################# +############################################################### + +INCLUDEPATH += src/plot3D/ + +HEADERS += src/plot3D/Bar.h \ + src/plot3D/ColorMapPreviewDialog.h\ + src/plot3D/Cone3D.h \ + src/plot3D/Graph3D.h \ + src/plot3D/Plot3DDialog.h \ + src/plot3D/SurfaceDialog.h \ + +SOURCES += src/plot3D/Bar.cpp \ + src/plot3D/ColorMapPreviewDialog.cpp\ + src/plot3D/Cone3D.cpp \ + src/plot3D/Graph3D.cpp \ + src/plot3D/Plot3DDialog.cpp \ + src/plot3D/SurfaceDialog.cpp \ === removed file 'qtiplot/src/plot3D/plot3D.pri' --- qtiplot/src/plot3D/plot3D.pri 2009-12-08 18:06:27 +0000 +++ qtiplot/src/plot3D/plot3D.pri 1970-01-01 00:00:00 +0000 @@ -1,19 +0,0 @@ -############################################################### -################# Module: Plot 3D ############################# -############################################################### - -INCLUDEPATH += src/plot3D/ - -HEADERS += src/plot3D/Bar.h \ - src/plot3D/ColorMapPreviewDialog.h\ - src/plot3D/Cone3D.h \ - src/plot3D/Graph3D.h \ - src/plot3D/Plot3DDialog.h \ - src/plot3D/SurfaceDialog.h \ - -SOURCES += src/plot3D/Bar.cpp \ - src/plot3D/ColorMapPreviewDialog.cpp\ - src/plot3D/Cone3D.cpp \ - src/plot3D/Graph3D.cpp \ - src/plot3D/Plot3DDialog.cpp \ - src/plot3D/SurfaceDialog.cpp \ === added directory 'qtiplot/src/scripting' === removed directory 'qtiplot/src/scripting' === added file 'qtiplot/src/scripting/FindReplaceDialog.cpp' --- qtiplot/src/scripting/FindReplaceDialog.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/FindReplaceDialog.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,215 @@ +/*************************************************************************** + File : FindReplaceDialog.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2008 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Find/Replace dialog for ScriptEdit + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "FindReplaceDialog.h" +#include "ScriptEdit.h" +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +FindReplaceDialog::FindReplaceDialog(ScriptEdit *editor, bool replace, QWidget* parent, Qt::WFlags fl ) + : QDialog( parent, fl ), d_editor(editor) +{ + setWindowTitle (tr("QtiPlot") + " - " + tr("Find")); + setSizeGripEnabled( true ); + + QGroupBox *gb1 = new QGroupBox(); + QGridLayout * topLayout = new QGridLayout(gb1); + + topLayout->addWidget( new QLabel(tr( "Find" )), 0, 0); + boxFind = new QComboBox(); + boxFind->setEditable(true); + boxFind->setDuplicatesEnabled(false); + boxFind->setInsertPolicy( QComboBox::InsertAtTop ); + boxFind->setAutoCompletion(true); + boxFind->setMaxCount ( 10 ); + boxFind->setMaxVisibleItems ( 10 ); + boxFind->setMinimumWidth(250); + boxFind->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); + + if (editor->textCursor().hasSelection()){ + QString text = editor->textCursor().selectedText(); + boxFind->setEditText(text); + boxFind->addItem(text); + } + + topLayout->addWidget(boxFind, 0, 1); + + if (replace){ + setWindowTitle (tr("QtiPlot") + " - " + tr("Find and Replace")); + topLayout->addWidget(new QLabel(tr( "Replace with" )), 1, 0); + boxReplace = new QComboBox(); + boxReplace->setEditable(true); + boxReplace->setDuplicatesEnabled(false); + boxReplace->setInsertPolicy( QComboBox::InsertAtTop ); + boxReplace->setAutoCompletion(true); + boxReplace->setMaxCount ( 10 ); + boxReplace->setMaxVisibleItems ( 10 ); + boxReplace->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); + topLayout->addWidget( boxReplace, 1, 1); + topLayout->setColumnStretch(1, 10); + } + + QGroupBox *gb2 = new QGroupBox(); + QGridLayout * bottomLayout = new QGridLayout(gb2); + + boxCaseSensitive = new QCheckBox(tr("&Match case")); + boxCaseSensitive->setChecked(false); + bottomLayout->addWidget( boxCaseSensitive, 0, 0); + + boxWholeWords = new QCheckBox(tr("&Whole word")); + boxWholeWords->setChecked(false); + bottomLayout->addWidget(boxWholeWords, 1, 0); + bottomLayout->setRowStretch(2, 1); + + QVBoxLayout *vb1 = new QVBoxLayout(); + vb1->addWidget(gb1); + vb1->addWidget(gb2); + + QVBoxLayout *vb2 = new QVBoxLayout(); + + buttonNext = new QPushButton(tr("&Next")); + buttonNext->setDefault(true); + vb2->addWidget(buttonNext); + + buttonPrevious = new QPushButton(tr("&Previous")); + vb2->addWidget(buttonPrevious); + + if (replace){ + buttonReplace = new QPushButton(tr("&Replace")); + connect(buttonReplace, SIGNAL(clicked()), this, SLOT(replace())); + vb2->addWidget(buttonReplace); + + buttonReplaceAll = new QPushButton(tr("Replace &all")); + connect(buttonReplaceAll, SIGNAL(clicked()), this, SLOT(replaceAll())); + vb2->addWidget(buttonReplaceAll); + } + + buttonCancel = new QPushButton(tr("&Close")); + vb2->addWidget(buttonCancel); + vb2->addStretch(); + + QHBoxLayout *hb = new QHBoxLayout(this); + hb->addLayout(vb1); + hb->addLayout(vb2); + + connect(buttonNext, SIGNAL(clicked()), this, SLOT(find())); + connect(buttonPrevious, SIGNAL(clicked()), this, SLOT(findPrevious())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); +} + +bool FindReplaceDialog::find(bool previous) +{ + QString searchString = boxFind->currentText(); + if (searchString.isEmpty()){ + QMessageBox::warning(this, tr("Empty Search Field"), + tr("The search field is empty. Please enter some text and try again.")); + boxFind->setFocus(); + return false; + } + + if(boxFind->findText(searchString) == -1) + boxFind->addItem (searchString); + + return d_editor->find(searchString, searchFlags(), previous); +} + +void FindReplaceDialog::replace() +{ + QString searchString = boxFind->currentText(); + if (searchString.isEmpty()){ + QMessageBox::warning(this, tr("Empty Search Field"), + tr("The search field is empty. Please enter some text and try again.")); + boxFind->setFocus(); + return; + } + + QTextCursor cursor = d_editor->textCursor(); + if (!cursor.hasSelection() || cursor.selectedText() != searchString){ + find();//find and select next match + return; + } + + QString replaceString = boxReplace->currentText(); + cursor.insertText(replaceString); + find();//find and select next match + + if(boxReplace->findText(replaceString) == -1) + boxReplace->addItem(replaceString); +} + +void FindReplaceDialog::replaceAll() +{ + QString searchString = boxFind->currentText(); + if (searchString.isEmpty()){ + QMessageBox::warning(this, tr("Empty Search Field"), + tr("The search field is empty. Please enter some text and try again.")); + boxFind->setFocus(); + return; + } + + if(boxFind->findText(searchString) == -1) + boxFind->addItem (searchString); + + QString replaceString = boxReplace->currentText(); + if(boxReplace->findText(replaceString) == -1) + boxReplace->addItem(replaceString); + + QTextDocument::FindFlags flags = searchFlags(); + QTextDocument *document = d_editor->document(); + QTextCursor cursor(document); + bool found = false; + while (!cursor.isNull() && !cursor.atEnd()){ + cursor = document->find(searchString, cursor, flags); + if (!cursor.isNull()){ + found = true; + cursor.insertText(replaceString); + } + } + + if (!found) + QMessageBox::information(this, tr("QtiPlot"), tr("QtiPlot has finished searching the document.")); +} + +QTextDocument::FindFlags FindReplaceDialog::searchFlags() +{ + QTextDocument::FindFlags flags; + if (boxCaseSensitive->isChecked()) + flags |= QTextDocument::FindCaseSensitively; + if (boxWholeWords->isChecked()) + flags |= QTextDocument::FindWholeWords; + return flags; +} === removed file 'qtiplot/src/scripting/FindReplaceDialog.cpp' --- qtiplot/src/scripting/FindReplaceDialog.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/FindReplaceDialog.cpp 1970-01-01 00:00:00 +0000 @@ -1,215 +0,0 @@ -/*************************************************************************** - File : FindReplaceDialog.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2008 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Find/Replace dialog for ScriptEdit - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "FindReplaceDialog.h" -#include "ScriptEdit.h" -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -FindReplaceDialog::FindReplaceDialog(ScriptEdit *editor, bool replace, QWidget* parent, Qt::WFlags fl ) - : QDialog( parent, fl ), d_editor(editor) -{ - setWindowTitle (tr("QtiPlot") + " - " + tr("Find")); - setSizeGripEnabled( true ); - - QGroupBox *gb1 = new QGroupBox(); - QGridLayout * topLayout = new QGridLayout(gb1); - - topLayout->addWidget( new QLabel(tr( "Find" )), 0, 0); - boxFind = new QComboBox(); - boxFind->setEditable(true); - boxFind->setDuplicatesEnabled(false); - boxFind->setInsertPolicy( QComboBox::InsertAtTop ); - boxFind->setAutoCompletion(true); - boxFind->setMaxCount ( 10 ); - boxFind->setMaxVisibleItems ( 10 ); - boxFind->setMinimumWidth(250); - boxFind->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); - - if (editor->textCursor().hasSelection()){ - QString text = editor->textCursor().selectedText(); - boxFind->setEditText(text); - boxFind->addItem(text); - } - - topLayout->addWidget(boxFind, 0, 1); - - if (replace){ - setWindowTitle (tr("QtiPlot") + " - " + tr("Find and Replace")); - topLayout->addWidget(new QLabel(tr( "Replace with" )), 1, 0); - boxReplace = new QComboBox(); - boxReplace->setEditable(true); - boxReplace->setDuplicatesEnabled(false); - boxReplace->setInsertPolicy( QComboBox::InsertAtTop ); - boxReplace->setAutoCompletion(true); - boxReplace->setMaxCount ( 10 ); - boxReplace->setMaxVisibleItems ( 10 ); - boxReplace->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); - topLayout->addWidget( boxReplace, 1, 1); - topLayout->setColumnStretch(1, 10); - } - - QGroupBox *gb2 = new QGroupBox(); - QGridLayout * bottomLayout = new QGridLayout(gb2); - - boxCaseSensitive = new QCheckBox(tr("&Match case")); - boxCaseSensitive->setChecked(false); - bottomLayout->addWidget( boxCaseSensitive, 0, 0); - - boxWholeWords = new QCheckBox(tr("&Whole word")); - boxWholeWords->setChecked(false); - bottomLayout->addWidget(boxWholeWords, 1, 0); - bottomLayout->setRowStretch(2, 1); - - QVBoxLayout *vb1 = new QVBoxLayout(); - vb1->addWidget(gb1); - vb1->addWidget(gb2); - - QVBoxLayout *vb2 = new QVBoxLayout(); - - buttonNext = new QPushButton(tr("&Next")); - buttonNext->setDefault(true); - vb2->addWidget(buttonNext); - - buttonPrevious = new QPushButton(tr("&Previous")); - vb2->addWidget(buttonPrevious); - - if (replace){ - buttonReplace = new QPushButton(tr("&Replace")); - connect(buttonReplace, SIGNAL(clicked()), this, SLOT(replace())); - vb2->addWidget(buttonReplace); - - buttonReplaceAll = new QPushButton(tr("Replace &all")); - connect(buttonReplaceAll, SIGNAL(clicked()), this, SLOT(replaceAll())); - vb2->addWidget(buttonReplaceAll); - } - - buttonCancel = new QPushButton(tr("&Close")); - vb2->addWidget(buttonCancel); - vb2->addStretch(); - - QHBoxLayout *hb = new QHBoxLayout(this); - hb->addLayout(vb1); - hb->addLayout(vb2); - - connect(buttonNext, SIGNAL(clicked()), this, SLOT(find())); - connect(buttonPrevious, SIGNAL(clicked()), this, SLOT(findPrevious())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); -} - -bool FindReplaceDialog::find(bool previous) -{ - QString searchString = boxFind->currentText(); - if (searchString.isEmpty()){ - QMessageBox::warning(this, tr("Empty Search Field"), - tr("The search field is empty. Please enter some text and try again.")); - boxFind->setFocus(); - return false; - } - - if(boxFind->findText(searchString) == -1) - boxFind->addItem (searchString); - - return d_editor->find(searchString, searchFlags(), previous); -} - -void FindReplaceDialog::replace() -{ - QString searchString = boxFind->currentText(); - if (searchString.isEmpty()){ - QMessageBox::warning(this, tr("Empty Search Field"), - tr("The search field is empty. Please enter some text and try again.")); - boxFind->setFocus(); - return; - } - - QTextCursor cursor = d_editor->textCursor(); - if (!cursor.hasSelection() || cursor.selectedText() != searchString){ - find();//find and select next match - return; - } - - QString replaceString = boxReplace->currentText(); - cursor.insertText(replaceString); - find();//find and select next match - - if(boxReplace->findText(replaceString) == -1) - boxReplace->addItem(replaceString); -} - -void FindReplaceDialog::replaceAll() -{ - QString searchString = boxFind->currentText(); - if (searchString.isEmpty()){ - QMessageBox::warning(this, tr("Empty Search Field"), - tr("The search field is empty. Please enter some text and try again.")); - boxFind->setFocus(); - return; - } - - if(boxFind->findText(searchString) == -1) - boxFind->addItem (searchString); - - QString replaceString = boxReplace->currentText(); - if(boxReplace->findText(replaceString) == -1) - boxReplace->addItem(replaceString); - - QTextDocument::FindFlags flags = searchFlags(); - QTextDocument *document = d_editor->document(); - QTextCursor cursor(document); - bool found = false; - while (!cursor.isNull() && !cursor.atEnd()){ - cursor = document->find(searchString, cursor, flags); - if (!cursor.isNull()){ - found = true; - cursor.insertText(replaceString); - } - } - - if (!found) - QMessageBox::information(this, tr("QtiPlot"), tr("QtiPlot has finished searching the document.")); -} - -QTextDocument::FindFlags FindReplaceDialog::searchFlags() -{ - QTextDocument::FindFlags flags; - if (boxCaseSensitive->isChecked()) - flags |= QTextDocument::FindCaseSensitively; - if (boxWholeWords->isChecked()) - flags |= QTextDocument::FindWholeWords; - return flags; -} === added file 'qtiplot/src/scripting/FindReplaceDialog.h' --- qtiplot/src/scripting/FindReplaceDialog.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/FindReplaceDialog.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,73 @@ +/*************************************************************************** + File : FindReplaceDialog.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2008 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Find/Replace dialog for ScriptEdit + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef FIND_REPLACE_DIALOG_H +#define FIND_REPLACE_DIALOG_H + +#include +#include +#include + +class QPushButton; +class QCheckBox; +class QComboBox; +class ScriptEdit; + +//! Find/Replace dialog +class FindReplaceDialog : public QDialog +{ + Q_OBJECT + +public: + FindReplaceDialog(ScriptEdit *editor, bool replace = false, QWidget* parent = 0, Qt::WFlags fl = 0 ); + +private: + QTextDocument::FindFlags searchFlags(); + + ScriptEdit *d_editor; + + QPushButton* buttonNext; + QPushButton* buttonPrevious; + QPushButton* buttonReplace; + QPushButton* buttonReplaceAll; + QPushButton* buttonCancel; + + QComboBox* boxFind; + QComboBox* boxReplace; + + QCheckBox* boxCaseSensitive; + QCheckBox* boxWholeWords; + +protected slots: + bool find(bool previous = false); + bool findPrevious(){return find(true);}; + void replace(); + void replaceAll(); +}; + +#endif === removed file 'qtiplot/src/scripting/FindReplaceDialog.h' --- qtiplot/src/scripting/FindReplaceDialog.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/FindReplaceDialog.h 1970-01-01 00:00:00 +0000 @@ -1,73 +0,0 @@ -/*************************************************************************** - File : FindReplaceDialog.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2008 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Find/Replace dialog for ScriptEdit - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef FIND_REPLACE_DIALOG_H -#define FIND_REPLACE_DIALOG_H - -#include -#include -#include - -class QPushButton; -class QCheckBox; -class QComboBox; -class ScriptEdit; - -//! Find/Replace dialog -class FindReplaceDialog : public QDialog -{ - Q_OBJECT - -public: - FindReplaceDialog(ScriptEdit *editor, bool replace = false, QWidget* parent = 0, Qt::WFlags fl = 0 ); - -private: - QTextDocument::FindFlags searchFlags(); - - ScriptEdit *d_editor; - - QPushButton* buttonNext; - QPushButton* buttonPrevious; - QPushButton* buttonReplace; - QPushButton* buttonReplaceAll; - QPushButton* buttonCancel; - - QComboBox* boxFind; - QComboBox* boxReplace; - - QCheckBox* boxCaseSensitive; - QCheckBox* boxWholeWords; - -protected slots: - bool find(bool previous = false); - bool findPrevious(){return find(true);}; - void replace(); - void replaceAll(); -}; - -#endif === added file 'qtiplot/src/scripting/MyParser.cpp' --- qtiplot/src/scripting/MyParser.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/MyParser.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,195 @@ +/*************************************************************************** + File : MyParser.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Parser class based on muParser + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "MyParser.h" +#include "muParserScripting.h" +#include "NonLinearFit.h" + +#include +#include +#include +#include + +#include +#include + +MyParser::MyParser() +:Parser() +{ + DefineConst("pi", M_PI); + DefineConst("Pi", M_PI); + DefineConst("PI", M_PI); + + for (const muParserScripting::mathFunction *i=muParserScripting::math_functions; i->name; i++){ + if (i->numargs == 1 && i->fun1 != NULL) + DefineFun(i->name, i->fun1); + else if (i->numargs == 2 && i->fun2 != NULL) + DefineFun(i->name, i->fun2); + else if (i->numargs == 3 && i->fun3 != NULL) + DefineFun(i->name, i->fun3); + } + gsl_set_error_handler_off(); + +#ifdef Q_OS_MAC + QSettings settings(QSettings::IniFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); +#else + QSettings settings(QSettings::NativeFormat,QSettings::UserScope, "ProIndependent", "QtiPlot"); +#endif + settings.beginGroup("/General"); + bool cLocale = settings.value("/MuParserCLocale", true).toBool(); + settings.endGroup(); + + QLocale locale = QLocale::c(); + if (!cLocale) + locale = QLocale(); + + setLocale(locale); +} + +void MyParser::setLocale(const QLocale& locale) +{ + const char decPoint = locale.decimalPoint().toAscii(); + if (decPoint != '.'){ + SetDecSep(decPoint); + SetArgSep(';'); + SetThousandsSep(locale.groupSeparator().toAscii()); + } else + ResetLocale();// reset C locale +} + +void MyParser::addGSLConstants() +{ + DefineConst("e", M_E); + DefineConst("E", M_E); + + //Fundamental constants provided by GSL + DefineConst("c", GSL_CONST_MKSA_SPEED_OF_LIGHT);//The speed of light in vacuum + DefineConst("eV", GSL_CONST_MKSA_ELECTRON_VOLT);//The energy of 1 electron volt + DefineConst("g", GSL_CONST_MKSA_GRAV_ACCEL);//The standard gravitational acceleration on Earth + DefineConst("G", GSL_CONST_MKSA_GRAVITATIONAL_CONSTANT);//The gravitational constant + DefineConst("h", GSL_CONST_MKSA_PLANCKS_CONSTANT_H);//Planck's constant + DefineConst("hbar", GSL_CONST_MKSA_PLANCKS_CONSTANT_HBAR);//Planck's constant divided by 2 pi + DefineConst("k", GSL_CONST_MKSA_PLANCKS_CONSTANT_H);//The Boltzmann constant + DefineConst("Na", GSL_CONST_NUM_AVOGADRO);//Avogadro's number + DefineConst("R0", GSL_CONST_MKSA_MOLAR_GAS);//The molar gas constant + DefineConst("V0", GSL_CONST_MKSA_STANDARD_GAS_VOLUME);//The standard gas volume + DefineConst("Ry", GSL_CONST_MKSA_RYDBERG);//The Rydberg constant, Ry, in units of energy +} + +const QStringList MyParser::functionsList() +{ + QStringList l; + + QString argSeparator = ","; + if (QString(QLocale().decimalPoint()) == argSeparator) + argSeparator = ";"; + + for (const muParserScripting::mathFunction *i = muParserScripting::math_functions; i->name; i++){ + if (i->numargs == 2) + l << QString(i->name) + "(" + argSeparator + ")"; + else + l << QString(i->name) + "()"; + } + return l; +} + +const QStringList MyParser::functionNamesList() +{ + QStringList l; + for (const muParserScripting::mathFunction *i = muParserScripting::math_functions; i->name; i++) + l << QString(i->name); + + return l; +} + +QString MyParser::explainFunction(int index) +{ + const muParserScripting::mathFunction i = muParserScripting::math_functions[index]; + QString s = QObject::tr(i.description); + if (QLocale().decimalPoint() == ',') + s.replace(",", ";"); + + return s; +} + +double MyParser::EvalRemoveSingularity(double *xvar, bool noisy) const +{ + try { + double result = Eval(); + if ( gsl_isinf(result) || gsl_isnan(result)) + throw Singularity(); + return result; + } catch (Singularity) { + try { + if (isinf(Eval())) + throw Pole(); + double backup = *xvar; + int n; + frexp (*xvar, &n); + double xp = *xvar + ldexp(DBL_EPSILON, n); + double xm = *xvar - ldexp(DBL_EPSILON, n); + *xvar = xp; + double yp = Eval(); + if (gsl_isinf(yp) || gsl_isnan(yp)) + throw Pole(); + *xvar = xm; + double ym = Eval(); + if (gsl_isinf(ym) || gsl_isnan(ym)) + throw Pole(); + *xvar = backup; + return 0.5*(yp + ym); + } catch (Pole) { + if (noisy){ + QApplication::restoreOverrideCursor(); + //QMessageBox::critical(0, QObject::tr("QtiPlot - Math Error"), + //QObject::tr("Found non-removable singularity at x = %1.").arg(*xvar)); + throw Pole(); + } + return GSL_NAN; + } + } +} + +//almost verbatim copy from Parser::Diff, adapted to use EvalRemoveSingularity() + +double MyParser::DiffRemoveSingularity(double *xvar, double *a_Var, double a_fPos) const +{ + double fRes(0), + fBuf(*a_Var), + f[4] = {0,0,0,0}, + a_fEpsilon( (a_fPos == 0) ? (double)1e-10 : 1e-7 * a_fPos ); + + *a_Var = a_fPos+2 * a_fEpsilon; f[0] = EvalRemoveSingularity(xvar); + *a_Var = a_fPos+1 * a_fEpsilon; f[1] = EvalRemoveSingularity(xvar); + *a_Var = a_fPos-1 * a_fEpsilon; f[2] = EvalRemoveSingularity(xvar); + *a_Var = a_fPos-2 * a_fEpsilon; f[3] = EvalRemoveSingularity(xvar); + *a_Var = fBuf; // restore variable + + fRes = (-f[0] + 8*f[1] - 8*f[2] + f[3]) / (12*a_fEpsilon); + return fRes; +} === removed file 'qtiplot/src/scripting/MyParser.cpp' --- qtiplot/src/scripting/MyParser.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/MyParser.cpp 1970-01-01 00:00:00 +0000 @@ -1,143 +0,0 @@ -/*************************************************************************** - File : MyParser.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Parser class based on muParser - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "MyParser.h" -#include -#include -#include "NonLinearFit.h" -#include "muParserScripting.h" -#include -#include - -MyParser::MyParser() -:Parser() -{ - DefineConst("pi", M_PI); - DefineConst("Pi", M_PI); - DefineConst("PI", M_PI); - DefineConst("e", M_E); - DefineConst("E", M_E); - - //Fundamental constants provided by GSL - DefineConst("c", GSL_CONST_MKSA_SPEED_OF_LIGHT);//The speed of light in vacuum - DefineConst("eV", GSL_CONST_MKSA_ELECTRON_VOLT);//The energy of 1 electron volt - DefineConst("g", GSL_CONST_MKSA_GRAV_ACCEL);//The standard gravitational acceleration on Earth - DefineConst("G", GSL_CONST_MKSA_GRAVITATIONAL_CONSTANT);//The gravitational constant - DefineConst("h", GSL_CONST_MKSA_PLANCKS_CONSTANT_H);//Planck's constant - DefineConst("hbar", GSL_CONST_MKSA_PLANCKS_CONSTANT_HBAR);//Planck's constant divided by 2 pi - DefineConst("k", GSL_CONST_MKSA_PLANCKS_CONSTANT_H);//The Boltzmann constant - DefineConst("Na", GSL_CONST_NUM_AVOGADRO);//Avogadro's number - DefineConst("R0", GSL_CONST_MKSA_MOLAR_GAS);//The molar gas constant - DefineConst("V0", GSL_CONST_MKSA_STANDARD_GAS_VOLUME);//The standard gas volume - DefineConst("Ry", GSL_CONST_MKSA_RYDBERG);//The Rydberg constant, Ry, in units of energy - - for (const muParserScripting::mathFunction *i=muParserScripting::math_functions; i->name; i++){ - if (i->numargs == 1 && i->fun1 != NULL) - DefineFun(i->name, i->fun1); - else if (i->numargs == 2 && i->fun2 != NULL) - DefineFun(i->name, i->fun2); - else if (i->numargs == 3 && i->fun3 != NULL) - DefineFun(i->name, i->fun3); - } - gsl_set_error_handler_off(); -} - -const QStringList MyParser::functionsList() -{ - QStringList l; - for (const muParserScripting::mathFunction *i = muParserScripting::math_functions; i->name; i++){ - if (i->numargs == 2) - l << QString(i->name) + "(,)"; - else - l << QString(i->name) + "()"; - } - return l; -} - -QString MyParser::explainFunction(int index) -{ - const muParserScripting::mathFunction i = muParserScripting::math_functions[index]; - return QObject::tr(i.description); -} - -double MyParser::EvalRemoveSingularity(double *xvar, bool noisy) const -{ - try { - double result = Eval(); - if ( gsl_isinf(result) || gsl_isnan(result)) - throw Singularity(); - return result; - } catch (Singularity) { - try { - if (isinf(Eval())) - throw Pole(); - double backup = *xvar; - int n; - frexp (*xvar, &n); - double xp = *xvar + ldexp(DBL_EPSILON, n); - double xm = *xvar - ldexp(DBL_EPSILON, n); - *xvar = xp; - double yp = Eval(); - if (gsl_isinf(yp) || gsl_isnan(yp)) - throw Pole(); - *xvar = xm; - double ym = Eval(); - if (gsl_isinf(ym) || gsl_isnan(ym)) - throw Pole(); - *xvar = backup; - return 0.5*(yp + ym); - } catch (Pole) { - if (noisy){ - QApplication::restoreOverrideCursor(); - QMessageBox::critical(0, QObject::tr("QtiPlot - Math Error"), - QObject::tr("Found non-removable singularity at x = %1.").arg(*xvar)); - throw Pole(); - } - return GSL_NAN; - } - } -} - -//almost verbatim copy from Parser::Diff, adapted to use EvalRemoveSingularity() - -double MyParser::DiffRemoveSingularity(double *xvar, double *a_Var, double a_fPos) const -{ - double fRes(0), - fBuf(*a_Var), - f[4] = {0,0,0,0}, - a_fEpsilon( (a_fPos == 0) ? (double)1e-10 : 1e-7 * a_fPos ); - - *a_Var = a_fPos+2 * a_fEpsilon; f[0] = EvalRemoveSingularity(xvar); - *a_Var = a_fPos+1 * a_fEpsilon; f[1] = EvalRemoveSingularity(xvar); - *a_Var = a_fPos-1 * a_fEpsilon; f[2] = EvalRemoveSingularity(xvar); - *a_Var = a_fPos-2 * a_fEpsilon; f[3] = EvalRemoveSingularity(xvar); - *a_Var = fBuf; // restore variable - - fRes = (-f[0] + 8*f[1] - 8*f[2] + f[3]) / (12*a_fEpsilon); - return fRes; -} === added file 'qtiplot/src/scripting/MyParser.h' --- qtiplot/src/scripting/MyParser.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/MyParser.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,66 @@ +/*************************************************************************** + File : MyParser.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Parser class based on muParser + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef MYPARSER_H +#define MYPARSER_H + +#include +#include + +using namespace mu; + +class QLocale; + +/*!\brief Mathematical parser class based on muParser. + * + * \section future Future Plans + * Eliminate in favour of Script/ScriptingEnv. + * This will allow you to use e.g. Python's global variables and functions everywhere. + * Before this happens, a cleaner and more generic solution for accessing the current ScriptingEnv + * should be implemented (maybe by making it a property of Project; see ApplicationWindow). + */ +class MyParser : public Parser +{ +public: + MyParser(); + void addGSLConstants(); + void setLocale(const QLocale& locale); + + const static QStringList functionsList(); + const static QStringList functionNamesList(); + static QString explainFunction(int index); + + double EvalRemoveSingularity(double *xvar, bool noisy = true) const; + double DiffRemoveSingularity(double *xvar, double *a_Var,double a_fPos) const; + static void SingularityErrorMessage(double xvar); + + class Singularity {}; + class Pole {}; +}; + +#endif === removed file 'qtiplot/src/scripting/MyParser.h' --- qtiplot/src/scripting/MyParser.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/MyParser.h 1970-01-01 00:00:00 +0000 @@ -1,61 +0,0 @@ -/*************************************************************************** - File : MyParser.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Parser class based on muParser - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef MYPARSER_H -#define MYPARSER_H - -#include -#include - -using namespace mu; - -/*!\brief Mathematical parser class based on muParser. - * - * \section future Future Plans - * Eliminate in favour of Script/ScriptingEnv. - * This will allow you to use e.g. Python's global variables and functions everywhere. - * Before this happens, a cleaner and more generic solution for accessing the current ScriptingEnv - * should be implemented (maybe by making it a property of Project; see ApplicationWindow). - */ -class MyParser : public Parser -{ -public: - MyParser(); - - const static QStringList functionsList(); - static QString explainFunction(int index); - - double EvalRemoveSingularity(double *xvar, bool noisy = true) const; - double DiffRemoveSingularity(double *xvar, double *a_Var,double a_fPos) const; - static void SingularityErrorMessage(double xvar); - - class Singularity {}; - class Pole {}; -}; - -#endif === added file 'qtiplot/src/scripting/Note.cpp' --- qtiplot/src/scripting/Note.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/Note.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,425 @@ +/*************************************************************************** + File : Note.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de + Description : Notes window class + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "Note.h" +#include "ScriptEdit.h" +#include + +#include +#include +#include +#include +#include + +Note::Note(ScriptingEnv *env, const QString& label, ApplicationWindow* parent, const QString& name, Qt::WFlags f) + : MdiSubWindow(label, parent, name, f), d_env(env), + d_line_number_enabled(parent->d_note_line_numbers) +{ + init(env); +} + +void Note::init(ScriptingEnv *env) +{ + autoExec = false; + + d_tab_widget = new QTabWidget; + d_tab_widget->setTabsClosable(true); + d_tab_widget->setDocumentMode(true); + connect(d_tab_widget, SIGNAL(tabCloseRequested(int)), this, SLOT(removeTab(int))); + connect(d_tab_widget, SIGNAL(currentChanged(int)), this, SLOT(notifyChanges())); + connect(d_tab_widget, SIGNAL(currentChanged(int)), this, SIGNAL(currentEditorChanged())); + + QPushButton *btnAdd = new QPushButton("+"); + btnAdd->setToolTip(tr("Add tab")); + btnAdd->setMaximumWidth(20); + connect(btnAdd, SIGNAL(clicked()), this, SLOT(addTab())); + + QWidget *addWidget = new QWidget; + QHBoxLayout *hb = new QHBoxLayout(addWidget); + hb->setMargin(0); + hb->setSpacing(0); + hb->addWidget(btnAdd); + hb->addStretch(); + + d_tab_widget->setCornerWidget(addWidget); + + setWidget(d_tab_widget); + + addTab(); + + resize(500, 200); +} + +void Note::showLineNumbers(bool show) +{ + if (d_line_number_enabled == show) + return; + + d_line_number_enabled = show; + + for (int i = 0; i < d_tab_widget->count(); i++){ + QWidget *w = d_tab_widget->widget(i); + if (!w) + continue; + + QObjectList lst = w->children(); + foreach (QObject *obj, lst){ + LineNumberDisplay *display = qobject_cast(obj); + if (display){ + display->setVisible(show); + break; + } + } + } +} + +void Note::renameCurrentTab() +{ + bool ok; + int index = d_tab_widget->currentIndex(); + QString title = QInputDialog::getText(this, tr("Please, enter new title:"), tr("Title"), + QLineEdit::Normal, d_tab_widget->tabText(index), &ok); + if (ok && !title.isEmpty()) + d_tab_widget->setTabText(index, title); +} + +void Note::renameTab(int index, const QString& title) +{ + d_tab_widget->setTabText(index, title); +} + +void Note::removeTab(int index) +{ + if (index < 0) + index = d_tab_widget->currentIndex(); + + if (d_tab_widget->count() == 1) + return; + + d_tab_widget->removeTab(index); + d_tab_widget->setTabsClosable(d_tab_widget->count() != 1); +} + +void Note::addTab() +{ + ApplicationWindow *app = applicationWindow(); + if (!app) + return; + + d_tab_widget->setTabsClosable(d_tab_widget->count() != 0); + + QFont f = app->d_notes_font; + + ScriptEdit *editor = new ScriptEdit(d_env, this, name()); + editor->setContext(this); + editor->setCurrentFont(f); + editor->document()->setDefaultFont(f); + editor->setTabStopWidth(app->d_notes_tab_length); + editor->setCompleter(app->completer()); + editor->setDirPath(app->scriptsDirPath); + + app->connectScriptEditor(editor); + + d_tab_widget->setFocusProxy(editor); + + LineNumberDisplay *ln = new LineNumberDisplay(editor, this); + ln->setCurrentFont(f); + + QWidget *frame = new QWidget(this); + + QHBoxLayout *hbox = new QHBoxLayout(frame); + hbox->setMargin(0); + hbox->setSpacing(0); + hbox->addWidget(ln); + hbox->addWidget(editor); + + ln->setVisible(d_line_number_enabled); + + d_tab_widget->setCurrentIndex(d_tab_widget->addTab(frame, tr("untitled"))); + + connect(editor, SIGNAL(textChanged()), this, SLOT(modifiedNote())); + connect(editor, SIGNAL(textChanged()), this, SIGNAL(currentEditorChanged())); + connect(editor, SIGNAL(dirPathChanged(const QString& )), this, SIGNAL(dirPathChanged(const QString&))); +} + +int Note::indexOf(ScriptEdit* editor) +{ + if (!editor) + return -1; + + for (int i = 0; i < d_tab_widget->count(); i++){ + QWidget *w = d_tab_widget->widget(i); + if (!w) + continue; + + QObjectList lst = w->children(); + foreach (QObject *obj, lst){ + ScriptEdit *edit = qobject_cast(obj); + if (edit && edit == editor){ + return i; + } + } + } +} + +ScriptEdit* Note::editor(int index) +{ + if (index < 0 || index >= d_tab_widget->count()) + return 0; + + QWidget *w = d_tab_widget->widget(index); + if (!w) + return 0; + + QObjectList lst = w->children(); + foreach (QObject *obj, lst){ + ScriptEdit *edit = qobject_cast(obj); + if (edit) + return edit; + } + return 0; +} + +ScriptEdit* Note::currentEditor() +{ + QWidget *w = d_tab_widget->currentWidget(); + if (!w) + return 0; + + QObjectList lst = w->children(); + foreach (QObject *obj, lst){ + ScriptEdit *editor = qobject_cast(obj); + if (editor) + return editor; + } + return 0; +} + +void Note::setTabStopWidth(int length) +{ + for (int i = 0; i < d_tab_widget->count(); i++){ + QWidget *w = d_tab_widget->widget(i); + if (!w) + continue; + + QObjectList lst = w->children(); + foreach (QObject *obj, lst){ + ScriptEdit *edit = qobject_cast(obj); + if (edit){ + edit->setTabStopWidth(length); + break; + } + } + } +} + +void Note::setName(const QString& name) +{ + currentEditor()->setObjectName(name); + MdiSubWindow::setName(name); +} + +void Note::modifiedNote() +{ + emit modifiedWindow(this); +} + +void Note::save(const QString &fn, const QString &info, bool) +{ + QFile f(fn); + if (!f.isOpen()){ + if (!f.open(QIODevice::Append)) + return; + } + QTextStream t( &f ); + t.setEncoding(QTextStream::UnicodeUTF8); + t << "\n"; + t << QString(name()) + "\t" + birthDate() + "\n"; + t << info; + t << "WindowLabel\t" + windowLabel() + "\t" + QString::number(captionPolicy()) + "\n"; + t << "AutoExec\t" + QString(autoExec ? "1" : "0") + "\n"; + t << "" + QString::number(d_line_number_enabled) + "\n"; + + f.close(); + for (int i = 0; i < tabs(); i++) + saveTab(i, fn); + + if (!f.open(QIODevice::Append)) + return; + + t << "\n"; +} + +void Note::saveTab(int index, const QString &fn) +{ + QFile f(fn); + if (!f.open(QIODevice::Append)) + return; + + QTextStream t( &f ); + t.setEncoding(QTextStream::UnicodeUTF8); + t << "\n"; + if (d_tab_widget->currentIndex() == index) + t << "1\n"; + + t << "" + d_tab_widget->tabText(index) + "\n"; + t << "\n" + editor(index)->text().stripWhiteSpace() + "\n"; + t << "\n\n"; + + f.close(); +} + +void Note::restore(const QStringList& data) +{ + QStringList::ConstIterator line = data.begin(); + QStringList fields; + + fields = (*line).split("\t"); + if (fields[0] == "AutoExec"){ + setAutoexec(fields[1] == "1"); + line++; + } + + bool lineNumbers = true; + if ((*line).startsWith("")){ + QString s = *line; + lineNumbers = s.remove("").remove("").toInt(); + line++; + } + + d_tab_widget->clear(); + + int activeTab = 0; + while (line != data.end() && *line != ""){ + QString s = *line; + if (s == ""){ + addTab(); + + line++; + s = *line; + + if (s.startsWith("")){ + activeTab = d_tab_widget->currentIndex(); + line++; + s = *line; + } + + if (s.startsWith("")) + d_tab_widget->setTabText(d_tab_widget->currentIndex(), s.remove("<title>").remove("")); + + line++; + if (*line == "") + line++; + + currentEditor()->setUndoRedoEnabled(false); + while (line != data.end() && *line != "") + currentEditor()->insertPlainText((*line++)+"\n"); + currentEditor()->setUndoRedoEnabled(true); + + line++; + if (*line == "") + line++; + if (*line == "") + line++; + } else if (s == ""){//old style single editor notes + addTab(); + line++; + + currentEditor()->setUndoRedoEnabled(false); + while (line != data.end() && *line != "") + currentEditor()->insertPlainText((*line++)+"\n"); + currentEditor()->setUndoRedoEnabled(true); + + if (*line == "") + line++; + } else {//even older style, no tag, versions < 0.8.5 + if (!currentEditor()) + addTab(); + currentEditor()->insertPlainText((*line++) + "\n"); + } + } + + showLineNumbers(lineNumbers); + d_tab_widget->setCurrentIndex(activeTab); + currentEditor()->moveCursor(QTextCursor::Start); +} + +void Note::setAutoexec(bool exec) +{ + autoExec = exec; + if (autoExec) + currentEditor()->setPaletteBackgroundColor(QColor(255,239,185)); + else + currentEditor()->unsetPalette(); +} + +void Note::setFont(const QFont& f) +{ + for (int i = 0; i < d_tab_widget->count(); i++){ + QWidget *w = d_tab_widget->widget(i); + if (!w) + continue; + + LineNumberDisplay *display = 0; + ScriptEdit *editor = 0; + + QObjectList lst = w->children(); + foreach (QObject *obj, lst){ + display = qobject_cast(obj); + if (display) + break; + } + + foreach (QObject *obj, lst){ + editor = qobject_cast(obj); + if (editor) + break; + } + + if (!editor || !display) + continue; + + if (editor->toPlainText().isEmpty()){ + editor->setCurrentFont(f); + editor->document()->setDefaultFont(f); + display->setCurrentFont(f); + return; + } + + editor->selectAll(); + editor->setCurrentFont(f); + editor->document()->setDefaultFont(f); + display->selectAll(); + display->setCurrentFont(f); + display->updateLineNumbers(true); + + QTextCursor cursor = editor->textCursor(); + cursor.clearSelection(); + editor->setTextCursor(cursor); + } +} === removed file 'qtiplot/src/scripting/Note.cpp' --- qtiplot/src/scripting/Note.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/Note.cpp 1970-01-01 00:00:00 +0000 @@ -1,415 +0,0 @@ -/*************************************************************************** - File : Note.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de - Description : Notes window class - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "Note.h" -#include "ScriptEdit.h" -#include - -#include -#include -#include -#include -#include - -Note::Note(ScriptingEnv *env, const QString& label, ApplicationWindow* parent, const QString& name, Qt::WFlags f) - : MdiSubWindow(label, parent, name, f), d_env(env), - d_line_number_enabled(parent->d_note_line_numbers) -{ - init(env); -} - -void Note::init(ScriptingEnv *env) -{ - autoExec = false; - - d_tab_widget = new QTabWidget; - d_tab_widget->setTabsClosable(true); - d_tab_widget->setDocumentMode(true); - connect(d_tab_widget, SIGNAL(tabCloseRequested(int)), this, SLOT(removeTab(int))); - connect(d_tab_widget, SIGNAL(currentChanged(int)), this, SLOT(notifyChanges())); - connect(d_tab_widget, SIGNAL(currentChanged(int)), this, SIGNAL(currentEditorChanged())); - - QPushButton *btnAdd = new QPushButton("+"); - btnAdd->setToolTip(tr("Add tab")); - btnAdd->setMaximumWidth(20); - connect(btnAdd, SIGNAL(clicked()), this, SLOT(addTab())); - - QWidget *addWidget = new QWidget; - QHBoxLayout *hb = new QHBoxLayout(addWidget); - hb->setMargin(0); - hb->setSpacing(0); - hb->addWidget(btnAdd); - hb->addStretch(); - - d_tab_widget->setCornerWidget(addWidget); - - setWidget(d_tab_widget); - - addTab(); - - resize(500, 200); -} - -void Note::showLineNumbers(bool show) -{ - if (d_line_number_enabled == show) - return; - - d_line_number_enabled = show; - - for (int i = 0; i < d_tab_widget->count(); i++){ - QWidget *w = d_tab_widget->widget(i); - if (!w) - continue; - - QObjectList lst = w->children(); - foreach (QObject *obj, lst){ - LineNumberDisplay *display = qobject_cast(obj); - if (display){ - display->setVisible(show); - break; - } - } - } -} - -void Note::renameCurrentTab() -{ - bool ok; - int index = d_tab_widget->currentIndex(); - QString title = QInputDialog::getText(this, tr("Please, enter new title:"), tr("Title"), - QLineEdit::Normal, d_tab_widget->tabText(index), &ok); - if (ok && !title.isEmpty()) - d_tab_widget->setTabText(index, title); -} - -void Note::renameTab(int index, const QString& title) -{ - d_tab_widget->setTabText(index, title); -} - -void Note::removeTab(int index) -{ - if (index < 0) - index = d_tab_widget->currentIndex(); - - if (d_tab_widget->count() == 1) - return; - - d_tab_widget->removeTab(index); - d_tab_widget->setTabsClosable(d_tab_widget->count() != 1); -} - -void Note::addTab() -{ - ApplicationWindow *app = applicationWindow(); - if (!app) - return; - - d_tab_widget->setTabsClosable(d_tab_widget->count() != 0); - - QFont f = app->d_notes_font; - - ScriptEdit *editor = new ScriptEdit(d_env, this, name()); - editor->setContext(this); - editor->setCurrentFont(f); - editor->document()->setDefaultFont(f); - editor->setTabStopWidth(app->d_notes_tab_length); - editor->setCompleter(app->completer()); - editor->setDirPath(app->scriptsDirPath); - - d_tab_widget->setFocusProxy(editor); - - LineNumberDisplay *ln = new LineNumberDisplay(editor, this); - ln->setCurrentFont(f); - - QWidget *frame = new QWidget(this); - - QHBoxLayout *hbox = new QHBoxLayout(frame); - hbox->setMargin(0); - hbox->setSpacing(0); - hbox->addWidget(ln); - hbox->addWidget(editor); - - ln->setVisible(d_line_number_enabled); - - d_tab_widget->setCurrentIndex(d_tab_widget->addTab(frame, tr("untitled"))); - - connect(editor, SIGNAL(textChanged()), this, SLOT(modifiedNote())); - connect(editor, SIGNAL(textChanged()), this, SIGNAL(currentEditorChanged())); - connect(editor, SIGNAL(dirPathChanged(const QString& )), this, SIGNAL(dirPathChanged(const QString&))); -} - -int Note::indexOf(ScriptEdit* editor) -{ - if (!editor) - return -1; - - for (int i = 0; i < d_tab_widget->count(); i++){ - QWidget *w = d_tab_widget->widget(i); - if (!w) - continue; - - QObjectList lst = w->children(); - foreach (QObject *obj, lst){ - ScriptEdit *edit = qobject_cast(obj); - if (edit && edit == editor){ - return i; - } - } - } -} - -ScriptEdit* Note::editor(int index) -{ - if (index < 0 || index >= d_tab_widget->count()) - return 0; - - QWidget *w = d_tab_widget->widget(index); - if (!w) - return 0; - - QObjectList lst = w->children(); - foreach (QObject *obj, lst){ - ScriptEdit *edit = qobject_cast(obj); - if (edit) - return edit; - } - return 0; -} - -ScriptEdit* Note::currentEditor() -{ - QWidget *w = d_tab_widget->currentWidget(); - if (!w) - return 0; - - QObjectList lst = w->children(); - foreach (QObject *obj, lst){ - ScriptEdit *editor = qobject_cast(obj); - if (editor) - return editor; - } - return 0; -} - -void Note::setTabStopWidth(int length) -{ - for (int i = 0; i < d_tab_widget->count(); i++){ - QWidget *w = d_tab_widget->widget(i); - if (!w) - continue; - - QObjectList lst = w->children(); - foreach (QObject *obj, lst){ - ScriptEdit *edit = qobject_cast(obj); - if (edit){ - edit->setTabStopWidth(length); - break; - } - } - } -} - -void Note::setName(const QString& name) -{ - currentEditor()->setObjectName(name); - MdiSubWindow::setName(name); -} - -void Note::modifiedNote() -{ - emit modifiedWindow(this); -} - -void Note::save(const QString &fn, const QString &info, bool) -{ - QFile f(fn); - if (!f.isOpen()){ - if (!f.open(QIODevice::Append)) - return; - } - QTextStream t( &f ); - t.setEncoding(QTextStream::UnicodeUTF8); - t << "\n"; - t << QString(name()) + "\t" + birthDate() + "\n"; - t << info; - t << "WindowLabel\t" + windowLabel() + "\t" + QString::number(captionPolicy()) + "\n"; - t << "AutoExec\t" + QString(autoExec ? "1" : "0") + "\n"; - t << "" + QString::number(d_line_number_enabled) + "\n"; - - f.close(); - for (int i = 0; i < tabs(); i++) - saveTab(i, fn); - - if (!f.open(QIODevice::Append)) - return; - - t << "\n"; -} - -void Note::saveTab(int index, const QString &fn) -{ - QFile f(fn); - if (!f.open(QIODevice::Append)) - return; - - QTextStream t( &f ); - t.setEncoding(QTextStream::UnicodeUTF8); - t << "\n"; - if (d_tab_widget->currentIndex() == index) - t << "1\n"; - - t << "" + d_tab_widget->tabText(index) + "\n"; - t << "\n" + editor(index)->text().stripWhiteSpace() + "\n"; - t << "\n\n"; - - f.close(); -} - -void Note::restore(const QStringList& data) -{ - QStringList::ConstIterator line = data.begin(); - QStringList fields; - - fields = (*line).split("\t"); - if (fields[0] == "AutoExec"){ - setAutoexec(fields[1] == "1"); - line++; - } - - bool lineNumbers = true; - if ((*line).startsWith("")){ - QString s = *line; - lineNumbers = s.remove("").remove("").toInt(); - line++; - } - - d_tab_widget->clear(); - - int activeTab = 0; - while (line != data.end() && *line != ""){ - QString s = *line; - if (s == ""){ - addTab(); - - line++; - s = *line; - - if (s.startsWith("")){ - activeTab = d_tab_widget->currentIndex(); - line++; - s = *line; - } - - if (s.startsWith("")) - d_tab_widget->setTabText(d_tab_widget->currentIndex(), s.remove("<title>").remove("")); - - line++; - if (*line == "") - line++; - - while (line != data.end() && *line != "") - currentEditor()->insertPlainText((*line++)+"\n"); - - line++; - if (*line == "") - line++; - if (*line == "") - line++; - } else if (s == ""){//old style single editor notes - addTab(); - line++; - - while (line != data.end() && *line != "") - currentEditor()->insertPlainText((*line++)+"\n"); - - if (*line == "") - line++; - } - } - - showLineNumbers(lineNumbers); - d_tab_widget->setCurrentIndex(activeTab); - currentEditor()->moveCursor(QTextCursor::Start); -} - -void Note::setAutoexec(bool exec) -{ - autoExec = exec; - if (autoExec) - currentEditor()->setPaletteBackgroundColor(QColor(255,239,185)); - else - currentEditor()->unsetPalette(); -} - -void Note::setFont(const QFont& f) -{ - for (int i = 0; i < d_tab_widget->count(); i++){ - QWidget *w = d_tab_widget->widget(i); - if (!w) - continue; - - LineNumberDisplay *display = 0; - ScriptEdit *editor = 0; - - QObjectList lst = w->children(); - foreach (QObject *obj, lst){ - display = qobject_cast(obj); - if (display) - break; - } - - foreach (QObject *obj, lst){ - editor = qobject_cast(obj); - if (editor) - break; - } - - if (!editor || !display) - continue; - - if (editor->toPlainText().isEmpty()){ - editor->setCurrentFont(f); - editor->document()->setDefaultFont(f); - display->setCurrentFont(f); - return; - } - - editor->selectAll(); - editor->setCurrentFont(f); - editor->document()->setDefaultFont(f); - display->selectAll(); - display->setCurrentFont(f); - display->updateLineNumbers(true); - - QTextCursor cursor = editor->textCursor(); - cursor.clearSelection(); - editor->setTextCursor(cursor); - } -} === added file 'qtiplot/src/scripting/Note.h' --- qtiplot/src/scripting/Note.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/Note.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,105 @@ +/*************************************************************************** + File : Note.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 - 2009 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Notes window class + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef NOTE_H +#define NOTE_H + +#include +#include +#include +#include +#include + +class ScriptingEnv; + +/*!\brief Notes window class. + * + */ +class Note: public MdiSubWindow +{ + Q_OBJECT + +public: + + Note(ScriptingEnv *env, const QString& label, ApplicationWindow* parent, const QString& name = QString(), Qt::WFlags f=0); + ~Note(){}; + + void init(ScriptingEnv *env); + void setName(const QString& name); + void setTabStopWidth(int length); + int indexOf(ScriptEdit* editor); + ScriptEdit* editor(int index); + ScriptEdit* currentEditor(); + int tabs(){return d_tab_widget->count();}; + void renameTab(int, const QString&); + + void save(const QString& fn, const QString &info, bool = false); + void restore(const QStringList&); + +public slots: + bool autoexec() const { return autoExec; } + void setAutoexec(bool); + void modifiedNote(); + + // ScriptEdit methods + QString text() { if(currentEditor()) return currentEditor()->text(); return QString::null;}; + void setText(const QString &s) { if(currentEditor()) currentEditor()->setText(s); }; + void print() { if(currentEditor()) currentEditor()->print(); }; + void print(QPrinter *printer) { if(currentEditor()) currentEditor()->print(printer); }; + void exportPDF(const QString& fileName){if(currentEditor()) currentEditor()->exportPDF(fileName);}; + QString exportASCII(const QString &file=QString::null) { if(currentEditor()) return currentEditor()->exportASCII(file); return QString::null;}; + QString importASCII(const QString &file=QString::null){ if(currentEditor()) return currentEditor()->importASCII(file); return QString::null;}; + void execute() { if(currentEditor()) currentEditor()->execute(); }; + void executeAll() { if(currentEditor()) currentEditor()->executeAll(); }; + void evaluate() { if(currentEditor()) currentEditor()->evaluate(); }; + void setDirPath(const QString& path){if(currentEditor()) currentEditor()->setDirPath(path);}; + + //! Enables/Disables the line number display + void showLineNumbers(bool show = true); + bool hasLineNumbers(){return d_line_number_enabled;}; + + void setFont(const QFont& f); + void addTab(); + void removeTab(int = -1); + void renameCurrentTab(); + + signals: + void dirPathChanged(const QString& path); + void currentEditorChanged(); + +private: + void saveTab(int index, const QString &fn); + + ScriptingEnv *d_env; + QWidget *d_frame; + QTabWidget *d_tab_widget; + bool d_line_number_enabled; + bool autoExec; +}; + +#endif === removed file 'qtiplot/src/scripting/Note.h' --- qtiplot/src/scripting/Note.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/Note.h 1970-01-01 00:00:00 +0000 @@ -1,105 +0,0 @@ -/*************************************************************************** - File : Note.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 - 2009 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Notes window class - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef NOTE_H -#define NOTE_H - -#include -#include -#include -#include -#include - -class ScriptingEnv; - -/*!\brief Notes window class. - * - */ -class Note: public MdiSubWindow -{ - Q_OBJECT - -public: - - Note(ScriptingEnv *env, const QString& label, ApplicationWindow* parent, const QString& name = QString(), Qt::WFlags f=0); - ~Note(){}; - - void init(ScriptingEnv *env); - void setName(const QString& name); - void setTabStopWidth(int length); - int indexOf(ScriptEdit* editor); - ScriptEdit* editor(int index); - ScriptEdit* currentEditor(); - int tabs(){return d_tab_widget->count();}; - void renameTab(int, const QString&); - - void save(const QString& fn, const QString &info, bool = false); - void restore(const QStringList&); - -public slots: - bool autoexec() const { return autoExec; } - void setAutoexec(bool); - void modifiedNote(); - - // ScriptEdit methods - QString text() { return currentEditor()->text(); }; - void setText(const QString &s) { currentEditor()->setText(s); }; - void print() { currentEditor()->print(); }; - void print(QPrinter *printer) { currentEditor()->print(printer); }; - void exportPDF(const QString& fileName){currentEditor()->exportPDF(fileName);}; - QString exportASCII(const QString &file=QString::null) { return currentEditor()->exportASCII(file); }; - QString importASCII(const QString &file=QString::null){ return currentEditor()->importASCII(file);}; - void execute() { currentEditor()->execute(); }; - void executeAll() { currentEditor()->executeAll(); }; - void evaluate() { currentEditor()->evaluate(); }; - void setDirPath(const QString& path){currentEditor()->setDirPath(path);}; - - //! Enables/Disables the line number display - void showLineNumbers(bool show = true); - bool hasLineNumbers(){return d_line_number_enabled;}; - - void setFont(const QFont& f); - void addTab(); - void removeTab(int = -1); - void renameCurrentTab(); - - signals: - void dirPathChanged(const QString& path); - void currentEditorChanged(); - -private: - void saveTab(int index, const QString &fn); - - ScriptingEnv *d_env; - QWidget *d_frame; - QTabWidget *d_tab_widget; - bool d_line_number_enabled; - bool autoExec; -}; - -#endif === added file 'qtiplot/src/scripting/PythonScript.cpp' --- qtiplot/src/scripting/PythonScript.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/PythonScript.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,300 @@ +/*************************************************************************** + File : PythonScript.cpp + Project : QtiPlot +-------------------------------------------------------------------- + Copyright : (C) 2006 by Knut Franke + Email (use @ for *) : knut.franke*gmx.de + Description : Execute Python code from within QtiPlot + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +// get rid of a compiler warning +#ifdef _POSIX_C_SOURCE +#undef _POSIX_C_SOURCE +#endif +#include + +#include "PythonScript.h" +#include "PythonScripting.h" +#include + +#include +#include +#include + +PythonScript::PythonScript(PythonScripting *env, const QString &code, QObject *context, const QString &name) +: Script(env, code, context, name) +{ + PyCode = NULL; + localDict = PyDict_New(); + setQObject(Context, "self"); +} + +PythonScript::~PythonScript() +{ + Py_DECREF(localDict); + Py_XDECREF(PyCode); +} + +void PythonScript::setContext(QObject *context) +{ + Script::setContext(context); + setQObject(Context, "self"); +} + +bool PythonScript::compile(bool for_eval) +{ + // Support for the convenient col() and cell() functions. + // This can't be done anywhere else, because we need access to the local + // variables self, i and j. + if(Context->inherits("Table")) { + // A bit of a hack, but we need either IndexError or len() from __builtins__. + PyDict_SetItemString(localDict, "__builtins__", + PyDict_GetItemString(env()->globalDict(), "__builtins__")); + PyObject *ret = PyRun_String( + "def col(c,*arg):\n" + "\ttry: return self.cell(c,arg[0])\n" + "\texcept(IndexError): return self.cell(c,i)\n" + "def cell(c,r):\n" + "\treturn self.cell(c,r)\n" + "def tablecol(t,c):\n" + "\treturn self.folder().rootFolder().table(t,True).cell(c,i)\n" + "def _meth_table_col_(t,c):\n" + "\treturn t.cell(c,i)\n" + "self.__class__.col = _meth_table_col_", + Py_file_input, localDict, localDict); + if (ret) + Py_DECREF(ret); + else + PyErr_Print(); + } else if(Context->inherits("Matrix")) { + // A bit of a hack, but we need either IndexError or len() from __builtins__. + PyDict_SetItemString(localDict, "__builtins__", + PyDict_GetItemString(env()->globalDict(), "__builtins__")); + PyObject *ret = PyRun_String( + "def cell(*arg):\n" + "\ttry: return self.cell(arg[0],arg[1])\n" + "\texcept(IndexError): return self.cell(i,j)\n", + Py_file_input, localDict, localDict); + if (ret) + Py_DECREF(ret); + else + PyErr_Print(); + } + bool success=false; + Py_XDECREF(PyCode); + // Simplest case: Code is a single expression + PyCode = Py_CompileString(Code, Name, Py_eval_input); + + if (PyCode) + success = true; + else if (for_eval) { + // Code contains statements (or errors) and we want to get a return + // value from it. + // So we wrap the code into a function definition, + // execute that (as Py_file_input) and store the function object in PyCode. + // See http://mail.python.org/pipermail/python-list/2001-June/046940.html + // for why there isn't an easier way to do this in Python. + PyErr_Clear(); // silently ignore errors + PyObject *key, *value; +#if PY_VERSION_HEX >= 0x02050000 + Py_ssize_t i=0; +#else + int i=0; +#endif + QString signature = ""; + while(PyDict_Next(localDict, &i, &key, &value)) + signature.append(PyString_AsString(key)).append(","); + signature.truncate(signature.length()-1); + QString fdef = "def __doit__("+signature+"):\n"; + fdef.append(Code); + fdef.replace('\n',"\n\t"); + PyCode = Py_CompileString(fdef, Name, Py_file_input); + if (PyCode){ + PyObject *tmp = PyDict_New(); + Py_XDECREF(PyEval_EvalCode((PyCodeObject*)PyCode, env()->globalDict(), tmp)); + Py_DECREF(PyCode); + PyCode = PyDict_GetItemString(tmp,"__doit__"); + Py_XINCREF(PyCode); + Py_DECREF(tmp); + } + success = (PyCode != NULL); + } else { + // Code contains statements (or errors), but we do not need to get + // a return value. + PyErr_Clear(); // silently ignore errors + PyCode = Py_CompileString(Code, Name, Py_file_input); + success = (PyCode != NULL); + } + + if (!success){ + compiled = compileErr; + emit_error(env()->errorMsg(), 0); + } else + compiled = isCompiled; + return success; +} + +QVariant PythonScript::eval() +{ + if (!isFunction) compiled = notCompiled; + if (compiled != isCompiled && !compile(true)) + return QVariant(); + + PyObject *pyret; + beginStdoutRedirect(); + if (PyCallable_Check(PyCode)){ + PyObject *empty_tuple = PyTuple_New(0); + pyret = PyObject_Call(PyCode, empty_tuple, localDict); + Py_DECREF(empty_tuple); + } else + pyret = PyEval_EvalCode((PyCodeObject*)PyCode, env()->globalDict(), localDict); + endStdoutRedirect(); + if (!pyret){ + if (PyErr_ExceptionMatches(PyExc_ValueError) || + PyErr_ExceptionMatches(PyExc_ZeroDivisionError)){ + PyErr_Clear(); // silently ignore errors + return QVariant(""); + } else { + emit_error(env()->errorMsg(), 0); + return QVariant(); + } + } + + QVariant qret = QVariant(); + /* None */ + if (pyret == Py_None) + qret = QVariant(""); + /* numeric types */ + else if (PyFloat_Check(pyret)) + qret = QVariant(PyFloat_AS_DOUBLE(pyret)); + else if (PyInt_Check(pyret)) + qret = QVariant((qlonglong)PyInt_AS_LONG(pyret)); + else if (PyLong_Check(pyret)) + qret = QVariant((qlonglong)PyLong_AsLongLong(pyret)); + else if (PyNumber_Check(pyret)){ + PyObject *number = PyNumber_Float(pyret); + if (number){ + qret = QVariant(PyFloat_AS_DOUBLE(number)); + Py_DECREF(number); + } + /* bool */ + } else if (PyBool_Check(pyret)) + qret = QVariant(pyret==Py_True, 0); + // could handle advanced types (such as PyList->QValueList) here if needed + /* fallback: try to convert to (unicode) string */ + if(!qret.isValid()) { + PyObject *pystring = PyObject_Unicode(pyret); + if (pystring) { + PyObject *asUTF8 = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(pystring), PyUnicode_GET_DATA_SIZE(pystring), 0); + Py_DECREF(pystring); + if (asUTF8) { + qret = QVariant(QString::fromUtf8(PyString_AS_STRING(asUTF8))); + Py_DECREF(asUTF8); + } else if (pystring = PyObject_Str(pyret)) { + qret = QVariant(QString(PyString_AS_STRING(pystring))); + Py_DECREF(pystring); + } + } + } + + Py_DECREF(pyret); + + if (PyErr_Occurred()){ + if (PyErr_ExceptionMatches(PyExc_ValueError) || + PyErr_ExceptionMatches(PyExc_ZeroDivisionError)){ + PyErr_Clear(); // silently ignore errors + return QVariant(""); + } else { + emit_error(env()->errorMsg(), 0); + return QVariant(); + } + } else + return qret; +} + +bool PythonScript::exec() +{ + if (isFunction) compiled = notCompiled; + if (compiled != Script::isCompiled && !compile(false)) + return false; + PyObject *pyret; + beginStdoutRedirect(); + if (PyCallable_Check(PyCode)){ + PyObject *empty_tuple = PyTuple_New(0); + if (!empty_tuple) { + emit_error(env()->errorMsg(), 0); + return false; + } + pyret = PyObject_Call(PyCode,empty_tuple,localDict); + Py_DECREF(empty_tuple); + } else { + pyret = PyEval_EvalCode((PyCodeObject*)PyCode, env()->globalDict(), localDict); + //pyret = PyRun_String(Code, 0, env()->globalDict(), localDict); + } + + endStdoutRedirect(); + if (pyret) { + Py_DECREF(pyret); + return true; + } + emit_error(env()->errorMsg(), 0); + return false; +} + +void PythonScript::beginStdoutRedirect() +{ + stdoutSave = PyDict_GetItemString(env()->sysDict(), "stdout"); + Py_XINCREF(stdoutSave); + stderrSave = PyDict_GetItemString(env()->sysDict(), "stderr"); + Py_XINCREF(stderrSave); + env()->setQObject(this, "stdout", env()->sysDict()); + env()->setQObject(this, "stderr", env()->sysDict()); +} + +void PythonScript::endStdoutRedirect() +{ + PyDict_SetItemString(env()->sysDict(), "stdout", stdoutSave); + Py_XDECREF(stdoutSave); + PyDict_SetItemString(env()->sysDict(), "stderr", stderrSave); + Py_XDECREF(stderrSave); +} + +bool PythonScript::setQObject(QObject *val, const char *name) +{ + if (!PyDict_Contains(localDict, PyString_FromString(name))) + compiled = notCompiled; + return env()->setQObject(val, name, localDict); +} + +bool PythonScript::setInt(int val, const char *name) +{ + if (!PyDict_Contains(localDict, PyString_FromString(name))) + compiled = notCompiled; + return env()->setInt(val, name, localDict); +} + +bool PythonScript::setDouble(double val, const char *name) +{ + if (!PyDict_Contains(localDict, PyString_FromString(name))) + compiled = notCompiled; + return env()->setDouble(val, name, localDict); +} === removed file 'qtiplot/src/scripting/PythonScript.cpp' --- qtiplot/src/scripting/PythonScript.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/PythonScript.cpp 1970-01-01 00:00:00 +0000 @@ -1,300 +0,0 @@ -/*************************************************************************** - File : PythonScript.cpp - Project : QtiPlot --------------------------------------------------------------------- - Copyright : (C) 2006 by Knut Franke - Email (use @ for *) : knut.franke*gmx.de - Description : Execute Python code from within QtiPlot - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -// get rid of a compiler warning -#ifdef _POSIX_C_SOURCE -#undef _POSIX_C_SOURCE -#endif -#include - -#include "PythonScript.h" -#include "PythonScripting.h" -#include - -#include -#include -#include - -PythonScript::PythonScript(PythonScripting *env, const QString &code, QObject *context, const QString &name) -: Script(env, code, context, name) -{ - PyCode = NULL; - localDict = PyDict_New(); - setQObject(Context, "self"); -} - -PythonScript::~PythonScript() -{ - Py_DECREF(localDict); - Py_XDECREF(PyCode); -} - -void PythonScript::setContext(QObject *context) -{ - Script::setContext(context); - setQObject(Context, "self"); -} - -bool PythonScript::compile(bool for_eval) -{ - // Support for the convenient col() and cell() functions. - // This can't be done anywhere else, because we need access to the local - // variables self, i and j. - if(Context->inherits("Table")) { - // A bit of a hack, but we need either IndexError or len() from __builtins__. - PyDict_SetItemString(localDict, "__builtins__", - PyDict_GetItemString(env()->globalDict(), "__builtins__")); - PyObject *ret = PyRun_String( - "def col(c,*arg):\n" - "\ttry: return self.cell(c,arg[0])\n" - "\texcept(IndexError): return self.cell(c,i)\n" - "def cell(c,r):\n" - "\treturn self.cell(c,r)\n" - "def tablecol(t,c):\n" - "\treturn self.folder().rootFolder().table(t,True).cell(c,i)\n" - "def _meth_table_col_(t,c):\n" - "\treturn t.cell(c,i)\n" - "self.__class__.col = _meth_table_col_", - Py_file_input, localDict, localDict); - if (ret) - Py_DECREF(ret); - else - PyErr_Print(); - } else if(Context->inherits("Matrix")) { - // A bit of a hack, but we need either IndexError or len() from __builtins__. - PyDict_SetItemString(localDict, "__builtins__", - PyDict_GetItemString(env()->globalDict(), "__builtins__")); - PyObject *ret = PyRun_String( - "def cell(*arg):\n" - "\ttry: return self.cell(arg[0],arg[1])\n" - "\texcept(IndexError): return self.cell(i,j)\n", - Py_file_input, localDict, localDict); - if (ret) - Py_DECREF(ret); - else - PyErr_Print(); - } - bool success=false; - Py_XDECREF(PyCode); - // Simplest case: Code is a single expression - PyCode = Py_CompileString(Code, Name, Py_eval_input); - - if (PyCode) - success = true; - else if (for_eval) { - // Code contains statements (or errors) and we want to get a return - // value from it. - // So we wrap the code into a function definition, - // execute that (as Py_file_input) and store the function object in PyCode. - // See http://mail.python.org/pipermail/python-list/2001-June/046940.html - // for why there isn't an easier way to do this in Python. - PyErr_Clear(); // silently ignore errors - PyObject *key, *value; -#if PY_VERSION_HEX >= 0x02050000 - Py_ssize_t i=0; -#else - int i=0; -#endif - QString signature = ""; - while(PyDict_Next(localDict, &i, &key, &value)) - signature.append(PyString_AsString(key)).append(","); - signature.truncate(signature.length()-1); - QString fdef = "def __doit__("+signature+"):\n"; - fdef.append(Code); - fdef.replace('\n',"\n\t"); - PyCode = Py_CompileString(fdef, Name, Py_file_input); - if (PyCode){ - PyObject *tmp = PyDict_New(); - Py_XDECREF(PyEval_EvalCode((PyCodeObject*)PyCode, env()->globalDict(), tmp)); - Py_DECREF(PyCode); - PyCode = PyDict_GetItemString(tmp,"__doit__"); - Py_XINCREF(PyCode); - Py_DECREF(tmp); - } - success = (PyCode != NULL); - } else { - // Code contains statements (or errors), but we do not need to get - // a return value. - PyErr_Clear(); // silently ignore errors - PyCode = Py_CompileString(Code, Name, Py_file_input); - success = (PyCode != NULL); - } - - if (!success){ - compiled = compileErr; - emit_error(env()->errorMsg(), 0); - } else - compiled = isCompiled; - return success; -} - -QVariant PythonScript::eval() -{ - if (!isFunction) compiled = notCompiled; - if (compiled != isCompiled && !compile(true)) - return QVariant(); - - PyObject *pyret; - beginStdoutRedirect(); - if (PyCallable_Check(PyCode)){ - PyObject *empty_tuple = PyTuple_New(0); - pyret = PyObject_Call(PyCode, empty_tuple, localDict); - Py_DECREF(empty_tuple); - } else - pyret = PyEval_EvalCode((PyCodeObject*)PyCode, env()->globalDict(), localDict); - endStdoutRedirect(); - if (!pyret){ - if (PyErr_ExceptionMatches(PyExc_ValueError) || - PyErr_ExceptionMatches(PyExc_ZeroDivisionError)){ - PyErr_Clear(); // silently ignore errors - return QVariant(""); - } else { - emit_error(env()->errorMsg(), 0); - return QVariant(); - } - } - - QVariant qret = QVariant(); - /* None */ - if (pyret == Py_None) - qret = QVariant(""); - /* numeric types */ - else if (PyFloat_Check(pyret)) - qret = QVariant(PyFloat_AS_DOUBLE(pyret)); - else if (PyInt_Check(pyret)) - qret = QVariant((qlonglong)PyInt_AS_LONG(pyret)); - else if (PyLong_Check(pyret)) - qret = QVariant((qlonglong)PyLong_AsLongLong(pyret)); - else if (PyNumber_Check(pyret)){ - PyObject *number = PyNumber_Float(pyret); - if (number){ - qret = QVariant(PyFloat_AS_DOUBLE(number)); - Py_DECREF(number); - } - /* bool */ - } else if (PyBool_Check(pyret)) - qret = QVariant(pyret==Py_True, 0); - // could handle advanced types (such as PyList->QValueList) here if needed - /* fallback: try to convert to (unicode) string */ - if(!qret.isValid()) { - PyObject *pystring = PyObject_Unicode(pyret); - if (pystring) { - PyObject *asUTF8 = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(pystring), PyUnicode_GET_DATA_SIZE(pystring), 0); - Py_DECREF(pystring); - if (asUTF8) { - qret = QVariant(QString::fromUtf8(PyString_AS_STRING(asUTF8))); - Py_DECREF(asUTF8); - } else if (pystring = PyObject_Str(pyret)) { - qret = QVariant(QString(PyString_AS_STRING(pystring))); - Py_DECREF(pystring); - } - } - } - - Py_DECREF(pyret); - - if (PyErr_Occurred()){ - if (PyErr_ExceptionMatches(PyExc_ValueError) || - PyErr_ExceptionMatches(PyExc_ZeroDivisionError)){ - PyErr_Clear(); // silently ignore errors - return QVariant(""); - } else { - emit_error(env()->errorMsg(), 0); - return QVariant(); - } - } else - return qret; -} - -bool PythonScript::exec() -{ - if (isFunction) compiled = notCompiled; - if (compiled != Script::isCompiled && !compile(false)) - return false; - PyObject *pyret; - beginStdoutRedirect(); - if (PyCallable_Check(PyCode)){ - PyObject *empty_tuple = PyTuple_New(0); - if (!empty_tuple) { - emit_error(env()->errorMsg(), 0); - return false; - } - pyret = PyObject_Call(PyCode,empty_tuple,localDict); - Py_DECREF(empty_tuple); - } else { - pyret = PyEval_EvalCode((PyCodeObject*)PyCode, env()->globalDict(), localDict); - //pyret = PyRun_String(Code, 0, env()->globalDict(), localDict); - } - - endStdoutRedirect(); - if (pyret) { - Py_DECREF(pyret); - return true; - } - emit_error(env()->errorMsg(), 0); - return false; -} - -void PythonScript::beginStdoutRedirect() -{ - stdoutSave = PyDict_GetItemString(env()->sysDict(), "stdout"); - Py_XINCREF(stdoutSave); - stderrSave = PyDict_GetItemString(env()->sysDict(), "stderr"); - Py_XINCREF(stderrSave); - env()->setQObject(this, "stdout", env()->sysDict()); - env()->setQObject(this, "stderr", env()->sysDict()); -} - -void PythonScript::endStdoutRedirect() -{ - PyDict_SetItemString(env()->sysDict(), "stdout", stdoutSave); - Py_XDECREF(stdoutSave); - PyDict_SetItemString(env()->sysDict(), "stderr", stderrSave); - Py_XDECREF(stderrSave); -} - -bool PythonScript::setQObject(QObject *val, const char *name) -{ - if (!PyDict_Contains(localDict, PyString_FromString(name))) - compiled = notCompiled; - return env()->setQObject(val, name, localDict); -} - -bool PythonScript::setInt(int val, const char *name) -{ - if (!PyDict_Contains(localDict, PyString_FromString(name))) - compiled = notCompiled; - return env()->setInt(val, name, localDict); -} - -bool PythonScript::setDouble(double val, const char *name) -{ - if (!PyDict_Contains(localDict, PyString_FromString(name))) - compiled = notCompiled; - return env()->setDouble(val, name, localDict); -} === added file 'qtiplot/src/scripting/PythonScript.h' --- qtiplot/src/scripting/PythonScript.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/PythonScript.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,70 @@ +/*************************************************************************** + File : PythonScript.h + Project : QtiPlot +-------------------------------------------------------------------- + Copyright : (C) 2006 by Knut Franke + Email (use @ for *) : knut.franke*gmx.de + Description : Execute Python code from within QtiPlot + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef PYTHON_SCRIPT_H +#define PYTHON_SCRIPT_H + +#include "Script.h" + +class QObject; +class QString; + +typedef struct _object PyObject; +class PythonScripting; +class ScriptingEnv; + +class PythonScript : public Script +{ + Q_OBJECT + + public: + PythonScript(PythonScripting *env, const QString &code, QObject *context=0, const QString &name=""); + ~PythonScript(); + + void write(const QString &text) { emit print(text); } + + public slots: + bool compile(bool for_eval=true); + QVariant eval(); + bool exec(); + bool setQObject(QObject *val, const char *name); + bool setInt(int val, const char* name); + bool setDouble(double val, const char* name); + void setContext(QObject *context); + + private: + PythonScripting *env() { return (PythonScripting*)Env; } + void beginStdoutRedirect(); + void endStdoutRedirect(); + + PyObject *PyCode, *localDict, *stdoutSave, *stderrSave; + bool isFunction; +}; + + +#endif === removed file 'qtiplot/src/scripting/PythonScript.h' --- qtiplot/src/scripting/PythonScript.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/PythonScript.h 1970-01-01 00:00:00 +0000 @@ -1,70 +0,0 @@ -/*************************************************************************** - File : PythonScript.h - Project : QtiPlot --------------------------------------------------------------------- - Copyright : (C) 2006 by Knut Franke - Email (use @ for *) : knut.franke*gmx.de - Description : Execute Python code from within QtiPlot - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef PYTHON_SCRIPT_H -#define PYTHON_SCRIPT_H - -#include "Script.h" - -class QObject; -class QString; - -typedef struct _object PyObject; -class PythonScripting; -class ScriptingEnv; - -class PythonScript : public Script -{ - Q_OBJECT - - public: - PythonScript(PythonScripting *env, const QString &code, QObject *context=0, const QString &name=""); - ~PythonScript(); - - void write(const QString &text) { emit print(text); } - - public slots: - bool compile(bool for_eval=true); - QVariant eval(); - bool exec(); - bool setQObject(QObject *val, const char *name); - bool setInt(int val, const char* name); - bool setDouble(double val, const char* name); - void setContext(QObject *context); - - private: - PythonScripting *env() { return (PythonScripting*)Env; } - void beginStdoutRedirect(); - void endStdoutRedirect(); - - PyObject *PyCode, *localDict, *stdoutSave, *stderrSave; - bool isFunction; -}; - - -#endif === added file 'qtiplot/src/scripting/PythonScripting.cpp' --- qtiplot/src/scripting/PythonScripting.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/PythonScripting.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,415 @@ +/*************************************************************************** + File : PythonScripting.cpp + Project : QtiPlot +-------------------------------------------------------------------- + Copyright : (C) 2006 by Knut Franke + Email (use @ for *) : knut.franke*gmx.de + Description : Execute Python code from within QtiPlot + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +// get rid of a compiler warning +#ifdef _POSIX_C_SOURCE +#undef _POSIX_C_SOURCE +#endif +#include +#include +#include +#include +#include + +#if PY_VERSION_HEX < 0x020400A1 +typedef struct _traceback { + PyObject_HEAD + struct _traceback *tb_next; + PyFrameObject *tb_frame; + int tb_lasti; + int tb_lineno; +} PyTracebackObject; +#endif + +#include "PythonScript.h" +#include "PythonScripting.h" +#include + +#include +#include +#include +#include +#include +#include + +// includes sip.h, which undefines Qt's "slots" macro since SIP 4.6 +#include "sipAPIqti.h" +extern "C" void initqti(); + +const char* PythonScripting::langName = "Python"; + +QString PythonScripting::toString(PyObject *object, bool decref) +{ + QString ret; + if (!object) return ""; + PyObject *repr = PyObject_Str(object); + if (decref) Py_DECREF(object); + if (!repr) return ""; + ret = PyString_AsString(repr); + Py_DECREF(repr); + return ret; +} + +PyObject *PythonScripting::eval(const QString &code, PyObject *argDict, const char *name) +{ + PyObject *args; + if (argDict) + { + Py_INCREF(argDict); + args = argDict; + } else + args = PyDict_New(); + PyObject *ret=NULL; + PyObject *co = Py_CompileString(code.ascii(), name, Py_eval_input); + if (co) + { + ret = PyEval_EvalCode((PyCodeObject*)co, globals, args); + Py_DECREF(co); + } + Py_DECREF(args); + return ret; +} + +bool PythonScripting::exec (const QString &code, PyObject *argDict, const char *name) +{ + PyObject *args; + if (argDict) + { + Py_INCREF(argDict); + args = argDict; + } else + args = PyDict_New(); + PyObject *tmp = NULL; + PyObject *co = Py_CompileString(code.ascii(), name, Py_file_input); + if (co) + { + tmp = PyEval_EvalCode((PyCodeObject*)co, globals, args); + Py_DECREF(co); + } + Py_DECREF(args); + if (!tmp) return false; + Py_DECREF(tmp); + return true; +} + +QString PythonScripting::errorMsg() +{ + PyObject *exception=0, *value=0, *traceback=0; + PyTracebackObject *excit=0; + PyFrameObject *frame; + char *fname; + QString msg; + if (!PyErr_Occurred()) return ""; + + PyErr_Fetch(&exception, &value, &traceback); + PyErr_NormalizeException(&exception, &value, &traceback); + if(PyErr_GivenExceptionMatches(exception, PyExc_SyntaxError)) + { + QString text = toString(PyObject_GetAttrString(value, "text"), true); + msg.append(text + "\n"); + PyObject *offset = PyObject_GetAttrString(value, "offset"); + for (int i=0; i<(PyInt_AsLong(offset)-1); i++) + if (text[i] == '\t') + msg.append("\t"); + else + msg.append(" "); + msg.append("^\n"); + Py_DECREF(offset); + msg.append("SyntaxError: "); + msg.append(toString(PyObject_GetAttrString(value, "msg"), true) + "\n"); + msg.append("at ").append(toString(PyObject_GetAttrString(value, "filename"), true)); + msg.append(":").append(toString(PyObject_GetAttrString(value, "lineno"), true)); + msg.append("\n"); + Py_DECREF(exception); + Py_DECREF(value); + } else { + msg.append(toString(exception,true)).remove("exceptions.").append(": "); + msg.append(toString(value,true)); + msg.append("\n"); + } + + if (traceback) { + excit = (PyTracebackObject*)traceback; + while (excit && (PyObject*)excit != Py_None) + { + frame = excit->tb_frame; + msg.append("at ").append(PyString_AsString(frame->f_code->co_filename)); + msg.append(":").append(QString::number(excit->tb_lineno)); + if (frame->f_code->co_name && *(fname = PyString_AsString(frame->f_code->co_name)) != '?') + msg.append(" in ").append(fname); + msg.append("\n"); + excit = excit->tb_next; + } + Py_DECREF(traceback); + } + + return msg; +} + +PythonScripting::PythonScripting(ApplicationWindow *parent) + : ScriptingEnv(parent, langName) +{ + PyObject *mainmod=NULL, *qtimod=NULL, *sysmod=NULL; + math = NULL; + sys = NULL; + d_initialized = false; + if (Py_IsInitialized()) + { +// PyEval_AcquireLock(); + mainmod = PyImport_ImportModule("__main__"); + if (!mainmod) + { + PyErr_Print(); +// PyEval_ReleaseLock(); + return; + } + globals = PyModule_GetDict(mainmod); + Py_DECREF(mainmod); + } else { +// PyEval_InitThreads (); + Py_Initialize (); + if (!Py_IsInitialized ()) + return; + initqti(); + + mainmod = PyImport_AddModule("__main__"); + if (!mainmod) + { +// PyEval_ReleaseLock(); + PyErr_Print(); + return; + } + globals = PyModule_GetDict(mainmod); + } + + if (!globals) + { + PyErr_Print(); +// PyEval_ReleaseLock(); + return; + } + Py_INCREF(globals); + + math = PyDict_New(); + if (!math) + PyErr_Print(); + + qtimod = PyImport_ImportModule("qti"); + if (qtimod) + { + PyDict_SetItemString(globals, "qti", qtimod); + PyObject *qtiDict = PyModule_GetDict(qtimod); + if (!setQObject(d_parent, "app", qtiDict)) + QMessageBox::warning(d_parent, tr("Failed to export QtiPlot API"), + tr("Accessing QtiPlot functions or objects from Python code won't work. "\ + "Probably your version of Qt/SIP/PyQt differs from the one QtiPlot was compiled against.")); + + PyDict_SetItemString(qtiDict, "mathFunctions", math); + Py_DECREF(qtimod); + } else + PyErr_Print(); + + sysmod = PyImport_ImportModule("sys"); + if (sysmod) + { + sys = PyModule_GetDict(sysmod); + Py_INCREF(sys); + } else + PyErr_Print(); + +// PyEval_ReleaseLock(); + d_initialized = true; +} + +bool PythonScripting::initialize() +{ + if (!d_initialized) return false; +// PyEval_AcquireLock(); + + // Redirect output to the print(const QString&) signal. + // Also see method write(const QString&) and Python documentation on + // sys.stdout and sys.stderr. + setQObject(this, "stdout", sys); + setQObject(this, "stderr", sys); + + bool initialized = loadInitFile(d_parent->d_python_config_folder + "/qtiplotrc"); + if(!initialized) + initialized = loadInitFile(d_parent->d_python_config_folder + "/.qtiplotrc"); + + if(!initialized){ + QMessageBox::critical(d_parent, tr("Couldn't find initialization files"), + tr("Please indicate the correct path to the Python configuration files in the preferences dialog.")); + } + + return initialized; + +// PyEval_ReleaseLock(); +} + +PythonScripting::~PythonScripting() +{ + Py_XDECREF(globals); + Py_XDECREF(math); + Py_XDECREF(sys); +} + +bool PythonScripting::loadInitFile(const QString &path) +{ + QFileInfo pyFile(path+".py"), pycFile(path+".pyc"); + bool success = false; + if (pycFile.isReadable() && (pycFile.lastModified() >= pyFile.lastModified())) { + // if we have a recent pycFile, use it + FILE *f = fopen(pycFile.filePath(), "rb"); + success = PyRun_SimpleFileEx(f, pycFile.filePath(), false) == 0; + fclose(f); + } else if (pyFile.isReadable() && pyFile.exists()) { + // try to compile pyFile to pycFile + PyObject *compileModule = PyImport_ImportModule("py_compile"); + if (compileModule) { + PyObject *compile = PyDict_GetItemString(PyModule_GetDict(compileModule), "compile"); + if (compile) { + PyObject *tmp = PyObject_CallFunctionObjArgs(compile, + PyString_FromString(pyFile.filePath()), + PyString_FromString(pycFile.filePath()), + NULL); + if (tmp) + Py_DECREF(tmp); + else + PyErr_Print(); + } else + PyErr_Print(); + Py_DECREF(compileModule); + } else + PyErr_Print(); + pycFile.refresh(); + if (pycFile.isReadable() && (pycFile.lastModified() >= pyFile.lastModified())) { + // run the newly compiled pycFile + FILE *f = fopen(pycFile.filePath(), "rb"); + success = PyRun_SimpleFileEx(f, pycFile.filePath(), false) == 0; + fclose(f); + } else { + // fallback: just run pyFile + /*FILE *f = fopen(pyFile.filePath(), "r"); + success = PyRun_SimpleFileEx(f, pyFile.filePath(), false) == 0; + fclose(f);*/ + //TODO: code above crashes on Windows - bug in Python? + QFile f(pyFile.filePath()); + if (f.open(QIODevice::ReadOnly | QIODevice::Text)) { + QByteArray data = f.readAll(); + success = PyRun_SimpleString(data.data()); + f.close(); + } + } + } + return success; +} + +bool PythonScripting::isRunning() const +{ + return Py_IsInitialized(); +} + +bool PythonScripting::setQObject(QObject *val, const char *name, PyObject *dict) +{ + if(!val) return false; + PyObject *pyobj=NULL; + + PyGILState_STATE state = PyGILState_Ensure(); + + sipWrapperType * klass = sipFindClass(val->className()); + if (!klass) return false; + pyobj = sipConvertFromInstance(val, klass, NULL); + + if (!pyobj) return false; + + if (dict) + PyDict_SetItemString(dict,name,pyobj); + else + PyDict_SetItemString(globals,name,pyobj); + Py_DECREF(pyobj); + + PyGILState_Release(state); + return true; +} + +bool PythonScripting::setInt(int val, const char *name, PyObject *dict) +{ + PyObject *pyobj = Py_BuildValue("i",val); + if (!pyobj) return false; + if (dict) + PyDict_SetItemString(dict,name,pyobj); + else + PyDict_SetItemString(globals,name,pyobj); + Py_DECREF(pyobj); + return true; +} + +bool PythonScripting::setDouble(double val, const char *name, PyObject *dict) +{ + PyObject *pyobj = Py_BuildValue("d",val); + if (!pyobj) return false; + if (dict) + PyDict_SetItemString(dict,name,pyobj); + else + PyDict_SetItemString(globals,name,pyobj); + Py_DECREF(pyobj); + return true; +} + +const QStringList PythonScripting::mathFunctions() const +{ + QStringList flist; + PyObject *key, *value; +#if PY_VERSION_HEX >= 0x02050000 + Py_ssize_t i=0; +#else + int i=0; +#endif + while(PyDict_Next(math, &i, &key, &value)) + if (PyCallable_Check(value)) + flist << PyString_AsString(key); + flist.sort(); + return flist; +} + +const QString PythonScripting::mathFunctionDoc(const QString &name) const +{ + PyObject *mathf = PyDict_GetItemString(math,name); // borrowed + if (!mathf) return ""; + PyObject *pydocstr = PyObject_GetAttrString(mathf, "__doc__"); // new + QString qdocstr = PyString_AsString(pydocstr); + Py_XDECREF(pydocstr); + return qdocstr; +} + +const QStringList PythonScripting::fileExtensions() const +{ + QStringList extensions; + extensions << "py" << "PY"; + return extensions; +} === removed file 'qtiplot/src/scripting/PythonScripting.cpp' --- qtiplot/src/scripting/PythonScripting.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/PythonScripting.cpp 1970-01-01 00:00:00 +0000 @@ -1,409 +0,0 @@ -/*************************************************************************** - File : PythonScripting.cpp - Project : QtiPlot --------------------------------------------------------------------- - Copyright : (C) 2006 by Knut Franke - Email (use @ for *) : knut.franke*gmx.de - Description : Execute Python code from within QtiPlot - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -// get rid of a compiler warning -#ifdef _POSIX_C_SOURCE -#undef _POSIX_C_SOURCE -#endif -#include -#include -#include -#include -#include - -#if PY_VERSION_HEX < 0x020400A1 -typedef struct _traceback { - PyObject_HEAD - struct _traceback *tb_next; - PyFrameObject *tb_frame; - int tb_lasti; - int tb_lineno; -} PyTracebackObject; -#endif - -#include "PythonScript.h" -#include "PythonScripting.h" -#include - -#include -#include -#include -#include -#include -#include - -// includes sip.h, which undefines Qt's "slots" macro since SIP 4.6 -#include "sipAPIqti.h" -extern "C" void initqti(); - -const char* PythonScripting::langName = "Python"; - -QString PythonScripting::toString(PyObject *object, bool decref) -{ - QString ret; - if (!object) return ""; - PyObject *repr = PyObject_Str(object); - if (decref) Py_DECREF(object); - if (!repr) return ""; - ret = PyString_AsString(repr); - Py_DECREF(repr); - return ret; -} - -PyObject *PythonScripting::eval(const QString &code, PyObject *argDict, const char *name) -{ - PyObject *args; - if (argDict) - { - Py_INCREF(argDict); - args = argDict; - } else - args = PyDict_New(); - PyObject *ret=NULL; - PyObject *co = Py_CompileString(code.ascii(), name, Py_eval_input); - if (co) - { - ret = PyEval_EvalCode((PyCodeObject*)co, globals, args); - Py_DECREF(co); - } - Py_DECREF(args); - return ret; -} - -bool PythonScripting::exec (const QString &code, PyObject *argDict, const char *name) -{ - PyObject *args; - if (argDict) - { - Py_INCREF(argDict); - args = argDict; - } else - args = PyDict_New(); - PyObject *tmp = NULL; - PyObject *co = Py_CompileString(code.ascii(), name, Py_file_input); - if (co) - { - tmp = PyEval_EvalCode((PyCodeObject*)co, globals, args); - Py_DECREF(co); - } - Py_DECREF(args); - if (!tmp) return false; - Py_DECREF(tmp); - return true; -} - -QString PythonScripting::errorMsg() -{ - PyObject *exception=0, *value=0, *traceback=0; - PyTracebackObject *excit=0; - PyFrameObject *frame; - char *fname; - QString msg; - if (!PyErr_Occurred()) return ""; - - PyErr_Fetch(&exception, &value, &traceback); - PyErr_NormalizeException(&exception, &value, &traceback); - if(PyErr_GivenExceptionMatches(exception, PyExc_SyntaxError)) - { - QString text = toString(PyObject_GetAttrString(value, "text"), true); - msg.append(text + "\n"); - PyObject *offset = PyObject_GetAttrString(value, "offset"); - for (int i=0; i<(PyInt_AsLong(offset)-1); i++) - if (text[i] == '\t') - msg.append("\t"); - else - msg.append(" "); - msg.append("^\n"); - Py_DECREF(offset); - msg.append("SyntaxError: "); - msg.append(toString(PyObject_GetAttrString(value, "msg"), true) + "\n"); - msg.append("at ").append(toString(PyObject_GetAttrString(value, "filename"), true)); - msg.append(":").append(toString(PyObject_GetAttrString(value, "lineno"), true)); - msg.append("\n"); - Py_DECREF(exception); - Py_DECREF(value); - } else { - msg.append(toString(exception,true)).remove("exceptions.").append(": "); - msg.append(toString(value,true)); - msg.append("\n"); - } - - if (traceback) { - excit = (PyTracebackObject*)traceback; - while (excit && (PyObject*)excit != Py_None) - { - frame = excit->tb_frame; - msg.append("at ").append(PyString_AsString(frame->f_code->co_filename)); - msg.append(":").append(QString::number(excit->tb_lineno)); - if (frame->f_code->co_name && *(fname = PyString_AsString(frame->f_code->co_name)) != '?') - msg.append(" in ").append(fname); - msg.append("\n"); - excit = excit->tb_next; - } - Py_DECREF(traceback); - } - - return msg; -} - -PythonScripting::PythonScripting(ApplicationWindow *parent) - : ScriptingEnv(parent, langName) -{ - PyObject *mainmod=NULL, *qtimod=NULL, *sysmod=NULL; - math = NULL; - sys = NULL; - d_initialized = false; - if (Py_IsInitialized()) - { -// PyEval_AcquireLock(); - mainmod = PyImport_ImportModule("__main__"); - if (!mainmod) - { - PyErr_Print(); -// PyEval_ReleaseLock(); - return; - } - globals = PyModule_GetDict(mainmod); - Py_DECREF(mainmod); - } else { -// PyEval_InitThreads (); - Py_Initialize (); - if (!Py_IsInitialized ()) - return; - initqti(); - - mainmod = PyImport_AddModule("__main__"); - if (!mainmod) - { -// PyEval_ReleaseLock(); - PyErr_Print(); - return; - } - globals = PyModule_GetDict(mainmod); - } - - if (!globals) - { - PyErr_Print(); -// PyEval_ReleaseLock(); - return; - } - Py_INCREF(globals); - - math = PyDict_New(); - if (!math) - PyErr_Print(); - - qtimod = PyImport_ImportModule("qti"); - if (qtimod) - { - PyDict_SetItemString(globals, "qti", qtimod); - PyObject *qtiDict = PyModule_GetDict(qtimod); - if (!setQObject(d_parent, "app", qtiDict)) - QMessageBox::warning(d_parent, tr("Failed to export QtiPlot API"), - tr("Accessing QtiPlot functions or objects from Python code won't work. "\ - "Probably your version of Qt/SIP/PyQt differs from the one QtiPlot was compiled against.")); - - PyDict_SetItemString(qtiDict, "mathFunctions", math); - Py_DECREF(qtimod); - } else - PyErr_Print(); - - sysmod = PyImport_ImportModule("sys"); - if (sysmod) - { - sys = PyModule_GetDict(sysmod); - Py_INCREF(sys); - } else - PyErr_Print(); - -// PyEval_ReleaseLock(); - d_initialized = true; -} - -bool PythonScripting::initialize() -{ - if (!d_initialized) return false; -// PyEval_AcquireLock(); - - // Redirect output to the print(const QString&) signal. - // Also see method write(const QString&) and Python documentation on - // sys.stdout and sys.stderr. - setQObject(this, "stdout", sys); - setQObject(this, "stderr", sys); - - bool initialized = loadInitFile(d_parent->d_python_config_folder + "/qtiplotrc"); - if(!initialized) - initialized = loadInitFile(d_parent->d_python_config_folder + "/.qtiplotrc"); - return initialized; - -// PyEval_ReleaseLock(); -} - -PythonScripting::~PythonScripting() -{ - Py_XDECREF(globals); - Py_XDECREF(math); - Py_XDECREF(sys); -} - -bool PythonScripting::loadInitFile(const QString &path) -{ - QFileInfo pyFile(path+".py"), pycFile(path+".pyc"); - bool success = false; - if (pycFile.isReadable() && (pycFile.lastModified() >= pyFile.lastModified())) { - // if we have a recent pycFile, use it - FILE *f = fopen(pycFile.filePath(), "rb"); - success = PyRun_SimpleFileEx(f, pycFile.filePath(), false) == 0; - fclose(f); - } else if (pyFile.isReadable() && pyFile.exists()) { - // try to compile pyFile to pycFile - PyObject *compileModule = PyImport_ImportModule("py_compile"); - if (compileModule) { - PyObject *compile = PyDict_GetItemString(PyModule_GetDict(compileModule), "compile"); - if (compile) { - PyObject *tmp = PyObject_CallFunctionObjArgs(compile, - PyString_FromString(pyFile.filePath()), - PyString_FromString(pycFile.filePath()), - NULL); - if (tmp) - Py_DECREF(tmp); - else - PyErr_Print(); - } else - PyErr_Print(); - Py_DECREF(compileModule); - } else - PyErr_Print(); - pycFile.refresh(); - if (pycFile.isReadable() && (pycFile.lastModified() >= pyFile.lastModified())) { - // run the newly compiled pycFile - FILE *f = fopen(pycFile.filePath(), "rb"); - success = PyRun_SimpleFileEx(f, pycFile.filePath(), false) == 0; - fclose(f); - } else { - // fallback: just run pyFile - /*FILE *f = fopen(pyFile.filePath(), "r"); - success = PyRun_SimpleFileEx(f, pyFile.filePath(), false) == 0; - fclose(f);*/ - //TODO: code above crashes on Windows - bug in Python? - QFile f(pyFile.filePath()); - if (f.open(QIODevice::ReadOnly | QIODevice::Text)) { - QByteArray data = f.readAll(); - success = PyRun_SimpleString(data.data()); - f.close(); - } - } - } - return success; -} - -bool PythonScripting::isRunning() const -{ - return Py_IsInitialized(); -} - -bool PythonScripting::setQObject(QObject *val, const char *name, PyObject *dict) -{ - if(!val) return false; - PyObject *pyobj=NULL; - - PyGILState_STATE state = PyGILState_Ensure(); - - sipWrapperType * klass = sipFindClass(val->className()); - if (!klass) return false; - pyobj = sipConvertFromInstance(val, klass, NULL); - - if (!pyobj) return false; - - if (dict) - PyDict_SetItemString(dict,name,pyobj); - else - PyDict_SetItemString(globals,name,pyobj); - Py_DECREF(pyobj); - - PyGILState_Release(state); - return true; -} - -bool PythonScripting::setInt(int val, const char *name, PyObject *dict) -{ - PyObject *pyobj = Py_BuildValue("i",val); - if (!pyobj) return false; - if (dict) - PyDict_SetItemString(dict,name,pyobj); - else - PyDict_SetItemString(globals,name,pyobj); - Py_DECREF(pyobj); - return true; -} - -bool PythonScripting::setDouble(double val, const char *name, PyObject *dict) -{ - PyObject *pyobj = Py_BuildValue("d",val); - if (!pyobj) return false; - if (dict) - PyDict_SetItemString(dict,name,pyobj); - else - PyDict_SetItemString(globals,name,pyobj); - Py_DECREF(pyobj); - return true; -} - -const QStringList PythonScripting::mathFunctions() const -{ - QStringList flist; - PyObject *key, *value; -#if PY_VERSION_HEX >= 0x02050000 - Py_ssize_t i=0; -#else - int i=0; -#endif - while(PyDict_Next(math, &i, &key, &value)) - if (PyCallable_Check(value)) - flist << PyString_AsString(key); - flist.sort(); - return flist; -} - -const QString PythonScripting::mathFunctionDoc(const QString &name) const -{ - PyObject *mathf = PyDict_GetItemString(math,name); // borrowed - if (!mathf) return ""; - PyObject *pydocstr = PyObject_GetAttrString(mathf, "__doc__"); // new - QString qdocstr = PyString_AsString(pydocstr); - Py_XDECREF(pydocstr); - return qdocstr; -} - -const QStringList PythonScripting::fileExtensions() const -{ - QStringList extensions; - extensions << "py" << "PY"; - return extensions; -} === added file 'qtiplot/src/scripting/PythonScripting.h' --- qtiplot/src/scripting/PythonScripting.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/PythonScripting.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,103 @@ +/*************************************************************************** + File : PythonScripting.h + Project : QtiPlot +-------------------------------------------------------------------- + Copyright : (C) 2006 by Knut Franke + Email (use @ for *) : knut.franke*gmx.de + Description : Execute Python code from within QtiPlot + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef PYTHON_SCRIPTING_H +#define PYTHON_SCRIPTING_H + +#include "ScriptingEnv.h" +#include "PythonScript.h" + +class QObject; +class QString; + +typedef struct _object PyObject; + +class PythonScripting: public ScriptingEnv +{ + Q_OBJECT + + public: + static const char *langName; + PythonScripting(ApplicationWindow *parent); + ~PythonScripting(); + static ScriptingEnv *constructor(ApplicationWindow *parent) { return new PythonScripting(parent); } + bool initialize(); + + void write(const QString &text) { emit print(text); } + + //! like str(object) in Python + /** + * Convert object to a string. + * Steals a reference to object if decref is true; borrows otherwise. + */ + QString toString(PyObject *object, bool decref=false); + //! evaluate a Python expression + /** + * Evaluates code, using argDict (borrowed reference) as local dictionary + * or an empty one if argDict==NULL. name is the filename Python uses when + * reporting errors. Returns a new reference; NULL means caller has to do + * exception handling. + */ + PyObject* eval(const QString &code, PyObject *argDict=NULL, const char *name=""); + //! execute a sequence of Python statements + /** + * Executes code, using argDict (borrowed reference) as local dictionary + * or an empty one if argDict==NULL. name is the filename Python uses when + * reporting errors. A false return value means caller has to do exception + * handling. + */ + bool exec(const QString &code, PyObject *argDict=NULL, const char *name=""); + QString errorMsg(); + + bool isRunning() const; + Script *newScript(const QString &code, QObject *context, const QString &name="") + { + return new PythonScript(this, code, context, name); + } + + bool setQObject(QObject*, const char*, PyObject *dict); + bool setQObject(QObject *val, const char *name) { return setQObject(val,name,NULL); } + bool setInt(int, const char*, PyObject *dict=NULL); + bool setDouble(double, const char*, PyObject *dict=NULL); + + const QStringList mathFunctions() const; + const QString mathFunctionDoc (const QString &name) const; + const QStringList fileExtensions() const; + + PyObject *globalDict() { return globals; } + PyObject *sysDict() { return sys; } + + private: + bool loadInitFile(const QString &path); + + PyObject *globals; // PyDict of global environment + PyObject *math; // PyDict of math functions + PyObject *sys; // PyDict of sys module +}; + +#endif === removed file 'qtiplot/src/scripting/PythonScripting.h' --- qtiplot/src/scripting/PythonScripting.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/PythonScripting.h 1970-01-01 00:00:00 +0000 @@ -1,103 +0,0 @@ -/*************************************************************************** - File : PythonScripting.h - Project : QtiPlot --------------------------------------------------------------------- - Copyright : (C) 2006 by Knut Franke - Email (use @ for *) : knut.franke*gmx.de - Description : Execute Python code from within QtiPlot - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef PYTHON_SCRIPTING_H -#define PYTHON_SCRIPTING_H - -#include "ScriptingEnv.h" -#include "PythonScript.h" - -class QObject; -class QString; - -typedef struct _object PyObject; - -class PythonScripting: public ScriptingEnv -{ - Q_OBJECT - - public: - static const char *langName; - PythonScripting(ApplicationWindow *parent); - ~PythonScripting(); - static ScriptingEnv *constructor(ApplicationWindow *parent) { return new PythonScripting(parent); } - bool initialize(); - - void write(const QString &text) { emit print(text); } - - //! like str(object) in Python - /** - * Convert object to a string. - * Steals a reference to object if decref is true; borrows otherwise. - */ - QString toString(PyObject *object, bool decref=false); - //! evaluate a Python expression - /** - * Evaluates code, using argDict (borrowed reference) as local dictionary - * or an empty one if argDict==NULL. name is the filename Python uses when - * reporting errors. Returns a new reference; NULL means caller has to do - * exception handling. - */ - PyObject* eval(const QString &code, PyObject *argDict=NULL, const char *name=""); - //! execute a sequence of Python statements - /** - * Executes code, using argDict (borrowed reference) as local dictionary - * or an empty one if argDict==NULL. name is the filename Python uses when - * reporting errors. A false return value means caller has to do exception - * handling. - */ - bool exec(const QString &code, PyObject *argDict=NULL, const char *name=""); - QString errorMsg(); - - bool isRunning() const; - Script *newScript(const QString &code, QObject *context, const QString &name="") - { - return new PythonScript(this, code, context, name); - } - - bool setQObject(QObject*, const char*, PyObject *dict); - bool setQObject(QObject *val, const char *name) { return setQObject(val,name,NULL); } - bool setInt(int, const char*, PyObject *dict=NULL); - bool setDouble(double, const char*, PyObject *dict=NULL); - - const QStringList mathFunctions() const; - const QString mathFunctionDoc (const QString &name) const; - const QStringList fileExtensions() const; - - PyObject *globalDict() { return globals; } - PyObject *sysDict() { return sys; } - - private: - bool loadInitFile(const QString &path); - - PyObject *globals; // PyDict of global environment - PyObject *math; // PyDict of math functions - PyObject *sys; // PyDict of sys module -}; - -#endif === added file 'qtiplot/src/scripting/PythonSyntaxHighlighter.cpp' --- qtiplot/src/scripting/PythonSyntaxHighlighter.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/PythonSyntaxHighlighter.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,189 @@ +/*************************************************************************** + File : PythonSyntaxHighlighter.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2008 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Python Syntax Highlighting based on the Qt Syntax Highlighter Example + (http://doc.trolltech.com/4.4/richtext-syntaxhighlighter.html) + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + +#include "PythonSyntaxHighlighter.h" +#include + +const QStringList PythonSyntaxHighlighter::d_keywords = QStringList() << "and" << "assert" << "break" + << "class" << "continue" << "def" << "del" + << "elif" << "else" << "except" << "exec" + << "finally" << "for" << "from" << "global" + << "if" << "import" << "in" << "is" + << "lambda" << "not" << "or" << "pass" + << "print" << "raise" << "return" << "try" << "while"; + +PythonSyntaxHighlighter::PythonSyntaxHighlighter(ScriptEdit *parent) + : SyntaxHighlighter(parent) +{ + HighlightingRule rule; + ApplicationWindow *app = parent->scriptingEnv()->application(); + + keywordFormat.setForeground(app->d_keyword_highlight_color); + keywordFormat.setFontWeight(QFont::Bold); + + foreach (QString pattern, d_keywords) { + rule.pattern = QRegExp("\\b" + pattern + "\\b"); + rule.format = keywordFormat; + pythonHighlightingRules.append(rule); + } + + classFormat.setFontWeight(QFont::Bold); + classFormat.setForeground(app->d_class_highlight_color); + rule.pattern = QRegExp("\\bQ[A-Za-z]+\\b"); + rule.format = classFormat; + pythonHighlightingRules.append(rule); +} + +void PythonSyntaxHighlighter::highlightBlock(const QString &text) +{ + QString s = text; + QRegExp comment = QRegExp("\"{3}"); + s.replace(comment, " "); + + foreach (HighlightingRule rule, pythonHighlightingRules) { + QRegExp expression(rule.pattern); + int index = s.indexOf(expression); + while (index >= 0) { + int length = expression.matchedLength(); + setFormat(index, length, rule.format); + index = s.indexOf(expression, index + length); + } + } + + SyntaxHighlighter::highlightBlock(text);//process common rules and parentheses matching + + int startIndex = text.indexOf(comment); + int prevState = previousBlockState (); + int comments = text.count(comment); + + if (comments > 1){ + int aux = 1; + if (prevState == 1) + setFormat(0, startIndex + 3, commentFormat); + + while (aux < comments) { + int endIndex = text.indexOf(comment, startIndex + 3); + aux++; + if ((!prevState && (aux %2 == 0)) || (prevState == 1 && (aux %2 != 0))) + setFormat(startIndex, endIndex - startIndex + 3, commentFormat); + + startIndex = endIndex; + } + + int state = 0; + if ((!prevState && (comments % 2 != 0)) || (prevState && (comments % 2 == 0))){ + state = 1; + setFormat(startIndex, text.length() - startIndex, commentFormat); + } + setCurrentBlockState(state); + } else if (comments == 1){ + if (prevState == 1){ + setCurrentBlockState(0);// end of comment block + setFormat(0, startIndex + 3, commentFormat); + } else { + setCurrentBlockState(1);// start of comment block + setFormat(startIndex, text.length() - startIndex, commentFormat); + } + } else { + if (prevState == 1){ + setCurrentBlockState(1);// inside comment block + setFormat(0, text.length(), commentFormat); + } else + setCurrentBlockState(0);// outside comment block + } +} + +SyntaxHighlighter::SyntaxHighlighter(ScriptEdit * parent) : QSyntaxHighlighter(parent->document()) +{ + HighlightingRule rule; + ApplicationWindow *app = parent->scriptingEnv()->application(); + + functionFormat.setFontItalic(true); + functionFormat.setForeground(app->d_function_highlight_color); + rule.pattern = QRegExp("\\b[A-Za-z0-9_]+(?=\\()"); + rule.format = functionFormat; + highlightingRules.append(rule); + + numericFormat.setForeground(app->d_numeric_highlight_color); + rule.pattern = QRegExp("\\b\\d+[eE.,]*\\d*\\b"); + rule.format = numericFormat; + highlightingRules.append(rule); + + quotationFormat.setForeground(app->d_quotation_highlight_color); + rule.pattern = QRegExp("\".*\""); + rule.pattern.setMinimal(true); + rule.format = quotationFormat; + highlightingRules.append(rule); + + commentFormat.setForeground(app->d_comment_highlight_color); + rule.pattern = QRegExp("#[^\n]*"); + rule.format = commentFormat; + highlightingRules.append(rule); +} + +//! Parentheses matching code taken from Qt Quarterly Issue 31 Q3 2009 +void SyntaxHighlighter::highlightBlock(const QString &text) +{ + QString s = text; + foreach (HighlightingRule rule, highlightingRules) { + QRegExp expression(rule.pattern); + int index = s.indexOf(expression); + while (index >= 0) { + int length = expression.matchedLength(); + setFormat(index, length, rule.format); + index = s.indexOf(expression, index + length); + } + } + + TextBlockData *data = new TextBlockData; + + int leftPos = text.indexOf('('); + while (leftPos != -1) { + ParenthesisInfo *info = new ParenthesisInfo; + info->character = '('; + info->position = leftPos; + + data->insert(info); + leftPos = text.indexOf('(', leftPos + 1); + } + + int rightPos = text.indexOf(')'); + while (rightPos != -1) { + ParenthesisInfo *info = new ParenthesisInfo; + info->character = ')'; + info->position = rightPos; + + data->insert(info); + + rightPos = text.indexOf(')', rightPos +1); + } + + setCurrentBlockUserData(data); +} === removed file 'qtiplot/src/scripting/PythonSyntaxHighlighter.cpp' --- qtiplot/src/scripting/PythonSyntaxHighlighter.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/PythonSyntaxHighlighter.cpp 1970-01-01 00:00:00 +0000 @@ -1,189 +0,0 @@ -/*************************************************************************** - File : PythonSyntaxHighlighter.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2008 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Python Syntax Highlighting based on the Qt Syntax Highlighter Example - (http://doc.trolltech.com/4.4/richtext-syntaxhighlighter.html) - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#include "PythonSyntaxHighlighter.h" -#include - -const QStringList PythonSyntaxHighlighter::d_keywords = QStringList() << "and" << "assert" << "break" - << "class" << "continue" << "def" << "del" - << "elif" << "else" << "except" << "exec" - << "finally" << "for" << "from" << "global" - << "if" << "import" << "in" << "is" - << "lambda" << "not" << "or" << "pass" - << "print" << "raise" << "return" << "try" << "while"; - -PythonSyntaxHighlighter::PythonSyntaxHighlighter(ScriptEdit *parent) - : SyntaxHighlighter(parent) -{ - HighlightingRule rule; - ApplicationWindow *app = parent->scriptingEnv()->application(); - - keywordFormat.setForeground(app->d_keyword_highlight_color); - keywordFormat.setFontWeight(QFont::Bold); - - foreach (QString pattern, d_keywords) { - rule.pattern = QRegExp("\\b" + pattern + "\\b"); - rule.format = keywordFormat; - pythonHighlightingRules.append(rule); - } - - classFormat.setFontWeight(QFont::Bold); - classFormat.setForeground(app->d_class_highlight_color); - rule.pattern = QRegExp("\\bQ[A-Za-z]+\\b"); - rule.format = classFormat; - pythonHighlightingRules.append(rule); -} - -void PythonSyntaxHighlighter::highlightBlock(const QString &text) -{ - QString s = text; - QRegExp comment = QRegExp("\"{3}"); - s.replace(comment, " "); - - foreach (HighlightingRule rule, pythonHighlightingRules) { - QRegExp expression(rule.pattern); - int index = s.indexOf(expression); - while (index >= 0) { - int length = expression.matchedLength(); - setFormat(index, length, rule.format); - index = s.indexOf(expression, index + length); - } - } - - SyntaxHighlighter::highlightBlock(text);//process common rules and parentheses matching - - int startIndex = text.indexOf(comment); - int prevState = previousBlockState (); - int comments = text.count(comment); - - if (comments > 1){ - int aux = 1; - if (prevState == 1) - setFormat(0, startIndex + 3, commentFormat); - - while (aux < comments) { - int endIndex = text.indexOf(comment, startIndex + 3); - aux++; - if ((!prevState && (aux %2 == 0)) || (prevState == 1 && (aux %2 != 0))) - setFormat(startIndex, endIndex - startIndex + 3, commentFormat); - - startIndex = endIndex; - } - - int state = 0; - if ((!prevState && (comments % 2 != 0)) || (prevState && (comments % 2 == 0))){ - state = 1; - setFormat(startIndex, text.length() - startIndex, commentFormat); - } - setCurrentBlockState(state); - } else if (comments == 1){ - if (prevState == 1){ - setCurrentBlockState(0);// end of comment block - setFormat(0, startIndex + 3, commentFormat); - } else { - setCurrentBlockState(1);// start of comment block - setFormat(startIndex, text.length() - startIndex, commentFormat); - } - } else { - if (prevState == 1){ - setCurrentBlockState(1);// inside comment block - setFormat(0, text.length(), commentFormat); - } else - setCurrentBlockState(0);// outside comment block - } -} - -SyntaxHighlighter::SyntaxHighlighter(ScriptEdit * parent) : QSyntaxHighlighter(parent->document()) -{ - HighlightingRule rule; - ApplicationWindow *app = parent->scriptingEnv()->application(); - - functionFormat.setFontItalic(true); - functionFormat.setForeground(app->d_function_highlight_color); - rule.pattern = QRegExp("\\b[A-Za-z0-9_]+(?=\\()"); - rule.format = functionFormat; - highlightingRules.append(rule); - - numericFormat.setForeground(app->d_numeric_highlight_color); - rule.pattern = QRegExp("\\b\\d+[eE.]*\\d*\\b"); - rule.format = numericFormat; - highlightingRules.append(rule); - - quotationFormat.setForeground(app->d_quotation_highlight_color); - rule.pattern = QRegExp("\".*\""); - rule.pattern.setMinimal(true); - rule.format = quotationFormat; - highlightingRules.append(rule); - - commentFormat.setForeground(app->d_comment_highlight_color); - rule.pattern = QRegExp("#[^\n]*"); - rule.format = commentFormat; - highlightingRules.append(rule); -} - -//! Parentheses matching code taken from Qt Quarterly Issue 31 Q3 2009 -void SyntaxHighlighter::highlightBlock(const QString &text) -{ - QString s = text; - foreach (HighlightingRule rule, highlightingRules) { - QRegExp expression(rule.pattern); - int index = s.indexOf(expression); - while (index >= 0) { - int length = expression.matchedLength(); - setFormat(index, length, rule.format); - index = s.indexOf(expression, index + length); - } - } - - TextBlockData *data = new TextBlockData; - - int leftPos = text.indexOf('('); - while (leftPos != -1) { - ParenthesisInfo *info = new ParenthesisInfo; - info->character = '('; - info->position = leftPos; - - data->insert(info); - leftPos = text.indexOf('(', leftPos + 1); - } - - int rightPos = text.indexOf(')'); - while (rightPos != -1) { - ParenthesisInfo *info = new ParenthesisInfo; - info->character = ')'; - info->position = rightPos; - - data->insert(info); - - rightPos = text.indexOf(')', rightPos +1); - } - - setCurrentBlockUserData(data); -} === added file 'qtiplot/src/scripting/PythonSyntaxHighlighter.h' --- qtiplot/src/scripting/PythonSyntaxHighlighter.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/PythonSyntaxHighlighter.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,89 @@ +/*************************************************************************** + File : PythonSyntaxHighlighter.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2008 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Python Syntax Highlighting based on the Qt Syntax Highlighter Example + (http://doc.trolltech.com/4.4/richtext-syntaxhighlighter.html) + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + +#ifndef PYTHON_HIGHLIGHTER_H +#define PYTHON_HIGHLIGHTER_H + +#include +#include +#include + +#include "ScriptEdit.h" + +QT_BEGIN_NAMESPACE +class QTextDocument; +QT_END_NAMESPACE + +class SyntaxHighlighter : public QSyntaxHighlighter +{ + Q_OBJECT + +public: + SyntaxHighlighter(ScriptEdit * parent); + +protected: + void highlightBlock(const QString &text); + + struct HighlightingRule + { + QRegExp pattern; + QTextCharFormat format; + }; + + QVector highlightingRules; + + QTextCharFormat commentFormat; + QTextCharFormat quotationFormat; + QTextCharFormat functionFormat; + QTextCharFormat numericFormat; +}; + +class PythonSyntaxHighlighter : public SyntaxHighlighter +{ + Q_OBJECT + +public: + PythonSyntaxHighlighter(ScriptEdit *parent); + + static QStringList keywordsList(){return d_keywords;}; + +protected: + void highlightBlock(const QString &text); + +private: + QVector pythonHighlightingRules; + + QTextCharFormat keywordFormat; + QTextCharFormat classFormat; + + static const QStringList d_keywords; +}; + +#endif === removed file 'qtiplot/src/scripting/PythonSyntaxHighlighter.h' --- qtiplot/src/scripting/PythonSyntaxHighlighter.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/PythonSyntaxHighlighter.h 1970-01-01 00:00:00 +0000 @@ -1,89 +0,0 @@ -/*************************************************************************** - File : PythonSyntaxHighlighter.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2008 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Python Syntax Highlighting based on the Qt Syntax Highlighter Example - (http://doc.trolltech.com/4.4/richtext-syntaxhighlighter.html) - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#ifndef PYTHON_HIGHLIGHTER_H -#define PYTHON_HIGHLIGHTER_H - -#include -#include -#include - -#include "ScriptEdit.h" - -QT_BEGIN_NAMESPACE -class QTextDocument; -QT_END_NAMESPACE - -class SyntaxHighlighter : public QSyntaxHighlighter -{ - Q_OBJECT - -public: - SyntaxHighlighter(ScriptEdit * parent); - -protected: - void highlightBlock(const QString &text); - - struct HighlightingRule - { - QRegExp pattern; - QTextCharFormat format; - }; - - QVector highlightingRules; - - QTextCharFormat commentFormat; - QTextCharFormat quotationFormat; - QTextCharFormat functionFormat; - QTextCharFormat numericFormat; -}; - -class PythonSyntaxHighlighter : public SyntaxHighlighter -{ - Q_OBJECT - -public: - PythonSyntaxHighlighter(ScriptEdit *parent); - - static QStringList keywordsList(){return d_keywords;}; - -protected: - void highlightBlock(const QString &text); - -private: - QVector pythonHighlightingRules; - - QTextCharFormat keywordFormat; - QTextCharFormat classFormat; - - static const QStringList d_keywords; -}; - -#endif === added file 'qtiplot/src/scripting/Script.cpp' --- qtiplot/src/scripting/Script.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/Script.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,113 @@ +/*************************************************************************** + File : Script.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Knut Franke + Email (use @ for *) : knut.franke*gmx.de + Description : Implementations of generic scripting classes + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "ScriptingEnv.h" +#include "Script.h" + +#include + +#ifdef SCRIPTING_MUPARSER +#include "muParserScript.h" +#include "muParserScripting.h" +#endif +#ifdef SCRIPTING_PYTHON +#include "PythonScript.h" +#include "PythonScripting.h" +#endif + +ScriptingLangManager::ScriptingLang ScriptingLangManager::langs[] = { +#ifdef SCRIPTING_MUPARSER + { muParserScripting::langName, muParserScripting::constructor }, +#endif +#ifdef SCRIPTING_PYTHON + { PythonScripting::langName, PythonScripting::constructor }, +#endif + { NULL, NULL } +}; + +ScriptingEnv *ScriptingLangManager::newEnv(ApplicationWindow *parent) +{ + if (!langs[0].constructor) + return NULL; + else + return langs[0].constructor(parent); +} + +ScriptingEnv *ScriptingLangManager::newEnv(const char *name, ApplicationWindow *parent) +{ + for (ScriptingLang *i = langs; i->constructor; i++) + if (!strcmp(name, i->name)) + return i->constructor(parent); + return NULL; +} + +QStringList ScriptingLangManager::languages() +{ + QStringList l; + for (ScriptingLang *i = langs; i->constructor; i++) + l << i->name; + return l; +} + +bool Script::compile(bool for_eval) +{ + Q_UNUSED(for_eval); + + emit_error("Script::compile called!", 0); + return false; +} + +QVariant Script::eval() +{ + emit_error("Script::eval called!",0); + return QVariant(); +} + +bool Script::exec() +{ + emit_error("Script::exec called!",0); + return false; +} + +scripted::scripted(ScriptingEnv *env) +{ + env->incref(); + scriptEnv = env; +} + +scripted::~scripted() +{ + scriptEnv->decref(); +} + +void scripted::scriptingChangeEvent(ScriptingChangeEvent *sce) +{ + scriptEnv->decref(); + sce->scriptingEnv()->incref(); + scriptEnv = sce->scriptingEnv(); +} === removed file 'qtiplot/src/scripting/Script.cpp' --- qtiplot/src/scripting/Script.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/Script.cpp 1970-01-01 00:00:00 +0000 @@ -1,113 +0,0 @@ -/*************************************************************************** - File : Script.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Knut Franke - Email (use @ for *) : knut.franke*gmx.de - Description : Implementations of generic scripting classes - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "ScriptingEnv.h" -#include "Script.h" - -#include - -#ifdef SCRIPTING_MUPARSER -#include "muParserScript.h" -#include "muParserScripting.h" -#endif -#ifdef SCRIPTING_PYTHON -#include "PythonScript.h" -#include "PythonScripting.h" -#endif - -ScriptingLangManager::ScriptingLang ScriptingLangManager::langs[] = { -#ifdef SCRIPTING_MUPARSER - { muParserScripting::langName, muParserScripting::constructor }, -#endif -#ifdef SCRIPTING_PYTHON - { PythonScripting::langName, PythonScripting::constructor }, -#endif - { NULL, NULL } -}; - -ScriptingEnv *ScriptingLangManager::newEnv(ApplicationWindow *parent) -{ - if (!langs[0].constructor) - return NULL; - else - return langs[0].constructor(parent); -} - -ScriptingEnv *ScriptingLangManager::newEnv(const char *name, ApplicationWindow *parent) -{ - for (ScriptingLang *i = langs; i->constructor; i++) - if (!strcmp(name, i->name)) - return i->constructor(parent); - return NULL; -} - -QStringList ScriptingLangManager::languages() -{ - QStringList l; - for (ScriptingLang *i = langs; i->constructor; i++) - l << i->name; - return l; -} - -bool Script::compile(bool for_eval) -{ - Q_UNUSED(for_eval); - - emit_error("Script::compile called!", 0); - return false; -} - -QVariant Script::eval() -{ - emit_error("Script::eval called!",0); - return QVariant(); -} - -bool Script::exec() -{ - emit_error("Script::exec called!",0); - return false; -} - -scripted::scripted(ScriptingEnv *env) -{ - env->incref(); - scriptEnv = env; -} - -scripted::~scripted() -{ - scriptEnv->decref(); -} - -void scripted::scriptingChangeEvent(ScriptingChangeEvent *sce) -{ - scriptEnv->decref(); - sce->scriptingEnv()->incref(); - scriptEnv = sce->scriptingEnv(); -} === added file 'qtiplot/src/scripting/Script.h' --- qtiplot/src/scripting/Script.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/Script.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,164 @@ +/*************************************************************************** + File : Script.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de + Description : Scripting abstraction layer + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef SCRIPT_H +#define SCRIPT_H + +#include +#include +#include +#include +#include +#include + +#include "customevents.h" +#include "ScriptingEnv.h" + +class ApplicationWindow; + +//! A chunk of scripting code. Abstract. + /** + * Script objects represent a chunk of code, possibly together with local + * variables. The code may be changed and executed multiple times during the + * lifetime of an object. + */ +class Script : public QObject +{ + Q_OBJECT + + public: + Script(ScriptingEnv *env, const QString &code, QObject *context=0, const QString &name="") + : Env(env), Code(code), Name(name), compiled(notCompiled) + { Env->incref(); Context = context; EmitErrors=true; } + ~Script() { Env->decref(); } + + //! Return the code that will be executed when calling exec() or eval() + const QString code() const { return Code; } + //! Return the context in which the code is to be executed. + QObject* context() const { return Context; } + //! Like QObject::name, but with unicode support. + const QString name() const { return Name; } + //! Return whether errors / exceptions are to be emitted or silently ignored + bool emitErrors() const { return EmitErrors; } + //! Append to the code that will be executed when calling exec() or eval() + virtual void addCode(const QString &code) { Code.append(code); compiled = notCompiled; emit codeChanged(); } + //! Set the code that will be executed when calling exec() or eval() + virtual void setCode(const QString &code) { Code=code; compiled = notCompiled; emit codeChanged(); } + //! Set the context in which the code is to be executed. + virtual void setContext(QObject *context) { Context = context; compiled = notCompiled; } + //! Like QObject::setName, but with unicode support. + void setName(const QString &name) { Name = name; compiled = notCompiled; } + //! Set whether errors / exceptions are to be emitted or silently ignored + void setEmitErrors(bool yes) { EmitErrors = yes; } + ScriptingEnv *scriptingEnv(){return Env;}; + + public slots: + //! Compile the Code. Return true if the implementation doesn't support compilation. + virtual bool compile(bool for_eval=true); + //! Evaluate the Code, returning QVariant() on an error / exception. + virtual QVariant eval(); + //! Execute the Code, returning false on an error / exception. + virtual bool exec(); + + // local variables + virtual bool setQObject(const QObject*, const char*) { return false; } + virtual bool setInt(int, const char*) { return false; } + virtual bool setDouble(double, const char*) { return false; } + + signals: + //! This is emitted whenever the code to be executed by exec() and eval() is changed. + void codeChanged(); + //! signal an error condition / exception + void error(const QString & message, const QString & scriptName, int lineNumber); + //! output generated by the code + void print(const QString & output); + + protected: + ScriptingEnv *Env; + QString Code, Name; + QObject *Context; + enum compileStatus { notCompiled, isCompiled, compileErr } compiled; + bool EmitErrors; + + void emit_error(const QString & message, int lineNumber) + { if(EmitErrors) emit error(message, Name, lineNumber); } +}; + +//! keeps a static list of available interpreters and instantiates them on demand +class ScriptingLangManager +{ + public: + //! Return an instance of the first implementation we can find. + static ScriptingEnv *newEnv(ApplicationWindow *parent); + //! Return an instance of the implementation specified by name, NULL on failure. + static ScriptingEnv *newEnv(const char *name, ApplicationWindow *parent); + //! Return the names of available implementations. + static QStringList languages(); + //! Return the number of available implementations. + static int numLanguages(); + + private: + typedef ScriptingEnv*(*ScriptingEnvConstructor)(ApplicationWindow*); + typedef struct { + const char *name; + ScriptingEnvConstructor constructor; + } ScriptingLang; +//! global registry of available languages + static ScriptingLang langs[]; +}; + +//! notify an object that it should update its scripting environment (see class scripted) +class ScriptingChangeEvent : public QEvent +{ + public: + ScriptingChangeEvent(ScriptingEnv *e) : QEvent(SCRIPTING_CHANGE_EVENT), env(e) {} + ScriptingEnv *scriptingEnv() const { return env; } + Type type() const { return SCRIPTING_CHANGE_EVENT; } + private: + ScriptingEnv *env; +}; + +//! Interface for maintaining a reference to the current ScriptingEnv + /** + * Every class that wants to use a ScriptingEnv should subclass this one and + * implement slot customEvent(QEvent*) such that it forwards any + * ScriptingChangeEvents to scripted::scriptingChangeEvent. + */ +class scripted +{ + public: + scripted(ScriptingEnv* env); + ~scripted(); + void scriptingChangeEvent(ScriptingChangeEvent*); + ScriptingEnv *scriptingEnv(){return scriptEnv;}; + + protected: + ScriptingEnv *scriptEnv; +}; + +#endif === removed file 'qtiplot/src/scripting/Script.h' --- qtiplot/src/scripting/Script.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/Script.h 1970-01-01 00:00:00 +0000 @@ -1,163 +0,0 @@ -/*************************************************************************** - File : Script.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de - Description : Scripting abstraction layer - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef SCRIPT_H -#define SCRIPT_H - -#include -#include -#include -#include -#include -#include - -#include "customevents.h" -#include "ScriptingEnv.h" - -class ApplicationWindow; - -//! A chunk of scripting code. Abstract. - /** - * Script objects represent a chunk of code, possibly together with local - * variables. The code may be changed and executed multiple times during the - * lifetime of an object. - */ -class Script : public QObject -{ - Q_OBJECT - - public: - Script(ScriptingEnv *env, const QString &code, QObject *context=0, const QString &name="") - : Env(env), Code(code), Name(name), compiled(notCompiled) - { Env->incref(); Context = context; EmitErrors=true; } - ~Script() { Env->decref(); } - - //! Return the code that will be executed when calling exec() or eval() - const QString code() const { return Code; } - //! Return the context in which the code is to be executed. - QObject* context() const { return Context; } - //! Like QObject::name, but with unicode support. - const QString name() const { return Name; } - //! Return whether errors / exceptions are to be emitted or silently ignored - bool emitErrors() const { return EmitErrors; } - //! Append to the code that will be executed when calling exec() or eval() - virtual void addCode(const QString &code) { Code.append(code); compiled = notCompiled; emit codeChanged(); } - //! Set the code that will be executed when calling exec() or eval() - virtual void setCode(const QString &code) { Code=code; compiled = notCompiled; emit codeChanged(); } - //! Set the context in which the code is to be executed. - virtual void setContext(QObject *context) { Context = context; compiled = notCompiled; } - //! Like QObject::setName, but with unicode support. - void setName(const QString &name) { Name = name; compiled = notCompiled; } - //! Set whether errors / exceptions are to be emitted or silently ignored - void setEmitErrors(bool yes) { EmitErrors = yes; } - - public slots: - //! Compile the Code. Return true if the implementation doesn't support compilation. - virtual bool compile(bool for_eval=true); - //! Evaluate the Code, returning QVariant() on an error / exception. - virtual QVariant eval(); - //! Execute the Code, returning false on an error / exception. - virtual bool exec(); - - // local variables - virtual bool setQObject(const QObject*, const char*) { return false; } - virtual bool setInt(int, const char*) { return false; } - virtual bool setDouble(double, const char*) { return false; } - - signals: - //! This is emitted whenever the code to be executed by exec() and eval() is changed. - void codeChanged(); - //! signal an error condition / exception - void error(const QString & message, const QString & scriptName, int lineNumber); - //! output generated by the code - void print(const QString & output); - - protected: - ScriptingEnv *Env; - QString Code, Name; - QObject *Context; - enum compileStatus { notCompiled, isCompiled, compileErr } compiled; - bool EmitErrors; - - void emit_error(const QString & message, int lineNumber) - { if(EmitErrors) emit error(message, Name, lineNumber); } -}; - -//! keeps a static list of available interpreters and instantiates them on demand -class ScriptingLangManager -{ - public: - //! Return an instance of the first implementation we can find. - static ScriptingEnv *newEnv(ApplicationWindow *parent); - //! Return an instance of the implementation specified by name, NULL on failure. - static ScriptingEnv *newEnv(const char *name, ApplicationWindow *parent); - //! Return the names of available implementations. - static QStringList languages(); - //! Return the number of available implementations. - static int numLanguages(); - - private: - typedef ScriptingEnv*(*ScriptingEnvConstructor)(ApplicationWindow*); - typedef struct { - const char *name; - ScriptingEnvConstructor constructor; - } ScriptingLang; -//! global registry of available languages - static ScriptingLang langs[]; -}; - -//! notify an object that it should update its scripting environment (see class scripted) -class ScriptingChangeEvent : public QEvent -{ - public: - ScriptingChangeEvent(ScriptingEnv *e) : QEvent(SCRIPTING_CHANGE_EVENT), env(e) {} - ScriptingEnv *scriptingEnv() const { return env; } - Type type() const { return SCRIPTING_CHANGE_EVENT; } - private: - ScriptingEnv *env; -}; - -//! Interface for maintaining a reference to the current ScriptingEnv - /** - * Every class that wants to use a ScriptingEnv should subclass this one and - * implement slot customEvent(QEvent*) such that it forwards any - * ScriptingChangeEvents to scripted::scriptingChangeEvent. - */ -class scripted -{ - public: - scripted(ScriptingEnv* env); - ~scripted(); - void scriptingChangeEvent(ScriptingChangeEvent*); - ScriptingEnv *scriptingEnv(){return scriptEnv;}; - - protected: - ScriptingEnv *scriptEnv; -}; - -#endif === added file 'qtiplot/src/scripting/ScriptEdit.cpp' --- qtiplot/src/scripting/ScriptEdit.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/ScriptEdit.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,896 @@ +/*************************************************************************** + File : ScriptEdit.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de + Description : Editor widget for scripting code + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "ScriptEdit.h" +#include "Note.h" +#include "PythonSyntaxHighlighter.h" +#include "FindReplaceDialog.h" +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +ScriptEdit::ScriptEdit(ScriptingEnv *env, QWidget *parent, const char *name) + : QTextEdit(parent, name), scripted(env), d_error(false), d_completer(0), d_highlighter(0), + d_file_name(QString::null), d_search_string(QString::null), d_output_widget(NULL) +{ + myScript = scriptEnv->newScript("", this, name); + connect(myScript, SIGNAL(error(const QString&, const QString&, int)), this, SLOT(insertErrorMsg(const QString&))); + connect(myScript, SIGNAL(print(const QString&)), this, SLOT(scriptPrint(const QString&))); + connect(myScript, SIGNAL(error(const QString&, const QString&, int)), + this, SIGNAL(error(const QString&, const QString&, int))); + + setLineWrapMode(NoWrap); + setUndoRedoEnabled(true); + setTextFormat(Qt::PlainText); + setAcceptRichText (false); + setFocusPolicy(Qt::StrongFocus); + + rehighlight(); + + d_fmt_default.setBackground(palette().brush(QPalette::Base)); + + //Init completer based on parser built-in functions + QStringList functions = MyParser::functionNamesList(); + functions.sort(); + QCompleter *completer = new QCompleter(this); + completer->setModelSorting(QCompleter::CaseSensitivelySortedModel); + completer->setCompletionMode(QCompleter::PopupCompletion); + completer->setModel(new QStringListModel(functions, completer)); + setCompleter(completer); + + printCursor = textCursor(); + scriptsDirPath = qApp->applicationDirPath(); + + actionExecute = new QAction(tr("E&xecute"), this); + actionExecute->setShortcut( tr("Ctrl+J") ); + connect(actionExecute, SIGNAL(activated()), this, SLOT(execute())); + + actionExecuteAll = new QAction(QIcon(":/play.png"), tr("Execute &All"), this); + actionExecuteAll->setShortcut( tr("Ctrl+Shift+J") ); + connect(actionExecuteAll, SIGNAL(activated()), this, SLOT(executeAll())); + + actionEval = new QAction(tr("&Evaluate Expression"), this); + actionEval->setShortcut( tr("Ctrl+Return") ); + connect(actionEval, SIGNAL(activated()), this, SLOT(evaluate())); + + actionPrint = new QAction(QIcon(":/fileprint.png"), tr("&Print"), this); + connect(actionPrint, SIGNAL(activated()), this, SLOT(print())); + + actionImport = new QAction(QIcon(":/fileopen.png"), tr("&Import..."), this); + actionImport->setShortcut(QKeySequence(Qt::CTRL+Qt::ALT+Qt::Key_O)); + connect(actionImport, SIGNAL(activated()), this, SLOT(importASCII())); + + actionSave = new QAction(QIcon(":/filesave.png"), tr("&Save"), this); + actionSave->setShortcut(QKeySequence(Qt::CTRL+Qt::ALT+Qt::Key_S)); + connect(actionSave, SIGNAL(activated()), this, SLOT(save())); + + actionExport = new QAction(QIcon(":/filesaveas.png"), tr("Sa&ve as..."), this); + connect(actionExport, SIGNAL(activated()), this, SLOT(exportASCII())); + + actionFind = new QAction(QIcon(":/find.png"), tr("&Find..."), this); + actionFind->setShortcut(QKeySequence(Qt::CTRL+Qt::ALT+Qt::Key_F)); + connect(actionFind, SIGNAL(activated()), this, SLOT(showFindDialog())); + + actionReplace = new QAction(QIcon(":/replace.png"), tr("&Replace..."), this); + actionReplace->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_R)); + connect(actionReplace, SIGNAL(activated()), this, SLOT(replace())); + + actionFindNext = new QAction(QIcon(":/find_next.png"), tr("&Find next"), this); + actionFindNext->setShortcut(QKeySequence(Qt::Key_F3)); + connect(actionFindNext, SIGNAL(activated()), this, SLOT(findNext())); + + actionFindPrevious = new QAction(QIcon(":/find_previous.png"), tr("&Find previous"), this); + actionFindPrevious->setShortcut(QKeySequence(Qt::Key_F4)); + connect(actionFindPrevious, SIGNAL(activated()), this, SLOT(findPrevious())); + + functionsMenu = new QMenu(this); + Q_CHECK_PTR(functionsMenu); + connect(functionsMenu, SIGNAL(triggered(QAction *)), this, SLOT(insertFunction(QAction *))); + + connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(matchParentheses())); +} + +void ScriptEdit::enableShortcuts() +{ + QShortcut *accelFindNext = new QShortcut(actionFindNext->shortcut(), this); + connect(accelFindNext, SIGNAL(activated()), this, SLOT(findNext())); + + QShortcut *accelReplace = new QShortcut(actionReplace->shortcut(), this); + connect(accelReplace, SIGNAL(activated()), this, SLOT(replace())); + + QShortcut *accelFindPrevious = new QShortcut(actionFindPrevious->shortcut(), this); + connect(accelFindPrevious, SIGNAL(activated()), this, SLOT(findPrevious())); + + QShortcut *accelFind = new QShortcut(actionFind->shortcut(), this); + connect(accelFind, SIGNAL(activated()), this, SLOT(showFindDialog())); + + QShortcut *accelSave = new QShortcut(actionSave->shortcut(), this); + connect(accelSave, SIGNAL(activated()), this, SLOT(save())); + + QShortcut *accelImport = new QShortcut(actionImport->shortcut(), this); + connect(accelImport, SIGNAL(activated()), this, SLOT(importASCII())); + + QShortcut *accelEval = new QShortcut(actionEval->shortcut(), this); + connect(accelEval, SIGNAL(activated()), this, SLOT(evaluate())); +} + +void ScriptEdit::customEvent(QEvent *e) +{ + if (e->type() == SCRIPTING_CHANGE_EVENT) + { + scriptingChangeEvent((ScriptingChangeEvent*)e); + delete myScript; + myScript = scriptEnv->newScript("", this, name()); + connect(myScript, SIGNAL(error(const QString&, const QString&, int)), this, SLOT(insertErrorMsg(const QString&))); + connect(myScript, SIGNAL(print(const QString&)), this, SLOT(scriptPrint(const QString&))); + + rehighlight(); + } +} + +void ScriptEdit::focusInEvent(QFocusEvent *e) +{ + if (d_completer) + d_completer->setWidget(this); + + activated(this); + return QTextEdit::focusInEvent(e); +} + +void ScriptEdit::keyPressEvent(QKeyEvent *e) +{ + if (d_completer && d_completer->popup()->isVisible()){ + // The following keys are forwarded by the completer to the widget + switch (e->key()) { + case Qt::Key_Enter: + case Qt::Key_Return: + case Qt::Key_Escape: + case Qt::Key_Tab: + case Qt::Key_Backtab: + e->ignore(); + return; // let the completer do default behavior + default: + break; + } + } + + QTextEdit::keyPressEvent(e); + if (d_completer && !d_completer->popup()->isVisible() && e->key() == Qt::Key_Return) + updateIndentation(); + + bool isShortcut = ((e->modifiers() & Qt::ControlModifier) && e->key() == Qt::Key_U); // CTRL+U + const bool ctrlOrShift = e->modifiers() & (Qt::ControlModifier | Qt::ShiftModifier); + if (!d_completer || (ctrlOrShift && e->text().isEmpty())) + return; + + static QString eow("~!@#$%^&*()_+{}|:\"<>?,./;'[]\\-="); // end of word + bool hasModifier = (e->modifiers() != Qt::NoModifier) && !ctrlOrShift; + QString completionPrefix = textUnderCursor(); + + if (!isShortcut && (hasModifier || e->text().isEmpty()|| completionPrefix.length() < 2 + || eow.contains(e->text().right(1)))){ + d_completer->popup()->hide(); + return; + } + + if (completionPrefix != d_completer->completionPrefix()){ + d_completer->setCompletionPrefix(completionPrefix); + d_completer->popup()->setCurrentIndex(d_completer->completionModel()->index(0, 0)); + } + + QRect cr = cursorRect(); + cr.setWidth(d_completer->popup()->sizeHintForColumn(0) + + d_completer->popup()->verticalScrollBar()->sizeHint().width()); + d_completer->complete(cr); // popup it up! +} + +void ScriptEdit::contextMenuEvent(QContextMenuEvent *e) +{ + QMenu *menu = createStandardContextMenu(); + Q_CHECK_PTR(menu); + + menu->insertSeparator(); + bool emptyText = toPlainText().isEmpty(); + if (!emptyText){ + menu->addAction(actionFind); + menu->addAction(actionFindNext); + menu->addAction(actionFindPrevious); + menu->addAction(actionReplace); + menu->insertSeparator(); + } + menu->addAction(actionPrint); + menu->addAction(actionImport); + menu->insertSeparator(); + menu->addAction(actionSave); + menu->addAction(actionExport); + menu->insertSeparator(); + + Note *sp = qobject_cast(myScript->context()); + if (sp){ + QAction *actionRenameTab = new QAction(tr("Rena&me Tab..."), menu); + connect(actionRenameTab, SIGNAL(activated()), sp, SLOT(renameCurrentTab())); + menu->addAction(actionRenameTab); + + QAction *actionAddTab = new QAction(QIcon(QPixmap(":/plus.png")), tr("A&dd Tab"), menu); + connect(actionAddTab, SIGNAL(activated()), sp, SLOT(addTab())); + menu->addAction(actionAddTab); + + if (sp->tabs() > 1){ + QAction *actionRemoveTab = new QAction(QIcon(QPixmap(":/delete.png")), tr("C&lose Tab"), menu); + connect(actionRemoveTab, SIGNAL(activated()), sp, SLOT(removeTab())); + menu->addAction(actionRemoveTab); + } + + menu->insertSeparator(); + } + + bool python = myScript->scriptingEnv()->name() == QString("Python"); + if (!emptyText){ + if (python){ + menu->addAction(actionExecute); + menu->addAction(actionExecuteAll); + } + menu->addAction(actionEval); + } + + if (sp && python){ + QAction *actionAutoexec = new QAction(tr("Auto&exec"), menu); + actionAutoexec->setToggleAction(true); + actionAutoexec->setOn(sp->autoexec()); + connect(actionAutoexec, SIGNAL(toggled(bool)), sp, SLOT(setAutoexec(bool))); + menu->addAction(actionAutoexec); + menu->insertSeparator(); + } + + functionsMenu->clear(); + functionsMenu->setTearOffEnabled(true); + QStringList flist = scriptEnv->mathFunctions(); + QMenu *submenu=NULL; + for (int i=0; ititle()) + submenu = functionsMenu->addMenu(menupart); + newAction = submenu->addAction(flist[i]); + } else + newAction = functionsMenu->addAction(flist[i]); + newAction->setData(i); + newAction->setWhatsThis(scriptEnv->mathFunctionDoc(flist[i])); + } + functionsMenu->setTitle(tr("&Functions")); + menu->addMenu(functionsMenu); + + menu->exec(e->globalPos()); + delete menu; +} + +void ScriptEdit::insertErrorMsg(const QString &message) +{ + QString err = message; + err.prepend("\n").replace("\n","\n#> "); + +#ifdef SCRIPTING_CONSOLE + QTextEdit *console = scriptEnv->application()->scriptingConsole(); + console->setPlainText(err); + if (!console->isVisible()) + ((QDockWidget *)console->parent())->show(); +#else + int start = printCursor.position(); + printCursor.insertText(err); + printCursor.setPosition(start, QTextCursor::KeepAnchor); + setTextCursor(printCursor); +#endif + + d_error = true; + d_err_message = message; +} + +void ScriptEdit::scriptPrint(const QString &text) +{ + if(lineNumber(printCursor.position()) == lineNumber(textCursor().selectionEnd())) + printCursor.insertText("\n"); + printCursor.insertText(text); +} + +void ScriptEdit::insertFunction(const QString &fname) +{ + QTextCursor cursor = textCursor(); + QString markedText = cursor.selectedText(); + cursor.insertText(fname+"("+markedText+")"); + if(markedText.isEmpty()){ + // if no text is selected, place cursor inside the () + // instead of after it + cursor.movePosition(QTextCursor::PreviousCharacter,QTextCursor::MoveAnchor,1); + // the next line makes the selection visible to the user + // (the line above only changes the selection in the + // underlying QTextDocument) + setTextCursor(cursor); + } +} + +void ScriptEdit::commentSelection() +{ + QTextCursor cursor = textCursor(); + QString markedText = cursor.selectedText(); + if (markedText.isEmpty()) + return; + + markedText.replace(QChar::ParagraphSeparator, "\n#"); + cursor.insertText("#" + markedText); + + undoAvailable(true); +} + +void ScriptEdit::uncommentSelection() +{ + QTextCursor cursor = textCursor(); + QString markedText = cursor.selectedText(); + if (markedText.isEmpty() || !(markedText.contains("#") || markedText.contains("\"\"\""))) + return; + + cursor.insertText(markedText.remove("#").remove("\"\"\"")); + undoAvailable(true); +} + +void ScriptEdit::insertFunction(QAction *action) +{ + insertFunction(scriptEnv->mathFunctions()[action->data().toInt()]); +} + +int ScriptEdit::lineNumber(int pos) const +{ + int n = 1; + for(QTextBlock i=document()->begin(); !i.contains(pos) && i!=document()->end(); i=i.next()) + n++; + return n; +} + +void ScriptEdit::execute() +{ + clearErrorHighlighting(); + + QString fname = "<%1:%2>"; + fname = fname.arg(name()); + QTextCursor codeCursor = textCursor(); + if (codeCursor.selectedText().isEmpty()){ + codeCursor.movePosition(QTextCursor::StartOfLine, QTextCursor::MoveAnchor); + codeCursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); + } + int startLineNumber = lineNumber(codeCursor.selectionStart()); + fname = fname.arg(startLineNumber); + + myScript->setName(fname); + myScript->setCode(codeCursor.selectedText().replace(QChar::ParagraphSeparator,"\n")); + printCursor.setPosition(codeCursor.selectionEnd(), QTextCursor::MoveAnchor); + printCursor.movePosition(QTextCursor::EndOfLine, QTextCursor::MoveAnchor); + myScript->exec(); + + highlightErrorLine(startLineNumber - 1); + d_error = false; +} + +void ScriptEdit::executeAll() +{ + clearErrorHighlighting(); + + QString fname = "<%1>"; + fname = fname.arg(name()); + myScript->setName(fname); + myScript->setCode(text()); + myScript->exec(); + + highlightErrorLine(0); + d_error = false; +} + +void ScriptEdit::evaluate() +{ + clearErrorHighlighting(); + + QString fname = "<%1:%2>"; + fname = fname.arg(name()); + QTextCursor codeCursor = textCursor(); + if (codeCursor.selectedText().isEmpty()){ + codeCursor.movePosition(QTextCursor::StartOfLine, QTextCursor::MoveAnchor); + codeCursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); + } + int startLineNumber = lineNumber(codeCursor.selectionStart()); + fname = fname.arg(startLineNumber); + + myScript->setName(fname); + myScript->setCode(codeCursor.selectedText().replace(QChar::ParagraphSeparator,"\n")); + QVariant res = myScript->eval(); + + if (res.isValid() && !myScript->code().isEmpty()) + if (!res.isNull() && res.canConvert(QVariant::String)){ + QString strVal; + if (myScript->scriptingEnv()->name() == QString("Python")) + strVal = res.toString(); + else + strVal = QLocale().toString(res.toDouble()); + + strVal.replace("\n", "\n#> "); + + printCursor.insertText("\n"); + printCursor.mergeBlockFormat(d_fmt_default); + if (!strVal.isEmpty()) + printCursor.insertText("#> " + strVal + "\n"); + } + + highlightErrorLine(startLineNumber - 2);//we need to substract a line due to __doit__ line prepended to Python scripts. + d_error = false; +} + +void ScriptEdit::exportPDF(const QString& fileName) +{ + QTextDocument *doc = document(); + QPrinter printer; + printer.setCreator("QtiPlot"); + printer.setOutputFormat(QPrinter::PdfFormat); + printer.setOutputFileName(fileName); + doc->print(&printer); +} + +void ScriptEdit::print() +{ + QTextDocument *doc = document(); + QPrinter printer; + QPrintDialog printDialog(&printer); + // TODO: Write a dialog to use more features of Qt4's QPrinter class + if (printDialog.exec() == QDialog::Accepted) + doc->print(&printer); +} + +void ScriptEdit::print(QPrinter *printer) +{ + if (!printer) + return; + + document()->print(printer); +} + +QString ScriptEdit::importASCII(const QString &filename) +{ + QString filter = scriptEnv->fileFilter(); + filter += tr("Text") + " (*.txt *.TXT);;"; + filter += tr("All Files")+" (*)"; + + QString f; + if (filename.isEmpty()) + f = ApplicationWindow::getFileName(this, tr("QtiPlot - Import Text From File"), scriptsDirPath, filter, 0, false); + else + f = filename; + if (f.isEmpty()) return QString::null; + + QFile file(f); + if (!file.open(IO_ReadOnly)){ + QMessageBox::critical(this, tr("QtiPlot - Error Opening File"), tr("Could not open file \"%1\" for reading.").arg(f)); + return QString::null; + } + + setFileName(f); + + QFileInfo fi(f); + if (scriptsDirPath != fi.absolutePath()){ + scriptsDirPath = fi.absolutePath(); + emit dirPathChanged(scriptsDirPath); + } + + clear(); + QTextStream ts(&file); + ts.setEncoding(QTextStream::UnicodeUTF8); + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + qApp->processEvents(QEventLoop::ExcludeUserInput); + + blockSignals(true); + insertPlainText(ts.readAll()); + blockSignals(false); + textChanged(); + + file.close(); + QApplication::restoreOverrideCursor(); + return f; +} + +QString ScriptEdit::save() +{ + return exportASCII(d_file_name); +} + +QString ScriptEdit::exportASCII(const QString &filename) +{ + QString filter = tr("Text") + " (*.txt *.TXT);;"; + filter += scriptEnv->fileFilter(); + filter += tr("All Files")+" (*)"; + + QString selectedFilter; + QString fn; + if (filename.isEmpty()) + fn = ApplicationWindow::getFileName(this, tr("Save Text to File"), scriptsDirPath, filter, &selectedFilter, true, scriptEnv->application()->d_confirm_overwrite); + else + fn = filename; + + if (!fn.isEmpty()){ + QFileInfo fi(fn); + scriptsDirPath = fi.absolutePath(); + + if (selectedFilter.contains(".txt") && !fn.endsWith(".txt", Qt::CaseInsensitive)) + fn.append(".txt"); + else if (selectedFilter.contains(".py") && !fn.endsWith(".py", Qt::CaseInsensitive)) + fn.append(".py"); + + QFile f(fn); + if (!f.open(IO_WriteOnly)){ + QMessageBox::critical(0, tr("QtiPlot - File Save Error"), + tr("Could not write to file:

%1

Please verify that you have the right to write to this location!").arg(fn)); + return QString::null; + } + + QTextStream t( &f ); + t.setEncoding(QTextStream::UnicodeUTF8); + t << text(); + f.close(); + + setFileName(fn); + } + return fn; +} + +void ScriptEdit::setFileName(const QString& fn) +{ + if (d_file_name == fn) + return; + + d_file_name = fn; + Note *note = qobject_cast(myScript->context()); + if (note) + note->renameTab(note->indexOf(this), QFileInfo(d_file_name).fileName()); +} + +void ScriptEdit::updateIndentation() +{ + QTextCursor cursor = textCursor(); + QTextBlock para = cursor.block(); + QString prev = para.previous().text(); + + int i; + for (i=0; prev[i].isSpace(); i++); + QString indent = prev.mid(0, i); + cursor.movePosition(QTextCursor::StartOfLine, QTextCursor::MoveAnchor); + cursor.insertText(indent); +} + +void ScriptEdit::setDirPath(const QString& path) +{ + QFileInfo fi(path); + if (!fi.exists() || !fi.isDir()) + return; + + scriptsDirPath = path; +} + + void ScriptEdit::setCompleter(QCompleter *completer) + { + if (d_completer) + QObject::disconnect(d_completer, 0, this, 0); + + d_completer = completer; + + if (!d_completer) + return; + + d_completer->setWidget(this); + QObject::connect(d_completer, SIGNAL(activated(const QString&)), this, SLOT(insertCompletion(const QString&))); +} + + void ScriptEdit::insertCompletion(const QString& completion) + { + if (!d_completer || d_completer->widget() != this) + return; + + QTextCursor tc = textCursor(); + int extra = completion.length() - d_completer->completionPrefix().length(); + tc.movePosition(QTextCursor::Left); + tc.movePosition(QTextCursor::EndOfWord); + + bool specialWord = (completion == "qti" || completion == "app" || completion == "self") ? true : false; + bool keyWord = (PythonSyntaxHighlighter::keywordsList().contains(completion)); + + QChar startChar = completion[0]; + if (startChar.category() == QChar::Letter_Lowercase && !specialWord && !keyWord){ + tc.insertText(completion.right(extra) + "()"); + tc.movePosition(QTextCursor::PreviousCharacter, QTextCursor::MoveAnchor, 1); + } else if (specialWord) + tc.insertText(completion.right(extra) + "."); + else + tc.insertText(completion.right(extra)); + + setTextCursor(tc); + } + + QString ScriptEdit::textUnderCursor() const + { + QTextCursor tc = textCursor(); + tc.select(QTextCursor::WordUnderCursor); + return tc.selectedText(); + } + + +void ScriptEdit::rehighlight() +{ + if (d_highlighter) + delete d_highlighter; + +#ifdef SCRIPTING_PYTHON + if (scriptEnv->name() == QString("Python")) + d_highlighter = new PythonSyntaxHighlighter(this); + else +#endif + d_highlighter = new SyntaxHighlighter(this); +} + +void ScriptEdit::showFindDialog(bool replace) +{ + if (toPlainText().isEmpty()) + return; + + FindReplaceDialog *frd = new FindReplaceDialog(this, replace, (QWidget *)scriptingEnv()->application()); + frd->exec(); +} + +bool ScriptEdit::find(const QString& searchString, QTextDocument::FindFlags flags, bool previous) +{ + d_search_string = searchString; + d_search_flags = flags; + if (previous) + flags |= QTextDocument::FindBackward; + + QTextCursor d_highlight_cursor = textCursor(); + bool stop = previous ? d_highlight_cursor.atStart() : d_highlight_cursor.atEnd(); + bool found = false; + while (!d_highlight_cursor.isNull() && !stop){ + d_highlight_cursor = document()->find(searchString, d_highlight_cursor, flags); + if (!d_highlight_cursor.isNull()){ + found = true; + setTextCursor(d_highlight_cursor); + return true; + } + stop = previous ? d_highlight_cursor.atStart() : d_highlight_cursor.atEnd(); + } + + if (!found) + QMessageBox::information(this, tr("QtiPlot"), tr("QtiPlot has finished searching the document.")); + return found; +} + +void ScriptEdit::findNext() +{ + if (textCursor().hasSelection()) + d_search_string = textCursor().selectedText(); + + if (!d_search_string.isEmpty()) + find(d_search_string, d_search_flags); + else + showFindDialog(); +} + +void ScriptEdit::findPrevious() +{ + if (textCursor().hasSelection()) + d_search_string = textCursor().selectedText(); + + if (!d_search_string.isEmpty()) + find(d_search_string, d_search_flags, true); + else + showFindDialog(); +} + +void ScriptEdit::clearErrorHighlighting() +{ + QTextCursor codeCursor = textCursor(); + codeCursor.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor); + codeCursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor); + codeCursor.mergeBlockFormat(d_fmt_default); + + if (d_output_widget) + d_output_widget->clear(); +} + +void ScriptEdit::highlightErrorLine(int offset) +{ + if (!d_error) + return; + + QTextCursor codeCursor = textCursor(); + codeCursor.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor); + + if (scriptEnv->name() == QString("Python")){ + QRegExp rx("<*>:(\\d+)"); + rx.indexIn(d_err_message); + QStringList list = rx.capturedTexts(); + int lineNumber = 0; + if (!list.isEmpty()) + lineNumber = list.last().toInt(); + + codeCursor.movePosition(QTextCursor::Down, QTextCursor::MoveAnchor, offset + lineNumber - 1); + codeCursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); + } else + codeCursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor); + + QTextBlockFormat d_fmt_failure; + d_fmt_failure.setBackground(QBrush(QColor(255,128,128))); + codeCursor.mergeBlockFormat(d_fmt_failure); + setTextCursor(codeCursor); +} + +void ScriptEdit::redirectOutputTo(QTextEdit *te) +{ + d_output_widget = te; + if (d_output_widget) + printCursor = QTextCursor(d_output_widget->textCursor()); + else + printCursor = textCursor(); +} + +void ScriptEdit::matchParentheses() +{ + QList selections; + setExtraSelections(selections); + + TextBlockData *data = static_cast(textCursor().block().userData()); + + if (data) { + QVector infos = data->parentheses(); + + int pos = textCursor().block().position(); + for (int i = 0; i < infos.size(); ++i) { + ParenthesisInfo *info = infos.at(i); + + int curPos = textCursor().position() - textCursor().block().position(); + if (info->position == curPos - 1 && info->character == '(') { + if (matchLeftParenthesis(textCursor().block(), i + 1, 0)) + createParenthesisSelection(pos + info->position); + } else if (info->position == curPos - 1 && info->character == ')') { + if (matchRightParenthesis(textCursor().block(), i - 1, 0)) + createParenthesisSelection(pos + info->position); + } + } + } +} + +bool ScriptEdit::matchLeftParenthesis(QTextBlock currentBlock, int i, int numLeftParentheses) +{ + TextBlockData *data = static_cast(currentBlock.userData()); + QVector infos = data->parentheses(); + + int docPos = currentBlock.position(); + for (; i < infos.size(); ++i) { + ParenthesisInfo *info = infos.at(i); + + if (info->character == '(') { + ++numLeftParentheses; + continue; + } + + if (info->character == ')' && numLeftParentheses == 0) { + createParenthesisSelection(docPos + info->position); + return true; + } else + --numLeftParentheses; + } + + currentBlock = currentBlock.next(); + if (currentBlock.isValid()) + return matchLeftParenthesis(currentBlock, 0, numLeftParentheses); + + return false; +} + +bool ScriptEdit::matchRightParenthesis(QTextBlock currentBlock, int i, int numRightParentheses) +{ + TextBlockData *data = static_cast(currentBlock.userData()); + QVector parentheses = data->parentheses(); + + int docPos = currentBlock.position(); + for (; i > -1 && parentheses.size() > 0; --i) { + ParenthesisInfo *info = parentheses.at(i); + if (info->character == ')') { + ++numRightParentheses; + continue; + } + if (info->character == '(' && numRightParentheses == 0) { + createParenthesisSelection(docPos + info->position); + return true; + } else + --numRightParentheses; + } + + currentBlock = currentBlock.previous(); + if (currentBlock.isValid()) + return matchRightParenthesis(currentBlock, 0, numRightParentheses); + + return false; +} + +void ScriptEdit::createParenthesisSelection(int pos) +{ + QList selections = extraSelections(); + + QTextEdit::ExtraSelection selection; + QTextCharFormat format = selection.format; + format.setBackground(Qt::green); + format.setForeground (Qt::red); + selection.format = format; + + QTextCursor cursor = textCursor(); + cursor.setPosition(pos); + cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor); + selection.cursor = cursor; + + selections.append(selection); + + setExtraSelections(selections); +} + +ScriptEdit::~ScriptEdit() +{ + if (d_highlighter) + delete d_highlighter; + if (d_completer){ + d_completer->popup()->close(); + QObject::disconnect(d_completer, 0, this, 0); + } +} + === removed file 'qtiplot/src/scripting/ScriptEdit.cpp' --- qtiplot/src/scripting/ScriptEdit.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/ScriptEdit.cpp 1970-01-01 00:00:00 +0000 @@ -1,819 +0,0 @@ -/*************************************************************************** - File : ScriptEdit.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de - Description : Editor widget for scripting code - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "ScriptEdit.h" -#include "Note.h" -#include "PythonSyntaxHighlighter.h" -#include "FindReplaceDialog.h" -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -ScriptEdit::ScriptEdit(ScriptingEnv *env, QWidget *parent, const char *name) - : QTextEdit(parent, name), scripted(env), d_error(false), d_completer(0), d_highlighter(0), - d_file_name(QString::null), d_search_string(QString::null), d_output_widget(NULL) -{ - myScript = scriptEnv->newScript("", this, name); - connect(myScript, SIGNAL(error(const QString&, const QString&, int)), this, SLOT(insertErrorMsg(const QString&))); - connect(myScript, SIGNAL(print(const QString&)), this, SLOT(scriptPrint(const QString&))); - connect(myScript, SIGNAL(error(const QString&, const QString&, int)), - this, SIGNAL(error(const QString&, const QString&, int))); - - setLineWrapMode(NoWrap); - setUndoRedoEnabled(true); - setTextFormat(Qt::PlainText); - setAcceptRichText (false); - - rehighlight(); - - d_fmt_default.setBackground(palette().brush(QPalette::Base)); - - printCursor = textCursor(); - scriptsDirPath = qApp->applicationDirPath(); - - actionExecute = new QAction(tr("E&xecute"), this); - actionExecute->setShortcut( tr("Ctrl+J") ); - connect(actionExecute, SIGNAL(activated()), this, SLOT(execute())); - - actionExecuteAll = new QAction(QIcon(QPixmap(play_xpm)), tr("Execute &All"), this); - actionExecuteAll->setShortcut( tr("Ctrl+Shift+J") ); - connect(actionExecuteAll, SIGNAL(activated()), this, SLOT(executeAll())); - - actionEval = new QAction(tr("&Evaluate Expression"), this); - actionEval->setShortcut( tr("Ctrl+Return") ); - connect(actionEval, SIGNAL(activated()), this, SLOT(evaluate())); - - actionPrint = new QAction(QPixmap(fileprint_xpm), tr("&Print"), this); - connect(actionPrint, SIGNAL(activated()), this, SLOT(print())); - - actionImport = new QAction(QPixmap(fileopen_xpm), tr("&Import..."), this); - actionImport->setShortcut(QKeySequence(Qt::CTRL+Qt::ALT+Qt::Key_O)); - connect(actionImport, SIGNAL(activated()), this, SLOT(importASCII())); - - QShortcut *accelImport = new QShortcut(actionImport->shortcut(), this); - connect(accelImport, SIGNAL(activated()), this, SLOT(importASCII())); - - actionSave = new QAction(QPixmap(filesave_xpm), tr("&Save"), this); - actionSave->setShortcut(QKeySequence(Qt::CTRL+Qt::ALT+Qt::Key_S)); - connect(actionSave, SIGNAL(activated()), this, SLOT(save())); - - QShortcut *accelSave = new QShortcut(actionSave->shortcut(), this); - connect(accelSave, SIGNAL(activated()), this, SLOT(save())); - - actionExport = new QAction(QIcon(QPixmap(filesaveas_xpm)), tr("Sa&ve as..."), this); - connect(actionExport, SIGNAL(activated()), this, SLOT(exportASCII())); - - actionFind = new QAction(QPixmap(find_xpm), tr("&Find..."), this); - actionFind->setShortcut(QKeySequence(Qt::CTRL+Qt::ALT+Qt::Key_F)); - connect(actionFind, SIGNAL(activated()), this, SLOT(showFindDialog())); - - actionReplace = new QAction(QPixmap(replace_xpm), tr("&Replace..."), this); - actionReplace->setShortcut(QKeySequence(Qt::CTRL+Qt::ALT+Qt::Key_R)); - connect(actionReplace, SIGNAL(activated()), this, SLOT(replace())); - - actionFindNext = new QAction(QPixmap(find_next_xpm), tr("&Find next"), this); - actionFindNext->setShortcut(QKeySequence(Qt::Key_F3)); - connect(actionFindNext, SIGNAL(activated()), this, SLOT(findNext())); - - actionFindPrevious = new QAction(QPixmap(find_previous_xpm), tr("&Find previous"), this); - actionFindPrevious->setShortcut(QKeySequence(Qt::Key_F4)); - connect(actionFindPrevious, SIGNAL(activated()), this, SLOT(findPrevious())); - - functionsMenu = new QMenu(this); - Q_CHECK_PTR(functionsMenu); - connect(functionsMenu, SIGNAL(triggered(QAction *)), this, SLOT(insertFunction(QAction *))); - - connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(matchParentheses())); -} - -void ScriptEdit::customEvent(QEvent *e) -{ - if (e->type() == SCRIPTING_CHANGE_EVENT) - { - scriptingChangeEvent((ScriptingChangeEvent*)e); - delete myScript; - myScript = scriptEnv->newScript("", this, name()); - connect(myScript, SIGNAL(error(const QString&, const QString&, int)), this, SLOT(insertErrorMsg(const QString&))); - connect(myScript, SIGNAL(print(const QString&)), this, SLOT(scriptPrint(const QString&))); - - rehighlight(); - } -} - -void ScriptEdit::focusInEvent(QFocusEvent *e) -{ - if (d_completer) - d_completer->setWidget(this); - QTextEdit::focusInEvent(e); -} - -void ScriptEdit::keyPressEvent(QKeyEvent *e) -{ - if (d_completer && d_completer->popup()->isVisible()) { - // The following keys are forwarded by the completer to the widget - switch (e->key()) { - case Qt::Key_Enter: - case Qt::Key_Return: - case Qt::Key_Escape: - case Qt::Key_Tab: - case Qt::Key_Backtab: - e->ignore(); - return; // let the completer do default behavior - default: - break; - } - } - - QTextEdit::keyPressEvent(e); - if (d_completer && !d_completer->popup()->isVisible() && e->key() == Qt::Key_Return) - updateIndentation(); - - bool isShortcut = ((e->modifiers() & Qt::ControlModifier) && e->key() == Qt::Key_U); // CTRL+U - const bool ctrlOrShift = e->modifiers() & (Qt::ControlModifier | Qt::ShiftModifier); - if (!d_completer || (ctrlOrShift && e->text().isEmpty())) - return; - - static QString eow("~!@#$%^&*()_+{}|:\"<>?,./;'[]\\-="); // end of word - bool hasModifier = (e->modifiers() != Qt::NoModifier) && !ctrlOrShift; - QString completionPrefix = textUnderCursor(); - - if (!isShortcut && (hasModifier || e->text().isEmpty()|| completionPrefix.length() < 2 - || eow.contains(e->text().right(1)))){ - d_completer->popup()->hide(); - return; - } - - if (completionPrefix != d_completer->completionPrefix()){ - d_completer->setCompletionPrefix(completionPrefix); - d_completer->popup()->setCurrentIndex(d_completer->completionModel()->index(0, 0)); - } - - QRect cr = cursorRect(); - cr.setWidth(d_completer->popup()->sizeHintForColumn(0) - + d_completer->popup()->verticalScrollBar()->sizeHint().width()); - d_completer->complete(cr); // popup it up! -} - -void ScriptEdit::contextMenuEvent(QContextMenuEvent *e) -{ - QMenu *menu = createStandardContextMenu(); - Q_CHECK_PTR(menu); - - menu->insertSeparator(); - bool emptyText = toPlainText().isEmpty(); - if (!emptyText){ - menu->addAction(actionFind); - menu->addAction(actionFindNext); - menu->addAction(actionFindPrevious); - menu->addAction(actionReplace); - menu->insertSeparator(); - } - menu->addAction(actionPrint); - menu->addAction(actionImport); - menu->insertSeparator(); - menu->addAction(actionSave); - menu->addAction(actionExport); - menu->insertSeparator(); - - Note *sp = qobject_cast(myScript->context()); - if (sp){ - QAction *actionRenameTab = new QAction(tr("Rena&me Tab..."), menu); - connect(actionRenameTab, SIGNAL(activated()), sp, SLOT(renameCurrentTab())); - menu->addAction(actionRenameTab); - - QAction *actionAddTab = new QAction(QIcon(QPixmap(plus_xpm)), tr("A&dd Tab"), menu); - connect(actionAddTab, SIGNAL(activated()), sp, SLOT(addTab())); - menu->addAction(actionAddTab); - - if (sp->tabs() > 1){ - QAction *actionRemoveTab = new QAction(QIcon(QPixmap(delete_xpm)), tr("C&lose Tab"), menu); - connect(actionRemoveTab, SIGNAL(activated()), sp, SLOT(removeTab())); - menu->addAction(actionRemoveTab); - } - - menu->insertSeparator(); - } - - if (!emptyText){ - menu->addAction(actionExecute); - menu->addAction(actionExecuteAll); - menu->addAction(actionEval); - } - - if (sp){ - QAction *actionAutoexec = new QAction(tr("Auto&exec"), menu); - actionAutoexec->setToggleAction(true); - actionAutoexec->setOn(sp->autoexec()); - connect(actionAutoexec, SIGNAL(toggled(bool)), sp, SLOT(setAutoexec(bool))); - menu->addAction(actionAutoexec); - menu->insertSeparator(); - } - - functionsMenu->clear(); - functionsMenu->setTearOffEnabled(true); - QStringList flist = scriptEnv->mathFunctions(); - QMenu *submenu=NULL; - for (int i=0; ititle()) - submenu = functionsMenu->addMenu(menupart); - newAction = submenu->addAction(flist[i]); - } else - newAction = functionsMenu->addAction(flist[i]); - newAction->setData(i); - newAction->setWhatsThis(scriptEnv->mathFunctionDoc(flist[i])); - } - functionsMenu->setTitle(tr("&Functions")); - menu->addMenu(functionsMenu); - - menu->exec(e->globalPos()); - delete menu; -} - -void ScriptEdit::insertErrorMsg(const QString &message) -{ - QString err = message; - err.prepend("\n").replace("\n","\n#> "); - -#ifdef SCRIPTING_CONSOLE - QTextEdit *console = scriptEnv->application()->scriptingConsole(); - console->setPlainText(err); - if (!console->isVisible()) - ((QDockWidget *)console->parent())->show(); -#else - int start = printCursor.position(); - printCursor.insertText(err); - printCursor.setPosition(start, QTextCursor::KeepAnchor); - setTextCursor(printCursor); -#endif - - d_error = true; - d_err_message = message; -} - -void ScriptEdit::scriptPrint(const QString &text) -{ - if(lineNumber(printCursor.position()) == lineNumber(textCursor().selectionEnd())) - printCursor.insertText("\n"); - printCursor.insertText(text); -} - -void ScriptEdit::insertFunction(const QString &fname) -{ - QTextCursor cursor = textCursor(); - QString markedText = cursor.selectedText(); - cursor.insertText(fname+"("+markedText+")"); - if(markedText.isEmpty()){ - // if no text is selected, place cursor inside the () - // instead of after it - cursor.movePosition(QTextCursor::PreviousCharacter,QTextCursor::MoveAnchor,1); - // the next line makes the selection visible to the user - // (the line above only changes the selection in the - // underlying QTextDocument) - setTextCursor(cursor); - } -} - -void ScriptEdit::insertFunction(QAction *action) -{ - insertFunction(scriptEnv->mathFunctions()[action->data().toInt()]); -} - -int ScriptEdit::lineNumber(int pos) const -{ - int n = 1; - for(QTextBlock i=document()->begin(); !i.contains(pos) && i!=document()->end(); i=i.next()) - n++; - return n; -} - -void ScriptEdit::execute() -{ - clearErrorHighlighting(); - - QString fname = "<%1:%2>"; - fname = fname.arg(name()); - QTextCursor codeCursor = textCursor(); - if (codeCursor.selectedText().isEmpty()){ - codeCursor.movePosition(QTextCursor::StartOfLine, QTextCursor::MoveAnchor); - codeCursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); - } - int startLineNumber = lineNumber(codeCursor.selectionStart()); - fname = fname.arg(startLineNumber); - - myScript->setName(fname); - myScript->setCode(codeCursor.selectedText().replace(QChar::ParagraphSeparator,"\n")); - printCursor.setPosition(codeCursor.selectionEnd(), QTextCursor::MoveAnchor); - printCursor.movePosition(QTextCursor::EndOfLine, QTextCursor::MoveAnchor); - myScript->exec(); - - highlightErrorLine(startLineNumber - 1); - d_error = false; -} - -void ScriptEdit::executeAll() -{ - clearErrorHighlighting(); - - QString fname = "<%1>"; - fname = fname.arg(name()); - myScript->setName(fname); - myScript->setCode(text()); - myScript->exec(); - - highlightErrorLine(0); - d_error = false; -} - -void ScriptEdit::evaluate() -{ - clearErrorHighlighting(); - - QString fname = "<%1:%2>"; - fname = fname.arg(name()); - QTextCursor codeCursor = textCursor(); - if (codeCursor.selectedText().isEmpty()){ - codeCursor.movePosition(QTextCursor::StartOfLine, QTextCursor::MoveAnchor); - codeCursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); - } - int startLineNumber = lineNumber(codeCursor.selectionStart()); - fname = fname.arg(startLineNumber); - - myScript->setName(fname); - myScript->setCode(codeCursor.selectedText().replace(QChar::ParagraphSeparator,"\n")); - QVariant res = myScript->eval(); - - if (res.isValid() && !myScript->code().isEmpty()) - if (!res.isNull() && res.canConvert(QVariant::String)){ - QString strVal = res.toString(); - strVal.replace("\n", "\n#> "); - - printCursor.insertText("\n"); - printCursor.mergeBlockFormat(d_fmt_default); - if (!strVal.isEmpty()) - printCursor.insertText("#> " + strVal + "\n"); - } - - highlightErrorLine(startLineNumber - 2);//we need to substract a line due to __doit__ line prepended to Python scripts. - d_error = false; -} - -void ScriptEdit::exportPDF(const QString& fileName) -{ - QTextDocument *doc = document(); - QPrinter printer; - printer.setCreator("QtiPlot"); - printer.setOutputFormat(QPrinter::PdfFormat); - printer.setOutputFileName(fileName); - doc->print(&printer); -} - -void ScriptEdit::print() -{ - QTextDocument *doc = document(); - QPrinter printer; - QPrintDialog printDialog(&printer); - // TODO: Write a dialog to use more features of Qt4's QPrinter class - if (printDialog.exec() == QDialog::Accepted) - doc->print(&printer); -} - -void ScriptEdit::print(QPrinter *printer) -{ - if (!printer) - return; - - document()->print(printer); -} - -QString ScriptEdit::importASCII(const QString &filename) -{ - QString filter = scriptEnv->fileFilter(); - filter += tr("Text") + " (*.txt *.TXT);;"; - filter += tr("All Files")+" (*)"; - - QString f; - if (filename.isEmpty()) - f = ApplicationWindow::getFileName(this, tr("QtiPlot - Import Text From File"), scriptsDirPath, filter, 0, false); - else - f = filename; - if (f.isEmpty()) return QString::null; - - QFile file(f); - if (!file.open(IO_ReadOnly)){ - QMessageBox::critical(this, tr("QtiPlot - Error Opening File"), tr("Could not open file \"%1\" for reading.").arg(f)); - return QString::null; - } - - setFileName(f); - - QFileInfo fi(f); - if (scriptsDirPath != fi.absolutePath()){ - scriptsDirPath = fi.absolutePath(); - emit dirPathChanged(scriptsDirPath); - } - - clear(); - QTextStream ts(&file); - ts.setEncoding(QTextStream::UnicodeUTF8); - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - qApp->processEvents(QEventLoop::ExcludeUserInput); - - blockSignals(true); - insertPlainText(ts.readAll()); - blockSignals(false); - textChanged(); - - file.close(); - QApplication::restoreOverrideCursor(); - return f; -} - -QString ScriptEdit::save() -{ - return exportASCII(d_file_name); -} - -QString ScriptEdit::exportASCII(const QString &filename) -{ - QString filter = tr("Text") + " (*.txt *.TXT);;"; - filter += scriptEnv->fileFilter(); - filter += tr("All Files")+" (*)"; - - QString selectedFilter; - QString fn; - if (filename.isEmpty()) - fn = ApplicationWindow::getFileName(this, tr("Save Text to File"), scriptsDirPath, filter, &selectedFilter); - else - fn = filename; - - if (!fn.isEmpty()){ - QFileInfo fi(fn); - scriptsDirPath = fi.absolutePath(); - if (!fn.endsWith(selectedFilter.remove("*"), Qt::CaseInsensitive)){ - if (selectedFilter.contains(".txt")) - fn.append(".txt"); - else if (selectedFilter.contains(".py")) - fn.append(".py"); - } - - QFile f(fn); - if (!f.open(IO_WriteOnly)){ - QMessageBox::critical(0, tr("QtiPlot - File Save Error"), - tr("Could not write to file:

%1

Please verify that you have the right to write to this location!").arg(fn)); - return QString::null; - } - - QTextStream t( &f ); - t.setEncoding(QTextStream::UnicodeUTF8); - t << text(); - f.close(); - - setFileName(fn); - } - return fn; -} - -void ScriptEdit::setFileName(const QString& fn) -{ - if (d_file_name == fn) - return; - - d_file_name = fn; - Note *note = qobject_cast(myScript->context()); - if (note) - note->renameTab(note->indexOf(this), QFileInfo(d_file_name).fileName()); -} - -void ScriptEdit::updateIndentation() -{ - QTextCursor cursor = textCursor(); - QTextBlock para = cursor.block(); - QString prev = para.previous().text(); - - int i; - for (i=0; prev[i].isSpace(); i++); - QString indent = prev.mid(0, i); - cursor.movePosition(QTextCursor::StartOfLine, QTextCursor::MoveAnchor); - cursor.insertText(indent); -} - -void ScriptEdit::setDirPath(const QString& path) -{ - QFileInfo fi(path); - if (!fi.exists() || !fi.isDir()) - return; - - scriptsDirPath = path; -} - - void ScriptEdit::setCompleter(QCompleter *completer) - { - if (d_completer) - QObject::disconnect(d_completer, 0, this, 0); - - d_completer = completer; - - if (!d_completer) - return; - - d_completer->setWidget(this); - QObject::connect(d_completer, SIGNAL(activated(const QString&)), - this, SLOT(insertCompletion(const QString&))); - } - - void ScriptEdit::insertCompletion(const QString& completion) - { - if (d_completer->widget() != this) - return; - - QTextCursor tc = textCursor(); - int extra = completion.length() - d_completer->completionPrefix().length(); - tc.movePosition(QTextCursor::Left); - tc.movePosition(QTextCursor::EndOfWord); - tc.insertText(completion.right(extra)); - setTextCursor(tc); - } - - QString ScriptEdit::textUnderCursor() const - { - QTextCursor tc = textCursor(); - tc.select(QTextCursor::WordUnderCursor); - return tc.selectedText(); - } - - -void ScriptEdit::rehighlight() -{ - if (d_highlighter) - delete d_highlighter; - -#ifdef SCRIPTING_PYTHON - if (scriptEnv->name() == QString("Python")) - d_highlighter = new PythonSyntaxHighlighter(this); - else -#endif - d_highlighter = new SyntaxHighlighter(this); -} - -void ScriptEdit::showFindDialog(bool replace) -{ - if (toPlainText().isEmpty()) - return; - - FindReplaceDialog *frd = new FindReplaceDialog(this, replace, (QWidget *)scriptingEnv()->application()); - frd->exec(); -} - -bool ScriptEdit::find(const QString& searchString, QTextDocument::FindFlags flags, bool previous) -{ - d_search_string = searchString; - d_search_flags = flags; - if (previous) - flags |= QTextDocument::FindBackward; - - QTextCursor d_highlight_cursor = textCursor(); - bool stop = previous ? d_highlight_cursor.atStart() : d_highlight_cursor.atEnd(); - bool found = false; - while (!d_highlight_cursor.isNull() && !stop){ - d_highlight_cursor = document()->find(searchString, d_highlight_cursor, flags); - if (!d_highlight_cursor.isNull()){ - found = true; - setTextCursor(d_highlight_cursor); - return true; - } - stop = previous ? d_highlight_cursor.atStart() : d_highlight_cursor.atEnd(); - } - - if (!found) - QMessageBox::information(this, tr("QtiPlot"), tr("QtiPlot has finished searching the document.")); - return found; -} - -void ScriptEdit::findNext() -{ - if (textCursor().hasSelection()) - d_search_string = textCursor().selectedText(); - - if (!d_search_string.isEmpty()) - find(d_search_string, d_search_flags); - else - showFindDialog(); -} - -void ScriptEdit::findPrevious() -{ - if (textCursor().hasSelection()) - d_search_string = textCursor().selectedText(); - - if (!d_search_string.isEmpty()) - find(d_search_string, d_search_flags, true); - else - showFindDialog(); -} - -void ScriptEdit::clearErrorHighlighting() -{ - QTextCursor codeCursor = textCursor(); - codeCursor.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor); - codeCursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor); - codeCursor.mergeBlockFormat(d_fmt_default); - - if (d_output_widget) - d_output_widget->clear(); -} - -void ScriptEdit::highlightErrorLine(int offset) -{ - if (!d_error) - return; - - QTextCursor codeCursor = textCursor(); - codeCursor.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor); - - if (scriptEnv->name() == QString("Python")){ - QRegExp rx("<*>:(\\d+)"); - rx.indexIn(d_err_message); - QStringList list = rx.capturedTexts(); - int lineNumber = 0; - if (!list.isEmpty()) - lineNumber = list.last().toInt(); - - codeCursor.movePosition(QTextCursor::Down, QTextCursor::MoveAnchor, offset + lineNumber - 1); - codeCursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); - } else - codeCursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor); - - QTextBlockFormat d_fmt_failure; - d_fmt_failure.setBackground(QBrush(QColor(255,128,128))); - codeCursor.mergeBlockFormat(d_fmt_failure); - setTextCursor(codeCursor); -} - -void ScriptEdit::redirectOutputTo(QTextEdit *te) -{ - d_output_widget = te; - if (d_output_widget) - printCursor = QTextCursor(d_output_widget->textCursor()); - else - printCursor = textCursor(); -} - -void ScriptEdit::matchParentheses() -{ - QList selections; - setExtraSelections(selections); - - TextBlockData *data = static_cast(textCursor().block().userData()); - - if (data) { - QVector infos = data->parentheses(); - - int pos = textCursor().block().position(); - for (int i = 0; i < infos.size(); ++i) { - ParenthesisInfo *info = infos.at(i); - - int curPos = textCursor().position() - textCursor().block().position(); - if (info->position == curPos - 1 && info->character == '(') { - if (matchLeftParenthesis(textCursor().block(), i + 1, 0)) - createParenthesisSelection(pos + info->position); - } else if (info->position == curPos - 1 && info->character == ')') { - if (matchRightParenthesis(textCursor().block(), i - 1, 0)) - createParenthesisSelection(pos + info->position); - } - } - } -} - -bool ScriptEdit::matchLeftParenthesis(QTextBlock currentBlock, int i, int numLeftParentheses) -{ - TextBlockData *data = static_cast(currentBlock.userData()); - QVector infos = data->parentheses(); - - int docPos = currentBlock.position(); - for (; i < infos.size(); ++i) { - ParenthesisInfo *info = infos.at(i); - - if (info->character == '(') { - ++numLeftParentheses; - continue; - } - - if (info->character == ')' && numLeftParentheses == 0) { - createParenthesisSelection(docPos + info->position); - return true; - } else - --numLeftParentheses; - } - - currentBlock = currentBlock.next(); - if (currentBlock.isValid()) - return matchLeftParenthesis(currentBlock, 0, numLeftParentheses); - - return false; -} - -bool ScriptEdit::matchRightParenthesis(QTextBlock currentBlock, int i, int numRightParentheses) -{ - TextBlockData *data = static_cast(currentBlock.userData()); - QVector parentheses = data->parentheses(); - - int docPos = currentBlock.position(); - for (; i > -1 && parentheses.size() > 0; --i) { - ParenthesisInfo *info = parentheses.at(i); - if (info->character == ')') { - ++numRightParentheses; - continue; - } - if (info->character == '(' && numRightParentheses == 0) { - createParenthesisSelection(docPos + info->position); - return true; - } else - --numRightParentheses; - } - - currentBlock = currentBlock.previous(); - if (currentBlock.isValid()) - return matchRightParenthesis(currentBlock, 0, numRightParentheses); - - return false; -} - -void ScriptEdit::createParenthesisSelection(int pos) -{ - QList selections = extraSelections(); - - QTextEdit::ExtraSelection selection; - QTextCharFormat format = selection.format; - format.setBackground(Qt::green); - selection.format = format; - - QTextCursor cursor = textCursor(); - cursor.setPosition(pos); - cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor); - selection.cursor = cursor; - - selections.append(selection); - - setExtraSelections(selections); -} - -ScriptEdit::~ScriptEdit() -{ - if (d_highlighter) - delete d_highlighter; -} - === added file 'qtiplot/src/scripting/ScriptEdit.h' --- qtiplot/src/scripting/ScriptEdit.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/ScriptEdit.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,175 @@ +/*************************************************************************** + File : ScriptEdit.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de + Description : Scripting classes + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef SCRIPTEDIT_H +#define SCRIPTEDIT_H + +#include "ScriptingEnv.h" +#include "Script.h" + +#include +#include + +class QAction; +class QMenu; +class QCompleter; + +class SyntaxHighlighter; + +/*!\brief Editor widget with support for evaluating expressions and executing code. + * + * \section future Future Plans + * - Display line numbers. + * - syntax highlighting, indentation, auto-completion etc. (maybe using QScintilla) + */ +class ScriptEdit: public QTextEdit, public scripted +{ + Q_OBJECT + + public: + ScriptEdit(ScriptingEnv *env, QWidget *parent=0, const char *name=0); + ~ScriptEdit(); + //! Handle changing of scripting environment. + void customEvent(QEvent*); + //! Map cursor positions to line numbers. + int lineNumber(int pos) const; + bool error(){return d_error;}; + + void setCompleter(QCompleter *c); + void setFileName(const QString& fn); + void rehighlight(); + void redirectOutputTo(QTextEdit *); + void enableShortcuts(); + + public slots: + void execute(); + void executeAll(); + void evaluate(); + void print(); + void print(QPrinter*); + void exportPDF(const QString& fileName); + QString save(); + QString exportASCII(const QString &file=QString::null); + QString importASCII(const QString &file=QString::null); + void insertFunction(const QString &); + void insertFunction(QAction * action); + void setContext(QObject *context) { myScript->setContext(context); } + void scriptPrint(const QString&); + + void updateIndentation(); + void setDirPath(const QString& path); + void showFindDialog(bool replace = false); + void replace(){showFindDialog(true);}; + bool find(const QString& searchString, QTextDocument::FindFlags flags, bool previous = false); + void findNext(); + void findPrevious(); + void commentSelection(); + void uncommentSelection(); + + signals: + void dirPathChanged(const QString& path); + void error(const QString&, const QString&, int); + void activated(ScriptEdit *); + + protected: + virtual void contextMenuEvent(QContextMenuEvent *e); + virtual void keyPressEvent(QKeyEvent *e); + void focusInEvent(QFocusEvent *e); + + private: + void clearErrorHighlighting(); + void highlightErrorLine(int offset); + + Script *myScript; + QAction *actionExecute, *actionExecuteAll, *actionEval, *actionPrint, *actionImport, *actionSave, *actionExport; + QAction *actionFind, *actionReplace, *actionFindNext, *actionFindPrevious; + //! Submenu of context menu with mathematical functions. + QMenu *functionsMenu; + //! Cursor used for output of evaluation results and error messages. + QTextCursor printCursor; + QString scriptsDirPath; + + //! Format used for resetting success/failure markers. + QTextBlockFormat d_fmt_default; + //! True if we are inside evaluate(), execute() or executeAll() there were errors. + bool d_error; + QString d_err_message; + + QCompleter *d_completer; + SyntaxHighlighter *d_highlighter; + QString d_file_name; + QString d_search_string; + QTextDocument::FindFlags d_search_flags; + QTextEdit *d_output_widget; + + private slots: + //! Insert an error message from the scripting system at printCursor. + /** + * After insertion, the text cursor will have the error message selected, allowing the user to + * delete it and fix the error. + */ + void insertErrorMsg(const QString &message); + void insertCompletion(const QString &completion); + void matchParentheses(); + + private: + QString textUnderCursor() const; + bool matchLeftParenthesis(QTextBlock currentBlock, int index, int numRightParentheses); + bool matchRightParenthesis(QTextBlock currentBlock, int index, int numLeftParentheses); + void createParenthesisSelection(int pos); +}; + +//! Structure used for parentheses matching +struct ParenthesisInfo +{ + char character; + int position; +}; + +//! Help class used for parentheses matching (code taken from Qt Quarterly Issue 31 Q3 2009) +class TextBlockData : public QTextBlockUserData +{ +public: + TextBlockData(){}; + + QVector parentheses(){return m_parentheses;}; + void insert(ParenthesisInfo *info) + { + int i = 0; + while (i < m_parentheses.size() && + info->position > m_parentheses.at(i)->position) + ++i; + + m_parentheses.insert(i, info); + } + +private: + QVector m_parentheses; +}; + +#endif === removed file 'qtiplot/src/scripting/ScriptEdit.h' --- qtiplot/src/scripting/ScriptEdit.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/ScriptEdit.h 1970-01-01 00:00:00 +0000 @@ -1,171 +0,0 @@ -/*************************************************************************** - File : ScriptEdit.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de - Description : Scripting classes - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef SCRIPTEDIT_H -#define SCRIPTEDIT_H - -#include "ScriptingEnv.h" -#include "Script.h" - -#include -#include - -class QAction; -class QMenu; -class QCompleter; - -class SyntaxHighlighter; - -/*!\brief Editor widget with support for evaluating expressions and executing code. - * - * \section future Future Plans - * - Display line numbers. - * - syntax highlighting, indentation, auto-completion etc. (maybe using QScintilla) - */ -class ScriptEdit: public QTextEdit, public scripted -{ - Q_OBJECT - - public: - ScriptEdit(ScriptingEnv *env, QWidget *parent=0, const char *name=0); - ~ScriptEdit(); - //! Handle changing of scripting environment. - void customEvent(QEvent*); - //! Map cursor positions to line numbers. - int lineNumber(int pos) const; - bool error(){return d_error;}; - - void setCompleter(QCompleter *c); - void setFileName(const QString& fn); - void rehighlight(); - void redirectOutputTo(QTextEdit *); - - public slots: - void execute(); - void executeAll(); - void evaluate(); - void print(); - void print(QPrinter*); - void exportPDF(const QString& fileName); - QString save(); - QString exportASCII(const QString &file=QString::null); - QString importASCII(const QString &file=QString::null); - void insertFunction(const QString &); - void insertFunction(QAction * action); - void setContext(QObject *context) { myScript->setContext(context); } - void scriptPrint(const QString&); - - void updateIndentation(); - void setDirPath(const QString& path); - void showFindDialog(bool replace = false); - void replace(){showFindDialog(true);}; - bool find(const QString& searchString, QTextDocument::FindFlags flags, bool previous = false); - void findNext(); - void findPrevious(); - - signals: - void dirPathChanged(const QString& path); - void error(const QString&, const QString&, int); - - protected: - virtual void contextMenuEvent(QContextMenuEvent *e); - virtual void keyPressEvent(QKeyEvent *e); - void focusInEvent(QFocusEvent *e); - - private: - void clearErrorHighlighting(); - void highlightErrorLine(int offset); - - Script *myScript; - QAction *actionExecute, *actionExecuteAll, *actionEval, *actionPrint, *actionImport, *actionSave, *actionExport; - QAction *actionFind, *actionReplace, *actionFindNext, *actionFindPrevious; - //! Submenu of context menu with mathematical functions. - QMenu *functionsMenu; - //! Cursor used for output of evaluation results and error messages. - QTextCursor printCursor; - QString scriptsDirPath; - - //! Format used for resetting success/failure markers. - QTextBlockFormat d_fmt_default; - //! True if we are inside evaluate(), execute() or executeAll() there were errors. - bool d_error; - QString d_err_message; - - QCompleter *d_completer; - SyntaxHighlighter *d_highlighter; - QString d_file_name; - QString d_search_string; - QTextDocument::FindFlags d_search_flags; - QTextEdit *d_output_widget; - - private slots: - //! Insert an error message from the scripting system at printCursor. - /** - * After insertion, the text cursor will have the error message selected, allowing the user to - * delete it and fix the error. - */ - void insertErrorMsg(const QString &message); - void insertCompletion(const QString &completion); - void matchParentheses(); - - private: - QString textUnderCursor() const; - bool matchLeftParenthesis(QTextBlock currentBlock, int index, int numRightParentheses); - bool matchRightParenthesis(QTextBlock currentBlock, int index, int numLeftParentheses); - void createParenthesisSelection(int pos); -}; - -//! Structure used for parentheses matching -struct ParenthesisInfo -{ - char character; - int position; -}; - -//! Help class used for parentheses matching (code taken from Qt Quarterly Issue 31 Q3 2009) -class TextBlockData : public QTextBlockUserData -{ -public: - TextBlockData(){}; - - QVector parentheses(){return m_parentheses;}; - void insert(ParenthesisInfo *info) - { - int i = 0; - while (i < m_parentheses.size() && - info->position > m_parentheses.at(i)->position) - ++i; - - m_parentheses.insert(i, info); - } - -private: - QVector m_parentheses; -}; - -#endif === added file 'qtiplot/src/scripting/ScriptWindow.cpp' --- qtiplot/src/scripting/ScriptWindow.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/ScriptWindow.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,481 @@ +/*************************************************************************** + File : ScriptWindow.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 - 2009 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Python script window + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "ScriptWindow.h" +#include +#include "ScriptEdit.h" +#include "LineNumberDisplay.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +ScriptWindow::ScriptWindow(ScriptingEnv *env, ApplicationWindow *app) +: QMainWindow(), +d_app(app) +{ + initMenu(); + + fileName = QString::null; + + te = new ScriptEdit(env, this, name()); + te->setContext(this); + te->setDirPath(d_app->scriptsDirPath); + connect(te, SIGNAL(dirPathChanged(const QString& )), d_app, SLOT(scriptsDirPathChanged(const QString&))); + + d_line_number = new LineNumberDisplay(te, this); + d_frame = new QWidget(this); + + QHBoxLayout *hbox = new QHBoxLayout(d_frame); + hbox->setMargin(0); + hbox->setSpacing(0); + hbox->addWidget(d_line_number); + hbox->addWidget(te); + + setCentralWidget(d_frame); + + consoleWindow = new QDockWidget(this); + consoleWindow->setAllowedAreas(Qt::BottomDockWidgetArea); + consoleWindow->setWindowTitle(tr("Script Output Panel")); + addDockWidget( Qt::BottomDockWidgetArea, consoleWindow ); + console = new QTextEdit(consoleWindow); + console->setReadOnly(true); + consoleWindow->setWidget(console); + connect(te, SIGNAL(error(const QString&, const QString&, int)), console, SLOT(setPlainText(const QString&))); + connect(te, SIGNAL(error(const QString&, const QString&, int)), consoleWindow, SLOT(show())); + connect(te, SIGNAL(textChanged ()), this, SLOT(enableActions())); + + initActions(); + enableActions(); + + setIcon(QPixmap(":/logo.png")); + setWindowTitle(tr("QtiPlot - Script Window")); + setFocusProxy(te); + setFocusPolicy(Qt::StrongFocus); + resize(QSize(500, 300)); +} + +void ScriptWindow::initMenu() +{ + file = new QMenu(tr("&File"), this); + menuBar()->addMenu(file); + + edit = new QMenu(tr("&Edit"), this); + menuBar()->addMenu(edit); + + run = new QMenu(tr("E&xecute"), this); + menuBar()->addMenu(run); + + windowMenu = new QMenu(tr("&Window"), this); + menuBar()->addMenu(windowMenu); +} + +void ScriptWindow::initActions() +{ + actionNew = new QAction(QIcon(":/new.png"), tr("&New"), this); + actionNew->setShortcut( tr("Ctrl+N") ); + connect(actionNew, SIGNAL(activated()), this, SLOT(newScript())); + file->addAction(actionNew); + + actionOpen = new QAction(QIcon(":/fileopen.png"), tr("&Open..."), this); + actionOpen->setShortcut( tr("Ctrl+O") ); + connect(actionOpen, SIGNAL(activated()), this, SLOT(open())); + file->addAction(actionOpen); + + file->addSeparator(); + + actionSave = new QAction(QIcon(":/filesave.png"), tr("&Save"), this); + actionSave->setShortcut( tr("Ctrl+S") ); + connect(actionSave, SIGNAL(activated()), this, SLOT(save())); + file->addAction(actionSave); + + actionSaveAs = new QAction(QIcon(":/filesaveas.png"), tr("Save &As..."), this); + connect(actionSaveAs, SIGNAL(activated()), this, SLOT(saveAs())); + file->addAction(actionSaveAs); + + file->addSeparator(); + + actionPrintPreview = new QAction(tr("Print Pre&view..."), this); + connect(actionPrintPreview, SIGNAL(activated()), this, SLOT(printPreview())); + file->addAction(actionPrintPreview); + + actionPrint = new QAction(QIcon(":/fileprint.png"), tr("&Print"), this); + actionPrint->setShortcut( tr("Ctrl+P") ); + connect(actionPrint, SIGNAL(activated()), te, SLOT(print())); + file->addAction(actionPrint); + + actionUndo = new QAction(QIcon(":/undo.png"), tr("&Undo"), this); + actionUndo->setShortcut( tr("Ctrl+Z") ); + connect(actionUndo, SIGNAL(activated()), te, SLOT(undo())); + edit->addAction(actionUndo); + actionUndo->setEnabled(false); + + actionRedo = new QAction(QIcon(":/redo.png"), tr("&Redo"), this); + actionRedo->setShortcut( tr("Ctrl+Y") ); + connect(actionRedo, SIGNAL(activated()), te, SLOT(redo())); + edit->addAction(actionRedo); + actionRedo->setEnabled(false); + edit->insertSeparator(); + + actionCut = new QAction(QIcon(":/cut.png"), tr("&Cut"), this); + actionCut->setShortcut( tr("Ctrl+x") ); + connect(actionCut, SIGNAL(activated()), te, SLOT(cut())); + edit->addAction(actionCut); + actionCut->setEnabled(false); + + actionCopy = new QAction(QIcon(":/copy.png"), tr("&Copy"), this); + actionCopy->setShortcut( tr("Ctrl+C") ); + connect(actionCopy, SIGNAL(activated()), te, SLOT(copy())); + edit->addAction(actionCopy); + actionCopy->setEnabled(false); + + actionPaste = new QAction(QIcon(":/paste.png"), tr("&Paste"), this); + actionPaste->setShortcut( tr("Ctrl+V") ); + connect(actionPaste, SIGNAL(activated()), te, SLOT(paste())); + edit->addAction(actionPaste); + + edit->insertSeparator(); + + actionIncreaseIndent = new QAction(QIcon(":/increase_indent.png"), tr("Increase Indent"), this); + connect(actionIncreaseIndent, SIGNAL(activated()), this, SLOT(increaseIndent())); + edit->addAction(actionIncreaseIndent); + + actionDecreaseIndent = new QAction(QIcon(":/decrease_indent.png"),tr("Decrease Indent"), this); + connect(actionDecreaseIndent, SIGNAL(activated()), this, SLOT(decreaseIndent())); + edit->addAction(actionDecreaseIndent); + + edit->insertSeparator(); + + actionFind = new QAction(QIcon(":/find.png"), tr("&Find..."), this); + actionFind->setShortcut(tr("Ctrl+Alt+F")); + connect(actionFind, SIGNAL(activated()), this, SLOT(find())); + edit->addAction(actionFind); + + actionFindNext = new QAction(QIcon(":/find_next.png"), tr("Find &Next"), this); + actionFindNext->setShortcut(tr("F3")); + connect(actionFindNext, SIGNAL(activated()), this, SLOT(findNext())); + edit->addAction(actionFindNext); + + actionFindPrev = new QAction(QIcon(":/find_previous.png"), tr("Find &Previous"), this); + actionFindPrev->setShortcut(tr("F4")); + connect(actionFindPrev, SIGNAL(activated()), this, SLOT(findPrevious())); + edit->addAction(actionFindPrev); + + actionReplace = new QAction(QIcon(":/replace.png"), tr("&Replace..."), this); + connect(actionReplace, SIGNAL(activated()), this, SLOT(replace())); + edit->addAction(actionReplace); + + edit->insertSeparator(); + + actionShowLineNumbers = new QAction(tr("Show &Line Numbers"), this); + actionShowLineNumbers->setCheckable(true); + actionShowLineNumbers->setChecked(d_app->d_note_line_numbers); + connect(actionShowLineNumbers, SIGNAL(toggled(bool)), d_line_number, SLOT(setVisible(bool))); + edit->addAction(actionShowLineNumbers); + + actionExecute = new QAction(tr("E&xecute"), this); + actionExecute->setShortcut( tr("CTRL+J") ); + connect(actionExecute, SIGNAL(activated()), te, SLOT(execute())); + run->addAction(actionExecute); + + actionExecuteAll = new QAction(QIcon(":/play.png"), tr("Execute &All"), this); + actionExecuteAll->setShortcut( tr("CTRL+SHIFT+J") ); + connect(actionExecuteAll, SIGNAL(activated()), te, SLOT(executeAll())); + run->addAction(actionExecuteAll); + + actionEval = new QAction(tr("&Evaluate Expression"), this); + actionEval->setShortcut( tr("CTRL+Return") ); + connect(actionEval, SIGNAL(activated()), te, SLOT(evaluate())); + run->addAction(actionEval); + + run->addSeparator(); + + actionShowConsole = consoleWindow->toggleViewAction(); + actionShowConsole->setText(tr("Show Script &Output Panel")); + run->addAction(actionShowConsole); + + actionRedirectOutput = new QAction(tr("Ouput on Next &Line"), this); + actionRedirectOutput->setCheckable(true); + actionRedirectOutput->setChecked(true); + connect(actionRedirectOutput, SIGNAL(toggled(bool)), this, SLOT(redirectOutput(bool))); + run->addAction(actionRedirectOutput); + + actionAlwaysOnTop = new QAction(tr("Always on &Top"), this); + actionAlwaysOnTop->setCheckable(true); + if (d_app) + actionAlwaysOnTop->setChecked (d_app->d_script_win_on_top); + windowMenu->addAction(actionAlwaysOnTop); + connect(actionAlwaysOnTop, SIGNAL(toggled(bool)), this, SLOT(setAlwaysOnTop(bool))); + + actionShowWorkspace = new QAction(tr("Show &Workspace"), this); + actionShowWorkspace->setCheckable(true); + actionShowWorkspace->setOn(d_app->isMdiAreaEnabled()); + connect(actionShowWorkspace, SIGNAL(toggled(bool)), this, SLOT(showWorkspace(bool))); + windowMenu->addAction(actionShowWorkspace); + + actionHide = new QAction(tr("&Close"), this); + connect(actionHide, SIGNAL(activated()), this, SLOT(close())); + windowMenu->addAction(actionHide); + + connect(te, SIGNAL(copyAvailable(bool)), actionCut, SLOT(setEnabled(bool))); + connect(te, SIGNAL(copyAvailable(bool)), actionCopy, SLOT(setEnabled(bool))); + connect(te, SIGNAL(undoAvailable(bool)), actionUndo, SLOT(setEnabled(bool))); + connect(te, SIGNAL(redoAvailable(bool)), actionRedo, SLOT(setEnabled(bool))); +} + +void ScriptWindow::languageChange() +{ + setWindowTitle(tr("QtiPlot - Script Window")); + consoleWindow->setWindowTitle(tr("Script Output Panel")); + + menuBar()->clear(); + menuBar()->addMenu(file); + menuBar()->addMenu(edit); + menuBar()->addMenu(run); + + file->setTitle(tr("&File")); + edit->setTitle(tr("&Edit")); + run->setTitle(tr("E&xecute")); + + menuBar()->addAction(tr("&Close"), this, SLOT(close())); + + actionNew->setText(tr("&New")); + actionNew->setShortcut(tr("Ctrl+N")); + + actionOpen->setText(tr("&Open...")); + actionOpen->setShortcut(tr("Ctrl+O")); + + actionSave->setText(tr("&Save")); + actionSave->setShortcut(tr("Ctrl+S")); + + actionSaveAs->setText(tr("Save &As...")); + + actionPrint->setText(tr("&Print")); + actionPrint->setShortcut(tr("Ctrl+P")); + + actionPrintPreview->setText(tr("Print Pre&view...")); + + actionUndo->setText(tr("&Undo")); + actionUndo->setShortcut(tr("Ctrl+Z")); + + actionRedo->setText(tr("&Redo")); + actionRedo->setShortcut(tr("Ctrl+Y")); + + actionCut->setText(tr("&Cut")); + actionCut->setShortcut(tr("Ctrl+x")); + + actionCopy->setText(tr("&Copy")); + actionCopy->setShortcut(tr("Ctrl+C")); + + actionPaste->setText(tr("&Paste")); + actionPaste->setShortcut(tr("Ctrl+V")); + + actionExecute->setText(tr("E&xecute")); + actionExecute->setShortcut(tr("CTRL+J")); + + actionExecuteAll->setText(tr("Execute &All")); + actionExecuteAll->setShortcut(tr("CTRL+SHIFT+J")); + + actionEval->setText(tr("&Evaluate Expression")); + actionEval->setShortcut(tr("CTRL+Return")); + + actionShowConsole->setText(tr("Show Script &Output Panel")); + actionShowConsole->setToolTip(tr("Show Script Output Panel")); + + actionRedirectOutput->setText(tr("Ouput on Next &Line")); + actionShowWorkspace->setText(tr("Show &Workspace")); + + actionFind->setText(tr("&Find...")); + actionFind->setShortcut(tr("Ctrl+Alt+F")); + + actionReplace->setText(tr("&Replace...")); + + actionFindNext->setText(tr("Find &Next")); + actionFindNext->setShortcut(tr("F3")); + + actionFindPrev->setText(tr("Find &Previous")); + actionFindPrev->setShortcut(tr("F4")); + + actionIncreaseIndent->setText(tr("Increase Indent")); + actionDecreaseIndent->setText(tr("Decrease Indent")); +} + + +void ScriptWindow::newScript() +{ + fileName = QString::null; + te->clear(); +} + +void ScriptWindow::open(const QString& fn) +{ + QString s = te->importASCII(fn); + if (!s.isEmpty()) + fileName = s; +} + +void ScriptWindow::saveAs() +{ + QString fn = te->exportASCII(); + if (!fn.isEmpty()) + fileName = fn; +} + +void ScriptWindow::save() +{ + if (!fileName.isEmpty()){ + QFile f(fileName); + if ( !f.open( QIODevice::WriteOnly ) ){ + QMessageBox::critical(0, tr("QtiPlot - File Save Error"), + tr("Could not write to file:

%1

Please verify that you have the right to write to this location!").arg(fileName)); + return; + } + QTextStream t( &f ); + t.setCodec("UTF-8"); + t << te->text(); + f.close(); + } else + saveAs(); +} + +void ScriptWindow::setVisible(bool visible) +{ + if (visible == isVisible()) + return; + QMainWindow::setVisible(visible); + emit visibilityChanged(visible); +} + +void ScriptWindow::setAlwaysOnTop(bool on) +{ + if (!d_app) + return; + + d_app->d_script_win_on_top = on; + + QString msg = tr("You need to close and reopen the script window before your changes become effective! Do you want to close it now?"); + if (QMessageBox::question(this, tr("QtiPlot"), msg, QMessageBox::Ok, QMessageBox::No) == QMessageBox::Ok) + this->close(); +} + +void ScriptWindow::moveEvent( QMoveEvent* e ) +{ + d_app->d_script_win_rect = QRect(pos(), size()); + e->accept(); +} + +void ScriptWindow::resizeEvent( QResizeEvent* e ) +{ + d_app->d_script_win_rect = QRect(geometry().topLeft(), size()); + e->accept(); +} + +void ScriptWindow::showLineNumbers(bool show) +{ + d_line_number->setVisible(show); + if (show) + d_line_number->updateLineNumbers(); +} + +void ScriptWindow::redirectOutput(bool inside) +{ + if (inside) + te->redirectOutputTo(0); + else + te->redirectOutputTo(console); +} + +void ScriptWindow::printPreview() +{ + QPrintPreviewDialog *preview = new QPrintPreviewDialog(this); + preview->setWindowTitle(tr("QtiPlot") + " - " + tr("Script print preview")); + connect(preview, SIGNAL(paintRequested(QPrinter *)), te, SLOT(print(QPrinter *))); + preview->exec(); +} + +void ScriptWindow::showWorkspace(bool on) +{ + if (!d_app) + return; + + d_app->enableMdiArea(on); + d_app->setVisible(on); + setAttribute (Qt::WA_DeleteOnClose, !on); +} + +void ScriptWindow::find() +{ + te->showFindDialog(); +} + +void ScriptWindow::findNext() +{ + te->findNext(); +} + +void ScriptWindow::findPrevious() +{ + te->findPrevious(); +} + +void ScriptWindow::replace() +{ + te->showFindDialog(true); +} + +void ScriptWindow::increaseIndent() +{ + te->setTabStopWidth(te->tabStopWidth() + 5); +} + +void ScriptWindow::decreaseIndent() +{ + te->setTabStopWidth(te->tabStopWidth() - 5); +} + +void ScriptWindow::enableActions() +{ + bool hasText = !te->text().isEmpty(); + + actionFind->setEnabled(hasText); + actionFindNext->setEnabled(hasText); + actionFindPrev->setEnabled(hasText); + actionReplace->setEnabled(hasText); + actionExecute->setEnabled(hasText); + actionExecuteAll->setEnabled(hasText); + actionEval->setEnabled(hasText); +} === removed file 'qtiplot/src/scripting/ScriptWindow.cpp' --- qtiplot/src/scripting/ScriptWindow.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/ScriptWindow.cpp 1970-01-01 00:00:00 +0000 @@ -1,482 +0,0 @@ -/*************************************************************************** - File : ScriptWindow.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 - 2009 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Python script window - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "ScriptWindow.h" -#include -#include "ScriptEdit.h" -#include "LineNumberDisplay.h" -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -ScriptWindow::ScriptWindow(ScriptingEnv *env, ApplicationWindow *app) -: QMainWindow(), -d_app(app) -{ - initMenu(); - - fileName = QString::null; - - te = new ScriptEdit(env, this, name()); - te->setContext(this); - te->setDirPath(d_app->scriptsDirPath); - connect(te, SIGNAL(dirPathChanged(const QString& )), d_app, SLOT(scriptsDirPathChanged(const QString&))); - - d_line_number = new LineNumberDisplay(te, this); - d_frame = new QWidget(this); - - QHBoxLayout *hbox = new QHBoxLayout(d_frame); - hbox->setMargin(0); - hbox->setSpacing(0); - hbox->addWidget(d_line_number); - hbox->addWidget(te); - - setCentralWidget(d_frame); - - consoleWindow = new QDockWidget(this); - consoleWindow->setAllowedAreas(Qt::BottomDockWidgetArea); - consoleWindow->setWindowTitle(tr("Script Output Panel")); - addDockWidget( Qt::BottomDockWidgetArea, consoleWindow ); - console = new QTextEdit(consoleWindow); - console->setReadOnly(true); - consoleWindow->setWidget(console); - connect(te, SIGNAL(error(const QString&, const QString&, int)), console, SLOT(setPlainText(const QString&))); - connect(te, SIGNAL(error(const QString&, const QString&, int)), consoleWindow, SLOT(show())); - connect(te, SIGNAL(textChanged ()), this, SLOT(enableActions())); - - initActions(); - enableActions(); - - setIcon(QPixmap(logo_xpm)); - setWindowTitle(tr("QtiPlot - Script Window")); - setFocusProxy(te); - setFocusPolicy(Qt::StrongFocus); - resize(QSize(500, 300)); -} - -void ScriptWindow::initMenu() -{ - file = new QMenu(tr("&File"), this); - menuBar()->addMenu(file); - - edit = new QMenu(tr("&Edit"), this); - menuBar()->addMenu(edit); - - run = new QMenu(tr("E&xecute"), this); - menuBar()->addMenu(run); - - windowMenu = new QMenu(tr("&Window"), this); - menuBar()->addMenu(windowMenu); -} - -void ScriptWindow::initActions() -{ - actionNew = new QAction(QPixmap(new_xpm), tr("&New"), this); - actionNew->setShortcut( tr("Ctrl+N") ); - connect(actionNew, SIGNAL(activated()), this, SLOT(newScript())); - file->addAction(actionNew); - - actionOpen = new QAction(QPixmap(fileopen_xpm), tr("&Open..."), this); - actionOpen->setShortcut( tr("Ctrl+O") ); - connect(actionOpen, SIGNAL(activated()), this, SLOT(open())); - file->addAction(actionOpen); - - file->addSeparator(); - - actionSave = new QAction(QPixmap(filesave_xpm), tr("&Save"), this); - actionSave->setShortcut( tr("Ctrl+S") ); - connect(actionSave, SIGNAL(activated()), this, SLOT(save())); - file->addAction(actionSave); - - actionSaveAs = new QAction(QIcon(QPixmap(filesaveas_xpm)), tr("Save &As..."), this); - connect(actionSaveAs, SIGNAL(activated()), this, SLOT(saveAs())); - file->addAction(actionSaveAs); - - file->addSeparator(); - - actionPrintPreview = new QAction(tr("Print Pre&view..."), this); - connect(actionPrintPreview, SIGNAL(activated()), this, SLOT(printPreview())); - file->addAction(actionPrintPreview); - - actionPrint = new QAction(QPixmap(fileprint_xpm), tr("&Print"), this); - actionPrint->setShortcut( tr("Ctrl+P") ); - connect(actionPrint, SIGNAL(activated()), te, SLOT(print())); - file->addAction(actionPrint); - - actionUndo = new QAction(QPixmap(undo_xpm), tr("&Undo"), this); - actionUndo->setShortcut( tr("Ctrl+Z") ); - connect(actionUndo, SIGNAL(activated()), te, SLOT(undo())); - edit->addAction(actionUndo); - actionUndo->setEnabled(false); - - actionRedo = new QAction(QPixmap(redo_xpm), tr("&Redo"), this); - actionRedo->setShortcut( tr("Ctrl+Y") ); - connect(actionRedo, SIGNAL(activated()), te, SLOT(redo())); - edit->addAction(actionRedo); - actionRedo->setEnabled(false); - edit->insertSeparator(); - - actionCut = new QAction(QPixmap(cut_xpm), tr("&Cut"), this); - actionCut->setShortcut( tr("Ctrl+x") ); - connect(actionCut, SIGNAL(activated()), te, SLOT(cut())); - edit->addAction(actionCut); - actionCut->setEnabled(false); - - actionCopy = new QAction(QPixmap(copy_xpm), tr("&Copy"), this); - actionCopy->setShortcut( tr("Ctrl+C") ); - connect(actionCopy, SIGNAL(activated()), te, SLOT(copy())); - edit->addAction(actionCopy); - actionCopy->setEnabled(false); - - actionPaste = new QAction(QPixmap(paste_xpm), tr("&Paste"), this); - actionPaste->setShortcut( tr("Ctrl+V") ); - connect(actionPaste, SIGNAL(activated()), te, SLOT(paste())); - edit->addAction(actionPaste); - - edit->insertSeparator(); - - actionIncreaseIndent = new QAction(QPixmap(increase_indent_xpm), tr("Increase Indent"), this); - connect(actionIncreaseIndent, SIGNAL(activated()), this, SLOT(increaseIndent())); - edit->addAction(actionIncreaseIndent); - - actionDecreaseIndent = new QAction(QPixmap(decrease_indent_xpm),tr("Decrease Indent"), this); - connect(actionDecreaseIndent, SIGNAL(activated()), this, SLOT(decreaseIndent())); - edit->addAction(actionDecreaseIndent); - - edit->insertSeparator(); - - actionFind = new QAction(QPixmap(find_xpm), tr("&Find..."), this); - actionFind->setShortcut(tr("Ctrl+Alt+F")); - connect(actionFind, SIGNAL(activated()), this, SLOT(find())); - edit->addAction(actionFind); - - actionFindNext = new QAction(QPixmap(find_next_xpm), tr("Find &Next"), this); - actionFindNext->setShortcut(tr("F3")); - connect(actionFindNext, SIGNAL(activated()), this, SLOT(findNext())); - edit->addAction(actionFindNext); - - actionFindPrev = new QAction(QPixmap(find_previous_xpm), tr("Find &Previous"), this); - actionFindPrev->setShortcut(tr("F4")); - connect(actionFindPrev, SIGNAL(activated()), this, SLOT(findPrevious())); - edit->addAction(actionFindPrev); - - actionReplace = new QAction(QPixmap(replace_xpm), tr("&Replace..."), this); - connect(actionReplace, SIGNAL(activated()), this, SLOT(replace())); - edit->addAction(actionReplace); - - edit->insertSeparator(); - - actionShowLineNumbers = new QAction(tr("Show &Line Numbers"), this); - actionShowLineNumbers->setCheckable(true); - actionShowLineNumbers->setChecked(d_app->d_note_line_numbers); - connect(actionShowLineNumbers, SIGNAL(toggled(bool)), d_line_number, SLOT(setVisible(bool))); - edit->addAction(actionShowLineNumbers); - - actionExecute = new QAction(tr("E&xecute"), this); - actionExecute->setShortcut( tr("CTRL+J") ); - connect(actionExecute, SIGNAL(activated()), te, SLOT(execute())); - run->addAction(actionExecute); - - actionExecuteAll = new QAction(QPixmap(play_xpm), tr("Execute &All"), this); - actionExecuteAll->setShortcut( tr("CTRL+SHIFT+J") ); - connect(actionExecuteAll, SIGNAL(activated()), te, SLOT(executeAll())); - run->addAction(actionExecuteAll); - - actionEval = new QAction(tr("&Evaluate Expression"), this); - actionEval->setShortcut( tr("CTRL+Return") ); - connect(actionEval, SIGNAL(activated()), te, SLOT(evaluate())); - run->addAction(actionEval); - - run->addSeparator(); - - actionShowConsole = consoleWindow->toggleViewAction(); - actionShowConsole->setText(tr("Show Script &Output Panel")); - run->addAction(actionShowConsole); - - actionRedirectOutput = new QAction(tr("Ouput on Next &Line"), this); - actionRedirectOutput->setCheckable(true); - actionRedirectOutput->setChecked(true); - connect(actionRedirectOutput, SIGNAL(toggled(bool)), this, SLOT(redirectOutput(bool))); - run->addAction(actionRedirectOutput); - - actionAlwaysOnTop = new QAction(tr("Always on &Top"), this); - actionAlwaysOnTop->setCheckable(true); - if (d_app) - actionAlwaysOnTop->setChecked (d_app->d_script_win_on_top); - windowMenu->addAction(actionAlwaysOnTop); - connect(actionAlwaysOnTop, SIGNAL(toggled(bool)), this, SLOT(setAlwaysOnTop(bool))); - - actionShowWorkspace = new QAction(tr("Show &Workspace"), this); - actionShowWorkspace->setCheckable(true); - actionShowWorkspace->setOn(d_app->isMdiAreaEnabled()); - connect(actionShowWorkspace, SIGNAL(toggled(bool)), this, SLOT(showWorkspace(bool))); - windowMenu->addAction(actionShowWorkspace); - - actionHide = new QAction(tr("&Close"), this); - connect(actionHide, SIGNAL(activated()), this, SLOT(close())); - windowMenu->addAction(actionHide); - - connect(te, SIGNAL(copyAvailable(bool)), actionCut, SLOT(setEnabled(bool))); - connect(te, SIGNAL(copyAvailable(bool)), actionCopy, SLOT(setEnabled(bool))); - connect(te, SIGNAL(undoAvailable(bool)), actionUndo, SLOT(setEnabled(bool))); - connect(te, SIGNAL(redoAvailable(bool)), actionRedo, SLOT(setEnabled(bool))); -} - -void ScriptWindow::languageChange() -{ - setWindowTitle(tr("QtiPlot - Script Window")); - consoleWindow->setWindowTitle(tr("Script Output Panel")); - - menuBar()->clear(); - menuBar()->addMenu(file); - menuBar()->addMenu(edit); - menuBar()->addMenu(run); - - file->setTitle(tr("&File")); - edit->setTitle(tr("&Edit")); - run->setTitle(tr("E&xecute")); - - menuBar()->addAction(tr("&Close"), this, SLOT(close())); - - actionNew->setText(tr("&New")); - actionNew->setShortcut(tr("Ctrl+N")); - - actionOpen->setText(tr("&Open...")); - actionOpen->setShortcut(tr("Ctrl+O")); - - actionSave->setText(tr("&Save")); - actionSave->setShortcut(tr("Ctrl+S")); - - actionSaveAs->setText(tr("Save &As...")); - - actionPrint->setText(tr("&Print")); - actionPrint->setShortcut(tr("Ctrl+P")); - - actionPrintPreview->setText(tr("Print Pre&view...")); - - actionUndo->setText(tr("&Undo")); - actionUndo->setShortcut(tr("Ctrl+Z")); - - actionRedo->setText(tr("&Redo")); - actionRedo->setShortcut(tr("Ctrl+Y")); - - actionCut->setText(tr("&Cut")); - actionCut->setShortcut(tr("Ctrl+x")); - - actionCopy->setText(tr("&Copy")); - actionCopy->setShortcut(tr("Ctrl+C")); - - actionPaste->setText(tr("&Paste")); - actionPaste->setShortcut(tr("Ctrl+V")); - - actionExecute->setText(tr("E&xecute")); - actionExecute->setShortcut(tr("CTRL+J")); - - actionExecuteAll->setText(tr("Execute &All")); - actionExecuteAll->setShortcut(tr("CTRL+SHIFT+J")); - - actionEval->setText(tr("&Evaluate Expression")); - actionEval->setShortcut(tr("CTRL+Return")); - - actionShowConsole->setText(tr("Show Script &Output Panel")); - actionShowConsole->setToolTip(tr("Show Script Output Panel")); - - actionRedirectOutput->setText(tr("Ouput on Next &Line")); - actionShowWorkspace->setText(tr("Show &Workspace")); - - actionFind->setText(tr("&Find...")); - actionFind->setShortcut(tr("Ctrl+Alt+F")); - - actionReplace->setText(tr("&Replace...")); - - actionFindNext->setText(tr("Find &Next")); - actionFindNext->setShortcut(tr("F3")); - - actionFindPrev->setText(tr("Find &Previous")); - actionFindPrev->setShortcut(tr("F4")); - - actionIncreaseIndent->setText(tr("Increase Indent")); - actionDecreaseIndent->setText(tr("Decrease Indent")); -} - - -void ScriptWindow::newScript() -{ - fileName = QString::null; - te->clear(); -} - -void ScriptWindow::open(const QString& fn) -{ - QString s = te->importASCII(fn); - if (!s.isEmpty()) - fileName = s; -} - -void ScriptWindow::saveAs() -{ - QString fn = te->exportASCII(); - if (!fn.isEmpty()) - fileName = fn; -} - -void ScriptWindow::save() -{ - if (!fileName.isEmpty()){ - QFile f(fileName); - if ( !f.open( QIODevice::WriteOnly ) ){ - QMessageBox::critical(0, tr("QtiPlot - File Save Error"), - tr("Could not write to file:

%1

Please verify that you have the right to write to this location!").arg(fileName)); - return; - } - QTextStream t( &f ); - t.setCodec("UTF-8"); - t << te->text(); - f.close(); - } else - saveAs(); -} - -void ScriptWindow::setVisible(bool visible) -{ - if (visible == isVisible()) - return; - QMainWindow::setVisible(visible); - emit visibilityChanged(visible); -} - -void ScriptWindow::setAlwaysOnTop(bool on) -{ - if (!d_app) - return; - - d_app->d_script_win_on_top = on; - - QString msg = tr("You need to close and reopen the script window before your changes become effective! Do you want to close it now?"); - if (QMessageBox::question(this, tr("QtiPlot"), msg, QMessageBox::Ok, QMessageBox::No) == QMessageBox::Ok) - this->close(); -} - -void ScriptWindow::moveEvent( QMoveEvent* e ) -{ - d_app->d_script_win_rect = QRect(pos(), size()); - e->accept(); -} - -void ScriptWindow::resizeEvent( QResizeEvent* e ) -{ - d_app->d_script_win_rect = QRect(geometry().topLeft(), size()); - e->accept(); -} - -void ScriptWindow::showLineNumbers(bool show) -{ - d_line_number->setVisible(show); - if (show) - d_line_number->updateLineNumbers(); -} - -void ScriptWindow::redirectOutput(bool inside) -{ - if (inside) - te->redirectOutputTo(0); - else - te->redirectOutputTo(console); -} - -void ScriptWindow::printPreview() -{ - QPrintPreviewDialog *preview = new QPrintPreviewDialog(this); - preview->setWindowTitle(tr("QtiPlot") + " - " + tr("Script print preview")); - connect(preview, SIGNAL(paintRequested(QPrinter *)), te, SLOT(print(QPrinter *))); - preview->exec(); -} - -void ScriptWindow::showWorkspace(bool on) -{ - if (!d_app) - return; - - d_app->enableMdiArea(on); - d_app->setVisible(on); - setAttribute (Qt::WA_DeleteOnClose, !on); -} - -void ScriptWindow::find() -{ - te->showFindDialog(); -} - -void ScriptWindow::findNext() -{ - te->findNext(); -} - -void ScriptWindow::findPrevious() -{ - te->findPrevious(); -} - -void ScriptWindow::replace() -{ - te->showFindDialog(true); -} - -void ScriptWindow::increaseIndent() -{ - te->setTabStopWidth(te->tabStopWidth() + 5); -} - -void ScriptWindow::decreaseIndent() -{ - te->setTabStopWidth(te->tabStopWidth() - 5); -} - -void ScriptWindow::enableActions() -{ - bool hasText = !te->text().isEmpty(); - - actionFind->setEnabled(hasText); - actionFindNext->setEnabled(hasText); - actionFindPrev->setEnabled(hasText); - actionReplace->setEnabled(hasText); - actionExecute->setEnabled(hasText); - actionExecuteAll->setEnabled(hasText); - actionEval->setEnabled(hasText); -} === added file 'qtiplot/src/scripting/ScriptWindow.h' --- qtiplot/src/scripting/ScriptWindow.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/ScriptWindow.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,107 @@ +/*************************************************************************** + File : ScriptWindow.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 - 2009 by Ion Vasilief Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Python script window + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef SCRIPTWINDOW_H +#define SCRIPTWINDOW_H + +#include "ScriptEdit.h" + +#include +#include +#include +class ScriptingEnv; +class ApplicationWindow; +class LineNumberDisplay; +class QAction; + +//! Python script window +class ScriptWindow: public QMainWindow +{ + Q_OBJECT + +public: + ScriptWindow(ScriptingEnv *env, ApplicationWindow *app); + ~ScriptWindow(){exit(0);}; + +public slots: + void newScript(); + void open(const QString& fn = QString()); + void save(); + void saveAs(); + void languageChange(); + virtual void setVisible(bool visible); + + ScriptEdit* editor(){return te;}; + void executeAll(){te->executeAll();}; + + //! Enables/Disables the line number display + void showLineNumbers(bool show = true); + +private slots: + void setAlwaysOnTop(bool on); + void redirectOutput(bool); + void printPreview(); + void showWorkspace(bool on = true); + void find(); + void findNext(); + void findPrevious(); + void replace(); + void increaseIndent(); + void decreaseIndent(); + void enableActions(); + +signals: + void visibilityChanged(bool visible); + +private: + void moveEvent( QMoveEvent* ); + void resizeEvent( QResizeEvent* ); + + void initMenu(); + void initActions(); + ScriptEdit *te; + ApplicationWindow *d_app; + LineNumberDisplay *d_line_number; + QWidget *d_frame; + + QString fileName; + + QMenu *file, *edit, *run, *windowMenu; + QAction *actionNew, *actionUndo, *actionRedo, *actionCut, *actionCopy, *actionPaste; + QAction *actionExecute, *actionExecuteAll, *actionEval, *actionPrint, *actionOpen; + QAction *actionSave, *actionSaveAs; + QAction *actionAlwaysOnTop, *actionHide, *actionShowLineNumbers; + QAction *actionShowConsole, *actionRedirectOutput, *actionPrintPreview; + QAction *actionShowWorkspace; + QAction *actionFind, *actionFindNext, *actionFindPrev, *actionReplace; + QAction *actionIncreaseIndent, *actionDecreaseIndent; + QDockWidget *consoleWindow; + QTextEdit *console; +}; + +#endif === removed file 'qtiplot/src/scripting/ScriptWindow.h' --- qtiplot/src/scripting/ScriptWindow.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/ScriptWindow.h 1970-01-01 00:00:00 +0000 @@ -1,107 +0,0 @@ -/*************************************************************************** - File : ScriptWindow.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 - 2009 by Ion Vasilief Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Python script window - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef SCRIPTWINDOW_H -#define SCRIPTWINDOW_H - -#include "ScriptEdit.h" - -#include -#include -#include -class ScriptingEnv; -class ApplicationWindow; -class LineNumberDisplay; -class QAction; - -//! Python script window -class ScriptWindow: public QMainWindow -{ - Q_OBJECT - -public: - ScriptWindow(ScriptingEnv *env, ApplicationWindow *app); - ~ScriptWindow(){exit(0);}; - -public slots: - void newScript(); - void open(const QString& fn = QString()); - void save(); - void saveAs(); - void languageChange(); - virtual void setVisible(bool visible); - - ScriptEdit* editor(){return te;}; - void executeAll(){te->executeAll();}; - - //! Enables/Disables the line number display - void showLineNumbers(bool show = true); - -private slots: - void setAlwaysOnTop(bool on); - void redirectOutput(bool); - void printPreview(); - void showWorkspace(bool on = true); - void find(); - void findNext(); - void findPrevious(); - void replace(); - void increaseIndent(); - void decreaseIndent(); - void enableActions(); - -signals: - void visibilityChanged(bool visible); - -private: - void moveEvent( QMoveEvent* ); - void resizeEvent( QResizeEvent* ); - - void initMenu(); - void initActions(); - ScriptEdit *te; - ApplicationWindow *d_app; - LineNumberDisplay *d_line_number; - QWidget *d_frame; - - QString fileName; - - QMenu *file, *edit, *run, *windowMenu; - QAction *actionNew, *actionUndo, *actionRedo, *actionCut, *actionCopy, *actionPaste; - QAction *actionExecute, *actionExecuteAll, *actionEval, *actionPrint, *actionOpen; - QAction *actionSave, *actionSaveAs; - QAction *actionAlwaysOnTop, *actionHide, *actionShowLineNumbers; - QAction *actionShowConsole, *actionRedirectOutput, *actionPrintPreview; - QAction *actionShowWorkspace; - QAction *actionFind, *actionFindNext, *actionFindPrev, *actionReplace; - QAction *actionIncreaseIndent, *actionDecreaseIndent; - QDockWidget *consoleWindow; - QTextEdit *console; -}; - -#endif === added file 'qtiplot/src/scripting/ScriptingEnv.cpp' --- qtiplot/src/scripting/ScriptingEnv.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/ScriptingEnv.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,70 @@ +/*************************************************************************** + File : ScriptingEnv.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Knut Franke + Email (use @ for *) : knut.franke*gmx.de + Description : Implementations of generic scripting classes + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "ScriptingEnv.h" +#include "Script.h" + +#include + +#ifdef SCRIPTING_MUPARSER +#include "muParserScript.h" +#include "muParserScripting.h" +#endif +#ifdef SCRIPTING_PYTHON +#include "PythonScript.h" +#include "PythonScripting.h" +#endif + + ScriptingEnv::ScriptingEnv(ApplicationWindow *parent, const char *langName) +: QObject(0, langName), d_parent(parent) +{ + d_initialized=false; + d_refcount=0; +} + +const QString ScriptingEnv::fileFilter() const +{ + QStringList extensions = fileExtensions(); + if (extensions.isEmpty()) + return ""; + else + return tr("%1 Source (*.%2);;").arg(name()).arg(extensions.join(" *.")); +} + +void ScriptingEnv::incref() +{ + d_refcount++; +} + +void ScriptingEnv::decref() +{ + d_refcount--; + if (d_refcount==0) + delete this; +} + === removed file 'qtiplot/src/scripting/ScriptingEnv.cpp' --- qtiplot/src/scripting/ScriptingEnv.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/ScriptingEnv.cpp 1970-01-01 00:00:00 +0000 @@ -1,70 +0,0 @@ -/*************************************************************************** - File : ScriptingEnv.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Knut Franke - Email (use @ for *) : knut.franke*gmx.de - Description : Implementations of generic scripting classes - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "ScriptingEnv.h" -#include "Script.h" - -#include - -#ifdef SCRIPTING_MUPARSER -#include "muParserScript.h" -#include "muParserScripting.h" -#endif -#ifdef SCRIPTING_PYTHON -#include "PythonScript.h" -#include "PythonScripting.h" -#endif - - ScriptingEnv::ScriptingEnv(ApplicationWindow *parent, const char *langName) -: QObject(0, langName), d_parent(parent) -{ - d_initialized=false; - d_refcount=0; -} - -const QString ScriptingEnv::fileFilter() const -{ - QStringList extensions = fileExtensions(); - if (extensions.isEmpty()) - return ""; - else - return tr("%1 Source (*.%2);;").arg(name()).arg(extensions.join(" *.")); -} - -void ScriptingEnv::incref() -{ - d_refcount++; -} - -void ScriptingEnv::decref() -{ - d_refcount--; - if (d_refcount==0) - delete this; -} - === added file 'qtiplot/src/scripting/ScriptingEnv.h' --- qtiplot/src/scripting/ScriptingEnv.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/ScriptingEnv.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,115 @@ +/*************************************************************************** + File : ScriptingEnv.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Scripting abstraction layer + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef SCRIPTINGENV_H +#define SCRIPTINGENV_H + +#include +#include +#include +#include +#include +#include + +#include "customevents.h" + +class ApplicationWindow; +class Script; + +//! An interpreter for evaluating scripting code. Abstract. + /** + * ScriptingEnv objects represent a running interpreter, possibly with global + * variables, and are responsible for generating Script objects (which do + * the actual evaluation of code). + */ +class ScriptingEnv : public QObject +{ + Q_OBJECT + + public: + ScriptingEnv(ApplicationWindow *parent, const char *langName); + //! Part of the initialization is deferred from the constructor until after the signals have been connected. + virtual bool initialize() { return true; }; + //! initialization of the interpreter may fail; or there could be other errors setting up the environment + bool initialized() const { return d_initialized; } + //! whether asynchronuous execution is enabled (if supported by the implementation) + virtual bool isRunning() const { return false; } + + //! Instantiate the Script subclass matching the ScriptEnv subclass. + virtual Script *newScript(const QString&, QObject*, const QString&) { return 0; } + + //! If an exception / error occured, return a nicely formated stack backtrace. + virtual QString stackTraceString() { return QString::null; } + + //! Return a list of supported mathematical functions. These should be imported into the global namespace. + virtual const QStringList mathFunctions() const { return QStringList(); } + //! Return a documentation string for the given mathematical function. + virtual const QString mathFunctionDoc(const QString&) const { return QString::null; } + //! Return a list of file extensions commonly used for this language. + virtual const QStringList fileExtensions() const { return QStringList(); }; + //! Construct a filter expression from fileExtension(), suitable for QFileDialog. + const QString fileFilter() const; + + ApplicationWindow *application(){return d_parent;}; + + public slots: + // global variables + virtual bool setQObject(QObject*, const char*) { return false; } + virtual bool setInt(int, const char*) { return false; } + virtual bool setDouble(double, const char*) { return false; } + + //! Clear the global environment. What exactly happens depends on the implementation. + virtual void clear() {} + //! If the implementation supports asynchronuos execution, deactivate it. + virtual void stopExecution() {} + //! If the implementation supports asynchronuos execution, activate it. + virtual void startExecution() {} + + //! Increase the reference count. This should only be called by scripted and Script to avoid memory leaks. + void incref(); + //! Decrease the reference count. This should only be called by scripted and Script to avoid segfaults. + void decref(); + + signals: + //! signal an error condition / exception + void error(const QString & message, const QString & scriptName, int lineNumber); + //! output that is not handled by a Script + void print(const QString & output); + + protected: + //! whether the interpreter has been successfully initialized + bool d_initialized; + //! the context in which we are running + ApplicationWindow *d_parent; + + private: + //! the reference counter + int d_refcount; +}; + +#endif === removed file 'qtiplot/src/scripting/ScriptingEnv.h' --- qtiplot/src/scripting/ScriptingEnv.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/ScriptingEnv.h 1970-01-01 00:00:00 +0000 @@ -1,115 +0,0 @@ -/*************************************************************************** - File : ScriptingEnv.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Scripting abstraction layer - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef SCRIPTINGENV_H -#define SCRIPTINGENV_H - -#include -#include -#include -#include -#include -#include - -#include "customevents.h" - -class ApplicationWindow; -class Script; - -//! An interpreter for evaluating scripting code. Abstract. - /** - * ScriptingEnv objects represent a running interpreter, possibly with global - * variables, and are responsible for generating Script objects (which do - * the actual evaluation of code). - */ -class ScriptingEnv : public QObject -{ - Q_OBJECT - - public: - ScriptingEnv(ApplicationWindow *parent, const char *langName); - //! Part of the initialization is deferred from the constructor until after the signals have been connected. - virtual bool initialize() { return true; }; - //! initialization of the interpreter may fail; or there could be other errors setting up the environment - bool initialized() const { return d_initialized; } - //! whether asynchronuous execution is enabled (if supported by the implementation) - virtual bool isRunning() const { return false; } - - //! Instantiate the Script subclass matching the ScriptEnv subclass. - virtual Script *newScript(const QString&, QObject*, const QString&) { return 0; } - - //! If an exception / error occured, return a nicely formated stack backtrace. - virtual QString stackTraceString() { return QString::null; } - - //! Return a list of supported mathematical functions. These should be imported into the global namespace. - virtual const QStringList mathFunctions() const { return QStringList(); } - //! Return a documentation string for the given mathematical function. - virtual const QString mathFunctionDoc(const QString&) const { return QString::null; } - //! Return a list of file extensions commonly used for this language. - virtual const QStringList fileExtensions() const { return QStringList(); }; - //! Construct a filter expression from fileExtension(), suitable for QFileDialog. - const QString fileFilter() const; - - ApplicationWindow *application(){return d_parent;}; - - public slots: - // global variables - virtual bool setQObject(QObject*, const char*) { return false; } - virtual bool setInt(int, const char*) { return false; } - virtual bool setDouble(double, const char*) { return false; } - - //! Clear the global environment. What exactly happens depends on the implementation. - virtual void clear() {} - //! If the implementation supports asynchronuos execution, deactivate it. - virtual void stopExecution() {} - //! If the implementation supports asynchronuos execution, activate it. - virtual void startExecution() {} - - //! Increase the reference count. This should only be called by scripted and Script to avoid memory leaks. - void incref(); - //! Decrease the reference count. This should only be called by scripted and Script to avoid segfaults. - void decref(); - - signals: - //! signal an error condition / exception - void error(const QString & message, const QString & scriptName, int lineNumber); - //! output that is not handled by a Script - void print(const QString & output); - - protected: - //! whether the interpreter has been successfully initialized - bool d_initialized; - //! the context in which we are running - ApplicationWindow *d_parent; - - private: - //! the reference counter - int d_refcount; -}; - -#endif === added file 'qtiplot/src/scripting/ScriptingLangDialog.cpp' --- qtiplot/src/scripting/ScriptingLangDialog.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/ScriptingLangDialog.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,81 @@ +/*************************************************************************** + File : ScriptingLangDialog.cpp + Project : QtiPlot +-------------------------------------------------------------------- + Copyright : (C) 2006 by Knut Franke, Ion Vasilief + Email (use @ for *) : knut.franke*gmx.de, ion_vasilief*yahoo.fr + Description : Dialog for changing the current scripting + language + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "ScriptingLangDialog.h" +#include + +#include +#include +#include +#include + +ScriptingLangDialog::ScriptingLangDialog(ScriptingEnv *env, ApplicationWindow *parent, Qt::WFlags fl ) +: QDialog(parent, fl), scripted(env) +{ + setCaption(tr("QtiPlot - Select scripting language")); + + langList = new QListWidget(this); + + btnOK = new QPushButton(tr("OK")); + btnCancel = new QPushButton(tr("Cancel")); + + QHBoxLayout *hbox1 = new QHBoxLayout(); + hbox1->addStretch(); + hbox1->addWidget(btnOK); + hbox1->addWidget(btnCancel); + + QVBoxLayout *vl = new QVBoxLayout(this); + vl->addWidget(langList); + vl->addLayout(hbox1); + + connect(btnOK, SIGNAL(clicked()), this, SLOT(accept())); + connect(btnCancel, SIGNAL(clicked()), this, SLOT(close())); + connect(langList, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(accept())); + + updateLangList(); +} + +void ScriptingLangDialog::updateLangList() +{ + langList->clear(); + langList->insertItems(0, ScriptingLangManager::languages()); + QListWidgetItem *current = langList->findItems(scriptEnv->name(), Qt::MatchExactly).first(); + if (current) + langList->setCurrentItem(current); +} + +void ScriptingLangDialog::accept() +{ + ApplicationWindow *app = (ApplicationWindow*) parent(); + if (app->setScriptingLanguage(langList->currentItem()->text())) + close(); + else + QMessageBox::critical(this, tr("QtiPlot - Scripting Error"), + tr("Scripting language \"%1\" failed to initialize.").arg(langList->currentItem()->text())); +} === removed file 'qtiplot/src/scripting/ScriptingLangDialog.cpp' --- qtiplot/src/scripting/ScriptingLangDialog.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/ScriptingLangDialog.cpp 1970-01-01 00:00:00 +0000 @@ -1,81 +0,0 @@ -/*************************************************************************** - File : ScriptingLangDialog.cpp - Project : QtiPlot --------------------------------------------------------------------- - Copyright : (C) 2006 by Knut Franke, Ion Vasilief - Email (use @ for *) : knut.franke*gmx.de, ion_vasilief*yahoo.fr - Description : Dialog for changing the current scripting - language - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "ScriptingLangDialog.h" -#include - -#include -#include -#include -#include - -ScriptingLangDialog::ScriptingLangDialog(ScriptingEnv *env, ApplicationWindow *parent, Qt::WFlags fl ) -: QDialog(parent, fl), scripted(env) -{ - setCaption(tr("QtiPlot - Select scripting language")); - - langList = new QListWidget(this); - - btnOK = new QPushButton(tr("OK")); - btnCancel = new QPushButton(tr("Cancel")); - - QHBoxLayout *hbox1 = new QHBoxLayout(); - hbox1->addStretch(); - hbox1->addWidget(btnOK); - hbox1->addWidget(btnCancel); - - QVBoxLayout *vl = new QVBoxLayout(this); - vl->addWidget(langList); - vl->addLayout(hbox1); - - connect(btnOK, SIGNAL(clicked()), this, SLOT(accept())); - connect(btnCancel, SIGNAL(clicked()), this, SLOT(close())); - connect(langList, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(accept())); - - updateLangList(); -} - -void ScriptingLangDialog::updateLangList() -{ - langList->clear(); - langList->insertItems(0, ScriptingLangManager::languages()); - QListWidgetItem *current = langList->findItems(scriptEnv->name(), Qt::MatchExactly).first(); - if (current) - langList->setCurrentItem(current); -} - -void ScriptingLangDialog::accept() -{ - ApplicationWindow *app = (ApplicationWindow*) parent(); - if (app->setScriptingLanguage(langList->currentItem()->text())) - close(); - else - QMessageBox::critical(this, tr("QtiPlot - Scripting Error"), - tr("Scripting language \"%1\" failed to initialize.").arg(langList->currentItem()->text())); -} === added file 'qtiplot/src/scripting/ScriptingLangDialog.h' --- qtiplot/src/scripting/ScriptingLangDialog.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/ScriptingLangDialog.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,59 @@ +/*************************************************************************** + File : ScriptingLangDialog.h + Project : QtiPlot +-------------------------------------------------------------------- + Copyright : (C) 2006 by Knut Franke, Ion Vasilief + Email (use @ for *) : knut.franke*gmx.de, ion_vasilief*yahoo.fr + Description : Dialog for changing the current scripting + language + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef SCRIPTING_LANG_DIALOG_H +#define SCRIPTING_LANG_DIALOG_H + +#include "ScriptingEnv.h" +#include "Script.h" + +#include + +class ApplicationWindow; +class QListWidget; +class QPushButton; + +class ScriptingLangDialog: public QDialog, public scripted +{ + Q_OBJECT + + public: + ScriptingLangDialog(ScriptingEnv *env, ApplicationWindow *parent, Qt::WFlags fl = 0); + + public slots: + void updateLangList(); + void accept(); + + private: + QListWidget *langList; + QPushButton *btnOK, *btnCancel; +}; + +#endif + === removed file 'qtiplot/src/scripting/ScriptingLangDialog.h' --- qtiplot/src/scripting/ScriptingLangDialog.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/ScriptingLangDialog.h 1970-01-01 00:00:00 +0000 @@ -1,59 +0,0 @@ -/*************************************************************************** - File : ScriptingLangDialog.h - Project : QtiPlot --------------------------------------------------------------------- - Copyright : (C) 2006 by Knut Franke, Ion Vasilief - Email (use @ for *) : knut.franke*gmx.de, ion_vasilief*yahoo.fr - Description : Dialog for changing the current scripting - language - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef SCRIPTING_LANG_DIALOG_H -#define SCRIPTING_LANG_DIALOG_H - -#include "ScriptingEnv.h" -#include "Script.h" - -#include - -class ApplicationWindow; -class QListWidget; -class QPushButton; - -class ScriptingLangDialog: public QDialog, public scripted -{ - Q_OBJECT - - public: - ScriptingLangDialog(ScriptingEnv *env, ApplicationWindow *parent, Qt::WFlags fl = 0); - - public slots: - void updateLangList(); - void accept(); - - private: - QListWidget *langList; - QPushButton *btnOK, *btnCancel; -}; - -#endif - === added file 'qtiplot/src/scripting/customevents.h' --- qtiplot/src/scripting/customevents.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/customevents.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,40 @@ +/*************************************************************************** + File : customevents.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de + Description : registry of custom event types + + Please use only event types defined here in order to avoid clashes. + The lowest event ID not used by Qt is QEvent::User. See documentation + of QEvent for details. + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + +#ifndef CUSTOM_EVENTS_H +#define CUSTOM_EVENTS_H + +#define SCRIPTING_CHANGE_EVENT QEvent::User + +#endif + === removed file 'qtiplot/src/scripting/customevents.h' --- qtiplot/src/scripting/customevents.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/customevents.h 1970-01-01 00:00:00 +0000 @@ -1,40 +0,0 @@ -/*************************************************************************** - File : customevents.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de - Description : registry of custom event types - - Please use only event types defined here in order to avoid clashes. - The lowest event ID not used by Qt is QEvent::User. See documentation - of QEvent for details. - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#ifndef CUSTOM_EVENTS_H -#define CUSTOM_EVENTS_H - -#define SCRIPTING_CHANGE_EVENT QEvent::User - -#endif - === added file 'qtiplot/src/scripting/muParserScript.cpp' --- qtiplot/src/scripting/muParserScript.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/muParserScript.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,504 @@ +/*************************************************************************** + File : muParserScript.cpp + Project : QtiPlot + -------------------------------------------------------------------- + + Copyright : (C) 2006 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de + Description : Evaluate mathematical expressions using muParser + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "muParserScript.h" +#include "muParserScripting.h" +#include +#include +#include + +#include +#include + +#include + +using namespace mu; + +muParserScript::muParserScript(ScriptingEnv *env, const QString &code, QObject *context, const QString &name) + : Script(env, code, context, name) +{ + variables.setAutoDelete(true); + rvariables.setAutoDelete(true); + + if (Context->isA("Table")) { + parser.DefineFun("col", mu_col, false); + parser.DefineFun("cell", mu_tableCell); + parser.DefineFun("tablecol", mu_tablecol, false); + parser.DefineFun("AVG", mu_avg, false); + parser.DefineFun("SUM", mu_sum, false); + } else if (Context->isA("Matrix")) + parser.DefineFun("cell", mu_cell); + + parser.addGSLConstants(); + rparser = parser; + if (Context->inherits("Table") || Context->isA("Matrix")){ + connect(this, SIGNAL(error(const QString&,const QString&,int)), env, SIGNAL(error(const QString&,const QString&,int))); + connect(this, SIGNAL(print(const QString&)), env, SIGNAL(print(const QString&))); + if (code.count("\n") > 0){//autodetect new variables only for scripts having minimum 2 lines + parser.SetVarFactory(mu_addVariable); + rparser.SetVarFactory(mu_addVariableR); + } + } else { + parser.SetVarFactory(mu_addVariable); + rparser.SetVarFactory(mu_addVariableR); + } +} + +double muParserScript::col(const QString &arg) +{ + if (!Context->isA("Table")) + throw Parser::exception_type(tr("col() works only on tables!").ascii()); + QStringList items; + QString item = ""; + + for (int i=0; i < arg.size(); i++) { + if (arg[i] == '"') { + item += "\""; + for (i++; i < arg.size() && arg[i] != '"'; i++) + if (arg[i] == '\\') { + item += "\\"; + item += arg[++i]; + } else + item += arg[i]; + item += "\""; + } else if (arg[i] == ',') { + items << item; + item = ""; + } else + item += arg[i]; + } + items << item; + + Table *table = (Table*) Context; + int col, row; + Parser local_parser(rparser); + if (items[0].startsWith("\"") && items[0].endsWith("\"")) { + col = table->colNames().findIndex(items[0].mid(1,items[0].length()-2)); + if (col<0) + throw Parser::exception_type(tr("There's no column named %1 in table %2!"). + arg(items[0]).arg(Context->name()).ascii()); + } else + col = items[0].toInt() - 1; //use column index + + if (items.count() == 2) + { + local_parser.SetExpr(items[1].ascii()); + row = qRound(local_parser.Eval()) - 1; + } else if (variables["i"]) + row = (int) *(variables["i"]) - 1; + else + return 0; + rvariables.clear(); + if (row < 0 || row >= table->numRows()) + throw Parser::exception_type(tr("There's no row %1 in table %2!"). + arg(row+1).arg(Context->name()).ascii()); + if (col < 0 || col >= table->numCols()) + throw Parser::exception_type(tr("There's no column %1 in table %2!"). + arg(col+1).arg(Context->name()).ascii()); + if (table->text(row, col).isEmpty()) + throw new EmptySourceError(); + else + return table->cell(row,col); +} + +double muParserScript::tablecol(const QString &arg) +{ + if (!Context->isA("Table")) + throw Parser::exception_type(tr("tablecol() works only on tables!").ascii()); + QStringList items; + QString item = ""; + for (int i=0; i < arg.size(); i++) { + if (arg[i] == '"') { + item += "\""; + for (i++; i < arg.size() && arg[i] != '"'; i++) + if (arg[i] == '\\') { + item += "\\"; + item += arg[++i]; + } else + item += arg[i]; + item += "\""; + } else if (arg[i] == ',') { + items << item; + item = ""; + } else + item += arg[i]; + } + items << item; + Table *this_table = (Table*) Context; + int col, row; + Parser local_parser(rparser); + if (items.count() != 2) + throw Parser::exception_type(tr("tablecol: wrong number of arguments (need 2, got %1)").arg(items.count()).ascii()); + if (!items[0].startsWith("\"") || !items[0].endsWith("\"")) + throw Parser::exception_type(tr("tablecol: first argument must be a string (table name)").ascii()); + Table *target_table = this_table->folder()->rootFolder()->table(items[0].mid(1,items[0].length()-2)); + if (!target_table) + throw Parser::exception_type(tr("Couldn't find a table named %1.").arg(items[0]).ascii()); + if (items[1].startsWith("\"") && items[1].endsWith("\"")) { + col = target_table->colNames().findIndex(items[1].mid(1,items[1].length()-2)); + if (col<0) + throw Parser::exception_type(tr("There's no column named %1 in table %2!"). + arg(items[1]).arg(target_table->name()).ascii()); + } else { + local_parser.SetExpr(items[1].ascii()); + col = qRound(local_parser.Eval()) - 1; + } + if (variables["i"]) + row = (int) *(variables["i"]) - 1; + else + row = -1; + rvariables.clear(); + if (row < 0 || row >= target_table->numRows()) + throw Parser::exception_type(tr("There's no row %1 in table %2!"). + arg(row+1).arg(target_table->name()).ascii()); + if (col < 0 || col >= target_table->numCols()) + throw Parser::exception_type(tr("There's no column %1 in table %2!"). + arg(col+1).arg(target_table->name()).ascii()); + if (target_table->text(row,col).isEmpty()) + throw new EmptySourceError(); + else + return target_table->cell(row,col); +} + +double muParserScript::cell(int row, int col) +{ + if (!Context->isA("Matrix")) + throw Parser::exception_type(tr("cell() works only on tables and matrices!").ascii()); + Matrix *matrix = (Matrix*) Context; + if (row < 1 || row > matrix->numRows()) + throw Parser::exception_type(tr("There's no row %1 in matrix %2!"). + arg(row).arg(Context->name()).ascii()); + if (col < 1 || col > matrix->numCols()) + throw Parser::exception_type(tr("There's no column %1 in matrix %2!"). + arg(col).arg(Context->name()).ascii()); + if (matrix->text(row - 1,col - 1).isEmpty()) + throw new EmptySourceError(); + else + return matrix->cell(row - 1, col - 1); +} + +double muParserScript::tableCell(int col, int row) +{ + if (!Context->isA("Table")) + throw Parser::exception_type(tr("cell() works only on tables and matrices!").ascii()); + Table *table = (Table*) Context; + if (row < 1 || row > table->numRows()) + throw Parser::exception_type(tr("There's no row %1 in table %2!"). + arg(row).arg(Context->name()).ascii()); + if (col < 1 || col > table->numCols()) + throw Parser::exception_type(tr("There's no column %1 in table %2!"). + arg(col).arg(Context->name()).ascii()); + if (table->text(row-1,col-1).isEmpty()) + throw new EmptySourceError(); + else + return table->cell(row-1,col-1); +} + +double *muParserScript::addVariable(const char *name) +{ + double *valptr = new double; + if (!valptr) + throw Parser::exception_type(tr("Out of memory").ascii()); + *valptr = 0; + variables.insert(name, valptr); + rparser.DefineVar(name, valptr); + return valptr; +} + +double *muParserScript::addVariableR(const char *name) +{ + double *valptr = new double; + if (!valptr) + throw Parser::exception_type(tr("Out of memory").ascii()); + *valptr = 0; + rvariables.insert(name, valptr); + return valptr; +} + +double* muParserScript::defineVariable(const char *name, double val) +{ + double *valptr = variables[name]; + if (!valptr) + { + valptr = new double; + if (!valptr) + { + emit_error(tr("Out of memory"), 0); + return 0; + } + try { + parser.DefineVar(name, valptr); + rparser.DefineVar(name, valptr); + variables.insert(name, valptr); + } catch (mu::ParserError &e) { + delete valptr; + emit_error(QString(e.GetMsg().c_str()), 0); + return valptr; + } + } + *valptr = val; + return valptr; +} + +bool muParserScript::setDouble(double val, const char *name) +{ + double *valptr = variables[name]; + if (!valptr) + { + valptr = new double; + if (!valptr) + { + emit_error(tr("Out of memory"),0); + return false; + } + try { + parser.DefineVar(name, valptr); + rparser.DefineVar(name, valptr); + variables.insert(name, valptr); + } catch (mu::ParserError &e) { + delete valptr; + emit_error(QString(e.GetMsg().c_str()), 0); + return false; + } + } + *valptr = val; + return true; +} + +bool muParserScript::setInt(int val, const char *name) +{ + return setDouble((double) val, name); +} + +bool muParserScript::setQObject(QObject*, const char*) +{ + return false; +} + +QString muParserScript::compileColArg(const QString &in) +{ + QString out = "\""; + for (int i=0; i < in.size(); i++) + if (in[i] == 'c' && in.mid(i,4)=="col(") { + out += "col("; + QString arg = ""; + int paren = 1; + for (i+=4; i < in.size() && paren > 0; i++) + if (in[i] == '"') { + arg += "\""; + for (i++; i < in.size() && in[i] != '"'; i++) + if (in[i] == '\\') { + arg += "\\"; + arg += in[++i]; + } else + arg += in[i]; + arg += "\""; + } else if (in[i] == '(') { + paren++; + arg += "("; + } else if (in[i] == ')') { + paren--; + if(paren>0) arg += ")"; + } + else + arg += in[i]; + out += compileColArg(arg).replace('"',"\\\""); + out += ")"; + i--; + } + else if (in[i] == '\\') + out += "\\\\"; + else if (in[i] == '"') + out += "\\\""; + else + out += in[i]; + return out + "\""; +} + +bool muParserScript::compile(bool) +{ + muCode.clear(); + QString muCodeLine = ""; + for (int i=0; i < Code.size(); i++){ + if (Code[i] == 'c' && Code.mid(i,4)=="col(") { + muCodeLine += "col("; + QString arg = ""; + int paren = 1; + for (i+=4; i < Code.size() && paren > 0; i++) + if (Code[i] == '"') { + arg += "\""; + for (i++; Code[i] != '"' && i < Code.size(); i++) + if (Code[i] == '\\') { + arg += "\\"; + arg += Code[++i]; + } else + arg += Code[i]; + arg += "\""; + } else if (Code[i] == '(') { + paren++; + arg += "("; + } else if (Code[i] == ')') { + paren--; + if(paren>0) arg += ")"; + } + else + arg += Code[i]; + muCodeLine += compileColArg(arg); + muCodeLine += ")"; + i--; + } else if (Code[i] == '#') + for (i++; Code[i] != '\n' && i < Code.size(); i++) ; + else if (Code[i] == '\n') { + muCodeLine = muCodeLine.stripWhiteSpace(); + if (!muCodeLine.isEmpty()) + muCode += muCodeLine; + muCodeLine = ""; + } else + muCodeLine += Code[i]; + } + + muCodeLine = muCodeLine.stripWhiteSpace(); + if (!muCodeLine.isEmpty()) + muCode += muCodeLine; + compiled = Script::isCompiled; + + if (muCode.size() == 1){ + current = this; + parser.SetExpr(muCode[0].ascii()); + + try { + parser.Eval(); + } catch (EmptySourceError *e) { + QApplication::restoreOverrideCursor(); + return false; + } catch (mu::ParserError &e) { + if (e.GetCode() != ecVAL_EXPECTED){ + QApplication::restoreOverrideCursor(); + emit_error(e.GetMsg().c_str(), 0); + return false; + } + } + } + return true; +} + +QString muParserScript::evalSingleLineToString(const QLocale& locale, char f, int prec) +{ + double val = 0.0; + try { + val = parser.Eval(); + } catch (EmptySourceError *e) { + return ""; + } catch (ParserError &e) { + return ""; + } + return locale.toString(val, f, prec); +} + +double muParserScript::evalSingleLine() +{ + double val = 0.0; + try { + val = parser.Eval(); + } catch (EmptySourceError *e) { + return GSL_NAN; + } catch (ParserError &e) { + return GSL_NAN; + } + return val; +} + +muParserScript *muParserScript::current = NULL; + +QVariant muParserScript::eval() +{ + if (compiled != Script::isCompiled && !compile()) + return QVariant(); + double val = 0.0; + try { + current = this; + for (QStringList::iterator i=muCode.begin(); i != muCode.end(); i++) { + parser.SetExpr(i->ascii()); + val = parser.Eval(); + } + } catch (EmptySourceError *e) { + return QVariant(""); + } catch (ParserError &e) { + emit_error(e.GetMsg().c_str(), 0); + return QVariant(); + } + return QVariant(val); +} + +bool muParserScript::exec() +{ + if (compiled != Script::isCompiled && !compile()) + return false; + try { + current = this; + for (QStringList::iterator i=muCode.begin(); i != muCode.end(); i++) { + parser.SetExpr(i->ascii()); + parser.Eval(); + } + } catch (EmptySourceError *e) { + return true; + } catch (mu::ParserError &e) { + emit_error(e.GetMsg().c_str(), 0); + return false; + } + return true; +} + +double muParserScript::sum(const QString &arg, int start, int end) +{ + if (!Context->isA("Table")) + throw Parser::exception_type(tr("SUM() works only on tables!").ascii()); + + Table *table = (Table*) Context; + int col = table->colNames().findIndex(arg); + if (col < 0) + throw Parser::exception_type(tr("There's no column named %1 in table %2!").arg(arg).arg(Context->name()).ascii()); + + rvariables.clear(); + return table->sum(col, start, end); +} + +double muParserScript::avg(const QString &arg, int start, int end) +{ + if (!Context->isA("Table")) + throw Parser::exception_type(tr("AVG() works only on tables!").ascii()); + + Table *table = (Table*) Context; + int col = table->colNames().findIndex(arg); + if (col < 0) + throw Parser::exception_type(tr("There's no column named %1 in table %2!").arg(arg).arg(Context->name()).ascii()); + + rvariables.clear(); + return table->avg(col, start, end); +} === removed file 'qtiplot/src/scripting/muParserScript.cpp' --- qtiplot/src/scripting/muParserScript.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/muParserScript.cpp 1970-01-01 00:00:00 +0000 @@ -1,478 +0,0 @@ -/*************************************************************************** - File : muParserScript.cpp - Project : QtiPlot - -------------------------------------------------------------------- - - Copyright : (C) 2006 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de - Description : Evaluate mathematical expressions using muParser - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "muParserScript.h" -#include "muParserScripting.h" -#include -#include -#include - -#include -#include - -#include - -using namespace mu; - -muParserScript::muParserScript(ScriptingEnv *env, const QString &code, QObject *context, const QString &name) - : Script(env, code, context, name) -{ - variables.setAutoDelete(true); - rvariables.setAutoDelete(true); - - if (Context->isA("Table")) { - parser.DefineFun("col", mu_col, false); - parser.DefineFun("cell", mu_tableCell); - parser.DefineFun("tablecol", mu_tablecol, false); - } else if (Context->isA("Matrix")) - parser.DefineFun("cell", mu_cell); - - rparser = parser; - if (Context->inherits("Table") || Context->isA("Matrix")){ - connect(this, SIGNAL(error(const QString&,const QString&,int)), env, SIGNAL(error(const QString&,const QString&,int))); - connect(this, SIGNAL(print(const QString&)), env, SIGNAL(print(const QString&))); - if (code.count("\n") > 0){//autodetect new variables only for scripts having minimum 2 lines - parser.SetVarFactory(mu_addVariable); - rparser.SetVarFactory(mu_addVariableR); - } - } else { - parser.SetVarFactory(mu_addVariable); - rparser.SetVarFactory(mu_addVariableR); - } -} - -double muParserScript::col(const QString &arg) -{ - if (!Context->isA("Table")) - throw Parser::exception_type(tr("col() works only on tables!").ascii()); - QStringList items; - QString item = ""; - - for (int i=0; i < arg.size(); i++) { - if (arg[i] == '"') { - item += "\""; - for (i++; i < arg.size() && arg[i] != '"'; i++) - if (arg[i] == '\\') { - item += "\\"; - item += arg[++i]; - } else - item += arg[i]; - item += "\""; - } else if (arg[i] == ',') { - items << item; - item = ""; - } else - item += arg[i]; - } - items << item; - - Table *table = (Table*) Context; - int col, row; - Parser local_parser(rparser); - if (items[0].startsWith("\"") && items[0].endsWith("\"")) { - col = table->colNames().findIndex(items[0].mid(1,items[0].length()-2)); - if (col<0) - throw Parser::exception_type(tr("There's no column named %1 in table %2!"). - arg(items[0]).arg(Context->name()).ascii()); - } else {// for backwards compatibility - col = table->colNames().findIndex(items[0]); - if (col<0) { - local_parser.SetExpr(items[0].ascii()); - col = qRound(local_parser.Eval()) - 1; - } - } - - if (items.count() == 2) - { - local_parser.SetExpr(items[1].ascii()); - row = qRound(local_parser.Eval()) - 1; - } else if (variables["i"]) - row = (int) *(variables["i"]) - 1; - else - return 0; - rvariables.clear(); - if (row < 0 || row >= table->numRows()) - throw Parser::exception_type(tr("There's no row %1 in table %2!"). - arg(row+1).arg(Context->name()).ascii()); - if (col < 0 || col >= table->numCols()) - throw Parser::exception_type(tr("There's no column %1 in table %2!"). - arg(col+1).arg(Context->name()).ascii()); - if (table->text(row, col).isEmpty()) - throw new EmptySourceError(); - else - return table->cell(row,col); -} - -double muParserScript::tablecol(const QString &arg) -{ - if (!Context->isA("Table")) - throw Parser::exception_type(tr("tablecol() works only on tables!").ascii()); - QStringList items; - QString item = ""; - for (int i=0; i < arg.size(); i++) { - if (arg[i] == '"') { - item += "\""; - for (i++; i < arg.size() && arg[i] != '"'; i++) - if (arg[i] == '\\') { - item += "\\"; - item += arg[++i]; - } else - item += arg[i]; - item += "\""; - } else if (arg[i] == ',') { - items << item; - item = ""; - } else - item += arg[i]; - } - items << item; - Table *this_table = (Table*) Context; - int col, row; - Parser local_parser(rparser); - if (items.count() != 2) - throw Parser::exception_type(tr("tablecol: wrong number of arguments (need 2, got %1)").arg(items.count()).ascii()); - if (!items[0].startsWith("\"") || !items[0].endsWith("\"")) - throw Parser::exception_type(tr("tablecol: first argument must be a string (table name)").ascii()); - Table *target_table = this_table->folder()->rootFolder()->table(items[0].mid(1,items[0].length()-2)); - if (!target_table) - throw Parser::exception_type(tr("Couldn't find a table named %1.").arg(items[0]).ascii()); - if (items[1].startsWith("\"") && items[1].endsWith("\"")) { - col = target_table->colNames().findIndex(items[1].mid(1,items[1].length()-2)); - if (col<0) - throw Parser::exception_type(tr("There's no column named %1 in table %2!"). - arg(items[1]).arg(target_table->name()).ascii()); - } else { - local_parser.SetExpr(items[1].ascii()); - col = qRound(local_parser.Eval()) - 1; - } - if (variables["i"]) - row = (int) *(variables["i"]) - 1; - else - row = -1; - rvariables.clear(); - if (row < 0 || row >= target_table->numRows()) - throw Parser::exception_type(tr("There's no row %1 in table %2!"). - arg(row+1).arg(target_table->name()).ascii()); - if (col < 0 || col >= target_table->numCols()) - throw Parser::exception_type(tr("There's no column %1 in table %2!"). - arg(col+1).arg(target_table->name()).ascii()); - if (target_table->text(row,col).isEmpty()) - throw new EmptySourceError(); - else - return target_table->cell(row,col); -} - -double muParserScript::cell(int row, int col) -{ - if (!Context->isA("Matrix")) - throw Parser::exception_type(tr("cell() works only on tables and matrices!").ascii()); - Matrix *matrix = (Matrix*) Context; - if (row < 1 || row > matrix->numRows()) - throw Parser::exception_type(tr("There's no row %1 in matrix %2!"). - arg(row).arg(Context->name()).ascii()); - if (col < 1 || col > matrix->numCols()) - throw Parser::exception_type(tr("There's no column %1 in matrix %2!"). - arg(col).arg(Context->name()).ascii()); - if (matrix->text(row - 1,col - 1).isEmpty()) - throw new EmptySourceError(); - else - return matrix->cell(row - 1, col - 1); -} - -double muParserScript::tableCell(int col, int row) -{ - if (!Context->isA("Table")) - throw Parser::exception_type(tr("cell() works only on tables and matrices!").ascii()); - Table *table = (Table*) Context; - if (row < 1 || row > table->numRows()) - throw Parser::exception_type(tr("There's no row %1 in table %2!"). - arg(row).arg(Context->name()).ascii()); - if (col < 1 || col > table->numCols()) - throw Parser::exception_type(tr("There's no column %1 in table %2!"). - arg(col).arg(Context->name()).ascii()); - if (table->text(row-1,col-1).isEmpty()) - throw new EmptySourceError(); - else - return table->cell(row-1,col-1); -} - -double *muParserScript::addVariable(const char *name) -{ - double *valptr = new double; - if (!valptr) - throw Parser::exception_type(tr("Out of memory").ascii()); - *valptr = 0; - variables.insert(name, valptr); - rparser.DefineVar(name, valptr); - return valptr; -} - -double *muParserScript::addVariableR(const char *name) -{ - double *valptr = new double; - if (!valptr) - throw Parser::exception_type(tr("Out of memory").ascii()); - *valptr = 0; - rvariables.insert(name, valptr); - return valptr; -} - -double* muParserScript::defineVariable(const char *name, double val) -{ - double *valptr = variables[name]; - if (!valptr) - { - valptr = new double; - if (!valptr) - { - emit_error(tr("Out of memory"), 0); - return 0; - } - try { - parser.DefineVar(name, valptr); - rparser.DefineVar(name, valptr); - variables.insert(name, valptr); - } catch (mu::ParserError &e) { - delete valptr; - emit_error(QString(e.GetMsg().c_str()), 0); - return valptr; - } - } - *valptr = val; - return valptr; -} - -bool muParserScript::setDouble(double val, const char *name) -{ - double *valptr = variables[name]; - if (!valptr) - { - valptr = new double; - if (!valptr) - { - emit_error(tr("Out of memory"),0); - return false; - } - try { - parser.DefineVar(name, valptr); - rparser.DefineVar(name, valptr); - variables.insert(name, valptr); - } catch (mu::ParserError &e) { - delete valptr; - emit_error(QString(e.GetMsg().c_str()), 0); - return false; - } - } - *valptr = val; - return true; -} - -bool muParserScript::setInt(int val, const char *name) -{ - return setDouble((double) val, name); -} - -bool muParserScript::setQObject(QObject*, const char*) -{ - return false; -} - -QString muParserScript::compileColArg(const QString &in) -{ - QString out = "\""; - for (int i=0; i < in.size(); i++) - if (in[i] == 'c' && in.mid(i,4)=="col(") { - out += "col("; - QString arg = ""; - int paren = 1; - for (i+=4; i < in.size() && paren > 0; i++) - if (in[i] == '"') { - arg += "\""; - for (i++; i < in.size() && in[i] != '"'; i++) - if (in[i] == '\\') { - arg += "\\"; - arg += in[++i]; - } else - arg += in[i]; - arg += "\""; - } else if (in[i] == '(') { - paren++; - arg += "("; - } else if (in[i] == ')') { - paren--; - if(paren>0) arg += ")"; - } - else - arg += in[i]; - out += compileColArg(arg).replace('"',"\\\""); - out += ")"; - i--; - } - else if (in[i] == '\\') - out += "\\\\"; - else if (in[i] == '"') - out += "\\\""; - else - out += in[i]; - return out + "\""; -} - -bool muParserScript::compile(bool) -{ - muCode.clear(); - QString muCodeLine = ""; - for (int i=0; i < Code.size(); i++){ - if (Code[i] == 'c' && Code.mid(i,4)=="col(") { - muCodeLine += "col("; - QString arg = ""; - int paren = 1; - for (i+=4; i < Code.size() && paren > 0; i++) - if (Code[i] == '"') { - arg += "\""; - for (i++; Code[i] != '"' && i < Code.size(); i++) - if (Code[i] == '\\') { - arg += "\\"; - arg += Code[++i]; - } else - arg += Code[i]; - arg += "\""; - } else if (Code[i] == '(') { - paren++; - arg += "("; - } else if (Code[i] == ')') { - paren--; - if(paren>0) arg += ")"; - } - else - arg += Code[i]; - muCodeLine += compileColArg(arg); - muCodeLine += ")"; - i--; - } else if (Code[i] == '#') - for (i++; Code[i] != '\n' && i < Code.size(); i++); - else if (Code[i] == '\n') { - muCodeLine = muCodeLine.stripWhiteSpace(); - if (!muCodeLine.isEmpty()) - muCode += muCodeLine; - muCodeLine = ""; - } else - muCodeLine += Code[i]; - } - - muCodeLine = muCodeLine.stripWhiteSpace(); - if (!muCodeLine.isEmpty()) - muCode += muCodeLine; - compiled = Script::isCompiled; - - if (muCode.size() == 1){ - current = this; - parser.SetExpr(muCode[0].ascii()); - - try { - parser.Eval(); - } catch (EmptySourceError *e) { - QApplication::restoreOverrideCursor(); - return false; - } catch (mu::ParserError &e) { - if (e.GetCode() != ecVAL_EXPECTED){ - QApplication::restoreOverrideCursor(); - emit_error(e.GetMsg().c_str(), 0); - return false; - } - } - } - return true; -} - -QString muParserScript::evalSingleLineToString(const QLocale& locale, char f, int prec) -{ - double val = 0.0; - try { - val = parser.Eval(); - } catch (EmptySourceError *e) { - return ""; - } catch (ParserError &e) { - return ""; - } - return locale.toString(val, f, prec); -} - -double muParserScript::evalSingleLine() -{ - double val = 0.0; - try { - val = parser.Eval(); - } catch (EmptySourceError *e) { - return GSL_NAN; - } catch (ParserError &e) { - return GSL_NAN; - } - return val; -} - -muParserScript *muParserScript::current = NULL; - -QVariant muParserScript::eval() -{ - if (compiled != Script::isCompiled && !compile()) - return QVariant(); - double val = 0.0; - try { - current = this; - for (QStringList::iterator i=muCode.begin(); i != muCode.end(); i++) { - parser.SetExpr(i->ascii()); - val = parser.Eval(); - } - } catch (EmptySourceError *e) { - return QVariant(""); - } catch (ParserError &e) { - emit_error(e.GetMsg().c_str(), 0); - return QVariant(); - } - return QVariant(val); -} - -bool muParserScript::exec() -{ - if (compiled != Script::isCompiled && !compile()) - return false; - try { - current = this; - for (QStringList::iterator i=muCode.begin(); i != muCode.end(); i++) { - parser.SetExpr(i->ascii()); - parser.Eval(); - } - } catch (EmptySourceError *e) { - return true; - } catch (mu::ParserError &e) { - emit_error(e.GetMsg().c_str(), 0); - return false; - } - return true; -} === added file 'qtiplot/src/scripting/muParserScript.h' --- qtiplot/src/scripting/muParserScript.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/muParserScript.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,89 @@ +/*************************************************************************** + File : muParserScript.h + Project : QtiPlot + -------------------------------------------------------------------- + + Copyright : (C) 2006 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de + Description : Evaluate mathematical expressions using muParser + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef MUPARSER_SCRIPT_H +#define MUPARSER_SCRIPT_H + +#include "ScriptingEnv.h" +#include "Script.h" + +#include +#include "math.h" +#include +#include + +//! TODO +class muParserScript: public Script +{ + Q_OBJECT + + public: + muParserScript(ScriptingEnv *env, const QString &code, QObject *context=0, const QString &name=""); + + public slots: + bool compile(bool asFunction=true); + QVariant eval(); + double evalSingleLine(); + QString evalSingleLineToString(const QLocale& locale, char f, int prec); + bool exec(); + bool setQObject(QObject *val, const char *name); + bool setInt(int val, const char* name); + bool setDouble(double val, const char* name); + double* defineVariable(const char *name, double val = 0.0); + int codeLines(){return muCode.size();}; + + private: + double avg(const QString &arg, int start = 0, int end = -1); + double sum(const QString &arg, int start = 0, int end = -1); + double col(const QString &arg); + double tablecol(const QString &arg); + double cell(int row, int col); + double tableCell(int col, int row); + double *addVariable(const char *name); + double *addVariableR(const char *name); + static double *mu_addVariableR(const char *name) { return current->addVariableR(name); } + static double mu_avg(const char *arg, double start = 1, double end = -1) {return current->avg(arg, qRound(start - 1), qRound(end - 1));} + static double mu_sum(const char *arg, double start = 1, double end = -1) {return current->sum(arg, qRound(start - 1), qRound(end - 1));} + static double mu_col(const char *arg) { return current->col(arg); } + static double mu_cell(double row, double col) { return current->cell(qRound(row), qRound(col)); } + static double mu_tableCell(double col, double row) { return current->tableCell(qRound(col), qRound(row)); } + static double mu_tablecol(const char *arg) { return current->tablecol(arg); } + static double *mu_addVariable(const char *name, void *){ return current->addVariable(name); } + static double *mu_addVariableR(const char *name, void *) { return current->addVariableR(name); } + static QString compileColArg(const QString& in); + + MyParser parser, rparser; + Q3AsciiDict variables, rvariables; + QStringList muCode; + + public: + static muParserScript *current; +}; + +#endif === removed file 'qtiplot/src/scripting/muParserScript.h' --- qtiplot/src/scripting/muParserScript.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/muParserScript.h 1970-01-01 00:00:00 +0000 @@ -1,85 +0,0 @@ -/*************************************************************************** - File : muParserScript.h - Project : QtiPlot - -------------------------------------------------------------------- - - Copyright : (C) 2006 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de - Description : Evaluate mathematical expressions using muParser - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef MUPARSER_SCRIPT_H -#define MUPARSER_SCRIPT_H - -#include "ScriptingEnv.h" -#include "Script.h" - -#include -#include "math.h" -#include -#include - -//! TODO -class muParserScript: public Script -{ - Q_OBJECT - - public: - muParserScript(ScriptingEnv *env, const QString &code, QObject *context=0, const QString &name=""); - - public slots: - bool compile(bool asFunction=true); - QVariant eval(); - double evalSingleLine(); - QString evalSingleLineToString(const QLocale& locale, char f, int prec); - bool exec(); - bool setQObject(QObject *val, const char *name); - bool setInt(int val, const char* name); - bool setDouble(double val, const char* name); - double* defineVariable(const char *name, double val = 0.0); - int codeLines(){return muCode.size();}; - - private: - double col(const QString &arg); - double tablecol(const QString &arg); - double cell(int row, int col); - double tableCell(int col, int row); - double *addVariable(const char *name); - double *addVariableR(const char *name); - static double *mu_addVariableR(const char *name) { return current->addVariableR(name); } - static double mu_col(const char *arg) { return current->col(arg); } - static double mu_cell(double row, double col) { return current->cell(qRound(row), qRound(col)); } - static double mu_tableCell(double col, double row) { return current->tableCell(qRound(col), qRound(row)); } - static double mu_tablecol(const char *arg) { return current->tablecol(arg); } - static double *mu_addVariable(const char *name, void *){ return current->addVariable(name); } - static double *mu_addVariableR(const char *name, void *) { return current->addVariableR(name); } - static QString compileColArg(const QString& in); - - MyParser parser, rparser; - Q3AsciiDict variables, rvariables; - QStringList muCode; - - public: - static muParserScript *current; -}; - -#endif === added file 'qtiplot/src/scripting/muParserScripting.cpp' --- qtiplot/src/scripting/muParserScripting.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/muParserScripting.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,137 @@ +/*************************************************************************** + File : muParserScripting.cpp + Project : QtiPlot + -------------------------------------------------------------------- + + Copyright : (C) 2006 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de + Description : Evaluate mathematical expression using muParser + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "muParserScript.h" +#include "muParserScripting.h" + +#include +#include + +using namespace mu; + +const char* muParserScripting::langName = "muParser"; + +const muParserScripting::mathFunction muParserScripting::math_functions[] = { + { "abs", 1, NULL,NULL,NULL, QObject::tr("abs(x):\n Absolute value of x.") }, + { "acos", 1, NULL,NULL,NULL, QObject::tr("acos(x):\n Inverse cos function.") }, + { "acosh", 1, NULL,NULL,NULL, QObject::tr("acosh(x):\n Hyperbolic inverse cos function.") }, + { "asin", 1, NULL,NULL,NULL, QObject::tr("asin(x):\n Inverse sin function.") }, + { "asinh", 1, NULL,NULL,NULL, QObject::tr("asinh(x):\n Hyperbolic inverse sin function.") }, + { "atan", 1, NULL,NULL,NULL, QObject::tr("atan(x):\n Inverse tan function.") }, + { "atanh", 1, NULL,NULL,NULL, QObject::tr("atanh(x):\n Hyperbolic inverse tan function.") }, + { "avg", -1, NULL,NULL,NULL, QObject::tr("avg(x,y,...):\n Mean value of all arguments.") }, + { "bessel_j0", 1, bessel_J0,NULL,NULL, QObject::tr("bessel_j0(x):\n Regular cylindrical Bessel function of zeroth order, J_0(x).") }, + { "bessel_j1", 1, bessel_J1,NULL,NULL, QObject::tr("bessel_j1(x):\n Regular cylindrical Bessel function of first order, J_1(x).") }, + { "bessel_jn", 2, NULL,bessel_Jn,NULL, QObject::tr("bessel_jn(double x, int n):\n Regular cylindrical Bessel function of order n, J_n(x).") }, + { "bessel_jn_zero", 2, NULL,bessel_Jn_zero,NULL, QObject::tr("bessel_jn_zero(double n, unsigned int s):\n s-th positive zero x_s of regular cylindrical Bessel function of order n, J_n(x_s)=0") }, + { "bessel_y0", 1, bessel_Y0, NULL,NULL, QObject::tr("bessel_y0(x):\n Irregular cylindrical Bessel function of zeroth order, Y_0(x), for x>0.") }, + { "bessel_y1", 1, bessel_Y1, NULL,NULL, QObject::tr("bessel_y1(x):\n Irregular cylindrical Bessel function of first order, Y_1(x), for x>0.") }, + { "bessel_yn", 2, NULL,bessel_Yn,NULL, QObject::tr("bessel_yn(double x, int n):\n Irregular cylindrical Bessel function of order n, Y_n(x), for x>0.") }, + { "beta", 2, NULL,beta,NULL, QObject::tr("beta(a,b):\n Computes the Beta Function, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) for a > 0, b > 0.") }, + { "ceil", 1, ceil,NULL,NULL, QObject::tr("ceil(x):\n Round to the next larger integer,\n smallest integer larger or equal to x.") }, + { "cos", 1, NULL,NULL,NULL, QObject::tr("cos(x):\n Calculate cosine.") }, + { "cosh", 1, NULL,NULL,NULL, QObject::tr("cosh(x):\n Hyperbolic cos function.") }, + { "erf", 1, erf, NULL,NULL, QObject::tr("erf(x):\n The error function.") }, + { "erfc", 1, erfc, NULL,NULL, QObject::tr("erfc(x):\n Complementary error function erfc(x) = 1 - erf(x).") }, + { "erfz", 1, erf_Z, NULL,NULL, QObject::tr("erfz(x):\n The Gaussian probability density function Z(x).") }, + { "erfq", 1, erf_Q, NULL,NULL, QObject::tr("erfq(x):\n The upper tail of the Gaussian probability function Q(x).") }, + { "exp", 1, NULL,NULL,NULL, QObject::tr("exp(x):\n Exponential function: e raised to the power of x.") }, + { "floor", 1, floor,NULL,NULL, QObject::tr("floor(x):\n Round to the next smaller integer,\n largest integer smaller or equal to x.") }, + { "gamma", 1, gamma, NULL,NULL, QObject::tr("gamma(x):\n Computes the Gamma function, subject to x not being a negative integer.") }, + { "gammaln", 1, lngamma,NULL,NULL, QObject::tr("gammaln(x):\n Computes the logarithm of the Gamma function, subject to x not a being negative integer. For x<0, log(|Gamma(x)|) is returned.") }, + { "gauss_cdf", 2, NULL, gauss_cdf, NULL, QObject::tr("gauss_cdf(x, sigma):\n Computes the cumulative distribution function for a Gaussian distribution with standard deviation sigma.") }, + { "gauss_pdf", 2, NULL, gauss_pdf, NULL, QObject::tr("gauss_pdf(x, sigma):\n Computes the probability density at x for a Gaussian distribution with standard deviation sigma.") }, + { "hazard", 1, hazard,NULL,NULL, QObject::tr("hazard(x):\n Computes the hazard function for the normal distribution h(x) = erfz(x)/erfq(x).") }, + { "if", 3, NULL,NULL,NULL, QObject::tr("if(e1, e2, e3):\n if e1 then e2 else e3.") }, + { "inv_gauss_cdf", 2, NULL, inv_gauss_cdf, NULL, QObject::tr("inv_gauss_cdf(x, sigma):\n Computes the inverse of the cumulative distribution function for a Gaussian distribution with standard deviation sigma.") }, + { "ln", 1, NULL,NULL,NULL, QObject::tr("ln(x):\n Calculate natural logarithm log_e.") }, + { "log", 1, NULL,NULL,NULL, QObject::tr("log(x):\n Calculate decimal logarithm log_10.") }, + { "log10", 1, NULL,NULL,NULL, QObject::tr("log10(x):\n Calculate decimal logarithm log_10.") }, + { "log2", 1, NULL,NULL,NULL, QObject::tr("log2(x):\n Calculate binary logarithm log_2.") }, + { "min", -1, NULL,NULL,NULL, QObject::tr("min(x,y,...):\n Calculate minimum of all arguments.") }, + { "max", -1, NULL,NULL,NULL, QObject::tr("max(x,y,...):\n Calculate maximum of all arguments.") }, + { "mod", 2, NULL,mod,NULL, QObject::tr("mod(x,y):\n Calculate rest of integer division x/y,\n x modulo y.") }, + { "pow", 2, NULL,pow,NULL, QObject::tr("pow(x,y):\n Raise x to the power of y, x^y.") }, + { "rint", 1, NULL,NULL,NULL, QObject::tr("rint(x):\n Round to nearest integer.") }, + { "rnd", 1,rnd,NULL,NULL, QObject::tr("rnd(seed):\n Returns a pseudo-random number in the range 0 to 1. Calling this function several times with the same seed will return the same value.") }, + { "sign", 1, NULL,NULL,NULL, QObject::tr("sign(x):\n Sign function: -1 if x<0; 1 if x>0.") }, + { "sin", 1, NULL,NULL,NULL, QObject::tr("sin(x):\n Calculate sine.") }, + { "sinh", 1, NULL,NULL,NULL, QObject::tr("sinh(x):\n Hyperbolic sin function.") }, + { "sqrt", 1, NULL,NULL,NULL, QObject::tr("sqrt(x):\n Square root function.") }, + { "sum", -1, NULL,NULL,NULL, QObject::tr("sum(x,y,...):\n Calculate sum of all arguments.") }, + { "tan", 1, NULL,NULL,NULL, QObject::tr("tan(x):\n Calculate tangent function.") }, + { "tanh", 1, NULL,NULL,NULL, QObject::tr("tanh(x):\n Hyperbolic tan function.") }, + { "ttable", 2, NULL,ttable,NULL, QObject::tr("ttable(x, n):\n Student's t-distribution with n degrees of freedom.") }, + { "w0", 1, lambert_W0, NULL, NULL, QObject::tr("w0(x):\n Compute the principal branch of Lambert's W function, W_0(x).\n W is defined as a solution to the equation W(x)*exp(W(x))=x.\n For x<0, there are two real-valued branches; this function computes the one where W>-1 for x<0 (also see wm1(x)).") }, + { "wm1", 1, lambert_Wm1, NULL, NULL, QObject::tr("wm1(x):\n Compute the secondary branch of Lambert's W function, W_{-1}(x).\n W is defined as a solution to the equation W(x)*exp(W(x))=x.\n For x<0, there are two real-valued branches; this function computes the one where W<-1 for x<0. (also see w0(x)).") }, + {0,0,NULL,NULL,NULL,0} +}; + +const QStringList muParserScripting::mathFunctions() const +{ + return functionsList(); +} + +const QString muParserScripting::mathFunctionDoc (const QString &name) const +{ + return explainFunction(name); +} + +const QStringList muParserScripting::functionsList(bool tableContext) +{ + QStringList l; + if (tableContext){ + l << "AVG"; + l << "SUM"; + } + + for (const mathFunction *i = math_functions; i->name; i++) + l << i->name; + + return l; +} + +const QString muParserScripting::explainFunction(const QString &name) +{ + if (name == "AVG") + return QObject::tr("AVG(\"colName\", i, j):\n The average of all cells from row i to j in column colName."); + if (name == "SUM") + return QObject::tr("SUM(\"colName\", i, j):\n The sum of all cells from row i to j in column colName."); + + for (const mathFunction *i = math_functions; i->name; i++){ + if (name == i->name){ + QString s = QObject::tr(i->description); + if (QLocale().decimalPoint() == ',') + s.replace(",", ";"); + + return s; + } + } + return QString::null; +} === removed file 'qtiplot/src/scripting/muParserScripting.cpp' --- qtiplot/src/scripting/muParserScripting.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/muParserScripting.cpp 1970-01-01 00:00:00 +0000 @@ -1,108 +0,0 @@ -/*************************************************************************** - File : muParserScripting.cpp - Project : QtiPlot - -------------------------------------------------------------------- - - Copyright : (C) 2006 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de - Description : Evaluate mathematical expression using muParser - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "muParserScript.h" -#include "muParserScripting.h" - -#include - -using namespace mu; - -const char* muParserScripting::langName = "muParser"; - -const muParserScripting::mathFunction muParserScripting::math_functions[] = { - { "abs", 1, NULL,NULL,NULL, QObject::tr("abs(x):\n Absolute value of x.") }, - { "acos", 1, NULL,NULL,NULL, QObject::tr("acos(x):\n Inverse cos function.") }, - { "acosh", 1, NULL,NULL,NULL, QObject::tr("acosh(x):\n Hyperbolic inverse cos function.") }, - { "asin", 1, NULL,NULL,NULL, QObject::tr("asin(x):\n Inverse sin function.") }, - { "asinh", 1, NULL,NULL,NULL, QObject::tr("asinh(x):\n Hyperbolic inverse sin function.") }, - { "atan", 1, NULL,NULL,NULL, QObject::tr("atan(x):\n Inverse tan function.") }, - { "atanh", 1, NULL,NULL,NULL, QObject::tr("atanh(x):\n Hyperbolic inverse tan function.") }, - { "avg", -1, NULL,NULL,NULL, QObject::tr("avg(x,y,...):\n Mean value of all arguments.") }, - { "bessel_j0", 1, bessel_J0,NULL,NULL, QObject::tr("bessel_j0(x):\n Regular cylindrical Bessel function of zeroth order, J_0(x).") }, - { "bessel_j1", 1, bessel_J1,NULL,NULL, QObject::tr("bessel_j1(x):\n Regular cylindrical Bessel function of first order, J_1(x).") }, - { "bessel_jn", 2, NULL,bessel_Jn,NULL, QObject::tr("bessel_jn(double x, int n):\n Regular cylindrical Bessel function of order n, J_n(x).") }, - { "bessel_jn_zero", 2, NULL,bessel_Jn_zero,NULL, QObject::tr("bessel_jn_zero(double n, unsigned int s):\n s-th positive zero x_s of regular cylindrical Bessel function of order n, J_n(x_s)=0") }, - { "bessel_y0", 1, bessel_Y0, NULL,NULL, QObject::tr("bessel_y0(x):\n Irregular cylindrical Bessel function of zeroth order, Y_0(x), for x>0.") }, - { "bessel_y1", 1, bessel_Y1, NULL,NULL, QObject::tr("bessel_y1(x):\n Irregular cylindrical Bessel function of first order, Y_1(x), for x>0.") }, - { "bessel_yn", 2, NULL,bessel_Yn,NULL, QObject::tr("bessel_yn(double x, int n):\n Irregular cylindrical Bessel function of order n, Y_n(x), for x>0.") }, - { "beta", 2, NULL,beta,NULL, QObject::tr("beta(a,b):\n Computes the Beta Function, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) for a > 0, b > 0.") }, - { "ceil", 1, ceil,NULL,NULL, QObject::tr("ceil(x):\n Round to the next larger integer,\n smallest integer larger or equal to x.") }, - { "cos", 1, NULL,NULL,NULL, QObject::tr("cos(x):\n Calculate cosine.") }, - { "cosh", 1, NULL,NULL,NULL, QObject::tr("cosh(x):\n Hyperbolic cos function.") }, - { "erf", 1, erf, NULL,NULL, QObject::tr("erf(x):\n The error function.") }, - { "erfc", 1, erfc, NULL,NULL, QObject::tr("erfc(x):\n Complementary error function erfc(x) = 1 - erf(x).") }, - { "erfz", 1, erf_Z, NULL,NULL, QObject::tr("erfz(x):\n The Gaussian probability density function Z(x).") }, - { "erfq", 1, erf_Q, NULL,NULL, QObject::tr("erfq(x):\n The upper tail of the Gaussian probability function Q(x).") }, - { "exp", 1, NULL,NULL,NULL, QObject::tr("exp(x):\n Exponential function: e raised to the power of x.") }, - { "floor", 1, floor,NULL,NULL, QObject::tr("floor(x):\n Round to the next smaller integer,\n largest integer smaller or equal to x.") }, - { "gamma", 1, gamma, NULL,NULL, QObject::tr("gamma(x):\n Computes the Gamma function, subject to x not being a negative integer.") }, - { "gammaln", 1, lngamma,NULL,NULL, QObject::tr("gammaln(x):\n Computes the logarithm of the Gamma function, subject to x not a being negative integer. For x<0, log(|Gamma(x)|) is returned.") }, - { "gauss_cdf", 2, NULL, gauss_cdf, NULL, QObject::tr("gauss_cdf(x, sigma):\n Computes the cumulative distribution function for a Gaussian distribution with standard deviation sigma.") }, - { "gauss_pdf", 2, NULL, gauss_pdf, NULL, QObject::tr("gauss_pdf(x, sigma):\n Computes the probability density at x for a Gaussian distribution with standard deviation sigma.") }, - { "hazard", 1, hazard,NULL,NULL, QObject::tr("hazard(x):\n Computes the hazard function for the normal distribution h(x) = erfz(x)/erfq(x).") }, - { "if", 3, NULL,NULL,NULL, QObject::tr("if(e1, e2, e3):\n if e1 then e2 else e3.") }, - { "inv_gauss_cdf", 2, NULL, inv_gauss_cdf, NULL, QObject::tr("inv_gauss_cdf(x, sigma):\n Computes the inverse of the cumulative distribution function for a Gaussian distribution with standard deviation sigma.") }, - { "ln", 1, NULL,NULL,NULL, QObject::tr("ln(x):\n Calculate natural logarithm log_e.") }, - { "log", 1, NULL,NULL,NULL, QObject::tr("log(x):\n Calculate decimal logarithm log_10.") }, - { "log10", 1, NULL,NULL,NULL, QObject::tr("log10(x):\n Calculate decimal logarithm log_10.") }, - { "log2", 1, NULL,NULL,NULL, QObject::tr("log2(x):\n Calculate binary logarithm log_2.") }, - { "min", -1, NULL,NULL,NULL, QObject::tr("min(x,y,...):\n Calculate minimum of all arguments.") }, - { "max", -1, NULL,NULL,NULL, QObject::tr("max(x,y,...):\n Calculate maximum of all arguments.") }, - { "mod", 2, NULL,mod,NULL, QObject::tr("mod(x,y):\n Calculate rest of integer division x/y,\n x modulo y.") }, - { "pow", 2, NULL,pow,NULL, QObject::tr("pow(x,y):\n Raise x to the power of y, x^y.") }, - { "rint", 1, NULL,NULL,NULL, QObject::tr("rint(x):\n Round to nearest integer.") }, - { "sign", 1, NULL,NULL,NULL, QObject::tr("sign(x):\n Sign function: -1 if x<0; 1 if x>0.") }, - { "sin", 1, NULL,NULL,NULL, QObject::tr("sin(x):\n Calculate sine.") }, - { "sinh", 1, NULL,NULL,NULL, QObject::tr("sinh(x):\n Hyperbolic sin function.") }, - { "sqrt", 1, NULL,NULL,NULL, QObject::tr("sqrt(x):\n Square root function.") }, - { "sum", -1, NULL,NULL,NULL, QObject::tr("sum(x,y,...):\n Calculate sum of all arguments.") }, - { "tan", 1, NULL,NULL,NULL, QObject::tr("tan(x):\n Calculate tangent function.") }, - { "tanh", 1, NULL,NULL,NULL, QObject::tr("tanh(x):\n Hyperbolic tan function.") }, - { "ttable", 2, NULL,ttable,NULL, QObject::tr("ttable(x, n):\n Student's t-distribution with n degrees of freedom.") }, - { "w0", 1, lambert_W0, NULL, NULL, QObject::tr("w0(x):\n Compute the principal branch of Lambert's W function, W_0(x).\n W is defined as a solution to the equation W(x)*exp(W(x))=x.\n For x<0, there are two real-valued branches; this function computes the one where W>-1 for x<0 (also see wm1(x)).") }, - { "wm1", 1, lambert_Wm1, NULL, NULL, QObject::tr("wm1(x):\n Compute the secondary branch of Lambert's W function, W_{-1}(x).\n W is defined as a solution to the equation W(x)*exp(W(x))=x.\n For x<0, there are two real-valued branches; this function computes the one where W<-1 for x<0. (also see w0(x)).") }, - {0,0,NULL,NULL,NULL,0} -}; - -const QStringList muParserScripting::mathFunctions() const -{ - QStringList l; - for (const mathFunction *i=math_functions; i->name; i++) - l << i->name; - return l; -} - -const QString muParserScripting::mathFunctionDoc (const QString &name) const -{ - for (const mathFunction *i=math_functions; i->name; i++) - if (name==i->name) - return i->description; - return QString::null; -} === added file 'qtiplot/src/scripting/muParserScripting.h' --- qtiplot/src/scripting/muParserScripting.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/muParserScripting.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,147 @@ +/*************************************************************************** + File : muParserScripting.h + Project : QtiPlot + -------------------------------------------------------------------- + + Copyright : (C) 2006 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de + Description : Evaluate mathematical expressions using muParser + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef MUPARSER_SCRIPTING_H +#define MUPARSER_SCRIPTING_H + +#include "ScriptingEnv.h" +#include "Script.h" +#include "muParserScript.h" + +#include +#include "math.h" +#include +#include +#include +#include + +//! TODO +class muParserScripting: public ScriptingEnv +{ + Q_OBJECT + + public: + static const char *langName; + muParserScripting(ApplicationWindow *parent) : ScriptingEnv(parent, langName){ + d_initialized = true; + gsl_set_error_handler_off(); + } + static ScriptingEnv *constructor(ApplicationWindow *parent) { return new muParserScripting(parent); } + + bool isRunning() const { return true; } + Script *newScript(const QString &code, QObject *context, const QString &name="") + { + return new muParserScript(this, code, context, name); + } + + // we do not support global variables + bool setQObject(QObject*, const char*) { return false; } + bool setInt(int, const char*) { return false; } + bool setDouble(double, const char*) { return false; } + + const QStringList mathFunctions() const; + const QString mathFunctionDoc (const QString &name) const; + + const static QStringList functionsList(bool tableContext = false); + const static QString explainFunction(const QString &name); + + struct mathFunction + { + char *name; + int numargs; + double (*fun1)(double); + double (*fun2)(double,double); + double (*fun3)(double,double,double); + QString description; + }; + static const mathFunction math_functions[]; + + private: + static double rnd(double x){ + gsl_rng_default_seed = (unsigned int)x*time(NULL); + const gsl_rng_type * T = gsl_rng_default; + gsl_rng * r = gsl_rng_alloc (T); + double u = gsl_rng_uniform (r); + gsl_rng_free (r); + return u; + } + + static double mod(double x, double y) + { return fmod(x,y); } + static double bessel_J0(double x) + { return gsl_sf_bessel_J0 (x); } + static double bessel_J1(double x) + { return gsl_sf_bessel_J1 (x); } + static double bessel_Jn(double x, double n) + { return gsl_sf_bessel_Jn ((int)n, x); } + static double bessel_Yn(double x, double n) + { return gsl_sf_bessel_Yn ((int)n, x); } + static double bessel_Jn_zero(double n, double s) + { return gsl_sf_bessel_zero_Jnu(n, (unsigned int) s); } + static double bessel_Y0(double x) + { return gsl_sf_bessel_Y0 (x); } + static double bessel_Y1(double x) + { return gsl_sf_bessel_Y1 (x); } + static double beta(double a, double b) + { return gsl_sf_beta (a,b); } + static double erf(double x) + { return gsl_sf_erf (x); } + static double erfc(double x) + { return gsl_sf_erfc (x); } + static double erf_Z(double x) + { return gsl_sf_erf_Z (x); } + static double erf_Q(double x) + { return gsl_sf_erf_Q (x); } + static double gamma(double x) + { return gsl_sf_gamma (x); } + static double lngamma(double x) + { return gsl_sf_lngamma (x); } + static double hazard(double x) + { return gsl_sf_hazard (x); } + static double lambert_W0(double x) + { return gsl_sf_lambert_W0(x); } + static double lambert_Wm1(double x) + { return gsl_sf_lambert_Wm1(x); } + static double ttable(double x, double n) + { return gsl_cdf_tdist_Pinv(x, n); } + static double gauss_pdf(double x, double sigma ) + {return gsl_ran_gaussian_pdf (x, sigma);}; + static double gauss_cdf(double x, double sigma ) + {return gsl_cdf_gaussian_P (x, sigma);}; + static double inv_gauss_cdf(double x, double sigma) + {return gsl_cdf_gaussian_Pinv(x, sigma);}; +}; + +class EmptySourceError : public mu::ParserError +{ + public: + EmptySourceError() {} +}; + +#endif === removed file 'qtiplot/src/scripting/muParserScripting.h' --- qtiplot/src/scripting/muParserScripting.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/muParserScripting.h 1970-01-01 00:00:00 +0000 @@ -1,134 +0,0 @@ -/*************************************************************************** - File : muParserScripting.h - Project : QtiPlot - -------------------------------------------------------------------- - - Copyright : (C) 2006 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de - Description : Evaluate mathematical expressions using muParser - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef MUPARSER_SCRIPTING_H -#define MUPARSER_SCRIPTING_H - -#include "ScriptingEnv.h" -#include "Script.h" -#include "muParserScript.h" - -#include -#include "math.h" -#include -#include -#include - -//! TODO -class muParserScripting: public ScriptingEnv -{ - Q_OBJECT - - public: - static const char *langName; - muParserScripting(ApplicationWindow *parent) : ScriptingEnv(parent, langName){ - d_initialized = true; - gsl_set_error_handler_off(); - } - static ScriptingEnv *constructor(ApplicationWindow *parent) { return new muParserScripting(parent); } - - bool isRunning() const { return true; } - Script *newScript(const QString &code, QObject *context, const QString &name="") - { - return new muParserScript(this, code, context, name); - } - - // we do not support global variables - bool setQObject(QObject*, const char*) { return false; } - bool setInt(int, const char*) { return false; } - bool setDouble(double, const char*) { return false; } - - const QStringList mathFunctions() const; - const QString mathFunctionDoc (const QString &name) const; - - struct mathFunction - { - char *name; - int numargs; - double (*fun1)(double); - double (*fun2)(double,double); - double (*fun3)(double,double,double); - QString description; - }; - static const mathFunction math_functions[]; - - private: - static double mod(double x, double y) - { return fmod(x,y); } - static double bessel_J0(double x) - { return gsl_sf_bessel_J0 (x); } - static double bessel_J1(double x) - { return gsl_sf_bessel_J1 (x); } - static double bessel_Jn(double x, double n) - { return gsl_sf_bessel_Jn ((int)n, x); } - static double bessel_Yn(double x, double n) - { return gsl_sf_bessel_Yn ((int)n, x); } - static double bessel_Jn_zero(double n, double s) - { return gsl_sf_bessel_zero_Jnu(n, (unsigned int) s); } - static double bessel_Y0(double x) - { return gsl_sf_bessel_Y0 (x); } - static double bessel_Y1(double x) - { return gsl_sf_bessel_Y1 (x); } - static double beta(double a, double b) - { return gsl_sf_beta (a,b); } - static double erf(double x) - { return gsl_sf_erf (x); } - static double erfc(double x) - { return gsl_sf_erfc (x); } - static double erf_Z(double x) - { return gsl_sf_erf_Z (x); } - static double erf_Q(double x) - { return gsl_sf_erf_Q (x); } - static double gamma(double x) - { return gsl_sf_gamma (x); } - static double lngamma(double x) - { return gsl_sf_lngamma (x); } - static double hazard(double x) - { return gsl_sf_hazard (x); } - static double lambert_W0(double x) - { return gsl_sf_lambert_W0(x); } - static double lambert_Wm1(double x) - { return gsl_sf_lambert_Wm1(x); } - static double ttable(double x, double n) - { return gsl_cdf_tdist_Pinv(x, n); } - static double gauss_pdf(double x, double sigma ) - {return gsl_ran_gaussian_pdf (x, sigma);}; - static double gauss_cdf(double x, double sigma ) - {return gsl_cdf_gaussian_P (x, sigma);}; - static double inv_gauss_cdf(double x, double sigma) - {return gsl_cdf_gaussian_Pinv(x, sigma);}; -}; - -class EmptySourceError : public mu::ParserError -{ - public: - EmptySourceError() {} -}; - -#endif === added file 'qtiplot/src/scripting/qti.sip' --- qtiplot/src/scripting/qti.sip 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/qti.sip 2010-07-21 23:21:08 +0000 @@ -0,0 +1,3009 @@ +/* vim: set filetype=cpp : */ +/* due to a limitation of sip, this file has to use Unix style line endings */ +/*************************************************************************** + File : qti.sip + Project : QtiPlot +-------------------------------------------------------------------- + Copyright : (C) 2006 by Knut Franke, Ion Vasilief, Michael Roemer, Jonas Bhr + Email : knut.franke*gmx.de, ion_vasilief*yahoo.fr, + roemer*nano.uni-hannover.de, Jonas.Baehr*web.de + Description : Specifications for Python bindings + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ + +%Module qti 0 +%Import QtCore/QtCoremod.sip +%Import QtGui/QtGuimod.sip + +class ScriptEdit: QTextEdit +{ +%TypeHeaderCode +#include "../src/scripting/ScriptEdit.h" +%End +public slots: + void print(); + void insertFunction(const QString &); + void exportPDF(const QString& fileName); + QString save(); + QString exportASCII(const QString &file=QString::null)/PyName=saveAs/; + QString importASCII(const QString &file=QString::null); + +private: + ScriptEdit(ScriptEdit&); +}; + +class MdiSubWindow: QMdiSubWindow /PyName=MDIWindow/ +{ +%TypeHeaderCode +#include "../src/core/MdiSubWindow.h" +%End +public: + enum CaptionPolicy{Name = 0, Label = 1, Both = 2}; + + SIP_PYOBJECT windowLabel(); +%MethodCode + sipRes = PyString_FromString(sipCpp->windowLabel()); +%End + void setWindowLabel(const QString&); + + CaptionPolicy captionPolicy(); + void setCaptionPolicy(CaptionPolicy); + + virtual void restore(const QStringList& ); + Folder* folder(); + + void askOnCloseEvent(bool)/PyName=confirmClose/; + +private: + MdiSubWindow(const MdiSubWindow&); +}; + +class Table: MdiSubWindow +{ +%TypeHeaderCode +#include "../src/table/Table.h" +#include +#include +#include +#include +#include // python include +#define CHECK_TABLE_COL(arg)\ + int col;\ + if (PyInt_Check(arg)) {\ + col = (int)PyInt_AsLong(arg) - 1;\ + if (col < 0 || col >= sipCpp->numCols()) {\ + sipIsErr = 1;\ + PyErr_Format(PyExc_ValueError, "There's no column %d in table %s!", col+1, sipCpp->name().ascii());\ + }\ + } else {\ + PyObject *tmp = PyObject_Str(arg);\ + if (!tmp) {\ + sipIsErr = 1;\ + PyErr_Format(PyExc_TypeError, "Column argument must be either int or string.");\ + } else {\ + col = sipCpp->colNames().findIndex(PyString_AsString(tmp));\ + if (col < 0) {\ + sipIsErr = 1;\ + PyErr_Format(PyExc_ValueError, "There's no column named %s in table %s!", PyString_AsString(tmp),\ + sipCpp->name().ascii());\ + Py_DECREF(tmp);\ + }\ + }\ + } + +#define CHECK_TABLE_ROW(arg)\ + int row = arg-1;\ + if (row < 0 || row >= sipCpp->numRows()) {\ + sipIsErr = 1;\ + PyErr_Format(PyExc_ValueError, "There's no row %d in table %s!", row+1, sipCpp->name().ascii());\ + } + +static int setCellDataHelper(Table* table, int row, int col, PyObject* item) { + PyTypeObject* item_type = item->ob_type; + if (item == Py_None) { + table->clearCell(row, col); + return 0; + } + switch (table->columnType(col)) { + case Table::Numeric: + item = PyNumber_Float(item); + if (item) { + table->setCell(row, col, PyFloat_AsDouble(item)); + Py_DECREF(item); + } + else { + if (PyType_Ready(item_type) == 0) + PyErr_Format(PyExc_TypeError, "Can't convert <%s> into a float!", item_type->tp_name); + return 1; + } + break; + case Table::Text: + item = PyObject_Str(item); + if (item) { + table->setText(row, col, PyString_AsString(item)); + Py_DECREF(item); + } + else { + if (PyType_Ready(item_type) == 0) + PyErr_Format(PyExc_TypeError, "Can't convert <%s> into a string!", item_type->tp_name); + return 1; + } + break; + case Table::Date: + if (sipCanConvertToType(item, sipType_QDateTime, 0)) { + int isErr = 0; + QDateTime* dateTime = reinterpret_cast(sipConvertToType(item, sipType_QDateTime, + 0/*sipTransferObj*/, 0/*flags*/, 0/*state*/, &isErr)); + if (isErr) + return 1; + table->setText(row, col, dateTime->toString(table->columnFormat(col))); + delete dateTime; + } + else { + if (PyType_Ready(item_type) == 0) + PyErr_Format(PyExc_TypeError, "Can't convert <%s> into a datetime!", item_type->tp_name); + return 1; + } + break; + case Table::Time: + if (sipCanConvertToType(item, sipType_QTime, 0)) { + int isErr = 0; + QTime* time = reinterpret_cast(sipConvertToType(item, sipType_QTime, + 0/*sipTransferObj*/, 0/*flags*/, 0/*state*/, &isErr)); + if (isErr) + return 1; + table->setText(row, col, time->toString(table->columnFormat(col))); + delete time; + } + else { + if (PyType_Ready(item_type) == 0) + PyErr_Format(PyExc_TypeError, "Can't convert <%s> into a time!", item_type->tp_name); + return 1; + } + break; + case Table::Month: + item = PyNumber_Int(item); + if (item) { + int m = PyInt_AS_LONG(item) % 12; // no type checking required since we casted above + if (!m) + m = 12; + QString format = table->columnFormat(col); + Py_DECREF(item); + if (format == "M") + table->setText(row, col, QDate::shortMonthName(m).left(1)); + else if (format == "MMM") + table->setText(row, col, QDate::shortMonthName(m)); + else if (format == "MMMM") + table->setText(row, col, QDate::longMonthName(m)); + } + else { + if (PyType_Ready(item_type) == 0) + PyErr_Format(PyExc_TypeError, "Can't convert <%s> into a number!", item_type->tp_name); + return 1; + } + break; + case Table::Day: + item = PyNumber_Int(item); + if (item) { + int day = PyInt_AS_LONG(item) % 7; // no type checking required since we casted above + if (!day) + day = 7; + QString format = table->columnFormat(col); + Py_DECREF(item); + if (format == "d") + table->setText(row, col, QDate::shortDayName(day).left(1)); + else if (format == "ddd") + table->setText(row, col, QDate::shortDayName(day)); + else if (format == "dddd") + table->setText(row, col, QDate::longDayName(day)); + } + else { + if (PyType_Ready(item_type) == 0) + PyErr_Format(PyExc_TypeError, "Can't convert <%s> into a number!", item_type->tp_name); + return 1; + } + break; + default: + PyErr_Format(PyExc_ValueError, "Type %d of column %d in table %s not supported!", + table->columnType(col), col+1, table->name().ascii()); + return 1; + break; + } // switch column type + return 0; // everything ok +} + +static int cellDataHelper(Table* table, int row, int col, PyObject** item) { + switch (table->columnType(col)) { + case Table::Numeric: + if (table->text(row, col).isEmpty()) + *item = Py_None; + else + *item = PyFloat_FromDouble(table->cell(row, col)); + break; + case Table::Text: + *item = PyString_FromString(table->text(row, col)); + break; + case Table::Date: + if (table->text(row, col).isEmpty()) + *item = Py_None; + else { + if (!PyDateTimeAPI) + PyDateTime_IMPORT; + QDateTime dateTime = QDateTime::fromString(table->text(row, col), table->columnFormat(col)); + QDate date = dateTime.date(); + QTime time = dateTime.time(); + *item = PyDateTime_FromDateAndTime(date.year(), date.month(), date.day(), + time.hour(), time.minute(), time.second(), time.msec()*1000); + } + break; + case Table::Time: + if (table->text(row, col).isEmpty()) + *item = Py_None; + else { + if (!PyDateTimeAPI) + PyDateTime_IMPORT; + QTime time = QTime::fromString(table->text(row, col), table->columnFormat(col)); + *item = PyTime_FromTime(time.hour(), time.minute(), time.second(), time.msec()*1000); + } + break; + case Table::Month: + if (table->text(row, col).isEmpty()) + *item = Py_None; + else { + QDate date = QDate::fromString(table->text(row, col), table->columnFormat(col)); + *item = PyInt_FromLong(date.month()); + } + break; + case Table::Day: + if (table->text(row, col).isEmpty()) + *item = Py_None; + else { + QDate date = QDate::fromString(table->text(row, col), table->columnFormat(col)); + *item = PyInt_FromLong(date.dayOfWeek()); + } + break; + default: + *item = NULL; + PyErr_Format(PyExc_ValueError, "Type %d of column %d in table %s not supported!", + table->columnType(col), col+1, table->name().ascii()); + return 1; + break; + } // switch column type + return 0; // everything ok +} +%End + +public: + enum PlotDesignation{None = 0, X = 1, Y = 2, Z = 3, xErr = 4, yErr = 5, Label = 6}; + enum ImportMode{NewColumns, NewRows, Overwrite}; + enum NumericFormat{Default = 0, Decimal = 1, Scientific = 2}; + + int numRows(); + int __len__(); +%MethodCode + sipRes = sipCpp->numRows(); +%End + int numCols(); + void resizeRows(int) /PyName=setNumRows/; + void resizeCols(int) /PyName=setNumCols/; + + void deleteRows(int, int); + void __delitem__(int); +%MethodCode + int len = sipCpp->numRows(); + if ((a0 = (int)sipConvertFromSequenceIndex(a0, len)) < 0) + sipIsErr = 1; + else + sipCpp->deleteRows(a0 + 1, a0 + 1); // start and stop are equal, counting starts at 1 +%End + void __delitem__(SIP_PYSLICE); +%MethodCode + SIP_SSIZE_T len, start, stop, step, slicelength; + len = sipCpp->numRows(); + if (PySlice_GetIndicesEx((PySliceObject *)a0, len, &start, &stop, &step, &slicelength) < 0) + sipIsErr = 1; + else { + start += 1; // row index starts at 1 (python at 0); the stop is inclusive (python exclusive) so no need to change + if (step == 1) + sipCpp->deleteRows(start, stop); + else { + for (int i = 0; i < slicelength; i++) { + sipCpp->deleteRows(start, start); + start += step - 1; // the "- 1" is needed since the removal also shifts the index + } + } + } +%End + + SIP_PYOBJECT text(SIP_PYOBJECT, int); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + CHECK_TABLE_ROW(a1); + if (sipIsErr == 0) { + PyObject *encstr = PyString_FromString(sipCpp->text(row, col).utf8()); + if (encstr) { + sipRes = PyUnicode_FromEncodedObject(encstr, "utf8", 0); + Py_DECREF(encstr); + } else { + sipRes = NULL; + sipIsErr = 1; + } + } +%End + + void removeCol(SIP_PYOBJECT); +%MethodCode + sipIsErr=0; + CHECK_TABLE_COL(a0); + if (sipIsErr==0) + { + QStringList list; + list << "_" + sipCpp->colLabel(col); + sipCpp->removeCol(list); + } +%End + + double cell(SIP_PYOBJECT, int); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + CHECK_TABLE_ROW(a1); + if (sipIsErr == 0){ + if (sipCpp->text(row, col) != "") + sipRes = sipCpp->cell(row, col); + else { + sipRes = NULL; + PyErr_SetString(PyExc_ValueError, "Empty table cell"); + } + } +%End + SIP_PYOBJECT cellData(SIP_PYOBJECT, int); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + CHECK_TABLE_ROW(a1); + if (sipIsErr == 0) + sipIsErr = cellDataHelper(sipCpp, row, col, &sipRes); +%End + SIP_PYTUPLE rowData(int); +%MethodCode + PyObject *item; + sipIsErr = 0; + CHECK_TABLE_ROW(a0); + if (sipIsErr == 0){ + int size = sipCpp->numCols(); + sipRes = PyTuple_New(size); + for(int col = 0; col < size; col++) { + sipIsErr = cellDataHelper(sipCpp, row, col, &item); + if (sipIsErr == 0) + PyTuple_SET_ITEM(sipRes, col, item); + else { + Py_DECREF(sipRes); + sipRes = NULL; + break; + } + } // for each col + } // if not sip error +%End + SIP_PYTUPLE __getitem__(int); // this is operator[] +%MethodCode + SIP_SSIZE_T idx = sipConvertFromSequenceIndex(a0, sipCpp->numRows()); + if (idx < 0) + sipIsErr = 1; + else { + sipRes = PyObject_CallMethod(sipSelf, "rowData", "i", idx + 1); // rowData's index starts at 1 + if (sipRes == NULL) + sipIsErr = 1; + } +%End + SIP_PYTUPLE __getitem__(SIP_PYSLICE); // this is operator[] +%MethodCode + SIP_SSIZE_T len, start, stop, step, slicelength; + len = sipCpp->numRows(); + if (PySlice_GetIndicesEx((PySliceObject *)a0, len, &start, &stop, &step, &slicelength) < 0) + sipIsErr = 1; + else { + PyObject *item; + sipRes = PyList_New(slicelength); + for(int i = 0; i < slicelength; i++) { + item = PyObject_CallMethod(sipSelf, "rowData", "i", start + 1); // rowData's index starts at 1 + start += step; + if (item) + PyList_SET_ITEM(sipRes, i, item); + else { + Py_DECREF(sipRes); + sipRes = NULL; + sipIsErr = 1; + break; + } + } // for + } +%End + SIP_PYLIST colData(SIP_PYOBJECT); +%MethodCode + PyObject *item; + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (sipIsErr == 0){ + int size = sipCpp->numRows(); + sipRes = PyList_New(size); + for(int row = 0; row < size; row++) { + sipIsErr = cellDataHelper(sipCpp, row, col, &item); + if (sipIsErr == 0) + PyList_SET_ITEM(sipRes, row, item); + else { + Py_DECREF(sipRes); + sipRes = NULL; + break; + } + } // for + } // if not sip error +%End + void setRowData(int, SIP_PYTUPLE); +%MethodCode + PyObject *item; + sipIsErr = 0; + CHECK_TABLE_ROW(a0); + int n = PyTuple_Size(a1); + int size = sipCpp->numCols(); + if (n != size) { + sipIsErr = 1; + PyErr_SetString(PyExc_ValueError, "The argument length must match the table's column count!"); + } + if (sipIsErr == 0){ + for(int col = 0; col < size; col++) { + item = PyTuple_GET_ITEM(a1, col); + sipIsErr = setCellDataHelper(sipCpp, row, col, item); + if (sipIsErr) + break; + } // for each col + } // if not sip error +%End + void __setitem__(int, SIP_PYTUPLE); +%MethodCode + SIP_SSIZE_T idx = sipConvertFromSequenceIndex(a0, sipCpp->numRows()); + if (idx < 0) + sipIsErr = 1; + else { + PyObject* methodName = PyString_FromString("setRowData"); + PyObject* rowNumber = PyInt_FromLong(idx + 1); // setRowData's index starts at 1 + PyObject* ret = PyObject_CallMethodObjArgs(sipSelf, methodName, rowNumber, a1, NULL); + if (ret == NULL) + sipIsErr = 1; + else + Py_DECREF(ret); + Py_DECREF(rowNumber); + Py_DECREF(methodName); + } +%End + int appendRowData(SIP_PYTUPLE); +%MethodCode + sipRes = sipCpp->numRows() + 1; + sipCpp->resizeRows(sipRes); + PyObject* methodName = PyString_FromString("setRowData"); + PyObject* rowNumber = PyInt_FromLong(sipRes); + PyObject* ret = PyObject_CallMethodObjArgs(sipSelf, methodName, rowNumber, a0, NULL); + if (ret == NULL) + sipIsErr = 1; + else + Py_DECREF(ret); + Py_DECREF(rowNumber); + Py_DECREF(methodName); +%End + void setColData(SIP_PYOBJECT, SIP_PYOBJECT, int=0); // a2 can be used as an offset +%MethodCode + PyObject *item; + PyObject *iterator = PyObject_GetIter(a1); + sipIsErr = 0; + CHECK_TABLE_COL(a0); + int tableLength = sipCpp->numRows(); + if (iterator == NULL) { + sipIsErr = 1; + PyErr_SetString(PyExc_TypeError, "Object needs to be iterable"); + } + else { + while (a2 < 0) { // a negative offset should skip the first values in the iterator + if (item = PyIter_Next(iterator)) + Py_DECREF(item); // not needed any more + else { + sipIsErr = 1; + if (! PyErr_Occurred()) + PyErr_SetString(PyExc_StopIteration, "Iterator ended before any row could be filled!"); + } + a2++; + } //while + } + if (sipIsErr == 0){ + for(int row = a2; row < tableLength; row++) { + if (item = PyIter_Next(iterator)) { + sipIsErr = setCellDataHelper(sipCpp, row, col, item); + Py_DECREF(item); + } + else { + sipIsErr = 1; + if (! PyErr_Occurred()) + PyErr_SetString(PyExc_StopIteration, "Iterator ended before all rows were filled!"); + } + if (sipIsErr) + break; + } // for each row + } // if not sip error + if (iterator) + Py_DECREF(iterator); +%End + void setText(SIP_PYOBJECT, int, const QString&); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + CHECK_TABLE_ROW(a1); + if (sipIsErr == 0) + sipCpp->setText(row, col, *a2); +%End + void setCell(SIP_PYOBJECT, int, double); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + CHECK_TABLE_ROW(a1); + if (sipIsErr == 0) + sipCpp->setCell(row, col, a2); +%End + void setCellData(SIP_PYOBJECT, int, SIP_PYOBJECT); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + CHECK_TABLE_ROW(a1); + if (sipIsErr == 0) + sipIsErr = setCellDataHelper(sipCpp, row, col, a2); +%End + SIP_PYOBJECT colName(int); +%MethodCode + if (a0 < 1 || a0 > sipCpp->numCols()) {\ + sipIsErr = 1;\ + PyErr_SetString(PyExc_ValueError, "Invalid column argument");\ + } else + sipRes = PyString_FromString(sipCpp->colLabel(a0-1)); +%End + SIP_PYTUPLE colNames(); +%MethodCode + QStringList l = sipCpp->colNames(); + int size = l.length(); + sipRes = PyTuple_New(size); + if(sipRes) { + for(int i=0; isetColName(col, *a1, a2); +%End + void setHeader(QStringList header)/PyName=setColNames/; + void notifyChanges(); + + void importASCII(const QString&, const QString&="\t", int=0, bool=false, + bool=true, bool=false, bool=false, const QString&="#", bool=false, + ImportMode = Overwrite, const QLocale& = QLocale(), int = 0, int = -1, const QList& = QList()); + bool exportASCII(const QString&, const QString&="\t", bool=false, bool=false, bool=false); + + void setDecimalSeparators(int,bool=true); +%MethodCode + QLocale locale; + switch (a0){ + case 0: + locale = QLocale::system(); + break; + case 1: + locale = QLocale::c(); + break; + case 2: + locale = QLocale(QLocale::German); + break; + case 3: + locale = QLocale(QLocale::French); + break; + } + if (a1==true) + locale.setNumberOptions(QLocale::OmitGroupSeparator); + + sipCpp->updateDecimalSeparators(locale); +%End + + void normalizeCol(SIP_PYOBJECT) /PyName=normalize/; +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (sipIsErr == 0) + sipCpp->normalizeCol(col); +%End + void normalize(); + + void sortColumn(SIP_PYOBJECT, int order = 0); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (sipIsErr == 0) + sipCpp->sortColumn(col, a1); +%End + void sort(int type = 0, int order = 0, const QString& leadCol = QString()); + void sortColumns(SIP_PYTUPLE, int=0, int=0, const QString&=QString()); +%MethodCode + QStringList l; + int n = PyTuple_Size(a0); + for (int i=0; isortColumns(l, a1, a2, *a3); +%End + + void setCommand(SIP_PYOBJECT, const QString&); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (sipIsErr == 0) + sipCpp->setCommand(col, *a1); +%End + bool calculate(SIP_PYOBJECT col, int startRow = 1, int endRow = -1, bool forceMuParser = false, bool notifyChanges = true)/PyName=recalculate/; +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (a2 == -1) + a2 = sipCpp->numRows(); + if (sipIsErr == 0) + sipCpp->calculate(col, a1 - 1, a2 - 1, a3, a4); // row indes starts at 0 +%End + + QString comment(SIP_PYOBJECT); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (sipIsErr == 0) + return Py_BuildValue("s", sipCpp->comment(col).toAscii().constData()); +%End + + void setComment(SIP_PYOBJECT, const QString&); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (sipIsErr == 0) + sipCpp->setColComment(col, *a1); +%End + + void showComments(bool on = true); + + void setReadOnlyColumn(SIP_PYOBJECT, bool = true); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (sipIsErr == 0) + sipCpp->setReadOnlyColumn(col, a1); +%End + + void setColumnRole(SIP_PYOBJECT, PlotDesignation); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (sipIsErr == 0){ + sipCpp->setColPlotDesignation(col, a1); + sipCpp->setHeaderColType(); + } +%End + + void setColTextFormat(SIP_PYOBJECT); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (sipIsErr == 0) + sipCpp->setTextFormat(col); +%End + + void setColNumericFormat(SIP_PYOBJECT, int, int, bool = true); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (sipIsErr == 0) + sipCpp->setColNumericFormat(a1, a2, col, a3); +%End + + void setColDateFormat(SIP_PYOBJECT, const QString&, bool = true); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (sipIsErr == 0) + sipCpp->setDateFormat(*a1, col, a2); +%End + + void setColTimeFormat(SIP_PYOBJECT, const QString&, bool = true); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (sipIsErr == 0) + sipCpp->setTimeFormat(*a1, col, a2); +%End + + void setColMonthFormat(SIP_PYOBJECT, const QString&, bool = true); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (sipIsErr == 0) + sipCpp->setMonthFormat(*a1, col, a2); +%End + + void setColDayFormat(SIP_PYOBJECT, const QString&, bool = true); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (sipIsErr == 0) + sipCpp->setDayFormat(*a1, col, a2); +%End + + void setColumnWidth(SIP_PYOBJECT, int); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (sipIsErr == 0) + sipCpp->setColumnWidth(col, a1); +%End + + void showAllColumns(); + void hideColumn(SIP_PYOBJECT, bool = true); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (sipIsErr == 0) + sipCpp->hideColumn(col, a1); +%End + + bool isRowSelected(int, bool = false); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_ROW(a0); + if (sipIsErr == 0) + return Py_BuildValue("b",sipCpp->isRowSelected(row, a1)); + +%End + + bool isColumnSelected(SIP_PYOBJECT, bool = false)/PyName=isColSelected/; +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (sipIsErr == 0) + return Py_BuildValue("b",sipCpp->isColumnSelected(col, a1)); +%End + + int firstSelectedColumn(); + int numSelectedRows(); + + void setSelectedCol(SIP_PYOBJECT); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (sipIsErr == 0) + sipCpp->setSelectedCol(col); +%End + + int selectedColumn(); + + void addCol(PlotDesignation pd = Y)/PyName=addColumn/; + int addRow(); +%MethodCode + sipRes = sipCpp->numRows() + 1; + sipCpp->resizeRows(sipRes); +%End + void insertColumns(SIP_PYOBJECT, int); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + if (sipIsErr == 0) + sipCpp->insertCols(col, a1); +%End + + void swapColumns(SIP_PYOBJECT, SIP_PYOBJECT); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + + int col2; + if (PyInt_Check(a1)) { + col2 = (int)PyInt_AsLong(a1) - 1; + if (col2 < 0 || col2 >= sipCpp->numCols()) { + sipIsErr = 1; + PyErr_Format(PyExc_ValueError, "There's no column %d in table %s!", col2+1, sipCpp->name().ascii()); + } + } else { + PyObject *tmp = PyObject_Str(a1); + if (!tmp) { + sipIsErr = 1; + PyErr_Format(PyExc_TypeError, "Column argument must be either int or string."); + } else { + col2 = sipCpp->colNames().findIndex(PyString_AsString(tmp)); + if (col2 < 0) { + sipIsErr = 1; + PyErr_Format(PyExc_ValueError, "There's no column named %s in table %s!", PyString_AsString(tmp),sipCpp->name().ascii()); + Py_DECREF(tmp); + } + } + } + + if (sipIsErr == 0) + sipCpp->swapColumns(col, col2); +%End + +void scrollToCell(SIP_PYOBJECT, int); +%MethodCode + sipIsErr = 0; + CHECK_TABLE_COL(a0); + CHECK_TABLE_ROW(a1); + if (sipIsErr == 0) + sipCpp->table()->ensureCellVisible(row, col); // for some reason these indices seem to start at 1 +%End + +private: + Table(const Table&); +}; + +class QwtLinearColorMap /PyName=LinearColorMap/ +{ +%TypeHeaderCode +#include +%End +public: + + enum Format{RGB, Indexed}; + enum Mode {FixedColors, ScaledColors}; + QwtLinearColorMap(const QColor &, const QColor &, QwtLinearColorMap::Format=QwtColorMap::RGB); + + void addColorStop (double, const QColor &); + void setMode (Mode); + + void setColorInterval (const QColor &, const QColor &); + QColor color1() const; + QColor color2() const; + +private: + QwtLinearColorMap(const QwtLinearColorMap&); +}; + +class Matrix: MdiSubWindow +{ +%TypeHeaderCode +#include "../src/matrix/Matrix.h" +#define CHECK_MATRIX_COL(arg)\ + int col = arg-1;\ + if (col < 0 || col >= sipCpp->numCols()) {\ + sipIsErr = 1;\ + PyErr_Format(PyExc_ValueError, "There's no column %d in matrix %s!", col+1, sipCpp->name().ascii());\ + } +#define CHECK_MATRIX_ROW(arg)\ + int row = arg-1;\ + if (row < 0 || row >= sipCpp->numRows()) {\ + sipIsErr = 1;\ + PyErr_Format(PyExc_ValueError, "There's no row %d in matrix %s!", row+1, sipCpp->name().ascii());\ + } +%End +public: + enum HeaderViewType{ColumnRow, XY}; + enum ViewType{TableView, ImageView}; + enum ImportMode{NewColumns, NewRows, Overwrite}; + + int numRows(); + void setNumRows(int); + int numCols(); + void setNumCols(int); + void setDimensions(int rows, int cols); + + SIP_PYOBJECT text(int, int); +%MethodCode + sipIsErr = 0; + CHECK_MATRIX_ROW(a0); + CHECK_MATRIX_COL(a1); + if (sipIsErr == 0) + sipRes = PyString_FromString(sipCpp->text(row, col)); +%End + double cell(int, int); +%MethodCode + sipIsErr = 0; + CHECK_MATRIX_ROW(a0); + CHECK_MATRIX_COL(a1); + if (sipIsErr == 0) + sipRes = sipCpp->cell(row, col); +%End + void setText(int, int, const QString&); +%MethodCode + sipIsErr = 0; + CHECK_MATRIX_ROW(a0); + CHECK_MATRIX_COL(a1); + if (sipIsErr == 0) + sipCpp->setText(row, col, *a2); +%End + void setCell(int, int, double); +%MethodCode + sipIsErr = 0; + CHECK_MATRIX_ROW(a0); + CHECK_MATRIX_COL(a1); + if (sipIsErr == 0) + sipCpp->setCell(row, col, a2); +%End + + double dx(); + double dy(); + double xStart(); + double xEnd(); + double yStart(); + double yEnd(); + void setCoordinates(double xs, double xe, double ys, double ye); + + void setFormula(const QString &); + bool calculate(int startRow = 0, int endRow = -1, int startCol = 0, int endCol = -1, bool muParser = true); + + void setNumericPrecision(int prec); + + void transpose(); + void invert(); + void flipVertically(); + void flipHorizontally(); + void rotate90(bool = true); + double determinant(); + double integrate(); + + void setViewType(ViewType); + void setHeaderViewType(HeaderViewType); + + void setDefaultColorMap(); + void setGrayScale(); + void setRainbowColorMap(); + QwtLinearColorMap *colorMapPointer()/PyName=colorMap/; + void setColorMap(const QwtLinearColorMap&); + + void resetView(); + + QImage image(); + void importImage(const QString&); + void exportRasterImage(const QString&, int = 100, int dpi = 0); + void exportToFile(const QString&) /PyName=export/; + void exportVector(const QString&, int = 0, bool = true); + + void importASCII(const QString&, const QString&="\t", int=0, bool=false, bool=false, + const QString&="#", ImportMode = Overwrite, const QLocale& = QLocale(), int = 0, int = -1); + bool exportASCII(const QString&, const QString&="\t", bool=false); + +private: + Matrix(const Matrix&); +}; + +class ArrowMarker // : QwtPlotMarker +{ +%TypeHeaderCode +#include "../src/plot2D/ArrowMarker.h" +%End +public: + + ArrowMarker(); + + void setStartPoint(double, double) /PyName=setStart/; + void setEndPoint(double, double) /PyName=setEnd/; + + void setStyle(Qt::PenStyle); + void setColor(const QColor&); + void setWidth(double); + void drawStartArrow(bool = true); + void drawEndArrow(bool = true); + void setHeadLength(int); + void setHeadAngle(int); + void fillArrowHead(bool = true); + +private: + ArrowMarker(const ArrowMarker&); +}; + +class FrameWidget : QWidget /PyName=Frame/ +{ +%TypeHeaderCode +#include "../src/plot2D/FrameWidget.h" +%End + +public: + enum FrameStyle{None = 0, Line = 1, Shadow = 2}; + enum Unit{Inch = 0, Millimeter, Centimeter, Point, Pixel, Scale}; + + double xValue(); + double yValue(); + void setOriginCoord(double, double); + void setOrigin(int x, int y); + void move(const QPoint&); + + QRectF boundingRect(); + void setCoordinates(double left, double top, double right, double bottom); + void setSize(int w, int h); + void setSize(const QSize& newSize); + void setRect(int x, int y, int w, int h); + + double right(); + double bottom(); + + int frameStyle(); + void setFrameStyle(int); + + QPen framePen(); + void setFramePen(const QPen&); + + Qt::PenStyle frameLineStyle(); + void setFrameLineStyle(const Qt::PenStyle&); + + QColor frameColor(); + void setFrameColor(const QColor&); + + double frameWidth(); + void setFrameWidth(double); + + QColor backgroundColor(); + void setBackgroundColor(const QColor&); + + QBrush brush(); + void setBrush(const QBrush& ); + +private: + FrameWidget(const FrameWidget&); +}; + +class ImageWidget : FrameWidget /PyName=Image/ +{ +%TypeHeaderCode +#include "../src/plot2D/ImageWidget.h" +%End +public: + + ImageWidget(Graph *, const QString&); + QString fileName(); + bool load(const QString& fn); + +private: + ImageWidget(const ImageWidget&); +}; + +class LegendWidget : FrameWidget /PyName=Legend/ +{ +%TypeHeaderCode +#include "../src/plot2D/LegendWidget.h" +%End +public: + + void setText(const QString&); + void setTextColor(const QColor&); + void setFont(const QFont&); + void setAngle(int); + int angle(); + + bool isAutoUpdateEnabled(); + void setAutoUpdate(bool); + +private: + LegendWidget(const LegendWidget&); +}; + +class RectangleWidget : FrameWidget /PyName=Rectangle/ +{ +%TypeHeaderCode +#include "../src/plot2D/RectangleWidget.h" +%End +public: + + RectangleWidget(Graph *); + +private: + RectangleWidget(const RectangleWidget&); +}; + +class EllipseWidget : FrameWidget /PyName=Ellipse/ +{ +%TypeHeaderCode +#include "../src/plot2D/EllipseWidget.h" +%End +public: + + EllipseWidget(Graph *); + +private: + EllipseWidget(const EllipseWidget&); +}; + +class QwtSymbol /PyName = PlotSymbol/ +{ +%TypeHeaderCode +#include +%End + public: + enum Style + { + NoSymbol = -1, + Ellipse, + Rect, + Diamond, + Triangle, + DTriangle, + UTriangle, + LTriangle, + RTriangle, + Cross, + XCross, + HLine, + VLine, + Star1, + Star2, + Hexagon, + + StyleCnt + }; + + QwtSymbol(); + QwtSymbol(Style st, const QBrush &bd, const QPen &pn, const QSize &s); + + void setSize(const QSize &s); + void setSize(int a, int b = -1); + void setBrush(const QBrush& b); + void setPen(const QPen &p); + void setStyle (Style s); + + const QBrush& brush() const; + const QPen& pen() const; + const QSize& size() const; + Style style() const; + + private: + QwtSymbol(const QwtSymbol&); +}; + +class QwtPlotCurve +{ +%TypeHeaderCode +#include +%End + public: + int dataSize() const; + double x(int i) const; + double y(int i) const; + double minXValue() const; + double maxXValue() const; + double minYValue() const; + double maxYValue() const; + + void setPen(const QPen &); + const QPen &pen() const; + + void setBrush(const QBrush &); + const QBrush &brush() const; + + void setSymbol(const QwtSymbol &s); + const QwtSymbol& symbol() const; + + void setVisible(bool on); + bool isVisible(); + + private: + QwtPlotCurve(const QwtPlotCurve&); +}; + +class PlotCurve : QwtPlotCurve +{ +%TypeHeaderCode +#include "../src/plot2D/PlotCurve.h" +%End +public: + PlotCurve(const QString& name = QString()); + + int skipSymbolsCount(); + void setSkipSymbolsCount(int); + +private: + PlotCurve(const PlotCurve&); +}; + +class DataCurve : PlotCurve +{ +%TypeHeaderCode +#include "../src/plot2D/PlotCurve.h" +%End +public: + DataCurve(Table *t, const QString& xColName, const QString& name, int startRow = 0, int endRow = -1); + + bool hasLabels(); + QString labelsColumnName(); + void setLabelsColumnName(const QString& name); + + int labelsAlignment(); + void setLabelsAlignment(int flags); + + int labelsXOffset(); + int labelsYOffset(); + void setLabelsOffset(int x, int y); + + double labelsRotation(); + void setLabelsRotation(double angle); + + QFont labelsFont(); + void setLabelsFont(const QFont& font); + + QColor labelsColor(); + void setLabelsColor(const QColor& c); + + bool labelsWhiteOut(); + void setLabelsWhiteOut(bool whiteOut = true); + + Table* table(); + + int startRow(); + int endRow(); + void setRowRange(int startRow, int endRow); + + bool isFullRange(); + void setFullRange(); + + bool updateData(Table *t, const QString& colName); + void loadData(); + + void clearLabels(); + +private: + DataCurve(const DataCurve&); +}; + +class QwtHistogram : QwtPlotCurve /PyName=Histogram/ +{ +%TypeHeaderCode +#include "../src/plot2D/QwtHistogram.h" +%End +public: + QwtHistogram(Table *t, const QString& name, int startRow = 0, int endRow = -1); + QwtHistogram(Matrix *m); + + void setBinning(double size, double begin, double end); + void setAutoBinning(bool autoBin = true); + double begin(); + double end(); + double binSize(); + + void loadData(); + + double mean(); + double standardDeviation(); + double minimum(); + double maximum(); + + Matrix* matrix(); + +private: + QwtHistogram(const QwtHistogram&); +}; + +class QwtPlotSpectrogram // : QwtPlotItem +{ +%TypeHeaderCode +#include +%End +public: + enum DisplayMode { + ImageMode = 1, + ContourMode = 2 + }; + + QwtPlotSpectrogram (const QString &title = QString::null); + void setDefaultContourPen (const QPen &); + void setDisplayMode (DisplayMode mode, bool on = true); + +private: + QwtPlotSpectrogram(const QwtPlotSpectrogram&); +}; + +class Spectrogram : QwtPlotSpectrogram +{ +%TypeHeaderCode +#include "../src/plot2D/Spectrogram.h" +%End +public: + + Spectrogram(Graph *graph, Matrix *m); + + Matrix * matrix(); + bool setMatrix(Matrix *, bool = false); + + int levels(); + void setLevelsNumber(int); + void setContourLevels (SIP_PYTUPLE); +%MethodCode + QList l; + int n = PyTuple_Size(a0); + for (int i=0; isetContourLevels(l); +%End + + bool hasColorScale(); + int colorScaleAxis(); + void showColorScale(int axis, bool on = true); + + int colorBarWidth(); + void setColorBarWidth(int width); + + void setGrayScale(); + void setDefaultColorMap(); + + QwtLinearColorMap *colorMapPointer()/PyName=colorMap/; + void setCustomColorMap(const QwtLinearColorMap& map); + + bool hasLabels(); + void showContourLineLabels(bool show = true); + + QFont labelsFont(); + void setLabelsFont(const QFont& font); + + QColor labelsColor(); + void setLabelsColor(const QColor& c); + + bool labelsWhiteOut(); + void setLabelsWhiteOut(bool whiteOut = true); + + double labelsXOffset(); + double labelsYOffset(); + void setLabelsOffset(double x, double y); + + double labelsRotation(); + void setLabelsRotation(double angle); + + bool useMatrixFormula(); + bool setUseMatrixFormula(bool on = true); + + void setColorMapPen(bool on = true); + void setContourLinePen(int, const QPen &); + void updateData(); + +private: + Spectrogram(const Spectrogram&); +}; + +class Grid // : QwtPlotGrid +{ +%TypeHeaderCode +#include "../src/plot2D/Grid.h" +%End +public: + + Grid(); + + void enableX(bool = true) /PyName=enableXMax/; + bool xEnabled() /PyName=xMaxEnabled/; + void enableXMin(bool = true); + bool xMinEnabled(); + + void enableY(bool = true) /PyName=enableYMax/; + bool yEnabled() /PyName=yMaxEnabled/; + void enableYMin(bool = true); + bool yMinEnabled(); + + bool xZeroLineEnabled(); + void enableZeroLineX(bool = true); + bool yZeroLineEnabled(); + void enableZeroLineY(bool = true); + const QPen& xZeroLinePen(); + void setXZeroLinePen(const QPen &p); + const QPen& yZeroLinePen(); + void setYZeroLinePen(const QPen &p); + + void setMajPenX(const QPen &p); + const QPen& majPenX(); + + void setMinPenX(const QPen &p); + const QPen& minPenX(); + + void setMajPenY(const QPen &p); + const QPen& majPenY(); + + void setMinPenY(const QPen &p); + const QPen& minPenY(); + +private: + Grid(const Grid&); +}; + +class QwtPlot : QFrame +{ +%TypeHeaderCode +#include "qwt_plot.h" +%End + +private: + QwtPlot(const QwtPlot&); +}; + +class Graph : QwtPlot /PyName=Layer/ +{ +%TypeHeaderCode +#include "../src/plot2D/Graph.h" +#include "../src/plot2D/LegendWidget.h" +%End +public: + enum Scale{Linear, Log10}; + enum Axis{Left, Right, Bottom, Top}; + enum TicksStyle{NoTicks = 0, Out = 1, InOut = 2, In = 3}; + enum CurveType{Line, Scatter, LineSymbols, VerticalBars, Area, Pie, VerticalDropLines, + Spline, HorizontalSteps, Histogram, HorizontalBars, VectXYXY, ErrorBars, + Box, VectXYAM, VerticalSteps, ColorMap, GrayScale, Contour, Function, ImagePlot, + StackBar, StackColumn}; + + bool isPiePlot(); + SIP_PYOBJECT pieLegendText() /PyName=pieLegend/; +%MethodCode + sipRes = PyString_FromString(sipCpp->pieLegendText()); +%End + + DataCurve* insertCurve(Table*, const QString&, int style = 1, int startRow = 0, int endRow = -1); + DataCurve* insertCurve(Table*, const QString&, const QString&, int style = 1, int startRow = 0, int endRow = -1); + bool addCurves(Table*, SIP_PYTUPLE, int=0, double=1, int=3, int=0, int=-1); +%MethodCode + QStringList l; + int n = PyTuple_Size(a1); + for (int i=0; iaddCurves(a0, l, a2, a3, a4, a5, a6); +%End + + bool addCurve(Table*, const QString&, int=0, double=1, int=3, int=0, int=-1); +%MethodCode + if (a0 == 0) { + sipIsErr = 1; + PyErr_Format(PyExc_ValueError, "Invalid table in addCurve()."); + } else { + QStringList l; + l << *a1; + sipRes = sipCpp->addCurves(a0, l, a2, a3, a4, a5, a6); + } +%End + void removeCurve(int); + void removeCurve(const QString&); + void removeCurve(QwtPlotCurve*); + void deleteFitCurves(); + int curveCount() /PyName=numCurves/; + PlotCurve* curve(int index); + PlotCurve* curve(const QString &title); + QString curveTitle(int); + DataCurve* dataCurve(int index); + + void changeCurveIndex(int fromIndex, int toIndex); + + void setCurveLineColor(int, int); + void setCurveLineColor(int, QColor); + void setCurveLineStyle(int, Qt::PenStyle); + void setCurveLineWidth(int, double); + + void setGrayScale(); + void setIndexedColors(); + + void addFunction(const QString&, double, double, int=100); +%MethodCode + QStringList l; + l << *a0; + sipCpp->addFunction(l, a1, a2, a3); +%End + void addPolarFunction(const QString&, const QString&, double, double, int=100, const QString & = "t"); +%MethodCode + QStringList l; + l << *a0; + l << *a1; + sipCpp->addFunction(l, a2, a3, a4, *a5, 2); +%End + void addParametricFunction(const QString&, const QString&, double, double, int=100, const QString & = "m"); +%MethodCode + QStringList l; + l << *a0; + l << *a1; + sipCpp->addFunction(l, a2, a3, a4, *a5, 1); +%End + + void addErrorBars(const QString&, Table *, const QString&, + int type = 1, double width = 1, int cap = 8, const QColor& color = QColor(Qt::black), + bool through = true, bool minus = true, bool plus = true); + + QwtHistogram* addHistogram(Matrix*); + Spectrogram* plotSpectrogram(Matrix *m, CurveType type); + Spectrogram* spectrogram(Matrix *m); + + ArrowMarker* addArrow(ArrowMarker*); + void remove(ArrowMarker*); + QList arrowsList(); + int numArrows(); + + ImageWidget* addImage(ImageWidget*); + ImageWidget* addImage(const QString&); + ImageWidget* addImage(const QImage&); + void remove(ImageWidget*); + + void setTitle(const QString& t); + void setTitleFont(const QFont &fnt); + void setTitleColor(const QColor &c); + void setTitleAlignment(int align); + void removeTitle(); + + LegendWidget* newLegend(const QString& = QString()); + void setLegend(const QString&); + + LegendWidget* legend(); + void removeLegend(); + + LegendWidget* addText(LegendWidget*); + void remove(LegendWidget*); + + LegendWidget* addTimeStamp(); + + FrameWidget* add(FrameWidget*, bool = true); + void remove(FrameWidget*); + + void setXAxisTitle(const QString& text) /PyName=setXTitle/; + void setYAxisTitle(const QString& text) /PyName=setYTitle/; + + void enableAxis(int axis, bool on = true); + void setAxisColor(int axis, const QColor& color); + void setAxisFont(int axis, const QFont &fnt); + + void setAxisTitle(int axis, const QString& text); + void setAxisTitleFont(int axis,const QFont &fnt); + void setAxisTitleColor(int axis, const QColor& c); + void setAxisTitleAlignment(int axis, int align); + + int axisTitleDistance(int axis); + void setAxisTitleDistance(int axis, int dist); + + void setAxisTicksLength(int axis, int majTicksType, int minTicksType, int minLength, int majLength); + void setAxisLabelRotation(int axis, int rotation); + + void setAxesLinewidth(int width); + void drawAxesBackbones(bool yes); + void setTicksLength(int minLength, int majLength); + + void enableAxisLabels(int axis, bool on); + void setAxisLabelsColor(int axis, const QColor& color); + void setLabelsNumericFormat(int axis, int format, int = 6, const QString& = QString()) /PyName=setAxisNumericFormat/; + void setScale(int axis, double start, double end, double step = 0.0, + int majorTicks = 5, int minorTicks = 5, int type = 0, bool inverted = false, + double left_break = -DBL_MAX, double right_break = DBL_MAX, int pos = 50, + double stepBeforeBreak = 0.0, double stepAfterBreak = 0.0, int minTicksBeforeBreak = 4, + int minTicksAfterBreak = 4, bool log10AfterBreak = false, int breakWidth = 4, bool breakDecoration = true); + void setAutoScale(); + void setMargin(int); + void setFrame(int width = 1, const QColor& color = QColor(Qt::black)); + void setCanvasFrame(int width = 1, const QColor& color = QColor(Qt::black)); + void setBackgroundColor(const QColor& color); + void setCanvasBackground(const QColor& color) /PyName=setCanvasColor/; + + void setCanvasGeometry(int x, int y, int w, int h); + void setCanvasGeometry(const QRect &canvasRect); + void setCanvasSize(int w, int h); + void setCanvasSize(const QSize &size); + + Grid* grid(); + void showGrid(int); + void showGrid(); + + void replot(); + + void exportTeX(const QString& fname, bool color = true, bool escapeStrings = true, bool fontSizes = true, + const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, double fontsFactor = 1.0)/PyName=exportTex/; + void exportImage(const QString& fileName, int quality = 100, bool transparent = false, + int dpi = 0, const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, double fontsFactor = 1.0); + void exportVector(const QString&, int = 0, bool = true, + const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, double fontsFactor = 1.0); + void exportToFile(const QString& fileName) /PyName=export/; + + void enableAutoscaling(bool = true); + void setAutoscaleFonts(bool = true); + void setAntialiasing(bool on = true, bool update = true); + + void setCurveAxes(int,int,int); +%MethodCode + sipIsErr = 0; + if ((a1)>1 || (a1<0) || (a2>1) || (a2<0)) + { + sipIsErr=1; + PyErr_Format(PyExc_ValueError, "Invalid axis attachment!");\ + } + if (a0>=sipCpp->curveCount()) + { + sipIsErr=1; + PyErr_Format(PyExc_ValueError, "Invalid curve index! is %d, should be less than %d",a0,sipCpp->curveCount());\ + } + if (sipIsErr == 0) + { + QwtPlotItem* pItem; + pItem = sipCpp->plotItem(a0); + pItem->setAxis(a1 + 2, a2); + sipCpp->setAutoScale(); + } +%End + +private: + Graph(const Graph&); +}; + +class MultiLayer : MdiSubWindow /PyName=Graph/ +{ +%TypeHeaderCode +#include "../src/plot2D/MultiLayer.h" +%End +public: + + enum HorAlignement{HCenter, Left, Right}; + enum VertAlignement{VCenter, Top, Bottom}; + + Graph *activeLayer(); + void setActiveLayer(Graph*); + int numLayers(); + void setNumLayers(int n); + Graph* layer(int num); + QList layersList(); + Graph* addLayer(int = 0, int = 0, int = 0, int = 0, bool = false); + + bool removeLayer(Graph *g); + bool removeActiveLayer(); + + void setCols(int); + void setRows(int); + void setSpacing (int, int); + void setMargins (int, int, int, int); + void setLayerCanvasSize (int, int); + void setAlignement (int, int); + void arrangeLayers(bool fit = true, bool userSize = false); + bool swapLayers(int, int); + + void setScaleLayersOnResize(bool = true); + + void exportToFile(const QString& fileName) /PyName=export/; + void exportImage(const QString& fileName, int quality = 100, bool transparent = false, + int dpi = 0, const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, + double fontsFactor = 1.0); + void exportVector(const QString&, int = 0, bool = true, + const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, double fontsFactor = 1.0); + void exportTeX(const QString& fname, bool color = true, bool escapeStrings = true, bool fontSizes = true, + const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, double fontsFactor = 1.0)/PyName=exportTex/; + + void setWaterfallSideLines(bool = true); + void setWaterfallFillColor(const QColor&); + void setWaterfallOffset(int x, int y, bool = true); + void reverseWaterfallOrder(); + +private: + MultiLayer(const MultiLayer&); +}; + +class Note: MdiSubWindow +{ +%TypeHeaderCode +#include "../src/scripting/Note.h" +%End +public: + bool autoexec() const; + void setAutoexec(bool = true); + + QString text(); + void setText(const QString &s); + + void exportPDF(const QString& fileName); + QString exportASCII(const QString &file=QString::null)/PyName=saveAs/; + QString importASCII(const QString &file=QString::null); + + void showLineNumbers(bool = true); + + void setFont(const QFont& f); + void setTabStopWidth(int length); + + int tabs(); + void addTab(); + void removeTab(int = -1); + void renameTab(int, const QString&); + + int indexOf(ScriptEdit*); + ScriptEdit* editor(int index); + ScriptEdit* currentEditor(); + +private: + Note(const Note&); +}; + +class Graph3D: MdiSubWindow +{ +%TypeHeaderCode +#include "../src/plot3D/Graph3D.h" +%End +public: + enum PlotType{Scatter = 0, Trajectory = 1, Bars = 2, Ribbon = 3}; + enum AxisNumericFormat{Default = 0, Decimal = 1, Scientific = 2, Engineering = 3}; + + void exportToFile(const QString& fileName) /PyName=export/; + void exportVector(const QString& fileName, int = 0, int = 1, + const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, double fontsFactor = 1.0); + void exportImage(const QString& fileName, int quality = 100, bool transparent = false, + int dpi = 0, const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, double fontsFactor = 1.0); + + void setRotation(double xVal, double yVal, double zVal); + void setScale(double xVal, double yVal, double zVal); + void setShift(double xVal, double yVal, double zVal); + void setZoom(double val); + void setOrthogonal(bool = true); + void setMeshLineWidth(int); + void setMeshColor(const QColor&); + void setAxesColor(const QColor&); + void setNumbersColor(const QColor&); + void setLabelsColor(const QColor&); + void setLabelsDistance(int); + void setBackgroundColor(const QColor&); + void setGridColor(const QColor&); + void setDataColors(const QColor&, const QColor&); + QString colorMapFile(); + void setDataColorMap(const QString& fileName); + QwtLinearColorMap *colorMapPointer()/PyName=colorMap/; + void setDataColorMap(const QwtLinearColorMap&); + + void changeTransparency(double) /PyName=setOpacity/; + void setResolution(int); + void showColorLegend(bool = true) /PyName=showLegend/; + void setTitle(const QString&, const QColor& color = QColor(Qt::black), const QFont& font = QFont()); + void setAntialiasing(bool = true); + void setLeftGrid(bool = true); + void setRightGrid(bool = true); + void setCeilGrid(bool = true); + void setFloorGrid(bool = true); + void setFrontGrid(bool = true); + void setBackGrid(bool = true); + + void setFramed(); + void setBoxed(); + void setNoAxes(); + + void setFloorData() /PyName=showFloorProjection/; + void setFloorIsolines() /PyName=showFloorIsolines/; + void setEmptyFloor(); + + void setPolygonStyle(); + void setHiddenLineStyle(); + void setWireframeStyle(); + void setFilledMeshStyle(); + void setDotStyle(); + void setBarStyle(); + void setConeStyle(); + void setCrossStyle(); + + void setConeOptions(double rad, int quality); + void setCrossOptions(double rad, double linewidth, bool smooth, bool boxed); + void setDotOptions(double size, bool smooth); + void setBarRadius(double rad); + void setBarLines(bool lines = true); + void setFilledBars(bool filled = true); + + void animate(bool = true); + void findBestLayout(); + + void changeDataColumn(Table* table, const QString& colName, int = 0) /PyName=setData/; + void addMatrixData(Matrix* ) /PyName=setMatrix/; + void addFunction(const QString&, double, double, double, double, double, double, int = 40, int = 40) /PyName=setFunction/; + void addParametricSurface(const QString&, const QString&, const QString&, double, + double, double, double, int=40, int=40, bool=true, bool=true) /PyName=setParametricSurface/; + + void update(); + + void setXAxisLabel(const QString&); + void setYAxisLabel(const QString&); + void setZAxisLabel(const QString&); + + void setXAxisTickLength(double majorLength, double minorLength); + void setYAxisTickLength(double majorLength, double minorLength); + void setZAxisTickLength(double majorLength, double minorLength); + + void setScales(double xl, double xr, double yl, double yr, double zl, double zr); + + int axisNumericFormat(int axis); + int axisNumericPrecision(int axis); + void setAxisNumericFormat(int axis, int format, int precision); + void setXAxisNumericFormat(int format, int precision); +%MethodCode + sipCpp->setAxisNumericFormat(0, a0, a1); +%End + + void setYAxisNumericFormat(int format, int precision); +%MethodCode + sipCpp->setAxisNumericFormat(1, a0, a1); +%End + + void setZAxisNumericFormat(int format, int precision); +%MethodCode + sipCpp->setAxisNumericFormat(2, a0, a1); +%End + +private: + Graph3D(const Graph3D&); +}; + +class ApplicationWindow: QMainWindow +{ +%TypeHeaderCode +#include "../src/core/ApplicationWindow.h" +%End +%ConvertToSubClassCode +// we have to do this to override casting in qt/qobject.sip + sipClass = sipFindClass(sipCpp->className()); +%End + +public: + enum MatrixToTableConversion{Direct, XYZ, YXZ}; + + Table* table(const QString&); +%MethodCode + sipRes = sipCpp->current_folder->table(*a0, false); + if(!sipRes) + sipRes = sipCpp->projectFolder()->table(*a0, true); +%End + Table* newTable(); + Table* currentTable(); + Table* newTable(const QString&, int=30, int=2); +%MethodCode + sipRes = sipCpp->newTable(*a0, a1, a2); +%End + Matrix* matrix(const QString&); +%MethodCode + sipRes = sipCpp->current_folder->matrix(*a0, false); + if(!sipRes) + sipRes = sipCpp->projectFolder()->matrix(*a0, true); +%End + Matrix* newMatrix(); + Matrix* currentMatrix(); + Matrix* newMatrix(const QString&, int=32, int=32); + MultiLayer *plot(const QString&) /PyName=graph/; +%MethodCode + sipRes = sipCpp->current_folder->graph(*a0, false); + if(!sipRes) + sipRes = sipCpp->projectFolder()->graph(*a0, true); +%End + MultiLayer* currentPlot() /PyName=currentGraph/; + MultiLayer* multilayerPlot(const QString& = "Graph1", int = 1, int = 1, int = 1)/PyName=newGraph/; + + Note *note(const QString&); +%MethodCode + sipRes = sipCpp->current_folder->note(*a0, false); + if(!sipRes) + sipRes = sipCpp->projectFolder()->note(*a0, true); +%End + Note* newNote(const QString& = QString::null); + Note* currentNote(); + MultiLayer *multilayerPlot(Table*, SIP_PYTUPLE, int=1) /PyName=plot/; +%MethodCode + if (a0 == 0) { + sipIsErr = 1; + PyErr_Format(PyExc_ValueError, "Invalid table in argument to plot()."); + } else { + QStringList l; + int n = PyTuple_Size(a1); + for (int i=0; imultilayerPlot(a0, l, a2); + } +%End + MultiLayer *multiLayerPlot(Table*, const QString&, int=1) /PyName=plot/; +%MethodCode + if (a0 == 0) { + sipIsErr = 1; + PyErr_Format(PyExc_ValueError, "Invalid table in argument to plot()."); + } else { + QStringList l; + l << *a1; + sipRes = sipCpp->multilayerPlot(a0, l, a2); + } +%End + + MultiLayer *waterfallPlot(Table*, SIP_PYTUPLE); +%MethodCode + if (a0 == 0) { + sipIsErr = 1; + PyErr_Format(PyExc_ValueError, "Invalid table in argument to waterfallPlot()."); + } else { + QStringList l; + int n = PyTuple_Size(a1); + for (int i=0; iwaterfallPlot(a0, l); + } +%End + + Matrix* importImage(const QString&, bool); + MultiLayer* plotSpectrogram(Matrix*, Graph::CurveType = Graph::ColorMap) /PyName=plot/; + MultiLayer* plotImageProfiles(Matrix*); + MultiLayer* plot(const QString&, double, double, int = 100); +%MethodCode + QStringList l; + l << *a0; + sipRes = sipCpp->newFunctionPlot(l, a1, a2, a3); +%End + + Graph3D *plot3D(const QString&); +%MethodCode + sipRes = sipCpp->current_folder->plot3D(*a0, false); + if(!sipRes) + sipRes = sipCpp->projectFolder()->plot3D(*a0, true); +%End + + Graph3D* newPlot3D(const QString& = QString()); + Graph3D* plotXYZ(Table* table, const QString&, int = 0) /PyName=plot3D/; + Graph3D* plot3DMatrix(Matrix *, int style = 5) /PyName=plot3D/; + Graph3D* plotSurface(const QString&, double xl, double xr, double yl, double yr, + double zl, double zr, int=40, int=40) /PyName=plot3D/; + Graph3D* plotParametricSurface(const QString&, const QString&, const QString&, + double, double, double, double, int=40, int=40, bool=true, bool=true) /PyName=plot3D/; + + QList windowsList() /PyName=windows/; + + // folders + Folder *activeFolder() /NoDerived/; +%MethodCode + sipRes = sipCpp->current_folder; +%End + + Folder* appendProject(const QString& file_name, Folder* parentFolder = 0); + void saveFolder(Folder *folder, const QString& fn, bool=false); + Folder* projectFolder() /PyName=rootFolder/; + + Folder* addFolder(QString name, Folder* parent = 0); + bool deleteFolder(Folder *); + bool changeFolder(Folder *, bool force = false); + bool copyFolder(Folder *src, Folder *dest); + + MdiSubWindow* openTemplate(const QString&); + void saveAsTemplate(MdiSubWindow*, const QString&); + + void setWindowName(MdiSubWindow *, const QString &); + void setPreferences(Graph*); + + void saveProjectAs(const QString& fileName = QString(), bool = false); + MdiSubWindow* clone(MdiSubWindow*); + + Matrix* tableToMatrix(Table* t); + Table* matrixToTable(Matrix* m, MatrixToTableConversion = Direct); + + QTextEdit *resultsLog(); + QString stemPlot(Table *t, const QString& colName, int power = 1001, int startRow = 0, int endRow = -1); + + QMdiArea* workspace(); + Table* importOdfSpreadsheet(const QString& = QString::null, int = -1); + Table* importExcel(const QString& = QString::null, int = -1); + Table* importWaveFile(); + +private: + ApplicationWindow(const ApplicationWindow&); +}; + +class Fit : Filter +{ +%TypeHeaderCode +#include "../src/analysis/Fit.h" +%End +public: + enum Algorithm{ScaledLevenbergMarquardt, UnscaledLevenbergMarquardt, NelderMeadSimplex}; + enum WeightingMethod{NoWeighting, Instrumental, Statistical, Dataset, Direct}; + + Fit(ApplicationWindow* /TransferThis/, Graph*=0, const char*=0); + ~Fit(); + + virtual void fit(); + virtual bool run(); + + bool setWeightingData(WeightingMethod, const QString&=QString::null); + bool setDataFromTable(Table *, const QString&, const QString&, int = 1, int = -1); + void setInterval(double from, double to); + + QString formula(); + QString resultFormula(); + int numParameters(); + QStringList parameterNames(); + + void setInitialGuess(int, double) /PyName=setInitialValue/; + void setInitialGuesses(...) /PyName=setInitialValues/; +%MethodCode +int n = PyTuple_GET_SIZE(a0); +double *values = new double[n]; +for (int i=0; isetInitialGuesses(values); +delete values; +%End + + virtual void guessInitialValues(); + void setParameterRange(int, double, double); + + void setAlgorithm(Algorithm); + void setOutputPrecision(int); + void generateFunction(bool, int=100); + + void showLegend(); + virtual QString legendInfo(); + + void scaleErrors(bool yes = true); + + SIP_PYTUPLE results(); +%MethodCode +double *results = sipCpp->results(); +int size=sipCpp->numParameters(); +sipRes = PyTuple_New(size); +if(sipRes) +{ + for(int i=0; ierrors(); +int size=sipCpp->numParameters(); +sipRes = PyTuple_New(size); +if(sipRes) +{ + for(int i=0; iresiduals(); +int size = sipCpp->dataSize(); +sipRes = PyTuple_New(size); +if(sipRes) +{ + for(int i=0; isetParametersList(l); +%End + // TODO: make it accept Python callables + bool setFormula(const QString&, bool = true); + bool save(const QString&); + bool load(const QString&); +}; + +class PluginFit : Fit +{ +%TypeHeaderCode +#include "../src/analysis/PluginFit.h" +%End +public: + PluginFit(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int); + PluginFit(Table *, const QString&, const QString&, int = 1, int = -1) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipPluginFit(app, a0, *a1, *a2, a3, a4)) +%End + + PluginFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *); + PluginFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double); + PluginFit(ApplicationWindow * /TransferThis/, Graph *, const QString&); + PluginFit(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double); + PluginFit(QwtPlotCurve *) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipPluginFit(app, a0)) +%End + PluginFit(QwtPlotCurve *, double, double) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipPluginFit(app, a0, a1, a2)) +%End + PluginFit(Graph *, const QString&) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipPluginFit(app, a0, *a1)) +%End + PluginFit(Graph *, const QString&, double, double) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipPluginFit(app, a0, *a1, a2, a3)) +%End + bool load(const QString&); +}; + +class MultiPeakFit : Fit +{ +%TypeHeaderCode +#include "../src/analysis/MultiPeakFit.h" +%End +public: + enum PeakProfile{Gauss, Lorentz}; + MultiPeakFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *, PeakProfile=Gauss, int=1); + MultiPeakFit(ApplicationWindow * /TransferThis/, Graph *, PeakProfile=Gauss, int=1); + + int peaks() /PyName=numPeaks/; + void setNumPeaks(int); + + void enablePeakCurves(bool); + void setPeakCurvesColor(int); + + static QString generateFormula(int, PeakProfile); + static QStringList generateParameterList(int); + + void guessInitialValues(); +}; + +class LorentzFit : MultiPeakFit +{ +%TypeHeaderCode +#include "../src/analysis/MultiPeakFit.h" +%End +public: + LorentzFit(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int); + LorentzFit(Table *, const QString&, const QString&, int = 1, int = -1) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipLorentzFit(app, a0, *a1, *a2, a3, a4)) +%End + + LorentzFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *); + LorentzFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double); + LorentzFit(ApplicationWindow * /TransferThis/, Graph *, const QString&); + LorentzFit(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double); + LorentzFit(QwtPlotCurve *) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipLorentzFit(app, a0)) +%End + LorentzFit(QwtPlotCurve *, double, double) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipLorentzFit(app, a0, a1, a2)) +%End + LorentzFit(Graph *, const QString&) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipLorentzFit(app, a0, *a1)) +%End + LorentzFit(Graph *, const QString&, int, int) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipLorentzFit(app, a0, *a1, a2, a3)) +%End +}; + +class GaussFit : MultiPeakFit +{ +%TypeHeaderCode +#include "../src/analysis/MultiPeakFit.h" +%End +public: + GaussFit(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int); + GaussFit(Table *, const QString&, const QString&, int = 1, int = -1) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipGaussFit(app, a0, *a1, *a2, a3, a4)) +%End + + GaussFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *); + GaussFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double); + GaussFit(ApplicationWindow * /TransferThis/, Graph *, const QString&); + GaussFit(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double); + GaussFit(QwtPlotCurve *) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipGaussFit(app, a0)) +%End + GaussFit(QwtPlotCurve *, double, double) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipGaussFit(app, a0, a1, a2)) +%End + GaussFit(Graph *, const QString&) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipGaussFit(app, a0, *a1)) +%End + GaussFit(Graph *, const QString&, double, double) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipGaussFit(app, a0, *a1, a2, a3)) +%End +}; + +class PolynomialFit : Fit +{ +%TypeHeaderCode +#include "../src/analysis/PolynomialFit.h" +%End +public: + PolynomialFit(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int, int, bool); + PolynomialFit(Table *, const QString&, const QString&, int = 1, int = -1, int = 2, bool = false) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipPolynomialFit(app, a0, *a1, *a2, a3, a4, a5, a6)) +%End + + PolynomialFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *, int=2, bool=false); + PolynomialFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double, int=2, bool=false); + PolynomialFit(ApplicationWindow * /TransferThis/, Graph *, QString&, int=2, bool=false); + PolynomialFit(ApplicationWindow * /TransferThis/, Graph *, QString&, double, double, int=2, bool=false); + PolynomialFit(QwtPlotCurve *, int=2, bool=false) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipPolynomialFit(app, a0, a1, a2)) +%End + PolynomialFit(QwtPlotCurve *, double, double, int=2, bool=false) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipPolynomialFit(app, a0, a1, a2, a3, a4)) +%End + PolynomialFit(Graph *, QString&, int=2, bool=false) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipPolynomialFit(app, a0, *a1, a2, a3)) +%End + PolynomialFit(Graph *, QString&, double, double, int=2, bool=false) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipPolynomialFit(app, a0, *a1, a2, a3, a4, a5)) +%End + + virtual QString legendInfo(); + void fit(); + + static QString generateFormula(int); + static QStringList generateParameterList(int); +}; + +class LinearFit : Fit +{ +%TypeHeaderCode +#include "../src/analysis/PolynomialFit.h" +%End +public: + LinearFit(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int); + LinearFit(Table *, const QString&, const QString&, int = 1, int = -1) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipLinearFit(app, a0, *a1, *a2, a3, a4)) +%End + + LinearFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *); + LinearFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double); + LinearFit(ApplicationWindow * /TransferThis/, Graph *, const QString&); + LinearFit(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double); + LinearFit(QwtPlotCurve *) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipLinearFit(app, a0)) +%End + LinearFit(QwtPlotCurve *, double, double) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipLinearFit(app, a0, a1, a2)) +%End + LinearFit(Graph *, const QString&) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipLinearFit(app, a0, *a1)) +%End + LinearFit(Graph *, const QString&, double, double) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipLinearFit(app, a0, *a1, a2, a3)) +%End + void fit(); +}; + +class Filter : QObject +{ +%TypeHeaderCode +#include "../src/analysis/Filter.h" +%End +public: + Filter(ApplicationWindow* /TransferThis/, Graph*=0, const char*=0); + ~Filter(); + + void setOutputPoints(int); + void setTolerance(double); + void setMaximumIterations(int); + + void setColor(int); + void setColor(const QString&); + void setColor(const QColor&); + + bool setDataFromCurve(QwtPlotCurve *c); + bool setDataFromCurve(QwtPlotCurve *c, double from, double to); + bool setDataFromCurve(const QString&, Graph*=0); + bool setDataFromCurve(const QString& curveTitle, double from, double to, Graph *g = 0); + virtual bool setDataFromTable(Table *t, const QString& xColName, const QString& yColName, int from = 1, int to = -1); + + Table *resultTable(); + + virtual void enableGraphicsDisplay(bool on = true, Graph *g = 0); + virtual bool run(); +}; + +class Differentiation : Filter +{ +%TypeHeaderCode +#include "../src/analysis/Differentiation.h" +%End +public: + Differentiation(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int); + Differentiation(Table *, const QString&, const QString&, int = 1, int = -1) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipDifferentiation(app, a0, *a1, *a2, a3, a4)) +%End + + Differentiation(ApplicationWindow * /TransferThis/, QwtPlotCurve *); + Differentiation(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double); + Differentiation(ApplicationWindow * /TransferThis/, Graph *, const QString&); + Differentiation(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double); + Differentiation(QwtPlotCurve *, double, double) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipDifferentiation(app, a0, a1, a2)) +%End + Differentiation(QwtPlotCurve *) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipDifferentiation(app, a0)) +%End + Differentiation(Graph *, const QString&) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipDifferentiation(app, a0, *a1)) +%End + Differentiation(Graph *, const QString&, double, double) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipDifferentiation(app, a0, *a1, a2, a3)) +%End + bool run(); +}; + +class Integration : Filter +{ +%TypeHeaderCode +#include "../src/analysis/Integration.h" +%End +public: + Integration(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int); + Integration(Table *, const QString&, const QString&, int = 1, int = -1) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipIntegration(app, a0, *a1, *a2, a3, a4)) +%End + + Integration(ApplicationWindow * /TransferThis/, QwtPlotCurve *); + Integration(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double); + Integration(ApplicationWindow * /TransferThis/, Graph *, const QString&); + Integration(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double); + Integration(QwtPlotCurve *) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipIntegration(app, a0)) +%End + Integration(QwtPlotCurve *, double, double) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipIntegration(app, a0, a1, a2)) +%End + Integration(Graph *, const QString&) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipIntegration(app, a0, *a1)) +%End + Integration(Graph *, const QString&, double, double) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipIntegration(app, a0, *a1, a2, a3)) +%End + + void enableGraphicsDisplay(bool on = true, Graph *g = 0); + void setMethodOrder(int n); + bool run(); + + double area(); +}; + +class Interpolation : Filter +{ +%TypeHeaderCode +#include "../src/analysis/Interpolation.h" +%End +public: + enum InterpolationMethod{Linear, Cubic, Akima}; + + Interpolation(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int, int); + Interpolation(Table *, const QString&, const QString&, int = 1, int = -1, int = 0) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipInterpolation(app, a0, *a1, *a2, a3, a4, a5)) +%End + + Interpolation(ApplicationWindow * /TransferThis/, QwtPlotCurve *, int=0); + Interpolation(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double, int=0); + Interpolation(ApplicationWindow * /TransferThis/, Graph *, const QString&, int=0); + Interpolation(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double, int=0); + Interpolation(QwtPlotCurve *, int=0) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipInterpolation(app, a0, a1)) +%End + Interpolation(QwtPlotCurve *, double, double, int=0) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipInterpolation(app, a0, a1, a2, a3)) +%End + Interpolation(Graph *, const QString&, int=0) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipInterpolation(app, a0, *a1, a2)) +%End + Interpolation(Graph *, const QString&, double, double, int=0) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipInterpolation(app, a0, *a1, a2, a3, a4)) +%End + + void setMethod(int n); + bool run(); +}; + +class SmoothFilter : Filter +{ +%TypeHeaderCode +#include "../src/analysis/SmoothFilter.h" +%End +public: + enum SmoothMethod{SavitzkyGolay = 1, FFT = 2, Average = 3, Lowess = 4}; + + SmoothFilter(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int, int); + SmoothFilter(Table *, const QString&, const QString&, int = 1, int = -1, int = 3) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipSmoothFilter(app, a0, *a1, *a2, a3, a4, a5)) +%End + + SmoothFilter(ApplicationWindow * /TransferThis/, QwtPlotCurve *, int = 3); + SmoothFilter(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double, int = 3); + SmoothFilter(ApplicationWindow * /TransferThis/, Graph *, const QString&, int=3); + SmoothFilter(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double, int=3); + SmoothFilter(QwtPlotCurve *, int=3) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipSmoothFilter(app, a0, a1)) +%End + SmoothFilter(QwtPlotCurve *, double, double, int=3) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipSmoothFilter(app, a0, a1, a2, a3)) +%End + SmoothFilter(Graph *, const QString&, int=3) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipSmoothFilter(app, a0, *a1, a2)) +%End + SmoothFilter(Graph *, const QString&, double, double, int=3) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipSmoothFilter(app, a0, *a1, a2, a3, a4)) +%End + + void setMethod(int); + void setSmoothPoints(int, int = 0); + void setPolynomOrder(int); + void setLowessParameter(double f, int iterations); + bool run(); +}; + +class FFTFilter : Filter +{ +%TypeHeaderCode +#include "../src/analysis/FFTFilter.h" +%End +public: + enum FilterType{LowPass = 1, HighPass = 2, BandPass = 3, BandBlock = 4}; + + FFTFilter(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int, int); + FFTFilter(Table *, const QString&, const QString&, int = 1, int = -1, int = 1) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipFFTFilter(app, a0, *a1, *a2, a3, a4, a5)) +%End + + FFTFilter(ApplicationWindow * /TransferThis/, QwtPlotCurve *, int = 1); + FFTFilter(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double, int = 1); + FFTFilter(ApplicationWindow * /TransferThis/, Graph *, const QString&, int=1); + FFTFilter(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double, int=1); + FFTFilter(QwtPlotCurve *, int=1) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipFFTFilter(app, a0, a1)) +%End + FFTFilter(QwtPlotCurve *, double, double, int=1) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipFFTFilter(app, a0, a1, a2, a3)) +%End + FFTFilter(Graph *, const QString&, int=1) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipFFTFilter(app, a0, *a1, a2)) +%End + FFTFilter(Graph *, const QString&, double, double, int=1) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipFFTFilter(app, a0, *a1, a2, a3, a4)) +%End + + void setFilterType(int); + void setCutoff(double); + void setBand(double, double); + void enableOffset(bool=true); + + bool run(); +}; + +class FFT : Filter +{ +%TypeHeaderCode +#include "../src/analysis/FFT.h" +%End +public: + + FFT(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString& = QString(), int = 1, int = -1); + FFT(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double); + FFT(ApplicationWindow * /TransferThis/, Graph *, const QString&); + FFT(ApplicationWindow * /TransferThis/, QwtPlotCurve *); + FFT(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double); + + FFT(Table *, const QString&, const QString& = QString(), int = 1, int = -1) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipFFT(app, a0, *a1, *a2, a3, a4)) +%End + FFT(Graph *, const QString&) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipFFT(app, a0, *a1)) +%End + FFT(Graph *, const QString&, double, double) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipFFT(app, a0, *a1, a2, a3)) +%End + FFT(QwtPlotCurve *&) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipFFT(app, a0)) +%End + FFT(QwtPlotCurve *&, double, double) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipFFT(app, a0, a1, a2)) +%End + + void setInverseFFT(bool=true); + void setSampling(double); + void normalizeAmplitudes(bool=true); + void shiftFrequencies(bool=true); + + bool run(); +}; + +class Correlation : Filter +{ +%TypeHeaderCode +#include "../src/analysis/Correlation.h" +%End +public: + + Correlation(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int); + Correlation(Table *, const QString&, const QString&, int = 1, int = -1) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipCorrelation(app, a0, *a1, *a2, a3, a4)) +%End + + bool setDataFromTable(Table *, const QString&, const QString&, int = 1, int = -1); + bool run(); +}; + +class Convolution : Filter +{ +%TypeHeaderCode +#include "../src/analysis/Convolution.h" +%End +public: + + Convolution(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&); + Convolution(Table *, const QString&, const QString&) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipConvolution(app, a0, *a1, *a2)) +%End + + void setDataFromTable(Table *, const QString&, const QString&); + bool run(); +}; + +class Deconvolution : Filter +{ +%TypeHeaderCode +#include "../src/analysis/Convolution.h" +%End +public: + + Deconvolution(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&); + Deconvolution(Table *, const QString&, const QString&) /NoDerived/; +%MethodCode + SIPQTI_APP(new sipDeconvolution(app, a0, *a1, *a2)) +%End + + void setDataFromTable(Table *, const QString&, const QString&); + bool run(); +}; + +// used for output redirection +class PythonScripting +{ +%TypeHeaderCode +#include "../src/scripting/PythonScripting.h" +%End +public: + void write(const QString&); +private: + PythonScripting(const PythonScripting&); +}; +class PythonScript +{ +%TypeHeaderCode +#include "../src/scripting/PythonScript.h" +%End +public: + void write(const QString&); +private: + PythonScript(const PythonScript&); +}; + +class Folder : QObject +{ +%TypeHeaderCode +#include "../src/core/Folder.h" +%End +public: + QList windowsList() /PyName=windows/; +// TODO: implement signal Folder::nameChanged and make it update the project explorer; adjust renaming from GUI accordingly +// void setFolderName(const QString&) /PyName=setName/; + QString name(); + QString path(); + + QList folders(); + Folder *findSubfolder(const QString&, bool=true, bool=false) /PyName=folder/; + MdiSubWindow* findWindow(const QString&, bool=true, bool=true, bool=false, bool=true); + + MdiSubWindow *window(const QString &name, const char *cls="MdiSubWindow", bool recursive=false); + Table *table(const QString &name, bool recursive=false); + Matrix *matrix(const QString &name, bool recursive=false); + MultiLayer *graph(const QString &name, bool recursive=false); + Note *note(const QString &name, bool recursive=false); + Graph3D *plot3D(const QString &name, bool recursive=false); + + Folder* rootFolder(); + + QString logInfo(); + void appendLogInfo(const QString&); + void clearLogInfo(); + +private: + Folder(const Folder&); +}; === removed file 'qtiplot/src/scripting/qti.sip' --- qtiplot/src/scripting/qti.sip 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/qti.sip 1970-01-01 00:00:00 +0000 @@ -1,2824 +0,0 @@ -/* vim: set filetype=cpp : */ -/* due to a limitation of sip, this file has to use Unix style line endings */ -/*************************************************************************** - File : qti.sip - Project : QtiPlot --------------------------------------------------------------------- - Copyright : (C) 2006 by Knut Franke, Ion Vasilief, Michael Roemer - Email : knut.franke*gmx.de, ion_vasilief*yahoo.fr, roemer*nano.uni-hannover.de - Description : Specifications for Python bindings - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -%Module qti 0 -%Import QtCore/QtCoremod.sip -%Import QtGui/QtGuimod.sip - -class ScriptEdit: QTextEdit -{ -%TypeHeaderCode -#include "../src/scripting/ScriptEdit.h" -%End -public slots: - void print(); - void insertFunction(const QString &); - void exportPDF(const QString& fileName); - QString save(); - QString exportASCII(const QString &file=QString::null)/PyName=saveAs/; - QString importASCII(const QString &file=QString::null); - -private: - ScriptEdit(ScriptEdit&); -}; - -class MdiSubWindow: QMdiSubWindow /PyName=MDIWindow/ -{ -%TypeHeaderCode -#include "../src/core/MdiSubWindow.h" -%End -public: - enum CaptionPolicy{Name = 0, Label = 1, Both = 2}; - - SIP_PYOBJECT windowLabel(); -%MethodCode - sipRes = PyString_FromString(sipCpp->windowLabel()); -%End - void setWindowLabel(const QString&); - - CaptionPolicy captionPolicy(); - void setCaptionPolicy(CaptionPolicy); - - virtual void restore(const QStringList& ); - Folder* folder(); - - void askOnCloseEvent(bool)/PyName=confirmClose/; - -private: - MdiSubWindow(const MdiSubWindow&); -}; - -class Table: MdiSubWindow -{ -%TypeHeaderCode -#include "../src/table/Table.h" -#include -#define CHECK_TABLE_COL(arg)\ - int col;\ - if (PyInt_Check(arg)) {\ - col = (int)PyInt_AsLong(arg) - 1;\ - if (col < 0 || col >= sipCpp->numCols()) {\ - sipIsErr = 1;\ - PyErr_Format(PyExc_ValueError, "There's no column %d in table %s!", col+1, sipCpp->name().ascii());\ - }\ - } else {\ - PyObject *tmp = PyObject_Str(arg);\ - if (!tmp) {\ - sipIsErr = 1;\ - PyErr_Format(PyExc_TypeError, "Column argument must be either int or string.");\ - } else {\ - col = sipCpp->colNames().findIndex(PyString_AsString(tmp));\ - if (col < 0) {\ - sipIsErr = 1;\ - PyErr_Format(PyExc_ValueError, "There's no column named %s in table %s!", PyString_AsString(tmp),\ - sipCpp->name().ascii());\ - Py_DECREF(tmp);\ - }\ - }\ - } - -#define CHECK_TABLE_ROW(arg)\ - int row = arg-1;\ - if (row < 0 || row >= sipCpp->numRows()) {\ - sipIsErr = 1;\ - PyErr_Format(PyExc_ValueError, "There's no row %d in table %s!", row+1, sipCpp->name().ascii());\ - } - -static int setCellDataHelper(Table* table, int row, int col, PyObject* item) { - if (item == Py_None) { - table->clearCell(row, col); - return 0; - } - switch (table->columnType(col)) { - case Table::Numeric: - item = PyNumber_Float(item); - if (item) { - table->setCell(row, col, PyFloat_AsDouble(item)); - Py_DECREF(item); - } - else { - PyErr_Format(PyExc_TypeError, "Can't convert item %d into a float!", col); - return 1; - } - break; - case Table::Text: - item = PyObject_Str(item); - if (item) { - table->setText(row, col, PyString_AsString(item)); - Py_DECREF(item); - } - else { - PyErr_Format(PyExc_TypeError, "Can't convert item %d into a string!", col); - return 1; - } - break; - default: - PyErr_Format(PyExc_ValueError, "Type %d of column %d in table %s not supported!", - table->columnType(col), col+1, table->name().ascii()); - return 1; - break; - } // switch column type - return 0; // everything ok -} - -static int cellDataHelper(Table* table, int row, int col, PyObject** item) { - switch (table->columnType(col)) { - case Table::Numeric: - if (table->text(row, col).isEmpty()) - *item = Py_None; - else - *item = PyFloat_FromDouble(table->cell(row, col)); - break; - case Table::Text: - *item = PyString_FromString(table->text(row, col)); - break; - default: - *item = NULL; - PyErr_Format(PyExc_ValueError, "Type %d of column %d in table %s not supported!", - table->columnType(col), col+1, table->name().ascii()); - return 1; - break; - } // switch column type - return 0; // everything ok -} -%End - -public: - enum PlotDesignation{None = 0, X = 1, Y = 2, Z = 3, xErr = 4, yErr = 5, Label = 6}; - enum ImportMode{NewColumns, NewRows, Overwrite}; - enum NumericFormat{Default = 0, Decimal = 1, Scientific = 2}; - - int numRows(); - int __len__(); -%MethodCode - sipRes = sipCpp->numRows(); -%End - int numCols(); - void resizeRows(int) /PyName=setNumRows/; - void resizeCols(int) /PyName=setNumCols/; - - void deleteRows(int, int); - void __delitem__(int); -%MethodCode - int len = sipCpp->numRows(); - if ((a0 = (int)sipConvertFromSequenceIndex(a0, len)) < 0) - sipIsErr = 1; - else - sipCpp->deleteRows(a0 + 1, a0 + 1); // start and stop are equal, counting starts at 1 -%End - void __delitem__(SIP_PYSLICE); -%MethodCode - SIP_SSIZE_T len, start, stop, step, slicelength, i; - len = sipCpp->numRows(); - if (PySlice_GetIndicesEx((PySliceObject *)a0, len, &start, &stop, &step, &slicelength) < 0) - sipIsErr = 1; - else { - start += 1; // row index starts at 1 (python at 0); the stop is inclusive (python exclusive) so no need to change - if (step == 1) - sipCpp->deleteRows(start, stop); - else { - for (int i = 0; i < slicelength; i++) { - sipCpp->deleteRows(start, start); - start += step - 1; // the "- 1" is needed since the removal also shifts the index - } - } - } -%End - - SIP_PYOBJECT text(SIP_PYOBJECT, int); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - CHECK_TABLE_ROW(a1); - if (sipIsErr == 0) { - PyObject *encstr = PyString_FromString(sipCpp->text(row, col).utf8()); - if (encstr) { - sipRes = PyUnicode_FromEncodedObject(encstr, "utf8", 0); - Py_DECREF(encstr); - } else { - sipRes = NULL; - sipIsErr = 1; - } - } -%End - - void removeCol(SIP_PYOBJECT); -%MethodCode - sipIsErr=0; - CHECK_TABLE_COL(a0); - if (sipIsErr==0) - { - QStringList list; - list << "_" + sipCpp->colLabel(col); - sipCpp->removeCol(list); - } -%End - - double cell(SIP_PYOBJECT, int); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - CHECK_TABLE_ROW(a1); - if (sipIsErr == 0){ - if (sipCpp->text(row, col) != "") - sipRes = sipCpp->cell(row, col); - else { - sipRes = NULL; - PyErr_SetString(PyExc_ValueError, "Empty table cell"); - } - } -%End - SIP_PYOBJECT cellData(SIP_PYOBJECT, int); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - CHECK_TABLE_ROW(a1); - if (sipIsErr == 0) - sipIsErr = cellDataHelper(sipCpp, row, col, &sipRes); -%End - SIP_PYTUPLE rowData(int); -%MethodCode - PyObject *item; - sipIsErr = 0; - CHECK_TABLE_ROW(a0); - if (sipIsErr == 0){ - int size = sipCpp->numCols(); - sipRes = PyTuple_New(size); - for(int col = 0; col < size; col++) { - sipIsErr = cellDataHelper(sipCpp, row, col, &item); - if (sipIsErr == 0) - PyTuple_SET_ITEM(sipRes, col, item); - else { - Py_DECREF(sipRes); - sipRes = NULL; - break; - } - } // for each col - } // if not sip error -%End - SIP_PYTUPLE __getitem__(int); // this is operator[] -%MethodCode - SIP_SSIZE_T idx = sipConvertFromSequenceIndex(a0, sipCpp->numRows()); - if (idx < 0) - sipIsErr = 1; - else { - sipRes = PyObject_CallMethod(sipSelf, "rowData", "i", idx + 1); // rowData's index starts at 1 - if (sipRes == NULL) - sipIsErr = 1; - } -%End - SIP_PYTUPLE __getitem__(SIP_PYSLICE); // this is operator[] -%MethodCode - SIP_SSIZE_T len, start, stop, step, slicelength, i; - len = sipCpp->numRows(); - if (PySlice_GetIndicesEx((PySliceObject *)a0, len, &start, &stop, &step, &slicelength) < 0) - sipIsErr = 1; - else { - PyObject *item; - sipRes = PyList_New(slicelength); - for(int i = 0; i < slicelength; i++) { - item = PyObject_CallMethod(sipSelf, "rowData", "i", start + 1); // rowData's index starts at 1 - start += step; - if (item) - PyList_SET_ITEM(sipRes, i, item); - else { - Py_DECREF(sipRes); - sipRes = NULL; - sipIsErr = 1; - break; - } - } // for - } -%End - SIP_PYLIST colData(SIP_PYOBJECT); -%MethodCode - PyObject *item; - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (sipIsErr == 0){ - int size = sipCpp->numRows(); - sipRes = PyList_New(size); - for(int row = 0; row < size; row++) { - sipIsErr = cellDataHelper(sipCpp, row, col, &item); - if (sipIsErr == 0) - PyList_SET_ITEM(sipRes, row, item); - else { - Py_DECREF(sipRes); - sipRes = NULL; - break; - } - } // for - } // if not sip error -%End - void setRowData(int, SIP_PYTUPLE); -%MethodCode - PyObject *item; - sipIsErr = 0; - CHECK_TABLE_ROW(a0); - int n = PyTuple_Size(a1); - int size = sipCpp->numCols(); - if (n != size) { - sipIsErr = 1; - PyErr_SetString(PyExc_ValueError, "The argument length must match the table's column count!"); - } - if (sipIsErr == 0){ - for(int col = 0; col < size; col++) { - item = PyTuple_GET_ITEM(a1, col); - sipIsErr = setCellDataHelper(sipCpp, row, col, item); - if (sipIsErr) - break; - } // for each col - } // if not sip error -%End - void __setitem__(int, SIP_PYTUPLE); -%MethodCode - SIP_SSIZE_T idx = sipConvertFromSequenceIndex(a0, sipCpp->numRows()); - if (idx < 0) - sipIsErr = 1; - else { - PyObject* methodName = PyString_FromString("setRowData"); - PyObject* rowNumber = PyInt_FromLong(idx + 1); // setRowData's index starts at 1 - PyObject* ret = PyObject_CallMethodObjArgs(sipSelf, methodName, rowNumber, a1, NULL); - if (ret == NULL) - sipIsErr = 1; - else - Py_DECREF(ret); - Py_DECREF(rowNumber); - Py_DECREF(methodName); - } -%End - int appendRowData(SIP_PYTUPLE); -%MethodCode - sipRes = sipCpp->numRows() + 1; - sipCpp->resizeRows(sipRes); - PyObject* methodName = PyString_FromString("setRowData"); - PyObject* rowNumber = PyInt_FromLong(sipRes); - PyObject* ret = PyObject_CallMethodObjArgs(sipSelf, methodName, rowNumber, a0, NULL); - if (ret == NULL) - sipIsErr = 1; - else - Py_DECREF(ret); - Py_DECREF(rowNumber); - Py_DECREF(methodName); -%End - void setColData(SIP_PYOBJECT, SIP_PYLIST, int=0); // a2 can be used as an offset -%MethodCode - PyObject *item; - sipIsErr = 0; - CHECK_TABLE_COL(a0); - int listSize = PyList_Size(a1); - int tableLength = sipCpp->numRows(); - if (sipIsErr == 0){ - int colType = sipCpp->columnType(col); - for(int row = a2, idx = 0; row < tableLength; row++, idx++) { - if (idx >= listSize) { - sipIsErr = 1; - PyErr_SetString(PyExc_StopIteration, "List argument ended before all rows were filled!"); - break; - } - item = PyList_GET_ITEM(a1, idx); - sipIsErr = setCellDataHelper(sipCpp, row, col, item); - if (sipIsErr) - break; - } // for each col - } // if not sip error -%End - void setText(SIP_PYOBJECT, int, const QString&); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - CHECK_TABLE_ROW(a1); - if (sipIsErr == 0) - sipCpp->setText(row, col, *a2); -%End - void setCell(SIP_PYOBJECT, int, double); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - CHECK_TABLE_ROW(a1); - if (sipIsErr == 0) - sipCpp->setCell(row, col, a2); -%End - void setCellData(SIP_PYOBJECT, int, SIP_PYOBJECT); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - CHECK_TABLE_ROW(a1); - if (sipIsErr == 0) - sipIsErr = setCellDataHelper(sipCpp, row, col, a2); -%End - SIP_PYOBJECT colName(int); -%MethodCode - if (a0 < 1 || a0 > sipCpp->numCols()) {\ - sipIsErr = 1;\ - PyErr_SetString(PyExc_ValueError, "Invalid column argument");\ - } else - sipRes = PyString_FromString(sipCpp->colLabel(a0-1)); -%End - SIP_PYTUPLE colNames(); -%MethodCode - QStringList l = sipCpp->colNames(); - int size = l.length(); - sipRes = PyTuple_New(size); - if(sipRes) { - for(int i=0; isetColName(col, *a1, a2); -%End - void setHeader(QStringList header)/PyName=setColNames/; - void notifyChanges(); - - void importASCII(const QString&, const QString&="\t", int=0, bool=false, - bool=true, bool=false, bool=false, const QString&="#", bool=false, - ImportMode = Overwrite, int = 0, int = -1); - bool exportASCII(const QString&, const QString&="\t", bool=false, bool=false, bool=false); - - void setDecimalSeparators(int,bool=true); -%MethodCode - QLocale locale; - switch (a0){ - case 0: - locale = QLocale::system(); - break; - case 1: - locale = QLocale::c(); - break; - case 2: - locale = QLocale(QLocale::German); - break; - case 3: - locale = QLocale(QLocale::French); - break; - } - if (a1==true) - locale.setNumberOptions(QLocale::OmitGroupSeparator); - - sipCpp->updateDecimalSeparators(locale); -%End - - void normalizeCol(SIP_PYOBJECT) /PyName=normalize/; -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (sipIsErr == 0) - sipCpp->normalizeCol(col); -%End - void normalize(); - - void sortColumn(SIP_PYOBJECT, int order = 0); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (sipIsErr == 0) - sipCpp->sortColumn(col, a1); -%End - void sort(int type = 0, int order = 0, const QString& leadCol = QString()); - void sortColumns(SIP_PYTUPLE, int=0, int=0, const QString&=QString()); -%MethodCode - QStringList l; - int n = PyTuple_Size(a0); - for (int i=0; isortColumns(l, a1, a2, *a3); -%End - - void setCommand(SIP_PYOBJECT, const QString&); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (sipIsErr == 0) - sipCpp->setCommand(col, *a1); -%End - bool calculate(SIP_PYOBJECT col, int startRow = 1, int endRow = -1, bool forceMuParser = false, bool notifyChanges = true)/PyName=recalculate/; -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (a2 == -1) - a2 = sipCpp->numRows(); - if (sipIsErr == 0) - sipCpp->calculate(col, a1 - 1, a2 - 1, a3, a4); // row indes starts at 0 -%End - - QString comment(SIP_PYOBJECT); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (sipIsErr == 0) - return Py_BuildValue("s", sipCpp->comment(col).toAscii().constData()); -%End - - void setComment(SIP_PYOBJECT, const QString&); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (sipIsErr == 0) - sipCpp->setColComment(col, *a1); -%End - - void showComments(bool on = true); - - void setReadOnlyColumn(SIP_PYOBJECT, bool = true); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (sipIsErr == 0) - sipCpp->setReadOnlyColumn(col, a1); -%End - - void setColumnRole(SIP_PYOBJECT, PlotDesignation); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (sipIsErr == 0){ - sipCpp->setColPlotDesignation(col, a1); - sipCpp->setHeaderColType(); - } -%End - - void setColTextFormat(SIP_PYOBJECT); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (sipIsErr == 0) - sipCpp->setTextFormat(col); -%End - - void setColNumericFormat(SIP_PYOBJECT, int, int, bool = true); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (sipIsErr == 0) - sipCpp->setColNumericFormat(a1, a2, col, a3); -%End - - void setColDateFormat(SIP_PYOBJECT, const QString&, bool = true); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (sipIsErr == 0) - sipCpp->setDateFormat(*a1, col, a2); -%End - - void setColTimeFormat(SIP_PYOBJECT, const QString&, bool = true); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (sipIsErr == 0) - sipCpp->setTimeFormat(*a1, col, a2); -%End - - void setColMonthFormat(SIP_PYOBJECT, const QString&, bool = true); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (sipIsErr == 0) - sipCpp->setMonthFormat(*a1, col, a2); -%End - - void setColDayFormat(SIP_PYOBJECT, const QString&, bool = true); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (sipIsErr == 0) - sipCpp->setDayFormat(*a1, col, a2); -%End - - void setColumnWidth(SIP_PYOBJECT, int); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (sipIsErr == 0) - sipCpp->setColumnWidth(col, a1); -%End - - void showAllColumns(); - void hideColumn(SIP_PYOBJECT, bool = true); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (sipIsErr == 0) - sipCpp->hideColumn(col, a1); -%End - - bool isRowSelected(int, bool = false); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_ROW(a0); - if (sipIsErr == 0) - return Py_BuildValue("b",sipCpp->isRowSelected(row, a1)); - -%End - - bool isColumnSelected(SIP_PYOBJECT, bool = false)/PyName=isColSelected/; -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (sipIsErr == 0) - return Py_BuildValue("b",sipCpp->isColumnSelected(col, a1)); -%End - - int firstSelectedColumn(); - int numSelectedRows(); - - void setSelectedCol(SIP_PYOBJECT); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (sipIsErr == 0) - sipCpp->setSelectedCol(col); -%End - - int selectedColumn(); - - void addCol(PlotDesignation pd = Y)/PyName=addColumn/; - int addRow(); -%MethodCode - sipRes = sipCpp->numRows() + 1; - sipCpp->resizeRows(sipRes); -%End - void insertColumns(SIP_PYOBJECT, int); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - if (sipIsErr == 0) - sipCpp->insertCols(col, a1); -%End - - void swapColumns(SIP_PYOBJECT, SIP_PYOBJECT); -%MethodCode - sipIsErr = 0; - CHECK_TABLE_COL(a0); - - int col2; - if (PyInt_Check(a1)) { - col2 = (int)PyInt_AsLong(a1) - 1; - if (col2 < 0 || col2 >= sipCpp->numCols()) { - sipIsErr = 1; - PyErr_Format(PyExc_ValueError, "There's no column %d in table %s!", col2+1, sipCpp->name().ascii()); - } - } else { - PyObject *tmp = PyObject_Str(a1); - if (!tmp) { - sipIsErr = 1; - PyErr_Format(PyExc_TypeError, "Column argument must be either int or string."); - } else { - col2 = sipCpp->colNames().findIndex(PyString_AsString(tmp)); - if (col2 < 0) { - sipIsErr = 1; - PyErr_Format(PyExc_ValueError, "There's no column named %s in table %s!", PyString_AsString(tmp),sipCpp->name().ascii()); - Py_DECREF(tmp); - } - } - } - - if (sipIsErr == 0) - sipCpp->swapColumns(col, col2); -%End - -private: - Table(const Table&); -}; - -class QwtLinearColorMap /PyName=LinearColorMap/ -{ -%TypeHeaderCode -#include -%End -public: - - enum Format{RGB, Indexed}; - enum Mode {FixedColors, ScaledColors}; - QwtLinearColorMap(const QColor &, const QColor &, QwtLinearColorMap::Format=QwtColorMap::RGB); - - void addColorStop (double, const QColor &); - void setMode (Mode); - - void setColorInterval (const QColor &, const QColor &); - QColor color1() const; - QColor color2() const; - -private: - QwtLinearColorMap(const QwtLinearColorMap&); -}; - -class Matrix: MdiSubWindow -{ -%TypeHeaderCode -#include "../src/matrix/Matrix.h" -#define CHECK_MATRIX_COL(arg)\ - int col = arg-1;\ - if (col < 0 || col >= sipCpp->numCols()) {\ - sipIsErr = 1;\ - PyErr_Format(PyExc_ValueError, "There's no column %d in matrix %s!", col+1, sipCpp->name().ascii());\ - } -#define CHECK_MATRIX_ROW(arg)\ - int row = arg-1;\ - if (row < 0 || row >= sipCpp->numRows()) {\ - sipIsErr = 1;\ - PyErr_Format(PyExc_ValueError, "There's no row %d in matrix %s!", row+1, sipCpp->name().ascii());\ - } -%End -public: - enum HeaderViewType{ColumnRow, XY}; - enum ViewType{TableView, ImageView}; - enum ImportMode{NewColumns, NewRows, Overwrite}; - - int numRows(); - void setNumRows(int); - int numCols(); - void setNumCols(int); - void setDimensions(int rows, int cols); - - SIP_PYOBJECT text(int, int); -%MethodCode - sipIsErr = 0; - CHECK_MATRIX_ROW(a0); - CHECK_MATRIX_COL(a1); - if (sipIsErr == 0) - sipRes = PyString_FromString(sipCpp->text(row, col)); -%End - double cell(int, int); -%MethodCode - sipIsErr = 0; - CHECK_MATRIX_ROW(a0); - CHECK_MATRIX_COL(a1); - if (sipIsErr == 0) - sipRes = sipCpp->cell(row, col); -%End - void setText(int, int, const QString&); -%MethodCode - sipIsErr = 0; - CHECK_MATRIX_ROW(a0); - CHECK_MATRIX_COL(a1); - if (sipIsErr == 0) - sipCpp->setText(row, col, *a2); -%End - void setCell(int, int, double); -%MethodCode - sipIsErr = 0; - CHECK_MATRIX_ROW(a0); - CHECK_MATRIX_COL(a1); - if (sipIsErr == 0) - sipCpp->setCell(row, col, a2); -%End - - double dx(); - double dy(); - double xStart(); - double xEnd(); - double yStart(); - double yEnd(); - void setCoordinates(double xs, double xe, double ys, double ye); - - void setFormula(const QString &); - bool calculate(int startRow = 0, int endRow = -1, int startCol = 0, int endCol = -1, bool muParser = true); - - void setNumericPrecision(int prec); - - void transpose(); - void invert(); - void flipVertically(); - void flipHorizontally(); - void rotate90(bool = true); - double determinant(); - double integrate(); - - void setViewType(ViewType); - void setHeaderViewType(HeaderViewType); - - void setDefaultColorMap(); - void setGrayScale(); - void setRainbowColorMap(); - QwtLinearColorMap *colorMapPointer()/PyName=colorMap/; - void setColorMap(const QwtLinearColorMap&); - - void resetView(); - - QImage image(); - void importImage(const QString&); - void exportRasterImage(const QString&, int = 100, int dpi = 0); - void exportToFile(const QString&) /PyName=export/; - void exportVector(const QString&, int = 0, bool = true); - - void importASCII(const QString&, const QString&="\t", int=0, bool=false, bool=false, - const QString&="#", ImportMode = Overwrite, const QLocale& = QLocale(), int = 0, int = -1); - bool exportASCII(const QString&, const QString&="\t", bool=false); - -private: - Matrix(const Matrix&); -}; - -class ArrowMarker // : QwtPlotMarker -{ -%TypeHeaderCode -#include "../src/plot2D/ArrowMarker.h" -%End -public: - - ArrowMarker(); - - void setStartPoint(double, double) /PyName=setStart/; - void setEndPoint(double, double) /PyName=setEnd/; - - void setStyle(Qt::PenStyle); - void setColor(const QColor&); - void setWidth(double); - void drawStartArrow(bool = true); - void drawEndArrow(bool = true); - void setHeadLength(int); - void setHeadAngle(int); - void fillArrowHead(bool = true); - -private: - ArrowMarker(const ArrowMarker&); -}; - -class FrameWidget : QWidget /PyName=Frame/ -{ -%TypeHeaderCode -#include "../src/plot2D/FrameWidget.h" -%End - -public: - enum FrameStyle{None = 0, Line = 1, Shadow = 2}; - enum Unit{Inch = 0, Millimeter, Centimeter, Point, Pixel, Scale}; - - double xValue(); - double yValue(); - void setOriginCoord(double, double); - void setOrigin(int x, int y); - void move(const QPoint&); - - QRectF boundingRect(); - void setCoordinates(double left, double top, double right, double bottom); - void setSize(int w, int h); - void setSize(const QSize& newSize); - void setRect(int x, int y, int w, int h); - - double right(); - double bottom(); - - int frameStyle(); - void setFrameStyle(int); - - QPen framePen(); - void setFramePen(const QPen&); - - Qt::PenStyle frameLineStyle(); - void setFrameLineStyle(const Qt::PenStyle&); - - QColor frameColor(); - void setFrameColor(const QColor&); - - double frameWidth(); - void setFrameWidth(double); - - QColor backgroundColor(); - void setBackgroundColor(const QColor&); - - QBrush brush(); - void setBrush(const QBrush& ); - -private: - FrameWidget(const FrameWidget&); -}; - -class ImageWidget : FrameWidget /PyName=Image/ -{ -%TypeHeaderCode -#include "../src/plot2D/ImageWidget.h" -%End -public: - - ImageWidget(Graph *, const QString&); - QString fileName(); - bool load(const QString& fn); - -private: - ImageWidget(const ImageWidget&); -}; - -class LegendWidget : FrameWidget /PyName=Legend/ -{ -%TypeHeaderCode -#include "../src/plot2D/LegendWidget.h" -%End -public: - - void setText(const QString&); - void setTextColor(const QColor&); - void setFont(const QFont&); - void setAngle(int); - int angle(); - - bool isAutoUpdateEnabled(); - void setAutoUpdate(bool); - -private: - LegendWidget(const LegendWidget&); -}; - -class RectangleWidget : FrameWidget /PyName=Rectangle/ -{ -%TypeHeaderCode -#include "../src/plot2D/RectangleWidget.h" -%End -public: - - RectangleWidget(Graph *); - -private: - RectangleWidget(const RectangleWidget&); -}; - -class EllipseWidget : FrameWidget /PyName=Ellipse/ -{ -%TypeHeaderCode -#include "../src/plot2D/EllipseWidget.h" -%End -public: - - EllipseWidget(Graph *); - -private: - EllipseWidget(const EllipseWidget&); -}; - -class QwtSymbol /PyName = PlotSymbol/ -{ -%TypeHeaderCode -#include -%End - public: - enum Style - { - NoSymbol = -1, - Ellipse, - Rect, - Diamond, - Triangle, - DTriangle, - UTriangle, - LTriangle, - RTriangle, - Cross, - XCross, - HLine, - VLine, - Star1, - Star2, - Hexagon, - - StyleCnt - }; - - QwtSymbol(); - QwtSymbol(Style st, const QBrush &bd, const QPen &pn, const QSize &s); - - void setSize(const QSize &s); - void setSize(int a, int b = -1); - void setBrush(const QBrush& b); - void setPen(const QPen &p); - void setStyle (Style s); - - const QBrush& brush() const; - const QPen& pen() const; - const QSize& size() const; - Style style() const; - - private: - QwtSymbol(const QwtSymbol&); -}; - -class QwtPlotCurve -{ -%TypeHeaderCode -#include -%End - public: - int dataSize() const; - double x(int i) const; - double y(int i) const; - double minXValue() const; - double maxXValue() const; - double minYValue() const; - double maxYValue() const; - - void setPen(const QPen &); - const QPen &pen() const; - - void setBrush(const QBrush &); - const QBrush &brush() const; - - void setSymbol(const QwtSymbol &s); - const QwtSymbol& symbol() const; - - void setVisible(bool on); - - private: - QwtPlotCurve(const QwtPlotCurve&); -}; - -class PlotCurve : QwtPlotCurve -{ -%TypeHeaderCode -#include "../src/plot2D/PlotCurve.h" -%End -public: - PlotCurve(const QString& name = QString()); - - int skipSymbolsCount(); - void setSkipSymbolsCount(int); - -private: - PlotCurve(const PlotCurve&); -}; - -class DataCurve : PlotCurve -{ -%TypeHeaderCode -#include "../src/plot2D/PlotCurve.h" -%End -public: - DataCurve(Table *t, const QString& xColName, const QString& name, int startRow = 0, int endRow = -1); - - bool hasLabels(); - QString labelsColumnName(); - void setLabelsColumnName(const QString& name); - - int labelsAlignment(); - void setLabelsAlignment(int flags); - - int labelsXOffset(); - int labelsYOffset(); - void setLabelsOffset(int x, int y); - - double labelsRotation(); - void setLabelsRotation(double angle); - - QFont labelsFont(); - void setLabelsFont(const QFont& font); - - QColor labelsColor(); - void setLabelsColor(const QColor& c); - - bool labelsWhiteOut(); - void setLabelsWhiteOut(bool whiteOut = true); - - Table* table(); - - int startRow(); - int endRow(); - void setRowRange(int startRow, int endRow); - - bool isFullRange(); - void setFullRange(); - - bool updateData(Table *t, const QString& colName); - void loadData(); - - void clearLabels(); - -private: - DataCurve(const DataCurve&); -}; - -class QwtHistogram : QwtPlotCurve /PyName=Histogram/ -{ -%TypeHeaderCode -#include "../src/plot2D/QwtHistogram.h" -%End -public: - QwtHistogram(Table *t, const QString& name, int startRow = 0, int endRow = -1); - QwtHistogram(Matrix *m); - - void setBinning(double size, double begin, double end); - void setAutoBinning(bool autoBin = true); - double begin(); - double end(); - double binSize(); - - void loadData(); - - double mean(); - double standardDeviation(); - double minimum(); - double maximum(); - - Matrix* matrix(); - -private: - QwtHistogram(const QwtHistogram&); -}; - -class QwtPlotSpectrogram // : QwtPlotItem -{ -%TypeHeaderCode -#include -%End -public: - enum DisplayMode { - ImageMode = 1, - ContourMode = 2 - }; - - QwtPlotSpectrogram (const QString &title = QString::null); - void setDefaultContourPen (const QPen &); - void setDisplayMode (DisplayMode mode, bool on = true); - -private: - QwtPlotSpectrogram(const QwtPlotSpectrogram&); -}; - -class Spectrogram : QwtPlotSpectrogram -{ -%TypeHeaderCode -#include "../src/plot2D/Spectrogram.h" -%End -public: - - Spectrogram(Graph *graph, Matrix *m); - - Matrix * matrix(); - bool setMatrix(Matrix *, bool = false); - - int levels(); - void setLevelsNumber(int); - void setContourLevels (SIP_PYTUPLE); -%MethodCode - QList l; - int n = PyTuple_Size(a0); - for (int i=0; isetContourLevels(l); -%End - - bool hasColorScale(); - int colorScaleAxis(); - void showColorScale(int axis, bool on = true); - - int colorBarWidth(); - void setColorBarWidth(int width); - - void setGrayScale(); - void setDefaultColorMap(); - - QwtLinearColorMap *colorMapPointer()/PyName=colorMap/; - void setCustomColorMap(const QwtLinearColorMap& map); - - bool hasLabels(); - void showContourLineLabels(bool show = true); - - QFont labelsFont(); - void setLabelsFont(const QFont& font); - - QColor labelsColor(); - void setLabelsColor(const QColor& c); - - bool labelsWhiteOut(); - void setLabelsWhiteOut(bool whiteOut = true); - - double labelsXOffset(); - double labelsYOffset(); - void setLabelsOffset(double x, double y); - - double labelsRotation(); - void setLabelsRotation(double angle); - - bool useMatrixFormula(); - bool setUseMatrixFormula(bool on = true); - - void setColorMapPen(bool on = true); - void setContourLinePen(int, const QPen &); - -private: - Spectrogram(const Spectrogram&); -}; - -class Grid // : QwtPlotGrid -{ -%TypeHeaderCode -#include "../src/plot2D/Grid.h" -%End -public: - - Grid(); - - void enableX(bool = true) /PyName=enableXMax/; - bool xEnabled() /PyName=xMaxEnabled/; - void enableXMin(bool = true); - bool xMinEnabled(); - - void enableY(bool = true) /PyName=enableYMax/; - bool yEnabled() /PyName=yMaxEnabled/; - void enableYMin(bool = true); - bool yMinEnabled(); - - bool xZeroLineEnabled(); - void enableZeroLineX(bool = true); - bool yZeroLineEnabled(); - void enableZeroLineY(bool = true); - const QPen& xZeroLinePen(); - void setXZeroLinePen(const QPen &p); - const QPen& yZeroLinePen(); - void setYZeroLinePen(const QPen &p); - - void setMajPenX(const QPen &p); - const QPen& majPenX(); - - void setMinPenX(const QPen &p); - const QPen& minPenX(); - - void setMajPenY(const QPen &p); - const QPen& majPenY(); - - void setMinPenY(const QPen &p); - const QPen& minPenY(); - -private: - Grid(const Grid&); -}; - -class QwtPlot : QFrame -{ -%TypeHeaderCode -#include "qwt_plot.h" -%End - -private: - QwtPlot(const QwtPlot&); -}; - -class Graph : QwtPlot /PyName=Layer/ -{ -%TypeHeaderCode -#include "../src/plot2D/Graph.h" -#include "../src/plot2D/LegendWidget.h" -%End -public: - enum Scale{Linear, Log10}; - enum Axis{Left, Right, Bottom, Top}; - enum TicksStyle{NoTicks = 0, Out = 1, InOut = 2, In = 3}; - enum CurveType{Line, Scatter, LineSymbols, VerticalBars, Area, Pie, VerticalDropLines, - Spline, HorizontalSteps, Histogram, HorizontalBars, VectXYXY, ErrorBars, - Box, VectXYAM, VerticalSteps, ColorMap, GrayScale, Contour, Function, ImagePlot, - StackBar, StackColumn}; - - bool isPiePlot(); - SIP_PYOBJECT pieLegendText() /PyName=pieLegend/; -%MethodCode - sipRes = PyString_FromString(sipCpp->pieLegendText()); -%End - - DataCurve* insertCurve(Table*, const QString&, int style = 1, int startRow = 0, int endRow = -1); - DataCurve* insertCurve(Table*, const QString&, const QString&, int style = 1, int startRow = 0, int endRow = -1); - bool addCurves(Table*, SIP_PYTUPLE, int=0, double=1, int=3, int=0, int=-1); -%MethodCode - QStringList l; - int n = PyTuple_Size(a1); - for (int i=0; iaddCurves(a0, l, a2, a3, a4, a5, a6); -%End - - bool addCurve(Table*, const QString&, int=0, double=1, int=3, int=0, int=-1); -%MethodCode - if (a0 == 0) { - sipIsErr = 1; - PyErr_Format(PyExc_ValueError, "Invalid table in addCurve()."); - } else { - QStringList l; - l << *a1; - sipRes = sipCpp->addCurves(a0, l, a2, a3, a4, a5, a6); - } -%End - void removeCurve(int); - void removeCurve(const QString&); - void removeCurve(QwtPlotCurve*); - void deleteFitCurves(); - int curveCount() /PyName=numCurves/; - QwtPlotCurve* curve(int index); - QwtPlotCurve* curve(const QString &title); - QString curveTitle(int); - - void changeCurveIndex(int fromIndex, int toIndex); - - void setCurveLineColor(int, int); - void setCurveLineStyle(int, Qt::PenStyle); - void setCurveLineWidth(int, double); - - void setGrayScale(); - void setIndexedColors(); - - void addFunction(const QString&, double, double, int=100); -%MethodCode - QStringList l; - l << *a0; - sipCpp->addFunction(l, a1, a2, a3); -%End - void addPolarFunction(const QString&, const QString&, double, double, int=100, const QString & = "t"); -%MethodCode - QStringList l; - l << *a0; - l << *a1; - sipCpp->addFunction(l, a2, a3, a4, *a5, 2); -%End - void addParametricFunction(const QString&, const QString&, double, double, int=100, const QString & = "m"); -%MethodCode - QStringList l; - l << *a0; - l << *a1; - sipCpp->addFunction(l, a2, a3, a4, *a5, 1); -%End - - void addErrorBars(const QString&, Table *, const QString&, - int type = 1, double width = 1, int cap = 8, const QColor& color = QColor(Qt::black), - bool through = true, bool minus = true, bool plus = true); - - QwtHistogram* addHistogram(Matrix*); - Spectrogram* plotSpectrogram(Matrix *m, CurveType type); - - ArrowMarker* addArrow(ArrowMarker*); - void remove(ArrowMarker*); - - ImageWidget* addImage(ImageWidget*); - ImageWidget* addImage(const QString&); - ImageWidget* addImage(const QImage&); - void remove(ImageWidget*); - - void setTitle(const QString& t); - void setTitleFont(const QFont &fnt); - void setTitleColor(const QColor &c); - void setTitleAlignment(int align); - void removeTitle(); - - LegendWidget* newLegend(const QString& = QString()); - void setLegend(const QString&); - - LegendWidget* legend(); - void removeLegend(); - - LegendWidget* addText(LegendWidget*); - void remove(LegendWidget*); - - LegendWidget* addTimeStamp(); - - FrameWidget* add(FrameWidget*, bool = true); - void remove(FrameWidget*); - - void setXAxisTitle(const QString& text) /PyName=setXTitle/; - void setYAxisTitle(const QString& text) /PyName=setYTitle/; - - void enableAxis(int axis, bool on = true); - void setAxisColor(int axis, const QColor& color); - void setAxisFont(int axis, const QFont &fnt); - - void setAxisTitle(int axis, const QString& text); - void setAxisTitleFont(int axis,const QFont &fnt); - void setAxisTitleColor(int axis, const QColor& c); - void setAxisTitleAlignment(int axis, int align); - - int axisTitleDistance(int axis); - void setAxisTitleDistance(int axis, int dist); - - void setAxisTicksLength(int axis, int majTicksType, int minTicksType, int minLength, int majLength); - void setAxisLabelRotation(int axis, int rotation); - - void setAxesLinewidth(int width); - void drawAxesBackbones(bool yes); - void setTicksLength(int minLength, int majLength); - - void enableAxisLabels(int axis, bool on); - void setAxisLabelsColor(int axis, const QColor& color); - void setLabelsNumericFormat(int axis, int format, int = 6, const QString& = QString()) /PyName=setAxisNumericFormat/; - void setScale(int axis, double start, double end, double step = 0.0, - int majorTicks = 5, int minorTicks = 5, int type = 0, bool inverted = false, - double left_break = -DBL_MAX, double right_break = DBL_MAX, int pos = 50, - double stepBeforeBreak = 0.0, double stepAfterBreak = 0.0, int minTicksBeforeBreak = 4, - int minTicksAfterBreak = 4, bool log10AfterBreak = false, int breakWidth = 4, bool breakDecoration = true); - void setAutoScale(); - void setMargin(int); - void setFrame(int width = 1, const QColor& color = QColor(Qt::black)); - void setCanvasFrame(int width = 1, const QColor& color = QColor(Qt::black)); - void setBackgroundColor(const QColor& color); - void setCanvasBackground(const QColor& color) /PyName=setCanvasColor/; - - Grid* grid(); - void showGrid(int); - void showGrid(); - - void replot(); - - void exportTeX(const QString& fname, bool color = true, bool escapeStrings = true, bool fontSizes = true, - const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, double fontsFactor = 1.0)/PyName=exportTex/; - void exportImage(const QString& fileName, int quality = 100, bool transparent = false, - int dpi = 0, const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, double fontsFactor = 1.0); - void exportVector(const QString&, int = 0, bool = true, - const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, double fontsFactor = 1.0); - void exportToFile(const QString& fileName) /PyName=export/; - - void enableAutoscaling(bool = true); - void setAutoscaleFonts(bool = true); - void setAntialiasing(bool on = true, bool update = true); - - void setCurveAxes(int,int,int); -%MethodCode - sipIsErr = 0; - if ((a1)>1 || (a1<0) || (a2>1) || (a2<0)) - { - sipIsErr=1; - PyErr_Format(PyExc_ValueError, "Invalid axis attachment!");\ - } - if (a0>=sipCpp->curveCount()) - { - sipIsErr=1; - PyErr_Format(PyExc_ValueError, "Invalid curve index! is %d, should be less than %d",a0,sipCpp->curveCount());\ - } - if (sipIsErr == 0) - { - QwtPlotItem* pItem; - pItem = sipCpp->plotItem(a0); - pItem->setAxis(a1 + 2, a2); - sipCpp->setAutoScale(); - } -%End - -private: - Graph(const Graph&); -}; - -class MultiLayer : MdiSubWindow /PyName=Graph/ -{ -%TypeHeaderCode -#include "../src/plot2D/MultiLayer.h" -%End -public: - - enum HorAlignement{HCenter, Left, Right}; - enum VertAlignement{VCenter, Top, Bottom}; - - Graph *activeLayer(); - void setActiveLayer(Graph*); - int numLayers(); - void setNumLayers(int n); - Graph* layer(int num); - QList layersList(); - Graph* addLayer(int = 0, int = 0, int = 0, int = 0); - - bool removeLayer(Graph *g); - bool removeActiveLayer(); - - void setCols(int); - void setRows(int); - void setSpacing (int, int); - void setMargins (int, int, int, int); - void setLayerCanvasSize (int, int); - void setAlignement (int, int); - void arrangeLayers(bool fit = true, bool userSize = false); - bool swapLayers(int, int); - - void setScaleLayersOnResize(bool = true); - - void exportToFile(const QString& fileName) /PyName=export/; - void exportImage(const QString& fileName, int quality = 100, bool transparent = false, - int dpi = 0, const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, - double fontsFactor = 1.0); - void exportVector(const QString&, int = 0, bool = true, - const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, double fontsFactor = 1.0); - void exportTeX(const QString& fname, bool color = true, bool escapeStrings = true, bool fontSizes = true, - const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, double fontsFactor = 1.0)/PyName=exportTex/; - - void setWaterfallSideLines(bool = true); - void setWaterfallFillColor(const QColor&); - void setWaterfallOffset(int x, int y, bool = true); - void reverseWaterfallOrder(); - -private: - MultiLayer(const MultiLayer&); -}; - -class Note: MdiSubWindow -{ -%TypeHeaderCode -#include "../src/scripting/Note.h" -%End -public: - bool autoexec() const; - void setAutoexec(bool = true); - - QString text(); - void setText(const QString &s); - - void exportPDF(const QString& fileName); - QString exportASCII(const QString &file=QString::null)/PyName=saveAs/; - QString importASCII(const QString &file=QString::null); - - void showLineNumbers(bool = true); - - void setFont(const QFont& f); - void setTabStopWidth(int length); - - int tabs(); - void addTab(); - void removeTab(int = -1); - void renameTab(int, const QString&); - - int indexOf(ScriptEdit*); - ScriptEdit* editor(int index); - ScriptEdit* currentEditor(); - -private: - Note(const Note&); -}; - -class Graph3D: MdiSubWindow -{ -%TypeHeaderCode -#include "../src/plot3D/Graph3D.h" -%End -public: - enum PlotType{Scatter = 0, Trajectory = 1, Bars = 2, Ribbon = 3}; - - void exportToFile(const QString& fileName) /PyName=export/; - void exportVector(const QString& fileName, int = 0, int = 1, - const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, double fontsFactor = 1.0); - void exportImage(const QString& fileName, int quality = 100, bool transparent = false, - int dpi = 0, const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, double fontsFactor = 1.0); - - void setRotation(double xVal, double yVal, double zVal); - void setScale(double xVal, double yVal, double zVal); - void setShift(double xVal, double yVal, double zVal); - void setZoom(double val); - void setOrthogonal(bool = true); - void setMeshLineWidth(int); - void setMeshColor(const QColor&); - void setAxesColor(const QColor&); - void setNumbersColor(const QColor&); - void setLabelsColor(const QColor&); - void setLabelsDistance(int); - void setBackgroundColor(const QColor&); - void setGridColor(const QColor&); - void setDataColors(const QColor&, const QColor&); - QString colorMapFile(); - void setDataColorMap(const QString& fileName); - QwtLinearColorMap *colorMapPointer()/PyName=colorMap/; - void setDataColorMap(const QwtLinearColorMap&); - - void changeTransparency(double) /PyName=setOpacity/; - void setResolution(int); - void showColorLegend(bool = true) /PyName=showLegend/; - void setTitle(const QString&, const QColor& color = QColor(Qt::black), const QFont& font = QFont()); - void setAntialiasing(bool = true); - void setLeftGrid(bool = true); - void setRightGrid(bool = true); - void setCeilGrid(bool = true); - void setFloorGrid(bool = true); - void setFrontGrid(bool = true); - void setBackGrid(bool = true); - - void setFramed(); - void setBoxed(); - void setNoAxes(); - - void setFloorData() /PyName=showFloorProjection/; - void setFloorIsolines() /PyName=showFloorIsolines/; - void setEmptyFloor(); - - void setPolygonStyle(); - void setHiddenLineStyle(); - void setWireframeStyle(); - void setFilledMeshStyle(); - void setDotStyle(); - void setBarStyle(); - void setConeStyle(); - void setCrossStyle(); - - void setConeOptions(double rad, int quality); - void setCrossOptions(double rad, double linewidth, bool smooth, bool boxed); - void setDotOptions(double size, bool smooth); - void setBarRadius(double rad); - void setBarLines(bool lines = true); - void setFilledBars(bool filled = true); - - void animate(bool = true); - void findBestLayout(); - - void changeDataColumn(Table* table, const QString& colName, int = 0) /PyName=setData/; - void addMatrixData(Matrix* ) /PyName=setMatrix/; - void addFunction(const QString&, double, double, double, double, double, double, int = 40, int = 40) /PyName=setFunction/; - void addParametricSurface(const QString&, const QString&, const QString&, double, - double, double, double, int=40, int=40, bool=true, bool=true) /PyName=setParametricSurface/; - - void update(); - - void setXAxisLabel(const QString&); - void setYAxisLabel(const QString&); - void setZAxisLabel(const QString&); - - void setXAxisTickLength(double majorLength, double minorLength); - void setYAxisTickLength(double majorLength, double minorLength); - void setZAxisTickLength(double majorLength, double minorLength); - - void setScales(double xl, double xr, double yl, double yr, double zl, double zr); - -private: - Graph3D(const Graph3D&); -}; - -class ApplicationWindow: QMainWindow -{ -%TypeHeaderCode -#include "../src/core/ApplicationWindow.h" -%End -%ConvertToSubClassCode -// we have to do this to override casting in qt/qobject.sip - sipClass = sipFindClass(sipCpp->className()); -%End - -public: - enum MatrixToTableConversion{Direct, XYZ, YXZ}; - - Table* table(const QString&); -%MethodCode - sipRes = sipCpp->current_folder->table(*a0, false); - if(!sipRes) - sipRes = sipCpp->projectFolder()->table(*a0, true); -%End - Table* newTable(); - Table* currentTable(); - Table* newTable(const QString&, int=30, int=2); -%MethodCode - sipRes = sipCpp->newTable(*a0, a1, a2); -%End - Matrix* matrix(const QString&); -%MethodCode - sipRes = sipCpp->current_folder->matrix(*a0, false); - if(!sipRes) - sipRes = sipCpp->projectFolder()->matrix(*a0, true); -%End - Matrix* newMatrix(); - Matrix* currentMatrix(); - Matrix* newMatrix(const QString&, int=32, int=32); - MultiLayer *plot(const QString&) /PyName=graph/; -%MethodCode - sipRes = sipCpp->current_folder->graph(*a0, false); - if(!sipRes) - sipRes = sipCpp->projectFolder()->graph(*a0, true); -%End - MultiLayer* currentPlot() /PyName=currentGraph/; - MultiLayer* multilayerPlot(const QString& = "Graph1", int = 1, int = 1, int = 1)/PyName=newGraph/; - - Note *note(const QString&); -%MethodCode - sipRes = sipCpp->current_folder->note(*a0, false); - if(!sipRes) - sipRes = sipCpp->projectFolder()->note(*a0, true); -%End - Note* newNote(const QString& = QString::null); - Note* currentNote(); - MultiLayer *multilayerPlot(Table*, SIP_PYTUPLE, int=1) /PyName=plot/; -%MethodCode - if (a0 == 0) { - sipIsErr = 1; - PyErr_Format(PyExc_ValueError, "Invalid table in argument to plot()."); - } else { - QStringList l; - int n = PyTuple_Size(a1); - for (int i=0; imultilayerPlot(a0, l, a2); - } -%End - MultiLayer *multiLayerPlot(Table*, const QString&, int=1) /PyName=plot/; -%MethodCode - if (a0 == 0) { - sipIsErr = 1; - PyErr_Format(PyExc_ValueError, "Invalid table in argument to plot()."); - } else { - QStringList l; - l << *a1; - sipRes = sipCpp->multilayerPlot(a0, l, a2); - } -%End - - MultiLayer *waterfallPlot(Table*, SIP_PYTUPLE); -%MethodCode - if (a0 == 0) { - sipIsErr = 1; - PyErr_Format(PyExc_ValueError, "Invalid table in argument to waterfallPlot()."); - } else { - QStringList l; - int n = PyTuple_Size(a1); - for (int i=0; iwaterfallPlot(a0, l); - } -%End - - Matrix* importImage(const QString&, bool); - MultiLayer* plotSpectrogram(Matrix*, Graph::CurveType = Graph::ColorMap) /PyName=plot/; - MultiLayer* plot(const QString&, double, double, int = 100); -%MethodCode - QStringList l; - l << *a0; - sipRes = sipCpp->newFunctionPlot(l, a1, a2, a3); -%End - - Graph3D *plot3D(const QString&); -%MethodCode - sipRes = sipCpp->current_folder->plot3D(*a0, false); - if(!sipRes) - sipRes = sipCpp->projectFolder()->plot3D(*a0, true); -%End - - Graph3D* newPlot3D(const QString& = QString()); - Graph3D* plotXYZ(Table* table, const QString&, int = 0) /PyName=plot3D/; - Graph3D* plot3DMatrix(Matrix *, int style = 5) /PyName=plot3D/; - Graph3D* plotSurface(const QString&, double xl, double xr, double yl, double yr, - double zl, double zr, int=40, int=40) /PyName=plot3D/; - Graph3D* plotParametricSurface(const QString&, const QString&, const QString&, - double, double, double, double, int=40, int=40, bool=true, bool=true) /PyName=plot3D/; - - QList windowsList() /PyName=windows/; - - // folders - Folder *activeFolder() /NoDerived/; -%MethodCode - sipRes = sipCpp->current_folder; -%End - - Folder* appendProject(const QString& file_name, Folder* parentFolder = 0); - void saveFolder(Folder *folder, const QString& fn, bool=false); - Folder* projectFolder() /PyName=rootFolder/; - - Folder* addFolder(QString name, Folder* parent = 0); - bool deleteFolder(Folder *); - bool changeFolder(Folder *, bool force = false); - bool copyFolder(Folder *src, Folder *dest); - - MdiSubWindow* openTemplate(const QString&); - void saveAsTemplate(MdiSubWindow*, const QString&); - - void setWindowName(MdiSubWindow *, const QString &); - void setPreferences(Graph*); - - void saveProjectAs(const QString& fileName = QString(), bool = false); - MdiSubWindow* clone(MdiSubWindow*); - - Matrix* tableToMatrix(Table* t); - Table* matrixToTable(Matrix* m, MatrixToTableConversion = Direct); - - QTextEdit *resultsLog(); - QString stemPlot(Table *t, const QString& colName, int power = 1001, int startRow = 0, int endRow = -1); - - QMdiArea* workspace(); - -private: - ApplicationWindow(const ApplicationWindow&); -}; - -class Fit : Filter -{ -%TypeHeaderCode -#include "../src/analysis/Fit.h" -%End -public: - enum Algorithm{ScaledLevenbergMarquardt, UnscaledLevenbergMarquardt, NelderMeadSimplex}; - enum WeightingMethod{NoWeighting, Instrumental, Statistical, Dataset, Direct}; - - Fit(ApplicationWindow* /TransferThis/, Graph*=0, const char*=0); - ~Fit(); - - virtual void fit(); - virtual bool run(); - - bool setWeightingData(WeightingMethod, const QString&=QString::null); - bool setDataFromTable(Table *, const QString&, const QString&, int = 1, int = -1); - void setInterval(double from, double to); - - QString formula(); - QString resultFormula(); - int numParameters(); - QStringList parameterNames(); - - void setInitialGuess(int, double) /PyName=setInitialValue/; - void setInitialGuesses(...) /PyName=setInitialValues/; -%MethodCode -int n = PyTuple_GET_SIZE(a0); -double *values = new double[n]; -for (int i=0; isetInitialGuesses(values); -delete values; -%End - - virtual void guessInitialValues(); - void setParameterRange(int, double, double); - - void setAlgorithm(Algorithm); - void setOutputPrecision(int); - void generateFunction(bool, int=100); - - void showLegend(); - virtual QString legendInfo(); - - void scaleErrors(bool yes = true); - - SIP_PYTUPLE results(); -%MethodCode -double *results = sipCpp->results(); -int size=sipCpp->numParameters(); -sipRes = PyTuple_New(size); -if(sipRes) -{ - for(int i=0; ierrors(); -int size=sipCpp->numParameters(); -sipRes = PyTuple_New(size); -if(sipRes) -{ - for(int i=0; iresiduals(); -int size = sipCpp->dataSize(); -sipRes = PyTuple_New(size); -if(sipRes) -{ - for(int i=0; isetParametersList(l); -%End - // TODO: make it accept Python callables - bool setFormula(const QString&, bool = true); - bool save(const QString&); - bool load(const QString&); -}; - -class PluginFit : Fit -{ -%TypeHeaderCode -#include "../src/analysis/PluginFit.h" -%End -public: - PluginFit(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int); - PluginFit(Table *, const QString&, const QString&, int = 1, int = -1) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipPluginFit(app, a0, *a1, *a2, a3, a4)) -%End - - PluginFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *); - PluginFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double); - PluginFit(ApplicationWindow * /TransferThis/, Graph *, const QString&); - PluginFit(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double); - PluginFit(QwtPlotCurve *) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipPluginFit(app, a0)) -%End - PluginFit(QwtPlotCurve *, double, double) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipPluginFit(app, a0, a1, a2)) -%End - PluginFit(Graph *, const QString&) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipPluginFit(app, a0, *a1)) -%End - PluginFit(Graph *, const QString&, double, double) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipPluginFit(app, a0, *a1, a2, a3)) -%End - bool load(const QString&); -}; - -class MultiPeakFit : Fit -{ -%TypeHeaderCode -#include "../src/analysis/MultiPeakFit.h" -%End -public: - enum PeakProfile{Gauss, Lorentz}; - MultiPeakFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *, PeakProfile=Gauss, int=1); - MultiPeakFit(ApplicationWindow * /TransferThis/, Graph *, PeakProfile=Gauss, int=1); - - int peaks() /PyName=numPeaks/; - void setNumPeaks(int); - - void enablePeakCurves(bool); - void setPeakCurvesColor(int); - - static QString generateFormula(int, PeakProfile); - static QStringList generateParameterList(int); - - void guessInitialValues(); -}; - -class LorentzFit : MultiPeakFit -{ -%TypeHeaderCode -#include "../src/analysis/MultiPeakFit.h" -%End -public: - LorentzFit(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int); - LorentzFit(Table *, const QString&, const QString&, int = 1, int = -1) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipLorentzFit(app, a0, *a1, *a2, a3, a4)) -%End - - LorentzFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *); - LorentzFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double); - LorentzFit(ApplicationWindow * /TransferThis/, Graph *, const QString&); - LorentzFit(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double); - LorentzFit(QwtPlotCurve *) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipLorentzFit(app, a0)) -%End - LorentzFit(QwtPlotCurve *, double, double) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipLorentzFit(app, a0, a1, a2)) -%End - LorentzFit(Graph *, const QString&) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipLorentzFit(app, a0, *a1)) -%End - LorentzFit(Graph *, const QString&, int, int) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipLorentzFit(app, a0, *a1, a2, a3)) -%End -}; - -class GaussFit : MultiPeakFit -{ -%TypeHeaderCode -#include "../src/analysis/MultiPeakFit.h" -%End -public: - GaussFit(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int); - GaussFit(Table *, const QString&, const QString&, int = 1, int = -1) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipGaussFit(app, a0, *a1, *a2, a3, a4)) -%End - - GaussFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *); - GaussFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double); - GaussFit(ApplicationWindow * /TransferThis/, Graph *, const QString&); - GaussFit(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double); - GaussFit(QwtPlotCurve *) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipGaussFit(app, a0)) -%End - GaussFit(QwtPlotCurve *, double, double) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipGaussFit(app, a0, a1, a2)) -%End - GaussFit(Graph *, const QString&) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipGaussFit(app, a0, *a1)) -%End - GaussFit(Graph *, const QString&, double, double) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipGaussFit(app, a0, *a1, a2, a3)) -%End -}; - -class PolynomialFit : Fit -{ -%TypeHeaderCode -#include "../src/analysis/PolynomialFit.h" -%End -public: - PolynomialFit(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int, int, bool); - PolynomialFit(Table *, const QString&, const QString&, int = 1, int = -1, int = 2, bool = false) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipPolynomialFit(app, a0, *a1, *a2, a3, a4, a5, a6)) -%End - - PolynomialFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *, int=2, bool=false); - PolynomialFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double, int=2, bool=false); - PolynomialFit(ApplicationWindow * /TransferThis/, Graph *, QString&, int=2, bool=false); - PolynomialFit(ApplicationWindow * /TransferThis/, Graph *, QString&, double, double, int=2, bool=false); - PolynomialFit(QwtPlotCurve *, int=2, bool=false) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipPolynomialFit(app, a0, a1, a2)) -%End - PolynomialFit(QwtPlotCurve *, double, double, int=2, bool=false) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipPolynomialFit(app, a0, a1, a2, a3, a4)) -%End - PolynomialFit(Graph *, QString&, int=2, bool=false) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipPolynomialFit(app, a0, *a1, a2, a3)) -%End - PolynomialFit(Graph *, QString&, double, double, int=2, bool=false) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipPolynomialFit(app, a0, *a1, a2, a3, a4, a5)) -%End - - virtual QString legendInfo(); - void fit(); - - static QString generateFormula(int); - static QStringList generateParameterList(int); -}; - -class LinearFit : Fit -{ -%TypeHeaderCode -#include "../src/analysis/PolynomialFit.h" -%End -public: - LinearFit(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int); - LinearFit(Table *, const QString&, const QString&, int = 1, int = -1) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipLinearFit(app, a0, *a1, *a2, a3, a4)) -%End - - LinearFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *); - LinearFit(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double); - LinearFit(ApplicationWindow * /TransferThis/, Graph *, const QString&); - LinearFit(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double); - LinearFit(QwtPlotCurve *) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipLinearFit(app, a0)) -%End - LinearFit(QwtPlotCurve *, double, double) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipLinearFit(app, a0, a1, a2)) -%End - LinearFit(Graph *, const QString&) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipLinearFit(app, a0, *a1)) -%End - LinearFit(Graph *, const QString&, double, double) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipLinearFit(app, a0, *a1, a2, a3)) -%End - void fit(); -}; - -class Filter : QObject -{ -%TypeHeaderCode -#include "../src/analysis/Filter.h" -%End -public: - Filter(ApplicationWindow* /TransferThis/, Graph*=0, const char*=0); - ~Filter(); - - void setOutputPoints(int); - void setTolerance(double); - void setMaximumIterations(int); - - void setColor(int); - void setColor(const QString&); - - bool setDataFromCurve(QwtPlotCurve *c); - bool setDataFromCurve(QwtPlotCurve *c, double from, double to); - bool setDataFromCurve(const QString&, Graph*=0); - bool setDataFromCurve(const QString& curveTitle, double from, double to, Graph *g = 0); - virtual bool setDataFromTable(Table *t, const QString& xColName, const QString& yColName, int from = 1, int to = -1); - - Table *resultTable(); - - virtual void enableGraphicsDisplay(bool on = true, Graph *g = 0); - virtual bool run(); -}; - -class Differentiation : Filter -{ -%TypeHeaderCode -#include "../src/analysis/Differentiation.h" -%End -public: - Differentiation(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int); - Differentiation(Table *, const QString&, const QString&, int = 1, int = -1) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipDifferentiation(app, a0, *a1, *a2, a3, a4)) -%End - - Differentiation(ApplicationWindow * /TransferThis/, QwtPlotCurve *); - Differentiation(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double); - Differentiation(ApplicationWindow * /TransferThis/, Graph *, const QString&); - Differentiation(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double); - Differentiation(QwtPlotCurve *, double, double) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipDifferentiation(app, a0, a1, a2)) -%End - Differentiation(QwtPlotCurve *) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipDifferentiation(app, a0)) -%End - Differentiation(Graph *, const QString&) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipDifferentiation(app, a0, *a1)) -%End - Differentiation(Graph *, const QString&, double, double) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipDifferentiation(app, a0, *a1, a2, a3)) -%End - bool run(); -}; - -class Integration : Filter -{ -%TypeHeaderCode -#include "../src/analysis/Integration.h" -%End -public: - Integration(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int); - Integration(Table *, const QString&, const QString&, int = 1, int = -1) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipIntegration(app, a0, *a1, *a2, a3, a4)) -%End - - Integration(ApplicationWindow * /TransferThis/, QwtPlotCurve *); - Integration(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double); - Integration(ApplicationWindow * /TransferThis/, Graph *, const QString&); - Integration(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double); - Integration(QwtPlotCurve *) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipIntegration(app, a0)) -%End - Integration(QwtPlotCurve *, double, double) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipIntegration(app, a0, a1, a2)) -%End - Integration(Graph *, const QString&) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipIntegration(app, a0, *a1)) -%End - Integration(Graph *, const QString&, double, double) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipIntegration(app, a0, *a1, a2, a3)) -%End - - void enableGraphicsDisplay(bool on = true, Graph *g = 0); - void setMethodOrder(int n); - bool run(); - - double area(); -}; - -class Interpolation : Filter -{ -%TypeHeaderCode -#include "../src/analysis/Interpolation.h" -%End -public: - enum InterpolationMethod{Linear, Cubic, Akima}; - - Interpolation(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int, int); - Interpolation(Table *, const QString&, const QString&, int = 1, int = -1, int = 0) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipInterpolation(app, a0, *a1, *a2, a3, a4, a5)) -%End - - Interpolation(ApplicationWindow * /TransferThis/, QwtPlotCurve *, int=0); - Interpolation(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double, int=0); - Interpolation(ApplicationWindow * /TransferThis/, Graph *, const QString&, int=0); - Interpolation(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double, int=0); - Interpolation(QwtPlotCurve *, int=0) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipInterpolation(app, a0, a1)) -%End - Interpolation(QwtPlotCurve *, double, double, int=0) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipInterpolation(app, a0, a1, a2, a3)) -%End - Interpolation(Graph *, const QString&, int=0) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipInterpolation(app, a0, *a1, a2)) -%End - Interpolation(Graph *, const QString&, double, double, int=0) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipInterpolation(app, a0, *a1, a2, a3, a4)) -%End - - void setMethod(int n); - bool run(); -}; - -class SmoothFilter : Filter -{ -%TypeHeaderCode -#include "../src/analysis/SmoothFilter.h" -%End -public: - enum SmoothMethod{SavitzkyGolay = 1, FFT = 2, Average = 3, Lowess = 4}; - - SmoothFilter(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int, int); - SmoothFilter(Table *, const QString&, const QString&, int = 1, int = -1, int = 3) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipSmoothFilter(app, a0, *a1, *a2, a3, a4, a5)) -%End - - SmoothFilter(ApplicationWindow * /TransferThis/, QwtPlotCurve *, int = 3); - SmoothFilter(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double, int = 3); - SmoothFilter(ApplicationWindow * /TransferThis/, Graph *, const QString&, int=3); - SmoothFilter(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double, int=3); - SmoothFilter(QwtPlotCurve *, int=3) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipSmoothFilter(app, a0, a1)) -%End - SmoothFilter(QwtPlotCurve *, double, double, int=3) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipSmoothFilter(app, a0, a1, a2, a3)) -%End - SmoothFilter(Graph *, const QString&, int=3) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipSmoothFilter(app, a0, *a1, a2)) -%End - SmoothFilter(Graph *, const QString&, double, double, int=3) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipSmoothFilter(app, a0, *a1, a2, a3, a4)) -%End - - void setMethod(int); - void setSmoothPoints(int, int = 0); - void setPolynomOrder(int); - void setLowessParameter(double f, int iterations); - bool run(); -}; - -class FFTFilter : Filter -{ -%TypeHeaderCode -#include "../src/analysis/FFTFilter.h" -%End -public: - enum FilterType{LowPass = 1, HighPass = 2, BandPass = 3, BandBlock = 4}; - - FFTFilter(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int, int); - FFTFilter(Table *, const QString&, const QString&, int = 1, int = -1, int = 1) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipFFTFilter(app, a0, *a1, *a2, a3, a4, a5)) -%End - - FFTFilter(ApplicationWindow * /TransferThis/, QwtPlotCurve *, int = 1); - FFTFilter(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double, int = 1); - FFTFilter(ApplicationWindow * /TransferThis/, Graph *, const QString&, int=1); - FFTFilter(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double, int=1); - FFTFilter(QwtPlotCurve *, int=1) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipFFTFilter(app, a0, a1)) -%End - FFTFilter(QwtPlotCurve *, double, double, int=1) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipFFTFilter(app, a0, a1, a2, a3)) -%End - FFTFilter(Graph *, const QString&, int=1) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipFFTFilter(app, a0, *a1, a2)) -%End - FFTFilter(Graph *, const QString&, double, double, int=1) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipFFTFilter(app, a0, *a1, a2, a3, a4)) -%End - - void setFilterType(int); - void setCutoff(double); - void setBand(double, double); - void enableOffset(bool=true); - - bool run(); -}; - -class FFT : Filter -{ -%TypeHeaderCode -#include "../src/analysis/FFT.h" -%End -public: - - FFT(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString& = QString(), int = 1, int = -1); - FFT(ApplicationWindow * /TransferThis/, Graph *, const QString&, double, double); - FFT(ApplicationWindow * /TransferThis/, Graph *, const QString&); - FFT(ApplicationWindow * /TransferThis/, QwtPlotCurve *); - FFT(ApplicationWindow * /TransferThis/, QwtPlotCurve *, double, double); - - FFT(Table *, const QString&, const QString& = QString(), int = 1, int = -1) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipFFT(app, a0, *a1, *a2, a3, a4)) -%End - FFT(Graph *, const QString&) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipFFT(app, a0, *a1)) -%End - FFT(Graph *, const QString&, double, double) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipFFT(app, a0, *a1, a2, a3)) -%End - FFT(QwtPlotCurve *&) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipFFT(app, a0)) -%End - FFT(QwtPlotCurve *&, double, double) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipFFT(app, a0, a1, a2)) -%End - - void setInverseFFT(bool=true); - void setSampling(double); - void normalizeAmplitudes(bool=true); - void shiftFrequencies(bool=true); - - bool run(); -}; - -class Correlation : Filter -{ -%TypeHeaderCode -#include "../src/analysis/Correlation.h" -%End -public: - - Correlation(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&, int, int); - Correlation(Table *, const QString&, const QString&, int = 1, int = -1) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipCorrelation(app, a0, *a1, *a2, a3, a4)) -%End - - bool setDataFromTable(Table *, const QString&, const QString&, int = 1, int = -1); - bool run(); -}; - -class Convolution : Filter -{ -%TypeHeaderCode -#include "../src/analysis/Convolution.h" -%End -public: - - Convolution(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&); - Convolution(Table *, const QString&, const QString&) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipConvolution(app, a0, *a1, *a2)) -%End - - void setDataFromTable(Table *, const QString&, const QString&); - bool run(); -}; - -class Deconvolution : Filter -{ -%TypeHeaderCode -#include "../src/analysis/Convolution.h" -%End -public: - - Deconvolution(ApplicationWindow * /TransferThis/, Table *, const QString&, const QString&); - Deconvolution(Table *, const QString&, const QString&) /NoDerived/; -%MethodCode - SIPQTI_APP(new sipDeconvolution(app, a0, *a1, *a2)) -%End - - void setDataFromTable(Table *, const QString&, const QString&); - bool run(); -}; - -// used for output redirection -class PythonScripting -{ -%TypeHeaderCode -#include "../src/scripting/PythonScripting.h" -%End -public: - void write(const QString&); -private: - PythonScripting(const PythonScripting&); -}; -class PythonScript -{ -%TypeHeaderCode -#include "../src/scripting/PythonScript.h" -%End -public: - void write(const QString&); -private: - PythonScript(const PythonScript&); -}; - -class Folder : QObject -{ -%TypeHeaderCode -#include "../src/core/Folder.h" -%End -public: - QList windowsList() /PyName=windows/; -// TODO: implement signal Folder::nameChanged and make it update the project explorer; adjust renaming from GUI accordingly -// void setFolderName(const QString&) /PyName=setName/; - QString name(); - QString path(); - - QList folders(); - Folder *findSubfolder(const QString&, bool=true, bool=false) /PyName=folder/; - MdiSubWindow* findWindow(const QString&, bool=true, bool=true, bool=false, bool=true); - - MdiSubWindow *window(const QString &name, const char *cls="MdiSubWindow", bool recursive=false); - Table *table(const QString &name, bool recursive=false); - Matrix *matrix(const QString &name, bool recursive=false); - MultiLayer *graph(const QString &name, bool recursive=false); - Note *note(const QString &name, bool recursive=false); - Graph3D *plot3D(const QString &name, bool recursive=false); - - Folder* rootFolder(); - - QString logInfo(); - void appendLogInfo(const QString&); - void clearLogInfo(); - -private: - Folder(const Folder&); -}; === added file 'qtiplot/src/scripting/scripting.pri' --- qtiplot/src/scripting/scripting.pri 1970-01-01 00:00:00 +0000 +++ qtiplot/src/scripting/scripting.pri 2010-07-21 23:21:08 +0000 @@ -0,0 +1,118 @@ +############################################################### +##################### SCRIPTING LANGUAGES SECTION ############# +############################################################### + +INCLUDEPATH += src/scripting/ + +HEADERS += src/scripting/customevents.h\ + src/scripting/FindReplaceDialog.h\ + src/scripting/MyParser.h\ + src/scripting/Note.h\ + src/scripting/PythonSyntaxHighlighter.h\ + src/scripting/ScriptingEnv.h\ + src/scripting/Script.h\ + src/scripting/ScriptEdit.h\ + src/scripting/ScriptingLangDialog.h\ + src/scripting/ScriptWindow.h\ + +SOURCES += src/scripting/FindReplaceDialog.cpp\ + src/scripting/MyParser.cpp\ + src/scripting/Note.cpp\ + src/scripting/PythonSyntaxHighlighter.cpp\ + src/scripting/ScriptingEnv.cpp\ + src/scripting/Script.cpp\ + src/scripting/ScriptEdit.cpp\ + src/scripting/ScriptingLangDialog.cpp\ + src/scripting/ScriptWindow.cpp\ + +##################### Default: muParser v1.28 ################# + +contains(SCRIPTING_LANGS, muParser) { + DEFINES += SCRIPTING_MUPARSER + + HEADERS += src/scripting/muParserScript.h \ + src/scripting/muParserScripting.h \ + + SOURCES += src/scripting/muParserScript.cpp \ + src/scripting/muParserScripting.cpp +} + +##################### PYTHON + SIP + PyQT ##################### + +contains(SCRIPTING_LANGS, Python) { + + DEFINES += SCRIPTING_PYTHON + + HEADERS += src/scripting/PythonScript.h\ + src/scripting/PythonScripting.h\ + + SOURCES += src/scripting/PythonScript.cpp\ + src/scripting/PythonScripting.cpp\ + +##################### SIP generated files ##################### + + SOURCES += $${SIP_DIR}/sipqticmodule.cpp\ + $${SIP_DIR}/sipqtiApplicationWindow.cpp\ + $${SIP_DIR}/sipqtiQwtPlot.cpp\ + $${SIP_DIR}/sipqtiGraph.cpp\ + $${SIP_DIR}/sipqtiGraph3D.cpp\ + $${SIP_DIR}/sipqtiArrowMarker.cpp\ + $${SIP_DIR}/sipqtiFrameWidget.cpp\ + $${SIP_DIR}/sipqtiEllipseWidget.cpp\ + $${SIP_DIR}/sipqtiImageWidget.cpp\ + $${SIP_DIR}/sipqtiLegendWidget.cpp\ + $${SIP_DIR}/sipqtiRectangleWidget.cpp\ + $${SIP_DIR}/sipqtiGrid.cpp\ + $${SIP_DIR}/sipqtiQwtSymbol.cpp\ + $${SIP_DIR}/sipqtiQwtPlotCurve.cpp\ + $${SIP_DIR}/sipqtiPlotCurve.cpp\ + $${SIP_DIR}/sipqtiDataCurve.cpp\ + $${SIP_DIR}/sipqtiQwtHistogram.cpp\ + $${SIP_DIR}/sipqtiQwtPlotSpectrogram.cpp\ + $${SIP_DIR}/sipqtiSpectrogram.cpp\ + $${SIP_DIR}/sipqtiMultiLayer.cpp\ + $${SIP_DIR}/sipqtiTable.cpp\ + $${SIP_DIR}/sipqtiQwtLinearColorMap.cpp\ + $${SIP_DIR}/sipqtiMatrix.cpp\ + $${SIP_DIR}/sipqtiMdiSubWindow.cpp\ + $${SIP_DIR}/sipqtiScriptEdit.cpp\ + $${SIP_DIR}/sipqtiNote.cpp\ + $${SIP_DIR}/sipqtiPythonScript.cpp\ + $${SIP_DIR}/sipqtiPythonScripting.cpp\ + $${SIP_DIR}/sipqtiFolder.cpp\ + $${SIP_DIR}/sipqtiFit.cpp \ + $${SIP_DIR}/sipqtiExponentialFit.cpp \ + $${SIP_DIR}/sipqtiTwoExpFit.cpp \ + $${SIP_DIR}/sipqtiThreeExpFit.cpp \ + $${SIP_DIR}/sipqtiSigmoidalFit.cpp \ + $${SIP_DIR}/sipqtiLogisticFit.cpp \ + $${SIP_DIR}/sipqtiGaussAmpFit.cpp \ + $${SIP_DIR}/sipqtiLorentzFit.cpp \ + $${SIP_DIR}/sipqtiNonLinearFit.cpp \ + $${SIP_DIR}/sipqtiPluginFit.cpp \ + $${SIP_DIR}/sipqtiMultiPeakFit.cpp \ + $${SIP_DIR}/sipqtiPolynomialFit.cpp \ + $${SIP_DIR}/sipqtiLinearFit.cpp \ + $${SIP_DIR}/sipqtiGaussFit.cpp \ + $${SIP_DIR}/sipqtiFilter.cpp \ + $${SIP_DIR}/sipqtiDifferentiation.cpp \ + $${SIP_DIR}/sipqtiIntegration.cpp \ + $${SIP_DIR}/sipqtiInterpolation.cpp \ + $${SIP_DIR}/sipqtiSmoothFilter.cpp \ + $${SIP_DIR}/sipqtiFFTFilter.cpp \ + $${SIP_DIR}/sipqtiFFT.cpp \ + $${SIP_DIR}/sipqtiCorrelation.cpp \ + $${SIP_DIR}/sipqtiConvolution.cpp \ + $${SIP_DIR}/sipqtiDeconvolution.cpp \ + +exists(../../$${SIP_DIR}/sipqtiQList.cpp) { + # SIP < 4.9 + SOURCES += $${SIP_DIR}/sipqtiQList.cpp +} else { + SOURCES += \ + $${SIP_DIR}/sipqtiQList0101Folder.cpp\ + $${SIP_DIR}/sipqtiQList0101Graph.cpp\ + $${SIP_DIR}/sipqtiQList0101MdiSubWindow.cpp\ + $${SIP_DIR}/sipqtiQList0101ArrowMarker.cpp\ +} +} === removed file 'qtiplot/src/scripting/scripting.pri' --- qtiplot/src/scripting/scripting.pri 2009-12-08 18:06:27 +0000 +++ qtiplot/src/scripting/scripting.pri 1970-01-01 00:00:00 +0000 @@ -1,117 +0,0 @@ -############################################################### -##################### SCRIPTING LANGUAGES SECTION ############# -############################################################### - -INCLUDEPATH += src/scripting/ - -HEADERS += src/scripting/customevents.h\ - src/scripting/FindReplaceDialog.h\ - src/scripting/MyParser.h\ - src/scripting/Note.h\ - src/scripting/PythonSyntaxHighlighter.h\ - src/scripting/ScriptingEnv.h\ - src/scripting/Script.h\ - src/scripting/ScriptEdit.h\ - src/scripting/ScriptingLangDialog.h\ - src/scripting/ScriptWindow.h\ - -SOURCES += src/scripting/FindReplaceDialog.cpp\ - src/scripting/MyParser.cpp\ - src/scripting/Note.cpp\ - src/scripting/PythonSyntaxHighlighter.cpp\ - src/scripting/ScriptingEnv.cpp\ - src/scripting/Script.cpp\ - src/scripting/ScriptEdit.cpp\ - src/scripting/ScriptingLangDialog.cpp\ - src/scripting/ScriptWindow.cpp\ - -##################### Default: muParser v1.28 ################# - -contains(SCRIPTING_LANGS, muParser) { - DEFINES += SCRIPTING_MUPARSER - - HEADERS += src/scripting/muParserScript.h \ - src/scripting/muParserScripting.h \ - - SOURCES += src/scripting/muParserScript.cpp \ - src/scripting/muParserScripting.cpp -} - -##################### PYTHON + SIP + PyQT ##################### - -contains(SCRIPTING_LANGS, Python) { - - DEFINES += SCRIPTING_PYTHON - - HEADERS += src/scripting/PythonScript.h\ - src/scripting/PythonScripting.h\ - - SOURCES += src/scripting/PythonScript.cpp\ - src/scripting/PythonScripting.cpp\ - -##################### SIP generated files ##################### - - SOURCES += $${SIP_DIR}/sipqticmodule.cpp\ - $${SIP_DIR}/sipqtiApplicationWindow.cpp\ - $${SIP_DIR}/sipqtiQwtPlot.cpp\ - $${SIP_DIR}/sipqtiGraph.cpp\ - $${SIP_DIR}/sipqtiGraph3D.cpp\ - $${SIP_DIR}/sipqtiArrowMarker.cpp\ - $${SIP_DIR}/sipqtiFrameWidget.cpp\ - $${SIP_DIR}/sipqtiEllipseWidget.cpp\ - $${SIP_DIR}/sipqtiImageWidget.cpp\ - $${SIP_DIR}/sipqtiLegendWidget.cpp\ - $${SIP_DIR}/sipqtiRectangleWidget.cpp\ - $${SIP_DIR}/sipqtiGrid.cpp\ - $${SIP_DIR}/sipqtiQwtSymbol.cpp\ - $${SIP_DIR}/sipqtiQwtPlotCurve.cpp\ - $${SIP_DIR}/sipqtiPlotCurve.cpp\ - $${SIP_DIR}/sipqtiDataCurve.cpp\ - $${SIP_DIR}/sipqtiQwtHistogram.cpp\ - $${SIP_DIR}/sipqtiQwtPlotSpectrogram.cpp\ - $${SIP_DIR}/sipqtiSpectrogram.cpp\ - $${SIP_DIR}/sipqtiMultiLayer.cpp\ - $${SIP_DIR}/sipqtiTable.cpp\ - $${SIP_DIR}/sipqtiQwtLinearColorMap.cpp\ - $${SIP_DIR}/sipqtiMatrix.cpp\ - $${SIP_DIR}/sipqtiMdiSubWindow.cpp\ - $${SIP_DIR}/sipqtiScriptEdit.cpp\ - $${SIP_DIR}/sipqtiNote.cpp\ - $${SIP_DIR}/sipqtiPythonScript.cpp\ - $${SIP_DIR}/sipqtiPythonScripting.cpp\ - $${SIP_DIR}/sipqtiFolder.cpp\ - $${SIP_DIR}/sipqtiFit.cpp \ - $${SIP_DIR}/sipqtiExponentialFit.cpp \ - $${SIP_DIR}/sipqtiTwoExpFit.cpp \ - $${SIP_DIR}/sipqtiThreeExpFit.cpp \ - $${SIP_DIR}/sipqtiSigmoidalFit.cpp \ - $${SIP_DIR}/sipqtiLogisticFit.cpp \ - $${SIP_DIR}/sipqtiGaussAmpFit.cpp \ - $${SIP_DIR}/sipqtiLorentzFit.cpp \ - $${SIP_DIR}/sipqtiNonLinearFit.cpp \ - $${SIP_DIR}/sipqtiPluginFit.cpp \ - $${SIP_DIR}/sipqtiMultiPeakFit.cpp \ - $${SIP_DIR}/sipqtiPolynomialFit.cpp \ - $${SIP_DIR}/sipqtiLinearFit.cpp \ - $${SIP_DIR}/sipqtiGaussFit.cpp \ - $${SIP_DIR}/sipqtiFilter.cpp \ - $${SIP_DIR}/sipqtiDifferentiation.cpp \ - $${SIP_DIR}/sipqtiIntegration.cpp \ - $${SIP_DIR}/sipqtiInterpolation.cpp \ - $${SIP_DIR}/sipqtiSmoothFilter.cpp \ - $${SIP_DIR}/sipqtiFFTFilter.cpp \ - $${SIP_DIR}/sipqtiFFT.cpp \ - $${SIP_DIR}/sipqtiCorrelation.cpp \ - $${SIP_DIR}/sipqtiConvolution.cpp \ - $${SIP_DIR}/sipqtiDeconvolution.cpp \ - -exists(../../$${SIP_DIR}/sipqtiQList.cpp) { - # SIP < 4.9 - SOURCES += $${SIP_DIR}/sipqtiQList.cpp -} else { - SOURCES += \ - $${SIP_DIR}/sipqtiQList0101Folder.cpp\ - $${SIP_DIR}/sipqtiQList0101Graph.cpp\ - $${SIP_DIR}/sipqtiQList0101MdiSubWindow.cpp\ -} -} === added directory 'qtiplot/src/table' === removed directory 'qtiplot/src/table' === added file 'qtiplot/src/table/ExportDialog.cpp' --- qtiplot/src/table/ExportDialog.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/table/ExportDialog.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,302 @@ +/*************************************************************************** + File : ExportDialog.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Export ASCII dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "ExportDialog.h" +#include "ApplicationWindow.h" +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +ExportDialog::ExportDialog(MdiSubWindow *window, QWidget * parent, bool extended, Qt::WFlags flags) +: ExtensibleFileDialog( parent, extended, flags ), d_window(window) +{ + setWindowTitle( tr( "QtiPlot - Export ASCII" ) ); + setAttribute(Qt::WA_DeleteOnClose); + setSizeGripEnabled( true ); + setAcceptMode(QFileDialog::AcceptSave); + + initAdvancedOptions(); + setExtensionWidget((QWidget *)d_advanced_options); + + setFileTypeFilters(); + setFileMode(QFileDialog::AnyFile); + if (d_window){ + boxTable->setCurrentIndex(boxTable->findText(d_window->objectName())); + selectFile(d_window->objectName()); + } + +#if QT_VERSION >= 0x040300 + connect(this, SIGNAL(filterSelected ( const QString & )), + this, SLOT(updateAdvancedOptions ( const QString & ))); +#else + QList combo_boxes = findChildren(); + if (combo_boxes.size() >= 2) + connect(combo_boxes[1], SIGNAL(currentIndexChanged ( const QString & )), + this, SLOT(updateAdvancedOptions ( const QString & ))); +#endif + + selectNameFilter(((ApplicationWindow *)parent)->d_export_ASCII_file_filter); + updateAdvancedOptions(selectedFilter()); +} + +void ExportDialog::initAdvancedOptions() +{ + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + d_advanced_options = new QGroupBox(); + + QGridLayout *gl1 = new QGridLayout(); + gl1->addWidget(new QLabel(tr("Table")), 0, 0); + boxTable = new QComboBox(); + QStringList tables = app->tableNames() + app->matrixNames(); + boxTable->addItems(tables); + + boxTable->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); + gl1->addWidget(boxTable, 0, 1); + + boxAllTables = new QCheckBox(tr( "&All" )); + boxAllTables->setChecked(false); + gl1->addWidget(boxAllTables, 0, 2); + + separatorLbl = new QLabel( tr( "Separator" ) ); + gl1->addWidget(separatorLbl, 1, 0); + + boxSeparator = new QComboBox(); + boxSeparator->addItem(tr("TAB")); + boxSeparator->addItem(tr("SPACE")); + boxSeparator->addItem(";" + tr("TAB")); + boxSeparator->addItem("," + tr("TAB")); + boxSeparator->addItem(";" + tr("SPACE")); + boxSeparator->addItem("," + tr("SPACE")); + boxSeparator->addItem(";"); + boxSeparator->addItem(","); + boxSeparator->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); + boxSeparator->setEditable( true ); + gl1->addWidget(boxSeparator, 1, 1); + setColumnSeparator(app->d_export_col_separator); + + buttonHelp = new QPushButton(tr( "&Help" )); + gl1->addWidget( buttonHelp, 1, 2); + + QString help = tr("The column separator can be customized. The following special codes can be used:\n\\t for a TAB character \n\\s for a SPACE"); + help += "\n"+tr("The separator must not contain the following characters: 0-9eE.+-"); + + boxSeparator->setWhatsThis(help); + separatorLbl->setWhatsThis(help); + boxSeparator->setToolTip(help); + separatorLbl->setToolTip(help); + + boxNames = new QCheckBox(tr( "Include Column &Names" )); + boxNames->setChecked( app->d_export_col_names ); + boxNames->setVisible(d_window && d_window->inherits("Table")); + + boxComments = new QCheckBox(tr( "Include Column Co&mments" )); + boxComments->setChecked( app->d_export_col_comment ); + boxComments->setVisible(d_window && d_window->inherits("Table")); + + boxSelection = new QCheckBox(tr( "Export &Selection" )); + boxSelection->setChecked( app->d_export_table_selection ); + + QVBoxLayout *vl1 = new QVBoxLayout(d_advanced_options); + vl1->addLayout( gl1 ); + vl1->addWidget( boxNames ); + vl1->addWidget( boxComments ); + vl1->addWidget( boxSelection ); + + // signals and slots connections + connect( boxTable, SIGNAL(activated(const QString &)), this, SLOT(updateOptions(const QString &))); + connect( buttonHelp, SIGNAL(clicked()), this, SLOT(help())); + connect( boxAllTables, SIGNAL(toggled(bool)), this, SLOT( enableTableName(bool))); +} + +void ExportDialog::updateAdvancedOptions (const QString & filter) +{ + bool on = !filter.contains("*.tex") && !filter.contains("*.odf") && !filter.contains("*.html"); + separatorLbl->setVisible(on); + boxSeparator->setVisible(on); + buttonHelp->setVisible(on); +} + +void ExportDialog::help() +{ + QString s = tr("The column separator can be customized. The following special codes can be used:\n\\t for a TAB character \n\\s for a SPACE"); + s += "\n"+tr("The separator must not contain the following characters: 0-9eE.+-"); + QMessageBox::about((ApplicationWindow *)parent(), tr("QtiPlot - Help"), s); +} + +void ExportDialog::enableTableName(bool ok) +{ + QString selected_filter = selectedFilter(); + boxTable->setEnabled(!ok); + if (!ok){ + setFileMode(QFileDialog::AnyFile); + + if (d_window){ + boxTable->setCurrentIndex(boxTable->findText(d_window->objectName())); + selectFile(d_window->objectName()); + } + } else + setFileMode(QFileDialog::Directory); + + setFileTypeFilters(); + selectNameFilter(selected_filter); +} + +void ExportDialog::setFileTypeFilters() +{ + QList list; + list << "DAT"; + list << "ODF"; + list << "HTML"; + list << "TXT"; + list << "TEX"; + + QStringList filters; + for(int i = 0 ; i < list.count() ; i++) + filters << "*." + list[i].toLower(); + + filters.sort(); + setFilters(filters); +} + +void ExportDialog::accept() +{ + ApplicationWindow *app = (ApplicationWindow *)parent(); + if (!app) + return; + + QString sep = boxSeparator->currentText(); + sep.replace(tr("TAB"), "\t", Qt::CaseInsensitive); + sep.replace(tr("SPACE"), " "); + sep.replace("\\s", " "); + sep.replace("\\t", "\t"); + + if (sep.contains(QRegExp("[0-9.eE+-]"))){ + QMessageBox::warning(0, tr("QtiPlot - Import options error"), + tr("The separator must not contain the following characters: 0-9eE.+-")); + return; + } + + app->asciiDirPath = directory().path(); + if (selectedFiles().isEmpty()) + return; + + QString selected_filter = selectedFilter().remove("*"); + if (boxAllTables->isChecked()) + app->exportAllTables(directory().absolutePath(), selected_filter, sep, boxNames->isChecked(), boxComments->isChecked(), boxSelection->isChecked()); + else { + QString file_name = selectedFiles()[0]; + if(!file_name.endsWith(selected_filter, Qt::CaseInsensitive)) + file_name.append(selected_filter); + + if (app->d_confirm_overwrite && QFileInfo(file_name).exists() && + QMessageBox::warning(this, tr("QtiPlot") + " - " + tr("Overwrite file?"), + tr("%1 already exists.").arg(file_name) + "\n" + tr("Do you want to replace it?"), + QMessageBox::Yes|QMessageBox::No) == QMessageBox::No) + return; + + QFile file(file_name); + if ( !file.open( QIODevice::WriteOnly ) ){ + QMessageBox::critical(this, tr("QtiPlot - Export error"), + tr("Could not write to file:

%1

Please verify that you have the right to write to this location!").arg(file_name)); + return; + } + file.close(); + + if (d_window->inherits("Table")) + ((Table *)d_window)->exportASCII(file_name, sep, boxNames->isChecked(), + boxComments->isChecked(), boxSelection->isChecked()); + else if (d_window->isA("Matrix")) + ((Matrix *)d_window)->exportASCII(file_name, sep, boxSelection->isChecked()); + } + + close(); +} + +void ExportDialog::setColumnSeparator(const QString& sep) +{ + if (sep=="\t") + boxSeparator->setCurrentIndex(0); + else if (sep==" ") + boxSeparator->setCurrentIndex(1); + else if (sep==";\t") + boxSeparator->setCurrentIndex(2); + else if (sep==",\t") + boxSeparator->setCurrentIndex(3); + else if (sep=="; ") + boxSeparator->setCurrentIndex(4); + else if (sep==", ") + boxSeparator->setCurrentIndex(5); + else if (sep==";") + boxSeparator->setCurrentIndex(6); + else if (sep==",") + boxSeparator->setCurrentIndex(7); + else { + QString separator = sep; + boxSeparator->setEditText(separator.replace(" ","\\s").replace("\t","\\t")); + } +} + +void ExportDialog::closeEvent(QCloseEvent* e) +{ + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + if (app){ + app->d_export_col_names = boxNames->isChecked(); + app->d_export_table_selection = boxSelection->isChecked(); + app->d_export_col_comment = boxComments->isChecked(); + app->d_export_ASCII_file_filter = selectedFilter(); + + QString sep = boxSeparator->currentText(); + sep.replace(tr("TAB"), "\t", Qt::CaseInsensitive); + sep.replace(tr("SPACE"), " "); + sep.replace("\\s", " "); + sep.replace("\\t", "\t"); + app->d_export_col_separator = sep; + } + e->accept(); +} + +void ExportDialog::updateOptions(const QString & name) +{ + ApplicationWindow *app = (ApplicationWindow *)this->parent(); + if (!app) + return; + + MdiSubWindow* w = app->window(name); + if (!w) + return; + + boxComments->setVisible(w->inherits("Table")); + boxNames->setVisible(w->inherits("Table")); +} === removed file 'qtiplot/src/table/ExportDialog.cpp' --- qtiplot/src/table/ExportDialog.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/table/ExportDialog.cpp 1970-01-01 00:00:00 +0000 @@ -1,296 +0,0 @@ -/*************************************************************************** - File : ExportDialog.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Export ASCII dialog - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "ExportDialog.h" -#include "ApplicationWindow.h" -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -ExportDialog::ExportDialog(MdiSubWindow *window, QWidget * parent, bool extended, Qt::WFlags flags) -: ExtensibleFileDialog( parent, extended, flags ), d_window(window) -{ - setWindowTitle( tr( "QtiPlot - Export ASCII" ) ); - setAttribute(Qt::WA_DeleteOnClose); - setSizeGripEnabled( true ); - setAcceptMode(QFileDialog::AcceptSave); - - initAdvancedOptions(); - setExtensionWidget((QWidget *)d_advanced_options); - - setFileTypeFilters(); - setFileMode(QFileDialog::AnyFile); - if (d_window){ - boxTable->setCurrentIndex(boxTable->findText(d_window->objectName())); - selectFile(d_window->objectName()); - } - -#if QT_VERSION >= 0x040300 - connect(this, SIGNAL(filterSelected ( const QString & )), - this, SLOT(updateAdvancedOptions ( const QString & ))); -#else - QList combo_boxes = findChildren(); - if (combo_boxes.size() >= 2) - connect(combo_boxes[1], SIGNAL(currentIndexChanged ( const QString & )), - this, SLOT(updateAdvancedOptions ( const QString & ))); -#endif - - selectNameFilter(((ApplicationWindow *)parent)->d_export_ASCII_file_filter); - updateAdvancedOptions(selectedFilter()); -} - -void ExportDialog::initAdvancedOptions() -{ - ApplicationWindow *app = (ApplicationWindow *)this->parent(); - d_advanced_options = new QGroupBox(); - - QGridLayout *gl1 = new QGridLayout(); - gl1->addWidget(new QLabel(tr("Table")), 0, 0); - boxTable = new QComboBox(); - QStringList tables = app->tableNames() + app->matrixNames(); - boxTable->addItems(tables); - - boxTable->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); - gl1->addWidget(boxTable, 0, 1); - - boxAllTables = new QCheckBox(tr( "&All" )); - boxAllTables->setChecked(false); - gl1->addWidget(boxAllTables, 0, 2); - - separatorLbl = new QLabel( tr( "Separator" ) ); - gl1->addWidget(separatorLbl, 1, 0); - - boxSeparator = new QComboBox(); - boxSeparator->addItem(tr("TAB")); - boxSeparator->addItem(tr("SPACE")); - boxSeparator->addItem(";" + tr("TAB")); - boxSeparator->addItem("," + tr("TAB")); - boxSeparator->addItem(";" + tr("SPACE")); - boxSeparator->addItem("," + tr("SPACE")); - boxSeparator->addItem(";"); - boxSeparator->addItem(","); - boxSeparator->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); - boxSeparator->setEditable( true ); - gl1->addWidget(boxSeparator, 1, 1); - setColumnSeparator(app->d_export_col_separator); - - buttonHelp = new QPushButton(tr( "&Help" )); - gl1->addWidget( buttonHelp, 1, 2); - - QString help = tr("The column separator can be customized. The following special codes can be used:\n\\t for a TAB character \n\\s for a SPACE"); - help += "\n"+tr("The separator must not contain the following characters: 0-9eE.+-"); - - boxSeparator->setWhatsThis(help); - separatorLbl->setWhatsThis(help); - boxSeparator->setToolTip(help); - separatorLbl->setToolTip(help); - - boxNames = new QCheckBox(tr( "Include Column &Names" )); - boxNames->setChecked( app->d_export_col_names ); - boxNames->setVisible(d_window && d_window->inherits("Table")); - - boxComments = new QCheckBox(tr( "Include Column Co&mments" )); - boxComments->setChecked( app->d_export_col_comment ); - boxComments->setVisible(d_window && d_window->inherits("Table")); - - boxSelection = new QCheckBox(tr( "Export &Selection" )); - boxSelection->setChecked( app->d_export_table_selection ); - - QVBoxLayout *vl1 = new QVBoxLayout(d_advanced_options); - vl1->addLayout( gl1 ); - vl1->addWidget( boxNames ); - vl1->addWidget( boxComments ); - vl1->addWidget( boxSelection ); - - // signals and slots connections - connect( boxTable, SIGNAL(activated(const QString &)), this, SLOT(updateOptions(const QString &))); - connect( buttonHelp, SIGNAL(clicked()), this, SLOT(help())); - connect( boxAllTables, SIGNAL(toggled(bool)), this, SLOT( enableTableName(bool))); -} - -void ExportDialog::updateAdvancedOptions (const QString & filter) -{ - bool on = !filter.contains("*.tex") && !filter.contains("*.odf") && !filter.contains("*.html"); - separatorLbl->setVisible(on); - boxSeparator->setVisible(on); - buttonHelp->setVisible(on); -} - -void ExportDialog::help() -{ - QString s = tr("The column separator can be customized. The following special codes can be used:\n\\t for a TAB character \n\\s for a SPACE"); - s += "\n"+tr("The separator must not contain the following characters: 0-9eE.+-"); - QMessageBox::about((ApplicationWindow *)parent(), tr("QtiPlot - Help"), s); -} - -void ExportDialog::enableTableName(bool ok) -{ - QString selected_filter = selectedFilter(); - boxTable->setEnabled(!ok); - if (!ok){ - setFileMode(QFileDialog::AnyFile); - - if (d_window){ - boxTable->setCurrentIndex(boxTable->findText(d_window->objectName())); - selectFile(d_window->objectName()); - } - } else - setFileMode(QFileDialog::Directory); - - setFileTypeFilters(); - selectNameFilter(selected_filter); -} - -void ExportDialog::setFileTypeFilters() -{ - QList list; - list << "DAT"; - list << "ODF"; - list << "HTML"; - list << "TXT"; - list << "TEX"; - - QStringList filters; - for(int i = 0 ; i < list.count() ; i++) - filters << "*." + list[i].toLower(); - - filters.sort(); - setFilters(filters); -} - -void ExportDialog::accept() -{ - ApplicationWindow *app = (ApplicationWindow *)parent(); - if (!app) - return; - - QString sep = boxSeparator->currentText(); - sep.replace(tr("TAB"), "\t", Qt::CaseInsensitive); - sep.replace(tr("SPACE"), " "); - sep.replace("\\s", " "); - sep.replace("\\t", "\t"); - - if (sep.contains(QRegExp("[0-9.eE+-]"))){ - QMessageBox::warning(0, tr("QtiPlot - Import options error"), - tr("The separator must not contain the following characters: 0-9eE.+-")); - return; - } - - app->asciiDirPath = directory().path(); - if (selectedFiles().isEmpty()) - return; - - QString selected_filter = selectedFilter().remove("*"); - if (boxAllTables->isChecked()) - app->exportAllTables(directory().absolutePath(), selected_filter, sep, boxNames->isChecked(), boxComments->isChecked(), boxSelection->isChecked()); - else { - QString file_name = selectedFiles()[0]; - if(!file_name.endsWith(selected_filter, Qt::CaseInsensitive)) - file_name.append(selected_filter); - - QFile file(file_name); - if ( !file.open( QIODevice::WriteOnly ) ){ - QMessageBox::critical(this, tr("QtiPlot - Export error"), - tr("Could not write to file:

%1

Please verify that you have the right to write to this location!").arg(file_name)); - return; - } - file.close(); - - if (d_window->inherits("Table")) - ((Table *)d_window)->exportASCII(file_name, sep, boxNames->isChecked(), - boxComments->isChecked(), boxSelection->isChecked()); - else if (d_window->isA("Matrix")) - ((Matrix *)d_window)->exportASCII(file_name, sep, boxSelection->isChecked()); - } - - close(); -} - -void ExportDialog::setColumnSeparator(const QString& sep) -{ - if (sep=="\t") - boxSeparator->setCurrentIndex(0); - else if (sep==" ") - boxSeparator->setCurrentIndex(1); - else if (sep==";\t") - boxSeparator->setCurrentIndex(2); - else if (sep==",\t") - boxSeparator->setCurrentIndex(3); - else if (sep=="; ") - boxSeparator->setCurrentIndex(4); - else if (sep==", ") - boxSeparator->setCurrentIndex(5); - else if (sep==";") - boxSeparator->setCurrentIndex(6); - else if (sep==",") - boxSeparator->setCurrentIndex(7); - else { - QString separator = sep; - boxSeparator->setEditText(separator.replace(" ","\\s").replace("\t","\\t")); - } -} - -void ExportDialog::closeEvent(QCloseEvent* e) -{ - ApplicationWindow *app = (ApplicationWindow *)this->parent(); - if (app){ - app->d_export_col_names = boxNames->isChecked(); - app->d_export_table_selection = boxSelection->isChecked(); - app->d_export_col_comment = boxComments->isChecked(); - app->d_export_ASCII_file_filter = selectedFilter(); - - QString sep = boxSeparator->currentText(); - sep.replace(tr("TAB"), "\t", Qt::CaseInsensitive); - sep.replace(tr("SPACE"), " "); - sep.replace("\\s", " "); - sep.replace("\\t", "\t"); - app->d_export_col_separator = sep; - } - e->accept(); -} - -void ExportDialog::updateOptions(const QString & name) -{ - ApplicationWindow *app = (ApplicationWindow *)this->parent(); - if (!app) - return; - - MdiSubWindow* w = app->window(name); - if (!w) - return; - - boxComments->setVisible(w->inherits("Table")); - boxNames->setVisible(w->inherits("Table")); -} === added file 'qtiplot/src/table/ExportDialog.h' --- qtiplot/src/table/ExportDialog.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/table/ExportDialog.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,100 @@ +/*************************************************************************** + File : ExportDialog.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Export ASCII dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef EXPORTDIALOG_H +#define EXPORTDIALOG_H + +#include + +class QPushButton; +class QCheckBox; +class QComboBox; +class QGroupBox; +class QLabel; +class MdiSubWindow; + +//! Export ASCII dialog +class ExportDialog : public ExtensibleFileDialog +{ + Q_OBJECT + +public: + //! Constructor + /** + * \param window window to be exported + * \param parent parent widget + * \param extended flag: show/hide the advanced options on start-up + * \param fl window flags + */ + ExportDialog(MdiSubWindow *window = NULL, QWidget* parent = 0, bool extended = true, Qt::WFlags fl = 0 ); + +private: + //! Pointer to the window to be exported. + MdiSubWindow *d_window; + + void closeEvent(QCloseEvent*); + //! Create #d_advanced_options and everything it contains. + void initAdvancedOptions(); + void setFileTypeFilters(); + //! Container widget for all advanced options. + QGroupBox *d_advanced_options; + + QPushButton* buttonHelp; + QCheckBox* boxNames; + QCheckBox* boxComments; + QCheckBox* boxSelection; + QCheckBox* boxAllTables; + QComboBox* boxSeparator; + QComboBox* boxTable; + QLabel *separatorLbl; + +public slots: + //! Set the column delimiter + void setColumnSeparator(const QString& sep); + //! Enable/disable export options depending if the selected window is a Table or a Matrix. + void updateOptions(const QString & name); + +private slots: + //! Enable/disable the tables combox box + /** + * The tables combo box is disabled when + * the checkbox "all" is selected. + */ + void enableTableName(bool ok); + + //! Update which options are visible and enabled based on the output format. + void updateAdvancedOptions (const QString &filter); + +protected slots: + //! Accept changes + void accept(); + //! Display help + void help(); +}; + +#endif // ExportDialog_H === removed file 'qtiplot/src/table/ExportDialog.h' --- qtiplot/src/table/ExportDialog.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/table/ExportDialog.h 1970-01-01 00:00:00 +0000 @@ -1,100 +0,0 @@ -/*************************************************************************** - File : ExportDialog.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Export ASCII dialog - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef EXPORTDIALOG_H -#define EXPORTDIALOG_H - -#include - -class QPushButton; -class QCheckBox; -class QComboBox; -class QGroupBox; -class QLabel; -class MdiSubWindow; - -//! Export ASCII dialog -class ExportDialog : public ExtensibleFileDialog -{ - Q_OBJECT - -public: - //! Constructor - /** - * \param window window to be exported - * \param parent parent widget - * \param extended flag: show/hide the advanced options on start-up - * \param fl window flags - */ - ExportDialog(MdiSubWindow *window = NULL, QWidget* parent = 0, bool extended = true, Qt::WFlags fl = 0 ); - -private: - //! Pointer to the window to be exported. - MdiSubWindow *d_window; - - void closeEvent(QCloseEvent*); - //! Create #d_advanced_options and everything it contains. - void initAdvancedOptions(); - void setFileTypeFilters(); - //! Container widget for all advanced options. - QGroupBox *d_advanced_options; - - QPushButton* buttonHelp; - QCheckBox* boxNames; - QCheckBox* boxComments; - QCheckBox* boxSelection; - QCheckBox* boxAllTables; - QComboBox* boxSeparator; - QComboBox* boxTable; - QLabel *separatorLbl; - -public slots: - //! Set the column delimiter - void setColumnSeparator(const QString& sep); - //! Enable/disable export options depending if the selected window is a Table or a Matrix. - void updateOptions(const QString & name); - -private slots: - //! Enable/disable the tables combox box - /** - * The tables combo box is disabled when - * the checkbox "all" is selected. - */ - void enableTableName(bool ok); - - //! Update which options are visible and enabled based on the output format. - void updateAdvancedOptions (const QString &filter); - -protected slots: - //! Accept changes - void accept(); - //! Display help - void help(); -}; - -#endif // ExportDialog_H === added file 'qtiplot/src/table/ExtractDataDialog.cpp' --- qtiplot/src/table/ExtractDataDialog.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/table/ExtractDataDialog.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,229 @@ +/*************************************************************************** + File : ExtractDataDialog.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2010 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Extract data values dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "ExtractDataDialog.h" +#include "Table.h" +#include +#include +#include "muParserScripting.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +ExtractDataDialog::ExtractDataDialog( ScriptingEnv *env, QWidget* parent, Qt::WFlags fl ) + : QDialog( parent, fl ), scripted(env) +{ + setName( "ExtractDataDialog" ); + setWindowTitle( tr( "QtiPlot") + " - " + tr("Extract Data")); + setSizeGripEnabled(true); + setAttribute(Qt::WA_DeleteOnClose); + + QHBoxLayout *hbox1 = new QHBoxLayout(); + hbox1->addWidget(new QLabel(tr("For row (i)"))); + start = new QSpinBox(); + start->setMinValue(1); + start->setMaxValue(INT_MAX); + hbox1->addWidget(start); + + hbox1->addWidget(new QLabel(tr("to"))); + + end = new QSpinBox(); + end->setMinValue(1); + end->setMaxValue(INT_MAX); + hbox1->addWidget(end); + + QGridLayout *gl1 = new QGridLayout(); + functions = new QComboBox(); + functions->addItems(muParserScripting::functionsList(true)); + gl1->addWidget(functions, 0, 0); + btnAddFunction = new QPushButton(tr( "Add &function" )); + gl1->addWidget(btnAddFunction, 0, 1); + boxColumn = new QComboBox(); + gl1->addWidget(boxColumn, 1, 0); + btnAddCol = new QPushButton(tr( "Add co&lumn" )); + gl1->addWidget(btnAddCol, 1, 1); + boxOperators = new QComboBox(); + boxOperators->addItems(QStringList() << ">" << ">=" << "<" << "<=" << "==" << "!="); + gl1->addWidget(boxOperators, 2, 0); + btnAddOp = new QPushButton(tr( "Add &operator" )); + gl1->addWidget(btnAddOp, 2, 1); + + QGroupBox *gb = new QGroupBox(); + QVBoxLayout *vbox1 = new QVBoxLayout(); + vbox1->addLayout(hbox1); + vbox1->addLayout(gl1); + gb->setLayout(vbox1); + gb->setSizePolicy(QSizePolicy (QSizePolicy::Preferred, QSizePolicy::Preferred)); + + explain = new QTextEdit(); + explain->setReadOnly (true); + explain->setSizePolicy(QSizePolicy (QSizePolicy::Preferred, QSizePolicy::Preferred)); + QPalette palette = explain->palette(); + palette.setColor(QPalette::Active, QPalette::Base, Qt::lightGray); + explain->setPalette(palette); + + QHBoxLayout *hbox2 = new QHBoxLayout(); + hbox2->addWidget(explain); + hbox2->addWidget(gb); + + commands = new ScriptEdit(scriptEnv); + commands->setTabStopWidth(((ApplicationWindow *)parent)->d_notes_tab_length); + commands->setFont(((ApplicationWindow *)parent)->d_notes_font); + + QVBoxLayout *vbox2 = new QVBoxLayout(); + btnApply = new QPushButton(tr( "&Apply" )); + vbox2->addWidget(btnApply); + buttonClearFormulas = new QPushButton(tr("Clea&r" )); + vbox2->addWidget(buttonClearFormulas); + btnCancel = new QPushButton(tr( "&Close" )); + vbox2->addWidget(btnCancel); + vbox2->addStretch(); + + QHBoxLayout *hbox4 = new QHBoxLayout(); + hbox4->addWidget(commands); + hbox4->addLayout(vbox2); + + QHBoxLayout *hbox5 = new QHBoxLayout(); + QLabel *l = new QLabel(tr("&Put into table")); + hbox5->addWidget(l); + + destNameBox = new QLineEdit; + destNameBox->setText(tr("Table")); + l->setBuddy(destNameBox); + hbox5->addWidget(destNameBox); + + QVBoxLayout* vbox3 = new QVBoxLayout(); + vbox3->addLayout(hbox2); + vbox3->addLayout(hbox5); + + QLabel *l2 = new QLabel(tr("Cond&ition:")); + l2->setBuddy(commands); + vbox3->addWidget(l2); + vbox3->addLayout(hbox4); + + setLayout(vbox3); + setFocusProxy (commands); + commands->setFocus(); + + if (functions->count() > 0) + insertExplain(0); + + connect(btnAddFunction, SIGNAL(clicked()),this, SLOT(insertFunction())); + connect(btnAddCol, SIGNAL(clicked()),this, SLOT(insertCol())); + connect(btnAddOp, SIGNAL(clicked()),this, SLOT(insertOp())); + connect(btnApply, SIGNAL(clicked()),this, SLOT(apply())); + connect(btnCancel, SIGNAL(clicked()),this, SLOT(close())); + connect(functions, SIGNAL(activated(int)),this, SLOT(insertExplain(int))); + connect(buttonClearFormulas, SIGNAL(clicked()), this, SLOT(clearFormulas())); +} + +QSize ExtractDataDialog::sizeHint() const +{ + return QSize( 400, 190 ); +} + +void ExtractDataDialog::apply() +{ + Table *t = table->extractData(destNameBox->text(), commands->text(), start->value() - 1, end->value() - 1); + if (!t) + return; + + t->show(); +} + +void ExtractDataDialog::insertExplain(int index) +{ + + explain->setText(muParserScripting::explainFunction(functions->text(index))); +} + +void ExtractDataDialog::insertFunction() +{ + commands->insertFunction(functions->currentText()); +} + +void ExtractDataDialog::insertCol() +{ + commands->insert(boxColumn->currentText()); +} + +void ExtractDataDialog::insertOp() +{ + commands->insert(boxOperators->currentText()); +} + +void ExtractDataDialog::setTable(Table* w) +{ + table = w; + QStringList colNames = w->colNames(); + int cols = w->numCols(); + for (int i=0; iinsertItem("col(\""+colNames[i]+"\")", i); + + int s = w->table()->currentSelection(); + if (s >= 0) { + Q3TableSelection sel = w->table()->selection(s); + w->setSelectedCol(sel.leftCol()); + + start->setValue(sel.topRow() + 1); + end->setValue(sel.bottomRow() + 1); + } else { + start->setValue(1); + end->setValue(w->numRows()); + } + + commands->setContext(w); +} + +void ExtractDataDialog::setCompleter(QCompleter *completer) +{ + if (!completer) + return; + + commands->setCompleter(completer); +} + +void ExtractDataDialog::clearFormulas() +{ + if (!table) + return; + + table->clearCommands(); + commands->clear(); +} === added file 'qtiplot/src/table/ExtractDataDialog.h' --- qtiplot/src/table/ExtractDataDialog.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/table/ExtractDataDialog.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,88 @@ +/*************************************************************************** + File : ExtractDataDialog.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2010 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Extract data values dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef EXTRACTDATADIALOG_H +#define EXTRACTDATADIALOG_H + +#include +#include +#include + +class QLineEdit; +class QComboBox; +class QTextEdit; +class QSpinBox; +class QPushButton; +class QLabel; +class QCompleter; +class Table; +class ScriptingEnv; +class ScriptEdit; + + +//! Set column values dialog +class ExtractDataDialog : public QDialog, public scripted +{ + Q_OBJECT + +public: + ExtractDataDialog( ScriptingEnv *env, QWidget* parent = 0, Qt::WFlags fl = 0 ); + void setTable(Table* w); + void setCompleter(QCompleter *); + +private slots: + void apply(); + void insertFunction(); + void insertCol(); + void insertOp(); + void insertExplain(int index); + void clearFormulas(); + +private: + Table* table; + + QSize sizeHint() const ; + + QComboBox* functions; + QComboBox* boxColumn; + QComboBox *boxOperators; + + QPushButton* btnAddFunction; + QPushButton* btnAddCol; + QPushButton* btnCancel; + QPushButton *btnApply; + QPushButton* buttonClearFormulas; + QPushButton* btnAddOp; + + ScriptEdit* commands; + QTextEdit* explain; + QSpinBox* start, *end; + QLineEdit *destNameBox; +}; + +#endif // === added file 'qtiplot/src/table/SetColValuesDialog.cpp' --- qtiplot/src/table/SetColValuesDialog.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/table/SetColValuesDialog.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,316 @@ +/*************************************************************************** + File : SetColValuesDialog.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2004 - 2010 by Ion Vasilief, + (C) 2006 - June 2007 by Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de + Description : Set column values dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "SetColValuesDialog.h" +#include "Table.h" +#include +#include +#include "muParserScripting.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef SCRIPTING_PYTHON +#include +#endif + +SetColValuesDialog::SetColValuesDialog( ScriptingEnv *env, QWidget* parent, Qt::WFlags fl ) + : QDialog( parent, fl ), scripted(env) +{ + setName( "SetColValuesDialog" ); + setWindowTitle( tr( "QtiPlot - Set column values" ) ); + setSizeGripEnabled(true); + setAttribute(Qt::WA_DeleteOnClose); + + QHBoxLayout *hbox1 = new QHBoxLayout(); + hbox1->addWidget(new QLabel(tr("For row (i)"))); + start = new QSpinBox(); + start->setMinValue(1); + start->setMaxValue(INT_MAX); + hbox1->addWidget(start); + + hbox1->addWidget(new QLabel(tr("to"))); + + end = new QSpinBox(); + end->setMinValue(1); + end->setMaxValue(INT_MAX); + hbox1->addWidget(end); + + QGridLayout *gl1 = new QGridLayout(); + functions = new QComboBox(false); + functions->addItems(muParserScripting::functionsList(true)); + gl1->addWidget(functions, 0, 0); + btnAddFunction = new QPushButton(tr( "Add function" )); + gl1->addWidget(btnAddFunction, 0, 1); + boxColumn = new QComboBox(false); + gl1->addWidget(boxColumn, 1, 0); + btnAddCol = new QPushButton(tr( "Add column" )); + gl1->addWidget(btnAddCol, 1, 1); + + QHBoxLayout *hbox3 = new QHBoxLayout(); + hbox3->addStretch(); + buttonPrev = new QPushButton("&<<"); + hbox3->addWidget(buttonPrev); + buttonNext = new QPushButton("&>>"); + hbox3->addWidget(buttonNext); + gl1->addLayout(hbox3, 2, 0); + addCellButton = new QPushButton(tr( "Add cell" )); + gl1->addWidget(addCellButton, 2, 1); + + QGroupBox *gb = new QGroupBox(); + QVBoxLayout *vbox1 = new QVBoxLayout(); + vbox1->addLayout(hbox1); + vbox1->addLayout(gl1); + gb->setLayout(vbox1); + gb->setSizePolicy(QSizePolicy (QSizePolicy::Preferred, QSizePolicy::Preferred)); + + explain = new QTextEdit(); + explain->setReadOnly (true); + explain->setSizePolicy(QSizePolicy (QSizePolicy::Preferred, QSizePolicy::Preferred)); + QPalette palette = explain->palette(); + palette.setColor(QPalette::Active, QPalette::Base, Qt::lightGray); + explain->setPalette(palette); + + QHBoxLayout *hbox2 = new QHBoxLayout(); + hbox2->addWidget(explain); + hbox2->addWidget(gb); + + commands = new ScriptEdit(scriptEnv); + commands->setTabStopWidth(((ApplicationWindow *)parent)->d_notes_tab_length); + commands->setFont(((ApplicationWindow *)parent)->d_notes_font); + + QVBoxLayout *vbox2 = new QVBoxLayout(); + btnApply = new QPushButton(tr( "&Apply" )); + vbox2->addWidget(btnApply); + buttonClearFormulas = new QPushButton(tr("Clear &Formulas" )); + vbox2->addWidget(buttonClearFormulas); + btnCancel = new QPushButton(tr( "&Close" )); + vbox2->addWidget(btnCancel); + vbox2->addStretch(); + + QHBoxLayout *hbox4 = new QHBoxLayout(); + hbox4->addWidget(commands); + hbox4->addLayout(vbox2); + + QVBoxLayout* vbox3 = new QVBoxLayout(); + vbox3->addLayout(hbox2); +#ifdef SCRIPTING_PYTHON + boxMuParser = NULL; + if (env->name() != QString("muParser")){ + boxMuParser = new QCheckBox(tr("Use built-in muParser (much faster)")); + boxMuParser->setChecked(true); + connect(boxMuParser, SIGNAL(toggled(bool)), this, SLOT(updateFunctionsList(bool))); + updateFunctionsList(true); + vbox3->addWidget(boxMuParser); + } +#endif + + colNameLabel = new QLabel(); + vbox3->addWidget(colNameLabel); + vbox3->addLayout(hbox4); + + setLayout(vbox3); + setFocusProxy (commands); + commands->setFocus(); + + if (functions->count() > 0) + insertExplain(0); + + connect(btnAddFunction, SIGNAL(clicked()),this, SLOT(insertFunction())); + connect(btnAddCol, SIGNAL(clicked()),this, SLOT(insertCol())); + connect(addCellButton, SIGNAL(clicked()),this, SLOT(insertCell())); + connect(btnApply, SIGNAL(clicked()),this, SLOT(apply())); + connect(btnCancel, SIGNAL(clicked()),this, SLOT(close())); + connect(functions, SIGNAL(activated(int)),this, SLOT(insertExplain(int))); + connect(buttonPrev, SIGNAL(clicked()), this, SLOT(prevColumn())); + connect(buttonNext, SIGNAL(clicked()), this, SLOT(nextColumn())); + connect(buttonClearFormulas, SIGNAL(clicked()), this, SLOT(clearFormulas())); +} + +void SetColValuesDialog::prevColumn() +{ + int sc = table->selectedColumn(); + updateColumn(--sc); +} + +void SetColValuesDialog::nextColumn() +{ + int sc = table->selectedColumn(); + updateColumn(++sc); +} + +void SetColValuesDialog::updateColumn(int sc) +{ + if (sc < 0 || sc > table->numCols() - 1) + return; + + if (sc == 0) + buttonPrev->setEnabled(false); + else + buttonPrev->setEnabled(true); + + if (sc == table->numCols() - 1) + buttonNext->setEnabled(false); + else + buttonNext->setEnabled(true); + + table->setSelectedCol(sc); + table->table()->clearSelection(); + table->table()->selectColumn(sc); + colNameLabel->setText("col(\""+table->colLabel(sc)+"\")= "); + + QStringList com = table->getCommands(); + commands->setText(com[sc]); + QTextCursor cursor = commands->textCursor(); + cursor.movePosition(QTextCursor::End,QTextCursor::KeepAnchor); +} + +QSize SetColValuesDialog::sizeHint() const +{ + return QSize( 400, 190 ); +} + +void SetColValuesDialog::customEvent(QEvent *e) +{ + if (e->type() == SCRIPTING_CHANGE_EVENT) + scriptingChangeEvent((ScriptingChangeEvent*)e); +} + +bool SetColValuesDialog::apply() +{ + int col = table->selectedColumn(); + if (col < 0 || col > table->numCols() - 1) + return false; + + QString formula = commands->text(); + QString oldFormula = table->getCommands()[col]; + + table->setCommand(col,formula); + bool useMuParser = true; +#ifdef SCRIPTING_PYTHON + if(boxMuParser) + useMuParser = boxMuParser->isChecked(); +#endif + if(table->calculate(col, start->value()-1, end->value()-1, useMuParser)) + return true; + + table->setCommand(col, oldFormula); + return false; +} + +void SetColValuesDialog::insertExplain(int index) +{ +#ifdef SCRIPTING_PYTHON + if (boxMuParser && boxMuParser->isChecked()) + explain->setText(muParserScripting::explainFunction(functions->text(index))); + else + explain->setText(scriptEnv->mathFunctionDoc(functions->text(index))); +#else + explain->setText(scriptEnv->mathFunctionDoc(functions->text(index))); +#endif +} + +void SetColValuesDialog::insertFunction() +{ + commands->insertFunction(functions->currentText()); +} + +void SetColValuesDialog::insertCol() +{ + commands->insert(boxColumn->currentText()); +} + +void SetColValuesDialog::insertCell() +{ + commands->insert(boxColumn->currentText().remove(")")+", i)"); +} + +void SetColValuesDialog::setTable(Table* w) +{ + table = w; + QStringList colNames = w->colNames(); + int cols = w->numCols(); + for (int i=0; iinsertItem("col(\""+colNames[i]+"\")", i); + + int s = w->table()->currentSelection(); + if (s >= 0) { + Q3TableSelection sel = w->table()->selection(s); + w->setSelectedCol(sel.leftCol()); + + start->setValue(sel.topRow() + 1); + end->setValue(sel.bottomRow() + 1); + } else { + start->setValue(1); + end->setValue(w->numRows()); + } + + updateColumn(w->selectedColumn()); + commands->setContext(w); +} + +void SetColValuesDialog::setCompleter(QCompleter *completer) +{ + if (!completer) + return; + + commands->setCompleter(completer); +} + +void SetColValuesDialog::clearFormulas() +{ + if (!table) + return; + + table->clearCommands(); + commands->clear(); +} + +#ifdef SCRIPTING_PYTHON +void SetColValuesDialog::updateFunctionsList(bool muParser) +{ + functions->clear(); + if (muParser) + functions->addItems(muParserScripting::functionsList(true)); + else + functions->addItems(scriptingEnv()->mathFunctions()); + + if (functions->count() > 0) + insertExplain(0); +} +#endif === removed file 'qtiplot/src/table/SetColValuesDialog.cpp' --- qtiplot/src/table/SetColValuesDialog.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/table/SetColValuesDialog.cpp 1970-01-01 00:00:00 +0000 @@ -1,292 +0,0 @@ -/*************************************************************************** - File : SetColValuesDialog.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de - Description : Set column values dialog - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "SetColValuesDialog.h" -#include "Table.h" -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef SCRIPTING_PYTHON -#include -#endif - -SetColValuesDialog::SetColValuesDialog( ScriptingEnv *env, QWidget* parent, Qt::WFlags fl ) - : QDialog( parent, fl ), scripted(env) -{ - setName( "SetColValuesDialog" ); - setWindowTitle( tr( "QtiPlot - Set column values" ) ); - setSizeGripEnabled(true); - setAttribute(Qt::WA_DeleteOnClose); - - QHBoxLayout *hbox1 = new QHBoxLayout(); - hbox1->addWidget(new QLabel(tr("For row (i)"))); - start = new QSpinBox(); - start->setMinValue(1); - start->setMaxValue(INT_MAX); - hbox1->addWidget(start); - - hbox1->addWidget(new QLabel(tr("to"))); - - end = new QSpinBox(); - end->setMinValue(1); - end->setMaxValue(INT_MAX); - hbox1->addWidget(end); - - QGridLayout *gl1 = new QGridLayout(); - functions = new QComboBox(false); - gl1->addWidget(functions, 0, 0); - btnAddFunction = new QPushButton(tr( "Add function" )); - gl1->addWidget(btnAddFunction, 0, 1); - boxColumn = new QComboBox(false); - gl1->addWidget(boxColumn, 1, 0); - btnAddCol = new QPushButton(tr( "Add column" )); - gl1->addWidget(btnAddCol, 1, 1); - - QHBoxLayout *hbox3 = new QHBoxLayout(); - hbox3->addStretch(); - buttonPrev = new QPushButton("&<<"); - hbox3->addWidget(buttonPrev); - buttonNext = new QPushButton("&>>"); - hbox3->addWidget(buttonNext); - gl1->addLayout(hbox3, 2, 0); - addCellButton = new QPushButton(tr( "Add cell" )); - gl1->addWidget(addCellButton, 2, 1); - - QGroupBox *gb = new QGroupBox(); - QVBoxLayout *vbox1 = new QVBoxLayout(); - vbox1->addLayout(hbox1); - vbox1->addLayout(gl1); - gb->setLayout(vbox1); - gb->setSizePolicy(QSizePolicy (QSizePolicy::Preferred, QSizePolicy::Preferred)); - - explain = new QTextEdit(); - explain->setReadOnly (true); - explain->setSizePolicy(QSizePolicy (QSizePolicy::Preferred, QSizePolicy::Preferred)); - QPalette palette = explain->palette(); - palette.setColor(QPalette::Active, QPalette::Base, Qt::lightGray); - explain->setPalette(palette); - - QHBoxLayout *hbox2 = new QHBoxLayout(); - hbox2->addWidget(explain); - hbox2->addWidget(gb); - - commands = new ScriptEdit(scriptEnv); - commands->setTabStopWidth(((ApplicationWindow *)parent)->d_notes_tab_length); - commands->setFont(((ApplicationWindow *)parent)->d_notes_font); - - QVBoxLayout *vbox2 = new QVBoxLayout(); - btnApply = new QPushButton(tr( "&Apply" )); - vbox2->addWidget(btnApply); - buttonClearFormulas = new QPushButton(tr("Clear &Formulas" )); - vbox2->addWidget(buttonClearFormulas); - btnCancel = new QPushButton(tr( "&Close" )); - vbox2->addWidget(btnCancel); - vbox2->addStretch(); - - QHBoxLayout *hbox4 = new QHBoxLayout(); - hbox4->addWidget(commands); - hbox4->addLayout(vbox2); - - QVBoxLayout* vbox3 = new QVBoxLayout(); - vbox3->addLayout(hbox2); -#ifdef SCRIPTING_PYTHON - boxMuParser = NULL; - if (env->name() != QString("muParser")){ - boxMuParser = new QCheckBox(tr("Use built-in muParser (much faster)")); - boxMuParser->setChecked(true); - vbox3->addWidget(boxMuParser); - } -#endif - - colNameLabel = new QLabel(); - vbox3->addWidget(colNameLabel); - vbox3->addLayout(hbox4); - - setLayout(vbox3); - setFocusProxy (commands); - commands->setFocus(); - - functions->insertStringList(scriptEnv->mathFunctions(), -1); - if (functions->count() > 0) - insertExplain(0); - - connect(btnAddFunction, SIGNAL(clicked()),this, SLOT(insertFunction())); - connect(btnAddCol, SIGNAL(clicked()),this, SLOT(insertCol())); - connect(addCellButton, SIGNAL(clicked()),this, SLOT(insertCell())); - connect(btnApply, SIGNAL(clicked()),this, SLOT(apply())); - connect(btnCancel, SIGNAL(clicked()),this, SLOT(close())); - connect(functions, SIGNAL(activated(int)),this, SLOT(insertExplain(int))); - connect(buttonPrev, SIGNAL(clicked()), this, SLOT(prevColumn())); - connect(buttonNext, SIGNAL(clicked()), this, SLOT(nextColumn())); - connect(buttonClearFormulas, SIGNAL(clicked()), this, SLOT(clearFormulas())); -} - -void SetColValuesDialog::prevColumn() -{ - int sc = table->selectedColumn(); - updateColumn(--sc); -} - -void SetColValuesDialog::nextColumn() -{ - int sc = table->selectedColumn(); - updateColumn(++sc); -} - -void SetColValuesDialog::updateColumn(int sc) -{ - if (sc < 0 || sc > table->numCols() - 1) - return; - - if (sc == 0) - buttonPrev->setEnabled(false); - else - buttonPrev->setEnabled(true); - - if (sc == table->numCols() - 1) - buttonNext->setEnabled(false); - else - buttonNext->setEnabled(true); - - table->setSelectedCol(sc); - table->table()->clearSelection(); - table->table()->selectColumn(sc); - colNameLabel->setText("col(\""+table->colLabel(sc)+"\")= "); - - QStringList com = table->getCommands(); - commands->setText(com[sc]); - QTextCursor cursor = commands->textCursor(); - cursor.movePosition(QTextCursor::End,QTextCursor::KeepAnchor); -} - -QSize SetColValuesDialog::sizeHint() const -{ - return QSize( 400, 190 ); -} - -void SetColValuesDialog::customEvent(QEvent *e) -{ - if (e->type() == SCRIPTING_CHANGE_EVENT) - scriptingChangeEvent((ScriptingChangeEvent*)e); -} - -bool SetColValuesDialog::apply() -{ - int col = table->selectedColumn(); - if (col < 0 || col > table->numCols() - 1) - return false; - - QString formula = commands->text(); - QString oldFormula = table->getCommands()[col]; - - table->setCommand(col,formula); - bool useMuParser = true; -#ifdef SCRIPTING_PYTHON - if(boxMuParser) - useMuParser = boxMuParser->isChecked(); -#endif - if(table->calculate(col, start->value()-1, end->value()-1, useMuParser)) - return true; - - table->setCommand(col, oldFormula); - return false; -} - -void SetColValuesDialog::insertExplain(int index) -{ - explain->setText(scriptEnv->mathFunctionDoc(functions->text(index))); -} - -void SetColValuesDialog::insertFunction() -{ - commands->insertFunction(functions->currentText()); -} - -void SetColValuesDialog::insertCol() -{ - commands->insert(boxColumn->currentText()); -} - -void SetColValuesDialog::insertCell() -{ - commands->insert(boxColumn->currentText().remove(")")+", i)"); -} - -void SetColValuesDialog::setTable(Table* w) -{ - table = w; - QStringList colNames = w->colNames(); - int cols = w->numCols(); - for (int i=0; iinsertItem("col(\""+colNames[i]+"\")", i); - - int s = w->table()->currentSelection(); - if (s >= 0) { - Q3TableSelection sel = w->table()->selection(s); - w->setSelectedCol(sel.leftCol()); - - start->setValue(sel.topRow() + 1); - end->setValue(sel.bottomRow() + 1); - } else { - start->setValue(1); - end->setValue(w->numRows()); - } - - updateColumn(w->selectedColumn()); - commands->setContext(w); -} - -void SetColValuesDialog::setCompleter(QCompleter *completer) -{ - if (!completer) - return; - - commands->setCompleter(completer); -} - -void SetColValuesDialog::clearFormulas() -{ - if (!table) - return; - - table->clearCommands(); - commands->clear(); - -} === added file 'qtiplot/src/table/SetColValuesDialog.h' --- qtiplot/src/table/SetColValuesDialog.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/table/SetColValuesDialog.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,99 @@ +/*************************************************************************** + File : SetColValuesDialog.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de + Description : Set column values dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef VALUESDIALOG_H +#define VALUESDIALOG_H + +#include +#include +#include + +class QComboBox; +class QTextEdit; +class QSpinBox; +class QPushButton; +class QLabel; +class QCompleter; +#ifdef SCRIPTING_PYTHON +class QCheckBox; +#endif +class Table; +class ScriptingEnv; +class ScriptEdit; + + +//! Set column values dialog +class SetColValuesDialog : public QDialog, public scripted +{ + Q_OBJECT + +public: + SetColValuesDialog( ScriptingEnv *env, QWidget* parent = 0, Qt::WFlags fl = 0 ); + void setTable(Table* w); + void setCompleter(QCompleter *); + +private slots: + bool apply(); + void prevColumn(); + void nextColumn(); + void insertFunction(); + void insertCol(); + void insertCell(); + void insertExplain(int index); + void updateColumn(int sc); + void clearFormulas(); +#ifdef SCRIPTING_PYTHON + void updateFunctionsList(bool); +#endif + +private: + Table* table; + + QSize sizeHint() const ; + void customEvent( QEvent *e ); + + QComboBox* functions; + QComboBox* boxColumn; + QPushButton* btnAddFunction; + QPushButton* btnAddCol; + QPushButton* btnCancel; + QPushButton *buttonPrev; + QPushButton *buttonNext; + QPushButton *addCellButton; + QPushButton *btnApply; + QPushButton* buttonClearFormulas; + ScriptEdit* commands; + QTextEdit* explain; + QSpinBox* start, *end; + QLabel *colNameLabel; +#ifdef SCRIPTING_PYTHON + QCheckBox *boxMuParser; +#endif +}; + +#endif // === removed file 'qtiplot/src/table/SetColValuesDialog.h' --- qtiplot/src/table/SetColValuesDialog.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/table/SetColValuesDialog.h 1970-01-01 00:00:00 +0000 @@ -1,96 +0,0 @@ -/*************************************************************************** - File : SetColValuesDialog.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de - Description : Set column values dialog - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef VALUESDIALOG_H -#define VALUESDIALOG_H - -#include "../scripting/ScriptingEnv.h" -#include "../scripting/Script.h" -#include - -class QComboBox; -class QTextEdit; -class QSpinBox; -class QPushButton; -class QLabel; -class QCompleter; -#ifdef SCRIPTING_PYTHON -class QCheckBox; -#endif -class Table; -class ScriptingEnv; -class ScriptEdit; - - -//! Set column values dialog -class SetColValuesDialog : public QDialog, public scripted -{ - Q_OBJECT - -public: - SetColValuesDialog( ScriptingEnv *env, QWidget* parent = 0, Qt::WFlags fl = 0 ); - void setTable(Table* w); - void setCompleter(QCompleter *); - -private slots: - bool apply(); - void prevColumn(); - void nextColumn(); - void insertFunction(); - void insertCol(); - void insertCell(); - void insertExplain(int index); - void updateColumn(int sc); - void clearFormulas(); - -private: - Table* table; - - QSize sizeHint() const ; - void customEvent( QEvent *e ); - - QComboBox* functions; - QComboBox* boxColumn; - QPushButton* btnAddFunction; - QPushButton* btnAddCol; - QPushButton* btnCancel; - QPushButton *buttonPrev; - QPushButton *buttonNext; - QPushButton *addCellButton; - QPushButton *btnApply; - QPushButton* buttonClearFormulas; - ScriptEdit* commands; - QTextEdit* explain; - QSpinBox* start, *end; - QLabel *colNameLabel; -#ifdef SCRIPTING_PYTHON - QCheckBox *boxMuParser; -#endif -}; - -#endif // === added file 'qtiplot/src/table/SortDialog.cpp' --- qtiplot/src/table/SortDialog.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/table/SortDialog.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,102 @@ +/*************************************************************************** + File : SortDialog.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Sorting options dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "SortDialog.h" + +#include +#include +#include +#include +#include +#include + +SortDialog::SortDialog( QWidget* parent, Qt::WFlags fl ) + : QDialog( parent, fl ) +{ + setWindowTitle(tr("QtiPlot - Sorting Options")); + setSizeGripEnabled(true); + + QGroupBox *groupBox1 = new QGroupBox(); + QGridLayout * topLayout = new QGridLayout(groupBox1); + QHBoxLayout * hl = new QHBoxLayout(); + hl->addStretch(); + + topLayout->addWidget( new QLabel(tr("Sort columns")), 0, 0 ); + boxType = new QComboBox(); + boxType->addItem(tr("Separately")); + boxType->addItem(tr("Together")); + topLayout->addWidget(boxType, 0, 1 ); + + topLayout->addWidget( new QLabel( tr("Order")), 1, 0 ); + boxOrder = new QComboBox(); + boxOrder->addItem(tr("Ascending")); + boxOrder->addItem(tr("Descending")); + topLayout->addWidget(boxOrder, 1, 1 ); + + topLayout->addWidget( new QLabel(tr("Leading column")), 2, 0 ); + columnsList = new QComboBox(); + topLayout->addWidget(columnsList, 2, 1); + topLayout->setRowStretch(3, 1); + + buttonOk = new QPushButton(tr("&Sort")); + buttonOk->setDefault( true ); + hl->addWidget(buttonOk); + + buttonCancel = new QPushButton(tr("&Close")); + hl->addWidget(buttonCancel); + + QVBoxLayout * mainlayout = new QVBoxLayout(this); + mainlayout->addWidget(groupBox1); + mainlayout->addLayout(hl); + + connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); + connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( boxType, SIGNAL( activated(int) ), this, SLOT(changeType(int))); +} + +void SortDialog::accept() +{ + emit sort(boxType->currentIndex(),boxOrder->currentIndex(),columnsList->currentText()); +} + +void SortDialog::insertColumnsList(const QStringList& cols) +{ + columnsList->addItems(cols); + columnsList->setCurrentIndex(0); + + boxType->setCurrentIndex(1); +} + +void SortDialog::changeType(int Type) +{ + boxType->setCurrentIndex(Type); + if(Type==1) + columnsList->setEnabled(true); + else + columnsList->setEnabled(false); +} === removed file 'qtiplot/src/table/SortDialog.cpp' --- qtiplot/src/table/SortDialog.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/table/SortDialog.cpp 1970-01-01 00:00:00 +0000 @@ -1,102 +0,0 @@ -/*************************************************************************** - File : SortDialog.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Sorting options dialog - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "SortDialog.h" - -#include -#include -#include -#include -#include -#include - -SortDialog::SortDialog( QWidget* parent, Qt::WFlags fl ) - : QDialog( parent, fl ) -{ - setWindowTitle(tr("QtiPlot - Sorting Options")); - setSizeGripEnabled(true); - - QGroupBox *groupBox1 = new QGroupBox(); - QGridLayout * topLayout = new QGridLayout(groupBox1); - QHBoxLayout * hl = new QHBoxLayout(); - hl->addStretch(); - - topLayout->addWidget( new QLabel(tr("Sort columns")), 0, 0 ); - boxType = new QComboBox(); - boxType->addItem(tr("Separately")); - boxType->addItem(tr("Together")); - topLayout->addWidget(boxType, 0, 1 ); - - topLayout->addWidget( new QLabel( tr("Order")), 1, 0 ); - boxOrder = new QComboBox(); - boxOrder->addItem(tr("Ascending")); - boxOrder->addItem(tr("Descending")); - topLayout->addWidget(boxOrder, 1, 1 ); - - topLayout->addWidget( new QLabel(tr("Leading column")), 2, 0 ); - columnsList = new QComboBox(); - topLayout->addWidget(columnsList, 2, 1); - topLayout->setRowStretch(3, 1); - - buttonOk = new QPushButton(tr("&Sort")); - buttonOk->setDefault( true ); - hl->addWidget(buttonOk); - - buttonCancel = new QPushButton(tr("&Close")); - hl->addWidget(buttonCancel); - - QVBoxLayout * mainlayout = new QVBoxLayout(this); - mainlayout->addWidget(groupBox1); - mainlayout->addLayout(hl); - - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); - connect( boxType, SIGNAL( activated(int) ), this, SLOT(changeType(int))); -} - -void SortDialog::accept() -{ - emit sort(boxType->currentIndex(),boxOrder->currentIndex(),columnsList->currentText()); -} - -void SortDialog::insertColumnsList(const QStringList& cols) -{ - columnsList->addItems(cols); - columnsList->setCurrentIndex(0); - - boxType->setCurrentIndex(1); -} - -void SortDialog::changeType(int Type) -{ - boxType->setCurrentIndex(Type); - if(Type==1) - columnsList->setEnabled(true); - else - columnsList->setEnabled(false); -} === added file 'qtiplot/src/table/SortDialog.h' --- qtiplot/src/table/SortDialog.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/table/SortDialog.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,62 @@ +/*************************************************************************** + File : SortDialog.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Sort table dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef SORTDIALOG_H +#define SORTDIALOG_H + +#include + +class QPushButton; +class QComboBox; + +//! Sorting options dialog +class SortDialog : public QDialog +{ + Q_OBJECT + +public: + SortDialog( QWidget* parent = 0, Qt::WFlags fl = 0 ); + void insertColumnsList(const QStringList& cols); + +private slots: + void accept(); + void changeType(int index); + +signals: + void sort(int, int, const QString&); + +private: + QPushButton* buttonOk; + QPushButton* buttonCancel; + QPushButton* buttonHelp; + QComboBox* boxType; + QComboBox* boxOrder; + QComboBox *columnsList; +}; + +#endif === removed file 'qtiplot/src/table/SortDialog.h' --- qtiplot/src/table/SortDialog.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/table/SortDialog.h 1970-01-01 00:00:00 +0000 @@ -1,62 +0,0 @@ -/*************************************************************************** - File : SortDialog.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Sort table dialog - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef SORTDIALOG_H -#define SORTDIALOG_H - -#include - -class QPushButton; -class QComboBox; - -//! Sorting options dialog -class SortDialog : public QDialog -{ - Q_OBJECT - -public: - SortDialog( QWidget* parent = 0, Qt::WFlags fl = 0 ); - void insertColumnsList(const QStringList& cols); - -private slots: - void accept(); - void changeType(int index); - -signals: - void sort(int, int, const QString&); - -private: - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonHelp; - QComboBox* boxType; - QComboBox* boxOrder; - QComboBox *columnsList; -}; - -#endif === added file 'qtiplot/src/table/Table.cpp' --- qtiplot/src/table/Table.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/table/Table.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,3589 @@ +/*************************************************************************** + File : Table.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de + Description : Table worksheet class + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "Table.h" +#include "SortDialog.h" +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +Table::Table(ScriptingEnv *env, int r, int c, const QString& label, ApplicationWindow* parent, const QString& name, Qt::WFlags f) +: MdiSubWindow(label,parent,name,f), scripted(env) +{ + init(r,c); +} + +void Table::init(int rows, int cols) +{ + selectedCol=-1; + d_saved_cells = 0; + d_show_comments = false; + d_numeric_precision = 13; + + d_table = new MyTable(rows, cols, this, "table"); + d_table->setSelectionMode (Q3Table::Single); + d_table->setRowMovingEnabled(true); + d_table->setColumnMovingEnabled(true); + d_table->setCurrentCell(-1, -1); + + connect(d_table->verticalHeader(), SIGNAL(indexChange(int, int, int)), + this, SLOT(notifyChanges())); + connect(d_table->horizontalHeader(), SIGNAL(indexChange(int, int, int)), + this, SLOT(moveColumn(int, int, int))); + + setFocusPolicy(Qt::StrongFocus); + setFocus(); + + for (int i=0; ihorizontalHeader(); + head->setMouseTracking(true); + head->setResizeEnabled(true); + head->installEventFilter(this); + connect(head, SIGNAL(sizeChange(int, int, int)), this, SLOT(colWidthModified(int, int, int))); + + col_plot_type[0] = X; + setHeaderColType(); + + int w = 4*(d_table->horizontalHeader())->sectionSize(0); + int h = 11*(d_table->verticalHeader())->sectionSize(0); + setGeometry(50, 50, w + 45, h); + + d_table->verticalHeader()->setResizeEnabled(false); + d_table->verticalHeader()->installEventFilter(this); + + setWidget(d_table); + + QShortcut *accelTab = new QShortcut(QKeySequence(Qt::Key_Tab), this); + connect(accelTab, SIGNAL(activated()), this, SLOT(moveCurrentCell())); + + QShortcut *accelAll = new QShortcut(QKeySequence(Qt::CTRL+Qt::Key_A), this); + connect(accelAll, SIGNAL(activated()), this, SLOT(selectAllTable())); + + connect(d_table, SIGNAL(valueChanged(int, int)), this, SLOT(cellEdited(int, int))); + + setAutoUpdateValues(applicationWindow()->autoUpdateTableValues()); +} + +void Table::setAutoUpdateValues(bool on) +{ + if (on){ + connect(this, SIGNAL(modifiedData(Table *, const QString&)), + this, SLOT(updateValues(Table*, const QString&))); + } else { + disconnect(this, SIGNAL(modifiedData(Table *, const QString&)), + this, SLOT(updateValues(Table*, const QString&))); + } +} + +void Table::colWidthModified(int, int, int) +{ + emit modifiedWindow(this); + setHeaderColType(); +} + + +void Table::setBackgroundColor(const QColor& col) +{ + d_table->setPaletteBackgroundColor ( col ); +} + +void Table::setTextColor(const QColor& col) +{ + d_table->setPaletteForegroundColor (col); +} + +void Table::setTextFont(const QFont& fnt) +{ + d_table->setFont (fnt); + QFontMetrics fm(fnt); + int lm = fm.width( QString::number(10*d_table->numRows())); + d_table->setLeftMargin( lm ); +} + +void Table::setHeaderColor(const QColor& col) +{ + QPalette palette = d_table->horizontalHeader()->palette (); + palette.setColor (QColorGroup::ButtonText, col); +#ifdef Q_OS_MAC //! Highlighting of the header text + palette.setColor (QColorGroup::BrightText, col); +#endif + d_table->horizontalHeader()->setPalette (palette); +} + +void Table::setHeaderFont(const QFont& fnt) +{ + d_table->horizontalHeader()->setFont (fnt); +} + +void Table::exportPDF(const QString& fileName) +{ + print(fileName); +} + +void Table::print() +{ + print(QString()); +} + +void Table::print(QPrinter *printer) +{ + if (!printer) + return; + + QPainter p; + if (!p.begin(printer)) + return; // paint on printer + + Q3PaintDeviceMetrics metrics( p.device() ); + int dpiy = metrics.logicalDpiY(); + const int margin = (int) ( (1/2.54)*dpiy ); // 2 cm margins + + Q3Header *hHeader = d_table->horizontalHeader(); + Q3Header *vHeader = d_table->verticalHeader(); + + int rows=d_table->numRows(); + int cols=d_table->numCols(); + int height=margin; + int i,vertHeaderWidth=vHeader->width(); + int right = margin + vertHeaderWidth; + + // print header + p.setFont(hHeader->font()); + QRect br=p.boundingRect(br,Qt::AlignCenter, hHeader->label(0)); + p.drawLine(right,height,right,height+br.height()); + QRect tr(br); + + for (i=0;icolumnWidth (i); + tr.setTopLeft(QPoint(right,height)); + tr.setWidth(w); + tr.setHeight(br.height()); + p.drawText(tr,Qt::AlignCenter,hHeader->label(i),-1); + right+=w; + p.drawLine(right,height,right,height+tr.height()); + + if (right >= metrics.width()-2*margin ) + break; + } + p.drawLine(margin + vertHeaderWidth, height, right-1, height);//first horizontal line + height += tr.height(); + p.drawLine(margin,height,right-1,height); + + // print table values + for (i=0;ilabel(i)+"\t"; + tr = p.boundingRect(tr,Qt::AlignCenter,text); + p.drawLine(right,height,right,height+tr.height()); + + br.setTopLeft(QPoint(right,height)); + br.setWidth(vertHeaderWidth); + br.setHeight(tr.height()); + p.drawText(br,Qt::AlignCenter,text,-1); + right += vertHeaderWidth; + p.drawLine(right,height,right,height+tr.height()); + + for (int j=0;jcolumnWidth (j); + text=d_table->text(i,j)+"\t"; + tr=p.boundingRect(tr,Qt::AlignCenter,text); + br.setTopLeft(QPoint(right,height)); + br.setWidth(w); + br.setHeight(tr.height()); + p.drawText(br,Qt::AlignCenter,text,-1); + right+=w; + p.drawLine(right,height,right,height+tr.height()); + + if (right >= metrics.width()-2*margin ) + break; + } + height+=br.height(); + p.drawLine(margin, height, right - 1, height); + + if (height >= metrics.height() - margin ) + { + printer->newPage(); + height=margin; + p.drawLine(margin, height, right, height); + } + } + p.end(); +} + +void Table::print(const QString& fileName) +{ + QPrinter printer; + printer.setColorMode (QPrinter::GrayScale); + if (!fileName.isEmpty()){ + printer.setCreator("QtiPlot"); + printer.setOutputFormat(QPrinter::PdfFormat); + printer.setOutputFileName(fileName); + } else { + QPrintDialog printDialog(&printer, applicationWindow()); + if (printDialog.exec() != QDialog::Accepted) + return; + } + + printer.setFullPage( true ); + print(&printer); +} + +void Table::cellEdited(int row, int col) +{ + QString text = d_table->text(row,col).remove(QRegExp("\\s")); + if (columnType(col) != Numeric || text.isEmpty()){ + emit modifiedData(this, colName(col)); + emit modifiedWindow(this); + return; + } + + char f; + int precision; + columnNumericFormat(col, &f, &precision); + bool ok = true; + double res = locale().toDouble(text, &ok); + if (ok) + d_table->setText(row, col, locale().toString(res, f, precision)); + else { + Script *script = scriptEnv->newScript(d_table->text(row,col),this,QString("<%1_%2_%3>").arg(objectName()).arg(row+1).arg(col+1)); + connect(script, SIGNAL(error(const QString&,const QString&,int)), scriptEnv, SIGNAL(error(const QString&,const QString&,int))); + + script->setInt(row+1, "i"); + script->setInt(col+1, "j"); + QVariant ret = script->eval(); + if(ret.type()==QVariant::Int || ret.type()==QVariant::UInt || ret.type()==QVariant::LongLong || ret.type()==QVariant::ULongLong) + d_table->setText(row, col, ret.toString()); + else if(ret.canCast(QVariant::Double)) + d_table->setText(row, col, locale().toString(ret.toDouble(), f, precision)); + else + d_table->setText(row, col, ""); + } + + emit modifiedData(this, colName(col)); + emit modifiedWindow(this); +} + +int Table::colX(int col) +{ + int i, xcol = -1; + for(i = col - 1; i >= 0; i--){ + if (col_plot_type[i] == X) + return i; + } + for(i = col + 1; i < (int)d_table->numCols(); i++){ + if (col_plot_type[i] == X) + return i; + } + return xcol; +} + +int Table::colY(int col, int xCol) +{ + int yCol = -1; + if (xCol >= 0){ + for(int i = col - 1; i >= 0; i--){ + if (col_plot_type[i] == Y && colX(i) == xCol) + return i; + } + for(int i = col + 1; i < (int)d_table->numCols(); i++){ + if (col_plot_type[i] == Y && colX(i) == xCol) + return i; + } + } else { + for(int i = col - 1; i >= 0; i--){ + if (col_plot_type[i] == Y) + return i; + } + for(int i = col + 1; i < (int)d_table->numCols(); i++){ + if (col_plot_type[i] == Y) + return i; + } + } + return yCol; +} + +void Table::setPlotDesignation(PlotDesignation pd, bool rightColumns) +{ + if (rightColumns){ + int cols = d_table->numCols(); + for (int i = selectedCol; i= d_table->numCols() || col_plot_type[col] == pd) + return; + + col_plot_type[col] = pd; + if (pd == Label) + colTypes[col] = Text; +} + +void Table::columnNumericFormat(int col, int *f, int *precision) +{ + QStringList format = col_format[col].split("/", QString::KeepEmptyParts); + if (format.count() == 2){ + *f = format[0].toInt(); + *precision = format[1].toInt(); + if (*precision > 14) + *precision = 14; + } else { + *f = 0; + *precision = 14; + } +} + +void Table::columnNumericFormat(int col, char *f, int *precision) +{ + QStringList format = col_format[col].split("/", QString::KeepEmptyParts); + if (format.count() == 2){ + switch(format[0].toInt()){ + case 0: + *f = 'g'; + break; + + case 1: + *f = 'f'; + break; + + case 2: + *f = 'e'; + break; + } + *precision = format[1].toInt(); + if (*precision > 14) + *precision = 14; + } else { + *f = 'g'; + *precision = 14; + } +} + +int Table::columnWidth(int col) +{ + return d_table->columnWidth(col); +} + +QStringList Table::columnWidths() +{ + QStringList widths; + for (int i=0;inumCols();i++) + widths<columnWidth(i)); + + return widths; +} + +void Table::setColWidths(const QStringList& widths) +{ + for (int i=0; i<(int)widths.count(); i++) + d_table->setColumnWidth(i, widths[i].toInt()); +} + +void Table::setColumnTypes(const QStringList& ctl) +{ + int n = QMIN((int)ctl.count(), numCols()); + for (int i=0; i= numRows()) + resizeRows(endRow + 1); + + QString cmd = commands[col]; + if (cmd.isEmpty() || colTypes[col] != Numeric){ + for (int i = startRow; i <= endRow; i++) + d_table->setText(i, col, cmd); + if (notifyChanges) + emit modifiedData(this, colName(col)); + emit modifiedWindow(this); + return true; + } + + if (cmd.count("\n") > 0){ + QString mess = tr("Multiline expressions take much more time to evaluate! Do you want to continue anyways?"); + if (QMessageBox::Yes != QMessageBox::warning(this, tr("QtiPlot") + " - " + tr("Warning"), mess, + QMessageBox::Yes, QMessageBox::Cancel)) + return false; + } + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + muParserScript *mup = new muParserScript(scriptEnv, cmd, this, QString("<%1>").arg(colName(col))); + double *r = mup->defineVariable("i"); + mup->defineVariable("j", (double)col); + mup->defineVariable("sr", startRow + 1.0); + mup->defineVariable("er", endRow + 1.0); + + if (!mup->compile()){ + QApplication::restoreOverrideCursor(); + return false; + } + + QLocale loc = locale(); + int prec; + char f; + columnNumericFormat(col, &f, &prec); + + if (mup->codeLines() == 1){ + for (int i = startRow; i <= endRow; i++){ + *r = i + 1.0; + d_table->setText(i, col, mup->evalSingleLineToString(loc, f, prec)); + } + } else { + QVariant ret; + for (int i = startRow; i <= endRow; i++){ + *r = i + 1.0; + ret = mup->eval(); + if(ret.type() == QVariant::Double) { + d_table->setText(i, col, loc.toString(ret.toDouble(), f, prec)); + } else if(ret.canConvert(QVariant::String)) + d_table->setText(i, col, ret.toString()); + else { + QApplication::restoreOverrideCursor(); + return false; + } + } + } + if (notifyChanges) + emit modifiedData(this, colName(col)); + emit modifiedWindow(this); + QApplication::restoreOverrideCursor(); + return true; +} + +bool Table::calculate(int col, int startRow, int endRow, bool forceMuParser, bool notifyChanges) +{ + if (col < 0 || col >= d_table->numCols()) + return false; + + if (d_table->isColumnReadOnly(col)){ + QMessageBox::warning(this, tr("QtiPlot - Error"), + tr("Column '%1' is read only!").arg(col_label[col])); + return false; + } + + if (QString(scriptEnv->name()) == "muParser" || forceMuParser) + return muParserCalculate(col, startRow, endRow, notifyChanges); + + if (startRow < 0) + startRow = 0; + if (endRow >= numRows()) + resizeRows(endRow + 1); + + QString cmd = commands[col]; + if (cmd.isEmpty() || colTypes[col] != Numeric){ + for (int i=startRow; i<=endRow; i++) + d_table->setText(i, col, cmd); + if (notifyChanges) + emit modifiedData(this, colName(col)); + emit modifiedWindow(this); + return true; + } + + QApplication::setOverrideCursor(Qt::WaitCursor); + + Script *colscript = scriptEnv->newScript(cmd, this, QString("<%1>").arg(colName(col))); + connect(colscript, SIGNAL(error(const QString&,const QString&,int)), scriptEnv, SIGNAL(error(const QString&,const QString&,int))); + connect(colscript, SIGNAL(print(const QString&)), scriptEnv, SIGNAL(print(const QString&))); + + if (!colscript->compile()){ + QApplication::restoreOverrideCursor(); + return false; + } + + QLocale loc = locale(); + int prec; + char f; + columnNumericFormat(col, &f, &prec); + + colscript->setDouble(col + 1.0, "j"); + colscript->setDouble(startRow + 1.0, "sr"); + colscript->setDouble(endRow + 1.0, "er"); + QVariant ret; + for (int i = startRow; i <= endRow; i++){ + colscript->setDouble(i + 1.0, "i"); + ret = colscript->eval(); + if(ret.type() == QVariant::Double) + d_table->setText(i, col, loc.toString(ret.toDouble(), f, prec)); + else if(ret.canConvert(QVariant::String)) + d_table->setText(i, col, ret.toString()); + else { + QApplication::restoreOverrideCursor(); + return false; + } + } + if (notifyChanges) + emit modifiedData(this, colName(col)); + emit modifiedWindow(this); + QApplication::restoreOverrideCursor(); + return true; +} + +Table* Table::extractData(const QString& name, const QString& condition, int startRow, int endRow) +{ + if (startRow < 0) + startRow = 0; + + if (endRow < 0 || endRow >= numRows()) + endRow = numRows(); + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + muParserScript *mup = new muParserScript(scriptEnv, condition, this, QString("<%1>").arg(this->objectName())); + double *r = mup->defineVariable("i"); + mup->defineVariable("sr", startRow + 1.0); + mup->defineVariable("er", endRow + 1.0); + + if (!mup->compile()){ + QApplication::restoreOverrideCursor(); + return 0; + } + + ApplicationWindow *app = applicationWindow(); + if (!app) + return 0; + + int cols = d_table->numCols(); + Table *dest = app->table(name); + if (dest){ + dest->setNumCols(cols); + dest->setNumRows(numRows()); + } else + dest = app->newTable(numRows(), cols, name); + + if (!dest) + return 0; + + int aux = 0; + if (mup->codeLines() == 1){ + for (int i = startRow; i <= endRow; i++){ + *r = i + 1.0; + if (mup->evalSingleLine()){ + for (int j = 0; j < cols; j++) + dest->setText(aux, j, this->text(i, j)); + + aux++; + } + } + } else { + QVariant ret; + for (int i = startRow; i <= endRow; i++){ + *r = i + 1.0; + ret = mup->eval(); + if (ret.type() == QVariant::Double && ret.toDouble()){ + for (int j = 0; j < cols; j++) + dest->setText(aux, j, this->text(i, j)); + + aux++; + } + } + } + + if (aux) + dest->setNumRows(aux); + dest->copy(this, false); + QApplication::restoreOverrideCursor(); + return dest; +} + +void Table::updateValues(Table* t, const QString& columnName) +{ + if (!t || t != this) + return; + + QString colLabel = columnName; + colLabel.remove(this->objectName()).remove("_"); + + int cols = numCols(); + int endRow = numRows() - 1; + for (int i = 0; i < cols; i++){ + QString cmd = commands[i]; + if (cmd.isEmpty() || colTypes[i] != Numeric || !cmd.contains("\"" + colLabel + "\"") || + cmd.contains("\"" + col_label[i] + "\"")) + continue; + + calculate(i, 0, endRow, false, true); + } +} + +Q3TableSelection Table::getSelection() +{ + Q3TableSelection sel; + if (d_table->numSelections() == 0){ + sel.init(d_table->currentRow(), d_table->currentColumn()); + sel.expandTo(d_table->currentRow(), d_table->currentColumn()); + } else if (d_table->currentSelection()>0) + sel = d_table->selection(d_table->currentSelection()); + else + sel = d_table->selection(0); + return sel; +} + +QString Table::saveColumnWidths() +{ + QString s="ColWidth\t"; + for (int i=0;inumCols();i++) + s+=QString::number(d_table->columnWidth (i))+"\t"; + return s+"\n"; +} + +QString Table::saveColumnTypes() +{ + QString s="ColType"; + for (int i=0; inumCols(); i++) + s += "\t"+QString::number(colTypes[i])+";"+col_format[i]; + return s+"\n"; +} + +QString Table::saveCommands() +{ + QString s="\n"; + for (int col=0; col\n"; + s += commands[col]; + s += "\n\n"; + } + s += "\n"; + return s; +} + +QString Table::saveComments() +{ + QString s = "Comments\t"; + for (int i=0; inumCols(); i++){ + if (comments.count() > i) + s += comments[i] + "\t"; + else + s += "\t"; + } + return s + "\n"; +} + +QString Table::saveHeader() +{ + QString s = "header"; + for (int j=0; jnumCols(); j++){ + if (col_plot_type[j] == X) + s += "\t" + colLabel(j) + "[X]"; + else if (col_plot_type[j] == Y) + s += "\t" + colLabel(j) + "[Y]"; + else if (col_plot_type[j] == Z) + s += "\t" + colLabel(j) + "[Z]"; + else if (col_plot_type[j] == xErr) + s += "\t" + colLabel(j) + "[xEr]"; + else if (col_plot_type[j] == yErr) + s += "\t" + colLabel(j) + "[yEr]"; + else if (col_plot_type[j] == Label) + s += "\t" + colLabel(j) + "[L]"; + else + s += "\t" + colLabel(j); + } + return s += "\n"; +} + +QString Table::saveReadOnlyInfo() +{ + QString s = "ReadOnlyColumn"; + for (int i=0; inumCols(); i++) + s += "\t" + QString::number(d_table->isColumnReadOnly(i)); + return s += "\n"; +} + +QString Table::saveHiddenColumnsInfo() +{ + QString s = "HiddenColumn"; + for (int i=0; inumCols(); i++) + s += "\t" + QString::number(d_table->isColumnHidden(i)); + return s += "\n"; +} + +void Table::save(const QString& fn, const QString& geometry, bool saveAsTemplate) +{ + QFile f(fn); + if (!f.isOpen()){ + if (!f.open(QIODevice::Append)) + return; + } + QTextStream t( &f ); + t.setEncoding(QTextStream::UnicodeUTF8); + t << "

"; + if (saveAsTemplate){ + t << "\t" + QString::number(d_table->numRows()) + "\t"; + t << QString::number(d_table->numCols()) + "\n"; + } else { + t << "\n" + QString(objectName()) + "\t"; + t << QString::number(d_table->numRows()) + "\t"; + t << QString::number(d_table->numCols()) + "\t"; + t << birthDate() + "\n"; + } + t << geometry; + t << saveHeader(); + t << saveColumnWidths(); + t << saveCommands(); + t << saveColumnTypes(); + t << saveReadOnlyInfo(); + t << saveHiddenColumnsInfo(); + t << saveComments(); + + if (!saveAsTemplate){ + t << "WindowLabel\t" + windowLabel() + "\t" + QString::number(captionPolicy()) + "\n"; + t << "\n"; + int cols = d_table->numCols() - 1; + int rows = d_table->numRows(); + for (int i=0; itext(i, j).isEmpty()) + t << QString::number(cell(i, j), 'e', 14) + "\t"; + else + t << d_table->text(i, j) + "\t"; + } + if (colTypes[cols] == Numeric && !d_table->text(i, cols).isEmpty()) + t << QString::number(cell(i, cols), 'e', 14) + "\n"; + else + t << d_table->text(i, cols) + "\n"; + } + } + t << "\n"; + } + t << "
\n"; +} + +int Table::firstXCol() +{ + int xcol = -1; + for (int j=0; jnumCols(); j++) + { + if (col_plot_type[j] == X) + return j; + } + return xcol; +} + +QString Table::comment(int col) +{ + if (col < 0 || col >= d_table->numCols()) + return QString::null; + + return comments[col]; +} + +void Table::setColComment(int col, const QString& s) +{ + if (col < 0 || col >= d_table->numCols()) + return; + + if (comments[col] == s) + return; + + comments[col] = s; + + if (d_show_comments) + setHeaderColType(); +} + +void Table::setColumnWidth(int width, bool allCols) +{ + int cols=d_table->numCols(); + if (allCols) + { + for (int i=0;isetColumnWidth (i, width); + + emit modifiedWindow(this); + } + else + { + if (d_table->columnWidth(selectedCol) == width) + return; + + d_table->setColumnWidth (selectedCol, width); + emit modifiedWindow(this); + } +} + +void Table::adjustColumnsWidth() +{ + int cols = d_table->numCols(); + for (int i = 0; i < cols; i++){ + if(d_table->isColumnSelected (i, true)) + d_table->adjustColumn(i); + } + + emit modifiedWindow(this); +} + +void Table::setColumnWidth(int col, int width) +{ + + if (d_table->columnWidth(col) == width) + return; + + d_table->setColumnWidth (col, width); + emit modifiedWindow(this); +} + +QString Table::colName(int col) +{//returns the table name + horizontal header text + if (col<0 || col >= col_label.count()) + return QString(); + + return QString(this->objectName())+"_"+col_label[col]; +} + +void Table::setColName(int col, const QString& text, bool enumerateRight, bool warn) +{ + if (text.isEmpty() || col<0 || col >= d_table->numCols()) + return; + + if (col_label[col] == text && !enumerateRight) + return; + + QString caption = objectName(); + QString oldLabel = col_label[col]; + int cols = col + 1; + if (enumerateRight) + cols = (int)d_table->numCols(); + + int n = 1; + for (int i = col; i 0){ + if (warn){ + QMessageBox::critical(0, tr("QtiPlot - Error"), + tr("There is already a column called : "+newLabel+" in table "+caption+"!

Please choose another name!")); + } + return; + } + n++; + } + + n = 1; + caption += "_"; + for (int i = col; inumCols(); i++){ + if(d_table->isColumnSelected (i, true)) + names << QString(name()) + "_" + col_label[i]; + } + return names; +} + +QStringList Table::YColumns() +{ + QStringList names; + for (int i = 0; i < d_table->numCols(); i++){ + if(col_plot_type[i] == Y) + names << QString(name()) + "_" + col_label[i]; + } + return names; +} + +QStringList Table::selectedYColumns() +{ + QStringList names; + for (int i = 0; i < d_table->numCols(); i++){ + if(d_table->isColumnSelected (i) && col_plot_type[i] == Y) + names << QString(objectName()) + "_" + col_label[i]; + } + return names; +} + +QStringList Table::selectedErrColumns() +{ + QStringList names; + for (int i=0;inumCols();i++){ + if(d_table->isColumnSelected (i, true) && + (col_plot_type[i] == yErr || col_plot_type[i] == xErr)) + names<numCols(); i++){ + if(d_table->isColumnSelected (i) && col_plot_type[i] == Y) + names << QString(objectName()) + "_" + col_label[i]; + } + + for (int i=0; inumCols(); i++){ + if(d_table->isColumnSelected (i) && + (col_plot_type[i] == yErr || col_plot_type[i] == xErr || col_plot_type[i] == Label)) + names << QString(objectName()) + "_" + col_label[i]; + } + return names; +} + +QStringList Table::selectedYLabels() +{ + QStringList names; + for (int i=0;inumCols();i++){ + if(d_table->isColumnSelected (i) && col_plot_type[i] == Y) + names<numCols();i++) + names<numCols();i++) + { + if(d_table->isColumnSelected (i,true)) + return i; + } + return -1; +} + +int Table::numSelectedRows() +{ + int r=0; + for (int i=0;inumRows();i++) + { + if(d_table->isRowSelected (i,true)) + r++; + } + return r; +} + +int Table::selectedColsNumber() +{ + int c=0; + for (int i=0;inumCols(); i++){ + if(d_table->isColumnSelected (i,true)) + c++; + } + return c; +} + +QVarLengthArray Table::col(int c) +{ + if (c < 0 || c >= d_table->numCols()) + return QVarLengthArray(); + + int rows = d_table->numRows(); + QVarLengthArray Y(rows); + QLocale l = locale(); + for (int i = 0; itext(i, c)); + return Y; +} + +void Table::columnRange(int c, double *min, double *max) +{ + if (c < 0 || c >= d_table->numCols()) + return; + + double d_min = 0.0; + double d_max = 0.0; + + Q3TableSelection selection = getSelection(); + + QLocale l = locale(); + int startRow = selection.topRow(); + for (int i = selection.topRow(); i <= selection.bottomRow(); i++){ + QString s = d_table->text(i, c); + if (!s.isEmpty()){ + d_min = l.toDouble(s); + d_max = d_min; + startRow = i; + break; + } + } + + for (int i = startRow; i <= selection.bottomRow(); i++){ + QString s = d_table->text(i, c); + if (!s.isEmpty()){ + double aux = l.toDouble(s); + + if (aux <= d_min) + d_min = aux; + + if (aux >= d_max) + d_max = aux; + } + } + + *min = d_min; + *max = d_max; +} + +void Table::insertCols(int start, int count) +{ + if (start < 0) + start = 0; + + int max = 0; + int cols = d_table->numCols(); + QList hiddenCols; + + for (int i = 0; i max) + max = id; + } + hiddenCols << d_table->isColumnHidden(i); + } + max++; + + d_table->insertColumns(start, count); + + for(int i = 0; inumCols(); i++) + hideColumn(i, hiddenCols[i]); + + emit modifiedWindow(this); +} + +void Table::insertCol() +{ + insertCols(selectedCol, 1); +} + +void Table::insertRow() +{ + int cr = d_table->currentRow(); + if (d_table->isRowSelected (cr, true)) + { + d_table->insertRows(cr, 1); + emit modifiedWindow(this); + } +} + +void Table::addCol(PlotDesignation pd) +{ + d_table->clearSelection(); + int index, max=0, cols=d_table->numCols(); + for (int i=0; i max) + max = index; + } + } + d_table->insertColumns(cols); + d_table->ensureCellVisible ( 0, cols ); + + comments << QString(); + commands << ""; + colTypes << Numeric; + col_format << "0/" + QString::number(d_numeric_precision); + col_label << QString::number(max+1); + col_plot_type << pd; + + setHeaderColType(); + emit modifiedWindow(this); +} + +void Table::addColumns(int c) +{ + int max=0, cols=d_table->numCols(); + for (int i=0; imax) + max=index; + } + } + max++; + d_table->insertColumns(cols, c); + for (int i=0; iisColumnReadOnly(selectedCol)) + return; + + for (int i=0; inumRows(); i++){ + if (d_table->isSelected (i, selectedCol)) + d_table->setText(i, selectedCol, ""); + } + + emit modifiedData(this, colName(selectedCol)); +} + +void Table::clearCell(int row, int col) +{ + if (col < 0 || col >= d_table->numCols()) + return; + + if (d_table->isColumnReadOnly(col)){ + QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Column '%1' is read only!").arg(colName(col))); + return; + } + + d_table->setText(row, col, ""); + + emit modifiedData(this, colName(col)); + emit modifiedWindow(this); +} + +void Table::deleteSelectedRows() +{ + Q3TableSelection sel = d_table->selection(0); + deleteRows(sel.topRow() + 1, sel.bottomRow() + 1); +} + +void Table::deleteRows(int startRow, int endRow) +{ + for(int i=0; inumCols(); i++){ + if (d_table->isColumnReadOnly(i)){ + QMessageBox::warning(this, tr("QtiPlot - Error"), + tr("The table '%1' contains read-only columns! Operation aborted!").arg(objectName())); + return; + } + } + + int start = QMIN(startRow, endRow); + int end = QMAX(startRow, endRow); + + start--; + end--; + if (start < 0) + start = 0; + if (end >= d_table->numRows()) + end = d_table->numRows() - 1; + + int rows = abs(end - start) + 1; + Q3MemArray rowsToDelete(rows); + for (int i=0; iremoveRows(rowsToDelete); + notifyChanges(); +} + +void Table::cutSelection() +{ + copySelection(); + clearSelection(); +} + +void Table::selectAllTable() +{ + d_table->addSelection (Q3TableSelection( 0, 0, d_table->numRows(), d_table->numCols() )); +} + +void Table::deselect() +{ + d_table->clearSelection(); +} + +void Table::clearSelection() +{ + QStringList list=selectedColumns(); + int n = int(list.count()); + + if (n>0){ + QStringList lstReadOnly; + for (int i=0; iisColumnReadOnly(col)) + lstReadOnly << name; + } + if (lstReadOnly.count() > 0){ + QMessageBox::warning(this, tr("QtiPlot - Error"), + tr("The folowing columns")+":\n"+ lstReadOnly.join("\n") + "\n"+ tr("are read only!")); + } + + for (int i=0; iselection(0); + int top=sel.topRow(); + int bottom=sel.bottomRow(); + int left=sel.leftCol(); + int right=sel.rightCol(); + + if (sel.isEmpty ()){ + int col = d_table->currentColumn(); + QString name = colName(col); + if (d_table->isColumnReadOnly(col)){ + QMessageBox::warning(this, tr("QtiPlot - Error"), + tr("Column '%1' is read only!").arg(name)); + return; + } + d_table->setText(d_table->currentRow (), col, ""); + emit modifiedData(this, name); + } else { + QStringList lstReadOnly; + for (int i=left; i<=right; i++){ + QString name = col_label[i]; + if (d_table->isColumnReadOnly(i)) + lstReadOnly << name; + } + if (lstReadOnly.count() > 0){ + QMessageBox::warning(this, tr("QtiPlot - Error"), + tr("The folowing columns")+":\n"+ lstReadOnly.join("\n") + "\n"+ tr("are read only!")); + } + + for (int i=left; i<=right; i++){ + if (d_table->isColumnReadOnly(i)) + continue; + + for (int j=top; j<=bottom; j++) + d_table->setText(j, i, ""); + + QString name = colName(i); + emit modifiedData(this, name); + } + } + } + emit modifiedWindow(this); +} + +void Table::copySelection() +{ + QString text; + int rows = d_table->numRows(); + int cols = d_table->numCols(); + QString eol = applicationWindow()->endOfLine(); + + QVarLengthArray selection(1); + int c = 0; + for (int i = 0; iisColumnSelected(i, true)){ + c++; + selection.resize(c); + selection[c-1] = i; + } + } + if (c > 0){ + for (int i = 0; itext(i, selection[j]) + "\t"; + text += d_table->text(i, selection[c-1]) + eol; + } + } else { + Q3TableSelection sel = d_table->selection(0); + int right = sel.rightCol(); + int bottom = sel.bottomRow(); + for (int i = sel.topRow(); itext(i, j) + "\t"; + text += d_table->text(i, right) + eol; + } + for (int j = sel.leftCol(); jtext(bottom, j) + "\t"; + text += d_table->text(bottom, right); + } + + // Copy text into the clipboard + QApplication::clipboard()->setText(text.trimmed()); +} + +// Paste text from the clipboard +void Table::pasteSelection() +{ + QString text = QApplication::clipboard()->text(); + if (text.isEmpty()) + return; + + QStringList linesList = text.split(ApplicationWindow::guessEndOfLine(text)); + int rows = linesList.size(); + if (rows < 1) + return; + + QStringList firstLine = linesList[0].split("\t", QString::SkipEmptyParts); + int cols = firstLine.count(); + for (int i = 1; i < rows; i++){ + int aux = linesList[i].split("\t").count(); + if (aux > cols) + cols = aux; + } + + QLocale l = locale(); + QLocale clipboardLocale = applicationWindow()->clipboardLocale(); + + bool allNumbers = true; + bool pasteComments = false; + bool pasteHeader = false; + for (int i = 0; i < firstLine.size(); i++) + {//verify if the strings in the line used to rename the columns are not all numbers + clipboardLocale.toDouble(firstLine[i], &allNumbers); + if (!allNumbers){ + switch(QMessageBox::question(this, tr("QtiPlot") + " - " + tr("Paste operation"), + tr("How should QtiPlot interpret first clipboard line?"), + tr("&Values"), tr("Column &Names"), tr("&Comments"), 1, 1)){ + case 0: + break; + case 1: + pasteHeader = true; + linesList.pop_front(); + rows--; + break; + case 2: + pasteComments = true; + linesList.pop_front(); + rows--; + break; + } + break; + } + } + + int top, left, firstCol = firstSelectedColumn(); + Q3TableSelection sel = d_table->selection(0); + if (!sel.isEmpty()){// not columns but only cells are selected + top = sel.topRow(); + left = sel.leftCol(); + } else if(cols == 1 && rows == 1){ + top = d_table->currentRow(); + left = d_table->currentColumn(); + } else { + top = 0; + left = 0; + if (firstCol >= 0)// columns are selected + left = firstCol; + } + + if (top + rows > d_table->numRows()) + d_table->setNumRows(top + rows); + if (left + cols > d_table->numCols()){ + addColumns(left + cols - d_table->numCols()); + setHeaderColType(); + } + + QStringList lstReadOnly; + for (int i = left; i < left + cols; i++){ + QString name = colName(i); + if (d_table->isColumnReadOnly(i)) + lstReadOnly << name; + } + if (lstReadOnly.count() > 0){ + QMessageBox::warning(this, tr("QtiPlot - Error"), + tr("The folowing columns")+":\n"+ lstReadOnly.join("\n") + "\n"+ tr("are read only!")); + } + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + if (pasteComments || pasteHeader){ + for (int j = left; j < left + cols; j++){ + if (d_table->isColumnReadOnly(j) || firstLine.size() <= j) + continue; + + if (pasteComments) + comments[j] = firstLine[j]; + else if (pasteHeader) + col_label[j] = firstLine[j].replace("-","_").remove(QRegExp("\\W")).replace("_","-"); + } + if (pasteComments) + showComments(); + else if (pasteHeader) + setHeaderColType(); + } + + for (int i = 0; i < rows; i++){ + int row = top + i; + QStringList cells = linesList[i].split("\t"); + for (int j = left; j < left + cols; j++){ + if (d_table->isColumnReadOnly(j)) + continue; + + int colIndex = j-left; + if (colIndex >= cells.count()) + break; + + bool numeric = false; + double value = clipboardLocale.toDouble(cells[colIndex], &numeric); + if (numeric){ + int prec; + char f; + columnNumericFormat(j, &f, &prec); + d_table->setText(row, j, l.toString(value, f, prec)); + } else + d_table->setText(row, j, cells[colIndex]); + } + } + + for (int i = left; i< left + cols; i++){ + if (!d_table->isColumnReadOnly(i)) + emit modifiedData(this, colName(i)); + } + emit modifiedWindow(this); + QApplication::restoreOverrideCursor(); +} + +void Table::removeCol() +{ + QStringList list=selectedColumns(); + removeCol(list); +} + +void Table::removeCol(const QStringList& list) +{ + QStringList lstReadOnly; + for (int i=0; iisColumnReadOnly(col)) + lstReadOnly << name; + } + + if (lstReadOnly.count() > 0){ + QMessageBox::warning(this, tr("QtiPlot - Error"), + tr("The folowing columns")+":\n"+ lstReadOnly.join("\n") + "\n"+ tr("are read only!")); + } + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + for (int i=0; i= 0){ + if (d_table->isColumnReadOnly(id)) + continue; + + if ( id < commands.size() ) + commands.removeAt(id); + + if ( id < col_label.size() ) + col_label.removeAt(id); + + if ( id < col_format.size() ) + col_format.removeAt(id); + + if ( id < comments.size() ) + comments.removeAt(id); + + if ( id < colTypes.size() ) + colTypes.removeAt(id); + + if ( id < col_plot_type.size() ) + col_plot_type.removeAt(id); + + d_table->removeColumn(id); + emit removedCol(name); + } + } + emit modifiedWindow(this); + QApplication::restoreOverrideCursor(); +} + +void Table::normalizeSelection() +{ + QStringList s = selectedColumns(); + QStringList lstReadOnly; + for (int i=0; i<(int)s.count(); i++){ + int col = colIndex(s[i]); + if (d_table->isColumnReadOnly(col)) + lstReadOnly << col_label[col]; + } + + if (lstReadOnly.count() > 0){ + QMessageBox::warning(this, tr("QtiPlot - Error"), + tr("The folowing columns")+":\n"+ lstReadOnly.join("\n") + "\n"+ tr("are read only!")); + } + + for (int i=0; i<(int)s.count(); i++) + normalizeCol(colIndex(s[i])); + + emit modifiedWindow(this); +} + +void Table::normalize() +{ + QStringList lstReadOnly; + for (int i=0; inumCols(); i++){ + if (d_table->isColumnReadOnly(i)) + lstReadOnly << col_label[i]; + } + + if (lstReadOnly.count() > 0){ + QMessageBox::warning(this, tr("QtiPlot - Error"), + tr("The folowing columns")+":\n"+ lstReadOnly.join("\n") + "\n"+ tr("are read only!")); + } + + for (int i=0; inumCols(); i++) + normalizeCol(i); + + emit modifiedWindow(this); +} + +void Table::normalizeCol(int col) +{ + if (col<0) col = selectedCol; + if (d_table->isColumnReadOnly(col) || colTypes[col] == Table::Text) + return; + + int rows = d_table->numRows(); + gsl_vector *data = gsl_vector_alloc(rows); + for (int i=0; itext(i, col).isEmpty() ) + d_table->setText(i, col, locale().toString(gsl_vector_get(data, i)/max, f, prec)); + } + + gsl_vector_free(data); + emit modifiedData(this, colName(col)); +} + +void Table::sortColumnsDialog() +{ + SortDialog *sortd = new SortDialog((QWidget*)applicationWindow()); + sortd->setAttribute(Qt::WA_DeleteOnClose); + connect (sortd, SIGNAL(sort(int, int, const QString&)), this, SLOT(sortColumns(int, int, const QString&))); + sortd->insertColumnsList(selectedColumns()); + sortd->exec(); +} + +void Table::sortTableDialog() +{ + SortDialog *sortd = new SortDialog((QWidget*)applicationWindow()); + sortd->setAttribute(Qt::WA_DeleteOnClose); + connect (sortd, SIGNAL(sort(int, int, const QString&)), this, SLOT(sort(int, int, const QString&))); + sortd->insertColumnsList(colNames()); + sortd->exec(); +} + +void Table::sort(int type, int order, const QString& leadCol) +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + sortColumns(col_label, type, order, leadCol); + QApplication::restoreOverrideCursor(); +} + +void Table::sortColumns(int type, int order, const QString& leadCol) +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + sortColumns(selectedColumns(), type, order, leadCol); + QApplication::restoreOverrideCursor(); +} + +int compare_qstrings (const void * a, const void * b) +{ + QString *bb = (QString *)b; + return ((QString *)a)->compare(*bb); +} + +void Table::sortColumns(const QStringList&s, int type, int order, const QString& leadCol) +{ + int cols = s.count(); + if(!type){//Sort columns separately + for(int i=0;inumRows(); + int non_empty_cells = 0; + QVarLengthArray valid_cell(rows); + QVarLengthArray data_double(rows); + QVarLengthArray strings(rows); + for (int j = 0; j text(j, leadcol).isEmpty()){ + strings[non_empty_cells] = d_table->text(j, leadcol); + data_double[non_empty_cells] = cell(j, leadcol); + valid_cell[non_empty_cells] = j; + non_empty_cells++; + } + } + + if (!non_empty_cells){ + QApplication::restoreOverrideCursor(); + QMessageBox::critical(this, tr("QtiPlot - Error"), + tr("The leading column is empty! Operation aborted!")); + return; + } + + data_double.resize(non_empty_cells); + valid_cell.resize(non_empty_cells); + strings.resize(non_empty_cells); + + // Find the permutation index for the lead col + size_t *p = new size_t[non_empty_cells]; + if (columnType(leadcol) == Table::Text) + gsl_heapsort_index(p, strings.data(), strings.count(), sizeof(QString), compare_qstrings); + else + gsl_sort_index(p, data_double.data(), 1, non_empty_cells); + + for(int i = 0; i < cols; i++){// Since we have the permutation index, sort all the columns + int col = colIndex(s[i]); + if (d_table->isColumnReadOnly(col)) + continue; + + if (columnType(col) == Text){ + for (int j = 0; jsetText(valid_cell[j], col, strings[p[j]]); + else + for (int j = 0; j < non_empty_cells; j++) + d_table->setText(valid_cell[j], col, strings[p[non_empty_cells - j - 1]]); + } else { + for (int j = 0; jsetText(valid_cell[j], col, locale().toString(data_double[p[j]], f, prec)); + else + for (int j=0; jsetText(valid_cell[j], col, locale().toString(data_double[p[non_empty_cells-j-1]], f, prec)); + } + emit modifiedData(this, colName(col)); + } + delete[] p; + } + emit modifiedWindow(this); +} + +void Table::sortColumn(int col, int order) +{ + if (col < 0) + col = d_table->currentColumn(); + + if (d_table->isColumnReadOnly(col)) + return; + + int rows=d_table->numRows(); + int non_empty_cells = 0; + QVarLengthArray valid_cell(rows); + QVarLengthArray r(rows); + QStringList text_cells; + for (int i = 0; i text(i, col).isEmpty()){ + if (columnType(col) == Table::Text) + text_cells << d_table->text(i, col); + else + r[non_empty_cells] = cell(i, col); + valid_cell[non_empty_cells] = i; + non_empty_cells++; + } + } + + if (!non_empty_cells) + return; + + valid_cell.resize(non_empty_cells); + if (columnType(col) == Table::Text){ + r.clear(); + text_cells.sort(); + } else { + r.resize(non_empty_cells); + gsl_sort(r.data(), 1, non_empty_cells); + } + + if (columnType(col) == Table::Text){ + if (!order){ + for (int i=0; isetText(valid_cell[i], col, text_cells[i]); + } else { + for (int i=0; isetText(valid_cell[i], col, text_cells[non_empty_cells-i-1]); + } + } else { + int prec; + char f; + columnNumericFormat(col, &f, &prec); + if (!order) { + for (int i=0; isetText(valid_cell[i], col, locale().toString(r[i], f, prec)); + } else { + for (int i=0; isetText(valid_cell[i], col, locale().toString(r[non_empty_cells-i-1], f, prec)); + } + } + emit modifiedData(this, colName(col)); + emit modifiedWindow(this); +} + +void Table::sortColAsc() +{ +sortColumn(d_table->currentColumn ()); +} + +void Table::sortColDesc() +{ +sortColumn(d_table->currentColumn(), 1); +} + +int Table::numRows() +{ + return d_table->numRows(); +} + +int Table::numCols() +{ + return d_table->numCols(); +} + +bool Table::isEmptyRow(int row) +{ + for (int i=0; inumCols(); i++) + { + QString text = d_table->text(row,i); + if (!text.isEmpty()) + return false; + } + return true; +} + +bool Table::isEmptyColumn(int col) +{ + for (int i=0; inumRows(); i++) + { + QString text=d_table->text(i,col); + if (!text.isEmpty()) + return false; + } + return true; +} + +int Table::nonEmptyRows() +{ + int r=0; + for (int i=0;inumRows();i++){ + if (!isEmptyRow(i)) + r++; + } + return r; +} + +double Table::cell(int row, int col) +{ + return locale().toDouble(d_table->text(row, col)); +} + +void Table::setCell(int row, int col, double val) +{ + if (col < 0 || col >= d_table->numCols() || + row < 0 || row >= d_table->numRows()) + return; + + char format; + int prec; + columnNumericFormat(col, &format, &prec); + d_table->setText(row, col, locale().toString(val, format, prec)); +} + +QString Table::text(int row, int col) +{ + return d_table->text(row, col); +} + +void Table::setText (int row, int col, const QString & text ) +{ + d_table->setText(row, col, text); +} + +void Table::saveToMemory() +{ + int rows = d_table->numRows(); + int cols = d_table->numCols(); + + d_saved_cells = new double* [cols]; + for ( int i = 0; i < cols; ++i) + d_saved_cells[i] = new double [rows]; + + for (int col = 0; col < cols; col++){// initialize the matrix to zero + for (int row = 0; row < rows; row++) + d_saved_cells[col][row] = 0.0;} + + for (int col = 0; col < cols; col++){ + if (colTypes[col] == Time){ + QTime ref = QTime(0, 0); + for (int row = 0; row text(row, col), col_format[col]); + d_saved_cells[col][row] = ref.msecsTo(t); + } + } + else if (colTypes[col] == Date){ + QTime ref = QTime(0, 0); + for (int row = 0; row < rows; row++){ + QDateTime dt = QDateTime::fromString(d_table->text(row, col), col_format[col]); + d_saved_cells[col][row] = dt.date().toJulianDay() - 1 + (double)ref.msecsTo(dt.time())/864.0e5; + } + } + } + + QLocale l = locale(); + for (int col = 0; col < cols; col++){ + if (colTypes[col] == Numeric){ + for (int row=0; row < rows; row++){ + QString s = d_table->text(row, col); + if (!s.isEmpty()) + d_saved_cells[col][row] = l.toDouble(s); + } + } + } +} + +void Table::freeMemory() +{ + for ( int i = 0; i < d_table->numCols(); i++) + delete[] d_saved_cells[i]; + + delete[] d_saved_cells; + d_saved_cells = 0; +} + +void Table::setTextFormat(int col) +{ + if (col >= 0 && col < colTypes.count()) + colTypes[col] = Text; +} + +void Table::setColNumericFormat(int f, int prec, int col, bool updateCells) +{ + if (prec < 0) + prec = 0; + else if (prec > 14) + prec = 14; + + if (colTypes[col] == Numeric){ + int old_f, old_prec; + columnNumericFormat(col, &old_f, &old_prec); + if (old_f == f && old_prec == prec) + return; + } + + colTypes[col] = Numeric; + col_format[col] = QString::number(f) + "/" + QString::number(prec); + + if (!updateCells) + return; + + char format = 'g'; + for (int i=0; inumRows(); i++) { + QString t = text(i, col); + if (!t.isEmpty()) { + if (f == 1) + format = 'f'; + else if (f == 2) + format = 'e'; + else + format = 'g'; + + if (d_saved_cells) + setText(i, col, locale().toString(d_saved_cells[col][i], format, prec)); + else + setText(i, col, locale().toString(locale().toDouble(t), format, prec)); + } + } +} + +void Table::setColumnsFormat(const QStringList& lst) +{ + if (col_format == lst) + return; + + col_format = lst; +} + +bool Table::setDateFormat(const QString& format, int col, bool updateCells) +{ + if (colTypes[col] == Date && col_format[col] == format) + return true; + + bool first_time = false; + if (updateCells){ + for (int i=0; inumRows(); i++){ + QString s = d_table->text(i,col); + if (!s.isEmpty()){ + QDateTime d = QDateTime::fromString (s, format); + if (colTypes[col] != Date && d.isValid()){ + //This might be the first time the user assigns a date format. + //If Qt understands the format we break the loop, assign it to the column and return true! + first_time = true; + break; + } + + if (d_saved_cells){ + d = QDateTime(QDate::fromJulianDay((int)d_saved_cells[col][i] + 1)); + double msecs = (d_saved_cells[col][i] - floor(d_saved_cells[col][i]))*864e5; + d.setTime(d.time().addMSecs(qRound(msecs))); + if (d.isValid()) + d_table->setText(i, col, d.toString(format)); + } + } + } + } + colTypes[col] = Date; + col_format[col] = format; + QTime ref = QTime(0, 0); + if (first_time){//update d_saved_cells in case the user changes the time format before pressing OK in the column dialog + for (int i=0; inumRows(); i++){ + QDateTime dt = QDateTime::fromString(d_table->text(i, col), format); + d_saved_cells[col][i] = dt.date().toJulianDay() - 1 + (double)ref.msecsTo(dt.time())/864.0e5; + } + } + return true; +} + +bool Table::setTimeFormat(const QString& format, int col, bool updateCells) +{ + if (colTypes[col] == Time && col_format[col] == format) + return true; + + QTime ref = QTime(0, 0); + bool first_time = false; + if (updateCells){ + for (int i=0; inumRows(); i++){ + QString s = d_table->text(i,col); + if (!s.isEmpty()){ + QTime t = QTime::fromString (s, format); + if (colTypes[col] != Time && t.isValid()){ + //This is the first time the user assigns a time format. + //If Qt understands the format we break the loop, assign it to the column and return true! + first_time = true; + break; + } + + if (d_saved_cells){ + if (d_saved_cells[col][i] < 1)// import of Origin files + t = ref.addMSecs(int(d_saved_cells[col][i]*86400000)); + else + t = ref.addMSecs((int)d_saved_cells[col][i]); + + if (t.isValid()) + d_table->setText(i, col, t.toString(format)); + } + } + } + } + colTypes[col] = Time; + col_format[col] = format; + if (first_time){//update d_saved_cells in case the user changes the time format before pressing OK in the column dialog + for (int i=0; inumRows(); i++){ + QTime t = QTime::fromString(d_table->text(i, col), format); + d_saved_cells[col][i] = ref.msecsTo(t); + } + } + return true; +} + +void Table::setMonthFormat(const QString& format, int col, bool updateCells) +{ + if (colTypes[col] == Month && col_format[col] == format) + return; + + colTypes[col] = Month; + col_format[col] = format; + + if (!updateCells) + return; + + for (int i=0; itext(i,col); + if (!t.isEmpty()){ + int day; + if (d_saved_cells) + day = int(d_saved_cells[col][i]) % 12; + else + day = t.toInt() % 12; + if (!day) + day = 12; + + if (format == "M") + d_table->setText(i, col, QDate::shortMonthName(day).left(1)); + else if (format == "MMM") + d_table->setText(i, col, QDate::shortMonthName(day)); + else if (format == "MMMM") + d_table->setText(i, col, QDate::longMonthName(day)); + } + } +} + +void Table::setDayFormat(const QString& format, int col, bool updateCells) +{ + if (colTypes[col] == Day && col_format[col] == format) + return; + + colTypes[col] = Day; + col_format[col] = format; + + if (!updateCells) + return; + + for (int i=0; itext(i,col); + if (!t.isEmpty()){ + int day; + if (d_saved_cells) + day = int(d_saved_cells[col][i]) % 7; + else + day = t.toInt() % 7; + if (!day) + day = 7; + + if (format == "d") + d_table->setText(i, col, QDate::shortDayName(day).left(1)); + else if (format == "ddd") + d_table->setText(i, col, QDate::shortDayName(day)); + else if (format == "dddd") + d_table->setText(i, col, QDate::longDayName(day)); + } + } +} + +void Table::setRandomValues() +{ + QStringList list=selectedColumns(); + QStringList lstReadOnly; + for (int i=0; iisColumnReadOnly(col)) + lstReadOnly << name; + } + + if (lstReadOnly.count() > 0){ + QMessageBox::warning(this, tr("QtiPlot - Error"), + tr("The folowing columns")+":\n"+ lstReadOnly.join("\n") + "\n"+ tr("are read only!")); + } + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + time_t tmp; + srand(time(&tmp)); + int rows=d_table->numRows(); + for (int j=0; j<(int) list.count(); j++){ + QString name=list[j]; + selectedCol=colIndex(name); + if (d_table->isColumnReadOnly(selectedCol)) + continue; + + int prec; + char f; + columnNumericFormat(selectedCol, &f, &prec); + + for (int i=0; isetText(i, selectedCol, locale().toString(double(rand())/double(RAND_MAX), f, prec)); + + emit modifiedData(this, name); + } + + emit modifiedWindow(this); + QApplication::restoreOverrideCursor(); +} + +void Table::loadHeader(QStringList header) +{ + col_label = QStringList(); + col_plot_type = QList (); + for (int i=0; inumCols(); j++){ + if (col_plot_type[j] == X) + xcols++; + } + + if (xcols > 1){ + xcols = 0; + for (int i=0; i < d_table->numCols(); i++){ + if (col_plot_type[i] == X) + setColumnHeader(i, col_label[i]+"[X" + QString::number(++xcols) +"]"); + else if (col_plot_type[i] == Y){ + if(xcols>0) + setColumnHeader(i, col_label[i]+"[Y"+ QString::number(xcols) +"]"); + else + setColumnHeader(i, col_label[i]+"[Y]"); + } else if (col_plot_type[i] == Z){ + if(xcols>0) + setColumnHeader(i, col_label[i]+"[Z"+ QString::number(xcols) +"]"); + else + setColumnHeader(i, col_label[i]+"[Z]"); + } else if (col_plot_type[i] == xErr) + setColumnHeader(i, col_label[i]+"[xEr]"); + else if (col_plot_type[i] == yErr) + setColumnHeader(i, col_label[i]+"[yEr]"); + else if (col_plot_type[i] == Label) + setColumnHeader(i, col_label[i]+"[L]"); + else + setColumnHeader(i, col_label[i]); + } + } else { + for (int i=0; i < d_table->numCols(); i++){ + if (col_plot_type[i] == X) + setColumnHeader(i, col_label[i]+"[X]"); + else if (col_plot_type[i] == Y) + setColumnHeader(i, col_label[i]+"[Y]"); + else if (col_plot_type[i] == Z) + setColumnHeader(i, col_label[i]+"[Z]"); + else if (col_plot_type[i] == xErr) + setColumnHeader(i, col_label[i]+"[xEr]"); + else if (col_plot_type[i] == yErr) + setColumnHeader(i, col_label[i]+"[yEr]"); + else if (col_plot_type[i] == Label) + setColumnHeader(i, col_label[i]+"[L]"); + else + setColumnHeader(i, col_label[i]); + } + } +} + +void Table::setAscValues() +{ + QStringList list=selectedColumns(); + QStringList lstReadOnly; + for (int i=0; iisColumnReadOnly(col)) + lstReadOnly << name; + } + + if (lstReadOnly.count() > 0){ + QMessageBox::warning(this, tr("QtiPlot - Error"), + tr("The folowing columns")+":\n"+ lstReadOnly.join("\n") + "\n"+ tr("are read only!")); + } + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + int rows = d_table->numRows(); + for (int j=0; j<(int) list.count(); j++){ + QString name = list[j]; + selectedCol = colIndex(name); + + if (d_table->isColumnReadOnly(selectedCol)) + continue; + + if (columnType(selectedCol) != Numeric){ + colTypes[selectedCol] = Numeric; + col_format[selectedCol] = "0/6"; + } + + int prec; + char f; + columnNumericFormat(selectedCol, &f, &prec); + + for (int i=0; inumCols(); i++){ + if (col_plot_type[i] == X) + return false; + } + return notSet; +} + +bool Table::noYColumn() +{ + bool notSet = true; + for (int i=0; inumCols(); i++){ + if (col_plot_type[i] == Y) + return false; + } + return notSet; +} + +void Table::importASCII(const QString &fname, const QString &sep, int ignoredLines, bool renameCols, + bool stripSpaces, bool simplifySpaces, bool importComments, const QString& commentString, + bool readOnly, ImportMode importAs, const QLocale& importLocale, int endLine, int maxRows, const QList& newColTypes) +{ + int rows; + QString name = MdiSubWindow::parseAsciiFile(fname, commentString, endLine, ignoredLines, maxRows, rows); + if (name.isEmpty()) + return; + + QFile f(name); + if (!f.open(QIODevice::ReadOnly)) + return; + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QLocale locale = this->locale(); + bool updateDecimalSeparators = (importLocale != locale) ? true : false; + + QTextStream t(&f); + QString s = t.readLine();//read first line + if (simplifySpaces) + s = s.simplifyWhiteSpace(); + else if (stripSpaces) + s = s.stripWhiteSpace(); + + QStringList line = s.split(sep); + int cols = line.size(); + + bool allNumbers = true; + for (int i=0; inumCols(); + int r = d_table->numRows(); + switch(importAs){ + case Overwrite: + if (d_table->numRows() != rows) + d_table->setNumRows(rows); + + if (c != cols){ + if (c < cols) + addColumns(cols - c); + else { + d_table->setNumCols(cols); + for (int i = c-1; i>=cols; i--){ + emit removedCol(QString(objectName()) + "_" + oldHeader[i]); + commands.removeLast(); + comments.removeLast(); + col_format.removeLast(); + col_label.removeLast(); + colTypes.removeLast(); + col_plot_type.removeLast(); + } + } + } + break; + case NewColumns: + startCol = c; + addColumns(cols); + if (r < rows) + d_table->setNumRows(rows); + break; + case NewRows: + startRow = r; + if (c < cols) + addColumns(cols - c); + d_table->setNumRows(r + rows); + break; + } + + if (!newColTypes.isEmpty()){ + switch(importAs){ + case NewColumns: + for (int i = c; i < c + newColTypes.size(); i++) + if (i < colTypes.size()) + colTypes[i] = newColTypes[i]; + break; + default: + for (int i = 0; i < newColTypes.size(); i++) + colTypes[i] = newColTypes[i]; + break; + } + } + + if (renameCols && !allNumbers){//use first line to set the table header + for (int i = 0; iprocessEvents(QEventLoop::ExcludeUserInput); + showComments(true); + } + + if ((!renameCols || allNumbers) && !importComments && rows > 0){ + //put values in the first line of the table + for (int i = 0; i < cols; i++){ + bool ok; + double val = importLocale.toDouble(line[i], &ok); + if (colTypes[i] == Table::Numeric && ok && updateDecimalSeparators){ + char format; + int prec; + columnNumericFormat(startCol + i, &format, &prec); + d_table->setText(startRow, startCol + i, locale.toString(val, format, prec)); + } else + d_table->setText(startRow, startCol + i, line[i]); + } + startRow++; + } + + d_table->blockSignals(true); + setHeaderColType(); + + int steps = rows/100 + 1; + QProgressDialog progress((QWidget *)applicationWindow()); + progress.setWindowTitle(tr("Qtiplot") + " - " + tr("Reading file...")); + progress.setLabelText(fname); + progress.setActiveWindow(); + progress.setAutoClose(true); + progress.setAutoReset(true); + progress.setRange(0, steps); + + QApplication::restoreOverrideCursor(); + + int l = 0; + int row = startRow; + rows = d_table->numRows(); + while (!t.atEnd() && row < rows){ + if (progress.wasCanceled()){ + f.close(); + return; + } + s = t.readLine(); + if (simplifySpaces) + s = s.simplifyWhiteSpace(); + else if (stripSpaces) + s = s.stripWhiteSpace(); + line = s.split(sep); + int lc = line.size(); + if (lc > cols) { + addColumns(lc - cols); + cols = lc; + } + + for (int j = 0; jsetText(row, startCol + j, locale.toString(val, format, prec)); + } else + d_table->setText(row, startCol + j, line[j]); + } + + l++; + row++; + if (l%100 == 0) + progress.setValue(l/100); + } + + d_table->blockSignals(false); + f.remove(); + + if (readOnly){ + for (int i = 0; isetColumnReadOnly(startCol + i, true); + } + + if (importAs == Overwrite || importAs == NewRows){ + if (cols > c) + cols = c; + + for (int i = 0; i < cols; i++){ + emit modifiedData(this, colName(i)); + if (colLabel(i) != oldHeader[i]) + emit changedColHeader(QString(objectName()) + "_" + oldHeader[i], QString(objectName()) + "_" + colLabel(i)); + } + } +} + +bool Table::exportODF(const QString& fname, bool withLabels, bool exportComments, bool exportSelection) +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + int rows = d_table->numRows(); + int cols = d_table->numCols(); + int selectedCols = 0; + int topRow = 0, bottomRow = 0; + int *sCols = 0; + int r = rows; + if (exportSelection){ + for (int i=0; iisColumnSelected(i)) + selectedCols++; + } + + sCols = new int[selectedCols]; + int aux = 0; + for (int i=0; iisColumnSelected(i)){ + sCols[aux] = i; + aux++; + } + } + + for (int i=0; iisRowSelected(i)){ + topRow = i; + break; + } + } + + for (int i = rows - 1; i > 0; i--){ + if (d_table->isRowSelected(i)){ + bottomRow = i; + break; + } + } + + r = abs(bottomRow - topRow) + 1; + } + + int aux = selectedCols; + if (!selectedCols) + aux = cols; + + QTextDocument *document = new QTextDocument(); + QTextCursor cursor = QTextCursor(document); + + QTextTableFormat tableFormat; + tableFormat.setAlignment(Qt::AlignCenter); + tableFormat.setCellPadding(0); + tableFormat.setHeaderRowCount(0); + tableFormat.setBorder (1); + tableFormat.setBorderStyle(QTextFrameFormat::BorderStyle_Solid); + tableFormat.setWidth(QTextLength(QTextLength::PercentageLength, 100)); + + int headerRows = 0; + if (withLabels) + headerRows++; + if (exportComments) + headerRows++; + r += headerRows; + + QTextTable *table = cursor.insertTable(r, aux, tableFormat); + QTextCharFormat cellFormat; + cellFormat.setBackground (QBrush(Qt::gray)); + for (int i = 0; i < aux; i++){ + for (int j = 0; j < headerRows; j++){ + QTextTableCell cell = table->cellAt(j, i); + cell.setFormat(cellFormat); + } + } + + if (withLabels){ + QStringList header = colNames(); + QStringList ls = header.grep ( QRegExp ("\\D")); + if (exportSelection){ + for (int i = 0; i < aux; i++){ + if (ls.count()>0) + cursor.insertText(header[sCols[i]]); + else + cursor.insertText("C" + header[sCols[i]]); + cursor.movePosition(QTextCursor::NextCell); + } + } else { + if (ls.count() > 0){ + for (int j = 0; j < aux; j++){ + cursor.insertText(header[j]); + cursor.movePosition(QTextCursor::NextCell); + } + } else { + for (int j = 0; j < aux; j++){ + cursor.insertText("C" + header[j]); + cursor.movePosition(QTextCursor::NextCell); + } + } + } + }// finished writting labels + + if (exportComments){ + if (exportSelection){ + for (int i = 0; i < aux; i++){ + cursor.insertText(comments[sCols[i]]); + cursor.movePosition(QTextCursor::NextCell); + } + } else { + for (int i = 0; i < aux; i++){ + cursor.insertText(comments[i]); + cursor.movePosition(QTextCursor::NextCell); + } + } + } + + if (exportSelection){ + for (int i = topRow; i <= bottomRow; i++){ + for (int j = 0; j < aux; j++){ + cursor.insertText(d_table->text(i, sCols[j])); + cursor.movePosition(QTextCursor::NextCell); + } + } + delete [] sCols; + } else { + for (int i = 0; i < rows; i++) { + for (int j = 0; j < aux; j++){ + cursor.insertText(d_table->text(i, j)); + cursor.movePosition(QTextCursor::NextCell); + } + } + } + + QTextDocumentWriter writer(fname); + if (fname.endsWith(".html")) + writer.setFormat("HTML"); + writer.write(document); + + QApplication::restoreOverrideCursor(); + return true; +} + +bool Table::exportASCII(const QString& fname, const QString& separator, + bool withLabels, bool exportComments, bool exportSelection) +{ + QFile f(fname); + if ( !f.open( QIODevice::WriteOnly ) ){ + QMessageBox::critical(0, tr("QtiPlot - ASCII Export Error"), + tr("Could not write to file:

"+fname+ "

Please verify that you have the right to write to this location!").arg(fname)); + return false; + } + + if (fname.endsWith(".odf") || fname.endsWith(".html")){ + f.close(); + return exportODF(fname, withLabels, exportComments, exportSelection); + } + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + QTextStream t( &f ); + QString eol = applicationWindow()->endOfLine(); + QString sep = separator; + bool exportTex = (fname.endsWith(".tex")) ? true : false; + if (exportTex){ + t << "\\begin{tabular}{|"; + eol = "\\\\\\hline\n"; + sep = " & "; + } + + int rows = d_table->numRows(); + int cols = d_table->numCols(); + int selectedCols = 0; + int topRow = 0, bottomRow = 0; + int *sCols = 0; + if (exportSelection){ + for (int i=0; iisColumnSelected(i)) + selectedCols++; + } + + sCols = new int[selectedCols]; + int aux = 0; + for (int i=0; iisColumnSelected(i)){ + sCols[aux] = i; + aux++; + } + } + + for (int i=0; iisRowSelected(i)){ + topRow = i; + break; + } + } + + for (int i = rows - 1; i > 0; i--){ + if (d_table->isRowSelected(i)){ + bottomRow = i; + break; + } + } + } + + int aux = selectedCols - 1; + if (!selectedCols) + aux = cols - 1; + + if (exportTex){ + for (int i = 0; i <= aux; i++) + t << "c|"; + t << "}\\hline\n"; + } + + if (withLabels){ + QStringList header = colNames(); + QStringList ls = header.grep ( QRegExp ("\\D")); + if (exportSelection){ + for (int i = 0; i < aux; i++){ + if (ls.count()>0) + t << header[sCols[i]] + sep; + else + t << "C" + header[sCols[i]] + sep; + } + + if (aux >= 0){ + if (ls.count()>0) + t << header[sCols[aux]] + eol; + else + t << "C" + header[sCols[aux]] + eol; + } + } else { + if (ls.count()>0){ + for (int j = 0; j < aux; j++) + t << header[j] + sep; + t << header[aux] + eol; + } else { + for (int j = 0; j < aux; j++) + t << "C" + header[j] + sep; + t << "C" + header[aux] + eol; + } + } + }// finished writting labels + + if (exportComments){ + if (exportSelection){ + for (int i = 0; i < aux; i++) + t << comments[sCols[i]] + sep; + if (aux >= 0) + t << comments[sCols[aux]] + eol; + } else { + for (int i = 0; i < aux; i++) + t << comments[i] + sep; + t << comments[aux] + eol; + } + } + + if (exportSelection){ + for (int i = topRow; i <= bottomRow; i++){ + for (int j = 0; j < aux; j++) + t << d_table->text(i, sCols[j]) + sep; + if (aux >= 0) + t << d_table->text(i, sCols[aux]) + eol; + } + delete [] sCols; + } else { + for (int i = 0; i < rows; i++) { + for (int j = 0; j < aux; j++) + t << d_table->text(i, j) + sep; + t << d_table->text(i, aux) + eol; + } + } + + if (exportTex) + t << "\\end{tabular}\n"; + + f.close(); + QApplication::restoreOverrideCursor(); + return true; +} + +void Table::moveCurrentCell() +{ + int cols=d_table->numCols(); + int row=d_table->currentRow(); + int col=d_table->currentColumn(); + d_table->clearSelection (true); + + if (col+1setCurrentCell(row, col+1); + d_table->selectCells(row, col+1, row, col+1); + } + else + { + if(row+1 >= numRows()) + d_table->setNumRows(row + 11); + + d_table->setCurrentCell (row+1, 0); + d_table->selectCells(row+1, 0, row+1, 0); + } +} + +bool Table::eventFilter(QObject *object, QEvent *e) +{ + Q3Header *hheader = d_table->horizontalHeader(); + Q3Header *vheader = d_table->verticalHeader(); + + if (e->type() == QEvent::MouseButtonDblClick && object == (QObject*)hheader) { + const QMouseEvent *me = (const QMouseEvent *)e; + selectedCol = hheader->sectionAt (me->pos().x() + hheader->offset()); + + QRect rect = hheader->sectionRect (selectedCol); + rect.setLeft(rect.right() - 2); + rect.setWidth(4); + + if (rect.contains (me->pos())) { + d_table->adjustColumn(selectedCol); + emit modifiedWindow(this); + } else + emit optionsDialog(); + setActiveWindow(); + return true; + } else if (e->type() == QEvent::MouseButtonPress && object == (QObject*)hheader) { + const QMouseEvent *me = (const QMouseEvent *)e; + if (me->button() == Qt::LeftButton){ + int col = hheader->sectionAt (me->pos().x() + hheader->offset()); + if (me->state() == Qt::ControlButton){ + if (!d_table->isColumnSelected(col, true)){ + selectedCol = col; + d_table->selectColumn (col); + d_table->setCurrentCell (0, col); + } else {//deselect already selected column: dirty hack to be modified when porting Table to Qt4 + QVector sel; + int cols = 0; + for (int i = 0; i < d_table->numCols(); i++){ + if(d_table->isColumnSelected (i, true) && i != col){ + sel << i; + cols++; + } + } + sel.resize(cols); + d_table->clearSelection(); + for (int i = 0; i < cols; i++) + d_table->selectColumn (sel[i]); + } + setActiveWindow(); + return true; + } + + if (me->modifiers() == Qt::ShiftModifier){ + int col = hheader->sectionAt (me->pos().x() + hheader->offset()); + for (int i = selectedCol; i <= col; i++) + d_table->selectColumn(i); + return true; + } + + QRect r = hheader->sectionRect(col); + r = QRect(r.topLeft(), QSize(r.width(), 10)); + if (d_table->isColumnSelected(col, true) && r.contains(me->pos())){ + QDrag *drag = new QDrag(this); + QMimeData *mimeData = new QMimeData; + mimeData->setText(selectedColumns().join("\n")); + drag->setMimeData(mimeData); + drag->setPixmap(QPixmap(":/drag_curves.png")); + drag->exec(); + return true; + } + + selectedCol = hheader->sectionAt (me->pos().x() + hheader->offset()); + d_table->clearSelection(); + d_table->selectColumn (selectedCol); + d_table->setCurrentCell (0, selectedCol); + setActiveWindow(); + return false; + } + + if (me->button() == Qt::RightButton && selectedColsNumber() <= 1){ + selectedCol = hheader->sectionAt (me->pos().x() + hheader->offset()); + d_table->clearSelection(); + d_table->selectColumn (selectedCol); + d_table->setCurrentCell (0, selectedCol); + setActiveWindow(); + return false; + } + } else if (e->type() == QEvent::MouseButtonPress && object == (QObject*)vheader) { + const QMouseEvent *me = (const QMouseEvent *)e; + if (me->button() == Qt::RightButton && numSelectedRows() <= 1) { + d_table->clearSelection(); + int row = vheader->sectionAt(me->pos().y() + vheader->offset()); + d_table->selectRow (row); + d_table->setCurrentCell (row, 0); + setActiveWindow(); + } + } else if (e->type() == QEvent::ContextMenu && object == (QObject*)d_table){ + const QContextMenuEvent *ce = (const QContextMenuEvent *)e; + QRect r = d_table->horizontalHeader()->sectionRect(d_table->numCols()-1); + setFocus(); + if (ce->pos().x() > r.right() + d_table->verticalHeader()->width()) + emit showContextMenu(false); + else if (d_table->numCols() > 0 && d_table->numRows() > 0) + emit showContextMenu(true); + } else if (e->type() == QEvent::MouseMove && object == (QObject*)hheader){ + const QMouseEvent *me = (const QMouseEvent *)e; + int col = hheader->sectionAt (me->pos().x() + hheader->offset()); + QRect r = hheader->sectionRect(col); + r = QRect(r.topLeft(), QSize(r.width(), 10)); + if (d_table->isColumnSelected(col, true) && r.contains(me->pos())) + setCursor(QCursor(QPixmap(":/append_drag_curves.png"))); + else + setCursor(QCursor(Qt::ArrowCursor)); + return false; + } + + return MdiSubWindow::eventFilter(object, e); +} + +void Table::customEvent(QEvent *e) +{ + if (e->type() == SCRIPTING_CHANGE_EVENT) + scriptingChangeEvent((ScriptingChangeEvent*)e); +} + +void Table::setNumRows(int rows) +{ + d_table->setNumRows(rows); +} + +void Table::setNumCols(int c) +{ + int cols = d_table->numCols(); + if (cols == c) + return; + + if (cols > c){ + d_table->setNumCols(c); + for (int i = cols - 1; i >= c; i--){ + commands.removeLast(); + comments.removeLast(); + col_format.removeLast(); + col_label.removeLast(); + colTypes.removeLast(); + col_plot_type.removeLast(); + } + } else { + addColumns(c - cols); + setHeaderColType(); + } +} + +void Table::resizeRows(int r) +{ + int rows = d_table->numRows(); + if (rows == r) + return; + + if (rows > r){ + QString text= tr("Rows will be deleted from the table!"); + text+="

"+tr("Do you really want to continue?"); + int i,cols = d_table->numCols(); + switch( QMessageBox::information(this,tr("QtiPlot"), text, tr("Yes"), tr("Cancel"), 0, 1 ) ) + { + case 0: + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + d_table->setNumRows(r); + for (i=0; isetNumRows(r); + QApplication::restoreOverrideCursor(); + } + + emit modifiedWindow(this); +} + +void Table::resizeCols(int c) +{ + int cols = d_table->numCols(); + if (cols == c) + return; + + if (cols > c){ + QString text= tr("Columns will be deleted from the table!"); + text+="

"+tr("Do you really want to continue?"); + switch( QMessageBox::information(this,tr("QtiPlot"), text, tr("Yes"), tr("Cancel"), 0, 1 ) ){ + case 0: { + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + Q3MemArray columns(cols-c); + for (int i=cols-1; i>=c; i--){ + QString name = colName(i); + emit removedCol(name); + columns[i-c]=i; + + commands.removeLast(); + comments.removeLast(); + col_format.removeLast(); + col_label.removeLast(); + colTypes.removeLast(); + col_plot_type.removeLast(); + } + + d_table->removeColumns(columns); + QApplication::restoreOverrideCursor(); + break; + } + + case 1: + return; + break; + } + } + else{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + addColumns(c-cols); + setHeaderColType(); + QApplication::restoreOverrideCursor(); + } + emit modifiedWindow(this); +} + +void Table::copy(Table *m, bool values) +{ + int rows = d_table->numRows(); + int cols = d_table->numCols(); + + if (values){ + for (int i=0; isetText(i, j, m->text(i, j)); + } + } + + for (int i=0; isetColumnReadOnly(i, m->isReadOnlyColumn(i)); + d_table->setColumnWidth(i, m->columnWidth(i)); + if (m->isColumnHidden(i)) + d_table->hideColumn(i); + } + + col_label = m->colNames(); + col_plot_type = m->plotDesignations(); + d_show_comments = m->commentsEnabled(); + comments = m->colComments(); + setHeaderColType(); + + commands = m->getCommands(); + setColumnTypes(m->columnTypes()); + col_format = m->getColumnsFormat(); +} + +void Table::restore(const QStringList& lst) +{ + QStringList l; + QStringList::const_iterator i=lst.begin(); + + l= (*i++).split("\t"); + l.remove(l.first()); + loadHeader(l); + + setColWidths((*i).right((*i).length()-9).split("\t", QString::SkipEmptyParts)); + i++; + + l = (*i++).split("\t"); + if (l[0] == "com") + { + l.remove(l.first()); + setCommands(l); + } else if (l[0] == "") { + commands.clear(); + for (int col=0; colnumCols(); i++) + emit modifiedData(this, colName(i)); + + emit modifiedWindow(this); +} + +void Table::notifyChanges(const QString& colName) +{ + emit modifiedData(this, colName); + emit modifiedWindow(this); +} + +void Table::clear() +{ + for (int i=0; inumCols(); i++) + { + for (int j=0; jnumRows(); j++) + d_table->setText(j, i, QString::null); + + emit modifiedData(this, colName(i)); + } + + emit modifiedWindow(this); +} + +void Table::goToRow(int row) +{ + if( (row < 1) || (row > numRows()) ) return; + + d_table->ensureCellVisible ( row-1, 0 ); + d_table->clearSelection(); + d_table->selectRow(row-1); +} + +void Table::goToColumn(int col) +{ + if( (col < 1) || (col > numCols()) ) + return; + + d_table->ensureCellVisible (0, col - 1); + d_table->clearSelection(); + d_table->selectColumn(col - 1); +} + +void Table::setColumnHeader(int index, const QString& label) +{ + Q3Header *head = d_table->horizontalHeader(); + if (d_show_comments){ + QString s = label; + int lines = d_table->columnWidth(index)/head->fontMetrics().boundingRect("_").width(); + head->setLabel(index, s.remove("\n") + "\n" + QString(lines, '_') + "\n" + comments[index]); + } else + head->setLabel(index, label); +} + +void Table::showComments(bool on) +{ + if (d_show_comments == on) + return; + + d_show_comments = on; + setHeaderColType(); + +#ifndef Q_OS_MAC + if(!on) + d_table->setTopMargin (d_table->horizontalHeader()->height()/2); +#endif +} + +void Table::setNumericPrecision(int prec) +{ + if (prec > 14) + prec = 14; + + d_numeric_precision = prec; + for (int i=0; inumCols(); i++){ + if (colTypes[i] == Numeric) + col_format[i] = "0/" + QString::number(prec); + } +} + +void Table::updateDecimalSeparators(const QLocale& oldSeparators) +{ + QLocale l = locale(); + if (l == oldSeparators) + return; + + int rows = d_table->numRows(); + for (int i=0; inumCols(); i++){ + if (colTypes[i] != Numeric) + continue; + + char format; + int prec; + columnNumericFormat(i, &format, &prec); + + for (int j = 0; jtext(j, i); + if (!s.isEmpty()){ + double val = oldSeparators.toDouble(s); + d_table->setText(j, i, l.toString(val, format, prec)); + } + } + } +} + +bool Table::isReadOnlyColumn(int col) +{ + if (col < 0 || col >= d_table->numCols()) + return false; + + return d_table->isColumnReadOnly(col); +} + +void Table::setReadOnlyColumn(int col, bool on) +{ + if (col < 0 || col >= d_table->numCols()) + return; + + d_table->setColumnReadOnly(col, on); +} + +void Table::moveColumn(int, int fromIndex, int toIndex) +{ + int to = toIndex; + if (fromIndex < toIndex) + to = toIndex - 1; + + col_label.move(fromIndex, to); + comments.move(fromIndex, to); + commands.move(fromIndex, to); + colTypes.move(fromIndex, to); + col_format.move(fromIndex, to); + col_plot_type.move(fromIndex, to); + setHeaderColType(); +} + +void Table::swapColumns(int col1, int col2) +{ + if (col1 < 0 || col1 >= d_table->numCols() || col2 < 0 || col2 >= d_table->numCols()) + return; + + int width1 = d_table->columnWidth(col1); + int width2 = d_table->columnWidth(col2); + + d_table->swapColumns(col1, col2); + col_label.swap (col1, col2); + comments.swap (col1, col2); + commands.swap (col1, col2); + colTypes.swap (col1, col2); + col_format.swap (col1, col2); + col_plot_type.swap (col1, col2); + + d_table->setColumnWidth(col1, width2); + d_table->setColumnWidth(col2, width1); + setHeaderColType(); + emit modifiedWindow(this); +} + +void Table::moveColumnBy(int cols) +{ + int oldPos = selectedCol; + int newPos = oldPos + cols; + if (newPos < 0) + newPos = 0; + else if (newPos >= d_table->numCols()) + newPos = d_table->numCols() - 1; + + if (abs(cols) > 1){ + if (cols < 0){ + d_table->insertColumns(newPos); + d_table->swapColumns(oldPos + 1, newPos); + d_table->removeColumn(oldPos + 1); + } else { + d_table->insertColumns(newPos + 1); + d_table->swapColumns(oldPos, newPos + 1); + d_table->removeColumn(oldPos); + } + + col_label.move(oldPos, newPos); + comments.move(oldPos, newPos); + commands.move(oldPos, newPos); + colTypes.move(oldPos, newPos); + col_format.move(oldPos, newPos); + col_plot_type.move(oldPos, newPos); + } else + swapColumns(oldPos, newPos); + + setHeaderColType(); + + setSelectedCol(newPos); + d_table->clearSelection(); + d_table->selectColumn(newPos); + emit modifiedWindow(this); +} + +void Table::hideColumn(int col, bool hide) +{ + if(hide) + d_table->hideColumn(col); + else + d_table->showColumn(col); +} + +void Table::hideSelectedColumns() +{ + for(int i = 0; inumCols(); i++){ + if (d_table->isColumnSelected(i, true)) + d_table->hideColumn(i); + } +} + +void Table::showAllColumns() +{ + for(int i = 0; inumCols(); i++){ + if (d_table->isColumnHidden(i)) + d_table->showColumn(i); + } +} + +QString Table::sizeToString() +{ + int size = d_table->numRows() * d_table->numCols(); + return QString::number((sizeof(Table) + size*sizeof(Q3TableItem))/1024.0, 'f', 1) + " " + tr("kB"); +} + +void Table::moveRow(bool up) +{ + int row = d_table->currentRow(); + int nextRow = row - 1; + if (up){ + if (!row) + return; + } else { + if (row == d_table->numRows() - 1) + return; + + nextRow = row + 1; + } + + d_table->clearSelection(); + d_table->swapRows(row, nextRow); + d_table->selectRow(nextRow); + d_table->ensureCellVisible(nextRow, 0); + d_table->updateContents(); + + emit modifiedWindow(this); +} + +double Table::sum(int col, int startRow, int endRow) +{ + if (col < 0 || col >= d_table->numCols()) + return 0.0; + + if (colTypes[col] != Numeric) + return 0.0; + + int rows = d_table->numRows(); + if (startRow < 0 || startRow >= rows) + startRow = 0; + if (endRow < 0 || endRow >= rows) + endRow = d_table->numRows() - 1; + + QLocale l = locale(); + double sum = 0.0; + for (int i = startRow; i <= endRow; i++){ + QString s = d_table->text(i, col); + if (!s.isEmpty()) + sum += l.toDouble(s); + } + return sum; +} + +double Table::avg(int col, int startRow, int endRow) +{ + if (col < 0 || col >= d_table->numCols()) + return 0.0; + + if (colTypes[col] != Numeric) + return 0.0; + + int rows = d_table->numRows(); + if (startRow < 0 || startRow >= rows) + startRow = 0; + if (endRow < 0 || endRow >= rows) + endRow = d_table->numRows() - 1; + + QLocale l = locale(); + double sum = 0.0; + int count = 0; + for (int i = startRow; i <= endRow; i++){ + QString s = d_table->text(i, col); + if (!s.isEmpty()){ + sum += l.toDouble(s); + count++; + } + } + + if (count) + return sum/(double)count; + + return 0.0; +} + +/***************************************************************************** + * + * Class MyTable + * + *****************************************************************************/ + +MyTable::MyTable(QWidget * parent, const char * name) +:Q3Table(parent, name) +{} + +MyTable::MyTable(int numRows, int numCols, QWidget * parent, const char * name) +:Q3Table(numRows, numCols, parent, name) +{} + +void MyTable::activateNextCell() +{ + int row = currentRow(); + int col = currentColumn(); + + clearSelection (true); + + if(row+1 >= numRows()) + setNumRows(row + 11); + + setCurrentCell (row + 1, col); + selectCells(row+1, col, row+1, col); +} === removed file 'qtiplot/src/table/Table.cpp' --- qtiplot/src/table/Table.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/table/Table.cpp 1970-01-01 00:00:00 +0000 @@ -1,3412 +0,0 @@ -/*************************************************************************** - File : Table.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de - Description : Table worksheet class - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "Table.h" -#include "SortDialog.h" -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -Table::Table(ScriptingEnv *env, int r, int c, const QString& label, ApplicationWindow* parent, const QString& name, Qt::WFlags f) -: MdiSubWindow(label,parent,name,f), scripted(env) -{ - init(r,c); -} - -void Table::init(int rows, int cols) -{ - selectedCol=-1; - d_saved_cells = 0; - d_show_comments = false; - d_numeric_precision = 13; - - d_table = new MyTable(rows, cols, this, "table"); - d_table->setSelectionMode (Q3Table::Single); - d_table->setRowMovingEnabled(true); - d_table->setColumnMovingEnabled(true); - d_table->setCurrentCell(-1, -1); - - connect(d_table->verticalHeader(), SIGNAL(indexChange(int, int, int)), - this, SLOT(notifyChanges())); - connect(d_table->horizontalHeader(), SIGNAL(indexChange(int, int, int)), - this, SLOT(moveColumn(int, int, int))); - - setFocusPolicy(Qt::StrongFocus); - setFocus(); - - for (int i=0; ihorizontalHeader(); - head->setMouseTracking(true); - head->setResizeEnabled(true); - head->installEventFilter(this); - connect(head, SIGNAL(sizeChange(int, int, int)), this, SLOT(colWidthModified(int, int, int))); - - col_plot_type[0] = X; - setHeaderColType(); - - int w = 4*(d_table->horizontalHeader())->sectionSize(0); - int h = 11*(d_table->verticalHeader())->sectionSize(0); - setGeometry(50, 50, w + 45, h); - - d_table->verticalHeader()->setResizeEnabled(false); - d_table->verticalHeader()->installEventFilter(this); - - setWidget(d_table); - - QShortcut *accelTab = new QShortcut(QKeySequence(Qt::Key_Tab), this); - connect(accelTab, SIGNAL(activated()), this, SLOT(moveCurrentCell())); - - QShortcut *accelAll = new QShortcut(QKeySequence(Qt::CTRL+Qt::Key_A), this); - connect(accelAll, SIGNAL(activated()), this, SLOT(selectAllTable())); - - connect(d_table, SIGNAL(valueChanged(int, int)), this, SLOT(cellEdited(int, int))); - - setAutoUpdateValues(applicationWindow()->autoUpdateTableValues()); -} - -void Table::setAutoUpdateValues(bool on) -{ - if (on){ - connect(this, SIGNAL(modifiedData(Table *, const QString&)), - this, SLOT(updateValues(Table*, const QString&))); - } else { - disconnect(this, SIGNAL(modifiedData(Table *, const QString&)), - this, SLOT(updateValues(Table*, const QString&))); - } -} - -void Table::colWidthModified(int, int, int) -{ - emit modifiedWindow(this); - setHeaderColType(); -} - - -void Table::setBackgroundColor(const QColor& col) -{ - d_table->setPaletteBackgroundColor ( col ); -} - -void Table::setTextColor(const QColor& col) -{ - d_table->setPaletteForegroundColor (col); -} - -void Table::setTextFont(const QFont& fnt) -{ - d_table->setFont (fnt); - QFontMetrics fm(fnt); - int lm = fm.width( QString::number(10*d_table->numRows())); - d_table->setLeftMargin( lm ); -} - -void Table::setHeaderColor(const QColor& col) -{ - QPalette palette = d_table->horizontalHeader()->palette (); - palette.setColor (QColorGroup::ButtonText, col); -#ifdef Q_OS_MAC //! Highlighting of the header text - palette.setColor (QColorGroup::BrightText, col); -#endif - d_table->horizontalHeader()->setPalette (palette); -} - -void Table::setHeaderFont(const QFont& fnt) -{ - d_table->horizontalHeader()->setFont (fnt); -} - -void Table::exportPDF(const QString& fileName) -{ - print(fileName); -} - -void Table::print() -{ - print(QString()); -} - -void Table::print(QPrinter *printer) -{ - if (!printer) - return; - - QPainter p; - if (!p.begin(printer)) - return; // paint on printer - - Q3PaintDeviceMetrics metrics( p.device() ); - int dpiy = metrics.logicalDpiY(); - const int margin = (int) ( (1/2.54)*dpiy ); // 2 cm margins - - Q3Header *hHeader = d_table->horizontalHeader(); - Q3Header *vHeader = d_table->verticalHeader(); - - int rows=d_table->numRows(); - int cols=d_table->numCols(); - int height=margin; - int i,vertHeaderWidth=vHeader->width(); - int right = margin + vertHeaderWidth; - - // print header - p.setFont(hHeader->font()); - QRect br=p.boundingRect(br,Qt::AlignCenter, hHeader->label(0)); - p.drawLine(right,height,right,height+br.height()); - QRect tr(br); - - for (i=0;icolumnWidth (i); - tr.setTopLeft(QPoint(right,height)); - tr.setWidth(w); - tr.setHeight(br.height()); - p.drawText(tr,Qt::AlignCenter,hHeader->label(i),-1); - right+=w; - p.drawLine(right,height,right,height+tr.height()); - - if (right >= metrics.width()-2*margin ) - break; - } - p.drawLine(margin + vertHeaderWidth, height, right-1, height);//first horizontal line - height += tr.height(); - p.drawLine(margin,height,right-1,height); - - // print table values - for (i=0;ilabel(i)+"\t"; - tr = p.boundingRect(tr,Qt::AlignCenter,text); - p.drawLine(right,height,right,height+tr.height()); - - br.setTopLeft(QPoint(right,height)); - br.setWidth(vertHeaderWidth); - br.setHeight(tr.height()); - p.drawText(br,Qt::AlignCenter,text,-1); - right += vertHeaderWidth; - p.drawLine(right,height,right,height+tr.height()); - - for (int j=0;jcolumnWidth (j); - text=d_table->text(i,j)+"\t"; - tr=p.boundingRect(tr,Qt::AlignCenter,text); - br.setTopLeft(QPoint(right,height)); - br.setWidth(w); - br.setHeight(tr.height()); - p.drawText(br,Qt::AlignCenter,text,-1); - right+=w; - p.drawLine(right,height,right,height+tr.height()); - - if (right >= metrics.width()-2*margin ) - break; - } - height+=br.height(); - p.drawLine(margin, height, right - 1, height); - - if (height >= metrics.height() - margin ) - { - printer->newPage(); - height=margin; - p.drawLine(margin, height, right, height); - } - } - p.end(); -} - -void Table::print(const QString& fileName) -{ - QPrinter printer; - printer.setColorMode (QPrinter::GrayScale); - if (!fileName.isEmpty()){ - printer.setCreator("QtiPlot"); - printer.setOutputFormat(QPrinter::PdfFormat); - printer.setOutputFileName(fileName); - } else { - QPrintDialog printDialog(&printer, applicationWindow()); - if (printDialog.exec() != QDialog::Accepted) - return; - } - - printer.setFullPage( true ); - print(&printer); -} - -void Table::cellEdited(int row, int col) -{ - QString text = d_table->text(row,col).remove(QRegExp("\\s")); - if (columnType(col) != Numeric || text.isEmpty()){ - emit modifiedData(this, colName(col)); - emit modifiedWindow(this); - return; - } - - char f; - int precision; - columnNumericFormat(col, &f, &precision); - bool ok = true; - double res = locale().toDouble(text, &ok); - if (ok) - d_table->setText(row, col, locale().toString(res, f, precision)); - else { - Script *script = scriptEnv->newScript(d_table->text(row,col),this,QString("<%1_%2_%3>").arg(objectName()).arg(row+1).arg(col+1)); - connect(script, SIGNAL(error(const QString&,const QString&,int)), scriptEnv, SIGNAL(error(const QString&,const QString&,int))); - - script->setInt(row+1, "i"); - script->setInt(col+1, "j"); - QVariant ret = script->eval(); - if(ret.type()==QVariant::Int || ret.type()==QVariant::UInt || ret.type()==QVariant::LongLong || ret.type()==QVariant::ULongLong) - d_table->setText(row, col, ret.toString()); - else if(ret.canCast(QVariant::Double)) - d_table->setText(row, col, locale().toString(ret.toDouble(), f, precision)); - else - d_table->setText(row, col, ""); - } - - emit modifiedData(this, colName(col)); - emit modifiedWindow(this); -} - -int Table::colX(int col) -{ - int i, xcol = -1; - for(i=col-1; i>=0; i--) - { - if (col_plot_type[i] == X) - return i; - } - for(i=col+1; i<(int)d_table->numCols(); i++) - { - if (col_plot_type[i] == X) - return i; - } - return xcol; -} - -int Table::colY(int col) -{ - int i, yCol = -1; - for(i=col-1; i>=0; i--) - { - if (col_plot_type[i] == Y) - return i; - } - for(i=col+1; i<(int)d_table->numCols(); i++) - { - if (col_plot_type[i] == Y) - return i; - } - return yCol; -} - -void Table::setPlotDesignation(PlotDesignation pd, bool rightColumns) -{ - if (rightColumns){ - int cols = d_table->numCols(); - for (int i = selectedCol; i= d_table->numCols() || col_plot_type[col] == pd) - return; - - col_plot_type[col] = pd; - if (pd == Label) - colTypes[col] = Text; -} - -void Table::columnNumericFormat(int col, int *f, int *precision) -{ - QStringList format = col_format[col].split("/", QString::KeepEmptyParts); - if (format.count() == 2){ - *f = format[0].toInt(); - *precision = format[1].toInt(); - if (*precision > 14) - *precision = 14; - } else { - *f = 0; - *precision = 14; - } -} - -void Table::columnNumericFormat(int col, char *f, int *precision) -{ - QStringList format = col_format[col].split("/", QString::KeepEmptyParts); - if (format.count() == 2){ - switch(format[0].toInt()){ - case 0: - *f = 'g'; - break; - - case 1: - *f = 'f'; - break; - - case 2: - *f = 'e'; - break; - } - *precision = format[1].toInt(); - if (*precision > 14) - *precision = 14; - } else { - *f = 'g'; - *precision = 14; - } -} - -int Table::columnWidth(int col) -{ - return d_table->columnWidth(col); -} - -QStringList Table::columnWidths() -{ - QStringList widths; - for (int i=0;inumCols();i++) - widths<columnWidth(i)); - - return widths; -} - -void Table::setColWidths(const QStringList& widths) -{ - for (int i=0; i<(int)widths.count(); i++) - d_table->setColumnWidth(i, widths[i].toInt()); -} - -void Table::setColumnTypes(const QStringList& ctl) -{ - int n = QMIN((int)ctl.count(), numCols()); - for (int i=0; i= numRows()) - resizeRows(endRow + 1); - - QString cmd = commands[col]; - if (cmd.isEmpty() || colTypes[col] != Numeric){ - for (int i = startRow; i <= endRow; i++) - d_table->setText(i, col, cmd); - if (notifyChanges) - emit modifiedData(this, colName(col)); - emit modifiedWindow(this); - return true; - } - - if (cmd.count("\n") > 0){ - QString mess = tr("Multiline expressions take much more time to evaluate! Do you want to continue anyways?"); - if (QMessageBox::Yes != QMessageBox::warning(this, tr("QtiPlot") + " - " + tr("Warning"), mess, - QMessageBox::Yes, QMessageBox::Cancel)) - return false; - } - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - muParserScript *mup = new muParserScript(scriptEnv, cmd, this, QString("<%1>").arg(colName(col))); - double *r = mup->defineVariable("i"); - mup->defineVariable("j", (double)col); - mup->defineVariable("sr", startRow + 1.0); - mup->defineVariable("er", endRow + 1.0); - - if (!mup->compile()){ - QApplication::restoreOverrideCursor(); - return false; - } - - QLocale loc = locale(); - int prec; - char f; - columnNumericFormat(col, &f, &prec); - - if (mup->codeLines() == 1){ - for (int i = startRow; i <= endRow; i++){ - *r = i + 1.0; - d_table->setText(i, col, mup->evalSingleLineToString(loc, f, prec)); - } - } else { - QVariant ret; - for (int i = startRow; i <= endRow; i++){ - *r = i + 1.0; - ret = mup->eval(); - if(ret.type() == QVariant::Double) { - d_table->setText(i, col, loc.toString(ret.toDouble(), f, prec)); - } else if(ret.canConvert(QVariant::String)) - d_table->setText(i, col, ret.toString()); - else { - QApplication::restoreOverrideCursor(); - return false; - } - } - } - if (notifyChanges) - emit modifiedData(this, colName(col)); - emit modifiedWindow(this); - QApplication::restoreOverrideCursor(); - return true; -} - -bool Table::calculate(int col, int startRow, int endRow, bool forceMuParser, bool notifyChanges) -{ - if (col < 0 || col >= d_table->numCols()) - return false; - - if (d_table->isColumnReadOnly(col)){ - QMessageBox::warning(this, tr("QtiPlot - Error"), - tr("Column '%1' is read only!").arg(col_label[col])); - return false; - } - - if (QString(scriptEnv->name()) == "muParser" || forceMuParser) - return muParserCalculate(col, startRow, endRow, notifyChanges); - - if (startRow < 0) - startRow = 0; - if (endRow >= numRows()) - resizeRows(endRow + 1); - - QString cmd = commands[col]; - if (cmd.isEmpty() || colTypes[col] != Numeric){ - for (int i=startRow; i<=endRow; i++) - d_table->setText(i, col, cmd); - if (notifyChanges) - emit modifiedData(this, colName(col)); - emit modifiedWindow(this); - return true; - } - - QApplication::setOverrideCursor(Qt::WaitCursor); - - Script *colscript = scriptEnv->newScript(cmd, this, QString("<%1>").arg(colName(col))); - connect(colscript, SIGNAL(error(const QString&,const QString&,int)), scriptEnv, SIGNAL(error(const QString&,const QString&,int))); - connect(colscript, SIGNAL(print(const QString&)), scriptEnv, SIGNAL(print(const QString&))); - - if (!colscript->compile()){ - QApplication::restoreOverrideCursor(); - return false; - } - - QLocale loc = locale(); - int prec; - char f; - columnNumericFormat(col, &f, &prec); - - colscript->setDouble(col + 1.0, "j"); - colscript->setDouble(startRow + 1.0, "sr"); - colscript->setDouble(endRow + 1.0, "er"); - QVariant ret; - for (int i = startRow; i <= endRow; i++){ - colscript->setDouble(i + 1.0, "i"); - ret = colscript->eval(); - if(ret.type() == QVariant::Double) - d_table->setText(i, col, loc.toString(ret.toDouble(), f, prec)); - else if(ret.canConvert(QVariant::String)) - d_table->setText(i, col, ret.toString()); - else { - QApplication::restoreOverrideCursor(); - return false; - } - } - if (notifyChanges) - emit modifiedData(this, colName(col)); - emit modifiedWindow(this); - QApplication::restoreOverrideCursor(); - return true; -} - -void Table::updateValues(Table* t, const QString& columnName) -{ - if (!t || t != this) - return; - - QString colLabel = columnName; - colLabel.remove(this->objectName()).remove("_"); - - int cols = numCols(); - int endRow = numRows() - 1; - for (int i = 0; i < cols; i++){ - QString cmd = commands[i]; - if (cmd.isEmpty() || colTypes[i] != Numeric || !cmd.contains("\"" + colLabel + "\"") || - cmd.contains("\"" + col_label[i] + "\"")) - continue; - - calculate(i, 0, endRow, false, true); - } -} - -Q3TableSelection Table::getSelection() -{ - Q3TableSelection sel; - if (d_table->numSelections() == 0){ - sel.init(d_table->currentRow(), d_table->currentColumn()); - sel.expandTo(d_table->currentRow(), d_table->currentColumn()); - } else if (d_table->currentSelection()>0) - sel = d_table->selection(d_table->currentSelection()); - else - sel = d_table->selection(0); - return sel; -} - -QString Table::saveColumnWidths() -{ - QString s="ColWidth\t"; - for (int i=0;inumCols();i++) - s+=QString::number(d_table->columnWidth (i))+"\t"; - return s+"\n"; -} - -QString Table::saveColumnTypes() -{ - QString s="ColType"; - for (int i=0; inumCols(); i++) - s += "\t"+QString::number(colTypes[i])+";"+col_format[i]; - return s+"\n"; -} - -QString Table::saveCommands() -{ - QString s="\n"; - for (int col=0; col\n"; - s += commands[col]; - s += "\n\n"; - } - s += "\n"; - return s; -} - -QString Table::saveComments() -{ - QString s = "Comments\t"; - for (int i=0; inumCols(); i++){ - if (comments.count() > i) - s += comments[i] + "\t"; - else - s += "\t"; - } - return s + "\n"; -} - -QString Table::saveHeader() -{ - QString s = "header"; - for (int j=0; jnumCols(); j++){ - if (col_plot_type[j] == X) - s += "\t" + colLabel(j) + "[X]"; - else if (col_plot_type[j] == Y) - s += "\t" + colLabel(j) + "[Y]"; - else if (col_plot_type[j] == Z) - s += "\t" + colLabel(j) + "[Z]"; - else if (col_plot_type[j] == xErr) - s += "\t" + colLabel(j) + "[xEr]"; - else if (col_plot_type[j] == yErr) - s += "\t" + colLabel(j) + "[yEr]"; - else if (col_plot_type[j] == Label) - s += "\t" + colLabel(j) + "[L]"; - else - s += "\t" + colLabel(j); - } - return s += "\n"; -} - -QString Table::saveReadOnlyInfo() -{ - QString s = "ReadOnlyColumn"; - for (int i=0; inumCols(); i++) - s += "\t" + QString::number(d_table->isColumnReadOnly(i)); - return s += "\n"; -} - -QString Table::saveHiddenColumnsInfo() -{ - QString s = "HiddenColumn"; - for (int i=0; inumCols(); i++) - s += "\t" + QString::number(d_table->isColumnHidden(i)); - return s += "\n"; -} - -void Table::save(const QString& fn, const QString& geometry, bool saveAsTemplate) -{ - QFile f(fn); - if (!f.isOpen()){ - if (!f.open(QIODevice::Append)) - return; - } - QTextStream t( &f ); - t.setEncoding(QTextStream::UnicodeUTF8); - t << ""; - if (saveAsTemplate){ - t << "\t" + QString::number(d_table->numRows()) + "\t"; - t << QString::number(d_table->numCols()) + "\n"; - } else { - t << "\n" + QString(objectName()) + "\t"; - t << QString::number(d_table->numRows()) + "\t"; - t << QString::number(d_table->numCols()) + "\t"; - t << birthDate() + "\n"; - } - t << geometry; - t << saveHeader(); - t << saveColumnWidths(); - t << saveCommands(); - t << saveColumnTypes(); - t << saveReadOnlyInfo(); - t << saveHiddenColumnsInfo(); - t << saveComments(); - - if (!saveAsTemplate){ - t << "WindowLabel\t" + windowLabel() + "\t" + QString::number(captionPolicy()) + "\n"; - t << "\n"; - int cols = d_table->numCols() - 1; - int rows = d_table->numRows(); - for (int i=0; itext(i, j).isEmpty()) - t << QString::number(cell(i, j), 'e', 14) + "\t"; - else - t << d_table->text(i, j) + "\t"; - } - if (colTypes[cols] == Numeric && !d_table->text(i, cols).isEmpty()) - t << QString::number(cell(i, cols), 'e', 14) + "\n"; - else - t << d_table->text(i, cols) + "\n"; - } - } - t << "\n"; - } - t << "
\n"; -} - -int Table::firstXCol() -{ - int xcol = -1; - for (int j=0; jnumCols(); j++) - { - if (col_plot_type[j] == X) - return j; - } - return xcol; -} - -QString Table::comment(int col) -{ - if (col < 0 || col >= d_table->numCols()) - return QString::null; - - return comments[col]; -} - -void Table::setColComment(int col, const QString& s) -{ - if (col < 0 || col >= d_table->numCols()) - return; - - if (comments[col] == s) - return; - - comments[col] = s; - - if (d_show_comments) - setHeaderColType(); -} - -void Table::setColumnWidth(int width, bool allCols) -{ - int cols=d_table->numCols(); - if (allCols) - { - for (int i=0;isetColumnWidth (i, width); - - emit modifiedWindow(this); - } - else - { - if (d_table->columnWidth(selectedCol) == width) - return; - - d_table->setColumnWidth (selectedCol, width); - emit modifiedWindow(this); - } -} - -void Table::adjustColumnsWidth() -{ - int cols = d_table->numCols(); - for (int i = 0; i < cols; i++){ - if(d_table->isColumnSelected (i, true)) - d_table->adjustColumn(i); - } - - emit modifiedWindow(this); -} - -void Table::setColumnWidth(int col, int width) -{ - - if (d_table->columnWidth(col) == width) - return; - - d_table->setColumnWidth (col, width); - emit modifiedWindow(this); -} - -QString Table::colName(int col) -{//returns the table name + horizontal header text - if (col<0 || col >= col_label.count()) - return QString(); - - return QString(this->objectName())+"_"+col_label[col]; -} - -void Table::setColName(int col, const QString& text, bool enumerateRight) -{ - if (text.isEmpty() || col<0 || col >= d_table->numCols()) - return; - - if (col_label[col] == text && !enumerateRight) - return; - - QString caption = objectName(); - QString oldLabel = col_label[col]; - int cols = col + 1; - if (enumerateRight) - cols = (int)d_table->numCols(); - - int n = 1; - for (int i = col; i 0){ - QMessageBox::critical(0,tr("QtiPlot - Error"), - tr("There is already a column called : "+newLabel+" in table "+caption+"!

Please choose another name!")); - return; - } - n++; - } - - n = 1; - caption += "_"; - for (int i = col; inumCols(); i++){ - if(d_table->isColumnSelected (i, true)) - names << QString(name()) + "_" + col_label[i]; - } - return names; -} - -QStringList Table::YColumns() -{ - QStringList names; - for (int i = 0; i < d_table->numCols(); i++){ - if(col_plot_type[i] == Y) - names << QString(name()) + "_" + col_label[i]; - } - return names; -} - -QStringList Table::selectedYColumns() -{ - QStringList names; - for (int i = 0; i < d_table->numCols(); i++){ - if(d_table->isColumnSelected (i) && col_plot_type[i] == Y) - names << QString(objectName()) + "_" + col_label[i]; - } - return names; -} - -QStringList Table::selectedErrColumns() -{ - QStringList names; - for (int i=0;inumCols();i++){ - if(d_table->isColumnSelected (i, true) && - (col_plot_type[i] == yErr || col_plot_type[i] == xErr)) - names<numCols(); i++){ - if(d_table->isColumnSelected (i) && col_plot_type[i] == Y) - names << QString(objectName()) + "_" + col_label[i]; - } - - for (int i=0; inumCols(); i++){ - if(d_table->isColumnSelected (i) && - (col_plot_type[i] == yErr || col_plot_type[i] == xErr || col_plot_type[i] == Label)) - names << QString(objectName()) + "_" + col_label[i]; - } - return names; -} - -QStringList Table::selectedYLabels() -{ - QStringList names; - for (int i=0;inumCols();i++){ - if(d_table->isColumnSelected (i) && col_plot_type[i] == Y) - names<numCols();i++) - names<numCols();i++) - { - if(d_table->isColumnSelected (i,true)) - return i; - } - return -1; -} - -int Table::numSelectedRows() -{ - int r=0; - for (int i=0;inumRows();i++) - { - if(d_table->isRowSelected (i,true)) - r++; - } - return r; -} - -int Table::selectedColsNumber() -{ - int c=0; - for (int i=0;inumCols(); i++){ - if(d_table->isColumnSelected (i,true)) - c++; - } - return c; -} - -QVarLengthArray Table::col(int c) -{ - if (c < 0 || c >= d_table->numCols()) - return QVarLengthArray(); - - int rows = d_table->numRows(); - QVarLengthArray Y(rows); - QLocale l = locale(); - for (int i = 0; itext(i, c)); - return Y; -} - -void Table::columnRange(int c, double *min, double *max) -{ - if (c < 0 || c >= d_table->numCols()) - return; - - double d_min = 0.0; - double d_max = 0.0; - - Q3TableSelection selection = getSelection(); - - QLocale l = locale(); - int startRow = selection.topRow(); - for (int i = selection.topRow(); i <= selection.bottomRow(); i++){ - QString s = d_table->text(i, c); - if (!s.isEmpty()){ - d_min = l.toDouble(s); - d_max = d_min; - startRow = i; - break; - } - } - - for (int i = startRow; i <= selection.bottomRow(); i++){ - QString s = d_table->text(i, c); - if (!s.isEmpty()){ - double aux = l.toDouble(s); - - if (aux <= d_min) - d_min = aux; - - if (aux >= d_max) - d_max = aux; - } - } - - *min = d_min; - *max = d_max; -} - -void Table::insertCols(int start, int count) -{ - if (start < 0) - start = 0; - - int max = 0; - int cols = d_table->numCols(); - QList hiddenCols; - - for (int i = 0; i max) - max = id; - } - hiddenCols << d_table->isColumnHidden(i); - } - max++; - - d_table->insertColumns(start, count); - - for(int i = 0; inumCols(); i++) - hideColumn(i, hiddenCols[i]); - - emit modifiedWindow(this); -} - -void Table::insertCol() -{ - insertCols(selectedCol, 1); -} - -void Table::insertRow() -{ - int cr = d_table->currentRow(); - if (d_table->isRowSelected (cr, true)) - { - d_table->insertRows(cr, 1); - emit modifiedWindow(this); - } -} - -void Table::addCol(PlotDesignation pd) -{ - d_table->clearSelection(); - int index, max=0, cols=d_table->numCols(); - for (int i=0; i max) - max = index; - } - } - d_table->insertColumns(cols); - d_table->ensureCellVisible ( 0, cols ); - - comments << QString(); - commands << ""; - colTypes << Numeric; - col_format << "0/" + QString::number(d_numeric_precision); - col_label << QString::number(max+1); - col_plot_type << pd; - - setHeaderColType(); - emit modifiedWindow(this); -} - -void Table::addColumns(int c) -{ - int max=0, cols=d_table->numCols(); - for (int i=0; imax) - max=index; - } - } - max++; - d_table->insertColumns(cols, c); - for (int i=0; iisColumnReadOnly(selectedCol)) - return; - - for (int i=0; inumRows(); i++){ - if (d_table->isSelected (i, selectedCol)) - d_table->setText(i, selectedCol, ""); - } - - emit modifiedData(this, colName(selectedCol)); -} - -void Table::clearCell(int row, int col) -{ - if (col < 0 || col >= d_table->numCols()) - return; - - if (d_table->isColumnReadOnly(col)){ - QMessageBox::warning(this, tr("QtiPlot - Error"), tr("Column '%1' is read only!").arg(colName(col))); - return; - } - - d_table->setText(row, col, ""); - - emit modifiedData(this, colName(col)); - emit modifiedWindow(this); -} - -void Table::deleteSelectedRows() -{ - Q3TableSelection sel = d_table->selection(0); - deleteRows(sel.topRow() + 1, sel.bottomRow() + 1); -} - -void Table::deleteRows(int startRow, int endRow) -{ - for(int i=0; inumCols(); i++){ - if (d_table->isColumnReadOnly(i)){ - QMessageBox::warning(this, tr("QtiPlot - Error"), - tr("The table '%1' contains read-only columns! Operation aborted!").arg(objectName())); - return; - } - } - - int start = QMIN(startRow, endRow); - int end = QMAX(startRow, endRow); - - start--; - end--; - if (start < 0) - start = 0; - if (end >= d_table->numRows()) - end = d_table->numRows() - 1; - - int rows = abs(end - start) + 1; - Q3MemArray rowsToDelete(rows); - for (int i=0; iremoveRows(rowsToDelete); - notifyChanges(); -} - -void Table::cutSelection() -{ - copySelection(); - clearSelection(); -} - -void Table::selectAllTable() -{ - d_table->addSelection (Q3TableSelection( 0, 0, d_table->numRows(), d_table->numCols() )); -} - -void Table::deselect() -{ - d_table->clearSelection(); -} - -void Table::clearSelection() -{ - QStringList list=selectedColumns(); - int n = int(list.count()); - - if (n>0){ - QStringList lstReadOnly; - for (int i=0; iisColumnReadOnly(col)) - lstReadOnly << name; - } - if (lstReadOnly.count() > 0){ - QMessageBox::warning(this, tr("QtiPlot - Error"), - tr("The folowing columns")+":\n"+ lstReadOnly.join("\n") + "\n"+ tr("are read only!")); - } - - for (int i=0; iselection(0); - int top=sel.topRow(); - int bottom=sel.bottomRow(); - int left=sel.leftCol(); - int right=sel.rightCol(); - - if (sel.isEmpty ()){ - int col = d_table->currentColumn(); - QString name = colName(col); - if (d_table->isColumnReadOnly(col)){ - QMessageBox::warning(this, tr("QtiPlot - Error"), - tr("Column '%1' is read only!").arg(name)); - return; - } - d_table->setText(d_table->currentRow (), col, ""); - emit modifiedData(this, name); - } else { - QStringList lstReadOnly; - for (int i=left; i<=right; i++){ - QString name = col_label[i]; - if (d_table->isColumnReadOnly(i)) - lstReadOnly << name; - } - if (lstReadOnly.count() > 0){ - QMessageBox::warning(this, tr("QtiPlot - Error"), - tr("The folowing columns")+":\n"+ lstReadOnly.join("\n") + "\n"+ tr("are read only!")); - } - - for (int i=left; i<=right; i++){ - if (d_table->isColumnReadOnly(i)) - continue; - - for (int j=top; j<=bottom; j++) - d_table->setText(j, i, ""); - - QString name = colName(i); - emit modifiedData(this, name); - } - } - } - emit modifiedWindow(this); -} - -void Table::copySelection() -{ - QString text; - int rows = d_table->numRows(); - int cols = d_table->numCols(); - QString eol = applicationWindow()->endOfLine(); - - QVarLengthArray selection(1); - int c = 0; - for (int i = 0; iisColumnSelected(i, true)){ - c++; - selection.resize(c); - selection[c-1] = i; - } - } - if (c > 0){ - for (int i = 0; itext(i, selection[j]) + "\t"; - text += d_table->text(i, selection[c-1]) + eol; - } - } else { - Q3TableSelection sel = d_table->selection(0); - int right = sel.rightCol(); - int bottom = sel.bottomRow(); - for (int i = sel.topRow(); itext(i, j) + "\t"; - text += d_table->text(i, right) + eol; - } - for (int j = sel.leftCol(); jtext(bottom, j) + "\t"; - text += d_table->text(bottom, right); - } - - // Copy text into the clipboard - QApplication::clipboard()->setText(text); -} - -// Paste text from the clipboard -void Table::pasteSelection() -{ - QString text = QApplication::clipboard()->text(); - if (text.isEmpty()) - return; - - QStringList linesList = text.split(ApplicationWindow::guessEndOfLine(text)); - int rows = linesList.size(); - if (rows < 1) - return; - - QStringList firstLine = linesList[0].split("\t", QString::SkipEmptyParts); - int cols = firstLine.count(); - for (int i = 1; i < rows; i++){ - int aux = linesList[i].split("\t").count(); - if (aux > cols) - cols = aux; - } - - QLocale l = locale(); - QLocale clipboardLocale = applicationWindow()->clipboardLocale(); - - bool allNumbers = true; - bool pasteComments = false; - bool pasteHeader = false; - for (int i = 0; i < firstLine.size(); i++) - {//verify if the strings in the line used to rename the columns are not all numbers - clipboardLocale.toDouble(firstLine[i], &allNumbers); - if (!allNumbers){ - switch(QMessageBox::question(this, tr("QtiPlot") + " - " + tr("Paste operation"), - tr("How should QtiPlot interpret first clipboard line?"), - tr("&Values"), tr("Column &Names"), tr("&Comments"), 1, 1)){ - case 0: - break; - case 1: - pasteHeader = true; - linesList.pop_front(); - rows--; - break; - case 2: - pasteComments = true; - linesList.pop_front(); - rows--; - break; - } - break; - } - } - - int top, left, firstCol = firstSelectedColumn(); - Q3TableSelection sel = d_table->selection(0); - if (!sel.isEmpty()){// not columns but only cells are selected - top = sel.topRow(); - left = sel.leftCol(); - } else if(cols == 1 && rows == 1){ - top = d_table->currentRow(); - left = d_table->currentColumn(); - } else { - top = 0; - left = 0; - if (firstCol >= 0)// columns are selected - left = firstCol; - } - - if (top + rows > d_table->numRows()) - d_table->setNumRows(top + rows); - if (left + cols > d_table->numCols()){ - addColumns(left + cols - d_table->numCols()); - setHeaderColType(); - } - - QStringList lstReadOnly; - for (int i = left; i < left + cols; i++){ - QString name = colName(i); - if (d_table->isColumnReadOnly(i)) - lstReadOnly << name; - } - if (lstReadOnly.count() > 0){ - QMessageBox::warning(this, tr("QtiPlot - Error"), - tr("The folowing columns")+":\n"+ lstReadOnly.join("\n") + "\n"+ tr("are read only!")); - } - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - if (pasteComments || pasteHeader){ - for (int j = left; j < left + cols; j++){ - if (d_table->isColumnReadOnly(j) || firstLine.size() <= j) - continue; - - if (pasteComments) - comments[j] = firstLine[j]; - else if (pasteHeader) - col_label[j] = firstLine[j].replace("-","_").remove(QRegExp("\\W")).replace("_","-"); - } - if (pasteComments) - showComments(); - else if (pasteHeader) - setHeaderColType(); - } - - for (int i = 0; i < rows; i++){ - int row = top + i; - QStringList cells = linesList[i].split("\t"); - for (int j = left; j < left + cols; j++){ - if (d_table->isColumnReadOnly(j)) - continue; - - int colIndex = j-left; - if (colIndex >= cells.count()) - break; - - bool numeric = false; - double value = clipboardLocale.toDouble(cells[colIndex], &numeric); - if (numeric){ - int prec; - char f; - columnNumericFormat(j, &f, &prec); - d_table->setText(row, j, l.toString(value, f, prec)); - } else - d_table->setText(row, j, cells[colIndex]); - } - } - - for (int i = left; i< left + cols; i++){ - if (!d_table->isColumnReadOnly(i)) - emit modifiedData(this, colName(i)); - } - emit modifiedWindow(this); - QApplication::restoreOverrideCursor(); -} - -void Table::removeCol() -{ - QStringList list=selectedColumns(); - removeCol(list); -} - -void Table::removeCol(const QStringList& list) -{ - QStringList lstReadOnly; - for (int i=0; iisColumnReadOnly(col)) - lstReadOnly << name; - } - - if (lstReadOnly.count() > 0){ - QMessageBox::warning(this, tr("QtiPlot - Error"), - tr("The folowing columns")+":\n"+ lstReadOnly.join("\n") + "\n"+ tr("are read only!")); - } - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - for (int i=0; i= 0){ - if (d_table->isColumnReadOnly(id)) - continue; - - if ( id < commands.size() ) - commands.removeAt(id); - - if ( id < col_label.size() ) - col_label.removeAt(id); - - if ( id < col_format.size() ) - col_format.removeAt(id); - - if ( id < comments.size() ) - comments.removeAt(id); - - if ( id < colTypes.size() ) - colTypes.removeAt(id); - - if ( id < col_plot_type.size() ) - col_plot_type.removeAt(id); - - d_table->removeColumn(id); - emit removedCol(name); - } - } - emit modifiedWindow(this); - QApplication::restoreOverrideCursor(); -} - -void Table::normalizeSelection() -{ - QStringList s = selectedColumns(); - QStringList lstReadOnly; - for (int i=0; i<(int)s.count(); i++){ - int col = colIndex(s[i]); - if (d_table->isColumnReadOnly(col)) - lstReadOnly << col_label[col]; - } - - if (lstReadOnly.count() > 0){ - QMessageBox::warning(this, tr("QtiPlot - Error"), - tr("The folowing columns")+":\n"+ lstReadOnly.join("\n") + "\n"+ tr("are read only!")); - } - - for (int i=0; i<(int)s.count(); i++) - normalizeCol(colIndex(s[i])); - - emit modifiedWindow(this); -} - -void Table::normalize() -{ - QStringList lstReadOnly; - for (int i=0; inumCols(); i++){ - if (d_table->isColumnReadOnly(i)) - lstReadOnly << col_label[i]; - } - - if (lstReadOnly.count() > 0){ - QMessageBox::warning(this, tr("QtiPlot - Error"), - tr("The folowing columns")+":\n"+ lstReadOnly.join("\n") + "\n"+ tr("are read only!")); - } - - for (int i=0; inumCols(); i++) - normalizeCol(i); - - emit modifiedWindow(this); -} - -void Table::normalizeCol(int col) -{ - if (col<0) col = selectedCol; - if (d_table->isColumnReadOnly(col) || colTypes[col] == Table::Text) - return; - - int rows = d_table->numRows(); - gsl_vector *data = gsl_vector_alloc(rows); - for (int i=0; itext(i, col).isEmpty() ) - d_table->setText(i, col, locale().toString(gsl_vector_get(data, i)/max, f, prec)); - } - - gsl_vector_free(data); - emit modifiedData(this, colName(col)); -} - -void Table::sortColumnsDialog() -{ - SortDialog *sortd = new SortDialog((QWidget*)applicationWindow()); - sortd->setAttribute(Qt::WA_DeleteOnClose); - connect (sortd, SIGNAL(sort(int, int, const QString&)), this, SLOT(sortColumns(int, int, const QString&))); - sortd->insertColumnsList(selectedColumns()); - sortd->exec(); -} - -void Table::sortTableDialog() -{ - SortDialog *sortd = new SortDialog((QWidget*)applicationWindow()); - sortd->setAttribute(Qt::WA_DeleteOnClose); - connect (sortd, SIGNAL(sort(int, int, const QString&)), this, SLOT(sort(int, int, const QString&))); - sortd->insertColumnsList(colNames()); - sortd->exec(); -} - -void Table::sort(int type, int order, const QString& leadCol) -{ - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - sortColumns(col_label, type, order, leadCol); - QApplication::restoreOverrideCursor(); -} - -void Table::sortColumns(int type, int order, const QString& leadCol) -{ - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - sortColumns(selectedColumns(), type, order, leadCol); - QApplication::restoreOverrideCursor(); -} - -int compare_qstrings (const void * a, const void * b) -{ - QString *bb = (QString *)b; - return ((QString *)a)->compare(*bb); -} - -void Table::sortColumns(const QStringList&s, int type, int order, const QString& leadCol) -{ - int cols = s.count(); - if(!type){//Sort columns separately - for(int i=0;inumRows(); - int non_empty_cells = 0; - QVarLengthArray valid_cell(rows); - QVarLengthArray data_double(rows); - QVarLengthArray strings(rows); - for (int j = 0; j text(j, leadcol).isEmpty()){ - strings[non_empty_cells] = d_table->text(j, leadcol); - data_double[non_empty_cells] = cell(j, leadcol); - valid_cell[non_empty_cells] = j; - non_empty_cells++; - } - } - - if (!non_empty_cells){ - QApplication::restoreOverrideCursor(); - QMessageBox::critical(this, tr("QtiPlot - Error"), - tr("The leading column is empty! Operation aborted!")); - return; - } - - data_double.resize(non_empty_cells); - valid_cell.resize(non_empty_cells); - strings.resize(non_empty_cells); - - // Find the permutation index for the lead col - size_t *p = new size_t[non_empty_cells]; - if (columnType(leadcol) == Table::Text) - gsl_heapsort_index(p, strings.data(), strings.count(), sizeof(QString), compare_qstrings); - else - gsl_sort_index(p, data_double.data(), 1, non_empty_cells); - - for(int i = 0; i < cols; i++){// Since we have the permutation index, sort all the columns - int col = colIndex(s[i]); - if (d_table->isColumnReadOnly(col)) - continue; - - if (columnType(col) == Text){ - for (int j = 0; jsetText(valid_cell[j], col, strings[p[j]]); - else - for (int j = 0; j < non_empty_cells; j++) - d_table->setText(valid_cell[j], col, strings[p[non_empty_cells - j - 1]]); - } else { - for (int j = 0; jsetText(valid_cell[j], col, locale().toString(data_double[p[j]], f, prec)); - else - for (int j=0; jsetText(valid_cell[j], col, locale().toString(data_double[p[non_empty_cells-j-1]], f, prec)); - } - emit modifiedData(this, colName(col)); - } - delete[] p; - } - emit modifiedWindow(this); -} - -void Table::sortColumn(int col, int order) -{ - if (col < 0) - col = d_table->currentColumn(); - - if (d_table->isColumnReadOnly(col)) - return; - - int rows=d_table->numRows(); - int non_empty_cells = 0; - QVarLengthArray valid_cell(rows); - QVarLengthArray r(rows); - QStringList text_cells; - for (int i = 0; i text(i, col).isEmpty()){ - if (columnType(col) == Table::Text) - text_cells << d_table->text(i, col); - else - r[non_empty_cells] = cell(i, col); - valid_cell[non_empty_cells] = i; - non_empty_cells++; - } - } - - if (!non_empty_cells) - return; - - valid_cell.resize(non_empty_cells); - if (columnType(col) == Table::Text){ - r.clear(); - text_cells.sort(); - } else { - r.resize(non_empty_cells); - gsl_sort(r.data(), 1, non_empty_cells); - } - - if (columnType(col) == Table::Text){ - if (!order){ - for (int i=0; isetText(valid_cell[i], col, text_cells[i]); - } else { - for (int i=0; isetText(valid_cell[i], col, text_cells[non_empty_cells-i-1]); - } - } else { - int prec; - char f; - columnNumericFormat(col, &f, &prec); - if (!order) { - for (int i=0; isetText(valid_cell[i], col, locale().toString(r[i], f, prec)); - } else { - for (int i=0; isetText(valid_cell[i], col, locale().toString(r[non_empty_cells-i-1], f, prec)); - } - } - emit modifiedData(this, colName(col)); - emit modifiedWindow(this); -} - -void Table::sortColAsc() -{ -sortColumn(d_table->currentColumn ()); -} - -void Table::sortColDesc() -{ -sortColumn(d_table->currentColumn(), 1); -} - -int Table::numRows() -{ - return d_table->numRows(); -} - -int Table::numCols() -{ - return d_table->numCols(); -} - -bool Table::isEmptyRow(int row) -{ - for (int i=0; inumCols(); i++) - { - QString text = d_table->text(row,i); - if (!text.isEmpty()) - return false; - } - return true; -} - -bool Table::isEmptyColumn(int col) -{ - for (int i=0; inumRows(); i++) - { - QString text=d_table->text(i,col); - if (!text.isEmpty()) - return false; - } - return true; -} - -int Table::nonEmptyRows() -{ - int r=0; - for (int i=0;inumRows();i++){ - if (!isEmptyRow(i)) - r++; - } - return r; -} - -double Table::cell(int row, int col) -{ - return locale().toDouble(d_table->text(row, col)); -} - -void Table::setCell(int row, int col, double val) -{ - if (col < 0 || col >= d_table->numCols() || - row < 0 || row >= d_table->numRows()) - return; - - char format; - int prec; - columnNumericFormat(col, &format, &prec); - d_table->setText(row, col, locale().toString(val, format, prec)); -} - -QString Table::text(int row, int col) -{ - return d_table->text(row, col); -} - -void Table::setText (int row, int col, const QString & text ) -{ - d_table->setText(row, col, text); -} - -void Table::saveToMemory() -{ - int rows = d_table->numRows(); - int cols = d_table->numCols(); - - d_saved_cells = new double* [cols]; - for ( int i = 0; i < cols; ++i) - d_saved_cells[i] = new double [rows]; - - for (int col = 0; col < cols; col++){// initialize the matrix to zero - for (int row = 0; row < rows; row++) - d_saved_cells[col][row] = 0.0;} - - for (int col = 0; col < cols; col++){ - if (colTypes[col] == Time){ - QTime ref = QTime(0, 0); - for (int row = 0; row text(row, col), col_format[col]); - d_saved_cells[col][row] = ref.msecsTo(t); - } - } - else if (colTypes[col] == Date){ - QTime ref = QTime(0, 0); - for (int row = 0; row < rows; row++){ - QDateTime dt = QDateTime::fromString(d_table->text(row, col), col_format[col]); - d_saved_cells[col][row] = dt.date().toJulianDay() - 1 + (double)ref.msecsTo(dt.time())/864.0e5; - } - } - } - - QLocale l = locale(); - for (int col = 0; col < cols; col++){ - if (colTypes[col] == Numeric){ - for (int row=0; row < rows; row++){ - QString s = d_table->text(row, col); - if (!s.isEmpty()) - d_saved_cells[col][row] = l.toDouble(s); - } - } - } -} - -void Table::freeMemory() -{ - for ( int i = 0; i < d_table->numCols(); i++) - delete[] d_saved_cells[i]; - - delete[] d_saved_cells; - d_saved_cells = 0; -} - -void Table::setTextFormat(int col) -{ - if (col >= 0 && col < colTypes.count()) - colTypes[col] = Text; -} - -void Table::setColNumericFormat(int f, int prec, int col, bool updateCells) -{ - if (prec < 0) - prec = 0; - else if (prec > 14) - prec = 14; - - if (colTypes[col] == Numeric){ - int old_f, old_prec; - columnNumericFormat(col, &old_f, &old_prec); - if (old_f == f && old_prec == prec) - return; - } - - colTypes[col] = Numeric; - col_format[col] = QString::number(f) + "/" + QString::number(prec); - - if (!updateCells) - return; - - char format = 'g'; - for (int i=0; inumRows(); i++) { - QString t = text(i, col); - if (!t.isEmpty()) { - if (f == 1) - format = 'f'; - else if (f == 2) - format = 'e'; - else - format = 'g'; - - if (d_saved_cells) - setText(i, col, locale().toString(d_saved_cells[col][i], format, prec)); - else - setText(i, col, locale().toString(locale().toDouble(t), format, prec)); - } - } -} - -void Table::setColumnsFormat(const QStringList& lst) -{ - if (col_format == lst) - return; - - col_format = lst; -} - -bool Table::setDateFormat(const QString& format, int col, bool updateCells) -{ - if (colTypes[col] == Date && col_format[col] == format) - return true; - - bool first_time = false; - if (updateCells){ - for (int i=0; inumRows(); i++){ - QString s = d_table->text(i,col); - if (!s.isEmpty()){ - QDateTime d = QDateTime::fromString (s, format); - if (colTypes[col] != Date && d.isValid()){ - //This might be the first time the user assigns a date format. - //If Qt understands the format we break the loop, assign it to the column and return true! - first_time = true; - break; - } - - if (d_saved_cells){ - d = QDateTime(QDate::fromJulianDay((int)d_saved_cells[col][i] + 1)); - double msecs = (d_saved_cells[col][i] - floor(d_saved_cells[col][i]))*864e5; - d.setTime(d.time().addMSecs(qRound(msecs))); - if (d.isValid()) - d_table->setText(i, col, d.toString(format)); - } - } - } - } - colTypes[col] = Date; - col_format[col] = format; - QTime ref = QTime(0, 0); - if (first_time){//update d_saved_cells in case the user changes the time format before pressing OK in the column dialog - for (int i=0; inumRows(); i++){ - QDateTime dt = QDateTime::fromString(d_table->text(i, col), format); - d_saved_cells[col][i] = dt.date().toJulianDay() - 1 + (double)ref.msecsTo(dt.time())/864.0e5; - } - } - return true; -} - -bool Table::setTimeFormat(const QString& format, int col, bool updateCells) -{ - if (colTypes[col] == Time && col_format[col] == format) - return true; - - QTime ref = QTime(0, 0); - bool first_time = false; - if (updateCells){ - for (int i=0; inumRows(); i++){ - QString s = d_table->text(i,col); - if (!s.isEmpty()){ - QTime t = QTime::fromString (s, format); - if (colTypes[col] != Time && t.isValid()){ - //This is the first time the user assigns a time format. - //If Qt understands the format we break the loop, assign it to the column and return true! - first_time = true; - break; - } - - if (d_saved_cells){ - if (d_saved_cells[col][i] < 1)// import of Origin files - t = ref.addMSecs(int(d_saved_cells[col][i]*86400000)); - else - t = ref.addMSecs((int)d_saved_cells[col][i]); - - if (t.isValid()) - d_table->setText(i, col, t.toString(format)); - } - } - } - } - colTypes[col] = Time; - col_format[col] = format; - if (first_time){//update d_saved_cells in case the user changes the time format before pressing OK in the column dialog - for (int i=0; inumRows(); i++){ - QTime t = QTime::fromString(d_table->text(i, col), format); - d_saved_cells[col][i] = ref.msecsTo(t); - } - } - return true; -} - -void Table::setMonthFormat(const QString& format, int col, bool updateCells) -{ - if (colTypes[col] == Month && col_format[col] == format) - return; - - colTypes[col] = Month; - col_format[col] = format; - - if (!updateCells) - return; - - for (int i=0; itext(i,col); - if (!t.isEmpty()){ - int day; - if (d_saved_cells) - day = int(d_saved_cells[col][i]) % 12; - else - day = t.toInt() % 12; - if (!day) - day = 12; - - if (format == "M") - d_table->setText(i, col, QDate::shortMonthName(day).left(1)); - else if (format == "MMM") - d_table->setText(i, col, QDate::shortMonthName(day)); - else if (format == "MMMM") - d_table->setText(i, col, QDate::longMonthName(day)); - } - } -} - -void Table::setDayFormat(const QString& format, int col, bool updateCells) -{ - if (colTypes[col] == Day && col_format[col] == format) - return; - - colTypes[col] = Day; - col_format[col] = format; - - if (!updateCells) - return; - - for (int i=0; itext(i,col); - if (!t.isEmpty()){ - int day; - if (d_saved_cells) - day = int(d_saved_cells[col][i]) % 7; - else - day = t.toInt() % 7; - if (!day) - day = 7; - - if (format == "d") - d_table->setText(i, col, QDate::shortDayName(day).left(1)); - else if (format == "ddd") - d_table->setText(i, col, QDate::shortDayName(day)); - else if (format == "dddd") - d_table->setText(i, col, QDate::longDayName(day)); - } - } -} - -void Table::setRandomValues() -{ - QStringList list=selectedColumns(); - QStringList lstReadOnly; - for (int i=0; iisColumnReadOnly(col)) - lstReadOnly << name; - } - - if (lstReadOnly.count() > 0){ - QMessageBox::warning(this, tr("QtiPlot - Error"), - tr("The folowing columns")+":\n"+ lstReadOnly.join("\n") + "\n"+ tr("are read only!")); - } - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - time_t tmp; - srand(time(&tmp)); - int rows=d_table->numRows(); - for (int j=0; j<(int) list.count(); j++){ - QString name=list[j]; - selectedCol=colIndex(name); - if (d_table->isColumnReadOnly(selectedCol)) - continue; - - int prec; - char f; - columnNumericFormat(selectedCol, &f, &prec); - - for (int i=0; isetText(i, selectedCol, locale().toString(double(rand())/double(RAND_MAX), f, prec)); - - emit modifiedData(this, name); - } - - emit modifiedWindow(this); - QApplication::restoreOverrideCursor(); -} - -void Table::loadHeader(QStringList header) -{ - col_label = QStringList(); - col_plot_type = QList (); - for (int i=0; inumCols(); j++){ - if (col_plot_type[j] == X) - xcols++; - } - - if (xcols > 1){ - xcols = 0; - for (int i=0; i < d_table->numCols(); i++){ - if (col_plot_type[i] == X) - setColumnHeader(i, col_label[i]+"[X" + QString::number(++xcols) +"]"); - else if (col_plot_type[i] == Y){ - if(xcols>0) - setColumnHeader(i, col_label[i]+"[Y"+ QString::number(xcols) +"]"); - else - setColumnHeader(i, col_label[i]+"[Y]"); - } else if (col_plot_type[i] == Z){ - if(xcols>0) - setColumnHeader(i, col_label[i]+"[Z"+ QString::number(xcols) +"]"); - else - setColumnHeader(i, col_label[i]+"[Z]"); - } else if (col_plot_type[i] == xErr) - setColumnHeader(i, col_label[i]+"[xEr]"); - else if (col_plot_type[i] == yErr) - setColumnHeader(i, col_label[i]+"[yEr]"); - else if (col_plot_type[i] == Label) - setColumnHeader(i, col_label[i]+"[L]"); - else - setColumnHeader(i, col_label[i]); - } - } else { - for (int i=0; i < d_table->numCols(); i++){ - if (col_plot_type[i] == X) - setColumnHeader(i, col_label[i]+"[X]"); - else if (col_plot_type[i] == Y) - setColumnHeader(i, col_label[i]+"[Y]"); - else if (col_plot_type[i] == Z) - setColumnHeader(i, col_label[i]+"[Z]"); - else if (col_plot_type[i] == xErr) - setColumnHeader(i, col_label[i]+"[xEr]"); - else if (col_plot_type[i] == yErr) - setColumnHeader(i, col_label[i]+"[yEr]"); - else if (col_plot_type[i] == Label) - setColumnHeader(i, col_label[i]+"[L]"); - else - setColumnHeader(i, col_label[i]); - } - } -} - -void Table::setAscValues() -{ - QStringList list=selectedColumns(); - QStringList lstReadOnly; - for (int i=0; iisColumnReadOnly(col)) - lstReadOnly << name; - } - - if (lstReadOnly.count() > 0){ - QMessageBox::warning(this, tr("QtiPlot - Error"), - tr("The folowing columns")+":\n"+ lstReadOnly.join("\n") + "\n"+ tr("are read only!")); - } - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - int rows = d_table->numRows(); - for (int j=0; j<(int) list.count(); j++){ - QString name = list[j]; - selectedCol = colIndex(name); - - if (d_table->isColumnReadOnly(selectedCol)) - continue; - - if (columnType(selectedCol) != Numeric){ - colTypes[selectedCol] = Numeric; - col_format[selectedCol] = "0/6"; - } - - int prec; - char f; - columnNumericFormat(selectedCol, &f, &prec); - - for (int i=0; inumCols(); i++){ - if (col_plot_type[i] == X) - return false; - } - return notSet; -} - -bool Table::noYColumn() -{ - bool notSet = true; - for (int i=0; inumCols(); i++){ - if (col_plot_type[i] == Y) - return false; - } - return notSet; -} - -void Table::importASCII(const QString &fname, const QString &sep, int ignoredLines, bool renameCols, - bool stripSpaces, bool simplifySpaces, bool importComments, const QString& commentString, - bool readOnly, ImportMode importAs, int endLine, int maxRows) -{ - int rows; - QString name = MdiSubWindow::parseAsciiFile(fname, commentString, endLine, ignoredLines, maxRows, rows); - if (name.isEmpty()) - return; - - QFile f(name); - if (!f.open(QIODevice::ReadOnly)) - return; - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - QTextStream t(&f); - QString s = t.readLine();//read first line - if (simplifySpaces) - s = s.simplifyWhiteSpace(); - else if (stripSpaces) - s = s.stripWhiteSpace(); - - QStringList line = s.split(sep); - int cols = line.size(); - - bool allNumbers = true; - for (int i=0; inumCols(); - int r = d_table->numRows(); - switch(importAs){ - case Overwrite: - if (d_table->numRows() != rows) - d_table->setNumRows(rows); - - oldHeader = col_label; - if (c != cols){ - if (c < cols) - addColumns(cols - c); - else { - d_table->setNumCols(cols); - for (int i = c-1; i>=cols; i--){ - emit removedCol(QString(objectName()) + "_" + oldHeader[i]); - commands.removeLast(); - comments.removeLast(); - col_format.removeLast(); - col_label.removeLast(); - colTypes.removeLast(); - col_plot_type.removeLast(); - } - } - } - break; - case NewColumns: - startCol = c; - addColumns(cols); - if (r < rows) - d_table->setNumRows(rows); - break; - case NewRows: - startRow = r; - if (c < cols) - addColumns(cols - c); - d_table->setNumRows(r + rows); - break; - } - - if (renameCols && !allNumbers){//use first line to set the table header - for (int i = 0; iprocessEvents(QEventLoop::ExcludeUserInput); - showComments(true); - } - - if ((!renameCols || allNumbers) && !importComments && rows > 0){ - //put values in the first line of the table - for (int i = 0; isetText(startRow, startCol + i, line[i]); - startRow++; - } - - d_table->blockSignals(true); - setHeaderColType(); - - int steps = rows/100 + 1; - QProgressDialog progress((QWidget *)applicationWindow()); - progress.setWindowTitle(tr("Qtiplot") + " - " + tr("Reading file...")); - progress.setLabelText(fname); - progress.setActiveWindow(); - progress.setAutoClose(true); - progress.setAutoReset(true); - progress.setRange(0, steps); - - QApplication::restoreOverrideCursor(); - - int l = 0; - int row = startRow; - rows = d_table->numRows(); - while (!t.atEnd() && row < rows){ - if (progress.wasCanceled()){ - f.close(); - return; - } - s = t.readLine(); - if (simplifySpaces) - s = s.simplifyWhiteSpace(); - else if (stripSpaces) - s = s.stripWhiteSpace(); - line = s.split(sep); - int lc = line.size(); - if (lc > cols) { - addColumns(lc - cols); - cols = lc; - } - for (int j=0; jsetText(row, startCol + j, line[j]); - - l++; - row++; - if (l%100 == 0) - progress.setValue(l/100); - qApp->processEvents(); - } - - d_table->blockSignals(false); - f.remove(); - - if (readOnly){ - for (int i = 0; isetColumnReadOnly(startCol + i, true); - } - - if (importAs == Overwrite || importAs == NewRows){ - if (cols > c) - cols = c; - for (int i=0; inumRows(); - int cols = d_table->numCols(); - int selectedCols = 0; - int topRow = 0, bottomRow = 0; - int *sCols = 0; - int r = rows; - if (exportSelection){ - for (int i=0; iisColumnSelected(i)) - selectedCols++; - } - - sCols = new int[selectedCols]; - int aux = 0; - for (int i=0; iisColumnSelected(i)){ - sCols[aux] = i; - aux++; - } - } - - for (int i=0; iisRowSelected(i)){ - topRow = i; - break; - } - } - - for (int i = rows - 1; i > 0; i--){ - if (d_table->isRowSelected(i)){ - bottomRow = i; - break; - } - } - - r = abs(bottomRow - topRow) + 1; - } - - int aux = selectedCols; - if (!selectedCols) - aux = cols; - - QTextDocument *document = new QTextDocument(); - QTextCursor cursor = QTextCursor(document); - - QTextTableFormat tableFormat; - tableFormat.setAlignment(Qt::AlignCenter); - tableFormat.setCellPadding(0); - tableFormat.setHeaderRowCount(0); - tableFormat.setBorder (1); - tableFormat.setBorderStyle(QTextFrameFormat::BorderStyle_Solid); - tableFormat.setWidth(QTextLength(QTextLength::PercentageLength, 100)); - - int headerRows = 0; - if (withLabels) - headerRows++; - if (exportComments) - headerRows++; - r += headerRows; - - QTextTable *table = cursor.insertTable(r, aux, tableFormat); - QTextCharFormat cellFormat; - cellFormat.setBackground (QBrush(Qt::gray)); - for (int i = 0; i < aux; i++){ - for (int j = 0; j < headerRows; j++){ - QTextTableCell cell = table->cellAt(j, i); - cell.setFormat(cellFormat); - } - } - - if (withLabels){ - QStringList header = colNames(); - QStringList ls = header.grep ( QRegExp ("\\D")); - if (exportSelection){ - for (int i = 0; i < aux; i++){ - if (ls.count()>0) - cursor.insertText(header[sCols[i]]); - else - cursor.insertText("C" + header[sCols[i]]); - cursor.movePosition(QTextCursor::NextCell); - } - } else { - if (ls.count() > 0){ - for (int j = 0; j < aux; j++){ - cursor.insertText(header[j]); - cursor.movePosition(QTextCursor::NextCell); - } - } else { - for (int j = 0; j < aux; j++){ - cursor.insertText("C" + header[j]); - cursor.movePosition(QTextCursor::NextCell); - } - } - } - }// finished writting labels - - if (exportComments){ - if (exportSelection){ - for (int i = 0; i < aux; i++){ - cursor.insertText(comments[sCols[i]]); - cursor.movePosition(QTextCursor::NextCell); - } - } else { - for (int i = 0; i < aux; i++){ - cursor.insertText(comments[i]); - cursor.movePosition(QTextCursor::NextCell); - } - } - } - - if (exportSelection){ - for (int i = topRow; i <= bottomRow; i++){ - for (int j = 0; j < aux; j++){ - cursor.insertText(d_table->text(i, sCols[j])); - cursor.movePosition(QTextCursor::NextCell); - } - } - delete [] sCols; - } else { - for (int i = 0; i < rows; i++) { - for (int j = 0; j < aux; j++){ - cursor.insertText(d_table->text(i, j)); - cursor.movePosition(QTextCursor::NextCell); - } - } - } - - QTextDocumentWriter writer(fname); - if (fname.endsWith(".html")) - writer.setFormat("HTML"); - writer.write(document); - - QApplication::restoreOverrideCursor(); - return true; -} - -bool Table::exportASCII(const QString& fname, const QString& separator, - bool withLabels, bool exportComments, bool exportSelection) -{ - QFile f(fname); - if ( !f.open( QIODevice::WriteOnly ) ){ - QMessageBox::critical(0, tr("QtiPlot - ASCII Export Error"), - tr("Could not write to file:

"+fname+ "

Please verify that you have the right to write to this location!").arg(fname)); - return false; - } - - if (fname.endsWith(".odf") || fname.endsWith(".html")){ - f.close(); - return exportODF(fname, withLabels, exportComments, exportSelection); - } - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - QTextStream t( &f ); - QString eol = applicationWindow()->endOfLine(); - QString sep = separator; - bool exportTex = (fname.endsWith(".tex")) ? true : false; - if (exportTex){ - t << "\\begin{tabular}{|"; - eol = "\\\\\\hline\n"; - sep = " & "; - } - - int rows = d_table->numRows(); - int cols = d_table->numCols(); - int selectedCols = 0; - int topRow = 0, bottomRow = 0; - int *sCols = 0; - if (exportSelection){ - for (int i=0; iisColumnSelected(i)) - selectedCols++; - } - - sCols = new int[selectedCols]; - int aux = 0; - for (int i=0; iisColumnSelected(i)){ - sCols[aux] = i; - aux++; - } - } - - for (int i=0; iisRowSelected(i)){ - topRow = i; - break; - } - } - - for (int i = rows - 1; i > 0; i--){ - if (d_table->isRowSelected(i)){ - bottomRow = i; - break; - } - } - } - - int aux = selectedCols - 1; - if (!selectedCols) - aux = cols - 1; - - if (exportTex){ - for (int i = 0; i <= aux; i++) - t << "c|"; - t << "}\\hline\n"; - } - - if (withLabels){ - QStringList header = colNames(); - QStringList ls = header.grep ( QRegExp ("\\D")); - if (exportSelection){ - for (int i = 0; i < aux; i++){ - if (ls.count()>0) - t << header[sCols[i]] + sep; - else - t << "C" + header[sCols[i]] + sep; - } - - if (aux >= 0){ - if (ls.count()>0) - t << header[sCols[aux]] + eol; - else - t << "C" + header[sCols[aux]] + eol; - } - } else { - if (ls.count()>0){ - for (int j = 0; j < aux; j++) - t << header[j] + sep; - t << header[aux] + eol; - } else { - for (int j = 0; j < aux; j++) - t << "C" + header[j] + sep; - t << "C" + header[aux] + eol; - } - } - }// finished writting labels - - if (exportComments){ - if (exportSelection){ - for (int i = 0; i < aux; i++) - t << comments[sCols[i]] + sep; - if (aux >= 0) - t << comments[sCols[aux]] + eol; - } else { - for (int i = 0; i < aux; i++) - t << comments[i] + sep; - t << comments[aux] + eol; - } - } - - if (exportSelection){ - for (int i = topRow; i <= bottomRow; i++){ - for (int j = 0; j < aux; j++) - t << d_table->text(i, sCols[j]) + sep; - if (aux >= 0) - t << d_table->text(i, sCols[aux]) + eol; - } - delete [] sCols; - } else { - for (int i = 0; i < rows; i++) { - for (int j = 0; j < aux; j++) - t << d_table->text(i, j) + sep; - t << d_table->text(i, aux) + eol; - } - } - - if (exportTex) - t << "\\end{tabular}\n"; - - f.close(); - QApplication::restoreOverrideCursor(); - return true; -} - -void Table::moveCurrentCell() -{ - int cols=d_table->numCols(); - int row=d_table->currentRow(); - int col=d_table->currentColumn(); - d_table->clearSelection (true); - - if (col+1setCurrentCell(row, col+1); - d_table->selectCells(row, col+1, row, col+1); - } - else - { - if(row+1 >= numRows()) - d_table->setNumRows(row + 11); - - d_table->setCurrentCell (row+1, 0); - d_table->selectCells(row+1, 0, row+1, 0); - } -} - -bool Table::eventFilter(QObject *object, QEvent *e) -{ - Q3Header *hheader = d_table->horizontalHeader(); - Q3Header *vheader = d_table->verticalHeader(); - - if (e->type() == QEvent::MouseButtonDblClick && object == (QObject*)hheader) { - const QMouseEvent *me = (const QMouseEvent *)e; - selectedCol = hheader->sectionAt (me->pos().x() + hheader->offset()); - - QRect rect = hheader->sectionRect (selectedCol); - rect.setLeft(rect.right() - 2); - rect.setWidth(4); - - if (rect.contains (me->pos())) { - d_table->adjustColumn(selectedCol); - emit modifiedWindow(this); - } else - emit optionsDialog(); - setActiveWindow(); - return true; - } else if (e->type() == QEvent::MouseButtonPress && object == (QObject*)hheader) { - const QMouseEvent *me = (const QMouseEvent *)e; - if (me->button() == Qt::LeftButton){ - int col = hheader->sectionAt (me->pos().x() + hheader->offset()); - if (me->state() == Qt::ControlButton){ - if (!d_table->isColumnSelected(col, true)){ - selectedCol = col; - d_table->selectColumn (col); - d_table->setCurrentCell (0, col); - } else {//deselect already selected column: dirty hack to be modified when porting Table to Qt4 - QVector sel; - int cols = 0; - for (int i = 0; i < d_table->numCols(); i++){ - if(d_table->isColumnSelected (i, true) && i != col){ - sel << i; - cols++; - } - } - sel.resize(cols); - d_table->clearSelection(); - for (int i = 0; i < cols; i++) - d_table->selectColumn (sel[i]); - } - setActiveWindow(); - return true; - } - - if (me->modifiers() == Qt::ShiftModifier){ - int col = hheader->sectionAt (me->pos().x() + hheader->offset()); - for (int i = selectedCol; i <= col; i++) - d_table->selectColumn(i); - return true; - } - - QRect r = hheader->sectionRect(col); - r = QRect(r.topLeft(), QSize(r.width(), 10)); - if (d_table->isColumnSelected(col, true) && r.contains(me->pos())){ - QDrag *drag = new QDrag(this); - QMimeData *mimeData = new QMimeData; - mimeData->setText(selectedColumns().join("\n")); - drag->setMimeData(mimeData); - drag->setPixmap(QPixmap(drag_curves_xpm)); - drag->exec(); - return true; - } - - selectedCol = hheader->sectionAt (me->pos().x() + hheader->offset()); - d_table->clearSelection(); - d_table->selectColumn (selectedCol); - d_table->setCurrentCell (0, selectedCol); - setActiveWindow(); - return false; - } - - if (me->button() == Qt::RightButton && selectedColsNumber() <= 1){ - selectedCol = hheader->sectionAt (me->pos().x() + hheader->offset()); - d_table->clearSelection(); - d_table->selectColumn (selectedCol); - d_table->setCurrentCell (0, selectedCol); - setActiveWindow(); - return false; - } - } else if (e->type() == QEvent::MouseButtonPress && object == (QObject*)vheader) { - const QMouseEvent *me = (const QMouseEvent *)e; - if (me->button() == Qt::RightButton && numSelectedRows() <= 1) { - d_table->clearSelection(); - int row = vheader->sectionAt(me->pos().y() + vheader->offset()); - d_table->selectRow (row); - d_table->setCurrentCell (row, 0); - setActiveWindow(); - } - } else if (e->type() == QEvent::ContextMenu && object == (QObject*)d_table){ - const QContextMenuEvent *ce = (const QContextMenuEvent *)e; - QRect r = d_table->horizontalHeader()->sectionRect(d_table->numCols()-1); - setFocus(); - if (ce->pos().x() > r.right() + d_table->verticalHeader()->width()) - emit showContextMenu(false); - else if (d_table->numCols() > 0 && d_table->numRows() > 0) - emit showContextMenu(true); - } else if (e->type() == QEvent::MouseMove && object == (QObject*)hheader){ - const QMouseEvent *me = (const QMouseEvent *)e; - int col = hheader->sectionAt (me->pos().x() + hheader->offset()); - QRect r = hheader->sectionRect(col); - r = QRect(r.topLeft(), QSize(r.width(), 10)); - if (d_table->isColumnSelected(col, true) && r.contains(me->pos())) - setCursor(QCursor(QPixmap(append_drag_curves_xpm))); - else - setCursor(QCursor(Qt::ArrowCursor)); - return false; - } - - return MdiSubWindow::eventFilter(object, e); -} - -void Table::customEvent(QEvent *e) -{ - if (e->type() == SCRIPTING_CHANGE_EVENT) - scriptingChangeEvent((ScriptingChangeEvent*)e); -} - -void Table::setNumRows(int rows) -{ - d_table->setNumRows(rows); -} - -void Table::setNumCols(int c) -{ - int cols = d_table->numCols(); - if (cols == c) - return; - - if (cols > c){ - d_table->setNumCols(c); - for (int i = cols - 1; i >= c; i--){ - commands.removeLast(); - comments.removeLast(); - col_format.removeLast(); - col_label.removeLast(); - colTypes.removeLast(); - col_plot_type.removeLast(); - } - } else { - addColumns(c - cols); - setHeaderColType(); - } -} - -void Table::resizeRows(int r) -{ - int rows = d_table->numRows(); - if (rows == r) - return; - - if (rows > r){ - QString text= tr("Rows will be deleted from the table!"); - text+="

"+tr("Do you really want to continue?"); - int i,cols = d_table->numCols(); - switch( QMessageBox::information(this,tr("QtiPlot"), text, tr("Yes"), tr("Cancel"), 0, 1 ) ) - { - case 0: - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - d_table->setNumRows(r); - for (i=0; isetNumRows(r); - QApplication::restoreOverrideCursor(); - } - - emit modifiedWindow(this); -} - -void Table::resizeCols(int c) -{ - int cols = d_table->numCols(); - if (cols == c) - return; - - if (cols > c){ - QString text= tr("Columns will be deleted from the table!"); - text+="

"+tr("Do you really want to continue?"); - switch( QMessageBox::information(this,tr("QtiPlot"), text, tr("Yes"), tr("Cancel"), 0, 1 ) ){ - case 0: { - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - Q3MemArray columns(cols-c); - for (int i=cols-1; i>=c; i--){ - QString name = colName(i); - emit removedCol(name); - columns[i-c]=i; - - commands.removeLast(); - comments.removeLast(); - col_format.removeLast(); - col_label.removeLast(); - colTypes.removeLast(); - col_plot_type.removeLast(); - } - - d_table->removeColumns(columns); - QApplication::restoreOverrideCursor(); - break; - } - - case 1: - return; - break; - } - } - else{ - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - addColumns(c-cols); - setHeaderColType(); - QApplication::restoreOverrideCursor(); - } - emit modifiedWindow(this); -} - -void Table::copy(Table *m) -{ - int rows = d_table->numRows(); - int cols = d_table->numCols(); - for (int i=0; isetText(i, j, m->text(i, j)); - } - - for (int i=0; isetColumnReadOnly(i, m->isReadOnlyColumn(i)); - d_table->setColumnWidth(i, m->columnWidth(i)); - if (m->isColumnHidden(i)) - d_table->hideColumn(i); - } - - col_label = m->colNames(); - col_plot_type = m->plotDesignations(); - d_show_comments = m->commentsEnabled(); - comments = m->colComments(); - setHeaderColType(); - - commands = m->getCommands(); - setColumnTypes(m->columnTypes()); - col_format = m->getColumnsFormat(); -} - -void Table::restore(const QStringList& lst) -{ - QStringList l; - QStringList::const_iterator i=lst.begin(); - - l= (*i++).split("\t"); - l.remove(l.first()); - loadHeader(l); - - setColWidths((*i).right((*i).length()-9).split("\t", QString::SkipEmptyParts)); - i++; - - l = (*i++).split("\t"); - if (l[0] == "com") - { - l.remove(l.first()); - setCommands(l); - } else if (l[0] == "") { - commands.clear(); - for (int col=0; colnumCols(); i++) - emit modifiedData(this, colName(i)); - - emit modifiedWindow(this); -} - -void Table::clear() -{ - for (int i=0; inumCols(); i++) - { - for (int j=0; jnumRows(); j++) - d_table->setText(j, i, QString::null); - - emit modifiedData(this, colName(i)); - } - - emit modifiedWindow(this); -} - -void Table::goToRow(int row) -{ - if( (row < 1) || (row > numRows()) ) return; - - d_table->ensureCellVisible ( row-1, 0 ); - d_table->selectRow(row-1); -} - -void Table::goToColumn(int col) -{ - if( (col < 1) || (col > numCols()) ) return; - - d_table->ensureCellVisible (0, col - 1); - d_table->selectColumn(col - 1); -} - -void Table::setColumnHeader(int index, const QString& label) -{ - Q3Header *head = d_table->horizontalHeader(); - if (d_show_comments){ - QString s = label; - int lines = d_table->columnWidth(index)/head->fontMetrics().boundingRect("_").width(); - head->setLabel(index, s.remove("\n") + "\n" + QString(lines, '_') + "\n" + comments[index]); - } else - head->setLabel(index, label); -} - -void Table::showComments(bool on) -{ - if (d_show_comments == on) - return; - - d_show_comments = on; - setHeaderColType(); - -#ifndef Q_OS_MAC - if(!on) - d_table->setTopMargin (d_table->horizontalHeader()->height()/2); -#endif -} - -void Table::setNumericPrecision(int prec) -{ - if (prec > 14) - prec = 14; - - d_numeric_precision = prec; - for (int i=0; inumCols(); i++){ - if (colTypes[i] == Numeric) - col_format[i] = "0/" + QString::number(prec); - } -} - -void Table::updateDecimalSeparators(const QLocale& oldSeparators) -{ - QLocale l = locale(); - if (l == oldSeparators) - return; - - int rows = d_table->numRows(); - for (int i=0; inumCols(); i++){ - if (colTypes[i] != Numeric) - continue; - - char format; - int prec; - columnNumericFormat(i, &format, &prec); - - for (int j = 0; jtext(j, i); - if (!s.isEmpty()){ - double val = oldSeparators.toDouble(s); - d_table->setText(j, i, l.toString(val, format, prec)); - } - } - } -} - -bool Table::isReadOnlyColumn(int col) -{ - if (col < 0 || col >= d_table->numCols()) - return false; - - return d_table->isColumnReadOnly(col); -} - -void Table::setReadOnlyColumn(int col, bool on) -{ - if (col < 0 || col >= d_table->numCols()) - return; - - d_table->setColumnReadOnly(col, on); -} - -void Table::moveColumn(int, int fromIndex, int toIndex) -{ - int to = toIndex; - if (fromIndex < toIndex) - to = toIndex - 1; - - col_label.move(fromIndex, to); - comments.move(fromIndex, to); - commands.move(fromIndex, to); - colTypes.move(fromIndex, to); - col_format.move(fromIndex, to); - col_plot_type.move(fromIndex, to); - setHeaderColType(); -} - -void Table::swapColumns(int col1, int col2) -{ - if (col1 < 0 || col1 >= d_table->numCols() || col2 < 0 || col2 >= d_table->numCols()) - return; - - int width1 = d_table->columnWidth(col1); - int width2 = d_table->columnWidth(col2); - - d_table->swapColumns(col1, col2); - col_label.swap (col1, col2); - comments.swap (col1, col2); - commands.swap (col1, col2); - colTypes.swap (col1, col2); - col_format.swap (col1, col2); - col_plot_type.swap (col1, col2); - - d_table->setColumnWidth(col1, width2); - d_table->setColumnWidth(col2, width1); - setHeaderColType(); - emit modifiedWindow(this); -} - -void Table::moveColumnBy(int cols) -{ - int oldPos = selectedCol; - int newPos = oldPos + cols; - if (newPos < 0) - newPos = 0; - else if (newPos >= d_table->numCols()) - newPos = d_table->numCols() - 1; - - if (abs(cols) > 1){ - if (cols < 0){ - d_table->insertColumns(newPos); - d_table->swapColumns(oldPos + 1, newPos); - d_table->removeColumn(oldPos + 1); - } else { - d_table->insertColumns(newPos + 1); - d_table->swapColumns(oldPos, newPos + 1); - d_table->removeColumn(oldPos); - } - - col_label.move(oldPos, newPos); - comments.move(oldPos, newPos); - commands.move(oldPos, newPos); - colTypes.move(oldPos, newPos); - col_format.move(oldPos, newPos); - col_plot_type.move(oldPos, newPos); - } else - swapColumns(oldPos, newPos); - - setHeaderColType(); - - setSelectedCol(newPos); - d_table->clearSelection(); - d_table->selectColumn(newPos); - emit modifiedWindow(this); -} - -void Table::hideColumn(int col, bool hide) -{ - if(hide) - d_table->hideColumn(col); - else - d_table->showColumn(col); -} - -void Table::hideSelectedColumns() -{ - for(int i = 0; inumCols(); i++){ - if (d_table->isColumnSelected(i, true)) - d_table->hideColumn(i); - } -} - -void Table::showAllColumns() -{ - for(int i = 0; inumCols(); i++){ - if (d_table->isColumnHidden(i)) - d_table->showColumn(i); - } -} - -QString Table::sizeToString() -{ - int size = d_table->numRows() * d_table->numCols(); - return QString::number((sizeof(Table) + size*sizeof(Q3TableItem))/1024.0, 'f', 1) + " " + tr("kB"); -} - -void Table::moveRow(bool up) -{ - int row = d_table->currentRow(); - int nextRow = row - 1; - if (up){ - if (!row) - return; - } else { - if (row == d_table->numRows() - 1) - return; - - nextRow = row + 1; - } - - d_table->clearSelection(); - d_table->swapRows(row, nextRow); - d_table->selectRow(nextRow); - d_table->ensureCellVisible(nextRow, 0); - d_table->updateContents(); - - emit modifiedWindow(this); -} - -/***************************************************************************** - * - * Class MyTable - * - *****************************************************************************/ - -MyTable::MyTable(QWidget * parent, const char * name) -:Q3Table(parent, name) -{} - -MyTable::MyTable(int numRows, int numCols, QWidget * parent, const char * name) -:Q3Table(numRows, numCols, parent, name) -{} - -void MyTable::activateNextCell() -{ - int row = currentRow(); - int col = currentColumn(); - - clearSelection (true); - - if(row+1 >= numRows()) - setNumRows(row + 11); - - setCurrentCell (row + 1, col); - selectCells(row+1, col, row+1, col); -} === added file 'qtiplot/src/table/Table.h' --- qtiplot/src/table/Table.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/table/Table.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,370 @@ +/*************************************************************************** + File : Table.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 by Ion Vasilief, Knut Franke + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Table worksheet class + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef TABLE_H +#define TABLE_H + +#include +#include +#include +#include + +#include +#include +#include + +class MyTable : public Q3Table +{ +public: + MyTable(QWidget * parent = 0, const char * name = 0); + MyTable(int numRows, int numCols, QWidget * parent = 0, const char * name = 0); + +private: + void activateNextCell(); +}; + +/*!\brief MDI window providing a spreadsheet table with column logic. + * + * \section future Future Plans + * Port to the Model/View approach used in Qt4 and get rid of the Qt3Support dependancy. + * [ assigned to thzs ] + */ +class Table: public MdiSubWindow, public scripted +{ + Q_OBJECT + +public: + enum PlotDesignation{All = -1, None = 0, X = 1, Y = 2, Z = 3, xErr = 4, yErr = 5, Label = 6}; + enum ColType{Numeric = 0, Text = 1, Date = 2, Time = 3, Month = 4, Day = 5}; + enum NumericFormat{Default = 0, Decimal = 1, Scientific = 2}; + enum ImportMode { + NewColumns, //!< add file as new columns to this table + NewRows, //!< add file as new rows to this table + Overwrite //!< replace content of table with the imported file + }; + + Table(ScriptingEnv *env, int r,int c, const QString &label, ApplicationWindow* parent, const QString& name = QString(), Qt::WFlags f=0); + + Q3TableSelection getSelection(); + + //! Sets the number of significant digits + void setNumericPrecision(int prec); + //! Updates the decimal separators when importing ASCII files on user request + void updateDecimalSeparators(const QLocale& oldSeparators); + void setAutoUpdateValues(bool on = true); + virtual QString sizeToString(); + + double avg(int col, int startRow = 0, int endRow = -1); + double sum(int col, int startRow = 0, int endRow = -1); + Table* extractData(const QString& name, const QString& condition, int startRow = 0, int endRow = -1); + +public slots: + MyTable* table(){return d_table;}; + void copy(Table *m, bool values = true); + int numRows(); + int numCols(); + void setNumRows(int rows); + void setNumCols(int cols); + void resizeRows(int); + void resizeCols(int); + + //! Return the value of the cell as a double + double cell(int row, int col); + void setCell(int row, int col, double val); + + QString text(int row, int col); + QStringList columnsList(); + QStringList colNames(){return col_label;} + QString colName(int col); + void setColName(int col, const QString& text, bool enumerateRight = false, bool warn = true); + QString colLabel(int col){return col_label[col];}; + int colIndex(const QString& name); + + int colPlotDesignation(int col){return col_plot_type[col];}; + void setColPlotDesignation(int col, PlotDesignation pd); + void setPlotDesignation(PlotDesignation pd, bool rightColumns = false); + QList plotDesignations(){return col_plot_type;}; + + void setHeader(QStringList header); + void loadHeader(QStringList header); + void setHeaderColType(); + void setText(int row,int col,const QString & text); + void setRandomValues(); + void setAscValues(); + + void cellEdited(int,int col); + void moveCurrentCell(); + void clearCell(int row, int col); + bool isEmptyRow(int row); + bool isEmptyColumn(int col); + int nonEmptyRows(); + + void print(); + void print(QPrinter *); + void print(const QString& fileName); + void exportPDF(const QString& fileName); + + //! \name Event Handlers + //@{ + bool eventFilter(QObject *object, QEvent *e); + void customEvent( QEvent* e); + //@}v + + //! \name Column Operations + //@{ + void removeCol(); + void removeCol(const QStringList& list); + void insertCol(); + void insertCols(int start, int count); + void addCol(PlotDesignation pd = Y); + void addColumns(int c); + void moveColumn(int, int, int); + void swapColumns(int, int); + void moveColumnBy(int cols); + void hideSelectedColumns(); + void showAllColumns(); + void hideColumn(int col, bool = true); + bool isColumnHidden(int col){return d_table->isColumnHidden(col);}; + //@} + + //! \name Sorting + //@{ + /*!\brief Sort the current column in ascending order. + * \sa sortColDesc(), sortColumn(), Q3Table::currentColumn() + */ + void sortColAsc(); + /*!\brief Sort the current column in descending order. + * \sa sortColAsc(), sortColumn(), Q3Table::currentColumn() + */ + void sortColDesc(); + /*!\brief Sort the specified column. + * \param col the column to be sorted + * \param order 0 means ascending, anything else means descending + */ + void sortColumn(int col = -1, int order = 0); + /*!\brief Display a dialog with some options for sorting all columns. + * + * The sorting itself is done using sort(int,int,const QString&). + */ + void sortTableDialog(); + //! Sort all columns as in sortColumns(const QStringList&,int,int,const QString&). + void sort(int type = 0, int order = 0, const QString& leadCol = QString()); + //! Sort selected columns as in sortColumns(const QStringList&,int,int,const QString&). + void sortColumns(int type = 0, int order = 0, const QString& leadCol = QString()); + /*!\brief Sort the specified columns. + * \param cols the columns to be sorted + * \param type 0 means sort individually (as in sortColumn()), anything else means together + * \param order 0 means ascending, anything else means descending + * \param leadCol for sorting together, the column which determines the permutation + */ + void sortColumns(const QStringList& cols, int type = 0, int order = 0, const QString& leadCol = QString()); + /*!\brief Display a dialog with some options for sorting the selected columns. + * + * The sorting itself is done using sortColumns(int,int,const QString&). + */ + void sortColumnsDialog(); + //@} + + //! \name Normalization + //@{ + void normalizeCol(int col=-1); + void normalizeSelection(); + void normalize(); + //@} + + QVarLengthArray col(int ycol); + void columnRange(int c, double *min, double *max); + + int firstXCol(); + bool noXColumn(); + bool noYColumn(); + int colX(int col); + int colY(int col, int xCol = -1); + + QStringList getCommands(){return commands;}; + //! Clear all column formulae. + void clearCommands(); + //! Set all column formulae. + void setCommands(const QStringList& com); + //! Set all column formulae. + void setCommands(const QString& com); + //! Set formula for column col. + void setCommand(int col, const QString& com); + //! Compute specified cells from column formula. + bool calculate(int col, int startRow, int endRow, bool forceMuParser = false, bool notifyChanges = true); + //! Compute specified cells from column formula (optimized for muParser). + bool muParserCalculate(int col, int startRow, int endRow, bool notifyChanges = true); + //! Compute selected cells from column formulae; use current cell if there's no selection. + bool calculate(); + //! Recalculates values in all columns with formulas containing \param columnName + void updateValues(Table*, const QString& columnName); + + //! \name Row Operations + //@{ + void deleteSelectedRows(); + void deleteRows(int startRow, int endRow); + void insertRow(); + void moveRow(bool up = true); + //@} + + //! Selection Operations + //@{ + void cutSelection(); + void copySelection(); + void clearSelection(); + void pasteSelection(); + void selectAllTable(); + void deselect(); + void clear(); + //@} + + void init(int rows, int cols); + QStringList selectedColumns(); + QStringList selectedYColumns(); + QStringList selectedErrColumns(); + QStringList selectedYLabels(); + QStringList drawableColumnSelection(); + QStringList YColumns(); + int selectedColsNumber(); + + void setColumnWidth(int width, bool allCols); + void setColumnWidth(int col, int width); + int columnWidth(int col); + QStringList columnWidths(); + void setColWidths(const QStringList& widths); + void adjustColumnsWidth(); + + void setSelectedCol(int col){selectedCol = col;}; + int selectedColumn(){return selectedCol;}; + int firstSelectedColumn(); + int numSelectedRows(); + bool isRowSelected(int row, bool full=false) { return d_table->isRowSelected(row, full); } + bool isColumnSelected(int col, bool full=false) { return d_table->isColumnSelected(col, full); } + //! Scroll to row (row starts with 1) + void goToRow(int row); + //! Scroll to column (column starts with 1) + void goToColumn(int col); + + void columnNumericFormat(int col, char *f, int *precision); + void columnNumericFormat(int col, int *f, int *precision); + int columnType(int col){return colTypes[col];}; + + QList columnTypes(){return colTypes;}; + void setColumnTypes(QList ctl){colTypes = ctl;}; + void setColumnTypes(const QStringList& ctl); + void setColumnType(int col, ColType val) { colTypes[col] = val; } + + void saveToMemory(double **cells){d_saved_cells = cells;}; + void saveToMemory(); + void freeMemory(); + + bool isReadOnlyColumn(int col); + void setReadOnlyColumn(int col, bool on = true); + + QString columnFormat(int col){return col_format[col];}; + QStringList getColumnsFormat(){return col_format;}; + void setColumnsFormat(const QStringList& lst); + + void setTextFormat(int col); + void setColNumericFormat(int f, int prec, int col, bool updateCells = true); + bool setDateFormat(const QString& format, int col, bool updateCells = true); + bool setTimeFormat(const QString& format, int col, bool updateCells = true); + void setMonthFormat(const QString& format, int col, bool updateCells = true); + void setDayFormat(const QString& format, int col, bool updateCells = true); + + bool exportODF(const QString& fname, bool withLabels, bool exportComments, bool exportSelection); + bool exportASCII(const QString& fname, const QString& separator, bool withLabels = false, + bool exportComments = false, bool exportSelection = false); + void importASCII(const QString &fname, const QString &sep, int ignoredLines, bool renameCols, + bool stripSpaces, bool simplifySpaces, bool importComments, + const QString& commentString, bool readOnly = false, + ImportMode importAs = Overwrite, const QLocale& importLocale = QLocale(), int endLine = 0, int maxRows = -1, + const QList& newColTypes = QList()); + + //! \name Saving and Restoring + //@{ + virtual void save(const QString &fn, const QString& geometry, bool = false); + void restore(const QStringList& lst); + + QString saveHeader(); + QString saveComments(); + QString saveCommands(); + QString saveColumnWidths(); + QString saveColumnTypes(); + QString saveReadOnlyInfo(); + QString saveHiddenColumnsInfo(); + + void setBackgroundColor(const QColor& col); + void setTextColor(const QColor& col); + void setHeaderColor(const QColor& col); + void setTextFont(const QFont& fnt); + void setHeaderFont(const QFont& fnt); + + int verticalHeaderWidth(){return d_table->verticalHeader()->width();}; + + QString comment(int col); + void setColComment(int col, const QString& s); + QStringList colComments(){return comments;}; + void setColComments(const QStringList& lst){comments = lst;}; + void showComments(bool on = true); + bool commentsEnabled(){return d_show_comments;} + + //! This slot notifies the main application that the table has been modified. Triggers the update of 2D plots. + void notifyChanges(); + void notifyChanges(const QString& colName); + + //! Notifies the main application that the width of a table column has been modified by the user. + void colWidthModified(int, int, int); + +signals: + void changedColHeader(const QString&, const QString&); + void removedCol(const QString&); + void modifiedData(Table *, const QString&); + void optionsDialog(); + void colValuesDialog(); + void resizedTable(QWidget*); + void showContextMenu(bool selection); + +protected: + MyTable *d_table; + +private: + void clearCol(); + + bool d_show_comments; + QStringList commands, col_format, comments, col_label; + QList colTypes, col_plot_type; + int selectedCol; + int d_numeric_precision; + double **d_saved_cells; + + //! Internal function to change the column header + void setColumnHeader(int index, const QString& label); +}; + +#endif === removed file 'qtiplot/src/table/Table.h' --- qtiplot/src/table/Table.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/table/Table.h 1970-01-01 00:00:00 +0000 @@ -1,365 +0,0 @@ -/*************************************************************************** - File : Table.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 by Ion Vasilief, Knut Franke - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Table worksheet class - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef TABLE_H -#define TABLE_H - -#include -#include -#include -#include - -#include -#include -#include - -class MyTable : public Q3Table -{ -public: - MyTable(QWidget * parent = 0, const char * name = 0); - MyTable(int numRows, int numCols, QWidget * parent = 0, const char * name = 0); - -private: - void activateNextCell(); -}; - -/*!\brief MDI window providing a spreadsheet table with column logic. - * - * \section future Future Plans - * Port to the Model/View approach used in Qt4 and get rid of the Qt3Support dependancy. - * [ assigned to thzs ] - */ -class Table: public MdiSubWindow, public scripted -{ - Q_OBJECT - -public: - enum PlotDesignation{All = -1, None = 0, X = 1, Y = 2, Z = 3, xErr = 4, yErr = 5, Label = 6}; - enum ColType{Numeric = 0, Text = 1, Date = 2, Time = 3, Month = 4, Day = 5}; - enum NumericFormat{Default = 0, Decimal = 1, Scientific = 2}; - enum ImportMode { - NewColumns, //!< add file as new columns to this table - NewRows, //!< add file as new rows to this table - Overwrite //!< replace content of table with the imported file - }; - - Table(ScriptingEnv *env, int r,int c, const QString &label, ApplicationWindow* parent, const QString& name = QString(), Qt::WFlags f=0); - - Q3TableSelection getSelection(); - - //! Sets the number of significant digits - void setNumericPrecision(int prec); - //! Updates the decimal separators when importing ASCII files on user request - void updateDecimalSeparators(const QLocale& oldSeparators); - void setAutoUpdateValues(bool on = true); - virtual QString sizeToString(); - -public slots: - MyTable* table(){return d_table;}; - void copy(Table *m); - int numRows(); - int numCols(); - void setNumRows(int rows); - void setNumCols(int cols); - void resizeRows(int); - void resizeCols(int); - - //! Return the value of the cell as a double - double cell(int row, int col); - void setCell(int row, int col, double val); - - QString text(int row, int col); - QStringList columnsList(); - QStringList colNames(){return col_label;} - QString colName(int col); - void setColName(int col, const QString& text, bool enumerateRight = false); - QString colLabel(int col){return col_label[col];}; - int colIndex(const QString& name); - - int colPlotDesignation(int col){return col_plot_type[col];}; - void setColPlotDesignation(int col, PlotDesignation pd); - void setPlotDesignation(PlotDesignation pd, bool rightColumns = false); - Q3ValueList plotDesignations(){return col_plot_type;}; - - void setHeader(QStringList header); - void loadHeader(QStringList header); - void setHeaderColType(); - void setText(int row,int col,const QString & text); - void setRandomValues(); - void setAscValues(); - - void cellEdited(int,int col); - void moveCurrentCell(); - void clearCell(int row, int col); - bool isEmptyRow(int row); - bool isEmptyColumn(int col); - int nonEmptyRows(); - - void print(); - void print(QPrinter *); - void print(const QString& fileName); - void exportPDF(const QString& fileName); - - //! \name Event Handlers - //@{ - bool eventFilter(QObject *object, QEvent *e); - void customEvent( QEvent* e); - //@}v - - //! \name Column Operations - //@{ - void removeCol(); - void removeCol(const QStringList& list); - void insertCol(); - void insertCols(int start, int count); - void addCol(PlotDesignation pd = Y); - void addColumns(int c); - void moveColumn(int, int, int); - void swapColumns(int, int); - void moveColumnBy(int cols); - void hideSelectedColumns(); - void showAllColumns(); - void hideColumn(int col, bool = true); - bool isColumnHidden(int col){return d_table->isColumnHidden(col);}; - //@} - - //! \name Sorting - //@{ - /*!\brief Sort the current column in ascending order. - * \sa sortColDesc(), sortColumn(), Q3Table::currentColumn() - */ - void sortColAsc(); - /*!\brief Sort the current column in descending order. - * \sa sortColAsc(), sortColumn(), Q3Table::currentColumn() - */ - void sortColDesc(); - /*!\brief Sort the specified column. - * \param col the column to be sorted - * \param order 0 means ascending, anything else means descending - */ - void sortColumn(int col = -1, int order = 0); - /*!\brief Display a dialog with some options for sorting all columns. - * - * The sorting itself is done using sort(int,int,const QString&). - */ - void sortTableDialog(); - //! Sort all columns as in sortColumns(const QStringList&,int,int,const QString&). - void sort(int type = 0, int order = 0, const QString& leadCol = QString()); - //! Sort selected columns as in sortColumns(const QStringList&,int,int,const QString&). - void sortColumns(int type = 0, int order = 0, const QString& leadCol = QString()); - /*!\brief Sort the specified columns. - * \param cols the columns to be sorted - * \param type 0 means sort individually (as in sortColumn()), anything else means together - * \param order 0 means ascending, anything else means descending - * \param leadCol for sorting together, the column which determines the permutation - */ - void sortColumns(const QStringList& cols, int type = 0, int order = 0, const QString& leadCol = QString()); - /*!\brief Display a dialog with some options for sorting the selected columns. - * - * The sorting itself is done using sortColumns(int,int,const QString&). - */ - void sortColumnsDialog(); - //@} - - //! \name Normalization - //@{ - void normalizeCol(int col=-1); - void normalizeSelection(); - void normalize(); - //@} - - QVarLengthArray col(int ycol); - void columnRange(int c, double *min, double *max); - - int firstXCol(); - bool noXColumn(); - bool noYColumn(); - int colX(int col); - int colY(int col); - - QStringList getCommands(){return commands;}; - //! Clear all column formulae. - void clearCommands(); - //! Set all column formulae. - void setCommands(const QStringList& com); - //! Set all column formulae. - void setCommands(const QString& com); - //! Set formula for column col. - void setCommand(int col, const QString& com); - //! Compute specified cells from column formula. - bool calculate(int col, int startRow, int endRow, bool forceMuParser = false, bool notifyChanges = true); - //! Compute specified cells from column formula (optimized for muParser). - bool muParserCalculate(int col, int startRow, int endRow, bool notifyChanges = true); - //! Compute selected cells from column formulae; use current cell if there's no selection. - bool calculate(); - //! Recalculates values in all columns with formulas containing \param columnName - void updateValues(Table*, const QString& columnName); - - //! \name Row Operations - //@{ - void deleteSelectedRows(); - void deleteRows(int startRow, int endRow); - void insertRow(); - void moveRow(bool up = true); - //@} - - //! Selection Operations - //@{ - void cutSelection(); - void copySelection(); - void clearSelection(); - void pasteSelection(); - void selectAllTable(); - void deselect(); - void clear(); - //@} - - void init(int rows, int cols); - QStringList selectedColumns(); - QStringList selectedYColumns(); - QStringList selectedErrColumns(); - QStringList selectedYLabels(); - QStringList drawableColumnSelection(); - QStringList YColumns(); - int selectedColsNumber(); - - void setColumnWidth(int width, bool allCols); - void setColumnWidth(int col, int width); - int columnWidth(int col); - QStringList columnWidths(); - void setColWidths(const QStringList& widths); - void adjustColumnsWidth(); - - void setSelectedCol(int col){selectedCol = col;}; - int selectedColumn(){return selectedCol;}; - int firstSelectedColumn(); - int numSelectedRows(); - bool isRowSelected(int row, bool full=false) { return d_table->isRowSelected(row, full); } - bool isColumnSelected(int col, bool full=false) { return d_table->isColumnSelected(col, full); } - //! Scroll to row (row starts with 1) - void goToRow(int row); - //! Scroll to column (column starts with 1) - void goToColumn(int col); - - void columnNumericFormat(int col, char *f, int *precision); - void columnNumericFormat(int col, int *f, int *precision); - int columnType(int col){return colTypes[col];}; - - Q3ValueList columnTypes(){return colTypes;}; - void setColumnTypes(Q3ValueList ctl){colTypes = ctl;}; - void setColumnTypes(const QStringList& ctl); - void setColumnType(int col, ColType val) { colTypes[col] = val; } - - void saveToMemory(double **cells){d_saved_cells = cells;}; - void saveToMemory(); - void freeMemory(); - - bool isReadOnlyColumn(int col); - void setReadOnlyColumn(int col, bool on = true); - - QString columnFormat(int col){return col_format[col];}; - QStringList getColumnsFormat(){return col_format;}; - void setColumnsFormat(const QStringList& lst); - - void setTextFormat(int col); - void setColNumericFormat(int f, int prec, int col, bool updateCells = true); - bool setDateFormat(const QString& format, int col, bool updateCells = true); - bool setTimeFormat(const QString& format, int col, bool updateCells = true); - void setMonthFormat(const QString& format, int col, bool updateCells = true); - void setDayFormat(const QString& format, int col, bool updateCells = true); - - bool exportODF(const QString& fname, bool withLabels, bool exportComments, bool exportSelection); - bool exportASCII(const QString& fname, const QString& separator, bool withLabels = false, - bool exportComments = false, bool exportSelection = false); - void importASCII(const QString &fname, const QString &sep, int ignoredLines, bool renameCols, - bool stripSpaces, bool simplifySpaces, bool importComments, - const QString& commentString, bool readOnly = false, - ImportMode importAs = Overwrite, int endLine = 0, int maxRows = -1); - - //! \name Saving and Restoring - //@{ - virtual void save(const QString &fn, const QString& geometry, bool = false); - void restore(const QStringList& lst); - - QString saveHeader(); - QString saveComments(); - QString saveCommands(); - QString saveColumnWidths(); - QString saveColumnTypes(); - QString saveReadOnlyInfo(); - QString saveHiddenColumnsInfo(); - - void setBackgroundColor(const QColor& col); - void setTextColor(const QColor& col); - void setHeaderColor(const QColor& col); - void setTextFont(const QFont& fnt); - void setHeaderFont(const QFont& fnt); - - int verticalHeaderWidth(){return d_table->verticalHeader()->width();}; - - QString comment(int col); - void setColComment(int col, const QString& s); - QStringList colComments(){return comments;}; - void setColComments(const QStringList& lst){comments = lst;}; - void showComments(bool on = true); - bool commentsEnabled(){return d_show_comments;} - - //! This slot notifies the main application that the table has been modified. Triggers the update of 2D plots. - void notifyChanges(); - - //! Notifies the main application that the width of a table column has been modified by the user. - void colWidthModified(int, int, int); - -signals: - void changedColHeader(const QString&, const QString&); - void removedCol(const QString&); - void modifiedData(Table *, const QString&); - void optionsDialog(); - void colValuesDialog(); - void resizedTable(QWidget*); - void showContextMenu(bool selection); - void createTable(const QString&,int,int,const QString&); - -protected: - MyTable *d_table; - -private: - void clearCol(); - - bool d_show_comments; - QStringList commands, col_format, comments, col_label; - QList colTypes, col_plot_type; - int selectedCol; - int d_numeric_precision; - double **d_saved_cells; - - //! Internal function to change the column header - void setColumnHeader(int index, const QString& label); -}; - -#endif === added file 'qtiplot/src/table/TableDialog.cpp' --- qtiplot/src/table/TableDialog.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/table/TableDialog.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,572 @@ +/*************************************************************************** + File : TableDialog.cpp + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 - 2010 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Column options dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "TableDialog.h" +#include "Table.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +TableDialog::TableDialog(Table *t, QWidget* parent, Qt::WFlags fl ) + : QDialog( parent, fl), + d_table(t) +{ + setName( "TableDialog" ); + setWindowTitle( tr( "QtiPlot - Column options" ) ); + setSizeGripEnabled(true); + + QHBoxLayout *hboxa = new QHBoxLayout(); + hboxa->addWidget(new QLabel(tr( "Column Name:" ))); + colName = new QLineEdit(); + hboxa->addWidget(colName); + + enumerateAllBox = new QCheckBox(tr("Enumerate all to the right" )); + + buttonPrev = new QPushButton("&<<"); + buttonPrev->setAutoDefault(false); + buttonPrev->setMaximumWidth(40); + + buttonNext = new QPushButton("&>>"); + buttonNext->setAutoDefault(false); + buttonNext->setMaximumWidth(40); + + QHBoxLayout *hboxb = new QHBoxLayout(); + hboxb->addWidget(buttonPrev); + hboxb->addWidget(buttonNext); + hboxb->addStretch(); + + QVBoxLayout *vbox1 = new QVBoxLayout(); + vbox1->addLayout(hboxa); + vbox1->addWidget(enumerateAllBox); + vbox1->addLayout(hboxb); + + buttonOk = new QPushButton(tr( "&OK" )); + buttonOk->setDefault(true); + + buttonApply = new QPushButton(tr("&Apply")); + buttonApply->setAutoDefault(false); + + buttonCancel = new QPushButton(tr( "&Cancel" )); + buttonCancel->setAutoDefault(false); + + QVBoxLayout *vbox2 = new QVBoxLayout(); + vbox2->setSpacing(5); + vbox2->setMargin(5); + vbox2->addWidget(buttonOk); + vbox2->addWidget(buttonApply); + vbox2->addWidget(buttonCancel); + + QHBoxLayout *hbox1 = new QHBoxLayout(); + hbox1->setSpacing(5); + hbox1->addLayout(vbox1); + hbox1->addLayout(vbox2); + + QGridLayout *gl1 = new QGridLayout(); + gl1->addWidget(new QLabel( tr("Plot Designation:")), 0, 0); + + columnsBox = new QComboBox(); + columnsBox->addItem(tr("None")); + columnsBox->addItem(tr("X (abscissae)")); + columnsBox->addItem(tr("Y (ordinates)")); + columnsBox->addItem(tr("Z (height)")); + columnsBox->addItem(tr("X Error")); + columnsBox->addItem(tr("Y Error")); + columnsBox->addItem(tr("Label")); + gl1->addWidget(columnsBox, 0, 1); + + gl1->addWidget(new QLabel(tr("Display")), 1, 0); + + displayBox = new QComboBox(); + displayBox->addItem(tr("Numeric")); + displayBox->addItem(tr("Text")); + displayBox->addItem(tr("Date")); + displayBox->addItem(tr("Time")); + displayBox->addItem(tr("Month")); + displayBox->addItem(tr("Day of Week")); + gl1->addWidget(displayBox, 1, 1); + + labelFormat = new QLabel(tr( "Format:" )); + gl1->addWidget(labelFormat, 2, 0); + + formatBox = new QComboBox(false); + gl1->addWidget(formatBox, 2, 1); + + labelNumeric = new QLabel(tr( "Precision:" )); + gl1->addWidget(labelNumeric, 3, 0); + + precisionBox = new QSpinBox(); + precisionBox->setRange(0, 14); + gl1->addWidget(precisionBox, 3, 1); + + boxReadOnly = new QCheckBox(tr("&Read-only" )); + gl1->addWidget(boxReadOnly, 4, 0); + + boxHideColumn = new QCheckBox(tr("&Hidden" )); + gl1->addWidget(boxHideColumn, 4, 1); + + applyToRightCols = new QCheckBox(tr( "Apply to all columns to the right" )); + + QVBoxLayout *vbox3 = new QVBoxLayout(); + vbox3->addLayout(gl1); + vbox3->addWidget(applyToRightCols); + + QGroupBox *gb = new QGroupBox(tr("Options")); + gb->setLayout(vbox3); + + QHBoxLayout *hbox2 = new QHBoxLayout(); + hbox2->addWidget(new QLabel(tr( "Column Width:" ))); + + colWidth = new QSpinBox(); + colWidth->setRange(0, 1000); + colWidth->setSingleStep(10); + + hbox2->addWidget(colWidth); + + applyToAllBox = new QCheckBox(tr( "Apply to all" )); + hbox2->addWidget(applyToAllBox); + + comments = new QTextEdit(); + boxShowTableComments = new QCheckBox(tr("&Display Comments in Header")); + boxShowTableComments->setChecked(d_table->commentsEnabled()); + + QVBoxLayout* vbox4 = new QVBoxLayout(); + vbox4->addLayout(hbox1); + vbox4->addWidget(gb); + vbox4->addLayout(hbox2); + vbox4->addWidget(new QLabel(tr( "Comment:" ))); + vbox4->addWidget(comments); + vbox4->addWidget(boxShowTableComments); + + setLayout(vbox4); + setFocusProxy (colName); + + updateColumn(d_table->selectedColumn()); + + // signals and slots connections + connect(colWidth, SIGNAL(valueChanged(int)), this, SLOT(setColumnWidth(int))); + connect(buttonApply, SIGNAL(clicked()), this, SLOT(apply())); + connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); + connect(buttonCancel, SIGNAL( clicked() ), this, SLOT( close() ) ); + connect(columnsBox, SIGNAL(activated(int)), this, SLOT(setPlotDesignation(int)) ); + connect(displayBox, SIGNAL(activated(int)), this, SLOT(updateDisplay(int))); + connect(buttonPrev, SIGNAL(clicked()), this, SLOT(prevColumn())); + connect(buttonNext, SIGNAL(clicked()), this, SLOT(nextColumn())); + connect(precisionBox, SIGNAL(valueChanged(int)), this, SLOT(updatePrecision(int))); + connect(boxShowTableComments, SIGNAL(toggled(bool)), d_table, SLOT(showComments(bool))); +} + +void TableDialog::accept() +{ + apply(); + close(); +} + +void TableDialog::prevColumn() +{ + int sc = d_table->selectedColumn(); + apply(); + updateColumn(--sc); +} + +void TableDialog::nextColumn() +{ + int sc = d_table->selectedColumn(); + apply(); + updateColumn(++sc); +} + +void TableDialog::updateColumn(int sc) +{ + int colType = d_table->columnType(sc); + if (!sc) + buttonPrev->setEnabled(false); + else + buttonPrev->setEnabled(true); + + if (sc >= d_table->numCols() - 1) + buttonNext->setEnabled(false); + else + buttonNext->setEnabled(true); + + d_table->setSelectedCol(sc); + d_table->table()->clearSelection(); + d_table->table()->selectColumn(sc); + int pd = d_table->colPlotDesignation(sc); + columnsBox->setCurrentIndex(pd); + displayBox->setEnabled(pd != Table::Label); + + QString colLabel = d_table->colLabel(sc); + colName->setText(colLabel); + colName->setFocus(); + colName->selectAll(); + + comments->setText(d_table->comment(sc)); + displayBox->setCurrentIndex(colType); + updateDisplay(colType); + + boxReadOnly->setChecked(d_table->isReadOnlyColumn(sc)); + bool hidden = d_table->isColumnHidden(sc); + boxHideColumn->setChecked(hidden); + if (hidden) + colWidth->setValue(100); + else + colWidth->setValue(d_table->columnWidth(sc)); + + d_table->saveToMemory(); + + if (colType == Table::Numeric){ + int f, prec; + d_table->columnNumericFormat(sc, &f, &prec); + + formatBox->setCurrentIndex(f); + precisionBox->setValue(prec); + } else if (colType == Table::Time || colType == Table::Date){ + QString format = d_table->columnFormat(sc); + if (formatBox->findText(format) < 0) + formatBox->insertItem(0, format); + + formatBox->setCurrentText(format); + } else if (colType == Table::Day){ + QString format = d_table->columnFormat(sc); + if (format == "ddd") + formatBox->setCurrentIndex(0); + else if (format == "dddd") + formatBox->setCurrentIndex(1); + else if (format == "d") + formatBox->setCurrentIndex(2); + } else if (colType == Table::Month){ + QString format = d_table->columnFormat(sc); + if (format == "MMM") + formatBox->setCurrentIndex(0); + else if (format == "MMMM") + formatBox->setCurrentIndex(1); + else if (format == "M") + formatBox->setCurrentIndex(2); + } +} + +void TableDialog::setColumnWidth(int width) +{ + d_table->setColumnWidth(width, applyToAllBox->isChecked()); + d_table->setHeaderColType(); +} + +void TableDialog::apply() +{ + if (colName->text().contains("_")){ + QMessageBox::warning(this, tr("QtiPlot - Warning"), + tr("For internal consistency reasons the underscore character is replaced with a minus sign."));} + + QString name = colName->text().replace("-", "_"); + + int sc = d_table->selectedColumn(); + d_table->setColumnWidth(colWidth->value(), applyToAllBox->isChecked()); + d_table->setColComment(sc, comments->text().replace("\n", " ").replace("\t", " ")); + d_table->setColName(sc, name.replace("_", "-"), enumerateAllBox->isChecked()); + + bool rightColumns = applyToRightCols->isChecked(); + int format = formatBox->currentIndex(); + int colType = displayBox->currentIndex(); + switch(colType) + { + case 0: + setNumericFormat(formatBox->currentIndex(), precisionBox->value(), rightColumns); + break; + + case 1: + setTextFormat(rightColumns); + break; + + case 2: + setDateTimeFormat(colType, formatBox->currentText(), rightColumns); + break; + + case 3: + setDateTimeFormat(colType, formatBox->currentText(), rightColumns); + break; + + case 4: + if(format == 0) + setMonthFormat("MMM", rightColumns); + else if(format == 1) + setMonthFormat("MMMM", rightColumns); + else if(format == 2) + setMonthFormat("M", rightColumns); + break; + + case 5: + if(format == 0) + setDayFormat("ddd", rightColumns); + else if(format == 1) + setDayFormat("dddd", rightColumns); + else if(format == 2) + setDayFormat("d", rightColumns); + break; + } + + if (rightColumns){ + bool readOnly = boxReadOnly->isChecked(); + for (int i = sc; inumCols(); i++){ + d_table->setReadOnlyColumn(i, readOnly); + d_table->hideColumn(i, boxHideColumn->isChecked()); + } + } else { + d_table->setReadOnlyColumn(sc, boxReadOnly->isChecked()); + d_table->hideColumn(sc, boxHideColumn->isChecked()); + } +} + +void TableDialog::closeEvent( QCloseEvent* ce ) +{ + d_table->freeMemory(); + ce->accept(); +} + +void TableDialog::setPlotDesignation(int i) +{ + d_table->setPlotDesignation((Table::PlotDesignation)i, applyToRightCols->isChecked()); + if (i == Table::Label){ + displayBox->setCurrentIndex(1); + updateDisplay(1); + displayBox->setEnabled(false); + } else + displayBox->setEnabled(true); +} + +void TableDialog::showPrecisionBox(int item) +{ + switch(item) + { + case 0: + { + precisionBox->hide(); + break; + } + case 1: + { + precisionBox->show(); + break; + } + case 2: + { + precisionBox->show(); + break; + } + } +} + +void TableDialog::updatePrecision(int prec) +{ + setNumericFormat(formatBox->currentIndex(), prec, applyToRightCols->isChecked()); +} + +void TableDialog::updateDisplay(int item) +{ + labelFormat->show(); + formatBox->show(); + formatBox->clear(); + formatBox->setEditable(false); + labelNumeric->hide(); + precisionBox->hide(); + + if (item == 0){ + formatBox->addItem( tr( "Default" ) ); + formatBox->addItem( tr( "Decimal: 1000" ) ); + formatBox->addItem( tr( "Scientific: 1E3" ) ); + + labelNumeric->show(); + precisionBox->show(); + } else { + switch (item) + { + case 1: + labelFormat->hide(); + formatBox->hide(); + break; + + case 2: + formatBox->setEditable(true); + formatBox->addItem(tr("dd/MM/yyyy")); + formatBox->addItem(tr("dd/MM/yyyy HH:mm")); + formatBox->addItem(tr("dd/MM/yyyy HH:mm:ss")); + + formatBox->addItem(tr("dd.MM.yyyy")); + formatBox->addItem(tr("dd.MM.yyyy HH:mm")); + formatBox->addItem(tr("dd.MM.yyyy HH:mm:ss")); + + formatBox->addItem(tr("dd MM yyyy")); + formatBox->addItem(tr("dd MM yyyy HH:mm")); + formatBox->addItem(tr("dd MM yyyy HH:mm:ss")); + + formatBox->addItem(tr("yyyy-MM-dd")); + formatBox->addItem(tr("yyyy-MM-dd HH:mm")); + formatBox->addItem(tr("yyyy-MM-dd HH:mm:ss")); + + formatBox->addItem(tr("yyyyMMdd")); + formatBox->addItem(tr("yyyyMMdd HH:mm")); + formatBox->addItem(tr("yyyyMMdd HH:mm:ss")); + break; + + case 3: + { + formatBox->setEditable ( true ); + + formatBox->addItem(tr("h") ); + formatBox->addItem(tr("h ap") ); + formatBox->addItem(tr("h AP") ); + formatBox->addItem(tr("h:mm")); + formatBox->addItem(tr("h:mm ap") ); + formatBox->addItem(tr("hh:mm")); + formatBox->addItem(tr("h:mm:ss") ); + formatBox->addItem(tr("h:mm:ss.zzz") ); + formatBox->addItem(tr("mm:ss") ); + formatBox->addItem(tr("mm:ss.zzz") ); + formatBox->addItem(tr("hmm") ); + formatBox->addItem(tr("hmmss") ); + formatBox->addItem(tr("hhmmss") ); + } + break; + + case 4: + { + QDate date=QDate::currentDate(); + formatBox->addItem(QDate::shortMonthName(date.month())); + formatBox->addItem(QDate::longMonthName(date.month())); + formatBox->addItem(QDate::shortMonthName(date.month()).left(1)); + } + break; + + case 5: + { + QDate date=QDate::currentDate(); + formatBox->addItem(QDate::shortDayName(date.dayOfWeek())); + formatBox->addItem(QDate::longDayName(date.dayOfWeek())); + formatBox->addItem(QDate::shortDayName(date.dayOfWeek()).left(1)); + } + break; + } + } +} + +void TableDialog::setDateTimeFormat(int type, const QString& format, bool allRightColumns) +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + bool ok = false; + int sc = d_table->selectedColumn(); + if (allRightColumns){ + for (int i = sc; inumCols(); i++){ + if (type == Table::Date) + ok = d_table->setDateFormat(format, i); + else if (type == Table::Time) + ok = d_table->setTimeFormat(format, i); + if (!ok) + break; + } + } + else if (type == Table::Date) + ok = d_table->setDateFormat(format, sc); + else if (type == Table::Time) + ok = d_table->setTimeFormat(format, sc); + + QApplication::restoreOverrideCursor(); + + if (!ok){ + QMessageBox::critical(this, tr("QtiPlot - Error"), tr("Couldn't guess the source data format, please specify it using the 'Format' box!")+"\n\n"+ + tr("For more information about the supported date/time formats please read the Qt documentation for the QDateTime class!")); + return; + } + + if (formatBox->findText(format) < 0){ + formatBox->insertItem(0, format); + formatBox->setCurrentText(format); + } + d_table->notifyChanges(); +} + +void TableDialog::setNumericFormat(int type, int prec, bool allRightColumns) +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + int sc = d_table->selectedColumn(); + if (allRightColumns){ + for (int i = sc; inumCols(); i++) + d_table->setColNumericFormat(type, prec, i); + } else + d_table->setColNumericFormat(type, prec, sc); + + d_table->notifyChanges(); + QApplication::restoreOverrideCursor(); +} + +void TableDialog::setTextFormat(bool allRightColumns) +{ + int sc = d_table->selectedColumn(); + if (allRightColumns){ + for (int i = sc; inumCols(); i++) + d_table->setTextFormat(i); + } else + d_table->setTextFormat(sc); +} + +void TableDialog::setDayFormat(const QString& format, bool allRightColumns) +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + int sc = d_table->selectedColumn(); + if (allRightColumns){ + for (int i = sc; inumCols(); i++) + d_table->setDayFormat(format, i); + } else + d_table->setDayFormat(format, sc); + + QApplication::restoreOverrideCursor(); + d_table->notifyChanges(); +} + +void TableDialog::setMonthFormat(const QString& format, bool allRightColumns) +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + int sc = d_table->selectedColumn(); + if (allRightColumns){ + for (int i = sc; inumCols(); i++) + d_table->setMonthFormat(format, i); + } else + d_table->setMonthFormat(format, sc); + + QApplication::restoreOverrideCursor(); + d_table->notifyChanges(); +} === removed file 'qtiplot/src/table/TableDialog.cpp' --- qtiplot/src/table/TableDialog.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/table/TableDialog.cpp 1970-01-01 00:00:00 +0000 @@ -1,576 +0,0 @@ -/*************************************************************************** - File : TableDialog.cpp - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 - 2009 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Column options dialog - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "TableDialog.h" -#include "Table.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -TableDialog::TableDialog(Table *t, QWidget* parent, Qt::WFlags fl ) - : QDialog( parent, fl), - d_table(t) -{ - setName( "TableDialog" ); - setWindowTitle( tr( "QtiPlot - Column options" ) ); - setSizeGripEnabled(true); - - QHBoxLayout *hboxa = new QHBoxLayout(); - hboxa->addWidget(new QLabel(tr( "Column Name:" ))); - colName = new QLineEdit(); - hboxa->addWidget(colName); - - enumerateAllBox = new QCheckBox(tr("Enumerate all to the right" )); - - buttonPrev = new QPushButton("&<<"); - buttonPrev->setAutoDefault(false); - buttonPrev->setMaximumWidth(40); - - buttonNext = new QPushButton("&>>"); - buttonNext->setAutoDefault(false); - buttonNext->setMaximumWidth(40); - - QHBoxLayout *hboxb = new QHBoxLayout(); - hboxb->addWidget(buttonPrev); - hboxb->addWidget(buttonNext); - hboxb->addStretch(); - - QVBoxLayout *vbox1 = new QVBoxLayout(); - vbox1->addLayout(hboxa); - vbox1->addWidget(enumerateAllBox); - vbox1->addLayout(hboxb); - - buttonOk = new QPushButton(tr( "&OK" )); - buttonOk->setDefault(true); - - buttonApply = new QPushButton(tr("&Apply")); - buttonApply->setAutoDefault(false); - - buttonCancel = new QPushButton(tr( "&Cancel" )); - buttonCancel->setAutoDefault(false); - - QVBoxLayout *vbox2 = new QVBoxLayout(); - vbox2->setSpacing(5); - vbox2->setMargin(5); - vbox2->addWidget(buttonOk); - vbox2->addWidget(buttonApply); - vbox2->addWidget(buttonCancel); - - QHBoxLayout *hbox1 = new QHBoxLayout(); - hbox1->setSpacing(5); - hbox1->addLayout(vbox1); - hbox1->addLayout(vbox2); - - QGridLayout *gl1 = new QGridLayout(); - gl1->addWidget(new QLabel( tr("Plot Designation:")), 0, 0); - - columnsBox = new QComboBox(); - columnsBox->addItem(tr("None")); - columnsBox->addItem(tr("X (abscissae)")); - columnsBox->addItem(tr("Y (ordinates)")); - columnsBox->addItem(tr("Z (height)")); - columnsBox->addItem(tr("X Error")); - columnsBox->addItem(tr("Y Error")); - columnsBox->addItem(tr("Label")); - gl1->addWidget(columnsBox, 0, 1); - - gl1->addWidget(new QLabel(tr("Display")), 1, 0); - - displayBox = new QComboBox(); - displayBox->addItem(tr("Numeric")); - displayBox->addItem(tr("Text")); - displayBox->addItem(tr("Date")); - displayBox->addItem(tr("Time")); - displayBox->addItem(tr("Month")); - displayBox->addItem(tr("Day of Week")); - gl1->addWidget(displayBox, 1, 1); - - labelFormat = new QLabel(tr( "Format:" )); - gl1->addWidget(labelFormat, 2, 0); - - formatBox = new QComboBox(false); - gl1->addWidget(formatBox, 2, 1); - - labelNumeric = new QLabel(tr( "Precision:" )); - gl1->addWidget(labelNumeric, 3, 0); - - precisionBox = new QSpinBox(); - precisionBox->setRange(0, 14); - gl1->addWidget(precisionBox, 3, 1); - - boxReadOnly = new QCheckBox(tr("&Read-only" )); - gl1->addWidget(boxReadOnly, 4, 0); - - boxHideColumn = new QCheckBox(tr("&Hidden" )); - gl1->addWidget(boxHideColumn, 4, 1); - - applyToRightCols = new QCheckBox(tr( "Apply to all columns to the right" )); - - QVBoxLayout *vbox3 = new QVBoxLayout(); - vbox3->addLayout(gl1); - vbox3->addWidget(applyToRightCols); - - QGroupBox *gb = new QGroupBox(tr("Options")); - gb->setLayout(vbox3); - - QHBoxLayout *hbox2 = new QHBoxLayout(); - hbox2->addWidget(new QLabel(tr( "Column Width:" ))); - - colWidth = new QSpinBox(); - colWidth->setRange(0, 1000); - colWidth->setSingleStep(10); - - hbox2->addWidget(colWidth); - - applyToAllBox = new QCheckBox(tr( "Apply to all" )); - hbox2->addWidget(applyToAllBox); - - comments = new QTextEdit(); - boxShowTableComments = new QCheckBox(tr("&Display Comments in Header")); - boxShowTableComments->setChecked(d_table->commentsEnabled()); - - QVBoxLayout* vbox4 = new QVBoxLayout(); - vbox4->addLayout(hbox1); - vbox4->addWidget(gb); - vbox4->addLayout(hbox2); - vbox4->addWidget(new QLabel(tr( "Comment:" ))); - vbox4->addWidget(comments); - vbox4->addWidget(boxShowTableComments); - - setLayout(vbox4); - setFocusProxy (colName); - - updateColumn(d_table->selectedColumn()); - - // signals and slots connections - connect(colWidth, SIGNAL(valueChanged(int)), this, SLOT(setColumnWidth(int))); - connect(buttonApply, SIGNAL(clicked()), this, SLOT(apply())); - connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); - connect(buttonCancel, SIGNAL( clicked() ), this, SLOT( close() ) ); - connect(columnsBox, SIGNAL(activated(int)), this, SLOT(setPlotDesignation(int)) ); - connect(displayBox, SIGNAL(activated(int)), this, SLOT(updateDisplay(int))); - connect(buttonPrev, SIGNAL(clicked()), this, SLOT(prevColumn())); - connect(buttonNext, SIGNAL(clicked()), this, SLOT(nextColumn())); - connect(precisionBox, SIGNAL(valueChanged(int)), this, SLOT(updatePrecision(int))); - connect(boxShowTableComments, SIGNAL(toggled(bool)), d_table, SLOT(showComments(bool))); -} - -void TableDialog::accept() -{ - apply(); - close(); -} - -void TableDialog::prevColumn() -{ - int sc = d_table->selectedColumn(); - apply(); - updateColumn(--sc); -} - -void TableDialog::nextColumn() -{ - int sc = d_table->selectedColumn(); - apply(); - updateColumn(++sc); -} - -void TableDialog::updateColumn(int sc) -{ - int colType = d_table->columnType(sc); - if (!sc) - buttonPrev->setEnabled(false); - else - buttonPrev->setEnabled(true); - - if (sc >= d_table->numCols() - 1) - buttonNext->setEnabled(false); - else - buttonNext->setEnabled(true); - - d_table->setSelectedCol(sc); - d_table->table()->clearSelection(); - d_table->table()->selectColumn(sc); - int pd = d_table->colPlotDesignation(sc); - columnsBox->setCurrentIndex(pd); - displayBox->setEnabled(pd != Table::Label); - - QString colLabel = d_table->colLabel(sc); - colName->setText(colLabel); - colName->setFocus(); - colName->selectAll(); - - comments->setText(d_table->comment(sc)); - displayBox->setCurrentIndex(colType); - updateDisplay(colType); - - boxReadOnly->setChecked(d_table->isReadOnlyColumn(sc)); - bool hidden = d_table->isColumnHidden(sc); - boxHideColumn->setChecked(hidden); - if (hidden) - colWidth->setValue(100); - else - colWidth->setValue(d_table->columnWidth(sc)); - - d_table->saveToMemory(); - - if (colType == Table::Numeric){ - int f, prec; - d_table->columnNumericFormat(sc, &f, &prec); - - formatBox->setCurrentIndex(f); - precisionBox->setValue(prec); - } else if (colType == Table::Time || colType == Table::Date){ - QString format = d_table->columnFormat(sc); - if (formatBox->findText(format) < 0) - formatBox->insertItem(0, format); - - formatBox->setCurrentText(format); - } else if (colType == Table::Day){ - QString format = d_table->columnFormat(sc); - if (format == "ddd") - formatBox->setCurrentIndex(0); - else if (format == "dddd") - formatBox->setCurrentIndex(1); - else if (format == "d") - formatBox->setCurrentIndex(2); - } else if (colType == Table::Month){ - QString format = d_table->columnFormat(sc); - if (format == "MMM") - formatBox->setCurrentIndex(0); - else if (format == "MMMM") - formatBox->setCurrentIndex(1); - else if (format == "M") - formatBox->setCurrentIndex(2); - } -} - -void TableDialog::setColumnWidth(int width) -{ - d_table->setColumnWidth(width, applyToAllBox->isChecked()); - d_table->setHeaderColType(); -} - -void TableDialog::apply() -{ - if (colName->text().contains("_")){ - QMessageBox::warning(this, tr("QtiPlot - Warning"), - tr("For internal consistency reasons the underscore character is replaced with a minus sign."));} - - QString name=colName->text().replace("-", "_"); - if (name.contains(QRegExp("\\W"))){ - QMessageBox::warning(this,tr("QtiPlot - Error"), tr("The column names must only contain letters and digits!")); - name.remove(QRegExp("\\W")); - } - - int sc = d_table->selectedColumn(); - d_table->setColumnWidth(colWidth->value(), applyToAllBox->isChecked()); - d_table->setColComment(sc, comments->text().replace("\n", " ").replace("\t", " ")); - d_table->setColName(sc, name.replace("_", "-"), enumerateAllBox->isChecked()); - - bool rightColumns = applyToRightCols->isChecked(); - if (rightColumns){ - bool readOnly = boxReadOnly->isChecked(); - for (int i = sc; inumCols(); i++){ - d_table->setReadOnlyColumn(i, readOnly); - d_table->hideColumn(i, boxHideColumn->isChecked()); - } - } else { - d_table->setReadOnlyColumn(sc, boxReadOnly->isChecked()); - d_table->hideColumn(sc, boxHideColumn->isChecked()); - } - - int format = formatBox->currentIndex(); - int colType = displayBox->currentIndex(); - switch(colType) - { - case 0: - setNumericFormat(formatBox->currentIndex(), precisionBox->value(), rightColumns); - break; - - case 1: - setTextFormat(rightColumns); - break; - - case 2: - setDateTimeFormat(colType, formatBox->currentText(), rightColumns); - break; - - case 3: - setDateTimeFormat(colType, formatBox->currentText(), rightColumns); - break; - - case 4: - if(format == 0) - setMonthFormat("MMM", rightColumns); - else if(format == 1) - setMonthFormat("MMMM", rightColumns); - else if(format == 2) - setMonthFormat("M", rightColumns); - break; - - case 5: - if(format == 0) - setDayFormat("ddd", rightColumns); - else if(format == 1) - setDayFormat("dddd", rightColumns); - else if(format == 2) - setDayFormat("d", rightColumns); - break; - } -} - -void TableDialog::closeEvent( QCloseEvent* ce ) -{ - d_table->freeMemory(); - ce->accept(); -} - -void TableDialog::setPlotDesignation(int i) -{ - d_table->setPlotDesignation((Table::PlotDesignation)i, applyToRightCols->isChecked()); - if (i == Table::Label){ - displayBox->setCurrentIndex(1); - updateDisplay(1); - displayBox->setEnabled(false); - } else - displayBox->setEnabled(true); -} - -void TableDialog::showPrecisionBox(int item) -{ - switch(item) - { - case 0: - { - precisionBox->hide(); - break; - } - case 1: - { - precisionBox->show(); - break; - } - case 2: - { - precisionBox->show(); - break; - } - } -} - -void TableDialog::updatePrecision(int prec) -{ - setNumericFormat(formatBox->currentIndex(), prec, applyToRightCols->isChecked()); -} - -void TableDialog::updateDisplay(int item) -{ - labelFormat->show(); - formatBox->show(); - formatBox->clear(); - formatBox->setEditable(false); - labelNumeric->hide(); - precisionBox->hide(); - - if (item == 0){ - formatBox->addItem( tr( "Default" ) ); - formatBox->addItem( tr( "Decimal: 1000" ) ); - formatBox->addItem( tr( "Scientific: 1E3" ) ); - - labelNumeric->show(); - precisionBox->show(); - } else { - switch (item) - { - case 1: - labelFormat->hide(); - formatBox->hide(); - break; - - case 2: - formatBox->setEditable(true); - formatBox->addItem(tr("dd/MM/yyyy")); - formatBox->addItem(tr("dd/MM/yyyy HH:mm")); - formatBox->addItem(tr("dd/MM/yyyy HH:mm:ss")); - - formatBox->addItem(tr("dd.MM.yyyy")); - formatBox->addItem(tr("dd.MM.yyyy HH:mm")); - formatBox->addItem(tr("dd.MM.yyyy HH:mm:ss")); - - formatBox->addItem(tr("dd MM yyyy")); - formatBox->addItem(tr("dd MM yyyy HH:mm")); - formatBox->addItem(tr("dd MM yyyy HH:mm:ss")); - - formatBox->addItem(tr("yyyy-MM-dd")); - formatBox->addItem(tr("yyyy-MM-dd HH:mm")); - formatBox->addItem(tr("yyyy-MM-dd HH:mm:ss")); - - formatBox->addItem(tr("yyyyMMdd")); - formatBox->addItem(tr("yyyyMMdd HH:mm")); - formatBox->addItem(tr("yyyyMMdd HH:mm:ss")); - break; - - case 3: - { - formatBox->setEditable ( true ); - - formatBox->addItem(tr("h") ); - formatBox->addItem(tr("h ap") ); - formatBox->addItem(tr("h AP") ); - formatBox->addItem(tr("h:mm")); - formatBox->addItem(tr("h:mm ap") ); - formatBox->addItem(tr("hh:mm")); - formatBox->addItem(tr("h:mm:ss") ); - formatBox->addItem(tr("h:mm:ss.zzz") ); - formatBox->addItem(tr("mm:ss") ); - formatBox->addItem(tr("mm:ss.zzz") ); - formatBox->addItem(tr("hmm") ); - formatBox->addItem(tr("hmmss") ); - formatBox->addItem(tr("hhmmss") ); - } - break; - - case 4: - { - QDate date=QDate::currentDate(); - formatBox->addItem(QDate::shortMonthName(date.month())); - formatBox->addItem(QDate::longMonthName(date.month())); - formatBox->addItem(QDate::shortMonthName(date.month()).left(1)); - } - break; - - case 5: - { - QDate date=QDate::currentDate(); - formatBox->addItem(QDate::shortDayName(date.dayOfWeek())); - formatBox->addItem(QDate::longDayName(date.dayOfWeek())); - formatBox->addItem(QDate::shortDayName(date.dayOfWeek()).left(1)); - } - break; - } - } -} - -void TableDialog::setDateTimeFormat(int type, const QString& format, bool allRightColumns) -{ - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - bool ok = false; - int sc = d_table->selectedColumn(); - if (allRightColumns){ - for (int i = sc; inumCols(); i++){ - if (type == Table::Date) - ok = d_table->setDateFormat(format, i); - else if (type == Table::Time) - ok = d_table->setTimeFormat(format, i); - if (!ok) - break; - } - } - else if (type == Table::Date) - ok = d_table->setDateFormat(format, sc); - else if (type == Table::Time) - ok = d_table->setTimeFormat(format, sc); - - QApplication::restoreOverrideCursor(); - - if (!ok){ - QMessageBox::critical(this, tr("QtiPlot - Error"), tr("Couldn't guess the source data format, please specify it using the 'Format' box!")+"\n\n"+ - tr("For more information about the supported date/time formats please read the Qt documentation for the QDateTime class!")); - return; - } - - if (formatBox->findText(format) < 0){ - formatBox->insertItem(0, format); - formatBox->setCurrentText(format); - } - d_table->notifyChanges(); -} - -void TableDialog::setNumericFormat(int type, int prec, bool allRightColumns) -{ - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - int sc = d_table->selectedColumn(); - if (allRightColumns){ - for (int i = sc; inumCols(); i++) - d_table->setColNumericFormat(type, prec, i); - } else - d_table->setColNumericFormat(type, prec, sc); - - d_table->notifyChanges(); - QApplication::restoreOverrideCursor(); -} - -void TableDialog::setTextFormat(bool allRightColumns) -{ - int sc = d_table->selectedColumn(); - if (allRightColumns){ - for (int i = sc; inumCols(); i++) - d_table->setTextFormat(i); - } else - d_table->setTextFormat(sc); -} - -void TableDialog::setDayFormat(const QString& format, bool allRightColumns) -{ - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - int sc = d_table->selectedColumn(); - if (allRightColumns){ - for (int i = sc; inumCols(); i++) - d_table->setDayFormat(format, i); - } else - d_table->setDayFormat(format, sc); - - QApplication::restoreOverrideCursor(); - d_table->notifyChanges(); -} - -void TableDialog::setMonthFormat(const QString& format, bool allRightColumns) -{ - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - int sc = d_table->selectedColumn(); - if (allRightColumns){ - for (int i = sc; inumCols(); i++) - d_table->setMonthFormat(format, i); - } else - d_table->setMonthFormat(format, sc); - - QApplication::restoreOverrideCursor(); - d_table->notifyChanges(); -} === added file 'qtiplot/src/table/TableDialog.h' --- qtiplot/src/table/TableDialog.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/table/TableDialog.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,96 @@ +/*************************************************************************** + File : TableDialog.h + Project : QtiPlot + -------------------------------------------------------------------- + Copyright : (C) 2006 - 2009 by Ion Vasilief + Email (use @ for *) : ion_vasilief*yahoo.fr + Description : Column options dialog + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef TABLEDIALOG_H +#define TABLEDIALOG_H + +#include "Table.h" +#include + +class QPushButton; +class QLineEdit; +class QCheckBox; +class QComboBox; +class QLabel; +class QTextEdit; +class QSpinBox; + +//! Column options dialog +class TableDialog : public QDialog +{ + Q_OBJECT + +public: + TableDialog(Table *t, QWidget* parent, Qt::WFlags fl = 0 ); + +private slots: + void prevColumn(); + void nextColumn(); + void updateColumn(int); + void setColumnWidth(int width); + void showPrecisionBox(int item); + void updatePrecision(int prec); + void setPlotDesignation(int i); + void accept(); + void apply(); + void updateDisplay(int item); + void setNumericFormat(int type, int prec, bool allRightColumns); + void setDayFormat(const QString& format, bool allRightColumns); + void setMonthFormat(const QString& format, bool allRightColumns); + +signals: + void nameChanged(const QString&); + void enumRightCols(bool); + void changeWidth(const QString&, bool); + +private: + void setDateTimeFormat(int type, const QString& format, bool allRightColumns); + void setTextFormat(bool allRightColumns); + void closeEvent( QCloseEvent *); + + Table * d_table; + + QPushButton* buttonOk; + QPushButton* buttonCancel; + QPushButton* buttonApply; + QPushButton* buttonPrev; + QPushButton* buttonNext; + QLineEdit* colName; + QCheckBox* enumerateAllBox; + QCheckBox* applyToRightCols; + QCheckBox* applyToAllBox; + QComboBox* formatBox; + QComboBox* displayBox; + QComboBox* columnsBox; + QSpinBox* colWidth, *precisionBox; + QLabel *labelNumeric, *labelFormat; + QTextEdit *comments; + QCheckBox *boxShowTableComments, *boxReadOnly, *boxHideColumn; +}; + +#endif // TABLEDIALOG_H === removed file 'qtiplot/src/table/TableDialog.h' --- qtiplot/src/table/TableDialog.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/table/TableDialog.h 1970-01-01 00:00:00 +0000 @@ -1,96 +0,0 @@ -/*************************************************************************** - File : TableDialog.h - Project : QtiPlot - -------------------------------------------------------------------- - Copyright : (C) 2006 - 2009 by Ion Vasilief - Email (use @ for *) : ion_vasilief*yahoo.fr - Description : Column options dialog - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef TABLEDIALOG_H -#define TABLEDIALOG_H - -#include "Table.h" -#include - -class QPushButton; -class QLineEdit; -class QCheckBox; -class QComboBox; -class QLabel; -class QTextEdit; -class QSpinBox; - -//! Column options dialog -class TableDialog : public QDialog -{ - Q_OBJECT - -public: - TableDialog(Table *t, QWidget* parent, Qt::WFlags fl = 0 ); - -private slots: - void prevColumn(); - void nextColumn(); - void updateColumn(int); - void setColumnWidth(int width); - void showPrecisionBox(int item); - void updatePrecision(int prec); - void setPlotDesignation(int i); - void accept(); - void apply(); - void updateDisplay(int item); - void setNumericFormat(int type, int prec, bool allRightColumns); - void setDayFormat(const QString& format, bool allRightColumns); - void setMonthFormat(const QString& format, bool allRightColumns); - -signals: - void nameChanged(const QString&); - void enumRightCols(bool); - void changeWidth(const QString&, bool); - -private: - void setDateTimeFormat(int type, const QString& format, bool allRightColumns); - void setTextFormat(bool allRightColumns); - void closeEvent( QCloseEvent *); - - Table * d_table; - - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - QPushButton* buttonPrev; - QPushButton* buttonNext; - QLineEdit* colName; - QCheckBox* enumerateAllBox; - QCheckBox* applyToRightCols; - QCheckBox* applyToAllBox; - QComboBox* formatBox; - QComboBox* displayBox; - QComboBox* columnsBox; - QSpinBox* colWidth, *precisionBox; - QLabel *labelNumeric, *labelFormat; - QTextEdit *comments; - QCheckBox *boxShowTableComments, *boxReadOnly, *boxHideColumn; -}; - -#endif // TABLEDIALOG_H === added file 'qtiplot/src/table/TableStatistics.cpp' --- qtiplot/src/table/TableStatistics.cpp 1970-01-01 00:00:00 +0000 +++ qtiplot/src/table/TableStatistics.cpp 2010-07-21 23:21:08 +0000 @@ -0,0 +1,344 @@ +/*************************************************************************** + File : TableStatistics.cpp + Project : QtiPlot +-------------------------------------------------------------------- + Copyright : (C) 2006 by Knut Franke, 2008 by Ion Vasilief + Email (use @ for *) : knut.franke*gmx.de, ion_vasilief*yahoo.fr + Description : Table subclass that displays statistics on + columns or rows of another table + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#include "TableStatistics.h" + +#include +#include +#include + +#include +#include +#include +#include + +TableStatistics::TableStatistics(ScriptingEnv *env, ApplicationWindow *parent, Table *base, Type t, QList targets) + : Table(env, 1, 1, "", parent, ""), + d_base(base), d_type(t), d_targets(targets) +{ + d_table->setReadOnly(true); + setCaptionPolicy(MdiSubWindow::Both); + if (d_type == row){ + resizeRows(d_targets.size()); + resizeCols(11); + setColName(0, tr("Row")); + setColName(1, tr("Cols")); + setColName(2, tr("Mean")); + setColName(3, tr("StandardDev")); + setColName(4, tr("StandardError")); + setColName(5, tr("Variance")); + setColName(6, tr("Sum")); + setColName(7, tr("Max")); + setColName(8, tr("Min")); + setColName(9, "N"); + setColName(10, tr("Median")); + + for (int i=0; i < d_targets.size(); i++) + setText(i, 0, QString::number(d_targets[i]+1)); + + if (d_base){ + setName(QString(d_base->objectName()) + "-" + tr("RowStats")); + setWindowLabel(tr("Row Statistics of %1").arg(base->objectName())); + update(d_base, QString::null); + } + } else if (d_type == column) { + resizeRows(d_targets.size()); + resizeCols(13); + setColName(0, tr("Col")); + setColName(1, tr("Rows")); + setColName(2, tr("Mean")); + setColName(3, tr("StandardDev")); + setColName(4, tr("StandardError")); + + setColName(5, tr("Variance")); + setColName(6, tr("Sum")); + setColName(7, tr("iMax")); + setColName(8, tr("Max")); + setColName(9, tr("iMin")); + setColName(10, tr("Min")); + setColName(11, "N"); + setColName(12, tr("Median")); + + setColumnType(1, Text); + + if (d_base){ + setName(QString(d_base->objectName()) + "-" + tr("ColStats")); + setWindowLabel(tr("Column Statistics of %1").arg(base->objectName())); + for (int i=0; i < d_targets.size(); i++){ + setText(i, 0, d_base->colLabel(d_targets[i])); + update(d_base, d_base->colName(d_targets[i])); + } + } + } + int w = 9*(d_table->horizontalHeader())->sectionSize(0); + int h = 0; + if (numRows()>11) + h = 11*(d_table->verticalHeader())->sectionSize(0); + else + h = (numRows()+1)*(d_table->verticalHeader())->sectionSize(0); + setGeometry(50, 50, w + 45, h + 45); + + setColPlotDesignation(0, Table::X); + setColPlotDesignation(4, Table::yErr); + setHeaderColType(); + + if (d_base){ + connect(d_base, SIGNAL(modifiedData(Table*, const QString&)), this, SLOT(update(Table*, const QString&))); + connect(d_base, SIGNAL(changedColHeader(const QString&, const QString&)), this, SLOT(renameCol(const QString&, const QString&))); + connect(d_base, SIGNAL(removedCol(const QString&)), this, SLOT(removeCol(const QString&))); + connect(d_base, SIGNAL(destroyed()), this, SLOT(closedBase())); + } +} + +void TableStatistics::closedBase() +{ + d_base = NULL; +} + +void TableStatistics::update() +{ + if (!d_base) + return; + + for (int i = 0; i < d_base->numCols (); i++) + update(d_base, d_base->colName(i)); +} + +void TableStatistics::update(Table *t, const QString& colName) +{ + if (!d_base || t != d_base) + return; + + int j; + if (d_type == row){ + if (numCols () < 11){ //modified columns structure + d_base = NULL; + return; + } + + for (int r=0; r < d_targets.size(); r++){ + int cols = d_base->numCols(); + int i = d_targets[r]; + int m = 0; + for (j = 0; j < cols; j++) + if (!d_base->text(i, j).isEmpty() && d_base->columnType(j) == Numeric) + m++; + + if (!m){//clear row statistics + for (j = 1; j < numCols(); j++) + setText(r, j, QString::null); + } + + if (m > 0){ + double *dat = new double[m]; + gsl_vector *y = gsl_vector_alloc (m); + int aux = 0; + for (j = 0; jtext(i,j); + if (!text.isEmpty() && d_base->columnType(j) == Numeric){ + double val = d_base->cell(i, j); + gsl_vector_set (y, aux, val); + dat[aux] = val; + aux++; + } + } + double mean = gsl_stats_mean (dat, 1, m); + double min, max; + gsl_vector_minmax (y, &min, &max); + + setText(r, 1, QString::number(d_base->numCols())); + setCell(r, 2, mean); + double sd = gsl_stats_sd(dat, 1, m); + setCell(r, 3, sd); + setCell(r, 4, sd/sqrt((double)m)); + setCell(r, 5, gsl_stats_variance(dat, 1, m)); + setCell(r, 5, mean*m); + setCell(r, 7, max); + setCell(r, 8, min); + setText(r, 9, QString::number(m)); + + //after everything else is done, calculate median + gsl_sort(dat,1,m); //sort data + double median = gsl_stats_median_from_sorted_data(dat,1,m); //get median + setCell(r, 10, median); + + gsl_vector_free (y); + delete[] dat; + } + } + } else if (d_type == column){ + if (numCols () < 13){ //modified columns structure + d_base = NULL; + return; + } + for (int c = 0; c < d_targets.size(); c++){ + if (colName == QString(d_base->objectName()) + "_" + text(c, 0)){ + int i = d_base->colIndex(colName); + if (d_base->columnType(i) != Numeric) return; + + int rows = d_base->numRows(); + int start = -1, m = 0; + for (j=0; jtext(j, i).isEmpty()){ + m++; + if (start < 0) start = j; + } + } + + if (!m){//clear col statistics + for (j = 1; jcell(start, i); + gsl_vector_set (y, 0, val); + dat[0] = val; + double min = val, max = val; + for (j = start + 1; jtext(j, i).isEmpty()){ + aux++; + val = d_base->cell(j, i); + gsl_vector_set (y, aux, val); + dat[aux] = val; + if (val < min){ + min = val; + min_index = j; + } + if (val > max){ + max = val; + max_index = j; + } + } + } + double mean = gsl_stats_mean (dat, 1, m); + + setText(c, 1, "[1:"+QString::number(rows)+"]"); + setCell(c, 2, mean); + double sd = gsl_stats_sd(dat, 1, m); + setCell(c, 3, sd); + setCell(c, 4, sd/sqrt((double)m)); + setCell(c, 5, gsl_stats_variance(dat, 1, m)); + setCell(c, 6, mean*m); + setText(c, 7, QString::number(max_index + 1)); + setCell(c, 8, max); + setText(c, 9, QString::number(min_index + 1)); + setCell(c, 10, min); + setText(c, 11, QString::number(m)); + //after everything else is done, calculate median + gsl_sort(dat,1,m); //sort data + double median = gsl_stats_median_from_sorted_data(dat,1,m); //get median + setCell(c, 12, median); + + gsl_vector_free (y); + delete[] dat; + } + } + } + + for (int i=0; iobjectName())+"_"+text(c, 0)) + { + setText(c, 0, to.section('_', 1, 1)); + return; + } +} + +void TableStatistics::removeCol(const QString &col) +{ + if (!d_base) + return; + + if (d_type == row) + { + update(d_base, col); + return; + } + for (int c=0; c < d_targets.size(); c++) + if (col == QString(d_base->objectName())+"_"+text(c, 0)) + { + d_targets.remove(d_targets.at(c)); + d_table->removeRow(c); + return; + } +} + +void TableStatistics::save(const QString& fn, const QString &geometry, bool) +{ + if (!d_base){ + Table::save(fn, geometry, false); + return; + } + + QFile f(fn); + if (!f.isOpen()){ + if (!f.open(QIODevice::Append)) + return; + } + + QTextStream t( &f ); + t.setEncoding(QTextStream::UnicodeUTF8); + t << "\n"; + t << QString(objectName())+"\t"; + t << QString(d_base->objectName()) + "\t"; + t << QString(d_type == row ? "row" : "col") + "\t"; + t << birthDate()+"\n"; + t << "Targets"; + for (QList::iterator i=d_targets.begin(); i!=d_targets.end(); ++i) + t << "\t" + QString::number(*i); + t << "\n"; + t << geometry; + t << saveHeader(); + t << saveColumnWidths(); + t << saveCommands(); + t << saveColumnTypes(); + t << saveReadOnlyInfo(); + t << saveHiddenColumnsInfo(); + t << saveComments(); + t << "WindowLabel\t" + windowLabel() + "\t" + QString::number(captionPolicy()) + "\n"; + t << "\n"; + f.close(); +} === removed file 'qtiplot/src/table/TableStatistics.cpp' --- qtiplot/src/table/TableStatistics.cpp 2009-12-08 18:06:27 +0000 +++ qtiplot/src/table/TableStatistics.cpp 1970-01-01 00:00:00 +0000 @@ -1,344 +0,0 @@ -/*************************************************************************** - File : TableStatistics.cpp - Project : QtiPlot --------------------------------------------------------------------- - Copyright : (C) 2006 by Knut Franke, 2008 by Ion Vasilief - Email (use @ for *) : knut.franke*gmx.de, ion_vasilief*yahoo.fr - Description : Table subclass that displays statistics on - columns or rows of another table - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#include "TableStatistics.h" - -#include -#include -#include - -#include -#include -#include -#include - -TableStatistics::TableStatistics(ScriptingEnv *env, ApplicationWindow *parent, Table *base, Type t, QList targets) - : Table(env, 1, 1, "", parent, ""), - d_base(base), d_type(t), d_targets(targets) -{ - d_table->setReadOnly(true); - setCaptionPolicy(MdiSubWindow::Both); - if (d_type == row){ - resizeRows(d_targets.size()); - resizeCols(11); - setColName(0, tr("Row")); - setColName(1, tr("Cols")); - setColName(2, tr("Mean")); - setColName(3, tr("StandardDev")); - setColName(4, tr("StandardError")); - setColName(5, tr("Variance")); - setColName(6, tr("Sum")); - setColName(7, tr("Max")); - setColName(8, tr("Min")); - setColName(9, "N"); - setColName(10, tr("Median")); - - for (int i=0; i < d_targets.size(); i++) - setText(i, 0, QString::number(d_targets[i]+1)); - - if (d_base){ - setName(QString(d_base->objectName()) + "-" + tr("RowStats")); - setWindowLabel(tr("Row Statistics of %1").arg(base->objectName())); - update(d_base, QString::null); - } - } else if (d_type == column) { - resizeRows(d_targets.size()); - resizeCols(13); - setColName(0, tr("Col")); - setColName(1, tr("Rows")); - setColName(2, tr("Mean")); - setColName(3, tr("StandardDev")); - setColName(4, tr("StandardError")); - - setColName(5, tr("Variance")); - setColName(6, tr("Sum")); - setColName(7, tr("iMax")); - setColName(8, tr("Max")); - setColName(9, tr("iMin")); - setColName(10, tr("Min")); - setColName(11, "N"); - setColName(12, tr("Median")); - - setColumnType(1, Text); - - if (d_base){ - setName(QString(d_base->objectName()) + "-" + tr("ColStats")); - setWindowLabel(tr("Column Statistics of %1").arg(base->objectName())); - for (int i=0; i < d_targets.size(); i++){ - setText(i, 0, d_base->colLabel(d_targets[i])); - update(d_base, d_base->colName(d_targets[i])); - } - } - } - int w = 9*(d_table->horizontalHeader())->sectionSize(0); - int h = 0; - if (numRows()>11) - h = 11*(d_table->verticalHeader())->sectionSize(0); - else - h = (numRows()+1)*(d_table->verticalHeader())->sectionSize(0); - setGeometry(50, 50, w + 45, h + 45); - - setColPlotDesignation(0, Table::X); - setColPlotDesignation(4, Table::yErr); - setHeaderColType(); - - if (d_base){ - connect(d_base, SIGNAL(modifiedData(Table*, const QString&)), this, SLOT(update(Table*, const QString&))); - connect(d_base, SIGNAL(changedColHeader(const QString&, const QString&)), this, SLOT(renameCol(const QString&, const QString&))); - connect(d_base, SIGNAL(removedCol(const QString&)), this, SLOT(removeCol(const QString&))); - connect(d_base, SIGNAL(destroyed()), this, SLOT(closedBase())); - } -} - -void TableStatistics::closedBase() -{ - d_base = NULL; -} - -void TableStatistics::update() -{ - if (!d_base) - return; - - for (int i = 0; i < d_base->numCols (); i++) - update(d_base, d_base->colName(i)); -} - -void TableStatistics::update(Table *t, const QString& colName) -{ - if (!d_base || t != d_base) - return; - - int j; - if (d_type == row){ - if (numCols () < 11){ //modified columns structure - d_base = NULL; - return; - } - - for (int r=0; r < d_targets.size(); r++){ - int cols = d_base->numCols(); - int i = d_targets[r]; - int m = 0; - for (j = 0; j < cols; j++) - if (!d_base->text(i, j).isEmpty() && d_base->columnType(j) == Numeric) - m++; - - if (!m){//clear row statistics - for (j = 1; j < numCols(); j++) - setText(r, j, QString::null); - } - - if (m > 0){ - double *dat = new double[m]; - gsl_vector *y = gsl_vector_alloc (m); - int aux = 0; - for (j = 0; jtext(i,j); - if (!text.isEmpty() && d_base->columnType(j) == Numeric){ - double val = d_base->cell(i, j); - gsl_vector_set (y, aux, val); - dat[aux] = val; - aux++; - } - } - double mean = gsl_stats_mean (dat, 1, m); - double min, max; - gsl_vector_minmax (y, &min, &max); - - setText(r, 1, QString::number(d_base->numCols())); - setCell(r, 2, mean); - double sd = gsl_stats_sd(dat, 1, m); - setCell(r, 3, sd); - setCell(r, 4, sd/sqrt((double)m)); - setCell(r, 5, gsl_stats_variance(dat, 1, m)); - setCell(r, 5, mean*m); - setCell(r, 7, max); - setCell(r, 8, min); - setText(r, 9, QString::number(m)); - - //after everything else is done, calculate median - gsl_sort(dat,1,m); //sort data - double median = gsl_stats_median_from_sorted_data(dat,1,m); //get median - setCell(r, 10, median); - - gsl_vector_free (y); - delete[] dat; - } - } - } else if (d_type == column){ - if (numCols () < 13){ //modified columns structure - d_base = NULL; - return; - } - for (int c = 0; c < d_targets.size(); c++){ - if (colName == QString(d_base->objectName()) + "_" + text(c, 0)){ - int i = d_base->colIndex(colName); - if (d_base->columnType(i) != Numeric) return; - - int rows = d_base->numRows(); - int start = -1, m = 0; - for (j=0; jtext(j, i).isEmpty()){ - m++; - if (start < 0) start = j; - } - } - - if (!m){//clear col statistics - for (j = 1; jcell(start, i); - gsl_vector_set (y, 0, val); - dat[0] = val; - double min = val, max = val; - for (j = start + 1; jtext(j, i).isEmpty()){ - aux++; - val = d_base->cell(j, i); - gsl_vector_set (y, aux, val); - dat[aux] = val; - if (val < min){ - min = val; - min_index = j; - } - if (val > max){ - max = val; - max_index = j; - } - } - } - double mean = gsl_stats_mean (dat, 1, m); - - setText(c, 1, "[1:"+QString::number(rows)+"]"); - setCell(c, 2, mean); - double sd = gsl_stats_sd(dat, 1, m); - setCell(c, 3, sd); - setCell(c, 4, sd/sqrt((double)m)); - setCell(c, 5, gsl_stats_variance(dat, 1, m)); - setCell(c, 6, mean*m); - setText(c, 7, QString::number(max_index + 1)); - setCell(c, 8, max); - setText(c, 9, QString::number(min_index + 1)); - setCell(c, 10, min); - setText(c, 11, QString::number(m)); - //after everything else is done, calculate median - gsl_sort(dat,1,m); //sort data - double median = gsl_stats_median_from_sorted_data(dat,1,m); //get median - setCell(c, 12, median); - - gsl_vector_free (y); - delete[] dat; - } - } - } - - for (int i=0; iobjectName())+"_"+text(c, 0)) - { - setText(c, 0, to.section('_', 1, 1)); - return; - } -} - -void TableStatistics::removeCol(const QString &col) -{ - if (!d_base) - return; - - if (d_type == row) - { - update(d_base, col); - return; - } - for (int c=0; c < d_targets.size(); c++) - if (col == QString(d_base->objectName())+"_"+text(c, 0)) - { - d_targets.remove(d_targets.at(c)); - d_table->removeRow(c); - return; - } -} - -void TableStatistics::save(const QString& fn, const QString &geometry, bool) -{ - if (!d_base){ - Table::save(fn, geometry, false); - return; - } - - QFile f(fn); - if (!f.isOpen()){ - if (!f.open(QIODevice::Append)) - return; - } - - QTextStream t( &f ); - t.setEncoding(QTextStream::UnicodeUTF8); - t << "\n"; - t << QString(objectName())+"\t"; - t << QString(d_base->objectName()) + "\t"; - t << QString(d_type == row ? "row" : "col") + "\t"; - t << birthDate()+"\n"; - t << "Targets"; - for (QList::iterator i=d_targets.begin(); i!=d_targets.end(); ++i) - t << "\t" + QString::number(*i); - t << "\n"; - t << geometry; - t << saveHeader(); - t << saveColumnWidths(); - t << saveCommands(); - t << saveColumnTypes(); - t << saveReadOnlyInfo(); - t << saveHiddenColumnsInfo(); - t << saveComments(); - t << "WindowLabel\t" + windowLabel() + "\t" + QString::number(captionPolicy()) + "\n"; - t << "\n"; - f.close(); -} === added file 'qtiplot/src/table/TableStatistics.h' --- qtiplot/src/table/TableStatistics.h 1970-01-01 00:00:00 +0000 +++ qtiplot/src/table/TableStatistics.h 2010-07-21 23:21:08 +0000 @@ -0,0 +1,74 @@ +/*************************************************************************** + File : TableStatistics.h + Project : QtiPlot +-------------------------------------------------------------------- + Copyright : (C) 2006 by Knut Franke + Email (use @ for *) : knut.franke*gmx.de + Description : Table subclass that displays statistics on + columns or rows of another table + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + ***************************************************************************/ +#ifndef TABLE_STATISTICS_H +#define TABLE_STATISTICS_H + +#include "Table.h" + +/*!\brief Table that computes and displays statistics on another Table. + * + * \section future Future Plans + * Make it possible to add new columns/rows to be monitored. + */ +class TableStatistics : public Table +{ + Q_OBJECT + + public: + //! supported statistics types + enum Type { row, column }; + TableStatistics(ScriptingEnv *env, ApplicationWindow *parent, Table *base, Type, QList targets); + //! return the type of statistics + Type type() const { return d_type; } + //! return the base table of which statistics are displayed + Table *base() const { return d_base; } + // saving + virtual void save(const QString&, const QString &geometry, bool = false); + + public slots: + //! update statistics when the user triggers a recaculate action + void update(); + //! update statistics after a column has changed (to be connected with Table::modifiedData) + void update(Table*, const QString& colName); + //! handle renaming of columns (to be connected with Table::changedColHeader) + void renameCol(const QString&, const QString&); + //! remove statistics of removed columns (to be connected with Table::removedCol) + void removeCol(const QString&); + + private slots: + void closedBase(); + + private: + Table *d_base; + Type d_type; + QList d_targets; +}; + +#endif === removed file 'qtiplot/src/table/TableStatistics.h' --- qtiplot/src/table/TableStatistics.h 2009-12-08 18:06:27 +0000 +++ qtiplot/src/table/TableStatistics.h 1970-01-01 00:00:00 +0000 @@ -1,74 +0,0 @@ -/*************************************************************************** - File : TableStatistics.h - Project : QtiPlot --------------------------------------------------------------------- - Copyright : (C) 2006 by Knut Franke - Email (use @ for *) : knut.franke*gmx.de - Description : Table subclass that displays statistics on - columns or rows of another table - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ -#ifndef TABLE_STATISTICS_H -#define TABLE_STATISTICS_H - -#include "Table.h" - -/*!\brief Table that computes and displays statistics on another Table. - * - * \section future Future Plans - * Make it possible to add new columns/rows to be monitored. - */ -class TableStatistics : public Table -{ - Q_OBJECT - - public: - //! supported statistics types - enum Type { row, column }; - TableStatistics(ScriptingEnv *env, ApplicationWindow *parent, Table *base, Type, QList targets); - //! return the type of statistics - Type type() const { return d_type; } - //! return the base table of which statistics are displayed - Table *base() const { return d_base; } - // saving - virtual void save(const QString&, const QString &geometry, bool = false); - - public slots: - //! update statistics when the user triggers a recaculate action - void update(); - //! update statistics after a column has changed (to be connected with Table::modifiedData) - void update(Table*, const QString& colName); - //! handle renaming of columns (to be connected with Table::changedColHeader) - void renameCol(const QString&, const QString&); - //! remove statistics of removed columns (to be connected with Table::removedCol) - void removeCol(const QString&); - - private slots: - void closedBase(); - - private: - Table *d_base; - Type d_type; - QList d_targets; -}; - -#endif === added file 'qtiplot/src/table/table.pri' --- qtiplot/src/table/table.pri 1970-01-01 00:00:00 +0000 +++ qtiplot/src/table/table.pri 2010-07-21 23:21:08 +0000 @@ -0,0 +1,21 @@ +############################################################### +################# Module: Table ############################## +############################################################### + +INCLUDEPATH += src/table/ + +HEADERS += src/table/ExportDialog.h \ + src/table/SetColValuesDialog.h \ + src/table/SortDialog.h \ + src/table/Table.h \ + src/table/TableDialog.h \ + src/table/TableStatistics.h \ + src/table/ExtractDataDialog.h \ + +SOURCES += src/table/ExportDialog.cpp \ + src/table/SetColValuesDialog.cpp \ + src/table/SortDialog.cpp \ + src/table/Table.cpp \ + src/table/TableDialog.cpp \ + src/table/TableStatistics.cpp \ + src/table/ExtractDataDialog.cpp \ === removed file 'qtiplot/src/table/table.pri' --- qtiplot/src/table/table.pri 2009-12-08 18:06:27 +0000 +++ qtiplot/src/table/table.pri 1970-01-01 00:00:00 +0000 @@ -1,19 +0,0 @@ -############################################################### -################# Module: Table ############################## -############################################################### - -INCLUDEPATH += src/table/ - -HEADERS += src/table/ExportDialog.h \ - src/table/SetColValuesDialog.h \ - src/table/SortDialog.h \ - src/table/Table.h \ - src/table/TableDialog.h \ - src/table/TableStatistics.h \ - -SOURCES += src/table/ExportDialog.cpp \ - src/table/SetColValuesDialog.cpp \ - src/table/SortDialog.cpp \ - src/table/Table.cpp \ - src/table/TableDialog.cpp \ - src/table/TableStatistics.cpp \ === added file 'qtiplot/translations/qtiplot_cn.ts' --- qtiplot/translations/qtiplot_cn.ts 1970-01-01 00:00:00 +0000 +++ qtiplot/translations/qtiplot_cn.ts 2010-07-21 23:21:08 +0000 @@ -0,0 +1,21909 @@ + + + + + + + QtiPlot - File openning error + QtiPlot - 文件打开错误 + + + You don't have the permission to open this file: <b>%1</b> + 你没有权限打开<b>%1</b>文件 + + + QtiPlot - File opening error + QtiPlot - 文件打开错误 + + + The file: <b>%1</b> doesn't exist! + 文件:<b>%1</b>不存在! + + + The file: <b>%1</b> is not a QtiPlot or Origin project file! + 文件:<b>%1</b>不是一个QtiPlot或者Origin项目文件! + + + QtiPlot - Demo Version + QtiPlot - 演示版本 + + + QtiPlot - File backup error + QtiPlot - 文件备份错误 + + + Cannot make a backup copy of <b>%1</b> (to %2).<br>If you ignore this, you run the risk of <b>data loss</b>. + 无法备份<b>%1</b>(至 %2)。<br>如果你忽略这个,你就处于<b>丢失数据</b>的风险中。 + + + QtiPlot - File save error + QtiPlot - 文件保存失败 + + + The file: <br><b>%1</b> is opened in read-only mode + 文件: <br><b>%1</b>是以只读模式打开的 + + + QtiPlot project + QtiPlot项目 + + + Compressed QtiPlot project + 压缩的QtiPlot项目 + + + Save project as + 项目另存为 + + + Save &As Project... + 另存为项目(&A)... + + + &Show All Windows + 显示所有窗口(&S) + + + &Hide All Windows + 隐藏所有窗口(&H) + + + &Delete Folder + 删除文件夹(&D) + + + &Rename + 重命名(&R) + + + New &Window + 新建窗口(&W) + + + New F&older + 新建文件夹(&o) + + + &None + 无(&N) + + + &Windows in Active Folder + 活动文件夹内的窗口(&W) + + + Windows in &Active Folder && Subfolders + 活动文件夹和自文件夹内的窗口(&A) + + + &View Windows + 查看窗口(&V) + + + &Properties... + 属性(&P)... + + + Hidden + 隐藏 + + + QtiPlot - Error + QtiPlot - 错误 + + + Please enter a valid name! + 请输入一个有效名称! + + + Name already exists! + 名称已存在! + + + Please choose another name! + 请选择一个其它的名称! + + + Type + 类型 + + + Project + 项目 + + + Path + 路径 + + + Size + 大小 + + + bytes + 字节 + + + Contents + 内容 + + + windows + 窗口 + + + folders + 文件夹 + + + Created + 创建 + + + Modified + 改动的 + + + Properties + 属性 + + + Folder + 文件夹 + + + New Folder + 新建文件夹 + + + QtiPlot - Delete folder? + QtiPlot - 删除文件夹? + + + Delete folder '%1' and all the windows it contains? + 删除文件夹'%1'和里面包含的所有窗口? + + + Yes + + + + No + + + + Matrix + 矩阵 + + + Table + 表格 + + + Note + 笔记 + + + Graph + 绘图 + + + Format + 格式 + + + Time + 时间 + + + The file: <b>%1</b> is the current file! + 文件<b>%1</b>是当前文件! + + + The file <b>%1</b> is corrupted, but there exists a backup copy.<br>Do you want to open the backup instead? + 文件<b>%1</b>损坏,但是有一个备份。<br>你想打开备份的文件吗? + + + The file: <b> %1 </b> was not created using QtiPlot! + 文件<b> %1 </b>不是QtiPlot创建的! + + + The file: <p><b> %1 </b><p> is the current file! + 文件<p><b> %1 </b><p>是当前文件! + + + QtiPlot - File Open Error + QtiPlot - 文件打开错误 + + + The file: <b> %1 </b> <p>does not exist anymore!<p>It will be removed from the list. + 文件<b> %1 </b> <p>不再存在!<p>它将被从列表中移除。 + + + The file "%1" was created using "%2" as scripting language. + +Initializing support for this language FAILED; I'm using "%3" instead. +Various parts of this file may not be displayed as expected. + 文件"%1"是用"%2"作为脚本语言创建的。 + +这种语言的支持初始化失败;正在使用"%3"替代。 +这个文件的很多部分可能不会被正确的显示。 + + + Window + 窗口 + + + QtiPlot - Opening file + QtiPlot - 打开文件 + + + Script Error + 脚本错误 + + + QtiPlot - Scripting Error + QtiPlot - 脚本错误 + + + QtiPlot - Open Template File + QtiPlot - 打开模板文件 + + + The file: <b>%1</b> is not a QtiPlot template file! + 文件<b>%1</b>不是一个QtiPlot模板文件! + + + Table1 + 表格1 + + + QtiPlot - Export Error + QtiPlot - 导出错误 + + + <h4>There are no plot layers available in this window!</h4> + <h4>在此窗口没有有效的绘图图层。</h4> + + + &Save + 保存(&S) + + + &Cancel + 取消(&C) + + + Choose a directory to export the graphs to + 选择一个图像导出目录 + + + Output format: + 输出格式: + + + Directory: + 目录: + + + There are no plot layers available in window <b>%1</b>.<br>Graph window not exported! + 在<b>%1</b>窗口没有有效的绘图图层。<br>图像窗口没有导出! + + + A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? + <p><b>%1</b><p>文件已经存在。 你想覆盖吗? + + + QtiPlot - Overwrite file? + QtiPlot - 覆盖文件? + + + QtiPlot - Export error + QtiPlot - 导出错误 + + + Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! + 无法写入文件: <br><h4> %1</h4><p>请保证你在这个位置有写权限! + + + Minimized + 最小化 + + + Save Project As + 项目另存为 + + + QtiPlot Matrix Template + QtiPlot矩阵模板 + + + QtiPlot 2D Graph Template + QtiPlot 2D图像模板 + + + QtiPlot Table Template + QtiPlot表格模板 + + + QtiPlot 3D Surface Template + QtiPlot 3D曲面图模板 + + + Save Window As Template + 窗口另存为模板 + + + The name you chose is not valid: only letters and digits are allowed! + 你选择的名称无效:只允许字母和数字! + + + Name <b>%1</b> already exists! + 名称<b>%1</b>已存在! + + + Warning: for internal consistency reasons the underscore character is replaced with a minus sign. + 警告:因为内部一致性原因,画线字符被减号替代。 + + + <h4>There are no plot layers available in this window.</h4><p><h4>Please add a layer and try again!</h4> + <h4>在此窗口没有有效的绘图图层。</h4><p><h4>请添加一个图层后重试!</h4> + + + This functionality is not available for pie plots! + 这个功能在饼状图上无效! + + + &All + 全部(&A) + + + QtiPlot - Enter rows number + QtiPlot - 输入行号 + + + Rows + + + + QtiPlot - Delete rows + QtiPlot - 删除行 + + + Start row + 起始行 + + + End row + 终止行 + + + QtiPlot - Enter columns number + QtiPlot - 输入列号 + + + Columns + + + + Please select a column first! + 请先选择一列! + + + Please select two columns for this operation! + 请为此操作选择两列! + + + Please select exactly one columns for this operation! + 请为此操作选择恰好一列! + + + Please select two columns for this operation: + the first represents the signal and the second the response function! + 请为此操作选择两列: +第一列代表信号第二列代表函数! + + + QtiPlot - Row selection error + QtiPlot - 行选择错误 + + + Please select a row first! + 请先选择一行! + + + Special Line/Symb&ol + 特殊线/符号(&o) + + + Statistical &Graphs + 统计图(&G) + + + &Plot + 绘图(&P) + + + Cu&t + 剪切(&t) + + + &Copy + 复制(&C) + + + Past&e + 粘贴(&e) + + + &X + &X + + + &Y + &Y + + + &Z + &Z + + + &Label + 标签(&L) + + + X E&rror + X误差(&r) + + + Y &Error + Y误差(&E) + + + Set As + 设置为 + + + &Fill Column With + 填充列(&F) + + + &Column + 列(&C) + + + &Normalize + 归一化(&N) + + + &Delete + 删除(&D) + + + &Insert + 插入(&I) + + + &Ascending + 升序(&A) + + + &Descending + 降序(&D) + + + Sort Colu&mn + 按列排序(&m) + + + Pa&nel + 面板(&n) + + + &Read-only + 只读(&R) + + + Read/&Write + 读写(&W) + + + &Fill Columns With + 填充列(&F) + + + You need to select at least one Y column for this operation! + 你需要为此操作选择至少一个Y列! + + + Y2 Axis Title + Y2轴标题 + + + Not available for empty 3D surface plots! + 空的3D曲面图绘制是无效的! + + + Set Display Range + 设置显示范围 + + + <h4>There are no plot layers available in this window.</h4> + <h4>在此窗口没有有效的绘图图层。</h4> + + + This will modify the data in the worksheets! +Are you sure you want to continue? + 这会改动工作表中的数据! +你确定你想继续吗? + + + Continue + 继续 + + + Cancel + 取消 + + + Choose a filename to save under + 选择一个文件来保存 + + + Could not write to file: <h4>%1</h4><p>Please verify that you have the right to write to this location or that the file is not being used by another application! + 无法写入文件: <h4> %1</h4><p>请保证你在这个位置有写权限或者这个文件不在被别的程序所使用! + + + Please select a 'Y' column first! + 请先选择一个Y列! + + + Sorry, there are no results to display! + 对不起,没有结果可以显示! + + + There are no plot layers available in this window! + 在此窗口没有有效的绘图图层! + + + There are no layers available on this plot. Operation aborted! + 此绘图上没有有效图层。操作中止! + + + QtiPlot - Insert image from file + QtiPlot - 从文件插入图像 + + + There are no plot layers available in this window. + 在此窗口没有有效的绘图图层。 + + + QtiPlot - Duplicate window error + QtiPlot - 复制窗口错误 + + + QtiPlot - Duplicate error + QtiPlot - 复制错误 + + + Empty 3D surface plots cannot be duplicated! + 空的3D曲面图不可复制! + + + Released + 发布 + + + About QtiPlot + 关于QtiPlot + + + &Translate + 翻译(&T) + + + Vie&w + 视图(&w) + + + &Palette + 调色板(&P) + + + &Convert to Spreadsheet + 转换为电子表格(&C) + + + &Recent Projects + 最近项目(&R) + + + &Folders + 文件夹(&F) + + + &Cascade + 层叠(&C) + + + &Tile + 平铺(&T) + + + Close &Window + 关闭窗口(&W) + + + More windows... + 更多窗口... + + + &View Pixel Line profile + 查看像素谱线轮廓(&V) + + + &Intensity Matrix + 强度矩阵(&I) + + + &Cut + 剪切(&C) + + + Please use the project explorer to select a window! + 请使用项目浏览器选择一个窗口! + + + Normal + 普通 + + + Save changes to project: <p><b> %1 </b> ? + 保存变动到项目<p><b> %1 </b>? + + + UNTITLED + 未命名 + + + QtiPlot - untitled + QtiPlot - 未命名 + + + &Delete Selection + 删除所选(&D) + + + Auto &Column Width + 自动列宽(&C) + + + &Delete Window + 删除窗口(&D) + + + &Rename Window + 重命名窗口(&R) + + + &Print Window + 打印窗口(&P) + + + D&epending Graphs + 依赖的图像(&e) + + + D&epending 3D Graphs + 依赖的3D图像(&e) + + + D&epends on + 依赖 + + + Function + 函数 + + + Maximized + 最大化 + + + Re&move Pie Curve + 移除饼状图曲线(&m) + + + &Add + 添加(&A) + + + Anal&yze + 分析(&y) + + + &Data + 数据(&D) + + + &Gray Scale + 灰阶(&G) + + + &Layer + 图层(&L) + + + &Window + 窗口(&W) + + + &Paste Layer + 粘贴图层(&P) + + + &Paste Text + 粘贴文本(&P) + + + &Paste Tex Formula + 粘贴TeX方程式(&P) + + + &Paste Image + 粘贴图像(&P) + + + &Paste Rectangle + 粘贴矩形(&P) + + + &Paste Ellipse + 粘贴椭圆(&P) + + + &Paste Line/Arrow + 粘贴线/箭头(&P) + + + E&xport + 导出(&x) + + + &Print + 打印(&P) + + + P&roperties... + 属性(&r)... + + + &Copy Page + 复制页(&C) + + + E&xport Page + 导出页(&x) + + + 3D &Plot + 三维绘图(&P) + + + &Matrix... + 矩阵(&M)... + + + Choose &Data Set... + 选择数据集(&D)... + + + Choose &Matrix... + 选择矩阵(&M)... + + + C&lear + 清除(&l) + + + &Copy Graph + 复制图像(&C) + + + &Export + 导出(&E) + + + &Paste + 粘贴(&P) + + + &Insert Row + 插入行(&I) + + + &Insert Column + 插入列(&I) + + + &Delete Rows + 删除行(&D) + + + &Delete Columns + 删除列(&D) + + + &Delete Row + 删除行(&D) + + + Clea&r Row + 清除行(&r) + + + Clea&r Rows + 清除行(&r) + + + QtiPlot - Help Files Not Found! + QtiPlot - 帮助文件没找到! + + + The manual can be downloaded from the following internet address: + 手册可以从以下网址下载: + + + QtiPlot - Help Profile Not Found! + QtiPlot - 帮助没找到! + + + The assistant could not start because the file <b>%1</b> was not found in the help file directory! + 助手无法启动因为文件<b>%1</b>不在帮助文件的目录中! + + + This file is provided with the QtiPlot manual which can be downloaded from the following internet address: + 这个文件随同QtiPlot手册提供,可以在以下网址下载: + + + Please indicate the location of the help file! + 请指示帮助文件的位置! + + + <h4>There are no tables available in this project.</h4><p><h4>Please create a table and try again!</h4> + <h4>项目中没有有效的表格。</h4><p><h4>请创建表格后重试!</h4> + + + QtiPlot - Edit function + QtiPlot - 编辑函数 + + + 3D Surface + 三维曲面图 + + + QtiPlot - Set the number of pixels to average + QtiPlot - 设置象素值为平均 + + + Number of averaged pixels + 平均象素值 + + + You must have more than one layer in the active window! + 在一个活动窗口你需要超过一个图层! + + + You must have more than one dataset in the active layer! + 在一个活动图层你需要超过一个数据集! + + + QtiPlot - Guess best origin for the new layer? + QtiPlot - 猜测新图层的最佳来源? + + + Do you want QtiPlot to guess the best position for the new layer? + Warning: this will rearrange existing layers! + 你希望QtiPlot猜测新图层的最佳位置吗? +警告:这会重排已存在的图层! + + + &Guess + 猜测(&G) + + + &Top-left corner + 左上角(&T) + + + QtiPlot - Choose data set + QtiPlot - 选择数据集 + + + Curve + 曲线 + + + Integration of %1 from zero is + %1从0开始的积分 + + + Integration of %1 + %1的积分 + + + Area + 面积 + + + Linear Regression of %1 + %1线性回归 + + + Slope + 斜率 + + + Intercept + 截止 + + + Chi^2 + Chi^2 + + + R^2 + R^2 + + + Add &Custom Script Action... + 添加自定义脚本动作(&C)... + + + New &Project + 新建项目(&P) + + + Ctrl+N + Ctrl+N + + + App&end Project... + 附加项目(&e)... + + + New &Graph + 新建绘图(&G) + + + Ctrl+G + Ctrl+G + + + New &Note + 新建笔记(&N) + + + New &Table + 新建表格(&T) + + + Ctrl+T + Ctrl+T + + + New &Matrix + 新建矩阵(&M) + + + Ctrl+M + Ctrl+M + + + New &Function Plot + 新建函数绘图(&F) + + + Ctrl+F + Ctrl+F + + + New 3D &Surface Plot + 新建三维曲面绘图(&S) + + + Ctrl+ALT+Z + Ctrl+ALT+Z + + + &Open + 打开(&O) + + + Ctrl+O + Ctrl+O + + + Open Image &File + 打开图象文件(&F) + + + Ctrl+I + Ctrl+I + + + Import I&mage... + 导入图像(&m)... + + + &Save Project + 保存项目(&S) + + + Ctrl+S + Ctrl+S + + + Save Project &As... + 项目另存为(&A)... + + + Ctrl+Shift+S + Ctrl+Shift+S + + + Open Temp&late... + 打开模板(&l)... + + + Save As &Template... + 另存为模板(&T)... + + + Save Note As... + 笔记另存为... + + + &Import ASCII... + 导入ASCII(&I)... + + + &Undo + 撤销(&U) + + + Ctrl+Z + Ctrl+Z + + + &Redo + 重做(&R) + + + &Duplicate + 复制(&D) + + + Cu&t Selection + 剪切所选(&t) + + + Ctrl+X + Ctrl+X + + + &Copy Selection + 复制所选(&C) + + + Ctrl+C + Ctrl+C + + + &Paste Selection + 粘贴所选(&P) + + + Ctrl+V + Ctrl+V + + + Del + delete key + 删除 + + + Ctrl+E + Ctrl+E + + + &Find... + 查找(&F)... + + + Add La&yer + 添加图层(&y) + + + ALT+L + ALT+L + + + Arran&ge Layers + 排列图层(&g) + + + Shift+A + Shift+A + + + Automatic Layout + 自动布局 + + + &Current + 当前(&C) + + + Ctrl+Alt+G + Ctrl+Alt+G + + + Alt+X + Alt+X + + + &Export PDF + 导出PDF(&E) + + + Ctrl+Alt+P + Ctrl+Alt+P + + + Ctrl+P + Ctrl+P + + + Print All Plo&ts + 打印所有绘图(&t) + + + E&xport ASCII + 导出ASCII文件(&x) + + + &Quit + 退出(&Q) + + + Ctrl+Q + Ctrl+Q + + + &Close + 关闭(&C) + + + Clear &Log Information + 清除日志信息(&L) + + + Delete &Fit Tables + 删除拟合表格(&F) + + + Plot &Wizard + 绘图向导(&W) + + + Ctrl+Alt+W + Ctrl+Alt+W + + + &Preferences... + 选项(&P)... + + + Add/Remove &Curve... + 添加/删除曲线(&C)... + + + ALT+C + ALT+C + + + Add &Error Bars... + 添加误差棒(&E)... + + + Ctrl+B + Ctrl+B + + + Add &Function... + 添加函数(&F)... + + + Ctrl+Alt+F + Ctrl+Alt+F + + + &Rescale to Show All + 重缩放显示所有(&R) + + + Ctrl+Shift+R + Ctrl+Shift+R + + + New &Legend + 新建图例(&L) + + + Ctrl+L + Ctrl+L + + + Add Time Stamp + 添加时间标记 + + + Ctrl+ALT+T + Ctrl+ALT+T + + + Add &Image + 添加图像(&I) + + + ALT+I + ALT+I + + + &Scatter + 散点图(&S) + + + Line + S&ymbol + 线状图+符号(&y) + + + Vertical &Drop Lines + 垂线图(&D) + + + &Spline + 齿形图(&S) + + + &Horizontal Steps + 水平阶梯图(&H) + + + &Vertical Steps + 垂直阶梯图(&V) + + + &Columns + 柱状图(&C) + + + &Rows + 水平柱状图(&R) + + + &Area + 面积图(&A) + + + &Pie + 饼状图(&P) + + + Vectors XY&AM + 矢量图XY&AM + + + &Vectors &XYXY + 矢量图&XYXY + + + &Histogram + 直方图(&H) + + + &Stacked Histogram + 堆叠直方图(&S) + + + Stem-and-&Leaf Plot + 茎叶图(&L) + + + &Vertical 2 Layers + 垂直排列2图层(&V) + + + &Horizontal 2 Layers + 水平排列2图层(&H) + + + &4 Layers + 4图层(&4) + + + &Stacked Layers + 堆叠图层(&S) + + + D&ouble-Y + 双Y轴图(&o) + + + &Zoom + 缩放(&Z) + + + E&xtract to Graphs + 提取至绘图(&x) + + + Extract to &Layers + 提取至层(&L) + + + Add Inset Layer + 添加浮动层 + + + &Ribbon + 带状图(&R) + + + &Bars + 棒状图(&B) + + + &Trajectory + 轨线(&T) + + + Statistics on &Columns + 统计列(&C) + + + Statistics on &Rows + 统计行(&R) + + + &Integrate + 积分(&I) + + + Integr&ate Function... + 函数积分(&a)... + + + Inte&rpolate ... + 插值(&r)... + + + &Low Pass... + 低通(&L)... + + + &High Pass... + 高通(&H)... + + + &Band Pass... + 带通(&B)... + + + &Band Block... + 带阻(&B)... + + + &FFT... + &FFT... + + + &Savitzky-Golay... + Savitzky-Golay(&S)... + + + &FFT Filter... + FFT滤波器(&F)... + + + Moving Window &Average... + 平均移动窗口(&A)... + + + &Differentiate + 微分(&D) + + + Fit &Linear + 线性拟合(&L) + + + Fit &Polynomial ... + 多项式拟合(&P)... + + + &First Order ... + 一阶(&F)... + + + &Second Order ... + 二阶(&S)... + + + &Third Order ... + 三阶(&T)... + + + Fit Exponential Gro&wth ... + 指数增益拟合(&w)... + + + Fit &Boltzmann (Sigmoidal) + 波尔兹曼(S型)拟合(&B) + + + Fit &Gaussian + 高斯拟合(&G) + + + Fit Lorent&zian + 洛仑兹拟合(&z) + + + Fit &Wizard... + 拟合向导(&W)... + + + Ctrl+Y + Ctrl+Y + + + &Plot ... + 绘图(&P)... + + + &Scales... + 比例(&S)... + + + &Axes... + 轴(&A)... + + + &Grid ... + 网格(&G)... + + + &Title ... + 标题(&T)... + + + Column &Options ... + 列选项(&O)... + + + Ctrl+Alt+O + Ctrl+Alt+O + + + Set Column &Values ... + 设置列值(&V)... + + + Alt+Q + Alt+Q + + + Recalculate + 重新计算 + + + Ctrl+Return + Ctrl+Return + + + &Hide Selected + 隐藏所选(&H) + + + Sho&w All Columns + 显示所有列(&w) + + + &Swap columns + 交换列(&S) + + + Move &Right + 右移(&R) + + + Move &Left + 左移(&L) + + + Move to F&irst + 移至开头(&i) + + + Move to Las&t + 移至末尾(&t) + + + &Columns... + 列(&C)... + + + &Rows... + 行(&R)... + + + &Delete Rows Interval... + 删除行间隔(&D)... + + + &About QtiPlot + 关于QtiPlot(&A) + + + F1 + F1 + + + &Help + 帮助(&H) + + + Ctrl+H + Ctrl+H + + + &Choose Help Folder... + 选择帮助文件夹(&C)... + + + Ctrl+W + Ctrl+W + + + Add Column + 添加列 + + + &Go to Row... + 跳转至行(&G)... + + + Go to Colum&n... + 跳转至列(&n)... + + + Ctrl+Alt+C + Ctrl+Alt+C + + + Clear + 清除 + + + &Remove Layer + 移除图层(&R) + + + Alt+R + Alt+R + + + Window &Geometry... + 窗口几何属性(&G)... + + + &Hide Window + 隐藏窗口(&H) + + + Ctrl+Alt+H + Ctrl+Alt+H + + + &View Pixel Line Profile + 查看像素谱线轮廓(&V) + + + &Intensity Table + 强度表格(&I) + + + &Properties + 属性(&P) + + + &Activate Window + 激活窗口(&A) + + + Mi&nimize Window + 最小化窗口(&n) + + + Ma&ximize Window + 最大化窗口(&x) + + + Re&size Window... + 调整窗口尺寸(&s)... + + + &Surface... + 曲面图(&S)... + + + &Data Set... + 数据集(&D)... + + + Set &Properties... + 设置属性(&P)... + + + Set &Dimensions... + 设置维度(&D)... + + + Ctrl+D + Ctrl+D + + + Set &Values... + 设置值(&V)... + + + &Image Plot + 图像绘制(&I) + + + &Transpose + 转置(&T) + + + Flip &V + V型翻转(&V) + + + Ctrl+Shift+V + Ctrl+Shift+V + + + Flip &H + H型翻转(&H) + + + Ctrl+Shift+H + Ctrl+Shift+H + + + R&otate 90 + 旋转90(&o) + + + Rotate &-90 + 旋转-90(&-) + + + Ctrl+Alt+R + Ctrl+Alt+R + + + &Invert + 求逆(&I) + + + &Determinant + 秩(&D) + + + &Image mode + 图像模式(&I) + + + Ctrl+Shift+I + Ctrl+Shift+I + + + &Data mode + 数据模式(&D) + + + Ctrl+Shift+D + Ctrl+Shift+D + + + Show &X/Y + 显示X/Y(&X) + + + Ctrl+Shift+X + Ctrl+Shift+X + + + Show &Column/Row + 显示列/行(&C) + + + Ctrl+Shift+C + Ctrl+Shift+C + + + &Default + 默认(&D) + + + &Rainbow + 彩虹(&R) + + + &Custom + 自定义(&C) + + + &Export Image ... + 导出图象(&E)... + + + &Direct + 直接(&D) + + + &XYZ Columns + &XYZ列 + + + &YXZ Columns + &YXZ列 + + + &Forward FFT + 正FFT(&F) + + + &Inverse FFT + 逆FFT(&I) + + + 3D &Wire Frame + 三维线框(&W) + + + 3D &Hidden Line + 三维隐藏线(&H) + + + 3D &Polygons + 三维多边形(&P) + + + 3D Wire &Surface + 三维线状曲面图(&S) + + + Contour - &Color Fill + 等值线 - 色彩填充(&C) + + + Contour &Lines + 等值线图(&L) + + + &Gray Scale Map + 灰阶表(&G) + + + Sort Ta&ble + 表排序(&) + + + Sort Columns + 列排序 + + + &Table + 表格(&T) + + + Co&rrelate + 相关(&r) + + + &Autocorrelate + 自动相关(&A) + + + &Convolute + 卷积(&C) + + + &Deconvolute + 反卷积(&D) + + + &Horizontal + 水平(&H) + + + &Vertical + 垂直(&V) + + + Ro&w Numbers + 行号(&w) + + + &Random Values + 随机数(&R) + + + &Frequency Count ... + 频数统计(&F)... + + + &Read Only + 只读(&R) + + + &Disregard + 忽略该列(&D) + + + &Box Plot + 箱形图(&B) + + + &Gaussian... + 高斯(&G)... + + + &Lorentzian... + 洛仑兹(&L)... + + + Search for &Updates + 搜索更新(&U) + + + &QtiPlot Homepage + QtiPlot主页(&Q) + + + QtiPlot &Forums + QtiPlot论坛(&F) + + + Report a &Bug + 报告BUG(&B) + + + Download &Manual + 下载手册(&M) + + + &Translations + 语言包(&T) + + + Make a &Donation + 捐赠(&D) + + + Technical &Support + 技术支持(&S) + + + Scripting &language + 脚本语言(&l) + + + &Restart scripting + 重新运行脚本(&R) + + + E&xecute + 执行(&x) + + + Ctrl+J + Ctrl+J + + + Execute &All + 全部执行(&A) + + + Ctrl+Shift+J + Ctrl+Shift+J + + + &Evaluate Expression + 计算表达式(&E) + + + Show Line &Numbers + 显示行号(&N) + + + &Replace... + 替换(&R)... + + + &Script Window + 脚本窗口(&S) + + + &Plot details... + 绘图详情(&P)... + + + &Worksheet + 工作表(&W) + + + &Reset to Full Range + 重置到全部范围(&R) + + + Edit &Range... + 编辑范围(&R)... + + + &Hide + 隐藏(&H) + + + Hide &Other Curves + 隐藏其他曲线(&O) + + + &Show All Curves + 显示所有曲线(&S) + + + &Toolbars... + 工具栏(&T)... + + + Ctrl+Shift+T + Ctrl+Shift+T + + + Bold + 粗体 + + + Italic + 斜体 + + + Superscript + 上标 + + + Subscript + 下标 + + + Underline (Ctrl+U) + 下划线 (Ctrl+U) + + + Ctrl+U + Ctrl+U + + + Greek + 希腊字母 + + + Mathematical Symbols + 数学符号 + + + Open a new project + 打开一个新项目 + + + New Fol&der + 新建文件夹(&d) + + + Create a new folder + 创建新文件夹 + + + Create an empty 2D plot + 创建一个空2D绘图 + + + Create an empty note window + 创建一个空笔记窗口 + + + New table + 新建表格 + + + New matrix + 新建矩阵 + + + Create a new 2D function plot + 创建一个新的2D函数绘图 + + + Create a new 3D surface plot + 创建一个新的3D曲面图 + + + Open project + 打开项目 + + + Save project + 保存项目 + + + Open Te&mplate... + 打开模板(&m)... + + + Open template + 打开模板 + + + Save window as template + 窗口另存为模板 + + + Import data file(s) + 导入数据文件 + + + Ctrl+K + Ctrl+K + + + Undo changes + 撤销修改 + + + Redo changes + 重做修改 + + + Duplicate window + 复制窗口 + + + Cut selection + 剪切所选 + + + Copy selection + 复制所选 + + + Paste selection + 粘贴所选 + + + Delete selection + 删除所选 + + + Project &Explorer + 项目浏览器(&E) + + + Show project explorer + 显示项目浏览器 + + + Results &Log + 结果日志(&L) + + + Show analysis results + 显示分析结果 + + + &Undo/Redo Stack + 撤销/重做堆栈(&U) + + + Show available undo/redo commands + 显示可用撤销/重做命令 + + + &Console + 控制台(&C) + + + Show Scripting console + 显示脚本控制台 + + + Script Window + 脚本窗口 + + + Add Layer + 添加图层 + + + Arrange Layers + 排列图层 + + + Export current graph + 导出当前绘图 + + + Export all graphs + 导出全部绘图 + + + Export to PDF + 导出到PDF + + + Print window + 打印窗口 + + + Add curve to graph + 把曲线添加到绘图 + + + Add Error Bars... + 添加误差棒... + + + Add Function... + 添加函数... + + + Best fit + 最佳拟合 + + + Add new legend + 添加新图例 + + + Date & time + 日期 & 时间 + + + Add Image + 添加图像 + + + Plot as line + 绘制为线 + + + Plot as symbols + 绘制为符号 + + + Plot as line + symbols + 绘制为线 + 符号 + + + Plot with vertical bars + 用垂直棒绘制 + + + Plot with horizontal bars + 用水平棒绘制 + + + Plot area + 绘图区域图 + + + Plot pie + 绘制饼状图 + + + &Vectors XYXY + 矢量图XYXY(&V) + + + Vectors XYXY + 矢量图XYXY + + + Vectors XYAM + 矢量图XYAM + + + Stem-and-Leaf Plot + 绘制茎叶图 + + + Double Y Axis + 双Y轴 + + + Zoom + 缩放 + + + Extract to Graphs + 提取至绘图 + + + Extract to Layer&s + 提取至图层(&s) + + + Extract to Layers + 提取至图层 + + + Plot 3D ribbon + 绘制三维带状图 + + + Plot 3D bars + 绘制三维棒状图 + + + Plot 3D scatter + 绘制三维散点图 + + + Plot 3D trajectory + 绘制三维轨线 + + + Contour + &Color Fill + 等值线 + 色彩填充(&C) + + + Contour Lines + Color Fill + 等值线图 + 色彩填充 + + + Contour Lines + 等值线图 + + + Gray Scale Map + 灰阶表 + + + Selected columns statistics + 选中列统计 + + + Selected rows statistics + 选中行统计 + + + Hide selected columns + 隐藏所选列 + + + Show all table columns + 显示表格所有列 + + + Swap selected columns + 交换选中列 + + + Move Right + 右移 + + + Move Left + 左移 + + + Move to First + 移至开头 + + + Move to Last + 移至末尾 + + + Alt+C + Alt+C + + + More Windows... + 更多窗口... + + + Set Matrix Values + 设置矩阵值 + + + Image Plot + 图像绘制 + + + Rotate 90 Clockwise + 顺时针旋转90 + + + Rotate 90 Counterclockwise + 逆时针旋转90 + + + Flip Vertically + 垂直翻转 + + + Flip Horizontally + 水平翻转 + + + Fill selected columns with row numbers + 用行号填充选中列 + + + Fill selected columns with random numbers + 用随机数填充选中列 + + + Set column as X + 设置列为X + + + Set column as Y + 设置列为Y + + + Set column as Z + 设置列为Z + + + Set as Y Error Bars + 设置为Y误差棒 + + + Set as Labels + 设置为标签 + + + Disregard Columns + 忽视列 + + + Box and whiskers plot + 箱形图 + + + Visit QtiPlot &Forums + 访问QtiPlot论坛(&F) + + + Disable &tools + 禁用工具(&t) + + + Pointer + 指针 + + + &Zoom In + 放大(&Z) + + + Ctrl++ + Ctrl++ + + + Zoom In + 放大 + + + Zoom &Out + 缩小(&O) + + + Ctrl+- + Ctrl+- + + + Zoom Out + 缩小 + + + &Data Reader + 数据读取器(&D) + + + CTRL+D + CTRL+D + + + Data reader + 数据读取器 + + + &Select Data Range + 选择数据范围(&S) + + + ALT+S + ALT+S + + + Select data range + 选择数据范围 + + + S&creen Reader + 屏幕读取器(&c) + + + Screen reader + 屏幕读取器 + + + &Draw Data Points + 画数据点(&D) + + + Draw Data Points + 画数据点 + + + &Move Data Points... + 移动数据点(&M)... + + + Ctrl+ALT+M + Ctrl+ALT+M + + + Move data points + 移动数据点 + + + Remove &Bad Data Points... + 移除坏数据点(&B)... + + + Alt+B + Alt+B + + + Remove data points + 移除数据点 + + + Add &Text + 添加文本(&T) + + + Add Text + 添加文本 + + + ALT+T + ALT+T + + + Add E&quation + 添加公式(&q) + + + Add Equation + 添加公式 + + + ALT+Q + ALT+Q + + + Add &Rectangle + 添加矩形(&R) + + + Add Rectangle + 添加矩形 + + + CTRL+ALT+R + CTRL+ALT+R + + + Add &Ellipse + 添加椭圆(&E) + + + Add Ellipse/Circle + 添加椭圆/圆 + + + CTRL+ALT+E + CTRL+ALT+E + + + Draw &Arrow + 画箭头(&A) + + + CTRL+ALT+A + CTRL+ALT+A + + + Draw arrow + 画箭头 + + + Draw &Line + 画线(&L) + + + CTRL+ALT+L + CTRL+ALT+L + + + Draw line + 画线 + + + Box + 箱形框 + + + Frame + 框架 + + + &Frame + 框架(&F) + + + No Axes + 无轴 + + + No axes + 无轴 + + + Front grid + 前栅格 + + + Back grid + 后栅格 + + + Right grid + 右栅格 + + + Left grid + 左栅格 + + + Ceiling grid + 顶栅格 + + + Floor grid + 底栅格 + + + Wireframe + 线框架 + + + Hidden Line + 隐藏线 + + + Hidden line + 隐藏线 + + + Polygon Only + 只有多边形 + + + Polygon only + 只有多边形 + + + Mesh & Filled Polygons + 网格&填充多边形 + + + Mesh & filled Polygons + 网格&填充多边形 + + + Dots + + + + Bars + + + + Cones + 圆锥体 + + + Crosshairs + 叉丝 + + + Floor Data Projection + 底面数据投影 + + + Floor data projection + 底面数据投影 + + + Floor Isolines + 底面等值线 + + + Floor isolines + 底面等值线 + + + Empty Floor + 空底面 + + + Empty floor + 空底面 + + + Animation + 动画 + + + Enable perspective + 启用透视 + + + Reset rotation + 重置旋转 + + + Fit frame to window + 使框架适合窗口 + + + Horizontal + 水平 + + + Vertical + 垂直 + + + QtiPlot - Enter the number of peaks + QtiPlot - 输入峰值数量 + + + Peaks + + + + <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> If you like it, you're using it in your work and you would like to see it constantly improved, please support its authors by making a donation.</b></font> + <font size=+2, color = darkBlue><b>QtiPlot是一个开源软件,它的开发需要上百小时的工作。<br><br>如果你喜欢它,你在你的工作中应用它,并且希望看到它稳步的改进,请通过捐献的方式支持一下它的作者。</b></font> + + + Please support QtiPlot! + 请支持QtiPlot! + + + Close + 关闭 + + + <b> %1 </b>: This command line option must be used without other arguments! + <b> %1 </b>: 这个命令行选项不能和其他参数一起用! + + + Version + 版本 + + + Usage + 用法 + + + options + 选项 + + + file + 文件 + + + name + 名称 + + + Valid options are + 有效的选项是 + + + or + 或者 + + + show about dialog and exit + 显示关于对话框并退出 + + + start QtiPlot with the default settings + 使用默认设置启动QtiPlot + + + show command line options + 显示命令行选项 + + + start QtiPlot in language + 使用语言包启动QtiPlot + + + show QtiPlot manual in a standalone window + 在一个单独的窗口显示QtiPlot手册 + + + print QtiPlot version and release date + 打印QtiPlot版本和发行日期 + + + execute the script file given as argument + 执行参数中给出的脚本文件 + + + execute the script file given as argument without displying the user interface. Warning: 2D plots are not correctly handled in this functioning mode! + 执行参数中给出的脚本文件并且不显示用户界面。警告:2D绘图在这种模式下处理不正确! + + + Help + 帮助 + + + <b> %1 </b>: Wrong locale option or no translation available! + <b> %1 </b>:错误的地区选项或者语言包不可用! + + + <b> %1 </b> unknown command line option! + <b> %1 </b> 未知命令行选项! + + + Type %1 to see the list of the valid options. + 键入%1来查看有效选项列表。 + + + <b>%1</b> is a directory, please specify a file name! + <b>%1</b>是一个目录,请指定一个文件名! + + + 3D Graph + 三维绘图 + + + Label + 标签 + + + Status + 状态 + + + QtiPlot - No match found + QtiPlot - 找不到匹配项 + + + Sorry, no match found for string: '%1' + 对不起,没有找到匹配的字符串: '%1' + + + Cannot move an object to itself! + 不能把一个对象移到自身上! + + + Cannot move a parent folder into a child folder! + 不能把一个父文件夹移动到资文件夹内! + + + Skipped moving folder + 跳过移动文件夹 + + + The destination folder already contains a folder called '%1'! Folder skipped! + 目的文件夹已经含有一个叫做'%1'的文件夹!文件夹跳过! + + + Error + 错误 + + + QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! + QtiPlot尝试下载最新更新的必要信息。请修改你的防火墙设置来允许QtiPlot连接到英特网! + + + Do you wish to continue? + 你想继续吗? + + + QtiPlot - HTTP get version file + QtiPlot - HTTP获取版本文件 + + + Error while fetching version file with HTTP: %1. + HTTP取版本文件时出错: %1。 + + + QtiPlot - Updates Available + QtiPlot - 有更新 + + + There is a newer version of QtiPlot (%1) available for download. Would you like to download it? + 有更新版本的QtiPlot (%1)等待下载。你希望下载它吗? + + + QtiPlot - No Updates Available + QtiPlot - 没有更新 + + + No updates available. Your current version %1 is the last version available! + 没有更新。你现在的版本%1就是最新版本! + + + QtiPlot - Warning + QtiPlot - 警告 + + + This will clear the contents of all the data associated with the table. Are you sure? + 这会清楚表格相关的数据的所有内容。你确定? + + + &Yes + 是(&Y) + + + &No + 否(&N) + + + QtiPlot - Enter row number + QtiPlot - 输入行号 + + + Row + + + + QtiPlot - Enter column number + QtiPlot - 输入列号 + + + Column + + + + QtiPlot was not built with Python scripting support included! + QtiPlot编译时不包含Python脚本支持! + + + Please select a Y column to plot! + 请选择需要绘制的Y列! + + + You need at least two columns for this operation! + 你需要为此操作选择至少两列! + + + Please set a default X column for this table, first! + 请先为这个表格设置一个默认的X列! + + + Please select a Z column for this operation! + 请为这个操作选择一个Z列! + + + You need to define a X column first! + 首先你需要定义一个X列! + + + You need to define a Y column first! + 首先你需要定义一个Y列! + + + Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. + 从0.9.1版本开始QtiPlot就保存拥护定义拟合模型到不同的位置。 + + + If you want to save your already defined models, please choose a destination folder. + 如果你想保存你已经定义的模型,请选择一个目的文件夹。 + + + Import fit models + 导入拟合模型 + + + Choose a directory to export the fit models to + 选择一个目录来导出拟合模型 + + + No Icon + 无图标 + + + Couldn't load file: %1. +Autocompletion will not be available! + 无法加载文件:%1。 +自动完成无法使用! + + + QtiPlot - Column selection error + QtiPlot - 列选择错误 + + + Please select exactly one column and more than one non empty cell! + 请选择一列和至少一个非空单元! + + + Data set: %1 doesn't exist! + 数据集:%1不存在! + + + Stem and leaf plot of dataset + 数据集的茎叶图 + + + from row + 起始行 + + + to row + 结束行 + + + Not enough memory for this dataset! + 没有足够的内存给这个数据集! + + + Stem + + + + Leaf + + + + Please confirm the stem unit! + 你确认茎单位! + + + Data set + 数据集 + + + stem unit + 茎单位 + + + Stem unit + 茎单位 + + + Leaf unit + 叶单位 + + + Key + + + + means + 方法 + + + Input error: empty data set! + 输入错误:空数据集! + + + Memory Allocation Error + 内存分配错误 + + + Not enough memory, operation aborted! + 内存不足,操作中止! + + + + AddWidgetTool + + + Click on plot to choose the position of the new object! + 在图上点击以选取新对象的位置! + + + + + enter your text here + 在这里输入文本 + + + + Move cursor in order to resize the new rectangle! + 移动光标来调整新矩形的大小! + + + + Move cursor in order to resize the new ellipse! + 移动光标来调整新椭圆的大小! + + + + ApplicationWindow + + + File %1 contains only %2 sheets, operation aborted! + 文件%1只包含%2表单,操作中止! + + + + Sheet %1 is empty, operation aborted! + %1表单为空,操作中止! + + + + sheet + 表单 + + + + QtiPlot was built without libxls support! + 此QtiPlot没有libxls支持! + + + + + + QtiPlot - untitled + QtiPlot - 未命名 + + + + + Project Explorer + 项目浏览器 + + + + + + Folder + 文件夹 + + + + + UNTITLED + 未命名 + + + + + Name + 名称 + + + + + + + + + + + + Type + 类型 + + + + + View + 视图 + + + + + + + + Size + 大小 + + + + + + + + + Created + 创建 + + + + + + Label + 标签 + + + + + Results Log + 结果日志 + + + + + Scripting Console + 脚本控制台 + + + + + Undo Stack + 撤销堆栈 + + + + &Next + next window + 下一个窗口(&N) + + + + F5 + next window shortcut + F5 + + + + &Previous + previous window + 上一个窗口(&P) + + + + F6 + previous window shortcut + F6 + + + + + File + 文件 + + + + + Edit + 编辑 + + + + + Plot + 绘图 + + + + Disable &Tools + 禁用工具(&T) + + + + + &Zoom In + 放大(&Z) + + + + + Ctrl++ + Ctrl++ + + + + &Zoom Out + 缩小(&Z) + + + + + Ctrl+- + Ctrl+- + + + + + &Data Reader + 数据读取器(&D) + + + + + CTRL+D + CTRL+D + + + + + &Select Data Range + 选择数据范围(&S) + + + + + ALT+S + ALT+S + + + + + S&creen Reader + 屏幕读取器(&c) + + + + + &Draw Data Points + 画数据点(&D) + + + + + &Move Data Points... + 移动数据点(&M)... + + + + + Ctrl+ALT+M + Ctrl+ALT+M + + + + + Remove &Bad Data Points... + 移除坏数据点(&B)... + + + + + Alt+B + Alt+B + + + + + Add E&quation + 添加公式(&q) + + + + + ALT+Q + ALT+Q + + + + + Add &Text + 添加文本(&T) + + + + + ALT+T + ALT+T + + + + + Draw &Arrow + 画箭头(&A) + + + + + CTRL+ALT+A + CTRL+ALT+A + + + + + Draw &Line + 画线(&L) + + + + + CTRL+ALT+L + CTRL+ALT+L + + + + + Add &Rectangle + 添加矩形(&R) + + + + + CTRL+ALT+R + CTRL+ALT+R + + + + + Add &Ellipse + 添加椭圆(&E) + + + + + CTRL+ALT+E + CTRL+ALT+E + + + + + + + + + + + Table + 表格 + + + + + + + + + + + Column + + + + + + Data Display + 数据显示 + + + + + Matrix Plot + 矩阵绘图 + + + + + + Format + 格式 + + + + QtiPlot - Script Window + QtiPlot - 脚本窗口 + + + + + 3D Surface + 三维曲面图 + + + + + &Recent Projects + 最近项目(&R) + + + + &File + 文件(&F) + + + + &New + 新建(&N) + + + + &Export Graph + 导出绘图(&E) + + + + &Edit + 编辑(&E) + + + + &View + 视图(&V) + + + + &Graph + 绘图(&G) + + + + + 3D &Plot + 三维绘图(&P) + + + + &Matrix + 矩阵(&M) + + + + + + &Plot + 绘图(&P) + + + + + &Data + 数据(&D) + + + + + + &Normalize + 归一化(&N) + + + + + &Fill Columns With + 填充列(&F) + + + + + + &Table + 表格(&T) + + + + &Smooth + 平滑(&S) + + + + &FFT filter + FFT滤波器(&F) + + + + Fit E&xponential Decay + 指数衰减拟合(&x) + + + + Fit &Multi-peak + 多峰值拟合(&M) + + + + &Analysis + 分析(&A) + + + + F&ormat + 格式(&o) + + + + &Scripting + 脚本(&S) + + + + &Windows + 窗口(&W) + + + + + + &Help + 帮助(&H) + + + + Set Columns &As + 设置列(&A) + + + + + &Read-only + 只读(&R) + + + + + Read/&Write + 读写(&W) + + + + + + Special Line/Symb&ol + 特殊线/符号(&o) + + + + + + Statistical &Graphs + 统计图(&G) + + + + + Pa&nel + 面板(&n) + + + + 3&D Plot + 三维绘图(&D) + + + + Empty Stack + 空堆栈 + + + + + + + + + + + QtiPlot - Plot error + QtiPlot - 绘图错误 + + + + + + + + You must select exactly one column for plotting! + 你必须选择一列来绘图! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + QtiPlot - Error + QtiPlot - 错误 + + + + Please select a column to plot! + 请选择一列来绘图! + + + + + Please select four columns for this operation! + 请为这个操作选择四列! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + QtiPlot - Warning + QtiPlot - 警告 + + + + + <h4>There are no tables available in this project.</h4><p><h4>Please create a table and try again!</h4> + <h4>项目中没有有效的表格。</h4><p><h4>请创建表格后重试!</h4> + + + + There are no available columns with plot designation set to Z! + 绘图指示设置为Z的情况下没有有效的列! + + + + + + QtiPlot - Choose data set + QtiPlot - 选择数据集 + + + + + + + + + + + Matrix + 矩阵 + + + + + QtiPlot - Choose matrix to plot + QtiPlot - 选择需要绘制的矩阵 + + + + <h4>There are no matrices available in this project.</h4><p><h4>Please create a matrix and try again!</h4> + <h4>项目中没有有效的矩阵。</h4><p><h4>请创建矩阵后重试!</h4> + + + + + + + + + + + + + + + + Graph + 绘图 + + + + + + QtiPlot - Export error + QtiPlot - 导出错误 + + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + 无法写入文件: <br><h4> %1 </h4><p>请保证你在这个位置有写权限! + + + + Images + 图像 + + + + QtiPlot - Import image from file + QtiPlot - 从文件导入图像 + + + + QtiPlot - Load image from file + QtiPlot - 从文件中加载图像 + + + + + + + Please select a Y column to plot! + 请选择需要绘制的Y列! + + + + + QtiPlot - Renamed Window + QtiPlot - 重名名窗口 + + + + + The table '%1' already exists. It has been renamed '%2'. + 表格'%1'已经存在。重名名为'%2'。 + + + + + + Notes + 笔记 + + + + Set Image Mode + 设置图像模式 + + + + Set Data Mode + 设置数据模式 + + + + Show X/Y + 显示X/Y + + + + Show Column/Row + 显示列/行 + + + + Set Default Palette + 设置默认调色板 + + + + Set Gray Scale Palette + 设置灰阶调色板 + + + + Set Rainbow Palette + 设置彩色调色板 + + + + Determinant of + 行列式 + + + + + + + + + + + + + + + + + + + + + <h4>There are no plot layers available in this window.</h4><p><h4>Please add a layer and try again!</h4> + <h4>在此窗口没有有效的绘图图层。</h4><p><h4>请添加一个图层后重试!</h4> + + + + + There are no curves available on this plot! + 在此绘图上没有有效的曲线! + + + + + + + + + + + + + + This functionality is not available for pie plots! + 这个功能在饼状图上无效! + + + + QtiPlot - Error bars error + QtiPlot - 误差棒错误 + + + + + This feature is not available for user defined function curves! + 这个功能对于用户自定义函数曲线无效! + + + + The selected columns have different numbers of rows! + 选中的列行数不同! + + + + The selected error column is empty! + 选中的误差列为空! + + + + + + + + + + QtiPlot - File openning error + QtiPlot - 文件打开错误 + + + + The file: <b>%1</b> is the current file! + 文件<b>%1</b>是当前文件! + + + + + + + The file: <b>%1</b> doesn't exist! + 文件:<b>%1</b>不存在! + + + + + You don't have the permission to open this file: <b>%1</b> + 你没有权限打开<b>%1</b>文件 + + + + + + + + + + + QtiPlot - File opening error + QtiPlot - 文件打开错误 + + + + The file <b>%1</b> is corrupted, but there exists a backup copy.<br>Do you want to open the backup instead? + 文件<b>%1</b>损坏,但是有一个备份。<br>你想打开备份的文件吗? + + + + + The file: <b> %1 </b> was not created using QtiPlot! + 文件<b> %1 </b>不是QtiPlot创建的! + + + + QtiPlot - File Open Error + QtiPlot - 文件打开错误 + + + + The file: <b> %1 </b> <p>does not exist anymore!<p>It will be removed from the list. + 文件<b> %1 </b> <p>不再存在!<p>它将被从列表中移除。 + + + + The file: <p><b> %1 </b><p> is the current file! + 文件<p><b> %1 </b><p>是当前文件! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + QtiPlot + QtiPlot + + + + The file "%1" was created using "%2" as scripting language. + +Initializing support for this language FAILED; I'm using "%3" instead. +Various parts of this file may not be displayed as expected. + 文件"%1"是用"%2"作为脚本语言创建的。 + +这种语言的支持初始化失败;正在使用"%3"替代。 +这个文件的很多部分可能不会被正确的显示。 + + + + Window + 窗口 + + + + QtiPlot - Opening file + QtiPlot - 打开文件 + + + + Script Error + 脚本错误 + + + + QtiPlot - Scripting Error + QtiPlot - 脚本错误 + + + + Scripting language "%1" failed to initialize. + "%1"脚本语言初始化失败。 + + + + QtiPlot - Open Template File + QtiPlot - 打开模板文件 + + + + The file: <b>%1</b> is not a QtiPlot template file! + 文件<b>%1</b>不是一个QtiPlot模板文件! + + + + Table1 + 表格1 + + + + QtiPlot - Export Error + QtiPlot - 导出错误 + + + + <h4>There are no plot layers available in this window!</h4> + <h4>在此窗口没有有效的绘图图层。</h4> + + + + Choose a directory to export the graphs to + 选择一个图像导出目录 + + + + Output format: + 输出格式: + + + + Directory: + 目录: + + + + There are no plot layers available in window <b>%1</b>.<br>Graph window not exported! + 在<b>%1</b>窗口没有有效的绘图图层。<br>图像窗口没有导出! + + + + + A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? + <p><b>%1</b><p>文件已经存在。 你想覆盖吗? + + + + + QtiPlot - Overwrite file? + QtiPlot - 覆盖文件? + + + + Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! + 无法写入文件: <br><h4> %1</h4><p>请保证你在这个位置有写权限! + + + + Minimized + 最小化 + + + + + Maximized + 最大化 + + + + + QtiPlot project + QtiPlot项目 + + + + + Compressed QtiPlot project + 压缩的QtiPlot项目 + + + + Save Project As + 项目另存为 + + + + QtiPlot Matrix Template + QtiPlot矩阵模板 + + + + QtiPlot 2D Graph Template + QtiPlot 2D图像模板 + + + + QtiPlot Table Template + QtiPlot表格模板 + + + + QtiPlot 3D Surface Template + QtiPlot 3D曲面图模板 + + + + Save Window As Template + 窗口另存为模板 + + + + + Please enter a valid name! + 请输入一个有效名称! + + + + The name you chose is not valid: only letters and digits are allowed! + 你选择的名称无效:只允许字母和数字! + + + + + + Please choose another name! + 请选择一个其它的名称! + + + + Name <b>%1</b> already exists! + 名称<b>%1</b>已存在! + + + + Warning: for internal consistency reasons the underscore character is replaced with a minus sign. + 警告:因为内部一致性原因,画线字符被减号替代。 + + + Choose a directory to export the tables to + 选择一个表格导出目录 + + + + + &Yes + 是(&Y) + + + + + + &All + 全部(&A) + + + + + + &Cancel + 取消(&C) + + + + Choose a filename to save under + 选择一个文件来保存 + + + + QtiPlot - Enter rows number + QtiPlot - 输入行号 + + + + Rows + + + + + + QtiPlot - Delete rows + QtiPlot - 删除行 + + + + Start row + 起始行 + + + + End row + 终止行 + + + + QtiPlot - Enter columns number + QtiPlot - 输入列号 + + + + Columns + + + + + + + + + + + + + + + + QtiPlot - Column selection error + QtiPlot - 列选择错误 + + + + + + + + Please select a column first! + 请先选择一列! + + + + Please select two columns for this operation! + 请为此操作选择两列! + + + + Please select exactly one columns for this operation! + 请为此操作选择恰好一列! + + + + + Please select two columns for this operation: + the first represents the signal and the second the response function! + 请为此操作选择两列: +第一列代表信号第二列代表函数! + + + + QtiPlot - Row selection error + QtiPlot - 行选择错误 + + + + Please select a row first! + 请先选择一行! + + + + + &Line + 线状图(&L) + + + + + + + &Scatter + 散点图(&S) + + + + + Line + S&ymbol + 线状图+符号(&y) + + + + + Vertical &Drop Lines + 垂线图(&D) + + + + + &Spline + 齿形图(&S) + + + + + &Vertical Steps + 垂直阶梯图(&V) + + + + + &Horizontal Steps + 水平阶梯图(&H) + + + + + + + &Columns + 柱状图(&C) + + + + + &Rows + 水平柱状图(&R) + + + + + &Area + 面积图(&A) + + + + + &Pie + 饼状图(&P) + + + 3D Ribbo&n + 三维带状图(&n) + + + 3D &Bars + 三维棒状图(&B) + + + 3&D Scatter + 三维散点图(&D) + + + 3D &Trajectory + 三维轨线(&T) + + + + + &Histogram + 直方图(&H) + + + &Stacked Histograms + 堆叠直方图(&S) + + + + + + + + + Cu&t + 剪切(&t) + + + + + + + + + + + &Copy + 复制(&C) + + + + + Past&e + 粘贴(&e) + + + + + + &X + &X + + + + + + &Y + &Y + + + + + + &Z + &Z + + + + + + &Label + 标签(&L) + + + + + &None + 无(&N) + + + + + + X E&rror + X误差(&r) + + + + + + Y &Error + Y误差(&E) + + + + + Set As + 设置为 + + + + &Fill Column With + 填充列(&F) + + + + &Column + 列(&C) + + + + + + + Clea&r + 清除(&c) + + + + + + + + &Delete + 删除(&D) + + + + + &Insert + 插入(&I) + + + + &Ascending + 升序(&A) + + + + &Descending + 降序(&D) + + + + Sort Colu&mn + 按列排序(&m) + + + Vectors &XYXY + 矢量图&XYXY + + + + + + + &Vertical 2 Layers + 垂直排列2图层(&V) + + + + + + + &Horizontal 2 Layers + 水平排列2图层(&H) + + + + + + + &4 Layers + 4图层(&4) + + + + + + + &Stacked Layers + 堆叠图层(&S) + + + + You need to select at least one Y column for this operation! + 你需要为此操作选择至少一个Y列! + + + + + + You need at least two columns for this operation! + 你需要为此操作选择至少两列! + + + + Y2 Axis Title + Y2轴标题 + + + + Not available for empty 3D surface plots! + 空的3D曲面图绘制是无效的! + + + + Set Display Range + 设置显示范围 + + + + + + + <h4>There are no plot layers available in this window.</h4> + <h4>在此窗口没有有效的绘图图层。</h4> + + + + + This will modify the data in the worksheets! +Are you sure you want to continue? + 这会改动工作表中的数据! +你确定你想继续吗? + + + + + Continue + 继续 + + + + + Cancel + 取消 + + + + Could not write to file: <h4>%1</h4><p>Please verify that you have the right to write to this location or that the file is not being used by another application! + 无法写入文件: <h4> %1</h4><p>请保证你在这个位置有写权限或者这个文件不在被别的程序所使用! + + + + Sorry, there are no results to display! + 对不起,没有结果可以显示! + + + + There are no plot layers available in this window! + 在此窗口没有有效的绘图图层! + + + + + + There are no layers available on this plot. Operation aborted! + 此绘图上没有有效图层。操作中止! + + + + QtiPlot - Insert image from file + QtiPlot - 从文件插入图像 + + + + There are no plot layers available in this window. + 在此窗口没有有效的绘图图层。 + + + + QtiPlot - Duplicate window error + QtiPlot - 复制窗口错误 + + + There are no windows available in this project! + 此项目中没有有效窗口! + + + + QtiPlot - Duplicate error + QtiPlot - 复制错误 + + + + Empty 3D surface plots cannot be duplicated! + 空的3D曲面图不可复制! + + + + + + Released + 发布 + + + + About QtiPlot + 关于QtiPlot + + + + &Translate + 翻译(&T) + + + + Vie&w + 视图(&w) + + + + &Palette + 调色板(&P) + + + + &Convert to Spreadsheet + 转换为电子表格(&C) + + + + &Folders + 文件夹(&F) + + + + &Cascade + 层叠(&C) + + + + &Tile + 平铺(&T) + + + + + + Close &Window + 关闭窗口(&W) + + + + + More windows... + 更多窗口... + + + + &View Pixel Line profile + 查看像素谱线轮廓(&V) + + + + &Intensity Matrix + 强度矩阵(&I) + + + + &Cut + 剪切(&C) + + + + + + + &Properties... + 属性(&P)... + + + + Please use the project explorer to select a window! + 请使用项目浏览器选择一个窗口! + + + + Normal + 普通 + + + + Save changes to project: <p><b> %1 </b> ? + 保存变动到项目<p><b> %1 </b>? + + + + Yes + + + + + No + + + + + + &Show All Windows + 显示所有窗口(&S) + + + + + &Hide All Windows + 隐藏所有窗口(&H) + + + + + + &Delete Selection + 删除所选(&D) + + + + + New &Window + 新建窗口(&W) + + + + + New F&older + 新建文件夹(&o) + + + + Auto &Column Width + 自动列宽(&C) + + + + &Delete Window + 删除窗口(&D) + + + + + + &Rename Window + 重命名窗口(&R) + + + + &Print Window + 打印窗口(&P) + + + + D&epending Graphs + 依赖的图像(&e) + + + + D&epending 3D Graphs + 依赖的3D图像(&e) + + + + + + D&epends on + 依赖(&e) + + + + Function + 函数 + + + + Re&move Pie Curve + 移除饼状图曲线(&m) + + + + Anal&yze + 分析(&y) + + + + + &Paste Layer + 粘贴图层(&P) + + + + &Paste Text + 粘贴文本(&P) + + + + &Paste Tex Formula + 粘贴TeX方程式(&P) + + + + &Paste Image + 粘贴图像(&P) + + + + &Paste Rectangle + 粘贴矩形(&P) + + + + &Paste Ellipse + 粘贴椭圆(&P) + + + + &Paste Line/Arrow + 粘贴线/箭头(&P) + + + + + + &Layer + 图层(&L) + + + + + + &Window + 窗口(&W) + + + + E&xport + 导出(&x) + + + + &Print + 打印(&P) + + + + P&roperties... + 属性(&r)... + + + &Delete Layer + 删除图层(&D) + + + + &Copy Page + 复制页(&C) + + + + E&xport Page + 导出页(&x) + + + + &Matrix... + 矩阵(&M)... + + + + Choose &Data Set... + 选择数据集(&D)... + + + + Choose &Matrix... + 选择矩阵(&M)... + + + + C&lear + 清除(&l) + + + + &Copy Graph + 复制图像(&C) + + + + &Export + 导出(&E) + + + + + + + &Paste + 粘贴(&P) + + + + + &Insert Row + 插入行(&I) + + + + &Insert Column + 插入列(&I) + + + + + &Delete Rows + 删除行(&D) + + + + &Delete Columns + 删除列(&D) + + + + &Delete Row + 删除行(&D) + + + + Clea&r Row + 清除行(&r) + + + + Clea&r Rows + 清除行(&r) + + + + Choose the location of the QtiPlot help folder! + 选择QtiPlot帮助文件夹的路径! + + + + QtiPlot - index.html File Not Found! + QtiPlot - index.html文件没找到! + + + + There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! + 这个文件夹里面没有叫做<b>index.html</b>的文件。<br>请另选一个文件夹! + + + + + + QtiPlot - Help Files Not Found! + QtiPlot - 帮助文件没找到! + + + + + The manual can be downloaded from the following internet address: + 手册可以从以下网址下载: + + + + + QtiPlot - Help Profile Not Found! + QtiPlot - 帮助没找到! + + + + + The assistant could not start because the file <b>%1</b> was not found in the help file directory! + 助手无法启动因为文件<b>%1</b>不在帮助文件的目录中! + + + + + This file is provided with the QtiPlot manual which can be downloaded from the following internet address: + 这个文件随同QtiPlot手册提供,可以在以下网址下载: + + + + Please indicate the location of the help file! + 请指示帮助文件的位置! + + + + QtiPlot - Edit function + QtiPlot - 编辑函数 + + + + QtiPlot - Set the number of pixels to average + QtiPlot - 设置象素值为平均 + + + + Number of averaged pixels + 平均象素值 + + + + You must have more than one layer in the active window! + 在一个活动窗口你需要超过一个图层! + + + + You must have more than one dataset in the active layer! + 在一个活动图层你需要超过一个数据集! + + + + QtiPlot - Guess best origin for the new layer? + QtiPlot - 猜测新图层的最佳来源? + + + + Do you want QtiPlot to guess the best position for the new layer? + Warning: this will rearrange existing layers! + 你希望QtiPlot猜测新图层的最佳位置吗? +警告:这会重排已存在的图层! + + + + &Guess + 猜测(&G) + + + + &Top-left corner + 左上角(&T) + + + + Curve + 曲线 + + + + Integration of %1 from zero is + %1从0开始的积分 + + + + + + + + Please select a 'Y' column first! + 请先选择一个Y列! + + + + + Shared A&xes Panel + + + + + + + + + + File %1 contains only %2 sheets! + 文件%1只包含%2表单! + + + + Imported sound file + 导入声音文件 + + + + This is not a PCM type WAV file, operation aborted! + 这不是一个PCM类型的WAV文件,操作中止! + + + + PCM + PCM + + + + Left + + + + + Right + + + + + Data + 数据 + + + + Channels + 通道 + + + + Sample Rate + 采样率 + + + + Byte Rate + 比特率 + + + + Block Align + 块对齐 + + + + Bits Per Sample + 采样位数 + + + + Presentation Preview + 演示预览 + + + + Paste Selection as Te&xt + 粘贴所选为文本(&x) + + + + Print preview of window: + 窗口打印预览: + + + + There are no windows available in this folder! + 目录中没有可用的窗口! + + + + S&ubtract + + + + + Export + 导出 + + + + &Indexed Colors + 索引色彩(&I) + + + + Pale&tte + 调色板(&t) + + + + Integration of %1 + %1的积分 + + + + Area + 面积 + + + + + Linear Regression of %1 + %1线性回归 + + + + + Slope + 斜率 + + + + Intercept + 截止 + + + + + Chi^2 + Chi^2 + + + + + R^2 + R^2 + + + + + Add &Custom Script Action... + 添加自定义脚本动作(&C)... + + + + + New &Project + 新建项目(&P) + + + + + Ctrl+N + Ctrl+N + + + + + New &Graph + 新建绘图(&G) + + + + + Ctrl+G + Ctrl+G + + + + + New &Note + 新建笔记(&N) + + + + + New &Table + 新建表格(&T) + + + + + Ctrl+T + Ctrl+T + + + + + New &Matrix + 新建矩阵(&M) + + + + + Ctrl+M + Ctrl+M + + + + + New &Function Plot + 新建函数绘图(&F) + + + + + Ctrl+F + Ctrl+F + + + + + New 3D &Surface Plot + 新建三维曲面绘图(&S) + + + + + Ctrl+ALT+Z + Ctrl+ALT+Z + + + &Open + 打开(&O) + + + + + Ctrl+O + Ctrl+O + + + + + Ctrl+Shift+E + Ctrl+Shift+E + + + + + Open ODF Spreads&heet... + 打开ODF工作表(&h)... + + + Open Image &File + 打开图象文件(&F) + + + + + Ctrl+I + Ctrl+I + + + + + Import I&mage... + 导入图像(&m)... + + + + + &Save Project + 保存项目(&S) + + + + + Ctrl+S + Ctrl+S + + + + + Save Project &As... + 项目另存为(&A)... + + + + + Ctrl+Shift+S + Ctrl+Shift+S + + + + Open Temp&late... + 打开模板(&l)... + + + + + Save As &Template... + 另存为模板(&T)... + + + + Save Note As... + 笔记另存为... + + + + + &Import ASCII... + 导入ASCII(&I)... + + + + + &Sound (WAV)... + 导入WAV波形文件(&S)... + + + + + &Undo + 撤销(&U) + + + + + Ctrl+Z + Ctrl+Z + + + + + &Redo + 重做(&R) + + + + + &Duplicate + 复制(&D) + + + + + Ctrl+Alt+D + Ctrl+Alt+D + + + + + Cu&t Selection + 剪切所选(&t) + + + + + Ctrl+X + Ctrl+X + + + + + &Copy Selection + 复制所选(&C) + + + + + Ctrl+C + Ctrl+C + + + + + &Paste Selection + 粘贴所选(&P) + + + + + Ctrl+V + Ctrl+V + + + + + Del + delete key + 删除 + + + + + Ctrl+E + Ctrl+E + + + + + Add La&yer + 添加图层(&y) + + + + + ALT+L + ALT+L + + + + + Arran&ge Layers + 排列图层(&g) + + + + + Shift+A + Shift+A + + + + + + Automatic Layout + 自动布局 + + + + + &Current + 当前(&C) + + + + + + + Ctrl+Alt+G + Ctrl+Alt+G + + + + + Alt+X + Alt+X + + + + + Create Open &Document Presentation... + 创建Open Document演示(&D)... + + + + + &Export PDF + 导出PDF(&E) + + + + + Ctrl+Alt+P + Ctrl+Alt+P + + + + + Ctrl+P + Ctrl+P + + + Print Pre&view + 打印预览(&v) + + + + + Print All Plo&ts + 打印所有绘图(&t) + + + E&xport ASCII + 导出ASCII文件(&x) + + + + + &Quit + 退出(&Q) + + + + + &Open... + 打开(&O)... + + + + + Open Image &File... + + + + + + &Print... + + + + + + Print Pre&view... + 打印预览(&v)... + + + + + E&xport ASCII... + + + + + + Ctrl+Q + Ctrl+Q + + + + + Clear &Log Information + 清除日志信息(&L) + + + + + Delete &Fit Tables + 删除拟合表格(&F) + + + + + Plot &Wizard + 绘图向导(&W) + + + + + Ctrl+Alt+W + Ctrl+Alt+W + + + + + &Preferences... + 选项(&P)... + + + + + Add/Remove &Curve... + 添加/删除曲线(&C)... + + + + + ALT+C + ALT+C + + + + + Add &Error Bars... + 添加误差棒(&E)... + + + + + Ctrl+B + Ctrl+B + + + + + Add &Function... + 添加函数(&F)... + + + + + + + Ctrl+Alt+F + Ctrl+Alt+F + + + + + &Rescale to Show All + 重缩放显示所有(&R) + + + + + + Ctrl+Shift+R + Ctrl+Shift+R + + + + + Zoom &In/Out and Drag Canvas + 放大缩小拖动画布(&I) + + + + + Zoom/Drag Canvas &Horizontally + 水平缩放/拖动(&H) + + + + + Zoom/Drag Canvas &Vertically + 垂直缩放/拖动(&V) + + + + + New &Legend + 新建图例(&L) + + + + + Ctrl+L + Ctrl+L + + + + + Add Time Stamp + 添加时间标记 + + + + + Ctrl+ALT+T + Ctrl+ALT+T + + + + + Add &Image + 添加图像(&I) + + + + + ALT+I + ALT+I + + + + + Stack &Bar + 堆栈棒状图(&B) + + + + + Stack &Column + 堆栈列(&C) + + + + + Vectors XY&AM + 矢量图XY&AM + + + + &Vectors &XYXY + 矢量图&XYXY + + + + + &Stacked Histogram + 堆叠直方图(&S) + + + + + Stem-and-&Leaf Plot + 茎叶图(&L) + + + + + + + &Custom Layout... + + + + + + D&ouble-Y + 双Y轴图(&o) + + + + + &Zoom + 缩放(&Z) + + + + + &Waterfall Plot + 瀑布图(&W) + + + + + E&xtract to Graphs + 提取至绘图(&x) + + + + Extract to &Layers + 提取至层(&L) + + + + + Add Inset Layer + 添加浮动层 + + + + + &Ribbon + 带状图(&R) + + + + + &Bars + 棒状图(&B) + + + + + &Trajectory + 轨线(&T) + + + + + Statistics on &Columns + 统计列(&C) + + + + + Statistics on &Rows + 统计行(&R) + + + + + &Integrate + 积分(&I) + + + + + Integr&ate Function... + 函数积分(&a)... + + + + + Inte&rpolate ... + 插值(&r)... + + + + + &Low Pass... + 低通(&L)... + + + + + &High Pass... + 高通(&H)... + + + + + &Band Pass... + 带通(&B)... + + + + + &Band Block... + 带阻(&B)... + + + + + &FFT... + &FFT... + + + + + &Savitzky-Golay... + Savitzky-Golay(&S)... + + + + + &FFT Filter... + FFT滤波器(&F)... + + + + + Moving Window &Average... + 平均移动窗口(&A)... + + + + + &Lowess... + 局部加权回归(&L)... + + + + + &Differentiate + 微分(&D) + + + + + Fit Slop&e + 拟合斜率(&e) + + + + + Fit &Linear + 线性拟合(&L) + + + + + Fit &Polynomial ... + 多项式拟合(&P)... + + + + + &First Order ... + 一阶(&F)... + + + + + &Second Order ... + 二阶(&S)... + + + + + &Third Order ... + 三阶(&T)... + + + + + Fit Exponential Gro&wth ... + 指数增益拟合(&w)... + + + + + Fit &Boltzmann (Sigmoidal) + 波尔兹曼(S型)拟合(&B) + + + + + Fit &Gaussian + 高斯拟合(&G) + + + + + Fit Lorent&zian + 洛仑兹拟合(&z) + + + + + Fit &Wizard... + 拟合向导(&W)... + + + + + Ctrl+Y + Ctrl+Y + + + + + &Plot ... + 绘图(&P)... + + + + + &Scales... + 比例(&S)... + + + + + &Axes... + 轴(&A)... + + + + + &Grid ... + 网格(&G)... + + + + + &Title ... + 标题(&T)... + + + + + Column &Options ... + 列选项(&O)... + + + + + Ctrl+Alt+O + Ctrl+Alt+O + + + + + Set Column &Values ... + 设置列值(&V)... + + + + + + + Alt+Q + Alt+Q + + + + + &Extract Data... + + + + + + Recalculate + 重新计算 + + + + + + + Ctrl+Return + Ctrl+Return + + + + + &Hide Selected + 隐藏所选(&H) + + + + + Sho&w All Columns + 显示所有列(&w) + + + + + &Swap columns + 交换列(&S) + + + + + Move &Right + 右移(&R) + + + + + Move &Left + 左移(&L) + + + + + Move to F&irst + 移至开头(&i) + + + + + Move to Las&t + 移至末尾(&t) + + + + + Ad&just Column Width + 调整列宽(&j) + + + + + &Columns... + 列(&C)... + + + + + &Rows... + 行(&R)... + + + + + &Delete Rows Interval... + 删除行间隔(&D)... + + + + + &Upward + 向上(&U) + + + + + &Downward + 向下(&D) + + + + + &About QtiPlot + 关于QtiPlot(&A) + + + + + F1 + F1 + + + + + Ctrl+H + Ctrl+H + + + + + &Choose Help Folder... + 选择帮助文件夹(&C)... + + + + + Ctrl+W + Ctrl+W + + + + + + Add Column + 添加列 + + + + + &Go to Row... + 跳转至行(&G)... + + + + + Go to Colum&n... + 跳转至列(&n)... + + + + + Ctrl+Alt+C + Ctrl+Alt+C + + + + + Clear + 清除 + + + + + &Remove Layer + 移除图层(&R) + + + + + Alt+R + Alt+R + + + + + Window &Geometry... + 窗口几何属性(&G)... + + + + + + + &Hide Window + 隐藏窗口(&H) + + + + + + + Ctrl+Alt+H + Ctrl+Alt+H + + + + + &View Pixel Line Profile + 查看像素谱线轮廓(&V) + + + + + &Intensity Table + 强度表格(&I) + + + + + + + &Properties + 属性(&P) + + + + + &Activate Window + 激活窗口(&A) + + + + + Mi&nimize Window + 最小化窗口(&n) + + + + + Ma&ximize Window + 最大化窗口(&x) + + + + + Re&size Window... + 调整窗口尺寸(&s)... + + + + + &Surface... + 曲面图(&S)... + + + + + &Data Set... + 数据集(&D)... + + + + + Set &Properties... + 设置属性(&P)... + + + + + Set &Dimensions... + 设置维度(&D)... + + + + + Ctrl+D + Ctrl+D + + + + + Set &Values... + 设置值(&V)... + + + + + &Image Plot + 图像绘制(&I) + + + + + &Image Profiles + 图片简介(&I) + + + + + &Transpose + 转置(&T) + + + + + Flip &V + V型翻转(&V) + + + + Ctrl+Shift+V + Ctrl+Shift+V + + + + + Flip &H + H型翻转(&H) + + + + Ctrl+Shift+H + Ctrl+Shift+H + + + + + R&otate 90 + 旋转90(&o) + + + + + Rotate &-90 + 旋转-90(&-) + + + + Ctrl+Alt+R + Ctrl+Alt+R + + + + + &Invert + 求逆(&I) + + + + + &Determinant + 秩(&D) + + + + + &Image mode + 图像模式(&I) + + + + Ctrl+Shift+I + Ctrl+Shift+I + + + + + &Data mode + 数据模式(&D) + + + + Ctrl+Shift+D + Ctrl+Shift+D + + + + + Show &X/Y + 显示X/Y(&X) + + + + Ctrl+Shift+X + Ctrl+Shift+X + + + + + Show &Column/Row + 显示列/行(&C) + + + + Ctrl+Shift+C + Ctrl+Shift+C + + + + + &Straight Line... + + + + + + &Reference Data... + + + + + + Commen&t Selection + + + + + + &Uncomment Selection + + + + + Waterfall Plot + + + + + Comment Selection + + + + + Ctrl+Shift+O + + + + + Uncomment Selection + + + + + Ctrl+Shift+U + + + + + Execute Selected Lines + + + + + Zoom In/Out and Drag Canvas Horizontally + 横向缩放或移动画布 + + + + Zoom In/Out and Drag Canvas Vertically + 纵向缩放或移动画布 + + + + can be any .qti, qti.gz, .ods, .opj, .ogm, .ogw, .ogg, .py, .xls or ASCII file + 可以为任何.qti, qti.gz, .ods, .opj, .ogm, .ogw, .ogg, .py, .xls 或者ASCII文件 + + + + + Set Precision %1 digits + 设置精度为%1小数 + + + + Choose custom user interface + 选择自定义用户界面 + + + + Custom user interfaces can be created using the QtDesigner application provided by the Qt framework + 自定义用户界面可以用Qt framework提供的QtDesigner创建 + + + + For more details about how to use .ui files in your Python scripts please read the PyQt4 documentation + 关于如何在Python脚本里面使用.ui文件的更多详细资料请参阅PyQt4手册 + + + + + + &Gray Scale + 灰阶(&G) + + + + + &Default + 默认(&D) + + + + + &Rainbow + 彩虹(&R) + + + + + &Custom + 自定义(&C) + + + + + &Export Image ... + 导出图象(&E)... + + + + + + + &Direct + 直接(&D) + + + + + &XYZ Columns + &XYZ列 + + + + + &YXZ Columns + &YXZ列 + + + + &Forward FFT + 正FFT(&F) + + + + &Inverse FFT + 逆FFT(&I) + + + + Convert to &Matrix + 转换为矩阵(&M) + + + + + Dra&g Curve + 移动曲线(&g) + + + + &Import + 导入数据(&I) + + + + You must select a single Y column that has an associated X column! + 你需要选择仅一个与X列关联的Y列! + + + + You must select exactly one Z column! + 你必须选择仅一个Z列! + + + + Open ODF Spreadsheet File + 打开ODF工作表文件 + + + + QtiPlot was built without ODF spreadsheet support! + 此QtiPlot没有ODF支持! + + + + Open File + 打开文件 + + + + + Time + 时间 + + + + &Save + 保存(&S) + + + + + Open Exce&l ... + 打开Excel(&l)... + + + + + &Close + 关闭(&C) + + + + + 3D &Wire Frame + 三维线框(&W) + + + + + 3D &Hidden Line + 三维隐藏线(&H) + + + + + 3D &Polygons + 三维多边形(&P) + + + + + 3D Wire &Surface + 三维线状曲面图(&S) + + + + Contour - &Color Fill + 等值线 - 色彩填充(&C) + + + + + Contour &Lines + 等值线图(&L) + + + + + &Gray Scale Map + 灰阶表(&G) + + + + + Sort Ta&ble + 表排序(&) + + + + + Sort Columns + 列排序 + + + + + Co&rrelate + 相关(&r) + + + + + &Autocorrelate + 自动相关(&A) + + + + + &Convolute + 卷积(&C) + + + + + &Deconvolute + 反卷积(&D) + + + + + &Horizontal + 水平(&H) + + + + + &Vertical + 垂直(&V) + + + + + Ro&w Numbers + 行号(&w) + + + + + &Random Values + 随机数(&R) + + + + + &Frequency Count ... + 频数统计(&F)... + + + + + &Read Only + 只读(&R) + + + + + &Disregard + 忽略该列(&D) + + + + + &Box Plot + 箱形图(&B) + + + + + &Gaussian... + 高斯(&G)... + + + + + &Lorentzian... + 洛仑兹(&L)... + + + + + Search for &Updates + 搜索更新(&U) + + + + + &QtiPlot Homepage + QtiPlot主页(&Q) + + + + QtiPlot &Forums + QtiPlot论坛(&F) + + + + + Report a &Bug + 报告BUG(&B) + + + + + Download &Manual + 下载手册(&M) + + + + + &Translations + 语言包(&T) + + + + + Make a &Donation + 捐赠(&D) + + + + + Technical &Support + 技术支持(&S) + + + + + Scripting &language + 脚本语言(&l) + + + + + &Restart scripting + 重新运行脚本(&R) + + + + + E&xecute + 执行(&x) + + + + + Ctrl+J + Ctrl+J + + + + + Execute &All + 全部执行(&A) + + + + + Ctrl+Shift+J + Ctrl+Shift+J + + + + + &Evaluate Expression + 计算表达式(&E) + + + + + Show Line &Numbers + 显示行号(&N) + + + + + &Replace... + 替换(&R)... + + + + + &Script Window + 脚本窗口(&S) + + + + + &Plot details... + 绘图详情(&P)... + + + + + &Worksheet + 工作表(&W) + + + + + &Reset to Full Range + 重置到全部范围(&R) + + + + + Edit &Range... + 编辑范围(&R)... + + + + + &Hide + 隐藏(&H) + + + + + Hide &Other Curves + 隐藏其他曲线(&O) + + + + + &Show All Curves + 显示所有曲线(&S) + + + &Edit Function... + 编辑函数(&E)... + + + + + &Toolbars... + 工具栏(&T)... + + + + + Ctrl+Shift+T + Ctrl+Shift+T + + + + + Bold + 粗体 + + + + + Italic + 斜体 + + + + Superscript + 上标 + + + + Subscript + 下标 + + + + + Underline (Ctrl+U) + 下划线 (Ctrl+U) + + + + + Ctrl+U + Ctrl+U + + + + + + + Greek + 希腊字母 + + + + + Mathematical Symbols + 数学符号 + + + + Increase Precision + 增加精度 + + + + Decrease Precision + 降低精度 + + + + Open a new project + 打开一个新项目 + + + + Append a project to the current folder + 在当前目录添加一个项目 + + + + Ctrl+Alt+A + Ctrl+Alt+A + + + New Fol&der + 新建文件夹(&d) + + + + Create a new folder + 创建新文件夹 + + + + Create an empty 2D plot + 创建一个空2D绘图 + + + + Create an empty note window + 创建一个空笔记窗口 + + + + New table + 新建表格 + + + + New matrix + 新建矩阵 + + + + Create a new 2D function plot + 创建一个新的2D函数绘图 + + + + Create a new 3D surface plot + 创建一个新的3D曲面图 + + + + Open project + 打开项目 + + + + Open Excel + 打开Excel文档 + + + + Open ODF Spreadsheet + 打开ODF文档 + + + + Save project + 保存项目 + + + + Open Te&mplate... + 打开模板(&m)... + + + + Open template + 打开模板 + + + + Save window as template + 窗口另存为模板 + + + + Import data file(s) + 导入数据文件 + + + + Ctrl+K + Ctrl+K + + + + Undo changes + 撤销修改 + + + + Redo changes + 重做修改 + + + + Duplicate window + 复制窗口 + + + + Cut selection + 剪切所选 + + + + Copy selection + 复制所选 + + + + Paste selection + 粘贴所选 + + + + Delete selection + 删除所选 + + + + Project &Explorer + 项目浏览器(&E) + + + + Show project explorer + 显示项目浏览器 + + + + Results &Log + 结果日志(&L) + + + + Show analysis results + 显示分析结果 + + + + &Undo/Redo Stack + 撤销/重做堆栈(&U) + + + + Show available undo/redo commands + 显示可用撤销/重做命令 + + + + &Console + 控制台(&C) + + + + Show Scripting console + 显示脚本控制台 + + + + Script Window + 脚本窗口 + + + + Add Layer + 添加图层 + + + + Arrange Layers + 排列图层 + + + + Export current graph + 导出当前绘图 + + + + Export all graphs + 导出全部绘图 + + + + Export to PDF + 导出到PDF + + + + Print window + 打印窗口 + + + + Print preview + 打印预览 + + + + Add curve to graph + 把曲线添加到绘图 + + + + Add Error Bars... + 添加误差棒... + + + + Add Function... + 添加函数... + + + + Best fit + 最佳拟合 + + + + Add new legend + 添加新图例 + + + + Date & time + 日期 & 时间 + + + + Add Image + 添加图像 + + + + Plot as line + 绘制为线 + + + + Plot as symbols + 绘制为符号 + + + + Plot as line + symbols + 绘制为线 + 符号 + + + + Plot with vertical bars + 用垂直棒绘制 + + + + Plot with horizontal bars + 用水平棒绘制 + + + + Plot stack bar + 绘制堆栈棒 + + + + Plot stack column + 绘制堆栈列 + + + + Plot area + 绘图区域图 + + + + Plot pie + 绘制饼状图 + + + + &Vectors XYXY + 矢量图XYXY(&V) + + + + Vectors XYXY + 矢量图XYXY + + + + Vectors XYAM + 矢量图XYAM + + + + Stem-and-Leaf Plot + 绘制茎叶图 + + + + Double Y Axis + 双Y轴 + + + + Zoom + 缩放 + + + + Extract to Graphs + 提取至绘图 + + + + Extract to Layer&s + 提取至图层(&s) + + + + Extract to Layers + 提取至图层 + + + + Plot 3D ribbon + 绘制三维带状图 + + + + Plot 3D bars + 绘制三维棒状图 + + + + Plot 3D scatter + 绘制三维散点图 + + + + Plot 3D trajectory + 绘制三维轨线 + + + + Contour + &Color Fill + 等值线 + 色彩填充(&C) + + + + Contour Lines + Color Fill + 等值线图 + 色彩填充 + + + + Contour Lines + 等值线图 + + + + Gray Scale Map + 灰阶表 + + + + Selected columns statistics + 选中列统计 + + + + Selected rows statistics + 选中行统计 + + + + Hide selected columns + 隐藏所选列 + + + + Show all table columns + 显示表格所有列 + + + + Swap selected columns + 交换选中列 + + + + Move Right + 右移 + + + + Move Left + 左移 + + + + Move to First + 移至开头 + + + + Move to Last + 移至末尾 + + + + Move current row upward + 上移当前行 + + + + Move current row downward + 下移当前行 + + + + Set optimal column width + 设置最佳列宽 + + + + More Windows... + 更多窗口... + + + + Set Matrix Values + 设置矩阵值 + + + + Image Plot + 图像绘制 + + + + Image Profiles + 图片简介 + + + + Rotate 90 Clockwise + 顺时针旋转90 + + + + Rotate 90 Counterclockwise + 逆时针旋转90 + + + + Flip Vertically + 垂直翻转 + + + + Flip Horizontally + 水平翻转 + + + + Fill selected columns with row numbers + 用行号填充选中列 + + + + Fill selected columns with random numbers + 用随机数填充选中列 + + + + Set column as X + 设置列为X + + + + Set column as Y + 设置列为Y + + + + Set column as Z + 设置列为Z + + + + Set as Y Error Bars + 设置为Y误差棒 + + + + Set as Labels + 设置为标签 + + + + Disregard Columns + 忽视列 + + + + Box and whiskers plot + 箱形图 + + + + Visit QtiPlot &Forums + 访问QtiPlot论坛(&F) + + + + Show find dialog + 显示查找对话框 + + + + Find Next + 查找下一条 + + + + Find Previous + 查找上一条 + + + + Show replace dialog + 显示替换对话框 + + + + Ctrl+R + Ctrl+R + + + + Disable &tools + 禁用工具(&t) + + + + Pointer + 指针 + + + + Zoom In (Shift++) or Out (-) and Drag Canvas + 成比例缩放或移动画布 + + + + Zoom In + 放大 + + + + Zoom &Out + 缩小(&O) + + + + Zoom Out + 缩小 + + + + Data reader + 数据读取器 + + + + Select data range + 选择数据范围 + + + + Screen reader + 屏幕读取器 + + + + Draw Data Points + 画数据点 + + + + Move data points + 移动数据点 + + + + Drag Curve + 移动曲线 + + + + Remove data points + 移除数据点 + + + + Add Text + 添加文本 + + + + Add Equation + 添加公式 + + + + Add Rectangle + 添加矩形 + + + + Add Ellipse/Circle + 添加椭圆/圆 + + + + Draw arrow + 画箭头 + + + + Draw line + 画线 + + + + + + + Box + 箱形框 + + + + + + Frame + 框架 + + + + &Frame + 框架(&F) + + + + + No Axes + 无轴 + + + + + No axes + 无轴 + + + + Front grid + 前栅格 + + + + Back grid + 后栅格 + + + + Right grid + 右栅格 + + + + Left grid + 左栅格 + + + + Ceiling grid + 顶栅格 + + + + Floor grid + 底栅格 + + + + + + + Wireframe + 线框架 + + + + + Hidden Line + 隐藏线 + + + + + Hidden line + 隐藏线 + + + + + Polygon Only + 只有多边形 + + + + + Polygon only + 只有多边形 + + + + + Mesh & Filled Polygons + 网格&填充多边形 + + + + + Mesh & filled Polygons + 网格&填充多边形 + + + + + + + Dots + + + + + + + + Bars + + + + + + + + Cones + 圆锥体 + + + + + + + Crosshairs + 叉丝 + + + + + Floor Data Projection + 底面数据投影 + + + + + Floor data projection + 底面数据投影 + + + + + Floor Isolines + 底面等值线 + + + + + Floor isolines + 底面等值线 + + + + + Empty Floor + 空底面 + + + + + Empty floor + 空底面 + + + + + + + Animation + 动画 + + + + + + + Enable perspective + 启用透视 + + + + + + + Reset rotation + 重置旋转 + + + + + + + Fit frame to window + 使框架适合窗口 + + + + Profiles + 简介 + + + + Horizontal + 水平 + + + + Vertical + 垂直 + + + + QtiPlot - Enter the number of peaks + QtiPlot - 输入峰值数量 + + + + Peaks + + + + + Make a donation + 捐赠 + + + + show standalone scripting window + 显示独立的脚本窗口 + + + + You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://soft.proindependent.com/download.html">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. + 你正在使用演示版本的Qtiplot。它跟完全版是一致的,不过你不能保存文件,也不能一次使用超过十分钟。<br><br>如果你准备好使用完整功能版,请在<a href="http://soft.proindependent.com/individual_contract.html">订阅一个单用户带维护通知的版本。</a><br><br>QtiPlot是一个自由软件。如果你想知道如何使用,你可以免费得到<a href="http://soft.proindependent.com/download.htm">源代码</a>。尽管如此,仍然欢迎你<a href="http://soft.proindependent.com/why_donate.html">捐助</a>来支持QtiPlot未来的开发。 + + + + Memory Allocation Error + 内存分配错误 + + + + Not enough memory, operation aborted! + 内存不足,操作中止! + + + + <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> If you like it, you're using it in your work and you would like to see it constantly improved, please support its authors by making a donation.</b></font> + <font size=+2, color = darkBlue><b>QtiPlot是一个开源软件,它的开发需要上百小时的工作。<br><br>如果你喜欢它,你在你的工作中应用它,并且希望看到它稳步的改进,请通过捐献的方式支持一下它的作者。</b></font> + + + + Please support QtiPlot! + 请支持QtiPlot! + + + + <b> %1 </b>: This command line option must be used without other arguments! + <b> %1 </b>: 这个命令行选项不能和其他参数一起用! + + + + Version + 版本 + + + + Usage + 用法 + + + + options + 选项 + + + + + file + 文件 + + + + + name + 名称 + + + + Valid options are + 有效的选项是 + + + + + + + + + + + or + 或者 + + + + show about dialog and exit + 显示关于对话框并退出 + + + + start QtiPlot with the default settings + 使用默认设置启动QtiPlot + + + + show command line options + 显示命令行选项 + + + + start QtiPlot in language + 使用语言包启动QtiPlot + + + + show QtiPlot manual in a standalone window + 在一个单独的窗口显示QtiPlot手册 + + + + print QtiPlot version and release date + 打印QtiPlot版本和发行日期 + + + + execute the script file given as argument + 执行参数中给出的脚本文件 + + + + execute the script file given as argument without displying the user interface. Warning: 2D plots are not correctly handled in this functioning mode! + 执行参数中给出的脚本文件并且不显示用户界面。警告:2D绘图在这种模式下处理不正确! + + + can be any .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py or ASCII file + 可以为任何.qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py或者ASCII文件 + + + + Help + 帮助 + + + + <b> %1 </b>: Wrong locale option or no translation available! + <b> %1 </b>:错误的地区选项或者语言包不可用! + + + + <b> %1 </b> unknown command line option! + <b> %1 </b> 未知命令行选项! + + + + Type %1 to see the list of the valid options. + 键入%1来查看有效选项列表。 + + + + <b>%1</b> is a directory, please specify a file name! + <b>%1</b>是一个目录,请指定一个文件名! + + + + The file: <b>%1</b> is not a QtiPlot or Origin project file! + 文件:<b>%1</b>不是一个QtiPlot或者Origin项目文件! + + + + QtiPlot - Demo Version + QtiPlot - 演示版本 + + + You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. + 你正在使用演示版本的Qtiplot。它跟完全版是一致的,不过你不能保存文件,也不能一次使用超过十分钟。<br><br>如果你准备好使用完整功能版,请在<a href="http://soft.proindependent.com/individual_contract.html">订阅一个单用户带维护通知的版本。</a><br><br>QtiPlot是一个自由软件。如果你想知道如何使用,你可以免费得到<a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">源代码</a>。尽管如此,仍然欢迎你<a href="http://soft.proindependent.com/why_donate.html">捐助</a>来支持QtiPlot未来的开发。 + + + + QtiPlot - File backup error + QtiPlot - 文件备份错误 + + + + Cannot make a backup copy of <b>%1</b> (to %2).<br>If you ignore this, you run the risk of <b>data loss</b>. + 无法备份<b>%1</b>(至 %2)。<br>如果你忽略这个,你就处于<b>丢失数据</b>的风险中。 + + + + QtiPlot - File save error + QtiPlot - 文件保存失败 + + + + The file: <br><b>%1</b> is opened in read-only mode + 文件: <br><b>%1</b>是以只读模式打开的 + + + + Save project as + 项目另存为 + + + + + + + &Find... + 查找(&F)... + + + + Couldn't open file %1 + 不能打开文件%1 + + + + Open Excel File + 打开Excel文件 + + + + + App&end Project... + 附加项目(&e)... + + + + + Ctrl+Alt+S + Ctrl+Alt+S + + + + + 2D &Binning + 2D合并(&B) + + + + + &Regular XYZ + 正则XYZ(&R) + + + + + Find &Next + 查找下一条(&N) + + + + + F3 + F3 + + + + + Find &Previous + 查找上一条(&P) + + + + + F4 + F4 + + + + + Increase Indent + 增加缩进 + + + + + Decrease Indent + 减少缩进 + + + + + Rena&me Tab... + 重命名标签(&m)... + + + + + A&dd Tab + 添加标签(&d) + + + + + C&lose Tab + 关闭标签(&l) + + + + + Load Custom User &Interface... + 加载自定义用户界面(&I)... + + + + Save &As Project... + 另存为项目(&A)... + + + + &Delete Folder + 删除文件夹(&D) + + + + &Rename + 重命名(&R) + + + + &Windows in Active Folder + 活动文件夹内的窗口(&W) + + + + Windows in &Active Folder && Subfolders + 活动文件夹和自文件夹内的窗口(&A) + + + + &View Windows + 查看窗口(&V) + + + + Hidden + 隐藏 + + + + Name already exists! + 名称已存在! + + + + Project + 项目 + + + + + + Path + 路径 + + + + bytes + 字节 + + + + + Contents + 内容 + + + + + windows + 窗口 + + + + + folders + 文件夹 + + + + Modified + 改动的 + + + + + + Properties + 属性 + + + + New Folder + 新建文件夹 + + + + QtiPlot - Delete folder? + QtiPlot - 删除文件夹? + + + + Delete folder '%1' and all the windows it contains? + 删除文件夹'%1'和里面包含的所有窗口? + + + + + Note + 笔记 + + + + + 3D Graph + 三维绘图 + + + + Status + 状态 + + + + QtiPlot - No match found + QtiPlot - 找不到匹配项 + + + + Sorry, no match found for string: '%1' + 对不起,没有找到匹配的字符串: '%1' + + + + Cannot move an object to itself! + 不能把一个对象移到自身上! + + + + Cannot move a parent folder into a child folder! + 不能把一个父文件夹移动到资文件夹内! + + + + Skipped moving folder + 跳过移动文件夹 + + + + + The destination folder already contains a folder called '%1'! Folder skipped! + 目的文件夹已经含有一个叫做'%1'的文件夹!文件夹跳过! + + + + + + Error + 错误 + + + + QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! + QtiPlot尝试下载最新更新的必要信息。请修改你的防火墙设置来允许QtiPlot连接到英特网! + + + + Do you wish to continue? + 你想继续吗? + + + + QtiPlot - HTTP get version file + QtiPlot - HTTP获取版本文件 + + + + Error while fetching version file with HTTP: %1. + HTTP取版本文件时出错: %1。 + + + + QtiPlot - Updates Available + QtiPlot - 有更新 + + + + There is a newer version of QtiPlot (%1) available for download. Would you like to download it? + 有更新版本的QtiPlot (%1)等待下载。你希望下载它吗? + + + + QtiPlot - No Updates Available + QtiPlot - 没有更新 + + + + No updates available. Your current version %1 is the last version available! + 没有更新。你现在的版本%1就是最新版本! + + + + This will clear the contents of all the data associated with the table. Are you sure? + 这会清楚表格相关的数据的所有内容。你确定? + + + + &No + 否(&N) + + + + QtiPlot - Enter row number + QtiPlot - 输入行号 + + + + Row + + + + + QtiPlot - Enter column number + QtiPlot - 输入列号 + + + + + QtiPlot was not built with Python scripting support included! + QtiPlot编译时不包含Python脚本支持! + + + + Please set a default X column for this table, first! + 请先为这个表格设置一个默认的X列! + + + + Please select a Z column for this operation! + 请为这个操作选择一个Z列! + + + + You need to define a X column first! + 首先你需要定义一个X列! + + + + You need to define a Y column first! + 首先你需要定义一个Y列! + + + + Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. + 从0.9.1版本开始QtiPlot就保存拥护定义拟合模型到不同的位置。 + + + + If you want to save your already defined models, please choose a destination folder. + 如果你想保存你已经定义的模型,请选择一个目的文件夹。 + + + + Import fit models + 导入拟合模型 + + + + Choose a directory to export the fit models to + 选择一个目录来导出拟合模型 + + + + + No Icon + 无图标 + + + + Couldn't load file: %1. +Autocompletion will not be available! + 无法加载文件:%1。 +自动完成无法使用! + + + + Please select exactly one column and more than one non empty cell! + 请选择一列和至少一个非空单元! + + + + Data set: %1 doesn't exist! + 数据集:%1不存在! + + + + Stem and leaf plot of dataset + 数据集的茎叶图 + + + + from row + 起始行 + + + + to row + 结束行 + + + + Not enough memory for this dataset! + 没有足够的内存给这个数据集! + + + + Stem + + + + + Leaf + + + + + Please confirm the stem unit! + 你确认茎单位! + + + + Data set + 数据集 + + + + stem unit + 茎单位 + + + + Stem unit + 茎单位 + + + + Leaf unit + 叶单位 + + + + Key + + + + + means + 方法 + + + + Input error: empty data set! + 输入错误:空数据集! + + + + English + 中文 + + + + Alt+C + Alt+C + + + + + + Spec&ial Bar/Column + 特定的棒/列(&i) + + + + &Add + 添加(&A) + + + + Close + 关闭 + + + + + Move Row + 移动行 + + + + ArrowMarker + + + dx + dx + + + + dy + dy + + + + angle + 角度 + + + + length + 长度 + + + + + eqn + 方程式 + + + + + y + y + + + + + x + x + + + + AssociationsDialog + + + QtiPlot - Plot Associations + QtiPlot - 绘图关联 + + + + Spreadsheet: + 数据表: + + + + Column + + + + + X + X + + + + Y + Y + + + + + xErr + xErr + + + + + yErr + yErr + + + + &Update curves + 更新曲线(&U) + + + + &OK + 确定(&O) + + + + &Cancel + 取消(&C) + + + + xEnd + xEnd + + + + yEnd + yEnd + + + + Angle + 角度 + + + + Magn. + Magnitude, vector length + Magn. + + + + AxesDialog + + + QtiPlot - General Plot Options + QtiPlot - 常规绘图选项 + + + + &Apply + 应用(&A) + + + + &OK + 确定(&O) + + + + &Cancel + 取消(&C) + + + + + From + + + + + + To + + + + + + Type + 类型 + + + linear + 线性 + + + logarithmic + 对数 + + + + Probability + 概率 + + + + Logit + 逻辑 + + + + Inverted + + + + + Show Axis &Break + 显示轴间隙(&B) + + + + Draw Break &Decoration + 绘制间断装饰(&D) + + + + Position + 位置 + + + + % of Axis Length + 轴长度的% + + + + + Width + 宽度 + + + + + + + pixels + 像素 + + + + &Log10 Scale After Break + 间断后以Log10调整(&L) + + + + Step Before Break + 间断前步长 + + + + + Guess + 猜测 + + + + Step After Break + 间断后步长 + + + + Minor Ticks Before + 次刻度之前于 + + + + Minor Ticks After + 次刻度之后于 + + + + Step + 步长 + + + + + Major Ticks + 主刻度 + + + + + Minor Ticks + 次刻度 + + + + + + Bottom + + + + + + + Left + + + + + + + Top + + + + + + + Right + + + + + Scale + 比例 + + + + Major Grids + 主栅格 + + + + Minor Grids + 次栅格 + + + + Line Color + 线颜色 + + + + Line Type + 线形 + + + + Thickness + + + + + + Axes + + + + + Additional lines + 附加线 + + + + X=0 + X=0 + + + + Y=0 + Y=0 + + + + Apply To + 应用到 + + + + This Layer + 此图层 + + + + This Window + 此窗口 + + + + + + All Windows + 所有窗口 + + + + An&tialised + 反锯齿(&) + + + + Horizontal + 水平 + + + + Vertical + 垂直 + + + + Grid + 栅格 + + + + Show + 显示 + + + + Title + 标题 + + + + Distance to axis + 到轴的距离 + + + + &Font + 字体(&F) + + + + + Format + 格式 + + + + Numeric + 数字 + + + + Text from table + 来自表格的文本 + + + + Day of the week + 周几 + + + + Month + + + + + Time + 时间 + + + + Date + 日期 + + + + Column Headings + 列头 + + + + Font + 字体 + + + + Axis &Font + 轴字体(&F) + + + + + + Color + 颜色 + + + + + + None + 不选 + + + + + Out + + + + + + In & Out + 内 & 外 + + + + + In + + + + + Hide Ticks + + + + + At Axis Begin + + + + + At Axis End + + + + + At Axis Begin & End + + + + + Labels space + 标签空间 + + + + Stand-off + 远离 + + + + Apply &to + 应用到(&t) + + + + + Axis + + + + + + Layer + 图层 + + + + + Window + 窗口 + + + + Show Labels + 显示标签 + + + + Show &backbone + 显示干线(&b) + + + + Column + + + + + Table + 表格 + + + + + Precision + 精度 + + + + Angle + 角度 + + + + For&mula + 方程式(&m) + + + + Canvas frame + 画布框架 + + + + Draw backbones + 画干线 + + + + Line Width + 线宽 + + + + Major ticks length + 主刻度长度 + + + + Minor ticks length + 次刻度长度 + + + + Set As &Default + 设为默认(&D) + + + + Apply &to... + 应用到(&t)... + + + + General + 常规 + + + + Automatic + 自动 + + + + Decimal: 10000.0 + 十进制: 10000.0 + + + + Scientific: 1e4 + 科学计数法: 1E4 + + + + Scientific: 1x10^4 + 科学计数法: 1x10^4 + + + + Engineering: 10k + 工程计数: 10k + + + + Scientific: 1·10^4 + 科学计数法: 1·10^4 + + + + + Origin + Origin + + + + QtiPlot - Formula input error + QtiPlot - 方程式输入错误 + + + + Valid variables are 'x' for Top/Bottom axes and 'y' for Left/Right axes! + 有效变量是'x'为上/下轴'y'为左/右轴! + + + + days + + + + + weeks + + + + + millisec. + 毫秒. + + + + sec. + 秒. + + + + min. + 分钟. + + + + hours + 小时 + + + + &Inverted + 逆(&I) + + + + Linear + 线性 + + + + Log10 + Log10 + + + + ln + ln + + + + Log2 + Log2 + + + + Reciprocal + 倒数 + + + + ColorBox + + + black + 黑色 + + + + red + 红色 + + + + green + 绿色 + + + + blue + 蓝色 + + + + cyan + 青色 + + + + magenta + 紫红色 + + + + yellow + 黄色 + + + + dark yellow + 深黄色 + + + + navy + 藏青色 + + + + purple + 紫红色 + + + + wine + 酒红色 + + + + olive + 橄榄色 + + + + dark cyan + 深青色 + + + + royal + 宝蓝色 + + + + orange + 橙色 + + + + violet + 紫色 + + + + pink + 粉红色 + + + + white + 白色 + + + + light gray + 浅灰色 + + + + gray + 灰色 + + + + light yellow + 浅黄色 + + + + light cyan + 浅青色 + + + + light magenta + 浅紫红色 + + + + dark gray + 深灰色 + + + + ColorButton + + Custom + 自定义 + + + + ColorMapDialog + + + QtiPlot + QtiPlot + + + + Custom Color Map + 自定义颜色表 + + + + &Apply + 应用(&A) + + + + &Close + 关闭(&C) + + + + Set Custom Palette + 设置自定义调色板 + + + + ColorMapEditor + + + Level + + + + + Color + 颜色 + + + + &Insert + 插入(&I) + + + + &Delete + 删除(&D) + + + + &Scale Colors + 色阶(&S) + + + + ColorMapPreviewDialog + + + QtiPlot - Color Map Preview Dialog + QtiPlot - 颜色表预览对话框 + + + + Colormap files + 颜色表文件 + + + + All files + 所有文件 + + + + << &Preview + << 预览(&P) + + + + + + + None + 不选 + + + + ColorPickerPopup + + + Custom + 自定义 + + + + ConfigDialog + + + The column separator can be customized. +The following special codes can be used: +\t for a TAB character +\s for a SPACE + 列分隔符可以自定义. +以下特殊代码可以用: +\t为制表符 +\s为空格 + + + + The separator must not contain the following characters: +0-9eE.+- + 分隔符不能包含以下字符: +0-9eE.+- + + + + + + Background + 背景 + + + + + Background Color + 背景颜色 + + + + + + + + Opacity + 不透明度 + + + + + Canvas Color + 画布颜色 + + + + + Border Color + 边框颜色 + + + + + + + Width + 宽度 + + + + LF (Unix) + LF (Unix) + + + + CRLF (Windows) + CRLF (Windows) + + + + CR (Mac) + CR (Mac) + + + + + + + System Locale Setting + 系统本地设置 + + + + &B + &B + + + + &It + &It + + + + + Translations + 语言包 + + + + + Help + 帮助 + + + + + Python Configuration Files + Python配置文件 + + + + QtiPlot - Choose default settings + QtiPlot - 选择默认设置 + + + + General + 常规 + + + + + Tables + 表格 + + + + + 2D Plots + 二维绘图 + + + + + 3D Plots + 三维绘图 + + + + Notes + 笔记 + + + + Fitting + 拟合 + + + + Options + 选项 + + + + Curves + 曲线 + + + + Axes + + + + + Ticks + 刻度 + + + + + + Fonts + 字体 + + + + Do not &resize layers when window size changes + 当窗口尺寸变化的时候不改变图层尺寸(&r) + + + + &Disable in-place editing + 禁用就地编辑(&D) + + + + + Length + 长度 + + + + Major Ticks + 主刻度 + + + + Minor Ticks + 次刻度 + + + + Margin + 页边距 + + + + Axes title space + 轴标题空白 + + + + Frame width + 框架宽度 + + + + Canvas Fra&me + 画布框架(&m) + + + + Show &Title + 显示标题(&T) + + + + Scale &Fonts + 缩放字体(&F) + + + + Auto&scaling + 自动缩放(&s) + + + + Antia&liasing + 反锯齿(&l) + + + + Legend display + 图例显示 + + + + + + Column name + 列名 + + + + + + Column comment + 列注释 + + + + Table name + 表名 + + + + Table legend + 表图例 + + + + + + Transparent + 透明 + + + + Axes &backbones + 轴干线(&b) + + + + Axes linewidth + 轴线宽 + + + + Left + + + + + Right + + + + + Bottom + + + + + Top + + + + + Enabled axes + 启用轴 + + + + Show + 显示 + + + + + Labels + 标签 + + + + + None + 不选 + + + + + Out + + + + + + In & Out + 内 & 外 + + + + + In + + + + + Print + 打印 + + + + Print Crop&marks + 打印截角标记(&m) + + + + &Scale layers to paper size + 缩放图层到纸张尺寸(&S) + + + + Prompt on closing + 关闭时提示 + + + + Folders + + + + + Matrices + 矩阵 + + + + &Notes + 笔记(&N) + + + + &OK + 确定(&O) + + + + &Cancel + 取消(&C) + + + + &Apply + 应用(&A) + + + + &Text Font + 文本字体(&T) + + + + &Labels Font + 标签字体(&L) + + + + A&xes Labels + 轴标签(&x) + + + + Axes &Numbers + 轴数字(&N) + + + + &Legend + 图例(&L) + + + + T&itle + 标题(&i) + + + + Prompt on &renaming tables when appending projects + 添加到项目重命名表格时提醒(&r) + + + + Application + 程序 + + + + Confirmations + 确认 + + + + + + Colors + 颜色 + + + + Numeric Format + 数字格式 + + + + File Locations + 文件位置 + + + + Language + 语言 + + + + + + + Style + 样式 + + + + + Grids + 栅格 + + + + + Ma&jor Grids + 主栅格(&j) + + + + + Mi&nor Grids + 次栅格(&n) + + + + + + Color + 颜色 + + + + + &Keep aspect ratio + 保持宽高比(&K) + + + + + New Color + + + + + Geometry + 布局 + + + + Ticks - Labels space + 刻度-标签间距 + + + + + pixels + 像素 + + + + Axis title + + + + + Default + 默认 + + + + Unit + 单位 + + + + inch + 英寸 + + + + mm + 毫米 + + + + cm + 厘米 + + + + point + + + + + pixel + 像素 + + + + Canvas Width + 画布宽 + + + + Canvas Height + 画布高 + + + + Synchronize scale &divisions + + + + + Ask before over&writing files + 覆盖文件前询问(&w) + + + + Main Font + 主字体 + + + + Choose &font + 选择字体(&f) + + + + Workspace + 工作台 + + + + Panels text + 面板文本 + + + + Panels + 面板 + + + + Save every + 保存每 + + + + &Backup project before saving + 保存项目前备份(&B) + + + + Check for new versions at startup + 启动时检查新版本 + + + + minutes + 分钟 + + + + Default scripting language + 默认脚本语言 + + + + Matrix Undo Stack Size + 矩阵撤销堆栈大小 + + + + Endline character + 行尾字符 + + + + Start New Project + 开始新项目 + + + + + Empty + + + + + Table + 表格 + + + + Matrix + 矩阵 + + + + Empty Graph + 空图 + + + + Note + 笔记 + + + + &Enable autocompletion (Ctrl+U) + 启用自动完成(&E)(Ctrl+U) + + + + Number of Decimal Digits + 小数位数 + + + + Decimal Separators + 小数分隔符 + + + + Omit &Thousands Separator + 忽略千位分隔符(&T) + + + + mu&Parser uses C locale settings + muParser使用C本地设置(&P) + + + + Clipboard Decimal Separators + 剪贴板小数分隔符 + + + + Automatically &Recalculate Column Values + 自动重计算列值(&R) + + + + &Display Comments in Header + 在头里面显示注释(&D) + + + + Default Column Separator + 默认列分隔符 + + + + + + + TAB + TAB + + + + + + + SPACE + SPACE + + + + Text + 文本 + + + + Default curve style + 默认曲线样式 + + + + Line width + 线宽 + + + + Symbol size + 符号大小 + + + + + &Load Default + + + + + Delete Color + + + + + Move Color Up + + + + + Move Color Down + + + + + Indexed Colors + + + + + Inde&xed Symbols + + + + + Move Symbol Up + + + + + Move Symbol Down + + + + + Pattern + 图案 + + + + Line style + + + + + Fill area under curve + 填充曲线下方区域 + + + + Default Line Style + + + + + Default Symbol + + + + + Edge width + + + + + &Fill Symbol + + + + + Name + 名称 + + + + Symbol + 符号 + + + + Line + 线状图 + + + + Scatter + 散点图 + + + + Line + Symbol + 线状图+符号 + + + + Vertical drop lines + 垂线图 + + + + Spline + 齿形图 + + + + Vertical steps + 垂直阶梯图 + + + + Horizontal steps + 水平阶梯图 + + + + Area + 面积 + + + + Vertical Bars + 垂直棒状图 + + + + Horizontal Bars + 水平棒状图 + + + + &Resolution + 分辨率(&R) + + + + (all data shown) + (显示所有数据) + + + + &Show Legend + 显示图例(&S) + + + + &Floor style + 底线样式(&F) + + + + Isolines + 等值线 + + + + Projection + 投影 + + + + Smoot&h Line + 平滑线(&h) + + + + O&rthogonal + 正交(&r) + + + + Lab&els + 标签(&e) + + + + &Mesh + 网格(&M) + + + + &Grid + 栅格(&G) + + + + + + &Numbers + 数字(&N) + + + + A&xes + 轴(&x) + + + + &Background + 背景(&B) + + + + Default Color Map + 默认颜色表 + + + + &Title + 标题(&T) + + + + &Axes Labels + 轴标签(&A) + + + + Autosca&ling + 自动缩放(&l) + + + + + Solid + 实心 + + + + + Dash + 虚线 + + + + + Dot + + + + + + Dash Dot + 点划线 + + + + + Dash Dot Dot + 点划线点点 + + + + + Short Dash + 短划线 + + + + + Short Dot + 短点线 + + + + + Short Dash Dot + 短点划线 + + + + Tab length (pixels) + 制表符长度(像素) + + + + Font + 字体 + + + + &Display line numbers + 显示行号(&D) + + + + Syntax Highlighting + 语法高亮 + + + + Co&mments + 注释(&m) + + + + &Keywords + 关键字(&K) + + + + &Quotations + 引用(&Q) + + + + &Functions + 函数(&F) + + + + Q&t Classes + Qt类(&t) + + + + Generated Fit Curve + 拟合生成的曲线 + + + + Uniform X Function + 统一X的函数 + + + + Points + + + + + Same X as Fitting Data + 跟拟合数据的X相同 + + + + 2 points for linear fits + 线性拟合两点 + + + + + Display Peak Curves for Multi-peak Fits + 多峰拟合显示峰值曲线 + + + + Parameters Output + 参数输出 + + + + Significant Digits + 有效数字 + + + + Write Parameters to Result Log + 参数写到结果日志 + + + + Paste Parameters to Plot + 参数粘贴到绘图上 + + + + Scale Errors with sqrt(Chi^2/doF) + 用sqrt(Chi^2/doF)调整误差 + + + + Peaks Color + 峰值颜色 + + + + Display Confirmation &Messages for Multi-peak Fits + 为多峰拟合显示确认信息(&M) + + + + QtiPlot - Import options error + QtiPlot - 导入选项错误 + + + + The separator must not contain the following characters: 0-9eE.+- + 分隔符不能包含以下字符: 0-9eE.+- + + + + + QtiPlot - index.html File Not Found! + QtiPlot - index.html没有找到! + + + + There is no file called <b>index.html</b> in folder %1.<br>Please choose another folder! + %1文件夹中没有<b>index.html</b>文件.<br>请选择另一个文件夹! + + + + Choose the location of the QtiPlot translations folder! + 选择QtiPlot语言包文件夹的位置! + + + + Choose the location of the QtiPlot help folder! + 选择QtiPlot帮助文件夹的位置! + + + + There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! + 文件夹中没有<b>index.html</b>文件.<br>请选择另一个文件夹! + + + + Choose the location of the Python configuration files! + 选择Python配置文件的位置! + + + + + QtiPlot - Folder Not Found! + QtiPlot - 文件夹未找到! + + + + The folder %1 doesn't exist.<br>Please choose another folder! + 文件夹%1不存在.<br>请选择另一个文件夹! + + + + %1 is not a folder.<br>Please choose another folder! + %1不是文件夹.<br>请选择另一个文件夹! + + + + + QtiPlot + QtiPlot + + + + You don't have read access rights to folder %1.<br>Please choose another folder! + 你没有%1文件夹的阅读权限.<br>请选择另一个文件夹! + + + + + &Internet Connection + 网络连接(&I) + + + + + &Proxy + 代理(&P) + + + + + Host + 主机 + + + + + Port + 端口 + + + + + Username + 用户名 + + + + + Password + 密码 + + + + LaTeX Compiler + LaTeX编译器 + + + + Choose the location of the LaTeX compiler! + 选择LaTeX编译器的位置! + + + + + QtiPlot - File Not Found! + QtiPlot - 文件未找到! + + + + The file %1 doesn't exist.<br>Please choose another file! + 文件%1不存在.<br>请选择另一个文件! + + + + %1 is a folder.<br>Please choose a file! + %1是文件夹.<br>请选择一个文件! + + + + You don't have read access rights to file %1.<br>Please choose another file! + 你没有%1文件的阅读权限.<br>请选择另一个文件! + + + + ContourLinesEditor + + + Level + + + + + Pen + 笔画 + + + + &Insert + 插入(&I) + + + + &Delete + 删除(&D) + + + + QtiPlot - Edit pen + QtiPlot - 编辑笔画 + + + + Color + 颜色 + + + + + + Apply to all + 应用到所有 + + + + Style + 样式 + + + + Width + 宽度 + + + + &Ok + 确定(&O) + + + + &Close + 关闭(&C) + + + + Convolution + + + Convolution + 卷积 + + + + + + + + QtiPlot + QtiPlot + + + + + + + + Error + 错误 + + + + The signal data set %1 does not exist! + 信号数据集%1不存在! + + + + The response data set %1 does not exist! + 响应数据集%1不存在! + + + + The response dataset '%1' must be less then half the size of the signal dataset '%2'! + 响应数据集'%1'必须少于信号数据集'%2'的一半! + + + + The response dataset '%1' must contain an odd number of points! + 响应数据集'%1'必须含有奇数个点! + + + + Could not allocate memory, operation aborted! + 分配内存失败,操作中止! + + + + + Index + 索引 + + + + Correlation + + + Correlation + 相关分析 + + + + + + QtiPlot + QtiPlot + + + + + + Error + 错误 + + + + + The data set %1 does not exist! + 数据集%1不存在! + + + + Error in GSL forward FFT operation! + GSL中的FFT运算错误! + + + + + Lag + 延迟 + + + + CreateBinMatrixDialog + + + + QtiPlot + QtiPlot + + + + Bin Matrix Dialog + 合并矩阵对话框 + + + + &OK + 确定(&O) + + + + &Cancel + 取消(&C) + + + + X-min + X-min + + + + X-max + X-max + + + + Columns + + + + + Y-min + Y-min + + + + Y-max + Y-max + + + + Rows + + + + + Input Size Error + 输入尺寸错误 + + + + The dimensions you have specified are not acceptable! + 你指定的维度不可接受! + + + + Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! + 请输入一个正值,保证行*列的乘积不会超过系统允许的整数最大值! + + + + CurveRangeDialog + + + QtiPlot - Plot range + QtiPlot - 绘图值域 + + + + Data set: + 数据集: + + + + From row number + 自行号 + + + + To row number + 至行号 + + + + &OK + 确定(&O) + + + + &Close + 关闭(&C) + + + + CurvesDialog + + + QtiPlot - Add/Remove curves + QtiPlot - 添加/删除曲线 + + + + New curves style + 新建曲线样式 + + + + Line + 线状图 + + + + Scatter + 散点图 + + + + Line + Symbol + 线状图+符号 + + + + Vertical drop lines + 垂线图 + + + + Spline + 齿形图 + + + + Vertical steps + 垂直阶梯图 + + + + Horizontal steps + 水平阶梯图 + + + + Area + 面积 + + + + Vertical Bars + 垂直棒状图 + + + + Horizontal Bars + 水平棒状图 + + + + Histogram + 直方图 + + + + Contour - Color Fill + 等值线 - 色彩填充 + + + + Contour Lines + 等值线图 + + + + Gray Scale Map + 灰阶表 + + + + Histogram + 直方图 + + + + Available data + 可用数据 + + + + Graph contents + 图片内容 + + + + &Plot Associations... + 绘图关联(&P)... + + + + Edit &Range... + 编辑范围(&R)... + + + + &Edit Function... + 编辑函数(&E)... + + + + OK + 确定 + + + + Close + 关闭 + + + + &Show Range + 显示范围(&S) + + + + Show current &folder only + 只显示当前文件夹(&f) + + + + &Plot Selection + 绘制所选(&P) + + + + &Plot + 绘图(&P) + + + + &Delete Selection + 删除所选(&D) + + + + &Delete Curve + 删除曲线(&D) + + + + CustomActionDialog + + + + + + + + + + + + + QtiPlot + QtiPlot + + + + Add Custom Action + 添加自定义行为 + + + + Folder + 文件夹 + + + + Choose &Folder + 选择文件夹(&F) + + + + Script File + 脚本文件 + + + + Choose &Script + 选择脚本(&S) + + + + Icon + 图标 + + + + Choose &Icon + 选择图标(&I) + + + + + Text + 文本 + + + + Tool Tip Text + 工具提示文本 + + + + Shortcut + 快捷方式 + + + + &Menu + 菜单(&M) + + + + &New Menu... + 新建菜单(&N)... + + + + &Delete Menu + 删除菜单(&D) + + + + &Tool Bar + 工具栏(&T) + + + + &Save + 保存(&S) + + + + &Add + 添加(&A) + + + + &Remove + 移除(&R) + + + + &Close + 关闭(&C) + + + + + + + + + + Error + 错误 + + + + Please provide a description for your custom action! + 请给你的自定义行为提供一个描述! + + + + Dot characters are not allowed in the description text! + 点阵字符在描述文本中不允许! + + + + You have already defined an action having description: %1 <br>Please provide a different description text! + 你已经定义了一个描述为%1 <br>的行为。请提供一份不同的描述文本! + + + + The file you have specified doesn't exist, please choose a valid script file! + 你指定的文件不存在,请选择一个有效的脚本文件! + + + + The image file you have specified doesn't exist or can't be read, please choose another file! + 你指定的图像文件不存在或不可读,请选择另一个文件! + + + + Please provide a different key sequence! The following shortcut key sequences are already assigned: + 请提供一个不同的关键字顺序!以下快捷方式关键字顺序已经被指派过: + + + + Are you sure you want to remove this action? + 你确定你想移除这个行为? + + + + Remove Action + 移除行为 + + + + + File Save Error + 文件保存错误 + + + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + 不能写入文件<br><h4> %1 </h4><p>。请验证你是否有此位置的写入权限! + + + Images + 图像 + + + + QtiPlot - Load icon from file + QtiPlot - 从文件加载图标 + + + + Python Script + Python脚本 + + + + All Files + 所有文件 + + + + Choose script file + 选择脚本文件 + + + + Choose the custom actions folder + 选择自定义行为文件夹 + + + + Add menu + 添加菜单 + + + + Menu title: + 菜单标题: + + + + + Menu Bar + 菜单栏 + + + + Please, choose the location of the new menu + 请选择新菜单的位置 + + + + Menu: + 菜单: + + + Thers's already a menu item with this title, please choose another title! + 已经有一个此标题的菜单,请选择另外的标题! + + + + Remove Menu + 移除菜单 + + + + Are you sure you want to remove menu '%1' and all its actions? + 你确定你希望移除'%1'菜单和它所有的行为吗? + + + + There's already a menu item with this title, please choose another title! + 已经有一个菜单项用这个标题,请选择请一个标题! + + + + DataPickerTool + + + Click on plot or move cursor to display coordinates! + 在图上点击或者移动光标来显示坐标系! + + + + Please, click on plot and move cursor! + 点击图并移动鼠标! + + + + Select point and double click to remove it! + 选择点并双击来删除它! + + + + QtiPlot - Remove point error + QtiPlot - 删除点错误 + + + + Sorry, but removing points of a function is not possible. + 对不起,不能从函数中删除点。 + + + + + + + QtiPlot - Warning + QtiPlot - 警告 + + + + + This operation cannot be performed on curves plotted from columns having a non-numerical format. + 这个操作不能在包含有非数字格式的列所画的曲线上执行。 + + + + QtiPlot - Move point error + QtiPlot - 移动点错误 + + + + Sorry, but moving points of a function is not possible. + 对不起,不能从函数中移动点。 + + + + + The column '%1' is read-only! Please choose another curve! + 列'%1'是只读!请选择其它曲线! + + + + DataSetDialog + + QtiPlot - Select data set + QtiPlot - 选择数据集 + + + &OK + 确定(&O) + + + &Cancel + 取消(&C) + + + + Deconvolution + + + Deconvolution + 反卷积 + + + + Differentiation + + + + Derivative + 导数 + + + + of + Derivative of + + + + + DrawPointTool + + + Draw + 画图 + + + + EnrichmentDialog + + + + + + QtiPlot + QtiPlot + + + + Tex Equation Editor + Tex公式编辑器 + + + + Clea&r + 清除(&r) + + + + Window Geometry + 窗口几何属性 + + + + Object Properties + 对象属性 + + + + &Apply + 应用(&A) + + + + &Close + 关闭(&C) + + + + Preview: + 预览: + + + + + &Text + 文本(&T) + + + + + Color + 颜色 + + + + &Font + 字体(&F) + + + + Background + 背景 + + + + + Opacity + 不透明度 + + + + + Transparent + 透明 + + + + Rotate (deg.) + 旋转(角度) + + + + Auto-&update + 自动更新(&u) + + + + TeX &Output + TeX输出(&O) + + + + + + Set As &Default + 设为默认(&D) + + + + Apply format &to... + 应用格式到(&t)... + + + + + + Object + 对象 + + + + + + Layer + 图层 + + + + + + Window + 窗口 + + + + + + All Windows + 所有窗口 + + + + File + 文件 + + + + &Save internally + 内部保存(&S) + + + + &Image + 图像(&I) + + + + Shape + 形状 + + + + None + 不选 + + + + Line + 线 + + + + Rectangle + 矩形 + + + + Shadow + 阴影 + + + + Line Style + 线样式 + + + + + Width + 宽度 + + + + + Apply t&o... + 应用到(&o)... + + + + &Frame + 框架(&F) + + + + Fill Color + 填充颜色 + + + + Pattern + 图案 + + + + Pattern Color + 图案颜色 + + + + Use &Frame Color + 使用框架颜色(&F) + + + + Fill &Pattern + 填充图案(&P) + + + + Page + + + + + Layer Scales + 层比例尺 + + + + Attach to + 附加至 + + + + inch + 英寸 + + + + mm + 毫米 + + + + cm + 厘米 + + + + point + + + + + pixel + 像素 + + + + scale + 比例 + + + + Unit + 单位 + + + + Position + 位置 + + + + X + X + + + + Y + Y + + + + Size + 大小 + + + + Height + + + + + &Keep aspect ratio + 保持宽高比(&K) + + + + &Best size + 最佳尺寸(&B) + + + + &Geometry + 布局(&G) + + + + Network connection error + 网络连接错误 + + + + Error while trying to connect to host %1: + 尝试连接主机%1时错误: + + + + Please verify your network connection! + 请检查你的网络连接! + + + + QtiPlot - Import image from file + QtiPlot - 从文件导入图像 + + + + QtiPlot - Warning + QtiPlot - 警告 + + + + The file %1 doesn't exist. The image cannot be restored when reloading the project file! + 文件%1不存在。当重载项目文件时图像无法恢复! + + + + MathTran (http://www.mathtran.org/) + MathTran (http://www.mathtran.org/) + + + + locally installed + 本地已安装 + + + + LaTeX Compiler + LaTeX编译器 + + + + Compile process ended + 编译过程结束 + + + + Compiling process ended with exit code: %1 + 编译过程结束于代码:%1 + + + + LaTeX compile process + LaTeX编译过程 + + + + dvipng process + dvipng过程 + + + + + failed to start! + 启动失败! + + + + Please verify that you have dvipng installed in the same folder as your LaTeX compiler! + 请保证你在LaTeX编译器的目录下安装了dvipng! + + + + crashed + 已崩溃 + + + + timedout + 超时 + + + + write error + 写错误 + + + + read error + 读错误 + + + + unknown error + 未知错误 + + + + Compile error + 编译错误 + + + + Please set the correct path to the compiler in the preferences dialog! + 请在选项对话框设置编译器的正确路径! + + + + ErrDialog + + + + Source of errors + 误差源 + + + + QtiPlot - Error Bars + QtiPlot - 误差棒 + + + + &X Error Bars + &X误差棒 + + + + &Add + 添加(&A) + + + + Add Error Bars to + 添加误差棒至 + + + + Percent of data (%) + 数据百分比(%) + + + + Standard Deviation of Data + 数据标准差 + + + + &Y Error Bars + &Y误差棒 + + + + &Close + 关闭(&C) + + + + Existing column + 已存在列 + + + + ExpDecayDialog + + + QtiPlot - Verify initial guesses + QtiPlot - 验证初始猜测 + + + + Exponential Fit of + 指数拟合 + + + + Growth time + 增长时间 + + + + Decay time + 衰减时间 + + + + First decay time (t1) + 第一衰减时间(t1) + + + + Second decay time (t2) + 第二衰减时间(t2) + + + + Third decay time (t3) + 第三衰减时间(t3) + + + + Amplitude + 振幅 + + + + Y Offset + Y偏移 + + + + Initial time + 初始时间 + + + + Color + 颜色 + + + + &Fit + 拟合(&F) + + + + &Close + 关闭(&C) + + + + QtiPlot - Warning + QtiPlot - 警告 + + + + The curve <b> %1 </b> doesn't exist anymore! Operation aborted! + 曲线<b> %1 </b>不再存在!操作中止! + + + + ExponentialFit + + + ExpGrowth + 指数增长 + + + + Exponential growth + 指数增长 + + + + + amplitude + 振幅 + + + + lifetime + 生命期 + + + + + offset + 偏移 + + + + ExpDecay1 + 指数衰减1 + + + + Exponential decay + 指数衰减 + + + + e-folding time + e 倍变化时间 + + + + ExportDialog + + + QtiPlot - Export ASCII + QtiPlot - 导出ASCII + + + + Table + 表格 + + + + &All + 全部(&A) + + + + Separator + 分隔符 + + + + + + + + TAB + TAB + + + + + + + + SPACE + SPACE + + + + + The column separator can be customized. The following special codes can be used: +\t for a TAB character +\s for a SPACE + 列分隔符可以自定义.以下特殊代码可以用: +\t为制表符 +\s为空格 + + + + + + The separator must not contain the following characters: 0-9eE.+- + 分隔符不能包含以下字符: 0-9eE.+- + + + + Include Column &Names + 包含列名称(&N) + + + + Include Column Co&mments + 包含列注释(&m) + + + + Export &Selection + 导出所选(&S) + + + + QtiPlot + QtiPlot + + + + Overwrite file? + 覆盖文件? + + + + %1 already exists. + %1已经存在了. + + + + Do you want to replace it? + 你想替换它么? + + + + QtiPlot - Export error + QtiPlot - 导出错误 + + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + 无法写入文件:<br><h4> %1 </h4><p>请确定在该位置有写权限! + + + &OK + 确定(&O) + + + &Cancel + 取消(&C) + + + + &Help + 帮助(&H) + + + + QtiPlot - Help + QtiPlot - 帮助 + + + + QtiPlot - Import options error + QtiPlot - 导入选项错误 + + + + ExtensibleFileDialog + + + << &Advanced + << 高级(&A) + + + + ExtractDataDialog + + + QtiPlot + + + + + Extract Data + + + + + For row (i) + row (i) + + + + to + + + + + Clea&r + + + + Add function + 添加函数 + + + Add column + 添加列 + + + + Add &function + + + + + Add co&lumn + + + + + Add &operator + + + + + &Apply + 应用(&A) + + + Clear &Formulas + 清除方程式(&F) + + + + &Close + 关闭(&C) + + + + &Put into table + + + + + Table + 表格 + + + + Cond&ition: + + + + + FFT + + + + + + + FFT + FFT + + + + + Forward + + + + + + + + of + + + + + + + Frequency + 频率 + + + + + Inverse + + + + + + + Time + 时间 + + + + + Real + 实部 + + + + + Imaginary + 虚部 + + + + + + + Amplitude + 振幅 + + + + + Angle + 角度 + + + + Hz + Hz + + + + s + s + + + + FFTDialog + + + QtiPlot - FFT Options + QtiPlot - FFT选项 + + + + &Forward + 正(&F) + + + + &Inverse + 逆(&I) + + + + Curve + 曲线 + + + + Sampling + 采样 + + + + Real + 实部 + + + + Imaginary + 虚部 + + + + + Sampling Interval + 采样间隔 + + + + &Normalize Amplitude + 归一化振幅(&N) + + + + &Shift Results + 偏移结果(&S) + + + + &OK + 确定(&O) + + + + &Close + 关闭(&C) + + + + QtiPlot - Error + QtiPlot - 错误 + + + + Please choose a column for the real part of the data! + 请选择实部数据列! + + + + QtiPlot + QtiPlot + + + + The two matrices have different dimensions, the imaginary part will be neglected! + 两个矩阵维度不同,虚部忽略! + + + + RealMatrixFFT + RealMatrixFFT + + + + Real part of the FFT transform of + FFT变换的实部 + + + + ImagMatrixFFT + ImagMatrixFFT + + + + Imaginary part of the FFT transform of + FFT变换的虚部 + + + + AmplitudeMatrixFFT + AmplitudeMatrixFFT + + + + Amplitudes of the FFT transform of + FFT变换的振幅 + + + + FFTFilter + + + FFT + FFT + + + + Filtered + 滤波 + + + + + QtiPlot + QtiPlot + + + + + Error + 错误 + + + + Unknown filter type. Valid values are: 1 - Low pass, 2 - High Pass, 3 - Band Pass, 4 - Band block. + 未知滤波器类型. 有效值: 1 - 低通, 2 - 高通, 3 - 带通, 4 - 带阻. + + + + Please enter different values for the band limits. + 请给频带限制键入一个不同的值。 + + + + to + + + + + Hz + Hz + + + + Low Pass FFT Filter + 低通FFT滤波器 + + + + High Pass FFT Filter + 高通FFT滤波器 + + + + Band Pass FFT Filter + 带通FFT滤波器 + + + + Band Block FFT Filter + 带阻FFT滤波器 + + + + Filter + + + + + + + + QtiPlot + QtiPlot + + + + + + + + Error + 错误 + + + + Please assign a curve first! + 请先制定一条曲线! + + + + Several data points have the same x value causing divisions by zero, operation aborted! + 部分点X值相同,导致被0除,操作中止! + + + + + You need at least %1 points in order to perform this operation! + 你需要至少%1个点来进行操作! + + + + QtiPlot - Filter Error + QtiPlot - 滤波器错误 + + + + Please enter a valid curve name! + 请输入一个有效的曲线名称! + + + + QtiPlot - Color Name Error + QtiPlot - 颜色名称错误 + + + + The color name '%1' is not valid, a default color (red) will be used instead! + 颜色名称'%1'无效,使用默认颜色(红色)! + + + + You didn't specify a valid data set for this operation! + 你还没有为该操作选定一个有效的数据集! + + + + of + + + + + Plot + 绘图 + + + + Memory Allocation Error + 内存分配错误 + + + + Not enough memory, operation aborted! + 内存不足,操作中止! + + + + FilterDialog + + + QtiPlot - Filter options + QtiPlot - 滤波器选项 + + + + Filter curve: + 滤波器曲线: + + + + Frequency cutoff (Hz) + 截止频率(Hz) + + + + Low Frequency (Hz) + 低频(Hz) + + + + High Frequency (Hz) + 高频(Hz) + + + + Add DC Offset + 添加直流偏置 + + + + Substract DC Offset + 减去直流偏置 + + + + + Color + 颜色 + + + + &Filter + 滤波器(&F) + + + + &Close + 关闭(&C) + + + + QtiPlot - Frequency input error + QtiPlot - 频率输入错误 + + + + Please enter frequency limits that satisfy: Low < High ! + 请输入频率满足条件的限制:Low < High ! + + + + FindDialog + + + QtiPlot + QtiPlot + + + + + Find + 查找 + + + + Start From + 开始于 + + + + Search in + 查找于 + + + + &Window Names + 窗口名称(&W) + + + + Window &Labels + 窗口标签(&L) + + + + Folder &Names + 文件夹名称(&N) + + + + Case &Sensitive + 大小写敏感(&S) + + + + &Partial Match Allowed + 允许部分匹配(&P) + + + + &Include Subfolders + 包括子文件夹(&I) + + + + &Find + 查找(&F) + + + + &Update Start Path + 更新起始路径(&U) + + + + &Close + 关闭(&C) + + + + FindReplaceDialog + + + + + QtiPlot + QtiPlot + + + + + Find + 查找 + + + + Find and Replace + 查找并替换 + + + + Replace with + 替换为 + + + + &Match case + 匹配大小写(&M) + + + + &Whole word + 匹配全字(&W) + + + + &Next + 下一个(&N) + + + + &Previous + 上一个(&P) + + + + &Replace + 替换(&R) + + + + Replace &all + 全部替换(&a) + + + + &Close + 关闭(&C) + + + + + + Empty Search Field + 空查找域 + + + + + + The search field is empty. Please enter some text and try again. + 查找域为空。请键入文字再重新尝试。 + + + + QtiPlot has finished searching the document. + QtiPlot已经完成了文档搜索。 + + + + Fit + + + Plot + 绘图 + + + + graphics display disabled + 图像显示已禁用 + + + + of dataset + 的数据集 + + + + using function + 使用函数 + + + + Weighting Method + 取权方法 + + + + No weighting + 不取权 + + + + Instrumental + 辅助 + + + + using error bars dataset + 使用误差棒数据集 + + + + Statistical + 统计 + + + + Arbitrary Dataset + 任意数据集 + + + + Direct Weighting using Dataset + 使用数据集直接取权 + + + + Nelder-Mead Simplex + Nelder-Mead单形 + + + + Unscaled Levenberg-Marquardt + 未调整的Levenberg-Marquardt + + + + Scaled Levenberg-Marquardt + 调整的Levenberg-Marquardt + + + + algorithm with tolerance = + 算法容差= + + + + From x + 从x + + + + to x + 到x + + + + + R^2 + R^2 + + + + Adjusted R^2 + 校正的R^2 + + + + RMSE (Root Mean Squared Error) + 均方根误差(RMSE) + + + + RSS (Residual Sum of Squares) + 残差平方和(RSS) + + + + Iterations + 迭代 + + + + Status + 状态 + + + + Dataset + 数据集 + + + + Function + 函数 + + + + + + + QtiPlot - Error + QtiPlot - 错误 + + + + You cannot use the instrumental weighting method. + 你不能使用辅助加权方法。 + + + + The curve %1 has no associated Y error bars. You cannot use instrumental weighting method. + 曲线%1没有关联Y误差棒。你不能使用辅助加权方法。 + + + + + The column %1 has less points than the fitted data set. Please choose another column! + 列%1数据点少于拟合数据集。你选择其它列! + + + The column %1 has less points than the fitted data set. Please choose another column!. + 列%1数据点少于拟合数据集。你选择其它列!。 + + + + Parameter + 参数 + + + + Value + + + + + Error + 错误 + + + + + + + + + + QtiPlot - Fit Error + QtiPlot - 拟合错误 + + + + + + Please perform a fit first! + 请先进行一个拟合! + + + + FitResiduals + 残差拟合 + + + + Residuals of %1 + %1的残差 + + + + residue + 残差 + + + + + + + + + + QtiPlot - Memory Allocation Error + QtiPlot - 内存分配错误 + + + + + + + + + Not enough memory! + 内存不足! + + + + + FitStats + 拟合状态 + + + + Confidence Limits of %1 + %1的置信限 + + + + + Independent Variable + 独立变量 + + + + LCL + 置信下限 + + + + Lower %1 Confidence Limit + %1的置信下限 + + + + UCL + 置信上限 + + + + Upper %1 Confidence Limit + %1的置信上限 + + + + Prediction Limits of %1 + %1的预测限 + + + + LPL + 预测下限 + + + + Lower %1 Prediction Limit + %1的预测下限 + + + + UPL + 预测上限 + + + + Upper %1 Prediction Limit + %1的预测上限 + + + + You didn't specify a valid data set for this fit operation. Operation aborted! + 你没有为此次拟合指定有效的数据集。操作中止! + + + + There are no parameters specified for this fit operation. Operation aborted! + 你没有为此次拟合指定参数。操作中止! + + + + You need at least %1 data points for this fit operation. Operation aborted! + 你需要至少%1个数据点来拟合。操作中止! + + + + You must specify a valid fit function first. Operation aborted! + 你必须首先指定一个有效的拟合函数。操作中止! + + + + + Could not allocate enough memory for the fit curves! + 不能为拟合曲线分配足够的内存! + + + + QtiPlot - Memory Allocation Error + QtiPlot - 内存分配错误 + + + + Fit + 拟合 + + + + QtiPlot + QtiPlot + + + + File Save Error + 文件保存错误 + + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + 无法写入文件: <br><h4> %1 </h4><p>请保证你在这个位置有写权限! + + + + QtiPlot Fit Model + QtiPlot拟合模型 + + + + Cannot read file %1: +%2. + 不能读取文件%1: +%2。 + + + + FitDialog + + + QtiPlot - Fit Wizard + QtiPlot - 拟合向导 + + + + Curve + 曲线 + + + + + Function + 函数 + + + + Initial guesses + 初始猜测 + + + + + &Save + 保存(&S) + + + + &Preview + 预览(&P) + + + + Parameter + 参数 + + + + Data Set + 数据集 + + + + Weighting + 权重 + + + + Re&load + 重载(&l) + + + + &Guess + 猜测(&G) + + + + &Range + 范围(&R) + + + + From + + + + + Value + + + + + To + + + + + Constant + 常数 + + + + Error + 错误 + + + + Algorithm + 算法 + + + + Scaled Levenberg-Marquardt + 调整的Levenberg-Marquardt + + + + Unscaled Levenberg-Marquardt + 未调整的Levenberg-Marquardt + + + + Nelder-Mead Simplex + Nelder-Mead单形 + + + + Color + 颜色 + + + + From x= + 从x= + + + + To x= + 到x= + + + + Iterations + 迭代 + + + + Tolerance + 容许误差 + + + Weighting Method + 取权方法 + + + + No weighting + 不取权 + + + + Instrumental + 辅助 + + + + Statistical + 统计 + + + + Arbitrary Dataset + 任意数据集 + + + + Direct Weighting + 直接取权 + + + << &Edit function + << 编辑函数(&E) + + + + &Delete Fit Curves + 删除拟合曲线(&D) + + + + &Fit + 拟合(&F) + + + + + + &Close + 关闭(&C) + + + Custom &Output >> + 自定义输出(&O)>> + + + + Category + 类别 + + + + Expression + 表达式 + + + + User defined + 用户定义 + + + + Built-in + 内置 + + + + Basic + 基本 + + + + Plugins + 插件 + + + + Fit with &built-in function + 使用内置函数拟合(&b) + + + + + Polynomial Order + 多项式阶 + + + + + Choose plug&ins folder... + 选择插件目录(&i)... + + + + Name + 名称 + + + + user1 + user1 + + + + + Parameters + 参数 + + + + &Remove + 移除(&R) + + + + Add &expression + 添加表达式(&e) + + + + Add &name + 添加名称(&n) + + + + Rese&t + 重置(&t) + + + &Fit >> + 拟合(&F)>> + + + + &Uniform X Function + 统一X的函数(&U) + + + + Points + + + + + Same X as Fitting &Data + 跟拟合数据的X相同(&D) + + + + Generated Fit Curve + 拟合生成的曲线 + + + + Significant Digits + 有效数字 + + + + Parameters &Table + 参数表(&T) + + + + + Name: + 名称: + + + + &One table for all fits + 所有拟合使用一个表(&O) + + + + Covariance &Matrix + 协变矩阵(&M) + + + + CovMatrix + 协变矩阵 + + + + Co&nf. Bands + 置信带(&n) + + + + Pred. &Bands + 推导带(&B) + + + + &Residuals Plot + 残差散布图(&R) + + + + &Scale Errors with sqrt(Chi^2/doF) + 用sqrt(Chi^2/doF)调整误差(&S) + + + + Parameters Output + 参数输出 + + + + &Write Parameters to Result Log + 参数写到结果日志(&W) + + + + &Paste Parameters to Plot + 参数粘贴到绘图上(&P) + + + << &Fit + << 拟合(&F) + + + + + + Select Function + 选择函数 + + + + + + + Fitting Session + 拟合会话 + + + + + + Custom Output + 自定义输出 + + + + Start Fitting Session + 开始拟合会话 + + + + &Apply + 应用(&A) + + + + + + + + + + QtiPlot - Error + QtiPlot - 错误 + + + + Please enter a valid name for the parameters table. + 请为参数表输入一个有效名称。 + + + + + + + + Please perform a fit first and try again. + 请先进行一个拟合并重试。 + + + + Please enter a valid name for the covariance matrix. + 请为协变矩阵输入一个有效名称。 + + + + + + + + QtiPlot - Input function error + QtiPlot - 输入函数错误 + + + + + Please enter a valid function! + 请输入一个有效的函数! + + + + Please enter a function name! + 你输入一个函数名称! + + + + QtiPlot - Error: function name + QtiPlot - 错误:函数名称 + + + + is a built-in function name<p>You must choose another name for your function! + 是一个内置函数名<p>你必须给你的函数选择另外一个名称! + + + + You can't define functions recursively! + 你不能定义一个递归的函数! + + + + + QtiPlot fit model + QtiPlot拟合模型 + + + + + All files + 所有文件 + + + + + + QtiPlot + QtiPlot + + + + + Save Fit Model As + 另存为拟合模型 + + + + Are you sure you want to remove fit model file: + %1 ? + 你确定要移除拟合模型文件: +%1 ? + + + + Remove Fit Model + 移除拟合模型 + + + + Choose &models folder... + 选择模型目录(&m)... + + + + Fit with selected &user function + 使用选定的用户函数拟合(&u) + + + + Fit using &built-in function + 使用内置函数拟合(&b) + + + + Fit using &plugin function + 使用插件函数拟合(&p) + + + + Choose the plugins folder + 选择插件目录 + + + + Choose the fit models folder + 选择拟合模型目录 + + + + + Gauss + 高斯 + + + + + Lorentz + 洛仑兹 + + + + Peaks + + + + + + Polynomial + 多项式 + + + + QtiPlot - Warning + QtiPlot - 警告 + + + + The curve <b> %1 </b> doesn't exist anymore! Operation aborted! + 曲线<b> %1 </b>不再存在!操作中止! + + + + QtiPlot - Input error + QtiPlot - 输入错误 + + + + Please enter x limits that satisfy: from < end! + 请输入x满足from < end 的上下限! + + + + Please verify that you have initialized all the parameters! + 你验证你是否初始化了所有参数! + + + + + No data tables + 没有数据表 + + + + Error: + 错误: + + + + Folder + + + kB + kB + + + + bytes + 字节 + + + + FrequencyCountDialog + + + QtiPlot - Frequency count + QtiPlot - 频数统计 + + + + Statistics on %1 + 统计%1 + + + + Mean + 平均值 + + + + Standard Deviation + 标准差 + + + + Median + 中值 + + + + Size + 大小 + + + + From Minimum + 自最小值 + + + + To Maximum + 至最大指 + + + + Step Size + 步长 + + + + &Apply + 应用(&A) + + + + &Cancel + 取消(&C) + + + + &Ok + 确定(&O) + + + + QtiPlot - Error + QtiPlot - 错误 + + + + Not enough data points, operation aborted! + 没有足够的数据点,操作中止! + + + + QtiPlot - Frequency input error + QtiPlot - 频率输入错误 + + + + Please enter frequency limits that satisfy: From < To ! + 请输入频率满足条件的限制:From < To ! + + + + + Count + 计数 + + + + Frequency count of %1 + %1的频数统计 + + + + BinCtr + BinCtr + + + + BinEnd + BinEnd + + + + Sum + + + + + FunctionDialog + + + QtiPlot - Add function curve + QtiPlot - 添加函数曲线 + + + + Curve type + + + + + Click here to select a recently typed expression + 点击这里选取一个最近输入的表达式 + + + + Rece&nt + 最近(&n) + + + + Function + 函数 + + + + Parametric plot + 参数绘图 + + + + Polar plot + 极坐标绘图 + + + + f(x)= + f(x)= + + + + From x= + 从x= + + + + To x= + 到x= + + + + + + Points + + + + + Constant + 常数 + + + + Value + + + + + + Parameter + 参数 + + + + + From + + + + + + To + + + + + + + + + + + + + + QtiPlot + QtiPlot + + + + + + + + Sorry, there are no recent expressions available! + 抱歉,没有最近可用的表达式! + + + + + + + + Recent Functions + 最近的函数 + + + + + + + + Please, choose a function: + 请选择一个函数: + + + + x = + x = + + + + y = + y = + + + + R = + R = + + + + Theta = + Theta = + + + + Clea&r Function + 清除函数(&r) + + + + &Ok + 确定(&O) + + + + &Close + 关闭(&C) + + + Clear list + 清除列表 + + + Clear Function + 清除函数 + + + + + + QtiPlot - Input error + QtiPlot - 输入错误 + + + + Please enter x limits that satisfy: from < end! + 请输入x满足from < end 的上下限! + + + + + + + + QtiPlot - Input function error + QtiPlot - 输入函数错误 + + + QtiPlot - Start limit error + QtiPlot - 起始限制错误 + + + QtiPlot - End limit error + QtiPlot - 结束限制错误 + + + + + Please enter parameter limits that satisfy: from < end! + 请输入参数满足from < end 的上下限! + + + + &Add Function + 添加函数(&A) + + + + GaussAmpFit + + + GaussAmp + GaussAmp + + + + offset + 偏移 + + + + amplitude + 振幅 + + + + center + 中心 + + + + width + 宽度 + + + + GaussAmp Fit + GaussAmp拟合 + + + + GaussFit + + + Gauss + 高斯 + + + + Gauss Fit + 高斯拟合 + + + + area + 面积 + + + + center + 中心 + + + + width + 宽度 + + + + offset + 偏移 + + + + Graph + + + + Y Axis Title + Y轴标题 + + + + + X Axis Title + X轴标题 + + + + + + + + + QtiPlot - Error + QtiPlot - 错误 + + + + + Couldn't change the axis type to the requested format! + 不能将轴类型转换为请求格式! + + + + + Please provide a valid file name! + 请提供有效的文件名! + + + + File format not handled, operation aborted! + 无法处理的文件格式,操作中止! + + + + layer + + + + + Title + 标题 + + + + QtiPlot - File open error + QtiPlot - 文件打开错误 + + + + Image file: <p><b> %1 </b><p>does not exist anymore! + 图像文件<p><b> %1 </b><p>不再存在! + + + + Data set generated from curve + 从曲线生成数据集 + + + Table + 表格 + + + + + + QtiPlot - Warning + QtiPlot - 警告 + + + + The columns + + + + + are empty and will not be added to the plot! + 是空的并且不会被添加到绘图中! + + + + The column + + + + + is empty and will not be added to the plot! + 是空的并且不会被添加到绘图中! + + + + + Cu&t + 剪切(&t) + + + + + &Copy + 复制(&C) + + + + + C&lear + 清除(&l) + + + + + &Delete + 删除(&D) + + + + + + &Properties... + 属性(&P)... + + + + &Rescale to show all + 重缩放显示所有(&R) + + + + Ctrl+Shift+R + Ctrl+Shift+R + + + + &Hide axis + 隐藏轴(&H) + + + + &Show grids + 显示网格(&S) + + + + &Scale... + 比例(&S)... + + + + There are no curves available on this plot! + 绘图中没有有效曲线! + + + + There are no curves with more than two points on this plot. Operation aborted! + 绘图中没有包含多于两个点的曲线。操作中止! + + + + F + F + + + + Graph3D + + + X axis + X轴 + + + + Y axis + Y轴 + + + + Z axis + Z轴 + + + + + + QtiPlot - Error + QtiPlot - 错误 + + + + + Please provide a valid file name! + 请提供有效的文件名! + + + + File format not handled, operation aborted! + 无法处理的文件格式,操作中止! + + + + ImageExportDialog + + + QtiPlot - Choose a filename to save under + QtiPlot - 选择一个文件来保存 + + + + Resolution (DPI) + 分辨率(DPI) + + + &Export in &color + 彩色输出(&E) + + + + Export in &color + 以彩色导出(&c) + + + + &Escape special characters in texts + 跳过文本中的特殊字符(&E) + + + + Export &font sizes + 导出字号(&f) + + + + Export 3D texts as + 导出三维文字为 + + + + Bitmap images + Bitmap图像 + + + + Native fonts + 点阵字体 + + + + LaTeX file + LaTeX文件 + + + + 3D Sort mode + 三维排序模式 + + + + No sort + 不排序 + + + + Simple sort + 简单排序 + + + + BSP sort + BSP排序 + + + + Image quality + 图像质量 + + + + Save transparency + 保存透明度 + + + + Custom print size + 自定义打印尺寸 + + + + inch + 英寸 + + + + mm + 毫米 + + + + cm + 厘米 + + + + point + + + + + pixel + 像素 + + + + Unit + 单位 + + + + Width + + + + + Height + + + + + Scale Fonts Factor + 字体调整比例 + + + + Automatic + 自动 + + + + &Keep aspect ratio + 保持宽高比(&K) + + + + QtiPlot + QtiPlot + + + + Overwrite file? + 覆盖文件? + + + + %1 already exists. + %1已经存在了. + + + + Do you want to replace it? + 你想替换它么? + + + + QtiPlot - Export error + QtiPlot - 导出错误 + + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + 无法写入文件: <br><h4> %1 </h4><p>请保证你在这个位置有写权限! + + + + Print Resolution (DPI) + 打印分辨率(DPI) + + + + ImageProfilesTool + + + Position + 位置 + + + + x + x + + + + y + y + + + + Z-Value + Z值 + + + + ImageWidget + + + + QtiPlot - File openning error + QtiPlot - 文件打开错误 + + + + The file: <b>%1</b> doesn't exist! + 文件:<b>%1</b>不存在! + + + + You don't have the permission to open this file: <b>%1</b> + 你没有权限打开<b>%1</b>文件 + + + + ImportASCIIDialog + + + QtiPlot - Import ASCII File(s) + QtiPlot - 导入ASCII文件 + + + + All files + 所有文件 + + + + Text files + 文本文件 + + + + Data files + 数据文件 + + + + Comma Separated Values + 逗号分隔的值 + + + + Import each file as: + 每个文件导入为: + + + + + New Table + 新建表格 + + + + New Matrice + 新建矩阵 + + + + New Columns + 新建列 + + + + New Matrix + 新建矩阵 + + + + New Rows + 新建行 + + + + Overwrite Current Window + 覆盖当前窗口 + + + + Separator: + 分隔符: + + + + + + + + TAB + TAB + + + + + + + SPACE + SPACE + + + + The column separator can be customized. +The following special codes can be used: +\t for a TAB character +\s for a SPACE + 列分隔符可以自定义. +以下特殊代码可以用: +\t为制表符 +\s为空格 + + + + The separator must not contain the following characters: +0-9eE.+- + 分隔符不能包含以下字符: +0-9eE.+- + + + + Ignore first + 忽略起始 + + + + lines + + + + + Ignore lines starting with + 忽略行始于 + + + Use first row to &name columns + 用第一行命名各列(&n) + + + + Use first row &as + 用第一行为(&a) + + + + Column Names + 列名 + + + + Column Comments + 列注释 + + + + Use second row as &comments + 用第二行作为注释(&c) + + + + &Remove white spaces from line ends + 移除行尾空格(&R) + + + + By checking this option all white spaces will be +removed from the beginning and the end of +the lines in the ASCII file. + when translating this check the what's this functions and tool tips to place the '\n's correctly + 选上这个选项,ASCII文件中所有行首和行尾的空白都会被移除。 + + + + Warning: checking this option leads to column +overlaping if the columns in the ASCII file don't +have the same number of rows. + 警告:选上这个选项会导致列重叠,如果ASCII文件中的各列行数不等。 + + + + + To avoid this problem you should precisely +define the column separator using TAB and +SPACE characters. + when translating this check the what's this functions and tool tips to place the '\n's correctly + 为了避免这个问题,你应该精确的用TAB和SPACE定义列分隔符。 + + + + &Simplify white spaces + 简化空白(&S) + + + + By checking this option all white spaces will be +removed from the beginning and the end of the +lines and each sequence of internal +whitespaces (including the TAB character) will +be replaced with a single space. + when translating this check the what's this functions and tool tips to place the '\n's correctly + 选上这个选项,行首和行尾的空白都会被去掉, +行内的连续空白(包括TAB)都会被替换为单个空格。 + + + + Warning: checking this option leads to column +overlaping if the columns in the ASCII file don't +have the same number of rows. + when translating this check the what's this functions and tool tips to place the '\n's correctly + 警告:选上这个选项会导致列重叠,如果ASCII文件中的各列行数不等。 + + + + Decimal Separators + 小数分隔符 + + + + System Locale Setting + 系统本地设置 + + + + Omit &thousands separator + 忽略千位分隔符(&t) + + + + Endline character + 行尾字符 + + + + LF (Unix) + LF (Unix) + + + + CRLF (Windows) + CRLF (Windows) + + + + CR (Mac) + CR (Mac) + + + + Import as &read-only + 导入为只读(&r) + + + + &Preview Lines + 预览行(&P) + + + + All + 全部 + + + + &Help + 帮助(&H) + + + + The column separator can be customized. The following special codes can be used: +\t for a TAB character +\s for a SPACE + 列分隔符可以自定义.以下特殊代码可以用: +\t为制表符 +\s为空格 + + + + The separator must not contain the following characters: 0-9eE.+- + 分隔符不能包含以下字符: 0-9eE.+- + + + + Remove white spaces from line ends + 移除行尾空格 + + + + By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. + 选上这个选项,ASCII文件中所有行首和行尾的空白都会被移除。 + + + + Simplify white spaces + 简化空白 + + + + By checking this option each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. + 选上这个选项,行内的连续空白(包括TAB)会被替换为单个空格。 + + + + By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. + 选上这个选项,行首和行尾的空白都会被去掉, +行内的连续空白(包括TAB)都会被替换为单个空格。 + + + + Warning: using these two last options leads to column overlaping if the columns in the ASCII file don't have the same number of rows. + 警告:使用最后这两个选项会导致列重叠,如果ASCII文件中的各列行数不等。 + + + + To avoid this problem you should precisely define the column separator using TAB and SPACE characters. + 为了避免这个问题,你应该精确的用TAB和SPACE定义列分隔符。 + + + + QtiPlot - Help + QtiPlot - 帮助 + + + + QtiPlot - File openning error + QtiPlot - 文件打开错误 + + + + You don't have the permission to open this file: <b>%1</b> + 你没有权限打开<b>%1</b>文件 + + + + IntDialog + + + QtiPlot - Integration Options + QtiPlot - 几分选项 + + + + Function + 函数 + + + + Variable + 变量 + + + + Order (1 - 5, 1 = Trapezoidal Rule) + 阶(1 - 5, 1 = 梯形法则) + + + + Number of iterations (Max=20) + 迭代次数(最大=20) + + + + Tolerance + 容许误差 + + + + Lower limit + 下限 + + + + Upper limit + 上限 + + + + &Plot area + 绘图区域(&P) + + + + &Integrate + 积分(&I) + + + + &Close + 关闭(&C) + + + + Integration + + + QtiPlot - Input error + QtiPlot - 输入错误 + + + + + Integration + 积分 + + + + + Numerical integration of + 数值积分 + + + + using a %1 order method + 使用%1阶方法 + + + + From + + + + + + to + + + + + Tolerance + 容许误差 + + + + Iterations + 迭代 + + + + Plot + 绘制 + + + + using the Trapezoidal Rule + 使用梯形法则 + + + + Points + + + + + from + + + + + Peak at + 峰位于 + + + + Area + 面积 + + + + QtiPlot - Error + QtiPlot - 错误 + + + + Unknown integration method. Valid values must be in the range: 1 (Trapezoidal Method) to 5. + 未知积分方法。有效值必须在1(梯形法则)至5。 + + + + Interpolation + + + + QtiPlot + QtiPlot + + + + + Error + 错误 + + + + Unknown interpolation method. Valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. + 未知插值方法。有效值:0 - 线性, 1 - 立方插值, 2 - 阿克玛光滑插值。 + + + + + + + Linear + 线性 + + + + + + + + + Int + 整数 + + + + + + + + + Interpolation + 插值 + + + + + + + Cubic + 立方插值 + + + + + + + Akima + 阿克玛光滑插值 + + + + QtiPlot - Error + QtiPlot - 错误 + + + + Unknown interpolation method, valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. + 未知插值方法,有效值:0 - 线性, 1 - 立方插值, 2 - 阿克玛光滑插值。 + + + + You need at least %1 points in order to perform this operation! + 你需要至少%1个点来进行此项操作! + + + + InterpolationDialog + + + QtiPlot - Interpolation Options + QtiPlot - 插值选项 + + + + Make curve from + 生成曲线自 + + + + Spline + 齿形图 + + + + Linear + 线性插值 + + + + Cubic + 立方插值 + + + + Non-rounded Akima + 非圆阿克玛插值 + + + + Points + + + + + From Xmin + 自Xmin + + + + To Xmax + 至Xmax + + + + Color + 颜色 + + + + &Make + 生成(&M) + + + + &Close + 关闭(&C) + + + + QtiPlot - Warning + QtiPlot - 警告 + + + + The curve <b> %1 </b> doesn't exist anymore! Operation aborted! + 曲线<b> %1 </b>不再存在!操作中止! + + + + QtiPlot - Input error + QtiPlot - 输入错误 + + + + Please enter x limits that satisfy: from < to! + 请输入x满足from < end 的上下限! + + + + LayerButton + + + Activate layer + 激活层 + + + + LayerDialog + + + QtiPlot - Arrange Layers + QtiPlot - 排列图层 + + + + + Layers + 图层 + + + + Number + 数字 + + + + Link &X axes + + + + + Automatic &layout + 自动图层(&l) + + + + Alignment + 对齐 + + + + Horizontal + 水平 + + + + + Center + 居中 + + + + Left + + + + + Right + + + + + Vertical + 垂直 + + + + Top + + + + + Bottom + + + + + Grid + 栅格 + + + + Columns + + + + + Rows + + + + + &Layer Canvas Size + 图层画布尺寸(&L) + + + + Width + 宽度 + + + + &Fixed size + + + + + Align + + + + + Canvases + + + + + + + + + + pixels + 像素 + + + + Height + 高度 + + + + Unit + 单位 + + + + inch + 英寸 + + + + mm + 毫米 + + + + cm + 厘米 + + + + point + + + + + pixel + 像素 + + + + &Keep aspect ratio + 保持宽高比(&K) + + + + Spacing + 间距 + + + + Columns gap + 列间距 + + + + Rows gap + 行间距 + + + + Margins + 页边距 + + + + Left margin + 左页边距 + + + + Right margin + 右页边距 + + + + Top margin + 上页边距 + + + + Bottom margin + 下页边距 + + + + &Apply + 应用(&A) + + + + &OK + 确定(&O) + + + + Co&mmon axes + + + + + + &Cancel + 取消(&C) + + + + Swap Layers + 交换图层 + + + + Source Layer + 源图层 + + + + Destination Layer + 目的图层 + + + + &Swap + 交换(&S) + + + + QtiPlot - Delete Layers? + QtiPlot - 删除图层? + + + + You are about to delete %1 existing layers. + 你将要删除已存在的%1图层。 + + + + Are you sure you want to continue this operation? + 你确定要继续此次操作? + + + + &Continue + 继续(&C) + + + + QtiPlot - Columns input error + QtiPlot - 列输入错误 + + + + The number of columns you've entered is greater than the number of graphs (%1)! + 你输入的列数超过了图像数(%1)! + + + + QtiPlot - Rows input error + QtiPlot - 行输入错误 + + + + The number of rows you've entered is greater than the number of graphs (%1)! + 你输入的行数超过了图像数(%1)! + + + + QtiPlot - Error + QtiPlot - 错误 + + + + Please enter different indexes for the source and destination layers! + 请为源和目的图层输入不同的索引号! + + + + LineDialog + + + QtiPlot - Line options + QtiPlot - 线状图选项 + + + + Color + 颜色 + + + + Type + 类型 + + + + Width + + + + + Arrow at &start + 起点处箭头(&s) + + + + Arrow at &end + 终点处箭头(&e) + + + + &Line + 线(&L) + + + + Length + + + + + Angle + 角度 + + + + &Filled + 填充(&F) + + + + Arrow &Head + 箭头头部(&H) + + + + Set &Default + 设为默认(&D) + + + + &Apply + 应用(&A) + + + + &Ok + 确定(&O) + + + + Page + + + + + Layer Scales + 层比例尺 + + + + Attach to + 附加至 + + + + Scale Coordinates + 缩放坐标系 + + + + Pixels + 像素 + + + + Unit + 单位 + + + + Start Point + 起点 + + + + + X + X + + + + + Y + Y + + + + End Point + 终点 + + + + &Geometry + 布局(&G) + + + + LineProfileTool + + + + QtiPlot - Pixel selection warning + QtiPlot - 像素选择警告 + + + + Please select an image marker first. + 请首先选择一个图像记号。 + + + + Please select the end line point inside the image rectangle! + 请在图像框内选择终点指向! + + + + pixel + 像素 + + + + intensity + 强度 + + + + x + x + + + + y + y + + + Table + 表格 + + + + pixels + 像素 + + + + pixel intensity (a.u.) + 像素强度(a.u.) + + + + LinearFit + + + Linear Regression + 线性回归 + + + + Linear + 线性 + + + + QtiPlot - Fit Error + QtiPlot - 拟合错误 + + + + You need at least %1 data points for this fit operation. Operation aborted! + 你需要至少%1个数据点来拟合。操作中止! + + + + LinearSlopeFit + + + Linear Regression + 线性回归 + + + + LinearSlope + 线性斜率 + + + + QtiPlot - Fit Error + QtiPlot - 拟合错误 + + + + You need at least %1 data points for this fit operation. Operation aborted! + 你需要至少%1个数据点来拟合。操作中止! + + + + LogisticFit + + + Logistic + 逻辑斯蒂 + + + + init value + 初始值 + + + + final value + 终止值 + + + + center + 中心 + + + + power + + + + + Logistic Fit + 逻辑斯蒂拟合 + + + + LorentzFit + + + Lorentz + 洛仑兹 + + + + Lorentz Fit + 洛仑兹拟合 + + + + area + 面积 + + + + center + 中心 + + + + width + 宽度 + + + + offset + 偏移 + + + + Matrix + + + Set Dimensions + 设置维度 + + + + + + + + QtiPlot - Error + QtiPlot - 错误 + + + + Calculation failed, the matrix is not square! + 计算失败,矩阵不是方阵! + + + + + + + + + QtiPlot + QtiPlot + + + + + + + + Memory Allocation Error + 内存分配错误 + + + + + + + + Not enough memory, operation aborted! + 内存不足,操作中止! + + + + Inversion failed, the matrix is not square! + 求逆失败,矩阵不是方阵! + + + + Invert + 求逆 + + + + Transpose + 转置 + + + + Flip Vertically + 垂直翻转 + + + + Flip Horizontally + 水平翻转 + + + + Rotate 90° + 旋转90° + + + + Rotate -90° + 旋转-90° + + + + + Calculate Values + 计算值 + + + + Clear Selection + 清除所选 + + + + Paste + 粘贴 + + + + Delete Rows + 删除行 + + + + Delete Columns + 删除列 + + + + Insert Row + 插入行 + + + + Insert Column + 插入列 + + + + + Please provide a valid file name! + 请提供有效的文件名! + + + + File format not handled, operation aborted! + 无法处理的文件格式,操作中止! + + + + + Set Data Mode + 设置数据模式 + + + + Ctrl+A + Matrix: select all + Ctrl+A + + + + + Import Image + 导入图像 + + + + Inverse FFT + 逆FFT + + + + Forward FFT + 正FFT + + + + QtiPlot - ASCII Export Error + QtiPlot - ASCII导出错误 + + + + Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! + 无法写入文件: <br><h4> %1</h4><p>请保证你在这个位置有写权限! + + + + Import ASCII File + 导入ASCII文件 + + + + Due to memory limitations it will not be possible to undo this change. Do you want to continue anyways? + 因为内存限制而无法撤销此变化。你想继续吗? + + + + Warning + 警告 + + + + kB + kB + + + + MatrixDialog + + + QtiPlot - Matrix Properties + QtiPlot - 矩阵属性 + + + + Cell Width + 单元宽度 + + + + Data Format + 数据格式 + + + + Decimal: 1000 + 十进制: 1000 + + + + Scientific: 1E3 + 科学计数法: 1E3 + + + + Numeric Display + 数字显示 + + + + Default Decimal Digits + 默认小数位数 + + + + Significant Digits= + 有效位数= + + + + &Apply + 应用(&A) + + + + &OK + 确定(&O) + + + + &Cancel + 取消(&C) + + + + Set Columns Width + 设置列宽 + + + + Decimal + 十进制 + + + + Scientific + 科学计数法 + + + + Set Data Format %1 + 设置数据格式%1 + + + + Precision %1 digits + 精确到%1位 + + + + MatrixModel + + + Edited cell + 已编辑单元 + + + + + + + QtiPlot + QtiPlot + + + + + Input Size Error + 输入尺寸错误 + + + + The dimensions you have specified are not acceptable! + 你指定的维度不可接受! + + + + Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! + 请输入一个正值,保证行*列的乘积不会超过系统允许的整数最大值! + + + + + Memory Allocation Error + 内存分配错误 + + + + + Not enough memory, operation aborted! + 内存不足,操作中止! + + + + Multiline expressions take much more time to evaluate! Do you want to continue anyways? + 多行表达式需要很多的时间计算!你希望继续吗? + + + + Warning + 警告 + + + + MatrixSizeDialog + + + QtiPlot - Matrix Dimensions + QtiPlot - 矩阵维度 + + + + Dimensions + 维度 + + + + Rows + + + + + Columns + + + + + Coordinates + 坐标系 + + + + X (Columns) + X (列) + + + + Y (Rows) + Y (行) + + + + First + 第一项 + + + + Last + 最后一项 + + + + &Apply + 应用(&A) + + + + &OK + 确定(&O) + + + + &Cancel + 取消(&C) + + + + Set Coordinates x[%1 : %2], y[%3 : %4] + 设置坐标系 x[%1 : %2], y[%3 : %4] + + + + MatrixValuesDialog + + + QtiPlot - Set Matrix Values + QtiPlot - 设置矩阵值 + + + + For row (i) + row (i) + + + + + to + + + + + For col (j) + For col (j) + + + + Add &Function + 添加函数(&F) + + + + Add Ce&ll + 添加单元(&l) + + + + &Apply + 应用(&A) + + + + &Close + 关闭(&C) + + + + Use built-in muParser (much faster) + 使用内置muParser(快很多) + + + + Cell(i,j)= + Cell(i,j)= + + + + Set New Formula + 设置新方程式 + + + + MdiSubWindow + + + QtiPlot + QtiPlot + + + + Do you want to hide or delete + 你确实想要隐藏或者删除 + + + + Delete + 删除 + + + + Hide + 隐藏 + + + + Cancel + 取消 + + + + Normal + 普通 + + + + Minimized + 最小化 + + + + Maximized + 最大化 + + + + Hidden + 隐藏 + + + + B + 粗体 + + + + MultiLayer + + + Add layer + 添加层 + + + + Remove active layer + 移除活动层 + + + + QtiPlot - Guess best layout? + QtiPlot - 猜测最优布局? + + + + Do you want QtiPlot to rearrange the remaining layers? + 你希望QtiPlot重排现在的图层吗? + + + + &Yes + 是(&Y) + + + + &No + 否(&N) + + + + &Cancel + 取消(&C) + + + + + + QtiPlot - Error + QtiPlot - 错误 + + + + + Please provide a valid file name! + 请提供有效的文件名! + + + + File format not handled, operation aborted! + 无法处理的文件格式,操作中止! + + + + kB + kB + + + + Offset Amount... + 偏移量... + + + + Reverse Order + 逆序 + + + + Fill Area... + 填充区域... + + + + Offset Dialog + 偏移设置窗口 + + + + Total Y Offset (%) + 总Y偏移(%) + + + + Total X Offset (%) + 总X偏移(%) + + + + &Apply + 应用(&A) + + + + + &Close + 关闭(&C) + + + + Fill Curves + 填充曲线 + + + + Enable Fill + 启用填充 + + + + Fill with Color + 填充色 + + + + Side Lines + 边线 + + + + MultiPeakFit + + + Gauss + 高斯 + + + + Lorentz + 洛仑兹 + + + + Gauss Fit + 高斯拟合 + + + + Lorentz Fit + 洛仑兹拟合 + + + + multi-peak + 多峰 + + + + + area + 面积 + + + + + center + 中心 + + + + + width + 宽度 + + + + + offset + 偏移 + + + + + + Peak + + + + + + + Fit + 拟合 + + + + QtiPlot - Fit Error + QtiPlot - 拟合错误 + + + + Could not allocate enough memory for the fit curves! + 不能为拟合曲线分配足够的内存! + + + + fit of + 拟合 + + + + + peak + + + + + Area + 面积 + + + + Center + 中心 + + + + Width + + + + + Height + + + + + MultiPeakFitTool + + + Move cursor and click to select a point and double-click/press 'Enter' to set the position of a peak! + 移动光标并点击来选取一个点、双击/回车来设置一个峰值位置! + + + + Peak %1 selected! Click to select a point and double-click/press 'Enter' to set the position of the next peak! + %1峰已选择!点击选取一个点、双击/回车来设置下一个峰值的位置! + + + + NonLinearFit + + + NonLinear + 非线性 + + + + Non-linear Fit + 非线性拟合 + + + + + QtiPlot - Input function error + QtiPlot - 输入函数错误 + + + + Please enter a valid non-empty expression! Operation aborted! + 请键入一个有效的非空表达式!操作中止! + + + + + QtiPlot - Fit Error + QtiPlot - 拟合错误 + + + + There are no parameters specified for this fit operation. Please define a list of parameters first! + 拟合操作没有定义参数。请首先定义参数表! + + + + You must provide a list containing at least one parameter for this type of fit. Operation aborted! + 你必须提供至少包含一个此种拟合参数的参数表。操作中止! + + + + + constant + 常数 + + + + Ignore + 忽略 + + + + Note + + + Add tab + 添加标签页 + + + + Please, enter new title: + 请输入新标题: + + + + Title + 标题 + + + + untitled + 未命名 + + + + OpenProjectDialog + + + QtiPlot - Open Project + QtiPlot - 打开项目 + + + + QtiPlot project + QtiPlot项目 + + + + Compressed QtiPlot project + 压缩的QtiPlot项目 + + + + Origin project + Origin项目 + + + + Origin matrix + Origin矩阵 + + + + Origin worksheet + Origin工作表 + + + + Origin graph + Origin图像 + + + + Backup files + 备份文件 + + + + Excel + Excel + + + + ODF Spreadsheet + ODF工作表 + + + + All files + 所有文件 + + + + Open As + 打开为 + + + + New Project Window + 新建项目窗口 + + + + New Folder + 新建文件夹 + + + + PatternBox + + + Solid + 实心 + + + + Horizontal + 水平 + + + + Vertical + 垂直 + + + + Cross + 交叉 + + + + BDiagonal + B对角 + + + + FDiagonal + F对角 + + + + DiagCross + 45度交叉 + + + + Dense1 + 密度1 + + + + Dense2 + 密度2 + + + + Dense3 + 密度3 + + + + Dense4 + 密度4 + + + + Dense5 + 密度5 + + + + Dense6 + 密度6 + + + + Dense7 + 密度7 + + + + None + 不选 + + + + Plot3DDialog + + + QtiPlot - Surface Plot Options + QtiPlot - 曲面图选项 + + + + &Apply + 应用(&A) + + + + &OK + 确定(&O) + + + + &Cancel + 取消(&C) + + + + Scale to paper si&ze + 缩放到纸张尺寸(&z) + + + + Print Crop&marks + 打印截角标记(&m) + + + + &Print + 打印(&P) + + + + + X + X + + + + + Y + Y + + + + + Z + u + + + + From + + + + + To + + + + + Type + 类型 + + + + linear + 线性 + + + + logarithmic + 对数 + + + + Major Ticks + 主刻度 + + + + Minor Ticks + 次刻度 + + + + Tick Labels + + + + + Format + 格式 + + + + Automatic + 自动 + + + + Decimal: 10000.0 + 十进制: 10000.0 + + + + Scientific: 1e4 + 科学计数法: 1E4 + + + + Engineering: 10k + 工程计数: 10k + + + + Precision + 精度 + + + + &Scale + 比例(&S) + + + + Title + 标题 + + + + Axis Font + 轴字体 + + + + &Choose font + 选择字体(&C) + + + + Major Ticks Length + 主刻度长度 + + + + Minor Ticks Length + 次刻度长度 + + + + &Axis + 轴(&A) + + + + Co&lor + 颜色(&l) + + + + &Font + 字体(&F) + + + + &Title + 标题(&T) + + + + Linea&r color map + 线性颜色表(&r) + + + + Color map &file + 颜色表文件(&f) + + + + + + None + 不选 + + + + Opacity + 不透明度 + + + + &Line + 线(&L) + + + + &Background + 背景(&B) + + + + General + 常规 + + + + A&xes + 轴(&x) + + + + Lab&els + 标签(&e) + + + + &Numbers + 数字(&N) + + + &Grid + 栅格(&G) + + + + Coordinate System + 坐标系 + + + + &Colors + 颜色(&C) + + + + Show Legend + 显示图例 + + + + Orthogonal + 正交 + + + + + Line Width + 线宽 + + + + Resolution + 分辨率 + + + + Numbers Font + 数字字体 + + + + &Choose Font + 选择字体(&C) + + + + Distance labels - axis + 标签 - 轴距离 + + + + Zoom (%) + 缩放(%) + + + + X Zoom (%) + X缩放(%) + + + + Y Zoom (%) + Y缩放(%) + + + + Z Zoom (%) + Z缩放(%) + + + + &General + 常规(&G) + + + + Ma&jor Grids + 主栅格(&j) + + + + Mi&nor Grids + 次栅格(&n) + + + + Color + 颜色 + + + + + Style + 样式 + + + + + Solid + 实心 + + + + + Dash + 虚线 + + + + + + Dot + + + + + + Dash Dot + 点划线 + + + + + Dash Dot Dot + 点划线点点 + + + + + Short Dash + 短划线 + + + + + Short Dot + 短点线 + + + + + Short Dash Dot + 短点划线 + + + + G&rid + 栅格(&r) + + + + Cross Hair + 叉丝 + + + + Cone + 圆锥体 + + + + + + + Width + 宽度 + + + + Smooth angles + 平滑角 + + + + Radius + 半径 + + + + Smooth line + 平滑线 + + + + Boxed + 箱形框 + + + + Quality + 质量 + + + + Points + + + + + &Worksheet + 工作表(&W) + + + + &Matrix + 矩阵(&M) + + + + Draw lines + 画线 + + + + Filled bars + 填充棒 + + + + Bars + + + + + PlotDialog + + + QtiPlot - Plot details + QtiPlot - 绘图详情 + + + + Plot type + 绘图类型 + + + + &Worksheet + 工作表(&W) + + + + &OK + 确定(&O) + + + + &Cancel + 取消(&C) + + + + &Apply + 应用(&A) + + + + + &Plot Associations... + 绘图关联(&P)... + + + + Titles + 标题 + + + + Axes Labels + 轴标签 + + + + Axes Numbers + 轴数字 + + + + Legends + 图例 + + + + + Fonts + 字体 + + + + Background Color + 背景颜色 + + + + + + Opacity + 不透明度 + + + + + + Transparent + 透明 + + + + Canvas Color + 画布颜色 + + + + Border Color + 边框颜色 + + + + + + + + Width + 宽度 + + + + Antialiasing + 反锯齿 + + + + Margin + 页边距 + + + + Set As &Default + 设为默认(&D) + + + + + + Apply &to... + 应用到(&t)... + + + + + + + + + + + + + Layer + 图层 + + + + + + + + + Window + 窗口 + + + + + + + + + All Windows + 所有窗口 + + + + + inch + 英寸 + + + + + mm + 毫米 + + + + + cm + 厘米 + + + + + point + + + + + + pixel + 像素 + + + + + Unit + 单位 + + + + + Origin + Origin + + + + + X= + X= + + + + + Y= + Y= + + + + + + + Size + 大小 + + + + + width= + 宽= + + + + + height= + 高= + + + + + Keep aspect ratio + 保持宽高比 + + + + + + Geometry + 布局 + + + + &Speed Mode, Skip Points if needed + 加速模式,如果必要会跳过一些点(&S) + + + + data points + 数据点 + + + + Apply to curves with more than: + 应用到曲线用多余: + + + Tolerance (Douglas Peuker algorithm) + 容差(Douglas Peuke算法) + + + + + + Speed + 加速 + + + + + + + + + Color + 颜色 + + + + + + + + Style + 样式 + + + + Border + 边界 + + + + First color + 第一颜色 + + + + + + + + + Pattern + 图案 + + + + Fill + 填充 + + + + 3D View + 三维视图 + + + + View Angle (deg) + 视角(度) + + + + Thickness (% of radius) + 厚(半径的百分比) + + + + Rotation + 旋转 + + + + Starting Azimuth (deg) + 起始方位角(度) + + + + Counter cloc&kwise + 顺时针计数(&k) + + + + Radius/Center + 半径/中心 + + + + Radius (% of frame) + 半径(框架的百分比) + + + + Horizontal Offset (% of frame) + 水平偏移(框架的百分比) + + + + + Pie Geometry + 饼状图几何属性 + + + + Automatic &Format + 自动格式化(&F) + + + + &Values + 值(&V) + + + + &Percentages + 百分比(&P) + + + + Categories/&Rows + 类别/行(&R) + + + + Associate Position with &Wedge + 用楔子关联位置(&W) + + + + Dist. from Pie Edge + 到饼状图边缘的距离 + + + + + + + + Labels + 标签 + + + + &Scale layers to paper size + 缩放图层到纸张尺寸(&S) + + + + Print Crop&marks + 打印截角标记(&m) + + + + + Print + 打印 + + + + &Show + 显示(&S) + + + + Column + + + + + White O&ut + 不透明(&u) + + + + Justify + 证明 + + + + Center + 居中 + + + + + + Left + 左对齐 + + + + + + Right + 右对齐 + + + + &Font + 字体(&F) + + + + Rotate (deg) + 旋转(角度) + + + + Link &X axes + + + + + + Miscellaneous + + + + + Scale &Fonts + 缩放字体(&F) + + + + Do not &resize layers when window size changes + 当窗口尺寸变化的时候不改变图层尺寸(&r) + + + + + Dimensions + 维度 + + + + 0 (all data points) + + + + + Tolerance (Douglas-Peucker algorithm) + + + + + X Offset (font height %) + X偏移(字体高度百分比) + + + + Y Offset (font height %) + Y偏移(字体高度百分比) + + + + Attach curve to: + 附加曲线至: + + + + x Axis + X轴 + + + + + Bottom + + + + + + Top + + + + + y Axis + Y轴 + + + + + Axes + + + + + Connect + 连接 + + + + No line + 没有线 + + + + Lines + 线 + + + + Sticks + + + + + Horizontal Steps + 水平阶梯图 + + + + Dots + + + + + Spline + 齿形图 + + + + Vertical Steps + 垂直阶梯图 + + + + + + Apply Format &to + 应用格式至(&t) + + + + + + Selected Curve + 选择曲线 + + + + Fill area under curve + 填充曲线下方区域 + + + + Fill color + 填充颜色 + + + + + + + Line + 线 + + + + + Fill Color + 填充颜色 + + + + + Edge Color + 边缘颜色 + + + + + Edge Width + 边缘宽度 + + + + + Skip Points + 跳过点 + + + + + None + 不选 + + + + + + + Symbol + 符号 + + + + + Box + 箱形框 + + + + + Type + 类型 + + + + No Box + 无边框 + + + + Rectangle + 矩形 + + + + Diamond + 菱形 + + + + Perc 10, 25, 75, 90 + 百分比 10, 25, 75, 90 + + + + Notch + V型切口 + + + + + Range + 范围 + + + + + + Standard Deviation + 标准差 + + + + + Standard Error + 标准误差 + + + + Perc 25, 75 + 百分比 25, 75 + + + + Perc 10, 90 + 百分比 10, 90 + + + + Perc 5, 95 + 百分比 5, 95 + + + + Perc 1, 99 + 百分比 1, 99 + + + + + Max-Min + 最大-最小 + + + + + Constant + 常数 + + + + + Percentile (%) + 百分比(%) + + + + Coefficient + 系数 + + + + Box Width + 箱形宽度 + + + + Whiskers + 有须 + + + + No Whiskers + 无须 + + + + 75-25 + 75-25 + + + + 90-10 + 90-10 + + + + 95-5 + 95-5 + + + + 99-1 + 99-1 + + + + Coef + 系数 + + + + + Box/Whiskers + 箱形图 + + + + Max + 最大值 + + + + 99% + 99% + + + + + Mean + 平均值 + + + + 1% + 1% + + + + Min + 最小值 + + + + + Percentile + 百分比 + + + + + Image + 图像 + + + + &Gray Scale + 灰阶(&G) + + + + &Default Color Map + 默认颜色表(&D) + + + + &Custom Color Map + 自定义颜色表(&C) + + + + + Contour Lines + 等值线图 + + + + Levels + + + + + Use &Color Map + 使用颜色表(&C) + + + + Use Default &Pen + 使用默认笔触(&P) + + + + Color Bar Scale + 颜色棒比例 + + + + Axis + + + + + Contour + 等值线 + + + + Direction + 方向 + + + + Plus + + + + + Minus + + + + + &X Error Bar + &X误差棒 + + + + + Line Width + 线宽 + + + + Cap Width + 冠宽度 + + + + 8 + 8 + + + + 10 + 10 + + + + 12 + 12 + + + + 16 + 16 + + + + 20 + 20 + + + + Through Symbol + 贯穿符号 + + + + + + Error Bars + 误差棒 + + + + Automatic Binning + 自动Binning + + + + &Show statistics + 显示统计信息(&S) + + + + Bin Size + Bin尺寸 + + + + Begin + 开始 + + + + End + 结束 + + + + + Histogram Data + 直方图数据 + + + + Gap Between Bars (in %) + 棒间间隔(%) + + + + Offset (in %) + 偏移(%) + + + + + Spacing + 间距 + + + + Arrowheads + 箭头头部 + + + + Length + 长度 + + + + + Angle + 角度 + + + + &Filled + 填充(&F) + + + + + End Point + 终点 + + + + + X End + X终点 + + + + + Y End + Y终点 + + + + Position + 位置 + + + + Tail + 尾部 + + + + Middle + 中部 + + + + Head + 头部 + + + + + Vector + 矢量 + + + + + + Bins + Bins + + + + + Histogram and Probabilities for + 直方图和几率 + + + + Quantity + 数量 + + + + Sum + + + + + Percent + 百分比 + + + + Minimum + 最小 + + + + Maximum + 最大 + + + + &Delete + 删除(&D) + + + &Edit... + 编辑(&E)... + + + + + Colors + 颜色 + + + + &Function + 函数(&F) + + + + Pie + 饼状图 + + + + Vertical Bars + 垂直棒状图 + + + + Horizontal Bars + 水平棒状图 + + + + Histogram + 直方图 + + + + Vector XYXY + 矢量图XYXY + + + + Vector XYAM + 矢量图XYAM + + + + Scatter + 散点图 + + + + Line + Symbol + 线状图+符号 + + + + + + + QtiPlot - Input error + QtiPlot - 输入错误 + + + + Please enter a valid start limit! + 请输入有效的起始限制! + + + + Please enter a valid end limit! + 请输入有效的结束限制! + + + + Please enter a valid bin size value! + 请输入一个有效的bin尺寸值! + + + + QtiPlot - Start limit error + QtiPlot - 起始限制错误 + + + + QtiPlot - End limit error + QtiPlot - 结束限制错误 + + + + Please enter limits that satisfy: begin < end! + 请输入限制满足begin < end! + + + + + QtiPlot - Bin size input error + QtiPlot - Bin尺寸输入错误 + + + + Please enter a positive bin size value! + 请输入一个正的bin尺寸值! + + + + Vector Data + 矢量图数据 + + + + Magnitude + + + + + Matrix + 矩阵 + + + + Use matrix formula to calculate values + 用矩阵式计算值 + + + + + Values + + + + + &Show Contour Lines + 显示等值线图(&S) + + + + Set Equidistant Levels + 设置等距级数 + + + + Start + 开始 + + + + Step + 步长 + + + + Set &Levels + 设置等级(&L) + + + + Pen + 笔触 + + + + Use &Table Custom Pen + 使用表格自定义笔触(&T) + + + + PlotWizard + + + QtiPlot - Select Columns to Plot + QtiPlot - 选择需绘制列 + + + + &X + &X + + + + x&Err + x&Err + + + + &Y + &Y + + + + yE&rr + yE&rr + + + + &Z + &Z + + + + &New curve + 新建曲线(&N) + + + + &Delete curve + 删除曲线(&D) + + + + Worksheet + 工作表 + + + + &Plot + 绘图(&P) + + + + &Close + 关闭(&C) + + + + + + + + + + + + + + + + + + + QtiPlot - Error + QtiPlot - 错误 + + + + Please define a Y column for the following curve + 请为以下曲线定义Y列 + + + + You have already defined a X column! + 你已经定义了一个X列! + + + + + + + You must define a X column first! + 首先你需要定义一个X列! + + + + You have already defined a Y column! + 你已经定义了一个Y列! + + + + + + This kind of curve is not handled by QtiPlot! + QtiPlot不能处理此种曲线! + + + + You have already defined a Z column! + 你已经定义了一个Z列! + + + + + You must define a Y column first! + 首先你需要定义一个Y列! + + + + + You have already defined an error-bars column! + 你已经定义了一个误差棒列! + + + + You must add a new curve first! + 首先你需要定义一个Y列! + + + + PluginFit + + + Plugin Fit + 通过插件拟合 + + + + QtiPlot - File not found + QtiPlot - 文件未找到 + + + + Plugin file: <p><b> %1 </b> <p>not found. Operation aborted! + 插件文件:<p><b> %1 </b> <p>未找。操作中止! + + + + + + + QtiPlot - Plugin Error + QtiPlot - 插件错误 + + + + The plugin does not implement a %1 method necessary for simplex fitting. + 这个插件不能执行一个简单拟合所需的%1方法。 + + + + + + The plugin does not implement a %1 method necessary for Levenberg-Marquardt fitting. + 这个插件不能执行一个Levenberg-Marquardt拟合所需的%1方法。 + + + + PolynomFitDialog + + + QtiPlot - Polynomial Fit Options + QtiPlot - 多项式拟合选项 + + + + Polynomial Fit of + 多项式拟合 + + + + Order (1 - 9, 1 = linear) + 阶(1 - 9, 1 = 线性) + + + + Fit curve # pts + 拟合曲线 # pts + + + + Not enough points + 没有足够的点 + + + + Fit curve Xmin + 拟合曲线Xmin + + + + Fit curve Xmax + 拟合曲线Xmax + + + + Color + 颜色 + + + + Show Formula on Graph? + 在图上显示方程式? + + + + &Fit + 拟合(&F) + + + + &Close + 关闭(&C) + + + + QtiPlot - Warning + QtiPlot - 警告 + + + + The curve <b> %1 </b> doesn't exist anymore! Operation aborted! + 曲线<b> %1 </b>不再存在!操作中止! + + + + PolynomialFit + + + Polynomial + 多项式 + + + + Polynomial Fit + 多项式拟合 + + + + QtiPlot - Fit Error + QtiPlot - 拟合错误 + + + + You need at least %1 data points for this fit operation. Operation aborted! + 你需要至少%1个数据点来拟合。操作中止! + + + + PreviewTable + + + Numeric + 数字 + + + + Text + 文本 + + + + Date + 日期 + + + + Time + 时间 + + + + Month + + + + + Day + + + + + Choose column type + + + + + Column type: + + + + + PythonScripting + + + Failed to export QtiPlot API + 导出QtiPlot API失败 + + + + Couldn't find initialization files + 找不到初始化文件 + + + + Please indicate the correct path to the Python configuration files in the preferences dialog. + 请在配置对话框确定正确的Python配置文件路径。 + + + Accessing QtiPlot functions or objects from Python code won't work.Probably your version of SIP differs from the one QtiPlot was compiled against. + 从Python代码访问QtiPlot函数或对象失败。很可能你的SIP版本与QtiPlot编译所需的不符合。 + + + + Accessing QtiPlot functions or objects from Python code won't work. Probably your version of Qt/SIP/PyQt differs from the one QtiPlot was compiled against. + 从Python代码访问QtiPlot函数或对象失败。很可能你的SIP版本与QtiPlot编译所需的不符合。 + + + + QObject + + + The file is not an QtiPlot fit model file. + 这个文件不是一个QtiPlot拟合模型文件。 + + + + The file is not an QtiPlot fit model version 1.0 file. + 这个文件不是一个QtiPlot拟合模型1.0版本的文件。 + + + + The file is not a QtiPlot custom action file. + 这个文件不是一个QtiPlot自定义动作文件。 + + + + The file is not an QtiPlot custom action version 1.0 file. + 这个文件不是一个QtiPlot自定义动作1.0版本的文件。 + + + + The file is not a QtiPlot custom menu file. + 这个文件不是一个QtiPlot自定义菜单文件。 + + + + The file is not a QtiPlot custom menu version 1.0 file. + 这个文件不是一个QtiPlot自定义菜单1.0版本的文件。 + + + + QtiPlot - Script Error + QtiPlot - 脚本错误 + + + + Python-like syntax is not supported in this case since it severely reduces drawing speed! + 类Python语法在这里不支持因为它会降低绘图速度! + + + + + QtiPlot + QtiPlot + + + + Found non-removable singularity at x = %1. + 在x = %1处找到不可移除奇点. + + + + abs(x): + Absolute value of x. + + + + + acos(x): + Inverse cos function. + + + + + acosh(x): + Hyperbolic inverse cos function. + + + + + asin(x): + Inverse sin function. + + + + + asinh(x): + Hyperbolic inverse sin function. + + + + + atan(x): + Inverse tan function. + + + + + atanh(x): + Hyperbolic inverse tan function. + + + + + avg(x,y,...): + Mean value of all arguments. + + + + + bessel_j0(x): + Regular cylindrical Bessel function of zeroth order, J_0(x). + + + + + bessel_j1(x): + Regular cylindrical Bessel function of first order, J_1(x). + + + + + bessel_jn(double x, int n): + Regular cylindrical Bessel function of order n, J_n(x). + + + + + bessel_jn_zero(double n, unsigned int s): + s-th positive zero x_s of regular cylindrical Bessel function of order n, J_n(x_s)=0 + + + + + bessel_y0(x): + Irregular cylindrical Bessel function of zeroth order, Y_0(x), for x>0. + + + + + bessel_y1(x): + Irregular cylindrical Bessel function of first order, Y_1(x), for x>0. + + + + + bessel_yn(double x, int n): + Irregular cylindrical Bessel function of order n, Y_n(x), for x>0. + + + + + beta(a,b): + Computes the Beta Function, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) for a > 0, b > 0. + + + + + ceil(x): + Round to the next larger integer, + smallest integer larger or equal to x. + + + + + cos(x): + Calculate cosine. + + + + + cosh(x): + Hyperbolic cos function. + + + + + erf(x): + The error function. + + + + + erfc(x): + Complementary error function erfc(x) = 1 - erf(x). + + + + + erfz(x): + The Gaussian probability density function Z(x). + + + + + erfq(x): + The upper tail of the Gaussian probability function Q(x). + + + + + exp(x): + Exponential function: e raised to the power of x. + + + + + floor(x): + Round to the next smaller integer, + largest integer smaller or equal to x. + + + + + gamma(x): + Computes the Gamma function, subject to x not being a negative integer. + + + + + gammaln(x): + Computes the logarithm of the Gamma function, subject to x not a being negative integer. For x<0, log(|Gamma(x)|) is returned. + + + + + gauss_cdf(x, sigma): + Computes the cumulative distribution function for a Gaussian distribution with standard deviation sigma. + + + + + gauss_pdf(x, sigma): + Computes the probability density at x for a Gaussian distribution with standard deviation sigma. + + + + + hazard(x): + Computes the hazard function for the normal distribution h(x) = erfz(x)/erfq(x). + + + + + if(e1, e2, e3): + if e1 then e2 else e3. + + + + + inv_gauss_cdf(x, sigma): + Computes the inverse of the cumulative distribution function for a Gaussian distribution with standard deviation sigma. + + + + + ln(x): + Calculate natural logarithm log_e. + + + + + log(x): + Calculate decimal logarithm log_10. + + + + + log10(x): + Calculate decimal logarithm log_10. + + + + + log2(x): + Calculate binary logarithm log_2. + + + + + min(x,y,...): + Calculate minimum of all arguments. + + + + + max(x,y,...): + Calculate maximum of all arguments. + + + + + mod(x,y): + Calculate rest of integer division x/y, + x modulo y. + + + + + pow(x,y): + Raise x to the power of y, x^y. + + + + + rint(x): + Round to nearest integer. + + + + + rnd(seed): + Returns a pseudo-random number in the range 0 to 1. Calling this function several times with the same seed will return the same value. + + + + + sign(x): + Sign function: -1 if x<0; 1 if x>0. + + + + + sin(x): + Calculate sine. + + + + + sinh(x): + Hyperbolic sin function. + + + + + sqrt(x): + Square root function. + + + + + sum(x,y,...): + Calculate sum of all arguments. + + + + + tan(x): + Calculate tangent function. + + + + + tanh(x): + Hyperbolic tan function. + + + + + ttable(x, n): + Student's t-distribution with n degrees of freedom. + + + + + w0(x): + Compute the principal branch of Lambert's W function, W_0(x). + W is defined as a solution to the equation W(x)*exp(W(x))=x. + For x<0, there are two real-valued branches; this function computes the one where W>-1 for x<0 (also see wm1(x)). + + + + + wm1(x): + Compute the secondary branch of Lambert's W function, W_{-1}(x). + W is defined as a solution to the equation W(x)*exp(W(x))=x. + For x<0, there are two real-valued branches; this function computes the one where W<-1 for x<0. (also see w0(x)). + + + + + AVG("colName", i, j): + The average of all cells from row i to j in column colName. + + + + + SUM("colName", i, j): + The sum of all cells from row i to j in column colName. + + + + + + QtiPlot - Memory Allocation Error + QtiPlot - 内存分配错误 + + + + + Not enough memory, operation aborted! + 内存不足,操作中止! + + + + The function %1 is not defined in the specified interval! + 函数%1在指定区间没有定义! + + + + QtColorPicker + + + + + Black + + + + + + White + + + + + + Red + + + + + + Dark red + 深红 + + + + + Green + 绿 + + + + + Dark green + 深绿 + + + + + Blue + + + + + + Dark blue + 深蓝 + + + + + Cyan + + + + + + Dark cyan + 藏青 + + + + + Magenta + 紫红 + + + + + Dark magenta + 深紫红 + + + + + Yellow + + + + + + Dark yellow + 深黄 + + + + + Gray + + + + + + Dark gray + 深灰 + + + + + Light gray + 浅灰 + + + + Custom + 自定义 + + + + RangeSelectorTool + + + + + + + + QtiPlot - Warning + QtiPlot - 警告 + + + + All the curves on this plot are empty! + 此次绘制的所有曲线都为空! + + + + Click or use Ctrl+arrow key to select range (arrows select active cursor)! + 点击或用Ctrl+方向键来选择范围(箭头选择活动光标)! + + + + + + Right + + + + + + + Left + + + + + + + + + The column '%1' is read-only! Operation aborted! + 列'%1'是只读!操作中止! + + + + Remove data from curves? + 是否从曲线移除数据? + + + + Copy data to clipboard? + 是否拷贝数据到剪贴板? + + + + RenameWindowDialog + + + QtiPlot - Rename Window + QtiPlot - 重命名窗口 + + + + Window Title + 窗口标题 + + + + &Name (single word) + 名称(单个词)(&N) + + + + &Label + 标签(&L) + + + + &Both Name and Label + 名称和标签(&B) + + + + &OK + 确定(&O) + + + + &Cancel + 取消(&C) + + + + QtiPlot - Warning + QtiPlot - 警告 + + + + For internal consistency reasons the underscore character is replaced with a minus sign. + 因为内部一致性原因,画线字符被减号替代。 + + + + ScreenPickerTool + + + Click on plot or move cursor to display coordinates! + 在图上点击或者移动鼠标来显示坐标系! + + + + ScriptEdit + + + E&xecute + 执行(&x) + + + + Ctrl+J + Ctrl+J + + + + Execute &All + 全部执行(&A) + + + + Ctrl+Shift+J + Ctrl+Shift+J + + + + &Evaluate Expression + 计算表达式(&E) + + + + Ctrl+Return + Ctrl+Return + + + + &Print + 打印(&P) + + + + &Import... + 导入(&I)... + + + + &Save + 保存(&S) + + + + Sa&ve as... + 另存为(&v)... + + + + &Find... + 查找(&F)... + + + + &Replace... + 替换(&R)... + + + + &Find next + 查找下一条(&F) + + + + &Find previous + 查找上一条(&F) + + + + Rena&me Tab... + 重命名标签(&m)... + + + + A&dd Tab + 添加标签(&d) + + + + C&lose Tab + 关闭标签(&l) + + + + Auto&exec + 自动执行(&e) + + + + &Functions + 函数(&F) + + + + + Text + 文本 + + + + + All Files + 所有文件 + + + + QtiPlot - Import Text From File + QtiPlot - 从文件导入文本 + + + + QtiPlot - Error Opening File + QtiPlot - 打开文件错误 + + + + Could not open file "%1" for reading. + 不能打开文件"%1"来读取。 + + + + Save Text to File + 保存文本至文件 + + + + QtiPlot - File Save Error + QtiPlot - 文件保存失败 + + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + 无法写入文件<br><h4> %1 </h4><p>。请检查是否有权限写入该处! + + + + QtiPlot + QtiPlot + + + + QtiPlot has finished searching the document. + QtiPlot完成了文档搜索。 + + + + ScriptWindow + + + + QtiPlot - Script Window + QtiPlot - 脚本窗口 + + + + + &File + 文件(&F) + + + + + &Edit + 编辑(&E) + + + + + + + E&xecute + 执行(&x) + + + + &Window + 窗口(&W) + + + + + &New + 新建(&N) + + + + + Ctrl+N + Ctrl+N + + + + + &Open... + 打开(&O)... + + + + + Ctrl+O + Ctrl+O + + + + + &Save + 保存(&S) + + + + + Ctrl+S + Ctrl+S + + + + + Save &As... + 另存为(&A)... + + + + + &Print + 打印(&P) + + + + + Ctrl+P + Ctrl+P + + + + + &Undo + 撤销(&U) + + + + + Ctrl+Z + Ctrl+Z + + + + + &Redo + 重做(&R) + + + + + Ctrl+Y + Ctrl+Y + + + + + &Cut + 剪切(&C) + + + + + Ctrl+x + Ctrl+x + + + + + &Copy + 复制(&C) + + + + + Ctrl+C + Ctrl+C + + + + + &Paste + 粘贴(&P) + + + + + Ctrl+V + Ctrl+V + + + + + Increase Indent + 增加缩进 + + + + + Decrease Indent + 减少缩进 + + + + + &Find... + 查找(&F)... + + + + + Ctrl+Alt+F + Ctrl+Alt+F + + + + + Find &Next + 查找下一条(&N) + + + + + F3 + F3 + + + + + Find &Previous + 查找上一条(&P) + + + + + F4 + F4 + + + + + &Replace... + 替换(&R)... + + + + Show &Line Numbers + 显示行号(&L) + + + + + CTRL+J + CTRL+J + + + + + Execute &All + 全部执行(&A) + + + + + CTRL+SHIFT+J + CTRL+SHIFT+J + + + + + &Evaluate Expression + 计算表达式(&E) + + + + + CTRL+Return + CTRL+Return + + + + Always on &Top + 始终在前端(&T) + + + &Hide + 隐藏(&H) + + + + QtiPlot - File Save Error + QtiPlot - 文件保存错误 + + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + 无法写入文件: <br><h4> %1 </h4><p>请保证你在这个位置有写权限! + + + + You need to close and reopen the script window before your changes become effective! Do you want to close it now? + 你需要关闭再重新打开脚本窗口才能使变化生效!你想现在关闭吗? + + + + + QtiPlot + QtiPlot + + + + + Script Output Panel + 脚本输出面板 + + + + + Show Script &Output Panel + 显示脚本输出面板(&O) + + + + + Ouput on Next &Line + 输出于下一行(&L) + + + + Show Script Output Panel + 显示脚本输出面板 + + + + + Print Pre&view... + 打印预览(&v)... + + + + Script print preview + 脚本打印预览 + + + + + &Close + 关闭(&C) + + + + + Show &Workspace + 显示工作台(&W) + + + + ScriptingEnv + + + %1 Source (*.%2);; + %1 源于 (*.%2);; + + + + ScriptingLangDialog + + + QtiPlot - Select scripting language + QtiPlot - 选择脚本语言 + + + + OK + 确定 + + + + Cancel + 取消 + + + + QtiPlot - Scripting Error + QtiPlot - 脚本错误 + + + + Scripting language "%1" failed to initialize. + "%1"脚本语言初始化错误。 + + + + SetColValuesDialog + + + QtiPlot - Set column values + QtiPlot - 设置列值 + + + + For row (i) + row (i) + + + + to + + + + + Add function + 添加函数 + + + + Add column + 添加列 + + + + Add cell + 添加单元 + + + + &Apply + 应用(&A) + + + + &Close + 关闭(&C) + + + + Use built-in muParser (much faster) + 使用内置muParser(快很多) + + + + Clear &Formulas + 清除方程式(&F) + + + + SigmoidalFit + + + Boltzmann + 波尔兹曼 + + + + init value + 初始值 + + + + final value + 终止值 + + + + center + 中心 + + + + time constant + 时间常数 + + + + Boltzmann (Sigmoidal) Fit + 波尔兹曼(S型)拟合 + + + + SmoothCurveDialog + + + QtiPlot - Smoothing Options + QtiPlot - 平滑选项 + + + + Curve + 曲线 + + + + Polynomial Order + 多项式阶 + + + + Points to the Left + 左边的点 + + + + Points to the Right + 右边的点 + + + + + + Color + 颜色 + + + + f + f + + + + Iterations + 迭代 + + + + Points + + + + + &Smooth + 平滑(&S) + + + + &Close + 关闭(&C) + + + + SmoothFilter + + + Smoothed + 平滑 + + + + + + + + + + + QtiPlot + QtiPlot + + + + + + + + + + + Error + 错误 + + + Unknown smooth filter. Valid values are: 1 - Savitky-Golay, 2 - FFT, 3 - Moving Window Average. + 未知平滑滤波器。有效值:1 - Savitzky-Golay, 2 - FFT, 3 - 移动窗口平均。 + + + + Unknown smooth filter. Valid values are: 1 - Savitky-Golay, 2 - FFT, 3 - Moving Window Average, 4 - Lowess. + 未知平滑滤波器。有效值:1 - Savitzky-Golay, 2 - FFT, 3 - 移动窗口平均,4 - Lowess。 + + + + + + points + + + + + Savitzky-Golay smoothing + Savitzky-Golay平滑 + + + + FFT smoothing + FFT平滑 + + + + average smoothing + 平均平滑 + + + + Lowess smoothing with f=%1 and %2 iterations + Lowess平滑f=%1 %2次迭代 + + + + The number of points must be positive! + 点的数目必须为正! + + + + + The polynomial order must be lower than the number of left points plus the number of right points! + 多项式的阶比较低于左边的点数加右边的点数! + + + + Setting polynomial order is only available for Savitzky-Golay smooth filters! Ignored option! + 设置多项式阶仅对Savitzky-Golay平滑有效!忽略选项! + + + + Setting Lowess parameter is only available for Lowess smooth filters! Ignored option! + 设置Lowess参数只对Lowess平滑滤波器有效!忽略选项! + + + + The parameter f must be between 0 and 1! + 参数f必须在0到1之间! + + + + The number of iterations must be at least 1! + 迭代次数必须至少是1! + + + + SortDialog + + + QtiPlot - Sorting Options + QtiPlot - 排序选项 + + + + Sort columns + 列排序 + + + + Separately + 分别地 + + + + Together + 一起地 + + + + Order + 顺序 + + + + Ascending + 升序 + + + + Descending + 降序 + + + + Leading column + 前导列 + + + + &Sort + 排序(&S) + + + + &Close + 关闭(&C) + + + + SubtractDataDialog + + + + QtiPlot + + + + + Math on Data Sets + + + + + Cu&rve + + + + + &Operator + + + + + &Data set + + + + + Current &folder + + + + + &Value + + + + + &Apply + 应用(&A) + + + + &Close + 关闭(&C) + + + + Error + 错误 + + + + Data set %1 must containt at least two valid data points in order to perform this operation! + + + + + SubtractLineTool + + + Move cursor and click to select and double-click/press 'Enter' to set the position of the first point! + + + + + First point selected! Click to select and double-click/press 'Enter' to set the position of the 2nd point! + + + + + SurfaceDialog + + + QtiPlot - Define surface plot + QtiPlot - 定义曲面图 + + + + Surface type + 曲面图类型 + + + + Function + 函数 + + + + Parametric + 参数的 + + + Clear &list + 清除列表(&l) + + + + &OK + 确定(&O) + + + + &Close + 关闭(&C) + + + + f(x,y)= + f(x,y)= + + + + X - axis + X - 轴 + + + -1 + -1 + + + 1 + 1 + + + + Clea&r + 清除(&r) + + + + + Rece&nt + 最近(&n) + + + + + Click here to select a recently typed expression + 点击这里选取一个最近输入的表达式 + + + + + + + + From + + + + + + + + + To + + + + + Y - axis + Y - 轴 + + + + Z - axis + Z - 轴 + + + + + Mesh + 网格 + + + + + Columns + + + + + + Rows + + + + + Equations + 公式 + + + + X(u,v)= + X(u,v)= + + + + Y(u,v)= + Y(u,v)= + + + + Z(u,v)= + Z(u,v)= + + + + u + u + + + + + Periodic + 周期的 + + + + v + v + + + + QtiPlot - X Formula Error + QtiPlot - X方程式错误 + + + + QtiPlot - Y Formula Error + QtiPlot - Y方程式错误 + + + + QtiPlot - Z Formula Error + QtiPlot - Z方程式错误 + + + + + + + + + + + QtiPlot + QtiPlot + + + + + + + Sorry, there are no recent expressions available! + 抱歉,没有最近可用的表达式! + + + + + + + Recent Functions + 最近的函数 + + + + + + + Please, choose a function: + 请选择一个函数: + + + QtiPlot - u start limit error + QtiPlot - u起始限制错误 + + + QtiPlot - u end limit error + QtiPlot - u结束限制错误 + + + QtiPlot - v start limit error + QtiPlot - v起始限制错误 + + + QtiPlot - X Start limit error + QtiPlot - X起始限制错误 + + + QtiPlot - X End limit error + QtiPlot - X结束限制错误 + + + QtiPlot - Y Start limit error + QtiPlot - Y起始限制错误 + + + QtiPlot - Y End limit error + QtiPlot - Y结束限制错误 + + + QtiPlot - Z Start limit error + QtiPlot - Z起始限制错误 + + + QtiPlot - Z End limit error + QtiPlot - Z结束限制错误 + + + + QtiPlot - Input error + QtiPlot - 输入错误 + + + + Please enter limits that satisfy: from < end! + 请输入限制满足from < end 的上下限! + + + + QtiPlot - Input function error + QtiPlot - 输入函数错误 + + + + SymbolBox + + + No Symbol + 没有符号 + + + + Ellipse + 椭圆 + + + + Rectangle + 矩形 + + + + Diamond + 菱形 + + + + Triangle + 三角形 + + + + Down Triangle + 下三角 + + + + Up Triangle + 上三角 + + + + Left Triangle + 左三角 + + + + Right Triangle + 右三角 + + + + Cross + 十字 + + + + Diagonal Cross + 对角十字 + + + + Horizontal Line + 水平线 + + + + Vertical Line + 垂直线 + + + + Star 1 + 星1 + + + + Star 2 + 星2 + + + + Hexagon + 六边形 + + + + SymbolDialog + + + &Close + 关闭(&C) + + + + QtiPlot - Choose Symbol + QtiPlot - 选择符号 + + + + Table + + + Multiline expressions take much more time to evaluate! Do you want to continue anyways? + 多行表达式需要很多的时间计算!你希望继续吗? + + + + + + + QtiPlot + QtiPlot + + + + Warning + 警告 + + + + + + + + + + + + + + + + + + QtiPlot - Error + QtiPlot - 错误 + + + + + + Column '%1' is read only! + 列'%1'为只读! + + + + There is already a column called : <b> + 已经存在列: <b> + + + + The table '%1' contains read-only columns! Operation aborted! + 表'%1'包含有只读列!操作中止! + + + + + + + + + + + The folowing columns + 以下列 + + + + + + + + + + + are read only! + 是只读! + + + + Paste operation + 粘贴操作 + + + + How should QtiPlot interpret first clipboard line? + QtiPlot该如何翻译剪贴板中的第一行? + + + + &Values + 值(&V) + + + + Column &Names + 列名(&N) + + + + &Comments + 注释(&C) + + + + Please indicate the name of the leading column! + 请注明前导列的名称! + + + The leading column has the type set to 'Text'! Operation aborted! + 前导列类型必须为'文本'!操作中止! + + + + The leading column is empty! Operation aborted! + 前导列为空!操作中止! + + + + Qtiplot + QtiPlot + + + + Reading file... + 读取文件... + + + + QtiPlot - ASCII Export Error + QtiPlot - ASCII导出错误 + + + + Could not write to file: <br><h4> + 不能写入文件: <br><h4> + + + + Rows will be deleted from the table! + 将从表中删除行! + + + + + Do you really want to continue? + 你想继续吗? + + + + + Yes + + + + + + Cancel + 取消 + + + + Columns will be deleted from the table! + 将从表中删除列! + + + + kB + kB + + + + TableDialog + + + QtiPlot - Column options + QtiPlot - 列选项 + + + + Column Name: + 列名: + + + + Enumerate all to the right + 列举所有至右边 + + + + &OK + 确定(&O) + + + + &Apply + 应用(&A) + + + + &Cancel + 取消(&C) + + + + Plot Designation: + 绘图目的: + + + + None + 不选 + + + + X (abscissae) + X(横坐标) + + + + Y (ordinates) + Y(纵坐标) + + + + Z (height) + Z(高) + + + + X Error + X误差 + + + + Y Error + Y误差 + + + + Label + 标签 + + + + Display + 显示 + + + + Numeric + 数字 + + + + Text + 文本 + + + + Date + 日期 + + + + Time + 时间 + + + + Month + + + + + Day of Week + 周几 + + + + Format: + 格式: + + + + Precision: + 精度: + + + + &Read-only + 只读(&R) + + + + &Hidden + 隐藏(&H) + + + + Apply to all columns to the right + 应用到所有列至右边 + + + + Options + 选项 + + + + Column Width: + 列宽: + + + + Apply to all + 应用到所有 + + + + &Display Comments in Header + 在头里显示注视(&D) + + + + Comment: + 注释: + + + + QtiPlot - Warning + QtiPlot - 警告 + + + + For internal consistency reasons the underscore character is replaced with a minus sign. + 因为内部一致性原因,画线字符被减号替代。 + + + + QtiPlot - Error + QtiPlot - 错误 + + + The column names must only contain letters and digits! + 列名只能包含字母和数字! + + + + Default + 默认 + + + + Decimal: 1000 + 十进制: 1000 + + + + Scientific: 1E3 + 科学计数法: 1E3 + + + + dd/MM/yyyy + dd/MM/yyyy + + + + dd/MM/yyyy HH:mm + dd/MM/yyyy HH:mm + + + + dd/MM/yyyy HH:mm:ss + dd/MM/yyyy HH:mm:ss + + + + dd.MM.yyyy + dd.MM.yyyy + + + + dd.MM.yyyy HH:mm + dd.MM.yyyy HH:mm + + + + dd.MM.yyyy HH:mm:ss + dd.MM.yyyy HH:mm:ss + + + + dd MM yyyy + dd MM yyyy + + + + dd MM yyyy HH:mm + dd MM yyyy HH:mm + + + + dd MM yyyy HH:mm:ss + dd MM yyyy HH:mm:ss + + + + yyyy-MM-dd + yyyy-MM-dd + + + + yyyy-MM-dd HH:mm + yyyy-MM-dd HH:mm + + + + yyyy-MM-dd HH:mm:ss + yyyy-MM-dd HH:mm:ss + + + + yyyyMMdd + yyyyMMdd + + + + yyyyMMdd HH:mm + yyyyMMdd HH:mm + + + + yyyyMMdd HH:mm:ss + yyyyMMdd HH:mm:ss + + + + h + h + + + + h ap + h ap + + + + h AP + h AP + + + + h:mm + h:mm + + + + h:mm ap + h:mm ap + + + + hh:mm + hh:mm + + + + h:mm:ss + h:mm:ss + + + + h:mm:ss.zzz + h:mm:ss.zzz + + + + mm:ss + mm:ss + + + + mm:ss.zzz + mm:ss.zzz + + + + hmm + hmm + + + + hmmss + hmmss + + + + hhmmss + hhmmss + + + + Couldn't guess the source data format, please specify it using the 'Format' box! + 无法猜测源数据格式,请在格式框中指定! + + + + For more information about the supported date/time formats please read the Qt documentation for the QDateTime class! + 如果要知道更多关于支持的日期/时间格式请阅读Qt文档的QDateTime类! + + + + TableStatistics + + + RowStats + 行统计 + + + + Row Statistics of %1 + %1行统计 + + + + Row + + + + + Cols + + + + + + Mean + 平均值 + + + + + StandardDev + 标准偏差 + + + + + StandardError + 标准误差 + + + + + Variance + 方差 + + + + + Sum + + + + + + Max + 最大值 + + + + + Min + 最小值 + + + + + Median + 中值 + + + + ColStats + 列统计 + + + + Column Statistics of %1 + %1列统计 + + + + Col + + + + + Rows + + + + + iMax + iMax + + + + iMin + iMin + + + + TextDialog + + + QtiPlot - Text options + QtiPlot - 文本选项 + + + + Text Color + 文字颜色 + + + + Font + 字体 + + + + &Font + 字体(&F) + + + + Alignment + 对齐 + + + + Center + 居中 + + + + Left + 左对齐 + + + + Right + 右对齐 + + + + Distance to axis + 到轴的距离 + + + + &Apply to... + 应用到(&A)... + + + + Object + 对象 + + + + Layer + 图层 + + + + Window + 窗口 + + + + All Windows + 所有窗口 + + + + &Close + 关闭(&C) + + + + + + + QtiPlot + QtiPlot + + + + X Axis Title + X轴标题 + + + + Y Axis Title + Y轴标题 + + + + Top Axis Title + 顶轴标题 + + + + Right Axis Title + 右轴标题 + + + + &Inverted + 逆(&I) + + + + TextEditor + + + QtiPlot + QtiPlot + + + + Confirmation + 确认 + + + + Are you sure you want to add %1 text lines into this text box? + 你确定要添加%1文本到这个文本框? + + + + TextFormatButtons + + + B + Button bold + 粗体 + + + + It + Button italics + 斜体 + + + + U + Button underline + 下划线 + + + + ThreeExpFit + + + ExpDecay3 + 指数衰减3 + + + + Exponential decay + 指数衰减 + + + + first amplitude + 第一振幅 + + + + first lifetime + 第一生命期 + + + + second amplitude + 第二振幅 + + + + second lifetime + 第二生命期 + + + + third amplitude + 第三振幅 + + + + third lifetime + 第三生命期 + + + + offset + 偏移 + + + + TranslateCurveTool + + + Double-click on plot to select a data point! + 在图上双击选取一个数据点! + + + + + + + QtiPlot - Warning + QtiPlot - 警告 + + + + + The column '%1' is read-only! Operation aborted! + 列'%1'是只读!操作中止! + + + + Curve selected! Move cursor and click to choose a point and double-click/press 'Enter' to finish! + 曲线已选择!移动光标并点击来选择一个点、双击/回车结束选择! + + + + This operation cannot be performed on function curves. + 这个操作不能在函数曲线上执行。 + + + + This operation cannot be performed on curves plotted from columns having a non-numerical format. + 这个操作不能在包含有非数字格式的列所画的曲线上执行。 + + + + TwoExpFit + + + ExpDecay2 + 指数衰减2 + + + + Exponential decay + 指数衰减 + + + + first amplitude + 第一振幅 + + + + first lifetime + 第一生命期 + + + + second amplitude + 第二振幅 + + + + second lifetime + 第二生命期 + + + + offset + 偏移 + + + + muParserScript + + + col() works only on tables! + col()只作用于表格! + + + + + + + There's no column named %1 in table %2! + 表格%2里面没有名为%1的列! + + + + + + There's no row %1 in table %2! + 表格%2里面没有名为%1的行! + + + + + + There's no column %1 in table %2! + 表格%2里面没有%1列! + + + + tablecol() works only on tables! + tablecol()只作用于表格! + + + + tablecol: wrong number of arguments (need 2, got %1) + tablecol: 错误的参数数量(需要 2, 有 %1) + + + + tablecol: first argument must be a string (table name) + tablecol: 第一个参数必须为字符串(表格名称) + + + + Couldn't find a table named %1. + 找不到名为%1的表格。 + + + + + cell() works only on tables and matrices! + cell()只作用于表格和矩阵! + + + + There's no row %1 in matrix %2! + 矩阵%2里面没有%1行! + + + + There's no column %1 in matrix %2! + 矩阵%2里面没有%1列! + + + + + + + Out of memory + 内存溢出 + + + + SUM() works only on tables! + SUM()只作用于表格! + + + + AVG() works only on tables! + AVG()只作用于表格! + + + === removed file 'qtiplot/translations/qtiplot_cn.ts' --- qtiplot/translations/qtiplot_cn.ts 2009-12-08 18:06:27 +0000 +++ qtiplot/translations/qtiplot_cn.ts 1970-01-01 00:00:00 +0000 @@ -1,18144 +0,0 @@ - - - - - - - QtiPlot - File openning error - QtiPlot - 文件打开错误 - - - You don't have the permission to open this file: <b>%1</b> - 你没有权限打开<b>%1</b>文件 - - - QtiPlot - File opening error - QtiPlot - 文件打开错误 - - - The file: <b>%1</b> doesn't exist! - 文件:<b>%1</b>不存在! - - - The file: <b>%1</b> is not a QtiPlot or Origin project file! - 文件:<b>%1</b>不是一个QtiPlot或者Origin项目文件! - - - QtiPlot - Demo Version - QtiPlot - 演示版本 - - - QtiPlot - File backup error - QtiPlot - 文件备份错误 - - - Cannot make a backup copy of <b>%1</b> (to %2).<br>If you ignore this, you run the risk of <b>data loss</b>. - 无法备份<b>%1</b>(至 %2)。<br>如果你忽略这个,你就处于<b>丢失数据</b>的风险中。 - - - QtiPlot - File save error - QtiPlot - 文件保存失败 - - - The file: <br><b>%1</b> is opened in read-only mode - 文件: <br><b>%1</b>是以只读模式打开的 - - - QtiPlot project - QtiPlot项目 - - - Compressed QtiPlot project - 压缩的QtiPlot项目 - - - Save project as - 项目另存为 - - - Save &As Project... - 另存为项目(&A)... - - - &Show All Windows - 显示所有窗口(&S) - - - &Hide All Windows - 隐藏所有窗口(&H) - - - &Delete Folder - 删除文件夹(&D) - - - &Rename - 重命名(&R) - - - New &Window - 新建窗口(&W) - - - New F&older - 新建文件夹(&o) - - - &None - 无(&N) - - - &Windows in Active Folder - 活动文件夹内的窗口(&W) - - - Windows in &Active Folder && Subfolders - 活动文件夹和自文件夹内的窗口(&A) - - - &View Windows - 查看窗口(&V) - - - &Properties... - 属性(&P)... - - - Hidden - 隐藏 - - - QtiPlot - Error - QtiPlot - 错误 - - - Please enter a valid name! - 请输入一个有效名称! - - - Name already exists! - 名称已存在! - - - Please choose another name! - 请选择一个其它的名称! - - - Type - 类型 - - - Project - 项目 - - - Path - 路径 - - - Size - 大小 - - - bytes - 字节 - - - Contents - 内容 - - - windows - 窗口 - - - folders - 文件夹 - - - Created - 创建 - - - Modified - 改动的 - - - Properties - 属性 - - - Folder - 文件夹 - - - New Folder - 新建文件夹 - - - QtiPlot - Delete folder? - QtiPlot - 删除文件夹? - - - Delete folder '%1' and all the windows it contains? - 删除文件夹'%1'和里面包含的所有窗口? - - - Yes - - - - No - - - - Matrix - 矩阵 - - - Table - 表格 - - - Note - 笔记 - - - Graph - 绘图 - - - 3D Graph - 三维绘图 - - - Label - 标签 - - - Status - 状态 - - - QtiPlot - No match found - QtiPlot - 找不到匹配项 - - - Sorry, no match found for string: '%1' - 对不起,没有找到匹配的字符串: '%1' - - - Cannot move an object to itself! - 不能把一个对象移到自身上! - - - Cannot move a parent folder into a child folder! - 不能把一个父文件夹移动到资文件夹内! - - - Skipped moving folder - 跳过移动文件夹 - - - The destination folder already contains a folder called '%1'! Folder skipped! - 目的文件夹已经含有一个叫做'%1'的文件夹!文件夹跳过! - - - Error - 错误 - - - QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! - QtiPlot尝试下载最新更新的必要信息。请修改你的防火墙设置来允许QtiPlot连接到英特网! - - - Do you wish to continue? - 你想继续吗? - - - QtiPlot - HTTP get version file - QtiPlot - HTTP获取版本文件 - - - Error while fetching version file with HTTP: %1. - HTTP取版本文件时出错: %1。 - - - QtiPlot - Updates Available - QtiPlot - 有更新 - - - There is a newer version of QtiPlot (%1) available for download. Would you like to download it? - 有更新版本的QtiPlot (%1)等待下载。你希望下载它吗? - - - QtiPlot - No Updates Available - QtiPlot - 没有更新 - - - No updates available. Your current version %1 is the last version available! - 没有更新。你现在的版本%1就是最新版本! - - - QtiPlot - Warning - QtiPlot - 警告 - - - This will clear the contents of all the data associated with the table. Are you sure? - 这会清楚表格相关的数据的所有内容。你确定? - - - &Yes - 是(&Y) - - - &No - 否(&N) - - - QtiPlot - Enter row number - QtiPlot - 输入行号 - - - Row - - - - QtiPlot - Enter column number - QtiPlot - 输入列号 - - - Column - - - - QtiPlot was not built with Python scripting support included! - QtiPlot编译时不包含Python脚本支持! - - - Please select a Y column to plot! - 请选择需要绘制的Y列! - - - You need at least two columns for this operation! - 你需要为此操作选择至少两列! - - - Please set a default X column for this table, first! - 请先为这个表格设置一个默认的X列! - - - Please select a Z column for this operation! - 请为这个操作选择一个Z列! - - - You need to define a X column first! - 首先你需要定义一个X列! - - - You need to define a Y column first! - 首先你需要定义一个Y列! - - - Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. - 从0.9.1版本开始QtiPlot就保存拥护定义拟合模型到不同的位置。 - - - If you want to save your already defined models, please choose a destination folder. - 如果你想保存你已经定义的模型,请选择一个目的文件夹。 - - - Import fit models - 导入拟合模型 - - - Choose a directory to export the fit models to - 选择一个目录来导出拟合模型 - - - No Icon - 无图标 - - - Couldn't load file: %1. -Autocompletion will not be available! - 无法加载文件:%1。 -自动完成无法使用! - - - QtiPlot - Column selection error - QtiPlot - 列选择错误 - - - Please select exactly one column and more than one non empty cell! - 请选择一列和至少一个非空单元! - - - Data set: %1 doesn't exist! - 数据集:%1不存在! - - - Stem and leaf plot of dataset - 数据集的茎叶图 - - - from row - 起始行 - - - to row - 结束行 - - - Not enough memory for this dataset! - 没有足够的内存给这个数据集! - - - Stem - - - - Leaf - - - - Please confirm the stem unit! - 你确认茎单位! - - - Data set - 数据集 - - - stem unit - 茎单位 - - - Stem unit - 茎单位 - - - Leaf unit - 叶单位 - - - Key - - - - means - 方法 - - - Input error: empty data set! - 输入错误:空数据集! - - - Memory Allocation Error - 内存分配错误 - - - Not enough memory, operation aborted! - 内存不足,操作中止! - - - - AddWidgetTool - - - Click on plot to choose the position of the new object! - 在图上点击以选取新对象的位置! - - - - - enter your text here - 在这里输入文本 - - - - Move cursor in order to resize the new rectangle! - 移动光标来调整新矩形的大小! - - - - Move cursor in order to resize the new ellipse! - 移动光标来调整新椭圆的大小! - - - - ApplicationWindow - - - - QtiPlot - untitled - QtiPlot - 未命名 - - - - - Project Explorer - 项目浏览器 - - - - - - Folder - 文件夹 - - - - UNTITLED - 未命名 - - - - - Name - 名称 - - - - - - - - - - - - Type - 类型 - - - - - View - 视图 - - - - - - - - Size - 大小 - - - - - - - - - Created - 创建 - - - - - - Label - 标签 - - - - - Results Log - 结果日志 - - - - - Scripting Console - 脚本控制台 - - - - - Undo Stack - 撤销堆栈 - - - - &Next - next window - 下一个窗口(&N) - - - - F5 - next window shortcut - F5 - - - - &Previous - previous window - 上一个窗口(&P) - - - - F6 - previous window shortcut - F6 - - - - - File - 文件 - - - - - Edit - 编辑 - - - - - Plot - 绘图 - - - - Disable &Tools - 禁用工具(&T) - - - - - &Zoom In - 放大(&Z) - - - - - Ctrl++ - Ctrl++ - - - - &Zoom Out - 缩小(&Z) - - - - - Ctrl+- - Ctrl+- - - - - - &Data Reader - 数据读取器(&D) - - - - - CTRL+D - CTRL+D - - - - - &Select Data Range - 选择数据范围(&S) - - - - - ALT+S - ALT+S - - - - - S&creen Reader - 屏幕读取器(&c) - - - - - &Draw Data Points - 画数据点(&D) - - - - - &Move Data Points... - 移动数据点(&M)... - - - - - Ctrl+ALT+M - Ctrl+ALT+M - - - - - Remove &Bad Data Points... - 移除坏数据点(&B)... - - - - - Alt+B - Alt+B - - - - - Add E&quation - 添加公式(&q) - - - - - ALT+Q - ALT+Q - - - - - Add &Text - 添加文本(&T) - - - - - ALT+T - ALT+T - - - - - Draw &Arrow - 画箭头(&A) - - - - - CTRL+ALT+A - CTRL+ALT+A - - - - - Draw &Line - 画线(&L) - - - - - CTRL+ALT+L - CTRL+ALT+L - - - - - Add &Rectangle - 添加矩形(&R) - - - - - CTRL+ALT+R - CTRL+ALT+R - - - - - Add &Ellipse - 添加椭圆(&E) - - - - - CTRL+ALT+E - CTRL+ALT+E - - - - - - - - - - - Table - 表格 - - - - - - - - - - - Column - - - - - - Data Display - 数据显示 - - - - - Matrix Plot - 矩阵绘图 - - - - - - Format - 格式 - - - - QtiPlot - Script Window - QtiPlot - 脚本窗口 - - - - - 3D Surface - 三维曲面图 - - - - - &Recent Projects - 最近项目(&R) - - - - &File - 文件(&F) - - - - &New - 新建(&N) - - - - &Export Graph - 导出绘图(&E) - - - - &Edit - 编辑(&E) - - - - &View - 视图(&V) - - - - &Graph - 绘图(&G) - - - - - 3D &Plot - 三维绘图(&P) - - - - &Matrix - 矩阵(&M) - - - - - - &Plot - 绘图(&P) - - - - - &Data - 数据(&D) - - - - - - &Normalize - 归一化(&N) - - - - - &Fill Columns With - 填充列(&F) - - - - - - &Table - 表格(&T) - - - - &Smooth - 平滑(&S) - - - - &FFT filter - FFT滤波器(&F) - - - - Fit E&xponential Decay - 指数衰减拟合(&x) - - - - Fit &Multi-peak - 多峰值拟合(&M) - - - - &Analysis - 分析(&A) - - - - F&ormat - 格式(&o) - - - - &Scripting - 脚本(&S) - - - - &Windows - 窗口(&W) - - - - - - &Help - 帮助(&H) - - - - Set Columns &As - 设置列(&A) - - - - - &Read-only - 只读(&R) - - - - - Read/&Write - 读写(&W) - - - - - - Special Line/Symb&ol - 特殊线/符号(&o) - - - - - - Statistical &Graphs - 统计图(&G) - - - - - Pa&nel - 面板(&n) - - - - 3&D Plot - 三维绘图(&D) - - - - Empty Stack - 空堆栈 - - - - - - - - - - QtiPlot - Plot error - QtiPlot - 绘图错误 - - - - - - - - You must select exactly one column for plotting! - 你必须选择一列来绘图! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QtiPlot - Error - QtiPlot - 错误 - - - - Please select a column to plot! - 请选择一列来绘图! - - - - - Please select four columns for this operation! - 请为这个操作选择四列! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QtiPlot - Warning - QtiPlot - 警告 - - - - - <h4>There are no tables available in this project.</h4><p><h4>Please create a table and try again!</h4> - <h4>项目中没有有效的表格。</h4><p><h4>请创建表格后重试!</h4> - - - - There are no available columns with plot designation set to Z! - 绘图指示设置为Z的情况下没有有效的列! - - - - - - QtiPlot - Choose data set - QtiPlot - 选择数据集 - - - - - - - - - - - Matrix - 矩阵 - - - - - QtiPlot - Choose matrix to plot - QtiPlot - 选择需要绘制的矩阵 - - - - <h4>There are no matrices available in this project.</h4><p><h4>Please create a matrix and try again!</h4> - <h4>项目中没有有效的矩阵。</h4><p><h4>请创建矩阵后重试!</h4> - - - - - - - - - - - - - - - - - Graph - 绘图 - - - - - - - - - - QtiPlot - Export error - QtiPlot - 导出错误 - - - - - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - 无法写入文件: <br><h4> %1 </h4><p>请保证你在这个位置有写权限! - - - - Images - 图像 - - - - QtiPlot - Import image from file - QtiPlot - 从文件导入图像 - - - - QtiPlot - Load image from file - QtiPlot - 从文件中加载图像 - - - - - - Please select a Y column to plot! - 请选择需要绘制的Y列! - - - - - QtiPlot - Renamed Window - QtiPlot - 重名名窗口 - - - - - The table '%1' already exists. It has been renamed '%2'. - 表格'%1'已经存在。重名名为'%2'。 - - - - - - Notes - 笔记 - - - - Set Image Mode - 设置图像模式 - - - - Set Data Mode - 设置数据模式 - - - - Show X/Y - 显示X/Y - - - - Show Column/Row - 显示列/行 - - - - Set Default Palette - 设置默认调色板 - - - - Set Gray Scale Palette - 设置灰阶调色板 - - - - Set Rainbow Palette - 设置彩色调色板 - - - - Determinant of - 行列式 - - - - - - - - - - - - - - - - - - - - <h4>There are no plot layers available in this window.</h4><p><h4>Please add a layer and try again!</h4> - <h4>在此窗口没有有效的绘图图层。</h4><p><h4>请添加一个图层后重试!</h4> - - - - - There are no curves available on this plot! - 在此绘图上没有有效的曲线! - - - - - - - - - - - - - This functionality is not available for pie plots! - 这个功能在饼状图上无效! - - - - QtiPlot - Error bars error - QtiPlot - 误差棒错误 - - - - - This feature is not available for user defined function curves! - 这个功能对于用户自定义函数曲线无效! - - - - The selected columns have different numbers of rows! - 选中的列行数不同! - - - - The selected error column is empty! - 选中的误差列为空! - - - - - - - - - - QtiPlot - File openning error - QtiPlot - 文件打开错误 - - - - The file: <b>%1</b> is the current file! - 文件<b>%1</b>是当前文件! - - - - - - - The file: <b>%1</b> doesn't exist! - 文件:<b>%1</b>不存在! - - - - - You don't have the permission to open this file: <b>%1</b> - 你没有权限打开<b>%1</b>文件 - - - - - - - - - - - QtiPlot - File opening error - QtiPlot - 文件打开错误 - - - - The file <b>%1</b> is corrupted, but there exists a backup copy.<br>Do you want to open the backup instead? - 文件<b>%1</b>损坏,但是有一个备份。<br>你想打开备份的文件吗? - - - - - The file: <b> %1 </b> was not created using QtiPlot! - 文件<b> %1 </b>不是QtiPlot创建的! - - - - QtiPlot - File Open Error - QtiPlot - 文件打开错误 - - - - The file: <b> %1 </b> <p>does not exist anymore!<p>It will be removed from the list. - 文件<b> %1 </b> <p>不再存在!<p>它将被从列表中移除。 - - - - The file: <p><b> %1 </b><p> is the current file! - 文件<p><b> %1 </b><p>是当前文件! - - - - - - - - - - - - - - - - - - - - - QtiPlot - QtiPlot - - - - The file "%1" was created using "%2" as scripting language. - -Initializing support for this language FAILED; I'm using "%3" instead. -Various parts of this file may not be displayed as expected. - 文件"%1"是用"%2"作为脚本语言创建的。 - -这种语言的支持初始化失败;正在使用"%3"替代。 -这个文件的很多部分可能不会被正确的显示。 - - - - Window - 窗口 - - - - QtiPlot - Opening file - QtiPlot - 打开文件 - - - - Script Error - 脚本错误 - - - - QtiPlot - Scripting Error - QtiPlot - 脚本错误 - - - - Scripting language "%1" failed to initialize. - "%1"脚本语言初始化失败。 - - - - QtiPlot - Open Template File - QtiPlot - 打开模板文件 - - - - The file: <b>%1</b> is not a QtiPlot template file! - 文件<b>%1</b>不是一个QtiPlot模板文件! - - - - Table1 - 表格1 - - - - QtiPlot - Export Error - QtiPlot - 导出错误 - - - - <h4>There are no plot layers available in this window!</h4> - <h4>在此窗口没有有效的绘图图层。</h4> - - - - Choose a directory to export the graphs to - 选择一个图像导出目录 - - - - Output format: - 输出格式: - - - - Directory: - 目录: - - - - There are no plot layers available in window <b>%1</b>.<br>Graph window not exported! - 在<b>%1</b>窗口没有有效的绘图图层。<br>图像窗口没有导出! - - - - - A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? - <p><b>%1</b><p>文件已经存在。 你想覆盖吗? - - - - - QtiPlot - Overwrite file? - QtiPlot - 覆盖文件? - - - - Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! - 无法写入文件: <br><h4> %1</h4><p>请保证你在这个位置有写权限! - - - - Minimized - 最小化 - - - - - Maximized - 最大化 - - - - - QtiPlot project - QtiPlot项目 - - - - - Compressed QtiPlot project - 压缩的QtiPlot项目 - - - - Save Project As - 项目另存为 - - - - QtiPlot Matrix Template - QtiPlot矩阵模板 - - - - QtiPlot 2D Graph Template - QtiPlot 2D图像模板 - - - - QtiPlot Table Template - QtiPlot表格模板 - - - - QtiPlot 3D Surface Template - QtiPlot 3D曲面图模板 - - - - Save Window As Template - 窗口另存为模板 - - - - - Please enter a valid name! - 请输入一个有效名称! - - - - The name you chose is not valid: only letters and digits are allowed! - 你选择的名称无效:只允许字母和数字! - - - - - - Please choose another name! - 请选择一个其它的名称! - - - - Name <b>%1</b> already exists! - 名称<b>%1</b>已存在! - - - - Warning: for internal consistency reasons the underscore character is replaced with a minus sign. - 警告:因为内部一致性原因,画线字符被减号替代。 - - - Choose a directory to export the tables to - 选择一个表格导出目录 - - - - - &Yes - 是(&Y) - - - - - - &All - 全部(&A) - - - - - - &Cancel - 取消(&C) - - - - Choose a filename to save under - 选择一个文件来保存 - - - - QtiPlot - Enter rows number - QtiPlot - 输入行号 - - - - Rows - - - - - - QtiPlot - Delete rows - QtiPlot - 删除行 - - - - Start row - 起始行 - - - - End row - 终止行 - - - - QtiPlot - Enter columns number - QtiPlot - 输入列号 - - - - Columns - - - - - - - - - - - - - - - - QtiPlot - Column selection error - QtiPlot - 列选择错误 - - - - - - - - Please select a column first! - 请先选择一列! - - - - Please select two columns for this operation! - 请为此操作选择两列! - - - - Please select exactly one columns for this operation! - 请为此操作选择恰好一列! - - - - - Please select two columns for this operation: - the first represents the signal and the second the response function! - 请为此操作选择两列: -第一列代表信号第二列代表函数! - - - - QtiPlot - Row selection error - QtiPlot - 行选择错误 - - - - Please select a row first! - 请先选择一行! - - - - - &Line - 线状图(&L) - - - - - - - &Scatter - 散点图(&S) - - - - - Line + S&ymbol - 线状图+符号(&y) - - - - - Vertical &Drop Lines - 垂线图(&D) - - - - - &Spline - 齿形图(&S) - - - - - &Vertical Steps - 垂直阶梯图(&V) - - - - - &Horizontal Steps - 水平阶梯图(&H) - - - - - - - &Columns - 柱状图(&C) - - - - - &Rows - 水平柱状图(&R) - - - - - &Area - 面积图(&A) - - - - - &Pie - 饼状图(&P) - - - 3D Ribbo&n - 三维带状图(&n) - - - 3D &Bars - 三维棒状图(&B) - - - 3&D Scatter - 三维散点图(&D) - - - 3D &Trajectory - 三维轨线(&T) - - - - - &Histogram - 直方图(&H) - - - &Stacked Histograms - 堆叠直方图(&S) - - - - - - - - - Cu&t - 剪切(&t) - - - - - - - - - - - &Copy - 复制(&C) - - - - - Past&e - 粘贴(&e) - - - - - - &X - &X - - - - - - &Y - &Y - - - - - - &Z - &Z - - - - - - &Label - 标签(&L) - - - - - &None - 无(&N) - - - - - - X E&rror - X误差(&r) - - - - - - Y &Error - Y误差(&E) - - - - - Set As - 设置为 - - - - &Fill Column With - 填充列(&F) - - - - &Column - 列(&C) - - - - - - - Clea&r - 清除(&c) - - - - - - - - &Delete - 删除(&D) - - - - - &Insert - 插入(&I) - - - - &Ascending - 升序(&A) - - - - &Descending - 降序(&D) - - - - Sort Colu&mn - 按列排序(&m) - - - Vectors &XYXY - 矢量图&XYXY - - - - - &Vertical 2 Layers - 垂直排列2图层(&V) - - - - - &Horizontal 2 Layers - 水平排列2图层(&H) - - - - - &4 Layers - 4图层(&4) - - - - - &Stacked Layers - 堆叠图层(&S) - - - - You need to select at least one Y column for this operation! - 你需要为此操作选择至少一个Y列! - - - - - - You need at least two columns for this operation! - 你需要为此操作选择至少两列! - - - - Y2 Axis Title - Y2轴标题 - - - - Not available for empty 3D surface plots! - 空的3D曲面图绘制是无效的! - - - - Set Display Range - 设置显示范围 - - - - - - - <h4>There are no plot layers available in this window.</h4> - <h4>在此窗口没有有效的绘图图层。</h4> - - - - - This will modify the data in the worksheets! -Are you sure you want to continue? - 这会改动工作表中的数据! -你确定你想继续吗? - - - - - Continue - 继续 - - - - - - Cancel - 取消 - - - - Could not write to file: <h4>%1</h4><p>Please verify that you have the right to write to this location or that the file is not being used by another application! - 无法写入文件: <h4> %1</h4><p>请保证你在这个位置有写权限或者这个文件不在被别的程序所使用! - - - - Sorry, there are no results to display! - 对不起,没有结果可以显示! - - - - There are no plot layers available in this window! - 在此窗口没有有效的绘图图层! - - - - - - There are no layers available on this plot. Operation aborted! - 此绘图上没有有效图层。操作中止! - - - - QtiPlot - Insert image from file - QtiPlot - 从文件插入图像 - - - - There are no plot layers available in this window. - 在此窗口没有有效的绘图图层。 - - - - QtiPlot - Duplicate window error - QtiPlot - 复制窗口错误 - - - There are no windows available in this project! - 此项目中没有有效窗口! - - - - QtiPlot - Duplicate error - QtiPlot - 复制错误 - - - - Empty 3D surface plots cannot be duplicated! - 空的3D曲面图不可复制! - - - - - Released - 发布 - - - - About QtiPlot - 关于QtiPlot - - - - &Translate - 翻译(&T) - - - - Vie&w - 视图(&w) - - - - &Palette - 调色板(&P) - - - - &Convert to Spreadsheet - 转换为电子表格(&C) - - - - &Folders - 文件夹(&F) - - - - &Cascade - 层叠(&C) - - - - &Tile - 平铺(&T) - - - - - - Close &Window - 关闭窗口(&W) - - - - - More windows... - 更多窗口... - - - - &View Pixel Line profile - 查看像素谱线轮廓(&V) - - - - &Intensity Matrix - 强度矩阵(&I) - - - - &Cut - 剪切(&C) - - - - - - - &Properties... - 属性(&P)... - - - - Please use the project explorer to select a window! - 请使用项目浏览器选择一个窗口! - - - - Normal - 普通 - - - - Save changes to project: <p><b> %1 </b> ? - 保存变动到项目<p><b> %1 </b>? - - - - - Yes - - - - - - No - - - - - - &Show All Windows - 显示所有窗口(&S) - - - - - &Hide All Windows - 隐藏所有窗口(&H) - - - - - - &Delete Selection - 删除所选(&D) - - - - - New &Window - 新建窗口(&W) - - - - - New F&older - 新建文件夹(&o) - - - - Auto &Column Width - 自动列宽(&C) - - - - &Delete Window - 删除窗口(&D) - - - - - - &Rename Window - 重命名窗口(&R) - - - - &Print Window - 打印窗口(&P) - - - - D&epending Graphs - 依赖的图像(&e) - - - - D&epending 3D Graphs - 依赖的3D图像(&e) - - - - - - D&epends on - 依赖 - - - - Function - 函数 - - - - Re&move Pie Curve - 移除饼状图曲线(&m) - - - - Anal&yze - 分析(&y) - - - - - &Paste Layer - 粘贴图层(&P) - - - - &Paste Text - 粘贴文本(&P) - - - - &Paste Tex Formula - 粘贴TeX方程式(&P) - - - - &Paste Image - 粘贴图像(&P) - - - - &Paste Rectangle - 粘贴矩形(&P) - - - - &Paste Ellipse - 粘贴椭圆(&P) - - - - &Paste Line/Arrow - 粘贴线/箭头(&P) - - - - - - &Layer - 图层(&L) - - - - - - &Window - 窗口(&W) - - - - E&xport - 导出(&x) - - - - - - &Print - 打印(&P) - - - - P&roperties... - 属性(&r)... - - - &Delete Layer - 删除图层(&D) - - - - &Copy Page - 复制页(&C) - - - - E&xport Page - 导出页(&x) - - - - &Matrix... - 矩阵(&M)... - - - - Choose &Data Set... - 选择数据集(&D)... - - - - Choose &Matrix... - 选择矩阵(&M)... - - - - C&lear - 清除(&l) - - - - &Copy Graph - 复制图像(&C) - - - - &Export - 导出(&E) - - - - - - - &Paste - 粘贴(&P) - - - - - &Insert Row - 插入行(&I) - - - - &Insert Column - 插入列(&I) - - - - - &Delete Rows - 删除行(&D) - - - - &Delete Columns - 删除列(&D) - - - - &Delete Row - 删除行(&D) - - - - Clea&r Row - 清除行(&r) - - - - Clea&r Rows - 清除行(&r) - - - - Choose the location of the QtiPlot help folder! - 选择QtiPlot帮助文件夹的路径! - - - - QtiPlot - index.html File Not Found! - QtiPlot - index.html文件没找到! - - - - There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! - 这个文件夹里面没有叫做<b>index.html</b>的文件。<br>请另选一个文件夹! - - - - - - QtiPlot - Help Files Not Found! - QtiPlot - 帮助文件没找到! - - - - - The manual can be downloaded from the following internet address: - 手册可以从以下网址下载: - - - - - QtiPlot - Help Profile Not Found! - QtiPlot - 帮助没找到! - - - - - The assistant could not start because the file <b>%1</b> was not found in the help file directory! - 助手无法启动因为文件<b>%1</b>不在帮助文件的目录中! - - - - - This file is provided with the QtiPlot manual which can be downloaded from the following internet address: - 这个文件随同QtiPlot手册提供,可以在以下网址下载: - - - - Please indicate the location of the help file! - 请指示帮助文件的位置! - - - - QtiPlot - Edit function - QtiPlot - 编辑函数 - - - - QtiPlot - Set the number of pixels to average - QtiPlot - 设置象素值为平均 - - - - Number of averaged pixels - 平均象素值 - - - - You must have more than one layer in the active window! - 在一个活动窗口你需要超过一个图层! - - - - You must have more than one dataset in the active layer! - 在一个活动图层你需要超过一个数据集! - - - - QtiPlot - Guess best origin for the new layer? - QtiPlot - 猜测新图层的最佳来源? - - - - Do you want QtiPlot to guess the best position for the new layer? - Warning: this will rearrange existing layers! - 你希望QtiPlot猜测新图层的最佳位置吗? -警告:这会重排已存在的图层! - - - - &Guess - 猜测(&G) - - - - &Top-left corner - 左上角(&T) - - - - Curve - 曲线 - - - - Integration of %1 from zero is - %1从0开始的积分 - - - - - - - - Please select a 'Y' column first! - 请先选择一个Y列! - - - - Integration of %1 - %1的积分 - - - - Area - 面积 - - - - - Linear Regression of %1 - %1线性回归 - - - - - Slope - 斜率 - - - - Intercept - 截止 - - - - - Chi^2 - Chi^2 - - - - - R^2 - R^2 - - - - - Add &Custom Script Action... - 添加自定义脚本动作(&C)... - - - - - - New &Project - 新建项目(&P) - - - - - Ctrl+N - Ctrl+N - - - - - New &Graph - 新建绘图(&G) - - - - - Ctrl+G - Ctrl+G - - - - - New &Note - 新建笔记(&N) - - - - - New &Table - 新建表格(&T) - - - - - Ctrl+T - Ctrl+T - - - - - New &Matrix - 新建矩阵(&M) - - - - - Ctrl+M - Ctrl+M - - - - - New &Function Plot - 新建函数绘图(&F) - - - - - Ctrl+F - Ctrl+F - - - - - New 3D &Surface Plot - 新建三维曲面绘图(&S) - - - - - Ctrl+ALT+Z - Ctrl+ALT+Z - - - - - &Open - 打开(&O) - - - - - Ctrl+O - Ctrl+O - - - - - Open Image &File - 打开图象文件(&F) - - - - - Ctrl+I - Ctrl+I - - - - - Import I&mage... - 导入图像(&m)... - - - - - &Save Project - 保存项目(&S) - - - - - Ctrl+S - Ctrl+S - - - - - Save Project &As... - 项目另存为(&A)... - - - - - Ctrl+Shift+S - Ctrl+Shift+S - - - - Open Temp&late... - 打开模板(&l)... - - - - - Save As &Template... - 另存为模板(&T)... - - - - Save Note As... - 笔记另存为... - - - - - &Import ASCII... - 导入ASCII(&I)... - - - - - &Undo - 撤销(&U) - - - - - Ctrl+Z - Ctrl+Z - - - - - &Redo - 重做(&R) - - - - - &Duplicate - 复制(&D) - - - - - Cu&t Selection - 剪切所选(&t) - - - - - Ctrl+X - Ctrl+X - - - - - &Copy Selection - 复制所选(&C) - - - - - Ctrl+C - Ctrl+C - - - - - &Paste Selection - 粘贴所选(&P) - - - - - Ctrl+V - Ctrl+V - - - - - Del - delete key - 删除 - - - - - Ctrl+E - Ctrl+E - - - - - Add La&yer - 添加图层(&y) - - - - - ALT+L - ALT+L - - - - - Arran&ge Layers - 排列图层(&g) - - - - - Shift+A - Shift+A - - - - - - Automatic Layout - 自动布局 - - - - - &Current - 当前(&C) - - - - - - - Ctrl+Alt+G - Ctrl+Alt+G - - - - - Alt+X - Alt+X - - - - - &Export PDF - 导出PDF(&E) - - - - - Ctrl+Alt+P - Ctrl+Alt+P - - - - - Ctrl+P - Ctrl+P - - - - - Print All Plo&ts - 打印所有绘图(&t) - - - - - E&xport ASCII - 导出ASCII文件(&x) - - - - - &Quit - 退出(&Q) - - - - - Ctrl+Q - Ctrl+Q - - - - - Clear &Log Information - 清除日志信息(&L) - - - - - Delete &Fit Tables - 删除拟合表格(&F) - - - - - Plot &Wizard - 绘图向导(&W) - - - - - Ctrl+Alt+W - Ctrl+Alt+W - - - - - &Preferences... - 选项(&P)... - - - - - Add/Remove &Curve... - 添加/删除曲线(&C)... - - - - - ALT+C - ALT+C - - - - - Add &Error Bars... - 添加误差棒(&E)... - - - - - Ctrl+B - Ctrl+B - - - - - Add &Function... - 添加函数(&F)... - - - - - - - Ctrl+Alt+F - Ctrl+Alt+F - - - - - &Rescale to Show All - 重缩放显示所有(&R) - - - - - - Ctrl+Shift+R - Ctrl+Shift+R - - - - - New &Legend - 新建图例(&L) - - - - - Ctrl+L - Ctrl+L - - - - - Add Time Stamp - 添加时间标记 - - - - - Ctrl+ALT+T - Ctrl+ALT+T - - - - - Add &Image - 添加图像(&I) - - - - - ALT+I - ALT+I - - - - - Vectors XY&AM - 矢量图XY&AM - - - - &Vectors &XYXY - 矢量图&XYXY - - - - - &Stacked Histogram - 堆叠直方图(&S) - - - - - Stem-and-&Leaf Plot - 茎叶图(&L) - - - - - D&ouble-Y - 双Y轴图(&o) - - - - - &Zoom - 缩放(&Z) - - - - - E&xtract to Graphs - 提取至绘图(&x) - - - - Extract to &Layers - 提取至层(&L) - - - - - Add Inset Layer - 添加浮动层 - - - - - &Ribbon - 带状图(&R) - - - - - &Bars - 棒状图(&B) - - - - - &Trajectory - 轨线(&T) - - - - - Statistics on &Columns - 统计列(&C) - - - - - Statistics on &Rows - 统计行(&R) - - - - - &Integrate - 积分(&I) - - - - - Integr&ate Function... - 函数积分(&a)... - - - - - Inte&rpolate ... - 插值(&r)... - - - - - &Low Pass... - 低通(&L)... - - - - - &High Pass... - 高通(&H)... - - - - - &Band Pass... - 带通(&B)... - - - - - &Band Block... - 带阻(&B)... - - - - - &FFT... - &FFT... - - - - - &Savitzky-Golay... - Savitzky-Golay(&S)... - - - - - &FFT Filter... - FFT滤波器(&F)... - - - - - Moving Window &Average... - 平均移动窗口(&A)... - - - - - &Differentiate - 微分(&D) - - - - - Fit &Linear - 线性拟合(&L) - - - - - Fit &Polynomial ... - 多项式拟合(&P)... - - - - - &First Order ... - 一阶(&F)... - - - - - &Second Order ... - 二阶(&S)... - - - - - &Third Order ... - 三阶(&T)... - - - - - Fit Exponential Gro&wth ... - 指数增益拟合(&w)... - - - - - Fit &Boltzmann (Sigmoidal) - 波尔兹曼(S型)拟合(&B) - - - - - Fit &Gaussian - 高斯拟合(&G) - - - - - Fit Lorent&zian - 洛仑兹拟合(&z) - - - - - Fit &Wizard... - 拟合向导(&W)... - - - - - Ctrl+Y - Ctrl+Y - - - - - &Plot ... - 绘图(&P)... - - - - - &Scales... - 比例(&S)... - - - - - &Axes... - 轴(&A)... - - - - - &Grid ... - 网格(&G)... - - - - - &Title ... - 标题(&T)... - - - - - Column &Options ... - 列选项(&O)... - - - - - Ctrl+Alt+O - Ctrl+Alt+O - - - - - Set Column &Values ... - 设置列值(&V)... - - - - - - - Alt+Q - Alt+Q - - - - - Recalculate - 重新计算 - - - - - - - Ctrl+Return - Ctrl+Return - - - - - &Hide Selected - 隐藏所选(&H) - - - - - Sho&w All Columns - 显示所有列(&w) - - - - - &Swap columns - 交换列(&S) - - - - - Move &Right - 右移(&R) - - - - - Move &Left - 左移(&L) - - - - - Move to F&irst - 移至开头(&i) - - - - - Move to Las&t - 移至末尾(&t) - - - - - &Columns... - 列(&C)... - - - - - &Rows... - 行(&R)... - - - - - &Delete Rows Interval... - 删除行间隔(&D)... - - - - - &About QtiPlot - 关于QtiPlot(&A) - - - - - F1 - F1 - - - - - Ctrl+H - Ctrl+H - - - - - &Choose Help Folder... - 选择帮助文件夹(&C)... - - - - - Ctrl+W - Ctrl+W - - - - - - Add Column - 添加列 - - - - - &Go to Row... - 跳转至行(&G)... - - - - - Go to Colum&n... - 跳转至列(&n)... - - - - - Ctrl+Alt+C - Ctrl+Alt+C - - - - - Clear - 清除 - - - - - &Remove Layer - 移除图层(&R) - - - - - Alt+R - Alt+R - - - - - Window &Geometry... - 窗口几何属性(&G)... - - - - - - - &Hide Window - 隐藏窗口(&H) - - - - - - - Ctrl+Alt+H - Ctrl+Alt+H - - - - - &View Pixel Line Profile - 查看像素谱线轮廓(&V) - - - - - &Intensity Table - 强度表格(&I) - - - - - - - &Properties - 属性(&P) - - - - - &Activate Window - 激活窗口(&A) - - - - - Mi&nimize Window - 最小化窗口(&n) - - - - - Ma&ximize Window - 最大化窗口(&x) - - - - - Re&size Window... - 调整窗口尺寸(&s)... - - - - - &Surface... - 曲面图(&S)... - - - - - &Data Set... - 数据集(&D)... - - - - - Set &Properties... - 设置属性(&P)... - - - - - Set &Dimensions... - 设置维度(&D)... - - - - - Ctrl+D - Ctrl+D - - - - - Set &Values... - 设置值(&V)... - - - - - &Image Plot - 图像绘制(&I) - - - - - &Transpose - 转置(&T) - - - - - Flip &V - V型翻转(&V) - - - - Ctrl+Shift+V - Ctrl+Shift+V - - - - - Flip &H - H型翻转(&H) - - - - Ctrl+Shift+H - Ctrl+Shift+H - - - - - R&otate 90 - 旋转90(&o) - - - - - Rotate &-90 - 旋转-90(&-) - - - - - Ctrl+Alt+R - Ctrl+Alt+R - - - - - &Invert - 求逆(&I) - - - - - &Determinant - 秩(&D) - - - - - &Image mode - 图像模式(&I) - - - - Ctrl+Shift+I - Ctrl+Shift+I - - - - - &Data mode - 数据模式(&D) - - - - Ctrl+Shift+D - Ctrl+Shift+D - - - - - Show &X/Y - 显示X/Y(&X) - - - - Ctrl+Shift+X - Ctrl+Shift+X - - - - - Show &Column/Row - 显示列/行(&C) - - - - Ctrl+Shift+C - Ctrl+Shift+C - - - - - - &Gray Scale - 灰阶(&G) - - - - - &Default - 默认(&D) - - - - - &Rainbow - 彩虹(&R) - - - - - &Custom - 自定义(&C) - - - - - &Export Image ... - 导出图象(&E)... - - - - - - - &Direct - 直接(&D) - - - - - &XYZ Columns - &XYZ列 - - - - - &YXZ Columns - &YXZ列 - - - - &Forward FFT - 正FFT(&F) - - - - &Inverse FFT - 逆FFT(&I) - - - - Convert to &Matrix - 转换为矩阵(&M) - - - - - Dra&g Curve - - - - - &Import - - - - - You must select a single Y column that has an associated X column! - - - - - You must select exactly one Z column! - - - - - Open File - - - - - Imported sound file - - - - - This is not a PCM type WAV file, operation aborted! - - - - - PCM - - - - - - Time - 时间 - - - - Left - - - - - Right - - - - - Data - - - - - Channels - - - - - Sample Rate - - - - - Byte Rate - - - - - Block Align - - - - - Bits Per Sample - - - - - Presentation Preview - - - - - &Save - 保存(&S) - - - - There are no windows available in this folder! - - - - - - &Sound (WAV)... - - - - - - Create Open &Document Presentation... - - - - - - &Close - 关闭(&C) - - - - - &Lowess... - - - - - - 2D &Binning - - - - - - &Regular XYZ - - - - - - 3D &Wire Frame - 三维线框(&W) - - - - - 3D &Hidden Line - 三维隐藏线(&H) - - - - - 3D &Polygons - 三维多边形(&P) - - - - - 3D Wire &Surface - 三维线状曲面图(&S) - - - - Contour - &Color Fill - 等值线 - 色彩填充(&C) - - - - - Contour &Lines - 等值线图(&L) - - - - - &Gray Scale Map - 灰阶表(&G) - - - - - Sort Ta&ble - 表排序(&) - - - - - Sort Columns - 列排序 - - - - - Co&rrelate - 相关(&r) - - - - - &Autocorrelate - 自动相关(&A) - - - - - &Convolute - 卷积(&C) - - - - - &Deconvolute - 反卷积(&D) - - - - - &Horizontal - 水平(&H) - - - - - &Vertical - 垂直(&V) - - - - - Ro&w Numbers - 行号(&w) - - - - - &Random Values - 随机数(&R) - - - - - &Frequency Count ... - 频数统计(&F)... - - - - - &Read Only - 只读(&R) - - - - - &Disregard - 忽略该列(&D) - - - - - &Box Plot - 箱形图(&B) - - - - - &Gaussian... - 高斯(&G)... - - - - - &Lorentzian... - 洛仑兹(&L)... - - - - - Search for &Updates - 搜索更新(&U) - - - - - &QtiPlot Homepage - QtiPlot主页(&Q) - - - - QtiPlot &Forums - QtiPlot论坛(&F) - - - - - Report a &Bug - 报告BUG(&B) - - - - - Download &Manual - 下载手册(&M) - - - - - &Translations - 语言包(&T) - - - - - Make a &Donation - 捐赠(&D) - - - - - Technical &Support - 技术支持(&S) - - - - - Scripting &language - 脚本语言(&l) - - - - - &Restart scripting - 重新运行脚本(&R) - - - - - E&xecute - 执行(&x) - - - - - Ctrl+J - Ctrl+J - - - - - Execute &All - 全部执行(&A) - - - - - Ctrl+Shift+J - Ctrl+Shift+J - - - - - &Evaluate Expression - 计算表达式(&E) - - - - - Show Line &Numbers - 显示行号(&N) - - - - - Find &Next - - - - - - F3 - - - - - - Find &Previous - - - - - - F4 - - - - - - &Replace... - 替换(&R)... - - - - - Increase Indent - - - - - - Decrease Indent - - - - - - Rena&me Tab... - - - - - - A&dd Tab - - - - - - C&lose Tab - - - - - - &Script Window - 脚本窗口(&S) - - - - - &Plot details... - 绘图详情(&P)... - - - - - &Worksheet - 工作表(&W) - - - - - &Reset to Full Range - 重置到全部范围(&R) - - - - - Edit &Range... - 编辑范围(&R)... - - - - - &Hide - 隐藏(&H) - - - - - Hide &Other Curves - 隐藏其他曲线(&O) - - - - - &Show All Curves - 显示所有曲线(&S) - - - - - &Edit Function... - 编辑函数(&E)... - - - - - &Toolbars... - 工具栏(&T)... - - - - - Ctrl+Shift+T - Ctrl+Shift+T - - - - - Bold - 粗体 - - - - - Italic - 斜体 - - - - Superscript - 上标 - - - - Subscript - 下标 - - - - - Underline (Ctrl+U) - 下划线 (Ctrl+U) - - - - - Ctrl+U - Ctrl+U - - - - - - - Greek - 希腊字母 - - - - - Mathematical Symbols - 数学符号 - - - - Increase Precision - - - - - Decrease Precision - - - - - Open a new project - 打开一个新项目 - - - - New Fol&der - 新建文件夹(&d) - - - - Create a new folder - 创建新文件夹 - - - - Create an empty 2D plot - 创建一个空2D绘图 - - - - Create an empty note window - 创建一个空笔记窗口 - - - - New table - 新建表格 - - - - New matrix - 新建矩阵 - - - - Create a new 2D function plot - 创建一个新的2D函数绘图 - - - - Create a new 3D surface plot - 创建一个新的3D曲面图 - - - - Open project - 打开项目 - - - - Save project - 保存项目 - - - - Open Te&mplate... - 打开模板(&m)... - - - - Open template - 打开模板 - - - - Save window as template - 窗口另存为模板 - - - - Import data file(s) - 导入数据文件 - - - - Ctrl+K - Ctrl+K - - - - Undo changes - 撤销修改 - - - - Redo changes - 重做修改 - - - - Duplicate window - 复制窗口 - - - - Cut selection - 剪切所选 - - - - Copy selection - 复制所选 - - - - Paste selection - 粘贴所选 - - - - Delete selection - 删除所选 - - - - Project &Explorer - 项目浏览器(&E) - - - - Show project explorer - 显示项目浏览器 - - - - Results &Log - 结果日志(&L) - - - - Show analysis results - 显示分析结果 - - - - &Undo/Redo Stack - 撤销/重做堆栈(&U) - - - - Show available undo/redo commands - 显示可用撤销/重做命令 - - - - &Console - 控制台(&C) - - - - Show Scripting console - 显示脚本控制台 - - - - Script Window - 脚本窗口 - - - - Add Layer - 添加图层 - - - - Arrange Layers - 排列图层 - - - - Export current graph - 导出当前绘图 - - - - Export all graphs - 导出全部绘图 - - - - Export to PDF - 导出到PDF - - - - Print window - 打印窗口 - - - - Print preview - - - - - Add curve to graph - 把曲线添加到绘图 - - - - Add Error Bars... - 添加误差棒... - - - - Add Function... - 添加函数... - - - - Best fit - 最佳拟合 - - - - Add new legend - 添加新图例 - - - - Date & time - 日期 & 时间 - - - - Add Image - 添加图像 - - - - Plot as line - 绘制为线 - - - - Plot as symbols - 绘制为符号 - - - - Plot as line + symbols - 绘制为线 + 符号 - - - - Plot with vertical bars - 用垂直棒绘制 - - - - Plot with horizontal bars - 用水平棒绘制 - - - - Plot area - 绘图区域图 - - - - Plot pie - 绘制饼状图 - - - - &Vectors XYXY - 矢量图XYXY(&V) - - - - Vectors XYXY - 矢量图XYXY - - - - Vectors XYAM - 矢量图XYAM - - - - Stem-and-Leaf Plot - 绘制茎叶图 - - - - Double Y Axis - 双Y轴 - - - - Zoom - 缩放 - - - - Extract to Graphs - 提取至绘图 - - - - Extract to Layer&s - 提取至图层(&s) - - - - Extract to Layers - 提取至图层 - - - - Plot 3D ribbon - 绘制三维带状图 - - - - Plot 3D bars - 绘制三维棒状图 - - - - Plot 3D scatter - 绘制三维散点图 - - - - Plot 3D trajectory - 绘制三维轨线 - - - - Contour + &Color Fill - 等值线 + 色彩填充(&C) - - - - Contour Lines + Color Fill - 等值线图 + 色彩填充 - - - - Contour Lines - 等值线图 - - - - Gray Scale Map - 灰阶表 - - - - Selected columns statistics - 选中列统计 - - - - Selected rows statistics - 选中行统计 - - - - Hide selected columns - 隐藏所选列 - - - - Show all table columns - 显示表格所有列 - - - - Swap selected columns - 交换选中列 - - - - Move Right - 右移 - - - - Move Left - 左移 - - - - Move to First - 移至开头 - - - - Move to Last - 移至末尾 - - - - More Windows... - 更多窗口... - - - - Set Matrix Values - 设置矩阵值 - - - - Image Plot - 图像绘制 - - - - Rotate 90 Clockwise - 顺时针旋转90 - - - - Rotate 90 Counterclockwise - 逆时针旋转90 - - - - Flip Vertically - 垂直翻转 - - - - Flip Horizontally - 水平翻转 - - - - Fill selected columns with row numbers - 用行号填充选中列 - - - - Fill selected columns with random numbers - 用随机数填充选中列 - - - - Set column as X - 设置列为X - - - - Set column as Y - 设置列为Y - - - - Set column as Z - 设置列为Z - - - - Set as Y Error Bars - 设置为Y误差棒 - - - - Set as Labels - 设置为标签 - - - - Disregard Columns - 忽视列 - - - - Box and whiskers plot - 箱形图 - - - - Visit QtiPlot &Forums - 访问QtiPlot论坛(&F) - - - - Show find dialog - - - - - Find Next - - - - - Find Previous - - - - - Show replace dialog - - - - - Disable &tools - 禁用工具(&t) - - - - Pointer - 指针 - - - - Zoom In - 放大 - - - - Zoom &Out - 缩小(&O) - - - - Zoom Out - 缩小 - - - - Data reader - 数据读取器 - - - - Select data range - 选择数据范围 - - - - Screen reader - 屏幕读取器 - - - - Draw Data Points - 画数据点 - - - - Move data points - 移动数据点 - - - - Drag Curve - - - - - Remove data points - 移除数据点 - - - - Add Text - 添加文本 - - - - Add Equation - 添加公式 - - - - Add Rectangle - 添加矩形 - - - - Add Ellipse/Circle - 添加椭圆/圆 - - - - Draw arrow - 画箭头 - - - - Draw line - 画线 - - - - - - - Box - 箱形框 - - - - - - Frame - 框架 - - - - &Frame - 框架(&F) - - - - - No Axes - 无轴 - - - - - No axes - 无轴 - - - - Front grid - 前栅格 - - - - Back grid - 后栅格 - - - - Right grid - 右栅格 - - - - Left grid - 左栅格 - - - - Ceiling grid - 顶栅格 - - - - Floor grid - 底栅格 - - - - - - - Wireframe - 线框架 - - - - - Hidden Line - 隐藏线 - - - - - Hidden line - 隐藏线 - - - - - Polygon Only - 只有多边形 - - - - - Polygon only - 只有多边形 - - - - - Mesh & Filled Polygons - 网格&填充多边形 - - - - - Mesh & filled Polygons - 网格&填充多边形 - - - - - - - Dots - - - - - - - - Bars - - - - - - - - Cones - 圆锥体 - - - - - - - Crosshairs - 叉丝 - - - - - Floor Data Projection - 底面数据投影 - - - - - Floor data projection - 底面数据投影 - - - - - Floor Isolines - 底面等值线 - - - - - Floor isolines - 底面等值线 - - - - - Empty Floor - 空底面 - - - - - Empty floor - 空底面 - - - - - - - Animation - 动画 - - - - - - - Enable perspective - 启用透视 - - - - - - - Reset rotation - 重置旋转 - - - - - - - Fit frame to window - 使框架适合窗口 - - - - QtiPlot - Enter the number of peaks - QtiPlot - 输入峰值数量 - - - - Peaks - - - - - Memory Allocation Error - 内存分配错误 - - - - Not enough memory, operation aborted! - 内存不足,操作中止! - - - - - Set Precision %1 digits - - - - - <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> If you like it, you're using it in your work and you would like to see it constantly improved, please support its authors by making a donation.</b></font> - <font size=+2, color = darkBlue><b>QtiPlot是一个开源软件,它的开发需要上百小时的工作。<br><br>如果你喜欢它,你在你的工作中应用它,并且希望看到它稳步的改进,请通过捐献的方式支持一下它的作者。</b></font> - - - - Please support QtiPlot! - 请支持QtiPlot! - - - - <b> %1 </b>: This command line option must be used without other arguments! - <b> %1 </b>: 这个命令行选项不能和其他参数一起用! - - - - Version - 版本 - - - - Usage - 用法 - - - - options - 选项 - - - - - file - 文件 - - - - - name - 名称 - - - - Valid options are - 有效的选项是 - - - - - - - - - - - or - 或者 - - - - show about dialog and exit - 显示关于对话框并退出 - - - - start QtiPlot with the default settings - 使用默认设置启动QtiPlot - - - - show command line options - 显示命令行选项 - - - - start QtiPlot in language - 使用语言包启动QtiPlot - - - - show QtiPlot manual in a standalone window - 在一个单独的窗口显示QtiPlot手册 - - - - print QtiPlot version and release date - 打印QtiPlot版本和发行日期 - - - - execute the script file given as argument - 执行参数中给出的脚本文件 - - - - execute the script file given as argument without displying the user interface. Warning: 2D plots are not correctly handled in this functioning mode! - 执行参数中给出的脚本文件并且不显示用户界面。警告:2D绘图在这种模式下处理不正确! - - - - can be any .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py or ASCII file - 可以为任何.qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py或者ASCII文件 - - - - Help - 帮助 - - - - <b> %1 </b>: Wrong locale option or no translation available! - <b> %1 </b>:错误的地区选项或者语言包不可用! - - - - <b> %1 </b> unknown command line option! - <b> %1 </b> 未知命令行选项! - - - - Type %1 to see the list of the valid options. - 键入%1来查看有效选项列表。 - - - - <b>%1</b> is a directory, please specify a file name! - <b>%1</b>是一个目录,请指定一个文件名! - - - - The file: <b>%1</b> is not a QtiPlot or Origin project file! - 文件:<b>%1</b>不是一个QtiPlot或者Origin项目文件! - - - - QtiPlot - Demo Version - QtiPlot - 演示版本 - - - You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. - 你正在使用演示版本的Qtiplot。它跟完全版是一致的,不过你不能保存文件,也不能一次使用超过十分钟。<br><br>如果你准备好使用完整功能版,请在<a href="http://soft.proindependent.com/individual_contract.html">订阅一个单用户带维护通知的版本。</a><br><br>QtiPlot是一个自由软件。如果你想知道如何使用,你可以免费得到<a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">源代码</a>。尽管如此,仍然欢迎你<a href="http://soft.proindependent.com/why_donate.html">捐助</a>来支持QtiPlot未来的开发。 - - - - QtiPlot - File backup error - QtiPlot - 文件备份错误 - - - - Cannot make a backup copy of <b>%1</b> (to %2).<br>If you ignore this, you run the risk of <b>data loss</b>. - 无法备份<b>%1</b>(至 %2)。<br>如果你忽略这个,你就处于<b>丢失数据</b>的风险中。 - - - - QtiPlot - File save error - QtiPlot - 文件保存失败 - - - - The file: <br><b>%1</b> is opened in read-only mode - 文件: <br><b>%1</b>是以只读模式打开的 - - - - Save project as - 项目另存为 - - - - - - - &Find... - 查找(&F)... - - - - - App&end Project... - 附加项目(&e)... - - - - Make a donation - - - - - show standalone scripting window - - - - - You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://soft.proindependent.com/download.html">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. - - - - - Save &As Project... - 另存为项目(&A)... - - - - &Delete Folder - 删除文件夹(&D) - - - - &Rename - 重命名(&R) - - - - &Windows in Active Folder - 活动文件夹内的窗口(&W) - - - - Windows in &Active Folder && Subfolders - 活动文件夹和自文件夹内的窗口(&A) - - - - &View Windows - 查看窗口(&V) - - - - Hidden - 隐藏 - - - - Name already exists! - 名称已存在! - - - - Project - 项目 - - - - - - Path - 路径 - - - - bytes - 字节 - - - - - Contents - 内容 - - - - - windows - 窗口 - - - - - folders - 文件夹 - - - - Modified - 改动的 - - - - - - Properties - 属性 - - - - New Folder - 新建文件夹 - - - - QtiPlot - Delete folder? - QtiPlot - 删除文件夹? - - - - Delete folder '%1' and all the windows it contains? - 删除文件夹'%1'和里面包含的所有窗口? - - - - - Note - 笔记 - - - - - 3D Graph - 三维绘图 - - - - Status - 状态 - - - - QtiPlot - No match found - QtiPlot - 找不到匹配项 - - - - Sorry, no match found for string: '%1' - 对不起,没有找到匹配的字符串: '%1' - - - - Cannot move an object to itself! - 不能把一个对象移到自身上! - - - - Cannot move a parent folder into a child folder! - 不能把一个父文件夹移动到资文件夹内! - - - - Skipped moving folder - 跳过移动文件夹 - - - - - The destination folder already contains a folder called '%1'! Folder skipped! - 目的文件夹已经含有一个叫做'%1'的文件夹!文件夹跳过! - - - - - - Error - 错误 - - - - QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! - QtiPlot尝试下载最新更新的必要信息。请修改你的防火墙设置来允许QtiPlot连接到英特网! - - - - Do you wish to continue? - 你想继续吗? - - - - QtiPlot - HTTP get version file - QtiPlot - HTTP获取版本文件 - - - - Error while fetching version file with HTTP: %1. - HTTP取版本文件时出错: %1。 - - - - QtiPlot - Updates Available - QtiPlot - 有更新 - - - - There is a newer version of QtiPlot (%1) available for download. Would you like to download it? - 有更新版本的QtiPlot (%1)等待下载。你希望下载它吗? - - - - QtiPlot - No Updates Available - QtiPlot - 没有更新 - - - - No updates available. Your current version %1 is the last version available! - 没有更新。你现在的版本%1就是最新版本! - - - - This will clear the contents of all the data associated with the table. Are you sure? - 这会清楚表格相关的数据的所有内容。你确定? - - - - &No - 否(&N) - - - - QtiPlot - Enter row number - QtiPlot - 输入行号 - - - - Row - - - - - QtiPlot - Enter column number - QtiPlot - 输入列号 - - - - - QtiPlot was not built with Python scripting support included! - QtiPlot编译时不包含Python脚本支持! - - - - Please set a default X column for this table, first! - 请先为这个表格设置一个默认的X列! - - - - Please select a Z column for this operation! - 请为这个操作选择一个Z列! - - - - You need to define a X column first! - 首先你需要定义一个X列! - - - - You need to define a Y column first! - 首先你需要定义一个Y列! - - - - Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. - 从0.9.1版本开始QtiPlot就保存拥护定义拟合模型到不同的位置。 - - - - If you want to save your already defined models, please choose a destination folder. - 如果你想保存你已经定义的模型,请选择一个目的文件夹。 - - - - Import fit models - 导入拟合模型 - - - - Choose a directory to export the fit models to - 选择一个目录来导出拟合模型 - - - - - No Icon - 无图标 - - - - Couldn't load file: %1. -Autocompletion will not be available! - 无法加载文件:%1。 -自动完成无法使用! - - - - Please select exactly one column and more than one non empty cell! - 请选择一列和至少一个非空单元! - - - - Data set: %1 doesn't exist! - 数据集:%1不存在! - - - - Stem and leaf plot of dataset - 数据集的茎叶图 - - - - from row - 起始行 - - - - to row - 结束行 - - - - Not enough memory for this dataset! - 没有足够的内存给这个数据集! - - - - Stem - - - - - Leaf - - - - - Please confirm the stem unit! - 你确认茎单位! - - - - Data set - 数据集 - - - - stem unit - 茎单位 - - - - Stem unit - 茎单位 - - - - Leaf unit - 叶单位 - - - - Key - - - - - means - 方法 - - - - Input error: empty data set! - 输入错误:空数据集! - - - - English - 中文 - - - - Alt+C - Alt+C - - - - - - Spec&ial Bar/Column - - - - - &Add - 添加(&A) - - - - &Indexed Colors - - - - - Pale&tte - - - - - - Ctrl+Alt+D - - - - - - Zoom &In/Out and Drag Canvas - - - - - - Stack &Bar - - - - - - Stack &Column - - - - - &Waterfall Plot - - - - - - Fit Slop&e - - - - - Plot stack bar - - - - - Plot stack column - - - - - Zoom In (Shift++) or Out (-) and Drag Canvas - - - - - Close - 关闭 - - - - - Move Row - - - - - Print preview of window: - - - - - - Print Pre&view - - - - - - Ad&just Column Width - - - - - - &Upward - - - - - - &Downward - - - - - Append a project to the current folder - - - - - Ctrl+Alt+A - - - - - Move current row upward - - - - - Move current row downward - - - - - Set optimal column width - - - - - ArrowMarker - - - dx - - - - - dy - - - - - angle - - - - - length - - - - - - eqn - - - - - y - - - - - - x - - - - - AssociationsDialog - - - QtiPlot - Plot Associations - QtiPlot - 绘图关联 - - - - Spreadsheet: - 数据表: - - - - Column - - - - - X - X - - - - Y - Y - - - - - xErr - xErr - - - - - yErr - yErr - - - - &Update curves - 更新曲线(&U) - - - - &OK - 确定(&O) - - - - &Cancel - 取消(&C) - - - - xEnd - xEnd - - - - yEnd - yEnd - - - - Angle - 角度 - - - - Magn. - Magnitude, vector length - Magn. - - - - AxesDialog - - - QtiPlot - General Plot Options - QtiPlot - 常规绘图选项 - - - - &Apply - 应用(&A) - - - - &OK - 确定(&O) - - - - &Cancel - 取消(&C) - - - - - From - - - - - - To - - - - - - Type - 类型 - - - linear - 线性 - - - logarithmic - 对数 - - - - Probability - - - - - Logit - - - - - Inverted - - - - - Show Axis &Break - 显示轴间隙(&B) - - - - Draw Break &Decoration - 绘制间断装饰(&D) - - - - Position - 位置 - - - - % of Axis Length - 轴长度的% - - - - - Width - 宽度 - - - - pixels - 像素 - - - - &Log10 Scale After Break - 间断后以Log10调整(&L) - - - - Step Before Break - 间断前步长 - - - - - Guess - 猜测 - - - - Step After Break - 间断后步长 - - - - Minor Ticks Before - 次刻度之前于 - - - - Minor Ticks After - 次刻度之后于 - - - - Step - 步长 - - - - - Major Ticks - 主刻度 - - - - - Minor Ticks - 次刻度 - - - - - - Bottom - - - - - - - Left - - - - - - - Top - - - - - - - Right - - - - - Scale - 比例 - - - - Major Grids - 主栅格 - - - - Minor Grids - 次栅格 - - - - Line Color - 线颜色 - - - - Line Type - 线形 - - - - Thickness - - - - - - Axes - - - - - Additional lines - 附加线 - - - - X=0 - X=0 - - - - Y=0 - Y=0 - - - - Apply To - 应用到 - - - - This Layer - 此图层 - - - - This Window - 此窗口 - - - - - - All Windows - 所有窗口 - - - - An&tialised - 反锯齿(&) - - - - Horizontal - 水平 - - - - Vertical - 垂直 - - - - Grid - 栅格 - - - - Show - 显示 - - - - Title - 标题 - - - - Distance to axis - 到轴的距离 - - - - &Font - 字体(&F) - - - - - Format - 格式 - - - - Numeric - 数字 - - - - Text from table - 来自表格的文本 - - - - Day of the week - 周几 - - - - Month - - - - - Time - 时间 - - - - Date - 日期 - - - - Column Headings - 列头 - - - - Font - 字体 - - - - Axis &Font - 轴字体(&F) - - - - - - Color - 颜色 - - - - - None - 不选 - - - - - Out - - - - - - In & Out - 内 & 外 - - - - - In - - - - - Stand-off - 远离 - - - - Apply &to - 应用到(&t) - - - - - Axis - - - - - - Layer - 图层 - - - - - Window - 窗口 - - - - Show Labels - 显示标签 - - - - Column - - - - - Table - 表格 - - - - - Precision - 精度 - - - - Angle - 角度 - - - - For&mula - 方程式(&m) - - - - Canvas frame - 画布框架 - - - - Draw backbones - 画干线 - - - - Line Width - 线宽 - - - - Major ticks length - 主刻度长度 - - - - Minor ticks length - 次刻度长度 - - - - Set As &Default - 设为默认(&D) - - - - Apply &to... - 应用到(&t)... - - - - General - 常规 - - - - Automatic - 自动 - - - - Decimal: 10000.0 - 十进制: 10000.0 - - - - Scientific: 1e4 - 科学计数法: 1E4 - - - - Scientific: 1x10^4 - 科学计数法: 1x10^4 - - - - Engineering: 10k - 工程计数: 10k - - - - - Origin - Origin - - - - QtiPlot - Formula input error - QtiPlot - 方程式输入错误 - - - - Valid variables are 'x' for Top/Bottom axes and 'y' for Left/Right axes! - 有效变量是'x'为上/下轴'y'为左/右轴! - - - - days - - - - - weeks - - - - - millisec. - 毫秒. - - - - sec. - 秒. - - - - min. - 分钟. - - - - hours - 小时 - - - - &Inverted - - - - - Linear - - - - - Log10 - - - - - ln - - - - - Log2 - - - - - Reciprocal - - - - - ColorBox - - - black - 黑色 - - - - red - 红色 - - - - green - 绿色 - - - - blue - 蓝色 - - - - cyan - 青色 - - - - magenta - 经紫色 - - - - yellow - 黄色 - - - - dark yellow - 深黄色 - - - - navy - 藏青色 - - - - purple - 紫红色 - - - - wine - 酒红色 - - - - olive - 橄榄色 - - - - dark cyan - 深青色 - - - - royal - 宝蓝色 - - - - orange - 橙色 - - - - violet - 紫色 - - - - pink - 粉红色 - - - - white - 白色 - - - - light gray - 浅灰色 - - - - gray - 灰色 - - - - light yellow - 浅黄色 - - - - light cyan - 浅青色 - - - - light magenta - 浅经紫色 - - - - dark gray - 深灰色 - - - - ColorButton - - - Custom - - - - - ColorMapDialog - - - QtiPlot - QtiPlot - - - - Custom Color Map - 自定义颜色表 - - - - &Apply - 应用(&A) - - - - &Close - 关闭(&C) - - - - Set Custom Palette - 设置自定义调色板 - - - - ColorMapEditor - - - Level - - - - - Color - 颜色 - - - - &Insert - 插入(&I) - - - - &Delete - 删除(&D) - - - - &Scale Colors - 色阶(&S) - - - - ColorMapPreviewDialog - - - QtiPlot - Color Map Preview Dialog - QtiPlot - 颜色表预览对话框 - - - - Colormap files - 颜色表文件 - - - - All files - 所有文件 - - - - << &Preview - << 预览(&P) - - - - - - - None - 不选 - - - - ColorPickerPopup - - - Custom - - - - - ConfigDialog - - - The column separator can be customized. -The following special codes can be used: -\t for a TAB character -\s for a SPACE - 列分隔符可以自定义. -以下特殊代码可以用: -\t为制表符 -\s为空格 - - - - The separator must not contain the following characters: -0-9eE.+- - 分隔符不能包含以下字符: -0-9eE.+- - - - - - - Background - 背景 - - - - - Background Color - 背景颜色 - - - - - - - Opacity - 不透明度 - - - - - Canvas Color - 画布颜色 - - - - - Border Color - 边框颜色 - - - - - - - Width - 宽度 - - - - LF (Unix) - LF (Unix) - - - - CRLF (Windows) - CRLF (Windows) - - - - CR (Mac) - CR (Mac) - - - - - - - System Locale Setting - 系统本地设置 - - - - &B - &B - - - - &It - &It - - - - - Translations - 语言包 - - - - - Help - 帮助 - - - - - Python Configuration Files - Python配置文件 - - - - QtiPlot - Choose default settings - QtiPlot - 选择默认设置 - - - - General - 常规 - - - - - Tables - 表格 - - - - - 2D Plots - 二维绘图 - - - - - 3D Plots - 三维绘图 - - - - Notes - 笔记 - - - - Fitting - 拟合 - - - - Options - 选项 - - - - Curves - 曲线 - - - - Axes - - - - - Ticks - 刻度 - - - - - - Fonts - 字体 - - - - Do not &resize layers when window size changes - 当窗口尺寸变化的时候不改变图层尺寸(&r) - - - - &Disable in-place editing - 禁用就地编辑(&D) - - - - - Length - 长度 - - - - Major Ticks - 主刻度 - - - - Minor Ticks - 次刻度 - - - - Margin - 页边距 - - - - Axes title space - 轴标题空白 - - - - Frame width - 框架宽度 - - - - Canvas Fra&me - 画布框架(&m) - - - - Show &Title - 显示标题(&T) - - - - Scale &Fonts - 缩放字体(&F) - - - - Auto&scaling - 自动缩放(&s) - - - - Antia&liasing - 反锯齿(&l) - - - - Legend display - - - - - Column name - - - - - Column comment - - - - - Table name - - - - - Table legend - - - - - - Transparent - 透明 - - - - Axes &backbones - 轴干线(&b) - - - - Axes linewidth - 轴线宽 - - - - Left - - - - - Right - - - - - Bottom - - - - - Top - - - - - Enabled axes - 启用轴 - - - - Show - 显示 - - - - - Labels - 标签 - - - - - None - 不选 - - - - - Out - - - - - - In & Out - 内 & 外 - - - - - In - - - - - Print - 打印 - - - - Print Crop&marks - 打印截角标记(&m) - - - - &Scale layers to paper size - 缩放图层到纸张尺寸(&S) - - - - Prompt on closing - 关闭时提示 - - - - Folders - - - - - Matrices - 矩阵 - - - - &Notes - 笔记(&N) - - - - &OK - 确定(&O) - - - - &Cancel - 取消(&C) - - - - &Apply - 应用(&A) - - - - &Text Font - 文本字体(&T) - - - - &Labels Font - 标签字体(&L) - - - - A&xes Labels - 轴标签(&x) - - - - Axes &Numbers - 轴数字(&N) - - - - &Legend - 图例(&L) - - - - T&itle - 标题(&i) - - - - Prompt on &renaming tables when appending projects - 添加到项目重命名表格时提醒(&r) - - - - Application - 程序 - - - - Confirmations - 确认 - - - - - - Colors - 颜色 - - - - Numeric Format - 数字格式 - - - - File Locations - 文件位置 - - - - Language - 语言 - - - - - - Style - 样式 - - - - - Grids - - - - - - Ma&jor Grids - - - - - - Mi&nor Grids - - - - - - Color - 颜色 - - - - Main Font - 主字体 - - - - Choose &font - 选择字体(&f) - - - - Workspace - 工作台 - - - - Panels text - 面板文本 - - - - Panels - 面板 - - - - Save every - 保存每 - - - - &Backup project before saving - 保存项目前备份(&B) - - - - Check for new versions at startup - 启动时检查新版本 - - - - minutes - 分钟 - - - - Default scripting language - 默认脚本语言 - - - - Matrix Undo Stack Size - 矩阵撤销堆栈大小 - - - - Endline character - 行尾字符 - - - - Start New Project - 开始新项目 - - - - - Empty - - - - - Table - 表格 - - - - Matrix - 矩阵 - - - - Empty Graph - 空图 - - - - Note - 笔记 - - - - &Enable autocompletion (Ctrl+U) - 启用自动完成(&E)(Ctrl+U) - - - - Number of Decimal Digits - 小数位数 - - - - Decimal Separators - 小数分隔符 - - - - Omit &Thousands Separator - 忽略千位分隔符(&T) - - - - Clipboard Decimal Separators - 剪贴板小数分隔符 - - - - Automatically &Recalculate Column Values - 自动重计算列值(&R) - - - - &Display Comments in Header - 在头里面显示注释(&D) - - - - Default Column Separator - 默认列分隔符 - - - - - - - TAB - TAB - - - - - - - SPACE - SPACE - - - - Text - 文本 - - - - Default curve style - 默认曲线样式 - - - - Line width - 线宽 - - - - Symbol size - 符号大小 - - - - Line - 线状图 - - - - Scatter - 散点图 - - - - Line + Symbol - 线状图+符号 - - - - Vertical drop lines - 垂线图 - - - - Spline - 齿形图 - - - - Vertical steps - 垂直阶梯图 - - - - Horizontal steps - 水平阶梯图 - - - - Area - 面积 - - - - Vertical Bars - 垂直棒状图 - - - - Horizontal Bars - 水平棒状图 - - - - &Resolution - 分辨率(&R) - - - - (all data shown) - (显示所有数据) - - - - &Show Legend - 显示图例(&S) - - - - &Floor style - 底线样式(&F) - - - - Isolines - 等值线 - - - - Projection - 投影 - - - - Smoot&h Line - 平滑线(&h) - - - - O&rthogonal - 正交(&r) - - - - Lab&els - 标签(&e) - - - - &Mesh - 网格(&M) - - - - &Grid - 栅格(&G) - - - - - - &Numbers - 数字(&N) - - - - A&xes - 轴(&x) - - - - &Background - 背景(&B) - - - - Default Color Map - 默认颜色表 - - - - &Title - 标题(&T) - - - - &Axes Labels - 轴标签(&A) - - - - Autosca&ling - 自动缩放(&l) - - - - - Solid - 实心 - - - - - Dash - - - - - - Dot - - - - - - Dash Dot - - - - - - Dash Dot Dot - - - - - - Short Dash - - - - - - Short Dot - - - - - - Short Dash Dot - - - - - Tab length (pixels) - 制表符长度(像素) - - - - Font - 字体 - - - - &Display line numbers - 显示行号(&D) - - - - Syntax Highlighting - 语法高亮 - - - - Co&mments - 注释(&m) - - - - &Keywords - 关键字(&K) - - - - &Quotations - 引用(&Q) - - - - &Functions - 函数(&F) - - - - Q&t Classes - Qt类(&t) - - - - Generated Fit Curve - 拟合生成的曲线 - - - - Uniform X Function - 统一X的函数 - - - - Points - - - - - Same X as Fitting Data - 跟拟合数据的X相同 - - - - 2 points for linear fits - 线性拟合两点 - - - - - Display Peak Curves for Multi-peak Fits - 多峰拟合显示峰值曲线 - - - - Parameters Output - 参数输出 - - - - Significant Digits - 有效数字 - - - - Write Parameters to Result Log - 参数写到结果日志 - - - - Paste Parameters to Plot - 参数粘贴到绘图上 - - - - Scale Errors with sqrt(Chi^2/doF) - 用sqrt(Chi^2/doF)调整误差 - - - - Peaks Color - 峰值颜色 - - - - QtiPlot - Import options error - QtiPlot - 导入选项错误 - - - - The separator must not contain the following characters: 0-9eE.+- - 分隔符不能包含以下字符: 0-9eE.+- - - - - - QtiPlot - index.html File Not Found! - QtiPlot - index.html没有找到! - - - - There is no file called <b>index.html</b> in folder %1.<br>Please choose another folder! - %1文件夹中没有<b>index.html</b>文件.<br>请选择另一个文件夹! - - - - Choose the location of the QtiPlot translations folder! - 选择QtiPlot语言包文件夹的位置! - - - - Choose the location of the QtiPlot help folder! - 选择QtiPlot帮助文件夹的位置! - - - - There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! - 文件夹中没有<b>index.html</b>文件.<br>请选择另一个文件夹! - - - - Choose the location of the Python configuration files! - 选择Python配置文件的位置! - - - - - QtiPlot - Folder Not Found! - QtiPlot - 文件夹未找到! - - - - The folder %1 doesn't exist.<br>Please choose another folder! - 文件夹%1不存在.<br>请选择另一个文件夹! - - - - %1 is not a folder.<br>Please choose another folder! - %1不是文件夹.<br>请选择另一个文件夹! - - - - - QtiPlot - QtiPlot - - - - You don't have read access rights to folder %1.<br>Please choose another folder! - 你没有%1文件夹的阅读权限.<br>请选择另一个文件夹! - - - - - &Internet Connection - - - - - - &Proxy - - - - - - Host - - - - - - Port - - - - - - Username - - - - - - Password - - - - - LaTeX Compiler - - - - - Choose the location of the LaTeX compiler! - - - - - - QtiPlot - File Not Found! - - - - - The file %1 doesn't exist.<br>Please choose another file! - - - - - %1 is a folder.<br>Please choose a file! - - - - - You don't have read access rights to file %1.<br>Please choose another file! - - - - - ContourLinesEditor - - - Level - - - - - Pen - - - - - &Insert - 插入(&I) - - - - &Delete - 删除(&D) - - - - QtiPlot - Edit pen - - - - - Color - 颜色 - - - - - - Apply to all - 应用到所有 - - - - Style - 样式 - - - - Width - - - - - &Ok - 确定(&O) - - - - &Close - 关闭(&C) - - - - Convolution - - - Convolution - 卷积 - - - - - - - - QtiPlot - QtiPlot - - - - - - - - Error - 错误 - - - - The signal data set %1 does not exist! - 信号数据集%1不存在! - - - - The response data set %1 does not exist! - 响应数据集%1不存在! - - - - The response dataset '%1' must be less then half the size of the signal dataset '%2'! - 响应数据集'%1'必须少于信号数据集'%2'的一半! - - - - The response dataset '%1' must contain an odd number of points! - 响应数据集'%1'必须含有奇数个点! - - - - Could not allocate memory, operation aborted! - 分配内存失败,操作中止! - - - - - Index - 索引 - - - - Correlation - - - Correlation - 相关分析 - - - - - - QtiPlot - QtiPlot - - - - - - Error - 错误 - - - - - The data set %1 does not exist! - 数据集%1不存在! - - - - Error in GSL forward FFT operation! - GSL中的FFT运算错误! - - - - - Lag - 延迟 - - - - CreateBinMatrixDialog - - - - QtiPlot - - - - - Bin Matrix Dialog - - - - - &OK - 确定(&O) - - - - &Cancel - 取消(&C) - - - - X-min - - - - - X-max - - - - - Columns - - - - - Y-min - - - - - Y-max - - - - - Rows - - - - - Input Size Error - 输入尺寸错误 - - - - The dimensions you have specified are not acceptable! - 你指定的维度不可接受! - - - - Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! - 请输入一个正值,保证行*列的乘积不会超过系统允许的整数最大值! - - - - CurveRangeDialog - - - QtiPlot - Plot range - QtiPlot - 绘图值域 - - - - Data set: - 数据集: - - - - From row number - 自行号 - - - - To row number - 至行号 - - - - &OK - 确定(&O) - - - - &Close - 关闭(&C) - - - - CurvesDialog - - - QtiPlot - Add/Remove curves - QtiPlot - 添加/删除曲线 - - - - New curves style - 新建曲线样式 - - - - Line - 线状图 - - - - Scatter - 散点图 - - - - Line + Symbol - 线状图+符号 - - - - Vertical drop lines - 垂线图 - - - - Spline - 齿形图 - - - - Vertical steps - 垂直阶梯图 - - - - Horizontal steps - 水平阶梯图 - - - - Area - 面积 - - - - Vertical Bars - 垂直棒状图 - - - - Horizontal Bars - 水平棒状图 - - - - Histogram - 直方图 - - - - Contour - Color Fill - 等值线 - 色彩填充 - - - - Contour Lines - 等值线图 - - - - Gray Scale Map - 灰阶表 - - - - Histogram - 直方图 - - - - Available data - 可用数据 - - - - Graph contents - 图片内容 - - - - &Plot Associations... - 绘图关联(&P)... - - - - Edit &Range... - 编辑范围(&R)... - - - - &Edit Function... - 编辑函数(&E)... - - - - OK - 确定 - - - - Close - 关闭 - - - - &Show Range - 显示范围(&S) - - - - Show current &folder only - 只显示当前文件夹(&f) - - - - &Plot Selection - 绘制所选(&P) - - - - &Plot - 绘图(&P) - - - - &Delete Selection - 删除所选(&D) - - - - &Delete Curve - 删除曲线(&D) - - - - CustomActionDialog - - - - - - - - - - - - - QtiPlot - QtiPlot - - - - Add Custom Action - 添加自定义行为 - - - - Folder - 文件夹 - - - - Choose &Folder - 选择文件夹(&F) - - - - Script File - 脚本文件 - - - - Choose &Script - 选择脚本(&S) - - - - Icon - 图标 - - - - Choose &Icon - 选择图标(&I) - - - - - Text - 文本 - - - - Tool Tip Text - 工具提示文本 - - - - Shortcut - 快捷方式 - - - - &Menu - 菜单(&M) - - - - &New Menu... - 新建菜单(&N)... - - - - &Delete Menu - 删除菜单(&D) - - - - &Tool Bar - 工具栏(&T) - - - - &Save - 保存(&S) - - - - &Add - 添加(&A) - - - - &Remove - 移除(&R) - - - - &Close - 关闭(&C) - - - - - - - - - - Error - 错误 - - - - Please provide a description for your custom action! - 请给你的自定义行为提供一个描述! - - - - Dot characters are not allowed in the description text! - 点阵字符在描述文本中不允许! - - - - You have already defined an action having description: %1 <br>Please provide a different description text! - 你已经定义了一个描述为%1 <br>的行为。请提供一份不同的描述文本! - - - - The file you have specified doesn't exist, please choose a valid script file! - 你指定的文件不存在,请选择一个有效的脚本文件! - - - - The image file you have specified doesn't exist or can't be read, please choose another file! - 你指定的图像文件不存在或不可读,请选择另一个文件! - - - - Please provide a different key sequence! The following shortcut key sequences are already assigned: - 请提供一个不同的关键字顺序!以下快捷方式关键字顺序已经被指派过: - - - - Are you sure you want to remove this action? - 你确定你想移除这个行为? - - - - Remove Action - 移除行为 - - - - - File Save Error - 文件保存错误 - - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - 不能写入文件<br><h4> %1 </h4><p>。请验证你是否有此位置的写入权限! - - - Images - 图像 - - - - QtiPlot - Load icon from file - QtiPlot - 从文件加载图标 - - - - Python Script - Python脚本 - - - - All Files - 所有文件 - - - - Choose script file - 选择脚本文件 - - - - Choose the custom actions folder - 选择自定义行为文件夹 - - - - Add menu - 添加菜单 - - - - Menu title: - 菜单标题: - - - - - Menu Bar - 菜单栏 - - - - Please, choose the location of the new menu - 请选择新菜单的位置 - - - - Menu: - 菜单: - - - Thers's already a menu item with this title, please choose another title! - 已经有一个此标题的菜单,请选择另外的标题! - - - - Remove Menu - 移除菜单 - - - - Are you sure you want to remove menu '%1' and all its actions? - 你确定你希望移除'%1'菜单和它所有的行为吗? - - - - There's already a menu item with this title, please choose another title! - 已经有一个菜单项用这个标题,请选择请一个标题! - - - - DataPickerTool - - - Click on plot or move cursor to display coordinates! - 在图上点击或者移动光标来显示坐标系! - - - - Please, click on plot and move cursor! - 点击图并移动鼠标! - - - - Select point and double click to remove it! - 选择点并双击来删除它! - - - - QtiPlot - Remove point error - QtiPlot - 删除点错误 - - - - Sorry, but removing points of a function is not possible. - 对不起,不能从函数中删除点。 - - - - - - - QtiPlot - Warning - QtiPlot - 警告 - - - - - This operation cannot be performed on curves plotted from columns having a non-numerical format. - 这个操作不能在包含有非数字格式的列所画的曲线上执行。 - - - - QtiPlot - Move point error - QtiPlot - 移动点错误 - - - - Sorry, but moving points of a function is not possible. - 对不起,不能从函数中移动点。 - - - - - The column '%1' is read-only! Please choose another curve! - 列'%1'是只读!请选择其它曲线! - - - - DataSetDialog - - QtiPlot - Select data set - QtiPlot - 选择数据集 - - - &OK - 确定(&O) - - - &Cancel - 取消(&C) - - - - Deconvolution - - - Deconvolution - 反卷积 - - - - Differentiation - - - - Derivative - 导数 - - - - of - Derivative of - - - - - DrawPointTool - - - Draw - 画图 - - - - EnrichmentDialog - - - - - - QtiPlot - QtiPlot - - - - Tex Equation Editor - Tex公式编辑器 - - - - Clea&r - 清除(&r) - - - - Window Geometry - 窗口几何属性 - - - - Object Properties - 对象属性 - - - - &Apply - 应用(&A) - - - - &Close - 关闭(&C) - - - - Preview: - 预览: - - - - - &Text - 文本(&T) - - - - - Color - 颜色 - - - - &Font - 字体(&F) - - - - Background - 背景 - - - - - Opacity - 不透明度 - - - - - Transparent - 透明 - - - - Rotate (deg.) - 旋转(角度) - - - - Auto-&update - 自动更新(&u) - - - - TeX &Output - - - - - - - Set As &Default - 设为默认(&D) - - - - Apply format &to... - 应用格式到(&t)... - - - - - - Object - 对象 - - - - - - Layer - 图层 - - - - - - Window - 窗口 - - - - - - All Windows - 所有窗口 - - - - File - 文件 - - - - &Save internally - 内部保存(&S) - - - - &Image - 图像(&I) - - - - Shape - 形状 - - - - None - 不选 - - - - Line - 线 - - - - Rectangle - 矩形 - - - - Shadow - 阴影 - - - - Line Style - 线样式 - - - - - Width - 宽度 - - - - - Apply t&o... - 应用到(&o)... - - - - &Frame - 框架(&F) - - - - Fill Color - 填充颜色 - - - - Pattern - 图案 - - - - Pattern Color - 图案颜色 - - - - Use &Frame Color - 使用框架颜色(&F) - - - - Fill &Pattern - 填充图案(&P) - - - - Page - - - - - Layer Scales - - - - - Attach to - - - - - inch - 英寸 - - - - mm - 毫米 - - - - cm - 厘米 - - - - point - - - - - pixel - 像素 - - - - scale - 比例 - - - - Unit - 单位 - - - - Position - 位置 - - - - X - X - - - - Y - Y - - - - Size - 大小 - - - - Height - - - - - &Keep aspect ratio - 保持宽高比(&K) - - - - &Best size - 最佳尺寸(&B) - - - - &Geometry - 布局(&G) - - - - Network connection error - 网络连接错误 - - - - Error while trying to connect to host %1: - 尝试连接主机%1时错误: - - - - Please verify your network connection! - 请检查你的网络连接! - - - - QtiPlot - Import image from file - QtiPlot - 从文件导入图像 - - - - QtiPlot - Warning - QtiPlot - 警告 - - - - The file %1 doesn't exist. The image cannot be restored when reloading the project file! - 文件%1不存在。当重载项目文件时图像无法恢复! - - - - MathTran (http://www.mathtran.org/) - - - - - locally installed - - - - - LaTeX Compiler - - - - - Compile process ended - - - - - Compiling process ended with exit code: %1 - - - - - LaTeX compile process - - - - - dvipng process - - - - - - failed to start! - - - - - Please verify that you have dvipng installed in the same folder as your LaTeX compiler! - - - - - crashed - - - - - timedout - - - - - write error - - - - - read error - - - - - unknown error - - - - - Compile error - - - - - Please set the correct path to the compiler in the preferences dialog! - - - - - ErrDialog - - - - Source of errors - 误差源 - - - - QtiPlot - Error Bars - QtiPlot - 误差棒 - - - - &X Error Bars - &X误差棒 - - - - &Add - 添加(&A) - - - - Add Error Bars to - 添加误差棒至 - - - - Percent of data (%) - 数据百分比(%) - - - - Standard Deviation of Data - 数据标准差 - - - - &Y Error Bars - &Y误差棒 - - - - &Close - 关闭(&C) - - - - Existing column - 已存在列 - - - - ExpDecayDialog - - - QtiPlot - Verify initial guesses - QtiPlot - 验证初始猜测 - - - - Exponential Fit of - 指数拟合 - - - - Growth time - 增长时间 - - - - Decay time - 衰减时间 - - - - First decay time (t1) - 第一衰减时间(t1) - - - - Second decay time (t2) - 第二衰减时间(t2) - - - - Third decay time (t3) - 第三衰减时间(t3) - - - - Amplitude - 振幅 - - - - Y Offset - Y偏移 - - - - Initial time - 初始时间 - - - - Color - 颜色 - - - - &Fit - 拟合(&F) - - - - &Close - 关闭(&C) - - - - QtiPlot - Warning - QtiPlot - 警告 - - - - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - 曲线<b> %1 </b>不再存在!操作中止! - - - - ExponentialFit - - - ExpGrowth - 指数增长 - - - - Exponential growth - 指数增长 - - - - - amplitude - 振幅 - - - - lifetime - 生命期 - - - - - offset - 偏移 - - - - ExpDecay1 - 指数衰减1 - - - - Exponential decay - 指数衰减 - - - - e-folding time - e 倍变化时间 - - - - ExportDialog - - - QtiPlot - Export ASCII - QtiPlot - 导出ASCII - - - - Table - 表格 - - - - &All - 全部(&A) - - - - Separator - 分隔符 - - - - - - - - TAB - TAB - - - - - - - - SPACE - SPACE - - - - - The column separator can be customized. The following special codes can be used: -\t for a TAB character -\s for a SPACE - 列分隔符可以自定义.以下特殊代码可以用: -\t为制表符 -\s为空格 - - - - - - The separator must not contain the following characters: 0-9eE.+- - 分隔符不能包含以下字符: 0-9eE.+- - - - - Include Column &Names - 包含列名称(&N) - - - - Include Column Co&mments - 包含列注释(&m) - - - - Export &Selection - 导出所选(&S) - - - - QtiPlot - Export error - QtiPlot - 导出错误 - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - - - - &OK - 确定(&O) - - - &Cancel - 取消(&C) - - - - &Help - 帮助(&H) - - - - QtiPlot - Help - QtiPlot - 帮助 - - - - QtiPlot - Import options error - QtiPlot - 导入选项错误 - - - - ExtensibleFileDialog - - - << &Advanced - << 高级(&A) - - - - FFT - - - - - - - FFT - FFT - - - - - Forward - - - - - - - - of - - - - - - - Frequency - 频率 - - - - - Inverse - - - - - - - Time - 时间 - - - - - Real - 实部 - - - - - Imaginary - 虚部 - - - - - - - Amplitude - 振幅 - - - - - Angle - 角度 - - - - Hz - Hz - - - - s - s - - - - FFTDialog - - - QtiPlot - FFT Options - QtiPlot - FFT选项 - - - - &Forward - 正(&F) - - - - &Inverse - 逆(&I) - - - - Curve - 曲线 - - - - Sampling - 采样 - - - - Real - 实部 - - - - Imaginary - 虚部 - - - - - Sampling Interval - 采样间隔 - - - - &Normalize Amplitude - 归一化振幅(&N) - - - - &Shift Results - 偏移结果(&S) - - - - &OK - 确定(&O) - - - - &Close - 关闭(&C) - - - - QtiPlot - Error - QtiPlot - 错误 - - - - Please choose a column for the real part of the data! - 请选择实部数据列! - - - - QtiPlot - QtiPlot - - - - The two matrices have different dimensions, the imaginary part will be neglected! - 两个矩阵维度不同,虚部忽略! - - - - RealMatrixFFT - RealMatrixFFT - - - - Real part of the FFT transform of - FFT变换的实部 - - - - ImagMatrixFFT - ImagMatrixFFT - - - - Imaginary part of the FFT transform of - FFT变换的虚部 - - - - AmplitudeMatrixFFT - AmplitudeMatrixFFT - - - - Amplitudes of the FFT transform of - FFT变换的振幅 - - - - FFTFilter - - - FFT - FFT - - - - Filtered - 滤波 - - - - - QtiPlot - QtiPlot - - - - - Error - 错误 - - - - Unknown filter type. Valid values are: 1 - Low pass, 2 - High Pass, 3 - Band Pass, 4 - Band block. - 未知滤波器类型. 有效值: 1 - 低通, 2 - 高通, 3 - 带通, 4 - 带阻. - - - - Please enter different values for the band limits. - 请给频带限制键入一个不同的值。 - - - - to - - - - - Hz - Hz - - - - Low Pass FFT Filter - 低通FFT滤波器 - - - - High Pass FFT Filter - 高通FFT滤波器 - - - - Band Pass FFT Filter - 带通FFT滤波器 - - - - Band Block FFT Filter - 带阻FFT滤波器 - - - - Filter - - - - - - - - QtiPlot - QtiPlot - - - - - - - - Error - 错误 - - - - Please assign a curve first! - 请先制定一条曲线! - - - - Several data points have the same x value causing divisions by zero, operation aborted! - 部分点X值相同,导致被0除,操作中止! - - - - - You need at least %1 points in order to perform this operation! - 你需要至少%1个点来进行操作! - - - - QtiPlot - Filter Error - QtiPlot - 滤波器错误 - - - - Please enter a valid curve name! - 请输入一个有效的曲线名称! - - - - QtiPlot - Color Name Error - QtiPlot - 颜色名称错误 - - - - The color name '%1' is not valid, a default color (red) will be used instead! - 颜色名称'%1'无效,使用默认颜色(红色)! - - - - You didn't specify a valid data set for this operation! - 你还没有为该操作选定一个有效的数据集! - - - - of - - - - - Plot - 绘图 - - - - Memory Allocation Error - 内存分配错误 - - - - Not enough memory, operation aborted! - 内存不足,操作中止! - - - - FilterDialog - - - QtiPlot - Filter options - QtiPlot - 滤波器选项 - - - - Filter curve: - 滤波器曲线: - - - - Frequency cutoff (Hz) - 截止频率(Hz) - - - - Low Frequency (Hz) - 低频(Hz) - - - - High Frequency (Hz) - 高频(Hz) - - - - Add DC Offset - 添加直流偏置 - - - - Substract DC Offset - 减去直流偏置 - - - - - Color - 颜色 - - - - &Filter - 滤波器(&F) - - - - &Close - 关闭(&C) - - - - QtiPlot - Frequency input error - QtiPlot - 频率输入错误 - - - - Please enter frequency limits that satisfy: Low < High ! - 请输入频率满足条件的限制:Low < High ! - - - - FindDialog - - - QtiPlot - QtiPlot - - - - - Find - 查找 - - - - Start From - 开始于 - - - - Search in - 查找于 - - - - &Window Names - 窗口名称(&W) - - - - Window &Labels - 窗口标签(&L) - - - - Folder &Names - 文件夹名称(&N) - - - - Case &Sensitive - 大小写敏感(&S) - - - - &Partial Match Allowed - 允许部分匹配(&P) - - - - &Include Subfolders - 包括子文件夹(&I) - - - - &Find - 查找(&F) - - - - &Update Start Path - 更新起始路径(&U) - - - - &Close - 关闭(&C) - - - - FindReplaceDialog - - - - - QtiPlot - QtiPlot - - - - - Find - 查找 - - - - Find and Replace - 查找并替换 - - - - Replace with - 替换为 - - - - &Match case - 匹配大小写(&M) - - - - &Whole word - 匹配全字(&W) - - - - &Next - 下一个(&N) - - - - &Previous - 上一个(&P) - - - - &Replace - 替换(&R) - - - - Replace &all - 全部替换(&a) - - - - &Close - 关闭(&C) - - - - - - Empty Search Field - 空查找域 - - - - - - The search field is empty. Please enter some text and try again. - 查找域为空。请键入文字再重新尝试。 - - - - QtiPlot has finished searching the document. - QtiPlot已经完成了文档搜索。 - - - - Fit - - - Plot - 绘图 - - - - graphics display disabled - 图像显示已禁用 - - - - of dataset - 的数据集 - - - - using function - 使用函数 - - - - Weighting Method - 取权方法 - - - - No weighting - 不取权 - - - - Instrumental - 辅助 - - - - using error bars dataset - 使用误差棒数据集 - - - - Statistical - 统计 - - - - Arbitrary Dataset - 任意数据集 - - - - Direct Weighting using Dataset - 使用数据集直接取权 - - - - Nelder-Mead Simplex - Nelder-Mead单形 - - - - Unscaled Levenberg-Marquardt - 未调整的Levenberg-Marquardt - - - - Scaled Levenberg-Marquardt - 调整的Levenberg-Marquardt - - - - algorithm with tolerance = - 算法容差= - - - - From x - 从x - - - - to x - 到x - - - - - R^2 - R^2 - - - - Adjusted R^2 - 校正的R^2 - - - - RMSE (Root Mean Squared Error) - 均方根误差(RMSE) - - - - RSS (Residual Sum of Squares) - 残差平方和(RSS) - - - - Iterations - 迭代 - - - - Status - 状态 - - - - Dataset - 数据集 - - - - Function - 函数 - - - - - - - QtiPlot - Error - QtiPlot - 错误 - - - - You cannot use the instrumental weighting method. - 你不能使用辅助加权方法。 - - - - The curve %1 has no associated Y error bars. You cannot use instrumental weighting method. - 曲线%1没有关联Y误差棒。你不能使用辅助加权方法。 - - - - The column %1 has less points than the fitted data set. Please choose another column! - - - - - The column %1 has less points than the fitted data set. Please choose another column!. - 列%1数据点少于拟合数据集。你选择其它列!。 - - - - Parameter - 参数 - - - - Value - - - - - Error - 错误 - - - - - - - - - - QtiPlot - Fit Error - QtiPlot - 拟合错误 - - - - - - Please perform a fit first! - 请先进行一个拟合! - - - - FitResiduals - 残差拟合 - - - - Residuals of %1 - %1的残差 - - - - residue - 残差 - - - - - - - - - - QtiPlot - Memory Allocation Error - QtiPlot - 内存分配错误 - - - - - - - - - Not enough memory! - 内存不足! - - - - - FitStats - 拟合状态 - - - - Confidence Limits of %1 - %1的置信限 - - - - - Independent Variable - 独立变量 - - - - LCL - 置信下限 - - - - Lower %1 Confidence Limit - %1的置信下限 - - - - UCL - 置信上限 - - - - Upper %1 Confidence Limit - %1的置信上限 - - - - Prediction Limits of %1 - %1的预测限 - - - - LPL - 预测下限 - - - - Lower %1 Prediction Limit - %1的预测下限 - - - - UPL - 预测上限 - - - - Upper %1 Prediction Limit - %1的预测上限 - - - - You didn't specify a valid data set for this fit operation. Operation aborted! - 你没有为此次拟合指定有效的数据集。操作中止! - - - - There are no parameters specified for this fit operation. Operation aborted! - 你没有为此次拟合指定参数。操作中止! - - - - You need at least %1 data points for this fit operation. Operation aborted! - 你需要至少%1个数据点来拟合。操作中止! - - - - You must specify a valid fit function first. Operation aborted! - 你必须首先指定一个有效的拟合函数。操作中止! - - - - - Could not allocate enough memory for the fit curves! - 不能为拟合曲线分配足够的内存! - - - - QtiPlot - Memory Allocation Error - QtiPlot - 内存分配错误 - - - - Fit - 拟合 - - - - QtiPlot - QtiPlot - - - - File Save Error - 文件保存错误 - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - 无法写入文件: <br><h4> %1 </h4><p>请保证你在这个位置有写权限! - - - - QtiPlot Fit Model - QtiPlot拟合模型 - - - - Cannot read file %1: -%2. - 不能读取文件%1: -%2。 - - - - FitDialog - - - QtiPlot - Fit Wizard - QtiPlot - 拟合向导 - - - - Curve - 曲线 - - - - - Function - 函数 - - - - Initial guesses - 初始猜测 - - - - - &Save - 保存(&S) - - - - &Preview - 预览(&P) - - - - Parameter - 参数 - - - - From - - - - - Value - - - - - To - - - - - Constant - 常数 - - - - Error - 错误 - - - - Algorithm - 算法 - - - - Scaled Levenberg-Marquardt - 调整的Levenberg-Marquardt - - - - Unscaled Levenberg-Marquardt - 未调整的Levenberg-Marquardt - - - - Nelder-Mead Simplex - Nelder-Mead单形 - - - - Color - 颜色 - - - - From x= - 从x= - - - - To x= - 到x= - - - - Iterations - 迭代 - - - - Tolerance - 容许误差 - - - - Weighting Method - 取权方法 - - - - No weighting - 不取权 - - - - Instrumental - 辅助 - - - - Statistical - 统计 - - - - Arbitrary Dataset - 任意数据集 - - - - Direct Weighting - 直接取权 - - - << &Edit function - << 编辑函数(&E) - - - - &Delete Fit Curves - 删除拟合曲线(&D) - - - - &Fit - 拟合(&F) - - - - - - &Close - 关闭(&C) - - - Custom &Output >> - 自定义输出(&O)>> - - - - Category - 类别 - - - - Expression - 表达式 - - - - User defined - 用户定义 - - - - Built-in - 内置 - - - - Basic - 基本 - - - - Plugins - 插件 - - - - Fit with &built-in function - 使用内置函数拟合(&b) - - - - - Polynomial Order - 多项式阶 - - - - - Choose plug&ins folder... - 选择插件目录(&i)... - - - - Name - 名称 - - - - user1 - user1 - - - - - Parameters - 参数 - - - - &Remove - 移除(&R) - - - - Add &expression - 添加表达式(&e) - - - - Add &name - 添加名称(&n) - - - - Rese&t - 重置(&t) - - - &Fit >> - 拟合(&F)>> - - - - &Uniform X Function - 统一X的函数(&U) - - - - Points - - - - - Same X as Fitting &Data - 跟拟合数据的X相同(&D) - - - - Generated Fit Curve - 拟合生成的曲线 - - - - Significant Digits - 有效数字 - - - - Parameters &Table - 参数表(&T) - - - - - Name: - 名称: - - - - &One table for all fits - 所有拟合使用一个表(&O) - - - - Covariance &Matrix - 协变矩阵(&M) - - - - CovMatrix - 协变矩阵 - - - - Co&nf. Bands - 置信带(&n) - - - - Pred. &Bands - 推导带(&B) - - - - &Residuals Plot - 残差散布图(&R) - - - - &Scale Errors with sqrt(Chi^2/doF) - 用sqrt(Chi^2/doF)调整误差(&S) - - - - Parameters Output - 参数输出 - - - - &Write Parameters to Result Log - 参数写到结果日志(&W) - - - - &Paste Parameters to Plot - 参数粘贴到绘图上(&P) - - - << &Fit - << 拟合(&F) - - - - - - Select Function - - - - - - - - Fitting Session - - - - - - - Custom Output - - - - - Start Fitting Session - - - - - &Apply - 应用(&A) - - - - - - - - - - QtiPlot - Error - QtiPlot - 错误 - - - - Please enter a valid name for the parameters table. - 请为参数表输入一个有效名称。 - - - - - - - - Please perform a fit first and try again. - 请先进行一个拟合并重试。 - - - - Please enter a valid name for the covariance matrix. - 请为协变矩阵输入一个有效名称。 - - - - - - - - QtiPlot - Input function error - QtiPlot - 输入函数错误 - - - - - Please enter a valid function! - 请输入一个有效的函数! - - - - Please enter a function name! - 你输入一个函数名称! - - - - QtiPlot - Error: function name - QtiPlot - 错误:函数名称 - - - - is a built-in function name<p>You must choose another name for your function! - 是一个内置函数名<p>你必须给你的函数选择另外一个名称! - - - - You can't define functions recursively! - 你不能定义一个递归的函数! - - - - - QtiPlot fit model - QtiPlot拟合模型 - - - - - All files - 所有文件 - - - - - - QtiPlot - QtiPlot - - - - - Save Fit Model As - 另存为拟合模型 - - - - Are you sure you want to remove fit model file: - %1 ? - 你确定要移除拟合模型文件: -%1 ? - - - - Remove Fit Model - 移除拟合模型 - - - - Choose &models folder... - 选择模型目录(&m)... - - - - Fit with selected &user function - 使用选定的用户函数拟合(&u) - - - - Fit using &built-in function - 使用内置函数拟合(&b) - - - - Fit using &plugin function - 使用插件函数拟合(&p) - - - - Choose the plugins folder - 选择插件目录 - - - - Choose the fit models folder - 选择拟合模型目录 - - - - - Gauss - 高斯 - - - - - Lorentz - 洛仑兹 - - - - Peaks - - - - - - Polynomial - 多项式 - - - - QtiPlot - Warning - QtiPlot - 警告 - - - - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - 曲线<b> %1 </b>不再存在!操作中止! - - - - QtiPlot - Input error - QtiPlot - 输入错误 - - - - Please enter x limits that satisfy: from < end! - 请输入x满足from < end 的上下限! - - - - Please verify that you have initialized all the parameters! - 你验证你是否初始化了所有参数! - - - - - No data tables - 没有数据表 - - - - Error: - 错误: - - - - Folder - - - kB - kB - - - - bytes - 字节 - - - - FrequencyCountDialog - - - QtiPlot - Frequency count - QtiPlot - 频数统计 - - - - Statistics on %1 - 统计%1 - - - - Mean - 平均值 - - - - Standard Deviation - 标准差 - - - - Median - 中值 - - - - Size - 大小 - - - - From Minimum - 自最小值 - - - - To Maximum - 至最大指 - - - - Step Size - 步长 - - - - &Apply - 应用(&A) - - - - &Cancel - 取消(&C) - - - - &Ok - 确定(&O) - - - - QtiPlot - Error - QtiPlot - 错误 - - - - Not enough data points, operation aborted! - 没有足够的数据点,操作中止! - - - - QtiPlot - Frequency input error - QtiPlot - 频率输入错误 - - - - Please enter frequency limits that satisfy: From < To ! - 请输入频率满足条件的限制:From < To ! - - - - - Count - 计数 - - - - Frequency count of %1 - %1的频数统计 - - - - BinCtr - BinCtr - - - - BinEnd - BinEnd - - - - Sum - - - - - FunctionDialog - - - QtiPlot - Add function curve - QtiPlot - 添加函数曲线 - - - - Curve type - - - - - Function - 函数 - - - - Parametric plot - 参数绘图 - - - - Polar plot - 极坐标绘图 - - - - f(x)= - f(x)= - - - - From x= - 从x= - - - - To x= - 到x= - - - - - - Points - - - - - Constant - 常数 - - - - Value - - - - - - Parameter - 参数 - - - - - From - - - - - - To - - - - - x = - x = - - - - y = - y = - - - - R = - R = - - - - Theta = - Theta = - - - - Clea&r Function - 清除函数(&r) - - - - &Ok - 确定(&O) - - - - &Close - 关闭(&C) - - - - Clear list - 清除列表 - - - - Clear Function - 清除函数 - - - - - - QtiPlot - Input error - QtiPlot - 输入错误 - - - - Please enter x limits that satisfy: from < end! - 请输入x满足from < end 的上下限! - - - - - - - - QtiPlot - Input function error - QtiPlot - 输入函数错误 - - - - - QtiPlot - Start limit error - QtiPlot - 起始限制错误 - - - - - QtiPlot - End limit error - QtiPlot - 结束限制错误 - - - - - Please enter parameter limits that satisfy: from < end! - 请输入参数满足from < end 的上下限! - - - - &Add Function - - - - - GaussAmpFit - - - GaussAmp - GaussAmp - - - - offset - 偏移 - - - - amplitude - 振幅 - - - - center - 中心 - - - - width - 宽度 - - - - GaussAmp Fit - GaussAmp拟合 - - - - GaussFit - - - Gauss - 高斯 - - - - Gauss Fit - 高斯拟合 - - - - area - 面积 - - - - center - 中心 - - - - width - 宽度 - - - - offset - 偏移 - - - - Graph - - - Y Axis Title - Y轴标题 - - - - X Axis Title - X轴标题 - - - - - - - - - QtiPlot - Error - QtiPlot - 错误 - - - - - Couldn't change the axis type to the requested format! - 不能将轴类型转换为请求格式! - - - - - Please provide a valid file name! - 请提供有效的文件名! - - - - File format not handled, operation aborted! - 无法处理的文件格式,操作中止! - - - - layer - - - - - Title - 标题 - - - - QtiPlot - File open error - QtiPlot - 文件打开错误 - - - - Image file: <p><b> %1 </b><p>does not exist anymore! - 图像文件<p><b> %1 </b><p>不再存在! - - - - Data set generated from curve - 从曲线生成数据集 - - - - Table - 表格 - - - - - - QtiPlot - Warning - QtiPlot - 警告 - - - - The columns - - - - - are empty and will not be added to the plot! - 是空的并且不会被添加到绘图中! - - - - The column - - - - - is empty and will not be added to the plot! - 是空的并且不会被添加到绘图中! - - - - - Cu&t - 剪切(&t) - - - - - &Copy - 复制(&C) - - - - - C&lear - 清除(&l) - - - - - &Delete - 删除(&D) - - - - - - &Properties... - 属性(&P)... - - - - &Rescale to show all - 重缩放显示所有(&R) - - - - Ctrl+Shift+R - Ctrl+Shift+R - - - - &Hide axis - 隐藏轴(&H) - - - - &Show grids - 显示网格(&S) - - - - &Scale... - 比例(&S)... - - - - There are no curves available on this plot! - 绘图中没有有效曲线! - - - - There are no curves with more than two points on this plot. Operation aborted! - 绘图中没有包含多于两个点的曲线。操作中止! - - - - F - F - - - - Graph3D - - - X axis - X轴 - - - - Y axis - Y轴 - - - - Z axis - Z轴 - - - - - - QtiPlot - Error - QtiPlot - 错误 - - - - - Please provide a valid file name! - 请提供有效的文件名! - - - - File format not handled, operation aborted! - 无法处理的文件格式,操作中止! - - - - ImageExportDialog - - - QtiPlot - Choose a filename to save under - QtiPlot - 选择一个文件来保存 - - - - Resolution (DPI) - 分辨率(DPI) - - - &Export in &color - 彩色输出(&E) - - - - Export in &color - - - - - &Escape special characters in title/axis labels - - - - - Export &font sizes - - - - - Export 3D texts as - 导出三维文字为 - - - - Bitmap images - Bitmap图像 - - - - Native fonts - 点阵字体 - - - - LaTeX file - LaTeX文件 - - - - 3D Sort mode - 三维排序模式 - - - - No sort - 不排序 - - - - Simple sort - 简单排序 - - - - BSP sort - BSP排序 - - - - Image quality - 图像质量 - - - - Save transparency - 保存透明度 - - - - Custom print size - 自定义打印尺寸 - - - - inch - 英寸 - - - - mm - 毫米 - - - - cm - 厘米 - - - - point - - - - - pixel - 像素 - - - - Unit - 单位 - - - - Width - - - - - Height - - - - - Scale Fonts Factor - 字体调整比例 - - - - Automatic - 自动 - - - - &Keep aspect ratio - 保持宽高比(&K) - - - - Print Resolution (DPI) - - - - - ImageWidget - - - - QtiPlot - File openning error - QtiPlot - 文件打开错误 - - - - The file: <b>%1</b> doesn't exist! - 文件:<b>%1</b>不存在! - - - - You don't have the permission to open this file: <b>%1</b> - 你没有权限打开<b>%1</b>文件 - - - - ImportASCIIDialog - - - QtiPlot - Import ASCII File(s) - QtiPlot - 导入ASCII文件 - - - - All files - 所有文件 - - - - Text files - 文本文件 - - - - Data files - 数据文件 - - - - Comma Separated Values - 逗号分隔的值 - - - - Import each file as: - 每个文件导入为: - - - - - New Table - 新建表格 - - - - - New Matrice - 新建矩阵 - - - - New Columns - 新建列 - - - - New Rows - 新建行 - - - - Overwrite Current Window - 覆盖当前窗口 - - - - Separator: - 分隔符: - - - - - - - - TAB - TAB - - - - - - - SPACE - SPACE - - - - The column separator can be customized. -The following special codes can be used: -\t for a TAB character -\s for a SPACE - 列分隔符可以自定义. -以下特殊代码可以用: -\t为制表符 -\s为空格 - - - - The separator must not contain the following characters: -0-9eE.+- - 分隔符不能包含以下字符: -0-9eE.+- - - - - Ignore first - 忽略起始 - - - - lines - - - - - Ignore lines starting with - 忽略行始于 - - - Use first row to &name columns - 用第一行命名各列(&n) - - - - Use first row &as - - - - - Column Names - - - - - Column Comments - - - - - Use second row as &comments - 用第二行作为注释(&c) - - - - &Remove white spaces from line ends - 移除行尾空格(&R) - - - - By checking this option all white spaces will be -removed from the beginning and the end of -the lines in the ASCII file. - when translating this check the what's this functions and tool tips to place the '\n's correctly - 选上这个选项,ASCII文件中所有行首和行尾的空白都会被移除。 - - - - Warning: checking this option leads to column -overlaping if the columns in the ASCII file don't -have the same number of rows. - 警告:选上这个选项会导致列重叠,如果ASCII文件中的各列行数不等。 - - - - - To avoid this problem you should precisely -define the column separator using TAB and -SPACE characters. - when translating this check the what's this functions and tool tips to place the '\n's correctly - 为了避免这个问题,你应该精确的用TAB和SPACE定义列分隔符。 - - - - &Simplify white spaces - 简化空白(&S) - - - - By checking this option all white spaces will be -removed from the beginning and the end of the -lines and each sequence of internal -whitespaces (including the TAB character) will -be replaced with a single space. - when translating this check the what's this functions and tool tips to place the '\n's correctly - 选上这个选项,行首和行尾的空白都会被去掉, -行内的连续空白(包括TAB)都会被替换为单个空格。 - - - - Warning: checking this option leads to column -overlaping if the columns in the ASCII file don't -have the same number of rows. - when translating this check the what's this functions and tool tips to place the '\n's correctly - 警告:选上这个选项会导致列重叠,如果ASCII文件中的各列行数不等。 - - - - Decimal Separators - 小数分隔符 - - - - System Locale Setting - 系统本地设置 - - - - Omit &thousands separator - 忽略千位分隔符(&t) - - - - Endline character - 行尾字符 - - - - LF (Unix) - LF (Unix) - - - - CRLF (Windows) - CRLF (Windows) - - - - CR (Mac) - CR (Mac) - - - - Import as &read-only - 导入为只读(&r) - - - - &Preview Lines - 预览行(&P) - - - - All - 全部 - - - - &Help - 帮助(&H) - - - - The column separator can be customized. The following special codes can be used: -\t for a TAB character -\s for a SPACE - 列分隔符可以自定义.以下特殊代码可以用: -\t为制表符 -\s为空格 - - - - The separator must not contain the following characters: 0-9eE.+- - 分隔符不能包含以下字符: 0-9eE.+- - - - - Remove white spaces from line ends - 移除行尾空格 - - - - By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. - 选上这个选项,ASCII文件中所有行首和行尾的空白都会被移除。 - - - - Simplify white spaces - 简化空白 - - - - By checking this option each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. - 选上这个选项,行内的连续空白(包括TAB)会被替换为单个空格。 - - - - By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. - 选上这个选项,行首和行尾的空白都会被去掉, -行内的连续空白(包括TAB)都会被替换为单个空格。 - - - - Warning: using these two last options leads to column overlaping if the columns in the ASCII file don't have the same number of rows. - 警告:使用最后这两个选项会导致列重叠,如果ASCII文件中的各列行数不等。 - - - - To avoid this problem you should precisely define the column separator using TAB and SPACE characters. - 为了避免这个问题,你应该精确的用TAB和SPACE定义列分隔符。 - - - - QtiPlot - Help - QtiPlot - 帮助 - - - - QtiPlot - File openning error - QtiPlot - 文件打开错误 - - - - You don't have the permission to open this file: <b>%1</b> - 你没有权限打开<b>%1</b>文件 - - - - IntDialog - - - QtiPlot - Integration Options - QtiPlot - 几分选项 - - - - Function - 函数 - - - - Variable - 变量 - - - - Order (1 - 5, 1 = Trapezoidal Rule) - 阶(1 - 5, 1 = 梯形法则) - - - - Number of iterations (Max=20) - 迭代次数(最大=20) - - - - Tolerance - 容许误差 - - - - Lower limit - 下限 - - - - Upper limit - 上限 - - - - &Plot area - 绘图区域(&P) - - - - &Integrate - 积分(&I) - - - - &Close - 关闭(&C) - - - - Integration - - - QtiPlot - Input error - QtiPlot - 输入错误 - - - - - Integration - 积分 - - - - - Numerical integration of - 数值积分 - - - - using a %1 order method - 使用%1阶方法 - - - - From - - - - - - to - - - - - Tolerance - 容许误差 - - - - Iterations - 迭代 - - - - Plot - 绘制 - - - - using the Trapezoidal Rule - 使用梯形法则 - - - - Points - - - - - from - - - - - Peak at - 峰位于 - - - - Area - 面积 - - - - QtiPlot - Error - QtiPlot - 错误 - - - - Unknown integration method. Valid values must be in the range: 1 (Trapezoidal Method) to 5. - 未知积分方法。有效值必须在1(梯形法则)至5。 - - - - Interpolation - - - - QtiPlot - QtiPlot - - - - - Error - 错误 - - - - Unknown interpolation method. Valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. - 未知插值方法。有效值:0 - 线性, 1 - 立方插值, 2 - 阿克玛光滑插值。 - - - - - - - Linear - 线性 - - - - - - - - - Int - 整数 - - - - - - - - - Interpolation - 插值 - - - - - - - Cubic - 立方插值 - - - - - - - Akima - 阿克玛光滑插值 - - - - QtiPlot - Error - QtiPlot - 错误 - - - - Unknown interpolation method, valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. - 未知插值方法,有效值:0 - 线性, 1 - 立方插值, 2 - 阿克玛光滑插值。 - - - - You need at least %1 points in order to perform this operation! - 你需要至少%1个点来进行此项操作! - - - - InterpolationDialog - - - QtiPlot - Interpolation Options - QtiPlot - 插值选项 - - - - Make curve from - 生成曲线自 - - - - Spline - 齿形图 - - - - Linear - 线性插值 - - - - Cubic - 立方插值 - - - - Non-rounded Akima - 非圆阿克玛插值 - - - - Points - - - - - From Xmin - 自Xmin - - - - To Xmax - 至Xmax - - - - Color - 颜色 - - - - &Make - 生成(&M) - - - - &Close - 关闭(&C) - - - - QtiPlot - Warning - QtiPlot - 警告 - - - - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - 曲线<b> %1 </b>不再存在!操作中止! - - - - QtiPlot - Input error - QtiPlot - 输入错误 - - - - Please enter x limits that satisfy: from < to! - 请输入x满足from < end 的上下限! - - - - LayerButton - - - Activate layer - - - - - LayerDialog - - - QtiPlot - Arrange Layers - QtiPlot - 排列图层 - - - - Layers - 图层 - - - - Number - 数字 - - - - Automatic &layout - 自动图层(&l) - - - - Alignment - 对齐 - - - - Horizontal - 水平 - - - - - Center - 居中 - - - - Left - - - - - Right - - - - - Vertical - 垂直 - - - - Top - - - - - Bottom - - - - - Grid - 栅格 - - - - Columns - - - - - Rows - - - - - &Layer Canvas Size - 图层画布尺寸(&L) - - - - Width - 宽度 - - - - - - - - - - - pixels - 像素 - - - - Height - 高度 - - - - Spacing - 间距 - - - - Columns gap - 列间距 - - - - Rows gap - 行间距 - - - - Left margin - 左页边距 - - - - Right margin - 右页边距 - - - - Top margin - 上页边距 - - - - Bottom margin - 下页边距 - - - - &Apply - 应用(&A) - - - - &OK - 确定(&O) - - - - - &Cancel - 取消(&C) - - - - Swap Layers - 交换图层 - - - - Source Layer - 源图层 - - - - Destination Layer - 目的图层 - - - - &Swap - 交换(&S) - - - - QtiPlot - Delete Layers? - QtiPlot - 删除图层? - - - - You are about to delete %1 existing layers. - 你将要删除已存在的%1图层。 - - - - Are you sure you want to continue this operation? - 你确定要继续此次操作? - - - - &Continue - 继续(&C) - - - - QtiPlot - Columns input error - QtiPlot - 列输入错误 - - - - The number of columns you've entered is greater than the number of graphs (%1)! - 你输入的列数超过了图像数(%1)! - - - - QtiPlot - Rows input error - QtiPlot - 行输入错误 - - - - The number of rows you've entered is greater than the number of graphs (%1)! - 你输入的行数超过了图像数(%1)! - - - - QtiPlot - Error - QtiPlot - 错误 - - - - Please enter different indexes for the source and destination layers! - 请为源和目的图层输入不同的索引号! - - - - LineDialog - - - QtiPlot - Line options - QtiPlot - 线状图选项 - - - - Color - 颜色 - - - - Type - 类型 - - - - Width - - - - - Arrow at &start - 起点处箭头(&s) - - - - Arrow at &end - 终点处箭头(&e) - - - - &Line - 线(&L) - - - - Length - - - - - Angle - 角度 - - - - &Filled - 填充(&F) - - - - Arrow &Head - 箭头头部(&H) - - - - Set &Default - 设为默认(&D) - - - - &Apply - 应用(&A) - - - - &Ok - 确定(&O) - - - - Page - - - - - Layer Scales - - - - - Attach to - - - - - Scale Coordinates - 缩放坐标系 - - - - Pixels - 像素 - - - - Unit - 单位 - - - - Start Point - 起点 - - - - - X - X - - - - - Y - Y - - - - End Point - 终点 - - - - &Geometry - 布局(&G) - - - - LineProfileTool - - - - QtiPlot - Pixel selection warning - QtiPlot - 像素选择警告 - - - - Please select an image marker first. - 请首先选择一个图像记号。 - - - - Please select the end line point inside the image rectangle! - 请在图像框内选择终点指向! - - - - pixel - 像素 - - - - intensity - 强度 - - - - Table - 表格 - - - - pixels - 像素 - - - - pixel intensity (a.u.) - 像素强度(a.u.) - - - - LinearFit - - - Linear Regression - 线性回归 - - - - Linear - 线性 - - - - QtiPlot - Fit Error - QtiPlot - 拟合错误 - - - - You need at least %1 data points for this fit operation. Operation aborted! - 你需要至少%1个数据点来拟合。操作中止! - - - - LinearSlopeFit - - - Linear Regression - 线性回归 - - - - LinearSlope - 线性斜率 - - - - QtiPlot - Fit Error - QtiPlot - 拟合错误 - - - - You need at least %1 data points for this fit operation. Operation aborted! - 你需要至少%1个数据点来拟合。操作中止! - - - - LogisticFit - - - Logistic - 逻辑斯蒂 - - - - init value - 初始值 - - - - final value - 终止值 - - - - center - 中心 - - - - power - - - - - Logistic Fit - 逻辑斯蒂拟合 - - - - LorentzFit - - - Lorentz - 洛仑兹 - - - - Lorentz Fit - 洛仑兹拟合 - - - - area - 面积 - - - - center - 中心 - - - - width - 宽度 - - - - offset - 偏移 - - - - Matrix - - - Set Dimensions - 设置维度 - - - - - - - - QtiPlot - Error - QtiPlot - 错误 - - - - Calculation failed, the matrix is not square! - 计算失败,矩阵不是方阵! - - - - - - - - - QtiPlot - QtiPlot - - - - - - - - Memory Allocation Error - 内存分配错误 - - - - - - - - Not enough memory, operation aborted! - 内存不足,操作中止! - - - - Inversion failed, the matrix is not square! - 求逆失败,矩阵不是方阵! - - - - Invert - 求逆 - - - - Transpose - 转置 - - - - Flip Vertically - 垂直翻转 - - - - Flip Horizontally - 水平翻转 - - - - Rotate 90° - 旋转90° - - - - Rotate -90° - 旋转-90° - - - - - Calculate Values - 计算值 - - - - Clear Selection - 清除所选 - - - - Paste - 粘贴 - - - - Delete Rows - 删除行 - - - - Delete Columns - 删除列 - - - - Insert Row - 插入行 - - - - Insert Column - 插入列 - - - - - Please provide a valid file name! - 请提供有效的文件名! - - - - File format not handled, operation aborted! - 无法处理的文件格式,操作中止! - - - - - Set Data Mode - 设置数据模式 - - - - Ctrl+A - Matrix: select all - Ctrl+A - - - - - Import Image - 导入图像 - - - - Inverse FFT - 逆FFT - - - - Forward FFT - 正FFT - - - - QtiPlot - ASCII Export Error - QtiPlot - ASCII导出错误 - - - - Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! - 无法写入文件: <br><h4> %1</h4><p>请保证你在这个位置有写权限! - - - - Import ASCII File - 导入ASCII文件 - - - - Due to memory limitations it will not be possible to undo this change. Do you want to continue anyways? - 因为内存限制而无法撤销此变化。你想继续吗? - - - - Warning - 警告 - - - - kB - kB - - - - MatrixDialog - - - QtiPlot - Matrix Properties - QtiPlot - 矩阵属性 - - - - Cell Width - 单元宽度 - - - - Data Format - 数据格式 - - - - Decimal: 1000 - 十进制: 1000 - - - - Scientific: 1E3 - 科学计数法: 1E3 - - - - Numeric Display - 数字显示 - - - - Default Decimal Digits - 默认小数位数 - - - - Significant Digits= - 有效位数= - - - - &Apply - 应用(&A) - - - - &OK - 确定(&O) - - - - &Cancel - 取消(&C) - - - - Set Columns Width - 设置列宽 - - - - Decimal - 十进制 - - - - Scientific - 科学计数法 - - - - Set Data Format %1 - 设置数据格式%1 - - - - Precision %1 digits - 精确到%1位 - - - - MatrixModel - - - Edited cell - 已编辑单元 - - - - - - - QtiPlot - QtiPlot - - - - - Input Size Error - 输入尺寸错误 - - - - The dimensions you have specified are not acceptable! - 你指定的维度不可接受! - - - - Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! - 请输入一个正值,保证行*列的乘积不会超过系统允许的整数最大值! - - - - - Memory Allocation Error - 内存分配错误 - - - - - Not enough memory, operation aborted! - 内存不足,操作中止! - - - - Multiline expressions take much more time to evaluate! Do you want to continue anyways? - 多行表达式需要很多的时间计算!你希望继续吗? - - - - Warning - 警告 - - - - MatrixSizeDialog - - - QtiPlot - Matrix Dimensions - QtiPlot - 矩阵维度 - - - - Dimensions - 维度 - - - - Rows - - - - - Columns - - - - - Coordinates - 坐标系 - - - - X (Columns) - X (列) - - - - Y (Rows) - Y (行) - - - - First - 第一项 - - - - Last - 最后一项 - - - - &Apply - 应用(&A) - - - - &OK - 确定(&O) - - - - &Cancel - 取消(&C) - - - - Set Coordinates x[%1 : %2], y[%3 : %4] - 设置坐标系 x[%1 : %2], y[%3 : %4] - - - - MatrixValuesDialog - - - QtiPlot - Set Matrix Values - QtiPlot - 设置矩阵值 - - - - For row (i) - row (i) - - - - - to - - - - - For col (j) - For col (j) - - - - Add &Function - 添加函数(&F) - - - - Add Ce&ll - 添加单元(&l) - - - - &Apply - 应用(&A) - - - - &Close - 关闭(&C) - - - - Use built-in muParser (much faster) - 使用内置muParser(快很多) - - - - Cell(i,j)= - Cell(i,j)= - - - - Set New Formula - 设置新方程式 - - - - MdiSubWindow - - - QtiPlot - QtiPlot - - - - Do you want to hide or delete - 你确实想要隐藏或者删除 - - - - Delete - 删除 - - - - Hide - 隐藏 - - - - Cancel - 取消 - - - - Normal - 普通 - - - - Minimized - 最小化 - - - - Maximized - 最大化 - - - - Hidden - 隐藏 - - - - B - 粗体 - - - - MultiLayer - - - Add layer - - - - - Remove active layer - - - - - QtiPlot - Guess best layout? - QtiPlot - 猜测最优布局? - - - - Do you want QtiPlot to rearrange the remaining layers? - 你希望QtiPlot重排现在的图层吗? - - - - &Yes - 是(&Y) - - - - &No - 否(&N) - - - - &Cancel - 取消(&C) - - - - - - QtiPlot - Error - QtiPlot - 错误 - - - - - Please provide a valid file name! - 请提供有效的文件名! - - - - File format not handled, operation aborted! - 无法处理的文件格式,操作中止! - - - - kB - kB - - - - Offset Amount... - - - - - Reverse Order - - - - - Fill Area... - - - - - Offset Dialog - - - - - Total Y Offset (%) - - - - - Total X Offset (%) - - - - - &Apply - 应用(&A) - - - - - &Close - 关闭(&C) - - - - Fill Curves - - - - - Enable Fill - - - - - Fill with Color - - - - - Side Lines - - - - - MultiPeakFit - - - Gauss - 高斯 - - - - Lorentz - 洛仑兹 - - - - Gauss Fit - 高斯拟合 - - - - Lorentz Fit - 洛仑兹拟合 - - - - multi-peak - 多峰 - - - - - area - 面积 - - - - - center - 中心 - - - - - width - 宽度 - - - - - offset - 偏移 - - - - - - Peak - - - - - - - Fit - 拟合 - - - - QtiPlot - Fit Error - QtiPlot - 拟合错误 - - - - Could not allocate enough memory for the fit curves! - 不能为拟合曲线分配足够的内存! - - - - fit of - 拟合 - - - - - peak - - - - - Area - 面积 - - - - Center - 中心 - - - - Width - - - - - Height - - - - - MultiPeakFitTool - - - Move cursor and click to select a point and double-click/press 'Enter' to set the position of a peak! - 移动光标并点击来选取一个点、双击/回车来设置一个峰值位置! - - - - Peak %1 selected! Click to select a point and double-click/press 'Enter' to set the position of the next peak! - %1峰已选择!点击选取一个点、双击/回车来设置下一个峰值的位置! - - - - NonLinearFit - - - NonLinear - 非线性 - - - - Non-linear Fit - 非线性拟合 - - - - - QtiPlot - Input function error - QtiPlot - 输入函数错误 - - - - Please enter a valid non-empty expression! Operation aborted! - 请键入一个有效的非空表达式!操作中止! - - - - - QtiPlot - Fit Error - QtiPlot - 拟合错误 - - - - There are no parameters specified for this fit operation. Please define a list of parameters first! - 拟合操作没有定义参数。请首先定义参数表! - - - - You must provide a list containing at least one parameter for this type of fit. Operation aborted! - 你必须提供至少包含一个此种拟合参数的参数表。操作中止! - - - - - constant - 常数 - - - - Note - - - Add tab - - - - - Please, enter new title: - - - - - Title - 标题 - - - - untitled - - - - - OpenProjectDialog - - - QtiPlot - Open Project - QtiPlot - 打开项目 - - - - QtiPlot project - QtiPlot项目 - - - - Compressed QtiPlot project - 压缩的QtiPlot项目 - - - - Origin project - Origin项目 - - - - Origin matrix - Origin矩阵 - - - - Origin worksheet - Origin工作表 - - - - Origin graph - Origin图像 - - - - Backup files - 备份文件 - - - - All files - 所有文件 - - - - Open As - 打开为 - - - - New Project Window - 新建项目窗口 - - - - New Folder - 新建文件夹 - - - - PatternBox - - - Solid - 实心 - - - - Horizontal - 水平 - - - - Vertical - 垂直 - - - - Cross - 交叉 - - - - BDiagonal - B对角 - - - - FDiagonal - F对角 - - - - DiagCross - 45度交叉 - - - - Dense1 - 密度1 - - - - Dense2 - 密度2 - - - - Dense3 - 密度3 - - - - Dense4 - 密度4 - - - - Dense5 - 密度5 - - - - Dense6 - 密度6 - - - - Dense7 - 密度7 - - - - None - 不选 - - - - Plot3DDialog - - - QtiPlot - Surface Plot Options - QtiPlot - 曲面图选项 - - - - &Apply - 应用(&A) - - - - &OK - 确定(&O) - - - - &Cancel - 取消(&C) - - - - - X - X - - - - - Y - Y - - - - - Z - u - - - - From - - - - - To - - - - - Type - 类型 - - - - linear - 线性 - - - - logarithmic - 对数 - - - - Major Ticks - 主刻度 - - - - Minor Ticks - 次刻度 - - - - &Scale - 比例(&S) - - - - Title - 标题 - - - - Axis Font - 轴字体 - - - - &Choose font - 选择字体(&C) - - - - Major Ticks Length - 主刻度长度 - - - - Minor Ticks Length - 次刻度长度 - - - - &Axis - 轴(&A) - - - - Co&lor - 颜色(&l) - - - - &Font - 字体(&F) - - - - &Title - 标题(&T) - - - - Linea&r color map - 线性颜色表(&r) - - - - Color map &file - 颜色表文件(&f) - - - - - - None - 不选 - - - - Opacity - 不透明度 - - - - &Line - 线(&L) - - - - &Background - 背景(&B) - - - - General - 常规 - - - - A&xes - 轴(&x) - - - - Lab&els - 标签(&e) - - - - &Numbers - 数字(&N) - - - &Grid - 栅格(&G) - - - - Coordinate System - 坐标系 - - - - &Colors - 颜色(&C) - - - - Show Legend - 显示图例 - - - - Orthogonal - 正交 - - - - - Line Width - 线宽 - - - - Resolution - 分辨率 - - - - Numbers Font - 数字字体 - - - - &Choose Font - 选择字体(&C) - - - - Distance labels - axis - 标签 - 轴距离 - - - - Zoom (%) - 缩放(%) - - - - X Zoom (%) - X缩放(%) - - - - Y Zoom (%) - Y缩放(%) - - - - Z Zoom (%) - Z缩放(%) - - - - &General - 常规(&G) - - - - Ma&jor Grids - - - - - Mi&nor Grids - - - - - Color - 颜色 - - - - - Style - 样式 - - - - - Solid - 实心 - - - - - Dash - - - - - - - Dot - - - - - - Dash Dot - - - - - - Dash Dot Dot - - - - - - Short Dash - - - - - - Short Dot - - - - - - Short Dash Dot - - - - - G&rid - - - - - Cross Hair - 叉丝 - - - - Cone - 圆锥体 - - - - - - - Width - 宽度 - - - - Smooth angles - 平滑角 - - - - Radius - 半径 - - - - Smooth line - 平滑线 - - - - Boxed - 箱形框 - - - - Quality - 质量 - - - - Points - - - - - &Worksheet - 工作表(&W) - - - - &Matrix - 矩阵(&M) - - - - Draw lines - 画线 - - - - Filled bars - 填充棒 - - - - Bars - - - - - PlotDialog - - - QtiPlot - Plot details - QtiPlot - 绘图详情 - - - - Plot type - 绘图类型 - - - - &Worksheet - 工作表(&W) - - - - &OK - 确定(&O) - - - - &Cancel - 取消(&C) - - - - &Apply - 应用(&A) - - - - - - &Plot Associations... - 绘图关联(&P)... - - - - Titles - 标题 - - - - Axes Labels - 轴标签 - - - - Axes Numbers - 轴数字 - - - - Legends - 图例 - - - - - Fonts - 字体 - - - - Background Color - 背景颜色 - - - - - Opacity - 不透明度 - - - - - Transparent - 透明 - - - - Canvas Color - 画布颜色 - - - - Border Color - 边框颜色 - - - - - - - - Width - 宽度 - - - - Antialiasing - 反锯齿 - - - - Margin - 页边距 - - - - Set As &Default - 设为默认(&D) - - - - Apply &to... - 应用到(&t)... - - - - - - - - - - - - Layer - 图层 - - - - - - - Window - 窗口 - - - - - - - All Windows - 所有窗口 - - - - inch - 英寸 - - - - mm - 毫米 - - - - cm - 厘米 - - - - point - - - - - pixel - 像素 - - - - Unit - 单位 - - - - Origin - Origin - - - - X= - X= - - - - Y= - Y= - - - - - - Size - 大小 - - - - width= - 宽= - - - - height= - 高= - - - - Keep aspect ratio - 保持宽高比 - - - - - - Geometry - 布局 - - - - &Speed Mode, Skip Points if needed - - - - - data points - - - - - Apply to curves with more than: - - - - - Tolerance (Douglas Peuker algorithm) - - - - - - - Speed - - - - - - - - - - Color - 颜色 - - - - - - - - Style - 样式 - - - - Border - 边界 - - - - First color - 第一颜色 - - - - - - - - - Pattern - 图案 - - - - Fill - 填充 - - - - 3D View - 三维视图 - - - - View Angle (deg) - 视角(度) - - - - Thickness (% of radius) - 厚(半径的百分比) - - - - Rotation - 旋转 - - - - Starting Azimuth (deg) - 起始方位角(度) - - - - Counter cloc&kwise - 顺时针计数(&k) - - - - Radius/Center - 半径/中心 - - - - Radius (% of frame) - 半径(框架的百分比) - - - - Horizontal Offset (% of frame) - 水平偏移(框架的百分比) - - - - - Pie Geometry - 饼状图几何属性 - - - - Automatic &Format - 自动格式化(&F) - - - - &Values - 值(&V) - - - - &Percentages - 百分比(&P) - - - - Categories/&Rows - 类别/行(&R) - - - - Associate Position with &Wedge - 用楔子关联位置(&W) - - - - Dist. from Pie Edge - 到饼状图边缘的距离 - - - - - - - - Labels - 标签 - - - - &Scale layers to paper size - 缩放图层到纸张尺寸(&S) - - - - Print Crop&marks - 打印截角标记(&m) - - - - - Print - 打印 - - - - &Show - 显示(&S) - - - - Column - - - - - White O&ut - 不透明(&u) - - - - Justify - 证明 - - - - Center - 居中 - - - - - - Left - 左对齐 - - - - - - Right - 右对齐 - - - - &Font - 字体(&F) - - - - Rotate (deg) - 旋转(角度) - - - - X Offset (font height %) - X偏移(字体高度百分比) - - - - Y Offset (font height %) - Y偏移(字体高度百分比) - - - - Attach curve to: - 附加曲线至: - - - - x Axis - X轴 - - - - - Bottom - - - - - - Top - - - - - y Axis - Y轴 - - - - - Axes - - - - - Connect - 连接 - - - - No line - 没有线 - - - - Lines - 线 - - - - Sticks - - - - - Horizontal Steps - 水平阶梯图 - - - - Dots - - - - - Spline - 齿形图 - - - - Vertical Steps - 垂直阶梯图 - - - - - - Apply Format &to - - - - - - - Selected Curve - - - - - Fill area under curve - 填充曲线下方区域 - - - - Fill color - 填充颜色 - - - - - - - Line - 线 - - - - - Fill Color - 填充颜色 - - - - - Edge Color - 边缘颜色 - - - - - Edge Width - 边缘宽度 - - - - - Skip Points - - - - - - None - 不选 - - - - - - - Symbol - 符号 - - - - - Box - 箱形框 - - - - - Type - 类型 - - - - No Box - 无边框 - - - - Rectangle - 矩形 - - - - Diamond - 菱形 - - - - Perc 10, 25, 75, 90 - 百分比 10, 25, 75, 90 - - - - Notch - V型切口 - - - - - Range - 范围 - - - - - - Standard Deviation - 标准差 - - - - - Standard Error - 标准误差 - - - - Perc 25, 75 - 百分比 25, 75 - - - - Perc 10, 90 - 百分比 10, 90 - - - - Perc 5, 95 - 百分比 5, 95 - - - - Perc 1, 99 - 百分比 1, 99 - - - - - Max-Min - 最大-最小 - - - - - Constant - 常数 - - - - - Percentile (%) - 百分比(%) - - - - Coefficient - 系数 - - - - Box Width - 箱形宽度 - - - - Whiskers - 有须 - - - - No Whiskers - 无须 - - - - 75-25 - 75-25 - - - - 90-10 - 90-10 - - - - 95-5 - 95-5 - - - - 99-1 - 99-1 - - - - Coef - 系数 - - - - - Box/Whiskers - 箱形图 - - - - Max - 最大值 - - - - 99% - 99% - - - - - Mean - 平均值 - - - - 1% - 1% - - - - Min - 最小值 - - - - - Percentile - 百分比 - - - - - Image - 图像 - - - - &Gray Scale - 灰阶(&G) - - - - &Default Color Map - 默认颜色表(&D) - - - - &Custom Color Map - 自定义颜色表(&C) - - - - - Contour Lines - 等值线图 - - - - Levels - - - - - Use &Color Map - 使用颜色表(&C) - - - - Use Default &Pen - 使用默认笔触(&P) - - - - Color Bar Scale - 颜色棒比例 - - - - Axis - - - - - Contour - 等值线 - - - - Direction - 方向 - - - - Plus - - - - - Minus - - - - - &X Error Bar - &X误差棒 - - - - - Line Width - 线宽 - - - - Cap Width - 冠宽度 - - - - 8 - 8 - - - - 10 - 10 - - - - 12 - 12 - - - - 16 - 16 - - - - 20 - 20 - - - - Through Symbol - 贯穿符号 - - - - - - Error Bars - 误差棒 - - - - Automatic Binning - 自动Binning - - - - &Show statistics - 显示统计信息(&S) - - - - Bin Size - Bin尺寸 - - - - Begin - 开始 - - - - End - 结束 - - - - - Histogram Data - 直方图数据 - - - - Gap Between Bars (in %) - 棒间间隔(%) - - - - Offset (in %) - 偏移(%) - - - - - Spacing - 间距 - - - - Arrowheads - 箭头头部 - - - - Length - 长度 - - - - - Angle - 角度 - - - - &Filled - 填充(&F) - - - - - End Point - 终点 - - - - - X End - X终点 - - - - - Y End - Y终点 - - - - Position - 位置 - - - - Tail - 尾部 - - - - Middle - 中部 - - - - Head - 头部 - - - - - Vector - 矢量 - - - - - - Bins - Bins - - - - - Histogram and Probabilities for - 直方图和几率 - - - - Quantity - 数量 - - - - Sum - - - - - Percent - 百分比 - - - - Minimum - 最小 - - - - Maximum - 最大 - - - - &Delete - 删除(&D) - - - - - &Edit... - 编辑(&E)... - - - - - Colors - 颜色 - - - - Pie - 饼状图 - - - - Vertical Bars - 垂直棒状图 - - - - Horizontal Bars - 水平棒状图 - - - - Histogram - 直方图 - - - - Vector XYXY - 矢量图XYXY - - - - Vector XYAM - 矢量图XYAM - - - - Scatter - 散点图 - - - - Line + Symbol - 线状图+符号 - - - - - - - QtiPlot - Input error - QtiPlot - 输入错误 - - - - Please enter a valid start limit! - 请输入有效的起始限制! - - - - Please enter a valid end limit! - 请输入有效的结束限制! - - - - Please enter a valid bin size value! - 请输入一个有效的bin尺寸值! - - - - QtiPlot - Start limit error - QtiPlot - 起始限制错误 - - - - QtiPlot - End limit error - QtiPlot - 结束限制错误 - - - - Please enter limits that satisfy: begin < end! - 请输入限制满足begin < end! - - - - - QtiPlot - Bin size input error - QtiPlot - Bin尺寸输入错误 - - - - Please enter a positive bin size value! - 请输入一个正的bin尺寸值! - - - - Vector Data - 矢量图数据 - - - - Magnitude - - - - - Matrix - 矩阵 - - - - Use matrix formula to calculate values - - - - - - Values - - - - - &Show Contour Lines - - - - - Set Equidistant Levels - - - - - Start - - - - - Step - 步长 - - - - Set &Levels - - - - - Pen - - - - - Use &Table Custom Pen - - - - - PlotWizard - - - QtiPlot - Select Columns to Plot - QtiPlot - 选择需绘制列 - - - - &X - &X - - - - x&Err - x&Err - - - - &Y - &Y - - - - yE&rr - yE&rr - - - - &Z - &Z - - - - &New curve - 新建曲线(&N) - - - - &Delete curve - 删除曲线(&D) - - - - Worksheet - 工作表 - - - - &Plot - 绘图(&P) - - - - &Close - 关闭(&C) - - - - - - - - - - - - - - - - - - - QtiPlot - Error - QtiPlot - 错误 - - - - Please define a Y column for the following curve - 请为以下曲线定义Y列 - - - - You have already defined a X column! - 你已经定义了一个X列! - - - - - - - You must define a X column first! - 首先你需要定义一个X列! - - - - You have already defined a Y column! - 你已经定义了一个Y列! - - - - - - This kind of curve is not handled by QtiPlot! - QtiPlot不能处理此种曲线! - - - - You have already defined a Z column! - 你已经定义了一个Z列! - - - - - You must define a Y column first! - 首先你需要定义一个Y列! - - - - - You have already defined an error-bars column! - 你已经定义了一个误差棒列! - - - - You must add a new curve first! - 首先你需要定义一个Y列! - - - - PluginFit - - - Plugin Fit - 通过插件拟合 - - - - QtiPlot - File not found - QtiPlot - 文件未找到 - - - - Plugin file: <p><b> %1 </b> <p>not found. Operation aborted! - 插件文件:<p><b> %1 </b> <p>未找。操作中止! - - - - - - - QtiPlot - Plugin Error - QtiPlot - 插件错误 - - - - The plugin does not implement a %1 method necessary for simplex fitting. - 这个插件不能执行一个简单拟合所需的%1方法。 - - - - - - The plugin does not implement a %1 method necessary for Levenberg-Marquardt fitting. - 这个插件不能执行一个Levenberg-Marquardt拟合所需的%1方法。 - - - - PolynomFitDialog - - - QtiPlot - Polynomial Fit Options - QtiPlot - 多项式拟合选项 - - - - Polynomial Fit of - 多项式拟合 - - - - Order (1 - 9, 1 = linear) - 阶(1 - 9, 1 = 线性) - - - - Fit curve # pts - 拟合曲线 # pts - - - - Not enough points - 没有足够的点 - - - - Fit curve Xmin - 拟合曲线Xmin - - - - Fit curve Xmax - 拟合曲线Xmax - - - - Color - 颜色 - - - - Show Formula on Graph? - 在图上显示方程式? - - - - &Fit - 拟合(&F) - - - - &Close - 关闭(&C) - - - - QtiPlot - Warning - QtiPlot - 警告 - - - - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - 曲线<b> %1 </b>不再存在!操作中止! - - - - PolynomialFit - - - Polynomial - 多项式 - - - - Polynomial Fit - 多项式拟合 - - - - QtiPlot - Fit Error - QtiPlot - 拟合错误 - - - - You need at least %1 data points for this fit operation. Operation aborted! - 你需要至少%1个数据点来拟合。操作中止! - - - - PythonScripting - - - Failed to export QtiPlot API - 导出QtiPlot API失败 - - - Accessing QtiPlot functions or objects from Python code won't work.Probably your version of SIP differs from the one QtiPlot was compiled against. - 从Python代码访问QtiPlot函数或对象失败。很可能你的SIP版本与QtiPlot编译所需的不符合。 - - - - Accessing QtiPlot functions or objects from Python code won't work. Probably your version of Qt/SIP/PyQt differs from the one QtiPlot was compiled against. - 从Python代码访问QtiPlot函数或对象失败。很可能你的SIP版本与QtiPlot编译所需的不符合。 - - - - QObject - - - The file is not an QtiPlot fit model file. - 这个文件不是一个QtiPlot拟合模型文件。 - - - - The file is not an QtiPlot fit model version 1.0 file. - 这个文件不是一个QtiPlot拟合模型1.0版本的文件。 - - - - The file is not a QtiPlot custom action file. - 这个文件不是一个QtiPlot自定义动作文件。 - - - - The file is not an QtiPlot custom action version 1.0 file. - 这个文件不是一个QtiPlot自定义动作1.0版本的文件。 - - - - The file is not a QtiPlot custom menu file. - 这个文件不是一个QtiPlot自定义菜单文件。 - - - - The file is not a QtiPlot custom menu version 1.0 file. - 这个文件不是一个QtiPlot自定义菜单1.0版本的文件。 - - - - QtiPlot - Math Error - - - - - QtiPlot - Script Error - - - - - Python-like syntax is not supported in this case since it severely reduces drawing speed! - - - - - QtiPlot - - - - - Ignored data point at x = %1. - - - - - Found non-removable singularity at x = %1. - - - - - abs(x): - Absolute value of x. - - - - - acos(x): - Inverse cos function. - - - - - acosh(x): - Hyperbolic inverse cos function. - - - - - asin(x): - Inverse sin function. - - - - - asinh(x): - Hyperbolic inverse sin function. - - - - - atan(x): - Inverse tan function. - - - - - atanh(x): - Hyperbolic inverse tan function. - - - - - avg(x,y,...): - Mean value of all arguments. - - - - - bessel_j0(x): - Regular cylindrical Bessel function of zeroth order, J_0(x). - - - - - bessel_j1(x): - Regular cylindrical Bessel function of first order, J_1(x). - - - - - bessel_jn(double x, int n): - Regular cylindrical Bessel function of order n, J_n(x). - - - - - bessel_jn_zero(double n, unsigned int s): - s-th positive zero x_s of regular cylindrical Bessel function of order n, J_n(x_s)=0 - - - - - bessel_y0(x): - Irregular cylindrical Bessel function of zeroth order, Y_0(x), for x>0. - - - - - bessel_y1(x): - Irregular cylindrical Bessel function of first order, Y_1(x), for x>0. - - - - - bessel_yn(double x, int n): - Irregular cylindrical Bessel function of order n, Y_n(x), for x>0. - - - - - beta(a,b): - Computes the Beta Function, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) for a > 0, b > 0. - - - - - ceil(x): - Round to the next larger integer, - smallest integer larger or equal to x. - - - - - cos(x): - Calculate cosine. - - - - - cosh(x): - Hyperbolic cos function. - - - - - erf(x): - The error function. - - - - - erfc(x): - Complementary error function erfc(x) = 1 - erf(x). - - - - - erfz(x): - The Gaussian probability density function Z(x). - - - - - erfq(x): - The upper tail of the Gaussian probability function Q(x). - - - - - exp(x): - Exponential function: e raised to the power of x. - - - - - floor(x): - Round to the next smaller integer, - largest integer smaller or equal to x. - - - - - gamma(x): - Computes the Gamma function, subject to x not being a negative integer. - - - - - gammaln(x): - Computes the logarithm of the Gamma function, subject to x not a being negative integer. For x<0, log(|Gamma(x)|) is returned. - - - - - gauss_cdf(x, sigma): - Computes the cumulative distribution function for a Gaussian distribution with standard deviation sigma. - - - - - gauss_pdf(x, sigma): - Computes the probability density at x for a Gaussian distribution with standard deviation sigma. - - - - - hazard(x): - Computes the hazard function for the normal distribution h(x) = erfz(x)/erfq(x). - - - - - if(e1, e2, e3): - if e1 then e2 else e3. - - - - - inv_gauss_cdf(x, sigma): - Computes the inverse of the cumulative distribution function for a Gaussian distribution with standard deviation sigma. - - - - - ln(x): - Calculate natural logarithm log_e. - - - - - log(x): - Calculate decimal logarithm log_10. - - - - - log10(x): - Calculate decimal logarithm log_10. - - - - - log2(x): - Calculate binary logarithm log_2. - - - - - min(x,y,...): - Calculate minimum of all arguments. - - - - - max(x,y,...): - Calculate maximum of all arguments. - - - - - mod(x,y): - Calculate rest of integer division x/y, - x modulo y. - - - - - pow(x,y): - Raise x to the power of y, x^y. - - - - - rint(x): - Round to nearest integer. - - - - - sign(x): - Sign function: -1 if x<0; 1 if x>0. - - - - - sin(x): - Calculate sine. - - - - - sinh(x): - Hyperbolic sin function. - - - - - sqrt(x): - Square root function. - - - - - sum(x,y,...): - Calculate sum of all arguments. - - - - - tan(x): - Calculate tangent function. - - - - - tanh(x): - Hyperbolic tan function. - - - - - ttable(x, n): - Student's t-distribution with n degrees of freedom. - - - - - w0(x): - Compute the principal branch of Lambert's W function, W_0(x). - W is defined as a solution to the equation W(x)*exp(W(x))=x. - For x<0, there are two real-valued branches; this function computes the one where W>-1 for x<0 (also see wm1(x)). - - - - - wm1(x): - Compute the secondary branch of Lambert's W function, W_{-1}(x). - W is defined as a solution to the equation W(x)*exp(W(x))=x. - For x<0, there are two real-valued branches; this function computes the one where W<-1 for x<0. (also see w0(x)). - - - - - QtColorPicker - - - - - Black - - - - - - White - - - - - - Red - - - - - - Dark red - - - - - - Green - - - - - - Dark green - - - - - - Blue - - - - - - Dark blue - - - - - - Cyan - - - - - - Dark cyan - - - - - - Magenta - - - - - - Dark magenta - - - - - - Yellow - - - - - - Dark yellow - - - - - - Gray - - - - - - Dark gray - - - - - - Light gray - - - - - Custom - - - - - RangeSelectorTool - - - - - - - - QtiPlot - Warning - QtiPlot - 警告 - - - - All the curves on this plot are empty! - 此次绘制的所有曲线都为空! - - - - Click or use Ctrl+arrow key to select range (arrows select active cursor)! - 点击或用Ctrl+方向键来选择范围(箭头选择活动光标)! - - - - - - Right - - - - - - - Left - - - - - - - - - The column '%1' is read-only! Operation aborted! - 列'%1'是只读!操作中止! - - - - Remove data from curves? - - - - - Copy data to clipboard? - - - - - RenameWindowDialog - - - QtiPlot - Rename Window - QtiPlot - 重命名窗口 - - - - Window Title - 窗口标题 - - - - &Name (single word) - 名称(单个词)(&N) - - - - &Label - 标签(&L) - - - - &Both Name and Label - 名称和标签(&B) - - - - &OK - 确定(&O) - - - - &Cancel - 取消(&C) - - - - QtiPlot - Warning - QtiPlot - 警告 - - - - For internal consistency reasons the underscore character is replaced with a minus sign. - 因为内部一致性原因,画线字符被减号替代。 - - - - ScreenPickerTool - - - Click on plot or move cursor to display coordinates! - 在图上点击或者移动鼠标来显示坐标系! - - - - ScriptEdit - - - E&xecute - 执行(&x) - - - - Ctrl+J - Ctrl+J - - - - Execute &All - 全部执行(&A) - - - - Ctrl+Shift+J - Ctrl+Shift+J - - - - &Evaluate Expression - 计算表达式(&E) - - - - Ctrl+Return - Ctrl+Return - - - - &Print - 打印(&P) - - - - &Import... - 导入(&I)... - - - - &Save - 保存(&S) - - - - Sa&ve as... - 另存为(&v)... - - - - &Find... - 查找(&F)... - - - - &Replace... - 替换(&R)... - - - - &Find next - 查找下一条(&F) - - - - &Find previous - 查找上一条(&F) - - - - Rena&me Tab... - - - - - A&dd Tab - - - - - C&lose Tab - - - - - Auto&exec - 自动执行(&e) - - - - &Functions - 函数(&F) - - - - - Text - 文本 - - - - - All Files - 所有文件 - - - - QtiPlot - Import Text From File - QtiPlot - 从文件导入文本 - - - - QtiPlot - Error Opening File - QtiPlot - 打开文件错误 - - - - Could not open file "%1" for reading. - 不能打开文件"%1"来读取。 - - - - Save Text to File - 保存文本至文件 - - - - QtiPlot - File Save Error - QtiPlot - 文件保存失败 - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - 无法写入文件<br><h4> %1 </h4><p>。请检查是否有权限写入该处! - - - - QtiPlot - QtiPlot - - - - QtiPlot has finished searching the document. - QtiPlot完成了文档搜索。 - - - - ScriptWindow - - - - QtiPlot - Script Window - QtiPlot - 脚本窗口 - - - - - &File - 文件(&F) - - - - - &Edit - 编辑(&E) - - - - - - - E&xecute - 执行(&x) - - - - &Window - 窗口(&W) - - - - - &New - 新建(&N) - - - - - Ctrl+N - Ctrl+N - - - - - &Open... - 打开(&O)... - - - - - Ctrl+O - Ctrl+O - - - - - &Save - 保存(&S) - - - - - Ctrl+S - Ctrl+S - - - - - Save &As... - 另存为(&A)... - - - - - &Print - 打印(&P) - - - - - Ctrl+P - Ctrl+P - - - - - &Undo - 撤销(&U) - - - - - Ctrl+Z - Ctrl+Z - - - - - &Redo - 重做(&R) - - - - - Ctrl+Y - Ctrl+Y - - - - - &Cut - 剪切(&C) - - - - - Ctrl+x - Ctrl+x - - - - - &Copy - 复制(&C) - - - - - Ctrl+C - Ctrl+C - - - - - &Paste - 粘贴(&P) - - - - - Ctrl+V - Ctrl+V - - - - - Increase Indent - - - - - - Decrease Indent - - - - - - &Find... - 查找(&F)... - - - - - Ctrl+Alt+F - Ctrl+Alt+F - - - - - Find &Next - - - - - - F3 - - - - - - Find &Previous - - - - - - F4 - - - - - - &Replace... - 替换(&R)... - - - - Show &Line Numbers - 显示行号(&L) - - - - - CTRL+J - CTRL+J - - - - - Execute &All - 全部执行(&A) - - - - - CTRL+SHIFT+J - CTRL+SHIFT+J - - - - - &Evaluate Expression - 计算表达式(&E) - - - - - CTRL+Return - CTRL+Return - - - - Always on &Top - 始终在前端(&T) - - - &Hide - 隐藏(&H) - - - - QtiPlot - File Save Error - QtiPlot - 文件保存错误 - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - 无法写入文件: <br><h4> %1 </h4><p>请保证你在这个位置有写权限! - - - - You need to close and reopen the script window before your changes become effective! Do you want to close it now? - 你需要关闭再重新打开脚本窗口才能使变化生效!你想现在关闭吗? - - - - - QtiPlot - QtiPlot - - - - - Script Output Panel - - - - - - Show Script &Output Panel - - - - - - Ouput on Next &Line - - - - - Show Script Output Panel - - - - - - Print Pre&view... - - - - - Script print preview - - - - - - &Close - 关闭(&C) - - - - - Show &Workspace - - - - - ScriptingEnv - - - %1 Source (*.%2);; - %1 源于 (*.%2);; - - - - ScriptingLangDialog - - - QtiPlot - Select scripting language - QtiPlot - 选择脚本语言 - - - - OK - 确定 - - - - Cancel - 取消 - - - - QtiPlot - Scripting Error - QtiPlot - 脚本错误 - - - - Scripting language "%1" failed to initialize. - "%1"脚本语言初始化错误。 - - - - SetColValuesDialog - - - QtiPlot - Set column values - QtiPlot - 设置列值 - - - - For row (i) - row (i) - - - - to - - - - - Add function - 添加函数 - - - - Add column - 添加列 - - - - Add cell - 添加单元 - - - - &Apply - 应用(&A) - - - - &Close - 关闭(&C) - - - - Use built-in muParser (much faster) - 使用内置muParser(快很多) - - - - Clear &Formulas - - - - - SigmoidalFit - - - Boltzmann - 波尔兹曼 - - - - init value - 初始值 - - - - final value - 终止值 - - - - center - 中心 - - - - time constant - 时间常数 - - - - Boltzmann (Sigmoidal) Fit - 波尔兹曼(S型)拟合 - - - - SmoothCurveDialog - - - QtiPlot - Smoothing Options - QtiPlot - 平滑选项 - - - - Curve - 曲线 - - - - Polynomial Order - 多项式阶 - - - - Points to the Left - 左边的点 - - - - Points to the Right - 右边的点 - - - - - - Color - 颜色 - - - - f - - - - - Iterations - 迭代 - - - - Points - - - - - &Smooth - 平滑(&S) - - - - &Close - 关闭(&C) - - - - SmoothFilter - - - Smoothed - 平滑 - - - - - - - - - - - QtiPlot - QtiPlot - - - - - - - - - - - Error - 错误 - - - Unknown smooth filter. Valid values are: 1 - Savitky-Golay, 2 - FFT, 3 - Moving Window Average. - 未知平滑滤波器。有效值:1 - Savitzky-Golay, 2 - FFT, 3 - 移动窗口平均。 - - - - Unknown smooth filter. Valid values are: 1 - Savitky-Golay, 2 - FFT, 3 - Moving Window Average, 4 - Lowess. - - - - - - - - points - - - - - Savitzky-Golay smoothing - Savitzky-Golay平滑 - - - - FFT smoothing - FFT平滑 - - - - average smoothing - 平均平滑 - - - - Lowess smoothing - - - - - The number of points must be positive! - 点的数目必须为正! - - - - - The polynomial order must be lower than the number of left points plus the number of right points! - 多项式的阶比较低于左边的点数加右边的点数! - - - - Setting polynomial order is only available for Savitzky-Golay smooth filters! Ignored option! - 设置多项式阶仅对Savitzky-Golay平滑有效!忽略选项! - - - - Setting Lowess parameter is only available for Lowess smooth filters! Ignored option! - - - - - The parameter f must be between 0 and 1! - - - - - The number of iterations must be at least 1! - - - - - SortDialog - - - QtiPlot - Sorting Options - QtiPlot - 排序选项 - - - - Sort columns - 列排序 - - - - Separately - 分别地 - - - - Together - 一起地 - - - - Order - 顺序 - - - - Ascending - 升序 - - - - Descending - 降序 - - - - Leading column - 前导列 - - - - &Sort - 排序(&S) - - - - &Close - 关闭(&C) - - - - SurfaceDialog - - - QtiPlot - Define surface plot - QtiPlot - 定义曲面图 - - - - Surface type - 曲面图类型 - - - - Function - 函数 - - - - Parametric - 参数的 - - - - Clear &list - 清除列表(&l) - - - - &OK - 确定(&O) - - - - &Close - 关闭(&C) - - - - f(x,y)= - f(x,y)= - - - - X - axis - X - 轴 - - - -1 - -1 - - - 1 - 1 - - - - - - - - From - - - - - - - - - To - - - - - Y - axis - Y - 轴 - - - - Z - axis - Z - 轴 - - - - - Mesh - 网格 - - - - - Columns - - - - - - Rows - - - - - Equations - 公式 - - - - X(u,v)= - X(u,v)= - - - - Y(u,v)= - Y(u,v)= - - - - Z(u,v)= - Z(u,v)= - - - - u - u - - - - - Periodic - 周期的 - - - - v - v - - - - QtiPlot - X Formula Error - QtiPlot - X方程式错误 - - - - QtiPlot - Y Formula Error - QtiPlot - Y方程式错误 - - - - QtiPlot - Z Formula Error - QtiPlot - Z方程式错误 - - - - QtiPlot - u start limit error - QtiPlot - u起始限制错误 - - - - - QtiPlot - u end limit error - QtiPlot - u结束限制错误 - - - - QtiPlot - v start limit error - QtiPlot - v起始限制错误 - - - QtiPlot - X Start limit error - QtiPlot - X起始限制错误 - - - QtiPlot - X End limit error - QtiPlot - X结束限制错误 - - - QtiPlot - Y Start limit error - QtiPlot - Y起始限制错误 - - - QtiPlot - Y End limit error - QtiPlot - Y结束限制错误 - - - QtiPlot - Z Start limit error - QtiPlot - Z起始限制错误 - - - QtiPlot - Z End limit error - QtiPlot - Z结束限制错误 - - - - QtiPlot - Input error - QtiPlot - 输入错误 - - - - Please enter limits that satisfy: from < end! - 请输入限制满足from < end 的上下限! - - - - QtiPlot - Input function error - QtiPlot - 输入函数错误 - - - - SymbolBox - - - No Symbol - 没有符号 - - - - Ellipse - 椭圆 - - - - Rectangle - 矩形 - - - - Diamond - 菱形 - - - - Triangle - 三角形 - - - - Down Triangle - 下三角 - - - - Up Triangle - 上三角 - - - - Left Triangle - 左三角 - - - - Right Triangle - 右三角 - - - - Cross - 十字 - - - - Diagonal Cross - 对角十字 - - - - Horizontal Line - 水平线 - - - - Vertical Line - 垂直线 - - - - Star 1 - 星1 - - - - Star 2 - 星2 - - - - Hexagon - 六边形 - - - - SymbolDialog - - - &Close - 关闭(&C) - - - - QtiPlot - Choose Symbol - QtiPlot - 选择符号 - - - - Table - - - Multiline expressions take much more time to evaluate! Do you want to continue anyways? - 多行表达式需要很多的时间计算!你希望继续吗? - - - - - - - QtiPlot - QtiPlot - - - - Warning - 警告 - - - - - - - - - - - - - - - - - - QtiPlot - Error - QtiPlot - 错误 - - - - - - Column '%1' is read only! - 列'%1'为只读! - - - - There is already a column called : <b> - 已经存在列: <b> - - - - The table '%1' contains read-only columns! Operation aborted! - 表'%1'包含有只读列!操作中止! - - - - - - - - - - - The folowing columns - 以下列 - - - - - - - - - - - are read only! - 是只读! - - - - Paste operation - - - - - How should QtiPlot interpret first clipboard line? - - - - - &Values - 值(&V) - - - - Column &Names - - - - - &Comments - - - - - Please indicate the name of the leading column! - 请注明前导列的名称! - - - The leading column has the type set to 'Text'! Operation aborted! - 前导列类型必须为'文本'!操作中止! - - - - The leading column is empty! Operation aborted! - 前导列为空!操作中止! - - - - Qtiplot - QtiPlot - - - - Reading file... - 读取文件... - - - - QtiPlot - ASCII Export Error - QtiPlot - ASCII导出错误 - - - - Could not write to file: <br><h4> - 不能写入文件: <br><h4> - - - - Rows will be deleted from the table! - 将从表中删除行! - - - - - Do you really want to continue? - 你想继续吗? - - - - - Yes - - - - - - Cancel - 取消 - - - - Columns will be deleted from the table! - 将从表中删除列! - - - - kB - kB - - - - TableDialog - - - QtiPlot - Column options - QtiPlot - 列选项 - - - - Column Name: - 列名: - - - - Enumerate all to the right - 列举所有至右边 - - - - &OK - 确定(&O) - - - - &Apply - 应用(&A) - - - - &Cancel - 取消(&C) - - - - Plot Designation: - 绘图目的: - - - - None - 不选 - - - - X (abscissae) - X(横坐标) - - - - Y (ordinates) - Y(纵坐标) - - - - Z (height) - Z(高) - - - - X Error - X误差 - - - - Y Error - Y误差 - - - - Label - 标签 - - - - Display - 显示 - - - - Numeric - 数字 - - - - Text - 文本 - - - - Date - 日期 - - - - Time - 时间 - - - - Month - - - - - Day of Week - 周几 - - - - Format: - 格式: - - - - Precision: - 精度: - - - - &Read-only - 只读(&R) - - - - &Hidden - 隐藏(&H) - - - - Apply to all columns to the right - 应用到所有列至右边 - - - - Options - 选项 - - - - Column Width: - 列宽: - - - - Apply to all - 应用到所有 - - - - &Display Comments in Header - 在头里显示注视(&D) - - - - Comment: - 注释: - - - - QtiPlot - Warning - QtiPlot - 警告 - - - - For internal consistency reasons the underscore character is replaced with a minus sign. - 因为内部一致性原因,画线字符被减号替代。 - - - - - QtiPlot - Error - QtiPlot - 错误 - - - - The column names must only contain letters and digits! - 列名只能包含字母和数字! - - - - Default - 默认 - - - - Decimal: 1000 - 十进制: 1000 - - - - Scientific: 1E3 - 科学计数法: 1E3 - - - - dd/MM/yyyy - dd/MM/yyyy - - - - dd/MM/yyyy HH:mm - dd/MM/yyyy HH:mm - - - - dd/MM/yyyy HH:mm:ss - dd/MM/yyyy HH:mm:ss - - - - dd.MM.yyyy - dd.MM.yyyy - - - - dd.MM.yyyy HH:mm - dd.MM.yyyy HH:mm - - - - dd.MM.yyyy HH:mm:ss - dd.MM.yyyy HH:mm:ss - - - - dd MM yyyy - dd MM yyyy - - - - dd MM yyyy HH:mm - dd MM yyyy HH:mm - - - - dd MM yyyy HH:mm:ss - dd MM yyyy HH:mm:ss - - - - yyyy-MM-dd - yyyy-MM-dd - - - - yyyy-MM-dd HH:mm - yyyy-MM-dd HH:mm - - - - yyyy-MM-dd HH:mm:ss - yyyy-MM-dd HH:mm:ss - - - - yyyyMMdd - yyyyMMdd - - - - yyyyMMdd HH:mm - yyyyMMdd HH:mm - - - - yyyyMMdd HH:mm:ss - yyyyMMdd HH:mm:ss - - - - h - h - - - - h ap - h ap - - - - h AP - h AP - - - - h:mm - h:mm - - - - h:mm ap - h:mm ap - - - - hh:mm - hh:mm - - - - h:mm:ss - h:mm:ss - - - - h:mm:ss.zzz - h:mm:ss.zzz - - - - mm:ss - mm:ss - - - - mm:ss.zzz - mm:ss.zzz - - - - hmm - hmm - - - - hmmss - hmmss - - - - hhmmss - hhmmss - - - - Couldn't guess the source data format, please specify it using the 'Format' box! - 无法猜测源数据格式,请在格式框中指定! - - - - For more information about the supported date/time formats please read the Qt documentation for the QDateTime class! - 如果要知道更多关于支持的日期/时间格式请阅读Qt文档的QDateTime类! - - - - TableStatistics - - - RowStats - 行统计 - - - - Row Statistics of %1 - %1行统计 - - - - Row - - - - - Cols - - - - - - Mean - 平均值 - - - - - StandardDev - 标准偏差 - - - - - StandardError - 标准误差 - - - - - Variance - 方差 - - - - - Sum - - - - - - Max - 最大值 - - - - - Min - 最小值 - - - - - Median - 中值 - - - - ColStats - 列统计 - - - - Column Statistics of %1 - %1列统计 - - - - Col - - - - - Rows - - - - - iMax - iMax - - - - iMin - iMin - - - - TextDialog - - - QtiPlot - Text options - QtiPlot - 文本选项 - - - - Text Color - 文字颜色 - - - - Font - 字体 - - - - &Font - 字体(&F) - - - - Alignment - 对齐 - - - - Center - 居中 - - - - Left - 左对齐 - - - - Right - 右对齐 - - - - Distance to axis - 到轴的距离 - - - - &Apply to... - 应用到(&A)... - - - - Object - 对象 - - - - Layer - 图层 - - - - Window - 窗口 - - - - All Windows - 所有窗口 - - - - &Close - 关闭(&C) - - - - - - - QtiPlot - QtiPlot - - - - X Axis Title - X轴标题 - - - - Y Axis Title - Y轴标题 - - - - Top Axis Title - 顶轴标题 - - - - Right Axis Title - 右轴标题 - - - - &Inverted - - - - - TextEditor - - - QtiPlot - QtiPlot - - - - Confirmation - 确认 - - - - Are you sure you want to add %1 text lines into this text box? - 你确定要添加%1文本到这个文本框? - - - - TextFormatButtons - - - B - Button bold - 粗体 - - - - It - Button italics - 斜体 - - - - U - Button underline - 下划线 - - - - ThreeExpFit - - - ExpDecay3 - 指数衰减3 - - - - Exponential decay - 指数衰减 - - - - first amplitude - 第一振幅 - - - - first lifetime - 第一生命期 - - - - second amplitude - 第二振幅 - - - - second lifetime - 第二生命期 - - - - third amplitude - 第三振幅 - - - - third lifetime - 第三生命期 - - - - offset - 偏移 - - - - TranslateCurveTool - - - Double-click on plot to select a data point! - 在图上双击选取一个数据点! - - - - - - - QtiPlot - Warning - QtiPlot - 警告 - - - - - The column '%1' is read-only! Operation aborted! - 列'%1'是只读!操作中止! - - - - Curve selected! Move cursor and click to choose a point and double-click/press 'Enter' to finish! - 曲线已选择!移动光标并点击来选择一个点、双击/回车结束选择! - - - - This operation cannot be performed on function curves. - 这个操作不能在函数曲线上执行。 - - - - This operation cannot be performed on curves plotted from columns having a non-numerical format. - 这个操作不能在包含有非数字格式的列所画的曲线上执行。 - - - - TwoExpFit - - - ExpDecay2 - 指数衰减2 - - - - Exponential decay - 指数衰减 - - - - first amplitude - 第一振幅 - - - - first lifetime - 第一生命期 - - - - second amplitude - 第二振幅 - - - - second lifetime - 第二生命期 - - - - offset - 偏移 - - - - muParserScript - - - col() works only on tables! - col()只作用于表格! - - - - - There's no column named %1 in table %2! - 表格%2里面没有名为%1的列! - - - - - - There's no row %1 in table %2! - 表格%2里面没有名为%1的行! - - - - - - There's no column %1 in table %2! - 表格%2里面没有%1列! - - - - tablecol() works only on tables! - tablecol()只作用于表格! - - - - tablecol: wrong number of arguments (need 2, got %1) - tablecol: 错误的参数数量(需要 2, 有 %1) - - - - tablecol: first argument must be a string (table name) - tablecol: 第一个参数必须为字符串(表格名称) - - - - Couldn't find a table named %1. - 找不到名为%1的表格。 - - - - - cell() works only on tables and matrices! - cell()只作用于表格和矩阵! - - - - There's no row %1 in matrix %2! - 矩阵%2里面没有%1行! - - - - There's no column %1 in matrix %2! - 矩阵%2里面没有%1列! - - - - - - - Out of memory - 内存溢出 - - - === modified file 'qtiplot/translations/qtiplot_cz.ts' --- qtiplot/translations/qtiplot_cz.ts 2009-11-18 10:33:29 +0000 +++ qtiplot/translations/qtiplot_cz.ts 2010-07-21 23:21:08 +0000 @@ -2,5942 +2,3952 @@ - - - QtiPlot - File openning error - QtiPlot - Chyba při otevírání souboru - - - You don't have the permission to open this file: <b>%1</b> - Nemáte oprávnění pro otevření tohoto souboru: <b>%1</b> - - - QtiPlot - File opening error - QtiPlot - Chyba při otevírání souboru - - - The file: <b>%1</b> doesn't exist! - Soubor: <b>%1</b> neexistuje! - - - The file: <b>%1</b> is not a QtiPlot or Origin project file! - Soubor: <b>%1</b> není souborem projektu QtiPlot nebo Origin! - - - QtiPlot - Demo Version - QtiPlot - Demoverze - - - QtiPlot - File backup error - QtiPlot - Chyba při zálohování souboru - - - Cannot make a backup copy of <b>%1</b> (to %2).<br>If you ignore this, you run the risk of <b>data loss</b>. - Nelze vytvořit záložní kopii z <b>%1</b> (do %2).<br>Pokud si této věci nebudete všímat, riskujete <b>ztrátu dat</b>. - - - QtiPlot - File save error - QtiPlot - Chyba při ukládání souboru - - - The file: <br><b>%1</b> is opened in read-only mode - Soubor: <br><b> %1 </b> je otevřen v režimu pouze pro čtení - - - QtiPlot project - Projekt QtiPlotu - - - Compressed QtiPlot project - Stlačený projekt QtiPlotu - - - Save project as - Uložit projekt jako - - - Save &As Project... - Uložit &jako projekt... - - - &Show All Windows - &Ukázat všechna okna - - - &Hide All Windows - &Skrýt všechna okna - - - &Delete Folder - &Smazat složku - - - &Rename - &Přejmenovat - - - New &Window - Nové &okno - - - New F&older - Nová &složka - - - &None - &Žádná - - - &Windows in Active Folder - &Okna v činné složce - - - Windows in &Active Folder && Subfolders - Okna v &činné složce && podsložkách - - - &View Windows - &Zobrazit okna - - - &Properties... - &Vlastnosti... - - - Hidden - Skryto - - - QtiPlot - Error - QtiPlot - Chyba - - - Please enter a valid name! - Zadejte, prosím, platný název! - - - Name already exists! - Název již existuje! - - - Please choose another name! - Vyberte, prosím, jiný název! - - - Type - Typ - - - Project - Projekt - - - Path - Cesta - - - Size - Velikost - - - bytes - byty - - - Contents - Obsah - - - windows - Okna - - - folders - Složky - - - Created - Vytvořeno - - - Modified - Upraveno - - - Properties - Vlastnosti - - - Folder - Složka - - - New Folder - Nová složka - - - QtiPlot - Delete folder? - QtiPlot - Odstranit složku? - - - Delete folder '%1' and all the windows it contains? - Odstranit složku '%1' a všechna okna, jež obsahuje? - - - Yes - Ano - - - No - Ne - - - Matrix - Matice - - - Table - Tabulka - - - Note - Poznámka - - - Graph - Nákres - - - 3D Graph - Trojrozměrný nákres - - - Label - Popis - - - Status - Stav - - - QtiPlot - No match found - QtiPlot - Nenalezena žádná shoda - - - Sorry, no match found for string: '%1' - Promiňte, ale nebyla nalezena žádná shoda pro řetězec znaků: '%1' - - - Cannot move an object to itself! - Nelze přesunout předmět do sebe sama! - - - Cannot move a parent folder into a child folder! - Nelze přesunout složku do její podsložky! - - - QtiPlot - QtiPlot - - - Skipped moving folder - Přesunutí složky bylo přeskočeno - - - The destination folder already contains a folder called '%1'! Folder skipped! - Cílová složka již obsahuje složku nazvanou '%1'! Složka byla přeskočena! - - - Error - Chyba - - - QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! - QtiPlot se pokusí stáhnout z internetu nezbytnou informaci o posledních dostupných aktualizacích. Upravte, prosím, nastavení své ochrany počítače před viry a nežádoucími průniky do systému, aby se QtiPlot mohl připojit k internetu! - - - Do you wish to continue? - Chcete pokračovat? - - - QtiPlot - HTTP get version file - QtiPlot - HTTP získání souboru s verzí - - - Error while fetching version file with HTTP: %1. - Při získávání souboru s verzí programu přes HTTP došlo k chybě: %1. - - - QtiPlot - Updates Available - QtiPlot - Aktualizace jsou dostupné - - - There is a newer version of QtiPlot (%1) available for download. Would you like to download it? - Existuje novější verze QtiPlotu (%1) ḋostupná ke stažení. Chcete ji stáhnout? - - - QtiPlot - No Updates Available - QtiPlot - Žádné aktualizace nejsou dostupné - - - No updates available. Your current version %1 is the last version available! - Žádné aktualizace nejsou dostupné. Verze %1, kterou nyní používáte, je poslední verzí, jež je dostupná! - - - QtiPlot - Warning - QtiPlot - Varování - - - This will clear the contents of all the data associated with the table. Are you sure? - Tímto se smažou všechna data přiřazená k tabulce. Jste si jist tímto krokem? - - - &Yes - &Ano - - - &No - &Ne - - - QtiPlot - Enter row number - QtiPlot - Zadat číslo řádku - - - Row - Řádek - - - QtiPlot - Enter column number - QtiPlot - Zadat počet sloupců - - - Column - Sloupec - - - QtiPlot was not built with Python scripting support included! - QtiPlot nebyl sestaven se zahrnutou podporou pro skriptování s Pythonem! - - - Please select a Y column to plot! - Vyberte, prosím, sloupec Y pro nakreslení! - - - You need at least two columns for this operation! - Pro tuto operaci je potřeba, abyste vybral alespoň dva sloupce! - - - Please set a default X column for this table, first! - Nejprve, prosím, u této tabulky nastavte jeden sloupec jako výchozí sloupec X! - - - Please select a Z column for this operation! - Vyberte, prosím, pro tuto operaci sloupec Z! - - - You need to define a X column first! - Neprve musíte stanovit sloupec X! - - - You need to define a Y column first! - Neprve musíte stanovit sloupec Y! - - - Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. - Počínaje verzí 0.9.1 QtiPlot ukládá uživatelsky stanovené odpovídající modely do jiného umístění. - - - If you want to save your already defined models, please choose a destination folder. - Pokud chcete uložit své již stanovené modely, vyberte, prosím, cílovou složku. - - - Import fit models - Zavést modely umístění - - - Choose a directory to export the fit models to - Vybrat adresář, do něhož se budou vyvádět modely umístění - - - No Icon - Bez ikony - - - Couldn't load file: %1. -Autocompletion will not be available! - Nelze nahrát soubor: %1. -Automatické dokončení nebude dostupné! - - - QtiPlot - Column selection error - QtiPlot - Chyba při výběru sloupců - - - Please select exactly one column and more than one non empty cell! - Vyberte, prosím, přesně jeden sloupec a více než jednu buňku, která není prázdná! - - - Data set: %1 doesn't exist! - Soubor dat: %1 neexistuje! - - - Stem and leaf plot of dataset - Stonkový a listový nákres souboru dat - - - from row - od řádku - - - to row - po řádek - - - Not enough memory for this dataset! - Pro tento soubor dat není dost paměti! - - - Stem - Stonek - - - Leaf - List - - - Please confirm the stem unit! - Potvrďte, prosím, jednotku pro stonek! - - - Data set - Soubor dat - - - stem unit - Jednotka pro stonek - - - Stem unit - Jednotka pro stonek - - - Leaf unit - Jednotka pro list - - - Key - Klávesa - - - means - znamená - - - Input error: empty data set! - Chyba vstupu: prázdný soubor dat! - - - Memory Allocation Error - Chyba v přidělení paměti - - - Not enough memory, operation aborted! - Není dostatek paměti. Operace zrušena! - - - Set Precision %1 digits - Nastavit přesnost %1 desetinných míst - - - You are using the demonstration version of Qtiplot. - - Používáte ukázkovou verzi Qtiplotu. - - - - AddWidgetTool - + enter your text here + Zde zadejte svůj text + + Click on plot to choose the position of the new object! Klepněte na nákres pro výběr polohy nového předmětu! - - - enter your text here - Zde zadejte svůj text + Move cursor in order to resize the new ellipse! + Přesuňte kurzor za účelem změny velikosti nové elipsy! - Move cursor in order to resize the new rectangle! Přesuňte kurzor za účelem změny velikosti nového obdélníka! - - - Move cursor in order to resize the new ellipse! - Přesuňte kurzor za účelem změny velikosti nové elipsy! - ApplicationWindow - - - QtiPlot - untitled - QtiPlot - Bez názvu - - - - - Project Explorer - Průzkumník projektu - - - - - - Folder - Složka - - - - UNTITLED - BEZ NÁZVU - - - - + &X + &x + + + &Y + &y + + + &Z + &z + + + F1 + F1 + + + F3 + F3 + + + F4 + F4 + + + F5 + F5 + + + F6 + F6 + + + No + Ne + + + or + nebo + + + &No + &Ne + + + Box + Bedna + + + Del + Klávesa Delete + + + Key + Klávesa + + + PCM + PCM + + + R^2 + R^2 + + + Row + Řádek + + + Yes + Ano + + + &Add + &Přidat + + + &All + &Vše + + + &Cut + &Vyjmout + + + &New + &Nový + + + &Pie + &Koláčový nákres + + + &Yes + &Ano + + + &Paste Rectangle + &Vložit obdélník + + + Bars + Pruhy + + + Area + Oblast + + + Bold + Tučné písmo + + + Cu&t + Vyj&mout + + + Data + Data + + + Dots + Tečky + + + Edit + Upravit + + + File + Soubor + + + Help + Nápověda + + + Leaf + List + + + Left + Levý + + Name Název - - - - - - - - - + Note + Poznámka + + + Path + Cesta + + + Plot + Nákres + + + Rows + Řádky + + + Size + Velikost + + + Stem + Stonek + + + Time + Čas + + Type Typ - - View Pohled - - - - - - Size - Velikost - - - - - - - - - Created - Vytvořeno - - - - - - Label - Popis - - - - - Results Log - Zápis výsledků - - - - - Scripting Console - Skriptovací konzole - - - - - Undo Stack - Zpět zásobník - - - + Zoom + Přiblížit + + + file + Soubor + + + name + Název + + + Download &Manual + Stáhnout &příručku + + + Please enter a valid name! + Zadejte, prosím, platný název! + + + Ceiling grid + Stropní mřížka + + + Set Display Range + Nastavit rozsah zobrazení + + + Window &Geometry... + Uspořádání &oken... + + + Import fit models + Zavést modely umístění + + + Print All Plo&ts + Tisk všech ná&kresů + + + QtiPlot - File openning error + QtiPlot - Chyba při otevírání souboru + + + &Import ASCII... + &Zavést ASCII... + + + Move data points + Přesunout datové body + + + Print preview + Tisk náhledu + + + Add Inset Layer + Přidat vloženou vrstvu + + + &Bars + &Pruhy + + + &Area + &Oblast + + + &Copy + &Kopírovat + + + &Data + &Data + + + &Edit + &Úpravy + + + &File + &Soubor + + + &Help + &Nápověda + + + &Hide + &Skrýt + + + &Line + &Čára + + &Next - next window - &Další - - - - F5 - next window shortcut - F5 - - - - &Previous - previous window - &Předchozí - - - - F6 - previous window shortcut - F6 - - - - - File - Soubor - - - - - Edit - Upravit - - - - - Plot - Nákres - - - - Disable &Tools - Zakázat &nástroje - - - - - &Zoom In + &Další + + + &None + &Žádná + + + &Open + &Otevřít + + + &Plot + &Nákres + + + &Redo + &Udělat znovu + + + &Quit + &Ukončit + + + &Rows + &Řádky + + + &Save + &Uložit + + + &Tile + Klást jedno &vedle druhého + + + &Undo + &Vrátit zpět + + + &View + &Pohled + + + &Zoom &Přiblížit - - - Ctrl++ - Ctrl++ - - - - &Zoom Out - &Oddálit - - - - - Ctrl+- - Ctrl+- - - - - - &Data Reader - &Čtečka dat - - - - - CTRL+D - CTRL+D - - - - - &Select Data Range - &Vybrat rozsah dat - - - - + Please select a Y column to plot! + Vyberte, prosím, sloupec Y pro nakreslení! + + + Add/Remove &Curve... + Přidat/Odstranit &křivku... + + + Ro&w Numbers + Čís&la řádků + + + Please select exactly one column and more than one non empty cell! + Vyberte, prosím, přesně jeden sloupec a více než jednu buňku, která není prázdná! + + + Animation + Kreslený film + + + &Regular XYZ + &Pravidelný XYZ + + + show QtiPlot manual in a standalone window + Ukázat příručku ke QtiPlotu v samostatném okně + + + Stack &Column + &Sloupec zásobníku + + + Save Project &As... + Uložit projekt &jako... + + + ALT+C + ALT+C + + + ALT+I + ALT+I + + + ALT+L + ALT+L + + + ALT+Q + ALT+Q + + ALT+S ALT+S - - - S&creen Reader - Č&tečka obrazovky - - - - - &Draw Data Points - &Nakreslit datové body - - - - - &Move Data Points... - &Přesunout datové body... - - - - - Ctrl+ALT+M - Ctrl+ALT+M - - - - - Remove &Bad Data Points... - Odstranit &špatné datové body... - - - - + ALT+T + ALT+T + + Alt+B Alt+B - - - Add E&quation - Přidat R&ovnici - - - - - ALT+Q - ALT+Q - - - - - Add &Text - Přidat &text - - - - - ALT+T - ALT+T - - - - - Draw &Arrow - Nakreslit &šipku - - - - - CTRL+ALT+A - CTRL+ALT+A - - - - - Draw &Line - Nakreslit &čáru - - - - - CTRL+ALT+L - CTRL+ALT+L - - - - + Alt+C + ALT+C + + + Alt+Q + Alt+Q + + + Alt+R + Alt+R + + + Alt+X + Alt+X + + + Open Excel + + + + Chi^2 + Chi^2 + + + Clear + Vyprázdnit + + + Close + Zavřít + + + Cones + Kužely + + + Curve + Křivka + + + &Indexed Colors + &Rejstříkované barvy + + + Error + Chyba + + + Frame + Rám + + + Graph + Nákres + + + Greek + Řecké symboly + + + Label + Popis + + + Move to Last + Přesunout k poslednímu + + + Notes + Poznámky + + + Peaks + Vrcholy + + + App&end Project... + Při&pojit projekt... + + + Right + Pravý + + + Slope + Sklon + + + Table + Tabulka + + + Usage + Použití + + + Vie&w + &Pohled + + + The file: <b>%1</b> is the current file! + Soubor: <b>%1</b> je nynější soubor! + + + D&epending 3D Graphs + &Závisející trojrozměrné nákresy + + + Add &Ellipse + Přidat &elipsu + + + bytes + byty + + + Add &Error Bars... + Přidat &chybové úsečky... + + + means + znamená + + + There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! + V tomto adresáři nebyl nalezen žádný soubor s názvem <b>index.html</b><br>Zvolte, prosím, jiný adresář! + + + Statistics on &Rows + Statistické údaje k &řádkům + + + sheet + + + + Zoom In/Out and Drag Canvas Horizontally + + + + Empty 3D surface plots cannot be duplicated! + Nelze zdvojit prázdné nákresy trojrozměrných povrchů! + + + &Trajectory + &Dráha + + + Gray Scale Map + Zobrazení povrchu v odstínech šedi + + + &Gray Scale Map + &Zobrazení povrchu v odstínech šedi + + + QtiPlot - Opening file + QtiPlot - Otevírá se soubor + + + Ctrl+Return + Ctrl+Return + + Add &Rectangle Přidat &obdélník - - - CTRL+ALT+R - CTRL+ALT+R - - - - - Add &Ellipse - Přidat &elipsu - - - - - CTRL+ALT+E - CTRL+ALT+E - - - - - - - - - - - Table - Tabulka - - - - - - - - - - - Column - Sloupec - - - - - Data Display - Zobrazení dat - - - - + Linear Regression of %1 + Lineární regrese %1 + + + Mi&nimize Window + &Zmenšit okno + + + <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> If you like it, you're using it in your work and you would like to see it constantly improved, please support its authors by making a donation.</b></font> + <font size=+2, color = darkBlue><b>QtiPlot je otevřený program a jeho vývoj vyžaduje stovky hodin práce.<br><br> Jestliže se vám líbí, používáte jej při své práci a rád byste viděl jeho stálé vylepšování, podpořte, prosím, jeho autory darem.</b></font> + + + &Savitzky-Golay... + &Savitzky-Golay... + + + Moving Window &Average... + Klouzající &okenní průměr... + + + Open ODF Spreads&heet... + + + + Plot as line + symbols + Nakreslit jako čáru + symboly + + + Fit &Wizard... + &Průvodce přízpůsobením křivek... + + + Go to Colum&n... + Jít na slou&pec... + + Matrix Plot Nákres matice - - - - Format - Formát - - - - QtiPlot - Script Window - QtiPlot - Skriptovací okno - - - - - 3D Surface - Nákres trojrozměrného povrchu - - - - + There are no plot layers available in this window! + V tomto okně nejsou dostupné žádné vrstvy nákresu! + + + There are no plot layers available in this window. + V tomto okně nejsou dostupné žádné vrstvy nákresu. + + + Technical &Support + Technická &podpora + + + Vertical &Drop Lines + Svislé &čáry + + + You need to define a Y column first! + Neprve musíte stanovit sloupec Y! + + + You need to define a X column first! + Neprve musíte stanovit sloupec X! + + + Set Image Mode + Nastavit režim obrázku + + + Horizontal + + + + Fill selected columns with random numbers + Naplnit vybrané sloupce náhodnými čísly + + + Set &Dimensions... + Nastavit &rozměry... + + + QtiPlot - Error + QtiPlot - Chyba + + + &Horizontal + &Vodorovně + + + &Autocorrelate + &Automaticky dát do vzájemného vztahu + + + Sho&w All Columns + Uká&zat všechny sloupce + + + Undo Stack + Zpět zásobník + + + start QtiPlot with the default settings + Spustit QtiPlot s výchozími nastaveními + + + Save &As Project... + Uložit &jako projekt... + + + Zoom In + Přiblížit + + + &Zoom In + &Přiblížit + + + 3D &Wire Frame + Trojrozměrná &drátěná mřížka + + + &Export Image ... + &Vyvést obrázek... + + + Polygon only + Pouze mnohoúhelník + + + Polygon Only + Pouze mnohoúhelník + + + Print Pre&view + Tisk &náhledu + + + Plot stack column + Nakreslit sloupec se zásobníkem + + + Fit &Boltzmann (Sigmoidal) + &Boltzmannovo umístění (esovité) + + + Show available undo/redo commands + Ukázat dostupné příkazy Zpět/Znovu + + + E&xport ASCII + &Vyvést jako ASCII + + + &Intensity Table + &Tabulka síly + + + &Plot details... + &Podrobnosti nákresu... + + + Open a new project + Otevřít nový projekt + + + Stem and leaf plot of dataset + Stonkový a listový nákres souboru dat + + + Scripting &language + Skriptovací &jazyk + + + <b>%1</b> is a directory, please specify a file name! + <b>%1</b> Je adresářem. Zadejte, prosím, název souboru! + + + You must have more than one dataset in the active layer! + V činné vrstvě musíte mít více než jeden soubor s daty! + + + Do you wish to continue? + Chcete pokračovat? + + + Re&move Pie Curve + Odstranit &zobrazení koláče + + + Output format: + Výstupní formát: + + + Read/&Write + Číst/&Zapisovat + + + Close &Window + Zavřít &okno + + + Ad&just Column Width + Upravit &šířku sloupce + + + Set Rainbow Palette + Nastavit paletu barev + + + Not enough memory for this dataset! + Pro tento soubor dat není dost paměti! + + + Plot 3D bars + Nakreslit trojrozměrné pruhy + + + Choose a directory to export the fit models to + Vybrat adresář, do něhož se budou exportovat modely umístění + + + Sample Rate + Vzorkovací kmitočet + + + Save project + Uložit projekt + + + Disable &Tools + Zakázat &nástroje + + + Sorry, there are no results to display! + Promiňte, ale nejsou zde žádné výsledky, které by bylo možné zobrazit! + + + Remove &Bad Data Points... + Odstranit &špatné datové body... + + + &Show All Curves + &Ukázat všechny křivky + + + Move to F&irst + Přesunout k prv&nímu + + + Disable &tools + Zakázat &nástroje + + + &Replace... + &Nahradit... + + + Append a project to the current folder + Projekt připojit k nynější složce + + + There is a newer version of QtiPlot (%1) available for download. Would you like to download it? + Existuje novější verze QtiPlotu (%1) ḋostupná ke stažení. Chcete ji stáhnout? + + + &Vectors XYXY + &Vektory XYXY + + + &Differentiate + &Diferencovat + + + Print window + Tisk okna + + &Recent Projects &Naposledy otevřené projekty - - &File - &Soubor - - - - &New - &Nový - - - - &Export Graph - &Vyvést nákres - - - - &Edit - &Úpravy - - - - &View - &Pohled - - - + There are no curves available on this plot! + Nejsou zde žádné křivky, které by byly dostupné pro tento nákres! + + + &Close + &Zavřít + + + New &Graph + Nový &nákres + + + Add &Image + Přidat &obrázek + + + Y &Error + Chy&ba y + + + &Frame + &Rám + + &Graph &Nákres - - - 3D &Plot - Trojrozměrný &nákres - - - - &Matrix - &Matice - - - - - - &Plot - &Nákres - - - - - &Data - &Data - - - - - - &Normalize - &Normalizovat - - - - - &Fill Columns With - &Naplnit sloupce - - - - - + Plot 3D trajectory + Nakreslit trojrozměrnou dráhu + + + &Guess + &Určit + + + Create a new 3D surface plot + Vytvořit nový trojrozměrný nákres povrchu + + + &Label + &Štítek + + + &Layer + &Vrstva + + + &Paste + &Vložit + + + &Print + &Tisk + + &Table &Tabulka - - &Smooth - &Vyhladit - - - - &FFT filter - &FFT filtr - - - - Fit E&xponential Decay - Umístit ex&ponenciální pokles - - - - Fit &Multi-peak - Umístění s &mnohačetnými vrcholy - - - - &Analysis - &Rozbor - - - - F&ormat - F&ormát - - - - &Scripting - &Skriptování - - - - &Windows - &Okna - - - - - - &Help - &Nápověda - - - - Set Columns &As - Nastavit sloupce &jako - - - - - &Read-only - &Pouze pro čtení - - - - - Read/&Write - Číst/&Zapisovat - - - - - - Special Line/Symb&ol - Zvláštní řádek/Symb&ol - - - - - - Statistical &Graphs - Statistické &nákresy - - - - - Pa&nel - Pa&nel - - - - 3&D Plot - &Trojrozměrný nákres - - - - Empty Stack - Prázdný zásobník - - - - - - - - - - QtiPlot - Plot error - QtiPlot - Chyba při kreslení - - - - - - - - You must select exactly one column for plotting! - Pro tento nákres musíte vybrat přesně jeden sloupec, který bude nakreslen! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QtiPlot - Error - QtiPlot - Chyba - - - - Please select a column to plot! - Vyberte, prosím, sloupec, který bude nakreslen! - - - - - Please select four columns for this operation! - Vyberte, prosím, čtyři sloupce pro tuto operaci! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QtiPlot - Warning - QtiPlot - Varování - - - - - <h4>There are no tables available in this project.</h4><p><h4>Please create a table and try again!</h4> - <h4>V tomto projektu nejsou dostupné žádné tabulky.</h4><p><h4>Vytvořte, prosím, tabulku a zkuste to znovu!</h4> - - - - There are no available columns with plot designation set to Z! - Nejsou zde dostupné žádné sloupce s přiřazením nákresu nastaveným na Z! - - - - - - QtiPlot - Choose data set - QtiPlot - Vyberte soubor s daty - - - - - - - - - - - Matrix - Matice - - - - - QtiPlot - Choose matrix to plot - QtiPlot - Vyberte matici, která bude nakreslena - - - - <h4>There are no matrices available in this project.</h4><p><h4>Please create a matrix and try again!</h4> - <h4>V tomto projektu nejsou dostupné žádné matice.</h4><p><h4>Vytvořte, prosím, matici a zkuste to znovu!</h4> - - - - - - - - - - - - - - - - - Graph - Nákres - - - - - - - - - - QtiPlot - Export error - QtiPlot - Chyba při vyvedení - - - - - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - Nelze zapisovat do souboru: <br><h4> %1 </h4><p>Ověřte, prosím, že máte oprávnění pro zápis do tohoto umístění! - - - - Images - Obrázky - - - - QtiPlot - Import image from file - QtiPlot - Zavést obrázek ze souboru - - - - QtiPlot - Load image from file - QtiPlot - Nahrát obrázek ze souboru - - - - - - Please select a Y column to plot! - Vyberte, prosím, sloupec Y pro nakreslení! - - - - - QtiPlot - Renamed Window - QtiPlot - přejmenované okno - - - - - The table '%1' already exists. It has been renamed '%2'. - Tabulka '%1' již existuje. Byla přejmenována na '%2'. - - - - - - Notes - Poznámky - - - - Set Image Mode - Nastavit režim obrázku - - - - Set Data Mode - Nastavit režim dat - - - - Show X/Y - Ukázat X/Y - - - - Show Column/Row - Ukázat Sloupec/Řádek - - - - Set Default Palette - Nastavit výchozí paletu - - - - Set Gray Scale Palette - Nastavit paletu odstínů šedi - - - - Set Rainbow Palette - Nastavit paletu barev - - - - Determinant of - Determinant - - - - - - - - - - - - - - - - - - - - <h4>There are no plot layers available in this window.</h4><p><h4>Please add a layer and try again!</h4> - <h4>V tomto okně nejsou dostupné žádné vrstvy nákresu.</h4><p><h4>Přidejte, prosím, vrstvu, a zkuste to znovu!</h4> - - - - - There are no curves available on this plot! - Nejsou zde žádné křivky, které by byly dostupné pro tento nákres! - - - - - - - - - - - - - This functionality is not available for pie plots! - Tento rozsah funkcí není pro koláčové nákresy dostupný! - - - - QtiPlot - Error bars error - QtiPlot - Chyba pruhu s chybami - - - - - This feature is not available for user defined function curves! - Tato funkce není pro uživatelem stanovené křivky funkcí dostupná! - - - - The selected columns have different numbers of rows! - Vybrané sloupce mají různé počty řádků! - - - - The selected error column is empty! - Vybraný chybový sloupec je prázdný! - - - - - - - - - - QtiPlot - File openning error - QtiPlot - Chyba při otevírání souboru - - - - The file: <b>%1</b> is the current file! - Soubor: <b>%1</b> je nynější soubor! - - - - - - - The file: <b>%1</b> doesn't exist! - Soubor: <b>%1</b> neexistuje! - - - - + New &Table + Nová &tabulka + + + &Vertical Steps + &Svislé stupně + + + Choose &Matrix... + Vybrat &matici... + + + Show Line &Numbers + Ukázat čísla &řádků + + + New &Project + Nový &projekt + + + &Rescale to Show All + &Změnit měřítko na Ukázat vše + + + Flip Horizontally + Obrátit vodorovně + + + Draw &Arrow + Nakreslit &šipku + + + Move &Right + Přesunout &doprava + + + Skipped moving folder + Přesunutí složky bylo přeskočeno + + + Recalculate + Znovu spočítat + + + You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://soft.proindependent.com/download.html">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. + Používáte předváděcí verzi Qtiplotu. Je totožná s plnou verzí, mimo to, že vaši práci nelze uložit do souboru s projektem a nemůžete ji používat déle než 10 minut na jedno sezení. <br><br> Pokud chcete mít verzi připravenou k používání, plně pracující binární soubory, podepište se, prosím, na <a href="http://soft.proindependent.com/individual_contract.html">smlouva na starání se o binární soubory pro jednoho-uživatele</a>. <br><br> QtiPlot je svobodný software ve smyslu svobody projevu. Pokud víte, jak jej používat, můžete získat <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">zdrojový kód</a> zdarma. Přesto však jste vítán, <a href="http://soft.proindependent.com/why_donate.html">hodláte-li poskytnout dar, </a> kterým podpoříte budoucí vývoj QtiPlotu. + + + Open project + Otevřít projekt + + You don't have the permission to open this file: <b>%1</b> Nemáte oprávnění pro otevření tohoto souboru: <b>%1</b> - - - - - - - - - QtiPlot - File opening error - QtiPlot - Chyba při otevírání souboru - - - + Couldn't load file: %1. +Autocompletion will not be available! + Nelze nahrát soubor: %1. +Automatické dokončení nebude dostupné! + + + Extract to Graphs + Vytáhnout do obrazců + + + QtiPlot - Help Profile Not Found! + QtiPlot - Profil nápovědy nenalezen! + + + Show replace dialog + Ukázat dialog pro nahrazování + + + QtiPlot - Enter row number + QtiPlot - Zadat číslo řádku + + + Automatic Layout + Automatické rozvržení + + + Not enough memory, operation aborted! + + + + More windows... + Další okna... + + + More Windows... + Další okna... + + + Scripting language "%1" failed to initialize. + Skriptovací jazyk "%1" se nepodařilo inicializovat. + + + &Fill Columns With + &Naplnit sloupce + + + &QtiPlot Homepage + &Domovská stránky QtiPlotu + + + &Restart scripting + &Vynulovat skriptování + + + Make a &Donation + Poskytněte &dar + + + Show &Column/Row + Ukázat &Sloupec/Řádek + + The file <b>%1</b> is corrupted, but there exists a backup copy.<br>Do you want to open the backup instead? Soubor <b>%1</b> je porušen, ale existuje kopie se zálohou dat.<br>Chcete místo něj otevřít zálohu? - - - The file: <b> %1 </b> was not created using QtiPlot! - Soubor: <b> %1</b> nebyl vytvořen QtiPlotem! - - - - QtiPlot - File Open Error - QtiPlot - Chyba při otevírání souboru - - - - The file: <b> %1 </b> <p>does not exist anymore!<p>It will be removed from the list. - Soubor: <b> %1</b> <p>už neexistuje!<p>Bude odstraněn ze seznamu. - - - - The file: <p><b> %1 </b><p> is the current file! - Soubor: <p><b> %1 </b><p> je nynější soubor! - - - - - - - - - - - - - - - - - - - - - QtiPlot - QtiPlot - - - - The file "%1" was created using "%2" as scripting language. - -Initializing support for this language FAILED; I'm using "%3" instead. -Various parts of this file may not be displayed as expected. - Soubor "%1" byl vytvořen "%2" jako skriptovací jazyk. - -Inicializace podpory pro tento jazyk SELHALA; Místo toho se používá "%3". -Různé části tohoto souboru se nemusí zobrazovat tak, jak se očekává. - - - - Window - Okno - - - - QtiPlot - Opening file - QtiPlot - Otevírá se soubor - - - + Sorry, no match found for string: '%1' + Promiňte, ale nebyla nalezena žádná shoda pro řetězec znaků: '%1' + + + execute the script file given as argument + Vykonat soubor se skriptem zadaným jako nezávislou proměnnou + + + Fit Lorent&zian + &Lorentzovo umístění + + + Set Default Palette + Nastavit výchozí paletu + + + &View Pixel Line Profile + &Zobrazit profil čár + + + &View Pixel Line profile + &Ukázat profil čár + + + &First Order ... + &První řád... + + + &Plot ... + &Nákres... + + + Plot pie + Nakreslit koláčový nákres + + + QtiPlot was built without libxls support! + + + + &Frequency Count ... + &Počítání kmitočtu... + + + UNTITLED + BEZ NÁZVU + + + &Lorentzian... + &Lorentzův... + + + No updates available. Your current version %1 is the last version available! + Žádné aktualizace nejsou dostupné. Verze %1, kterou nyní používáte, je poslední verzí, jež je dostupná! + + + Disregard Columns + Sloupce nebrat v úvahu + + + Clea&r Row + Vyprá&zdnit řádek + + + Export current graph + Vyvést nynější nákres + + Script Error Chyba skriptu - - QtiPlot - Scripting Error - QtiPlot - Chyba skriptu - - - - Scripting language "%1" failed to initialize. - Skriptovací jazyk "%1" se nepodařilo inicializovat. - - - - QtiPlot - Open Template File - QtiPlot - Otevřít soubor šablony - - - - The file: <b>%1</b> is not a QtiPlot template file! - Soubor: <b> %1</b> není souborem šablony programu QtiPlot! - - - - Table1 - Tabulka 1 - - - - QtiPlot - Export Error - QtiPlot - Chyba při vyvedení - - - - <h4>There are no plot layers available in this window!</h4> - <h4>V tomto okně nejsou dostupné žádné vrstvy nákresu!</h4> - - - - Choose a directory to export the graphs to - Vybrat adresář, do něhož se budou vyvádět nákresy - - - - Output format: - Výstupní formát: - - - - Directory: - Adresář: - - - - There are no plot layers available in window <b>%1</b>.<br>Graph window not exported! - V tomto okně nejsou dostupné žádné vrstvy nákresu, <b>%1</b>.<br>Okno s nákresem nebylo vyvedeno! - - - - - A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? - Soubor nazvaný: <p><b>%1</b><p>již existuje. Chcete jej přepsat? - - - - - QtiPlot - Overwrite file? - QtiPlot - Přepsat soubor? - - - - Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! + QtiPlot - Enter columns number + QtiPlot - Chyba v počtu sloupců + + + Please use the project explorer to select a window! + Pro výběr okna použijte, prosím, projektového průzkumníka! + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Nelze zapisovat do souboru: <br><h4> %1 </h4><p>Ověřte, prosím, že máte oprávnění pro zápis do tohoto umístění! - - Minimized - Zmenšen - - - - - Maximized - Zvětšen - - - - - QtiPlot project - Projekt QtiPlotu - - - - - Compressed QtiPlot project - Stlačený projekt QtiPlotu - - - - Save Project As - Projekt uložit jako - - - - QtiPlot Matrix Template - Předloha matice pro QtiPlot - - - - QtiPlot 2D Graph Template - Předloha QtiPlotu pro dvojrozměrné nákresy - - - - QtiPlot Table Template - Předloha tabulky pro QtiPlot - - - - QtiPlot 3D Surface Template - Předloha QtiPlotu pro trojrozměrné povrchy - - - - Save Window As Template - Uložit okno jako šablonu - - - - - Please enter a valid name! - Zadejte, prosím, platný název! - - - - The name you chose is not valid: only letters and digits are allowed! - Název, který jste vybral, není platný: jsou povoleny pouze číslice a písmena! - - - - - - Please choose another name! - Vyberte, prosím, jiný název! - - - - Name <b>%1</b> already exists! - Název: <b>%1</b> již existuje! - - - - Warning: for internal consistency reasons the underscore character is replaced with a minus sign. - Varování: Kvůli zajištění vnitřní ucelenosti byl znak podtržení nahrazen znaménkem mínus. - - - Choose a directory to export the tables to - Vybrat, prosím, adresář, do něhož se budou vyvádět tabulky - - - - - &Yes - &Ano - - - - - - &All - &Vše - - - - - - &Cancel - &Zrušit - - - - Choose a filename to save under - Vybrat název souboru, pod nímž se bude ukládat - - - + Search for &Updates + Hledat &aktualizace + + + Fit Exponential Gro&wth ... + Umístit exponenciální &růst... + + + Results Log + Zápis výsledků + + + Set Data Mode + Nastavit režim dat + + + Please select a column to plot! + Vyberte, prosím, sloupec, který bude nakreslen! + + + &Swap columns + &Vyměnit sloupce + + QtiPlot - Enter rows number QtiPlot - Zadat počet řádků - - Rows - Řádky - - - - - QtiPlot - Delete rows - QtiPlot - Odstranit řádky - - - - Start row - Začátek řádku - - - - End row - Konec řádku - - - - QtiPlot - Enter columns number - QtiPlot - Chyba v počtu sloupců - - - - Columns - Sloupce - - - - - - - - - - - - - - - QtiPlot - Column selection error - QtiPlot - Chyba při výběru sloupců - - - - - - - - Please select a column first! - Vyberte, prosím, nejprve sloupec! - - - - Please select two columns for this operation! - Vyberte, prosím, dva sloupce pro tuto operaci! - - - - Please select exactly one columns for this operation! - Vyberte, prosím, přesně jeden sloupec pro tuto operaci! - - - - - Please select two columns for this operation: - the first represents the signal and the second the response function! - Vyberte, prosím, dva sloupce pro tuto operaci: -První představuje funkci signálu a druhý funkci odpovědi! - - - - QtiPlot - Row selection error - QtiPlot - Chyba při výběru řádků - - - - Please select a row first! - Vyberte, prosím, nejprve řádek! - - - - - &Line - &Čára - - - - - - - &Scatter - &Body - - - - - Line + S&ymbol - Čára + &Značky - - - - - Vertical &Drop Lines - Svislé &čáry - - - - - &Spline - &Spline - - - - - &Vertical Steps - &Svislé stupně - - - - - &Horizontal Steps - &Vodorovné kroky - - - - - - - &Columns - &Sloupce - - - - - &Rows - &Řádky - - - - - &Area - &Oblast - - - - - &Pie - &Koláčový nákres - - - 3D Ribbo&n - Trojrozměrný pr&uh - - - 3D &Bars - Trojrozměrné &tyče - - - 3&D Scatter - Troj&rozměrná změť - - - 3D &Trajectory - Trojrozměr&ná dráha - - - - - &Histogram - &Histogram - - - &Stacked Histograms - &Naskládané histogramy - - - - - - - - - Cu&t - Vyj&mout - - - - - - - - - - - &Copy - &Kopírovat - - - - - Past&e - Vlo&žit - - - - - - &X - &x - - - - - - &Y - &y - - - - - - &Z - &z - - - - - - &Label - &Štítek - - - - - &None - &Žádná - - - - - - X E&rror - Chy&ba x - - - - - - Y &Error - Chy&ba y - - - - - Set As - Nastavit jako - - - - &Fill Column With - &Vyplnit sloupec - - - - &Column - &Sloupec - - - - - - - Clea&r - Vypráz&dnit - - - - - - - - &Delete - &Smazat - - - - - &Insert - &Vložit - - - - &Ascending - &Vzestupný - - - - &Descending - &Sestupný - - - - Sort Colu&mn - Seřadit slou&pec - - - Vectors &XYXY - Vektory &XYXY - - - - - &Vertical 2 Layers - &Dvě svislé vrstvy - - - - - &Horizontal 2 Layers - Dvě vodo&rovné vrstvy - - - - - &4 Layers - &Čtyři vrstvy - - - - - &Stacked Layers - &Vrstvené vrstvy - - - + Create an empty 2D plot + Vytvořit prázdný dvojrozměrný nákres + + + Valid options are + Platnými volbami jsou + + + start QtiPlot in language + Spustit QtiPlot v jazyce + + + The assistant could not start because the file <b>%1</b> was not found in the help file directory! + Pomocník nemohl být spuštěn, protože soubor <b>%1</b> nebyl nalezen v adresáři se soubory nápovědy! + + + &Low Pass... + &Nízké posunutí... + + You need to select at least one Y column for this operation! Pro tuto operaci je potřeba, abyste vybral alespoň jeden sloupec Y! - - - - You need at least two columns for this operation! - Pro tuto operaci je potřeba, abyste vybral alespoň dva sloupce! - - - - Y2 Axis Title - Název osy Y2 - - - - Not available for empty 3D surface plots! - Není dostupné pro nákresy trojrozměrných povrchů bez dat! - - - - Set Display Range - Nastavit rozsah zobrazení - - - - - - - <h4>There are no plot layers available in this window.</h4> - <h4>V tomto okně nejsou dostupné žádné vrstvy nákresu.</h4> - - - - - This will modify the data in the worksheets! -Are you sure you want to continue? - Tato operace upraví data v pracovních listech! -Jste si jist, že chcete pokračovat? - - - - - Continue - Pokračovat - - - - - - Cancel - Zrušit - - - - Could not write to file: <h4>%1</h4><p>Please verify that you have the right to write to this location or that the file is not being used by another application! - Nelze zapisovat do souboru: <h4>%1</h4><p>Ověřte, prosím, že máte oprávnění pro zápis do tohoto umístění, nebo že soubor nepoužívá další aplikace! - - - - Sorry, there are no results to display! - Promiňte, ale nejsou zde žádné výsledky, které by bylo možné zobrazit! - - - - There are no plot layers available in this window! - V tomto okně nejsou dostupné žádné vrstvy nákresu! - - - - - - There are no layers available on this plot. Operation aborted! - U tohoto nákresu nejsou dostupné žádné vrstvy. Operace byla zrušena! - - - - QtiPlot - Insert image from file - QtiPlot - Vložit obrázek ze souboru - - - - There are no plot layers available in this window. - V tomto okně nejsou dostupné žádné vrstvy nákresu. - - - + execute the script file given as argument without displying the user interface. Warning: 2D plots are not correctly handled in this functioning mode! + Vykonat soubor se skriptem jako nezávislou proměnnou bez zobrazení uživatelského rozhraní. Varování: Dvojrozměrné nákresy nejsou při tomto pracovním režimu zvládány správně! + + + QtiPlot - Choose data set + QtiPlot - Vyberte soubor s daty + + + &Delete Rows Interval... + &Smazat řádky od do... + + + Move current row upward + Přesunout nynější řádek nahoru + + QtiPlot - Duplicate window error QtiPlot - Chyba při zdvojení okna - There are no windows available in this project! - V tomto projektu nejsou dostupná žádná okna! - - - - QtiPlot - Duplicate error - QtiPlot - Chyba při zdvojení - - - - Empty 3D surface plots cannot be duplicated! - Nelze zdvojit prázdné nákresy trojrozměrných povrchů! - - - - - Released - Uvolněno - - - - About QtiPlot - O programu QtiPlot - - - - &Translate - &Přeložit - - - - Vie&w - &Pohled - - - - &Palette - &Paleta - - - - &Convert to Spreadsheet - &Převést na tabulku - - - - &Folders - &Složky - - - - &Cascade - &Překrývat - - - - &Tile - Jeden &vedle druhého (kachlička) - - - - - - Close &Window - Zavřít &okno - - - - - More windows... - Další okna... - - - - &View Pixel Line profile - &Ukázat profil čár - - - - &Intensity Matrix - &Matice síly - - - - &Cut - &Vyjmout - - - - - - - &Properties... - &Vlastnosti... - - - - Please use the project explorer to select a window! - Pro výběr okna použijte, prosím, projektového průzkumníka! - - - - Normal - Obvyklá - - - - Save changes to project: <p><b> %1 </b> ? - Uložit změny do projektu: <p><b> %1 </b>? - - - - - Yes - Ano - - - - - No - Ne - - - - - &Show All Windows - &Ukázat všechna okna - - - - - &Hide All Windows - &Skrýt všechna okna - - - - - - &Delete Selection - &Smazat výběr - - - - - New &Window - Nové &okno - - - - - New F&older - Nová &složka - - - - Auto &Column Width - Automatická &šířka sloupce - - - - &Delete Window - &Smazat okno - - - - - - &Rename Window - &Přejmenovat okno - - - - &Print Window - &Tisk okna - - - - D&epending Graphs - &Závisející nákresy - - - - D&epending 3D Graphs - &Závisející trojrozměrné nákresy - - - - - - D&epends on - Zá&visí na - - - - Function - Funkce - - - - Re&move Pie Curve - Odstranit &zobrazení koláče - - - + C&lear + &Vyprázdnit + + + Find Next + Najít další + + + Stem-and-Leaf Plot + Stonkový a listový nákres + + + Add Error Bars... + Přidat chybové úsečky... + + + X E&rror + Chy&ba x + + Anal&yze Provést &rozbor - - - &Paste Layer - &Vložit zkopírovanou vrstvu - - - - &Paste Text - &Vložit zkopírovaný text - - - - &Paste Tex Formula - &Vložit vzorec TeX - - - - &Paste Image - &Vložit zkopírovaný obrázek - - - - &Paste Rectangle - &Vložit obdélník - - - - &Paste Ellipse - &Vložit elipsu - - - - &Paste Line/Arrow - &Vložit zkopírovanou čáru/šipku - - - - - - &Layer - &Vrstva - - - - - - &Window - &Okno - - - - E&xport - &Vyvést - - - - - - &Print - &Tisk - - - - P&roperties... - Vla&stnosti... - - - &Delete Layer - &Smazat vrstvu - - - - &Copy Page - &Kopírovat stranu - - - - E&xport Page - &Vyvést stranu - - - - &Matrix... - &Matice... - - - - Choose &Data Set... - Vybrat &datový soubor... - - - - Choose &Matrix... - Vybrat &matici... - - - - C&lear - &Vyprázdnit - - - - &Copy Graph - &Kopírovat nákres - - - - &Export - &Vyvést - - - - - - - &Paste - &Vložit - - - - - &Insert Row - &Vložit řádek - - - + &Analysis + &Rozbor + + + QtiPlot - Open Template File + QtiPlot - Otevřít soubor šablony + + + CTRL+D + CTRL+D + + + QtiPlot Matrix Template + Předloha matice pro QtiPlot + + + &Move Data Points... + &Přesunout datové body... + + + Cancel + Zrušit + + + Add Column + Přidat sloupec + + + Clea&r + Vypráz&dnit + + + Project &Explorer + &Průzkumník projektu + + + Column + Sloupec + + + &Show All Windows + &Ukázat všechna okna + + + Ctrl++ + Ctrl++ + + + Ctrl+- + Ctrl+- + + + Ctrl+B + Ctrl+B + + + Ctrl+C + Ctrl+C + + + Ctrl+D + Ctrl+D + + + Ctrl+E + Ctrl+E + + + Ctrl+F + Ctrl+F + + + Ctrl+G + Ctrl+G + + + Ctrl+H + Ctrl+H + + + Ctrl+I + Ctrl+I + + + Ctrl+J + Ctrl+J + + + Ctrl+K + Ctrl+K + + + Ctrl+L + Ctrl+L + + + Ctrl+M + Ctrl+M + + + Ctrl+N + Ctrl+N + + + Ctrl+O + Ctrl+O + + + Ctrl+P + Ctrl+P + + + Ctrl+Q + Ctrl+Q + + + Ctrl+R + + + + Ctrl+S + Ctrl+S + + + Ctrl+T + Ctrl+T + + + Ctrl+U + Ctrl+U + + + Ctrl+V + Ctrl+V + + + Ctrl+W + Ctrl+W + + + Ctrl+X + Ctrl+X + + + Ctrl+Y + Ctrl+Y + + + Ctrl+Z + Ctrl+Z + + + QtiPlot - Load image from file + QtiPlot - Nahrát obrázek ze souboru + + + Copy selection + Kopírovat výběr + + + &Copy Selection + &Kopírovat výběr + + + Extract to Layers + Vytáhnout do vrstev + + + 3D Wire &Surface + Trojrozměrný &povrch drátěné mřížky + + + QtiPlot &Forums + Fórum &QtiPlotu + + + Export + + + + Set optimal column width + Nastavit nejlepší šířku sloupců + + + New Folder + Nová složka + + + Folder + Složka + + + Format + Formát + + &Insert Column &Vložit sloupec - - - &Delete Rows - &Smazat řádky - - - - &Delete Columns - &Smazat sloupce - - - - &Delete Row - &Smazat řádek - - - - Clea&r Row - Vyprá&zdnit řádek - - - - Clea&r Rows - Vyprá&zdnit řádky - - - - Choose the location of the QtiPlot help folder! - Vyberte umístění složky s nápovědou k programu QtiPlot! - - - - QtiPlot - index.html File Not Found! - QtiPlot - index.html nebyl nalezen! - - - - There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! - V tomto adresáři nebyl nalezen žádný soubor s názvem <b>index.html</b><br>Zvolte, prosím, jiný adresář! - - - - - + QtiPlot - Edit function + QtiPlot - Upravit funkci + + + Plot 3D ribbon + Nakreslit trojrozměrnou stuhu + + + Hidden + Skryt + + + For more details about how to use .ui files in your Python scripts please read the PyQt4 documentation + + + + Plot stack bar + Nakreslit pruh se zásobníkem + + + Images + Obrázky + + + Minimized + Zmenšen + + + Enable perspective + Povolit perspektivní zobrazení + + + Contour &Lines + Obrysové &čáry + + + Italic + Kurzíva + + + Add Ellipse/Circle + Přidat elipsu/kružnici + + + No Axes + Žádné osy + + + No Icon + Bez ikony + + + No axes + Žádné osy + + + Not available for empty 3D surface plots! + Není dostupné pro nákresy trojrozměrných povrchů bez dat! + + + Data set: %1 doesn't exist! + Soubor dat: %1 neexistuje! + + + Move to First + Přesunout k prvnímu + + + Duplicate window + Zdvojit okno + + + Add La&yer + Přidat &vrstvu + + + &4 Layers + &Čtyři vrstvy + + + can be any .qti, qti.gz, .ods, .opj, .ogm, .ogw, .ogg, .py, .xls or ASCII file + + + + Matrix + Matice + + + Make a donation + Poskytněte dar + + + Move to Las&t + Přesunout k pos&lednímu + + QtiPlot - Help Files Not Found! QtiPlot - Soubor s nápovědou nenalezen! - - - The manual can be downloaded from the following internet address: - Příručku lze stáhnout z následující adresy: - - - - - QtiPlot - Help Profile Not Found! - QtiPlot - Profil nápovědy nenalezen! - - - - - The assistant could not start because the file <b>%1</b> was not found in the help file directory! - Pomocník nemohl být spuštěn, protože soubor <b>%1</b> nebyl nalezen v adresáři se soubory nápovědy! - - - - - This file is provided with the QtiPlot manual which can be downloaded from the following internet address: - Tento soubor je poskytován s nápovědou ke QtiPlotu, která se dá stáhnout z následující internetové adresy: - - - - Please indicate the location of the help file! - Ukažte, prosím, umístění souboru s nápovědou! - - - - QtiPlot - Edit function - QtiPlot - Upravit funkci - - - - QtiPlot - Set the number of pixels to average - QtiPlot - Nastavit počet pixelů na průměrnou hodnotu - - - - Number of averaged pixels - Počet zprůměrovaných pixelů - - - - You must have more than one layer in the active window! - V činném okně musíte mít více než jednu vrstvu! - - - - You must have more than one dataset in the active layer! - V činné vrstvě musíte mít více než jeden soubor s daty! - - - - QtiPlot - Guess best origin for the new layer? - QtiPlot - Určit nejlepší počátek souřadnic pro novou vrstvu? - - - + Normal + Obvyklá + + + Front grid + Mřížka popředí + + + Pa&nel + Pa&nel + + + Zoom/Drag Canvas &Horizontally + + + + Past&e + Vlo&žit + + + Cu&t Selection + Vyj&mout výběr + + + QtiPlot - Overwrite file? + QtiPlot - Přepsat soubor? + + Do you want QtiPlot to guess the best position for the new layer? Warning: this will rearrange existing layers! Chcete, aby QtiPlot určil nejlepší polohu pro novou vrstvu? Varování. Tento krok přeuspořádá stávající vrstvy! - - &Guess - &Určit - - - + Extract to &Layers + Vytáhnout do &vrstev + + + QtiPlot - Export error + QtiPlot - Chyba při vyvedení + + + Remove data points + Přesunout datové body + + + Line + S&ymbol + Čára + &Značky + + + Set As + Nastavit jako + + + Table1 + Tabulka 1 + + + Fit Slop&e + Umístit &sklon + + + Status + Stav + + + Modified + Upraveno + + + QtiPlot - Export Error + QtiPlot - Chyba při vyvedení + + + Find Previous + Najít předchozí + + + Fit &Gaussian + &Gaussovo umístění + + + QtiPlot - File backup error + QtiPlot - Chyba při zálohování souboru + + + &Convolute + &Složit + + + Window + Okno + + &Top-left corner &Horní levý roh - - Curve - Křivka - - - - Integration of %1 from zero is - Začlenění %1 od nuly je - - - - - - - - Please select a 'Y' column first! - Vyberte, prosím, nejprve sloupec 'y'! - - - - Integration of %1 - Začlenění %1 - - - - Area - Oblast - - - - - Linear Regression of %1 - Přímočarý pokles %1 - - - - - Slope - Sklon - - - - Intercept - Ohraničený úsek - - - - - Chi^2 - Chi^2 - - - - - R^2 - R^2 - - - - - Add &Custom Script Action... - Přidat &akci vlastního skriptu... - - - - - - New &Project - Nový &projekt - - - - - Ctrl+N - Ctrl+N - - - - - New &Graph - Nový &nákres - - - - - Ctrl+G - Ctrl+G - - - - - New &Note - Novou &poznámku - - - - - New &Table - Nová &tabulka - - - - - Ctrl+T - Ctrl+T - - - - - New &Matrix - Nová &matice - - - - - Ctrl+M - Ctrl+M - - - - - New &Function Plot - Nový &nákres funkce - - - - - Ctrl+F - Ctrl+F - - - - - New 3D &Surface Plot - Nový trojrozměrný &nákres povrchu - - - - - Ctrl+ALT+Z - Ctrl+ALT+Z - - - - - &Open - &Otevřít - - - - - Ctrl+O - Ctrl+O - - - - - Open Image &File - Otevřít soubor s &obrázkem - - - - - Ctrl+I - Ctrl+I - - - - + The file: <br><b>%1</b> is opened in read-only mode + Soubor: <br><b> %1 </b> je otevřen v režimu pouze pro čtení + + Import I&mage... Zavést &obrázek... - - - &Save Project - &Uložit projekt - - - - - Ctrl+S - Ctrl+S - - - - - Save Project &As... - Uložit projekt &jako... - - - - - Ctrl+Shift+S - Ctrl+Shift+S - - - - Open Temp&late... - Otevřít &předlohu... - - - - - Save As &Template... - Uložit jako &předlohu... - - - - Save Note As... - Uložit poznámku jako... - - - - - &Import ASCII... - &Zavést ASCII... - - - - - &Undo - &Vrátit zpět - - - - - Ctrl+Z - Ctrl+Z - - - - - &Redo - &Udělat znovu - - - - - &Duplicate - &Zdvojit - - - - - Cu&t Selection - Vyj&mout výběr - - - - - Ctrl+X - Ctrl+X - - - - - &Copy Selection - &Kopírovat výběr - - - - - Ctrl+C - Ctrl+C - - - - - &Paste Selection - &Vložit výběr - - - - - Ctrl+V - Ctrl+V - - - - - Del - delete key - Klávesa Delete - - - - - Ctrl+E - Ctrl+E - - - - - Add La&yer - Přidat &vrstvu - - - - - ALT+L - ALT+L - - - - - Arran&ge Layers - &Uspořádat vrstvy - - - - - Shift+A - Shift+A - - - - - - Automatic Layout - Automatické rozvržení - - - - - &Current - &Nynější - - - - - - - Ctrl+Alt+G - Ctrl+Alt+G - - - - - Alt+X - Alt+X - - - - - &Export PDF - &Vyvést jako PDF - - - - - Ctrl+Alt+P - Ctrl+Alt+P - - - - - Ctrl+P - Ctrl+P - - - - - Print All Plo&ts - Tisk všech ná&kresů - - - - - E&xport ASCII - &Vyvést jako ASCII - - - - - &Quit - &Ukončit - - - - - Ctrl+Q - Ctrl+Q - - - - - Clear &Log Information - Smazat všechny informace v &zápisu - - - - + Zoom &Out + &Oddálit + + + Sort Ta&ble + Seřadit tabul&ku + + + &Paste Image + &Vložit zkopírovaný obrázek + + + &Paste Layer + &Vložit zkopírovanou vrstvu + + + Re&size Window... + Změnit &velikost okna... + + + QtiPlot was built without ODF spreadsheet support! + + + + The destination folder already contains a folder called '%1'! Folder skipped! + Cílová složka již obsahuje složku nazvanou '%1'! Složka byla přeskočena! + + + Increase Precision + Zvětšit přesnost + + + Set Matrix Values + Nastavit hodnoty matice + + + QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! + QtiPlot se pokusí stáhnout z internetu nezbytnou informaci o posledních dostupných aktualizacích. Upravte, prosím, nastavení své ochrany počítače před viry a nežádoucími průniky do systému, aby se QtiPlot mohl připojit k internetu! + + + Set Columns &As + Nastavit sloupce &jako + + Delete &Fit Tables Smazat &tabulky umístění - - - Plot &Wizard - Průvodce &nákresem - - - - - Ctrl+Alt+W - Ctrl+Alt+W - - - - - &Preferences... - &Nastavení... - - - - - Add/Remove &Curve... - Přidat/Odstranit &křivku... - - - - - ALT+C - ALT+C - - - - - Add &Error Bars... - Přidat &pruhy s chybami... - - - - - Ctrl+B - Ctrl+B - - - - - Add &Function... - Přidat &funkci... - - - - - - - Ctrl+Alt+F - Ctrl+Alt+F - - - - - &Rescale to Show All - &Změnit měřítko na Ukázat vše - - - - - - Ctrl+Shift+R - Ctrl+Shift+R - - - - - New &Legend - Nová &vysvětlivka - - - - - Ctrl+L - Ctrl+L - - - - - Add Time Stamp - Přidat označení času - - - - - Ctrl+ALT+T - Ctrl+ALT+T - - - - - Add &Image - Přidat &obrázek - - - - - ALT+I - ALT+I - - - - - Vectors XY&AM - Vektory XY&AM - - - - &Vectors &XYXY - Vektory &XYXY - - - - - &Stacked Histogram - &Vrstvený histogram - - - - - Stem-and-&Leaf Plot - Stonkový a &listový nákres - - - - + Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. + Počínaje verzí 0.9.1 QtiPlot ukládá uživatelsky stanovené odpovídající modely do jiného umístění. + + + 3D &Plot + Trojrozměrný &nákres + + + Add &Text + Přidat &text + + + Find &Next + Najít &další + + + Compressed QtiPlot project + Stlačený projekt QtiPlotu + + + There are no available columns with plot designation set to Z! + Nejsou zde dostupné žádné sloupce s přiřazením nákresu nastaveným na Z! + + + Floor grid + Povrchová mřížka + + + Fit &Polynomial ... + &Mnohočlenné umístění... + + + &View Windows + &Zobrazit okna + + + 3D Graph + Trojrozměrný obrazec + + + Add Image + Přidat obrázek + + + Add Layer + Přidat vrstvu + + + QtiPlot - untitled + QtiPlot - Bez názvu + + + Contents + Obsah + + + Continue + Pokračovat + + + The selected error column is empty! + Vybraný chybový sloupec je prázdný! + + + Zoom Out + Oddálit + + + &Zoom Out + &Oddálit + + + You need at least two columns for this operation! + Pro tuto operaci je potřeba, abyste vybral alespoň dva sloupce! + + + Plot area + Nakreslit oblast + + + Integr&ate Function... + Začle&nit funkci... + + + Set column as X + Nastavit sloupec jako X + + + Set column as Y + Nastavit sloupec jako Y + + + Set column as Z + Nastavit sloupec jako Z + + + QtiPlot - HTTP get version file + QtiPlot - HTTP získání souboru s verzí + + + options + Volby + + + &Palette + &Paleta + + + &Delete Columns + &Smazat sloupce + + + This will modify the data in the worksheets! +Are you sure you want to continue? + Tato operace upraví data v pracovních listech! +Jste si jist, že chcete pokračovat? + + + Show &X/Y + Ukázat &X/Y + + + C&lose Tab + &Zavřít kartu + + + Error while fetching version file with HTTP: %1. + Při získávání souboru s verzí programu přes HTTP došlo k chybě: %1. + + + QtiPlot - Insert image from file + QtiPlot - Vložit obrázek ze souboru + + + &Box Plot + &Krabicový nákres + + + QtiPlot - Delete folder? + QtiPlot - Odstranit složku? + + + Save window as template + Uložit okno jako předlohu + + + Cannot move an object to itself! + Nelze přesunout předmět do sebe sama! + + D&ouble-Y Zdvo&jit y - - - &Zoom - &Přiblížit - - - - + <b> %1 </b> unknown command line option! + <b> %1 </b> Neznámá volba příkazového řádku! + + + &Export PDF + &Vyvést jako PDF + + + This file is provided with the QtiPlot manual which can be downloaded from the following internet address: + Tento soubor je poskytován s nápovědou ke QtiPlotu, která se dá stáhnout z následující internetové adresy: + + + Move Row + Přesunout řádek + + + Properties + Vlastnosti + + + &Hide Selected + &Skrýt vybrané + + + This will clear the contents of all the data associated with the table. Are you sure? + Tímto se smažou všechna data přiřazená k tabulce. Jste si jist tímto krokem? + + + &Properties + &Vlastnosti + + + &Downward + &Dolů + + + QtiPlot - Column selection error + QtiPlot - Chyba při výběru sloupců + + + &FFT filter + &FFT filtr + + + &Windows in Active Folder + &Okna v činné složce + + + Please choose another name! + Vyberte, prosím, jiný název! + + + Name <b>%1</b> already exists! + Název: <b>%1</b> již existuje! + + + Please set a default X column for this table, first! + Nejprve, prosím, u této tabulky nastavte jeden sloupec jako výchozí sloupec X! + + + <h4>There are no matrices available in this project.</h4><p><h4>Please create a matrix and try again!</h4> + <h4>V tomto projektu nejsou dostupné žádné matice.</h4><p><h4>Vytvořte, prosím, matici a zkuste to znovu!</h4> + + + &Data Reader + &Čtečka dat + + + Please confirm the stem unit! + Potvrďte, prosím, jednotku pro stonek! + + + &Duplicate + &Zdvojit + + + Move &Left + Přesunout &doleva + + + The file: <b>%1</b> is not a QtiPlot or Origin project file! + Soubor: <b>%1</b> není souborem projektu QtiPlot nebo Origin! + + E&xtract to Graphs V&ytáhnout do obrazců - - Extract to &Layers - Vytáhnout do &vrstev - - - - - Add Inset Layer - Přidat vloženou vrstvu - - - - - &Ribbon - &Stuha - - - - - &Bars - &Pruhy - - - - - &Trajectory - &Dráha - - - - + &Data Set... + &Soubor s daty... + + + New matrix + Nová matice + + + Create an empty note window + Vytvořit prázdné okno na poznámky + + + 3D &Polygons + Trojrozměrné &mnohoúhelníky + + + Plot with horizontal bars + Nakreslit s vodorovnými pruhy + + + Please select exactly one columns for this operation! + Vyberte, prosím, přesně jeden sloupec pro tuto operaci! + + + The file: <b> %1 </b> <p>does not exist anymore!<p>It will be removed from the list. + Soubor: <b> %1</b> <p>už neexistuje!<p>Bude odstraněn ze seznamu. + + + Move Right + Přesunout vpravo + + + Pointer + Ukazovátko + + + Open Image &File + Otevřít soubor s &obrázkem + + + &Read Only + &Pouze pro čtení + + + P&roperties... + Vla&stnosti... + + + There are no layers available on this plot. Operation aborted! + U tohoto nákresu nejsou dostupné žádné vrstvy. Operace byla zrušena! + + + &Hide Window + &Skrýt okno + + + &Read-only + &Pouze pro čtení + + + Open Temp&late... + Otevřít &předlohu... + + + Open Te&mplate... + Otevřít před&lohu... + + + &Deconvolute + &Rozložit + + + Leaf unit + Jednotka pro list + + + Project + Projekt + + + to row + po řádek + + + Input error: empty data set! + Chyba vstupu: prázdný soubor dat! + + + &Copy Page + &Kopírovat stranu + + + Decrease Precision + Zmenšit přesnost + + + Data reader + Čtečka dat + + + Print preview of window: + Tisk náhledu okna: + + + Could not write to file: <h4>%1</h4><p>Please verify that you have the right to write to this location or that the file is not being used by another application! + Nelze zapisovat do souboru: <h4>%1</h4><p>Ověřte, prosím, že máte oprávnění pro zápis do tohoto umístění, nebo že soubor nepoužívá další aplikace! + + + Couldn't open file %1 + + + + E&xport + &Vyvést + + + Open Excel File + + + + Contour Lines + Color Fill + Obrysové čáry + Barevná výplň + + + Choose a filename to save under + Vybrat název souboru, pod nímž se bude ukládat + + + Presentation Preview + Náhled provedení + + + The manual can be downloaded from the following internet address: + Příručku lze stáhnout z následující adresy: + + + <h4>There are no plot layers available in this window!</h4> + <h4>V tomto okně nejsou dostupné žádné vrstvy nákresu!</h4> + + + QtiPlot - Enter column number + QtiPlot - Zadat počet sloupců + + + Paste selection + Vložit výběr + + + &Paste Selection + &Vložit výběr + + + Custom user interfaces can be created using the QtDesigner application provided by the Qt framework + + + + Pale&tte + &Paleta + + + &Scales... + &Stupnice... + + Statistics on &Columns Statistické údaje ke &sloupcům - - - Statistics on &Rows - Statistické údaje k &řádkům - - - - - &Integrate - &Začlenit - - - - - Integr&ate Function... - Začle&nit funkci... - - - - - Inte&rpolate ... - &Interpolovat... - - - - - &Low Pass... - &Nízké posunutí... - - - - - &High Pass... - &Vysoké posunutí... - - - - - &Band Pass... - &Pásmové posunutí... - - - - - &Band Block... - &Pásmovou závoru... - - - - - &FFT... - &FFT... - - - - - &Savitzky-Golay... - &Savitzky-Golay... - - - - - &FFT Filter... - &FFT filtr... - - - - - Moving Window &Average... - Klouzající &okenní průměr... - - - - - &Differentiate - &Diferencovat - - - - - Fit &Linear - &Přímočaré umístění - - - - - Fit &Polynomial ... - &Mnohočlenné umístění... - - - - - &First Order ... - &První řád... - - - - - &Second Order ... - &Druhý řád... - - - - - &Third Order ... - &Třetí řád... - - - - - Fit Exponential Gro&wth ... - Umístit exponenciální &růst... - - - - - Fit &Boltzmann (Sigmoidal) - &Boltzmannovo umístění (esovité) - - - - - Fit &Gaussian - &Gaussovo umístění - - - - - Fit Lorent&zian - &Lorentzovo umístění - - - - - Fit &Wizard... - &Průvodce přízpůsobením křivek... - - - - - Ctrl+Y - Ctrl+Y - - - - - &Plot ... - &Nákres... - - - - - &Scales... - &Stupnice... - - - - + Windows in &Active Folder && Subfolders + Okna v &činné složce && podsložkách + + + Please select two columns for this operation: + the first represents the signal and the second the response function! + Vyberte, prosím, dva sloupce pro tuto operaci: +První představuje funkci signálu a druhý funkci odpovědi! + + + &Transpose + &Převést + + + &Translate + &Přeložit + + + Add &Function... + Přidat &funkci... + + + Choose the location of the QtiPlot help folder! + Vyberte umístění složky s nápovědou k programu QtiPlot! + + + QtiPlot - Enter the number of peaks + QtiPlot - Zadat počet vrcholů + + + The file: <p><b> %1 </b><p> is the current file! + Soubor: <p><b> %1 </b><p> je nynější soubor! + + + Cut selection + Vyjmout výběr + + + &Rainbow + &Duha + + + <b> %1 </b>: Wrong locale option or no translation available! + <b> %1 </b>: Nesprávná zkratka pro zemi, nebo není dostupný žádný překlad! + + + Save Window As Template + Uložit okno jako šablonu + + + Find &Previous + Najít &předchozí + + + Start row + Začátek řádku + + + Draw line + Nakreslit čáru + + + New F&older + Nová &složka + + + Data set + Soubor dat + + + QtiPlot + QtiPlot + + + Show Scripting console + Ukázat skriptovací konzoli + + + Mathematical Symbols + Matematické symboly + + + Wireframe + Drátěná mříž + + + &Previous + &Předchozí + + + 2D &Binning + Dvojrozměrné &uložení do bedny + + + Set &Properties... + Nastavit &vlastnosti... + + + F&ormat + F&ormát + + + QtiPlot - index.html File Not Found! + QtiPlot - index.html nebyl nalezen! + + + &Delete Rows + &Smazat řádky + + + D&epending Graphs + &Závisející nákresy + + &Axes... &Osy... - - + Save As &Template... + Uložit jako &předlohu... + + &Grid ... &Mřížka... - - - &Title ... - &Název... - - - - - Column &Options ... - Volby pro &sloupce... - - - - - Ctrl+Alt+O - Ctrl+Alt+O - - - - - Set Column &Values ... - Nastavit hodnoty pro &sloupce... - - - - - - - Alt+Q - Alt+Q - - - - - Recalculate - Znovu spočítat - - - - - - - Ctrl+Return - Ctrl+Return - - - - - &Hide Selected - &Skrýt vybrané - - - - - Sho&w All Columns - Uká&zat všechny sloupce - - - - - &Swap columns - &Vyměnit sloupce - - - - - Move &Right - Přesunout &doprava - - - - - Move &Left - Přesunout &doleva - - - - - Move to F&irst - Přesunout k prv&nímu - - - - - Move to Las&t - Přesunout k pos&lednímu - - - - - &Columns... - &Sloupce... - - - - + QtiPlot - No match found + QtiPlot - Nenalezena žádná shoda + + + There are no windows available in this folder! + V tomto projektu nejsou dostupná žádná okna! + + + Convert to &Matrix + Převést do &matice + + + Dra&g Curve + &Táhnout křivku + + + &Scripting + &Skriptování + + + &FFT Filter... + &FFT filtr... + + + Y2 Axis Title + Název osy Y2 + + + S&creen Reader + Č&tečka obrazovky + + + Open ODF Spreadsheet + + + + New &Note + Novou &poznámku + + + &Worksheet + &Pracovní list + + + Draw &Line + Nakreslit &čáru + + + &Translations + &Překlady + + + &Normalize + &Normalizovat + + + This feature is not available for user defined function curves! + Tato funkce není pro uživatelem stanovené křivky funkcí dostupná! + + + Stem-and-&Leaf Plot + Stonkový a &listový nákres + + + Select data range + Vybrat rozsah dat + + + &Intensity Matrix + &Matice síly + + + Drag Curve + Táhnout křivku + + + <h4>There are no plot layers available in this window.</h4> + <h4>V tomto okně nejsou dostupné žádné vrstvy nákresu.</h4> + + + Profiles + + + + from row + od řádku + + + Show project explorer + Ukázat průzkumníka projektu + + + Move current row downward + Přesunout nynější řádek dolů + + + Draw arrow + Nakreslit šipku + + &Rows... &Řádky... - - - &Delete Rows Interval... - &Smazat řádky od do... - - - - - &About QtiPlot - &O programu QtiPlot - - - - - F1 - F1 - - - - - Ctrl+H - Ctrl+H - - - - - &Choose Help Folder... - &Vybrat složku s nápovědou... - - - - - Ctrl+W - Ctrl+W - - - - - - Add Column - Přidat sloupec - - - - - &Go to Row... - &Jít na řádek... - - - - - Go to Colum&n... - Jít na slou&pec... - - - - - Ctrl+Alt+C - Ctrl+Alt+C - - - - - Clear - Vyprázdnit - - - - - &Remove Layer - &Odstranit vrstvu - - - - - Alt+R - Alt+R - - - - - Window &Geometry... - Uspořádání &oken... - - - - - - - &Hide Window - &Skrýt okno - - - - - - - Ctrl+Alt+H - Ctrl+Alt+H - - - - - &View Pixel Line Profile - &Zobrazit profil čár - - - - - &Intensity Table - &Tabulka síly - - - - - - - &Properties - &Vlastnosti - - - - - &Activate Window - &Aktivovat okno - - - - - Mi&nimize Window - &Zmenšit okno - - - - - Ma&ximize Window - Zvět&šit okno - - - - - Re&size Window... - Změnit &velikost okna... - - - - - &Surface... - &Povrch... - - - - - &Data Set... - &Soubor s daty... - - - - - Set &Properties... - Nastavit &vlastnosti... - - - - - Set &Dimensions... - Nastavit &rozměry... - - - - - Ctrl+D - Ctrl+D - - - - - Set &Values... - Nastavit &hodnoty... - - - - - &Image Plot - &Znázornit nákres - - - - - &Transpose - &Převést - - - - - Flip &V - Obrátit &svisle - - - - Ctrl+Shift+V - Ctrl+Shift+V - - - - - Flip &H - Obrátit &vodorovně - - - - Ctrl+Shift+H - Ctrl+Shift+H - - - - - R&otate 90 - O&točit o 90° - - - - + Special Line/Symb&ol + Zvláštní řádek/Symb&ol + + + Create Open &Document Presentation... + Vytvořit představení v Open &Document... + + + New table + Nová tabulka + + + The name you chose is not valid: only letters and digits are allowed! + Název, který jste vybral, není platný: jsou povoleny pouze číslice a písmena! + + + The file "%1" was created using "%2" as scripting language. + +Initializing support for this language FAILED; I'm using "%3" instead. +Various parts of this file may not be displayed as expected. + Soubor "%1" byl vytvořen "%2" jako skriptovací jazyk. + +Inicializace podpory pro tento jazyk SELHALA; Místo toho se používá "%3". +Různé části tohoto souboru se nemusí zobrazovat tak, jak se očekává. + + + Add curve to graph + Do nákresu přidat křivku + + + &Cascade + &Překrývat + + + Co&rrelate + Dát do &vzájemného vztahu + + + &Vectors &XYXY + Vektory &XYXY + + + &Scatter + &Body + + + Subscript + Dolní index + + + Hide selected columns + Skrýt vybrané sloupce + + + &Descending + &Sestupný + + + Zoom In/Out and Drag Canvas Vertically + + + + &Stacked Histogram + &Vrstvený histogram + + + Superscript + Horní index + + + &Ascending + &Vzestupný + + + Back grid + Mřížka pozadí + + + Stack &Bar + &Pruh zásobníku + + + Rena&me Tab... + &Přejmenovat kartu... + + + Vectors XY&AM + Vektory XY&AM + + + Shift+A + Shift+A + + + Open ODF Spreadsheet File + + + + &Convert to Spreadsheet + &Převést na tabulku + + + &Vertical 2 Layers + &Dvě svislé vrstvy + + + QtiPlot project + Projekt QtiPlotu + + + The table '%1' already exists. It has been renamed '%2'. + Tabulka '%1' již existuje. Byla přejmenována na '%2'. + + + File %1 contains only %2 sheets, operation aborted! + + + + &Forward FFT + &FFT dopředu + + Rotate &-90 Otočit &o 90° - - - Ctrl+Alt+R - Ctrl+Alt+R - - - - - &Invert - &Převrátit - - - - - &Determinant - &Determinant - - - - - &Image mode - &Obrazový režim - - - - Ctrl+Shift+I - Ctrl+Shift+I - - - - + Import data file(s) + Zavést soubor(y) s daty + + + &Toolbars... + &Nástrojové lišty... + + + Clear &Log Information + Smazat všechny informace v &zápisu + + + Reset rotation + Znovu nastavit otáčení + + &Data mode &Datový režim - - Ctrl+Shift+D - Ctrl+Shift+D - - - - - Show &X/Y - Ukázat &X/Y - - - - Ctrl+Shift+X - Ctrl+Shift+X - - - - - Show &Column/Row - Ukázat &Sloupec/Řádek - - - - Ctrl+Shift+C - Ctrl+Shift+C - - - - - - &Gray Scale - &Stupnice šedi - - - - - &Default - &Výchozí - - - - - &Rainbow - &Duha - - - - + Please select a column first! + Vyberte, prosím, nejprve sloupec! + + + Set as Y Error Bars + Nastavit jako chybové úsečky Y + + + Please select a 'Y' column first! + Vyberte, prosím, nejprve sloupec 'y'! + + + The selected columns have different numbers of rows! + Vybrané sloupce mají různé počty řádků! + + + &Third Order ... + &Třetí řád... + + + &Waterfall Plot + &Vodopádový nákres + + + &Paste Text + &Vložit zkopírovaný text + + + &Columns + &Sloupce + + + Columns + Sloupce + + + 3&D Plot + &Trojrozměrný nákres + + + Add Text + Přidat text + + + &Console + &Konzole - ovládací panel + + + Byte Rate + Rychlost bajtů + + + &Undo/Redo Stack + &Zpět/Znovu zásobník + + + show command line options + Ukázat volby příkazového řádku + + + <h4>There are no tables available in this project.</h4><p><h4>Please create a table and try again!</h4> + <h4>V tomto projektu nejsou dostupné žádné tabulky.</h4><p><h4>Vytvořte, prosím, tabulku a zkuste to znovu!</h4> + + + &Paste Tex Formula + &Vložit vzorec TeX + + + &Disregard + &Nebrat v úvahu + + + Created + Vytvořeno + + + Create a new folder + Vytvořit novou složku + + + R&otate 90 + O&točit o 90° + + + &Cancel + &Zrušit + + + Crosshairs + Nitkový kříž + + + &Column + &Sloupec + + + &Hide All Windows + &Skrýt všechna okna + + + &FFT... + &FFT... + + + 3D &Hidden Line + Trojrozměrné &skryté čáry + + + &Delete + &Smazat + + &Custom &Vlastní - - - &Export Image ... - &Vyvést obrázek... - - - - - - &Direct &Přímo - - - &XYZ Columns - Sloupce &XYZ - - - - - &YXZ Columns - Sloupce &YXZ - - - - &Forward FFT - &FFT dopředu - - - - &Inverse FFT - &Převrácená hodnota FFT - - - - Convert to &Matrix - Převést do &matici - - - - - Dra&g Curve - &Táhnout křivku - - - + Please support QtiPlot! + Podpořte, prosím, QtiPlot! + + + &Histogram + &Histogram + + + Statistical &Graphs + Statistické &nákresy + + + &Integrate + &Začlenit + + + &Default + &Výchozí + + + The file: <b>%1</b> doesn't exist! + Soubor: <b>%1</b> neexistuje! + + + Rotate 90 Counterclockwise + Otočit o 90° proti směru hodinových ručiček + + + Intercept + Ohraničený úsek + + + &Current + &Nynější + + + 3D Surface + Nákres trojrozměrného povrchu + + + &Export + &Vyvést + + + Ma&ximize Window + Zvět&šit okno + + + Integration of %1 from zero is + Začlenění %1 od nuly je + + + Flip Vertically + Obrátit svisle + + + show standalone scripting window + Ukázat samostatné skriptovací okno + + + Empty Floor + Prázdný povrch + + &Import &Zavést - + &Insert + &Vložit + + + &Invert + &Převrátit + + You must select a single Y column that has an associated X column! Musíte vybrat jeden sloupec Y, ke kterému je přiřazen sloupec X! - - You must select exactly one Z column! - Musíte vybrat přesně jeden sloupec Z! - - - - Open File - Otevřít soubor - - - - Imported sound file - Zavedený zvukový soubor - - - + Empty Stack + Prázdný zásobník + + + Set Gray Scale Palette + Nastavit paletu odstínů šedi + + This is not a PCM type WAV file, operation aborted! Toto není soubor WAV typu PCM. Operace byla zrušena! - - PCM - PCM - - - - - Time - Čas - - - - Left - Levý - - - - Right - Pravý - - - - Data - Data - - - - Channels - Kanály - - - - Sample Rate - Vzorkovací kmitočet - - - - Byte Rate - Rychlost bajtů - - - - Block Align - Spojení bloků - - - - Bits Per Sample - Bitů na vzorek - - - - Presentation Preview - Náhled provedení - - - - &Save - &Uložit - - - - There are no windows available in this folder! - V tomto projektu nejsou dostupná žádná okna! - - - - - &Sound (WAV)... - &Zvuk (WAV)... - - - - - Create Open &Document Presentation... - Vytvořit představení v Open &Document... - - - - - &Close - &Zavřít - - - - - &Lowess... - - - - - - 2D &Binning - Dvojrozměrné &uložení do bedny - - - - - &Regular XYZ - &Pravidelný XYZ - - - - - 3D &Wire Frame - Trojrozměrná &drátěná mřížka - - - - - 3D &Hidden Line - Trojrozměrné &skryté čáry - - - - - 3D &Polygons - Trojrozměrné &mnohoúhelníky - - - - - 3D Wire &Surface - Trojrozměrný &povrch drátěné mřížky - - - - Contour - &Color Fill - Obrys - &Barevná výplň - - - - - Contour &Lines - Obrysové &čáry - - - - - &Gray Scale Map - &Zobrazení povrchu v odstínech šedi - - - - - Sort Ta&ble - Seřadit tabul&ku - - - - - Sort Columns - Seřadit sloupce - - - - - Co&rrelate - Dát do &vzájemného vztahu - - - - - &Autocorrelate - &Automaticky dát do vzájemného vztahu - - - - - &Convolute - &Složit - - - - - &Deconvolute - &Rozložit - - - - - &Horizontal - &Vodorovně - - - - - &Vertical - &Svisle - - - - - Ro&w Numbers - Čís&la řádků - - - - - &Random Values - &Náhodné hodnoty - - - - - &Frequency Count ... - &Počítání kmitočtu... - - - - - &Read Only - &Pouze pro čtení - - - - - &Disregard - &Nebrat v úvahu - - - - - &Box Plot - &Krabicový nákres - - - - + Empty floor + Prázdný povrch + + + &Title ... + &Název... + + + &Inverse FFT + &Převrácená hodnota FFT + + + Hide &Other Curves + Skrýt &jiné křivky + + + Zoom &In/Out and Drag Canvas + &Přiblížit/Oddálit a táhnout plátnem + + + &Matrix + &Matice + + + QtiPlot - Error bars error + QtiPlot - Chyba chybových úseček + + + Save changes to project: <p><b> %1 </b> ? + Uložit změny do projektu: <p><b> %1 </b>? + + + Save Note As... + Uložit poznámku jako... + + + Floor Isolines + Povrchové obrysové čáry + + + Floor isolines + Povrchové obrysové čáry + + + QtiPlot - Delete rows + QtiPlot - Odstranit řádky + + &Gaussian... &Gaussův... - - - &Lorentzian... - &Lorentzův... - - - - - Search for &Updates - Hledat &aktualizace - - - - - &QtiPlot Homepage - &Domovská stránky QtiPlotu - - - - QtiPlot &Forums - Fórum &QtiPlotu - - - - - Report a &Bug - Nahlásit &chybu v programu - - - - - Download &Manual - Stáhnout &příručku - - - - - &Translations - &Překlady - - - - - Make a &Donation - Poskytněte &dar - - - - - Technical &Support - Technická &podpora - - - - - Scripting &language - Skriptovací &jazyk - - - - - &Restart scripting - &Vynulovat skriptování - - - - - E&xecute - Vy&konat - - - - - Ctrl+J - Ctrl+J - - - - - Execute &All - Vykonat &vše - - - - - Ctrl+Shift+J - Ctrl+Shift+J - - - - - &Evaluate Expression - &Vyhodnotit výraz - - - - - Show Line &Numbers - Ukázat čísla &řádků - - - - - Find &Next - Najít &další - - - - - F3 - F3 - - - - - Find &Previous - Najít &předchozí - - - - - F4 - F4 - - - - - &Replace... - &Nahradit... - - - - - Increase Indent - Zvětšit odsazení - - - - - Decrease Indent - Zmenšit odsazení - - - - - Rena&me Tab... - &Přejmenovat kartu... - - - - - A&dd Tab - Při&dat kartu - - - - - C&lose Tab - &Zavřít kartu - - - - - &Script Window - &Skriptovací okno - - - - - &Plot details... - &Podrobnosti nákresu... - - - - - &Worksheet - &Pracovní list - - - - - &Reset to Full Range - &Znovu nastavit na plný rozsah - - - - - Edit &Range... - Upravit &rozsah... - - - - - &Hide - &Skrýt - - - - - Hide &Other Curves - Skrýt &jiné křivky - - - - - &Show All Curves - &Ukázat všechny křivky - - - - - &Edit Function... - &Upravit funkci... - - - - - &Toolbars... - &Nástrojové lišty... - - - - - Ctrl+Shift+T - Ctrl+Shift+T - - - - - Bold - Tučné písmo - - - - - Italic - Kurzíva - - - - Superscript - Horní index - - - - Subscript - Dolní index - - - - - Underline (Ctrl+U) - Podtržení (Ctrl+U) - - - - - Ctrl+U - Ctrl+U - - - - - - - Greek - Řecké symboly - - - - - Mathematical Symbols - Matematické symboly - - - - Increase Precision - Zvětšit přesnost - - - - Decrease Precision - Zmenšit přesnost - - - - Open a new project - Otevřít nový projekt - - - - New Fol&der - Nová slož&ka - - - - Create a new folder - Vytvořit novou složku - - - - Create an empty 2D plot - Vytvořit prázdný dvojrozměrný nákres - - - - Create an empty note window - Vytvořit prázdné okno na poznámky - - - - New table - Nová tabulka - - - - New matrix - Nová matice - - - - Create a new 2D function plot - Vytvořit nový dvojrozměrný nákres funkce - - - - Create a new 3D surface plot - Vytvořit nový trojrozměrný nákres povrchu - - - - Open project - Otevřít projekt - - - - Save project - Uložit projekt - - - - Open Te&mplate... - Otevřít před&lohu... - - - - Open template - Otevřít šablonu - - - - Save window as template - Uložit okno jako předlohu - - - - Import data file(s) - Zavést soubor(y) s daty - - - - Ctrl+K - Ctrl+K - - - + Show all table columns + Ukázat všechny sloupce tabulky + + + Fit &Linear + &Lineární umístění + + + &Copy Graph + &Kopírovat nákres + + + Export to PDF + Vyvést do PDF + + + New &Matrix + Nová &matice + + + &Gray Scale + &Stupnice šedi + + + Zoom/Drag Canvas &Vertically + + + + New &Legend + Nová &vysvětlivka + + + &Select Data Range + &Vybrat rozsah dat + + + &Rename + &Přejmenovat + + + New &Window + Nové &okno + + + &Ribbon + &Stuha + + + &Matrix... + &Matice... + + + &Determinant + &Determinant + + + If you want to save your already defined models, please choose a destination folder. + Pokud chcete uložit své již stanovené modely, vyberte, prosím, cílovou složku. + + + QtiPlot - File save error + QtiPlot - Chyba při ukládání souboru + + + QtiPlot - Set the number of pixels to average + QtiPlot - Nastavit počet pixelů na průměrnou hodnotu + + + &Smooth + &Vyhladit + + + &Spline + &Spline + + + Directory: + Adresář: + + + <b> %1 </b>: This command line option must be used without other arguments! + <b> %1 </b>: Tato volba příkazového řádku se musí používat bez dalších nezávislých proměnných! + + + The file: <b>%1</b> is not a QtiPlot template file! + Soubor: <b> %1</b> není souborem šablony programu QtiPlot! + + + &Upward + &Nahoru + + + Open Exce&l ... + + + + &Band Block... + &Pásmovou závoru... + + + &Window + &Okno + + + Swap selected columns + Vyměnit vybrané sloupce + + + stem unit + Jednotka pro stonek + + + Stem unit + Jednotka pro stonek + + + show about dialog and exit + Ukázat dialog "O programu" a ukončit + + + Please select a row first! + Vyberte, prosím, nejprve řádek! + + + &Band Pass... + &Pásmové posunutí... + + + Open File + Otevřít soubor + + + D&epends on + Zá&visí na + + + &Draw Data Points + &Nakreslit datové body + + + Selected columns statistics + Statistické údaje pro vybrané sloupce + + + &Preferences... + &Nastavení... + + + Image Profiles + + + + &Image Profiles + + + Undo changes Změny vrátit zpět - + Extract to Layer&s + Vytáhnout do vrstev + + + QtiPlot - Updates Available + QtiPlot - Aktualizace jsou dostupné + + + Released + Uvolněno + + + &Save Project + &Uložit projekt + + + &Columns... + &Sloupce... + + + Memory Allocation Error + Chyba v přidělení paměti + + + Draw Data Points + Nakreslit datové body + + + Delete folder '%1' and all the windows it contains? + Odstranit složku '%1' a všechna okna, jež obsahuje? + + + Type %1 to see the list of the valid options. + Zadejte %1 kvůli zobrazení seznamu s platnými volbami. + + + End row + Konec řádku + + + Hidden line + Skryté čáry + + + Function + Funkce + + + Hidden Line + Skryté čáry + + + English + Český + + + Please indicate the location of the help file! + Ukažte, prosím, umístění souboru s nápovědou! + + + &Surface... + &Povrch... + + + You must select exactly one column for plotting! + Pro tento nákres musíte vybrat přesně jeden sloupec, který bude nakreslen! + + + &High Pass... + &Vysoké posunutí... + + Redo changes Změny provést znovu - - Duplicate window - Zdvojit okno - - - - Cut selection - Vyjmout výběr - - - - Copy selection - Kopírovat výběr - - - - Paste selection - Vložit výběr - - - - Delete selection - Smazat výběr - - - - Project &Explorer - &Průzkumník projektu - - - - Show project explorer - Ukázat průzkumníka projektu - - - - Results &Log - Zápis &výsledků - - - - Show analysis results - Ukázat výsledky výpočtů - - - - &Undo/Redo Stack - &Zpět/Znovu zásobník - - - - Show available undo/redo commands - Ukázat dostupné příkazy Zpět/Znovu - - - - &Console - &Konzole - ovládací panel - - - - Show Scripting console - Ukázat skriptovací konzoli - - - + QtiPlot - Renamed Window + QtiPlot - přejmenované okno + + + Name already exists! + Název již existuje! + + + Move Left + Přesunout vlevo + + Script Window Skriptovací okno - - Add Layer - Přidat vrstvu - - - - Arrange Layers - Uspořádat vrstvy - - - - Export current graph - Vyvést nynější nákres - - - - Export all graphs - Vyvést všechny nákresy - - - - Export to PDF - Vyvést do PDF - - - - Print window - Tisk okna - - - - Print preview - Tisk náhledu - - - - Add curve to graph - Do nákresu přidat křivku - - - - Add Error Bars... - Přidat pruhy s chybami... - - - + &Script Window + &Skriptovací okno + + + Selected rows statistics + Statistické údaje pro vybrané řádky + + + &Export Graph + &Vyvést nákres + + + QtiPlot Table Template + Předloha tabulky pro QtiPlot + + + &Delete Row + &Smazat řádek + + + &Vertical + &Svisle + + + Vertical + + + + Vectors XYXY + Vektory XYXY + + + Vectors XYAM + Vektory XYAM + + + QtiPlot - Import image from file + QtiPlot - Zavést obrázek ze souboru + + + Plot as symbols + Nakreslit jako symboly + + + A&dd Tab + Při&dat kartu + + + Best fit + Nejlepší umístění + + + &Second Order ... + &Druhý řád... + + + Load Custom User &Interface... + + + + Fit &Multi-peak + Umístění s &mnohačetnými vrcholy + + + Plot with vertical bars + Nakreslit se svislými pruhy + + + QtiPlot - File Open Error + QtiPlot - Chyba při otevírání souboru + + + &Insert Row + &Vložit řádek + + + Add Equation + Přidat rovnici + + + Version + Verze + + + Please select four columns for this operation! + Vyberte, prosím, čtyři sloupce pro tuto operaci! + + Add Function... Přidat funkci... - - Best fit - Nejlepší umístění - - - - Add new legend - Přidat novou vysvětlivku - - - + Save project as + Uložit projekt jako + + + Save Project As + Projekt uložit jako + + + print QtiPlot version and release date + Vytisknout verzi a datum vydání QtiPlotu + + Date & time Datum & čas - - Add Image - Přidat obrázek - - - + Contour - &Color Fill + Obrys - &Barevná výplň + + + &Remove Layer + &Odstranit vrstvu + + + Floor data projection + Promítání povrchu dat + + + Floor Data Projection + Povrchové promítání dat + + + Fit frame to window + Umístit rámeček oknu + + + &Choose Help Folder... + &Vybrat složku s nápovědou... + + + QtiPlot - File opening error + QtiPlot - Chyba při otevírání souboru + + + &YXZ Columns + Sloupce &YXZ + + + &XYZ Columns + Sloupce &XYZ + + + Add Rectangle + Přidat obdélník + + + &Find... + &Najít... + + + New &Function Plot + Nový &nákres funkce + + + Block Align + Spojení bloků + + + Clea&r Rows + Vyprá&zdnit řádky + + + E&xport Page + &Vyvést stranu + + + &Rename Window + &Přejmenovat okno + + Plot as line Nakreslit jako čáru - - Plot as symbols - Nakreslit jako symboly - - - - Plot as line + symbols - Nakreslit jako čáru + symboly - - - - Plot with vertical bars - Nakreslit se svislými pruhy - - - - Plot with horizontal bars - Nakreslit s vodorovnými pruhy - - - - Plot area - Nakreslit oblast - - - - Plot pie - Nakreslit koláčový nákres - - - - &Vectors XYXY - &Vektory XYXY - - - - Vectors XYXY - Vektory XYXY - - - - Vectors XYAM - Vektory XYAM - - - - Stem-and-Leaf Plot - Stonkový a listový nákres - - - - Double Y Axis - Zdvojit osu Y - - - - Zoom - Přiblížit - - - - Extract to Graphs - Vytáhnout do obrazců - - - - Extract to Layer&s - Vytáhnout do vrstev - - - - Extract to Layers - Vytáhnout do vrstev - - - - Plot 3D ribbon - Nakreslit trojrozměrnou stuhu - - - - Plot 3D bars - Nakreslit trojrozměrné pruhy - - - - Plot 3D scatter - Nakreslit trojrozměrné body - - - - Plot 3D trajectory - Nakreslit trojrozměrnou dráhu - - - - Contour + &Color Fill - Obrys + &Barevná výplň - - - - Contour Lines + Color Fill - Obrysové čáry + Barevná výplň - - - - Contour Lines - Obrysové čáry - - - - Gray Scale Map - Zobrazení povrchu v odstínech šedi - - - - Selected columns statistics - Statistické údaje pro vybrané sloupce - - - - Selected rows statistics - Statistické údaje pro vybrané řádky - - - - Hide selected columns - Skrýt vybrané sloupce - - - - Show all table columns - Ukázat všechny sloupce tabulky - - - - Swap selected columns - Vyměnit vybrané sloupce - - - - Move Right - Přesunout vpravo - - - - Move Left - Přesunout vlevo - - - - Move to First - Přesunout k prvnímu - - - - Move to Last - Přesunout k poslednímu - - - - More Windows... - Další okna... - - - - Set Matrix Values - Nastavit hodnoty matice - - - + Flip &H + Obrátit &vodorovně + + + Flip &V + Obrátit &svisle + + + Mesh & Filled Polygons + Síť & vyplněné mnohoúhelníky + + + Mesh & filled Polygons + Síť & vyplněné mnohoúhelníky + + + Add Time Stamp + Přidat označení času + + + Ctrl+Shift+C + Ctrl+Shift+C + + + Ctrl+Shift+D + Ctrl+Shift+D + + + Ctrl+Shift+E + + + + Ctrl+Shift+H + Ctrl+Shift+H + + + Ctrl+Shift+I + Ctrl+Shift+I + + + Ctrl+Shift+J + Ctrl+Shift+J + + + Ctrl+Shift+R + Ctrl+Shift+R + + + Ctrl+Shift+S + Ctrl+Shift+S + + + Ctrl+Shift+T + Ctrl+Shift+T + + + Ctrl+Shift+V + Ctrl+Shift+V + + + Ctrl+Shift+X + Ctrl+Shift+X + + + &Random Values + &Náhodné hodnoty + + + Edit &Range... + Upravit &rozsah... + + + Add new legend + Přidat novou vysvětlivku + + + &Image mode + &Obrazový režim + + + &Image Plot + &Znázornit nákres + + + folders + Složky + + + &Folders + &Složky + + + Left grid + Levá mřížka + + + &Properties... + &Vlastnosti... + + Image Plot Znázornit nákres - - Rotate 90 Clockwise - Otočit o 90° po směru hodinových ručiček - - - - Rotate 90 Counterclockwise - Otočit o 90° proti směru hodinových ručiček - - - - Flip Vertically - Obrátit svisle - - - - Flip Horizontally - Obrátit vodorovně - - - + Sheet %1 is empty, operation aborted! + + + + &Reset to Full Range + &Znovu nastavit na plný rozsah + + + Arran&ge Layers + &Uspořádat vrstvy + + + &Sound (WAV)... + &Zvuk (WAV)... + + + &Lowess... + + + + Choose a directory to export the graphs to + Vybrat adresář, do něhož se budou vyvádět nákresy + + + Add &Custom Script Action... + Přidat &akci vlastního skriptu... + + + E&xecute + Vy&konat + + + Underline (Ctrl+U) + Podtržení (Ctrl+U) + + + This functionality is not available for pie plots! + Tento rozsah funkcí není pro koláčové nákresy dostupný! + + + &Windows + &Okna + + + windows + Okna + + + Sort Columns + Seřadit sloupce + + + Sort Colu&mn + Seřadit slou&pec + + + Zoom In (Shift++) or Out (-) and Drag Canvas + Přiblížit(Shift++) nebo Oddálit (-) a táhnout plátnem + + + &Delete Folder + &Smazat složku + + + Delete selection + Smazat výběr + + + Screen reader + Čtečka obrazovky + + + You must select exactly one Z column! + Musíte vybrat přesně jeden sloupec Z! + + + Open template + Otevřít šablonu + + + Spec&ial Bar/Column + &Zvláštní pruh/sloupec + + + Contour Lines + Obrysové čáry + + + &Delete Selection + &Smazat výběr + + + Cannot make a backup copy of <b>%1</b> (to %2).<br>If you ignore this, you run the risk of <b>data loss</b>. + Nelze vytvořit záložní kopii z <b>%1</b> (do %2).<br>Pokud si této věci nebudete všímat, riskujete <b>ztrátu dat</b>. + + + New 3D &Surface Plot + Nový trojrozměrný &nákres povrchu + + + <h4>There are no plot layers available in this window.</h4><p><h4>Please add a layer and try again!</h4> + <h4>V tomto okně nejsou dostupné žádné vrstvy nákresu.</h4><p><h4>Přidejte, prosím, vrstvu, a zkuste to znovu!</h4> + + + QtiPlot was not built with Python scripting support included! + QtiPlot nebyl sestaven se zahrnutou podporou pro skriptování s Pythonem! + + + &Paste Line/Arrow + &Vložit zkopírovanou čáru/šipku + + + QtiPlot 2D Graph Template + Předloha QtiPlotu pro dvojrozměrné nákresy + + + &Fill Column With + &Vyplnit sloupec + + + Show analysis results + Ukázat výsledky výpočtů + + + QtiPlot - Guess best origin for the new layer? + QtiPlot - Určit nejlepší počátek souřadnic pro novou vrstvu? + + + &Evaluate Expression + &Vyhodnotit výraz + + + Auto &Column Width + Automatická &šířka sloupce + + + QtiPlot - Plot error + QtiPlot - Chyba při kreslení + + + Column &Options ... + Volby pro &sloupce... + + + QtiPlot - Row selection error + QtiPlot - Chyba při výběru řádků + + + Channels + Kanály + + + Decrease Indent + Zmenšit odsazení + + + Increase Indent + Zvětšit odsazení + + + Fit E&xponential Decay + Umístit ex&ponenciální pokles + + Fill selected columns with row numbers Naplnit vybrané sloupce řadovými čísly - - Fill selected columns with random numbers - Naplnit vybrané sloupce náhodnými čísly - - - - Set column as X - Nastavit sloupec jako X - - - - Set column as Y - Nastavit sloupec jako Y - - - - Set column as Z - Nastavit sloupec jako Z - - - - Set as Y Error Bars - Nastavit jako pruhy s chybami Y - - - + Determinant of + Determinant + + + Arrange Layers + Uspořádat vrstvy + + + Please select a Z column for this operation! + Vyberte, prosím, pro tuto operaci sloupec Z! + + + &Print Window + &Tisk okna + + + Plot &Wizard + Průvodce &nákresem + + + Show Column/Row + Ukázat Sloupec/Řádek + + + QtiPlot - Warning + QtiPlot - Varování + + + &Paste Ellipse + &Vložit elipsu + + + Execute &All + Vykonat &vše + + + Choose &Data Set... + Vybrat &datový soubor... + + + QtiPlot - Duplicate error + QtiPlot - Chyba při zdvojení + + + Bits Per Sample + Bitů na vzorek + + + Visit QtiPlot &Forums + Navštívit fóra ke &QtiPlotu + + + QtiPlot - Scripting Error + QtiPlot - Chyba skriptu + + + Integration of %1 + Začlenění %1 + + + Box and whiskers plot + Bednový a vousatý nákres + + + &Activate Window + &Aktivovat okno + + + Contour + &Color Fill + Obrys + &Barevná výplň + + + Results &Log + Zápis &výsledků + + + Double Y Axis + Zdvojit osu Y + + Set as Labels Nastavit jako štítky - - Disregard Columns - Sloupce nebrat v úvahu - - - - Box and whiskers plot - Bednový a vousatý nákres - - - - Visit QtiPlot &Forums - Navštívit fóra ke &QtiPlotu - - - + There are no plot layers available in window <b>%1</b>.<br>Graph window not exported! + V tomto okně nejsou dostupné žádné vrstvy nákresu, <b>%1</b>.<br>Okno s nákresem nebylo vyvedeno! + + + CTRL+ALT+A + CTRL+ALT+A + + + CTRL+ALT+E + CTRL+ALT+E + + + CTRL+ALT+L + CTRL+ALT+L + + + CTRL+ALT+R + CTRL+ALT+R + + + Ctrl+ALT+M + Ctrl+ALT+M + + + Ctrl+ALT+T + Ctrl+ALT+T + + + Ctrl+ALT+Z + Ctrl+ALT+Z + + + Ctrl+Alt+A + Ctrl+Alt+A + + + Ctrl+Alt+C + Ctrl+Alt+C + + + Ctrl+Alt+D + Ctrl+Alt+D + + + Ctrl+Alt+F + Ctrl+Alt+F + + + Ctrl+Alt+G + Ctrl+Alt+G + + + Ctrl+Alt+H + Ctrl+Alt+H + + + Ctrl+Alt+O + Ctrl+Alt+O + + + Ctrl+Alt+P + Ctrl+Alt+P + + + Ctrl+Alt+R + Ctrl+Alt+R + + + Ctrl+Alt+S + + + + Ctrl+Alt+W + Ctrl+Alt+W + + + Report a &Bug + Nahlásit &chybu v programu + + + Please select two columns for this operation! + Vyberte, prosím, dva sloupce pro tuto operaci! + + + Cannot move a parent folder into a child folder! + Nelze přesunout složku do její podsložky! + + + Maximized + Zvětšen + + + &Horizontal Steps + &Vodorovné kroky + + + &Delete Window + &Smazat okno + + + Add E&quation + Přidat R&ovnici + + + QtiPlot 3D Surface Template + Předloha QtiPlotu pro trojrozměrné povrchy + + + Create a new 2D function plot + Vytvořit nový dvojrozměrný nákres funkce + + + About QtiPlot + O programu QtiPlot + + + &About QtiPlot + &O programu QtiPlot + + + Set Precision %1 digits + Nastavit přesnost %1 desetinných míst + + + QtiPlot - Choose matrix to plot + QtiPlot - Vyberte matici, která bude nakreslena + + + Imported sound file + Zavedený zvukový soubor + + + QtiPlot - Script Window + QtiPlot - Skriptovací okno + + + Rotate 90 Clockwise + Otočit o 90° po směru hodinových ručiček + + + Choose custom user interface + + + + Set Column &Values ... + Nastavit hodnoty pro &sloupce... + + + QtiPlot - Demo Version + QtiPlot - Demoverze + + + &Stacked Layers + &Vrstvené vrstvy + + + Right grid + Pravá mřížka + + + Show X/Y + Ukázat X/Y + + + &Go to Row... + &Jít na řádek... + + + Inte&rpolate ... + &Interpolovat... + + + Number of averaged pixels + Počet zprůměrovaných pixelů + + + QtiPlot - No Updates Available + QtiPlot - Žádné aktualizace nejsou dostupné + + + Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! + Nelze zapisovat do souboru: <br><h4> %1 </h4><p>Ověřte, prosím, že máte oprávnění pro zápis do tohoto umístění! + + + Data Display + Zobrazení dat + + + You must have more than one layer in the active window! + V činném okně musíte mít více než jednu vrstvu! + + + The file: <b> %1 </b> was not created using QtiPlot! + Soubor: <b> %1</b> nebyl vytvořen QtiPlotem! + + + A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? + Soubor nazvaný: <p><b>%1</b><p>již existuje. Chcete jej přepsat? + + + Warning: for internal consistency reasons the underscore character is replaced with a minus sign. + Varování: Kvůli zajištění vnitřní ucelenosti byl znak podtržení nahrazen znaménkem mínus. + + + Scripting Console + Skriptovací konzole + + + Export all graphs + Vyvést všechny nákresy + + Show find dialog Ukázat dialog pro hledání - - Find Next - Najít další - - - - Find Previous - Najít předchozí - - - - Show replace dialog - Ukázat dialog pro nahrazování - - - - Disable &tools - Zakázat &nástroje - - - - Pointer - Ukazovátko - - - - Zoom In - Přiblížit - - - - Zoom &Out - &Oddálit - - - - Zoom Out - Oddálit - - - - Data reader - Čtečka dat - - - - Select data range - Vybrat rozsah dat - - - - Screen reader - Čtečka obrazovky - - - - Draw Data Points - Nakreslit datové body - - - - Move data points - Přesunout datové body - - - - Drag Curve - Táhnout křivku - - - - Remove data points - Přesunout datové body - - - - Add Text - Přidat text - - - - Add Equation - Přidat rovnici - - - - Add Rectangle - Přidat obdélník - - - - Add Ellipse/Circle - Přidat elipsu/kružnici - - - - Draw arrow - Nakreslit šipku - - - - Draw line - Nakreslit čáru - - - - - - - Box - Bedna - - - - - - Frame - Rám - - - - &Frame - &Rám - - - - - No Axes - Žádné osy - - - - - No axes - Žádné osy - - - - Front grid - Mřížka popředí - - - - Back grid - Mřížka pozadí - - - - Right grid - Pravá mřížka - - - - Left grid - Levá mřížka - - - - Ceiling grid - Stropní mřížka - - - - Floor grid - Povrchová mřížka - - - - - - - Wireframe - Drátěná mříž - - - - - Hidden Line - Skryté čáry - - - - - Hidden line - Skryté čáry - - - - - Polygon Only - Pouze mnohoúhelník - - - - - Polygon only - Pouze mnohoúhelník - - - - - Mesh & Filled Polygons - Síť & vyplněné mnohoúhelníky - - - - - Mesh & filled Polygons - Síť & vyplněné mnohoúhelníky - - - - - - - Dots - Tečky - - - - - - - Bars - Pruhy - - - - - - - Cones - Kužely - - - - - - - Crosshairs - Nitkový kříž - - - - - Floor Data Projection - Povrchové promítání dat - - - - - Floor data projection - Promítání povrchu dat - - - - - Floor Isolines - Povrchové obrysové čáry - - - - - Floor isolines - Povrchové obrysové čáry - - - - - Empty Floor - Prázdný povrch - - - - - Empty floor - Prázdný povrch - - - - - - - Animation - Kreslený film - - - - - - - Enable perspective - Povolit perspektivní zobrazení - - - - - - - Reset rotation - Znovu nastavit otáčení - - - - - - - Fit frame to window - Umístit rámeček oknu - - - - QtiPlot - Enter the number of peaks - QtiPlot - Zadat počet vrcholů - - - - Peaks - Vrcholy - - - - Memory Allocation Error - Chyba v přidělení paměti - - - - Not enough memory, operation aborted! - - - - - - Set Precision %1 digits - Nastavit přesnost %1 desetinných míst - - - <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> - - <font velikost=+2, barva = tmavomodrá><b>QtiPlot program s otevřeným zdrojovým kódem a jeho vývoj vyžaduje stovky hodin práce.<br><br> - - - - - <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> If you like it, you're using it in your work and you would like to see it constantly improved, please support its authors by making a donation.</b></font> - <font size=+2, color = darkBlue><b>QtiPlot je otevřený program a jeho vývoj vyžaduje stovky hodin práce.<br><br> Jestliže se vám líbí, používáte jej při své práci a rád byste viděl jeho stálé vylepšování, podpořte, prosím, jeho autory darem.</b></font> - - - - Please support QtiPlot! - Podpořte, prosím, QtiPlot! - - - - <b> %1 </b>: This command line option must be used without other arguments! - <b> %1 </b>: Tato volba příkazového řádku se musí používat bez dalších nezávislých proměnných! - - - - Version - Verze - - - - Usage - Použití - - - - options - Volby - - - - - file - Soubor - - - - - name - Název - - - - Valid options are - Platnými volbami jsou - - - - - - - - - - - or - nebo - - - - show about dialog and exit - Ukázat dialog "O programu" a ukončit - - - - start QtiPlot with the default settings - Spustit QtiPlot s výchozími nastaveními - - - - show command line options - Ukázat volby příkazového řádku - - - - start QtiPlot in language - Spustit QtiPlot v jazyce - - - - show QtiPlot manual in a standalone window - Ukázat příručku ke QtiPlotu v samostatném okně - - - - print QtiPlot version and release date - Vytisknout verzi a datum vydání QtiPlotu - - - - execute the script file given as argument - Vykonat soubor se skriptem zadaným jako nezávislou proměnnou - - - - execute the script file given as argument without displying the user interface. Warning: 2D plots are not correctly handled in this functioning mode! - Vykonat soubor se skriptem jako nezávislou proměnnou bez zobrazení uživatelského rozhraní. Varování: Dvojrozměrné nákresy nejsou při tomto pracovním režimu zvládány správně! - - - - can be any .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py or ASCII file - Může být jakýkoli soubor .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py nebo ASCII - - - - Help - Nápověda - - - - <b> %1 </b>: Wrong locale option or no translation available! - <b> %1 </b>: Nesprávná zkratka pro zemi, nebo není dostupný žádný překlad! - - - - <b> %1 </b> unknown command line option! - <b> %1 </b> Neznámá volba příkazového řádku! - - - - Type %1 to see the list of the valid options. - Zadejte %1 kvůli zobrazení seznamu s platnými volbami. - - - - <b>%1</b> is a directory, please specify a file name! - <b>%1</b> Je adresářem. Zadejte, prosím, název souboru! - - - - The file: <b>%1</b> is not a QtiPlot or Origin project file! - Soubor: <b>%1</b> není souborem projektu QtiPlot nebo Origin! - - - - QtiPlot - Demo Version - QtiPlot - Demoverze - - - You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. - Používáte předváděcí verzi Qtiplotu. Je totožná s plnou verzí, mimo to, že vaši práci nelze uložit do souboru s projektem a nemůžete ji používat déle než 10 minut na jedno sezení. <br><br> Pokud chcete mít verzi připravenou k používání s plně pracující binární soubory, podepište se, prosím, na <a href="http://soft.proindependent.com/individual_contract.html">smlouva na starání se o binární soubory pro jednoho-uživatele</a>. <br><br> QtiPlot je svobodný software ve smyslu svobody projevu. Pokud víte, jak jej používat, můžete získat <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">zdrojový kód</a> zdarma. Přesto však jste vítán, <a href="http://soft.proindependent.com/why_donate.html">hodláte-li poskytnout dar, </a> kterým podpoříte budoucí vývoj QtiPlotu. - - - - QtiPlot - File backup error - QtiPlot - Chyba při zálohování souboru - - - - Cannot make a backup copy of <b>%1</b> (to %2).<br>If you ignore this, you run the risk of <b>data loss</b>. - Nelze vytvořit záložní kopii z <b>%1</b> (do %2).<br>Pokud si této věci nebudete všímat, riskujete <b>ztrátu dat</b>. - - - - QtiPlot - File save error - QtiPlot - Chyba při ukládání souboru - - - - The file: <br><b>%1</b> is opened in read-only mode - Soubor: <br><b> %1 </b> je otevřen v režimu pouze pro čtení - - - - Save project as - Uložit projekt jako - - - - - - - &Find... - &Najít... - - - - - App&end Project... - Při&pojit projekt... - - - - Save &As Project... - Uložit &jako projekt... - - - - &Delete Folder - &Smazat složku - - - - &Rename - &Přejmenovat - - - - &Windows in Active Folder - &Okna v činné složce - - - - Windows in &Active Folder && Subfolders - Okna v &činné složce && podsložkách - - - - &View Windows - &Zobrazit okna - - - - Hidden - Skryt - - - - Name already exists! - Název již existuje! - - - - Project - Projekt - - - - - - Path - Cesta - - - - bytes - byty - - - - - Contents - Obsah - - - - - windows - Okna - - - - - folders - Složky - - - - Modified - Upraveno - - - - - - Properties - Vlastnosti - - - - New Folder - Nová složka - - - - QtiPlot - Delete folder? - QtiPlot - Odstranit složku? - - - - Delete folder '%1' and all the windows it contains? - Odstranit složku '%1' a všechna okna, jež obsahuje? - - - - - Note - Poznámka - - - - - 3D Graph - Trojrozměrný obrazec - - - - Status - Stav - - - - QtiPlot - No match found - QtiPlot - Nenalezena žádná shoda - - - - Sorry, no match found for string: '%1' - Promiňte, ale nebyla nalezena žádná shoda pro řetězec znaků: '%1' - - - - Cannot move an object to itself! - Nelze přesunout předmět do sebe sama! - - - - Cannot move a parent folder into a child folder! - Nelze přesunout složku do její podsložky! - - - - Skipped moving folder - Přesunutí složky bylo přeskočeno - - - - - The destination folder already contains a folder called '%1'! Folder skipped! - Cílová složka již obsahuje složku nazvanou '%1'! Složka byla přeskočena! - - - - - - Error - Chyba - - - - QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! - QtiPlot se pokusí stáhnout z internetu nezbytnou informaci o posledních dostupných aktualizacích. Upravte, prosím, nastavení své ochrany počítače před viry a nežádoucími průniky do systému, aby se QtiPlot mohl připojit k internetu! - - - - Do you wish to continue? - Chcete pokračovat? - - - - QtiPlot - HTTP get version file - QtiPlot - HTTP získání souboru s verzí - - - - Error while fetching version file with HTTP: %1. - Při získávání souboru s verzí programu přes HTTP došlo k chybě: %1. - - - - QtiPlot - Updates Available - QtiPlot - Aktualizace jsou dostupné - - - - There is a newer version of QtiPlot (%1) available for download. Would you like to download it? - Existuje novější verze QtiPlotu (%1) ḋostupná ke stažení. Chcete ji stáhnout? - - - - QtiPlot - No Updates Available - QtiPlot - Žádné aktualizace nejsou dostupné - - - - No updates available. Your current version %1 is the last version available! - Žádné aktualizace nejsou dostupné. Verze %1, kterou nyní používáte, je poslední verzí, jež je dostupná! - - - - This will clear the contents of all the data associated with the table. Are you sure? - Tímto se smažou všechna data přiřazená k tabulce. Jste si jist tímto krokem? - - - - &No - &Ne - - - - QtiPlot - Enter row number - QtiPlot - Zadat číslo řádku - - - - Row - Řádek - - - - QtiPlot - Enter column number - QtiPlot - Zadat počet sloupců - - - - - QtiPlot was not built with Python scripting support included! - QtiPlot nebyl sestaven se zahrnutou podporou pro skriptování s Pythonem! - - - - Please set a default X column for this table, first! - Nejprve, prosím, u této tabulky nastavte jeden sloupec jako výchozí sloupec X! - - - - Please select a Z column for this operation! - Vyberte, prosím, pro tuto operaci sloupec Z! - - - - You need to define a X column first! - Neprve musíte stanovit sloupec X! - - - - You need to define a Y column first! - Neprve musíte stanovit sloupec Y! - - - - Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. - Počínaje verzí 0.9.1 QtiPlot ukládá uživatelsky stanovené odpovídající modely do jiného umístění. - - - - If you want to save your already defined models, please choose a destination folder. - Pokud chcete uložit své již stanovené modely, vyberte, prosím, cílovou složku. - - - - Import fit models - Zavést modely umístění - - - - Choose a directory to export the fit models to - Vybrat adresář, do něhož se budou exportovat modely umístění - - - - - No Icon - Bez ikony - - - - Couldn't load file: %1. -Autocompletion will not be available! - Nelze nahrát soubor: %1. -Automatické dokončení nebude dostupné! - - - - Please select exactly one column and more than one non empty cell! - Vyberte, prosím, přesně jeden sloupec a více než jednu buňku, která není prázdná! - - - - Data set: %1 doesn't exist! - Soubor dat: %1 neexistuje! - - - - Stem and leaf plot of dataset - Stonkový a listový nákres souboru dat - - - - from row - od řádku - - - - to row - po řádek - - - - Not enough memory for this dataset! - Pro tento soubor dat není dost paměti! - - - - Stem - Stonek - - - - Leaf - List - - - - Please confirm the stem unit! - Potvrďte, prosím, jednotku pro stonek! - - - - Data set - Soubor dat - - - - stem unit - Jednotka pro stonek - - - - Stem unit - Jednotka pro stonek - - - - Leaf unit - Jednotka pro list - - - - Key - Klávesa - - - - means - znamená - - - - Input error: empty data set! - Chyba vstupu: prázdný soubor dat! - - - - English - Český - - - - - Move Row - Přesunout řádek - - - - - - Spec&ial Bar/Column - &Zvláštní pruh/sloupec - - - - Print preview of window: - Tisk náhledu okna: - - - - - Print Pre&view - Tisk &náhledu - - - - &Add - &Přidat - - - - &Indexed Colors - &Indexované barvy - - - - Pale&tte - &Paleta - - - - - Ctrl+Alt+D - Ctrl+Alt+D - - - - - Zoom &In/Out and Drag Canvas - &Přiblížit/Oddálit a táhnout plátnem - - - - - Stack &Bar - &Pruh zásobníku - - - - - Stack &Column - &Sloupec zásobníku - - - - &Waterfall Plot - &Vodopádový nákres - - - - - Fit Slop&e - Umístit &sklon - - - - - Ad&just Column Width - Upravit &šířku sloupce - - - - - &Upward - &Nahoru - - - - - &Downward - &Dolů - - - - Append a project to the current folder - Projekt připojit k nynější složce - - - - Ctrl+Alt+A - Ctrl+Alt+A - - - - Plot stack bar - Nakreslit pruh se zásobníkem - - - - Plot stack column - Nakreslit sloupec se zásobníkem - - - - Move current row upward - Přesunout nynější řádek nahoru - - - - Move current row downward - Přesunout nynější řádek dolů - - - - Set optimal column width - Nastavit nejlepší šířku sloupců - - - - Alt+C - ALT+C - - - - Zoom In (Shift++) or Out (-) and Drag Canvas - Přiblížit(Shift++) nebo Oddálit (-) a táhnout plátnem - - - - Make a donation - Poskytněte dar - - - - Close - Zavřít - - - - show standalone scripting window - Ukázat samostatné skriptovací okno - - - - You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://soft.proindependent.com/download.html">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. - Používáte předváděcí verzi Qtiplotu. Je totožná s plnou verzí, mimo to, že vaši práci nelze uložit do souboru s projektem a nemůžete ji používat déle než 10 minut na jedno sezení. <br><br> Pokud chcete mít verzi připravenou k používání, plně pracující binární soubory, podepište se, prosím, na <a href="http://soft.proindependent.com/individual_contract.html">smlouva na starání se o binární soubory pro jednoho-uživatele</a>. <br><br> QtiPlot je svobodný software ve smyslu svobody projevu. Pokud víte, jak jej používat, můžete získat <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">zdrojový kód</a> zdarma. Přesto však jste vítán, <a href="http://soft.proindependent.com/why_donate.html">hodláte-li poskytnout dar, </a> kterým podpoříte budoucí vývoj QtiPlotu. + Set &Values... + Nastavit &hodnoty... + + + &Horizontal 2 Layers + Dvě vodo&rovné vrstvy + + + Project Explorer + Průzkumník projektu + + + Plot 3D scatter + Nakreslit trojrozměrné body + + + &Next + next window + &Další + + + F5 + next window shortcut + F5 + + + &Previous + previous window + &Předchozí + + + F6 + previous window shortcut + F6 + + + File %1 contains only %2 sheets! + Soubor %1 obsahuje pouze %2 listy! + + + Paste Selection as Te&xt + Vložit výběr jako te&xt + + + Del + delete key + Klávesa Delete + + + Shared A&xes Panel + Sdílený panel &os + + + + + + + &Custom Layout... + &Vlastní rozvržení... + + + Execute Selected Lines + Provést vybrané řádky + + + Commen&t Selection + Opatřit výběr &poznámkou + + + &Uncomment Selection + &Odebrat poznámku k výběru + + + Comment Selection + Opatřit výběr poznámkou + + + Uncomment Selection + Odebrat poznámku k výběru + + + Ctrl+Shift+O + Ctrl+Shift+O + + + Ctrl+Shift+U + Ctrl+Shift+U + + + Waterfall Plot + + + + &Extract Data... + + + + S&ubtract + + + + &Straight Line... + + + + &Reference Data... + + + + &Open... + &Otevřít... + + + Open Image &File... + + + + &Print... + + + + Print Pre&view... + Náhled &tisku... + + + E&xport ASCII... + ArrowMarker - + x + x + + + y + y + + dx dx - dy dy - + eqn + rovnice + + angle úhel - length délka - - - - eqn - rovnice - - - - y - y - - - - - x - x - AssociationsDialog - - QtiPlot - Plot Associations - QtiPlot - Asociace nákresu - - - - Spreadsheet: - Tabulkový kalkulátor: - - - - Column - Sloupec - - - X x - Y y - - + &OK + &OK + + + xEnd + xKonec + + xErr xChyba - - + yEnd + yKonec + + yErr yChyba - + Angle + Úhel + + + Magn. + Vel. + + + Spreadsheet: + Tabulkový kalkulátor: + + + Column + Sloupec + + + QtiPlot - Plot Associations + QtiPlot - Asociace nákresu + + + &Cancel + &Zrušit + + &Update curves &Aktualizovat křivky - - &OK - &OK - - - - &Cancel - &Zrušit - - - - xEnd - xKonec - - - - yEnd - yKonec - - - - Angle - Úhel - - - Magn. Magnitude, vector length Vel. @@ -5946,724 +3956,579 @@ AxesDialog - - QtiPlot - General Plot Options - QtiPlot - Obecné volby nákresu - - - - &Apply - &Použít - - - + In + Zapnuto + + + To + Do + + + ln + ln + + &OK &OK - - &Cancel - &Zrušit - - - - + Out + Vypnuto + + + Top + Nahoře + + + X=0 + x=0 + + + Y=0 + y=0 + + + Axes + Osy + + + Axis + Osa + + + Date + Datum + + + Font + Písmo + + From Od - - - To - Do - - - - + Grid + Mřížka + + + Left + Vlevo + + + Log2 + Log2 + + + None + Žádný + + + Show + Ukázat + + + Step + Krok + + + Time + Čas + + Type Druh - linear - přímočarý - - - logarithmic - logaritmický - - - - Inverted + days + dny + + + min. + min. + + + sec. + sek. + + + Text from table + Text z tabulky + + + In & Out + Zapnuto & Vypnuto + + + &Font + &Písmo + + + Angle + Úhel + + + Color + Barva + + + Guess + Předpoklad + + + Layer + Vrstva + + + Log10 + Log10 + + + Logit + Logit + + + Month + Měsíc + + + Right + Vpravo + + + Scale + Stupnice + + + Table + Tabulka + + + Title + Název + + + Width + Šířka + + + hours + hodiny + + + weeks + týdny + + + Reciprocal Převrácený - - Show Axis &Break - Ukázat přeru&šení osy - - - + Scientific: 1e4 + Vědecký: 1e4 + + + Horizontal + Vodorovný + + + Minor Ticks After + Vedlejší označení os po + + + Distance to axis + Vzdálenost od os + + + Canvas frame + Rámeček plátna + + + Draw backbones + Nakreslit opory + + + &Apply + &Použít + + Draw Break &Decoration Nakreslit ozdo&bu přerušení - - Position - Poloha - - - - % of Axis Length - % délky osy - - - - - Width - Šířka - - - - pixels - pixely - - - + Valid variables are 'x' for Top/Bottom axes and 'y' for Left/Right axes! + Platnými proměnnými jsou 'x' pro osy nahoře/dole a 'y' pro osy vlevo/vpravo! + + + millisec. + millisek. + + + Step Before Break + Krok před přerušením + + &Log10 Scale After Break &Log10 rozsah po přerušení - - Step Before Break - Krok před přerušením - - - - - Guess - Předpoklad - - - - Step After Break - Krok po přerušení - - - - Minor Ticks Before - Menší fajfky před - - - - Minor Ticks After - Menší fajfky po - - - - Step - Krok - - - - + Decimal: 10000.0 + Desetinný: 10000.0 + + Major Ticks - Větší fajfky + Hlavní označení os - - Minor Ticks - Menší fajfky - - - - - - Bottom - Dole - - - - - - Left - Vlevo - - - - - - Top - Nahoře - - - - - - Right - Vpravo - - - - Scale - Stupnice - - - + Vedlejší označení os + + + Minor Grids + Podmřížka + + Major Grids Hlavní mřížka - - Minor Grids - Podmřížka - - - - Line Color - Barva čáry - - - + Minor Ticks Before + Vedlejší označení os před + + Line Type Druh čáry - - Thickness - Síla v průřezu - - - - - Axes - Osy - - - - Additional lines - Dodatečné čáry - - - - X=0 - x=0 - - - - Y=0 - y=0 - - - - Apply To - Použít na - - - - This Layer - Tato vrstva - - - - This Window - Toto okno - - - - - - All Windows - Všechna okna - - - - An&tialised - Vyhla&zeno - - - - Horizontal - Vodorovný - - - - Vertical - Svislý - - - - Grid - Mřížka - - - - Show - Ukázat - - - - Title - Název - - - - Distance to axis - Vzdálenost od os - - - - &Font - &Písmo - - - - + Bottom + Dole + + + Column + Sloupec + + Format Formát - - Numeric - Číselný - - - - Text from table - Text z tabulky - - - + Engineering: 10k + Technický: 10k + + Day of the week Den v týdnu - - Month - Měsíc - - - - Time - Čas - - - - Date - Datum - - - - Column Headings - Záhlaví sloupců - - - - Font - Písmo - - - Axis &Font Písmo &os - - - - Color - Barva - - - - - None - Žádný - - - - - Out - Vypnuto - - - - - In & Out - Zapnuto & Vypnuto - - - - - In - Zapnuto - - - - Stand-off - Vymezovací prvek - - - - Apply &to - Použít &na - - - - - Axis - Osa - - - - - Layer - Vrstva - - - - - Window - Okno - - - + Linear + Lineární + + + QtiPlot - Formula input error + QtiPlot - Chyba vstupu vzorce + + + This Layer + Tato vrstva + + + Origin + Původ + + Show Labels Ukázat štítky - - Column - Sloupec - - - - Table - Tabulka - - - - - Precision - Přesnost - - - - Angle - Úhel - - - + This Window + Toto okno + + + Major ticks length + Délka hlavního označení os + + + Numeric + Číselný + + + Minor ticks length + Délka vedlejšího označení os + + + Inverted + Převrácený + + + &Inverted + &Obrácený + + + Window + Okno + + + Step After Break + Krok po přerušení + + For&mula Vzo&rec - - Canvas frame - Rámeček plátna - - - - Draw backbones - Nakreslit opory - - - + Apply &to... + Použít &na... + + + Position + Poloha + + + Apply &to + Použít &na + + + Line Color + Barva čáry + + Line Width Šířka čar - - Major ticks length - Délka větších fajfek - - - - Minor ticks length - Délka menších fajfek - - - - Set As &Default - Nastavit jako &výchozí - - - - Apply &to... - Použít &na... - - - - General - Obecné - - - + pixels + pixely + + + Apply To + Použít na + + + Probability + Pravděpodobnost + + + Stand-off + Vymezovací prvek + + + Column Headings + Záhlaví sloupců + + + &Cancel + &Zrušit + + + QtiPlot - General Plot Options + QtiPlot - Obecné volby nákresu + + Automatic Automaticky - - Decimal: 10000.0 - Desetinný: 10000.0 - - - - Scientific: 1e4 - Vědecký: 1e4 - - - + Precision + Přesnost + + + Show Axis &Break + Ukázat přeru&šení osy + + + Vertical + Svislý + + Scientific: 1x10^4 Vědecký: 1x10^4 - - Engineering: 10k - Technický: 10k - - - - - Origin - Původ - - - - QtiPlot - Formula input error - QtiPlot - Chyba vstupu vzorce - - - - Valid variables are 'x' for Top/Bottom axes and 'y' for Left/Right axes! - Platnými proměnnými jsou 'x' pro osy nahoře/dole a 'y' pro osy vlevo/vpravo! - - - - days - dny - - - - weeks - týdny - - - - millisec. - millisek. - - - - sec. - sek. - - - - min. - min. - - - - hours - hodiny - - - - Linear - Přímočarý - - - - Log10 - Log10 - - - - ln - ln - - - - Log2 - Log2 - - - - Reciprocal - Převrácený - - - - Probability - Pravděpodobnost - - - - Logit - Logit - - - - &Inverted - &Obrácený + Set As &Default + Nastavit jako &výchozí + + + % of Axis Length + % délky osy + + + General + Obecné + + + All Windows + Všechna okna + + + Additional lines + Dodatečné čáry + + + An&tialised + Vyhla&zeno + + + Thickness + Síla v průřezu + + + Labels space + Prostor štítku + + + Show &backbone + Ukázat &základovou čáru + + + Scientific: 1·10^4 + Vědecký: 1·10^4 + + + Hide Ticks + Skrýt značení os + + + At Axis Begin + Na začátku osy + + + At Axis End + Na konci osy + + + At Axis Begin & End + Na začátku & konci osy ColorBox - - black - černá - - - red červená - - green - zelená - - - blue modrá - cyan modrozelená - - magenta - červenorudá - - - - yellow - žlutá - - - - dark yellow - tmavě žlutá - - - + gray + šedá + + navy tmavomodrá - - purple - purpurová + pink + růžová - wine vínová (tmavě červená) - + black + černá + + + green + zelená + + olive olivová (olivově zelená) - - dark cyan - tmavě modrozelená - - - royal královská modř - - orange - oranžová - - - - violet - fialová - - - - pink - růžová - - - white bílá - - light gray - světle šedá - - - - gray - šedá - - - light yellow světle žlutá - - light cyan - světle modrozelená - - - light magenta světle červenorudá - + magenta + červenorudá + + + orange + oranžová + + + purple + purpurová + + + dark yellow + tmavě žlutá + + + violet + fialová + + + yellow + žlutá + + dark gray tmavě šedá + + dark cyan + tmavě modrozelená + + + light cyan + světle modrozelená + + + light gray + světle šedá + ColorButton - Custom - Vlastní + Vlastní ColorMapDialog - + &Apply + &Použít + + + &Close + &Zavřít + + QtiPlot QtiPlot - Custom Color Map Vlastní mapa barev - - &Apply - &Použít - - - - &Close - &Zavřít - - - Set Custom Palette Nastavit vlastní paletu @@ -6671,27 +4536,22 @@ ColorMapEditor - + Color + Barva + + Level Úroveň - - Color - Barva + &Delete + &Smazat - &Insert &Vložit - - &Delete - &Smazat - - - &Scale Colors Barvy &zařadit do stupnice @@ -6699,38 +4559,29 @@ ColorMapPreviewDialog - + None + Žádný + + + Colormap files + Soubory mapy barev + + QtiPlot - Color Map Preview Dialog QtiPlot - Dialog náhledu mapy barev - - Colormap files - Soubory mapy barev - - - - All files - Všechny soubory - - - << &Preview << &Náhled - - - - - None - Žádný + All files + Všechny soubory ColorPickerPopup - Custom Vlastní @@ -6738,1840 +4589,1509 @@ ConfigDialog - The column separator can be customized. -The following special codes can be used: -\t for a TAB character -\s for a SPACE - Oddělovač sloupců může být uživatelem upraven. -Dají se použít následující zvláštní kódy: -\t pro znak TAB (tabulátor) -\s pro SPACE (mezerník) - - - The separator must not contain the following characters: -0-9eE.+- - Oddělovač nesmí obsahovat následující znaky: -0-9eE.+- - - - - - - Background - Pozadí - - - - - Background Color - Barva pozadí - - - - - - - Opacity - Neprůhlednost - - - - - Canvas Color - Barva plátna - - - - - Border Color - Barva okraje - - - - - - - Width - Šířka - - - - LF (Unix) - LF (Unix) - - - - CRLF (Windows) - CRLF (Windows) - - - - CR (Mac) - CR (Mac) - - - - - - - System Locale Setting - Místní nastavení systému - - - &B &B - + In + Uvnitř + + &It &It - - - Translations - Překlady - - - - + &OK + &OK + + + Dot + Tečka + + + Out + Vně + + + TAB + Tabulátor (TAB) + + + Top + Nahoře + + + Axes + Osy + + + Main Font + Hlavní písmo + + + Dash + Čárka + + + Font + Písmo + + Help Nápověda - - - Python Configuration Files - Soubory pro nastavení Pythonu - - - - QtiPlot - Choose default settings - QtiPlot - Vybrat výchozí nastavení - - - - General - Obecné - - - - - Tables - Tabulky - - - - - 2D Plots - Dvojrozměrné nákresy - - - - - 3D Plots - Trojrozměrné nákresy - - - + Host + Hostitelský počítač + + + Left + Levý + + + None + Žádný + + + Note + Poznámka + + + Port + Port + + + Show + Ukázat + + + Text + Text + + + Area + Oblast + + + Line + Čára + + + In & Out + Uvnitř & Vně + + + &Grid + &Mřížka + + + &Mesh + &Síť + + + &Scale layers to paper size + &Změnit velikost vrstev na velikost papíru + + + Syntax Highlighting + Zvýrazňování skladby + + + A&xes + O&sy + + + Color + Barva + + + Empty + Prázdný + + + Fonts + Písma + + + Grids + Mřížky + + Notes Poznámky - - Fitting - Umístění křivek - - - - Options - Volby - - - - Curves - Křivky - - - - Axes - Osy - - - + Print + Tisk + + + SPACE + Mezerník (SPACE) + + + Right + Pravý + + + Solid + Vyplněný + + + Table + Tabulka + + + Style + Styl + + Ticks Značení os - - - - Fonts - Písma - - - - Do not &resize layers when window size changes - Neměnit &velikost vrstev při změně velikosti okna - - - - &Disable in-place editing - &Zakázat úpravy v místě - - - - - Length - Délka - - - - Major Ticks - Hlavní označení os - - - - Minor Ticks - Vedlejší označení os - - - - Margin - Odstup - - - + Width + Šířka + + + There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! + V této složce<b>není žádný soubor nazvaný</b>index.html.<br>Vyberte, prosím, jinou složku! + + + Column comment + Poznámka ke sloupci + + + %1 is not a folder.<br>Please choose another folder! + %1 není složkou.<br>Vyberte, prosím, jinou složku! + + + Projection + Zobrazení + + + Choose the location of the Python configuration files! + Vyberte umístění složky se soubory nastavení pro Python! + + + Prompt on &renaming tables when appending projects + Výzva při &přejmenovávání tabulek při přidávání projektů + + + Border Color + Barva okraje + + + A&xes Labels + Popisy &os + + + %1 is a folder.<br>Please choose a file! + %1 je složkou.<br>Vyberte, prosím, soubor! + + + Generated Fit Curve + Vytvořená křivka umístění + + + Mi&nor Grids + &Menší mřížky + + + Ma&jor Grids + &Větší mřížky + + + The file %1 doesn't exist.<br>Please choose another file! + Soubor %1 neexistuje.<br>Vyberte, prosím, jiný soubor! + + + Start New Project + Začít s novým projektem + + + &Background + &Pozadí + + + The separator must not contain the following characters: 0-9eE.+- + Oddělovač nesmí obsahovat následující znaky: 0-9eE.+- + + + Canvas Color + Barva plátna + + + &Labels Font + &Písmo popisů + + + Background + Pozadí + + Axes title space Prostor pro názvy os - - Frame width - Šířka rámečku - - - - Canvas Fra&me - Rámeček &podkladu - - - - Show &Title - Ukázat &název - - - - Scale &Fonts - Velikost &písma - - - - Auto&scaling - Automatická &velikost - - - - Antia&liasing - Vyhla&zování okrajů - - - - Legend display - Zobrazení vysvětlivek - - - - Column name - Název sloupce - - - - Column comment - Poznámka ke sloupci - - - + &Display line numbers + &Zobrazovat čísla řádků + + + Lab&els + &Popisy + + Table name Název tabulky - - Table legend - Vysvětlivky k tabulce - - - - - Transparent - Průhledný - - - - Axes &backbones - &Základové čáry os - - - - Axes linewidth - Šířka čar os - - - - Left - Levý - - - - Right - Pravý - - - - Bottom - Dole - - - - Top - Nahoře - - - - Enabled axes - Osy povoleny - - - - Show - Ukázat - - - - - Labels - Popisy - - - - - None - Žádný - - - - - Out - Vně - - - - - In & Out - Uvnitř & Vně - - - - - In - Uvnitř - - - - Print - Tisk - - - - Print Crop&marks - Tisk značek &oříznutí - - - - &Scale layers to paper size - &Změnit velikost vrstev na velikost papíru - - - - Prompt on closing - Ptát se při uzavření - - - - Folders - Složky - - - - Matrices - Matice - - - + &Apply + &Použít + + &Notes &Poznámky - - &OK - &OK - - - - &Cancel - &Zrušit - - - - &Apply - &Použít - - - - &Text Font - &Písmo textu - - - - &Labels Font - &Písmo popisů - - - - A&xes Labels - Popisy &os - - - - Axes &Numbers - Čísla &os - - - - &Legend - &Vysvětlivka - - - - T&itle + &Proxy + &Proxy + + + &Title &Název - - Prompt on &renaming tables when appending projects - Výzva při &přejmenovávání tabulek při přidávání projektů - - - - Application - Program - - - - Confirmations - Potvrzení - - - - - - Colors - Barvy - - - - Numeric Format - Číselný formát - - - - File Locations - Umístění souborů - - - - Language - Jazyk - - - - - - Style - Styl - - - - The column separator can be customized. -The following special codes can be used: -\t for a TAB character -\s for a SPACE - - - - - The separator must not contain the following characters: -0-9eE.+- - - - - - - Grids - Mřížky - - - - - Ma&jor Grids - &Větší mřížky - - - - - Mi&nor Grids - &Menší mřížky - - - - - Color - Barva - - - - Main Font - Hlavní písmo - - - - Choose &font - Vybrat &písmo - - - - Workspace - Pracovní oblast - - - + Legend display + Zobrazení vysvětlivek + + + LF (Unix) + LF (Unix) + + + Vertical steps + Svislé kroky + + + Show &Title + Ukázat &název + + + Default scripting language + Výchozí skriptovací jazyk + + Panels text Podokno: text - - Panels - Podokno: Pozadí - - - - Save every - Uložit vše - - - - &Backup project before saving - &Před uložením provést zálohu projektu - - - Check for new versions at startup Při spuštění provést ověření dostupnosti nových verzí - + Choose &font + Vybrat &písmo + + minutes minuty - - Default scripting language - Výchozí skriptovací jazyk - - - - Matrix Undo Stack Size - Velikost zásobníku pro "Zpět" u matic - - - - Endline character - Znak pro konec řádku - - - - Start New Project - Začít s novým projektem - - - - - Empty - Prázdný - - - - Table - Tabulka - - - - Matrix - Matice - - - - Empty Graph - Prázdný nákres - - - - Note - Poznámka - - - - &Enable autocompletion (Ctrl+U) - &Povolit automatické dokončení (Ctrl+U) - - - - Number of Decimal Digits - Počet desetinných míst - - - - Decimal Separators - Oddělovače desetinných míst - - - - Omit &Thousands Separator - Vynechat oddělovač míst (&tisíce) - - - - Clipboard Decimal Separators - Oddělovače desetinných míst pro schránku - - - - Automatically &Recalculate Column Values - Automaticky &přepočítat hodnoty ve sloupcích - - - + Major Ticks + Hlavní označení os + + + Minor Ticks + Vedlejší označení os + + + CR (Mac) + CR (Mac) + + + Column name + Název sloupce + + + &Disable in-place editing + &Zakázat úpravy v místě + + + QtiPlot - Import options error + QtiPlot - chyba ve volbách pro zavádění + + + Table legend + Vysvětlivky k tabulce + + + Bottom + Dole + + + Colors + Barvy + + + &Functions + &Funkce + + + Curves + Křivky + + + LaTeX Compiler + LaTeXový překladač + + &Display Comments in Header &Zobrazovat poznámky v záhlaví sloupce - - Default Column Separator - Výchozí oddělovač sloupců - - - - - - - TAB - Tabulátor (TAB) - - - - - - - SPACE - Mezerník (SPACE) - - - - Text - Text - - - - Default curve style - Přednastavený způsob kreslení křivek - - - - Line width - Šířka čar - - - + Peaks Color + Barva vrcholů + + + Labels + Popisy + + + Length + Délka + + + Margin + Odstup + + + Matrix + Matice + + + Panels + Podokno: Pozadí + + + T&itle + &Název + + + Points + Body + + + Spline + Spline + + + Tables + Tabulky + + Symbol size Velikost symbolu - - Line - Čára - - - - Scatter - Body - - - - Line + Symbol - Čára + Symbol - - - - Vertical drop lines - Svislé čáry - - - - Spline - Spline - - - - Vertical steps - Svislé kroky - - - - Horizontal steps - Vodorovné kroky - - - - Area - Oblast - - - - Vertical Bars - Svislé pruhy - - - - Horizontal Bars - Vodorovné pruhy - - - + &Numbers + &Čísla + + &Resolution &Rozlišení - - (all data shown) - (všechna data ukázána) - - - + Axes &backbones + &Základové čáry os + + + 3D Plots + Trojrozměrné nákresy + + + 2D Plots + Dvojrozměrné nákresy + + + Opacity + Neprůhlednost + + + Options + Volby + + + Short Dot + Krátká tečka + + + Line + Symbol + Čára + Symbol + + + &Floor style + &Způsob kreslení povrchu + + + System Locale Setting + Místní nastavení systému + + + Frame width + Šířka rámečku + + + Translations + Překlady + + + Scale &Fonts + Velikost &písma + + + Same X as Fitting Data + Stejná hodnota X jako data pro umístění + + + Save every + Uložit vše + + + Line width + Šířka čar + + + Uniform X Function + Jednotná funkce X + + + &Axes Labels + &Popisy os + + &Show Legend &Ukázat vysvětlivku - - &Floor style - &Způsob kreslení povrchu - - - - Isolines - Obrysové čáry - - - - Projection - Zobrazení - - - + Background Color + Barva pozadí + + + Print Crop&marks + Tisk značek &oříznutí + + + &Enable autocompletion (Ctrl+U) + &Povolit automatické dokončení (Ctrl+U) + + + Paste Parameters to Plot + Vložit parametry do nákresu + + + Python Configuration Files + Soubory pro nastavení Pythonu + + + Short Dash Dot + Krátká čárka tečka + + + &Backup project before saving + &Před uložením provést zálohu projektu + + + You don't have read access rights to file %1.<br>Please choose another file! + K souboru %1 nemáte oprávnění pro čtení.<br>Vyberte, prosím, jiný soubor! + + + QtiPlot - File Not Found! + QtiPlot - Soubor nebyl nenalezen! + + + Ask before over&writing files + + + + Language + Jazyk + + + Choose the location of the QtiPlot help folder! + Vyberte umístění složky s nápovědou QtiPlotu! + + + &Internet Connection + Připojení k &internetu + + + Default Column Separator + Výchozí oddělovač sloupců + + + Endline character + Znak pro konec řádku + + + Dash Dot + Čárka tečka + + + Password + Heslo + + + QtiPlot + QtiPlot + + + Matrices + Matice + + + QtiPlot - index.html File Not Found! + QtiPlot - soubor index.html nenalezen! + + + Parameters Output + Výstup parametrů + + Smoot&h Line &Vyhlazená čára - - O&rthogonal - P&ravoúhlý - - - - Lab&els - &Popisy - - - - &Mesh - &Síť - - - - &Grid - &Mřížka - - - - - - &Numbers - &Čísla - - - - A&xes - O&sy - - - - &Background - &Pozadí - - - - Default Color Map - Výchozí mapa barev - - - - &Title - &Název - - - - &Axes Labels - &Popisy os - - - - Autosca&ling - Automatická ve&likost - - - - - Solid - Vyplněný - - - - - Dash - Čárka - - - - - Dot - Tečka - - - - - Dash Dot - Čárka tečka - - - - - Dash Dot Dot - Čárka tečka tečka - - - - + Numeric Format + Číselný formát + + + Workspace + Pracovní oblast + + + Automatically &Recalculate Column Values + Automaticky &přepočítat hodnoty ve sloupcích + + + Display Peak Curves for Multi-peak Fits + Ukazovat vrcholy křivek pro umístění s více vrcholy + + + CRLF (Windows) + CRLF (Windows) + + + Vertical drop lines + Svislé čáry + + Short Dash Krátká čárka - - - Short Dot - Krátká tečka - - - - - Short Dash Dot - Krátká čárka tečka - - - + There is no file called <b>index.html</b> in folder %1.<br>Please choose another folder! + Ve složce %1 <b>není žádný soubor nazvaný</b>index.html.<br>Vyberte, prosím, jinou složku! + + Tab length (pixels) Délka tabulátoru (v pixelech) - - Font - Písmo - - - - &Display line numbers - &Zobrazovat čísla řádků - - - - Syntax Highlighting - Zvýrazňování skladby - - - - Co&mments - Po&známky - - - - &Keywords - &Klíčová slova - - - + Scatter + Body + + + File Locations + Umístění souborů + + + Username + Uživatelské jméno + + + QtiPlot - Folder Not Found! + QtiPlot - Složka nenalezena! + + + Scale Errors with sqrt(Chi^2/doF) + Zařazovat do stupnice hodnoty chyb s (kořenem) sqrt(Chi^2/doF) + + + Confirmations + Potvrzení + + + (all data shown) + (všechna data ukázána) + + + Axes linewidth + Šířka čar os + + + Transparent + Průhledný + + + Isolines + Obrysové čáry + + + Q&t Classes + Q&t třídy + + + &Cancel + &Zrušit + + &Quotations &Citace - - &Functions - &Funkce - - - - Q&t Classes - Q&t třídy - - - - Generated Fit Curve - Vytvořená křivka umístění - - - - Uniform X Function - Jednotná funkce X - - - - Points - Body - - - - Same X as Fitting Data - Stejná hodnota X jako data pro umístění - - - + Antia&liasing + Vyhla&zování okrajů + + 2 points for linear fits - Dva body pro přímočaré umístění - - - - - Display Peak Curves for Multi-peak Fits - Ukazovat vrcholy křivek pro umístění s více vrcholy - - - - Parameters Output - Výstup parametrů - - - - Significant Digits - Statisticky významná desetinná místa - - - - Write Parameters to Result Log - Zapsat parametry do zápisu s výsledky - - - - Paste Parameters to Plot - Vložit parametry do nákresu - - - - Scale Errors with sqrt(Chi^2/doF) - Zařazovat do stupnice hodnoty chyb s (kořenem) sqrt(Chi^2/doF) - - - - Peaks Color - Barva vrcholů - - - - QtiPlot - Import options error - QtiPlot - chyba ve volbách pro zavádění - - - - The separator must not contain the following characters: 0-9eE.+- - Oddělovač nesmí obsahovat následující znaky: 0-9eE.+- - - - - - QtiPlot - index.html File Not Found! - QtiPlot - soubor index.html nenalezen! - - - - There is no file called <b>index.html</b> in folder %1.<br>Please choose another folder! - Ve složce %1 <b>není žádný soubor nazvaný</b>index.html.<br>Vyberte, prosím, jinou složku! - - - + Dva body pro lineární umístění + + + Empty Graph + Prázdný nákres + + + &Legend + &Vysvětlivka + + + Vertical Bars + Svislé pruhy + + Choose the location of the QtiPlot translations folder! Vyberte umístění složky s překlady QtiPlotu! - - Choose the location of the QtiPlot help folder! - Vyberte umístění složky s nápovědou QtiPlotu! - - - - There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! - V této složce<b>není žádný soubor nazvaný</b>index.html.<br>Vyberte, prosím, jinou složku! - - - - Choose the location of the Python configuration files! - Vyberte umístění složky se soubory nastavení pro Python! - - - - - QtiPlot - Folder Not Found! - QtiPlot - Složka nenalezena! - - - The folder %1 doesn't exist.<br>Please choose another folder! Složka %1 neexistuje.<br>Vyberte, prosím, jinou složku! - - %1 is not a folder.<br>Please choose another folder! - %1 není složkou.<br>Vyberte, prosím, jinou složku! - - - - - QtiPlot - QtiPlot - - - + mu&Parser uses C locale settings + + + + Default curve style + Přednastavený způsob kreslení křivek + + + Decimal Separators + Oddělovače desetinných míst + + + Choose the location of the LaTeX compiler! + Vyberte umístění s LaTeXovým překladačem! + + + Do not &resize layers when window size changes + Neměnit &velikost vrstev při změně velikosti okna + + + Fitting + Umístění křivek + + + &Keywords + &Klíčová slova + + + Write Parameters to Result Log + Zapsat parametry do zápisu s výsledky + + + Auto&scaling + Automatická &velikost + + + Co&mments + Po&známky + + + Clipboard Decimal Separators + Oddělovače desetinných míst pro schránku + + + Canvas Fra&me + Rámeček &podkladu + + + Folders + Složky + + + Axes &Numbers + Čísla &os + + + Autosca&ling + Automatická ve&likost + + + QtiPlot - Choose default settings + QtiPlot - Vybrat výchozí nastavení + + + General + Obecné + + + Significant Digits + Statisticky významná desetinná místa + + + Matrix Undo Stack Size + Velikost zásobníku pro "Zpět" u matic + + + Number of Decimal Digits + Počet desetinných míst + + + Omit &Thousands Separator + Vynechat oddělovač míst (&tisíce) + + + Horizontal Bars + Vodorovné pruhy + + + O&rthogonal + P&ravoúhlý + + + Default Color Map + Výchozí mapa barev + + + Prompt on closing + Ptát se při uzavření + + You don't have read access rights to folder %1.<br>Please choose another folder! Ke složce %1 nemáte oprávnění pro čtení.<br>Vyberte, prosím, jinou složku! - - LaTeX Compiler - LaTeXový překladač - - - - - &Internet Connection - Připojení k &internetu - - - - - &Proxy - &Proxy - - - - - Host - Hostitelský počítač - - - - - Port - Port - - - - - Username - Uživatelské jméno - - - - - Password - Heslo - - - - Choose the location of the LaTeX compiler! - Vyberte umístění s LaTeXovým překladačem! - - - - - QtiPlot - File Not Found! - QtiPlot - Soubor nebyl nenalezen! - - - - The file %1 doesn't exist.<br>Please choose another file! - Soubor %1 neexistuje.<br>Vyberte, prosím, jiný soubor! - - - - %1 is a folder.<br>Please choose a file! - %1 je složkou.<br>Vyberte, prosím, soubor! - - - - You don't have read access rights to file %1.<br>Please choose another file! - K souboru %1 nemáte oprávnění pro čtení.<br>Vyberte, prosím, jiný soubor! + Horizontal steps + Vodorovné kroky + + + &Text Font + &Písmo textu + + + Enabled axes + Osy povoleny + + + Dash Dot Dot + Čárka tečka tečka + + + Application + Program + + + &Keep aspect ratio + &Zachovat poměr stran obrazu + + + Geometry + Uspořádání + + + Ticks - Labels space + Značení os - prostor popisků + + + pixels + pixely + + + Unit + Jednotka + + + inch + palec + + + mm + mm + + + cm + cm + + + point + bod + + + pixel + pixel + + + Canvas Width + Šířka plátna + + + Canvas Height + Výška plátna + + + Display Confirmation &Messages for Multi-peak Fits + Zobrazovat potvrzovací zp&rávy pro umístění s více vrcholy + + + The column separator can be customized. +The following special codes can be used: +\t for a TAB character +\s for a SPACE + Oddělovač sloupců lze uživatelsky nastavit. +K tomu lze použít následujících zvláštních kódů: +\t pro znak zarážky (TABULÁTOR) +\s pro mezeru (MEZERNÍK) + + + The separator must not contain the following characters: +0-9eE.+- + Oddělovač nesmí obsahovat následující znaky: +0-9eE.+- + + + New Color + Nová barva + + + &Load Default + &Nahrát výchozí + + + Delete Color + Smazat barvu + + + Move Color Up + Posunout barvu nahoru + + + Move Color Down + Posunout barvu dolů + + + Indexed Colors + Rejstříkované barvy + + + Inde&xed Symbols + &Rejstříkované symboly + + + Move Symbol Up + Posunout symbol nahoru + + + Move Symbol Down + Posunout symbol dolů + + + Pattern + Vzor + + + Default Symbol + Výchozí symbol + + + Edge width + Šířka okraje + + + &Fill Symbol + &Vyplnit symbolem + + + Name + Název + + + Symbol + Symbol + + + Line style + Styl čáry + + + Fill area under curve + Vyplnit oblast pod křivkou + + + Default Line Style + Výchozí styl čáry + + + Axis title + + + + Default + Výchozí + + + Synchronize scale &divisions + ContourLinesEditor - + &Ok + &OK + + + Pen + Pero + + + Color + Barva + + Level Úroveň - - Pen - Pero - - - - &Insert - &Vložit - - - + Style + Styl + + + Width + Šířka + + + &Close + &Zavřít + + + Apply to all + Použít na vše + + &Delete &Smazat - QtiPlot - Edit pen QtiPlot - Upravit pero - - Color - Barva - - - - - - Apply to all - Použít na vše - - - - Style - Styl - - - - Width - Šířka - - - - &Ok - &OK - - - - &Close - &Zavřít + &Insert + &Vložit Convolution - + The response data set %1 does not exist! + Záznam s údaji o odpovědi %1 neexistuje! + + + Error + Chyba + + + Index + Index + + + Could not allocate memory, operation aborted! + Nepodařilo se přidělit dostatek paměti. Operace zrušena! + + Convolution Složení - - - - - - QtiPlot - QtiPlot - - - - - - - - Error - Chyba - - - The signal data set %1 does not exist! Záznam s údaji o signálu %1 neexistuje! - - The response data set %1 does not exist! - Záznam s údaji o odpovědi %1 neexistuje! - - - + QtiPlot + QtiPlot + + + The response dataset '%1' must contain an odd number of points! + Záznam s údaji o odpovědi '%1' musí obsahovat lichý počet bodů! + + The response dataset '%1' must be less then half the size of the signal dataset '%2'! Záznam s údaji o odpovědi '%1' musí být menší než poloviční oproti záznamu s údaji o signálu '%2'! - - - The response dataset '%1' must contain an odd number of points! - Záznam s údaji o odpovědi '%1' musí obsahovat lichý počet bodů! - - - - Could not allocate memory, operation aborted! - Nepodařilo se přidělit dostatek paměti. Operace zrušena! - - - - - Index - Index - Correlation - + Lag + Prodleva + + + Error + Chyba + + + QtiPlot + QtiPlot + + + The data set %1 does not exist! + Záznam s údaji %1 neexistuje! + + Correlation Vzájemná souvislost - - - - QtiPlot - QtiPlot - - - - - - Error - Chyba - - - - - The data set %1 does not exist! - Záznam s údaji %1 neexistuje! - - - Error in GSL forward FFT operation! Chyba v GSL vpřed FFT operaci! - - - - Lag - Prodleva - CreateBinMatrixDialog - - - QtiPlot - QtiPlot - - - - Bin Matrix Dialog - Dialog matice binárního souboru - - - &OK &OK - - &Cancel - &Zrušit - - - + Rows + Řádky + + + X-max + X-max + + X-min X-min - - X-max - X-max - - - - Columns - Sloupce - - - + Y-max + Y-max + + Y-min Y-min - - Y-max - Y-max - - - - Rows - Řádky - - - + The dimensions you have specified are not acceptable! + Rozměry, které jste zadal, nejsou přijatelné! + + + Bin Matrix Dialog + Dialog matice binárního souboru + + + QtiPlot + QtiPlot + + + Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! + Zadejte, prosím, kladné hodnoty, pro které výsledek řádky*sloupce nepřekročí největší možnou celočíselnou hodnotu na vašem systému! + + + Columns + Sloupce + + + &Cancel + &Zrušit + + Input Size Error Chyba ve velikosti vstupu - - - The dimensions you have specified are not acceptable! - Rozměry, které jste zadal, nejsou přijatelné! - - - - Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! - Zadejte, prosím, kladné hodnoty, pro které výsledek řádky*sloupce nepřekročí největší možnou celočíselnou hodnotu na vašem systému! - CurveRangeDialog - - QtiPlot - Plot range - QtiPlot - Rozsah nákresu - - - + &OK + &OK + + + &Close + &Zavřít + + Data set: Záznam s údaji: - From row number Od řádku s číslem - To row number Po řádek s číslem - - &OK - &OK - - - - &Close - &Zavřít + QtiPlot - Plot range + QtiPlot - Rozsah nákresu CurvesDialog - - QtiPlot - Add/Remove curves - QtiPlot - Přidat/Odstranit křivky - - - + OK + OK + + + Area + Oblast + + + Line + Čára + + + &Plot + &Nákres + + + Close + Zavřít + + + Gray Scale Map + Zobrazení povrchu v odstínech šedi + + + &Plot Selection + &Výběr nákresu + + + Vertical steps + Svislé kroky + + + Contour - Color Fill + Obrys - Barevná výplň + + New curves style Nový styl křivek - - Line - Čára - - - + &Plot Associations... + &Přiřazení nákresu... + + + Spline + Spline + + + Line + Symbol + Čára + Symbol + + + Vertical drop lines + Svislé čáry + + + &Show Range + &Ukázat rozsah + + Scatter Změť - - Line + Symbol - Čára + Symbol - - - - Vertical drop lines - Svislé čáry - - - - Spline - Spline - - - - Vertical steps - Svislé kroky - - - - Horizontal steps - Vodorovné kroky - - - - Area - Oblast - - - - Vertical Bars - Svislé pruhy - - - - Horizontal Bars - Vodorovné pruhy - - - + Histogram + Histogram + + Histogram Histogram - - Contour - Color Fill - Obrys - Barevná výplň - - - - Contour Lines - Obrysové čáry - - - - Gray Scale Map - Zobrazení povrchu v odstínech šedi - - - - Histogram - Histogram - - - - Available data - Dostupná data - - - - Graph contents - Obsah nákresu - - - - &Plot Associations... - &Přiřazení nákresu... - - - - Edit &Range... - Upravit &Rozsah... - - - - &Edit Function... - &Upravit funkci... - - - - OK - OK - - - - Close - Zavřít - - - - &Show Range - &Ukázat rozsah - - - + Vertical Bars + Svislé pruhy + + Show current &folder only Ukázat pouze &nynější složku - - &Plot Selection - &Výběr nákresu - - - - &Plot - &Nákres - - - - &Delete Selection - &Smazat výběr - - - + &Edit Function... + &Upravit funkci... + + + Edit &Range... + Upravit &Rozsah... + + &Delete Curve &Smazat křivku + + Contour Lines + Obrysové čáry + + + &Delete Selection + &Smazat výběr + + + Graph contents + Obsah nákresu + + + Available data + Dostupná data + + + Horizontal Bars + Vodorovné pruhy + + + QtiPlot - Add/Remove curves + QtiPlot - Přidat/Odstranit křivky + + + Horizontal steps + Vodorovné kroky + CustomActionDialog - - - - - - - - - - - - QtiPlot - QtiPlot - - - - Add Custom Action - Přidat vlastní akci - - - - Folder - Složka - - - - Choose &Folder - Vybrat &složku - - - - Script File - Soubor se skriptem - - - - Choose &Script - Vybrat &skript - - - + &Add + &Přidat + + Icon Ikona - - Choose &Icon - Vybrat &ikonu - - - - Text Text - - Tool Tip Text - Text rady k nástroji - - - - Shortcut - Zkratka - - - &Menu &Menu - + &Save + &Uložit + + + Error + Chyba + + + Menu: + Menu: + + &New Menu... &Nové menu... - - &Delete Menu - &Smazat menu - - - - &Tool Bar - &Nástrojová lišta - - - - &Save - &Uložit - - - - &Add - &Přidat - - - - &Remove - &Odstranit - - - - &Close - &Zavřít - - - - - - - - - - Error - Chyba - - - Please provide a description for your custom action! Poskytněte, prosím, popis své vlastní akce! - - Dot characters are not allowed in the description text! - V textu s popisem nejsou povoleny znaky obsahující tečku! - - - - You have already defined an action having description: %1 <br>Please provide a different description text! - Již jste stanovil akci s popisem: %1 <br>Poskytněte, prosím, jiný popisný text! - - - + &Close + &Zavřít + + + Please, choose the location of the new menu + Vyberte, prosím, umístění nového menu + + The file you have specified doesn't exist, please choose a valid script file! Vámi určený soubor neexistuje. Vyberte, prosím, platný soubor se skriptem! - + Choose the custom actions folder + Vybrat složku pro vlastní akce + + + Choose &Icon + Vybrat &ikonu + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + Nelze zapisovat do souboru: <br><h4> %1 </h4><p>Ověřte, prosím, že máte oprávnění pro zápis do tohoto umístění! + + The image file you have specified doesn't exist or can't be read, please choose another file! Vámi určený soubor s obrázkem neexistuje, nebo se nedá přečíst. Vyberte, prosím, jiný soubor! - + Choose script file + Vybrat soubor se skriptem + + + You have already defined an action having description: %1 <br>Please provide a different description text! + Již jste stanovil akci s popisem: %1 <br>Poskytněte, prosím, jiný popisný text! + + + Folder + Složka + + + Choose &Script + Vybrat &skript + + + There's already a menu item with this title, please choose another title! + Položka menu, která má shodný název, již existuje. Vyberte, prosím, jiný název! + + + File Save Error + Chyba při ukládání souboru + + + Choose &Folder + Vybrat &složku + + + Dot characters are not allowed in the description text! + V textu s popisem nejsou povoleny znaky obsahující tečku! + + + &Tool Bar + &Nástrojová lišta + + + Script File + Soubor se skriptem + + Please provide a different key sequence! The following shortcut key sequences are already assigned: Poskytněte, prosím, jiné pořadí kláves. Následující pořadí kláves pro zkratky jsou již přiřazena: - + Menu title: + Název menu: + + + QtiPlot + QtiPlot + + + &Delete Menu + &Smazat menu + + + QtiPlot - Load icon from file + QtiPlot - Nahrát obrázek ze souboru + + + Add menu + Přidat menu + + + Are you sure you want to remove menu '%1' and all its actions? + Jste si jist, že chcete odstranit menu '%1' a všechny s ním spojené akce? + + + Tool Tip Text + Text rady k nástroji + + + &Remove + &Odstranit + + + Remove Menu + Odstranit menu + + + Menu Bar + Lišta s menu + + Are you sure you want to remove this action? Jste si jist, že chcete odstranit tuto akci? - Remove Action Odstranit akci - - - File Save Error - Chyba při ukládání souboru - - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - Nelze zapisovat do souboru: <br><h4> %1 </h4><p>Ověřte, prosím, že máte oprávnění pro zápis do tohoto umístění! - - - Images - Obrázky - - - - QtiPlot - Load icon from file - QtiPlot - Nahrát obrázek ze souboru - - - Python Script Pythonový script - All Files Všechny soubory - - Choose script file - Vybrat soubor se skriptem - - - - Choose the custom actions folder - Vybrat složku pro vlastní akce - - - - Add menu - Přidat menu - - - - Menu title: - Název menu: - - - - - Menu Bar - Lišta s menu - - - - Please, choose the location of the new menu - Vyberte, prosím, umístění nového menu - - - - Menu: - Menu: - - - Thers's already a menu item with this title, please choose another title! - Položka menu, která má shodný název, již existuje. Vyberte, prosím, jiný název! - - - - Remove Menu - Odstranit menu - - - - Are you sure you want to remove menu '%1' and all its actions? - Jste si jist, že chcete odstranit menu '%1' a všechny s ním spojené akce? - - - - There's already a menu item with this title, please choose another title! - Položka menu, která má shodný název, již existuje. Vyberte, prosím, jiný název! + Add Custom Action + Přidat vlastní akci + + + Shortcut + Zkratka DataPickerTool - - Click on plot or move cursor to display coordinates! - Klepněte na nákres nebo pohněte ukazovátkem pro zobrazení souřadnic! - - - - Please, click on plot and move cursor! - Klepněte, prosím, na nákres a pohněte ukazovátkem! - - - - Select point and double click to remove it! - Vyberte bod a klepněte dvakrát pro jeho odstranění! - - - + The column '%1' is read-only! Please choose another curve! + Sloupec '%1' je jen pro čtení! Vyberte, prosím, jinou křivku! + + QtiPlot - Remove point error QtiPlot - Chyba při odstranění bodů - Sorry, but removing points of a function is not possible. Promiňte, ale odstranění bodů funkce není možné. - - - - - QtiPlot - Warning - QtiPlot - Varování + Select point and double click to remove it! + Vyberte bod a klepněte dvakrát pro jeho odstranění! - - This operation cannot be performed on curves plotted from columns having a non-numerical format. Tuto operaci nelze provést na křivkách nakreslených ze sloupců, které nemají číselný formát. - + Sorry, but moving points of a function is not possible. + Promiňte, ale přesun bodů funkce není možný. + + QtiPlot - Move point error QtiPlot - Chyba při přesunu bodu - - Sorry, but moving points of a function is not possible. - Promiňte, ale přesun bodů funkce není možný. - - - - - The column '%1' is read-only! Please choose another curve! - Sloupec '%1' je jen pro čtení! Vyberte, prosím, jinou křivku! - - - - DataSetDialog - - QtiPlot - Select data set - QtiPlot - Vybrat záznam s údaji - - - &OK - &OK - - - &Cancel - &Zrušit + QtiPlot - Warning + QtiPlot - Varování + + + Please, click on plot and move cursor! + Klepněte, prosím, na nákres a pohněte ukazovátkem! + + + Click on plot or move cursor to display coordinates! + Klepněte na nákres nebo pohněte ukazovátkem pro zobrazení souřadnic! Deconvolution - Deconvolution Rozložení @@ -8579,13 +6099,14 @@ Differentiation - - + of + z + + Derivative Derivace - of Derivative of z @@ -8594,7 +6115,6 @@ DrawPointTool - Draw Nakreslit @@ -8602,2205 +6122,1732 @@ EnrichmentDialog - - - - - QtiPlot - QtiPlot - - - - Tex Equation Editor - TeX editor rovnic - - - - Clea&r - Vypráz&dnit - - - + X + + + + Y + y + + + cm + cm + + + mm + mm + + + File + Soubor + + + Line + Čára + + + None + Žádný + + + Page + Strana + + + Size + Velikost + + + Unit + Jednotka + + + inch + palec + + + &Font + &Písmo + + + &Text + &Text + + + timedout + vypršelo + + + Color + Barva + + + Layer + Vrstva + + + Shape + Tvar + + + Width + Šířka + + + pixel + pixel + + + point + bod + + + scale + rozsah + + + Layer Scales + Rozměry vrstvy + + Window Geometry Uspořádání oken - - Object Properties - Vlastnosti předmětů - - - - &Apply - &Použít - - - - &Close - &Zavřít - - - - Preview: - Náhled: - - - - - &Text - &Text - - - - - Color - Barva - - - - &Font - &Písmo - - - - Background - Pozadí - - - - - Opacity - Neprůhlednost - - - - - Transparent - Průhledný - - - - Rotate (deg.) - Otáčet (stupně) - - - - Auto-&update - Automatická &aktualizace - - - - TeX &Output - Výstup v &TeXu - - - - - - Set As &Default - Nastavit jako &výchozí - - - - Apply format &to... - Formát použít &na... - - - - - - Object - Předmět - - - - - - Layer - Vrstva - - - - - - Window - Okno - - - - - - All Windows - Všechna okna - - - - File - Soubor - - - &Save internally &Uložit uvnitř - + Compile process ended + Proces překladu dokončen + + + Background + Pozadí + + + &Keep aspect ratio + &Zachovat poměr stran obrazu + + + &Apply + &Použít + + + &Close + &Zavřít + + + &Frame + &Rámeček + + &Image &Obrázek - - Shape - Tvar - - - - None - Žádný - - - - Line - Čára - - - - Rectangle - Obdélníkový - - - + Apply t&o... + Použít n&a... + + + Clea&r + Vypráz&dnit + + + Height + Výška + + + LaTeX Compiler + LaTeXový překladač + + + failed to start! + nepodařilo se spustit! + + + Object + Předmět + + + Please set the correct path to the compiler in the preferences dialog! + Nastavte, prosím, v dialogu nastavení správnou cestu k překladači! + + Shadow Stín - + Window + Okno + + + Use &Frame Color + Použít &barvu rámečku + + + Tex Equation Editor + TeX editor rovnic + + + Opacity + Neprůhlednost + + + read error + chyba čtení + + + Pattern + Vzor + + + Position + Poloha + + + Pattern Color + Barva vzoru + + + write error + chyba zápisu + + Line Style Způsob kreslení čáry - - - Width - Šířka - - - - - Apply t&o... - Použít n&a... - - - - &Frame - &Rámeček - - - - Fill Color - Barva výplně - - - - Pattern - Vzor - - - - Pattern Color - Barva vzoru - - - - Use &Frame Color - Použít &barvu rámečku - - - - Fill &Pattern - Vzor &výplně - - - - Page - Strana - - - - Layer Scales - Rozměry vrstvy - - - - Attach to - Spojit s - - - - inch - palec - - - - mm - mm - - - - cm - cm - - - - point - bod - - - - pixel - pixel - - - - scale - rozsah - - - - Unit - Jednotka - - - - Position - Poloha - - - - X - - - - - Y - y - - - - Size - Velikost - - - - Height - Výška - - - - &Keep aspect ratio - &Zachovat poměr stran obrazu - - - + Compiling process ended with exit code: %1 + Proces překladu skončil s kódem ukončení: %1 + + + Apply format &to... + Formát použít &na... + + + QtiPlot + QtiPlot + + + Preview: + Náhled: + + + Please verify that you have dvipng installed in the same folder as your LaTeX compiler! + Ověřte, prosím, že máte nainstalován dvipng v té samé složce jako svůj LaTeXový překladač! + + + Auto-&update + Automatická &aktualizace + + + Network connection error + Chyba v připojení k síti + + + LaTeX compile process + LaTeXový překladový proces + + + locally installed + instalováno místně + + + Transparent + Průhledný + + &Best size &Nejlepší velikost - - &Geometry - &Uspořádání - - - - Network connection error - Chyba v připojení k síti - - - - Error while trying to connect to host %1: - Při pokusu o spojení se s hostitelským počítačem %1 došlo k chybě: - - - - Please verify your network connection! - Ověřte, prosím, své síťové spojení! - - - - QtiPlot - Import image from file - QtiPlot - Zavést obrázek ze souboru - - - - QtiPlot - Warning - QtiPlot - Varování - - - + Attach to + Spojit s + + + crashed + spadlo + + + dvipng process + dvipng proces + + + Rectangle + Obdélníkový + + + TeX &Output + Výstup v &TeXu + + The file %1 doesn't exist. The image cannot be restored when reloading the project file! Soubor %1 neexistuje. Obrázek nemůže být při opětovném nahrání projektu obnoven! - MathTran (http://www.mathtran.org/) MathTran (http://www.mathtran.org/) - - locally installed - instalováno místně - - - - LaTeX Compiler - LaTeXový překladač - - - - Compile process ended - Proces překladu dokončen - - - - Compiling process ended with exit code: %1 - Proces překladu skončil s kódem ukončení: %1 - - - - LaTeX compile process - LaTeXový překladový proces - - - - dvipng process - dvipng proces - - - - - failed to start! - nepodařilo se spustit! - - - - Please set the correct path to the compiler in the preferences dialog! - Nastavte, prosím, v dialogu nastavení správnou cestu k překladači! - - - - Please verify that you have dvipng installed in the same folder as your LaTeX compiler! - Ověřte, prosím, že máte nainstalován dvipng v té samé složce jako svůj LaTeXový překladač! - - - - crashed - spadlo - - - - timedout - vypršelo - - - - write error - chyba zápisu - - - - read error - chyba čtení - - - + Rotate (deg.) + Otáčet (stupně) + + + Fill &Pattern + Vzor &výplně + + + Please verify your network connection! + Ověřte, prosím, své síťové spojení! + + unknown error neznámá chyba - + &Geometry + &Uspořádání + + + QtiPlot - Import image from file + QtiPlot - Zavést obrázek ze souboru + + + Set As &Default + Nastavit jako &výchozí + + + Object Properties + Vlastnosti předmětů + + Compile error Chyba překladu + + All Windows + Všechna okna + + + Fill Color + Barva výplně + + + QtiPlot - Warning + QtiPlot - Varování + + + Error while trying to connect to host %1: + Při pokusu o spojení se s hostitelským počítačem %1 došlo k chybě: + ErrDialog - - - Source of errors - Chybové údaje - - - - QtiPlot - Error Bars - QtiPlot - Pruhy s chybami - - - - &X Error Bars - Pruhy s chybami pro &X - - - &Add &Přidat - + Standard Deviation of Data + Obvyklá odchylka v údajích + + + &Close + &Zavřít + + Add Error Bars to - Pruhy s chybami přidat k - - - + Chybové úsečky přidat k + + + Existing column + Stávající sloupec + + Percent of data (%) Procento údajů (%) - - Standard Deviation of Data - Obvyklá odchylka v údajích + &X Error Bars + Chybové úsečky pro &X - &Y Error Bars - Pruhy s chybami pro &Y - - - - &Close - &Zavřít - - - - Existing column - Stávající sloupec + Chybové úsečky pro &Y + + + QtiPlot - Error Bars + QtiPlot - Chybové úsečky + + + Source of errors + Chybové údaje ExpDecayDialog - + &Fit + &Umístění + + + Color + Barva + + + The curve <b> %1 </b> doesn't exist anymore! Operation aborted! + Křivka <b> %1 </b> již více neexistuje! Operace zrušena! + + + &Close + &Zavřít + + + Initial time + Počáteční čas + + + First decay time (t1) + První čas poklesu (t1) + + + Exponential Fit of + Exponenciální umístění + + + Y Offset + Posunutí Y + + + Amplitude + Rozkmit (amplituda) + + + Decay time + Čas poklesu + + QtiPlot - Verify initial guesses QtiPlot - Ověřit počáteční hodnoty - - Exponential Fit of - Exponenciální umístění + Third decay time (t3) + Třetí čas poklesu (t3) - Growth time Růstový čas - - Decay time - Čas poklesu - - - - First decay time (t1) - První čas poklesu (t1) - - - Second decay time (t2) Druhý čas poklesu (t2) - - Third decay time (t3) - Třetí čas poklesu (t3) - - - - Amplitude - Rozkmit (amplituda) - - - - Y Offset - Posunutí Y - - - - Initial time - Počáteční čas - - - - Color - Barva - - - - &Fit - &Umístění - - - - &Close - &Zavřít - - - QtiPlot - Warning QtiPlot - Varování - - - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - Křivka <b> %1 </b> již více neexistuje! Operace zrušena! - ExponentialFit - + ExpDecay1 + Exp. pokles 1 + + ExpGrowth Exp. růst - Exponential growth Exponenciální růst - - amplitude rozkmit - + e-folding time + čas e-skládání + + + offset + posun + + + Exponential decay + Exponenciální pokles + + lifetime životnost - - - - offset - posun - - - - ExpDecay1 - Exp. pokles 1 - - - - Exponential decay - Exponenciální pokles - - - - e-folding time - čas e-skládání - ExportDialog - + TAB + Tabulátor (TAB) + + + &All + &Vše + + + &Help + &Nápověda + + + SPACE + Mezerník (SPACE) + + + Table + Tabulka + + + The separator must not contain the following characters: 0-9eE.+- + Oddělovač sloupců nesmí obsahovat následující znaky: 0-9eE.+- + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + Nelze zapisovat do souboru: <br><h4> %1 </h4><p>Ověřte, prosím, že máte oprávnění pro zápis do tohoto umístění! + + + QtiPlot - Import options error + QtiPlot - Chyba ve volbách pro zavádění + + + QtiPlot - Export error + QtiPlot - Chyba při vyvedení + + QtiPlot - Export ASCII QtiPlot - Vyvést jako soubor ASCII - - Table - Tabulka - - - - &All - &Vše - - - Separator Oddělovač sloupců - - - - - - TAB - Tabulátor (TAB) - - - - - - - - SPACE - Mezerník (SPACE) - - - The column separator can be customized. The following special codes can be used: -\t for a TAB character -\s for a SPACE - Oddělovač sloupců může být uživatelem upraven. Dají se použít následující zvláštní kódy: -\t pro znak TAB (tabulátor) -\s pro SPACE (mezerník) - - - - - - The separator must not contain the following characters: 0-9eE.+- - Oddělovač sloupců nesmí obsahovat následující znaky: 0-9eE.+- - - - + %1 already exists. + + + Include Column &Names Zahrnout názvy &sloupců - + QtiPlot - Help + QtiPlot - Nápověda + + + QtiPlot + QtiPlot + + Include Column Co&mments Zahrnout poznámky ke &sloupcům - Export &Selection Vyvést &výběr - - QtiPlot - Export error - QtiPlot - Chyba při vyvedení - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - Nelze zapisovat do souboru: <br><h4> %1 </h4><p>Ověřte, prosím, že máte oprávnění pro zápis do tohoto umístění! - - - &OK - &OK - - - &Cancel - &Zrušit - - - - &Help - &Nápověda - - - - + Do you want to replace it? + + + + Overwrite file? + + + The column separator can be customized. The following special codes can be used: \t for a TAB character \s for a SPACE - - - - - QtiPlot - Help - QtiPlot - Nápověda - - - - QtiPlot - Import options error - QtiPlot - Chyba ve volbách pro zavádění + ExtensibleFileDialog - << &Advanced << &Rozšířené volby + ExtractDataDialog + + QtiPlot + QtiPlot + + + Extract Data + + + + For row (i) + Pro řádek (i) + + + to + + + + Add function + Přidat funkci + + + Add column + Přidat sloupec + + + &Apply + &Použít + + + Clear &Formulas + Smazat &vzorce + + + &Close + &Zavřít + + + &Put into table + + + + Table + Tabulka + + + Cond&ition: + + + + Add &function + + + + Add co&lumn + + + + Add &operator + + + + Clea&r + Vypráz&dnit + + + FFT - - - - - + s + s + + + Hz + Hz + + + of + z + + FFT FFT - - - Forward - Dopředu - - - - - - - of - z - - - - - - Frequency - Kmitočet - - - - + Real + Skutečný + + + Time + Čas + + + Angle + Úhel + + Inverse Převrácená hodnota - - - - Time - Čas - - - - - Real - Skutečný - - - - - Imaginary - Pomyslná část - - - - - - Amplitude Rozkmit - - - Angle - Úhel - - - - Hz - Hz - - - - s - s + Imaginary + Pomyslná část + + + Frequency + Kmitočet + + + Forward + Dopředu FFTDialog - - QtiPlot - FFT Options - QtiPlot - Volby FFT - - - - &Forward - &Dopředu - - - + &OK + &OK + + + Real + Skutečná část + + + Curve + Křivka + + &Inverse &Převracet - - Curve - Křivka - - - - Sampling - Vzorkování - - - - Real - Skutečná část - - - - Imaginary - Pomyslná část - - - - - Sampling Interval - Vzorkovací rozmezí - - - + &Shift Results + &Přesunout výsledky + + + QtiPlot - Error + QtiPlot - Chyba + + &Normalize Amplitude &Normalizovat rozkmit - - &Shift Results - &Přesunout výsledky - - - - &OK - &OK - - - &Close &Zavřít - - QtiPlot - Error - QtiPlot - Chyba - - - - Please choose a column for the real part of the data! - Vyberte, prosím, sloupec pro skutečnou část dat! - - - - QtiPlot - QtiPlot - - - - The two matrices have different dimensions, the imaginary part will be neglected! - Dvě matice mají různé rozměry. Pomyslná část bude opomenuta! - - - RealMatrixFFT Skutečná matice FFT - + AmplitudeMatrixFFT + Rozkmitová matice FFT + + + Amplitudes of the FFT transform of + Rozkmity FFT přeměnění + + Real part of the FFT transform of Skutečná část FFT přeměnění - + Sampling Interval + Vzorkovací rozmezí + + + QtiPlot - FFT Options + QtiPlot - Volby FFT + + + Imaginary + Pomyslná část + + + Sampling + Vzorkování + + + QtiPlot + QtiPlot + + + Imaginary part of the FFT transform of + Pomyslná část FFT přeměnění + + ImagMatrixFFT Pomyslná matice FFT - - Imaginary part of the FFT transform of - Pomyslná část FFT přeměnění - - - - AmplitudeMatrixFFT - Rozkmitová matice FFT - - - - Amplitudes of the FFT transform of - Rozkmity FFT přeměnění + The two matrices have different dimensions, the imaginary part will be neglected! + Dvě matice mají různé rozměry. Pomyslná část bude opomenuta! + + + &Forward + &Dopředu + + + Please choose a column for the real part of the data! + Vyberte, prosím, sloupec pro skutečnou část dat! FFTFilter - + Hz + Hz + + + to + do + + FFT FFT - Filtered Filtrováno - - - QtiPlot - QtiPlot - - - - Error Chyba - + High Pass FFT Filter + FFT filtr s vysokým průchodem + + Unknown filter type. Valid values are: 1 - Low pass, 2 - High Pass, 3 - Band Pass, 4 - Band block. Neznámý druh filtru: Platnými hodnotami jsou: 1 - s nízkým průchodem, 2 - s vysokým průchodem, 3 - s pásmovým průchodem, 4 - s pásmovou závorou. - + Band Pass FFT Filter + FFT filtr s pásmovým průchodem + + + QtiPlot + QtiPlot + + + Band Block FFT Filter + FFT filtr s pásmovou závorou + + Please enter different values for the band limits. Zadejte, prosím, různé hodnoty pro hranice pásma. - - to - do - - - - Hz - Hz - - - Low Pass FFT Filter FFT filtr s nízkým průchodem - - - High Pass FFT Filter - FFT filtr s vysokým průchodem - - - - Band Pass FFT Filter - FFT filtr s pásmovým průchodem - - - - Band Block FFT Filter - FFT filtr s pásmovou závorou - Filter - - - - - - - QtiPlot - QtiPlot - - - - - - - + of + z + + + Plot + Nákres + + Error Chyba - Please assign a curve first! Nejprve, prosím, přiřaďte křivku! - + Not enough memory, operation aborted! + Není dostatek paměti, a tak byla operace zrušena! + + + The color name '%1' is not valid, a default color (red) will be used instead! + Název barvy '%1' je neplatný. Místo ní bude použita výchozí barva (červená)! + + + You didn't specify a valid data set for this operation! + Pro tuto operaci jste nestanovil platný záznam s údaji! + + Several data points have the same x value causing divisions by zero, operation aborted! Několik datových bodů má stejnou hodnotu x, což způsobuje dělení nulou. Operace byla zrušena! - - - You need at least %1 points in order to perform this operation! - Pro provedení této operace potřebujete alespoň %1 bodů! - - - QtiPlot - Filter Error QtiPlot - Chyba filtru - Please enter a valid curve name! Zadejte, prosím, pro křivku platný název! - + QtiPlot + QtiPlot + + QtiPlot - Color Name Error QtiPlot - Chyba v názvu barvy - - The color name '%1' is not valid, a default color (red) will be used instead! - Název barvy '%1' je neplatný. Místo ní bude použita výchozí barva (červená)! - - - - You didn't specify a valid data set for this operation! - Pro tuto operaci jste nestanovil platný záznam s údaji! - - - - of - z - - - - Plot - Nákres - - - Memory Allocation Error Chyba v přidělení paměti - - Not enough memory, operation aborted! - Není dostatek paměti, a tak byla operace zrušena! + You need at least %1 points in order to perform this operation! + Pro provedení této operace potřebujete alespoň %1 bodů! FilterDialog - - QtiPlot - Filter options - QtiPlot - Volby pro filtr - - - + Color + Barva + + + &Close + &Zavřít + + + Add DC Offset + Přidat DC posunutí + + + Low Frequency (Hz) + Spodní kmitočet (Hz) + + + Please enter frequency limits that satisfy: Low < High ! + Zadejte, prosím, hranice kmitočtu, které vyhoví: Spodní < Horní! + + + Substract DC Offset + Stáhnout DC posunutí + + + &Filter + &Filtr + + Filter curve: Křivka filtru: - Frequency cutoff (Hz) Hodnota náběhu kmitočtu (Hz) - - Low Frequency (Hz) - Spodní kmitočet (Hz) + QtiPlot - Filter options + QtiPlot - Volby pro filtr - High Frequency (Hz) Horní kmitočet (Hz) - - Add DC Offset - Přidat DC posunutí - - - - Substract DC Offset - Stáhnout DC posunutí - - - - - Color - Barva - - - - &Filter - &Filtr - - - - &Close - &Zavřít - - - QtiPlot - Frequency input error QtiPlot - Chyba při zadání kmitočtu - - - Please enter frequency limits that satisfy: Low < High ! - Zadejte, prosím, hranice kmitočtu, které vyhoví: Spodní < Horní! - FindDialog - + Find + Najít + + + &Find + &Najít + + + &Update Start Path + &Aktualizovat počáteční cestu + + + &Close + &Zavřít + + + &Window Names + &Názvy oken + + + Search in + Hledat v + + QtiPlot QtiPlot - - - Find - Najít - - - Start From Začít od - - Search in - Hledat v - - - - &Window Names - &Názvy oken - - - Window &Labels Popisy &oken - - Folder &Names - Názvy &složek - - - Case &Sensitive Rozlišující psaní &velkých a malých písmen - &Partial Match Allowed Hledat také &částečnou shodu - &Include Subfolders &Včetně podsložek - - &Find - &Najít - - - - &Update Start Path - &Aktualizovat počáteční cestu - - - - &Close - &Zavřít + Folder &Names + Názvy &složek FindReplaceDialog - - - - QtiPlot - QtiPlot - - - - Find Najít - - Find and Replace - Najít a nahradit - - - - Replace with - Čím nahradit - - - - &Match case - &Shoda u velikosti písmen - - - + &Next + &Další + + &Whole word &Celé slovo - - &Next - &Další - - - - &Previous - &Předchozí - - - + &Close + &Zavřít + + + The search field is empty. Please enter some text and try again. + Toto vyhledávací pole je prázdné. Zadejte, prosím, nějaký text a zkuste hledání provést znovu. + + + QtiPlot + QtiPlot + + &Replace &Nahradit - + &Previous + &Předchozí + + + &Match case + &Shoda u velikosti písmen + + + Empty Search Field + Prázdné vyhledávací pole + + + QtiPlot has finished searching the document. + QtiPlot dokončil prohledávání dokumentu. + + + Replace with + Čím nahradit + + Replace &all Nahradit &vše - - &Close - &Zavřít - - - - - - Empty Search Field - Prázdné vyhledávací pole - - - - - - The search field is empty. Please enter some text and try again. - Toto vyhledávací pole je prázdné. Zadejte, prosím, nějaký text a zkuste hledání provést znovu. - - - - QtiPlot has finished searching the document. - QtiPlot dokončil prohledávání dokumentu. + Find and Replace + Najít a nahradit Fit - + Fit + Umístění + + + LCL + LCL + + + LPL + LPL + + + R^2 + R^2 + + + UCL + UCL + + + UPL + UPL + + Plot Nákres - - graphics display disabled - zobrazení grafiky zakázáno - - - - of dataset - záznamu s údaji - - - + to x + do x + + + Upper %1 Confidence Limit + Horní mezní hodnota důvěry %1 + + + Error + Chyba + + + Value + Hodnota + + + FitStats + Statistiky umístění + + + You cannot use the instrumental weighting method. + Nemůžete použít nástrojový způsob statistického zvážení. + + + Statistical + Statistický + + + Lower %1 Confidence Limit + Dolní mezní hodnota důvěry %1 + + + QtiPlot - Error + QtiPlot - Chyba + + + Arbitrary Dataset + Libovolný záznam s údaji + + + RSS (Residual Sum of Squares) + RSS (Residual Sum of Squares) + + + Not enough memory! + Nedostatek paměťi! + + + Lower %1 Prediction Limit + Dolní mezní hodnota předpovědi %1 + + using function za použití funkce - - Weighting Method - Způsob zvážení - - - - No weighting - Žádné zvážení - - - - Instrumental - Nástrojový - - - - using error bars dataset - za použití souboru dat chybových pruhů - - - - Statistical - Statistický - - - - Arbitrary Dataset - Libovolný záznam s údaji - - - - Direct Weighting using Dataset - Přímé zvážení za použití záznamu s údaji - - - - Nelder-Mead Simplex - Simplexní Nelder-Mead - - - - Unscaled Levenberg-Marquardt - Levenberg-Marquardt nezařazený do stupnice - - - - Scaled Levenberg-Marquardt - Levenberg-Marquardt zařazený do stupnice - - - algorithm with tolerance = Algoritmus s povolenou odchylkou = - + Could not allocate enough memory for the fit curves! + Nepodařilo se přidělit dost paměti, operace zrušena! + + + The curve %1 has no associated Y error bars. You cannot use instrumental weighting method. + Křivka %1 není spojena s žádnými Y chybovými úsečkam. Nemůžete použít nástrojový způsob statistického zvážení. + + + graphics display disabled + zobrazení grafiky zakázáno + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + Nelze zapisovat do souboru: <br><h4> %1 </h4><p>Ověřte, prosím, že máte oprávnění pro zápis do tohoto umístění! + + From x Od x - - to x - do x - - - - - R^2 - R^2 - - - - Adjusted R^2 - Upravený R^2 - - - + QtiPlot - Memory Allocation Error + QtiPlot - Chyba v přidělení paměti + + + File Save Error + Chyba při ukládání souboru + + + QtiPlot Fit Model + QtiPlot - Model umístění + + + Status + Stav + + + Independent Variable + Nezávislá proměnná + + RMSE (Root Mean Squared Error) RMSE (Root Mean Squared Error) - - RSS (Residual Sum of Squares) - RSS (Residual Sum of Squares) - - - - Iterations - Iterace (opakování) - - - - Status - Stav - - - - Dataset - Záznam s údaji - - - - Function - Funkce - - - - - - - QtiPlot - Error - QtiPlot - Chyba - - - - You cannot use the instrumental weighting method. - Nemůžete použít nástrojový způsob statistického zvážení. - - - - The curve %1 has no associated Y error bars. You cannot use instrumental weighting method. - Křivka %1 není spojena s žádnými Y chybovými pruhy. Nemůžete použít nástrojový způsob statistického zvážení. - - - - The column %1 has less points than the fitted data set. Please choose another column! - - - - - The column %1 has less points than the fitted data set. Please choose another column!. - Sloupec %1 má méně bodů než záznam s údaji o umístění. Vyberte, prosím, jiný sloupec! - - - - Parameter - Parametr - - - - Value - Hodnota - - - - Error - Chyba - - - - - - - - - - QtiPlot - Fit Error - QtiPlot - Chyba při umístění - - - - - + You didn't specify a valid data set for this fit operation. Operation aborted! + Nestanovil jste platný záznam s údaji pro operaci umístění. Operace zrušena! + + Please perform a fit first! Proveďte, prosím, nejprve umístění! - - FitResiduals - Zbytkové chyby umístění - - - - Residuals of %1 - Zbytky %1 - - - + Parameter + Parametr + + + Iterations + Iterace (opakování) + + + QtiPlot + QtiPlot + + residue Zbytek - - - - - - - - QtiPlot - Memory Allocation Error - QtiPlot - Chyba v přidělení paměti - - - - - - - - - Not enough memory! - Nedostatek paměťi! - - - - - FitStats - Statistiky umístění - - - + QtiPlot - Fit Error + QtiPlot - Chyba při umístění + + + You need at least %1 data points for this fit operation. Operation aborted! + Pro tuto operaci umístění potřebujete alespoň %1 datových bodů! Operace zrušena! + + Confidence Limits of %1 Mezní hodnoty důvěry %1 - - - Independent Variable - Nezávislá proměnná - - - - LCL - LCL - - - - Lower %1 Confidence Limit - Dolní mezní hodnota důvěry %1 - - - - UCL - UCL - - - - Upper %1 Confidence Limit - Horní mezní hodnota důvěry %1 - - - Prediction Limits of %1 Mezní hodnoty předpovědi %1 - - LPL - LPL - - - - Lower %1 Prediction Limit - Dolní mezní hodnota předpovědi %1 - - - - UPL - UPL - - - - Upper %1 Prediction Limit - Horní mezní hodnota předpovědi %1 - - - - You didn't specify a valid data set for this fit operation. Operation aborted! - Nestanovil jste platný záznam s údaji pro operaci umístění. Operace zrušena! - - - There are no parameters specified for this fit operation. Operation aborted! Pro tuto operaci umístění nejsou stanoveny žádné parametry. Operace zrušena! - - You need at least %1 data points for this fit operation. Operation aborted! - Pro tuto operaci umístění potřebujete alespoň %1 datových bodů! Operace zrušena! + The column %1 has less points than the fitted data set. Please choose another column! + - You must specify a valid fit function first. Operation aborted! Nejprve musíte stanovit platnou funkci umístění. Operace zrušena! - - - Could not allocate enough memory for the fit curves! - Nepodařilo se přidělit dost paměti, operace zrušena! - - - - QtiPlot - Memory Allocation Error - QtiPlot - Chyba v přidělení paměti - - - - Fit - Umístění - - - - QtiPlot - QtiPlot - - - - File Save Error - Chyba při ukládání souboru - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - Nelze zapisovat do souboru: <br><h4> %1 </h4><p>Ověřte, prosím, že máte oprávnění pro zápis do tohoto umístění! - - - - QtiPlot Fit Model - QtiPlot - Model umístění - - - + Dataset + Záznam s údaji + + + of dataset + záznamu s údaji + + + No weighting + Žádné zvážení + + + Weighting Method + Způsob zvážení + + + Direct Weighting using Dataset + Přímé zvážení za použití záznamu s údaji + + + Function + Funkce + + Cannot read file %1: %2. Nelze přečíst soubor %1: %2. + + Residuals of %1 + Zbytky %1 + + + using error bars dataset + za použití souboru dat chybových úseček + + + QtiPlot - Memory Allocation Error + QtiPlot - Chyba v přidělení paměti + + + FitResiduals + Zbytkové chyby umístění + + + Scaled Levenberg-Marquardt + Levenberg-Marquardt zařazený do stupnice + + + Unscaled Levenberg-Marquardt + Levenberg-Marquardt nezařazený do stupnice + + + Adjusted R^2 + Upravený R^2 + + + Upper %1 Prediction Limit + Horní mezní hodnota předpovědi %1 + + + Nelder-Mead Simplex + Simplexní Nelder-Mead + + + Instrumental + Nástrojový + FitDialog - - QtiPlot - Fit Wizard - QtiPlot - Průvodce umístěním - - - - Curve - Křivka - - - - - Function - Funkce - - - - Initial guesses - Počáteční odhadní hodnoty - - - - - &Save - &Uložit - - - - &Preview - &Náhled - - - - Parameter - Parametr - - - - From - Od - - - - Value - Hodnota - - - To Do - - Constant - Stálá hodnota - - - - Error - Chyba - - - - Algorithm - Algoritmus - - - - Scaled Levenberg-Marquardt - Škálovaný Levenberg-Marquardt - - - - Unscaled Levenberg-Marquardt - Neškálovaný Levenberg-Marquardt - - - - Nelder-Mead Simplex - Simplexní Nelder-Mead - - - - Color - Barva - - - - From x= - Od x= - - - - To x= - Do x= - - - - Iterations - Iterace (opakování) - - - - Tolerance - Dovolená odchylka - - - - Weighting Method - Způsob zvážení - - - - No weighting - Žádné zvážení - - - - Instrumental - Nástrojové - - - - Statistical - Statistické - - - - Arbitrary Dataset - Libovolný záznam s údaji - - - - Direct Weighting - Přímé statistické zvážení - - - << &Edit function - << &Upravit funkci - - - - &Delete Fit Curves - &Smazat křivky umístění - - - &Fit &Umístit - - - - &Close - &Zavřít - - - Custom &Output >> - Vlastní &výstup >> - - - - Category - Skupina - - - - Expression - Výraz - - - - User defined - Stanoveno uživatelem - - - - Built-in - Vestavěno - - - + From + Od + + + Name + Název + + + Please enter a valid function! + Zadejte, prosím, platnou funkci! + + + &Save + &Uložit + + Basic Základní - - Plugins - Přídavné moduly - - - - Fit with &built-in function - Umístění s &vestavěnou funkcí - - - - - Polynomial Order - Řád mnohočlenů - - - - + Color + Barva + + + Curve + Křivka + + + Error + Chyba + + + Gauss + Gauss + + + Polynomial + Mnohočlenný + + + Peaks + Vrcholy + + + To x= + Do x= + + + Value + Hodnota + + Choose plug&ins folder... &Vybrat složku pro přídavné moduly... - - Name - Název + Fit using &built-in function + Umístit s pomocí &vestavěné funkce - user1 Uživatel1 - - - Parameters - Parametry - - - - &Remove - &Odstranit - - - - Add &expression - Přidat &výraz - - - - Add &name - Přidat &název - - - - Rese&t - &Znovu nastavit - - - &Fit >> - &Umístit >> - - - - &Uniform X Function - &Jednotná funkce X - - - - Points - Body - - - - Same X as Fitting &Data - Stejné hodnoty X jako &data umístění - - - - Generated Fit Curve - Vytvořená křivka umístění - - - - Significant Digits - Statisticky významná desetinná místa - - - + Remove Fit Model + Odstranit model umístění + + + The curve <b> %1 </b> doesn't exist anymore! Operation aborted! + Křivka <b> %1 </b> již více neexistuje! Operace zrušena! + + + Statistical + Statistické + + + Save Fit Model As + Uložit model umístění jako + + Parameters &Table &Tabulka parametrů - - - Name: - Název: - - - + Generated Fit Curve + Vytvořená křivka umístění + + + QtiPlot - Error + QtiPlot - Chyba + + + Arbitrary Dataset + Libovolný záznam s údaji + + + Please perform a fit first and try again. + Proveďte, prosím, nejprve umístění a pak to zkuste znovu. + + + You can't define functions recursively! + Funkce nemůžete stanovit rekurzivně! + + + Fitting Session + + + + Are you sure you want to remove fit model file: + %1 ? + Jste si jist, že chcete odstranit soubor s modelem umístění: + %1? + + + &Apply + &Použít + + + &Close + &Zavřít + + + &Guess + &Určit + + + &Range + + + + Tolerance + Dovolená odchylka + + + Covariance &Matrix + Matice &kovariance + + + &Write Parameters to Result Log + &Zapsat parametry do zápisu s výsledky + + + Lorentz + Lorentz + + &One table for all fits &Jedna tabulka pro všechna umístění - - Covariance &Matrix - Matice &kovariance - - - - CovMatrix - Matice kovariance - - - + QtiPlot - Error: function name + QtiPlot - Chyba: název funkce + + + Same X as Fitting &Data + Stejné hodnoty X jako &data umístění + + + Direct Weighting + Přímé statistické zvážení + + + Choose the fit models folder + Vybrat složku pro model umístění + + Co&nf. Bands Co&nf. pruhy - + Name: + Název: + + + Fit using &plugin function + Umístit s pomocí &funkce přídavného modulu + + + QtiPlot fit model + Model umístění v QtiPlotu + + + Points + Body + + + Rese&t + &Znovu nastavit + + + Add &name + Přidat &název + + + Constant + Stálá hodnota + + + Please enter a valid name for the covariance matrix. + Zadejte, prosím, platný název pro matici kovariance. + + + Please enter x limits that satisfy: from < end! + Zadejte, prosím, rozsah x, který vyhoví: Začátek < Konec! + + + No data tables + Žádné tabulky s daty + + + Plugins + Přídavné moduly + + + QtiPlot - Input error + QtiPlot - Chyba při zadání + + + &Preview + &Náhled + + Pred. &Bands Pred. &pruhy - - &Residuals Plot - Nákres &zbytků - - - + Parameters + Parametry + + + Fit with selected &user function + Umístit s &uživatelem stanovenou funkcí + + + is a built-in function name<p>You must choose another name for your function! + je názvem vestavěné funkce<p>Pro svou funkci musíte vybrat jiný název! + + + Re&load + + + + Parameter + Parametr + + + Iterations + Iterace (opakování) + + + Data Set + + + + Category + Skupina + + + QtiPlot + QtiPlot + + + Expression + Výraz + + + Parameters Output + Výstup parametrů + + + &Uniform X Function + &Jednotná funkce X + + + &Paste Parameters to Plot + &Vložit parametry do nákresu + + + Fit with &built-in function + Umístění s &vestavěnou funkcí + + + Please verify that you have initialized all the parameters! + Ověřte, prosím, že jste inicializoval všechny parametry! + + &Scale Errors with sqrt(Chi^2/doF) &Zařazovat do stupnice hodnoty chyb s (kořenem) sqrt(Chi^2/doF) - - Parameters Output - Výstup parametrů - - - - &Write Parameters to Result Log - &Zapsat parametry do zápisu s výsledky - - - - &Paste Parameters to Plot - &Vložit parametry do nákresu - - - << &Fit - << &Umístit - - - - - + No weighting + Žádné zvážení + + Select Function - - - - - - - - Fitting Session - - - - - - - Custom Output - - - - + + + Start Fitting Session - - - - - &Apply - &Použít - - - - - - - - - - QtiPlot - Error - QtiPlot - Chyba - - - - Please enter a valid name for the parameters table. - Zadejte, prosím, platný název pro tabulku parametrů. - - - - - - - - Please perform a fit first and try again. - Proveďte, prosím, nejprve umístění a pak to zkuste znovu. - - - - Please enter a valid name for the covariance matrix. - Zadejte, prosím, platný název pro matici kovariance. - - - - - - - - QtiPlot - Input function error - QtiPlot - Chyba při zadání funkce - - - - - Please enter a valid function! - Zadejte, prosím, platnou funkci! - - - - Please enter a function name! - Zadejte, prosím, název funkce! - - - - QtiPlot - Error: function name - QtiPlot - Chyba: název funkce - - - - is a built-in function name<p>You must choose another name for your function! - je názvem vestavěné funkce<p>Pro svou funkci musíte vybrat jiný název! - - - - You can't define functions recursively! - Funkce nemůžete stanovit rekurzivně! - - - - - QtiPlot fit model - Model umístění v QtiPlotu - - - - - All files - Všechny soubory - - - - - - QtiPlot - QtiPlot - - - - - Save Fit Model As - Uložit model umístění jako - - - - Are you sure you want to remove fit model file: - %1 ? - Jste si jist, že chcete odstranit soubor s modelem umístění: - %1? - - - - Remove Fit Model - Odstranit model umístění - - - + + + Choose &models folder... &Vybrat složku &pro model... - - Fit with selected &user function - Umístit s &uživatelem stanovenou funkcí - - - - Fit using &built-in function - Umístit s pomocí &vestavěné funkce - - - - Fit using &plugin function - Umístit s pomocí &funkce přídavného modulu - - - Choose the plugins folder Vybrat složku pro přídavné moduly - - Choose the fit models folder - Vybrat složku pro model umístění - - - - - Gauss - Gauss - - - - - Lorentz - Lorentz - - - - Peaks - Vrcholy - - - - - Polynomial - Mnohočlenný - - - - QtiPlot - Warning - QtiPlot - Varování - - - - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - Křivka <b> %1 </b> již více neexistuje! Operace zrušena! - - - - QtiPlot - Input error - QtiPlot - Chyba při zadání - - - - Please enter x limits that satisfy: from < end! - Zadejte, prosím, rozsah x, který vyhoví: Začátek < Konec! - - - - Please verify that you have initialized all the parameters! - Ověřte, prosím, že jste inicializoval všechny parametry! - - - - - No data tables - Žádné tabulky s daty - - - + CovMatrix + Matice kovariance + + + &Remove + &Odstranit + + + Built-in + Vestavěno + + + Function + Funkce + + + &Delete Fit Curves + &Smazat křivky umístění + + Error: Chyba: + + From x= + Od x= + + + Significant Digits + Statisticky významná desetinná místa + + + QtiPlot - Fit Wizard + QtiPlot - Průvodce umístěním + + + Initial guesses + Počáteční odhadní hodnoty + + + Polynomial Order + Řád mnohočlenů + + + Scaled Levenberg-Marquardt + Škálovaný Levenberg-Marquardt + + + Unscaled Levenberg-Marquardt + Neškálovaný Levenberg-Marquardt + + + Algorithm + Algoritmus + + + All files + Všechny soubory + + + QtiPlot - Input function error + QtiPlot - Chyba při zadání funkce + + + QtiPlot - Warning + QtiPlot - Varování + + + Please enter a valid name for the parameters table. + Zadejte, prosím, platný název pro tabulku parametrů. + + + Add &expression + Přidat &výraz + + + Nelder-Mead Simplex + Simplexní Nelder-Mead + + + Instrumental + Nástrojové + + + Please enter a function name! + Zadejte, prosím, název funkce! + + + User defined + Stanoveno uživatelem + + + Custom Output + + + + &Residuals Plot + Nákres &zbytků + + + Weighting + + Folder - kB kB - bytes byty @@ -10808,916 +7855,777 @@ FrequencyCountDialog - - QtiPlot - Frequency count - QtiPlot - Počet kmitočtů - - - - Statistics on %1 - Statistické údaje pro %1 - - - + &Ok + &OK + + + Sum + Součet + + Mean Průměr - - Standard Deviation - Obvyklá odchylka - - - - Median - Střední hodnota - - - Size Velikost - - From Minimum - Od nejmenší hodnoty - - - - To Maximum - Po největší hodnotu - - - - Step Size - Velikost kroku - - - - &Apply - &Použít - - - - &Cancel - &Zrušit - - - - &Ok - &OK - - - - QtiPlot - Error - QtiPlot - Chyba - - - - Not enough data points, operation aborted! - Není dostatek datových bodů, a tak byla operace zrušena! - - - - QtiPlot - Frequency input error - QtiPlot - Chyba u vstupu kmitočtu - - - - Please enter frequency limits that satisfy: From < To ! - Zadejte, prosím, mezní hodnoty kmitočtu, které vyhoví: Od < Po! - - - - Count Počet - + QtiPlot - Error + QtiPlot - Chyba + + Frequency count of %1 Počítání kmitočtu %1 - + Standard Deviation + Obvyklá odchylka + + + &Apply + &Použít + + + To Maximum + Po největší hodnotu + + BinCtr BinCtr - BinEnd BinEnd - - Sum - Součet + Median + Střední hodnota + + + From Minimum + Od nejmenší hodnoty + + + QtiPlot - Frequency count + QtiPlot - Počet kmitočtů + + + &Cancel + &Zrušit + + + Step Size + Velikost kroku + + + Statistics on %1 + Statistické údaje pro %1 + + + Please enter frequency limits that satisfy: From < To ! + Zadejte, prosím, mezní hodnoty kmitočtu, které vyhoví: Od < Po! + + + QtiPlot - Frequency input error + QtiPlot - Chyba u vstupu kmitočtu + + + Not enough data points, operation aborted! + Není dostatek datových bodů, a tak byla operace zrušena! FunctionDialog - - QtiPlot - Add function curve - QtiPlot - Přidat křivku funkce - - - + To + Do + + + &Ok + &OK + + + R = + R = + + + From + Od + + + x = + x = + + + y = + + + + Value + Hodnota + + + Clea&r Function + &Smazat funkci + + + &Add Function + Přidat &funkci + + + &Close + &Zavřít + + + Points + Body + + + To x= + Do x= + + + Constant + Stálá hodnota (konstanta) + + + f(x)= + f(x)= + + + Please enter x limits that satisfy: from < end! + Zadejte, prosím, rozsah x, který vyhoví: Začátek < Konec! + + Curve type Druh křivky - - Function - Funkce + QtiPlot - Input error + QtiPlot - Chyba při zadání - Parametric plot Parametrický nákres - + Please, choose a function: + + + Polar plot Nákres s polárními souřadnicemi - - f(x)= - f(x)= - - - + Parameter + Parametr + + + QtiPlot + QtiPlot + + + Rece&nt + + + + Recent Functions + + + From x= Od x= - - To x= - Do x= - - - - - - Points - Body - - - - Constant - Stálá hodnota (konstanta) - - - - Value - Hodnota - - - - - Parameter - Parametr - - - - - From - Od - - - - - To - Do - - - - x = - x = - - - - y = + QtiPlot - Add function curve + QtiPlot - Přidat křivku funkce + + + Click here to select a recently typed expression - - R = - R = - - - Theta = Théta = - - Clea&r Function - &Smazat funkci - - - - &Ok - &OK - - - - &Close - &Zavřít - - - - Clear list - Vyprázdnit seznam - - - - Clear Function - Smazat funkci - - - - - - QtiPlot - Input error - QtiPlot - Chyba při zadání - - - - Please enter x limits that satisfy: from < end! - Zadejte, prosím, rozsah x, který vyhoví: Začátek < Konec! - - - - - - - - QtiPlot - Input function error - QtiPlot - Chyba při zadání funkce - - - - - QtiPlot - Start limit error - QtiPlot - Chyba počáteční hranice - - - - - QtiPlot - End limit error - QtiPlot - Chyba koncové hranice - - - - Please enter parameter limits that satisfy: from < end! Zadejte, prosím, parametrický rozsah, který vyhoví: Začátek < Konec! - - &Add Function - Přidat &funkci + Function + Funkce + + + QtiPlot - Input function error + QtiPlot - Chyba při zadání funkce + + + Sorry, there are no recent expressions available! + GaussAmpFit - + width + šířka + + + GaussAmp Fit + Umístění GaussAmp + + + center + střed + + + amplitude + rozkmit + + + offset + posun + + GaussAmp GaussAmp - - - offset - posun - - - - amplitude - rozkmit - - - - center - střed - - - - width - šířka - - - - GaussAmp Fit - Umístění GaussAmp - GaussFit - + area + oblast + + Gauss Gauss - - Gauss Fit - Gaussovo umístění - - - - area - oblast - - - + width + šířka + + center střed - - width - šířka - - - offset posun + + Gauss Fit + Gaussovo umístění + Graph - - Y Axis Title - Název osy y - - - - X Axis Title - Název osy x - - - - - - - - - QtiPlot - Error - QtiPlot - Chyba - - - - + F + F + + + Cu&t + Vyj&mout + + Couldn't change the axis type to the requested format! Nepodařilo se změnit typ osy na požadovaný formát! - - - Please provide a valid file name! - Zadejte, prosím, platný název souboru! - - - - File format not handled, operation aborted! - Tento souborový formát se nepodařilo zpracovat. Operace byla zrušena! - - - + &Copy + &Kopírovat + + + Title + Název + + layer vrstva - - Title - Název - - - - QtiPlot - File open error - QtiPlot - Chyba při otevírání souboru - - - + Y Axis Title + Název osy y + + + X Axis Title + Název osy x + + + QtiPlot - Error + QtiPlot - Chyba + + + There are no curves available on this plot! + V tomto nákresu nejsou žádné křivky! + + + &Rescale to show all + &Změnit měřítko pohledu na Ukázat vše + + + File format not handled, operation aborted! + Tento souborový formát se nepodařilo zpracovat. Operace byla zrušena! + + + C&lear + Vypráz&dnit + + + The column + Sloupec + + Image file: <p><b> %1 </b><p>does not exist anymore! Soubor s obrázkem: <p><b> %1 </b><p> již neexistuje! - + are empty and will not be added to the plot! + jsou prázdné a nebudou do nákresu přidány! + + + There are no curves with more than two points on this plot. Operation aborted! + V tomto nákresu nejsou žádné křivky, které by měly více než dva body. Operace zrušena! + + + &Show grids + &Ukázat mřížky + + + &Scale... + &Stupnice... + + Data set generated from curve Záznam s údaji vytvořený z křivky - - Table - Tabulka - - - - - - QtiPlot - Warning - QtiPlot - Varování - - - The columns Sloupce - - are empty and will not be added to the plot! - jsou prázdné a nebudou do nákresu přidány! - - - - The column - Sloupec - - - + &Hide axis + &Skrýt osu + + + &Delete + &Smazat + + + Please provide a valid file name! + Zadejte, prosím, platný název souboru! + + + QtiPlot - File open error + QtiPlot - Chyba při otevírání souboru + + + Ctrl+Shift+R + Ctrl+Shift+R + + + &Properties... + &Vlastnosti... + + is empty and will not be added to the plot! je prázdný a nebude do nákresu přidán! - - - Cu&t - Vyj&mout - - - - - &Copy - &Kopírovat - - - - - C&lear - Vypráz&dnit - - - - - &Delete - &Smazat - - - - - - &Properties... - &Vlastnosti... - - - - &Rescale to show all - &Změnit měřítko pohledu na Ukázat vše - - - - Ctrl+Shift+R - Ctrl+Shift+R - - - - &Hide axis - &Skrýt osu - - - - &Show grids - &Ukázat mřížky - - - - &Scale... - &Stupnice... - - - - There are no curves available on this plot! - V tomto nákresu nejsou žádné křivky! - - - - There are no curves with more than two points on this plot. Operation aborted! - V tomto nákresu nejsou žádné křivky, které by měly více než dva body. Operace zrušena! - - - - F - F + QtiPlot - Warning + QtiPlot - Varování Graph3D - + QtiPlot - Error + QtiPlot - Chyba + + + File format not handled, operation aborted! + Tento souborový formát se nepodařilo zpracovat. Operace byla zrušena! + + X axis Osa x - Y axis Osa y - Z axis Osa z - - - - QtiPlot - Error - QtiPlot - Chyba - - - - Please provide a valid file name! Poskytněte, prosím, platný název souboru! - - - File format not handled, operation aborted! - Tento souborový formát se nepodařilo zpracovat. Operace byla zrušena! - ImageExportDialog - - QtiPlot - Choose a filename to save under - QtiPlot - Vybrat název souboru pro uložení - - - - Resolution (DPI) - Rozlišení (DPI) - - - &Export in &color - Vyvést v &barvě - - - - Export 3D texts as - Vyvést trojrozměrné texty jako - - - + cm + cm + + + mm + mm + + + Unit + Jednotka + + + inch + palec + + Bitmap images Bitmapové obrázky - + Width + Šířka + + + pixel + pixel + + + point + bod + + + &Escape special characters in texts + + + + Custom print size + Vlastní velikost tisku + + + Save transparency + Uložit průhlednost + + + Print Resolution (DPI) + Rozlišení tisku (DPI) + + Native fonts Původní písma - - LaTeX file - Soubor LaTeXu - - - - 3D Sort mode - Režim trojrozměrného třídění - - - - No sort - Žádné třídění - - - Simple sort Jednoduché třídění - - BSP sort - BSP třídění - - - - Image quality - Kvalita obrázku - - - - Save transparency - Uložit průhlednost - - - - Custom print size - Vlastní velikost tisku - - - - inch - palec - - - - mm - mm - - - - cm - cm - - - - point - bod - - - - pixel - pixel - - - - Unit - Jednotka - - - - Width - Šířka - - - - Height - Výška - - - &Keep aspect ratio &Zachovat poměr stran obrazu - - Print Resolution (DPI) - Rozlišení tisku (DPI) + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + Nelze zapisovat do souboru: <br><h4> %1 </h4><p>Ověřte, prosím, že máte oprávnění pro zápis do tohoto umístění! - Export in &color Vyvést v &barvě - - &Escape special characters in title/axis labels - &Vyhnout se zvláštním znakům v názvu/popisech os - - - Export &font sizes Vyvést velikosti &písem - + Height + Výška + + + QtiPlot - Choose a filename to save under + QtiPlot - Vybrat název souboru pro uložení + + + No sort + Žádné třídění + + + QtiPlot - Export error + QtiPlot - Chyba při vyvedení + + Scale Fonts Factor Faktor změny velikosti písem - + Resolution (DPI) + Rozlišení (DPI) + + + %1 already exists. + + + + BSP sort + BSP třídění + + + Image quality + Kvalita obrázku + + + QtiPlot + QtiPlot + + + 3D Sort mode + Režim trojrozměrného třídění + + + LaTeX file + Soubor LaTeXu + + Automatic Automaticky + + Do you want to replace it? + + + + Overwrite file? + + + + Export 3D texts as + Vyvést trojrozměrné texty jako + + + + ImageProfilesTool + + x + x + + + y + y + + + Position + Poloha + + + Z-Value + + ImageWidget - - QtiPlot - File openning error QtiPlot - Chyba při otevírání souboru - + You don't have the permission to open this file: <b>%1</b> + Pro otevření tohoto souboru nemáte oprávnění: <b>%1</b> + + The file: <b>%1</b> doesn't exist! Soubor: <b>%1</b> neexistuje! - - - You don't have the permission to open this file: <b>%1</b> - Pro otevření tohoto souboru nemáte oprávnění: <b>%1</b> - ImportASCIIDialog - - QtiPlot - Import ASCII File(s) - QtiPlot - Zavést ASCII soubor(y) - - - - All files - Všechny soubory - - - - Text files - Textové soubory - - - - Data files - Datové soubory - - - - Comma Separated Values - Hodnoty oddělené čárkou - - - - Import each file as: - Zavést každý soubor jako: - - - - - New Table - Nová tabulka - - - - - New Matrice - Nová matice - - - - New Columns - Nové sloupce - - - - New Rows - Nové řádky - - - - Overwrite Current Window - Přepsat současné okno - - - - Separator: - Oddělovač: - - - - - - - + All + Vše + + TAB TABULÁTOR (TAB) - - - - + QtiPlot - File openning error + QtiPlot - Chyba při otevírání souboru + + + &Help + &Nápověda + + SPACE MEZERNÍK (SPACE) - - The column separator can be customized. -The following special codes can be used: -\t for a TAB character -\s for a SPACE - - - - - The separator must not contain the following characters: -0-9eE.+- - - - - - By checking this option all white spaces will be -removed from the beginning and the end of -the lines in the ASCII file. - when translating this check the what's this functions and tool tips to place the '\n's correctly - - - - - Warning: checking this option leads to column -overlaping if the columns in the ASCII file don't -have the same number of rows. - - - - - - To avoid this problem you should precisely -define the column separator using TAB and -SPACE characters. - when translating this check the what's this functions and tool tips to place the '\n's correctly - - - - - By checking this option all white spaces will be -removed from the beginning and the end of the -lines and each sequence of internal -whitespaces (including the TAB character) will -be replaced with a single space. - when translating this check the what's this functions and tool tips to place the '\n's correctly - - - - - Warning: checking this option leads to column -overlaping if the columns in the ASCII file don't -have the same number of rows. - when translating this check the what's this functions and tool tips to place the '\n's correctly - - - - - The column separator can be customized. The following special codes can be used: -\t for a TAB character -\s for a SPACE - - - - The column separator can be customized. -The following special codes can be used: -\t for a TAB character -\s for a SPACE - Oddělovač sloupců může být vlastní. -Dají se použít následující zvláštní kódy: -\t pro znak TABULÁTORU -\s pro MEZERNÍK - - - The separator must not contain the following characters: -0-9eE.+- - Oddělovač sloupců nesmí obsahovat následující znaky: -0-9eE.+- - - - - Ignore first - Nevšímat si prvních - - - lines řádků - + Use second row as &comments + Použít druhý řádek jako po&známky + + + The separator must not contain the following characters: 0-9eE.+- + Oddělovač sloupců nesmí obsahovat následující znaky: 0-9eE.+- + + + By checking this option each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. + Zaškrtnutím této volby budou všechny mezery mezi sloupci (včetně znaku pro TABULÁTOR) nahrazeny jednoduchou mezerou. + + + Warning: using these two last options leads to column overlaping if the columns in the ASCII file don't have the same number of rows. + Varování: použití těchto dvou posledních voleb vede k překrývání sloupců, jestliže sloupce v ASCII souboru nemají stejný počet řádků. + + + Import each file as: + Zavést každý soubor jako: + + Ignore lines starting with Nevšímat si řádků začínajících na - Use first row to &name columns - Pro &pojmenování sloupců použít záznam v prvním řádku - - - + LF (Unix) + LF (Unix) + + + You don't have the permission to open this file: <b>%1</b> + Pro otevření tohoto souboru nemáte oprávnění: <b>%1</b> + + + Data files + Datové soubory + + + Ignore first + Nevšímat si prvních + + + New Matrice + Nová matice + + + &Simplify white spaces + &Zjednodušit mezery + + + Simplify white spaces + Zjednodušit mezery + + + CR (Mac) + CR (Mac) + + + Column Names + Názvy sloupců + + + New Matrix + + + Use first row &as Použít první řádek &jako - - Column Names - Názvy sloupců - - - + Text files + Textové soubory + + + System Locale Setting + Místní nastavení systému + + + Overwrite Current Window + Přepsat současné okno + + Column Comments Poznámky ke sloupcům - - Use second row as &comments - Použít druhý řádek jako po&známky - - - + QtiPlot - Help + QtiPlot - Nápověda + + + Endline character + Znak pro konec řádku + + + Separator: + Oddělovač: + + + CRLF (Windows) + CRLF (Windows) + + + New Table + Nová tabulka + + + New Columns + Nové sloupce + + + By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. + Zaškrtnutím této volby budou všechny mezery ze začátků a konců řádků odstraněny a všechny mezery mezi sloupci (včetně znaku pro TABULÁTOR) budou nahrazeny jednoduchou mezerou. + + + Import as &read-only + Zavést jako &pouze pro čtení + + + Decimal Separators + Oddělovače desetinných míst + + + To avoid this problem you should precisely define the column separator using TAB and SPACE characters. + Abyste se vyhnul tomuto problému, měl byste přesně určit oddělovač sloupců s pomocí znaků pro TAB(ULÁTOR) a MEZERU. + + + By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. + Zaškrtnutím této volby budou všechny mezery odstraněny ze začátků a konců řádků v ASCII souboru. + + + New Rows + Nové řádky + + + QtiPlot - Import ASCII File(s) + QtiPlot - Zavést ASCII soubor(y) + + + All files + Všechny soubory + + + Comma Separated Values + Hodnoty oddělené čárkou + + + Omit &thousands separator + Vynechat oddělovač míst (&tisíce) + + + Remove white spaces from line ends + Z konců řádků odstranit mezery + + + &Preview Lines + &Náhled řádků + + &Remove white spaces from line ends Z konců řádků &odstranit mezery @@ -11731,26 +8639,13 @@ v ASCII souboru. - Warning: checking this option leads to column -overlaping if the columns in the ASCII file don't -have the same number of rows. - Varování: zaškrtnutí této volby vede k překrývání -sloupců, jestliže sloupce v ASCII souboru nemají -stejný počet řádků. - - To avoid this problem you should precisely define the column separator using TAB and SPACE characters. when translating this check the what's this functions and tool tips to place the '\n's correctly Abyste se vyhnul tomuto problému, měl byste přesně určit oddělovač sloupců s pomocí znaků -pro TAB(ULÁTOR) a MEZERNÍK. - - - - &Simplify white spaces - &Zjednodušit mezery +pro TAB(ULÁTOR) a MEZERU. By checking this option all white spaces will be @@ -11766,353 +8661,236 @@ jednoduchou mezerou. - Warning: checking this option leads to column -overlaping if the columns in the ASCII file don't -have the same number of rows. - when translating this check the what's this functions and tool tips to place the '\n's correctly - Varování: zaškrtnutí této volby vede k překrývání -sloupců, jestliže sloupce v ASCII souboru nemají -stejný počet řádků. - - - - Decimal Separators - Oddělovače desetinných míst - - - - System Locale Setting - Místní nastavení systému - - - - Omit &thousands separator - Vynechat oddělovač míst (&tisíce) - - - - Endline character - Znak pro konec řádku - - - - LF (Unix) - LF (Unix) - - - - CRLF (Windows) - CRLF (Windows) - - - - CR (Mac) - CR (Mac) - - - - Import as &read-only - Zavést jako &pouze pro čtení - - - - &Preview Lines - &Náhled řádků - - - - All - Vše - - - - &Help - &Nápověda + The column separator can be customized. +The following special codes can be used: +\t for a TAB character +\s for a SPACE + Oddělovač sloupců lze uživatelsky nastavit. +K tomu lze použít následujících zvláštních kódů: +\t pro znak zarážky (TAB) +\s pro mezeru (MEZERNÍK) + + + The separator must not contain the following characters: +0-9eE.+- + Oddělovač nesmí obsahovat následující znaky: +0-9eE.+- + + + By checking this option all white spaces will be +removed from the beginning and the end of +the lines in the ASCII file. + when translating this check the what's this functions and tool tips to place the '\n's correctly + Zaškrtnutím této volby budou všechny mezery +odstraněny ze začátků a konců řádků +souboru ASCII. + + + Warning: checking this option leads to column +overlaping if the columns in the ASCII file don't +have the same number of rows. + Varování: zaškrtnutí této volby vede k překrývání +sloupců, pokud sloupce v souboru ASCII nemají +stejný počet řádků. + + + To avoid this problem you should precisely +define the column separator using TAB and +SPACE characters. + when translating this check the what's this functions and tool tips to place the '\n's correctly + Abyste se vyhnul těmto potížím, měl byste +přesně určit oddělovač sloupce pomocí znáků +pro zarážku (TAB) a mezeru (MEZERNÍK). + + + By checking this option all white spaces will be +removed from the beginning and the end of the +lines and each sequence of internal +whitespaces (including the TAB character) will +be replaced with a single space. + when translating this check the what's this functions and tool tips to place the '\n's correctly + Zaškrtnutím této volby budou všechny mezery +odstraněny ze začátků a konců řádků a každá +posloupnost vnitřních prázdných míst (včetně +znaku zarážky (TAB)) bude nahrazena jednoduchou +mezerou. + + + Warning: checking this option leads to column +overlaping if the columns in the ASCII file don't +have the same number of rows. + when translating this check the what's this functions and tool tips to place the '\n's correctly + Varování: zaškrtnutí této volby vede k překrývání +sloupců, pokud sloupce v souboru ASCII nemají +stejný počet řádků. The column separator can be customized. The following special codes can be used: -\t for a TAB character +\t for a TAB character \s for a SPACE - Oddělovač sloupců může být uživatelem upraven. -Dají se použít následující zvláštní kódy: -\t pro znak TAB (tabulátor) -\s pro SPACE (mezerník) - - - - The separator must not contain the following characters: 0-9eE.+- - Oddělovač sloupců nesmí obsahovat následující znaky: 0-9eE.+- - - - - Remove white spaces from line ends - Z konců řádků odstranit mezery - - - - By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. - Zaškrtnutím této volby budou všechny mezery odstraněny ze začátků a konců řádků v ASCII souboru. - - - - Simplify white spaces - Zjednodušit mezery - - - - By checking this option each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. - Zaškrtnutím této volby budou všechny mezery mezi sloupci (včetně znaku pro TABULÁTOR) nahrazeny jednoduchou mezerou. - - - - By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. - Zaškrtnutím této volby budou všechny mezery ze začátků a konců řádků odstraněny a všechny mezery mezi sloupci (včetně znaku pro TABULÁTOR) budou nahrazeny jednoduchou mezerou. - - - - Warning: using these two last options leads to column overlaping if the columns in the ASCII file don't have the same number of rows. - Varování: použití těchto dvou posledních voleb vede k překrývání sloupců, jestliže sloupce v ASCII souboru nemají stejný počet řádků. - - - - To avoid this problem you should precisely define the column separator using TAB and SPACE characters. - Abyste se vyhnul tomuto problému, měl byste přesně určit oddělovač sloupců s pomocí znaků pro TAB(ULÁTOR) a MEZERU. - - - - QtiPlot - Help - QtiPlot - Nápověda - - - - QtiPlot - File openning error - QtiPlot - Chyba při otevírání souboru - - - - You don't have the permission to open this file: <b>%1</b> - Pro otevření tohoto souboru nemáte oprávnění: <b>%1</b> + Oddělovač sloupců lze uživatelsky nastavit. +K tomu lze použít následujících zvláštních kódů: +\t pro znak zarážky (TAB) +\s pro mezeru (MEZERNÍK) IntDialog - + &Close + &Zavřít + + + Tolerance + Povolená odchylka + + QtiPlot - Integration Options QtiPlot - Volby pro začlenění - - Function - Funkce - - - - Variable - Proměnná - - - - Order (1 - 5, 1 = Trapezoidal Rule) - Řád (1 - 5, 1 = lichoběžníkové pravidlo) - - - - Number of iterations (Max=20) - Počet opakování (iterací) (Max=20) - - - - Tolerance - Povolená odchylka - - - Lower limit Spodní mez - Upper limit Horní mez - &Plot area &Nakreslit oblast - + Number of iterations (Max=20) + Počet opakování (iterací) (Max=20) + + + Variable + Proměnná + + &Integrate &Začlenit - - &Close - &Zavřít + Order (1 - 5, 1 = Trapezoidal Rule) + Řád (1 - 5, 1 = lichoběžníkové pravidlo) + + + Function + Funkce Integration - - QtiPlot - Input error - QtiPlot - Chyba při zadání - - - - - Integration - Začlenění - - - - - Numerical integration of - Číselné začlenění - - - - using a %1 order method - s pomocí způsobu %1. Řád - - - + to + do + + + Area + Oblast + + From Od - - - to - do - - - - Tolerance - Povolená odchylka - - - - Iterations - Opakování (iterace) - - - + from + od + + Plot Nákres - + QtiPlot - Error + QtiPlot - Chyba + + + Tolerance + Povolená odchylka + + using the Trapezoidal Rule s pomocí lichoběžníkového pravidla - Points Body - - from - od - - - + Numerical integration of + Číselné začlenění + + + Unknown integration method. Valid values must be in the range: 1 (Trapezoidal Method) to 5. + Neznámý způsob začlenění. Platné hodnoty musí být v rozsahu: 1 (lichoběžníkový způsob) do 5. + + Peak at Vrchol při - - Area - Oblast - - - - QtiPlot - Error - QtiPlot - Chyba - - - - Unknown integration method. Valid values must be in the range: 1 (Trapezoidal Method) to 5. - Neznámý způsob začlenění. Platné hodnoty musí být v rozsahu: 1 (lichoběžníkový způsob) do 5. + using a %1 order method + s pomocí způsobu %1. Řád + + + QtiPlot - Input error + QtiPlot - Chyba při zadání + + + Iterations + Opakování (iterace) + + + Integration + Začlenění Interpolation - - - QtiPlot - QtiPlot - - - - - Error - Chyba - - - - Unknown interpolation method. Valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. - Neznámý způsob interpolace. Platné hodnoty jsou: 0 - přímočará, 1 - trojrozměrná, 2 - Akima. - - - - - - - Linear - Přímočará - - - - - - - - Int Interpolace - - - - - - - Interpolation - Interpolace - - - - - - - Cubic - Trojrozměrná - - - - - - Akima Akima - + Cubic + Trojrozměrná + + + Error + Chyba + + QtiPlot - Error QtiPlot - Chyba - + Linear + Lineární + + + Interpolation + Interpolace + + + QtiPlot + QtiPlot + + + Unknown interpolation method. Valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. + Neznámý způsob interpolace. Platné hodnoty jsou: 0 - lineární, 1 - trojrozměrná, 2 - Akima. + + Unknown interpolation method, valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. - Neznámý způsob interpolace. Platné hodnoty jsou: 0 - přímočará, 1 - trojrozměrná, 2 - Akima. + Neznámý způsob interpolace. Platné hodnoty jsou: 0 - lineární, 1 - trojrozměrná, 2 - Akima. - You need at least %1 points in order to perform this operation! Pro provedení této operace potřebujete alespoň %1 bodů! @@ -12120,90 +8898,73 @@ InterpolationDialog - + &Make + &Použít + + + Color + Barva + + + Cubic + Trojrozměrná + + + The curve <b> %1 </b> doesn't exist anymore! Operation aborted! + Křivka <b> %1 </b> již více neexistuje! Operace zrušena! + + + &Close + &Zavřít + + + Linear + Lineární + + + Points + Body + + + Spline + Spline + + + From Xmin + Od Xmin + + + QtiPlot - Input error + QtiPlot - Chyba v zadání + + QtiPlot - Interpolation Options QtiPlot - Volby pro interpolaci - + To Xmax + Do Xmax + + Make curve from Udělat křivku z - - Spline - Spline - - - - Linear - Přímočará - - - - Cubic - Trojrozměrná - - - + Please enter x limits that satisfy: from < to! + Zadejte, prosím, rozsah x, který vyhoví: Začátek < Konec! + + + QtiPlot - Warning + QtiPlot - Varování + + Non-rounded Akima Ne-kulatá Akima - - - Points - Body - - - - From Xmin - Od Xmin - - - - To Xmax - Do Xmax - - - - Color - Barva - - - - &Make - &Použít - - - - &Close - &Zavřít - - - - QtiPlot - Warning - QtiPlot - Varování - - - - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - Křivka <b> %1 </b> již více neexistuje! Operace zrušena! - - - - QtiPlot - Input error - QtiPlot - Chyba v zadání - - - - Please enter x limits that satisfy: from < to! - Zadejte, prosím, rozsah x, který vyhoví: Začátek < Konec! - LayerButton - Activate layer Spustit vrstvu @@ -12211,423 +8972,387 @@ LayerDialog - - QtiPlot - Arrange Layers - QtiPlot - Uspořádat vrstvy - - - - Layers - Vrstvy - - - - Number - Počet - - - + &OK + &OK + + + Top + Nahoru + + + Grid + Mřížka + + + Left + Vlevo + + + Rows + Řádky + + + &Swap + &Vyměnit + + + Destination Layer + Cílová vrstva + + + Bottom margin + Dolní okraj + + + Right + Vpravo + + + Width + Šířka + + Automatic &layout Automatické &rozvržení - - Alignment - Zarovnání - - - Horizontal Vodorovné - - - Center - Na střed - - - - Left - Vlevo - - - - Right - Vpravo - - - - Vertical - Svisle - - - - Top - Nahoru - - - - Bottom - Dolů - - - - Grid - Mřížka - - - - Columns - Sloupce - - - - Rows - Řádky - - - - &Layer Canvas Size - &Velikost podkladu vrstvy - - - - Width - Šířka - - - - - - - - - - - pixels - pixely - - - - Height - Výška - - - - Spacing - Odstup - - - + QtiPlot - Error + QtiPlot - Chyba + + + &Apply + &Použít + + + Source Layer + Zdrojová vrstva + + Columns gap Odstup sloupců - + Bottom + Dolů + + + Center + Na střed + + + Right margin + Pravý okraj + + + Height + Výška + + + Layers + Vrstvy + + + Number + Počet + + + Swap Layers + Vyměnit vrstvy + + + &Continue + &Pokračovat + + Rows gap Odstup řádků - + The number of rows you've entered is greater than the number of graphs (%1)! + Počet řádků, který jste zadal, je větší než počet obrazců (%1)! + + + Top margin + Horní okraj + + Left margin Levý okraj - - Right margin - Pravý okraj - - - - Top margin - Horní okraj - - - - Bottom margin - Dolní okraj - - - - &Apply - &Použít - - - - &OK - &OK - - - - + pixels + pixely + + + QtiPlot - Columns input error + QtiPlot - Chyba v zadání sloupců + + + Columns + Sloupce + + + Spacing + Odstup + + &Cancel &Zrušit - - Swap Layers - Vyměnit vrstvy - - - - Source Layer - Zdrojová vrstva - - - - Destination Layer - Cílová vrstva - - - - &Swap - &Vyměnit - - - + QtiPlot - Rows input error + QtiPlot - Chyba v zadání řádků + + + You are about to delete %1 existing layers. + Chystáte se smazat %1 stávající vrstvy. + + QtiPlot - Delete Layers? QtiPlot - Odstranit vrstvy? - - You are about to delete %1 existing layers. - Chystáte se smazat %1 stávající vrstvy. - - - Are you sure you want to continue this operation? Jste si jist, že chcete pokračovat v této operaci? - - &Continue - &Pokračovat - - - - QtiPlot - Columns input error - QtiPlot - Chyba v zadání sloupců - - - The number of columns you've entered is greater than the number of graphs (%1)! Počet sloupců, který jste zadal, je větší než počet obrazců (%1)! - - QtiPlot - Rows input error - QtiPlot - Chyba v zadání řádků - - - - The number of rows you've entered is greater than the number of graphs (%1)! - Počet řádků, který jste zadal, je větší než počet obrazců (%1)! - - - - QtiPlot - Error - QtiPlot - Chyba - - - + Vertical + Svisle + + Please enter different indexes for the source and destination layers! Zadejte, prosím, odlišné indexy pro zdrojové a cílové vrstvy! + + &Layer Canvas Size + &Velikost podkladu vrstvy + + + QtiPlot - Arrange Layers + QtiPlot - Uspořádat vrstvy + + + Alignment + Zarovnání + + + Unit + Jednotka + + + inch + palec + + + mm + mm + + + cm + cm + + + point + bod + + + pixel + pixel + + + &Keep aspect ratio + &Zachovat poměr stran obrazu + + + Margins + Okraje + + + Link &X axes + Spojit osy &x + + + &Fixed size + &Pevná velikost + + + Align + Zarovnání + + + Canvases + Plátna + + + Co&mmon axes + &Společné osy + LineDialog - + X + X + + + Y + Y + + + &Ok + &OK + + + Page + Strana + + + Type + Druh + + + Unit + Jednotka + + + &Line + &Čára + + + Angle + Úhel + + + Color + Barva + + + Width + Šířka + + + Layer Scales + Rozměry vrstvy + + + Arrow at &end + Šipka na &konci + + QtiPlot - Line options QtiPlot - Volby pro řádek - - Color - Barva - - - - Type - Druh - - - - Width - Šířka - - - + &Apply + &Použít + + + Length + Délka + + + Pixels + Pixely + + + Start Point + Počáteční bod + + + End Point + Koncový bod + + + Arrow &Head + Špička &šipky + + + Attach to + Spojit s + + + &Filled + &Vyplněná + + Arrow at &start Šipka na &začátku - - Arrow at &end - Šipka na &konci - - - - &Line - &Čára - - - - Length - Délka - - - - Angle - Úhel - - - - &Filled - &Vyplněná - - - - Arrow &Head - Špička &šipky - - - + &Geometry + &Uspořádání + + + Scale Coordinates + Souřadnice zařadit do stupnice + + Set &Default Nastavit &výchozí hodnotu - - - &Apply - &Použít - - - - &Ok - &OK - - - - Page - Strana - - - - Layer Scales - Rozměry vrstvy - - - - Attach to - Spojit s - - - - Scale Coordinates - Souřadnice zařadit do stupnice - - - - Pixels - Pixely - - - - Unit - Jednotka - - - - Start Point - Počáteční bod - - - - - X - X - - - - - Y - Y - - - - End Point - Koncový bod - - - - &Geometry - &Uspořádání - LineProfileTool - - + x + x + + + y + y + + + pixel + pixel + + + pixel intensity (a.u.) + síla pixelu (a. u.) + + + pixels + pixely + + QtiPlot - Pixel selection warning QtiPlot - Varování týkající se výběru pixelů - + intensity + síla + + Please select an image marker first. Vyberte, prosím, nejprve značku pro obrázek. - Please select the end line point inside the image rectangle! Vyberte, prosím, uvnitř obdélníku pro obrázek bod pro koncovou čáru! - - - pixel - pixel - - - - intensity - síla - - - - Table - Tabulka - - - - pixels - pixely - - - - pixel intensity (a.u.) - síla pixelu (a. u.) - LinearFit - Linear Regression - Přímočarý pokles + Lineární regrese - Linear - Přímočarý + Lineární - QtiPlot - Fit Error QtiPlot - Chyba při umístění - You need at least %1 data points for this fit operation. Operation aborted! Pro tuto operaci umístění potřebujete alespoň %1 datových bodů! Operace zrušena! @@ -12635,22 +9360,18 @@ LinearSlopeFit - Linear Regression - Přímočarý pokles + Lineární regrese - LinearSlope Přímočarý sklon - QtiPlot - Fit Error QtiPlot - Chyba při umístění - You need at least %1 data points for this fit operation. Operation aborted! Pro tuto operaci umístění potřebujete alespoň %1 datových bodů! Operace zrušena! @@ -12658,32 +9379,26 @@ LogisticFit - + power + síla + + Logistic Logistické - init value počáteční hodnota - - final value - konečná hodnota - - - center na střed - - power - síla + final value + konečná hodnota - Logistic Fit Logistické umístění @@ -12691,32 +9406,26 @@ LorentzFit - + area + oblast + + + width + šířka + + Lorentz Lorentz - Lorentz Fit Lorentzovo umístění - - area - oblast - - - center střed - - width - šířka - - - offset posun @@ -12724,325 +9433,245 @@ Matrix - - Set Dimensions - Nastavit rozměry - - - - - - - + kB + kB + + + Paste + Vložit + + QtiPlot - Error QtiPlot - Chyba - - Calculation failed, the matrix is not square! - Výpočet není možný, protože matice není kvadratická (matice druhého stupně)! - - - - - - - - - QtiPlot - QtiPlot - - - - - - - - Memory Allocation Error - Chyba v přidělení paměti - - - - - - - + QtiPlot - ASCII Export Error + QtiPlot - Chyba při vyvedení do ASCII + + + Due to memory limitations it will not be possible to undo this change. Do you want to continue anyways? + Kvůli omezením paměti nebude možné tuto změnu vrátit zpět. Přesto chcete pokračovat? + + + Flip Horizontally + Obrátit vodorovně + + Not enough memory, operation aborted! Není dostatek paměti. Operace zrušena! - - Inversion failed, the matrix is not square! - Převrácení selhalo, protože matice není kvadratická (matice druhého stupně)! - - - + Import Image + Zavést obrázek + + + File format not handled, operation aborted! + Program si neví rady, co s tímto formátem souboru. Operace byla zrušena! + + + Set Data Mode + Nastavit režim dat + + + Import ASCII File + Zavést soubor ASCII + + + Ctrl+A + Ctrl+A + + + Insert Column + Vložit sloupec + + Invert Převrátit - + Delete Columns + Smazat sloupce + + + Set Dimensions + Nastavit rozměry + + Transpose Převést - - Flip Vertically - Obrátit svisle - - - - Flip Horizontally - Obrátit vodorovně - - - Rotate 90° Otočit o 90° - + QtiPlot + QtiPlot + + + Forward FFT + FFT dopředu + + + Clear Selection + Vyprázdnit výběr + + + Inverse FFT + Převrácená hodnota FFT + + Rotate -90° Otočit -90° - - - Calculate Values - Vypočítat hodnoty - - - - Clear Selection - Vyprázdnit výběr - - - - Paste - Vložit - - - Delete Rows Smazat řádky - - Delete Columns - Smazat sloupce - - - + Flip Vertically + Obrátit svisle + + + Please provide a valid file name! + Poskytněte, prosím, platný název souboru! + + + Memory Allocation Error + Chyba v přidělení paměti + + Insert Row Vložit řádek - - Insert Column - Vložit sloupec - - - - - Please provide a valid file name! - Poskytněte, prosím, platný název souboru! - - - - File format not handled, operation aborted! - Program si neví rady, co s tímto formátem souboru. Operace byla zrušena! - - - - - Set Data Mode - Nastavit režim dat - - - + Warning + Varování + + + Inversion failed, the matrix is not square! + Převrácení selhalo, protože matice není kvadratická (matice druhého stupně)! + + + Calculate Values + Vypočítat hodnoty + + + Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! + Nelze zapisovat do souboru: <br><h4> %1 </h4><p>Ověřte, prosím, že máte oprávnění pro zápis do tohoto umístění! + + + Calculation failed, the matrix is not square! + Výpočet není možný, protože matice není kvadratická (matice druhého stupně)! + + Ctrl+A Matrix: select all Ctrl+A - - - - Import Image - Zavést obrázek - - - - Inverse FFT - Převrácená hodnota FFT - - - - Forward FFT - FFT dopředu - - - - QtiPlot - ASCII Export Error - QtiPlot - Chyba při vyvedení do ASCII - - - - Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! - Nelze zapisovat do souboru: <br><h4> %1 </h4><p>Ověřte, prosím, že máte oprávnění pro zápis do tohoto umístění! - - - - Import ASCII File - Zavést soubor ASCII - - - - Due to memory limitations it will not be possible to undo this change. Do you want to continue anyways? - Kvůli omezením paměti nebude možné tuto změnu vrátit zpět. Přesto chcete pokračovat? - - - - Warning - Varování - - - - kB - kB - MatrixDialog - + &OK + &OK + + + Scientific: 1E3 + Vědecký: 1E3 + + + &Apply + &Použít + + + Data Format + Datový formát + + + Decimal: 1000 + Desetinný: 1000 + + + Set Data Format %1 + Nastavit formát dat %1 + + QtiPlot - Matrix Properties QtiPlot - Vlastnosti matice - - Cell Width - Šířka buňky - - - - Data Format - Datový formát - - - - Decimal: 1000 - Desetinný: 1000 - - - - Scientific: 1E3 - Vědecký: 1E3 - - - - Numeric Display - Číselné zobrazení - - - Default Decimal Digits Výchozí desetinná místa - - Significant Digits= - Statisticky významná desetinná místa= - - - - &Apply - &Použít - - - - &OK - &OK - - - &Cancel &Zrušit - - Set Columns Width - Nastavit šířku sloupců - - - Decimal Desetinný - + Numeric Display + Číselné zobrazení + + Scientific Vědecký - - Set Data Format %1 - Nastavit formát dat %1 - - - + Significant Digits= + Statisticky významná desetinná místa= + + + Cell Width + Šířka buňky + + Precision %1 digits Přesnost %1 desetinných míst + + Set Columns Width + Nastavit šířku sloupců + MatrixModel - + The dimensions you have specified are not acceptable! + Rozměry, které jste zadal, nejsou přijatelné! + + + Not enough memory, operation aborted! + Není dostatek paměti, a tak byla operace zrušena! + + + QtiPlot + QtiPlot + + + Multiline expressions take much more time to evaluate! Do you want to continue anyways? + Vyhodnocení výrazů zabírajících více řádků trvá mnohem delší dobu! Tak či tak chcete pokračovat? + + + Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! + Zadejte, prosím, kladné hodnoty, pro které výsledek řádky*sloupce nepřekročí největší možnou celočíselnou hodnotu na vašem systému! + + + Input Size Error + Chyba velikosti vstupu + + Edited cell Upravená buňka - - - - - QtiPlot - QtiPlot - - - - Input Size Error - Chyba velikosti vstupu - - - - The dimensions you have specified are not acceptable! - Rozměry, které jste zadal, nejsou přijatelné! - - - - Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! - Zadejte, prosím, kladné hodnoty, pro které výsledek řádky*sloupce nepřekročí největší možnou celočíselnou hodnotu na vašem systému! - - - - Memory Allocation Error Chyba v přidělení paměti - - - Not enough memory, operation aborted! - Není dostatek paměti, a tak byla operace zrušena! - - - - Multiline expressions take much more time to evaluate! Do you want to continue anyways? - Vyhodnocení výrazů zabírajících více řádků trvá mnohem delší dobu! Tak či tak chcete pokračovat? - - - Warning Varování @@ -13050,2531 +9679,2017 @@ MatrixSizeDialog - - QtiPlot - Matrix Dimensions - QtiPlot - Rozměry matice - - - - Dimensions - Rozměry - - - + &OK + &OK + + + Last + Poslední + + Rows Řádky - - Columns - Sloupce - - - - Coordinates - Souřadnice - - - - X (Columns) - X (Sloupce) - - - - Y (Rows) - Y (Řádky) - - - First První - - Last - Poslední - - - - &Apply - &Použít - - - - &OK - &OK - - - - &Cancel - &Zrušit - - - Set Coordinates x[%1 : %2], y[%3 : %4] Nastavit souřadnice x[%1 : %2], y[%3 : %4] + + &Apply + &Použít + + + Y (Rows) + Y (Řádky) + + + X (Columns) + X (Sloupce) + + + Columns + Sloupce + + + &Cancel + &Zrušit + + + Coordinates + Souřadnice + + + QtiPlot - Matrix Dimensions + QtiPlot - Rozměry matice + + + Dimensions + Rozměry + MatrixValuesDialog - + to + do + + + &Apply + &Použít + + + &Close + &Zavřít + + + Add Ce&ll + Přidat buň&ku + + QtiPlot - Set Matrix Values QtiPlot - Nastavit hodnoty matice - For row (i) Pro řádek (i) - - - to - do - - - For col (j) Pro sloupec (j) - + Set New Formula + Stanovit nový vzorec + + Add &Function Přidat &funkci - - Add Ce&ll - Přidat buň&ku - - - - &Apply - &Použít - - - - &Close - &Zavřít - - - Use built-in muParser (much faster) Použít vestavěný muParser (mnohem rychlejší) - Cell(i,j)= Buňka(i,j)= - - - Set New Formula - Stanovit nový vzorec - MdiSubWindow - - QtiPlot - QtiPlot - - - - Do you want to hide or delete - Chcete skrýt nebo smazat - - - + B + B + + + Hide + Skrýt + + + Cancel + Zrušit + + Delete Smazat - - Hide - Skrýt - - - - Cancel - Zrušit - - - + Hidden + Skrytý + + + Minimized + Zminimalizovaný + + Normal Obvyklý - - Minimized - Zminimalizovaný - - - + QtiPlot + QtiPlot + + + Do you want to hide or delete + Chcete skrýt nebo smazat + + Maximized Zmaximalizovaný - - - Hidden - Skrytý - - - - B - B - MultiLayer - + kB + kB + + + &No + &Ne + + + &Yes + &Ano + + + QtiPlot - Error + QtiPlot - Chyba + + + Offset Dialog + Dialog pro posun + + + Enable Fill + Povolit výplň + + + &Apply + &Použít + + + &Close + &Zavřít + + + File format not handled, operation aborted! + Tento souborový formát se nepodařilo zpracovat. Operace byla zrušena! + + + Fill Curves + Vyplnit křivky + + Add layer Přidat vrstvu - - Remove active layer - Odstranit činnou vrstvu + Side Lines + Postranní čáry - QtiPlot - Guess best layout? QtiPlot - Automaticky určit nejlepší rozvržení? - Do you want QtiPlot to rearrange the remaining layers? Chcete, aby QtiPlot přeuspořádal zbývající vrstvy? - - &Yes - &Ano - - - - &No - &Ne - - - + Fill with Color + Vyplnit barvou + + + Total Y Offset (%) + Celkový posun Y (%) + + + Total X Offset (%) + Celkový posun X (%) + + + Remove active layer + Odstranit činnou vrstvu + + &Cancel &Zrušit - - - - QtiPlot - Error - QtiPlot - Chyba - - - - Please provide a valid file name! Poskytněte, prosím, platný název souboru! - - File format not handled, operation aborted! - Tento souborový formát se nepodařilo zpracovat. Operace byla zrušena! - - - - kB - kB - - - + Fill Area... + Vyplnit oblast... + + Offset Amount... Velikost posunu... - Reverse Order Převrátit řád - - - Fill Area... - Vyplnit oblast... - - - - Offset Dialog - Dialog pro posun - - - - Total Y Offset (%) - Celkový posun Y (%) - - - - Total X Offset (%) - Celkový posun X (%) - - - - &Apply - &Použít - - - - - &Close - &Zavřít - - - - Fill Curves - Vyplnit křivky - - - - Enable Fill - Povolit výplň - - - - Fill with Color - Vyplnit barvou - - - - Side Lines - Postranní čáry - MultiPeakFit - - Gauss - Gauss - - - - Lorentz - Lorentz - - - - Gauss Fit - Gaussovo umístění - - - - Lorentz Fit - Lorentzovo umístění - - - - multi-peak - mnohačetný vrchol - - - - - area - oblast - - - - - center - střed - - - - - width - šířka - - - - - offset - posun - - - - - + Fit + Umístění + + + Area + Oblast + + Peak Vrchol - - - - Fit - Umístění - - - - QtiPlot - Fit Error - QtiPlot - Chyba při umístění - - - - Could not allocate enough memory for the fit curves! - Nepodařilo se přidělit dostatek paměti. Operace zrušena! - - - - fit of - Umístění - - - - + area + oblast + + peak vrcholu - - Area - Oblast - - - + Gauss + Gauss + + + Width + Šířka + + + width + šířka + + + Could not allocate enough memory for the fit curves! + Nepodařilo se přidělit dostatek paměti. Operace zrušena! + + + Lorentz + Lorentz + + Center Střed - - Width - Šířka - - - Height Výška + + Lorentz Fit + Lorentzovo umístění + + + center + střed + + + fit of + Umístění + + + offset + posun + + + QtiPlot - Fit Error + QtiPlot - Chyba při umístění + + + multi-peak + mnohačetný vrchol + + + Gauss Fit + Gaussovo umístění + MultiPeakFitTool - + Peak %1 selected! Click to select a point and double-click/press 'Enter' to set the position of the next peak! + Vrchol %1 byl vybrán. Klepněte pro výběr bodu a dvakrát klepněte/stiskněte 'Enter' pro stanovení polohy dalšího vrcholu! + + Move cursor and click to select a point and double-click/press 'Enter' to set the position of a peak! Posuňte ukazovátko a klepněte pro výběr bodu a dvakrát klepněte/stiskněte 'Enter' pro stanovení polohy vrcholu! - - - Peak %1 selected! Click to select a point and double-click/press 'Enter' to set the position of the next peak! - Vrchol %1 byl vybrán. Klepněte pro výběr bodu a dvakrát klepněte/stiskněte 'Enter' pro stanovení polohy dalšího vrcholu! - NonLinearFit - - NonLinear - Nepřímočaré - - - - Non-linear Fit - Nepřímočaré umístění - - - - - QtiPlot - Input function error - QtiPlot - Chyba v zadání funkce - - - Please enter a valid non-empty expression! Operation aborted! Zadejte, prosím, platný nikoli prázdný výraz! Operace zrušena! - - - QtiPlot - Fit Error - QtiPlot - Chyba při umístění - - - + NonLinear + Nelineární + + + constant + stálé + + There are no parameters specified for this fit operation. Please define a list of parameters first! Pro tuto operaci umístění nebyly stanoveny žádné parametry. Nejprve, prosím, určete seznam parametrů! - You must provide a list containing at least one parameter for this type of fit. Operation aborted! Musíte poskytnout seznam, který bude obsahovat alespoň jeden parametr pro tento typ umístění. Operace zrušena! - - - constant - stálé + QtiPlot - Fit Error + QtiPlot - Chyba při umístění + + + Non-linear Fit + Nelineární umístění + + + QtiPlot - Input function error + QtiPlot - Chyba v zadání funkce + + + Ignore + Nevšímat si Note - + Title + Název + + + untitled + bez názvu + + Add tab Přidat kartu - Please, enter new title: Zadejte, prosím, nový název: - - - Title - Název - - - - untitled - bez názvu - OpenProjectDialog - + Excel + + + + Origin matrix + Původní matice + + QtiPlot - Open Project QtiPlot - Otevřít projekt - - QtiPlot project - Projekt QtiPlotu - - - - Compressed QtiPlot project - Stlačený projekt QtiPlotu - - - - Origin project - Původní projekt - - - - Origin matrix - Původní matice - - - - Origin worksheet - Původní pracovní list - - - + New Folder + Nová složka + + Origin graph Původní nákres - + Compressed QtiPlot project + Stlačený projekt QtiPlotu + + + Open As + Otevřít jako + + Backup files Soubory se zálohou - - All files - Všechny soubory - - - - Open As - Otevřít jako - - - + Origin worksheet + Původní pracovní list + + + QtiPlot project + Projekt QtiPlotu + + New Project Window Nové okno s projektem - - New Folder - Nová složka + All files + Všechny soubory + + + Origin project + Původní projekt + + + ODF Spreadsheet + PatternBox - - Solid - Vyplněný - - - - Horizontal - Vodorovný - - - - Vertical - Svislý - - - + None + Žádný + + Cross Křížový - - BDiagonal - BÚhlopříčný - - - - FDiagonal - FÚhlopříčný - - - - DiagCross - Úhlopříčný křížový - - - + Solid + Vyplněný + + + Horizontal + Vodorovný + + Dense1 Hustý1 - Dense2 Hustý2 - Dense3 Hustý3 - Dense4 Hustý4 - Dense5 Hustý5 - Dense6 Hustý6 - Dense7 Hustý7 - - None - Žádný + DiagCross + Úhlopříčný křížový + + + Vertical + Svislý + + + BDiagonal + BÚhlopříčný + + + FDiagonal + FÚhlopříčný Plot3DDialog - - QtiPlot - Surface Plot Options - QtiPlot - Volby pro nákres povrchu - - - - &Apply - &Použít - - - - &OK - &OK - - - - &Cancel - &Zrušit - - - - X X - - Y Y - - Z Z - + To + Do + + + &OK + &OK + + + Dot + Tečka + + + Bars + Pruhy + + + Cone + Kužel + + + Dash + Čárka + + From Od - - To - Do + None + Žádný - Type Druh - - linear - přímočarý - - - - logarithmic - logaritmický - - - - Major Ticks - Větší fajfky - - - - Minor Ticks - Menší fajfky - - - + &Axis + &Osa + + + &Font + &Písmo + + + &Line + &Čára + + + A&xes + O&sy + + + Boxed + Zarámované + + + G&rid + &Mřížka + + + Color + Barva + + + Axis Font + Písmo os + + + Solid + Vyplněný + + + Style + Styl + + + Title + Název + + + Width + Šířka + + + Color map &file + &Soubor s mapou barev + + + Mi&nor Grids + &Menší mřížky + + + Ma&jor Grids + &Větší mřížky + + + &Background + &Pozadí + + + Lab&els + &Popisy + + + &Apply + &Použít + + &Scale &Stupnice - - Title - Název - - - - Axis Font - Písmo os - - - - &Choose font - &Vybrat písmo - - - - Major Ticks Length - Délka hlavního označení os - - - - Minor Ticks Length - Délka vedlejšího označení os - - - - &Axis - &Osa - - - + &Title + &Název + + + Linea&r color map + &Přímá mapa barev + + + Major Ticks + Hlavní označení os + + + Minor Ticks + Vedlejší označení os + + Co&lor &Barva - - &Font - &Písmo - - - - &Title - &Název - - - - Linea&r color map - &Přímočará mapa barev - - - - Color map &file - &Soubor s mapou barev - - - - - - None - Žádný - - - - Opacity - Neprůhlednost - - - - &Line - &Čára - - - - &Background - &Pozadí - - - - General - Obecné - - - - A&xes - O&sy - - - - Lab&els - &Popisy - - - - &Numbers - &Čísla - - - &Grid - &Mřížka - - - - Coordinate System - Soustava souřadnic - - - - &Colors - &Barvy - - - Show Legend Ukázat vysvětlivku - - Orthogonal - Pravoúhlý - - - - - Line Width - Šířka čar - - - + Points + Body + + + Radius + Poloměr + + + Major Ticks Length + Délka hlavního označení os + + + &Numbers + &Čísla + + + Minor Ticks Length + Délka vedlejšího označení os + + Resolution Rozlišení - - Numbers Font - Písmo číslic - - - - &Choose Font - &Vybrat písmo - - - - Distance labels - axis - Popis odstupu- osa - - - - Zoom (%) - Měřítko (%) - - - X Zoom (%) Měřítko x (%) - Y Zoom (%) Měřítko y (%) - Z Zoom (%) Měřítko z (%) - - &General - &Obecné - - - - Ma&jor Grids - &Větší mřížky - - - - Mi&nor Grids - &Menší mřížky - - - - Color - Barva - - - - - Style - Styl - - - - - Solid - Vyplněný - - - - - Dash - Čárka - - - - - - Dot - Tečka - - - - - Dash Dot - Čárka tečka - - - - - Dash Dot Dot - Čárka tečka tečka - - - - - Short Dash - Krátká čárka - - - - + Zoom (%) + Měřítko (%) + + + Opacity + Neprůhlednost + + Short Dot Krátká tečka - - + linear + lineární + + + Line Width + Šířka čar + + Short Dash Dot Krátká čárka tečka - - G&rid - &Mřížka - - - - Cross Hair - Nitkový kříž - - - - Cone - Kužel - - - - - - - Width - Šířka - - - - Smooth angles - Vyhladit úhly - - - - Radius - Poloměr - - - - Smooth line - Vyhladit čáry - - - - Boxed - Zarámované - - - + Dash Dot + Čárka tečka + + Quality Kvalita - - Points - Body - - - &Worksheet &Pracovní list - - &Matrix - &Matice + Short Dash + Krátká čárka - Draw lines Nakreslit čáry - + logarithmic + logaritmický + + + Distance labels - axis + Popis odstupu- osa + + + Cross Hair + Nitkový kříž + + + &Cancel + &Zrušit + + + &Colors + &Barvy + + + Smooth line + Vyhladit čáry + + Filled bars Vyplněné pruhy - - Bars - Pruhy + &Matrix + &Matice + + + &Choose Font + &Vybrat písmo + + + &Choose font + &Vybrat písmo + + + Numbers Font + Písmo číslic + + + Smooth angles + Vyhladit úhly + + + QtiPlot - Surface Plot Options + QtiPlot - Volby pro nákres povrchu + + + General + Obecné + + + &General + &Obecné + + + Orthogonal + Pravoúhlý + + + Coordinate System + Soustava souřadnic + + + Dash Dot Dot + Čárka tečka tečka + + + Scale to paper si&ze + Změnit velikost na v&elikost papíru + + + Print Crop&marks + Tisknout značky &oříznutí + + + &Print + &Tisk + + + Tick Labels + Popisy čárek + + + Format + Formát + + + Automatic + Automaticky + + + Decimal: 10000.0 + Desetinný: 10000.0 + + + Scientific: 1e4 + Vědecký: 1e4 + + + Engineering: 10k + Technický: 10k + + + Precision + Přesnost PlotDialog - - QtiPlot - Plot details - QtiPlot - Podrobnosti nákresu - - - - Plot type - Typ nákresu - - - - &Worksheet - &Pracovní list - - - + 8 + 8 + + + Use &Table Custom Pen + Použít vlastní pero &tabulky + + + 1% + 1% + + + 10 + 10 + + + 12 + 12 + + + 16 + 16 + + + 20 + 20 + + + cm + cm + + + mm + mm + + &OK &OK - - &Cancel - &Zrušit - - - - &Apply - &Použít - - - - - - &Plot Associations... - &Přiřazení nákresu... - - - - Titles - Názvy - - - - Axes Labels - Popisy os - - - - Axes Numbers - Očíslování os - - - - Legends - Vysvětlivky - - - - - Fonts - Písma - - - - Background Color - Barva pozadí - - - - - Opacity - Neprůhlednost - - - - - Transparent - Průhledný - - - - Canvas Color - Barva podkladu - - - - Border Color - Barva rámu - - - - - - - - Width - Šířka - - - - Antialiasing - Vyhlazování okrajů - - - - Margin - Odstup - - - - Set As &Default - Nastavit jako &výchozí - - - - Apply &to... - Použít &na... - - - - - - - - - - - - Layer - Vrstva - - - - - - - Window - Okno - - - - - - - All Windows - Všechna okna - - - - inch - palec - - - - mm - mm - - - - cm - cm - - - - point - bod - - - - pixel - pixel - - - - Unit - Jednotka - - - - Origin - Původ - - - + 99% + 99% + + + Box + Bedna + + + End + Konec + + + Max + Maximum + + + Min + Minimum + + + Pen + Pero + + + Pie + Koláčový nákres + + + Sum + Součet + + + Top + Nahoře + + X= X= - Y= Y= - - - - Size - Velikost - - - - width= - Šířka= - - - - height= - výška= - - - - Keep aspect ratio - Zachovat poměr stran - - - - - - Geometry - Uspořádání - - - - &Speed Mode, Skip Points if needed - &Režim zrychlení. Přeskočit body, je-li to potřeba - - - - data points - datové body - - - - Apply to curves with more than: - Použít na křivky s více než: - - - - Tolerance (Douglas Peuker algorithm) - Povolená odchylka (algoritmus Douglas Peukerův) - - - - - - Speed - Rychlost - - - - - - - - - Color - Barva - - - - - - - - Style - Styl - - - - Border - Rám - - - - First color - První barva - - - - - - - - - Pattern - Vzor - - - + 95-5 + 95-5 + + + 99-1 + 99-1 + + + Axes + Osy + + + Axis + Osa + + + Bins + Rozdělení + + + Coef + Součinitel + + + Dots + Tečky + + Fill Výplň - - 3D View - Trojrozměrný pohled - - - - View Angle (deg) - Úhel pohledu (stupně) - - - + Head + Hlava + + + Left + Vlevo + + + Line + Čára + + + Mean + Průměrná hodnota + + + None + Žádný + + + Plus + Plus + + + Size + Velikost + + + Bin Size + Velikost rozmezí + + + Tail + Vzadu + + + Step + Krok + + + Type + Druh + + + Unit + Jednotka + + + inch + palec + + Thickness (% of radius) Tloušťka (% poloměru) - - Rotation - Otáčení - - - - Starting Azimuth (deg) - Počáteční azimut (stupně) - - - - Counter cloc&kwise - Proti směru &hodinových ručiček - - - - Radius/Center - Poloměr/Střed - - - - Radius (% of frame) - Poloměr (% rámečku) - - - - Horizontal Offset (% of frame) - Vodorovný posun (% rámečku) - - - - - Pie Geometry - Uspořádání koláčového nákresu - - - - Automatic &Format - Automatický &formát - - - - &Values - &Hodnoty - - - - &Percentages - &Procentní části - - - - Categories/&Rows - Skupiny/&Řádky - - - - Associate Position with &Wedge - Přiřadit polohu ke &klínu - - - - Dist. from Pie Edge - Vzdálenost od okraje koláčového nákresu - - - - - - - - Labels - Popisy - - - - &Scale layers to paper size - &Změnit velikost vrstev na velikost papíru - - - - Print Crop&marks - Tisknout značky &oříznutí - - - - - Print - Tisk - - - + &Font + &Písmo + + &Show &Ukázat - - Column - Sloupec - - - - White O&ut - Bílý &ven - - - - Justify - Zarovnat do bloku - - - - Center - Na střed - - - - - - Left - Vlevo - - - - - - Right - Vpravo - - - - &Font - &Písmo - - - - Rotate (deg) - Otáčet (stupně) - - - - X Offset (font height %) - Posun x (výška písma %) - - - - Y Offset (font height %) - Posun y (výška písma %) - - - - Attach curve to: - Křivku spojit s: - - - - x Axis - Osa x - - - - - Bottom - Dole - - - - - Top - Nahoře - - - - y Axis - Osa y - - - - - Axes - Osy - - - - Connect - Spojit - - - - No line - Žádná čára - - - + &Scale layers to paper size + &Změnit velikost vrstev na velikost papíru + + + Apply Format &to + Použít formát &na + + + 75-25 + 75-25 + + + 90-10 + 90-10 + + + Angle + Úhel + + + Begin + Začátek + + + Color + Barva + + + Fonts + Písma + + + Image + Obrázek + + + Layer + Vrstva + + Lines Čáry - - Sticks - Svislé čáry - - - - Horizontal Steps - Vodorovné kroky - - - - Dots - Tečky - - - - Spline - Spline - - - - Vertical Steps - Svislé kroky - - - - - - Apply Format &to - Použít formát &na - - - - - - Selected Curve - Vybraná křivka - - - - Fill area under curve - Vyplnit oblast pod křivkou - - - - Fill color - Barva výplně - - - - - - - Line - Čára - - - - - Fill Color - Barva výplně - - - - - Edge Color - Barva orámování - - - - - Edge Width - Šířka orámování - - - - - Skip Points - Přeskočit body - - - - - None - Žádný - - - - - - - Symbol - Symbol - - - - - Box - Bedna - - - - - Type - Druh - - - - No Box - Žádná krabice - - - - Rectangle - Obdélník - - - - Diamond - Kosočtverec - - - - Perc 10, 25, 75, 90 - Proc 10, 25, 75, 90 - - - + Minus + Mínus + + Notch S vroubkem - - + Print + Tisk + + Range Rozsah - - - + Right + Vpravo + + + X End + Konec x + + + Speed + Rychlost + + + Start + Začátek + + + Style + Styl + + + Y End + Konec y + + + Width + Šířka + + + pixel + pixel + + + point + bod + + + Keep aspect ratio + Zachovat poměr stran + + + Border Color + Barva rámu + + + QtiPlot - Start limit error + QtiPlot - Chyba počáteční hodnoty + + + Set Equidistant Levels + Nastavit stejně vzdálené úrovně + + + Axes Numbers + Očíslování os + + + Justify + Zarovnat do bloku + + + Canvas Color + Barva podkladu + + Standard Deviation Obvyklá odchylka - - - Standard Error - Obvyklá chyba - - - + Cap Width + Šířka přestřižení + + + Apply to curves with more than: + Použít na křivky s více než: + + + &Apply + &Použít + + + Rotate (deg) + Otáčet (stupně) + + + Legends + Vysvětlivky + + + Please enter limits that satisfy: begin < end! + Zadejte, prosím, mezní hodnoty, které vyhoví: Začátek < Konec! + + + Vertical Steps + Svislé kroky + + Perc 25, 75 Proc 25, 75 - + &Speed Mode, Skip Points if needed + &Režim zrychlení. Přeskočit body, je-li to potřeba + + Perc 10, 90 Proc 10, 90 - - Perc 5, 95 - Proc 5, 95 - - - - Perc 1, 99 - Proc 1, 99 - - - - + Horizontal Offset (% of frame) + Vodorovný posun (% rámečku) + + + Please enter a valid bin size value! + Zadejte, prosím, platnou hodnotu pro šířku rozmezí! + + Max-Min Max-Min - - - Constant - Stálá hodnota - - - - + Maximum + Nejvyšší hodnota + + + Minimum + Nejnižší hodnota + + + Border + Rám + + + Bottom + Dole + + + Center + Na střed + + + Colors + Barvy + + + Column + Sloupec + + Percentile (%) Percentil (%) - - Coefficient - Součinitel - - - - Box Width - Šířka krabice - - - - Whiskers - Vousy - - - - No Whiskers - Žádné vousy - - - - 75-25 - 75-25 - - - - 90-10 - 90-10 - - - - 95-5 - 95-5 - - - - 99-1 - 99-1 - - - - Coef - Součinitel - - - - - Box/Whiskers - Okénko/Vousy - - - - Max - Maximum - - - - 99% - 99% - - - - - Mean - Průměrná hodnota - - - - 1% - 1% - - - - Min - Minimum - - - - - Percentile - Percentil - - - - - Image - Obrázek - - - - &Gray Scale - &Stupnice odstínů šedi - - - - &Default Color Map - &Výchozí tabulka barev - - - - &Custom Color Map - &Vlastní tabulka barev - - - - - Contour Lines - Obrysové čáry - - - + Tolerance (Douglas Peuker algorithm) + Povolená odchylka (algoritmus Douglas Peukerův) + + + No line + Žádná čára + + + Labels + Popisy + + + Length + Délka + + Levels Úrovně - - Use &Color Map - Použít &mapu barev - - - - Use Default &Pen - Použít výchozí &pero - - - - Color Bar Scale - Vysvětlivka k barvám - - - - Axis - Osa - - - - Contour - Obrys - - - - Direction - Směr - - - - Plus - Plus - - - - Minus - Mínus - - - - &X Error Bar - Pruh s chybami u &x - - - - - Line Width - Šířka čar - - - - Cap Width - Šířka přestřižení - - - - 8 - 8 - - - - 10 - 10 - - - - 12 - 12 - - - - 16 - 16 - - - - 20 - 20 - - - - Through Symbol - Přes symbol - - - - - - Error Bars - Pruhy s chybami - - - - Automatic Binning - Automatické rozdělení - - - - &Show statistics - &Ukázat statistiky - - - - Bin Size - Velikost rozmezí - - - - Begin - Začátek - - - - End - Konec - - - - - Histogram Data - Údaje histogramu - - - - Gap Between Bars (in %) - Odstup mezi pruhy (v %) - - - - Offset (in %) - Posun (v %) - - - - - Spacing + Perc 5, 95 + Proc 5, 95 + + + Perc 1, 99 + Proc 1, 99 + + + Margin Odstup - - Arrowheads - Špičky šipek - - - - Length - Délka - - - - - Angle - Úhel - - - - &Filled - &Vyplněno - - - - - End Point - Koncový bod - - - - - X End - Konec x - - - - - Y End - Konec y - - - - Position - Poloha - - - - Tail - Vzadu - - - + Matrix + Matice + + Middle Vprostřed - - Head - Hlava - - - - + Skip Points + Přeskočit body + + + No Box + Žádná krabice + + + Origin + Původ + + + Axes Labels + Popisy os + + + &Plot Associations... + &Přiřazení nákresu... + + + Attach curve to: + Křivku spojit s: + + + Spline + Spline + + + Sticks + Svislé čáry + + + Symbol + Symbol + + + Titles + Názvy + + + Values + Hodnoty + + Vector Vektor - - - - Bins - Rozdělení - - - - - Histogram and Probabilities for - Histogram a pravděpodobnosti pro - - - - Quantity - Množství - - - - Sum - Součet - - - - Percent - Procento - - - - Minimum - Nejnižší hodnota - - - - Maximum - Nejvyšší hodnota - - - - &Delete - &Smazat - - - - - &Edit... - &Upravit... - - - - - Colors - Barvy - - - - Pie - Koláčový nákres - - - - Vertical Bars - Svislé pruhy - - - - Horizontal Bars - Vodorovné pruhy - - - - Histogram - Histogram - - - + Window + Okno + + + X Offset (font height %) + Posun x (výška písma %) + + + Fill area under curve + Vyplnit oblast pod křivkou + + + Y Offset (font height %) + Posun y (výška písma %) + + + Vector Data + Vektorové údaje + + Vector XYXY Vektor XYXY - Vector XYAM Vektor XYAM - - Scatter - Body - - - + First color + První barva + + + Error Bars + Chybové úsečky + + + End Point + Koncový bod + + + Constant + Stálá hodnota + + + Apply &to... + Použít &na... + + + Opacity + Neprůhlednost + + + Plot type + Typ nákresu + + + Antialiasing + Vyhlazování okrajů + + + Pattern + Vzor + + + Position + Poloha + + + Rotation + Otáčení + + Line + Symbol Čára + Symbol - - - - + Percent + Procento + + + Arrowheads + Špičky šipek + + + data points + datové body + + + Offset (in %) + Posun (v %) + + + Color Bar Scale + Vysvětlivka k barvám + + + Edge Color + Barva orámování + + QtiPlot - Input error QtiPlot - Chyba při zadání - + Line Width + Šířka čar + + + Edge Width + Šířka orámování + + + Histogram Data + Údaje histogramu + + + 3D View + Trojrozměrný pohled + + + Perc 10, 25, 75, 90 + Proc 10, 25, 75, 90 + + + x Axis + Osa x + + + Background Color + Barva pozadí + + + &Show Contour Lines + &Ukázat obrysové čáry + + + Print Crop&marks + Tisknout značky &oříznutí + + + y Axis + Osa y + + + Use Default &Pen + Použít výchozí &pero + + + Starting Azimuth (deg) + Počáteční azimut (stupně) + + + QtiPlot - Plot details + QtiPlot - Podrobnosti nákresu + + + Direction + Směr + + + Automatic &Format + Automatický &formát + + + &Worksheet + &Pracovní list + + Please enter a valid start limit! Zadejte, prosím, platnou počáteční hodnotu! - - Please enter a valid end limit! - Zadejte, prosím, platnou koncovou hodnotu! - - - - Please enter a valid bin size value! - Zadejte, prosím, platnou hodnotu pro šířku rozmezí! - - - - QtiPlot - Start limit error - QtiPlot - Chyba počáteční hodnoty - - - - QtiPlot - End limit error - QtiPlot - Chyba koncové hodnoty - - - - Please enter limits that satisfy: begin < end! - Zadejte, prosím, mezní hodnoty, které vyhoví: Začátek < Konec! - - - - + Histogram and Probabilities for + Histogram a pravděpodobnosti pro + + + Scatter + Body + + + Percentile + Percentil + + + Dist. from Pie Edge + Vzdálenost od okraje koláčového nákresu + + + &Default Color Map + &Výchozí tabulka barev + + + &Custom Color Map + &Vlastní tabulka barev + + + Gap Between Bars (in %) + Odstup mezi pruhy (v %) + + + Transparent + Průhledný + + + Through Symbol + Přes symbol + + + Box Width + Šířka krabice + + + Selected Curve + Vybraná křivka + + + Connect + Spojit + + + Contour + Obrys + + + Spacing + Odstup + + + White O&ut + Bílý &ven + + + &Cancel + &Zrušit + + + Rectangle + Obdélník + + + &Delete + &Smazat + + + Histogram + Histogram + + + &Filled + &Vyplněno + + + &Percentages + &Procentní části + + + Diamond + Kosočtverec + + + Vertical Bars + Svislé pruhy + + + Automatic Binning + Automatické rozdělení + + + &Gray Scale + &Stupnice odstínů šedi + + + Set &Levels + Nastavit &úrovně + + + Quantity + Množství + + + Box/Whiskers + Okénko/Vousy + + + &Values + &Hodnoty + + + &X Error Bar + Chybová úsečka u &X + + + Radius/Center + Poloměr/Střed + + + height= + výška= + + + Radius (% of frame) + Poloměr (% rámečku) + + + Use &Color Map + Použít &mapu barev + + + &Function + + + + Geometry + Uspořádání + + + Coefficient + Součinitel + + + Standard Error + Obvyklá chyba + + QtiPlot - Bin size input error QtiPlot - Chyba ve velikosti rozmezí - + Set As &Default + Nastavit jako &výchozí + + + Counter cloc&kwise + Proti směru &hodinových ručiček + + + &Show statistics + &Ukázat statistiky + + + All Windows + Všechna okna + + + width= + Šířka= + + Please enter a positive bin size value! Zadejte, prosím, kladnou hodnotu pro velikost rozmezí! - - Vector Data - Vektorové údaje - - - + Contour Lines + Obrysové čáry + + + Fill Color + Barva výplně + + Magnitude Velikost - - Matrix - Matice - - - + View Angle (deg) + Úhel pohledu (stupně) + + + Fill color + Barva výplně + + + QtiPlot - End limit error + QtiPlot - Chyba koncové hodnoty + + + Horizontal Bars + Vodorovné pruhy + + + Whiskers + Vousy + + + Horizontal Steps + Vodorovné kroky + + + Pie Geometry + Uspořádání koláčového nákresu + + + No Whiskers + Žádné vousy + + + Associate Position with &Wedge + Přiřadit polohu ke &klínu + + Use matrix formula to calculate values Použít maticový vzorec pro výpočet hodnot - - - Values - Hodnoty - - - - &Show Contour Lines - &Ukázat obrysové čáry - - - - Set Equidistant Levels - Nastavit stejně vzdálené úrovně - - - - Start - Začátek - - - - Step - Krok - - - - Set &Levels - Nastavit &úrovně - - - - Pen - Pero - - - - Use &Table Custom Pen - Použít vlastní pero &tabulky + Please enter a valid end limit! + Zadejte, prosím, platnou koncovou hodnotu! + + + Categories/&Rows + Skupiny/&Řádky + + + Link &X axes + Spojit osy &x + + + Miscellaneous + Různé + + + 0 (all data points) + 0 (všechny datové body) + + + Tolerance (Douglas-Peucker algorithm) + Dovolená úchylka (algoritmus Douglas-Peucker) + + + Scale &Fonts + Velikost &písma + + + Do not &resize layers when window size changes + Neměnit &velikost vrstev při změně velikosti okna + + + Dimensions + Rozměry PlotWizard - - QtiPlot - Select Columns to Plot - QtiPlot - Vybrat sloupce, které budou nakresleny - - - &X &X - + &Y + &Y + + + &Z + &Z + + + &Plot + &Nákres + + x&Err x&Chyba - - &Y - &Y - - - yE&rr yChy&ba - - &Z - &Z - - - - &New curve - &Nová křivka - - - - &Delete curve - &Smazat křivku - - - - Worksheet - Pracovní list - - - - &Plot - &Nákres - - - + QtiPlot - Error + QtiPlot - Chyba + + + You have already defined an error-bars column! + Již jste stanovil sloupec pro chybový pruh! + + &Close &Zavřít - - - - - - - - - - - - - - - - - QtiPlot - Error - QtiPlot - Chyba - - - Please define a Y column for the following curve Stanovte, prosím, sloupec Y pro následující křivku - + You have already defined a Z column! + Již jste stanovil sloupec Z! + + You have already defined a X column! Již jste stanovil sloupec X! - - - - - You must define a X column first! - Neprve musíte vybrat sloupec X! - - - You have already defined a Y column! Již jste stanovil sloupec Y! - - - - This kind of curve is not handled by QtiPlot! - S tímto druhem křivky si QtiPlot neporadí! - - - - You have already defined a Z column! - Již jste stanovil sloupec Z! - - - - You must define a Y column first! Neprve musíte vybrat sloupec Y! - - - You have already defined an error-bars column! - Již jste stanovil sloupec pro chybový pruh! - - - + You must define a X column first! + Neprve musíte vybrat sloupec X! + + + Worksheet + Pracovní list + + + &New curve + &Nová křivka + + + QtiPlot - Select Columns to Plot + QtiPlot - Vybrat sloupce, které budou nakresleny + + You must add a new curve first! Neprve musíte přidat novou křivku! + + This kind of curve is not handled by QtiPlot! + S tímto druhem křivky si QtiPlot neporadí! + + + &Delete curve + &Smazat křivku + PluginFit - - Plugin Fit - Umístění z přídavného modulu - - - - QtiPlot - File not found - QtiPlot - Soubor nebyl nenalezen - - - Plugin file: <p><b> %1 </b> <p>not found. Operation aborted! Soubor s přídavným modulem<b> %1 </b> nebyl nenalezen! Operace zrušena! - - - - QtiPlot - Plugin Error QtiPlot - Chyba přídavného modulu - The plugin does not implement a %1 method necessary for simplex fitting. Přídavný modul neprovádí žádnou %1 metodu nezbytnou pro simplexní umístění. - - - The plugin does not implement a %1 method necessary for Levenberg-Marquardt fitting. Přídavný modul neprovádí žádnou %1 metodu nezbytnou pro Levenberg-Marquardt umístění. + + QtiPlot - File not found + QtiPlot - Soubor nebyl nenalezen + + + Plugin Fit + Umístění z přídavného modulu + PolynomFitDialog - + &Fit + &Umístění + + + Color + Barva + + QtiPlot - Polynomial Fit Options QtiPlot - Volby mnohočlenného (polynomického) umístění - + The curve <b> %1 </b> doesn't exist anymore! Operation aborted! + Křivka <b> %1 </b> již více neexistuje! Operace zrušena! + + + Fit curve # pts + Počet bodů křivky umístění + + + Order (1 - 9, 1 = linear) + Řád (1 - 9, 1 = lineární) + + Polynomial Fit of Mnohočlenné (polynomické) umístění - - Order (1 - 9, 1 = linear) - Řád (1 - 9, 1 = přímočaré) - - - - Fit curve # pts - Počet bodů křivky umístění - - - + &Close + &Zavřít + + + Show Formula on Graph? + Ukázat vzorec v nákresu? + + Not enough points Nedostatek bodů - Fit curve Xmin Křivka umístění min. X - Fit curve Xmax Křivka umístění max. X - - Color - Barva - - - - Show Formula on Graph? - Ukázat vzorec v nákresu? - - - - &Fit - &Umístění - - - - &Close - &Zavřít - - - QtiPlot - Warning QtiPlot - Varování - - - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - Křivka <b> %1 </b> již více neexistuje! Operace zrušena! - PolynomialFit - Polynomial Mnohočlenný (polynomický) - + QtiPlot - Fit Error + QtiPlot - Chyba při umístění + + Polynomial Fit Polynomické (mnohočlenné) umístění - - QtiPlot - Fit Error - QtiPlot - Chyba při umístění - - - You need at least %1 data points for this fit operation. Operation aborted! Pro tuto operaci umístění potřebujete alespoň %1 datových bodů! Operace zrušena! + PreviewTable + + Numeric + Číselný + + + Text + Text + + + Date + Datum + + + Time + Čas + + + Month + Měsíc + + + Day + + + + Choose column type + + + + Column type: + + + + PythonScripting - Failed to export QtiPlot API Vyvedení API QtiPlotu se nezdařilo - Accessing QtiPlot functions or objects from Python code won't work.Probably your version of SIP differs from the one QtiPlot was compiled against. - Přístup k funkcím nebo objektům QtiPlot z Pythonu nebude pracovat. Pravděpodobně se liší vaše verze SIP od té, proti které byl QtiPlot sestaven. - - - + Please indicate the correct path to the Python configuration files in the preferences dialog. + + + + Couldn't find initialization files + + + Accessing QtiPlot functions or objects from Python code won't work. Probably your version of Qt/SIP/PyQt differs from the one QtiPlot was compiled against. Přístup k funkcím a objektům z pythonovského kódu u programu QtiPlot není možný. Pravděpodobně je nainstalována jiná verze Qt/SIP/PyQt než ta, která byla použita při sestavení programu QtiPlot; Aktualizace SIP nebo nové sestavení programu QtiPlot by problém odstranilo. @@ -15582,690 +11697,555 @@ QObject - - The file is not an QtiPlot fit model file. - Soubor není souborem QtiPlot modelu umístění. - - - - The file is not an QtiPlot fit model version 1.0 file. - Soubor není souborem QtiPlot modelu umístění verze 1.0. - - - - The file is not a QtiPlot custom action file. - Soubor není souborem QtiPlot vlastních akcí. - - - - The file is not an QtiPlot custom action version 1.0 file. - Soubor není souborem QtiPlot vlastních akcí verze 1.0. - - - + erfq(x): + The upper tail of the Gaussian probability function Q(x). + erfq(x): + Horní část Gaussovy funkce hustoty pravděpodobnosti Q(x). + + + bessel_y1(x): + Irregular cylindrical Bessel function of first order, Y_1(x), for x>0. + bessel_y1(x): + Nepravidelná válcovitá Besselova funkce prvního řádu, Y_1(x),pro x>0. + + + bessel_y0(x): + Irregular cylindrical Bessel function of zeroth order, Y_0(x), for x>0. + bessel_y0(x): + Nepravidelná válcovitá Besselova funkce nultého řádu, Y_0(x),pro x>0. + + + asinh(x): + Hyperbolic inverse sin function. + asinh(x): + Hyperbolická obrácená funkce k sin funkci. + + + erfc(x): + Complementary error function erfc(x) = 1 - erf(x). + erfc(x): + Doplňková funkce chyby erfc(x) = 1 - erf(x). + + The file is not a QtiPlot custom menu file. Soubor není souborem QtiPlot vlastního menu. - - The file is not a QtiPlot custom menu version 1.0 file. - Soubor není souborem QtiPlot vlastního menu verze 1.0. - - - - QtiPlot - QtiPlot - - - - Ignored data point at x = %1. - Datový bod na x = %1 nebrán v úvahu. - - - + tan(x): + Calculate tangent function. + tan(x): + Počítá funkci tangens. + + + avg(x,y,...): + Mean value of all arguments. + avg(x,y,...): + Průměrná hodnota všech argumentů. + + + bessel_yn(double x, int n): + Irregular cylindrical Bessel function of order n, Y_n(x), for x>0. + bessel_yn(double x, int n): + Nepravidelná válcovitá Besselova funkce n-tého řádu, Y_n(x), pro x>0. + + + QtiPlot - Math Error + QtiPlot - Chyba v matematice + + + bessel_jn(double x, int n): + Regular cylindrical Bessel function of order n, J_n(x). + bessel_jn(double x, int n): + Pravidelná válcovitá Besselova funkce n-tého řádu, J_n(x). + + + abs(x): + Absolute value of x. + abs(x): + Absolutní hodnota x. + + + log(x): + Calculate decimal logarithm log_10. + log(x): + Počítá desetinný logaritmus log_10. + + + exp(x): + Exponential function: e raised to the power of x. + exp(x): + Exponenciální funkce: e umocnilo x. + + + floor(x): + Round to the next smaller integer, + largest integer smaller or equal to x. + floor(x): + Zaokrouhlit na nejbližší nejmenší celé číslo, + největší celé číslo menší nebo rovno x. + + + bessel_j1(x): + Regular cylindrical Bessel function of first order, J_1(x). + bessel_j1(x): + Pravidelná válcovitá Besselova funkce prvního řádu, J_1(x). + + + ceil(x): + Round to the next larger integer, + smallest integer larger or equal to x. + ceil(x): + Zaokrouhlit na nejbližší větší celé číslo, + nejmenší celé číslo větší nebo rovno x. + + QtiPlot - Script Error QtiPlot - Chyba skriptu - - Python-like syntax is not supported in this case since it severely reduces drawing speed! - Skladba na způsob Pythonu není v tomto případě podporována, jelikož vážně omezuje rychlost kreslení! - - - - abs(x): - Absolute value of x. - abs(x): - Absolutní hodnota x. - - - - acos(x): - Inverse cos function. - acos(x): - Obrácená funkce ke cos funkci. - - - - acosh(x): - Hyperbolic inverse cos function. - acosh(x): - Hyperbolická obrácená funkce ke cos funkci. - - - + Found non-removable singularity at x = %1. + Nalezena neodstranitelná singularita na x = %1. + + + max(x,y,...): + Calculate maximum of all arguments. + max(x,y,...): + Počítá maximum všech argumentů. + + + bessel_j0(x): + Regular cylindrical Bessel function of zeroth order, J_0(x). + bessel_j0(x): + Pravidelná válcovitá Besselova funkce nultého řádu, J_0(x). + + asin(x): Inverse sin function. asin(x): Obrácená funkce k sin funkci. - - asinh(x): - Hyperbolic inverse sin function. - asinh(x): - Hyperbolická obrácená funkce k sin funkci. - - - + The file is not an QtiPlot fit model file. + Soubor není souborem QtiPlot modelu umístění. + + + gamma(x): + Computes the Gamma function, subject to x not being a negative integer. + gamma(x): + Počítá funkci gama, předmět x není záporné celé číslo. + + atan(x): Inverse tan function. atan(x): Obrácená funkce k funkci tangens. - + The file is not a QtiPlot custom action file. + Soubor není souborem QtiPlot vlastních akcí. + + atanh(x): Hyperbolic inverse tan function. atanh(x): Hyperbolická obrácená funkce k funkci tangens. - - avg(x,y,...): - Mean value of all arguments. - avg(x,y,...): - Průměrná hodnota všech argumentů. - - - - bessel_j0(x): - Regular cylindrical Bessel function of zeroth order, J_0(x). - bessel_j0(x): - Pravidelná válcovitá Besselova funkce nultého řádu, J_0(x). - - - - bessel_j1(x): - Regular cylindrical Bessel function of first order, J_1(x). - bessel_j1(x): - Pravidelná válcovitá Besselova funkce prvního řádu, J_1(x). - - - - bessel_jn(double x, int n): - Regular cylindrical Bessel function of order n, J_n(x). - bessel_jn(double x, int n): - Pravidelná válcovitá Besselova funkce n-tého řádu, J_n(x). - - - - bessel_jn_zero(double n, unsigned int s): - s-th positive zero x_s of regular cylindrical Bessel function of order n, J_n(x_s)=0 - bessel_jn_zero(double n, jsoucí bez znaménka int s): - s-tá kladná zero x_s pravidelné válcovité Besselovy funkce n-tého řádu, J_n(x_s)=0 - - - - bessel_y0(x): - Irregular cylindrical Bessel function of zeroth order, Y_0(x), for x>0. - bessel_y0(x): - Nepravidelná válcovitá Besselova funkce nultého řádu, Y_0(x),pro x>0. - - - - bessel_y1(x): - Irregular cylindrical Bessel function of first order, Y_1(x), for x>0. - bessel_y1(x): - Nepravidelná válcovitá Besselova funkce prvního řádu, Y_1(x),pro x>0. - - - - bessel_yn(double x, int n): - Irregular cylindrical Bessel function of order n, Y_n(x), for x>0. - bessel_yn(double x, int n): - Nepravidelná válcovitá Besselova funkce n-tého řádu, Y_n(x), pro x>0. - - - + ttable(x, n): + Student's t-distribution with n degrees of freedom. + ttable(x, n): + Studentovo rozložení s n stupni volnosti. + + + inv_gauss_cdf(x, sigma): + Computes the inverse of the cumulative distribution function for a Gaussian distribution with standard deviation sigma. + inv_gauss_cdf(x, sigma): + Počítá převrácenou /reciprokou/ hodnotu kumulativní distribuční funkce pro Gaussovu distribuci s obvyklou odchylkou sigma. + + + mod(x,y): + Calculate rest of integer division x/y, + x modulo y. + mod(x,y): + Počítá zbytek celočíselného dělení x/y, + x modulo y. + + + QtiPlot + QtiPlot + + + sum(x,y,...): + Calculate sum of all arguments. + sum(x,y,...): + Počítá součet všech argumentů. + + + hazard(x): + Computes the hazard function for the normal distribution h(x) = erfz(x)/erfq(x). + hazard(x): + Počítá funkci nebezpečí pro normální/Gaussovo rozdělení h(x) = erfz(x)/erfq(x). + + + tanh(x): + Hyperbolic tan function. + tanh(x): + Hyperbolická funkce tangens. + + + The file is not an QtiPlot fit model version 1.0 file. + Soubor není souborem QtiPlot modelu umístění verze 1.0. + + beta(a,b): Computes the Beta Function, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) for a > 0, b > 0. beta(a,b): Počítá funkci beta, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) pro a > 0, b > 0. - - ceil(x): - Round to the next larger integer, - smallest integer larger or equal to x. - ceil(x): - Zaokrouhlit na nejbližší větší celé číslo, - nejmenší celé číslo větší nebo rovno x. - - - - cos(x): - Calculate cosine. - cos (x): - Počítá cosinus. - - - + sinh(x): + Hyperbolic sin function. + sinh(x): + Hyperbolická funkce sinus. + + + gauss_pdf(x, sigma): + Computes the probability density at x for a Gaussian distribution with standard deviation sigma. + gauss_cdf(x, sigma): + Počítá funkci hustoty pravděpodobnosti v x pro Gaussovu distribuci s obvyklou odchylkou sigma. + + + acos(x): + Inverse cos function. + acos(x): + Obrácená funkce ke cos funkci. + + if(e1, e2, e3): if e1 then e2 else e3. if(e1, e2, e3): pokud e1 pak e2 jinak e3. - - inv_gauss_cdf(x, sigma): - Computes the inverse of the cumulative distribution function for a Gaussian distribution with standard deviation sigma. - inv_gauss_cdf(x, sigma): - Počítá převrácenou /reciprokou/ hodnotu kumulativní distribuční funkce pro Gaussovu distribuci s obvyklou odchylkou sigma. - - - + cosh(x): + Hyperbolic cos function. + cosh(x): + Hyperbolická funkce cosinus. + + + bessel_jn_zero(double n, unsigned int s): + s-th positive zero x_s of regular cylindrical Bessel function of order n, J_n(x_s)=0 + bessel_jn_zero(double n, jsoucí bez znaménka int s): + s-tá kladná zero x_s pravidelné válcovité Besselovy funkce n-tého řádu, J_n(x_s)=0 + + + The file is not an QtiPlot custom action version 1.0 file. + Soubor není souborem QtiPlot vlastních akcí verze 1.0. + + + cos(x): + Calculate cosine. + cos (x): + Počítá cosinus. + + + Python-like syntax is not supported in this case since it severely reduces drawing speed! + Skladba na způsob Pythonu není v tomto případě podporována, jelikož vážně omezuje rychlost kreslení! + + ln(x): Calculate natural logarithm log_e. ln(x): Počítá přirozený logaritmus log_e. - - log(x): - Calculate decimal logarithm log_10. - log(x): - Počítá desetinný logaritmus log_10. - - - log10(x): Calculate decimal logarithm log_10. log10(x): Počítá desetinný logaritmus log_10. - + wm1(x): + Compute the secondary branch of Lambert's W function, W_{-1}(x). + W is defined as a solution to the equation W(x)*exp(W(x))=x. + For x<0, there are two real-valued branches; this function computes the one where W<-1 for x<0. (also see w0(x)). + wm1(x): + Počítá vedlejší větev Lambertovy funkce W, W_{-1}(x). + W je vymezeno jako řešení rovnice W(x)*exp(W(x))=x. + Pro x<0, jsou dvě větve nabývající reálných hodnot; tato funkce počítá tu, kde W<-1 pro x<0 (také se podívejte na wm0(x)). + + + sqrt(x): + Square root function. + sqrt(x): + Funkce druhé mocniny (dvojmocniny). + + + min(x,y,...): + Calculate minimum of all arguments. + min(x,y,...): + Počítá minimum všech argumentů. + + + erf(x): + The error function. + erf(x): + Funkce chyby. + + + Ignored data point at x = %1. + Datový bod na x = %1 nebrán v úvahu. + + + The file is not a QtiPlot custom menu version 1.0 file. + Soubor není souborem QtiPlot vlastního menu verze 1.0. + + + erfz(x): + The Gaussian probability density function Z(x). + erfz(x): + Gaussova funkce hustoty pravděpodobnosti Z(x). + + log2(x): Calculate binary logarithm log_2. log2(x): Počítá dvojkový logaritmus o základu 2 (log_2). - beta (a,b): - Computes the Beta Function, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) for a > 0, b > 0. - beta (a,b): - Počítá funkci beta, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) pro a > 0, b > 0. - - - cos (x): - Calculate cosine. - cos (x): - Počítá cosinus. - - - - cosh(x): - Hyperbolic cos function. - cosh(x): - Hyperbolická funkce cosinus. - - - - erf(x): - The error function. - erf(x): - Funkce chyby. - - - - erfc(x): - Complementary error function erfc(x) = 1 - erf(x). - erfc(x): - Doplňková funkce chyby erfc(x) = 1 - erf(x). - - - - erfz(x): - The Gaussian probability density function Z(x). - erfz(x): - Gaussova funkce hustoty pravděpodobnosti Z(x). - - - - erfq(x): - The upper tail of the Gaussian probability function Q(x). - erfq(x): - Horní část Gaussovy funkce hustoty pravděpodobnosti Q(x). - - - - exp(x): - Exponential function: e raised to the power of x. - exp(x): - Exponenciální funkce: e umocnilo x. - - - - floor(x): - Round to the next smaller integer, - largest integer smaller or equal to x. - floor(x): - Zaokrouhlit na nejbližší nejmenší celé číslo, - největší celé číslo menší nebo rovno x. - - - - gamma(x): - Computes the Gamma function, subject to x not being a negative integer. - gamma(x): - Počítá funkci gama, předmět x není záporné celé číslo. - - - + rint(x): + Round to nearest integer. + rint(x): + Zaokrouhlit na nejbližší celé číslo. + + + w0(x): + Compute the principal branch of Lambert's W function, W_0(x). + W is defined as a solution to the equation W(x)*exp(W(x))=x. + For x<0, there are two real-valued branches; this function computes the one where W>-1 for x<0 (also see wm1(x)). + w0(x): + Počítá hlavní větev Lambertovy funkce W, W_0(x). + W je vymezeno jako řešení rovnice W(x)*exp(W(x))=x. + Pro x<0, jsou dvě větve nabývající reálných hodnot; tato funkce počítá tu, kde W>-1 pro x<0 (také se podívejte na wm1(x)). + + + sin(x): + Calculate sine. + sin (x): + Počítá sinus. + + + sign(x): + Sign function: -1 if x<0; 1 if x>0. + sign(x): + Funkce sign: -1 pokud f x<0; 1 pokud x>0. + + + pow(x,y): + Raise x to the power of y, x^y. + pow(x): + Umocnit x y, x^y. + + gammaln(x): Computes the logarithm of the Gamma function, subject to x not a being negative integer. For x<0, log(|Gamma(x)|) is returned. gammaln(x): Počítá logaritmus funkce gama function, předmět x není záporné celé číslo. Pro x<0, log(|Gamma(x)|) je vrácen. - gauss_cdf(x, sigma): Computes the cumulative distribution function for a Gaussian distribution with standard deviation sigma. gauss_cdf(x, sigma): Počítá hodnotu kumulativní distribuční funkce pro Gaussovu distribuci s obvyklou odchylkou sigma. - - gauss_pdf(x, sigma): - Computes the probability density at x for a Gaussian distribution with standard deviation sigma. - gauss_cdf(x, sigma): - Počítá funkci hustoty pravděpodobnosti v x pro Gaussovu distribuci s obvyklou odchylkou sigma. - - - - hazard(x): - Computes the hazard function for the normal distribution h(x) = erfz(x)/erfq(x). - hazard(x): - Počítá funkci nebezpečí pro normální/Gaussovo rozdělení h(x) = erfz(x)/erfq(x). - - - if(e1, e2, e3): if e1 then e2 else e3. - if(e1, e2, e3): pokud e1 pak e2 else e3. - - - ln(x): - Calculate natural logarithm. - ln(x): - Počítá přirozený logaritmus. - - - log(x): - Calculate decimal logarithm. - log(x): - Počítá desetinný logaritmus. - - - log2(x): - Calculate logarithm to the base 2. - log2(x): - Počítá logaritmus o základu 2. - - - - min(x,y,...): - Calculate minimum of all arguments. - min(x,y,...): - Počítá minimum všech argumentů. - - - - max(x,y,...): - Calculate maximum of all arguments. - max(x,y,...): - Počítá maximum všech argumentů. - - - - mod(x,y): - Calculate rest of integer division x/y, - x modulo y. - mod(x,y): - Počítá zbytek celočíselného dělení x/y, - x modulo y. - - - - pow(x,y): - Raise x to the power of y, x^y. - pow(x): - Umocnit x y, x^y. - - - - rint(x): - Round to nearest integer. - rint(x): - Zaokrouhlit na nejbližší celé číslo. - - - - sign(x): - Sign function: -1 if x<0; 1 if x>0. - sign(x): - Funkce sign: -1 pokud f x<0; 1 pokud x>0. - - - - sin(x): - Calculate sine. - sin (x): - Počítá sinus. - - - - sinh(x): - Hyperbolic sin function. - sinh(x): - Hyperbolická funkce sinus. - - - - sqrt(x): - Square root function. - sqrt(x): - Funkce druhé mocniny (dvojmocniny). - - - - sum(x,y,...): - Calculate sum of all arguments. - sum(x,y,...): - Počítá součet všech argumentů. - - - - tan(x): - Calculate tangent function. - tan(x): - Počítá funkci tangens. - - - - tanh(x): - Hyperbolic tan function. - tanh(x): - Hyperbolická funkce tangens. - - - - ttable(x, n): - Student's t-distribution with n degrees of freedom. - ttable(x, n): - Studentovo rozložení s n stupni volnosti. - - - - w0(x): - Compute the principal branch of Lambert's W function, W_0(x). - W is defined as a solution to the equation W(x)*exp(W(x))=x. - For x<0, there are two real-valued branches; this function computes the one where W>-1 for x<0 (also see wm1(x)). - w0(x): - Počítá hlavní větev Lambertovy funkce W, W_0(x). - W je vymezeno jako řešení rovnice W(x)*exp(W(x))=x. - Pro x<0, jsou dvě větve nabývající reálných hodnot; tato funkce počítá tu, kde W>-1 pro x<0 (také se podívejte na wm1(x)). - - - - wm1(x): - Compute the secondary branch of Lambert's W function, W_{-1}(x). - W is defined as a solution to the equation W(x)*exp(W(x))=x. - For x<0, there are two real-valued branches; this function computes the one where W<-1 for x<0. (also see w0(x)). - wm1(x): - Počítá vedlejší větev Lambertovy funkce W, W_{-1}(x). - W je vymezeno jako řešení rovnice W(x)*exp(W(x))=x. - Pro x<0, jsou dvě větve nabývající reálných hodnot; tato funkce počítá tu, kde W<-1 pro x<0 (také se podívejte na wm0(x)). - - - - QtiPlot - Math Error - QtiPlot - Chyba v matematice - - - - Found non-removable singularity at x = %1. - Nalezena neodstranitelná singularita na x = %1. + acosh(x): + Hyperbolic inverse cos function. + acosh(x): + Hyperbolická obrácená funkce ke cos funkci. + + + QtiPlot - Memory Allocation Error + QtiPlot - Chyba v přidělení paměti + + + Not enough memory, operation aborted! + Není dostatek paměti, a tak byla operace zrušena! + + + The function %1 is not defined in the specified interval! + Funkce %1 není vymezena v zadaném intervalu! + + + AVG("colName", i, j): + The average of all cells from row i to j in column colName. + AVG("colName", i, j): + Průměr všech buněk od řádku i po j ve sloupci colName. + + + SUM("colName", i, j): + The sum of all cells from row i to j in column colName. + SUM("colName", i, j): + Součet všech buněk od řádku i po j ve sloupci colName. + + + rnd(seed): + Returns a pseudo-random number in the range 0 to 1. Calling this function several times with the same seed will return the same value. + QtColorPicker - - - - Black - Černá - - - - - White - Bílá - - - - Red Červená - - - Dark red - Tmavě červená - - - - - Green - Zelená - - - - - Dark green - Tmavě zelená - - - - Blue Modrá - - - Dark blue - Tmavě modrá - - - - Cyan Modrozelená - - - Dark cyan - Tmavě modrozelená - - - - + Gray + Šedá + + + Black + Černá + + + Green + Zelená + + + White + Bílá + + Magenta Červenorudá - - - Dark magenta - Tmavě červenorudá + Custom + Vlastní - - Yellow Žlutá - - Dark yellow Tmavě žlutá - - - Gray - Šedá - - - - + Dark magenta + Tmavě červenorudá + + + Dark red + Tmavě červená + + Dark gray Tmavě šedá - - + Dark blue + Tmavě modrá + + + Dark cyan + Tmavě modrozelená + + + Dark green + Tmavě zelená + + Light gray Světle šedá - - - Custom - Vlastní - RangeSelectorTool - - - - - - - QtiPlot - Warning - QtiPlot - Varování - - - + Left + Vlevo + + + Right + Vpravo + + All the curves on this plot are empty! Všechny křivky na tomto nákresu jsou prázdné! - Click or use Ctrl+arrow key to select range (arrows select active cursor)! Klepněte nebo použijte Ctrl+klávesu šipky pro výběr rozsahu (šipky vybírají aktivní ukazovátko)! - - - - Right - Vpravo - - - - - - Left - Vlevo - - - - - - - - The column '%1' is read-only! Operation aborted! - Sloupec '%1' je pouze pro čtení! Operace zrušena! - - - + Copy data to clipboard? + Kopírovat data do schránky? + + + QtiPlot - Warning + QtiPlot - Varování + + Remove data from curves? Odstranit data z křivek? - - Copy data to clipboard? - Kopírovat data do schránky? + The column '%1' is read-only! Operation aborted! + Sloupec '%1' je pouze pro čtení! Operace zrušena! RenameWindowDialog - - QtiPlot - Rename Window - QtiPlot - Přejmenovat okno - - - - Window Title - Název okna - - - + &OK + &OK + + + &Label + &Popis + + &Name (single word) &Název (jednotlivé slovo) - - &Label - &Popis - - - &Both Name and Label &Jak název tak popis - - &OK - &OK - - - &Cancel &Zrušit - - QtiPlot - Warning - QtiPlot - Varování + Window Title + Název okna - For internal consistency reasons the underscore character is replaced with a minus sign. Z důvodů zajištění vnitřní ucelenosti by znaky podtržení nahrazeny znaménkem mínus. + + QtiPlot - Rename Window + QtiPlot - Přejmenovat okno + + + QtiPlot - Warning + QtiPlot - Varování + ScreenPickerTool - Click on plot or move cursor to display coordinates! Klepněte na nákres nebo pohněte ukazovátkem pro zobrazení souřadnic! @@ -16273,470 +12253,336 @@ ScriptEdit - - E&xecute - &Vykonat - - - - Ctrl+J - Ctrl+J - - - - Execute &All - Vykonat &vše - - - - Ctrl+Shift+J - Ctrl+Shift+J - - - - &Evaluate Expression - &Vyhodnotit výraz - - - + Text + Text + + + &Save + &Uložit + + Ctrl+Return Ctrl+Return - + Save Text to File + Uložit text do souboru + + + QtiPlot - Import Text From File + QtiPlot - Zavést text ze souboru + + + &Replace... + &Nahradit... + + &Print &Tisk - + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + Nelze zapisovat do souboru: <br><h4> %1 </h4><p>Ověřte, prosím, že máte oprávnění pro zápis do tohoto umístění! + + + &Find next + Najít &další + + + &Functions + &Funkce + + + Ctrl+J + Ctrl+J + + + &Find previous + Najít &předchozí + + + C&lose Tab + &Zavřít kartu + + + Sa&ve as... + &Uložit jako... + + &Import... &Zavést... - - &Save - &Uložit - - - - Sa&ve as... - &Uložit jako... - - - - &Find... - &Najít... - - - - &Replace... - &Nahradit... - - - - &Find next - Najít &další - - - - &Find previous - Najít &předchozí - - - + QtiPlot + QtiPlot + + Rena&me Tab... &Přejmenovat kartu... - - A&dd Tab - Při&dat kartu - - - - C&lose Tab - &Zavřít kartu - - - Auto&exec &Automaticky vykonat - - &Functions - &Funkce - - - - - Text - Text - - - - - All Files - Všechny soubory - - - - QtiPlot - Import Text From File - QtiPlot - Zavést text ze souboru - - - + QtiPlot has finished searching the document. + QtiPlot dokončil prohledávání dokumentu. + + + QtiPlot - File Save Error + QtiPlot - Chyba při ukládání souboru + + QtiPlot - Error Opening File QtiPlot - Chyba při otevírání souboru - + A&dd Tab + Při&dat kartu + + + &Find... + &Najít... + + + Ctrl+Shift+J + Ctrl+Shift+J + + + E&xecute + &Vykonat + + + All Files + Všechny soubory + + + &Evaluate Expression + &Vyhodnotit výraz + + + Execute &All + Vykonat &vše + + Could not open file "%1" for reading. Nepodařilo se otevřít soubor "%1" pro čtení. - - - Save Text to File - Uložit text do souboru - - - - QtiPlot - File Save Error - QtiPlot - Chyba při ukládání souboru - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - Nelze zapisovat do souboru: <br><h4> %1 </h4><p>Ověřte, prosím, že máte oprávnění pro zápis do tohoto umístění! - - - - QtiPlot - QtiPlot - - - - QtiPlot has finished searching the document. - QtiPlot dokončil prohledávání dokumentu. - ScriptWindow - - - QtiPlot - Script Window - QtiPlot - Skriptovací okno - - - - - &File - &Soubor - - - - + F3 + F3 + + + F4 + F4 + + + &Cut + &Vyjmout + + + &New + &Nový + + + &Copy + &Kopírovat + + &Edit &Upravovat - - - - - E&xecute - &Vykonat - - - - &Window - &Okno - - - - - &New - &Nový - - - - - Ctrl+N - Ctrl+N - - - - - &Open... - &Otevřít... - - - - - Ctrl+O - Ctrl+O - - - - + &File + &Soubor + + + &Redo + &Udělat znovu + + &Save &Uložit - - - Ctrl+S - Ctrl+S - - - - + &Undo + &Vrátit zpět + + + CTRL+Return + Ctrl+Return + + + &Replace... + &Nahradit... + + + &Close + &Zavřít + + + &Paste + &Vložit + + + &Print + &Tisk + + + Ouput on Next &Line + Výstup na dalším &řádku + + Save &As... Uložit &jako... - - - &Print - &Tisk - - - - + CTRL+SHIFT+J + Ctrl+Shift+J + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + Nelze zapisovat do souboru: <br><h4> %1 </h4><p>Ověřte, prosím, že máte oprávnění pro zápis do tohoto umístění! + + + CTRL+J + Ctrl+J + + + Ctrl+C + Ctrl+C + + + Ctrl+N + Ctrl+N + + + Ctrl+O + Ctrl+O + + Ctrl+P Ctrl+P - - - &Undo - &Vrátit zpět - - - - + Ctrl+S + Ctrl+S + + + Ctrl+V + Ctrl+V + + + Ctrl+Y + Ctrl+Y + + Ctrl+Z Ctrl+Z - - - &Redo - &Udělat znovu - - - - - Ctrl+Y - Ctrl+Y - - - - - &Cut - &Vyjmout - - - - Ctrl+x Ctrl+X - - - &Copy - &Kopírovat - - - - - Ctrl+C - Ctrl+C - - - - - &Paste - &Vložit - - - - - Ctrl+V - Ctrl+V - - - - - Increase Indent - Zvětšit odsazení - - - - - Decrease Indent - Zmenšit odsazení - - - - - &Find... - &Najít... - - - - - Ctrl+Alt+F - Ctrl+Alt+F - - - - - Find &Next - Najít &další - - - - - F3 - F3 - - - - - Find &Previous - Najít &předchozí - - - - - F4 - F4 - - - - - &Replace... - &Nahradit... - - - Show &Line Numbers Ukázat čísla &řádků - - - CTRL+J - Ctrl+J - - - - - Execute &All - Vykonat &vše - - - - - CTRL+SHIFT+J - Ctrl+Shift+J - - - - - &Evaluate Expression - &Vyhodnotit výraz - - - - - CTRL+Return - Ctrl+Return - - - + Find &Next + Najít &další + + + &Open... + &Otevřít... + + Always on &Top Vždy &nahoře - &Hide - &Skrýt - - - - QtiPlot - File Save Error - QtiPlot - Chyba při ukládání souboru - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - Nelze zapisovat do souboru: <br><h4> %1 </h4><p>Ověřte, prosím, že máte oprávnění pro zápis do tohoto umístění! - - - - You need to close and reopen the script window before your changes become effective! Do you want to close it now? - Musíte zavřít a znovu otevřít skriptovací okno předtím, než se vaše změny projeví. Chcete jej zavřít nyní? - - - - - QtiPlot - QtiPlot - - - - + Find &Previous + Najít &předchozí + + Script Output Panel Výstupní panel pro skript - - + QtiPlot + QtiPlot + + + Script print preview + Náhled tisku skriptu + + Print Pre&view... Náhled &tisku... - - + QtiPlot - File Save Error + QtiPlot - Chyba při ukládání souboru + + + &Window + &Okno + + Show Script &Output Panel Ukázat &výstupní panel pro skript - - - Ouput on Next &Line - Výstup na dalším &řádku - - - - + &Find... + &Najít... + + + E&xecute + &Vykonat + + + &Evaluate Expression + &Vyhodnotit výraz + + + Decrease Indent + Zmenšit odsazení + + + Increase Indent + Zvětšit odsazení + + + Execute &All + Vykonat &vše + + + Ctrl+Alt+F + Ctrl+Alt+F + + + Show Script Output Panel + Ukázat výstupní panel pro skript + + + QtiPlot - Script Window + QtiPlot - Skriptovací okno + + + You need to close and reopen the script window before your changes become effective! Do you want to close it now? + Musíte zavřít a znovu otevřít skriptovací okno předtím, než se vaše změny projeví. Chcete jej zavřít nyní? + + Show &Workspace Ukázat &pracovní prostor - - - - &Close - &Zavřít - - - - Show Script Output Panel - Ukázat výstupní panel pro skript - - - - Script print preview - Náhled tisku skriptu - ScriptingEnv - %1 Source (*.%2);; %1 Zdroj (*.%2);; @@ -16744,630 +12590,524 @@ ScriptingLangDialog - + OK + OK + + QtiPlot - Select scripting language QtiPlot - Vybrat skriptovací jazyk - - OK - OK + Scripting language "%1" failed to initialize. + Skriptovací jazyk "%1" se nepodařilo inicializovat. - Cancel Zrušit - QtiPlot - Scripting Error QtiPlot - Chyba skriptu - - - Scripting language "%1" failed to initialize. - Skriptovací jazyk "%1" se nepodařilo inicializovat. - SetColValuesDialog - - QtiPlot - Set column values - QtiPlot - Nastavit hodnoty sloupce - - - - For row (i) - Pro řádek (i) - - - to do - Add function Přidat funkci - + &Apply + &Použít + + + &Close + &Zavřít + + Add column Přidat sloupec - + For row (i) + Pro řádek (i) + + Add cell Přidat buňku - - &Apply - &Použít - - - - &Close - &Zavřít - - - - Use built-in muParser (much faster) - Použít vestavěný muParser (mnohem rychlejší) - - - Clear &Formulas Smazat &vzorce + + QtiPlot - Set column values + QtiPlot - Nastavit hodnoty sloupce + + + Use built-in muParser (much faster) + Použít vestavěný muParser (mnohem rychlejší) + SigmoidalFit - Boltzmann Boltzmann - init value počáteční hodnota - + center + střed + + + Boltzmann (Sigmoidal) Fit + Boltzmannovo umístění (esovité) + + final value konečná hodnota - - center - střed - - - time constant stálá hodnota času - - - Boltzmann (Sigmoidal) Fit - Boltzmannovo umístění (esovité) - SmoothCurveDialog - + f + + + + Color + Barva + + + Curve + Křivka + + + &Close + &Zavřít + + + Points + Body + + + Points to the Right + Body napravo + + + Iterations + + + + &Smooth + &Vyhladit + + QtiPlot - Smoothing Options QtiPlot - Volby pro vyhlazování - - Curve - Křivka - - - Polynomial Order Mnohočlenný (polynomický) řád - Points to the Left Body nalevo - - - Points to the Right - Body napravo - - - - - - Color - Barva - - - - f - - - - - Iterations - - - - - Points - Body - - - - &Smooth - &Vyhladit - - - - &Close - &Zavřít - SmoothFilter - - Smoothed - Vyhlazeno - - - - - - - - - - - QtiPlot - QtiPlot - - - - - - - - - - Error Chyba - Unknown smooth filter. Valid values are: 1 - Savitky-Golay, 2 - FFT, 3 - Moving Window Average. - Neznámý filtr pro vyhlazování. Platnými hodnotami jsou: 1 - Savitky-Golay, 2 - FFT, 3 - Klouzající okenní průměr. - - - - Unknown smooth filter. Valid values are: 1 - Savitky-Golay, 2 - FFT, 3 - Moving Window Average, 4 - Lowess. - - - - - - - - points - Body - - - + FFT smoothing + FFT vyhlazování + + Savitzky-Golay smoothing Vyhlazování Savitzky-Golay - - FFT smoothing - FFT vyhlazování + The number of iterations must be at least 1! + - average smoothing průměrné vyhlazování - - Lowess smoothing - - - - + Smoothed + Vyhlazeno + + + The polynomial order must be lower than the number of left points plus the number of right points! + Mnohočlenný (polynomický) řád musí být nižší než počet levých bodů plus počet pravých bodů! + + + points + Body + + + QtiPlot + QtiPlot + + + Lowess smoothing with f=%1 and %2 iterations + + + + Setting Lowess parameter is only available for Lowess smooth filters! Ignored option! + + + The number of points must be positive! Počet bodů musí být kladný! - - - The polynomial order must be lower than the number of left points plus the number of right points! - Mnohočlenný (polynomický) řád musí být nižší než počet levých bodů plus počet pravých bodů! - - - + The parameter f must be between 0 and 1! + + + + Unknown smooth filter. Valid values are: 1 - Savitky-Golay, 2 - FFT, 3 - Moving Window Average, 4 - Lowess. + + + Setting polynomial order is only available for Savitzky-Golay smooth filters! Ignored option! Nastavení mnohočlenného (polynomického) řádu je dostupné pouze u filtrů pro vyhlazování Savitzky-Golay! Volba není brána na vědomí! - - - Setting Lowess parameter is only available for Lowess smooth filters! Ignored option! - - - - - The parameter f must be between 0 and 1! - - - - - The number of iterations must be at least 1! - - SortDialog - + &Sort + &Seřadit + + + Order + Směr + + QtiPlot - Sorting Options QtiPlot - Volby pro seřazení - - Sort columns - Seřadit sloupce - - - + &Close + &Zavřít + + + Together + Dohromady + + Separately Jednotlivě - - Together - Dohromady - - - - Order - Směr - - - + Descending + Sestupně + + Ascending Vzestupně - - Descending - Sestupně - - - Leading column Seřadit podle hlavního sloupce - - &Sort - &Seřadit - - - + Sort columns + Seřadit sloupce + + + + SubtractDataDialog + + QtiPlot + QtiPlot + + + Math on Data Sets + + + + Cu&rve + + + + &Operator + + + + &Data set + + + + Current &folder + + + + &Value + + + + &Apply + &Použít + + &Close - &Zavřít + &Zavřít + + + Error + Chyba + + + Data set %1 must containt at least two valid data points in order to perform this operation! + + + + + SubtractLineTool + + Move cursor and click to select and double-click/press 'Enter' to set the position of the first point! + + + + First point selected! Click to select and double-click/press 'Enter' to set the position of the 2nd point! + SurfaceDialog - + u + u + + + v + v + + + To + Do + + + &OK + &OK + + + From + Od + + + Mesh + Síť + + + Rows + Řádky + + + QtiPlot - X Formula Error + QtiPlot - Chyba vzorce x + + + QtiPlot - Y Formula Error + QtiPlot - Chyba vzorce y + + + QtiPlot - Z Formula Error + QtiPlot - Chyba vzorce z + + + &Close + &Zavřít + + + X - axis + X - osa + + + Y - axis + Y - osa + + + Z - axis + Z - osa + + + Clea&r + Vypráz&dnit + + + QtiPlot - Input error + QtiPlot - Chyba v zadání + + QtiPlot - Define surface plot QtiPlot - Stanovit nákres povrchu - - Surface type - Druh povrchu - - - - Function - Funkce - - - + Please, choose a function: + + + Parametric Parametrický - - Clear &list - Vyprázdnit &seznam - - - - &OK - &OK - - - - &Close - &Zavřít - - - + QtiPlot + QtiPlot + + + Rece&nt + + + + Recent Functions + + + f(x,y)= f(x,y)= - - X - axis - X - osa - - - -1 - -1 - - - 1 - 1 - - - - - - - - From - Od - - - - - - - - To - Do - - - - Y - axis - Y - osa - - - - Z - axis - Z - osa - - - - - Mesh - Síť - - - - + Click here to select a recently typed expression + + + Columns Sloupce - - - Rows - Řádky + X(u,v)= + X(u,v)= - Equations Rovnice - - X(u,v)= - X(u,v)= - - - Y(u,v)= Y(u,v)= - + Function + Funkce + + + Periodic + Pravidelný + + + Surface type + Druh povrchu + + Z(u,v)= Z(u,v)= - - u - u - - - - - Periodic - Pravidelný - - - - v - v - - - - QtiPlot - X Formula Error - QtiPlot - Chyba vzorce x - - - - QtiPlot - Y Formula Error - QtiPlot - Chyba vzorce y - - - - QtiPlot - Z Formula Error - QtiPlot - Chyba vzorce z - - - - QtiPlot - u start limit error - QtiPlot - Chyba počáteční hodnoty u - - - - - QtiPlot - u end limit error - QtiPlot - Chyba koncové hodnoty u - - - - QtiPlot - v start limit error - QtiPlot - Chyba počáteční hodnoty v - - - QtiPlot - X Start limit error - QtiPlot - Chyba: neplatná počáteční hodnota x - - - QtiPlot - X End limit error - QtiPlot - Chyba: neplatná konečná hodnota x - - - QtiPlot - Y Start limit error - QtiPlot - Chyba: neplatná počáteční hodnota y - - - QtiPlot - Y End limit error - QtiPlot - Chyba: neplatná konečná hodnota y - - - QtiPlot - Z Start limit error - QtiPlot - Chyba: neplatná počáteční hodnota z - - - QtiPlot - Z End limit error - QtiPlot - Chyba: neplatná konečná hodnota z - - - - QtiPlot - Input error - QtiPlot - Chyba v zadání - - - + QtiPlot - Input function error + QtiPlot - Chyba v zadání funkce + + + Sorry, there are no recent expressions available! + + + Please enter limits that satisfy: from < end! Zadejte, prosím, hodnoty x, který vyhoví: Začátek < Konec! - - - QtiPlot - Input function error - QtiPlot - Chyba v zadání funkce - SymbolBox - + Cross + Kříž + + + Diagonal Cross + Úhlopříčný kříž + + + Down Triangle + Trojúhelník dolů + + + Star 1 + Hvězda 1 + + + Star 2 + Hvězda 2 + + No Symbol Žádný symbol - - Ellipse - Elipsa - - - - Rectangle - Obdélník - - - - Diamond - Kosočtverec - - - + Right Triangle + Trojúhelník napravo + + + Up Triangle + Trojúhelník nahoru + + Triangle Trojúhelník - - Down Triangle - Trojúhelník dolů - - - - Up Triangle - Trojúhelník nahoru - - - Left Triangle Trojúhelník nalevo - - Right Triangle - Trojúhelník napravo - - - - Cross - Kříž - - - - Diagonal Cross - Úhlopříčný kříž - - - - Horizontal Line - Vodorovná čára - - - + Rectangle + Obdélník + + + Diamond + Kosočtverec + + Vertical Line Svislá čára - - Star 1 - Hvězda 1 - - - - Star 2 - Hvězda 2 - - - + Ellipse + Elipsa + + Hexagon Šestiúhelník + + Horizontal Line + Vodorovná čára + SymbolDialog - &Close &Zavřít - QtiPlot - Choose Symbol QtiPlot - Vybrat symbol @@ -17375,766 +13115,587 @@ Table - - Multiline expressions take much more time to evaluate! Do you want to continue anyways? - Vyhodnocení výrazů zybírajících více řádků trvá mnohem delší dobu! Tak či tak chcete pokračovat? - - - - - - - QtiPlot - QtiPlot - - - - Warning - Varování - - - - - - - - - - - - - - - - - + kB + kB + + + Yes + Ano + + QtiPlot - Error QtiPlot - Chyba - - - - Column '%1' is read only! - Sloupec '%1' je pouze pro čtení! - - - - There is already a column called : <b> - Již zde je sloupec s názvem: <b> - - - + Columns will be deleted from the table! + Sloupce budou vymazány z tabulky! + + + QtiPlot - ASCII Export Error + QtiPlot - Chyba při vyvedení ASCII + + + The folowing columns + Následující sloupce + + + Cancel + Zrušit + + The table '%1' contains read-only columns! Operation aborted! Tabulka '%1' obsahuje sloupce pouze pro čtení! Operace zrušena! - - - - - - - - - The folowing columns - Následující sloupce - - - - - - - - - - - are read only! - jsou pouze pro čtení! - - - + Do you really want to continue? + Opravdu chcete pokračovat? + + Paste operation Operace s vložením - + &Comments + Po&známky + + + There is already a column called : <b> + Již zde je sloupec s názvem: <b> + + How should QtiPlot interpret first clipboard line? Jakým způsobem má QtiPlot vykládat první řádek schránky? - - &Values - &Hodnoty - - - + Rows will be deleted from the table! + Řádky budou vymazány z tabulky! + + + QtiPlot + QtiPlot + + + Qtiplot + QtiPlot + + Column &Names &Názvy sloupců - - &Comments - Po&známky - - - - Please indicate the name of the leading column! - Ukažte, prosím, název hlavního sloupce! - - - The leading column has the type set to 'Text'! Operation aborted! - Hlavní sloupec má typ nastavený na 'Text'! Operace zrušena! - - - + Multiline expressions take much more time to evaluate! Do you want to continue anyways? + Vyhodnocení výrazů zybírajících více řádků trvá mnohem delší dobu! Tak či tak chcete pokračovat? + + + Could not write to file: <br><h4> + Nelze zapisovat do souboru: <br><h4> + + The leading column is empty! Operation aborted! Hlavní sloupec je prázdný! Operace zrušena! - - Qtiplot - QtiPlot - - - Reading file... Čte se soubor... - - QtiPlot - ASCII Export Error - QtiPlot - Chyba při vyvedení ASCII - - - - Could not write to file: <br><h4> - Nelze zapisovat do souboru: <br><h4> - - - - Rows will be deleted from the table! - Řádky budou vymazány z tabulky! - - - - - Do you really want to continue? - Opravdu chcete pokračovat? - - - - - Yes - Ano - - - - - Cancel - Zrušit - - - - Columns will be deleted from the table! - Sloupce budou vymazány z tabulky! - - - - kB - kB + &Values + &Hodnoty + + + Please indicate the name of the leading column! + Ukažte, prosím, název hlavního sloupce! + + + Warning + Varování + + + are read only! + jsou pouze pro čtení! + + + Column '%1' is read only! + Sloupec '%1' je pouze pro čtení! TableDialog - + h + h + + + &OK + &OK + + + hmm + hmm + + + Date + Datum + + + None + Žádný + + + Text + Text + + + Time + Čas + + + h AP + h ap + + + h ap + h ap + + + h:mm + h:mm + + + Label + Štítek + + + Month + Měsíc + + + hh:mm + hh:mm + + + hmmss + hmmss + + + Plot Designation: + Přiřazení nákresu: + + + mm:ss + mm:ss + + + Scientific: 1E3 + Vědecký: 1E3 + + + yyyyMMdd + rrrrmmdd + + + QtiPlot - Error + QtiPlot - Chyba + + + dd MM yyyy HH:mm:ss + dd.mm.rrrr hh:mm:ss + + + dd.MM.yyyy HH:mm:ss + dd.mm.rrrr hh:mm:ss + + + dd/MM/yyyy HH:mm:ss + dd/mm/rrrr hh:mm:ss + + + mm:ss.zzz + mm:ss.zzz + + QtiPlot - Column options QtiPlot - Volby pro sloupce - + h:mm:ss.zzz + h:mm:ss.zzz + + + dd MM yyyy + dd mm rrrr + + + dd/MM/yyyy + dd/mm/rrrr + + + dd.MM.yyyy + dd.mm.rrrr + + + &Apply + &Použít + + + Apply to all + Použít na vše + + + X (abscissae) + Hodnota pro X (abscisa, x-ová souřadnice) + + + Couldn't guess the source data format, please specify it using the 'Format' box! + Formát zdrojových dat nelze poznat. Zadejte jej, prosím, s pomocí okénka 'Formát'! + + Column Name: Název sloupce: - - Enumerate all to the right - Vypočítat vše napravo - - - - &OK - &OK - - - - &Apply - &Použít - - - - &Cancel - &Zrušit - - - - Plot Designation: - Přiřazení nákresu: - - - - None - Žádný - - - - X (abscissae) - Hodnota pro X (abscisa, x-ová souřadnice) - - - + &Display Comments in Header + &Zobrazovat poznámky v záhlaví + + + yyyy-MM-dd HH:mm:ss + dd mm rrrr hh:mm:ss + + Y (ordinates) Hodnota pro Y (pořadnice, ordináta) - - Z (height) - Z (výška) - - - - X Error - Chyba x - - - - Y Error - Chyba y - - - - Label - Štítek - - - - Display - Zobrazení - - - - Numeric - Číselný - - - - Text - Text - - - - Date - Datum - - - - Time - Čas - - - - Month - Měsíc - - - - Day of Week - Den v týdnu - - - - Format: - Formát: - - - - Precision: - Přesnost: - - - - &Read-only - &Pouze pro čtení - - - - &Hidden - &Skryto - - - + Decimal: 1000 + Desetinný: 1000 + + Apply to all columns to the right Použít na všechny sloupce napravo - - Options - Volby - - - - Column Width: - Šířka sloupce: - - - - Apply to all - Použít na vše - - - - &Display Comments in Header - &Zobrazovat poznámky v záhlaví - - - + Numeric + Číselný + + + Day of Week + Den v týdnu + + + For more information about the supported date/time formats please read the Qt documentation for the QDateTime class! + Více informací o podporovaných formátech data/času si, prosím, přečtěte v Qt dokumentaci pro třídu QDateTime! + + Comment: Poznámka: - - QtiPlot - Warning - QtiPlot - Varování - - - - For internal consistency reasons the underscore character is replaced with a minus sign. - Z důvodů vnitřní ucelenosti je znak podtržení nahrazen znaménkem mínus. - - - - - QtiPlot - Error - QtiPlot - Chyba - - - - The column names must only contain letters and digits! - Názvy sloupců musí obsahovat pouze písmena a číslice! - - - - Default - Výchozí - - - - Decimal: 1000 - Desetinný: 1000 - - - - Scientific: 1E3 - Vědecký: 1E3 - - - - dd/MM/yyyy - dd/mm/rrrr - - - + Options + Volby + + + hhmmss + hhmmss + + + yyyyMMdd HH:mm + rrrrmmdd hh:mm + + + &Read-only + &Pouze pro čtení + + + dd.MM.yyyy HH:mm + dd.mm.rrrr hh:mm + + dd/MM/yyyy HH:mm dd/mm/rrrr hh:mm - - dd/MM/yyyy HH:mm:ss - dd/mm/rrrr hh:mm:ss - - - - dd.MM.yyyy - dd.mm.rrrr - - - - dd.MM.yyyy HH:mm - dd.mm.rrrr hh:mm - - - - dd.MM.yyyy HH:mm:ss - dd.mm.rrrr hh:mm:ss - - - - dd MM yyyy - dd mm rrrr - - - + Precision: + Přesnost: + + + X Error + Chyba x + + + yyyy-MM-dd HH:mm + rrrr mm dd hh:mm + + + &Cancel + &Zrušit + + + Default + Výchozí + + dd MM yyyy HH:mm dd mm rrrr hh:mm - - dd MM yyyy HH:mm:ss - dd.mm.rrrr hh:mm:ss - - - - yyyy-MM-dd - rrrr mm dd - - - - yyyy-MM-dd HH:mm - rrrr mm dd hh:mm - - - - yyyy-MM-dd HH:mm:ss - dd mm rrrr hh:mm:ss - - - - yyyyMMdd - rrrrmmdd - - - - yyyyMMdd HH:mm - rrrrmmdd hh:mm - - - yyyyMMdd HH:mm:ss rrrrmmdd hh:mm:ss - - h - h - - - - h ap - h ap - - - - h AP - h ap - - - - h:mm - h:mm - - - + &Hidden + &Skryto + + + Display + Zobrazení + + + Y Error + Chyba y + + h:mm ap h:mm ap - - hh:mm - hh:mm - - - h:mm:ss h:mm:ss - - h:mm:ss.zzz - h:mm:ss.zzz - - - - mm:ss - mm:ss - - - - mm:ss.zzz - mm:ss.zzz - - - - hmm - hmm - - - - hmmss - hmmss - - - - hhmmss - hhmmss - - - - Couldn't guess the source data format, please specify it using the 'Format' box! - Formát zdrojových dat nelze poznat. Zadejte jej, prosím, s pomocí okénka 'Formát'! - - - - For more information about the supported date/time formats please read the Qt documentation for the QDateTime class! - Více informací o podporovaných formátech data/času si, prosím, přečtěte v Qt dokumentaci pro třídu QDateTime! + yyyy-MM-dd + rrrr mm dd + + + Format: + Formát: + + + For internal consistency reasons the underscore character is replaced with a minus sign. + Z důvodů vnitřní ucelenosti je znak podtržení nahrazen znaménkem mínus. + + + QtiPlot - Warning + QtiPlot - Varování + + + Z (height) + Z (výška) + + + The column names must only contain letters and digits! + Názvy sloupců musí obsahovat pouze písmena a číslice! + + + Enumerate all to the right + Vypočítat vše napravo + + + Column Width: + Šířka sloupce: TableStatistics - + Col + Sloupec + + + Max + Maximum + + + Min + Minimum + + + Row + Řádek + + + Sum + Součet + + + Cols + Sloupce + + + Mean + Průměrná hodnota + + + Rows + Řádky + + + iMax + iMax + + + iMin + iMin + + + StandardError + Obvyklá chyba + + + Median + Střední hodnota + + + ColStats + Statistické údaje ke sloupcům + + RowStats Statistické údaje k řádkům - + Variance + Odchylka + + Row Statistics of %1 Statistické údaje řádků pro %1 - - Row - Řádek - - - - Cols - Sloupce - - - - - Mean - Průměrná hodnota - - - - - StandardDev - Obvyklá odchylka - - - - - StandardError - Obvyklá chyba - - - - - Variance - Odchylka - - - - - Sum - Součet - - - - - Max - Maximum - - - - - Min - Minimum - - - - - Median - Střední hodnota - - - - ColStats - Statistické údaje ke sloupcům - - - Column Statistics of %1 Statistické údaje sloupců pro %1 - - Col - Sloupec - - - - Rows - Řádky - - - - iMax - iMax - - - - iMin - iMin + StandardDev + Obvyklá odchylka TextDialog - + Font + Písmo + + + Left + Vlevo + + + &Font + &Písmo + + + Layer + Vrstva + + + Right + Vpravo + + + Y Axis Title + Název osy y + + + X Axis Title + Název osy x + + + Distance to axis + Vzdálenost od os + + + &Close + &Zavřít + + + Top Axis Title + Název osy nahoře + + + Center + Na střed + + QtiPlot - Text options QtiPlot - Volby pro text - + Object + Předmět + + + &Inverted + &Obrácený + + + Window + Okno + + Text Color Barva textu - - Font - Písmo - - - - &Font - &Písmo - - - - Alignment - Zarovnání - - - - Center - Na střed - - - - Left - Vlevo - - - - Right - Vpravo - - - - Distance to axis - Vzdálenost od os - - - + QtiPlot + QtiPlot + + &Apply to... &Použít na... - - Object - Předmět - - - - Layer - Vrstva - - - - Window - Okno - - - - All Windows - Všechna okna - - - - &Close - &Zavřít - - - - - - - QtiPlot - QtiPlot - - - - X Axis Title - Název osy x - - - - Y Axis Title - Název osy y - - - - Top Axis Title - Název osy nahoře - - - Right Axis Title Název osy vpravo - - &Inverted - &Obrácený + All Windows + Všechna okna + + + Alignment + Zarovnání TextEditor - QtiPlot QtiPlot - - Confirmation - Potvrzení - - - Are you sure you want to add %1 text lines into this text box? Jste si jist, že chcete přidat '%1' řádky textu do tohoto textového okénka? + + Confirmation + Potvrzení + TextFormatButtons - + B + Tučné + + + U + Podtržení + + + It + Kurzíva + + B Button bold Tučné - It Button italics Kurzíva - U Button underline Podtržení @@ -18143,417 +13704,157 @@ ThreeExpFit - + first amplitude + první rozkmit + + + third lifetime + třetí životnost + + + second amplitude + druhý rozkmit + + ExpDecay3 Exp. pokles 3 - - Exponential decay - Exponenciální pokles - - - - first amplitude - první rozkmit - - - - first lifetime - první životnost - - - - second amplitude - druhý rozkmit - - - second lifetime druhá životnost - + offset + posun + + third amplitude třetí rozkmit - - third lifetime - třetí životnost + Exponential decay + Exponenciální pokles - - offset - posun + first lifetime + první životnost TranslateCurveTool - + This operation cannot be performed on curves plotted from columns having a non-numerical format. + Tuto operaci nelze provést na křivkách nakreslených ze sloupců, které nemají číselný formát. + + Double-click on plot to select a data point! Klepněte dvakrát na nákres pro výběr datového bodu! - - - - - QtiPlot - Warning - QtiPlot - Varování - - - - - The column '%1' is read-only! Operation aborted! - Sloupec '%1' je pouze pro čtení! Operace zrušena! - - - Curve selected! Move cursor and click to choose a point and double-click/press 'Enter' to finish! Křivka byla vybrána! Pohněte ukazovátkem a klepněte pro výběr bodu a dvakrát klepněte/stiskněte 'Enter'pro dokončení! - + QtiPlot - Warning + QtiPlot - Varování + + This operation cannot be performed on function curves. Tuto operaci nelze provést s funkčními křivkami. - - This operation cannot be performed on curves plotted from columns having a non-numerical format. - Tuto operaci nelze provést na křivkách nakreslených ze sloupců, které nemají číselný formát. + The column '%1' is read-only! Operation aborted! + Sloupec '%1' je pouze pro čtení! Operace zrušena! TwoExpFit - + first amplitude + první rozkmit + + + second amplitude + druhý rozkmit + + ExpDecay2 Exp. pokles 2 - + second lifetime + druhá životnost + + + offset + posun + + Exponential decay Exponenciální pokles - - first amplitude - první rozkmit - - - first lifetime první životnost - - - second amplitude - druhý rozkmit - - - - second lifetime - druhá životnost - - - - offset - posun - muParserScript - - col() works only on tables! - col() pracuje pouze u tabulek! + There's no row %1 in matrix %2! + Není zde žádný řádek %1 v matici %2! - - There's no column named %1 in table %2! Není zde žádný sloupec s názvem %1 v tabulce %2! - - - - There's no row %1 in table %2! - Není zde žádný řádek %1 v tabulce %2! - - - - - - There's no column %1 in table %2! - Není zde žádný sloupec %1 v tabulce %2! - - - - tablecol() works only on tables! - tablecol() pracuje pouze u tabulek! - - - + Out of memory + Mimo paměť + + tablecol: wrong number of arguments (need 2, got %1) tablecol: nesprávný počet argumentů (jsou potřeba 2, a tady jsou %1) - tablecol: first argument must be a string (table name) tablecol: první argument musí být řetězcem (název tabulky) - Couldn't find a table named %1. Nelze nalézt tabulku s názvem %1. - - + There's no row %1 in table %2! + Není zde žádný řádek %1 v tabulce %2! + + + tablecol() works only on tables! + tablecol() pracuje pouze u tabulek! + + + There's no column %1 in matrix %2! + Není zde žádný sloupec %1 v matici %2! + + + col() works only on tables! + col() pracuje pouze u tabulek! + + + There's no column %1 in table %2! + Není zde žádný sloupec %1 v tabulce %2! + + cell() works only on tables and matrices! cell() pracuje pouze u tabulek a matic! - - There's no row %1 in matrix %2! - Není zde žádný řádek %1 v matici %2! - - - - There's no column %1 in matrix %2! - Není zde žádný sloupec %1 v matici %2! - - - - - - - Out of memory - Mimo paměť - - - - muParserScripting - - abs(x): - Absolute value of x. - abs(x): - Absolutní hodnota x. - - - acos(x): - Inverse cos function. - acos(x): - Obrácená funkce ke cos funkci. - - - acosh(x): - Hyperbolic inverse cos function. - acosh(x): - Hyperbolická brácená funkce ke cos funkci. - - - asin(x): - Inverse sin function. - asin(x): - Obrácená funkce k sin funkci. - - - asinh(x): - Hyperbolic inverse sin function. - asinh(x): - Hyperbolická brácená funkce k sin funkci. - - - atan(x): - Inverse tan function. - atan(x): - Obrácená funkce k funkci tangens. - - - atanh(x): - Hyperbolic inverse tan function. - atanh(x): - Hyperbolická brácená funkce k funkci tangens. - - - avg(x,y,...): - Mean value of all arguments. - avg(x,y,...): - Průměrná hodnota všech argumentů. - - - bessel_j0(x): - Regular cylindrical Bessel function of zeroth order, J_0(x). - bessel_j0(x): - Pravidelná válcovitá Besselova funkce nultého řádu, J_0(x). - - - bessel_j1(x): - Regular cylindrical Bessel function of first order, J_1(x). - bessel_j1(x): - Pravidelná válcovitá Besselova funkce prvního řádu, J_1(x). - - - bessel_jn(double x, int n): - Regular cylindrical Bessel function of order n, J_n(x). - bessel_jn(double x, int n): - Pravidelná válcovitá Besselova funkce n-tého řádu, J_n(x). - - - bessel_y0(x): - Irregular cylindrical Bessel function of zeroth order, Y_0(x), for x>0. - bessel_y0(x): - Nepravidelná válcovitá Besselova funkce nultého řádu, Y_0(x),pro x>0. - - - bessel_y1(x): - Irregular cylindrical Bessel function of first order, Y_1(x), for x>0. - bessel_y1(x): - Nepravidelná válcovitá Besselova funkce prvního řádu, Y_1(x),pro x>0. - - - bessel_yn(double x, int n): - Irregular cylindrical Bessel function of order n, Y_n(x), for x>0. - bessel_yn(double x, int n): - Nepravidelná válcovitá Besselova funkce n-tého řádu, Y_n(x), pro x>0. - - - cosh(x): - Hyperbolic cos function. - cosh(x): - Hyperbolická funkce cosinus. - - - erf(x): - The error function. - erf(x): - Funkce chyby. - - - erfc(x): - Complementary error function erfc(x) = 1 - erf(x). - erfc(x): - Doplňková funkce chyby erfc(x) = 1 - erf(x). - - - erfz(x): - The Gaussian probability density function Z(x). - erfz(x): - Gaussova funkce hustoty pravděpodobnosti Z(x). - - - erfq(x): - The upper tail of the Gaussian probability function Q(x). - erfq(x): - Horní část Gaussovy funkce hustoty pravděpodobnosti Q(x). - - - exp(x): - Exponential function: e raised to the power of x. - exp(x): - Exponenciální funkce: e umocnilo x. - - - gamma(x): - Computes the Gamma function, subject to x not being a negative integer. - gamma(x): - Počítá funkci gama, předmět x není záporné celé číslo. - - - gammaln(x): - Computes the logarithm of the Gamma function, subject to x not a being negative integer. For x<0, log(|Gamma(x)|) is returned. - gammaln(x): - Počítá logaritmus funkce gama function, předmět x není záporné celé číslo. Pro x<0, log(|Gamma(x)|) je vrácen. - - - hazard(x): - Computes the hazard function for the normal distribution h(x) = erfz(x)/erfq(x). - hazard(x): - Počítá funkci nebezpečí pro normální/Gaussovo rozdělení h(x) = erfz(x)/erfq(x). - - - min(x,y,...): - Calculate minimum of all arguments. - min(x,y,...): - Počítá minimum všech argumentů. - - - max(x,y,...): - Calculate maximum of all arguments. - max(x,y,...): - Počítá maximum všech argumentů. - - - rint(x): - Round to nearest integer. - rint(x): - Zaokrouhlit na nejbližší celé číslo. - - - sign(x): - Sign function: -1 if x<0; 1 if x>0. - sign(x): - Funkce sign: -1 pokud f x<0; 1 pokud x>0. - - - sin(x): - Calculate sine. - sin (x): - Počítá sinus. - - - sinh(x): - Hyperbolic sin function. - sinh(x): - Hyperbolická funkce sinus. - - - sqrt(x): - Square root function. - sqrt(x): - Funkce druhé mocniny (dvojmocniny). - - - tan(x): - Calculate tangent function. - tan(x): - Počítá funkci tangens. - - - tanh(x): - Hyperbolic tan function. - tanh(x): - Hyperbolická funkce tangens. - - - ttable(x, n): - Student's t-distribution with n degrees of freedom. - ttable(x, n): - Studentovo rozložení s n stupni volnosti. - - - w0(x): - Compute the principal branch of Lambert's W function, W_0(x). - W is defined as a solution to the equation W(x)*exp(W(x))=x. - For x<0, there are two real-valued branches; this function computes the one where W>-1 for x<0 (also see wm1(x)). - w0(x): - Počítá hlavní větev Lambertovy funkce W, W_0(x). - W je vymezeno jako řešení rovnice W(x)*exp(W(x))=x. - Pro x<0, jsou dvě větve nabývající reálných hodnot; tato funkce počítá tu, kde W>-1 pro x<0 (také se podívejte na wm1(x)). - - - wm1(x): - Compute the secondary branch of Lambert's W function, W_{-1}(x). - W is defined as a solution to the equation W(x)*exp(W(x))=x. - For x<0, there are two real-valued branches; this function computes the one where W<-1 for x<0. (also see w0(x)). - wm1(x): - Počítá vedlejší větev Lambertovy funkce W, W_{-1}(x). - W je vymezeno jako řešení rovnice W(x)*exp(W(x))=x. - Pro x<0, jsou dvě větve nabývající reálných hodnot; tato funkce počítá tu, kde W<-1 pro x<0 (také se podívejte na wm0(x)). + SUM() works only on tables! + SUM() pracuje pouze u tabulek! + + + AVG() works only on tables! + AVG() pracuje pouze u tabulek! === modified file 'qtiplot/translations/qtiplot_de.ts' --- qtiplot/translations/qtiplot_de.ts 2009-12-08 18:06:27 +0000 +++ qtiplot/translations/qtiplot_de.ts 2010-07-21 23:21:08 +0000 @@ -90,6 +90,2581 @@ Bitte einen anderen Namen wählen! + Open File + Datei öffnen + + + Format + Format + + + Time + Zeit + + + Left + Links + + + Right + Rechts + + + Data + Daten + + + The file: <b>%1</b> is the current file! + Die Datei <b>%1</b> ist die aktuelle Datei! + + + The file <b>%1</b> is corrupted, but there exists a backup copy.<br>Do you want to open the backup instead? + Die Datei <b>%1</b> is korrupt, aber es existiert eine Sicherheitskopie.<br>Wollen Sie die Sicherheitskopie stattdessen öffnen? + + + The file: <b> %1 </b> was not created using QtiPlot! + Die Datei <b> %1 </b> wurde nicht von QtiPlot erzeugt! + + + The file: <p><b> %1 </b><p> is the current file! + Die Datei <p><b> %1 </b><p> ist die aktuelle! + + + QtiPlot - File Open Error + QtiPlot - Fehler beim Öffnen der Datei + + + The file: <b> %1 </b> <p>does not exist anymore!<p>It will be removed from the list. + Die Datei <b> %1 </b> <p> existiert nicht mehr!<p>Sie wird aus der Liste entfernt. + + + The file "%1" was created using "%2" as scripting language. + +Initializing support for this language FAILED; I'm using "%3" instead. +Various parts of this file may not be displayed as expected. + Die Datei "%1" wurde mit der Skriptsprache "%2" erstellt. +Die Initialisierung dieser Sprache ist FEHLGESCHLAGEN; Es wird stattdessen "%3" benutzt. +Einige Teile der Datei werden eventuell nicht wie erwartet dargestellt. + + + Window + Fenster + + + QtiPlot - Opening file + QtiPlot - Datei öffnen + + + Script Error + Skriptfehler + + + QtiPlot - Scripting Error + QtiPlot - Skriptunterstützungsfehler + + + Scripting language "%1" failed to initialize. + Skriptsprache "%1" konnte nicht initialisiert werden. + + + QtiPlot - Open Template File + QtiPlot - Vorlagendatei öffnen + + + The file: <b>%1</b> is not a QtiPlot template file! + Die Datei <b>%1</b> ist keine QtiPlot-Vorlagendatei! + + + Table1 + Tabelle1 + + + <h4>There are no plot layers available in this window!</h4> + <h4>Keine Ebenen in diesem Fenster vorhanden</h4> + + + &Save + &Speichern + + + Choose a directory to export the graphs to + Ein Verzeichnis für den Export der Grafik wählen + + + Output format: + Ausgabeformat: + + + Directory: + Verzeichnis: + + + There are no plot layers available in window <b>%1</b>.<br>Graph window not exported! + Es sind keine Grafik-Ebenen in Fenster <b>%1</b> vorhanden. Grafikfenster nicht exportiert! + + + QtiPlot - Overwrite file? + QtiPlot - Datei überschreiben? + + + QtiPlot - Export error + QtiPlot - Export-Fehler + + + Minimized + Minimiert + + + QtiPlot Matrix Template + QtiPlot Matrixvorlage + + + QtiPlot 2D Graph Template + QtiPlot 2D-Grafik Vorlage + + + QtiPlot Table Template + QtiPlot Tabellenvorlage + + + QtiPlot 3D Surface Template + QtiPlot 3D Oberflächenvorlage + + + Save Window As Template + Fenster als Vorlage speichern + + + The name you chose is not valid: only letters and digits are allowed! + Der eingegebene Name ist nicht gültig: Bitte nur Buchstaben und Ziffern eingeben! + + + Name <b>%1</b> already exists! + Der Name <b>%1</b> existiert bereits! + + + Warning: for internal consistency reasons the underscore character is replaced with a minus sign. + Warnung: Um interne Konsistenz zu sichern, wurden Unterstriche durch ein Minuszeichen ersetzt. + + + <h4>There are no plot layers available in this window.</h4><p><h4>Please add a layer and try again!</h4> + <h4>Keine Ebenen in diesem Fenster verfügbar.</h4><p><h4>Bitte fügen Sie eine Ebene hinzu und versuchen Sie es noch einmal.</h4> + + + This functionality is not available for pie plots! + Diese Funktionalität existiert nicht für Tortendiagramme! + + + QtiPlot - Enter rows number + QtiPlot - Anzahl der Zeilen eingeben + + + Rows + Zeilen + + + QtiPlot - Delete rows + QtiPlot - Zeilen löschen + + + Start row + Startzeile + + + End row + Endzeile + + + QtiPlot - Enter columns number + QtiPlot - Anzahl der Spalten eingeben + + + Columns + Spalten + + + Please select a column first! + Bitte zuerst eine Spalten auswählen! + + + Please select two columns for this operation! + Bitte zwei Spalten für diese Operation auswählen! + + + Please select exactly one columns for this operation! + Bitte genau ein Spalte für diese Operation auswählen! + + + Please select two columns for this operation: + the first represents the signal and the second the response function! + Bitte wählen Sie zwei Spalten für diese Operation aus: +Die erste repräsentiert die Signal- und die zweite die Antwortfunktion! + + + QtiPlot - Row selection error + QtiPlot - Fehler beim Auswählen einer Zeile + + + Please select a row first! + Bitte zuerst eine Zeile auswählen! + + + Special Line/Symb&ol + Spezielle Linie/Symb&ol + + + Statistical &Graphs + Statistische &Diagramme + + + &Plot + &Diagramm + + + &Copy + &Kopieren + + + Past&e + &Einfügen + + + &X + &X + + + &Y + &Y + + + &Z + &Z + + + X E&rror + X-&Fehler + + + Y &Error + Y-F&ehler + + + Set As + Setzen als + + + &Fill Column With + Spalten &füllen mit + + + &Column + &Spalte + + + &Normalize + &Normieren + + + &Delete + &Löschen + + + &Insert + E&infügen + + + &Ascending + &Aufsteigend + + + &Descending + A&bsteigend + + + Sort Colu&mn + Spalte S&ortieren + + + Pa&nel + &Feld + + + &Read-only + Sch&reibgeschützt + + + Read/&Write + Lesen/Schreiben + + + &Fill Columns With + Spalten &füllen mit + + + You need to select at least one Y column for this operation! + Für diesene Vorgang müssen Sie mindestens eine Y-Spalte markieren! + + + Y2 Axis Title + Y2-Achsenbeschriftung + + + Not available for empty 3D surface plots! + Nicht für 3D-Oberflächendiagramme ohne Daten verfügbar! + + + Set Display Range + Anzeigebereich setzen + + + <h4>There are no plot layers available in this window.</h4> + <h4>Es sind keine Grafik-Ebenen in diesem Fenster vorhanden.</h4> + + + This will modify the data in the worksheets! +Are you sure you want to continue? + Diese Operation wird die Daten des Arbeitsblattes verändern! +Wollen Sie fortfahren? + + + Continue + Fortfahren + + + Cancel + Abbrechen + + + Could not write to file: <h4>%1</h4><p>Please verify that you have the right to write to this location or that the file is not being used by another application! + Konnte in Datei nicht schreiben: <h4>%1</h4><p>Bitte stellen Sie sicher, dass die Schreibrechte für diesen Ordner haben und dass keine andere Applikation diese Datei benutzt! + + + Print preview of window: + Druckvorschau von Fenster: + + + Please select a 'Y' column first! + Bitte zuerst eine 'Y'-Spalte markieren! + + + Sorry, there are no results to display! + Keine Ergebnisse zum Anzeigen vorhanden! + + + There are no plot layers available in this window! + Es sind keine Grafikebenen in diesem Fenster vorhanden! + + + There are no curves available on this plot! + In diesem Diagramm existieren keine Kurven! + + + There are no layers available on this plot. Operation aborted! + In diesem Diagramm sind keine Ebenen verfügbar. Vorgang abgebrochen! + + + QtiPlot - Insert image from file + QtiPlot - Bild aus Datei einfügen + + + There are no plot layers available in this window. + Es sind keine Grafikebenen in diesem Fenster vorhanden. + + + QtiPlot - Duplicate window error + QtiPlot - Fehler beim Duplizieren des Fensters + + + QtiPlot - Duplicate error + QtiPlot - Fehler beim Duplizieren + + + Empty 3D surface plots cannot be duplicated! + Leere 3D Oberflächendiagramme können nicht dupliziert werden! + + + Released + Herausgegeben + + + About QtiPlot + Über QtiPlot + + + &Translate + &Verschieben + + + Vie&w + Ansicht + + + &Palette + &Palette + + + &Convert to Spreadsheet + In Tabelle &konvertieren + + + &Recent Projects + &Zuletzt geöffnete Projekte + + + &Folders + Ordner + + + &Cascade + Ü&berlagern + + + &Tile + &Nebeneinander + + + Close &Window + &Fenster schließen + + + More windows... + Weitere Fenster... + + + &View Pixel Line profile + Linienprofil anzeigen + + + &Intensity Matrix + &Intensitätsmatrix + + + Please use the project explorer to select a window! + Bitte benutzen Sie den Projektexplorer, um ein Fenster auszuwählen! + + + Normal + Normal + + + Save changes to project: <p><b> %1 </b> ? + Änderungen im Projekt <p><b> %1 </b> speichern? + + + UNTITLED + UNBENANNT + + + QtiPlot - untitled + QtiPlot - unbenannt + + + &Delete Selection + Auswahl &löschen + + + Auto &Column Width + Automatische &Spaltenbreite + + + &Delete Window + &Fenster löschen + + + &Rename Window + &Fenster umbenennen + + + &Print Window + Fenster &drucken + + + D&epending Graphs + Abhängig&e Grafiken + + + D&epending 3D Graphs + Abhängig&e 3D-Grafiken + + + D&epends on + Häng&t ab von + + + Function + Funktion + + + Maximized + Maximiert + + + Re&move Pie Curve + &Tortengrafik entfernen + + + Anal&yze + Anal&yse + + + &Data + &Daten + + + &Gray Scale + &Graustufen + + + &Indexed Colors + &Nummerierte Farben + + + Pale&tte + Pale&tte + + + &Layer + &Ebene + + + &Window + &Fenster + + + &Paste Layer + Ko&pierte Ebene einfügen + + + &Paste Text + Ko&pierten Text einfügen + + + &Paste Tex Formula + TeX-Formel einfügen + + + &Paste Image + Ko&piertes Bild einfügen + + + &Paste Rectangle + Rechteck einfügen + + + &Paste Ellipse + Elli&pse einfügen + + + &Paste Line/Arrow + Ko&pierte(n) Linie/Pfeil einfügen + + + E&xport + E&xportieren + + + &Print + &Drucken + + + P&roperties... + &Eigenschaften... + + + &Copy Page + Seite &kopieren + + + E&xport Page + Seite e&xportieren + + + 3D &Plot + 3D-Dia&gramm + + + &Matrix... + &Matrix... + + + Choose &Data Set... + &Datensatz wählen... + + + Choose &Matrix... + &Matrix wählen... + + + C&lear + Daten &löschen + + + &Copy Graph + Grafik &kopieren + + + &Export + &Exportieren + + + &Paste + E&infügen + + + &Insert Row + &Zeile Einfügen + + + &Insert Column + Spalte e&infügen + + + &Delete Rows + Zeilen &löschen + + + &Delete Columns + Spalten &löschen + + + Move Row + Zeile verschieben + + + &Delete Row + Zeile &löschen + + + Clea&r Row + Zeilen&inhalt löschen + + + Clea&r Rows + Zeilen&inhalte löschen + + + Choose the location of the QtiPlot help folder! + Wählen Sie den QtiPlot Hilfeordner! + + + QtiPlot - index.html File Not Found! + QtiPlot - index.html nicht gefunden! + + + There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! + Keine Datei mit dem Namen <b>index.html</b> in diesem Ordner gefunden.<br>Bitte wählen Sie einen anderen Ordner! + + + QtiPlot - Help Files Not Found! + QtiPlot - Hilfedateien nicht gefunden! + + + The manual can be downloaded from the following internet address: + Das Handbuch kann von der folgenden Adresse heruntergeladen werden: + + + QtiPlot - Help Profile Not Found! + QtiPlot - Hilfeprofil nicht gefunden! + + + The assistant could not start because the file <b>%1</b> was not found in the help file directory! + Der Assistent konnte nicht starten weil die Datei <b>%1</b> nicht im Hilfeverzeichnis gefunden wurde! + + + This file is provided with the QtiPlot manual which can be downloaded from the following internet address: + Diese Datei wird vom QtiPlot-Handbuch zur Verfügung gestellt, das von der folgenden Adresse heruntergeladen werden kann: + + + Please indicate the location of the help file! + Wählen Sie das Verzeichnis der Hilfedatei! + + + <h4>There are no tables available in this project.</h4><p><h4>Please create a table and try again!</h4> + <h4>Keine Tabellen vorhanden in diesem Projekt</h4><p><h4>Bitte erstellen Sie eine Tabelle und versuchen Sie es noch einmal.</h4> + + + QtiPlot - Edit function + QtiPlot - Funktion editieren + + + 3D Surface + 3D-Oberflächendiagramm + + + QtiPlot - Set the number of pixels to average + QtiPlot - Anzahl der zu mittelnden Pixel festlegen + + + Number of averaged pixels + Anzahl der zu mittelnden Pixel + + + You must have more than one layer in the active window! + Im aktiven Fenster muss mehr als eine Ebene vorhanden sein! + + + You must have more than one dataset in the active layer! + Im aktiven Fenster muss mehr als ein Datensatz vorhanden sein! + + + Do you want QtiPlot to guess the best position for the new layer? + Warning: this will rearrange existing layers! + Möchten Sie, dass QtiPlot die beste Position für die neue Ebene bestimmt? + Warnung: Diese Funktion richtet alle vorhandenen Ebenen neu aus! + + + &Guess + &Bestimmen + + + &Top-left corner + &Obere, linke Ecke + + + QtiPlot - Choose data set + QtiPlot - Datensatz auswählen + + + Curve + Kurve + + + Integration of %1 from zero is + Integration von %1 angefangen bei Null ist + + + Integration of %1 + Integration von %1 + + + Area + Fläche + + + Linear Regression of %1 + Lineare Regression von %1 + + + Slope + Steigung + + + Intercept + Abschnitt + + + Chi^2 + Chi^2 + + + R^2 + R^2 + + + Add &Custom Script Action... + Hinzufügen und anpassen von Skriptaktionen... + + + New &Project + Neues &Projekt + + + Ctrl+N + Ctrl+N + + + App&end Project... + Projekt an&hängen... + + + New &Graph + Neue &Grafik + + + Ctrl+G + Ctrl+G + + + New &Note + Neue &Notiz + + + New &Table + Neue &Tabelle + + + Ctrl+T + Ctrl+T + + + New &Matrix + Neue &Matrix + + + Ctrl+M + Ctrl+M + + + New &Function Plot + Neuer &Funktionsplot + + + Ctrl+F + Ctrl+F + + + New 3D &Surface Plot + Neues &3D-Oberflächendiagramm + + + Ctrl+ALT+Z + Ctrl+Alt+Z + + + &Open + Ö&ffnen + + + Ctrl+O + Ctrl+O + + + Open Image &File + Bilddatei ö&ffnen + + + Ctrl+I + Ctrl+I + + + Import I&mage... + Bild i&mportieren... + + + &Save Project + Projekt &speichern + + + Ctrl+S + Ctrl+S + + + Ctrl+Shift+S + Strg+Umschalt+S + + + Open Temp&late... + Vor&lage öffnen... + + + Save As &Template... + Als &Vorlage speichern... + + + Save Note As... + Notizen speichern als... + + + &Import ASCII... + ASCII-&Import... + + + &Undo + &Rückgängig + + + Ctrl+Z + Ctrl+Z + + + &Duplicate + &Duplizieren + + + Ctrl+Alt+D + Strg+Alt+D + + + Cu&t Selection + Auswahl ausschnei&den + + + Ctrl+X + Ctrl+X + + + &Copy Selection + Auswahl &kopieren + + + Ctrl+C + Ctrl+C + + + &Paste Selection + Auswahl ein&fügen + + + Ctrl+V + Ctrl+V + + + Ctrl+E + Ctrl+E + + + Add La&yer + &Ebene hinzufügen + + + ALT+L + ALT+L + + + Arran&ge Layers + Ebenen &anordnen + + + Shift+A + Umschalt+A + + + Automatic Layout + Automatisches Layout + + + &Current + &Aktuelle + + + Ctrl+Alt+G + Ctrl+Alt+G + + + Alt+X + Alt+X + + + &Export PDF + &Exportieren als PDF + + + Ctrl+Alt+P + Ctrl+Alt+P + + + Ctrl+P + Ctrl+P + + + Print Pre&view + Druck&vorschau + + + Print All Plo&ts + Alle Grafiken aus&drucken + + + E&xport ASCII + ASCII-E&xport + + + &Quit + &Beenden + + + Ctrl+Q + Ctrl+Q + + + &Close + S&chließen + + + Clear &Log Information + Alle &Log-Einträge löschen + + + Delete &Fit Tables + &Fit-Tabellen löschen + + + Plot &Wizard + Diagramm-&Assistent + + + Ctrl+Alt+W + Ctrl+Alt+R + + + &Preferences... + &Einstellungen... + + + Add/Remove &Curve... + &Kurve hinzufügen/entfernen... + + + ALT+C + ALT+C + + + Add &Error Bars... + F&ehlerbalken hinzufügen... + + + Ctrl+B + Ctrl+B + + + Add &Function... + &Funktion hinzufügen... + + + Ctrl+Alt+F + Ctrl+Alt+F + + + &Rescale to Show All + Auf Komplettansicht &reskalieren + + + Ctrl+Shift+R + Ctrl+Shift+R + + + Zoom &In/Out and Drag Canvas + &Vergrößern/Verkleinern und Arbeitsfläche ziehen + + + New &Legend + Neue &Legende + + + Ctrl+L + Ctrl+L + + + Add Time Stamp + Zeitstempel hinzufügen + + + Ctrl+ALT+T + Ctrl+Alt+T + + + Add &Image + Bild h&inzufügen + + + ALT+I + ALT+I + + + &Line + &Linie + + + &Scatter + &Punkte + + + Line + S&ymbol + Linie + S&ymbole + + + Vertical &Drop Lines + Vertikale &Linien + + + &Spline + &Spline + + + &Horizontal Steps + &Horizontale Schritte + + + &Vertical Steps + &Vertikale Schritte + + + &Columns + &Spalten + + + &Rows + &Zeilen + + + &Area + &Fläche + + + &Pie + &Tortengrafik + + + Vectors XY&AM + Verktoren XY&AM + + + &Vectors &XYXY + Vektoren &XYXY + + + &Histogram + &Histogramm + + + &Stacked Histogram + ge&stapeltes Histogramm + + + Stem-and-&Leaf Plot + Stamm-&Blatt-Diagramm + + + &Vertical 2 Layers + 2 &vertikale Ebenen + + + &Horizontal 2 Layers + 2 &horizontale Ebenen + + + &4 Layers + &4 Ebenen + + + &Stacked Layers + Ge&stapelte Ebenen + + + D&ouble-Y + D&oppel-Y + + + &Zoom + &Zoom + + + &Waterfall Plot + &Wasserfall Diagramm + + + E&xtract to Graphs + In Diagramme e&xtrahieren + + + Extract to &Layers + In Ebene extrahieren + + + Add Inset Layer + Eingebettete Ebene hinzufügen + + + &Ribbon + &Band + + + &Bars + &Balken + + + &Trajectory + &Trajektorie + + + Statistics on &Columns + S&paltenstatistik + + + Statistics on &Rows + &Zeilenstatistik + + + Integr&ate Function... + Integriere Funktion... + + + Inte&rpolate ... + Inte&rpolieren... + + + &Low Pass... + &Tiefpass... + + + &High Pass... + &Hochpass... + + + &Band Pass... + &Bandpass... + + + &Band Block... + &Bandfilter... + + + &FFT... + &FFT... + + + &Savitzky-Golay... + &Savitzky-Golay... + + + &FFT Filter... + &FFT Filter... + + + Moving Window &Average... + &Gleitender Fensterdurchschnitt... + + + &Differentiate + &Differenzieren + + + Fit Slop&e + St&eigung anpassen + + + Fit &Linear + &Linearer Fit + + + Fit &Polynomial ... + &Polynomialer Fit... + + + &First Order ... + &Erster Ordnung... + + + &Second Order ... + &Zweiter Ordnung... + + + &Third Order ... + &Dritter Ordnung... + + + Fit Exponential Gro&wth ... + Exponentielles &Wachstum fitten... + + + Fit &Boltzmann (Sigmoidal) + &Boltzmann fitten (Sigmoidal) + + + Fit &Gaussian + &Gauss-Fit + + + Fit Lorent&zian + Loren&z-Fit + + + Fit &Wizard... + Fit-Assistent... + + + Ctrl+Y + Ctrl+Y + + + &Plot ... + &Diagramm ... + + + &Scales... + &Skalen... + + + &Axes... + &Achsen... + + + &Grid ... + &Gitter... + + + &Title ... + &Titel ... + + + Column &Options ... + Spalten&optionen... + + + Ctrl+Alt+O + Ctrl+Alt+O + + + Set Column &Values ... + Spalten&werte setzen... + + + Alt+Q + Alt+Q + + + Recalculate + Neu berechnen + + + Ctrl+Return + Ctrl+Return + + + &Hide Selected + Verstecke markierte + + + Sho&w All Columns + Zeige alle Spalten + + + &Swap columns + &Spalten tauschen + + + Move &Right + Ve&rschiebe nach rechts + + + Move &Left + Verschiebe nach &links + + + Move to F&irst + Verschiebe zum ersten + + + Move to Las&t + Verschiebe zum le&tzten + + + Ad&just Column Width + Spaltenbreite an&passen + + + &Columns... + &Spalten... + + + &Rows... + &Zeilen... + + + &Delete Rows Interval... + &Entferne Spalten im Bereich... + + + &Upward + nach &oben + + + &Downward + nach &unten + + + &About QtiPlot + Ü&ber QtiPlot + + + F1 + F1 + + + &Help + &Hilfe + + + Ctrl+H + Ctrl+H + + + &Choose Help Folder... + &Bitte wählen Sie den Hilfe-Ordner aus... + + + Ctrl+W + Ctrl+W + + + Add Column + Spalte hinzufügen + + + &Go to Row... + &Gehe zu Zeile... + + + Go to Colum&n... + Gehe zur Spalte... + + + Ctrl+Alt+C + Strg+Alt+C + + + Clear + Leeren + + + &Remove Layer + Ebene &entfernen + + + Alt+R + Alt+R + + + Window &Geometry... + Fenster&geometrie... + + + &Hide Window + Fenster &ausblenden + + + Ctrl+Alt+H + Strg+Alt+H + + + &View Pixel Line Profile + Linienprofil &anzeigen + + + &Intensity Table + &Intensitätstabelle + + + &Properties + &Eigenschaften + + + &Activate Window + Fenster &aktivieren + + + Mi&nimize Window + Fenster mi&nimieren + + + Ma&ximize Window + Fenster ma&ximieren + + + Re&size Window... + Fen&stergröße ändern... + + + &Surface... + &Oberfläche... + + + &Data Set... + &Datensatz... + + + Set &Properties... + &Eigenschaften festlegen... + + + Set &Dimensions... + &Dimensionen festlegen... + + + Ctrl+D + Strg+D + + + Set &Values... + &Werte festlegen... + + + &Image Plot + B&ilddiagramm + + + &Transpose + &Transponieren + + + Flip &V + Drehe &V + + + Ctrl+Shift+V + Strg+Umschalt+V + + + Flip &H + Drehe &H + + + Ctrl+Shift+H + Strg+Umschalt+H + + + R&otate 90 + Drehe 90 + + + Rotate &-90 + Drehe &-90 + + + Ctrl+Alt+R + Strg+Alt+R + + + &Invert + &Invertieren + + + &Determinant + &Determinate + + + &Image mode + B&ildmodus + + + Ctrl+Shift+I + Strg+Umschalt+I + + + &Data mode + &Datenmodus + + + Ctrl+Shift+D + Strg+Umschalt+D + + + Show &X/Y + Zeige &X/Y + + + Ctrl+Shift+X + Strg+Umschalt+X + + + Show &Column/Row + Zeige Spalte/Zeile + + + Ctrl+Shift+C + Strg+Umschalt+C + + + &Default + Stan&dard + + + &Rainbow + &Regenbogen + + + &Custom + Anpassen + + + &Export Image ... + &Exportiere Abbildung ... + + + &Direct + &Direkt + + + &XYZ Columns + &XYZ-Spalten + + + &YXZ Columns + &YXZ-Spalten + + + &Forward FFT + Vorwärts-&FFT + + + &Inverse FFT + &Inverse-FFT + + + 3D &Wire Frame + 3D-&Drahtgitter + + + 3D &Hidden Line + 3D &verdeckte Linien + + + 3D &Polygons + 3D-&Polygone + + + 3D Wire &Surface + 3D-Drahtgitter-&Oberfläche + + + Contour - &Color Fill + &Kontur - Farbfüllung + + + Contour &Lines + Kontur&linien + + + &Gray Scale Map + &Graustufenoberfläche + + + Sort Ta&ble + Ta&belle sortieren + + + Sort Columns + Spalten sortieren + + + &Table + &Tabelle + + + Co&rrelate + Ko&rrelieren + + + &Autocorrelate + &Autokorrelieren + + + &Convolute + &Falten + + + &Deconvolute + &Entfalten + + + &Horizontal + &Horizontal + + + &Vertical + &Vertikal + + + Ro&w Numbers + &Zeilennummern + + + &Random Values + Zufallswe&rte + + + &Frequency Count ... + &Frequenzzähler ... + + + &Read Only + Sch&reibgeschützt + + + &Disregard + nicht berücksichtigen + + + &Box Plot + &Boxdiagramm + + + &Gaussian... + &Gauss... + + + &Lorentzian... + &Lorentz... + + + Search for &Updates + Nach &Update suchen + + + &QtiPlot Homepage + &QtiPlot Homepage + + + QtiPlot &Forums + QtiPlot &Foren + + + Report a &Bug + Einen &Bug melden + + + Download &Manual + &Handbuch herunterladen + + + &Translations + Ü&bersetzungen + + + Make a &Donation + Das Projekt mit einer Spen&de unterstützen + + + Technical &Support + Technischer &Support + + + Scripting &language + S&kriptsprache + + + &Restart scripting + Sk&riptunterstützung neu starten + + + E&xecute + &Ausführen + + + Ctrl+J + Ctrl+J + + + Ctrl+Shift+J + Ctrl+Shift+J + + + &Evaluate Expression + Ausdruck ausw&erten + + + Show Line &Numbers + Zeige die Zeile&nnnummern + + + F3 + F3 + + + &Replace... + E&rsetzen... + + + &Script Window + &Skriptfenster + + + &Plot details... + &Diagramm-Details... + + + &Reset to Full Range + Zurücksetzen auf gesamter Be&reich + + + Edit &Range... + Be&reich ändern... + + + &Hide + Aus&blenden + + + Hide &Other Curves + Andere &Kurven ausblenden + + + &Show All Curves + &Alle Kurven anzeigen + + + &Toolbars... + Werkzeugleis&ten... + + + Ctrl+Shift+T + Strg+Umschalt+T + + + Bold + Dick + + + Italic + Kursiv + + + Superscript + Hochgestellt + + + Subscript + Untergestellt + + + Underline (Ctrl+U) + Unterstrichen (Strg+U) + + + Ctrl+U + Ctrl+U + + + Greek + Griechisch + + + Mathematical Symbols + Mathematische Symbole + + + Open a new project + Ein neues Projekt öffnen + + + Append a project to the current folder + Anhängen eines Projekts zum aktuellen Ordner + + + New Fol&der + Neuer Or&dner + + + Create a new folder + Erstelle einen neuen Ordner + + + Create an empty note window + Ein leeres Notizfenster erstellen + + + New table + Neue Tabelle + + + New matrix + Neue Matrix + + + Open project + Projekt öffnen + + + Save project + Projekt speichern + + + Open template + Vorlage öffnen + + + Save window as template + Fenster als Vorlage speichern + + + Import data file(s) + Datendatei(en) importieren + + + Undo changes + Änderungen rückgängig machen + + + Redo changes + Wiederherstellen + + + Duplicate window + Fenster duplizieren + + + Cut selection + Auswahl ausschneiden + + + Copy selection + Auswahl kopieren + + + Delete selection + Auswahl löschen + + + Project &Explorer + Projekt&explorer + + + Show project explorer + Projektexplorer anzeigen + + + Results &Log + Ergebnis-&Log + + + &Undo/Redo Stack + Rückgängig/Wiederherstellen-Mod&ul + + + Show available undo/redo commands + Zeige verfügbare Rückgängig/Wiederherstellen-Befehle + + + &Console + &Konsole + + + Show Scripting console + Skriptkonsole anzeigen + + + Script Window + Skriptfenster + + + Add Layer + Ebene hinzufügen + + + Arrange Layers + Ebenen anordnen + + + Export current graph + Aktuelle Grafik exportieren + + + Export all graphs + Alle Grafiken exportieren + + + Export to PDF + Exportieren als PDF + + + Print window + Fenster drucken + + + Add Error Bars... + Fehlerbalken hinzufügen... + + + Add Function... + Funktion hinzufügen... + + + Best fit + Beste Anpassung + + + Add Image + Bild hinzufügen + + + Plot as line + Als Linie darstellen + + + Plot as symbols + Als Symbole darstellen + + + Plot with vertical bars + Mit vertikalen Balken darstellen + + + Plot with horizontal bars + Mit horizontalen Balken darstellen + + + Plot area + Diagrammfläche + + + Plot pie + Tortengrafik zeichnen + + + &Vectors XYXY + &Vektoren XYXY + + + Vectors XYXY + Vektoren XYXY + + + Vectors XYAM + Vektoren XYAM + + + Stem-and-Leaf Plot + Stamm-Blatt-Diagramm + + + Double Y Axis + Doppelte Y-Achse + + + Zoom + Zoom + + + Extract to Graphs + In Diagramme extrahieren + + + Extract to Layer&s + In Ebene extrahieren + + + Extract to Layers + In Ebene extrahieren + + + Plot 3D ribbon + 3D-Band zeichnen + + + Plot 3D bars + 3D-Balken zeichnen + + + Plot 3D scatter + 3D-Punkte zeichnen + + + Plot 3D trajectory + 3D-Trajektorie zeichnen + + + Contour Lines + Color Fill + Konturlinien + Farbfüllung + + + Contour Lines + Konturlinien + + + Hide selected columns + Verstecke markierte Spalten + + + Show all table columns + Zeige alle Tabellenspalten + + + Swap selected columns + Ausgewählte Spalten tauschen + + + Move Right + Verschiebe nach rechts + + + Move Left + verschiebe nach links + + + Move to First + Verschiebe zum ersten + + + Move to Last + Verschiebe zum letzten + + + Move current row upward + Markierte Zeile nach oben verschieben + + + Move current row downward + Markierte Zeile nach unten verschieben + + + Set optimal column width + Optimale Spaltenbreite einstellen + + + Alt+C + ALT+C + + + More Windows... + Weitere Fenster... + + + Set Matrix Values + Lege Matrixwerte fest + + + Image Plot + Bildplot + + + Rotate 90 Clockwise + Drehe im Uhrzeigersinn um 90° + + + Rotate 90 Counterclockwise + Drehe gegen den Uhrzeigersinn um 90° + + + Flip Vertically + Vertikal drehen + + + Flip Horizontally + Horizontal drehen + + + Fill selected columns with row numbers + Fülle die markierten Spalten mit den Zeilennummern + + + Fill selected columns with random numbers + Fülle die markierten Spalten mit Zufallszahlen + + + Set column as X + Setze Spalte als X + + + Set column as Y + Setze Spalte als Y + + + Set column as Z + Setze Spalte als Z + + + Set as Y Error Bars + Setze als Y-Fehlerbalken + + + Set as Labels + Setze als Beschriftungen + + + Disregard Columns + Ignoriere Spalten + + + Box and whiskers plot + Box-and-Whiskers-Diagramm + + + Visit QtiPlot &Forums + QtiPlot &Foren besuchen + + + Ctrl+R + Ctrl+R + + + Disable &tools + Werkzeuge deak&tivieren + + + Pointer + Mauszeiger + + + Zoom In (Shift++) or Out (-) and Drag Canvas + Vergrößern/Verkleinern (Mausrad) und Arbeitsfläche ziehen + + + &Zoom In + Rein&zoomen + + + Ctrl++ + Ctrl++ + + + Zoom &Out + Herausz&oomen + + + Ctrl+- + Ctrl+- + + + Zoom Out + Herauszoomen + + + &Data Reader + &Datenleser + + + CTRL+D + Ctrl+D + + + Data reader + Datenleser + + + &Select Data Range + Datenbereich au&swählen + + + ALT+S + ALT+S + + + Select data range + Datenbereich setzen + + + S&creen Reader + &Bildschirmleser + + + Screen reader + Bildschirmleser + + + &Draw Data Points + Zeichne &Datenpunkte + + + Draw Data Points + Zeichne Datenpunkte + + + &Move Data Points... + Datenpunkte &verschieben... + + + Ctrl+ALT+M + Ctrl+Alt+M + + + Move data points + Datenpunkte verschieben + + + Remove &Bad Data Points... + Datenausreißer &entfernen... + + + Alt+B + Alt+B + + + Remove data points + Datenpunkte löschen + + + Add &Text + &Text hinzufügen + + + Add Text + Text hinzufügen + + + ALT+T + ALT+T + + + Add E&quation + Gleichung hinzufügen + + + Add Equation + Gleichung hinzufügen + + + ALT+Q + Alt+Q + + + Add &Rectangle + &Rechteck hinzufügen + + + Add Rectangle + Rechteck hinzufügen + + + CTRL+ALT+R + Strg+Alt+R + + + Add &Ellipse + &Ellipse hinzufügen + + + Add Ellipse/Circle + Ellipse/Kreis hinzufügen + + + CTRL+ALT+E + Strg+Alt+E + + + Draw &Arrow + &Pfeil zeichnen + + + CTRL+ALT+A + Ctrl+Alt+A + + + Draw arrow + Pfeil zeichnen + + + Draw &Line + &Linie zeichnen + + + CTRL+ALT+L + Ctrl+ALT+L + + + Draw line + Linien zeichnen + + + Frame + Rahmen + + + No Axes + Keine Axen + + + No axes + Keine Axen + + + Front grid + Vordergrundgitter + + + Back grid + Hintergrundgitter + + + Right grid + Rechtes Gitter + + + Left grid + Linkes Gitter + + + Ceiling grid + Deckengitter + + + Floor grid + Bodenflächengitter + + + Wireframe + Drahtgitter + + + Hidden Line + Versteckte Linien + + + Polygon Only + Nur Polygon + + + Polygon only + Nur Polygon + + + Mesh & Filled Polygons + Netz & gefüllte Polygone + + + Mesh & filled Polygons + Netz & gefüllte Polygone + + + Dots + Punkte + + + Bars + Balken + + + Cones + Kegel + + + Floor Data Projection + Bodenflächenprojektion der Daten + + + Floor data projection + Bodenflächenprojektion der Daten + + + Floor Isolines + Bodenflächenkonturlinien + + + Floor isolines + Bodenflächenkonturlinien + + + Empty Floor + Leere Bodenfläche + + + Empty floor + Leere Bodenfläche + + + Animation + Animation + + + Enable perspective + Perspektive einschalten + + + Fit frame to window + Rahmen an Fenster anpassen + + + Horizontal + Horizontal + + + Vertical + Vertikal + + + QtiPlot - Enter the number of peaks + QtiPlot - Anzahl der Peaks eingeben + + + Peaks + Peaks + + + <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> If you like it, you're using it in your work and you would like to see it constantly improved, please support its authors by making a donation.</b></font> + <font size=+2, color = darkBlue><b>QtiPlot ist Opensource Software. Die Entwicklung hat hunderte von Studen in Anspruch genommen.<br><br> Wenn Sie QtiPlot mögen und es regelmäßig nutzen, möchten Sie bestimmt, dass es permanent verbessert wird. Bitte unterstützen Sie die Autoren durch eine Spende.</b></font> + + + Please support QtiPlot! + Bitte unterstützen Sie QtiPlot! + + + Make a donation + Das Projekt mit einer Spende unterstützen + + + Close + Schließen + + + Version + Version + + + options + Optionen + + + file + Datei + + + name + Name + + + Valid options are + Gültige Optionen sind + + + or + oder + + + show about dialog and exit + Über-Dialog anzeigen und beenden + + + show standalone scripting window + Zeige separates Scriptfenster + + + start QtiPlot with the default settings + starte QtiPlot mit den Standardeinstellungen + + + show command line options + Kommandozeilenoptionen anzeigen + + + start QtiPlot in language + QtiPlot starten in Sprache + + + show QtiPlot manual in a standalone window + QtiPlot-Handbuch in einem unabhängigen Fenster anzeigen + + + print QtiPlot version and release date + QtiPlot-Version und Herausgabedatum ausgeben + + + execute the script file given as argument + Ausführen der Skriptdatei, die als Argument angegeben wurde. + + + execute the script file given as argument without displying the user interface. Warning: 2D plots are not correctly handled in this functioning mode! + Ausführen der Skriptdatei, die als Argument angegeben wurde, ohne die Benutzeroberfläche anzuzeigen. Warnung: 2D-Diagramme werden in diesem Modus nicht korrekt verarbeitet! + + + Help + Hilfe + + + <b> %1 </b> unknown command line option! + <b> %1 </b>: Unbekannte Kommandozeilenoption! + + + Type %1 to see the list of the valid options. + Geben Sie %1 ein, um die Liste der gültigen Optionen anzeigen zu lassen. + + + <b>%1</b> is a directory, please specify a file name! + <b>%1</b> ist ein Verzeichnis. Bitte einen Dateinamen eingeben! + + + You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://soft.proindependent.com/download.html">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. + Sie benutzen die Demoversion von QtiPlot. Sie ist mit der Vollversion identisch bis auf die Limitierung, dass Sie keine Projekte speichern können und nicht länger als 10 Minuten pro Sitzung arbeiten können. <br><br> Wenn Sie eine sofort benutzbare, voll funktionstüchtige Version möchten, schließen Sie bitte einen <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a> ab. <br><br> QtiPlot ist freie Software im Sinne von freier Rede. Wenn Sie wissen, wie dieser zur handhaben ist, können Sie den <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">Quellcode</a> kostenlos herunterladen. Trotzdem, erwägen Sie bitte, eine <a href="http://soft.proindependent.com/why_donate.html">Spende</a> abzugeben, um die weitere Entwicklung QtiPlot zu unterstützen. + + Type Typ @@ -2329,23 +4904,18 @@ AddWidgetTool - Click on plot to choose the position of the new object! Auf den Plot klicken, um die Position des neuen Objects zu wählen! - - enter your text here Geben Sie hier Ihren Text ein - Move cursor in order to resize the new rectangle! Cursor bewegen um die Größe des Rechtecks zu ändern! - Move cursor in order to resize the new ellipse! Cursor bewegen um die Größe der Ellipse zu ändern! @@ -2372,29 +4942,39 @@ ApplicationWindow + File %1 contains only %2 sheets, operation aborted! + Die Datei %1 enthält nur %2 Blätter. Die Operation wurde abgebrochen! + + + Sheet %1 is empty, operation aborted! + Blatt %1 ist leer. Operation wurde abgebrochen! + + + sheet + Blatt + + + QtiPlot was built without libxls support! + QtiPlot wurde ohne libxls Unterstützung erstellt! + + <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> <font size=+2, color = darkBlue><b>QtiPlot ist Open-Source Software und seine Entwicklung benötigte hunderte von Arbeitsstunden.<br><br> - - File Datei - - Plot Diagramm - Pointer Mauszeiger - Zoom Zoom @@ -2403,7 +4983,6 @@ Daten anzeigen - Select data range Datenbereich setzen @@ -2412,45 +4991,30 @@ Bildschirmkoordinaten - Move data points Datenpunkte verschieben - Remove data points Datenpunkte löschen - Draw line - Linien zeichnen + Linie zeichnen - - - - - - - - Table Tabelle - - Data Display Datenanzeige - &File &Datei - &New &Neu @@ -2459,7 +5023,6 @@ &Zuletzt geöffnete Projekte - &Export Graph Grafik &exportieren @@ -2468,17 +5031,14 @@ ASCII-&Import - &Edit B&earbeiten - &View &Ansicht - &Graph &Grafik @@ -2487,27 +5047,18 @@ 3&D-Diagramm - &Matrix &Matrix - - - Special Line/Symb&ol Spezielle Linie/Symb&ol - - - Statistical &Graphs Statistische &Diagramme - - Pa&nel &Feld @@ -2520,8 +5071,6 @@ 3&D-Grafik - - &Data &Daten @@ -2534,12 +5083,10 @@ &FFT - Fit E&xponential Decay E&ponentiellen Abfall anpassen - &Analysis &Analyse @@ -2548,27 +5095,18 @@ For&mat - &Windows &Fenster - - - &Help &Hilfe - - <h4>There are no tables available in this project.</h4><p><h4>Please create a table and try again!</h4> <h4>Keine Tabellen vorhanden in diesem Projekt</h4><p><h4>Bitte erstellen Sie eine Tabelle und versuchen Sie es noch einmal.</h4> - - - QtiPlot - Choose data set QtiPlot - Datensatz auswählen @@ -2577,8 +5115,6 @@ <h4>Keine Matrizen vorhanden in diesem Projekt</h4><p><h4>Bitte erstellen Sie eine Matrix und versuchen Sie es erneut</h4> - - QtiPlot - Choose matrix to plot QtiPlot - darzustellende Matrix auswählen @@ -2595,106 +5131,62 @@ 3D-Funktionsgrafik - QtiPlot - Import image from file QtiPlot - Bild aus Datei importieren - QtiPlot - Load image from file QtiPlot - Bild aus Datei laden - - - - - - - - Matrix Matrix - Normal Normal - - - - - - - - - - - - - - - - - <h4>There are no plot layers available in this window.</h4><p><h4>Please add a layer and try again!</h4> <h4>Keine Ebenen in diesem Fenster verfügbar.</h4><p><h4>Bitte fügen Sie eine Ebene hinzu und versuchen Sie es noch einmal.</h4> - QtiPlot - Error bars error QtiPlot - Fehlerbalken-Fehler - - This feature is not available for user defined function curves! Diese Funktion steht für benutzerdefinierte Funktionskurven nicht zur Verfügung! - QtiPlot - File Open Error QtiPlot - Fehler beim Öffnen der Datei - <h4>There are no plot layers available in this window!</h4> - <h4>Keine Ebenen in diesem Fenster vorhanden</h4> + <h4>Es sind keine Ebenen in diesem Fenster vorhanden</h4> QtiPlot - Overwrite File? QtiPlot - Datei überschreiben? - - A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? Eine Datei mit dem Namen <p><b>%1</b><p> existiert bereits. Wollen Sie sie überschreiben? - - &Yes &Ja - - - &All &Alle - - - &Cancel - &Abbrechen + Ab&brechen - QtiPlot - Export Error QtiPlot - Export-Fehler @@ -2713,9 +5205,8 @@ Wollen Sie sie überschreiben? - &No - &Nein + &Nein Rename Window @@ -2726,91 +5217,14 @@ Bitte whlen Sie einen Namen - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QtiPlot - Error QtiPlot - Fehler - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QtiPlot - Warning QtiPlot - Warnung - Not available for empty 3D surface plots! Nicht für 3D-Oberflächendiagramme ohne Daten verfügbar! @@ -2819,15 +5233,10 @@ QtiPlot - Benutzerdefinierte Kurven - - - - <h4>There are no plot layers available in this window.</h4> <h4>Es sind keine Grafik-Ebenen in diesem Fenster vorhanden.</h4> - Sorry, there are no results to display! Keine Ergebnisse zum Anzeigen vorhanden! @@ -2856,7 +5265,6 @@ QtiPlot - Ebenengeometrie - QtiPlot - Duplicate error QtiPlot - Fehler beim Duplizieren @@ -2865,7 +5273,6 @@ Eine leeres 3D-Oberflächendiagramm kann nicht dupliziert werden! - QtiPlot - Duplicate window error QtiPlot - Fehler beim Duplizieren des Fensters @@ -2878,7 +5285,6 @@ QtiPlot - Fenstergeometrie - About QtiPlot Über QtiPlot @@ -2887,56 +5293,34 @@ Linienprofil &anzeigen - &Intensity Matrix &Intensitätsmatrix - &Cut &Ausschneiden - - - - - - - - &Copy &Kopieren - - - - - &Delete &Löschen - - - - &Properties &Eigenschaften - Please use the project explorer to select a window! Bitte benutzen Sie den Projektexplorer, um ein Fenster auszuwählen! - QtiPlot - index.html File Not Found! QtiPlot - index.html nicht gefunden! - There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! Keine Datei mit dem Namen <b>index.html</b> in diesem Ordner gefunden.<br>Bitte wählen Sie einen anderen Ordner! @@ -2969,26 +5353,18 @@ &Koord - - - - Box - Kasten + Rechteck A A - - - Frame Rahmen - &Frame &Rahmen @@ -2997,10 +5373,8 @@ F - - No Axes - Keine Axen + Keine Achsen grid @@ -3059,52 +5433,30 @@ Diagrammstil - - - - Wireframe Drahtgitter - - Hidden Line Versteckte Linien - - Polygon only Nur Polygon - - Mesh & filled Polygons Netz & gefüllte Polygone - - - - Dots Punkte - - - - Bars Balken - - - - Cones Kegel @@ -3117,121 +5469,88 @@ Bodenflächenstil - - Floor Data Projection Bodenflächenprojektion der Daten - - Floor Isolines Bodenflächenkonturlinien - - Empty Floor Leere Bodenfläche - QtiPlot - Guess best origin for the new layer? QtiPlot - Besten Ursprung für die neue Ebene bestimmen? - Do you want QtiPlot to guess the best position for the new layer? Warning: this will rearrange existing layers! Möchten Sie, dass QtiPlot die beste Position für die neue Ebene bestimmt? Warnung: Diese Funktion richtet alle vorhandenen Ebenen neu aus! - &Guess &Bestimmen - &Top-left corner &Obere, linke Ecke - - - New &Project Neues &Projekt - - Ctrl+N Ctrl+N - - New &Table Neue &Tabelle - - Ctrl+T - Ctrl+T + Strg+T New spreadsheet Neues Tabellenfenster - - New &Matrix Neue &Matrix - New matrix Neue Matrix - - New &Function Plot Neuer &Funktionsplot - - Ctrl+F - Ctrl+F + Strg+F New &Surface 3D Plot Neues &3D-Oberflächendiagramm - - Ctrl+Z - Ctrl+Z + Strg+Z - - &Open - Ö&ffnen + Ö&ffnen - - Ctrl+O - Ctrl+O + Strg+O - Open project Projekt öffnen @@ -3240,26 +5559,20 @@ Bilddatei &öffnen - - Ctrl+I - Ctrl+I + Strg+I Import &image... Bild &importieren... - - &Save Project Projekt &speichern - - Ctrl+S - Ctrl+S + Strgl+S Save Project &as... @@ -3282,35 +5595,26 @@ Mehrere Datendateien importieren - - &Undo &Rückgängig - - Ctrl+U - Ctrl+U + Strg+U - - &Redo Wiede&rholen Ctrl+R - Ctrl+R + Strg+R - - &Duplicate &Duplizieren - Duplicate window Fenster duplizieren @@ -3319,30 +5623,24 @@ Auswahl ausschnei&den - - Ctrl+X - Ctrl+X + Strg+X &Copy selection Auswahl kopieren - - Ctrl+C - Ctrl+C + Strg+C &Paste selection Auswahl ein&fügen - - Ctrl+V - Ctrl+V + Strg+V &Delete selection @@ -3357,18 +5655,14 @@ Projekt&explorer - - Ctrl+E - Ctrl+E + Strg+E - Show project explorer Projektexplorer anzeigen - Results &Log Ergebnis-&Log @@ -3377,8 +5671,6 @@ Berechnungsergebnis anzeigen - - Add La&yer &Ebene hinzufügen @@ -3387,45 +5679,32 @@ Ebenen anordnen/Eigene Ebeneneinstellungen - - &Current &Aktuelle - - Ctrl+G - Ctrl+G + Strg+G - Export current graph Aktuelle Grafik exportieren - - Alt+X Alt+X - Export all graphs Alle Grafiken exportieren - - - &Print &Drucken - - Ctrl+P - Ctrl+P + Strg+P Print graph @@ -3436,26 +5715,20 @@ &Alle Diahramme drucken - - E&xport ASCII - ASCII-E&xport + ASCII-E&xport Set import &options Import&optionen - - &Quit &Beenden - - Ctrl+Q - Ctrl+Q + Strg+Q Clear &log information @@ -3466,14 +5739,10 @@ Diagramm-&Assistent - - Ctrl+Alt+W - Ctrl+Alt+R + Strg+Alt+R - - &Preferences... &Einstellungen... @@ -3482,7 +5751,6 @@ Kurve hinzufügen/entfernen - Add curve to graph Kurve zur Grafik hinzufügen @@ -3491,58 +5759,42 @@ Fehlerbalken hinzufügen - - Ctrl+B - Ctrl+B + Strg+B Add &function curve Funktionskurve hinzufügen - - - - Ctrl+Alt+F - Ctrl+Alt+F + Strg+Alt+F &Rescale to show all Auf Komplettansicht &reskalieren - Best fit Beste Anpassung - - New &Legend Neue &Legende - - Ctrl+L - Ctrl+L + Strg+L - Add new legend - Neue Beschriftung hinzufügen + Neue Legende hinzufügen - - Add &Image Bild h&inzufügen - - Add &Text &Text hinzufügen @@ -3551,8 +5803,6 @@ Peil/Linie zeichnen - - &Line &Linie @@ -3561,10 +5811,6 @@ Als Linie darstellen - - - - &Scatter &Punkte @@ -3573,8 +5819,6 @@ Als Symbole darstellen - - Line + S&ymbol Linie + S&ymbole @@ -3587,107 +5831,74 @@ Vertikale &Linien - - &Spline &Spline - - &Vertical Steps &Vertikale Schritte - - - - &Columns - &Spalten + &Säulendiagramm - Plot with vertical bars - Mit vertikalen Balken darstellen + Säulendiagramm - - &Rows - &Zeilen + &Balkendiagramm - Plot with horizontal bars - Mit horizontalen Balken darstellen + Balkendiagramm - - &Area &Fläche - Plot area Diagrammfläche - - &Pie &Tortengrafik - Plot pie Tortengrafik zeichnen - &Vectors &XYXY Vektoren &XYXY - - &Histogram &Histogramm - - &Stacked Histogram - ge&stapeltes Histogramm + Ge&stapeltes Histogramm - - &Vertical 2 Layers 2 &vertikale Ebenen - - &Horizontal 2 Layers 2 &horizontale Ebenen - - &4 Layers &4 Ebenen - - &Stacked Layers Ge&stapelte Ebenen - - &Ribbon &Band @@ -3696,8 +5907,6 @@ 3D-Band zeichnen - - &Bars &Balken @@ -3710,8 +5919,6 @@ 3D-Punkte zeichnen - - &Trajectory &Trajektorie @@ -3724,40 +5931,30 @@ Datenpunkte verschieben - - Ctrl+M - Ctrl+M + Strg+M Remove &bad data points Ausreißer entfernen - - Alt+R Alt+R - - Statistics on &Columns S&paltenstatistik - Selected columns statistics Statistiken für ausgewählte Spalten - - Statistics on &Rows &Zeilenstatistik - Selected rows statistics Statistiken für ausgewählte Zeilen @@ -3786,38 +5983,26 @@ &Invertieren - - &Differentiate &Differenzieren - - Fit &Linear &Linearer Fit - - Fit &Polynomial ... &Polynomialer Fit... - - &First Order ... &Erster Ordnung... - - &Second Order ... &Zweiter Ordnung... - - &Third Order ... &Dritter Ordnung... @@ -3826,14 +6011,10 @@ Fit fr Exponentiellen Anstieg - - Fit &Gaussian &Gauss-Fit - - Fit Lorent&zian Loren&z-Fit @@ -3842,14 +6023,10 @@ &Nicht-linearer Fit... - - Ctrl+Y - Ctrl+Y + Strg+Y - - &Plot ... &Diagramm ... @@ -3858,8 +6035,6 @@ &Achsen/Gitter ... - - &Title ... &Titel ... @@ -3872,56 +6047,40 @@ Spaltenwerte fe&stlegen ... - - &Columns... - &Spalten... + &Spaltenzahl... - - &Rows... - &Zeilen... + &Zeilenzahl... &About &Über QtiPlot - - F1 F1 - - Ctrl+H - Ctrl+H + Strg+H &Choose help folder... &Bitte wählen Sie den Hilfe-Ordner aus... - - - &Rename Window &Fenster umbenennen - - - Close &Window &Fenster schließen - - Ctrl+W - Ctrl+W + Strg+W Add column @@ -3932,22 +6091,14 @@ Ebene löschen - - Window &Geometry... Fenster&geometrie... - - - - &Hide Window Fenster &ausblenden - - More windows... Weitere Fenster... @@ -3956,31 +6107,22 @@ &Intensitätstabelle - - &Activate Window Fenster &aktivieren - - Mi&nimize Window Fenster mi&nimieren - - Ma&ximize Window Fenster ma&ximieren - - Re&size Window... Fen&stergröße ändern... - &Print Window Fenster &drucken @@ -4001,38 +6143,26 @@ 3D-Data hinzufügen - - Set &Properties... &Eigenschaften festlegen... - - Set &Dimensions... &Dimensionen festlegen... - - Set &Values... &Werte festlegen... - - &Transpose &Transponieren - - &Invert &Invertieren - - &Determinant &Determinate @@ -4045,32 +6175,22 @@ In Matrize &konvertieren - - 3D &Wire Frame 3D-&Drahtgitter - - 3D &Hidden Line 3D &verdeckte Linien - - 3D &Polygons 3D-&Polygone - - 3D Wire &Surface 3D-Drahtgitter-&Oberfläche - - There are no curves available on this plot! In diesem Diagramm existieren keine Kurven! @@ -4080,13 +6200,10 @@ Die Grafik, die Sie analysieren wollen existiert nicht mehr. Die ausgewhlte Operation wurde abgebrochen! - Disable &tools Werkzeuge deak&tivieren - - &Zoom &Zoom @@ -4099,13 +6216,10 @@ &Datenleser - - CTRL+D Ctrl+D - Data reader Datenleser @@ -4114,8 +6228,6 @@ Datenbereich aus&wählen - - ALT+S ALT+S @@ -4124,31 +6236,22 @@ &Bildschirmleser - Screen reader Bildschirmleser - - &Move Data Points... Datenpunkte &verschieben... - - Remove &Bad Data Points... Datenausreißer &entfernen... - - Alt+B Alt+B - - ALT+T ALT+T @@ -4157,15 +6260,10 @@ &Pfeil/Linie zeichnen - - CTRL+ALT+L Ctrl+ALT+L - - - &Table &Tabelle @@ -4174,27 +6272,14 @@ 3&D-Diagramm - - - - - - - QtiPlot - Plot error QtiPlot - Darstellungsproblem - - - - - You must select exactly one column for plotting! Sie müssen exakt ein Spalte für dieses Diagramm auswählen! - Please select a column to plot! Bitte whlen Sie die darzustellende Spalte aus! @@ -4207,26 +6292,14 @@ Bitte wählen Sie ein Verzeichnis für die zu exportierten Tabellen - There are no plot layers available in this window! Es sind keine Grafikebenen in diesem Fenster vorhanden! - - - - - - - - - - This functionality is not available for pie plots! Diese Funktionalität existiert nicht für Tortendiagramme! - There are no plot layers available in this window. Es sind keine Grafikebenen in diesem Fenster vorhanden. @@ -4243,14 +6316,10 @@ Bild &importieren... - - ALT+L ALT+L - - Arran&ge Layers Ebenen &anordnen @@ -4259,8 +6328,6 @@ ALT+A - - Print All Plo&ts Alle Grafiken aus&drucken @@ -4273,8 +6340,6 @@ &Kurve hinzufügen/entfernen - - ALT+C ALT+C @@ -4283,38 +6348,26 @@ &Funktion hinzufügen - - ALT+I ALT+I - - Inte&rpolate ... Inte&rpolieren... - - Fit Exponential Gro&wth ... Exponentielles &Wachstum fitten... - - Column &Options ... Spalten&optionen... - - Set Column &Values ... Spalten&werte setzen... - - &Remove Layer Ebene &entfernen @@ -4331,102 +6384,58 @@ <b> %1 </b>: Unbekannte Kommandozeilenoption oder fehlende Datei! - - - Folder Ordner - UNTITLED UNBENANNT - - Name Name - - - - - - - - - Type Typ - - View Ansicht - - - - - Size Größe - - - - - - Created Erstellt - - - Label Beschriftung - - Edit Bearbeiten - - Ctrl+ALT+M Ctrl+Alt+M - - QtiPlot - untitled QtiPlot - unbenannt - - Project Explorer Projektexplorer - - Results Log Ergebnis-Log - - - &Normalize &Normieren @@ -4439,36 +6448,28 @@ Spalten &füllen mit - &Translate &Verschieben - &Smooth &Glätten - &FFT filter &FFT Filter - Fit &Multi-peak &Mehrere Peaks fitten - - - &Plot &Diagramm - There are no available columns with plot designation set to Z! - Es gibt keine verfügbaren Spalten mit Plotzuweisung als Z! + Es gibt keine verfügbaren Spalten mit einer Diagrammzuordnung als Z-Achse! Y Axis Title @@ -4479,9 +6480,6 @@ X-Achsentitel - - - Please select a Y column to plot! Bitte eine Y-Spalte zum Plotten auswählen! @@ -4494,8 +6492,6 @@ Pixelintensität (a.u.) - - The table '%1' already exists. It has been renamed '%2'. Die Tabelle '%1' existiert bereits. Sie wurde in '%2' umbenannt. @@ -4504,91 +6500,46 @@ Die Matrix '%1' existiert bereits. Sie wurde in '%2' umbenannt. - Determinant of Determinante von - The selected columns have different numbers of rows! Die ausgewählten Spalen haben eine unterschiedliche Anzahl Zeilen! - The selected error column is empty! Die ausgewählte Fehlerspalte ist leer! - - - - - - - - QtiPlot - File opening error QtiPlot - Fehler beim Öffnen der Datei - The file <b>%1</b> is corrupted, but there exists a backup copy.<br>Do you want to open the backup instead? - Die Datei <b>%1</b> is korrupt, aber es existiert eine Sicherheitskopie.<br>Wollen Sie die Sicherheitskopie stattdessen öffnen? + Die Datei <b>%1</b> is beschädigt, aber es existiert eine Sicherheitskopie.<br>Wollen Sie die Sicherheitskopie stattdessen öffnen? - - The file: <b> %1 </b> was not created using QtiPlot! Die Datei <b> %1 </b> wurde nicht von QtiPlot erzeugt! - - - - - - - - - - - - - - - - - - QtiPlot QtiPlot - QtiPlot - Opening file QtiPlot - Datei öffnen - QtiPlot - Open Template File QtiPlot - Vorlagendatei öffnen - - - - - - - QtiPlot - File openning error QtiPlot - Fehler beim Öffnen der Datei - - - - The file: <b>%1</b> doesn't exist! Die Datei <b>%1</b> existiert nicht! @@ -4605,19 +6556,14 @@ Matrix1 - The file: <b>%1</b> is not a QtiPlot template file! Die Datei <b>%1</b> ist keine QtiPlot-Vorlagendatei! - - QtiPlot project QtiPlot Projekt - - Compressed QtiPlot project Gepacktes QtiPlot Projekt @@ -4634,17 +6580,14 @@ QtiPlot - Projekt öffnen - The file: <b>%1</b> is the current file! Die Datei <b>%1</b> ist die aktuelle Datei! - The file: <b>%1</b> is not a QtiPlot or Origin project file! - Die Datei <b>%1</b> ist kein QtiPlot oder Origin-Projekt! + Die Datei <b>%1</b> ist kein QtiPlot oder Origin-Projekt! - The file: <b> %1 </b> <p>does not exist anymore!<p>It will be removed from the list. Die Datei <b> %1 </b> <p> existiert nicht mehr!<p>Sie wird aus der Liste entfernt. @@ -4653,26 +6596,18 @@ Die Datei <b>%1</b> ist die aktuelle Datei! - - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Konnte nicht in Datei <br><h4> %1 </h4> schreiben.<p>Bitte überprüfen Sie Ihre Schreibrechte! - Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! Konnte nicht in Datei <br><h4> %1 </h4> schreiben.<p>Bitte überprüfen Sie Ihre Schreibrechte! - Save Project As Projekt speichern als - QtiPlot Matrix Template QtiPlot Matrixvorlage @@ -4681,42 +6616,32 @@ QtiPlot 2D Diagrammvorlage - QtiPlot Table Template QtiPlot Tabellenvorlage - QtiPlot 3D Surface Template QtiPlot 3D Oberflächenvorlage - Save Window As Template Fenster als Vorlage speichern - - Please enter a valid name! Bitte einen gültigen Namen eingeben! - The name you chose is not valid: only letters and digits are allowed! - Der eingegebene Name ist nicht gültig: Bitte nur Buchstaben und Ziffern eingeben! + Der eingegebene Name ist ungültig: Es sind nur Buchstaben und Ziffern erlaubt! - - - Please choose another name! Bitte einen anderen Namen wählen! - Name already exists! - Der Name existiert bereits! + Der Name existiert bereits! The table name must be different from the names of its columns! @@ -4739,54 +6664,32 @@ QtiPlot - Titel der operen Achse - Choose a filename to save under Dateiname zum Speichern auswählen - QtiPlot - Enter rows number QtiPlot - Anzahl der Zeilen eingeben - Rows Zeilen - QtiPlot - Enter columns number QtiPlot - Anzahl der Spalten eingeben - Columns Spalten - - - - - - - - - - - - QtiPlot - Column selection error QtiPlot - Fehler bei der Spaltenauswahl - - - - - Please select a column first! - Bitte zuerst eine Spalten auswählen! + Bitte zuerst eine Spalte auswählen! Line + s&ymbol @@ -4813,18 +6716,10 @@ Ge&stapelte Histogramme - - - - - - Cu&t &Ausschneiden - - Past&e &Einfügen @@ -4845,21 +6740,14 @@ Spalten &füllen mit - &Column &Spalte - - - - Clea&r &Leeren - - &Insert E&infügen @@ -4868,17 +6756,14 @@ Sp&alte hinzufügen - &Ascending &Aufsteigend - &Descending A&bsteigend - Sort Colu&mn Spalte S&ortieren @@ -4887,8 +6772,6 @@ Vektoren &XYXY - - &Worksheet &Arbeitsblatt @@ -4901,23 +6784,16 @@ Die aktive Ebene enthält keine Kurven! - - This will modify the data in the worksheets! Are you sure you want to continue? Diese Operation wird die Daten des Arbeitsblattes verändern! Wollen Sie fortfahren? - - Continue Fortfahren - - - Cancel Abbrechen @@ -4930,12 +6806,10 @@ Klicken Sie auf ein Diagramm, um Informationen anzuzeigen! - &Cascade Ü&berlagern - &Tile &Nebeneinander @@ -4948,56 +6822,38 @@ &Voriges - - - - &Properties... &Eigenschaften... - Save changes to project: <p><b> %1 </b> ? Änderungen im Projekt <p><b> %1 </b> speichern? - - Yes Ja - - No Nein - - - &Delete Selection Auswahl &löschen - - New &Window Neues &Fenster - - New F&older Neuer &Ordner - Auto &Column Width Automatische &Spaltenbreite - &Delete Window &Fenster löschen @@ -5010,20 +6866,14 @@ Abhängig&e 3D Diagramme - - - D&epends on Häng&t ab von - Function Funktion - - Maximized Maximiert @@ -5052,21 +6902,14 @@ Ko&piertes Bild einfügen - - - &Layer &Ebene - - - &Window &Fenster - E&xport E&xportieren @@ -5075,7 +6918,6 @@ &Geometrie... - P&roperties... &Eigenschaften... @@ -5084,53 +6926,38 @@ Ebene &löschen - - &Paste Layer Ko&pierte Ebene einfügen - &Copy Page Seite &kopieren - E&xport Page Seite e&xportieren - - - - &Paste E&infügen - - &Insert Row &Zeile Einfügen - &Delete Row Zeile &löschen - Clea&r Row Zeilen&inhalt löschen - - &Delete Rows Zeilen &löschen - Clea&r Rows Zeilen&inhalte löschen @@ -5139,49 +6966,38 @@ &3D-Diagramm - &Matrix... &Matrix... - Choose &Data Set... &Datensatz wählen... - Choose &Matrix... &Matrix wählen... - C&lear Daten &löschen - &Copy Graph Grafik &kopieren - &Export &Exportieren - &Insert Column Spalte e&infügen - &Delete Columns Spalten &löschen - - - QtiPlot - Help Files Not Found! QtiPlot - Hilfedateien nicht gefunden! @@ -5194,44 +7010,34 @@ QtiPlot - Hilfe-Browser - QtiPlot - Edit function QtiPlot - Funktion editieren - Minimized Minimiert - Hidden - Ausgeblendet + Ausgeblendet Curve: Kurve: - - New &Graph Neue &Grafik - - New &Note Neue &Notiz - - Ctrl+ALT+Z - Ctrl+Alt+Z + Strg+Alt+Z - Open Temp&late... Vor&lage öffnen... @@ -5244,20 +7050,14 @@ Entf - - Add/Remove &Curve... &Kurve hinzufügen/entfernen... - - Add &Error Bars... F&ehlerbalken hinzufügen... - - Add &Function... &Funktion hinzufügen... @@ -5266,68 +7066,46 @@ Zeitstempel hinzufügen - - Ctrl+ALT+T - Ctrl+Alt+T + Strg+Alt+T - - Vectors XY&AM Verktoren XY&AM - - &Low Pass... &Tiefpass... - - &High Pass... &Hochpass... - - &Band Pass... &Bandpass... - - &Band Block... &Bandfilter... - - &FFT... &FFT... - - &Savitzky-Golay... &Savitzky-Golay... - - &FFT Filter... &FFT Filter... - - Moving Window &Average... - &Gleitender Fensterdurchschnitt... + &Gleitender Mittelwert... - - Fit &Boltzmann (Sigmoidal) &Boltzmann fitten (Sigmoidal) @@ -5336,86 +7114,58 @@ &Kurven... - - &Scales... &Skalen... - - &Axes... &Achsen... - - &Grid ... &Gitter... - - &About QtiPlot Ü&ber QtiPlot - - &Surface... &Oberfläche... - - &Data Set... &Datensatz... - - Sort Ta&ble Ta&belle sortieren - - Sort Columns Spalten sortieren - - Co&rrelate Ko&rrelieren - - &Convolute &Falten - - &Deconvolute &Entfalten - - &Horizontal &Horizontal - - &Vertical &Vertikal - - Ro&w Numbers &Zeilennummern @@ -5424,26 +7174,18 @@ Z&ufallswerten - - &None &Keine - - &Box Plot &Boxdiagramm - - &Gaussian... &Gauss... - - &Lorentzian... &Lorentz... @@ -5452,8 +7194,6 @@ Nach Updates &suchen - - &QtiPlot Homepage &QtiPlot Homepage @@ -5462,8 +7202,6 @@ &Handbuch herunterladen - - &Translations Ü&bersetzungen @@ -5476,17 +7214,14 @@ Technischer &Support - Open a new project Ein neues Projekt öffnen - Create an empty 2D plot Ein leeres 2D-Diagramm erstellen - Create an empty note window Ein leeres Notizfenster erstellen @@ -5495,12 +7230,10 @@ Neue Tabelle - Create a new 2D function plot Eine neue 2D-Funktion erstellen - Create a new 3D surface plot Ein neues 3D-Oberflächendiagramm erstellen @@ -5509,9 +7242,8 @@ Projekt speichern - Open Te&mplate... - Vorlage öffnen... + &Vorlage öffnen... Open Template @@ -5522,37 +7254,30 @@ Das Fenster als Vorlage speichern - Undo changes Änderungen rückgängig machen - Redo changes Wiederherstellen - Cut selection Auswahl ausschneiden - Copy selection Auswahl kopieren - Paste selection Auswahl einfügen - Delete selection Auswahl löschen - Print window Fenster drucken @@ -5561,17 +7286,14 @@ Datum & Zeit - &Vectors XYXY &Vektoren XYXY - Vectors XYXY Vektoren XYXY - Vectors XYAM Vektoren XYAM @@ -5588,12 +7310,10 @@ Auf das Diagramm doppelklicken, um einen Datenpunkt auszuwählen! - QtiPlot - Enter the number of peaks QtiPlot - Anzahl der Peaks eingeben - Peaks Peaks @@ -5611,31 +7331,22 @@ Ctrl+Q - English Deutsch - - Scripting Console Skriptkonsole - - Draw &Arrow &Pfeil zeichnen - - CTRL+ALT+A Ctrl+Alt+A - - Draw &Line &Linie zeichnen @@ -5644,23 +7355,18 @@ Diese Operation kann nicht auf Kurven angewendet werden, die auf Spalten mit nicht-numerischem Format basieren. - - Recalculate Neu berechnen - Images Bilder - QtiPlot - Insert image from file QtiPlot - Bild aus Datei einfügen - Empty 3D surface plots cannot be duplicated! Leere 3D Oberflächendiagramme können nicht dupliziert werden! @@ -5673,30 +7379,22 @@ Alt+G - - - Ctrl+Shift+R - Ctrl+Shift+R + Strg+Shift+R - - Search for &Updates - Nach &Update suchen + Nach &Updates suchen - &Console &Konsole - Show Scripting console Skriptkonsole anzeigen - Draw arrow Pfeil zeichnen @@ -5705,9 +7403,8 @@ Text - Data - Daten + Daten Comma Separated Values @@ -5718,7 +7415,6 @@ QtiPlot - Importiere ASCII-Datei - Window Fenster @@ -5727,41 +7423,30 @@ Klicken Sie auf einen Datenpunkt, um Informationen anzuzeigen! - - &Zoom In Rein&zoomen - - Ctrl++ Ctrl++ - Zoom &Out Herausz&oomen - - Ctrl+- Ctrl+- - - Note - Notiz + Notiz - QtiPlot - Row selection error QtiPlot - Fehler beim Auswählen einer Zeile - Please select a row first! Bitte zuerst eine Zeile auswählen! @@ -5794,75 +7479,42 @@ Anzahl der zu mittelnden Pixel - - - &X &X - - - &Y &Y - - - &Z &Z - - - X E&rror X-&Fehler - - - Y &Error Y-F&ehler - Zoom In Hineinzoomen - Zoom Out Herauszoomen - QtiPlot - Set the number of pixels to average QtiPlot - Anzahl der zu mittelnden Pixel festlegen - Number of averaged pixels Anzahl der zu mittelnden Pixel - - - - - - - - - - - - - - Graph Grafik @@ -5871,25 +7523,18 @@ S&cripting - <h4>There are no matrices available in this project.</h4><p><h4>Please create a matrix and try again!</h4> <h4>Es sind keine Matrizen in diesem Projekt vorhanden.</h4><p><h4>Bitte eine Matrix erzeugen und noch einemal versuchen!</h4> - - QtiPlot - Renamed Window QtiPlot - Umbenanntes Fenster - - - Notes Notizen - The file "%1" was created using "%2" as scripting language. Initializing support for this language FAILED; I'm using "%3" instead. @@ -5899,12 +7544,10 @@ Einige Teile der Datei werden eventuell nicht wie erwartet dargestellt. - QtiPlot - Scripting Error QtiPlot - Skriptunterstützungsfehler - Scripting language "%1" failed to initialize. Skriptsprache "%1" konnte nicht initialisiert werden. @@ -5913,7 +7556,6 @@ Existirendes Verzeichnis wählen - Choose a directory to export the graphs to Ein Verzeichnis für den Export der Grafik wählen @@ -5930,29 +7572,22 @@ Notizen speichern als... - QtiPlot 2D Graph Template QtiPlot 2D-Grafik Vorlage - - &Edit Function... - Funktion b&earbeiten... + Funktion b&earbeiten... - - &Plot details... &Diagramm-Details... - D&epending Graphs Abhängig&e Grafiken - D&epending 3D Graphs Abhängig&e 3D-Grafiken @@ -5961,208 +7596,148 @@ 3D &Grafik - Choose the location of the QtiPlot help folder! Wählen Sie den QtiPlot Hilfeordner! - Open File - Datei öffnen + Datei öffnen Alt+F4 Alt+F4 - - Ctrl+Alt+O - Ctrl+Alt+O + Strg+Alt+O - - - - Ctrl+Return - Ctrl+Return + Strg+Eingabe - - &Go to Row... &Gehe zu Zeile... - - - - Ctrl+Alt+G - Ctrl+Alt+G + Strg+Alt+G - - Clear Leeren - - Scripting &language S&kriptsprache - - &Restart scripting Sk&riptunterstützung neu starten - - E&xecute &Ausführen - - Ctrl+J - Ctrl+J + Strg+J - - Execute &All A&lle Ausführen - - Ctrl+Shift+J - Ctrl+Shift+J + Strg+Umschalt+J - - &Evaluate Expression Ausdruck ausw&erten - - F3 - F3 + F3 Fit Fit - <b> %1 </b>: Wrong locale option or no translation available! - <b> %1 </b>: Falsches Landeskürzel oder keine Übersetzung vorhanden! + <b> %1 </b>: Falsches Landeskürzel oder keine Übersetzung vorhanden! QtiPlot - File Backup Error QtiPlot - Datei Backup Fehler - Cannot make a backup copy of <b>%1</b> (to %2).<br>If you ignore this, you run the risk of <b>data loss</b>. - Kann keine Sicherheitskopie von <b>%1</b> (nach %2) erstellen. <br>Wenn Sie diese Warnung ignorieren, kann <b>Datenverlust</b> auftreten. + Kann keine Sicherheitskopie von <b>%1</b> (nach %2) erstellen. <br>Wenn Sie diese Warnung ignorieren, kann <b>Datenverlust</b> auftreten. - The file: <br><b>%1</b> is opened in read-only mode - Die Datei <br><b>%1</b> wurde im schreibgeschützten Modus geöffnet + Die Datei <br><b>%1</b> wurde im schreibgeschützten Modus geöffnet - - - - &Find... &Suchen... - - App&end Project... Projekt an&hängen... - Save &As Project... - Speichere &als Projekt... + Speichere &als Projekt... - - Save Project &As... Speichere Projekt &als... - - &Show All Windows Alle Fen&ster anzeigen - - &Hide All Windows - Alle Fenster ausblenden + Alle Fenster &ausblenden - &Delete Folder - Or&dner löschen + Or&dner löschen - &Rename - Umbenennen + &Umbenennen - &Windows in Active Folder - Fenster im aktiven Ordner + &Fenster im aktiven Ordner - Windows in &Active Folder && Subfolders - Fenster im &aktiven Ordner && Unterordnern + Fenster im &aktiven Ordner && Unterordnern - &View Windows - Fenster anzeigen + Fenster &anzeigen - Project - Projekt + Projekt - - - Path - Pfad + Pfad - bytes - Bytes + Bytes - - Contents - Inhalt + Inhalt Windows @@ -6173,66 +7748,52 @@ Ordner - Modified - Geändert + Geändert - - - Properties - Eigenschaften + Eigenschaften - New Folder - Neuer Ordner + Neuer Ordner - QtiPlot - Delete folder? - QtiPlot - Order löschen? + QtiPlot - Order löschen? - Delete folder '%1' and all the windows it contains? - Ordner '%1' und alle enthaltenen Fenster löschen? + Ordner '%1' und alle darin enthaltenen Fenster löschen? - Status - Status + Status - QtiPlot - No match found - QtiPlot - Keine Übereinstimmung gefunden + QtiPlot - Keine Übereinstimmung gefunden - Sorry, no match found for string: '%1' - Entschuldigung, keine Übereinstimmung für die Zeichenkette '%1' gefunden + Keine Übereinstimmung für die Zeichenkette '%1' gefunden - Cannot move an object to itself! - Kann ein Objekt nicht auf sich selbst bewegen! + Kann ein Objekt nicht auf sich selbst bewegen! - Cannot move a parent folder into a child folder! - Kann nicht einen Ordner in einen seiner Unterordner bewegen! + Kann nicht einen Ordner in einen seiner Unterordner bewegen! Skipped Moving Folder Ordnerverschieben übersprungen - - The destination folder already contains a folder called '%1'! Folder skipped! - Der Zielordner enthält bereits einen Ordner mit dem Namen '%1'! Ordner übersprungen! + Der Zielordner enthält bereits einen Ordner mit dem Namen '%1'! Ordner übersprungen! QtiPlot - HTTP Get Version File @@ -6245,115 +7806,86 @@ %2. - Error while fetching version file with HTTP: %1. - Fehler beim Herunterladen der Versionsdatei über HTTP: %1. + Fehler beim Herunterladen der Versionsdatei über HTTP: %1. - QtiPlot - Updates Available - QtiPlot - Updates verfügbar + QtiPlot - Updates verfügbar - There is a newer version of QtiPlot (%1) available for download. Would you like to download it? - Eine neuere Version von QtiPlot (%1) ist verfügbar. Möchten Sie diese herunterladen? + Eine neuere Version von QtiPlot (%1) ist verfügbar. Möchten Sie diese herunterladen? - QtiPlot - No Updates Available - QtiPlot - Keine Updates verfügbar + QtiPlot - Keine Updates verfügbar - No updates available. Your current version %1 is the last version available! - Keine Updates verfügbar. Die verwendete Version %1 ist die aktuellste! + Keine Updates verfügbar. Die verwendete Version %1 ist die aktuellste! - QtiPlot - Script Window QtiPlot - Skriptfenster - - &Horizontal Steps &Horizontale Schritte - - - Automatic Layout Automatisches Layout - Script Window Skriptfenster - Add Layer Ebene hinzufügen - Arrange Layers Ebenen anordnen - Add Error Bars... Fehlerbalken hinzufügen... - Add Function... Funktion hinzufügen... - Add Image Bild hinzufügen - Add Text Text hinzufügen - - - - Animation Animation - - Matrix Plot Matrix Plot - The file: <p><b> %1 </b><p> is the current file! - Die Datei <p><b> %1 </b><p> ist die aktuelle! + Die Datei <p><b> %1 </b><p> ist die aktuelle Datei! - Name <b>%1</b> already exists! Der Name <b>%1</b> existiert bereits! - Warning: for internal consistency reasons the underscore character is replaced with a minus sign. - Warnung: Um interne Konsistenz zu sichern, wurden Unterstriche durch ein Minuszeichen ersetzt. + Warnung: Um interne Konsistenz sicherzustellen, wurden Unterstriche durch ein Minuszeichen ersetzt. - - QtiPlot - Help Profile Not Found! QtiPlot - Hilfeprofil nicht gefunden! @@ -6362,7 +7894,6 @@ Der Assistent konnte nicht gestartet werden, da die Datei <b>%1</b> im Hilfeverzeichnis nicht gefunden wurde!<p>Diese Datei gehört zum QtiPlot Handbuch, dass von der folgenden Internetadresse bezogen werden kann:</p><p><font color=blue>'http://soft.proindependent.com/manuals.html'</font></p> - Ctrl+K Strg+K @@ -6371,151 +7902,106 @@ Ctrl+Alt+K - - - - Alt+Q Alt+Q - Contour - &Color Fill &Kontur - Farbfüllung - - Contour &Lines Kontur&linien - - &Gray Scale Map &Graustufenoberfläche - Contour + &Color Fill - Konturen + Farbfüllung + Konturen + &Farbfüllung - Contour Lines + Color Fill Konturlinien + Farbfüllung - Contour Lines Konturlinien - Gray Scale Map Graustufenpalette - - - - Enable perspective Perspektive einschalten - - - - Reset rotation Rotation zurücksetzen - - - - Fit frame to window Rahmen an Fenster anpassen - &Next next window &Nächstes - F5 next window shortcut F5 - &Previous previous window &Voriges - F6 previous window shortcut F6 - Disable &Tools Werkzeuge deak&tivieren - &Zoom Out Heraus&zoomen - - &Data Reader &Datenleser - - &Select Data Range Datenbereich au&swählen - - S&creen Reader &Bildschirmleser - - 3D Surface 3D-Oberflächendiagramm - - &Recent Projects &Zuletzt geöffnete Projekte - 3&D Plot 3&D-Diagramm - Set Columns &As Spalten setzen &als - - &Fill Columns With Spalten &füllen mit @@ -6532,42 +8018,26 @@ Scripting - - 3D &Plot 3D-Dia&gramm - - QtiPlot - Overwrite file? QtiPlot - Datei überschreiben? - - - - - - - QtiPlot - Export error QtiPlot - Export-Fehler - - Vertical &Drop Lines Vertikale &Linien - - Set As Setzen als - &Fill Column With Spalten &füllen mit @@ -6576,150 +8046,111 @@ Sp&alte hinzufügen - &View Pixel Line profile - Linienprofil anzeigen + &Linienprofil anzeigen - Re&move Pie Curve &Tortengrafik entfernen - Anal&yze Anal&yse - &Paste Text Ko&pierten Text einfügen - &Paste Line/Arrow Ko&pierte(n) Linie/Pfeil einfügen - &Paste Image Ko&piertes Bild einfügen - - Dra&g Curve - + Kurve &ziehen - &Import - &Importieren + &Importieren - - The manual can be downloaded from the following internet address: Das Handbuch kann von der folgenden Adresse heruntergeladen werden: - - The assistant could not start because the file <b>%1</b> was not found in the help file directory! Der Assistent konnte nicht starten weil die Datei <b>%1</b> nicht im Hilfeverzeichnis gefunden wurde! - - This file is provided with the QtiPlot manual which can be downloaded from the following internet address: Diese Datei wird vom QtiPlot-Handbuch zur Verfügung gestellt, das von der folgenden Adresse heruntergeladen werden kann: - Please indicate the location of the help file! Wählen Sie das Verzeichnis der Hilfedatei! - - New 3D &Surface Plot Neues &3D-Oberflächendiagramm - - + Open Exce&l ... + Exce&l-Datei öffnen ... + + Open Image &File - Bilddatei ö&ffnen + Bilddatei ö&ffnen - - Import I&mage... Bild i&mportieren... - - Save As &Template... Als &Vorlage speichern... - Save Note As... Notizen speichern als... - - Cu&t Selection Auswahl ausschnei&den - - &Copy Selection Auswahl &kopieren - - &Paste Selection Auswahl ein&fügen - - Del delete key - Del + Entf - - Clear &Log Information Alle &Log-Einträge löschen - - Delete &Fit Tables &Fit-Tabellen löschen - - Plot &Wizard Diagramm-&Assistent - - &Rescale to Show All Auf Komplettansicht &reskalieren - - Add Time Stamp Zeitstempel hinzufügen @@ -6728,27 +8159,18 @@ &Nicht-linearer Fit... - - &Choose Help Folder... &Bitte wählen Sie den Hilfe-Ordner aus... - - - Add Column Spalte hinzufügen - - &View Pixel Line Profile Linienprofil &anzeigen - - &Intensity Table &Intensitätstabelle @@ -6757,73 +8179,54 @@ &Ebenengeometrie - &Convert to Spreadsheet In Tabelle &konvertieren - Convert to &Matrix In &Matrix konvertieren - - &Random Values Zufallswe&rte - QtiPlot &Forums QtiPlot &Foren - - Report a &Bug Einen &Bug melden - - Download &Manual &Handbuch herunterladen - - Make a &Donation Das Projekt mit einer Spen&de unterstützen - - Technical &Support Technischer &Support - - &Script Window &Skriptfenster - New table Neue Tabelle - Save project Projekt speichern - Open template Vorlage öffnen - Save window as template Fenster als Vorlage speichern @@ -6836,12 +8239,10 @@ &Mehrere Dateien... - Project &Explorer Projekt&explorer - Show analysis results Berechnungsergebnisse anzeigen @@ -6850,195 +8251,146 @@ Ctrl+Alt+0 - Date & time Datum & Zeit - Plot as line Als Linie darstellen - Plot as symbols Als Symbole darstellen - Plot as line + symbols Als Linie mit Symbolen darstellen - Plot 3D ribbon 3D-Band zeichnen - Plot 3D bars 3D-Balken zeichnen - Plot 3D scatter 3D-Punkte zeichnen - Plot 3D trajectory 3D-Trajektorie zeichnen - More Windows... Weitere Fenster... - + Image Profiles + Bild-Querschnitte + + Box and whiskers plot Box-and-Whiskers-Diagramm - Visit QtiPlot &Forums QtiPlot &Foren besuchen - Show find dialog - + Suchen-Dialog anzeigen - Find Next - + Weitersuchen - Find Previous - + Vorherige Suchen - Show replace dialog - + Ersetzen-Dialog anzeigen - Drag Curve - + Kurve ziehen - - No axes - Keine Axen + Keine Achsen - Front grid Vordergrundgitter - Back grid Hintergrundgitter - Right grid Rechtes Gitter - Left grid Linkes Gitter - Ceiling grid Deckengitter - Floor grid Bodenflächengitter - - Hidden line Versteckte Linie - - Polygon Only Nur Polygon - - Mesh & Filled Polygons Netz & gefüllte Polygone - - - - Crosshairs Fadenkreuze - - Floor data projection Bodenflächenprojektion der Daten - - Floor isolines Bodenflächenkonturlinien - - Empty floor Leere Bodenfläche - - - - - - - - Column Spalte - Script Error Skriptfehler - Table1 Tabelle1 - - Released Herausgegeben - Curve Kurve @@ -7047,8 +8399,6 @@ Es sind keine Grafikebenen im Fenster <b> - - Please select two columns for this operation: the first represents the signal and the second the response function! Bitte wählen Sie zwei Spalten für diese Operation aus: @@ -7067,40 +8417,30 @@ Es sind keine Exportoptionen für 3D-Diagramme verfügbar! - Please select two columns for this operation! Bitte zwei Spalten für diese Operation auswählen! - Please select exactly one columns for this operation! Bitte genau ein Spalte für diese Operation auswählen! - Could not write to file: <h4>%1</h4><p>Please verify that you have the right to write to this location or that the file is not being used by another application! - Konnte in Datei nicht schreiben: <h4>%1</h4><p>Bitte stellen Sie sicher, dass die Schreibrechte für diesen Ordner haben und dass keine andere Applikation diese Datei benutzt! + Konnte nicht in Datei schreiben: <h4>%1</h4><p>Bitte stellen Sie sicher, dass Sie Schreibrechte für diesen Ordner haben und dass keine andere Anwendung diese Datei verwendet! - - &Export PDF &Exportieren als PDF - - Ctrl+Alt+P - Ctrl+Alt+P + Strg+Alt+P - - &Autocorrelate &Autokorrelieren - Export to PDF Exportieren als PDF @@ -7109,19 +8449,16 @@ QtiPlot - Hilfe - This will clear the contents of all the data associated with the table. Are you sure? - Dieser Vorgang löscht alle der Tabelle zugeordnete Daten. Sind Sie sicher? + Dieser Vorgang löscht alle der Tabelle zugeordneten Daten. Sind Sie sicher? - QtiPlot - Enter row number - QtiPlot - Zeilennummer eingeben + QtiPlot - Zeilennummer eingeben - Row - Zeile + Zeile Origin matrix @@ -7132,32 +8469,22 @@ Origin-Arbeitsblatt - - &Reset to Full Range - Zurücksetzen auf gesamter Be&reich + Zurücksetzen auf gesamten Be&reich - - Edit &Range... Be&reich ändern... - - &Hide Aus&blenden - - Hide &Other Curves Andere &Kurven ausblenden - - &Show All Curves &Alle Kurven anzeigen @@ -7166,9 +8493,8 @@ <font size=+2, color = darkBlue><b>QtiPlot ist eine Open-Source Software und seine Entwicklung hat Hunderte von Arbeitsstunden gekostet.<br><br> Wenn Sie QtiPlot mögen, bei Ihrer Arbeit benutzen und möchten, dass es konstant weiterentwickelt wird,<br> unterstützen Sie bitte seine Autoren durch eine Spende.<br><br> Möchten Sie jetzt für QtiPlot spenden?</b></font> - Please support QtiPlot! - Bitte unterstützen Sie QtiPlot! + Bitte unterstützen Sie QtiPlot! Yes, I'd love to! @@ -7183,148 +8509,112 @@ Nein, lassen Sie mich damit in Ruhe! - <b> %1 </b>: This command line option must be used without other arguments! - <b> %1 </b>: Diese Kommandozeilenoption muss ohne weitere Argumente verwendet werden! + <b> %1 </b>: Diese Kommandozeilenoption muss ohne weitere Argumente verwendet werden! - Version - Version + Version - Usage - Verwendung + Verwendung - options - Optionen + Optionen - - file - Datei + Datei - - name - Name + Name - Valid options are - Gültige Optionen sind + Gültige Optionen sind - - - - - - - - or - oder + oder - show about dialog and exit - Über-Dialog anzeigen und beenden + Über QtiPlot-Dialog anzeigen und beenden - show command line options - Kommandozeilenoptionen anzeigen + Kommandozeilenoptionen anzeigen - start QtiPlot in language - QtiPlot starten in Sprache + QtiPlot starten in Sprache - show QtiPlot manual in a standalone window - QtiPlot-Handbuch in einem unabhängigen Fenster anzeigen + QtiPlot-Handbuch in einem unabhängigen Fenster anzeigen - print QtiPlot version and release date - QtiPlot-Version und Herausgabedatum ausgeben + QtiPlot-Version und Herausgabedatum ausgeben can be any .qti, qti.gz, .opj, .ogm, .ogw or ASCII file Kann eine beliebige .qti, qti.gz, .opj, .ogm, .ogw, .ogg or ASCII Datei sein - <b> %1 </b> unknown command line option! - <b> %1 </b>: Unbekannte Kommandozeilenoption! + <b> %1 </b>: Unbekannte Kommandozeilenoption! - Type %1 to see the list of the valid options. - Geben Sie %1 ein, um die Liste der gültigen Optionen anzeigen zu lassen. + Geben Sie %1 ein, um die Liste der gültigen Optionen anzeigen zu lassen. QtiPlot - Open project QtiPlot - Projekt öffnen - QtiPlot - Demo Version - QtiPlot - Demoversion + QtiPlot - Demoversion You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your projects. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. Sie benutzen die Demoversion von QtiPlot. Sie ist mit der Vollversion identisch bis auf die Limitierung, dass Sie keine Projekte speichern können. <br><br> Wenn Sie eine sofort benutzbare, voll funktionstüchtige Version möchten, schließen Sie bitte einen <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a> ab. <br><br> QtiPlot ist freie Software im Sinne von freier Rede. Wenn Sie wissen, wie dieser zur handhaben ist, können Sie den <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">Quellcode</a> kostenlos herunterladen. Trotzdem, erwägen Sie bitte, eine <a href="http://soft.proindependent.com/why_donate.html">Spende</a> abzugeben, um die weitere Entwicklung QtiPlot zu unterstützen. - QtiPlot - File backup error - QtiPlot - Datei-Backup-Fehler + QtiPlot - Datei-Backup-Fehler - QtiPlot - File save error - QtiPlot - Fehler beim Sichern der Datei + QtiPlot - Fehler beim Sichern der Datei - Save project as - Project speichern als + Projekt speichern als - - windows - Fenster + Fenster - - folders - Ordner + Ordner - - 3D Graph - 3D-Grafik + 3D-Grafik - Skipped moving folder - Ordnerverschieben übersprungen + Ordnerverschieben übersprungen - QtiPlot - HTTP get version file - QtiPlot - HTTP Versionsdatei herunterladen + QtiPlot - HTTP Versionsdatei herunterladen <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> If you like it, you're using it in your work and you would like to see it constantly improved,<br> please support its authors by making a donation.<br><br> Would you like to make a donation for QtiPlot now?</b></font> @@ -7335,761 +8625,656 @@ Sie verwenden die Demoversion von QtiPlot. Sie ist mit der Vollversion identisch bis auf folgende Limitierungen: Sie können keine Projekte speichern und können nicht länger als 10 Minuten pro Sitzung arbeiten. <br><br> Wenn Sie eine vollständig funktionstüchtige Version haben möchten, schließen Sie bitte einen <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a> ab. <br><br> QtiPlot ist freie Software im Sinne von freier Rede. Wenn Sie wissen, wie dieser zur handhaben ist, können Sie den <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">Quellcode</a> kostenlos herunterladen. Erwägen Sie bitte trotzdem etwas <a href="http://soft.proindependent.com/why_donate.html">zu spenden</a> , um die weitere Entwicklung von QtiPlot zu unterstützen. - Vie&w - Ansicht + Ansich&t - &Palette &Palette - - &Read-only Sch&reibgeschützt - - Read/&Write - Lesen/Schreiben + Lesen/&Schreiben QtiPLot - Plot error QtiPlot - Plot-Fehler - - Please select four columns for this operation! Bitte vier Spalten für diesen Vorgang auswählen! - You must select a single Y column that has an associated X column! - + Sie müssen eine einzelne Y-Spalte mit zugeordnetter X-Spalte auswählen! - You must select exactly one Z column! - - - - + Sie müssen genau eine Z-Spalte wählen! + + + Open ODF Spreadsheet File + Öffne ODF-Tabellenkalkulationsdatei + + + File %1 contains only %2 sheets! + Datei %1 enthült nur %2 Blätter! + + + QtiPlot was built without ODF spreadsheet support! + QtiPlot wurde ohne Unterstützung für ODF-Tabellenkalkulationsdateien erstellt! + + Imported sound file - + Importierte Sound-Datei - This is not a PCM type WAV file, operation aborted! - + Dies ist keine WAV-Datei im PCM-Format. Die Operation wurde Abgebrochen! - PCM - + PCM - - Time - Zeit + Zeit - Left - Links + Links - Right - Rechts + Rechts - Channels - + Kanäle - Sample Rate - + Abtastrate - Byte Rate - + Byterate - Block Align - + Blockausrichtung - Bits Per Sample - + Bits pro Sample - Presentation Preview - + Präsentationsvorschau - &Save - &Speichern + &Speichern - Output format: Ausgabeformat: - Directory: Verzeichnis: - There are no plot layers available in window <b>%1</b>.<br>Graph window not exported! Es sind keine Grafik-Ebenen in Fenster <b>%1</b> vorhanden. Grafikfenster nicht exportiert! - - QtiPlot - Delete rows QtiPlot - Zeilen löschen - Start row Startzeile - End row Endzeile - + Paste Selection as Te&xt + Auswahl als Te&xt einfügen + + Set Display Range Anzeigebereich setzen - There are no windows available in this folder! - - - - + Dieser Ordner enthält keine Fenster! + + + Export + Export + + &Folders - Ordner - - - - + &Ordner + + + Ctrl+Shift+E + Strg+Umschalt+E + + + Open ODF Spreads&heet... + Öffne ODF-Tabellen&kalkulation... + + &Import ASCII... ASCII-&Import... - - &Sound (WAV)... - + &Audiodatei (WAV)... - - Shift+A Umschalt+A - - Create Open &Document Presentation... - + Erstelle Open &Document Präsentation... - - &Close - S&chließen - - - - + S&chließen + + + Zoom/Drag Canvas &Horizontally + &Horizontales Zoomen/Verschieben der Zeichenfläche + + + Zoom/Drag Canvas &Vertically + &Vertikales Zoomen/Verschieben der Zeichenfläche + + + Stack &Bar + Gestabeltes &Balkendiagramm + + + Stack &Column + Gestapeltes &Säulendiagramm + + &Lowess... - + &Lokale Regression (linear)... - - Fit &Wizard... - Fit-Assistent... + Fit-&Assistent... - - &Swap columns &Spalten tauschen - - Move &Right Ve&rschiebe nach rechts - - Move &Left Verschiebe nach &links - - Move to F&irst - Verschiebe zum ersten + Verschiebe zur &Eersten - - Move to Las&t - Verschiebe zum le&tzten + Verschiebe zur Le&tzten - - &Delete Rows Interval... &Entferne Spalten im Bereich... - - + &Image Profiles + &Bild-Querschnitte + + Flip &V - Drehe &V + &Vertikal umdrehen - Ctrl+Shift+V Strg+Umschalt+V - - Flip &H - Drehe &H + &Horizontal umdrehen - Ctrl+Shift+H Strg+Umschalt+H - - R&otate 90 - Drehe 90 + Um 90° &drehen - - Rotate &-90 - Drehe &-90 + Um &-90° drehen - - Ctrl+Alt+R Strg+Alt+R - - &Image mode B&ildmodus - Ctrl+Shift+I Strg+Umschalt+I - - &Data mode &Datenmodus - Ctrl+Shift+D Strg+Umschalt+D - + Open ODF Spreadsheet + Öffne ODF-Tabellenkalkulation + + + Zoom In/Out and Drag Canvas Horizontally + Vergrößern/Verkleinern und horizontales verschieben der Zeichenfläche + + + Zoom In/Out and Drag Canvas Vertically + Vergrößern/Verkleinern und vertikales verschieben der Zeichenfläche + + + can be any .qti, qti.gz, .ods, .opj, .ogm, .ogw, .ogg, .py, .xls or ASCII file + kann eine beliebige .qti, qti.gz, .ods, .opj, .ogm, .ogw, .ogg, .py, .xls oder ASCII datei sein + + Memory Allocation Error - + Fehler bei der Speicherreservierung - Not enough memory, operation aborted! - + Nicht genug Speicher. Vorgang abgebrochen! - - Set Precision %1 digits - - - - - - + Setze Genauigkeit auf %1 Dezimalstellen + + + Choose custom user interface + Wählen Sie eine benutzerdefinierte Oberfläche + + + Custom user interfaces can be created using the QtDesigner application provided by the Qt framework + Benutzerdefinierte Oberflöchen lönnen mit dem QtDesigner aus dem Qt-System erstellt werden + + + For more details about how to use .ui files in your Python scripts please read the PyQt4 documentation + Für weitere Informationen zur Anwendung von .ui Dateien in Ihren Python-Scripten lesen Sie bitte die PyQt4 Dokumentation + + &Gray Scale &Graustufen - - &Rainbow &Regenbogen - - &Export Image ... &Exportiere Abbildung ... - - &Read Only Sch&reibgeschützt - - &Disregard - nicht berücksichtigen + &nicht berücksichtigen - - - You need at least two columns for this operation! Es werden mindestens zwei Spalten für diesen Vorgang benötigt! - Please set a default X column for this table, first! - Bitte zuerst eine Spalte als Standard X-Spalte für diese Tabelle festlegen! + Bitte zuerst eine Spalte als Standard X-Spalte für diese Tabelle festlegen! - Please select a Z column for this operation! - Bitte eine Z-Spalte für diesen Vorgang wählen! + Bitte eine Z-Spalte für diesen Vorgang wählen! - You need to define a X column first! - Sie müssen zuerst eine X-Spalte definieren! + Sie müssen zuerst eine X-Spalte definieren! - You need to define a Y column first! - Sie müssen zuerst eine Y-Spalte definieren! + Sie müssen zuerst eine Y-Spalte definieren! - - &Custom - Anpassen + &Anpassen - New Fol&der - Neuer Or&dner + Neuer Or&dner - Create a new folder Erstelle einen neuen Ordner - Import data file(s) Datendatei(en) importieren - Swap selected columns Ausgewählte Spalten tauschen - Move Right Verschiebe nach rechts - Move Left verschiebe nach links - Move to First Verschiebe zum ersten - Move to Last Verschiebe zum letzten - - &Draw Data Points Zeichne &Datenpunkte - - &Image Plot B&ilddiagramm - - Show &X/Y Zeige &X/Y - Ctrl+Shift+X Strg+Umschalt+X - - Show &Column/Row - Zeige Spalte/Zeile + Zeige &Spalte/Zeile - Ctrl+Shift+C Strg+Umschalt+C - &Forward FFT Vorwärts-&FFT - &Inverse FFT &Inverse-FFT - - Ctrl+Shift+T Strg+Umschalt+T - Draw Data Points Zeichne Datenpunkte - - - Format Format - - Add &Custom Script Action... - Hinzufügen und anpassen von Skriptaktionen... + Hinzufügen &benutzerdefinierter Skriptaktionen... - - Bold - Dick + Fett - - Italic Kursiv - Superscript Hochgestellt - Subscript Untergestellt - - Underline (Ctrl+U) Unterstrichen (Strg+U) - - - - Greek Griechisch - - - Error - Fehler + Fehler - - - &Label - Beschriftung + &Beschriftung - - Undo Stack Rückgängig-Modul - Empty Stack Leeres Modul - Set Image Mode Setze den Bildmodus - Set Data Mode Setze den Datenmodus - Show X/Y Zeige X/Y - Show Column/Row Zeige Spalte/Zeile - Set Gray Scale Palette Die Graustufenpalette festlegen - Set Rainbow Palette Die Regenbogenpalette festlegen - - + Couldn't open file %1 + Konnte Datei %1 nicht öffnen + + + Open Excel File + Öffne Excel Datei + + + Ctrl+Alt+S + Strg+Alt+S + + &Hide Selected - Verstecke markierte + &Verstecke markierte - - Sho&w All Columns - Zeige alle Spalten + &Zeige alle Spalten - - - - &Direct &Direkt - - &XYZ Columns &XYZ-Spalten - - &YXZ Columns &YXZ-Spalten - - 2D &Binning - + &Binning/Klasseneinteilung: 2D Histogramm - - &Regular XYZ - + &Regulär: gegeben durch XYZ-Spalten - - Find &Next - + &nächsten finden - - Find &Previous - + &Vorherige Suchen - - F4 - + F4 - - &Replace... - E&rsetzen... + E&rsetzen... - - Increase Indent - + Einrückung vergrößern - - Decrease Indent - + Einrückung verkleinern - - Rena&me Tab... - + Tab &umbenennen... - - A&dd Tab - + Tab &hinzufügen - - C&lose Tab - - - - + Tab &schließen + + + Load Custom User &Interface... + Benutzerdefinierte &Oberfläche laden... + + Increase Precision - + Genauigkeit erhöhen - Decrease Precision - - - - + Genauigkeit verringern + + + Ctrl+Alt+A + STRG+Alt+A + + + Open Excel + Öffne Excel + + Show available undo/redo commands Zeige verfügbare Rückgängig/Wiederherstellen-Befehle - Print preview - - - - + Druckvorschau + + + Plot stack bar + Gestabeltes Balkendiagramm zeichnen + + + Plot stack column + Gestapeltes Säulendiagramm zeichnen + + Hide selected columns Verstecke markierte Spalten - Show all table columns Zeige alle Tabellenspalten - Integration of %1 from zero is - Integration von %1 angefangen bei Null ist + Integral von %1 angefangen bei Null ist - - &Integrate &Integriere - - Integr&ate Function... - Integriere Funktion... + Inte&griere Funktion... - - Ctrl+D Strg+D - - &Toolbars... Werkzeugleis&ten... - &Undo/Redo Stack Rückgängig/Wiederherstellen-Mod&ul - - Go to Colum&n... - Gehe zur Spalte... + Gehe zu S&palte... - - Ctrl+Alt+C Strg+Alt+C - Set Matrix Values Lege Matrixwerte fest - Image Plot - Bildplot + Bilddiagramm Rotate 90° Clockwise @@ -8100,721 +9285,617 @@ Drehe gegen den Uhrzeigersinn um 90° - Flip Vertically - Vertikal drehen + Vertikal umdrehen - Flip Horizontally - Horizontal drehen + Horizontal umdrehen - Fill selected columns with row numbers Fülle die markierten Spalten mit den Zeilennummern - Fill selected columns with random numbers Fülle die markierten Spalten mit Zufallszahlen - Set column as X Setze Spalte als X - Set column as Y Setze Spalte als Y - Set column as Z Setze Spalte als Z - Set as Y Error Bars Setze als Y-Fehlerbalken - Set as Labels Setze als Beschriftungen - Disregard Columns Ignoriere Spalten - - Mathematical Symbols Mathematische Symbole - Integration of %1 Integration von %1 - Area Fläche - - - - - Please select a 'Y' column first! Bitte zuerst eine 'Y'-Spalte markieren! - - Linear Regression of %1 Lineare Regression von %1 - - Slope Steigung - Intercept Abschnitt - - Chi^2 Chi^2 - - R^2 R^2 - &Scripting &Skripte - - Show Line &Numbers Zeige die Zeile&nnnummern - - Add E&quation - Gleichung hinzufügen + &Gleichung hinzufügen - - ALT+Q Alt+Q - - Add &Rectangle &Rechteck hinzufügen - - CTRL+ALT+R Strg+Alt+R - - You don't have the permission to open this file: <b>%1</b> Sie haben nicht ausreichend Rechte um die Datei <b>%1</b> zu öffnen - - - There are no layers available on this plot. Operation aborted! - In diesem Diagramm sind keine Ebenen verfügbar. Vorgang abgebrochen! + In diesem Diagramm sind keine Ebenen vorhanden. Vorgang abgebrochen! - &Paste Tex Formula - TeX-Formel einfügen + TeX-Formel einfü&gen - - &Frequency Count ... &Frequenzzähler ... - Add Equation Gleichung hinzufügen - Add Rectangle Rechteck hinzufügen - You need to select at least one Y column for this operation! Für diesene Vorgang müssen Sie mindestens eine Y-Spalte markieren! - Y2 Axis Title Y2-Achsenbeschriftung - You must have more than one layer in the active window! - Im aktiven Fenster muss mehr als eine Ebene vorhanden sein! + Im aktiven Fenster muss mehr als eine Ebene vorhanden sein! - You must have more than one dataset in the active layer! - Im aktiven Fenster muss mehr als ein Datensatz vorhanden sein! + Im aktiven Fenster muss mehr als ein Datensatz vorhanden sein! - - D&ouble-Y D&oppel-Y - - E&xtract to Graphs In Diagramme e&xtrahieren - Extract to &Layers - In Ebene extrahieren + In &Ebene extrahieren - - Add Inset Layer Eingebettete Ebene hinzufügen - Double Y Axis Doppelte Y-Achse - Extract to Graphs In Diagramme extrahieren - Extract to Layer&s - In Ebene extrahieren + In &Ebenen extrahieren - Extract to Layers - In Ebene extrahieren + In Ebenen extrahieren - Please select exactly one column and more than one non empty cell! - Bitte genau eine Spalte markieren die mehr als eine nichtleere Zelle enthält! + Bitte genau eine Spalte markieren die mehr als eine nichtleere Zelle enthält! - - Add &Ellipse &Ellipse hinzufügen - - CTRL+ALT+E Strg+Alt+E - &Paste Rectangle - Rechteck einfügen + &Rechteck einfügen - &Paste Ellipse - Elli&pse einfügen + &Ellipse einfügen - Add Ellipse/Circle Ellipse/Kreis hinzufügen - - - - Ctrl+Alt+H Strg+Alt+H - Set Default Palette Bestimme die Standardpalette - - &Default Stan&dard - <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> If you like it, you're using it in your work and you would like to see it constantly improved, please support its authors by making a donation.</b></font> - <font size=+2, color = darkBlue><b>QtiPlot ist Opensource Software. Die Entwicklung hat hunderte von Studen in Anspruch genommen.<br><br> Wenn Sie QtiPlot mögen und es regelmäßig nutzen, möchten Sie bestimmt, dass es permanent verbessert wird. Bitte unterstützen Sie die Autoren durch eine Spende.</b></font> + <font size=+2, color = darkBlue><b>QtiPlot ist Opensource Software. Die Entwicklung hat hunderte von Studen in Anspruch genommen.<br><br> Wenn Sie QtiPlot mögen und es regelmäßig nutzen, möchten Sie bestimmt, dass es permanent verbessert wird. Bitte unterstützen Sie die Autoren durch eine Spende.</b></font> - start QtiPlot with the default settings - starte QtiPlot mit den Standardeinstellungen + starte QtiPlot mit den Standardeinstellungen - execute the script file given as argument - Ausführen der Skriptdatei, die als Argument angegeben wurde. + Ausführen der Skriptdatei, die als Argument übergeben wurde - execute the script file given as argument without displying the user interface. Warning: 2D plots are not correctly handled in this functioning mode! - Ausführen der Skriptdatei, die als Argument angegeben wurde, ohne die Benutzeroberfläche anzuzeigen. Warnung: 2D-Diagramme werden in diesem Modus nicht korrekt verarbeitet! + Ausführen der Skriptdatei, die als Argument übergeben wurde, ohne die Benutzeroberfläche anzuzeigen. Warnung: 2D-Diagramme werden in diesem Modus nicht korrekt verarbeitet! - can be any .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py or ASCII file - kann eine beliebige .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py oder ASCII-Datei sein + kann eine beliebige .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py oder ASCII-Datei sein - Help - Hilfe + Hilfe - <b>%1</b> is a directory, please specify a file name! - <b>%1</b> ist ein Verzeichnis. Bitte einen Dateinamen eingeben! + <b>%1</b> ist ein Verzeichnis. Bitte einen Dateinamen eingeben! - QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! - QtiPlot wird versuchen Informationen über verfügbare Updates herunterzuladen. Bitte passen Sie ihre Firewalleinstellungen so an, dass QtiPlot auf das Internet zugreifen kann! + QtiPlot wird versuchen Informationen über verfügbare Updates herunterzuladen. Bitte passen Sie ihre Firewalleinstellungen so an, dass QtiPlot auf das Internet zugreifen kann! - Do you wish to continue? - Möchten Sie fortfahren? + Möchten Sie fortfahren? - QtiPlot - Enter column number - QtiPlot - Spaltennummer einfügen + QtiPlot - Spaltennummer eingeben - - QtiPlot was not built with Python scripting support included! - QtiPlot wurde ohne der Pythonskriptsprache erstellt! + QtiPlot wurde ohne Unterstützung für die Python-Skriptsprache erstellt! - Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. - Ab der Version 0.9.1 werden die Benutzerdefinierten Fitmodelle in einem anderen Ordner abgelegt. + Ab der Version 0.9.1 werden die benutzerdefinierten Fitmodelle in einem anderen Ordner abgelegt. - If you want to save your already defined models, please choose a destination folder. - Wenn Sie Ihre Modelle speichern möchten, müssen Sie einen Zielordner auswählen. + Wenn Sie Ihre Modelle speichern möchten, müssen Sie einen Zielordner auswählen. - Import fit models - Importiere Fitmodelle + Importiere Fitmodelle - Choose a directory to export the fit models to - Wählen Sie einen Ordner, in den die Fitmodelle exportiert werden + Wählen Sie einen Ordner, in den die Fitmodelle exportiert werden - - No Icon - Kein Piktogramm + Kein Piktogramml - Couldn't load file: %1. Autocompletion will not be available! - Konnte die Datei %1 nicht laden. + Konnte die Datei %1 nicht laden. Autovervollständigung ist nicht verfügbar! - Rotate 90 Clockwise - Drehe im Uhrzeigersinn um 90° + Drehe um 90° im Uhrzeigersinn - Rotate 90 Counterclockwise - Drehe gegen den Uhrzeigersinn um 90° + Drehe um 90° gegen den Uhrzeigersinn - - Ctrl+Shift+S Strg+Umschalt+S - + Profiles + Querschnitte + + + Horizontal + Horizontal + + + Vertical + Vertikal + + Data set: %1 doesn't exist! - Der Datensatz %1 existiert nicht! + Der Datensatz %1 existiert nicht! - Stem and leaf plot of dataset - Stamm-Blatt-Diagramm von Datensatz + Stamm-Blatt-Diagramm von Datensatz - from row - von Zeile + von Zeile - to row - bis Zeile + bis Zeile - Not enough memory for this dataset! - Nicht genug Speicher für diesen Datensatz! + Nicht genug Speicher für diesen Datensatz! - Stem - Stamm + Stamm - Leaf - Blatt + Blatt - Please confirm the stem unit! - Bitte die Stamm-Einheit bestätigen! + Bitte die Stamm-Einheit bestätigen! - Data set - Datensatz + Datensatz - stem unit - Stamm-Einheit + Stamm-Einheit - Stem unit - Stamm-Einheit + Stamm-Einheit - Leaf unit - Blatt-Einheit + Blatt-Einheit - Key - Schlüssel + Schlüssel - means - + bedeutet - Input error: empty data set! - Eingabefehler: leerer Datensatz! + Eingabefehler: leerer Datensatz! - Stem-and-Leaf Plot Stamm-Blatt-Diagramm - - Stem-and-&Leaf Plot Stamm-&Blatt-Diagramm - F&ormat F&ormat - Alt+C ALT+C - - Zoom &In/Out and Drag Canvas - &Vergrößern/Verkleinern und Arbeitsfläche ziehen + &Vergrößern/Verkleinern und verschieben der Zeichenfläche - Zoom In (Shift++) or Out (-) and Drag Canvas - Vergrößern/Verkleinern (Mausrad) und Arbeitsfläche ziehen + Vergrößern/Verkleinern (Mausrad) und verschieben der Arbeitsfläche - - Fit Slop&e St&eigung anpassen - You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://soft.proindependent.com/download.html">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. - Sie benutzen die Demoversion von QtiPlot. Sie ist mit der Vollversion identisch bis auf die Limitierung, dass Sie keine Projekte speichern können und nicht länger als 10 Minuten pro Sitzung arbeiten können. <br><br> Wenn Sie eine sofort benutzbare, voll funktionstüchtige Version möchten, schließen Sie bitte einen <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a> ab. <br><br> QtiPlot ist freie Software im Sinne von freier Rede. Wenn Sie wissen, wie dieser zur handhaben ist, können Sie den <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">Quellcode</a> kostenlos herunterladen. Trotzdem, erwägen Sie bitte, eine <a href="http://soft.proindependent.com/why_donate.html">Spende</a> abzugeben, um die weitere Entwicklung QtiPlot zu unterstützen. + Sie benutzen die Demoversion von QtiPlot. Sie ist mit der Vollversion identisch bis auf die Limitierung, dass Sie keine Projekte speichern können und nicht länger als 10 Minuten pro Sitzung arbeiten können. <br><br> Wenn Sie eine sofort benutzbare, voll funktionstüchtige Version möchten, schließen Sie bitte einen <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a> ab. <br><br> QtiPlot ist freie Software im Sinne von freier Rede. Wenn Sie wissen, wie dieser zur handhaben ist, können Sie den <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">Quellcode</a> kostenlos herunterladen. Trotzdem, erwägen Sie bitte, eine <a href="http://soft.proindependent.com/why_donate.html">Spende</a> abzugeben, um die weitere Entwicklung QtiPlot zu unterstützen. - &Add &Hinzufügen - - Ctrl+Alt+D Strg+Alt+D - &Waterfall Plot &Wasserfall Diagramm - &Indexed Colors &Nummerierte Farben - Pale&tte Pale&tte - Make a donation - Das Projekt mit einer Spende unterstützen + Das Projekt mit einer Spende unterstützen - Close - Schließen + Schließen - - - Spec&ial Bar/Column - - - - - - Stack &Bar - - - - - - Stack &Column - - - - - Plot stack bar - - - - - Plot stack column - - - - - + Spez&ielle Säulen-/Balkendiagramme + + Move Row Zeile verschieben - Print preview of window: Druckvorschau von Fenster: - - Print Pre&view - Druck&vorschau + Druck&vorschau - - Ad&just Column Width Spaltenbreite an&passen - - &Upward nach &oben - - &Downward nach &unten - Append a project to the current folder Anhängen eines Projekts zum aktuellen Ordner - - Ctrl+Alt+A - - - - Move current row upward Markierte Zeile nach oben verschieben - Move current row downward Markierte Zeile nach unten verschieben - Set optimal column width Optimale Spaltenbreite einstellen - show standalone scripting window - Zeige separates Scriptfenster + Zeige separates Scriptfenster + + + Shared A&xes Panel + Bedienfeld für gemeinsam benutze A&chsen + + + + + + + &Custom Layout... + Benutzerdefinertes &Layout... + + + Execute Selected Lines + Ausgewählte Zeilen ausführen + + + Commen&t Selection + Auswahl als Kommen&tar setzen + + + &Uncomment Selection + Auswahl &nicht als Kommentar setzen + + + Comment Selection + Auswahl als Kommentar setzen + + + Uncomment Selection + Auswahl nicht als Kommentar setzen + + + Ctrl+Shift+O + Strg+Shif+O + + + Ctrl+Shift+U + Strg+Shift+U + + + + + + + Waterfall Plot + Wasserfall-Diagramm + + + &Extract Data... + Daten &extrahieren... + + + S&ubtract + S&ubtrahieren + + + &Straight Line... + &Gerade... + + + &Reference Data... + &Referenzdaten... + + + &Open... + Ö&ffnen... + + + Open Image &File... + Bilddatei ö&ffnen... + + + &Print... + &Drucken... + + + Print Pre&view... + Druck&vorschau... + + + E&xport ASCII... + ASCII-E&xport... ArrowMarker - dx - + dx - dy - + dy - angle - + Winkel - length - + Länge - - eqn - + Gleichung - y - + y - - x - + x AssociationsDialog - QtiPlot - Plot Associations QtiPlot - Darstellungszuordnungen - Spreadsheet: Tabellenblatt: - Column Spalte - X X - Y Y - - xErr xFehler - - yErr yFehler @@ -8823,32 +9904,26 @@ Kurve &aktualieren - &OK &OK - &Cancel - &Abbrechen + Ab&brechen - xEnd xEnde - yEnd yEnde - &Update curves K&urve aktualisieren - Angle Winkel @@ -8862,51 +9937,41 @@ Betrag - Magn. Magnitude, vector length + Betrag, Länge des Vektors Betrag AxesDialog - QtiPlot - General Plot Options QtiPlot - Allgemeine Diagrammoptionen - &Apply &Anwenden - &OK &OK - &Cancel - &Abbrechen + Ab&brechen - - From Von - - To Bis - - Type - Typ + Art linear @@ -8917,111 +9982,88 @@ logarithmisch - Inverted invertiert - Step Schritt - - Major Ticks - Achsenhauptmarken + Hauptteilstriche - - Minor Ticks - Achsennebenmarken + Hilfsteilstriche - Horizontal Horizontal - Vertical Vertikal - Scale - Skala + Skalierung - Probability - + Wahrscheinlichkeit - Logit - + Logit - Major Grids - Hauptgitter + Hauptgitterlinien - Minor Grids - Untergitter + Hilfsgitterlinien - Line Color Linienfarbe - Line Type Linientyp - Thickness Stärke - Additional lines Zusätzliche Linien - X=0 X=0 - Y=0 Y=0 - Grid - Gitter + Gitterlinien - Show Anzeigen - Title Titel - &Font - &Schriftart + Schri&ftart B @@ -9036,54 +10078,42 @@ U - Numeric Numerisch - Text from table Text aus Tabelle - Day of the week Wochentag - Month Monat - Time Zeit - Date Datum - Column Headings Spaltenüberschriften - Font Schriftart - Axis &Font - &Achsenschriftart + Achsenschri&ftart - - - Color Farbe @@ -9092,14 +10122,10 @@ Achsenmarkierungen - - In lnnen - - Out Aussen @@ -9108,62 +10134,46 @@ Beides - - None Keine - Stand-off - Abstand + Achse verschieben um - Show Labels Beschriftungen anzeigen - Table Tabelle - - Format Format - - Precision Genauigkeit - Angle Winkel - For&mula For&mel - - Axis Achse - Canvas frame - Untergrund-Rahmen + Rahmen der Zeichenfläche - - Width Breite @@ -9180,30 +10190,24 @@ Rahmenfarbe - - Axes Achsen - Draw backbones Basislinien zeichnen - Line Width Linienstärke - Major ticks length - Achsen-Hauptmarkenlänge + Länge der Hauptteilstriche - Minor ticks length - Achsen-Nebenmarkenlänge + Länge der Hilfsteilstriche Margin @@ -9214,12 +10218,10 @@ Auf alle Ebenen anwenden - General Allgemein - Automatic Automatisch @@ -9252,12 +10254,10 @@ Bitte geben Sie einen positiven Schrittwert ein! - QtiPlot - Formula input error QtiPlot - Formeleingabefehler - Valid variables are 'x' for Top/Bottom axes and 'y' for Left/Right axes! Gültige Variablen sind 'x' für die obere/untere Achse und 'y' für die linke/rechte Achse! @@ -9266,38 +10266,30 @@ Millisek. - sec. Sek. - min. Min. - hours Stunden - days Tage - weeks Wochen - millisec. Millisek. - - In & Out Innen & Aussen @@ -9306,35 +10298,22 @@ Untergrundfarbe - - - Bottom Unten - - - Left Links - - - Top Oben - - - Right Rechts - Column Spalte @@ -9351,175 +10330,164 @@ Deckkraft - Show Axis &Break - Zeige Achsenlücke + &Zeige Achsenunterbrechung - Draw Break &Decoration - Zeichne Lückenzeichen + Zeichne &Unterbrechungsstriche - Position Position - % of Axis Length % der Achsenlänge - pixels Pixel - &Log10 Scale After Break - &Log10-Skala nach der Lücke + &Log10-Skala nach der Unterbrechung - Step Before Break - Stufe vor der Lücke + Stufe vor der Unterbrechung - - Guess Schätzung - Step After Break - Stufe nach der Lücke + Stufe nach der Unterbrechung - Minor Ticks Before - Achsennebenmarken davor + Hilfsteilstriche davor - Minor Ticks After - Achsennebenmarken danach + Hilfsteilstriche danach - Apply To Anwenden auf - This Layer Diese Ebene - This Window Dieses Fenster - - - All Windows Alle Fenster - An&tialised Kanteng&lättung - + Labels space + Abstand Wert-Teilstrich + + + Show &backbone + Achsen&linie Zeichnen + + Set As &Default Als Stan&dard setzen - Apply &to... - Anwenden auf + Anwen&den auf... - - Layer Ebene - - Window Fenster - Distance to axis Abstand zur Achse - Apply &to - &Anwenden auf + Anwen&den auf - Decimal: 10000.0 Dezimal: 10000.0 - Scientific: 1e4 Wissenschaftlich: 1e4 - Scientific: 1x10^4 - Wissenschaftlich: 10^4 + Wissenschaftlich: 1x10^4 - Engineering: 10k - - - - - + Technisch: 10k + + + Scientific: 1·10^4 + Wissenschaftlich 1·10^4 + + Origin Ursprung - &Inverted - + &Invertiert - Linear - Linear + Linear - Log10 - + Log10 - ln - + ln - Log2 - + Log2 - Reciprocal - + Reziprok + + + Hide Ticks + Teilstriche ausblenden + + + At Axis Begin + Am Achsenanfang + + + At Axis End + Am Achsenende + + + At Axis Begin & End + Am Achsenanfang & -ende @@ -9532,122 +10500,98 @@ ColorBox - black Schwarz - red Rot - green Grün - blue Blau - cyan Cyan - magenta Magenta - yellow Gelb - dark yellow Dunkles Gelb - navy Marinblau - purple Violett - wine Weinrot - olive Olivgrün - dark cyan Dunkles Cyan - white Weiß - light gray Helles Grau - dark gray Dunkles Grau - royal Königsblau - orange Orange - violet Violett - pink Pink - gray Grau - light yellow Hellgelb - light cyan Helles Cyan - light magenta Helles Magenta @@ -9655,35 +10599,29 @@ ColorButton - Custom - Benutzerdefiniert + Benutzerdefiniert ColorMapDialog - QtiPlot QtiPlot - Custom Color Map Benutzerdefinierte Farbtabelle - &Apply &Anwenden - &Close S&chließen - Set Custom Palette Benutzerdefinierte Farbtabelle einstellen @@ -9691,29 +10629,24 @@ ColorMapEditor - Level Niveau - Color Farbe - &Insert E&infügen - &Delete &Löschen - &Scale Colors - Farben &Skalieren + fliesende Farb&übergänge QtiPlot - Input Error @@ -9739,30 +10672,22 @@ ColorMapPreviewDialog - QtiPlot - Color Map Preview Dialog QtiPlot - Dialog der Farbtabellenvorschau - Colormap files Farbtabellendateien - All files Alle Dateien - << &Preview - << Vorschau + << &Vorschau - - - - None Keine @@ -9770,7 +10695,6 @@ ColorPickerPopup - Custom Benutzerdefiniert @@ -9778,30 +10702,22 @@ ConfigDialog - Application Programm - Confirmations Bestätigungen - - Tables Tabellen - - 3D Plots 3D-Diagramme - - 2D Plots 2D-Diagramme @@ -9810,21 +10726,14 @@ 2D-Kurven - - - Colors Farben - - - Fonts Schriftart - Prompt on closing Beim Schließen nachfragen @@ -9833,12 +10742,10 @@ Matrizen - Options Optionen - Frame width Rahmenbreite @@ -9847,8 +10754,6 @@ Legendenrahmen - - None Keine @@ -9869,19 +10774,14 @@ schwärzen - Ticks - Achsenmarkierungen + Teilstriche - - In lnnen - - Out Aussen @@ -9894,7 +10794,6 @@ Achsen-Hauptmarkenlänge - Axes linewidth Achsenlinienbreite @@ -9903,7 +10802,6 @@ Achsen-Nebenmarkenlänge - &Show Legend &Legende anzeigen @@ -9912,7 +10810,6 @@ Auflösung - Lab&els Beschriftung&en @@ -9921,135 +10818,106 @@ Gitter-&Linie - &Grid - &Gitter + &Gitterlinien Data &Min Daten-&Min - - - &Numbers &Zahlen - &Background &Hintergrund - &Title &Titel - &Axes Labels &Achsenbeschriftungen - General Allgemein - - - Style Stil - Choose &font Schri&ftart auswählen - Save every Speichern alle - Default curve style Voreingestellter Kurvenstil - Line Linie - Scatter Punkte - Line + Symbol Linie + Symbol - Vertical drop lines Vertikale Linien - Spline Spline - Vertical steps Vertikale Schritte - Area Fläche - Vertical Bars - Vertikale Balken + Säulendiagramm - Horizontal Bars - Horizontale Balken + Balkendiagramm - Line width Linienbreite - Symbol size Symbolgröße - QtiPlot - Choose default settings QtiPlot - Bitte legen Sie die Voreinstellungen fest - &OK &OK - &Cancel - &Abbrechen + Ab&brechen - &Apply &Anwenden @@ -10062,12 +10930,10 @@ &Beschriftungen - &Text Font &Textschriftart - &Labels Font &Beschriftungsschriftart @@ -10076,17 +10942,14 @@ A&chsenbeschriftung - Axes &Numbers Achsen-&Ziffern - &Legend &Legende - T&itle T&itel @@ -10111,45 +10974,34 @@ &Datenmaximum - A&xes A&chsen - - - Background Hintergrund - Text Text - - Labels Beschriftungen - Margin - Abstand + Ränder - Workspace Arbeitsbereich - Panels Unterfenster: Hintergrund - Panels text Unterfenster: Text @@ -10158,23 +11010,14 @@ Te&xt - Default Column Separator Standard-Spaltentrenner - - - - TAB Tabulator (TAB) - - - - SPACE Leerzeichen (SPACE) @@ -10203,46 +11046,38 @@ , - Do not &resize layers when window size changes Ebenen nicht &reskalieren, wenn sich die Fenstergröße ändert - Axes &backbones Achsen-&Basislinie - Canvas Fra&me - Untergrund-Rah&men + Rah&men der Zeichenfläche Sho&w all axes Alle Achsen an&zeigen - Show &Title &Titel anzeigen - Scale &Fonts Schri&ftarten skalieren - Auto&scaling Automatische &Skalierung - Folders Ordner - &Notes &Notizen @@ -10251,64 +11086,50 @@ S&chließen - Language Sprache - minutes Minuten - (all data shown) (alle Daten angezeigt) - Smoot&h Line &Geglättete Linie - QtiPlot - Import options error QtiPlot - Fehler in den Importoptionen - The separator must not contain the following characters: 0-9eE.+- Der Spaltentrenner darf die folgenden Zeichen nicht enthalten: 0-9eE.+- - Curves Kurven - Check for new versions at startup Beim Starten die Verfügbarkeit einer neuen Version prüfen - - Length Länge - Major Ticks - Achsenhauptmarken + Hauptteilstriche - Minor Ticks - Achsennebenmarken + Hilfsteilstriche - - In & Out Innen & Aussen @@ -10325,83 +11146,66 @@ Achsen automatisch &skalieren - Generated Fit Curve Generierte Fitkurve - Uniform X Function - Uniforme X-Funktion + Uniforme X-Werte - Points - Punkte + Anzahl der Punkte - Same X as Fitting Data Gleiche X-Werte wie Fit-Daten - - Display Peak Curves for Multi-peak Fits Peak-Kurven für Mehrfach-Peak-Fits anzeigen - Peaks Color Peakfarben - Parameters Output Parameterausgabe - Significant Digits Signifikante Dezimalstellen - Write Parameters to Result Log Parameter ins Ergebnislog schreiben - Paste Parameters to Plot Parameter ins Diagramm einfügen - Fitting - Fitten + Kurvenanpassung - Default scripting language Standardskriptsprache - Scale Errors with sqrt(Chi^2/doF) - Skaliere Fehler mit Wurzel(Chi^/doF) + Skaliere Fehler mit Wurzel(Chi^2/doF) - Horizontal steps Horizontale Schritte - O&rthogonal O&rthogonal - The column separator can be customized. The following special codes can be used: \t for a TAB character @@ -10412,648 +11216,635 @@ \s für ein Leerzeichen - The separator must not contain the following characters: 0-9eE.+- Der Spaltentrenner darf die folgenden Zeichen nicht enthalten: 0-9eE.+- - Matrices Matrizen - A&xes Labels A&chsenbeschriftungen - Main Font Hauptschriftart - Antia&liasing Kanteng&lättung - Autosca&ling Automatische Ska&lierung - - - - System Locale Setting Systemeinstellung verwenden - Decimal Separators Dezimaltrennzeichen - Print Drucken - - Grids - + Gitterlinien - - Ma&jor Grids - + &Hauptgitterlinien - - Mi&nor Grids - + &Hilfsgitterlinien - - Color - Farbe - - - + Farbe + + + &Keep aspect ratio + &Seitenverhältnis beibehalten + + + Geometry + Geometrie + + + Ticks - Labels space + Abstand Teilstriche - Beschriftung + + + pixels + Pixel + + Legend display - + Beschriftung der Legenden mittels - Column name - + Spaltenname - Column comment - + Spaltenkommentar - Table name - + Tabellenname - Table legend - - - - + Tabellenkommentar + + + Unit + Einheit + + + inch + Zoll + + + mm + mm + + + cm + cm + + + point + Punkt + + + pixel + Pixel + + + Canvas Width + Breite der Zeichenfläche + + + Canvas Height + Höhe der Zeichenfläche + + Print Crop&marks Schnitt&marken drucken - &Scale layers to paper size &Skaliere Ebenen auf Papiergröße - Prompt on &renaming tables when appending projects - Hinweis anzeigen wenn beim Anhängen von Projekten Tabellen umbenannt werden - - - + Beim Anhängen von P&rojekten auf Umbenennung von Tabellen hinweisen + + + Ask before over&writing files + Vor dem &Überschreiben einer Datei nachfragen + + Numeric Format Zahlenformat - &Backup project before saving Sichern &bevor das Projekt gespeichert wird - Start New Project Ein neues Projekt beginnen - - Empty Leer - Table Tabelle - Matrix Matrix - Empty Graph Leere Grafik - Note Notiz - Number of Decimal Digits Anzahl der Dezimalstellen - + mu&Parser uses C locale settings + mu&Parser verwendet das C Zahlenformat + + &Display Comments in Header Zeige Kommentare in &der Kopfzeile - - Solid - Gefüllt + Gefüllt - - Dash - + Striche - - Dot - Punkt + Punkt - - Dash Dot - + Strich Punkt - - Dash Dot Dot - + Strich Punkt Punkt - - Short Dash - + kurze Striche - - Short Dot - + kurzer Punkt - - Short Dash Dot - + Kurzer Strich Punkt - 2 points for linear fits 2 Punkte für linearen Fit - &Disable in-place editing &Deaktiviere direktes Bearbeiten - File Locations Datei Pfade - Choose the location of the QtiPlot translations folder! Wählen Sie das Verzeichnis der QtiPlot-Übersetzungen aus! - Matrix Undo Stack Size Größe des Matrix-Rückgängig/Wiederherstellen-Moduls - - Translations Übersetzungen - - Help Hilfe - LF (Unix) LF (Unix) - CRLF (Windows) CRLF (Windows) - CR (Mac) CR (Mac) - - Python Configuration Files Python Konfigurationsdateien - Endline character Zeilenabschlusszeichen - Choose the location of the Python configuration files! Wählen Sie das Verzeichnis der Python-Konfigurationsdateien! - Automatically &Recalculate Column Values Automatische Neube&rechnung der Spaltenwerte - - Background Color Hintergrundfarbe - - - - Opacity Deckkraft - - Canvas Color - Untergrundfarbe + Farbe der Zeichenfläche - - Border Color Rahmenfarbe - - - - Width Breite - - Transparent Transparent - &Enable autocompletion (Ctrl+U) Aktivi&ere die Autovervollständigung (Strg+U) - Omit &Thousands Separator &Tausendertrennzeichen auslassen - Clipboard Decimal Separators Zwischenablage Dezimaltrennzeichen - &B &B - &It &lt - Notes Notizen - Tab length (pixels) Tab-Länge (Pixel) - Font Schriftart - &Display line numbers Zeige &die Zeilennummern - Axes title space Abstand der Achsenbeschriftung - &Resolution - Auflösung + Auf&lösung - &Floor style Boden&flächenstil - Isolines Konturlinien - Projection Projektion - &Mesh - Gitter + &Gitter - Syntax Highlighting Syntax hervorheben - Co&mments Ko&mmentare - &Keywords - Schlüsselwörter + &Schlüsselwörter - &Quotations - Anführungszeichen + Anführungs&zeichen - &Functions &Funktionen - Q&t Classes Q&t-Klassen - Default Color Map Standardfarbtabelle - Axes Achsen - Left Links - Right Rechts - Bottom Unten - Top Oben - Enabled axes Aktivierte Achsen - Show Anzeigen - - + Display Confirmation &Messages for Multi-peak Fits + Zeige Bestätigungsnachrichten für die Kurvenanpassung '&multi peak' + + QtiPlot - index.html File Not Found! QtiPlot - index.html nicht gefunden! - There is no file called <b>index.html</b> in folder %1.<br>Please choose another folder! Keine Datei mit dem Namen <b>index.html</b> in Ordner %1 gefunden.<br>Bitte wählen Sie einen anderen Ordner! - - QtiPlot - Folder Not Found! - QtiPlot - Ordner nicht gefunden + QtiPlot - Ordner nicht gefunden! - The folder %1 doesn't exist.<br>Please choose another folder! Der Ordner %1 existiert nicht.<br>Bitte wählen Sie einen anderen Ordner! - %1 is not a folder.<br>Please choose another folder! %1 ist kein Ordner.<br>Bitte wählen Sie einen anderen Ordner! - Choose the location of the QtiPlot help folder! Wählen Sie den QtiPlot Hilfeordner! - There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! Keine Datei mit dem Namen <b>index.html</b> in diesem Ordner gefunden.<br>Bitte wählen Sie einen anderen Ordner! - - QtiPlot QtiPlot - You don't have read access rights to folder %1.<br>Please choose another folder! Sie haben keine Zugriffsrechte auf Ordner %1.<br>Bitte wählen Sie einen anderen Ordner! - - &Internet Connection &Internetverbindung - - &Proxy &Proxyserver - - Host Host - - Port Port - - Username Benutzername - - Password Passwort - LaTeX Compiler LaTeX Kompiler - Choose the location of the LaTeX compiler! Geben Sie den Pfad zum LaTex Kompiler an! - - QtiPlot - File Not Found! QtiPlot - Datei nicht gefunden! - The file %1 doesn't exist.<br>Please choose another file! Die Datei %1 existiert nicht.<br>Bitte wählen Sie eine andere Datei! - %1 is a folder.<br>Please choose a file! %1 ist ein Ordner.<br>Bitte wählen Sie eine Datei aus! - You don't have read access rights to file %1.<br>Please choose another file! Sie haben keine Leserechte für die Datei %1.<br>Bitte wählen Sie eine andere Datei aus! + + New Color + Neue Farbe + + + &Load Default + Standart &Laden + + + Delete Color + Farbe Löschen + + + Move Color Up + Farbe höher schieben + + + Move Color Down + Farbe nach unten schieben + + + Indexed Colors + Farbtabelle + + + Default Symbol + Standart Symol + + + Edge width + Randstärke + + + Fill + Füllung + + + Name + Name + + + Symbol + Symbol + + + Inde&xed Symbols + S&ymboltabelle + + + &Fill Symbol + Symbole &Füllen + + + Move Symbol Up + Symbol nach oben schieben + + + Move Symbol Down + Symbol nach untern schieben + + + Pattern + Muster + + + Line style + Linienart + + + Fill area under curve + Fläche unter der Kurve füllen + + + Default Line Style + Stnadart Linenart + + + Axis title + Achsenbeschriftung + + + Default + Standard + + + Synchronize scale &divisions + &Gleiche Skalenabstände bei doppelten Achsen + ContourLinesEditor - Level Niveau - Pen Stift - &Insert E&infügen - &Delete &Löschen - QtiPlot - Edit pen QtiPlot - Stift bearbeiten - Color Farbe - - - Apply to all Auf alle anwenden - Style Stil - Width Breite - &Ok &OK - &Close S&chließen @@ -11061,56 +11852,38 @@ Convolution - Convolution Faltung - - - - - QtiPlot QtiPlot - - - - - Error Fehler - The signal data set %1 does not exist! Der Signaldatensatz %1 existiert nicht! - The response data set %1 does not exist! Der Antwortdatensatz %1 existiert nicht! - The response dataset '%1' must be less then half the size of the signal dataset '%2'! Der Antwortdatensatz '%1' muss weniger als halb so groß wie der Signaldatensatz '%2' sein! - The response dataset '%1' must contain an odd number of points! Der Antwortdatensatz '%1' muss eine ungerade Anzahl von Punkten enthalten! - Could not allocate memory, operation aborted! Konnte nicht genug Speicher reservieren, Operation abgebrochen! - - Index Index @@ -11122,27 +11895,18 @@ Correlation - Correlation Korrelation - - - QtiPlot QtiPlot - - - Error Fehler - - The data set %1 does not exist! Der Datensatz %1 existiert nicht! @@ -11151,13 +11915,10 @@ Konnte nicht genug Speicher reservieren, Operation abgebrochen! - Error in GSL forward FFT operation! Fehler in GSL vorwärts FFT Operation! - - Lag Lag @@ -11169,101 +11930,81 @@ CreateBinMatrixDialog - - QtiPlot - QtiPlot + QtiPlot - Bin Matrix Dialog - + Dialog für Matrix Konvertierung: 2D Histogramm - &OK - &OK + &OK - &Cancel - + Ab&brechen - X-min - + X-min - X-max - + X-max - Columns - Spalten + Spalten - Y-min - + Y-min - Y-max - + Y-max - Rows - Zeilen + Zeilen - Input Size Error - Fehler bei der Größenangabe + Fehler bei der Größenangabe - The dimensions you have specified are not acceptable! - Die von Ihnen angegebenen Dimensionen sind nicht akzeptabel! + Die von Ihnen angegebenen Dimensionen sind nicht anwendbar! - Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! - Bitte geben Sie einen positiven Wert ein, für den das Produkt Zeilen*Spalten nicht die maximale Ganzzahlgröße Ihres Systems überschreitet! + Bitte geben Sie einen positiven Wert ein, für den das Produkt Zeilen*Spalten nicht die maximale Ganzzahlgröße Ihres Systems überschreitet! CurveRangeDialog - QtiPlot - Plot range QtiPlot - Anzeigebereich - Data set: Datensatz: - From row number Von Zeile Nummer - To row number Bis Zeile Nummer - &OK &OK - &Close S&chließen @@ -11271,67 +12012,54 @@ CurvesDialog - QtiPlot - Add/Remove curves QtiPlot - Kurven Hinzufügen/Entfernen - Line Linie - Scatter Punkte - Line + Symbol Linie + Symbol - Vertical drop lines Vertikale Linien - Spline Spline - Vertical steps Vertikale Schritte - Area Fläche - Vertical Bars - Vertikale Balken + Säulendiagramm - Horizontal Bars - Horizontale Balken + Balkendiagramm - Available data Verfgübare Daten - Graph contents Grafikinhalt - OK OK @@ -11344,17 +12072,14 @@ Diagramm??? - &Plot Associations... &Darstellungszuordnungen... - &Edit Function... Funktion b&earbeiten... - Close Schließen @@ -11363,72 +12088,58 @@ &Löschen - &Plot &Diagramm - Horizontal steps Horizontale Schritte - New curves style Neuer Kurvenstil - &Plot Selection Dia&grammauswahl - &Delete Selection Auswahl &löschen - &Delete Curve Kurve &löschen - Contour - Color Fill Kontur - Farbfüllung - Contour Lines Konturlinien - Gray Scale Map Graustufenoberfläche - Edit &Range... Be&reich ändern... - &Show Range &Bereich anzeigen - Show current &folder only - Zeige nur den aktuellen Ordner + Zeige nur den aktuellen &Ordner - Histogram Histogramm - Histogram Histogramm @@ -11436,156 +12147,110 @@ CustomActionDialog - - - - - - - - - - - QtiPlot QtiPlot - Add Custom Action Benutzerdefinierte Aktion hinzufügen - Folder Ordner - Choose &Folder - Ordner auswählen + &Ordner auswählen - Script File Scriptdatei - Choose &Script &Script wählen - Icon - + Piktogramm - Choose &Icon P&iktogramm auswählen - - Text Text - Tool Tip Text Kurzinfotext - Shortcut Tastenkombination - &Menu &Menü - &Tool Bar Werkzeugleis&te - &Add - Hinzufügen + &Hinzufügen - &Remove Entfe&rnen - &Close S&chließen - - - - - - - Error Fehler - Please provide a description for your custom action! Bitte geben Sie eine Beschreibung für Ihre benutzerdefinierte Aktion ein! - Dot characters are not allowed in the description text! Punkte sind in der Beschreibung nicht erlaubt! - You have already defined an action having description: %1 <br>Please provide a different description text! Es existiert bereits eine Aktion mit der Beschreibung: %1 <br>Bitte geben Sie eine andere Beschreibung ein! - The file you have specified doesn't exist, please choose a valid script file! Die angegebene Datei existiert nicht. Bitte wählen Sie eine gültigte Scriptdatei! - The image file you have specified doesn't exist or can't be read, please choose another file! Die angegebene Bilddatei existiert nicht oder kann nicht gelesen werden. Bitte wählen Sie eine andere Datei! - Please provide a different key sequence! The following shortcut key sequences are already assigned: Bitte geben Sie eine andere Tastenkombination an! Die folgenden Kombinationen sind bereits zugewiesen: - Are you sure you want to remove this action? Sind Sie sicher, dass Sie diese Aktion löschen wollen? - Remove Action Aktion entfernen - - File Save Error Datei Speicherfehler - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Konnte nicht in die Datei <br><h4> %1 </h4> schreiben. <p>Bitte überprüfen Sie Ihre Schreibrechte! @@ -11594,83 +12259,66 @@ Bilder - QtiPlot - Load icon from file - QtiPlot - Lade icon aus Datei + QtiPlot - Lade Piktogramm aus Datei - Choose script file Scriptdatei wählen - Choose the custom actions folder Ordner für benutzerdefinierte Aktionen wählen - &Save &Speichern - &Delete Menu Menü &löschen - Python Script Python-Script - All Files Alle Dateien - Add menu Menü hinzufügen - Menu title: - Menübeschriftung + Menübeschriftung: - Please, choose the location of the new menu Bitte wählen Sie den Ort für das neue Menü aus - Menu: Menü: - Remove Menu Menü entfernen - Are you sure you want to remove menu '%1' and all its actions? Sind Sie sicher, dass Sie das Menü '%1' und alle zugeordneten Aktionen löschen wollen? - &New Menu... - &Neues Menü + &Neues Menü... - - Menu Bar Menüleiste - There's already a menu item with this title, please choose another title! Es existiert bereits ein Menüpunkt mit diesem Namen, bitte wählen Sie einen anderen Namen! @@ -11678,57 +12326,42 @@ DataPickerTool - Click on plot or move cursor to display coordinates! Klicken Sie auf ein Diagramm oder bewegen sie den Cursor, um die Koordinaten anzuzeigen! - Please, click on plot and move cursor! Bitte klicken Sie auf ein Diagramm und bewegen sie den Cursor! - Select point and double click to remove it! Wählen Sie einen Punkt aus entfernen ihn mit einem Doppelklick! - QtiPlot - Remove point error QtiPlot - Fehler beim Punkte entfernen - Sorry, but removing points of a function is not possible. Das Entfernen von Punkten einer Funktion is leider nicht möglich. - QtiPlot - Move point error QtiPlot - Fehler beim Punkte verschieben - Sorry, but moving points of a function is not possible. Das Bewegen von Punkten einer Funktion is leider nicht möglich. - - - - QtiPlot - Warning QtiPlot - Warnung - - This operation cannot be performed on curves plotted from columns having a non-numerical format. Diese Operation kann nicht auf Kurven angewendet werden, die auf Spalten im nicht-numerischem Format basieren. - - The column '%1' is read-only! Please choose another curve! Die Spalte '%1' ist schreibgeschützt! Bitte wählen Sie eine andere Kurve! @@ -11751,7 +12384,6 @@ Deconvolution - Deconvolution Entfaltung @@ -11759,8 +12391,6 @@ Differentiation - - Derivative Ableitung @@ -11773,7 +12403,6 @@ Diagramm - of Derivative of von @@ -11782,7 +12411,6 @@ DrawPointTool - Draw Zeichnen @@ -11790,86 +12418,62 @@ EnrichmentDialog - - - - QtiPlot QtiPlot - Tex Equation Editor Tex Gleichungseditor - Clea&r - Lee&ren + &Leeren - Window Geometry Fenstergeometrie - Object Properties Objekteigenschaften - &Apply &Anwenden - &Close S&chließen - Preview: Vorschau: - - &Text &Text - - Color Farbe - - - Set As &Default Als Stan&dard setzen - &Font Schri&ftart - Auto-&update &Automatisch aktualisieren - - Opacity Deckkraft - - Transparent Transparent @@ -11878,338 +12482,262 @@ Hintergrundfarbe - File Datei - &Save internally Intern &speichern - &Image &Bild - Shape Form - None Keine - Rectangle Rechteck - Shadow Schatten - Line Style Linienstil - - Width Breite - - - All Windows Alle Fenster - TeX &Output - + TeX &Ausgabe - &Frame - Rahmen + &Rahmen - Fill Color Füllfarbe - Pattern Füllmuster - Pattern Color Musterfarbe - Use &Frame Color Benutze &Rahmenfarbe - Fill &Pattern Mit &Muster füllen - Page - + Seite - Layer Scales - + Ebenenskalierung - Attach to - + Anhängen an - inch Zoll - mm mm - cm cm - point Punkt - pixel Pixel - scale Skala - Unit Einheit - Position Position - X X - Y Y - Size Größe - Height Höhe - &Keep aspect ratio &Seitenverhältnis beibehalten - &Best size &Optimale Größe - &Geometry &Geometrie - Network connection error Netzwerkverbindungsfehler - Error while trying to connect to host %1: - Fehler beim Versuch eine Verbindung zum Host '%1' herzustellen. + Fehler beim Versuch eine Verbindung zum Host %1 herzustellen: - Please verify your network connection! Bitte prüfen Sie Ihre Netzwerkverbindung! - QtiPlot - Import image from file QtiPlot - Bild aus Datei importieren - QtiPlot - Warning QtiPlot - Warnung - The file %1 doesn't exist. The image cannot be restored when reloading the project file! Die Datei '%1' existiert nicht. Das Bild kann beim Neuladen der Projektdatei nicht wiederhergestellt werden! - - - Layer Ebene - - - Window Fenster - Background Hintergrund - Rotate (deg.) Rotieren (Grad) - - - Object Objekt - - Apply t&o... - &Anwenden auf... + Anwen&den auf... - Line Linie - Apply format &to... - Wende das Forma&t auf... + Forma&t anwenden auf... - MathTran (http://www.mathtran.org/) - + MathTran (http://www.mathtran.org/) - locally installed Lokal installiert - LaTeX Compiler LaTeX Kompiler - Compile process ended Kompilierung beendet - Compiling process ended with exit code: %1 Kompilierung beendet mit Rückgabewert: %1 - LaTeX compile process Latex Kompilierung - dvipng process - + dvipng Umwandlung - - failed to start! Konnte nicht starten! - Please verify that you have dvipng installed in the same folder as your LaTeX compiler! Bitte stellen Sie sicher, dass Sie dvipng im selben Ordner wie Ihren LaTeX Kompiler installiert haben! - crashed abgestürzt - timedout Zeitüberschreitung - write error Schreibfehler - read error Lesefehler - unknown error unbekannter Fehler - Compile error Kompilierungsfehler - Please set the correct path to the compiler in the preferences dialog! Bitte geben Sie den korrekten Pfad zum LaTex Kompiler im Einstellungsdialog an! @@ -12268,12 +12796,10 @@ ErrDialog - QtiPlot - Error Bars QtiPlot - Fehlerbalken - &X Error Bars &X-Fehlerbalken @@ -12282,18 +12808,14 @@ &OK - Add Error Bars to Fehlerbalken hinzufügen zu - - Source of errors Fehler-Daten - Percent of data (%) Prozent (%) der Daten @@ -12302,12 +12824,10 @@ 5 - Standard Deviation of Data Standardabweichung der Daten - &Y Error Bars &Y-Fehlerbalken @@ -12316,17 +12836,14 @@ &Abbrechen - &Add &Hinzufügen - &Close S&chließen - Existing column Existierende Spalte @@ -12334,7 +12851,6 @@ ExpDecayDialog - QtiPlot - Verify initial guesses QtiPlot - Verifiziere Anfangswerte @@ -12347,7 +12863,6 @@ Dämpfung - First decay time (t1) Erste Zerfallszeit (t1) @@ -12356,22 +12871,18 @@ 1 - Second decay time (t2) Zweite Zerfallszeit (t2) - Third decay time (t3) Dritte Zerfallszeit (t3) - Amplitude Amplitude - Initial time Anfangszeit @@ -12380,7 +12891,6 @@ 0 - Y Offset Y-Verschiebung @@ -12393,42 +12903,34 @@ &Abbrechen - Exponential Fit of Exponentieller Fit von - Growth time Wachstumszeit - &Fit &Fit - Color Farbe - QtiPlot - Warning QtiPlot - Warnung - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! Die Kurve <b> %1 </b> existiert nicht mehr! Operation abgebrochen! - &Close S&chließen - Decay time Abklingzeit @@ -12436,17 +12938,14 @@ ExponentialFit - Exponential growth Exponentielles Wachstum - Exponential decay Exponentielles Abklingen - ExpGrowth ExpWachstum @@ -12455,29 +12954,22 @@ (Offset) - - amplitude Amplitude - lifetime Lebensdauer - - offset Offset - ExpDecay1 - e-folding time @@ -12485,12 +12977,10 @@ ExportDialog - Separator Spaltentrenner - QtiPlot - Export ASCII QtiPlot - als ASCII-Datei exportieren @@ -12511,20 +13001,10 @@ Auswahl exportieren - - - - - TAB Tabulator (TAB) - - - - - SPACE Leerzeichen (SPACE) @@ -12553,28 +13033,22 @@ , - Table Tabelle - Include Column &Names inkl. Spalten&namen - Export &Selection &Auswahl exportieren - &All &Alles - - The column separator can be customized. The following special codes can be used: \t for a TAB character \s for a SPACE @@ -12583,39 +13057,46 @@ \s für ein Leerzeichen (SPACE) - - - The separator must not contain the following characters: 0-9eE.+- Der Spaltentrenner darf die folgenden Zeichen nicht enthalten: 0-9eE.+- - QtiPlot - Help QtiPlot - Hilfe - + QtiPlot + QtiPlot + + + Overwrite file? + Datei überschreiben? + + + %1 already exists. + %1 existiert bereits. + + + Do you want to replace it? + Möchten Sie ersetzen? + + QtiPlot - Export error - QtiPlot - Export-Fehler + QtiPlot - Export-Fehler - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - + Konnte nicht in Datei <br><h4> %1 </h4> schreiben.<p>Bitte überprüfen Sie Ihre Schreibrechte! - &Help &Hilfe - QtiPlot - Import options error QtiPlot - Fehler in den Importoptionen - Include Column Co&mments Spaltenkommentare &einschließen @@ -12623,19 +13104,80 @@ ExtensibleFileDialog - << &Advanced - << Erweitert + << &Erweitert + + + + ExtractDataDialog + + QtiPlot + QtiPlot + + + Extract Data + Daten Extrahieren + + + For row (i) + Von Zeile (i) + + + to + bis + + + Add function + Funktion hinzufügen + + + Add column + Spalte hinzufügen + + + &Apply + &Anwenden + + + Clear &Formulas + &Formeln löschen + + + &Close + S&chließen + + + &Put into table + In &Tabelle schreiben + + + Table + Tabelle + + + Cond&ition: + Bed&ingung: + + + Add &function + &Funktion hinzufügen + + + Add co&lumn + &Spalte hinzufügen + + + Add &operator + &Operator hinzufügen + + + Clea&r + Lee&ren FFT - - - - - FFT FFT @@ -12652,72 +13194,46 @@ Konnte nicht genug Speicher reservieren, Operation abgebrochen! - - Forward Weiter - - - - of von - - - Frequency Frequenz - - Inverse Inverse - - - Time Zeit - - Real Realteil - - Imaginary Imaginärteil - - - - Amplitude Amplitude - - Angle Winkel - Hz Hz - s s @@ -12725,63 +13241,50 @@ FFTDialog - QtiPlot - FFT Options QtiPlot - FFT Optionen - Curve Kurve - Sampling Sampling - Real Realteil - Imaginary Imaginärteil - - Sampling Interval Sampling-Interval - &Normalize Amplitude Amplitude &normieren - &Shift Results Ergebnisse ver&schieben - &Inverse &Invertieren - &Forward &Weiter - &OK &OK - &Close S&chließen @@ -12790,12 +13293,10 @@ QtiPlot - Sampling-Fehler - QtiPlot - Error QtiPlot - Fehler - Please choose a column for the real part of the data! Bitte eine Spalte für den Realteil der Daten auswählen! @@ -12812,42 +13313,34 @@ Amplitude - QtiPlot QtiPlot - The two matrices have different dimensions, the imaginary part will be neglected! Die beiden Matrizen haben unterschiedliche Dimensionen, der Imaginärteil wird vernachlässigt! - RealMatrixFFT RealMatrixFFT - Real part of the FFT transform of Realteil der FFT Transformation von - ImagMatrixFFT ImaginärMatrixFFT - Imaginary part of the FFT transform of Imaginärteil der FFT Transformation von - AmplitudeMatrixFFT AmplitudenmatrixFFT - Amplitudes of the FFT transform of Amplituden der FFT Transformation von @@ -12855,64 +13348,50 @@ FFTFilter - FFT FFT - Filtered Gefiltert - - QtiPlot QtiPlot - - Error Fehler - Unknown filter type. Valid values are: 1 - Low pass, 2 - High Pass, 3 - Band Pass, 4 - Band block. Unbekannter Fit-Typ. Gültige Werte sind: 1 - Tiefpass, 2 - Hochpass, 3 - Bandpass, 4 - Bandsperre. - Please enter different values for the band limits. Bitte unterschiedliche Werte für die Bandgrenzen angeben. - to bis - Hz Hz - Low Pass FFT Filter Tiefpass FFT Filter - High Pass FFT Filter Hochpass FFT Filter - Band Pass FFT Filter Bandpass FFT Filter - Band Block FFT Filter Bandsperre FFT Filter @@ -12920,82 +13399,58 @@ Filter - - - - - - QtiPlot QtiPlot - - - - - Error Fehler - Please assign a curve first! Bitte zuerst eine Kurve zuweisen! - Several data points have the same x value causing divisions by zero, operation aborted! Mehrere Datenpunkte haben den gleichen X-Wert und erzeugen dadurch Divisionen durch Null, Operation abgebrochen! - - You need at least %1 points in order to perform this operation! Sie benötigen mindestens %1 Punkte für diese Operation! - QtiPlot - Filter Error QtiPlot - Filter-Fehler - Please enter a valid curve name! Bitte einen gültigen Kurvennamen eingeben! - QtiPlot - Color Name Error QtiPlot - Farbnamenfehler - The color name '%1' is not valid, a default color (red) will be used instead! Der Farbname '%1' is ungültig, die Standardfarbe (rot) wird stattdessen benutzt! - You didn't specify a valid data set for this operation! Sie haben keinen gültigen Datensatz für diese Operation angegeben! - of von - Plot Diagramm - Memory Allocation Error Fehler bei der Speicherreservierung - Not enough memory, operation aborted! Nicht genug Speicher, Operation abgebrochen! @@ -13003,17 +13458,14 @@ FilterDialog - Filter curve: Kurve filtern: - Frequency cutoff (Hz) Frequenzschwellwert (Hz) - Low Frequency (Hz) Untere Frequenz (Hz) @@ -13022,43 +13474,34 @@ 0 - High Frequency (Hz) Obere Frequenz (Hz) - Add DC Offset DC Verschiebung hinzufügen - Substract DC Offset DC Verschiebung abziehen - - Color Farbe - QtiPlot - Filter options QtiPlot - Filteroptionen - &Filter &Filter - &Close S&chließen - QtiPlot - Frequency input error QtiPlot - Fehler bei der Frequenzeingabe @@ -13071,7 +13514,6 @@ QtiPlot - Fehler bei der oberen Frequenz - Please enter frequency limits that satisfy: Low < High ! Bitte geben Sie einen Frequenzbereich ein, so dass untere < obere ist! @@ -13079,18 +13521,14 @@ FindDialog - QtiPlot QtiPlot - - Find Suchen - Start From Starte von @@ -13099,37 +13537,30 @@ Suche in - &Window Names &Fensternamen - Window &Labels Fenster&beschriftungen - Folder &Names &Ordnernamen - Case &Sensitive Groß-/Klein&schreibung beachten - &Partial Match Allowed Auch &teilweise Übereinstimmungen suchen - &Include Subfolders Unterordner e&inbeziehen - &Find &Suchen @@ -13138,17 +13569,14 @@ &Ausgangsordner neu setzen - &Close S&chließen - Search in Suche in - &Update Start Path Startpfad akt&ualisieren @@ -13156,79 +13584,58 @@ FindReplaceDialog - - - QtiPlot QtiPlot - - Find Suchen - Find and Replace Suche und ersetze - Replace with Ersetze mit - &Match case Übereinsti&mmung - &Whole word Ganzes &Wort - &Next &Nächstes - &Previous - Voriges + &Voriges - &Replace E&rsetze - Replace &all Ersetze &alle - &Close S&chließen - - - Empty Search Field Leeres Suchfeld - - - The search field is empty. Please enter some text and try again. Das Suchfeld ist leer. Bitte Text eingeben und nochmal versuchen. - QtiPlot has finished searching the document. Die Suche ist abgeschlossen. @@ -13236,13 +13643,6 @@ Fit - - - - - - - QtiPlot - Fit Error QtiPlot - Fit-Fehler @@ -13255,7 +13655,6 @@ Bitte einen gültigen Kurvennamen eingeben! - Plot Diagramm @@ -13264,118 +13663,94 @@ Fit des Datensatzes - using function unter Verwendung der Funktion - Weighting Method Gewichtungsmethode - No weighting - Keine Gewichtung + Keine Gewichtung (alle w_i = 1) - Instrumental - Instrumentell + Instrumentell: unter Benutzung der Fehlerbalken (w_i = 1/er_i**2) - using error bars dataset unter Benutzung der Fehlerbalkendaten - Statistical - Statistisch + Statistisch (w_i = 1/y_i) - Arbitrary Dataset - Beliebiger Datensatz + Beliebigen Datensatz als Fehler verwenden (w_i = 1/c_i**2) - Nelder-Mead Simplex Nelder-Mead Simplex - Unscaled Levenberg-Marquardt Unskalierter Levenberg-Marquardt - Scaled Levenberg-Marquardt Skalierter Levenberg-Marquardt - algorithm with tolerance = Algorithmus mit Tolleranz = - From x Von x - to x bis x - - R^2 R^2 - Iterations Iterationen - Status Status - Dataset Datensatz - Function Funktion - The column %1 has less points than the fitted data set. Please choose another column! - + Die Spalte %1 hat weniger Punkte als der Datensatz des Fits. Bitte eine andere Spalte wählen! - Error Fehler - The curve %1 has no associated Y error bars. You cannot use instrumental weighting method. Die Kurve %1 hat keine zugeordneten Y-Fehlerbalken. Sie können deshalb keine intrumentelle Gewichtung benutzen. - Parameter Parameter - Value Wert @@ -13384,17 +13759,14 @@ Sie haben keinen Datensatz für die Fit-Operation ausgewählt. Abbruch! - There are no parameters specified for this fit operation. Operation aborted! Sie haben keine Parameter für die Fit-Operation ausgewählt. Abbruch! - You must specify a valid fit function first. Operation aborted! Sie müssen zuerst eine gültige Fitfunktion angeben. Abbruch! - Fit Fit @@ -13403,10 +13775,6 @@ von - - - - QtiPlot - Error QtiPlot - Fehler @@ -13415,195 +13783,144 @@ Es werden mindestens %1 Punkte für diese Funktion benötigt. Die Ausführung wurde abgebrochen! - The column %1 has less points than the fitted data set. Please choose another column!. - Die Spalte %1 hat weniger Punkte als der Datensatz des Fits. Bitte eine andere Spalte wählen!. + Die Spalte %1 hat weniger Punkte als der Datensatz des Fits. Bitte eine andere Spalte wählen!. - You didn't specify a valid data set for this fit operation. Operation aborted! Sie haben keinen gültigen Datensatz für diesen Fit ausgewählt. Ausführung abgebrochen! - You need at least %1 data points for this fit operation. Operation aborted! Es werden mindestens %1 Datenpunkte für diese Funktion benötigt. Die Ausführung wurde abgebrochen! - graphics display disabled Grafikanzeige deaktiviert - of dataset von Datensatz - You cannot use the instrumental weighting method. Sie können nicht nach Datenfehler-Methode gewichten. - QtiPlot QtiPlot - File Save Error Datei Speicherfehler - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Konnte nicht in die Datei <br><h4> %1 </h4> schreiben. <p>Bitte überprüfen Sie Ihre Schreibrechte! - QtiPlot Fit Model QtiPlot Fitmodell - Cannot read file %1: %2. Kann Datei '%1' nicht lesen: %2. - - - Please perform a fit first! Bitte zuerst einen Fit ausführen! - Residuals of %1 Restwerte von %1 - residue Rest - Adjusted R^2 Angepasstes R^2 - RMSE (Root Mean Squared Error) RMSE (Standardabweichung) - RSS (Residual Sum of Squares) RSS (Summe der quadrierten Restwerte) - FitResiduals FitRestwerte - - FitStats Fitstatistiken - Confidence Limits of %1 Vertrauensbereich von %1 - - Independent Variable Unabhängige Variable - LCL LCL - Lower %1 Confidence Limit Vertrauensbereich unter %1 - UCL UCL - Upper %1 Confidence Limit Vertrauensbereich über %1 - Prediction Limits of %1 Prognosegrenzen von %1 - LPL LPL - Lower %1 Prediction Limit Prognosegrenzwert unter %1 - UPL UPL - Upper %1 Prediction Limit Prognosegrenzwert über %1 - Direct Weighting using Dataset Direkte Gewichtung unter Verwendung des Datensatzes - - - - - - - QtiPlot - Memory Allocation Error QtiPlot - Fehler bei der Speicherreservierung - - Could not allocate enough memory for the fit curves! Konnte nicht genug Speicher für die Fit-Kurven reservieren! - QtiPlot - Memory Allocation Error QtiPlot - Fehler bei der Speicherreservierung - - - - - - Not enough memory! Nicht genug Speicher! @@ -13615,48 +13932,38 @@ Nichtlineare Kurvenanpassung - Curve Kurve - - Function Funktion - Initial guesses Anfangsschätzwerte - From x= Von x= - To x= Bis x= - Iterations Iterationen - Tolerance Toleranz - Algorithm Algorithmus - &Fit &Anpassen @@ -13669,12 +13976,10 @@ Typ: - Scaled Levenberg-Marquardt Skalierter Levenberg-Marquardt - Unscaled Levenberg-Marquardt Unskalierter Levenberg-Marquardt @@ -13683,22 +13988,18 @@ << Funktion b&earbeiten - Category Kategorie - User defined Benutzerdefiniert - Built-in Eingebaut - Basic Grundlegend @@ -13707,29 +14008,22 @@ Ausdruck - Fit with &built-in function Anpassung mit einge&bauter Funktion - Name Name - - &Save &Speichern - - Parameters Parameter - &Remove &Entfernen @@ -13738,7 +14032,6 @@ &Ausdruck hinzufügen - Add &name &Name hinzufügen @@ -13751,22 +14044,14 @@ &Anpassen >> - - - - - QtiPlot - Input function error QtiPlot - Fehler bei der Funktionseingabe - - Please enter a valid function! Bitte geben Sie eine gültige Funktion ein! - Please enter a function name! Bitte geben Sie einen Funktionsnamen an! @@ -13789,17 +14074,14 @@ Benutzer-definierte Funktion - Please verify that you have initialized all the parameters! Bitte berprüfen Sie, ob alle Parameter initialisiert wurden! - QtiPlot - Error: function name QtiPlot - Fehler: Funktionsname - is a built-in function name<p>You must choose another name for your function! QtiPlot-interner Funktionsname<p>Bitte wählen Sie einen anderen Namen für Ihre Funktion! @@ -13808,7 +14090,6 @@ Bitte benutzen Sie exakt ein '=' Symbol! - QtiPlot - Input error QtiPlot - Eingabefehler @@ -13825,7 +14106,6 @@ QtiPlot - Endwertfehler - Please enter x limits that satisfy: from < end! Bitte geben Sie einen X-Bereich ein, so dass Anfang < Ende ist! @@ -13838,42 +14118,34 @@ Toleranzwerte müssen positiv und kleiner 1 sein! - Plugins Plugins - QtiPlot - Warning QtiPlot - Warnung - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! Die Kurve <b> %1 </b> existiert nicht mehr! Operation abgebrochen! - Parameter Parameter - Value Wert - Nelder-Mead Simplex Nelder-Mead Simplex - Color Farbe - &Delete Fit Curves Fit-Kurven &löschen @@ -13882,69 +14154,54 @@ Plugin-Ordner &wählen... - Constant Konstante - Fit with selected &user function Mit ben&utzerdefinierter Funktion fitten - Fit using &built-in function Mit einge&bauter Funktion fitten - Fit using &plugin function Mit &Plugin-Funktion fitten - Choose the plugins folder Bitte Ordner für Plugins wählen - Expression Ausdruck - Add &expression Ausdruck &hinzufügen - Weighting Method - Gewichtete Methode + Gewichtete Methode - No weighting Keine Gewichtung - Instrumental Instrumentell - Statistical Statistisch - Arbitrary Dataset Beliebiger Datensatz - - - &Close S&chließen @@ -13953,13 +14210,10 @@ Benutzerdefinierte &Ausgabe >> - - Polynomial Order Grad des Polynoms - Generated Fit Curve Generierte Fitkurve @@ -13968,7 +14222,6 @@ Uniforme X-Funktion - Points Punkte @@ -13977,12 +14230,10 @@ Gleiche X-Werte wie Fit-Daten - Parameters Output Parameterausgabe - Significant Digits Signifikante Dezimalstellen @@ -13991,8 +14242,6 @@ Parametertabelle - - Name: Name: @@ -14001,7 +14250,6 @@ Kovarianzmatrix - CovMatrix KovMatrix @@ -14018,65 +14266,42 @@ << &Anpassen - &Apply &Anwenden - - - - - - - QtiPlot - Error QtiPlot - Fehler - Please enter a valid name for the parameters table. Bitte geben Sie einen gültigen Namen für die Parametertabelle ein. - - - - - Please perform a fit first and try again. Bitte zuerst einen Fit ausführen und dann neu versuchen. - Error - Fehler + Fehler - Please enter a valid name for the covariance matrix. Bitte geben Sie einen gültigen Namen für die Kovarianzmatrix ein. - - Gauss Gauß - Peaks Peaks - - Lorentz Lorentz - - Polynomial Polynomiell @@ -14093,188 +14318,160 @@ QtiPlot - Nichtlineare Kurvenanpassung - user1 Benutzer1 - Rese&t Zurückse&tzen - &Uniform X Function - &Uniforme X-Funktion + &Uniforme X-Werte - Same X as Fitting &Data Die selben X-Werte wie die Fit-&Daten - Parameters &Table Parameter&tabelle - Covariance &Matrix Kovarianz&matrix - &Write Parameters to Result Log &Ausgabe der Parameter im Ergebnislog - &Paste Parameters to Plot &Parameter im Diagramm anzeigen - - No data tables Keine Datentabellen - QtiPlot - Fit Wizard QtiPlot - Fit-Assistent - &One table for all fits - Eine Tabelle für alle Fits + &Eine Tabelle für alle Fits - &Preview - Vorschau - - - + &Vorschau + + + Data Set + Datensatz + + + Weighting + Gewichtung + + + Re&load + Neu &laden + + + &Guess + &Bestimmen + + + &Range + &Bereich + + From Von - To Bis - - - Select Function - + Funktion auswählen - - - - Fitting Session - + Kurvenanpassung - - - Custom Output - + Benutzerdefinierte Ausgabe - - Choose plug&ins folder... Plug&in-Ordner wählen... - Start Fitting Session - + Kurvenanpassung Starten - You can't define functions recursively! Sie können Funktionen nicht rekursiv definieren! - - QtiPlot fit model QtiPlot Fitmodell - - All files Alle Dateien - - - QtiPlot QtiPlot - - Save Fit Model As Fitmodell speichern als - Are you sure you want to remove fit model file: %1 ? Sind Sie sicher, dass Sie die Fitmodell-Datei '%1' löschen wollen? - Remove Fit Model Fitmodell entfernen - Choose &models folder... - Fit&modell-Ordner wählen + Ordner für Fit&modelle wählen... - Choose the fit models folder Bitte Ordner für Fitmodelle wählen - &Residuals Plot Da&rstellung der Restwerte - Co&nf. Bands Co&nf. Band - Pred. &Bands Pred. &Band - &Scale Errors with sqrt(Chi^2/doF) - &Skaliere Fehler mit sqrt(Chi^2/doF) + &Skaliere Fehler mit Wurzel(Chi^2/doF) - Direct Weighting Direkte Gewichtung - Error: Fehler: @@ -14282,12 +14479,10 @@ Folder - kB kB - bytes Bytes @@ -14295,108 +14490,86 @@ FrequencyCountDialog - QtiPlot - Frequency count QtiPlot - Frequenzzähler - Statistics on %1 Statistiken über %1 - Mean Mittel - Standard Deviation Standardabweichung - Median Mittelwert - Size Größe - From Minimum Von Minimum - To Maximum Bis Maximum - Step Size Schrittgröße - &Apply &Anwenden - &Cancel - Abbre&chen + Ab&brechen - &Ok &OK - QtiPlot - Error QtiPlot - Fehler - Not enough data points, operation aborted! Nicht genügend Datenpunkte, Operation abgebrochen! - QtiPlot - Frequency input error QtiPlot - Fehler bei der Frequenzeingabe - Please enter frequency limits that satisfy: From < To ! Bitte geben Sie Frequenzgrenzen ein, die die Bedingung Anfang < Ende erfüllen! - - Count Zählen - Frequency count of %1 Frequenzzähler: %1 - BinCtr BinCtr - BinEnd BinEnd - Sum Summe @@ -14404,97 +14577,98 @@ FunctionDialog - Clear list - Liste leeren + Liste leeren - Clear Function - Funktion löschen + Funktion löschen - QtiPlot - Add function curve QtiPlot - Funktionskurve hinzufügen - Curve type Kurventyp - + Click here to select a recently typed expression + Anklicken um eine Auswahl der zuletzt verwendeten Funktionen zu erhalten + + + Rece&nt + Zuletzt verwe&ndet + + f(x)= f(x)= - From x= Von x= - To x= Bis x= - - - Points Punkte - - Parameter Parameter - - To Bis - + QtiPlot + QtiPlot + + + Sorry, there are no recent expressions available! + Es gibt keine zuletzt verwendete Funktionen! + + + Recent Functions + Zuletzt verwendete Funktionen + + + Please, choose a function: + Bitte eine Funktion auswählen: + + y = y = - x = x = - - From Von - R = R = - Theta = Theta = - Function Funktion - Parametric plot Parametrisches Diagramm - Polar plot Polarkoordinatendiagramm @@ -14507,71 +14681,50 @@ Ok - - QtiPlot - Start limit error - Qtiplot - Anfangsgrenzenfehler + Qtiplot - Anfangsgrenzenfehler - - QtiPlot - End limit error - QtiPlot - Endgrenzenfehler + QtiPlot - Endgrenzenfehler - - - QtiPlot - Input error QtiPlot - Eingabefehler - Please enter x limits that satisfy: from < end! Bitte geben Sie einen X-Bereich ein, so dass Anfang < Ende ist! - - - - - QtiPlot - Input function error QtiPlot - Fehler bei der Funktionseingabe - - Please enter parameter limits that satisfy: from < end! Bitte geben Sie einen Parameterbereich an, so dass Anfang < Ende ist! - Clea&r Function - Funktion löschen + Funktion &löschen - &Ok &OK - &Close S&chließen - Constant Konstant - Value Wert - &Add Function Funktion &hinzufügen @@ -14674,32 +14827,26 @@ (Breite) - GaussAmp GaussAmp - GaussAmp Fit GaussAmp Fit - offset Offset - amplitude Amplitude - center Mitte - width Breite @@ -14707,7 +14854,6 @@ GaussFit - Gauss Gauß @@ -14728,27 +14874,22 @@ (Offset) - Gauss Fit Gauß-Fit - area Fläche - center Mitte - width Breite - offset Offset @@ -15155,7 +15296,6 @@ QtiPlot - Export-Fehler - QtiPlot - File open error QtiPlot - Fehler beim Öffnen der Datei @@ -15168,9 +15308,6 @@ QtiPlot - Pixelauswahl-Warnung - - - QtiPlot - Warning QtiPlot - Warnung @@ -15199,22 +15336,18 @@ Peak %1 ausgewählt! Bewegen Sie den Cursor, wählen Sie durch einen Klick einen Punkt aus und bestätigen Sie durch einen Doppelklick oder 'Enter' den nächsten Peak! - The columns Die Spalten - are empty and will not be added to the plot! sind leer und werden nicht zum Diagramm hinzugefügt! - The column Die Spalte - is empty and will not be added to the plot! ist leer und wird nicht zum Diagramm hinzugefügt! @@ -15223,26 +15356,18 @@ &Ausschneiden - - &Copy &Kopieren - - &Delete &Löschen - - - &Properties... &Eigenschaften... - &Rescale to show all Auf Komplettansicht &reskalierenskalieren @@ -15251,17 +15376,14 @@ Ctrl+R - &Hide axis Achse &verbergen - &Show grids Gitter &anzeigen - &Scale... &Skala... @@ -15484,22 +15606,14 @@ Band FFT Filter von - There are no curves available on this plot! In diesem Diagramm existieren keine Kurven! - - - - - - QtiPlot - Error QtiPlot - Fehler - There are no curves with more than two points on this plot. Operation aborted! Es gibt keine Kurven mit mehr als 2 Punkten in diesem Diagramm. Operation abgebrochen! @@ -15528,7 +15642,6 @@ Boltzmann (Sigmoidal) Fit von - Ctrl+Shift+R Ctrl+Shift+R @@ -15585,12 +15698,10 @@ QtiPlot - Title Titel - Image file: <p><b> %1 </b><p>does not exist anymore! Die Bilddatei: <p><b> %1 </b><p> existiert nicht mehr! @@ -15639,61 +15750,46 @@ Mittelungsglättung von - - Please provide a valid file name! Bitte einen gültigen Dateinamen eingeben! - F F - Data set generated from curve Aus der Kurve generierter Datensatz - Table - Tabelle + Tabelle - File format not handled, operation aborted! Dateiformat konnte nicht verarbeitet werden, Operation abgebrochen! - - Couldn't change the axis type to the requested format! Konnte den Achsentyp nicht in das gewünschte Format ändern! - Y Axis Title Y-Achsenbeschriftung - X Axis Title X-Achsenbeschriftung - layer - + Ebene - - Cu&t - Ausschneiden + Ausschnei&den - - C&lear Daten &löschen @@ -15733,17 +15829,14 @@ QtiPlot - X axis X-Achse - Y axis Y-Achse - Z axis Z-Achse @@ -15752,20 +15845,14 @@ Konnte nicht drucken: <h4> - - - QtiPlot - Error QtiPlot - Fehler - - Please provide a valid file name! Bitte einen gültigen Dateinamen eingeben! - File format not handled, operation aborted! Dateiformat konnte nicht verarbeitet werden, Vorgang abgebrochen! @@ -15828,7 +15915,6 @@ ImageExportDialog - QtiPlot - Choose a filename to save under Dateiname zum Speichern auswählen @@ -15841,7 +15927,6 @@ Bildformat - Image quality Bildqualität @@ -15858,7 +15943,6 @@ &Abbrechen - Resolution (DPI) Auflösung (DPI) @@ -15867,127 +15951,126 @@ &Exportiere in Farbe - Save transparency Transparenz speichern - Native fonts Eingebettete Schriftarten - LaTeX file LaTeX-Datei - Export 3D texts as Exportiere 3D-Texte als - Export in &color - - - - - &Escape special characters in title/axis labels - - - - + in &Farbe exportieren + + Export &font sizes - + Schrift&größen exportieren - Bitmap images Bitmap-Dateien - 3D Sort mode 3D-Sortiermodus - No sort Keine Sortierung - Simple sort Einfache Sortierung - BSP sort BSP-Sortierung - inch Zoll - mm mm - cm cm - point Punkt - pixel Pixel - Unit Einheit - Width Breite - Height Höhe - &Keep aspect ratio - &Seitenverhältnis beibehalten - - - + &Seitenverhältnis beibehalten + + + QtiPlot + QtiPlot + + + Overwrite file? + Datei überschreiben? + + + %1 already exists. + %1 existiert bereits. + + + Do you want to replace it? + Möchten Sie ersetzen? + + + QtiPlot - Export error + QtiPlot - Export-Fehler + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + Öffnen der Datei: <br><h4> %1 </h4><p> nicht möglich. Bitte überprüfen Sie, ob sie Schreibrechte für diesen Pfad besitzen! + + Custom print size Benutzerdefinierte Druckgröße - + &Escape special characters in texts + &Sonderzeichen in Texten auslassen + + Scale Fonts Factor - Schriftskalierungsfaktor + Skalierungsfaktor für Texte - Automatic Automatisch - Print Resolution (DPI) Druckauflösung (DPI) @@ -16020,20 +16103,35 @@ + ImageProfilesTool + + Position + Position + + + x + X + + + y + Y + + + Z-Value + Z Wert + + + ImageWidget - - QtiPlot - File openning error QtiPlot - Fehler beim Öffnen der Datei - The file: <b>%1</b> doesn't exist! Die Datei <b>%1</b> existiert nicht! - You don't have the permission to open this file: <b>%1</b> Sie haben nicht die Rechte um die Datei <b>%1</b> zu öffnen. @@ -16041,75 +16139,58 @@ ImportASCIIDialog - QtiPlot - Import ASCII File(s) QtiPlot - Importiere ASCII-Datei(en) - All files Alle Dateien - Text files Textdateien - Data files Datendateien - Comma Separated Values Kommagetrennte Werte - Import each file as: Jede Datei importieren als: - - New Table Neue Tabelle - + New Matrix + Neue Matrix + + New Columns Neue Spalten - New Rows Neue Zeilen - Separator: Spaltentrennzeichen: - - - - - TAB Tabulator (TAB) - - - - SPACE Leerzeichen (SPACE) - The column separator can be customized. The following special codes can be used: \t for a TAB character @@ -16120,24 +16201,20 @@ \s für ein Leerzeichen - The separator must not contain the following characters: 0-9eE.+- Folgenden Zeichen dürfen nicht als Spaltentrennzeichen verwendet werden: 0-9eE.+- - Ignore first Ignoriere erste - lines Zeilen - Ignore lines starting with Ignoriere Zeilen beginnend mit @@ -16146,17 +16223,14 @@ Spalten entsprechend dem &Eintrag in der ersten Zeile benennen - Use second row as &comments - Benutze zweite Zeile für Kommentare + Benutze zweite Zeile als &Kommentare - &Remove white spaces from line ends - Entfe&rne Leerzeichen von den Zeilenenden + Leerzeichen an &Zeilenenden entfernen - By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. @@ -16166,17 +16240,14 @@ -enden in der ASCII-Datei entfernt. - Warning: checking this option leads to column overlaping if the columns in the ASCII file don't have the same number of rows. Warnung: die Aktivierung dieser Option könnte -zum Überlappen von Spalten führen, wenn +zum Versatz von Spalten führen, wenn die Spalten unterschiedlich viele Zeilen aufweisen. - - To avoid this problem you should precisely define the column separator using TAB and SPACE characters. @@ -16186,12 +16257,10 @@ Tabulatoren und Leerzeichen definieren. - &Simplify white spaces - Ignoriere Leerzeichen + &Ignoriere Leerzeichen - By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal @@ -16199,42 +16268,36 @@ be replaced with a single space. when translating this check the what's this functions and tool tips to place the '\n's correctly Aktivieren dieser Option führt zum Entfernen -aller Leerzeichen vom Anfand und Ende der Zeilen, -sowie Ersetzen aller Leerzeichensequenzen +aller Leerzeichen vom Anfang und Ende der Zeilen, +sowie zum Ersetzen aller Leerzeichensequenzen (inclusive Tabulatoren) durch ein einzelnes Leerzeichen. - Warning: checking this option leads to column overlaping if the columns in the ASCII file don't have the same number of rows. when translating this check the what's this functions and tool tips to place the '\n's correctly Warnung: die Aktivierung dieser Option könnte -zum Überlappen von Spalten führen, wenn -die Spalten in der ASCII-Datei unterschiedlich viele Zeilen aufweisen. +zum Versatz von Spalten führen, wenn die Spalten +in der ASCII-Datei unterschiedlich viele Zeilen aufweisen. - Decimal Separators Dezimaltrennzeichen - System Locale Setting Systemeinstellung verwenden - Import as &read-only - Sch&reibgeschützt importieren + &Schreibgeschützt importieren - &Help &Hilfe - The column separator can be customized. The following special codes can be used: \t for a TAB character \s for a SPACE @@ -16243,47 +16306,38 @@ \s für ein Leerzeichen - The separator must not contain the following characters: 0-9eE.+- Folgenden Zeichen dürfen nicht als Spaltentrennzeichen verwendet werden: 0-9eE.+- - Remove white spaces from line ends Leerzeichen von den Zeilenenden entfernen - By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. Aktivieren dieser Option führt zum Entfernen aller Leerzeichen am Anfang und Ende der Zeilen in der ASCII-Datei. - Simplify white spaces Ignoriere Leerzeichen - By checking this option each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. Aktivieren dieser Option führt zum Entfernen von Leerzeichensequenzen (inclusive Tabulatoren) zwischen den Spalten durch ein einzelnes Leerzeichen. - By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. Aktivieren dieser Option führt zum Entfernen aller Leerzeichen am Anfang und Ende der Zeilen in der ASCII-Datei, alle Leerzezichensequenzen (inclusive Tabulatoren) zwischen den Spalten werden durch ein einzelnes Leerzeichen ersetzt. - Warning: using these two last options leads to column overlaping if the columns in the ASCII file don't have the same number of rows. Warnung: Diese Option führt zu überlappenden Spalten, falls die Spalten in der ASCII-Datei nicht die gleiche Zeilenzahl aufweisen. - To avoid this problem you should precisely define the column separator using TAB and SPACE characters. Um dieses Problem zu vermeiden, sollten Sie als Spaltentrennzeichen Tabulatoren und Leerzeichen verwenden. - QtiPlot - Help QtiPlot - Hilfe @@ -16292,7 +16346,6 @@ Linien - All Alle @@ -16305,68 +16358,54 @@ Fehler - &Preview Lines - Vorschau Zeilen + &Vorschau von n Zeilen - - New Matrice Neue Matrix - Overwrite Current Window Überschreibe aktuelles Fenster - Use first row &as - + Verwende &erste Zeile als - Column Names - + Spaltenname - Column Comments - + Spaltenkommentar - Endline character Zeilenendzeichen - LF (Unix) LF (Unix) - CRLF (Windows) CRLF (Windows) - CR (Mac) CR (Mac) - QtiPlot - File openning error QtiPlot - Fehler beim Öffnen der Datei - You don't have the permission to open this file: <b>%1</b> Sie haben nicht ausreichend Rechte um die Datei <b>%1</b> zu öffnen - Omit &thousands separator &Tausendertrennzeichen auslassen @@ -16659,7 +16698,6 @@ IntDialog - QtiPlot - Integration Options QtiPlot - Integrationsoptionen @@ -16676,17 +16714,14 @@ Anzahl der Iterationen (Max=40) - Tolerance Toleranz - Lower limit Untere Grenze - Upper limit Obere Grenze @@ -16699,12 +16734,10 @@ &Abbrechen - &Integrate &Integrieren - &Close S&chließen @@ -16833,22 +16866,18 @@ Sie können die Kruve nicht integrieren: - Function Funktion - Variable Variable - Order (1 - 5, 1 = Trapezoidal Rule) Ordnung (1-5, 1 = Trapez-Regel) - Number of iterations (Max=20) Anzahl der Iterationen (Max=20) @@ -16857,16 +16886,13 @@ Diagrammfläche - &Plot area - Diagrammfläche + &Diagrammfläche Integration - - Integration Integration @@ -16875,23 +16901,18 @@ Diagramm - - Numerical integration of Numerische Integration von - using a %1 order method mit einer Methode %1. Ordnung - Iterations Iterationen - Tolerance Toleranz @@ -16900,58 +16921,46 @@ Max - Points Punkte - from von - - to bis - Peak at Peak bei - Area Fläche - QtiPlot - Error QtiPlot - Fehler - Unknown integration method. Valid values must be in the range: 1 (Trapezoidal Method) to 5. Unbekannte Integrationsmethode. Gültige Werte müssen im Bereich 1 (Trapezoidalmethode) bis 5 liegen. - Plot Diagramm - QtiPlot - Input error QtiPlot - Eingabefehler - From Von - using the Trapezoidal Rule benutze die Trapez-Regel @@ -16959,78 +16968,46 @@ Interpolation - - QtiPlot QtiPlot - - Error Fehler - Unknown interpolation method. Valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. Unbekannte Interpolationsmethode. Gültige Werte sind: 0 - linear, 1 - kubisch, 2 - Akima. - - - - Linear Linear - - - - - - Int Int - - - - - - Interpolation Interpolation - - - - Cubic Kubisch - - - - Akima Akima - QtiPlot - Error QtiPlot - Fehler - You need at least %1 points in order to perform this operation! Sie benötigen mindestens %1 Punkte für diese Operation! - Unknown interpolation method, valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. Unbekannte Interpolationsmethode. Gültige Werte sind: 0 - linear, 1 - kubisch, 2 - Akima. @@ -17038,27 +17015,22 @@ InterpolationDialog - QtiPlot - Interpolation Options Qtiplot - Interpolationsoptionen - Make curve from Kurve erzeugen aus - Spline Spline - Points Punkte - From Xmin Von X-Min @@ -17067,19 +17039,16 @@ 0 - To Xmax bis X-Max - Color Farbe - &Make - &Anwenden + A&nwenden &OK @@ -17090,17 +17059,14 @@ &Abbrechen - Linear Linear - Cubic Kubisch - Non-rounded Akima ungerundete Akima @@ -17113,27 +17079,22 @@ QtiPlot - Endwertfehler - QtiPlot - Input error QtiPlot - Eingabefehler - Please enter x limits that satisfy: from < to! Bitte geben Sie einen X-Bereich ein, so dass Anfang < Ende ist! - &Close S&chließen - QtiPlot - Warning QtiPlot - Warnung - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! Die Kurve <b> %1 </b> existiert nicht mehr! Operation abgebrochen! @@ -17149,40 +17110,33 @@ LayerButton - Activate layer - + Aktive Ebene LayerDialog - Grid Gitter - Columns Spalten - Rows Zeilen - Spacing Abstand - Columns gap Spaltenabstand - Rows gap Zeilenabstand @@ -17199,33 +17153,26 @@ QtiPlot - Bildgeometrie - &Apply &Anwenden - &OK &OK - - &Cancel - &Abbrechen + Ab&brechen - Automatic &layout Automatisches &Layout - QtiPlot - Columns input error QtiPlot - Spalteneingabefehler - QtiPlot - Rows input error QtiPlot - Zeileneingabefehler @@ -17238,90 +17185,94 @@ Ausrichtung - Horizontal Horizontal - - Center Mitte - Left Links - Right Rechts - Vertical Vertikal - Top Oben - Bottom Unten - &Layer Canvas Size - Ebenen-&Untergrundgröße - - - + Größe der Ebenen &Zeichenfläche + + + Unit + Einheit + + + inch + Zoll + + + mm + mm + + + cm + cm + + + point + Punkt + + + pixel + Pixel + + Width Breite - - - - - - - - + &Keep aspect ratio + &Seitenverhältnis beibehalten + + pixels Pixel - Height Höhe - Left margin Linker Rand - Right margin Rechter Rand - Top margin Oberer Rand - Bottom margin Unterer Rand - QtiPlot - Arrange Layers QtiPlot - Ebenen anordnen @@ -17342,32 +17293,26 @@ Legenden - QtiPlot - Delete Layers? QtiPlot - Ebenen löschen? - You are about to delete %1 existing layers. Sie sind im Begriff, %1 Ebenen zu löschen. - Are you sure you want to continue this operation? Sind Sie sicher, dass sie fortfahren wollen? - &Continue &Weiter - The number of columns you've entered is greater than the number of graphs (%1)! Die Anzahl der Spalten, die Sie angegeben haben, ist größer als die Anzahl der Graphen (%1)! - The number of rows you've entered is greater than the number of graphs (%1)! Die Anzahl der Zeilen, die Sie angegeben haben, ist größer als die Anzahl der Graphen (%1)! @@ -17380,60 +17325,73 @@ Achsennummerierung - Layers Ebenen - Number Zahl - Alignment Ausrichtung - + Margins + Ränder + + Swap Layers Ebenen tauschen - Source Layer Quellebene - Destination Layer Zielebene - &Swap &Tauschen - QtiPlot - Error QtiPlot - Fehler - Please enter different indexes for the source and destination layers! Bitte geben Sie unterschiedliche Indizes für die Quell- und Zielebene an! + + Link &X axes + &X-Achse verknüpfen + + + &Fixed size + &feste Größe + + + Align + Anordnen der + + + Canvases + Zeichenflächen + + + Co&mmon axes + ge&meinsame Achse + LineDialog - QtiPlot - Line options QtiPlot - Linienoptionen - Color Farbe @@ -17466,12 +17424,10 @@ 5 - Arrow at &start Pfeil am &Anfang - Arrow at &end Pfeil am &Ende @@ -17480,74 +17436,58 @@ Opti&onen - Length Länge - Angle Winkel - &Filled &Gefüllt - Arrow &Head Pfeil&spitze - Page - + Seite - Layer Scales - + Ebenenskalierung - Attach to - + Anhängen an - Start Point Startpunkt - - X X - - Y Y - End Point Endpunkt - &Geometry &Geometrie - &Ok &OK - &Apply &Anwenden @@ -17564,22 +17504,18 @@ Pixel - Unit Einheit - Pixels Pixel - Scale Coordinates Skalenkoordinaten - Set &Default Stan&dardwert setzen @@ -17588,17 +17524,14 @@ Bis - Type Typ - Width Breite - &Line &Linie @@ -17606,43 +17539,42 @@ LineProfileTool - - QtiPlot - Pixel selection warning QtiPlot - Pixelauswahl-Warnung - Please select an image marker first. Bitte zuerst einen Bildmarker auswählen. - Please select the end line point inside the image rectangle! Bitte einen Linienendpunkt im Bildrechteck wählen! - pixel Pixel - intensity Intensität - + x + X + + + y + Y + + Table - Tabelle + Tabelle - pixels Pixel - pixel intensity (a.u.) Pixelintensität (a.u.) @@ -17650,22 +17582,18 @@ LinearFit - Linear Regression Lineare Regression - Linear Linear - QtiPlot - Fit Error QtiPlot - Fit-Fehler - You need at least %1 data points for this fit operation. Operation aborted! Es werden mindestens %1 Datenpunkte für diese Funktion benötigt. Die Ausführung wurde abgebrochen! @@ -17673,22 +17601,18 @@ LinearSlopeFit - Linear Regression Lineare Regression - LinearSlope Steigung - QtiPlot - Fit Error QtiPlot - Fit-Fehler - You need at least %1 data points for this fit operation. Operation aborted! Es werden mindestens %1 Datenpunkte für diese Funktion benötigt. Vorgang abgebrochen! @@ -17696,7 +17620,6 @@ LogisticFit - Logistic logistisch @@ -17713,27 +17636,22 @@ (Mitte) - Logistic Fit - init value Anfangswert - final value Endwert - center Mitte - power @@ -17741,7 +17659,6 @@ LorentzFit - Lorentz Lorentz @@ -17762,27 +17679,22 @@ (Offset) - Lorentz Fit Lorentz-Fit - area Fläche - center Mitte - width Breite - offset Offset @@ -17802,21 +17714,14 @@ Abbrechen - - - - - QtiPlot - Error QtiPlot - Fehler - Calculation failed, the matrix is not square! Berechnung nicht möglich, da keine quadratische Matrix vorliegt! - Inversion failed, the matrix is not square! Invertierung fehlgeschlagen, da keine quadratische Matrix vorliegt! @@ -17831,17 +17736,10 @@ Wollen Sie trotzdem die Zellen einfügen? - - - - - - QtiPlot QtiPlot - Ctrl+A Matrix: select all Ctrl+A @@ -17863,105 +17761,82 @@ Wollen sie Zellen einfügen? - - Please provide a valid file name! Bitte einen gültigen Dateinamen eingeben! - File format not handled, operation aborted! Dateiformat konnte nicht verarbeitet werden. Vorgang abgebrochen! - QtiPlot - ASCII Export Error QtiPlot - ASCII-Export-Fehler - Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! Konnte nicht in die Datei <br><h4> %1 </h4> <p> schreiben. Bitte überprüfen Sie Ihre Schreibrechte! - Invert Invertieren - Transpose Transponieren - Flip Vertically Vertikal drehen - Flip Horizontally Horizontal drehen - Rotate 90° Um 90° drehen - - Calculate Values Werte berechnen - Clear Selection Auswahl aufheben - Paste Einfügen - Delete Rows Zeilen löschen - Delete Columns Spalten löschen - Insert Row Zeile einfügen - Insert Column Spalte einfügen - - Import Image Bild importieren - Forward FFT Vorwärts FFT - Inverse FFT Inverse FFT - Import ASCII File ASCII-Datei importieren @@ -17970,51 +17845,34 @@ Fehler - - - - - Memory Allocation Error Speicherreservierungsfehler - - - - - Not enough memory, operation aborted! Nicht genug Speicher. Vorgang abgebrochen! - Rotate -90° Um -90° drehen - Due to memory limitations it will not be possible to undo this change. Do you want to continue anyways? Aufgrund von Speicherbeschränkungen kann diese Änderung nicht rückgängig gemacht werden. Möchten Sie trotzdem fortfahren? - Warning Warnung - Set Dimensions Dimensionen festlegen - - Set Data Mode Setze den Datenmodus - kB kB @@ -18022,82 +17880,66 @@ MatrixDialog - Cell Width Zellenbreite - Data Format Datenformat - Numeric Display Numerische Anzeige - QtiPlot - Matrix Properties QtiPlot - Matrixeigenschaften - &OK &OK - &Cancel - &Abbrechen + Ab&brechen - &Apply &Anwenden - Decimal: 1000 Dezimal: 1000 - Scientific: 1E3 Wissenschaftlich: 1E3 - Default Decimal Digits Vorgabe Dezimalstellen - Significant Digits= Signifikante Ziffern= - Set Columns Width Spaltenbreite setzen - Decimal Dezimal - Scientific Wissenschaftlich - Set Data Format %1 Datenformat %1 setzen - Precision %1 digits Genauigkeit %1 Dezimalstellen @@ -18105,52 +17947,38 @@ MatrixModel - Edited cell Bearbeitete Zelle - - - - QtiPlot QtiPlot - - Memory Allocation Error Speicherreservierungsfehler - - Not enough memory, operation aborted! Nicht genug Speicher. Vorgang abgebrochen! - Input Size Error Fehler bei der Größenangabe - The dimensions you have specified are not acceptable! Die von Ihnen angegebenen Dimensionen sind nicht akzeptabel! - Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! Bitte geben Sie einen positiven Wert ein, für den das Produkt Zeilen*Spalten nicht die maximale Ganzzahlgröße Ihres Systems überschreitet! - Multiline expressions take much more time to evaluate! Do you want to continue anyways? Mehrzeilige Ausdrücke benötigen viel mehr Zeit zur Auswertung! Möchten Sie trotzdem fortfahren? - Warning Warnung @@ -18158,57 +17986,46 @@ MatrixSizeDialog - Rows Zeilen - Columns Spalten - QtiPlot - Matrix Dimensions QtiPlot - Dimensionen der Matrix - &OK &OK - &Cancel - &Abbrechen + Ab&brechen - Dimensions Dimensionen - Coordinates Koordinaten - X (Columns) X (Spalten) - Y (Rows) Y (Zeilen) - First Erste - Last Letzte @@ -18217,12 +18034,10 @@ QtiPlot - Eingabefehler - Set Coordinates x[%1 : %2], y[%3 : %4] Setze Koordinaten x[%1 : %2], y[%3 : %4] - &Apply &Anwenden @@ -18230,25 +18045,20 @@ MatrixValuesDialog - QtiPlot - Set Matrix Values QtiPlot - Setze Matrix-Werte - For row (i) - Für Zeile (i) + Von Zeile (i) - - to bis - For col (j) - Für Spalte (j) + Von Spalte (j) Add function @@ -18259,7 +18069,6 @@ Zelle hinzufügen - Cell(i,j)= Zelle(i,j)= @@ -18288,32 +18097,26 @@ Der Spalten- und Zeilen-Index muss größer 0 sein! - Add &Function &Funktion hinzufügen - Add Ce&ll Ze&lle hinzufügen - &Apply &Anwenden - &Close S&chließen - Set New Formula Neue Formel setzen - Use built-in muParser (much faster) Benutze eingebauten muParser (viel schneller) @@ -18321,47 +18124,38 @@ MdiSubWindow - QtiPlot QtiPlot - Do you want to hide or delete Möchten Sie ausblenden oder löschen - Delete Löschen - Hide Ausblenden - Cancel Abbrechen - Normal Normal - Minimized Minimiert - Maximized Maximiert - Hidden Ausgeblendet @@ -18370,7 +18164,6 @@ kB - B B @@ -18386,24 +18179,20 @@ QtiPlot - Koordinatenursprung für neue Ebene automatisch ermitteln? - Do you want QtiPlot to rearrange the remaining layers? Soll QtiPlot die übrigen Ebenen neu ausrichten? - &Yes &Ja - &No &Nein - &Cancel - &Abbrechen + Ab&brechen QtiPlot - Error: arranging layers failed! @@ -18434,101 +18223,78 @@ Geben Sie hier Ihren Text ein - Add layer - + Ebene hinzufügen - Remove active layer - + aktive Ebene entfernen - QtiPlot - Guess best layout? QtiPlot - Bestes Layout automatisch bestimmen? - - - QtiPlot - Error QtiPlot - Fehler - - Please provide a valid file name! Bitte einen gültigen Dateinamen eingeben! - File format not handled, operation aborted! Dateiformat konnte nicht verarbeitet werden, Operation abgebrochen! - kB kB - Offset Amount... Größe der Verschiebung... - Reverse Order Reihenfolge vertauschen - Fill Area... - Fläche füllen + Fläche füllen... - Offset Dialog Verschiebungdialog - Total Y Offset (%) Gesamte Y Verschiebung (%) - Total X Offset (%) Gesamte X Verschiebung (%) - &Apply &Anwenden - - &Close S&chließen - Fill Curves Kurven füllen - Enable Fill Füllen aktivieren - Fill with Color Mit Farbe füllen - Side Lines Seitenlinien @@ -18540,106 +18306,78 @@ Mehrere Peaks - Gauss Gauß - Lorentz Lorentz - multi-peak Mehrere Peaks - - - Peak Peak - QtiPlot - Fit Error QtiPlot - Fit-Fehler - Could not allocate enough memory for the fit curves! Konnte nicht genug Speicher für Fit-Kurven reservieren! - - - Fit Fit - fit of Fit von - - peak Peak - Area Fläche - Center Mitte - Width Breite - Height Höhe - Gauss Fit Gauß-Fit - Lorentz Fit Lorentz-Fit - - center Mitte - - width Breite - - offset Offset - - area Fläche @@ -18647,12 +18385,10 @@ MultiPeakFitTool - Move cursor and click to select a point and double-click/press 'Enter' to set the position of a peak! Wählen Sie einen Punkt durch einen Klick, ein Doppelklick (oder die Eingabetaste) legt die Position des Peaks fest! - Peak %1 selected! Click to select a point and double-click/press 'Enter' to set the position of the next peak! Peak %1 ausgewählt! Bewegen Sie den Cursor, wählen Sie durch einen Klick einen Punkt aus und bestätigen Sie durch einen Doppelklick oder der Eingabetaste den nächsten Peak! @@ -18934,7 +18670,6 @@ NonLinearFit - NonLinear Nichtlinear @@ -18943,40 +18678,34 @@ Nichtlinear - - QtiPlot - Input function error QtiPlot - Fehler bei der Funktionseingabe - Please enter a valid non-empty expression! Operation aborted! Bitte einen gültigen, nichtleern Ausdruck eingeben! Abbruch! - - QtiPlot - Fit Error QtiPlot - Fit-Fehler - There are no parameters specified for this fit operation. Please define a list of parameters first! Es wurden keine Parameter für diese Fit-Operation ausgewählt. Bitte zuerst eine Liste von Parameters angeben! - You must provide a list containing at least one parameter for this type of fit. Operation aborted! Sie müssen mindestens einen Parameter für diesen Typ von Fit angeben. Abbruch! - + Ignore + Ignorieren + + Non-linear Fit Nichtlinearer Fit - - constant Konstante @@ -18984,85 +18713,77 @@ Note - Add tab - + Tabulator hinzufügen - Please, enter new title: - + Bitte neuen Titel eingeben: - Title - Titel + Titel - untitled - + nicht benannt OpenProjectDialog - QtiPlot - Open Project QtiPlot - Projekt öffnen - QtiPlot project QtiPlot Projekt - Compressed QtiPlot project Komprimiertes QtiPlot-Projekt - Origin project Origin-Projekt - Origin matrix Origin-Matrix - Origin worksheet Origin-Arbeitsblatt - Origin graph Origin-Grafik - Backup files Backup-Dateien - + Excel + Excel-Datei + + + ODF Spreadsheet + ODF Kalkulationstabelle + + All files Alle Dateien - Open As Öffnen als - New Project Window Neues Projektfenster - New Folder Neuer Ordner @@ -19070,77 +18791,62 @@ PatternBox - Solid Gefüllt - Horizontal Horizontal - Vertical Vertikal - Cross Kreuz - BDiagonal BDiagonal - FDiagonal FDiagonal - DiagCross Diagonales Kreuz - Dense1 Dicht1 - Dense2 Dicht2 - Dense3 Dicht3 - Dense4 Dicht4 - Dense5 Dicht5 - Dense6 Dicht6 - Dense7 Dicht7 - None Keine @@ -19330,114 +19036,102 @@ Plot3DDialog - QtiPlot - Surface Plot Options QtiPLot - Oberflächendigramm-Optionen - &Worksheet - Arbeitsblatt + Arbeitsbla&tt - &Apply &Anwenden - &OK &OK - &Cancel - &Abbrechen - - - - + Ab&brechen + + + Scale to paper si&ze + An &Papiergröße anpassen + + + Print Crop&marks + Schnitt&marken drucken + + + &Print + &Drucken + + X X - - Y Y - - Z Z - From Von - To Bis - Type - Typ + Art - linear Linear - logarithmic Logarithmisch - Major Ticks - Achsenhauptmarken + Hauptteilstriche MinorTicks Achsennebenmarken - &Scale &Skala - Title Titel - Axis Font Achsenschriftart - &Choose font &Schriftart auswählen - Major Ticks Length - Hauptmarkenlänge + Länge der Hauptteilstriche - Minor Ticks Length - Nebenmarkenlänge + Länge der Hilfsteilstriche - &Axis &Achse @@ -19446,12 +19140,10 @@ &Farbe - &Font &Schriftart - &Title &Titel @@ -19468,22 +19160,18 @@ &Min - General Allgemein - &Line &Linie - &Background &Hintergrund - Coordinate System Koordinatensystem @@ -19492,12 +19180,10 @@ &Achsen - Lab&els Beschriftung&en - &Numbers &Zahlen @@ -19506,191 +19192,142 @@ &Gitter - Opacity Deckkraft - &Colors &Farben - - Line Width Linienstärke - Resolution Auflösung - Numbers Font Zahlenschriftart - &Choose Font &Schriftart auswählen - Distance labels - axis Abstand Beschriftung - Achse - Zoom (%) Zoom (%) - X Zoom (%) X Zoom (%) - Y Zoom (%) Y Zoom (%) - Z Zoom (%) Z Zoom (%) - &General All&gemein - Ma&jor Grids - + Ha&uptlinien - Mi&nor Grids - + H&ilfslinien - Color - Farbe + Farbe - - Style Stil - - Solid - Gefüllt + Gefüllt - - Dash - + Striche - - - Dot Punkt - - Dash Dot - + Strich Punkt - - Dash Dot Dot - + Strich Punkt Punkt - - Short Dash - + kurze Striche - - Short Dot - + kurzer Punkt - - Short Dash Dot - + Kurzer Strich Punkt - G&rid - + Gitte&rlinien - Cross Hair Fadenkreuz - Cone Kegel - - - - Width Breite - Smooth angles Kanten abrunden - Radius Radius - Smooth line Geglättete Linie - Boxed Eingerahmt - Quality Qualität - Points Punkte - Bars Balken @@ -19719,62 +19356,77 @@ Farbtabellendateien - Minor Ticks - Achsennebenmarken + Hilfsteilstriche - Show Legend Legende anzeigen - Orthogonal Orthogonal - Co&lor - Farbe + &Farbe - A&xes - Achsen + A&chsen - &Matrix &Matrix - Linea&r color map - Lineare Farbtabelle + Linea&re Farbtabelle - Color map &file &Farbtabellendatei - - - None Keine - Draw lines Zeichne Linien - Filled bars Gefüllte Balken + + Tick Labels + Teilstrichbeschriftung + + + Format + Format + + + Automatic + Automatisch + + + Decimal: 10000.0 + Dezimal: 10000.0 + + + Scientific: 1e4 + Wissenschaftlich: 1e4 + + + Engineering: 10k + Technisch: 10k + + + Precision + Genauigkeit + PlotDialog @@ -19783,131 +19435,86 @@ QtiPlot - selbstangepasstes Diagramm - Plot type Diagrammtyp - - - - Line Linie - Scatter Punkte - Line + Symbol Linie + Symbol - Vertical Bars - Vertikale Balken + Säulendiagramm - Horizontal Bars - Horizontale Balken + Balkendiagramm - Histogram Histogramm - Vector XYXY Vektor XYXY - - - Error Bars Fehlerbalken - - - &Plot Associations... &Darstellungszuordnungen... - &Worksheet &Arbeitsblatt - &Apply &Anwenden - &OK &OK - &Cancel - &Abbrechen + Ab&brechen QtiPlot - Error QtiPlot - Fehler - Connect Verbinden - - - - - Style Stil - - - - - Width Breite - - - - - - Color Farbe - Fill color Füllfarbe - - - - - - Pattern Muster @@ -19916,43 +19523,30 @@ Stiftfarbe - - Fill Color Füllfarbe - - - Size Größe - - - - Symbol Symbol - Direction Richtung - Plus Plus - Minus Minus - &X Error Bar &X-Fehlerbalken @@ -19961,8 +19555,6 @@ F&arbe - - Line Width Linienstärke @@ -19987,124 +19579,94 @@ 5 - Cap Width Kappenbreite - 8 8 - 10 10 - 12 12 - 16 16 - 20 20 - Through Symbol Durch die Symbole - Automatic Binning Automatische Einteilung - &Show statistics &Statistik anzeigen - Bin Size Intervallbreite - Begin Anfang - End Ende - - Histogram Data Histogrammdaten - Gap Between Bars (in %) Balkenabstand (in %) - - Spacing Abstand - Arrowheads Pfeilspitzen - Length Länge - - Angle Winkel - &Filled &Gefüllt - - End Point Endpunkt - - X End X-Ende - - Y End Y-Ende - - Vector Vektor @@ -20117,17 +19679,14 @@ Funktion b&earbeiten... - No line Keine Linie - Lines Linien - Sticks Vertikale Linien @@ -20136,412 +19695,298 @@ Stufen - Dots Punkte - Spline Spline - Fill area under curve Fläche unter der Kurve füllen - - Edge Color Umrandungsfarbe - - Edge Width Dicke der Umrandung - - Box Box - - Type Typ - No Box Keine - Rectangle Rechteck - Diamond Raute - Perc 10, 25, 75, 90 Proz 10, 25, 75, 90 - Notch Mit Einkerbung - - Range Bereich - - - Standard Deviation Standardabweichung - - Standard Error Standardfehler - Perc 25, 75 Proz 25, 75 - Perc 10, 90 Proz 10, 90 - Perc 5, 95 Proz 5, 95 - Perc 1, 99 Proz 1, 99 - - Max-Min Max-Min - - Constant Konstant - - Percentile (%) Perzentil (%) - Coef Koeffizient - Box Width Boxgröße - &Speed Mode, Skip Points if needed - + Be&schleunigungsmodus, Datanpunkte auslassen wenn nötig - data points - + Datenpunkten - Apply to curves with more than: - - - - - Tolerance (Douglas Peuker algorithm) - - - - - - + Anwenden auf Kurven mit mehr als: + + Speed - + Beschleunigung - - - Apply Format &to - + Anwen&den auf - - - Selected Curve - + ausgewählten Graph - - Skip Points - + Zwischenpunkte auslassen - - None - Keine + Keine - Whiskers Whiskers - No Whiskers Keine Whiskers - 75-25 75-25 - 90-10 90-10 - 95-5 95-5 - 99-1 99-1 - - Box/Whiskers Box/Whiskers - Max Max - 99% 99% - - Mean Mittelwert - 1% 1% - Min Min - - Percentile Perzentil - Offset (in %) Verschiebung (in %) - Position Position - Tail Hinten - Middle Mitte - Head Kopf - &Delete &Löschen - - &Edit... - B&earbeiten... + B&earbeiten... - Vector XYAM Vektor XYAM - - - - QtiPlot - Input error QtiPlot - Eingabefehler - Please enter a valid start limit! Bitte einen gültigen Startwert eingeben! - Please enter a valid end limit! Bitte einen gültigen Endwert eingeben! - Please enter a valid bin size value! Bitte eine gültige Intervallbreite eingeben! - Please enter limits that satisfy: begin < end! Bitte Grenzen eingeben, so dass Anfang < Ende! - - QtiPlot - Bin size input error QtiPlot - Fehler bei der Intervallgröße - Please enter a positive bin size value! Bitte eine positive Intervallgröße eingeben! - Vector Data Vektordaten - Magnitude Betrag - Attach curve to: Kurve verbinden mit: - x Axis X-Achse - - Bottom Unten - - Top Oben - y Axis Y-Achse - - - Left Links - - - Right Rechts - - Axes Achsen - Horizontal Steps Horizontale Schritte - Vertical Steps Vertikale Schritte - - Image Farbbild - &Gray Scale &Graustufen @@ -20554,235 +19999,178 @@ &Benutzerdefinierte Farben - - Contour Lines Konturlinien - Levels - Niveaus + # Niveaus - Use &Color Map Farb&karte benutzen - Use Default &Pen - &Standardstift benutzen + &einheitliche Kontourlienen - Color Bar Scale Farblegende - Axis Achse - Contour Kontur - - Colors Farben - Coefficient Koeffizient - &Default Color Map Stan&dardfarbtabelle - &Custom Color Map &Benutzerdefinierte Farbtabelle - + &Function + &Funktion + + QtiPlot - Start limit error Qtiplot - Startwertfehler - QtiPlot - End limit error QtiPlot - Endwertfehler - - - Bins Einteilungen - - Histogram and Probabilities for Histogramm und Wahrscheinlichkeiten für - Quantity Anzahl - Sum Summe - Percent Prozent - Minimum Minimum - Maximum Maximum - QtiPlot - Plot details QtiPlot - Diagrammdetails - Titles Titel - Axes Labels Achsenbeschriftungen - Axes Numbers Achsennummerierung - Legends - Beschriftungen + Legende - - Fonts Schriftarten - Background Color Hintergrundfarbe - - Opacity Deckkraft - - Transparent Transparent - Canvas Color - Untergrundfarbe + Farbe der Zeichenfläche - Border Color - Randfarbe + Rahmenfarbe - Margin Rand - Antialiasing Kantenglättung - - - - - - - - - Layer Ebene - Origin Ursprung - X= X= - Y= Y= - width= Breite= - height= Höhe= - Keep aspect ratio Seitenverhältnis beibehalten - - - Geometry Geometrie - Border Rahmen - First color Erste Farbe @@ -20791,298 +20179,258 @@ Tortenradius - Fill Füllung - Pie Tortengrafik - &Scale layers to paper size &Skaliere die Ebenen auf Papiergröße - Print Crop&marks Schnitt&marken drucken - - Print Drucken - &Show - &Anzeigen + An&zeigen - Column Spalte - White O&ut Weiß aus&füllen - Justify - justieren + Ausrichtung - Center Zentrieren - &Font - &Schriftart + Schri&ftart - Rotate (deg) Rotieren (Grad) - X Offset (font height %) X Offset (% der Schrifthöhe) - Y Offset (font height %) Y Offset (% von Schrifthöhe) - - - - - Labels - Beschriftungen + Zahlenwerte - 3D View 3D-Ansicht - View Angle (deg) Sichtwinkel (Grad) - Thickness (% of radius) Dicke (% vom Radius) - Rotation Rotation - Starting Azimuth (deg) Startazimuth (Grad) - Radius/Center Radius/Mitte - Radius (% of frame) Radius (% des Rahmens) - Horizontal Offset (% of frame) Horizontaler Offset (% des Rahmens) - - Pie Geometry Geometrie der Tortengrafik - Automatic &Format Auto&format - &Values - Werte + &Werte - &Percentages &Prozentwerte - Categories/&Rows Katego&rien/Zeilen - Associate Position with &Wedge - Position der Ecke zuordnen + Position der &Ecke zuordnen - Dist. from Pie Edge Abstand von der Ecke der Tortengrafik - Counter cloc&kwise - Zähle im Uhrzeigersinn + Zähle &im Uhrzeigersinn - inch Zoll - mm mm - cm cm - point Punkt - pixel Pixel - Unit Einheit - Apply &to... - Anwenden auf... + Anwen&den auf... - - - - Window - Fenster + gesamte Grafik - - - - All Windows - Alle Fenster + alle Grafiken - Set As &Default Als Stan&dard setzen - Pen - Stift + Stil und Farben der Konturlinien - Matrix Matrix - Use matrix formula to calculate values Benutze Matrix-Formel für Neuberechnung der Werte - - Values Werte - &Show Contour Lines - Konturlinien &anzeigen + Konturlinien an&zeigen - Set Equidistant Levels - Äquidistanzkurven einstellen + äquidistante Niveaus setzen - Start - Start + Startwert - Step - Schritt + Schrittweite - Set &Levels - Setze &Stufen + Setze &Nivaus - Use &Table Custom Pen - + benutzerspezifisch definierbar + (&Tabelle s.o.) + + + Link &X axes + &X-Achsen verknüpfen + + + Miscellaneous + Sonstiges + + + 0 (all data points) + 0 (alle Datenpunkte) + + + Tolerance (Douglas-Peucker algorithm) + Toleranz (Douglas-Peucker-Algorithmus) + + + Scale &Fonts + Schri&ftarten skalieren + + + Do not &resize layers when window size changes + Ebenen nicht &reskalieren, wenn sich die Fenstergröße ändert + + + Dimensions + Größe PlotWizard - QtiPlot - Select Columns to Plot QtiPlot - Spalten zum plotten auswählen - Worksheet Arbeitsblatt - &New curve &Neue Kurve - &Delete curve Kurve &löschen - &Plot &Diagramm @@ -21099,22 +20447,6 @@ Mehrfache Definitionen des gleichen Diagramms werden ignoriert! - - - - - - - - - - - - - - - - QtiPlot - Error QtiPlot - Fehler @@ -21123,10 +20455,6 @@ Sie haben bereits eine X-Spalte ausgewählt! - - - - You must define a X column first! Sie müssen zuerst eine X-Spalte auswählen! @@ -21135,9 +20463,6 @@ Sie haben bereits eine Y-Spalte ausgewählt! - - - This kind of curve is not handled by QtiPlot! Diese Art Kurve kann vonQtiPlot nicht verarbeitet werden! @@ -21146,8 +20471,6 @@ Sie haben bereits eine Z-Spalte ausgewählt! - - You must define a Y column first! Sie müssen zuerst eine Y-Spalte auswählen! @@ -21156,63 +20479,50 @@ Sie haben bereits eine Spalte für Fehlerbalken ausgewählt! - You must add a new curve first! Sie müssen erst eine neue Kurve hinzufügen! - &X &X - x&Err X-&Fehler - &Y &Y - yE&rr Y-Fehle&r - &Z &Z - &Close S&chließen - You have already defined a X column! Sie haben bereits eine X-Spalte ausgewählt! - You have already defined a Y column! Sie haben bereits eine Y-Spalte ausgewählt! - You have already defined a Z column! Sie haben bereits eine Z-Spalte ausgewählt! - - You have already defined an error-bars column! Sie haben bereits eine Spalte für Fehlerbalken ausgewählt! - Please define a Y column for the following curve Bitte geben Sie eine Y-Spalte für die folgende Kurve an @@ -21224,37 +20534,26 @@ Plugin - QtiPlot - File not found QtiPlot - Datei nicht gefunden - Plugin file: <p><b> %1 </b> <p>not found. Operation aborted! Plugindatei <p><b> %1 </b> <p>nicht gefunden. Operation abgebrochen! - - - - QtiPlot - Plugin Error QtiPlot - Plugin-Fehler - The plugin does not implement a %1 method necessary for simplex fitting. Dieses Plugin implementiert keine %1 Methode, die für Simplex-Fits benötigt wird. - - - The plugin does not implement a %1 method necessary for Levenberg-Marquardt fitting. Dieses Plugin implementiert keine %1 Methode, die für Levenberg-Marquardt-Fits benötigt wird. - Plugin Fit Plugin-Fit @@ -21262,27 +20561,22 @@ PolynomFitDialog - QtiPlot - Polynomial Fit Options QtiPlot - Polynom-Fit Optionen - Polynomial Fit of Polynom-Fit an - Order (1 - 9, 1 = linear) Grad (1 - 9, 1 = linear) - Fit curve # pts Anzahl der Punkte der Fitkurve - Fit curve Xmin Fitkurve min. X @@ -21291,17 +20585,14 @@ 0 - Fit curve Xmax Fitkurve max. X - Show Formula on Graph? Formel im Diagramm zeigen? - &Fit &Fitten @@ -21314,27 +20605,22 @@ &Abbrechen - Color Farbe - &Close S&chließen - Not enough points Nicht genügend Punkte - QtiPlot - Warning QtiPlot - Warnung - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! Die Kurve <b> %1 </b> existiert nicht mehr! Operation abgebrochen! @@ -21358,424 +20644,485 @@ Polynom - Polynomial Polynom - QtiPlot - Fit Error QtiPlot - Fit-Fehler - You need at least %1 data points for this fit operation. Operation aborted! Es werden mindestens %1 Datenpunkte für diese Funktion benötigt. Die Ausführung wurde abgebrochen! - Polynomial Fit Polynom-Fit + PreviewTable + + Numeric + Numerisch + + + Text + Text + + + Date + Datum + + + Time + Zeit + + + Month + Monat + + + Day + Tag + + + Choose column type + Spaltentyp wählen + + + Column type: + Spaltentyp: + + + PythonScripting - Failed to export QtiPlot API Exportieren des QtiPlot APIs gescheitert - Accessing QtiPlot functions or objects from Python code won't work. Probably your version of Qt/SIP/PyQt differs from the one QtiPlot was compiled against. Der Zugriff auf QtiPlot-Funktionen oder Objekte aus Python-Code funktioniert nicht. Wahrscheinlich unterscheidet sich Ihre Version von QT/SIP/PyQt von der Version mit der QtiPlot erstellt wurde. + + Couldn't find initialization files + Initialisierungsfile konnte nicht gefunden werden + + + Please indicate the correct path to the Python configuration files in the preferences dialog. + Bitte geben Sie den korrekten Pfad für die Python Konfigurationsdatei in den Einstellungen an. + QObject - The file is not an QtiPlot fit model file. Die Datei ist keine QtiPlot-Fitmodelldatei. - The file is not an QtiPlot fit model version 1.0 file. Die Datei keineQtiPlot-Fitmodelldatei Version 1.0. - The file is not a QtiPlot custom action file. Die Datei ist keine benutzerdifinierte QtiPlot-Aktionsdatei. - The file is not an QtiPlot custom action version 1.0 file. Die Datei ist keine benutzerdifinierte QtiPlot-Aktiondatei Version 1.0. - The file is not a QtiPlot custom menu file. Es existiert keine QtiPlot-Benutzerdefinierte-Menü-Datei. - The file is not a QtiPlot custom menu version 1.0 file. Dies ist keine QtiPlot Benutzerdefiniertes-Menü Version 1.0 Datei. - QtiPlot - Script Error QtiPlot -Scriptfehler - Python-like syntax is not supported in this case since it severely reduces drawing speed! Python-ähnlicher Syntax wird hier nicht unterstütz da es die Darstellungsgeschwindigkeit stark beeinträchtigt! - abs(x): Absolute value of x. - abs(x): -Betrag von x. + abs(x): + Betrag von x. - acos(x): Inverse cos function. - acos(x): -Inverse Kosinus-Funktion. + acos(x): + Areakosinus. - acosh(x): Hyperbolic inverse cos function. - acosh(x): -Inverse Kosinus Hyperbolikus-Funktion. + acosh(x): + Areakosinus Hyperbolicus. - asin(x): Inverse sin function. - asin(x): -Inverse Sinus-Funktion. + asin(x): + Areasinus. - asinh(x): Hyperbolic inverse sin function. - asinh(x): -Inverse Sinus-Hyperbolikus-Funktion. + asinh(x): + Areasinus Hyperbolicus. - atan(x): Inverse tan function. - atan(x): -Inverse Tangens-Funktion. + atan(x): + Areatangens. - atanh(x): Hyperbolic inverse tan function. - + atanh(x): + Areatangens Hyperbolicus. - avg(x,y,...): Mean value of all arguments. - + avg(x,y,...) + Mittelwert aller Elemente. - bessel_j0(x): Regular cylindrical Bessel function of zeroth order, J_0(x). - + bessel_j0(x): + Bessel Funktion erster Gattung, nullter Ordnung: J_0(x). - bessel_j1(x): Regular cylindrical Bessel function of first order, J_1(x). - + bessel_j1(x): + Bessel Funktion erster Gattung, erste Ordnung: J_1(x). - bessel_jn(double x, int n): Regular cylindrical Bessel function of order n, J_n(x). - + bessel_j0(double, int n): + Bessel Funktion erster Gattung, n-ter Ordnung: J_n(x). - bessel_jn_zero(double n, unsigned int s): s-th positive zero x_s of regular cylindrical Bessel function of order n, J_n(x_s)=0 - + bessel_jn_zero(double n, unsigned int s): + s-te positive Nullstelle x_s der Bessel Funktion erster Gattung, n-ter Ordnung: J_n(x_s)=0 - bessel_y0(x): Irregular cylindrical Bessel function of zeroth order, Y_0(x), for x>0. - + bessel_y0(x): + Bessel Funktion zweiter Gattung, nullter Ordnung: Y_0(x), für x>0. - bessel_y1(x): Irregular cylindrical Bessel function of first order, Y_1(x), for x>0. - + bessel_y1(x): + Bessel Funktion zweiter Gattung, erster Ordnung: Y_1(x), für x>0. - bessel_yn(double x, int n): Irregular cylindrical Bessel function of order n, Y_n(x), for x>0. - + bessel_yn(double x, int n): + Bessel Funktion zweiter Gattung, n-ter Ordnung: Y_n(x). - beta(a,b): Computes the Beta Function, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) for a > 0, b > 0. - + beta(a,b): + Berechnet die Eulersche Betafunktion: B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) für a > 0, b > 0. - ceil(x): Round to the next larger integer, smallest integer larger or equal to x. - + ceil(x): + Rundet auf zum next größeren Integer, + kleinster Iinteger, welcher größer-gleich x ist. - cos(x): Calculate cosine. - + cos(x) + Kosinus. - cosh(x): Hyperbolic cos function. - + cosh(x): + Kosinus Hyperbolicus. - erf(x): The error function. - + erf(x): + Gaußsche Fehlerfunktion. - erfc(x): Complementary error function erfc(x) = 1 - erf(x). - + erfc(x): + Komplementäre (bzw. konjugierte) Fehlerfunktion: erfc(x) = 1 - erf(x). - erfz(x): The Gaussian probability density function Z(x). - + Z(x) = (1/\sqrt{2\pi}) \exp(-x^2/2). + erfz(x) + Wahrscheinlichkeitsdichtefunktion der Gauß- / Normal-Verteilung: Z(x). - erfq(x): The upper tail of the Gaussian probability function Q(x). - + Q(x) = (1/\sqrt{2\pi}) \int_x^\infty dt \exp(-t^2/2) + erfq(x): + Das Integral von x bis Unentlich über die Gaußsche Wahrscheinlichkeitsverteilung: Q(x) = 1 -gauss_cdf(x,1). - exp(x): Exponential function: e raised to the power of x. - + exp(x): + Exponentialfunktion: e^x. - floor(x): Round to the next smaller integer, largest integer smaller or equal to x. - + floor(x): + Rundet zum nächst kleineren Integer, + größter Integer, der kleiner-gleich x ist. - gamma(x): Computes the Gamma function, subject to x not being a negative integer. - + \Gamma(x) = \int_0^\infty dt t^{x-1} \exp(-t) + gamma(x): + Gammafunktion mit der Bedingung dass x kein negativer Integer und nicht Null ist. - gammaln(x): Computes the logarithm of the Gamma function, subject to x not a being negative integer. For x<0, log(|Gamma(x)|) is returned. - + gammaln(x): + Logarithmische Gammafunktion. Für x<0 wird log(|Gamma(x)|) berechnet. - gauss_cdf(x, sigma): Computes the cumulative distribution function for a Gaussian distribution with standard deviation sigma. - + gauss_cdf(x, sigma): + Wert der kumulativen Verteilungsfunktion am Ort x für die Gauß- / Normal-Verteilng mit Standartabweichung sigma. - gauss_pdf(x, sigma): Computes the probability density at x for a Gaussian distribution with standard deviation sigma. - + gauss_pdf(x, sigma): + Wert der Dichtefunktion für den Wert x für die Gauß- / Normal-Verteilng mit Standartabweichung sigma. - hazard(x): Computes the hazard function for the normal distribution h(x) = erfz(x)/erfq(x). - + http://de.wikipedia.org/wiki/Hazardfunktion + hazard(x): + Hazardfunktion for the normal distribution h(x) = erfz(x)/erfq(x) = pdf / ( 1 - gauss_cdf(x,1) ). - if(e1, e2, e3): if e1 then e2 else e3. - + if(e1, e2, e3): + wenn e1 dann e2 sonst e3. - inv_gauss_cdf(x, sigma): Computes the inverse of the cumulative distribution function for a Gaussian distribution with standard deviation sigma. - + http://de.wikipedia.org/wiki/Quantil + inv_gauss_cdf(x, sigma): + Quantil = inverse der kummulativen Verteilungsfunktion für die Gauß- / Normal-Verteilng mit der Standardabweichung sigma. - ln(x): Calculate natural logarithm log_e. - + ln(x): + Natürlicher Logarithmus log_e. - log(x): Calculate decimal logarithm log_10. - + log(x): + Zehnerlogarithmus log_10. - log10(x): Calculate decimal logarithm log_10. - + log10(x): + Zehnerlogarithmus log_10. - log2(x): Calculate binary logarithm log_2. - + log2(x): + Zweierlogarithmus log_2. - min(x,y,...): Calculate minimum of all arguments. - + min(x,y,...): + Minumum aller Elemente. - max(x,y,...): Calculate maximum of all arguments. - + max(x,y,...): + Maximum aller Elemente. - mod(x,y): Calculate rest of integer division x/y, x modulo y. - + mod(x,y): + Ganzzahliger Rest der Division zweier Intergerzahlen x/y, + x modulo y. - pow(x,y): Raise x to the power of y, x^y. - + pow(x,y): + x hoch y,oder x^y, oder x**y. - rint(x): Round to nearest integer. - + rint(x) + Rundet zur nächstgelegenen Integerzahl. - sign(x): Sign function: -1 if x<0; 1 if x>0. - + sign(x): + Vorzeichen von x: -1 für x<0; 1 für x>0. - sin(x): Calculate sine. - + sin(x): + Sinus von x. - sinh(x): Hyperbolic sin function. - + sinh(x): + Sinus Hyperbolicus. - sqrt(x): Square root function. - + sqrt(x): + Wurzel von x. - sum(x,y,...): Calculate sum of all arguments. - + sum(x,y,...) + Summe aller Elemente. - tan(x): Calculate tangent function. - + tan(x): + Tangens. - tanh(x): Hyperbolic tan function. - + tanh(x): + Tagens Hyperbolicus. - ttable(x, n): Student's t-distribution with n degrees of freedom. - + ttable(x, n): + Student-t-Verteilung mit n Freiheitsgraden. - w0(x): Compute the principal branch of Lambert's W function, W_0(x). W is defined as a solution to the equation W(x)*exp(W(x))=x. For x<0, there are two real-valued branches; this function computes the one where W>-1 for x<0 (also see wm1(x)). - + w0(x): + Oberer Ast der Lambert-W-Funktion (Omegafunktion), W_0(x). + W ist definiert als Lösung der Gleichung W(x)*exp(W(x))=x. + Für x<0, gibt es zwei reellwertige Lösungen; diese Funktion berechnet diejenige mit: W>-1 for x<0 (vergleiche wm1(x)). - wm1(x): Compute the secondary branch of Lambert's W function, W_{-1}(x). W is defined as a solution to the equation W(x)*exp(W(x))=x. For x<0, there are two real-valued branches; this function computes the one where W<-1 for x<0. (also see w0(x)). - - - - + wm1(x): + Unterer Ast der Lambert-W-Funktion (Omegafunktion), W_{-1}(x). + W ist definiert als Lösung der Gleichung W(x)*exp(W(x))=x. + Für x<0, gibt es zwei reellwertige Lösungen; diese Funktion berechnet diejenige mit: W<-1 for x<0 (vergleiche w0(x)). + + + AVG("colName", i, j): + The average of all cells from row i to j in column colName. + AVG("colName", i, j): + Mittelwert aller Elemente von Zeile i bis Zeile j in Spalte colName. + + + SUM("colName", i, j): + The sum of all cells from row i to j in column colName. + SUM("colName", i, j): + Summe aller Elemente von Zeile i bis Zeile j in der Spalte colName. + + QtiPlot - Math Error - QtiPlot - Mathematikfehler + QtiPlot - Mathematikfehler Found non-removable singularity at x = %1. Operation aborted! Es wurde eine nicht hebbare singularität bei x = %1 gefunden. Die Operation wurde abgebrochen! - QtiPlot QtiPlot - Ignored data point at x = %1. - Datenpunkt bei x= %1 wurde ignoriert. + Datenpunkt bei x= %1 wurde ignoriert. - Found non-removable singularity at x = %1. Eine nicht hebbare Singularität wurde bei x = %1 gefunden. + + QtiPlot - Memory Allocation Error + QtiPlot - Fehler bei der Speicherreservierung + + + Not enough memory, operation aborted! + Nicht genügend Speicher, Berechnung abgebrochen! + + + The function %1 is not defined in the specified interval! + Die Funktion %1 ist auf dem gegebenen Intervall nicht definiert! + + + rnd(seed): + Returns a pseudo-random number in the range 0 to 1. Calling this function several times with the same seed will return the same value. + rnd(seed): + Pseudozufallszahl zwischen 0 und 1. Der mehrfache Aufruf mit mit gleichm seed-Wert führt zur Ausgabe eines gleichbleibenden Wertes. + QShortcut @@ -21799,110 +21146,74 @@ QtColorPicker - - - Black Schwarz - - White Weiß - - Red Rot - - Dark red Dunkles Rot - - Green Grün - - Dark green Dunkles Grün - - Blue Blau - - Dark blue Dunkles Blau - - Cyan Cyan - - Dark cyan Dunkles Cyan - - Magenta Magenta - - Dark magenta Dunkles Magenta - - Yellow Gelb - - Dark yellow Dunkles Gelb - - Gray Grau - - Dark gray Dunkles Grau - - Light gray Helles Grau - Custom Benutzerdefiniert @@ -21910,36 +21221,22 @@ RangeSelectorTool - - - - - - QtiPlot - Warning QtiPlot - Warnung - All the curves on this plot are empty! Alle Kurven dieses Diagramms sind leer! - Click or use Ctrl+arrow key to select range (arrows select active cursor)! Klicken Sie oder benutzen Sie Ctrl+Pfeiltasten um den Bereich auszuwählen (Pfeiltasten selektieren den aktiven Cursor)! - - - Right Rechts - - - Left Links @@ -21954,21 +21251,14 @@ Delta_y - - - - - The column '%1' is read-only! Operation aborted! Die Spalte '%1' ist schreibgeschützt! Vorgang abgebrochen! - Remove data from curves? Daten aus Kurven entfernen? - Copy data to clipboard? Daten in die Zwischenablage kopieren? @@ -21976,51 +21266,42 @@ RenameWindowDialog - QtiPlot - Rename Window QtiPlot - Fenster umbennen - Window Title Fenstertitel - &Name (single word) &Name (einzelnes Wort) - &Label - &Beschriftung + &Kommentar - &Both Name and Label &Beide: Name und Beschriftung - &OK &OK - &Cancel - &Abbrechen + Ab&brechen QtiPlot - Error QtiPlot - Fehler - QtiPlot - Warning QtiPlot - Warnung - For internal consistency reasons the underscore character is replaced with a minus sign. Um interne Konsistenz zu sichern, wurden Unterstriche durch ein Minuszeichen ersetzt. @@ -22028,7 +21309,6 @@ ScreenPickerTool - Click on plot or move cursor to display coordinates! Klicken Sie auf ein Diagramm oder bewegen sie den Cursor, um die Koordinaten anzuzeigen! @@ -22036,18 +21316,14 @@ ScriptEdit - Auto&exec Automatisch ausführ&en - &Functions &Funktionen - - Text Text @@ -22056,28 +21332,22 @@ Python Quellcode - - All Files Alle Dateien - QtiPlot - Import Text From File QtiPlot - Text aus Datei importieren - QtiPlot - Error Opening File QtiPlot - Fehler beim Öffnen der Datei - Could not open file "%1" for reading. Konnte Datei "%1" nicht zum Lesen öffnen. - Save Text to File Text in Datei speichern @@ -22100,47 +21370,38 @@ &Nein - QtiPlot - File Save Error QtiPlot - Fehler beim Sichern der Datei - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Konnte nicht in Datei <br><h4> %1 </h4> schreiben.<p>Bitte überprüfen Sie Ihre Schreibrechte! - E&xecute &Ausführen - Ctrl+J Ctrl+J - Execute &All &Alles ausführen - Ctrl+Shift+J Ctrl+Shift+J - &Evaluate Expression Ausdruck ausw&erten - Ctrl+Return Ctrl+Return - &Print &Drucken @@ -22153,62 +21414,50 @@ &Exportieren - &Save &Speichern - &Import... &Importieren... - Sa&ve as... - Speichern als... + Spe&ichern als... - &Find... - Suchen... + S&uchen... - &Replace... E&rsetzen... - &Find next - Suche nächstes + Suche &nächstes - &Find previous - Suche voriges + Suche &voriges - Rena&me Tab... - + Tab &umbenennen... - A&dd Tab - + Tab &hinzufügen - C&lose Tab - + Tab &schließen - QtiPlot QtiPlot - QtiPlot has finished searching the document. Die Suche ist abgeschlossen. @@ -22216,22 +21465,14 @@ ScriptWindow - - &File &Datei - - &Edit B&earbeiten - - - - E&xecute &Ausführen @@ -22240,56 +21481,38 @@ Aus&blenden - - Ctrl+N Ctrl+N - - Ctrl+O Ctrl+O - - Ctrl+S Ctrl+S - - Ctrl+P Ctrl+P - - Ctrl+Z Ctrl+Z - - Ctrl+Y Ctrl+Y - - Ctrl+x Ctrl+x - - Ctrl+C Ctrl+C - - Ctrl+V Ctrl+V @@ -22298,90 +21521,62 @@ Del - - CTRL+J Ctrl+J - - CTRL+SHIFT+J Ctrl+Shift+J - - CTRL+Return Ctrl+Return - QtiPlot - File Save Error QtiPlot - Fehler beim Sichern der Datei - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Konnte nicht in Datei <br><h4> %1 </h4> schreiben.<p>Bitte überprüfen Sie Ihre Schreibrechte! - - &New &Neu - - &Open... Ö&ffnen... - - &Save &Speichern - - Save &As... Speichern &als... - - &Print &Drucken - - &Undo &Rückgängig - - &Redo &Wiederholen - - &Cut Auss&chneiden - - &Copy &Kopieren - - &Paste E&infügen @@ -22390,20 +21585,14 @@ &Löschen - - Execute &All &Alle ausführen - - &Evaluate Expression Ausdruck ausw&erten - - QtiPlot - Script Window QtiPlot - Skriptfenster @@ -22412,128 +21601,90 @@ QtiPlot - Python-Skriptfenster - &Window &Fenster - Always on &Top Immer im &Vordergrund - You need to close and reopen the script window before your changes become effective! Do you want to close it now? Sie müssen das Scriptfenster schließen und wieder öffnen bevor die Änderung wirksam werden! Möchten Sie das Fenster jetzt schließen? - - QtiPlot QtiPlot - Show &Line Numbers Zei&lennummerierung anzeigen - - Script Output Panel - Scriptausgabekonsole + Scriptausgabekonsole - - Increase Indent - + Einrückung vergrößern - - Decrease Indent - + Einrückung verkleinern - - &Find... - + Such&en... - - Ctrl+Alt+F - Ctrl+Alt+F + Ctrl+Alt+F - - Find &Next - + &nächsten finden - - F3 - F3 + F3 - - Find &Previous - + &Vorherige Suchen - - F4 - + F4 - - &Replace... - E&rsetzen... + E&rsetzen... - - Show Script &Output Panel - Script&ausgabekonsole anzeigen + Script&ausgabekonsole anzeigen - - Ouput on Next &Line Ausgabe in nächste &Zeile - Show Script Output Panel - Zeige Ausgabe in der Ausgabekonsole + Zeige Ausgabe in der Ausgabekonsole - - Print Pre&view... - &Druckvorschau + Druck&vorschau... - Script print preview Script Durckvorschau - - &Close S&chließen - - Show &Workspace Arbeits&bereich anzeigen @@ -22541,7 +21692,6 @@ ScriptingEnv - %1 Source (*.%2);; %1 Quelle (*.%2);; @@ -22549,27 +21699,22 @@ ScriptingLangDialog - QtiPlot - Select scripting language QtiPlot - Skriptsprache auswählen - OK OK - Cancel Abbrechen - QtiPlot - Scripting Error QtiPlot - Skriptunterstützungsfehler - Scripting language "%1" failed to initialize. Skriptsprache "%1" konnte nicht initialisiert werden. @@ -22577,32 +21722,26 @@ SetColValuesDialog - QtiPlot - Set column values QtiPlot - Spaltenwerte setzen - For row (i) - Für Zeile (i) + Von Zeile (i) - to bis - Add function Funktion hinzufügen - Add column Spalte hinzufügen - Add cell Zelle hinzufügen @@ -22631,22 +21770,18 @@ &OK - &Apply &Anwenden - &Close S&chließen - Use built-in muParser (much faster) Eingebauten muParser benutzen (viel schneller) - Clear &Formulas &Formeln löschen @@ -22674,32 +21809,26 @@ Boltzmann (Sigmoidal) - Boltzmann (Sigmoidal) Fit Boltzmann (Sigmoidal) Fit - Boltzmann Boltzmann - init value Anfangswert - final value Endwert - center Zentrum - time constant Zeitkonstante @@ -22707,59 +21836,46 @@ SmoothCurveDialog - QtiPlot - Smoothing Options QtiPlot - Glättungsoptionen - Curve Kurve - Polynomial Order Grad des Polynoms - Points to the Left Punkte nach links - Points to the Right Punkte nach rechts - f - + f - Iterations - Iterationen + Iterationen - Points Punkte - - - Color Farbe - &Smooth &Glätten - &Close S&chließen @@ -22767,31 +21883,14 @@ SmoothFilter - Smoothed Geglättet - - - - - - - - QtiPlot QtiPlot - - - - - - - - Error Fehler @@ -22800,89 +21899,69 @@ Unbekannter Glättungsfilter. Gültige Werte sind: 1 - Savitky-Golay, 2 - FFT, 3 - Gleitender Fensterdurchschnitt. - Unknown smooth filter. Valid values are: 1 - Savitky-Golay, 2 - FFT, 3 - Moving Window Average, 4 - Lowess. - + Unbekannter Glättungsfilter. Gültige Werte sind: 1 - Savitky-Golay, 2 - FFT, 3 - Gleitender Mittelwert, 4 - Lokale Regression. - - - - points Punkte - Savitzky-Golay smoothing Savitzky-Golay-Glättung - FFT smoothing FFT-Glättung - average smoothing - Durchschnittsglättung - - - - Lowess smoothing - - - - + Mittelwert-Glättung + + + Lowess smoothing with f=%1 and %2 iterations + Glättung mittels Lokaler Regression mit f=%1 und %2 Iterationen + + The number of points must be positive! Die Anzahl der Punkte muss positiv sein! - - The polynomial order must be lower than the number of left points plus the number of right points! - Die Ordnung des Polynoms muss kleiner als die Summe der linken und rechten Punkte sein! + Der Grad des Polynoms muss kleiner als die Summe der linken und rechten Punkte sein! - Setting polynomial order is only available for Savitzky-Golay smooth filters! Ignored option! - Einstellen der Polynomgrads ist nur für Savitzky-Golay Glättungsfilter verfügbar! Ignoriere Einstellung! + Das Setzen des Polynomgrads ist nur für Savitzky-Golay Glättungsfilter verfügbar! Einstellungen werden ignoriert! - Setting Lowess parameter is only available for Lowess smooth filters! Ignored option! - + Das Setzen der Parameter für Lokale Regression ist nur für diese Glättungsmethode verfügbar! Einstellungen werden ignoriert! - The parameter f must be between 0 and 1! - + Der Paramter f muss zwischen 0 und 1 liegen! - The number of iterations must be at least 1! - + Die Zahl der Iterationen muss mindestens 1 sein! SortDialog - QtiPlot - Sorting Options QtiPlot - Sortierungseinstellungen - Sort columns Spalten sortieren - Order Richtung - Leading column Sortieren nach @@ -22895,59 +21974,103 @@ &Abbrechen - Separately Einzeln - Together Zusammen - Ascending Aufsteigend - Descending Absteigend - &Sort &Sortieren - - &Close - S&chließen + &Close + S&chließen + + + + SubtractDataDialog + + QtiPlot + QtiPlot + + + Math on Data Sets + Berechnungen auf Datensatz anwenden + + + Cu&rve + Kur&ve + + + &Operator + &Operator + + + &Data set + &Datensatz + + + Current &folder + Aktueller &Ordner + + + &Value + &Wert + + + &Apply + &Anwenden + + + &Close + S&chließen + + + Error + Fehler + + + Data set %1 must containt at least two valid data points in order to perform this operation! + Datansatz %1 muss mindestens zwei gültige Datenpunkte enthalten, um diese Operation durchführen zu können! + + + + SubtractLineTool + + Move cursor and click to select and double-click/press 'Enter' to set the position of the first point! + Bewege Mauszeiger, zum Auswählen anklicken und Doppelklick/'Return'-Taste drücken, um die Position des ersten Punktes zu bestimmen! + + + First point selected! Click to select and double-click/press 'Enter' to set the position of the 2nd point! + Erster Punkt wurde ausgewählt! Zum Auswählen anklicken und Doppelklick/'Return'-Taste drücken, um die Position des zweiten Punktes zu bestimmen! SurfaceDialog - QtiPlot - Define surface plot QtiPlot - Oberflächendiagramm erstellen - f(x,y)= f(x,y)= - X - axis X-Achse - - - - - From Von @@ -22956,11 +22079,6 @@ -1 - - - - - To Bis @@ -22969,22 +22087,18 @@ 1 - Y - axis Y-Achse - Z - axis Z-Achse - Clear &list - &Liste leeren + &Liste leeren - &OK &OK @@ -23017,205 +22131,189 @@ QtiPlot - Fehler: Ungültiger Z-Endwert - QtiPlot - Input error QtiPlot - Eingabefehler - Please enter limits that satisfy: from < end! Bitte Grenzen eingeben, so dass Anfang < Ende! - QtiPlot - Input function error QtiPlot - Fehler bei der Funktionseingabe - &Close S&chließen - Surface type Oberflächentyp - Function Funktion - Parametric Parametrisch - - + Clea&r + &Löschen + + + Rece&nt + &Kürzlich + + + Click here to select a recently typed expression + Hier anklicken, um einen kürzlich verwendeten Ausdruck zu verwenden + + Mesh Netz - - Columns Spalten - - Rows Zeilen - Equations Gleichungen - X(u,v)= X(u,v)= - Y(u,v)= Y(u,v)= - Z(u,v)= Z(u,v)= - u u - - Periodic Periodisch - v v - QtiPlot - X Formula Error QtiPlot - X-Formelfehler - QtiPlot - Y Formula Error QtiPlot - Y-Formelfehler - QtiPlot - Z Formula Error QtiPlot - Z-Formelfehler - + QtiPlot + QtiPlot + + + Sorry, there are no recent expressions available! + Es sind keine kürzlich verwendeten Ausdruck verfügbar! + + + Recent Functions + kürzlich verwendete Funktionen + + + Please, choose a function: + Bitte eine Funktion auswählen: + + QtiPlot - u start limit error - QtiPlot - u Startzwertfehler + QtiPlot - u Startzwertfehler - - QtiPlot - u end limit error - QtiPlot - u Endwertfehler + QtiPlot - u Endwertfehler - QtiPlot - v start limit error - QtiPlot - v Startzwertfehler + QtiPlot - v Startzwertfehler SymbolBox - No Symbol Kein Symbol - Ellipse Ellipse - Rectangle Rechteck - Diamond Raute - Triangle Dreieck - Down Triangle Dreieck nach unten - Up Triangle Dreieck nach oben - Left Triangle Dreieck nach links - Right Triangle Dreieck nach rechts - Cross Kreuz - Diagonal Cross Diagonalkreuz - Horizontal Line Horizontale Linie - Vertical Line Vertikale Linie - Star 1 Stern 1 - Star 2 Stern 2 - Hexagon Sechseck @@ -23223,12 +22321,10 @@ SymbolDialog - QtiPlot - Choose Symbol QtiPlot - Symbol auswählen - &Close S&chließen @@ -23236,21 +22332,6 @@ Table - - - - - - - - - - - - - - - QtiPlot - Error QtiPlot - Fehler @@ -23275,21 +22356,14 @@ &Nein - QtiPlot - ASCII Export Error QtiPlot - ASCII-Export-Fehler - - - - QtiPlot QtiPlot - - Yes Ja @@ -23298,8 +22372,6 @@ Nein - - Cancel Abbrechen @@ -23358,18 +22430,14 @@ QtiPlot - Datei lesen... - Rows will be deleted from the table! Es werden Zeilen in der Tabelle gelöscht! - - Do you really want to continue? Möchten Sie wirklich fortfahren? - Columns will be deleted from the table! Es werden Spalten in der Tabelle gelöscht! @@ -23416,7 +22484,6 @@ Der Name der Spalte muss sich vom Namen der Tabelle unterscheiden: <b> - There is already a column called : <b> Es gibt bereits eine Spalte namens: <b> @@ -23427,7 +22494,6 @@ Wollen sie Zellen einfügen? - Please indicate the name of the leading column! Bitte den Namen der führenden Spalte angeben! @@ -23436,83 +22502,54 @@ Die führende Spalte hat den Typ 'Text'! Vorgang abgebrochen! - The leading column is empty! Operation aborted! Die führende Spalte ist leer! Vorgang abgebrochen! - Could not write to file: <br><h4> Konnte nicht in die Datei <br><h4> schreiben - - - Column '%1' is read only! Spalte '%1' ist schreibgeschützt! - The table '%1' contains read-only columns! Operation aborted! Die Tabelle '%1' enthält schreibgeschützte Spalten! Vorgang abgebrochen! - - - - - - - - The folowing columns Folgende Spalten - - - - - - - - are read only! sind schreibgeschützt! - Paste operation - + Operation einfügen - How should QtiPlot interpret first clipboard line? - + Wie soll QtiPlot die erste Zeile der Zwischenablage interpretieren? - &Values - Werte + &Werte - Column &Names - + Spalten&namen - &Comments - + Ko&mmentare - Qtiplot Qtiplot - Reading file... Lese Datei... @@ -23521,17 +22558,14 @@ QtiPlot - Eingabefehler - kB kB - Multiline expressions take much more time to evaluate! Do you want to continue anyways? Mehrzeilige Ausdrücke benötigen viel mehr Zeit zur Auswertung! Möchten Sie trotzdem fortfahren? - Warning Warnung @@ -23539,12 +22573,10 @@ TableDialog - Column Name: Spaltenname: - Enumerate all to the right Alle folgenden Spalten nummerieren @@ -23553,102 +22585,82 @@ Anwenden - Options Optionen - Plot Designation: - Plotzuweisung: + Diagrammzuordnung: - Display - Anzeige + Typ - Format: Format: - X (abscissae) X-Werte - Y (ordinates) Y-Werte - None Keine - Numeric Numerisch - Text Text - Date Datum - Time Zeit - Month Monat - Day of Week Wochentag - Apply to all columns to the right Auf alle folgenden Spalten anwenden - Column Width: Spaltenbreite: - Comment: Kommentar: - Decimal: 1000 Dezimal: 1000 - Scientific: 1E3 Wissenschaftlich: 1E3 - yyyy-MM-dd yyyy-MM-dd - dd.MM.yyyy dd.MM.yyyy @@ -23657,233 +22669,186 @@ ddd MMMM d aa - dd/MM/yyyy dd/MM/yyyy - h h - h ap h ap - h AP h AP - h:mm h:mm - h:mm ap h:mm ap - hh:mm hh:mm - h:mm:ss h:mm:ss - h:mm:ss.zzz h:mm:ss.zzz - mm:ss mm:ss - mm:ss.zzz mm:ss.zzz - hmm hmm - hmmss hmmss - hhmmss hhmmss - QtiPlot - Column options QtiPlot - Spaltenoptionen - &Cancel - &Abbrechen + Ab&brechen - &OK &OK - Default Standard - Apply to all Auf alle anwenden - &Apply &Anwenden - Precision: Genauigkeit: - Z (height) Z-Werte - - QtiPlot - Error QtiPlot - Fehler - The column names must only contain letters and digits! - Die Spaltennamen dürfen nur Buchstaben und Ziffern enthalten! + Die Spaltennamen dürfen nur Buchstaben und Ziffern enthalten! - X Error X-Fehler - Y Error Y-Fehler - QtiPlot - Warning QtiPlot - Warnung - For internal consistency reasons the underscore character is replaced with a minus sign. Um interne Konsistenz zu sichern, wurden Unterstriche durch ein Minuszeichen ersetzt. - &Read-only Sch&reibgeschützt - &Display Comments in Header Kommentare in &der Kopfzeile anzeigen - dd MM yyyy dd MM yyyy - yyyyMMdd yyyyMMdd - Couldn't guess the source data format, please specify it using the 'Format' box! Konnte das Dateiformat nicht bestimmen. Bitte geben Sie das Dateiformat im Formatfeld an! - For more information about the supported date/time formats please read the Qt documentation for the QDateTime class! Mehr Informationnen über die unterstützten Zeit- und Datumformate finden Sie in der Qt-Dokumentation der QDate-Time-Klasse! - Label Beschriftung - &Hidden - Verborgen + Verbor&gen - dd/MM/yyyy HH:mm dd/MM/yyyy HH:mm - dd/MM/yyyy HH:mm:ss dd/MM/yyyy HH:mm:ss - dd.MM.yyyy HH:mm dd.MM.yyyy HH:mm - dd.MM.yyyy HH:mm:ss dd.MM.yyyy HH:mm:ss - dd MM yyyy HH:mm dd MM yyyy HH:mm - dd MM yyyy HH:mm:ss dd MM yyyy HH:mm:s - yyyy-MM-dd HH:mm yyyy-MM-dd HH:mm - yyyy-MM-dd HH:mm:ss yyyy-MM-dd HH:mm:ss - yyyyMMdd HH:mm yyyyMMdd HH:mm - yyyyMMdd HH:mm:ss yyyyMMdd HH:mm:ss @@ -23891,100 +22856,74 @@ TableStatistics - Row Statistics of %1 Zeilenstatistik für %1 - Row Zeile - Cols Spalten - - Mean Mittel - - Variance Varianz - - Sum Summe - - Max Max - - Min Min - Column Statistics of %1 Spaltenstatistik für %1 - Col Spalte - Rows Zeilen - iMax iMax - iMin iMin - RowStats Zeilenstatistiken - - StandardDev Standardabweichung - ColStats Spaltenstatistiken - - StandardError Standardfehler - - Median Mittelwert @@ -23992,7 +22931,6 @@ TextDialog - QtiPlot - Text options QtiPlot - Textoptionen @@ -24005,12 +22943,10 @@ &OK - Font Schriftart - &Font &Schrift @@ -24023,17 +22959,14 @@ Ausrichtung - Center Mitte - Left Links - Right Rechts @@ -24118,12 +23051,10 @@ F&arbe - Text Color Textfarbe - Alignment Ausrichtung @@ -24144,88 +23075,69 @@ Transparent - - - - QtiPlot QtiPlot - X Axis Title X-Achsenbeschriftung - Y Axis Title Y-Achsenbeschriftung - Top Axis Title Obere Achsenbeschriftung - Right Axis Title Rechte Achsenbeschriftung - &Apply to... &Anwenden auf... - Object Objekt - Layer Ebene - Window Fenster - All Windows Alle Fenster - &Close S&chließen - Distance to axis Abstand zur Achse - &Inverted - + &Invertiert TextEditor - QtiPlot QtiPlot - Confirmation Bestätigung - Are you sure you want to add %1 text lines into this text box? Sie Sie sicher, dass Sie %1 Textzeilen hinzufügen möchten? @@ -24233,19 +23145,16 @@ TextFormatButtons - B Button bold B - It Button italics I - U Button underline U @@ -24254,7 +23163,6 @@ ThreeExpFit - Exponential decay Exponentielles Abklingen @@ -24263,42 +23171,34 @@ (Offset) - ExpDecay3 ExpAbnahme3 - first amplitude erste Amplitude - first lifetime erste Lebensdauer - second amplitude zweite Lebensdauer - second lifetime zweite Lebensdauer - third amplitude dritte Amplitude - third lifetime dritte Lebensdauer - offset Offset @@ -24306,36 +23206,26 @@ TranslateCurveTool - Curve selected! Move cursor and click to choose a point and double-click/press 'Enter' to finish! Kurve ausgewählt! Bewegen Sie den Cursor, wählen Sie durch einen Klick einen Punkt aus und bestätigen Sie durch einen Doppelklick oder die Eingabetaste! - - - - QtiPlot - Warning QtiPlot - Warnung - This operation cannot be performed on curves plotted from columns having a non-numerical format. Diese Operation kann nicht auf Kurven angewendet werden, die auf Spalten mit nicht-numerischem Format basieren. - This operation cannot be performed on function curves. Diese Operationi kann nicht für Funktionskurven benutzt werden. - - The column '%1' is read-only! Operation aborted! Die Spalte '%1' ist schreibgeschützt! Operation abgebrochen! - Double-click on plot to select a data point! Auf das Diagramm doppelklicken, um einen Datenpunkt auszuwählen! @@ -24343,7 +23233,6 @@ TwoExpFit - Exponential decay Exponentielles Abklingen @@ -24352,32 +23241,26 @@ (Offset) - ExpDecay2 ExpAbnahme2 - first amplitude erste Amplitude - first lifetime erste Lebensdauer - second amplitude zweite Amplitude - second lifetime zweite Lebensdauer - offset Offset @@ -24385,10 +23268,6 @@ muParserScript - - - - Out of memory Kein Speicher mehr verfügbar @@ -24409,7 +23288,6 @@ Syntaxfehler: '=' ohne Variablenname. - col() works only on tables! col() funktioniert nur bei Tabellen! @@ -24418,58 +23296,50 @@ cell() funktioniert nur bei Matrizen! - - There's no column named %1 in table %2! Es gibt keine Spalte namens %1 in Tabelle %2! - - - There's no row %1 in table %2! Es gibt keine Zeile %1 in Tabelle %2! - - - There's no column %1 in table %2! Es gibt keine Spalte namens %1 in Tabelle %2! - There's no row %1 in matrix %2! Es gibt keine Zeile %1 in Matrix %2! - There's no column %1 in matrix %2! Es gibt keine Spalte namens %1 in Matrix %2! - + SUM() works only on tables! + SUM() funktioniert nur unter Verwendung von Tabellen! + + + AVG() works only on tables! + AVG() funktioniert nur unter Verwendung von Tabellen! + + tablecol() works only on tables! tablecol() funkioniert nur bei Tabellen! - tablecol: wrong number of arguments (need 2, got %1) tablecol: falsche Anzahl an Argumenten (2 benötigt, %1 angegeben) - tablecol: first argument must be a string (table name) tablecol: erstes Argument muss vom Typ String sein (Tabellenname) - Couldn't find a table named %1. Konnte keine Tabelle mit dem Namen %1 finden. - - cell() works only on tables and matrices! cell() funktioniert nur mit Tabellen und Matrizen! === modified file 'qtiplot/translations/qtiplot_es.ts' --- qtiplot/translations/qtiplot_es.ts 2009-12-08 18:06:27 +0000 +++ qtiplot/translations/qtiplot_es.ts 2010-07-21 23:21:08 +0000 @@ -68,14 +68,1683 @@ QtiPlot - Error + Open File + Abrir Archivo + + + Format + Formato + + + Time + Tiempo + + + Left + Izquierda + + + Right + Derecha + + + Data + Datos + + + The file: <b>%1</b> is the current file! + ¡El archivo <b> %1 </b> es el archivo actual! + + + The file <b>%1</b> is corrupted, but there exists a backup copy.<br>Do you want to open the backup instead? + El archivo <b>%1</b> está corrupto, pero existe una copia de seguridad.<br>¿Desea abrir la copia en su lugar? + + + The file: <b> %1 </b> was not created using QtiPlot! + ¡El archivo <b> %1 </b> no fue creado usando QtiPlot! + + + The file: <p><b> %1 </b><p> is the current file! + ¡El archivo <p><b> %1 </b><p> es el archivo actual! + + + QtiPlot - File Open Error + QtiPlot - Error Abriendo Archivo + + + The file: <b> %1 </b> <p>does not exist anymore!<p>It will be removed from the list. + ¡El archivo <b> %1 </b> <p> ya no existe!<p>Será eliminado de la lista. + + + The file "%1" was created using "%2" as scripting language. + +Initializing support for this language FAILED; I'm using "%3" instead. +Various parts of this file may not be displayed as expected. + El archivo "%1" fue creado usando "%2" como lenguaje de programación. + +La inicialización del soporte para este lenguaje FALLÓ; Estoy usando "%3" en su lugar. +Varias partes de este archivo pueden no mostrarse como se esperaba. + + + Window + Ventana + + + QtiPlot - Opening file + QtiPlot - Abriendo archivo + + + QtiPlot - Scripting Error + QtiPlot - Error de Programación + + + Scripting language "%1" failed to initialize. + Falló la inicialización del lenguaje de programación "%1". + + + QtiPlot - Open Template File + QtiPlot - Abrir Archivo de Plantilla + + + The file: <b>%1</b> is not a QtiPlot template file! + ¡El archivo: <b>%1</b> no es un archivo de plantilla de QtiPlot! + + + QtiPlot - Export Error + QtiPlot - Error de Exportación + + + <h4>There are no plot layers available in this window!</h4> + <h4>¡No hay capas gráficas disponibles en esta ventana!</h4> + + + &Cancel + &Cancelar + + + Choose a directory to export the graphs to + Elija un directorio al que exportar las gráficas + + + A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? + Un archivo llamado <p><b>%1</b><p> ya existe. ¿Desea sobreescribirlo? + + + Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! + No se pudo escribir en el archivo <br><h4> %1 </h4><p>¡Por favor, verifique que tiene permiso de escritura! + + + Minimized + Minimizada + + + Save Project As + Guardar Proyecto Como + + + QtiPlot Matrix Template + Plantilla de Matriz de QtiPlot + + + QtiPlot 2D Graph Template + Plantilla para Gráfica 2D de QtiPlot + + + QtiPlot Table Template + Plantilla de Tabla de QtiPlot + + + QtiPlot 3D Surface Template + Plantilla de Superficie 3D de QtiPlot + + + Save Window As Template + Guardar Ventana como Plantilla + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + No se pudo escribir en el archivo <br><h4> %1 </h4><p>¡Por favor, verifique que tiene permiso de escritura! + + Please enter a valid name! ¡Por favor, introduzca un nombre válido! + The name you chose is not valid: only letters and digits are allowed! + ¡El nombre escogido no es válido: sólo cifras y letras están permitidos! + + Please choose another name! ¡Por favor, escoja otro nombre! + Name <b>%1</b> already exists! + ¡El nombre <b>%1</b> ya existe! + + + Warning: for internal consistency reasons the underscore character is replaced with a minus sign. + Aviso: por razones de consistencia interna el carácter de guión bajo es reemplazado por el signo menos. + + + <h4>There are no plot layers available in this window.</h4><p><h4>Please add a layer and try again!</h4> + <h4>No hay capas gráficas disponibles en esta ventana.</h4><p><h4>¡Por favor añada una e inténtelo de nuevo!</h4> + + + This functionality is not available for pie plots! + ¡Esta funcionalidad no está disponible para gráficos de porciones! + + + &All + &Todo + + + QtiPlot - Enter rows number + QtiPlot - Introduzca el número de filas + + + Rows + Filas + + + QtiPlot - Enter columns number + QtiPlot - Introduzca el número de columnas + + + Columns + Columnas + + + Please select a column first! + ¡Por favor, seleccione una columna primero! + + + Please select two columns for this operation! + ¡Por favor, seleccione dos columnas para esta operación! + + + Please select two columns for this operation: + the first represents the signal and the second the response function! + Por favor, seleccione dos columnas para esta operación: +¡la primera representa la señal y la segunda la función respuesta! + + + QtiPlot - Row selection error + QtiPlot - Error de selección de fila + + + Please select a row first! + ¡Por favor, seleccione una fila primero! + + + Special Line/Symb&ol + Línea/Símb&olo especial + + + Statistical &Graphs + &Gráficas estadísticas + + + &Plot + &Gráfica + + + Cu&t + Cor&tar + + + &Copy + &Copiar + + + Past&e + P&egar + + + &X + &X + + + &Y + &Y + + + &Z + &Z + + + &Label + Etiqueta + + + X E&rror + X E&rror + + + Y &Error + Y &Error + + + &Column + &Columna + + + &Normalize + &Normalizar + + + Clea&r + Limpia&r + + + &Delete + &Eliminar + + + &Insert + &Insertar + + + &Ascending + &Ascendente + + + &Descending + &Descendente + + + Sort Colu&mn + Ordenar Colu&mna + + + Pa&nel + Pa&nel + + + Not available for empty 3D surface plots! + ¡No disponible para superficies 3D vacías! + + + <h4>There are no plot layers available in this window.</h4> + <h4>No hay capas gráficas disponibles en esta ventana.</h4> + + + This will modify the data in the worksheets! +Are you sure you want to continue? + ¡Esto modificará los datos en las tablas! +¿Seguro que quiere continuar? + + + Continue + Continuar + + + Cancel + Cancelar + + + Sorry, there are no results to display! + Lo siento. ¡No hay resultados para mostrar! + + + There are no plot layers available in this window! + ¡No hay capas gráficas disponibles en esta ventana! + + + There are no curves available on this plot! + ¡No hay curvas disponibles en esta gráfica! + + + QtiPlot - Insert image from file + QtiPlot - Insertar imagen desde archivo + + + There are no plot layers available in this window. + No hay capas gráficas disponibles en esta ventana. + + + QtiPlot - Duplicate window error + QtiPlot - Error de Ventana Duplicada + + + QtiPlot - Duplicate error + QtiPlot - Error de Duplicado + + + Empty 3D surface plots cannot be duplicated! + ¡Las gráficas de superficies 3D vacías no pueden ser duplicadas! + + + About QtiPlot + Acerca de QtiPlot + + + &Translate + &Traducir + + + &Cascade + &Cascada + + + &Tile + Mosai&co + + + Close &Window + Cerrar &Ventana + + + More windows... + Más ventanas ... + + + &Intensity Matrix + Matriz &Intensidad + + + &Cut + &Cortar + + + Please use the project explorer to select a window! + ¡Por favor, use el explorador de proyecto para seleccionar una ventana! + + + Normal + Normal + + + Save changes to project: <p><b> %1 </b> ? + ¿Guardar cambios del proyecto: <p><b>%1</b>? + + + UNTITLED + SIN TITULO + + + QtiPlot - untitled + QtiPlot - sin título + + + &Delete Selection + Borrar selección + + + Auto &Column Width + Anchura de Columna Automática + + + &Delete Window + Eliminar Ventana + + + &Rename Window + &Renombrar Ventana + + + &Print Window + Im&primir Ventana + + + D&epending Graphs + Gráficas D&ependientes + + + D&epending 3D Graphs + Gráficas 3D D&ependientes + + + D&epends on + D&epende de + + + Function + Función + + + Maximized + Maximizada + + + &Add + &Añadir + + + &Data + &Datos + + + &Gray Scale + Escala de &Grises + + + &Layer + &Capa + + + &Window + &Ventana + + + &Paste Layer + &Pegar Capa + + + E&xport + E&xportar + + + &Print + Im&primir + + + P&roperties... + P&ropiedades... + + + &Copy Page + &Copiar Página + + + E&xport Page + E&xportar Página + + + &Matrix... + &Matriz... + + + Choose &Data Set... + Elegir Conjunto de &Datos... + + + Choose &Matrix... + Elegir &Matriz... + + + C&lear + Vac&iar + + + &Copy Graph + &Copiar Gráfica + + + &Export + &Exportar + + + &Paste + &Pegar + + + &Insert Row + &Insertar Fila + + + &Insert Column + &Insertar Columna + + + &Delete Rows + &Borrar Filas + + + &Delete Columns + Eliminar Columnas + + + &Delete Row + Eliminar Fila + + + Clea&r Row + Limpia&r Fila + + + Clea&r Rows + Vacia&r Fila + + + Choose the location of the QtiPlot help folder! + ¡Escoja la ubicación de la carpeta de ayuda de QtiPlot! + + + QtiPlot - index.html File Not Found! + QtiPlot - Archivo No Encontrado index.html + + + There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! + No hay ningún archivo llamado <b>index.html</b> en esta carpeta.<br>¡Por favor, elija otra carpeta! + + + QtiPlot - Help Files Not Found! + QtiPlot - ¡No se encontraron archivos de ayuda! + + + QtiPlot - Help Profile Not Found! + ¡QtiPlot - No se encontró el perfil de ayuda! + + + <h4>There are no tables available in this project.</h4><p><h4>Please create a table and try again!</h4> + <h4>No hay tablas disponibles en este proyecto</h4><p><h4>¡Por favor, cree una tabla e inténtelo de nuevo!</h4> + + + QtiPlot - Edit function + QtiPlot - Editar función + + + QtiPlot - Set the number of pixels to average + QtiPlot - Seleccione el número de pixels a promediar + + + Number of averaged pixels + Número de pixels promediados + + + QtiPlot - Guess best origin for the new layer? + QtiPlot - ¿Buscar origen óptimo para la capa nueva? + + + Do you want QtiPlot to guess the best position for the new layer? + Warning: this will rearrange existing layers! + ¿Quiere que QtiPlot busque el origen óptimo para la capa nueva? + ¡Atención: esto reorganizará las capas existentes! + + + &Guess + Adivinar + + + &Top-left corner + Esquina superior izquierda + + + QtiPlot - Choose data set + QtiPlot - Elegir conjunto de datos + + + Curve + Curva + + + Area + Área + + + R^2 + R^2 + + + New &Project + Nuevo &Proyecto + + + Ctrl+N + Ctrl+N + + + App&end Project... + Añadir Proy&ecto... + + + New &Graph + Nueva &Gráfica + + + Ctrl+G + Ctrl+G + + + New &Note + Nueva &Nota + + + New &Table + Nueva &Tabla + + + Ctrl+T + Ctrl+T + + + New &Matrix + Nueva &Matriz + + + Ctrl+M + Ctrl+M + + + New &Function Plot + Nueva Gráfica de &Función + + + Ctrl+F + Ctrl+F + + + Ctrl+ALT+Z + Ctrl+ALT+Z + + + &Open + Abrir + + + Ctrl+O + Ctrl+O + + + Ctrl+I + Ctrl+I + + + &Save Project + &Guardar Proyecto + + + Ctrl+S + Ctrl+S + + + Save Project &As... + Guard&ar Proyecto Como... + + + Open Temp&late... + Abrir P&lantilla... + + + Ctrl+Z + Ctrl+Z + + + &Redo + &Rehacer + + + &Duplicate + &Duplicar + + + Ctrl+X + Ctrl+X + + + Ctrl+C + Ctrl+C + + + Ctrl+V + Ctrl+V + + + Del + delete key + Del + + + Ctrl+E + Ctrl+E + + + Add La&yer + Añadir Capa + + + ALT+L + ALT+L + + + Arran&ge Layers + Or&ganizar Capas + + + Automatic Layout + Organización Automática + + + &Current + A&ctual + + + Ctrl+Alt+G + Ctrl+Alt+G + + + Alt+X + Alt+X + + + Ctrl+P + Ctrl+P + + + Print All Plo&ts + Imprimir &todas las Gráficas + + + E&xport ASCII + E&xportar ASCII + + + &Quit + &Quitar + + + Ctrl+Q + Ctrl+Q + + + &Close + &Cerrar + + + Ctrl+Alt+W + Ctrl+Alt+W + + + &Preferences... + &Preferencias... + + + Add/Remove &Curve... + Añadir/Quitar &Curva... + + + ALT+C + ALT+C + + + Add &Error Bars... + Añadir Barras de &Error... + + + Ctrl+B + Ctrl+B + + + Add &Function... + Añadir &Función... + + + Ctrl+Alt+F + Ctrl+Alt+F + + + Ctrl+Shift+R + Ctrl+Shift+R + + + New &Legend + Nueva &Leyenda + + + Ctrl+L + Ctrl+L + + + Ctrl+ALT+T + Ctrl+ALT+T + + + Add &Image + Añadir &Imagen + + + ALT+I + ALT+I + + + &Line + &Línea + + + &Scatter + Di&spersión + + + Line + S&ymbol + Línea + Símbolo + + + &Spline + Suavizado + + + &Horizontal Steps + Escalones &Horizontales + + + &Vertical Steps + Escalones &Verticales + + + &Columns + &Columnas + + + &Rows + Filas + + + &Area + Área + + + &Pie + Porciones + + + Vectors XY&AM + Vectores XY&AM + + + &Vectors &XYXY + &Vectores &XYXY + + + &Histogram + &Histograma + + + &Stacked Histogram + Hi&stograma apilado + + + &Vertical 2 Layers + &2 capas &verticales + + + &Horizontal 2 Layers + 2 capas &horizontales + + + &4 Layers + &4 capas + + + &Stacked Layers + &Capas Apiladas + + + &Zoom + &Zoom + + + &Ribbon + &Cinta + + + &Bars + &Barras + + + &Trajectory + &Trayectoria + + + Statistics on &Columns + Estadísticas de &Columna + + + Statistics on &Rows + Estadísticas de &Fila + + + &Integrate + &Integrar + + + Inte&rpolate ... + Inte&rpolar... + + + &Low Pass... + Pasa &Baja... + + + &High Pass... + Pasa &Alta... + + + &Band Pass... + Pasa &Banda... + + + &Band Block... + Bloquear &Banda... + + + &FFT... + &FFT... + + + &Savitzky-Golay... + &Savitzky-Golay... + + + &FFT Filter... + Filtro &FFT... + + + Moving Window &Average... + Promedio de Vent&ana Móvil... + + + &Differentiate + &Derivar + + + Fit &Linear + Ajuste &Lineal + + + Fit &Polynomial ... + Ajuste &Polinomial ... + + + &First Order ... + &Primer Orden ... + + + &Second Order ... + &Segundo Orden ... + + + &Third Order ... + &Tercer Orden ... + + + Fit Exponential Gro&wth ... + Ajustar a Crecimiento E&xponencial... + + + Fit &Boltzmann (Sigmoidal) + Ajustar &Boltzmann (Sigmoidal) + + + Fit &Gaussian + Ajuste &Gaussiano + + + Fit Lorent&zian + Ajuste Loren&ziano + + + Ctrl+Y + Ctrl+Y + + + &Plot ... + &Dibujar ... + + + &Scales... + E&scalas... + + + &Axes... + &Ejes... + + + &Grid ... + &Malla ... + + + &Title ... + &Título ... + + + Column &Options ... + &Opciones de Columna... + + + Ctrl+Alt+O + Ctrl+Alt+O + + + Set Column &Values ... + Fijar &Valores de las Columnas... + + + Alt+Q + Alt+Q + + + Recalculate + Recalcular + + + Ctrl+Return + Ctrl+Return + + + &Columns... + &Columnas ... + + + &Rows... + &Filas ... + + + &About QtiPlot + &Acerca de QtiPlot + + + F1 + F1 + + + Ctrl+H + Ctrl+H + + + Ctrl+W + Ctrl+W + + + &Go to Row... + Ir a fila... + + + Clear + Limpiar + + + &Remove Layer + Quita&r Capa + + + Alt+R + Alt+R + + + Window &Geometry... + &Geometría de Ventanas ... + + + &Hide Window + &Esconder Ventana + + + &Properties + &Propiedades + + + &Activate Window + &Activar Ventana + + + Mi&nimize Window + Mi&nimizar Ventana + + + Ma&ximize Window + Ma&ximizar Ventana + + + Re&size Window... + Redimen&sionar Ventana ... + + + &Surface... + &Superficie... + + + &Data Set... + Conjunto de &Datos... + + + Set &Properties... + Fijar &Propiedades ... + + + Set &Dimensions... + Fijar &Dimensiones ... + + + Set &Values... + Fijar &Valores ... + + + &Transpose + &Transponer + + + &Invert + &Invertir + + + &Determinant + &Determinante + + + 3D &Wire Frame + Es&queleto 3D + + + 3D &Hidden Line + Línea &Oculta 3D + + + 3D &Polygons + &Polígonos 3D + + + 3D Wire &Surface + &Superficie de Hilos 3D + + + Contour - &Color Fill + Contorno - Relleno de &Color + + + Contour &Lines + &Líneas de Contorno + + + &Gray Scale Map + Escala de &Grises + + + Sort Ta&ble + Ordenar Ta&bla + + + Sort Columns + Ordenar Columnas + + + &Table + &Tabla + + + Co&rrelate + Co&rrelacionar + + + &Convolute + &Convolucionar + + + &Deconvolute + &Deconvolucionar + + + &Horizontal + &Horizontal + + + &Vertical + &Vertical + + + Ro&w Numbers + Números de &Fila + + + &Box Plot + Gráfica de &Caja + + + &Gaussian... + &Gaussiana... + + + &Lorentzian... + &Lorentziana... + + + Search for &Updates + B&uscar Actualizaciones + + + &QtiPlot Homepage + Página de Inicio de &QtiPlot + + + &Translations + &Traducciones + + + Scripting &language + &Lenguaje de Programación + + + &Restart scripting + &Reiniciar programación + + + E&xecute + Ejecutar + + + Ctrl+J + Ctrl+J + + + Execute &All + Ejecut&ar Todo + + + Ctrl+Shift+J + Ctrl+Shift+J + + + &Evaluate Expression + &Evaluar Expresión + + + F3 + F3 + + + &Plot details... + Detalles de la Gráfica... + + + &Hide + Ocultar + + + Ctrl+U + Ctrl+U + + + Open a new project + Abrir un nuevo proyecto + + + Create an empty 2D plot + Crear un gráfico 2D vacío + + + Create an empty note window + Crear una ventana de notas vacía + + + New matrix + Nueva matriz + + + Create a new 2D function plot + Crear una nueva gráfica 2D de función + + + Create a new 3D surface plot + Crear una nueva gráfica 3D + + + Open project + Abrir proyecto + + + Open Te&mplate... + Abrir Pla&ntilla... + + + Ctrl+K + Ctrl+K + + + Undo changes + Deshacer cambios + + + Redo changes + Rehacer cambios + + + Duplicate window + Duplicar ventana + + + Cut selection + Cortar selección + + + Copy selection + Copiar selección + + + Paste selection + Pegar selección + + + Delete selection + Borrar selección + + + Show project explorer + Mostrar explorador de proyecto + + + Results &Log + Registro de Resultados + + + &Console + &Consola + + + Show Scripting console + Mostrar consola de programación + + + Script Window + Ventana de Programación + + + Add Layer + Añadir Capa + + + Arrange Layers + Organizar Capas + + + Export current graph + Exportar gráfica actual + + + Export all graphs + Exportar todas las gráficas + + + Print window + Imprimir ventana + + + Add curve to graph + Añadir curva a gráfica + + + Add Error Bars... + Añadir Barras de Error... + + + Add Function... + Añadir Función... + + + Best fit + Reescalar para mostrar todo + + + Add new legend + Añadir nueva leyenda + + + Add Image + Añadir Imagen + + + Plot with vertical bars + Dibujar con barras verticales + + + Plot with horizontal bars + Dibujar con barras horizontales + + + Plot area + Dibujar área + + + Plot pie + Dibujar con porciones + + + &Vectors XYXY + &Vectores XYXY + + + Vectors XYXY + Vectores XYXY + + + Vectors XYAM + Vectores XYAM + + + Zoom + Zoom + + + Contour + &Color Fill + Contorno + Relleno de &Color + + + Contour Lines + Color Fill + Líneas de Contorno + Relleno de Color + + + Gray Scale Map + Escala de Grises + + + Selected columns statistics + Estadísticas de columnas seleccionadas + + + Selected rows statistics + Estadísticas de filas seleccionadas + + + Ctrl+R + Ctrl+R + + + Disable &tools + Desactivar herramien&tas + + + Pointer + Puntero + + + &Zoom In + Aumentar &Zoom + + + Ctrl++ + Ctrl++ + + + Zoom In + Aumentar Zoom + + + Zoom &Out + Disminuir Zoom + + + Ctrl+- + Ctrl+- + + + Zoom Out + Disminuir Zoom + + + CTRL+D + CTRL+D + + + Data reader + Lector de datos + + + ALT+S + ALT+S + + + Select data range + Seleccionar rango de datos + + + Screen reader + Lector de pantalla + + + &Move Data Points... + &Mover Puntos ... + + + Ctrl+ALT+M + Ctrl+ALT+M + + + Move data points + Mover puntos + + + Remove &Bad Data Points... + Quitar Puntos &Malos ... + + + Alt+B + Alt+B + + + Remove data points + Eliminar puntos + + + Add &Text + Añadir &Texto + + + Add Text + Añadir Texto + + + ALT+T + ALT+T + + + Draw &Arrow + Dibuj&ar Flecha + + + CTRL+ALT+A + CTRL+ALT+A + + + Draw arrow + Dibujar flecha + + + Draw &Line + Dibujar &Línea + + + CTRL+ALT+L + CTRL+ALT+L + + + Draw line + Dibujar línea + + + Box + Caja + + + Frame + Marco + + + &Frame + &Marco + + + No Axes + Sin Ejes + + + Wireframe + Esqueleto + + + Hidden Line + Línea Oculta + + + Polygon only + Sólo polígonos + + + Mesh & filled Polygons + Mallar polígonos llenos + + + Dots + Puntos + + + Bars + Barras + + + Cones + Conos + + + Floor Data Projection + Proyección de Datos en el Suelo + + + Floor Isolines + Isolíneas del Suelo + + + Empty Floor + Suelo Vacío + + + Animation + Animación + + + Enable perspective + Activar perspectiva + + + Reset rotation + Reiniciar rotación + + + Fit frame to window + Ajustar marco a la ventana + + + Horizontal + Horizontal + + + Vertical + Vertical + + + QtiPlot - Enter the number of peaks + QtiPlot - Introduzca el número de picos + + + Peaks + Picos + + + Close + Cerrar + + + <b> %1 </b>: Wrong locale option or no translation available! + <b> %1 </b>: ¡Opciones regionales equivocadas o traducción no disponible! + + Type Tipo @@ -1813,23 +3482,18 @@ AddWidgetTool - Click on plot to choose the position of the new object! - - enter your text here introduzca su texto aquí - Move cursor in order to resize the new rectangle! - Move cursor in order to resize the new ellipse! @@ -1837,24 +3501,34 @@ ApplicationWindow - - + File %1 contains only %2 sheets, operation aborted! + + + + Sheet %1 is empty, operation aborted! + + + + sheet + + + + QtiPlot was built without libxls support! + + + File Archivo - - Plot Gráfica - Pointer Puntero - Zoom Zoom @@ -1863,7 +3537,6 @@ Mostrar pantalla de datos - Select data range Seleccionar rango de datos @@ -1872,45 +3545,30 @@ Mostrar cursor de datos - Move data points Mover puntos - Remove data points Eliminar puntos - Draw line Dibujar línea - - - - - - - - Table Tabla - - Data Display Pantalla de datos - &File &Archivo - &New &Nuevo @@ -1919,7 +3577,6 @@ &Proyectos Recientes - &Export Graph &Exportar gráfica @@ -1928,17 +3585,14 @@ &Importar ASCII - &Edit &Editar - &View &Ver - &Graph &Gráfica @@ -1947,27 +3601,18 @@ Gráfica 3D - &Matrix &Matriz - - - Special Line/Symb&ol Línea/Símb&olo especial - - - Statistical &Graphs &Gráficas estadísticas - - Pa&nel Pa&nel @@ -1980,8 +3625,6 @@ Gráfica &3D - - &Data &Datos @@ -1994,12 +3637,10 @@ &FFT - Fit E&xponential Decay Ajuste a decaimiento e&ponencial - &Analysis &Análisis @@ -2008,27 +3649,18 @@ For&mato - &Windows &Ventana - - - &Help A&yuda - - <h4>There are no tables available in this project.</h4><p><h4>Please create a table and try again!</h4> <h4>No hay tablas disponibles en este proyecto</h4><p><h4>¡Por favor, cree una tabla e inténtelo de nuevo!</h4> - - - QtiPlot - Choose data set QtiPlot - Elegir conjunto de datos @@ -2037,8 +3669,6 @@ <h4>No hay matrices disponibles en este proyecto.</h4><p><h4>¡Por favor, cree una matriz e inténtelo de nuevo!</h4> - - QtiPlot - Choose matrix to plot QtiPlot - Elegir matriz para representar @@ -2055,106 +3685,62 @@ Gráfica 3D de función - QtiPlot - Import image from file QtiPlot - Importar imagen de archivo - QtiPlot - Load image from file QtiPlot - Cargar imagen de archivo - - - - - - - - Matrix Matriz - Normal - Normal + Normal - - - - - - - - - - - - - - - - - <h4>There are no plot layers available in this window.</h4><p><h4>Please add a layer and try again!</h4> <h4>No hay capas gráficas disponibles en esta ventana.</h4><p><h4>¡Por favor añada una e inténtelo de nuevo!</h4> - QtiPlot - Error bars error QtiPlot - Error de barras de error - - This feature is not available for user defined function curves! ¡Esta característica no está disponible para funciones definidas por el usuario! - QtiPlot - File Open Error - QtiPlot - Error Abriendo Archivo + QtiPlot - Error Abriendo Archivo - <h4>There are no plot layers available in this window!</h4> - <h4>¡No hay capas gráficas disponibles en esta ventana!</h4> + <h4>¡No hay capas gráficas disponibles en esta ventana!</h4> QtiPlot - Overwrite File? QtiPlot - ¿Sobreescribir Archivo? - - A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? - Un archivo llamado <p><b>%1</b><p> ya existe. ¿Desea sobreescribirlo? + Un archivo llamado <p><b>%1</b><p> ya existe. ¿Desea sobreescribirlo? - - &Yes - &Sí + &Sí - - - &All - &Todo + &Todo - - - &Cancel - &Cancelar + &Cancelar - QtiPlot - Export Error QtiPlot - Error de Exportación @@ -2173,7 +3759,6 @@ ¿Desea sobreescribirlo? - &No &No @@ -2186,110 +3771,28 @@ Por favor, escoja un nombre - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QtiPlot - Error QtiPlot - Error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QtiPlot - Warning QtiPlot- Aviso - Not available for empty 3D surface plots! - ¡No disponible para superficies 3D vacías! + ¡No disponible para superficies 3D vacías! QtiPlot - Custom curves Curvas Personalizadas - - - - <h4>There are no plot layers available in this window.</h4> - <h4>No hay capas gráficas disponibles en esta ventana.</h4> + <h4>No hay capas gráficas disponibles en esta ventana.</h4> - Sorry, there are no results to display! - Lo siento. ¡No hay resultados para mostrar! + Lo siento. ¡No hay resultados para mostrar! QtiPlot - Add new layer? @@ -2316,18 +3819,16 @@ QtiPlot - Geometría de Capa - QtiPlot - Duplicate error - QtiPlot - Error de Duplicado + QtiPlot - Error de Duplicado Empty 3D surface plots can not be duplicated! ¡Las superficies 3D vacías no pueden ser duplicadas! - QtiPlot - Duplicate window error - QtiPlot - Error de Ventana Duplicada + QtiPlot - Error de Ventana Duplicada There are no windows available in this project! @@ -2338,67 +3839,44 @@ QtiPlot - Geometría de Ventana - About QtiPlot - Acerca de QtiPlot + Acerca de QtiPlot &View pixel line profile &Ver perfil de línea de pixel - &Intensity Matrix - Matriz &Intensidad + Matriz &Intensidad - &Cut - &Cortar + &Cortar - - - - - - - - &Copy - &Copiar + &Copiar - - - - - &Delete - &Eliminar + &Eliminar - - - - &Properties - &Propiedades + &Propiedades - Please use the project explorer to select a window! - ¡Por favor, use el explorador de proyecto para seleccionar una ventana! + ¡Por favor, use el explorador de proyecto para seleccionar una ventana! - QtiPlot - index.html File Not Found! - QtiPlot - Archivo No Encontrado index.html + QtiPlot - Archivo No Encontrado index.html - There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! - No hay ningún archivo llamado <b>index.html</b> en esta carpeta.<br>¡Por favor, elija otra carpeta! + No hay ningún archivo llamado <b>index.html</b> en esta carpeta.<br>¡Por favor, elija otra carpeta! Print @@ -2429,28 +3907,18 @@ &Coord - - - - Box Caja - - - Frame Marco - &Frame &Marco - - No Axes Sin Ejes @@ -2511,52 +3979,30 @@ Estilo de Gráfica - - - - Wireframe Esqueleto - - Hidden Line Línea Oculta - - Polygon only Sólo polígonos - - Mesh & filled Polygons Mallar polígonos llenos - - - - Dots Puntos - - - - Bars Barras - - - - Cones Conos @@ -2569,121 +4015,88 @@ Estilo de Suelo - - Floor Data Projection Proyección de Datos en el Suelo - - Floor Isolines Isolíneas del Suelo - - Empty Floor Suelo Vacío - QtiPlot - Guess best origin for the new layer? - QtiPlot - ¿Buscar origen óptimo para la capa nueva? + QtiPlot - ¿Buscar origen óptimo para la capa nueva? - Do you want QtiPlot to guess the best position for the new layer? Warning: this will rearrange existing layers! - ¿Quiere que QtiPlot busque el origen óptimo para la capa nueva? + ¿Quiere que QtiPlot busque el origen óptimo para la capa nueva? ¡Atención: esto reorganizará las capas existentes! - &Guess - Adivinar + Adivinar - &Top-left corner - Esquina superior izquierda + Esquina superior izquierda - - - New &Project - Nuevo &Proyecto + Nuevo &Proyecto - - Ctrl+N - Ctrl+N + Ctrl+N - - New &Table - Nueva &Tabla + Nueva &Tabla - - Ctrl+T - Ctrl+T + Ctrl+T New spreadsheet Nueva hoja de cálculo - - New &Matrix - Nueva &Matriz + Nueva &Matriz - New matrix Nueva matriz - - New &Function Plot - Nueva Gráfica de &Función + Nueva Gráfica de &Función - - Ctrl+F - Ctrl+F + Ctrl+F New &Surface 3D Plot Nueva &Superficie 3D - - Ctrl+Z - Ctrl+Z + Ctrl+Z - - &Open - Abrir + Abrir - - Ctrl+O - Ctrl+O + Ctrl+O - Open project Abrir proyecto @@ -2692,26 +4105,20 @@ Abrir archivo de imagen - - Ctrl+I - Ctrl+I + Ctrl+I Import &image... Importar &imagen... - - &Save Project - &Guardar Proyecto + &Guardar Proyecto - - Ctrl+S - Ctrl+S + Ctrl+S Save Project &as... @@ -2734,35 +4141,26 @@ Importar múltiples archivos de datos - - &Undo - Deshacer + Deshacer - - Ctrl+U Ctrl+U - - &Redo - &Rehacer + &Rehacer Ctrl+R - Ctrl+R + Ctrl+R - - &Duplicate - &Duplicar + &Duplicar - Duplicate window Duplicar ventana @@ -2771,30 +4169,24 @@ Cor&tar selección - - Ctrl+X - Ctrl+X + Ctrl+X &Copy selection &Copiar selección - - Ctrl+C - Ctrl+C + Ctrl+C &Paste selection &Pegar selección - - Ctrl+V - Ctrl+V + Ctrl+V &Delete selection @@ -2809,18 +4201,14 @@ &Explorador de proyecto - - Ctrl+E - Ctrl+E + Ctrl+E - Show project explorer Mostrar explorador de proyecto - Results &Log Registro de Resultados @@ -2829,51 +4217,36 @@ Mostrar resultados del cálculo - - Add La&yer - Añadir Capa + Añadir Capa - - &Current - A&ctual + A&ctual - - Ctrl+G - Ctrl+G + Ctrl+G - Export current graph Exportar gráfica actual - - Alt+X - Alt+X + Alt+X - Export all graphs Exportar todas las gráficas - - - &Print - Im&primir + Im&primir - - Ctrl+P - Ctrl+P + Ctrl+P Print graph @@ -2884,26 +4257,20 @@ Imprimir Tod&as las Gráficas - - E&xport ASCII - E&xportar ASCII + E&xportar ASCII Set import &options Configurar &opciones de importación - - &Quit - &Quitar + &Quitar - - Ctrl+Q - Ctrl+Q + Ctrl+Q Clear &log information @@ -2914,23 +4281,18 @@ Asistente de Gráfica - - Ctrl+Alt+W - Ctrl+Alt+W + Ctrl+Alt+W - - &Preferences... - &Preferencias... + &Preferencias... &Add/Remove curve & Añadir/Quitar curva - Add curve to graph Añadir curva a gráfica @@ -2939,58 +4301,42 @@ Añadir Barras de &Error - - Ctrl+B - Ctrl+B + Ctrl+B Add &function curve Añadir &curva de función - - - - Ctrl+Alt+F - Ctrl+Alt+F + Ctrl+Alt+F &Rescale to show all &Reescalar para mostrar todo - Best fit Reescalar para mostrar todo - - New &Legend - Nueva &Leyenda + Nueva &Leyenda - - Ctrl+L - Ctrl+L + Ctrl+L - Add new legend Añadir nueva leyenda - - Add &Image - Añadir &Imagen + Añadir &Imagen - - Add &Text Añadir &Texto @@ -2999,32 +4345,24 @@ &Dibujar flecha/línea - - &Line - &Línea + &Línea Plot with line Dibujar con línea - - - - &Scatter - Di&spersión + Di&spersión Plot with symbols Dibujar con símbolos - - Line + S&ymbol - Línea + Símbolo + Línea + Símbolo Plot with line + symbols @@ -3035,119 +4373,84 @@ Líneas Verticales - - &Spline - Suavizado + Suavizado - - &Vertical Steps - Escalones &Verticales + Escalones &Verticales - - - - &Columns - &Columnas + &Columnas - Plot with vertical bars Dibujar con barras verticales - - &Rows - Filas + Filas - Plot with horizontal bars Dibujar con barras horizontales - - &Area - Área + Área - Plot area Dibujar área - - &Pie - Porciones + Porciones - Plot pie Dibujar con porciones - &Vectors &XYXY - &Vectores &XYXY + &Vectores &XYXY - - &Histogram - &Histograma + &Histograma - - &Stacked Histogram - Hi&stograma apilado + Hi&stograma apilado - - &Vertical 2 Layers - &2 capas &verticales + &2 capas &verticales - - &Horizontal 2 Layers - 2 capas &horizontales + 2 capas &horizontales - - &4 Layers - &4 capas + &4 capas - - &Stacked Layers - &Capas Apiladas + &Capas Apiladas - - &Ribbon - &Cinta + &Cinta Plot 3D Ribbon Gráfica Cinta 3D - - &Bars - &Barras + &Barras Plot 3D Bars @@ -3158,46 +4461,34 @@ Gráfica Dispersión 3D - - &Trajectory - &Trayectoria + &Trayectoria Plot 3D Trajectory Gráfica Trayectoria 3D - - Ctrl+M - Ctrl+M + Ctrl+M - - Alt+R - Alt+R + Alt+R - - Statistics on &Columns - Estadísticas de &Columna + Estadísticas de &Columna - Selected columns statistics Estadísticas de columnas seleccionadas - - Statistics on &Rows - Estadísticas de &Fila + Estadísticas de &Fila - Selected rows statistics Estadísticas de filas seleccionadas @@ -3206,262 +4497,180 @@ &Integrar ... - - &Differentiate - &Derivar + &Derivar - - Fit &Linear - Ajuste &Lineal + Ajuste &Lineal - - Fit &Polynomial ... - Ajuste &Polinomial ... + Ajuste &Polinomial ... - - &First Order ... - &Primer Orden ... + &Primer Orden ... - - &Second Order ... - &Segundo Orden ... + &Segundo Orden ... - - &Third Order ... - &Tercer Orden ... + &Tercer Orden ... - - Fit &Gaussian - Ajuste &Gaussiano + Ajuste &Gaussiano - - Fit Lorent&zian - Ajuste Loren&ziano + Ajuste Loren&ziano &Non-linear Curve Fit ... Ajuste &No Lineal ... - - Ctrl+Y - Ctrl+Y + Ctrl+Y - - &Plot ... - &Dibujar ... + &Dibujar ... - - &Title ... - &Título ... + &Título ... - - &Columns... - &Columnas ... + &Columnas ... - - &Rows... - &Filas ... + &Filas ... &About &Acerca de - - F1 - F1 + F1 - - Ctrl+H - Ctrl+H + Ctrl+H &Choose help folder... Elegir &carpeta de ayuda ... - - - &Rename Window - &Renombrar Ventana + &Renombrar Ventana - - - Close &Window - Cerrar &Ventana + Cerrar &Ventana - - Ctrl+W - Ctrl+W + Ctrl+W Add column Añadir columna - - Window &Geometry... - &Geometría de Ventanas ... + &Geometría de Ventanas ... - - - - &Hide Window - &Esconder Ventana + &Esconder Ventana - - More windows... - Más ventanas ... + Más ventanas ... &Intensity table Tabla de &Intensidad - - &Activate Window - &Activar Ventana + &Activar Ventana - - Mi&nimize Window - Mi&nimizar Ventana + Mi&nimizar Ventana - - Ma&ximize Window - Ma&ximizar Ventana + Ma&ximizar Ventana - - Re&size Window... - Redimen&sionar Ventana ... + Redimen&sionar Ventana ... - &Print Window - Im&primir Ventana + Im&primir Ventana &Layer geometry &Geometría de Capa - - Set &Properties... - Fijar &Propiedades ... + Fijar &Propiedades ... - - Set &Dimensions... - Fijar &Dimensiones ... + Fijar &Dimensiones ... - - Set &Values... - Fijar &Valores ... + Fijar &Valores ... - - &Transpose - &Transponer + &Transponer - - &Invert - &Invertir + &Invertir - - &Determinant - &Determinante + &Determinante &Convert to spreadsheet &Convertir a tabla - - 3D &Wire Frame - Es&queleto 3D + Es&queleto 3D - - 3D &Hidden Line - Línea &Oculta 3D + Línea &Oculta 3D - - 3D &Polygons - &Polígonos 3D + &Polígonos 3D - - 3D Wire &Surface - &Superficie de Hilos 3D + &Superficie de Hilos 3D - - - - - - - QtiPlot - File openning error - QtiPlot - Error de apertura de archivo + QtiPlot - Error de apertura de archivo The file: <b> %1 </b> doesn't exist! @@ -3472,53 +4681,26 @@ QtiPlot - Explorador de Proyecto - - Name Nombre - - - - - - - - - Type Tipo - - View Ver - - - - - Size Tamaño - - - - - - Created Creado - - - Label Etiqueta @@ -3527,13 +4709,10 @@ QtiPlot - Registro de Resultados - Disable &tools Desactivar herramien&tas - - &Zoom &Zoom @@ -3546,13 +4725,10 @@ Lector de &datos - - CTRL+D CTRL+D - Data reader Lector de datos @@ -3561,8 +4737,6 @@ &Seleccionar rango de datos - - ALT+S ALT+S @@ -3571,31 +4745,22 @@ Lector de &pantalla - Screen reader Lector de pantalla - - &Move Data Points... &Mover Puntos ... - - Remove &Bad Data Points... Quitar Puntos &Malos ... - - Alt+B Alt+B - - ALT+T ALT+T @@ -3604,23 +4769,18 @@ Dibujar Flech&a/Línea - - CTRL+ALT+L CTRL+ALT+L - &Translate - &Traducir + &Traducir - &Smooth &Suavizar - &FFT filter Filtro &FFT @@ -3633,9 +4793,6 @@ &Llenar columnas con - - - &Table &Tabla @@ -3644,36 +4801,18 @@ Gráfica 3&D - - - &Plot &Gráfica - - - &Normalize &Normalizar - - - - - - - QtiPlot - Plot error QtiPlot - Error de dibujado - - - - - You must select exactly one column for plotting! ¡Debe seleccionar una única columna para dibujar! @@ -3690,140 +4829,88 @@ Título del Eje X - - - Please select a Y column to plot! ¡Seleccione una columna Y para dibujar! - - - - - - - - - - This functionality is not available for pie plots! ¡Esta funcionalidad no está disponible para gráficos de porciones! - The selected columns have different numbers of rows! ¡Las columnas seleccionadas tienen número diferente de filas! - The selected error column is empty! ¡La columna de error seleccionada está vacía! - - The file: <b> %1 </b> was not created using QtiPlot! - ¡El archivo <b> %1 </b> no fue creado usando QtiPlot! + ¡El archivo <b> %1 </b> no fue creado usando QtiPlot! QtiPlot - Open Project QtiPlot - Abrir Proyecto - The file: <b>%1</b> is the current file! - ¡El archivo <b> %1 </b> es el archivo actual! + ¡El archivo <b> %1 </b> es el archivo actual! - - - - The file: <b>%1</b> doesn't exist! - ¡El archivo <b> %1 </b> no existe! + ¡El archivo <b> %1 </b> no existe! - The file: <b>%1</b> is not a QtiPlot or Origin project file! ¡El archivo <b> %1 </b> no es un proyecto de Origin o QtiPlot! - The file: <b> %1 </b> <p>does not exist anymore!<p>It will be removed from the list. - ¡El archivo <b> %1 </b> <p> ya no existe!<p>Será eliminado de la lista. + ¡El archivo <b> %1 </b> <p> ya no existe!<p>Será eliminado de la lista. The file: <b> %1 </b> is the current file! ¡El archivo <b> %1 </b> es el archivo actual! - - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - No se pudo escribir en el archivo <br><h4> %1 </h4><p>¡Por favor, verifique que tiene permiso de escritura! + No se pudo escribir en el archivo <br><h4> %1 </h4><p>¡Por favor, verifique que tiene permiso de escritura! - Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! - No se pudo escribir en el archivo <br><h4> %1 </h4><p>¡Por favor, verifique que tiene permiso de escritura! + No se pudo escribir en el archivo <br><h4> %1 </h4><p>¡Por favor, verifique que tiene permiso de escritura! Choose a directory to export the tables to Escoja un directorio al que exportar las tablas - Choose a filename to save under - Escoja el nombre del archivo en que guardar + Escoja el nombre del archivo en que guardar - QtiPlot - Enter rows number - QtiPlot - Introduzca el número de filas + QtiPlot - Introduzca el número de filas - Rows - Filas + Filas - QtiPlot - Enter columns number - QtiPlot - Introduzca el número de columnas + QtiPlot - Introduzca el número de columnas - Columns - Columnas + Columnas - - - - - - - - - - - - QtiPlot - Column selection error QtiPlot - Error de selección de columna - - - - - Please select a column first! - ¡Por favor, seleccione una columna primero! + ¡Por favor, seleccione una columna primero! Line + s&ymbol @@ -3850,20 +4937,12 @@ Histogramas Apilado&s - - - - - - Cu&t - Cor&tar + Cor&tar - - Past&e - P&egar + P&egar None @@ -3882,42 +4961,32 @@ Llenar colum&na con - &Column - &Columna + &Columna - - - - Clea&r - Limpia&r + Limpia&r - - &Insert - &Insertar + &Insertar &Add column &Añadir columna - &Ascending - &Ascendente + &Ascendente - &Descending - &Descendente + &Descendente - Sort Colu&mn - Ordenar Colu&mna + Ordenar Colu&mna Pr&operties @@ -3928,28 +4997,20 @@ Vectores &XYXY - - - - &Paste - &Pegar + &Pegar - Clea&r Row - Limpia&r Fila + Limpia&r Fila - &Delete Row - Eliminar Fila + Eliminar Fila - - &Worksheet - &Hoja de Trabajo + &Hoja de Trabajo QtiPlot - Empty plot @@ -3960,51 +5021,24 @@ ¡En realidad no hay curvas en la capa activa! - - - - - - - - - - - - - - - - - - QtiPlot QtiPlot - - This will modify the data in the worksheets! Are you sure you want to continue? - ¡Esto modificará los datos en las tablas! + ¡Esto modificará los datos en las tablas! ¿Seguro que quiere continuar? - - Continue - Continuar + Continuar - - - Cancel - Cancelar + Cancelar - - There are no curves available on this plot! ¡No hay curvas disponibles en esta gráfica! @@ -4013,44 +5047,36 @@ ¡Haga click en la gráfica o mueva el cursor para mostrar las coordenadas! - There are no plot layers available in this window! - ¡No hay capas gráficas disponibles en esta ventana! + ¡No hay capas gráficas disponibles en esta ventana! Click on plot to display information! ¡Haga click en la gráfica para mostrar la información! - There are no plot layers available in this window. - No hay capas gráficas disponibles en esta ventana. + No hay capas gráficas disponibles en esta ventana. - Hidden Oculto - - Maximized - Maximizada + Maximizada - Minimized - Minimizada + Minimizada - &Cascade - &Cascada + &Cascada - &Tile - Mosai&co + Mosai&co &Next @@ -4061,34 +5087,24 @@ &Previa - - - - &Properties... - &Propiedades... + &Propiedades... - Save changes to project: <p><b> %1 </b> ? - ¿Guardar cambios del proyecto: <p><b>%1</b>? + ¿Guardar cambios del proyecto: <p><b>%1</b>? - - Yes - + - - No - No + No - &Delete Window - Eliminar Ventana + Eliminar Ventana D&epending Plots @@ -4099,16 +5115,12 @@ Gráficas 3D D&ependientes - - - D&epends on - D&epende de + D&epende de - Function - Función + Función Re&move pie curve @@ -4135,104 +5147,80 @@ &Pegar imagen - - - &Layer - &Capa + &Capa - - - &Window - &Ventana + &Ventana - E&xport - E&xportar + E&xportar &Geometry... &Geometría... - P&roperties... - P&ropiedades... + P&ropiedades... &Delete Layer Eliminar Capa - - &Paste Layer - &Pegar Capa + &Pegar Capa - &Copy Page - &Copiar Página + &Copiar Página - E&xport Page - E&xportar Página + E&xportar Página - Clea&r Rows - Vacia&r Fila + Vacia&r Fila - - &Delete Rows - &Borrar Filas + &Borrar Filas &Plot 3D &Gráfica 3D - &Matrix... - &Matriz... + &Matriz... - Choose &Data Set... - Elegir Conjunto de &Datos... + Elegir Conjunto de &Datos... - Choose &Matrix... - Elegir &Matriz... + Elegir &Matriz... - C&lear - Vac&iar + Vac&iar - &Copy Graph - &Copiar Gráfica + &Copiar Gráfica - &Export - &Exportar + &Exportar - - - QtiPlot - Help Files Not Found! - QtiPlot - ¡No se encontraron archivos de ayuda! + QtiPlot - ¡No se encontraron archivos de ayuda! Please indicate the location of the help file!<br><br><p>The manual can be downloaded from the following internet address:</p><p><font color=blue>'http://soft.proindependent.com/manuals.html'</font></p> @@ -4243,9 +5231,8 @@ QtiPlot - Navegador de Ayuda - QtiPlot - Edit function - QtiPlot - Editar función + QtiPlot - Editar función Curve: @@ -4256,273 +5243,194 @@ Importar i&magen... - - ALT+L - ALT+L + ALT+L - - Arran&ge Layers - Or&ganizar Capas + Or&ganizar Capas ALT+A ALT+A - - Print All Plo&ts - Imprimir &todas las Gráficas + Imprimir &todas las Gráficas Delete &fit tables Borrar tablas de a&juste - - Add/Remove &Curve... - Añadir/Quitar &Curva... + Añadir/Quitar &Curva... - - ALT+C - ALT+C + ALT+C - - Add &Error Bars... - Añadir Barras de &Error... + Añadir Barras de &Error... - - Add &Function... - Añadir &Función... + Añadir &Función... Add time stamp Añadir sello de tiempo - - Ctrl+ALT+T - Ctrl+ALT+T + Ctrl+ALT+T Date & Time Hora &y Fecha - - ALT+I - ALT+I + ALT+I - - Inte&rpolate ... - Inte&rpolar... + Inte&rpolar... - - &Low Pass... - Pasa &Baja... + Pasa &Baja... - - &High Pass... - Pasa &Alta... + Pasa &Alta... - - &Band Pass... - Pasa &Banda... + Pasa &Banda... - - &Band Block... - Bloquear &Banda... + Bloquear &Banda... - - &FFT... - &FFT... + &FFT... - - &Savitzky-Golay... - &Savitzky-Golay... + &Savitzky-Golay... - - &FFT Filter... - Filtro &FFT... + Filtro &FFT... - - Moving Window &Average... - Promedio de Vent&ana Móvil... + Promedio de Vent&ana Móvil... - - Fit Exponential Gro&wth ... - Ajustar a Crecimiento E&xponencial... + Ajustar a Crecimiento E&xponencial... - - &Axes... - &Ejes... + &Ejes... - - &Grid ... - &Malla ... + &Malla ... - - Column &Options ... - &Opciones de Columna... + &Opciones de Columna... - - Set Column &Values ... - Fijar &Valores de las Columnas... + Fijar &Valores de las Columnas... - - &Remove Layer - Quita&r Capa + Quita&r Capa Edit 3D &Surface Editar &Superficie 3D - - &Surface... - &Superficie... + &Superficie... - - &Data Set... - Conjunto de &Datos... + Conjunto de &Datos... Convert to &matrix Convertir en &matriz - - Sort Ta&ble - Ordenar Ta&bla + Ordenar Ta&bla - - Sort Columns - Ordenar Columnas + Ordenar Columnas - - Co&rrelate - Co&rrelacionar + Co&rrelacionar - - &Convolute - &Convolucionar + &Convolucionar - - &Deconvolute - &Deconvolucionar + &Deconvolucionar - - &Horizontal - &Horizontal + &Horizontal - - &Vertical - &Vertical + &Vertical - - Ro&w Numbers - Números de &Fila + Números de &Fila &Random values Valores Aleato&rios - - &None - &Ninguno + &Ninguno - - &Box Plot - Gráfica de &Caja + Gráfica de &Caja - Fit &Multi-peak Ajustar &Multipicos - - &Gaussian... - &Gaussiana... + &Gaussiana... - - &Lorentzian... - &Lorentziana... + &Lorentziana... - QtiPlot - Enter the number of peaks QtiPlot - Introduzca el número de picos - Peaks Picos @@ -4539,8 +5447,6 @@ <b> %1 </b>: ¡Opción de línea de comandos desconocida o el archivo no existe! - - QtiPlot - untitled QtiPlot - sin título @@ -4549,20 +5455,16 @@ Bu&scar Actualizaciones - - &QtiPlot Homepage - Página de Inicio de &QtiPlot + Página de Inicio de &QtiPlot Download &manual Descargar &manual - - &Translations - &Traducciones + &Traducciones Make a &donation @@ -4573,57 +5475,46 @@ A&sistencia Técnica - Open a new project Abrir un nuevo proyecto - Create a new 2D function plot Crear una nueva gráfica 2D de función - Create a new 3D surface plot Crear una nueva gráfica 3D - Undo changes Deshacer cambios - Redo changes Rehacer cambios - Cut selection Cortar selección - Copy selection Copiar selección - Paste selection Pegar selección - Delete selection Borrar selección - English Español - There are no available columns with plot designation set to Z! ¡No hay columnas disponibles designadas como Z! @@ -4632,14 +5523,12 @@ Gráfica 3D - Determinant of Determinante de - QtiPlot - Open Template File - QtiPlot - Abrir Archivo de Plantilla + QtiPlot - Abrir Archivo de Plantilla graph1 @@ -4654,39 +5543,32 @@ Matriz1 - The file: <b>%1</b> is not a QtiPlot template file! - ¡El archivo: <b>%1</b> no es un archivo de plantilla de QtiPlot! + ¡El archivo: <b>%1</b> no es un archivo de plantilla de QtiPlot! - Save Window As Template - Guardar Ventana como Plantilla + Guardar Ventana como Plantilla There are actually no curves on the active layer! ¡No hay curvas en la capa activa! - - &Insert Row - &Insertar Fila + &Insertar Fila - &Insert Column - &Insertar Columna + &Insertar Columna - &Delete Columns - Eliminar Columnas + Eliminar Columnas - Open Temp&late... - Abrir P&lantilla... + Abrir P&lantilla... Save as &Template... @@ -4697,16 +5579,12 @@ &Curvas... - - &Scales... - E&scalas... + E&scalas... - - &About QtiPlot - &Acerca de QtiPlot + &Acerca de QtiPlot New Table @@ -4717,7 +5595,6 @@ Guardar Proyecto - Open Te&mplate... Abrir Pla&ntilla... @@ -4730,12 +5607,10 @@ Guardar Ventana como Plantilla - &Vectors XYXY &Vectores XYXY - Vectors XYXY Vectores XYXY @@ -4748,73 +5623,48 @@ Gráfica de Caja y Barbas - <b> %1 </b>: Wrong locale option or no translation available! <b> %1 </b>: ¡Opciones regionales equivocadas o traducción no disponible! - - Edit Editar - - Ctrl+ALT+M Ctrl+ALT+M - - Project Explorer Explorador de Proyecto - - Results Log Hoja de Resultados - - Note Nota - - - - - - - - QtiPlot - File opening error - QtiPlot - Error de apertura de archivo + QtiPlot - Error de apertura de archivo - The file <b>%1</b> is corrupted, but there exists a backup copy.<br>Do you want to open the backup instead? - El archivo <b>%1</b> está corrupto, pero existe una copia de seguridad.<br>¿Desea abrir la copia en su lugar? + El archivo <b>%1</b> está corrupto, pero existe una copia de seguridad.<br>¿Desea abrir la copia en su lugar? - QtiPlot - Opening file - QtiPlot - Abriendo archivo + QtiPlot - Abriendo archivo - - QtiPlot project - Proyecto de QtiPlot + Proyecto de QtiPlot - - Compressed QtiPlot project - Proyecto de QtiPlot comprimido + Proyecto de QtiPlot comprimido Origin project @@ -4829,38 +5679,32 @@ QtiPlot - Error de Copia de Seguridad - Cannot make a backup copy of <b>%1</b> (to %2).<br>If you ignore this, you run the risk of <b>data loss</b>. No se puede hacer la copia de seguridad de <b>%1</b> (a %2). <br>Si ignora esto corre el riesgo de <b>perder datos</b>. - The file: <br><b>%1</b> is opened in read-only mode El archivo: <br><b>%1</b> está abierto en modo de sólo lectura - Save Project As - Guardar Proyecto Como + Guardar Proyecto Como - QtiPlot Matrix Template - Plantilla de Matriz de QtiPlot + Plantilla de Matriz de QtiPlot QtiPlot 2D Plot Template Plantilla de Gráfica 2D de QtiPlot - QtiPlot Table Template - Plantilla de Tabla de QtiPlot + Plantilla de Tabla de QtiPlot - QtiPlot 3D Surface Template - Plantilla de Superficie 3D de QtiPlot + Plantilla de Superficie 3D de QtiPlot QtiPlot - X Axis Title @@ -4879,64 +5723,46 @@ QtiPlot - Título del Eje Superior - - New &Graph - Nueva &Gráfica + Nueva &Gráfica - - New &Note - Nueva &Nota + Nueva &Nota - - Ctrl+ALT+Z - Ctrl+ALT+Z + Ctrl+ALT+Z - - Vectors XY&AM - Vectores XY&AM + Vectores XY&AM - - Fit &Boltzmann (Sigmoidal) - Ajustar &Boltzmann (Sigmoidal) + Ajustar &Boltzmann (Sigmoidal) - Create an empty 2D plot Crear un gráfico 2D vacío - Create an empty note window Crear una ventana de notas vacía - Print window Imprimir ventana - Vectors XYAM Vectores XYAM - - - Folder Carpeta - UNTITLED SIN TITULO @@ -4949,8 +5775,6 @@ intensidad de píxels (u. a.) - - The table '%1' already exists. It has been renamed '%2'. La tabla '%1' ya existe. Ha sido renombrada '%2'. @@ -4959,25 +5783,18 @@ La matriz '%1' ya existe. Ha sido renombrada '%2'. - - Please enter a valid name! - ¡Por favor, introduzca un nombre válido! + ¡Por favor, introduzca un nombre válido! - The name you chose is not valid: only letters and digits are allowed! - ¡El nombre escogido no es válido: sólo cifras y letras están permitidos! + ¡El nombre escogido no es válido: sólo cifras y letras están permitidos! - - - Please choose another name! - ¡Por favor, escoja otro nombre! + ¡Por favor, escoja otro nombre! - Name already exists! ¡El nombre ya no existe! @@ -4986,28 +5803,20 @@ ¡El nombre de la tabla debe ser diferente de los nombres de las columnas! - - - &Delete Selection - Borrar selección + Borrar selección - - New &Window - Nueva Ventana + Nueva Ventana - - New F&older - Nueva Carpeta + Nueva Carpeta - Auto &Column Width - Anchura de Columna Automática + Anchura de Columna Automática Key_Delete @@ -5022,67 +5831,38 @@ ¡Lo siento, QtiPlot no pudo iniciar el navegador por defecto! Por favor, inicie el navegador manualmente y visite el siguiente link - - Scripting Console Consola de Programación - - - - - - - - - - - - - - Graph Gráfica - - &Zoom In Aumentar &Zoom - - Ctrl++ Ctrl++ - Zoom &Out Disminuir Zoom - - Ctrl+- Ctrl+- - - Draw &Arrow Dibuj&ar Flecha - - CTRL+ALT+A CTRL+ALT+A - - Draw &Line Dibujar &Línea @@ -5099,20 +5879,14 @@ Esta operación no puede ser realizada en curvas dibujadas a partir de columnas con un formato no numérico. - <h4>There are no matrices available in this project.</h4><p><h4>Please create a matrix and try again!</h4> <h4>No existen matrices disponibles en este proyecto.</h4><p><h4>¡Por favor, cree una matriz he inténtelo de nuevo!</h4> - - QtiPlot - Renamed Window QtiPlot - Ventana Renombrada - - - Notes Notas @@ -5121,7 +5895,6 @@ Texto - Data Datos @@ -5134,39 +5907,34 @@ QtiPlot - Importar Archivo ASCII - The file "%1" was created using "%2" as scripting language. Initializing support for this language FAILED; I'm using "%3" instead. Various parts of this file may not be displayed as expected. - El archivo "%1" fue creado usando "%2" como lenguaje de programación. + El archivo "%1" fue creado usando "%2" como lenguaje de programación. La inicialización del soporte para este lenguaje FALLÓ; Estoy usando "%3" en su lugar. Varias partes de este archivo pueden no mostrarse como se esperaba. - Window - Ventana + Ventana - QtiPlot - Scripting Error - QtiPlot - Error de Programación + QtiPlot - Error de Programación - Scripting language "%1" failed to initialize. - Falló la inicialización del lenguaje de programación "%1". + Falló la inicialización del lenguaje de programación "%1". Get existing directory Obtener directorio existente - Choose a directory to export the graphs to - Elija un directorio al que exportar las gráficas + Elija un directorio al que exportar las gráficas Python Source @@ -5181,19 +5949,16 @@ Guardar las Notas Como... - QtiPlot 2D Graph Template - Plantilla para Gráfica 2D de QtiPlot + Plantilla para Gráfica 2D de QtiPlot - QtiPlot - Row selection error - QtiPlot - Error de selección de fila + QtiPlot - Error de selección de fila - Please select a row first! - ¡Por favor, seleccione una fila primero! + ¡Por favor, seleccione una fila primero! X @@ -5216,69 +5981,56 @@ Y Error - - &Edit Function... - &Editar Función... + &Editar Función... - - &Plot details... - Detalles de la Gráfica... + Detalles de la Gráfica... Click on data point to display information! ¡Haga click en un punto para mostrar la información! - Images Imágenes - QtiPlot - Insert image from file - QtiPlot - Insertar imagen desde archivo + QtiPlot - Insertar imagen desde archivo - Empty 3D surface plots cannot be duplicated! - ¡Las gráficas de superficies 3D vacías no pueden ser duplicadas! + ¡Las gráficas de superficies 3D vacías no pueden ser duplicadas! - D&epending Graphs - Gráficas D&ependientes + Gráficas D&ependientes - D&epending 3D Graphs - Gráficas 3D D&ependientes + Gráficas 3D D&ependientes &Graph 3D &Gráfica 3D - Choose the location of the QtiPlot help folder! - ¡Escoja la ubicación de la carpeta de ayuda de QtiPlot! + ¡Escoja la ubicación de la carpeta de ayuda de QtiPlot! - Open File Abrir Archivo - QtiPlot - Set the number of pixels to average - QtiPlot - Seleccione el número de pixels a promediar + QtiPlot - Seleccione el número de pixels a promediar - Number of averaged pixels - Número de pixels promediados + Número de pixels promediados Scripting &Console @@ -5293,167 +6045,883 @@ Alt+F4 - - - Ctrl+Shift+R - Ctrl+Shift+R + Ctrl+Shift+R - - Ctrl+Alt+O - Ctrl+Alt+O + Ctrl+Alt+O - - Recalculate - Recalcular + Recalcular - - - - Ctrl+Return - Ctrl+Return + Ctrl+Return - - &Go to Row... - Ir a fila... + Ir a fila... - - - - Ctrl+Alt+G - Ctrl+Alt+G + Ctrl+Alt+G - - Clear - Limpiar + Limpiar - - - &X - &X - - - - - + &X + + + Couldn't open file %1 + + + + File %1 contains only %2 sheets! + + + + Open Excel File + + + + Imported sound file + + + + This is not a PCM type WAV file, operation aborted! + + + + PCM + + + + Channels + + + + Sample Rate + + + + Byte Rate + + + + Block Align + + + + Bits Per Sample + + + + You don't have the permission to open this file: <b>%1</b> + + + + Script Error + + + + Table1 + + + + Presentation Preview + + + + &Save + + + + Output format: + + + + Directory: + + + + There are no plot layers available in window <b>%1</b>.<br>Graph window not exported! + + + + QtiPlot - Overwrite file? + + + + QtiPlot - Export error + + + + QtiPlot - Delete rows + + + + Start row + + + + End row + + + + Please select exactly one columns for this operation! + + + &Y - &Y + &Y - - - &Z - &Z + &Z - - - X E&rror - X E&rror + X E&rror - - - Y &Error - Y &Error - - - - + Y &Error + + + Set As + + + + &Fill Column With + + + + You need to select at least one Y column for this operation! + + + + Y2 Axis Title + + + + Paste Selection as Te&xt + + + + Set Display Range + + + + Could not write to file: <h4>%1</h4><p>Please verify that you have the right to write to this location or that the file is not being used by another application! + + + + Print preview of window: + + + + Please select a 'Y' column first! + + + + There are no layers available on this plot. Operation aborted! + + + + There are no windows available in this folder! + + + + Released + + + + Vie&w + + + + &Palette + + + + &Convert to Spreadsheet + + + + Export + + + + &Folders + + + + &View Pixel Line profile + + + + Re&move Pie Curve + + + + Anal&yze + + + + &Indexed Colors + + + + Pale&tte + + + + &Paste Text + + + + &Paste Tex Formula + + + + &Paste Image + + + + &Paste Rectangle + + + + &Paste Ellipse + + + + &Paste Line/Arrow + + + + The manual can be downloaded from the following internet address: + + + + The assistant could not start because the file <b>%1</b> was not found in the help file directory! + + + + This file is provided with the QtiPlot manual which can be downloaded from the following internet address: + + + + Please indicate the location of the help file! + + + + You must have more than one layer in the active window! + + + + You must have more than one dataset in the active layer! + + + + Integration of %1 from zero is + + + + Integration of %1 + + + + Linear Regression of %1 + + + + Slope + + + + Intercept + + + + Chi^2 + + + + Add &Custom Script Action... + + + + New 3D &Surface Plot + + + + Ctrl+Shift+E + + + + Open ODF Spreads&heet... + + + + Import I&mage... + + + + Ctrl+Shift+S + + + + Save As &Template... + + + + Save Note As... + + + + &Import ASCII... + + + + &Sound (WAV)... + + + + Ctrl+Alt+D + + + + Cu&t Selection + + + + &Copy Selection + + + + &Paste Selection + + + + Shift+A + + + + Create Open &Document Presentation... + + + + &Export PDF + + + + Ctrl+Alt+P + + + + Clear &Log Information + + + + Delete &Fit Tables + + + + Plot &Wizard + + + + &Rescale to Show All + + + + Zoom &In/Out and Drag Canvas + + + + Zoom/Drag Canvas &Horizontally + + + + Zoom/Drag Canvas &Vertically + + + + Add Time Stamp + + + + Vertical &Drop Lines + + + + Stack &Bar + + + + Stack &Column + + + + Stem-and-&Leaf Plot + + + + D&ouble-Y + + + + &Waterfall Plot + + + + E&xtract to Graphs + + + + Extract to &Layers + + + + Add Inset Layer + + + + Integr&ate Function... + + + + &Lowess... + + + + Fit Slop&e + + + + Fit &Wizard... + + + + &Hide Selected + + + + Sho&w All Columns + + + + &Swap columns + + + + Move &Right + + + + Move &Left + + + + Move to F&irst + + + + Move to Las&t + + + + Ad&just Column Width + + + + &Delete Rows Interval... + + + + &Upward + + + + &Downward + + + + &Choose Help Folder... + + + + Add Column + + + + Go to Colum&n... + + + + Ctrl+Alt+C + + + + Ctrl+Alt+H + + + + &View Pixel Line Profile + + + + &Intensity Table + + + + Ctrl+D + + + + &Image Plot + + + + &Image Profiles + + + + Flip &V + + + + Ctrl+Shift+V + + + + Flip &H + + + + Ctrl+Shift+H + + + + R&otate 90 + + + + Rotate &-90 + + + + Ctrl+Alt+R + + + + &Image mode + + + + Ctrl+Shift+I + + + + &Data mode + + + + Ctrl+Shift+D + + + + Show &X/Y + + + + Ctrl+Shift+X + + + + Show &Column/Row + + + + Ctrl+Shift+C + + + + &Default + + + + &Rainbow + + + + &Custom + + + + &Export Image ... + + + + &Direct + + + + &XYZ Columns + + + + &YXZ Columns + + + + &Forward FFT + + + + &Inverse FFT + + + + 2D &Binning + + + + &Regular XYZ + + + + &Autocorrelate + + + + &Random Values + + + + &Frequency Count ... + + + + &Read Only + + + + &Disregard + + + Search for &Updates - B&uscar Actualizaciones - - - - + B&uscar Actualizaciones + + + QtiPlot &Forums + + + + Report a &Bug + + + + Download &Manual + + + + Make a &Donation + + + + Technical &Support + + + Scripting &language - &Lenguaje de Programación + &Lenguaje de Programación - - &Restart scripting - &Reiniciar programación + &Reiniciar programación - - E&xecute - Ejecutar + Ejecutar - - Ctrl+J - Ctrl+J + Ctrl+J - - Execute &All - Ejecut&ar Todo + Ejecut&ar Todo - - Ctrl+Shift+J - Ctrl+Shift+J + Ctrl+Shift+J - - &Evaluate Expression - &Evaluar Expresión + &Evaluar Expresión + + + Open ODF Spreadsheet + + + + Zoom In/Out and Drag Canvas Horizontally + + + + Zoom In/Out and Drag Canvas Vertically + + + + can be any .qti, qti.gz, .ods, .opj, .ogm, .ogw, .ogg, .py, .xls or ASCII file + + + + Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. + + + + If you want to save your already defined models, please choose a destination folder. + + + + Import fit models + + + + Choose a directory to export the fit models to + + + + No Icon + + + + Couldn't load file: %1. +Autocompletion will not be available! + + + + Please select exactly one column and more than one non empty cell! + + + + Data set: %1 doesn't exist! + + + + Stem and leaf plot of dataset + + + + from row + + + + to row + + + + Not enough memory for this dataset! + + + + Stem + + + + Leaf + + + + Please confirm the stem unit! + + + + Data set + + + + stem unit + + + + Stem unit + + + + Leaf unit + + + + Key + + + + means + + + + Input error: empty data set! + + + + Memory Allocation Error + + + + Not enough memory, operation aborted! + + + + Set Precision %1 digits + + + + Choose custom user interface + + + + Custom user interfaces can be created using the QtDesigner application provided by the Qt framework + + + + For more details about how to use .ui files in your Python scripts please read the PyQt4 documentation + &Python Script Window Ventana de Programación &Python - - F3 F3 - &Console &Consola - Show Scripting console Mostrar consola de programación - Zoom In Aumentar Zoom - Zoom Out Disminuir Zoom - Draw arrow Dibujar flecha @@ -5462,246 +6930,194 @@ Ajustar - - - - &Find... Buscar... - - App&end Project... Añadir Proy&ecto... - Save &As Project... Guard&ar Como Proyecto... - - Save Project &As... Guard&ar Proyecto Como... - - &Show All Windows Mo&strar Todas Las Ventanas - - &Hide All Windows Ocultar Todas Las Ventanas - + Ctrl+Alt+S + + + + Profiles + + + + Horizontal + Horizontal + + + Vertical + Vertical + + <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> If you like it, you're using it in your work and you would like to see it constantly improved, please support its authors by making a donation.</b></font> - Please support QtiPlot! - Make a donation - <b> %1 </b>: This command line option must be used without other arguments! - Version - Usage - options - - file - - name - Valid options are - - - - - - - - or - show about dialog and exit - show standalone scripting window - start QtiPlot with the default settings - show command line options - start QtiPlot in language - show QtiPlot manual in a standalone window - print QtiPlot version and release date - execute the script file given as argument - execute the script file given as argument without displying the user interface. Warning: 2D plots are not correctly handled in this functioning mode! - - can be any .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py or ASCII file - - - - Help - <b> %1 </b> unknown command line option! - Type %1 to see the list of the valid options. - <b>%1</b> is a directory, please specify a file name! - QtiPlot - Demo Version - You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://soft.proindependent.com/download.html">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. - QtiPlot - File backup error - QtiPlot - File save error - Save project as - &Delete Folder Eliminar Carpeta - &Rename &Renombrar - &Windows in Active Folder Ventanas en la Carpeta Activa - Windows in &Active Folder && Subfolders Ventanas en la Carpeta Activa y Subcarpetas - &View Windows &Ver Ventanas - Project Proyecto - - - Path Ruta - bytes bytes - - Contents Contenidos @@ -5714,54 +7130,46 @@ Carpetas - Modified Modificado - - - Properties Propiedades - New Folder Nueva Carpeta - QtiPlot - Delete folder? QtiPlot - ¿Eliminar carpeta? - Delete folder '%1' and all the windows it contains? ¿Eliminar carpeta '%1' y todas las ventanas que contiene? - + 3D Graph + + + Status Estado - QtiPlot - No match found QtiPlot - No se encontró coincidencia - Sorry, no match found for string: '%1' Lo siento, no se encontró coincidencia para la cadena: '%1' - Cannot move an object to itself! ¡No puede mover un objeto a sí mismo! - Cannot move a parent folder into a child folder! ¡No puede mover una carpeta padre dentro de una hija! @@ -5770,8 +7178,6 @@ Mover Carpeta Omitido - - The destination folder already contains a folder called '%1'! Folder skipped! ¡La carpeta de destino ya contiene una carpeta llamada '%1'! ¡Carpeta omitida! @@ -5790,89 +7196,70 @@ %2. - Error while fetching version file with HTTP: %1. Error obteniendo el archivo de versión con HTTP: %1. - QtiPlot - Updates Available QtiPlot - Actualizaciones Disponibles - There is a newer version of QtiPlot (%1) available for download. Would you like to download it? Existe una nueva versión de QtiPlot (%1) disponible. ¿Desea descargarla? - QtiPlot - No Updates Available QtiPlot - No Existen Actualizaciones - No updates available. Your current version %1 is the last version available! No hay actualizaciones disponibles. ¡Su versión actual %1 es la última versión disponible! - This will clear the contents of all the data associated with the table. Are you sure? Esto borrará los contenidos de todos los datos asociados con la tabla. ¿Está seguro? - QtiPlot - Enter row number QtiPlot - Introduzca el número de fila - Row Fila - - Matrix Plot Gráfica de Matriz - QtiPlot - Script Window QtiPlot - Ventana de Programación - The file: <p><b> %1 </b><p> is the current file! - ¡El archivo <p><b> %1 </b><p> es el archivo actual! + ¡El archivo <p><b> %1 </b><p> es el archivo actual! - Name <b>%1</b> already exists! - ¡El nombre <b>%1</b> ya existe! + ¡El nombre <b>%1</b> ya existe! - Warning: for internal consistency reasons the underscore character is replaced with a minus sign. - Aviso: por razones de consistencia interna el carácter de guión bajo es reemplazado por el signo menos. + Aviso: por razones de consistencia interna el carácter de guión bajo es reemplazado por el signo menos. - - &Horizontal Steps - Escalones &Horizontales + Escalones &Horizontales - - QtiPlot - Help Profile Not Found! - ¡QtiPlot - No se encontró el perfil de ayuda! + ¡QtiPlot - No se encontró el perfil de ayuda! The assistant could not start because the file <b>%1</b> was not found in the help file directory!<p>This file is provided with the QtiPlot manual which can be downloaded from the following internet address:</p><p><font color=blue>'http://soft.proindependent.com/manuals.html'</font></p> ¡El asistente no pudo iniciarse porque el archivo <b>%1</b> no se encontró en el directorio de ayuda!<p>Este archivo es distribuido con el manual de QtiPlot que puede ser descargado de la siguiente dirección:</p><p><font color=blue>'http://soft.proindependent.com/manuals.html'</font></p> - Ctrl+K Ctrl+K @@ -5881,2183 +7268,960 @@ Ctrl+Alt+K - - - Automatic Layout - Organización Automática + Organización Automática - - - - Alt+Q - Alt+Q + Alt+Q - Contour - &Color Fill - Contorno - Relleno de &Color + Contorno - Relleno de &Color - - Contour &Lines - &Líneas de Contorno + &Líneas de Contorno - - &Gray Scale Map - Escala de &Grises - - - - Script Window - Ventana de Programación - - - - Add Layer - Añadir Capa - - - - Arrange Layers - Organizar Capas - - - - Add Error Bars... - Añadir Barras de Error... - - - - Add Function... - Añadir Función... - - - - Add Image - Añadir Imagen - - - - Contour + &Color Fill - Contorno + Relleno de &Color - - - - Contour Lines + Color Fill - Líneas de Contorno + Relleno de Color - - - - Contour Lines - Líneas de Contorno - - - - Gray Scale Map - Escala de Grises - - - - Add Text - Añadir Texto - - - - - - - Animation - Animación - - - - - - - Enable perspective - Activar perspectiva - - - - - - - Reset rotation - Reiniciar rotación - - - - - - - Fit frame to window - Ajustar marco a la ventana - - - - &Next - next window - Siguie&nte - - - - F5 - next window shortcut - F5 - - - - &Previous - previous window - &Previa - - - - F6 - previous window shortcut - F6 - - - - Disable &Tools - - - - - &Zoom Out - - - - - - &Data Reader - - - - - - &Select Data Range - - - - - - S&creen Reader - - - - - - 3D Surface - - - - - - &Recent Projects - - - - - 3&D Plot - - - - - Set Columns &As - - - - - - &Fill Columns With - - - - - - 3D &Plot - - - - - - - - - - - - Column - Columna - - - - Script Error - - - - - Table1 - - - - - - - - - - - QtiPlot - Export error - - - - - - QtiPlot - Overwrite file? - - - - - Please select two columns for this operation! - ¡Por favor, seleccione dos columnas para esta operación! - - - - Please select exactly one columns for this operation! - - - - - - Please select two columns for this operation: - the first represents the signal and the second the response function! - Por favor, seleccione dos columnas para esta operación: -¡la primera representa la señal y la segunda la función respuesta! - - - - - Vertical &Drop Lines - - - - - - Set As - - - - - &Fill Column With - - - - - Could not write to file: <h4>%1</h4><p>Please verify that you have the right to write to this location or that the file is not being used by another application! - - - - - - Released - - - - - Re&move Pie Curve - - - - - Anal&yze - - - - - &Paste Text - - - - - &Paste Line/Arrow - - - - - &Paste Image - - - - - - The manual can be downloaded from the following internet address: - - - - - - The assistant could not start because the file <b>%1</b> was not found in the help file directory! - - - - - - This file is provided with the QtiPlot manual which can be downloaded from the following internet address: - - - - - Please indicate the location of the help file! - - - - - Curve - Curva - - - - - New 3D &Surface Plot - - - - - - Open Image &File - - - - - - Import I&mage... - - - - - - Save As &Template... - - - - - Save Note As... - - - - - - Cu&t Selection - - - - - - &Copy Selection - - - - - - &Paste Selection - - - - - - Del - delete key - Del - - - - - &Export PDF - - - - - - Ctrl+Alt+P - - - - - - Clear &Log Information - - - - - - Delete &Fit Tables - - - - - - Plot &Wizard - - - - - - &Rescale to Show All - - - - - - Add Time Stamp - - - - - - &Choose Help Folder... - - - - - - - Add Column - - - - - - &View Pixel Line Profile - - - - - - &Intensity Table - - - - - &Convert to Spreadsheet - - - - - Convert to &Matrix - - - - - - &Autocorrelate - - - - - - &Random Values - - - - - QtiPlot &Forums - - - - - - Report a &Bug - - - - - - Download &Manual - - - - - - Make a &Donation - - - - - - Technical &Support - - - - - + Escala de &Grises + + + Show Line &Numbers + + + + Find &Next + + + + Find &Previous + + + + F4 + + + + &Replace... + + + + Increase Indent + + + + Decrease Indent + + + + Rena&me Tab... + + + + A&dd Tab + + + + C&lose Tab + + + &Script Window - - + Load Custom User &Interface... + + + &Reset to Full Range - - Edit &Range... - - - &Hide - Ocultar - - - - Hide &Other Curves - - &Show All Curves - QtiPlot - Help - QtiPlot - Ayuda - - - - Vie&w - - - - - &Palette - - - - - - &Read-only - - - - - - Dra&g Curve - - - - - &Import - - - - - - Read/&Write - - - - - Please select a column to plot! - ¡Por favor, seleccione una columna para la gráfica! - - - - - Please select four columns for this operation! - ¡Por favor, seleccione cuatro columnas para esta operación! - - - - You must select a single Y column that has an associated X column! - - - - - You must select exactly one Z column! - - - - - Imported sound file - - - - - This is not a PCM type WAV file, operation aborted! - - - - - PCM - - - - - - Time - Tiempo - - - - Left - Izquierda - - - - Right - Derecha - - - - Channels - - - - - Sample Rate - - - - - Byte Rate - - - - - Block Align - - - - - Bits Per Sample - - - - - Presentation Preview - - - - - &Save - - - - - Output format: - - - - - Directory: - - - - - There are no plot layers available in window <b>%1</b>.<br>Graph window not exported! - - - - - - QtiPlot - Delete rows - - - - - Start row - - - - - End row - - - - - Set Display Range - - - - - There are no windows available in this folder! - - - - - &Folders - - - - - &View Pixel Line profile - - - - - - &Import ASCII... - - - - - - &Sound (WAV)... - - - - - - Shift+A - - - - - - Create Open &Document Presentation... - - - - - - &Close - &Cerrar - - - - - Fit &Wizard... - - - - - - &Swap columns - - - - - - Move &Right - - - - - - Move &Left - - - - - - Move to F&irst - - - - - - Move to Las&t - - - - - - &Delete Rows Interval... - - - - - - Flip &V - - - - - Ctrl+Shift+V - - - - - - Flip &H - - - - - Ctrl+Shift+H - - - - - - R&otate 90 - - - - - - Rotate &-90 - - - - - - Ctrl+Alt+R - - - - - - &Image mode - - - - - Ctrl+Shift+I - - - - - - &Data mode - - - - - Ctrl+Shift+D - - - - - - - &Gray Scale - Escala de &Grises - - - - - &Rainbow - - - - - - &Export Image ... - - - - - - &Read Only - - - - - - &Disregard - - - - - - - You need at least two columns for this operation! - ¡Necesita por lo menos dos columnas para esta operación! - - - - QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! - - - - - Do you wish to continue? - - - - - QtiPlot - HTTP get version file - - - - - QtiPlot - Enter column number - - - - - - QtiPlot was not built with Python scripting support included! - - - - - Please set a default X column for this table, first! - ¡Por favor, primero fije una columna X para esta tabla! - - - - Please select a Z column for this operation! - ¡Por favor, seleccione a una columna Z para esta operación! - - - - You need to define a X column first! - ¡Necesita definir una columna X primero! - - - - You need to define a Y column first! - ¡Necesita definir una columna X primero! - - - - - &Custom - - - - - - &Lowess... - - - - - - 2D &Binning - - - - - - &Regular XYZ - - - - - - Find &Next - - - - - - Find &Previous - - - - - - F4 - - - - - - &Replace... - - - - - - Increase Indent - - - - - - Decrease Indent - - - - - - Rena&me Tab... - - - - - - A&dd Tab - - - - - - C&lose Tab - - - - + &Toolbars... + + + + Ctrl+Shift+T + + + + Bold + + + + Italic + + + + Superscript + + + + Subscript + + + + Underline (Ctrl+U) + + + + Greek + + + + Mathematical Symbols + + + Increase Precision - Decrease Precision - - New Fol&der - - - - + Append a project to the current folder + + + + Ctrl+Alt+A + + + Create a new folder - New table - + Open Excel + + + Save project - Open template - Save window as template - Import data file(s) - Project &Explorer - Show analysis results - + &Undo/Redo Stack + + + + Show available undo/redo commands + + + + Script Window + Ventana de Programación + + + Add Layer + Añadir Capa + + + Arrange Layers + Organizar Capas + + Export to PDF - Print preview - + Add Error Bars... + Añadir Barras de Error... + + + Add Function... + Añadir Función... + + Date & time - + Add Image + Añadir Imagen + + Plot as line - Plot as symbols - Plot as line + symbols - + Plot stack bar + + + + Plot stack column + + + + Stem-and-Leaf Plot + + + + Double Y Axis + + + + Extract to Graphs + + + + Extract to Layer&s + + + + Extract to Layers + + + Plot 3D ribbon - Plot 3D bars - Plot 3D scatter - Plot 3D trajectory - + Contour + &Color Fill + Contorno + Relleno de &Color + + + Contour Lines + Color Fill + Líneas de Contorno + Relleno de Color + + + Contour Lines + Líneas de Contorno + + + Gray Scale Map + Escala de Grises + + + Hide selected columns + + + + Show all table columns + + + Swap selected columns - Move Right - Move Left - Move to First - Move to Last - + Move current row upward + + + + Move current row downward + + + + Set optimal column width + + + + Alt+C + + + More Windows... - + Set Matrix Values + + + + Image Plot + + + + Image Profiles + + + + Rotate 90 Clockwise + + + + Rotate 90 Counterclockwise + + + + Flip Vertically + + + + Flip Horizontally + + + + Fill selected columns with row numbers + + + + Fill selected columns with random numbers + + + + Set column as X + + + + Set column as Y + + + + Set column as Z + + + + Set as Y Error Bars + + + + Set as Labels + + + + Disregard Columns + + + Box and whiskers plot - Visit QtiPlot &Forums - Show find dialog - Find Next - Find Previous - Show replace dialog - + Zoom In (Shift++) or Out (-) and Drag Canvas + + + + Draw Data Points + + + Drag Curve - - + Add Text + Añadir Texto + + + Add Equation + + + + Add Rectangle + + + + Add Ellipse/Circle + + + No axes - Front grid - Back grid - Right grid - Left grid - Ceiling grid - Floor grid - - Hidden line - - Polygon Only - - Mesh & Filled Polygons - - - - Crosshairs - - Floor data projection - - Floor isolines - - Empty floor - - Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. - - - - - If you want to save your already defined models, please choose a destination folder. - - - - - Import fit models - - - - - Choose a directory to export the fit models to - - - - - - No Icon - - - - - Couldn't load file: %1. -Autocompletion will not be available! - - - - - Please select exactly one column and more than one non empty cell! - - - - - Data set: %1 doesn't exist! - - - - - Stem and leaf plot of dataset - - - - - from row - - - - - to row - - - - - Not enough memory for this dataset! - - - - - Stem - - - - - Leaf - - - - - Please confirm the stem unit! - - - - - Data set - - - - - stem unit - - - - - Stem unit - - - - - Leaf unit - - - - - Key - - - - - means - - - - - Input error: empty data set! - - - - - Memory Allocation Error - - - - - Not enough memory, operation aborted! - - - - - - Set Precision %1 digits - - - - - - &Draw Data Points - - - - - - &Image Plot - - - - - - Show &X/Y - - - - - Ctrl+Shift+X - - - - - - Show &Column/Row - - - - - Ctrl+Shift+C - - - - - &Forward FFT - - - - - &Inverse FFT - - - - - - Ctrl+Shift+T - - - - - Draw Data Points - - - - - - - Format - Formato - - - - - Add &Custom Script Action... - - - - - - Bold - - - - - - Italic - - - - - Superscript - - - - - Subscript - - - - - - Underline (Ctrl+U) - - - - - - - - Greek - - - - - + Animation + Animación + + + Enable perspective + Activar perspectiva + + + Reset rotation + Reiniciar rotación + + + Fit frame to window + Ajustar marco a la ventana + + + &Next + next window + Siguie&nte + + + F5 + next window shortcut + F5 + + + &Previous + previous window + &Previa + + + F6 + previous window shortcut + F6 + + + Disable &Tools + + + + &Zoom Out + + + + &Data Reader + + + + &Select Data Range + + + + S&creen Reader + + + + 3D Surface + + + + &Recent Projects + + + + 3&D Plot + + + + Set Columns &As + + + + &Fill Columns With + + + + 3D &Plot + + + + Column + Columna + + + Please select two columns for this operation! + ¡Por favor, seleccione dos columnas para esta operación! + + + Please select two columns for this operation: + the first represents the signal and the second the response function! + Por favor, seleccione dos columnas para esta operación: +¡la primera representa la señal y la segunda la función respuesta! + + + Curve + Curva + + + Del + delete key + Del + + + Convert to &Matrix + + + + &Hide + Ocultar + + + QtiPlot - Help + QtiPlot - Ayuda + + + &Read-only + + + + Dra&g Curve + + + + &Import + + + + Read/&Write + + + + Please select a column to plot! + ¡Por favor, seleccione una columna para la gráfica! + + + Please select four columns for this operation! + ¡Por favor, seleccione cuatro columnas para esta operación! + + + You must select a single Y column that has an associated X column! + + + + You must select exactly one Z column! + + + + Time + Tiempo + + + Left + Izquierda + + + Right + Derecha + + + &Close + &Cerrar + + + &Gray Scale + Escala de &Grises + + + Open ODF Spreadsheet File + + + + QtiPlot was built without ODF spreadsheet support! + + + + You need at least two columns for this operation! + ¡Necesita por lo menos dos columnas para esta operación! + + + Open Exce&l ... + + + windows - - folders - - - 3D Graph - - - - Skipped moving folder - - - + QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! + + + + Do you wish to continue? + + + + QtiPlot - HTTP get version file + + + + QtiPlot - Enter column number + + + + QtiPlot was not built with Python scripting support included! + + + + Please set a default X column for this table, first! + ¡Por favor, primero fije una columna X para esta tabla! + + + Please select a Z column for this operation! + ¡Por favor, seleccione a una columna Z para esta operación! + + + You need to define a X column first! + ¡Necesita definir una columna X primero! + + + You need to define a Y column first! + ¡Necesita definir una columna X primero! + + + &Draw Data Points + + + + Format + Formato + + Error Error - - - &Label Etiqueta - - Undo Stack - Empty Stack - Set Image Mode - Set Data Mode - Show X/Y - Show Column/Row - Set Gray Scale Palette - Set Rainbow Palette - - - &Hide Selected - - - - - - Sho&w All Columns - - - - - - - - &Direct - - - - - - &XYZ Columns - - - - - - &YXZ Columns - - - - - Show available undo/redo commands - - - - - Hide selected columns - - - - - Show all table columns - - - - - Integration of %1 from zero is - - - - - &Integrate &Integrar - - - Integr&ate Function... - - - - - - Ctrl+D - - - - - - &Toolbars... - - - - - &Undo/Redo Stack - - - - - - Go to Colum&n... - - - - - - Ctrl+Alt+C - - - - - Set Matrix Values - - - - - Image Plot - - - - - Flip Vertically - - - - - Flip Horizontally - - - - - Fill selected columns with row numbers - - - - - Fill selected columns with random numbers - - - - - Set column as X - - - - - Set column as Y - - - - - Set column as Z - - - - - Set as Y Error Bars - - - - - Set as Labels - - - - - Disregard Columns - - - - - - Mathematical Symbols - - - - - Integration of %1 - - - - Area Área - - - - - - Please select a 'Y' column first! - - - - - - Linear Regression of %1 - - - - - - Slope - - - - - Intercept - - - - - - Chi^2 - - - - - R^2 R^2 - &Scripting - - - Show Line &Numbers - - - - - Add E&quation - - ALT+Q - - Add &Rectangle - - CTRL+ALT+R - - - You don't have the permission to open this file: <b>%1</b> - - - - - - - There are no layers available on this plot. Operation aborted! - - - - - &Paste Tex Formula - - - - - - &Frequency Count ... - - - - - Add Equation - - - - - Add Rectangle - - - - - You need to select at least one Y column for this operation! - - - - - Y2 Axis Title - - - - - You must have more than one layer in the active window! - - - - - You must have more than one dataset in the active layer! - - - - - - D&ouble-Y - - - - - - E&xtract to Graphs - - - - - Extract to &Layers - - - - - - Add Inset Layer - - - - - Double Y Axis - - - - - Extract to Graphs - - - - - Extract to Layer&s - - - - - Extract to Layers - - - - - Add &Ellipse - - CTRL+ALT+E - - &Paste Rectangle - - - - - &Paste Ellipse - - - - - Add Ellipse/Circle - - - - - - - - Ctrl+Alt+H - - - - Set Default Palette - - - &Default - - - - - Rotate 90 Clockwise - - - - - Rotate 90 Counterclockwise - - - - - - Ctrl+Shift+S - - - - - Stem-and-Leaf Plot - - - - - - Stem-and-&Leaf Plot - - - - F&ormat - - Alt+C - - - - - - Zoom &In/Out and Drag Canvas - - - - - Zoom In (Shift++) or Out (-) and Drag Canvas - - - - - - Fit Slop&e - - - - &Add &Añadir - - - Ctrl+Alt+D - - - - - &Waterfall Plot - - - - - &Indexed Colors - - - - - Pale&tte - - - - Close Cerrar - - - Spec&ial Bar/Column - - - Stack &Bar - - - - - - Stack &Column - - - - - Plot stack bar - - - - - Plot stack column - - - - - Move Row - - Print preview of window: - - - - - - Print Pre&view - - - - - - Ad&just Column Width - - - - - - &Upward - - - - - - &Downward - - - - - Append a project to the current folder - - - - - Ctrl+Alt+A - - - - - Move current row upward - - - - - Move current row downward - - - - - Set optimal column width - + Shared A&xes Panel + + + + + + + + &Custom Layout... + + + + Execute Selected Lines + + + + Commen&t Selection + + + + &Uncomment Selection + + + + Comment Selection + + + + Uncomment Selection + + + + Ctrl+Shift+O + + + + Ctrl+Shift+U + + + + Waterfall Plot + + + + &Extract Data... + + + + S&ubtract + + + + &Straight Line... + + + + &Reference Data... + + + + &Open... + &Abrir... + + + Open Image &File... + Abrir archivo de &imagen... + + + &Print... + Im&primir... + + + Print Pre&view... + + + + E&xport ASCII... + E&xportar ASCII... ArrowMarker - dx - dy - angle - length - - eqn - y - - x @@ -8065,74 +8229,58 @@ AssociationsDialog - QtiPlot - Plot Associations QtiPlot - Asociaciones de Gráficas - Spreadsheet: Hoja de Cálculo: - Column Columna - X X - Y Y - - xErr xErr - - yErr yErr - &Update curves - &OK &OK - &Cancel &Cancelar - xEnd xFin - yEnd yFin - Angle Ángulo - Magn. Magnitude, vector length @@ -8141,40 +8289,30 @@ AxesDialog - QtiPlot - General Plot Options QtiPlot - Opciones Generales de Gráfica - &Apply &Aplicar - &OK &OK - &Cancel &Cancelar - - From Desde - - To A - - Type Tipo @@ -8187,268 +8325,206 @@ logarítmico - Inverted Invertido - Step Paso - - Major Ticks Marcas Mayores - - Minor Ticks Marcas Menores - - - Bottom Inferior - - - Left Izquierda - - - Top Superior - - - Right Derecha - Scale Escala - Major Grids Mallas Primarias - Minor Grids Mallas Secundarias - Line Color Color de Línea - Line Type Tipo de Línea - Thickness Grosor - - Axes Ejes - Additional lines Líneas Adicionales - X=0 X=0 - Y=0 Y=0 - Horizontal Horizontal - Vertical Vertical - Grid - Show Mostrar - Title Título - &Font &Fuente - Numeric Numérico - Text from table Texto de tabla - Day of the week Día de la semana - Month Mes - Time Tiempo - Date Fecha - Column Headings Encabezamientos de Columna - Font Fuente - Axis &Font &Fuente del Eje - - - Color Color - - None Ninguno - - Out Fuera - - In & Out Dentro y Fuera - - In Dentro - + Labels space + + + Stand-off Separados - Show Labels Mostrar Etiquetas - + Show &backbone + + + Column Columna - Table Tabla - - Format Formato - - Precision Precisión - Angle Ángulo - For&mula Fór&mula - - Axis Eje - Canvas frame Marco de lienzo - - Width Anchura @@ -8473,22 +8549,18 @@ Color de Borde - Draw backbones Dibujar guías - Line Width Grosor de Línea - Major ticks length Longitud de las marcas mayores - Minor ticks length Longitud de las marcas menores @@ -8497,12 +8569,10 @@ Aplicar a todas las capas - General General - Automatic Automático @@ -8535,226 +8605,197 @@ ¡Por favor, introduzca un valor positivo del paso! - QtiPlot - Formula input error QtiPlot - Error en la fórmula - Valid variables are 'x' for Top/Bottom axes and 'y' for Left/Right axes! Las variables válidas son 'x' para los ejes Superior/Inferior e 'y' para los ejes Izquierda/Derecha! - millisec. milisec. - sec. seg. - min. min. - hours horas - days días - weeks semanas - Show Axis &Break - Probability - Logit - Draw Break &Decoration - Position Posición - % of Axis Length - pixels píxels - &Log10 Scale After Break - Step Before Break - - Guess - Step After Break - Minor Ticks Before - Minor Ticks After - Apply To - This Layer - This Window - - - All Windows - An&tialised - Set As &Default - Apply &to... - - Layer - - Window Ventana - Distance to axis - Apply &to - Decimal: 10000.0 Decimal: 10000.0 - Scientific: 1e4 Científico: 1e4 {1e?} - Scientific: 1x10^4 - Engineering: 10k - - + Scientific: 1·10^4 + + + Origin Origen - &Inverted - Linear Lineal - Log10 - ln - Log2 - Reciprocal + + Hide Ticks + + + + At Axis Begin + + + + At Axis End + + + + At Axis Begin & End + + CanvasPicker @@ -8766,158 +8807,121 @@ ColorBox - black negro - red rojo - green verde - blue azul - cyan cian - magenta magenta - yellow amarillo - dark yellow amarillo oscuro - navy azul marino - purple púrpura - wine granate - olive oliva - dark cyan cian oscuro - white blanco - light gray gris claro - dark gray gris oscuro - royal - orange - violet - pink - gray - light yellow - light cyan - light magenta - ColorButton - - - Custom - - - - ColorMapDialog - QtiPlot QtiPlot - Custom Color Map - &Apply &Aplicar - &Close &Cerrar - Set Custom Palette @@ -8925,27 +8929,22 @@ ColorMapEditor - Level Nivel - Color Color - &Insert &Insertar - &Delete &Eliminar - &Scale Colors E&scalar Colores @@ -8973,30 +8972,22 @@ ColorMapPreviewDialog - QtiPlot - Color Map Preview Dialog - Colormap files Archivos de Mapar de Color - All files Todos los archivos - << &Preview - - - - None Ninguno @@ -9004,7 +8995,6 @@ ColorPickerPopup - Custom @@ -9012,7 +9002,6 @@ ConfigDialog - The column separator can be customized. The following special codes can be used: \t for a TAB character @@ -9020,186 +9009,187 @@ - The separator must not contain the following characters: 0-9eE.+- - - Grids - - Ma&jor Grids - - Mi&nor Grids - - Color Color - + &Keep aspect ratio + + + QtiPlot - Choose default settings QtiPlot - Elegir configuración por defecto - General General - - Tables Tablas - - 2D Plots Gráficas 2D - - 3D Plots Gráficas 3D - Fitting Ajustes - Options Opciones - Curves Curvas - Ticks Marcas - - - + Geometry + + + Fonts Fuentes - Do not &resize layers when window size changes No cambiar las dimensiones de la capa cuando lo hacen las de la ventana - - Length Longitud - - + Ticks - Labels space + + + + pixels + píxels + + + Unit + Unidad + + + inch + + + + mm + + + + cm + + + + point + + + + pixel + + + + Canvas Width + + + + Canvas Height + + + + mu&Parser uses C locale settings + + + Solid Sólido - - Dash - - Dot Punto - - Dash Dot - - Dash Dot Dot - - Short Dash - - Short Dot - - Short Dash Dot - Scale Errors with sqrt(Chi^2/doF) Escalar Errores con sqrt(Chi^2/doF) - Axes linewidth Anchura de línea de ejes - Major Ticks Marcas Mayores - Minor Ticks Marcas Menores - Margin - Frame width Anchura de marco - Axes &backbones Guías de Ejes - Canvas Fra&me Marco del Lienzo @@ -9208,314 +9198,242 @@ Mostrar todos los ejes - Show &Title Mostrar &Título - Scale &Fonts Escalar &Fuentes - Auto&scaling Autoe&scalado - Antia&liasing - Legend display - Column name - Column comment - Table name - Table legend - - None Ninguno - - Out Fuera - - In & Out Dentro y Fuera - - In Dentro - Prompt on closing Aviso al cerrar - Folders Carpetas - Matrices - &Notes &Notas - &OK &OK - &Cancel &Cancelar - &Apply &Aplicar - &Text Font Fuente del &Texto - &Labels Font Fuente de Etiquetas - A&xes Labels - Axes &Numbers &Números de Ejes - &Legend &Leyenda - T&itle T&ítulo - + Ask before over&writing files + + + Application Aplicación - Confirmations Confirmaciones - - - Colors Colores - Language Lenguaje - - - Style Estilo - Main Font - Choose &font Elegir &fuente - Workspace Espacio de Trabajo - Panels text Texto de Paneles - Panels Paneles - Save every Guardar cada - Check for new versions at startup Buscar versiones nuevas al inicio - minutes minutos - Default scripting language Lenguaje de programación por defecto - Default Column Separator Separador de Columna por Defecto - - - - TAB TAB - - - - SPACE ESPACIO - - - Background Fondo - Text Texto - - Labels Etiquetas - Default curve style Estilo de curva por defecto - Line width - Symbol size Tamaño de Símbolo - Line - Scatter Dispersión - Line + Symbol Línea + Símbolo - Vertical drop lines - Spline Spline - Vertical steps Pasos verticales - Horizontal steps Escalones Horizontales - Area - Vertical Bars Barras Verticales - Horizontal Bars @@ -9524,12 +9442,10 @@ Resolución - (all data shown) (todos los datos mostrados) - &Show Legend Mo&strar Leyenda @@ -9542,17 +9458,14 @@ Max &Datos - Smoot&h Line Línea Suave - O&rthogonal O&rtogonal - Lab&els Etiqu&etas @@ -9561,7 +9474,6 @@ &Línea de mallado - &Grid @@ -9570,612 +9482,557 @@ &Min Datos - - - &Numbers &Números - A&xes Ejes - &Background Fon&do - &Title &Título - &Axes Labels Etiquet&as de Ejes - Autosca&ling - Generated Fit Curve Curva de Ajuste Generada - Uniform X Function - Points Puntos - Same X as Fitting Data - - Display Peak Curves for Multi-peak Fits Mostrar Curvas Pico para Ajustes MultiPico - Parameters Output Salida de Parámetros - Significant Digits Dígitos Significativos - Write Parameters to Result Log Escribir Parámetros en la Hoja de Resultados - Paste Parameters to Plot - Peaks Color Color de Picos - + Display Confirmation &Messages for Multi-peak Fits + + + QtiPlot - Import options error QtiPlot - Error en opciones de importación - The separator must not contain the following characters: 0-9eE.+- El separador no puede contener los caracteres siguientes: 0-9eE.+- - - - - System Locale Setting - Decimal Separators - Print Imprimir - Print Crop&marks - &Scale layers to paper size - Prompt on &renaming tables when appending projects - Numeric Format - &Backup project before saving - Start New Project - - Empty - Table Tabla - Matrix Matriz - Empty Graph - Note Nota - Number of Decimal Digits - &Display Comments in Header - 2 points for linear fits - &Disable in-place editing - File Locations - Choose the location of the QtiPlot translations folder! - Matrix Undo Stack Size - - Translations - - Help - LF (Unix) - CRLF (Windows) - CR (Mac) - - Python Configuration Files - Endline character - Choose the location of the Python configuration files! - Automatically &Recalculate Column Values - - Background Color - - - - Opacity Opacidad - - Canvas Color Color del Lienzo - - Border Color Color de Borde - - - - Width Anchura - - Transparent - &Enable autocompletion (Ctrl+U) - Omit &Thousands Separator - Clipboard Decimal Separators - &B - &It - Notes Notas - Tab length (pixels) - Font Fuente - &Display line numbers - Axes title space - &Resolution - &Floor style - Isolines - Projection - &Mesh - Syntax Highlighting - Co&mments - &Keywords - &Quotations - &Functions &Funciones - Q&t Classes - Default Color Map - Axes Ejes - Left Izquierda - Right Derecha - Bottom Inferior - Top Superior - Enabled axes - Show Mostrar - - QtiPlot - index.html File Not Found! QtiPlot - Archivo No Encontrado index.html - There is no file called <b>index.html</b> in folder %1.<br>Please choose another folder! - - QtiPlot - Folder Not Found! - The folder %1 doesn't exist.<br>Please choose another folder! - %1 is not a folder.<br>Please choose another folder! - Choose the location of the QtiPlot help folder! ¡Escoja la ubicación de la carpeta de ayuda de QtiPlot! - There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! No hay ningún archivo llamado <b>index.html</b> en esta carpeta.<br>¡Por favor, elija otra carpeta! - - QtiPlot QtiPlot - You don't have read access rights to folder %1.<br>Please choose another folder! - - &Internet Connection - - &Proxy - - Host - - Port - - Username - - Password - LaTeX Compiler - Choose the location of the LaTeX compiler! - - QtiPlot - File Not Found! - The file %1 doesn't exist.<br>Please choose another file! - %1 is a folder.<br>Please choose a file! - You don't have read access rights to file %1.<br>Please choose another file! + + New Color + + + + &Load Default + + + + Delete Color + + + + Move Color Up + + + + Move Color Down + + + + Indexed Colors + + + + Default Symbol + + + + Edge width + + + + Fill + Relleno + + + Name + Nombre + + + Symbol + Símbolo + + + Inde&xed Symbols + + + + &Fill Symbol + + + + Move Symbol Up + + + + Move Symbol Down + + + + Pattern + Patrón + + + Line style + + + + Fill area under curve + Rellenar área bajo la curva + + + Default Line Style + + + + Axis title + + + + Default + Por defecto + + + Synchronize scale &divisions + + ContourLinesEditor - Level Nivel - Pen - &Insert &Insertar - &Delete &Eliminar - QtiPlot - Edit pen - Color Color - - - Apply to all Aplicar a todo - Style Estilo - Width Anchura - &Ok &Ok - &Close &Cerrar @@ -10183,56 +10040,38 @@ Convolution - Convolution - - - - - QtiPlot QtiPlot - - - - - Error Error - The signal data set %1 does not exist! - The response data set %1 does not exist! - The response dataset '%1' must be less then half the size of the signal dataset '%2'! ¡El conjunto respuesta '%1' debe ser menor que la mitad del tamaño del conjunto señal '%2'! - The response dataset '%1' must contain an odd number of points! ¡El conjunto respuesta '%1' debe contener un número impar de puntos! - Could not allocate memory, operation aborted! ¡No se pudo reservar memoria, operación abortada! - - Index @@ -10244,27 +10083,18 @@ Correlation - Correlation - - - QtiPlot QtiPlot - - - Error Error - - The data set %1 does not exist! @@ -10273,13 +10103,10 @@ ¡No se pudo reservar memoria, operación abortada! - Error in GSL forward FFT operation! ¡Error en operación de FFT directa en GSL! - - Lag @@ -10291,68 +10118,54 @@ CreateBinMatrixDialog - - QtiPlot QtiPlot - Bin Matrix Dialog - &OK &OK - &Cancel &Cancelar - X-min - X-max - Columns Columnas - Y-min - Y-max - Rows Filas - Input Size Error - The dimensions you have specified are not acceptable! - Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! @@ -10360,32 +10173,26 @@ CurveRangeDialog - QtiPlot - Plot range - Data set: - From row number - To row number - &OK &OK - &Close &Cerrar @@ -10393,152 +10200,122 @@ CurvesDialog - QtiPlot - Add/Remove curves QtiPlot - Añadir/Quitar curvas - New curves style - Line - Scatter Dispersión - Line + Symbol Línea + Símbolo - Vertical drop lines - Spline Spline - Vertical steps Pasos verticales - Horizontal steps Escalones Horizontales - Area - Vertical Bars Barras Verticales - Horizontal Bars - Contour - Color Fill - Contour Lines Líneas de contorno - Gray Scale Map Escala de Grises - Available data Datos disponibles - Graph contents Contenidos de gráfica - &Plot Associations... - Edit &Range... - &Edit Function... &Editar Función... - OK OK - Close Cerrar - &Show Range - &Plot Selection - &Plot &Gráfica - &Delete Selection Borrar selección - &Delete Curve - Show current &folder only - Histogram Histograma - Histogram @@ -10546,156 +10323,110 @@ CustomActionDialog - - - - - - - - - - - QtiPlot QtiPlot - Add Custom Action - Folder Carpeta - Choose &Folder - Script File - Choose &Script - Icon - Choose &Icon - - Text Texto - Tool Tip Text - Shortcut - &Menu - &Tool Bar - &Add &Añadir - &Remove Quita&r - &Close &Cerrar - - - - - - - Error Error - Please provide a description for your custom action! - Dot characters are not allowed in the description text! - You have already defined an action having description: %1 <br>Please provide a different description text! - The file you have specified doesn't exist, please choose a valid script file! - The image file you have specified doesn't exist or can't be read, please choose another file! - Please provide a different key sequence! The following shortcut key sequences are already assigned: - Are you sure you want to remove this action? - Remove Action - - File Save Error - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! No se pudo escribir en el archivo <br><h4> %1 </h4><p>¡Por favor, verifique que tiene permiso de escritura! @@ -10704,83 +10435,66 @@ Imágenes - QtiPlot - Load icon from file - Choose script file - Choose the custom actions folder - &Save - &Delete Menu - Python Script - All Files Todos los Archivos - Add menu - Menu title: - Please, choose the location of the new menu - Menu: - Remove Menu - Are you sure you want to remove menu '%1' and all its actions? - &New Menu... - - Menu Bar - There's already a menu item with this title, please choose another title! @@ -10788,57 +10502,42 @@ DataPickerTool - Click on plot or move cursor to display coordinates! ¡Haga click en la gráfica o mueva el cursor para mostrar las coordenadas! - Please, click on plot and move cursor! - Select point and double click to remove it! - QtiPlot - Remove point error QtiPlot - Quitar error del punto - Sorry, but removing points of a function is not possible. - QtiPlot - Move point error QtiPlot - Error Moviendo Punto - Sorry, but moving points of a function is not possible. - - - - QtiPlot - Warning QtiPlot- Aviso - - This operation cannot be performed on curves plotted from columns having a non-numerical format. Esta operación no puede ser realizada en curvas dibujadas a partir de columnas con un formato no numérico. - - The column '%1' is read-only! Please choose another curve! @@ -10857,7 +10556,6 @@ Deconvolution - Deconvolution @@ -10865,13 +10563,10 @@ Differentiation - - Derivative - of Derivative of @@ -10884,7 +10579,6 @@ DrawPointTool - Draw @@ -10892,64 +10586,46 @@ EnrichmentDialog - - - - QtiPlot QtiPlot - Tex Equation Editor - Clea&r Limpia&r - Window Geometry - Object Properties - &Apply &Aplicar - &Close &Cerrar - Preview: - - &Text - - Color Color - - - Set As &Default @@ -10958,360 +10634,278 @@ Fuente - &Font &Fuente - Auto-&update - - Opacity Opacidad - - Transparent - File Archivo - &Save internally - &Image - Shape - None Ninguno - Rectangle Rectángulo - Shadow Sombra - Line Style - - Width Anchura - - - All Windows - TeX &Output - &Frame &Marco - Fill Color Color de relleno - Pattern Patrón - Pattern Color - Use &Frame Color - Fill &Pattern - Page - Layer Scales - Attach to - inch - mm - cm - point - pixel - scale - Unit Unidad - Position Posición - X X - Y Y - Size Tamaño - Height Altura - &Keep aspect ratio - &Best size - &Geometry &Geometría - Network connection error - Error while trying to connect to host %1: - Please verify your network connection! - QtiPlot - Import image from file QtiPlot - Importar imagen de archivo - QtiPlot - Warning QtiPlot- Aviso - The file %1 doesn't exist. The image cannot be restored when reloading the project file! - - - Layer - - - Window Ventana - Background Fondo - Rotate (deg.) Rotar (grad.) - - - Object - - Apply t&o... - Line Línea - Apply format &to... - MathTran (http://www.mathtran.org/) - locally installed - LaTeX Compiler - Compile process ended - Compiling process ended with exit code: %1 - LaTeX compile process - dvipng process - - failed to start! - Please verify that you have dvipng installed in the same folder as your LaTeX compiler! - crashed - timedout - write error - read error - unknown error - Compile error - Please set the correct path to the compiler in the preferences dialog! @@ -11354,33 +10948,26 @@ ErrDialog - - Source of errors Fuente de errores - QtiPlot - Error Bars QtiPlot - Barras de Error - &X Error Bars Barras de Error &X - &Add &Añadir - Add Error Bars to Añadir Barras de Error a - Percent of data (%) Porcentaje de datos (%) @@ -11389,22 +10976,18 @@ 5 - Standard Deviation of Data Desviación Estándar de los Datos - &Y Error Bars Barras de Error &Y - &Close &Cerrar - Existing column @@ -11412,27 +10995,22 @@ ExpDecayDialog - QtiPlot - Verify initial guesses QtiPlot - Verificar conjeturas iniciales - Exponential Fit of Ajuste Exponencial de - Growth time Tiempo de crecimiento - Decay time - First decay time (t1) Primer tiempo de decaimiento (t1) @@ -11441,22 +11019,18 @@ 1 - Second decay time (t2) Segundo tiempo de decaimiento (t2) - Third decay time (t3) Tercer tiempo de decaimiento (t3) - Amplitude Amplitud - Y Offset Desplazamiento Y @@ -11465,32 +11039,26 @@ 0 - Initial time Tiempo inicial - Color Color - &Fit - &Close &Cerrar - QtiPlot - Warning QtiPlot- Aviso - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! ¡La curva <b>%1</b> ya no existe! ¡Operación abortada! @@ -11498,17 +11066,14 @@ ExponentialFit - Exponential growth Crecimiento exponencial - Exponential decay Decaimiento exponencial - ExpGrowth @@ -11517,29 +11082,22 @@ (offset) - - amplitude - lifetime - - offset - ExpDecay1 - e-folding time @@ -11547,75 +11105,68 @@ ExportDialog - QtiPlot - Export ASCII QtiPlot - Exportar ASCII - Table Tabla - &All &Todo - Separator Separador - - - - - TAB TAB - - - - - SPACE ESPACIO - - The column separator can be customized. The following special codes can be used: \t for a TAB character \s for a SPACE - - - The separator must not contain the following characters: 0-9eE.+- El separador no puede contener los caracteres siguientes: 0-9eE.+- - Include Column &Names Incluir &Nombres de las Columnas - Export &Selection Exportar &Selección - + QtiPlot + QtiPlot + + + Overwrite file? + + + + %1 already exists. + + + + Do you want to replace it? + + + QtiPlot - Export error - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! No se pudo escribir en el archivo <br><h4> %1 </h4><p>¡Por favor, verifique que tiene permiso de escritura! @@ -11628,22 +11179,18 @@ &Cancelar - &Help - QtiPlot - Help QtiPlot - Ayuda - QtiPlot - Import options error QtiPlot - Error en opciones de importación - Include Column Co&mments @@ -11651,19 +11198,76 @@ ExtensibleFileDialog - << &Advanced + ExtractDataDialog + + QtiPlot + QtiPlot + + + Extract Data + + + + For row (i) + Para fila (i) + + + to + a + + + Add function + Añadir función + + + Add column + Añadir columna + + + &Apply + &Aplicar + + + &Close + &Cerrar + + + &Put into table + + + + Table + Tabla + + + Cond&ition: + + + + Add &function + + + + Add co&lumn + + + + Add &operator + + + + Clea&r + Limpia&r + + + FFT - - - - - FFT @@ -11680,72 +11284,46 @@ ¡No se pudo reservar memoria, operación abortada! - - Forward Hacia adelante - - - - of - - - Frequency Frecuencia - - Inverse - - - Time Tiempo - - Real Real - - Imaginary Imaginario - - - - Amplitude Amplitud - - Angle Ángulo - Hz - s @@ -11753,63 +11331,50 @@ FFTDialog - QtiPlot - FFT Options QtiPlot- Opciones FFT - Curve Curva - Sampling Muestreo - Real Real - Imaginary Imaginario - - Sampling Interval Intervalo de muestreo - &Normalize Amplitude &Normalizar Amplitud - &Shift Results Desplazar Resultado&s - &Inverse &Inversa - &Forward &Directa - &OK &OK - &Close &Cerrar @@ -11818,12 +11383,10 @@ QtiPlot - Error del valor de muestreo - QtiPlot - Error QtiPlot - Error - Please choose a column for the real part of the data! ¡Por favor, escoja una columan para la parte real de los datos! @@ -11840,42 +11403,34 @@ Amplitud - QtiPlot QtiPlot - The two matrices have different dimensions, the imaginary part will be neglected! - RealMatrixFFT - Real part of the FFT transform of - ImagMatrixFFT - Imaginary part of the FFT transform of - AmplitudeMatrixFFT - Amplitudes of the FFT transform of @@ -11883,64 +11438,50 @@ FFTFilter - FFT - Filtered - - QtiPlot QtiPlot - - Error Error - Unknown filter type. Valid values are: 1 - Low pass, 2 - High Pass, 3 - Band Pass, 4 - Band block. - Please enter different values for the band limits. - to a - Hz - Low Pass FFT Filter - High Pass FFT Filter - Band Pass FFT Filter - Band Block FFT Filter @@ -11948,82 +11489,58 @@ Filter - - - - - - QtiPlot QtiPlot - - - - - Error Error - Please assign a curve first! - Several data points have the same x value causing divisions by zero, operation aborted! - - You need at least %1 points in order to perform this operation! - QtiPlot - Filter Error - Please enter a valid curve name! ¡Por favor, introduzca un nombre válido de curva! - QtiPlot - Color Name Error - The color name '%1' is not valid, a default color (red) will be used instead! - You didn't specify a valid data set for this operation! - of - Plot Gráfica - Memory Allocation Error - Not enough memory, operation aborted! @@ -12031,22 +11548,18 @@ FilterDialog - QtiPlot - Filter options QtiPlot - Opciones de filtro - Filter curve: Curva filtro: - Frequency cutoff (Hz) Corte de frecuencias (Hz) - Low Frequency (Hz) Frecuencia Baja (Hz) @@ -12055,38 +11568,30 @@ 0 - High Frequency (Hz) Frencuencia Alta (Hz) - Add DC Offset Añadir Desplazamiento DC - Substract DC Offset Restar Desplazamiento DC - - Color Color - &Filter &Filtro - &Close &Cerrar - QtiPlot - Frequency input error QtiPlot - Error en la frecuencia @@ -12099,7 +11604,6 @@ QtiPlot - Error en la frecuencia alta - Please enter frequency limits that satisfy: Low < High ! ¡Por favor, introduzca límites para la frecuencia tales que: Bajo < Alto! @@ -12107,68 +11611,54 @@ FindDialog - QtiPlot QtiPlot - - Find Buscar - Start From Empezar Desde - Search in - &Window Names Nombres de las Ventanas - Window &Labels Etiquetas de las Ventanas - Folder &Names &Nombres de las Carpetas - Case &Sensitive Distinguir Mayús/Minus - &Partial Match Allowed Coincidencia &Parcial Permitida - &Include Subfolders &Incluir Subcarpetas - &Find Buscar - &Update Start Path - &Close &Cerrar @@ -12176,79 +11666,58 @@ FindReplaceDialog - - - QtiPlot QtiPlot - - Find Buscar - Find and Replace - Replace with - &Match case - &Whole word - &Next Siguie&nte - &Previous &Previa - &Replace - Replace &all - &Close &Cerrar - - - Empty Search Field - - - The search field is empty. Please enter some text and try again. - QtiPlot has finished searching the document. @@ -12256,13 +11725,6 @@ Fit - - - - - - - QtiPlot - Fit Error QtiPlot - Error de Ajuste @@ -12275,7 +11737,6 @@ ¡Por favor, introduzca un nombre válido de curva! - Plot Gráfica @@ -12284,118 +11745,94 @@ ajuste del conjunto de datos - using function usando función - Weighting Method Método de Pesado - No weighting Sin pesado - Instrumental Instrumental - using error bars dataset usando conjunto de datos de barras de error - Statistical Estadístico - Arbitrary Dataset Conjunto de Datos Arbitrario - Nelder-Mead Simplex Nelder-Mead Simplex - Unscaled Levenberg-Marquardt Levenberg-Marquardt no escalado - Scaled Levenberg-Marquardt Levenberg-Marquardt escalado - algorithm with tolerance = algoritmo con tolerancia = - From x Desde x - to x a x - - R^2 R^2 - Iterations Iteraciones - Status Estado - Dataset Conjunto de datos - Function Función - The column %1 has less points than the fitted data set. Please choose another column! - Error Error - The curve %1 has no associated Y error bars. You cannot use instrumental weighting method. La curva %1 no tiene barras de error Y asociadas. No puede usar el método de pesado instrumental. - Parameter Parámetro - Value Valor @@ -12404,17 +11841,14 @@ No especificó un conjunto de datos para esta operación. ¡Operación abortada! - There are no parameters specified for this fit operation. Operation aborted! No especificó parámetros para esta operación de ajuste. ¡Operación abortada! - You must specify a valid fit function first. Operation aborted! Debe especificar una función válida primero. ¡Operación abortada! - Fit Ajustar @@ -12423,10 +11857,6 @@ de - - - - QtiPlot - Error QtiPlot - Error @@ -12435,194 +11865,143 @@ ¡Necesita al menos %1 puntos para realizar esta operación! ¡Operación abortada! - The column %1 has less points than the fitted data set. Please choose another column!. - La columna %1 tiene menos puntos que el conjunto de datos ajustado. ¡Por favor, escoja otra columna!. + La columna %1 tiene menos puntos que el conjunto de datos ajustado. ¡Por favor, escoja otra columna!. - You didn't specify a valid data set for this fit operation. Operation aborted! No especificó un conjunto de datos válido para esta operación de ajuste. ¡Operación abortada! - You need at least %1 data points for this fit operation. Operation aborted! Necesita por lo menos %1 puntos para este ajuste. ¡Operación abortada! - graphics display disabled - of dataset - You cannot use the instrumental weighting method. - QtiPlot QtiPlot - File Save Error - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! No se pudo escribir en el archivo <br><h4> %1 </h4><p>¡Por favor, verifique que tiene permiso de escritura! - QtiPlot Fit Model - Cannot read file %1: %2. - - - Please perform a fit first! - Residuals of %1 - residue - Adjusted R^2 - RMSE (Root Mean Squared Error) - RSS (Residual Sum of Squares) - FitResiduals - - FitStats - Confidence Limits of %1 - - Independent Variable - LCL - Lower %1 Confidence Limit - UCL - Upper %1 Confidence Limit - Prediction Limits of %1 - LPL - Lower %1 Prediction Limit - UPL - Upper %1 Prediction Limit - Direct Weighting using Dataset - - - - - - - QtiPlot - Memory Allocation Error - - Could not allocate enough memory for the fit curves! ¡No puedo reservar memoria suficiente para el ajuste de las curvas! - QtiPlot - Memory Allocation Error - - - - - - Not enough memory! @@ -12630,108 +12009,86 @@ FitDialog - Curve Curva - - Function Función - Initial guesses Conjeturas iniciales - Parameter Parámetro - Value Valor - Constant Constante - Error Error - Algorithm Algoritmo - Scaled Levenberg-Marquardt Levenberg-Marquardt escalado - Unscaled Levenberg-Marquardt Levenberg-Marquardt no escalado - Nelder-Mead Simplex Nelder-Mead Simplex - Color Color - From x= Desde x= - To x= A x= - Iterations Iteraciones - Tolerance Tolerancia - Weighting Method - Método de Pesado + Método de Pesado - No weighting Sin pesado - Instrumental Instrumental - Statistical Estadístico - Arbitrary Dataset Conjunto de Datos Arbitrario @@ -12740,19 +12097,14 @@ << &Editar función - &Delete Fit Curves &Borrar Curvas de Ajuste - &Fit - - - &Close &Cerrar @@ -12761,43 +12113,34 @@ Salida Pers&onalizada >> - Category Categoría - Expression Expresión - User defined Definida por el usuario - Built-in Incorporada - Basic Básico - Plugins Plugins - Fit with &built-in function Ajustar con función incorporada - - Polynomial Order Orden del Polinomio @@ -12810,44 +12153,34 @@ Borrar &lista de usuarios - Name Nombre - user1 - - &Save - - Parameters Parámetros - &Remove Quita&r - Add &expression Añadir &expresión - Add &name Añadir &nombre - Rese&t @@ -12856,48 +12189,38 @@ &Ajustar >> - &Uniform X Function - Points Puntos - Same X as Fitting &Data - Generated Fit Curve Curva de Ajuste Generada - Significant Digits Dígitos Significativos - Parameters &Table - - Name: Nombre: - Covariance &Matrix - CovMatrix CovMatriz @@ -12906,17 +12229,14 @@ Escalar Errores con sqrt(Chi^2/doF) - Parameters Output Salida de Parámetros - &Write Parameters to Result Log - &Paste Parameters to Plot @@ -12925,57 +12245,34 @@ << Ajustar - &Apply &Aplicar - - - - - - - QtiPlot - Error QtiPlot - Error - Please enter a valid name for the parameters table. Por favor, introduzca un nombre válido para la tabla de parámetros. - - - - - Please perform a fit first and try again. Por favor, realice un ajuste primero e inténtelo de nuevo. - Please enter a valid name for the covariance matrix. Por favor, introduzca un nombre válido para la matriz de covarianza. - - - - - QtiPlot - Input function error QtiPlot - Error en la fórmula introducida - - Please enter a valid function! ¡Por favor, introduzca una función válida! - Please enter a function name! ¡Por favor, introduzca un nombre de función! @@ -12984,12 +12281,10 @@ ¡Por favor, introduzca al menos un nombre para el parámetro! - QtiPlot - Error: function name QtiPlot - Error: el nombre de la función - is a built-in function name<p>You must choose another name for your function! es el nombre de una función incorporada<p>¡Debe elegir otro nombre! @@ -12998,55 +12293,42 @@ ¡No puede definir funciones recursivamente! - Fit with selected &user function Ajustar con la función seleccionada por el &usuario - Fit using &built-in function Ajustar usando función incorporada - Fit using &plugin function Ajustar usando función de &plugin - Choose the plugins folder Escoger carpeta de plugins - - Gauss Gauss - Peaks Picos - - Lorentz Lorentz - - Polynomial Polinomial - QtiPlot - Warning QtiPlot- Aviso - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! ¡La curva <b>%1</b> ya no existe! ¡Operación abortada! @@ -13059,12 +12341,10 @@ QtiPlot - Error en el límite final - QtiPlot - Input error QtiPlot - Error de entrada - Please enter x limits that satisfy: from < end! ¡Por favor, introduzca límites en x tales que: inicio < fin! @@ -13077,7 +12357,6 @@ ¡El valor de la tolerancia debe ser positivo y menor que 1! - Please verify that you have initialized all the parameters! ¡Por favor, verifique que ha inicializado todos los parámetros! @@ -13090,147 +12369,127 @@ ¡Por favor, introduzca conjeturas iniciales para sus parámetros! - - No data tables - QtiPlot - Fit Wizard - &One table for all fits - &Preview - + Data Set + + + + Weighting + + + + Re&load + + + + &Guess + Adivinar + + + &Range + + + From Desde - To A - - - Select Function - - - - Fitting Session - - - Custom Output - - Choose plug&ins folder... - Start Fitting Session - You can't define functions recursively! - - QtiPlot fit model - - All files Todos los archivos - - - QtiPlot QtiPlot - - Save Fit Model As - Are you sure you want to remove fit model file: %1 ? - Remove Fit Model - Choose &models folder... - Choose the fit models folder - &Residuals Plot - Co&nf. Bands - Pred. &Bands - &Scale Errors with sqrt(Chi^2/doF) - Direct Weighting - Error: @@ -13238,12 +12497,10 @@ Folder - kB kB - bytes bytes @@ -13251,108 +12508,86 @@ FrequencyCountDialog - QtiPlot - Frequency count - Statistics on %1 - Mean Media - Standard Deviation Desviación Estándar - Median - Size Tamaño - From Minimum - To Maximum - Step Size - &Apply &Aplicar - &Cancel &Cancelar - &Ok &Ok - QtiPlot - Error QtiPlot - Error - Not enough data points, operation aborted! - QtiPlot - Frequency input error QtiPlot - Error en la frecuencia - Please enter frequency limits that satisfy: From < To ! - - Count - Frequency count of %1 - BinCtr - BinEnd - Sum Suma @@ -13360,97 +12595,98 @@ FunctionDialog - Clear list - Borrar lista + Borrar lista - Clear Function - Borrar Función + Borrar Función - QtiPlot - Add function curve QtiPlot - Añadir curva de función - Curve type Tipo de curva - + Click here to select a recently typed expression + + + + Rece&nt + + + f(x)= f(x)= - From x= Desde x= - To x= A x= - - - Points Puntos - - Parameter Parámetro - - To A - + QtiPlot + QtiPlot + + + Sorry, there are no recent expressions available! + + + + Recent Functions + + + + Please, choose a function: + + + y = y = - x = x = - - From Desde - R = R = - Theta = Theta = - Function Función - Parametric plot Gráfica paramétrica - Polar plot Gráfica polar @@ -13463,71 +12699,50 @@ Ok - - QtiPlot - Start limit error - QtiPlot - Error en el límite inicial + QtiPlot - Error en el límite inicial - - QtiPlot - End limit error - QtiPlot - Error en el límite final + QtiPlot - Error en el límite final - - - QtiPlot - Input error QtiPlot - Error de entrada - Please enter x limits that satisfy: from < end! ¡Por favor, introduzca límites en x tales que: inicio < fin! - - - - - QtiPlot - Input function error QtiPlot - Error en la fórmula introducida - - Please enter parameter limits that satisfy: from < end! ¡Por favor, introduzca límites para el parámetro tales que: inicio < fin! - Clea&r Function - &Ok &Ok - &Close &Cerrar - Constant Constante - Value Valor - &Add Function @@ -13551,32 +12766,26 @@ (anchura) - GaussAmp GaussAmp - GaussAmp Fit - offset - amplitude - center - width @@ -13584,7 +12793,6 @@ GaussFit - Gauss Gauss @@ -13605,27 +12813,22 @@ (offset) - Gauss Fit - area - center - width - offset @@ -13633,7 +12836,6 @@ Graph - QtiPlot - File open error QtiPlot - Error de apertura de archivo @@ -13654,26 +12856,18 @@ &Cortar - - &Copy &Copiar - - &Delete &Eliminar - - - &Properties... &Propiedades... - &Rescale to show all &Reescalar para mostrar todo @@ -13682,17 +12876,14 @@ Ctrl+R - &Hide axis &Ocultar eje - &Show grids Mo&strar mallas - &Scale... E&scala... @@ -13769,9 +12960,6 @@ Regresión lineal de - - - QtiPlot - Warning QtiPlot- Aviso @@ -13826,22 +13014,14 @@ Filtro FFT Bloquea Banda de - There are no curves available on this plot! ¡No hay curvas disponibles en esta gráfica! - - - - - - QtiPlot - Error QtiPlot - Error - There are no curves with more than two points on this plot. Operation aborted! No hay curvas con más de dos puntos en esta gráfica. ¡Operación abortada! @@ -13986,22 +13166,18 @@ Boltzmann (Sigmoidal) ajuste de - The columns Las columnas - are empty and will not be added to the plot! están vacías y no serán añadidas a la gráfica! - The column La columna - is empty and will not be added to the plot! está vacía y no será añadida a la gráfica! @@ -14018,7 +13194,6 @@ Derecha - Title Título @@ -14047,7 +13222,6 @@ Los índices válidos tienen valores comprendidos entre 0 y %1 - Image file: <p><b> %1 </b><p>does not exist anymore! ¡El archivo de imagen: <p><b> %1 </b><p> ya no existe! @@ -14056,7 +13230,6 @@ QtiPlot - Error en la fórmula introducida - Ctrl+Shift+R Ctrl+Shift+R @@ -14117,61 +13290,46 @@ suavizado mediante media de - - Please provide a valid file name! - File format not handled, operation aborted! - layer - Data set generated from curve - Table - Tabla + Tabla - F - - Couldn't change the axis type to the requested format! - Y Axis Title Título del Eje Y - X Axis Title Título del Eje X - - Cu&t Cor&tar - - C&lear Vac&iar @@ -14211,35 +13369,26 @@ QtiPlot - X axis Eje X - Y axis Eje Y - Z axis Eje Z - - - QtiPlot - Error QtiPlot - Error - - Please provide a valid file name! - File format not handled, operation aborted! @@ -14290,7 +13439,6 @@ ImageExportDialog - QtiPlot - Choose a filename to save under QtiPlot - Escoja el nombre del archivo para guardar @@ -14299,137 +13447,134 @@ Mostrar &opciones de exportación - Resolution (DPI) - + &Escape special characters in texts + + + Image quality Calida de imagen - Save transparency - Native fonts - LaTeX file - Export 3D texts as - Export in &color - - &Escape special characters in title/axis labels - - - - Export &font sizes - Bitmap images - 3D Sort mode - No sort - Simple sort - BSP sort - inch - mm - cm - point - pixel - Unit Unidad - Width Anchura - Height Altura - &Keep aspect ratio - + QtiPlot + QtiPlot + + + Overwrite file? + + + + %1 already exists. + + + + Do you want to replace it? + + + + QtiPlot - Export error + + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + No se pudo escribir en el archivo <br><h4> %1 </h4><p>¡Por favor, verifique que tiene permiso de escritura! + + Custom print size - Scale Fonts Factor - Automatic Automático - Print Resolution (DPI) @@ -14458,20 +13603,35 @@ + ImageProfilesTool + + Position + Posición + + + x + + + + y + + + + Z-Value + + + + ImageWidget - - QtiPlot - File openning error QtiPlot - Error de apertura de archivo - The file: <b>%1</b> doesn't exist! ¡El archivo <b> %1 </b> no existe! - You don't have the permission to open this file: <b>%1</b> @@ -14479,75 +13639,58 @@ ImportASCIIDialog - QtiPlot - Import ASCII File(s) - All files Todos los archivos - Text files - Data files - Comma Separated Values Valores Separados por Comas - Import each file as: - - New Table Nueva Tabla - + New Matrix + + + New Columns Nuevas Columnas - New Rows Nuevas Filas - Separator: - - - - - TAB TAB - - - - SPACE ESPACIO - The column separator can be customized. The following special codes can be used: \t for a TAB character @@ -14555,23 +13698,19 @@ - The separator must not contain the following characters: 0-9eE.+- - Ignore first Ignorar primeras - lines líneas - Ignore lines starting with @@ -14580,17 +13719,14 @@ Usar primera fila para &nombrar columnas - Use second row as &comments - &Remove white spaces from line ends Quita&r espacios en blanco de los finales de línea - By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. @@ -14598,15 +13734,12 @@ - Warning: checking this option leads to column overlaping if the columns in the ASCII file don't have the same number of rows. - - To avoid this problem you should precisely define the column separator using TAB and SPACE characters. @@ -14614,12 +13747,10 @@ - &Simplify white spaces &Simplificar espacios en blanco - By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal @@ -14629,7 +13760,6 @@ - Warning: checking this option leads to column overlaping if the columns in the ASCII file don't have the same number of rows. @@ -14637,74 +13767,60 @@ - Decimal Separators - System Locale Setting - Import as &read-only - &Help - The column separator can be customized. The following special codes can be used: \t for a TAB character \s for a SPACE - The separator must not contain the following characters: 0-9eE.+- El separador no puede contener los caracteres siguientes: 0-9eE.+- - Remove white spaces from line ends Quitar espacios en blanco de los finales de línea - By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. Marcando esta opción todos los espacios en blanco serán eliminados del principio y el final de las líneas en el archivo ASCII. - Simplify white spaces Simplificar espacios en blanco - By checking this option each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. Marcando esta opción cada secuencia de espacios en blanco internos (incluyendo el carácter TAB) será reemplazada por un único espacio. - By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. Marcando esta opción todos los espacios en blanco serán eliminados del principio y el final de las líneas y cada secuencia de espacios internos (incluyendo el carácter TAB) serán reemplazados por un único espacio en blanco. - Warning: using these two last options leads to column overlaping if the columns in the ASCII file don't have the same number of rows. Aviso: usando estas dos últimas opciones conduce a la superposición de columnas si las columnas del archivo ASCII no tienen el mismo número de filas. - To avoid this problem you should precisely define the column separator using TAB and SPACE characters. Para evitar este problema debería definir con precisión el separador de columnas usando los caracteres TAB o ESPACIO. - QtiPlot - Help QtiPlot - Ayuda @@ -14713,7 +13829,6 @@ Líneas - All @@ -14726,68 +13841,54 @@ Error - &Preview Lines - - New Matrice - Overwrite Current Window - Use first row &as - Column Names - Column Comments - Endline character - LF (Unix) - CRLF (Windows) - CR (Mac) - QtiPlot - File openning error QtiPlot - Error de apertura de archivo - You don't have the permission to open this file: <b>%1</b> - Omit &thousands separator @@ -14941,7 +14042,6 @@ IntDialog - QtiPlot - Integration Options QtiPlot - Opciones de Integración @@ -14958,27 +14058,22 @@ Número de iteraciones (Max=40) - Tolerance Tolerancia - Lower limit Límite inferior - Upper limit Límite superior - &Integrate &Integrar - &Close &Cerrar @@ -15050,22 +14145,18 @@ Los límites deben estar dentro del rango de x; si no conoce el máximo (mínimo) valor de x, escriba max (min) en las cajas. - Function Función - Variable - Order (1 - 5, 1 = Trapezoidal Rule) - Number of iterations (Max=20) Número de iteraciones (Max=40) {20)?} @@ -15074,7 +14165,6 @@ Dibujar área - &Plot area @@ -15082,8 +14172,6 @@ Integration - - Integration @@ -15092,79 +14180,62 @@ Gráfica - - Numerical integration of - using a %1 order method - Iterations Iteraciones - Tolerance Tolerancia - Points Puntos - from - - to a - Peak at - Area Área - QtiPlot - Error QtiPlot - Error - Unknown integration method. Valid values must be in the range: 1 (Trapezoidal Method) to 5. - Plot - QtiPlot - Input error QtiPlot - Error de entrada - From Desde - using the Trapezoidal Rule @@ -15172,78 +14243,46 @@ Interpolation - - QtiPlot QtiPlot - - Error Error - Unknown interpolation method. Valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. - - - - Linear Lineal - - - - - - Int - - - - - - Interpolation - - - - Cubic Cúbica - - - - Akima - QtiPlot - Error QtiPlot - Error - Unknown interpolation method, valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. - You need at least %1 points in order to perform this operation! @@ -15251,42 +14290,34 @@ InterpolationDialog - QtiPlot - Interpolation Options QtiPlot - Opciones de Interpolación - Make curve from Hacer curva de - Spline Spline - Linear Lineal - Cubic Cúbica - Non-rounded Akima Akima no redondeado - Points Puntos - From Xmin Desde Xmin @@ -15295,32 +14326,26 @@ 0 - To Xmax A Xmax - Color Color - &Make Hacer - &Close &Cerrar - QtiPlot - Warning QtiPlot- Aviso - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! ¡La curva <b>%1</b> ya no existe! ¡Operación abortada! @@ -15333,12 +14358,10 @@ QtiPlot - Error en el límite final - QtiPlot - Input error QtiPlot - Error de entrada - Please enter x limits that satisfy: from < to! ¡Por favor, introduzca límites en x tales que: inicio < fin! @@ -15346,7 +14369,6 @@ LayerButton - Activate layer @@ -15354,7 +14376,6 @@ LayerDialog - QtiPlot - Arrange Layers QtiPlot - Organizar Capas @@ -15363,43 +14384,34 @@ Número de capas - Automatic &layout Distribución automática - Horizontal Horizontal - - Center Centro - Left Izquierda - Right Derecha - Vertical Vertical - Top Superior - Bottom Inferior @@ -15408,79 +14420,58 @@ Alineación - Columns Columnas - Rows Filas - Grid - &Layer Canvas Size Tamaño del Lienzo de la Capa - Width Anchura - - - - - - - - pixels - Height Altura - Columns gap Hueco entre columnas - Rows gap Hueco entre filas - Left margin Margen Izquierdo - Right margin Margen derecho - Top margin Margen superior - Bottom margin Margen inferior - Spacing Espaciado @@ -15501,116 +14492,145 @@ Fuentes - &Apply &Aplicar - &OK &OK - - &Cancel &Cancelar - QtiPlot - Delete Layers? QtiPlot - ¿Borrar Capas? - You are about to delete %1 existing layers. Está a punto de borrar %1 capas existentes. - Are you sure you want to continue this operation? ¿Está seguro de querer continuar con esta operación? - &Continue &Continuar - QtiPlot - Columns input error QtiPlot - Error en las columnas - The number of columns you've entered is greater than the number of graphs (%1)! ¡El número de columnas que ha introducido es mayor que el número de gráficas (%1)! - QtiPlot - Rows input error QtiPlot - Error en las filas - The number of rows you've entered is greater than the number of graphs (%1)! ¡El número de filas que ha introducido es mayor que el número de gráficas (%1)! - Layers - Number - Alignment - + Unit + Unidad + + + inch + + + + mm + + + + cm + + + + point + + + + pixel + + + + &Keep aspect ratio + + + + Margins + + + Swap Layers - Source Layer - Destination Layer - &Swap - QtiPlot - Error QtiPlot - Error - Please enter different indexes for the source and destination layers! + + Link &X axes + + + + &Fixed size + + + + Align + + + + Canvases + + + + Co&mmon axes + + LineDialog - QtiPlot - Line options QtiPlot- Opciones de línea - Color Color @@ -15639,12 +14659,10 @@ 5 - Arrow at &start Flecha al principio - Arrow at &end Flecha al final @@ -15653,78 +14671,62 @@ Opci&ones - Length Longitud - Angle Ángulo - &Filled - Arrow &Head Punto de Flec&ha - Set &Default Fijar por &Defecto - &Apply &Aplicar - &Ok &Ok - Page - Layer Scales - Attach to - Scale Coordinates Coordenadas de la Escala - Pixels Pixels - Unit Unidad - Start Point Punto Inicial - - X X @@ -15733,33 +14735,26 @@ A - End Point Punto Final - &Geometry &Geometría - - Y Y - Type Tipo - Width Anchura - &Line &Línea @@ -15767,43 +14762,42 @@ LineProfileTool - - QtiPlot - Pixel selection warning QtiPlot - Aviso de selección de pixel - Please select an image marker first. - Please select the end line point inside the image rectangle! ¡Por favor, seleccione el punto de fin de línea dentro del rectángulo de la imagen! - pixel - intensity - + x + + + + y + + + Table - Tabla + Tabla - pixels píxels - pixel intensity (a.u.) intensidad de píxels (u. a.) @@ -15811,22 +14805,18 @@ LinearFit - Linear Regression Regresión Lineal - Linear Lineal - QtiPlot - Fit Error QtiPlot - Error de Ajuste - You need at least %1 data points for this fit operation. Operation aborted! Necesita al menos %1 puntos para esta operación de ajuste. ¡Operación abortada! @@ -15834,22 +14824,18 @@ LinearSlopeFit - Linear Regression Regresión Lineal - LinearSlope - QtiPlot - Fit Error QtiPlot - Error de Ajuste - You need at least %1 data points for this fit operation. Operation aborted! @@ -15857,7 +14843,6 @@ LogisticFit - Logistic @@ -15870,27 +14855,22 @@ (valor final) - Logistic Fit - init value - final value - center - power @@ -15898,7 +14878,6 @@ LorentzFit - Lorentz Lorentz @@ -15919,27 +14898,22 @@ (offset) - Lorentz Fit - area - center - width - offset @@ -15959,21 +14933,14 @@ Cancelar - - - - - QtiPlot - Error QtiPlot - Error - Calculation failed, the matrix is not square! ¡El cálculo falló, la matriz no es cuadrada! - Inversion failed, the matrix is not square! ¡La inversión falló, la matriz no es cuadrada! @@ -15982,12 +14949,6 @@ No - - - - - - QtiPlot QtiPlot @@ -15998,111 +14959,87 @@ ¿Quiere insertar celdas? - Ctrl+A Matrix: select all - - Please provide a valid file name! - File format not handled, operation aborted! - QtiPlot - ASCII Export Error QtiPlot - Error de Exportación ASCII - Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! No se pudo escribir en el archivo <br><h4> %1 </h4><p>¡Por favor, verifique que tiene permiso de escritura! - Invert - Transpose - Flip Vertically - Flip Horizontally - Rotate 90° - - Calculate Values - Clear Selection - Paste - Delete Rows - Delete Columns - Insert Row - Insert Column - - Import Image - Forward FFT - Inverse FFT - Import ASCII File @@ -16111,51 +15048,34 @@ Error - - - - - Memory Allocation Error - - - - - Not enough memory, operation aborted! - Rotate -90° - Due to memory limitations it will not be possible to undo this change. Do you want to continue anyways? - Warning - Set Dimensions - - Set Data Mode - kB kB @@ -16163,82 +15083,66 @@ MatrixDialog - Cell Width Anchura de Celda - Data Format Formato de Datos - Numeric Display Pantalla Numérica - QtiPlot - Matrix Properties QtiPlot - Propiedades de Matriz - &OK &OK - &Cancel &Cancelar - &Apply &Aplicar - Decimal: 1000 Decimal: 1000 - Scientific: 1E3 Científico: 1E3 - Default Decimal Digits Cifras Decimales por Defecto - Significant Digits= Cifras Significativas= - Set Columns Width - Decimal - Scientific - Set Data Format %1 - Precision %1 digits @@ -16246,52 +15150,38 @@ MatrixModel - Edited cell - - - - QtiPlot QtiPlot - - Memory Allocation Error - - Not enough memory, operation aborted! - Input Size Error - The dimensions you have specified are not acceptable! - Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! - Multiline expressions take much more time to evaluate! Do you want to continue anyways? - Warning @@ -16299,57 +15189,46 @@ MatrixSizeDialog - Dimensions Dimensiones - Coordinates Coordenadas - Rows Filas - Columns Columnas - X (Columns) X (Columnas) - Y (Rows) Y (Filas) - First Primero - Last Último - QtiPlot - Matrix Dimensions QtiPlot - Dimensiones de la Matriz - &OK &OK - &Cancel &Cancelar @@ -16358,12 +15237,10 @@ QtiPlot - Error de entrada - Set Coordinates x[%1 : %2], y[%3 : %4] - &Apply &Aplicar @@ -16371,23 +15248,18 @@ MatrixValuesDialog - QtiPlot - Set Matrix Values QtiPlot - Fijar Valores de la Matriz - For row (i) Para fila (i) - - to a - For col (j) Para col (i) @@ -16400,7 +15272,6 @@ Añadir Celda - Cell(i,j)= Celda(i,j)= @@ -16417,32 +15288,26 @@ Cancelar - Add &Function - Add Ce&ll - &Apply &Aplicar - &Close &Cerrar - Set New Formula - Use built-in muParser (much faster) @@ -16450,47 +15315,38 @@ MdiSubWindow - QtiPlot QtiPlot - Do you want to hide or delete Quiere ocultar o borrar - Delete Borrar - Hide Ocultar - Cancel Cancelar - Normal Normal - Minimized Minimizada - Maximized Maximizada - Hidden Oculto @@ -16499,7 +15355,6 @@ kB - B B @@ -16515,22 +15370,18 @@ QtiPlot - ¿Buscar origen óptimo para la capa nueva? - Do you want QtiPlot to rearrange the remaining layers? ¿Desea que QtiPlot reorganice las capas restantes? - &Yes &Sí - &No &No - &Cancel &Cancelar @@ -16547,101 +15398,78 @@ introduzca su texto aquí - Add layer - Remove active layer - QtiPlot - Guess best layout? QtiPlot - ¿Adivinar mejor organización? - - - QtiPlot - Error QtiPlot - Error - - Please provide a valid file name! - File format not handled, operation aborted! - kB kB - Offset Amount... - Reverse Order - Fill Area... - Offset Dialog - Total Y Offset (%) - Total X Offset (%) - &Apply &Aplicar - - &Close &Cerrar - Fill Curves - Enable Fill - Fill with Color - Side Lines @@ -16653,106 +15481,78 @@ MultiPicos - Gauss Gauss - Lorentz Lorentz - multi-peak multipico - - - Peak Pico - QtiPlot - Fit Error QtiPlot - Error de Ajuste - Could not allocate enough memory for the fit curves! ¡No puedo reservar memoria suficiente para el ajuste de las curvas! - - - Fit Ajustar - fit of ajuste de - - peak pico - Area Área - Center Centro - Width Anchura - Height Altura - Gauss Fit - Lorentz Fit - - center - - width - - offset - - area @@ -16760,12 +15560,10 @@ MultiPeakFitTool - Move cursor and click to select a point and double-click/press 'Enter' to set the position of a peak! ¡Mueva el cursor y haga click para seleccionar un punto y doble-click o 'Enter' para fijar la posición de un pico! - Peak %1 selected! Click to select a point and double-click/press 'Enter' to set the position of the next peak! ¡Pico %1 seleccionado! ¡Haga click para seleccionar un punto y doble click/'Enter' para fijar la posición del siguiente pico! @@ -16816,7 +15614,6 @@ NonLinearFit - NonLinear No Lineal @@ -16825,44 +15622,38 @@ No lineal - - QtiPlot - Input function error QtiPlot - Error en la fórmula introducida - Please enter a valid non-empty expression! Operation aborted! ¡Por favor, introduzca una expresión válida no vacía! ¡Operación abortada! - - QtiPlot - Fit Error QtiPlot - Error de Ajuste - There are no parameters specified for this fit operation. Please define a list of parameters first! No especificó parámetros para esta operación de ajuste. ¡Por favor, defina una lista de parámetros primero! + Ignore + + + You must provide a list containing at least 2 parameters for this type of fit. Operation aborted! Debe proporcionar una lista conteniendo al menos 2 parámetros para este tipo de ajuste. ¡Operación abortada! - You must provide a list containing at least one parameter for this type of fit. Operation aborted! Debe proporcionar una lista conteniendo al menos un parámetro para este tipo de ajuste. ¡Operación abortada! - Non-linear Fit - - constant @@ -16886,22 +15677,18 @@ Cancelar - Add tab - Please, enter new title: - Title Título - untitled @@ -16909,62 +15696,58 @@ OpenProjectDialog - QtiPlot - Open Project QtiPlot - Abrir Proyecto - QtiPlot project Proyecto de QtiPlot - Compressed QtiPlot project Proyecto de QtiPlot comprimido - Origin project Proyecto de Origin - Origin matrix - Origin worksheet - Origin graph - Backup files - + Excel + + + + ODF Spreadsheet + + + All files Todos los archivos - Open As - New Project Window - New Folder Nueva Carpeta @@ -16972,77 +15755,62 @@ PatternBox - Solid Sólido - Horizontal Horizontal - Vertical Vertical - Cross Cruzado - BDiagonal BDiagonal - FDiagonal FDiagonal - DiagCross DiagCruzado - Dense1 Denso1 - Dense2 Denso2 - Dense3 Denso3 - Dense4 Denso4 - Dense5 Denso5 - Dense6 Denso6 - Dense7 Denso7 - None Ninguno @@ -17148,110 +15916,86 @@ Plot3DDialog - QtiPlot - Surface Plot Options QtiPlot - Opciones de Gráfica de Superficie - &Apply &Aplicar - &OK &OK - &Cancel &Cancelar - - X X - - Y Y - - Z Z - From Desde - To A - Type Tipo - linear lineal - logarithmic logarítmico - Major Ticks Marcas Mayores - Minor Ticks Marcas Menores - &Scale E&scala - Title Título - Axis Font Fuente del Eje - &Choose font Elegir fuente - Major Ticks Length Longitud de las marcas mayores - Minor Ticks Length Longitud de las marcas menores - &Axis Eje @@ -17260,12 +16004,10 @@ &Color - &Font &Fuente - &Title &Título @@ -17286,17 +16028,14 @@ Datos - &Line &Línea - &Background Fon&do - General General @@ -17305,216 +16044,174 @@ Ejes - Lab&els Etiqu&etas - &Numbers &Números - Coordinate System Sistema de Coordenadas - Opacity Opacidad - + Scale to paper si&ze + + + + Print Crop&marks + + + + &Print + Im&primir + + &Colors &Colores - Show Legend - Orthogonal - - Line Width Grosor de Línea - Resolution Resolución - Numbers Font Fuente de los Números - &Choose Font Elegir fuente - Distance labels - axis Distancia etiquetas - eje - Zoom (%) Zoom (%) - X Zoom (%) X Zoom (%) - Y Zoom (%) Y Zoom (%) - Z Zoom (%) Z Zoom (%) - &General &General - Ma&jor Grids - Mi&nor Grids - Color Color - - Style Estilo - - Solid Sólido - - Dash - - - Dot Punto - - Dash Dot - - Dash Dot Dot - - Short Dash - - Short Dot - - Short Dash Dot - G&rid - Cross Hair Mira - Cone Cono - - - - Width Anchura - Smooth angles Ángulos suaves - Radius Radio - Smooth line Línea suave - Boxed Recuadrado - Quality Calidad - Points Puntos - Bars Barras @@ -17539,59 +16236,73 @@ ¡Por favor, introduzca límites de escala tales que: inicio < fin! - Co&lor Co&lor - A&xes Ejes - &Worksheet - &Matrix &Matriz - Linea&r color map - Color map &file - - - None Ninguno - Draw lines - Filled bars + + Tick Labels + + + + Format + Formato + + + Automatic + Automático + + + Decimal: 10000.0 + Decimal: 10000.0 + + + Scientific: 1e4 + Científico: 1e4 {1e?} + + + Engineering: 10k + + + + Precision + Precisión + PlotDialog - - - &Plot Associations... @@ -17600,516 +16311,362 @@ &Editar Función... - Plot type Tipo de Gráfica - &Worksheet - &Apply &Aplicar - &OK &OK - &Cancel &Cancelar - Attach curve to: Fijar curva a: - x Axis Eje x - - Bottom Inferior - - Top Superior - y Axis Eje y - - - Left Izquierda - - - Right Derecha - - Axes Ejes - Connect Conectar - No line Sin línea - Lines Líneas - Sticks Palos - Horizontal Steps Escalones Horizontales - Dots Puntos - Spline Spline - Vertical Steps Escalones Verticales - - - - - Style Estilo - - - - - Width Anchura - - - - - - Color Color - Fill area under curve Rellenar área bajo la curva - Fill color Color de relleno - - - - - - Pattern Patrón - - - - Line Línea - - - Size Tamaño - &Speed Mode, Skip Points if needed - data points - Apply to curves with more than: - - Tolerance (Douglas Peuker algorithm) - - - - - - Speed - - - Apply Format &to - - - Selected Curve - - Fill Color Color de relleno - - Edge Color Color del Borde - - Edge Width Grosor del Borde - - Skip Points - - None Ninguno - - - - Symbol Símbolo - - Box Caja - - Type Tipo - No Box Sin Caja - Rectangle Rectángulo - Diamond Diamante - Perc 10, 25, 75, 90 Perc 10, 25, 75, 90 - Notch Muesca - - Range Rango - - - Standard Deviation Desviación Estándar - - Standard Error Error Estándar - Perc 25, 75 Perc 25, 75 - Perc 10, 90 Perc 10, 90 - Perc 5, 95 Perc 5, 95 - Perc 1, 99 Perc 1, 99 - - Max-Min Max-Min - - Constant Constante - - Percentile (%) Porcentaje (%) - Coefficient - Box Width Anchura de Caja - Whiskers Barbas - No Whiskers Sin Barbas - 75-25 75-25 - 90-10 90-10 - 95-5 95-5 - 99-1 99-1 - Coef Coef - - Box/Whiskers Caja/Barbas - Max Max - 99% 99% - - Mean Media - 1% 1% - Min Min - - Percentile Porcentaje - - Image Imagen - &Gray Scale Escala de &Grises - &Default Color Map - &Custom Color Map - - Contour Lines Líneas de contorno - Levels Niveles - Use &Color Map Usar Mapa de &Colores - Use Default &Pen Usar &Pluma por Defecto - Color Bar Scale Escala de Barra de Color - Axis Eje - Contour Contorno - Direction Dirección - Plus Más - Minus Menos - &X Error Bar Barra de Error &X - - Line Width Grosor de Línea @@ -18134,373 +16691,286 @@ 5 - Cap Width Anchura de Mayúsculas - 8 8 - 10 10 - 12 12 - 16 16 - 20 20 - Through Symbol Mediante Símbolo - - - Error Bars Barras de Error - Automatic Binning Binning Automático - &Show statistics &Mostrar estadísticas - Bin Size Tamaño de Bin - Begin Empezar - End Fin - - Histogram Data Datos del Histograma - Gap Between Bars (in %) Hueco entre Barras (en %) - Offset (in %) Desplazamiento (en %) - - Spacing Espaciado - Arrowheads Puntas de Flecha - Length Longitud - - Angle Ángulo - &Filled - - End Point Punto Final - - X End X Final - - Y End Y Final - Position Posición - Tail Cola - Middle Medio - Head Cabeza - - Vector Vector - - - Bins Bins - - Histogram and Probabilities for Histograma y Probabilidades para - Quantity Cantidad - Sum Suma - Percent Porcentaje - Minimum Mínimo - Maximum Máximo - &Delete &Eliminar - - &Edit... - &Editar... + &Editar... - - Colors Colores - + &Function + + + Vertical Bars Barras Verticales - Horizontal Bars Barras Horizontales - Histogram Histograma - Vector XYXY Vector XYXY - Vector XYAM Vector XYAM - Scatter Dispersión - Line + Symbol Línea + Símbolo - - - - QtiPlot - Input error QtiPlot - Error de entrada - Please enter a valid start limit! ¡Por favor, introduzca un límite inicial válido! - Please enter a valid end limit! ¡Por favor, introduzca un límite final válido! - Please enter a valid bin size value! ¡Por favor, introduzca un valor de bin válido! - QtiPlot - Start limit error QtiPlot - Error en el límite inicial - QtiPlot - End limit error QtiPlot - Error en el límite final - Please enter limits that satisfy: begin < end! ¡Por favor, introduzca límites en tales que: inicio < fin! - - QtiPlot - Bin size input error QtiPlot - Error en el tamaño del bin - Please enter a positive bin size value! ¡Por favor, introduzca un valor positivo de bin! - Vector Data Datos Vectoriales - Magnitude Magnitud - QtiPlot - Plot details - Titles Títulos - Axes Labels - Axes Numbers - Legends Leyendas - - Fonts Fuentes - Background Color - - Opacity Opacidad - - Transparent - Canvas Color Color del Lienzo - Border Color Color de Borde - Margin - Antialiasing @@ -18509,62 +16979,42 @@ Aplicar a todas las capas - - - - - - - - - Layer - Origin Origen - X= X= - Y= Y= - width= anchura= - height= altura= - Keep aspect ratio - - - Geometry - Border Borde - First color Primer color @@ -18573,400 +17023,321 @@ Radio de la porción - Fill Relleno - Pie Porción - &Scale layers to paper size - Print Crop&marks - - Print Imprimir - &Show - Column Columna - White O&ut - Justify - Center Centro - &Font &Fuente - Rotate (deg) - X Offset (font height %) - Y Offset (font height %) - - - - - Labels Etiquetas - 3D View - View Angle (deg) - Thickness (% of radius) - Rotation - Starting Azimuth (deg) - Radius/Center - Radius (% of frame) - Horizontal Offset (% of frame) - - Pie Geometry - Automatic &Format - &Values - &Percentages - Categories/&Rows - Associate Position with &Wedge - Dist. from Pie Edge - Counter cloc&kwise - inch - mm - cm - point - pixel - Unit Unidad - Apply &to... - - - - Window Ventana - - - - All Windows - Set As &Default - Pen - Matrix Matriz - Use matrix formula to calculate values - - Values - &Show Contour Lines - Set Equidistant Levels - Start - Step Paso - Set &Levels - Use &Table Custom Pen + + Link &X axes + + + + Miscellaneous + + + + 0 (all data points) + + + + Tolerance (Douglas-Peucker algorithm) + + + + Scale &Fonts + Escalar &Fuentes + + + Do not &resize layers when window size changes + No cambiar las dimensiones de la capa cuando lo hacen las de la ventana + + + Dimensions + Dimensiones + PlotWizard - QtiPlot - Select Columns to Plot QtiPlot - Seleccione Columnas para la Gráfica - &X &X - x&Err - &Y &Y - yE&rr - &Z &Z - &New curve &Nueva curva - &Delete curve Borrar curva - Worksheet Hoja de Trabajo - &Plot &Gráfica - &Close &Cerrar - - - - - - - - - - - - - - - - QtiPlot - Error QtiPlot - Error - Please define a Y column for the following curve - You have already defined a X column! - - - - You must define a X column first! ¡Necesita definir una columna X primero! - You have already defined a Y column! - - - This kind of curve is not handled by QtiPlot! ¡Este tipo de gráfica no es manejado por QtiPlot! - You have already defined a Z column! - - You must define a Y column first! ¡Necesita definir una columna Y primero! - - You have already defined an error-bars column! - You must add a new curve first! ¡Necesita añadir una nueva curva primero! @@ -18978,37 +17349,26 @@ Plugin - QtiPlot - File not found QtiPlot - Archivo no encontrado - Plugin file: <p><b> %1 </b> <p>not found. Operation aborted! Archivo de plugin: <p><b>%1</b><p>no encontrado. ¡Operación abortada! - - - - QtiPlot - Plugin Error QtiPlot - Error de Plugin - The plugin does not implement a %1 method necessary for simplex fitting. El plugin no implementa un método %1 necesario para el ajuste simplex. - - - The plugin does not implement a %1 method necessary for Levenberg-Marquardt fitting. El plugin no implementa un método %1 necesario para el ajuste Levenberg-Marquardt. - Plugin Fit @@ -19016,32 +17376,26 @@ PolynomFitDialog - QtiPlot - Polynomial Fit Options QtiPlot - Opciones de Ajuste Polinomial - Polynomial Fit of Ajuste polinomial de - Order (1 - 9, 1 = linear) Orden (1 - 9, 1 = lineal) - Fit curve # pts Ajustar # pts de curva - Not enough points No hay puntos suficientes - Fit curve Xmin Ajustar Xmin de curva @@ -19050,37 +17404,30 @@ 0 - Fit curve Xmax Ajustar Xmax de curva - Color Color - Show Formula on Graph? ¿Mostrar Fórmula en la Gráfica? - &Fit - &Close &Cerrar - QtiPlot - Warning QtiPlot- Aviso - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! ¡La curva <b>%1</b> ya no existe! ¡Operación abortada! @@ -19092,400 +17439,367 @@ Poli - Polynomial Polinomial - QtiPlot - Fit Error QtiPlot - Error de Ajuste - You need at least %1 data points for this fit operation. Operation aborted! Necesita por lo menos %1 puntos para este ajuste. ¡Operación abortada! - Polynomial Fit + PreviewTable + + Numeric + Numérico + + + Text + Texto + + + Date + Fecha + + + Time + Tiempo + + + Month + Mes + + + Day + + + + Choose column type + + + + Column type: + + + + PythonScripting - Failed to export QtiPlot API - Accessing QtiPlot functions or objects from Python code won't work. Probably your version of Qt/SIP/PyQt differs from the one QtiPlot was compiled against. + + Couldn't find initialization files + + + + Please indicate the correct path to the Python configuration files in the preferences dialog. + + QObject - The file is not an QtiPlot fit model file. - The file is not an QtiPlot fit model version 1.0 file. - The file is not a QtiPlot custom action file. - The file is not an QtiPlot custom action version 1.0 file. - The file is not a QtiPlot custom menu file. - The file is not a QtiPlot custom menu version 1.0 file. - QtiPlot - Script Error - Python-like syntax is not supported in this case since it severely reduces drawing speed! - - QtiPlot - Math Error - - - - QtiPlot QtiPlot - - Ignored data point at x = %1. - - - - Found non-removable singularity at x = %1. - abs(x): Absolute value of x. - acos(x): Inverse cos function. - acosh(x): Hyperbolic inverse cos function. - asin(x): Inverse sin function. - asinh(x): Hyperbolic inverse sin function. - atan(x): Inverse tan function. - atanh(x): Hyperbolic inverse tan function. - avg(x,y,...): Mean value of all arguments. - bessel_j0(x): Regular cylindrical Bessel function of zeroth order, J_0(x). - bessel_j1(x): Regular cylindrical Bessel function of first order, J_1(x). - bessel_jn(double x, int n): Regular cylindrical Bessel function of order n, J_n(x). - bessel_jn_zero(double n, unsigned int s): s-th positive zero x_s of regular cylindrical Bessel function of order n, J_n(x_s)=0 - bessel_y0(x): Irregular cylindrical Bessel function of zeroth order, Y_0(x), for x>0. - bessel_y1(x): Irregular cylindrical Bessel function of first order, Y_1(x), for x>0. - bessel_yn(double x, int n): Irregular cylindrical Bessel function of order n, Y_n(x), for x>0. - beta(a,b): Computes the Beta Function, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) for a > 0, b > 0. - ceil(x): Round to the next larger integer, smallest integer larger or equal to x. - cos(x): Calculate cosine. - cosh(x): Hyperbolic cos function. - erf(x): The error function. - erfc(x): Complementary error function erfc(x) = 1 - erf(x). - erfz(x): The Gaussian probability density function Z(x). - erfq(x): The upper tail of the Gaussian probability function Q(x). - exp(x): Exponential function: e raised to the power of x. - floor(x): Round to the next smaller integer, largest integer smaller or equal to x. - gamma(x): Computes the Gamma function, subject to x not being a negative integer. - gammaln(x): Computes the logarithm of the Gamma function, subject to x not a being negative integer. For x<0, log(|Gamma(x)|) is returned. - gauss_cdf(x, sigma): Computes the cumulative distribution function for a Gaussian distribution with standard deviation sigma. - gauss_pdf(x, sigma): Computes the probability density at x for a Gaussian distribution with standard deviation sigma. - hazard(x): Computes the hazard function for the normal distribution h(x) = erfz(x)/erfq(x). - if(e1, e2, e3): if e1 then e2 else e3. - inv_gauss_cdf(x, sigma): Computes the inverse of the cumulative distribution function for a Gaussian distribution with standard deviation sigma. - ln(x): Calculate natural logarithm log_e. - log(x): Calculate decimal logarithm log_10. - log10(x): Calculate decimal logarithm log_10. - log2(x): Calculate binary logarithm log_2. - min(x,y,...): Calculate minimum of all arguments. - max(x,y,...): Calculate maximum of all arguments. - mod(x,y): Calculate rest of integer division x/y, x modulo y. - pow(x,y): Raise x to the power of y, x^y. - rint(x): Round to nearest integer. - sign(x): Sign function: -1 if x<0; 1 if x>0. - sin(x): Calculate sine. - sinh(x): Hyperbolic sin function. - sqrt(x): Square root function. - sum(x,y,...): Calculate sum of all arguments. - tan(x): Calculate tangent function. - tanh(x): Hyperbolic tan function. - ttable(x, n): Student's t-distribution with n degrees of freedom. - w0(x): Compute the principal branch of Lambert's W function, W_0(x). W is defined as a solution to the equation W(x)*exp(W(x))=x. @@ -19493,121 +17807,111 @@ - wm1(x): Compute the secondary branch of Lambert's W function, W_{-1}(x). W is defined as a solution to the equation W(x)*exp(W(x))=x. For x<0, there are two real-valued branches; this function computes the one where W<-1 for x<0. (also see w0(x)). + + AVG("colName", i, j): + The average of all cells from row i to j in column colName. + + + + SUM("colName", i, j): + The sum of all cells from row i to j in column colName. + + + + QtiPlot - Memory Allocation Error + + + + Not enough memory, operation aborted! + + + + The function %1 is not defined in the specified interval! + + + + rnd(seed): + Returns a pseudo-random number in the range 0 to 1. Calling this function several times with the same seed will return the same value. + + QtColorPicker - - - Black - - White - - Red - - Dark red - - Green - - Dark green - - Blue - - Dark blue - - Cyan - - Dark cyan - - Magenta - - Dark magenta - - Yellow - - Dark yellow - - Gray - - Dark gray - - Light gray - Custom @@ -19615,55 +17919,34 @@ RangeSelectorTool - - - - - - QtiPlot - Warning QtiPlot- Aviso - All the curves on this plot are empty! ¡Todas las curvas en esta gráfica están vacías! - Click or use Ctrl+arrow key to select range (arrows select active cursor)! - - - Right Derecha - - - Left Izquierda - - - - - The column '%1' is read-only! Operation aborted! - Remove data from curves? - Copy data to clipboard? @@ -19671,47 +17954,38 @@ RenameWindowDialog - Window Title Título de la Ventanta - &Name (single word) &Nombre (una palabra) - &Label Etiqueta - &Both Name and Label Nom&bre y Etiqueta - QtiPlot - Rename Window QtiPlot - Renombrar Ventana - &OK &OK - &Cancel &Cancelar - QtiPlot - Warning QtiPlot- Aviso - For internal consistency reasons the underscore character is replaced with a minus sign. Por razones de consistencia interna el carácter de guión bajo es reemplazado por el signo menos. @@ -19719,7 +17993,6 @@ ScreenPickerTool - Click on plot or move cursor to display coordinates! ¡Haga click en la gráfica o mueva el cursor para mostrar las coordenadas! @@ -19727,18 +18000,14 @@ ScriptEdit - Auto&exec Auto&ejecutar - &Functions &Funciones - - Text Texto @@ -19747,28 +18016,22 @@ Fuente Python - - All Files Todos los Archivos - QtiPlot - Import Text From File QtiPlot - Importar Texto desde Archivo - QtiPlot - Error Opening File QtiPlot - Error Abriendo Archivo - Could not open file "%1" for reading. Imposible abrir archivo "%1" para lectura. - Save Text to File Guardar el Texto en Archivo @@ -19791,47 +18054,38 @@ &No - QtiPlot - File Save Error QtiPlot - Error Guardando Archivo - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! No se pudo escribir en el archivo <br><h4> %1 </h4><p>¡Por favor, verifique que tiene permiso de escritura! - E&xecute Ejecutar - Ctrl+J Ctrl+J - Execute &All Ejecut&ar Todo - Ctrl+Shift+J Ctrl+Shift+J - &Evaluate Expression &Evaluar Expresión - Ctrl+Return Ctrl+Return - &Print Im&primir @@ -19840,62 +18094,50 @@ &Exportar - &Save - &Import... - Sa&ve as... - &Find... Buscar... - &Replace... - &Find next - &Find previous - Rena&me Tab... - A&dd Tab - C&lose Tab - QtiPlot QtiPlot - QtiPlot has finished searching the document. @@ -19907,22 +18149,14 @@ QtiPlot - Ventana de Programación Python - - &File &Archivo - - &Edit &Editar - - - - E&xecute Ejecutar @@ -19931,56 +18165,38 @@ Ocultar - - Ctrl+N Ctrl+N - - Ctrl+O Ctrl+O - - Ctrl+S Ctrl+S - - Ctrl+P Ctrl+P - - Ctrl+Z Ctrl+Z - - Ctrl+Y Ctrl+Y - - Ctrl+x Ctrl+x - - Ctrl+C Ctrl+C - - Ctrl+V Ctrl+V @@ -19989,90 +18205,62 @@ Del - - CTRL+J CTRL+J - - CTRL+SHIFT+J CTRL+SHIFT+J - - CTRL+Return CTRL+Return - QtiPlot - File Save Error QtiPlot - Error Guardando Archivo - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! No se pudo escribir en el archivo <br><h4> %1 </h4><p>¡Por favor, verifique que tiene permiso de escritura! - - &New &Nuevo - - &Open... &Abrir... - - &Save &Guardar - - Save &As... Guardar &Como... - - &Print Im&primir - - &Undo &Deshacer - - &Redo &Rehacer - - &Cut &Cortar - - &Copy &Copiar - - &Paste &Pegar @@ -20081,146 +18269,102 @@ &Eliminar - - Execute &All Ejecut&ar Todo - - &Evaluate Expression &Evaluar Expresión - - QtiPlot - Script Window QtiPlot - Ventana de Programación - &Window &Ventana - - Increase Indent - - Decrease Indent - - &Find... - - Ctrl+Alt+F Ctrl+Alt+F - - Find &Next - - F3 F3 - - Find &Previous - - F4 - - &Replace... - Always on &Top - You need to close and reopen the script window before your changes become effective! Do you want to close it now? - - QtiPlot QtiPlot - Show &Line Numbers - - Script Output Panel - - Show Script &Output Panel - - Ouput on Next &Line - Show Script Output Panel - - Print Pre&view... - Script print preview - - &Close &Cerrar - - Show &Workspace @@ -20228,7 +18372,6 @@ ScriptingEnv - %1 Source (*.%2);; @@ -20236,27 +18379,22 @@ ScriptingLangDialog - QtiPlot - Select scripting language QtiPlot - Seleccionar lenguaje de programación - OK OK - Cancel Cancelar - QtiPlot - Scripting Error QtiPlot - Error de Programación - Scripting language "%1" failed to initialize. Falló la inicialización del lenguaje de programación "%1". @@ -20264,32 +18402,26 @@ SetColValuesDialog - QtiPlot - Set column values QtiPlot - Fijar valores de la columna - For row (i) Para fila (i) - to a - Add function Añadir función - Add column Añadir columna - Add cell Añadir Celda @@ -20298,7 +18430,6 @@ &OK - &Apply &Aplicar @@ -20307,17 +18438,14 @@ Cancelar - &Close &Cerrar - Use built-in muParser (much faster) - Clear &Formulas @@ -20345,32 +18473,26 @@ Boltzmann (Sigmoidal) - Boltzmann (Sigmoidal) Fit - Boltzmann - init value - final value - center - time constant @@ -20378,59 +18500,46 @@ SmoothCurveDialog - QtiPlot - Smoothing Options QtiPlot - Opciones de Suavizado - Curve Curva - Polynomial Order Orden del Polinomio - Points to the Left Puntos a la Izquierda - Points to the Right Puntos a la Derecha - - - Color Color - f - Iterations Iteraciones - Points Puntos - &Smooth &Suavizar - &Close &Cerrar @@ -20438,95 +18547,62 @@ SmoothFilter - Smoothed Suavizado - - - - - - - - QtiPlot QtiPlot - - - - - - - - Error Error - Unknown smooth filter. Valid values are: 1 - Savitky-Golay, 2 - FFT, 3 - Moving Window Average, 4 - Lowess. - - - - points puntos - Savitzky-Golay smoothing - FFT smoothing - average smoothing - - Lowess smoothing + Lowess smoothing with f=%1 and %2 iterations - The number of points must be positive! - - The polynomial order must be lower than the number of left points plus the number of right points! - Setting polynomial order is only available for Savitzky-Golay smooth filters! Ignored option! - Setting Lowess parameter is only available for Lowess smooth filters! Ignored option! - The parameter f must be between 0 and 1! - The number of iterations must be at least 1! @@ -20534,70 +18610,115 @@ SortDialog - QtiPlot - Sorting Options QtiPlot - Opciones de Ordenado - Sort columns Ordenar columnas - Order Orden - Leading column Columan principal - &Sort - &Close &Cerrar - Separately Separadamente - Together Juntos - Ascending Ascendente - Descending Descendente + SubtractDataDialog + + QtiPlot + QtiPlot + + + Math on Data Sets + + + + Cu&rve + + + + &Operator + + + + &Data set + + + + Current &folder + + + + &Value + + + + &Apply + &Aplicar + + + &Close + &Cerrar + + + Error + Error + + + Data set %1 must containt at least two valid data points in order to perform this operation! + + + + + SubtractLineTool + + Move cursor and click to select and double-click/press 'Enter' to set the position of the first point! + + + + First point selected! Click to select and double-click/press 'Enter' to set the position of the 2nd point! + + + + SurfaceDialog - QtiPlot - Define surface plot QtiPlot - Definir Gráfica de Superficie - f(x,y)= f(x,y)= - X - axis Eje - X @@ -20610,45 +18731,30 @@ 1 - - - - - From Desde - - - - - To A - Y - axis Eje - Y - Z - axis Eje - Z - Clear &list - Borrar &lista + Borrar &lista - &OK &OK - &Close &Cerrar @@ -20677,200 +18783,173 @@ QtiPlot - Error en el límite final Z - QtiPlot - Input error QtiPlot - Error de entrada - Please enter limits that satisfy: from < end! ¡Por favor, introduzca límites tales que: inicio < fin! - QtiPlot - Input function error QtiPlot - Error en la fórmula introducida - Surface type - Function Función - Parametric - - + Clea&r + Limpia&r + + + Rece&nt + + + + Click here to select a recently typed expression + + + Mesh - - Columns Columnas - - Rows Filas - Equations - X(u,v)= - Y(u,v)= - Z(u,v)= - u - - Periodic - v - QtiPlot - X Formula Error - QtiPlot - Y Formula Error - QtiPlot - Z Formula Error - - QtiPlot - u start limit error - - - - - - QtiPlot - u end limit error - - - - - QtiPlot - v start limit error + QtiPlot + QtiPlot + + + Sorry, there are no recent expressions available! + + + + Recent Functions + + + + Please, choose a function: SymbolBox - Ellipse Elipse - Rectangle Rectángulo - Diamond Diamante - Up Triangle Triángulo Arriba - Down Triangle Triángulo Abajo - Left Triangle Triángulo Izquierda - Right Triangle Triángulo Derecha - Cross Cruz - Diagonal Cross Cruz Diagonal - No Symbol Sin Símbolo - Triangle Triángulo - Horizontal Line Línea Horizontal - Vertical Line Línea Vertical - Star 1 Estrella 1 - Star 2 Estrella 2 - Hexagon Hexágono @@ -20878,12 +18957,10 @@ SymbolDialog - &Close &Cerrar - QtiPlot - Choose Symbol QtiPlot - Elegir Símbolo @@ -20891,27 +18968,10 @@ Table - - - - - - - - - - - - - - - QtiPlot - Error QtiPlot - Error - - Yes @@ -20920,8 +18980,6 @@ No - - Cancel Cancelar @@ -20966,26 +19024,18 @@ ¡Necesita definir una columna X primero! - QtiPlot - ASCII Export Error QtiPlot - Error de Exportación ASCII - - - - QtiPlot QtiPlot - Columns will be deleted from the table! ¡Las columnas serán borradas de la tabla! - - Do you really want to continue? ¿Desea continuar realmente? @@ -21034,7 +19084,6 @@ ¿Quiere insertar celdas? - Rows will be deleted from the table! ¡Las filas serán borradas de la tabla! @@ -21043,93 +19092,62 @@ QtiPlot - Leyendo archivo... - There is already a column called : <b> - - - Column '%1' is read only! - The table '%1' contains read-only columns! Operation aborted! - - - - - - - - The folowing columns - - - - - - - - are read only! - Paste operation - How should QtiPlot interpret first clipboard line? - &Values - Column &Names - &Comments - Please indicate the name of the leading column! - The leading column is empty! Operation aborted! - Could not write to file: <br><h4> - Qtiplot - Reading file... @@ -21138,17 +19156,14 @@ QtiPlot - Error de entrada - kB kB - Multiline expressions take much more time to evaluate! Do you want to continue anyways? - Warning @@ -21156,343 +19171,274 @@ TableDialog - QtiPlot - Column options QtiPlot - Opciones de columna - Column Name: Nombre de Columna: - Enumerate all to the right Enumerar todas a la derecha - &OK &OK - &Apply &Aplicar - &Cancel &Cancelar - Plot Designation: Designación de la Gráfica: - None Ninguno - X (abscissae) X (abscisas) - Y (ordinates) Y (ordenadas) - Z (height) Z (altura) - X Error X Error - Y Error Y Error - Display Pantalla - Numeric Numérico - Text Texto - Date Fecha - Time Tiempo - Month Mes - Day of Week Día de la semana - Format: Formato: - Precision: Precisión: - Apply to all columns to the right Aplicar a todas las columnas a la derecha - Options Opciones - Column Width: Anchura de Columna: - Apply to all Aplicar a todo - Comment: Comentario: - QtiPlot - Warning QtiPlot- Aviso - For internal consistency reasons the underscore character is replaced with a minus sign. Por razones de consistencia interna el carácter de guión bajo es reemplazado por el signo menos. - - QtiPlot - Error QtiPlot - Error - The column names must only contain letters and digits! - ¡Los nombre de las columnas sólo pueden contener cifras y letras! + ¡Los nombre de las columnas sólo pueden contener cifras y letras! - Default Por defecto - Decimal: 1000 Decimal: 1000 - Scientific: 1E3 Científico: 1E3 - yyyy-MM-dd aaaa-MM-dd - h h - h ap h ap - h AP h AP - h:mm h:mm - h:mm ap h:mm ap - hh:mm hh:mm - h:mm:ss h:mm:ss - h:mm:ss.zzz h:mm:ss.zzz - mm:ss mm:ss - mm:ss.zzz mm:ss.zzz - hmm hmm - hmmss hmmss - hhmmss hhmmss - &Read-only - &Display Comments in Header - dd/MM/yyyy - dd.MM.yyyy - dd MM yyyy - yyyyMMdd - Couldn't guess the source data format, please specify it using the 'Format' box! - For more information about the supported date/time formats please read the Qt documentation for the QDateTime class! - Label Etiqueta - &Hidden - dd/MM/yyyy HH:mm - dd/MM/yyyy HH:mm:ss - dd.MM.yyyy HH:mm - dd.MM.yyyy HH:mm:ss - dd MM yyyy HH:mm - dd MM yyyy HH:mm:ss - yyyy-MM-dd HH:mm - yyyy-MM-dd HH:mm:ss - yyyyMMdd HH:mm - yyyyMMdd HH:mm:ss @@ -21500,100 +19446,74 @@ TableStatistics - Row Statistics of %1 Estadística de Filas de %1 - Row Fila - Cols Columnas - - Mean Media - - Variance Varianza - - Sum Suma - - Max Max - - Min Min - Column Statistics of %1 Estadísticas de filas de %1 - Col Columna - Rows Filas - iMax iMax - iMin iMin - RowStats EstadísticaFilas - - StandardDev DesvEstándar - ColStats EstadísticaColumnas - - StandardError - - Median @@ -21601,7 +19521,6 @@ TextDialog - QtiPlot - Text options QtiPlot- Opciones de texto @@ -21618,12 +19537,10 @@ &OK - Font Fuente - &Font &Fuente @@ -21636,17 +19553,14 @@ Alineación - Center Centro - Left Izquierda - Right Derecha @@ -21731,12 +19645,10 @@ Fijar por &Defecto - Text Color - Alignment @@ -21745,70 +19657,54 @@ Opacidad - - - - QtiPlot QtiPlot - X Axis Title Título del Eje X - Y Axis Title Título del Eje Y - Top Axis Title - Right Axis Title - &Apply to... - Object - Layer - Window Ventana - All Windows - &Close &Cerrar - Distance to axis - &Inverted @@ -21816,17 +19712,14 @@ TextEditor - QtiPlot QtiPlot - Confirmation - Are you sure you want to add %1 text lines into this text box? @@ -21834,19 +19727,16 @@ TextFormatButtons - B Button bold B - It Button italics It - U Button underline U @@ -21855,7 +19745,6 @@ ThreeExpFit - Exponential decay Decaimiento exponencial @@ -21864,42 +19753,34 @@ (offset) - ExpDecay3 - first amplitude - first lifetime - second amplitude - second lifetime - third amplitude - third lifetime - offset @@ -21907,36 +19788,26 @@ TranslateCurveTool - Curve selected! Move cursor and click to choose a point and double-click/press 'Enter' to finish! ¡Curva seleccionada! !Mueva el cursor y haga click para elegir un punto y doble click/'Enter' para finalizar¡ - - - - QtiPlot - Warning QtiPlot- Aviso - This operation cannot be performed on function curves. - This operation cannot be performed on curves plotted from columns having a non-numerical format. Esta operación no puede ser realizada en curvas dibujadas a partir de columnas con un formato no numérico. - - The column '%1' is read-only! Operation aborted! - Double-click on plot to select a data point! ¡Haga doble click en la gráfica para seleccionar un punto! @@ -21944,7 +19815,6 @@ TwoExpFit - Exponential decay Decaimiento exponencial @@ -21953,32 +19823,26 @@ (offset) - ExpDecay2 - first amplitude - first lifetime - second amplitude - second lifetime - offset @@ -24693,10 +22557,6 @@ muParserScript - - - - Out of memory Memoria agotada @@ -24717,27 +22577,18 @@ Error de sintaxis: '=' sin nombre de variable. - col() works only on tables! ¡col() funciona sólo en tablas! - - There's no column named %1 in table %2! ¡No hay columna llamada %1 en la tabla %2! - - - There's no row %1 in table %2! ¡No hay fila %1 en la tabla %2! - - - There's no column %1 in table %2! ¡No hay columna llamada %1 en la tabla %2! @@ -24746,42 +22597,42 @@ ¡cell() funciona sólo con matrices! - There's no row %1 in matrix %2! ¡No hay fila %1 en la matriz %2! - There's no column %1 in matrix %2! ¡No hay columna llamada %1 en la matriz %2! - tablecol() works only on tables! - tablecol: wrong number of arguments (need 2, got %1) - tablecol: first argument must be a string (table name) - Couldn't find a table named %1. - - cell() works only on tables and matrices! + SUM() works only on tables! + + + + AVG() works only on tables! + + + QtiPlot QtiPlot === modified file 'qtiplot/translations/qtiplot_fr.ts' --- qtiplot/translations/qtiplot_fr.ts 2009-12-08 18:06:27 +0000 +++ qtiplot/translations/qtiplot_fr.ts 2010-07-21 23:21:08 +0000 @@ -2,901 +2,20 @@ - - - QtiPlot - File openning error - QtiPlot - Erreur lors de l'ouverture du fichier - - - You don't have the permission to open this file: <b>%1</b> - Vous n'avez pas les droits pour ouvrir le fichier <b>%1</b> - - - QtiPlot - File opening error - QtiPlot - Erreur lors de l'ouverture du fichier - - - QtiPlot - Demo Version - QtiPlot - Version de démonstration - - - QtiPlot - File backup error - QtiPlot - Erreur lors de la sauvegarde automatique - - - QtiPlot - File save error - QtiPlot - Erreur lors de la sauvegarde du fichier - - - The file: <br><b>%1</b> is opened in read-only mode - Le fichier <br><b>%1</b> est ouvert en lecture seule - - - QtiPlot project - Projet QtiPlot - - - Save project as - Enregistrer le projet sous - - - Save &As Project... - S&auvegarder comme projet... - - - &Delete Folder - Supprimer le dossier - - - &Rename - &Renommer - - - &Windows in Active Folder - Dans le dossier actif - - - Windows in &Active Folder && Subfolders - Dans le dossier actif et les sous-dossiers - - - &View Windows - Afficher les fenêtres - - - &Properties... - &Propriétés... - - - Hidden - Caché - - - Name already exists! - Ce nom existe déjà ! - - - Please choose another name! - Choisissez un autre nom ! - - - Type - Type - - - Project - Projet - - - Path - Chemin - - - Contents - Contenu - - - windows - fenêtres - - - folders - dossiers - - - Properties - Propriétés - - - Folder - Dossier - - - QtiPlot - Delete folder? - QtiPlot - Supprimer le dossier ? - - - Delete folder '%1' and all the windows it contains? - Supprimer le dossier '%1' et toutes les fenêtres qu'il contient ? - - - Yes - Oui - - - No - Non - - - Matrix - Matrice - - - Table - Table - - - Graph - Graphe - - - 3D Graph - Graphe 3D - - - Status - Etat - - - QtiPlot - No match found - QtiPlot - Pas de correspondance - - - Sorry, no match found for string: '%1' - Désolé, '%1' introuvable - - - Cannot move an object to itself! - Impossible de déplacer un objet vers lui-même ! - - - Skipped moving folder - Dossier inchangé - - - Error - Erreur - - - QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! - QtiPlot va essayer de télécharger les informations necessaires des mises à jour disponibles. Veuillez modifier les paramètres du firewall afin d'autoriser QtiPlot à se connecter à Internet ! - - - Do you wish to continue? - Désirez vous continuer ? - - - QtiPlot - HTTP get version file - QtiPlot - Recherche de mise à jour par le WEB - - - Error while fetching version file with HTTP: %1. - Erreur lors de la recherche de la version du fichier par le WEB : %1. - - - QtiPlot - Updates Available - QtiPlot - Mises à jour disponibles - - - There is a newer version of QtiPlot (%1) available for download. Would you like to download it? - Une nouvelle version de QtiPlot (%1) est disponible. Voulez-vous la télécharger ? - - - QtiPlot - No Updates Available - QtiPlot - Aucune mise à jour disponible - - - No updates available. Your current version %1 is the last version available! - Aucune mise à jour disponible. Votre version %1 est la dernière disponible ! - - - &No - &Non - - - Row - Rangée - - - QtiPlot - Enter column number - QtiPlot - Entrer le numéro de la colonne - - - Column - Colonne - - - QtiPlot was not built with Python scripting support included! - Qtiplot a été compilé sans le support des scripts Python - - - Please select a Y column to plot! - Sélectionnez une colonne Y à tracer ! - - - You need at least two columns for this operation! - Vous avez besoin d'au moins deux colonnes pour cette opération ! - - - Please select a Z column for this operation! - Sélectionnez une colonne Z pour cette opération ! - - - You need to define a X column first! - Vous devez d'abord définir une colonne X ! - - - You need to define a Y column first! - Vous devez d'abord définir une colonne Y ! - - - Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. - Depuis la version 0.9.1 Qtiplot sauvegarde les modèles de régression dans un dossier différent - - - If you want to save your already defined models, please choose a destination folder. - Si vous voulez sauvegarder vos modèles prédfinis, choisissez un dossier de destination - - - Import fit models - Importer un modèle de régression - - - Choose a directory to export the fit models to - Choisissez un répertoire pour exporter les modèles de regression - - - No Icon - Pas d'icônes - - - Couldn't load file: %1. -Autocompletion will not be available! - Ne peut charger le fichier: %1. -L'autocomplétion ne sera pas disponible - - - QtiPlot - Column selection error - QtiPlot - Erreur de sélection de la colonne - - - Please select exactly one column and more than one non empty cell! - Veuillez choisir exactement une colonne et plus d'une celllule non vide ! - - - Data set: %1 doesn't exist! - Les données %1 doesn't exist ! - - - Stem and leaf plot of dataset - Tracé des données en "stemplot" - - - from row - de la colonne - - - to row - à la colonne - - - Not enough memory for this dataset! - Pas assez de mémoire pour ces données ! - - - Please confirm the stem unit! - Mercid e confirmer l'unité du "stem"! - - - Data set - Plage de données - - - stem unit - Unité du "stem" - - - Stem unit - Unité du "stem" - - - Key - clé - - - means - moyenne - - - Input error: empty data set! - Erreur en entrée : plage de données vide. - - - - @default - - QtiPlot - File openning error - QtiPlot - Erreur lors de l'ouverture du fichier - - - QtiPlot - File opening error - QtiPlot - Erreur lors de l'ouverture du fichier - - - QtiPlot - Demo Version - QtiPlot - Version de démonstration - - - You are using the demonstration version of Qtiplot. - Vous utilisez la version de démonstration de Qtiplot. - - - QtiPlot - File backup error - QtiPlot - Erreur lors de la sauvegarde automatique - - - QtiPlot - File save error - QtiPlot - Erreur lors de la sauvegarde du fichier - - - The file: <br><b>%1</b> is opened in read-only mode - Le fichier <br><b>%1</b> est ouvert en lecture seule - - - QtiPlot project - Projet QtiPlot - - - Save project as - Enregistrer le projet sous - - - &Find... - Chercher... - - - App&end Project... - Ajout&er un projet... - - - Save &As Project... - S&auvegarder comme projet... - - - &Delete Folder - Supprimer le dossier - - - &Rename - &Renommer - - - &Windows in Active Folder - Dans le dossier actif - - - Windows in &Active Folder && Subfolders - Dans le dossier actif et les sous-dossiers - - - &View Windows - Afficher les fenêtres - - - &Properties... - &Propriétés... - - - Hidden - Caché - - - Name already exists! - Ce nom existe déjà ! - - - Please choose another name! - Choisissez un autre nom ! - - - Type - Type - - - Project - Projet - - - Path - Chemin - - - Contents - Contenu - - - windows - fenêtres - - - folders - dossiers - - - Properties - Propriétés - - - Folder - Dossier - - - QtiPlot - Delete folder? - QtiPlot - Supprimer le dossier ? - - - Delete folder '%1' and all the windows it contains? - Supprimer le dossier '%1' et toutes les fenêtres qu'il contient ? - - - Yes - Oui - - - No - Non - - - Matrix - Matrice - - - Table - Table - - - Graph - Graphe - - - 3D Graph - Graphe 3D - - - Status - Etat - - - QtiPlot - No match found - QtiPlot - Pas de correspondance - - - Sorry, no match found for string: '%1' - Désolé, '%1' introuvable - - - Cannot move an object to itself! - Impossible de déplacer un objet vers lui-même ! - - - Skipped moving folder - Dossier inchangé - - - Error - Erreur - - - QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! - QtiPlot va essayer de télécharger les informations necessaires des mises à jour disponibles. Veuillez modifier les paramètres du firewall afin d'autoriser QtiPlot à se connecter à Internet ! - - - Do you wish to continue? - Désirez vous continuer ? - - - QtiPlot - HTTP get version file - QtiPlot - Recherche de mise à jour par le WEB - - - Error while fetching version file with HTTP: %1. - Erreur lors de la recherche de la version du fichier par le WEB : %1. - - - QtiPlot - Updates Available - QtiPlot - Mises à jour disponibles - - - There is a newer version of QtiPlot (%1) available for download. Would you like to download it? - Une nouvelle version de QtiPlot (%1) est disponible. Voulez-vous la télécharger ? - - - QtiPlot - No Updates Available - QtiPlot - Aucune mise à jour disponible - - - No updates available. Your current version %1 is the last version available! - Aucune mise à jour disponible. Votre version %1 est la dernière disponible ! - - - &No - &Non - - - Row - Rangée - - - QtiPlot - Enter column number - QtiPlot - Entrer le numéro de la colonne - - - Column - Colonne - - - QtiPlot was not built with Python scripting support included! - Qtiplot a été compilé sans le support des scripts Python - - - Please select a Y column to plot! - Sélectionnez une colonne Y à tracer ! - - - You need at least two columns for this operation! - Vous avez besoin d'au moins deux colonnes pour cette opération ! - - - Please select a Z column for this operation! - Sélectionnez une colonne Z pour cette opération ! - - - You need to define a X column first! - Vous devez d'abord définir une colonne X ! - - - You need to define a Y column first! - Vous devez d'abord définir une colonne Y ! - - - Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. - Depuis la version 0.9.1 Qtiplot sauvegarde les modèles de régression dans un dossier différent - - - If you want to save your already defined models, please choose a destination folder. - Si vous voulez sauvegarder vos modèles prédfinis, choisissez un dossier de destination - - - Import fit models - Importer un modèle de régression - - - Choose a directory to export the fit models to - Choisissez un répertoire pour exporter les modèles de regression - - - No Icon - Pas d'icônes - - - Couldn't load file: %1. -Autocompletion will not be available! - Ne peut charger le fichier: %1. -L'autocomplétion ne sera pas disponible - - - QtiPlot - Column selection error - QtiPlot - Erreur de sélection de la colonne - - - Please select exactly one column and more than one non empty cell! - Veuillez choisir exactement une colonne et plus d'une celllule non vide ! - - - The file: <b>%1</b> doesn't exist! - Le fichier <b> %1 </b> n'existe pas ! - - - The file: <b>%1</b> is not a QtiPlot or Origin project file! - Le fichier <b>%1</b> n'est pas un fichier QtiPlot ou un projet Origin ! - - - Cannot make a backup copy of <b>%1</b> (to %2).<br>If you ignore this, you run the risk of <b>data loss</b>. - Impossible de faire une sauvegarde de <b>%1</b> (vers %2).<br>Si vous ignorez ce message, vous prenez le risque de <b>perdre des données</b>. - - - Compressed QtiPlot project - Projet QtiPlot compressé - - - Save Project &As... - E&nregistrer le projet sous... - - - &Show All Windows - Montrer toutes les fenêtre&S - - - &Hide All Windows - Cac&Her toutes les fenêtres - - - New &Window - Nouvelle Fenêtre - - - New F&older - Nouveau Dossier - - - &None - &Aucun - - - QtiPlot - Error - QtiPlot - Erreur - - - Please enter a valid name! - Veuillez donner un nom valide ! - - - Size - Taille - - - bytes - octets - - - Created - Créé(e) - - - Modified - Modifié(e) - - - New Folder - Nouveau Dossier - - - Note - Commentaires - - - Label - Etiquette - - - Cannot move a parent folder into a child folder! - Ne peux pas déplacer un dossier père vers un dossier fils ! - - - QtiPlot - QtiPlot - - - The destination folder already contains a folder called '%1'! Folder skipped! - Le dossier de destination contient déjà un dossier '%1' ! - - - QtiPlot - Warning - QtiPlot - Avertissement - - - This will clear the contents of all the data associated with the table. Are you sure? - Toutes les données de la table seront effacées. Etes vous sûr ? - - - &Yes - Oui - - - QtiPlot - Enter row number - QtiPlot - Entrer le numéro de la ligne - - - Please set a default X column for this table, first! - Sélectionnez d'abord la colonne X par défaut pour cette table ! - - - Please select two columns for this operation! - Sélectionnez 2 colonnes pour cette opération ! - - - Could not allocate memory, operation aborted! - Allocation mémoire impossible, Opération annulée ! - - - Error in GSL forward FFT operation! - Erreur de la librarie GSL sur l'opération FFT ! - - - Please select a column to plot! - Sélectionnez une colonne à tracer ! - - - Please select four columns for this operation! - Sélectionnez quatre colonnes pour cette opération ! - - - QtiPlot - ASCII Export Error - Qtiplot - Erreur lors de l'exportation ASCII - - - Please select two columns for this operation: - the first represents the signal and the second the response function! - Sélectionnez 2 colonnes pour cette opération : -La première représente le signal et la seconde, la réponse de la fonction ! - - - The response dataset '%1' must be less then half the size of the signal dataset '%2'! - Les données de la réponse '%1' doivent être de moitié inférieure à la taille des données du signal '%2' ! - - - The response dataset '%1' must contain an odd number of points! - Les données de la réponse '%1' doivent contenir un nombre de points impaires ! - - - Frequency - Fréquence - - - Time - Temps - - - Real - Réel - - - Imaginary - Imaginaire - - - Amplitude - Amplitude - - - Angle - Angle - - - QtiPlot - untitled - QtiPlot - Sans nom - - - <b> %1 </b>: Wrong locale option or no translation available! - <b> %1 </b> : Langue inconnue ! - - - <b> %1 </b>: Unknown command line option or the file doesn't exist! - <b> %1 </b> : Commande inconnue ou le fichier n'existe pas ! - - - QtiPlot - Open Project - QtiPlot - Ouvrir un projet - - - The file: <b>%1</b> is not a QtiPlot project file! - Le fichier <b>%1</b> n'est pas un fichier projet QtiPlot ! - - - QtiPlot - File Backup Error - QtiPlot - Erreur lors de la sauvegarde automatique - - - QtiPlot - File Save Error - QtiPlot - Erreur lors de la sauvegarde du fichier - - - Save Project As - Enregistrer le projet sous - - - QtiPlot -- Overwrite File? - QtiPlot -- Ecraser le fichier ? - - - A file called: <p><b>%1</b><p>already exists. -Do you want to overwrite it? - Un fichier nommé <p><b>%1</b><p>existe déjà. -Voulez-vous l'écraser ? - - - Windows - Fenêtres - - - Folders - Dossiers - - - Plot - Graphe - - - Plot 3D - Graphe 3D - - - Rows will be deleted from the table! - Les rangées seront effacées de la table ! - - - Do you really want to continue? - Voulez-vous vraiment continuer ? - - - Cancel - Annuler - - - Columns will be deleted from the table! - Les colonnes seront effacées de la table ! - - - Origin project - Projet OriginLab - - - Skipped Moving Folder - Dossier inchangé - - - QtiPlot - HTTP Get Version File - QtiPlot - Recherche de mise à jour par le WEB - - - Cannot write file %1 -%2. - Ne peut pas écire le fichier %1 -%2. - - - Qtiplot - Reading file... - Qtiplot - Lecture du fichier... - - - Graph 3D - Graphe 3D - - - QtiPlot - Help - QtiPlot - Aide - - - AddWidgetTool - Click on plot to choose the position of the new object! Cliquer sur le graphique pour choisir la position du nouvel objet ! - - enter your text here Entrez votre texte ici - Move cursor in order to resize the new rectangle! - Bouger le curseur afin de redimensionner le nouveau rectangle + Bouger le curseur afin de redimensionner le nouveau rectangle ! - Move cursor in order to resize the new ellipse! Bouger le curseur afin de redimensionner la nouvelle ellipse ! @@ -904,3646 +23,1802 @@ ApplicationWindow - - File Fichier - - Plot Graphe - Pointer Pointeur - Zoom Zoom - Select data range Sélectionner les données - Move data points Déplacer une valeur - Remove data points Supprimer une valeur - Draw line Tracer une ligne - - - - - - - - Table Table - - Data Display Affichage des données - &File &Fichier - &New &Nouveau - &Recent projects - Projets récents - - - &Export Graph &Exporter - &Import ASCII - &Importer un fichier ASCII - - - &Edit - &Edition + &Édition - &View &Affichage - &Graph &Graphique - &Plot3D - Gra&phe 3D - - - &Matrix &Matrice - - - Special Line/Symb&ol Ligne/Symb&ole spécial - - - Statistical &Graphs &Graphes statistiques - - Pa&nel Pa&nneau - &Plot 2D - &Graphes 2D - - - - &Data &Données - Inter&polate - Inter&polation - - - Fit E&xponential Decay Ajustement décroissance e&xponentielle - &Analysis A&nalyse - For&mat - For&mat - - - &Windows Fenêt&re - - - &Help &Aide - - <h4>There are no tables available in this project.</h4><p><h4>Please create a table and try again!</h4> <h4>Il n'y a pas de tables disponibles dans ce projet.</h4><p><h4>Veuillez créer une table et réessayer !</h4> - - - QtiPlot - Choose data set QtiPlot - Choisissez une série de données - <h4>There are no matrixes available in this project.</h4><p><h4>Please create a matrix and try again!</h4> - <h4>Il n'y a pas de matrices disponibles dans ce projet.</h4><p><h4>Veuillez créer une matrice et réessayer !</h4> - - - - QtiPlot - Choose matrix to plot QtiPlot - Choisissez une matrice à tracer - QtiPlot - Import image from file QtiPlot - Importer une image à partir d'un fichier - QtiPlot - Load image from file QtiPlot - Charger une image à partir d'un fichier - - - - - - - - Matrix Matrice - Normal Normal - - - - - - - - - - - - - - - - - <h4>There are no plot layers available in this window.</h4><p><h4>Please add a layer and try again!</h4> <h4>Il n'y a pas de planche disponible dans cette fenêtre.</h4><p><h4>Veuillez ajouter une planche et réessayer !</h4> - QtiPlot - Error bars error QtiPlot - Erreur sur les barres d'erreur du graphe - - This feature is not available for user defined function curves! Cette fonctionnalité n'est pas disponible pour les fonctions définies par l'utilisateur ! - QtiPlot - File Open Error QtiPlot - Erreur lors de l'ouverture du fichier - <h4>There are no plot layers available in this window!</h4> <h4>Il n'y a pas de planche disponible dans cette fenêtre !</h4> - QtiPlot - Overwrite File? - QtiPlot - Ecraser le fichier? - - - - A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? Un fichier nommé : <p><b>%1</b><p>existe déjà. Voulez vous écraser ce fichier ? - - &Yes &Oui - - - &All &Tous les graphes - - - &Cancel &Annuler - QtiPlot - Export Error QtiPlot - Erreur lors de l'exportation - QtiPlot - File Save Error - QtiPlot - Erreur lors de la sauvegarde du fichier - - - QtiPlot -- Overwrite File? - QtiPlot -- Ecraser le fichier? - - - A file called: <p><b>%1</b><p>already exists. -Do you want to overwrite it? - Un fichier nommé : <p><b>%1</b><p>existe déjà. Voulez-vous l'écraser ? - - - &No - &Non + &Non - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QtiPlot - Error QtiPlot - Erreur - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QtiPlot - Warning - QtiPlot - Avertissement + QtiPlot - Attention - Not available for empty 3D surface plots! Non disponible pour un graphique de surface 3D vide ! - QtiPlot - Custom curves - QtiPlot - Courbes définies par l'utilisateur - - - - - - <h4>There are no plot layers available in this window.</h4> <h4>Il n'y a pas de planche disponible dans cette fenêtre.</h4> - Sorry, there are no results to display! Désolé, il n'y a pas de résultat à afficher ! - QtiPlot - Add new layer? - QtiPlot - Ajouter une nouvelle planche ? - - - Do you want to add the text on a new layer or on the active layer? - Voulez-vous ajouter ce texte sur une nouvelle planche ou sur la planche active ? - - - On &New Layer - Sur une &nouvelle planche - - - On &Active Layer - Sur la planche &active - - - QtiPlot - Define Layout - QtiPlot - Définir une planche - - - QtiPlot - Layer Geometry - QtiPlot - Géométrie de la planche - - - QtiPlot - Duplicate error QtiPlot - Erreur lors de la duplication - Empty 3D surface plots can not be duplicated! - Les graphiques de surface 3D vides ne peuvent pas être dupliqués ! - - - QtiPlot - Duplicate window error QtiPlot - Erreur lors de la duplication de la fenêtre - There are no windows available in this project! - Il n'y a pas de fenêtre disponible dans ce projet ! - - - QtiPlot - Window Geometry - QtiPlot - Géométrie de la fenêtre - - - About QtiPlot A propos de QtiPlot - &View pixel line profile - &Voir le profile en pixel suivant une ligne - - - &Intensity Matrix Matrice des &Intensités - &Cut Co&uper - - - - - - - - &Copy &Copier - - - - - &Delete &Supprimer - - - - &Properties &Propriétés - Please use the project explorer to select a window! Veuillez utiliser l'explorateur de projets pour sélectionner une fenêtre ! - QtiPlot - index.html File Not Found! QtiPlot - Fichier index.html non trouvé ! - There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! Il n'y a pas de fichier nommé <b>index.html</b> dans ce répertoire.<br>Veuillez choisir un autre répertoire ! - Print - Imprimer - - - Backward - Précédent - - - Forward - Suivant - - - Home - Dossier utilisateur - - - Surface 3D - Surface 3D - - - Coordinates - Coordonnées - - - &Coord - &Coordonnées - - - - - - Box Boîte - A - A - - - - - Frame Cadre - &Frame &Cadre - F - F - - - - No Axes Aucun axe - grid - Grille - - - Action - Action - - - Front Grid - Grille avant - - - Action_2 - Action 2 - - - Back Grid - Grille arrière - - - Action_3 - Action 3 - - - Right Grid - Grille de droite - - - Action_4 - Action 4 - - - Left Grid - Grille de gauche - - - Action_5 - Action 5 - - - Ceiling Grid - Grille de toit - - - Action_6 - Action 6 - - - Floor Grid - Grille de plancher - - - Plot Style - Style de graphe - - - - - - Wireframe Maillage transparent - - Hidden Line Maillage - - Polygon only Courbe 3D - - Mesh & filled Polygons Courbe 3D + maillage - - - - Dots Points - - - - Bars Barres - - - - Cones Cônes - Cross Hairs - Croix - - - Floor Style - Style de plancher - - - - Floor Data Projection Projection des données sur le plancher - - Floor Isolines Isolignes sur le plancher - - Empty Floor Plancher vide - QtiPlot - Guess best origin for the new layer? QtiPlot - Proposer une meilleure origine pour la nouvelle planche ? - Do you want QtiPlot to guess the best position for the new layer? Warning: this will rearrange existing layers! Voulez-vous que QtiPlot propose la meilleure position pour la nouvelle planche ? Attention : cela va modifier la disposition des planches existantes ! - &Guess &Proposer - &Top-left corner &Coin en haut à gauche - - - New &Project &Projet - - Ctrl+N Ctrl+N - - New &Table &Table - - Ctrl+T Ctrl+T - New spreadsheet - Feuille de calcul - - - - New &Matrix &Matrice - New matrix Nouvelle matrice - - New &Function Plot Graphe de &Fonction - - Ctrl+F Ctrl+F - New &Surface 3D Plot - Graphe de &Surface 3D - - - - Ctrl+Z Ctrl+Z - - &Open - &Ouvrir + &Ouvrir - - Ctrl+O Ctrl+O - Open project Ouvrir un projet - Open image &file - Ouvrir un &fichier image - - - - Ctrl+I Ctrl+I - - &Save Project Enregi&strer le projet - - Ctrl+S Ctrl+S - Save Project &as... - E&nregistrer le projet sous... - - - &Single file... - &Un seul fichier... - - - Import data file - Importer un fichier de données - - - &Multiple files... - &Plusieurs fichiers... - - - Import multiple data files - Importer plusieurs fichiers de données - - - - &Undo Ann&uler - - Ctrl+U Ctrl+U - - &Redo &Refaire Ctrl+R - Ctrl+R + Ctrl+R - - &Duplicate &Dupliquer - Duplicate window Dupliquer la fenêtre - Cu&t selection - Co&uper - - - - Ctrl+X Ctrl+X - &Copy selection - &Copier - - - - Ctrl+C Ctrl+C - &Paste selection - C&oller - - - - Ctrl+V Ctrl+V - &Delete selection - &Supprimer - - - Delete - Supprimer - - - Project &explorer - &Explorateur de projets - - - - Ctrl+E Ctrl+E - Show project explorer Afficher l'explorateur de projets - Results &Log &Historique des résultats - Show calculus results - Afficher les résultats des calculs - - - - Add La&yer - Ajouter une planche + Ajouter une &planche - - &Current Ce &graphe - - Ctrl+G Ctrl+G - Export current graph Exporter le graphe actif - - Alt+X Alt+X - Export all graphs Exporter tous les graphes - - - &Print Im&primer - - Ctrl+P Ctrl+P - Print graph - Imprimer le graphe - - - - E&xport ASCII - E&xporter en ASCII - - - Set import &options - &Options d'importation - - - - + E&xporter en ASCII + + &Quit &Quitter - - Ctrl+Q Ctrl+Q - Clear &log information - Effacer l'&historique - - - Plot &wizard - Assistant graphique - - - - Ctrl+Alt+W Ctrl+Alt+W - - &Preferences... &Préférences... - Add curve to graph Ajouter une courbe au graphe - - Add &Error Bars... Ajouter des barres d'&erreur... - - Ctrl+B Ctrl+B - - - - Ctrl+Alt+F Ctrl+Alt+F - &Rescale to show all - &Echelle automatique - - - Best fit - Meilleur ajustement + Afficher toutes les données - - New &Legend Nouvelle &Légende - - Ctrl+L Ctrl+L - Add new legend Ajouter une nouvelle légende - - Add &Image Ajouter une &image - - Add &Text Ajouter du &texte - - &Line &Ligne - Plot with line - Lignes - - - - - - &Scatter &Nuage - Plot with symbols - Symboles - - - - Line + S&ymbol Ligne + S&ymbole - Plot with line + symbols - Lignes et symboles - - - Vertical &drop lines - Eping&les - - - - &Spline &Spline - - &Vertical Steps Marches &verticales - - - - &Columns &Colonnes - Plot with vertical bars Barres verticales - - &Rows &Rangées - Plot with horizontal bars Barres horizontales - - &Area &Aire - Plot area Graphe - - &Pie &Secteur - Plot pie Secteurs - &Vectors &XYXY &Vecteurs &XYXY - - &Histogram &Histogramme - - &Stacked Histogram Hi&stogramme empilé - - &Vertical 2 Layers &Colonne de 2 planches - - &Horizontal 2 Layers &Rangée de 2 planches - - &4 Layers Tableau de &4 planches - - &Stacked Layers - Planches empilés + Planche&s empilés - - &Ribbon &Rubans - Plot 3D Ribbon - Rubans 3D - - - - &Bars &Barres - Plot 3D Bars - Barres 3D - - - Plot 3D Scatter - Nuage 3D - - - - &Trajectory &Trajectoire - Plot 3D Trajectory - Graphe à trajectoire 3D - - - - Ctrl+M Ctrl+M - - Alt+R Alt+R - - Statistics on &Columns Statistiques sur &colonnes - Selected columns statistics Statistiques sur les colonnes - - Statistics on &Rows Statistiques sur &rangées - Selected rows statistics Statistiques sur les rangées - &Integrate ... - &Intégrer... - - - Li&near - Li&néaire - - - Cu&bic spline - spline cu&bique - - - Non-&rounded Akime spline - Spline Akime non ar&rondie - - - &Forward - &Directe - - - &Inverse - &Inverse - - - - &Differentiate &Dériver - - Fit &Linear Ajustement &linéaire - - Fit &Polynomial ... Ajustement &Polynomial... - - &First Order ... &Premier ordre... - - &Second Order ... &Second ordre... - - &Third Order ... &Troisième ordre... - - Fit &Gaussian Ajustement &Gaussien - - Fit Lorent&zian Ajustement &Lorentzien - &Non-linear Curve Fit ... - Ajustement &non-linéaire - - - - Ctrl+Y Ctrl+Y - - &Plot ... &Graphique... - &Axes/Grid ... - &Axes/Grille ... - - - - &Title ... &Titre... - - &Columns... - &Colonnes... + Nombre de &colonnes... - - &Rows... - &Rangées... - - - &About - &A propos - - - - + Nombre de &rangées... + + F1 F1 - - Ctrl+H Ctrl+H - &Choose help folder... - &Choisir le répertoire d'aide... - - - - - &Rename Window &Renommer - - - Close &Window &Fermer la fenêtre - - Ctrl+W Ctrl+W - Add column - Ajouter une colonne - - - - Window &Geometry... &Géométrie... - - - - &Hide Window - Cacher + Cac&her - - More windows... Autres fenêtres... - &Intensity table - Table des &intensités - - - - &Activate Window &Activer la fenêtre - - Mi&nimize Window Réd&uire la fenêtre - - Ma&ximize Window Ma&ximizer la fenêtre - - Re&size Window... &Redimensionner la fenêtre... - &Print Window Im&primer la fenêtre - &Layer geometry - Géométrie de la planche - - - E&mpty 3D plot - Graphe 3D &Vide - - - Add 3D &Function - Ajoute une &Fonction 3D - - - Add 3D &Data - Ajouter des &données 3D - - - - Set &Properties... &Propriétés... - - Set &Dimensions... &Dimensions... - - Set &Values... &Valeurs... - - &Transpose &Transposer - - &Invert &Inverser - - &Determinant &Déterminant - &Convert to spreadsheet - &Convertir en feuille de calcul - - - - 3D &Wire Frame &Fil de fer 3D - - 3D &Hidden Line Lignes &cachées 3D - - 3D &Polygons &Polygônes 3D - - 3D Wire &Surface &Surface 3D - Matrix Plot 3D - Graphe 3D de matrice - - - Data Plot 3D - Graphe 3D de données - - - Function Plot 3D - Graphe 3D de fonctions - - - - There are no curves available on this plot! Il n'y a pas de courbes disponibles sur ce graphe ! - The graph you want to analyse doesn't exist anymore. -Operation aborted! - Le graphe que vous voulez analyser n'existe plus. Opération abandonnée! - - - Disable &tools Poin&teur - - &Zoom &Zoom - ALT+Z - Alt+Z - - - &Data reader - Curseur sur courbe - - - - CTRL+D CTRL+D - Data reader Curseur sur courbe - &Select data range - Gamme des données - - - - ALT+S Alt+S - S&creen reader - Curseur libre - - - Screen reader Curseur libre - - &Move Data Points... - Déplacer une valeur... + &Déplacer une valeur... - - Remove &Bad Data Points... - Supprimer une valeur... + &Supprimer une valeur... - - Alt+B Alt+B - Draw &Arrow/Line - Tracer une &Flèche/Ligne - - - - CTRL+ALT+L Ctrl+Alt+L - - - &Table &Table - Plot 3&D - Graphe 3&D - - - - - - - - - QtiPlot - Plot error QtiPlot - Erreur lors du tracé du graphe - - - - - You must select exactly one column for plotting! Vous ne devez sélectionner qu'une seule colonne ! - Please select a column to plot! Veuillez sélectionner une colonne à tracer ! - This operation can not be performed on curves plotted from columns having a non-numerical format. - Cette opération ne peut pas être réalisée pour des courbes tracées à partir de colonnes ayant des données non numériques. - - - Choose a directory to export the tables to - Choisissez un répertoire pour exporter les tables - - - There are no plot layers available in this window! Il n'y a pas de planche disponible dans cette fenêtre ! - - - - - - - - - - This functionality is not available for pie plots! Cette fonctionnalité n'est pas disponible pour des graphiques à secteurs ! - There are no plot layers available in this window. Il n'y a pas de planche disponible dans cette fenêtre. - Alt+L - Alt+L - - - Alt+A - Alt+A - - - Import i&mage... - Importer une i&mage... - - - - ALT+L Alt+L - - Arran&ge Layers Re&disposer les planches - ALT+A - Alt+A - - - - Print All Plo&ts Imprimer &tous les graphes - Delete &fit tables - Supprimer les tables des &ajustements - - - - Add/Remove &Curve... Ajouter/Supprimer une &courbe... - - ALT+C Alt+C - - Add &Function... Ajouter une &Fonction... - - ALT+I Alt+I - - ALT+T Alt+T - - Fit Exponential Gro&wth ... Ajustement &croissance exponentielle... - - Column &Options ... &Options de la colonne... - - Set Column &Values ... Fixer les &Valeurs de la Colonne... - - &Remove Layer &Supprimer la planche - Convert to &matrix - Convertir en &matrice - - - - Inte&rpolate ... Inte&rpolation... - QtiPlot - Project Explorer - QtiPlot - Explorateur de Projets - - - - Name Nom - - - - - - - - - Type Type - - View Vue - - - - - Size Taille - - - - - - Created Créé - - - Label Étiquette - QtiPlot - Results Log - Qtiplot - Historique des Résultats - - - QtiPlot - Enter rows number QtiPlot - Entrer le nombre de rangées - Rows Rangées - QtiPlot - Enter columns number QtiPlot - Entrer le nombre de colonnes - Columns Colonnes - - - - - - - - - - - - QtiPlot - Column selection error QtiPlot - Erreur de sélection de la colonne - - - - - Please select a column first! Vous devez d'abord sélectionner une colonne ! - Line + s&ymbol - Ligne + S&ymbole - - - 3D Ribbo&n - ruba&ns 3D - - - 3D &Bars - &Barres 3D - - - 3&D Scatter - Nuage 3&D - - - 3D &Trajectory - &Trajectoire 3D - - - &Stacked Histograms - Hi&stogramme empilé - - - - - &Plot &Graphe - - - - - - Cu&t Co&uper - - Past&e C&oller - None - Aucun - - - Set as... - Fixer à... - - - Set column &values... - Fixer les &valeurs de la colonne... - - - - Ro&w Numbers Numéros des &rangées - &Random values - Valeurs &Aléatoires - - - &Fill column with - &Remplir la colonne avec - - - &Column &Colonnes - - - &Normalize &Normaliser - - - - Clea&r Efface&r - - &Insert &Insérer - &Add column - &Ajouter une colonne - - - &Ascending Croiss&ant - &Descending &Décroissant - Sort Colu&mn Trier la &colonne - - Sort Ta&ble Trier la ta&ble - Pr&operties - Pr&opriétés - - - Vectors &XYXY - Vecteurs &XYXY - - - &Fill columns with - &Remplir les colonnes avec - - - &Sort - &Trier - - - &Cascade &Cascade - &Tile - Adossées - - - &Next - &Suivante - - - &Previous - &Précédente - - - + A&dossées + + &Rename - &Renommer + &Renommer - - - - &Properties... &Propriétés... - Save changes to project: <p><b> %1 </b> ? Sauvegarder les changements du projet : <p><b> %1 </b> ? - - &Axes... &Axes... - - &Grid ... &Grille... - Y Axis Title - Étiquette de l'axe Y - - - X Axis Title - Étiquette de l'axe X - - - - &Worksheet &Feuille de calcul - - Yes Oui - - No Non - - - Cancel - &Annuler + Annuler - QtiPlot - Edit function QtiPlot - Modifier la fonction - &Smooth Li&sser - &FFT filter &Filtrage Numérique - Hidden - Caché + Caché - - Maximized Maximum - Minimized Minimum - &Delete Window - Effacer la fenêtre - - - D&epending Plots - Graphes dép&endants - - - D&epending 3D Plots - Graphes 3D Dép&endants - - - - - + Effacer la &fenêtre + + D&epends on - Suivant + &Suivant - Function Fonction - Re&move pie curve - Effacer les secteurs - - - Anal&yse - Anal&yse - - - &Paste layer - Coller la &planche - - - &Paste text - Coller le texte - - - &Paste line/arrow - Coller la ligne/flêche - - - &Paste image - Coller l'image - - - - - &Layer &P&lanche - - - &Window - Fenêtre + &Fenêtre - E&xport E&xporter - &Geometry... - &Géométrie... - - - P&roperties... P&ropriétés... - &Delete Layer - &Supprimer la planche - - - - &Paste Layer Coller la &planche - &Copy Page &Copier la page - E&xport Page E&xporter la page - - - - &Paste - Coller + &Coller - Clea&r Rows - Effacer les rangées + Effacer les &rangées - - &Delete Rows - Supprimer les rangées - - - &Plot 3D - Graphes 3D - - - + Su&pprimer les rangées + + &Matrix... &Matrice... - Choose &Data Set... Remplacer &Données... - Choose &Matrix... Choisir une &matrice... - C&lear - Supprimer + &Supprimer - &Copy Graph &Copier le graphe - &Export &Exporter - Add time stamp - Ajouter Date et Heure - - - - Ctrl+ALT+T Ctrl+Alt+T - Date & Time - Date & Temps - - - - &Low Pass... Passe ba&s... - - &High Pass... Passe &haut... - - &Band Pass... Passe &bande... - - &Band Block... - Réjecteur... + &Réjecteur... - - &FFT... &FFT... - - &Savitzky-Golay... &Savitzky-Golay... - - &FFT Filter... &Filtre Passe bas... - - Moving Window &Average... &Moyenne glissante... - Edit 3D &Surface - Modifier la surface 3D - - - - &Surface... &Surface... - - &Data Set... - Fixer les valeurs... - - - &Smoothing - Li&ssage - - - &Add/Remove Curve - &Ajouter/Enlever une courbe - - - Add &Error Bars - Ajouter des barres d'&erreurs - - - + &Fixer les valeurs... + + Clea&r Row Effacer la &rangée - &Delete Row - Supprimer la rangée + &Supprimer la rangée - - Sort Columns Trier les colonnes - - Co&rrelate - Corrélation + Co&rrélation - - &Convolute &Convolution - - &Deconvolute &Déconvolution - - - - - - - QtiPlot - File openning error QtiPlot - Erreur lors de l'ouverture du fichier - The file: <b> %1 </b> doesn't exist! - Le fichier : <b> %1 </b> n'existe pas ! - - - &Translate &Translation - Set columns &as - Fixer la colonne &à - - - - - Please select a Y column to plot! Sélectionnez une colonne Y à tracer ! - The selected columns have different numbers of rows! Les colonnes sélectionnées ont un nombre de rangées différentes ! - The selected error column is empty! La colonne d'erreur sélectionnée est vide ! - - The file: <b> %1 </b> was not created using QtiPlot! Le fichier : <b> %1 </b> n'a pas été créé avec QtiPlot ! - QtiPlot - Open Project - QtiPlot - Ouvrir un projet - - - The file: <b>%1</b> is the current file! Le fichier : <b> %1 </b> est le fichier actuel ! - - - - The file: <b>%1</b> doesn't exist! Le fichier : <b> %1 </b> n'existe pas ! - The file: <b>%1</b> is not a QtiPlot or Origin project file! - Le fichier : <b>%1</b> n'est pas un fichier QtiPlot ou un projet Origin ! + Le fichier : <b>%1</b> n'est pas un fichier QtiPlot ou un projet Origin ! - The file: <b> %1 </b> <p>does not exist anymore!<p>It will be removed from the list. Un fichier nommé <p><b>%1</b><p>n'existe plus. Il sera effacé de la liste. - The file: <b> %1 </b> is the current file! - Le fichier : <b> %1 </b> est le fichier actuel ! - - - - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Impossible d'enregistrer le fichier <br><h4> %1 </h4><p>. Vérifiez que vous avez les droits requis pour écrire à cet emplacement ! - Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! Impossible d'enregistrer le fichier : <br><h4> %1 </h4><p>. Vérifiez que vous avez les droits requis pour écrire à cet emplacement ! - Choose a filename to save under Choisissez un nom pour sauvegarder ce fichier - Set as - Fixer à - - - QtiPlot - Empty plot - QtiPlot - Graphe Vide - - - There are actually no curves on the active layer! - Aucune courbe sur la planche active ! - - - - - - - - - - - - - - - - - - - - QtiPlot QtiPlot - - This will modify the data in the worksheets! Are you sure you want to continue? Ceci modifiera les données dans les tables ! -Etes vous sûr de vouloir continuer ? +Êtes vous sûr de vouloir continuer ? - - Continue Continuer - Click on plot or move cursor to display coordinates! - Cliquez sur le graphe ou déplacez le curseur pour afficher les coordonnées ! - - - Click on plot to display information! - Cliquez sur le graphe pour afficher les informations ! - - - - - QtiPlot - Help Files Not Found! QtiPlot - Fichiers d'aide non trouvés ! - Please indicate the location of the help file!<br><br><p>The manual can be downloaded from the following internet address:</p><p><font color=blue>'http://soft.proindependent.com/manuals.html'</font></p> - Indiquez l'emplacement du fichier d'aide ! <br><br><p>Le manuel peut être téléchargé de l'adresse Internet suivante : </p><p><font color=blue>'http://soft.proindependent.com/manuals.html'</font></p> - - - QtiPlot - Help Browser - QtiPlot - Navigateur d'aide - - - Curve: - Courbe : - - - - &Horizontal &Horizontale - - &Vertical &Verticale - - &None Aucu&n - Too many command line options (maximum accepted is 2)! - Trop d'options en ligne de comnade (2 maximum) ! - - - <b> %1 </b>: Unknown command line option or the file doesn't exist! - <b> %1 </b> : Option en ligne de commande inconnue ou le fichier n'existe pas ! - - - - - Folder Dossier - UNTITLED SANS TITRE - - Edit - Edition + Édition - - Ctrl+ALT+M Ctrl+Alt+M - - QtiPlot - untitled QtiPlot - Sans nom - - Project Explorer Explorateur de projets - - Results Log Historique des résultats - Fit &Multi-peak Fit &Multi-pics - There are no available columns with plot designation set to Z! Aucune colonne disponible pour le graphe de la colonne Z ! - - The table '%1' already exists. It has been renamed '%2'. - La table '%14 existe déjà. Elle a été renommée en '%2'. - - - The matrix '%1' already exists. It has been renamed '%2'. - La matrice '%1' existe déjà. Elle a été renommée en '%2'. - - - + La table '%1' existe déjà. Elle a été renommée en '%2'. + + Determinant of Déterminant de - - - - - - - - QtiPlot - File opening error QtiPlot - Erreur lors de l'ouverture du fichier - The file <b>%1</b> is corrupted, but there exists a backup copy.<br>Do you want to open the backup instead? Le fichier <b>%1</b> est corrompu mais une copie de restauration existe.<br>Voulez vous plutôt ouvrir cette copie ? - QtiPlot - Opening file QtiPlot - Ouverture du fichier - QtiPlot - Open Template File QtiPlot - Ouvrir un modèle - graph1 - graph1 - - - table1 - table1 - - - Matrix1 - Matrice1 - - - The file: <b>%1</b> is not a QtiPlot template file! Le fichier <b>%1</b> n'est pas un modèle QtiPlot ! - - QtiPlot project Projet QtiPlot - - Compressed QtiPlot project Projet QtiPlot compréssé - Origin project - Projet Origin - - - All files - Tous les fichiers - - - Save Project As Sauvegarder le projet sous - QtiPlot Matrix Template Modèle de Matrice Qtiplot - QtiPlot 2D Plot Template - Modèle de Graphe 2D Qtiplot - - - QtiPlot Table Template Modèle de Table Qtiplot - QtiPlot 3D Surface Template Modèle de Graphe 3D Qtiplot - Save Window As Template Sauvegarder la fenêtre comme modèle - - Please enter a valid name! Donnez un nom valide ! - The name you chose is not valid: only letters and digits are allowed! Le nom que vous avez choisi n'est pas valide : seuls les lettres et les caractères alphanumériques sont autorisés ! - - - Please choose another name! Choisissez un autre nom ! - Name already exists! - Ce nom existe déjà ! - - - The table name must be different from the names of its columns! - Le nom de la table doit être différent des noms de colonnes ! - - - QtiPlot - X Axis Title - QtiPlot - Titre Axe X - - - QtiPlot - Y Axis Title - QtiPlot - Titre Axe Y - - - QtiPlot - Right Axis Title - QtiPlot - Titre Axe de Droite - - - QtiPLot - Top Axis Title - QtiPlot - Titre Axe de Gauche - - - There are actually no curves on the active layer! - Aucune courbe disponible sur la planche active ! - - - - - + Ce nom existe déjà ! + + &Delete Selection - Effacer la sélection + E&ffacer la sélection - - New &Window - Nouvelle fenêtre + &Nouvelle fenêtre - - New F&older Nouveau D&ossier - Auto &Column Width - Largeur automatique + &Largeur automatique - - &Insert Row &Insérer une rangée - &Insert Column &Insérer une colonne - &Delete Columns - Effacer les colonnes + &Effacer les colonnes - - New &Graph - Graphe + &Graphe - - New &Note - Commentaires + Comme&ntaires - - Ctrl+ALT+Z Ctrl+Alt+Z - Open Temp&late... Ouvrir un modè&le... - Save as &Template... - Sauvegarder comme modèle... - - - - Vectors XY&AM Vecteurs XY&AM - - Fit &Boltzmann (Sigmoidal) Ajustement de &Boltzmann (Sigmoïdal) - &Curves ... - &Courbes... - - - - &Scales... - Echelle&s... + Échelle&s... - - &About QtiPlot &A propos de QtiPlot - - &Box Plot - Graphe de boîtes + Graphe de &boîtes - - &Gaussian... &Gaussienne... - - &Lorentzian... &Lorentzienne... - &Search for Updates - Recherche de mi&ses à jour - - - - &QtiPlot Homepage Page d'accueil de &QtiPlot - Download &manual - Télécharger le &manuel - - - - &Translations &Traductions - Make a &donation - Faire un &don - - - Technical &support - &Support technique - - - Open a new project Nouveau projet - Create an empty 2D plot Créer un graphe 2D vide - Create an empty note window Créer une fenêtre de commentaires vide - New Table - Nouvelle table - - - Create a new 2D function plot Créer un nouveau graphe de fonction 2D - Create a new 3D surface plot Créer un nouveau graphe 3D - Save Project - Sauvegarder le projet - - - Open Te&mplate... Ouvrir un &modèle... - Open Template - Ouvrir un modèle - - - Save Window as Template - Sauvegarder la fenêtre comme modèle - - - Undo changes Annuler - Redo changes Refaire - Cut selection Couper - Copy selection Copier - Paste selection Coller - Delete selection Effacer - Print window Imprimer la fenêtre - &Vectors XYXY &Vecteurs XYXY - Vectors XYXY Vecteurs XYXY - Vectors XYAM Vecteurs XYAM - &Curves... - &Courbes... - - - Box and Whiskers Plot - Graphe Whiskers - - - Double-click on plot to select a data point! - Double-cliquez pour sélectionner un point ! - - - QtiPlot - Enter the number of peaks QtiPlot - Donnez le nombre de pics - Peaks Pics - Move cursor and click to select a point and double-click/press 'Enter' to set the position of a peak! - Déplacer le curseur et cliquez poour sélectionner un point et double-qliquez (ou tapez 'Entrée') pour fixer la position d'un Pic ! - - - Sorry, QtiPlot couldn't start the default browser! Please start a browser manually and visit the following link - Désolé, QtiPlot ne parvient pas démarrer le navigateur ! Lancez votre navigateur manuellement et visitez le lien suivant - - - English Français - <b> %1 </b>: Wrong locale option or no translation available! - <b> %1 </b> : langue inconnue ou mauvaise traduction ! - - - The file: <b>%1</b> is not a QtiPlot project file! - Le fichier <b>%1</b> n'est pas un fichier projet QtiPlot ! - - - QtiPlot - File Backup Error - QtiPlot - Erreur de sauvegarde automatique - - - + <b> %1 </b> : Langue inconnue ou traduction indisponible ! + + Cannot make a backup copy of <b>%1</b> (to %2).<br>If you ignore this, you run the risk of <b>data loss</b>. - Impossible de faire une sauvegarde de <b>%1</b> (vers %2).<br>Si vous ignorez ce message, vous prenez le risque de <b>prendre des données</b>. + Impossible de faire une sauvegarde de <b>%1</b> (vers %2).<br>Si vous ignorez ce message, vous prenez le risque de <b>prendre des données</b>. - The file: <br><b>%1</b> is opened in read-only mode - Le fichier <br><b>%1</b> est ouvert en lecture seule + Le fichier <br><b>%1</b> est ouvert en lecture seule - - - - &Find... - Chercher... + &Chercher... - - App&end Project... Ajout&er un projet... - Save &As Project... - S&auvegarder comme projet... + S&auvegarder comme projet... - - Save Project &As... - Enregistrer le projet sous... + Enregistrer le projet so&us... - - &Show All Windows - Montrer toutes les fenêtres + Montrer toutes le&s fenêtres - - &Hide All Windows Cac&her toutes les fenêtres - &Delete Folder - Supprimer le dossier + Supprimer le &dossier - &Windows in Active Folder - Dans le dossier actif + Dans le dossier acti&f - Windows in &Active Folder && Subfolders - Dans le dossier actif et les sous-dossiers + Dans le dossier &actif et les sous-dossiers - &View Windows - Afficher les fenêtres + Afficher les &fenêtres - Project - Projet + Projet - - - Path - Chemin + Chemin - - Contents - Contenu - - - Windows - Fenêtres - - - Folders - Dossiers - - - + Contenu + + Modified - Modifié + Modifié - - - Properties - Propriétés + Propriétés - New Folder - Nouveau Dossier + Nouveau Dossier - QtiPlot - Delete folder? - QtiPlot - Supprimer le dossier ? + QtiPlot - Supprimer le dossier ? - Delete folder '%1' and all the windows it contains? - Supprimer le dossier '%1' et toutes les fenêtres qu'il contient ? + Supprimer le dossier '%1' et toutes les fenêtres qu'il contient ? - - Note - Commentaire - - - Plot 3D - Graphe 3D - - - + Commentaire + + Status - Etat + Etat - QtiPlot - No match found - QtiPlot - Pas de correspondance + QtiPlot - Pas de correspondance - Sorry, no match found for string: '%1' - Désolé, '%1' introuvable + Désolé, '%1' introuvable - Cannot move an object to itself! - Impossible de déplacer un objet vers lui-même ! + Impossible de déplacer un objet vers lui-même ! - Cannot move a parent folder into a child folder! - Ne peut pas déplacer un dossier père vers un dossier fils ! + Ne peut pas déplacer un dossier père vers un dossier fils ! - - The destination folder already contains a folder called '%1'! Folder skipped! - Le dossier de destination contient déjà un dossier nommé '%1'. Le dossier n'a pas été déplacé ! - - - QtiPlot - Skipped Moving Folder - QtiPlot - - - - Skipped Moving Folder - Dossier inchangé! - - - Key_Delete - Suppr - - - pixels - pixels - - - pixel intensity (a.u.) - Intensité (u.a) - - - - + Le dossier de destination contient déjà un dossier nommé '%1'. Le dossier n'a pas été déplacé ! + + Scripting Console Console d'édition de scripts - - &Zoom In &Zoom + - - Ctrl++ Ctrl++ - Zoom &Out Zo&om - - - Ctrl+- Ctrl+- - - Draw &Arrow &Ajouter une flèche - - CTRL+ALT+A Ctrl+Alt+A - - Draw &Line Ajouter une &ligne - This operation cannot be performed on curves plotted from columns having a non-numerical format. - Cette opération ne peut être réalisée sur des courbes ayant des colonnes au format non numérique. - - - Text - Texte - - - Data - Données - - - Comma Separated Values - Valeurs séparées par une virgule - - - QtiPlot - Import ASCII File - QtiPlot - Importer un fichier ASCII - - - + Données + + Window Fenêtre - QtiPlot - Row selection error QtiPlot - Erreur de sélection de rangée - Please select a row first! - Sélectionnez d'abord une rangée ! - - - X - X - - - Y - Y - - - Z - Z - - - X Error - Erreur en X - - - Y Error - Erreur en Y - - - - + Vous devez d'abord sélectionner une rangée ! + + Recalculate Recalculer - Click on data point to display information! - Cliquez sur un point pour afficher l'information ! - - - Images Images - QtiPlot - Insert image from file QtiPlot - insérer une image à partir d'un fichier - Empty 3D surface plots cannot be duplicated! Les courbes de surfaces 3D vides ne peuvent pas être dupliquées ! - QtiPlot - Set the number of pixels to average QtiPlot - Fixez le nombre de pixels à moyenner - Number of averaged pixels Nombre de pixels moyennés - Scripting &Console - &Console d'édition de scripts - - - Alt+G - Alt+G - - - - - Ctrl+Shift+R Ctrl+Shift+R - - - &X &X - - - &Y &Y - - - &Z &Z - - - X E&rror E&rreur en X - - - Y &Error &Erreur en Y - - Search for &Updates - Recherche de mises à jour + Recherche de mises à jo&ur - &Console &Console - Show Scripting console Afficher la console d'édition de scripts - Zoom In Zoom + - Zoom Out Zoom - - Draw arrow Désiner une flèche - - - - - - - - - - - - - - Graph Graphe - QtiPlot - Python Script Window - QtiPlot - Fenêtre d'édition de Script - - - S&cripting - Script - - - <h4>There are no matrices available in this project.</h4><p><h4>Please create a matrix and try again!</h4> <h4>Il n'y a pas de matrices disponibles dans ce projet.</h4><p><h4>Veuillez créer une matrice et réessayer !</h4> - - QtiPlot - Renamed Window Qtiplot - Fenêtre renommée - - - Notes Commentaires - The file "%1" was created using "%2" as scripting language. Initializing support for this language FAILED; I'm using "%3" instead. @@ -4554,3513 +1829,2680 @@ Quelques parties de ce fichier peuvent ne pas être affichés comme attendu. - QtiPlot - Scripting Error QtiPlot - Erreur de Script - Scripting language "%1" failed to initialize. L'initialisation du langage de script "%1" a échouée. - Choose a directory to export the graphs to Choisir un répertoire vers lequel exporter les graphes - Python Source - Source Python - - - All Files - Tous les fichiers - - - Save Notes As... - Sauvegarder les commentaires sous... - - - QtiPlot 2D Graph Template Modèle de graphe QtiPlot 2D - - - &Edit Function... - Modifi&er la fonction... - - - - &Plot details... - Détails du graphe... + &Propriétés... - D&epending Graphs Graphes dép&endants - D&epending 3D Graphs Graphe 3D dép&endants - &Graph 3D - &Graphe 3D - - - Choose the location of the QtiPlot help folder! Choisir l'emplacement pour le répertoire du fichier d'aide ! - Open File - Ouvrir le fichier - - - Alt+F4 - Alt+F4 - - - - + Ouvrir le fichier + + Ctrl+Alt+O Ctrl+Alt+O - - - - Ctrl+Return Ctrl+Entrée - - &Go to Row... - Aller à la rangée... + Aller à la ran&gée... - - - - Ctrl+Alt+G Ctrl+Alt+G - - Clear Effacer - - Scripting &language - Langage de script + &Langage de script - - &Restart scripting - &Redémarrer + Lan&cer - - E&xecute - Exécuter + É&xécuter - - Ctrl+J Ctrl+J - - Execute &All - Tout exécuter + &Tout exécuter - - Ctrl+Shift+J Ctrl+Shift+J - - &Evaluate Expression - Evaluer l'expression - - - &Python Script Window - Fenêtre d'édition de script - - - - + &Évaluer l'expression + + F3 - F3 - - - Fit - Ajuster - - - QtiPlot - HTTP Get Version File - QtiPlot - Recherche de mise à jour par le WEB - - - Cannot write file %1 -%2. - Ne peut pas écire le fichier %1 -%2. - - - + F3 + + Error while fetching version file with HTTP: %1. - Erreur lors de la recherche de la version du fichier par le WEB : %1. + Erreur lors de la recherche de la version du fichier par le WEB : %1. - QtiPlot - Updates Available - QtiPlot - Mises à jour disponibles + QtiPlot - Mises à jour disponibles - There is a newer version of QtiPlot (%1) available for download. Would you like to download it? - Une nouvelle version de QtiPlot (%1) est disponible. Voulez-vous la télécharger ? + Une nouvelle version de QtiPlot (%1) est disponible. Voulez-vous la télécharger ? - QtiPlot - No Updates Available - QtiPlot - Aucune mise à jour disponible + QtiPlot - Aucune mise à jour disponible - No updates available. Your current version %1 is the last version available! - Aucune mise à jour disponible. Votre version %1 est la dernière disponible ! + Aucune mise à jour disponible. Votre version %1 est la dernière disponible ! - - Matrix Plot Tracé de matrice - QtiPlot - Script Window QtiPlot - Fenêtre de script - The file: <p><b> %1 </b><p> is the current file! Le fichier : <p><b> %1 </b><p> est le fichier actuel ! - Name <b>%1</b> already exists! Le nom <b>%1</b> existe déjà ! - Warning: for internal consistency reasons the underscore character is replaced with a minus sign. Averstissement : pour des raisons d'uniformité, le trait souligné (_) est remplacé par le signe moins (-). - - &Horizontal Steps Pas &horizontaux - - QtiPlot - Help Profile Not Found! QtiPlot - Profile d'aide non trouvé ! - The assistant could not start because the file <b>%1</b> was not found in the help file directory!<p>This file is provided with the QtiPlot manual which can be downloaded from the following internet address:</p><p><font color=blue>'http://soft.proindependent.com/manuals.html'</font></p> - L'assistant ne peut démarre car le fichier <b>%1</b> n'est pas dans le répertoire d'aide ! <p> Ce fichier est fourni avec le manuel de QtiPlot qui peut être téléchargé depuis la site internet :</p><p><font color=blue>'http://soft.proindependent.com/manuals.html'</font></p> - - - Ctrl+K Ctrl+K - Ctrl+Alt+K - Ctrl+Alt+K - - - - - Automatic Layout Disposition automatique - - - - Alt+Q Alt+Q - Contour - &Color Fill Contour - &Couleur de remplissage - - Contour &Lines &Lignes du contour - - &Gray Scale Map Carte d'échelle de &gris - Script Window Fenêtre de script - Add Layer Ajouter une planche - Arrange Layers Redisposer les planches - Add Error Bars... Ajouter des barres d'erreurs... - Add Function... Ajouter une fonction... - Add Image Ajouter une image - Contour + &Color Fill Contour + &couleur de remplissage - Contour Lines + Color Fill Lignes du contour + couleur de remplissage - Contour Lines Lignes du contour - Gray Scale Map Carte d'échelle de gris - Add Text Ajouter du texte - - - - Animation Animation - - - - Enable perspective Perspective - - - - Reset rotation MaJ Rotation - - - - Fit frame to window Ajuster le cadre à la fenêtre - &Next next window Suiva&nte - F5 next window shortcut F5 - &Previous previous window &Précédente - F6 previous window shortcut F6 - Disable &Tools Poin&teur - &Zoom Out &Zoom + - - &Data Reader - Curseur sur courbe + &Curseur sur courbe - - &Select Data Range Gamme des donnée&s - - S&creen Reader &Curseur libre - - 3D Surface Surface 3D - - &Recent Projects P&rojets récents - 3&D Plot Graphe 3&D - Set Columns &As Fixer la colonne &à - - &Fill Columns With - Remplir les colonnes avec - - - &FFT Filter - &Filtrage Numérique - - - Fit &Multi-Peak - Fit &Multi-pics - - - Scripting - Script - - - - + &Remplir les colonnes avec + + 3D &Plot - Graphes 3D + &Graphes 3D - - - - - - - - Column Colonne - Script Error Fenêtre de script - Table1 Table1 - - - - - - - QtiPlot - Export error QtiPlot - Erreur lors de l'exportation - - QtiPlot - Overwrite file? QtiPlot - Écraser le fichier? - Please select two columns for this operation! Sélectionnez 2 colonnes pour cette opération ! - Please select exactly one columns for this operation! Vous ne devez sélectionner qu'une seule colonne ! - - Please select two columns for this operation: the first represents the signal and the second the response function! Sélectionnez 2 colonnes pour cette opération : La première représente le signal et la seconde, la réponse de la fonction ! - - Vertical &Drop Lines - Epingles + &Épingles - - Set As Fixer à - &Fill Column With - Remplir la colonne avec - - - &Add Column - &Ajouter une colonne - - - + &Remplir la colonne avec + + Could not write to file: <h4>%1</h4><p>Please verify that you have the right to write to this location or that the file is not being used by another application! Impossible d'écrire dans le fichier : <h4>%1</h4><p> Vérifiez que vous possédez les droits d'écriture dans ce répertoire ou que le fichier n'est pas utilisé par une autre application ! - - Released Mis à jour - Re&move Pie Curve - Effacer les secteurs + &Effacer les secteurs - Anal&yze Anal&yse - &Paste Text - Coller le texte + &Coller le texte - &Paste Line/Arrow - Coller la ligne/flêche + &Coller la ligne/flêche - &Paste Image - Coller l'image + &Coller l'image - - The manual can be downloaded from the following internet address: Le manuel peut être téléchargé depuis l'adresse suivante : - - The assistant could not start because the file <b>%1</b> was not found in the help file directory! L'assistant ne peut démarrer car le fichier <b>%1</b> n'a pas été trouvé dans le répertoire d'aide ! - - This file is provided with the QtiPlot manual which can be downloaded from the following internet address: Ce fichier est fourni avec le manuel de QtiPlot qui peut être téléchargé depuis l'adresse suivante : - Please indicate the location of the help file! Veuillez indiquer l'emplacement du fichier d'aide ! - Curve Courbe - - New 3D &Surface Plot Graphe de &Surface 3D - - Open Image &File - Ouvrir un &fichier image + Ouvrir un &fichier image - - Import I&mage... Importer une i&mage... - - Save As &Template... - Sauvegarder comme modèle... + Sauvegarder comme &modèle... - Save Note As... Sauvegarder les commentaires sous... - - Cu&t Selection - Couper + Cou&per - - &Copy Selection &Copier - - &Paste Selection - Coller + C&oller - - Del delete key Suppr - - &Export PDF &Exporter en PDF - - Ctrl+Alt+P Ctrl+Alt+P - - Clear &Log Information Effacer &l'historique - - Delete &Fit Tables - Supprimer les tables des ajustements + Supprimer les tables des a&justements - - Plot &Wizard - Assistant graphique + Assistant &graphique - - &Rescale to Show All &Échelle automatique - - Add Time Stamp Ajouter Date et Heure - - &Choose Help Folder... &Choisir le répertoire d'aide... - - - Add Column Ajouter une colonne - - &View Pixel Line Profile &Voir le profile en pixel suivant une ligne - - &Intensity Table Table des &intensités - &Convert to Spreadsheet &Convertir en feuille de calcul - - Dra&g Curve - + Dé&placer la courbe - &Import - &Importer + &Importer - Convert to &Matrix Convertir en &matrice - You must select a single Y column that has an associated X column! - + Vous devez sélectionner une seule colonne Y qui possède une colonne X associée ! - You must select exactly one Z column! - - - - + Vous ne devez sélectionner qu'une seule colonne Z ! + + + Open ODF Spreadsheet File + Ouvrir un fichier tableur ODF + + + Couldn't open file %1 + Ne peut ouvrir le fichier %1 + + + File %1 contains only %2 sheets! + Le fichier %1 ne contient que %2 feuillles ! + + + QtiPlot was built without ODF spreadsheet support! + QtiPlot a été compilé sans le support des fichiers tableurs ODF ! + + + Open Excel File + Ouvrir un fichier Excel + + + File %1 contains only %2 sheets, operation aborted! + Le fichier %1 contient seulement %2 feuilles, opération annulée ! + + + Sheet %1 is empty, operation aborted! + La feuille %1 est vide, opération annulée ! + + + sheet + feuille + + + QtiPlot was built without libxls support! + QtiPlot a été compilé sans le support libxls ! + + Imported sound file - + Fichier son importé - This is not a PCM type WAV file, operation aborted! - + Ceci n'est pas un fichier WAV de type PCM, opération annulée ! - PCM - + PCM - - Time - + Temps - Left - Gauche + Gauche - Right - Droite + Droite - Channels - + Chaînes - Sample Rate - + Taux d'échantillonage - Byte Rate - + A vérifier ! + Débit - Block Align - + Alignement - Bits Per Sample - + Bit par échantillon - Presentation Preview - + Aperçu de la présentation - &Save - &Sauvegarder - - - + &Sauvegarder + + + Paste Selection as Te&xt + Coller le te&xte + + There are no windows available in this folder! - - - - - + Il n'y a pas de fenêtres disponibles dans ce dossier ! + + + Export + Exporter + + + Open Exce&l ... + Ouvrir un fichier Exce&l ... + + + Ctrl+Shift+E + Ctrl+Shift+E + + + Open ODF Spreads&heet... + Ouvrir un fic&hier tableur ODF... + + + Ctrl+Alt+S + Ctrl+Alt+S + + &Sound (WAV)... - + &Son (WAV)... - - Create Open &Document Presentation... - + Créer un fichier O&DP... - - &Close - - - - - + &Fermer + + + Zoom/Drag Canvas &Horizontally + Zoomer/déplacer le cadre &horizontalement + + + Zoom/Drag Canvas &Vertically + Zoomer/déplacer le cadre &verticalement + + &Lowess... - - - - - + &Lowess... + + + &Image Profiles + Profiles d'&images + + 2D &Binning - + Éc&hantillonnage 2D - - &Regular XYZ - + XYZ &Régulier - - &Autocorrelate &Autocorrélation - - &Random Values - Valeu&rs Aléatoires + Valeu&rs aléatoires - QtiPlot &Forums &Forum QtiPlot - - Report a &Bug Signaler un &bug - - Download &Manual Télécharger le &manuel - - Make a &Donation Faire un &don - - Technical &Support &Support technique - - Find &Next - + Suiva&nt - - Find &Previous - + &Précédent - - F4 - + F4 - - &Replace... - &Remplacer + &Remplacer... - - Increase Indent - + Incrémenter - - Decrease Indent - + Décrémenter - - Rena&me Tab... - + Reno&mmer la table... - - A&dd Tab - + &Ajouter une table - - C&lose Tab - + Fermer la tab&le - - &Script Window Fenêtre de &script - - + Load Custom User &Interface... + Charger une &interface personnalisée... + + &Reset to Full Range - Pleine échelle + &Pleine échelle - - Edit &Range... Modifie&r la gamme... - - &Hide Cac&her - - Hide &Other Curves Masquer les autres c&ourbes - - &Show All Curves Montrer toute&s les courbes - Increase Precision - + Augmenter la précision - Decrease Precision - + Diminuer la précision - New table Nouvelle table - + Open Excel + Ouvrir Excel + + + Open ODF Spreadsheet + Ouvrir un fichier tableur ODF + + Save project Sauvegarder le projet - Open template Ouvrir un modèle - Save window as template Sauvegarder la fenêtre comme modèle - Project &Explorer &Explorateur de projets - Show analysis results Voir les résultats d'analyse - Export to PDF Exporter en PDF - Print preview - + Aperçu avant impression - Date & time Date & Heure - Plot as line Tracé en ligne - Plot as symbols Tracé avec des symboles - Plot as line + symbols Tracé en ligne avec des symboles - Plot 3D ribbon Rubans 3D - Plot 3D bars Barres 3D - Plot 3D scatter Nuage 3D - Plot 3D trajectory Graphe à trajectoire 3D - More Windows... Autres fenêtres... - + Image Profiles + Profiles d'image + + Box and whiskers plot Graphe Whiskers - Visit QtiPlot &Forums - Aller sur les &forums QtiPlot + &Forums QtiPlot - Show find dialog - + Rémy : Bof... + Afficher la boite "Chercher" - Find Next - + Suivant - Find Previous - + Précédent - Show replace dialog - - - - + Afficher la boite "Remplacer" + + + Zoom In/Out and Drag Canvas Horizontally + Zoomer/déplacer le cadre horizontalement + + + Zoom In/Out and Drag Canvas Vertically + Zoomer/déplacer le cadre verticalement + + Drag Curve - + Déplacer la courbe - - No axes Aucun axe - Front grid Grille avant - Back grid Grille de fond - Right grid Grille de droite - Left grid Grille de gauche - Ceiling grid Grille de toit - Floor grid Grille de plancher - - Hidden line Maillage - - Polygon Only Courbe 3D - - Mesh & Filled Polygons - Courbe 3D + maillage + Cour&be 3D + maillage - - - - Crosshairs Lignes croisées - - Floor data projection Projection des données sur le planché - - Floor isolines Isolignes sur le planché - - Empty floor Planché vide - Memory Allocation Error - + Erreur d'allocation mémoire - Not enough memory, operation aborted! - + Pas assez de mémoire, opération annulée ! - - Set Precision %1 digits - - - - QtiPlot - Help - QtiPlot - Aide - - - + Précision %1 décimales + + + Choose custom user interface + Choisir l'interface personnalisée + + + Custom user interfaces can be created using the QtDesigner application provided by the Qt framework + Les interfaces personnalisées peuvent être crées en utilisant QtDesigner fourni avec l'environnement Qt + + + For more details about how to use .ui files in your Python scripts please read the PyQt4 documentation + Pour plus de détails sur l'utilisation des fichiers ui dans vos scripts Python, veuillez lire la documentation de PyQt4 + + This will clear the contents of all the data associated with the table. Are you sure? - Toutes les données de la table seront effacées. Êtes vous sûr ? + Toutes les données de la table seront effacées. Êtes vous sûr ? - QtiPlot - Enter row number - QtiPlot - Entrer le numéro de la rangée + QtiPlot - Entrer le numéro de la rangée - Row - Rangée - - - QtiPLot - Plot error - QtiPlot - Erreur lors du tracé du graphe - - - - + Rangée + + Please select four columns for this operation! Sélectionnez quatre colonnes pour cette opération ! - Import image... - Importer une image... - - - Output format: Format de sortie : - Directory: Répertoire : - There are no plot layers available in window <b>%1</b>.<br>Graph window not exported! Il n'y a pas de planche disponible sur la fenêtre <b>%1</b>. Le graphe n'a pas été exporté ! - - QtiPlot - Delete rows QtiPlot - Effacer les rangées - Start row Rangée de départ - End row Rangée de fin - Set Display Range Fixer la gamme affichée - &Folders - Dossiers + &Dossiers - &View Pixel Line profile &Voir le profile en pixel suivant une ligne - - &Import ASCII... &Importer un fichier ASCII... - - Shift+A Shift+A - - Fit &Wizard... - Assistant d'ajustement... + Assistant d'a&justement... - - &Delete Rows Interval... - &Éffacer l'interval des rangéees... + &Effacer les rangées entre les intervalles... - Import data file(s) Importer le(s) fichier(s) de données - <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> If you like it, you're using it in your work and you would like to see it constantly improved,<br> please support its authors by making a donation.<br><br> Would you like to make a donation for QtiPlot now?</b></font> - <font size=+2, color = darkBlue><b>QtiPlot est un logiciel libre et son developpement require des centaines d'heures de travail. <br><br> Si vous l'appréciez, que vous l'utilisiez à titre professionnel et que vous aimeriez le voir constamment amélioré, aidez financièrement ses auteurs en faisant un don. <br> <br> Voulez-vous faire un don pour QtiPlot maintenant ?</b></font> - - - Please support QtiPlot! - Supportez Qtiplot ! - - - Yes, I'd love to! - Oui, je l'adore ! - - - Ask me again later! - Plus tard ! - - - No, stop bothering me! - Non, cela ne m'interesse pas ! - - - + Supportez Qtiplot ! + + <b> %1 </b>: This command line option must be used without other arguments! - <b> %1 </b> : Cette option de commande doit être utilisé sans autres arguments ! + <b> %1 </b> : Cette option de commande doit être utilisé sans autres arguments ! - Version - Version + Version - Usage - Usage + Usage - options - options + options - - file - fichier + fichier - - name - nom + nom - Valid options are - Les options valides sont + Les options valides sont - - - - - - - - or - ou + ou - show about dialog and exit - Voir la boite et quitter - - - - show standalone scripting window - - - - + Voir la boite et quitter + + start QtiPlot with the default settings - Démarrer QtiPlot avec les options par défaut + Démarrer QtiPlot avec les options par défaut - show command line options - Voir les options de la ligne de commande + Voir les options de la ligne de commande - start QtiPlot in language - Démarrer QtiPlot en + Démarrer QtiPlot en - show QtiPlot manual in a standalone window - Voir le manuel de QtiPlot dans une autre fenêtre + Voir le manuel de QtiPlot dans une autre fenêtre - print QtiPlot version and release date - Afficher le numéro et la date de version de QtiPlot + Afficher le numéro et la date de version de QtiPlot - execute the script file given as argument - Éxécuter le fichier de script comme argument - - - - can be any .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py or ASCII file - peut être .qti, .qti.gz, .opj, .ogm, .ogw, .ogg, .py ou un fichier ASCII - - - + Éxécuter le fichier de script comme argument + + <b> %1 </b> unknown command line option! - <b> %1 </b> option en ligne de commande inconnue ! + <b> %1 </b> option en ligne de commande inconnue ! - Type %1 to see the list of the valid options. - Tapez %1 pour voir la liste des options valides. + Tapez %1 pour voir la liste des options valides. - <b>%1</b> is a directory, please specify a file name! - <b>%1</b> est un répertoire, veuillez spécifiez un nom de fichier ! + <b>%1</b> est un répertoire, veuillez spécifiez un nom de fichier ! - - You don't have the permission to open this file: <b>%1</b> Vous n'avez pas les droits pour ouvrir le fichier <b>%1</b> - QtiPlot - Demo Version - QtiPlot - Version de démonstration - - - You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. - Vous utilisez la version de démonstration de QtiPlot. Elle est identique à la version complète mais vous ne pouvez sauvegarder votre travail et vous ne pouvez pas l'utiliser plus de 10 minutes par session. <br><br>. Pour disposer de la version complète, veuillez souscrire un contrat de maintenance à <a href="http://soft.proindependent.com/individual_contract.html">. <br><br> QtiPlot est un logiciel libre au sens de la liberté d'expression. Si vous savez comment l'utiliser, vous pouvez avoir <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626"> les fichiers sources</a> sans charges. . Néanmoins, vous êtes le bienvenu <a href="http://soft.proindependent.com/why_donate.html"> pour faire un don</a> afin d'aidez aux développements futurs de QtiPlot. - - - + QtiPlot - Version de démonstration + + QtiPlot - File backup error - QtiPlot - Erreur lors de la sauvegarde automatique + QtiPlot - Erreur lors de la sauvegarde automatique - QtiPlot - File save error - QtiPlot - Erreur lors de la sauvegarde du fichier + QtiPlot - Erreur lors de la sauvegarde du fichier - Save project as - Enregistrer le projet sous + Enregistrer le projet sous - bytes - octects + octects - - windows - fenêtres + fenêtres - - folders - dossiers + dossiers - - 3D Graph - Graphe 3D + Graphe 3D - Skipped moving folder - Dossier inchangé + Dossier inchangé - QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! - QtiPlot va essayer de télécharger les informations necessaires des mises à jour disponibles. Veuillez modifier les paramètres du firewall afin d'autoriser QtiPlot à se connecter à Internet ! + QtiPlot va essayer de télécharger les informations nécessaires des mises à jour disponibles. Vous devez modifier les paramètres du firewall afin d'autoriser QtiPlot à se connecter à Internet ! - Do you wish to continue? - Désirez vous continuer ? + Désirez vous continuer ? - QtiPlot - HTTP get version file - QtiPlot - Recherche de mise à jour par le WEB + QtiPlot - Recherche de mise à jour par le WEB - - - You need at least two columns for this operation! Vous avez besoin d'au moins deux colonnes pour cette opération ! - Please set a default X column for this table, first! - Sélectionnez d'abord la colonne X par défaut pour cette table ! + Sélectionnez d'abord la colonne X par défaut pour cette table ! - Please select a Z column for this operation! - Sélectionnez une colonne Z pour cette opération ! + Sélectionnez une colonne Z pour cette opération ! - You need to define a X column first! - Vous devez d'abord définir une colonne X ! + Vous devez d'abord définir une colonne X ! - You need to define a Y column first! - Vous devez d'abord définir une colonne Y ! + Vous devez d'abord définir une colonne Y ! - - &Draw Data Points &Dessiner les points - - &Read-only - Lectu&Re Seule + Lectu&re seule - - Read/&Write - Lecture/Écriture + &Lecture/écriture - Vie&w - Affichage + A&ffichage - &Palette &Palette - - &Swap columns - Echanger les Colonnes + Echanger les Colonne&s - - Move &Right - Se déplacer à droite + Colonne de d&roite - - Move &Left - Se déplacer à gauche + Co&lonne de gauche - - Move to F&irst - Se déplacer au premier + Prem&iere colonne - - Move to Las&t - Se déplacer au dernier + Dernière co&lonne - - &Image Plot - + &Image - - Flip &V Retourner &Verticalement - Ctrl+Shift+V Ctrl+Shift+V - - Flip &H Retourner &Horizontalement - Ctrl+Shift+H Ctrl+Shift+H - - R&otate 90 T&ourner de 90° - - Rotate &-90 Tourner de &-90° - - Ctrl+Alt+R Ctrl+Alt+R - - &Image mode - Mode de l'image + Convertir en &Image - Ctrl+Shift+I Ctrl+Shift+I - - &Data mode - Mode des &Données + Convertir en &Données - Ctrl+Shift+D Ctrl+Shift+D - - Show &X/Y Montrer &X/Y - Ctrl+Shift+X Ctrl+Shift+X - - Show &Column/Row Montrer &Colonnes/Lignes - Ctrl+Shift+C Ctrl+Shift+C - - - &Gray Scale Échelle de &gris - - &Rainbow - Arc-en-ciel + A&rc-en-ciel - - &Custom - personnalisé + &Personnalisé - - &Export Image ... - Exporter l'image + Rémy : espace en trop avant les ... + &Exporter l'image... - &Forward FFT - Transformée de Fourrier Directe + Transformée de &Fourier directe - &Inverse FFT - Transformée de Fourrier inversée + Transformée de Fourier &inverse - - &Read Only Lectu&Re Seule - - &Disregard - + R&ien - - Ctrl+Shift+T Ctrl+Shift+T - - New Fol&der - Nouveau Dossier - - - Create a new folder Créer un nouveau dossier - Swap selected columns Echanger les colonnes sélectionnées - Move Right Se déplacer à droite - Move Left Se déplacer à gauche - Move to First Se déplacer au premier - Move to Last Se déplacer au dernier - Draw Data Points Dessiner les points - - - Format Format - - Add &Custom Script Action... - Ajouter un script d'action personnalisé + A&ction personnalisée... - - Bold Gras - - Italic Italique - Superscript Exposant - Subscript Indice - - Underline (Ctrl+U) Souligné (Ctrl+U) - - - - Greek Grec - - - Error - Erreur + Erreur - - - &Label &Etiquette - - Undo Stack - Défaire la pile + Pile - Empty Stack Vider la pile - Set Image Mode - Définier le mode de l'image + Passage en mode image - Set Data Mode - Définir le mode de donnée + Passage en mode données - Show X/Y Montrer X/Y - Show Column/Row - montrer Colonne/Cellule + Montrer colonne/rangée - Set Gray Scale Palette Définir la palette d'échelle de gris - Set Rainbow Palette Définir la palette arc-en-ciel - - &Hide Selected - Caché la sélection + Cac&her la sélection - - Sho&w All Columns - Montrer toutes les colonnes + Montrer toutes les co&lonnes - - - - &Direct &Direct - - &XYZ Columns Colonnes &XYZ - - &YXZ Columns Colonnes &YXZ - Show available undo/redo commands Montrer les commandes défaire/refaire disponibles - Hide selected columns Caché les colonnes sélectionnées - Show all table columns Montrer toutes les colonnes du tableau - Integration of %1 from zero is - L'integration de %1 à partir de zéro est + L'intégration de %1 à partir de zéro est - - &Integrate &Intégrer - - Integr&ate Function... - intégrer l&a fonction + Intégrer l&a fonction... - - Ctrl+D Ctrl+D - - &Toolbars... - Barre d'ou&Tils... + Barre d'ou&tils... - &Undo/Redo Stack - Défaire/Refaire la pile + Dé&faire/refaire la pile - - Go to Colum&n... Aller à la colon&ne... - - Ctrl+Alt+C Ctrl+Alt+C - Set Matrix Values Définier les valeurs de la matrice - Image Plot Image du graphique - Rotate 90° Clockwise - Tourner de 90° vers la droite - - - Rotate 90° Counterclockwise - Tourner de 90° vers la gauche - - - Flip Vertically Retourner Verticalement - Flip Horizontally Retourner Horizontalement - Fill selected columns with row numbers Remplir les colonnes sélectionnée avec les numéros des lignes - Fill selected columns with random numbers Remplir les colonnes sélectionnées avec des nombres aléatoires - Set column as X Définir la colonne comme X - Set column as Y Définir la colonne comme Y - Set column as Z Définir la colonne comme Z - Set as Y Error Bars Définir comme barre d'erreur de Y - Set as Labels Définir comme une étiquette - Disregard Columns - - Mathematical Symbols Symboles mathématiques - Integration of %1 L'intégration de %1 - Area Aire - - - - - Please select a 'Y' column first! Vous devez d'abord sélectionner une colonne "Y" ! - - Linear Regression of %1 Régression Linéraire de %1 - - Slope Pente - Intercept Intersection - - Chi^2 Chi^2 - - R^2 R^2 - &Scripting &Scripts - - Show Line &Numbers Montrer les &Numéros des lignes - - Add E&quation - Ajouter une &Equation + Ajouter une é&quation - - ALT+Q ALT+Q - - Add &Rectangle - Ajouter un &Rectagle + Ajouter un &Rectangle - - CTRL+ALT+R CTRL+ALT+R - - - There are no layers available on this plot. Operation aborted! il n'y a pas de planches disponibles sur ce graphique. Opération interrompue ! - &Paste Tex Formula - Coller une formule TEX + Rémy : C'est pas LaTeX plutôt ? + Coller une &formule TEX - - &Frequency Count ... - calcul des fréquences + Calcul des &fréquences... - Add Equation Ajouter une équation - Add Rectangle Ajouter un rectangle - You need to select at least one Y column for this operation! - You devez sélectionner au moins une colonne Y pour cette opération + Vous devez sélectionner au moins une colonne Y pour cette opération ! - Y2 Axis Title Titre de l'axe Y2 - You must have more than one layer in the active window! - Vous devez avoir au moins une planche dans la fenêtre active + Vous devez avoir au moins une planche dans la fenêtre active ! - You must have more than one dataset in the active layer! - Vous devez avoir au moins un set de donnée dans la fenêtre active + Vous devez avoir au moins un jeu de donnée dans la fenêtre active ! - - D&ouble-Y D&ouble-Y - - E&xtract to Graphs E&xtraire vers mes graphiques - Extract to &Layers - Extraire vers une planche + Extraire vers une p&lanche - - Add Inset Layer - + Ajouter un encart - Double Y Axis Double Axe en Y - Extract to Graphs Extraire vers les graphiques - Extract to Layer&s Extraire vers les planche&s - Extract to Layers Extraire vers les planches - <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> - <font size=+2, color = darkBlue><b>QtiPlot est un logiciel libre et son développement a nécessité des centaines d'heures de travail.<br><br> - - - - Add &Ellipse Ajouter une &Ellipse - - CTRL+ALT+E CTRL+ALT+E - &Paste Rectangle - Coller le Rectangle + Coller le &rectangle - &Paste Ellipse - Coller l'ellipse + Coller l'élli&pse - Add Ellipse/Circle Ajouter une Ellipse/un cercle - Set Default Palette Définir la palette par défaut - - - - Ctrl+Alt+H Ctrl+Alt+H - - &Default - Par défaut - - - + Par &défaut + + + Profiles + Profiles + + + Horizontal + Horizontal + + + Vertical + Vertical + + <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> If you like it, you're using it in your work and you would like to see it constantly improved, please support its authors by making a donation.</b></font> - <font size=+2, color = darkBlue><b>QtiPlot est un logiciel libre et son développement nécessite des centaines h'eures de travail.<br><br>Si vous l'aimez, que vous l'utilisez à votre travail et que vous voulez le voir constamment évoluer, merci de le supporter en faisant une donation à son auteur</b></font> + <font size=+2, color = darkBlue><b>QtiPlot est un logiciel libre et son développement nécessite des centaines h'eures de travail.<br><br>Si vous l'aimez, que vous l'utilisez à votre travail et que vous voulez le voir constamment évoluer, merci de le supporter en faisant une donation à son auteur</b></font> - Make a donation - - - - + Faire un don + + + show standalone scripting window + montrer la fenêtre des scripts autonomes + + execute the script file given as argument without displying the user interface. Warning: 2D plots are not correctly handled in this functioning mode! - Execute le script donnée en argument sans le montrer dans l'interface utilisateur. Attention ! Les graphs 2D ne sont pas bien pris en compte dans ce mode de fonctionnement - - - + Execute le script donnée en argument sans le montrer dans l'interface utilisateur. Attention ! Les graphs 2D ne sont pas bien pris en compte dans ce mode de fonctionnement! + + + can be any .qti, qti.gz, .ods, .opj, .ogm, .ogw, .ogg, .py, .xls or ASCII file + peut être .qti, .qti.gz, .ods, .opj, .ogm, .ogw, .ogg, .py, .xls ou un fichier ASCII + + Help - Aides + Aides - You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://soft.proindependent.com/download.html">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. - + Vous utilisez la version de démonstration de QtiPlot. Elle est identique à la version complète mais vous ne pouvez sauvegarder votre travail et vous ne pouvez pas l'utiliser plus de 10 minutes par session. <br><br>. Pour disposer de la version complète, veuillez souscrire un contrat de maintenance à <a href="http://soft.proindependent.com/individual_contract.html">. <br><br> QtiPlot est un logiciel libre au sens de la liberté d'expression. Si vous savez comment l'utiliser, vous pouvez avoir <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626"> les fichiers sources</a> sans charges. . Néanmoins, vous êtes le bienvenu <a href="http://soft.proindependent.com/why_donate.html"> pour faire un don</a> afin d'aidez aux développements futurs de QtiPlot. - QtiPlot - Enter column number - QtiPlot - Entrer le numéro de la colonne + QtiPlot - Entrer le numéro de la colonne - - QtiPlot was not built with Python scripting support included! - Qtiplot a été compilé sans le support des scripts Python + Qtiplot a été compilé sans le support des scripts Python! - Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. - Depuis la version 0.9.1 Qtiplot sauvegarde les modèles de régression dans un dossier différent + Depuis la version 0.9.1 Qtiplot sauvegarde les modèles de régression dans un dossier différent. - If you want to save your already defined models, please choose a destination folder. - Si vous voulez sauvegarder vos modèles prédfinis, choisissez un dossier de destination + Si vous voulez sauvegarder vos modèles prédfinis, choisissez un dossier de destination. - Import fit models - Importer un modèle de régression + Importer un modèle de régression - Choose a directory to export the fit models to - Choisissez un répertoire pour exporter les modèles de regression + Choisissez un répertoire pour exporter les modèles de regression - - No Icon - Pas d'icônes + Pas d'icônes - Couldn't load file: %1. Autocompletion will not be available! - Ne peut charger le fichier: %1. -L'autocomplétion ne sera pas disponible + Ne peut charger le fichier: %1. +L'autocomplétion ne sera pas disponible! - Please select exactly one column and more than one non empty cell! - Veuillez choisir exactement une colonne et plus d'une celllule non vide ! + Veuillez choisir exactement une colonne et plus d'une celllule non vide ! - Rotate 90 Clockwise Tourner de 90° vers la droite - Rotate 90 Counterclockwise Tourner de 90° vers la gauche - - Ctrl+Shift+S - + Ctrl+Shift+S - Data set: %1 doesn't exist! - Les données %1 doesn't exist ! + Les données %1 doesn't exist ! - Stem and leaf plot of dataset - Tracé des données en "stemplot" + Tracé des données en "stemplot" - from row - de la colonne + De la rangée - to row - à la colonne + à la rangée - Not enough memory for this dataset! - Pas assez de mémoire pour ces données ! + Pas assez de mémoire pour ces données ! - Stem - + Tige - Leaf - + Feuille - Please confirm the stem unit! - Mercid e confirmer l'unité du "stem"! + Mercid e confirmer l'unité du "stem"! - Data set - Plage de données + Plage de données - stem unit - Unité du "stem" + Unité du "stem" - Stem unit - Unité du "stem" + Unité du "stem" - Leaf unit - + Unité de la Feuille - Key - clé + clé - means - moyenne + moyenne - Input error: empty data set! - Erreur en entrée : plage de données vide. + Erreur en entrée : plage de données vide! - Stem-and-Leaf Plot Tracé des données en "stemplot" - - Stem-and-&Leaf Plot Tracé des données en "stemp&Lot" - F&ormat - + F&ormat - Alt+C - + Alt+C - - Zoom &In/Out and Drag Canvas - + Z&oom +/- et déplacer le cadre - Zoom In (Shift++) or Out (-) and Drag Canvas - + Zoom + (Shift++) ou - (Shift+-) et déplacer le cadre - - Fit Slop&e - + Ajuster la pent&e - &Add - &Ajouter + &Ajouter - - Ctrl+Alt+D - + Ctrl+Alt+D - &Waterfall Plot - + C&ourbes en cascade - &Indexed Colors - + Couleurs &indéxées - Pale&tte - + Pale&tte - Close - Fermer + Fermer - - - Spec&ial Bar/Column - + Barre/colonne spéc&ial - - Stack &Bar - + &Barres empilées - - Stack &Column - + RC : Bof... + &Colonnes empilées - Plot stack bar - + Tracé en barres empilées - Plot stack column - + Tracé en colonnes empilées - - Move Row - + Déplacer la rangée - Print preview of window: - + Aperçu avant impression de la fenêtre : - - Print Pre&view - + Aperçu a&vant impression - - Ad&just Column Width - + A&juster la largeur de la colonne - - &Upward - + Vers le ha&ut - - &Downward - + Vers le &bas - Append a project to the current folder - + Ajouter un projet au dossier actuel - Ctrl+Alt+A - + Ctrl+Alt+A - Move current row upward - + Déplacer cette rangée vers le haut - Move current row downward - + Déplacer cette rangée vers le bas - Set optimal column width - + Largeur de colonne optimale + + + Shared A&xes Panel + A&xes communs + + + + + + + &Custom Layout... + &Personnalisé... + + + Execute Selected Lines + Exécuter les lignes sélectionnées + + + Commen&t Selection + Commen&ter la sélection + + + &Uncomment Selection + Dé&commenter la sélection + + + Comment Selection + Commenter la sélection + + + Uncomment Selection + Décommenter la sélection + + + Ctrl+Shift+O + Ctrl+Shift+O + + + Ctrl+Shift+U + Ctrl+Shift+O + + + Waterfall Plot + Courbes en cascade + + + &Extract Data... + &Extraire les données... + + + S&ubtract + So&ustraire + + + &Straight Line... + &Ligne de référence... + + + &Reference Data... + &Donnée de référence... + + + &Open... + &Ouvrir... + + + Open Image &File... + Ouvrir un &fichier image... + + + &Print... + Im&primer... + + + Print Pre&view... + Aperçu a&vant impression... + + + E&xport ASCII... + E&xporter en ASCII... ArrowMarker - dx - + dx - dy - + dy - angle - + angle - length - + longueur - - eqn - + eqn - y - + y - - x - + x AssociationsDialog - QtiPlot - Plot Associations QtiPlot - Association de graphes - Spreadsheet: Feuille de calcul : - Column Colonne - X X - Y Y - - xErr xErr - - yErr yErr - &Update curves - Modifier la co&urbe + Appliq&uer - &OK &OK - &Cancel - Annuler + &Annuler - xEnd xEnd - yEnd yEnd - Angle Angle - Magn. Magnitude, vector length - Ampl, longueur du vecteur + Long. AxesDialog - QtiPlot - General Plot Options Qtiplot - Options générales des graphes - &Apply &Appliquer - &OK &OK - &Cancel - Annuler + &Annuler - - From De - - To à - - Type Type - linear - linéaire - - - logarithmic - logarithmique - - - Inverted Inversé - Step Intervalle - - Major Ticks Graduations principales - - Minor Ticks Graduations secondaires - - - Bottom Inférieur - - - Left Gauche - - - Top Supérieur - - - Right Droite - Scale Échelle - Major Grids Grille principale - Minor Grids Grille secondaire - Line Color Couleur des lignes - Line Type Type de lignes - Thickness Épaisseur - - Axes Axes - Additional lines Lignes supplémentaires - X=0 X = 0 - Y=0 Y = 0 - Horizontal Horizontal - Vertical Vertical - Grid Grille - Show Voir - Title Titre - &Font - Police + &Police - Numeric Numérique - Text from table Texte de la table - Day of the week Jour de la semaine - Month Mois - Time Heure - Date Date - Column Headings En-têtes de colonnes - Font Police - Axis &Font - Police + &Police - - - Color Couleur - - None Sans - - Out Au dessous de l'axe - - In & Out Au dessus et en dessous - - In Au dessus de l'axe - + Labels space + Espace entre labels + + Stand-off Décalage - Show Labels Montrer les étiquettes - + Show &backbone + Mon&trer le renfort + + Column Colonne - Table Table - - Format Format - - Precision Précision - Angle Angle - For&mula For&mule - - Axis Axe - Canvas frame Bordure du cadre - - Width Épaisseur - Opacity - Opacité - - - Canvas Color - Couleur du cadre - - - Border Color - Couleur de la bordure - - - Draw backbones Axes visibles - Line Width Largeur de ligne - Major ticks length Longueur des graduations principales - Minor ticks length Longueur des graduations secondaires - Margin - Marge - - - General Général - Automatic Automatique - Decimal: 100.0 - Décimal : 100.0 - - - Scientific: 1e2 - Scientifique : 1e2 - - - Scientific: 10^2 - Ingénieur : 10^2 - - - QtiPlot - Start limit error - QtiPlot - Erreur de la limite de départ - - - QtiPlot - End limit error - QtiPlot - Erreur de la limite d'arrêt - - - QtiPlot - Step input error - Qtiplot - Erreur d'intervalle - - - Please enter a positive step value! - Veuillez entrer une valeur d'intervalle positive ! - - - QtiPlot - Formula input error QtiPlot - Erreur de formule - Valid variables are 'x' for Top/Bottom axes and 'y' for Left/Right axes! Les variables ne peuvent être que 'x' pour les axes supérieur/inférieur et 'y' pour les axes latéraux ! - millisec. ms. - sec. sec. - min. min. - hours heures - days jours - weeks semaines - Show Axis &Break - Montrer les arrêt de l'axe + &Briser l'axe - Probability - + Probabilité - Logit - + RC : Ca veut dire quoi ? + - Draw Break &Decoration - Dessiner les arrêts + &Afficher - Position Position - % of Axis Length - % de la longueur de l'axe + % longueur axe - pixels pixels - &Log10 Scale After Break - Echelle en &Log10 après l'arrêt + Échelle en &Log10 après la brisure - Step Before Break - Pas avant l'arrêt + Pas avant - - Guess - + Auto - Step After Break - Pas après l'arrêt + Pas après - Minor Ticks Before - + Graduations avant - Minor Ticks After - + Graduations après - Apply To Appliquer à - This Layer cette planche - This Window cette fenêtre - - - All Windows toutes les fenêtres - An&tialised An&tialiasé - Set As &Default - Par défaut + Par &défaut - Apply &to... - Appliquer à... + A&ppliquer à... - - Layer Planche - - Window Fenêtre - Distance to axis - + Distance à l'axe - Apply &to - Appliquer à + A&ppliquer à - Decimal: 10000.0 Décimal : 10000.0 - Scientific: 1e4 - Scientifique: 1e4 + Scientifique : 1e4 - Scientific: 1x10^4 - Scientifique: 1x10^4 + Scientifique : 1x10^4 - Engineering: 10k - Notaiton ingénieur : 10k - - - - + Notation ingénieur : 10k + + + Scientific: 1·10^4 + Scientific : 1 10^4 + + Origin Origine - &Inverted - + &Inversé - Linear - + Linéaire - Log10 - + Log10 - ln - + Ln - Log2 - + Log2 - Reciprocal - - - - - CanvasPicker - - enter your text here - Entrez votre texte ici + Réciproque + + + Hide Ticks + Cacher les graduations + + + At Axis Begin + Du début + + + At Axis End + De la fin + + + At Axis Begin & End + Du début et de la fin ColorBox - black noir - red rouge - green vert - blue bleu - cyan cyan - magenta rose - yellow jaune - dark yellow jaune foncé - navy bleu outremer - purple violet - wine rouge grenat - olive vert olive - dark cyan turquoise - white blanc - light gray gris clair - dark gray gris foncé - royal Bleu marine - orange orange - violet violet - pink rose - gray gris - light yellow jaune clair - light cyan cyan - light magenta rouge clair - ColorButton - - - Custom - - - - ColorMapDialog - QtiPlot QtiPlot - Custom Color Map Palette des couleurs personnalisée - &Apply &Appliquer - &Close - Fermer + &Fermer - Set Custom Palette Définir la palette personnalisée @@ -8068,70 +4510,45 @@ ColorMapEditor - Level Niveau - Color Couleur - &Insert &Insérer - &Delete &Supprimer - &Scale Colors - Echelle des couleur&s - - - QtiPlot - Input Error - Qtiplot - Erreur : entrée incorrecte - - - Sorry, you cannot edit this value! - Désolé, vous ne pouvez modifiez cette valeur ! - - - Please enter a valid color level value! - Veuillez donner une valeur de niveau de couleur valide ! + Échelle des couleur&s ColorMapPreviewDialog - QtiPlot - Color Map Preview Dialog Qtiplot - dialogue de prévisualisation des cartes de couleur - Colormap files Fichiers de cartes de couleurs - All files Tous les fichiers - << &Preview - << &Prévisualisation + << A&perçu - - - - None Aucun(e) @@ -8139,15 +4556,13 @@ ColorPickerPopup - Custom - + Personnalisée ConfigDialog - The column separator can be customized. The following special codes can be used: \t for a TAB character @@ -8158,1534 +4573,1276 @@ \s pour une espace - The separator must not contain the following characters: 0-9eE.+- Le séparateur ne doit pas contenir un des caractères suivant : 0-9eE.+- - - Grids - + Grilles - - Ma&jor Grids - + Grille pr&incipale - - Mi&nor Grids - + Grille seco&ndaire - - Color - Couleur - - - + Couleur + + + &Keep aspect ratio + &Proportionnelle + + QtiPlot - Choose default settings - Qtiplot - Choisissez les paramètres par défaut + Qtiplot - Paramètres par défaut - General Général - - Tables Tables - - 2D Plots Graphes 2D - - 3D Plots Graphes 3D - Fitting Ajustement - Options Options - Curves Courbes - Ticks Graduations - - - + Geometry + Géometrie + + Fonts Polices - Do not &resize layers when window size changes Ne pas &redimensionner les planches lorsque la taille de la fenêtre change - - Length Longueur - - + Ticks - Labels space + Espace entre étiquettes et graduations + + + pixels + pixels + + + Unit + Unité + + + inch + pouce + + + mm + mm + + + cm + cm + + + point + point + + + pixel + pixel + + + Canvas Width + Largeur du cadre + + + Canvas Height + Hauteur du cadre + + + mu&Parser uses C locale settings + mu&Parser utilise la syntaxe C locale + + Solid - plein + Plein - - Dash - + Tiret - - Dot - Point + Point - - Dash Dot - + Tiret point - - Dash Dot Dot - + Tiret point point - - Short Dash - + Tiret court - - Short Dot - + Point court - - Short Dash Dot - + Tiret point courts - Scale Errors with sqrt(Chi^2/doF) Échelle d'erreurs en sqrt(Chi^2/doF) - Axes linewidth Épaisseur des traits d'axes - Major Ticks Graduations principales - Minor Ticks Graduations secondaires - Margin Marge - Frame width Épaisseur du cadre - Axes &backbones - Abscisses / Ordonnées + A&bscisses / Ordonnées - Canvas Fra&me - Bordure du cadre - - - Sho&w all axes - Afficher tous les axes - - - + Bordure du &cadre + + Show &Title - Afficher le &titre + Montrer le &titre - Scale &Fonts - Taille de la Police + &Taille de la police - Auto&scaling - Échelle automatique + Échelle auto&matique - Antia&liasing Antirep&liement - Legend display - + Légende d'affichage - Column name - + Nom de la colonne - Column comment - + Commentaire de la colonne - Table name - + Nom de la table - Table legend - + Légende de la table - - None - Aucun + Aucune - - Out Au dessous de l'axe - - In & Out - Au dessus et en dessous + Au dessus & en dessous - - In Au dessus de l'axe - Prompt on closing - Confirmer les fermetures de + Confirmer les fermetures des - Folders Dossiers - Matrices Matrices - &Notes Commentai&res - &OK &OK - &Cancel - Annuler + &Annuler - &Apply &Appliquer - &Text Font &Texte - &Labels Font - Étiquettes + &Étiquettes - A&xes Labels Étiquette des a&xes - Axes &Numbers - Étiquette des graduations + Étiquette des graduatio&ns - &Legend &Légende - T&itle T&itre - + Ask before over&writing files + Dem&ander avant d'écraser un fichier + + Application Application - Confirmations Confirmations - - - Colors Couleurs - Language Langue - - - Style Style - Main Font Police principale - Choose &font - Modifier + Modi&fier - Workspace Fond - Panels text Texte des Panneaux - Panels Panneaux - Save every Sauvegarder toutes les - Check for new versions at startup Vérifier les nouvelles versions au démarrage - minutes minutes - Default scripting language Langage de script - Default Column Separator - Séparateur de colonnes par défaut + Séparateur de colonnes par défaut + Séparateur de colonnes - - - - TAB TAB - - - - SPACE ESPACE - - - Background Arrière Plan - Text Texte - - Labels Étiquettes - Default curve style - Style de courbe par défaut + Style - Line width - Épaisseur de ligne + Épaisseur - Symbol size - Taille des symboles + Taille - Line Ligne - Scatter Nuage de points - Line + Symbol Ligne + Symbole - Vertical drop lines Épingles - Spline Spline - Vertical steps Marches verticales - Horizontal steps Marches horizontales - Area Aire - Vertical Bars Barres verticales - Horizontal Bars Barres horizontales - Resolution - Résolution - - - (all data shown) (Toutes les données) - &Show Legend - Afficher la légende - - - Show &Projection - Afficher la &Projection - - - &Data Max - &Maximum - - - + &Afficher la légende + + Smoot&h Line - Affinée + A&ffinée - O&rthogonal O&rthogonal - Lab&els Étiqu&ettes - Mesh &Line - &Ligne du maillage - - - &Grid &Grille - Data &Min - Minimum - - - - - &Numbers &Nombres - A&xes A&xes - &Background - Arrière plan + Arrière &plan - &Title &Titre - &Axes Labels Étiquette des &axes - Autosca&ling Éche&lle automatique - Generated Fit Curve Création de l'ajustement de la courbe - Uniform X Function Fonction X uniforme - Points Points - Same X as Fitting Data Même X que les données d'ajustement - - Display Peak Curves for Multi-peak Fits - Afficher les pics de la courbe pour l'ajustement multi-pics + Afficher les pics lors de l'ajustement multi-pics - Parameters Output - Paramètre de sortie + Paramètres de sortie - Significant Digits Fixées à - Write Parameters to Result Log - Ecrire les paramètres sur la fenêtre de résultats + Écrire les paramètres sur la fenêtre de résultats - Paste Parameters to Plot - Copier les paramètres vers la courbe + Copier les paramètres sur le graphe - Peaks Color Couleur des pics - + Display Confirmation &Messages for Multi-peak Fits + Afficher la confirmation des &messages pour l'ajustement multi-pics + + QtiPlot - Import options error QtiPlot - Erreur d'importation des données - The separator must not contain the following characters: 0-9eE.+- Le séparateur ne doit pas contenir un des caractères suivant : 0-9eE.+- - - - - System Locale Setting Paramètres locaux - Decimal Separators Séparateurs décimaux - Print - Imprimer + Impression - Print Crop&marks - Imprimer les marges de coupe + I&mprimer les marges de coupe - &Scale layers to paper size - Redimensionner les planches à la taille du papier + Redimensionner les planche&s à la taille du papier - Prompt on &renaming tables when appending projects - Demander à renommer les tables lors de l'ajout à de nouveaux projets + Demander à &renommer les tables lors de l'ajout à de nouveaux projets - Numeric Format Format numérique - &Backup project before saving - Archiver le projet avant de sauvegarder + Arc&hiver le projet avant de sauvegarder - Start New Project Nouveau projet - - Empty Vide - Table Table - Matrix Matrice - Empty Graph Graphe vide - Note Commentaire - Update separators in Tables/Matrices - Mettre à jour des séparateurs dans les tables / matrices - - - Number of Decimal Digits Nombre de chiffres - Omit Thousands Separator - Ingnorer le séparateur de milliers - - - &Display Comments in Header &Afficher les commentaires dans l'en-tête - 2 points for linear fits 2 points pour les ajustements linéaires - &Disable in-place editing - + Rémy : C'est quoi ça ? + &Désactiver l'édition en-place - File Locations Chemin des fichiers - Choose the location of the QtiPlot translations folder! - Choisissez le chemin des fichiers de traduction de Qtiplot + Choisissez le chemin des fichiers de traduction de Qtiplot ! - Matrix Undo Stack Size Taille de la pile de la matrice à garder pour corrections - - Translations Traductions - - Help Aides - LF (Unix) LF (Unix) - CRLF (Windows) CRLF (Windows) - CR (Mac) - - Python Configuration Files Fichiers de configuration de python - Endline character Caractère de fin de ligne - Choose the location of the Python configuration files! - Choisissez le chemin des fichiers de configuration de python + Choisissez le chemin des fichiers de configuration de python ! - Automatically &Recalculate Column Values - recalcul automatique des valeurs des colonnes + &Recalcul automatique des valeurs des colonnes - - Background Color Couleur d'arrière plan - - - - Opacity Opacité - - Canvas Color Couleur du cadre - - Border Color Couleur de la bordure - - - - Width Largeur - - Transparent Transparent - &Enable autocompletion (Ctrl+U) - Activer l'autocomplétion + Activ&er l'autocomplétion (Ctrl+U) - Omit &Thousands Separator - Ne pas afficher le séparateur des milliers + Ne pas afficher le sépara&teur des milliers - Clipboard Decimal Separators Séparateur décimal du presse-papier - &B - &It - Notes Commentaires - Tab length (pixels) Longueur de la tabulation (pixels) - Font Police - &Display line numbers - Afficher les Numéros des lignes + Afficher les numéros &des lignes - Axes title space - Espace du Titre des axes + Espace du titre des axes - &Resolution - Résolution + &Résolution - &Floor style - Style de plancher + &Style du plancher - Isolines Isolignes - Projection Projection - &Mesh - &Maille + &Maillage - Default Color Map Carte de couleurs par défaut - Syntax Highlighting Surlignage syntaxique - Co&mments Co&mmentaires - &Keywords - Mots Clefs + Mots &Clefs - &Quotations - Citations + &Citations - &Functions &Fonctions - Q&t Classes Classes Q&t - Axes Axes - Left Gauche - Right Droite - Bottom Inférieur - Top Supérieur - Enabled axes Axes autorisés - Show Montrer - - QtiPlot - index.html File Not Found! QtiPlot - Fichier index.html non trouvé ! - There is no file called <b>index.html</b> in folder %1.<br>Please choose another folder! Il n'existe pas de fichier appelé <b>index.html</b> dans le dossier %1.<br> Choisissez un dossier adéquat ! - - QtiPlot - Folder Not Found! - QtiPlot - Dossier non trouvé + QtiPlot - Dossier non trouvé ! - The folder %1 doesn't exist.<br>Please choose another folder! - Le dossier %1 n'existe pas. <br>Choississez-en un autre. + Le dossier %1 n'existe pas. <br>Choississez-en un autre ! - %1 is not a folder.<br>Please choose another folder! %1 n'est pas un dossier.<br> Choissisez-en un autre! - Choose the location of the QtiPlot help folder! Choisir l'emplacement pour le répertoire du fichier d'aide ! - There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! Il n'y a pas de fichier nommé <b>index.html</b> dans ce répertoire.<br>Veuillez choisir un autre répertoire ! - - QtiPlot - You don't have read access rights to folder %1.<br>Please choose another folder! Vous n'avez pas d'accès en lecture pour le dosseir %1.<br>Choisissez-en un autre ! - - &Internet Connection - + Connexion &internet - - &Proxy - + &Proxy - - Host - + Hôte - - Port - + Port - - Username - + Identifiant - - Password - + Mot de passe - LaTeX Compiler - + Compilateur LaTeX - Choose the location of the LaTeX compiler! - + Choisissez l'emplacement du compilateur LaTeX ! - - QtiPlot - File Not Found! - + QtiPlot - Fichier non trouvé ! - The file %1 doesn't exist.<br>Please choose another file! - + Le fichier %1 n'existe pas. <br>Veuillez choisir un autre fichier ! - %1 is a folder.<br>Please choose a file! - + %1 est un dossier. <br>Veuillez choisir un autre fichier ! - You don't have read access rights to file %1.<br>Please choose another file! - + Vous n'avez pas les droits d'accès en lecture sur le fichier %1.<br>Choisissez un autre fichier ! + + + New Color + Nouvelle couleur + + + &Load Default + Dé&faut + + + Delete Color + Supprimer la couleur + + + Move Color Up + Déplacer vers le haut + + + Move Color Down + Déplacer vers le bas + + + Indexed Colors + Couleurs indéxées + + + Default Symbol + Symbole par défaut + + + Edge width + Largeur + + + Name + Nom + + + Symbol + Symbole + + + Inde&xed Symbols + Symboles indé&xés + + + &Fill Symbol + Re&mplir + + + Move Symbol Up + Déplacer vers le haut + + + Move Symbol Down + Déplacer vers le bas + + + Pattern + Motif + + + Line style + Style + + + Fill area under curve + Remplir l'aire sous la courbe + + + Default Line Style + Ligne par défaut + + + Axis title + Légende d'axe + + + Default + Sans + + + Synchronize scale &divisions + Synchroni&zer les échelles opposées ContourLinesEditor - Level - Niveau + Niveau - Pen - Stylo + Stylo - &Insert - &Insérer + &Insérer - &Delete - + Su&pprimer - QtiPlot - Edit pen - + QtiPlot - Édition du stylo - Color - Couleur + Couleur - - - Apply to all - Appliquer à toutes + Appliquer à toutes - Style - + Style - Width - + Épaisseur - &Ok - &Ok + &Ok - &Close - + Fer&mer Convolution - Convolution Convolution - - - - - QtiPlot QtiPlot - - - - - Error Erreur - The signal data set %1 does not exist! Les données du signal %1 n'existent pas ! - The response data set %1 does not exist! Les données de la réponse %1 n'existent pas ! - The response dataset '%1' must be less then half the size of the signal dataset '%2'! Les données de la réponse '%1' doivent être de moitié inférieure à la taille des données du signal '%2' ! - The response dataset '%1' must contain an odd number of points! Les données de la réponse '%1' doivent contenir un nombre de points impaires ! - Could not allocate memory, operation aborted! Allocation mémoire impossible, opération annulée ! - - Index Indice - - Plot - Graphe - Correlation - Correlation Corrélation - - - QtiPlot QtiPlot - - - Error Erreur - - The data set %1 does not exist! Les données %1 n'existent pas ! - Could not allocate memory, operation aborted! - Allocation mémoire impossible, opération annulée ! - - - Error in GSL forward FFT operation! Erreur de la librarie GSL sur l'opération FFT ! - - Lag - Temps de reponse trop long - - - Plot - Graphe + Décalage CreateBinMatrixDialog - - QtiPlot - + QtiPlot - Bin Matrix Dialog - + Boite des échantillons de matrice - &OK - &OK + &OK - &Cancel - + &Annuler - X-min - + X-min - X-max - + X-max - Columns - Colonnes + Colonnes - Y-min - + Y-min - Y-max - + Y-max - Rows - Rangées + Rangées - Input Size Error - Erreur sur la Taille d'entrée + Erreur sur la taille d'entrée - The dimensions you have specified are not acceptable! - Les dimensions que vous avez spécifiées ne sont pas acceptables + Les dimensions que vous avez spécifiées ne sont pas tolérées ! - Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! - Veuillez entrer des valeurs positives telles que le produit lignes*colonnes ne dépasse pas l'entier maximum que votre système peut gérer + Veuillez entrer des valeurs positives telles que le produit lignes*colonnes ne dépasse pas l'entier maximum que votre système peut gérer ! CurveRangeDialog - QtiPlot - Plot range QtiPlot - Gamme - Data set: Données : - From row number De la rangée - To row number à la rangée - &OK &OK - &Close - Fermer + &Fermer CurvesDialog - QtiPlot - Add/Remove curves Qtiplot - Ajouter / Enlever des courbes - New curves style Nouveau style de courbe - Line Ligne - Scatter Nuage de points - Line + Symbol Ligne + Symbole - Vertical drop lines Épingles - Spline Spline - Vertical steps Marches verticales - Horizontal steps Marches horizontales - Area Aire - Vertical Bars Barres verticales - Horizontal Bars Barres horizontales - Contour - Color Fill Contour - Couleur de remplissage - Contour Lines Lignes du contour - Gray Scale Map Carte en échelle de gris - Available data Données disponibles - Graph contents Contenu - &Plot Associations... - Matrice de Graphes... + &Matrice de Graphes... - Edit &Range... Modifie&r la gamme... - &Edit Function... Modifi&er la fonction... - OK OK - Close Fermer - &Show Range - Afficher la gamme + &Afficher la gamme - &Plot Selection - Sélection du graphe + Sélection du &graphe - &Plot - Courbe + C&ourbe - &Delete Selection - Éffacer la sélection + &Effacer la sélection - &Delete Curve - Supprimer une courbe + &Supprimer une courbe - Show current &folder only - Voir le dossier actuel uniquement + Voir le dossier actuel u&niquement - Histogram Histogramme - Histogram Histogramme @@ -9693,241 +5850,174 @@ CustomActionDialog - - - - - - - - - - - QtiPlot - + QtiPlot - Add Custom Action - Ajouter une action personnalisée + Action personnalisée - Folder Dossier - Choose &Folder - Choisir le dossier + C&hoisir - Script File - fichier de script + Fichier de script - Choose &Script - Choisir le script + Choi&sir - Icon Icône - Choose &Icon - Choisir l'icône + Cho&isir - - Text Texte - Tool Tip Text "Le saviez-vous ?" - Shortcut Raccourci - &Menu - + &Menu - &Tool Bar - Barre d'ou&Tils + Barre d'ou&tils - &Add &Ajouter - &Remove - Supprimer + Supp&rimer - &Close &Fermer - - - - - - - Error Erreur - Please provide a description for your custom action! - Veuillez mettre une description pour votre action personnalisée + Veuillez fournir une description de votre action ! - Dot characters are not allowed in the description text! - Les caractères . , ; : ne sont pas autorisés dans la description du text. + Les caractères . , ; : ne sont pas autorisés dans la description du text ! - You have already defined an action having description: %1 <br>Please provide a different description text! - Vous avez déjà définis une action ayant pour description : %1 <br>Veuillez en fournir une autre. + Vous avez déjà défini une action ayant pour description : %1 <br>Veuillez en fournir une autre ! - The file you have specified doesn't exist, please choose a valid script file! - le fichier que vous avez spécifié n'existe pas. Veuillez en choisir un autre. + Le fichier de script que vous avez spécifié n'existe pas. Veuillez en choisir un autre ! - The image file you have specified doesn't exist or can't be read, please choose another file! - L'image que vous avez spécifié n'existe pas. Veuillez en choisir un autre. + L'icône que vous avez spécifié n'existe pas. Veuillez en choisir une autre ! - Please provide a different key sequence! The following shortcut key sequences are already assigned: - Merci de définir un autre raccourci clavier. Cette séquence est déjà assignée. + Merci de définir un autre raccourci clavier. Cette séquence est déjà assignée : - Are you sure you want to remove this action? - Etes-vous sure de vouloir supprimer cette action ? + Êtes-vous sûr de vouloir supprimer cette action ? - Remove Action - Effacer l'action + Supprimer l'action - - File Save Error - Erreur de sauvegarde + Erreur lors de la sauvegarde - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - Ne peut écrire dans le fichier : <br><h4> %1 </h4><p>. Veuillez vérfifier que vous avez les droits d'écriture. - - - Images - Images - - - + Ne peut écrire dans le fichier : <br><h4> %1 </h4><p>. Veuillez vérifier que vous avez les droits d'écriture ! + + QtiPlot - Load icon from file - QtiPlot - Charger l'icone depuis le fichier + QtiPlot - Charger l'icône depuis le fichier - Choose script file Choisir le fichier de script - Choose the custom actions folder Choisir le dossier des actions personnalisées - &Save &Sauvegarder - &Delete Menu - Menu &D'effacement + &Supprimer - Python Script Script python - All Files Tous les fichiers - Add menu Ajouter un menu - Menu title: - Titre du Menu + Titre du Menu : - Please, choose the location of the new menu Merci de choisir le chemin du nouveau menu - Menu: - + Menu : - Remove Menu - Enlever le Menu + Supprimer - Are you sure you want to remove menu '%1' and all its actions? - Etes-vous sûr de vouloir enlever le menu %1 et toutes ses actions ? + Êtes-vous sûr de vouloir enlever le menu %1 et toutes ses actions ? - &New Menu... - &Nouveau Menu... + &Nouveau... - - Menu Bar Barre de Menu - There's already a menu item with this title, please choose another title! Il existe déjà un objet du menu possédant le même titre. Choisissez-en un autre! @@ -9935,80 +6025,49 @@ DataPickerTool - Click on plot or move cursor to display coordinates! Cliquez sur le graphe ou déplacez le curseur pour afficher les coordonnées ! - Please, click on plot and move cursor! Cliquez sur le graphe et déplacez le curseur ! - Select point and double click to remove it! Sélectionner le point et double cliquez pour le supprimer ! - QtiPlot - Remove point error QtiPlot - Supprimer l'erreur de point - Sorry, but removing points of a function is not possible. Désolé, mais supprimer les points d'une fonction n'est pas possible. - QtiPlot - Move point error QtiPlot - Déplacer l'erreur de point - Sorry, but moving points of a function is not possible. Désolé, mais déplacer les points d'une fonction n'est pas possible. - - - - QtiPlot - Warning QtiPlot - Avertissement - - This operation cannot be performed on curves plotted from columns having a non-numerical format. Cette opération ne peut être réalisée sur des courbes ayant des colonnes au format non numérique. - - The column '%1' is read-only! Please choose another curve! - La colonne '%1' est en lecture-seule ! Choisissez une autre courbe. - - - - DataSetDialog - - QtiPlot - Select data set - QtiPlot - Choisissez une série de données - - - &OK - &OK - - - &Cancel - Annuler + La colonne '%1' est en lecture-seule ! Choisissez une autre courbe ! Deconvolution - Deconvolution Déconvolution @@ -10016,26 +6075,18 @@ Differentiation - - Derivative Dérivée - of Derivative of de - - Plot - Graphe - DrawPointTool - Draw Dessiner @@ -10043,523 +6094,366 @@ EnrichmentDialog - - - - QtiPlot - Tex Equation Editor Editeur d'équation Tex - Clea&r Efface&r - Window Geometry Géométrie de la fenêtre - Object Properties Propriétés - &Apply &Appliquer - &Close - Fermer + F&ermer - Preview: - Prévisualisation + Aperçu : - - &Text - - Color Couleur - - - Set As &Default - Par défaut - - - Font - Police - - - + Par &défaut + + &Font - Police + &Police - Auto-&update - Mise-à-jour automatique + Mise-à-jo&ur automatique - - Opacity Opacité - - Transparent Transparent - Background color - Couleur d'arrière plan - - - File Fichier - &Save internally &Sauvegarde interne - &Image - Shape Forme - None Aucun(e) - Rectangle Rectangle - Shadow Ombré - Line Style Style de ligne - - Width Largeur - Apply &to... - Aplliquer à - - - - - All Windows Toutes les fenêtres - &Frame &Cadre - Fill Color Remplissage - Pattern Modèles de brosse - Pattern Color Couleur de la brosse - Use &Frame Color - Couleur du cadre utilisé + Utiliser la couleur du ca&dre - Fill &Pattern - Remplir le modèle + Rem&plir le motif - Page - + Page - Layer Scales - + Échelles des planches - Attach to - + Associer à - inch pouce - mm - cm - point - pixel pixel - scale échelle - Unit Unité - Position Position - X X - Y Y - Size Taille - Height Hauteur - &Keep aspect ratio - Proportionnel + &Proportionnelle - &Best size - La meilleure taille + Auto&matique - &Geometry &Géometrie - Network connection error Erreur de connexion au réseau - Error while trying to connect to host %1: Ne peut se connecteur à l'hôte %1: - Please verify your network connection! Veuillez vérifier votre connexion! - QtiPlot - Import image from file QtiPlot - Importer une image à partir d'un fichier - QtiPlot - Warning Qtiplot - Attention - The file %1 doesn't exist. The image cannot be restored when reloading the project file! - Le ficheir %1 n'existe pas. L'image ne pourra pas être restaurée quand vous rechargerez le projet. + Le ficheir %1 n'existe pas. L'image ne pourra pas être restaurée quand vous rechargerez le projet ! - - - Layer Planche - - - Window Fenêtre - Background Fond - Rotate (deg.) Rotation (deg.) - - - Object Objet - - Apply t&o... - Appliquer à + &Appliquer à... - Line ligne - Apply format &to... - Appliquer le format à... + Appliquer le forma&t à... - MathTran (http://www.mathtran.org/) - + MathTran (http://www.mathtran.org/) - locally installed - + Installé localement - LaTeX Compiler - + Compilateur LaTeX - TeX &Output - + Rémy : Ca ne serait pas LaTeX plutot ? + S&ortie TeX - Compile process ended - + Fin de la compilation - Compiling process ended with exit code: %1 - + Compilation terminée avec le code %1 - LaTeX compile process - + Processus de compilation LaTeX - dvipng process - + Processus dvipng - - failed to start! - + Échec du démarrage ! - Please verify that you have dvipng installed in the same folder as your LaTeX compiler! - + Veuillez vérifier que dvipng est installé dans le même répertoire que le compilateur LaTeX ! - crashed - + terminé brusquement - timedout - + temps dépassé - write error - + erreur d'écriture - read error - + erreur de lecture - unknown error - + erreur inconnue - Compile error - + erreur de compilation - Please set the correct path to the compiler in the preferences dialog! - - - - - EpsExportDialog - - Orientation - Orientation - - - Page Size - Format de la Page - - - &Print in color if available - Im&primer en couleur si c'est possible - - - QtiPlot - Export options - Qtiplot - Options pour l'exportation - - - &OK - &OK - - - Landscape - Paysage - - - Portrait - Portrait + Veuillez indiquer le chemin correct du compilateur dans les préférences ! ErrDialog - - Source of errors Origine des erreurs - QtiPlot - Error Bars Qtiplot - Barres d'erreurs - &X Error Bars Barres d'erreurs en &abscisse - &Add &Ajouter - Add Error Bars to Ajouter des barres d'erreurs à - Percent of data (%) - Pourcentage sur les données (%) - - - 5 - 5 - - - + Pourcentage (%) + + Standard Deviation of Data Écart-type des données - &Y Error Bars Barres d'erreurs en &ordonnée - &Close - Fermer + &Fermer - Existing column Colonne existante @@ -10567,85 +6461,62 @@ ExpDecayDialog - QtiPlot - Verify initial guesses Qtiplot - Vérifiez les paramètres initiaux - Exponential Fit of Ajustement exponentiel de - Growth time Durée d'accroissement - Decay time Durée de retard - First decay time (t1) Première constante de temps (t1) - 1 - 1 - - - Second decay time (t2) Deuxième constante de temps (t2) - Third decay time (t3) Troisième constante de temps (t3) - Amplitude Amplitude - Y Offset Décalage en Y - 0 - 0 - - - Initial time Temps initial - Color Couleur - &Fit &Calculer - &Close - Fermer + &Fermer - QtiPlot - Warning QtiPlot - Avertissement - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! La courbe <b> %1 </b> n'existe plus ! Opération annulée ! @@ -10653,44 +6524,34 @@ ExponentialFit - Exponential growth Croissance exponentielle - Exponential decay Décroissance exponentielle - ExpGrowth Croissance Exponentielle - - amplitude - lifetime - - offset décalage en Y - ExpDecay1 Décroissance exponentielle, premier ordre - e-folding time @@ -10698,46 +6559,30 @@ ExportDialog - QtiPlot - Export ASCII Qtiplot - Exporter en ASCII - Table Table - &All &Tout - Separator Séparateur - - - - - TAB TAB - - - - - SPACE ESPACE - - The column separator can be customized. The following special codes can be used: \t for a TAB character \s for a SPACE @@ -10746,159 +6591,179 @@ \s pour une espace - - - The separator must not contain the following characters: 0-9eE.+- Le séparateur ne doit pas contenir un des caractères suivant : 0-9eE.+- - Include Column &Names Insérer les &noms des colonnes - Export &Selection Exporter la &sélection - + QtiPlot + QtiPlot + + + Overwrite file? + Écraser le fichier ? + + + %1 already exists. + %1 existe déjà. + + + Do you want to replace it? + Voulez-vous le remplacer ? + + QtiPlot - Export error - QtiPlot - Erreur lors de l'exportation + QtiPlot - Erreur lors de l'exportation - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - - - - &OK - &OK - - - &Cancel - Annuler - - - + Impossible d'enregistrer le fichier <br><h4> %1 </h4><p>. Vérifiez que vous avez les droits requis pour écrire à cet emplacement ! + + &Help - Aide + &Aide - QtiPlot - Help QtiPlot - Aide - QtiPlot - Import options error QtiPlot - Erreur d'importation des données - Include Column Co&mments - Inclure les commentaires des colonnes + Inclure les comme&ntaires des colonnes ExtensibleFileDialog - << &Advanced << &Avancé + ExtractDataDialog + + QtiPlot + QtiPlot + + + Extract Data + Extraire les données + + + For row (i) + Pour la rangée (i) + + + to + à + + + Add function + Ajouter une fonction + + + Add column + Ajouter une colonne + + + &Apply + &Appliquer + + + Clear &Formulas + Effacer les &formules + + + &Close + &Fermer + + + &Put into table + &Destination + + + Table + Table + + + Cond&ition: + Cond&ition : + + + Add &function + &Ajouter + + + Add co&lumn + &Ajouter + + + Add &operator + &Ajouter + + + Clea&r + Efface&r + + + FFT - - - - - FFT FFT - QtiPlot - QtiPlot - - - Error - Erreur - - - Could not allocate memory, operation aborted! - Allocation mémoire impossible, Opération annulée ! - - - - Forward Suivant - - - - of de - - - Frequency Fréquence - - Inverse Inverse - - - Time Temps - - Real Partie réelle - - Imaginary Partie imaginaire - - - - Amplitude Amplitude - - Angle Angle - Hz Hz - s s @@ -10906,194 +6771,141 @@ FFTDialog - QtiPlot - FFT Options QtiPlot - Options FFT - Curve Courbe - - Sampling Interval Période d'échantillonnage - &Normalize Amplitude Amplitude &normalisée - &Shift Results - Fréquence centrée autour de 0 Hz + Fréquence &centrée autour de 0 Hz - &Inverse &Inverse - &Forward - Directe + &Directe - &OK &OK - &Close &Fermer - QtiPlot - Sampling value error - QtiPlot - Erreur d'échantillonnage - - - Frequency - Fréquence - - - Time - Temps - - - Amplitude - Amplitude - - - Sampling Échantillons - Real Partie réelle - Imaginary Partie imaginaire - QtiPlot - Error QtiPlot - Erreur - Please choose a column for the real part of the data! Choisissez une colonne pour la partie réelle des données ! - QtiPlot - The two matrices have different dimensions, the imaginary part will be neglected! Les deux matrices ont des dimensions différentes, la partie imaginaire sera négligée ! - RealMatrixFFT ReelMatriceFFT - Real part of the FFT transform of Partie réelle de la tranformée de Fourier de - ImagMatrixFFT ImageMatriceFFT - Imaginary part of the FFT transform of - Partie Imaginaire de la transformée de Fourrier de + Partie Imaginaire de la transformée de Fourier de - AmplitudeMatrixFFT AmplitudeMatriceFFT - Amplitudes of the FFT transform of - Amplitudes de la transformée de Fourrier de + Amplitudes de la transformée de Fourier de FFTFilter - FFT FFT - Filtered Filtré - - QtiPlot QtiPlot - - Error Erreur - Unknown filter type. Valid values are: 1 - Low pass, 2 - High Pass, 3 - Band Pass, 4 - Band block. Type de filtre inconnu. Le choix est : 1 - Passe-bas, 2 - Passe-haut, 3 - Passe-bande, 4 - Réjecteur. - Please enter different values for the band limits. Veuillez donner différentes valeurs pour les limites de bande. - to à - Hz Hz - Low Pass FFT Filter Filtre Passe bas - High Pass FFT Filter Filtre Passe haut - Band Pass FFT Filter Filtre Passe bande - Band Block FFT Filter Filtre réjecteur @@ -11101,82 +6913,58 @@ Filter - - - - - - QtiPlot QtiPlot - - - - - Error Erreur - Please assign a curve first! Assignez d'abord une courbe ! - Several data points have the same x value causing divisions by zero, operation aborted! Plusieurs points ont la même valeur en X, causant une division par zéro. opération annulée ! - - You need at least %1 points in order to perform this operation! - Il faut au moins %1 points pour pouvoir faire cet opération ! + Il faut au moins %1 points pour pouvoir faire cette opération ! - QtiPlot - Filter Error QtiPlot - Erreur sur le filtre - Please enter a valid curve name! Veuillez entrez un nom de courbe valide ! - QtiPlot - Color Name Error QtiPlot - Erreur de couleur - The color name '%1' is not valid, a default color (red) will be used instead! Le nom de couleur '%1' n'est pas valide, la couleur par défaut (rouge) est utilisé ! - You didn't specify a valid data set for this operation! Vous n'avez pas spécifié de données valides pour cette opération ! - of de - Plot Graphe - Memory Allocation Error Erreur d'Allocation mémoire - Not enough memory, operation aborted! Pas assez de mémoire, opération annulée! @@ -11184,75 +6972,50 @@ FilterDialog - QtiPlot - Filter options QtiPlot - Options du filtre - Filter curve: Filtrer : - Frequency cutoff (Hz) Fréquence de coupure (Hz) - Low Frequency (Hz) Fréquence de coupure basse (Hz) - 0 - 0 - - - High Frequency (Hz) Fréquence de coupure haute (Hz) - Add DC Offset Tenir compte de la composante continue - Substract DC Offset Supprimer la composante continue - - Color Couleur - &Filter &Calculer - &Close - Fermer + &Fermer - QtiPlot - Frequency input error QtiPlot - Erreur de la fréquence d'entrée - Please enter positive frequency values! - Donnez des valeurs de fréquences positives ! - - - QtiPlot - High Frequency input error - QtiPlot - Erreur de la limite de départ - - - Please enter frequency limits that satisfy: Low < High ! Donnez des limites de fréquences dans l'ordre croissant ! @@ -11260,523 +7023,370 @@ FindDialog - QtiPlot QtiPlot - - Find Chercher - Start From À partir de - Search in Chercher dans - &Window Names - Noms des fenêtres + Noms des &fenêtres - Window &Labels - Etiquettes des fenêtres + &Étiquettes des fenêtres - Folder &Names - Noms des dossiers + &Noms des dossiers - Case &Sensitive - Respecter la case + Re&specter la casse - &Partial Match Allowed Correspondance &partielle autorisée - &Include Subfolders &Inclure les sous-dossiers - &Find - Chercher + &Chercher - &Update Start Path Mise à jo&ur du chemin - &Close - Fermer + &Fermer FindReplaceDialog - - - QtiPlot Qtiplot - - Find Chercher - Find and Replace Chercher et remplacer - Replace with Remplacer par - &Match case Tenir co&mpte de la casse - &Whole word - Mot entier + &Mot entier - &Next - Suivant + Suiva&nt - &Previous - &Précédente + &Précédent - &Replace - Remplacer + &Remplacer - Replace &all - Tout remplacer + Tout rempl&acer - &Close - Fermer + &Fermer - - - Empty Search Field Champ de recherche vide - - - The search field is empty. Please enter some text and try again. - Le champ de recherche est vide. Veuillez entrer une expression et ré-essayer + Le champ de recherche est vide. Veuillez entrer une expression et ré-essayer. - QtiPlot has finished searching the document. - Qtpilot a terminé de chercher dans le document + Qtpilot a terminé la recherche. Fit - - - - - - - QtiPlot - Fit Error QtiPlot - Erreur d'ajustement - No curve assigned to the fitter! Please assign a curve first! - Aucune courbe assignée pour l'ajustement. Asssignez une courbe ! - - - Please enter a valid curve name! - Veuillez entrez un nom de courbe valide ! - - - Plot Graphe - fit of dataset - Ajustement des données - - - using function utilisant la fonction - Weighting Method Méthode de pondération - No weighting Aucun poids - Instrumental Instrumentation - using error bars dataset utilisant les données en barres d'erreurs - Statistical Statistique - Arbitrary Dataset - Données aléatoires + Aléatoires - Nelder-Mead Simplex Simplex Nelder-Mead - Unscaled Levenberg-Marquardt Levenberg-Marquardt - Scaled Levenberg-Marquardt Levenberg-Marquardt Normalisé - algorithm with tolerance = algorithme avec une tolérence de - From x De x - to x à x - - R^2 R^2 - Iterations Nombre d'itérations - Status - Etat + État - Dataset Données - Function Fonction - The column %1 has less points than the fitted data set. Please choose another column! - + La colonne %1 possède moins de points que la colonne des points ajustés. Veuillez choisir une autre colonne ! - Error Erreur - The curve %1 has no associated Y error bars. You cannot use instrumental weighting method. La courbe %1 n'a pas de barres d'erreurs asociées en Y. Vous ne pouvez pas . - Parameter Paramètre - Value Valeur - You didn't specify a data set for this fit operation. Operation aborted! - Vous n'avez pas spécifié de données pour cette opération. Opération annulée ! - - - There are no parameters specified for this fit operation. Operation aborted! Aucun paramètre spécifée pour cette opération. Opération annulée ! - You must specify a valid fit function first. Operation aborted! Vous devez d'abord spécifier une fonction d'ajustement valide. Opération annulée ! - Fit Ajustement - of - de - - - - - - QtiPlot - Error QtiPlot - Erreur - You need at least %1 points to perform this operation! Operation aborted! - Il faut au moins %1 points pour réaliser cette opération ! Opération annulée ! - - - - The column %1 has less points than the fitted data set. Please choose another column!. - La colonne %1 possède moins de points que les données ajustées. Veuillez choisir une autre colonne !. - - - You didn't specify a valid data set for this fit operation. Operation aborted! Vous n'avez pas spécifiés des données valides pour cette opération d'ajustement. Opération annulée ! - You need at least %1 data points for this fit operation. Operation aborted! Il faut au moins %1 points pour réaliser cette opération ! Opération annulée ! - graphics display disabled Affichage des graphes désactivé - of dataset de données - You cannot use the instrumental weighting method. Vous ne pouvez pas utiliser la méthode de la pondération instrumental. - QtiPlot - File Save Error Erreur lors de la sauvegarde du fichier - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Impossible d'enregistrer dans le fichier <br><h4> %1 </h4><p>. Vérifiez que vous avez les droits requis pour écrire à cet emplacement ! - QtiPlot Fit Model Qtiplot modèle de Régression - Cannot read file %1: %2. Ne peut pas lire le fichier %1 %2. - - - Please perform a fit first! - Merci de procéder à un ajustement avant. + Merci de procéder à un ajustement avant ! - Residuals of %1 Résidus de %1 - residue résidu - Adjusted R^2 Coefficient R^2 ajusté - RMSE (Root Mean Squared Error) RMSE (La racine carrée moyenne des carrés des erreurs) - RSS (Residual Sum of Squares) RSS (Restes de la somme des carrés) - FitResiduals - - FitStats - Confidence Limits of %1 Intervalle de confiance de %1 - - Independent Variable Variable indépendante - LCL - Lower %1 Confidence Limit Limite inférieur de confiance de %1 - UCL UCL (Limite supérieure de confiance) - Upper %1 Confidence Limit Limite supérieure de confiance %1 - Prediction Limits of %1 Limites de prédiction de %1 - LPL LPL (Limite inférieur de prédiction) - Lower %1 Prediction Limit Limite inférieur de prédiction de %1 - UPL UPL (Limite supérieure de prédiction) - Upper %1 Prediction Limit Limite supérieur de prédiction de %1 - Direct Weighting using Dataset Pondération à partir des données - - - - - - - QtiPlot - Memory Allocation Error Qtiplot - Erreur d'Allocation mémoire - - Could not allocate enough memory for the fit curves! Allocation mémoire impossible pour l'ajustement des courbes ! - QtiPlot - Memory Allocation Error Qtiplot - Erreur d'Allocation mémoire - - - - - - Not enough memory! Pas assez de mémoire ! @@ -11784,608 +7394,425 @@ FitDialog - Curve Courbe - - Function Fonction - Initial guesses Estimation initiale des paramètres - Parameter Paramètre - Value Valeur - Constant Constante - - Error - Erreur - - - Algorithm Algorithme - Scaled Levenberg-Marquardt Levenberg-Marquardt normalisé - Unscaled Levenberg-Marquardt Levenberg-Marquardt - Nelder-Mead Simplex Simplex Nelder-Mead - Color Couleur - From x= De x = - To x= à x = - Iterations Nombre d'itérations - Tolerance Tolérance - - Weighting Method - Méthode de pondération - - - No weighting - Aucun poids + Aucun - Instrumental - Instrumentale + Instrumental - Statistical Statistique - Arbitrary Dataset Données aléatoires - << &Edit function - << Modifi&er la fonction - - - &Delete Fit Curves - Supprimer les courbes ajustées + &Supprimer les courbes ajustées - &Fit &Calculer - - - &Close - Fermer - - - Custom &Output >> - Sortie personnalisée >> - - - + &Fermer + + Category Catégorie - Expression Expression - User defined Définie par l'utilisateur - Built-in Interne - Basic Basique - Plugins Extensions - Fit with &built-in function - Ajuster avec une fonction interne + Ajuster avec une &fonction interne - - Polynomial Order Ordre - &Choose plugins folder... - &Choisir le répertoire des extensions... - - - Clear user &list - Supprimer la &liste personnalisée - - - Name Nom - user1 utilisateur1 - - &Save &Sauvegarder - - Parameters Paramètres - &Remove - Supprimer + Supp&rimer - Add &expression - Ajouter une &expression + Ajouter l'&expression - Add &name - Ajouter un &nom + Ajouter le &nom - Rese&t Ini&tialiser - &Fit >> - Ajuster >> - - - &Uniform X Function Fonction X &uniforme - Points Points - Same X as Fitting &Data - Même X que les données d'ajustement + Même X que les &données d'ajustement - Generated Fit Curve Création de l'ajustement de la courbe - Significant Digits Fixées à - Parameters &Table Paramètres de la &table - - Name: Nom : - Covariance &Matrix &Matrice de co-variance - CovMatrix CovMatrix - Scale Errors with sqrt(Chi^2/doF) - Échelle d'erreurs en sqrt(Chi^2/doF) - - - Parameters Output - Paramètre de sortie + Paramètres de sortie - &Write Parameters to Result Log - Ecrire les paramètres sur la fenêtre de résultats + Rémy : bof + Écrire les &paramètres sur la fenêtre de résultats - &Paste Parameters to Plot Co&pier les paramètres vers la courbe - << &Fit - << &Ajuster - - - &Apply &Appliquer - - - - - - - QtiPlot - Error QtiPlot - Erreur - Please enter a valid name for the parameters table. Veuillez donner un nom valide pour les paramètres de la table. - - - - - Please perform a fit first and try again. Veuillez faire un ajustement et essayer de nouveau. - Please enter a valid name for the covariance matrix. Veuillez donner un nom valide pour la matrice de co-variance. - - - - - QtiPlot - Input function error QtiPlot - Erreur de la fonction d'entrée - - Please enter a valid function! Veuillez entrer une fonction valide ! - Please enter a function name! Veuillez entrer un nom de fonction ! - Please enter at least one parameter name! - Veuillez entrer au moins un nom de paramètre ! - - - QtiPlot - Error: function name Qtiplot - Erreur : fonction non reconnue - is a built-in function name<p>You must choose another name for your function! est un nom de fonction interne<p>Veuillez choisir un autre nom pour votre fonction ! - You can't define functions recursevely! - Vous en pouvez pas définir de fonctions récursives ! - - - Fit with selected &user function Aj&uster par une fonction définie par l'utilisateur - Fit using &built-in function - Ajuster par une fonction interne + Ajuster par une &fonction interne - Fit using &plugin function - Ajuster par une fonction externe + Ajuster par une &extension - Choose the plugins folder Choisir le répertoire des extensions - - Gauss Gauss - Peaks Pics - - Lorentz Lorentz - - Polynomial Polynomial - QtiPlot - Warning QtiPlot - Avertissement - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! La courbe <b> %1 </b> n'existe plus ! Opération annulée ! - QtiPlot - Start limit error - QtiPlot - Erreur sur la limite inférieure - - - QtiPlot - End limit error - QtiPlot - Erreur sur la limite supérieure - - - QtiPlot - Input error QtiPlot - Erreur lors de l'entrée des paramètres - Please enter x limits that satisfy: from < end! Donnez des limites en abscisses dans l'ordre croissant ! - QtiPlot - Tolerance input error - QtiPlot - Erreur sur la valeur de la tolérance - - - The tolerance value must be positive and less than 1! - La tolérance doit être un nombre compris entre 0 et 1 ! - - - Please verify that you have initialized all the parameters! Veuillez vérifier que vous avez initialisé tous les paramètres ! - MultiPeak - Multi-pics - - - Please enter initial guesses for your parameters! - Veuillez entrer des valeurs initiales pour la recherche des paramètres ! - - - - No data tables Aucune donnée dans les tables - QtiPlot - Fit Wizard QtiPlot - Assistant de l'ajustement - &Preview - Prévisualisation + A&perçu - From De - + Data Set + Jeu de données + + + Weighting + Poids + + + Re&load + Re&charger + + + &Guess + &Proposer + + + &Range + &Gamme + + To à - - - + Error + Erreur + + Select Function - + Choisissez une fonction - - - - Fitting Session - + Session d'ajustement de courbe - - - Custom Output - + Sortie personnalisée - - Choose plug&ins folder... - Choisir le dossier des plugins... + Cho&isir le dossier des extensions... - Start Fitting Session - + Début de la session d'ajustement - &One table for all fits - Un tableau pour toutes les régressions + Une table pour t&outes les régressions - You can't define functions recursively! - Vous ne pouvez pas définir les fonctions de manière récursive + Vous ne pouvez pas définir les fonctions de manière récursive ! - - QtiPlot fit model Modèle de régression Qtiplot - - All files Tous les fichiers - - - QtiPlot - - Save Fit Model As - Enregistrer les modèles de régression sous... + Enregistrer les modèles de régression sous - Are you sure you want to remove fit model file: %1 ? Êtes-vous certains de vouloir effacer ce modèle de régression du fichier : %1 ? - Remove Fit Model Effacer le modèle de régression - Choose &models folder... - Choisir le dossier des modèles... + Choisir le dossier des &modèles... - Choose the fit models folder Choisir le dossier des modèles de régression - &Residuals Plot - Co&nf. Bands - Pred. &Bands - &Scale Errors with sqrt(Chi^2/doF) - Echelle des erreur avec racine(Chi^2/doF) + Échelle des erreur&s en racine(Chi^2/doF) - Direct Weighting Pondération directe - Error: Erreur: @@ -12393,12 +7820,10 @@ Folder - kB kOctects - bytes octects @@ -12406,108 +7831,86 @@ FrequencyCountDialog - QtiPlot - Frequency count Qtiplot - Calculs de fréquences - Statistics on %1 Statistique sur %1 - Mean Moyenne - Standard Deviation - Déviation standard + Écart type - Median Médiane - Size taille - From Minimum Depuis le minimum - To Maximum au maximum - Step Size valeur du pas - &Apply &Appliquer - &Cancel - Annuler + &Annuler - &Ok &Ok - QtiPlot - Error QtiPlot - Erreur - Not enough data points, operation aborted! - Pas assez de points, opération annulée. + Pas assez de points, opération annulée ! - QtiPlot - Frequency input error QtiPlot - Erreur de la fréquence d'entrée - Please enter frequency limits that satisfy: From < To ! Veuillez entrer des fréquences limites telles que "de < à" ! - - Count Calcul - Frequency count of %1 Calculs des fréquences de %1 - BinCtr - BinEnd - Sum Somme @@ -12515,223 +7918,157 @@ FunctionDialog - - Clear list - Effacer la liste - - - - Clear Function - Effacer la fonction - - - QtiPlot - Add function curve Qtiplot - Ajouter une courbe de fonction - Curve type Type de courbe - + Click here to select a recently typed expression + Cliquez ici pour sélectionner une expression récente + + + Rece&nt + Réce&nt + + f(x)= f(x) = - From x= De x = - To x= à x = - - - Points Points - - Parameter Paramètre - - To à - + QtiPlot + QtiPlot + + + Sorry, there are no recent expressions available! + Désolé, il n'y a pas d'expressions récentes ! + + + Recent Functions + Fonctions récentes + + + Please, choose a function: + Veuillez choisir une fonction : + + y = y = - x = x = - - From De - R = R = - Theta = Theta = - Function Fonction - Parametric plot Courbe paramétrée - Polar plot Courbe polaire - Close - Fermer - - - Ok - OK - - - - - QtiPlot - Start limit error - QtiPlot - Erreur de la limite de départ - - - - - QtiPlot - End limit error - QtiPlot - Erreur de la limite d'arrêt - - - - - QtiPlot - Input error QtiPlot - Erreur lors de l'entrée des paramètres - Please enter x limits that satisfy: from < end! Donnez des limites en abscisses dans l'ordre croissant ! - - - - - QtiPlot - Input function error QtiPlot - Erreur de la fonction d'entrée - - Please enter parameter limits that satisfy: from < end! Donnez les limites du paramètre dans l'ordre croissant ! - Clea&r Function - Effacer la fonction + Efface&r la fonction - &Ok &Ok - &Close - fermer + &fermer - Constant Constante - Value Valeur - &Add Function - + &Ajouter une fonction GaussAmpFit - (offset) - (décalage) - - - (height) - (poids) - - - (center) - (centre) - - - (width) - (largeur) - - - GaussAmp GaussAmp - GaussAmp Fit Ajustement de gaussienne - offset Décalage en Y - amplitude - center centre - width Largeur @@ -12739,48 +8076,26 @@ GaussFit - Gauss Gauss - (area) - (surface) - - - (center) - (centre) - - - (width) - (largeur) - - - (offset) - (décalage) - - - Gauss Fit Ajustement de Gauss - area aire - center Centre - width Largeur - offset Décalage en Y @@ -12788,893 +8103,318 @@ Graph - Choose a filename to save under - Choisissez un nom pour sauvegarder ce fichier - - - QtiPlot - Overwrite File? - QtiPlot - Ecraser le fichier? - - - A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? - Un fichier nommé: <p><b>%1</b><p>existe déjà. Voulez vous l'écraser? - - - &Yes - &Oui - - - &No - &Non - - - QtiPlot - Export Error - QtiPlot - Erreur lors de l'exportation - - - QtiPlot - File open error QtiPlot - Erreur lors de l'ouverture du fichier - Error - QtiPlot - Erreur - QtiPlot - - - QtiPlot - Pixel selection warning - QtiPlot - Avertissement lors de la sélection de pixel - - - - - QtiPlot - Warning QtiPlot - Avertissement - You need at least %1 points to perform the fit! Operation aborted! - Il faut au moins %1 points pour pouvoir faire cet ajustement ! Opération annulée ! - - - You need at least %1 points to perform this operation! Operation aborted! - Il faut au moins %1 points pour pouvoir faire cette opération ! Opération annulée ! - - - &Cut - &Couper - - - - &Copy &Copier - - &Delete &Supprimer - - - &Properties... &Propriétés... - &Rescale to show all - &Echelle automatique - - - Ctrl+R - Ctrl+R - - - + &Échelle automatique + + &Hide axis &Cacher les axes - &Show grids &Afficher la grille - &Scale... - &Echelle... - - - QtiPlot - File not found - QtiPlot - Fichier non trouvé - - - Plugin file: <p><b> %1 </b> <p>not found. Operation aborted! - Le ficher d'extension : <p><b> %1 </b> <p> n'existe pas. Opération annulée ! - - - Error when loading plugin! - - Erreur lors du chargement de l'extension ! - - - - Error when loading plugin! - Erreur lors du chargement de l'extension ! - - - Frequency - Fréquence - - - Time - Temps - - - Real - Réel - - - Imaginary - Imaginaire - - - Amplitude - Amplitude - - - Angle - Angle - - - Low Pass FFT Filter of - Filtre Passe bas de - - - High Pass FFT Filter of - Filtre Passe haut de - - - Band Pass FFT Filter of - Filtre Passe bande de - - - Band Block FFT Filter of - Filtre réjecteur de - - - Histogram and Probabilities for - Histogramme et Probalités pour - - - Mean - Moyenne - - - Standard Deviation - Ecart-Type - - - Minimum - Minimum - - - Maximum - Maximum - - - Bins - Echantillons - - - Could not allocate memory, operation aborted! - Allocation mémoire impossible, opération annulée ! - - - Curve selected! Move cursor and click to choose a point and double-click/press 'Enter' to finish! - Courbe sélectionnée ! Déplacez le curseur et cliquez pour choisir un point puis double-cliquez ou appuyez sur 'Entrée' pour terminer ! - - - Your data is not valid. You need at least two different points for a histogram! - Vos données ne sont pas valides. Il faut au moins 2 points différents pour un histogramme ! - - - QtiPlot - Integration error - QtiPlot - Erreur d'intégration - - - You need at least 2 points to integrate! Integration aborted! - Il faut au moins 2 points pour intégrer ! Intégration annulée ! - - - Several points have the same x value causing divisions by zero, integration aborted! - Plusieurs points ont la même valeur en X, causant une division par zéro. Intégration annulée ! - - - Linear regresion of - Régression linéaire de - - - Order - Ordre - - - Polynomial fit of - Ajustement polynomial de - - - + &Échelle... + + There are no curves available on this plot! Il n'y a pas de courbes disponibles sur ce graphe ! - - - - - - QtiPlot - Error QtiPlot - Erreur - There are no curves with more than two points on this plot. Operation aborted! Il n'y a pas de courbes avec plus de 2 points sur ce graphe. Opération annulée ! - All the curves on this plot are empty! - Toutes les courbes de ce graphe sont vides ! - - - Peak %1 selected! Click to select a point and double-click/press 'Enter' to set the position of the next peak! - Pic %1 sélectionné ! Cliquez pour sélectionner un point et double-cliquez (ou pressez 'Entrée') pour fixer la position du prochain pic ! - - - The columns Les colonnes - are empty and will not be added to the plot! sont vides et ne seront pas ajoutées au graphe ! - The column La colonne - is empty and will not be added to the plot! est vide et ne sera pas ajoutée au graphe ! - y0 (offset) - y0 (décalage) - - - Lorentz - Lorentz - - - Gauss - Gauss - - - multi-peak - multi-pic - - - fit of - Ajustement de - - - Non-linear fit of - Ajustement non-linéaire de - - - Non-linear - Non-linéaire - - - Exponential decay fit of - Ajustement décroissance exponentielle de - - - ExpDecay2 fit of - Ajustement décroissance exponentielle 2 de - - - ExpDecay3 fit of - Ajustement décroissance exponentielle 3 de - - - Exponential growth fit of - Ajustement croissance exponentielle de - - - Gauss fit of - Ajustement Gaussien de - - - Lorentz fit of - Ajustement Lorentzien de - - - using function - utilisant la fonction - - - Unscaled Levenberg-Marquardt - Levenberg-Marquardt - - - Scaled Levenberg-Marquardt - Levenberg-Marquardt Normalisé - - - algorithm with tolerance = - algorithme avec une tolérence de - - - From x= - De x = - - - to x= - à x = - - - Iterations = - Nombre d'itérations - - - Peak - Pic - - - Height - Hauteur - - - Area - Aire - - - Center - Centre - - - Width - Largeur - - - Nelder-Mead Simplex - Simplex Nelder-Mead - - - Savitzky-Golay smoothing of - Lissage Savitzky-Golay de - - - A1 (init value) - A1 (Valeur initiale) - - - A2 (final value) - A2 (valeur finale) - - - x0 (center) - x0 (centre) - - - dx (time constant) - dx (constante de temps) - - - Boltzmann (Sigmoidal) - Boltzmann (Sigmoïdal) - - - Boltzmann (Sigmoidal) fit of - Ajustement Boltzmann (Sigmoïdal) de - - - Derivative of - Dérivée de - - - Left - Gauche - - - Right - Droite - - - Title Titre - QtiPlot - Remove point error - QtiPlot - Supprimer l'erreur de point - - - This function is not available for function curves! - Cette fonction n'est pas disponible pour courbes de fonctions ! - - - QtiPlot - Move point error - QtiPlot - Déplacer l'erreur de point - - - Image file: <p><b> %1 </b><p>does not exist anymore! Fichier image : <p><b> %1 </b><p> n'existe plus ! - QtiPlot - Input function error - QtiPlot - Erreur de la fonction d'entrée - - - Ctrl+Shift+R Ctrl+Shift+R - Quantity - Quantité - - - Sum - Somme - - - Percent - Pourcentage - - - Linear interpolation of - Interpolation linéaire de - - - Cubic interpolation of - Interpolation cubique de - - - Akima interpolation of - Interpolation Akima de - - - Linear regression of - Regression linéaire de - - - QtiPlot - QtiPlot - - - There is no curve called '%1' on this layer. - Aucune courbe nommée "%1" sur cette planche. - - - There is no curve with index %1 on this layer. - Aucune courbe avec un index %1 sur cette planche. - - - Valid indexes must have values between 0 and %1 - Les indexes doivent être compris entre 0 et %1 - - - Fit - Ajustement - - - The curve %1 doesn't exist! Operation aborted! - La courbe %1 n'existe plus. Opération annulée ! - - - Please select the start line point inside the image rectangle! - Veuillez sélectionner la ligne de départ à l'intérieur du rectangle image ! - - - Please select the end line point inside the image rectangle! - Veuillez sélectionner la ligne de fin à l'intérieur du rectangle image ! - - - Smoothed - Lissée - - - points - points - - - FFT Smoothing of - FFT lissée de - - - average mmoothing of - moyenne lissée de - - - - Please provide a valid file name! Veuillez donner un nom de fichier valide ! - File format not handled, operation aborted! Format de fichier non supporté, opération annulée ! - layer - + planche - Data set generated from curve Données générées à partir de la courbe - - Table - Table - - - F F - - Couldn't change the axis type to the requested format! - Ne peut changer le type de l'axe au format demandé. + Ne peut changer le type de l'axe au format demandé ! - Y Axis Title Étiquette de l'axe Y - X Axis Title Étiquette de l'axe X - - Cu&t Co&uper - - C&lear - Supprimer + Supp&rimer Graph3D - QtiPlot - IO Error - QtiPlot - Erreur d'entrée/Sortie - - - Choose a filename to save under - Choisissez un nom pour sauvegarder ce fichier - - - QtiPlot - Overwrite File? - Qtiplot - Ecraser ce fichier? - - - A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? - Un fichier nommé <p><b>%1</b><p>existe déjà. Voulez-vous l'écraser ? - - - &Yes - &Oui - - - &No - &Non - - - QtiPlot - Export Error - QtiPlot - Erreur lors de l'exportation - - - QtiPlot - QtiPlot - - - X axis Axe X - Y axis Axe Y - Z axis Axes Z - Could not print: <h4> - Ne peut pas impriemr <h4> - - - - - QtiPlot - Error QtiPlot - Erreur - - Please provide a valid file name! Veuillez donner un nom de fichier valide ! - File format not handled, operation aborted! Format de fichier non supporté, opération annulée ! - ImageDialog - - QtiPlot - Image Geometry - Qtiplot - Taille de l'image - - - Origin - Origine - - - pixels - pixels - - - X= - X = - - - Y= - Y = - - - Size - Taille - - - width= - Largeur = - - - height= - Hauteur = - - - Keep aspect ratio - Proportionnel - - - &Apply - &Appliquer - - - &Ok - &Ok - - - &Cancel - Annuler - - - ImageExportDialog - QtiPlot - Choose a filename to save under QtiPlot - Choisissez un nom pour sauvegarder ce fichier - Show export &options - Afficher les &options d'exportation - - - Resolution (DPI) Résolution (DPI) - &Export in &color - &Exporter en couleur - - - Custom &page size - Personnaliser la taille de la &page - - - &Keep aspect ratio - Proportionnel + &Proportionnel - Image quality Qualité de l'image - Save transparency Sauvegarder la transparence - Export 3D texts as Exporter les textes 3D comme - Export in &color - - - - - &Escape special characters in title/axis labels - - - - + Exporter en &couleur + + Export &font sizes - + Exporter les tailles de la &police - Bitmap images Images Bitmap - Native fonts Polices natives - LaTeX file - fichier LaTeX + Fichier LaTeX - 3D Sort mode Mode de tri 3D - No sort - pas de tri + Pas de tri - Simple sort - simple tri + Simple tri - BSP sort - tri BSP + Tri BSP - inch pouce - mm - + mm - cm - + cm - point - + point - pixel pixel - Unit Unité - Width - largeur + Largeur - Height Hauteur - + QtiPlot + QtiPlot + + + Overwrite file? + Écraser le fichier ? + + + %1 already exists. + %1 existe déjà. + + + Do you want to replace it? + Voulez-vous le remplacer ? + + + QtiPlot - Export error + QtiPlot - Erreur lors de l'exportation + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + Ne peut écrire dans le fichier : <br><h4> %1 </h4><p>. Veuillez vérifier que vous avez les droits d'écriture à cet emplacement ! + + Custom print size Taille d'impression personnalisée - + &Escape special characters in texts + Caractère &Escape dans le texte + + Scale Fonts Factor - facteur d'échelle pour la police + Facteur d'échelle pour la police - Automatic Automatique - Print Resolution (DPI) - + Résolution (DPI) - ImageExportOptionsDialog - - QtiPlot - Export options - Qtiplot - Options pour l'exportation - - - Image format - Format de l'image - - - Image quality - Qualité de l'image - - - &OK - &OK + ImageProfilesTool + + Position + Position + + + x + x + + + y + y + + + Z-Value + z ImageWidget - - QtiPlot - File openning error QtiPlot - Erreur lors de l'ouverture du fichier - The file: <b>%1</b> doesn't exist! Le fichier : <b> %1 </b> n'existe pas ! - You don't have the permission to open this file: <b>%1</b> Vous n'avez pas les droits pour ouvrir le fichier <b>%1</b> @@ -13682,79 +8422,46 @@ ImportASCIIDialog - QtiPlot - Import ASCII File(s) QtiPlot - Importer un (des) fichier(s) ASCII - All files Tous les fichiers - Text files Fichiers texte - Data files Fichiers de données - Comma Separated Values Valeurs séparées par une virgule - - Import each file as: - Importer chaque fichier comme : - - - - New Table Nouvelle table - New Columns Nouvelles colonnes - New Rows Nouvelles rangées - Overwrite Current Table - Écraser la table - - - - Separator: - Séparator : - - - - - - - TAB TAB - - - - SPACE ESPACE - The column separator can be customized. The following special codes can be used: \t for a TAB character @@ -13762,42 +8469,31 @@ Le séparateur de colonne peut être personnalisé. Les codes spéciaux suivant peuvent être utilisés :\t pour une tabulation \s pour une espace - The separator must not contain the following characters: 0-9eE.+- Le séparateur ne doit pas contenir un des caractères suivant : 0-9eE.+- - Ignore first Ignorer les premières - lines lignes - Ignore lines starting with Ignorer les lignes commançant par - Use first row to &name columns - Utiliser la première rangée pour &nommer les colonnes - - - Use second row as &comments Utiliser la seconde colonne pour les &commentaires - &Remove white spaces from line ends Supprime&r les espaces de fin de lignes - By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. @@ -13805,15 +8501,12 @@ En validant cette option, toutes les espaces du fichier ASCII seront supprimées. - Warning: checking this option leads to column overlaping if the columns in the ASCII file don't have the same number of rows. Attention : Valider cette option entrainera un recouvrement de colonnes si les colonnes du fichier ASCII n'ont pas le même nombre de rangées. - - To avoid this problem you should precisely define the column separator using TAB and SPACE characters. @@ -13821,12 +8514,10 @@ Pour éviter ce problème, vous devez définir les séparateurs de colonnes à TAB ou à SPACE. - &Simplify white spaces &Simplifier les espaces - By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal @@ -13836,7 +8527,6 @@ En validant cette option, toutes les espaces et les tabulations (TAB) du fichier seront supprimées et remplacées par une espace unique. - Warning: checking this option leads to column overlaping if the columns in the ASCII file don't have the same number of rows. @@ -13844,30 +8534,18 @@ Attention : Valider cette option entrainera un recouvrement de colonnes si les colonnes du fichier ASCII n'ont pas le même nombre de rangées. - Decimal Separators Séparateurs décimaux - System Locale Setting Paramètres locaux - Import &decimal separators - Importer les séparateurs décimaux - - - Re&member the above options - Se souvenir des options précédentes - - - &Help - Aide + &Aide - The column separator can be customized. The following special codes can be used: \t for a TAB character \s for a SPACE @@ -13876,513 +8554,237 @@ \s pour une espace - The separator must not contain the following characters: 0-9eE.+- Le séparateur ne doit pas contenir un des caractères suivant : 0-9eE.+- - Remove white spaces from line ends Supprimer les espaces de fin de lignes - By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. En validant cette option, toutes les espaces du fichier ASCII seront supprimées. - Simplify white spaces Simplifier les espaces - By checking this option each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. En validant cette option, toutes les espaces (y compris les tabulations) seront remplacées par une espace unique. - By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. En validant cette option, toutes les espaces du fichier seront supprimées et les tabulations seront remplacées par une espace unique. - Warning: using these two last options leads to column overlaping if the columns in the ASCII file don't have the same number of rows. Attention : Utiliser ces deux dernières options entrainera le recouvrement de colonnes si les colonnes du fichier ASCII n'ont pas le même nombre de rangées. - To avoid this problem you should precisely define the column separator using TAB and SPACE characters. Pour éviter ce problème, vous devez définir les séparateurs de colonnes à TAB ou à SPACE. - QtiPlot - Help QtiPlot - Aide - Import as &read-only Importer en lectu&re seule - Lines - Lignes - - - All Tout - Error - Erreur - - - &Preview Lines - Prévisualisation des lignes + A&perçu des lignes + A&perçu - - New Matrice Nouvelle matrice - Overwrite Current Window Ecraser la fenêtre courante - + New Matrix + Matrice + + Use first row &as - + Utiliser l&a première colonne comme - Column Names - + Noms des colonnes - Column Comments - + Commentaires des colonnes - Endline character Caractère de fin de ligne - LF (Unix) - + LF (Unix) - CRLF (Windows) - + CRLF (Windows) - CR (Mac) - + CR (Mac) - QtiPlot - File openning error QtiPlot - Erreur lors de l'ouverture du fichier - You don't have the permission to open this file: <b>%1</b> Vous n'avez pas les droits pour ouvrir le fichier <b>%1</b> - Omit &thousands separator - Ingnorer le séparateur de milliers - - - - ImportDialog - - QtiPlot - ASCII Import Options - Qtiplot - Options pour l'importation de fichiers ASCII - - - Separator + Ignorer le sépara&teur de milliers + + + Import each file as + Importer comme + + + Separator Séparateur - Ignore first - Ignorer les premières - - - lines - lignes - - - Use first row to &name columns - Utiliser la première rangée pour nommer les colonnes - - - &Remove white spaces from line ends - Supprime&r les espaces de fin de lignes - - - &Simplify white spaces - &Simplifier les espaces - - - &Apply - &Appliquer - - - The column separator can be customized. The following special codes can be used: -\t for a TAB character -\s for a SPACE - Le séparateur de colonne peut être personnalisé. Les codes spéciaux suivant peuvent être utilisés : -\t pour une tabulation -\s pour une espace - - - The separator must not contain the following characters: 0-9eE.+- - Le séparateur ne doit pas contenir un des caractères suivant : 0-9eE.+- - - - Remove white spaces from line ends - Supprimer les espaces de fin de lignes - - - By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. - En validant cette option, toutes les espaces du fichier ASCII seront supprimées. - - - Simplify white spaces - Simplifier les espaces - - - By checking this option each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. - En validant cette option, toutes les espaces (y compris les tabulations) seront remplacées par une espace unique. - - - By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. - En validant cette option, toutes les espaces du fichier seront supprimées et les tabulations seront remplacées par une espace unique. - - - Warning: using these two last options leads to column overlaping if the columns in the ASCII file don't have the same number of rows. - Attention : Utiliser ces deux dernières options entrainera le recouvrement de colonnes si les colonnes du fichier ASCII n'ont pas le même nombre de rangées. - - - To avoid this problem you should precisely define the column separator using TAB and SPACE characters. - Pour éviter ce problème, vous devez définir les séparateurs de colonnes à TAB ou à SPACE. - - - QtiPlot - Help - QtiPlot - Aide - - - QtiPlot - Import options error - QtiPlot - Erreur d'importation des données - - - QtiPlot - QtiPlot - - - Do you want to save the modifications to the ASCII import options before closing? - Voulez-vous sauvegarder les modifications d'importations des fichiers ASCII ? - - - Yes - Oui - - - No - Non - - - - ImportFilesDialog - - QtiPlot - Import Multiple ASCII Files - QtiPlot - Importer plusieurs fichiers ASCII - - - New Table - Nouvelle table - - - New Columns - Nouvelles colonnes - - - New Rows - Nouvelles rangées - - - All files - Tous les fichiers - - - Text - Texte - - - Data - Données - - - Comma Separated Values - Valeurs séparées par une virgule - - - Import each file as - Importer chaque fichier comme + Import each file as: + Importer comme : + + + Separator: + Séparateur : + + + Separator: + Separator : IntDialog - QtiPlot - Integration Options Qtiplot - Options d'intégration - Integration of - Intégration de - - - Order (1 - 5, 1 = Trapezoid Rule) - Ordre (1 à 5, 1 = méthode des trapêzes) - - - Number of iterations (Max=40) - Nombre d'itérations (Max = 40) - - - Tolerance Tolérance - Lower limit Limite inférieure - Upper limit Limite supérieure - &Integrate &Intégrer - &Help - Aide - - - &Close - Fermer - - - QtiPlot - QtiPlot - - - Warning - Avertissement - - - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - La courbe <b> %1 </b> n'existe plus ! Opération annulée ! - - - QtiPlot - Tolerance value error - QtiPlot - Erreur sur la valeur de la tolérance - - - QtiPlot - Input error - Qtiplot - Erreur : entrée incorrecte - - - Please give a number larger or equal to the minimum value of X, for the lower limit. - If you do not know that value, type min in the box. - Donnez un nombre supérieur ou égal à la plus petite valeur de X pour la limite inférieure. -Si vous ne la connaissez pas, tapez 'min'. - - - Please give a number smaller or equal to the maximum value of X, for the lower limit. - If you do not know that value, type max in the box. - Donnez un nombre inférieur à la plus petite valeur de X pour la limite inférieure. -Si vous ne la connaissez pas, tapez 'max'. - - - QtiPlot - Start limit error - QtiPlot - Erreur de la limite de départ - - - Please give a number larger or equal to the minimum value of X, for the upper limit. - If you do not know that value, type min in the box. - Donnez un nombre supérieur ou égal à la plus petite valeur de X pour la limite supérieure. -Si vous ne la connaissez pas, tapez 'min'. - - - QtiPlot - End limit error - QtiPlot - Erreur de la limite d'arrêt - - - QtiPlot - Help for Integration - QtiPlot - Aide pour l'intégration - - - The integration of a curve consists of the following five steps: - 1) Choose which curve you want to integrate - 2) Set the order of the integration. The higher it is the more accurate the calculation is - 3) Choose the number of iterations - 4) Choose the tolerance - 5) Choose the lower and the upper limit. - The code integrates the curve with an iterative algorithm. The tolerance determines the termination criteria for the solver. - Because, sometimes we ask for too much accuracy, the number of iterations makes sure that the solver will not work for ever. - IMPORTANT -The limits must be within the range of x; If you do not know the maximum (minimum) value of x, type max (min) in the boxes. - L'intégration d'une courbe, consiste à suivre les cinq points suivants : -1) Choisir quelle courbe vous voulez intégrer -2) Fixer l'ordre d'intégration. Plus l'ordre est élevé, meilleure est la précision -3) Choisir le nombre d'itérations -4) Choisir la tolérance -5) Choisir les limites inférieure et supérieure. -Le code intégre la courbe avec un algorithme itératif. La tolérance est le critère de fin d'itération pour le solveur. -Parce que, quelque fois, nous demandons une trop grande précision, le nombre d'itérations assure au solveur de ne pas calculer à l'infini. -IMPORTANT -Les limites doivent être dans la gamme de x ; Si vous ne connaissez pas la valeur maximum (minimum) de x, tapez 'max' ('min') dans les zones d'édition. - - - + &Fermer + + Function Fonction - Variable - Order (1 - 5, 1 = Trapezoidal Rule) - ordre (1 - 5, 1 = règle du Trapezoïde) + Ordre (1 - 5, 1 = règle du Trapezoïde) - Number of iterations (Max=20) Nombre d'itérations (Max = 20) - Plot area - Graphe - - - &Plot area - Aire du graphique + Aire du &graphique Integration - - Integration Intégration - Plot - Graphe - - - - Numerical integration of Intégration numérique de - using a %1 order method en utilisant une méthode d'ordre %1 - Iterations Nombre d'itérations - Tolerance Tolérance - max - max - - - Points Points - from de - - to à - Peak at Pic à - Area Aire - QtiPlot - Error QtiPlot - Erreur - Unknown integration method. Valid values must be in the range: 1 (Trapezoidal Method) to 5. Méthode d'intégration inconnue. Les valeurs doivent être comprises entre 1 (Trapêze) et 5. - Plot Graphe - QtiPlot - Input error Qtiplot -Erreur d'entrée-sortie- - From De - using the Trapezoidal Rule utiliser les règles du trapèzoïde @@ -14390,78 +8792,46 @@ Interpolation - - QtiPlot QtiPlot - - Error Erreur - Unknown interpolation method. Valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. Méthode d'interpolation inconnue. Les valeurs sont : 0 - Linéaire, 1 - Cubique, 2 - Akima. - - - - Linear Linéaire - - - - - - Int Int - - - - - - Interpolation Interpolation - - - - Cubic Cubique - - - - Akima Akima - QtiPlot - Error QtiPlot - Erreur - Unknown interpolation method, valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. Méthode d'interpolation inconnue. Les valeurs sont : 0 - Linéaire, 1 - Cubique, 2 - Akima. - You need at least %1 points in order to perform this operation! Il faut au moins %1 points pour pouvoir faire cette opération ! @@ -14469,94 +8839,66 @@ InterpolationDialog - QtiPlot - Interpolation Options Qtiplot - Options pour l'interpolation - Make curve from Interpolation de - Spline Interpolation - Linear Linéaire - Cubic Cubique - Non-rounded Akima Akima non arrondie - Points Points - From Xmin De Xmin = - 0 - 0 - - - To Xmax à Xmax = - Color Couleur - &Make &Calculer - &Close - Fermer + &Fermer - QtiPlot - Warning QtiPlot - Avertissement - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! La courbe <b> %1 </b> n'existe plus ! Opération annulée ! - QtiPlot - Start limit error - QtiPlot - Erreur de la limite de départ - - - QtiPlot - End limit error - QtiPlot - Erreur de la limite d'arrêt - - - QtiPlot - Input error Qtiplot - Erreur : entrée incorrecte - Please enter x limits that satisfy: from < to! Donnez des limites en abscisses dans l'ordre croissant ! @@ -14564,420 +8906,336 @@ LayerButton - Activate layer - + Planche active LayerDialog - QtiPlot - Arrange Layers - QtiPlot - Redisposer les planches - - - Number of Layers - Nombre de planches - - - + QtiPlot - Redisposition des planches + + Automatic &layout - Redisposer les planches de manière automatique + Redisposition &automatique - Horizontal Horizontal - - Center Centré - Left Gauche - Right Droite - Vertical Vertical - Top Supérieur - Bottom Inférieur - Alignement - Alignement - - - Columns Colonnes - Rows Rangées - Grid Grille - &Layer Canvas Size - Tail&le du Canevas des planches + Tail&le du cadre - Width Épaisseur - - - - - - - - pixels pixels - Height Hauteur - Columns gap - Écart entre les colonnes + Entre colonnes - Rows gap - Écart entre les rangées + Entre rangées - Left margin Marge de gauche - Right margin Marge de droite - Top margin Marge supérieure - Bottom margin Marge inférieure - Spacing Espacement - Layout - Planche - - - Titles - Titres - - - Legends - Légendes - - - &Apply &Appliquer - &OK &OK - - &Cancel - Annuler + &Annuler - QtiPlot - Delete Layers? QtiPlot - Effacer les planches ? - You are about to delete %1 existing layers. Vous allez supprimer %1 planches existantes. - Are you sure you want to continue this operation? Êtes vous certain de vouloir continuer cette opération ? - &Continue &Continuer - QtiPlot - Columns input error Qtiplot - Erreur lors de l'entrée de la colonne - The number of columns you've entered is greater than the number of graphs (%1)! Le nombre de colonnes que vous avez donné est plus grand que le nombre de graphes (%1) ! - QtiPlot - Rows input error Qtiplot - Erreur lors de l'entrée de la rangée - The number of rows you've entered is greater than the number of graphs (%1)! Le nombre de rangées que vous avez donné est plus grand que le nombre de graphes (%1) ! - Layers Planches - Number Nombre - Alignment Alignement - + Unit + Unité + + + inch + pouce + + + mm + mm + + + cm + cm + + + point + point + + + pixel + pixel + + + &Keep aspect ratio + &Proportionnelle + + + Margins + Marges + + Swap Layers Échanger les planches - Source Layer - Planche source + Source - Destination Layer - Planche de destination + Destination - &Swap - Échanger + &Échanger - QtiPlot - Error QtiPlot - Erreur - Please enter different indexes for the source and destination layers! Veuillez donner des indices de source et de destination différents ! + + Link &X axes + Lier les axes &X + + + &Fixed size + Taille &fixe + + + Align + Aligné + + + Canvases + Cadres + + + Co&mmon axes + Axes co&mmuns + LineDialog - QtiPlot - Line options Qtiplot - Options de ligne - Color Couleur - Line type - Type de ligne - - - Line width - Épaisseur de ligne - - - 1 - 1 - - - 2 - 2 - - - 3 - 3 - - - 4 - 4 - - - 5 - 5 - - - Arrow at &start - Flêche au début + Flêche au &début - Arrow at &end Flêch&e à la fin - Opti&ons - Opti&ons - - - Length Longueur - Angle Angle - &Filled - Rempli + Rem&pli - Arrow &Head - Tête de la flêche + Tête de la flêc&he - Set &Default &Défaut - &Apply &Appliquer - &Ok &Ok - Page - + Page - Layer Scales - + Échelles des planches - Attach to - + Associer à - Scale Coordinates Coordonnées du graphe - Pixels Pixels - Unit Unité - Start Point Point de départ - - X X - To - à - - - End Point Point terminal - &Geometry &Géometrie - - Y Y - Type Type - Width Largeur - &Line &Ligne @@ -14985,43 +9243,38 @@ LineProfileTool - - QtiPlot - Pixel selection warning QtiPlot - Avertissement : sélection du pixel - Please select an image marker first. Veuillez d'abord sélectionner un marqueur sur l'image. - Please select the end line point inside the image rectangle! Veuillez sélectionner la ligne de fin à l'intérieur du rectangle image ! - pixel pixel - intensity intensité - - Table - Table - - - + x + x + + + y + y + + pixels pixels - pixel intensity (a.u.) Intensité (u.a) @@ -15029,22 +9282,18 @@ LinearFit - Linear Regression Regression linéaire - Linear Linéaire - QtiPlot - Fit Error QtiPlot - Erreur d'ajustement - You need at least %1 data points for this fit operation. Operation aborted! Il faut au moins %1 points pour réaliser cette opération ! Opération annulée ! @@ -15052,22 +9301,18 @@ LinearSlopeFit - Linear Regression Regression linéaire - LinearSlope Pente de la droite - QtiPlot - Fit Error QtiPlot - Erreur d'ajustement - You need at least %1 data points for this fit operation. Operation aborted! Il faut au moins %1 points pour réaliser cette opération ! Opération annulée ! @@ -15075,48 +9320,26 @@ LogisticFit - Logistic Logistique - (init value) - (valeur initiale) - - - (final value) - (valeur finale) - - - (center) - (centre) - - - (power) - (puissance) - - - Logistic Fit Ajustement logistique - init value Valeur de départ - final value Valeur finale - center Centre - power puissance @@ -15124,48 +9347,26 @@ LorentzFit - Lorentz Lorentz - (area) - (surface) - - - (center) - (centre) - - - (width) - (largeur) - - - (offset) - (décalage) - - - Lorentz Fit Ajustement Lorentzien - area aire - center Centre - width Largeur - offset Décalage en Y @@ -15173,225 +9374,135 @@ Matrix - QtiPlot - Input error - QtiPlot - Erreur lors de l'entrée des paramètres - - - Yes - Oui - - - Cancel - &Annuler - - - - - - - QtiPlot - Error QtiPlot - Erreur - Calculation failed, the matrix is not square! Le calcul a échoué car la matrice n'est pas carrée ! - Inversion failed, the matrix is not square! L'inversion a échouée car la matrice n'est pas carrée ! - The text in the clipboard is larger than your current selection! -Do you want to insert cells? - Le texte présent dans le presse-papier est plus grand que la sélection !(tab)(sp)(sp)(sp)(sp)(sp)(sp)(sp)(sp)(new line) -Voulez-vous insérer des cellules? - - - No - Non - - - - - - - - QtiPlot QtiPlot - Ctrl+A Matrix: select all Ctrl+A - Deleting rows/columns from the matrix! - set matrix dimensions - Suppression des lignes / colonnes de la matrice ! - - - <p>Do you really want to continue? - set matrix dimensions - <p>Voulez-vous vraiment continuer ? - - - - Please provide a valid file name! Veuillez donner un nom de fichier valide ! - File format not handled, operation aborted! Format de fichier non supporté, opération annulée ! - QtiPlot - ASCII Export Error QtiPlot - Erreur d'export ASCII Export - Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! Impossible d'enregistrer le fichier : <br><h4> %1 </h4><p>. Vérifiez que vous avez les droits requis pour écrire à cet emplacement ! - Invert Inverser - Transpose Transposer - Flip Vertically Retourner Verticalement - Flip Horizontally Retourner Horizontalement - Rotate 90° Tourner de 90° - - Calculate Values Calculer les valeurs - Clear Selection Réinitialiser la sélection - Paste Coller - Delete Rows Supprimer les lignes - Delete Columns Effacer les colonnes - Insert Row Insérer une ligne - Insert Column Insérer une colonne - - Import Image Importer une image - Forward FFT - Transformée de Fourrier Directe + Transformée de Fourier Directe - Inverse FFT - Transformée de Fourrier inversée + Transformée de Fourier inverse - Import ASCII File - Importer un fichier ASCII... - - - Error - Erreur - - - - - - - + Importer un fichier ASCII + + Memory Allocation Error Erreur d'allocaiton mémoire - - - - - Not enough memory, operation aborted! Pas assez de mémoire, operation annulée! - Rotate -90° Tourner de -90° - Due to memory limitations it will not be possible to undo this change. Do you want to continue anyways? Impossible de défaire ce changement, pas assez de mémoire. Voulez-vous continuez quand-même ? - Warning Avertissement - Set Dimensions Définir les dimensions - - Set Data Mode Définir le mode des données - kB kOctects @@ -15399,82 +9510,66 @@ MatrixDialog - Cell Width Largeur des cellules - Data Format Format des données - Numeric Display Nombre de décimales - QtiPlot - Matrix Properties Qtiplot - Propriétés de la matrice - &OK &OK - &Cancel - Annuler + &Annuler - &Apply &Appliquer - Decimal: 1000 Décimal : 1000 - Scientific: 1E3 Scientifique : 1E3 - Default Decimal Digits Par défaut - Significant Digits= Fixées à - Set Columns Width Définir la largeur des colonnes - Decimal décimal - Scientific Scientifique - Set Data Format %1 Définir le format des donnnées %1 - Precision %1 digits Précision %1 décimales @@ -15482,52 +9577,38 @@ MatrixModel - Edited cell Cellule édité - - - - QtiPlot - - Memory Allocation Error Erreur d'allocation mémoire - - Not enough memory, operation aborted! - Pas assez de mémoire, opération annulée + Pas assez de mémoire, opération annulée ! - Input Size Error Erreur sur la Taille d'entrée - The dimensions you have specified are not acceptable! - Les dimensions que vous avez spécifiées ne sont pas acceptables + Les dimensions que vous avez spécifiées ne sont pas tolorées ! - Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! - Veuillez entrer des valeurs positives telles que le produit lignes*colonnes ne dépasse pas l'entier maximum que votre système peut gérer + Veuillez entrer des valeurs positives telles que le produit lignes*colonnes ne dépasse pas l'entier maximum que votre système peut gérer ! - Warning Avertissement - Multiline expressions take much more time to evaluate! Do you want to continue anyways? Les expressions multilignes sont plus lentes à évaluer! Voulez-vous continuer quand même ? @@ -15535,71 +9616,54 @@ MatrixSizeDialog - Dimensions Dimensions - Coordinates Coordonnées - Rows Rangées - Columns Colonnes - X (Columns) X (Colonnes) - Y (Rows) Y (Rangées) - First - Premier + Première - Last - Dernier + Dernière - QtiPlot - Matrix Dimensions Qtiplot - Taille de la matrice - &OK &OK - &Cancel - Annuler - - - QtiPlot - Input error - Qtiplot - Erreur : entrée incorrecte - - - + &Annuler + + Set Coordinates x[%1 : %2], y[%3 : %4] Définir les coordonnées x[%1 : %2], y[%3 : %4] - &Apply &Appliquer @@ -15607,74 +9671,46 @@ MatrixValuesDialog - QtiPlot - Set Matrix Values Qtiplot - Fixer les valeurs de la matrice - For row (i) Pour la rangée (i) - - to à - For col (j) Pour la colonne (j) - Add function - Ajouter la fonction - - - Add Cell - Ajouter la cellule - - - Cell(i,j)= Cellule(i,j ) = - OK - OK - - - Apply - Appliquer - - - Add &Function Ajouter une &fonction - Add Ce&ll Ajouter une ce&llule - &Apply &Appliquer - &Close - Fermer + &Fermer - Set New Formula Définir une nouvelle formule - Use built-in muParser (much faster) Utiliser muParser interne (plus rapide) @@ -15682,56 +9718,42 @@ MdiSubWindow - QtiPlot - Do you want to hide or delete Voulez-vous Cacher ou Supprimer - Delete Supprimer - Hide Cacher - Cancel Annuler - Normal Normal - Minimized Minimum - Maximized Maximum - Hidden Caché - kB - kOctects - - - B B @@ -15739,268 +9761,173 @@ MultiLayer - QtiPlot - QtiPlot - - - QtiPlot - Guess best origin for the new layer? - QtiPlot - Est-ce que Qtiplot doit proposer la meilleure originie pour la nouvelle planche ? - - - Do you want QtiPlot to rearrange the remaining layers? Voulez-vous que Qtiplot redispose les autres planches ? - &Yes &Oui - &No &Non - &Cancel &Annuler - QtiPlot - Error: arranging layers failed! - Qtiplot - Erreur lors de la disposition des planches ! - - - There is not enaugh space available in this window.<p>You could try to maximize it first and to rearrange the layers using the automatic option!</p> - Il n'y a pas assez de place dans cette fenêtre.<p>Vous devriez agrandir la fenêtre puis redisposer les planches à l'aide de la commande automatique !</p> - - - Choose a filename to save under - Choisissez un nom pour sauvegarder ce fichier - - - QtiPlot - Overwrite File? - Qtiplot - Ecraser ce fichier? - - - A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? - Un fichier nommé: <p><b>%1</b><p>existe déjà. Voulez-vous écraser ce fichier? - - - QtiPlot - Export Error - Qtiplot - Erreur lors de l'exportation - - - enter your text here - Entrez votre texte ici - - - Add layer - + Ajouter une planche - Remove active layer - + Supprimer la planche active - QtiPlot - Guess best layout? QtiPlot - Arrangement automatique ? - - - QtiPlot - Error QtiPlot - Erreur - - Please provide a valid file name! Veuillez donner un nom de fichier valide ! - File format not handled, operation aborted! Format de fichier non supporté, opération annulée ! - kB kOctects - Offset Amount... - + Quantité du décalage... - Reverse Order - + Ordre inversé - Fill Area... - + Remplir l'aire... - Offset Dialog - + Boite "Décalage" - Total Y Offset (%) - + Décalage en Y total (%) - Total X Offset (%) - + Décalage en X total (%) - &Apply - &Appliquer + &Appliquer - - &Close - + &Fermer - Fill Curves - + Remplir les courbes - Enable Fill - + Remplissage autorisé - Fill with Color - + Remplir avec de la couleur - Side Lines - + Lignes de coté MultiPeakFit - MultiPeak - Multi-pics - - - Gauss Gauss - Lorentz Lorentz - multi-peak multi-pic - - - Peak Pic - QtiPlot - Fit Error QtiPlot - Erreur d'ajustement - Could not allocate enough memory for the fit curves! Allocation mémoire impossible pour l'ajustement des courbes ! - - - Fit Ajuster - fit of Ajustement de - - peak pic - Area Aire - Center Centre - Width Largeur - Height Hauteur - Gauss Fit Ajustement Gaussien - Lorentz Fit Ajustement Lorentzien - - area aire - - center centre - - width largeur - - offset Décalage en Y @@ -16008,109 +9935,49 @@ MultiPeakFitTool - Move cursor and click to select a point and double-click/press 'Enter' to set the position of a peak! Déplacer le curseur et cliquez poour sélectionner un point et double-qliquez (ou tapez 'Entrée') pour fixer la position d'un Pic ! - Peak %1 selected! Click to select a point and double-click/press 'Enter' to set the position of the next peak! Pic %1 sélectionné ! Cliquez pour sélectionner un point et double-cliquez (ou pressez 'Entrée') pour fixer la position du prochain pic ! - MyWidget - - QtiPlot - QtiPlot - - - Do you want to hide or delete - Voulez-vous Cacher ou Supprimer - - - Delete - Supprimer - - - Hide - Cacher - - - Cancel - Annuler - - - Normal - Normal - - - Hidden - Caché - - - Minimized - Minimum - - - Maximized - Maximum - - - kB - kOctects - - - NonLinearFit - NonLinear Non-linéaire - Non-linear - Non-linéaire - - - - QtiPlot - Input function error QtiPlot - Erreur de la fonction d'entrée - Please enter a valid non-empty expression! Operation aborted! Veuillez entrer une expression valide no ive ! Opération annulée ! - - QtiPlot - Fit Error QtiPlot - Erreur d'ajustement - There are no parameters specified for this fit operation. Please define a list of parameters first! Aucun paramètre spécifié pour cette opération d'ajustement. Veuillez d'abord, définir une liste de paramètres ! - You must provide a list containing at least 2 parameters for this type of fit. Operation aborted! - Vous devez fournir une liste contenant au moins 2 paramètres pour ce type d'ajustement. Opération annulée ! + Ignore + Ignorer - You must provide a list containing at least one parameter for this type of fit. Operation aborted! Vous devez fournir une liste contenant au moins 1 paramètre pour ce type d'ajustement. Opération annulée ! - Non-linear Fit Non-Ajustement non-linéaire - - constant Constante @@ -16118,85 +9985,78 @@ Note - Add tab - + Rémy : tab c'est bien table ? + AJouter une table - Please, enter new title: - + Veuillez donner un nouveau titre : - Title - Titre + TitreTitre - untitled - + Sans titre OpenProjectDialog - QtiPlot - Open Project QtiPlot - Ouvrir un projet - QtiPlot project Projet QtiPlot - Compressed QtiPlot project Projet QtiPlot compressé - Origin project Projet OriginLab - Origin matrix Matrice OriginLab - Origin worksheet Feuille OriginLab - Origin graph Graphe OriginLab - Backup files Fichiers archive - + Excel + Excel + + + ODF Spreadsheet + Fichier ODF (Calc) + + All files Tous les fichiers - Open As Ouvrir comme - New Project Window Nouvelle fenêtre de projet - New Folder Nouveau dossier @@ -16204,1985 +10064,1415 @@ PatternBox - Solid plein - Horizontal Hachures = - Vertical Hachures || - Cross Hachures # - BDiagonal Hachures // - FDiagonal Hachures \\ - DiagCross Hachures X - Dense1 Densité 1 - Dense2 Densité 2 - Dense3 Densité 3 - Dense4 Densité 4 - Dense5 Densité 5 - Dense6 Densité 6 - Dense7 Densité 7 - None - Aucun - - - - PieDialog - - QtiPlot - Pie Options - Qtiplot - Options pour les graphes à secteurs - - - &Apply - &Appliquer - - - &OK - &OK - - - Color - Couleur - - - Border - Bordure - - - First color - Première couleur - - - Pattern - Texture - - - Pie radius - Rayon du graphe à secteurs - - - Fill - Palette - - - Pie - Diagramme - - - Opacity - Opacité - - - Canvas Color - Couleur du cadre - - - Border Color - Couleur de la bordure - - - Margin - Marge - - - General - Général - - - - Plot - - Y Axis Title - Axe Y - - - X Axis Title - Axe X + Aucune Plot3DDialog - QtiPlot - Surface Plot Options Qtiplot - Options pour les graphes 3D - &Apply &Appliquer - &OK &OK - &Cancel - Annuler + &Annuler - - X X - - Y Y - - Z Z - From De - To à - Type Type - linear linéaire - logarithmic logarithmique - Major Ticks Graduations principales - Minor Ticks Graduations secondaires - &Scale - Echelle + &Échelle - Title Titre - Axis Font Police - &Choose font - Modifiez + &Modifiez - Major Ticks Length Longueur des graduations principales - Minor Ticks Length Longueur des graduations secondaires - &Axis &Axes - &Color - &Couleur - - - &Font &Police - &Title &Titre - Ma&x - Ma&x - - - &Min - &Min - - - Color Ma&p - Carte de couleurs - - - Data - Données - - - &Line &Ligne - &Background - Arrière plan + Arrière &plan - General Général - &Axes - &Axes - - - Lab&els Étiqu&ettes - &Numbers &Nombres - &Grid - &Grille - - - Coordinate System - Coordonnées système + Couleurs systèmes - Opacity Opacité - + Scale to paper si&ze + Ajuster à la taille du &papier + + + Print Crop&marks + I&mprimer les marges de coupe + + + &Print + Im&primer + + &Colors &Couleurs - Show Legend Afficher la légende - Orthogonal Orthogonal - - Line Width Épaisseur de ligne - Resolution Résolution - Numbers Font Police des nombres - &Choose Font - Modifiez + &Modifiez - Distance labels - axis Distance étiquettes - axes - Zoom (%) Zoom (%) - X Zoom (%) Zoom en X (%) - Y Zoom (%) Zoom en Y (%) - Z Zoom (%) Zoom en Z (%) - &General &Général - Ma&jor Grids - + Gri&lle principale - Mi&nor Grids - + Grille seco&ndaire - Color - Couleur + Couleur - - Style Style - - Solid - plein + Plein - - Dash - + Tiret - - - Dot Point - - Dash Dot - + Tiret point - - Dash Dot Dot - + Tiret point point - - Short Dash - + Tiret court - - Short Dot - + Point court - - Short Dash Dot - + Tiret point courts - G&rid - + G&rille - Cross Hair Lignes croisées - Cone Cône - - - - Width Épaisseur - Smooth angles Angles arrondis - Radius Rayon - Smooth line Affinée - Boxed Boites 3D - Quality Qualité - Points Points - Bars Barres - Colormap files - Fichiers de cartes de couleurs - - - QtiPlot - Start limit error - QtiPlot - Erreur de la limite de départ - - - QtiPlot - End limit error - QtiPlot - Erreur de la limite d'arrêt - - - QtiPlot - Input error - Qtiplot - Erreur : entrée incorrecte - - - Please enter scale limits that satisfy: from < to! - Donnez des limites d'échelle dans l'ordre croissant ! - - - &Worksheet - Feuille de calcul + &Feuille de calcul - &Matrix &Matrice - Co&lor Cou&leur - A&xes A&xes - Linea&r color map - Carte de couleurs linéaires + Ca&rte de couleurs linéaires - Color map &file - Fichiers de cartes de couleurs + &Fichiers de cartes de couleurs - - - None Aucun(e) - Draw lines Dessiner des lignes - Filled bars Barres remplies + + Tick Labels + Labels des étiquettes + + + Format + Format + + + Automatic + Automatique + + + Decimal: 10000.0 + Décimal : 10000.0 + + + Scientific: 1e4 + Scientifique: 1e4 + + + Engineering: 10k + Ingénieur : 10k + + + Precision + Précision + PlotDialog - QtiPlot - Custom curves - QtiPlot - Courbes définies par l'utilisateur - - - - - &Plot Associations... - Matrice de Graphes... + Matrice de &graphes... - Plot type Type de graphe - &Worksheet - Feuille de calcul + &Feuille de calcul - &Apply &Appliquer - &OK &OK - &Cancel - Annuler + &Annuler - Attach curve to: - Associer la courbe à : + Association : - x Axis Axe X - - Bottom Inférieur - - Top Supérieur - y Axis Axe Y - - - Left Gauche - - - Right Droite - - Axes Axes - Connect Style - No line Aucune ligne - Lines Lignes - Sticks Batons - Horizontal Steps Marches horizontales - Dots Points - Spline Interpolation - Vertical Steps Marches verticales - - - - - Style Style - - - - - Width Épaisseur - - - - - - Color Couleur - Fill area under curve Remplir l'aire sous la courbe - Fill color Couleur de remplissage - - - - - - Pattern Motif - - - - Line Ligne - - - Size Taille - &Speed Mode, Skip Points if needed - + Mode rapide, &sauter des données si nécessaire - data points - + Données - Apply to curves with more than: - - - - - Tolerance (Douglas Peuker algorithm) - - - - - - + Appliquer aux courbes de plus de : + + Speed - + Vitesse - - - Apply Format &to - + &Appliquer à - - - Selected Curve - + Courbe sélectionnée - - Fill Color Remplissage - - Edge Color - Couleur du symbole + Couleur - - Edge Width - Largeur du symbole + Largeur - - Skip Points - + Points à passer tous les - - None - + Aucun - - - - Symbol Symbole - - Box Boîte - - Type Type - No Box Aucune boîte - Rectangle Rectangle - Diamond Diamant - Perc 10, 25, 75, 90 10, 25, 75, 90 % - Notch Réjecteur - - Range Gamme - - - Standard Deviation - Ecart type + Écart type - - Standard Error Erreur type - Perc 25, 75 25, 75 % - Perc 10, 90 10, 90 % - Perc 5, 95 5, 95 % - Perc 1, 99 1, 99 % - - Max-Min Max - Min - - Constant Constante - - Percentile (%) Pourcentage (%) - Coefficient Coefficient - Box Width Largeur de boîte - Whiskers Whiskers - No Whiskers Sans Whiskers - 75-25 75 - 25 - 90-10 90 - 10 - 95-5 95 - 5 - 99-1 99 - 1 - Coef Coef - - Box/Whiskers Boîte / Whiskers - Max Max - 99% 99 % - - Mean Moyenne - 1% 1 % - Min Min - - Percentile Pourcentage - - Image Image - &Gray Scale Échelle de &gris - &Default Color Map Carte de couleurs par &défaut - &Custom Color Map &Carte de couleurs personnalisée - - Contour Lines Lignes du contour - Levels Niveaux - Use &Color Map Utiliser la &carte des couleurs - Use Default &Pen - Utiliser le crayon par défaut + Utiliser le crayon &par défaut - Color Bar Scale Échelle des barres de couleurs - Axis Axe - Contour Contour - Direction - Direction + Sens - Plus - Plus + Haut - Minus - Moins + Bas - &X Error Bar - Barres d'erreurs en abscisse + Barres d'erreurs en &X - - Line Width - Épaisseur de ligne - - - 1 - 1 - - - 2 - 2 - - - 3 - 3 - - - 4 - 4 - - - 5 - 5 - - - + Épaisseur + + Cap Width - Largeur ??? + Largeur du tiret - 8 8 - 10 10 - 12 12 - 16 16 - 20 20 - Through Symbol À travers le symbole - - - Error Bars Barres d'erreurs - Automatic Binning Échantillonage automatique - &Show statistics Afficher les &statistiques - Bin Size Période d'échantillonnage - Begin Début - End Fin - - Histogram Data Données de l'histogramme - Gap Between Bars (in %) Écart entre les barres (en %) - Offset (in %) Décalage (en %) - - Spacing Espacement - Arrowheads Têtes des flêches - Length Longueur - - Angle Angle - &Filled &Pleine - - End Point Point terminal - - X End Fin en X - - Y End Fin en Y - Position Position - Tail Queue - Middle Milieu - Head Tête - - Vector Vecteur - - - Bins Échantillons - - Histogram and Probabilities for Histogramme et probalités pour - Quantity Quantité - Sum Somme - Percent Pourcentage - Minimum Minimum - Maximum Maximum - &Delete - Supprimer - - - - - &Edit... - &Edition... - - - - + &Supprimer + + Colors Couleurs - + &Function + &Fonction + + Vertical Bars Barres verticales - Horizontal Bars Barres horizontales - Histogram Histogramme - Vector XYXY Vecteurs XYXY - Vector XYAM Vecteur XYAM - Scatter Nuage de points - Line + Symbol Lignes + Symboles - - - - QtiPlot - Input error Qtiplot - Erreur : entrée incorrecte - Please enter a valid start limit! Donnez une valeur de départ correcte ! - Please enter a valid end limit! Donnez une valeur d'arrêt correcte ! - Please enter a valid bin size value! Donnez une taille d'échantillonnage valide ! - QtiPlot - Start limit error QtiPlot - Erreur de la limite de départ - QtiPlot - End limit error QtiPlot - Erreur de la limite d'arrêt - Please enter limits that satisfy: begin < end! Veuillez entrer un domaine pour les abscisses tel que le début soit inférieur à la fin ! - - QtiPlot - Bin size input error QtiPlot - Erreur de taille des échantillons - Please enter a positive bin size value! Donnez une valeur positive de taille d'échantillons ! - Vector Data Vecteur Donnée - Magnitude Amplitude - QtiPlot - Plot details QtiPlot - Détails du graphe - Titles Titres - Axes Labels Étiquette des axes - Axes Numbers Étiquette des graduations - Legends Légendes - - Fonts Polices - Background Color Couleur d'arrière plan - - Opacity Opacité - - Transparent Transparent - Canvas Color Couleur du cadre - Border Color Couleur de la bordure - Margin Marge - Antialiasing Sans crenelage - Apply to all layers - Appliquer à toutes les planches - - - - - - - - - - - Layer Planche - Origin Origine - pixels - pixels - - - X= X = - Y= Y = - width= Largeur = - height= Hauteur = - Keep aspect ratio Proportionnel - - - Geometry Géometrie - Border Bordure - First color Première couleur - Pie radius - Rayon du graphe à secteurs - - - Fill Palette - Pie Diagramme - &Scale layers to paper size Redimensionner les planche&s à la taille du papier - Print Crop&marks - Imprimer les marges de coupe + I&mprimer les marges de coupe - - Print Imprimer - &Show - Montrer + &Montrer - Column Colonne - White O&ut - + C&ontour blanc - Justify - Justifier + Alignement - Center - centre + Centré - &Font - Police + &Police - Rotate (deg) Rotation (deg.) - X Offset (font height %) - Décalage en X (Hauteur de police %) + Décalage en X (% de hauteur de police) - Y Offset (font height %) - Décalage en Y (Hauteur de police %) + Décalage en Y (% de hauteur de police) - - - - - Labels Etiquettes - 3D View Vue en 3D - View Angle (deg) Angle de vue (deg) - Thickness (% of radius) Finesse (% of radius) - Rotation - Starting Azimuth (deg) Azimtuh de départ (deg) - Radius/Center Rayon/centre - Radius (% of frame) Rayon (% du cadre) - Horizontal Offset (% of frame) Décalage horizontal (% du cadre) - - Pie Geometry Géometrie du graphe à secteur - Automatic &Format - Format automatique + &Format automatique - &Values &Valeurs - &Percentages &Pourcentages - Categories/&Rows - Categories/Lignes + Catégories/&Rangées - Associate Position with &Wedge - Associe la position avec le coin + Associe la position avec le &coin - Dist. from Pie Edge Distance depuis le coin - Counter cloc&kwise - Dans le sens des aiguilles d'une montre + Dans le sens des &aiguilles d'une montre - inch pouce - mm - cm - point - pixel pixel - Unit Unité - Apply &to... - Appliqué à ... + Appliqué &à ... - - - - Window Fenêtre - - - - All Windows Toutes les fenêtres - Set As &Default - Par défaut + Par &défaut - Pen - Stylo + Stylo - Matrix - Matrice + Matrice - Use matrix formula to calculate values - + Utiliser la formule de la matrice pour calculer les valeurs - - Values - + Valeurs - &Show Contour Lines - + Montrer les ligne&s du contour - Set Equidistant Levels - + Niveaux équidistants - Start - + Début - Step - Intervalle + Intervalle - Set &Levels - + &Niveaux - Use &Table Custom Pen - + Utiliser la &table des stylos personnalisée + + + Link &X axes + Lier les axes &X + + + Miscellaneous + Divers + + + 0 (all data points) + 0 (tous les points) + + + Tolerance (Douglas-Peucker algorithm) + Tolérance (Algorithme de Douglas Peucker) + + + Apply to curves with more than + Appliquer aux courbes de plus de + + + Scale &Fonts + &Taille de la police + + + Do not &resize layers when window size changes + Ne pas &redimensionner les planches lorsque la taille de la fenêtre change + + + Dimensions + Dimensions PlotWizard - QtiPlot - Select Columns to Plot Qtiplot - Sélectionnez les colonnes à tracer - &X &X - x&Err x&Err - &Y &Y - yE&rr yE&rr - &Z &Z - &New curve &Nouvelle courbe - &Delete curve - Supprimer une courbe + &Supprimer une courbe - Worksheet Feuille de travail - &Plot - Courbe + Co&urbe - &Close - Fermer + &Fermer - - - - - - - - - - - - - - - - QtiPlot - Error QtiPlot - Erreur - Please define a Y column for the following curve Veuillez définir une colonne Y pour la courbe suivante - You have already defined a X column! Vous avez déjà défini une colonne en X ! - - - - You must define a X column first! Vous devez définir une colonne en X ! - You have already defined a Y column! Vous avez déjà défini une colonne en Y ! - - - This kind of curve is not handled by QtiPlot! Ce type de courbe n'est pas géré par Qtiplot ! - You have already defined a Z column! Vous avez déjà défini une colonne en Z ! - - You must define a Y column first! Vous devez définir une colonne en Y ! - - You have already defined an error-bars column! Vous avez déjà défini une colonne pour les barres d'erreur ! - You must add a new curve first! Vous devez d'abord définir une nouvelle courbe ! @@ -18190,41 +11480,26 @@ PluginFit - Plugin - Extension - - - QtiPlot - File not found QtiPlot - Fichier non trouvé - Plugin file: <p><b> %1 </b> <p>not found. Operation aborted! Le ficher d'extension : <p><b> %1 </b> <p> n'existe pas. Opération annulée ! - - - - QtiPlot - Plugin Error QtiPlot - Erreur de l'extension - The plugin does not implement a %1 method necessary for simplex fitting. L'extension ne comporte pas la méthode %1 nécessaire à l'ajustement simplex. - - - The plugin does not implement a %1 method necessary for Levenberg-Marquardt fitting. L'extension ne comporte pas la méthode %1 nécessaire à l'ajustement Levenberg-Marquardt. - Plugin Fit Extension d'ajustement @@ -18232,71 +11507,54 @@ PolynomFitDialog - QtiPlot - Polynomial Fit Options Qtiplot - Options pour l'ajustement polynomial - Polynomial Fit of Ajustement de - Order (1 - 9, 1 = linear) Ordre (1 - 9, 1 = linéaire) - Fit curve # pts Points - Not enough points Nombre de points insuffisants - Fit curve Xmin Xmin = - 0 - 0 - - - Fit curve Xmax Xmax = - Color Couleur - Show Formula on Graph? - Afficher la formule + Afficher la formule sur la courbe ? - &Fit &Calculer - &Close - Fermer + &Fermer - QtiPlot - Warning QtiPlot - Avertissement - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! La courbe <b> %1 </b> n'existe plus ! Opération annulée ! @@ -18304,630 +11562,613 @@ PolynomialFit - Poly - Poly - - - Polynomial Polynomial - QtiPlot - Fit Error QtiPlot - Erreur d'ajustement - You need at least %1 data points for this fit operation. Operation aborted! Il faut au moins %1 points pour réaliser cette opération ! Opération annulée ! - Polynomial Fit Ajustement + PreviewTable + + Numeric + Numérique + + + Text + Texte + + + Date + Date + + + Time + Temps + + + Month + Mois + + + Day + Jour + + + Choose column type + Choisir le type de données + + + Column type: + Format: + + + PythonScripting - Failed to export QtiPlot API Impossible d'exporter l'API de QtiPlot - Accessing QtiPlot functions or objects from Python code won't work. Probably your version of Qt/SIP/PyQt differs from the one QtiPlot was compiled against. Accéder via python aux fonctions ou objets de Qtiplot ne fonctionnera pas. Vos versions de Qt/SIP/PyQT sont sans doutes différents de ceux avec lesquels Qtiplot a été compilé. + + Couldn't find initialization files + Impossible de trouver les fichiers d'initialisations + + + Please indicate the correct path to the Python configuration files in the preferences dialog. + Veuillez indiquer le chemin correct vers les fichiers de configuration de Python dans les préférences. + QObject - The file is not an QtiPlot fit model file. - Le fichier n'est pas un modèle QtiPlot ! + Le fichier n'est pas un modèle QtiPlot. - The file is not an QtiPlot fit model version 1.0 file. - Le fichier n'est pas un modèle QtiPlot version 1.0 + Le fichier n'est pas un modèle QtiPlot version 1.0. - The file is not a QtiPlot custom action file. - Le fichier n'est pas une action personnalisée Qtiplot ! + Le fichier n'est pas un fichier d'action personnalisée Qtiplot. - The file is not an QtiPlot custom action version 1.0 file. - Le fichier n'est pas une action personnalisée Qtiplot 1.0 ! + Le fichier n'est pas un fichier d'action personnalisée Qtiplot 1.0. - The file is not a QtiPlot custom menu file. Ce fichier n'est pas un fichier de menu perosnnalisé pour QtiPlot. - The file is not a QtiPlot custom menu version 1.0 file. Ce fichier n'est pas un menu personnalisé version 1.0. - QtiPlot - Script Error - + QtiPlot - Erreur de script - Python-like syntax is not supported in this case since it severely reduces drawing speed! - - - - - QtiPlot - Math Error - - - - + La syntaxe à la python n'est pas supportée dans ce cas car elle réduit les performances ! + + QtiPlot - - - - - Ignored data point at x = %1. - - - - + QtiPlot + + Found non-removable singularity at x = %1. - + Singularité trouvé en x = %1. - abs(x): Absolute value of x. - + abs(x) : + Valeur absolue de x. - acos(x): Inverse cos function. - + acos(x) : + Fonction cosinus inverse. - acosh(x): Hyperbolic inverse cos function. - + acosh(x) : + Fonction cosinus hyperbolique inverse. - asin(x): Inverse sin function. - + asin(x) : + Fonction sinus inverse. - asinh(x): Hyperbolic inverse sin function. - + asinh(x) : + Fonction sinus hyperbolique inverse. - atan(x): Inverse tan function. - + atan(x) : + Fonction tangente inverse. - atanh(x): Hyperbolic inverse tan function. - + atanh(x) : + Fontion tangente hyperbolique inverse. - avg(x,y,...): Mean value of all arguments. - + avg(x,y,...) : + Valeur moyenne des arguments. - bessel_j0(x): Regular cylindrical Bessel function of zeroth order, J_0(x). - + bessel_j0(x) : + Fonction de bessel cylindrique à l'ordre zéro, J_0(x). - bessel_j1(x): Regular cylindrical Bessel function of first order, J_1(x). - + bessel_j1(x) : + Fonction de bessel cylindrique à l'ordre un, J_1(x). - bessel_jn(double x, int n): Regular cylindrical Bessel function of order n, J_n(x). - + bessel_jn(double x, int n) : + Fonction de bessel cylindrique à l'ordre n, J_n(x). - bessel_jn_zero(double n, unsigned int s): s-th positive zero x_s of regular cylindrical Bessel function of order n, J_n(x_s)=0 - + bessel_jn_zero(double n, unsigned int s) : +s-ème zéro positif x-s de la fonction de Bessel cylindrique régulaire d'ordre n, J_n(x_s) = 0 - bessel_y0(x): Irregular cylindrical Bessel function of zeroth order, Y_0(x), for x>0. - + bessel_y0(x) : + Fonction de bessel cylindrique irréguliaire à l'ordre zéro, Y_0(x). - bessel_y1(x): Irregular cylindrical Bessel function of first order, Y_1(x), for x>0. - + bessel_y1(x) : + Fonction de bessel cylindrique irréguliaire à l'ordre un, Y_1(x). - bessel_yn(double x, int n): Irregular cylindrical Bessel function of order n, Y_n(x), for x>0. - + bessel_yn(double x, int n) : + Fonction de bessel cylindrique irréguliaire à l'ordre n, Y_n(x), pour x>0. - beta(a,b): Computes the Beta Function, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) for a > 0, b > 0. - + beta(a,b) : + Calcule la fonction Beta(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) pour a > 0, b > 0. - ceil(x): Round to the next larger integer, smallest integer larger or equal to x. - + ceil(x) : + Arrondi à l'entier immédiatement supérieur, + Plus petit intier supérieur ou égal à x. - cos(x): Calculate cosine. - + cos(x) : + Fonction cosinus. - cosh(x): Hyperbolic cos function. - + cosh(x) : + Fonction cosinus hyperbolique. - erf(x): The error function. - + erf(x) : + Fonction erreur. - erfc(x): Complementary error function erfc(x) = 1 - erf(x). - + erfc(x) : + Fonction erreur complémentaire erfc(x) = 1 - erf(x). - erfz(x): The Gaussian probability density function Z(x). - + erfz(x) : + La fonction de densité de probabilité Gaussienne Z(x). - erfq(x): The upper tail of the Gaussian probability function Q(x). - + erfq(x) : +Partie supérieure de la fonction de probalité Gaussienne Q(x). - exp(x): Exponential function: e raised to the power of x. - + exp(x) : + Fonction exponentielle. - floor(x): Round to the next smaller integer, largest integer smaller or equal to x. - + floor(x) : + Arrondi au prochain plus petit entier, + Le plus grand entier supérieur ou égal à x. - gamma(x): Computes the Gamma function, subject to x not being a negative integer. - + gamma(x): + Calcule la fonction Gamma, x n'est pas un entier négatif. - gammaln(x): Computes the logarithm of the Gamma function, subject to x not a being negative integer. For x<0, log(|Gamma(x)|) is returned. - + gammaln(x) : + Calcule le logarithme de la fonction Gamme, x n'est pas un entier négatif. Pour x<0, log(|Gamma(x)|) est retourné. - gauss_cdf(x, sigma): Computes the cumulative distribution function for a Gaussian distribution with standard deviation sigma. - + gauss_cdf(x, sigma) : + Calcule la fonction de distribution cumulative pour une distribution Gaussienne avec un écart type sigma. - gauss_pdf(x, sigma): Computes the probability density at x for a Gaussian distribution with standard deviation sigma. - + gauss_pdf(x, sigma) : + Calcule la densité de probalité en x pour une distribution Gaussienne avec un écart type sigma. - hazard(x): Computes the hazard function for the normal distribution h(x) = erfz(x)/erfq(x). - + hazard(x) : + Calcule la fonction hazard pour la distribution normale h(x) = erfz(x)/erfq(x). - if(e1, e2, e3): if e1 then e2 else e3. - + if (e1, e2, e3) : +si e1 alors e2 sinon e3. - inv_gauss_cdf(x, sigma): Computes the inverse of the cumulative distribution function for a Gaussian distribution with standard deviation sigma. - + inv_gauss_cdf(x, sigma) : + Calcule la fonction inverse de la distribution cumulative pour une distribution Gaussienne avec un écart type sigma. - ln(x): Calculate natural logarithm log_e. - + ln(x) : + Calcule le logarithme naturel log_e. - log(x): Calculate decimal logarithm log_10. - + log10(x) : + Calcule le logarithme décimal log_10. - log10(x): Calculate decimal logarithm log_10. - + log10(x) : + Calcule le logarithme décimal log_10. - log2(x): Calculate binary logarithm log_2. - + log2(x) : + Calcule le logarithme binaire log_2. - min(x,y,...): Calculate minimum of all arguments. - + min(x,y,...) : + Retourne le minimum de tous les arguments. - max(x,y,...): Calculate maximum of all arguments. - + max(x,y,...) : + Retourne le maximum de tous les arguments. - mod(x,y): Calculate rest of integer division x/y, x modulo y. - + mod(x/y) : + Calcule le reste de la division entière x/y, + x modulo y. - pow(x,y): Raise x to the power of y, x^y. - + pow(x,y) : + Élève x à la puissance y, x^y. - rint(x): Round to nearest integer. - + rint(x) : + Arrondi à l'entier le plus proche. - sign(x): Sign function: -1 if x<0; 1 if x>0. - + sign(x) : + Fonction signe : -1 si x<0; 1 si x>0. - sin(x): Calculate sine. - + sin(x) : +Calcule le sinus de x. - sinh(x): Hyperbolic sin function. - + sinh(x) : + Calcule la fonction sinus hyberbolique de x. - sqrt(x): Square root function. - + sqrt(x) : + Fonction racine carrée. - sum(x,y,...): Calculate sum of all arguments. - + sum(x,y) : + Retourne la somme de tous les arguments. - tan(x): Calculate tangent function. - + tan(x) : + Calcule la tangente de x. - tanh(x): Hyperbolic tan function. - + tanh(x) : + Calcule la tangente hyperbolique de x. - ttable(x, n): Student's t-distribution with n degrees of freedom. - + ttable(x, n) : Loi de Student avec n degrées de liberté. - w0(x): Compute the principal branch of Lambert's W function, W_0(x). W is defined as a solution to the equation W(x)*exp(W(x))=x. For x<0, there are two real-valued branches; this function computes the one where W>-1 for x<0 (also see wm1(x)). - + w0(x) : + Calcule la branche principale du Lambertien W_0(x). + W est défini comme étant la solution de l'équation W(x)*exp(W(x)) = x. + Pour x<0, il n'y a que deux branches de réels ; cette fonction calcule celle pour W>-1 avec x<0 (voir aussi wm1(x)). - wm1(x): Compute the secondary branch of Lambert's W function, W_{-1}(x). W is defined as a solution to the equation W(x)*exp(W(x))=x. For x<0, there are two real-valued branches; this function computes the one where W<-1 for x<0. (also see w0(x)). - + wm1(x) : + Calcule la branche secondaire du Lambertien W_{-1}(x). + W est défini comme étant la solution de l'équation W(x)*exp(W(x)) = x. + Pour x<0, il n'y a que deux branches de réels ; cette fonction calcule celle pour W<-1 avec x<0 (voir aussi w0(x)). + + + AVG("colName", i, j): + The average of all cells from row i to j in column colName. + AVG("colName",i,j) : + La moyenne de toutes les celulles de la colonne colName pour les rangées de i à j. + + + SUM("colName", i, j): + The sum of all cells from row i to j in column colName. + SUM("colName",i,j) : + La somme de toutes les celulles de la colonne colName pour les rangées de i à j. + + + QtiPlot - Memory Allocation Error + Qtiplot - Erreur d'Allocation mémoire + + + Not enough memory, operation aborted! + Pas assez de mémoire, opération annulée ! + + + The function %1 is not defined in the specified interval! + La fonction %1 n'est pas définie dans l'intervalle spécifié ! + + + rnd(seed): + Returns a pseudo-random number in the range 0 to 1. Calling this function several times with the same seed will return the same value. + rnd(arg) : + Retourne un nombre pseudo aléatoire compris entre 0 et 1. L'appel de cette fonction à plusieurs reprises et avec le même argument, retournera la même valeur. QtColorPicker - - - Black - + Noir - - White - + Blanc - - Red - + Rouge - - Dark red - + Rouge foncé - - Green - + Vert - - Dark green - + Vert foncé - - Blue - + Bleu - - Dark blue - + Bleu foncé - - Cyan - + Cyan - - Dark cyan - + Cyan foncé - - Magenta - + Magenta - - Dark magenta - + Magenta foncé - - Yellow - + Jaune - - Dark yellow - + Jaune foncé - - Gray - + Gris - - Dark gray - + Gris foncé - - Light gray - + Gris clair - Custom - + Personnalisé RangeSelectorTool - - - - - - QtiPlot - Warning QtiPlot - Avertissement - All the curves on this plot are empty! Toutes les courbes de ce graphe sont vides ! - Click or use Ctrl+arrow key to select range (arrows select active cursor)! Cliquez ou utilisez Ctr+Flêche pour sélectionner la gamme (??) ! - - - Right Droite - - - Left Gauche - - - - - The column '%1' is read-only! Operation aborted! - La colonne '%1' est en lecture-seule ! Opération annulée + La colonne '%1' est en lecture-seule ! Opération annulée ! - Remove data from curves? - + Supprimer les données des courbes ? - Copy data to clipboard? - + Copier les données vers le presse papier ? RenameWindowDialog - Window Title Titre de la fenêtre - &Name (single word) &Nom (un seul mot) - &Label &Etiquette - &Both Name and Label - Nom et étiquette + &Nom et étiquette - QtiPlot - Rename Window Qtiplot - Renommer la Fenêtre - &OK &OK - &Cancel - Annuler + &Annuler - QtiPlot - Warning QtiPlot - Avertissement - For internal consistency reasons the underscore character is replaced with a minus sign. Pour des raisons d'uniformité, le trait souligné (_) est remplacé par le signe moins (-). @@ -18935,7 +12176,6 @@ ScreenPickerTool - Click on plot or move cursor to display coordinates! Cliquez sur le graphe ou déplacez le curseur pour afficher les coordonnées ! @@ -18943,511 +12183,339 @@ ScriptEdit - Auto&exec Auto&execution - &Functions &Fonctions - - Text Texte - Python Source - Source Python - - - - All Files Tous les fichiers - QtiPlot - Import Text From File QtiPlot - Importer du texte à partir d'un fichier - QtiPlot - Error Opening File QtiPlot - Erreur lors de l'ouverture du fichier - Could not open file "%1" for reading. Imposssible d'ouvrir le fichier "%1" en lecture. - Save Text to File Sauvegarde du texte en fichier - QtiPlot -- Overwrite File? - QtiPlot -- Ecraser le fichier? - - - A file called: <p><b>%1</b><p>already exists. -Do you want to overwrite it? - Un fichier nommé : <p><b>%1</b><p>existe déjà. Voulez-vous l'écraser ? - - - &Yes - &Oui - - - &No - &Non - - - QtiPlot - File Save Error QtiPlot - Erreur lors de la sauvegarde du fichier - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Impossible d'enregistrer le fichier <br><h4> %1 </h4><p>. Vérifiez que vous avez les droits requis pour écrire à cet emplacement ! - E&xecute E&xécuter - Ctrl+J Ctrl+J - Execute &All - Tout exécuter + &Tout exécuter - Ctrl+Shift+J Ctrl+Shift+J - &Evaluate Expression Évalu&er l'expression - Ctrl+Return Ctrl+Entrée - &Print Im&primer - &Import - &Importer - - - &Export - &Exporter - - - &Import... - &Importer + &Importer... - &Save &Sauvegarder - Sa&ve as... Sau&vegarder sous... - &Find... - Chercher... + &Chercher... - &Replace... - &Remplacer + &Remplacer... - &Find next - Suivant... + &Suivant - &Find previous - Précédent... + &Précédent - Rena&me Tab... - + Reno&mmer la table... - A&dd Tab - + &Ajouter une table - C&lose Tab - + Fermer la tab&le - QtiPlot Qtiplot - QtiPlot has finished searching the document. - Qtiplot a terminé de chercher le document + Qtiplot a terminé la recherche. ScriptWindow - QtiPlot - Python Script Window - QtiPlot - Fenêtre d'édition de script - - - - &File &Fichier - - &Edit - &Edition + &Édition - - - - E&xecute E&xécuter - &Hide - &Cacher - - - - Ctrl+N Ctrl+N - - Ctrl+O Ctrl+O - - Ctrl+S Ctrl+S - - Ctrl+P Ctrl+P - - Ctrl+Z Ctrl+Z - - Ctrl+Y Ctrl+Y - - Ctrl+x Ctrl+x - - Ctrl+C Ctrl+C - - Ctrl+V Ctrl+V - Del - Suppr - - - - CTRL+J Ctrl+J - - CTRL+SHIFT+J Ctrl+Shift+J - - CTRL+Return Ctrl+Entrée - QtiPlot - File Save Error QtiPlot - Erreur lors de la sauvegarde du fichier - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Impossible d'écrire le fichier <br><h4> %1 </h4><p>. Vérifiez que vous avez les droits requis pour écrire à cet emplacement ! - - &New &Nouveau - - &Open... &Ouvrir... - - &Save &Sauvegarder - - Save &As... Sauveg&arder sous... - - &Print Im&primer - - &Undo Ann&uler - - &Redo &Refaire - - &Cut &Couper - - &Copy &Copier - - &Paste - Coller - - - &Delete - &Supprimer - - - - + &Coller + + Execute &All - Tout exécuter + &Tout exécuter - - &Evaluate Expression - Evaluer l'expression + &Évaluer l'expression - - QtiPlot - Script Window QtiPlot - Fenêtre de script - &Window - Fenêtre + &Fenêtre - - Increase Indent - + Incrémenter - - Decrease Indent - + Décrémenter - - &Find... - Chercher... + &Chercher... - - Ctrl+Alt+F - Ctrl+Alt+F + Ctrl+Alt+F - - Find &Next - + Suiva&nt - - F3 - F3 + F3 - - Find &Previous - + &Précédent - - F4 - + F4 - - &Replace... - &Remplacer + &Remplacer... - Always on &Top &Toujours au dessus - You need to close and reopen the script window before your changes become effective! Do you want to close it now? Vous devez fermer et réouvrir la fenêtre de script pour que les changements deviennent effectifs. Voulez-vous fermer maintenant ? - - QtiPlot QtiPlot - Show &Line Numbers Montrer les &Numéros des lignes - - Script Output Panel - + Rémy : Bof ! + Sortie du script - - Show Script &Output Panel - + Rémy : Bof ! + M&ontrer le panneau des scripts - - Ouput on Next &Line - + Rémy : Atention, faute à Output + Sortie sur la &ligne suivante - Show Script Output Panel - + Montret le panneau des script - - Print Pre&view... - + Pré&visualisation... - Script print preview - + Aperçu avant impression du script - - &Close - + &Fermer - - Show &Workspace - + &Montrer l'espace de travail ScriptingEnv - %1 Source (*.%2);; %1 source (*.%2);; @@ -19455,27 +12523,22 @@ ScriptingLangDialog - QtiPlot - Select scripting language QtiPlot - Choix du langage de script - OK OK - Cancel Annuler - QtiPlot - Scripting Error QtiPlot - Erreur de Script - Scripting language "%1" failed to initialize. L'initialisation du langage de script "%1" a échouée. @@ -19483,109 +12546,69 @@ SetColValuesDialog - QtiPlot - Set column values Qtiplot - Propriétés de la colonne - For row (i) Pour la rangée (i) - to à - Add function Ajouter une fonction - Add column Ajouter une colonne - Add cell Ajouter une cellule - &OK - &OK - - - &Apply &Appliquer - &Close - Fermer + &Fermer - Use built-in muParser (much faster) Utiliser le muParser interne (plus rapide) - Clear &Formulas - + Effacer les &formules SigmoidalFit - (init value) - (valeur initiale) - - - (final value) - (valeur finale) - - - (center) - (centre) - - - (time constant) - (constante de temps) - - - Boltzmann (Sigmoidal) - Boltzmann (Sigmoïdal) - - - Boltzmann (Sigmoidal) Fit Ajustement de Boltzmann (Sigmoïdal) - Boltzmann - init value Valeur de départ - final value Valeur finale - center Centre - time constant constante de temps @@ -19593,503 +12616,420 @@ SmoothCurveDialog - QtiPlot - Smoothing Options QtiPlot - Options de lissage - Curve Courbe - Polynomial Order Ordre - Points to the Left Points à gauche - Points to the Right Points à droite - - - Color Couleur - f - + f - Iterations - Nombre d'itérations + Nombre d'itérations - Points Points - &Smooth Li&sser - &Close - Fermer + &Fermer SmoothFilter - Smoothed Lissée - - - - - - - - QtiPlot QtiPlot - - - - - - - - Error Erreur - Unknown smooth filter. Valid values are: 1 - Savitky-Golay, 2 - FFT, 3 - Moving Window Average. - Type de lissage inconnu. Les choix sont : 1 - Savitsky-Golay, 2 - FFT, 3 - Moyenne glissante. - - - Unknown smooth filter. Valid values are: 1 - Savitky-Golay, 2 - FFT, 3 - Moving Window Average, 4 - Lowess. - + Filtre de lissage inconnu. Les valeurs correctes sont : 1 - Savitsky-Golay, 2 - FFT, 3 - Moyenne glissante, 4 - Lowess. - - - - points points - Savitzky-Golay smoothing Lissage Savitzky-Golay - FFT smoothing Lissage par FFT - average smoothing moyenne lissée - - Lowess smoothing - + Lowess smoothing with f=%1 and %2 iterations + Lissage de type Lowess avec f = %1 et %2 itérations - The number of points must be positive! Le nombre de points doit être positif ! - - The polynomial order must be lower than the number of left points plus the number of right points! L'ordre doit être plus petit que le nombre de points à gauche additionné au nombre de points à droite ! - Setting polynomial order is only available for Savitzky-Golay smooth filters! Ignored option! L'ordre du filtre n'est modifiable que pour le filtrage Savitsky-Golay ! Option ignorée ! - Setting Lowess parameter is only available for Lowess smooth filters! Ignored option! - + Les paramètres Lowess ne sont accéssibles que pour les filtres de lissage Lowess ! Option ignorée ! - The parameter f must be between 0 and 1! - + Le paramètre f doit être compris entre 0 et 1 ! - The number of iterations must be at least 1! - + Le nombre d'itérations doit être au moins de 1 ! SortDialog - QtiPlot - Sorting Options Qtiplot - Options de Tri - Sort columns Trier les Colonnes - Order Ordre - Leading column - Colonne triée + Colonne à trier - &Sort &Trier - &Close - Fermer + &Fermer - Separately Séparement - Together Ensemble - Ascending Croissant - Descending Décroissant + SubtractDataDialog + + QtiPlot + QtiPlot + + + Math on Data Sets + Opération sur données + + + Cu&rve + Cou&rbe + + + &Operator + &Opérateur + + + &Data set + Jeu de &données + + + Current &folder + Dossier a&ctuel + + + &Value + &Valeur + + + &Apply + &Appliquer + + + &Close + &Fermer + + + Error + Erreur + + + Data set %1 must containt at least two valid data points in order to perform this operation! + Le jeu de donnée %1 doit contenir au minimum 2 données valides pour ce type d'opération ! + + + + SubtractLineTool + + Move cursor and click to select and double-click/press 'Enter' to set the position of the first point! + Déplacer le curseur et cliquez pour sélectionner un point et double-cliquez (ou tapez 'Entrée') pour fixer la position du premier point ! + + + First point selected! Click to select and double-click/press 'Enter' to set the position of the 2nd point! + Premier point sélectionné ! Cliquez pour sélectionner un point et double-cliquez (ou pressez 'Entrée') pour fixer la position du deuxième pic ! + + + SurfaceDialog - QtiPlot - Define surface plot Qtiplot - Définition d'un graphe de surface - f(x,y)= f(x,y) = - X - axis Axe des X - -1 - -1 - - - 1 - 1 - - - - - - - From De - - - - - To à - Y - axis Axe des Y - Z - axis Axe des Z - - Clear &list - Éffacer la &liste - - - &OK &OK - &Close - Fermer - - - QtiPlot - X Start limit error - Qtiplot - Valeur de X initial erronée - - - QtiPlot - X End limit error - Qtiplot - Valeur de X final erronée - - - QtiPlot - Y Start limit error - Qtiplot - Valeur de Y initial erronée - - - QtiPlot - Y End limit error - Qtiplot - Valeur de Y final erronée - - - QtiPlot - Z Start limit error - Qtiplot - Valeur de Z initial erronée - - - QtiPlot - Z End limit error - Qtiplot - Valeur de Z final erronée - - - + &Fermer + + QtiPlot - Input error Qtiplot - Erreur : entrée incorrecte - Please enter limits that satisfy: from < end! Veuillez entrer un domaine d'abscisses tel que le début soit inférieur à la fin ! - QtiPlot - Input function error QtiPlot - Erreur de la fonction d'entrée - Surface type Type de surface - Function Fonction - Parametric Paramétrique - - + Clea&r + Efface&r + + + Rece&nt + Réce&nt + + + Click here to select a recently typed expression + Cliquez ici pour sélectionner une expression récente + + Mesh - - Columns Colonnes - - Rows Rangées - Equations - X(u,v)= - Y(u,v)= - Z(u,v)= - u - - Periodic Périodique - v - QtiPlot - X Formula Error QtiPlot - Erreur de formule sur X - QtiPlot - Y Formula Error QtiPlot - Erreur de formule sur Y - QtiPlot - Z Formula Error QtiPlot - Z Formula Error - - QtiPlot - u start limit error - Qtiplot - u limite de départ : erreur - - - - - QtiPlot - u end limit error - Qtiplot - u limite de fin : erreur - - - - QtiPlot - v start limit error - Qtiplot - v limite de départ : erreur + QtiPlot + QtiPlot + + + Sorry, there are no recent expressions available! + Désolé, il n'y a pas d'expressions récentes ! + + + Recent Functions + Fonctions récentes + + + Please, choose a function: + Veuillez choisir une fonction : SymbolBox - No Symbol Aucun - Ellipse Ellipse - Rectangle Rectangle - Diamond Diamant - Triangle Triangle 1 - Down Triangle Triangle 2 - Up Triangle Triangle 3 - Left Triangle Triangle 4 - Right Triangle Triangle 5 - Cross Croix 1 - Diagonal Cross Croix 2 - Horizontal Line Ligne horizontale - Vertical Line Ligne verticale - Star 1 Etoile 1 - Star 2 Etoile 2 - Hexagon Hexagone @@ -20097,12 +13037,10 @@ SymbolDialog - &Close - Fermer + &Fermer - QtiPlot - Choose Symbol QtiPlot - Choisir le Symbole @@ -20110,278 +13048,106 @@ Table - - - - - - - - - - - - - - - QtiPlot - Error Qtiplot - Erreur - Choose a filename to save under - Choisissez un nom pour sauvegarder ce fichier - - - QtiPlot - Overwrite File? - Qtiplot - Ecraser ce fichier? - - - A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? - Un fichier nommé: <p><b>%1</b><p>existe déjà. Voulez-vous l'écraser? - - - &Yes - &Oui - - - &No - &Non - - - QtiPlot - ASCII Export Error Qtiplot - Erreur lors de l'exportation en ASCII - - - - QtiPlot Qtiplot - Please select two columns for this operation! - Sélectionnez 2 colonnes pour cette opération ! - - - Could not allocate memory, operation aborted! - Allocation mémoire impossible, Opération annulée ! - - - Error in GSL forward FFT operation! - Erreur de la librarie GSL sur la FFT ! - - - Please select two columns for this operation: - the first represents the signal and the second the response function! - Sélectionnez 2 colonnes pour cette opération : -La première représente le signal et la seconde la réponse de la fonction ! - - - The response dataset '%1' must be less then half the size of the signal dataset '%2'! - Les données de la réponse '%1' doivent être de moitié inférieure à la taille des données du signal '%2' ! - - - The response dataset '%1' must contain an odd number of points! - Les données de la réponse '%1' doivent contenir un nombre de points impaires ! - - - Frequency - Fréquence - - - Time - Temps - - - Real - Réel - - - Imaginary - Imaginaire - - - Amplitude - Amplitude - - - Angle - Angle - - - - Yes Oui - No - Non - - - - Cancel Annuler - Please select a Y column to plot! - Sélectionnez une colonne Y à tracer ! - - - Please set a default X column for this table, first! - Sélectionnez d'abord une colonne X par défaut pour cette table ! - - - Please select four columns for this operation! - Sélectionnez quatre colonnes pour cette opération ! - - - You need at least two columns for this operation! - Vous avez besoin d'au moins deux colonnes pour cette opération ! - - - Please select a Z column for this operation! - Sélectionnez une colonne Z pour cette opération ! - - - You need to define a X column first! - Vous devez d'abord définir une colonne X ! - - - You need to define a Y column first! - Vous devez d'abord définir une colonne Y ! - - - Rows will be deleted from the table! Les rangées seront effacées de cette table ! - - Do you really want to continue? Voulez-vous vraiment continuer ? - Columns will be deleted from the table! Les colonnes seront effacées de la table ! - Qtiplot - Reading file... - Qtiplot - Lecture du fichier... - - - There is already a column called : <b> Il existe déjà une colonne nommée : <b> - Please indicate the name of the leading column! Veuillez indiquer le nom de la première colonne ! - The leading column has the type set to 'Text'! Operation aborted! - La première colonne n'a pas le type 'Texte' ! Opération annulée ! - - - The leading column is empty! Operation aborted! La première colonne est vide ! opération annulée ! - Could not write to file: <br><h4> Impossible d'écrire dans le fichier : <br><h4> - - - Column '%1' is read only! - La colonne %1 est en lecture seule + La colonne %1 est en lecture seule ! - The table '%1' contains read-only columns! Operation aborted! - Le tableau '%1' contient des colonnes en lecture-seule ! Opération annulée + La table '%1' contient des colonnes en lecture-seule ! Opération annulée ! - - - - - - - - The folowing columns Les colonnes suivantes - - - - - - - - are read only! - sont en lecture seule + sont en lecture seule ! - Paste operation - + Coller - How should QtiPlot interpret first clipboard line? - + Comment QtiPlot doit-il interpréter la première ligne du presse papier ? - &Values - &Valeurs + &Valeurs - Column &Names - + &Noms des colonnes - &Comments - + &Commentaires - Qtiplot Qtiplot - Reading file... - Lecture du fichier + Lecture du fichier... - kB kOctects - Warning Avertissement - Multiline expressions take much more time to evaluate! Do you want to continue anyways? Les expressions multilignes sont plus lentes à évaluer! Voulez-vous continuer quand même ? @@ -20389,444 +13155,369 @@ TableDialog - QtiPlot - Column options QtiPlot - Options de colonne - - Column Name: - Nom de colonne : - - - Enumerate all to the right Énumérer les colonnes à partir de la droite - &OK &OK - &Apply &Appliquer - &Cancel - Annuler - - - - Plot Designation: - Nom du graphe : - - - + &Annuler + + None Aucun - X (abscissae) X (abscisse) - Y (ordinates) Y (ordonnée) - Z (height) Z (hauteur) - X Error Erreur en X - Y Error Erreur en Y - Display Affichage - Numeric Numérique - Text Texte - Date Date - Time Heure - Month Mois - Day of Week Jour de la semaine - - Format: - Format : - - - - Precision: - Précision : - - - Apply to all columns to the right Appliquer à toutes les colonnes vers la droite - Options Options - - Column Width: - largeur de colonne : - - - Apply to all - Appliquer à toutes - - - - Comment: - Commentaire : - - - + Pour toutes + + QtiPlot - Warning - QtiPlot - Avertissement + QtiPlot - Attention - For internal consistency reasons the underscore character is replaced with a minus sign. Pour des raisons d'uniformité, le trait souligné (_) est remplacé par le signe moins (-). - - QtiPlot - Error QtiPlot - Erreur - - The column names must only contain letters and digits! - Les noms de colonnes doivent seulement contenir des lettres et des chiffres ! - - - Default Par défaut - Decimal: 1000 Décimal : 1000 - Scientific: 1E3 Scientifique : 1E3 - yyyy-MM-dd aaaa-MM-jj - h h - h ap h ap - h AP h AP - h:mm h:mm - h:mm ap h:mm ap - hh:mm hh:mm - h:mm:ss h:mm:ss - h:mm:ss.zzz - h:mm:ss.mmm + h:mm:ss.zzz - mm:ss mm:ss - mm:ss.zzz - mm:ss.mmm + mm:ss.zzz - hmm hmm - hmmss hmmss - hhmmss hhmmss - &Display Comments in Header Afficher les commentaires &dans l'en-tête - dd/MM/yyyy jj/MM/aaaa - dd.MM.yyyy jj.MM.aaaa - dd MM yyyy jj MM aaaa - yyyyMMdd aaaaMMjj - Couldn't guess the source data format, please specify it using the 'Format' box! - Ne peut détecter le format de données de la source, veuillez le spécifiez en utilisant la boîte 'Format' ! + Ne peut détecter le format de données de la source, veuillez le spécifier en utilisant la boîte 'Format' ! - For more information about the supported date/time formats please read the Qt documentation for the QDateTime class! Pour plus d'informations des formats date/heure supportés lisez la documentation de Qt (classe QDateTime) ! - &Read-only - Lectu&Re Seule + Lectu&re seule - Label Étiquette - &Hidden - Cac&Hé + Cac&hé - dd/MM/yyyy HH:mm - + jj/MM/aaaa HH:mm - dd/MM/yyyy HH:mm:ss - + jj/MM/aaaa HH:mm:ss - dd.MM.yyyy HH:mm - + j.M.aaaa HH:mm - dd.MM.yyyy HH:mm:ss - + jj.MM.aaaa HH:mm:ss - dd MM yyyy HH:mm - + jj MM aaaa HH:mm - dd MM yyyy HH:mm:ss - + jj MM aaaa HH:mm:ss - yyyy-MM-dd HH:mm - + aaaa-MM-jj HH:mm - yyyy-MM-dd HH:mm:ss - + aaaa-MM-jj HH:mm:ss - yyyyMMdd HH:mm - + aaaaMMjj HH:mm - yyyyMMdd HH:mm:ss - + aaaaMMjj HH:mm:ss + + + Column Name + Nom de la colonne + + + Plot Designation + Type de graphe + + + Format + Format + + + Precision + Précision + + + Column Width + Largeur + + + Comment + Commentaire + + + Plot Designation: + Type de graphe : + + + Format: + Format : + + + Precision: + Précision : + + + Column Width: + Largeur : + + + Comment: + Commentaire : + + + Column Name: + Nom : TableStatistics - Row Statistics of %1 Statistiques de la rangée de %1 - Row Rangée - Cols Colonnes - - Mean Moyenne - - Variance Variance - - Sum Somme - - Max Max - - Min Min - Column Statistics of %1 Statistiques de la colonne de %1 - Col Colonne - Rows Rangées - iMax iMax - iMin iMin - RowStats Stats Rangée - - StandardDev - Ecart-type + Écart-type - ColStats Stats colonne - - StandardError Erreur type - - Median Médiane @@ -20834,236 +13525,101 @@ TextDialog - QtiPlot - Text options QtiPlot - Options du Texte - Color - Couleur - - - &OK - &OK - - - Font Police - &Font - Police - - - &Apply - &Appliquer - - - Alignement - Alignement - - - + &Police + + Center Centré - Left Gauche - Right Droite - Frame - Cadre - - - None - Aucun - - - Rectangle - Rectangle - - - Shadow - Ombré - - - &Cancel - Annuler - - - Background - Arrière Plan - - - Rotate (deg.) - Rotation (deg.) - - - 0 - 0 - - - 45 - 45 - - - 90 - 90 - - - 135 - 135 - - - 180 - 180 - - - 225 - 225 - - - 270 - 270 - - - 315 - 315 - - - B - B - - - It - It - - - U - U - - - Set &Default - &Défault - - - Text Color Couleur du texte - Alignment Alignement - Opacity - Opacité - - - Transparent - Transparent - - - Background color - Couleur d'arrière plan - - - Set As &Default - Par défaut - - - - - - QtiPlot - X Axis Title Titre de l'axe X - Y Axis Title Titre de l'axe Y - Top Axis Title Titre de l'axe supérieur - Right Axis Title Titre de l'axe de droite - &Apply to... - &Appliquer à + &Appliquer à... - Object Objet - Layer Planche - Window Fenêtre - All Windows Toutes les fenêtres - &Close - Fermer + &Fermer - Distance to axis Distance aux axes - &Inverted - + &Inversé TextEditor - QtiPlot - Confirmation - Are you sure you want to add %1 text lines into this text box? Êtes-vous sûr de vouloir ajouter %1 lines dans cette boite à texte ? @@ -21071,19 +13627,16 @@ TextFormatButtons - B Button bold B - It Button italics It - U Button underline U @@ -21092,47 +13645,38 @@ ThreeExpFit - Exponential decay Décroissance exponentielle - ExpDecay3 Décroissance exponentielle, troisème ordre - first amplitude Premier amplitude - first lifetime premier constante de temps - second amplitude deuxième amplitude - second lifetime deuxième constante de temps - third amplitude troisième amplitude - third lifetime troisième constante de temps - offset Décalage en Y @@ -21140,36 +13684,26 @@ TranslateCurveTool - Curve selected! Move cursor and click to choose a point and double-click/press 'Enter' to finish! Courbe sélectionnée ! Déplacez le curseur et cliquez pour choisir un point puis double-cliquez ou appuyez sur 'Entrée' pour terminer ! - - - - QtiPlot - Warning QtiPlot - Avertissement - This operation cannot be performed on function curves. Cette opération ne peut être réalisée sur les fonctions. - This operation cannot be performed on curves plotted from columns having a non-numerical format. Cette opération ne peut être réalisée sur des courbes ayant des colonnes au format non numérique. - - The column '%1' is read-only! Operation aborted! - La colonne '%1' est en lecture-seule ! Opération annulée + La colonne '%1' est en lecture-seule ! Opération annulée ! - Double-click on plot to select a data point! Double-cliquez pour sélectionner un point ! @@ -21177,5221 +13711,91 @@ TwoExpFit - Exponential decay Décroissance exponentielle - ExpDecay2 Décroissance exponentielle, deux ordres - first amplitude Première amplitude - first lifetime Première constante de temps - second amplitude deuxième amplitude - second lifetime deuxième contante de temps - offset Décalage en Y - analysisDialog - - QtiPlot - Analysis Option - QtiPlot - Options d'analyse - - - &OK - &OK - - - &Cancel - &Annuler - - - QtiPlot - Analysis Options - QtiPlot - Options d'analyses - - - - associationsDialog - - QtiPlot - Plot Associations - QtiPlot - Association de graphes - - - Column - Colonne - - - X - X - - - Y - Y - - - xErr - xErr - - - yErr - yErr - - - &Update curve - &Modifier la courbe - - - &OK - &OK - - - &Cancel - &Annuler - - - xEnd - xEnd - - - yEnd - yEnd - - - Spreadsheet: - Feuille de calcul : - - - - axesDialog - - QtiPlot - General Plot Options - Qtiplot - Options générales pour les graphes - - - &Apply - &Appliquer - - - &OK - &OK - - - &Cancel - &Annuler - - - From - De - - - To - à - - - Type - Type - - - linear - linéaire - - - logarithmic - logarithmique - - - Inverted - Inversé - - - Step - Intervalle - - - Major Ticks - Graduations Principales - - - Minor Ticks - Graduations Secondaires - - - Horizontal - Horizontale - - - Vertical - Verticale - - - Scale - Échelle - - - Major Grids - Grille Principale - - - Minor Grids - Grille Secondaire - - - Line Color - Couleur des Lignes - - - Line Type - Type de Lignes - - - Thickness - Épaisseur - - - Additional lines - Lignes supplémentaires - - - X=0 - X = 0 - - - Y=0 - Y = 0 - - - Grid - Grille - - - Show - Voir - - - Title - Titre - - - Numeric - Numérique - - - Text from table - Texte de la table - - - Day of the week - Jour de la semaine - - - Month - Mois - - - Time - Heure - - - Date - Date - - - Font - Police - - - Axis &Font - Modi&fier - - - Color - Couleur - - - Co&lor - Modifier - - - Ticks - Graduations - - - In - Au dessus de l'axe - - - Out - Au dessous de l'axe - - - Both - Au dessus et en dessous - - - None - Aucune - - - Stand-off - Décalage - - - Show Labels - Afficher les étiquettes - - - Table - Table - - - Format - Format - - - Automatic - Automatique - - - Decimal: 100.0 - Décimal : 100.0 - - - Scientific: 1e2 - Scientifique : 1e2 - - - Scientific: 10^2 - Ingénieur : 10^2 - - - Precision - Précision - - - Angle - Angle - - - For&mula - For&mule - - - Axis - Axe - - - Canvas frame - Bordure du cadre - - - C&olor - M&odifier - - - Width - Largeur - - - Background - Arrière Plan - - - Border Width - Épaisseur de la bordure - - - Border Color - Couleur de la bordure - - - Colo&r - Modifie&r - - - Axes - Axes - - - Draw backbones - Axes visibles - - - Line Width - Largeur de ligne - - - Major ticks length - Longueur des graduations principales - - - Minor ticks length - Longueur des graduations secondaires - - - Margin - Marge - - - Apply to all layers - Appliquer à toutes les planches - - - General - Général - - - h - h - - - h ap - h ap - - - h AP - h AP - - - h:mm - h:mm - - - h:mm ap - h:mm ap - - - hh:mm - hh:mm - - - h:mm:ss - h:mm:ss - - - h:mm:ss.zzz - h:mm:ss.mmm - - - mm:ss - mm:ss - - - mm:ss.zzz - mm:ss.mmm - - - hmm - hmm - - - hmmss - hmmss - - - hhmmss - hhmmss - - - yyyy-MM-dd - aaaa-MM-jj - - - dd.MM.yyyy - jj.MM.aaaa - - - ddd MMMM d yy - jjj MMMM j aa - - - dd/MM/yyyy - jj/MM/aaaa - - - QtiPlot - Start limit error - QtiPlot - Erreur de la limite de départ - - - QtiPlot - End limit error - QtiPlot - Erreur de la limite d'arrêt - - - QtiPlot - Step input error - Qtiplot - Erreur d'intervalle - - - Please enter a positive step value! - Veuillez entrer une valeur d'intervalle positive ! - - - QtiPlot - Formula input error - QtiPlot - Erreur de formule - - - Valid variables are 'x' for Top/Bottom axes and 'y' for Left/Right axes! - Les variables ne peuvent être que 'x' pour les axes supérieur/inférieur et 'y' pour les axes latéraux ! - - - milisec. - milisec. - - - sec. - sec. - - - min. - min. - - - hours - heures - - - days - jours - - - weeks - semaines - - - &Font - Police - - - B - B - - - It - it - - - U - U - - - Column Headings - En-têtes de colonnes - - - In & Out - Au dessus et en dessous - - - Canvas Color - Couleur du cadre - - - millisec. - ms. - - - Bottom - Inférieur - - - Left - Gauche - - - Top - Supérieur - - - Right - Droite - - - - configDialog - - Application - Application - - - Confirmations - Confirmations - - - Tables - Tables - - - 2D Plots - Graphes 2D - - - 2D Curves - Courbes 2D - - - Colors - Couleurs - - - Fonts - Police - - - Prompt on closing - Confirmer les fermetures de - - - Matrixes - Matrices - - - 3D Plots - Graphes 3D - - - Options - Options - - - Frame width - Epaisseur du cadre - - - Legend frame - Cadre autour de la légende - - - None - Aucun - - - Rectangle - Rectangle - - - Shadow - Ombré - - - White out - Contour blanc - - - Black out - Contour noir - - - Ticks - Graduations des axes - - - In - Au dessus de l'axe - - - Out - Au dessous de l'axe - - - Both - Au dessus et en dessous - - - Major ticks length - Longueur des graduations principales - - - Axes linewidth - Epaisseur des traits d'axes - - - Minor ticks length - Longueur des graduations secondaires - - - General - Général - - - Style - Style - - - Choose &font - Modifier - - - Save every - Sauvegarder toutes les - - - Default curve style - Style de courbe par défaut - - - Line - Ligne - - - Scatter - Nuage de points - - - Line + Symbol - Ligne + Symbole - - - Vertical drop lines - Epingles - - - Spline - Spline - - - Vertical steps - Marches verticales - - - Area - Aire - - - Vertical Bars - Barres Verticales - - - Horizontal Bars - Barres Horizontales - - - Line width - Epaisseur des lignes - - - Symbol size - Taille des symboles - - - QtiPlot - Choose default settings - Qtiplot - Choisissez les paramètres par défaut - - - &OK - &OK - - - &Cancel - &Annuler - - - &Apply - &Appliquer - - - &Background - Modifier - - - &Text Font - &Texte - - - &Labels Font - Etiquettes - - - A&xes Legend - Etiquettes des A&xes - - - Axes &Numbers - Etiquettes des &Graduations - - - &Legend - &Légende - - - T&itle - T&itre - - - &Workspace - &Modifier - - - Pa&nels - Modifier - - - Panels Te&xt - Modifier - - - &Show Legend - Afficher la légende - - - Resolution - Résolution - - - Lab&els - Modifier - - - Mesh &Line - Ligne du maillage - - - &Grid - &Grille - - - Data &Min - Minimum - - - &Numbers - &Nombre - - - &Title - &Titre - - - &Axes Labels - Etiquette des &Axes - - - Show &Projection - Afficher la &Projection - - - &Data Max - &Maximum - - - A&xes - A&xes - - - Background - Arrière Plan - - - Text - Texte - - - Labels - Etiquettes - - - Margin - Marge - - - Workspace - Fond - - - Panels - Panneaux - - - Panels text - Texte des Panneaux - - - Te&xt - &Modifier - - - Default Column Separator - Séparateur de colonnes par défaut - - - TAB - TAB - - - SPACE - ESPACE - - - ;TAB - ;TAB - - - ,TAB - ,TAB - - - ;SPACE - ;ESPACE - - - ,SPACE - ,ESPACE - - - ; - ; - - - , - , - - - Auto&scaling - Echelle automatique - - - Scale &Fonts - Taille de la Police - - - Show &Title - Afficher le &Titre - - - Sho&w all axes - Afficher tous les axes - - - Canvas Fra&me - Bordure du cadre - - - Axes &backbones - Abscisses / Ordonnées - - - Do not &resize layers when window size changes - Ne pas &redimensionner les planches lorsque la taille de la fenêtre change - - - (all data shown) - (Toutes les données) - - - Smooth Mes&h - Maillage lissé - - - &Close - &Annuler - - - Folders - Dossier - - - &Notes - Commentai&res - - - Language - Langue - - - minutes - minutes - - - Smoot&h Line - Affinée - - - QtiPlot - Import options error - QtiPlot - Erreur d'importation des données - - - The separator must not contain the following characters: 0-9eE.+- - Le séparateur ne doit pas contenir un des caractères suivant : 0-9eE.+- - - - Curves - Courbes - - - Length - Longueur - - - Major Ticks - Graduations Principales - - - Minor Ticks - Graduations Secondaires - - - Draw axes &backbone - Axes visibles - - - Scale &fonts on resize - Mise à l'échelle des polices lors du redimensionnement - - - Auto&scale axes - Echelle automatique des axes - - - In & Out - Au dessus et en dessous - - - Check for new versions at startup - Vérifier les nouvelles versions au démarrage - - - Generated Fit Curve - Création de l'ajustement de la courbe - - - Uniform X Function - Fonction X uniforme - - - Points - Points - - - Same X as Fitting Data - Même X que les données d'ajustement - - - Display Peak Curves for Multi-peak Fits - Afficher les pics de la courbe pour l'ajustement multi-pics - - - Peaks Color - Couleur des pics - - - Parameters Output - Paramètre de sortie - - - Significant Digits - Fixées à - - - Write Parameters to Result Log - Ecrire les paramètres sur la fenêtre de résultats - - - Paste Parameters to Plot - Copier les paramètres vers la courbe - - - Fitting - Ajustement - - - Default scripting language - Langage de script - - - Scale Errors with sqrt(Chi^2/doF) - Échelle d'erreurs avec sqrt(Chi^2/doF) - - - Horizontal steps - Marches horizontales - - - O&rthogonal - O&rthogonal - - - - curvesDialog - - QtiPlot - Add/Remove curves - Qtiplot - Ajouter/Enlever des courbes - - - Line - Ligne - - - Scatter - Nuage de points - - - Line + Symbol - Ligne + Symbole - - - Vertical drop lines - Epingles - - - Spline - Spline - - - Vertical steps - Marches verticales - - - Area - Zones - - - Vertical Bars - Barres Verticales - - - Horizontal Bars - Barres Horizontales - - - Available data - Données disponibles - - - Graph contents - Contenu - - - OK - OK - - - Cancel - Annule - - - Plot Associations... - Associations de graphiques... - - - &Plot Associations... - &Matrice de Graphes... - - - &Edit Function... - Modifi&er la fonction... - - - Close - Fermer - - - &Delete - Supprimer - - - &Plot - Courbe - - - Horizontal steps - Marches horizontales - - - - epsExportDialog - - Orientation - Orientation - - - Page Size - Format de la Page - - - Resolution - Résolution - - - &Print in color if available - Im&primer en couleur si c'est possible - - - QtiPlot - EPS Export options - QtiPlot - Options pour l'exportation en EPS - - - &OK - &OK - - - &Cancel - &Annuler - - - Landscape - Paysage - - - Portrait - Portrait - - - Warning: Windows users need a default post-script printer enabled! - Avertissement : Les utilisateurs sous Windows ont besoin d'avoir une imprimante Postscript ! - - - - errDialog - - QtiPlot - Error Bars - Qtiplot - Barres d'erreurs - - - &X Error Bars - Barres d'erreurs en &abscisses - - - &OK - &OK - - - Add Error Bars to - Ajouter des barres d'erreurs à - - - Source of errors - Origine des erreurs - - - Percent of data (%) - Pourcentage sur les données (%) - - - 5 - 5 - - - Standard Deviation of Data - Ecart-Type des données - - - &Y Error Bars - Barres d'erreurs en &ordonnées - - - &Cancel - &Annuler - - - &Add - &Ajouter - - - &Close - Fermer - - - - expDecayDialog - - QtiPlot - Verify initial guesses - Qtiplot - Vérifier les paramètres initiaux - - - Damping - Atténuation - - - First decay time (t1) - Première constante de temps (t1) - - - 1 - 1 - - - Second decay time (t2) - Deuxième constante de temps (t2) - - - Third decay time (t3) - Troisième constante de temps (t3) - - - Amplitude - Amplitude - - - Initial time - Temps initial - - - 0 - 0 - - - Y Offset - Décalage en Y - - - &OK - &OK - - - &Cancel - &Annuler - - - Exponential Fit of - Ajustement de - - - Growth time - Durée d'accroissement - - - &Fit - &Calculer - - - QtiPlot - Warning - QtiPlot - Avertissement - - - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - La courbe <b> %1 </b> n'existe plus ! Opération annulée ! - - - Color - Couleur - - - &Close - &Fermer - - - - exportDialog - - Separator - Séparateur - - - QtiPlot - Export ASCII - Qtiplot - Exporter en texte ASCII - - - &OK - &OK - - - &Cancel - &Annuler - - - TAB - Tabulation - - - SPACE - Espace - - - ,TAB - ,Tabulation - - - ;TAB - ;Tabulation - - - ,SPACE - ,Espace - - - ;SPACE - ;Espace - - - ; - ; - - - , - , - - - Table - Table - - - Include Column &Names - Insérer les &Noms des Colonnes - - - Export &Selection - Exporter la &Sélection - - - &All - &Tout - - - QtiPlot - Import options error - QtiPlot - Erreur d'importation des données - - - The separator must not contain the following characters: 0-9eE.+- - Le séparateur ne doit pas contenir un des caractères suivant : 0-9eE.+- - - - The column separator can be customized. The following special codes can be used: -\t for a TAB character -\s for a SPACE - Le séparateur de colonne peut être personnalisé. Les codes spéciaux suivant peuvent être utilisés : -\t pour une tabulation -\s pour une espace - - - QtiPlot - Help - QtiPlot - Aide - - - &Help - Aide - - - - fDialog - - QtiPlot - Start limit error - QtiPlot - Erreur de la limite de départ - - - QtiPlot - End limit error - QtiPlot - Erreur de la limite d'arrêt - - - QtiPlot - Input error - Qtiplot - Erreur lors de l'entrée - - - Please enter x limits that satisfy: from < end! - Donnez des limites en abscisses dans l'ordre croissant ! - - - QtiPlot - Input function error - Qtiplot - Erreur lors de l'entrée de la fonction - - - Please enter parameter limits that satisfy: from < end! - Donnez des valeurs du paramètre dans l'ordre croissant ! - - - - filterDialog - - Filter curve: - Filtrer : - - - Frequency cutoff (Hz) - Fréquence de coupure (Hz) - - - Low Frequency (Hz) - Fréquence de coupure basse (Hz) - - - 0 - 0 - - - High Frequency (Hz) - Fréquence de coupure haute (Hz) - - - Add DC Offset - Tenir compte de la composante continue - - - Substract DC Offset - Supprimer la composante continue - - - Color - Couleur - - - QtiPlot - Filter options - QtiPlot - Options du filtre - - - &Filter - &Calculer - - - &Close - &Fermer - - - QtiPlot - Frequency input error - QtiPlot - Erreur de la fréquence d'entrée - - - Please enter positive frequency values! - Donnez des valeurs de fréquences positives ! - - - QtiPlot - High Frequency input error - QtiPlot - Erreur de la limite de départ - - - Please enter frequency limits that satisfy: Low < High ! - Donnez des limites de fréquences dans l'ordre croissant ! - - - - findDialog - - QtiPlot - QtiPlot - - - Find - Chercher - - - Start From - A partir de - - - Search In - Chercher dans - - - &Window Names - Noms des fenêtres - - - Window &Labels - &Labels des fenêtres - - - Folder &Names - Noms de dossiers - - - Case &Sensitive - Respecter la casse - - - &Partial Match Allowed - Correspondance &partielle autorisée - - - &Include Subfolders - &Inclure les sous-dossiers - - - &Find - Chercher - - - &Reset Start From - Recommencer - - - &Close - Fermer - - - - fitDialog - - QtiPlot - Non-linear curve fit - Qtiplot - Ajustement �une fonction non linéaire - - - Curve - Courbe - - - Function - Fonction - - - Initial guesses - Estimation initiale des paramètres - - - From x= - De x = - - - To x= - à x = - - - Iterations - Nombre d'itérations - - - Tolerance - Tolérance - - - Algorithm - Algorithme - - - &Fit - &Calculer - - - &Cancel - &Annuler - - - Type: - Type : - - - Scaled Levenberg-Marquardt - Levenberg-Marquardt Normalisé - - - Unscaled Levenberg-Marquardt - Levenberg-Marquardt - - - << &Edit function - << Modifi&er la fonction - - - Category - Catégorie - - - User defined - Définie par l'utilisateur - - - Built-in - Interne - - - Basic - Basique - - - Expresion - Expression - - - Fit with &built-in function - Ajuster avec une fonction interne - - - Name - Nom - - - &Save - &Sauvegarder - - - Parameters - Paramètres - - - &Remove - Supprimer - - - Add &expresion - Ajouter une &expression - - - Add &name - Ajouter un &nom - - - Clear user &list - Supprimer la &liste utilisateur - - - &Fit >> - Ajuster >> - - - QtiPlot - Input function error - Qtiplot - Erreur lors de l'entrée de la fonction - - - Please enter a valid function! - Veuillez entrer une fonction valide ! - - - Please enter a function name! - Veuillez entrer un nom de fonction ! - - - Please enter at least one parameter name! - Veuillez entrer au moins un nom de paramètre ! - - - You can't define functions recursevely! - Vous en pouvez pas définir de fonctions récursives ! - - - Built-in function: -the order of the parameters matters! - Fonctions internes : -respectez l'ordre des paramètres ! - - - User defined function - Fonction définie par l'utilisateur - - - Please verify that you have initialized all the parameters! - Veuillez vérifier que vous avez inititialisé tous les paramètres ! - - - QtiPlot - Error: function name - Qtiplot - Erreur : fonction non reconnue - - - is a built-in function name<p>You must choose another name for your function! - est un nom de fonction interne<p>Veuillez choisir un autre nom pour votre fonction ! - - - Please use exactly one '=' symbol! - Veuillez utiliser seulement un signe '=' ! - - - QtiPlot - Input error - QtiPlot - Erreur lors de l'entrée des paramètres - - - Please enter initial guesses for your parameters! - Veuillez entrer des valeurs initiales pour la recherche des paramètres ! - - - QtiPlot - Start limit error - QtiPlot - Erreur sur la limite inférieure - - - QtiPlot - End limit error - QtiPlot - Erreur sur la limite supérieure - - - Please enter x limits that satisfy: from < end! - Donnez des limites en abscisses dans l'ordre croissant ! - - - QtiPlot - Tolerance input error - QtiPlot - Erreur sur la valeur de la tolérance - - - The tolerance value must be positive and less than 1! - La tolérance doit être un nombre compris entre 0 et 1 ! - - - Plugins - Extensions - - - &Choose plugins folder... - &Choisir le répertoire pour les extensions... - - - Fit using &built-in function - Ajuster par une fonction &interne - - - Fit using &plugin function - Ajuster par une fonction &externe - - - Choose the plugins folder - Choisir le répertoire pour les extensions - - - QtiPlot - Warning - QtiPlot - Avertissement - - - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - La courbe <b> %1 </b> n'existe plus ! Opération annulée ! - - - Color - Couleur - - - Fit with selected &user function - Aj&uster par une fonction définie par l'utilisateur - - - Parameter - Paramètre - - - Value - Valeur - - - Nelder-Mead Simplex - Simplex Nelder-Mead - - - &Delete Fit Curves - Supprimer les courbes ajustées - - - Constant - Constante - - - Expression - Expression - - - Add &expression - Ajouter une expression - - - Weighting Method - Méthode de pondération - - - No weighting - Aucune pondération - - - Instrumental - Instrumentale - - - Statistical - Statistique - - - Arbitrary Dataset - Données aléatoires - - - &Close - &Fermer - - - Custom &Output >> - Sortie personnalisée >> - - - Polynomial Order - Ordre - - - Generated Fit Curve - Création de l'ajustement de la courbe - - - Uniform X Function - Fonction X uniforme - - - Points - Points - - - Same X as Fitting Data - Même X que les données d'ajustement - - - Parameters Output - Paramètre de sortie - - - Significant Digits - Fixées à - - - Parameters Table - Paramètres de la table - - - Name: - Nom : - - - Covariance Matrix - Matrice de co-variance - - - CovMatrix - CovMatrix - - - Write Parameters to Result Log - Ecrire les paramètres sur la fenêtre de résultats - - - Paste Parameters to Plot - Copier les paramètres vers la courbe - - - << &Fit - << &Ajuster - - - &Apply - &Appliquer - - - QtiPlot - Error - QtiPlot - Erreur - - - Please enter a valid name for the parameters table. - Veuillez donner un nom valide pour les paramètres de la table. - - - Please perform a fit first and try again. - Veuillez faire un ajustement et essayer de nouveau. - - - Error - Erreur - - - Please enter a valid name for the covariance matrix. - Veuillez donner un nom valide pour la matrice de co-variance. - - - Gauss - Gauss - - - Peaks - Pics - - - Lorentz - Lorentz - - - Polynomial - Polynomial - - - MultiPeak - Multi-pics - - - Scale Errors with sqrt(Chi^2/doF) - Échelle d'erreurs avec sqrt(Chi^2/doF) - - - - functionDialogui - - QtiPlot - Add function curve - Qtiplot - Ajouter une courbe de fonction - - - Curve type - Type de courbe - - - f(x)= - f(x) = - - - From x= - De x = - - - To x= - à x = - - - Points - Nombre de points - - - Clear list - Effacer la liste - - - Parameter - Paramètre - - - To - à - - - y = - y = - - - x = - x = - - - From - De - - - R = - R = - - - Theta = - Theta = - - - Function - Fonction y = f(x) - - - Parametric plot - Courbe paramétrée - - - Polar plot - Courbe polaire - - - Cancel - Annuler - - - Ok - OK - - - - genDialog - - QtiPlot - General Plot Options - Qtiplot - Options générales pour les graphes - - - &Apply - &Appliquer - - - &OK - &OK - - - &Cancel - &Annule - - - From - De - - - To - à - - - Type - Type - - - linear - linéaire - - - logarithmic - logarithmique - - - Inverted - Inversé - - - Step - Intervalle - - - Major Ticks - Graduations Principales - - - Minor Ticks - Graduations Secondaires - - - Scale - Echelle - - - Major Grids - Grille Principale - - - Minor Grids - Grille Secondaire - - - Line Color - Couleur des Lignes - - - Line Type - Type de Lignes - - - Thickness - Epaisseur - - - Aditional lines - Lignes supplémentaires - - - X=0 - X=0 - - - Y=0 - Y=0 - - - Grid - Grille - - - Show - Montrer - - - Title - Titre - - - Numeric - Numérique - - - Text from table - Texte de la table - - - Day of the week - Jour de la semaine - - - Month - Mois - - - Time - Temps - - - Date - Date - - - Font - Police - - - Axis &Font - &Police pour les Axes - - - Color - Couleur - - - Ticks - Graduations - - - In - Intérieures - - - Out - Extérieures - - - Both - Les deux - - - None - Aucune - - - Stand-off - Décalage - - - Show Labels - Montrer les étiquettes - - - Table - Table - - - Format - Format - - - Automatic - Automatique - - - Decimal: 100.0 - Décimal: 100.0 - - - Scientific: 1e2 - Scientifique: 1e2 - - - Scientific: 10^2 - Scientifique: 10^2 - - - Precision - Précision - - - Angle - Angle - - - Axis - Axes - - - Canvas frame - Cadre du graphique - - - Width - Epaisseur - - - Axes - Axes - - - Draw backbones - Tracer les axes - - - Line Width - Epaisseur des lignes - - - Major ticks length - Longueur des graduations principales - - - Minor ticks length - Longueur des graduations secondaires - - - General - Général - - - h - h - - - h ap - h ap - - - h AP - h AP - - - h:mm - h:mm - - - h:mm ap - h:mm ap - - - hh:mm - hh:mm - - - h:mm:ss - h:mm:ss - - - h:mm:ss.zzz - h:mm:ss.mmm - - - mm:ss - mm:ss - - - mm:ss.zzz - mm:ss.mmm - - - hmm - hmm - - - hmmss - hmmss - - - hhmmss - hhmmss - - - yyyy-MM-dd - aaaa-MM-jj - - - dd.MM.yyyy - jj.MM.aaaa - - - ddd MMMM d yy - jjj MMMM j aa - - - dd/MM/yyyy - jj/MM/aaaa - - - milisec. - milisec. - - - sec. - sec. - - - min. - min. - - - hours - Heures - - - days - Jours - - - weeks - Semaines - - - QtiPlot - Start limit error - Qtiplot - Erreur maximale au début - - - QtiPlot - End limit error - Qtiplot - Erreur maximale à la fin - - - QtiPlot - Step input error - Qtiplot - Erreur lors de l'entrée du pas - - - Please enter a positive step value! - Veuillez entrer une valeur positive pour le pas! - - - Co&lor - Co&uleur - - - C&olor - C&ouleur - - - Background - Arriêre plan - - - Border Width - Epaisseur de la bordure - - - Border Color - Couleur de la bordure - - - Colo&r - Couleu&r - - - Margin - Marge - - - Apply to all layers - Appliquer à tous les calques - - - Additional lines - Lignes suplémentaires - - - - imageDialog - - Origin - Origine - - - X= - X = - - - Y= - Y = - - - Size - Dimension - - - width= - Largeur = - - - height= - Hauteur = - - - QtiPlot - Image Geometry - Qtiplot - Taille de l'image - - - &Apply - &Appliquer - - - &OK - &OK - - - &Cancel - &Annuler - - - pixels - pixels - - - - imageExportDialog - - Image format - Format de l'image - - - Image quality - Qualité de l'image - - - QtiPlot - Export options - Qtiplot - Options pour l'exportation - - - &OK - &OK - - - &Cancel - &Annuler - - - - importDialog - - Separator - Séparateur - - - Ignore first - Ignorer les premières - - - QtiPlot - ASCII Import Options - Qtiplot - Options pour l'importation de fichiers ASCII - - - &OK - &OK - - - &Cancel - &Annuler - - - ; - ; - - - , - , - - - TAB - Tabulation - - - SPACE - Espace - - - ;TAB - ;Tabulation - - - ,TAB - ,Tabulation - - - ;SPACE - ;Espace - - - ,SPACE - ,Espace - - - Use first row to &name columns - Utiliser la première rangée pour nommer les colonnes - - - The column separator can be customized. The following special codes can be used: -\t for a TAB character -\s for a SPACE - Le séparateur de colonne peut être personnalisé. Les codes spéciaux suivant peuvent être utilisés : -\t pour une tabulation -\s pour une espace - - - The separator must not contain the following characters: 0-9eE.+- - Le séparateur ne doit pas contenir un des caractères suivant : 0-9eE.+- - - - lines - lignes - - - By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. - En validant cette option, toutes les espaces du fichier ASCII seront supprimées. - - - Warning: checking this option leads to column overlaping if the columns in the ASCII file don't have the same number of rows. - Attention : Valider cette option entrainera un recouvrement de colonnes si les colonnes du fichier ASCII n'ont pas le même nombre de rangées. - - - To avoid this problem you should precisely define the column separator using TAB and SPACE characters. - Pour éviter ce problème, vous devez définir les séparateurs de colonnes à TAB ou à SPACE. - - - By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. - En validant cette option, toutes les espaces du fichier seront supprimées et les tabulations seront remplacées par une espace unique. - - - Remove white spaces from line ends - Supprimer les espaces de fin de lignes - - - Simplify white spaces - Simplifier les espaces - - - By checking this option each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. - En validant cette option, toutes les espaces (y compris les tabulations) seront remplacées par une espace unique. - - - Warning: using these two last options leads to column overlaping if the columns in the ASCII file don't have the same number of rows. - Attention : Utiliser ces deux dernières options entrainera le recouvrement de colonnes si les colonnes du fichier ASCII n'ont pas le même nombre de rangées. - - - QtiPlot - Help - QtiPlot - Aide - - - &Apply - &Appliquer - - - &Close - Fermer - - - &Help - Aide - - - &Remove white spaces from line ends - Supprime&r les espaces de fin de lignes - - - &Simplify white spaces - &Simplifier les espaces - - - QtiPlot - Import options error - QtiPlot - Erreur d'importation des données - - - QtiPlot - QtiPlot - - - Do you want to save the modifications to the ASCII import options before closing? - Voulez-vous sauvegarder les modifications d'importations des fichiers ASCII ? - - - Yes - Oui - - - No - Non - - - Cancel - Annuler - - - - intDialog - - QtiPlot - Integration Options - Qtiplot - Options d'intégration - - - Integration of - Intégration de - - - Order (1 - 5, 1 = Trapezoid Rule) - Ordre (1 à 5, 1 = méthode des trapêzes) - - - Number of iterations (Max=40) - Nombre d'itérations (Max = 40) - - - Tolerance - Tolérance - - - Lower limit - Limite inférieure - - - Upper limit - Limite supérieure - - - &OK - &OK - - - &Cancel - &Annuler - - - &Integrate - &Intégrer - - - &Close - Fermer - - - &Help - Aide - - - You can not fit index: - Vous ne pouvez pas ajuster l'index : - - - because it has less than 2 points! - Parce qu'il a moins de 2 points ! - - - QtiPlot - Warning - QtiPlot - Avertissement - - - QtiPlot - Tolerance value error - QtiPlot - Erreur sur la valeur de la tolérance - - - QtiPlot - Input error - QtiPlot - Erreur lors de l'entrée des paramètres - - - Please give a number larger or equal to the minimum value of X, for the lower limit. - If you do not know that value, type min in the box. - Donnez un nombre supérieur ou égal à la plus petite valeur de X pour la limite inférieure. -Si vous ne la connaissez pas, tapez 'min'. - - - Please give a number smaller or equal to the maximum value of X, for the lower limit. - If you do not know that value, type max in the box. - Donnez un nombre inférieur à la plus petite valeur de X pour la limite inférieure. -Si vous ne la connaissez pas, tapez 'max'. - - - QtiPlot - Start limit error - QtiPlot - Erreur de la limite de départ - - - Please give a number smaller or equal to the maximum value of X, for the upper limit. - If you do not know that value, type max in the box. - Donnez un nombre inférieur à la plus petite valeur de X pour la limite supérieure. -Si vous ne la connaissez pas, tapez 'max'. - - - Please give a number larger or equal to the minimum value of X, for the upper limit. - If you do not know that value, type min in the box. - Donnez un nombre supérieur ou égal à la plus petite valeur de X pour la limite supérieure. -Si vous ne la connaissez pas, tapez 'min'. - - - QtiPlot - End limit error - QtiPlot - Erreur de la limite d'arrêt - - - QtiPlot - Help for Integration - QtiPlot - Aide pour l'intégration - - - The integration of a curve consists of the following five steps: - 1) Choose which curve you want to integrate - 2) Set the order of the integration. The higher it is the more accurate the calculation is - 3) Choose the number of iterations - 4) Choose the tollerance - 5) Choose the lower and the upper limit. - The code integrates the curve with an iterative algorithm. The tolerance determines the termination criteria for the solver. - Because, sometimes we ask for too much accuracy, the number of iterations makes sure that the solver will not work for ever. - IMPORTANT -The limits must be within the range of x; If you do not know the maximum (minimum) value of x, type max (min) in the boxes. - L'intégration d'une courbe suit les 5 étapes suivantes : -1) Choisir quelle courbe intégrer -2) Fixer l'ordre de l'intégration. Plus l'ordre est grand, plus la précision est importante -3) Choisir le nombre d'itérations -4) Choisir la tolérance -5) Choisir les limites inférieures et supérieures -Le logiciel intègre la courbe à l'aide d'un algorithme itératif. La téloérance détermine le critère d'arrêt pour le solveur. -Parce que, de temps en temps, nous demandons uen trop grande précésion, le nombre d'itérations assure que le solveur ne bouclera pas indéfiniment. -IMPORTANT -Les limtes doivent être dans la gamme des x ; Si vous ne connaissez pas le maximum (minimum), tapez 'max' ('min'). - - - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - La courbe <b> %1 </b> n'existe plus ! Opération annulée ! - - - You cannot fit index: - Vous ne pouvez pas ajuster l'index : - - - The integration of a curve consists of the following five steps: - 1) Choose which curve you want to integrate - 2) Set the order of the integration. The higher it is the more accurate the calculation is - 3) Choose the number of iterations - 4) Choose the tolerance - 5) Choose the lower and the upper limit. - The code integrates the curve with an iterative algorithm. The tolerance determines the termination criteria for the solver. - Because, sometimes we ask for too much accuracy, the number of iterations makes sure that the solver will not work for ever. - IMPORTANT -The limits must be within the range of x; If you do not know the maximum (minimum) value of x, type max (min) in the boxes. - L'intégration d'une courbe, consiste à suivre les cinq points suivants : -1) Choisir quelle courbe vous voulez intégrer -2) Fixer l'ordre d'intégration. Plus l'ordre est élevé, meilleure est la précision -3) Choisir le nombre d'itérations -4) Choisir la tolérance -5) Choisir les limites inférieure et supérieure. -Le code intégre la courbe avec un algorithme itératif. La tolérance est le critère de fin d'itération pour le solveur. -Parce que, quelque fois, nous demandons une trop grande précision, le nombre d'itérations assure au solveur de ne pas calculer à l'infini. -IMPORTANT -Les limites doivent être dans la gamme de x ; Si vous ne connaissez pas la valeur maximum (minimum) de x, tapez 'max' ('min') dans les zones d'édition. - - - - interpolationDialog - - QtiPlot - Interpolation Options - Qtiplot - Options pour l'interpolation - - - Make curve from - Interpolation de : - - - Spline - Interpolation - - - Points - Points - - - From Xmin - De Xmin = - - - 0 - 0 - - - To Xmax - à Xmax = - - - Color - Couleur - - - &Make - &Calculer - - - &OK - &OK - - - &Cancel - &Annuler - - - Linear - linéaire - - - Cubic - Cubique - - - Non-rounded Akima - Akima non arrondie - - - QtiPlot - Start limit error - QtiPlot - Erreur sur la limite inférieure - - - QtiPlot - End limit error - QtiPlot - Erreur sur la limite supérieure - - - QtiPlot - Input error - QtiPlot - Erreur lors de l'entrée des paramètres - - - Please enter x limits that satisfy: from < to! - Donnez des limites en abscisses dans l'ordre croissant ! - - - &Close - Fermer - - - QtiPlot - Warning - QtiPlot - Avertissement - - - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - La courbe <b> %1 </b> n'existe plus ! Opération annulée ! - - - QtiPlot - Error - QtiPlot - Erreur - - - You need at least %1 points to perform this operation! Operation aborted! - Il faut au moins %1 points pour pouvoir faire cette opération ! Opération annulée ! - - - - layerDialog - - Grid - Grille - - - Columns - Colonnes - - - Rows - Rangées - - - Spacing - Espacement - - - Columns gap - Ecart entre les colonnes - - - Rows gap - Ecart entre les rangées - - - Layout - Planche - - - Fonts - Polices - - - QtiPlot - Image Geometry - Qtiplot - Géométrie de l'image - - - &Apply - &Appliquer - - - &OK - &OK - - - &Cancel - &Annuler - - - Automatic &layout - Redisposer les planches de manière automatique - - - QtiPlot - Columns input error - Qtiplot - Erreur lors de l'entrée de la colonne - - - QtiPlot - Rows input error - Qtiplot - Erreur lors de l'entrée de la rangée - - - Number of Layers - Nombre de planches - - - Alignement - Alignement - - - Horizontal - Horizontal - - - Center - Centré - - - Left - Gauche - - - Right - Droite - - - Vertical - Vertical - - - Top - Supérieur - - - Bottom - Inférieur - - - &Layer Canvas Size - Tail&le du Canevas des planches - - - Width - Largeur - - - pixels - pixels - - - Height - Hauteur - - - Left margin - Marge de gauche - - - Right margin - Marge de droite - - - Top margin - Marche supérieure - - - Bottom margin - Marge inférieure - - - QtiPlot - Arrange Layers - QtiPlot - Redisposer les planches - - - Titles - Titres - - - Axis Legends - Légende des axes - - - Axis Numbers - Nombres de axes - - - Legends - Légendes - - - QtiPlot - Delete Layers? - QtiPlot - Effacer les planches ? - - - You are about to delete %1 existing layers. - Vous allez supprimer %1 planches existantes. - - - Are you sure you want to continue this operation? - Etes vous certain de continuer cette opération ? - - - &Continue - &Continuer - - - The number of columns you've entered is greater than the number of graphs (%1)! - Le nombre de colonnes que vous avez donné est plus grand que le nombre de graphes (%1) ! - - - The number of rows you've entered is greater than the number of graphs (%1)! - Le nombre de rangées que vous avez donné est plus grand que le nombre de graphes (%1) ! - - - - lineDialog - - QtiPlot - Line options - Qtiplot - Options de la ligne - - - Color - Couleur - - - Line type - Type de ligne - - - Line width - Epaisseur de la ligne - - - 1 - 1 - - - 2 - 2 - - - 3 - 3 - - - 4 - 4 - - - 5 - 5 - - - Arrow at &start - Flêche au &début - - - Arrow at &end - Flêche à la &fin - - - Opti&ons - Opti&ons - - - Length - Longueur - - - Angle - Angle - - - &Filled - &Pleine - - - Arrow &Head - &Tête de la flêche - - - Start Point - Point de départ - - - X - X - - - Y - Y - - - End Point - Point terminal - - - &Geometry - &Géometrie - - - &Ok - &Ok - - - &Apply - &Appliquer - - - &Cancel - &Annuler - - - Co&lor - Cou&leur - - - Set &Default - &Défault - - - Unit - Unité - - - Pixels - Pixels - - - Scale Coordinates - Echelle des coordonnées - - - - matrixDialog - - Cell Width - Largeur des cellules - - - Data Format - Format des données - - - Numeric Display - Nombre de décimales - - - QtiPlot - Matrix Properties - Qtiplot - Propriétés de la matrice - - - &OK - &OK - - - &Cancel - Annuler - - - &Apply - &Appliquer - - - Decimal: 1000 - Décimal : 1000 - - - Scientific: 1E3 - Scientifique : 1E3 - - - Default Decimal Digits - Par défaut - - - Significant Digits= - Fixées à - - - - matrixSizeDialog - - Rows - Rangées - - - Columns - Colonnes - - - QtiPlot - Matrix Dimensions - Qtiplot - Taille de la matrice - - - &OK - &OK - - - &Cancel - &Annuler - - - Dimensions - Dimensions - - - Coordinates - Coordonnées - - - X (Columns) - X (Colonnes) - - - Y (Rows) - Y (Rangées) - - - First - Premier - - - Last - Dernier - - - QtiPlot - Input error - QtiPlot - Erreur lors de l'entrée des paramètres - - - - matrixValuesDialog - - QtiPlot - Set Matrix Values - Qtiplot - Fixer les valeurs de la matrice - - - For row (i) - Pour la rangée (i) - - - to - à - - - For col (j) - Pour la colonne (j) - - - Add function - Ajouter la fonction - - - Add Cell - Ajouter la cellule - - - Cell(i,j)= - Cellule(i,j)= - - - OK - OK - - - Apply - Appliquer - - - Cancel - &Annuler - - - QtiPlot - Input function error - Qtiplot - Erreur lors de l'entrée de la fonction - - - You can not use cells recursevely! - Vous ne pouvez pas utiliser les cellules récursivement! - - - Column and row indexes must be greater than zero! - Les indices des rangées et des colonnes doivent ètre supérieurs à zéro ! - - - muParserScript - - - - Out of memory Manque de mémoire - You cannot use imbricated columns! - Vous ne pouvez pas utiliser des colonnes imbriquées ! - - - You cannot use cells recursively! - Vous ne pouvez pas utiliser des cellules recursivement ! - - - Too many '=' in one line. - Trop de '=' dans une ligne. - - - Syntax error: '=' without variable name. - Erreur de syntaxe : '=' sans nom de variable. - - - col() works only on tables! col() ne fonctionne qu'avec des tables ! - - There's no column named %1 in table %2! Il y a une colonne nommée %1 dans la table %2 ! - - - There's no row %1 in table %2! Il y a une rangée nommée %1 dans la table %2 ! - - - There's no column %1 in table %2! Il n'y a pas de colonne %1 dans la table %2 ! - cell() works only on matrices! - cell() ne fonctionne qu'avec des matrices ! - - - There's no row %1 in matrix %2! Il n'y a pas de rangées %1 dans la matrice %2 ! - There's no column %1 in matrix %2! Il n'y a pas de colonne %1 dans la matrice %2 ! - tablecol() works only on tables! tablecol() ne fonctionne qu'avec des tables ! - tablecol: wrong number of arguments (need 2, got %1) tablecol : mauvais nombre d'arguments (besoin de 2, non %1) - tablecol: first argument must be a string (table name) tablecol : Le premier argument doit être une chaîne (nom de la table) - Couldn't find a table named %1. Ne peut trouver une table nommée %1. - - cell() works only on tables and matrices! cell() ne fonctionne qu'avec des tables et des matrices ! - Warning - Avertissement - - - Multiline expressions take much more time to evaluate! Do you want to continue anyways? - Les expressions multilignes sont plus lentes à évaluer! Voulez-vous continuer quand même ? - - - - myWidget - - QtiPlot - QtiPlot - - - Do you want to hide or delete - Voulez-vous Cacher ou Supprimer - - - Delete - Supprimer - - - Hide - Cacher - - - Cancel - Annuler - - - Normal - Normal - - - Hidden - Caché - - - Minimized - Minimum - - - Maximized - Maximum - - - kB - kOctects - - - - pieDialog - - QtiPlot - Pie Options - Qtiplot - Options pour les graphes à secteurs - - - Border - Bordure - - - Color - Couleur - - - Style - Style - - - Width - Largeur - - - Fill - Palette - - - First color - Première couleur - - - Pattern - Texture - - - Pie ray - Hachures - - - Pie - Diagramme - - - &Worksheet - &Feuille de calcul - - - &Apply - &Appliquer - - - &OK - &OK - - - &Cancel - &Annuler - - - Background - Arrière plan - - - Co&lor - Cou&leur - - - Border Width - Epaisseur de la bordure - - - Border Color - Couleur de la bordure - - - Colo&r - Couleu&r - - - Options - Options - - - Margin - Marge - - - Apply to all layers - Appliquer à toutes les planches - - - General - Général - - - Pie radius - Rayon du graphe à secteurs - - - Canvas Color - Couleur du cadre - - - - plot3DDialog - - QtiPlot - Surface Plot Options - Qtiplot - Options pour les graphes 3D - - - X - X - - - Y - Y - - - Z - Z - - - From - De - - - To - à - - - Type - Type - - - linear - Linéaire - - - logarithmic - logarithmique - - - Major Ticks - Graduations principales - - - MinorTicks - Graduations secondaires - - - &Scale - &Echelle - - - Title - Titre - - - Axis Font - Police - - - &Choose font - Modifiez - - - Major Ticks Length - Longueur des graduations principales - - - Minor Ticks Length - Longueur des graduations secondaires - - - &Axis - &Axes - - - &Color - &Couleur - - - &Font - &Police - - - &Title - &Titre - - - Data - Données - - - Ma&x - Ma&x - - - &Min - &Min - - - General - Général - - - &Line - &Ligne - - - &Background - &Arrière plan - - - Coordinate System - Coordonnées système - - - &Axes - &Axes - - - Lab&els - &Etiquettes - - - &Numbers - &Nombres - - - &Grid - &Grille - - - Opacity - Opacité - - - &Colors - &Couleurs - - - Line Width - Epaisseur des lignes - - - Resolution - Résolution - - - Numbers Font - Police des nombres - - - &Choose Font - Modifiez - - - Distance labels - axis - Distance étiquettes - axes - - - Zoom (%) - Zoom (%) - - - X Zoom (%) - Zoom en X (%) - - - Y Zoom (%) - Zoom en Y (%) - - - Z Zoom (%) - Zoom en Z (%) - - - &General - &Général - - - &Worksheet - &Feuille de calcul - - - &Apply - &Appliquer - - - &OK - &OK - - - &Cancel - &Annuler - - - Style - Style - - - Dot - Point - - - Cross Hair - Lignes croisées - - - Cone - Cône - - - Width - Largeur - - - Smooth angles - Angles arrondis - - - Radius - Rayon - - - Smooth line - Affinée - - - Boxed - Boites 3D - - - Quality - Qualité - - - Points - Points - - - Bars - Barres - - - QtiPlot - Start limit error - Qtiplot - Erreur maximale au début - - - QtiPlot - End limit error - Qtiplot - Erreur maximale à la fin - - - QtiPlot - Input error - Qtiplot - Erreur: entrée incorrecte - - - Please enter scale limits that satisfy: from < to! - Donnez des limites d'échelle dans l'ordre croissant ! - - - Color Ma&p - Carte de couleurs - - - Colormap files - Fichiers de cartes de couleurs - - - - plotDialog - - QtiPlot - Custom plot - Qtiplot - Graphe défini par l'utilisateur - - - Plot type - Type de graphe - - - Line - Lignes - - - Scatter - Nuage de Points - - - Line + Symbol - Lignes + Symboles - - - Vertical Bars - Barres Verticales - - - Horizontal Bars - Barres Horizontales - - - Histogram - Histogramme - - - Vector XYXY - Vecteurs XYXY - - - Error Bars - Barres d'erreurs - - - &Plot Associations... - Matrice de Graphes... - - - &Worksheet - Feuille de calcul - - - &Apply - &Appliquer - - - &OK - &OK - - - &Cancel - &Annuler - - - QtiPlot - Error - Qtiplot - Erreur - - - Connect - Style - - - Style - Motif - - - Width - Epaisseur - - - Color - Couleur - - - Fill color - Couleur de remplissage - - - Pattern - Texture - - - Pen Color - Contour du symbole - - - Fill Color - Remplissage - - - Size - Taille - - - Symbol - Symbole - - - Direction - Direction - - - Plus - Plus - - - Minus - Moins - - - &X Error Bar - Barres d'erreur en abscisses - - - Co&lor - Cou&leur - - - Line Width - Epaisseur de ligne - - - 1 - 1 - - - 2 - 2 - - - 3 - 3 - - - 4 - 4 - - - 5 - 5 - - - Cap Width - Largeur ??? - - - 8 - 8 - - - 10 - 10 - - - 12 - 12 - - - 16 - 16 - - - 20 - 20 - - - Through Symbol - A travers le symbole - - - Automatic Binning - Échantillonage automatique - - - &Show statistics - Afficher les &Statistiques - - - Bin Size - Période d'échantillonnage - - - Begin - Début - - - End - Fin - - - Histogram Data - Données de l'Histogramme - - - Gap Between Bars (in %) - Ecart entre les barres (en %) - - - Spacing - Espacement - - - Arrowheads - Têtes des flêches - - - Length - Longueur - - - Angle - Angle - - - &Filled - Pleines - - - End Point - Point Final - - - X End - Fin en X - - - Y End - Fin en Y - - - Vector - Vecteur - - - &Edit Function... - Modifi&er... - - - No line - Aucune ligne - - - Lines - Lignes - - - Sticks - Batons - - - Steps - Marches - - - Dots - Points - - - Spline - Interpolation - - - Fill area under curve - Remplir l'aire sous la courbe - - - Ellipse - Ellipse - - - Rectangle - Rectangle - - - Diamond - Diamant - - - Up Triangle - Triangle /\ - - - Down Triangle - Triangle \/ - - - Left Triangle - Triangle < - - - Right Triangle - Triangle > - - - Cross - Croix + - - - Diagonal Cross - Croix x - - - Offset (in %) - Décalage (en %) - - - QtiPlot - Custom curves - QtiPlot - Courbes définies par l'utilisateur - - - Pen - Stylo - - - &Delete - &Supprimer - - - &Edit... - &Edition... - - - QtiPlot - Input error - QtiPlot - Erreur lors de l'entrée des paramètres - - - Please enter a valid start limit! - Donnez une valeur de départ correcte ! - - - Please enter a valid end limit! - Donnez une valeur d'arrêt correcte ! - - - Please enter a valid bin size value! - Donnez une taille d'échantillonnage valide ! - - - Please enter limits that satisfy: begin < end! - Veuillez entrer un domaine pour les abscisses tel que le début soit inférieur à la fin ! - - - QtiPlot - Bin size input error - QtiPlot - Erreur de la taille des échantillons - - - Please enter a positive bin size value! - Donnez une valeur positive de la taille des échantillons ! - - - Edge Color - Couleur du bord - - - Edge Width - Largeur du bord - - - Box - Boîte - - - Type - Type - - - No Box - Aucune boîte - - - Perc 10, 25, 75, 90 - 10, 25, 75, 90 % - - - Notch - Réjecteur - - - Range - Gamme - - - Standard Deviation - Ecart type - - - Standard Error - Erreur type - - - Perc 25, 75 - 25, 75 % - - - Perc 10, 90 - 10, 90 % - - - Perc 5, 95 - 5, 95 % - - - Perc 1, 99 - 1, 99 % - - - Max-Min - Max-Min - - - Constant - Constante - - - Percentile (%) - Pourcentage (%) - - - Coef - Coefficient - - - Box Width - Largeur de boîte - - - Whiskers - Whiskers - - - No Whiskers - Sans Whiskers - - - 75-25 - 75-25 - - - 90-10 - 90-10 - - - 95-5 - 95-5 - - - 99-1 - 99-1 - - - Box/Whiskers - Boîte / Whiskers - - - Max - Max - - - 99% - 99 % - - - Mean - Moyenne - - - 1% - 1 % - - - Min - Min - - - Percentile - Pourcentage - - - Position - Position - - - Tail - Queue - - - Middle - Milieu - - - Head - Tête - - - Vector XYAM - Vecteur XYAM - - - Vector Data - Vecteur Donnée - - - Magnitude - Amplitude - - - Attach curve to: - Associé à la courbe à : - - - x Axis - Axe X - - - Bottom - Inférieur - - - Top - Supérieur - - - y Axis - Axe Y - - - Left - Gauche - - - Right - Droite - - - Axes - Axes - - - Horizontal Steps - Marches horizontaux - - - Vertical Steps - Marches verticales - - - Image - Image - - - &Gray Scale - Échelle de &gris - - - &Default Colors - Couleurs par &défault - - - Custom Co&lors - Couleurs personnalisées - - - Contour Lines - Lignes du contour - - - Levels - Niveaux - - - Use &Color Map - Utiliser la &carte des couleurs - - - Use Default &Pen - Utiliser la crayon par défault - - - Color Bar Scale - Échelle des barres de couleurs - - - Axis - Axe - - - Contour - Contour - - - Colors - Couleurs - - - - plotWizard - - Worksheet - Feuille de travail - - - QtiPlot - Select Columns to Plot - Qtiplot - Sélectionnez les colonnes à tracer - - - &New curve - &Nouvelle courbe - - - &Delete curve - Supprimer une courbe - - - &Plot - Tracer - - - &Cancel - &Annuler - - - QtiPlot - Warning - Qtiplot - Avertissement - - - Redefinitions of the same curve are ignored! - Les redéfinitions de la même courbe sont ignorées ! - - - QtiPlot - Error - Qtiplot - Erreur - - - You have allready defined a X column! - Vous avez déjà défini une colonne pour les X ! - - - You must define a X column first! - Vous devez définir une colonne pour les X ! - - - You have allready defined a Y column! - Vous avez déjà défini une colonne pour les Y ! - - - This kind of curve is not handled by QtiPlot! - Ce type de courbe n'est pas géré par Qtiplot ! - - - You have allready defined a Z column! - Vous avez déjà défini une colonne pour les Z ! - - - You must define a Y column first! - Vous devez définir une colonne pour les Y ! - - - You have allready defined an error-bars column! - Vous avez déjà défini une colonne pour les barres d'erreur ! - - - You must add a new curve first! - Vous devez d'abord définir une nouvelle courbe ! - - - - polynomFitDialog - - QtiPlot - Polynomial Fit Options - Qtiplot - Options pour l'ajustement polynomial - - - Polynomial Fit of - Ajustement de - - - Order (1 - 9, 1 = linear) - Ordre (1 - 9, 1 = linéaire) - - - Fit curve # pts - Points - - - Fit curve Xmin - Xmin = - - - 0 - 0 - - - Fit curve Xmax - Xmax = - - - Show Formula on Graph? - Afficher la formule ? - - - &OK - &OK - - - &Cancel - &Annule - - - &Fit - &Calculer - - - &Close - Fermer - - - Color - Couleur - - - Not enough points - Nombre de points insuffisants - - - You can not fit curve: - Vous ne pouvez pas ajuster l'index : - - - because it has less than 2 points! - Parce qu'il a moins de 2 points ! - - - QtiPlot - Warning - QtiPlot - Avertissement - - - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - La courbe <b> %1 </b> n'existe plus ! Opération annulée ! - - - You cannot fit curve: - Vous ne pouvez pas ajuster la courbe : - - - - renameWindowDialog - - QtiPlot - Rename Window - Qtiplot - Renommer la Fenêtre - - - Window Title - Titre de la fenêtre - - - &Name (single word) - &Nom (un seul mot) - - - &Label - &Etiquette - - - &Both Name and Label - Nom et Etiquette - - - &OK - &OK - - - &Cancel - &Annuler - - - QtiPlot - Error - Qtiplot - Erreur - - - QtiPlot - Warning - QtiPlot - Avertissement - - - For internal consistency reasons the underscore character is replaced with a minus sign. - Pour des raisons d'uniformité, le trait souligné (_) est remplacé par le signe moins (-). - - - - sDialog - - QtiPlot - Define surface plot - Qtiplot - Définition d'un graphe de surface - - - f(x,y)= - f(x,y) = - - - X - axis - Axe des X - - - From - De - - - -1 - -1 - - - To - à - - - 1 - 1 - - - Y - axis - Axe des Y - - - Z - axis - Axe des Z - - - Clear &list - Effacer la &liste - - - &OK - &OK - - - &Cancel - &Annuler - - - QtiPlot - X Start limit error - Qtiplot - Valeur de X initial erronée - - - QtiPlot - X End limit error - Qtiplot - Valeur de X final erronée - - - QtiPlot - Y Start limit error - Qtiplot - Valeur de Y initial erronée - - - QtiPlot - Y End limit error - Qtiplot - Valeur de Y final erronée - - - QtiPlot - Z Start limit error - Qtiplot - Valeur de Z initial erronée - - - QtiPlot - Z End limit error - Qtiplot - Valeur de Z final erronée - - - QtiPlot - Input error - Qtiplot - Erreur lors de l'entrée - - - Please enter limits that satisfy: from < end! - Veuillez entrer un domaine pour les abscisses tel que le début soit inférieur à la fin ! - - - QtiPlot - Input function error - Qtiplot - Fonction entrée incorrecte - - - - setColValuesDialog - - QtiPlot - Set column values - Qtiplot - Propriétés de la colonne - - - For row (i) - Pour la rangée (i) - - - to - à - - - Add function - Ajouter la fonction - - - Add column - Ajouter la colonne - - - Add cell - Ajouter la cellule - - - OK - OK - - - Apply - Appliquer - - - Cancel - &Annuler - - - QtiPlot - Input function error - Qtiplot - Erreur lors de l'entrée de la fonction - - - You can not use imbricated columns! - Vous ne pouvez pas utilisez des colonnes imbriqués ! - - - - smoothCurveDialog - - QtiPlot - Smoothing Options - QtiPlot - Options de lissage - - - Curve - Courbe - - - Polynomial Order - Ordre - - - Points to the Left - Points à gauche - - - Points to the Right - Points à droite - - - Points - Points - - - Color - Couleur - - - &Smooth - &Calculer - - - &Close - Fermer - - - - sortDialog - - QtiPlot - Sorting Options - Qtiplot - Options pour le Tri - - - Sort columns - Trier les Colonnes - - - Order - Ordre - - - Leading column - Colonne triée - - - &OK - &OK - - - &Cancel - &Annuler - - - Separately - Séparement - - - Together - Ensemble - - - Ascending - &Croissant - - - Descending - &Décroissant - - - - symbolDialog - - QtiPlot - Choose Symbol - QtiPlot - Choisir le Symbole - - - - tableDialog - - Enumerate all to the right - Énumérer les colonnes à partir de la droite - - - Apply - Appliquer - - - Options - Propriétés - - - Display - Affichage : - - - X (abscissae) - X (abscisses) - - - Y (ordinates) - Y (ordonnées) - - - None - Aucun - - - Numeric - Numérique - - - Text - Texte - - - Date - Date - - - Time - Temps - - - Month - Mois - - - Day of Week - Jour de la semaine - - - Apply to all columns to the right - Appliquer à toutes les colonnes vers la droite - - - Decimal: 1000 - Décimal : 1000 - - - Scientific: 1E3 - Scientifique : 1E3 - - - yyyy-MM-dd - aaaa-MM-jj - - - dd.MM.yyyy - jj.MM.aaaa - - - ddd MMMM d yy - jjj MMMM j aa - - - dd/MM/yyyy - jj/MM/aaaa - - - h - h - - - h ap - h ap - - - h AP - h AP - - - h:mm - h:mm - - - h:mm ap - h:mm ap - - - hh:mm - hh:mm - - - h:mm:ss - h:mm:ss - - - h:mm:ss.zzz - h:mm:ss.mmm - - - mm:ss - mm:ss - - - mm:ss.zzz - mm:ss.mmm - - - hmm - hmm - - - hmmss - hmmss - - - hhmmss - hhmmss - - - QtiPlot - Column options - QtiPlot - Propriétés de la colonne - - - &Cancel - &Annuler - - - &OK - &OK - - - Default - Par défaut - - - Set Decimal Places= - Nombre de Décimales - - - Apply to all - Appliquer à toutes - - - Column Name: - Nom de colonne : - - - Plot Designation: - Nom du graphe : - - - Format: - Format : - - - Numeric Display: - Affichage des Nombres : - - - Column Width: - largeur de colonne : - - - Comment: - Commentaire : - - - &Apply - &Appliquer - - - Precision: - Précision : - - - Z (height) - Z (hauteur) - - - QtiPlot - Error - QtiPlot - Erreur - - - The column names must only contain letters and digits! - Les noms de colonnes doivent seulement contenir des lettres et des chiffres ! - - - X Error - Erreur en X - - - Y Error - Erreur en Y - - - QtiPlot - Warning - QtiPlot - Avertissement - - - For internal consistency reasons the underscore character is replaced with a minus sign. - Pour des raisons d'uniformité, le trait souligné (_) est remplacé par le signe moins (-). - - - - textDialog - - QtiPlot - Text Dialog - QtiPlot - Propriétés du Texte - - - Title Color - Couleur du titre - - - &OK - &OK - - - Title Font - Police du titre - - - &Font - Modifier - - - &Apply - &Appliquer - - - Alignement - Alignement - - - Center - Centré - - - Left - Gauche - - - Right - Droite - - - &Cancel - &Annuler - - - Co&lor - Modifier - - - - textDlg - - QtiPlot - Text options - QtiPlot - Options du Texte - - - Color - Couleur - - - &OK - &OK - - - Background - Arrière Plan - - - None - Aucun - - - Rectangle - Rectangle - - - Shadow - Ombré - - - &Apply - &Appliquer - - - &Font - &Police - - - &Cancel - &Annuler - - - Rotate (deg.) - Rotation (deg.) - - - 0 - 0 - - - 45 - 45 - - - 90 - 90 - - - 135 - 135 - - - 180 - 180 - - - 225 - 225 - - - 270 - 270 - - - 315 - 315 - - - Co&lor - Cou&leur - - - Frame - Cadre - - - Font - Police - - - &Background - &Arrière Plan + SUM() works only on tables! + SUM() ne fonctionne qu'avec des tables ! + + + AVG() works only on tables! + AVG() ne fonctionne qu'avec des tables ! === modified file 'qtiplot/translations/qtiplot_ja.ts' --- qtiplot/translations/qtiplot_ja.ts 2009-12-08 18:06:27 +0000 +++ qtiplot/translations/qtiplot_ja.ts 2010-07-21 23:21:08 +0000 @@ -2,6 +2,209 @@ + + + &All + 全て(&A) + + + Special Line/Symb&ol + 特殊な直線/シンボル + + + Statistical &Graphs + 統計用グラフ(&G) + + + Pa&nel + パネル(&n) + + + &Data + データ(&D) + + + &Print + 印刷(&P) + + + New &Project + 新規プロジェクト(&N) + + + New &Table + 新規テーブル(&T) + + + &Open + 開く(&O) + + + &Save Project + プロジェクトの保存(&S) + + + &Undo + 元に戻す(&U) + + + &Redo + やり直す(&R) + + + Add La&yer + レイヤーの追加(&Y) + + + &Current + 現在の物のみ(&C) + + + &Quit + 終了(&Q) + + + &Preferences... + 設定...(&P) + + + New &Legend + 新規凡例(&L) + + + Add &Image + 画像の追加(&I) + + + &Line + 直線(&L) + + + &Scatter + 点のみ(&S) + + + Line + S&ymbol + 直線+点(&Y) + + + &Spline + スプライン(&S) + + + &Columns + 縦の棒グラフ(&C) + + + &Rows + 横の棒グラフ(&R) + + + &Area + 積み上げ面グラフ(&A) + + + &Pie + 円グラフ(&P) + + + &Histogram + ヒストグラム(&H) + + + &Vertical 2 Layers + 上下2段レイヤー(&V) + + + &Horizontal 2 Layers + 左右2段レイヤー(&H) + + + &4 Layers + &4レイヤー + + + &Ribbon + リボン(&R) + + + &Bars + 縦棒(&B) + + + &Trajectory + 軌跡(&T) + + + Statistics on &Columns + 列に関する統計(&C) + + + Statistics on &Rows + 行に関する統計(&R) + + + &Differentiate + 微分(&D) + + + Fit &Linear + 直線フィッティング(&L) + + + Fit &Polynomial ... + 多項式フィッティング...(&P) + + + &First Order ... + 一次...(&F) + + + &Second Order ... + 二次...(&S) + + + &Third Order ... + 三次...(&T) + + + Fit &Gaussian + ガウシアンフィッティング(&G) + + + Fit Lorent&zian + ローレシアンフィッティング(&Z) + + + &Plot ... + プロット...(&P) + + + &Title ... + タイトル...(&T) + + + &Columns... + 列...(&C) + + + &Rows... + 行...(&R) + + + &Help + ヘルプ(&H) + + + Results &Log + 結果ログ(&L) + + + Add &Text + テキストの追加(&T) + + + @default New &Project @@ -195,23 +398,18 @@ AddWidgetTool - Click on plot to choose the position of the new object! - - enter your text here - Move cursor in order to resize the new rectangle! - Move cursor in order to resize the new ellipse! @@ -219,1705 +417,122 @@ ApplicationWindow - - File - - Plot - - - - - - - - Table - - Data Display - &File ファイル(&F) - - - - New &Project - 新規プロジェクト(&N) - - - - - New &Table - 新規テーブル(&T) - - - - &New - 新規作成(&N) - - - - - &Open - 開く(&O) - - - Open image &file - 画像を開く(&F) - - - &Recent projects - 最近開いたプロジェクト(&R) - - - - - &Save Project - プロジェクトの保存(&S) - - - Save Project &as... - プロジェクトを名前を付けて保存...(&A) - - - - - &Current - 現在の物のみ(&C) - - - - - - &All - 全て(&A) - - - - &Export Graph - グラフのエクスポート(&E) - - - - - - &Print - 印刷(&P) - - - &Single file... - 単一ファイル...(&S) - - - &Multiple files... - 複数ファイル...(&M) - - - Set import &options - インポートオプション(&O) - - - &Import ASCII - ASCIIデータのインポート(&I) - - - - - &Quit - 終了(&Q) - - - - - &Undo - 元に戻す(&U) - - - - - &Redo - やり直す(&R) - - - Cu&t selection - 選択範囲の切り取り(&T) - - - &Copy selection - 選択範囲のコピー(&C) - - - &Paste selection - 選択範囲の貼り付け(&P) - - - &Delete selection - 選択範囲の削除(&D) - - - Clear &log informations - ログの削除(&L) - - - - &Edit - 編集(&E) - - - Plot &wizard - プロットウィザード(&W) - - - Project &explorer - プロジェクトエクスプローラー(&E) - - - - Results &Log - 結果ログ(&L) - - - - - &Preferences... - 設定...(&P) - - - - &View - 表示(&V) - - - &Add/Remove curve - 曲線の追加/削除(&A) - - - Add &Error Bars - エラーバーの追加(&E) - - - Add &function curve - 関数曲線の追加(&F) - - - &Rescale to show all - 全体表示可能にリサイズ(&R) - - - - - New &Legend - 新規凡例(&L) - - - - - Add &Image - 画像の追加(&I) - - - - - Add &Text - テキストの追加(&T) - - - &Draw arrow/line - 矢印/直線の描画(&D) - - - - - Add La&yer - レイヤーの追加(&Y) - - - Delete Layer - レイヤーの削除 - - - Arran&ge/Custom Layers - レイヤーの整列/調節(&G) - - - - &Graph - グラフ(&G) - - - - - &Line - 直線(&L) - - - - - - - &Scatter - 点のみ(&S) - - - - - Line + S&ymbol - 直線+点(&Y) - - - - - &Spline - スプライン(&S) - - - - - &Vertical Steps - - - - - - - Special Line/Symb&ol - 特殊な直線/シンボル - - - - - - - &Columns - 縦の棒グラフ(&C) - - - - - &Rows - 横の棒グラフ(&R) - - - - - &Area - 積み上げ面グラフ(&A) - - - - - &Pie - 円グラフ(&P) - - - - - &Histogram - ヒストグラム(&H) - - - - - - Statistical &Graphs - 統計用グラフ(&G) - - - - - &Vertical 2 Layers - 上下2段レイヤー(&V) - - - - - &Horizontal 2 Layers - 左右2段レイヤー(&H) - - - - - &4 Layers - &4レイヤー - - - - - &Stacked Layers - - - - - - Pa&nel - パネル(&n) - - - &Plot 2D - 2Dプロット(&P) - - - - - &Ribbon - リボン(&R) - - - - - &Bars - 縦棒(&B) - - - - - &Trajectory - 軌跡(&T) - - - Plot &3D - &3Dプロット - - - &Move data points - データ点を移動する(&M) - - - Remove &bad data points - 邪魔なデータ点を削除(&B) - - - - - &Data - データ(&D) - - - - - Statistics on &Columns - 列に関する統計(&C) - - - - - Statistics on &Rows - 行に関する統計(&R) - - - &Integrate ... - 積分...(&I) - - - Li&near - 直線(&N) - - - Cu&bic spline - 三次スプライン(&B) - - - Inter&polate - 補間(&P) - - - &Forward - 順変換(&F) - - - &Inverse - 逆変換(&I) - - - &FFT - &FFT - - - - - &Differentiate - 微分(&D) - - - - - Fit &Linear - 直線フィッティング(&L) - - - - - Fit &Polynomial ... - 多項式フィッティング...(&P) - - - - - &First Order ... - 一次...(&F) - - - - - &Second Order ... - 二次...(&S) - - - - - &Third Order ... - 三次...(&T) - - - - Fit E&xponential Decay - 指数減衰フィッティング(&X) - - - Fit Exponential Gro&wth - 指数増加フィッティング(&W) - - - - - Fit &Gaussian - ガウシアンフィッティング(&G) - - - - - Fit Lorent&zian - ローレシアンフィッティング(&Z) - - - &Non-linear Curve Fit ... - 非線形曲線フィッティング...(&N) - - - - &Analysis - 分析(&A) - - - - - &Plot ... - プロット...(&P) - - - &Axes ... - 軸...(&A) - - - - - &Title ... - タイトル...(&T) - - - Column &options ... - 列のオプション...(&O) - - - &Set column values ... - 列の値を変換(&S) - - - - - &Columns... - 列...(&C) - - - - - &Rows... - 行...(&R) - - - For&mat - フォーマット(&M) - - - - &Windows - ウィンドウ(&W) - - - - - - &Help - ヘルプ(&H) - - - &About - このソフトについて(&A) - - - - - <h4>There are no tables available in this project.</h4><p><h4>Please create a table and try again!</h4> - - - - - - - QtiPlot - Choose data set - - - - - - - - - - - - - - - - - - - - - <h4>There are no plot layers available in this window.</h4><p><h4>Please add a layer and try again!</h4> - - - - - QtiPlot - File Open Error - - - - - <h4>There are no plot layers available in this window!</h4> - - - - - - A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? - - - - - - &Yes - - - - - - - &Cancel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QtiPlot - Error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QtiPlot - Warning - - - - - Not available for empty 3D surface plots! - - - - - - - - <h4>There are no plot layers available in this window.</h4> - - - - - QtiPlot - Duplicate error - - - - - QtiPlot - Duplicate window error - - - - - About QtiPlot - - - - - QtiPlot - Guess best origin for the new layer? - - - - - Do you want QtiPlot to guess the best position for the new layer? - Warning: this will rearrange existing layers! - - - - - &Guess - - - - - &Top-left corner - - - - - &Matrix - - - - - - QtiPlot - Choose matrix to plot - - - - - QtiPlot - Import image from file - - - - - QtiPlot - Load image from file - - - - - - - - - - - - Matrix - - - - - Normal - - - - - QtiPlot - Error bars error - - - - - - This feature is not available for user defined function curves! - - - - - Sorry, there are no results to display! - - - - - &Intensity Matrix - - - - - &Cut - - - - - - - - - - - - &Copy - - - - - - - - - &Delete - - - - - - - - &Properties - - - - - Please use the project explorer to select a window! - - - - - QtiPlot - index.html File Not Found! - - - - - There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! - - - - - - Ctrl+N - - - - - - Ctrl+T - - - - - - New &Matrix - - - - - - New &Function Plot - - - - - - Ctrl+F - - - - - - Ctrl+Z - - - - - - Ctrl+O - - - - - - Ctrl+I - - - - - - Ctrl+S - - - - - - &Duplicate - - - - - - Ctrl+X - - - - - - Ctrl+C - - - - - - Ctrl+V - - - - - - Ctrl+E - - - - - - Ctrl+G - - - - - - Alt+X - - - - - - Ctrl+P - - - - - - E&xport ASCII - - - - - - Ctrl+Q - - - - - - Ctrl+Alt+W - - - - - - Ctrl+B - - - - - - - - Ctrl+Alt+F - - - - - - Ctrl+L - - - - - &Vectors &XYXY - - - - - - &Stacked Histogram - - - - - - Ctrl+M - - - - - - Alt+R - - - - - - Ctrl+Y - - - - - - F1 - - - - - - Ctrl+H - - - - - - - &Rename Window - - - - - - - Close &Window - - - - - - Ctrl+W - - - - - - Window &Geometry... - - - - - - - - &Hide Window - - - - - - More windows... - - - - - - &Activate Window - - - - - - Mi&nimize Window - - - - - - Ma&ximize Window - - - - - - Re&size Window... - - - - - &Print Window - - - - - - Set &Properties... - - - - - - Set &Dimensions... - - - - - - Set &Values... - - - - - - &Transpose - - - - - - &Invert - - - - - - &Determinant - - - - - - 3D &Wire Frame - - - - - - 3D &Hidden Line - - - - - - 3D &Polygons - - - - - - 3D Wire &Surface - - - - - - There are no curves available on this plot! - - - - - - QtiPlot - untitled - - - - - - Project Explorer - - - - - - - Folder - - - - - UNTITLED - - - - - - Name - - - - - - - - - - - - - Type - - - - - - View - - - - - - - - - Size - - - - - - - - - - Created - - - - - - - Label - - - - - - Results Log - - - - - - Scripting Console - - - - - &Next - next window - - - - - F5 - next window shortcut - - - - - &Previous - previous window - - - - - F6 - previous window shortcut - - - - - - Edit - - - - - Disable &Tools - - - - - - &Zoom In - - - - - - Ctrl++ - - - - - &Zoom Out - - - - - - Ctrl+- - - - - - - &Data Reader - - - - - - CTRL+D - - - - - - &Select Data Range - - - - - - ALT+S - - - - - - S&creen Reader - - - - - - &Move Data Points... - - - - - - Ctrl+ALT+M - - - - - - Remove &Bad Data Points... - - - - - - Alt+B - - - - - - ALT+T - - - - - - Draw &Arrow - - - - - - CTRL+ALT+A - - - - - - Draw &Line - - - - - - CTRL+ALT+L - - - - - - Matrix Plot - - - - - QtiPlot - Script Window - - - - - - 3D Surface - - - - - - &Recent Projects - - - - - 3&D Plot - - - - - - - &Normalize - - - - - Set Columns &As - - - - - - &Fill Columns With - - - - - &Translate - - - - - &Smooth - - - - - &FFT filter - - - - - Fit &Multi-peak - - - - - - - &Plot - - - - - - - &Table - - - - - - 3D &Plot - - - - - - - - - - - QtiPlot - Plot error - - - - - - - - - You must select exactly one column for plotting! - - - - - There are no available columns with plot designation set to Z! - - - - - - - - - - - - Column - - - - - <h4>There are no matrices available in this project.</h4><p><h4>Please create a matrix and try again!</h4> - - - - - - - - - - - - - - - - - - Graph - - - - - Images - - - - - - - Please select a Y column to plot! - - - - - - QtiPlot - Renamed Window - - - - - - The table '%1' already exists. It has been renamed '%2'. - - - - - - - Notes - - - - - Determinant of - - - - - - - - - - - - - - This functionality is not available for pie plots! - - - - - The selected columns have different numbers of rows! - - - - - The selected error column is empty! - - - - - - QtiPlot project - - - - - - Compressed QtiPlot project - - - - - - - - - - + Couldn't open file %1 + + + + Open Excel File + + + + Imported sound file + + + + This is not a PCM type WAV file, operation aborted! + + + + PCM + + + + Time + + + + Left + + + + Right + + + + Data + + + + Channels + + + + Sample Rate + + + + Byte Rate + + + + Block Align + + + + Bits Per Sample + + + QtiPlot - File openning error - The file: <b>%1</b> is the current file! - - - - The file: <b>%1</b> doesn't exist! - - - - - - - - + You don't have the permission to open this file: <b>%1</b> + + + QtiPlot - File opening error - The file <b>%1</b> is corrupted, but there exists a backup copy.<br>Do you want to open the backup instead? - - The file: <b> %1 </b> was not created using QtiPlot! - + The file: <p><b> %1 </b><p> is the current file! + + + + QtiPlot - File Open Error + + + The file: <b> %1 </b> <p>does not exist anymore!<p>It will be removed from the list. - - The file: <p><b> %1 </b><p> is the current file! - - - - - - - - - - - - - - - - - - - - - - QtiPlot - - - - The file "%1" was created using "%2" as scripting language. Initializing support for this language FAILED; I'm using "%3" instead. @@ -1925,3783 +540,3862 @@ - Window - QtiPlot - Opening file - Script Error - QtiPlot - Scripting Error - Scripting language "%1" failed to initialize. - QtiPlot - Open Template File - + The file: <b>%1</b> is not a QtiPlot template file! + + + Table1 - - The file: <b>%1</b> is not a QtiPlot template file! - - - - - - - - - - - QtiPlot - Export error - - - - - - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - - - - + QtiPlot - Export Error + + + + <h4>There are no plot layers available in this window!</h4> + + + + Presentation Preview + + + + &Save + + + + &Cancel + + + Choose a directory to export the graphs to - - + Output format: + + + + Directory: + + + + There are no plot layers available in window <b>%1</b>.<br>Graph window not exported! + + + + A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? + + + QtiPlot - Overwrite file? - + QtiPlot - Export error + + + Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! - Minimized - - - Maximized - - - - + QtiPlot project + + + + Compressed QtiPlot project + + + Save Project As - QtiPlot Matrix Template - QtiPlot 2D Graph Template - QtiPlot Table Template - QtiPlot 3D Surface Template - Save Window As Template - - + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + + + Please enter a valid name! - The name you chose is not valid: only letters and digits are allowed! - - - Please choose another name! - Name <b>%1</b> already exists! - Warning: for internal consistency reasons the underscore character is replaced with a minus sign. - - Choose a filename to save under + &Yes - QtiPlot - Enter rows number - Rows - + QtiPlot - Delete rows + + + + Start row + + + + End row + + + QtiPlot - Enter columns number - Columns - - - - - - - - - - - - - QtiPlot - Column selection error - - - - - - - - Please select a column first! - Please select two columns for this operation! - Please select exactly one columns for this operation! - - Please select two columns for this operation: the first represents the signal and the second the response function! - QtiPlot - Row selection error - Please select a row first! - - - Vertical &Drop Lines - - - - - - &Horizontal Steps - - - - - - - - - Cu&t - - + &Copy + + + Past&e - - + &X + + + + &Y + + + + &Z + + + + &Label + + + + &None + + + + X E&rror + + + + Y &Error + + + Set As - &Fill Column With - &Column - - - - Clea&r - - + &Delete + + + &Insert - &Ascending - &Descending - Sort Colu&mn - - - &Worksheet - - - - - + You need to select at least one Y column for this operation! + + + + You need at least two columns for this operation! + + + + Y2 Axis Title + + + + Not available for empty 3D surface plots! + + + + Set Display Range + + + + <h4>There are no plot layers available in this window.</h4> + + + This will modify the data in the worksheets! Are you sure you want to continue? - - Continue - - - Cancel - + Choose a filename to save under + + + Could not write to file: <h4>%1</h4><p>Please verify that you have the right to write to this location or that the file is not being used by another application! - + Print preview of window: + + + + Please select a 'Y' column first! + + + + Sorry, there are no results to display! + + + There are no plot layers available in this window! - + There are no layers available on this plot. Operation aborted! + + + QtiPlot - Insert image from file - There are no plot layers available in this window. - + QtiPlot - Duplicate window error + + + + There are no windows available in this folder! + + + + QtiPlot - Duplicate error + + + Empty 3D surface plots cannot be duplicated! - - Released - + About QtiPlot + + + + &Translate + + + + Vie&w + + + + &Palette + + + + &Convert to Spreadsheet + + + + Export + + + + &Folders + + + &Cascade - &Tile - - - - + Close &Window + + + + More windows... + + + + &View Pixel Line profile + + + + &Intensity Matrix + + + + &Cut + + + &Properties... - + Please use the project explorer to select a window! + + + + Normal + + + Save changes to project: <p><b> %1 </b> ? - - - Yes - - - - - - No - - - - - - + &Show All Windows + + + + &Hide All Windows + + + &Delete Selection - - New &Window - - New F&older - Auto &Column Width - + File %1 contains only %2 sheets! + + + + Paste Selection as Te&xt + + + &Delete Window - + &Rename Window + + + + &Print Window + + + D&epending Graphs - D&epending 3D Graphs - - - D&epends on - Function - + Maximized + + + Re&move Pie Curve - + &Add + + + Anal&yze - - + &Gray Scale + + + + &Indexed Colors + + + + Pale&tte + + + + &Layer + + + + &Window + + + &Paste Layer - &Paste Text - + &Paste Tex Formula + + + + &Paste Image + + + + &Paste Rectangle + + + + &Paste Ellipse + + + &Paste Line/Arrow - - &Paste Image - - - - - - - &Layer - - - - - - - &Window - - - - E&xport - P&roperties... - &Copy Page - E&xport Page - &Matrix... - Choose &Data Set... - Choose &Matrix... - C&lear - &Copy Graph - &Export - - - - &Paste - - &Insert Row - &Insert Column - - &Delete Rows - &Delete Columns - &Delete Row - Clea&r Row - Clea&r Rows - Choose the location of the QtiPlot help folder! - - - + QtiPlot - index.html File Not Found! + + + + There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! + + + QtiPlot - Help Files Not Found! - - The manual can be downloaded from the following internet address: - - QtiPlot - Help Profile Not Found! - - The assistant could not start because the file <b>%1</b> was not found in the help file directory! - - This file is provided with the QtiPlot manual which can be downloaded from the following internet address: - Please indicate the location of the help file! - QtiPlot - Edit function - QtiPlot - Set the number of pixels to average - Number of averaged pixels - + You must have more than one layer in the active window! + + + + You must have more than one dataset in the active layer! + + + + QtiPlot - Guess best origin for the new layer? + + + + Do you want QtiPlot to guess the best position for the new layer? + Warning: this will rearrange existing layers! + + + + &Guess + + + + &Top-left corner + + + Curve - - + Integration of %1 from zero is + + + + Integration of %1 + + + + Area + + + + Linear Regression of %1 + + + + Slope + + + + Intercept + + + + Chi^2 + + + + R^2 + + + + Add &Custom Script Action... + + + + New &Project + 新規プロジェクト(&N) + + + Ctrl+N + + + + App&end Project... + + + New &Graph - - + Ctrl+G + + + New &Note - - - New 3D &Surface Plot - - - - - - Ctrl+ALT+Z - - - - - - Open Image &File - - - - - - Import I&mage... - - - - - - Save Project &As... - - - - - Open Temp&late... - - - - - - Save As &Template... - - - - - Save Note As... - - - - - - Cu&t Selection - - - - - - &Copy Selection - - - - - - &Paste Selection - - - - - - Del - delete key - - - - - - ALT+L - - - - - - Arran&ge Layers - - - - - - - Automatic Layout - - - - - - &Export PDF - - - - - - Ctrl+Alt+P - - - - - - Print All Plo&ts - - - - - - Clear &Log Information - - - - - - Delete &Fit Tables - - - - - - Plot &Wizard - - - - - - Add/Remove &Curve... - - - - - - ALT+C - - - - - - Add &Error Bars... - - - - - - Add &Function... - - - - - - &Rescale to Show All - - - - - - - Ctrl+Shift+R - - - - - - Add Time Stamp - - - - - - Ctrl+ALT+T - - - - - - ALT+I - - - - - - Vectors XY&AM - - - - - - Inte&rpolate ... - - - - - - &Low Pass... - - - - - - &High Pass... - - - - - - &Band Pass... - - - - - - &Band Block... - - - - - - &FFT... - - - - - - &Savitzky-Golay... - - - - - - &FFT Filter... - - - - - - Moving Window &Average... - - - - - - Fit Exponential Gro&wth ... - - - - - - Fit &Boltzmann (Sigmoidal) - - - - - + New &Table + 新規テーブル(&T) + + + Open Exce&l ... + + + + Open ODF Spreads&heet... + + + + Zoom/Drag Canvas &Horizontally + + + + Zoom/Drag Canvas &Vertically + + + &Scales... - - &Axes... - - &Grid ... - - Column &Options ... - - Ctrl+Alt+O - - Set Column &Values ... - - - - Alt+Q - - Recalculate - - - - Ctrl+Return - - + &Hide Selected + + + + Sho&w All Columns + + + + &Swap columns + + + + Move &Right + + + + Move &Left + + + + Move to F&irst + + + + Move to Las&t + + + + Ad&just Column Width + + + + &Delete Rows Interval... + + + + &Upward + + + + &Downward + + + &About QtiPlot - - + F1 + + + + Ctrl+H + + + &Choose Help Folder... - - - + Ctrl+W + + + Add Column - - &Go to Row... - - - - - Ctrl+Alt+G - - - - - + Go to Colum&n... + + + + Ctrl+Alt+C + + + Clear - - &Remove Layer - - + Alt+R + + + + Window &Geometry... + + + + &Hide Window + + + + Ctrl+Alt+H + + + &View Pixel Line Profile - - &Intensity Table - - + &Properties + + + + &Activate Window + + + + Mi&nimize Window + + + + Ma&ximize Window + + + + Re&size Window... + + + &Surface... - - &Data Set... - - &Convert to Spreadsheet - - - - - Convert to &Matrix - - - - + Set &Properties... + + + + Set &Dimensions... + + + + Ctrl+D + + + + Set &Values... + + + + &Image Plot + + + + &Image Profiles + + + + &Transpose + + + + Flip &V + + + + Ctrl+Shift+V + + + + Flip &H + + + + Ctrl+Shift+H + + + + R&otate 90 + + + + Rotate &-90 + + + + Ctrl+Alt+R + + + + &Invert + + + + &Determinant + + + + &Image mode + + + + Ctrl+Shift+I + + + + &Data mode + + + + Ctrl+Shift+D + + + + Show &X/Y + + + + Ctrl+Shift+X + + + + Show &Column/Row + + + + Ctrl+Shift+C + + + + &Default + + + + &Rainbow + + + + &Custom + + + + &Export Image ... + + + + &Direct + + + + &XYZ Columns + + + + &YXZ Columns + + + + &Forward FFT + + + + &Inverse FFT + + + + 2D &Binning + + + + &Regular XYZ + + + + 3D &Wire Frame + + + + 3D &Hidden Line + + + + 3D &Polygons + + + + 3D Wire &Surface + + + Contour - &Color Fill - - Contour &Lines - - &Gray Scale Map - - Sort Ta&ble - - Sort Columns - - Co&rrelate - - &Autocorrelate - - &Convolute - - &Deconvolute - - &Horizontal - - &Vertical - - Ro&w Numbers - - &Random Values - - - - &X - - - - - - - &Y - - - - - - - &Z - - - - - - - X E&rror - - - - - - - Y &Error - - - - - - &None - - - - - + &Frequency Count ... + + + + &Read Only + + + + &Disregard + + + &Box Plot - - &Gaussian... - - &Lorentzian... - - Search for &Updates - - &QtiPlot Homepage - QtiPlot &Forums - - Report a &Bug - - Download &Manual - - &Translations - - Make a &Donation - - Technical &Support - - Scripting &language - - &Restart scripting - - E&xecute - - Ctrl+J - - Execute &All - - Ctrl+Shift+J - - &Evaluate Expression - - + Show Line &Numbers + + + + Find &Next + + + + F3 + + + + Find &Previous + + + + F4 + + + + &Replace... + + + + Increase Indent + + + + Decrease Indent + + + + Rena&me Tab... + + + + A&dd Tab + + + + C&lose Tab + + + &Script Window - - + Load Custom User &Interface... + + + &Plot details... - - + &Worksheet + + + &Reset to Full Range - - Edit &Range... - - &Hide - - Hide &Other Curves - - &Show All Curves - - - &Edit Function... - - - - - English - - - - - Vie&w - - - - - &Palette - - - - - - &Read-only - - - - - - Read/&Write - - - - - Please select a column to plot! - - - - - - Please select four columns for this operation! - - - - - QtiPlot - Export Error - - - - - Output format: - - - - - Directory: - - - - - There are no plot layers available in window <b>%1</b>.<br>Graph window not exported! - - - - - - QtiPlot - Delete rows - - - - - Start row - - - - - End row - - - - - Set Display Range - - - - - &Folders - - - - - &View Pixel Line profile - - - - - - &Show All Windows - - - - - - &Hide All Windows - - - - - - &Import ASCII... - - - - - - Shift+A - - - - - - Fit &Wizard... - - - - - - &Swap columns - - - - - - Move &Right - - - - - - Move &Left - - - - - - Move to F&irst - - - - - - Move to Las&t - - - - - - &Delete Rows Interval... - - - - - - Flip &V - - - - - Ctrl+Shift+V - - - - - - Flip &H - - - - - Ctrl+Shift+H - - - - - - R&otate 90 - - - - - - Rotate &-90 - - - - - - Ctrl+Alt+R - - - - - - &Image mode - - - - - Ctrl+Shift+I - - - - - - &Data mode - - - - - Ctrl+Shift+D - - - - - - - &Gray Scale - - - - - - &Rainbow - - - - - - &Export Image ... - - - - - - &Read Only - - - - - - &Disregard - - - - - - &Custom - - - - - - Dra&g Curve - - - - - &Import - - - - - You must select a single Y column that has an associated X column! - - - - - You must select exactly one Z column! - - - - - Open File - - - - - Imported sound file - - - - - This is not a PCM type WAV file, operation aborted! - - - - - PCM - - - - - - Time - - - - - Left - - - - - Right - - - - - Data - - - - - Channels - - - - - Sample Rate - - - - - Byte Rate - - - - - Block Align - - - - - Bits Per Sample - - - - - Presentation Preview - - - - - &Save - - - - - There are no windows available in this folder! - - - - - - &Sound (WAV)... - - - - - - Create Open &Document Presentation... - - - - - - &Close - - - - - - &Lowess... - - - - - - 2D &Binning - - - - - - &Regular XYZ - - - - - - Find &Next - - - - - - F3 - - - - - - Find &Previous - - - - - - F4 - - - - - - &Replace... - - - - - - Increase Indent - - - - - - Decrease Indent - - - - - - Rena&me Tab... - - - - - - A&dd Tab - - - - - - C&lose Tab - - - - + &Toolbars... + + + + Ctrl+Shift+T + + + + Bold + + + + Italic + + + + Superscript + + + + Subscript + + + + Underline (Ctrl+U) + + + + Ctrl+U + + + + Greek + + + + Mathematical Symbols + + + Increase Precision - Decrease Precision - Open a new project - - New Fol&der - - - - + Append a project to the current folder + + + + Ctrl+Alt+A + + + Create a new folder - Create an empty 2D plot - Create an empty note window - New table - New matrix - Create a new 2D function plot - Create a new 3D surface plot - Open project - + Open Excel + + + + Open ODF Spreadsheet + + + Save project - Open Te&mplate... - Open template - Save window as template - Import data file(s) - Ctrl+K - Undo changes - Redo changes - Duplicate window - Cut selection - Copy selection - Paste selection - Delete selection - Project &Explorer - Show project explorer - Show analysis results - + &Undo/Redo Stack + + + + Show available undo/redo commands + + + &Console - Show Scripting console - Script Window - Add Layer - Arrange Layers - Export current graph - Export all graphs - Export to PDF - Print window - Print preview - Add curve to graph - Add Error Bars... - Add Function... - Best fit - Add new legend - Date & time - Add Image - Plot as line - Plot as symbols - Plot as line + symbols - Plot with vertical bars - Plot with horizontal bars - + Plot stack bar + + + + Plot stack column + + + Plot area - Plot pie - &Vectors XYXY - Vectors XYXY - Vectors XYAM - + Stem-and-Leaf Plot + + + + Double Y Axis + + + + Zoom + + + + Extract to Graphs + + + + Extract to Layer&s + + + + Extract to Layers + + + Plot 3D ribbon - Plot 3D bars - Plot 3D scatter - Plot 3D trajectory - Contour + &Color Fill - Contour Lines + Color Fill - Contour Lines - Gray Scale Map - Selected columns statistics - Selected rows statistics - + Hide selected columns + + + + Show all table columns + + + Swap selected columns - Move Right - Move Left - Move to First - Move to Last - + Move current row upward + + + + Move current row downward + + + + Set optimal column width + + + + Alt+C + + + More Windows... - + Set Matrix Values + + + + Image Plot + + + + Image Profiles + + + + Rotate 90 Clockwise + + + + Rotate 90 Counterclockwise + + + + Flip Vertically + + + + Flip Horizontally + + + + Fill selected columns with row numbers + + + + Fill selected columns with random numbers + + + + Set column as X + + + + Set column as Y + + + + Set column as Z + + + + Set as Y Error Bars + + + + Set as Labels + + + + Disregard Columns + + + Box and whiskers plot - Visit QtiPlot &Forums - Show find dialog - Find Next - Find Previous - Show replace dialog - + Ctrl+R + + + Disable &tools - Pointer - + Zoom In (Shift++) or Out (-) and Drag Canvas + + + + Zoom In/Out and Drag Canvas Horizontally + + + + Zoom In/Out and Drag Canvas Vertically + + + Zoom In - Zoom &Out - Zoom Out - Data reader - Select data range - Screen reader - + Draw Data Points + + + Move data points - Drag Curve - Remove data points - Add Text - + Add Equation + + + + Add Rectangle + + + + Add Ellipse/Circle + + + Draw arrow - Draw line - - - - Box - - - Frame - &Frame - - No Axes - - No axes - Front grid - Back grid - Right grid - Left grid - Ceiling grid - Floor grid - - - - Wireframe - - Hidden Line - - Hidden line - - Polygon Only - - Polygon only - - Mesh & Filled Polygons - - Mesh & filled Polygons - - - - Dots - - - - Bars - - - - Cones - - - - Crosshairs - - Floor Data Projection - - Floor data projection - - Floor Isolines - - Floor isolines - - Empty Floor - - Empty floor - - - - Animation - - - - Enable perspective - - - - Reset rotation - - - - Fit frame to window - + Profiles + + + + Horizontal + + + + Vertical + + + QtiPlot - Enter the number of peaks - Peaks - <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> If you like it, you're using it in your work and you would like to see it constantly improved, please support its authors by making a donation.</b></font> - Please support QtiPlot! - Make a donation - Close - <b> %1 </b>: This command line option must be used without other arguments! - Version - Usage - options - - file - - name - Valid options are - - - - - - - - or - show about dialog and exit - show standalone scripting window - start QtiPlot with the default settings - show command line options - start QtiPlot in language - show QtiPlot manual in a standalone window - print QtiPlot version and release date - execute the script file given as argument - execute the script file given as argument without displying the user interface. Warning: 2D plots are not correctly handled in this functioning mode! - - can be any .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py or ASCII file + can be any .qti, qti.gz, .ods, .opj, .ogm, .ogw, .ogg, .py, .xls or ASCII file - Help - <b> %1 </b>: Wrong locale option or no translation available! - <b> %1 </b> unknown command line option! - Type %1 to see the list of the valid options. - <b>%1</b> is a directory, please specify a file name! - The file: <b>%1</b> is not a QtiPlot or Origin project file! - QtiPlot - Demo Version - You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://soft.proindependent.com/download.html">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. - QtiPlot - File backup error - Cannot make a backup copy of <b>%1</b> (to %2).<br>If you ignore this, you run the risk of <b>data loss</b>. - QtiPlot - File save error - The file: <br><b>%1</b> is opened in read-only mode - Save project as - Save &As Project... - &Delete Folder - &Rename - &Windows in Active Folder - Windows in &Active Folder && Subfolders - &View Windows - Hidden - Name already exists! - Project - - - Path - bytes - - Contents - - windows - - folders - Modified - - - Properties - New Folder - QtiPlot - Delete folder? - Delete folder '%1' and all the windows it contains? - - + Yes + + + + No + + + Note - - 3D Graph - Status - QtiPlot - No match found - Sorry, no match found for string: '%1' - Cannot move an object to itself! - Cannot move a parent folder into a child folder! - Skipped moving folder - - The destination folder already contains a folder called '%1'! Folder skipped! - - - Error - QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! - Do you wish to continue? - QtiPlot - HTTP get version file - Error while fetching version file with HTTP: %1. - QtiPlot - Updates Available - There is a newer version of QtiPlot (%1) available for download. Would you like to download it? - QtiPlot - No Updates Available - No updates available. Your current version %1 is the last version available! - This will clear the contents of all the data associated with the table. Are you sure? - &No - QtiPlot - Enter row number - Row - QtiPlot - Enter column number - - QtiPlot was not built with Python scripting support included! - Please set a default X column for this table, first! - Please select a Z column for this operation! - You need to define a X column first! - You need to define a Y column first! - Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. - If you want to save your already defined models, please choose a destination folder. - Import fit models - Choose a directory to export the fit models to - - No Icon - Couldn't load file: %1. Autocompletion will not be available! - Please select exactly one column and more than one non empty cell! - Data set: %1 doesn't exist! - Stem and leaf plot of dataset - from row - to row - Not enough memory for this dataset! - Stem - Leaf - Please confirm the stem unit! - Data set - stem unit - Stem unit - Leaf unit - Key - means - Input error: empty data set! - Memory Allocation Error - Not enough memory, operation aborted! - - Set Precision %1 digits - - + Choose custom user interface + + + + Custom user interfaces can be created using the QtDesigner application provided by the Qt framework + + + + For more details about how to use .ui files in your Python scripts please read the PyQt4 documentation + + + + &New + 新規作成(&N) + + + &Open + 開く(&O) + + + Open image &file + 画像を開く(&F) + + + &Recent projects + 最近開いたプロジェクト(&R) + + + &Save Project + プロジェクトの保存(&S) + + + Save Project &as... + プロジェクトを名前を付けて保存...(&A) + + + &Current + 現在の物のみ(&C) + + + &All + 全て(&A) + + + &Export Graph + グラフのエクスポート(&E) + + + &Print + 印刷(&P) + + + &Single file... + 単一ファイル...(&S) + + + &Multiple files... + 複数ファイル...(&M) + + + Set import &options + インポートオプション(&O) + + + &Import ASCII + ASCIIデータのインポート(&I) + + + &Quit + 終了(&Q) + + + &Undo + 元に戻す(&U) + + + &Redo + やり直す(&R) + + + Cu&t selection + 選択範囲の切り取り(&T) + + + &Copy selection + 選択範囲のコピー(&C) + + + &Paste selection + 選択範囲の貼り付け(&P) + + + &Delete selection + 選択範囲の削除(&D) + + + Clear &log informations + ログの削除(&L) + + + &Edit + 編集(&E) + + + Plot &wizard + プロットウィザード(&W) + + + Project &explorer + プロジェクトエクスプローラー(&E) + + + Results &Log + 結果ログ(&L) + + + &Preferences... + 設定...(&P) + + + &View + 表示(&V) + + + &Add/Remove curve + 曲線の追加/削除(&A) + + + Add &Error Bars + エラーバーの追加(&E) + + + Add &function curve + 関数曲線の追加(&F) + + + &Rescale to show all + 全体表示可能にリサイズ(&R) + + + New &Legend + 新規凡例(&L) + + + Add &Image + 画像の追加(&I) + + + Add &Text + テキストの追加(&T) + + + &Draw arrow/line + 矢印/直線の描画(&D) + + + Add La&yer + レイヤーの追加(&Y) + + + Delete Layer + レイヤーの削除 + + + Arran&ge/Custom Layers + レイヤーの整列/調節(&G) + + + &Graph + グラフ(&G) + + + &Line + 直線(&L) + + + &Scatter + 点のみ(&S) + + + Line + S&ymbol + 直線+点(&Y) + + + &Spline + スプライン(&S) + + + Special Line/Symb&ol + 特殊な直線/シンボル + + + Ctrl+T + + + + New &Matrix + + + + Ctrl+M + + + + New &Function Plot + + + + Ctrl+F + + + + New 3D &Surface Plot + + + + Ctrl+ALT+Z + + + + Ctrl+O + + + + Ctrl+Shift+E + + + + Ctrl+Alt+S + + + + Ctrl+I + + + + Import I&mage... + + + + Ctrl+S + + + + Save Project &As... + + + + Ctrl+Shift+S + + + + Open Temp&late... + + + + Save As &Template... + + + + Save Note As... + + + + &Import ASCII... + + + + &Sound (WAV)... + + + + Ctrl+Z + + + + &Duplicate + + + + Ctrl+Alt+D + + + + Cu&t Selection + + + + Ctrl+X + + + + &Copy Selection + + + + Ctrl+C + + + + &Paste Selection + + + + Ctrl+V + + + + Del + delete key + + + + Ctrl+E + + + + &Find... + + + + ALT+L + + + + Arran&ge Layers + + + + Shift+A + + + + Automatic Layout + + + + Ctrl+Alt+G + + + + Alt+X + + + + Create Open &Document Presentation... + + + + &Export PDF + + + + Ctrl+Alt+P + + + + Ctrl+P + + + + Print All Plo&ts + + + + Ctrl+Q + + + + &Close + + + + Clear &Log Information + + + + Delete &Fit Tables + + + + Plot &Wizard + + + + Ctrl+Alt+W + + + + Add/Remove &Curve... + + + + ALT+C + + + + Add &Error Bars... + + + + Ctrl+B + + + + Add &Function... + + + + Ctrl+Alt+F + + + + &Rescale to Show All + + + + Ctrl+Shift+R + + + + Zoom &In/Out and Drag Canvas + + + + Ctrl+L + + + + Add Time Stamp + + + + Ctrl+ALT+T + + + + ALT+I + + + + Vertical &Drop Lines + + + + &Horizontal Steps + + + + &Vertical Steps + + + + &Columns + 縦の棒グラフ(&C) + + + &Rows + 横の棒グラフ(&R) + + + Stack &Bar + + + + Stack &Column + + + + &Area + 積み上げ面グラフ(&A) + + + &Pie + 円グラフ(&P) + + + Vectors XY&AM + + + + &Vectors &XYXY + + + + &Histogram + ヒストグラム(&H) + + + Statistical &Graphs + 統計用グラフ(&G) + + + &Stacked Histogram + + + + Stem-and-&Leaf Plot + + + + &Vertical 2 Layers + 上下2段レイヤー(&V) + + + &Horizontal 2 Layers + 左右2段レイヤー(&H) + + + &4 Layers + &4レイヤー + + + Pa&nel + パネル(&n) + + + &Plot 2D + 2Dプロット(&P) + + + &Ribbon + リボン(&R) + + + &Bars + 縦棒(&B) + + + &Trajectory + 軌跡(&T) + + + Plot &3D + &3Dプロット + + + &Move data points + データ点を移動する(&M) + + + Remove &bad data points + 邪魔なデータ点を削除(&B) + + + &Data + データ(&D) + + + &Stacked Layers + + + + D&ouble-Y + + + + &Zoom + + + + &Waterfall Plot + + + + E&xtract to Graphs + + + + Extract to &Layers + + + + Add Inset Layer + + + + Statistics on &Columns + 列に関する統計(&C) + + + Statistics on &Rows + 行に関する統計(&R) + + + &Integrate ... + 積分...(&I) + + + Li&near + 直線(&N) + + + Cu&bic spline + 三次スプライン(&B) + + + Inter&polate + 補間(&P) + + + &Forward + 順変換(&F) + + + &Inverse + 逆変換(&I) + + + &FFT + &FFT + + + &Differentiate + 微分(&D) + + + Fit &Linear + 直線フィッティング(&L) + + + Fit &Polynomial ... + 多項式フィッティング...(&P) + + + &First Order ... + 一次...(&F) + + + &Second Order ... + 二次...(&S) + + + &Third Order ... + 三次...(&T) + + + Fit E&xponential Decay + 指数減衰フィッティング(&X) + + + Fit Exponential Gro&wth + 指数増加フィッティング(&W) + + + Fit &Gaussian + ガウシアンフィッティング(&G) + + + Fit Lorent&zian + ローレシアンフィッティング(&Z) + + + &Non-linear Curve Fit ... + 非線形曲線フィッティング...(&N) + + + &Analysis + 分析(&A) + + + &Integrate + + + + Integr&ate Function... + + + + Inte&rpolate ... + + + + &Low Pass... + + + + &High Pass... + + + + &Band Pass... + + + + &Band Block... + + + + &FFT... + + + + &Savitzky-Golay... + + + + &FFT Filter... + + + + Moving Window &Average... + + + + &Lowess... + + + + Fit Slop&e + + + + Fit Exponential Gro&wth ... + + + + Fit &Boltzmann (Sigmoidal) + + + + Fit &Wizard... + + + + Ctrl+Y + + + + &Plot ... + プロット...(&P) + + + &Axes ... + 軸...(&A) + + + &Title ... + タイトル...(&T) + + + Column &options ... + 列のオプション...(&O) + + + &Set column values ... + 列の値を変換(&S) + + + &Columns... + 列...(&C) + + + &Rows... + 行...(&R) + + + For&mat + フォーマット(&M) + + + &Windows + ウィンドウ(&W) + + + &Help + ヘルプ(&H) + + + &About + このソフトについて(&A) + + + <h4>There are no tables available in this project.</h4><p><h4>Please create a table and try again!</h4> + + + + QtiPlot - Choose data set + + + + <h4>There are no plot layers available in this window.</h4><p><h4>Please add a layer and try again!</h4> + + + + QtiPlot - Error + + + + QtiPlot - Warning + + + + &Matrix + + + + QtiPlot - Choose matrix to plot + + + + QtiPlot - Import image from file + + + + QtiPlot - Load image from file + + + + Matrix + + + + QtiPlot - Error bars error + + + + This feature is not available for user defined function curves! + + + + There are no curves available on this plot! + + + + QtiPlot - untitled + + + + Project Explorer + + + + Folder + + + + UNTITLED + + + + Name + + + + Type + + + + View + + + + Size + + + + Created + + + + Label + + + + Results Log + + + + Scripting Console + + + + &Next + next window + + + + F5 + next window shortcut + + + + &Previous + previous window + + + + F6 + previous window shortcut + + + + Edit + + + + Disable &Tools + + + + &Zoom In + + + + Ctrl++ + + + + &Zoom Out + + + + Ctrl+- + + + + &Data Reader + + + + CTRL+D + + + + &Select Data Range + + + + ALT+S + + + + S&creen Reader + + + + &Move Data Points... + + + + Ctrl+ALT+M + + + + Remove &Bad Data Points... + + + + Alt+B + + + + ALT+T + + + + Draw &Arrow + + + + CTRL+ALT+A + + + + Draw &Line + + + + CTRL+ALT+L + + + + Matrix Plot + + + + QtiPlot - Script Window + + + + 3D Surface + + + + &Recent Projects + + + + 3&D Plot + + + + Open ODF Spreadsheet File + + + + QtiPlot was built without ODF spreadsheet support! + + + + File %1 contains only %2 sheets, operation aborted! + + + + Sheet %1 is empty, operation aborted! + + + + sheet + + + + QtiPlot was built without libxls support! + + + + &Normalize + + + + Set Columns &As + + + + &Fill Columns With + + + + &Smooth + + + + &FFT filter + + + + Fit &Multi-peak + + + + &Plot + + + + &Table + + + + 3D &Plot + + + + QtiPlot - Plot error + + + + You must select exactly one column for plotting! + + + + There are no available columns with plot designation set to Z! + + + + Column + + + + <h4>There are no matrices available in this project.</h4><p><h4>Please create a matrix and try again!</h4> + + + + Graph + + + + Images + + + + Please select a Y column to plot! + + + + QtiPlot - Renamed Window + + + + The table '%1' already exists. It has been renamed '%2'. + + + + Notes + + + + Determinant of + + + + This functionality is not available for pie plots! + + + + The selected columns have different numbers of rows! + + + + The selected error column is empty! + + + + QtiPlot + + + + QtiPlot - Column selection error + + + + Convert to &Matrix + + + + English + + + + &Read-only + + + + Read/&Write + + + + Please select a column to plot! + + + + Please select four columns for this operation! + + + + Dra&g Curve + + + + &Import + + + + You must select a single Y column that has an associated X column! + + + + You must select exactly one Z column! + + + + Open File + + + &Draw Data Points - - - &Image Plot - - - - - - Show &X/Y - - - - - Ctrl+Shift+X - - - - - - Show &Column/Row - - - - - Ctrl+Shift+C - - - - - &Forward FFT - - - - - &Inverse FFT - - - - - - Ctrl+Shift+T - - - - - Draw Data Points - - - - - - Format - - - Add &Custom Script Action... - - - - - - Bold - - - - - - Italic - - - - - Superscript - - - - - Subscript - - - - - - Underline (Ctrl+U) - - - - - - Ctrl+U - - - - - - - - Greek - - - - - - - &Label - - - - - Undo Stack - Empty Stack - Set Image Mode - Set Data Mode - Show X/Y - Show Column/Row - Set Gray Scale Palette - Set Rainbow Palette - - - &Hide Selected - - - - - - Sho&w All Columns - - - - - - - - &Direct - - - - - - &XYZ Columns - - - - - - &YXZ Columns - - - - - Show available undo/redo commands - - - - - Hide selected columns - - - - - Show all table columns - - - - - Integration of %1 from zero is - - - - - - &Integrate - - - - - - Integr&ate Function... - - - - - - Ctrl+D - - - - - - &Toolbars... - - - - - &Undo/Redo Stack - - - - - - Go to Colum&n... - - - - - - Ctrl+Alt+C - - - - - Set Matrix Values - - - - - Image Plot - - - - - Flip Vertically - - - - - Flip Horizontally - - - - - Fill selected columns with row numbers - - - - - Fill selected columns with random numbers - - - - - Set column as X - - - - - Set column as Y - - - - - Set column as Z - - - - - Set as Y Error Bars - - - - - Set as Labels - - - - - Disregard Columns - - - - - - Mathematical Symbols - - - - - Integration of %1 - - - - - Area - - - - - - - - - Please select a 'Y' column first! - - - - - - Linear Regression of %1 - - - - - - Slope - - - - - Intercept - - - - - - Chi^2 - - - - - - R^2 - - - - &Scripting - - - Show Line &Numbers - - - - - Add E&quation - - ALT+Q - - Add &Rectangle - - CTRL+ALT+R - - - You don't have the permission to open this file: <b>%1</b> - - - - - - - There are no layers available on this plot. Operation aborted! - - - - - &Paste Tex Formula - - - - - - &Frequency Count ... - - - - - Add Equation - - - - - Add Rectangle - - - - - You need to select at least one Y column for this operation! - - - - - - - You need at least two columns for this operation! - - - - - Y2 Axis Title - - - - - You must have more than one layer in the active window! - - - - - You must have more than one dataset in the active layer! - - - - - - D&ouble-Y - - - - - - &Zoom - - - - - - E&xtract to Graphs - - - - - Extract to &Layers - - - - - - Add Inset Layer - - - - - Double Y Axis - - - - - Zoom - - - - - Extract to Graphs - - - - - Extract to Layer&s - - - - - Extract to Layers - - - - - Add &Ellipse - - CTRL+ALT+E - - &Paste Rectangle - - - - - &Paste Ellipse - - - - - Add Ellipse/Circle - - - - - - - - Ctrl+Alt+H - - - - Set Default Palette - - - &Default - - - - - - - - &Find... - - - - - - App&end Project... - - - - - Rotate 90 Clockwise - - - - - Rotate 90 Counterclockwise - - - - - - Ctrl+Shift+S - - - - - Stem-and-Leaf Plot - - - - - - Stem-and-&Leaf Plot - - - - F&ormat - - Alt+C - - - - - - Zoom &In/Out and Drag Canvas - - - - - Zoom In (Shift++) or Out (-) and Drag Canvas - - - - - - Fit Slop&e - - - - - &Add - - - - - - Ctrl+Alt+D - - - - - &Waterfall Plot - - - - - &Indexed Colors - - - - - Pale&tte - - - - - - Spec&ial Bar/Column - - - Stack &Bar - - - - - - Stack &Column - - - - - Plot stack bar - - - - - Plot stack column - - - - - Move Row - - Print preview of window: - - - - - - Print Pre&view - - - - - - Ad&just Column Width - - - - - - &Upward - - - - - - &Downward - - - - - Append a project to the current folder - - - - - Ctrl+Alt+A - - - - - Move current row upward - - - - - Move current row downward - - - - - Set optimal column width + Shared A&xes Panel + + + + + + + + &Custom Layout... + + + + Execute Selected Lines + + + + Commen&t Selection + + + + &Uncomment Selection + + + + Comment Selection + + + + Uncomment Selection + + + + Ctrl+Shift+O + + + + Ctrl+Shift+U + + + + Waterfall Plot + + + + &Extract Data... + + + + S&ubtract + + + + &Straight Line... + + + + &Reference Data... + + + + &Open... + + + + Open Image &File... + + + + &Print... + + + + Print Pre&view... + + + + E&xport ASCII... ArrowMarker - dx - dy - angle - length - - eqn - y - - x @@ -5709,74 +4403,58 @@ AssociationsDialog - QtiPlot - Plot Associations - Spreadsheet: - Column - X - Y - - xErr - - yErr - &Update curves - &OK - &Cancel - xEnd - yEnd - Angle - Magn. Magnitude, vector length @@ -5785,716 +4463,572 @@ AxesDialog - QtiPlot - General Plot Options - &Apply - &OK - &Cancel - - From - - To - - Type - Probability - Logit - Inverted - Step - - Major Ticks - - Minor Ticks - - - Bottom - - - Left - - - Top - - - Right - Scale - Major Grids - Minor Grids - Line Color - Line Type - Thickness - - Axes - Additional lines - X=0 - Y=0 - Horizontal - Vertical - Grid - Show - Title - &Font - Numeric - Text from table - Day of the week - Month - Time - Date - Column Headings - Font - Axis &Font - - - Color - - None - - Out - - In & Out - - In - + Labels space + + + Stand-off - Show Labels - + Show &backbone + + + Column - Table - - Format - - Precision - Angle - For&mula - - Axis - Canvas frame - - Width - Draw backbones - Line Width - Major ticks length - Minor ticks length - General - Automatic - + Scientific: 1·10^4 + + + QtiPlot - Formula input error - Valid variables are 'x' for Top/Bottom axes and 'y' for Left/Right axes! - millisec. - sec. - min. - hours - days - weeks - Show Axis &Break - Draw Break &Decoration - Position - % of Axis Length - pixels - &Log10 Scale After Break - Step Before Break - - Guess - Step After Break - Minor Ticks Before - Minor Ticks After - Apply To - This Layer - This Window - - - All Windows - An&tialised - Set As &Default - Apply &to... - - Layer - - Window - Distance to axis - Apply &to - Decimal: 10000.0 - Scientific: 1e4 - Scientific: 1x10^4 - Engineering: 10k - - Origin - &Inverted - Linear - Log10 - ln - Log2 - Reciprocal + + Hide Ticks + + + + At Axis Begin + + + + At Axis End + + + + At Axis Begin & End + + ColorBox - black - red - green - blue - cyan - magenta - yellow - dark yellow - navy - purple - wine - olive - dark cyan - royal - orange - violet - pink - white - light gray - gray - light yellow - light cyan - light magenta - dark gray - ColorButton - - - Custom - - - - ColorMapDialog - QtiPlot - Custom Color Map - &Apply - &Close - Set Custom Palette @@ -6502,27 +5036,22 @@ ColorMapEditor - Level - Color - &Insert - &Delete - &Scale Colors @@ -6530,30 +5059,22 @@ ColorMapPreviewDialog - QtiPlot - Color Map Preview Dialog - Colormap files - All files - << &Preview - - - - None @@ -6561,7 +5082,6 @@ ColorPickerPopup - Custom @@ -6569,7 +5089,6 @@ ConfigDialog - The column separator can be customized. The following special codes can be used: \t for a TAB character @@ -6577,1138 +5096,1002 @@ - The separator must not contain the following characters: 0-9eE.+- - QtiPlot - Choose default settings - General - - Tables - - 2D Plots - - 3D Plots - Fitting - Options - Curves - Ticks - - - Fonts - Do not &resize layers when window size changes - - Length - Scale Errors with sqrt(Chi^2/doF) - Axes linewidth - Major Ticks - Minor Ticks - Margin - Frame width - Axes &backbones - Canvas Fra&me - Show &Title - Scale &Fonts - Auto&scaling - Antia&liasing - Legend display - Column name - Column comment - Table name - Table legend - - None - - Out - - In & Out - - In - Prompt on closing - Folders - Matrices - &Notes - &OK - &Cancel - &Apply - &Text Font - &Labels Font - A&xes Labels - Axes &Numbers - &Legend - T&itle - Application - Confirmations - - - Colors - Language - - - Style - Main Font - Choose &font - Workspace - Panels text - Panels - Save every - Check for new versions at startup - minutes - Default scripting language - Default Column Separator - - - - TAB - - - - SPACE - - - Background - Text - - Labels - - Grids - - Ma&jor Grids - - Mi&nor Grids - - Color - + &Keep aspect ratio + + + + Geometry + + + + Ticks - Labels space + + + + pixels + + + + Unit + + + + inch + + + + mm + + + + cm + + + + point + + + + pixel + + + + Canvas Width + + + + Canvas Height + + + + Ask before over&writing files + + + + mu&Parser uses C locale settings + + + Default curve style - Line width - Symbol size - Line - Scatter - Line + Symbol - Vertical drop lines - Spline - Vertical steps - Horizontal steps - Area - Vertical Bars - Horizontal Bars - (all data shown) - &Show Legend - Smoot&h Line - O&rthogonal - Lab&els - &Grid - - - &Numbers - A&xes - &Background - &Title - &Axes Labels - Autosca&ling - - Solid - - Dash - - Dot - - Dash Dot - - Dash Dot Dot - - Short Dash - - Short Dot - - Short Dash Dot - Generated Fit Curve - Uniform X Function - Points - Same X as Fitting Data - - Display Peak Curves for Multi-peak Fits - Parameters Output - Significant Digits - Write Parameters to Result Log - Paste Parameters to Plot - Peaks Color - + Display Confirmation &Messages for Multi-peak Fits + + + QtiPlot - Import options error - The separator must not contain the following characters: 0-9eE.+- - - - - System Locale Setting - Decimal Separators - Print - Print Crop&marks - &Scale layers to paper size - Prompt on &renaming tables when appending projects - Numeric Format - &Backup project before saving - Start New Project - - Empty - Table - Matrix - Empty Graph - Note - Number of Decimal Digits - &Display Comments in Header - 2 points for linear fits - &Disable in-place editing - File Locations - Choose the location of the QtiPlot translations folder! - Matrix Undo Stack Size - - Translations - - Help - LF (Unix) - CRLF (Windows) - CR (Mac) - - Python Configuration Files - Endline character - Choose the location of the Python configuration files! - Automatically &Recalculate Column Values - - Background Color - - - - Opacity - - Canvas Color - - Border Color - - - - Width - - Transparent - &Enable autocompletion (Ctrl+U) - Omit &Thousands Separator - Clipboard Decimal Separators - &B - &It - Notes - Tab length (pixels) - Font - &Display line numbers - Axes title space - &Resolution - &Floor style - Isolines - Projection - &Mesh - Syntax Highlighting - Co&mments - &Keywords - &Quotations - &Functions - Q&t Classes - Default Color Map - Axes - Left - Right - Bottom - Top - Enabled axes - Show - - QtiPlot - index.html File Not Found! - There is no file called <b>index.html</b> in folder %1.<br>Please choose another folder! - - QtiPlot - Folder Not Found! - The folder %1 doesn't exist.<br>Please choose another folder! - %1 is not a folder.<br>Please choose another folder! - Choose the location of the QtiPlot help folder! - There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! - - QtiPlot - You don't have read access rights to folder %1.<br>Please choose another folder! - - &Internet Connection - - &Proxy - - Host - - Port - - Username - - Password - LaTeX Compiler - Choose the location of the LaTeX compiler! - - QtiPlot - File Not Found! - The file %1 doesn't exist.<br>Please choose another file! - %1 is a folder.<br>Please choose a file! - You don't have read access rights to file %1.<br>Please choose another file! + + New Color + + + + &Load Default + + + + Delete Color + + + + Move Color Up + + + + Move Color Down + + + + Indexed Colors + + + + Default Symbol + + + + Edge width + + + + Name + + + + Symbol + + + + Inde&xed Symbols + + + + &Fill Symbol + + + + Move Symbol Up + + + + Move Symbol Down + + + + Pattern + + + + Line style + + + + Fill area under curve + + + + Default Line Style + + + + Axis title + + + + Default + + + + Synchronize scale &divisions + + ContourLinesEditor - Level - Pen - &Insert - &Delete - QtiPlot - Edit pen - Color - - - Apply to all - Style - Width - &Ok - &Close @@ -7716,56 +6099,38 @@ Convolution - Convolution - - - - - QtiPlot - - - - - Error - The signal data set %1 does not exist! - The response data set %1 does not exist! - The response dataset '%1' must be less then half the size of the signal dataset '%2'! - The response dataset '%1' must contain an odd number of points! - Could not allocate memory, operation aborted! - - Index @@ -7773,38 +6138,26 @@ Correlation - Correlation - - - QtiPlot - - - Error - - The data set %1 does not exist! - Error in GSL forward FFT operation! - - Lag @@ -7812,68 +6165,54 @@ CreateBinMatrixDialog - - QtiPlot - Bin Matrix Dialog - &OK - &Cancel - X-min - X-max - Columns - Y-min - Y-max - Rows - Input Size Error - The dimensions you have specified are not acceptable! - Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! @@ -7881,32 +6220,26 @@ CurveRangeDialog - QtiPlot - Plot range - Data set: - From row number - To row number - &OK - &Close @@ -7914,152 +6247,122 @@ CurvesDialog - QtiPlot - Add/Remove curves - New curves style - Line - Scatter - Line + Symbol - Vertical drop lines - Spline - Vertical steps - Horizontal steps - Area - Vertical Bars - Horizontal Bars - Contour - Color Fill - Contour Lines - Gray Scale Map - Available data - Graph contents - &Plot Associations... - Edit &Range... - &Edit Function... - OK - Close - &Show Range - &Plot Selection - &Plot - &Delete Selection - &Delete Curve - Show current &folder only - Histogram - Histogram @@ -8067,237 +6370,174 @@ CustomActionDialog - - - - - - - - - - - QtiPlot - Add Custom Action - Folder - Choose &Folder - Script File - Choose &Script - Icon - Choose &Icon - - Text - Tool Tip Text - Shortcut - &Menu - &Tool Bar - &Add - &Remove - &Close - - - - - - - Error - Please provide a description for your custom action! - Dot characters are not allowed in the description text! - You have already defined an action having description: %1 <br>Please provide a different description text! - The file you have specified doesn't exist, please choose a valid script file! - The image file you have specified doesn't exist or can't be read, please choose another file! - Please provide a different key sequence! The following shortcut key sequences are already assigned: - Are you sure you want to remove this action? - Remove Action - - File Save Error - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - QtiPlot - Load icon from file - Choose script file - Choose the custom actions folder - &Save - &Delete Menu - Python Script - All Files - Add menu - Menu title: - Please, choose the location of the new menu - Menu: - Remove Menu - Are you sure you want to remove menu '%1' and all its actions? - &New Menu... - - Menu Bar - There's already a menu item with this title, please choose another title! @@ -8305,57 +6545,42 @@ DataPickerTool - Click on plot or move cursor to display coordinates! - Please, click on plot and move cursor! - Select point and double click to remove it! - QtiPlot - Remove point error - Sorry, but removing points of a function is not possible. - QtiPlot - Move point error - Sorry, but moving points of a function is not possible. - - - - QtiPlot - Warning - - This operation cannot be performed on curves plotted from columns having a non-numerical format. - - The column '%1' is read-only! Please choose another curve! @@ -8363,7 +6588,6 @@ Deconvolution - Deconvolution @@ -8371,13 +6595,10 @@ Differentiation - - Derivative - of Derivative of @@ -8386,7 +6607,6 @@ DrawPointTool - Draw @@ -8394,422 +6614,322 @@ EnrichmentDialog - - - - QtiPlot - Tex Equation Editor - Clea&r - Window Geometry - Object Properties - &Apply - &Close - Preview: - - &Text - - Color - - - Set As &Default - &Font - Auto-&update - - Opacity - - Transparent - File - &Save internally - &Image - Shape - None - Rectangle - Shadow - Line Style - - Width - - - All Windows - TeX &Output - &Frame - Fill Color - Pattern - Pattern Color - Use &Frame Color - Fill &Pattern - Page - Layer Scales - Attach to - inch - mm - cm - point - pixel - scale - Unit - Position - X - Y - Size - Height - &Keep aspect ratio - &Best size - &Geometry - Network connection error - Error while trying to connect to host %1: - Please verify your network connection! - QtiPlot - Import image from file - QtiPlot - Warning - The file %1 doesn't exist. The image cannot be restored when reloading the project file! - - - Layer - - - Window - Background - Rotate (deg.) - - - Object - - Apply t&o... - Line - Apply format &to... - MathTran (http://www.mathtran.org/) - locally installed - LaTeX Compiler - Compile process ended - Compiling process ended with exit code: %1 - LaTeX compile process - dvipng process - - failed to start! - Please verify that you have dvipng installed in the same folder as your LaTeX compiler! - crashed - timedout - write error - read error - unknown error - Compile error - Please set the correct path to the compiler in the preferences dialog! @@ -8817,53 +6937,42 @@ ErrDialog - - Source of errors - QtiPlot - Error Bars - &X Error Bars - &Add - Add Error Bars to - Percent of data (%) - Standard Deviation of Data - &Y Error Bars - &Close - Existing column @@ -8871,77 +6980,62 @@ ExpDecayDialog - QtiPlot - Verify initial guesses - Exponential Fit of - Growth time - Decay time - First decay time (t1) - Second decay time (t2) - Third decay time (t3) - Amplitude - Y Offset - Initial time - Color - &Fit - &Close - QtiPlot - Warning - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! @@ -8949,44 +7043,34 @@ ExponentialFit - Exponential growth - Exponential decay - ExpGrowth - - amplitude - lifetime - - offset - ExpDecay1 - e-folding time @@ -8994,95 +7078,84 @@ ExportDialog - QtiPlot - Export ASCII - Table - &All 全て(&A) - Separator - - - - - TAB - - - - - SPACE - - The column separator can be customized. The following special codes can be used: \t for a TAB character \s for a SPACE - - - The separator must not contain the following characters: 0-9eE.+- - Include Column &Names - Export &Selection - + QtiPlot + + + + Overwrite file? + + + + %1 already exists. + + + + Do you want to replace it? + + + QtiPlot - Export error - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - &Help ヘルプ(&H) - QtiPlot - Help - QtiPlot - Import options error - Include Column Co&mments @@ -9090,89 +7163,112 @@ ExtensibleFileDialog - << &Advanced + ExtractDataDialog + + QtiPlot + + + + Extract Data + + + + For row (i) + + + + to + + + + &Apply + + + + &Close + + + + &Put into table + + + + Table + + + + Cond&ition: + + + + Add &function + + + + Add co&lumn + + + + Add &operator + + + + Clea&r + + + + FFT - - - - - FFT - - Forward - - - - of - - - Frequency - - Inverse - - - Time - - Real - - Imaginary - - - - Amplitude - - Angle - Hz - s @@ -9180,113 +7276,90 @@ FFTDialog - QtiPlot - FFT Options - &Forward 順変換(&F) - &Inverse 逆変換(&I) - Curve - Sampling - Real - Imaginary - - Sampling Interval - &Normalize Amplitude - &Shift Results - &OK - &Close - QtiPlot - Error - Please choose a column for the real part of the data! - QtiPlot - The two matrices have different dimensions, the imaginary part will be neglected! - RealMatrixFFT - Real part of the FFT transform of - ImagMatrixFFT - Imaginary part of the FFT transform of - AmplitudeMatrixFFT - Amplitudes of the FFT transform of @@ -9294,64 +7367,50 @@ FFTFilter - FFT - Filtered - - QtiPlot - - Error - Unknown filter type. Valid values are: 1 - Low pass, 2 - High Pass, 3 - Band Pass, 4 - Band block. - Please enter different values for the band limits. - to - Hz - Low Pass FFT Filter - High Pass FFT Filter - Band Pass FFT Filter - Band Block FFT Filter @@ -9359,82 +7418,58 @@ Filter - - - - - - QtiPlot - - - - - Error - Please assign a curve first! - Several data points have the same x value causing divisions by zero, operation aborted! - - You need at least %1 points in order to perform this operation! - QtiPlot - Filter Error - Please enter a valid curve name! - QtiPlot - Color Name Error - The color name '%1' is not valid, a default color (red) will be used instead! - You didn't specify a valid data set for this operation! - of - Plot - Memory Allocation Error - Not enough memory, operation aborted! @@ -9442,63 +7477,50 @@ FilterDialog - QtiPlot - Filter options - Filter curve: - Frequency cutoff (Hz) - Low Frequency (Hz) - High Frequency (Hz) - Add DC Offset - Substract DC Offset - - Color - &Filter - &Close - QtiPlot - Frequency input error - Please enter frequency limits that satisfy: Low < High ! @@ -9506,68 +7528,54 @@ FindDialog - QtiPlot - - Find - Start From - Search in - &Window Names - Window &Labels - Folder &Names - Case &Sensitive - &Partial Match Allowed - &Include Subfolders - &Find - &Update Start Path - &Close @@ -9575,79 +7583,58 @@ FindReplaceDialog - - - QtiPlot - - Find - Find and Replace - Replace with - &Match case - &Whole word - &Next - &Previous - &Replace - Replace &all - &Close - - - Empty Search Field - - - The search field is empty. Please enter some text and try again. - QtiPlot has finished searching the document. @@ -9655,349 +7642,255 @@ Fit - Plot - using function - Weighting Method - No weighting - Instrumental - using error bars dataset - Statistical - Arbitrary Dataset - Nelder-Mead Simplex - Unscaled Levenberg-Marquardt - Scaled Levenberg-Marquardt - algorithm with tolerance = - From x - to x - - R^2 - Iterations - Status - Dataset - Function - - - - QtiPlot - Error - The curve %1 has no associated Y error bars. You cannot use instrumental weighting method. - The column %1 has less points than the fitted data set. Please choose another column! - - The column %1 has less points than the fitted data set. Please choose another column!. - - - - Parameter - Value - Error - - - - - - - QtiPlot - Fit Error - You didn't specify a valid data set for this fit operation. Operation aborted! - There are no parameters specified for this fit operation. Operation aborted! - You need at least %1 data points for this fit operation. Operation aborted! - You must specify a valid fit function first. Operation aborted! - Fit - graphics display disabled - of dataset - You cannot use the instrumental weighting method. - QtiPlot - File Save Error - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - QtiPlot Fit Model - Cannot read file %1: %2. - - - Please perform a fit first! - Residuals of %1 - residue - Adjusted R^2 - RMSE (Root Mean Squared Error) - RSS (Residual Sum of Squares) - FitResiduals - - FitStats - Confidence Limits of %1 - - Independent Variable - LCL - Lower %1 Confidence Limit - UCL - Upper %1 Confidence Limit - Prediction Limits of %1 - LPL - Lower %1 Prediction Limit - UPL - Upper %1 Prediction Limit - Direct Weighting using Dataset - - - - - - - QtiPlot - Memory Allocation Error - - Could not allocate enough memory for the fit curves! - QtiPlot - Memory Allocation Error - - - - - - Not enough memory! @@ -10005,547 +7898,423 @@ FitDialog - Curve - - Function - Initial guesses - Parameter - Value - Constant - Error - Algorithm - Scaled Levenberg-Marquardt - Unscaled Levenberg-Marquardt - Nelder-Mead Simplex - Color - From x= - To x= - Iterations - Tolerance - - Weighting Method - - - - No weighting - Instrumental - Statistical - Arbitrary Dataset - &Delete Fit Curves - &Fit - - - &Close - Category - Expression - User defined - Built-in - Basic - Plugins - Fit with &built-in function - - Polynomial Order - Name - user1 - - &Save - - + Data Set + + + + Weighting + + + + Re&load + + + + &Guess + + + + &Range + + + Parameters - &Remove - Add &expression - Add &name - Rese&t - &Uniform X Function - Points - Same X as Fitting &Data - Generated Fit Curve - Significant Digits - Parameters &Table - - Name: - Covariance &Matrix - CovMatrix - Parameters Output - &Write Parameters to Result Log - &Paste Parameters to Plot - &Apply - - - - - - - QtiPlot - Error - Please enter a valid name for the parameters table. - - - - - Please perform a fit first and try again. - Please enter a valid name for the covariance matrix. - - - - - QtiPlot - Input function error - - Please enter a valid function! - Please enter a function name! - QtiPlot - Error: function name - is a built-in function name<p>You must choose another name for your function! - Fit with selected &user function - Fit using &built-in function - Fit using &plugin function - Choose the plugins folder - - Gauss - Peaks - - Lorentz - - Polynomial - QtiPlot - Warning - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - QtiPlot - Input error - Please enter x limits that satisfy: from < end! - Please verify that you have initialized all the parameters! - - No data tables - QtiPlot - Fit Wizard - &One table for all fits - &Preview - From - To - - - Select Function - - - - Fitting Session - - - Custom Output - - Choose plug&ins folder... - Start Fitting Session - You can't define functions recursively! - - QtiPlot fit model - - All files - - - QtiPlot - - Save Fit Model As - Are you sure you want to remove fit model file: %1 ? - Remove Fit Model - Choose &models folder... - Choose the fit models folder - &Residuals Plot - Co&nf. Bands - Pred. &Bands - &Scale Errors with sqrt(Chi^2/doF) - Direct Weighting - Error: @@ -10553,12 +8322,10 @@ Folder - kB - bytes @@ -10566,108 +8333,86 @@ FrequencyCountDialog - QtiPlot - Frequency count - Statistics on %1 - Mean - Standard Deviation - Median - Size - From Minimum - To Maximum - Step Size - &Apply - &Cancel - &Ok - QtiPlot - Error - Not enough data points, operation aborted! - QtiPlot - Frequency input error - Please enter frequency limits that satisfy: From < To ! - - Count - Frequency count of %1 - BinCtr - BinEnd - Sum @@ -10675,166 +8420,130 @@ FunctionDialog - QtiPlot - Add function curve - Curve type - + Click here to select a recently typed expression + + + + Rece&nt + + + Function - Parametric plot - Polar plot - f(x)= - From x= - To x= - - - Points - - Parameter - - From - - To - + QtiPlot + + + + Sorry, there are no recent expressions available! + + + + Recent Functions + + + + Please, choose a function: + + + x = - y = - R = - Theta = - - Clear Function - - - - - Clear list - - - - - - QtiPlot - Start limit error - - - - - - QtiPlot - End limit error - - - - - - QtiPlot - Input error - Please enter x limits that satisfy: from < end! - - - - - QtiPlot - Input function error - - Please enter parameter limits that satisfy: from < end! - Clea&r Function - &Ok - &Close - Constant - Value - &Add Function @@ -10842,32 +8551,26 @@ GaussAmpFit - GaussAmp Fit - GaussAmp - offset - amplitude - center - width @@ -10875,32 +8578,26 @@ GaussFit - Gauss Fit - Gauss - area - center - width - offset @@ -10908,167 +8605,118 @@ Graph - QtiPlot - File open error - - - QtiPlot - Warning - - - - - - QtiPlot - Error - - Please provide a valid file name! - File format not handled, operation aborted! - layer - Title - Image file: <p><b> %1 </b><p>does not exist anymore! - Data set generated from curve - - Table - - - - The columns - are empty and will not be added to the plot! - The column - is empty and will not be added to the plot! - - &Copy - - &Delete - - - &Properties... - &Rescale to show all 全体表示可能にリサイズ(&R) - Ctrl+Shift+R - &Hide axis - &Show grids - &Scale... - There are no curves available on this plot! - There are no curves with more than two points on this plot. Operation aborted! - F - - Couldn't change the axis type to the requested format! - Y Axis Title - X Axis Title - - Cu&t - - C&lear @@ -11076,35 +8724,26 @@ Graph3D - X axis - Y axis - Z axis - - - QtiPlot - Error - - Please provide a valid file name! - File format not handled, operation aborted! @@ -11112,161 +8751,172 @@ ImageExportDialog - QtiPlot - Choose a filename to save under - Resolution (DPI) - + &Escape special characters in texts + + + Image quality - Save transparency - Native fonts - LaTeX file - Export 3D texts as - Export in &color - - &Escape special characters in title/axis labels - - - - Export &font sizes - Bitmap images - 3D Sort mode - No sort - Simple sort - BSP sort - inch - mm - cm - point - pixel - Unit - Width - Height - &Keep aspect ratio - + QtiPlot + + + + Overwrite file? + + + + %1 already exists. + + + + Do you want to replace it? + + + + QtiPlot - Export error + + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + + + Custom print size - Scale Fonts Factor - Automatic - Print Resolution (DPI) + ImageProfilesTool + + Position + + + + x + + + + y + + + + Z-Value + + + + ImageWidget - - QtiPlot - File openning error - The file: <b>%1</b> doesn't exist! - You don't have the permission to open this file: <b>%1</b> @@ -11274,75 +8924,58 @@ ImportASCIIDialog - QtiPlot - Import ASCII File(s) - All files - Text files - Data files - Comma Separated Values - Import each file as: - - New Table - + New Matrix + + + New Columns - New Rows - Separator: - - - - - TAB - - - - SPACE - The column separator can be customized. The following special codes can be used: \t for a TAB character @@ -11350,38 +8983,31 @@ - The separator must not contain the following characters: 0-9eE.+- - Ignore first - lines - Ignore lines starting with - Use second row as &comments - &Remove white spaces from line ends - By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. @@ -11389,15 +9015,12 @@ - Warning: checking this option leads to column overlaping if the columns in the ASCII file don't have the same number of rows. - - To avoid this problem you should precisely define the column separator using TAB and SPACE characters. @@ -11405,12 +9028,10 @@ - &Simplify white spaces - By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal @@ -11420,7 +9041,6 @@ - Warning: checking this option leads to column overlaping if the columns in the ASCII file don't have the same number of rows. @@ -11428,145 +9048,116 @@ - Decimal Separators - System Locale Setting - Import as &read-only - &Help ヘルプ(&H) - The column separator can be customized. The following special codes can be used: \t for a TAB character \s for a SPACE - The separator must not contain the following characters: 0-9eE.+- - Remove white spaces from line ends - By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. - Simplify white spaces - By checking this option each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. - By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. - Warning: using these two last options leads to column overlaping if the columns in the ASCII file don't have the same number of rows. - To avoid this problem you should precisely define the column separator using TAB and SPACE characters. - QtiPlot - Help - All - &Preview Lines - - New Matrice - Overwrite Current Window - Use first row &as - Column Names - Column Comments - Endline character - LF (Unix) - CRLF (Windows) - CR (Mac) - QtiPlot - File openning error - You don't have the permission to open this file: <b>%1</b> - Omit &thousands separator @@ -11581,27 +9172,22 @@ IntDialog - QtiPlot - Integration Options - Tolerance - Lower limit - Upper limit - &Integrate @@ -11610,32 +9196,26 @@ ヘルプ(&H) - &Close - Function - Variable - Order (1 - 5, 1 = Trapezoidal Rule) - Number of iterations (Max=20) - &Plot area @@ -11643,85 +9223,66 @@ Integration - - Integration - - Numerical integration of - using a %1 order method - Iterations - Tolerance - Points - from - - to - Peak at - Area - QtiPlot - Error - Unknown integration method. Valid values must be in the range: 1 (Trapezoidal Method) to 5. - Plot - QtiPlot - Input error - From - using the Trapezoidal Rule @@ -11729,78 +9290,46 @@ Interpolation - - QtiPlot - - Error - Unknown interpolation method. Valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. - - - - Linear - - - - - - Int - - - - - - Interpolation - - - - Cubic - - - - Akima - QtiPlot - Error - Unknown interpolation method, valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. - You need at least %1 points in order to perform this operation! @@ -11808,82 +9337,66 @@ InterpolationDialog - QtiPlot - Interpolation Options - Make curve from - Spline - Linear - Cubic - Non-rounded Akima - Points - From Xmin - To Xmax - Color - &Make - &Close - QtiPlot - Warning - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - QtiPlot - Input error - Please enter x limits that satisfy: from < to! @@ -11891,7 +9404,6 @@ LayerButton - Activate layer @@ -11899,356 +9411,329 @@ LayerDialog - QtiPlot - Arrange Layers - Automatic &layout - Horizontal - - Center - Left - Right - Vertical - Top - Bottom - Columns - Rows - Grid - &Layer Canvas Size - Width - - - - - - - - pixels - Height - Columns gap - Rows gap - Left margin - Right margin - Top margin - Bottom margin - Spacing - + Unit + + + + inch + + + + mm + + + + cm + + + + point + + + + pixel + + + + &Keep aspect ratio + + + + Margins + + + &Apply - &OK - - &Cancel - QtiPlot - Delete Layers? - You are about to delete %1 existing layers. - Are you sure you want to continue this operation? - &Continue - QtiPlot - Columns input error - The number of columns you've entered is greater than the number of graphs (%1)! - QtiPlot - Rows input error - The number of rows you've entered is greater than the number of graphs (%1)! - Layers - Number - Alignment - Swap Layers - Source Layer - Destination Layer - &Swap - QtiPlot - Error - Please enter different indexes for the source and destination layers! + + Link &X axes + + + + &Fixed size + + + + Align + + + + Canvases + + + + Co&mmon axes + + LineDialog - QtiPlot - Line options - Color - Arrow at &start - Arrow at &end - Length - Angle - &Filled - Arrow &Head - Set &Default - &Apply - &Ok - Page - Layer Scales - Attach to - Scale Coordinates - Pixels - Unit - Start Point - - X - End Point - &Geometry - - Y - Type - Width - &Line 直線(&L) @@ -12256,43 +9741,38 @@ LineProfileTool - - QtiPlot - Pixel selection warning - Please select an image marker first. - Please select the end line point inside the image rectangle! - pixel - intensity - - Table - - - - + x + + + + y + + + pixels - pixel intensity (a.u.) @@ -12300,22 +9780,18 @@ LinearFit - Linear Regression - Linear - QtiPlot - Fit Error - You need at least %1 data points for this fit operation. Operation aborted! @@ -12323,22 +9799,18 @@ LinearSlopeFit - Linear Regression - LinearSlope - QtiPlot - Fit Error - You need at least %1 data points for this fit operation. Operation aborted! @@ -12346,32 +9818,26 @@ LogisticFit - Logistic - Logistic Fit - init value - final value - center - power @@ -12379,32 +9845,26 @@ LorentzFit - Lorentz Fit - Lorentz - area - center - width - offset @@ -12412,189 +9872,135 @@ Matrix - - - - - QtiPlot - Error - Calculation failed, the matrix is not square! - Inversion failed, the matrix is not square! - - - - - - QtiPlot - Ctrl+A Matrix: select all - - Please provide a valid file name! - File format not handled, operation aborted! - QtiPlot - ASCII Export Error - Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! - Invert - Transpose - Flip Vertically - Flip Horizontally - Rotate 90° - - Calculate Values - Clear Selection - Paste - Delete Rows - Delete Columns - Insert Row - Insert Column - - Import Image - Forward FFT - Inverse FFT - Import ASCII File - - - - - Memory Allocation Error - - - - - Not enough memory, operation aborted! - Rotate -90° - Due to memory limitations it will not be possible to undo this change. Do you want to continue anyways? - Warning - Set Dimensions - - Set Data Mode - kB @@ -12602,82 +10008,66 @@ MatrixDialog - Cell Width - Data Format - Numeric Display - QtiPlot - Matrix Properties - &OK - &Cancel - &Apply - Decimal: 1000 - Scientific: 1E3 - Default Decimal Digits - Significant Digits= - Set Columns Width - Decimal - Scientific - Set Data Format %1 - Precision %1 digits @@ -12685,52 +10075,38 @@ MatrixModel - Edited cell - - - - QtiPlot - - Memory Allocation Error - - Not enough memory, operation aborted! - Input Size Error - The dimensions you have specified are not acceptable! - Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! - Multiline expressions take much more time to evaluate! Do you want to continue anyways? - Warning @@ -12738,67 +10114,54 @@ MatrixSizeDialog - Dimensions - Coordinates - Rows - Columns - X (Columns) - Y (Rows) - First - Last - QtiPlot - Matrix Dimensions - &OK - &Cancel - Set Coordinates x[%1 : %2], y[%3 : %4] - &Apply @@ -12806,58 +10169,46 @@ MatrixValuesDialog - QtiPlot - Set Matrix Values - For row (i) - - to - For col (j) - Cell(i,j)= - Add &Function - Add Ce&ll - &Apply - &Close - Set New Formula - Use built-in muParser (much faster) @@ -12865,52 +10216,42 @@ MdiSubWindow - QtiPlot - Do you want to hide or delete - Delete - Hide - Cancel - Normal - Minimized - Maximized - Hidden - B @@ -12918,121 +10259,94 @@ MultiLayer - Do you want QtiPlot to rearrange the remaining layers? - &Yes - &No - &Cancel - QtiPlot - Guess best layout? - Add layer - Remove active layer - - - QtiPlot - Error - - Please provide a valid file name! - File format not handled, operation aborted! - kB - Offset Amount... - Reverse Order - Fill Area... - Offset Dialog - Total Y Offset (%) - Total X Offset (%) - &Apply - - &Close - Fill Curves - Enable Fill - Fill with Color - Side Lines @@ -13040,106 +10354,78 @@ MultiPeakFit - Gauss Fit - Lorentz Fit - multi-peak - - - Peak - QtiPlot - Fit Error - Could not allocate enough memory for the fit curves! - - - Fit - fit of - - peak - Area - Center - Width - Height - - center - - width - - offset - Gauss - Lorentz - - area @@ -13147,12 +10433,10 @@ MultiPeakFitTool - Move cursor and click to select a point and double-click/press 'Enter' to set the position of a peak! - Peak %1 selected! Click to select a point and double-click/press 'Enter' to set the position of the next peak! @@ -13160,45 +10444,38 @@ NonLinearFit - NonLinear - - QtiPlot - Input function error - Please enter a valid non-empty expression! Operation aborted! - - QtiPlot - Fit Error - There are no parameters specified for this fit operation. Please define a list of parameters first! - You must provide a list containing at least one parameter for this type of fit. Operation aborted! - + Ignore + + + Non-linear Fit - - constant @@ -13206,22 +10483,18 @@ Note - Add tab - Please, enter new title: - Title - untitled @@ -13229,62 +10502,58 @@ OpenProjectDialog - QtiPlot - Open Project - QtiPlot project - Compressed QtiPlot project - Origin project - Origin matrix - Origin worksheet - Origin graph - Backup files - + Excel + + + + ODF Spreadsheet + + + All files - Open As - New Project Window - New Folder @@ -13292,77 +10561,62 @@ PatternBox - Solid - Horizontal - Vertical - Cross - BDiagonal - FDiagonal - DiagCross - Dense1 - Dense2 - Dense3 - Dense4 - Dense5 - Dense6 - Dense7 - None @@ -13370,1749 +10624,1348 @@ Plot3DDialog - QtiPlot - Surface Plot Options - &Apply - &OK - &Cancel - - + Scale to paper si&ze + + + + Print Crop&marks + + + + &Print + 印刷(&P) + + X - - Y - - Z - From - To - Type - linear - logarithmic - Major Ticks - Minor Ticks - &Scale - Title - Axis Font - &Choose font - Major Ticks Length - Minor Ticks Length - &Axis - &Font - &Title - &Line 直線(&L) - &Background - General - Lab&els - &Numbers - Coordinate System - Opacity - &Colors - Show Legend - Orthogonal - - Line Width - Resolution - Numbers Font - &Choose Font - Distance labels - axis - Zoom (%) - X Zoom (%) - Y Zoom (%) - Z Zoom (%) - &General - Ma&jor Grids - Mi&nor Grids - Color - - Style - - Solid - - Dash - - - Dot - - Dash Dot - - Dash Dot Dot - - Short Dash - - Short Dot - - Short Dash Dot - G&rid - Cross Hair - Cone - - - - Width - Smooth angles - Radius - Smooth line - Boxed - Quality - Points - Bars - Co&lor - A&xes - &Worksheet - &Matrix - Linea&r color map - Color map &file - - - None - Draw lines - Filled bars + + Tick Labels + + + + Format + + + + Automatic + + + + Decimal: 10000.0 + + + + Scientific: 1e4 + + + + Engineering: 10k + + + + Precision + + PlotDialog - - - &Plot Associations... - Plot type - &Worksheet - &Apply - &OK - &Cancel - Attach curve to: - x Axis - - Bottom - - Top - y Axis - - - Left - - - Right - - Axes - Connect - No line - Lines - Sticks - Horizontal Steps - Dots - Spline - Vertical Steps - - - - - Style - - - - - Width - - - - - - Color - Fill area under curve - Fill color - - - - - - Pattern - - - - Line - - - Size - &Speed Mode, Skip Points if needed - data points - Apply to curves with more than: - - Tolerance (Douglas Peuker algorithm) - - - - - - Speed - - - Apply Format &to - - - Selected Curve - - Fill Color - - Edge Color - - Edge Width - - Skip Points - - None - - - - Symbol - - Box - - Type - No Box - Rectangle - Diamond - Perc 10, 25, 75, 90 - Notch - - Range - - - Standard Deviation - - Standard Error - Perc 25, 75 - Perc 10, 90 - Perc 5, 95 - Perc 1, 99 - - Max-Min - - Constant - - Percentile (%) - Coefficient - Box Width - Whiskers - No Whiskers - 75-25 - 90-10 - 95-5 - 99-1 - Coef - - Box/Whiskers - Max - 99% - - Mean - 1% - Min - - Percentile - - Image - &Gray Scale - &Default Color Map - &Custom Color Map - - Contour Lines - Levels - Use &Color Map - Use Default &Pen - Color Bar Scale - Axis - Contour - Direction - Plus - Minus - &X Error Bar - - Line Width - Cap Width - 8 - 10 - 12 - 16 - 20 - Through Symbol - - - Error Bars - Automatic Binning - &Show statistics - Bin Size - Begin - End - - Histogram Data - Gap Between Bars (in %) - Offset (in %) - - Spacing - Arrowheads - Length - - Angle - &Filled - - End Point - - X End - - Y End - Position - Tail - Middle - Head - - Vector - - - Bins - - Histogram and Probabilities for - Quantity - Sum - Percent - Minimum - Maximum - &Delete - - - &Edit... - - - - - Colors - + &Function + + + Vertical Bars - Horizontal Bars - Histogram - Vector XYXY - Vector XYAM - Scatter - Line + Symbol - - - - QtiPlot - Input error - Please enter a valid start limit! - Please enter a valid end limit! - Please enter a valid bin size value! - QtiPlot - Start limit error - QtiPlot - End limit error - Please enter limits that satisfy: begin < end! - - QtiPlot - Bin size input error - Please enter a positive bin size value! - Vector Data - Magnitude - QtiPlot - Plot details - Titles - Axes Labels - Axes Numbers - Legends - - Fonts - Background Color - - Opacity - - Transparent - Canvas Color - Border Color - Margin - Antialiasing - - - - - - - - - Layer - Origin - X= - Y= - width= - height= - Keep aspect ratio - - - Geometry - Border - First color - Fill - Pie - &Scale layers to paper size - Print Crop&marks - - Print - &Show - Column - White O&ut - Justify - Center - &Font - Rotate (deg) - X Offset (font height %) - Y Offset (font height %) - - - - - Labels - 3D View - View Angle (deg) - Thickness (% of radius) - Rotation - Starting Azimuth (deg) - Radius/Center - Radius (% of frame) - Horizontal Offset (% of frame) - - Pie Geometry - Automatic &Format - &Values - &Percentages - Categories/&Rows - Associate Position with &Wedge - Dist. from Pie Edge - Counter cloc&kwise - inch - mm - cm - point - pixel - Unit - Apply &to... - - - - Window - - - - All Windows - Set As &Default - Pen - Matrix - Use matrix formula to calculate values - - Values - &Show Contour Lines - Set Equidistant Levels - Start - Step - Set &Levels - Use &Table Custom Pen + + Link &X axes + + + + Miscellaneous + + + + 0 (all data points) + + + + Tolerance (Douglas-Peucker algorithm) + + + + Scale &Fonts + + + + Do not &resize layers when window size changes + + + + Dimensions + + PlotWizard - QtiPlot - Select Columns to Plot - &X - x&Err - &Y - yE&rr - &Z - &New curve - &Delete curve - Worksheet - &Plot - &Close - - - - - - - - - - - - - - - - QtiPlot - Error - Please define a Y column for the following curve - You have already defined a X column! - - - - You must define a X column first! - You have already defined a Y column! - - - This kind of curve is not handled by QtiPlot! - You have already defined a Z column! - - You must define a Y column first! - - You have already defined an error-bars column! - You must add a new curve first! @@ -15120,37 +11973,26 @@ PluginFit - Plugin Fit - QtiPlot - File not found - Plugin file: <p><b> %1 </b> <p>not found. Operation aborted! - - - - QtiPlot - Plugin Error - The plugin does not implement a %1 method necessary for simplex fitting. - - - The plugin does not implement a %1 method necessary for Levenberg-Marquardt fitting. @@ -15158,67 +12000,54 @@ PolynomFitDialog - QtiPlot - Polynomial Fit Options - Polynomial Fit of - Order (1 - 9, 1 = linear) - Fit curve # pts - Not enough points - Fit curve Xmin - Fit curve Xmax - Color - Show Formula on Graph? - &Fit - &Close - QtiPlot - Warning - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! @@ -15226,400 +12055,367 @@ PolynomialFit - QtiPlot - Fit Error - You need at least %1 data points for this fit operation. Operation aborted! - Polynomial Fit - Polynomial + PreviewTable + + Numeric + + + + Text + + + + Date + + + + Time + + + + Month + + + + Day + + + + Choose column type + + + + Column type: + + + + PythonScripting - Failed to export QtiPlot API - Accessing QtiPlot functions or objects from Python code won't work. Probably your version of Qt/SIP/PyQt differs from the one QtiPlot was compiled against. + + Couldn't find initialization files + + + + Please indicate the correct path to the Python configuration files in the preferences dialog. + + QObject - The file is not an QtiPlot fit model file. - The file is not an QtiPlot fit model version 1.0 file. - The file is not a QtiPlot custom action file. - The file is not an QtiPlot custom action version 1.0 file. - The file is not a QtiPlot custom menu file. - The file is not a QtiPlot custom menu version 1.0 file. - QtiPlot - Script Error - Python-like syntax is not supported in this case since it severely reduces drawing speed! - - QtiPlot - Math Error - - - - QtiPlot - - Ignored data point at x = %1. - - - - Found non-removable singularity at x = %1. - abs(x): Absolute value of x. - acos(x): Inverse cos function. - acosh(x): Hyperbolic inverse cos function. - asin(x): Inverse sin function. - asinh(x): Hyperbolic inverse sin function. - atan(x): Inverse tan function. - atanh(x): Hyperbolic inverse tan function. - avg(x,y,...): Mean value of all arguments. - bessel_j0(x): Regular cylindrical Bessel function of zeroth order, J_0(x). - bessel_j1(x): Regular cylindrical Bessel function of first order, J_1(x). - bessel_jn(double x, int n): Regular cylindrical Bessel function of order n, J_n(x). - bessel_jn_zero(double n, unsigned int s): s-th positive zero x_s of regular cylindrical Bessel function of order n, J_n(x_s)=0 - bessel_y0(x): Irregular cylindrical Bessel function of zeroth order, Y_0(x), for x>0. - bessel_y1(x): Irregular cylindrical Bessel function of first order, Y_1(x), for x>0. - bessel_yn(double x, int n): Irregular cylindrical Bessel function of order n, Y_n(x), for x>0. - beta(a,b): Computes the Beta Function, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) for a > 0, b > 0. - ceil(x): Round to the next larger integer, smallest integer larger or equal to x. - cos(x): Calculate cosine. - cosh(x): Hyperbolic cos function. - erf(x): The error function. - erfc(x): Complementary error function erfc(x) = 1 - erf(x). - erfz(x): The Gaussian probability density function Z(x). - erfq(x): The upper tail of the Gaussian probability function Q(x). - exp(x): Exponential function: e raised to the power of x. - floor(x): Round to the next smaller integer, largest integer smaller or equal to x. - gamma(x): Computes the Gamma function, subject to x not being a negative integer. - gammaln(x): Computes the logarithm of the Gamma function, subject to x not a being negative integer. For x<0, log(|Gamma(x)|) is returned. - gauss_cdf(x, sigma): Computes the cumulative distribution function for a Gaussian distribution with standard deviation sigma. - gauss_pdf(x, sigma): Computes the probability density at x for a Gaussian distribution with standard deviation sigma. - hazard(x): Computes the hazard function for the normal distribution h(x) = erfz(x)/erfq(x). - if(e1, e2, e3): if e1 then e2 else e3. - inv_gauss_cdf(x, sigma): Computes the inverse of the cumulative distribution function for a Gaussian distribution with standard deviation sigma. - ln(x): Calculate natural logarithm log_e. - log(x): Calculate decimal logarithm log_10. - log10(x): Calculate decimal logarithm log_10. - log2(x): Calculate binary logarithm log_2. - min(x,y,...): Calculate minimum of all arguments. - max(x,y,...): Calculate maximum of all arguments. - mod(x,y): Calculate rest of integer division x/y, x modulo y. - pow(x,y): Raise x to the power of y, x^y. - rint(x): Round to nearest integer. - sign(x): Sign function: -1 if x<0; 1 if x>0. - sin(x): Calculate sine. - sinh(x): Hyperbolic sin function. - sqrt(x): Square root function. - sum(x,y,...): Calculate sum of all arguments. - tan(x): Calculate tangent function. - tanh(x): Hyperbolic tan function. - ttable(x, n): Student's t-distribution with n degrees of freedom. - w0(x): Compute the principal branch of Lambert's W function, W_0(x). W is defined as a solution to the equation W(x)*exp(W(x))=x. @@ -15627,121 +12423,111 @@ - wm1(x): Compute the secondary branch of Lambert's W function, W_{-1}(x). W is defined as a solution to the equation W(x)*exp(W(x))=x. For x<0, there are two real-valued branches; this function computes the one where W<-1 for x<0. (also see w0(x)). + + AVG("colName", i, j): + The average of all cells from row i to j in column colName. + + + + SUM("colName", i, j): + The sum of all cells from row i to j in column colName. + + + + QtiPlot - Memory Allocation Error + + + + Not enough memory, operation aborted! + + + + The function %1 is not defined in the specified interval! + + + + rnd(seed): + Returns a pseudo-random number in the range 0 to 1. Calling this function several times with the same seed will return the same value. + + QtColorPicker - - - Black - - White - - Red - - Dark red - - Green - - Dark green - - Blue - - Dark blue - - Cyan - - Dark cyan - - Magenta - - Dark magenta - - Yellow - - Dark yellow - - Gray - - Dark gray - - Light gray - Custom @@ -15749,55 +12535,34 @@ RangeSelectorTool - - - - - - QtiPlot - Warning - All the curves on this plot are empty! - Click or use Ctrl+arrow key to select range (arrows select active cursor)! - - - Right - - - Left - - - - - The column '%1' is read-only! Operation aborted! - Remove data from curves? - Copy data to clipboard? @@ -15805,47 +12570,38 @@ RenameWindowDialog - Window Title - &Name (single word) - &Label - &Both Name and Label - QtiPlot - Rename Window - &OK - &Cancel - QtiPlot - Warning - For internal consistency reasons the underscore character is replaced with a minus sign. @@ -15853,7 +12609,6 @@ ScreenPickerTool - Click on plot or move cursor to display coordinates! @@ -15861,149 +12616,118 @@ ScriptEdit - E&xecute - Ctrl+J - Execute &All - Ctrl+Shift+J - &Evaluate Expression - Ctrl+Return - &Print 印刷(&P) - Rena&me Tab... - A&dd Tab - C&lose Tab - Auto&exec - &Functions - - Text - - All Files - QtiPlot - Import Text From File - QtiPlot - Error Opening File - Could not open file "%1" for reading. - Save Text to File - QtiPlot - File Save Error - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - &Save - &Import... - Sa&ve as... - &Find... - &Replace... - &Find next - &Find previous - QtiPlot - QtiPlot has finished searching the document. @@ -16011,308 +12735,210 @@ ScriptWindow - - QtiPlot - Script Window - - &File ファイル(&F) - - &Edit 編集(&E) - - - - E&xecute - - &New 新規作成(&N) - - Ctrl+N - - &Open... - - Ctrl+O - - &Save - - Ctrl+S - - Save &As... - - &Print 印刷(&P) - - Ctrl+P - - &Undo 元に戻す(&U) - - Ctrl+Z - - &Redo やり直す(&R) - - Ctrl+Y - - &Cut - - Ctrl+x - - &Copy - - Ctrl+C - - &Paste - - Ctrl+V - - Increase Indent - - Decrease Indent - - &Find... - - Ctrl+Alt+F - - Find &Next - - F3 - - Find &Previous - - F4 - - &Replace... - - CTRL+J - - Execute &All - - CTRL+SHIFT+J - - &Evaluate Expression - - CTRL+Return - QtiPlot - File Save Error - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - &Window - Always on &Top - You need to close and reopen the script window before your changes become effective! Do you want to close it now? - - QtiPlot - Show &Line Numbers - - Script Output Panel - - Show Script &Output Panel - - Ouput on Next &Line - Show Script Output Panel - - Print Pre&view... - Script print preview - - &Close - - Show &Workspace @@ -16320,7 +12946,6 @@ ScriptingEnv - %1 Source (*.%2);; @@ -16328,27 +12953,22 @@ ScriptingLangDialog - QtiPlot - Select scripting language - OK - Cancel - QtiPlot - Scripting Error - Scripting language "%1" failed to initialize. @@ -16356,52 +12976,42 @@ SetColValuesDialog - QtiPlot - Set column values - For row (i) - to - Add function - Add column - Add cell - &Apply - &Close - Use built-in muParser (much faster) - Clear &Formulas @@ -16409,32 +13019,26 @@ SigmoidalFit - Boltzmann (Sigmoidal) Fit - Boltzmann - init value - final value - center - time constant @@ -16442,59 +13046,46 @@ SmoothCurveDialog - QtiPlot - Smoothing Options - Curve - Polynomial Order - Points to the Left - Points to the Right - - - Color - f - Iterations - Points - &Smooth - &Close @@ -16502,95 +13093,62 @@ SmoothFilter - Smoothed - - - - - - - - QtiPlot - - - - - - - - Error - Unknown smooth filter. Valid values are: 1 - Savitky-Golay, 2 - FFT, 3 - Moving Window Average, 4 - Lowess. - - - - points - Savitzky-Golay smoothing - FFT smoothing - average smoothing - - Lowess smoothing + Lowess smoothing with f=%1 and %2 iterations - The number of points must be positive! - - The polynomial order must be lower than the number of left points plus the number of right points! - Setting polynomial order is only available for Savitzky-Golay smooth filters! Ignored option! - Setting Lowess parameter is only available for Lowess smooth filters! Ignored option! - The parameter f must be between 0 and 1! - The number of iterations must be at least 1! @@ -16598,311 +13156,310 @@ SortDialog - QtiPlot - Sorting Options - Sort columns - Order - Leading column - &Sort - &Close - Separately - Together - Ascending - Descending + SubtractDataDialog + + QtiPlot + + + + Math on Data Sets + + + + Cu&rve + + + + &Operator + + + + &Data set + + + + Current &folder + + + + &Value + + + + &Apply + + + + &Close + + + + Error + + + + Data set %1 must containt at least two valid data points in order to perform this operation! + + + + + SubtractLineTool + + Move cursor and click to select and double-click/press 'Enter' to set the position of the first point! + + + + First point selected! Click to select and double-click/press 'Enter' to set the position of the 2nd point! + + + + SurfaceDialog - QtiPlot - Define surface plot - f(x,y)= - X - axis - - - - - From - - - - - To - Y - axis - Z - axis - - Clear &list - - - - &OK - &Close - QtiPlot - Input error - Please enter limits that satisfy: from < end! - QtiPlot - Input function error - Surface type - Function - Parametric - - + Clea&r + + + + Rece&nt + + + + Click here to select a recently typed expression + + + Mesh - - Columns - - Rows - Equations - X(u,v)= - Y(u,v)= - Z(u,v)= - u - - Periodic - v - QtiPlot - X Formula Error - QtiPlot - Y Formula Error - QtiPlot - Z Formula Error - - QtiPlot - u start limit error - - - - - - QtiPlot - u end limit error - - - - - QtiPlot - v start limit error + QtiPlot + + + + Sorry, there are no recent expressions available! + + + + Recent Functions + + + + Please, choose a function: SymbolBox - No Symbol - Ellipse - Rectangle - Diamond - Triangle - Down Triangle - Up Triangle - Left Triangle - Right Triangle - Cross - Diagonal Cross - Horizontal Line - Vertical Line - Star 1 - Star 2 - Hexagon @@ -16910,12 +13467,10 @@ SymbolDialog - &Close - QtiPlot - Choose Symbol @@ -16923,168 +13478,106 @@ Table - - - - - - - - - - - - - - - QtiPlot - Error - There is already a column called : <b> - - Yes - - Cancel - - - Column '%1' is read only! - The table '%1' contains read-only columns! Operation aborted! - - - - - - - - The folowing columns - - - - - - - - are read only! - Paste operation - How should QtiPlot interpret first clipboard line? - &Values - Column &Names - &Comments - Please indicate the name of the leading column! - The leading column is empty! Operation aborted! - QtiPlot - ASCII Export Error - Could not write to file: <br><h4> - Rows will be deleted from the table! - - Do you really want to continue? - - - - QtiPlot - Columns will be deleted from the table! - Qtiplot - Reading file... - kB - Multiline expressions take much more time to evaluate! Do you want to continue anyways? - Warning @@ -17092,343 +13585,270 @@ TableDialog - QtiPlot - Column options - Column Name: - Enumerate all to the right - &OK - &Apply - &Cancel - Plot Designation: - None - X (abscissae) - Y (ordinates) - Z (height) - X Error - Y Error - Display - Numeric - Text - Date - Time - Month - Day of Week - Format: - Precision: - Apply to all columns to the right - Options - Column Width: - Apply to all - Comment: - QtiPlot - Warning - For internal consistency reasons the underscore character is replaced with a minus sign. - - QtiPlot - Error - - The column names must only contain letters and digits! - - - - Default - Decimal: 1000 - Scientific: 1E3 - yyyy-MM-dd - h - h ap - h AP - h:mm - h:mm ap - hh:mm - h:mm:ss - h:mm:ss.zzz - mm:ss - mm:ss.zzz - hmm - hmmss - hhmmss - &Read-only - &Display Comments in Header - dd/MM/yyyy - dd.MM.yyyy - dd MM yyyy - yyyyMMdd - Couldn't guess the source data format, please specify it using the 'Format' box! - For more information about the supported date/time formats please read the Qt documentation for the QDateTime class! - Label - &Hidden - dd/MM/yyyy HH:mm - dd/MM/yyyy HH:mm:ss - dd.MM.yyyy HH:mm - dd.MM.yyyy HH:mm:ss - dd MM yyyy HH:mm - dd MM yyyy HH:mm:ss - yyyy-MM-dd HH:mm - yyyy-MM-dd HH:mm:ss - yyyyMMdd HH:mm - yyyyMMdd HH:mm:ss @@ -17436,100 +13856,74 @@ TableStatistics - RowStats - Row Statistics of %1 - Row - Cols - - Mean - - StandardDev - - Variance - - Sum - - Max - - Min - ColStats - Column Statistics of %1 - Col - Rows - iMax - iMin - - StandardError - - Median @@ -17537,110 +13931,86 @@ TextDialog - QtiPlot - Text options - Text Color - Font - &Font - Alignment - Center - Left - Right - - - - QtiPlot - X Axis Title - Y Axis Title - Top Axis Title - Right Axis Title - &Apply to... - Object - Layer - Window - All Windows - &Close - Distance to axis - &Inverted @@ -17648,17 +14018,14 @@ TextEditor - QtiPlot - Confirmation - Are you sure you want to add %1 text lines into this text box? @@ -17666,19 +14033,16 @@ TextFormatButtons - B Button bold - It Button italics - U Button underline @@ -17687,47 +14051,38 @@ ThreeExpFit - Exponential decay - ExpDecay3 - first amplitude - first lifetime - second amplitude - second lifetime - third amplitude - third lifetime - offset @@ -17735,36 +14090,26 @@ TranslateCurveTool - Curve selected! Move cursor and click to choose a point and double-click/press 'Enter' to finish! - - - - QtiPlot - Warning - This operation cannot be performed on function curves. - This operation cannot be performed on curves plotted from columns having a non-numerical format. - - The column '%1' is read-only! Operation aborted! - Double-click on plot to select a data point! @@ -17772,37 +14117,30 @@ TwoExpFit - Exponential decay - ExpDecay2 - first amplitude - first lifetime - second amplitude - second lifetime - offset @@ -17810,71 +14148,58 @@ muParserScript - col() works only on tables! - - There's no column named %1 in table %2! - - - There's no row %1 in table %2! - - - There's no column %1 in table %2! - There's no row %1 in matrix %2! - There's no column %1 in matrix %2! - - - - Out of memory - + SUM() works only on tables! + + + + AVG() works only on tables! + + + tablecol() works only on tables! - tablecol: wrong number of arguments (need 2, got %1) - tablecol: first argument must be a string (table name) - Couldn't find a table named %1. - - cell() works only on tables and matrices! === added file 'qtiplot/translations/qtiplot_ro.ts' --- qtiplot/translations/qtiplot_ro.ts 1970-01-01 00:00:00 +0000 +++ qtiplot/translations/qtiplot_ro.ts 2010-07-21 23:21:08 +0000 @@ -0,0 +1,17658 @@ + + + + + + + QtiPlot - File openning error + QtiPlot - Eroare de deschidere fişier + + + You don't have the permission to open this file: <b>%1</b> + Nu aveţi permisiunea să deschideţi fişierul: <b>%1</b> + + + QtiPlot - File opening error + QtiPlot - Eroare de deschidere fişier + + + The file: <b>%1</b> doesn't exist! + Fişierul: <b>%1</b> nu există! + + + The file: <b>%1</b> is not a QtiPlot or Origin project file! + Fişierul: <b>%1</b> nu este un fişier creat folosind QtiPlot sau OriginLab! + + + QtiPlot - Demo Version + QtiPlot - Versiune de test + + + You are using the demonstration version of Qtiplot. + + Folosiţi versiunea de test a QtiPlot. + + + QtiPlot - File backup error + QtiPlot - Eroare de salvare a fişerului + + + Cannot make a backup copy of <b>%1</b> (to %2).<br>If you ignore this, you run the risk of <b>data loss</b>. + Nu a fost posibilă crearea unei copii de siguranţă pentru fişierul <b>%1</b> (în %2).<br>Daca ignoraţi acest mesaj riscaţi<b>să pierdeţi date</b>. + + + QtiPlot - File save error + QtiPlot - Eroare de salvare a fişerului + + + The file: <br><b>%1</b> is opened in read-only mode + Fişierul: <br><b>%1</b> este accesibil doar pentru citire + + + QtiPlot project + Proiect QtiPlot + + + Compressed QtiPlot project + Proiect QtiPlot arhivat + + + Save project as + Salvează proiectul ca + + + Save &As Project... + Salvează c&a proiect... + + + &Show All Windows + &Arată toate ferestrele + + + &Hide All Windows + Ascu&nde toate ferestrele + + + &Delete Folder + Şte&rge dosar + + + &Rename + &Redenumeşte + + + New &Window + &Fereastră nouă + + + New F&older + D&osar nou + + + &None + &Nici una + + + &Windows in Active Folder + &Ferestrele din dosarul activ + + + Windows in &Active Folder && Subfolders + Ferestrele din dosarul &activ şi din dosarele conţinute de acesta + + + &View Windows + Afişază &ferestrele + + + &Properties... + &Proprietăti... + + + Hidden + Ascuns + + + QtiPlot - Error + QtiPlot - Eroare + + + Please enter a valid name! + Vă rugăm introduceţi un nume valid! + + + Name already exists! + Acest nume e deja folosit! + + + Please choose another name! + Vă rugăm alegeţi un alt nume! + + + Type + Tip + + + Project + Proiect + + + Path + Cale + + + Size + Mărime + + + bytes + biţi + + + Contents + Conţinut + + + windows + ferestre + + + folders + dosare + + + Created + Creat + + + Modified + Modificat + + + Properties + Proprietăţi + + + Folder + Dosar + + + New Folder + Dosar nou + + + QtiPlot - Delete folder? + QtiPlot - Şterge dosarul? + + + Delete folder '%1' and all the windows it contains? + Şterge dosarul '%1' şi toate ferestrele pe care le conţine? + + + Yes + Da + + + No + Nu + + + Matrix + Matrice + + + Table + Tabel + + + Note + Note + + + Graph + Grafic + + + 3D Graph + Grafic 3D + + + Label + Etichetă + + + Status + Statut + + + QtiPlot - No match found + QtiPlot - Căutare fără rezultat + + + Sorry, no match found for string: '%1' + Ne pare rău, nu a fost găsit nici un rezultat pentru şirul de caractere: '%1' + + + Cannot move an object to itself! + Un obiect nu poate fi mutat în el însuşi! + + + Cannot move a parent folder into a child folder! + Un dosar nu poate fi mutat intr-un dosar pe care îl conţine! + + + QtiPlot + QtiPlot + + + Skipped moving folder + Dosarul nu a fost mutat + + + The destination folder already contains a folder called '%1'! Folder skipped! + Dosarul de destinaţie conţine deja un dosar numit '%1'! Dosarul a fost sărit! + + + Error + Eroare + + + QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! + QtiPlot va încerca să aducă informaţia necesară despre ultima versiune disponibilă. Vă rugăm să permiteţi conectarea la internet! + + + Do you wish to continue? + Doriţi să continuaţi? + + + QtiPlot - HTTP get version file + QtiPlot - Acces la informaţia despre ultima versiune folosind HTTP + + + Error while fetching version file with HTTP: %1. + Eroare de acces la fişierul cu informaţii despre ultima versiune disponibilă folosind HTTP: %1. + + + QtiPlot - Updates Available + QtiPlot - Actualizare disponibilă + + + There is a newer version of QtiPlot (%1) available for download. Would you like to download it? + Există o versiune mai nouă (%1) pentru QtiPlot. Vreţi să o instalaţi? + + + QtiPlot - No Updates Available + QtiPlot - Nu s-au găsit actualizări + + + No updates available. Your current version %1 is the last version available! + Nu e disponibilă o versiune mai nouă. Versiunea dumneavoastră %1 este ultima versiune disponibilă! + + + QtiPlot - Warning + QtiPlot - Avertisment + + + This will clear the contents of all the data associated with the table. Are you sure? + Toate seturile de date asociate cu acest tabel vor fi şterse. Sunteţi sigur? + + + &Yes + &Da + + + &No + &Nu + + + QtiPlot - Enter row number + QtiPlot - Introduceţi numărul liniei + + + Row + Linie + + + QtiPlot - Enter column number + QtiPlot - Introduceţi numărul coloanei + + + Column + Coloană + + + QtiPlot was not built with Python scripting support included! + QtiPlot nu a fost compilat cu suport pentru limbajul de programare Python! + + + Please select a Y column to plot! + Vă rugam să selectaţi o coloana de tip Y! + + + You need at least two columns for this operation! + E nevoie de cel puţin două coloane pentru aceasta operaţiune! + + + Please set a default X column for this table, first! + Vă rugăm să definiţi mai întâi o coloană de tip X pentru acest tabel! + + + Please select a Z column for this operation! + Vă rugăm să selectaţi o coloană de tip Z pentru această operaţie! + + + You need to define a X column first! + Vă rugam să definiţi mai întâi o coloana de tip X! + + + You need to define a Y column first! + Vă rugam să definiţi mai întâi o coloana de tip Y! + + + Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. + Începând cu versiunea 0.9.1 QtiPlot salveaza funcţiile de ajustare definite de utilizator într-un alt loc. + + + If you want to save your already defined models, please choose a destination folder. + Dacă doriţi să salvaţi funcţiile de ajustare create, vă rugăm să alegeţi un dosar. + + + Import fit models + Importă funcţii de ajustare + + + Choose a directory to export the fit models to + Alegeţi un dosar în care să exportaţi funcţiile de ajustare + + + No Icon + Fără icoană + + + Couldn't load file: %1. +Autocompletion will not be available! + Fişierul: %1 nu a putut fi încărcat.Sugestiile de completare automată nu vorfi disponibile! + + + QtiPlot - Column selection error + QtiPlot - Eroare de selecţie a coloanei + + + Open File + Deschide fişier + + + Imported sound file + Importă fişier de sunet + + + Format + Format + + + This is not a PCM type WAV file, operation aborted! + Acesta nu este un fişier WAV de tip PCM, operaţiunea a fost abandonată! + + + PCM + PCM + + + Time + Timp + + + Left + Stânga + + + Right + Dreapta + + + Data + Date + + + Channels + Canale + + + Sample Rate + Eşantionare + + + Byte Rate + Număr de biţi + + + Block Align + Aliniere bloc + + + Bits Per Sample + Numărul de biţi pe eşantion + + + The file: <b>%1</b> is the current file! + Fişierul: <b>%1</b> este fişierul curent! + + + The file <b>%1</b> is corrupted, but there exists a backup copy.<br>Do you want to open the backup instead? + Fişierul <b>%1</b> nu poate fi deschis, dar există o copie.<br>Vreţi să o deschideţi pe aceasta? + + + The file: <b> %1 </b> was not created using QtiPlot! + Fişierul: <b> %1 </b> nu a fost creat de QtiPlot! + + + The file: <p><b> %1 </b><p> is the current file! + Fişierul: <p><b> %1 </b><p> este fişierul curent! + + + QtiPlot - File Open Error + QtiPlot - Eroare de deschidere fişier + + + The file: <b> %1 </b> <p>does not exist anymore!<p>It will be removed from the list. + Fişierul: <b> %1 </b> <p>nu mai există!<p>Va fi şters din listă. + + + The file "%1" was created using "%2" as scripting language. + +Initializing support for this language FAILED; I'm using "%3" instead. +Various parts of this file may not be displayed as expected. + Fişierul "%1" a fost creat folosind ca limbaj de programare "%2". + +Iniţializarea suportului pentru acest limbaj de programare nu a fost posibilă; se foloseşte în loc limbajul "%3". +Diverse părţi din acest fişier ar putea fi afişate incorect. + + + Window + Fereastră + + + QtiPlot - Opening file + QtiPlot - Deschidere fişier + + + Script Error + Eroare de programare + + + QtiPlot - Scripting Error + QtiPlot - Eroare de programare + + + Scripting language "%1" failed to initialize. + Limbajul de programare "%1" nu a putut fi iniţializat. + + + QtiPlot - Open Template File + QtiPlot - Deschidere fişier model + + + The file: <b>%1</b> is not a QtiPlot template file! + Fişierul: <b>%1</b> nu este un fişier model creat de QtiPlot! + + + Table1 + Tabel1 + + + QtiPlot - Export Error + QtiPlot - Eroare de export + + + <h4>There are no plot layers available in this window!</h4> + <h4>Nu există grafice disponibile în această fereastra!</h4> + + + Presentation Preview + Previzualizare prezentare + + + &Save + &Salvează + + + &Cancel + &Anulează + + + Choose a directory to export the graphs to + Alegeţi un dosar în care să exportaţi graficele + + + Output format: + Format de export: + + + Directory: + Dosar: + + + There are no plot layers available in window <b>%1</b>.<br>Graph window not exported! + Nu există grafice disponibile în fereastra <b>%1</b>.<br>Fereastra nu a fost exportată! + + + A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? + Există deja un fişier cu numele: <p><b>%1</b><p>. Vreţi să-l rescrieţi? + + + QtiPlot - Overwrite file? + QtiPlot - Rescriere fişier? + + + QtiPlot - Export error + QtiPlot - Eroare de export + + + Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! + Nu a fost posibilă scrierea în fişierul: <br><h4> %1 </h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie! + + + Minimized + Minimizat + + + Save Project As + Salvează proiectul ca + + + QtiPlot Matrix Template + Model de matrice QtiPlot + + + QtiPlot 2D Graph Template + Model de grafic 2D QtiPlot + + + QtiPlot Table Template + Model de tabel QtiPlot + + + QtiPlot 3D Surface Template + Model de grafic 3D QtiPlot + + + Save Window As Template + Salvează fereastra ca model + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + Nu a fost posibilă scrierea în fişierul: <br><h4> %1 </h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie! + + + The name you chose is not valid: only letters and digits are allowed! + Numele ales nu este valid: sunt permise doar litere şi cifre! + + + Name <b>%1</b> already exists! + Numele <b>%1</b> este deja utilizat! + + + Warning: for internal consistency reasons the underscore character is replaced with a minus sign. + Avertisment: din motive legate de reprezentarea internă folosită de QtiPlot, caracterul "_" va fi înlocuit cu semnul minus '-'. + + + <h4>There are no plot layers available in this window.</h4><p><h4>Please add a layer and try again!</h4> + <h4>Nu există grafice disponibile în această fereastra.</h4><p><h4>Vă rugam adăugaţi un grafic şi încercaţi din nou!</h4> + + + This functionality is not available for pie plots! + Această operaţie nu este disponibilă pentru graficele placintă! + + + &All + &Toate + + + QtiPlot - Enter rows number + QtiPlot - Introduceţi numărul de linii + + + Rows + Linii + + + QtiPlot - Delete rows + QtiPlot - Ştergere linii + + + Start row + Prima linie + + + End row + Ultima linie + + + QtiPlot - Enter columns number + QtiPlot - Introduceţi numărul de coloane + + + Columns + Coloane + + + Please select a column first! + Vă rugam să selectaţi mai întâi o coloană! + + + Please select two columns for this operation! + Vă rugam să selectaţi două coloane pentru aceasta operaţiune! + + + Please select exactly one columns for this operation! + Vă rugăm să selectaţi o singură coloană! + + + Please select two columns for this operation: + the first represents the signal and the second the response function! + Va rugăm selecţionaţi două coloane pentru această operaţie: prima reprezintă semnalul şi a doua funcţia răspuns! + + + QtiPlot - Row selection error + QtiPlot - Eroare de selecţie a liniei + + + Please select a row first! + Vă rugam să selectaţi mai întâi o linie! + + + Special Line/Symb&ol + Linie/Simb&ol special + + + Spec&ial Bar/Column + Linii/Coloane spec&iale + + + Statistical &Graphs + Grafice &statistice + + + &Plot + &Grafic + + + Cu&t + &Taie + + + &Copy + &Copiază + + + Past&e + Li&peşte + + + &X + &X + + + &Y + &Y + + + &Z + &Z + + + &Label + &Etichetă + + + X E&rror + E&roare X + + + Y &Error + &Eroare Y + + + Set As + Defineşte ca + + + &Fill Column With + &Umplere coloană cu + + + &Column + &Coloană + + + &Normalize + &Normare + + + Clea&r + Go&leşte + + + &Delete + Şte&rge + + + &Insert + &Inserază + + + &Ascending + &Ascendent + + + &Descending + &Descendent + + + Sort Colu&mn + Sortare coloa&nă + + + Pa&nel + Pa&nou + + + &Read-only + Numai citi&re + + + Read/&Write + Citire/&Scriere + + + &Fill Columns With + &Umple coloanele cu + + + You need to select at least one Y column for this operation! + Trebuie să selectaţi cel puţin o coloană de tip Y pentru această operaţiune! + + + Y2 Axis Title + Titlu Axă Y2 + + + Not available for empty 3D surface plots! + Indisponibil pentru suprafeţe 3D goale! + + + Set Display Range + Defineşte intervalul de afişaj + + + <h4>There are no plot layers available in this window.</h4> + <h4>Nu există grafice disponibile în această fereastra.</h4> + + + This will modify the data in the worksheets! +Are you sure you want to continue? + Datele din tabele vor fi modificate. Sunteţi sigur că vreţi să continuaţi? + + + Continue + Continuă + + + Cancel + Anulează + + + Choose a filename to save under + Alegeţi un nume de fişier + + + Could not write to file: <h4>%1</h4><p>Please verify that you have the right to write to this location or that the file is not being used by another application! + Nu a fost posibilă scrierea în fişierul: <h4>%1</h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie sau că fişierul nu este folosit de un alt program! + + + Print preview of window: + Previzualizare tipărire fereastră: + + + Please select a 'Y' column first! + Vă rugam să selectaţi mai întâi o coloana de tip Y! + + + Sorry, there are no results to display! + Regretăm, nu există rezultate disponibile pentru afişare! + + + There are no plot layers available in this window! + Nu există grafice disponibile în această fereastra! + + + There are no curves available on this plot! + Nu există curbe disponibile în acest grafic! + + + There are no layers available on this plot. Operation aborted! + Nu există grafice disponibile în această fereastra! + + + QtiPlot - Insert image from file + QtiPlot - Inserează imagine din fişier + + + There are no plot layers available in this window. + Nu există grafice disponibile în această fereastra. + + + QtiPlot - Duplicate window error + QtiPlot - Eroare de duplicare + + + There are no windows available in this folder! + Nu există ferestre disponibile în acest dosar! + + + QtiPlot - Duplicate error + QtiPlot - Eroare de duplicare + + + Empty 3D surface plots cannot be duplicated! + Suprafeţele 3D nu pot fi duplicate! + + + Released + Apărut + + + About QtiPlot + Despre QtiPlot + + + &Translate + &Translatează + + + Vie&w + &Afişaj + + + &Palette + &Paletă + + + &Convert to Spreadsheet + &Transformă in tabel + + + &Recent Projects + Proiecte &recente + + + Export + Exportă + + + &Folders + &Dosare + + + &Cascade + Aranjare in &cascadă + + + &Tile + Aranjare pe &tot ecranul + + + Close &Window + Închidere &fereastră + + + More windows... + Mai multe ferestre... + + + &View Pixel Line profile + &Afişaza profilul liniei de pixeli + + + &Intensity Matrix + Matrice de &intensitate + + + &Cut + &Taie + + + Please use the project explorer to select a window! + Vă rugăm utilizaţi exploratorul de proiect pentru a selecţiona o fereastră! + + + Normal + Normal + + + Save changes to project: <p><b> %1 </b> ? + Salvează modificările proiectului: <p><b> %1 </b> ? + + + UNTITLED + NEINTITULAT + + + QtiPlot - untitled + QtiPlot - neintitulat + + + &Delete Selection + Sterge &selecţia + + + Auto &Column Width + Lărgime de &coloană automată + + + &Delete Window + Şte&rge fereastra + + + &Rename Window + &Redenumeşte fereastra + + + &Print Window + Im&primă fereastra + + + D&epending Graphs + Grafice d&ependente + + + D&epending 3D Graphs + Grafice 3D d&ependente + + + D&epends on + D&epinde de + + + Function + Funcţie + + + Maximized + Maximizat + + + Re&move Pie Curve + Şte&rge graficul plăcintă + + + &Add + &Adaugă + + + Anal&yze + Anal&iză + + + &Data + &Date + + + &Gray Scale + Scară de &griuri + + + &Indexed Colors + Culori &indexate + + + Pale&tte + &Paletă + + + &Layer + &Grafic + + + &Window + &Fereastră + + + &Paste Layer + Li&peşte grafic + + + &Paste Text + Li&peşte text + + + &Paste Tex Formula + Li&peşte formula Tex + + + &Paste Image + Li&peşte imagine + + + &Paste Rectangle + Li&peşte dreptunghi + + + &Paste Ellipse + Li&peşte elipsă + + + &Paste Line/Arrow + Li&peşte linie + + + E&xport + E&xportă + + + &Print + Im&primă + + + P&roperties... + P&roprietăti... + + + &Copy Page + &Copiază pagina + + + E&xport Page + E&xportă pagina + + + 3D &Plot + Grafic 3&D + + + &Matrix... + &Matrice... + + + Choose &Data Set... + Alegeţi un set de &date... + + + Choose &Matrix... + Alegeţi o &matrice... + + + C&lear + Go&leşte + + + &Copy Graph + &Copiază grafic + + + &Export + &Exportă + + + &Paste + Li&peşte + + + &Insert Row + &Inserează linie + + + &Insert Column + &Inserează coloană + + + &Delete Rows + Şte&rge linii + + + &Delete Columns + Şte&rge coloane + + + Move Row + Mută linia + + + &Delete Row + Şte&rge linie + + + Clea&r Row + Go&leşte linie + + + Clea&r Rows + Go&leşte liniile + + + Choose the location of the QtiPlot help folder! + Alegeţi dosarul conţinand documentaţia pentru QtiPlot! + + + QtiPlot - index.html File Not Found! + QtiPlot - Fişierul index.html nu a fost găsit! + + + There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! + Nu există un fişier numit <b>index.html</b> în acest dosar.<br>Vă rugăm să alegeţi un alt dosar! + + + QtiPlot - Help Files Not Found! + QtiPlot - Fişierele continand documentaţia nu au fost găsite! + + + The manual can be downloaded from the following internet address: + Manualul poate fi găsit la adresa de internet următoare: + + + QtiPlot - Help Profile Not Found! + QtiPlot - Fişierele continand documentaţia nu au fost găsite! + + + The assistant could not start because the file <b>%1</b> was not found in the help file directory! + Asistentul nu a putut fi lansat pentru că fişierul <b>%1</b> nu a fost găsit! + + + This file is provided with the QtiPlot manual which can be downloaded from the following internet address: + Fişierul este livrat împreună cu manualul pentru QtiPlot, care poate fi găsit la adresa de internet următoare: + + + Please indicate the location of the help file! + Vă rugam să indicaţi locaţia fişierelor continand documentaţia! + + + <h4>There are no tables available in this project.</h4><p><h4>Please create a table and try again!</h4> + <h4>Nu există tabele disponibile în acest proiect.</h4><p><h4>Vă rugam creaţi un tabel şi încercaţi din nou!</h4> + + + QtiPlot - Edit function + QtiPlot - Editează funcţia + + + 3D Surface + Suprafaţă 3D + + + QtiPlot - Set the number of pixels to average + QtiPlot - Setaţi numărul de pixeli pentru medie + + + Number of averaged pixels + Numărul de pixeli pentru medie + + + You must have more than one layer in the active window! + Trebuie să existe cel puţin două grafice in fereastra activă! + + + You must have more than one dataset in the active layer! + Trebuie să existe cel puţin două curbe in graficul activ! + + + QtiPlot - Guess best origin for the new layer? + QtiPlot - Determinaţi cea mai bună poziţie pentru noul grafic? + + + Do you want QtiPlot to guess the best position for the new layer? + Warning: this will rearrange existing layers! + Doriţi ca QtiPlot să determine cea mai bună poziţie pentru noul grafic?Avertisment: graficele existente vor fi rearanjate! + + + &Guess + &Determină + + + &Top-left corner + Colţul s&tang de sus + + + QtiPlot - Choose data set + QtiPlot - Alegeţi setul de date + + + Curve + Curbă + + + Integration of %1 from zero is + Integrala setului de date %1 este + + + Integration of %1 + Integrala setului de date %1 + + + Area + Aria + + + Linear Regression of %1 + Regresie liniară a %1 + + + Slope + Pantă + + + Intercept + Intersecţia cu axa absciselor + + + Chi^2 + Chi^2 + + + R^2 + R^2 + + + Add &Custom Script Action... + Adăugaţi o a&cţiune personalizată... + + + New &Project + &Proiect + + + Ctrl+N + Ctrl+N + + + App&end Project... + Adaugă proi&ect... + + + New &Graph + &Grafic + + + Ctrl+G + Ctrl+G + + + New &Note + &Notă + + + New &Table + &Tabel + + + Ctrl+T + Ctrl+T + + + New &Matrix + &Matrice + + + Ctrl+M + Ctrl+M + + + New &Function Plot + &Funcţie + + + Ctrl+F + Ctrl+F + + + New 3D &Surface Plot + &Suprafaţă 3D + + + Ctrl+ALT+Z + Ctrl+ALT+Z + + + &Open + &Deschide + + + Ctrl+O + Ctrl+O + + + &Open Excel ... + Deschide &fișier Excel... + + + Ctrl+Shift+E + Ctrl+Shift+E + + + Open Image &File + Deschide &fişier imagine + + + Ctrl+I + Ctrl+I + + + Import I&mage... + Importă i&magine... + + + &Save Project + &Salvează proiectul + + + Ctrl+S + Ctrl+S + + + Save Project &As... + Salvează proiectul c&a... + + + Ctrl+Shift+S + Ctrl+Shift+ + + + Open Temp&late... + Deschide mode&l... + + + Save As &Template... + Salvează ca mode&l... + + + Save Note As... + Salvează nota ca... + + + &Import ASCII... + &Importă fişier ASCII... + + + &Sound (WAV)... + &Sunet (WAV)... + + + &Undo + An&ulează + + + Ctrl+Z + Ctrl+Z + + + &Redo + &Refă + + + &Duplicate + &Duplichează + + + Ctrl+Alt+D + Ctrl+Alt+D + + + Cu&t Selection + &Taie selecţia + + + Ctrl+X + Ctrl+X + + + &Copy Selection + &Copiază selecţie + + + Ctrl+C + Ctrl+C + + + &Paste Selection + Li&peşte selecţie + + + Ctrl+V + Ctrl+V + + + Del + delete key + Del + + + Ctrl+E + Ctrl+E + + + &Find... + &Caută... + + + Add La&yer + Adăugare &grafic + + + ALT+L + ALT+L + + + Arran&ge Layers + Aranjază &graficele + + + Shift+A + Shift+A + + + Automatic Layout + Aranjare automată + + + &Current + &Curent + + + Ctrl+Alt+G + Ctrl+Alt+G + + + Alt+X + Alt+X + + + Create Open &Document Presentation... + Crează &document de prezentare... + + + &Export PDF + &Exportă in format PDF + + + Ctrl+Alt+P + Ctrl+Alt+P + + + Ctrl+P + Ctrl+P + + + Print Pre&view + &Previzualizare tipărire + + + Print All Plo&ts + Imprimă toate &graficele + + + E&xport ASCII + E&xportă fişier ASCII + + + &Quit + În&chide + + + Ctrl+Q + Ctrl+Q + + + &Close + În&chide + + + Clear &Log Information + Şterge rezu&ltatele + + + Delete &Fit Tables + Şterge tabelele de &ajustare + + + Plot &Wizard + &Asistent grafic + + + Ctrl+Alt+W + Ctrl+Alt+W + + + &Preferences... + O&pţiuni... + + + Add/Remove &Curve... + Adaugă/Şterge &Curbă... + + + ALT+C + ALT+C + + + Add &Error Bars... + Adaugă bare de &eroare... + + + Ctrl+B + Ctrl+B + + + Add &Function... + Adaugă &funcţie... + + + Ctrl+Alt+F + Ctrl+Alt+F + + + &Rescale to Show All + &Afişază toate datele + + + Ctrl+Shift+R + Ctrl+Shift+R + + + Zoom &In/Out and Drag Canvas + Măr&ire/Micşorare şi Translaţie + + + New &Legend + Nouă &legendă + + + Ctrl+L + Ctrl+L + + + Add Time Stamp + Adăugare dată/timp + + + Ctrl+ALT+T + Ctrl+ALT+T + + + Add &Image + Adăugare &imagine + + + ALT+I + ALT+I + + + &Line + &Linie + + + &Scatter + &Simbol + + + Line + S&ymbol + Linie + S&imbol + + + Vertical &Drop Lines + Linii &verticale + + + &Spline + &Spline + + + &Horizontal Steps + Trepte &orizontale + + + &Vertical Steps + Trepte &verticale + + + &Columns + &Coloane + + + &Rows + &Linii + + + Stack &Bar + Stivă &Linii + + + Stack &Column + Stivă &Coloane + + + &Area + &Arie + + + &Pie + &Placintă + + + Vectors XY&AM + Vectori XY&AM + + + &Vectors &XYXY + &Vectori &XYXY + + + &Histogram + &Histogramă + + + &Stacked Histogram + Histograme &suprapuse + + + Stem-and-&Leaf Plot + Grafic tulpină cu &frunze + + + &Vertical 2 Layers + 2 grafice &verticale + + + &Horizontal 2 Layers + 2 grafice &orizontale + + + &4 Layers + &4 grafice + + + &Stacked Layers + Grafice &suprapuse + + + D&ouble-Y + D&ouă axe Y + + + &Zoom + &Mărire zonă + + + &Waterfall Plot + Gra&fic cascadă + + + E&xtract to Graphs + E&xtrage ferestre + + + Extract to &Layers + Extrage &grafice + + + Add Inset Layer + Adăugare grafic interior + + + &Ribbon + &Panglică + + + &Bars + &Bare + + + &Trajectory + &Traiectorie + + + Statistics on &Columns + Statistici &coloane + + + Statistics on &Rows + Statistici &linii + + + &Integrate + &Integrează + + + Integr&ate Function... + Integr&ează funcţie... + + + Inte&rpolate ... + Inte&rpolează ... + + + &Low Pass... + Trece &jos... + + + &High Pass... + Trece &sus... + + + &Band Pass... + Trece &bandă... + + + &Band Block... + B&lochează bandă... + + + &FFT... + &FFT... + + + &Savitzky-Golay... + &Savitzky-Golay... + + + &FFT Filter... + Filtru &FFT... + + + Moving Window &Average... + &Medie... + + + &Lowess... + &Lowess... + + + &Differentiate + &Diferenţiază + + + Fit Slop&e + Aju&stare pantă + + + Fit &Linear + Ajustare &liniară + + + Fit &Polynomial ... + Ajustare &polinomială... + + + &First Order ... + Ordinul &unu... + + + &Second Order ... + Ordinul &doi... + + + &Third Order ... + Ordinul &trei... + + + Fit Exponential Gro&wth ... + Ajustare exponenţială &crescătoare... + + + Fit &Boltzmann (Sigmoidal) + Ajustare &Boltzmann (Sigmoidal) + + + Fit &Gaussian + Ajustare &Gaussiană + + + Fit Lorent&zian + Ajustare Lorent&z + + + Fit &Wizard... + &Asistent de ajustare de date... + + + Ctrl+Y + Ctrl+Y + + + &Plot ... + &Grafic ... + + + &Scales... + &Scale... + + + &Axes... + &Axe... + + + &Grid ... + &Grilaj ... + + + &Title ... + &Titlu ... + + + Column &Options ... + &Opţiuni coloană ... + + + Ctrl+Alt+O + Ctrl+Alt+O + + + Set Column &Values ... + Calcul &valori ... + + + Alt+Q + Alt+Q + + + Recalculate + Recalculează + + + Ctrl+Return + Ctrl+Return + + + &Hide Selected + &Ascunde selecţia + + + Sho&w All Columns + Afişază &toate coloanele + + + &Swap columns + Inver&sează coloanele + + + Move &Right + Mută la d&reapta + + + Move &Left + Mută la &stânga + + + Move to F&irst + Mută la înce&put + + + Move to Las&t + Mută la sfarşi&t + + + Ad&just Column Width + A&justează lăţimea coloanei + + + &Columns... + &Coloane... + + + &Rows... + &Linii... + + + &Delete Rows Interval... + Şte&rge linii... + + + &Upward + În &sus + + + &Downward + În &jos + + + &About QtiPlot + &Despre QtiPlot + + + F1 + F1 + + + &Help + &Ajutor + + + Ctrl+H + Ctrl+H + + + &Choose Help Folder... + Alegeţi dosarul cu do&cumentaţia... + + + Ctrl+W + Ctrl+W + + + Add Column + Adaugă coloană + + + &Go to Row... + Mer&gi la linia... + + + Go to Colum&n... + Mergi la coloa&na... + + + Ctrl+Alt+C + Ctrl+Alt+C + + + Clear + Goleşte + + + &Remove Layer + Şte&rge grafic + + + Alt+R + Alt+R + + + Window &Geometry... + &Geometrie... + + + &Hide Window + Ascu&nde fereastra + + + Ctrl+Alt+H + Ctrl+Alt+H + + + &View Pixel Line Profile + &Trasează profilul liniei de pixeli + + + &Intensity Table + Tabel de &intensităţi + + + &Properties + &Proprietăţi + + + &Activate Window + &Activează fereastra + + + Mi&nimize Window + &Minimizează fereastra + + + Ma&ximize Window + Ma&ximizează fereastra + + + Re&size Window... + Redimen&sionează fereastra... + + + &Surface... + &Suprafaţă... + + + &Data Set... + Set de &date... + + + Set &Properties... + &Proprietăti... + + + Set &Dimensions... + &Dimensiuni... + + + Ctrl+D + Ctrl+D + + + Set &Values... + &Valori... + + + &Image Plot + Grafic &imagine + + + &Image Profiles + Profile &Imagine + + + &Transpose + &Transpune + + + Flip &V + Întoarce &Vertical + + + Ctrl+Shift+V + Ctrl+Shift+V + + + Flip &H + Întoarce &Orizontal + + + Ctrl+Shift+H + Ctrl+Shift+H + + + R&otate 90 + R&oteşte 90 + + + Rotate &-90 + Roteşte &-90 + + + Ctrl+Alt+R + Ctrl+Alt+R + + + &Invert + &Inversează + + + &Determinant + &Determinant + + + &Image mode + Mod &imagine + + + Ctrl+Shift+I + Ctrl+Shift+I + + + &Data mode + Mod &date + + + Ctrl+Shift+D + Ctrl+Shift+D + + + Show &X/Y + Afişaj &X/Y + + + Ctrl+Shift+X + Ctrl+Shift+X + + + Show &Column/Row + Afişaj &Coloană/Linie + + + Ctrl+Shift+C + Ctrl+Shift+C + + + &Default + &Implicită + + + &Rainbow + Cu&rcubeu + + + &Custom + &Personalizată + + + &Export Image ... + E&xportă imagine... + + + &Direct + &Direct + + + &XYZ Columns + Coloane &XYZ + + + &YXZ Columns + Coloane &YXZ + + + &Forward FFT + &FFT Directă + + + &Inverse FFT + FFT &Inversă + + + 2D &Binning + Histo&gramă 2D + + + &Regular XYZ + &Reţea regulată XYZ + + + 3D &Wire Frame + Sar&ma 3D + + + 3D &Hidden Line + 3D linie &ascunsă + + + 3D &Polygons + &Poligoane 3D + + + 3D Wire &Surface + &Suprafaţă 3D + + + Contour - &Color Fill + Contour şi &culoare + + + Contour &Lines + &Linii de contour + + + &Gray Scale Map + Scară de &griuri + + + Sort Ta&ble + Sortare ta&bel + + + Sort Columns + Sortare coloane + + + &Table + &Tabel + + + Co&rrelate + Co&relare + + + &Autocorrelate + &Autocorelare + + + &Convolute + &Convoluţie + + + &Deconvolute + &Deconvoluţie + + + &Horizontal + &Orizontal + + + &Vertical + &Vertical + + + Ro&w Numbers + Indice &linie + + + &Random Values + Valori aleato&rii + + + &Frequency Count ... + Numără &frecvenţa de apariţie... + + + &Read Only + Doa&r citire + + + &Disregard + I&gnoră + + + &Box Plot + Grafic &cutie + + + &Gaussian... + Ajustare &Gaussiană... + + + &Lorentzian... + Ajustare &Lorentz... + + + Search for &Updates + Caută act&ualizări + + + &QtiPlot Homepage + Pagina de internet &QtiPlot + + + QtiPlot &Forums + &Forumuri dedicate QtiPlot + + + Report a &Bug + Semnalează o &eroare + + + Download &Manual + Obţine &manualul + + + &Translations + &Traduceri + + + Make a &Donation + &Donează + + + Technical &Support + &Suport tehnic + + + Scripting &language + &Limbaj de programare + + + &Restart scripting + &Reinitializează limbajul de programare + + + E&xecute + E&xecută + + + Ctrl+J + Ctrl+J + + + Execute &All + Execută &tot + + + Ctrl+Shift+J + Ctrl+Shift+J + + + &Evaluate Expression + &Evaluează expresia + + + Show Line &Numbers + Afişază &numărul liniei + + + Find &Next + Caută apariţia &următoare + + + F3 + F3 + + + Find &Previous + Caută apariţia &precedentă + + + F4 + F4 + + + &Replace... + În&locuieşte... + + + Increase Indent + Măreşte identarea + + + Decrease Indent + Micşorează identarea + + + Rena&me Tab... + Rede&numeşte fila... + + + A&dd Tab + A&daugă filă + + + C&lose Tab + Închidere &fila + + + &Script Window + Ferea&stră programare + + + Load Custom User &Interface... + Deschide &interfață utilizator... + + + &Plot details... + &Detalii grafic... + + + &Worksheet + &Tabel + + + &Reset to Full Range + &Afişaza toate datele + + + Edit &Range... + Editează inte&rvalul... + + + &Hide + Ascu&nde + + + Hide &Other Curves + Ascunde &celelelte curbe + + + &Show All Curves + Afişază &toate curbele + + + &Toolbars... + Bare de unel&te... + + + Ctrl+Shift+T + Ctrl+Shift+T + + + Bold + Gros + + + Italic + Italic + + + Superscript + Exponent + + + Subscript + Indice + + + Underline (Ctrl+U) + Subliniază (Ctrl+U) + + + Ctrl+U + Ctrl+U + + + Greek + Alfabet grec + + + Mathematical Symbols + Simboluri matematice + + + Increase Precision + Măreşte precizia + + + Decrease Precision + Micşorează precizia + + + Open a new project + Proiect nou + + + Append a project to the current folder + Adaugă un proiect in dosarul curent + + + Ctrl+Alt+A + Ctrl+Alt+A + + + New Fol&der + &Dosar + + + Create a new folder + Creează un dosar nou + + + Create an empty 2D plot + Creză un grafic 2D gol + + + Create an empty note window + Creză o fereastră de note + + + New table + Tabel nou + + + New matrix + Matrice nouă + + + Create a new 2D function plot + Creză un grafic de funcţie 2D + + + Create a new 3D surface plot + Creză o suprafaţă 3D + + + Open project + Deschide proiect + + + Open Excel + Deschide fișier Excel + + + Save project + Salvează proiectul + + + Open Te&mplate... + Deschide &model... + + + Open template + Deschide model + + + Save window as template + Salvează fereastra ca model + + + Import data file(s) + Importă fişier(e) de date + + + Ctrl+K + Ctrl+K + + + Undo changes + Anulează modificările + + + Redo changes + Refă modificările + + + Duplicate window + Duplicheză fereastra + + + Cut selection + Taie selecţie + + + Copy selection + Copiază selecţie + + + Paste selection + Lipeşte selecţie + + + Delete selection + Sterge selecţie + + + Project &Explorer + &Explorator de proiect + + + Show project explorer + Afişază exploratorul de proiect + + + Results &Log + Rezu&ltate + + + Show analysis results + Afişază rezultatele analizei + + + &Undo/Redo Stack + Listă de &modificări reversibile + + + Show available undo/redo commands + Afişază lista de modificări reversibile + + + &Console + &Consolă + + + Show Scripting console + Afişază consola de programere + + + Script Window + Fereastră programare + + + Add Layer + Adaugă grafic + + + Arrange Layers + Aranjază graficele + + + Export current graph + Exportă graficul curent + + + Export all graphs + Exportă toate graficele + + + Export to PDF + Exportă in format PDF + + + Print window + Imprimă fereastra + + + Print preview + Previzualizare tipărire + + + Add curve to graph + Adaugă curbă + + + Add Error Bars... + Adaugă bare de eroare... + + + Add Function... + Adaugă funcţie... + + + Best fit + Afişază toate datele + + + Add new legend + Adaugă legendă + + + Date & time + Dată & timp + + + Add Image + Adaugă imagine + + + Plot as line + Trasează cu linie + + + Plot as symbols + Trasează cu simboluri + + + Plot as line + symbols + Trasează cu linie şi simboluri + + + Plot with vertical bars + Trasează cu bare verticale + + + Plot with horizontal bars + Trasează cu bare orizontale + + + Plot stack bar + Desenează stivă de linii + + + Plot stack column + Desenează stivă de coloane + + + Plot area + Trasează ca suprafaţă + + + Plot pie + Trasează placintă + + + &Vectors XYXY + &Vectori XYXY + + + Vectors XYXY + Vectori XYXY + + + Vectors XYAM + Vectori XYAM + + + Stem-and-Leaf Plot + Grafic tulpină cu frunze + + + Double Y Axis + Două axe Y + + + Zoom + Mărire zonă + + + Extract to Graphs + Extrage ferestre + + + Extract to Layer&s + Extrage &grafice + + + Extract to Layers + Extrage grafice + + + Plot 3D ribbon + Trasează panglică 3D + + + Plot 3D bars + Trasează bare 3D + + + Plot 3D scatter + Trasează cu simboluri 3D + + + Plot 3D trajectory + Trasează traiectorie 3D + + + Contour + &Color Fill + Contour şi &culoare + + + Contour Lines + Color Fill + Linii de contour + culoare + + + Contour Lines + Linii de contour + + + Gray Scale Map + Scară de griuri + + + Selected columns statistics + Statistici pentru coloanele selectate + + + Selected rows statistics + Statistici pentru liniile selectate + + + Hide selected columns + Ascunde coloanele selectate + + + Show all table columns + Afişază toate coloanele din tabel + + + Swap selected columns + Inversează coloanele selectate + + + Move Right + Mută la dreapta + + + Move Left + Mută la stânga + + + Move to First + Mută la început + + + Move to Last + Mută la sfarşit + + + Move current row upward + Mută linia curentă în sus + + + Move current row downward + Mută linia curentă în jos + + + Set optimal column width + Lăţimea optimă a coloanei + + + Alt+C + Alt+C + + + More Windows... + Mai multe ferestre... + + + Set Matrix Values + Calculează valorile matricii + + + Image Plot + Grafic imagine + + + Image Profiles + Profile Imagine + + + Rotate 90 Clockwise + Roteşte cu 90° în sens orar + + + Rotate 90 Counterclockwise + Roteşte cu 90° în sens anti-orar + + + Flip Vertically + Răstoarnă vertical + + + Flip Horizontally + Răstoarnă orizontal + + + Fill selected columns with row numbers + Umple coloanele selectate cu indicele de linie + + + Fill selected columns with random numbers + Umple coloanele selectate cu numere aleatorii + + + Set column as X + Defineşte coloană de tip X + + + Set column as Y + Defineşte coloană de tip Y + + + Set column as Z + Defineşte coloană de tip Z + + + Set as Y Error Bars + Defineşte ca bare de eroare în Y + + + Set as Labels + Defineşte ca etichete + + + Disregard Columns + Ignoră coloanele + + + Box and whiskers plot + Grafic tip cutie cu mustăţi + + + Visit QtiPlot &Forums + Vizitează &forumurile dedicate QtiPlot + + + Show find dialog + Dialog căutare + + + Find Next + Caută apariţia următoare + + + Find Previous + Caută apariţia precedentă + + + Show replace dialog + Dialog înlocuire + + + Ctrl+R + Ctrl+R + + + Disable &tools + Dezactivare unel&te + + + Pointer + Dezactivare unelte + + + Zoom In (Shift++) or Out (-) and Drag Canvas + Mărire (Shift++) / Micşorare (-) şi Translaţie + + + &Zoom In + &Mărire + + + Ctrl++ + Ctrl++ + + + Zoom In + Mărire + + + Zoom &Out + Micş&orare + + + Ctrl+- + Ctrl+- + + + Zoom Out + Micşorare + + + &Data Reader + Cititor de &date + + + CTRL+D + CTRL+D + + + Data reader + Cititor de date + + + &Select Data Range + &Selectare interval + + + ALT+S + ALT+S + + + Select data range + Setează intervalul de date + + + S&creen Reader + Coordonate e&cran + + + Screen reader + Coordonate ecran + + + &Draw Data Points + &Desen date + + + Draw Data Points + Desen date + + + &Move Data Points... + &Modificare date... + + + Ctrl+ALT+M + Ctrl+ALT+M + + + Move data points + Modificare date + + + Dra&g Curve + Tra&ge curba + + + Drag Curve + Trage curba + + + Remove &Bad Data Points... + Ster&gere date incorecte... + + + Alt+B + Alt+B + + + Remove data points + Stergere date + + + Add &Text + Adăugare &text + + + Add Text + Adăugare text + + + ALT+T + ALT+T + + + Add E&quation + Adăugare &ecuaţie + + + Add Equation + Adăugare ecuaţie + + + ALT+Q + ALT+Q + + + Add &Rectangle + Adăugare d&reptunghi + + + Add Rectangle + Adăugare dreptunghi + + + CTRL+ALT+R + CTRL+ALT+R + + + Add &Ellipse + Adăugare &elipsă + + + Add Ellipse/Circle + Adăugare elipsă/cerc + + + CTRL+ALT+E + CTRL+ALT+E + + + Draw &Arrow + Desen săge&ată + + + CTRL+ALT+A + CTRL+ALT+A + + + Draw arrow + Desenează săgeată + + + Draw &Line + Desen &linie + + + CTRL+ALT+L + CTRL+ALT+L + + + Draw line + Desenează linie + + + Box + Cutie + + + Frame + Bordură + + + &Frame + &Bordură + + + No Axes + Fără axe + + + No axes + Fără axe + + + Front grid + Grilaj faţă + + + Back grid + Grilaj spate + + + Right grid + Grilaj dreapta + + + Left grid + Grilaj stânga + + + Ceiling grid + Grilaj tavan + + + Floor grid + Grilaj podea + + + Wireframe + Sârmă + + + Hidden Line + Linie ascunsă + + + Hidden line + Linie ascunsă + + + Polygon Only + Numai poligoane + + + Polygon only + Numai poligoane + + + Mesh & Filled Polygons + Linie & poligoane + + + Mesh & filled Polygons + Linie & poligoane + + + Dots + Puncte + + + Bars + Bare + + + Cones + Conuri + + + Crosshairs + Cruci + + + Floor Data Projection + Proiecţie podea + + + Floor data projection + Proiecţie podea + + + Floor Isolines + Proiecţie izolinii + + + Floor isolines + Proiecţie izolinii + + + Empty Floor + Fără proiecţie + + + Empty floor + Fără proiecţie + + + Animation + Animaţie + + + Enable perspective + Perspectivă + + + Reset rotation + Resetează rotaţia + + + Fit frame to window + Ajustează graficul la dimensiunile ferestrei + + + Profiles + Profile + + + Horizontal + Orizontal + + + Vertical + Vertical + + + QtiPlot - Enter the number of peaks + QtiPlot - Introduceţi numărul de extreme + + + Peaks + Extreme + + + <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> If you like it, you're using it in your work and you would like to see it constantly improved, please support its authors by making a donation.</b></font> + <font size=+2, color = darkBlue><b>QtiPlot est un soft liber a cărui dezvoltare a necesitat sute de ore de muncă.<br><br> Dacă vă place, îl utilizaţi în activitatea dumneavoastră şi aţi dori să fie îmbunătaţit in mod constant, vă rugăm sprijiniţi-i pe autorii lui făcand o donaţie.</b></font> + + + Please support QtiPlot! + Vă rugăm sprijiniţi dezvoltarea proiectului QtiPlot! + + + Make a donation + Donează + + + Close + Închide + + + <b> %1 </b>: This command line option must be used without other arguments! + <b> %1 </b>: Această comandă trebuie folosită fără argumente! + + + Version + Versiune + + + Usage + Utilizare + + + options + opţiuni + + + file + fişier + + + name + nume + + + Valid options are + Opţiunile valide sunt + + + or + sau + + + show about dialog and exit + afişază mesajul de informare despre QtiPlot + + + show standalone scripting window + afişază consola de programere + + + start QtiPlot with the default settings + porneşte QtiPlot cu setările din fabrică + + + show command line options + afişază opţiunile disponibile în linia de comandă + + + start QtiPlot in language + porneşte QtiPlot în limba + + + show QtiPlot manual in a standalone window + afişază manualul într-o fereastră de sine stătătoare + + + print QtiPlot version and release date + afişaza versiunea si data de apariţie + + + execute the script file given as argument + execută fişierul de cod introdus ca argument + + + execute the script file given as argument without displying the user interface. Warning: 2D plots are not correctly handled in this functioning mode! + execută fişierul de cod introdus ca argument fără a afişa interfaţa grafică. Avertisment: graficele 2D nu funcţionează corect in acest mod de operare! + + + can be any .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py, .xls or ASCII file + poate fi orice fişier .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py, .xls sau ASCII + + + Help + Documentaţie + + + <b> %1 </b>: Wrong locale option or no translation available! + <b> %1 </b>: Parametrii regionali specificaţi sunt incorecţi sau traducerea nu este încă disponibilă! + + + <b> %1 </b> unknown command line option! + <b> %1 </b> opţiune invalidă! + + + Type %1 to see the list of the valid options. + Scrieţi %1 pentru a vedea lista opţiunilor valide. + + + <b>%1</b> is a directory, please specify a file name! + <b>%1</b> este un dosar, vă rugăm să specificaţi un nume de fişier! + + + You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://soft.proindependent.com/download.html">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. + Folosiţi versiunea de demonstraţie a programului Qtiplot. Este identică cu versiunea integrală, exceptand faptul că nu puteţi salva proiectele deschise si nu poate fi utilizat mai mult de 10 minute pe sesiune. <br><br> Dacă doriţi să instalaţi versiunea integrala, vă rugăm să suscrieţi la<a href="http://soft.proindependent.com/individual_contract.html">un contract de mentenanţă</a>. <br><br> QtiPlot este un program liber. Dacă doriţi, puteţi obtine gratis <a href="http://soft.proindependent.com/download.html">codul sursă</a>. <a href="http://soft.proindependent.com/why_donate.html">Donaţiile</a> în vederea sprijinirii dezvoltării programului QtiPlot sunt binevenite. + + + Please select exactly one column and more than one non empty cell! + Vă rugăm să selectaţi o singură coloană si cel puţin două celule cu conţinut valid! + + + Data set: %1 doesn't exist! + Setul de date %1 nu există! + + + Stem and leaf plot of dataset + Grafic tulpină cu frunze a setului de date + + + from row + de la linia + + + to row + la linia + + + Not enough memory for this dataset! + Memorie insuficientă pentru acest set de date! + + + Stem + Tulpină + + + Leaf + Frunze + + + Please confirm the stem unit! + Vă rugam să confirmaţi unitatea de măsură pentru tulpină! + + + Data set + Set de date + + + stem unit + unitate pentru tulpină + + + Stem unit + Unitate pentru tulpină + + + Leaf unit + Unitate pentru frunze + + + Key + Legendă + + + means + înseamnă + + + Input error: empty data set! + Eroare: setul de date este vid! + + + Memory Allocation Error + Eroare de alocare a memoriei + + + Not enough memory, operation aborted! + Memorie insuficientă, operaţia a fost abandonată! + + + Set Precision %1 digits + %1 cifre semnificative + + + Choose custom user interface + Alege interfață utilizator + + + Custom user interfaces can be created using the QtDesigner application provided by the Qt framework + Interfețele utilizator personalizate pot fi create folosind aplicația QtDesigner din suita Qt + + + For more details about how to use .ui files in your Python scripts please read the PyQt4 documentation + Pentru mai multe detalii despre folosirea fișierelor .ui in scripturile Python vă rugăm să citiți documentația PyQt4 + + + + AddWidgetTool + + Click on plot to choose the position of the new object! + Vă rugăm, daţi click pe grafic pentru a alege poziţia noului obiect! + + + enter your text here + introduceţi textul dumneavoastră aici + + + Move cursor in order to resize the new rectangle! + Mişcaţi cursorul pentru a redimensiona noul dreptunghi! + + + Move cursor in order to resize the new ellipse! + Mişcaţi cursorul pentru a redimensiona noua elipsă! + + + + ApplicationWindow + + File %1 contains only %2 sheets, operation aborted! + Fișierul %1 conține doar %2 foi de calcul, operația a fost abandonată! + + + Sheet %1 is empty, operation aborted! + Foaia de calcul %1 este goală, operația a fost abandonată! + + + sheet + foaie de calcul + + + QtiPlot was built without libxls support! + QtiPlot a fost compilat fara suport pentru libxls! + + + QtiPlot - untitled + QtiPlot - neintitulat + + + Project Explorer + Explorator de proiect + + + Folder + Dosar + + + UNTITLED + NEINTITULAT + + + Name + Nume + + + Type + Tip + + + View + Afişaj + + + Size + Dimensiune + + + Created + Creat + + + Label + Etichetă + + + Results Log + Rezultate + + + Scripting Console + Consolă de programare + + + Undo Stack + Listă de modificări + + + &Next + next window + Fereastra &următoare + + + F5 + next window shortcut + F5 + + + &Previous + previous window + Fereastra &precedentă + + + F6 + previous window shortcut + F6 + + + File + Fişier + + + Edit + Editare + + + Plot + Grafic + + + Disable &Tools + Dezactivare unel&te + + + &Zoom In + &Mărire + + + Ctrl++ + Ctrl++ + + + &Zoom Out + Mi&cşorare + + + Ctrl+- + Ctrl+- + + + &Data Reader + Cititor de &date + + + CTRL+D + CTRL+D + + + &Select Data Range + &Selectare interval + + + ALT+S + ALT+S + + + S&creen Reader + Coordonate e&cran + + + &Draw Data Points + &Desen date + + + &Move Data Points... + &Modificare date... + + + Ctrl+ALT+M + Ctrl+ALT+M + + + Remove &Bad Data Points... + Ster&gere date incorecte... + + + Alt+B + Alt+B + + + Add E&quation + Adăugare &ecuaţie + + + ALT+Q + ALT+Q + + + Add &Text + Adăugare &text + + + ALT+T + ALT+T + + + Draw &Arrow + Desen săge&ată + + + CTRL+ALT+A + CTRL+ALT+A + + + Draw &Line + Desen &linie + + + CTRL+ALT+L + CTRL+ALT+L + + + Add &Rectangle + Adăugare d&reptunghi + + + CTRL+ALT+R + CTRL+ALT+R + + + Add &Ellipse + Adăugare &elipsă + + + CTRL+ALT+E + CTRL+ALT+E + + + Table + Tabel + + + Column + Coloană + + + Data Display + Afişaj date + + + Matrix Plot + Grafic de matrice + + + Format + Format + + + QtiPlot - Script Window + QtiPlot - Fereastră programare + + + 3D Surface + Suprafaţă 3D + + + &Recent Projects + Proiecte &recente + + + Set Columns &As + Definire coloane c&a + + + &Read-only + Numai citi&re + + + Read/&Write + Citire/&Scriere + + + &Fill Columns With + &Umple coloanele cu + + + Special Line/Symb&ol + Linie/Simb&ol special + + + Statistical &Graphs + Grafice &statistice + + + Pa&nel + Pa&nou + + + 3&D Plot + Grafic 3&D + + + &File + &Fişier + + + &Edit + &Editare + + + &View + &Afişaj + + + &Scripting + &Programare + + + &Graph + &Grafic + + + &Data + &Date + + + &Analysis + &Analiză + + + For&mat + For&mat + + + &Plot + &Grafic + + + &Table + &Tabel + + + 3D &Plot + Grafic 3&D + + + &Matrix + &Matrice + + + Empty Stack + Lista de modificări vidă + + + &Windows + &Ferestre + + + &Help + &Ajutor + + + You must select exactly one column for plotting! + Trebuie să selectaţi o singură coloană! + + + QtiPlot - Plot error + QtiPlot - Eroare + + + QtiPlot - Error + QtiPlot - Eroare + + + Please select a column to plot! + Vă rugam să selectaţi coloana pe care vreţi să o trasaţi! + + + Please select four columns for this operation! + Vă rugam să selectaţi patru coloane pentru aceasta operaţiune! + + + QtiPlot - Warning + QtiPlot - Avertisment + + + <h4>There are no tables available in this project.</h4><p><h4>Please create a table and try again!</h4> + <h4>Nu există tabele disponibile în acest proiect.</h4><p><h4>Vă rugam creaţi un tabel şi încercaţi din nou!</h4> + + + There are no available columns with plot designation set to Z! + Nu există coloane de tip Z! + + + QtiPlot - Choose data set + QtiPlot - Alegeţi setul de date + + + Matrix + Matrice + + + QtiPlot - Choose matrix to plot + QtiPlot - Alegeţi matricea pe care vreţi să o reprezentaţi + + + <h4>There are no matrices available in this project.</h4><p><h4>Please create a matrix and try again!</h4> + <h4>Nu există matrici disponibile în acest proiect.</h4><p><h4>Vă rugam creaţi o matrice şi încercaţi din nou!</h4> + + + Graph + Grafic + + + QtiPlot - Export error + QtiPlot - Eroare de export + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + Nu a fost posibilă scrierea în fişierul: <br><h4> %1 </h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie! + + + Images + Imagini + + + QtiPlot - Import image from file + QtiPlot - Importă imagine din fişier + + + QtiPlot - Load image from file + QtiPlot - Încarcă imagine din fişier + + + X Axis Title + Titlu axă X + + + Y Axis Title + Titlu axă Y + + + Please select a Y column to plot! + Vă rugam să selectaţi o coloana de tip Y! + + + QtiPlot - Renamed Window + QtiPlot - Fereastra redenumită + + + The table '%1' already exists. It has been renamed '%2'. + Există deja un tabel cu numele '%1'. A fost redenumit '%2'. + + + Notes + Note + + + Set Image Mode + Setează mod imagine + + + Set Data Mode + Setează mod date + + + Show X/Y + Afişaj X/Y + + + Show Column/Row + Afişaj Coloană/Linie + + + Set Default Palette + Setează paletă implicită + + + Set Gray Scale Palette + Setează scare de griuri + + + Set Rainbow Palette + Setează paletă curcubeu + + + Determinant of + Determinantul + + + <h4>There are no plot layers available in this window.</h4><p><h4>Please add a layer and try again!</h4> + <h4>Nu există grafice disponibile în această fereastra.</h4><p><h4>Vă rugam adăugaţi un grafic şi încercaţi din nou!</h4> + + + There are no curves available on this plot! + Nu există curbe disponibile în acest grafic! + + + This functionality is not available for pie plots! + Această operaţie nu este disponibilă pentru graficele placintă! + + + QtiPlot - Error bars error + QtiPlot - Eroare + + + This feature is not available for user defined function curves! + Această operaţie nu este disponibilă pentru funcţii! + + + The selected columns have different numbers of rows! + Coloanele selecţionate au un număr diferit de linii! + + + The selected error column is empty! + Coloana de bare de eroare selecţionată este goală! + + + QtiPlot - File openning error + QtiPlot - Eroare de deschidere fişier + + + The file: <b>%1</b> is the current file! + Fişierul: <b>%1</b> este fişierul curent! + + + The file: <b>%1</b> doesn't exist! + Fişierul: <b>%1</b> nu există! + + + You don't have the permission to open this file: <b>%1</b> + Nu aveţi permisiunea să deschideţi fişierul: <b>%1</b> + + + QtiPlot - File opening error + QtiPlot - Eroare de deschidere fişier + + + The file <b>%1</b> is corrupted, but there exists a backup copy.<br>Do you want to open the backup instead? + Fişierul <b>%1</b> nu poate fi deschis, dar există o copie.<br>Vreţi să o deschideţi pe aceasta? + + + The file: <b> %1 </b> was not created using QtiPlot! + Fişierul: <b> %1 </b> nu a fost creat de QtiPlot! + + + QtiPlot - File Open Error + QtiPlot - Eroare de deschidere fişier + + + The file: <b> %1 </b> <p>does not exist anymore!<p>It will be removed from the list. + Fişierul: <b> %1 </b> <p>nu mai există!<p>Va fi şters din listă. + + + The file: <p><b> %1 </b><p> is the current file! + Fişierul: <p><b> %1 </b><p> este fişierul curent! + + + QtiPlot + QtiPlot + + + The file "%1" was created using "%2" as scripting language. + +Initializing support for this language FAILED; I'm using "%3" instead. +Various parts of this file may not be displayed as expected. + Fişierul "%1" a fost creat folosind ca limbaj de programare "%2". + +Iniţializarea suportului pentru acest limbaj de programare nu a fost posibilă; se foloseşte în loc limbajul "%3". +Diverse părţi din acest fişier ar putea fi afişate incorect. + + + Window + Fereastră + + + QtiPlot - Opening file + QtiPlot - Deschidere fişier + + + Script Error + Eroare de programare + + + QtiPlot - Scripting Error + QtiPlot - Eroare de programare + + + Scripting language "%1" failed to initialize. + Limbajul de programare "%1" nu a putut fi iniţializat. + + + QtiPlot - Open Template File + QtiPlot - Deschidere fişier model + + + The file: <b>%1</b> is not a QtiPlot template file! + Fişierul: <b>%1</b> nu este un fişier model creat de QtiPlot! + + + Table1 + Tabel1 + + + QtiPlot - Export Error + QtiPlot - Eroare de export + + + <h4>There are no plot layers available in this window!</h4> + <h4>Nu există grafice disponibile în această fereastra!</h4> + + + Choose a directory to export the graphs to + Alegeţi un dosar în care să exportaţi graficele + + + Output format: + Format de export: + + + Directory: + Dosar: + + + There are no plot layers available in window <b>%1</b>.<br>Graph window not exported! + Nu există grafice disponibile în fereastra <b>%1</b>.<br>Fereastra nu a fost exportată! + + + A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? + Există deja un fişier cu numele: <p><b>%1</b><p>. Vreţi să-l rescrieţi? + + + QtiPlot - Overwrite file? + QtiPlot - Rescriere fişier? + + + Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! + Nu a fost posibilă scrierea în fişierul: <br><h4> %1 </h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie! + + + Minimized + Minimizat + + + Maximized + Maximizat + + + QtiPlot project + Proiect QtiPlot + + + Compressed QtiPlot project + Proiect QtiPlot arhivat + + + Save Project As + Salvează proiectul ca + + + QtiPlot Matrix Template + Model de matrice QtiPlot + + + QtiPlot 2D Graph Template + Model de grafic 2D QtiPlot + + + QtiPlot Table Template + Model de tabel QtiPlot + + + QtiPlot 3D Surface Template + Model de grafic 3D QtiPlot + + + Save Window As Template + Salvează fereastra ca model + + + Please enter a valid name! + Vă rugăm introduceţi un nume valid! + + + The name you chose is not valid: only letters and digits are allowed! + Numele ales nu este valid: sunt permise doar litere şi cifre! + + + Please choose another name! + Vă rugăm alegeţi un alt nume! + + + Name <b>%1</b> already exists! + Numele <b>%1</b> este deja utilizat! + + + Warning: for internal consistency reasons the underscore character is replaced with a minus sign. + Avertisment: din motive legate de reprezentarea internă folosită de QtiPlot, caracterul "_" va fi înlocuit cu semnul minus '-'. + + + Choose a directory to export the tables to + Alegeţi un dosar în care să exportaţi tabelele + + + &Yes + &Da + + + &All + &Toate + + + &Cancel + &Anulează + + + Choose a filename to save under + Alegeţi un nume de fişier + + + QtiPlot - Enter rows number + QtiPlot - Introduceţi numărul de linii + + + Rows + Linii + + + QtiPlot - Delete rows + QtiPlot - Ştergere linii + + + Start row + Prima linie + + + End row + Ultima linie + + + QtiPlot - Enter columns number + QtiPlot - Introduceţi numărul de coloane + + + Columns + Coloane + + + QtiPlot - Column selection error + QtiPlot - Eroare de selecţie a coloanei + + + Please select a column first! + Vă rugam să selectaţi mai întâi o coloană! + + + Please select two columns for this operation! + Vă rugam să selectaţi două coloane pentru aceasta operaţiune! + + + Please select exactly one columns for this operation! + Vă rugăm să selectaţi o singură coloană! + + + Please select two columns for this operation: + the first represents the signal and the second the response function! + Va rugăm selecţionaţi două coloane pentru această operaţie: prima reprezintă semnalul şi a doua funcţia răspuns! + + + QtiPlot - Row selection error + QtiPlot - Eroare de selecţie a liniei + + + Please select a row first! + Vă rugam să selectaţi mai întâi o linie! + + + &Line + &Linie + + + &Scatter + &Simbol + + + Line + S&ymbol + Linie + S&imbol + + + Vertical &Drop Lines + Linii &verticale + + + &Spline + &Spline + + + &Vertical Steps + Trepte &verticale + + + &Horizontal Steps + Trepte &orizontale + + + &Columns + &Coloane + + + &Rows + &Linii + + + &Area + &Arie + + + &Pie + &Placintă + + + 3D Ribbo&n + Pa&nglică 3D + + + 3D &Bars + &Bare 3D + + + 3&D Scatter + &Simbol 3D + + + 3D &Trajectory + &Traiectorie 3D + + + &Histogram + &Histogramă + + + &Stacked Histograms + Histograme &suprapuse + + + Cu&t + &Taie + + + &Copy + &Copiază + + + Past&e + Li&peşte + + + &X + &X + + + &Y + &Y + + + &Z + &Z + + + &Label + &Etichetă + + + &None + &Nici una + + + X E&rror + E&roare X + + + Y &Error + &Eroare Y + + + Set As + Defineşte ca + + + &Fill Column With + &Umplere coloană cu + + + &Column + &Coloană + + + &Normalize + &Normare + + + Clea&r + Go&leşte + + + &Delete + Şte&rge + + + &Insert + &Inserază + + + &Ascending + &Ascendent + + + &Descending + &Descendent + + + Sort Colu&mn + Sortare coloa&nă + + + Vectors &XYXY + Vectori &XYXY + + + &Vertical 2 Layers + 2 grafice &verticale + + + &Horizontal 2 Layers + 2 grafice &orizontale + + + &4 Layers + &4 grafice + + + &Stacked Layers + Grafice &suprapuse + + + You need to select at least one Y column for this operation! + Trebuie să selectaţi cel puţin o coloană de tip Y pentru această operaţiune! + + + You need at least two columns for this operation! + E nevoie de cel puţin două coloane pentru aceasta operaţiune! + + + Y2 Axis Title + Titlu Axă Y2 + + + Not available for empty 3D surface plots! + Indisponibil pentru suprafeţe 3D goale! + + + Set Display Range + Defineşte intervalul de afişaj + + + <h4>There are no plot layers available in this window.</h4> + <h4>Nu există grafice disponibile în această fereastra.</h4> + + + This will modify the data in the worksheets! +Are you sure you want to continue? + Datele din tabele vor fi modificate. Sunteţi sigur că vreţi să continuaţi? + + + Continue + Continuă + + + Cancel + Anulează + + + Could not write to file: <h4>%1</h4><p>Please verify that you have the right to write to this location or that the file is not being used by another application! + Nu a fost posibilă scrierea în fişierul: <h4>%1</h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie sau că fişierul nu este folosit de un alt program! + + + Sorry, there are no results to display! + Regretăm, nu există rezultate disponibile pentru afişare! + + + There are no plot layers available in this window! + Nu există grafice disponibile în această fereastra! + + + There are no layers available on this plot. Operation aborted! + Nu există grafice disponibile în această fereastra! + + + QtiPlot - Insert image from file + QtiPlot - Inserează imagine din fişier + + + There are no plot layers available in this window. + Nu există grafice disponibile în această fereastra. + + + QtiPlot - Duplicate window error + QtiPlot - Eroare de duplicare + + + There are no windows available in this project! + Nu există ferestre disponibile în acest proiect! + + + QtiPlot - Duplicate error + QtiPlot - Eroare de duplicare + + + Empty 3D surface plots cannot be duplicated! + Suprafeţele 3D nu pot fi duplicate! + + + Released + Lansat + + + About QtiPlot + Despre QtiPlot + + + &Translate + &Translatează + + + &Smooth + &Netezeşte + + + &FFT filter + Filtru &FFT + + + Fit E&xponential Decay + Ajustare e&xponenţială descrescătoare + + + Fit &Multi-peak + Ajustare extre&me + + + Vie&w + &Afişaj + + + &Palette + &Paletă + + + &Convert to Spreadsheet + &Transformă in tabel + + + &New + &Nou + + + &Export Graph + &Exportă grafic + + + &Folders + &Dosare + + + &Cascade + Aranjare in &cascadă + + + &Tile + Aranjare pe &tot ecranul + + + Close &Window + Închidere &fereastră + + + More windows... + Mai multe ferestre... + + + &View Pixel Line profile + &Afişaza profilul liniei de pixeli + + + &Intensity Matrix + Matrice de &intensitate + + + &Cut + &Taie + + + &Properties... + &Proprietăti... + + + Please use the project explorer to select a window! + Vă rugăm utilizaţi exploratorul de proiect pentru a selecţiona o fereastră! + + + Normal + Normal + + + Save changes to project: <p><b> %1 </b> ? + Salvează modificările proiectului: <p><b> %1 </b> ? + + + Yes + Da + + + No + Nu + + + &Show All Windows + &Arată toate ferestrele + + + &Hide All Windows + Ascu&nde toate ferestrele + + + &Delete Selection + Sterge &selecţie + + + New &Window + &Fereastră nouă + + + New F&older + D&osar nou + + + Auto &Column Width + Lărgime de &coloană automată + + + &Delete Window + Şte&rge fereastra + + + &Rename Window + &Redenumeşte fereastra + + + &Print Window + Im&primă fereastra + + + D&epending Graphs + Grafice d&ependente + + + D&epending 3D Graphs + Grafice 3D d&ependente + + + D&epends on + D&epinde de + + + Function + Funcţie + + + Re&move Pie Curve + Şte&rge graficul plăcintă + + + Anal&yze + Anal&iză + + + &Paste Layer + Li&peşte grafic + + + &Paste Text + Li&peşte text + + + &Paste Tex Formula + Li&peşte formula Tex + + + &Paste Image + Li&peşte imagine + + + &Paste Rectangle + Li&peşte dreptunghi + + + &Paste Ellipse + Li&peşte elipsă + + + &Paste Line/Arrow + Li&peşte linie + + + &Layer + &Grafic + + + &Window + &Fereastră + + + E&xport + E&xportă + + + &Print + Im&primă + + + P&roperties... + P&roprietăti... + + + &Delete Layer + Şterge &selecţie + + + &Copy Page + &Copiază pagina + + + E&xport Page + E&xportă pagina + + + &Matrix... + &Matrice... + + + Choose &Data Set... + Alegeţi un set de &date... + + + Choose &Matrix... + Alegeţi o &matrice... + + + C&lear + Go&leşte + + + &Copy Graph + &Copiază grafic + + + &Export + &Exportă + + + &Paste + Li&peşte + + + &Insert Row + &Inserează linie + + + &Insert Column + &Inserează coloană + + + &Delete Rows + Şte&rge linii + + + &Delete Columns + Şte&rge coloane + + + &Delete Row + Şte&rge linie + + + Clea&r Row + Go&leşte linie + + + Clea&r Rows + Go&leşte liniile + + + Choose the location of the QtiPlot help folder! + Alegeţi dosarul conţinand documentaţia pentru QtiPlot! + + + QtiPlot - index.html File Not Found! + QtiPlot - Fişierul index.html nu a fost găsit! + + + There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! + Nu există un fişier numit <b>index.html</b> în acest dosar.<br>Vă rugăm să alegeţi un alt dosar! + + + QtiPlot - Help Files Not Found! + QtiPlot - Fişierele continand documentaţia nu au fost găsite! + + + The manual can be downloaded from the following internet address: + Manualul poate fi găsit la adresa de internet următoare: + + + QtiPlot - Help Profile Not Found! + QtiPlot - Fişierele continand documentaţia nu au fost găsite! + + + The assistant could not start because the file <b>%1</b> was not found in the help file directory! + Asistentul nu a putut fi lansat pentru că fişierul <b>%1</b> nu a fost găsit! + + + This file is provided with the QtiPlot manual which can be downloaded from the following internet address: + Fişierul este livrat împreună cu manualul pentru QtiPlot, care poate fi găsit la adresa de internet următoare: + + + Please indicate the location of the help file! + Vă rugam să indicaţi locaţia fişierelor continand documentaţia! + + + QtiPlot - Edit function + QtiPlot - Editează funcţia + + + QtiPlot - Set the number of pixels to average + QtiPlot - Setaţi numărul de pixeli pentru medie + + + Number of averaged pixels + Numărul de pixeli pentru medie + + + You must have more than one layer in the active window! + Trebuie să existe cel puţin două grafice in fereastra activă! + + + You must have more than one dataset in the active layer! + Trebuie să existe cel puţin două curbe in graficul activ! + + + QtiPlot - Guess best origin for the new layer? + QtiPlot - Determinaţi cea mai bună poziţie pentru noul grafic? + + + Do you want QtiPlot to guess the best position for the new layer? + Warning: this will rearrange existing layers! + Doriţi ca QtiPlot să determine cea mai bună poziţie pentru noul grafic?Avertisment: graficele existente vor fi rearanjate! + + + &Guess + &Determină + + + &Top-left corner + Colţul s&tang de sus + + + Curve + Curbă + + + Integration of %1 from zero is + Integrala setului de date %1 este + + + Please select a 'Y' column first! + Vă rugam să selectaţi mai întâi o coloana de tip Y! + + + Export + Exportă + + + Integration of %1 + Integrala setului de date %1 + + + Area + Aria + + + Linear Regression of %1 + Regresie liniară a %1 + + + Slope + Pantă + + + Intercept + Intersecţia cu axa absciselor + + + Chi^2 + Chi^2 + + + R^2 + R^2 + + + Add &Custom Script Action... + Adăugaţi o a&cţiune personalizată... + + + New &Project + &Proiect + + + Ctrl+N + Ctrl+N + + + New &Graph + &Grafic + + + Ctrl+G + Ctrl+G + + + New &Note + &Notă + + + New &Table + &Tabel + + + Ctrl+T + Ctrl+T + + + New &Matrix + &Matrice + + + Ctrl+M + Ctrl+M + + + New &Function Plot + &Funcţie + + + Ctrl+F + Ctrl+F + + + New 3D &Surface Plot + &Suprafaţă 3D + + + Ctrl+ALT+Z + Ctrl+ALT+Z + + + &Open + &Deschide + + + Ctrl+O + Ctrl+O + + + &Open Excel ... + Deschide &fișier Excel... + + + Ctrl+Shift+E + Ctrl+Shift+E + + + Open ODF Spreads&heet... + Desc&hide foi de calcul ODF... + + + Open Image &File + Deschide &fişier imagine... + + + Ctrl+I + Ctrl+I + + + Import I&mage... + Importă i&magine... + + + &Save Project + &Salvează proiectul + + + Ctrl+S + Ctrl+S + + + Save Project &As... + Salvează proiectul c&a... + + + Open Temp&late... + Deschide mode&l... + + + Save As &Template... + Salvează ca mode&l... + + + Save Note As... + Salvează nota ca... + + + &Import ASCII... + &Importă fişier ASCII... + + + &Undo + An&ulează + + + Ctrl+Z + Ctrl+Z + + + &Redo + &Refă + + + &Duplicate + &Duplichează + + + Cu&t Selection + &Taie selecţia + + + Ctrl+X + Ctrl+X + + + &Copy Selection + &Copiază selecţie + + + Ctrl+C + Ctrl+C + + + &Paste Selection + Li&peşte selecţie + + + Ctrl+V + Ctrl+V + + + Del + delete key + Del + + + Ctrl+E + Ctrl+E + + + Add La&yer + Adăugare &grafic + + + ALT+L + ALT+L + + + Arran&ge Layers + Aranjază &graficele + + + Shift+A + Shift+A + + + Automatic Layout + Aranjare automată + + + &Current + &Curent + + + Ctrl+Alt+G + Ctrl+Alt+G + + + Alt+X + Alt+X + + + &Export PDF + &Exportă in format PDF + + + Ctrl+Alt+P + Ctrl+Alt+P + + + Ctrl+P + Ctrl+P + + + Print All Plo&ts + Imprimă toate &graficele + + + E&xport ASCII + E&xportă fişier ASCII + + + &Quit + În&chide + + + Ctrl+Q + Ctrl+Q + + + Clear &Log Information + Şterge rezu&ltatele + + + Delete &Fit Tables + Şterge tabelele de &ajustare + + + Plot &Wizard + &Asistent grafic + + + Ctrl+Alt+W + Ctrl+Alt+W + + + &Preferences... + O&pţiuni... + + + Add/Remove &Curve... + Adaugă/Şterge &Curbă... + + + ALT+C + ALT+C + + + Add &Error Bars... + Adaugă bare de &eroare... + + + Ctrl+B + Ctrl+B + + + Add &Function... + Adaugă &funcţie... + + + Ctrl+Alt+F + Ctrl+Alt+F + + + &Rescale to Show All + &Afişază toate datele + + + Ctrl+Shift+R + Ctrl+Shift+R + + + Zoom/Drag Canvas &Horizontally + Mărire/Micşorare şi Translaţie &Orizontală + + + Zoom/Drag Canvas &Vertically + Mărire/Micşorare şi Translaţie &Verticală + + + New &Legend + Nouă &legendă + + + Ctrl+L + Ctrl+L + + + Add Time Stamp + Adăugare dată/timp + + + Ctrl+ALT+T + Ctrl+ALT+T + + + Add &Image + Adăugare &imagine + + + ALT+I + ALT+I + + + Vectors XY&AM + Vectori XY&AM + + + &Vectors &XYXY + &Vectori &XYXY + + + &Stacked Histogram + Histograme &suprapuse + + + D&ouble-Y + D&ouă axe Y + + + &Zoom + &Mărire zonă + + + E&xtract to Graphs + E&xtrage ferestre + + + Extract to &Layers + Extrage &grafice + + + Add Inset Layer + Adăugare grafic interior + + + &Ribbon + &Panglică + + + &Bars + &Bare + + + &Trajectory + &Traiectorie + + + Statistics on &Columns + Statistici &coloane + + + Statistics on &Rows + Statistici &linii + + + &Integrate + &Integrează + + + Integr&ate Function... + Integr&ează funcţie... + + + Inte&rpolate ... + Inte&rpolează ... + + + &Low Pass... + Trece &jos... + + + &High Pass... + Trece &sus... + + + &Band Pass... + Trece &bandă... + + + &Band Block... + B&lochează bandă... + + + &FFT... + &FFT... + + + &Savitzky-Golay... + &Savitzky-Golay... + + + &FFT Filter... + Filtru &FFT... + + + Moving Window &Average... + &Medie... + + + &Lowess... + &Lowess... + + + &Differentiate + &Diferenţiază + + + Fit &Linear + Ajustare &liniară + + + Fit &Polynomial ... + Ajustare &polinomială... + + + &First Order ... + Ordinul &unu... + + + &Second Order ... + Ordinul &doi... + + + &Third Order ... + Ordinul &trei... + + + Fit Exponential Gro&wth ... + Ajustare exponenţială &crescătoare... + + + Fit &Boltzmann (Sigmoidal) + Ajustare &Boltzmann (Sigmoidal) + + + Fit &Gaussian + Ajustare &Gaussiană + + + Fit Lorent&zian + Ajustare Lorent&z + + + Fit &Wizard... + &Asistent de ajustare de date... + + + Ctrl+Y + Ctrl+Y + + + &Plot ... + &Grafic ... + + + &Scales... + &Scale... + + + &Axes... + &Axe... + + + &Grid ... + &Grilaj ... + + + &Title ... + &Titlu ... + + + Column &Options ... + &Opţiuni coloană ... + + + Ctrl+Alt+O + Ctrl+Alt+O + + + Set Column &Values ... + Calcul &valori ... + + + Alt+Q + Alt+Q + + + Recalculate + Recalculează + + + Ctrl+Return + Ctrl+Return + + + &Hide Selected + &Ascunde selecţia + + + Sho&w All Columns + Afişază &toate coloanele + + + &Swap columns + Inver&sează coloanele + + + Move &Right + Mută la d&reapta + + + Move &Left + Mută la &stânga + + + Move to F&irst + Mută la înce&put + + + Move to Las&t + Mută la sfarşi&t + + + &Columns... + &Coloane... + + + &Rows... + &Linii... + + + &Delete Rows Interval... + Şte&rge linii... + + + &About QtiPlot + &Despre QtiPlot + + + F1 + F1 + + + Ctrl+H + Ctrl+H + + + &Choose Help Folder... + Alegeţi dosarul cu do&cumentaţia... + + + Ctrl+W + Ctrl+W + + + Add Column + Adaugă coloană + + + &Go to Row... + Mer&gi la linia... + + + Go to Colum&n... + Mergi la coloa&na... + + + Ctrl+Alt+C + Ctrl+Alt+C + + + Clear + Goleşte + + + &Remove Layer + Şte&rge grafic + + + Alt+R + Alt+R + + + Window &Geometry... + &Geometrie... + + + &Hide Window + Ascu&nde fereastra + + + Ctrl+Alt+H + Ctrl+Alt+H + + + &View Pixel Line Profile + &Trasează profilul liniei de pixeli + + + &Intensity Table + Tabel de &intensităţi + + + &Properties + &Proprietăţi + + + &Activate Window + &Activează fereastra + + + Mi&nimize Window + &Minimizează fereastra + + + Ma&ximize Window + Ma&ximizează fereastra + + + Re&size Window... + Redimen&sionează fereastra... + + + &Surface... + &Suprafaţă... + + + &Data Set... + Set de &date... + + + Set &Properties... + &Proprietăti... + + + Set &Dimensions... + &Dimensiuni... + + + Ctrl+D + Ctrl+D + + + Set &Values... + &Valori... + + + &Image Plot + Grafic &imagine + + + &Image Profiles + Profile &Imagine + + + &Transpose + &Transpune + + + Flip &V + Întoarce &Vertical + + + Ctrl+Shift+V + Ctrl+Shift+V + + + Flip &H + Întoarce &Orizontal + + + Ctrl+Shift+H + Ctrl+Shift+H + + + R&otate 90 + R&oteşte 90 + + + Rotate &-90 + Roteşte &-90 + + + Ctrl+Alt+R + Ctrl+Alt+R + + + &Invert + &Inversează + + + &Determinant + &Determinant + + + &Image mode + Mod &imagine + + + Ctrl+Shift+I + Ctrl+Shift+I + + + &Data mode + Mod &date + + + Ctrl+Shift+D + Ctrl+Shift+D + + + Show &X/Y + Afişaj &X/Y + + + Ctrl+Shift+X + Ctrl+Shift+X + + + Show &Column/Row + Afişaj &Coloană/Linie + + + Ctrl+Shift+C + Ctrl+Shift+C + + + Open ODF Spreadsheet + Deschide foi de calcul ODF + + + Zoom In/Out and Drag Canvas Horizontally + Mărire (Shift++) / Micşorare (-) şi Translaţie Orizontală + + + Zoom In/Out and Drag Canvas Vertically + Mărire (Shift++) / Micşorare (-) şi Translaţie Verticală + + + can be any .qti, qti.gz, .ods, .opj, .ogm, .ogw, .ogg, .py, .xls or ASCII file + poate fi orice fişier .qti, qti.gz, .ods, .opj, .ogm, .ogw, .ogg, .py, .xls sau ASCII + + + Choose custom user interface + Alege interfață utilizator + + + Custom user interfaces can be created using the QtDesigner application provided by the Qt framework + Interfețele utilizator personalizate pot fi create folosind aplicația QtDesigner din suita Qt + + + For more details about how to use .ui files in your Python scripts please read the PyQt4 documentation + Pentru mai multe detalii despre folosirea fișierelor .ui in scripturile Python vă rugăm să citiți documentația PyQt4 + + + &Gray Scale + Scară de &griuri + + + &Default + &Implicită + + + &Rainbow + Cu&rcubeu + + + &Custom + &Personalizată + + + &Export Image ... + E&xportă imagine... + + + &Direct + &Direct + + + &XYZ Columns + Coloane &XYZ + + + &YXZ Columns + Coloane &YXZ + + + &Forward FFT + &FFT Directă + + + &Inverse FFT + FFT &Inversă + + + Convert to &Matrix + Transformă in &matrice + + + Dra&g Curve + Tra&ge curba + + + &Import + &Importă + + + You must select a single Y column that has an associated X column! + Trebuie să selectaţi o coloană de tip Y care are asociată o coloană de tip X! + + + You must select exactly one Z column! + Trebuie să selectaţi o singură coloană de tip Z! + + + Couldn't open file %1 + Fişierul %1 nu a putut fi deschis + + + Open Excel File + Deschide fișier Excel + + + Open File + Deschide fişier + + + Imported sound file + Importă fişier de sunet + + + This is not a PCM type WAV file, operation aborted! + Acesta nu este un fişier WAV de tip PCM, operaţiunea a fost abandonată! + + + PCM + PCM + + + Time + Timp + + + Left + Stânga + + + Right + Dreapta + + + Data + Date + + + Channels + Canale + + + Sample Rate + Eşantionare + + + Byte Rate + Număr de biţi + + + Block Align + Aliniere bloc + + + Bits Per Sample + Numărul de biţi pe eşantion + + + Presentation Preview + Previzualizare prezentare + + + &Save + &Salvează + + + There are no windows available in this folder! + Nu există ferestre disponibile în acest dosar! + + + Ctrl+Alt+S + Ctrl+Alt+S + + + &Sound (WAV)... + &Sunet (WAV)... + + + Create Open &Document Presentation... + Crează &document de prezentare... + + + &Close + În&chide + + + 2D &Binning + Histo&gramă 2D + + + &Regular XYZ + &Reţea regulată XYZ + + + 3D &Wire Frame + Sar&ma 3D + + + 3D &Hidden Line + 3D linie &ascunsă + + + 3D &Polygons + &Poligoane 3D + + + 3D Wire &Surface + &Suprafaţă 3D + + + Contour - &Color Fill + Contour şi &culoare + + + Contour &Lines + &Linii de contour + + + &Gray Scale Map + Scară de &griuri + + + Sort Ta&ble + Sortare ta&bel + + + Sort Columns + Sortare coloane + + + Co&rrelate + Co&relare + + + &Autocorrelate + &Autocorelare + + + &Convolute + &Convoluţie + + + &Deconvolute + &Deconvoluţie + + + &Horizontal + &Orizontal + + + &Vertical + &Vertical + + + Ro&w Numbers + Indice &linie + + + &Random Values + Valori aleato&rii + + + &Frequency Count ... + Numără &frecvenţa de apariţie... + + + &Read Only + Doa&r citire + + + &Disregard + I&gnoră + + + &Box Plot + Grafic &cutie + + + &Gaussian... + Ajustare &Gaussiană... + + + &Lorentzian... + Ajustare &Lorentz... + + + Search for &Updates + Caută act&ualizări + + + &QtiPlot Homepage + Pagina de internet &QtiPlot + + + QtiPlot &Forums + &Forumuri dedicate QtiPlot + + + Report a &Bug + Semnalează o &eroare + + + Download &Manual + Obţine &manualul + + + &Translations + &Traduceri + + + Make a &Donation + &Donează + + + Technical &Support + &Suport tehnic + + + Scripting &language + &Limbaj de programare + + + &Restart scripting + &Reinitializează limbajul de programare + + + E&xecute + E&xecută + + + Ctrl+J + Ctrl+J + + + Execute &All + Execută &tot + + + Ctrl+Shift+J + Ctrl+Shift+J + + + &Evaluate Expression + &Evaluează expresia + + + Show Line &Numbers + Afişază &numărul liniei + + + Find &Next + Caută apariţia &următoare + + + F3 + F3 + + + Find &Previous + Caută apariţia &precedentă + + + F4 + F4 + + + &Replace... + În&locuieşte... + + + Increase Indent + Măreşte identarea + + + Decrease Indent + Micşorează identarea + + + Rena&me Tab... + Rede&numeşte fila... + + + A&dd Tab + A&daugă filă + + + C&lose Tab + Închidere &fila + + + &Script Window + Ferea&stră programare + + + Load Custom User &Interface... + Deschide &interfață utilizator... + + + &Plot details... + &Detalii grafic... + + + &Worksheet + &Tabel + + + &Reset to Full Range + &Afişaza toate datele + + + Edit &Range... + Editează Inte&rval... + + + &Hide + Ascu&nde + + + Hide &Other Curves + Ascunde &celelelte curbe + + + &Show All Curves + Afişază &toate curbele + + + &Edit Function... + &Editează funcţia... + + + &Toolbars... + Bare de unel&te... + + + Ctrl+Shift+T + Ctrl+Shift+T + + + Bold + Gros + + + Italic + Italic + + + Superscript + Exponent + + + Subscript + Indice + + + Underline (Ctrl+U) + Subliniază (Ctrl+U) + + + Ctrl+U + Ctrl+U + + + Greek + Alfabet grec + + + Mathematical Symbols + Simboluri matematice + + + Increase Precision + Măreşte precizia + + + Decrease Precision + Micşorează precizia + + + Open a new project + Proiect nou + + + New Fol&der + &Dosar + + + Create a new folder + Creează un dosar nou + + + Create an empty 2D plot + Creză un grafic 2D gol + + + Create an empty note window + Creză o fereastră de note + + + New table + Tabel nou + + + New matrix + Matrice nouă + + + Create a new 2D function plot + Creză un grafic de funcţie 2D + + + Create a new 3D surface plot + Creză o suprafaţă 3D + + + Open project + Deschide proiect + + + Open Excel + Deschide fișier Excel + + + Save project + Salvează proiectul + + + Open Te&mplate... + Deschide &model... + + + Open template + Deschide model + + + Save window as template + Salvează fereastra ca model + + + Import data file(s) + Importă fişier(e) de date + + + Ctrl+K + Ctrl+K + + + Undo changes + Anulează modificările + + + Redo changes + Refă modificările + + + Duplicate window + Duplicheză fereastra + + + Cut selection + Taie selecţie + + + Copy selection + Copiază selecţie + + + Paste selection + Lipeşte selecţie + + + Delete selection + Sterge selecţie + + + Project &Explorer + &Explorator de proiect + + + Show project explorer + Afişază exploratorul de proiect + + + Results &Log + Rezu&ltate + + + Show analysis results + Afişază rezultatele analizei + + + &Undo/Redo Stack + Listă de &modificări reversibile + + + Show available undo/redo commands + Afişază lista de modificări reversibile + + + &Console + &Consolă + + + Show Scripting console + Afişază consola de programere + + + Script Window + Fereastră programare + + + Add Layer + Adaugă grafic + + + Arrange Layers + Aranjază graficele + + + Export current graph + Exportă graficul curent + + + Export all graphs + Exportă toate graficele + + + Export to PDF + Exportă in format PDF + + + Print window + Imprimă fereastra + + + Print preview + Previzualizare tipărire + + + Add curve to graph + Adaugă curbă + + + Add Error Bars... + Adaugă bare de eroare... + + + Add Function... + Adaugă funcţie... + + + Best fit + Afişază toate datele + + + Add new legend + Adaugă legendă + + + Date & time + Dată & timp + + + Add Image + Adaugă imagine + + + Plot as line + Trasează cu linie + + + Plot as symbols + Trasează cu simboluri + + + Plot as line + symbols + Trasează cu linie şi simboluri + + + Plot with vertical bars + Trasează cu bare verticale + + + Plot with horizontal bars + Trasează cu bare orizontale + + + Plot area + Trasează ca suprafaţă + + + Plot pie + Trasează placintă + + + &Vectors XYXY + &Vectori XYXY + + + Vectors XYXY + Vectori XYXY + + + Vectors XYAM + Vectori XYAM + + + Double Y Axis + Două axe Y + + + Zoom + Mărire zonă + + + File %1 contains only %2 sheets! + Fișierul %1 conține doar %2 foi de calcul! + + + Paste Selection as Te&xt + Lipeşte selecţia ca &text + + + Extract to Graphs + Extrage ferestre + + + Extract to Layer&s + Extrage &grafice + + + Extract to Layers + Extrage grafice + + + Plot 3D ribbon + Trasează panglică 3D + + + Plot 3D bars + Trasează bare 3D + + + Plot 3D scatter + Trasează cu simboluri 3D + + + Plot 3D trajectory + Trasează traiectorie 3D + + + Contour + &Color Fill + Contour şi &culoare + + + Contour Lines + Color Fill + Linii de contour + culoare + + + Contour Lines + Linii de contour + + + Gray Scale Map + Scară de griuri + + + Selected columns statistics + Statistici pentru coloanele selectate + + + Selected rows statistics + Statistici pentru liniile selectate + + + Hide selected columns + Ascunde coloanele selectate + + + Show all table columns + Afişază toate coloanele din tabel + + + Swap selected columns + Inversează coloanele selectate + + + Move Right + Mută la dreapta + + + Move Left + Mută la stânga + + + Move to First + Mută la început + + + Move to Last + Mută la sfarşit + + + More Windows... + Mai multe ferestre... + + + Set Matrix Values + Calculează valorile matricii + + + Image Plot + Grafic imagine + + + Image Profiles + Profile Imagine + + + Rotate 90 Clockwise + Roteşte cu 90° în sens orar + + + Rotate 90 Counterclockwise + Roteşte cu 90° în sens anti-orar + + + Flip Vertically + Întoarce vertical + + + Flip Horizontally + Întoarce orizontal + + + Fill selected columns with row numbers + Umple coloanele selectate cu indicele de linie + + + Fill selected columns with random numbers + Umple coloanele selectate cu numere aleatorii + + + Set column as X + Defineşte coloană de tip X + + + Set column as Y + Defineşte coloană de tip Y + + + Set column as Z + Defineşte coloană de tip Z + + + Set as Y Error Bars + Defineşte ca bare de eroare în Y + + + Set as Labels + Defineşte ca etichete + + + Disregard Columns + Ignoră coloanele + + + Box and whiskers plot + Grafic tip cutie cu mustăţi + + + Visit QtiPlot &Forums + Vizitează &forumurile dedicate QtiPlot + + + Show find dialog + Dialog căutare + + + Find Next + Caută apariţia următoare + + + Find Previous + Caută apariţia precedentă + + + Show replace dialog + Dialog înlocuire + + + Ctrl+R + Ctrl+R + + + Disable &tools + Dezactivare unel&te + + + Pointer + Dezactivare unelte + + + Zoom In + Mărire + + + Zoom &Out + Micş&orare + + + Zoom Out + Micşorare + + + Data reader + Cititor de date + + + Select data range + Setează intervalul de date + + + Screen reader + Coordonate ecran + + + Draw Data Points + Desen date + + + Move data points + Modificare date + + + Drag Curve + Trage curba + + + Remove data points + Stergere date + + + Add Text + Adăugare text + + + Add Equation + Adăugare ecuaţie + + + Add Rectangle + Adăugare dreptunghi + + + Add Ellipse/Circle + Adăugare elipsă/cerc + + + Draw arrow + Desenează săgeată + + + Draw line + Desenează linie + + + Box + Cutie + + + Frame + Bordură + + + &Frame + &Bordură + + + No Axes + Fără axe + + + No axes + Fără axe + + + Front grid + Grilaj faţă + + + Back grid + Grilaj spate + + + Right grid + Grilaj dreapta + + + Left grid + Grilaj stânga + + + Ceiling grid + Grilaj tavan + + + Floor grid + Grilaj podea + + + Wireframe + Sârmă + + + Hidden Line + Linie ascunsă + + + Hidden line + Linie ascunsă + + + Polygon Only + Numai poligoane + + + Polygon only + Numai poligoane + + + Mesh & Filled Polygons + Linie & poligoane + + + Mesh & filled Polygons + Linie & poligoane + + + Dots + Puncte + + + Bars + Bare + + + Cones + Conuri + + + Crosshairs + Cruci + + + Floor Data Projection + Proiecţie podea + + + Floor data projection + Proiecţie podea + + + Floor Isolines + Proiecţie izolinii + + + Floor isolines + Proiecţie izolinii + + + Empty Floor + Fără proiecţie + + + Empty floor + Fără proiecţie + + + Animation + Animaţie + + + Enable perspective + Perspectivă + + + Reset rotation + Resetează rotaţia + + + Fit frame to window + Ajustează graficul la dimensiunile ferestrei + + + Profiles + Profile + + + Horizontal + Orizontal + + + Vertical + Vertical + + + QtiPlot - Enter the number of peaks + QtiPlot - Introduceţi numărul de extreme + + + Peaks + Extreme + + + show standalone scripting window + afişază consola de programere + + + can be any .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py, .xls or ASCII file + poate fi orice fişier .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py, .xls sau ASCII + + + Memory Allocation Error + Eroare de alocare a memoriei + + + Not enough memory, operation aborted! + Memorie insuficientă, operaţia a fost abandonată! + + + Set Precision %1 digits + %1 cifre semnificative + + + <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> + + <font size=+2, color = darkBlue><b>QtiPlot est un soft liber a cărui dezvoltare a necesitat sute de ore de muncă.<br><br> Dacă vă place, îl utilizaţi în activitatea dumneavoastră şi aţi dori să fie îmbunătaţit in mod constant, vă rugăm sprijiniţi-i pe autorii lui făcand o donaţie.</b></font> + + + <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> If you like it, you're using it in your work and you would like to see it constantly improved, please support its authors by making a donation.</b></font> + <font size=+2, color = darkBlue><b>QtiPlot est un soft liber a cărui dezvoltare a necesitat sute de ore de muncă.<br><br> Dacă vă place, îl utilizaţi în activitatea dumneavoastră şi aţi dori să fie îmbunătaţit in mod constant, vă rugăm sprijiniţi-i pe autorii lui făcand o donaţie.</b></font> + + + Please support QtiPlot! + Vă rugăm sprijiniţi dezvoltarea proiectului QtiPlot! + + + <b> %1 </b>: This command line option must be used without other arguments! + <b> %1 </b>: Această comandă trebuie folosită fără argumente! + + + Version + Versiune + + + Usage + Utilizare + + + options + opţiuni + + + file + fişier + + + name + nume + + + Valid options are + Opţiunile valide sunt + + + or + sau + + + show about dialog and exit + afişază mesajul de informare despre QtiPlot + + + start QtiPlot with the default settings + porneşte QtiPlot cu setările din fabrică + + + show command line options + afişază opţiunile disponibile în linia de comandă + + + start QtiPlot in language + porneşte QtiPlot în limba + + + show QtiPlot manual in a standalone window + afişază manualul într-o fereastră de sine stătătoare + + + print QtiPlot version and release date + afişaza versiunea si data de apariţie + + + execute the script file given as argument + execută fişierul de cod introdus ca argument + + + execute the script file given as argument without displying the user interface. Warning: 2D plots are not correctly handled in this functioning mode! + execută fişierul de cod introdus ca argument fără a afişa interfaţa grafică. Avertisment: graficele 2D nu funcţionează corect in acest mod de operare! + + + can be any .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py or ASCII file + poate fi orice fişier .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py sau ASCII + + + Help + Ajutor + + + <b> %1 </b>: Wrong locale option or no translation available! + <b> %1 </b>: Parametrii regionali specificaţi sunt incorecţi sau traducerea nu este încă disponibilă! + + + <b> %1 </b> unknown command line option! + <b> %1 </b> opţiune invalidă! + + + Type %1 to see the list of the valid options. + Scrieţi %1 pentru a vedea lista opţiunilor valide. + + + <b>%1</b> is a directory, please specify a file name! + <b>%1</b> este un dosar, vă rugăm să specificaţi un nume de fişier! + + + The file: <b>%1</b> is not a QtiPlot or Origin project file! + Fişierul: <b>%1</b> nu este un fişier creat folosind QtiPlot sau OriginLab! + + + QtiPlot - Demo Version + QtiPlot - Versiune de test + + + You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. + Folosiţi versiunea de demonstraţie a programului Qtiplot. Este identică cu versiunea integrală, exceptand faptul că nu puteţi salva proiectele deschise si nu poate fi utilizat mai mult de 10 minute pe sesiune. <br><br> Dacă doriţi să instalaţi versiunea integrala, vă rugăm să suscrieţi la<a href="http://soft.proindependent.com/individual_contract.html">un contract de mentenanţă</a>. <br><br> QtiPlot este un program liber. Dacă doriţi, puteţi obtine gratis <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">codul sursă</a>. <a href="http://soft.proindependent.com/why_donate.html">Donaţiile</a> în vederea sprijinirii dezvoltării programului QtiPlot sunt binevenite. + + + QtiPlot - File backup error + QtiPlot - Eroare de salvare a fişerului + + + Cannot make a backup copy of <b>%1</b> (to %2).<br>If you ignore this, you run the risk of <b>data loss</b>. + Nu a fost posibilă crearea unei copii de siguranţă pentru fişierul <b>%1</b> (în %2).<br>Daca ignoraţi acest mesaj riscaţi<b>să pierdeţi date</b>. + + + QtiPlot - File save error + QtiPlot - Eroare de salvare a fişerului + + + The file: <br><b>%1</b> is opened in read-only mode + Fişierul: <br><b>%1</b> este accesibil doar pentru citire + + + Save project as + Salvează proiectul ca + + + &Find... + &Caută... + + + Open ODF Spreadsheet File + Deschide foi de calcul ODF + + + QtiPlot was built without ODF spreadsheet support! + QtiPlot a fost compilat fara suport pentru foile de calcul ODF! + + + App&end Project... + Adaugă proi&ect... + + + Open Exce&l ... + Deschide fișier Exce&l... + + + Save &As Project... + Salvează c&a proiect... + + + &Delete Folder + Şte&rge dosar + + + &Rename + &Redenumeşte + + + &Windows in Active Folder + &Ferestrele din dosarul activ + + + Windows in &Active Folder && Subfolders + Ferestrele din dosarul &activ şi din dosarele conţinute de acesta + + + &View Windows + Afişază &ferestrele + + + Hidden + Ascuns + + + Name already exists! + Acest nume e deja folosit! + + + Project + Proiect + + + Path + Cale + + + bytes + biţi + + + Contents + Conţinut + + + windows + ferestre + + + folders + dosare + + + Modified + Modificat + + + Properties + Proprietăţi + + + New Folder + Dosar nou + + + QtiPlot - Delete folder? + QtiPlot - Şterge dosarul? + + + Delete folder '%1' and all the windows it contains? + Şterge dosarul '%1' şi toate ferestrele pe care le conţine? + + + Note + Notă + + + 3D Graph + Grafic 3D + + + Status + Statut + + + QtiPlot - No match found + QtiPlot - Căutare fără rezultat + + + Sorry, no match found for string: '%1' + Ne pare rău, nu a fost găsit nici un rezultat pentru şirul de caractere: '%1' + + + Cannot move an object to itself! + Un obiect nu poate fi mutat în el însuşi! + + + Cannot move a parent folder into a child folder! + Un dosar nu poate fi mutat intr-un dosar pe care îl conţine! + + + Skipped moving folder + Dosarul nu a fost mutat + + + The destination folder already contains a folder called '%1'! Folder skipped! + Dosarul de destinaţie conţine deja un dosar numit '%1'! Dosarul a fost sărit! + + + Error + Eroare + + + QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! + QtiPlot va încerca să aducă informaţia necesară despre ultima versiune disponibilă. Vă rugăm să permiteţi conectarea la internet! + + + Do you wish to continue? + Doriţi să continuaţi? + + + QtiPlot - HTTP get version file + QtiPlot - Acces la informaţia despre ultima versiune folosind HTTP + + + Error while fetching version file with HTTP: %1. + Eroare de acces la fişierul cu informaţii despre ultima versiune disponibilă folosind HTTP: %1. + + + QtiPlot - Updates Available + QtiPlot - Actualizare disponibilă + + + There is a newer version of QtiPlot (%1) available for download. Would you like to download it? + Există o versiune mai nouă (%1) pentru QtiPlot. Vreţi să o instalaţi? + + + QtiPlot - No Updates Available + QtiPlot - Nu s-au găsit actualizări + + + No updates available. Your current version %1 is the last version available! + Nu e disponibilă o versiune mai nouă. Versiunea dumneavoastră %1 este ultima versiune disponibilă! + + + This will clear the contents of all the data associated with the table. Are you sure? + Toate seturile de date asociate cu acest tabel vor fi şterse. Sunteţi sigur? + + + &No + &Nu + + + QtiPlot - Enter row number + QtiPlot - Introduceţi numărul liniei + + + Row + Linie + + + QtiPlot - Enter column number + QtiPlot - Introduceţi numărul coloanei + + + QtiPlot was not built with Python scripting support included! + QtiPlot nu a fost compilat cu suport pentru limbajul de programare Python! + + + Please set a default X column for this table, first! + Vă rugăm să definiţi mai întâi o coloană de tip X pentru acest tabel! + + + Please select a Z column for this operation! + Vă rugăm să selectaţi o coloană de tip Z pentru această operaţie! + + + You need to define a X column first! + Vă rugam să definiţi mai întâi o coloana de tip X! + + + You need to define a Y column first! + Vă rugam să definiţi mai întâi o coloana de tip Y! + + + Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. + Începând cu versiunea 0.9.1 QtiPlot salveaza funcţiile de ajustare definite de utilizator într-un alt loc. + + + If you want to save your already defined models, please choose a destination folder. + Dacă doriţi să salvaţi funcţiile de ajustare create, vă rugăm să alegeţi un dosar. + + + Import fit models + Importă funcţii de ajustare + + + Choose a directory to export the fit models to + Alegeţi un dosar în care să exportaţi funcţiile de ajustare + + + No Icon + Fără icoană + + + Couldn't load file: %1. +Autocompletion will not be available! + Fişierul: %1 nu a putut fi încărcat.Sugestiile de completare automată nu vorfi disponibile! + + + Please select exactly one column and more than one non empty cell! + Vă rugăm să selectaţi o singură coloană si cel puţin două celule cu conţinut valid! + + + English + Română + + + Ctrl+Shift+S + Ctrl+Shift+ + + + Stem and &Leaf Plot + Grafic tulpină cu &frunze + + + Data set: %1 doesn't exist! + Setul de date %1 nu există! + + + Stem and leaf plot of dataset + Grafic tulpină cu frunze a setului de date + + + from row + de la linia + + + to row + la linia + + + Not enough memory for this dataset! + Memorie insuficientă pentru acest set de date! + + + Stem + Tulpină + + + Leaf + Frunze + + + Please confirm the stem unit! + Vă rugam să confirmaţi unitatea de măsură pentru tulpină! + + + Data set + Set de date + + + stem unit + unitate pentru tulpină + + + Stem unit + Unitate pentru tulpină + + + Leaf unit + Unitate pentru frunze + + + Key + Legendă + + + means + înseamnă + + + Input error: empty data set! + Eroare: setul de date este vid! + + + Stem-and-Leaf Plot + Grafic tulpină cu frunze + + + Stem-and-&Leaf Plot + Grafic tulpină cu &frunze + + + F&ormat + F&ormat + + + Menu Bar + Bara de meniu + + + Alt+C + Alt+C + + + Zoom &In/Out and Drag Canvas + Măr&ire/Micşorare şi Translaţie + + + Zoom In (Shift++) or Out (-) and Drag Canvas + Mărire (Shift++) / Micşorare (-) şi Translaţie + + + Fit Slop&e + Aju&stare pantă + + + You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://soft.proindependent.com/download.html">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. + Folosiţi versiunea de demonstraţie a programului Qtiplot. Este identică cu versiunea integrală, exceptand faptul că nu puteţi salva proiectele deschise si nu poate fi utilizat mai mult de 10 minute pe sesiune. <br><br> Dacă doriţi să instalaţi versiunea integrala, vă rugăm să suscrieţi la<a href="http://soft.proindependent.com/individual_contract.html">un contract de mentenanţă</a>. <br><br> QtiPlot este un program liber. Dacă doriţi, puteţi obtine gratis <a href="http://soft.proindependent.com/download.html">codul sursă</a>. <a href="http://soft.proindependent.com/why_donate.html">Donaţiile</a> în vederea sprijinirii dezvoltării programului QtiPlot sunt binevenite. + + + &Add + &Adaugă + + + Ctrl+Alt+D + Ctrl+Alt+D + + + &Waterfall Plot + Gra&fic cascadă + + + &Indexed Colors + Culori &indexate + + + Pale&tte + &Paletă + + + Make a donation + Donează + + + Close + Închide + + + Spec&ial Bar/Column + Linii/Coloane spec&iale + + + Stack &Bar + Stivă &Linii + + + Stack &Column + Stivă &Coloane + + + Plot stack bar + Desenează stivă de linii + + + Plot stack column + Desenează stivă de coloane + + + Move Row + Mută linia + + + Print preview of window: + Previzualizare tipărire fereastră: + + + Print Pre&view + &Previzualizare tipărire + + + Ad&just Column Width + A&justează lăţimea coloanei + + + &Upward + În &sus + + + &Downward + În &jos + + + Append a project to the current folder + Adaugă un proiect in dosarul curent + + + Ctrl+Alt+A + Ctrl+Alt+A + + + Move current row upward + Mută linia curentă în sus + + + Move current row downward + Mută linia curentă în jos + + + Set optimal column width + Lăţimea optimă a coloanei + + + Shared A&xes Panel + Panel cu a&xe comune + + + + . + + + &Custom Layout... + Aranjare personaliza&tă... + + + Execute Selected Lines + Executaă rândurile selectate + + + Commen&t Selection + Comentează &selecţia + + + &Uncomment Selection + Decomentea&ză selecţia + + + Comment Selection + Comentează selecţia + + + Uncomment Selection + Decomentează selecţia + + + Ctrl+Shift+O + Ctrl+Shift+O + + + Ctrl+Shift+U + Ctrl+Shift+U + + + Waterfall Plot + Grafic cascadă + + + &Extract Data... + &Extrage date... + + + S&ubtract + &Scădere + + + &Straight Line... + &Dreaptă... + + + &Reference Data... + &Set de date... + + + &Open... + &Deschide... + + + Open Image &File... + Deschide &fişier imagine... + + + &Print... + Im&primă... + + + Print Pre&view... + &Previzualizare tipărire... + + + E&xport ASCII... + E&xportă fişier ASCII... + + + + ArrowMarker + + dx + dx + + + dy + dy + + + angle + unghi + + + length + lungime + + + eqn + ecuaţie + + + y + y + + + x + x + + + + AssociationsDialog + + QtiPlot - Plot Associations + QtiPlot - Asociaţii de date + + + Spreadsheet: + Tabel: + + + Column + Coloană + + + X + X + + + Y + Y + + + xErr + xErr + + + yErr + yErr + + + &Update curves + Act&ualizează curbele + + + &OK + &OK + + + &Cancel + &Anulează + + + xEnd + xEnd + + + yEnd + yEnd + + + Angle + Unghi + + + Magn. + Magnitude, vector length + Magnitudine + + + + AxesDialog + + QtiPlot - General Plot Options + QtiPlot - Opţiuni generale ale graficului + + + &Apply + &Aplică + + + &OK + &OK + + + &Cancel + A&nulează + + + From + De la + + + To + Pană la + + + Type + Tip + + + linear + liniară + + + logarithmic + logaritmică + + + Inverted + Inversată + + + Show Axis &Break + Afişază &întrerupere + + + Draw Break &Decoration + &Desenează simbol de întrerupere + + + Position + Poziţie + + + % of Axis Length + % din lungimea axei + + + Width + Lăţime + + + pixels + pixeli + + + &Log10 Scale After Break + Scală &Log10 după întrerupere + + + Step Before Break + Pas înainte de întrerupere + + + Guess + Determină + + + Step After Break + Pas după întrerupere + + + Minor Ticks Before + Diviziuni secundare înainte + + + Minor Ticks After + Diviziuni secundare după + + + Step + Pas + + + Major Ticks + Diviziuni principale + + + Minor Ticks + Diviziuni secundare + + + Bottom + Jos + + + Left + Stânga + + + Top + Sus + + + Right + Dreapta + + + Scale + Scală + + + Major Grids + Grilaj principal + + + Minor Grids + Grilaj secundar + + + Line Color + Culoare + + + Line Type + Tip de linie + + + Thickness + Grosime + + + Axes + Axe + + + Additional lines + Linii suplimentare + + + X=0 + X=0 + + + Y=0 + Y=0 + + + Apply To + Aplică formatul + + + This Layer + Graficului + + + This Window + Ferestrei + + + All Windows + Tuturor ferestrelor + + + An&tialised + Linie ne&tă + + + Horizontal + Orizontal + + + Vertical + Vertical + + + Grid + Grilaj + + + Show + Afişază + + + Title + Titlu + + + Distance to axis + Distanţa pană la axă + + + &Font + &Font + + + Format + Format + + + Numeric + Numeric + + + Text from table + Text din tabel + + + Day of the week + Zi a săptămanii + + + Month + Lună + + + Time + Timp + + + Date + Dată + + + Column Headings + Titlu coloană + + + Font + Font + + + Axis &Font + &Fontul axei + + + Color + Culoare + + + None + Nici una + + + Out + Exterioare + + + In & Out + Interioare & Exterioare + + + In + Interioare + + + Labels space + Spaţiu etichete + + + Stand-off + Distanţă + + + Apply &to + Aplică forma&tul + + + Axis + Axe + + + Layer + Graficului + + + Window + Fereastrei + + + Show Labels + Afişază etichete + + + Show &backbone + Afişază linia &principală + + + Column + Coloană + + + Table + Tabel + + + Precision + Precizie + + + Angle + Unghi + + + For&mula + For&mulă + + + Canvas frame + Bordură + + + Draw backbones + Desenează linia principală + + + Line Width + Grosimea liniei + + + Major ticks length + Lungimea diviziunilor principale + + + Minor ticks length + Lungimea diviziunilor secundare + + + Set As &Default + &Defineşte ca format implicit + + + Apply &to... + Aplică forma&tul... + + + General + General + + + Automatic + Automat + + + Decimal: 100.0 + Zecimal: 100.0 + + + Scientific: 1e2 + Ştiinţific: 1e2 + + + Scientific: 10^2 + Ştiinţific: 10^2 + + + QtiPlot - Formula input error + QtiPlot - Eroare în formula introdusă + + + Valid variables are 'x' for Top/Bottom axes and 'y' for Left/Right axes! + Variabilele valide sunt 'x' pentru axa de sus/jos şi 'y' pentru axa stangă/dreaptă! + + + days + zile + + + weeks + săptămani + + + millisec. + millisec. + + + sec. + sec. + + + min. + min. + + + hours + ore + + + Decimal: 10000.0 + Zecimal: 10000.0 + + + Probability + Probabilitate + + + Logit + Logit + + + Scientific: 1e4 + Ştiinţific: 1e4 + + + Scientific: 1x10^4 + Ştiinţific: 1x10^4 + + + Engineering: 10k + Ingineresc: 10k + + + Scientific: 1·10^4 + Ştiinţific: 1·10^4 + + + Origin + Origine + + + &Inverted + &Inversată + + + Linear + Liniară + + + Log10 + Log10 + + + ln + ln + + + Log2 + Log2 + + + Reciprocal + Reciprocă + + + Hide Ticks + Ascunde diviziuni + + + At Axis Begin + La începutul axei + + + At Axis End + La sfârşitul axei + + + At Axis Begin & End + La capetele axei + + + + ColorBox + + black + negru + + + red + roşu + + + green + verde + + + blue + albastru + + + cyan + turcoaz + + + magenta + magenta + + + yellow + galben + + + dark yellow + galben închis + + + navy + albastru marin + + + purple + purpuriu + + + wine + vişiniu + + + olive + verde măsliniu + + + dark cyan + turcoaz închis + + + royal + albastru regal + + + orange + portocaliu + + + violet + violet + + + pink + roz + + + white + alb + + + light gray + gri deschis + + + gray + gri + + + light yellow + galben deschis + + + light cyan + turcoaz deschis + + + light magenta + magenta deschis + + + dark gray + gri închis + + + + ColorButton + + Custom + Personalizată + + + + ColorMapDialog + + QtiPlot + QtiPlot + + + Custom Color Map + Personalizare culori + + + &Apply + &Aplică + + + &Close + În&chide + + + Set Custom Palette + Setează paletă utilizator + + + + ColorMapEditor + + Level + Nivel + + + Color + Culoare + + + &Insert + &Inserează + + + &Delete + Şte&rge + + + &Scale Colors + &Gradient de culoare + + + + ColorMapPreviewDialog + + QtiPlot - Color Map Preview Dialog + QtiPlot - Dialog de previzualizare a paletelor de culoare + + + Colormap files + Fişiere conţinând palete de culoare predefinite + + + All files + Toate fişierele + + + << &Preview + << &Previzualizare + + + None + Paletă nedefinită + + + + ColorPickerPopup + + Custom + Personalizată + + + + ConfigDialog + + The column separator can be customized. +The following special codes can be used: +\t for a TAB character +\s for a SPACE + Separatorul de coloane poate fi personalizat. Următoarele coduri speciale pot fi folosite: +\t pentru caracterul TAB +\s pentru SPAŢIU + + + The separator must not contain the following characters: +0-9eE.+- + Separatorul de coloane nu trebuie să conţină caracterele următoare: 0-9eE.+- + + + Background + Fundal + + + Background Color + Culoare de fundal + + + Opacity + Opacitate + + + Canvas Color + Culoarea suprafeţei + + + Border Color + Culoare de bordură + + + Width + Lăţime + + + LF (Unix) + LF (Unix) + + + CRLF (Windows) + CRLF (Windows) + + + CR (Mac) + CR (Mac) + + + System Locale Setting + Setările regionale ale calculatorului + + + &B + &B + + + &It + &Italic + + + Translations + Traduceri + + + Help + Documentaţie + + + Python Configuration Files + Fişiere de configurare Python + + + QtiPlot - Choose default settings + QtiPlot - Definiţi opţiunile implice + + + General + General + + + Tables + Tabele + + + 2D Plots + Grafice 2D + + + 3D Plots + Grafice 3D + + + Notes + Note + + + Fitting + Ajustare de date + + + Options + Opţiuni + + + Curves + Curbe + + + Ticks + Diviziuni + + + Fonts + Fonturi + + + Do not &resize layers when window size changes + Nu &redimensiona graficele când dimeniunea ferestrei se schimbă + + + &Disable in-place editing + &Dezactivează editarea directă a textelor + + + Length + Lungime + + + Axes linewidth + Grosimea axei + + + Major Ticks + Diviziuni principale + + + Minor Ticks + Diviziuni secundare + + + Margin + Margine + + + Axes title space + Distanţa titlu-axe + + + Frame width + Grosimea bordurii + + + Axes &backbones + Linia &principală a axelor + + + Canvas Fra&me + &Bordură + + + Sho&w all axes + Afişază toate a&xele + + + Show &Title + Afişază &titlul + + + Scale &Fonts + Redimensionare &fonturi + + + Auto&scaling + &Scală automată + + + Antia&liasing + &Linii nete + + + Legend display + Legenda afisază + + + Column name + Nume coloană + + + Column comment + Comentariu coloană + + + Table name + Nume tabel + + + Table legend + Legendă tabel + + + Transparent + Transparent + + + None + Nici una + + + Out + Exterior + + + In & Out + Interior & Exterior + + + In + Interior + + + Print + Imprimare + + + Print Crop&marks + Imprimă &liniile ajutătoare pentru decupaj + + + &Scale layers to paper size + Aju&stează graficele la dimensiunile hârtiei + + + Prompt on closing + Cere confirmare la închidere + + + Folders + Dosare + + + Matrices + Matrici + + + &Notes + &Note + + + &OK + &OK + + + &Cancel + A&nulează + + + &Apply + &Aplică + + + &Text Font + Font pentru &text + + + &Labels Font + Font &Etichete + + + A&xes Labels + Tit&luri axe + + + Axes &Numbers + &Numerele de pe axe + + + &Legend + &Legendă + + + T&itle + T&itlu + + + Prompt on &renaming tables when appending projects + Confirmă &redenumirea tabelelor la adăugarea unui proiect + + + Application + Program + + + Confirmations + Confirmări + + + Colors + Culori + + + Numeric Format + Format numeric + + + File Locations + Amplasament fişiere + + + Language + Limbă + + + Style + Stil + + + Main Font + Font principal + + + Choose &font + Alegeţi &font + + + Workspace + Spaţiu de lucru + + + Panels text + Text în panouri + + + Panels + Panouri + + + Save every + Salvează la fiecare + + + &Backup project before saving + Creează copie de si&guranţă înainte de salvare + + + Check for new versions at startup + Verificaţi la pornire dacă există versiuni mai recente + + + minutes + minute + + + Default scripting language + Limbaj de programare implicit + + + Matrix Undo Stack Size + Mărimea listei de modificări pentru matrici + + + Endline character + Caracter de sfărşit de linie + + + Start New Project + Proiectele noi conţin + + + Empty + Nimic + + + Table + Tabel + + + Matrix + Matrice + + + Empty Graph + Grafic 2D vid + + + Note + Notă + + + &Enable autocompletion (Ctrl+U) + Activează sug&estiile de completare (Ctrl+U) + + + Number of Decimal Digits + Cifre semnificative + + + Decimal Separators + Separatori zecimali + + + Omit &Thousands Separator + Ignoră separa&torul de mii + + + Clipboard Decimal Separators + Separatori zecimali pentru copiere/lipire + + + Automatically &Recalculate Column Values + &Recalculeză automat valorile coloanei + + + &Display Comments in Header + A&fişază comentariile + + + Default Column Separator + Separator de coloane implicit + + + TAB + TAB + + + SPACE + SPAŢIU + + + Text + Text + + + Labels + Etichete + + + Grids + Grilaj + + + Ma&jor Grids + Grila&j principal + + + Mi&nor Grids + Grilaj secu&ndar + + + Color + Culoare + + + &Keep aspect ratio + &Păstrează aspectul + + + Geometry + Geometrie + + + Ticks - Labels space + Distanţa diviziuni - titlu + + + pixels + pixeli + + + Unit + Unitate + + + inch + ţol + + + mm + mm + + + cm + cm + + + point + punct + + + pixel + pixel + + + Canvas Width + Lăţime + + + Canvas Height + Înălţime + + + Ask before over&writing files + Confirmă rescrierea &fișierelor + + + mu&Parser uses C locale settings + mu&Parser foloseşte setări locale + + + Default curve style + Stil de curbă implicit + + + Line width + Grosimea liniei + + + Symbol size + Dimensiune simbol + + + Line + Linie + + + Scatter + Simbol + + + Line + Symbol + Linie + Simbol + + + Vertical drop lines + Linii verticale + + + Spline + Spline + + + Vertical steps + Trepte verticale + + + Horizontal steps + Trepte orizontale + + + Area + Suprafaţă + + + Vertical Bars + Bare verticale + + + Horizontal Bars + Bare orizontale + + + &Resolution + &Rezoluţie + + + (all data shown) + (afişază toate datele) + + + &Show Legend + Afişază &legenda + + + &Floor style + Stil &proiecţie + + + Isolines + Izolinii + + + Projection + Proiecţie + + + Smoot&h Line + L&inie netă + + + O&rthogonal + Or&togonal + + + Lab&els + &Etichete + + + &Mesh + &Linie + + + &Grid + &Grilaj + + + &Numbers + Nume&re + + + A&xes + A&xe + + + &Background + &Fundal + + + Default Color Map + Paletă de culori implicită + + + &Title + &Titlu + + + &Axes Labels + &Etichetele axelor + + + Autosca&ling + Sca&lă automată + + + Solid + Solid + + + Dash + Linie + + + Dot + Punct + + + Dash Dot + Linie Punct + + + Dash Dot Dot + Linie Punct Punct + + + Short Dash + Linie Scurtă + + + Short Dot + Punct Scurt + + + Short Dash Dot + Linie Punct Scurte + + + Tab length (pixels) + Lungimea caracterului TAB (pixeli) + + + Font + Font + + + &Display line numbers + Afişază numărul &liniei + + + Syntax Highlighting + Colorare sintactică + + + Co&mments + Co&mentarii + + + &Keywords + Cu&vinte cheie + + + &Quotations + &Ghilimele + + + &Functions + &Funcţii + + + Q&t Classes + Cla&se Qt + + + Generated Fit Curve + Curba de ajustare generată + + + Uniform X Function + Funcţie de X uniformă + + + Points + Puncte + + + Same X as Fitting Data + Aceleaşi abscise ca datele sursă + + + 2 points for linear fits + Doar 2 puncte pentru ajustările liniare + + + Display Peak Curves for Multi-peak Fits + Trasează curbele extremelor + + + Parameters Output + Rezultate parametri + + + Significant Digits + Cifre semnificative + + + Write Parameters to Result Log + Scrie rezultatele în istoric + + + Paste Parameters to Plot + Afişază rezultatele în grafic + + + Scale Errors with sqrt(Chi^2/doF) + Multiplică erorile cu sqrt(Chi^2/doF) + + + Peaks Color + Culoare extreme + + + Display Confirmation &Messages for Multi-peak Fits + Afişază &mesaje de confirmare pentru ajustările multi-peak + + + QtiPlot - Import options error + QtiPlot - Eroare în opţiunile de import + + + The separator must not contain the following characters: 0-9eE.+- + Separatorul de coloane nu trebuie să conţină caracterele următoare: 0-9eE.+- + + + Choose the location of the QtiPlot translations folder! + Alegeţi dosarul conţinând traducerile pentru QtiPlot! + + + Choose the location of the Python configuration files! + Alegeţi dosarul conţinând fişierele de configurare pentru Python! + + + Axes + Axe + + + Left + Stânga + + + Right + Dreapta + + + Bottom + Jos + + + Top + Sus + + + Enabled axes + Axe afişate + + + Show + Afişază + + + QtiPlot - index.html File Not Found! + QtiPlot - Fişierul index.html nu a fost găsit! + + + There is no file called <b>index.html</b> in folder %1.<br>Please choose another folder! + Nu există un fişier numit <b>index.html</b> în dosarul %1.<br>Vă rugăm să alegeţi un alt dosar! + + + QtiPlot - Folder Not Found! + QtiPlot - Dosarul nu a fost găsit! + + + The folder %1 doesn't exist.<br>Please choose another folder! + Dosarul %1 nu există.<br>Vă rugăm să alegeţi un alt dosar! + + + %1 is not a folder.<br>Please choose another folder! + %1 nu este un dosar.<br>Vă rugăm să alegeţi un alt dosar! + + + Choose the location of the QtiPlot help folder! + Alegeţi dosarul conţinand documentaţia pentru QtiPlot! + + + There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! + Nu există un fişier numit <b>index.html</b> în acest dosar.<br>Vă rugăm să alegeţi un alt dosar! + + + QtiPlot + QtiPlot + + + You don't have read access rights to folder %1.<br>Please choose another folder! + Nu aveţi drepturi de citire pentru dosarul %1.<br>Vă rugăm să alegeţi un alt dosar! + + + &Internet Connection + Conectare la &internet + + + &Proxy + &Proxy + + + Host + Gazdă + + + Port + Port + + + Username + Utilizator + + + Password + Parolă + + + LaTeX Compiler + Compilator LaTeX + + + Choose the location of the LaTeX compiler! + Vă rugam să indicaţi locaţia compilatorului LaTeX! + + + QtiPlot - File Not Found! + QtiPlot - Fişierul nu a fost găsit! + + + The file %1 doesn't exist.<br>Please choose another file! + Fişierul %1 nu există.<br>Vă rugăm să alegeţi un alt fişier! + + + %1 is a folder.<br>Please choose a file! + %1 este un dosar.<br>Vă rugăm să alegeţi un fişier! + + + You don't have read access rights to file %1.<br>Please choose another file! + Nu aveţi drepturi de citire pentru fişierul %1.<br>Vă rugăm să alegeţi un alt fişier! + + + New Color + Culoare nouă + + + &Load Default + Setări imp&licite + + + Delete Color + Şterge culoare + + + Move Color Up + Mută culoarea mai sus + + + Move Color Down + Mută culoarea mai jos + + + Indexed Colors + Culori indexate + + + Default Symbol + Simbol implicit + + + Edge width + Grosimea marginii + + + Fill + Umple + + + Name + Nume + + + Symbol + Simbol + + + Inde&xed Symbols + Simboluri inde&xate + + + &Fill Symbol + Simbol &plin + + + Move Symbol Up + Mută simbolul mai sus + + + Move Symbol Down + Mută simbolul mai sus + + + Pattern + Model + + + Line style + Stil linie + + + Fill area under curve + Umple suprafaţa de sub curbă + + + Default Line Style + Stil de linie implicit + + + Axis title + Titlu axe + + + Default + Implicit + + + Synchronize scale &divisions + Sincronizează &diviziunile axelor + + + + ContourLinesEditor + + Level + Nivel + + + Pen + Creion + + + &Insert + &Inserează + + + &Delete + Şte&rge + + + QtiPlot - Edit pen + QtiPlot - Editare creion + + + Color + Culoare + + + Apply to all + Aplică tuturor + + + Style + Stil + + + Width + Lăţime + + + &Ok + &OK + + + &Close + În&chide + + + + Convolution + + Convolution + Convoluţie + + + QtiPlot + QtiPlot + + + Error + Eroare + + + The signal data set %1 does not exist! + Setul de date %1 nu există! + + + The response data set %1 does not exist! + Setul de date %1 reprezentând funcţia de răspuns nu există! + + + The response dataset '%1' must be less then half the size of the signal dataset '%2'! + Setul de date %1 reprezentând funcţia de răspuns trebuie să aibă un număr de puncte mai mic decât jumătate din numărul punctelor din setul de date reprezentând semnalul '%2'! + + + The response dataset '%1' must contain an odd number of points! + Setul de date %1 reprezentând funcţia de răspuns trebuie să conţină un număr impar de puncte! + + + Could not allocate memory, operation aborted! + Memorie insuficientă, operaţia a fost abandonată! + + + Index + Index + + + + Correlation + + Correlation + Corelare + + + QtiPlot + QtiPlot + + + Error + Eroare + + + The data set %1 does not exist! + Setul de date %1 nu există! + + + Error in GSL forward FFT operation! + Librăria GSL a generat o eroare în timpul operaţiei FFT directe! + + + Lag + Lag + + + + CreateBinMatrixDialog + + QtiPlot + QtiPlot + + + Bin Matrix Dialog + Dimensiuni matrice + + + &OK + &OK + + + &Cancel + &Anulează + + + X-min + X-minim + + + X-max + X-maxim + + + Columns + Coloane + + + Y-min + Y-minim + + + Y-max + Y-maxim + + + Rows + Linii + + + Input Size Error + Eroare în dimensiunile introduse + + + The dimensions you have specified are not acceptable! + Dimensiunile specificate nu pot fi acceptate! + + + Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! + Va rugăm să introduceţi valori pozitive pentru care produsul linii*coloane nu depaşeşte valoare maximă permisă de sistemul dumneavoastră de operare pentru un număr întreg ! + + + + CurveRangeDialog + + QtiPlot - Plot range + QtiPlot - Interval de afişare + + + Data set: + Set de date: + + + From row number + De la linia cu numărul + + + To row number + La linia cu numărul + + + &OK + &OK + + + &Close + În&chide + + + + CurvesDialog + + QtiPlot - Add/Remove curves + QtiPlot - Adaugă/Şterge curbe + + + New curves style + Stilul noilor curbe + + + Line + Linie + + + Scatter + Simbol + + + Line + Symbol + Linie + Simbol + + + Vertical drop lines + Linii verticale + + + Spline + Spline + + + Vertical steps + Trepte verticale + + + Horizontal steps + Trepte orizontale + + + Area + Suprafaţă + + + Vertical Bars + Bare verticale + + + Horizontal Bars + Bare orizontale + + + Histogram + Histogramă + + + Contour - Color Fill + Linii de contour + culoare + + + Contour Lines + Linii de contour + + + Gray Scale Map + Scară de griuri + + + Histogram + Histogramă + + + Available data + Seturi de date disponibile + + + Graph contents + Conţinutul graficului + + + &Plot Associations... + &Asocieri de date... + + + Edit &Range... + Editează inte&rvalul... + + + &Edit Function... + &Editează funcţia... + + + OK + OK + + + Close + Închide + + + &Show Range + Afişază &intervalul + + + Show current &folder only + Afişază doar conţinutul dosarului &curent + + + &Plot Selection + &Trasează selecţia + + + &Plot + &Trasează + + + &Delete Selection + Sterge &selecţia + + + &Delete Curve + Şterge cur&ba + + + + CustomActionDialog + + QtiPlot + QtiPlot + + + Add Custom Action + Adăugaţi o acţiune personalizată + + + Folder + Dosar + + + Choose &Folder + Alegeţi &dosar + + + Script File + Fişier conţinând codul executabil + + + Choose &Script + Alegeţi &fişier + + + Icon + Icoană + + + Choose &Icon + Alegeţi &icoana + + + Text + Titlu + + + Tool Tip Text + Scurt text informativ + + + Shortcut + Secvenţă de taste + + + &Menu + &Meniu + + + &Tool Bar + Bara de unel&te + + + &Save + &Salvează + + + &Add + &Adaugă + + + &Remove + Şte&rge + + + &Close + În&chide + + + Error + Eroare + + + Please provide a description for your custom action! + Vă rugăm să furnizaţi o descriere pentru acţiunea personalizată! + + + Dot characters are not allowed in the description text! + Caracterul punct nu este admis în descriere! + + + You have already defined an action having description: %1 <br>Please provide a different description text! + Aţi definit deja o acţiune având descrierea: %1 <br>Vă rugăm să furnizaţi o descriere diferită! + + + The file you have specified doesn't exist, please choose a valid script file! + Fişierul specificat nu există, vă rugăm să alegeţi un fişier validl! + + + The image file you have specified doesn't exist or can't be read, please choose another file! + Fişierul imagine specificat nu există sau nu poate fi citit, vă rugăm să alegeţi un alt fişier! + + + Please provide a different key sequence! The following shortcut key sequences are already assigned: + Vă rugăm să introduceţi o altă secvenţă de taste! Următoarele secvenţe sunt deja utilizate: + + + Are you sure you want to remove this action? + Sunteţi sigur că vreţi să ştergeţi această acţiune personalizată? + + + Remove Action + Şterge acţiunea + + + File Save Error + Eroare de salvare a fişerului + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + Nu a fost posibilă scrierea în fişierul: <br><h4> %1 </h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie! + + + Images + Imagini + + + QtiPlot - Load icon from file + QtiPlot - Încarcă imagine din fişier + + + Choose script file + Alegeţi fişier sursă executabil + + + Choose the custom actions folder + Alegeţi dosarul conţinând acţiunile personalizate + + + &New Menu + A&daugă meniu + + + &Delete Menu + Şter&ge meniul + + + Python Script + Script Python + + + All Files + Toate fişierele + + + Add menu + Adaugă meniu + + + Menu title: + Titlul meniului: + + + Please, choose the location of the new menu + Vă rugam să indicaţi locaţia noului meniu + + + Menu: + Meniu: + + + Thers's already a menu item with this title, please choose another title! + Există deja un meniu cu acest titlu, vă rugăm să alegeţi un alt titlu! + + + Remove Menu + Ştergere meniu + + + Are you sure you want to remove menu '%1' and all its actions? + Sunteţi sigur că vreţi să ştergeţi meniul '%1' şi toate acţiunile pe care le conţine? + + + &New Menu... + Adaugă me&niu... + + + Menu Bar + Bara de meniu + + + There's already a menu item with this title, please choose another title! + Există deja un meniu cu acest titlu, vă rugăm să alegeţi un alt titlu! + + + + DataPickerTool + + Click on plot or move cursor to display coordinates! + Daţi click pe grafic sau mişcaţi cursorul pentru a afişa coordonatele! + + + Please, click on plot and move cursor! + Vă rugăm, daţi click pe grafic şi mişcaţi cursorul! + + + Select point and double click to remove it! + Selectaţi un punct şi efectuaţi un dublu-click pentru a-l şterge! + + + QtiPlot - Remove point error + QtiPlot - Eroare de ştergere a punctului + + + Sorry, but removing points of a function is not possible. + Ne pare rău, dar nu este posibil să ştergeţi puncte aparţinând unei funcţii. + + + QtiPlot - Warning + QtiPlot - Avertisment + + + This operation cannot be performed on curves plotted from columns having a non-numerical format. + Această operaţie nu poate fi efectuată pentru curbe ce utilizează ca surse de date coloane având un format diferit de cel numeric. + + + QtiPlot - Move point error + QtiPlot - Eroare de mutare a punctului + + + Sorry, but moving points of a function is not possible. + Ne pare rău, dar nu este posibil să mutaţi puncte aparţinând unei funcţii. + + + The column '%1' is read-only! Please choose another curve! + Coloana '%1' nu poate fi modificată! Vă rugăm să alegeţi o altă curbă! + + + + DataSetDialog + + QtiPlot - Select data set + QtiPlot - Alegeţi setul de date + + + &OK + &OK + + + &Cancel + &Anulează + + + + Deconvolution + + Deconvolution + Deconvoluţie + + + + Differentiation + + Derivative + Derivata + + + of + Derivative of + a + + + + DrawPointTool + + Draw + Desenează + + + + EnrichmentDialog + + QtiPlot + QtiPlot + + + Tex Equation Editor + Editor de ecuaţii Tex + + + Clea&r + Go&leşte + + + Window Geometry + Geometria ferestrei + + + Object Properties + Proprietăţile obiectului + + + &Apply + &Aplică + + + &Close + În&chide + + + Preview: + Previzualizare: + + + &Text + &Text + + + Color + Culoare + + + &Font + &Font + + + Background + Fundal + + + Opacity + Opacitate + + + Transparent + Transparent + + + Rotate (deg.) + Roteşte (grade) + + + Auto-&update + Auto-act&ualizează + + + TeX &Output + Sinta&xă TeX + + + Set As &Default + &Defineşte ca format implicit + + + Apply format &to... + Aplică forma&tul... + + + Object + Obiectului + + + Layer + Graficului + + + Window + Fereastrei + + + All Windows + Tuturor ferestrelor + + + File + Fişier + + + &Save internally + &Salvează in proiect + + + &Image + &Imagine + + + Shape + Formă + + + None + Fără bordură + + + Line + Linie + + + Rectangle + Dreptunghi + + + Shadow + Umbră + + + Line Style + Stil linie + + + Width + Lăţime + + + Apply t&o... + Aplică f&ormatul... + + + &Frame + &Bordură + + + Fill Color + Culoare de umplere + + + Pattern + Model + + + Pattern Color + Culoare model + + + Use &Frame Color + &Foloseşte culoarea bordurii + + + Fill &Pattern + Model de um&plere + + + Page + Pagină + + + Layer Scales + Axe de coordonate + + + Attach to + Ataşază la + + + inch + ţol + + + mm + mm + + + cm + cm + + + point + punct + + + pixel + pixel + + + scale + scară + + + Unit + Unitate + + + Position + Poziţie + + + X + X + + + Y + Y + + + Size + Dimensiuni + + + Height + Înălţime + + + &Keep aspect ratio + &Păstrează aspectul + + + &Best size + &Dimensiuni indicate + + + &Geometry + &Geometrie + + + Network connection error + Eroare de conectare la internet + + + Error while trying to connect to host %1: + Eroare în timpul încercării de conectare la %1: + + + Please verify your network connection! + Vă rugam să verificaţi conexiunea la internet! + + + QtiPlot - Import image from file + QtiPlot - Importă imagine din fişier + + + QtiPlot - Warning + QtiPlot - Avertisment + + + The file %1 doesn't exist. The image cannot be restored when reloading the project file! + Fişierul %1 nu există! Imaginea nu va putea fi afişată cand veţi redeschide proiectul! + + + MathTran (http://www.mathtran.org/) + MathTran (http://www.mathtran.org/) + + + locally installed + instalat local + + + LaTeX Compiler + Compilator LaTeX + + + Compile process ended + Procesul de compilare a luat sfârşit + + + Compiling process ended with exit code: %1 + Procesul de compilares-a terminat cu codul: %1 + + + LaTeX compile process + Procesul de compilare LaTeX + + + dvipng process + procesul dvipng + + + failed to start! + nu a putut începe! + + + Please verify that you have dvipng installed in the same folder as your LaTeX compiler! + Vă rugăm să verificaţi ca dvipng este instalat în acelaşi dosar cu compilatorul LaTeX! + + + crashed + distrus + + + timedout + oprit + + + write error + eroare de scriere + + + read error + eroare de citire + + + unknown error + eroare necunoscută + + + Compile error + Eroare de compilare + + + Please set the correct path to the compiler in the preferences dialog! + Vă rugăm să specificaţi locaţia corectă pentru compilator in dialogul "Opţiuni..."! + + + + ErrDialog + + Source of errors + Sursă + + + QtiPlot - Error Bars + QtiPlot - Bare de eroare + + + &X Error Bars + Bare de eroare în &X + + + &Add + &Adaugă + + + Add Error Bars to + Adaugă bare de eroare curbei + + + Percent of data (%) + Procent din date (%) + + + Standard Deviation of Data + Deviaţia standard + + + &Y Error Bars + Bare de eroare în &Y + + + &Close + În&chide + + + Existing column + Coloană existentă + + + + ExpDecayDialog + + QtiPlot - Verify initial guesses + QtiPlot - Verificare valori iniţiale + + + Exponential Fit of + Ajusează exponenţial curba + + + Growth time + Durata de viaţă + + + Decay time + Durata de viaţă + + + First decay time (t1) + Prima durată de viaţă (t1) + + + Second decay time (t2) + A doua durată de viaţă (t2) + + + Third decay time (t3) + A treia durată de viaţă (t3) + + + Amplitude + Amplitudine + + + Y Offset + Constantă Y + + + Initial time + Timp iniţial + + + Color + Culoare + + + &Fit + &Ajustează + + + &Close + În&chide + + + QtiPlot - Warning + QtiPlot - Avertisment + + + The curve <b> %1 </b> doesn't exist anymore! Operation aborted! + Curba <b> %1 </b> nu mai există! Operaţiunea a fost abandonată! + + + + ExponentialFit + + ExpGrowth + CreştereExp + + + Exponential growth + Creştere exponenţială + + + amplitude + amplitudine + + + lifetime + durata de viaţă + + + offset + constantă + + + ExpDecay1 + ScădereExp1 + + + Exponential decay + Scădere exponenţială + + + e-folding time + durata de viaţă (1/e) + + + + ExportDialog + + QtiPlot - Export ASCII + QtiPlot - Exportă ASCII + + + Table + Tabel + + + &All + &Toate + + + Separator + Separator + + + TAB + TAB + + + SPACE + SPAŢIU + + + The column separator can be customized. The following special codes can be used: +\t for a TAB character +\s for a SPACE + Separatorul de coloane poate fi personalizat. Următoarele coduri speciale pot fi folosite: +\t pentru caracterul TAB +\s pentru SPAŢIU + + + The separator must not contain the following characters: 0-9eE.+- + Separatorul de coloane nu trebuie să conţină caracterele următoare: 0-9eE.+- + + + Include Column &Names + Include &numele coloanelor + + + Include Column Co&mments + Include &comentariile + + + Export &Selection + Exportă &selecţie + + + QtiPlot + QtiPlot + + + Overwrite file? + Rescriere fişier? + + + %1 already exists. + %1 există deja. + + + Do you want to replace it? + Doriţi să-l înlocuiţi? + + + QtiPlot - Export error + QtiPlot - Eroare de export + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + Nu a fost posibilă scrierea în fişierul: <br><h4> %1 </h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie! + + + &OK + &OK + + + &Cancel + &Anulează + + + &Help + Aju&tor + + + QtiPlot - Help + QtiPlot - Ajutor + + + QtiPlot - Import options error + QtiPlot - Eroare în opţiunile de import + + + + ExtensibleFileDialog + + << &Advanced + << Opţiuni &Avansate + + + + ExtractDataDialog + + QtiPlot + QtiPlot + + + Extract Data + Extrage date + + + For row (i) + De la linia (i) + + + to + la + + + Add function + Adaugă funcţie + + + Add column + Adaugă coloană + + + &Apply + &Aplică + + + Clear &Formulas + Şterge &formulele + + + &Close + În&chide + + + &Put into table + &Pune in tabelul + + + Table + Tabel + + + Cond&ition: + Cond&iţie: + + + Add &function + Adaugă &funcţie + + + Add co&lumn + Adaugă coloa&nă + + + Add &operator + Adăugare &operator + + + Clea&r + Go&leşte + + + + FFT + + FFT + Transformată Fourier rapidă + + + QtiPlot + QtiPlot + + + Error + Eroare + + + Could not allocate memory, operation aborted! + Memorie insuficientă, operaţia a fost abandonată! + + + Forward + Directă + + + of + a + + + Frequency + Frecvenţă + + + Inverse + Inversă + + + Time + Timp + + + Real + Real + + + Imaginary + Imaginar + + + Amplitude + Amplitudine + + + Angle + Unghi + + + Hz + Hz + + + s + s + + + + FFTDialog + + QtiPlot - FFT Options + QtiPlot - Opţiuni pentru transformata Fourier rapidă (FFT) + + + &Forward + Transformată &directă + + + &Inverse + Transformată &inversă + + + Curve + Curbă + + + Sampling + Eşantionare + + + Real + Real + + + Imaginary + Imaginar + + + Sampling Interval + Interval de eşantionare + + + &Normalize Amplitude + &Normează amplitudinea + + + &Shift Results + &Rearanjază rezultatele + + + &OK + &OK + + + &Close + În&chide + + + QtiPlot - Error + QtiPlot - Eroare + + + Please choose a column for the real part of the data! + Vă rugăm să alegeţi o coloană reprezentând partea reală a datelor! + + + QtiPlot + QtiPlot + + + The two matrices have different dimensions, the imaginary part will be neglected! + Cele două matrici au dimensiuni diferite, partea imaginară va fi ignorată! + + + RealMatrixFFT + MatriceRealăFFT + + + Real part of the FFT transform of + Partea reală a transformatei Fourier rapide a + + + ImagMatrixFFT + MatriceImaginarăFFT + + + Imaginary part of the FFT transform of + Partea imaginară a transformatei Fourier rapide a + + + AmplitudeMatrixFFT + MatriceAmplitudiniFFT + + + Amplitudes of the FFT transform of + Amplitudinea transformatei Fourier rapide a + + + + FFTFilter + + FFT + Transformată Fourier rapidă + + + Filtered + Filtrat(ă) + + + QtiPlot + QtiPlot + + + Error + Eroare + + + Unknown filter type. Valid values are: 1 - Low pass, 2 - High Pass, 3 - Band Pass, 4 - Band block. + Tip de filtru necunoscut! Valorile valide sunt: 1 - Trece jos, 2 - Trece sus, 3 - Trece bandă, 4 - Blochează bandă. + + + Please enter different values for the band limits. + Vă rugam să introduceţi valori diferite pentru limitele benzii. + + + to + la + + + Hz + Hz + + + Low Pass FFT Filter + Filtru FFT trece jos + + + High Pass FFT Filter + Filtru FFT trece sus + + + Band Pass FFT Filter + Filtru FFT trece bandă + + + Band Block FFT Filter + Filtru FFT blochează bandă + + + + Filter + + QtiPlot + QtiPlot + + + Error + Eroare + + + Please assign a curve first! + Vă rugam să selectaţi mai întâi o coloană! + + + Several data points have the same x value causing divisions by zero, operation aborted! + Mai multe puncte au aceeaşi abscisă, ceea ce duce la operaţii de împărţire la zero. Operaţia a fost abandonată! + + + You need at least %1 points in order to perform this operation! + Aveţi nevoie de cel puţin %1 puncte pentru a efectua această operaţia! + + + QtiPlot - Filter Error + QtiPlot - Eroare de filtrare + + + Please enter a valid curve name! + Vă rugăm introduceţi un nume de curbă valid! + + + QtiPlot - Color Name Error + QtiPlot - Eroare detectată în numele culorii + + + The color name '%1' is not valid, a default color (red) will be used instead! + Numele culorii '%1' nu este valid, se va folosi o culoare implicită (roşu)! + + + You didn't specify a valid data set for this operation! + Nu aţi specificat un set de date valid pentru această operaţie! + + + of + a + + + Plot + Grafic + + + Memory Allocation Error + Eroare de alocare a memoriei + + + Not enough memory, operation aborted! + Memorie insuficientă, operaţia a fost abandonată! + + + + FilterDialog + + QtiPlot - Filter options + QtiPlot - Opţiuni de filtrare + + + Filter curve: + Filtrează curba: + + + Frequency cutoff (Hz) + Frecvenţă de tăiere (Hz) + + + Low Frequency (Hz) + Limita de jos (Hz) + + + High Frequency (Hz) + Limita de sus (Hz) + + + Add DC Offset + Adaugă componenta continuă + + + Substract DC Offset + Scade componenta continuă + + + Color + Culoare + + + &Filter + &Filtrează + + + &Close + În&chide + + + QtiPlot - Frequency input error + QtiPlot - Eroare detectată în frecvenţa introdusă + + + Please enter frequency limits that satisfy: Low < High ! + Vă rugam să introduceţi limite care satisfac condiţia: frecvenţa joasă < frecvenţa înaltă ! + + + + FindDialog + + QtiPlot + QtiPlot + + + Find + Caută + + + Start From + Începe de la + + + Search in + Cauta în + + + &Window Names + &Numele ferestrelor + + + Window &Labels + &Etichetele ferestrelor + + + Folder &Names + Numele &dosarelor + + + Case &Sensitive + Căutare &sensibilă la majuscule + + + &Partial Match Allowed + &Potrivire parţială + + + &Include Subfolders + &Include dosarele + + + &Find + Cau&tă + + + &Update Start Path + Act&ualizează calea de pornire + + + &Close + În&chide + + + + FindReplaceDialog + + QtiPlot + QtiPlot + + + Find + Caută + + + Find and Replace + Caută şi înlocuieşte + + + Replace with + Înlocuieşte cu + + + &Match case + Sensibil la &majuscule + + + &Whole word + Cu&vant întreg + + + &Next + &Următorul + + + &Previous + &Precedentul + + + &Replace + În&locuieşte + + + Replace &all + Înlocuieşte &tot + + + &Close + În&chide + + + Empty Search Field + Şirul de caractere căutat este vid + + + The search field is empty. Please enter some text and try again. + Şirul de caractere căutat este vid. Vă rugăm introduceţi un şir de caractere şi încercaţi din nou. + + + QtiPlot has finished searching the document. + QtiPlot a terminat de căutat în document. + + + + Fit + + Plot + Grafic + + + graphics display disabled + afişaj grafic dezactivat + + + of dataset + a setului de date + + + using function + folosind funcţia + + + Weighting Method + Metodă de ponderare + + + No weighting + Fără ponderare + + + Instrumental + Instrumentală + + + using error bars dataset + folosind bare de eroare din setul de date + + + Statistical + Statistică + + + Arbitrary Dataset + Set de date arbitrar + + + Direct Weighting using Dataset + Ponderare directă folosind setul de date + + + Nelder-Mead Simplex + Nelder-Mead Simplex + + + Unscaled Levenberg-Marquardt + Levenberg-Marquardt nescalat + + + Scaled Levenberg-Marquardt + Levenberg-Marquardt scalat + + + algorithm with tolerance = + algoritm cu toleranţa = + + + From x + De la x + + + to x + până la x + + + R^2 + R^2 + + + Adjusted R^2 + R^2 ajustat + + + RMSE (Root Mean Squared Error) + RMSE (Eroarea pătratică medie) + + + RSS (Residual Sum of Squares) + RSS (Suma reziduală a pătratelor) + + + Iterations + Iteraţii + + + Status + Statut + + + Dataset + Set de date + + + Function + Funcţie + + + QtiPlot - Error + QtiPlot - Eroare + + + You cannot use the instrumental weighting method. + Nu puteţi folosi metoda de ponderare instrumentală. + + + The curve %1 has no associated Y error bars. You cannot use instrumental weighting method. + Curba %1 nu are ataşate bare de eroare. Nu puteţi folosi metoda de ponderare instrumentală. + + + The column %1 has less points than the fitted data set. Please choose another column! + Coloana %1 are mai puţine puncte decat setul de date folosit pentru ajustare. Vă rugăm să alegeţi o altă coloană! + + + The column %1 has less points than the fitted data set. Please choose another column!. + Coloana %1 are mai puţine puncte decat setul de date folosit pentru ajustare. Vă rugăm să alegeţi o altă coloană! + + + Parameter + Parametru + + + Value + Valoare + + + Error + Eroare + + + QtiPlot - Fit Error + QtiPlot - Eroare de ajustare + + + Please perform a fit first! + Vă rugam să efectuaţi mai întâi o ajustare! + + + FitResiduals + ReziduuriAjustare + + + Residuals of %1 + Reziduuri ale %1 + + + residue + reziduu + + + QtiPlot - Memory Allocation Error + QtiPlot - Eroare de alocare a memoriei + + + Not enough memory! + Memorie insuficientă! + + + FitStats + StatisticiAjustare + + + Confidence Limits of %1 + Interval de încredere pentru %1 + + + Independent Variable + Variabilă independentă + + + LCL + + + + Lower %1 Confidence Limit + Limită de încredere inferioară %1 + + + UCL + + + + Upper %1 Confidence Limit + Limită de încredere superioară %1 + + + Prediction Limits of %1 + Benzi de predicţie pentru %1 + + + LPL + + + + Lower %1 Prediction Limit + Limită de predicţie inferioară %1 + + + UPL + + + + Upper %1 Prediction Limit + Limită de predicţie superioară %1 + + + You didn't specify a valid data set for this fit operation. Operation aborted! + Nu aţi specificat un set de date valid pentru această operaţie. Operaţia a fost abandonată! + + + There are no parameters specified for this fit operation. Operation aborted! + Nu aţi definit parametrii pentru această operaţie de ajustare. Operaţia a fost abandonată! + + + You need at least %1 data points for this fit operation. Operation aborted! + Aveţi nevoie de cel puţin %1 puncte pentru a efectua operaţia de ajustare. Operaţia fost abandonată! + + + You must specify a valid fit function first. Operation aborted! + Trebuie să specificaţi mai întâi o funcţie de ajustare validă. Operaţia a fost abandonată! + + + Could not allocate enough memory for the fit curves! + Memorie insuficientă pentru curbele de ajustare! + + + QtiPlot - Memory Allocation Error + QtiPlot - Eroare de alocare a memoriei + + + Fit + Ajustare + + + QtiPlot + QtiPlot + + + File Save Error + Eroare de salvare a fişerului + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + Nu a fost posibilă scrierea în fişierul: <br><h4> %1 </h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie! + + + QtiPlot Fit Model + Funcţie de ajustare QtiPlot + + + Cannot read file %1: +%2. + Nu a fost posibilă citirea fişierului %1:%2. + + + + FitDialog + + QtiPlot - Fit Wizard + QtiPlot - Asistent de ajustare + + + Curve + Curbă + + + Function + Funcţie + + + Initial guesses + Valori iniţiale + + + &Save + &Salvează + + + &Preview + &Previzualizare + + + Parameter + Parametru + + + Data Set + Set de date + + + Weighting + Metodă de ponderare + + + Re&load + R&eîncarcă + + + &Guess + &Determină + + + &Range + Inte&rval + + + From + De la + + + Value + Valoare + + + To + Pană la + + + Constant + Constant + + + Error + Eroare + + + Algorithm + Algoritm + + + Scaled Levenberg-Marquardt + Levenberg-Marquardt scalat + + + Unscaled Levenberg-Marquardt + Levenberg-Marquardt nescalat + + + Nelder-Mead Simplex + Nelder-Mead Simplex + + + Color + Culoare + + + From x= + De la x= + + + To x= + La x= + + + Iterations + Iteraţii + + + Tolerance + Toleranţă + + + Weighting Method + Metodă de ponderare + + + No weighting + Fără ponderare + + + Instrumental + Instrumentală + + + Statistical + Statistică + + + Arbitrary Dataset + Set de date arbitrar + + + Direct Weighting + Ponderare directă + + + << &Edit function + << &Editează funcţia + + + &Delete Fit Curves + Şterge curbele &de ajustare + + + &Fit + &Ajustează + + + &Close + În&chide + + + Custom &Output >> + Personalizare &rezultate >> + + + Category + Categorie + + + Expression + Expresie + + + User defined + Funcţii utilizator + + + Built-in + Funcţii predefinite + + + Basic + Funcţii elementare + + + Plugins + Extensii + + + Fit with &built-in function + Ajustare cu funţia &predefinită + + + Polynomial Order + Ordinul polinomului + + + Choose plug&ins folder... + Alegeţi dosarul conţinând extens&ii... + + + Name + Nume + + + user1 + funcţie1 + + + Parameters + Parametri + + + &Remove + Şte&rge + + + Add &expression + Adaugă &expresie + + + Add &name + Adaugă &nume + + + Rese&t + Ş&terge + + + &Fit >> + &Ajustează >> + + + &Uniform X Function + Funcţie de X &uniformă + + + Points + Puncte + + + Same X as Fitting &Data + Aceleaşi abscise ca &datele sursă + + + Generated Fit Curve + Curba de ajustare generată + + + Significant Digits + Cifre semnificative + + + Parameters &Table + &Tabel parametri + + + Name: + Nume: + + + &One table for all fits + &Un tabel pentru toate ajustările + + + Covariance &Matrix + &Matricea de covarianţă + + + CovMatrix + MatriceCovarianţă + + + Co&nf. Bands + Interval de î&ncredere + + + Pred. &Bands + &Benzi de predicţie + + + &Residuals Plot + Afişază &reziduurile + + + &Scale Errors with sqrt(Chi^2/doF) + Multiplică erorile cu &sqrt(Chi^2/doF) + + + Parameters Output + Rezultate parametri + + + &Write Parameters to Result Log + Scrie re&zultatele în istoric + + + &Paste Parameters to Plot + Afişază rezultatele în &grafic + + + << &Fit + << Ajus&tează + + + Select Function + Selectează funcția + + + Fitting Session + Sesiune de ajustare + + + Custom Output + Personalizare rezultate + + + Start Fitting Session + Începe ajustarea de date + + + &Apply + &Aplică + + + QtiPlot - Error + QtiPlot - Eroare + + + Please enter a valid name for the parameters table. + Vă rugăm introduceţi un nume valid pentru tabelul de parametri. + + + Please perform a fit first and try again. + Vă rugam să efectuaţi mai întâi o ajustare şi apoi să încercaţi din nu. + + + Please enter a valid name for the covariance matrix. + Vă rugăm introduceţi un nume valid pentru matrice. + + + QtiPlot - Input function error + QtiPlot - Eroare detectată în funcţia introdusă + + + Please enter a valid function! + Vă rugăm să introduceţi o funcţie validă! + + + Please enter a function name! + Vă rugăm să introduceţi un nume de funcţie! + + + QtiPlot - Error: function name + QtiPlot - Eroare: numele funcţiei + + + is a built-in function name<p>You must choose another name for your function! + este un nume de funcţie predefinită. <p> Trebuie să alegeţi un alt nume pentru funcţia dumneavoastră! + + + You can't define functions recursively! + Nu puteţi defini funcţii în mod recursiv! + + + QtiPlot fit model + Funcţie de ajustare QtiPlot + + + All files + Toate fişierele + + + QtiPlot + QtiPlot + + + Save Fit Model As + Salvează funcţia de ajustare ca + + + Are you sure you want to remove fit model file: + %1 ? + Sunteţi sigur că vreţi să ştergeţi fişierul conţinînd un model de ajustare: %1 ? + + + Remove Fit Model + Şterge funcţia de ajustare + + + Choose &models folder... + Alegeţi dosarul conţinând &modele de ajustare... + + + Fit with selected &user function + Ajustare cu funţia selecţionată de &utilizatorului + + + Fit using &built-in function + Ajustare cu funţia &predefinită + + + Fit using &plugin function + Ajustare folosind e&xtensia + + + Choose the plugins folder + Alegeţi dosarul conţinând extensii + + + Choose the fit models folder + Alegeţi dosarul conţinând modele de ajustare + + + Gauss + Gauss + + + Lorentz + Lorenz + + + Peaks + Extreme + + + Polynomial + Polinomial + + + QtiPlot - Warning + QtiPlot - Avertisment + + + The curve <b> %1 </b> doesn't exist anymore! Operation aborted! + Curba <b> %1 </b> nu mai există! Operaţiunea a fost abandonată! + + + QtiPlot - Input error + QtiPlot - Eroare + + + Please enter x limits that satisfy: from < end! + Vă rugam să introduceţi limite care satisfac condiţia: început < sfarşit ! + + + Please verify that you have initialized all the parameters! + Vă rugăm verificaţi că aţi iniţializat toţi parametrii! + + + No data tables + Nu există tabele de date + + + Error: + Eroare: + + + + Folder + + kB + kilobiţi + + + bytes + biţi + + + + FrequencyCountDialog + + QtiPlot - Frequency count + QtiPlot - Numără frecvenţa de apariţie + + + Statistics on %1 + Statistici pentru setul de date %1 + + + Mean + Medie + + + Standard Deviation + Deviaţia standard + + + Median + + + + Size + Dimensiune + + + From Minimum + De la minim + + + To Maximum + La maxim + + + Step Size + Pas + + + &Apply + &Aplică + + + &Cancel + A&nulează + + + &Ok + &OK + + + QtiPlot - Error + QtiPlot - Eroare + + + Not enough data points, operation aborted! + Setul de date este insuficient, operaţia a fost abandonată! + + + QtiPlot - Frequency input error + QtiPlot - Eroare detectată în frecvenţa introdusă + + + Please enter frequency limits that satisfy: From < To ! + Vă rugam să introduceţi limite care satisfac condiţia: minim < maxim ! + + + Count + Numără + + + Frequency count of %1 + Numărare frecvenţă de apariţie în setul de date %1 + + + BinCtr + Eşantion + + + BinEnd + SfarşitEşantion + + + Sum + Sumă + + + + FunctionDialog + + QtiPlot - Add function curve + QtiPlot - Adaugă funcţie + + + Curve type + Tip de funcţie + + + Click here to select a recently typed expression + Apăsați aici pentru a alege o expresie recent introdusă + + + Rece&nt + Re&cent + + + Function + Funcţie de o variabilă + + + Parametric plot + Curbă parametrică + + + Polar plot + Coordonate polare + + + f(x)= + f(x)= + + + From x= + De la x= + + + To x= + La x= + + + Points + Puncte + + + Constant + Constantă + + + Value + Valoare + + + Parameter + Parametru + + + From + De la + + + To + La + + + QtiPlot + QtiPlot + + + Sorry, there are no recent expressions available! + Ne pare rău, nu există expresii recente disponibile! + + + Recent Functions + Funcții recente + + + Please, choose a function: + Vă rugăm să alegeţi o funcţie: + + + x = + x = + + + y = + y = + + + R = + R = + + + Theta = + Theta = + + + Clea&r Function + Şte&rge funcţia + + + &Ok + &OK + + + &Close + În&chide + + + Clear list + Goleşte lista + + + Clear Function + Şterge funcţia + + + QtiPlot - Input error + QtiPlot - Eroare + + + Please enter x limits that satisfy: from < end! + Vă rugam să introduceţi limite care satisfac condiţia: început < sfarşit ! + + + QtiPlot - Input function error + QtiPlot - Eroare detectată în funcţia introdusă + + + QtiPlot - Start limit error + QtiPlot - Eroare detectată la valoarea de start + + + QtiPlot - End limit error + QtiPlot - Eroare detectată la valoarea de sfarşit + + + Please enter parameter limits that satisfy: from < end! + Vă rugam să introduceţi limite care satisfac condiţia: început < sfarşit ! + + + &Add Function + Adaugă &funcţie + + + + GaussAmpFit + + GaussAmp + GaussAmp + + + offset + constantă + + + amplitude + amplitudine + + + center + centru + + + width + lăţime + + + GaussAmp Fit + Ajustare cu funcţia GaussAmp + + + + GaussFit + + Gauss + Gauss + + + Gauss Fit + Ajustare gaussiană + + + area + aria + + + center + centru + + + width + lăţime + + + offset + constantă + + + + Graph + + Y Axis Title + Titlu axă Y + + + X Axis Title + Titlu axă X + + + QtiPlot - Error + QtiPlot - Eroare + + + Couldn't change the axis type to the requested format! + Formatul axei nu a putut fi schimbat! + + + Please provide a valid file name! + Vă rugăm introduceţi un nume valid! + + + File format not handled, operation aborted! + Format de fişier necunoscut, operaţiunea a fost abandonată! + + + layer + grafic + + + Title + Titlu + + + QtiPlot - File open error + QtiPlot - Eroare de deschidere fişier + + + Image file: <p><b> %1 </b><p>does not exist anymore! + Fişierul imagine: <p><b> %1 </b><p> nu mai există! + + + Data set generated from curve + Set de date generat folosind curba + + + Table + Tabel + + + QtiPlot - Warning + QtiPlot - Avertisment + + + The columns + Coloanele + + + are empty and will not be added to the plot! + sunt vide şi nu vor fi adăugate graficului! + + + The column + Coloana + + + is empty and will not be added to the plot! + este vidă şi nu va fi adăugată graficului! + + + Cu&t + &Taie + + + &Copy + &Copiază + + + C&lear + Go&leşte + + + &Delete + Şte&rge + + + &Properties... + &Proprietăti... + + + &Rescale to show all + &Afişază toate datele + + + Ctrl+Shift+R + Ctrl+Shift+R + + + &Hide axis + Ascu&nde axa + + + &Show grids + Afişază &grilajul + + + &Scale... + &Scală... + + + There are no curves available on this plot! + Nu există curbe disponibile în acest grafic! + + + There are no curves with more than two points on this plot. Operation aborted! + Nu există curbe conţinând mai mult de două puncte în acest grafic. Operaţie abandonată! + + + F + F + + + + Graph3D + + X axis + Axă X + + + Y axis + Axă Y + + + Z axis + Axă Z + + + QtiPlot - Error + QtiPlot - Eroare + + + Please provide a valid file name! + Vă rugăm introduceţi un nume valid! + + + File format not handled, operation aborted! + Format de fişier necunoscut, operaţiunea a fost abandonată! + + + + ImageExportDialog + + QtiPlot - Choose a filename to save under + QtiPlot - Alegeţi un nume de fişier + + + Resolution (DPI) + Rezoluţie (pixeli/ţol) + + + &Export in &color + Exportă în &culori + + + &Escape special characters in texts + &Exportă caracterele speciale din obiectele text + + + Export 3D texts as + Exportă textele 3D ca + + + Bitmap images + Imagini bitmap + + + Native fonts + Fonturi native + + + LaTeX file + Fişier LaTeX + + + 3D Sort mode + Metodă de sortare 3D + + + No sort + Fără sortare + + + Simple sort + Sortare simplă + + + BSP sort + Sortare BSP + + + Image quality + Calitatea imaginii + + + Save transparency + Salvează transparenţa + + + QtiPlot + QtiPlot + + + Overwrite file? + Rescriere fişier? + + + %1 already exists. + %1 există deja. + + + Do you want to replace it? + Doriţi să-l înlocuiţi? + + + QtiPlot - Export error + QtiPlot - Eroare de export + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + Nu a fost posibilă scrierea în fişierul: <br><h4> %1 </h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie! + + + Custom size + Dimensiuni + + + inch + ţol + + + mm + mm + + + cm + cm + + + point + punct + + + pixel + pixel + + + Unit + Unitate + + + Width + Lăţime + + + Height + Înălţime + + + &Keep aspect ratio + &Păstrează aspectul + + + Custom print size + Dimensiuni tipărire + + + Export in &color + Exportă în &culori + + + &Escape special characters in title/axis labels + &Exportă caracterele speciale din titlu/etichete axe + + + Export &font sizes + Exportă dimensiunile &fonturilor + + + Scale Fonts Factor + Factor de redimensionare fonturi + + + Automatic + Automat + + + Print Resolution (DPI) + Rezoluţia la imprimare (pixeli/ţol) + + + + ImageProfilesTool + + Position + Poziţie + + + x + x + + + y + y + + + Z-Value + Valoare Z + + + + ImageWidget + + QtiPlot - File openning error + QtiPlot - Eroare de deschidere fişier + + + The file: <b>%1</b> doesn't exist! + Fişierul: <b>%1</b> nu există! + + + You don't have the permission to open this file: <b>%1</b> + Nu aveţi permisiunea să deschideţi fişierul: <b>%1</b> + + + + ImportASCIIDialog + + QtiPlot - Import ASCII File(s) + QtiPlot - Importă fişier(e) ASCII + + + All files + Toate fişierele + + + Text files + Fişiere text + + + Data files + Fişiere de date + + + Comma Separated Values + Valori separate de virgulă + + + Import each file as: + Importă fiecare fişier ca: + + + New Table + Tabel nou + + + New Matrice + Matrice nouă + + + New Columns + Coloane noi + + + New Matrix + Matrice nouă + + + New Rows + Linii noi + + + Overwrite Current Window + Rescrie tabelul curent + + + Separator: + Separator: + + + TAB + TAB + + + SPACE + SPAŢIU + + + The column separator can be customized. +The following special codes can be used: +\t for a TAB character +\s for a SPACE + Separatorul de coloane poate fi personalizat. Următoarele coduri speciale pot fi folosite: +\t pentru caracterul TAB +\s pentru SPAŢIU + + + The separator must not contain the following characters: +0-9eE.+- + Separatorul de coloane nu trebuie să conţină caracterele următoare: 0-9eE.+- + + + Ignore first + Ignoră primele + + + lines + linii + + + Ignore lines starting with + Ignoră liniile începând cu + + + Use first row to &name columns + Utilizează prima linie pentru a denum&i coloanele + + + Use first row &as + Utilizează prima linie c&a + + + Column Names + Nume coloană + + + Column Comments + Comentariu coloană + + + Use second row as &comments + Utilizează a doua linie drept &comentarii + + + &Remove white spaces from line ends + Şterge spaţiile alb&e de la capetele liniilor + + + By checking this option all white spaces will be +removed from the beginning and the end of +the lines in the ASCII file. + when translating this check the what's this functions and tool tips to place the '\n's correctly + Daca selectaţi această opţiune toate spaţiile albe vor fi şterse de la începutul şi sfârşitul liniilor din fişierul ASCII. + + + Warning: checking this option leads to column +overlaping if the columns in the ASCII file don't +have the same number of rows. + Avertisment: slectarea acestei opţiuni poate duce la amestecarea diverselor coloane de date daca in fişierul ASCII acestea nu au acelaşi număr de linii. + + + To avoid this problem you should precisely +define the column separator using TAB and +SPACE characters. + when translating this check the what's this functions and tool tips to place the '\n's correctly + Pentru a evita această problemă trebuie să specificaţi separatorul de coloane folosind caracterele TAB şi SPAŢIU. + + + &Simplify white spaces + &Simplifică spaţiile albe + + + By checking this option all white spaces will be +removed from the beginning and the end of the +lines and each sequence of internal +whitespaces (including the TAB character) will +be replaced with a single space. + when translating this check the what's this functions and tool tips to place the '\n's correctly + Daca selectaţi această opţiune toate spaţiile albe vor fi şterse de la începutul şi sfârşitul liniilor din fişierul ASCII şi fiecare secvenţă internă de spaţii (incluzând caracterul TAB) va fi înlocuită cu un singur spaţiu. + + + Warning: checking this option leads to column +overlaping if the columns in the ASCII file don't +have the same number of rows. + when translating this check the what's this functions and tool tips to place the '\n's correctly + Avertisment: slectarea acestei opţiuni poate duce la amestecarea diverselor coloane de date daca in fişierul ASCII acestea nu au acelaşi număr de linii. + + + Decimal Separators + Separatori zecimali + + + System Locale Setting + Setările regionale ale calculatorului + + + Omit &thousands separator + Ignoră separa&torul de mii + + + Endline character + Caracter de sfărşit de linie + + + LF (Unix) + LF (Unix) + + + CRLF (Windows) + CRLF (Windows) + + + CR (Mac) + CR (Mac) + + + Import as &read-only + Importă fară drept de modifica&re + + + &Preview Lines + Linii de &previzualizare + + + All + Toate + + + &Help + A&jutor + + + The column separator can be customized. The following special codes can be used: +\t for a TAB character +\s for a SPACE + Separatorul de coloane poate fi personalizat. Următoarele coduri speciale pot fi folosite: +\t pentru caracterul TAB +\s pentru SPAŢIU + + + The separator must not contain the following characters: 0-9eE.+- + Separatorul de coloane nu trebuie să conţină caracterele următoare: 0-9eE.+- + + + Remove white spaces from line ends + Şterge spaţiile albe de la capetele liniilor + + + By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. + Daca selectaţi această opţiune toate spaţiile albe vor fi şterse de la începutul şi sfârşitul liniilor din fişierul ASCII. + + + Simplify white spaces + Simplifică spaţiile albe + + + By checking this option each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. + Daca selectaţi această opţiune toate secvenţele de spaţii albe (incluzând caracterul TAB) vor fi înlocuite cu un singur spaţiu. + + + By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. + Daca selectaţi această opţiune toate spaţiile albe vor fi şterse de la începutul şi sfârşitul liniilor din fişierul ASCII şi fiecare secvenţă internă de spaţii (incluzând caracterul TAB) va fi înlocuită cu un singur spaţiu. + + + Warning: using these two last options leads to column overlaping if the columns in the ASCII file don't have the same number of rows. + Avertisment: slectarea acestor ultime doua opţiuni poate duce la amestecarea diverselor coloane de date daca in fişierul ASCII acestea nu au acelaşi număr de linii. + + + To avoid this problem you should precisely define the column separator using TAB and SPACE characters. + Pentru a evita această problemă trebuie să specificaţi separatorul de coloane folosind caracterele TAB şi SPAŢIU. + + + QtiPlot - Help + QtiPlot - Ajutor + + + QtiPlot - File openning error + QtiPlot - Eroare de deschidere fişier + + + You don't have the permission to open this file: <b>%1</b> + Nu aveţi permisiunea să deschideţi fişierul: <b>%1</b> + + + + IntDialog + + QtiPlot - Integration Options + QtiPlot - Opţiuni de integrare + + + Function + Funcţie + + + Variable + Variabilă + + + Order (1 - 5, 1 = Trapezoidal Rule) + Ordin (1 - 5, 1 = Metoda trapezelor) + + + Number of iterations (Max=20) + Număr de iteraţii (Max=20) + + + Tolerance + Toleranţă + + + Lower limit + Limita inferioară + + + Upper limit + Limita superioară + + + &Plot area + Trasează su&prafaţă + + + &Integrate + &Integrează + + + &Close + În&chide + + + + Integration + + QtiPlot - Input error + QtiPlot - Eroare + + + Integration + Integrare + + + Numerical integration of + Integrare numerică a setului de date + + + using a %1 order method + folosind o metodă de ordinul %1 + + + From + De la + + + to + la + + + Tolerance + Toleranţă + + + Iterations + Iteraţii + + + Plot + Grafic + + + using the Trapezoidal Rule + folosind metoda trapezelor + + + Points + Puncte + + + from + de la + + + Peak at + Maxim la + + + Area + Aria + + + QtiPlot - Error + QtiPlot - Eroare + + + Unknown integration method. Valid values must be in the range: 1 (Trapezoidal Method) to 5. + Metodă de integrare necunoscută. Valorile valide trebuie să se situeze în intervalul: 1 ( metoda trapezelor) - 5. + + + + Interpolation + + QtiPlot + QtiPlot + + + Error + Eroare + + + Unknown interpolation method. Valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. + Metodă de interpolare necunoscută, valorile valide sunt: 0 - Liniar, 1 - Cubic, 2 - Akima. + + + Linear + Liniară + + + Int + Int + + + Interpolation + Interpolare + + + Cubic + Cubică + + + Akima + Akima + + + QtiPlot - Error + QtiPlot - Eroare + + + Unknown interpolation method, valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. + Metodă de interpolare necunoscută, valorile valide sunt: 0 - Liniar, 1 - Cubic, 2 - Akima. + + + You need at least %1 points in order to perform this operation! + Aveţi nevoie de cel puţin %1 puncte pentru a efectua această operaţia! + + + + InterpolationDialog + + QtiPlot - Interpolation Options + QtiPlot - Opţiuni de interpolare + + + Make curve from + Date sursă + + + Spline + Metodă de interpolare + + + Linear + Liniară + + + Cubic + Cubică + + + Non-rounded Akima + Akima + + + Points + Puncte + + + From Xmin + De la Xmin + + + To Xmax + La Xmax + + + Color + Culoare + + + &Make + &Genereză curbă + + + &Close + În&chide + + + QtiPlot - Warning + QtiPlot - Avertisment + + + The curve <b> %1 </b> doesn't exist anymore! Operation aborted! + Curba <b> %1 </b> nu mai există! Operaţiunea a fost abandonată! + + + QtiPlot - Input error + QtiPlot - Eroare + + + Please enter x limits that satisfy: from < to! + Vă rugam să introduceţi limite care satisfac condiţia: Xmin < Xmax ! + + + + LayerButton + + Activate layer + Activează graficul + + + + LayerDialog + + QtiPlot - Arrange Layers + QtiPlot - Aranjare grafice + + + Layers + Graficele + + + Number + Număr + + + Automatic &layout + Aranjare au&tomată + + + Alignment + Aliniere + + + Horizontal + Orizontal + + + Center + Centrat + + + Left + Stânga + + + Right + Dreapta + + + Vertical + Vertical + + + Top + Sus + + + Bottom + Jos + + + Grid + Aranjare + + + Columns + Coloane + + + Rows + Linii + + + &Layer Canvas Size + Suprafaţa &graficului + + + Width + Lăţime + + + pixels + pixeli + + + Height + Înălţime + + + Unit + Unitate + + + inch + ţol + + + mm + mm + + + cm + cm + + + point + punct + + + pixel + pixel + + + &Keep aspect ratio + &Păstrează aspectul + + + Spacing + Margini + + + Columns gap + Distanţă între coloane + + + Rows gap + Distanţă între linii + + + Margins + Margini + + + Left margin + Marginea stangă + + + Right margin + Marginea dreaptă + + + Top margin + Marginea de sus + + + Bottom margin + Marginea de jos + + + &Apply + &Aplică + + + &OK + &OK + + + &Cancel + A&nulează + + + Swap Layers + Schimbă graficele + + + Source Layer + Grafic sursă + + + Destination Layer + Grafic de destinaţie + + + &Swap + &Schimbă + + + QtiPlot - Delete Layers? + QtiPlot - Şterge graficul? + + + You are about to delete %1 existing layers. + Sunteţi pe punctul de a şterge %1 grafic(e) existent(e). + + + Are you sure you want to continue this operation? + Sunteţi sigur că vreţi să continuaţi această operaţie? + + + &Continue + &Continuă + + + QtiPlot - Columns input error + QtiPlot - Eroare detectată în numărul de coloane introdus + + + The number of columns you've entered is greater than the number of graphs (%1)! + Numărul de coloane introdus este mai mare decat numărul de grafice (%1)! + + + QtiPlot - Rows input error + QtiPlot - Eroare detectată în numărul de linii introdus + + + The number of rows you've entered is greater than the number of graphs (%1)! + Numărul de linii introdus este mai mare decat numărul de grafice (%1)! + + + QtiPlot - Error + QtiPlot - Eroare + + + Please enter different indexes for the source and destination layers! + Vă rugăm să introduceţi indici diferiţi pentru graficele sursă şi destinaţie! + + + Link &X axes + &Conectează axele X + + + &Fixed size + Dimensiuni &fixe + + + Align + Aliniază + + + Canvases + Axele + + + Common a&xes + A&xe comune + + + Co&mmon axes + Axe co&mune + + + + LineDialog + + QtiPlot - Line options + QtiPlot - Opţiuni de linie + + + Color + Culoare + + + Type + Tip + + + Width + Grosime + + + Arrow at &start + &Săgeată la început + + + Arrow at &end + Săg&eată la sfarşit + + + &Line + &Linie + + + Length + Lungime + + + Angle + Unghi + + + &Filled + &Umplut + + + Arrow &Head + Ca&p săgeată + + + Set &Default + &Defineşte ca format implicit + + + &Apply + &Aplică + + + &Ok + &OK + + + Page + Pagină + + + Layer Scales + Axe de coordonate + + + Attach to + Ataşază la + + + Scale Coordinates + Coordonate + + + Pixels + Pixeli + + + Unit + Unitate + + + Start Point + Punct de început + + + X + X + + + Y + Y + + + End Point + Punct de sfarşit + + + &Geometry + &Geometrie + + + + LineProfileTool + + QtiPlot - Pixel selection warning + QtiPlot - Eroare de selecţie a a pixelilor + + + Please select an image marker first. + Vă rugam să selectaţi mai întâi o imagine. + + + Please select the end line point inside the image rectangle! + Vă rugăm să selectaţi capătul liniei în interiorul imaginii! + + + pixel + pixel + + + intensity + intensitate + + + x + x + + + y + y + + + Table + Tabel + + + pixels + pixeli + + + pixel intensity (a.u.) + intensitate pixeli (u.a.) + + + + LinearFit + + Linear Regression + Regresie liniară + + + Linear + Liniară + + + QtiPlot - Fit Error + QtiPlot - Eroare de ajustare + + + You need at least %1 data points for this fit operation. Operation aborted! + Aveţi nevoie de cel puţin %1 puncte pentru a efectua operaţia de ajustare. Operaţia fost abandonată! + + + + LinearSlopeFit + + Linear Regression + Regresie liniară + + + LinearSlope + PantăLiniară + + + QtiPlot - Fit Error + QtiPlot - Eroare de ajustare + + + You need at least %1 data points for this fit operation. Operation aborted! + Aveţi nevoie de cel puţin %1 puncte pentru a efectua operaţia de ajustare. Operaţia fost abandonată! + + + + LogisticFit + + Logistic + Logistic + + + init value + valoare iniţială + + + final value + valoare finală + + + center + centru + + + power + putere + + + Logistic Fit + Ajustare cu funcţia logistică + + + + LorentzFit + + Lorentz + Lorenz + + + Lorentz Fit + Ajustare Lorentz + + + area + aria + + + center + centru + + + width + lăţime + + + offset + constantă + + + + Matrix + + Set Dimensions + Setează dimensiunile + + + QtiPlot - Error + QtiPlot - Eroare + + + Calculation failed, the matrix is not square! + Calcul imposibil, matriceanu este pătrată! + + + QtiPlot + QtiPlot + + + Memory Allocation Error + Eroare de alocare a memoriei + + + Not enough memory, operation aborted! + Memorie insuficientă, operaţia a fost abandonată! + + + Inversion failed, the matrix is not square! + Inversare imposibilă, matricea nu este pătrată! + + + Invert + Inversează + + + Transpose + Transpune + + + Flip Vertically + Răstoarnă vertical + + + Flip Horizontally + Răstoarnă orizontal + + + Rotate 90° + Rotire cu 90° + + + Rotate -90° + Rotire cu -90° + + + Calculate Values + Calculează valorile + + + Clear Selection + Şterge selecţie + + + Paste + Lipeşte + + + Delete Rows + Şterge linii + + + Delete Columns + Şterge coloane + + + Insert Row + Inserează linie + + + Insert Column + Inserează coloană + + + Please provide a valid file name! + Vă rugăm introduceţi un nume valid! + + + File format not handled, operation aborted! + Format de fişier necunoscut, operaţiunea a fost abandonată! + + + Set Data Mode + Setează mod date + + + Ctrl+A + Matrix: select all + Ctrl+A + + + Import Image + Import imagine + + + Inverse FFT + FFT Inversă + + + Forward FFT + FFT Directă + + + QtiPlot - ASCII Export Error + QtiPlot - Eroare de export ASCII + + + Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! + Nu a fost posibilă scrierea în fişierul: <br><h4> %1 </h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie! + + + Import ASCII File + Importă fişier ASCII + + + Due to memory limitations it will not be possible to undo this change. Do you want to continue anyways? + Din cauza memoriei insuficiente nu va fi posibil să anulaţi această modificare. Doriţi totuşi să continuaţi? + + + Warning + Avertisment + + + kB + kB + + + + MatrixDialog + + QtiPlot - Matrix Properties + QtiPlot - Proprietătile matricii + + + Cell Width + Lăţime celulă + + + Data Format + Format date + + + Decimal: 1000 + Zecimal: 100.0 + + + Scientific: 1E3 + Ştiinţific: 1E3 + + + Numeric Display + Afişaj numeric + + + Default Decimal Digits + Setări implicite + + + Significant Digits= + Cifre semnificative + + + &Apply + &Aplică + + + &OK + &OK + + + &Cancel + A&nulează + + + Set Columns Width + Defineşte lăţimea coloanelor + + + Decimal + Zecimal + + + Scientific + Ştiinţific + + + Set Data Format %1 + Defineşte formatul de date %1 + + + Precision %1 digits + %1 Cifre semnificative + + + + MatrixModel + + Edited cell + Celulă editată + + + QtiPlot + QtiPlot + + + Input Size Error + Eroare în dimensiunile introduse + + + The dimensions you have specified are not acceptable! + Dimensiunile specificate nu pot fi acceptate! + + + Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! + Va rugăm să introduceţi valori pozitive pentru care produsul linii*coloane nu depaşeşte valoare maximă permisă de sistemul dumneavoastră de operare pentru un număr întreg ! + + + Memory Allocation Error + Eroare de alocare a memoriei + + + Not enough memory, operation aborted! + Memorie insuficientă, operaţia a fost abandonată! + + + Multiline expressions take much more time to evaluate! Do you want to continue anyways? + Evaluarea expresiilor conţinand mai multe linii durează mult mai mult timp! Doriţi să continuaţi? + + + Warning + Avertisment + + + + MatrixSizeDialog + + QtiPlot - Matrix Dimensions + QtiPlot - Dimensiunile matricii + + + Dimensions + Dimensiuni + + + Rows + Linii + + + Columns + Coloane + + + Coordinates + Coordonate + + + X (Columns) + X (Coloane) + + + Y (Rows) + Y (Linii) + + + First + Început + + + Last + Sfarşit + + + &Apply + &Aplică + + + &OK + &OK + + + &Cancel + A&nulează + + + Set Coordinates x[%1 : %2], y[%3 : %4] + Definire coordonate x[%1 : %2], y[%3 : %4] + + + + MatrixValuesDialog + + QtiPlot - Set Matrix Values + QtiPlot - Calculează valorile matricii + + + For row (i) + De la linia (i) + + + to + la + + + For col (j) + De la coloana (j) + + + Add &Function + Adaugă &funcţie + + + Add Ce&ll + Adaugă celu&lă + + + &Apply + &Aplică + + + &Close + În&chide + + + Use built-in muParser (much faster) + Foloseşte muParser (mult mai rapid) + + + Cell(i,j)= + Celula(i,j)= + + + Set New Formula + Defineşte noua formulă + + + + MdiSubWindow + + QtiPlot + QtiPlot + + + Do you want to hide or delete + Doriţi să ştergeţi sau să ascundeţi + + + Delete + Şterge + + + Hide + Ascunde + + + Cancel + Anulează + + + Normal + Normal + + + Minimized + Minimizat + + + Maximized + Maximizat + + + Hidden + Ascuns + + + B + biţi + + + + MultiLayer + + Add layer + Adaugă grafic + + + Remove active layer + Şterge graficul curent + + + QtiPlot - Guess best layout? + QtiPlot - Aranjare automată a graficelor? + + + Do you want QtiPlot to rearrange the remaining layers? + Doriţi să rearanjaţi graficele rămase? + + + &Yes + &Da + + + &No + &Nu + + + &Cancel + &Anulează + + + QtiPlot - Error + QtiPlot - Eroare + + + Please provide a valid file name! + Vă rugăm introduceţi un nume valid! + + + File format not handled, operation aborted! + Format de fişier necunoscut, operaţiunea a fost abandonată! + + + kB + kilobiţi + + + Offset Amount... + Distanţe... + + + Reverse Order + Inversează ordinea + + + Fill Area... + Umplere curbe... + + + Offset Dialog + Dialog distanţe + + + Total Y Offset (%) + Distanţă Y (% din înlţime) + + + Total X Offset (%) + Distanţă X (% din lăţime) + + + &Apply + &Aplică + + + &Close + În&chide + + + Fill Curves + Umplere curbe + + + Enable Fill + Autorizează umplerea + + + Fill with Color + Culoare de umplere + + + Side Lines + Linii laterale + + + + MultiPeakFit + + Gauss + Gauss + + + Lorentz + Lorenz + + + Gauss Fit + Ajustare gaussiană + + + Lorentz Fit + Ajustare Lorentz + + + multi-peak + extreme + + + area + aria + + + center + centru + + + width + lăţime + + + offset + constantă + + + Peak + Extrem + + + Fit + Ajustare + + + QtiPlot - Fit Error + QtiPlot - Eroare de ajustare + + + Could not allocate enough memory for the fit curves! + Memorie insuficientă pentru curbele de ajustare! + + + fit of + ajustare a + + + peak + extrem + + + Area + Aria + + + Center + Centrat + + + Width + Lăţime + + + Height + Înălţime + + + + MultiPeakFitTool + + Move cursor and click to select a point and double-click/press 'Enter' to set the position of a peak! + Mişcaţi cursorul şi efectuaţi un click pentru a alege un punct şi efectuaţi un click dublu sau apăsaţi tasta 'Enter' pentru a defini poziţia extremului! + + + Peak %1 selected! Click to select a point and double-click/press 'Enter' to set the position of the next peak! + Extremul cu numarul %1 a fost selecţionat! Efectuaţi un click pentru a alege un punct şi efectuaţi un click dublu sau apăsaţi tasta 'Enter' pentru a defini poziţia extremului următor! + + + + NonLinearFit + + NonLinear + Neliniar + + + Non-linear Fit + Ajustare neliniară + + + QtiPlot - Input function error + QtiPlot - Eroare detectată în funcţia introdusă + + + Please enter a valid non-empty expression! Operation aborted! + Vă rugăm să introduceţi o expresie validă! Operaţie abandonată! + + + QtiPlot - Fit Error + QtiPlot - Eroare de ajustare + + + There are no parameters specified for this fit operation. Please define a list of parameters first! + Nu aţi definit parametrii pentru această operaţie de ajustare. Vă rugăm să definiţi mai întâi o listă de parametri! + + + You must provide a list containing at least one parameter for this type of fit. Operation aborted! + Trebuie să introduceţi o listă conţinand cel puţin un parametru pentru a efectua acest tip de ajustare. Operaţia fost abandonată! + + + constant + constant(ă) + + + Ignore + Ignoră + + + + Note + + Add tab + Adaugă filă + + + Please, enter new title: + Vă rugăm să introduceţi un nou titlu: + + + Title + Titlu + + + untitled + neintitulat + + + + OpenProjectDialog + + QtiPlot - Open Project + QtiPlot - Deschide proiect + + + QtiPlot project + Proiect QtiPlot + + + Compressed QtiPlot project + Proiect QtiPlot arhivat + + + Origin project + Proiect Origin + + + Origin matrix + Matrice Origin + + + Origin worksheet + Tabel Origin + + + Origin graph + Grafic Origin + + + Backup files + Copii de siguranţă + + + Excel + Excel + + + ODF Spreadsheet + Foi de calcul ODF + + + All files + Toate fişierele + + + Open As + Deschide ca + + + New Project Window + Fereastră nouă + + + New Folder + Dosar nou + + + + PatternBox + + Solid + Solid + + + Horizontal + Linii orizontale + + + Vertical + Linii verticale + + + Cross + Cruce + + + BDiagonal + Linii înclinate înainte + + + FDiagonal + Linii înclinate înapoi + + + DiagCross + Linii înclinate incrucişate + + + Dense1 + Dens1 + + + Dense2 + Dens2 + + + Dense3 + Dens3 + + + Dense4 + Dens4 + + + Dense5 + Dens5 + + + Dense6 + Dens6 + + + Dense7 + Dens7 + + + None + Fără model + + + + Plot3DDialog + + QtiPlot - Surface Plot Options + QtiPlot - Opţiunile graficului 3D + + + &Apply + &Aplică + + + &OK + &OK + + + &Cancel + A&nulează + + + Scale to paper si&ze + Ajustează graficul la dimensiunile &hârtiei + + + Print Crop&marks + Imprimă &liniile ajutătoare pentru decupaj + + + &Print + Im&primă + + + X + X + + + Y + Y + + + Z + Z + + + From + De la + + + To + Pană la + + + Type + Tip + + + linear + liniară + + + logarithmic + logaritmică + + + Major Ticks + Diviziuni principale + + + Minor Ticks + Diviziuni secundare + + + &Scale + &Scală + + + Title + Titlu + + + Axis Font + Font + + + &Choose font + Alegeţi &font + + + Major Ticks Length + Lungimea diviziunilor principale + + + Minor Ticks Length + Lungimea diviziunilor secundare + + + &Axis + &Axe + + + Co&lor + Cu&loare + + + &Font + &Font + + + &Title + &Titlu + + + Linea&r color map + &Paletă de culori liniară + + + Color map &file + &Fişier paletă de culori + + + None + Nici una + + + Opacity + Opacitate + + + &Line + &Linie + + + &Background + &Fundal + + + General + General + + + A&xes + A&xe + + + Lab&els + &Etichete + + + &Numbers + Nume&re + + + &Grid + Grila&j + + + Coordinate System + Sistem de coordonate + + + &Colors + &Culori + + + Show Legend + Afişază legenda + + + Orthogonal + Ortogonal + + + Line Width + Grosimea liniei + + + Resolution + Rezoluţie + + + Numbers Font + Font numere + + + &Choose Font + Alegeţi &font + + + Distance labels - axis + Distanţa axă - titlu + + + Zoom (%) + Mărire (%) + + + X Zoom (%) + Mărire axă X (%) + + + Y Zoom (%) + Mărire axă Y (%) + + + Z Zoom (%) + Mărire axă Z (%) + + + &General + &General + + + Ma&jor Grids + Grila&j principal + + + Mi&nor Grids + Grilaj secu&ndar + + + Color + Culoare + + + Style + Stil + + + Solid + Solid + + + Dash + Linie + + + Dot + Punct + + + Dash Dot + Linie Punct + + + Dash Dot Dot + Linie Punct Punct + + + Short Dash + Linie Scurtă + + + Short Dot + Linie Scurtă + + + Short Dash Dot + Linie Punct Scurte + + + G&rid + &Grilaj + + + Cross Hair + Cruce + + + Cone + Con + + + Width + Lăţime + + + Smooth angles + Unghiuri nete + + + Radius + Rază + + + Smooth line + Linie netă + + + Boxed + Desenează celulă 3D + + + Quality + Calitate + + + Points + Puncte + + + &Worksheet + &Tabel + + + &Matrix + &Matrice + + + Draw lines + Desenează linii + + + Filled bars + Bare umplute + + + Bars + Bare + + + Tick Labels + Etichetele diviziunilor + + + Format + Format + + + Automatic + Automat + + + Decimal: 10000.0 + Zecimal: 10000.0 + + + Scientific: 1e4 + Ştiinţific: 1e4 + + + Engineering: 10k + Ingineresc: 10k + + + Precision + Precizie + + + + PlotDialog + + QtiPlot - Plot details + QtiPlot - Detalii grafic + + + Plot type + Tip de grafic + + + &Worksheet + &Tabel + + + &OK + &OK + + + &Cancel + A&nulează + + + &Apply + &Aplică + + + &Plot Associations... + &Asocieri de date... + + + Titles + Titluri + + + Axes Labels + Titluri axe + + + Axes Numbers + + + + Legends + Legende + + + Fonts + Fonturi + + + Background Color + Culoare de fundal + + + Opacity + Opacitate + + + Transparent + Transparent + + + Canvas Color + Culoarea suprafeţei + + + Border Color + Culoare de bordură + + + Width + Lăţime + + + Antialiasing + Linii nete + + + Margin + Margine + + + Set As &Default + &Defineşte ca format implicit + + + Apply &to... + Aplică forma&tul... + + + Layer + Grafic + + + Window + Fereastră + + + All Windows + Tuturor ferestrelor + + + inch + ţol + + + mm + mm + + + cm + cm + + + point + punct + + + pixel + pixel + + + Unit + Unitate + + + Origin + Origine + + + X= + X= + + + Y= + Y= + + + Size + Dimensiuni + + + width= + lăţime= + + + height= + înălţime= + + + Keep aspect ratio + Păstrează aspectul + + + Geometry + Geometrie + + + &Speed Mode, Skip Points if needed + Mod &rapid, ignoră puncte dacă e nevoie + + + data points + puncte + + + Apply to curves with more than: + Aplică curbelor cu mai mult de: + + + Tolerance (Douglas Peuker algorithm) + Toleranţa pentru algoritmul Douglas Peuker + + + Speed + Viteză + + + Color + Culoare + + + Style + Stil + + + Border + Bordură + + + First color + Prima culoare + + + Pattern + Model + + + Fill + Umple + + + 3D View + Vedere 3D + + + View Angle (deg) + Unghi de vedere (grade) + + + Thickness (% of radius) + Grosime (% din rază) + + + Rotation + Rotaţie + + + Starting Azimuth (deg) + Azimut (grade) + + + Counter cloc&kwise + Sens anti-ora&r + + + Radius/Center + Rază/Centru + + + Radius (% of frame) + Rază (% din bordură) + + + Horizontal Offset (% of frame) + Distanţă orizontală (% din bordură) + + + Pie Geometry + Geometrie + + + Automatic &Format + &Format automat + + + &Values + &Valori + + + &Percentages + &Procente + + + Categories/&Rows + Categorii/&Linii + + + Associate Position with &Wedge + Asocia&ză poziţia cu marginea + + + Dist. from Pie Edge + Distanţa pană la marginea plăcintei + + + Labels + Etichete + + + &Scale layers to paper size + Aju&stează graficele la dimensiunile hârtiei + + + Print Crop&marks + Imprimă &liniile ajutătoare pentru decupaj + + + Print + Imprimare + + + &Show + Afişa&ză + + + Column + Coloană + + + White O&ut + F&undal alb + + + Justify + Aliniere + + + Center + Centrat + + + Left + Stânga + + + Right + Dreapta + + + &Font + &Font + + + Rotate (deg) + Roteşte (grade) + + + X Offset (font height %) + Distanţa X (% din înălţime font) + + + Y Offset (font height %) + Distanţa Y (% din înălţime font) + + + Attach curve to: + Ataşază curba axelor: + + + x Axis + Axa X + + + Bottom + Jos + + + Top + Sus + + + y Axis + Axa Y + + + Axes + Axe + + + Connect + Conectare + + + No line + Fără linie + + + Lines + Linii + + + Sticks + Beţe + + + Horizontal Steps + Trepte orizontale + + + Dots + Puncte + + + Spline + Metodă de interpolare + + + Vertical Steps + Trepte verticale + + + Apply Format &to + Aplică forma&tul + + + Selected Curve + Curba curentă + + + Fill area under curve + Umple suprafaţa de sub curbă + + + Fill color + Culoare de umplere + + + Line + Linie + + + Fill Color + Culoare de umplere + + + Edge Color + + + + Edge Width + Grosimea marginii + + + Skip Points + Sări puncte + + + None + Niciunul + + + Symbol + Simbol + + + Box + Cutie + + + Type + Tip + + + No Box + Fără cutie + + + Rectangle + Dreptunghi + + + Diamond + Diamant + + + Perc 10, 25, 75, 90 + Procente 10, 25, 75, 90 + + + Notch + Crestătură + + + Range + Interval + + + Standard Deviation + Deviaţia standard + + + Standard Error + Eroare standard + + + Perc 25, 75 + Procente 25, 75 + + + Perc 10, 90 + Procente 10, 90 + + + Perc 5, 95 + Procente 5, 95 + + + Perc 1, 99 + Procente 1, 99 + + + Max-Min + Max-Min + + + Constant + Constant + + + Percentile (%) + Percentile (%) + + + Coefficient + Coeficient + + + Box Width + Lăţime cutie + + + Whiskers + Mustăţi + + + No Whiskers + Fără mustăţi + + + 75-25 + 75-25 + + + 90-10 + 90-10 + + + 95-5 + 95-5 + + + 99-1 + 99-1 + + + Coef + Coeficient + + + Box/Whiskers + Cutie/Mustăţi + + + Max + Maxim + + + 99% + 99% + + + Mean + Medie + + + 1% + 1% + + + Min + Minim + + + Percentile + Percentile + + + Image + Imagine + + + &Gray Scale + Scară de &griuri + + + &Default Color Map + &Paletă de culori liniară + + + &Custom Color Map + Paletă &personalizată + + + Contour Lines + Linii de contour + + + Levels + Nivele + + + Use &Color Map + Foloseşte paleta de &culori + + + Use Default &Pen + Foloseşte stilul im&plicit + + + Color Bar Scale + Scară de culoare + + + Axis + Axă + + + Contour + Contur + + + Direction + Direcţie + + + Plus + Plus + + + Minus + Minus + + + &X Error Bar + Bare de eroare în &X + + + Line Width + Grosimea liniei + + + Cap Width + Lungime linie + + + 8 + 8 + + + 10 + 10 + + + 12 + 12 + + + 16 + 16 + + + 20 + 20 + + + Through Symbol + Prin simbol + + + Error Bars + Bare de eroare + + + Automatic Binning + Eşantionaj automat + + + &Show statistics + Afişază &statistici + + + Bin Size + Pas de eşantionaj + + + Begin + Început + + + End + Sfârşit + + + Histogram Data + Date histogramă + + + Gap Between Bars (in %) + Spaţiu între bare (în %) + + + Offset (in %) + Distanţă (in %) + + + Spacing + Margini + + + Arrowheads + Capete săgeţi + + + Length + Lungime + + + Angle + Unghi + + + &Filled + &Umplut + + + End Point + Punct de sfarşit + + + X End + X Sfârşit + + + Y End + Y Sfârşit + + + Position + Poziţie + + + Tail + Coadă + + + Middle + Mijloc + + + Head + Capăt + + + Vector + Vector + + + Bins + Eşantioane + + + Histogram and Probabilities for + Histogramă şi probabilitaţi pentru + + + Quantity + Cantitate + + + Sum + Sumă + + + Percent + Procent + + + Minimum + Minim + + + Maximum + Maxim + + + &Delete + Şte&rge + + + &Edit... + &Editare... + + + Colors + Culori + + + &Function + &Funcţie + + + Pie + Placintă + + + Vertical Bars + Bare verticale + + + Horizontal Bars + Bare orizontale + + + Histogram + Histogramă + + + Vector XYXY + Vectori XYXY + + + Vector XYAM + Vectori XYAM + + + Scatter + Simbol + + + Line + Symbol + Linie + Simbol + + + QtiPlot - Input error + QtiPlot - Eroare + + + Please enter a valid start limit! + Vă rugăm introduceţi o limita de început validă! + + + Please enter a valid end limit! + Vă rugăm introduceţi o limita de sfarşit validă! + + + Please enter a valid bin size value! + Vă rugăm introduceţi un pas de eşantionajului valid! + + + QtiPlot - Start limit error + QtiPlot - Eroare detectată la valoarea de start + + + QtiPlot - End limit error + QtiPlot - Eroare detectată la valoarea de sfarşit + + + Please enter limits that satisfy: begin < end! + Vă rugam să introduceţi limite care satisfac condiţia: început < sfarşit ! + + + QtiPlot - Bin size input error + QtiPlot - Eroare detectată în pasul de eşantionaj + + + Please enter a positive bin size value! + Vă rugăm introduceţi un pas de eşantionajului pozitiv! + + + Vector Data + Date vector + + + Magnitude + Magnitudine + + + Show Equidistant Levels + Afişază nivelele echidistante + + + First Level + Primul nivel + + + Distance between Levels + Distanţa între nivele + + + Pen + Creion + + + Matrix + Matrice + + + Use matrix formula to calculate values + Utilizează formula matricei pentru calculul valorilor + + + Values + Valori + + + &Show Contour Lines + Afişa&ză linii de contour + + + Set Equidistant Levels + Afişază nivelele echidistante + + + Start + Start + + + Step + Pas + + + Set &Levels + Defineşte nive&lele + + + Use &Table Custom Pen + Foloseşte &valorile din tabel + + + Link &X axes + Conectează axele &X + + + Miscellaneous + Diverse + + + 0 (all data points) + 0 (afişază toate datele) + + + Tolerance (Douglas-Peucker algorithm) + Toleranţa pentru algoritmul Douglas-Peucker + + + Scale &Fonts + Redimensionare &fonturi + + + Do not &resize layers when window size changes + Nu &redimensiona graficele când dimeniunea ferestrei se schimbă + + + Dimensions + Dimensiuni + + + + PlotWizard + + QtiPlot - Select Columns to Plot + QtiPlot - Selecţionaţi coloanele pe care vreţi să le afişaţi + + + &X + &X + + + x&Err + x&Err + + + &Y + &Y + + + yE&rr + yE&rr + + + &Z + &Z + + + &New curve + Curbă &nouă + + + &Delete curve + Şterge cur&ba + + + Worksheet + Tabel + + + &Plot + &Trasează + + + &Close + În&chide + + + QtiPlot - Error + QtiPlot - Eroare + + + Please define a Y column for the following curve + Vă rugăm să definiţi mai întâi o coloană de tip Y pentru curba + + + You have already defined a X column! + Aţi definit deja o coloană X! + + + You must define a X column first! + Vă rugam să definiţi mai întâi o coloana de tip X! + + + You have already defined a Y column! + Aţi definit deja o coloană Y! + + + This kind of curve is not handled by QtiPlot! + Acest tip de curbă nu este înţeles de QtiPlot! + + + You have already defined a Z column! + Aţi definit deja o coloană Z! + + + You must define a Y column first! + Vă rugam să definiţi mai întâi o coloana de tip Y! + + + You have already defined an error-bars column! + Aţi definit deja o coloană cu barele de eroare! + + + You must add a new curve first! + Vă rugam să adăugaţi mai întâi o curbă! + + + + PluginFit + + Plugin Fit + Ajustare folosind o extensie + + + QtiPlot - File not found + QtiPlot - Fişierul nu a fost găsit + + + Plugin file: <p><b> %1 </b> <p>not found. Operation aborted! + Fişierul extensie<p><b> %1 </b> <p>nu a fost găsit! Operaţiunea a fost abandonată! + + + QtiPlot - Plugin Error + QtiPlot - Eroare extensie + + + The plugin does not implement a %1 method necessary for simplex fitting. + Extensia nu implementează metoda %1 necesară pentru ajustările de tip simplex. + + + The plugin does not implement a %1 method necessary for Levenberg-Marquardt fitting. + Extensia nu implementează metoda %1 necesară pentru ajustările de tip Levenberg-Marquardt. + + + + PolynomFitDialog + + QtiPlot - Polynomial Fit Options + QtiPlot - Opţiuni de ajustare polinomială + + + Polynomial Fit of + Ajustare polinomială a curbei + + + Order (1 - 9, 1 = linear) + Ordin (1 - 5, 1 = ajustare liniară) + + + Fit curve # pts + Puncte de ajustare + + + Not enough points + Nu există îndeajuns de multe puncte + + + Fit curve Xmin + Începutul curbei (Xmin) + + + Fit curve Xmax + Sfarşitul curbei (Xmax) + + + Color + Culoare + + + Show Formula on Graph? + Afişaţi formula în grafic? + + + &Fit + &Ajustează + + + &Close + În&chide + + + QtiPlot - Warning + QtiPlot - Avertisment + + + The curve <b> %1 </b> doesn't exist anymore! Operation aborted! + Curba <b> %1 </b> nu mai există! Operaţiunea a fost abandonată! + + + + PolynomialFit + + Polynomial + Polinomial + + + Polynomial Fit + Ajustare polinomială + + + QtiPlot - Fit Error + QtiPlot - Eroare de ajustare + + + You need at least %1 data points for this fit operation. Operation aborted! + Aveţi nevoie de cel puţin %1 puncte pentru a efectua operaţia de ajustare. Operaţia fost abandonată! + + + + PreviewTable + + Numeric + Numeric + + + Text + Text + + + Date + Dată + + + Time + Timp + + + Month + Lună + + + Day + Zi + + + Choose column type + Alege tipul coloanei + + + Column type: + Tipul coloanei: + + + + PythonScripting + + Failed to export QtiPlot API + Eroare de export a interfeţei de programare QtiPlot + + + Couldn't find initialization files + Nu au fost găsite fișierele de inițializare + + + Please indicate the correct path to the Python configuration files in the preferences dialog. + Vă rugăm să specificaţi locaţia corectă pentru fisierele de configurare cu ajutorul dialoguluil pentru preferințe. + + + Accessing QtiPlot functions or objects from Python code won't work.Probably your version of SIP differs from the one QtiPlot was compiled against. + Accesarea funcţiilor sau a obiectelor din QtiPlot folosind cod Python nu este posibilă. Probabil folosiţi o versiune SIP diferită de cea folosită pentru a compila QtiPlot. + + + Accessing QtiPlot functions or objects from Python code won't work. Probably your version of Qt/SIP/PyQt differs from the one QtiPlot was compiled against. + Accesarea funcţiilor sau a obiectelor din QtiPlot folosind cod Python nu este posibilă. Probabil folosiţi o versiune Qt/SIP/PyQt diferită de cea folosită pentru a compila QtiPlot. + + + + QObject + + The file is not an QtiPlot fit model file. + Fişierul nu este un fişier model de ajustare creat de QtiPlot. + + + The file is not an QtiPlot fit model version 1.0 file. + Fişierul nu este un fişier model de ajustare cu versiunea 1.0 creat de QtiPlot. + + + The file is not a QtiPlot custom action file. + Fişierul nu este un fişier conţinand o acţiune personalizată creat de QtiPlot. + + + The file is not an QtiPlot custom action version 1.0 file. + Fişierul nu este un fişier conţinand o acţiune personalizată cu versiunea 1.0 creat de QtiPlot. + + + The file is not a QtiPlot custom menu file. + Fişierul nu este un fişier conţinand un meniu personalizat creat de QtiPlot. + + + The file is not a QtiPlot custom menu version 1.0 file. + Fişierul nu este un fişier de tip meniu personalizat cu versiunea 1.0 creat de QtiPlot. + + + QtiPlot - Script Error + QtiPlot - Eroare de programare + + + Python-like syntax is not supported in this case since it severely reduces drawing speed! + Sintaxa Python nu este acceptată deoarece reduce drastic viteza de afişaj! + + + abs(x): + Absolute value of x. + abs(x): + Modulul lui x. + + + acos(x): + Inverse cos function. + acos(x): + Funcţia cosinus inversă. + + + acosh(x): + Hyperbolic inverse cos function. + acosh(x): + Funcţia cosinus hiperbolică inversă. + + + asin(x): + Inverse sin function. + asin(x): + Funcţia sinus inversă. + + + asinh(x): + Hyperbolic inverse sin function. + asinh(x): + Funcţia sinus hiperbolică inversă. + + + atan(x): + Inverse tan function. + atan(x): + Funcţia tangentă inversă. + + + atanh(x): + Hyperbolic inverse tan function. + atanh(x): + Funcţia tangentă hiperbolică inversă. + + + avg(x,y,...): + Mean value of all arguments. + avg(x,y,...): + Valoarea medie a tuturor argumentelor. + + + cos(x): + Calculate cosine. + cos(x): + Calculează cosinus. + + + if(e1, e2, e3): + if e1 then e2 else e3. + if(e1, e2, e3): + dacă e1 atunci e2 altfel e3. + + + ln(x): + Calculate natural logarithm log_e. + ln(x): + Calculează logaritmul natural log_e. + + + log(x): + Calculate decimal logarithm log_10. + log(x): + Calculează logaritmul zecimal log_10. + + + log10(x): + Calculate decimal logarithm log_10. + log10(x): + Calculează logaritmul zecimal log_10. + + + log2(x): + Calculate binary logarithm log_2. + log2(x): + Calculează logaritmul binar log_2. + + + cosh(x): + Hyperbolic cos function. + cosh(x): + Funcţia cosinus hiperbolică. + + + bessel_j0(x): + Regular cylindrical Bessel function of zeroth order, J_0(x). + + + + bessel_j1(x): + Regular cylindrical Bessel function of first order, J_1(x). + + + + bessel_jn(double x, int n): + Regular cylindrical Bessel function of order n, J_n(x). + + + + bessel_jn_zero(double n, unsigned int s): + s-th positive zero x_s of regular cylindrical Bessel function of order n, J_n(x_s)=0 + + + + bessel_y0(x): + Irregular cylindrical Bessel function of zeroth order, Y_0(x), for x>0. + + + + bessel_y1(x): + Irregular cylindrical Bessel function of first order, Y_1(x), for x>0. + + + + bessel_yn(double x, int n): + Irregular cylindrical Bessel function of order n, Y_n(x), for x>0. + + + + beta(a,b): + Computes the Beta Function, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) for a > 0, b > 0. + beta(a,b): + Calculează funcţia Beta, B(a, b) = Gamma(a)*Gamma(b)/Gamma(a+b) pentru a > 0, b > 0. + + + ceil(x): + Round to the next larger integer, + smallest integer larger or equal to x. + ceil(x): + Rotunjeşte la cel mai mic întreg mai mare sau egal cu x. + + + erf(x): + The error function. + erf(x): Funcţia eroare. + + + erfc(x): + Complementary error function erfc(x) = 1 - erf(x). + erfc(x): + Funcţia eroare complementară erfc(x) = 1 - erf(x). + + + erfz(x): + The Gaussian probability density function Z(x). + + + + erfq(x): + The upper tail of the Gaussian probability function Q(x). + + + + exp(x): + Exponential function: e raised to the power of x. + exp(x): + Funcţia exponentială: e la puterea x. + + + floor(x): + Round to the next smaller integer, + largest integer smaller or equal to x. + floor(x): + Rotunjeşte la cel mai mare întreg mai mic sau egal cu x. + + + gamma(x): + Computes the Gamma function, subject to x not being a negative integer. + + + + gammaln(x): + Computes the logarithm of the Gamma function, subject to x not a being negative integer. For x<0, log(|Gamma(x)|) is returned. + + + + gauss_cdf(x, sigma): + Computes the cumulative distribution function for a Gaussian distribution with standard deviation sigma. + + + + gauss_pdf(x, sigma): + Computes the probability density at x for a Gaussian distribution with standard deviation sigma. + + + + hazard(x): + Computes the hazard function for the normal distribution h(x) = erfz(x)/erfq(x). + + + + inv_gauss_cdf(x, sigma): + Computes the inverse of the cumulative distribution function for a Gaussian distribution with standard deviation sigma. + + + + min(x,y,...): + Calculate minimum of all arguments. + min(x,y,...): + Calculează minimul dintre toate argumentele. + + + max(x,y,...): + Calculate maximum of all arguments. + max(x,y,...): + Calculează maximul dintre toate argumentele. + + + mod(x,y): + Calculate rest of integer division x/y, + x modulo y. + mod(x,y): + Calculează restul împarţirii lui x la y, + x modulo y. + + + pow(x,y): + Raise x to the power of y, x^y. + pow(x,y): + Ridică pe x la puterea y, x^y. + + + rint(x): + Round to nearest integer. + rint(x): + Rotunjeşte la cel mai apropiat întreg. + + + sign(x): + Sign function: -1 if x<0; 1 if x>0. + sign(x): + Funcţia semn: -1 dacă x<0; 1 dacă x>0. + + + sin(x): + Calculate sine. + cos(x): + Calculează sinus. + + + sinh(x): + Hyperbolic sin function. + sinh(x): + Funcţia sinus hiperbolică. + + + sqrt(x): + Square root function. + sqrt(x): + Rădăcină pătrată. + + + sum(x,y,...): + Calculate sum of all arguments. + sum(x,y,...): + Calculează suma tuturor argumentelor. + + + tan(x): + Calculate tangent function. + tan(x): + Funcţia tangentă. + + + tanh(x): + Hyperbolic tan function. + tanh(x): + Funcţia tangentă hiperbolică. + + + ttable(x, n): + Student's t-distribution with n degrees of freedom. + + + + w0(x): + Compute the principal branch of Lambert's W function, W_0(x). + W is defined as a solution to the equation W(x)*exp(W(x))=x. + For x<0, there are two real-valued branches; this function computes the one where W>-1 for x<0 (also see wm1(x)). + + + + wm1(x): + Compute the secondary branch of Lambert's W function, W_{-1}(x). + W is defined as a solution to the equation W(x)*exp(W(x))=x. + For x<0, there are two real-valued branches; this function computes the one where W<-1 for x<0. (also see w0(x)). + + + + AVG("colName", i, j): + The average of all cells from row i to j in column colName. + AVG("colName"): + Media celulelor de la linia i la linia j din coloana colName. + + + SUM("colName", i, j): + The sum of all cells from row i to j in column colName. + SUM("colName"): + Suma celulelor de la linia i la linia j din coloana colName. + + + AVG("colName"): + The average of all cells in column colName. + AVG("colName"): + Media tuturor celulelor din coloana colName. + + + SUM("colName"): + The sum of all cells in column colName. + SUM("colName"): + Suma tuturor celulelor din coloana colName. + + + QtiPlot - Math Error + QtiPlot - Eroare + + + Found non-removable singularity at x = %1. Operation aborted! + O singularitate a fost detectată pentru x = %1. Operaţiune abandonată! + + + QtiPlot + QtiPlot + + + Ignored data point at x = %1. + Punctul x = %1 a fost ignorat. + + + Found non-removable singularity at x = %1. + O singularitate a fost detectată pentru x = %1. + + + QtiPlot - Memory Allocation Error + QtiPlot - Eroare de alocare a memoriei + + + Not enough memory, operation aborted! + Memorie insuficientă, operaţia a fost abandonată! + + + The function %1 is not defined in the specified interval! + Funcţia %1 nu este definită în intervalul specificat! + + + rnd(seed): + Returns a pseudo-random number in the range 0 to 1. Calling this function several times with the same seed will return the same value. + + + + + QtColorPicker + + Black + Negru + + + White + Alb + + + Red + Roşu + + + Dark red + Roşu închis + + + Green + Verde + + + Dark green + Verde închis + + + Blue + Albastru + + + Dark blue + Albastru închis + + + Cyan + Turcoaz + + + Dark cyan + Turcoaz închis + + + Magenta + Magenta + + + Dark magenta + Magenta închis + + + Yellow + Galben + + + Dark yellow + Galben închis + + + Gray + Gri + + + Dark gray + Gri închis + + + Light gray + Gri deschis + + + Custom + Personalizată + + + + RangeSelectorTool + + QtiPlot - Warning + QtiPlot - Avertisment + + + All the curves on this plot are empty! + Toate curbele din acest grafic sunt vide! + + + Click or use Ctrl+arrow key to select range (arrows select active cursor)! + Daţi click sau apăsaţi tastele Ctrl+săgeţi pentru a selecta intervalul (săgeţile slectează curba activă)! + + + Right + Dreapta + + + Left + Stânga + + + The column '%1' is read-only! Operation aborted! + Coloana '%1' nu poate fi modificată! Operaţiune abandonată! + + + Remove data from curves? + Vreţi să ştergeţi datele? + + + Copy data to clipboard? + Copiază datele? + + + + RenameWindowDialog + + QtiPlot - Rename Window + QtiPlot - Redenumire fereastră + + + Window Title + Titlu + + + &Name (single word) + &Nume (un singur cuvânt) + + + &Label + &Etichetă + + + &Both Name and Label + Ş&i nume şi etichetă + + + &OK + &OK + + + &Cancel + &Anulează + + + QtiPlot - Warning + QtiPlot - Avertisment + + + For internal consistency reasons the underscore character is replaced with a minus sign. + Avertisment: din motive legate de reprezentarea internă folosită de QtiPlot, caracterul "_" va fi înlocuit cu semnul minus '-'. + + + + ScreenPickerTool + + Click on plot or move cursor to display coordinates! + Daţi click pe grafic sau mişcaţi cursorul pentru a afişa coordonatele! + + + + ScriptEdit + + E&xecute + E&xecută + + + Ctrl+J + Ctrl+J + + + Execute &All + Execută &tot + + + Ctrl+Shift+J + Ctrl+Shift+J + + + &Evaluate Expression + &Evaluează expresia + + + Ctrl+Return + Ctrl+Return + + + &Print + Im&primă + + + &Import... + &Importă... + + + &Save + &Salvează + + + Sa&ve as... + Salvează c&a... + + + &Find... + &Caută... + + + &Replace... + În&locuieşte... + + + &Find next + Caută apariţia &următoare + + + &Find previous + Caută apariţia &precedentă + + + Rena&me Tab... + Rede&numeşte fila... + + + A&dd Tab + A&daugă filă + + + C&lose Tab + Închidere &fila + + + Auto&exec + Auto-&execută + + + &Functions + &Funcţii + + + Text + Text + + + All Files + Toate fişierele + + + QtiPlot - Import Text From File + QtiPlot - Importă text din fişier + + + QtiPlot - Error Opening File + QtiPlot - Eroare de deschidere fişier + + + Could not open file "%1" for reading. + Nu a fost posibilă citirea fişierului "%1" . + + + Save Text to File + Salvează text în fişier + + + QtiPlot - File Save Error + QtiPlot - Eroare de salvare a fişerului + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + Nu a fost posibilă scrierea în fişierul: <br><h4> %1 </h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie! + + + QtiPlot + QtiPlot + + + QtiPlot has finished searching the document. + QtiPlot a terminat de căutat în document. + + + + ScriptWindow + + QtiPlot - Script Window + QtiPlot - Fereastră programare + + + &File + &Fişier + + + &Edit + &Editare + + + E&xecute + E&xecută + + + &Window + &Fereastră + + + &New + &Nou + + + Ctrl+N + Ctrl+N + + + &Open... + &Deschide... + + + Ctrl+O + Ctrl+O + + + &Save + &Salvează + + + Ctrl+S + Ctrl+S + + + Save &As... + Salvează c&a... + + + &Print + Im&primă + + + Ctrl+P + Ctrl+P + + + &Undo + An&ulează + + + Ctrl+Z + Ctrl+Z + + + &Redo + &Refă + + + Ctrl+Y + Ctrl+Y + + + &Cut + &Taie + + + Ctrl+x + Ctrl+X + + + &Copy + &Copiază + + + Ctrl+C + Ctrl+C + + + &Paste + Li&peşte + + + Ctrl+V + Ctrl+V + + + Increase Indent + Măreşte identarea + + + Decrease Indent + Micşorează identarea + + + &Find... + &Caută... + + + Ctrl+Alt+F + Ctrl+Alt+F + + + Find &Next + Caută apariţia &următoare + + + F3 + F3 + + + Find &Previous + Caută apariţia &precedentă + + + F4 + F4 + + + &Replace... + În&locuieşte... + + + Show &Line Numbers + Afişază numărul &liniei + + + CTRL+J + Ctrl+J + + + Execute &All + Execută &tot + + + CTRL+SHIFT+J + Ctrl+Shift+J + + + &Evaluate Expression + &Evaluează expresia + + + CTRL+Return + Ctrl+Return + + + Always on &Top + În&totdeauna deasupra + + + &Hide + Ascu&nde + + + QtiPlot - File Save Error + QtiPlot - Eroare de salvare a fişerului + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + Nu a fost posibilă scrierea în fişierul: <br><h4> %1 </h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie! + + + You need to close and reopen the script window before your changes become effective! Do you want to close it now? + Trebuie să închideţi şi să redeschideţi fereastra de script pentru ca noile setări să funcţioneze! Vreţi să o închideţi acum? + + + QtiPlot + QtiPlot + + + Script Output Panel + Fereastră cu rezultate + + + Show Script &Output Panel + Arată fereastra cu &rezultate + + + Ouput on Next &Line + Afişază rezultatul pe &linia următoare + + + Show Script Output Panel + Arată fereastra cu rezultate + + + Print Pre&view... + &Previzualizare tipărire... + + + Script print preview + Previzualizare tipărire script + + + &Close + În&chide + + + Show &Workspace + Arată &spaţiul de lucru + + + + ScriptingEnv + + %1 Source (*.%2);; + %1 Sursă (*.%2);; + + + + ScriptingLangDialog + + QtiPlot - Select scripting language + QtiPlot - Alegeţi limbajul de programare + + + OK + OK + + + Cancel + Anulează + + + QtiPlot - Scripting Error + QtiPlot - Eroare de programare + + + Scripting language "%1" failed to initialize. + Limbajul de programare "%1" nu a putut fi iniţializat. + + + + SetColValuesDialog + + QtiPlot - Set column values + QtiPlot - Calculează valorile coloanei + + + For row (i) + De la linia (i) + + + to + până la + + + Add function + Adaugă funcţie + + + Add column + Adaugă coloană + + + Add cell + Adaugă celulă + + + &Apply + &Aplică + + + &Close + În&chide + + + Use built-in muParser (much faster) + Foloseşte muParser (mult mai rapid) + + + Clear &Formulas + Şterge &formulele + + + + SigmoidalFit + + Boltzmann + Boltzmann + + + init value + Valoare iniţială + + + final value + Valoare finală + + + center + Centru + + + time constant + Constanta de timp + + + Boltzmann (Sigmoidal) Fit + Ajustare Boltzmann (Sigmoidală) + + + + SmoothCurveDialog + + QtiPlot - Smoothing Options + QtiPlot - Opţiuni de netezire + + + Curve + Curbă + + + Polynomial Order + Ordinul polinomului + + + Points to the Left + Puncte la stânga + + + Points to the Right + Puncte la dreapta + + + Color + Culoare + + + f + f + + + Iterations + Iteraţii + + + Points + Puncte + + + &Smooth + &Netezeşte + + + &Close + În&chide + + + + SmoothFilter + + Smoothed + Neted + + + QtiPlot + QtiPlot + + + Error + Eroare + + + Unknown smooth filter. Valid values are: 1 - Savitky-Golay, 2 - FFT, 3 - Moving Window Average. + Tip de filtru necunoscut! Valorile valide sunt: 1 - Savitky-Golay, 2 - FFT, 3 - Medie glisantă. + + + Unknown smooth filter. Valid values are: 1 - Savitky-Golay, 2 - FFT, 3 - Moving Window Average, 4 - Lowess. + Tip de filtru necunoscut! Valorile valide sunt: 1 - Savitky-Golay, 2 - FFT, 3 - Medie glisantă, 4 - Lowess. + + + points + puncte + + + Savitzky-Golay smoothing + Netezire Savitzky-Golay + + + FFT smoothing + Netezire FFT + + + average smoothing + Netezire prin mediere + + + Lowess smoothing with f=%1 and %2 iterations + Netezire Lowess folosind f=%1 și %2 iterații + + + The number of points must be positive! + Numărul de puncte trebuie să fie o valoare pozitivă! + + + The polynomial order must be lower than the number of left points plus the number of right points! + Ordinul polinomului trebuie să fie mai mic decat numărul de puncte la stânga adunat cu numărul de puncte la dreapta! + + + Setting polynomial order is only available for Savitzky-Golay smooth filters! Ignored option! + Definirea ordinului polinomului este disponibilă numai pentru filtrele de netezire de tip Savitzky-Golay! Opţiunea va fi ignorată! + + + Setting Lowess parameter is only available for Lowess smooth filters! Ignored option! + Definirea parametrului Lowess este disponibilă numai pentru filtrele de netezire de tip Lowess! Opţiunea va fi ignorată! + + + The parameter f must be between 0 and 1! + Parametrul f trebuie să aibă o valoare cuprinsă între 0 si 1! + + + The number of iterations must be at least 1! + Numărul de iterații trebuie să fie o valoare pozitivă! + + + + SortDialog + + QtiPlot - Sorting Options + QtiPlot - Opţiuni de sortare + + + Sort columns + Sortează coloanele + + + Separately + Separat + + + Together + Împreună + + + Order + Ordinea de sortare + + + Ascending + Ascendentă + + + Descending + Descendentă + + + Leading column + Coloana principală + + + &Sort + &Sortează + + + &Close + În&chide + + + + SubtractDataDialog + + QtiPlot + QtiPlot + + + Math on Data Sets + Operaţii cu seturi de date + + + Cu&rve + Cu&rbă + + + &Operator + &Operator + + + &Data set + &Set de date + + + Current &folder + &Dosarul curent + + + &Value + &Valoare + + + &Apply + &Aplică + + + &Close + În&chide + + + Error + Eroare + + + Data set %1 must containt at least two valid data points in order to perform this operation! + Setul de date %1 trebuie să conţină cel puţin două puncte pentru a efectua această operaţie! + + + + SubtractLineTool + + Move cursor and click to select and double-click/press 'Enter' to set the position of the first point! + Mişcaţi cursorul şi efectuaţi un click pentru a alege un punct şi efectuaţi un click dublu sau apăsaţi tasta 'Enter' pentru a defini poziţia primului capăt al dreptei! + + + First point selected! Click to select and double-click/press 'Enter' to set the position of the 2nd point! + Primul punct a fost selecţionat! Efectuaţi un click simplu pentru a alege şi efectuaţi un click dublu sau apăsaţi tasta 'Enter' pentru a defini poziţia punctului următor! + + + + SurfaceDialog + + QtiPlot - Define surface plot + QtiPlot - Definiţi suprafaţa 3D + + + Surface type + Tip de suprafaţă + + + Function + Funcţie + + + Parametric + Parametrică + + + Clear &list + Go&leşte lista + + + &OK + &OK + + + &Close + În&chide + + + f(x,y)= + f(x,y)= + + + X - axis + Axa X + + + -1 + -1 + + + 1 + 1 + + + Clea&r + Go&leşte + + + Rece&nt + Rece&nt + + + Click here to select a recently typed expression + Apăsați aici pentru a alege o expresie recent introdusă + + + From + De la + + + To + Pană la + + + Y - axis + Axa Y + + + Z - axis + Axa Z + + + Mesh + Eşantionaj + + + Columns + Coloane + + + Rows + Linii + + + Equations + Ecuaţii + + + X(u,v)= + X(u,v)= + + + Y(u,v)= + Y(u,v)= + + + Z(u,v)= + Z(u,v)= + + + u + u + + + Periodic + Periodic + + + v + v + + + QtiPlot - X Formula Error + QtiPlot - Eroare în formula introdusă pentru X + + + QtiPlot - Y Formula Error + QtiPlot - Eroare în formula introdusă pentru Y + + + QtiPlot - Z Formula Error + QtiPlot - Eroare în formula introdusă pentru Z + + + QtiPlot + QtiPlot + + + Sorry, there are no recent expressions available! + Ne pare rău, nu există expresii recente disponibile! + + + Recent Functions + Funcții recente + + + Please, choose a function: + Vă rugăm să alegeţi o funcţie: + + + QtiPlot - u start limit error + QtiPlot - Eroare detectată la valoarea de început pentru parametrul u + + + QtiPlot - u end limit error + QtiPlot - Eroare detectată la valoarea de sfarşit pentru parametrul u + + + QtiPlot - v start limit error + QtiPlot - Eroare detectată la valoarea de început pentru parametrul v + + + QtiPlot - X Start limit error + QtiPlot - Eroare detectată la valoarea de început pentru X + + + QtiPlot - X End limit error + QtiPlot - Eroare detectată la valoarea de sfarşit pentru X + + + QtiPlot - Y Start limit error + QtiPlot - Eroare detectată la valoarea de început pentru Y + + + QtiPlot - Y End limit error + QtiPlot - Eroare detectată la valoarea de sfarşit pentru Y + + + QtiPlot - Z Start limit error + QtiPlot - Eroare detectată la valoarea de început pentru Z + + + QtiPlot - Z End limit error + QtiPlot - Eroare detectată la valoarea de sfarşit pentru Z + + + QtiPlot - Input error + QtiPlot - Eroare + + + Please enter limits that satisfy: from < end! + Vă rugam să introduceţi limite care satisfac condiţia: început < sfarşit ! + + + QtiPlot - Input function error + QtiPlot - Eroare detectată în funcţia introdusă + + + + SymbolBox + + No Symbol + Fără simbol + + + Ellipse + Elipsă + + + Rectangle + Dreptunghi + + + Diamond + Diamant + + + Triangle + Triunghi + + + Down Triangle + Triunghi îndreptat în jos + + + Up Triangle + Triunghi îndreptat în sus + + + Left Triangle + Triunghi îndreptat la stânga + + + Right Triangle + Triunghi îndreptat la dreapta + + + Cross + Cruce + + + Diagonal Cross + Cruce diagonală + + + Horizontal Line + Linie orizontală + + + Vertical Line + Linie verticală + + + Star 1 + Stea 1 + + + Star 2 + Stea 2 + + + Hexagon + Hexagon + + + + SymbolDialog + + &Close + În&chide + + + QtiPlot - Choose Symbol + QtiPlot - Alegeţi simbolul + + + + Table + + Multiline expressions take much more time to evaluate! Do you want to continue anyways? + Evaluarea expresiilor conţinand mai multe linii durează mult mai mult timp! Doriţi să continuaţi? + + + QtiPlot + QtiPlot + + + Warning + Avertisment + + + QtiPlot - Error + QtiPlot - Eroare + + + Column '%1' is read only! + Coloana '%1' nu poate fi modificată! + + + There is already a column called : <b> + Există deja o coloană denumită: <b> + + + The table '%1' contains read-only columns! Operation aborted! + Tabelul '%1' conţine numai coloane care nu pot fi modificate! Operaţiune abandonată! + + + The folowing columns + Coloanele următoare + + + are read only! + nu pot fi modificate! + + + Paste operation + Lipeşte + + + How should QtiPlot interpret first clipboard line? + Cum trebuie QtiPlot să interpreteze prima linie? + + + &Values + &Valori + + + Column &Names + &Nume coloană + + + &Comments + Co&mentarii + + + Please indicate the name of the leading column! + Vă rugam să indicaţi numele coloanei principale! + + + The leading column has the type set to 'Text'! Operation aborted! + Coloana principală este de tip 'Text'! Operaţie abandonată! + + + The leading column is empty! Operation aborted! + Coloana principală este vidă! Operaţie abandonată! + + + Qtiplot + QtiPlot + + + Reading file... + Citire fişier... + + + QtiPlot - ASCII Export Error + QtiPlot - Eroare de export ASCII + + + Could not write to file: <br><h4> + Nu a fost posibilă scrierea în fişierul: <br><h4> + + + Rows will be deleted from the table! + Din tabel vor fi şterse linii! + + + Do you really want to continue? + Doriţi intr-adevăr să continuaţi? + + + Yes + Da + + + Cancel + Anulează + + + Columns will be deleted from the table! + Din tabel vor fi şterse coloane! + + + kB + kilobiţi + + + + TableDialog + + QtiPlot - Column options + QtiPlot - Opţiuni pentru coloană + + + Column Name: + Numele coloanei: + + + Enumerate all to the right + Numerotează toate coloanele la dreapta + + + &OK + &OK + + + &Apply + &Aplică + + + &Cancel + A&nulează + + + Plot Designation: + Tip de date: + + + None + Ignoră + + + X (abscissae) + X (abscise) + + + Y (ordinates) + Y (ordonate) + + + Z (height) + Z (înălţime) + + + X Error + Erori în X + + + Y Error + Erori în Y + + + Label + Etichete + + + Display + Afişaj + + + Numeric + Numeric + + + Text + Text + + + Date + Dată + + + Time + Timp + + + Month + Lună + + + Day of Week + Zi a săptămanii + + + Format: + Format: + + + Precision: + Precizie: + + + &Read-only + Numai citi&re + + + &Hidden + A&scunde + + + Apply to all columns to the right + Aplică tuturor coloanelor din dreapta + + + Options + Opţiuni + + + Column Width: + Lăţimea coloanei: + + + Apply to all + Aplică tuturor coloanelor + + + &Display Comments in Header + A&fişază comentariile + + + Comment: + Comentariu: + + + QtiPlot - Warning + QtiPlot - Avertisment + + + For internal consistency reasons the underscore character is replaced with a minus sign. + Avertisment: din motive legate de reprezentarea internă folosită de QtiPlot, caracterul "_" va fi înlocuit cu semnul minus '-'. + + + QtiPlot - Error + QtiPlot - Eroare + + + The column names must only contain letters and digits! + Numele de coloane trebuie să conţină doar litere şi cifre! + + + Default + Implicit + + + Decimal: 1000 + Zecimal: 100.0 + + + Scientific: 1E3 + Ştiinţific: 1E3 + + + dd/MM/yyyy + zz/LL/aaaa + + + dd/MM/yyyy HH:mm + zz/LL/aaaa OO:mm + + + dd/MM/yyyy HH:mm:ss + zz/LL/aaaa OO:mm:ss + + + dd.MM.yyyy + zz.LL.aaaa + + + dd.MM.yyyy HH:mm + zz.LL.aaaa OO:mm + + + dd.MM.yyyy HH:mm:ss + zz.LL.aaaa OO:mm:ss + + + dd MM yyyy + zz LL aaaa + + + dd MM yyyy HH:mm + zz LL aaaa OO:mm + + + dd MM yyyy HH:mm:ss + zz LL aaaa OO:mm:ss + + + yyyy-MM-dd + aaaa-LL-zz + + + yyyy-MM-dd HH:mm + aaaa-LL-zz OO:mm + + + yyyy-MM-dd HH:mm:ss + aaaa-LL-zz OO:mm:ss + + + yyyyMMdd + aaaaLLzz + + + yyyyMMdd HH:mm + aaaaLLzz OO:mm + + + yyyyMMdd HH:mm:ss + aaaaLLzz OO:mm:ss + + + h + o + + + h ap + o ap + + + h AP + o AP + + + h:mm + o:mm + + + h:mm ap + o:mm ap + + + hh:mm + oo:mm + + + h:mm:ss + o:mm:ss + + + h:mm:ss.zzz + o:mm:ss.zzz + + + mm:ss + + + + mm:ss.zzz + + + + hmm + omm + + + hmmss + ommss + + + hhmmss + oommss + + + Couldn't guess the source data format, please specify it using the 'Format' box! + Formatul datelor sursă nu aputut fi determinat, vă rugăm să-l specificaţi utilizand lista 'Format'! + + + For more information about the supported date/time formats please read the Qt documentation for the QDateTime class! + Pentru mai multe informaţii legate de formatul dată/timp vă rugăm să citiţi documentation Qt pentru clasa QDateTime! + + + + TableStatistics + + RowStats + StatisticiLinii + + + Row Statistics of %1 + Statistici linii pentru setul de date %1 + + + Row + Linie + + + Cols + Coloane + + + Mean + Medie + + + StandardDev + DeviereStandard + + + StandardError + EroareStandard + + + Variance + Varianţă + + + Sum + Sumă + + + Max + Maxim + + + Min + + + + ColStats + StatisticiColoane + + + Column Statistics of %1 + Statistici coloane pentru setul de date %1 + + + Col + Coloană + + + Rows + Linii + + + iMax + iMax + + + iMin + iMin + + + Median + Median + + + + TextDialog + + QtiPlot - Text options + QtiPlot - Opţiunile textului + + + Text Color + Culoare + + + Font + Font + + + &Font + &Font + + + Alignment + Aliniere + + + Center + Centrat + + + Left + Stânga + + + Right + Dreapta + + + Distance to axis + Distanţa pană la axă + + + &Apply to... + Aplică forma&tul... + + + Object + Obiectului + + + Layer + Graficului + + + Window + Fereastrei + + + All Windows + Tuturor ferestrelor + + + &Close + În&chide + + + QtiPlot + QtiPlot + + + X Axis Title + Titlu axă X + + + Y Axis Title + Titlu axă Y + + + Top Axis Title + Titlu axă sus + + + Right Axis Title + Titlu axă dreapta + + + &Inverted + &Inversată + + + + TextEditor + + QtiPlot + QtiPlot + + + Confirmation + Confirmare + + + Are you sure you want to add %1 text lines into this text box? + Sunteţi sigur că vreţi să adăugaţi %1 linii acestui text? + + + + TextFormatButtons + + B + Button bold + + + + It + Button italics + It + + + U + Button underline + U + + + + ThreeExpFit + + ExpDecay3 + ScădereExp3 + + + Exponential decay + Scădere exponenţială + + + first amplitude + prima amplitudine + + + first lifetime + prima durată de viaţă + + + second amplitude + a doua amplitudine + + + second lifetime + a doua durată de viaţă + + + third amplitude + a treia amplitudine + + + third lifetime + a treia durată de viaţă + + + offset + constantă + + + + TranslateCurveTool + + Double-click on plot to select a data point! + Efectuaţi un dublu-click în interiorul graficului pentru a selecta un punct! + + + QtiPlot - Warning + QtiPlot - Avertisment + + + The column '%1' is read-only! Operation aborted! + Coloana '%1' nu poate fi modificată! Operaţiune abandonată! + + + Curve selected! Move cursor and click to choose a point and double-click/press 'Enter' to finish! + Curbă selecţionată! Mişcaţi cursorul şi efectuaţi un click pentru a alege un punct şi efectuaţi un double-click sau apăsaţi tasta 'Enter' pentru a termina! + + + This operation cannot be performed on function curves. + Această operaţie nu este disponibilă pentru funcţiis. + + + This operation cannot be performed on curves plotted from columns having a non-numerical format. + Această operaţie nu poate fi efectuată pentru curbe ce utilizează ca surse de date coloane având un format diferit de cel numeric. + + + + TwoExpFit + + ExpDecay2 + ScădereExp2 + + + Exponential decay + Scădere exponenţială + + + first amplitude + prima amplitudine + + + first lifetime + prima durată de viaţă + + + second amplitude + a doua amplitudine + + + second lifetime + a doua durată de viaţă + + + offset + constantă + + + + muParserScript + + col() works only on tables! + funcţia col() poate fi folosită doar pentru tabele! + + + There's no column named %1 in table %2! + Nu există o coloană numită %1 în tabelul %2! + + + There's no row %1 in table %2! + Nu există linia %1 în tabelul %2! + + + There's no column %1 in table %2! + Nu există o coloană numită %1 în tabelul %2! + + + tablecol() works only on tables! + funcţia tablecol() poate fi folosită doar pentru tabele! + + + tablecol: wrong number of arguments (need 2, got %1) + tablecol: număr incorect de argumente (e nevoie de două, au fost furnizate %1) + + + tablecol: first argument must be a string (table name) + tablecol: primul argument trebuie să fie un şir de caractere (numele tabelului) + + + Couldn't find a table named %1. + Nu există un tabel numit %1. + + + cell() works only on tables and matrices! + funcţia cell() poate fi folosită doar pentru tabele sau matrici! + + + There's no row %1 in matrix %2! + Nu există linia %1 în matricea %2! + + + There's no column %1 in matrix %2! + Nu există coloana %1 în matricea %2! + + + Out of memory + Memorie insuficientă + + + SUM() works only on tables! + Funcţia SUM() poate fi folosită doar pentru tabele! + + + AVG() works only on tables! + Funcţia AVG() poate fi folosită doar pentru tabele! + + + + muParserScripting + + abs(x): + Absolute value of x. + abs(x): + Modulul lui x. + + + acos(x): + Inverse cos function. + acos(x): + Funcţia cosinus inversă. + + + acosh(x): + Hyperbolic inverse cos function. + acosh(x): + Funcţia cosinus hiperbolică inversă. + + + asin(x): + Inverse sin function. + asin(x): + Funcţia sinus inversă. + + + asinh(x): + Hyperbolic inverse sin function. + asinh(x): + Funcţia sinus hiperbolică inversă. + + + atan(x): + Inverse tan function. + atan(x): + Funcţia tangentă inversă. + + + atanh(x): + Hyperbolic inverse tan function. + atanh(x): + Funcţia tangentă hiperbolică inversă. + + + avg(x,y,...): + Mean value of all arguments. + avg(x,y,...): + Valoarea medie a tuturor argumentelor. + + + cos(x): + Calculate cosine. + cos(x): + Calculează cosinus. + + + cosh(x): + Hyperbolic cos function. + cosh(x): + Funcţia cosinus hiperbolică. + + + erf(x): + The error function. + erf(x): Funcţia eroare. + + + erfc(x): + Complementary error function erfc(x) = 1 - erf(x). + erfc(x): + Funcţia eroare complementară erfc(x) = 1 - erf(x). + + + exp(x): + Exponential function: e raised to the power of x. + exp(x): + Funcţia exponentială: e la puterea x. + + + if(e1, e2, e3): + if e1 then e2 else e3. + if(e1, e2, e3): + dacă e1 atunci e2 altfel e3. + + + ln(x): + Calculate natural logarithm log_e. + ln(x): + Calculează logaritmul natural log_e. + + + log(x): + Calculate decimal logarithm log_10. + log(x): + Calculează logaritmul zecimal log_10. + + + log10(x): + Calculate decimal logarithm log_10. + log10(x): + Calculează logaritmul zecimal log_10. + + + log2(x): + Calculate binary logarithm log_2. + log2(x): + Calculează logaritmul în baza doi log_2. + + + min(x,y,...): + Calculate minimum of all arguments. + min(x,y,...): + Calculează minimul dintre toate argumentele. + + + max(x,y,...): + Calculate maximum of all arguments. + max(x,y,...): + Calculează maximul dintre toate argumentele. + + + mod(x,y): + Calculate rest of integer division x/y, + x modulo y. + mod(x,y): + Calculează restul împarţirii lui x la y, + x modulo y. + + + pow(x,y): + Raise x to the power of y, x^y. + pow(x,y): + Ridică pe x la puterea y, x^y. + + + rint(x): + Round to nearest integer. + rint(x): + Rotunjeşte la cel mai apropiat întreg. + + + sign(x): + Sign function: -1 if x<0; 1 if x>0. + sign(x): + Funcţia semn: -1 if x<0; 1 if x>0. + + + sin(x): + Calculate sine. + cos(x): + Calculează sinus. + + + sinh(x): + Hyperbolic sin function. + sinh(x): + Funcţia sinus hiperbolică. + + + sqrt(x): + Square root function. + sqrt(x): + Rădăcină pătrată. + + + sum(x,y,...): + Calculate sum of all arguments. + sum(x,y,...): + Calculează suma tuturor argumentelor. + + + tan(x): + Calculate tangent function. + tan(x): + Funcţia tangentă. + + + tanh(x): + Hyperbolic tan function. + tanh(x): + Funcţia tangentă hiperbolică. + + + === removed file 'qtiplot/translations/qtiplot_ro.ts' --- qtiplot/translations/qtiplot_ro.ts 2009-12-08 18:06:27 +0000 +++ qtiplot/translations/qtiplot_ro.ts 1970-01-01 00:00:00 +0000 @@ -1,18434 +0,0 @@ - - - - - - - QtiPlot - File openning error - QtiPlot - Eroare de deschidere fişier - - - You don't have the permission to open this file: <b>%1</b> - Nu aveţi permisiunea să deschideţi fişierul: <b>%1</b> - - - QtiPlot - File opening error - QtiPlot - Eroare de deschidere fişier - - - The file: <b>%1</b> doesn't exist! - Fişierul: <b>%1</b> nu există! - - - The file: <b>%1</b> is not a QtiPlot or Origin project file! - Fişierul: <b>%1</b> nu este un fişier creat folosind QtiPlot sau OriginLab! - - - QtiPlot - Demo Version - QtiPlot - Versiune de test - - - You are using the demonstration version of Qtiplot. - - Folosiţi versiunea de test a QtiPlot. - - - QtiPlot - File backup error - QtiPlot - Eroare de salvare a fişerului - - - Cannot make a backup copy of <b>%1</b> (to %2).<br>If you ignore this, you run the risk of <b>data loss</b>. - Nu a fost posibilă crearea unei copii de siguranţă pentru fişierul <b>%1</b> (în %2).<br>Daca ignoraţi acest mesaj riscaţi<b>să pierdeţi date</b>. - - - QtiPlot - File save error - QtiPlot - Eroare de salvare a fişerului - - - The file: <br><b>%1</b> is opened in read-only mode - Fişierul: <br><b>%1</b> este accesibil doar pentru citire - - - QtiPlot project - Proiect QtiPlot - - - Compressed QtiPlot project - Proiect QtiPlot arhivat - - - Save project as - Salvează proiectul ca - - - Save &As Project... - Salvează c&a proiect... - - - &Show All Windows - &Arată toate ferestrele - - - &Hide All Windows - Ascu&nde toate ferestrele - - - &Delete Folder - Şte&rge dosar - - - &Rename - &Redenumeşte - - - New &Window - &Fereastră nouă - - - New F&older - D&osar nou - - - &None - &Nici una - - - &Windows in Active Folder - &Ferestrele din dosarul activ - - - Windows in &Active Folder && Subfolders - Ferestrele din dosarul &activ şi din dosarele conţinute de acesta - - - &View Windows - Afişază &ferestrele - - - &Properties... - &Proprietăti... - - - Hidden - Ascuns - - - QtiPlot - Error - QtiPlot - Eroare - - - Please enter a valid name! - Vă rugăm introduceţi un nume valid! - - - Name already exists! - Acest nume e deja folosit! - - - Please choose another name! - Vă rugăm alegeţi un alt nume! - - - Type - Tip - - - Project - Proiect - - - Path - Cale - - - Size - Mărime - - - bytes - biţi - - - Contents - Conţinut - - - windows - ferestre - - - folders - dosare - - - Created - Creat - - - Modified - Modificat - - - Properties - Proprietăţi - - - Folder - Dosar - - - New Folder - Dosar nou - - - QtiPlot - Delete folder? - QtiPlot - Şterge dosarul? - - - Delete folder '%1' and all the windows it contains? - Şterge dosarul '%1' şi toate ferestrele pe care le conţine? - - - Yes - Da - - - No - Nu - - - Matrix - Matrice - - - Table - Tabel - - - Note - Note - - - Graph - Grafic - - - 3D Graph - Grafic 3D - - - Label - Etichetă - - - Status - Statut - - - QtiPlot - No match found - QtiPlot - Căutare fără rezultat - - - Sorry, no match found for string: '%1' - Ne pare rău, nu a fost găsit nici un rezultat pentru şirul de caractere: '%1' - - - Cannot move an object to itself! - Un obiect nu poate fi mutat în el însuşi! - - - Cannot move a parent folder into a child folder! - Un dosar nu poate fi mutat intr-un dosar pe care îl conţine! - - - QtiPlot - QtiPlot - - - Skipped moving folder - Dosarul nu a fost mutat - - - The destination folder already contains a folder called '%1'! Folder skipped! - Dosarul de destinaţie conţine deja un dosar numit '%1'! Dosarul a fost sărit! - - - Error - Eroare - - - QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! - QtiPlot va încerca să aducă informaţia necesară despre ultima versiune disponibilă. Vă rugăm să permiteţi conectarea la internet! - - - Do you wish to continue? - Doriţi să continuaţi? - - - QtiPlot - HTTP get version file - QtiPlot - Acces la informaţia despre ultima versiune folosind HTTP - - - Error while fetching version file with HTTP: %1. - Eroare de acces la fişierul cu informaţii despre ultima versiune disponibilă folosind HTTP: %1. - - - QtiPlot - Updates Available - QtiPlot - Actualizare disponibilă - - - There is a newer version of QtiPlot (%1) available for download. Would you like to download it? - Există o versiune mai nouă (%1) pentru QtiPlot. Vreţi să o instalaţi? - - - QtiPlot - No Updates Available - QtiPlot - Nu s-au găsit actualizări - - - No updates available. Your current version %1 is the last version available! - Nu e disponibilă o versiune mai nouă. Versiunea dumneavoastră %1 este ultima versiune disponibilă! - - - QtiPlot - Warning - QtiPlot - Avertisment - - - This will clear the contents of all the data associated with the table. Are you sure? - Toate seturile de date asociate cu acest tabel vor fi şterse. Sunteţi sigur? - - - &Yes - &Da - - - &No - &Nu - - - QtiPlot - Enter row number - QtiPlot - Introduceţi numărul liniei - - - Row - Linie - - - QtiPlot - Enter column number - QtiPlot - Introduceţi numărul coloanei - - - Column - Coloană - - - QtiPlot was not built with Python scripting support included! - QtiPlot nu a fost compilat cu suport pentru limbajul de programare Python! - - - Please select a Y column to plot! - Vă rugam să selectaţi o coloana de tip Y! - - - You need at least two columns for this operation! - E nevoie de cel puţin două coloane pentru aceasta operaţiune! - - - Please set a default X column for this table, first! - Vă rugăm să definiţi mai întâi o coloană de tip X pentru acest tabel! - - - Please select a Z column for this operation! - Vă rugăm să selectaţi o coloană de tip Z pentru această operaţie! - - - You need to define a X column first! - Vă rugam să definiţi mai întâi o coloana de tip X! - - - You need to define a Y column first! - Vă rugam să definiţi mai întâi o coloana de tip Y! - - - Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. - Începând cu versiunea 0.9.1 QtiPlot salveaza funcţiile de ajustare definite de utilizator într-un alt loc. - - - If you want to save your already defined models, please choose a destination folder. - Dacă doriţi să salvaţi funcţiile de ajustare create, vă rugăm să alegeţi un dosar. - - - Import fit models - Importă funcţii de ajustare - - - Choose a directory to export the fit models to - Alegeţi un dosar în care să exportaţi funcţiile de ajustare - - - No Icon - Fără icoană - - - Couldn't load file: %1. -Autocompletion will not be available! - Fişierul: %1 nu a putut fi încărcat.Sugestiile de completare automată nu vorfi disponibile! - - - QtiPlot - Column selection error - QtiPlot - Eroare de selecţie a coloanei - - - Please select exactly one column and more than one non empty cell! - Vă rugăm să selectaţi o singură coloană si cel puţin două celule cu conţinut valid! - - - Data set: %1 doesn't exist! - Setul de date %1 nu există! - - - Stem and leaf plot of dataset - Grafic tulpină cu frunze a setului de date - - - from row - de la linia - - - to row - la linia - - - Not enough memory for this dataset! - Memorie insuficientă pentru acest set de date! - - - Stem - Tulpină - - - Leaf - Frunze - - - Please confirm the stem unit! - Vă rugam să confirmaţi unitatea de măsură pentru tulpină! - - - Data set - Set de date - - - stem unit - unitate pentru tulpină - - - Stem unit - Unitate pentru tulpină - - - Leaf unit - Unitate pentru frunze - - - Key - Legendă - - - means - înseamnă - - - Input error: empty data set! - Eroare: setul de date este vid! - - - Memory Allocation Error - Eroare de alocare a memoriei - - - Not enough memory, operation aborted! - Memorie insuficientă, operaţia a fost abandonată! - - - Set Precision %1 digits - %1 cifre semnificative - - - - AddWidgetTool - - - Click on plot to choose the position of the new object! - Vă rugăm, daţi click pe grafic pentru a alege poziţia noului obiect! - - - - - enter your text here - introduceţi textul dumneavoastră aici - - - - Move cursor in order to resize the new rectangle! - Mişcaţi cursorul pentru a redimensiona noul dreptunghi! - - - - Move cursor in order to resize the new ellipse! - Mişcaţi cursorul pentru a redimensiona noua elipsă! - - - - ApplicationWindow - - - - QtiPlot - untitled - QtiPlot - neintitulat - - - - - Project Explorer - Explorator de proiect - - - - - - Folder - Dosar - - - - UNTITLED - NEINTITULAT - - - - - Name - Nume - - - - - - - - - - - - Type - Tip - - - - - View - Afişaj - - - - - - - - Size - Dimensiune - - - - - - - - - Created - Creat - - - - - - Label - Etichetă - - - - - Results Log - Rezultate - - - - - Scripting Console - Consolă de programare - - - - - Undo Stack - Listă de modificări - - - - &Next - next window - Fereastra &următoare - - - - F5 - next window shortcut - F5 - - - - &Previous - previous window - Fereastra &precedentă - - - - F6 - previous window shortcut - F6 - - - - - File - Fişier - - - - - Edit - Editare - - - - - Plot - Grafic - - - - Disable &Tools - Dezactivare unel&te - - - - - &Zoom In - &Mărire - - - - - Ctrl++ - Ctrl++ - - - - &Zoom Out - Mi&cşorare - - - - - Ctrl+- - Ctrl+- - - - - - &Data Reader - Cititor de &date - - - - - CTRL+D - CTRL+D - - - - - &Select Data Range - &Selectare interval - - - - - ALT+S - ALT+S - - - - - S&creen Reader - Coordonate e&cran - - - - - &Draw Data Points - &Desen date - - - - - &Move Data Points... - &Modificare date... - - - - - Ctrl+ALT+M - Ctrl+ALT+M - - - - - Remove &Bad Data Points... - Ster&gere date incorecte... - - - - - Alt+B - Alt+B - - - - - Add E&quation - Adăugare &ecuaţie - - - - - ALT+Q - ALT+Q - - - - - Add &Text - Adăugare &text - - - - - ALT+T - ALT+T - - - - - Draw &Arrow - Desen săge&ată - - - - - CTRL+ALT+A - CTRL+ALT+A - - - - - Draw &Line - Desen &linie - - - - - CTRL+ALT+L - CTRL+ALT+L - - - - - Add &Rectangle - Adăugare d&reptunghi - - - - - CTRL+ALT+R - CTRL+ALT+R - - - - - Add &Ellipse - Adăugare &elipsă - - - - - CTRL+ALT+E - CTRL+ALT+E - - - - - - - - - - - Table - Tabel - - - - - - - - - - - Column - Coloană - - - - - Data Display - Afişaj date - - - - - Matrix Plot - Grafic de matrice - - - - - - Format - Format - - - - QtiPlot - Script Window - QtiPlot - Fereastră programare - - - - - 3D Surface - Suprafaţă 3D - - - - - &Recent Projects - Proiecte &recente - - - - Set Columns &As - Definire coloane c&a - - - - - &Read-only - Numai citi&re - - - - - Read/&Write - Citire/&Scriere - - - - - &Fill Columns With - &Umple coloanele cu - - - - - - Special Line/Symb&ol - Linie/Simb&ol special - - - - - - Statistical &Graphs - Grafice &statistice - - - - - Pa&nel - Pa&nou - - - - 3&D Plot - Grafic 3&D - - - - &File - &Fişier - - - - &Edit - &Editare - - - - &View - &Afişaj - - - - &Scripting - &Programare - - - - &Graph - &Grafic - - - - - &Data - &Date - - - - &Analysis - &Analiză - - - For&mat - For&mat - - - - - - &Plot - &Grafic - - - - - - &Table - &Tabel - - - - - 3D &Plot - Grafic 3&D - - - - &Matrix - &Matrice - - - - Empty Stack - Lista de modificări vidă - - - - &Windows - &Ferestre - - - - - - &Help - &Ajutor - - - - - - - - You must select exactly one column for plotting! - Trebuie să selectaţi o singură coloană! - - - - - - - - - - QtiPlot - Plot error - QtiPlot - Eroare - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QtiPlot - Error - QtiPlot - Eroare - - - - Please select a column to plot! - Vă rugam să selectaţi coloana pe care vreţi să o trasaţi! - - - - - Please select four columns for this operation! - Vă rugam să selectaţi patru coloane pentru aceasta operaţiune! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QtiPlot - Warning - QtiPlot - Avertisment - - - - - <h4>There are no tables available in this project.</h4><p><h4>Please create a table and try again!</h4> - <h4>Nu există tabele disponibile în acest proiect.</h4><p><h4>Vă rugam creaţi un tabel şi încercaţi din nou!</h4> - - - - There are no available columns with plot designation set to Z! - Nu există coloane de tip Z! - - - - - - QtiPlot - Choose data set - QtiPlot - Alegeţi setul de date - - - - - - - - - - - Matrix - Matrice - - - - - QtiPlot - Choose matrix to plot - QtiPlot - Alegeţi matricea pe care vreţi să o reprezentaţi - - - - <h4>There are no matrices available in this project.</h4><p><h4>Please create a matrix and try again!</h4> - <h4>Nu există matrici disponibile în acest proiect.</h4><p><h4>Vă rugam creaţi o matrice şi încercaţi din nou!</h4> - - - - - - - - - - - - - - - - - Graph - Grafic - - - - - - - - - - QtiPlot - Export error - QtiPlot - Eroare de export - - - - - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - Nu a fost posibilă scrierea în fişierul: <br><h4> %1 </h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie! - - - - Images - Imagini - - - - QtiPlot - Import image from file - QtiPlot - Importă imagine din fişier - - - - QtiPlot - Load image from file - QtiPlot - Încarcă imagine din fişier - - - X Axis Title - Titlu axă X - - - Y Axis Title - Titlu axă Y - - - - - - Please select a Y column to plot! - Vă rugam să selectaţi o coloana de tip Y! - - - - - QtiPlot - Renamed Window - QtiPlot - Fereastra redenumită - - - - - The table '%1' already exists. It has been renamed '%2'. - Există deja un tabel cu numele '%1'. A fost redenumit '%2'. - - - - - - Notes - Note - - - - Set Image Mode - Setează mod imagine - - - - Set Data Mode - Setează mod date - - - - Show X/Y - Afişaj X/Y - - - - Show Column/Row - Afişaj Coloană/Linie - - - - Set Default Palette - Setează paletă implicită - - - - Set Gray Scale Palette - Setează scare de griuri - - - - Set Rainbow Palette - Setează paletă curcubeu - - - - Determinant of - Determinantul - - - - - - - - - - - - - - - - - - - - <h4>There are no plot layers available in this window.</h4><p><h4>Please add a layer and try again!</h4> - <h4>Nu există grafice disponibile în această fereastra.</h4><p><h4>Vă rugam adăugaţi un grafic şi încercaţi din nou!</h4> - - - - - There are no curves available on this plot! - Nu există curbe disponibile în acest grafic! - - - - - - - - - - - - - This functionality is not available for pie plots! - Această operaţie nu este disponibilă pentru graficele placintă! - - - - QtiPlot - Error bars error - QtiPlot - Eroare - - - - - This feature is not available for user defined function curves! - Această operaţie nu este disponibilă pentru funcţii! - - - - The selected columns have different numbers of rows! - Coloanele selecţionate au un număr diferit de linii! - - - - The selected error column is empty! - Coloana de bare de eroare selecţionată este goală! - - - - - - - - - - QtiPlot - File openning error - QtiPlot - Eroare de deschidere fişier - - - - The file: <b>%1</b> is the current file! - Fişierul: <b>%1</b> este fişierul curent! - - - - - - - The file: <b>%1</b> doesn't exist! - Fişierul: <b>%1</b> nu există! - - - - - You don't have the permission to open this file: <b>%1</b> - Nu aveţi permisiunea să deschideţi fişierul: <b>%1</b> - - - - - - - - - - - QtiPlot - File opening error - QtiPlot - Eroare de deschidere fişier - - - - The file <b>%1</b> is corrupted, but there exists a backup copy.<br>Do you want to open the backup instead? - Fişierul <b>%1</b> nu poate fi deschis, dar există o copie.<br>Vreţi să o deschideţi pe aceasta? - - - - - The file: <b> %1 </b> was not created using QtiPlot! - Fişierul: <b> %1 </b> nu a fost creat de QtiPlot! - - - - QtiPlot - File Open Error - QtiPlot - Eroare de deschidere fişier - - - - The file: <b> %1 </b> <p>does not exist anymore!<p>It will be removed from the list. - Fişierul: <b> %1 </b> <p>nu mai există!<p>Va fi şters din listă. - - - - The file: <p><b> %1 </b><p> is the current file! - Fişierul: <p><b> %1 </b><p> este fişierul curent! - - - - - - - - - - - - - - - - - - - - - QtiPlot - QtiPlot - - - - The file "%1" was created using "%2" as scripting language. - -Initializing support for this language FAILED; I'm using "%3" instead. -Various parts of this file may not be displayed as expected. - Fişierul "%1" a fost creat folosind ca limbaj de programare "%2". - -Iniţializarea suportului pentru acest limbaj de programare nu a fost posibilă; se foloseşte în loc limbajul "%3". -Diverse părţi din acest fişier ar putea fi afişate incorect. - - - - Window - Fereastră - - - - QtiPlot - Opening file - QtiPlot - Deschidere fişier - - - - Script Error - Eroare de programare - - - - QtiPlot - Scripting Error - QtiPlot - Eroare de programare - - - - Scripting language "%1" failed to initialize. - Limbajul de programare "%1" nu a putut fi iniţializat. - - - - QtiPlot - Open Template File - QtiPlot - Deschidere fişier model - - - - The file: <b>%1</b> is not a QtiPlot template file! - Fişierul: <b>%1</b> nu este un fişier model creat de QtiPlot! - - - - Table1 - Tabel1 - - - - QtiPlot - Export Error - QtiPlot - Eroare de export - - - - <h4>There are no plot layers available in this window!</h4> - <h4>Nu există grafice disponibile în această fereastra!</h4> - - - - Choose a directory to export the graphs to - Alegeţi un dosar în care să exportaţi graficele - - - - Output format: - Format de export: - - - - Directory: - Dosar: - - - - There are no plot layers available in window <b>%1</b>.<br>Graph window not exported! - Nu există grafice disponibile în fereastra <b>%1</b>.<br>Fereastra nu a fost exportată! - - - - - A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? - Există deja un fişier cu numele: <p><b>%1</b><p>. Vreţi să-l rescrieţi? - - - - - QtiPlot - Overwrite file? - QtiPlot - Rescriere fişier? - - - - Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! - Nu a fost posibilă scrierea în fişierul: <br><h4> %1 </h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie! - - - - Minimized - Minimizat - - - - - Maximized - Maximizat - - - - - QtiPlot project - Proiect QtiPlot - - - - - Compressed QtiPlot project - Proiect QtiPlot arhivat - - - - Save Project As - Salvează proiectul ca - - - - QtiPlot Matrix Template - Model de matrice QtiPlot - - - - QtiPlot 2D Graph Template - Model de grafic 2D QtiPlot - - - - QtiPlot Table Template - Model de tabel QtiPlot - - - - QtiPlot 3D Surface Template - Model de grafic 3D QtiPlot - - - - Save Window As Template - Salvează fereastra ca model - - - - - Please enter a valid name! - Vă rugăm introduceţi un nume valid! - - - - The name you chose is not valid: only letters and digits are allowed! - Numele ales nu este valid: sunt permise doar litere şi cifre! - - - - - - Please choose another name! - Vă rugăm alegeţi un alt nume! - - - - Name <b>%1</b> already exists! - Numele <b>%1</b> este deja utilizat! - - - - Warning: for internal consistency reasons the underscore character is replaced with a minus sign. - Avertisment: din motive legate de reprezentarea internă folosită de QtiPlot, caracterul "_" va fi înlocuit cu semnul minus '-'. - - - Choose a directory to export the tables to - Alegeţi un dosar în care să exportaţi tabelele - - - - - &Yes - &Da - - - - - - &All - &Toate - - - - - - &Cancel - &Anulează - - - - Choose a filename to save under - Alegeţi un nume de fişier - - - - QtiPlot - Enter rows number - QtiPlot - Introduceţi numărul de linii - - - - Rows - Linii - - - - - QtiPlot - Delete rows - QtiPlot - Ştergere linii - - - - Start row - Prima linie - - - - End row - Ultima linie - - - - QtiPlot - Enter columns number - QtiPlot - Introduceţi numărul de coloane - - - - Columns - Coloane - - - - - - - - - - - - - - - QtiPlot - Column selection error - QtiPlot - Eroare de selecţie a coloanei - - - - - - - - Please select a column first! - Vă rugam să selectaţi mai întâi o coloană! - - - - Please select two columns for this operation! - Vă rugam să selectaţi două coloane pentru aceasta operaţiune! - - - - Please select exactly one columns for this operation! - Vă rugăm să selectaţi o singură coloană! - - - - - Please select two columns for this operation: - the first represents the signal and the second the response function! - Va rugăm selecţionaţi două coloane pentru această operaţie: prima reprezintă semnalul şi a doua funcţia răspuns! - - - - QtiPlot - Row selection error - QtiPlot - Eroare de selecţie a liniei - - - - Please select a row first! - Vă rugam să selectaţi mai întâi o linie! - - - - - &Line - &Linie - - - - - - - &Scatter - &Simbol - - - - - Line + S&ymbol - Linie + S&imbol - - - - - Vertical &Drop Lines - Linii &verticale - - - - - &Spline - &Spline - - - - - &Vertical Steps - Trepte &verticale - - - - - &Horizontal Steps - Trepte &orizontale - - - - - - - &Columns - &Coloane - - - - - &Rows - &Linii - - - - - &Area - &Arie - - - - - &Pie - &Placintă - - - 3D Ribbo&n - Pa&nglică 3D - - - 3D &Bars - &Bare 3D - - - 3&D Scatter - &Simbol 3D - - - 3D &Trajectory - &Traiectorie 3D - - - - - &Histogram - &Histogramă - - - &Stacked Histograms - Histograme &suprapuse - - - - - - - - - Cu&t - &Taie - - - - - - - - - - - &Copy - &Copiază - - - - - Past&e - Li&peşte - - - - - - &X - &X - - - - - - &Y - &Y - - - - - - &Z - &Z - - - - - - &Label - &Etichetă - - - - - &None - &Nici una - - - - - - X E&rror - E&roare X - - - - - - Y &Error - &Eroare Y - - - - - Set As - Defineşte ca - - - - &Fill Column With - &Umplere coloană cu - - - - &Column - &Coloană - - - - - - &Normalize - &Normare - - - - - - - Clea&r - Go&leşte - - - - - - - - &Delete - Şte&rge - - - - - &Insert - &Inserază - - - - &Ascending - &Ascendent - - - - &Descending - &Descendent - - - - Sort Colu&mn - Sortare coloa&nă - - - Vectors &XYXY - Vectori &XYXY - - - - - &Vertical 2 Layers - 2 grafice &verticale - - - - - &Horizontal 2 Layers - 2 grafice &orizontale - - - - - &4 Layers - &4 grafice - - - - - &Stacked Layers - Grafice &suprapuse - - - - You need to select at least one Y column for this operation! - Trebuie să selectaţi cel puţin o coloană de tip Y pentru această operaţiune! - - - - - - You need at least two columns for this operation! - E nevoie de cel puţin două coloane pentru aceasta operaţiune! - - - - Y2 Axis Title - Titlu Axă Y2 - - - - Not available for empty 3D surface plots! - Indisponibil pentru suprafeţe 3D goale! - - - - Set Display Range - Defineşte intervalul de afişaj - - - - - - - <h4>There are no plot layers available in this window.</h4> - <h4>Nu există grafice disponibile în această fereastra.</h4> - - - - - This will modify the data in the worksheets! -Are you sure you want to continue? - Datele din tabele vor fi modificate. Sunteţi sigur că vreţi să continuaţi? - - - - - Continue - Continuă - - - - - - Cancel - Anulează - - - - Could not write to file: <h4>%1</h4><p>Please verify that you have the right to write to this location or that the file is not being used by another application! - Nu a fost posibilă scrierea în fişierul: <h4>%1</h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie sau că fişierul nu este folosit de un alt program! - - - - Sorry, there are no results to display! - Regretăm, nu există rezultate disponibile pentru afişare! - - - - There are no plot layers available in this window! - Nu există grafice disponibile în această fereastra! - - - - - - There are no layers available on this plot. Operation aborted! - Nu există grafice disponibile în această fereastra! - - - - QtiPlot - Insert image from file - QtiPlot - Inserează imagine din fişier - - - - There are no plot layers available in this window. - Nu există grafice disponibile în această fereastra. - - - - QtiPlot - Duplicate window error - QtiPlot - Eroare de duplicare - - - There are no windows available in this project! - Nu există ferestre disponibile în acest proiect! - - - - QtiPlot - Duplicate error - QtiPlot - Eroare de duplicare - - - - Empty 3D surface plots cannot be duplicated! - Suprafeţele 3D nu pot fi duplicate! - - - - - Released - Apărut - - - - About QtiPlot - Despre QtiPlot - - - - &Translate - &Translatează - - - - &Smooth - &Netezeşte - - - - &FFT filter - Filtru &FFT - - - - Fit E&xponential Decay - Ajustare e&xponenţială descrescătoare - - - - Fit &Multi-peak - Ajustare extre&me - - - - Vie&w - &Afişaj - - - - &Palette - &Paletă - - - - &Convert to Spreadsheet - &Transformă in tabel - - - - &New - &Nou - - - - &Export Graph - &Exportă grafic - - - - &Folders - &Dosare - - - - &Cascade - Aranjare in &cascadă - - - - &Tile - Aranjare pe &tot ecranul - - - - - - Close &Window - Închidere &fereastră - - - - - More windows... - Mai multe ferestre... - - - - &View Pixel Line profile - &Afişaza profilul liniei de pixeli - - - - &Intensity Matrix - Matrice de &intensitate - - - - &Cut - &Taie - - - - - - - &Properties... - &Proprietăti... - - - - Please use the project explorer to select a window! - Vă rugăm utilizaţi exploratorul de proiect pentru a selecţiona o fereastră! - - - - Normal - Normal - - - - Save changes to project: <p><b> %1 </b> ? - Salvează modificările proiectului: <p><b> %1 </b> ? - - - - - Yes - Da - - - - - No - Nu - - - - - &Show All Windows - &Arată toate ferestrele - - - - - &Hide All Windows - Ascu&nde toate ferestrele - - - - - - &Delete Selection - Sterge &selecţie - - - - - New &Window - &Fereastră nouă - - - - - New F&older - D&osar nou - - - - Auto &Column Width - Lărgime de &coloană automată - - - - &Delete Window - Şte&rge fereastra - - - - - - &Rename Window - &Redenumeşte fereastra - - - - &Print Window - Im&primă fereastra - - - - D&epending Graphs - Grafice d&ependente - - - - D&epending 3D Graphs - Grafice 3D d&ependente - - - - - - D&epends on - D&epinde de - - - - Function - Funcţie - - - - Re&move Pie Curve - Şte&rge graficul plăcintă - - - - Anal&yze - Anal&iză - - - - - &Paste Layer - Li&peşte grafic - - - - &Paste Text - Li&peşte text - - - - &Paste Tex Formula - Li&peşte formula Tex - - - - &Paste Image - Li&peşte imagine - - - - &Paste Rectangle - Li&peşte dreptunghi - - - - &Paste Ellipse - Li&peşte elipsă - - - - &Paste Line/Arrow - Li&peşte linie - - - - - - &Layer - &Grafic - - - - - - &Window - &Fereastră - - - - E&xport - E&xportă - - - - - - &Print - Im&primă - - - - P&roperties... - P&roprietăti... - - - &Delete Layer - Şterge &selecţie - - - - &Copy Page - &Copiază pagina - - - - E&xport Page - E&xportă pagina - - - - &Matrix... - &Matrice... - - - - Choose &Data Set... - Alegeţi un set de &date... - - - - Choose &Matrix... - Alegeţi o &matrice... - - - - C&lear - Go&leşte - - - - &Copy Graph - &Copiază grafic - - - - &Export - &Exportă - - - - - - - &Paste - Li&peşte - - - - - &Insert Row - &Inserează linie - - - - &Insert Column - &Inserează coloană - - - - - &Delete Rows - Şte&rge linii - - - - &Delete Columns - Şte&rge coloane - - - - &Delete Row - Şte&rge linie - - - - Clea&r Row - Go&leşte linie - - - - Clea&r Rows - Go&leşte liniile - - - - Choose the location of the QtiPlot help folder! - Alegeţi dosarul conţinand documentaţia pentru QtiPlot! - - - - QtiPlot - index.html File Not Found! - QtiPlot - Fişierul index.html nu a fost găsit! - - - - There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! - Nu există un fişier numit <b>index.html</b> în acest dosar.<br>Vă rugăm să alegeţi un alt dosar! - - - - - - QtiPlot - Help Files Not Found! - QtiPlot - Fişierele continand documentaţia nu au fost găsite! - - - - - The manual can be downloaded from the following internet address: - Manualul poate fi găsit la adresa de internet următoare: - - - - - QtiPlot - Help Profile Not Found! - QtiPlot - Fişierele continand documentaţia nu au fost găsite! - - - - - The assistant could not start because the file <b>%1</b> was not found in the help file directory! - Asistentul nu a putut fi lansat pentru că fişierul <b>%1</b> nu a fost găsit! - - - - - This file is provided with the QtiPlot manual which can be downloaded from the following internet address: - Fişierul este livrat împreună cu manualul pentru QtiPlot, care poate fi găsit la adresa de internet următoare: - - - - Please indicate the location of the help file! - Vă rugam să indicaţi locaţia fişierelor continand documentaţia! - - - - QtiPlot - Edit function - QtiPlot - Editează funcţia - - - - QtiPlot - Set the number of pixels to average - QtiPlot - Setaţi numărul de pixeli pentru medie - - - - Number of averaged pixels - Numărul de pixeli pentru medie - - - - You must have more than one layer in the active window! - Trebuie să existe cel puţin două grafice in fereastra activă! - - - - You must have more than one dataset in the active layer! - Trebuie să existe cel puţin două curbe in graficul activ! - - - - QtiPlot - Guess best origin for the new layer? - QtiPlot - Determinaţi cea mai bună poziţie pentru noul grafic? - - - - Do you want QtiPlot to guess the best position for the new layer? - Warning: this will rearrange existing layers! - Doriţi ca QtiPlot să determine cea mai bună poziţie pentru noul grafic?Avertisment: graficele existente vor fi rearanjate! - - - - &Guess - &Determină - - - - &Top-left corner - Colţul s&tang de sus - - - - Curve - Curbă - - - - Integration of %1 from zero is - Integrala setului de date %1 este - - - - - - - - Please select a 'Y' column first! - Vă rugam să selectaţi mai întâi o coloana de tip Y! - - - - Integration of %1 - Integrala setului de date %1 - - - - Area - Aria - - - - - Linear Regression of %1 - Regresie liniară a %1 - - - - - Slope - Pantă - - - - Intercept - Intersecţia cu axa absciselor - - - - - Chi^2 - Chi^2 - - - - - R^2 - R^2 - - - - - Add &Custom Script Action... - Adăugaţi o a&cţiune personalizată... - - - - - - New &Project - &Proiect - - - - - Ctrl+N - Ctrl+N - - - - - New &Graph - &Grafic - - - - - Ctrl+G - Ctrl+G - - - - - New &Note - &Notă - - - - - New &Table - &Tabel - - - - - Ctrl+T - Ctrl+T - - - - - New &Matrix - &Matrice - - - - - Ctrl+M - Ctrl+M - - - - - New &Function Plot - &Funcţie - - - - - Ctrl+F - Ctrl+F - - - - - New 3D &Surface Plot - &Suprafaţă 3D - - - - - Ctrl+ALT+Z - Ctrl+ALT+Z - - - - - &Open - &Deschide - - - - - Ctrl+O - Ctrl+O - - - - - Open Image &File - Deschide &fişier imagine - - - - - Ctrl+I - Ctrl+I - - - - - Import I&mage... - Importă i&magine... - - - - - &Save Project - &Salvează proiectul - - - - - Ctrl+S - Ctrl+S - - - - - Save Project &As... - Salvează proiectul c&a... - - - - Open Temp&late... - Deschide mode&l... - - - - - Save As &Template... - Salvează ca mode&l... - - - - Save Note As... - Salvează nota ca... - - - - - &Import ASCII... - &Importă fişier ASCII... - - - - - &Undo - An&ulează - - - - - Ctrl+Z - Ctrl+Z - - - - - &Redo - &Refă - - - - - &Duplicate - &Duplichează - - - - - Cu&t Selection - &Taie selecţia - - - - - Ctrl+X - Ctrl+X - - - - - &Copy Selection - &Copiază selecţie - - - - - Ctrl+C - Ctrl+C - - - - - &Paste Selection - Li&peşte selecţie - - - - - Ctrl+V - Ctrl+V - - - - - Del - delete key - Del - - - - - Ctrl+E - Ctrl+E - - - - - Add La&yer - Adăugare &grafic - - - - - ALT+L - ALT+L - - - - - Arran&ge Layers - Aranjază &graficele - - - - - Shift+A - Shift+A - - - - - - Automatic Layout - Aranjare automată - - - - - &Current - &Curent - - - - - - - Ctrl+Alt+G - Ctrl+Alt+G - - - - - Alt+X - Alt+X - - - - - &Export PDF - &Exportă in format PDF - - - - - Ctrl+Alt+P - Ctrl+Alt+P - - - - - Ctrl+P - Ctrl+P - - - - - Print All Plo&ts - Imprimă toate &graficele - - - - - E&xport ASCII - E&xportă fişier ASCII - - - - - &Quit - În&chide - - - - - Ctrl+Q - Ctrl+Q - - - - - Clear &Log Information - Şterge rezu&ltatele - - - - - Delete &Fit Tables - Şterge tabelele de &ajustare - - - - - Plot &Wizard - &Asistent grafic - - - - - Ctrl+Alt+W - Ctrl+Alt+W - - - - - &Preferences... - O&pţiuni... - - - - - Add/Remove &Curve... - Adaugă/Şterge &Curbă... - - - - - ALT+C - ALT+C - - - - - Add &Error Bars... - Adaugă bare de &eroare... - - - - - Ctrl+B - Ctrl+B - - - - - Add &Function... - Adaugă &funcţie... - - - - - - - Ctrl+Alt+F - Ctrl+Alt+F - - - - - &Rescale to Show All - &Afişază toate datele - - - - - - Ctrl+Shift+R - Ctrl+Shift+R - - - - - New &Legend - Nouă &legendă - - - - - Ctrl+L - Ctrl+L - - - - - Add Time Stamp - Adăugare dată/timp - - - - - Ctrl+ALT+T - Ctrl+ALT+T - - - - - Add &Image - Adăugare &imagine - - - - - ALT+I - ALT+I - - - - - Vectors XY&AM - Vectori XY&AM - - - - &Vectors &XYXY - &Vectori &XYXY - - - - - &Stacked Histogram - Histograme &suprapuse - - - - - D&ouble-Y - D&ouă axe Y - - - - - &Zoom - &Mărire zonă - - - - - E&xtract to Graphs - E&xtrage ferestre - - - - Extract to &Layers - Extrage &grafice - - - - - Add Inset Layer - Adăugare grafic interior - - - - - &Ribbon - &Panglică - - - - - &Bars - &Bare - - - - - &Trajectory - &Traiectorie - - - - - Statistics on &Columns - Statistici &coloane - - - - - Statistics on &Rows - Statistici &linii - - - - - &Integrate - &Integrează - - - - - Integr&ate Function... - Integr&ează funcţie... - - - - - Inte&rpolate ... - Inte&rpolează ... - - - - - &Low Pass... - Trece &jos... - - - - - &High Pass... - Trece &sus... - - - - - &Band Pass... - Trece &bandă... - - - - - &Band Block... - B&lochează bandă... - - - - - &FFT... - &FFT... - - - - - &Savitzky-Golay... - &Savitzky-Golay... - - - - - &FFT Filter... - Filtru &FFT... - - - - - Moving Window &Average... - &Medie... - - - - - &Differentiate - &Diferenţiază - - - - - Fit &Linear - Ajustare &liniară - - - - - Fit &Polynomial ... - Ajustare &polinomială... - - - - - &First Order ... - Ordinul &unu... - - - - - &Second Order ... - Ordinul &doi... - - - - - &Third Order ... - Ordinul &trei... - - - - - Fit Exponential Gro&wth ... - Ajustare exponenţială &crescătoare... - - - - - Fit &Boltzmann (Sigmoidal) - Ajustare &Boltzmann (Sigmoidal) - - - - - Fit &Gaussian - Ajustare &Gaussiană - - - - - Fit Lorent&zian - Ajustare Lorent&z - - - - - Fit &Wizard... - &Asistent de ajustare de date... - - - - - Ctrl+Y - Ctrl+Y - - - - - &Plot ... - &Grafic ... - - - - - &Scales... - &Scale... - - - - - &Axes... - &Axe... - - - - - &Grid ... - &Grilaj ... - - - - - &Title ... - &Titlu ... - - - - - Column &Options ... - &Opţiuni coloană ... - - - - - Ctrl+Alt+O - Ctrl+Alt+O - - - - - Set Column &Values ... - Calcul &valori ... - - - - - - - Alt+Q - Alt+Q - - - - - Recalculate - Recalculează - - - - - - - Ctrl+Return - Ctrl+Return - - - - - &Hide Selected - &Ascunde selecţia - - - - - Sho&w All Columns - Afişază &toate coloanele - - - - - &Swap columns - Inver&sează coloanele - - - - - Move &Right - Mută la d&reapta - - - - - Move &Left - Mută la &stânga - - - - - Move to F&irst - Mută la înce&put - - - - - Move to Las&t - Mută la sfarşi&t - - - - - &Columns... - &Coloane... - - - - - &Rows... - &Linii... - - - - - &Delete Rows Interval... - Şte&rge linii... - - - - - &About QtiPlot - &Despre QtiPlot - - - - - F1 - F1 - - - - - Ctrl+H - Ctrl+H - - - - - &Choose Help Folder... - Alegeţi dosarul cu do&cumentaţia... - - - - - Ctrl+W - Ctrl+W - - - - - - Add Column - Adaugă coloană - - - - - &Go to Row... - Mer&gi la linia... - - - - - Go to Colum&n... - Mergi la coloa&na... - - - - - Ctrl+Alt+C - Ctrl+Alt+C - - - - - Clear - Goleşte - - - - - &Remove Layer - Şte&rge grafic - - - - - Alt+R - Alt+R - - - - - Window &Geometry... - &Geometrie... - - - - - - - &Hide Window - Ascu&nde fereastra - - - - - - - Ctrl+Alt+H - Ctrl+Alt+H - - - - - &View Pixel Line Profile - &Trasează profilul liniei de pixeli - - - - - &Intensity Table - Tabel de &intensităţi - - - - - - - &Properties - &Proprietăţi - - - - - &Activate Window - &Activează fereastra - - - - - Mi&nimize Window - &Minimizează fereastra - - - - - Ma&ximize Window - Ma&ximizează fereastra - - - - - Re&size Window... - Redimen&sionează fereastra... - - - - - &Surface... - &Suprafaţă... - - - - - &Data Set... - Set de &date... - - - - - Set &Properties... - &Proprietăti... - - - - - Set &Dimensions... - &Dimensiuni... - - - - - Ctrl+D - Ctrl+D - - - - - Set &Values... - &Valori... - - - - - &Image Plot - Grafic &imagine - - - - - &Transpose - &Transpune - - - - - Flip &V - Întoarce &Vertical - - - - Ctrl+Shift+V - Ctrl+Shift+V - - - - - Flip &H - Întoarce &Orizontal - - - - Ctrl+Shift+H - Ctrl+Shift+H - - - - - R&otate 90 - R&oteşte 90 - - - - - Rotate &-90 - Roteşte &-90 - - - - - Ctrl+Alt+R - Ctrl+Alt+R - - - - - &Invert - &Inversează - - - - - &Determinant - &Determinant - - - - - &Image mode - Mod &imagine - - - - Ctrl+Shift+I - Ctrl+Shift+I - - - - - &Data mode - Mod &date - - - - Ctrl+Shift+D - Ctrl+Shift+D - - - - - Show &X/Y - Afişaj &X/Y - - - - Ctrl+Shift+X - Ctrl+Shift+X - - - - - Show &Column/Row - Afişaj &Coloană/Linie - - - - Ctrl+Shift+C - Ctrl+Shift+C - - - - - - &Gray Scale - Scară de &griuri - - - - - &Default - &Implicită - - - - - &Rainbow - Cu&rcubeu - - - - - &Custom - &Personalizată - - - - - &Export Image ... - E&xportă imagine... - - - - - - - &Direct - &Direct - - - - - &XYZ Columns - Coloane &XYZ - - - - - &YXZ Columns - Coloane &YXZ - - - - &Forward FFT - &FFT Directă - - - - &Inverse FFT - FFT &Inversă - - - - Convert to &Matrix - Transformă in &matrice - - - - - Dra&g Curve - Tra&ge curba - - - - &Import - &Importă - - - - You must select a single Y column that has an associated X column! - Trebuie să selectaţi o coloană de tip Y care are asociată o coloană de tip X! - - - - You must select exactly one Z column! - Trebuie să selectaţi o singură coloană de tip Z! - - - - Open File - Deschide fişier - - - - Imported sound file - Importă fişier de sunet - - - - This is not a PCM type WAV file, operation aborted! - Acesta nu este un fişier WAV de tip PCM, operaţiunea a fost abandonată! - - - - PCM - PCM - - - - - Time - Timp - - - - Left - Stânga - - - - Right - Dreapta - - - - Data - Date - - - - Channels - Canale - - - - Sample Rate - Eşantionare - - - - Byte Rate - Număr de biţi - - - - Block Align - Aliniere bloc - - - - Bits Per Sample - Numărul de biţi pe eşantion - - - - Presentation Preview - Previzualizare prezentare - - - - &Save - &Salvează - - - - There are no windows available in this folder! - Nu există ferestre disponibile în acest dosar! - - - - - &Sound (WAV)... - &Sunet (WAV)... - - - - - Create Open &Document Presentation... - Crează &document de prezentare... - - - - - &Close - În&chide - - - - - &Lowess... - - - - - - 2D &Binning - Histo&gramă 2D - - - - - &Regular XYZ - &Reţea regulată XYZ - - - - - 3D &Wire Frame - Sar&ma 3D - - - - - 3D &Hidden Line - 3D linie &ascunsă - - - - - 3D &Polygons - &Poligoane 3D - - - - - 3D Wire &Surface - &Suprafaţă 3D - - - - Contour - &Color Fill - Contour şi &culoare - - - - - Contour &Lines - &Linii de contour - - - - - &Gray Scale Map - Scară de &griuri - - - - - Sort Ta&ble - Sortare ta&bel - - - - - Sort Columns - Sortare coloane - - - - - Co&rrelate - Co&relare - - - - - &Autocorrelate - &Autocorelare - - - - - &Convolute - &Convoluţie - - - - - &Deconvolute - &Deconvoluţie - - - - - &Horizontal - &Orizontal - - - - - &Vertical - &Vertical - - - - - Ro&w Numbers - Indice &linie - - - - - &Random Values - Valori aleato&rii - - - - - &Frequency Count ... - Numără &frecvenţa de apariţie... - - - - - &Read Only - Doa&r citire - - - - - &Disregard - I&gnoră - - - - - &Box Plot - Grafic &cutie - - - - - &Gaussian... - Ajustare &Gaussiană... - - - - - &Lorentzian... - Ajustare &Lorentz... - - - - - Search for &Updates - Caută act&ualizări - - - - - &QtiPlot Homepage - Pagina de internet &QtiPlot - - - - QtiPlot &Forums - &Forumuri dedicate QtiPlot - - - - - Report a &Bug - Semnalează o &eroare - - - - - Download &Manual - Obţine &manualul - - - - - &Translations - &Traduceri - - - - - Make a &Donation - &Donează - - - - - Technical &Support - &Suport tehnic - - - - - Scripting &language - &Limbaj de programare - - - - - &Restart scripting - &Reinitializează limbajul de programare - - - - - E&xecute - E&xecută - - - - - Ctrl+J - Ctrl+J - - - - - Execute &All - Execută &tot - - - - - Ctrl+Shift+J - Ctrl+Shift+J - - - - - &Evaluate Expression - &Evaluează expresia - - - - - Show Line &Numbers - Afişază &numărul liniei - - - - - Find &Next - Caută apariţia &următoare - - - - - F3 - F3 - - - - - Find &Previous - Caută apariţia &precedentă - - - - - F4 - F4 - - - - - &Replace... - În&locuieşte... - - - - - Increase Indent - Măreşte identarea - - - - - Decrease Indent - Micşorează identarea - - - - - Rena&me Tab... - Rede&numeşte fila... - - - - - A&dd Tab - A&daugă filă - - - - - C&lose Tab - Închidere &fila - - - - - &Script Window - Ferea&stră programare - - - - - &Plot details... - &Detalii grafic... - - - - - &Worksheet - &Tabel - - - - - &Reset to Full Range - &Afişaza toate datele - - - - - Edit &Range... - Editează Inte&rval... - - - - - &Hide - Ascu&nde - - - - - Hide &Other Curves - Ascunde &celelelte curbe - - - - - &Show All Curves - Afişază &toate curbele - - - - - &Edit Function... - &Editează funcţia... - - - - - &Toolbars... - Bare de unel&te... - - - - - Ctrl+Shift+T - Ctrl+Shift+T - - - - - Bold - Gros - - - - - Italic - Italic - - - - Superscript - Exponent - - - - Subscript - Indice - - - - - Underline (Ctrl+U) - Subliniază (Ctrl+U) - - - - - Ctrl+U - Ctrl+U - - - - - - - Greek - Alfabet grec - - - - - Mathematical Symbols - Simboluri matematice - - - - Increase Precision - Măreşte precizia - - - - Decrease Precision - Micşorează precizia - - - - Open a new project - Proiect nou - - - - New Fol&der - &Dosar - - - - Create a new folder - Creează un dosar nou - - - - Create an empty 2D plot - Creză un grafic 2D gol - - - - Create an empty note window - Creză o fereastră de note - - - - New table - Tabel nou - - - - New matrix - Matrice nouă - - - - Create a new 2D function plot - Creză un grafic de funcţie 2D - - - - Create a new 3D surface plot - Creză o suprafaţă 3D - - - - Open project - Deschide proiect - - - - Save project - Salvează proiectul - - - - Open Te&mplate... - Deschide &model... - - - - Open template - Deschide model - - - - Save window as template - Salvează fereastra ca model - - - - Import data file(s) - Importă fişier(e) de date - - - - Ctrl+K - Ctrl+K - - - - Undo changes - Anulează modificările - - - - Redo changes - Refă modificările - - - - Duplicate window - Duplicheză fereastra - - - - Cut selection - Taie selecţie - - - - Copy selection - Copiază selecţie - - - - Paste selection - Lipeşte selecţie - - - - Delete selection - Sterge selecţie - - - - Project &Explorer - &Explorator de proiect - - - - Show project explorer - Afişază exploratorul de proiect - - - - Results &Log - Rezu&ltate - - - - Show analysis results - Afişază rezultatele analizei - - - - &Undo/Redo Stack - Listă de &modificări reversibile - - - - Show available undo/redo commands - Afişază lista de modificări reversibile - - - - &Console - &Consolă - - - - Show Scripting console - Afişază consola de programere - - - - Script Window - Fereastră programare - - - - Add Layer - Adaugă grafic - - - - Arrange Layers - Aranjază graficele - - - - Export current graph - Exportă graficul curent - - - - Export all graphs - Exportă toate graficele - - - - Export to PDF - Exportă in format PDF - - - - Print window - Imprimă fereastra - - - - Print preview - Previzualizare tipărire - - - - Add curve to graph - Adaugă curbă - - - - Add Error Bars... - Adaugă bare de eroare... - - - - Add Function... - Adaugă funcţie... - - - - Best fit - Afişază toate datele - - - - Add new legend - Adaugă legendă - - - - Date & time - Dată & timp - - - - Add Image - Adaugă imagine - - - - Plot as line - Trasează cu linie - - - - Plot as symbols - Trasează cu simboluri - - - - Plot as line + symbols - Trasează cu linie şi simboluri - - - - Plot with vertical bars - Trasează cu bare verticale - - - - Plot with horizontal bars - Trasează cu bare orizontale - - - - Plot area - Trasează ca suprafaţă - - - - Plot pie - Trasează placintă - - - - &Vectors XYXY - &Vectori XYXY - - - - Vectors XYXY - Vectori XYXY - - - - Vectors XYAM - Vectori XYAM - - - - Double Y Axis - Două axe Y - - - - Zoom - Mărire zonă - - - - Extract to Graphs - Extrage ferestre - - - - Extract to Layer&s - Extrage &grafice - - - - Extract to Layers - Extrage grafice - - - - Plot 3D ribbon - Trasează panglică 3D - - - - Plot 3D bars - Trasează bare 3D - - - - Plot 3D scatter - Trasează cu simboluri 3D - - - - Plot 3D trajectory - Trasează traiectorie 3D - - - - Contour + &Color Fill - Contour şi &culoare - - - - Contour Lines + Color Fill - Linii de contour + culoare - - - - Contour Lines - Linii de contour - - - - Gray Scale Map - Scară de griuri - - - - Selected columns statistics - Statistici pentru coloanele selectate - - - - Selected rows statistics - Statistici pentru liniile selectate - - - - Hide selected columns - Ascunde coloanele selectate - - - - Show all table columns - Afişază toate coloanele din tabel - - - - Swap selected columns - Inversează coloanele selectate - - - - Move Right - Mută la dreapta - - - - Move Left - Mută la stânga - - - - Move to First - Mută la început - - - - Move to Last - Mută la sfarşit - - - - More Windows... - Mai multe ferestre... - - - - Set Matrix Values - Calculează valorile matricii - - - - Image Plot - Grafic imagine - - - - Rotate 90 Clockwise - Roteşte cu 90° în sens orar - - - - Rotate 90 Counterclockwise - Roteşte cu 90° în sens anti-orar - - - - Flip Vertically - Întoarce vertical - - - - Flip Horizontally - Întoarce orizontal - - - - Fill selected columns with row numbers - Umple coloanele selectate cu indicele de linie - - - - Fill selected columns with random numbers - Umple coloanele selectate cu numere aleatorii - - - - Set column as X - Defineşte coloană de tip X - - - - Set column as Y - Defineşte coloană de tip Y - - - - Set column as Z - Defineşte coloană de tip Z - - - - Set as Y Error Bars - Defineşte ca bare de eroare în Y - - - - Set as Labels - Defineşte ca etichete - - - - Disregard Columns - Ignoră coloanele - - - - Box and whiskers plot - Grafic tip cutie cu mustăţi - - - - Visit QtiPlot &Forums - Vizitează &forumurile dedicate QtiPlot - - - - Show find dialog - Dialog căutare - - - - Find Next - Caută apariţia următoare - - - - Find Previous - Caută apariţia precedentă - - - - Show replace dialog - Dialog înlocuire - - - - Disable &tools - Dezactivare unel&te - - - - Pointer - Dezactivare unelte - - - - Zoom In - Mărire - - - - Zoom &Out - Micş&orare - - - - Zoom Out - Micşorare - - - - Data reader - Cititor de date - - - - Select data range - Setează intervalul de date - - - - Screen reader - Coordonate ecran - - - - Draw Data Points - Desen date - - - - Move data points - Modificare date - - - - Drag Curve - Trage curba - - - - Remove data points - Stergere date - - - - Add Text - Adăugare text - - - - Add Equation - Adăugare ecuaţie - - - - Add Rectangle - Adăugare dreptunghi - - - - Add Ellipse/Circle - Adăugare elipsă/cerc - - - - Draw arrow - Desenează săgeată - - - - Draw line - Desenează linie - - - - - - - Box - Cutie - - - - - - Frame - Bordură - - - - &Frame - &Bordură - - - - - No Axes - Fără axe - - - - - No axes - Fără axe - - - - Front grid - Grilaj faţă - - - - Back grid - Grilaj spate - - - - Right grid - Grilaj dreapta - - - - Left grid - Grilaj stânga - - - - Ceiling grid - Grilaj tavan - - - - Floor grid - Grilaj podea - - - - - - - Wireframe - - - - - - Hidden Line - Linie ascunsă - - - - - Hidden line - Linie ascunsă - - - - - Polygon Only - Numai poligoane - - - - - Polygon only - Numai poligoane - - - - - Mesh & Filled Polygons - Linie şi poligoane - - - - - Mesh & filled Polygons - Linie şi poligoane - - - - - - - Dots - Puncte - - - - - - - Bars - Bare - - - - - - - Cones - Conuri - - - - - - - Crosshairs - Cruci - - - - - Floor Data Projection - Proiecţie podea - - - - - Floor data projection - Proiecţie podea - - - - - Floor Isolines - Proiecţie izolinii - - - - - Floor isolines - Proiecţie izolinii - - - - - Empty Floor - Fără proiecţie - - - - - Empty floor - Fără proiecţie - - - - - - - Animation - Animaţie - - - - - - - Enable perspective - Perspectivă - - - - - - - Reset rotation - Resetează rotaţia - - - - - - - Fit frame to window - Ajustează graficul la dimensiunile ferestrei - - - - QtiPlot - Enter the number of peaks - QtiPlot - Introduceţi numărul de extreme - - - - Peaks - Extreme - - - - Memory Allocation Error - Eroare de alocare a memoriei - - - - Not enough memory, operation aborted! - Memorie insuficientă, operaţia a fost abandonată! - - - - - Set Precision %1 digits - %1 cifre semnificative - - - <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> - - <font size=+2, color = darkBlue><b>QtiPlot est un soft liber a cărui dezvoltare a necesitat sute de ore de muncă.<br><br> Dacă vă place, îl utilizaţi în activitatea dumneavoastră şi aţi dori să fie îmbunătaţit in mod constant, vă rugăm sprijiniţi-i pe autorii lui făcand o donaţie.</b></font> - - - - <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> If you like it, you're using it in your work and you would like to see it constantly improved, please support its authors by making a donation.</b></font> - <font size=+2, color = darkBlue><b>QtiPlot est un soft liber a cărui dezvoltare a necesitat sute de ore de muncă.<br><br> Dacă vă place, îl utilizaţi în activitatea dumneavoastră şi aţi dori să fie îmbunătaţit in mod constant, vă rugăm sprijiniţi-i pe autorii lui făcand o donaţie.</b></font> - - - - Please support QtiPlot! - Vă rugăm sprijiniţi dezvoltarea proiectului QtiPlot! - - - - <b> %1 </b>: This command line option must be used without other arguments! - <b> %1 </b>: Această comandă trebuie folosită fără argumente! - - - - Version - Versiune - - - - Usage - Utilizare - - - - options - opţiuni - - - - - file - fişier - - - - - name - nume - - - - Valid options are - Opţiunile valide sunt - - - - - - - - - - - or - sau - - - - show about dialog and exit - afişază mesajul de informare despre QtiPlot - - - - start QtiPlot with the default settings - porneşte QtiPlot cu setările din fabrică - - - - show command line options - afişază opţiunile disponibile în linia de comandă - - - - start QtiPlot in language - porneşte QtiPlot în limba - - - - show QtiPlot manual in a standalone window - afişază manualul într-o fereastră de sine stătătoare - - - - print QtiPlot version and release date - afişaza versiunea si data de apariţie - - - - execute the script file given as argument - execută fişierul de cod introdus ca argument - - - - execute the script file given as argument without displying the user interface. Warning: 2D plots are not correctly handled in this functioning mode! - execută fişierul de cod introdus ca argument fără a afişa interfaţa grafică. Avertisment: graficele 2D nu funcţionează corect in acest mod de operare! - - - - can be any .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py or ASCII file - poate fi orice fişier .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py sau ASCII - - - - Help - Ajutor - - - - <b> %1 </b>: Wrong locale option or no translation available! - <b> %1 </b>: Parametrii regionali specificaţi sunt incorecţi sau traducerea nu este încă disponibilă! - - - - <b> %1 </b> unknown command line option! - <b> %1 </b> opţiune invalidă! - - - - Type %1 to see the list of the valid options. - Scrieţi %1 pentru a vedea lista opţiunilor valide. - - - - <b>%1</b> is a directory, please specify a file name! - <b>%1</b> este un dosar, vă rugăm să specificaţi un nume de fişier! - - - - The file: <b>%1</b> is not a QtiPlot or Origin project file! - Fişierul: <b>%1</b> nu este un fişier creat folosind QtiPlot sau OriginLab! - - - - QtiPlot - Demo Version - QtiPlot - Versiune de test - - - You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. - Folosiţi versiunea de demonstraţie a programului Qtiplot. Este identică cu versiunea integrală, exceptand faptul că nu puteţi salva proiectele deschise si nu poate fi utilizat mai mult de 10 minute pe sesiune. <br><br> Dacă doriţi să instalaţi versiunea integrala, vă rugăm să suscrieţi la<a href="http://soft.proindependent.com/individual_contract.html">un contract de mentenanţă</a>. <br><br> QtiPlot este un program liber. Dacă doriţi, puteţi obtine gratis <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">codul sursă</a>. <a href="http://soft.proindependent.com/why_donate.html">Donaţiile</a> în vederea sprijinirii dezvoltării programului QtiPlot sunt binevenite. - - - - QtiPlot - File backup error - QtiPlot - Eroare de salvare a fişerului - - - - Cannot make a backup copy of <b>%1</b> (to %2).<br>If you ignore this, you run the risk of <b>data loss</b>. - Nu a fost posibilă crearea unei copii de siguranţă pentru fişierul <b>%1</b> (în %2).<br>Daca ignoraţi acest mesaj riscaţi<b>să pierdeţi date</b>. - - - - QtiPlot - File save error - QtiPlot - Eroare de salvare a fişerului - - - - The file: <br><b>%1</b> is opened in read-only mode - Fişierul: <br><b>%1</b> este accesibil doar pentru citire - - - - Save project as - Salvează proiectul ca - - - - - - - &Find... - &Caută... - - - - - App&end Project... - Adaugă proi&ect... - - - - show standalone scripting window - - - - - Save &As Project... - Salvează c&a proiect... - - - - &Delete Folder - Şte&rge dosar - - - - &Rename - &Redenumeşte - - - - &Windows in Active Folder - &Ferestrele din dosarul activ - - - - Windows in &Active Folder && Subfolders - Ferestrele din dosarul &activ şi din dosarele conţinute de acesta - - - - &View Windows - Afişază &ferestrele - - - - Hidden - Ascuns - - - - Name already exists! - Acest nume e deja folosit! - - - - Project - Proiect - - - - - - Path - Cale - - - - bytes - biţi - - - - - Contents - Conţinut - - - - - windows - ferestre - - - - - folders - dosare - - - - Modified - Modificat - - - - - - Properties - Proprietăţi - - - - New Folder - Dosar - - - - QtiPlot - Delete folder? - QtiPlot - Şterge dosarul? - - - - Delete folder '%1' and all the windows it contains? - Şterge dosarul '%1' şi toate ferestrele pe care le conţine? - - - - - Note - Notă - - - - - 3D Graph - Grafic 3D - - - - Status - Statut - - - - QtiPlot - No match found - QtiPlot - Căutare fără rezultat - - - - Sorry, no match found for string: '%1' - Ne pare rău, nu a fost găsit nici un rezultat pentru şirul de caractere: '%1' - - - - Cannot move an object to itself! - Un obiect nu poate fi mutat în el însuşi! - - - - Cannot move a parent folder into a child folder! - Un dosar nu poate fi mutat intr-un dosar pe care îl conţine! - - - - Skipped moving folder - Dosarul nu a fost mutat - - - - - The destination folder already contains a folder called '%1'! Folder skipped! - Dosarul de destinaţie conţine deja un dosar numit '%1'! Dosarul a fost sărit! - - - - - - Error - Eroare - - - - QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! - QtiPlot va încerca să aducă informaţia necesară despre ultima versiune disponibilă. Vă rugăm să permiteţi conectarea la internet! - - - - Do you wish to continue? - Doriţi să continuaţi? - - - - QtiPlot - HTTP get version file - QtiPlot - Acces la informaţia despre ultima versiune folosind HTTP - - - - Error while fetching version file with HTTP: %1. - Eroare de acces la fişierul cu informaţii despre ultima versiune disponibilă folosind HTTP: %1. - - - - QtiPlot - Updates Available - QtiPlot - Actualizare disponibilă - - - - There is a newer version of QtiPlot (%1) available for download. Would you like to download it? - Există o versiune mai nouă (%1) pentru QtiPlot. Vreţi să o instalaţi? - - - - QtiPlot - No Updates Available - QtiPlot - Nu s-au găsit actualizări - - - - No updates available. Your current version %1 is the last version available! - Nu e disponibilă o versiune mai nouă. Versiunea dumneavoastră %1 este ultima versiune disponibilă! - - - - This will clear the contents of all the data associated with the table. Are you sure? - Toate seturile de date asociate cu acest tabel vor fi şterse. Sunteţi sigur? - - - - &No - &Nu - - - - QtiPlot - Enter row number - QtiPlot - Introduceţi numărul liniei - - - - Row - Linie - - - - QtiPlot - Enter column number - QtiPlot - Introduceţi numărul coloanei - - - - - QtiPlot was not built with Python scripting support included! - QtiPlot nu a fost compilat cu suport pentru limbajul de programare Python! - - - - Please set a default X column for this table, first! - Vă rugăm să definiţi mai întâi o coloană de tip X pentru acest tabel! - - - - Please select a Z column for this operation! - Vă rugăm să selectaţi o coloană de tip Z pentru această operaţie! - - - - You need to define a X column first! - Vă rugam să definiţi mai întâi o coloana de tip X! - - - - You need to define a Y column first! - Vă rugam să definiţi mai întâi o coloana de tip Y! - - - - Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. - Începând cu versiunea 0.9.1 QtiPlot salveaza funcţiile de ajustare definite de utilizator într-un alt loc. - - - - If you want to save your already defined models, please choose a destination folder. - Dacă doriţi să salvaţi funcţiile de ajustare create, vă rugăm să alegeţi un dosar. - - - - Import fit models - Importă funcţii de ajustare - - - - Choose a directory to export the fit models to - Alegeţi un dosar în care să exportaţi funcţiile de ajustare - - - - - No Icon - Fără icoană - - - - Couldn't load file: %1. -Autocompletion will not be available! - Fişierul: %1 nu a putut fi încărcat.Sugestiile de completare automată nu vorfi disponibile! - - - - Please select exactly one column and more than one non empty cell! - Vă rugăm să selectaţi o singură coloană si cel puţin două celule cu conţinut valid! - - - - English - Română - - - - - Ctrl+Shift+S - Ctrl+Shift+ - - - Stem and &Leaf Plot - Grafic tulpină cu &frunze - - - - Data set: %1 doesn't exist! - Setul de date %1 nu există! - - - - Stem and leaf plot of dataset - Grafic tulpină cu frunze a setului de date - - - - from row - de la linia - - - - to row - la linia - - - - Not enough memory for this dataset! - Memorie insuficientă pentru acest set de date! - - - - Stem - Tulpină - - - - Leaf - Frunze - - - - Please confirm the stem unit! - Vă rugam să confirmaţi unitatea de măsură pentru tulpină! - - - - Data set - Set de date - - - - stem unit - unitate pentru tulpină - - - - Stem unit - Unitate pentru tulpină - - - - Leaf unit - Unitate pentru frunze - - - - Key - Legendă - - - - means - înseamnă - - - - Input error: empty data set! - Eroare: setul de date este vid! - - - - Stem-and-Leaf Plot - Grafic tulpină cu frunze - - - - - Stem-and-&Leaf Plot - Grafic tulpină cu &frunze - - - - F&ormat - F&ormat - - - Menu Bar - Bara de meniu - - - - Alt+C - Alt+C - - - - - Zoom &In/Out and Drag Canvas - Măr&ire/Micşorare şi Translaţie - - - - Zoom In (Shift++) or Out (-) and Drag Canvas - Mărire (Shift++) / Micşorare (-) şi Translaţie - - - - - Fit Slop&e - Aju&stare pantă - - - - You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://soft.proindependent.com/download.html">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. - Folosiţi versiunea de demonstraţie a programului Qtiplot. Este identică cu versiunea integrală, exceptand faptul că nu puteţi salva proiectele deschise si nu poate fi utilizat mai mult de 10 minute pe sesiune. <br><br> Dacă doriţi să instalaţi versiunea integrala, vă rugăm să suscrieţi la<a href="http://soft.proindependent.com/individual_contract.html">un contract de mentenanţă</a>. <br><br> QtiPlot este un program liber. Dacă doriţi, puteţi obtine gratis <a href="http://soft.proindependent.com/download.html">codul sursă</a>. <a href="http://soft.proindependent.com/why_donate.html">Donaţiile</a> în vederea sprijinirii dezvoltării programului QtiPlot sunt binevenite. - - - - &Add - &Adaugă - - - - - Ctrl+Alt+D - Ctrl+Alt+D - - - - &Waterfall Plot - Gra&fic cascadă - - - - &Indexed Colors - Culori &indexate - - - - Pale&tte - &Paletă - - - - Make a donation - Donează - - - - Close - Închide - - - - - - Spec&ial Bar/Column - Linii/Coloane spec&iale - - - - - Stack &Bar - Stivă &Linii - - - - - Stack &Column - Stivă &Coloane - - - - Plot stack bar - Desenează stivă de linii - - - - Plot stack column - Desenează stivă de coloane - - - - - Move Row - Mută linia - - - - Print preview of window: - Previzualizare tipărire fereastră: - - - - - Print Pre&view - &Previzualizare tipărire - - - - - Ad&just Column Width - A&justează lăţimea coloanei - - - - - &Upward - În &sus - - - - - &Downward - În &jos - - - - Append a project to the current folder - Adaugă un proiect in dosarul curent - - - - Ctrl+Alt+A - Ctrl+Alt+A - - - - Move current row upward - Mută linia curentă în sus - - - - Move current row downward - Mută linia curentă în jos - - - - Set optimal column width - Lăţimea optimă a coloanei - - - - ArrowMarker - - - dx - dx - - - - dy - dy - - - - angle - unghi - - - - length - lungime - - - - - eqn - ecuaţie - - - - y - y - - - - - x - x - - - - AssociationsDialog - - - QtiPlot - Plot Associations - QtiPlot - Asociaţii de date - - - - Spreadsheet: - Tabel: - - - - Column - Coloană - - - - X - X - - - - Y - Y - - - - - xErr - xErr - - - - - yErr - yErr - - - - &Update curves - Act&ualizează curbele - - - - &OK - &OK - - - - &Cancel - &Anulează - - - - xEnd - xEnd - - - - yEnd - yEnd - - - - Angle - Unghi - - - - Magn. - Magnitude, vector length - Magnitudine - - - - AxesDialog - - - QtiPlot - General Plot Options - QtiPlot - Opţiuni generale ale graficului - - - - &Apply - &Aplică - - - - &OK - &OK - - - - &Cancel - A&nulează - - - - - From - De la - - - - - To - Pană la - - - - - Type - Tip - - - linear - liniară - - - logarithmic - logaritmică - - - - Inverted - Inversată - - - - Show Axis &Break - Afişază &întrerupere - - - - Draw Break &Decoration - &Desenează simbol de întrerupere - - - - Position - Poziţie - - - - % of Axis Length - % din lungimea axei - - - - - Width - Lăţime - - - - pixels - pixeli - - - - &Log10 Scale After Break - Scală &Log10 după întrerupere - - - - Step Before Break - Pas înainte de întrerupere - - - - - Guess - Determină - - - - Step After Break - Pas după întrerupere - - - - Minor Ticks Before - Diviziuni secundare înainte - - - - Minor Ticks After - Diviziuni secundare după - - - - Step - Pas - - - - - Major Ticks - Diviziuni principale - - - - - Minor Ticks - Diviziuni secundare - - - - - - Bottom - Jos - - - - - - Left - Stânga - - - - - - Top - Sus - - - - - - Right - Dreapta - - - - Scale - Scală - - - - Major Grids - Grilaj principal - - - - Minor Grids - Grilaj secundar - - - - Line Color - Culoare - - - - Line Type - Tip de linie - - - - Thickness - Grosime - - - - - Axes - Axe - - - - Additional lines - Linii suplimentare - - - - X=0 - X=0 - - - - Y=0 - Y=0 - - - - Apply To - Aplică formatul - - - - This Layer - Graficului - - - - This Window - Ferestrei - - - - - - All Windows - Tuturor ferestrelor - - - - An&tialised - Linie ne&tă - - - - Horizontal - Orizontal - - - - Vertical - Vertical - - - - Grid - Grilaj - - - - Show - Afişază - - - - Title - Titlu - - - - Distance to axis - Distanţa pană la axă - - - - &Font - &Font - - - - - Format - Format - - - - Numeric - Numeric - - - - Text from table - Text din tabel - - - - Day of the week - Zi a săptămanii - - - - Month - Lună - - - - Time - Timp - - - - Date - Dată - - - - Column Headings - Titlu coloană - - - - Font - Font - - - - Axis &Font - &Fontul axei - - - - - - Color - Culoare - - - - - None - Nici una - - - - - Out - Exterioare - - - - - In & Out - Interioare & Exterioare - - - - - In - Interioare - - - - Stand-off - Distanţă - - - - Apply &to - Aplică forma&tul - - - - - Axis - Axe - - - - - Layer - Graficului - - - - - Window - Fereastrei - - - - Show Labels - Afişază etichete - - - - Column - Coloană - - - - Table - Tabel - - - - - Precision - Precizie - - - - Angle - Unghi - - - - For&mula - For&mulă - - - - Canvas frame - Bordură - - - - Draw backbones - Desenează linia principală - - - - Line Width - Grosimea liniei - - - - Major ticks length - Lungimea diviziunilor principale - - - - Minor ticks length - Lungimea diviziunilor secundare - - - - Set As &Default - &Defineşte ca format implicit - - - - Apply &to... - Aplică forma&tul... - - - - General - General - - - - Automatic - Automat - - - Decimal: 100.0 - Zecimal: 100.0 - - - Scientific: 1e2 - Ştiinţific: 1e2 - - - Scientific: 10^2 - Ştiinţific: 10^2 - - - - QtiPlot - Formula input error - QtiPlot - Eroare în formula introdusă - - - - Valid variables are 'x' for Top/Bottom axes and 'y' for Left/Right axes! - Variabilele valide sunt 'x' pentru axa de sus/jos şi 'y' pentru axa stangă/dreaptă! - - - - days - zile - - - - weeks - săptămani - - - - millisec. - millisec. - - - - sec. - sec. - - - - min. - min. - - - - hours - ore - - - - Decimal: 10000.0 - Zecimal: 10000.0 - - - - Probability - Probabilitate - - - - Logit - Logit - - - - Scientific: 1e4 - Ştiinţific: 1e4 - - - - Scientific: 1x10^4 - Ştiinţific: 1x10^4 - - - - Engineering: 10k - Ingineresc: 10k - - - - - Origin - Origine - - - - &Inverted - &Inversată - - - - Linear - Liniară - - - - Log10 - Log10 - - - - ln - ln - - - - Log2 - Log2 - - - - Reciprocal - Reciprocă - - - - ColorBox - - - black - negru - - - - red - roşu - - - - green - verde - - - - blue - albastru - - - - cyan - turcoaz - - - - magenta - magenta - - - - yellow - galben - - - - dark yellow - galben închis - - - - navy - albastru marin - - - - purple - purpuriu - - - - wine - vişiniu - - - - olive - verde măsliniu - - - - dark cyan - turcoaz închis - - - - royal - albastru regal - - - - orange - portocaliu - - - - violet - violet - - - - pink - roz - - - - white - alb - - - - light gray - gri deschis - - - - gray - gri - - - - light yellow - galben deschis - - - - light cyan - turcoaz deschis - - - - light magenta - magenta deschis - - - - dark gray - gri închis - - - - ColorButton - - - Custom - Personalizată - - - - ColorMapDialog - - - QtiPlot - QtiPlot - - - - Custom Color Map - Personalizare culori - - - - &Apply - &Aplică - - - - &Close - În&chide - - - - Set Custom Palette - Setează paletă utilizator - - - - ColorMapEditor - - - Level - Nivel - - - - Color - Culoare - - - - &Insert - &Inserează - - - - &Delete - Şte&rge - - - - &Scale Colors - &Gradient de culoare - - - - ColorMapPreviewDialog - - - QtiPlot - Color Map Preview Dialog - QtiPlot - Dialog de previzualizare a paletelor de culoare - - - - Colormap files - Fişiere conţinând palete de culoare predefinite - - - - All files - Toate fişierele - - - - << &Preview - << &Previzualizare - - - - - - - None - Paletă nedefinită - - - - ColorPickerPopup - - - Custom - Personalizată - - - - ConfigDialog - - - The column separator can be customized. -The following special codes can be used: -\t for a TAB character -\s for a SPACE - Separatorul de coloane poate fi personalizat. Următoarele coduri speciale pot fi folosite: -\t pentru caracterul TAB -\s pentru SPAŢIU - - - - The separator must not contain the following characters: -0-9eE.+- - Separatorul de coloane nu trebuie să conţină caracterele următoare: 0-9eE.+- - - - - - - Background - Fundal - - - - - Background Color - Culoare de fundal - - - - - - - Opacity - Opacitate - - - - - Canvas Color - Culoarea suprafeţei - - - - - Border Color - Culoare de bordură - - - - - - - Width - Lăţime - - - - LF (Unix) - LF (Unix) - - - - CRLF (Windows) - CRLF (Windows) - - - - CR (Mac) - CR (Mac) - - - - - - - System Locale Setting - Setările regionale ale calculatorului - - - - &B - &B - - - - &It - &Italic - - - - - Translations - Traduceri - - - - - Help - Documentaţie - - - - - Python Configuration Files - Fişiere de configurare Python - - - - QtiPlot - Choose default settings - QtiPlot - Definiţi opţiunile implice - - - - General - General - - - - - Tables - Tabele - - - - - 2D Plots - Grafice 2D - - - - - 3D Plots - Grafice 3D - - - - Notes - Note - - - - Fitting - Ajustare de date - - - - Options - Opţiuni - - - - Curves - Curbe - - - - Ticks - Diviziuni - - - - - - Fonts - Fonturi - - - - Do not &resize layers when window size changes - Nu &redimensiona graficele când dimeniunea ferestrei se schimbă - - - - &Disable in-place editing - &Dezactivează editarea directă a textelor - - - - - Length - Lungime - - - - Axes linewidth - Grosimea axei - - - - Major Ticks - Diviziuni principale - - - - Minor Ticks - Diviziuni secundare - - - - Margin - Margine - - - - Axes title space - Distanţa titlu-axe - - - - Frame width - Grosimea bordurii - - - - Axes &backbones - Linia &principală a axelor - - - - Canvas Fra&me - &Bordură - - - Sho&w all axes - Afişază toate a&xele - - - - Show &Title - Afişază &titlul - - - - Scale &Fonts - Redimensionare &fonturi - - - - Auto&scaling - &Scală automată - - - - Antia&liasing - &Linii nete - - - - Legend display - Legenda afisază - - - - Column name - Nume coloană - - - - Column comment - Comentariu coloană - - - - Table name - Nume tabel - - - - Table legend - Legendă tabel - - - - - Transparent - Transparent - - - - - None - Nici una - - - - - Out - Exterior - - - - - In & Out - Interior & Exterior - - - - - In - Interior - - - - Print - Imprimare - - - - Print Crop&marks - Imprimă &liniile ajutătoare pentru decupaj - - - - &Scale layers to paper size - Aju&stează graficele la dimensiunile hârtiei - - - - Prompt on closing - Cere confirmare la închidere - - - - Folders - Dosare - - - - Matrices - Matrici - - - - &Notes - &Note - - - - &OK - &OK - - - - &Cancel - A&nulează - - - - &Apply - &Aplică - - - - &Text Font - Font pentru &text - - - - &Labels Font - Font &Etichete - - - - A&xes Labels - Tit&luri axe - - - - Axes &Numbers - &Numerele de pe axe - - - - &Legend - &Legendă - - - - T&itle - T&itlu - - - - Prompt on &renaming tables when appending projects - Confirmă &redenumirea tabelelor la adăugarea unui proiect - - - - Application - Program - - - - Confirmations - Confirmări - - - - - - Colors - Culori - - - - Numeric Format - Format numeric - - - - File Locations - Amplasament fişiere - - - - Language - Limbă - - - - - - Style - Stil - - - - Main Font - Font principal - - - - Choose &font - Alegeţi &font - - - - Workspace - Spaţiu de lucru - - - - Panels text - Text în panouri - - - - Panels - Panouri - - - - Save every - Salvează la fiecare - - - - &Backup project before saving - Creează copie de si&guranţă înainte de salvare - - - - Check for new versions at startup - Verificaţi la pornire dacă există versiuni mai recente - - - - minutes - minute - - - - Default scripting language - Limbaj de programare implicit - - - - Matrix Undo Stack Size - Mărimea listei de modificări pentru matrici - - - - Endline character - Caracter de sfărşit de linie - - - - Start New Project - Proiectele noi conţin - - - - - Empty - Nimic - - - - Table - Tabel - - - - Matrix - Matrice - - - - Empty Graph - Grafic 2D vid - - - - Note - Notă - - - - &Enable autocompletion (Ctrl+U) - Activează sug&estiile de completare (Ctrl+U) - - - - Number of Decimal Digits - Cifre semnificative - - - - Decimal Separators - Separatori zecimali - - - - Omit &Thousands Separator - Ignoră separa&torul de mii - - - - Clipboard Decimal Separators - Separatori zecimali pentru copiere/lipire - - - - Automatically &Recalculate Column Values - &Recalculeză automat valorile coloanei - - - - &Display Comments in Header - A&fişază comentariile - - - - Default Column Separator - Separator de coloane implicit - - - - - - - TAB - TAB - - - - - - - SPACE - SPAŢIU - - - - Text - Text - - - - - Labels - Etichete - - - - - Grids - Grilaj - - - - - Ma&jor Grids - Grila&j principal - - - - - Mi&nor Grids - Grilaj secu&ndar - - - - - Color - Culoare - - - - Default curve style - Stil de curbă implicit - - - - Line width - Grosimea liniei - - - - Symbol size - Dimensiune simbol - - - - Line - Linie - - - - Scatter - Simbol - - - - Line + Symbol - Linie + Simbol - - - - Vertical drop lines - Linii verticale - - - - Spline - Spline - - - - Vertical steps - Trepte verticale - - - - Horizontal steps - Trepte orizontale - - - - Area - Suprafaţă - - - - Vertical Bars - Bare verticale - - - - Horizontal Bars - Bare orizontale - - - - &Resolution - &Rezoluţie - - - - (all data shown) - (afişază toate datele) - - - - &Show Legend - Afişază &legenda - - - - &Floor style - Stil &proiecţie - - - - Isolines - Izolinii - - - - Projection - Proiecţie - - - - Smoot&h Line - L&inie netă - - - - O&rthogonal - Or&togonal - - - - Lab&els - &Etichete - - - - &Mesh - &Linie - - - - &Grid - &Grilaj - - - - - - &Numbers - Nume&re - - - - A&xes - A&xe - - - - &Background - &Fundal - - - - Default Color Map - Paletă de culori implicită - - - - &Title - &Titlu - - - - &Axes Labels - &Etichetele axelor - - - - Autosca&ling - Sca&lă automată - - - - - Solid - Solid - - - - - Dash - Linie - - - - - Dot - Punct - - - - - Dash Dot - Linie Punct - - - - - Dash Dot Dot - Linie Punct Punct - - - - - Short Dash - Linie Scurtă - - - - - Short Dot - Punct Scurt - - - - - Short Dash Dot - Linie Punct Scurte - - - - Tab length (pixels) - Lungimea caracterului TAB (pixeli) - - - - Font - Font - - - - &Display line numbers - Afişază numărul &liniei - - - - Syntax Highlighting - Colorare sintactică - - - - Co&mments - Co&mentarii - - - - &Keywords - Cu&vinte cheie - - - - &Quotations - &Ghilimele - - - - &Functions - &Funcţii - - - - Q&t Classes - Cla&se Qt - - - - Generated Fit Curve - Curba de ajustare generată - - - - Uniform X Function - Funcţie de X uniformă - - - - Points - Puncte - - - - Same X as Fitting Data - Aceleaşi abscise ca datele sursă - - - - 2 points for linear fits - Doar 2 puncte pentru ajustările liniare - - - - - Display Peak Curves for Multi-peak Fits - Trasează curbele extremelor - - - - Parameters Output - Rezultate parametri - - - - Significant Digits - Cifre semnificative - - - - Write Parameters to Result Log - Scrie rezultatele în istoric - - - - Paste Parameters to Plot - Afişază rezultatele în grafic - - - - Scale Errors with sqrt(Chi^2/doF) - Multiplică erorile cu sqrt(Chi^2/doF) - - - - Peaks Color - Culoare extreme - - - - QtiPlot - Import options error - QtiPlot - Eroare în opţiunile de import - - - - The separator must not contain the following characters: 0-9eE.+- - Separatorul de coloane nu trebuie să conţină caracterele următoare: 0-9eE.+- - - - - Choose the location of the QtiPlot translations folder! - Alegeţi dosarul conţinând traducerile pentru QtiPlot! - - - - Choose the location of the Python configuration files! - Alegeţi dosarul conţinând fişierele de configurare pentru Python! - - - - Axes - Axe - - - - Left - Stânga - - - - Right - Dreapta - - - - Bottom - Jos - - - - Top - Sus - - - - Enabled axes - Axe afişate - - - - Show - Afişază - - - - - QtiPlot - index.html File Not Found! - QtiPlot - Fişierul index.html nu a fost găsit! - - - - There is no file called <b>index.html</b> in folder %1.<br>Please choose another folder! - Nu există un fişier numit <b>index.html</b> în dosarul %1.<br>Vă rugăm să alegeţi un alt dosar! - - - - - QtiPlot - Folder Not Found! - QtiPlot - Dosarul nu a fost găsit! - - - - The folder %1 doesn't exist.<br>Please choose another folder! - Dosarul %1 nu există.<br>Vă rugăm să alegeţi un alt dosar! - - - - %1 is not a folder.<br>Please choose another folder! - %1 nu este un dosar.<br>Vă rugăm să alegeţi un alt dosar! - - - - Choose the location of the QtiPlot help folder! - Alegeţi dosarul conţinand documentaţia pentru QtiPlot! - - - - There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! - Nu există un fişier numit <b>index.html</b> în acest dosar.<br>Vă rugăm să alegeţi un alt dosar! - - - - - QtiPlot - QtiPlot - - - - You don't have read access rights to folder %1.<br>Please choose another folder! - Nu aveţi drepturi de citire pentru dosarul %1.<br>Vă rugăm să alegeţi un alt dosar! - - - - - &Internet Connection - Conectare la &internet - - - - - &Proxy - &Proxy - - - - - Host - Gazdă - - - - - Port - Port - - - - - Username - Utilizator - - - - - Password - Parolă - - - - LaTeX Compiler - Compilator LaTeX - - - - Choose the location of the LaTeX compiler! - Vă rugam să indicaţi locaţia compilatorului LaTeX! - - - - - QtiPlot - File Not Found! - QtiPlot - Fişierul nu a fost găsit! - - - - The file %1 doesn't exist.<br>Please choose another file! - Fişierul %1 nu există.<br>Vă rugăm să alegeţi un alt fişier! - - - - %1 is a folder.<br>Please choose a file! - %1 este un dosar.<br>Vă rugăm să alegeţi un fişier! - - - - You don't have read access rights to file %1.<br>Please choose another file! - Nu aveţi drepturi de citire pentru fişierul %1.<br>Vă rugăm să alegeţi un alt fişier! - - - - ContourLinesEditor - - - Level - Nivel - - - - Pen - Creion - - - - &Insert - &Inserează - - - - &Delete - Şte&rge - - - - QtiPlot - Edit pen - QtiPlot - Editare creion - - - - Color - Culoare - - - - - - Apply to all - Aplică tuturor - - - - Style - Stil - - - - Width - Lăţime - - - - &Ok - &OK - - - - &Close - În&chide - - - - Convolution - - - Convolution - Convoluţie - - - - - - - - QtiPlot - QtiPlot - - - - - - - - Error - Eroare - - - - The signal data set %1 does not exist! - Setul de date %1 nu există! - - - - The response data set %1 does not exist! - Setul de date %1 reprezentând funcţia de răspuns nu există! - - - - The response dataset '%1' must be less then half the size of the signal dataset '%2'! - Setul de date %1 reprezentând funcţia de răspuns trebuie să aibă un număr de puncte mai mic decât jumătate din numărul punctelor din setul de date reprezentând semnalul '%2'! - - - - The response dataset '%1' must contain an odd number of points! - Setul de date %1 reprezentând funcţia de răspuns trebuie să conţină un număr impar de puncte! - - - - Could not allocate memory, operation aborted! - Memorie insuficientă, operaţia a fost abandonată! - - - - - Index - Index - - - - Correlation - - - Correlation - Corelare - - - - - - QtiPlot - QtiPlot - - - - - - Error - Eroare - - - - - The data set %1 does not exist! - Setul de date %1 nu există! - - - - Error in GSL forward FFT operation! - Librăria GSL a generat o eroare în timpul operaţiei FFT directe! - - - - - Lag - Lag - - - - CreateBinMatrixDialog - - - - QtiPlot - QtiPlot - - - - Bin Matrix Dialog - Dimensiuni matrice - - - - &OK - &OK - - - - &Cancel - &Anulează - - - - X-min - X-minim - - - - X-max - X-maxim - - - - Columns - Coloane - - - - Y-min - Y-minim - - - - Y-max - Y-maxim - - - - Rows - Linii - - - - Input Size Error - Eroare în dimensiunile introduse - - - - The dimensions you have specified are not acceptable! - Dimensiunile specificate nu pot fi acceptate! - - - - Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! - Va rugăm să introduceţi valori pozitive pentru care produsul linii*coloane nu depaşeşte valoare maximă permisă de sistemul dumneavoastră de operare pentru un număr întreg ! - - - - CurveRangeDialog - - - QtiPlot - Plot range - QtiPlot - Interval de afişare - - - - Data set: - Set de date: - - - - From row number - De la linia cu numărul - - - - To row number - La linia cu numărul - - - - &OK - &OK - - - - &Close - În&chide - - - - CurvesDialog - - - QtiPlot - Add/Remove curves - QtiPlot - Adaugă/Şterge curbe - - - - New curves style - Stilul noilor curbe - - - - Line - Linie - - - - Scatter - Simbol - - - - Line + Symbol - Linie + Simbol - - - - Vertical drop lines - Linii verticale - - - - Spline - Spline - - - - Vertical steps - Trepte verticale - - - - Horizontal steps - Trepte orizontale - - - - Area - Suprafaţă - - - - Vertical Bars - Bare verticale - - - - Horizontal Bars - Bare orizontale - - - - Histogram - Histogramă - - - - Contour - Color Fill - Linii de contour + culoare - - - - Contour Lines - Linii de contour - - - - Gray Scale Map - Scară de griuri - - - - Histogram - Histogramă - - - - Available data - Seturi de date disponibile - - - - Graph contents - Conţinutul graficului - - - - &Plot Associations... - &Asocieri de date... - - - - Edit &Range... - Editează inte&rvalul... - - - - &Edit Function... - &Editează funcţia... - - - - OK - OK - - - - Close - Închide - - - - &Show Range - Afişază &intervalul - - - - Show current &folder only - Afişază doar conţinutul dosarului &curent - - - - &Plot Selection - &Trasează selecţia - - - - &Plot - &Trasează - - - - &Delete Selection - Sterge &selecţia - - - - &Delete Curve - Şterge cur&ba - - - - CustomActionDialog - - - - - - - - - - - - - QtiPlot - QtiPlot - - - - Add Custom Action - Adăugaţi o acţiune personalizată - - - - Folder - Dosar - - - - Choose &Folder - Alegeţi &dosar - - - - Script File - Fişier conţinând codul executabil - - - - Choose &Script - Alegeţi &fişier - - - - Icon - Icoană - - - - Choose &Icon - Alegeţi &icoana - - - - - Text - Titlu - - - - Tool Tip Text - Scurt text informativ - - - - Shortcut - Secvenţă de taste - - - - &Menu - &Meniu - - - - &Tool Bar - Bara de unel&te - - - - &Save - &Salvează - - - - &Add - &Adaugă - - - - &Remove - Şte&rge - - - - &Close - În&chide - - - - - - - - - - Error - Eroare - - - - Please provide a description for your custom action! - Vă rugăm să furnizaţi o descriere pentru acţiunea personalizată! - - - - Dot characters are not allowed in the description text! - Caracterul punct nu este admis în descriere! - - - - You have already defined an action having description: %1 <br>Please provide a different description text! - Aţi definit deja o acţiune având descrierea: %1 <br>Vă rugăm să furnizaţi o descriere diferită! - - - - The file you have specified doesn't exist, please choose a valid script file! - Fişierul specificat nu există, vă rugăm să alegeţi un fişier validl! - - - - The image file you have specified doesn't exist or can't be read, please choose another file! - Fişierul imagine specificat nu există sau nu poate fi citit, vă rugăm să alegeţi un alt fişier! - - - - Please provide a different key sequence! The following shortcut key sequences are already assigned: - Vă rugăm să introduceţi o altă secvenţă de taste! Următoarele secvenţe sunt deja utilizate: - - - - Are you sure you want to remove this action? - Sunteţi sigur că vreţi să ştergeţi această acţiune personalizată? - - - - Remove Action - Şterge acţiunea - - - - - File Save Error - Eroare de salvare a fişerului - - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - Nu a fost posibilă scrierea în fişierul: <br><h4> %1 </h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie! - - - Images - Imagini - - - - QtiPlot - Load icon from file - QtiPlot - Încarcă imagine din fişier - - - - Choose script file - Alegeţi fişier sursă executabil - - - - Choose the custom actions folder - Alegeţi dosarul conţinând acţiunile personalizate - - - &New Menu - A&daugă meniu - - - - &Delete Menu - Şter&ge meniul - - - - Python Script - Script Python - - - - All Files - Toate fişierele - - - - Add menu - Adaugă meniu - - - - Menu title: - Titlul meniului: - - - - Please, choose the location of the new menu - Vă rugam să indicaţi locaţia noului meniu - - - - Menu: - Meniu: - - - Thers's already a menu item with this title, please choose another title! - Există deja un meniu cu acest titlu, vă rugăm să alegeţi un alt titlu! - - - - Remove Menu - Ştergere meniu - - - - Are you sure you want to remove menu '%1' and all its actions? - Sunteţi sigur că vreţi să ştergeţi meniul '%1' şi toate acţiunile pe care le conţine? - - - - &New Menu... - Adaugă me&niu... - - - - - Menu Bar - Bara de meniu - - - - There's already a menu item with this title, please choose another title! - Există deja un meniu cu acest titlu, vă rugăm să alegeţi un alt titlu! - - - - DataPickerTool - - - Click on plot or move cursor to display coordinates! - Daţi click pe grafic sau mişcaţi cursorul pentru a afişa coordonatele! - - - - Please, click on plot and move cursor! - Vă rugăm, daţi click pe grafic şi mişcaţi cursorul! - - - - Select point and double click to remove it! - Selectaţi un punct şi efectuaţi un dublu-click pentru a-l şterge! - - - - QtiPlot - Remove point error - QtiPlot - Eroare de ştergere a punctului - - - - Sorry, but removing points of a function is not possible. - Ne pare rău, dar nu este posibil să ştergeţi puncte aparţinând unei funcţii. - - - - - - - QtiPlot - Warning - QtiPlot - Avertisment - - - - - This operation cannot be performed on curves plotted from columns having a non-numerical format. - Această operaţie nu poate fi efectuată pentru curbe ce utilizează ca surse de date coloane având un format diferit de cel numeric. - - - - QtiPlot - Move point error - QtiPlot - Eroare de mutare a punctului - - - - Sorry, but moving points of a function is not possible. - Ne pare rău, dar nu este posibil să mutaţi puncte aparţinând unei funcţii. - - - - - The column '%1' is read-only! Please choose another curve! - Coloana '%1' nu poate fi modificată! Vă rugăm să alegeţi o altă curbă! - - - - DataSetDialog - - QtiPlot - Select data set - QtiPlot - Alegeţi setul de date - - - &OK - &OK - - - &Cancel - &Anulează - - - - Deconvolution - - - Deconvolution - Deconvoluţie - - - - Differentiation - - - - Derivative - Derivata - - - - of - Derivative of - a - - - - DrawPointTool - - - Draw - Desenează - - - - EnrichmentDialog - - - - - - QtiPlot - QtiPlot - - - - Tex Equation Editor - Editor de ecuaţii Tex - - - - Clea&r - Go&leşte - - - - Window Geometry - Geometria ferestrei - - - - Object Properties - Proprietăţile obiectului - - - - &Apply - &Aplică - - - - &Close - În&chide - - - - Preview: - Previzualizare: - - - - - &Text - &Text - - - - - Color - Culoare - - - - &Font - &Font - - - - Background - Fundal - - - - - Opacity - Opacitate - - - - - Transparent - Transparent - - - - Rotate (deg.) - Roteşte (grade) - - - - Auto-&update - Auto-act&ualizează - - - - TeX &Output - Sinta&xă TeX - - - - - - Set As &Default - &Defineşte ca format implicit - - - - Apply format &to... - Aplică forma&tul... - - - - - - Object - Obiectului - - - - - - Layer - Graficului - - - - - - Window - Fereastrei - - - - - - All Windows - Tuturor ferestrelor - - - - File - Fişier - - - - &Save internally - &Salvează in proiect - - - - &Image - &Imagine - - - - Shape - Formă - - - - None - Fără bordură - - - - Line - Linie - - - - Rectangle - Dreptunghi - - - - Shadow - Umbră - - - - Line Style - Stil linie - - - - - Width - Lăţime - - - - - Apply t&o... - Aplică f&ormatul... - - - - &Frame - &Bordură - - - - Fill Color - Culoare de umplere - - - - Pattern - Model - - - - Pattern Color - Culoare model - - - - Use &Frame Color - &Foloseşte culoarea bordurii - - - - Fill &Pattern - Model de um&plere - - - - Page - Pagină - - - - Layer Scales - Axe de coordonate - - - - Attach to - Ataşază la - - - - inch - ţol - - - - mm - mm - - - - cm - cm - - - - point - punct - - - - pixel - pixel - - - - scale - scară - - - - Unit - Unitate - - - - Position - Poziţie - - - - X - X - - - - Y - Y - - - - Size - Dimensiuni - - - - Height - Înălţime - - - - &Keep aspect ratio - &Păstrează aspectul - - - - &Best size - &Dimensiuni indicate - - - - &Geometry - &Geometrie - - - - Network connection error - Eroare de conectare la internet - - - - Error while trying to connect to host %1: - Eroare în timpul încercării de conectare la %1: - - - - Please verify your network connection! - Vă rugam să verificaţi conexiunea la internet! - - - - QtiPlot - Import image from file - QtiPlot - Importă imagine din fişier - - - - QtiPlot - Warning - QtiPlot - Avertisment - - - - The file %1 doesn't exist. The image cannot be restored when reloading the project file! - Fişierul %1 nu există! Imaginea nu va putea fi afişată cand veţi redeschide proiectul! - - - - MathTran (http://www.mathtran.org/) - MathTran (http://www.mathtran.org/) - - - - locally installed - instalat local - - - - LaTeX Compiler - Compilator LaTeX - - - - Compile process ended - Procesul de compilare a luat sfârşit - - - - Compiling process ended with exit code: %1 - Procesul de compilares-a terminat cu codul: %1 - - - - LaTeX compile process - Procesul de compilare LaTeX - - - - dvipng process - procesul dvipng - - - - - failed to start! - nu a putut începe! - - - - Please verify that you have dvipng installed in the same folder as your LaTeX compiler! - Vă rugăm să verificaţi ca dvipng este instalat în acelaşi dosar cu compilatorul LaTeX! - - - - crashed - distrus - - - - timedout - oprit - - - - write error - eroare de scriere - - - - read error - eroare de citire - - - - unknown error - eroare necunoscută - - - - Compile error - Eroare de compilare - - - - Please set the correct path to the compiler in the preferences dialog! - Vă rugăm să specificaţi locaţia corectă pentru compilator in dialogul "Opţiuni..."! - - - - ErrDialog - - - - Source of errors - Sursă - - - - QtiPlot - Error Bars - QtiPlot - Bare de eroare - - - - &X Error Bars - Bare de eroare în &X - - - - &Add - &Adaugă - - - - Add Error Bars to - Adaugă bare de eroare curbei - - - - Percent of data (%) - &Procent din date (%) - - - - Standard Deviation of Data - &Deviaţia standard - - - - &Y Error Bars - Bare de eroare în &Y - - - - &Close - În&chide - - - - Existing column - Coloană &existentă - - - - ExpDecayDialog - - - QtiPlot - Verify initial guesses - QtiPlot - Verificare valori iniţiale - - - - Exponential Fit of - Ajusează exponenţial curba - - - - Growth time - Durata de viaţă - - - - Decay time - Durata de viaţă - - - - First decay time (t1) - Prima durată de viaţă (t1) - - - - Second decay time (t2) - A doua durată de viaţă (t2) - - - - Third decay time (t3) - A treia durată de viaţă (t3) - - - - Amplitude - Amplitudine - - - - Y Offset - Constantă Y - - - - Initial time - Timp iniţial - - - - Color - Culoare - - - - &Fit - &Ajustează - - - - &Close - În&chide - - - - QtiPlot - Warning - QtiPlot - Avertisment - - - - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - Curba <b> %1 </b> nu mai există! Operaţiunea a fost abandonată! - - - - ExponentialFit - - - ExpGrowth - CreştereExp - - - - Exponential growth - Creştere exponenţială - - - - - amplitude - amplitudine - - - - lifetime - durata de viaţă - - - - - offset - constantă - - - - ExpDecay1 - ScădereExp1 - - - - Exponential decay - Scădere exponenţială - - - - e-folding time - durata de viaţă (1/e) - - - - ExportDialog - - - QtiPlot - Export ASCII - QtiPlot - Exportă ASCII - - - - Table - Tabel - - - - &All - &Toate - - - - Separator - Separator - - - - - - - - TAB - TAB - - - - - - - - SPACE - SPAŢIU - - - - - The column separator can be customized. The following special codes can be used: -\t for a TAB character -\s for a SPACE - Separatorul de coloane poate fi personalizat. Următoarele coduri speciale pot fi folosite: -\t pentru caracterul TAB -\s pentru SPAŢIU - - - - - - The separator must not contain the following characters: 0-9eE.+- - Separatorul de coloane nu trebuie să conţină caracterele următoare: 0-9eE.+- - - - - Include Column &Names - Include &numele coloanelor - - - - Include Column Co&mments - Include &comentariile - - - - Export &Selection - Exportă &selecţie - - - - QtiPlot - Export error - QtiPlot - Eroare de export - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - Nu a fost posibilă scrierea în fişierul: <br><h4> %1 </h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie! - - - &OK - &OK - - - &Cancel - &Anulează - - - - &Help - Aju&tor - - - - QtiPlot - Help - QtiPlot - Ajutor - - - - QtiPlot - Import options error - QtiPlot - Eroare în opţiunile de import - - - - ExtensibleFileDialog - - - << &Advanced - << Opţiuni &Avansate - - - - FFT - - - - - - - FFT - Transformată Fourier rapidă - - - QtiPlot - QtiPlot - - - Error - Eroare - - - Could not allocate memory, operation aborted! - Memorie insuficientă, operaţia a fost abandonată! - - - - - Forward - Directă - - - - - - - of - a - - - - - - Frequency - Frecvenţă - - - - - Inverse - Inversă - - - - - - Time - Timp - - - - - Real - Real - - - - - Imaginary - Imaginar - - - - - - - Amplitude - Amplitudine - - - - - Angle - Unghi - - - - Hz - Hz - - - - s - s - - - - FFTDialog - - - QtiPlot - FFT Options - QtiPlot - Opţiuni pentru transformata Fourier rapidă (FFT) - - - - &Forward - Transformată &directă - - - - &Inverse - Transformată &inversă - - - - Curve - Curbă - - - - Sampling - Eşantionare - - - - Real - Real - - - - Imaginary - Imaginar - - - - - Sampling Interval - Interval de eşantionare - - - - &Normalize Amplitude - &Normează amplitudinea - - - - &Shift Results - &Rearanjază rezultatele - - - - &OK - &OK - - - - &Close - În&chide - - - - QtiPlot - Error - QtiPlot - Eroare - - - - Please choose a column for the real part of the data! - Vă rugăm să alegeţi o coloană reprezentând partea reală a datelor! - - - - QtiPlot - QtiPlot - - - - The two matrices have different dimensions, the imaginary part will be neglected! - Cele două matrici au dimensiuni diferite, partea imaginară va fi ignorată! - - - - RealMatrixFFT - MatriceRealăFFT - - - - Real part of the FFT transform of - Partea reală a transformatei Fourier rapide a - - - - ImagMatrixFFT - MatriceImaginarăFFT - - - - Imaginary part of the FFT transform of - Partea imaginară a transformatei Fourier rapide a - - - - AmplitudeMatrixFFT - MatriceAmplitudiniFFT - - - - Amplitudes of the FFT transform of - Amplitudinea transformatei Fourier rapide a - - - - FFTFilter - - - FFT - Transformată Fourier rapidă - - - - Filtered - Filtrat(ă) - - - - - QtiPlot - QtiPlot - - - - - Error - Eroare - - - - Unknown filter type. Valid values are: 1 - Low pass, 2 - High Pass, 3 - Band Pass, 4 - Band block. - Tip de filtru necunoscut! Valorile valide sunt: 1 - Trece jos, 2 - Trece sus, 3 - Trece bandă, 4 - Blochează bandă. - - - - Please enter different values for the band limits. - Vă rugam să introduceţi valori diferite pentru limitele benzii. - - - - to - la - - - - Hz - Hz - - - - Low Pass FFT Filter - Filtru FFT trece jos - - - - High Pass FFT Filter - Filtru FFT trece sus - - - - Band Pass FFT Filter - Filtru FFT trece bandă - - - - Band Block FFT Filter - Filtru FFT blochează bandă - - - - Filter - - - - - - - - QtiPlot - QtiPlot - - - - - - - - Error - Eroare - - - - Please assign a curve first! - Vă rugam să selectaţi mai întâi o coloană! - - - - Several data points have the same x value causing divisions by zero, operation aborted! - Mai multe puncte au aceeaşi abscisă, ceea ce duce la operaţii de împărţire la zero. Operaţia a fost abandonată! - - - - - You need at least %1 points in order to perform this operation! - Aveţi nevoie de cel puţin %1 puncte pentru a efectua această operaţia! - - - - QtiPlot - Filter Error - QtiPlot - Eroare de filtrare - - - - Please enter a valid curve name! - Vă rugăm introduceţi un nume de curbă valid! - - - - QtiPlot - Color Name Error - QtiPlot - Eroare detectată în numele culorii - - - - The color name '%1' is not valid, a default color (red) will be used instead! - Numele culorii '%1' nu este valid, se va folosi o culoare implicită (roşu)! - - - - You didn't specify a valid data set for this operation! - Nu aţi specificat un set de date valid pentru această operaţie! - - - - of - a - - - - Plot - Grafic - - - - Memory Allocation Error - Eroare de alocare a memoriei - - - - Not enough memory, operation aborted! - Memorie insuficientă, operaţia a fost abandonată! - - - - FilterDialog - - - QtiPlot - Filter options - QtiPlot - Opţiuni de filtrare - - - - Filter curve: - Filtrează curba: - - - - Frequency cutoff (Hz) - Frecvenţă de tăiere (Hz) - - - - Low Frequency (Hz) - Limita de jos (Hz) - - - - High Frequency (Hz) - Limita de sus (Hz) - - - - Add DC Offset - Adaugă componenta continuă - - - - Substract DC Offset - Scade componenta continuă - - - - - Color - Culoare - - - - &Filter - &Filtrează - - - - &Close - În&chide - - - - QtiPlot - Frequency input error - QtiPlot - Eroare detectată în frecvenţa introdusă - - - - Please enter frequency limits that satisfy: Low < High ! - Vă rugam să introduceţi limite care satisfac condiţia: frecvenţa joasă < frecvenţa înaltă ! - - - - FindDialog - - - QtiPlot - QtiPlot - - - - - Find - Caută - - - - Start From - Începe de la - - - - Search in - Cauta în - - - - &Window Names - &Numele ferestrelor - - - - Window &Labels - &Etichetele ferestrelor - - - - Folder &Names - Numele &dosarelor - - - - Case &Sensitive - Căutare &sensibilă la majuscule - - - - &Partial Match Allowed - &Potrivire parţială - - - - &Include Subfolders - &Include dosarele - - - - &Find - Cau&tă - - - - &Update Start Path - Act&ualizează calea de pornire - - - - &Close - În&chide - - - - FindReplaceDialog - - - - - QtiPlot - QtiPlot - - - - - Find - Caută - - - - Find and Replace - Caută şi înlocuieşte - - - - Replace with - Înlocuieşte cu - - - - &Match case - Sensibil la &majuscule - - - - &Whole word - Cu&vant întreg - - - - &Next - &Următorul - - - - &Previous - &Precedentul - - - - &Replace - În&locuieşte - - - - Replace &all - Înlocuieşte &tot - - - - &Close - În&chide - - - - - - Empty Search Field - Şirul de caractere căutat este vid - - - - - - The search field is empty. Please enter some text and try again. - Şirul de caractere căutat este vid. Vă rugăm introduceţi un şir de caractere şi încercaţi din nou. - - - - QtiPlot has finished searching the document. - QtiPlot a terminat de căutat în document. - - - - Fit - - - Plot - Grafic - - - - graphics display disabled - afişaj grafic dezactivat - - - - of dataset - a setului de date - - - - using function - folosind funcţia - - - - Weighting Method - Metodă de ponderare - - - - No weighting - Fără ponderare - - - - Instrumental - Instrumentală - - - - using error bars dataset - folosind bare de eroare din setul de date - - - - Statistical - Statistică - - - - Arbitrary Dataset - Set de date arbitrar - - - - Direct Weighting using Dataset - Ponderare directă folosind setul de date - - - - Nelder-Mead Simplex - Nelder-Mead Simplex - - - - Unscaled Levenberg-Marquardt - Levenberg-Marquardt nescalat - - - - Scaled Levenberg-Marquardt - Levenberg-Marquardt scalat - - - - algorithm with tolerance = - algoritm cu toleranţa = - - - - From x - De la x - - - - to x - până la x - - - - - R^2 - R^2 - - - - Adjusted R^2 - R^2 ajustat - - - - RMSE (Root Mean Squared Error) - RMSE (Eroarea pătratică medie) - - - - RSS (Residual Sum of Squares) - RSS (Suma reziduală a pătratelor) - - - - Iterations - Iteraţii - - - - Status - Statut - - - - Dataset - Set de date - - - - Function - Funcţie - - - - - - - QtiPlot - Error - QtiPlot - Eroare - - - - You cannot use the instrumental weighting method. - Nu puteţi folosi metoda de ponderare instrumentală. - - - - The curve %1 has no associated Y error bars. You cannot use instrumental weighting method. - Curba %1 nu are ataşate bare de eroare. Nu puteţi folosi metoda de ponderare instrumentală. - - - - The column %1 has less points than the fitted data set. Please choose another column! - - - - - The column %1 has less points than the fitted data set. Please choose another column!. - Coloana %1 are mai puţine puncte decat setul de date folosit pentru ajustare. Vă rugăm să alegeţi o altă coloană! - - - - Parameter - Parametru - - - - Value - Valoare - - - - Error - Eroare - - - - - - - - - - QtiPlot - Fit Error - QtiPlot - Eroare de ajustare - - - - - - Please perform a fit first! - Vă rugam să efectuaţi mai întâi o ajustare! - - - - FitResiduals - ReziduuriAjustare - - - - Residuals of %1 - Reziduuri ale %1 - - - - residue - reziduu - - - - - - - - - - QtiPlot - Memory Allocation Error - QtiPlot - Eroare de alocare a memoriei - - - - - - - - - Not enough memory! - Memorie insuficientă! - - - - - FitStats - StatisticiAjustare - - - - Confidence Limits of %1 - Interval de încredere pentru %1 - - - - - Independent Variable - Variabilă independentă - - - - LCL - - - - - Lower %1 Confidence Limit - Limită de încredere inferioară %1 - - - - UCL - - - - - Upper %1 Confidence Limit - Limită de încredere superioară %1 - - - - Prediction Limits of %1 - Benzi de predicţie pentru %1 - - - - LPL - - - - - Lower %1 Prediction Limit - Limită de predicţie inferioară %1 - - - - UPL - - - - - Upper %1 Prediction Limit - Limită de predicţie superioară %1 - - - - You didn't specify a valid data set for this fit operation. Operation aborted! - Nu aţi specificat un set de date valid pentru această operaţie. Operaţia a fost abandonată! - - - - There are no parameters specified for this fit operation. Operation aborted! - Nu aţi definit parametrii pentru această operaţie de ajustare. Operaţia a fost abandonată! - - - - You need at least %1 data points for this fit operation. Operation aborted! - Aveţi nevoie de cel puţin %1 puncte pentru a efectua operaţia de ajustare. Operaţia fost abandonată! - - - - You must specify a valid fit function first. Operation aborted! - Trebuie să specificaţi mai întâi o funcţie de ajustare validă. Operaţia a fost abandonată! - - - - - Could not allocate enough memory for the fit curves! - Memorie insuficientă pentru curbele de ajustare! - - - - QtiPlot - Memory Allocation Error - QtiPlot - Eroare de alocare a memoriei - - - - Fit - Ajustare - - - - QtiPlot - QtiPlot - - - - File Save Error - Eroare de salvare a fişerului - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - Nu a fost posibilă scrierea în fişierul: <br><h4> %1 </h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie! - - - - QtiPlot Fit Model - Funcţie de ajustare QtiPlot - - - - Cannot read file %1: -%2. - Nu a fost posibilă citirea fişierului %1:%2. - - - - FitDialog - - - QtiPlot - Fit Wizard - QtiPlot - Asistent de ajustare - - - - Curve - Curbă - - - - - Function - Funcţie - - - - Initial guesses - Valori iniţiale - - - - - &Save - &Salvează - - - - &Preview - &Previzualizare - - - - Parameter - Parametru - - - - From - De la - - - - Value - Valoare - - - - To - Pană la - - - - Constant - Constant - - - - Error - Eroare - - - - Algorithm - Algoritm - - - - Scaled Levenberg-Marquardt - Levenberg-Marquardt scalat - - - - Unscaled Levenberg-Marquardt - Levenberg-Marquardt nescalat - - - - Nelder-Mead Simplex - Nelder-Mead Simplex - - - - Color - Culoare - - - - From x= - De la x= - - - - To x= - La x= - - - - Iterations - Iteraţii - - - - Tolerance - Toleranţă - - - - Weighting Method - Metodă de ponderare - - - - No weighting - Fără ponderare - - - - Instrumental - Instrumentală - - - - Statistical - Statistică - - - - Arbitrary Dataset - Set de date arbitrar - - - - Direct Weighting - Ponderare directă - - - << &Edit function - << &Editează funcţia - - - - &Delete Fit Curves - Şterge curbele &de ajustare - - - - &Fit - &Ajustează - - - - - - &Close - În&chide - - - Custom &Output >> - Personalizare &rezultate >> - - - - Category - Categorie - - - - Expression - Expresie - - - - User defined - Funcţii utilizator - - - - Built-in - Funcţii predefinite - - - - Basic - Funcţii elementare - - - - Plugins - Extensii - - - - Fit with &built-in function - Ajustare cu funţia &predefinită - - - - - Polynomial Order - Ordinul polinomului - - - - - Choose plug&ins folder... - Alegeţi dosarul conţinând extens&ii... - - - - Name - Nume - - - - user1 - funcţie1 - - - - - Parameters - Parametri - - - - &Remove - Şte&rge - - - - Add &expression - Adaugă &expresie - - - - Add &name - Adaugă &nume - - - - Rese&t - Ş&terge - - - &Fit >> - &Ajustează >> - - - - &Uniform X Function - Funcţie de X &uniformă - - - - Points - Puncte - - - - Same X as Fitting &Data - Aceleaşi abscise ca &datele sursă - - - - Generated Fit Curve - Curba de ajustare generată - - - - Significant Digits - Cifre semnificative - - - - Parameters &Table - &Tabel parametri - - - - - Name: - Nume: - - - - &One table for all fits - &Un tabel pentru toate ajustările - - - - Covariance &Matrix - &Matricea de covarianţă - - - - CovMatrix - MatriceCovarianţă - - - - Co&nf. Bands - Interval de î&ncredere - - - - Pred. &Bands - &Benzi de predicţie - - - - &Residuals Plot - Afişază &reziduurile - - - - &Scale Errors with sqrt(Chi^2/doF) - Multiplică erorile cu &sqrt(Chi^2/doF) - - - - Parameters Output - Rezultate parametri - - - - &Write Parameters to Result Log - Scrie re&zultatele în istoric - - - - &Paste Parameters to Plot - Afişază rezultatele în &grafic - - - << &Fit - << Ajus&tează - - - - - - Select Function - - - - - - - - Fitting Session - - - - - - - Custom Output - - - - - Start Fitting Session - - - - - &Apply - &Aplică - - - - - - - - - - QtiPlot - Error - QtiPlot - Eroare - - - - Please enter a valid name for the parameters table. - Vă rugăm introduceţi un nume valid pentru tabelul de parametri. - - - - - - - - Please perform a fit first and try again. - Vă rugam să efectuaţi mai întâi o ajustare şi apoi să încercaţi din nu. - - - - Please enter a valid name for the covariance matrix. - Vă rugăm introduceţi un nume valid pentru matrice. - - - - - - - - QtiPlot - Input function error - QtiPlot - Eroare detectată în funcţia introdusă - - - - - Please enter a valid function! - Vă rugăm să introduceţi o funcţie validă! - - - - Please enter a function name! - Vă rugăm să introduceţi un nume de funcţie! - - - - QtiPlot - Error: function name - QtiPlot - Eroare: numele funcţiei - - - - is a built-in function name<p>You must choose another name for your function! - este un nume de funcţie predefinită. <p> Trebuie să alegeţi un alt nume pentru funcţia dumneavoastră! - - - - You can't define functions recursively! - Nu puteţi defini funcţii în mod recursiv! - - - - - QtiPlot fit model - Funcţie de ajustare QtiPlot - - - - - All files - Toate fişierele - - - - - - QtiPlot - QtiPlot - - - - - Save Fit Model As - Salvează funcţia de ajustare ca - - - - Are you sure you want to remove fit model file: - %1 ? - Sunteţi sigur că vreţi să ştergeţi fişierul conţinînd un model de ajustare: %1 ? - - - - Remove Fit Model - Şterge funcţia de ajustare - - - - Choose &models folder... - Alegeţi dosarul conţinând &modele de ajustare... - - - - Fit with selected &user function - Ajustare cu funţia selecţionată de &utilizatorului - - - - Fit using &built-in function - Ajustare cu funţia &predefinită - - - - Fit using &plugin function - Ajustare folosind e&xtensia - - - - Choose the plugins folder - Alegeţi dosarul conţinând extensii - - - - Choose the fit models folder - Alegeţi dosarul conţinând modele de ajustare - - - - - Gauss - Gauss - - - - - Lorentz - Lorenz - - - - Peaks - Extreme - - - - - Polynomial - Polinomial - - - - QtiPlot - Warning - QtiPlot - Avertisment - - - - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - Curba <b> %1 </b> nu mai există! Operaţiunea a fost abandonată! - - - - QtiPlot - Input error - QtiPlot - Eroare - - - - Please enter x limits that satisfy: from < end! - Vă rugam să introduceţi limite care satisfac condiţia: început < sfarşit ! - - - - Please verify that you have initialized all the parameters! - Vă rugăm verificaţi că aţi iniţializat toţi parametrii! - - - - - No data tables - Nu există tabele de date - - - - Error: - Eroare: - - - - Folder - - - kB - kilobiţi - - - - bytes - biţi - - - - FrequencyCountDialog - - - QtiPlot - Frequency count - QtiPlot - Numără frecvenţa de apariţie - - - - Statistics on %1 - Statistici pentru setul de date %1 - - - - Mean - Medie - - - - Standard Deviation - Deviaţia standard - - - - Median - - - - - Size - Dimensiune - - - - From Minimum - De la minim - - - - To Maximum - La maxim - - - - Step Size - Pas - - - - &Apply - &Aplică - - - - &Cancel - A&nulează - - - - &Ok - &OK - - - - QtiPlot - Error - QtiPlot - Eroare - - - - Not enough data points, operation aborted! - Setul de date este insuficient, operaţia a fost abandonată! - - - - QtiPlot - Frequency input error - QtiPlot - Eroare detectată în frecvenţa introdusă - - - - Please enter frequency limits that satisfy: From < To ! - Vă rugam să introduceţi limite care satisfac condiţia: minim < maxim ! - - - - - Count - Numără - - - - Frequency count of %1 - Numărare frecvenţă de apariţie în setul de date %1 - - - - BinCtr - Eşantion - - - - BinEnd - SfarşitEşantion - - - - Sum - Sumă - - - - FunctionDialog - - - QtiPlot - Add function curve - QtiPlot - Adaugă funcţie - - - - Curve type - Tip de funcţie - - - - Function - Funcţie de o variabilă - - - - Parametric plot - Curbă parametrică - - - - Polar plot - Coordonate polare - - - - f(x)= - f(x)= - - - - From x= - De la x= - - - - To x= - La x= - - - - - - Points - Puncte - - - - Constant - Constantă - - - - Value - Valoare - - - - - Parameter - Parametru - - - - - From - De la - - - - - To - La - - - - x = - x = - - - - y = - y = - - - - R = - R = - - - - Theta = - Theta = - - - - Clea&r Function - Şte&rge funcţia - - - - &Ok - &OK - - - - &Close - În&chide - - - - Clear list - Goleşte lista - - - - Clear Function - Şterge funcţia - - - - - - QtiPlot - Input error - QtiPlot - Eroare - - - - Please enter x limits that satisfy: from < end! - Vă rugam să introduceţi limite care satisfac condiţia: început < sfarşit ! - - - - - - - - QtiPlot - Input function error - QtiPlot - Eroare detectată în funcţia introdusă - - - - - QtiPlot - Start limit error - QtiPlot - Eroare detectată la valoarea de start - - - - - QtiPlot - End limit error - QtiPlot - Eroare detectată la valoarea de sfarşit - - - - - Please enter parameter limits that satisfy: from < end! - Vă rugam să introduceţi limite care satisfac condiţia: început < sfarşit ! - - - - &Add Function - Adaugă &funcţie - - - - GaussAmpFit - - - GaussAmp - GaussAmp - - - - offset - constantă - - - - amplitude - amplitudine - - - - center - centru - - - - width - lăţime - - - - GaussAmp Fit - Ajustare cu funcţia GaussAmp - - - - GaussFit - - - Gauss - Gauss - - - - Gauss Fit - Ajustare gaussiană - - - - area - aria - - - - center - centru - - - - width - lăţime - - - - offset - constantă - - - - Graph - - - Y Axis Title - Titlu axă Y - - - - X Axis Title - Titlu axă X - - - - - - - - - QtiPlot - Error - QtiPlot - Eroare - - - - - Couldn't change the axis type to the requested format! - Formatul axei nu a putut fi schimbat! - - - - - Please provide a valid file name! - Vă rugăm introduceţi un nume valid! - - - - File format not handled, operation aborted! - Format de fişier necunoscut, operaţiunea a fost abandonată! - - - - layer - grafic - - - - Title - Titlu - - - - QtiPlot - File open error - QtiPlot - Eroare de deschidere fişier - - - - Image file: <p><b> %1 </b><p>does not exist anymore! - Fişierul imagine: <p><b> %1 </b><p> nu mai există! - - - - Data set generated from curve - Set de date generat folosind curba - - - - Table - Tabel - - - - - - QtiPlot - Warning - QtiPlot - Avertisment - - - - The columns - Coloanele - - - - are empty and will not be added to the plot! - sunt vide şi nu vor fi adăugate graficului! - - - - The column - Coloana - - - - is empty and will not be added to the plot! - este vidă şi nu va fi adăugată graficului! - - - - - Cu&t - &Taie - - - - - &Copy - &Copiază - - - - - C&lear - Go&leşte - - - - - &Delete - Şte&rge - - - - - - &Properties... - &Proprietăti... - - - - &Rescale to show all - &Afişază toate datele - - - - Ctrl+Shift+R - Ctrl+Shift+R - - - - &Hide axis - Ascu&nde axa - - - - &Show grids - Afişază &grilajul - - - - &Scale... - &Scală... - - - - There are no curves available on this plot! - Nu există curbe disponibile în acest grafic! - - - - There are no curves with more than two points on this plot. Operation aborted! - Nu există curbe conţinând mai mult de două puncte în acest grafic. Operaţie abandonată! - - - - F - F - - - - Graph3D - - - X axis - Axă X - - - - Y axis - Axă Y - - - - Z axis - Axă Z - - - - - - QtiPlot - Error - QtiPlot - Eroare - - - - - Please provide a valid file name! - Vă rugăm introduceţi un nume valid! - - - - File format not handled, operation aborted! - Format de fişier necunoscut, operaţiunea a fost abandonată! - - - - ImageExportDialog - - - QtiPlot - Choose a filename to save under - QtiPlot - Alegeţi un nume de fişier - - - - Resolution (DPI) - Rezoluţie (pixeli/ţol) - - - &Export in &color - Exportă în &culori - - - - Export 3D texts as - Exportă textele 3D ca - - - - Bitmap images - Imagini bitmap - - - - Native fonts - Fonturi native - - - - LaTeX file - Fişier LaTeX - - - - 3D Sort mode - Metodă de sortare 3D - - - - No sort - Fără sortare - - - - Simple sort - Sortare simplă - - - - BSP sort - Sortare BSP - - - - Image quality - Calitatea imaginii - - - - Save transparency - Salvează transparenţa - - - Custom size - Dimensiuni - - - - inch - ţol - - - - mm - mm - - - - cm - cm - - - - point - punct - - - - pixel - pixel - - - - Unit - Unitate - - - - Width - Lăţime - - - - Height - Înălţime - - - - &Keep aspect ratio - &Păstrează aspectul - - - - Custom print size - Dimensiuni tipărire - - - - Export in &color - Exportă în &culori - - - - &Escape special characters in title/axis labels - &Exportă caracterele speciale din titlu/etichete axe - - - - Export &font sizes - Exportă dimensiunile &fonturilor - - - - Scale Fonts Factor - Factor de redimensionare fonturi - - - - Automatic - Automat - - - - Print Resolution (DPI) - Rezoluţia la imprimare (pixeli/ţol) - - - - ImageWidget - - - - QtiPlot - File openning error - QtiPlot - Eroare de deschidere fişier - - - - The file: <b>%1</b> doesn't exist! - Fişierul: <b>%1</b> nu există! - - - - You don't have the permission to open this file: <b>%1</b> - Nu aveţi permisiunea să deschideţi fişierul: <b>%1</b> - - - - ImportASCIIDialog - - - QtiPlot - Import ASCII File(s) - QtiPlot - Importă fişier(e) ASCII - - - - All files - Toate fişierele - - - - Text files - Fişiere text - - - - Data files - Fişiere de date - - - - Comma Separated Values - Valori separate de virgulă - - - - Import each file as: - Importă fiecare fişier ca: - - - - - New Table - Tabel nou - - - - - New Matrice - Matrice nouă - - - - New Columns - Coloane noi - - - - New Rows - Linii noi - - - - Overwrite Current Window - Rescrie tabelul curent - - - - Separator: - Separator: - - - - - - - - TAB - TAB - - - - - - - SPACE - SPAŢIU - - - - The column separator can be customized. -The following special codes can be used: -\t for a TAB character -\s for a SPACE - Separatorul de coloane poate fi personalizat. Următoarele coduri speciale pot fi folosite: -\t pentru caracterul TAB -\s pentru SPAŢIU - - - - The separator must not contain the following characters: -0-9eE.+- - Separatorul de coloane nu trebuie să conţină caracterele următoare: 0-9eE.+- - - - - Ignore first - Ignoră primele - - - - lines - linii - - - - Ignore lines starting with - Ignoră liniile începând cu - - - Use first row to &name columns - Utilizează prima linie pentru a denum&i coloanele - - - - Use first row &as - Utilizează prima linie c&a - - - - Column Names - Nume coloană - - - - Column Comments - Comentariu coloană - - - - Use second row as &comments - Utilizează a doua linie drept &comentarii - - - - &Remove white spaces from line ends - Şterge spaţiile alb&e de la capetele liniilor - - - - By checking this option all white spaces will be -removed from the beginning and the end of -the lines in the ASCII file. - when translating this check the what's this functions and tool tips to place the '\n's correctly - Daca selectaţi această opţiune toate spaţiile albe vor fi şterse de la începutul şi sfârşitul liniilor din fişierul ASCII. - - - - Warning: checking this option leads to column -overlaping if the columns in the ASCII file don't -have the same number of rows. - Avertisment: slectarea acestei opţiuni poate duce la amestecarea diverselor coloane de date daca in fişierul ASCII acestea nu au acelaşi număr de linii. - - - - - To avoid this problem you should precisely -define the column separator using TAB and -SPACE characters. - when translating this check the what's this functions and tool tips to place the '\n's correctly - Pentru a evita această problemă trebuie să specificaţi separatorul de coloane folosind caracterele TAB şi SPAŢIU. - - - - &Simplify white spaces - &Simplifică spaţiile albe - - - - By checking this option all white spaces will be -removed from the beginning and the end of the -lines and each sequence of internal -whitespaces (including the TAB character) will -be replaced with a single space. - when translating this check the what's this functions and tool tips to place the '\n's correctly - Daca selectaţi această opţiune toate spaţiile albe vor fi şterse de la începutul şi sfârşitul liniilor din fişierul ASCII şi fiecare secvenţă internă de spaţii (incluzând caracterul TAB) va fi înlocuită cu un singur spaţiu. - - - - Warning: checking this option leads to column -overlaping if the columns in the ASCII file don't -have the same number of rows. - when translating this check the what's this functions and tool tips to place the '\n's correctly - Avertisment: slectarea acestei opţiuni poate duce la amestecarea diverselor coloane de date daca in fişierul ASCII acestea nu au acelaşi număr de linii. - - - - Decimal Separators - Separatori zecimali - - - - System Locale Setting - Setările regionale ale calculatorului - - - - Omit &thousands separator - Ignoră separa&torul de mii - - - - Endline character - Caracter de sfărşit de linie - - - - LF (Unix) - LF (Unix) - - - - CRLF (Windows) - CRLF (Windows) - - - - CR (Mac) - CR (Mac) - - - - Import as &read-only - Importă fară drept de modifica&re - - - - &Preview Lines - Linii de &previzualizare - - - - All - Toate - - - - &Help - A&jutor - - - - The column separator can be customized. The following special codes can be used: -\t for a TAB character -\s for a SPACE - Separatorul de coloane poate fi personalizat. Următoarele coduri speciale pot fi folosite: -\t pentru caracterul TAB -\s pentru SPAŢIU - - - - The separator must not contain the following characters: 0-9eE.+- - Separatorul de coloane nu trebuie să conţină caracterele următoare: 0-9eE.+- - - - - Remove white spaces from line ends - Şterge spaţiile albe de la capetele liniilor - - - - By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. - Daca selectaţi această opţiune toate spaţiile albe vor fi şterse de la începutul şi sfârşitul liniilor din fişierul ASCII. - - - - Simplify white spaces - Simplifică spaţiile albe - - - - By checking this option each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. - Daca selectaţi această opţiune toate secvenţele de spaţii albe (incluzând caracterul TAB) vor fi înlocuite cu un singur spaţiu. - - - - By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. - Daca selectaţi această opţiune toate spaţiile albe vor fi şterse de la începutul şi sfârşitul liniilor din fişierul ASCII şi fiecare secvenţă internă de spaţii (incluzând caracterul TAB) va fi înlocuită cu un singur spaţiu. - - - - Warning: using these two last options leads to column overlaping if the columns in the ASCII file don't have the same number of rows. - Avertisment: slectarea acestor ultime doua opţiuni poate duce la amestecarea diverselor coloane de date daca in fişierul ASCII acestea nu au acelaşi număr de linii. - - - - To avoid this problem you should precisely define the column separator using TAB and SPACE characters. - Pentru a evita această problemă trebuie să specificaţi separatorul de coloane folosind caracterele TAB şi SPAŢIU. - - - - QtiPlot - Help - QtiPlot - Ajutor - - - - QtiPlot - File openning error - QtiPlot - Eroare de deschidere fişier - - - - You don't have the permission to open this file: <b>%1</b> - Nu aveţi permisiunea să deschideţi fişierul: <b>%1</b> - - - - IntDialog - - - QtiPlot - Integration Options - QtiPlot - Opţiuni de integrare - - - - Function - Funcţie - - - - Variable - Variabilă - - - - Order (1 - 5, 1 = Trapezoidal Rule) - Ordin (1 - 5, 1 = Metoda trapezelor) - - - - Number of iterations (Max=20) - Număr de iteraţii (Max=20) - - - - Tolerance - Toleranţă - - - - Lower limit - Limita inferioară - - - - Upper limit - Limita superioară - - - - &Plot area - Trasează su&prafaţă - - - - &Integrate - &Integrează - - - - &Close - În&chide - - - - Integration - - - QtiPlot - Input error - QtiPlot - Eroare - - - - - Integration - Integrare - - - - - Numerical integration of - Integrare numerică a setului de date - - - - using a %1 order method - folosind o metodă de ordinul %1 - - - - From - De la - - - - - to - la - - - - Tolerance - Toleranţă - - - - Iterations - Iteraţii - - - - Plot - Grafic - - - - using the Trapezoidal Rule - folosind metoda trapezelor - - - - Points - Puncte - - - - from - de la - - - - Peak at - Maxim la - - - - Area - Aria - - - - QtiPlot - Error - QtiPlot - Eroare - - - - Unknown integration method. Valid values must be in the range: 1 (Trapezoidal Method) to 5. - Metodă de integrare necunoscută. Valorile valide trebuie să se situeze în intervalul: 1 ( metoda trapezelor) - 5. - - - - Interpolation - - - - QtiPlot - QtiPlot - - - - - Error - Eroare - - - - Unknown interpolation method. Valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. - Metodă de interpolare necunoscută, valorile valide sunt: 0 - Liniar, 1 - Cubic, 2 - Akima. - - - - - - - Linear - Liniară - - - - - - - - - Int - Int - - - - - - - - - Interpolation - Interpolare - - - - - - - Cubic - Cubică - - - - - - - Akima - Akima - - - - QtiPlot - Error - QtiPlot - Eroare - - - - Unknown interpolation method, valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. - Metodă de interpolare necunoscută, valorile valide sunt: 0 - Liniar, 1 - Cubic, 2 - Akima. - - - - You need at least %1 points in order to perform this operation! - Aveţi nevoie de cel puţin %1 puncte pentru a efectua această operaţia! - - - - InterpolationDialog - - - QtiPlot - Interpolation Options - QtiPlot - Opţiuni de interpolare - - - - Make curve from - Date sursă - - - - Spline - Metodă de interpolare - - - - Linear - Liniară - - - - Cubic - Cubică - - - - Non-rounded Akima - Akima - - - - Points - Puncte - - - - From Xmin - De la Xmin - - - - To Xmax - La Xmax - - - - Color - Culoare - - - - &Make - &Genereză curbă - - - - &Close - În&chide - - - - QtiPlot - Warning - QtiPlot - Avertisment - - - - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - Curba <b> %1 </b> nu mai există! Operaţiunea a fost abandonată! - - - - QtiPlot - Input error - QtiPlot - Eroare - - - - Please enter x limits that satisfy: from < to! - Vă rugam să introduceţi limite care satisfac condiţia: Xmin < Xmax ! - - - - LayerButton - - - Activate layer - Activează graficul - - - - LayerDialog - - - QtiPlot - Arrange Layers - QtiPlot - Aranjare grafice - - - - Layers - Grafice - - - - Number - Număr - - - - Automatic &layout - Aranjare au&tomată - - - - Alignment - Aliniere - - - - Horizontal - Orizontal - - - - - Center - Centrat - - - - Left - Stânga - - - - Right - Dreapta - - - - Vertical - Vertical - - - - Top - Sus - - - - Bottom - Jos - - - - Grid - Aranjare - - - - Columns - Coloane - - - - Rows - Linii - - - - &Layer Canvas Size - Suprafaţa &graficului - - - - Width - Lăţime - - - - - - - - - - - pixels - pixeli - - - - Height - Înălţime - - - - Spacing - Margini - - - - Columns gap - Distanţă între coloane - - - - Rows gap - Distanţă între linii - - - - Left margin - Marginea stangă - - - - Right margin - Marginea dreaptă - - - - Top margin - Marginea de sus - - - - Bottom margin - Marginea de jos - - - - &Apply - &Aplică - - - - &OK - &OK - - - - - &Cancel - A&nulează - - - - Swap Layers - Schimbă graficele - - - - Source Layer - Grafic sursă - - - - Destination Layer - Grafic de destinaţie - - - - &Swap - &Schimbă - - - - QtiPlot - Delete Layers? - QtiPlot - Şterge graficul? - - - - You are about to delete %1 existing layers. - Sunteţi pe punctul de a şterge %1 grafic(e) existent(e). - - - - Are you sure you want to continue this operation? - Sunteţi sigur că vreţi să continuaţi această operaţie? - - - - &Continue - &Continuă - - - - QtiPlot - Columns input error - QtiPlot - Eroare detectată în numărul de coloane introdus - - - - The number of columns you've entered is greater than the number of graphs (%1)! - Numărul de coloane introdus este mai mare decat numărul de grafice (%1)! - - - - QtiPlot - Rows input error - QtiPlot - Eroare detectată în numărul de linii introdus - - - - The number of rows you've entered is greater than the number of graphs (%1)! - Numărul de linii introdus este mai mare decat numărul de grafice (%1)! - - - - QtiPlot - Error - QtiPlot - Eroare - - - - Please enter different indexes for the source and destination layers! - Vă rugăm să introduceţi indici diferiţi pentru graficele sursă şi destinaţie! - - - - LineDialog - - - QtiPlot - Line options - QtiPlot - Opţiuni de linie - - - - Color - Culoare - - - - Type - Tip - - - - Width - Grosime - - - - Arrow at &start - &Săgeată la început - - - - Arrow at &end - Săg&eată la sfarşit - - - - &Line - &Linie - - - - Length - Lungime - - - - Angle - Unghi - - - - &Filled - &Umplut - - - - Arrow &Head - Ca&p săgeată - - - - Set &Default - &Defineşte ca format implicit - - - - &Apply - &Aplică - - - - &Ok - &OK - - - - Page - Pagină - - - - Layer Scales - Axe de coordonate - - - - Attach to - Ataşază la - - - - Scale Coordinates - Coordonate - - - - Pixels - Pixeli - - - - Unit - Unitate - - - - Start Point - Punct de început - - - - - X - X - - - - - Y - Y - - - - End Point - Punct de sfarşit - - - - &Geometry - &Geometrie - - - - LineProfileTool - - - - QtiPlot - Pixel selection warning - QtiPlot - Eroare de selecţie a a pixelilor - - - - Please select an image marker first. - Vă rugam să selectaţi mai întâi o imagine. - - - - Please select the end line point inside the image rectangle! - Vă rugăm să selectaţi capătul liniei în interiorul imaginii! - - - - pixel - pixel - - - - intensity - intensitate - - - - Table - Tabel - - - - pixels - pixeli - - - - pixel intensity (a.u.) - intensitate pixeli (u.a.) - - - - LinearFit - - - Linear Regression - Regresie liniară - - - - Linear - Liniară - - - - QtiPlot - Fit Error - QtiPlot - Eroare de ajustare - - - - You need at least %1 data points for this fit operation. Operation aborted! - Aveţi nevoie de cel puţin %1 puncte pentru a efectua operaţia de ajustare. Operaţia fost abandonată! - - - - LinearSlopeFit - - - Linear Regression - Regresie liniară - - - - LinearSlope - PantăLiniară - - - - QtiPlot - Fit Error - QtiPlot - Eroare de ajustare - - - - You need at least %1 data points for this fit operation. Operation aborted! - Aveţi nevoie de cel puţin %1 puncte pentru a efectua operaţia de ajustare. Operaţia fost abandonată! - - - - LogisticFit - - - Logistic - Logistic - - - - init value - valoare iniţială - - - - final value - valoare finală - - - - center - centru - - - - power - putere - - - - Logistic Fit - Ajustare cu funcţia logistică - - - - LorentzFit - - - Lorentz - Lorenz - - - - Lorentz Fit - Ajustare Lorentz - - - - area - aria - - - - center - centru - - - - width - lăţime - - - - offset - constantă - - - - Matrix - - - Set Dimensions - Setează dimensiunile - - - - - - - - QtiPlot - Error - QtiPlot - Eroare - - - - Calculation failed, the matrix is not square! - Calcul imposibil, matriceanu este pătrată! - - - - - - - - - QtiPlot - QtiPlot - - - - - - - - Memory Allocation Error - Eroare de alocare a memoriei - - - - - - - - Not enough memory, operation aborted! - Memorie insuficientă, operaţia a fost abandonată! - - - - Inversion failed, the matrix is not square! - Inversare imposibilă, matricea nu este pătrată! - - - - Invert - Inversează - - - - Transpose - Transpune - - - - Flip Vertically - Răstoarnă vertical - - - - Flip Horizontally - Răstoarnă orizontal - - - - Rotate 90° - Rotire cu 90° - - - - Rotate -90° - Rotire cu -90° - - - - - Calculate Values - Calculează valorile - - - - Clear Selection - Şterge selecţie - - - - Paste - Lipeşte - - - - Delete Rows - Şterge linii - - - - Delete Columns - Şterge coloane - - - - Insert Row - Inserează linie - - - - Insert Column - Inserează coloană - - - - - Please provide a valid file name! - Vă rugăm introduceţi un nume valid! - - - - File format not handled, operation aborted! - Format de fişier necunoscut, operaţiunea a fost abandonată! - - - - - Set Data Mode - Setează mod date - - - - Ctrl+A - Matrix: select all - Ctrl+A - - - - - Import Image - Import imagine - - - - Inverse FFT - FFT Inversă - - - - Forward FFT - FFT Directă - - - - QtiPlot - ASCII Export Error - QtiPlot - Eroare de export ASCII - - - - Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! - Nu a fost posibilă scrierea în fişierul: <br><h4> %1 </h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie! - - - - Import ASCII File - Importă fişier ASCII - - - - Due to memory limitations it will not be possible to undo this change. Do you want to continue anyways? - Din cauza memoriei insuficiente nu va fi posibil să anulaţi această modificare. Doriţi totuşi să continuaţi? - - - - Warning - Avertisment - - - - kB - kB - - - - MatrixDialog - - - QtiPlot - Matrix Properties - QtiPlot - Proprietătile matricii - - - - Cell Width - Lăţime celulă - - - - Data Format - Format date - - - - Decimal: 1000 - Zecimal: 100.0 - - - - Scientific: 1E3 - Ştiinţific: 1E3 - - - - Numeric Display - Afişaj numeric - - - - Default Decimal Digits - Setări implicite - - - - Significant Digits= - Cifre semnificative - - - - &Apply - &Aplică - - - - &OK - &OK - - - - &Cancel - A&nulează - - - - Set Columns Width - Defineşte lăţimea coloanelor - - - - Decimal - Zecimal - - - - Scientific - Ştiinţific - - - - Set Data Format %1 - Defineşte formatul de date %1 - - - - Precision %1 digits - %1 Cifre semnificative - - - - MatrixModel - - - Edited cell - Celulă editată - - - - - - - QtiPlot - QtiPlot - - - - Input Size Error - Eroare în dimensiunile introduse - - - - The dimensions you have specified are not acceptable! - Dimensiunile specificate nu pot fi acceptate! - - - - Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! - Va rugăm să introduceţi valori pozitive pentru care produsul linii*coloane nu depaşeşte valoare maximă permisă de sistemul dumneavoastră de operare pentru un număr întreg ! - - - - - Memory Allocation Error - Eroare de alocare a memoriei - - - - - Not enough memory, operation aborted! - Memorie insuficientă, operaţia a fost abandonată! - - - - Multiline expressions take much more time to evaluate! Do you want to continue anyways? - Evaluarea expresiilor conţinand mai multe linii durează mult mai mult timp! Doriţi să continuaţi? - - - - Warning - Avertisment - - - - MatrixSizeDialog - - - QtiPlot - Matrix Dimensions - QtiPlot - Dimensiunile matricii - - - - Dimensions - Dimensiuni - - - - Rows - Linii - - - - Columns - Coloane - - - - Coordinates - Coordonate - - - - X (Columns) - X (Coloane) - - - - Y (Rows) - Y (Linii) - - - - First - Început - - - - Last - Sfarşit - - - - &Apply - &Aplică - - - - &OK - &OK - - - - &Cancel - A&nulează - - - - Set Coordinates x[%1 : %2], y[%3 : %4] - Definire coordonate x[%1 : %2], y[%3 : %4] - - - - MatrixValuesDialog - - - QtiPlot - Set Matrix Values - QtiPlot - Calculează valorile matricii - - - - For row (i) - De la linia (i) - - - - - to - la - - - - For col (j) - De la coloana (j) - - - - Add &Function - Adaugă &funcţie - - - - Add Ce&ll - Adaugă celu&lă - - - - &Apply - &Aplică - - - - &Close - În&chide - - - - Use built-in muParser (much faster) - Foloseşte muParser (mult mai rapid) - - - - Cell(i,j)= - Celula(i,j)= - - - - Set New Formula - Defineşte noua formulă - - - - MdiSubWindow - - - QtiPlot - QtiPlot - - - - Do you want to hide or delete - Doriţi să ştergeţi sau să ascundeţi - - - - Delete - Şterge - - - - Hide - Ascunde - - - - Cancel - Anulează - - - - Normal - Normal - - - - Minimized - Minimizat - - - - Maximized - Maximizat - - - - Hidden - Ascuns - - - - B - biţi - - - - MultiLayer - - - Add layer - Adaugă grafic - - - - Remove active layer - Şterge graficul curent - - - - QtiPlot - Guess best layout? - QtiPlot - Aranjare automată a graficelor? - - - - Do you want QtiPlot to rearrange the remaining layers? - Doriţi să rearanjaţi graficele rămase? - - - - &Yes - &Da - - - - &No - &Nu - - - - &Cancel - &Anulează - - - - - - QtiPlot - Error - QtiPlot - Eroare - - - - - Please provide a valid file name! - Vă rugăm introduceţi un nume valid! - - - - File format not handled, operation aborted! - Format de fişier necunoscut, operaţiunea a fost abandonată! - - - - kB - kilobiţi - - - - Offset Amount... - Distanţe... - - - - Reverse Order - Inversează ordinea - - - - Fill Area... - Umplere curbe... - - - - Offset Dialog - Dialog distanţe - - - - Total Y Offset (%) - Distanţă Y (% din înlţime) - - - - Total X Offset (%) - Distanţă X (% din lăţime) - - - - &Apply - &Aplică - - - - - &Close - În&chide - - - - Fill Curves - Umplere curbe - - - - Enable Fill - Autorizează umplerea - - - - Fill with Color - Culoare de umplere - - - - Side Lines - Linii laterale - - - - MultiPeakFit - - - Gauss - Gauss - - - - Lorentz - Lorenz - - - - Gauss Fit - Ajustare gaussiană - - - - Lorentz Fit - Ajustare Lorentz - - - - multi-peak - extreme - - - - - area - aria - - - - - center - centru - - - - - width - lăţime - - - - - offset - constantă - - - - - - Peak - Extrem - - - - - - Fit - Ajustare - - - - QtiPlot - Fit Error - QtiPlot - Eroare de ajustare - - - - Could not allocate enough memory for the fit curves! - Memorie insuficientă pentru curbele de ajustare! - - - - fit of - ajustare a - - - - - peak - extrem - - - - Area - Aria - - - - Center - Centrat - - - - Width - Lăţime - - - - Height - Înălţime - - - - MultiPeakFitTool - - - Move cursor and click to select a point and double-click/press 'Enter' to set the position of a peak! - Mişcaţi cursorul şi efectuaţi un click pentru a alege un punct şi efectuaţi un click dublu sau apăsaţi tasta 'Enter' pentru a defini poziţia extremului! - - - - Peak %1 selected! Click to select a point and double-click/press 'Enter' to set the position of the next peak! - Extremul cu numarul %1 a fost selecţionat! Efectuaţi un click pentru a alege un punct şi efectuaţi un click dublu sau apăsaţi tasta 'Enter' pentru a defini poziţia extremului următor! - - - - NonLinearFit - - - NonLinear - Neliniar - - - - Non-linear Fit - Ajustare neliniară - - - - - QtiPlot - Input function error - QtiPlot - Eroare detectată în funcţia introdusă - - - - Please enter a valid non-empty expression! Operation aborted! - Vă rugăm să introduceţi o expresie validă! Operaţie abandonată! - - - - - QtiPlot - Fit Error - QtiPlot - Eroare de ajustare - - - - There are no parameters specified for this fit operation. Please define a list of parameters first! - Nu aţi definit parametrii pentru această operaţie de ajustare. Vă rugăm să definiţi mai întâi o listă de parametri! - - - - You must provide a list containing at least one parameter for this type of fit. Operation aborted! - Trebuie să introduceţi o listă conţinand cel puţin un parametru pentru a efectua acest tip de ajustare. Operaţia fost abandonată! - - - - - constant - constant(ă) - - - - Note - - - Add tab - Adaugă filă - - - - Please, enter new title: - Vă rugăm să introduceţi un nou titlu: - - - - Title - Titlu - - - - untitled - neintitulat - - - - OpenProjectDialog - - - QtiPlot - Open Project - QtiPlot - Deschide proiect - - - - QtiPlot project - Proiect QtiPlot - - - - Compressed QtiPlot project - Proiect QtiPlot arhivat - - - - Origin project - Proiect Origin - - - - Origin matrix - Matrice Origin - - - - Origin worksheet - Tabel Origin - - - - Origin graph - Grafic Origin - - - - Backup files - Copii de siguranţă - - - - All files - Toate fişierele - - - - Open As - Deschide ca - - - - New Project Window - Fereastră nouă - - - - New Folder - Dosar nou - - - - PatternBox - - - Solid - Solid - - - - Horizontal - Linii orizontale - - - - Vertical - Linii verticale - - - - Cross - Cruce - - - - BDiagonal - Linii înclinate înainte - - - - FDiagonal - Linii înclinate înapoi - - - - DiagCross - Linii înclinate incrucişate - - - - Dense1 - Dens1 - - - - Dense2 - Dens2 - - - - Dense3 - Dens3 - - - - Dense4 - Dens4 - - - - Dense5 - Dens5 - - - - Dense6 - Dens6 - - - - Dense7 - Dens7 - - - - None - Fără model - - - - Plot3DDialog - - - QtiPlot - Surface Plot Options - QtiPlot - Opţiunile graficului 3D - - - - &Apply - &Aplică - - - - &OK - &OK - - - - &Cancel - A&nulează - - - - - X - X - - - - - Y - Y - - - - - Z - Z - - - - From - De la - - - - To - Pană la - - - - Type - Tip - - - - linear - liniară - - - - logarithmic - logaritmică - - - - Major Ticks - Diviziuni principale - - - - Minor Ticks - Diviziuni secundare - - - - &Scale - &Scală - - - - Title - Titlu - - - - Axis Font - Font - - - - &Choose font - Alegeţi &font - - - - Major Ticks Length - Lungimea diviziunilor principale - - - - Minor Ticks Length - Lungimea diviziunilor secundare - - - - &Axis - &Axe - - - - Co&lor - Cu&loare - - - - &Font - &Font - - - - &Title - &Titlu - - - - Linea&r color map - &Paletă de culori liniară - - - - Color map &file - &Fişier paletă de culori - - - - - - None - Nici una - - - - Opacity - Opacitate - - - - &Line - &Linie - - - - &Background - &Fundal - - - - General - General - - - - A&xes - A&xe - - - - Lab&els - &Etichete - - - - &Numbers - Nume&re - - - &Grid - Grila&j - - - - Coordinate System - Sistem de coordonate - - - - &Colors - &Culori - - - - Show Legend - Afişază &legenda - - - - Orthogonal - &Ortogonal - - - - - Line Width - Grosimea liniei - - - - Resolution - Rezoluţie - - - - Numbers Font - Font numere - - - - &Choose Font - Alegeţi &font - - - - Distance labels - axis - Distanţa axă - titlu - - - - Zoom (%) - Mărire (%) - - - - X Zoom (%) - Mărire axă X (%) - - - - Y Zoom (%) - Mărire axă Y (%) - - - - Z Zoom (%) - Mărire axă Z (%) - - - - &General - &General - - - - Ma&jor Grids - Grila&j principal - - - - Mi&nor Grids - Grilaj secu&ndar - - - - Color - Culoare - - - - - Style - Stil - - - - - Solid - Solid - - - - - Dash - Linie - - - - - - Dot - Punct - - - - - Dash Dot - Linie Punct - - - - - Dash Dot Dot - Linie Punct Punct - - - - - Short Dash - Linie Scurtă - - - - - Short Dot - Linie Scurtă - - - - - Short Dash Dot - Linie Punct Scurte - - - - G&rid - &Grilaj - - - - Cross Hair - Cruce - - - - Cone - Con - - - - - - - Width - Lăţime - - - - Smooth angles - Unghiuri nete - - - - Radius - Rază - - - - Smooth line - Linie netă - - - - Boxed - Desenează celulă 3D - - - - Quality - Calitate - - - - Points - Puncte - - - - &Worksheet - &Tabel - - - - &Matrix - &Matrice - - - - Draw lines - Desenează linii - - - - Filled bars - Bare umplute - - - - Bars - Bare - - - - PlotDialog - - - QtiPlot - Plot details - QtiPlot - Detalii grafic - - - - Plot type - Tip de grafic - - - - &Worksheet - &Tabel - - - - &OK - &OK - - - - &Cancel - A&nulează - - - - &Apply - &Aplică - - - - - - &Plot Associations... - &Asocieri de date... - - - - Titles - Titluri - - - - Axes Labels - Titluri axe - - - - Axes Numbers - - - - - Legends - Legende - - - - - Fonts - Fonturi - - - - Background Color - Culoare de fundal - - - - - Opacity - Opacitate - - - - - Transparent - Transparent - - - - Canvas Color - Culoarea suprafeţei - - - - Border Color - Culoare de bordură - - - - - - - - Width - Lăţime - - - - Antialiasing - Linii nete - - - - Margin - Margine - - - - Set As &Default - &Defineşte ca format implicit - - - - Apply &to... - Aplică forma&tul... - - - - - - - - - - - - Layer - Grafic - - - - - - - Window - Fereastră - - - - - - - All Windows - Tuturor ferestrelor - - - - inch - ţol - - - - mm - mm - - - - cm - cm - - - - point - punct - - - - pixel - pixel - - - - Unit - Unitate - - - - Origin - Origine - - - - X= - X= - - - - Y= - Y= - - - - - - Size - Dimensiuni - - - - width= - lăţime= - - - - height= - înălţime= - - - - Keep aspect ratio - Păstrează aspectul - - - - - - Geometry - Geometrie - - - - &Speed Mode, Skip Points if needed - Mod &rapid, ignoră puncte dacă e nevoie - - - - data points - puncte - - - - Apply to curves with more than: - Aplică curbelor cu mai mult de: - - - - Tolerance (Douglas Peuker algorithm) - Toleranţa pentru algoritmul Douglas Peuker - - - - - - Speed - Viteză - - - - - - - - - Color - Culoare - - - - - - - - Style - Stil - - - - Border - Bordură - - - - First color - Prima culoare - - - - - - - - - Pattern - Model - - - - Fill - Umple - - - - 3D View - Vedere 3D - - - - View Angle (deg) - Unghi de vedere (grade) - - - - Thickness (% of radius) - Grosime (% din rază) - - - - Rotation - Rotaţie - - - - Starting Azimuth (deg) - Azimut (grade) - - - - Counter cloc&kwise - Sens anti-ora&r - - - - Radius/Center - Rază/Centru - - - - Radius (% of frame) - Rază (% din bordură) - - - - Horizontal Offset (% of frame) - Distanţă orizontală (% din bordură) - - - - - Pie Geometry - Geometrie - - - - Automatic &Format - &Format automat - - - - &Values - &Valori - - - - &Percentages - &Procente - - - - Categories/&Rows - Categorii/&Linii - - - - Associate Position with &Wedge - Asocia&ză poziţia cu marginea - - - - Dist. from Pie Edge - Distanţa pană la marginea plăcintei - - - - - - - - Labels - Etichete - - - - &Scale layers to paper size - Aju&stează graficele la dimensiunile hârtiei - - - - Print Crop&marks - Imprimă &liniile ajutătoare pentru decupaj - - - - - Print - Imprimare - - - - &Show - Afişa&ză - - - - Column - Coloană - - - - White O&ut - F&undal alb - - - - Justify - Aliniere - - - - Center - Centrat - - - - - - Left - Stânga - - - - - - Right - Dreapta - - - - &Font - &Font - - - - Rotate (deg) - Roteşte (grade) - - - - X Offset (font height %) - Distanţa X (% din înălţime font) - - - - Y Offset (font height %) - Distanţa Y (% din înălţime font) - - - - Attach curve to: - Ataşază curba axelor: - - - - x Axis - Axa X - - - - - Bottom - Jos - - - - - Top - Sus - - - - y Axis - Axa Y - - - - - Axes - Axe - - - - Connect - Conectare - - - - No line - Fără linie - - - - Lines - Linii - - - - Sticks - Beţe - - - - Horizontal Steps - Trepte orizontale - - - - Dots - Puncte - - - - Spline - Metodă de interpolare - - - - Vertical Steps - Trepte verticale - - - - - - Apply Format &to - Aplică forma&tul - - - - - - Selected Curve - Curba curentă - - - - Fill area under curve - Umple suprafaţa de sub curbă - - - - Fill color - Culoare de umplere - - - - - - - Line - Linie - - - - - Fill Color - Culoare de umplere - - - - - Edge Color - - - - - - Edge Width - Grosimea marginii - - - - - Skip Points - Sări puncte - - - - - None - Niciunul - - - - - - - Symbol - Simbol - - - - - Box - Cutie - - - - - Type - Tip - - - - No Box - Fără cutie - - - - Rectangle - Dreptunghi - - - - Diamond - Diamant - - - - Perc 10, 25, 75, 90 - Procente 10, 25, 75, 90 - - - - Notch - Crestătură - - - - - Range - Interval - - - - - - Standard Deviation - Deviaţia standard - - - - - Standard Error - Eroare standard - - - - Perc 25, 75 - Procente 25, 75 - - - - Perc 10, 90 - Procente 10, 90 - - - - Perc 5, 95 - Procente 5, 95 - - - - Perc 1, 99 - Procente 1, 99 - - - - - Max-Min - Max-Min - - - - - Constant - Constant - - - - - Percentile (%) - Percentile (%) - - - - Coefficient - Coeficient - - - - Box Width - Lăţime cutie - - - - Whiskers - Mustăţi - - - - No Whiskers - Fără mustăţi - - - - 75-25 - 75-25 - - - - 90-10 - 90-10 - - - - 95-5 - 95-5 - - - - 99-1 - 99-1 - - - - Coef - Coeficient - - - - - Box/Whiskers - Cutie/Mustăţi - - - - Max - Maxim - - - - 99% - 99% - - - - - Mean - Medie - - - - 1% - 1% - - - - Min - Minim - - - - - Percentile - Percentile - - - - - Image - Imagine - - - - &Gray Scale - Scară de &griuri - - - - &Default Color Map - &Paletă de culori liniară - - - - &Custom Color Map - Paletă &personalizată - - - - - Contour Lines - Linii de contour - - - - Levels - Nivele - - - - Use &Color Map - Foloseşte paleta de &culori - - - - Use Default &Pen - Foloseşte stilul im&plicit - - - - Color Bar Scale - Scară de culoare - - - - Axis - Axă - - - - Contour - Contur - - - - Direction - Direcţie - - - - Plus - Plus - - - - Minus - Minus - - - - &X Error Bar - Bare de eroare în &X - - - - - Line Width - Grosimea liniei - - - - Cap Width - Lungime linie - - - - 8 - 8 - - - - 10 - 10 - - - - 12 - 12 - - - - 16 - 16 - - - - 20 - 20 - - - - Through Symbol - Prin simbol - - - - - - Error Bars - Bare de eroare - - - - Automatic Binning - Eşantionaj automat - - - - &Show statistics - Afişază &statistici - - - - Bin Size - Pas de eşantionaj - - - - Begin - Început - - - - End - Sfârşit - - - - - Histogram Data - Date histogramă - - - - Gap Between Bars (in %) - Spaţiu între bare (în %) - - - - Offset (in %) - Distanţă (in %) - - - - - Spacing - Margini - - - - Arrowheads - Capete săgeţi - - - - Length - Lungime - - - - - Angle - Unghi - - - - &Filled - &Umplut - - - - - End Point - Punct de sfarşit - - - - - X End - X Sfârşit - - - - - Y End - Y Sfârşit - - - - Position - Poziţie - - - - Tail - Coadă - - - - Middle - Mijloc - - - - Head - Capăt - - - - - Vector - Vector - - - - - - Bins - Eşantioane - - - - - Histogram and Probabilities for - Histogramă şi probabilitaţi pentru - - - - Quantity - Cantitate - - - - Sum - Sumă - - - - Percent - Procent - - - - Minimum - Minim - - - - Maximum - Maxim - - - - &Delete - Şte&rge - - - - - &Edit... - &Editare... - - - - - Colors - Culori - - - - Pie - Placintă - - - - Vertical Bars - Bare verticale - - - - Horizontal Bars - Bare orizontale - - - - Histogram - Histogramă - - - - Vector XYXY - Vectori XYXY - - - - Vector XYAM - Vectori XYAM - - - - Scatter - Simbol - - - - Line + Symbol - Linie + Simbol - - - - - - - QtiPlot - Input error - QtiPlot - Eroare - - - - Please enter a valid start limit! - Vă rugăm introduceţi o limita de început validă! - - - - Please enter a valid end limit! - Vă rugăm introduceţi o limita de sfarşit validă! - - - - Please enter a valid bin size value! - Vă rugăm introduceţi un pas de eşantionajului valid! - - - - QtiPlot - Start limit error - QtiPlot - Eroare detectată la valoarea de start - - - - QtiPlot - End limit error - QtiPlot - Eroare detectată la valoarea de sfarşit - - - - Please enter limits that satisfy: begin < end! - Vă rugam să introduceţi limite care satisfac condiţia: început < sfarşit ! - - - - - QtiPlot - Bin size input error - QtiPlot - Eroare detectată în pasul de eşantionaj - - - - Please enter a positive bin size value! - Vă rugăm introduceţi un pas de eşantionajului pozitiv! - - - - Vector Data - Date vector - - - - Magnitude - Magnitudine - - - Show Equidistant Levels - Afişază nivelele echidistante - - - First Level - Primul nivel - - - Distance between Levels - Distanţa între nivele - - - - Pen - Creion - - - - Matrix - Matrice - - - - Use matrix formula to calculate values - Utilizează formula matricei pentru calculul valorilor - - - - - Values - Valori - - - - &Show Contour Lines - Afişa&ză linii de contour - - - - Set Equidistant Levels - Afişază nivelele echidistante - - - - Start - Start - - - - Step - Pas - - - - Set &Levels - Defineşte nive&lele - - - - Use &Table Custom Pen - Foloseşte &valorile din tabel - - - - PlotWizard - - - QtiPlot - Select Columns to Plot - QtiPlot - Selecţionaţi coloanele pe care vreţi să le afişaţi - - - - &X - &X - - - - x&Err - x&Err - - - - &Y - &Y - - - - yE&rr - yE&rr - - - - &Z - &Z - - - - &New curve - Curbă &nouă - - - - &Delete curve - Şterge cur&ba - - - - Worksheet - Tabel - - - - &Plot - &Trasează - - - - &Close - În&chide - - - - - - - - - - - - - - - - - - - QtiPlot - Error - QtiPlot - Eroare - - - - Please define a Y column for the following curve - Vă rugăm să definiţi mai întâi o coloană de tip Y pentru curba - - - - You have already defined a X column! - Aţi definit deja o coloană X! - - - - - - - You must define a X column first! - Vă rugam să definiţi mai întâi o coloana de tip X! - - - - You have already defined a Y column! - Aţi definit deja o coloană Y! - - - - - - This kind of curve is not handled by QtiPlot! - Acest tip de curbă nu este înţeles de QtiPlot! - - - - You have already defined a Z column! - Aţi definit deja o coloană Z! - - - - - You must define a Y column first! - Vă rugam să definiţi mai întâi o coloana de tip Y! - - - - - You have already defined an error-bars column! - Aţi definit deja o coloană cu barele de eroare! - - - - You must add a new curve first! - Vă rugam să adăugaţi mai întâi o curbă! - - - - PluginFit - - - Plugin Fit - Ajustare folosind o extensie - - - - QtiPlot - File not found - QtiPlot - Fişierul nu a fost găsit - - - - Plugin file: <p><b> %1 </b> <p>not found. Operation aborted! - Fişierul extensie<p><b> %1 </b> <p>nu a fost găsit! Operaţiunea a fost abandonată! - - - - - - - QtiPlot - Plugin Error - QtiPlot - Eroare extensie - - - - The plugin does not implement a %1 method necessary for simplex fitting. - Extensia nu implementează metoda %1 necesară pentru ajustările de tip simplex. - - - - - - The plugin does not implement a %1 method necessary for Levenberg-Marquardt fitting. - Extensia nu implementează metoda %1 necesară pentru ajustările de tip Levenberg-Marquardt. - - - - PolynomFitDialog - - - QtiPlot - Polynomial Fit Options - QtiPlot - Opţiuni de ajustare polinomială - - - - Polynomial Fit of - Ajustare polinomială a curbei - - - - Order (1 - 9, 1 = linear) - Ordin (1 - 5, 1 = ajustare liniară) - - - - Fit curve # pts - Puncte de ajustare - - - - Not enough points - Nu există îndeajuns de multe puncte - - - - Fit curve Xmin - Începutul curbei (Xmin) - - - - Fit curve Xmax - Sfarşitul curbei (Xmax) - - - - Color - Culoare - - - - Show Formula on Graph? - Afişaţi formula în grafic? - - - - &Fit - &Ajustează - - - - &Close - În&chide - - - - QtiPlot - Warning - QtiPlot - Avertisment - - - - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! - Curba <b> %1 </b> nu mai există! Operaţiunea a fost abandonată! - - - - PolynomialFit - - - Polynomial - Polinomial - - - - Polynomial Fit - Ajustare polinomială - - - - QtiPlot - Fit Error - QtiPlot - Eroare de ajustare - - - - You need at least %1 data points for this fit operation. Operation aborted! - Aveţi nevoie de cel puţin %1 puncte pentru a efectua operaţia de ajustare. Operaţia fost abandonată! - - - - PythonScripting - - - Failed to export QtiPlot API - Eroare de export a interfeţei de programare QtiPlot - - - Accessing QtiPlot functions or objects from Python code won't work.Probably your version of SIP differs from the one QtiPlot was compiled against. - Accesarea funcţiilor sau a obiectelor din QtiPlot folosind cod Python nu este posibilă. Probabil folosiţi o versiune SIP diferită de cea folosită pentru a compila QtiPlot. - - - - Accessing QtiPlot functions or objects from Python code won't work. Probably your version of Qt/SIP/PyQt differs from the one QtiPlot was compiled against. - Accesarea funcţiilor sau a obiectelor din QtiPlot folosind cod Python nu este posibilă. Probabil folosiţi o versiune Qt/SIP/PyQt diferită de cea folosită pentru a compila QtiPlot. - - - - QObject - - - The file is not an QtiPlot fit model file. - Fişierul nu este un fişier model de ajustare creat de QtiPlot. - - - - The file is not an QtiPlot fit model version 1.0 file. - Fişierul nu este un fişier model de ajustare cu versiunea 1.0 creat de QtiPlot. - - - - The file is not a QtiPlot custom action file. - Fişierul nu este un fişier conţinand o acţiune personalizată creat de QtiPlot. - - - - The file is not an QtiPlot custom action version 1.0 file. - Fişierul nu este un fişier conţinand o acţiune personalizată cu versiunea 1.0 creat de QtiPlot. - - - - The file is not a QtiPlot custom menu file. - Fişierul nu este un fişier conţinand un meniu personalizat creat de QtiPlot. - - - - The file is not a QtiPlot custom menu version 1.0 file. - Fişierul nu este un fişier de tip meniu personalizat cu versiunea 1.0 creat de QtiPlot. - - - - QtiPlot - Script Error - QtiPlot - Eroare de programare - - - - Python-like syntax is not supported in this case since it severely reduces drawing speed! - Sintaxa Python nu este acceptată deoarece reduce drastic viteza de afişaj! - - - - abs(x): - Absolute value of x. - abs(x): - Modulul lui x. - - - - acos(x): - Inverse cos function. - acos(x): - Funcţia cosinus inversă. - - - - acosh(x): - Hyperbolic inverse cos function. - acosh(x): - Funcţia cosinus hiperbolică inversă. - - - - asin(x): - Inverse sin function. - asin(x): - Funcţia sinus inversă. - - - - asinh(x): - Hyperbolic inverse sin function. - asinh(x): - Funcţia sinus hiperbolică inversă. - - - - atan(x): - Inverse tan function. - atan(x): - Funcţia tangentă inversă. - - - - atanh(x): - Hyperbolic inverse tan function. - atanh(x): - Funcţia tangentă hiperbolică inversă. - - - - avg(x,y,...): - Mean value of all arguments. - avg(x,y,...): - Valoarea medie a tuturor argumentelor. - - - - cos(x): - Calculate cosine. - cos(x): - Calculează cosinus. - - - - if(e1, e2, e3): - if e1 then e2 else e3. - if(e1, e2, e3): - dacă e1 atunci e2 altfel e3. - - - - ln(x): - Calculate natural logarithm log_e. - ln(x): - Calculează logaritmul natural log_e. - - - - log(x): - Calculate decimal logarithm log_10. - log(x): - Calculează logaritmul zecimal log_10. - - - - log10(x): - Calculate decimal logarithm log_10. - log10(x): - Calculează logaritmul zecimal log_10. - - - - log2(x): - Calculate binary logarithm log_2. - log2(x): - Calculează logaritmul în baza doi log_2. - - - - cosh(x): - Hyperbolic cos function. - cosh(x): - Funcţia cosinus hiperbolică. - - - - bessel_j0(x): - Regular cylindrical Bessel function of zeroth order, J_0(x). - - - - - bessel_j1(x): - Regular cylindrical Bessel function of first order, J_1(x). - - - - - bessel_jn(double x, int n): - Regular cylindrical Bessel function of order n, J_n(x). - - - - - bessel_jn_zero(double n, unsigned int s): - s-th positive zero x_s of regular cylindrical Bessel function of order n, J_n(x_s)=0 - - - - - bessel_y0(x): - Irregular cylindrical Bessel function of zeroth order, Y_0(x), for x>0. - - - - - bessel_y1(x): - Irregular cylindrical Bessel function of first order, Y_1(x), for x>0. - - - - - bessel_yn(double x, int n): - Irregular cylindrical Bessel function of order n, Y_n(x), for x>0. - - - - - beta(a,b): - Computes the Beta Function, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) for a > 0, b > 0. - - - - - ceil(x): - Round to the next larger integer, - smallest integer larger or equal to x. - - - - - erf(x): - The error function. - erf(x): Funcţia eroare. - - - - erfc(x): - Complementary error function erfc(x) = 1 - erf(x). - erfc(x): - Funcţia eroare complementară erfc(x) = 1 - erf(x). - - - - erfz(x): - The Gaussian probability density function Z(x). - - - - - erfq(x): - The upper tail of the Gaussian probability function Q(x). - - - - - exp(x): - Exponential function: e raised to the power of x. - exp(x): - Funcţia exponentială: e la puterea x. - - - - floor(x): - Round to the next smaller integer, - largest integer smaller or equal to x. - - - - - gamma(x): - Computes the Gamma function, subject to x not being a negative integer. - - - - - gammaln(x): - Computes the logarithm of the Gamma function, subject to x not a being negative integer. For x<0, log(|Gamma(x)|) is returned. - - - - - gauss_cdf(x, sigma): - Computes the cumulative distribution function for a Gaussian distribution with standard deviation sigma. - - - - - gauss_pdf(x, sigma): - Computes the probability density at x for a Gaussian distribution with standard deviation sigma. - - - - - hazard(x): - Computes the hazard function for the normal distribution h(x) = erfz(x)/erfq(x). - - - - - inv_gauss_cdf(x, sigma): - Computes the inverse of the cumulative distribution function for a Gaussian distribution with standard deviation sigma. - - - - - min(x,y,...): - Calculate minimum of all arguments. - min(x,y,...): - Calculează minimul dintre toate argumentele. - - - - max(x,y,...): - Calculate maximum of all arguments. - max(x,y,...): - Calculează maximul dintre toate argumentele. - - - - mod(x,y): - Calculate rest of integer division x/y, - x modulo y. - mod(x,y): - Calculează restul împarţirii lui x la y, - x modulo y. - - - - pow(x,y): - Raise x to the power of y, x^y. - pow(x,y): - Ridică pe x la puterea y, x^y. - - - - rint(x): - Round to nearest integer. - rint(x): - Rotunjeşte la cel mai apropiat întreg. - - - - sign(x): - Sign function: -1 if x<0; 1 if x>0. - sign(x): - Funcţia semn: -1 if x<0; 1 if x>0. - - - - sin(x): - Calculate sine. - cos(x): - Calculează sinus. - - - - sinh(x): - Hyperbolic sin function. - sinh(x): - Funcţia sinus hiperbolică. - - - - sqrt(x): - Square root function. - sqrt(x): - Rădăcină pătrată. - - - - sum(x,y,...): - Calculate sum of all arguments. - sum(x,y,...): - Calculează suma tuturor argumentelor. - - - - tan(x): - Calculate tangent function. - tan(x): - Funcţia tangentă. - - - - tanh(x): - Hyperbolic tan function. - tanh(x): - Funcţia tangentă hiperbolică. - - - - ttable(x, n): - Student's t-distribution with n degrees of freedom. - - - - - w0(x): - Compute the principal branch of Lambert's W function, W_0(x). - W is defined as a solution to the equation W(x)*exp(W(x))=x. - For x<0, there are two real-valued branches; this function computes the one where W>-1 for x<0 (also see wm1(x)). - - - - - wm1(x): - Compute the secondary branch of Lambert's W function, W_{-1}(x). - W is defined as a solution to the equation W(x)*exp(W(x))=x. - For x<0, there are two real-valued branches; this function computes the one where W<-1 for x<0. (also see w0(x)). - - - - - QtiPlot - Math Error - QtiPlot - Eroare - - - Found non-removable singularity at x = %1. Operation aborted! - O singularitate a fost detectată pentru x = %1. Operaţiune abandonată! - - - - QtiPlot - QtiPlot - - - - Ignored data point at x = %1. - Punctul x = %1 a fost ignorat. - - - - Found non-removable singularity at x = %1. - O singularitate a fost detectată pentru x = %1. - - - - QtColorPicker - - - - - Black - Negru - - - - - White - Alb - - - - - Red - Roşu - - - - - Dark red - Roşu închis - - - - - Green - Verde - - - - - Dark green - Verde închis - - - - - Blue - Albastru - - - - - Dark blue - Albastru închis - - - - - Cyan - Turcoaz - - - - - Dark cyan - Turcoaz închis - - - - - Magenta - Magenta - - - - - Dark magenta - Magenta închis - - - - - Yellow - Galben - - - - - Dark yellow - Galben închis - - - - - Gray - Gri - - - - - Dark gray - Gri închis - - - - - Light gray - Gri deschis - - - - Custom - Personalizată - - - - RangeSelectorTool - - - - - - - - QtiPlot - Warning - QtiPlot - Avertisment - - - - All the curves on this plot are empty! - Toate curbele din acest grafic sunt vide! - - - - Click or use Ctrl+arrow key to select range (arrows select active cursor)! - Daţi click sau apăsaţi tastele Ctrl+săgeţi pentru a selecta intervalul (săgeţile slectează curba activă)! - - - - - - Right - Dreapta - - - - - - Left - Stânga - - - - - - - - The column '%1' is read-only! Operation aborted! - Coloana '%1' nu poate fi modificată! Operaţiune abandonată! - - - - Remove data from curves? - Vreţi să ştergeţi datele? - - - - Copy data to clipboard? - Copiază datele? - - - - RenameWindowDialog - - - QtiPlot - Rename Window - QtiPlot - Redenumire fereastră - - - - Window Title - Titlu - - - - &Name (single word) - &Nume (un singur cuvânt) - - - - &Label - &Etichetă - - - - &Both Name and Label - Ş&i nume şi etichetă - - - - &OK - &OK - - - - &Cancel - &Anulează - - - - QtiPlot - Warning - QtiPlot - Avertisment - - - - For internal consistency reasons the underscore character is replaced with a minus sign. - Avertisment: din motive legate de reprezentarea internă folosită de QtiPlot, caracterul "_" va fi înlocuit cu semnul minus '-'. - - - - ScreenPickerTool - - - Click on plot or move cursor to display coordinates! - Daţi click pe grafic sau mişcaţi cursorul pentru a afişa coordonatele! - - - - ScriptEdit - - - E&xecute - E&xecută - - - - Ctrl+J - Ctrl+J - - - - Execute &All - Execută &tot - - - - Ctrl+Shift+J - Ctrl+Shift+J - - - - &Evaluate Expression - &Evaluează expresia - - - - Ctrl+Return - Ctrl+Return - - - - &Print - Im&primă - - - - &Import... - &Importă... - - - - &Save - &Salvează - - - - Sa&ve as... - Salvează c&a... - - - - &Find... - &Caută... - - - - &Replace... - În&locuieşte... - - - - &Find next - Caută apariţia &următoare - - - - &Find previous - Caută apariţia &precedentă - - - - Rena&me Tab... - Rede&numeşte fila... - - - - A&dd Tab - A&daugă filă - - - - C&lose Tab - Închidere &fila - - - - Auto&exec - Auto-&execută - - - - &Functions - &Funcţii - - - - - Text - Text - - - - - All Files - Toate fişierele - - - - QtiPlot - Import Text From File - QtiPlot - Importă text din fişier - - - - QtiPlot - Error Opening File - QtiPlot - Eroare de deschidere fişier - - - - Could not open file "%1" for reading. - Nu a fost posibilă citirea fişierului "%1" . - - - - Save Text to File - Salvează text în fişier - - - - QtiPlot - File Save Error - QtiPlot - Eroare de salvare a fişerului - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - Nu a fost posibilă scrierea în fişierul: <br><h4> %1 </h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie! - - - - QtiPlot - QtiPlot - - - - QtiPlot has finished searching the document. - QtiPlot a terminat de căutat în document. - - - - ScriptWindow - - - - QtiPlot - Script Window - QtiPlot - Fereastră programare - - - - - &File - &Fişier - - - - - &Edit - &Editare - - - - - - - E&xecute - E&xecută - - - - &Window - &Fereastră - - - - - &New - &Nou - - - - - Ctrl+N - Ctrl+N - - - - - &Open... - &Deschide... - - - - - Ctrl+O - Ctrl+O - - - - - &Save - &Salvează - - - - - Ctrl+S - Ctrl+S - - - - - Save &As... - Salvează c&a... - - - - - &Print - Im&primă - - - - - Ctrl+P - Ctrl+P - - - - - &Undo - An&ulează - - - - - Ctrl+Z - Ctrl+Z - - - - - &Redo - &Refă - - - - - Ctrl+Y - Ctrl+Y - - - - - &Cut - &Taie - - - - - Ctrl+x - Ctrl+X - - - - - &Copy - &Copiază - - - - - Ctrl+C - Ctrl+C - - - - - &Paste - Li&peşte - - - - - Ctrl+V - Ctrl+V - - - - - Increase Indent - Măreşte identarea - - - - - Decrease Indent - Micşorează identarea - - - - - &Find... - &Caută... - - - - - Ctrl+Alt+F - Ctrl+Alt+F - - - - - Find &Next - Caută apariţia &următoare - - - - - F3 - F3 - - - - - Find &Previous - Caută apariţia &precedentă - - - - - F4 - F4 - - - - - &Replace... - În&locuieşte... - - - - Show &Line Numbers - Afişază numărul &liniei - - - - - CTRL+J - Ctrl+J - - - - - Execute &All - Execută &tot - - - - - CTRL+SHIFT+J - Ctrl+Shift+J - - - - - &Evaluate Expression - &Evaluează expresia - - - - - CTRL+Return - Ctrl+Return - - - - Always on &Top - În&totdeauna deasupra - - - &Hide - Ascu&nde - - - - QtiPlot - File Save Error - QtiPlot - Eroare de salvare a fişerului - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - Nu a fost posibilă scrierea în fişierul: <br><h4> %1 </h4><p>Vă rugam să verificaţi că aveţi drept de scriere in această locaţie! - - - - You need to close and reopen the script window before your changes become effective! Do you want to close it now? - Trebuie să închideţi şi să redeschideţi fereastra de script pentru ca noile setări să funcţioneze! Vreţi să o închideţi acum? - - - - - QtiPlot - QtiPlot - - - - - Script Output Panel - Fereastră cu rezultate - - - - - Show Script &Output Panel - Arată fereastra cu &rezultate - - - - - Ouput on Next &Line - Afişază rezultatul pe &linia următoare - - - - Show Script Output Panel - Arată fereastra cu rezultate - - - - - Print Pre&view... - &Previzualizare tipărire... - - - - Script print preview - Previzualizare tipărire script - - - - - &Close - În&chide - - - - - Show &Workspace - Arată &spaţiul de lucru - - - - ScriptingEnv - - - %1 Source (*.%2);; - %1 Sursă (*.%2);; - - - - ScriptingLangDialog - - - QtiPlot - Select scripting language - QtiPlot - Alegeţi limbajul de programare - - - - OK - OK - - - - Cancel - Anulează - - - - QtiPlot - Scripting Error - QtiPlot - Eroare de programare - - - - Scripting language "%1" failed to initialize. - Limbajul de programare "%1" nu a putut fi iniţializat. - - - - SetColValuesDialog - - - QtiPlot - Set column values - QtiPlot - Calculează valorile coloanei - - - - For row (i) - De la linia (i) - - - - to - până la - - - - Add function - Adaugă funcţie - - - - Add column - Adaugă coloană - - - - Add cell - Adaugă celulă - - - - &Apply - &Aplică - - - - &Close - În&chide - - - - Use built-in muParser (much faster) - Foloseşte muParser (mult mai rapid) - - - - Clear &Formulas - Şterge &formulele - - - - SigmoidalFit - - - Boltzmann - Boltzmann - - - - init value - Valoare iniţială - - - - final value - Valoare finală - - - - center - Centru - - - - time constant - Constanta de timp - - - - Boltzmann (Sigmoidal) Fit - Ajustare Boltzmann (Sigmoidală) - - - - SmoothCurveDialog - - - QtiPlot - Smoothing Options - QtiPlot - Opţiuni de netezire - - - - Curve - Curbă - - - - Polynomial Order - Ordinul polinomului - - - - Points to the Left - Puncte la stânga - - - - Points to the Right - Puncte la dreapta - - - - - - Color - Culoare - - - - f - - - - - Iterations - Iteraţii - - - - Points - Puncte - - - - &Smooth - &Netezeşte - - - - &Close - În&chide - - - - SmoothFilter - - - Smoothed - Neted - - - - - - - - - - - QtiPlot - QtiPlot - - - - - - - - - - - Error - Eroare - - - Unknown smooth filter. Valid values are: 1 - Savitky-Golay, 2 - FFT, 3 - Moving Window Average. - Tip de filtru necunoscut! Valorile valide sunt: 1 - Savitky-Golay, 2 - FFT, 3 - Medie glisantă. - - - - Unknown smooth filter. Valid values are: 1 - Savitky-Golay, 2 - FFT, 3 - Moving Window Average, 4 - Lowess. - - - - - - - - points - puncte - - - - Savitzky-Golay smoothing - Netezire Savitzky-Golay - - - - FFT smoothing - Netezire FFT - - - - average smoothing - Netezire prin mediere - - - - Lowess smoothing - - - - - The number of points must be positive! - Numărul de puncte trebuie să fie o valoare pozitivă! - - - - - The polynomial order must be lower than the number of left points plus the number of right points! - Ordinul polinomului trebuie să fie mai mic decat numărul de puncte la stânga adunat cu numărul de puncte la dreapta! - - - - Setting polynomial order is only available for Savitzky-Golay smooth filters! Ignored option! - Definirea ordinului polinomului este disounibilă numai pentru filtrele de netezire de tip Savitzky-Golay! Opţiunea va fi ignorată! - - - - Setting Lowess parameter is only available for Lowess smooth filters! Ignored option! - - - - - The parameter f must be between 0 and 1! - - - - - The number of iterations must be at least 1! - - - - - SortDialog - - - QtiPlot - Sorting Options - QtiPlot - Opţiuni de sortare - - - - Sort columns - Sortează coloanele - - - - Separately - Separat - - - - Together - Împreună - - - - Order - Ordinea de sortare - - - - Ascending - Ascendentă - - - - Descending - Descendentă - - - - Leading column - Coloana principală - - - - &Sort - &Sortează - - - - &Close - În&chide - - - - SurfaceDialog - - - QtiPlot - Define surface plot - QtiPlot - Definiţi suprafaţa 3D - - - - Surface type - Tip de suprafaţă - - - - Function - Funcţie - - - - Parametric - Parametrică - - - - Clear &list - Go&leşte lista - - - - &OK - &OK - - - - &Close - În&chide - - - - f(x,y)= - f(x,y)= - - - - X - axis - Axa X - - - -1 - -1 - - - 1 - 1 - - - - - - - - From - De la - - - - - - - - To - Pană la - - - - Y - axis - Axa Y - - - - Z - axis - Axa Z - - - - - Mesh - Eşantionaj - - - - - Columns - Coloane - - - - - Rows - Linii - - - - Equations - Ecuaţii - - - - X(u,v)= - X(u,v)= - - - - Y(u,v)= - Y(u,v)= - - - - Z(u,v)= - Z(u,v)= - - - - u - u - - - - - Periodic - Periodic - - - - v - v - - - - QtiPlot - X Formula Error - QtiPlot - Eroare în formula introdusă pentru X - - - - QtiPlot - Y Formula Error - QtiPlot - Eroare în formula introdusă pentru Y - - - - QtiPlot - Z Formula Error - QtiPlot - Eroare în formula introdusă pentru Z - - - - QtiPlot - u start limit error - QtiPlot - Eroare detectată la valoarea de început pentru parametrul u - - - - - QtiPlot - u end limit error - QtiPlot - Eroare detectată la valoarea de sfarşit pentru parametrul u - - - - QtiPlot - v start limit error - QtiPlot - Eroare detectată la valoarea de început pentru parametrul v - - - QtiPlot - X Start limit error - QtiPlot - Eroare detectată la valoarea de început pentru X - - - QtiPlot - X End limit error - QtiPlot - Eroare detectată la valoarea de sfarşit pentru X - - - QtiPlot - Y Start limit error - QtiPlot - Eroare detectată la valoarea de început pentru Y - - - QtiPlot - Y End limit error - QtiPlot - Eroare detectată la valoarea de sfarşit pentru Y - - - QtiPlot - Z Start limit error - QtiPlot - Eroare detectată la valoarea de început pentru Z - - - QtiPlot - Z End limit error - QtiPlot - Eroare detectată la valoarea de sfarşit pentru Z - - - - QtiPlot - Input error - QtiPlot - Eroare - - - - Please enter limits that satisfy: from < end! - Vă rugam să introduceţi limite care satisfac condiţia: început < sfarşit ! - - - - QtiPlot - Input function error - QtiPlot - Eroare detectată în funcţia introdusă - - - - SymbolBox - - - No Symbol - Fără simbol - - - - Ellipse - Elipsă - - - - Rectangle - Dreptunghi - - - - Diamond - Diamant - - - - Triangle - Triunghi - - - - Down Triangle - Triunghi îndreptat în jos - - - - Up Triangle - Triunghi îndreptat în sus - - - - Left Triangle - Triunghi îndreptat la stânga - - - - Right Triangle - Triunghi îndreptat la dreapta - - - - Cross - Cruce - - - - Diagonal Cross - Cruce diagonală - - - - Horizontal Line - Linie orizontală - - - - Vertical Line - Linie verticală - - - - Star 1 - Stea 1 - - - - Star 2 - Stea 2 - - - - Hexagon - Hexagon - - - - SymbolDialog - - - &Close - În&chide - - - - QtiPlot - Choose Symbol - QtiPlot - Alegeţi simbolul - - - - Table - - - Multiline expressions take much more time to evaluate! Do you want to continue anyways? - Evaluarea expresiilor conţinand mai multe linii durează mult mai mult timp! Doriţi să continuaţi? - - - - - - - QtiPlot - QtiPlot - - - - Warning - Avertisment - - - - - - - - - - - - - - - - - - QtiPlot - Error - QtiPlot - Eroare - - - - - - Column '%1' is read only! - Coloana '%1' nu poate fi modificată! - - - - There is already a column called : <b> - Există deja o coloană denumită: <b> - - - - The table '%1' contains read-only columns! Operation aborted! - Tabelul '%1' conţine numai coloane care nu pot fi modificate! Operaţiune abandonată! - - - - - - - - - - - The folowing columns - Coloanele următoare - - - - - - - - - - - are read only! - nu pot fi modificate! - - - - Paste operation - Lipeşte - - - - How should QtiPlot interpret first clipboard line? - Cum trebuie QtiPlot să interpreteze prima linie? - - - - &Values - &Valori - - - - Column &Names - &Nume coloană - - - - &Comments - Co&mentarii - - - - Please indicate the name of the leading column! - Vă rugam să indicaţi numele coloanei principale! - - - The leading column has the type set to 'Text'! Operation aborted! - Coloana principală este de tip 'Text'! Operaţie abandonată! - - - - The leading column is empty! Operation aborted! - Coloana principală este vidă! Operaţie abandonată! - - - - Qtiplot - QtiPlot - - - - Reading file... - Citire fişier... - - - - QtiPlot - ASCII Export Error - QtiPlot - Eroare de export ASCII - - - - Could not write to file: <br><h4> - Nu a fost posibilă scrierea în fişierul: <br><h4> - - - - Rows will be deleted from the table! - Din tabel vor fi şterse linii! - - - - - Do you really want to continue? - Doriţi intr-adevăr să continuaţi? - - - - - Yes - Da - - - - - Cancel - Anulează - - - - Columns will be deleted from the table! - Din tabel vor fi şterse coloane! - - - - kB - kilobiţi - - - - TableDialog - - - QtiPlot - Column options - QtiPlot - Opţiuni pentru coloană - - - - Column Name: - Numele coloanei: - - - - Enumerate all to the right - Numerotează toate coloanele la dreapta - - - - &OK - &OK - - - - &Apply - &Aplică - - - - &Cancel - A&nulează - - - - Plot Designation: - Tip de date: - - - - None - Ignoră - - - - X (abscissae) - X (abscise) - - - - Y (ordinates) - Y (ordonate) - - - - Z (height) - Z (înălţime) - - - - X Error - Erori în X - - - - Y Error - Erori în Y - - - - Label - Etichete - - - - Display - Afişaj - - - - Numeric - Numeric - - - - Text - Text - - - - Date - Dată - - - - Time - Timp - - - - Month - Lună - - - - Day of Week - Zi a săptămanii - - - - Format: - Format: - - - - Precision: - Precizie: - - - - &Read-only - Numai citi&re - - - - &Hidden - A&scunde - - - - Apply to all columns to the right - Aplică tuturor coloanelor din dreapta - - - - Options - Opţiuni - - - - Column Width: - Lăţimea coloanei: - - - - Apply to all - Aplică tuturor coloanelor - - - - &Display Comments in Header - A&fişază comentariile - - - - Comment: - Comentariu: - - - - QtiPlot - Warning - QtiPlot - Avertisment - - - - For internal consistency reasons the underscore character is replaced with a minus sign. - Avertisment: din motive legate de reprezentarea internă folosită de QtiPlot, caracterul "_" va fi înlocuit cu semnul minus '-'. - - - - - QtiPlot - Error - QtiPlot - Eroare - - - - The column names must only contain letters and digits! - Numele de coloane trebuie să conţină doar litere şi cifre! - - - - Default - Implicit - - - - Decimal: 1000 - Zecimal: 100.0 - - - - Scientific: 1E3 - Ştiinţific: 1E3 - - - - dd/MM/yyyy - zz/LL/aaaa - - - - dd/MM/yyyy HH:mm - zz/LL/aaaa OO:mm - - - - dd/MM/yyyy HH:mm:ss - zz/LL/aaaa OO:mm:ss - - - - dd.MM.yyyy - zz.LL.aaaa - - - - dd.MM.yyyy HH:mm - zz.LL.aaaa OO:mm - - - - dd.MM.yyyy HH:mm:ss - zz.LL.aaaa OO:mm:ss - - - - dd MM yyyy - zz LL aaaa - - - - dd MM yyyy HH:mm - zz LL aaaa OO:mm - - - - dd MM yyyy HH:mm:ss - zz LL aaaa OO:mm:ss - - - - yyyy-MM-dd - aaaa-LL-zz - - - - yyyy-MM-dd HH:mm - aaaa-LL-zz OO:mm - - - - yyyy-MM-dd HH:mm:ss - aaaa-LL-zz OO:mm:ss - - - - yyyyMMdd - aaaaLLzz - - - - yyyyMMdd HH:mm - aaaaLLzz OO:mm - - - - yyyyMMdd HH:mm:ss - aaaaLLzz OO:mm:ss - - - - h - o - - - - h ap - o ap - - - - h AP - o AP - - - - h:mm - o:mm - - - - h:mm ap - o:mm ap - - - - hh:mm - oo:mm - - - - h:mm:ss - o:mm:ss - - - - h:mm:ss.zzz - o:mm:ss.zzz - - - - mm:ss - - - - - mm:ss.zzz - - - - - hmm - omm - - - - hmmss - ommss - - - - hhmmss - oommss - - - - Couldn't guess the source data format, please specify it using the 'Format' box! - Formatul datelor sursă nu aputut fi determinat, vă rugăm să-l specificaţi utilizand lista 'Format'! - - - - For more information about the supported date/time formats please read the Qt documentation for the QDateTime class! - Pentru mai multe informaţii legate de formatul dată/timp vă rugăm să citiţi documentation Qt pentru clasa QDateTime! - - - - TableStatistics - - - RowStats - StatisticiLinii - - - - Row Statistics of %1 - Statistici linii pentru setul de date %1 - - - - Row - Linie - - - - Cols - Coloane - - - - - Mean - Medie - - - - - StandardDev - DeviereStandard - - - - - StandardError - EroareStandard - - - - - Variance - Varianţă - - - - - Sum - Sumă - - - - - Max - Maxim - - - - - Min - - - - - ColStats - StatisticiColoane - - - - Column Statistics of %1 - Statistici coloane pentru setul de date %1 - - - - Col - Coloană - - - - Rows - Linii - - - - iMax - iMax - - - - iMin - iMin - - - - - Median - Median - - - - TextDialog - - - QtiPlot - Text options - QtiPlot - Opţiunile textului - - - - Text Color - Culoare - - - - Font - Font - - - - &Font - &Font - - - - Alignment - Aliniere - - - - Center - Centrat - - - - Left - Stânga - - - - Right - Dreapta - - - - Distance to axis - Distanţa pană la axă - - - - &Apply to... - Aplică forma&tul... - - - - Object - Obiectului - - - - Layer - Graficului - - - - Window - Fereastrei - - - - All Windows - Tuturor ferestrelor - - - - &Close - În&chide - - - - - - - QtiPlot - QtiPlot - - - - X Axis Title - Titlu axă X - - - - Y Axis Title - Titlu axă Y - - - - Top Axis Title - Titlu axă sus - - - - Right Axis Title - Titlu axă dreapta - - - - &Inverted - &Inversată - - - - TextEditor - - - QtiPlot - QtiPlot - - - - Confirmation - Confirmare - - - - Are you sure you want to add %1 text lines into this text box? - Sunteţi sigur că vreţi să adăugaţi %1 linii acestui text? - - - - TextFormatButtons - - - B - Button bold - - - - - It - Button italics - It - - - - U - Button underline - U - - - - ThreeExpFit - - - ExpDecay3 - ScădereExp3 - - - - Exponential decay - Scădere exponenţială - - - - first amplitude - prima amplitudine - - - - first lifetime - prima durată de viaţă - - - - second amplitude - a doua amplitudine - - - - second lifetime - a doua durată de viaţă - - - - third amplitude - a treia amplitudine - - - - third lifetime - a treia durată de viaţă - - - - offset - constantă - - - - TranslateCurveTool - - - Double-click on plot to select a data point! - Efectuaţi un dublu-click în interiorul graficului pentru a selecta un punct! - - - - - - - QtiPlot - Warning - QtiPlot - Avertisment - - - - - The column '%1' is read-only! Operation aborted! - Coloana '%1' nu poate fi modificată! Operaţiune abandonată! - - - - Curve selected! Move cursor and click to choose a point and double-click/press 'Enter' to finish! - Curbă selecţionată! Mişcaţi cursorul şi efectuaţi un click pentru a alege un punct şi efectuaţi un double-click sau apăsaţi tasta 'Enter' pentru a termina! - - - - This operation cannot be performed on function curves. - Această operaţie nu este disponibilă pentru funcţiis. - - - - This operation cannot be performed on curves plotted from columns having a non-numerical format. - Această operaţie nu poate fi efectuată pentru curbe ce utilizează ca surse de date coloane având un format diferit de cel numeric. - - - - TwoExpFit - - - ExpDecay2 - ScădereExp2 - - - - Exponential decay - Scădere exponenţială - - - - first amplitude - prima amplitudine - - - - first lifetime - prima durată de viaţă - - - - second amplitude - a doua amplitudine - - - - second lifetime - a doua durată de viaţă - - - - offset - constantă - - - - muParserScript - - - col() works only on tables! - funcţia col() poate fi folosită doar pentru tabele! - - - - - There's no column named %1 in table %2! - Nu există o coloană numită %1 în tabelul %2! - - - - - - There's no row %1 in table %2! - Nu există linia %1 în tabelul %2! - - - - - - There's no column %1 in table %2! - Nu există o coloană numită %1 în tabelul %2! - - - - tablecol() works only on tables! - funcţia tablecol() poate fi folosită doar pentru tabele! - - - - tablecol: wrong number of arguments (need 2, got %1) - tablecol: număr incorect de argumente (e nevoie de două, au fost furnizate %1) - - - - tablecol: first argument must be a string (table name) - tablecol: primul argument trebuie să fie un şir de caractere (numele tabelului) - - - - Couldn't find a table named %1. - Nu există un tabel numit %1. - - - - - cell() works only on tables and matrices! - funcţia cell() poate fi folosită doar pentru tabele sau matrici! - - - - There's no row %1 in matrix %2! - Nu există linia %1 în matricea %2! - - - - There's no column %1 in matrix %2! - Nu există coloana %1 în matricea %2! - - - - - - - Out of memory - Memorie insuficientă - - - - muParserScripting - - abs(x): - Absolute value of x. - abs(x): - Modulul lui x. - - - acos(x): - Inverse cos function. - acos(x): - Funcţia cosinus inversă. - - - acosh(x): - Hyperbolic inverse cos function. - acosh(x): - Funcţia cosinus hiperbolică inversă. - - - asin(x): - Inverse sin function. - asin(x): - Funcţia sinus inversă. - - - asinh(x): - Hyperbolic inverse sin function. - asinh(x): - Funcţia sinus hiperbolică inversă. - - - atan(x): - Inverse tan function. - atan(x): - Funcţia tangentă inversă. - - - atanh(x): - Hyperbolic inverse tan function. - atanh(x): - Funcţia tangentă hiperbolică inversă. - - - avg(x,y,...): - Mean value of all arguments. - avg(x,y,...): - Valoarea medie a tuturor argumentelor. - - - cos(x): - Calculate cosine. - cos(x): - Calculează cosinus. - - - cosh(x): - Hyperbolic cos function. - cosh(x): - Funcţia cosinus hiperbolică. - - - erf(x): - The error function. - erf(x): Funcţia eroare. - - - erfc(x): - Complementary error function erfc(x) = 1 - erf(x). - erfc(x): - Funcţia eroare complementară erfc(x) = 1 - erf(x). - - - exp(x): - Exponential function: e raised to the power of x. - exp(x): - Funcţia exponentială: e la puterea x. - - - if(e1, e2, e3): - if e1 then e2 else e3. - if(e1, e2, e3): - dacă e1 atunci e2 altfel e3. - - - ln(x): - Calculate natural logarithm log_e. - ln(x): - Calculează logaritmul natural log_e. - - - log(x): - Calculate decimal logarithm log_10. - log(x): - Calculează logaritmul zecimal log_10. - - - log10(x): - Calculate decimal logarithm log_10. - log10(x): - Calculează logaritmul zecimal log_10. - - - log2(x): - Calculate binary logarithm log_2. - log2(x): - Calculează logaritmul în baza doi log_2. - - - min(x,y,...): - Calculate minimum of all arguments. - min(x,y,...): - Calculează minimul dintre toate argumentele. - - - max(x,y,...): - Calculate maximum of all arguments. - max(x,y,...): - Calculează maximul dintre toate argumentele. - - - mod(x,y): - Calculate rest of integer division x/y, - x modulo y. - mod(x,y): - Calculează restul împarţirii lui x la y, - x modulo y. - - - pow(x,y): - Raise x to the power of y, x^y. - pow(x,y): - Ridică pe x la puterea y, x^y. - - - rint(x): - Round to nearest integer. - rint(x): - Rotunjeşte la cel mai apropiat întreg. - - - sign(x): - Sign function: -1 if x<0; 1 if x>0. - sign(x): - Funcţia semn: -1 if x<0; 1 if x>0. - - - sin(x): - Calculate sine. - cos(x): - Calculează sinus. - - - sinh(x): - Hyperbolic sin function. - sinh(x): - Funcţia sinus hiperbolică. - - - sqrt(x): - Square root function. - sqrt(x): - Rădăcină pătrată. - - - sum(x,y,...): - Calculate sum of all arguments. - sum(x,y,...): - Calculează suma tuturor argumentelor. - - - tan(x): - Calculate tangent function. - tan(x): - Funcţia tangentă. - - - tanh(x): - Hyperbolic tan function. - tanh(x): - Funcţia tangentă hiperbolică. - - - === modified file 'qtiplot/translations/qtiplot_ru.ts' --- qtiplot/translations/qtiplot_ru.ts 2009-12-08 18:06:27 +0000 +++ qtiplot/translations/qtiplot_ru.ts 2010-07-21 23:21:08 +0000 @@ -4,23 +4,18 @@ AddWidgetTool - Click on plot to choose the position of the new object! Щёлкните на графике для выбора положения нового объекта! - - enter your text here введите свой текст здесь - Move cursor in order to resize the new rectangle! Перемещайте курсор для изменения размеров нового прямоугольника! - Move cursor in order to resize the new ellipse! Перемещайте курсор для изменения размеров нового эллипса! @@ -28,3407 +23,2259 @@ ApplicationWindow - - 3D Graph 3D График - - 3D &Hidden Line 3D &Скрытая линия - - 3D &Plot 3D &График - 3&D Plot 3&D График - - 3D &Polygons 3D &Многоугольники - - 3D Surface 3D Поверхность - - 3D &Wire Frame 3D &Проволочный каркас - - 3D Wire &Surface 3D Проволочная &поверхность - - &4 Layers &4 слоя - <b> %1 </b> unknown command line option! <b> %1 </b> неизвестный параметр командной строки! - <b> %1 </b>: This command line option must be used without other arguments! <b> %1 </b>: Данный параметр командной строки должен использоваться без других аргументов! - <b> %1 </b>: Wrong locale option or no translation available! <b> %1 </b>: Неправильный параметр локализации или отсутствует перевод! - <b>%1</b> is a directory, please specify a file name! <b>%1</b> - директория, пожалуйста, укажите файл! - <h4>There are no matrices available in this project.</h4><p><h4>Please create a matrix and try again!</h4> <h4>В этом проекте нет доступных матриц.</h4><p><h4>Пожалуйста, создайте матрицу и попробуйте ещё раз!</h4> - <h4>There are no plot layers available in this window!</h4> <h4>В этом окне нет доступных слоёв!</h4> - - - - <h4>There are no plot layers available in this window.</h4> <h4>В этом окне нет доступных слоёв.</h4> - - - - - - - - - - - - - - - - - <h4>There are no plot layers available in this window.</h4><p><h4>Please add a layer and try again!</h4> <h4>В этом окне нет доступных слоёв.</h4><p><h4>Пожалуйста, добавьте графический слой и попробуйте ещё раз!</h4> - - <h4>There are no tables available in this project.</h4><p><h4>Please create a table and try again!</h4> <h4>В этом окне нет доступных таблиц.</h4><p><h4>Пожалуйста, создайте таблицу и попробуйте ещё раз!</h4> - - A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? Файл с именем: <p><b>%1</b><p>уже существует. Хотите перезаписать его? - - ALT+C ALT+C - - ALT+I ALT+I - - ALT+L ALT+L - - ALT+S ALT+S - - ALT+T ALT+T - - &About QtiPlot &О программе QtiPlot - About QtiPlot О программе QtiPlot - - &Activate Window &Сделать окно активным - - - Add Column Добавить столбец - Add Error Bars... Добавить усы погрешности... - - Add &Error Bars... Добавить усы &погрешности... - - Add &Function... Добавить &функцию... - Add Function... Добавить функцию... - - Add &Image Добавить &изображение - Add Image Добавить изображение - Add Layer Добавить слой - - Add La&yer Добавить с&лой - Add Text Добавить текст - - Add &Text Добавить &текст - - Add Time Stamp Добавить штамп даты/времени - Add curve to graph Добавить кривую на график - Add new legend Добавить новую легенду - - Add/Remove &Curve... Добавить/удалить &кривую... - - - &All &Все - - Alt+B Alt+B - - - - Alt+Q Alt+Q - - Alt+R Alt+R - - Alt+X Alt+X - &Analysis &Анализ - Anal&yze &Анализ - - - - Animation Анимация - - App&end Project... &Добавить в проект... - - &Area &Область - - Arran&ge Layers Вы&ровнять слои - Arrange Layers Выровнять слои - &Ascending По &возрастанию - Auto &Column Width &Автоматическая ширина столбцов - - &Autocorrelate &Автокорреляция - - - Automatic Layout Автоматическая компоновка - - &Axes... &Оси... - Back grid Сетка сзади - - &Band Block... &Режекторный фильтр... - - &Band Pass... &Полосовой фильтр... - - - - Bars Блоки - - &Bars &Блоки - Best fit Оптимальный масштаб - - - - Box Короб - - &Box Plot &Ящичковая диаграмма - Box and whiskers plot Построить диаграмму с "усами" - - CTRL+ALT+A CTRL+ALT+A - - CTRL+ALT+L CTRL+ALT+L - - CTRL+D CTRL+D - - - &Cancel О&тмена - - - Cancel Отмена - Cannot make a backup copy of <b>%1</b> (to %2).<br>If you ignore this, you run the risk of <b>data loss</b>. Невозможно создать резервную копию <b>%1</b> (в %2).<br>Игнорируя эту ситуацию, вы рискуете <b>потерять данные</b>. - Cannot move a parent folder into a child folder! Невозможно переместить родительскую папку в дочернюю! - Cannot move an object to itself! Невозможно переместить объект в самого себя! - &Cascade &Каскад - Ceiling grid Сетка сверху - Choose &Data Set... Выберите набор &данных... - - &Choose Help Folder... &Выбрать расположение справки... - Choose &Matrix... Выберите &матрицу... - Choose a directory to export the graphs to Выберите каталог для экспорта графиков - Choose a filename to save under Выберите имя файла для сохранения - Choose the location of the QtiPlot help folder! Указать местоположение папки со справкой QtiPlot! - - - - Clea&r &Очистить - - Clear Очистить - C&lear Сте&реть - - Clear &Log Information Очистить &журнал - Clea&r Row &Очистить строку - Clea&r Rows С&тереть строки - - - Close &Window Закрыть &окно - - - - - - - - Column Столбец - &Column &Столбец - - Column &Options ... Параметры &столбца... - Columns Столбцов - - - - &Columns &Столбцы - - &Columns... &Столбцы... - - Compressed QtiPlot project Сжатый проект QtiPlot - - - - Cones Конусы - &Console &Консоль - - Contents Содержимое - - Continue Продолжить - Contour + &Color Fill Контур + заполнение &цветом - Contour - &Color Fill Контур - заполнение &цветом - - Contour &Lines &Линии контура - Contour Lines Линии контура - Contour Lines + Color Fill Линии контура + заполнение цветом - Convert to &Matrix Преобразовать в &матрицу - &Convert to Spreadsheet Преобразовать в &таблицу - - &Convolute &Свернуть - - - - - - - - &Copy &Копировать - &Copy Graph &Копировать график - &Copy Page &Копировать страницу - - &Copy Selection &Копировать выделенное - Copy selection Копировать выделенное - - Co&rrelate Вычислить ко&рреляцию - - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Невозможно выполнить запись в файл: <br><h4> %1 </h4><p>Удостоверьтесь, что у вас есть права доступа на запись в данное место! - Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! Невозможно выполнить записать в файл: <br><h4>%1</h4><p>Удостоверьтесь, что у вас есть права доступа на запись в данное место! - Could not write to file: <h4>%1</h4><p>Please verify that you have the right to write to this location or that the file is not being used by another application! - Не могу записать в файл: <h4>%1</h4><p>Удостоверьтесь, что у вас есть права доступа на запись в этот файл, и что он не используется другой программой! + Не удалось записать в файл: <h4>%1</h4><p>Удостоверьтесь, что у вас есть права доступа на запись в этот файл, и что он не используется другой программой! - Create a new 2D function plot Создать новый 2D график функции - Create a new 3D surface plot Создать новый 3D график поверхности - Create an empty 2D plot Создать пустой 2D график - Create an empty note window Создать пустое окно заметок - - - - - - Created Создан - - - - Crosshairs Перекрестия - - Ctrl++ Ctrl++ - - Ctrl+- Ctrl+- - - Ctrl+ALT+M Ctrl+ALT+M - - Ctrl+ALT+T Ctrl+ALT+ - - Ctrl+ALT+Z Ctrl+ALT+Z - - - - Ctrl+Alt+F Ctrl+Alt+F - - - - Ctrl+Alt+G Ctrl+Alt+G - - Ctrl+Alt+O Ctrl+Alt+O - - Ctrl+Alt+P Ctrl+Alt+P - - Ctrl+Alt+W Ctrl+Alt+W - - Ctrl+B Ctrl+B - - Ctrl+C Ctrl+C - - Ctrl+E Ctrl+E - - Ctrl+F Ctrl+F - - Ctrl+G Ctrl+G - - Ctrl+H Ctrl+H - - Ctrl+I Ctrl+I - - Ctrl+J Ctrl+J - Ctrl+K Ctrl+K - - Ctrl+L Ctrl+L - - Ctrl+M Ctrl+M - - Ctrl+N Ctrl+N - - Ctrl+O Ctrl+O - - Ctrl+P Ctrl+P - - Ctrl+Q Ctrl+Q - - - - Ctrl+Return Ctrl+Return - - Ctrl+S Ctrl+S - - Ctrl+Shift+J Ctrl+Shift+J - - - Ctrl+Shift+R Ctrl+Shift+R - - Ctrl+T Ctrl+T - - Ctrl+V Ctrl+V - - Ctrl+W Ctrl+W - - Ctrl+X Ctrl+X - - Ctrl+Y Ctrl+Y - - Ctrl+Z Ctrl+Z - - &Current &Текущий - Curve График функции - &Cut &Вырезать - - - - - - Cu&t В&ырезать - - Cu&t Selection &Вырезать выделенное - Cut selection Вырезать выделенное - - &Data &Данные - - Data Display Информационное табло - - &Data Reader &Чтение данных - - &Data Set... Набор &данных... - Data reader Считывание данных - Date & time Дата и время - - &Deconvolute &Обратить свёртку - - Del delete key Del - - - - - &Delete &Удалить - &Delete Columns &Удалить столбцы - - Delete &Fit Tables Удалить &таблицы аппроксимаций - &Delete Folder &Удалить папку - &Delete Row &Удалить строку - - &Delete Rows &Удалить строки - - &Delete Rows Interval... &Удалить диапазон строк... - - - &Delete Selection &Удалить выделенное - &Delete Window &Удалить окно - Delete folder '%1' and all the windows it contains? Удалить папку '%1' и все содержащиеся в ней окна? - Delete selection Удалить выделенное - D&epending 3D Graphs Связанные &трёхмерные графики - D&epending Graphs &Связанные графики - - - D&epends on Включить з&ависимости - &Descending По &убыванию - - &Determinant &Определитель - Determinant of Определитель - - &Differentiate &Дифференцирование - Directory: Директория: - Disable &Tools Отключить &Инструменты - Disable &tools Отключить &инструменты - Do you want QtiPlot to guess the best position for the new layer? Warning: this will rearrange existing layers! Вы хотите, чтобы QtiPlot определил оптимальное положение нового слоя?<br> Предупреждение: существующие слои будет перегруппированы! - Do you wish to continue? Продолжить? - - - - Dots Точки - - Download &Manual Загрузить &руководство - - Draw &Arrow Нарисовать &стрелку - - Draw &Line Нарисовать &линию - Draw arrow Нарисовать стрелку - Draw line Нарисовать линию - - &Duplicate &Создать копию - Duplicate window Создать копию окна - &Edit &Правка - - Edit Правка - - &Edit Function... - &Редактировать функцию... + &Редактировать функцию... - - Edit &Range... Изменить &диапазон... - Empty 3D surface plots cannot be duplicated! Графики пустых 3D поверхностей не могут быть продублированы! - - Empty Floor Пустое основание - - Empty floor Чистая плоскость - - - - Enable perspective В перспективе - End row Конечная строка - English Русский - Error while fetching version file with HTTP: %1. Ошибка при получении файла версии с помощью HTTP: %1. - - &Evaluate Expression &Раскрыть выражение - - E&xecute &Выполнить - - Execute &All Выполнить в&сё - E&xport &Экспорт - &Export &Экспортировать - - E&xport ASCII - Э&кспортировать в ASCII + Э&кспортировать в ASCII - &Export Graph &Экспортировать график - - &Export PDF &Экспортировать в PDF - E&xport Page &Экспортировать страницу - Export all graphs Экспортировать все графики - Export current graph Экспортировать текущий график - Export to PDF Экспорт в PDF - - F1 F1 - - F3 F3 - F5 next window shortcut F5 - F6 previous window shortcut F6 - - &FFT Filter... &БПФ-фильтр... - &FFT filter &БПФ фильтр - - &FFT... &Быстрое преобразование Фурье... - - File Файл - &File &Файл - &Fill Column With &Заполнить столбец - - &Fill Columns With &Заполнить столбцы - - - - &Find... &Найти... - - &First Order ... &Первого порядка... - - Fit &Boltzmann (Sigmoidal) Аппроксимация по &Больцману (Сигмоидальное) - Fit E&xponential Decay Аппроксимация экспоненциальным &затуханием - - Fit Exponential Gro&wth ... Аппроксимация &экспоненциальным ростом... - - Fit &Gaussian Аппроксимация &гауссианом - - Fit &Linear &Линейная аппроксимация - - Fit Lorent&zian Аппроксимация &лоренцианом - Fit &Multi-peak Много&пиковая аппроксимация - - Fit &Polynomial ... Аппроксимация &полиномом... - - Fit &Wizard... &Мастер Аппроксимации... - - - - Fit frame to window Совместить рамку с окном - - Floor Data Projection Проекция данных на основание - - Floor Isolines Изолинии на основании - - Floor data projection Проекция данных на основание - Floor grid Сетка снизу - - Floor isolines Изолинии на основании - - - Folder Папка - &Folders &Папки - - - Frame Рамка - &Frame &Рамка - Front grid Сетка спереди - Function Функция - - &Gaussian... &Гауссиан... - - &Go to Row... Перейти к &строке... - &Graph &График - - - - - - - - - - - - - - Graph График - - &Gray Scale Map Шкала &уровней серого - Gray Scale Map Шкала уровней серого - - &Grid ... &Сетка... - &Guess &Автоматически - - - &Help &Справка - Hidden Скрытый - - Hidden Line Скрытая линия - - Hidden line Скрытая линия - - &Hide &Скрыть - - &Hide All Windows &Скрыть все окна - - Hide &Other Curves Спрятать &другие графики - - - - &Hide Window &Скрыть окно - - &High Pass... Фильтр &верхних частот... - - &Histogram &Гистограмма - - &Horizontal &Горизонтально - - &Horizontal 2 Layers 2 &горизонтальных слоя - - &Horizontal Steps &Горизонтальные шаги - Images Изображения - - &Import ASCII... &Импорт ASCII... - - Import I&mage... &Импорт изображения... - Import data file(s) Импорт файлов данных - - &Insert &Вставить - &Insert Column &Вставить столбец - - &Insert Row &Вставить строку - &Intensity Matrix Матрица &интенсивности - - &Intensity Table Таблица &интенсивности - - Inte&rpolate ... Интер&поляция... - - &Invert О&братная матрица - - - Label Метка - - - &Layer &Слой - Left grid Сетка слева - - &Line &Линия - - Line + S&ymbol Линия + с&имволы - - &Lorentzian... &Лоренциан... - - &Low Pass... Фильтр &нижних частот... - - Make a &Donation Сделать &пожертвование - - - - - - - - Matrix Матрица - &Matrix &Матрица - - Matrix Plot График матрицы - &Matrix... &Матрица... - - Ma&ximize Window &Развернуть окно - - Maximized Развёрнутый - - Mesh & Filled Polygons Сетка и заполненные многоугольники - - Mesh & filled Polygons Сетка и заполненные многоугольники - - Mi&nimize Window &Свернуть окно - Minimized Свёрнутый - Modified Изменён - More Windows... Больше окон... - - More windows... Больше окон... - - &Move Data Points... &Переместить данные... - Move data points Перемещение данных - - Moving Window &Average... &Скользящее среднее... - - Name Имя - Name <b>%1</b> already exists! Имя <b>%1</b> уже существует! - Name already exists! Имя уже существует! - &New Созд&ать - - New 3D &Surface Plot Новый график 3D &поверхности - New Folder Новая папка - - New F&older Новая &папка - - New &Function Plot Новый график &функции - - New &Graph Новый &график - - New &Legend Новая &легенда - - New &Matrix Новая &матрица - - New &Note Новая &заметка - - - New &Project Новый &проект - - New &Table Новая &таблица - - New &Window &Новое окно - New matrix Новая матрица - New table Новая таблица - &Next next window &Следующее - &No &Нет - - No Нет - - No Axes Без осей координат - - No axes Без осей координат - No updates available. Your current version %1 is the last version available! Нет доступных обновлений. Текущая версия %1 является последней доступной! - - &None &Нет - Normal Нормальный - - - &Normalize &Нормировать - Not available for empty 3D surface plots! Не доступно для пустых 3D поверхностей! - - Note Заметка - - - Notes Notes - Number of averaged pixels Число усреднённых точек - - &Open - &Открыть + &Открыть - - Open Image &File - Открыть &файл изображения + Открыть &файл изображения - Open Te&mplate... Открыть &шаблон... - Open Temp&late... Открыть &шаблон... - Open a new project Открыть новый проект - Open project Открыть проект - Open template Открыть шаблон - Output format: Выходной формат: - - Pa&nel Па&нель - - - - &Paste &Вставить - - Past&e &Вставить - &Paste Image &Вставить изображение - - &Paste Layer &Вставить слой - &Paste Line/Arrow &Вставить линию/стрелку - - &Paste Selection В&ставить выделенное - &Paste Text &Вставить текст - Paste selection Вставить выделенное - - - Path Путь - Peaks Пики - - &Pie &Круговая диаграмма - - - Please choose another name! Пожалуйста выберите другое имя! - - Please enter a valid name! Пожалуйста введите корректное название! - Please indicate the location of the help file! Пожалуйста, укажите расположение файла справки! - - - Please select a Y column to plot! Пожалуйста, выберите Y столбец для построения! - Please select a Z column for this operation! Пожалуйста, выберите Z столбец для данной операции! - - - - - Please select a column first! Пожалуйста, выберите сначала столбец! - Please select a column to plot! Пожалуйста, выберите столбец для построения! - Please select a row first! Пожалуйста, выберите сначала строку! - Please select exactly one columns for this operation! Выберите ровно один столбец для данной операции! - - Please select four columns for this operation! Пожалуйста, выберите четыре столбца для данной операции! - Please select two columns for this operation! Пожалуйста, выберите два столбца для выполнения этой операции! - - Please select two columns for this operation: the first represents the signal and the second the response function! Пожалуйста выберите два столбца для данной операции: первый представляет сигнал, а второй - функцию-отклик! - Please set a default X column for this table, first! Пожалуйста, установите сначала X столбец по умолчанию для данной таблицы! - Please support QtiPlot! Пожалуйста, поддержите QtiPlot! - Please use the project explorer to select a window! Пожалуйста, используйте проводник проекта для выбора окна! - - - &Plot &Построить график - - Plot График - - &Plot ... &График... - Plot 3D bars Построить 3D блоки - Plot 3D ribbon Построить 3D ленту - Plot 3D scatter Построить 3D точки - Plot 3D trajectory Построить 3D траекторию - - Plot &Wizard &Мастер построений - Plot area Построить область - Plot as line Построить в виде линии - Plot as line + symbols Построить в виде линии с символами - Plot as symbols Построить в виде символов - - &Plot details... Детали &построения... - Plot pie Построить круговую диаграмму - Plot with horizontal bars Построить горизонтальные блоки - Plot with vertical bars Построить вертикальные блоки - Pointer Указатель - - Polygon Only Только многоугольник - - Polygon only Только многоугольник - - &Preferences... &Настройки... - &Previous previous window &Предыдущее - - - &Print &Печать - - Print All Plo&ts Печать всех гра&фиков - &Print Window &Распечатать окно - Print window Распечатать содержимое окна - Project Проект - - Project Explorer Обозреватель проекта - Project &Explorer &Обозреватель проекта - - - - &Properties &Свойства - - - Properties Свойства - - - - &Properties... &Свойства... - P&roperties... С&войства... - - - - - - - - - - - - - - - - - - QtiPlot QtiPlot - - - QtiPlot - Choose data set QtiPlot - Выберите набор данных - - QtiPlot - Choose matrix to plot QtiPlot - Выберите матрицу для отображения - - - - - - - - - - - - QtiPlot - Column selection error QtiPlot - Ошибка выбора столбца - QtiPlot - Delete folder? QtiPlot - Удалить папку? - - QtiPlot - Delete rows QtiPlot - Удалить строки - QtiPlot - Demo Version QtiPlot - Демонстрационная версия - QtiPlot - Duplicate error QtiPlot - Ошибка дублирования - QtiPlot - Duplicate window error QtiPlot - Ошибка дублирования окна - QtiPlot - Edit function QtiPlot - Редактировать функцию - QtiPlot - Enter columns number QtiPlot - Введите число столбцов - QtiPlot - Enter row number QtiPlot - Введите номер строки - QtiPlot - Enter rows number QtiPlot - Введите число строк - QtiPlot - Enter the number of peaks QtiPlot - Задайте число вершин - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QtiPlot - Error QtiPlot - Ошибка - QtiPlot - Error bars error QtiPlot - Ошибка круговой диаграммы - QtiPlot - Export Error QtiPlot - Ошибка при экспорте - - - - - - - QtiPlot - Export error QtiPlot - Ошибка при экспорте - QtiPlot - File Open Error QtiPlot - Ошибка при открытии файла - QtiPlot - File backup error QtiPlot - Ошибка при резервном копировании файла - - - - - - - - QtiPlot - File opening error QtiPlot - ошибка при открытии файла - - - - - - - QtiPlot - File openning error QtiPlot - ошибка при открытии файла - QtiPlot - File save error QtiPlot - Ошибка при сохранении файла - QtiPlot - Guess best origin for the new layer? QtiPlot - Определить оптимальное положение для нового слоя? - QtiPlot - HTTP get version file QtiPlot - HTTP получить файл версии - - - QtiPlot - Help Files Not Found! QtiPlot - Файл справки не найден! - - QtiPlot - Help Profile Not Found! QtiPlot - Профиль справки не найден! - QtiPlot - Import image from file QtiPlot - Импортировать изображение из файла - QtiPlot - Insert image from file QtiPlot - Вставить изображение из файла - QtiPlot - Load image from file QtiPlot - Загрузить изображение из файла - QtiPlot - No Updates Available QtiPlot - Нет доступных обновлений - QtiPlot - No match found QtiPlot - Совпадений не найдено - QtiPlot - Open Template File QtiPlot - Открыть файл шаблона - QtiPlot - Opening file QtiPlot - Открытие файла - - QtiPlot - Overwrite file? QtiPlot - Перезаписать файл? - - - - - - - QtiPlot - Plot error QtiPlot - Ошибка отображения - - QtiPlot - Renamed Window QtiPlot - переименованное окно - QtiPlot - Row selection error QtiPlot - Ошибка выделения строки - QtiPlot - Script Window QtiPlot - Окно сценария - QtiPlot - Scripting Error QtiPlot - ошибка выполнения сценария - QtiPlot - Set the number of pixels to average QtiPlot - Укажите число точек для усреднения - QtiPlot - Updates Available QtiPlot - Имеются обновления - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QtiPlot - Warning QtiPlot - Предупреждение - QtiPlot - index.html File Not Found! QtiPlot - Файл "index.html" не найден! - - QtiPlot - untitled QtiPlot - безымянный - QtiPlot 2D Graph Template Шаблон двумерного графика QtiPlot - QtiPlot 3D Surface Template Шаблон 3D поверхности QtiPlot - QtiPlot &Forums &Форумы QtiPlot - - &QtiPlot Homepage Домашняя страница &QtiPlot - QtiPlot Matrix Template Шаблон матрицы QtiPlot - QtiPlot Table Template Шаблон таблицы QtiPlot - - QtiPlot project Проект QtiPlot - QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! QtiPlot попытается загрузить необходимую информацию о последних доступных обновлениях. Пожалуйста, измените настройки брандмауэра, чтобы QtiPlot мог соединиться с интернетом! - - &Quit В&ыход - - &Random Values &Случайными значениями - - Recalculate Пересчитать - - &Recent Projects По&следние проекты - - &Redo &Вернуть - Redo changes Вернуть изменения - - Released Выпущено - - Remove &Bad Data Points... Удалить &ошибочные данные... - - &Remove Layer &Удалить слой - Re&move Pie Curve &Удалить круговую диаграмму - Remove data points Удаление данных - &Rename &Переименовать - - - &Rename Window &Переименовать окно - - Report a &Bug Сообщить об оши&бке - - &Rescale to Show All &Показать целиком - - - - Reset rotation Повернуть в исходное положение - - &Reset to Full Range Сбросить на полный &диапазон - - Re&size Window... И&зменить размер окна... - - &Restart scripting &Перезапустить поддержку сценариев - Results &Log &Журнал результатов - - Results Log Журнал результатов - - &Ribbon &Лента - Right grid Сетка справа - Row Строка - - Ro&w Numbers Номерами стро&к - - &Rows &Строки - Rows Строк - - &Rows... &Строки... - Save &As Project... Сохр&анить как проект... - - Save As &Template... Сохранить как &шаблон... - Save Note As... Сохранить примечание как... - - &Save Project &Сохранить проект - Save Project As Сохранить проект как - - Save Project &As... Сохранить проект &как... - Save Window As Template Сохранить окно как шаблон - Save changes to project: <p><b> %1 </b> ? Сохранить изменения в проекте: <p><b> %1 </b> ? - Save project Сохранить проект - Save project as Сохранить проект как - Save window as template Сохранить окно как шаблон - - &Savitzky-Golay... &Савицкий-Голай... - - &Scales... &Масштабы... - - - - &Scatter &Точки - - S&creen Reader Чтение с &экрана - Screen reader Считывание с экрана - Script Error Ошибка сценария - - &Script Window Окно &сценариев - Script Window Окно сценария - - Scripting Console Консоль команд - - Scripting &language &Язык сценариев - Scripting language "%1" failed to initialize. Ошибка инициализации языка сценариев "%1". - - Search for &Updates Искать &обновления - - &Second Order ... &Второго порядка... - - &Select Data Range &Выбрать диапазон данных - Select data range Выделить диапазон данных - Selected columns statistics Статистика выбранных столбцов - Selected rows statistics Статистика выделенных строк - - Set As Установить как - - Set Column &Values ... Задать з&начения столбца... - Set Columns &As У&становить столбцы как - - Set &Dimensions... Задать &размеры... - Set Display Range Установить диапазон отображения - - Set &Properties... &Свойства... - - Set &Values... Задать &значения... - - Shift+A Shift+A - - &Show All Curves &Показать все графики - - &Show All Windows Показать &все окна - Show Scripting console Показать консоль сценариев - Show analysis results Показать результаты анализа - Show project explorer Показать обозреватель проекта - - - - - Size Размер - Skipped moving folder Перемещение папки пропущено - &Smooth &Сглаживание - Sorry, no match found for string: '%1' Совпадений для строки '%1' не найдено - Sorry, there are no results to display! Извините, результаты для отображения отсутствуют! - Sort Colu&mn Со&ртировать столбец - - Sort Columns Сортировать столбцы - - Sort Ta&ble Сортировать та&блицу - - - Special Line/Symb&ol Специальная линия/симв&ол - - &Spline &Сплайн - - &Stacked Histogram &Фигурная гистограмма - - &Stacked Layers &Упакованные(Stacked) слои - Start row Начальная строка - - - Statistical &Graphs Статистические &диаграммы - - Statistics on &Columns &Статистика по столбцам - - Statistics on &Rows Статистика по &строкам - Status Состояние - - &Surface... &Поверхность... - - - &Table &Таблица - - - - - - - - Table Таблица - Table1 Таблица1 - - Technical &Support Техническая &поддержка - - The assistant could not start because the file <b>%1</b> was not found in the help file directory! Помощник не смог запуститься, поскольку файл <b>%1</b> не был найден в директории с файлами справки! - - The destination folder already contains a folder called '%1'! Folder skipped! Папка назначения уже содержит папку с именем '%1'! Папка пропускается! - The file "%1" was created using "%2" as scripting language. Initializing support for this language FAILED; I'm using "%3" instead. @@ -3438,1928 +2285,1596 @@ Отображение различных фрагментов этого файла может отличаться от ожидаемого. - The file <b>%1</b> is corrupted, but there exists a backup copy.<br>Do you want to open the backup instead? Файл <b>%1</b> повреждён, но существует резервная копия.<br>Хотите ли вы вместо оригинала открыть резервную копию? - The file: <b> %1 </b> <p>does not exist anymore!<p>It will be removed from the list. Файл: <b> %1 </b> <p>больше не существует!<p>Он будет удалён из списка. - - The file: <b> %1 </b> was not created using QtiPlot! Файл: <b> %1 </b> не был создан с помощью QtiPlot! - - - - The file: <b>%1</b> doesn't exist! Файл: <b>%1</b> не существует! - The file: <b>%1</b> is not a QtiPlot or Origin project file! Файл: <b> %1 </b> не является файлом проекта QtiPlot или Origin! - The file: <b>%1</b> is not a QtiPlot template file! Файл: <b>%1</b> не является файлом шаблона QtiPlot! - The file: <b>%1</b> is the current file! Файл: <b>%1</b> является текущим файлом! - The file: <br><b>%1</b> is opened in read-only mode Файл: <br><b>%1</b> открыт в режиме "только для чтения" - The file: <p><b> %1 </b><p> is the current file! Файл:: <p><b> %1 </b><p> является текущим файлом! - - The manual can be downloaded from the following internet address: Руководство может быть загружено с этого интернет-адреса: - The name you chose is not valid: only letters and digits are allowed! Вы выбрали некорректное название: допускается использовать только буквы и цифры! - The selected columns have different numbers of rows! В выбранных столбцах разное число строк! - The selected error column is empty! Выбранный столбец ошибок пуст! - - The table '%1' already exists. It has been renamed '%2'. Таблица '%1' уже существует. Она была переименована в '%2'. - There are no available columns with plot designation set to Z! Нет ни одного столбца, обозначенного как Z! - - There are no curves available on this plot! На данном графике нет доступных кривых! - There are no plot layers available in this window! В данном окне нет доступного графика! - There are no plot layers available in this window. В данном окне нет доступных слоёв. - There are no plot layers available in window <b>%1</b>.<br>Graph window not exported! В окне <b>%1</b> нет ни одного слоя с графиком.<br>Окно не экспортировано! - There is a newer version of QtiPlot (%1) available for download. Would you like to download it? Для загрузки доступна более свежая версия QtiPlot (%1). Вы хотите скачать её? - There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! В данной папке нет файла с именем <b>index.html</b>.<br>Пожалуйста выберите другую папку! - - &Third Order ... &Третьего порядка... - - This feature is not available for user defined function curves! Эта функция недоступна для кривых, определённых пользователем! - - This file is provided with the QtiPlot manual which can be downloaded from the following internet address: Этот файл поставляется вместе с руководством QtiPlot, которое может быть загружено с этого интернет-адреса: - - - - - - - - - - This functionality is not available for pie plots! Эта функция недоступна для круговой диаграммы! - This will clear the contents of all the data associated with the table. Are you sure? Все данные, связанные с таблицей, будут удалены. Продолжить? - - This will modify the data in the worksheets! Are you sure you want to continue? Данные в рабочих областях изменятся! Вы уверены, что хотите продолжить? - &Tile &Мозаика - - &Title ... &Заголовок... - &Top-left corner &Верхний левый угол - - &Trajectory &Траектория - &Translate &Транслировать - - &Translations &Переводы - - &Transpose &Транспонировать - - - - - - - - - Type Тип - Type %1 to see the list of the valid options. Наберите %1 для вывода списка доступных параметров. - UNTITLED Безымянный - - &Undo &Отменить - Undo changes Отменить изменения - Usage Использование - Valid options are Допустимые параметры - Vectors XYAM Векторы XYAM - - Vectors XY&AM Векторы XY&AM - &Vectors XYXY &Векторы XYXY - &Vectors &XYXY Векторы &XYXY - Vectors XYXY Векторы XYXY - Version Версия - - &Vertical &Вертикально - - &Vertical 2 Layers 2 &вертикальных слоя - - Vertical &Drop Lines &Вертикальные отрезки - - &Vertical Steps &Вертикальные шаги - - View Вид - &View &Вид - - &View Pixel Line Profile Просмотреть профиль &пиксельной линии - &View Pixel Line profile Просмотреть профиль &пиксельной линии - &View Windows П&росмотр окон - Visit QtiPlot &Forums Посетить &форумы QtiPlot - Warning: for internal consistency reasons the underscore character is replaced with a minus sign. Предупреждение: для обеспечения внутренней согласованности символ подчёркивания был заменён на знак минус. - - - &Window &Окно - Window Окно - - Window &Geometry... &Геометрия окна... - &Windows &Окна - &Windows in Active Folder Окна в т&екущей папке - Windows in &Active Folder && Subfolders Окна в &текущей и вложенных папках - - - - Wireframe Проволочный каркас - - &Worksheet Рабочая &таблица - - - &X &X - - - X E&rror &Погрешность по X - - - &Y &Y - - - Y &Error &Погрешность по Y - - &Yes &Да - - Yes Да - - You don't have the permission to open this file: <b>%1</b> У вас нет прав доступа на открытие файла <b>%1</b> - - - - - You must select exactly one column for plotting! Для построения необходимо выбрать только один столбец! - - - You need at least two columns for this operation! Для выполнения этой операции нужно как минимум два столбца! - You need to define a X column first! Сначала нужно задать X столбец! - You need to define a Y column first! Сначала нужно задать Y столбец! - - - &Z &Z - Zoom In Увеличить - - &Zoom In &Увеличить - &Zoom Out &Уменьшить - Zoom Out Уменьшить - Zoom &Out &Уменьшить - bytes байт - can be any .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py or ASCII file - может быть файлом следующих типов: .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py, ASCII файл + может быть файлом следующих типов: .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py, ASCII файл - execute the script file given as argument выполнить файл сценария, заданного как аргумент - - file файл - - folders папки - - name имя - options параметры - - - - - - - - or или - print QtiPlot version and release date вывести версию QtiPlot и дату выпуска - show QtiPlot manual in a standalone window показать руководство QtiPlot в отдельном окне - show about dialog and exit показать диалог "О программе" и выйти - show command line options показать параметры командной строки - start QtiPlot in language запустить QtiPlot на языке - start QtiPlot with the default settings запустить QtiPlot с настройками по умолчанию - - windows окна - Vie&w &Вид - - &Read-only &Только для чтения - - Dra&g Curve &Транслировать график - &Import &Импортировать - - Read/&Write Для чтения и &записи - You must select a single Y column that has an associated X column! Необходимо выбрать только один Y столбец, который ассоциирован с X столбцом! - You must select exactly one Z column! Необходимо выбрать только один Z столбец! - + Open ODF Spreadsheet File + Открыть таблицу ODF + + + Couldn't open file %1 + Невозможно открыть файл %1 + + + File %1 contains only %2 sheets! + + + + QtiPlot was built without ODF spreadsheet support! + QtiPlot скомпилирован без поддержки таблиц ODF! + + + Open Excel File + Открыть файл Excel + + + File %1 contains only %2 sheets, operation aborted! + Файл '%1' содержит только %2 листов, операция прервана! + + + Sheet %1 is empty, operation aborted! + Лист %1 пуст, операция отменена! + + + sheet + лист + + + QtiPlot was built without libxls support! + QtiPlot скомпилирован без поддержки библиотеки libxls! + + Open File Открыть файл - Imported sound file Импортированный звуковой файл - This is not a PCM type WAV file, operation aborted! Это файл WAV не PCM типа, операция прервана! - PCM PCM - - Time Время - Left Левый - Right Правый - Data Данные - Channels Каналы - Sample Rate Частота дискретизации - Byte Rate Поток в байтах - Block Align - + Выравнивание блоков - Bits Per Sample - + Бит на точку - Presentation Preview Просмотр презентации - &Save &Сохранить - + Paste Selection as Te&xt + + + There are no windows available in this folder! В данной папке нет доступных окон! - - + Export + Экспортировать + + + Open Exce&l ... + Открыть файл Exce&l ... + + + Ctrl+Shift+E + Ctrl+Shift+E + + + Open ODF Spreads&heet... + Открыть таблицу &ODF... + + + Ctrl+Alt+S + Ctrl+Alt+S + + &Sound (WAV)... &Звук (WAV)... - - Create Open &Document Presentation... Создать &презентацию в формате Open Document... - - &Close &Закрыть - - + Zoom/Drag Canvas &Horizontally + Приблизить/переместить холст по &горизонтали + + + Zoom/Drag Canvas &Vertically + Приблизить/переместить холст по &вертикали + + &Lowess... - - &Swap columns &Переставить столбцы - - Move &Right Переместить в&право - - Move &Left Переместить в&лево - - Move to F&irst Переместить в &начало - - Move to Las&t Переместить в &конец - - + &Image Profiles + Профили &изображения + + &Export Image ... &Экспорт изображения ... - - 2D &Binning 2D &гистограмма - - &Regular XYZ &Обычная XYZ - - &Read Only &Только для чтения - - &Disregard И&гнорировать - - Find &Next &Найти следующее совпадение - - Find &Previous &Найти предыдущее совпадение - - F4 F4 - - &Replace... &Заменить... - - Increase Indent Вставить отступ - - Decrease Indent Уменьшить отступ - - Rena&me Tab... &Переименовать вкладку... - - A&dd Tab &Добавить вкладку - - C&lose Tab &Закрыть вкладку - + Load Custom User &Interface... + Загрузить пользовательский &интерфейс... + + Increase Precision Увеличить точность - Decrease Precision Уменьшить точность - New Fol&der - Новая &папка + Новая &папка - Create a new folder Создать новую папку - + Open Excel + Открыть файл Excel + + + Open ODF Spreadsheet + Открыть таблицу ODF + + Print preview Предварительный просмотр - Swap selected columns Переставить выбранные столбцы - Move Right Переместить вправо - Move Left Переместить влево - Move to First Переместить в начало - Move to Last Переместить в конец - + Image Profiles + Профили изображения + + + Ctrl+R + Ctrl+R + + + Zoom In/Out and Drag Canvas Horizontally + Приблизить/отдалить и переместить холст по горизонтали + + + Zoom In/Out and Drag Canvas Vertically + Приблизить/отдалить и переместить холст по вертикали + + + Profiles + Профили + + + Horizontal + Горизонтальный + + + Vertical + Вертикальный + + + can be any .qti, qti.gz, .ods, .opj, .ogm, .ogw, .ogg, .py, .xls or ASCII file + может быть файлом следующих типов: .qti, qti.gz, .ods, .opj, .ogm, .ogw, .ogg, .py, .xls, ASCII файл + + Memory Allocation Error Ошибка выделения памяти - Not enough memory, operation aborted! Недостаточно памяти, операция отменена! - - Set Precision %1 digits Установить %1 значащих цифр - + Choose custom user interface + Выбрать пользовательский интерфейс + + + Custom user interfaces can be created using the QtDesigner application provided by the Qt framework + Пользовательский интерфейс может быть создан в QtDesigner + + + For more details about how to use .ui files in your Python scripts please read the PyQt4 documentation + Подробности использования .ui файлов в скриптах Python можно узнать в документации PyQt4 + + &Palette &Палитра - - Flip &V Отразить &вертикально - Ctrl+Shift+V Ctrl+Shift+V - - Flip &H Отразить &горизонтально - Ctrl+Shift+H Ctrl+Shift+H - - R&otate 90 &Повернуть на 90° - - Rotate &-90 П&овернуть на -90° - - Ctrl+Alt+R Ctrl+Alt+R - - &Image mode Режим &изображения - Ctrl+Shift+I Ctrl+Shift+I - - &Data mode Режим &данных - Ctrl+Shift+D Ctrl+Shift+D - - - &Gray Scale Уровни &серого - - &Rainbow &Радуга - - &Custom По &выбору - Help Справка - - &Image Plot Построить &изображение - - Show &X/Y Показать &X/Y - Ctrl+Shift+X Ctrl+Shift+X - - Show &Column/Row Показать &столбец/строку - Ctrl+Shift+C Ctrl+Shift+C - - &Draw Data Points Нарисовать &ломаную - - Ctrl+Shift+T Ctrl+Shift+T - Draw Data Points Нарисовать ломаную - Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. Начиная с версии 0.9.1 QtiPlot хранит пользовательские аппроксимационные модели в ином месте. - If you want to save your already defined models, please choose a destination folder. Если хотите сохранить ваши модели, пожалуйста, выберите папку назначения. - Import fit models Импортировать аппроксимационные модели - Choose a directory to export the fit models to Выберите каталог для экспорта аппроксимационных моделей - &Forward FFT &Прямое БПФ - &Inverse FFT &Обратное БПФ - - - Format Формат - - Add &Custom Script Action... Добавить пользовательское &действие... - - Bold Полужирный - - Italic Курсив - Superscript Верхний индекс - Subscript Нижний индекс - - Underline (Ctrl+U) Подчёркнутый - - Ctrl+U Ctrl+U - - - - Greek Греческие - Make a donation Сделать пожертвование - show standalone scripting window показать отдельное окно сценариев - You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://soft.proindependent.com/download.html">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. Это демонстрационная версия программы. Она идентична полной версии, за тем исключением, что вы не можете сохранить ваш проект и не можете использовать программу больше 10 минут за сессию.<br><br>Если вы желаете полностью функциональную программу, пожалуйста, подпишите <a href="http://soft.proindependent.com/individual_contract.html">однопользовательский договор на поддержку</a>.<br><br>QtiPlot - свободное (в смысле свободы слова) программное обеспечение. Если вы знаете как его использовать, то можете безвозмездно получить <a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">исходный код</a>. Тем не менее, мы всегда рады <a href="http://soft.proindependent.com/why_donate.html">принять от вас пожертвование</a> на дальнейшую разработку программы. - - - Error Ошибка - - QtiPlot was not built with Python scripting support included! QtiPlot скомпилирован без поддержки сценариев на языке Python! - - - &Label &Метка - - Undo Stack История действий - Empty Stack Начальное состояние - Set Image Mode Режим изображения - Set Data Mode Режим данных - Show X/Y Показать X/Y - Show Column/Row Показать столбец/строку - Set Gray Scale Palette Шкала уровней серого - Set Rainbow Palette Радуга - - &Hide Selected Ск&рыть столбцы - - Sho&w All Columns Показать &все столбцы - - - - &Direct &Непосредственно - - &XYZ Columns &XYZ столбцы - - &YXZ Columns &YXZ столбцы - Show available undo/redo commands Показать доступные действия - Hide selected columns Скрыть столбцы - Show all table columns Показать все столбцы - Integration of %1 from zero is Интеграл %1 от нуля равен - - &Integrate &Интегрировать - - Integr&ate Function... И&нтегрировать функцию... - - Ctrl+D Ctrl+D - - &Toolbars... &Панели инструментов... - &Undo/Redo Stack &История действий - - Go to Colum&n... Перейти к с&толбцу... - - Ctrl+Alt+C Ctrl+Alt+C - QtiPlot - Enter column number QtiPlot - Введите номер столбца - Set Matrix Values Задать значения матрицы - Image Plot Построить изображение - Flip Vertically Отразить вертикально - Flip Horizontally Отразить горизонтально - - Mathematical Symbols Математические символы - Fill selected columns with row numbers Заполнить выбранные столбцы номерами строк - Fill selected columns with random numbers Заполнить выбранные столбцы случайными значениями - Set column as X Установить столбец как X - Set column as Y Установить столбец как Y - Set column as Z Установить столбец как Z - Set as Y Error Bars Установить как погрешность по Y - Set as Labels Установить как подписи - Disregard Columns Игнорировать - Integration of %1 Интегрирование %1 - Area Площадь - - - - - Please select a 'Y' column first! Пожалуйста, выберите сначала столбец 'Y'! - - Linear Regression of %1 Линейная регрессия %1 - - Slope Наклон - Intercept Пересечение - - Chi^2 Chi^2 - - R^2 R^2 - &Scripting &Сценарии - - Show Line &Numbers Показать &номера строк - Couldn't load file: %1. Autocompletion will not be available! Невозможно открыть файл: %1. Автодополнение не будет доступно! - &Paste Tex Formula &Вставить формулу Tex - - &Frequency Count ... &Частотный анализ ... - - No Icon Без значка - Please select exactly one column and more than one non empty cell! Выберите только один столбец и более чем одну непустую ячейку! - <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> If you like it, you're using it in your work and you would like to see it constantly improved, please support its authors by making a donation.</b></font> <font size=+2, color = darkBlue><b>QtiPlot - программное обеспечение с открытым кодом и его разработка потребовала сотни часов работы.<br><br>Если вам нравится QtiPlot, и вы используете его в работе и хотите, чтобы он непрерывно улучшался,<br> пожалуйста, поддержите его авторов.</b></font> - - Add E&quation Добавить &уравнение - - ALT+Q - - Add &Rectangle Добавить &прямоугольник - - CTRL+ALT+R - - - There are no layers available on this plot. Operation aborted! В этом окне нет доступных слоёв! - Show find dialog Найти - Find Next Найти следующее совпадение - Find Previous Найти предыдущее совпадение - Show replace dialog Найти и заменить - Drag Curve Транслировать график - Add Equation Добавить уравнение - Add Rectangle Добавить прямоугольник - You need to select at least one Y column for this operation! Для выполнения этой операции нужно как минимум один Y столбец! - Y2 Axis Title Подпись оси Y2 - You must have more than one layer in the active window! Необходимо как минимум два слоя в активном окне! - You must have more than one dataset in the active layer! Необходимо как минимум два набора данных в активном слое! - - D&ouble-Y &Две оси Y - - &Zoom &Увеличение - - E&xtract to Graphs Развести по &окнам - Extract to &Layers Развести по &слоям - - Add Inset Layer Добавить слой-вставку - Double Y Axis Две оси Y - Zoom Увеличение - Extract to Graphs Развести по окнам - Extract to Layer&s Развести по &слоям - Extract to Layers Развести по слоям - - Add &Ellipse Добавить &эллипс - - CTRL+ALT+E - &Paste Rectangle В&ставить прямоугольник - &Paste Ellipse В&ставить эллипс - Add Ellipse/Circle Добавить эллипс/окружность - - - - Ctrl+Alt+H Ctrl+Alt+H - Set Default Palette Установить палитру по умолчанию - - &Default По &умолчанию - execute the script file given as argument without displying the user interface. Warning: 2D plots are not correctly handled in this functioning mode! выполнить файл сценария, заданный как аргумент, без запуска главного окна . Внимание: 2D графики не поддерживаются в этом режиме! - Rotate 90 Clockwise Повернуть на 90 по часовой стрелке - Rotate 90 Counterclockwise Повернуть на 90 против часовой стрелки - - Ctrl+Shift+S Ctrl+Shift+S - Data set: %1 doesn't exist! Набор данных %1 не существует! - Stem and leaf plot of dataset - from row от строки - to row до строки - Not enough memory for this dataset! Недостаточно памяти для этого набора данных! - Stem - Leaf - Please confirm the stem unit! - Data set Набор данных - stem unit - Stem unit - Leaf unit - Key Ключ - means - Input error: empty data set! Ошибка ввода: пустой набор данных! - Stem-and-Leaf Plot - - Stem-and-&Leaf Plot - F&ormat Ф&ормат - Alt+C Alt+C - - Zoom &In/Out and Drag Canvas &Приблизить/отдалить и переместить холст - Zoom In (Shift++) or Out (-) and Drag Canvas Приблизить(Shift++) ил отдалить (-) и переместить холст - - Fit Slop&e Аппроксимировать &наклон - &Add &Добавить - - Ctrl+Alt+D Ctrl+Alt+D - &Waterfall Plot &Каскадные графики - &Indexed Colors &Индексированные цвета - Pale&tte &Палитра - Close Закрыть - - - Spec&ial Bar/Column &Особые блоки/столбцы - - Stack &Bar - - Stack &Column - Plot stack bar - Plot stack column - - Move Row Переместить строку - Print preview of window: Предварительные просмотр окна: - - Print Pre&view - Предварительный &просмотр + Предварительный &просмотр - - Ad&just Column Width &Оптимальная ширина столбцов - - &Upward &Вверх - - &Downward В&низ - Append a project to the current folder Добавить проект к текущей папке - Ctrl+Alt+A Ctrl+Alt+A - Move current row upward Переместить текущую строку вверх - Move current row downward Переместить текущую строку вниз - Set optimal column width Установить оптимальную ширину столбцов + + Shared A&xes Panel + + + + + + + + &Custom Layout... + + + + Execute Selected Lines + + + + Commen&t Selection + + + + &Uncomment Selection + + + + Comment Selection + + + + Uncomment Selection + + + + Ctrl+Shift+O + + + + Ctrl+Shift+U + + + + Waterfall Plot + + + + &Extract Data... + + + + S&ubtract + + + + &Straight Line... + + + + &Reference Data... + + + + &Open... + &Открыть... + + + Open Image &File... + + + + &Print... + + + + Print Pre&view... + Предварительный &просмотр... + + + E&xport ASCII... + + ArrowMarker - dx - dy - angle угол - length длина - - eqn уравнение - y - - x @@ -5367,75 +3882,59 @@ AssociationsDialog - Angle Угол - &Cancel О&тмена - Column Столбец - Magn. Magnitude, vector length Велич. - &OK &OK - QtiPlot - Plot Associations QtiPlot - Соответствие координат - Spreadsheet: Таблица данных: - &Update curves Обновить &графики - X X - Y Y - xEnd x конечное - - xErr xErr - yEnd y конечное - - yErr yErr @@ -5443,680 +3942,549 @@ AxesDialog - Additional lines Дополнительные линии - Angle Угол - &Apply &Применить - Automatic Автоматический - - Axes Оси - - Axis Ось - Axis &Font &Шрифт осей - - - Bottom Снизу - &Cancel О&тмена - Canvas frame Рамка холста - - - Color Цвет - Column Столбец - Column Headings Заголовки столбцов - Date Дата - Day of the week День недели - Draw backbones Нарисовать каркас осей - &Font &Шрифт - Font Шрифт - - Format Формат - For&mula &Формула - - From От - General Общие - Grid Сетка - Horizontal Горизонтальная - - In Внутри - - In & Out Внутри и Снаружи - Inverted В обратном порядке - - - Left Слева - Line Color Цвет линии - Line Type Тип линии - Line Width Толщина линии - Major Grids Основная сетка - - Major Ticks Главные деления - Major ticks length Длина штрихов главных делений - Minor Grids Дополнительная сетка - - Minor Ticks Дополнительные деления - Minor ticks length Длина штрихов дополнительной делений - Month Месяц - - None Нет - Numeric Числовой - &OK &OK - - Out Снаружи - - Precision Точность - QtiPlot - Formula input error QtiPlot - Ошибка ввода формулы - QtiPlot - General Plot Options QtiPlot - Общие параметры отображения графика - - - Right Справа - Scale Масштаб - Show Показать - Show Labels Показать метки - Stand-off Отступить на - Step Шаг - Table Таблица - Text from table Текст из таблицы - Thickness Толщина - Time Время - Title Подпись - - To До - - - Top Вверху - - Type Тип - Valid variables are 'x' for Top/Bottom axes and 'y' for Left/Right axes! Допустимыми переменными являются 'x' для верхней/нижней оси и 'y' для левой/правой оси! - Vertical Вертикальная - - Width Ширина - X=0 X=0 - Y=0 Y=0 - days дни - hours часы - millisec. мс - min. мин - sec. с - weeks недели - Show Axis &Break Показать разрыв &оси - Probability функция ошибок - Logit Логит - Draw Break &Decoration Отметить &разрыв - Position Положение - % of Axis Length % от длины оси - pixels точки растра - &Log10 Scale After Break &Log10 шкала после разрыва - Step Before Break Шаг до разрыва - - Guess Авто - Step After Break Шаг после разрыва - Minor Ticks Before Дополнительные деления до - Minor Ticks After Дополнительные деления после - Apply To Применить к - This Layer слою - This Window окну - - - All Windows всем окнам - An&tialised Сгла&живание - + Labels space + + + + Show &backbone + + + Set As &Default Установить по &умолчанию - Apply &to... Применить &к... - - Layer Слой - - Window Окно - Distance to axis Расстояние до оси - Apply &to Применить &к - Decimal: 10000.0 Десятичный: 10000.0 - Scientific: 1e4 Научный: 1e4 - Scientific: 1x10^4 Научный: 1x10^4 - Engineering: 10k Инжнерный: 10k - - + Scientific: 1·10^4 + + + Origin Исходная точка - &Inverted &В обратном порядке - Linear Линейный - Log10 log10 - ln ln - Log2 log2 - Reciprocal обратная величина + + Hide Ticks + + + + At Axis Begin + + + + At Axis End + + + + At Axis Begin & End + + ColorBox - black чёрный - blue синий - cyan голубой - dark cyan тёмно-голубой - dark gray тёмно-серый - dark yellow темно-жёлтый - gray серый - green зелёный - light cyan светло-голубой - light gray светло-серый - light magenta светло-малиновый - light yellow светло-жёлтый - magenta пурпурный - navy тёмно-синий - olive оливковый - orange оранжевый - pink розовый - purple фиолетовый - red красный - royal ярко-синий - violet фиолетовый - white белый - wine бордовый - yellow жёлтый @@ -6124,35 +4492,29 @@ ColorButton - Custom - По выбору + По выбору ColorMapDialog - QtiPlot QtiPlot - Custom Color Map Пользовательская карта цветов - &Apply &Применить - &Close &Закрыть - Set Custom Palette Пользовательская палитра @@ -6160,27 +4522,22 @@ ColorMapEditor - Color Цвет - &Delete &Удалить - &Insert &Вставить - Level Уровень - &Scale Colors &Шкала цветов @@ -6188,30 +4545,22 @@ ColorMapPreviewDialog - QtiPlot - Color Map Preview Dialog QtiPlot - Диалог просмота цвотовой шкалы - Colormap files Файлы цветовой шкалы - All files Все файлы - << &Preview << &Просмотр - - - - None Нет @@ -6219,7 +4568,6 @@ ColorPickerPopup - Custom По выбору @@ -6227,577 +4575,438 @@ ConfigDialog - Area Область - Horizontal Bars Горизонтальные блоки - Horizontal steps Горизонтальные шаги - Line Линия - Line + Symbol Линия + Символ - Scatter Точки - Spline Сплайн - Vertical Bars Вертикальные блоки - Vertical drop lines Вертикальные отрезки - Vertical steps Вертикальные шаги - minutes минут(ы) - (all data shown) (все данные отображены) - 2 points for linear fits 2 точки для линейной аппроксимации - - 2D Plots 2D графики - - 3D Plots 3D графики - Antia&liasing Сгла&живание - Application Приложение - &Apply &Применить - Auto&scaling Авто&масштабирование - Autosca&ling Авто&масштабирование - A&xes &Оси - A&xes Labels Подписи &осей - &Axes Labels Подписи &осей - Axes &Numbers &Числа на осях - Axes &backbones &Каркас осей - Axes linewidth Толщина линий осей координат - - - Background Фон - &Background &Фон - &Backup project before saving &Создать резервную копию перед сохранением - &Cancel О&тмена - Canvas Fra&me &Рамка холста - Check for new versions at startup Проверять наличие новых версий при старте - Choose &font Выбор &шрифта - - - Colors Цвета - Confirmations Подтверждения - Curves Кривые - Decimal Separators Десятичные разделители - Default Column Separator Разделитель столбцов по умолчанию - Default curve style Стиль кривой по умолчанию - Default scripting language Язык сценариев по умолчанию - &Display Comments in Header &Отображать комментарии в заголовках - - Display Peak Curves for Multi-peak Fits Отображать кривые пиков для многопиковой аппроксимации - Do not &resize layers when window size changes Не &изменять размеры слоёв при изменении размера окна - - Empty Пустой - Empty Graph Пустое построение - Fitting Аппроксимация - Folders Директории - - - Fonts Шрифты - Frame width Ширина рамки - General Общие - Generated Fit Curve Аппроксимирующая кривая - &Grid &Сетка - - In Внутри - - In & Out Снаружи и внутри - Lab&els &Метки - - Labels Подписи - &Labels Font Шрифт &подписей - Language Язык - &Legend &Легенда - - Length Длина - Line width Толщина линии - Main Font Основной шрифт - Major Ticks Главные деления - Margin Поля - Matrices Матрицы - Matrix Матрица - Minor Ticks Дополнительные деления - - None Нет - Note Заметка - &Notes &Заметки - Number of Decimal Digits Число десятичных разрядов - - - &Numbers &Числа - Numeric Format Формат чисел - &OK &OK - Options Параметры - O&rthogonal О&ртогональный - - Out Снаружи - Panels Панели - Panels text Текст панелей - Parameters Output Вывод параметров - Paste Parameters to Plot Вставить параметры на график - Peaks Color Цвета пиков - Points Точек - Print Печать - Print Crop&marks Печатать метки &обреза - Prompt on closing Подтверждение при закрытии - Prompt on &renaming tables when appending projects Подтверждение о пе&реименовании таблиц при объединении проектов - QtiPlot - Choose default settings QtiPlot - Выберите установки по умолчанию - QtiPlot - Import options error QtiPlot - Ошибка в параметрах импорта - - - - SPACE Пробел - Same X as Fitting Data Тот же X, что и у аппроксимируемых данных - Save every Сохранять каждые - Scale Errors with sqrt(Chi^2/doF) Масштабировать ошибки по sqrt(Chi^2/doF) - Scale &Fonts Масштабировать &шрифты - &Scale layers to paper size &Масштабировать слои по размеру бумаги - &Show Legend &Отобразить легенду - Show &Title Отобразить &заголовок - Significant Digits Значащие разряды - Smoot&h Line &Гладкая линия - Start New Project Начать новый проект - - - Style Стиль - Symbol size Размер символа - - - - System Locale Setting Системные настройки языка - - - - TAB TAB - Table Таблица - - Tables Таблицы - Text Текст - &Text Font Шрифт &текста - The column separator can be customized. The following special codes can be used: \t for a TAB character @@ -6808,569 +5017,575 @@ \s - пробел (SPACE) - The separator must not contain the following characters: 0-9eE.+- Разделитель не должен содержать следующих символов: 0-9eE.+- - The separator must not contain the following characters: 0-9eE.+- Разделитель не должен содержать следующих символов: 0-9eE.+- - Ticks Деления - T&itle &Заголовок - &Title &Заголовок - Uniform X Function Равномерная функция по X - Workspace Рабочее пространство - Write Parameters to Result Log Записать параметры в журнал результатов - &Disable in-place editing &Отменить WYSIWYG для подписей - File Locations Расположение файлов - Choose the location of the QtiPlot translations folder! Указать местоположение папки переводов QtiPlot! - Matrix Undo Stack Size Размер истории отмен для матриц - - Translations Переводы - - Help Справка - LF (Unix) LF (Unix) - CRLF (Windows) CRLF (Windows) - CR (Mac) CR (Mac) - Endline character Конец строки - - Python Configuration Files Конфигурационные файлы Python - Choose the location of the Python configuration files! Указать местоположение конфигурационных файлов Python! - Automatically &Recalculate Column Values Автоматически пе&рерасчитывать значения столбцов - - Background Color Цвет фона - - - - Opacity Непрозрачность - - Canvas Color Цвет холста - - Border Color Цвет границы - - - - Width Ширина - - Transparent Прозрачный - &Enable autocompletion (Ctrl+U) &Автодополнение (Ctrl+U) - Omit &Thousands Separator Опускать разделитель &тысячных разрядов - Clipboard Decimal Separators Десятичные разделители буфера обмена - &B - &It - Notes Заметки - Tab length (pixels) Ширина отступа (pixels) - Font Шрифт - &Display line numbers &Показывать номера строк - Axes title space Расстояние между осью и её заголовком - &Resolution &Разрешение - &Floor style &Стиль основания - Isolines Изолинии - Projection Проекция - &Mesh &Сетка - Syntax Highlighting Подсветка синтаксиса - Co&mments Ко&мментарии - &Keywords &Ключевые слова - &Quotations &Строки - &Functions &Функции - Q&t Classes Q&t классы - Default Color Map Карта цветов по умолчанию - - Grids Сетка - - Ma&jor Grids &Основная сетка - - Mi&nor Grids &Дополнительная сетка - - Color Цвет - + &Keep aspect ratio + + + Axes Оси - + Geometry + Геометрия + + + Ticks - Labels space + + + + pixels + + + Legend display Показывать в легенде - Column name Название столбца - Column comment Комментарий к столбцу - Table name Название таблицы - Table legend Легенду таблицы - + Unit + Размеры в + + + inch + дюйм + + + mm + мм + + + cm + см + + + point + точка + + + pixel + + + + Canvas Width + + + + Canvas Height + + + Left Слева - Right Справа - Bottom Внизу - Top Вверху - Enabled axes Оси - Show Показать - - + Ask before over&writing files + Подтверждать пере&запись файлов + + + mu&Parser uses C locale settings + Использовать настройки локали "C" для mu&Parser + + Solid Сплошной - - Dash Черта - - Dot Точка - - Dash Dot - + - - Dash Dot Dot - + - - Short Dash - + - - Short Dot - + - - Short Dash Dot + + + + Display Confirmation &Messages for Multi-peak Fits - - QtiPlot - index.html File Not Found! QtiPlot - файл "index.html" не найден! - There is no file called <b>index.html</b> in folder %1.<br>Please choose another folder! В папке '%1' нет файла с именем <b>index.html</b>.<br>Пожалуйста выберите другую папку! - - QtiPlot - Folder Not Found! QtiPlot - папка не найдена! - The folder %1 doesn't exist.<br>Please choose another folder! Папка '%1' не существует.<br>Пожалуйста, выберите другую папку! - %1 is not a folder.<br>Please choose another folder! '%1' - не папка.<br>Пожалуйста, выберите другую папку! - Choose the location of the QtiPlot help folder! Указать местоположение папки со справкой QtiPlot! - There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! В данной папке нет файла с именем <b>index.html</b>.<br>Пожалуйста выберите другую папку! - - QtiPlot QtiPlot - You don't have read access rights to folder %1.<br>Please choose another folder! Нет прав для чтения папки '%1'.<br>Пожалуйста, выберите другую папку! - - &Internet Connection &Сетевые настройки - - &Proxy &Прокси-сервер - - Host Узел - - Port Порт - - Username Имя пользователя - - Password Пароль - LaTeX Compiler Компилятор LaTeX - Choose the location of the LaTeX compiler! Указать местоположение компилятора LaTeX! - - QtiPlot - File Not Found! QtiPlot - файл не найден! - The file %1 doesn't exist.<br>Please choose another file! Файл '%1' не существует.<br>Пожалуйста, выберите другой файл! - %1 is a folder.<br>Please choose a file! '%1' - папка.<br>Пожалуйста, выберите файл! - You don't have read access rights to file %1.<br>Please choose another file! Нет прав для чтения файла '%1'.<br>Пожалуйста, выберите другой файл! + + New Color + + + + &Load Default + + + + Delete Color + + + + Move Color Up + + + + Move Color Down + + + + Indexed Colors + + + + Default Symbol + + + + Edge width + + + + Fill + Заполнение + + + Name + Имя + + + Symbol + Символ + + + Inde&xed Symbols + + + + &Fill Symbol + + + + Move Symbol Up + + + + Move Symbol Down + + + + Pattern + Шаблон + + + Line style + + + + Fill area under curve + Заполнить область под кривой + + + Default Line Style + + + + Axis title + + + + Default + По умолчанию + + + Synchronize scale &divisions + + ContourLinesEditor - Level Уровень - Pen Перо - &Insert &Вставить - &Delete &Удалить - QtiPlot - Edit pen QtiPlot - Изменить перо - Color Цвет - - - Apply to all Применить ко всем - Style Стиль - Width Ширина - &Ok &Ok - &Close &Закрыть @@ -7378,56 +5593,38 @@ Convolution - Convolution Свёртка - Could not allocate memory, operation aborted! Не удалось выделить память, операция отменена! - - - - - Error Ошибка - - Index Индекс - - - - - QtiPlot QtiPlot - The response data set %1 does not exist! Ответного набора данных %1 не существует! - The response dataset '%1' must be less then half the size of the signal dataset '%2'! Объём данных отклика '%1' должен составлять менее половины объёма данных сигнала '%2'! - The response dataset '%1' must contain an odd number of points! Набор данных отклика '%1' должен содержать нечётное число точек! - The signal data set %1 does not exist! Набор сигнальных данных %1 не существует! @@ -7435,38 +5632,26 @@ Correlation - Correlation Корреляция - - - Error Ошибка - Error in GSL forward FFT operation! Ошибка в библиотеке GSL при прямом БПФ! - - Lag Запаздывание - - - QtiPlot QtiPlot - - The data set %1 does not exist! Набор данных %1 не существует! @@ -7474,68 +5659,54 @@ CreateBinMatrixDialog - - QtiPlot QtiPlot - Bin Matrix Dialog Матрица 2D гистограммы - &OK &OK - &Cancel О&тмена - X-min - X-max - Columns Столбцов - Y-min - Y-max - Rows Строк - Input Size Error Ошибка ввода размера - The dimensions you have specified are not acceptable! Указанные размеры недопустимы! - Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! Введите положительные числа, произведение которых не превышает INT_MAX в вашей системе! @@ -7543,32 +5714,26 @@ CurveRangeDialog - &Close &Закрыть - Data set: Набор данных : - From row number От строки номер - &OK &OK - QtiPlot - Plot range QtiPlot - Диапазон - To row number До строки номер @@ -7576,152 +5741,122 @@ CurvesDialog - Area Область - Horizontal Bars Горизонтальные блоки - Horizontal steps Горизонтальные шаги - Line Линия - Line + Symbol Линия + Символ - Scatter Точки - Spline Сплайн - Vertical Bars Вертикальные блоки - Vertical drop lines Вертикальные отрезки - Vertical steps Вертикальные шаги - Available data Доступные данные - Close Закрыть - Contour - Color Fill Контур - заполнение цветом - Contour Lines Линии контура - &Delete Curve &Удалить кривую - &Delete Selection &Удалить выделенное - &Edit Function... &Редактировать функцию... - Edit &Range... Изменить &диапазон... - Graph contents Содержимое построения - Gray Scale Map Шкала уровней серого - New curves style Стиль новых кривых - OK OK - &Plot &График - &Plot Associations... &Соответствие координат... - &Plot Selection &Построить выбранное - QtiPlot - Add/Remove curves QtiPlot - Добавить/удалить кривые - &Show Range П&оказать диапазон - Show current &folder only &Показывать только текущую папку - Histogram Гистограмма - Histogram Гистограмма @@ -7729,237 +5864,174 @@ CustomActionDialog - - - - - - - - - - - QtiPlot QtiPlot - Add Custom Action Добавить действие - Folder Папка - Choose &Folder Выбрать &папку - Script File Файл сценария - Choose &Script Выбрать &сценарий - Icon Значок - Choose &Icon Выбрать &значок - - Text Текст - Tool Tip Text Всплывающая подсказка - Shortcut Комбинация клавиш - &Menu &Меню - &Tool Bar &Панель инструментов - &Add &Добавить - &Remove &Удалить - &Close &Закрыть - - - - - - - Error Ошибка - Please provide a description for your custom action! Пожалуйста, дайте описание для вашего действия! - Dot characters are not allowed in the description text! Символ точки недопустим в описании! - You have already defined an action having description: %1 <br>Please provide a different description text! Вы уже определили действие: %1 <br>Пожалуйста, дайте другое описание! - The file you have specified doesn't exist, please choose a valid script file! Указанный файл не существует, пожалуйста, выберите действительный файл сценария! - The image file you have specified doesn't exist or can't be read, please choose another file! Указанное изображение не существует или не может быть прочитано, пожалуйста, выберите другой файл! - Please provide a different key sequence! The following shortcut key sequences are already assigned: Пожалуйста, назначьте другое сочетание клавиш! Данное сочетание уже присвоено: - Are you sure you want to remove this action? Вы уверены, что хотите удалить это действие? - Remove Action Удалить действие - - File Save Error Ошибка сохранения файла - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Невозможно выполнить запись в файл: <br><h4> %1 </h4><p>Удостоверьтесь, что у вас есть права доступа на запись в данное место! - QtiPlot - Load icon from file QtiPlot - Загрузить значок из файла - Choose script file Выбрать файл сценария - Choose the custom actions folder Выбрать папку пользовательских действий - &Save &Сохранить - &Delete Menu &Удалить меню - Python Script Сценарий Python - All Files Все файлы - Add menu Добавить меню - Menu title: Заголовок меню: - Please, choose the location of the new menu Пожалуйста, укажите расположение нового меню - Menu: Меню: - Remove Menu Удалить меню - Are you sure you want to remove menu '%1' and all its actions? Вы уверены, что хотите удалить меню '%1' и все его действия? - &New Menu... &Новое меню... - - Menu Bar Панель меню - There's already a menu item with this title, please choose another title! Меню с таким заголовком уже существует, выберите другой заголовок! @@ -7967,57 +6039,42 @@ DataPickerTool - Click on plot or move cursor to display coordinates! Щёлкните на графике или переместите курсор для отображения координат! - Please, click on plot and move cursor! Пожалуйста, щёлкните на графике и переместите курсор! - QtiPlot - Move point error QtiPlot - Ошибка перемещения данных - QtiPlot - Remove point error QtiPlot - Ошибка удаления данных - - - - QtiPlot - Warning QtiPlot - Предупреждение - Select point and double click to remove it! Выберите точку и дважды щёлкните на ней для её удаления! - Sorry, but moving points of a function is not possible. Извините, перемещение точек функции невозможно. - Sorry, but removing points of a function is not possible. Извините, удаление точек функции невозможно. - - This operation cannot be performed on curves plotted from columns having a non-numerical format. Эта операция не может быть выполнена над кривыми, построенными для столбцов с не числовым форматом данных. - - The column '%1' is read-only! Please choose another curve! Столбец '%1' - только для чтения! Пожалуйста, выберите другую кривую! @@ -8025,7 +6082,6 @@ Deconvolution - Deconvolution Обратная свёртка @@ -8033,13 +6089,10 @@ Differentiation - - Derivative Производная - of Derivative of от @@ -8048,7 +6101,6 @@ DrawPointTool - Draw Рисование @@ -8056,476 +6108,365 @@ EnrichmentDialog - - - - QtiPlot QtiPlot - Tex Equation Editor Редактор формул Tex - Clea&r &Очистить - Window Geometry Геометрия окна - Object Properties Свойства объекта - &Apply &Применить - &Close &Закрыть - Preview: Просмотр: - - &Text &Текст - - Color Цвет - - - Set As &Default Установить по &умолчанию - &Font &Шрифт - Auto-&update Авто&обновление - - Opacity Непрозрачность - - Transparent Прозрачный - File Файл - &Save internally - &Image &Изображение - Shape Форма - None Нет - Rectangle Прямоугольник - Shadow Тень - Line Style Тип линии - - Width Ширина - - - All Windows всем окнам - &Frame &Рамка - Fill Color Цвет заполнения - Pattern Шаблон - Pattern Color Цвет шаблона - Use &Frame Color Цвет &рамки - Fill &Pattern &Заполнение - Page Страница - Layer Scales Координатам - Attach to Прикрепить к - inch дюйм - mm мм - cm см - point точка - pixel точка растра - scale шкала - Unit Размеры в - Position Положение - X X - Y Y - Size Размер - Height Высота - &Keep aspect ratio &Сохранять пропорции - &Best size &Оптимальный размер - &Geometry &Геометрия - Network connection error Ошибка сетевого соединения - Error while trying to connect to host %1: Ошибка при попытке соединения с %1: - Please verify your network connection! Проверьте сетевое соединение! - QtiPlot - Import image from file QtiPlot - Импортировать изображение из файла - QtiPlot - Warning QtiPlot - Предупреждение - The file %1 doesn't exist. The image cannot be restored when reloading the project file! Файл %1 не существует. Изображение не может быть восстановлено при повторном открытии проекта! - - - Layer Слой - - - Window Окно - Background Фон - Rotate (deg.) Повернуть (град) - - - Object Объект - - Apply t&o... Применить &к... - Line Линия - Apply format &to... Применить формат &к... - MathTran (http://www.mathtran.org/) MathTran (http://www.mathtran.org/) - locally installed установлен - LaTeX Compiler Компилятор LaTeX - TeX &Output - + Выв&од TeX - Compile process ended - + Компиляция завершена - Compiling process ended with exit code: %1 - + Компиляция завершена с кодом выхода: %1 - LaTeX compile process - + Процесс LaTeX - dvipng process - + Процесс dvipng - - failed to start! - + не запустился! - Please verify that you have dvipng installed in the same folder as your LaTeX compiler! - + Пожалуйста, проверьте, что программа dvipng установлена в тот же каталог, что и компилятор LaTeX! - crashed - + совершил недопустимую ошибку - timedout - + вышел за рамки предоставленного времени - write error - + ошибка записи - read error - + ошибка чтения - unknown error - + неизвестная ошибка - Compile error - + Ошибка компиляции - Please set the correct path to the compiler in the preferences dialog! - + Пожалуйста, укажите путь к компилятору LaTeX в настройках! ErrDialog - &Add &Добавить - Add Error Bars to Добавить усы погрешности к - &Close &Закрыть - Percent of data (%) Процент от данных (%) - QtiPlot - Error Bars QtiPlot - Усы погрешности - - Source of errors Исходные данные для погрешности - Standard Deviation of Data Стандартное отклонение для данных - &X Error Bars Погрешность по &X - &Y Error Bars Погрешность по &Y - Existing column Существующий столбец @@ -8533,77 +6474,62 @@ ExpDecayDialog - Amplitude Амплитуда - &Close &Закрыть - Color Цвет - Decay time Время распада - Exponential Fit of Аппроксимация экспонентой для - First decay time (t1) Первое время распада (t1) - &Fit &Аппроксимация - Growth time Время роста - Initial time Начальное время - QtiPlot - Verify initial guesses QtiPlot - Проверка начальных предположений - QtiPlot - Warning QtiPlot - Предупреждение - Second decay time (t2) Второе время распада (t2) - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! Кривая <b> %1 </b> больше не существует! Операция отменена! - Third decay time (t3) Третье время распада (t3) - Y Offset Смещение по Y @@ -8611,44 +6537,34 @@ ExponentialFit - Exponential decay Затухание по экспоненте - Exponential growth Возрастание по экспоненте - ExpGrowth ЭкпРост - - amplitude амплитуда - lifetime время жизни - - offset смещение - ExpDecay1 ЭксРаспад1 - e-folding time время убывания в e раз @@ -8656,86 +6572,78 @@ ExportDialog - &All &Все - Export &Selection Экспортировать &выделенное - &Help &Справка - Include Column Co&mments Включить &комментарии к столбцам - Include Column &Names Включить &названия столбцов - QtiPlot - Export ASCII QtiPlot - экспорт в ASCII - QtiPlot - Help QtiPlot - Справка - QtiPlot - Import options error QtiPlot - Ошибка в параметрах импорта - + QtiPlot + QtiPlot + + + Overwrite file? + Перезаписать файл? + + + %1 already exists. + %1 уже существует. + + + Do you want to replace it? + Заменить? + + QtiPlot - Export error QtiPlot - Ошибка при экспорте - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Невозможно выполнить запись в файл: <br><h4> %1 </h4><p>Удостоверьтесь, что у вас есть права доступа на запись в данное место! - - - - - SPACE Пробел - Separator Разделитель - - - - - TAB TAB - Table Таблица - - The column separator can be customized. The following special codes can be used: \t for a TAB character \s for a SPACE @@ -8744,9 +6652,6 @@ \s - пробел (SPACE) - - - The separator must not contain the following characters: 0-9eE.+- Разделитель не должен содержать следующих символов: 0-9eE.+- @@ -8754,89 +6659,124 @@ ExtensibleFileDialog - << &Advanced << &Подробно + ExtractDataDialog + + QtiPlot + QtiPlot + + + Extract Data + + + + For row (i) + Строки (i) от + + + to + до + + + Add function + Добавить функцию + + + Add column + Добавить столбец + + + &Apply + &Применить + + + Clear &Formulas + &Очистить + + + &Close + &Закрыть + + + &Put into table + + + + Table + Таблица + + + Cond&ition: + + + + Add &function + + + + Add co&lumn + + + + Add &operator + + + + Clea&r + &Очистить + + + FFT - - - - Amplitude Амплитуда - - Angle Угол - - - - - FFT БПФ - - Forward Прямое - - - Frequency Частота - Hz Гц - - Imaginary Мнимая часть - - Inverse Обратное - - Real Действительная часть - - - Time Время - - - - of от - s с @@ -8844,113 +6784,90 @@ FFTDialog - &Close &Закрыть - Curve График функции - &Forward &Прямое - Imaginary Мнимая часть - &Inverse &Обратное - &Normalize Amplitude &Нормировать амплитуды - &OK &OK - Please choose a column for the real part of the data! Пожалуйста, выберите столбец для действительной части данных! - QtiPlot - Error QtiPlot - Ошибка - QtiPlot - FFT Options QtiPlot - параметры БПФ - Real Действительная часть - Sampling Выборка - - Sampling Interval Шаг выборки - &Shift Results &Перегруппировать результат - QtiPlot QtiPlot - The two matrices have different dimensions, the imaginary part will be neglected! Две матрицы имеют различный размер, мнимая часть будет игнорирована! - RealMatrixFFT - Real part of the FFT transform of Действительная часть БПФ - ImagMatrixFFT - Imaginary part of the FFT transform of Мнимая часть БПФ - AmplitudeMatrixFFT - Amplitudes of the FFT transform of Амплитуды БПФ @@ -8958,64 +6875,50 @@ FFTFilter - Band Block FFT Filter Режекторный фильтр БПФ - Band Pass FFT Filter Полосовой фильтр БПФ - - Error Ошибка - FFT БПФ - Filtered Фильтрованный - High Pass FFT Filter БПФ-фильтр высоких частот - Hz Гц - Low Pass FFT Filter БПФ-фильтр низких частот - Please enter different values for the band limits. Введите различающиеся значения границ диапазона. - - QtiPlot QtiPlot - Unknown filter type. Valid values are: 1 - Low pass, 2 - High Pass, 3 - Band Pass, 4 - Band block. Неизвестный тип фильтра. Допустимые значения: 1 - фильтр нижних частот (Low pass), 2 - фильтр верхних частот (High Pass), 3 - полосовой (Band Pass), 4 - режекторный (Band block). - to до @@ -9023,82 +6926,58 @@ Filter - - - - - Error Ошибка - Please assign a curve first! Пожалуйста, сначала назначьте кривую! - Please enter a valid curve name! Пожалуйста, введите правильное название кривой! - Plot График - - - - - - QtiPlot QtiPlot - QtiPlot - Color Name Error QtiPlot - Ошибка названия цвета - QtiPlot - Filter Error QtiPlot - Ошибка фильтра - Several data points have the same x value causing divisions by zero, operation aborted! Несколько точек данных имеют одинаковое значение X. Это привело к делению на ноль, операция отменена! - The color name '%1' is not valid, a default color (red) will be used instead! Цвет под названием '%1' недопустим, вместо него будет использован цвет по умолчанию (красный)! - You didn't specify a valid data set for this operation! Не указан допустимый набор данных для данной операции! - - You need at least %1 points in order to perform this operation! Минимально необходимо точек для выполнения данной операции: %1 ! - of от - Memory Allocation Error Ошибка выделения памяти - Not enough memory, operation aborted! Недостаточно памяти, операция отменена! @@ -9106,63 +6985,50 @@ FilterDialog - Add DC Offset Добавить постоянное смещение - &Close &Закрыть - - Color Цвет - &Filter &Фильтр - Filter curve: Отфильтровать кривую: - Frequency cutoff (Hz) Частота среза (Гц) - High Frequency (Hz) Верхняя частота (Гц) - Low Frequency (Hz) Нижняя частота (Гц) - Please enter frequency limits that satisfy: Low < High ! Пожалуйста введите пределы частоты, удовлетворяющие соотношению: нижний < верхнего! - QtiPlot - Filter options QtiPlot - Параметры фильтра - QtiPlot - Frequency input error QtiPlot - Ошибка ввода частоты - Substract DC Offset Удалить постоянное смещение @@ -9170,68 +7036,54 @@ FindDialog - Case &Sensitive С &учётом регистра - &Close &Закрыть - - Find Найти - &Find &Найти - Folder &Names Названия &каталогов - &Include Subfolders Включая &подкаталоги - &Partial Match Allowed Допускается &частичное совпадение - QtiPlot QtiPlot - Search in Искать в - Start From Начать с - &Update Start Path &Обновить начальный путь - Window &Labels &Метки окон - &Window Names &Названия окон @@ -9239,79 +7091,58 @@ FindReplaceDialog - - - QtiPlot QtiPlot - - Find Найти - Find and Replace Найти и заменить - Replace with Заменить на - &Match case С &учётом регистра - &Whole word &Слово целиком - &Next &Следующее - &Previous &Предыдущее - &Replace &Заменить - Replace &all Заменить &все - &Close &Закрыть - - - Empty Search Field Очистить поле поиска - - - The search field is empty. Please enter some text and try again. Поле поиска пусто. Введите текст и повторите снова. - QtiPlot has finished searching the document. QtiPlot закончил поиск по документу. @@ -9319,350 +7150,260 @@ Fit - algorithm with tolerance = алгоритм с допустимым отклонением = - Arbitrary Dataset Произвольный набор данных - Dataset Набор данных - Error Ошибка - Fit Аппроксимация - From x От значения по x - Function Функция - Instrumental Инструментальный - Iterations Итераций - Nelder-Mead Simplex Симплекс Нелдера-Мида - No weighting Без взвешивания - Parameter Параметр - Plot График - - - - QtiPlot - Error QtiPlot - Ошибка - - - - - - - QtiPlot - Fit Error Ошибка аппроксимации - - R^2 R^2 - Scaled Levenberg-Marquardt Масштабированный Левенберг-Макуардт - Statistical Статистический - Status Состояние - The column %1 has less points than the fitted data set. Please choose another column!. - Столбец %1 содержит меньше точек, чем обрабатываемый набор данных. Пожалуйста, выберите другой столбец! + Столбец %1 содержит меньше точек, чем обрабатываемый набор данных. Пожалуйста, выберите другой столбец! - The curve %1 has no associated Y error bars. You cannot use instrumental weighting method. У кривой %1 нет соответствующей погрешности по Y. Использование метода инструментального взвешивания невозможно. - There are no parameters specified for this fit operation. Operation aborted! Не указаны параметры для выполнения операции. Операция прервана! - Unscaled Levenberg-Marquardt Немасштабированный Левенберг-Макуардт - Value Значение - Weighting Method Способ взвешивания - You cannot use the instrumental weighting method. Невозможно использование метода инструментального взвешивания. - You didn't specify a valid data set for this fit operation. Operation aborted! Не указан допустимый набор данных для этой операции. Операция прервана! - You must specify a valid fit function first. Operation aborted! Необходимо сначала указать допустимую функцию для аппроксимации. Операция прервана! - You need at least %1 data points for this fit operation. Operation aborted! Необходимо как минимум %1 точек данных для аппроксимации. Операция прервана! - graphics display disabled графическое отображение отключено - of dataset набора данных - to x до значения по x - using error bars dataset использую набор данных о погрешности - using function используя функцию - QtiPlot QtiPlot - File Save Error Ошибка сохранения файла - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Невозможно выполнить запись в файл: <br><h4> %1 </h4><p>Удостоверьтесь, что у вас есть права доступа на запись в данное место! - QtiPlot Fit Model Аппроксимационная модель - Cannot read file %1: %2. Не удалось открыть файл %1: %2. - - - Please perform a fit first! Сперва нужно аппроксимировать данные! - Residuals of %1 Остаток %1 - residue разность - Adjusted R^2 - RMSE (Root Mean Squared Error) Среднеквадратичная ошибка - RSS (Residual Sum of Squares) Сумма квадратов разностей - The column %1 has less points than the fitted data set. Please choose another column! Столбец %1 содержит меньше точек, чем обрабатываемый набор данных. Пожалуйста, выберите другой столбец! - FitResiduals - - FitStats - Confidence Limits of %1 Доверительный интервал %1 - - Independent Variable Независимая переменная - LCL - Lower %1 Confidence Limit Нижняя %1 доверительная граница - UCL - Upper %1 Confidence Limit Верхняя %1 доверительная граница - Prediction Limits of %1 Прогнозируемый интервал %1 - LPL - Lower %1 Prediction Limit Нижняя %1 прогнозируемая граница - UPL - Upper %1 Prediction Limit Верхняя %1 прогнозируемая граница - Direct Weighting using Dataset Непосредственное взвешивание, используя набор данных - - - - - - - QtiPlot - Memory Allocation Error QtiPlot - Ошибка выделения памяти - - Could not allocate enough memory for the fit curves! Невозможно выделить достаточное количество памяти для аппроксимации кривых! - QtiPlot - Memory Allocation Error QtiPlot - Ошибка выделения памяти - - - - - - Not enough memory! Недостаточно памяти! @@ -9670,7 +7411,6 @@ FitDialog - is a built-in function name<p>You must choose another name for your function! является именем встроенной функции<p>Для вашей функции вы должны выбрать другое имя! @@ -9683,79 +7423,62 @@ << &Аппроксимировать - Add &expression Добавить &выражение - Add &name Добавить &название - Algorithm Алгоритм - &Apply &Применить - Arbitrary Dataset Произвольный набор данных - Basic Основные - Built-in Встроенные - Category Категория - Choose the plugins folder Выбрать папку с расширениями - - - &Close &Закрыть - Color Цвет - Constant Константа - CovMatrix КовМатрица - Covariance &Matrix Ковариационная &матрица - Curve График функции @@ -9764,17 +7487,14 @@ &Пользовательский вывод >> - &Delete Fit Curves &Удалить аппроксимирующие кривые - Expression Выражение - &Fit &Аппроксимировать @@ -9783,451 +7503,352 @@ &Аппроксимировать >> - Fit using &built-in function Аппроксимация &встроенной функцией - Fit using &plugin function Аппроксимация функцией из &модуля расширения - Fit with &built-in function Аппроксимация &встроенной функцией - Fit with selected &user function Аппроксимация &пользовательской функцией - From x= От x= - - Function Функция - - Gauss Гаусс - Generated Fit Curve Аппроксимирующая кривая - Initial guesses Начальные оценки - Instrumental Инструментальный - Iterations Итераций - - Lorentz Лоренц - Name Имя - - Name: Название: - Nelder-Mead Simplex Симплекс Нелдера-Мида - - No data tables Нет таблиц данных - No weighting Без взвешивания - Parameter Параметр - - Parameters Параметры - Parameters Output Вывод параметров - Parameters &Table &Таблица параметров - &Paste Parameters to Plot Вставить параметры на &график - Peaks Пиков - Please enter a function name! Пожалуйста введите имя функции! - - Please enter a valid function! Пожалуйста введите допустимую функцию! - Please enter a valid name for the covariance matrix. Введите, пожалуйста, допустимое название матрицы ковариации. - Please enter a valid name for the parameters table. Введите, пожалуйста, допустимое название таблицы параметров. - Please enter x limits that satisfy: from < end! Введите параметры удовлетворяющие условию: начало < конец! - - - - - Please perform a fit first and try again. Сперва нужно аппроксимировать данные. - Please verify that you have initialized all the parameters! Пожалуйста проверьте, что все параметры заданы! - Plugins Модули расширения - Points Точек - - Polynomial Полиномиальная - - Polynomial Order Порядок полинома - - - - - - - QtiPlot - Error QtiPlot - Ошибка - QtiPlot - Error: function name QtiPlot - Ошибка: наименование функции - QtiPlot - Fit Wizard QtiPlot - Мастер Аппроксимации - QtiPlot - Input error QtiPlot - Ошибка ввода - - - - - QtiPlot - Input function error QtiPlot - Ошибка ввода функции - QtiPlot - Warning QtiPlot - Предупреждение - &Remove &Удалить - Rese&t &Сбросить - Same X as Fitting &Data Тот же X, что и у аппроксимируемых &данных - - &Save &Сохранить - Scaled Levenberg-Marquardt Масштабированный Левенберг-Макуардт - Significant Digits Значащие разряды - Statistical Статистический - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! Кривая <b> %1 </b> больше не существует! Операция отменена! - To x= До x= - Tolerance Допуск - &Uniform X Function &Однородная функция X - Unscaled Levenberg-Marquardt Немасштабированный Левенберг-Макуардт - User defined Определённые пользователем - Value Значение - Weighting Method - Способ взвешивания + Способ взвешивания - &Write Parameters to Result Log Записать параметры в &журнал результатов - user1 имя функции - &One table for all fits &Одна таблица для всех аппроксимаций - - Choose plug&ins folder... &Выбрать папку с расширениями... - + Data Set + Набор данных + + + Weighting + Взвешивание + + + Re&load + Пере&загрузить + + + &Guess + &Предположить + + + &Range + &Диапазон + + Error Ошибка - - - Select Function - + Выбрать функцию - - - - Fitting Session - + Аппроксимация - - - Custom Output - + Вывод - Start Fitting Session - + Начать сессию аппроксимации - You can't define functions recursively! Вы не можете определять функции рекурсивно! - - QtiPlot fit model Аппроксимационная модель - - All files Все файлы - - - QtiPlot QtiPlot - - Save Fit Model As Сохранить аппроксимационную модель как - Are you sure you want to remove fit model file: %1 ? Вы уверены, что хотите удалить файл аппросимационной модели: %1 ? - Remove Fit Model Удалить аппроксимационную модель - Choose &models folder... &Выбрать папку моделей... - Choose the fit models folder Выбрать папку аппроксимационных моделей - &Preview &Просмотр - From От - To До - &Residuals Plot &График разности - Co&nf. Bands &Довер. Интервал - Pred. &Bands &Прогноз. Интервал - &Scale Errors with sqrt(Chi^2/doF) &Масштабировать ошибки по sqrt(Chi^2/doF) - Direct Weighting Непосредственное взвешивание - Error: Ошибка: @@ -10235,12 +7856,10 @@ Folder - bytes байт - kB кб @@ -10248,108 +7867,86 @@ FrequencyCountDialog - QtiPlot - Frequency count QtiPlot - Частотный анализ - Statistics on %1 Статистика %1 - Mean Среднее - Standard Deviation Среднеквадратичное отклонение - Median Медиана - Size Размер - From Minimum От - To Maximum До - Step Size Шаг - &Apply &Применить - &Cancel О&тмена - &Ok &Ok - QtiPlot - Error QtiPlot - Ошибка - Not enough data points, operation aborted! Недостаточно точек, операция отменена! - QtiPlot - Frequency input error QtiPlot - Ошибка ввода частоты - Please enter frequency limits that satisfy: From < To ! Нижний предел должен быть меньше верхнего! - - Count Подсчёт - Frequency count of %1 Частотный анализ %1 - BinCtr ЦентрКорзин - BinEnd ГраницаКорзин - Sum Сумма @@ -10357,166 +7954,146 @@ FunctionDialog - Clear Function - Очистить функцию + Очистить функцию - Clear list - Очистить список + Очистить список - Curve type Тип кривой - - From От - From x= От x= - Function Функция - - Parameter Параметр - Parametric plot Параметрический график - - Please enter parameter limits that satisfy: from < end! Пожалуйста введите пределы изменения параметра, удовлетворяющие соотношению: от < до! - Please enter x limits that satisfy: from < end! Пожалуйста введите пределы изменения x, удовлетворяющие соотношению: от < до! - - - Points Точек - Polar plot Полярный график - QtiPlot - Add function curve QtiPlot - Добавить график функции - - QtiPlot - End limit error - QtiPlot - Ошибка выбора конечной границы + QtiPlot - Ошибка выбора конечной границы - - - QtiPlot - Input error QtiPlot - Ошибка ввода - - - - - QtiPlot - Input function error QtiPlot - Ошибка ввода функции - - QtiPlot - Start limit error - QtiPlot - Ошибка выбора начальной границы + QtiPlot - Ошибка выбора начальной границы - R = R = - Theta = Theta = - - To До - To x= До x= - f(x)= f(x)= - + Click here to select a recently typed expression + Выбрать одно из последних введённых выражений + + + Rece&nt + По&следние + + x = x = - y = y = - Clea&r Function О&чистить функцию - &Ok &Ok - &Close &Закрыть - + QtiPlot + QtiPlot + + + Sorry, there are no recent expressions available! + Нет доступных выражений! + + + Recent Functions + Последние функции + + + Please, choose a function: + Выбрать функцию: + + Constant Константа - Value Значение - &Add Function Добавить &функцию @@ -10524,32 +8101,26 @@ GaussAmpFit - GaussAmp Fit Аппроксимация Гауссовой функцией (по амплитуде) - GaussAmp ГауссАмп - offset смещение - center центр - width ширина - amplitude амплитуда @@ -10557,32 +8128,26 @@ GaussFit - Gauss Fit Аппроксимация Гауссовой функцией (по площади) - Gauss Гаусс - area площадь - center центр - width ширина - offset смещение @@ -10590,167 +8155,122 @@ Graph - - &Copy &Копировать - Ctrl+Shift+R Ctrl+Shift+R - Data set generated from curve Набор данных, полученных из кривой - - &Delete &Удалить - F F - File format not handled, operation aborted! Формат файла не поддерживается, операция отменена! - &Hide axis &Скрыть оси - Image file: <p><b> %1 </b><p>does not exist anymore! Файл изображения: <p><b> %1 </b><p>больше не существует! - - Please provide a valid file name! Укажите допустимое имя файла! - - - &Properties... &Свойства... - - - - - - QtiPlot - Error QtiPlot - Ошибка - layer слой - QtiPlot - File open error QtiPlot - Ошибка при открытии файла - - - QtiPlot - Warning QtiPlot - Предупреждение - &Rescale to show all &Перерисовать и отобразить всё - &Scale... &Масштаб... - &Show grids &Показать сетку - Table - Таблица + Таблица - The column Столбец - The columns Столбцы - There are no curves available on this plot! На данном графике нет доступных кривых! - There are no curves with more than two points on this plot. Operation aborted! На данном графике нет кривых с более чем двумя точками. Операция прервана! - Title Заголовок - are empty and will not be added to the plot! являются пустыми и их содержимое не может быть отображено на графике! - is empty and will not be added to the plot! является пустой и её содержимое не может быть отображено на графике! - - Couldn't change the axis type to the requested format! Невозможно изменить тип оси на требуемый! - Y Axis Title Подпись оси Y - X Axis Title Подпись оси X - - Cu&t В&ырезать - - C&lear Сте&реть @@ -10758,35 +8278,26 @@ Graph3D - File format not handled, operation aborted! Формат файла не поддерживается, операция отменена! - - Please provide a valid file name! Укажите допустимое имя файла! - - - QtiPlot - Error QtiPlot - Ошибка - X axis Ось X - Y axis Ось Y - Z axis Ось Z @@ -10794,161 +8305,176 @@ ImageExportDialog - Image quality Качество изображения - &Keep aspect ratio &Сохранять пропорции - QtiPlot - Choose a filename to save under QtiPlot - Выберите имя файла для сохранения - Resolution (DPI) Разрешение (DPI) - + &Escape special characters in texts + &Пропускать специальные символы в тексте + + Save transparency Сохранить прозрачность - Native fonts Родные шрифты - LaTeX file Файл LaTeX - Export 3D texts as Экспортировать 3D текст как - Export in &color &Экспортировать в цвете - &Escape special characters in title/axis labels - &Пропускать специальные символы в подписях осей и заглавиях + &Пропускать специальные символы в подписях осей и заглавиях - Export &font sizes Экспортировать размеры &шрифтов - Bitmap images Изображения Bitmap - 3D Sort mode 3D метод сортировки - No sort без сортировки - Simple sort Простая сортировка - BSP sort BSP сортировка - inch дюйм - mm мм - cm см - point точка - pixel точка растра - Unit Размеры в - Width Ширина - Height Высота - + QtiPlot + QtiPlot + + + Overwrite file? + Перезаписать файл? + + + %1 already exists. + %1 уже существует. + + + Do you want to replace it? + Заменить? + + + QtiPlot - Export error + QtiPlot - Ошибка при экспорте + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + Невозможно выполнить запись в файл: <br><h4> %1 </h4><p>Удостоверьтесь, что у вас есть права доступа на запись в данное место! + + Custom print size Пользовательский размер для печати - Scale Fonts Factor Масштабирование шрифтов - Automatic Автоматически - Print Resolution (DPI) Разрешение (DPI) + ImageProfilesTool + + Position + Положение + + + x + x + + + y + y + + + Z-Value + z + + + ImageWidget - - QtiPlot - File openning error QtiPlot - ошибка при открытии файла - The file: <b>%1</b> doesn't exist! Файл: <b>%1</b> не существует! - You don't have the permission to open this file: <b>%1</b> У вас нет прав доступа на открытие файла: <b>%1</b> @@ -10956,12 +8482,10 @@ ImportASCIIDialog - All files Все файлы - By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. @@ -10971,7 +8495,6 @@ удалены. - By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal @@ -10985,135 +8508,102 @@ одиночным пробелом. - By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. Если отметить этот пункт, все пробелы в начале и конце строк будут удалены, а все начальные разделители (включая символ табуляции) будут заменены одиночным пробелом. - By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. Если отметить этот пункт, в ASCII файле будут удалены все разделители в начале и конце строк. - By checking this option each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. Если отметить этот пункт, каждая последовательность внутренних разделителей (включая символ табуляции) будет заменена одиночным пробелом. - Comma Separated Values Данные, разделённые запятой - Data files Файлы данных - Decimal Separators Десятичные разделители - &Help &Справка - Ignore first Исключить первые - Ignore lines starting with Исключить строки, начинающиеся с - Import each file as: Импортировать каждый файл как: - New Columns Новый столбец - New Rows Новая строка - - New Table Новая таблица - QtiPlot - Help QtiPlot - Справка - QtiPlot - Import ASCII File(s) QtiPlot - импорт файлов ASCII - &Remove white spaces from line ends &Удалить пробелы в конце строк - Remove white spaces from line ends Удалить пробелы в конце строк - - - - SPACE Пробел - Separator: Разделитель: - &Simplify white spaces &Упростить разделители - Simplify white spaces Упростить разделители - System Locale Setting Настройки локализации - - - - - TAB TAB - Text files Текстовые файлы - The column separator can be customized. The following special codes can be used: \t for a TAB character @@ -11124,7 +8614,6 @@ \s - пробел (SPACE) - The column separator can be customized. The following special codes can be used: \t for a TAB character \s for a SPACE @@ -11133,20 +8622,16 @@ \s - пробел (SPACE) - The separator must not contain the following characters: 0-9eE.+- Разделитель не должен содержать следующих символов: 0-9eE.+- - The separator must not contain the following characters: 0-9eE.+- Разделитель не должен содержать следующих символов: 0-9eE.+- - - To avoid this problem you should precisely define the column separator using TAB and SPACE characters. @@ -11156,17 +8641,14 @@ символы табуляции и пробела. - To avoid this problem you should precisely define the column separator using TAB and SPACE characters. Во избежания проблемы вы должны точно указать разделитель, используя символы табуляции и пробела. - Use second row as &comments Считать вторую строку &комментарием - Warning: checking this option leads to column overlaping if the columns in the ASCII file don't have the same number of rows. @@ -11175,7 +8657,6 @@ различается. - Warning: checking this option leads to column overlaping if the columns in the ASCII file don't have the same number of rows. @@ -11185,88 +8666,74 @@ различается. - Warning: using these two last options leads to column overlaping if the columns in the ASCII file don't have the same number of rows. Внимание: выбор двух последних пунктов приведёт к перекрытию столбцов, если число строк в столбцах ASCII файла отличается. - lines строк(и) - Import as &read-only Импортировать только для &чтения - All Все - &Preview Lines &Просмотр - - New Matrice Новая матрица - Overwrite Current Window Поверх текущего окна - + New Matrix + Новая матрица + + Use first row &as Считать первую строку &как - Column Names Названия столбцов - Column Comments Комментарии столбцов - Endline character Конец строки - LF (Unix) LF (Unix) - CRLF (Windows) CRLF (Windows) - CR (Mac) CR (Mac) - QtiPlot - File openning error QtiPlot - ошибка при открытии файла - You don't have the permission to open this file: <b>%1</b> У вас нет прав доступа на открытие файла <b>%1</b> - Omit &thousands separator Опускать разделитель &тысячных разрядов @@ -11274,57 +8741,46 @@ IntDialog - &Close &Закрыть - &Integrate &Интегрировать - Lower limit Нижний предел - QtiPlot - Integration Options QtiPlot - Параметры интегрирования - Tolerance Допустимое отклонение - Upper limit Верхняя граница - Function Функция - Variable Переменная - Order (1 - 5, 1 = Trapezoidal Rule) Порядок (1 - 5, 1 = метод трапеций) - Number of iterations (Max=20) Число итераций (максимум=20) - &Plot area &Построить область @@ -11332,85 +8788,66 @@ Integration - Area Площадь - - Integration Интегрирование - Iterations Итераций - - Numerical integration of Численное интегрирование - Peak at Пик при - Points Точек - QtiPlot - Error QtiPlot - Ошибка - Tolerance Допустимое отклонение - Unknown integration method. Valid values must be in the range: 1 (Trapezoidal Method) to 5. Неизвестный метод интегрирования. Допустимые значения находятся в диапазоне от 1 (метод трапеций) до 5. - from от - - to до - using a %1 order method используется метод %1 порядка - QtiPlot - Input error QtiPlot - Ошибка ввода - From От - using the Trapezoidal Rule методом трапеций - Plot График @@ -11418,78 +8855,46 @@ Interpolation - - - - Akima Акимы - - - - Cubic Кубическая - - Error Ошибка - - - - - - Int Инт - - - - - - Interpolation Интерполяция - - - - Linear Линейная - - QtiPlot QtiPlot - QtiPlot - Error QtiPlot - Ошибка - Unknown interpolation method, valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. Неизвестный метод интерполяции, допустимые значения: 0 - линейная, 1 - кубическая, 2 - метод Акимы. - Unknown interpolation method. Valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. Неизвестный метод интерполяции. Допустимые значения: 0 - линейная, 1 - кубическая, 2 - метод Акимы. - You need at least %1 points in order to perform this operation! Минимальное необходимое количество точек для выполнения данной операции: %1! @@ -11497,82 +8902,66 @@ InterpolationDialog - &Close &Закрыть - Color Цвет - Cubic Кубический - From Xmin Xmin - Linear Линейный - &Make &Вычислить - Make curve from Интерполировать - Non-rounded Akima Акима без округления - Please enter x limits that satisfy: from < to! Значение Xmin должно быть меньше Xmax! - Points Точек - QtiPlot - Input error QtiPlot - Ошибка ввода - QtiPlot - Interpolation Options QtiPlot - Параметры интерполяции - QtiPlot - Warning QtiPlot - Предупреждение - Spline Сплайн - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! Кривая <b> %1 </b> больше не существует! Операция отменена! - To Xmax Xmax @@ -11580,7 +8969,6 @@ LayerButton - Activate layer Сделать слой активным @@ -11588,356 +8976,329 @@ LayerDialog - - - - - - - - pixels точек растра - Alignment Выравнивание - &Apply &Применить - Are you sure you want to continue this operation? Продолжить? - Automatic &layout Авто&компоновка - Bottom По низу - + Unit + Размеры в + + + inch + дюйм + + + mm + мм + + + cm + см + + + point + точка + + + pixel + + + + &Keep aspect ratio + + + + Margins + + + Bottom margin Нижнее поле - - &Cancel О&тмена - - Center По центру - Columns Столбцов - Columns gap Между столбцами - &Continue &Продолжить - Destination Layer Конечный слой - Grid Сетка - Height Высота - Horizontal Горизонтальное - &Layer Canvas Size Размер &холста - Layers Слои - Left По левому краю - Left margin Левое поле - Number Число - &OK &OK - Please enter different indexes for the source and destination layers! Пожалуйста, введите различные индексы для исходного и конечного слоя! - QtiPlot - Arrange Layers QtiPlot - Выравнивание слоёв - QtiPlot - Columns input error QtiPlot - Ошибка при вводе столбцов - QtiPlot - Delete Layers? QtiPlot - Удалить слои? - QtiPlot - Error QtiPlot - Ошибка - QtiPlot - Rows input error QtiPlot - Ошибка при вводе строк - Right По правому краю - Right margin Правое поле - Rows Строк - Rows gap Между строками - Source Layer Исходный слой - Spacing Промежутки - &Swap &Переставить - Swap Layers Поменять слои местами - The number of columns you've entered is greater than the number of graphs (%1)! Введённое число столбцов больше, чем число графиков (%1)! - The number of rows you've entered is greater than the number of graphs (%1)! Введённое число строк больше, чем число графиков (%1)! - Top По верху - Top margin Верхнее поле - Vertical Вертикальное - Width Ширина - You are about to delete %1 existing layers. Вы собираетесь удалить %1 существующих слоёв. + + Link &X axes + + + + &Fixed size + + + + Align + + + + Canvases + + + + Co&mmon axes + + LineDialog - Angle Угол - &Apply &Применить - Arrow &Head &Наконечник стрелки - Arrow at &end Стрелка в &конце - Arrow at &start Стрелка в &начале - Color Цвет - Page Странице - Layer Scales Координатам - Attach to Привязать к - End Point Конечная точка - &Filled &Заполненный - &Geometry &Геометрия - Length Длина - &Ok &Ok - Pixels точках растра - QtiPlot - Line options QtiPlot - Параметры линии - Scale Coordinates единицах по осям - Set &Default По &умолчанию - Start Point Начальная точка - Unit Размеры в - - X X - - Y Y - Type Тип - Width Ширина - &Line &Линия @@ -11945,43 +9306,42 @@ LineProfileTool - Please select an image marker first. Пожалуйста, укажите сначала маркер изображения. - Please select the end line point inside the image rectangle! Пожалуйста, укажите конечную точку линии в пределах изображения! - - QtiPlot - Pixel selection warning QtiPlot - Предупреждение при выборе точки - Table - Таблица + Таблица - intensity интенсивность - pixel точка - + x + x + + + y + y + + pixel intensity (a.u.) интенсивность точек (отн. ед.) - pixels точки @@ -11989,22 +9349,18 @@ LinearFit - Linear Линейная - Linear Regression Линейная регрессия - QtiPlot - Fit Error QtiPlot - Ошибка аппроксимации - You need at least %1 data points for this fit operation. Operation aborted! Необходимо как минимум %1 точек данных для аппроксимации. Операция прервана! @@ -12012,22 +9368,18 @@ LinearSlopeFit - Linear Regression Линейная регрессия - LinearSlope Наклон - QtiPlot - Fit Error QtiPlot - Ошибка аппроксимации - You need at least %1 data points for this fit operation. Operation aborted! Необходимо как минимум %1 точек данных для аппроксимации. Операция прервана! @@ -12035,32 +9387,26 @@ LogisticFit - Logistic Логистическая - Logistic Fit Аппроксимация логистической функцией - init value начальное значение - final value конечное значение - center центр - power степень @@ -12068,32 +9414,26 @@ LorentzFit - Lorentz Fit Аппроксимация Лоренцевой кривой - Lorentz Лоренц - area площадь - center центр - width ширина - offset смещение @@ -12101,189 +9441,135 @@ Matrix - Set Dimensions Задать размеры - - - - - QtiPlot - Error QtiPlot - Ошибка - Calculation failed, the matrix is not square! Вычисление провести не удалось, матрица не квадратная! - - - - - - QtiPlot QtiPlot - - - - - Memory Allocation Error Ошибка выделения памяти - - - - - Not enough memory, operation aborted! Недостаточно памяти, операция отменена! - Inversion failed, the matrix is not square! Вычисление провести не удалось, матрица не квадратная! - Invert Обратная матрица - Transpose Транспонировать - Flip Vertically Отразить вертикально - Flip Horizontally Отразить горизонтально - Rotate 90° Повернуть на 90° - Rotate -90° Повернуть на -90° - - Calculate Values Расчитать значения - Clear Selection Очистить выделенное - Paste Вставить - Delete Rows Удалить строки - Delete Columns Удалить столбцы - Insert Row Вставить строку - Insert Column Вставить столбец - - Please provide a valid file name! Укажите допустимое имя файла! - File format not handled, operation aborted! Формат файла не поддерживается, операция отменена! - - Set Data Mode Режим данных - Ctrl+A Matrix: select all - - Import Image Импорт изображения - Inverse FFT Обратное БПФ - Forward FFT Прямое БПФ - QtiPlot - ASCII Export Error QtiPlot - ошибка при экспортировании в ASCII - Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! - Невозможно выполнить записать в файл: <br><h4>%1</h4><p>Удостоверьтесь, что у вас есть права доступа на запись в данное место! + Невозможно выполнить запись в файл: <br><h4>%1</h4><p>Удостоверьтесь, что у вас есть права доступа на запись в данное место! - Import ASCII File Импорт файла ASCII - Due to memory limitations it will not be possible to undo this change. Do you want to continue anyways? Это изменение невозможно будет отменить ввиду ограничений на память. Продолжить? - Warning Предупреждение - kB кб @@ -12291,82 +9577,66 @@ MatrixDialog - &Apply &Применить - &Cancel О&тмена - Cell Width Ширина ячейки - Data Format Формат данных - Decimal: 1000 Десятичный: 1000 - Default Decimal Digits Число десятичных разрядов по умолчанию - Numeric Display Отображение чисел - &OK &OK - QtiPlot - Matrix Properties QtiPlot - Свойства матрицы - Scientific: 1E3 Научный: 1E3 - Significant Digits= Значащих разрядов = - Set Columns Width Ширина столбца - Decimal Десятичный - Scientific Научный - Set Data Format %1 Формат данных %1 - Precision %1 digits Точность %1 @@ -12374,52 +9644,38 @@ MatrixModel - Edited cell Редактирование ячейки - - - - QtiPlot QtiPlot - - Memory Allocation Error Ошибка выделения памяти - - Not enough memory, operation aborted! Недостаточно памяти, операция отменена! - Input Size Error Ошибка ввода размера - The dimensions you have specified are not acceptable! Указанные размеры недопустимы! - Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! Введите положительные числа, произведение которых не превышает INT_MAX в вашей системе! - Multiline expressions take much more time to evaluate! Do you want to continue anyways? Многострочные выражения требуют намного больше времени для вычисления! Продолжить? - Warning Предупреждение @@ -12427,67 +9683,54 @@ MatrixSizeDialog - &Cancel О&тмена - Columns Столбцов - Coordinates Координаты - Dimensions Размерность - First Первая - Last Последняя - &OK &OK - QtiPlot - Matrix Dimensions QtiPlot - Размерность матрицы - Rows Строк - X (Columns) X (Столбцы) - Y (Rows) Y (Строки) - Set Coordinates x[%1 : %2], y[%3 : %4] Задать координаты x[%1 : %2], y[%3 : %4] - &Apply &Применить @@ -12495,58 +9738,46 @@ MatrixValuesDialog - Add Ce&ll Добавить &ячейку - Add &Function Добавить &функцию - &Apply &Применить - Cell(i,j)= Ячейка(i,j)= - &Close &Закрыть - For col (j) Кол. (j) от - For row (i) Строки (i) от - QtiPlot - Set Matrix Values QtiPlot - Задание элементов матрицы - - to до - Set New Formula Новая формула - Use built-in muParser (much faster) Использовать встроенный muParser (значительно быстрее) @@ -12554,52 +9785,42 @@ MdiSubWindow - QtiPlot QtiPlot - Do you want to hide or delete Вы хотите удалить или скрыть - Delete Удалить - Hide Скрыть - Cancel Отмена - Normal Нормальный - Minimized Свёрнутый - Maximized Развёрнутый - Hidden Скрытый - B Ж @@ -12607,121 +9828,94 @@ MultiLayer - &Cancel О&тмена - Do you want QtiPlot to rearrange the remaining layers? Вы хотите, чтобы QtiPlot перегруппировал оставшиеся слои? - File format not handled, operation aborted! Формат файла не поддерживается, операция отменена! - &No &Нет - - Please provide a valid file name! Укажите допустимое имя файла! - - - QtiPlot - Error QtiPlot - Ошибка - QtiPlot - Guess best layout? QtiPlot - Предложить оптимальное расположение? - Add layer Добавить слой - Remove active layer Удалить текущий слой - &Yes &Да - kB кб - Offset Amount... Смещение... - Reverse Order В обратном порядке - Fill Area... Заполнить область... - Offset Dialog Смещение - Total Y Offset (%) Смещение по Y (%) - Total X Offset (%) Смещение по X (%) - &Apply &Применить - - &Close &Закрыть - Fill Curves Заполнить область под кривой - Enable Fill Заполнить область под кривой - Fill with Color Цвет - Side Lines Боковые линии @@ -12729,106 +9923,78 @@ MultiPeakFit - Area Площадь - Center Центр - Could not allocate enough memory for the fit curves! Невозможно выделить память для аппроксимации кривых! - - - Fit Аппроксимация - Gauss Fit Аппроксимация Гауссовой функцией - Height Высота - Lorentz Fit Аппроксимация Лоренцевой кривой - - - Peak Пик - QtiPlot - Fit Error QtiPlot - Ошибка аппроксимации - Width Ширина - fit of аппроксимация - multi-peak многовершинный - - peak пик - - center центр - - width ширина - - offset смещение - Gauss Гаусс - Lorentz Лоренц - - area площадь @@ -12836,12 +10002,10 @@ MultiPeakFitTool - Move cursor and click to select a point and double-click/press 'Enter' to set the position of a peak! Для выделения точки подведите к ней указатель и щёлкните, двойной щелчок или 'Enter' для установки положения вершины! - Peak %1 selected! Click to select a point and double-click/press 'Enter' to set the position of the next peak! Пик %1 выбран! Один щелчок для выбора точки и двойной щелчок или 'Enter', для указания положения следующего пика! @@ -12849,68 +10013,57 @@ NonLinearFit - Non-linear Fit Нелинейная аппроксимация - NonLinear Нелинейная - Please enter a valid non-empty expression! Operation aborted! Введите, пожалуйста, допустимое негустое выражение! Операция прервана! - - QtiPlot - Fit Error QtiPlot - Ошибка аппроксимации - - QtiPlot - Input function error QtiPlot - Ошибка ввода функции - There are no parameters specified for this fit operation. Please define a list of parameters first! Не указаны параметры для аппроксимации. Укажите сначала, пожалуйста, список параметров! - You must provide a list containing at least one parameter for this type of fit. Operation aborted! Для выполнения этого типа аппроксимации список параметров должен содержать хотя бы один элемент. Операция прервана! - - constant константа + + Ignore + + Note - Add tab Добавить вкладку - Please, enter new title: Пожалуйста, введите новое заглавие: - Title Заголовок - untitled безымянный @@ -12918,62 +10071,58 @@ OpenProjectDialog - All files Все файлы - Backup files Резервные копии - Compressed QtiPlot project Сжатый проект QtiPlot - + Excel + Таблица Excel + + + ODF Spreadsheet + Таблица ODF + + New Folder Новая папка - New Project Window Новое окно проекта - Open As Открыть как - Origin graph график Origin - Origin matrix матрица Origin - Origin project Проект Origin - Origin worksheet таблица Origin - QtiPlot - Open Project QtiPlot - Открыть проект - QtiPlot project Проект QtiPlot @@ -12981,77 +10130,62 @@ PatternBox - BDiagonal Обратный штрих - Cross Перекрестие - Dense1 Плотность1 - Dense2 Плотность2 - Dense3 Плотность3 - Dense4 Плотность4 - Dense5 Плотность5 - Dense6 Плотность6 - Dense7 Плотность7 - DiagCross Дранка - FDiagonal Прямой штрих - Horizontal Горизонтальная - Solid Сплошной - Vertical Вертикальная - None Нет @@ -13059,1749 +10193,1356 @@ Plot3DDialog - &Apply &Применить - &Axis &Ось - Axis Font Шрифт оси - &Background &Фон - Bars Блоки - Boxed Заключённый в ящик - &Cancel О&тмена - &Choose Font &Выбор шрифта - &Choose font &Выбор шрифта - &Colors &Цвета - Cone Конус - Coordinate System Система координат - Cross Hair Перекрестие - Distance labels - axis Расстояние метка - ось - - - Dot Точка - &Font &Шрифт - From От - General Общие - &General &Общие - Lab&els &Метки - &Line &Линия - - Line Width Толщина линии - Major Ticks Главные деления - Major Ticks Length Длина штрихов главных делений - &Matrix &Матрица - Minor Ticks Дополнительные деления - Minor Ticks Length Длина штрихов дополнительной делений - &Numbers &Числа - Numbers Font Шрифт чисел - &OK &OK - Opacity Непрозрачность - Orthogonal Ортогональный - Points Точки - QtiPlot - Surface Plot Options QtiPlot - Параметры отрисовки трёхмерной поверхности - Quality Качество - Radius Радиус - Resolution Разрешение - &Scale &Масштаб - Show Legend Отобразить легенду - Smooth angles Сгладить углы - Smooth line Гладкая линия - - Style Стиль - Title Заголовок - &Title &Заголовок - To До - Type Тип - - - - Width Ширина - &Worksheet Рабочая &таблица - - X X - X Zoom (%) Масштабирование по X (%) - - Y Y - Y Zoom (%) Масштабирование по Y (%) - - Z Z - Z Zoom (%) Масштабирование по Z (%) - Zoom (%) Масштабирование (%) - linear линейный - logarithmic логарифмический - Co&lor &Цвет - A&xes &Оси - Linea&r color map &Линейная шкала цвета - + Scale to paper si&ze + + + + Print Crop&marks + + + + &Print + &Печать + + Color map &file &Файл цветовой шкалы - - - None Нет - Ma&jor Grids &Основная сетка - Mi&nor Grids &Дополнительная сетка - Color Цвет - - Solid Сплошной - - Dash Черта - - Dash Dot - - Dash Dot Dot - - Short Dash - - Short Dot - - Short Dash Dot - G&rid &Сетка - Draw lines Рисовать линии - Filled bars Заполненные блоки + + Tick Labels + + + + Format + Формат + + + Automatic + + + + Decimal: 10000.0 + Десятичный: 10000.0 + + + Scientific: 1e4 + Научный: 1e4 + + + Engineering: 10k + Инжнерный: 10k + + + Precision + Точность + PlotDialog - 1% 1% - 10 10 - 12 12 - 16 16 - 20 20 - 75-25 75-25 - 8 8 - 90-10 90-10 - 95-5 95-5 - 99% 99% - 99-1 99-1 - - Angle Угол - Antialiasing Сглаживание - &Apply &Применить - Arrowheads Наконечники стрелок - Attach curve to: Прикрепить кривую к: - Automatic Binning Автоматический выбор корзин - - Axes Оси - Axes Labels Подписи к осям - Axes Numbers Числа на осях - Axis Ось - Background Color Цвет фона - Begin Начала - Bin Size Размер корзины - - - Bins Корзины (bins) - Border Граница - Border Color Цвет границы - - Bottom Внизу - - Box Короб - Box Width Ширина ящика - - Box/Whiskers Ящик/усы - &Cancel О&тмена - Canvas Color Цвет холста - Cap Width Ширина шляпы - Coef Коэф - Coefficient Коэффициент - - - - - - Color Цвет - Color Bar Scale Шкала цветов - - Colors Цвета - Connect Сочленение - - Constant Константа - Contour Контур - - Contour Lines Линии контура - &Custom Color Map &Пользовательская карта цветов - &Default Color Map &Карта цветов по умолчанию - &Delete &Удалить - Diamond Ромб - Direction Направление - Dots Точки - - Edge Color Цвет грани - - Edge Width Толщина кромки - - &Edit... - &Правка... + &Правка... - End Конец - - End Point Конечная точка - - - Error Bars Усы погрешности - Fill Заполнение - - Fill Color Цвет заполнения - Fill area under curve Заполнить область под кривой - Fill color Цвет заполнения - &Filled &Заполненная - First color Первый цвет - - Fonts Шрифты - Gap Between Bars (in %) Интервал между блоками (в %) - - - Geometry Геометрия - &Gray Scale Уровни &серого - Head Начало - Histogram Гистограмма - - Histogram Data Данные гистограммы - - Histogram and Probabilities for Гистограмма и вероятности для - Horizontal Bars Горизонтальные блоки - Horizontal Steps Горизонтальные шаги - - Image Изображения - Keep aspect ratio Сохранять пропорции - - - - - - - - - Layer Слой - - - Left Слева - Legends Легенды - Length Длина - Levels Уровни - - - - Line Линия - Line + Symbol Линия + символ - - Line Width Толщина линии - Lines Линии - Magnitude Величина - Margin Поля - Max Макс - - Max-Min Max-Min - Maximum Максимум - - Mean Среднее - Middle Середина - Min Мин - Minimum Минимум - Minus Минус - No Box Без фигуры - No Whiskers Без усов - No line Без линий - Notch Катушка - &OK &OK - Offset (in %) Смещение (в %) - - Opacity Непрозрачность - Origin Исходная точка - - - - - - Pattern Шаблон - Perc 1, 99 Проц 1, 99 - Perc 10, 25, 75, 90 Проц 10, 25, 75, 90 - Perc 10, 90 Проц 10, 90 - Perc 25, 75 Проц 25, 75 - Perc 5, 95 Проц 5, 95 - Percent Процент - - Percentile Процентиль - - Percentile (%) Процентиль (%) - Pie Круговая диаграмма - Please enter a positive bin size value! Пожалуйста введите положительное значение размера столбика! - Please enter a valid bin size value! Пожалуйста введите корректное значение размера столбика! - Please enter a valid end limit! Пожалуйста введите корректную конечную границу! - Please enter a valid start limit! Пожалуйста введите корректную начальную границу! - Please enter limits that satisfy: begin < end! Пожалуйста введите пределы, удовлетворяющие соотношению: от < до! - - - &Plot Associations... &Соответствие координат... - Plot type Тип графика - Plus Плюс - Position Положение - - Print Печать - Print Crop&marks Печатать &метки обреза - - QtiPlot - Bin size input error QtiPlot - Ошибка ввода размера корзины - QtiPlot - End limit error QtiPlot - Ошибка выбора конечной границы - - - - QtiPlot - Input error QtiPlot - Ошибка ввода - QtiPlot - Plot details QtiPlot - Детали построения - QtiPlot - Start limit error QtiPlot - Ошибка выбора начальной границы - Quantity Количество - - Range Диапазон - Rectangle Прямоугольник - - - Right Справа - &Scale layers to paper size &Масштабировать слои по размеру бумаги - Scatter Точки - &Show statistics &Вывести статистику - - - Size Размер - - Spacing Интервал - Spline Сплайн - - - Standard Deviation Среднеквадратичное отклонение - - Standard Error Стандартная Ошибка - Sticks Вертикальные отрезки - - - - - Style Стиль - Sum Сумма - - - - Symbol Символ - Tail Конец - Through Symbol Через символ - Titles Заголовки - - Top Вверху - - Transparent Прозрачность - - Type Тип - Use &Color Map Использовать шкалу &цветов - Use Default &Pen Перо по &умолчанию - - Vector Вектор - + &Function + &Функция + + Vector Data Данные вектора - Vector XYAM Вектор XYAM - Vector XYXY Вектор XYXY - Vertical Bars Вертикальные блоки - Vertical Steps Вертикальные шаги - Whiskers Усы - - - - - Width Ширина - &Worksheet Рабочая &таблица - - X End Конец X - &X Error Bar Погрешность по &X - X= X= - - Y End Конец Y - Y= Y= - height= высота= - width= ширина= - x Axis Ось x - y Axis Ось y - &Show &Показать - Column Столбец - White O&ut Непрозрачный &фон - Justify По ширине - Center По центру - &Font &Шрифт - Rotate (deg) Повернуть (град) - X Offset (font height %) Смещение по X (высота шрифта %) - Y Offset (font height %) Смещение по Y (высота шрифта %) - - - - - Labels Метки - &Speed Mode, Skip Points if needed &Быстрый режим. Пропускать точки, если требуется - data points точек - Apply to curves with more than: Применять к кривым с более чем: - Tolerance (Douglas Peuker algorithm) - Допуск (алгоритм Douglas-Peuker) + Допуск (алгоритм Douglas-Peuker) - - - Speed Быстродействие - 3D View 3D Вид - View Angle (deg) Угол обзора - Thickness (% of radius) Толщина (% от радиуса) - Rotation Вращение - Starting Azimuth (deg) Угол поворота - Radius/Center Радиус/Центр - Radius (% of frame) Радиус (% от рамки) - Horizontal Offset (% of frame) Горизонтальное смещение (% от рамки) - - Pie Geometry Круговая диаграмма - Automatic &Format Авто&формат - &Values &Значения - &Percentages &Проценты - Categories/&Rows Категории/&Строки - Associate Position with &Wedge &Расположение - Dist. from Pie Edge Расстояние от края диаграммы - Counter cloc&kwise Против &часовой стрелки - inch дюйм - mm мм - cm см - point точка - pixel точка растра - Unit Размеры в - Set As &Default Установить по &умолчанию - Apply &to... Применить &к... - - - - Window Окно - - - - All Windows Всем окнам - Pen Перо - Matrix Матрица - - - Apply Format &to Применить формат &к - - - Selected Curve Выбранные кривые - - Skip Points Пропустить точки - - None Нет - Use matrix formula to calculate values Использовать матричную формулу для вычисления значений - - Values Значения - &Show Contour Lines &Показать линии контура - Set Equidistant Levels Установить эквидистантные уровни - Start Начало - Step Шаг - Set &Levels Установить &уровни - Use &Table Custom Pen &Набор перьев по выбору + + Link &X axes + + + + Miscellaneous + + + + 0 (all data points) + + + + Tolerance (Douglas-Peucker algorithm) + + + + Scale &Fonts + Масштабировать &шрифты + + + Do not &resize layers when window size changes + Не &изменять размеры слоёв при изменении размера окна + + + Dimensions + Размерность + PlotWizard - &Close &Закрыть - &Delete curve &Удалить кривую - &New curve &Новая кривая - Please define a Y column for the following curve Пожалуйста укажите столбец Y для следующей кривой - &Plot &Построить график - - - - - - - - - - - - - - - - QtiPlot - Error QtiPlot - Ошибка - QtiPlot - Select Columns to Plot QtiPlot - Выберите столбцы для построения графика - - - This kind of curve is not handled by QtiPlot! QtiPlot не поддерживает управление кривой данного типа! - Worksheet Рабочая таблица - &X &X - &Y &Y - You have already defined a X column! Вы уже определили столбец X! - You have already defined a Y column! Вы уже определили столбец Y! - You have already defined a Z column! Вы уже определили столбец Z! - - You have already defined an error-bars column! Вы уже определили столбец погрешностей! - You must add a new curve first! Сначала вы должны добавить кривую! - - - - You must define a X column first! Сначала вы должны определить X столбец! - - You must define a Y column first! Сначала вы должны определить Y столбец! - &Z &Z - x&Err x&Err - yE&rr yE&rr @@ -14809,37 +11550,26 @@ PluginFit - Plugin Fit Аппроксимация ч/з модуль - Plugin file: <p><b> %1 </b> <p>not found. Operation aborted! Файл модуля: <p><b> %1 </b> <p>не найден. Операция прервана! - QtiPlot - File not found QtiPlot - файл не найден - - - - QtiPlot - Plugin Error QtiPlot - ошибка модуля - - - The plugin does not implement a %1 method necessary for Levenberg-Marquardt fitting. В модуле отсутствует реализация метода %1, необходимого для аппроксимации Левенберга-Марквардта. - The plugin does not implement a %1 method necessary for simplex fitting. В модуле отсутствует реализация метода %1, необходимого для симплексной аппроксимации. @@ -14847,67 +11577,54 @@ PolynomFitDialog - &Close &Закрыть - Color Цвет - &Fit &Аппроксимировать - Fit curve # pts Число точек в аппроксимирующей кривой - Fit curve Xmax Xmax для аппроксимирующей кривой - Fit curve Xmin Xmin для аппроксимирующей кривой - Not enough points Недостаточно точек - Order (1 - 9, 1 = linear) Порядок (1 - 9, 1 = линейный) - Polynomial Fit of Аппроксимация полиномом для - QtiPlot - Polynomial Fit Options QtiPlot - Параметры аппроксимации полиномом - QtiPlot - Warning QtiPlot - Предупреждение - Show Formula on Graph? Отобразить формулу на графике? - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! Кривая <b> %1 </b> больше не существует! Операция отменена! @@ -14915,522 +11632,537 @@ PolynomialFit - Polynomial Fit Аппроксимация полиномами - QtiPlot - Fit Error QtiPlot - Ошибка аппроксимации - You need at least %1 data points for this fit operation. Operation aborted! Необходимо как минимум %1 точек данных для аппроксимации. Операция прервана! - Polynomial Полиномиальная + PreviewTable + + Numeric + + + + Text + Текст + + + Date + Дата + + + Time + Время + + + Month + Месяц + + + Day + + + + Choose column type + + + + Column type: + + + + PythonScripting - Failed to export QtiPlot API Не удалось экспортировать QtiPlot API - Accessing QtiPlot functions or objects from Python code won't work. Probably your version of Qt/SIP/PyQt differs from the one QtiPlot was compiled against. Доступ к функциям и объектам QtiPlot из Python не работает. Возможно версия SIP отличается от той, с которой был скомпилирован QtiPlot. + + Couldn't find initialization files + Не удалось найти инициализационных файлов + + + Please indicate the correct path to the Python configuration files in the preferences dialog. + Пожалуйста, укажите путь к конфигурационным файлам Python в настройках. + QObject - The file is not an QtiPlot fit model file. Этот файл не является файлом апроксимационной модели QtiPlot. - The file is not an QtiPlot fit model version 1.0 file. Этот файл не является файлом версии 1.0 апроксимационной модели QtiPlot. - The file is not a QtiPlot custom action file. Этот файл не является файлом действия QtiPlot. - The file is not an QtiPlot custom action version 1.0 file. Этот файл не является файлом версии 1.0 действия QtiPlot. - The file is not a QtiPlot custom menu file. Этот файл не является файлом меню QtiPlot. - The file is not a QtiPlot custom menu version 1.0 file. Этот файл не является файлом версии 1.0 меню QtiPlot. - QtiPlot - Script Error QtiPlot - Ошибка сценария - Python-like syntax is not supported in this case since it severely reduces drawing speed! Синтаксис в стиле Python не поддерживается в этом случае, т.к. он значительно уменьшает скорость отрисовки! - QtiPlot - Math Error - QtiPlot - Математическая ошибка + QtiPlot - Математическая ошибка - QtiPlot QtiPlot - Ignored data point at x = %1. - Игнорируемые данные при x = %1. + Игнорируемые данные при x = %1. - Found non-removable singularity at x = %1. Найдена неустранимая особенная точка при x = %1. - abs(x): Absolute value of x. - + abs(x): + Модуль x. - acos(x): Inverse cos function. - + acos(x): + Арккосинус. - acosh(x): Hyperbolic inverse cos function. - + acosh(x): + Гиперболический арккосинус. - asin(x): Inverse sin function. - + asin(x): + Арксинус. - asinh(x): Hyperbolic inverse sin function. - + asinh(x): + Гиперболический арксинус. - atan(x): Inverse tan function. - + atan(x): + Арктангенс. - atanh(x): Hyperbolic inverse tan function. - + atanh(x): + Гиперболический арктангенс. - avg(x,y,...): Mean value of all arguments. - + avg(x,y,...): + Среднее значение всех аргументов. - bessel_j0(x): Regular cylindrical Bessel function of zeroth order, J_0(x). - + bessel_j0(x): + Функция Бесселя первого рода нулевого порядка, J_0(x). - bessel_j1(x): Regular cylindrical Bessel function of first order, J_1(x). - + bessel_j1(x): + Функция Бесселя первого рода первого порядка, J_1(x). - bessel_jn(double x, int n): Regular cylindrical Bessel function of order n, J_n(x). - + bessel_jn(double x, int n): + Функция Бесселя первого рода порядка n, J_n(x). - bessel_jn_zero(double n, unsigned int s): s-th positive zero x_s of regular cylindrical Bessel function of order n, J_n(x_s)=0 - + bessel_jn_zero(double n, unsigned int s): + s-ый нуль функции Бесселя первого рода порядка n, J_n(x_s)=0 - bessel_y0(x): Irregular cylindrical Bessel function of zeroth order, Y_0(x), for x>0. - + bessel_y0(x): + Функция Бесселя второго рода нулевого порядка, Y_0(x), for x>0. - bessel_y1(x): Irregular cylindrical Bessel function of first order, Y_1(x), for x>0. - + bessel_y1(x): + Функция Бесселя второго рода первого порядка, Y_1(x), for x>0. - bessel_yn(double x, int n): Irregular cylindrical Bessel function of order n, Y_n(x), for x>0. - + bessel_yn(double x, int n): + Функция Бесселя второго рода порядка n, Y_n(x), for x>0. - beta(a,b): Computes the Beta Function, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) for a > 0, b > 0. - + beta(a,b): + Бета-функция, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) для a > 0, b > 0. - ceil(x): Round to the next larger integer, smallest integer larger or equal to x. - + ceil(x): + Округление до ближайшего целого, большего или равного x. - cos(x): Calculate cosine. - + cos(x): + Косинус. - cosh(x): Hyperbolic cos function. - + cosh(x): + Гиперболический косинус. - erf(x): The error function. - + erf(x): + Функция ошибок. - erfc(x): Complementary error function erfc(x) = 1 - erf(x). - + erfc(x): + Дополнительная функция ошибок: erfc(x) = 1 - erf(x). - erfz(x): The Gaussian probability density function Z(x). - + erfz(x): + Плотность вероятности распределения Гаусса Z(x). - erfq(x): The upper tail of the Gaussian probability function Q(x). - exp(x): Exponential function: e raised to the power of x. - + exp(x): + Экспоненциальная функция: e в степени x. - floor(x): Round to the next smaller integer, largest integer smaller or equal to x. - + floor(x): + Округление до ближайшего целого, меньшего или равного x. - gamma(x): Computes the Gamma function, subject to x not being a negative integer. - + gamma(x): + Гамма-функция, x>0. - gammaln(x): Computes the logarithm of the Gamma function, subject to x not a being negative integer. For x<0, log(|Gamma(x)|) is returned. - + gammaln(x): + Логарифм Гамма-функции, при условии, что x неотрицательный. Если x<0, возвращается log(|Gamma(x)|). - gauss_cdf(x, sigma): Computes the cumulative distribution function for a Gaussian distribution with standard deviation sigma. - gauss_pdf(x, sigma): Computes the probability density at x for a Gaussian distribution with standard deviation sigma. - hazard(x): Computes the hazard function for the normal distribution h(x) = erfz(x)/erfq(x). - if(e1, e2, e3): if e1 then e2 else e3. - + if(e1, e2, e3): + Если верно e1, тогда e2, иначе e3. - inv_gauss_cdf(x, sigma): Computes the inverse of the cumulative distribution function for a Gaussian distribution with standard deviation sigma. - ln(x): Calculate natural logarithm log_e. - + ln(x): + Натуральный логарифм. - log(x): Calculate decimal logarithm log_10. - + log(x): + Десятичный логарифм. - log10(x): Calculate decimal logarithm log_10. - + log10(x): + Десятичный логарифм. - log2(x): Calculate binary logarithm log_2. - + log2(x): + Логарифм по основанию 2. - min(x,y,...): Calculate minimum of all arguments. - + min(x,y,...): + Минимальное значание из всех аргументов. - max(x,y,...): Calculate maximum of all arguments. - + max(x,y,...): + Максимальное значание из всех аргументов. - mod(x,y): Calculate rest of integer division x/y, x modulo y. - + mod(x,y): + Остаток целочисленного деления x/y. - pow(x,y): Raise x to the power of y, x^y. - + pow(x,y): + x в степени y, x^y. - rint(x): Round to nearest integer. - + rint(x): + Округление до ближайшего целого. - sign(x): Sign function: -1 if x<0; 1 if x>0. - + sign(x): + Знак числа: -1 if x<0; 1 if x>0. - sin(x): Calculate sine. - + sin(x): + Синус. - sinh(x): Hyperbolic sin function. - + sinh(x): + Гиперболический синус. - sqrt(x): Square root function. - + sqrt(x): + Квадратный корень. - sum(x,y,...): Calculate sum of all arguments. - + sum(x,y,...): + Сумма всех аргументов. - tan(x): Calculate tangent function. - + tan(x): + Тангенс. - tanh(x): Hyperbolic tan function. - + tanh(x): + Гиперболический тангенс. - ttable(x, n): Student's t-distribution with n degrees of freedom. - + ttable(x, n): + Распределение Стьюдента с n степенями свободы. - w0(x): Compute the principal branch of Lambert's W function, W_0(x). W is defined as a solution to the equation W(x)*exp(W(x))=x. For x<0, there are two real-valued branches; this function computes the one where W>-1 for x<0 (also see wm1(x)). - + w0(x): + Главная ветвь W-функции Ламберта, W_0(x). + W(x) определяется как решение уравнения W(x)*exp(W(x))=x. + При x<0 существует две ветви, принимающие действительные значения; W_0(x) соответствует той ветви, для которой W>-1 при x<0 (см. также wm1(x)). - wm1(x): Compute the secondary branch of Lambert's W function, W_{-1}(x). W is defined as a solution to the equation W(x)*exp(W(x))=x. For x<0, there are two real-valued branches; this function computes the one where W<-1 for x<0. (also see w0(x)). + wm1(x): + Вторая ветвь W-функции Ламберта, W_{-1}(x). + W(x) определяется как решение уравнения W(x)*exp(W(x))=x. + При x<0 существует две ветви, принимающие действительные значения; W_{-1}(x) соответствует той ветви, для которой W<-1 при x<0 (см. также w0(x)). + + + AVG("colName", i, j): + The average of all cells from row i to j in column colName. + + + + SUM("colName", i, j): + The sum of all cells from row i to j in column colName. + + + + QtiPlot - Memory Allocation Error + QtiPlot - Ошибка выделения памяти + + + Not enough memory, operation aborted! + Недостаточно памяти, операция отменена! + + + The function %1 is not defined in the specified interval! + + + + rnd(seed): + Returns a pseudo-random number in the range 0 to 1. Calling this function several times with the same seed will return the same value. QtColorPicker - - - Black Чёрный - - White Белый - - Red Красный - - Dark red Тёмно-красный - - Green Зелёный - - Dark green Тёмно-зелёный - - Blue Синий - - Dark blue Тёмно-синий - - Cyan Голубой - - Dark cyan Тёмно-голубой - - Magenta Пурпурный - - Dark magenta Тёмно-пурпурный - - Yellow Жёлтый - - Dark yellow Тёмно-жёлтый - - Gray Серый - - Dark gray Тёмно-серый - - Light gray Светло-серый - Custom По выбору @@ -15438,55 +12170,34 @@ RangeSelectorTool - All the curves on this plot are empty! Все кривые на этом графике пустые! - Click or use Ctrl+arrow key to select range (arrows select active cursor)! Щелкните или используйте сочетание клавиш Ctrl+стрелки для выбора диапазона (стрелки выбирают активный курсор)! - - - Left По левому краю - - - - - - QtiPlot - Warning QtiPlot - Предупреждение - - - Right По правому краю - - - - - The column '%1' is read-only! Operation aborted! Столбец '%1' - только для чтения! Операция прервана! - Remove data from curves? Удалить данные с кривых? - Copy data to clipboard? Копировать данные в буфер обмена? @@ -15494,47 +12205,38 @@ RenameWindowDialog - &Both Name and Label &Название и метка - &Cancel О&тмена - For internal consistency reasons the underscore character is replaced with a minus sign. Для обеспечения внутренней согласованности символ подчёркивания был заменён на знак минус. - &Label &Метка - &Name (single word) &Название (одно слово) - &OK &OK - QtiPlot - Rename Window QtiPlot - Окно переименования - QtiPlot - Warning QtiPlot - Предупреждение - Window Title Заголовок окна @@ -15542,7 +12244,6 @@ ScreenPickerTool - Click on plot or move cursor to display coordinates! Щёлкните на графике и переместите курсор для отображения координат! @@ -15550,149 +12251,118 @@ ScriptEdit - - All Files Все файлы - Auto&exec Авто&выполнение - Could not open file "%1" for reading. Невозможно открыть файл "%1" для чтения. - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Невозможно выполнить запись в файл: <br><h4> %1 </h4><p>Удостоверьтесь, что у вас есть права доступа на запись в данное место! - Ctrl+J Ctrl+J - Ctrl+Return Ctrl+Return - Ctrl+Shift+J Ctrl+Shift+J - &Evaluate Expression &Вычислить выражение - E&xecute &Выполнить - Execute &All Выполнить в&сё - &Functions &Функции - &Print &Печать - QtiPlot - Error Opening File QtiPlot - Ошибка открытия файла - QtiPlot - File Save Error QtiPlot - ошибка сохранения файла - QtiPlot - Import Text From File QtiPlot - Импортировать текст из файла - Save Text to File Сохранить текст в файл - - Text Текст - &Save &Сохранить - &Import... &Импортировать... - Sa&ve as... Сохранить к&ак... - &Find... &Найти... - &Replace... &Заменить... - &Find next &Найти следующее совпадение - &Find previous &Найти предыдущее совпадение - Rena&me Tab... &Переименовать вкладку... - A&dd Tab &Добавить вкладку - C&lose Tab &Закрыть вкладку - QtiPlot QtiPlot - QtiPlot has finished searching the document. QtiPlot закончил поиск по документу. @@ -15700,308 +12370,210 @@ ScriptWindow - Always on &Top Держать выше &других - - CTRL+J CTRL+J - - CTRL+Return CTRL+Return - - CTRL+SHIFT+J CTRL+SHIFT+J - - &Copy &Копировать - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Невозможно выполнить запись в файл: <br><h4> %1 </h4><p>Удостоверьтесь, что у вас есть права доступа на запись в данное место! - - Ctrl+C Ctrl+C - - Ctrl+N Ctrl+N - - Ctrl+O Ctrl+O - - Ctrl+P Ctrl+P - - Ctrl+S Ctrl+S - - Ctrl+V Ctrl+V - - Ctrl+Y Ctrl+Y - - Ctrl+Z Ctrl+Z - - Ctrl+x Ctrl+x - - &Cut &Вырезать - - &Edit &Правка - - &Evaluate Expression &Раскрыть выражение - - - - E&xecute &Выполнить - - Execute &All Выполнить в&сё - - &File &Файл - - &New &Новый - - &Open... &Открыть... - - &Paste &Вставить - - &Print &Печать - - QtiPlot QtiPlot - QtiPlot - File Save Error QtiPlot - ошибка сохранения файла - - QtiPlot - Script Window QtiPlot - Окно сценария - - &Redo &Вернуть - - &Save &Сохранить - - Save &As... Сохранить к&ак... - - &Undo &Отменить - &Window &Окно - You need to close and reopen the script window before your changes become effective! Do you want to close it now? Требуется закрыть окно сценария и открыть его заново, чтобы изменения вступили в силу! Желаете закрыть сейчас? - Show &Line Numbers Показать &номера строк - - Script Output Panel Панель вывода - - Increase Indent Увеличить отступ - - Decrease Indent Уменьшить отступ - - &Find... &Найти... - - Ctrl+Alt+F Ctrl+Alt+F - - Find &Next &Найти следующее совпадение - - F3 F3 - - Find &Previous &Найти предыдущее совпадение - - F4 F4 - - &Replace... &Заменить... - - Show Script &Output Panel П&оказать панель вывода - - Ouput on Next &Line Вывод на с&ледующей строке - Show Script Output Panel Показать панель вывода - - Print Pre&view... Предварительный &просмотр... - Script print preview Предварительный просмотр - - &Close &Закрыть - - Show &Workspace Показать &рабочее пространство @@ -16009,7 +12581,6 @@ ScriptingEnv - %1 Source (*.%2);; Исходный код %1 (*.%2);; @@ -16017,27 +12588,22 @@ ScriptingLangDialog - Cancel Отмена - OK OK - QtiPlot - Scripting Error QtiPlot - Ошибка сценария - QtiPlot - Select scripting language QtiPlot - Выберите язык сценариев - Scripting language "%1" failed to initialize. Ошибка инициализации языка сценариев "%1". @@ -16045,52 +12611,42 @@ SetColValuesDialog - Add cell Добавить ячейку - Add column Добавить столбец - Add function Добавить функцию - &Apply &Применить - &Close &Закрыть - For row (i) Строки (i) от - QtiPlot - Set column values QtiPlot - Установка значений столбца - to до - Use built-in muParser (much faster) Использовать встроенный muParser (значительно быстрее) - Clear &Formulas &Очистить @@ -16098,32 +12654,26 @@ SigmoidalFit - Boltzmann (Sigmoidal) Fit Подбор сигмоидальной кривой (Больцмана) - Boltzmann Больцман - init value начальное значение - final value конечное значение - center центр - time constant постоянная времени @@ -16131,59 +12681,46 @@ SmoothCurveDialog - &Close &Закрыть - - - Color Цвет - Curve График функции - f - Iterations Итераций - Points Точек - Points to the Left Точек слева - Points to the Right Точек справа - Polynomial Order Порядок полинома - QtiPlot - Smoothing Options QtiPlot - Параметры сглаживания - &Smooth &Сглаживание @@ -16191,95 +12728,66 @@ SmoothFilter - - - - - - - - Error Ошибка - FFT smoothing Сглаживание Фурье - - - - - - - - QtiPlot QtiPlot - Unknown smooth filter. Valid values are: 1 - Savitky-Golay, 2 - FFT, 3 - Moving Window Average, 4 - Lowess. Неизвестный тип сглаживания. Допустимые значения:1 - Савицкий-Голай, 2 - Фурье, 3 - Скользящее среднее, 4 - Lowess. - Savitzky-Golay smoothing Сглаживание Савицкого-Голея - Lowess smoothing - Сглаживание Lowess + Сглаживание Lowess - Setting polynomial order is only available for Savitzky-Golay smooth filters! Ignored option! Настройка порядка полинома доступна только для метода сглаживания Савицкого-Голея! Опция игнорируется! - Setting Lowess parameter is only available for Lowess smooth filters! Ignored option! Настройка параметра доступна только для метода сглаживания Lowess! Опция игнорируется! - The parameter f must be between 0 and 1! Параметр f должен быть от 0 до 1! - The number of iterations must be at least 1! Количество итераций должно быть не меньше 1! - Smoothed Сглаженный - + Lowess smoothing with f=%1 and %2 iterations + Сглаживание Lowess c f=%1 и числом итерациий %2 + + The number of points must be positive! Количество точек должно быть положительным! - - The polynomial order must be lower than the number of left points plus the number of right points! Порядок полинома должен быть меньше, чем суммарное количество точек слева и справа! - average smoothing усредненное сглаживание - - - - points точки @@ -16287,311 +12795,326 @@ SortDialog - Ascending По возрастанию - &Close &Закрыть - Descending По убыванию - Leading column Ведущий столбец - Order Порядок - QtiPlot - Sorting Options QtiPlot - Параметры сортировки - Separately Раздельно - &Sort &Сортировать - Sort columns Сортировать столбцы - Together Совместно + SubtractDataDialog + + QtiPlot + QtiPlot + + + Math on Data Sets + + + + Cu&rve + + + + &Operator + + + + &Data set + + + + Current &folder + + + + &Value + + + + &Apply + &Применить + + + &Close + &Закрыть + + + Error + Ошибка + + + Data set %1 must containt at least two valid data points in order to perform this operation! + + + + + SubtractLineTool + + Move cursor and click to select and double-click/press 'Enter' to set the position of the first point! + + + + First point selected! Click to select and double-click/press 'Enter' to set the position of the 2nd point! + + + + SurfaceDialog - Clear &list - Очистить &список + Очистить &список - &Close &Закрыть - - - - - From От - &OK &OK - Please enter limits that satisfy: from < end! Пожалуйста введите пределы, удовлетворяющие соотношению: от < до! - QtiPlot - Define surface plot QtiPlot - Определение графика 3D поверхности - QtiPlot - Input error QtiPlot - Ошибка ввода - QtiPlot - Input function error QtiPlot - Ошибка ввода функции - - - - - To До - X - axis Ось X - Y - axis Ось Y - Z - axis Ось Z - f(x,y)= f(x,y)= - Surface type Тип поверхности - Function Функция - Parametric Параметрически заданная функция - - + Clea&r + &Очистить + + + Rece&nt + По&следние + + + Click here to select a recently typed expression + Выбрать одно из последних введённых выражений + + Mesh Сетка - - Columns Столбцов - - Rows Строк - Equations Уравнения - X(u,v)= - Y(u,v)= - Z(u,v)= - u - - Periodic Периодически - v - QtiPlot - X Formula Error QtiPlot - Ошибка в формуле для X - QtiPlot - Y Formula Error QtiPlot - Ошибка в формуле для Y - QtiPlot - Z Formula Error QtiPlot - Ошибка в формуле для Z - + QtiPlot + QtiPlot + + + Sorry, there are no recent expressions available! + Нет доступных выражений! + + + Recent Functions + Последние функции + + + Please, choose a function: + Выбрать функцию: + + QtiPlot - u start limit error - QtiPlot - Ошибка начального значения u + QtiPlot - Ошибка начального значения u - - QtiPlot - u end limit error - QtiPlot - Ошибка конечного значения u + QtiPlot - Ошибка конечного значения u - QtiPlot - v start limit error - QtiPlot - Ошибка начального значения v + QtiPlot - Ошибка начального значения v SymbolBox - Cross Перекрестие - Diagonal Cross Диагональное перекрестие - Diamond Ромб - Down Triangle Треугольник с вершиной внизу - Ellipse Эллипс - Hexagon Шестиугольник - Horizontal Line Горизонтальная чёрточка - Left Triangle Треугольник с вершиной слева - No Symbol Без символа - Rectangle Прямоугольник - Right Triangle Треугольник с вершиной справа - Star 1 Звёздочка 1 - Star 2 Звёздочка 2 - Triangle Треугольник - Up Triangle Треугольник с вершиной наверху - Vertical Line Вертикальная чёрточка @@ -16599,12 +13122,10 @@ SymbolDialog - &Close &Закрыть - QtiPlot - Choose Symbol QtiPlot - Выберите символ @@ -16612,168 +13133,106 @@ Table - - Cancel Отмена - Columns will be deleted from the table! Столбцы будут удалены из данной таблицы! - Could not write to file: <br><h4> Не удалось записать в файл: <br><h4> - - Do you really want to continue? Вы действительно хотите продолжить? - Please indicate the name of the leading column! Укажите имя ведущего столбца! - - - - QtiPlot QtiPlot - QtiPlot - ASCII Export Error QtiPlot - ошибка при экспортировании в ASCII - - - - - - - - - - - - - - - QtiPlot - Error QtiPlot - Ошибка - Rows will be deleted from the table! Строки будут удалены из таблицы! - The leading column is empty! Operation aborted! Ведущий столбец пуст. Операция отменена! - There is already a column called : <b> Уже существует столбец с названием : <b> - - Yes Да - - - Column '%1' is read only! Столбец '%1' - только для чтения! - The table '%1' contains read-only columns! Operation aborted! Таблице '%1' содержит столбцы только для чтения! Операция прервана! - - - - - - - - The folowing columns Следующие столбцы - - - - - - - - are read only! только для чтения! - Paste operation Вставить - How should QtiPlot interpret first clipboard line? Как интерпретировать первую линию буфера обмена? - &Values &Значения - Column &Names Названия &столбцов - &Comments Ко&мментарии - Qtiplot Qtiplot - Reading file... Читается файл... - kB кб - Multiline expressions take much more time to evaluate! Do you want to continue anyways? Многострочные выражения требуют намного больше времени для вычисления! Продолжить? - Warning Предупреждение @@ -16781,343 +13240,274 @@ TableDialog - &Apply &Применить - Apply to all Применить ко всем - Apply to all columns to the right Применить ко всем столбцам справа - &Cancel О&тмена - Column Name: Название столбца: - Column Width: Ширина столбца: - Comment: Комментарий: - Couldn't guess the source data format, please specify it using the 'Format' box! Не удаётся распознать формат входящих данных, пожалуйста, укажите его через поле 'Формат'! - Date Дата - Day of Week День недели - Decimal: 1000 Десятичный: 1000 - Default По умолчанию - Display Показывать как - &Display Comments in Header &Показывать комментарии в заголовках - Enumerate all to the right Пронумеровать все столбцы справа - For internal consistency reasons the underscore character is replaced with a minus sign. Для обеспечения внутренней согласованности символ подчёркивания был заменён на знак минус. - For more information about the supported date/time formats please read the Qt documentation for the QDateTime class! Для информации о поддерживаемых форматах даты и времени, пожалуйста, посмотрите документацию Qt для класса QDateTime! - Format: Формат: - Month Месяц - None Нет - Numeric Число - &OK &OK - Options Параметры - Plot Designation: Предназначение: - Precision: Точность: - QtiPlot - Column options QtiPlot - Параметры столбца - - QtiPlot - Error QtiPlot - Ошибка - QtiPlot - Warning QtiPlot - Предупреждение - Scientific: 1E3 Научный: 1E3 - Text Текст - The column names must only contain letters and digits! - Названия столбцов должны состоять только из букв и цифр! + Названия столбцов должны состоять только из букв и цифр! - Time Время - X (abscissae) X (абсцисса) - X Error Погрешность по X - Y (ordinates) Y (ордината) - Y Error Погрешность по Y - Z (height) Z (высота) - dd MM yyyy дд ММ гггг - dd.MM.yyyy дд.ММ.гггг - dd/MM/yyyy дд/ММ/гггг - h ч - h AP Ч 12 - h ap ч 12 - h:mm ч:мм - h:mm ap ч:мм 12 - h:mm:ss ч:мм:сс - h:mm:ss.zzz ч:мм:сс.ххх - hh:mm чч:мм - hhmmss ччммсс - hmm чмм - hmmss чммсс - mm:ss мм:сс - mm:ss.zzz мм:сс.ххх - yyyy-MM-dd гггг-ММ-дд - yyyyMMdd ггггММдд - &Read-only Только для &чтения - Label Метка - &Hidden &Скрытый - dd/MM/yyyy HH:mm дд/ММ/гггг ЧЧ:мм - dd/MM/yyyy HH:mm:ss дд/ММ/гггг ЧЧ:мм:cc - dd.MM.yyyy HH:mm дд.ММ.гггг ЧЧ:мм - dd.MM.yyyy HH:mm:ss дд.ММ.гггг ЧЧ:мм:cc - dd MM yyyy HH:mm дд ММ гггг ЧЧ:мм - dd MM yyyy HH:mm:ss дд ММ гггг ЧЧ:мм:cc - yyyy-MM-dd HH:mm гггг-ММ-дд ЧЧ:мм - yyyy-MM-dd HH:mm:ss гггг-ММ-дд ЧЧ:мм:cc - yyyyMMdd HH:mm ггггММдд ЧЧ:мм - yyyyMMdd HH:mm:ss ггггММдд ЧЧ:мм:сс @@ -17125,100 +13515,74 @@ TableStatistics - Col Столбец - ColStats ColStats - Cols Столбцов - Column Statistics of %1 Статистика столбцов %1 - - Max Max - - Mean Среднее - - Min Min - Row Строка - Row Statistics of %1 Статистика строк %1 - RowStats RowStats - Rows Строк - - StandardDev СтандартОтклон - - Sum Сумма - - Variance Вариация - iMax iMax - iMin iMin - - StandardError Стандартная Ошибка - - Median Медиана @@ -17226,110 +13590,86 @@ TextDialog - Alignment Выравнивание - Center По центру - &Font &Шрифт - Font Шрифт - Left По левому краю - QtiPlot - Text options QtiPlot - Параметры Текста - Right По правому краю - Text Color Цвет шрифта - - - - QtiPlot QtiPlot - X Axis Title Подпись оси X - Y Axis Title Подпись оси Y - Top Axis Title Подпись верхней оси - Right Axis Title Подпись правой оси - &Apply to... Применить &к... - Object Объект - Layer Слой - Window Окно - All Windows Всем окнам - &Close &Закрыть - Distance to axis Расстояние до оси - &Inverted &В обратном порядке @@ -17337,17 +13677,14 @@ TextEditor - QtiPlot QtiPlot - Confirmation Подтверждение - Are you sure you want to add %1 text lines into this text box? Вы уверены, что хотите добавить %1 строк текста? @@ -17355,19 +13692,16 @@ TextFormatButtons - B Button bold Ж - It Button italics К - U Button underline П @@ -17376,47 +13710,38 @@ ThreeExpFit - Exponential decay Затухание по экспоненте - ExpDecay3 ЭксРаспад3 - first amplitude первая амплитуда - first lifetime первое время - second amplitude вторая амплитуда - second lifetime второе время - third amplitude третья амплитуда - third lifetime третье время - offset смещение @@ -17424,36 +13749,26 @@ TranslateCurveTool - Curve selected! Move cursor and click to choose a point and double-click/press 'Enter' to finish! Кривая выбрана! Для выбора точки подведите указатель и сделайте щелчок, двойной щелчок или 'Enter' для завершения! - - - - QtiPlot - Warning QtiPlot - Предупреждение - This operation cannot be performed on curves plotted from columns having a non-numerical format. Эта операция не может быть выполнена над кривыми построенными для колонок с нечисловым форматом данных. - This operation cannot be performed on function curves. Эта операция не может быть выполнена на функциональных кривых. - - The column '%1' is read-only! Operation aborted! Столбец '%1' - только для чтения! Операция прервана! - Double-click on plot to select a data point! Двойной щелчок по графику для выбора точек! @@ -17461,37 +13776,30 @@ TwoExpFit - Exponential decay Затухание по экспоненте - ExpDecay2 ЭксРаспад2 - first amplitude первая амплитуда - first lifetime первое время - second amplitude вторая амплитуда - second lifetime второе время - offset смещение @@ -17499,71 +13807,58 @@ muParserScript - Couldn't find a table named %1. - Не могу найти таблицу с именем %1. + Не удалось найти таблицу с именем %1. - - - - Out of memory Вне области памяти - There's no column %1 in matrix %2! В матрице %2 нет столбца %1! - - - There's no column %1 in table %2! В таблице %2 нет столбца %1! - - There's no column named %1 in table %2! В таблице %2 нет столбца с именем %1! - There's no row %1 in matrix %2! В матрице %2 нет строки %1! - - - There's no row %1 in table %2! В таблице %2 нет строки %1! - - cell() works only on tables and matrices! cell() работает только с таблицами и матрицами! - col() works only on tables! col() работает только с таблицами! - tablecol() works only on tables! tablecol() работает только с таблицами! - tablecol: first argument must be a string (table name) tablecol: первый аргумент должен быть строкой (имя таблицы) - + SUM() works only on tables! + + + + AVG() works only on tables! + + + tablecol: wrong number of arguments (need 2, got %1) tablecol: неверное число аргументов (требуется 2, получили %1) === modified file 'qtiplot/translations/qtiplot_sv.ts' --- qtiplot/translations/qtiplot_sv.ts 2009-12-08 18:06:27 +0000 +++ qtiplot/translations/qtiplot_sv.ts 2010-07-21 23:21:08 +0000 @@ -332,6 +332,2622 @@ QtiPlot - Kolumnvalsfel + Open File + Öppna fil + + + Format + Format + + + Time + Tid + + + Left + Vänster + + + Right + Höger + + + Data + Data + + + The file: <b>%1</b> is the current file! + Filen: <b>%1</b> är den nuvarande filen! + + + The file <b>%1</b> is corrupted, but there exists a backup copy.<br>Do you want to open the backup instead? + Filen <b>%1</b> är förstörd. men det finns en säkerhetskopia.<br>Vill du öppna denna i stället? + + + The file: <b> %1 </b> was not created using QtiPlot! + Filen:<b>%1</b> skapades inte av QtiPlot! + + + The file: <p><b> %1 </b><p> is the current file! + Filen: <p><b> %1 </b><p> är den aktuella! + + + QtiPlot - File Open Error + QtiPlot - Filöppningsfel + + + The file: <b> %1 </b> <p>does not exist anymore!<p>It will be removed from the list. + Filen: <b>%1</b>finns inte längre!<p>Den kommer att tas bort från listan. + + + The file "%1" was created using "%2" as scripting language. + +Initializing support for this language FAILED; I'm using "%3" instead. +Various parts of this file may not be displayed as expected. + Filen "%1" ssskapades med "%2" som skript-språk. + +Initiering av stöd för detta språk MISSLYCAKDES; jag använder "%3" i stället. +Delar av denna fil kanske inte visas som väntat. + + + Window + Fönster + + + QtiPlot - Opening file + QtiPlot - Filöppning + + + Script Error + Skriptningsfel + + + QtiPlot - Scripting Error + QtiPlot - Skriptningsfel + + + Scripting language "%1" failed to initialize. + Misslyckades med att initiera skript-språkrt "%1" . + + + QtiPlot - Open Template File + QtiPlot - Öppna mallfil + + + The file: <b>%1</b> is not a QtiPlot template file! + Filen: <b>%1</b>är inte en QtiPlot mallfil! + + + Table1 + Tabell 1 + + + QtiPlot - Export Error + QtiPlot - Export-fel + + + <h4>There are no plot layers available in this window!</h4> + <h4>Det finns inga lager tillgängliga i detta fönster!</h4> + + + &Save + &Spara + + + &Cancel + &Avbryt + + + Choose a directory to export the graphs to + Välj en mapp för diagramexport + + + Output format: + Utdataformat: + + + Directory: + Mapp: + + + There are no plot layers available in window <b>%1</b>.<br>Graph window not exported! + Det finns inga diagramlager tillgängliga i fönster <b>%1</b>.<br>Diagramfönster ej exporterat! + + + A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? + En fil med namn: <p><b>%1</b><p>finns redan! Vill du skriva över den? + + + QtiPlot - Overwrite file? + QtiPlot - Skriva över fil? + + + QtiPlot - Export error + QtiPlot - Fel vi export + + + Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! + Kunde inte skriva till filen: <br><h4> %1 </h4><p>Verifiera att du har rättighet att skriva på denna plats! + + + Minimized + Minimerad + + + Save Project As + Spara projekt som + + + QtiPlot Matrix Template + QtiPlot - Matrismall + + + QtiPlot 2D Graph Template + QtiPlot - 2D-diagrammall + + + QtiPlot Table Template + QtiPlot - Tabellmall + + + QtiPlot 3D Surface Template + QtiPlot - 3D-ytdiagramsmall + + + Save Window As Template + Spara fönster som mall + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + Kunde inte skriva till filen: <br><h4> %1 </h4><p>Verifiera att du har rättighet att skriva på denna plats! + + + The name you chose is not valid: only letters and digits are allowed! + Namnet du valt är ej giltigt: endast bokstäver och siffror tillåtna! + + + Name <b>%1</b> already exists! + namnet <b>%1</b> finns redan! + + + Warning: for internal consistency reasons the underscore character is replaced with a minus sign. + varning: av interna skäl byts understrykningstecknet mot minustecken. + + + <h4>There are no plot layers available in this window.</h4><p><h4>Please add a layer and try again!</h4> + <h4<Det finns inga plottlager i detta fönster.</h4><p><h4>Lägg till ett lager och försök igen!</h4> + + + This functionality is not available for pie plots! + Denna egenskap är inte tillgänglig för pajdiagram! + + + &All + &Allt + + + QtiPlot - Enter rows number + QtiPlot - Mata in antal rader + + + Rows + Rader + + + QtiPlot - Delete rows + QtiPlot - Tag bort rader + + + Start row + Startrad + + + End row + Slutrad + + + QtiPlot - Enter columns number + QtiPlot - Mata in antal kolumner + + + Columns + Kolumner + + + Please select a column first! + Välj en kolumn först! + + + Please select exactly one columns for this operation! + Välj endast en kolumn för denna åtgärd! + + + Please select two columns for this operation: + the first represents the signal and the second the response function! + Välj två kolumner för denna åtgärd: +den första representerar signalen och den andra svarsfunktionen! + + + QtiPlot - Row selection error + QtiPlot - Radvalsfel + + + Please select a row first! + Välj en rad först! + + + Special Line/Symb&ol + Särskild linje/symb&ol + + + Statistical &Graphs + Statistiska dia&gram + + + Cu&t + Klipp u&t + + + &Copy + &Kopiera + + + Past&e + Klistra &in + + + &X + &X + + + &Y + &Y + + + &Z + &Z + + + &Label + &Etikett + + + X E&rror + X-f&el + + + Y &Error + Y-&fel + + + Set As + Satt som + + + &Fill Column With + &Fyll kolomn med + + + &Column + &Kolumn + + + &Normalize + &Normalisera + + + Clea&r + &Rensa + + + &Delete + &Tag bort + + + &Insert + Sätt &in + + + &Ascending + &Stigande + + + &Descending + &Fallande + + + Sort Colu&mn + Sortera kolu&mn + + + Pa&nel + Pa&nel + + + Read/&Write + Läs/&skriv + + + &Fill Columns With + &Fyll kolumn med + + + You need to select at least one Y column for this operation! + Du behöver mints en Y-kolumn för att utföra åtgärden! + + + Y2 Axis Title + Y2-axeltitel + + + Not available for empty 3D surface plots! + Inte tillgängligt för tomma 3D-ytdiagram! + + + Set Display Range + Ställ in visningsområde + + + <h4>There are no plot layers available in this window.</h4> + <h4>Det finns inga diagramlager tillgängliga i deta fönster.</h4> + + + This will modify the data in the worksheets! +Are you sure you want to continue? + Detta kommer att förändra data i arbetsbladen! +är du säker på att du vill fortsätta? + + + Continue + Fortsätt + + + Cancel + Avbryt + + + Could not write to file: <h4>%1</h4><p>Please verify that you have the right to write to this location or that the file is not being used by another application! + Kunde ej skriva till fil: <h4>%1</h4><p>verifiera att du har rätt att skriva till denna plats eller att filen inte utnyttjas av någon annan tillämpning! + + + Please select a 'Y' column first! + Välj en 'Y'-kolumn först! + + + Sorry, there are no results to display! + Tyvärr, det finns inga resultat att visa upp! + + + There are no plot layers available in this window! + Det finns inga diagramlager tillgängliga i detta fönster! + + + There are no curves available on this plot! + Det finns inga kurvor tillgängliga på detta diagram! + + + There are no layers available on this plot. Operation aborted! + Det finns inga lager tillgängliga för detta diagram. Åtgärd avbryts! + + + QtiPlot - Insert image from file + QtiPlot - Skjut in bild från fil + + + There are no plot layers available in this window. + Det finns inga diagramlager tillgängliga i detta fönster. + + + QtiPlot - Duplicate window error + QtiPlot - Dupliseringslfönsterfel + + + QtiPlot - Duplicate error + QtiPlot - Dupliseringslfel + + + Empty 3D surface plots cannot be duplicated! + Tomma 3D-ytdiagram kan ej dupliseras! + + + Released + Släppt + + + About QtiPlot + Om QtiPlot + + + &Translate + &Förskju&t + + + Vie&w + Vi&sa + + + &Palette + &Palett + + + &Convert to Spreadsheet + &Omvandla till kalkylblad + + + &Recent Projects + Aktuella p&rojekt + + + &Folders + &Mappar + + + &Cascade + &Kaskad + + + &Tile + &Bricka + + + Close &Window + &Stäng fönster + + + More windows... + Fler fönster... + + + &View Pixel Line profile + &Visa pixellinjeprofil + + + &Intensity Matrix + &Intensitetsmatris + + + &Cut + Klipp &ut + + + Please use the project explorer to select a window! + Använd projektutforskaren till att välja ett fänster! + + + Normal + Normal + + + Save changes to project: <p><b> %1 </b> ? + Spara ändringar till projekt: <p><b> %1 </b><p> ? + + + UNTITLED + NAMNLÖS + + + QtiPlot - untitled + QtiPlot - namnlös + + + &Delete Selection + &Tag bort det valda + + + Auto &Column Width + Automatisk &kolumnbredd + + + &Delete Window + &Tag bort fönster + + + &Rename Window + &Döp om fönster + + + &Print Window + &Skriv ut fönster + + + D&epending Graphs + B&eroende diagram + + + D&epending 3D Graphs + B&eroende 3D-diagram + + + D&epends on + B&eror på + + + Function + Funktion + + + Maximized + Maximerad + + + Re&move Pie Curve + Tag bort tårtdiagra&m + + + &Add + &Lägg till + + + Anal&yze + Anal&ysera + + + &Data + &Data + + + &Gray Scale + &Gråskala + + + &Layer + &Lager + + + &Window + &Fönster + + + &Paste Layer + &Klistra in lager + + + &Paste Text + &Klistra in ntext + + + &Paste Tex Formula + &Klista in texformel + + + &Paste Image + &Klistra in bild + + + &Paste Rectangle + &Klistra in rektangel + + + &Paste Ellipse + &Klistra in ellips + + + &Paste Line/Arrow + &Klistra in rad/pil + + + E&xport + E&xportera + + + &Print + &Skriv ut + + + P&roperties... + E&genskaper... + + + &Copy Page + &Kopiera sida + + + E&xport Page + E&xportera sida + + + 3D &Plot + 3D Dia&gram + + + &Matrix... + &Matris... + + + Choose &Data Set... + Välj &datamängd... + + + Choose &Matrix... + Välj &matris... + + + C&lear + &Rensa + + + &Copy Graph + &Kopiera diagram + + + &Export + E&xportera + + + &Paste + Klistra &in + + + &Insert Row + Sätt &in rad + + + &Insert Column + Sätt &in kolumn + + + &Delete Rows + &Tag bort rader + + + &Delete Columns + &Tag bort kolumn + + + &Delete Row + &Tag bort rad + + + Clea&r Row + &Rensa rad + + + Clea&r Rows + &Rensa rader + + + Choose the location of the QtiPlot help folder! + Välj platsen för QtiPlots hjälpmapp! + + + QtiPlot - index.html File Not Found! + QtiPlot - Index.html-fil ej funnen! + + + QtiPlot - Help Files Not Found! + QtiPlot - Hjälpfiler inte hittade! + + + The manual can be downloaded from the following internet address: + Handboken kan laddas ner från följande internetadress: + + + QtiPlot - Help Profile Not Found! + QtiPlot - Hjälpprofil ej funnen! + + + The assistant could not start because the file <b>%1</b> was not found in the help file directory! + Hjälpredan kunde inte startas ty filen <b>%1</b> kunde inte hittas i hjälpmappen! + + + This file is provided with the QtiPlot manual which can be downloaded from the following internet address: + Denna fil kommer med QtoPlot-handboken, som kan laddas ner från följande internetadress: + + + Please indicate the location of the help file! + Peka ut platsen för hjälpfilen! + + + <h4>There are no tables available in this project.</h4><p><h4>Please create a table and try again!</h4> + <h4> Det finns inga tabell tillgängliga i detta projekt.</h4><p><h4>Skapa en tabell och försök igen!</h4> + + + QtiPlot - Edit function + QtiPlot - Redigera funktion + + + 3D Surface + 3D-yta + + + QtiPlot - Set the number of pixels to average + QtiPlot - Sätt antal pixlar för medelvärdesbildning + + + Number of averaged pixels + Antal medelvärdesbildade pixlar + + + You must have more than one layer in the active window! + Du måste ha fler än ett lager i det aktiva fönstret! + + + You must have more than one dataset in the active layer! + Du måste ha fler än en datamängd i det aktiva lagret! + + + QtiPlot - Guess best origin for the new layer? + QtiPlot - Gissa bästa ursprung för det nya lagret? + + + Do you want QtiPlot to guess the best position for the new layer? + Warning: this will rearrange existing layers! + Vill du att QtiPlot skall gissa positionen för det nya lagret? +Varning: detta kommer att arrangera om befintliga lager! + + + &Guess + &Gissa + + + &Top-left corner + &Övre vänstra hörnet + + + QtiPlot - Choose data set + QtiPlot - Välj datamängd + + + Curve + Kurva + + + Integration of %1 from zero is + Integration av %1 från noll är + + + Integration of %1 + Integrering av v%1 + + + Area + Yta + + + Linear Regression of %1 + Linjär regression av %1 + + + Slope + Lutning + + + Intercept + Skärningspunkt + + + Chi^2 + Chi² + + + Add &Custom Script Action... + Lägg till &anpassad skriptåtgärd... + + + New &Project + Nytt &projekt + + + Ctrl+N + Ctrl+N + + + App&end Project... + Lägg till proj&ekt... + + + New &Graph + Nytt dia&gram + + + Ctrl+G + Ctrl+G + + + New &Note + Ny a&nteckning + + + New &Table + Ny &tabell + + + Ctrl+T + Ctrl+T + + + New &Matrix + Ny &matris + + + Ctrl+M + Ctrl+M + + + New &Function Plot + Nytt &funktionsdiagram + + + Ctrl+F + Ctrl+F + + + New 3D &Surface Plot + Nytt 3D-&ytdiagram + + + Ctrl+ALT+Z + Ctrl+Alt+Z + + + &Open + &Öppna + + + Ctrl+O + Ctrl+O + + + Open Image &File + Öppna bild&fil + + + Ctrl+I + Ctrl+I + + + Import I&mage... + I&mportera bildfil... + + + &Save Project + Spara pro&jet + + + Ctrl+S + Ctrl+S + + + Save Project &As... + Sp&ara projekt som... + + + Open Temp&late... + Öppna Ma&ll... + + + Save As &Template... + Spara som &mall... + + + Save Note As... + Spara anteckning som... + + + &Import ASCII... + &Importera ASCII... + + + &Undo + &Ångra + + + Ctrl+Z + Ctrl+Z + + + &Redo + Gö&r om + + + &Duplicate + D&uplicera + + + Cu&t Selection + Klipp u&t det valda + + + Ctrl+X + Ctrl+X + + + &Copy Selection + &Kopiera det valda + + + Ctrl+C + Ctrl+C + + + &Paste Selection + K&listra in det valda + + + Ctrl+V + Ctrl+V + + + Ctrl+E + Ctrl+E + + + &Find... + &Leta... + + + Add La&yer + L&ägg till lager + + + ALT+L + ALT+L + + + Arran&ge Layers + Arran&gera lager + + + Shift+A + Shift+A + + + Automatic Layout + Automatisk layout + + + &Current + &Aktuellt + + + Ctrl+Alt+G + Ctrl+Alt+G + + + Alt+X + Alt+X + + + &Export PDF + &Exportera PDF + + + Ctrl+Alt+P + Ctrl+Alt+P + + + Ctrl+P + Ctrl+P + + + Print All Plo&ts + Skriv u&t alla diagram + + + E&xport ASCII + Ex&portera ASCII + + + &Quit + &Avsluta + + + Ctrl+Q + Ctrl+Q + + + Clear &Log Information + Nollställ &logginformation + + + Delete &Fit Tables + Tag &bort anpassningstabeller + + + Plot &Wizard + Diagram&hjälp + + + Ctrl+Alt+W + Ctrl+Alt+W + + + &Preferences... + &Inställningar... + + + Add/Remove &Curve... + Lägg till/tag bort &kurva... + + + ALT+C + ALT+C + + + Add &Error Bars... + Lägg till f&elstaplar... + + + Ctrl+B + Ctrl+B + + + Add &Function... + Lägg till &funktion... + + + Ctrl+Alt+F + Ctrl+Alt+F + + + &Rescale to Show All + Skala om fö&r att visa allt + + + New &Legend + Ny &beskrivning + + + Ctrl+L + Ctrl+L + + + Add Time Stamp + Lägg till tidsstämpel + + + Ctrl+ALT+T + Ctrl+ALT+T + + + Add &Image + Lägg till b&ild + + + ALT+I + ALT+I + + + &Line + &Linje + + + &Scatter + S&pridning + + + Line + S&ymbol + Linje + s&ymbol + + + Vertical &Drop Lines + Vertikal &dropplinje + + + &Spline + Anpa&ssad kurva + + + &Horizontal Steps + &Horisontella steg + + + &Vertical Steps + &Vertikala steg + + + &Columns + &Kolumner + + + &Rows + &Rader + + + &Area + Yt&a + + + &Pie + &Paj + + + Vectors XY&AM + Vektorer XYA&M + + + &Vectors &XYXY + &Vektorer &XYXY + + + &Histogram + &Histogram + + + &Stacked Histogram + &Staplade histogram + + + Stem-and-&Leaf Plot + Stam-och-&lövplot + + + &Vertical 2 Layers + &Vertikalt 2 lager + + + &Horizontal 2 Layers + &Horisontellt 2 lager + + + &4 Layers + &4 Lager + + + &Stacked Layers + &Staplade lager + + + D&ouble-Y + D&ubbel-Y + + + &Zoom + &Zoom + + + E&xtract to Graphs + Ploc&ka ut till diagram + + + Extract to &Layers + Plocka ut till &lager + + + Add Inset Layer + Lägg till "Inset" lager + + + &Ribbon + &Band + + + &Bars + &Staplar + + + &Trajectory + Spå&r + + + Statistics on &Columns + Statistik för &kolumner + + + Statistics on &Rows + Statistik för &rader + + + &Integrate + &Integrera + + + Integr&ate Function... + Integrer&a funktion... + + + Inte&rpolate ... + Inte&rpolering... + + + &Low Pass... + &Lågpass... + + + &High Pass... + &Högpass... + + + &Band Pass... + &Bandpass... + + + &Band Block... + &Bandspärr... + + + &FFT... + &FFT... + + + &Savitzky-Golay... + &Savitzky-Golay... + + + &FFT Filter... + &FFT-filter... + + + Moving Window &Average... + Flytt&ar fönstermedelvärdesbildning... + + + &Differentiate + &Differentieria + + + Fit &Linear + Anpassa &linjärt + + + Fit &Polynomial ... + Anpassa &polynom ... + + + &First Order ... + &Första ordningens ... + + + &Second Order ... + &Andra ordningens ... + + + &Third Order ... + &tredje ordningens ... + + + Fit Exponential Gro&wth ... + Anpassa exponetiell till&växt ... + + + Fit &Boltzmann (Sigmoidal) + Anpassa &Boltzmann (Sigmoidal) + + + Fit &Gaussian + Anpassa &Gaussiskt + + + Fit Lorent&zian + Anpassa Lorent&ziskt + + + Fit &Wizard... + An&passningshjälpreda... + + + Ctrl+Y + Ctrl+Y + + + &Plot ... + &Diagram ... + + + &Scales... + &Skalor... + + + &Axes... + &Axlar... + + + &Grid ... + &Rutnät... + + + &Title ... + &Titel ... + + + Column &Options ... + K&olumnalternativ ... + + + Ctrl+Alt+O + Ctrl+Alt+O + + + Set Column &Values ... + Sätt kolumn&värden ... + + + Alt+Q + Alt+Q + + + Recalculate + Räkna om + + + Ctrl+Return + Ctrl+vagnretur + + + &Hide Selected + &Göm det valda + + + Sho&w All Columns + &Visa alla kolumner + + + &Swap columns + &Byt kolumner + + + Move &Right + Flytta åt &höger + + + Move &Left + Flytta åt &vänster + + + Move to F&irst + Flytta &först + + + Move to Las&t + Flytta &sist + + + &Columns... + &Kolumner... + + + &Rows... + &Rader... + + + &Delete Rows Interval... + &Tag bort radintervall... + + + &About QtiPlot + &Om QtiPlot + + + F1 + F1 + + + &Help + &Hjälp + + + Ctrl+H + Ctrl+H + + + &Choose Help Folder... + Väl&j hjälpmapp... + + + Ctrl+W + Ctrl+W + + + Add Column + Lägg till kolumn + + + &Go to Row... + &Gå till rad... + + + Go to Colum&n... + Gå till kolum&n... + + + Ctrl+Alt+C + Ctrl+Alt+C + + + Clear + Rensa + + + &Remove Layer + &Tag bort lager + + + Alt+R + Alt+R + + + Window &Geometry... + Fönster&geometri... + + + &Hide Window + Döl&j fönster + + + Ctrl+Alt+H + Ctrl+Alt+H + + + &View Pixel Line Profile + &Visa pixellinjeprofil + + + &Intensity Table + &Intensitetstabell + + + &Properties + &Egenskaper + + + &Activate Window + &Aktiver fönster + + + Mi&nimize Window + Mi&nimera fönster + + + Ma&ximize Window + Ma&ximera fönster + + + Re&size Window... + Ändra fönster&storlek... + + + &Surface... + &Yt... + + + &Data Set... + &Data mängd... + + + Set &Properties... + Ställ in egenska&per... + + + Set &Dimensions... + Ställ in &dimensioner... + + + Ctrl+D + Ctrl+D + + + Set &Values... + Ställ in &värden... + + + &Image Plot + B&ilddiagram + + + &Transpose + &Transponera + + + Flip &V + Vänd &V + + + Ctrl+Shift+V + Ctrl+Shift+V + + + Flip &H + Vänd %H + + + Ctrl+Shift+H + Ctrl+Shift+H + + + R&otate 90 + V&rid 90 + + + Rotate &-90 + Vrid &-90 + + + Ctrl+Alt+R + Ctrl+Alt+R + + + &Invert + &Invertera + + + &Determinant + &Determinant + + + &Image mode + B&ildläge + + + Ctrl+Shift+I + Ctrl+Shift+I + + + &Data mode + &Dataläge + + + Ctrl+Shift+D + Ctrl+Shift+D + + + Show &X/Y + Visa &X/Y + + + Ctrl+Shift+X + Ctrl+Shift+X + + + Show &Column/Row + Visa &kolumn/rad + + + Ctrl+Shift+C + Ctrl+Shift+C + + + &Default + Standard + + + &Rainbow + &Regnbåge + + + &Custom + &Anpassad + + + &Export Image ... + &Exportera bild... + + + &Direct + &Direkt + + + &XYZ Columns + &XYZ-kolumner + + + &YXZ Columns + &YXZ-kolumner + + + &Forward FFT + &Framåt FFT + + + &Inverse FFT + &Omvänd FFT + + + 3D &Wire Frame + 3D-t&rådram + + + 3D &Hidden Line + 3D &Dold linje + + + 3D &Polygons + 3D &Polygoner + + + 3D Wire &Surface + 3D Tråd&yta + + + Contour - &Color Fill + Kontur - &färgfyllnad + + + Contour &Lines + Kontur&linjer + + + &Gray Scale Map + &Gråskalekarta + + + Sort Ta&ble + Sortera ta&bell + + + Sort Columns + Sortera kolumner + + + &Table + &Tabell + + + Co&rrelate + K&orrelera + + + &Autocorrelate + &Autokorrelera + + + &Convolute + Fa&lta + + + &Deconvolute + O&mfalta + + + &Horizontal + &Horisontell + + + &Vertical + &Vertikal + + + Ro&w Numbers + Ra&dnummer + + + &Random Values + &Slumptal + + + &Frequency Count ... + &Frekvensräknare... + + + &Read Only + Sk&rivskyddat + + + &Disregard + &Förbise + + + &Box Plot + &Låddiagram + + + &Gaussian... + &Gaussiskt... + + + &Lorentzian... + &Lorentziskt... + + + Search for &Updates + Leta efter &uppdateringar + + + &QtiPlot Homepage + &QtiPlots Hemsida + + + QtiPlot &Forums + QtiPlot &Forum + + + Report a &Bug + Rapportera ett &fel + + + Download &Manual + Ladda ner &handbok + + + &Translations + Ö&versätttningar + + + Make a &Donation + Gör en &donation + + + Technical &Support + Teknisk &stöd + + + Scripting &language + Skripts&pråk + + + &Restart scripting + Sta&rta om skriptning + + + Ctrl+J + Ctrl+J + + + Execute &All + Utför &allt + + + Ctrl+Shift+J + Ctrl+Shift+J + + + &Evaluate Expression + Utvärd&era uttryck + + + Show Line &Numbers + Visa rad&nummer + + + F3 + F3 + + + &Replace... + &Byt ut... + + + &Script Window + &Skriptfönster + + + &Plot details... + &Diagramdetaljer... + + + &Worksheet + &Arbetsblad + + + &Reset to Full Range + &Återställ till fullt område + + + Edit &Range... + Redige&ra område... + + + Hide &Other Curves + Göm &andra kurvor + + + &Show All Curves + Vi&sa alla kurvor + + + &Toolbars... + &Verktygsrad... + + + Ctrl+Shift+T + Ctrl+Shift+T + + + Bold + Fetstil + + + Italic + Kursiv + + + Superscript + Exponent + + + Subscript + Index + + + Underline (Ctrl+U) + Understrykning (Ctrl+U) + + + Ctrl+U + Ctrl+U + + + Greek + Grekiska + + + Mathematical Symbols + Matematiska symboler + + + Open a new project + Öppna ett nytt projekt + + + New Fol&der + Ny ma&pp + + + Create a new folder + Skapa en ny mapp + + + Create an empty 2D plot + Skapa ett tomt 2D-diagram + + + Create an empty note window + Skapa ett tomt anteckningsfönster + + + New table + Ny tabell + + + New matrix + Ny matris + + + Create a new 2D function plot + Skapa ett nytt 2D-funktionsdiagram + + + Create a new 3D surface plot + Skapa ett nytt 3D-ytdiagram + + + Open project + Öppna projekt + + + Save project + Spara projekt + + + Open Te&mplate... + Öppna &mall... + + + Open template + Öppna mall + + + Save window as template + Spara fönster som mall + + + Import data file(s) + Importera datafil(er) + + + Ctrl+K + Ctrl+K + + + Undo changes + Ångra ändringar + + + Redo changes + Gör om ändringar + + + Duplicate window + Duplicera fönster + + + Cut selection + Klipp ut det valda + + + Copy selection + Kopiera det valda + + + Paste selection + Klistra in det valda + + + Delete selection + Tag bort det valda + + + Project &Explorer + Projektutforskar&e + + + Show project explorer + Visa projektutforskaren + + + Results &Log + Resultat&logg + + + Show analysis results + Visa analysresultat + + + &Undo/Redo Stack + &Ångra/göra-om stack + + + Show available undo/redo commands + Visa tillgängliga ångra/göra om kommandon + + + &Console + &Konsol + + + Show Scripting console + Visa konsol för skript + + + Script Window + Skriptfönster + + + Add Layer + Lägg till lager + + + Arrange Layers + Arrangera lager + + + Export current graph + Exportera aktuellt diagram + + + Export all graphs + Exportera alla diagram + + + Export to PDF + Exportera till PDF + + + Print window + Skriv ut fönster + + + Add curve to graph + Lägg till kurva till diagram + + + Add Error Bars... + Lägg till felstaplar... + + + Add Function... + Lägg till funktion... + + + Best fit + Bästa anpassning + + + Add new legend + Lägg till ny beskrivning + + + Date & time + Datum & klockslag + + + Add Image + Lägg till bild + + + Plot as line + Rita som linje + + + Plot as symbols + Rita som synbol + + + Plot as line + symbols + Rita som linje+symbol + + + Plot with vertical bars + Rita med vertikala staplar + + + Plot with horizontal bars + Rita med horisontella staplar + + + Plot area + Rita yta + + + Plot pie + Rita paj + + + &Vectors XYXY + &Vektorer XYXY + + + Vectors XYXY + Vektorer XYXY + + + Vectors XYAM + Vektorer XYAM + + + Stem-and-Leaf Plot + Stam-och-lövplot + + + Double Y Axis + Dubbla Y-axlar + + + Zoom + Zoom + + + Extract to Graphs + Plocka ut till diagram + + + Extract to Layer&s + Plocka ut till lage&r + + + Extract to Layers + Plocka ut till lager + + + Plot 3D ribbon + Rita n3D-band + + + Plot 3D bars + Rita 3D-staplar + + + Plot 3D scatter + Rita 3D-spridning + + + Plot 3D trajectory + Rita 3D-spår + + + Contour + &Color Fill + Kontur - &färgfyllnad + + + Contour Lines + Color Fill + Konturlinjer + färgfyllnad + + + Contour Lines + Konturlinjer + + + Gray Scale Map + Gråskalekarta + + + Selected columns statistics + Valda kolumners statistik + + + Selected rows statistics + Valda raders statistik + + + Hide selected columns + Göm valda kolumner + + + Show all table columns + Visa alla tabellkolumner + + + Swap selected columns + Byt valda kolumner + + + Move Right + Flytta år höger + + + Move Left + Flytta åt vänster + + + Move to First + Flytta först + + + Move to Last + Flytta sist + + + More Windows... + Fler fönster... + + + Set Matrix Values + Ge matrisvärden + + + Image Plot + Bildritning + + + Rotate 90 Clockwise + Vrid 90 medsols + + + Rotate 90 Counterclockwise + Vrid 90 motsols + + + Flip Vertically + Vik vertikalt + + + Flip Horizontally + Vik horisontellt + + + Fill selected columns with row numbers + Fyll valda kolumner med radnummer + + + Fill selected columns with random numbers + Fyll valda kolumner med slumptal + + + Set column as X + Sätt kolumn till X + + + Set column as Y + Sätt kolumn till Y + + + Set column as Z + Sätt kolumn till Z + + + Set as Y Error Bars + Sätt som Y-felstapel + + + Set as Labels + Sätt som etiketter + + + Disregard Columns + Bortse från kolumner + + + Box and whiskers plot + Låd- och morrhårskurva + + + Visit QtiPlot &Forums + Besök QtiPlot &Forum + + + Ctrl+R + Ctrl+R + + + Disable &tools + Stäng av verk&tyg + + + Pointer + Pekare + + + &Zoom In + &Zooma in + + + Ctrl++ + Ctrl++ + + + Zoom In + Zooma in + + + Zoom &Out + Z&ooma ut + + + Ctrl+- + Ctrl+- + + + Zoom Out + Zooma ut + + + &Data Reader + &Dataläsare + + + CTRL+D + CTRL+D + + + Data reader + Dataläsare + + + &Select Data Range + &Välj dataområde + + + ALT+S + ALT+V + + + Select data range + Välj dataområde + + + S&creen Reader + S&kärmläsare + + + Screen reader + Skärmläsare + + + &Draw Data Points + &Rita datapunkter + + + Draw Data Points + Rita datapunkter + + + &Move Data Points... + &Flytta datapunkter... + + + Ctrl+ALT+M + Ctrl+ALT+F + + + Move data points + Flytta datapunkter + + + Remove &Bad Data Points... + Tag bort &dåliga datapunkter... + + + Alt+B + Alt+D + + + Remove data points + Tab bort datapunkter + + + Add &Text + Lägg till &text + + + Add Text + Lägg till text + + + ALT+T + ALT+T + + + Add E&quation + Lägg till e&kvation + + + Add Equation + Lägg till ekvation + + + ALT+Q + ALT+Q + + + Add &Rectangle + Lägg till &rektangel + + + Add Rectangle + Lägg till rektangel + + + CTRL+ALT+R + CTRL+ALT+R + + + Add &Ellipse + Lägg till &ellips + + + Add Ellipse/Circle + Lägg till ellips/cirkel + + + CTRL+ALT+E + CTRL+ALT+E + + + Draw &Arrow + Rita &pil + + + CTRL+ALT+A + CTTRL+ALT+P + + + Draw arrow + Rita pil + + + Draw &Line + Rita &linje + + + CTRL+ALT+L + STRL+ALT+L + + + Draw line + Rita linje + + + Box + Låda + + + Frame + Ram + + + &Frame + &Ram + + + No Axes + Inga axlar + + + No axes + Inga axlar + + + Front grid + Främre rutnät + + + Back grid + Bakre rutnät + + + Right grid + Höger rutnät + + + Left grid + Vänster rutnät + + + Ceiling grid + Takrutnät + + + Floor grid + Golvrutnät + + + Wireframe + Trådram + + + Hidden Line + Dold linje + + + Hidden line + Gömd linje + + + Polygon Only + Endast polygon + + + Polygon only + Endast polygon + + + Mesh & Filled Polygons + Nät & fyllda polygoner + + + Mesh & filled Polygons + Nät & fyllda ploygoner + + + Dots + Prickar + + + Bars + Staplar + + + Cones + Koner + + + Crosshairs + Hårkors + + + Floor Data Projection + Golvdataprojektion + + + Floor data projection + Golvdataprojektion + + + Floor Isolines + Isolinjer på golv + + + Floor isolines + Golvisolinjer + + + Empty Floor + Tomt golv + + + Empty floor + Tomt golv + + + Animation + Animering + + + Enable perspective + Tillåt perspektiv + + + Reset rotation + Återställ rotation + + + Fit frame to window + Anpassa ram till fönster + + + Horizontal + Horisontell + + + Vertical + Vertikal + + + QtiPlot - Enter the number of peaks + QtiPlot - Mata in antal toppar + + + Peaks + Toppar + + + <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> If you like it, you're using it in your work and you would like to see it constantly improved, please support its authors by making a donation.</b></font> + <font size=+2, color = darkBlue><b>QtiPlot är öppen källprogramvara och dess utveckling har krävt hundratals timmars arbete.<br><br> Om du tycker det är bra och du använder det i ditt arbete samt om du vill se det kontinuerligt förbättrat, stöd dess upphovsman genom att göra en donation.</b></font> + + + Please support QtiPlot! + Stöd QtiPlot! + + + Close + Stäng + + + <b> %1 </b>: This command line option must be used without other arguments! + <b> %1 </b>: Detta kommandoradsval måste användas utan argument! + + + Version + Version + + + Usage + Användning + + + options + val + + + file + fil + + + name + namn + + + Valid options are + Giltiga val är + + + or + eller + + + show about dialog and exit + visa "Omdialog" och avsluta + + + start QtiPlot with the default settings + börja QtiPlot med standardinställningar + + + show command line options + visa kommandoradsval + + + start QtiPlot in language + starta QtiPlot i språket + + + show QtiPlot manual in a standalone window + visa QtiPlot-manualen i ett fristående fönster + + + print QtiPlot version and release date + skriv QtiPlot-version och utgivningsdatutm + + + execute the script file given as argument + utför skriptfilen, given som argument + + + Help + Hjälp + + + <b> %1 </b>: Wrong locale option or no translation available! + <b> %1 </b>; Fel lokaliseringsalternativ eller så finns ingen översättning! + + + <b> %1 </b> unknown command line option! + <b> %1 </b> okänt kommandoradsval! + + + <b>%1</b> is a directory, please specify a file name! + <b>%1</b> är en mapp, specificera ett filnamn! + + Please select exactly one column and more than one non empty cell! Välj exakt en kolumn och mer än en icke tom cell! @@ -1108,23 +3724,18 @@ AddWidgetTool - Click on plot to choose the position of the new object! Klicka på i diagram för att välja läge för det nya objektet! - - enter your text here skriv in din text här - Move cursor in order to resize the new rectangle! Flytta markör för att skala om den nya rektangeln! - Move cursor in order to resize the new ellipse! Flytta markör för att ändra storlek på den nya ellipsen! @@ -1132,47 +3743,28 @@ ApplicationWindow + File %1 contains only %2 sheets, operation aborted! + + + + Sheet %1 is empty, operation aborted! + + + + sheet + + + + QtiPlot was built without libxls support! + + + <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> <font size=+2, color=darkBlue><b>QtiPlot är öppenkällprogramvara och utvecklingen av den har krävt hundratals timmars arbete.<br><br> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QtiPlot - Error QtiPlot - Fel @@ -1185,129 +3777,78 @@ <b> %1 </b>: Okänt alternativ för kommandoraden eller filen finns ej! - - Project Explorer Projektutforskare - - - Folder Mapp - UNTITLED NAMNLÖS - - Name Namn - - - - - - - - - Type Typ - - View Vy - - - - - Size Storlek - - - - - - Created Skapad - - - Label Etikett - - Results Log Resultatlogg - - Scripting Console Skriptkonsol - - File Arkiv - - Edit Redigera - - Plot Rita - Disable &tools - Stäng av verk&tyg + Stäng av verk&tyg - - &Zoom In &Zooma in - - Ctrl++ Ctrl++ - Zoom &Out - Z&ooma ut + Z&ooma ut - - Ctrl+- Ctrl+- @@ -1316,8 +3857,6 @@ &Dataläsare - - CTRL+D CTRL+D @@ -1326,8 +3865,6 @@ &Välj dataområde - - ALT+S ALT+V @@ -1336,86 +3873,54 @@ S&kärmläsare - - &Move Data Points... &Flytta datapunkter... - - Ctrl+ALT+M Ctrl+ALT+F - - Remove &Bad Data Points... Tag bort &dåliga datapunkter... - - Alt+B Alt+D - - Add &Text Lägg till &text - - ALT+T ALT+T - - Draw &Arrow Rita &pil - - CTRL+ALT+A CTTRL+ALT+P - - Draw &Line Rita &linje - - CTRL+ALT+L STRL+ALT+L - - - - - - - - Table Tabell - - Data Display Datavisning - - QtiPlot - untitled QtiPlot - namnlös @@ -1424,7 +3929,6 @@ Yt-3D - &New &Ny @@ -1433,7 +3937,6 @@ Aktuella p&rojekt - &Export Graph &Exportera diagram @@ -1442,22 +3945,14 @@ &Importera ASCII - - - Special Line/Symb&ol Särskild linje/symb&ol - - - Statistical &Graphs Statistiska dia&gram - - Pa&nel Pa&nel @@ -1466,9 +3961,6 @@ Plotta 3&D - - - &Normalize &Normalisera @@ -1481,66 +3973,50 @@ &Fyll kolumn med - &Translate - &Förskju&t + &Förskju&t - &Smooth &Jämna ut - &FFT filter &FFT-filter - Fit E&xponential Decay Anpassa e&xponetiellt avtagande - Fit &Multi-peak Anpassa &flera toppar - - - - &Columns - &Kolumner + &Kolumner - &File &Arkiv - &Edit &Redigera - &View &Betrakta - &Graph Dia&gram - - &Data &Data - &Analysis Anal&ys @@ -1549,16 +4025,10 @@ For&mat: - - - &Plot &Diagram - - - &Table &Tabell @@ -1567,84 +4037,26 @@ &Plot3D - &Matrix &Matris - &Windows &Fönster - - - &Help &Hjälp - - - - - - - QtiPlot - Plot error QtiPlot - Plottfel - - - - - You must select exactly one column for plotting! Du måste välja exakt en kolumn för plottning! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QtiPlot - Warning QtiPlot - Varning @@ -1653,26 +4065,18 @@ Denna åtgärd kan ej utföras på kurvor ritade från kolumner med ett icke-numeriskt format. - - <h4>There are no tables available in this project.</h4><p><h4>Please create a table and try again!</h4> <h4> Det finns inga tabell tillgängliga i detta projekt.</h4><p><h4>Skapa en tabell och försök igen!</h4> - There are no available columns with plot designation set to Z! Det finns inga tillgängliga kolumner med plotmål satta till Z! - - - QtiPlot - Choose data set QtiPlot - Välj datamängd - - QtiPlot - Choose matrix to plot QtiPlot - Välj matris för plottning @@ -1681,24 +4085,14 @@ <h4>Det finns inga matriser tillgängliga i detta projekt.</h4><p><h4>Skapa en matris och försök igen!</h4> - - - - - - - - Matrix Matris - QtiPlot - Import image from file QtiPlot - Importera bild från fil - QtiPlot - Load image from file QtiPlot - Ladda bild från fil @@ -1715,9 +4109,6 @@ diagram1 - - - Please select a Y column to plot! Välj en Y-kolumn för plottning! @@ -1730,14 +4121,10 @@ pixelintensitet ("a.u.") - - The table '%1' already exists. It has been renamed '%2'. Tabellen '%1' finns redan. Den har bytt namn till '%2'. - - Note Notera @@ -1746,63 +4133,30 @@ Matrisen '%1' finns redan. Den har bytt namn till '%2'. - Determinant of Determinant av - - - - - - - - - - - - - - - - - <h4>There are no plot layers available in this window.</h4><p><h4>Please add a layer and try again!</h4> <h4<Det finns inga plottlager i detta fönster.</h4><p><h4>Lägg till ett lager och försök igen!</h4> - - - - - - - - - - This functionality is not available for pie plots! Denna egenskap är inte tillgänglig för pajdiagram! - QtiPlot - Error bars error QtiPlot - Felstavsfel - - This feature is not available for user defined function curves! Denna egenskap är inte tillgänglig för användardefinierade funktionskurvor! - The selected columns have different numbers of rows! De valda kolumnerna har olika antal rader! - The selected error column is empty! Den valda felkolumnen är tom! @@ -1815,7 +4169,6 @@ Text - Data Data @@ -1828,16 +4181,12 @@ QtiPlot - Importera ASCII-fil - - QtiPlot project - QtiPlot-projekt + QtiPlot-projekt - - Compressed QtiPlot project - Komprimerat QtiPlot-projekt + Komprimerat QtiPlot-projekt Origin project @@ -1848,107 +4197,60 @@ QtiPlot - Öppna projekt - - - - - - - QtiPlot - File openning error - QtiPlot - Filöppningsfel + QtiPlot - Filöppningsfel - The file: <b>%1</b> is the current file! - Filen: <b>%1</b> är den nuvarande filen! + Filen: <b>%1</b> är den nuvarande filen! - - - - The file: <b>%1</b> doesn't exist! - Filen: <b>>%1</b> saknas! + Filen: <b>>%1</b> saknas! - The file: <b>%1</b> is not a QtiPlot or Origin project file! Filen: <b>%1</b>är inte en QtiPLot- eller Origin-projektfil! - - - - - - - - QtiPlot - File opening error - QtiPlot - Filöppningsfel + QtiPlot - Filöppningsfel - The file <b>%1</b> is corrupted, but there exists a backup copy.<br>Do you want to open the backup instead? - Filen <b>%1</b> är förstörd. men det finns en säkerhetskopia.<br>Vill du öppna denna i stället? + Filen <b>%1</b> är förstörd. men det finns en säkerhetskopia.<br>Vill du öppna denna i stället? - - The file: <b> %1 </b> was not created using QtiPlot! - Filen:<b>%1</b> skapades inte av QtiPlot! + Filen:<b>%1</b> skapades inte av QtiPlot! - QtiPlot - File Open Error - QtiPlot - Filöppningsfel + QtiPlot - Filöppningsfel - The file: <b> %1 </b> <p>does not exist anymore!<p>It will be removed from the list. - Filen: <b>%1</b>finns inte längre!<p>Den kommer att tas bort från listan. + Filen: <b>%1</b>finns inte längre!<p>Den kommer att tas bort från listan. The file: <b> %1 </b> is the current file! Filen: <b> %1 </b> är den nuvarande filen! - - - - - - - - - - - - - - - - - - QtiPlot QtiPlot - Window - Fönster + Fönster - QtiPlot - Opening file - QtiPlot - Filöppning + QtiPlot - Filöppning - QtiPlot - Open Template File - QtiPlot - Öppna mallfil + QtiPlot - Öppna mallfil table1 @@ -1959,73 +4261,52 @@ Matris1 - The file: <b>%1</b> is not a QtiPlot template file! - Filen: <b>%1</b>är inte en QtiPlot mallfil! + Filen: <b>%1</b>är inte en QtiPlot mallfil! - <h4>There are no plot layers available in this window!</h4> - <h4>Det finns inga lager tillgängliga i detta fönster!</h4> + <h4>Det finns inga lager tillgängliga i detta fönster!</h4> QtiPlot - Overwrite File? QtiPlot - Skriva över fil? - - A file called: <p><b>%1</b><p>already exists. Do you want to overwrite it? - En fil med namn: <p><b>%1</b><p>finns redan! Vill du skriva över den? + En fil med namn: <p><b>%1</b><p>finns redan! Vill du skriva över den? - - &Yes - &Ja + &Ja - &No &Nej - QtiPlot - Export Error - QtiPlot - Export-fel + QtiPlot - Export-fel - - - - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! - Kunde inte skriva till filen: <br><h4> %1 </h4><p>Verifiera att du har rättighet att skriva på denna plats! + Kunde inte skriva till filen: <br><h4> %1 </h4><p>Verifiera att du har rättighet att skriva på denna plats! - - - &All - &Allt + &Allt - - - &Cancel - &Avbryt + &Avbryt - Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! - Kunde inte skriva till filen: <br><h4> %1 </h4><p>Verifiera att du har rättighet att skriva på denna plats! + Kunde inte skriva till filen: <br><h4> %1 </h4><p>Verifiera att du har rättighet att skriva på denna plats! - Save Project As - Spara projekt som + Spara projekt som QtiPlot -- Overwrite File? @@ -2038,49 +4319,38 @@ Vill du skriva över den? - QtiPlot Matrix Template - QtiPlot - Matrismall + QtiPlot - Matrismall QtiPlot 2D Plot Template QtiPlot - 2D-diagramsmall - QtiPlot Table Template - QtiPlot - Tabellmall + QtiPlot - Tabellmall - QtiPlot 3D Surface Template - QtiPlot - 3D-ytdiagramsmall + QtiPlot - 3D-ytdiagramsmall - Save Window As Template - Spara fönster som mall + Spara fönster som mall - - Please enter a valid name! - Mata in ett giltigt namn! + Mata in ett giltigt namn! - The name you chose is not valid: only letters and digits are allowed! - Namnet du valt är ej giltigt: endast bokstäver och siffror tillåtna! + Namnet du valt är ej giltigt: endast bokstäver och siffror tillåtna! - - - Please choose another name! - Mata in ett annat namn! + Mata in ett annat namn! - Name already exists! Namnet finns redan! @@ -2109,78 +4379,48 @@ Välj en mapp att exportera tabellerna till - Choose a filename to save under - Välj ett filnamn att spara under + Välj ett filnamn att spara under - QtiPlot - Enter rows number - QtiPlot - Mata in antal rader + QtiPlot - Mata in antal rader - Rows - Rader + Rader - QtiPlot - Enter columns number - QtiPlot - Mata in antal kolumner + QtiPlot - Mata in antal kolumner - Columns - Kolumner + Kolumner - - - - - - - - - - - - QtiPlot - Column selection error QtiPlot - Kolumnvalsfel - - - - - Please select a column first! - Välj en kolumn först! + Välj en kolumn först! - QtiPlot - Row selection error - QtiPlot - Radvalsfel + QtiPlot - Radvalsfel - Please select a row first! - Välj en rad först! + Välj en rad först! - - &Line - &Linje + &Linje - - - - &Scatter - S&pridning + S&pridning Line + s&ymbol @@ -2191,34 +4431,24 @@ Vertikala &droplinjer - - &Spline - Anpa&ssad kurva + Anpa&ssad kurva - - &Vertical Steps - &Vertikala steg + &Vertikala steg - - &Rows - &Rader + &Rader - - &Area - Yt&a + Yt&a - - &Pie - &Paj + &Paj 3D Ribbo&n @@ -2237,42 +4467,24 @@ 3D-Spå&r - - &Histogram - &Histogram + &Histogram &Stacked Histograms &Staplade histogram - - - - - - Cu&t - Klipp u&t + Klipp u&t - - - - - - - - &Copy - &Kopiera + &Kopiera - - Past&e - Klistra &in + Klistra &in X @@ -2303,10 +4515,8 @@ Sätt som - - Recalculate - Räkna om + Räkna om Set column &values... @@ -2317,90 +4527,64 @@ &Fyll kolumn med - &Column - &Kolumn + &Kolumn - - - - Clea&r - &Rensa + &Rensa - - - - - &Delete - &Tag bort + &Tag bort - - &Insert - Sätt &in + Sätt &in &Add column &Lägg till kolumn - &Ascending - &Stigande + &Stigande - &Descending - &Fallande + &Fallande - Sort Colu&mn - Sortera kolu&mn + Sortera kolu&mn Vectors &XYXY Vektorer &XYXY - - &Vertical 2 Layers - &Vertikalt 2 lager + &Vertikalt 2 lager - - &Horizontal 2 Layers - &Horisontellt 2 lager + &Horisontellt 2 lager - - &4 Layers - &4 Lager + &4 Lager - - &Stacked Layers - &Staplade lager + &Staplade lager - Not available for empty 3D surface plots! - Inte tillgängligt för tomma 3D-ytdiagram! + Inte tillgängligt för tomma 3D-ytdiagram! - - &Worksheet - &Arbetsblad + &Arbetsblad QtiPlot - Empty plot @@ -2411,53 +4595,38 @@ Det finns faktiskt inga kurvor på det aktiva lagret! - - - - <h4>There are no plot layers available in this window.</h4> - <h4>Det finns inga diagramlager tillgängliga i deta fönster.</h4> + <h4>Det finns inga diagramlager tillgängliga i deta fönster.</h4> - - This will modify the data in the worksheets! Are you sure you want to continue? - Detta kommer att förändra data i arbetsbladen! + Detta kommer att förändra data i arbetsbladen! är du säker på att du vill fortsätta? - - Continue - Fortsätt + Fortsätt - - - Cancel - Avbryt + Avbryt - - There are no curves available on this plot! Det finns inga kurvor tillgängliga på detta diagram! - Sorry, there are no results to display! - Tyvärr, det finns inga resultat att visa upp! + Tyvärr, det finns inga resultat att visa upp! Click on plot or move cursor to display coordinates! Klicka på diagram eller fluytta markör för att visa upp koordinater! - There are no plot layers available in this window! - Det finns inga diagramlager tillgängliga i detta fönster! + Det finns inga diagramlager tillgängliga i detta fönster! Click on data point to display information! @@ -2480,38 +4649,32 @@ På &aktivt lager - Images Bilder - QtiPlot - Insert image from file - QtiPlot - Skjut in bild från fil + QtiPlot - Skjut in bild från fil - There are no plot layers available in this window. - Det finns inga diagramlager tillgängliga i detta fönster. + Det finns inga diagramlager tillgängliga i detta fönster. QtiPlot - Layer Geometry QtiPlot - Lagergeometri - QtiPlot - Duplicate error - QtiPlot - Dupliseringslfel + QtiPlot - Dupliseringslfel - Empty 3D surface plots cannot be duplicated! - Tomma 3D-ytdiagram kan ej dupliseras! + Tomma 3D-ytdiagram kan ej dupliseras! - QtiPlot - Duplicate window error - QtiPlot - Dupliseringslfönsterfel + QtiPlot - Dupliseringslfönsterfel There are no windows available in this project! @@ -2522,19 +4685,16 @@ QtiPlot - Fönstergeometri - About QtiPlot - Om QtiPlot + Om QtiPlot - &Cascade - &Kaskad + &Kaskad - &Tile - &Bricka + &Bricka &Next @@ -2545,110 +4705,76 @@ &Föregående - - - - &Hide Window - Döl&j fönster + Döl&j fönster - - - Close &Window - &Stäng fönster + &Stäng fönster - - More windows... - Fler fönster... + Fler fönster... &View pixel line profile &Betrakta pixelradsprofil - &Intensity Matrix - &Intensitetsmatris + &Intensitetsmatris - &Cut - Klipp &ut + Klipp &ut - - - - &Properties... - &Egenskaper... + &Egenskaper... - Please use the project explorer to select a window! - Använd projektutforskaren till att välja ett fänster! + Använd projektutforskaren till att välja ett fänster! - Normal - Normal + Normal - Save changes to project: <p><b> %1 </b> ? - Spara ändringar till projekt: <p><b> %1 </b><p> ? + Spara ändringar till projekt: <p><b> %1 </b><p> ? - - Yes - Ja + Ja - - No - Nej + Nej - - - &Delete Selection - &Tag bort det valda + &Tag bort det valda - - New &Window - Nytt &fönster + Nytt &fönster - - New F&older - Ny m&app + Ny m&app - Auto &Column Width - Automatisk &kolumnbredd + Automatisk &kolumnbredd - &Delete Window - &Tag bort fönster + &Tag bort fönster - - - &Rename Window - &Döp om fönster + &Döp om fönster D&epending Plots @@ -2659,22 +4785,16 @@ B&eroende 3D-diagram - - - D&epends on - B&eror på + B&eror på - Function - Funktion + Funktion - - Maximized - Maximerad + Maximerad Re&move pie curve @@ -2701,148 +4821,112 @@ &Klistrar in bild - - - &Layer - &Lager + &Lager - - - &Window - &Fönster + &Fönster - E&xport - E&xportera + E&xportera - - - &Print - &Skriv ut + &Skriv ut &Geometry... &Geometri... - P&roperties... - E&genskaper... + E&genskaper... &Delete Layer &Tag bort lager - - &Paste Layer - &Klistra in lager + &Klistra in lager - &Copy Page - &Kopiera sida + &Kopiera sida - E&xport Page - E&xportera sida + E&xportera sida &Plot 3D &Rita 3D - &Matrix... - &Matris... + &Matris... - Choose &Data Set... - Välj &datamängd... + Välj &datamängd... - Choose &Matrix... - Välj &matris... + Välj &matris... - C&lear - &Rensa + &Rensa - &Copy Graph - &Kopiera diagram + &Kopiera diagram - &Export - E&xportera + E&xportera - - - - &Paste - Klistra &in + Klistra &in - - &Insert Row - Sätt &in rad + Sätt &in rad - - &Delete Rows - &Tag bort rader + &Tag bort rader - &Insert Column - Sätt &in kolumn + Sätt &in kolumn - &Delete Columns - &Tag bort kolumn + &Tag bort kolumn - &Delete Row - &Tag bort rad + &Tag bort rad - Clea&r Row - &Rensa rad + &Rensa rad - Clea&r Rows - &Rensa rader + &Rensa rader - QtiPlot - index.html File Not Found! - QtiPlot - Index.html-fil ej funnen! + QtiPlot - Index.html-fil ej funnen! - There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! - Det finns igne fil kallad <b>index.html</b> i denna mapp. <br>Välj en annan mapp! + Det finns igne fil kallad <b>index.html</b> i denna mapp. <br>Välj en annan mapp! Print @@ -2861,11 +4945,8 @@ Hem - - - QtiPlot - Help Files Not Found! - QtiPlot - Hjälpfiler inte hittade! + QtiPlot - Hjälpfiler inte hittade! Please indicate the location of the help file!<br><br><p>The manual can be downloaded from the following internet address:</p><p><font color=blue>'http://soft.proindependent.com/manuals.html'</font></p> @@ -2876,174 +4957,130 @@ QtiPlot - Hjälpbläddrare - QtiPlot - Edit function - QtiPlot - Redigera funktion + QtiPlot - Redigera funktion - QtiPlot - Set the number of pixels to average - QtiPlot - Sätt antal pixlar för medelvärdesbildning + QtiPlot - Sätt antal pixlar för medelvärdesbildning - Number of averaged pixels - Antal medelvärdesbildade pixlar + Antal medelvärdesbildade pixlar - QtiPlot - Guess best origin for the new layer? - QtiPlot - Gissa bästa ursprung för det nya lagret? + QtiPlot - Gissa bästa ursprung för det nya lagret? - Do you want QtiPlot to guess the best position for the new layer? Warning: this will rearrange existing layers! - Vill du att QtiPlot skall gissa positionen för det nya lagret? + Vill du att QtiPlot skall gissa positionen för det nya lagret? Varning: detta kommer att arrangera om befintliga lager! - &Guess - &Gissa + &Gissa - &Top-left corner - &Övre vänstra hörnet + &Övre vänstra hörnet - Minimized - Minimerad + Minimerad Curve: Kurva: - - - New &Project - Nytt &projekt + Nytt &projekt - - Ctrl+N - Ctrl+N + Ctrl+N - - New &Graph - Nytt dia&gram + Nytt dia&gram - - Ctrl+G - Ctrl+G + Ctrl+G - - New &Note - Ny a&nteckning + Ny a&nteckning - - New &Table - Ny &tabell + Ny &tabell - - Ctrl+T - Ctrl+T + Ctrl+T - - New &Matrix - Ny &matris + Ny &matris - - Ctrl+M - Ctrl+M + Ctrl+M - - New &Function Plot - Nytt &funktionsdiagram + Nytt &funktionsdiagram - - Ctrl+F - Ctrl+F + Ctrl+F New &Surface 3D Plot Nytt 3D-&ytdiagram - - Ctrl+ALT+Z - Ctrl+Alt+Z + Ctrl+Alt+Z - - &Open - &Öppna + &Öppna - - Ctrl+O - Ctrl+O + Ctrl+O Open image &file Öppna bild&fil - - Ctrl+I - Ctrl+I + Ctrl+I Import i&mage... Importera b&ild... - - &Save Project - Spara pro&jet + Spara pro&jet - - Ctrl+S - Ctrl+S + Ctrl+S Save Project &as... Spara pr&ojekt som... - Open Temp&late... - Öppna Ma&ll... + Öppna Ma&ll... Save as &Template... @@ -3058,62 +5095,48 @@ &Flera filer... - - &Undo - &Ångra + &Ångra - - Ctrl+Z - Ctrl+Z + Ctrl+Z - - &Redo - Gö&r om + Gö&r om Ctrl+R - Ctrl+R + Ctrl+R - - &Duplicate - D&uplicera + D&uplicera Cu&t selection Klipp &ut det valda - - Ctrl+X - Ctrl+X + Ctrl+X &Copy selection Kopiera &in det valda - - Ctrl+C - Ctrl+C + Ctrl+C &Paste selection &Klistra in det valda - - Ctrl+V - Ctrl+V + Ctrl+V &Delete selection @@ -3128,91 +5151,68 @@ Projektutforskar&e - - Ctrl+E - Ctrl+E + Ctrl+E - Results &Log - Resultat&logg + Resultat&logg Scripting &Console &Konsol för skript - - Add La&yer - L&ägg till lager + L&ägg till lager - - ALT+L - ALT+L + ALT+L - - Arran&ge Layers - Arran&gera lager + Arran&gera lager ALT+A ALT+A - - &Current - &Aktuellt + &Aktuellt Alt+G Alt+G - - Alt+X - Alt+X + Alt+X - - Ctrl+P - Ctrl+P + Ctrl+P - - Print All Plo&ts - Skriv u&t alla diagram + Skriv u&t alla diagram - - E&xport ASCII - Ex&portera ASCII + Ex&portera ASCII Set import &options Ställ in imp&ortalternativ - - &Quit - &Avsluta + &Avsluta - - Ctrl+Q - Ctrl+Q + Ctrl+Q Clear &log information @@ -3227,481 +5227,332 @@ Diagram&hjälp - - Ctrl+Alt+W - Ctrl+Alt+W + Ctrl+Alt+W - - &Preferences... - &Inställningar... + &Inställningar... - - Add/Remove &Curve... - Lägg till/tag bort &kurva... + Lägg till/tag bort &kurva... - - ALT+C - ALT+C + ALT+C - - Add &Error Bars... - Lägg till f&elstaplar... + Lägg till f&elstaplar... - - Ctrl+B - Ctrl+B + Ctrl+B - - Add &Function... - Lägg till &funktion... + Lägg till &funktion... - - - - Ctrl+Alt+F - Ctrl+Alt+F + Ctrl+Alt+F &Rescale to show all Skala om fö&r att visa allt - - - Ctrl+Shift+R - Ctrl+Shift+R + Ctrl+Shift+R - - New &Legend - Ny &beskrivning + Ny &beskrivning - - Ctrl+L - Ctrl+L + Ctrl+L Add time stamp Lägg till tidstämpel - - Ctrl+ALT+T - Ctrl+ALT+T + Ctrl+ALT+T - - Add &Image - Lägg till b&ild + Lägg till b&ild - - ALT+I - ALT+I + ALT+I - - Line + S&ymbol - Linje + s&ymbol + Linje + s&ymbol - - Vectors XY&AM - Vektorer XYA&M + Vektorer XYA&M - &Vectors &XYXY - &Vektorer &XYXY + &Vektorer &XYXY - - &Stacked Histogram - &Staplade histogram + &Staplade histogram - - &Ribbon - &Band + &Band - - &Bars - &Staplar + &Staplar - - &Trajectory - Spå&r + Spå&r - - Statistics on &Columns - Statistik för &kolumner + Statistik för &kolumner - - Statistics on &Rows - Statistik för &rader + Statistik för &rader &Integrate ... &Integrering... - - Inte&rpolate ... - Inte&rpolering... + Inte&rpolering... - - &Low Pass... - &Lågpass... + &Lågpass... - - &High Pass... - &Högpass... + &Högpass... - - &Band Pass... - &Bandpass... + &Bandpass... - - &Band Block... - &Bandspärr... + &Bandspärr... - - &FFT... - &FFT... + &FFT... - - &Savitzky-Golay... - &Savitzky-Golay... + &Savitzky-Golay... - - &FFT Filter... - &FFT-filter... + &FFT-filter... - - Moving Window &Average... - Flytt&ar fönstermedelvärdesbildning... + Flytt&ar fönstermedelvärdesbildning... - - &Differentiate - &Differentieria + &Differentieria - - Fit &Linear - Anpassa &linjärt + Anpassa &linjärt - - Fit &Polynomial ... - Anpassa &polynom ... + Anpassa &polynom ... - - &First Order ... - &Första ordningens ... + &Första ordningens ... - - &Second Order ... - &Andra ordningens ... + &Andra ordningens ... - - &Third Order ... - &tredje ordningens ... + &tredje ordningens ... - - Fit Exponential Gro&wth ... - Anpassa exponetiell till&växt ... + Anpassa exponetiell till&växt ... - - Fit &Boltzmann (Sigmoidal) - Anpassa &Boltzmann (Sigmoidal) + Anpassa &Boltzmann (Sigmoidal) - - Fit &Gaussian - Anpassa &Gaussiskt + Anpassa &Gaussiskt - - Fit Lorent&zian - Anpassa Lorent&ziskt + Anpassa Lorent&ziskt &Non-linear Curve Fit ... &Icke-linjär kurvanpassning ... - - Ctrl+Y - Ctrl+Y + Ctrl+Y - - &Plot ... - &Diagram ... + &Diagram ... &Curves ... &Kurvor ... - - &Scales... - &Skalor... + &Skalor... - - &Axes... - &Axlar... + &Axlar... - - &Grid ... - &Rutnät... + &Rutnät... - - &Title ... - &Titel ... + &Titel ... - - Column &Options ... - K&olumnalternativ ... + K&olumnalternativ ... - - Set Column &Values ... - Sätt kolumn&värden ... + Sätt kolumn&värden ... - - &Columns... - &Kolumner... + &Kolumner... - - &Rows... - &Rader... + &Rader... - - &About QtiPlot - &Om QtiPlot + &Om QtiPlot - - F1 - F1 + F1 - - Ctrl+H - Ctrl+H + Ctrl+H &Choose help folder... &Välj hjälpmapp... - - Ctrl+W - Ctrl+W + Ctrl+W Add column Lägg till kolumn - - &Remove Layer - &Tag bort lager + &Tag bort lager - - Alt+R - Alt+R + Alt+R - - Window &Geometry... - Fönster&geometri... + Fönster&geometri... &Intensity table &Intensitetstabell - - - - &Properties - &Egenskaper + &Egenskaper - - &Activate Window - &Aktiver fönster + &Aktiver fönster - - Mi&nimize Window - Mi&nimera fönster + Mi&nimera fönster - - Ma&ximize Window - Ma&ximera fönster + Ma&ximera fönster - - Re&size Window... - Ändra fönster&storlek... + Ändra fönster&storlek... - &Print Window - &Skriv ut fönster + &Skriv ut fönster &Layer geometry &Lagergeometri - - &Surface... - &Yt... + &Yt... - - &Data Set... - &Data mängd... + &Data mängd... - - Set &Properties... - Ställ in egenska&per... + Ställ in egenska&per... - - Set &Dimensions... - Ställ in &dimensioner... + Ställ in &dimensioner... - - Set &Values... - Ställ in &värden... + Ställ in &värden... - - &Transpose - &Transponera + &Transponera - - &Invert - &Invertera + &Invertera - - &Determinant - &Determinant + &Determinant &Convert to spreadsheet @@ -3712,161 +5563,108 @@ Omvandla till &matris - - 3D &Wire Frame - 3D-t&rådram + 3D-t&rådram - - 3D &Hidden Line - 3D &Dold linje + 3D &Dold linje - - 3D &Polygons - 3D &Polygoner + 3D &Polygoner - - 3D Wire &Surface - 3D Tråd&yta + 3D Tråd&yta - - Sort Ta&ble - Sortera ta&bell + Sortera ta&bell - - Sort Columns - Sortera kolumner + Sortera kolumner - - Co&rrelate - K&orrelera + K&orrelera - - &Convolute - Fa&lta + Fa&lta - - &Deconvolute - O&mfalta + O&mfalta - - &Horizontal - &Horisontell + &Horisontell - - &Vertical - &Vertikal + &Vertikal - - Ro&w Numbers - Ra&dnummer + Ra&dnummer &Random values &Slumptal - - - &X - &X + &X - - - &Y - &Y + &Y - - - &Z - &Z + &Z - - - X E&rror - X-f&el + X-f&el - - - Y &Error - Y-&fel + Y-&fel - - &None - &Inget + &Inget - - &Box Plot - &Låddiagram + &Låddiagram - - &Gaussian... - &Gaussiskt... + &Gaussiskt... - - &Lorentzian... - &Lorentziskt... + &Lorentziskt... - - Search for &Updates - Leta efter &uppdateringar + Leta efter &uppdateringar - - &QtiPlot Homepage - &QtiPlots Hemsida + &QtiPlots Hemsida Download &manual Ladda ner hand&bok - - &Translations - Ö&versätttningar + Ö&versätttningar Make a &donation @@ -3877,52 +5675,44 @@ Teknisk &stöd - Open a new project - Öppna ett nytt projekt + Öppna ett nytt projekt - Create an empty 2D plot - Skapa ett tomt 2D-diagram + Skapa ett tomt 2D-diagram - Create an empty note window - Skapa ett tomt anteckningsfönster + Skapa ett tomt anteckningsfönster New Table Ny tabell - New matrix - Ny matris + Ny matris - Create a new 2D function plot - Skapa ett nytt 2D-funktionsdiagram + Skapa ett nytt 2D-funktionsdiagram - Create a new 3D surface plot - Skapa ett nytt 3D-ytdiagram + Skapa ett nytt 3D-ytdiagram - Open project - Öppna projekt + Öppna projekt Save Project Spara projekt - Open Te&mplate... - Öppna &mall... + Öppna &mall... Open Template @@ -3941,88 +5731,72 @@ Importera flera datafiler - Undo changes - Ångra ändringar + Ångra ändringar - Redo changes - Gör om ändringar + Gör om ändringar - Duplicate window - Duplicera fönster + Duplicera fönster - Cut selection - Klipp ut det valda + Klipp ut det valda - Copy selection - Kopiera det valda + Kopiera det valda - Paste selection - Klistra in det valda + Klistra in det valda - Delete selection - Tag bort det valda + Tag bort det valda - Show project explorer - Visa projektutforskaren + Visa projektutforskaren Show calculus results Visa beräkningsresultat - &Console - &Konsol + &Konsol - Show Scripting console - Visa konsol för skript + Visa konsol för skript - Export current graph - Exportera aktuellt diagram + Exportera aktuellt diagram - Export all graphs - Exportera alla diagram + Exportera alla diagram - Print window - Skriv ut fönster + Skriv ut fönster - Add curve to graph - Lägg till kurva till diagram + Lägg till kurva till diagram - Best fit - Bästa anpassning + Bästa anpassning - Add new legend - Lägg till ny beskrivning + Lägg till ny beskrivning Date & Time @@ -4041,39 +5815,32 @@ Rita med linjer + symboler - Plot with vertical bars - Rita med vertikala staplar + Rita med vertikala staplar - Plot with horizontal bars - Rita med horisontella staplar + Rita med horisontella staplar - Plot area - Rita yta + Rita yta - Plot pie - Rita paj + Rita paj - &Vectors XYXY - &Vektorer XYXY + &Vektorer XYXY - Vectors XYXY - Vektorer XYXY + Vektorer XYXY - Vectors XYAM - Vektorer XYAM + Vektorer XYAM Plot 3D Ribbon @@ -4092,14 +5859,12 @@ Rita 3D-spår - Selected columns statistics - Valda kolumners statistik + Valda kolumners statistik - Selected rows statistics - Valda raders statistik + Valda raders statistik &Curves... @@ -4110,54 +5875,44 @@ Låd- och morrhårsdiagram - Pointer - Pekare + Pekare - Zoom In - Zooma in + Zooma in - Zoom Out - Zooma ut + Zooma ut - Data reader - Dataläsare + Dataläsare - Select data range - Välj dataområde + Välj dataområde - Screen reader - Skärmläsare + Skärmläsare - Move data points - Flytta datapunkter + Flytta datapunkter - Remove data points - Tab bort datapunkter + Tab bort datapunkter - Draw arrow - Rita pil + Rita pil - Draw line - Rita linje + Rita linje Coordinates @@ -4168,30 +5923,20 @@ &Koord - - - - Box - Låda + Låda - - - Frame - Ram + Ram - &Frame - &Ram + &Ram - - No Axes - Inga axlar + Inga axlar grid @@ -4226,54 +5971,32 @@ Diagramstil - - - - Wireframe - Trådram + Trådram - - Hidden Line - Dold linje + Dold linje - - Polygon only - Endast polygon + Endast polygon - - Mesh & filled Polygons - Nät & fyllda ploygoner + Nät & fyllda ploygoner - - - - Dots - Prickar + Prickar - - - - Bars - Staplar + Staplar - - - - Cones - Koner + Koner Cross Hairs @@ -4284,36 +6007,28 @@ Golvstil - - Floor Data Projection - Golvdataprojektion + Golvdataprojektion - - Floor Isolines - Isolinjer på golv + Isolinjer på golv - - Empty Floor - Tomt golv + Tomt golv Double-click on plot to select a data point! Dubbelklicka på diagram för att välja datapunkt! - QtiPlot - Enter the number of peaks - QtiPlot - Mata in antal toppar + QtiPlot - Mata in antal toppar - Peaks - Toppar + Toppar Move cursor and click to select a point and double-click/press 'Enter' to set the position of a peak! @@ -4328,7 +6043,6 @@ <teckensnittsstorlek=+2, färg=mörkblå><b>QtiPlot är en "open-source software" vars utveckling krävt hundratals timmars arbete.<br><br> Om du föredrar den, använder det i ditt arbete och om du vill se att det stadigt förbättras.<br> vänligen stöd dess författare genom en donation.<br><br> Vill du göra en donation till QtiPlot nu?</b></font> - Please support QtiPlot! Stöd QtiPlot! @@ -4345,7 +6059,6 @@ Nej, sluta med att störa mig! - <b> %1 </b>: Wrong locale option or no translation available! <b> %1 </b>; Fel lokaliseringsalternativ eller så finns ingen översättning! @@ -4354,7 +6067,6 @@ QtiPlot - Säkerhetskopieringsfel - Cannot make a backup copy of <b>%1</b> (to %2).<br>If you ignore this, you run the risk of <b>data loss</b>. Kan ej göra säkerhetskopiering av <b>%1</b> (till %2).<br>Om du ignorerar detta, riskerar du <b>dataförlust</b>. @@ -4363,97 +6075,70 @@ QtiPlot - Filsparningsfel - The file: <br><b>%1</b> is opened in read-only mode Filen: <br><b>%1</b> är redan öppnad i skrivskyddat läge - - - - &Find... &Leta... - - App&end Project... Lägg till proj&ekt... - Save &As Project... Sp&ara som projekt... - - Save Project &As... - Sp&ara projekt som... + Sp&ara projekt som... - - &Show All Windows - &Visa alla fönster + &Visa alla fönster - - &Hide All Windows - &Göm alla fönster + &Göm alla fönster - &Delete Folder &Tag bort mapp - &Rename &Döp om - &Windows in Active Folder &Fönster i aktiv mapp - Windows in &Active Folder && Subfolders &Fönster i aktiv mapp && undermappar - &View Windows &Visa fönster - Hidden Gömd - Project Projekt - - - Path Sökväg - bytes byte - - Contents Innehåll @@ -4466,29 +6151,22 @@ Mappar - Modified Ändrad - - - Properties Egenskaper - New Folder Ny mapp - QtiPlot - Delete folder? QtiPlot - Tag bort mapp? - Delete folder '%1' and all the windows it contains? Tag bort mapp '%1' och alla fönster den innehåller? @@ -4497,27 +6175,22 @@ Rita 3D - Status Status - QtiPlot - No match found QtiPlot - Ingen matchning hittad - Sorry, no match found for string: '%1' Ingen matchning hittad för strängen: '%1' - Cannot move an object to itself! Kan ej flytta ett objekt till sig självt! - Cannot move a parent folder into a child folder! Kan ej flytta en överordnad mapp till en av dess undermappar! @@ -4526,8 +6199,6 @@ Hoppar över mappflyttning - - The destination folder already contains a folder called '%1'! Folder skipped! Målmappen innehåller redan en mapp kallad '%1*! Mapped hoppas över! @@ -4536,27 +6207,22 @@ QtiPlot - HTTP hämta versionsfil - Error while fetching version file with HTTP: %1. Fel vid hämtning av versionsfil med HTTP: %1. - QtiPlot - No Updates Available QtiPlot - Ingen uppdatering tillgänglig - No updates available. Your current version %1 is the last version available! Ingen uppdatering tillgänglig. Din aktuell version %1 är den senaste! - QtiPlot - Updates Available QtiPlot - Uppdatering tillgänglig - There is a newer version of QtiPlot (%1) available for download. Would you like to download it? Det finns en nyare version av QtiPlot (%1) tillgänglig för nerladdning. Vill du ladda ner den? @@ -4567,25 +6233,10 @@ %2. - English Svenska - - - - - - - - - - - - - - Graph Diagram @@ -4598,52 +6249,42 @@ S&kriptning - <h4>There are no matrices available in this project.</h4><p><h4>Please create a matrix and try again!</h4> <h4>Det finns inga matriser tillgängliga i detta projekt.</h4><p><h4>Skapa en matris och försök igen!</h4> - - QtiPlot - Renamed Window QtiPlot - Omdöpt fönster - - - Notes Noteringar - The file "%1" was created using "%2" as scripting language. Initializing support for this language FAILED; I'm using "%3" instead. Various parts of this file may not be displayed as expected. - Filen "%1" ssskapades med "%2" som skript-språk. + Filen "%1" ssskapades med "%2" som skript-språk. Initiering av stöd för detta språk MISSLYCAKDES; jag använder "%3" i stället. Delar av denna fil kanske inte visas som väntat. - QtiPlot - Scripting Error - QtiPlot - Skriptningsfel + QtiPlot - Skriptningsfel - Scripting language "%1" failed to initialize. - Misslyckades med att initiera skript-språkrt "%1" . + Misslyckades med att initiera skript-språkrt "%1" . Get existing directory Hämta befintlig mapp - Choose a directory to export the graphs to - Välj en mapp för diagramexport + Välj en mapp för diagramexport Python Source @@ -4658,43 +6299,34 @@ Spara noteringar som... - QtiPlot 2D Graph Template - QtiPlot - 2D-diagrammall + QtiPlot - 2D-diagrammall - - &Edit Function... - R&edigera funktion... + R&edigera funktion... - - &Plot details... - &Diagramdetaljer... + &Diagramdetaljer... - D&epending Graphs - B&eroende diagram + B&eroende diagram - D&epending 3D Graphs - B&eroende 3D-diagram + B&eroende 3D-diagram &Graph 3D Rita 3D-dia&gram - Choose the location of the QtiPlot help folder! - Välj platsen för QtiPlots hjälpmapp! + Välj platsen för QtiPlots hjälpmapp! - Open File Öppna fil @@ -4703,88 +6335,58 @@ Alt+F4 - - Ctrl+Alt+O - Ctrl+Alt+O + Ctrl+Alt+O - - - - Ctrl+Return - Ctrl+vagnretur + Ctrl+vagnretur - - &Go to Row... - &Gå till rad... + &Gå till rad... - - - - Ctrl+Alt+G - Ctrl+Alt+G + Ctrl+Alt+G - - Clear - Rensa + Rensa - - Scripting &language - Skripts&pråk + Skripts&pråk - - &Restart scripting - Sta&rta om skriptning + Sta&rta om skriptning - - E&xecute - Ut&för + Ut&för - - Ctrl+J - Ctrl+J + Ctrl+J - - Execute &All - Utför &allt + Utför &allt - - Ctrl+Shift+J - Ctrl+Shift+J + Ctrl+Shift+J - - &Evaluate Expression - Utvärd&era uttryck + Utvärd&era uttryck &Python Script Window &Python-skriptfönster - - F3 F3 @@ -4797,280 +6399,202 @@ Rita 3D-diagram - This will clear the contents of all the data associated with the table. Are you sure? Detta kommer att rensa innehållet i alla data kopplat till tabellen. Är du säker? - QtiPlot - Enter row number QtiPlot - Mata in radnummer - Row Rad - QtiPlot - Script Window QtiPlot - Skriptfönster - - &Horizontal Steps - &Horisontella steg + &Horisontella steg - - - Automatic Layout - Automatisk layout + Automatisk layout - Contour - &Color Fill - Kontur - &färgfyllnad + Kontur - &färgfyllnad - - Contour &Lines - Kontur&linjer + Kontur&linjer - - &Gray Scale Map - &Gråskalekarta + &Gråskalekarta - Script Window - Skriptfönster + Skriptfönster - Add Layer - Lägg till lager + Lägg till lager - Arrange Layers - Arrangera lager - - - - Print preview - - - - + Arrangera lager + + Add Error Bars... - Lägg till felstaplar... + Lägg till felstaplar... - Add Function... - Lägg till funktion... + Lägg till funktion... - Add Image - Lägg till bild + Lägg till bild - Contour + &Color Fill - Kontur - &färgfyllnad + Kontur - &färgfyllnad - Contour Lines + Color Fill - Konturlinjer + färgfyllnad + Konturlinjer + färgfyllnad - Contour Lines - Konturlinjer + Konturlinjer - Gray Scale Map - Gråskalekarta + Gråskalekarta - Add Text - Lägg till text + Lägg till text - - - - Animation - Animering + Animering - - Matrix Plot Matrisdiagram - The file: <p><b> %1 </b><p> is the current file! - Filen: <p><b> %1 </b><p> är den aktuella! + Filen: <p><b> %1 </b><p> är den aktuella! There are no plot layers available in window <b> Det finns inga diagramlager tillgängliga i fönster <b> - Name <b>%1</b> already exists! - namnet <b>%1</b> finns redan! + namnet <b>%1</b> finns redan! - Warning: for internal consistency reasons the underscore character is replaced with a minus sign. - varning: av interna skäl byts understrykningstecknet mot minustecken. + varning: av interna skäl byts understrykningstecknet mot minustecken. <h2> <h2> - - QtiPlot - Help Profile Not Found! - QtiPlot - Hjälpprofil ej funnen! + QtiPlot - Hjälpprofil ej funnen! The assistant could not start because the file <b>%1</b> was not found in the help file directory!<p>This file is provided with the QtiPlot manual which can be downloaded from the following internet address:</p><p><font color=blue>'http://soft.proindependent.com/manuals.html'</font></p> Assistenten kunde inte startas ty filen <b>%1</b> fanns inte i hjälpmappen!<p> Denna fil kommer tillsammans med QtiPlot-handboken, som kan laddas ned från följande internetadress:</p><p><font color=blue>'http://soft.proindependent.com/manuals.html'</font></p> - Ctrl+K - Ctrl+K + Ctrl+K Ctrl+Alt+K Ctrl+Alt+K - - - - Alt+Q - Alt+Q + Alt+Q - - - - Enable perspective - Tillåt perspektiv + Tillåt perspektiv - - - - Reset rotation - Återställ rotation + Återställ rotation - - - - Fit frame to window - Anpassa ram till fönster + Anpassa ram till fönster - &Next next window &Nästa - F5 next window shortcut F5 - &Previous previous window &Föregående - F6 previous window shortcut F6 - Disable &Tools Koppla bort verk&tyg - &Zoom Out &Zooma ut - - &Data Reader &Dataläsare - - &Select Data Range &Välj dataområde - - S&creen Reader S&kärmläsare - - 3D Surface 3D-yta - - &Recent Projects Aktuella p&rojekt - 3&D Plot 3&D-diagram - Set Columns &As Sätt kolumn s&om - - &Fill Columns With &Fyll kolumn med @@ -5087,20 +6611,10 @@ Skriptning - - 3D &Plot 3D Dia&gram - - - - - - - - Column Kolumn @@ -5117,25 +6631,16 @@ Säkerhetsfiler - Script Error - Skriptningsfel + Skriptningsfel - Table1 - Tabell 1 + Tabell 1 - - - - - - - QtiPlot - Export error - QtiPlot - Fel vi export + QtiPlot - Fel vi export QtiPlot - Export @@ -5146,557 +6651,631 @@ Inga exportalternativ finns för 3D-diagram! - - QtiPlot - Overwrite file? - QtiPlot - Skriva över fil? + QtiPlot - Skriva över fil? - Please select two columns for this operation! - Välj två kolumner för denna åtgärd! + Välj två kolumner för denna åtgärd! - Please select exactly one columns for this operation! - Välj endast en kolumn för denna åtgärd! + Välj endast en kolumn för denna åtgärd! - - Please select two columns for this operation: the first represents the signal and the second the response function! - Välj två kolumner för denna åtgärd: + Välj två kolumner för denna åtgärd: den första representerar signalen och den andra svarsfunktionen! - - Vertical &Drop Lines - Vertikal &dropplinje + Vertikal &dropplinje - - Set As - Satt som + Satt som - &Fill Column With - &Fyll kolomn med + &Fyll kolomn med &Add Column &Lägg till kolumn - Could not write to file: <h4>%1</h4><p>Please verify that you have the right to write to this location or that the file is not being used by another application! - Kunde ej skriva till fil: <h4>%1</h4><p>verifiera att du har rätt att skriva till denna plats eller att filen inte utnyttjas av någon annan tillämpning! + Kunde ej skriva till fil: <h4>%1</h4><p>verifiera att du har rätt att skriva till denna plats eller att filen inte utnyttjas av någon annan tillämpning! - - Released - Släppt + Släppt - Re&move Pie Curve - Tag bort tårtdiagra&m + Tag bort tårtdiagra&m - Anal&yze - Anal&ysera + Anal&ysera - &Paste Text - &Klistra in ntext + &Klistra in ntext - &Paste Line/Arrow - &Klistra in rad/pil + &Klistra in rad/pil - &Paste Image - &Klistra in bild + &Klistra in bild - - Dra&g Curve - &Import &Importera - You must select a single Y column that has an associated X column! - You must select exactly one Z column! - + Couldn't open file %1 + + + + File %1 contains only %2 sheets! + + + + Open Excel File + + + Imported sound file - This is not a PCM type WAV file, operation aborted! - PCM - - Time Tid - Left Vänster - Right Höger - Channels - Sample Rate - Byte Rate - Block Align - Bits Per Sample - Presentation Preview - &Save &Spara - + Paste Selection as Te&xt + + + + Print preview of window: + + + There are no windows available in this folder! - - + Export + + + + &Indexed Colors + + + + Pale&tte + + + The manual can be downloaded from the following internet address: - Handboken kan laddas ner från följande internetadress: + Handboken kan laddas ner från följande internetadress: - - The assistant could not start because the file <b>%1</b> was not found in the help file directory! - Hjälpredan kunde inte startas ty filen <b>%1</b> kunde inte hittas i hjälpmappen! + Hjälpredan kunde inte startas ty filen <b>%1</b> kunde inte hittas i hjälpmappen! - - This file is provided with the QtiPlot manual which can be downloaded from the following internet address: - Denna fil kommer med QtoPlot-handboken, som kan laddas ner från följande internetadress: + Denna fil kommer med QtoPlot-handboken, som kan laddas ner från följande internetadress: - Please indicate the location of the help file! - Peka ut platsen för hjälpfilen! + Peka ut platsen för hjälpfilen! - Curve - Kurva + Kurva - - New 3D &Surface Plot - Nytt 3D-&ytdiagram - - - - + Nytt 3D-&ytdiagram + + + Ctrl+Shift+E + + + + Open ODF Spreads&heet... + + + Open Image &File - Öppna bild&fil + Öppna bild&fil - - Import I&mage... - I&mportera bildfil... - - - - + I&mportera bildfil... + + + Ctrl+Shift+S + + + Save As &Template... - Spara som &mall... + Spara som &mall... - Save Note As... - Spara anteckning som... + Spara anteckning som... - - &Sound (WAV)... - - + Ctrl+Alt+D + + + Cu&t Selection - Klipp u&t det valda + Klipp u&t det valda - - &Copy Selection - &Kopiera det valda + &Kopiera det valda - - &Paste Selection - K&listra in det valda + K&listra in det valda - - Del delete key - Tag bort + Tag bort - - Create Open &Document Presentation... - - &Export PDF - &Exportera PDF + &Exportera PDF - - Ctrl+Alt+P - Ctrl+Alt+P + Ctrl+Alt+P - - &Close - - Clear &Log Information - Nollställ &logginformation + Nollställ &logginformation - - Delete &Fit Tables - Tag &bort anpassningstabeller + Tag &bort anpassningstabeller - - Plot &Wizard - Diagram&hjälp + Diagram&hjälp - - &Rescale to Show All - Skala om fö&r att visa allt - - - - + Skala om fö&r att visa allt + + + Zoom &In/Out and Drag Canvas + + + + Zoom/Drag Canvas &Horizontally + + + + Zoom/Drag Canvas &Vertically + + + Add Time Stamp - Lägg till tidsstämpel - - - + Lägg till tidsstämpel + + + Stack &Bar + + + + Stack &Column + + + + &Waterfall Plot + + + + &Lowess... + + + + Fit Slop&e + + + + Ad&just Column Width + + + + &Upward + + + + &Downward + + + + &Image Profiles + + + + 2D &Binning + + + + &Regular XYZ + + + + Find &Next + + + + Find &Previous + + + + F4 + + + + Increase Indent + + + + Decrease Indent + + + + Rena&me Tab... + + + + A&dd Tab + + + + C&lose Tab + + + + Load Custom User &Interface... + + + + Increase Precision + + + + Decrease Precision + + + + Append a project to the current folder + + + + Ctrl+Alt+A + + + + Open Excel + + + + Print preview + + + + Plot stack bar + + + + Plot stack column + + + + Move current row upward + + + + Move current row downward + + + + Set optimal column width + + + + Alt+C + + + + Image Profiles + + + + Show find dialog + + + + Find Next + + + + Find Previous + + + + Show replace dialog + + + + Zoom In (Shift++) or Out (-) and Drag Canvas + + + + Zoom In/Out and Drag Canvas Horizontally + + + + Zoom In/Out and Drag Canvas Vertically + + + + Drag Curve + + + + Profiles + + + + Horizontal + Horisontell + + + Vertical + Vertikal + + + Make a donation + + + + show standalone scripting window + + + + execute the script file given as argument without displying the user interface. Warning: 2D plots are not correctly handled in this functioning mode! + + + + You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://soft.proindependent.com/download.html">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. + + + Memory Allocation Error Minnesallokeringsfel - Not enough memory, operation aborted! Ej tillräckligt med minne, uppgiften avbruten! - - Set Precision %1 digits + Choose custom user interface + + + + Custom user interfaces can be created using the QtDesigner application provided by the Qt framework + + + + For more details about how to use .ui files in your Python scripts please read the PyQt4 documentation + + + &Nonlinear Curve Fit ... Ickeli&njär kurvanpassning... - - &Choose Help Folder... - Väl&j hjälpmapp... + Väl&j hjälpmapp... - - - Add Column - Lägg till kolumn + Lägg till kolumn - - &View Pixel Line Profile - &Visa pixellinjeprofil + &Visa pixellinjeprofil - - &Intensity Table - &Intensitetstabell + &Intensitetstabell &Layer Geometry &Lagergeometri - &Convert to Spreadsheet - &Omvandla till kalkylblad + &Omvandla till kalkylblad - Convert to &Matrix Omvandla till &matris - - - &Lowess... - - - - - - 2D &Binning - - - - - - &Regular XYZ - - - - - + Open ODF Spreadsheet File + + + + QtiPlot was built without ODF spreadsheet support! + + + + Open Exce&l ... + + + &Autocorrelate - &Autokorrelera + &Autokorrelera - - &Random Values - &Slumptal + &Slumptal - QtiPlot &Forums - QtiPlot &Forum + QtiPlot &Forum - - Report a &Bug - Rapportera ett &fel + Rapportera ett &fel - - Download &Manual - Ladda ner &handbok + Ladda ner &handbok - - Make a &Donation - Gör en &donation + Gör en &donation - - Technical &Support - Teknisk &stöd - - - - - Find &Next - - - - - - Find &Previous - - - - - - F4 - - - - - + Teknisk &stöd + + &Replace... &Byt ut... - - - Increase Indent - - - - - - Decrease Indent - - - - - - Rena&me Tab... - - - - - - A&dd Tab - - - - - - C&lose Tab - - - - - &Script Window - &Skriptfönster + &Skriptfönster - - &Reset to Full Range - &Återställ till fullt område + &Återställ till fullt område - - Edit &Range... - Redige&ra område... + Redige&ra område... - - &Hide - &Göm + &Göm - - Hide &Other Curves - Göm &andra kurvor + Göm &andra kurvor - - &Show All Curves - Vi&sa alla kurvor - - - - Increase Precision - - - - - Decrease Precision - - - - + Vi&sa alla kurvor + + New table - Ny tabell - - - + Ny tabell + + + Open ODF Spreadsheet + + + Save project - Spara projekt + Spara projekt - Open template - Öppna mall + Öppna mall - Save window as template - Spara fönster som mall + Spara fönster som mall &Single File... @@ -5707,345 +7286,242 @@ &Flera filer... - Project &Explorer - Projektutforskar&e + Projektutforskar&e - Show analysis results - Visa analysresultat + Visa analysresultat - Export to PDF - Exportera till PDF + Exportera till PDF Ctrl+Alt+0 Ctrl+Alt+0 - Date & time - Datum & klockslag + Datum & klockslag - Plot as line - Rita som linje + Rita som linje - Plot as symbols - Rita som synbol + Rita som synbol - Plot as line + symbols - Rita som linje+symbol + Rita som linje+symbol - Plot 3D ribbon - Rita n3D-band + Rita n3D-band - Plot 3D bars - Rita 3D-staplar + Rita 3D-staplar - Plot 3D scatter - Rita 3D-spridning + Rita 3D-spridning - Plot 3D trajectory - Rita 3D-spår + Rita 3D-spår - More Windows... - Fler fönster... + Fler fönster... - Box and whiskers plot - Låd- och morrhårskurva + Låd- och morrhårskurva - Visit QtiPlot &Forums - Besök QtiPlot &Forum - - - - Show find dialog - - - - - Find Next - - - - - Find Previous - - - - - Show replace dialog - - - - - Drag Curve - - - - - + Besök QtiPlot &Forum + + No axes - Inga axlar + Inga axlar - Front grid - Främre rutnät + Främre rutnät - Back grid - Bakre rutnät + Bakre rutnät - Right grid - Höger rutnät + Höger rutnät - Left grid - Vänster rutnät + Vänster rutnät - Ceiling grid - Takrutnät + Takrutnät - Floor grid - Golvrutnät + Golvrutnät - - Hidden line - Gömd linje + Gömd linje - - Polygon Only - Endast polygon + Endast polygon - - Mesh & Filled Polygons - Nät & fyllda polygoner + Nät & fyllda polygoner - - - - Crosshairs - Hårkors + Hårkors - - Floor data projection - Golvdataprojektion + Golvdataprojektion - - Floor isolines - Golvisolinjer + Golvisolinjer - - Empty floor - Tomt golv + Tomt golv QtiPlot - Help QtiPlot - Hjälp - Output format: - Utdataformat: + Utdataformat: - Directory: - Mapp: + Mapp: - There are no plot layers available in window <b>%1</b>.<br>Graph window not exported! - Det finns inga diagramlager tillgängliga i fönster <b>%1</b>.<br>Diagramfönster ej exporterat! + Det finns inga diagramlager tillgängliga i fönster <b>%1</b>.<br>Diagramfönster ej exporterat! - Set Display Range - Ställ in visningsområde + Ställ in visningsområde - &View Pixel Line profile - &Visa pixellinjeprofil + &Visa pixellinjeprofil Import image... Importera bildfil... - - &Import ASCII... - &Importera ASCII... + &Importera ASCII... - - Fit &Wizard... - An&passningshjälpreda... + An&passningshjälpreda... - Import data file(s) - Importera datafil(er) + Importera datafil(er) <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> If you like it, you're using it in your work and you would like to see it constantly improved,<br> please support its authors by making a donation.<br><br> Would you like to make a donation for QtiPlot now?</b></font> <font size=+2, color = darkBlue><b>QtiPlot är program med öppen källkod och dess utveckling har krävt hundratals timmars arbete.<br><br>(tab)(tab)(tab)(tab)Om du uppskattar programmet du använder i ditt arbete och om du vill se det (tab)(tab)(tab)(tab) förbättrat,<br> stöd dess författare genom att göra en donation.<br><br> (tab)(tab)(tab)(tab)Vill du göra en donation nu till QtiPlot?</b></font> - <b> %1 </b>: This command line option must be used without other arguments! <b> %1 </b>: Detta kommandoradsval måste användas utan argument! - Version Version - Usage Användning - options val - - file fil - - name namn - Valid options are Giltiga val är - - - - - - - - or eller - show about dialog and exit visa "Omdialog" och avsluta - show command line options visa kommandoradsval - start QtiPlot in language starta QtiPlot i språket - show QtiPlot manual in a standalone window visa QtiPlot-manualen i ett fristående fönster - print QtiPlot version and release date skriv QtiPlot-version och utgivningsdatutm - execute the script file given as argument utför skriptfilen, given som argument - can be any .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py or ASCII file - kan vara något av .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py eller ASCII-fil + kan vara något av .qti, qti.gz, .opj, .ogm, .ogw, .ogg, .py eller ASCII-fil - <b> %1 </b> unknown command line option! <b> %1 </b> okänt kommandoradsval! - Type %1 to see the list of the valid options. Skriv %1 för att se listan på giltiga val. - <b>%1</b> is a directory, please specify a file name! <b>%1</b> är en mapp, specificera ett filnamn! - - You don't have the permission to open this file: <b>%1</b> - Du har inte tillåtelse att öppna denna fil: <b>%1</b> + Du har inte tillåtelse att öppna denna fil: <b>%1</b> - QtiPlot - Demo Version QtiPlot - Demoversion @@ -6054,73 +7530,54 @@ You are using the demonstration version of Qtiplot.(tab)(tab)(tab)(tab)It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session.(tab)(tab)(tab)(tab)<br><br>(tab)(tab)(tab)(tab)If you want to have ready-to-use, fully functional binaries, please subscribe for a(tab)(tab)(tab)(tab)<a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>.(tab)(tab)(tab)(tab)<br><br>(tab)(tab)(tab)(tab)QtiPlot is free software in the sense of free speech.(tab)(tab)(tab)(tab)If you know how to use it, you can get(tab)(tab)(tab)(tab)<a href="http://developer.berlios.de/project/showfiles.php?group_id=6626">the source code</a>(tab)(tab)(tab)(tab)free of charge.(tab)(tab)(tab)(tab)Nevertheless, you are welcome to(tab)(tab)(tab)(tab)<a href="http://soft.proindependent.com/why_donate.html">make a donation</a>(tab)(tab)(tab)(tab)in order to support the further development of QtiPlot. - QtiPlot - File backup error QtiPlot - Filbackuppfel - QtiPlot - File save error QtiPlot - Filsparningsfel - Save project as Spara projekt som - - windows fönster - - folders mapp - - 3D Graph 3D-diagram - Skipped moving folder Hoppande över att flytta mapp - QtiPlot will try to download necessary information about the last available updates. Please modify your firewall settings in order to allow QtiPlot to connect to the internet! QtiPlot kommer att försöka matt ladda ner nödvändig information om senaste tillgängliga uppdatering. Justera din brandvägg till att tillåta QtiPlot att kontakta Internet! - Do you wish to continue? Vill du fortsätta? - QtiPlot - HTTP get version file QtiPlot - HTTP hämta versionsfil - - &Draw Data Points &Rita datapunkter - - &Read-only &Skrivskyddat - - Read/&Write Läs/&skriv @@ -6129,31 +7586,24 @@ QtiPlot - Plottfel - Please select a column to plot! Välj en kolumn för plottning! - - Please select four columns for this operation! Välj fyra kolumner för denna åtgärd! - - QtiPlot - Delete rows - QtiPlot - Tag bort rader + QtiPlot - Tag bort rader - Start row - Startrad + Startrad - End row - Slutrad + Slutrad This feature is only available to users having subscribed for a binaries maintenance contract! @@ -6164,528 +7614,384 @@ Besäk följande hemsida för ytterligare detaljer: - Vie&w - Vi&sa + Vi&sa - &Palette - &Palett + &Palett - &Folders - &Mappar - - - - + &Mappar + + + Ctrl+Alt+S + + + Shift+A - Shift+A + Shift+A - - &Swap columns - &Byt kolumner + &Byt kolumner - - Move &Right - Flytta åt &höger + Flytta åt &höger - - Move &Left - Flytta åt &vänster + Flytta åt &vänster - - Move to F&irst - Flytta &först + Flytta &först - - Move to Las&t - Flytta &sist + Flytta &sist - - &Delete Rows Interval... - &Tag bort radintervall... + &Tag bort radintervall... - - &Image Plot - B&ilddiagram + B&ilddiagram - - Flip &V - Vänd &V + Vänd &V - Ctrl+Shift+V - Ctrl+Shift+V + Ctrl+Shift+V - - Flip &H - Vänd %H + Vänd %H - Ctrl+Shift+H - Ctrl+Shift+H + Ctrl+Shift+H - - R&otate 90 - V&rid 90 + V&rid 90 - - Rotate &-90 - Vrid &-90 + Vrid &-90 - - Ctrl+Alt+R - Ctrl+Alt+R + Ctrl+Alt+R - - &Image mode - B&ildläge + B&ildläge - Ctrl+Shift+I - Ctrl+Shift+I + Ctrl+Shift+I - - &Data mode - &Dataläge + &Dataläge - Ctrl+Shift+D - Ctrl+Shift+D + Ctrl+Shift+D - - Show &X/Y - Visa &X/Y + Visa &X/Y - Ctrl+Shift+X - Ctrl+Shift+X + Ctrl+Shift+X - - Show &Column/Row - Visa &kolumn/rad + Visa &kolumn/rad - Ctrl+Shift+C - Ctrl+Shift+C + Ctrl+Shift+C - - - &Gray Scale - &Gråskala + &Gråskala - - &Rainbow - &Regnbåge + &Regnbåge - - &Custom - &Anpassad + &Anpassad - - &Export Image ... - &Exportera bild... + &Exportera bild... - &Forward FFT - &Framåt FFT + &Framåt FFT - &Inverse FFT - &Omvänd FFT + &Omvänd FFT - - &Read Only - Sk&rivskyddat + Sk&rivskyddat - - &Disregard - &Förbise + &Förbise Toolbars... Verktygsrader... - - Ctrl+Shift+T - Ctrl+Shift+T + Ctrl+Shift+T - New Fol&der - Ny ma&pp + Ny ma&pp - Create a new folder - Skapa en ny mapp + Skapa en ny mapp - Swap selected columns - Byt valda kolumner + Byt valda kolumner - Move Right - Flytta år höger + Flytta år höger - Move Left - Flytta åt vänster + Flytta åt vänster - Move to First - Flytta först + Flytta först - Move to Last - Flytta sist + Flytta sist - Draw Data Points - Rita datapunkter + Rita datapunkter - start QtiPlot with the default settings börja QtiPlot med standardinställningar - Help Hjälp - - - You need at least two columns for this operation! - Du behöver minst två kolumner för denna åtgärd! + Du behöver minst två kolumner för denna åtgärd! - Please set a default X column for this table, first! Bestäm en standard X-kolumn till denna tabell först! - Please select a Z column for this operation! Välj en Z-kolumn för denna åtgärd! - You need to define a X column first! Du måste definiera en X-kolumn först! - You need to define a Y column first! Du måste definiera en Y-kolumn först! - Starting with version 0.9.1 QtiPlot stores the user defined fit models to a different location. Med början av version lagrar 0.9.1 QtiPlot användardefinierade anpassningsmodeller på en anna plats. - If you want to save your already defined models, please choose a destination folder. Om du vill spara dina befitliga modeller, välj en målmapp. - Import fit models Importera anpassningsmodeller - Choose a directory to export the fit models to Väl en mapp att exportera anpassningsmodellerna till - - - Format Format - - Add &Custom Script Action... - Lägg till &anpassad skriptåtgärd... + Lägg till &anpassad skriptåtgärd... - - Bold - Fetstil + Fetstil - - Italic - Kursiv + Kursiv - Superscript - Exponent + Exponent - Subscript - Index + Index - - Underline (Ctrl+U) - Understrykning (Ctrl+U) + Understrykning (Ctrl+U) - - Ctrl+U - Ctrl+U + Ctrl+U - - - - Greek - Grekiska + Grekiska - - - Error Fel - - QtiPlot was not built with Python scripting support included! QtoPlot skapades inte med Python-skriptning inkluderat! - - - &Label - &Etikett + &Etikett - - Undo Stack Ångrastack - Empty Stack Tom stack - Set Image Mode Ställ in bildläge - Set Data Mode Ställ in dataläge - Show X/Y Visa X/Y - Show Column/Row Visa kolumn/rad - Set Gray Scale Palette Ställ in gråskalepalett - Set Rainbow Palette Ställ in regnbågspalett - - &Hide Selected - &Göm det valda + &Göm det valda - - Sho&w All Columns - &Visa alla kolumner + &Visa alla kolumner - - - - &Direct - &Direkt + &Direkt - - &XYZ Columns - &XYZ-kolumner + &XYZ-kolumner - - &YXZ Columns - &YXZ-kolumner + &YXZ-kolumner Undo/Redo Stack Ångra/göra om-stack - Show available undo/redo commands - Visa tillgängliga ångra/göra om kommandon + Visa tillgängliga ångra/göra om kommandon - Hide selected columns - Göm valda kolumner + Göm valda kolumner - Show all table columns - Visa alla tabellkolumner + Visa alla tabellkolumner - Integration of %1 from zero is - Integration av %1 från noll är + Integration av %1 från noll är - - &Integrate - &Integrera + &Integrera - - Integr&ate Function... - Integrer&a funktion... + Integrer&a funktion... - - Ctrl+D - Ctrl+D + Ctrl+D - - &Toolbars... - &Verktygsrad... + &Verktygsrad... - &Undo/Redo Stack - &Ångra/göra-om stack + &Ångra/göra-om stack - - Go to Colum&n... - Gå till kolum&n... + Gå till kolum&n... - - Ctrl+Alt+C - Ctrl+Alt+C + Ctrl+Alt+C - Set Matrix Values - Ge matrisvärden + Ge matrisvärden - Image Plot - Bildritning + Bildritning Rotate 90° Clockwise @@ -6696,626 +8002,443 @@ Rotera 90 motsols - Flip Vertically - Vik vertikalt + Vik vertikalt - Flip Horizontally - Vik horisontellt + Vik horisontellt - Fill selected columns with row numbers - Fyll valda kolumner med radnummer + Fyll valda kolumner med radnummer - Fill selected columns with random numbers - Fyll valda kolumner med slumptal + Fyll valda kolumner med slumptal - Set column as X - Sätt kolumn till X + Sätt kolumn till X - Set column as Y - Sätt kolumn till Y + Sätt kolumn till Y - Set column as Z - Sätt kolumn till Z + Sätt kolumn till Z - Set as Y Error Bars - Sätt som Y-felstapel + Sätt som Y-felstapel - Set as Labels - Sätt som etiketter + Sätt som etiketter - Disregard Columns - Bortse från kolumner + Bortse från kolumner - QtiPlot - Enter column number QtiPlot - mata in kolumnnummer - - Mathematical Symbols - Matematiska symboler + Matematiska symboler - Integration of %1 - Integrering av v%1 + Integrering av v%1 - Area - Yta + Yta - - - - - Please select a 'Y' column first! - Välj en 'Y'-kolumn först! + Välj en 'Y'-kolumn först! - - Linear Regression of %1 - Linjär regression av %1 + Linjär regression av %1 - - Slope - Lutning + Lutning - Intercept - Skärningspunkt + Skärningspunkt - - Chi^2 - Chi² + Chi² - - R^2 - + - &Scripting &Skriptning - - Show Line &Numbers - Visa rad&nummer + Visa rad&nummer - - Add E&quation Lägg till e&kvation - - ALT+Q ALT+Q - - Add &Rectangle Lägg till &rektangel - - CTRL+ALT+R CTRL+ALT+R - - - There are no layers available on this plot. Operation aborted! - Det finns inga lager tillgängliga för detta diagram. Åtgärd avbryts! + Det finns inga lager tillgängliga för detta diagram. Åtgärd avbryts! - &Paste Tex Formula - &Klista in texformel + &Klista in texformel - - &Frequency Count ... - &Frekvensräknare... + &Frekvensräknare... - Add Equation - Lägg till ekvation + Lägg till ekvation - Add Rectangle - Lägg till rektangel + Lägg till rektangel - You need to select at least one Y column for this operation! - Du behöver mints en Y-kolumn för att utföra åtgärden! + Du behöver mints en Y-kolumn för att utföra åtgärden! - Y2 Axis Title - Y2-axeltitel + Y2-axeltitel - You must have more than one layer in the active window! - Du måste ha fler än ett lager i det aktiva fönstret! + Du måste ha fler än ett lager i det aktiva fönstret! - You must have more than one dataset in the active layer! - Du måste ha fler än en datamängd i det aktiva lagret! + Du måste ha fler än en datamängd i det aktiva lagret! - - D&ouble-Y - D&ubbel-Y + D&ubbel-Y - - &Zoom - &Zoom + &Zoom - - E&xtract to Graphs - Ploc&ka ut till diagram + Ploc&ka ut till diagram - Extract to &Layers - Plocka ut till &lager + Plocka ut till &lager - - Add Inset Layer - Lägg till "Inset" lager + Lägg till "Inset" lager - Double Y Axis - Dubbla Y-axlar + Dubbla Y-axlar - Zoom - Zoom + Zoom - Extract to Graphs - Plocka ut till diagram + Plocka ut till diagram - Extract to Layer&s - Plocka ut till lage&r + Plocka ut till lage&r - Extract to Layers - Plocka ut till lager + Plocka ut till lager - <font size=+2, color = darkBlue><b>QtiPlot is open-source software and its development required hundreds of hours of work.<br><br> If you like it, you're using it in your work and you would like to see it constantly improved, please support its authors by making a donation.</b></font> <font size=+2, color = darkBlue><b>QtiPlot är öppen källprogramvara och dess utveckling har krävt hundratals timmars arbete.<br><br> Om du tycker det är bra och du använder det i ditt arbete samt om du vill se det kontinuerligt förbättrat, stöd dess upphovsman genom att göra en donation.</b></font> - - Make a donation - - - - - show standalone scripting window - - - - - execute the script file given as argument without displying the user interface. Warning: 2D plots are not correctly handled in this functioning mode! - - - - - You are using the demonstration version of Qtiplot. It is identical with the full version, except that you can't save your work to project files and you can't use it for more than 10 minutes per session. <br><br> If you want to have ready-to-use, fully functional binaries, please subscribe for a <a href="http://soft.proindependent.com/individual_contract.html">single-user binaries maintenance contract</a>. <br><br> QtiPlot is free software in the sense of free speech. If you know how to use it, you can get <a href="http://soft.proindependent.com/download.html">the source code</a> free of charge. Nevertheless, you are welcome to <a href="http://soft.proindependent.com/why_donate.html">make a donation</a> in order to support the further development of QtiPlot. - - - - - + can be any .qti, qti.gz, .ods, .opj, .ogm, .ogw, .ogg, .py, .xls or ASCII file + + + No Icon Ingen ikon - Couldn't load file: %1. Autocompletion will not be available! Kunde inte ladda fil: %1. Automatisk komplettering ej tillgängligt! - Please select exactly one column and more than one non empty cell! Välj exakt en kolumn och mer än en icke tom cell! - - Add &Ellipse Lägg till &ellips - - CTRL+ALT+E CTRL+ALT+E - &Paste Rectangle - &Klistra in rektangel + &Klistra in rektangel - &Paste Ellipse - &Klistra in ellips + &Klistra in ellips - Add Ellipse/Circle - Lägg till ellips/cirkel + Lägg till ellips/cirkel - - - - Ctrl+Alt+H - Ctrl+Alt+H + Ctrl+Alt+H - Set Default Palette Använd standardpalett - - &Default - Standard + Standard - Rotate 90 Clockwise - Vrid 90 medsols + Vrid 90 medsols - Rotate 90 Counterclockwise - Vrid 90 motsols - - - - - Ctrl+Shift+S - - - - + Vrid 90 motsols + + Stem-and-Leaf Plot - Stam-och-lövplot + Stam-och-lövplot - - Stem-and-&Leaf Plot - Stam-och-&lövplot + Stam-och-&lövplot - F&ormat F&ormat - Data set: %1 doesn't exist! Datamängden %1 saknas! - Stem and leaf plot of dataset Stam-och-lövdiagram av datamängd - from row från rad - to row till rad - Not enough memory for this dataset! Ej tillräckligt för denna datamängd! - Stem Stam - Leaf Löv - Please confirm the stem unit! Bekräfta stamenheten! - Data set Datamängd - stem unit stameneht - Stem unit Stamenhet - Leaf unit Lövenhet - Key Nyckel - means betyder - Input error: empty data set! Indatafel: tom datamängd! - - Alt+C - - - - - - Zoom &In/Out and Drag Canvas - - - - - Zoom In (Shift++) or Out (-) and Drag Canvas - - - - - - Fit Slop&e - - - - &Add &Lägg till - - - Ctrl+Alt+D - - - - - &Waterfall Plot - - - - - &Indexed Colors - - - - - Pale&tte - - - - Close Stäng - - - Spec&ial Bar/Column - - - Stack &Bar - - - - - - Stack &Column - - - - - Plot stack bar - - - - - Plot stack column - - - - - Move Row - - Print preview of window: - - - - - - Print Pre&view - - - - - - Ad&just Column Width - - - - - - &Upward - - - - - - &Downward - - - - - Append a project to the current folder - - - - - Ctrl+Alt+A - - - - - Move current row upward - - - - - Move current row downward - - - - - Set optimal column width - + Shared A&xes Panel + + + + + + + + &Custom Layout... + + + + Execute Selected Lines + + + + Commen&t Selection + + + + &Uncomment Selection + + + + Comment Selection + + + + Uncomment Selection + + + + Ctrl+Shift+O + + + + Ctrl+Shift+U + + + + Waterfall Plot + + + + &Extract Data... + + + + S&ubtract + + + + &Straight Line... + + + + &Reference Data... + + + + &Open... + &Öppna... + + + Open Image &File... + Öppna bild&fil... + + + &Print... + &Skriv ut... + + + Print Pre&view... + + + + E&xport ASCII... + Ex&portera ASCII... ArrowMarker - dx - dy - angle - length - - eqn - y - - x @@ -7323,74 +8446,58 @@ AssociationsDialog - QtiPlot - Plot Associations QtiPlot - Plot-knytningar - Spreadsheet: Kalkylblad: - Column Kolumn - X X - Y Y - - xErr xFel - - yErr yFel - &Update curves &Uppdatera kurvor - &OK &OK - &Cancel &Avbryt - xEnd xSlut - yEnd ySlut - Angle Vinkel - Magn. Magnitude, vector length Magn. @@ -7399,40 +8506,30 @@ AxesDialog - QtiPlot - General Plot Options QtiPlot - Allmänna diagramalternativ - &Apply &Tillämpa - &OK &OK - &Cancel &Avbryt - - From Från - - To Till - - Type Typ @@ -7445,268 +8542,206 @@ logaritmisk - Inverted Inverterad - Step Steg - - Major Ticks Huvudskalstreck - - Minor Ticks Delskalstreck - - - Bottom Botten - - - Left Vänster - - - Top Topp - - - Right Höger - Scale Skala - Major Grids Huvudrutnät - Minor Grids Delrutnät - Line Color Linjefärg - Line Type Linjetyp - Thickness Tjocklek - - Axes Axlar - Additional lines Ytterligare linjer - X=0 X=0 - Y=0 Y=0 - Horizontal Horisontell - Vertical Vertikal - Grid Rutnät - Show Visa - Title Titel - &Font &Teckensnitt - Numeric Numerisk - Text from table Text från tabell - Day of the week Veckodag - Month Månad - Time Tid - Date Datum - Column Headings Kolumnrubrik - Font Teckensnitt - Axis &Font A&xelteckensnitt - - - Color Färg - - None Inget - - Out Ut - - In & Out In & Ut - - In In - + Labels space + + + Stand-off "Stand-off" - Show Labels Visa etiketter - + Show &backbone + + + Column Kolumn - Table Tabell - - Format Format - - Precision Precision - Angle Vinkel - For&mula For&mel - - Axis Axel - Canvas frame Dukkant - - Width Bredd @@ -7735,22 +8770,18 @@ Ramfärg - Draw backbones Rita grunder - Line Width Linjebredd - Major ticks length Huvudskalstreckslängd - Minor ticks length Delskalstreckslängd @@ -7767,12 +8798,10 @@ Tillämpa på alla lager - General Allmänt - Automatic Automatiskt @@ -7805,226 +8834,197 @@ Mata in ett positivt stegvärde! - QtiPlot - Formula input error QtiPlot - Fel i formelindata - Valid variables are 'x' for Top/Bottom axes and 'y' for Left/Right axes! Giltiga variabler är 'x' för topp/botten-axlar och 'y' för vänster/höger-axlar! - millisec. millisek. - sec. sek. - min. min. - hours timmar - days dagar - weeks veckor - Show Axis &Break Visa axelav&brott - Probability - Logit - Draw Break &Decoration Rita avbrotts&dekoration - Position Position - % of Axis Length % av axellängd - pixels pixlar - &Log10 Scale After Break &Log10 skala efter avbrott - Step Before Break Steg före avbrott - - Guess Gissa - Step After Break Steg efter avbrott - Minor Ticks Before Mindre streck före - Minor Ticks After Mindre streck efter - Apply To Tillämpa på - This Layer Detta lager - This Window Detta fönster - - - All Windows Alla fönster - An&tialised An&tialiased - Set As &Default Sätt stan&dard - Apply &to... &Tillämpa på... - - Layer Lager - - Window Fönster - Distance to axis Avstånd till axel - Apply &to &Tillämpa på - Decimal: 10000.0 Decimal: 10000.0 - Scientific: 1e4 Vetenskapligt: 1E4 {1e?} - Scientific: 1x10^4 Vetenskaplig: 1x10^4 - Engineering: 10k Tekniskt: 10k - - + Scientific: 1·10^4 + + + Origin Ursprung - &Inverted - Linear Linjär - Log10 - ln - Log2 - Reciprocal + + Hide Ticks + + + + At Axis Begin + + + + At Axis End + + + + At Axis Begin & End + + CanvasPicker @@ -8036,158 +9036,121 @@ ColorBox - black svart - red rött - green grönt - blue blått - cyan cyan - magenta magenta - yellow gult - dark yellow mörkgult - navy marin - purple purpel - wine vinrött - olive oliv - dark cyan mörkt cyan - white vitt - light gray ljusgrått - dark gray mörkgrått - royal kungs - orange orange - violet violett - pink skär - gray grå - light yellow ljusgul - light cyan ljuscyan - light magenta ljusmagenta - ColorButton - - - Custom - - - - ColorMapDialog - QtiPlot QtiPlot - Custom Color Map Anpassad färgkarta - &Apply &Tillämpa - &Close &Stäng - Set Custom Palette Ställ in anpassad palett @@ -8195,12 +9158,10 @@ ColorMapEditor - Level Nivå - Color Färg @@ -8213,7 +9174,6 @@ &Tag bort nivå - &Scale Colors &Skalfärger @@ -8230,12 +9190,10 @@ Skriv in ett giltigt värde på färgnivå! - &Insert Sätt &in - &Delete &Tag bort @@ -8243,30 +9201,22 @@ ColorMapPreviewDialog - QtiPlot - Color Map Preview Dialog QtiPlot - Granskningsdialog av färgkarta - Colormap files Färgkartefiler - All files Alla filer - << &Preview <<&Granskning - - - - None Inget @@ -8274,7 +9224,6 @@ ColorPickerPopup - Custom @@ -8282,7 +9231,6 @@ ConfigDialog - The column separator can be customized. The following special codes can be used: \t for a TAB character @@ -8293,187 +9241,188 @@ \s för MELLANSLAG - The separator must not contain the following characters: 0-9eE.+- Skiljetecknet får ej bestå av följande tecken: 0-9eE.+- - - Grids - - Ma&jor Grids - - Mi&nor Grids - - Color Färg - + &Keep aspect ratio + Behåll aspe&kten + + QtiPlot - Choose default settings QtiPlot - Välj standardinställningar - General Allmänt - - Tables Tabeller - - 2D Plots 2D-diagram - - 3D Plots 3D-diagram - Fitting Anpassning - Options Alternativ - Curves Kurvor - Ticks Markeringar - - - + Geometry + Geometri + + Fonts Teckensnitt - Do not &resize layers when window size changes Förändra inte sto&rlek på lager när fönsterstorlek ändras - - Length Längd - - + Ticks - Labels space + + + + pixels + pixlar + + + Unit + Enhet + + + inch + + + + mm + mm + + + cm + cm + + + point + punkt + + + pixel + pixel + + + Canvas Width + + + + Canvas Height + + + + mu&Parser uses C locale settings + + + Solid Massiv - - Dash - - Dot Punkt - - Dash Dot - - Dash Dot Dot - - Short Dash - - Short Dot - - Short Dash Dot - Scale Errors with sqrt(Chi^2/doF) Skalningfel med sqrt(Chi^2/doF) - Axes linewidth Axellinjebredd - Major Ticks Huvudskalstreck - Minor Ticks Delskalstreck - Margin Marginal - Frame width Rambredd - Axes &backbones Axlar och &grunder - Canvas Fra&me Kanvasra&m @@ -8482,314 +9431,242 @@ &Visa alla axlar - Show &Title Visa &titel - Scale &Fonts Skala &teckensnitt - Auto&scaling Auto&skalning - Antia&liasing Antia&liasing - Legend display - Column name - Column comment - Table name - Table legend - - None Inget - - Out Ut - - In & Out In & Ut - - In In - Prompt on closing Kvittera vid stängning - Folders Mappar - Matrices Matriser - &Notes A&nteckningar - &OK &OK - &Cancel &Avbryt - &Apply &Tillämpa - &Text Font &Teckensnitt - &Labels Font &Etikettteckensnitt - A&xes Labels A&xeletiketter - Axes &Numbers Axel&nummer - &Legend &Beskrivning - T&itle T&itel - + Ask before over&writing files + + + Application Tillämpning - Confirmations Bekräftelser - - - Colors Färger - Language Språk - - - Style Stil - Main Font Huvudteckensnitt - Choose &font Välj &teckensnitt - Workspace Arbetsutrymme - Panels text Paneltext - Panels Paneler - Save every Spara var - Check for new versions at startup Kontrollera om nya versioner vid start - minutes minuter - Default scripting language Standardskriptspråk - Default Column Separator Standardkolumnseparator - - - - TAB TAB - - - - SPACE MELLANSLAG - - - Background Bakgrund - Text Text - - Labels Etiketter - Default curve style Standardkurvstil - Line width Linjebredd - Symbol size Symbolstorlek - Line Linje - Scatter Spridning - Line + Symbol Linje + symbol - Vertical drop lines Vertikala dropplinjer - Spline Anpassad kurva - Vertical steps Vertikala steg - Horizontal steps Horisontella steg - Area Yta - Vertical Bars Vertikala staplar - Horizontal Bars Horisontella @@ -8798,12 +9675,10 @@ Upplösning - (all data shown) (all data visad) - &Show Legend &Visa beskrivning @@ -8816,17 +9691,14 @@ &Datamax - Smoot&h Line Utjämnad lin&je - O&rthogonal Vinkel&rät - Lab&els Etik&etter @@ -8835,7 +9707,6 @@ Rutnäts&linje - &Grid &Rutnät @@ -8844,128 +9715,102 @@ Data&min - - - &Numbers &Tal - A&xes A&xlar - &Background &Bakgrund - &Title &Titel - &Axes Labels Axeleti&ketter - Autosca&ling Autoska&lning - Generated Fit Curve Skapad anpasssningskurva - Uniform X Function Likformig X-funktion - Points Punkter - Same X as Fitting Data Samma X som anpassningsdata - - Display Peak Curves for Multi-peak Fits Visa toppkurvor för mångtopps-anpassning - Parameters Output Parameterutdata - Significant Digits Signifikanta siffror - Write Parameters to Result Log Skriv parametrar till resultatlogg - Paste Parameters to Plot Klistra in parametrar i diagram - Peaks Color Toppfärg - + Display Confirmation &Messages for Multi-peak Fits + + + QtiPlot - Import options error QtiPlot - Importalternativfel - The separator must not contain the following characters: 0-9eE.+- Skiljetecknet får ej bestå av följande tecken: 0-9eE.+- - - - - System Locale Setting Systemlokaliseringsinställning - Decimal Separators Decimalskiljare - Print Skriv ut - Print Crop&marks Skriv ut urklipps&markeringar - &Scale layers to paper size &Skala lager till pappersstorlek - Numeric Format Numeriskt format @@ -8974,7 +9819,6 @@ Updatera skiljetecken i tabeller/matriser - Number of Decimal Digits Antal decimala siffror @@ -8983,166 +9827,122 @@ Uteslut tusentalsåtskiljare - &Display Comments in Header &Visa kommentarer i huvud - 2 points for linear fits 2 punkter för linjär anpassning - Prompt on &renaming tables when appending projects Uppmaning vid namnbyte av tabelle&r när projekt läggs till - &Backup project before saving Tag sä&kerhetskopia inna ddu sparar - Start New Project Börja nytt projekt - - Empty Tomt - Table Tabell - Matrix Matris - Empty Graph Tom kurva - Note Notera - &Disable in-place editing &Koppla bort redigering på plats - File Locations Filplats - Choose the location of the QtiPlot translations folder! Välj plats för QtiPlots översättningsmapp! - Matrix Undo Stack Size Matrisångringsstackstorlek - - Translations Översättningar - - Help Hjälp - LF (Unix) LF (Unix) - CRLF (Windows) CRLF (Windows) - CR (Mac) CR (Mac) - - Python Configuration Files Konfigurationsfiler för Python - Endline character Radslutstecken - Choose the location of the Python configuration files! Välj plats för Pythons konfigurationsfiler! - Automatically &Recalculate Column Values &Räkna om kolumnvärden automatiskt - - Background Color Bakgrundsfärg - - - - Opacity Genomskinlighet - - Canvas Color Dukfärg - - Border Color Kantfärg - - - - Width Bredd - - Transparent Transparent - &Enable autocompletion (Ctrl+U) &Tillåt automatisk komplettering (Ctrl+U) @@ -9151,317 +9951,333 @@ &Visa radnummer i anteckningar - Omit &Thousands Separator Uteslut &tusentalsåtskiljare - Clipboard Decimal Separators Urklipps decimaltecken - &B &B - &It &mä - Notes Noteringar - Tab length (pixels) Tablängd (pixlar) - Font Teckensnitt - &Display line numbers &Visa radnummer - Axes title space Utrymme för axeltitel - &Resolution &Upplösning - &Floor style &Golvstil - Isolines Isobarer - Projection Projektion - &Mesh &Nät - Syntax Highlighting Syntaxmarkering - Co&mments Ko&mmentarer - &Keywords &Nyckelord - &Quotations &Citeringar - &Functions &Funktioner - Q&t Classes Q&t-klasser - Default Color Map Standardfärgkarta - Axes Axlar - Left Vänster - Right Höger - Bottom Botten - Top Topp - Enabled axes Tillåt axlar - Show Visa - - QtiPlot - index.html File Not Found! QtiPlot - Index.html-fil ej funnen! - There is no file called <b>index.html</b> in folder %1.<br>Please choose another folder! Det finns ingen fil kallad <b>index.html</b> i mapp %1.<br>Välj en annan mapp! - - QtiPlot - Folder Not Found! QtiPlot - Mapp inte hittad! - The folder %1 doesn't exist.<br>Please choose another folder! Mappen %1 saknas<br>Välj en annan mapp! - %1 is not a folder.<br>Please choose another folder! %1 är inte en mapp.<br>Välj en anna mapp! - Choose the location of the QtiPlot help folder! Välj platsen för QtiPlots hjälpmapp! - There is no file called <b>index.html</b> in this folder.<br>Please choose another folder! Det finns igen fil kallad <b>index.html</b> i denna mapp. <br>Välj en annan mapp! - - QtiPlot QtiPlot - You don't have read access rights to folder %1.<br>Please choose another folder! Du har inte tillgång till mapp %1.<br>Välj en anna mapp! - - &Internet Connection - - &Proxy - - Host - - Port - - Username - - Password - LaTeX Compiler - Choose the location of the LaTeX compiler! - - QtiPlot - File Not Found! - The file %1 doesn't exist.<br>Please choose another file! - %1 is a folder.<br>Please choose a file! - You don't have read access rights to file %1.<br>Please choose another file! + + New Color + + + + &Load Default + + + + Delete Color + + + + Move Color Up + + + + Move Color Down + + + + Indexed Colors + + + + Default Symbol + + + + Edge width + + + + Fill + Fyllnad + + + Name + Namn + + + Symbol + Symbol + + + Inde&xed Symbols + + + + &Fill Symbol + + + + Move Symbol Up + + + + Move Symbol Down + + + + Pattern + Mönster + + + Line style + + + + Fill area under curve + Fyll yta under kurva + + + Default Line Style + + + + Axis title + + + + Default + Standard + + + Synchronize scale &divisions + + ContourLinesEditor - Level Nivå - Pen - &Insert Sätt &in - &Delete &Tag bort - QtiPlot - Edit pen - Color Färg - - - Apply to all Tillämpa på allt - Style Stil - Width Bredd - &Ok &Ok - &Close @@ -9469,56 +10285,38 @@ Convolution - Convolution Faltning - - - - - QtiPlot QtiPlot - - - - - Error Fel - The signal data set %1 does not exist! Signaldatamängdet %1 saknas! - The response data set %1 does not exist! Svarsdatamängden %1 saknas! - The response dataset '%1' must be less then half the size of the signal dataset '%2'! Svarsdatamängden '%1' måste vara mindre 'än halva storleken på signaldatamängden '%2'! - The response dataset '%1' must contain an odd number of points! Svarsdatamängden '%1' måste innehålla ett udda antal punkter! - Could not allocate memory, operation aborted! Kunde inte tilldela minne, åtgärden avbröts! - - Index Index @@ -9530,27 +10328,18 @@ Correlation - Correlation Korrelation - - - QtiPlot QtiPlot - - - Error Fel - - The data set %1 does not exist! Datamängden %1 saknas! @@ -9559,13 +10348,10 @@ Kunde inte tilldela minne, åtgärden avbröts! - Error in GSL forward FFT operation! Fel i GSL fram-FFT-åtgärd! - - Lag Eftersläpning @@ -9577,68 +10363,54 @@ CreateBinMatrixDialog - - QtiPlot QtiPlot - Bin Matrix Dialog - &OK &OK - &Cancel &Avbryt - X-min - X-max - Columns Kolumner - Y-min - Y-max - Rows Rader - Input Size Error Indatastorleksfel - The dimensions you have specified are not acceptable! De dimensioner du valt kan ej accepteras! - Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! Mata in ett positivt värde för vilket produkten rader*kolumner inte överskrider det maximala heltalsvärde tillgängligt i ditt system! @@ -9646,32 +10418,26 @@ CurveRangeDialog - QtiPlot - Plot range QtiPlot - Plotområde - Data set: Datamängd: - From row number Från rad nummer - To row number Till rad nummer - &OK &OK - &Close &Stäng @@ -9679,152 +10445,122 @@ CurvesDialog - QtiPlot - Add/Remove curves QtiPlot - Lägg/ta bort kurvor - New curves style Nya kurvtyper - Line Linje - Scatter Spridning - Line + Symbol Linje + symbol - Vertical drop lines Vertikala dropplinjer - Spline Anpassad kurva - Vertical steps Vertikala steg - Horizontal steps Horisontella steg - Area Yta - Vertical Bars Vertikala staplar - Horizontal Bars Horisontella staplar - Contour - Color Fill Kontur - färgfyllnad - Contour Lines Konturlinjer - Gray Scale Map Gråskalekarta - Available data Tillgängliga data - Graph contents Diagraminnehåll - &Plot Associations... &Diagram-associationer... - Edit &Range... Redige&ra område... - &Edit Function... R&edigera funktion... - OK Ok - Close Stäng - &Show Range Vi&sa område - &Plot Selection &Rita det valda - &Plot &Rita - &Delete Selection &Tag bort det valda - &Delete Curve &Tag bort kurva - Show current &folder only Visa endast akuell ma&pp - Histogram Histogram - Histogram Histogram @@ -9832,156 +10568,110 @@ CustomActionDialog - - - - - - - - - - - QtiPlot QtiPlot - Add Custom Action Anpassad skriptåtgärd - Folder Mapp - Choose &Folder Välj &mapp - Script File Skriptifil - Choose &Script Välj &skript - Icon Ikon - Choose &Icon Välj &ikon - - Text Text - Tool Tip Text Hlälptext - Shortcut Genväg - &Menu &Meny - &Tool Bar &Verktygsrad - &Add &Lägg till - &Remove &Tag bort - &Close &Stäng - - - - - - - Error Fel - Please provide a description for your custom action! Lägg till en beskriving av skriptet! - Dot characters are not allowed in the description text! Punkter (punkt-tecken) är ej tillåtna i skripttexter! - You have already defined an action having description: %1 <br>Please provide a different description text! Du har redan definierat en åtgärd med beskrivningen: %1 <br>Ge en anna beskrivande text! - The file you have specified doesn't exist, please choose a valid script file! Filen du specificerade finns inte, välj en giltig skriptfil! - The image file you have specified doesn't exist or can't be read, please choose another file! Bildefilen du specificerade finns inte eller kan ej läsas, välj en anna fil! - Please provide a different key sequence! The following shortcut key sequences are already assigned: Välj en annan tangentlsekvens! Fäljande genvägstangenter är redan tilldelade: - Are you sure you want to remove this action? Är du säker på att du vill ta bort denna åtgärd? - Remove Action Borttagningsåtgärd - - File Save Error Fillagringsfel - - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Kunde inte skriva till filen: <br><h4> %1 </h4><p>Verifiera att du har rättighet att skriva på denna plats! @@ -9990,57 +10680,46 @@ Bilder - QtiPlot - Load icon from file QtiPlot - Ladda ikon från fil - Choose script file Välj skriptfil - Choose the custom actions folder Välj mapp för anpassad åtgärd - &Save &Spara - &Delete Menu &Tag bort meny - Python Script Pythonskript - All Files Alla filer - Add menu Lägg till meny - Menu title: Menytitel: - Please, choose the location of the new menu Välj plats för den nya menyn - Menu: Meny: @@ -10049,28 +10728,22 @@ Det finns redan en menypost med denna titel, välj en annan titel! - Remove Menu Tag bort meny - Are you sure you want to remove menu '%1' and all its actions? är du säker på att du vill ta bort menyn '%1' och alla dess funktioner? - &New Menu... &Ny meny... - - Menu Bar Menyrad - There's already a menu item with this title, please choose another title! @@ -10078,57 +10751,42 @@ DataPickerTool - Click on plot or move cursor to display coordinates! Klicka på diagram eller fluytta markör för att visa upp koordinater! - Please, click on plot and move cursor! Klicka på diagrammet och flytta markören! - Select point and double click to remove it! Välj en punkt och dubbelklicka för att flytta den! - QtiPlot - Remove point error QtiPlot - Tag bort punktfel - Sorry, but removing points of a function is not possible. Det går tyvärr inte att ta bort punkter hos en funktion. - QtiPlot - Move point error QtiPlot - Flytta punktfel - Sorry, but moving points of a function is not possible. Det går tyvärr inte att flytta punkter hos en funktion. - - - - QtiPlot - Warning QtiPlot - Varning - - This operation cannot be performed on curves plotted from columns having a non-numerical format. Denna åtgärd kan ej utföras på kurvor ritade från kolumner med ett icke-numeriskt format. - - The column '%1' is read-only! Please choose another curve! Kolumnen '%1' är skrivskyddat! Välj en anna kurva! @@ -10151,7 +10809,6 @@ Deconvolution - Deconvolution Omfaltning @@ -10159,13 +10816,10 @@ Differentiation - - Derivative Derivata - of Derivative of av @@ -10178,7 +10832,6 @@ DrawPointTool - Draw Rita @@ -10186,64 +10839,46 @@ EnrichmentDialog - - - - QtiPlot QtiPlot - Tex Equation Editor Tex ekvationsredigerare - Clea&r &Rensa - Window Geometry Fönstergeometri - Object Properties Objektegenskaper - &Apply &Tillämpa - &Close &Stäng - Preview: Förhandsgranskning: - - &Text &Text - - Color Färg - - - Set As &Default Sätt stan&dard @@ -10252,24 +10887,18 @@ Teckensnitt - &Font &Teckensnitt - Auto-&update Automatisk &uppdatering - - Opacity Genomskinlighet - - Transparent Transparent @@ -10278,48 +10907,38 @@ Bakgrundsfärg - File Arkiv - &Save internally &Spara internt - &Image B&ild - Shape Utseende - None Ingen - Rectangle Rektangel - Shadow Skugga - Line Style Linjestil - - Width Bredd @@ -10336,292 +10955,226 @@ Detta fönster - - - All Windows Alla fönster - &Frame &Ram - Fill Color Fyllnadsfärg - Pattern Mönster - Pattern Color Mönsterfärg - Use &Frame Color Använd &ramfärg - Fill &Pattern Ifyllnads&mönster - Page - Layer Scales - Attach to - inch inch - mm mm - cm cm - point punkt - pixel pixel - scale skala - Unit Enhet - Position Position - X X - Y Y - Size Storlek - Height Höjd - &Keep aspect ratio Behåll aspe&kten - &Best size &Bästa storlek - &Geometry &Geometri - Network connection error Nätverksanslutningsfel - Error while trying to connect to host %1: Fel vid försök att ansluta till värden %1: - Please verify your network connection! Verifiera din nätverksanslutning! - QtiPlot - Import image from file QtiPlot - Importera bild från fil - QtiPlot - Warning QtiPlot - Varning - The file %1 doesn't exist. The image cannot be restored when reloading the project file! Filen %1 finns inte! Bilden kan ej återskapas vid återladdning av projektfilen! - - - Layer Lager - - - Window Fönster - Background Bakgrund - Rotate (deg.) Rotera (grad.) - - - Object Objekt - - Apply t&o... &Tillämpa på... - Line Rad - Apply format &to... Tillämpa format &på... - MathTran (http://www.mathtran.org/) - locally installed - LaTeX Compiler - TeX &Output - Compile process ended - Compiling process ended with exit code: %1 - LaTeX compile process - dvipng process - - failed to start! - Please verify that you have dvipng installed in the same folder as your LaTeX compiler! - crashed - timedout - write error - read error - unknown error - Compile error - Please set the correct path to the compiler in the preferences dialog! @@ -10668,33 +11221,26 @@ ErrDialog - - Source of errors Felkälla - QtiPlot - Error Bars QtiPlot - Felstaplar - &X Error Bars &X-felstaplar - &Add &Lägg till - Add Error Bars to Lägg till felstaplar till - Percent of data (%) Procent av data (%) @@ -10703,22 +11249,18 @@ 5 - Standard Deviation of Data Standardavvikelse hos data - &Y Error Bars &Y-felstaplar - &Close &Stäng - Existing column Befintlig kolumn @@ -10726,27 +11268,22 @@ ExpDecayDialog - QtiPlot - Verify initial guesses QtiPlot - Verifiera begynnelsegissningar - Exponential Fit of Exponentiell anpassning av - Growth time Ökningstid - Decay time Avklingningstid - First decay time (t1) Första avklingningstid (t1) @@ -10755,22 +11292,18 @@ 1 - Second decay time (t2) Andra avklingningstid (t2) - Third decay time (t3) Tredje avklingningstid (t3) - Amplitude Amplitud - Y Offset Y-offset @@ -10779,32 +11312,26 @@ 0 - Initial time Begynnelsetid - Color Färg - &Fit &Anpassa - &Close &Stäng - QtiPlot - Warning QtiPlot - Varning - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! Kurvan <b> %1 </b> finns inte längre. Åtgärden avbruten! @@ -10812,44 +11339,34 @@ ExponentialFit - Exponential growth Exponentiell tillväxt - Exponential decay Exponentiellt avtagande - ExpGrowth - - amplitude Amplitud - lifetime livslängd - - offset förskjutning - ExpDecay1 - e-folding time @@ -10857,46 +11374,30 @@ ExportDialog - QtiPlot - Export ASCII QtiPlot - Exportera ASCII - Table Tabell - &All &Allt - Separator Separator - - - - - TAB TAB - - - - - SPACE MELLANSLAG - - The column separator can be customized. The following special codes can be used: \t for a TAB character \s for a SPACE @@ -10905,29 +11406,38 @@ \s för MELLANSLAG - - - The separator must not contain the following characters: 0-9eE.+- Skiljetecknet får ej bestå av följande tecken: 0-9eE.+- - Include Column &Names Inkludera kolumn&namn - Export &Selection Export&val - + QtiPlot + QtiPlot + + + Overwrite file? + + + + %1 already exists. + + + + Do you want to replace it? + + + QtiPlot - Export error QtiPlot - Fel vi export - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Kunde inte skriva till filen: <br><h4> %1 </h4><p>Verifiera att du har rättighet att skriva på denna plats! @@ -10940,22 +11450,18 @@ &Avbryt - &Help &Hjälp - QtiPlot - Help QtiPlot - Hjälp - QtiPlot - Import options error QtiPlot - Importalternativfel - Include Column Co&mments Inkludera kolumnkommentarer @@ -10963,19 +11469,76 @@ ExtensibleFileDialog - << &Advanced << &Avancerat<<&Avancerat + ExtractDataDialog + + QtiPlot + QtiPlot + + + Extract Data + + + + For row (i) + För rad (i) + + + to + till + + + Add function + Lägg till funktion + + + Add column + Lägg till kolumn + + + &Apply + &Tillämpa + + + &Close + + + + &Put into table + + + + Table + Tabell + + + Cond&ition: + + + + Add &function + + + + Add co&lumn + + + + Add &operator + + + + Clea&r + &Rensa + + + FFT - - - - - FFT FFT @@ -10992,72 +11555,46 @@ Kunde inte tilldela minne, åtgärden avbröts! - - Forward Framåt - - - - of av - - - Frequency Frekvens - - Inverse Invers - - - Time Tid - - Real Real - - Imaginary Imaginär - - - - Amplitude Amplitud - - Angle Vinkel - Hz Hz - s s @@ -11065,63 +11602,50 @@ FFTDialog - QtiPlot - FFT Options QtiPlot - FFT-alternativ - Curve Kurva - Sampling Sampling - Real Real - Imaginary Imaginär - - Sampling Interval Samplingsintervall - &Normalize Amplitude &Normalisera amplitud - &Shift Results &Skifta resultat - &Inverse &Invers - &Forward &Framåt - &OK &OK - &Close &Stäng @@ -11130,12 +11654,10 @@ QtiPlot - samplingsvärdesfel - QtiPlot - Error QtiPlot - Fel - Please choose a column for the real part of the data! Välj en kolumn för den reella delen av data! @@ -11152,42 +11674,34 @@ Amplitud - QtiPlot QtiPlot - The two matrices have different dimensions, the imaginary part will be neglected! De två matriserna har olika dimension, den imaginära delen tas ej med! - RealMatrixFFT - Real part of the FFT transform of Realdel av FFT-transformen av - ImagMatrixFFT - Imaginary part of the FFT transform of Imaginärdel av FFT-transformen av - AmplitudeMatrixFFT - Amplitudes of the FFT transform of Amplitud hos FFT-transformen av @@ -11195,64 +11709,50 @@ FFTFilter - FFT FFT - Filtered Filtrerad - - QtiPlot QtiPlot - - Error Fel - Unknown filter type. Valid values are: 1 - Low pass, 2 - High Pass, 3 - Band Pass, 4 - Band block. Okänd filtertyp, Giltiga värden är: 1 - logpass, 2 - högpass, 3 - bandpass, 4 - bandsspärr. - Please enter different values for the band limits. mata in skilda värden för bandgränser. - to till - Hz Hz - Low Pass FFT Filter Lågpass FFT-filter - High Pass FFT Filter Högpass FFT-filter - Band Pass FFT Filter Bandpass FFT-filter - Band Block FFT Filter Bandspärr FFT-filter @@ -11260,82 +11760,58 @@ Filter - - - - - - QtiPlot QtiPlot - - - - - Error Fel - Please assign a curve first! Tilldela en kurva först! - Several data points have the same x value causing divisions by zero, operation aborted! Flera datapunkter har samma x-värde, vilket ger division med noll, åtgärden avbryts! - - You need at least %1 points in order to perform this operation! Du behöver mints %1 punkter för att utföra åtgärden! - QtiPlot - Filter Error QtiPlot - Filterfel - Please enter a valid curve name! Skriv in ett giltigt kurvnamn! - QtiPlot - Color Name Error QtiPlot - Färgnamnfel - The color name '%1' is not valid, a default color (red) will be used instead! Färgnamnet '%1' är ogiltigt, en standardfärg (röd) kommer att utnyttjas i stället! - You didn't specify a valid data set for this operation! Du specificerade inte en giltig datamängd för denna åtgärd! - of av - Plot Rita - Memory Allocation Error Minnesallokeringsfel - Not enough memory, operation aborted! Ej tillräckligt med minne, uppgiften avbruten! @@ -11343,22 +11819,18 @@ FilterDialog - QtiPlot - Filter options QtiPlot - Filterval - Filter curve: Filterkurva: - Frequency cutoff (Hz) Lågfrekvensavklippning (Hz) - Low Frequency (Hz) Lågfrekvens (Hz) @@ -11367,38 +11839,30 @@ 0 - High Frequency (Hz) Högfrekvens (Hz) - Add DC Offset Lägg till DC-förspänning - Substract DC Offset Drag bort DC-förspänning - - Color Färg - &Filter &Filter - &Close &Stäng - QtiPlot - Frequency input error QtiPlot - Fel i frekvensindata @@ -11411,7 +11875,6 @@ QtiPlot - Fel i högfrekvensindata - Please enter frequency limits that satisfy: Low < High ! Mata in frekvensgränser som tillfredsställer villkoret: Låg < Hög! @@ -11419,68 +11882,54 @@ FindDialog - QtiPlot QtiPlot - - Find Leta - Start From Börja från - Search in Sök i - &Window Names &Fönsternamn - Window &Labels Fönster&etiketter - Folder &Names Mapp&namn - Case &Sensitive Känsligt för &gemener/VERSALER - &Partial Match Allowed &Delpassning tillåten - &Include Subfolders &Inkludera undermappar - &Find &Leta - &Update Start Path &Uppdatera startsökväg - &Close &Stäng @@ -11488,79 +11937,58 @@ FindReplaceDialog - - - QtiPlot QtiPlot - - Find Leta - Find and Replace Leta och byt ut - Replace with Byt till - &Match case &Matcha stora/små bokstäver - &Whole word &Helt ord - &Next &Nästa - &Previous &Föregående - &Replace &Byt ut - Replace &all Byt ut &allt - &Close &Stäng - - - Empty Search Field Tomt sökfält - - - The search field is empty. Please enter some text and try again. Sökfältet är tomt. Mata in någon text och försök igen. - QtiPlot has finished searching the document. QtoPlot är klar med att söka i dokumentet. @@ -11568,13 +11996,6 @@ Fit - - - - - - - QtiPlot - Fit Error QtiPlot - Anpassningsfel @@ -11587,7 +12008,6 @@ Skriv in ett giltigt kurvnamn! - Plot Rita @@ -11596,118 +12016,94 @@ anpassning av datamängd - using function använder funktion - Weighting Method Viktningsmetod - No weighting Ingen viktning - Instrumental Instrumentell - using error bars dataset använder felstaplars-datamängd - Statistical Statistiskt - Arbitrary Dataset Godtycklig datamängd - Nelder-Mead Simplex Nelder-Mead Simplex - Unscaled Levenberg-Marquardt Oskalad Levenberg-Marquardt - Scaled Levenberg-Marquardt Skalad Levenberg-Marquardt - algorithm with tolerance = algoritm med tolerans = - From x Från x - to x till x - - R^2 R^2 - Iterations Iterationer - Status Status - Dataset Datamängd - Function Funktion - The column %1 has less points than the fitted data set. Please choose another column! - Error Fel - The curve %1 has no associated Y error bars. You cannot use instrumental weighting method. Kurvan %1 har inga kopplade Y-felstaplar. Du kan inte använda instrumentell viktningsmetod. - Parameter Parameter - Value Värde @@ -11716,17 +12112,14 @@ Du specificerade inte en datamängd för denna åtgärd. Åtgärden avbröts! - There are no parameters specified for this fit operation. Operation aborted! Inga parametrar har specificerats för denna anpassningsåtgärd! Åtgärden avbröts! - You must specify a valid fit function first. Operation aborted! Du måste specificera en giltig anpassningsfunktion först. Åtgärden avbröts! - Fit Anpassning @@ -11735,10 +12128,6 @@ av - - - - QtiPlot - Error QtiPlot - Fel @@ -11747,66 +12136,52 @@ Du behöver minst %1 punkter för att genomföra denna åtgärd. Åtgärden avbruten! - You didn't specify a valid data set for this fit operation. Operation aborted! Du specificerade inte en giltig datamängd för denna anpassningsåtgärd. Åtgärden avbruten! - You need at least %1 data points for this fit operation. Operation aborted! Du behöver minst %1 punkter för att genomföra denna åtgärd. Åtgärden avbruten! - The column %1 has less points than the fitted data set. Please choose another column!. - Kolumnen %1 har färre punkter än den anpassade datamängden. Välj en annan kolumn!. + Kolumnen %1 har färre punkter än den anpassade datamängden. Välj en annan kolumn!. - graphics display disabled grafisk visning ej tillgänglig - of dataset av datamängd - You cannot use the instrumental weighting method. Man kan inte använda den "instrumentella" viktningsmetoden. - QtiPlot QtiPlot - File Save Error Fillagringsfel - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Kunde inte skriva till filen: <br><h4> %1 </h4><p>Verifiera att du har rättighet att skriva på denna plats! - QtiPlot Fit Model QtiPlot anpassningsmodell - Cannot read file %1: %2. Kan ej läsa %!: %2. - - - Please perform a fit first! Genom för en anpassning först! @@ -11815,131 +12190,94 @@ Residuer - Residuals of %1 Residuer av %1 - residue residu - Adjusted R^2 Justerad R² - RMSE (Root Mean Squared Error) RMSE (Root Mean Squared Error) - RSS (Residual Sum of Squares) RSS (Residual summa av kvadrater) - FitResiduals FitResiduals - - FitStats FitStats - Confidence Limits of %1 Konfidensgränser för %1 - - Independent Variable Oberoende variabel - LCL LCL - Lower %1 Confidence Limit Lägra %1 konfidensgräns - UCL UCL - Upper %1 Confidence Limit Övre %1 konfidensgräns - Prediction Limits of %1 Prediktionsgränser för %1 - LPL LPL - Lower %1 Prediction Limit Lägre %1 prediktionsgräns - UPL UPL - Upper %1 Prediction Limit Övre %1 prediktionsgräns - Direct Weighting using Dataset Direkt viktning med datamängd - - - - - - - QtiPlot - Memory Allocation Error QtiPlot - Minnesallokeringsfel - - Could not allocate enough memory for the fit curves! Kunde inte tilldela tillräckligt med minne för anpassningskurvorna! - QtiPlot - Memory Allocation Error QtiPlot - Minnesallokeringsfel - - - - - - Not enough memory! Ej tillräckligt med minne! @@ -11951,108 +12289,86 @@ QtiPlot - Ickelinjär kuvanpasssning - Curve Kurva - - Function Funktion - Initial guesses Initial gissning - Parameter Parameter - Value Värde - Constant Konstant - Error Fel - Algorithm Algoritm - Scaled Levenberg-Marquardt Skalad Levenberg-Marquardt - Unscaled Levenberg-Marquardt Oskalad Levenberg-Marquardt - Nelder-Mead Simplex Nelder-Mead Simplex - Color Färg - From x= Från x= - To x= Till x= - Iterations Iterationer - Tolerance Tolerans - Weighting Method - Viktningsmetod + Viktningsmetod - No weighting Ingen viktning - Instrumental Instrumentell - Statistical Statistiskt - Arbitrary Dataset Godtycklig datamängd @@ -12061,19 +12377,14 @@ << &Redigera funktion - &Delete Fit Curves &Tag bort anpassade kurvor - &Fit &Anpassa - - - &Close &Stäng @@ -12082,43 +12393,34 @@ Anpassad &utdata>> - Category Kategori - Expression Uttryck - User defined Användardefinierad - Built-in Inbyggd - Basic Grundläggande - Plugins Plugin - Fit with &built-in function Anpassa med in&byggd funktion - - Polynomial Order Polynomordning @@ -12131,44 +12433,34 @@ Rensa användar&lista - Name Namn - user1 användare1 - - &Save &Spara - - Parameters Parametrar - &Remove &Tag bort - Add &expression Lägg till &uttryck - Add &name Lägg till &namn - Rese&t Åters&täll @@ -12177,48 +12469,38 @@ &Anpassa >> - &Uniform X Function Likformig X-f&unktion - Points Punkter - Same X as Fitting &Data Samma X som anpassnings&data - Generated Fit Curve Skapad anpasssningskurva - Significant Digits Signifikanta siffror - Parameters &Table parameter&tabell - - Name: Namn: - Covariance &Matrix Kovarians&matris - CovMatrix KovMatris @@ -12227,17 +12509,14 @@ Skalningfel med sqrt(Chi^2/doF) - Parameters Output Parameterutdata - &Write Parameters to Result Log Skri&v parametrar till resultatlogg - &Paste Parameters to Plot Klistra in &parametrar i diagram @@ -12246,57 +12525,34 @@ << &Anpassa - &Apply &Tillämpa - - - - - - - QtiPlot - Error QtiPlot - Fel - Please enter a valid name for the parameters table. Skriv in ett giltigt namn på parametertabellen. - - - - - Please perform a fit first and try again. Genomför en anpassning först och försök igen. - Please enter a valid name for the covariance matrix. Skriv in ett giltigt namn på kovariansmatrisen. - - - - - QtiPlot - Input function error QtiPlot - Fel i indatafunktion - - Please enter a valid function! Mata in en giltig funktion! - Please enter a function name! Mata in ett funktionsnamn! @@ -12305,12 +12561,10 @@ Mata in åtminstone ett parameternamn! - QtiPlot - Error: function name QtiPlot - Fel: funktionsnamn - is a built-in function name<p>You must choose another name for your function! är ett inbyggt funktionsnamn<p>Du måste välja ett annat namn på din funktion! @@ -12319,55 +12573,42 @@ Du kan inte definiera funktioner rekursivt! - Fit with selected &user function Anpassad med vald an&vändarfunktion - Fit using &built-in function Anpassa med in&byggd funktion - Fit using &plugin function Anpassa med &plugin-funktion - Choose the plugins folder Välj plugin-mappen - - Gauss Gauss - Peaks Toppar - - Lorentz Lorentz - - Polynomial Polynomisk - QtiPlot - Warning QtiPlot - Varning - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! Kurvan <b> %1 </b> finns inte längre. Åtgärden avbruten! @@ -12380,12 +12621,10 @@ QtiPlot - Slutgränsfel - QtiPlot - Input error QtiPlot - Indatafel - Please enter x limits that satisfy: from < end! Mata in x-gränser som tillfredställer villkoret: från < slut! @@ -12398,7 +12637,6 @@ Toleransvärdet måste vara positivt och mindre än 1! - Please verify that you have initialized all the parameters! Verifiera att du har initialiserat alla parametrarna! @@ -12411,148 +12649,128 @@ Mata in begynnelsegissningar för dina parametrar! - - No data tables Inga datatabeller - QtiPlot - Fit Wizard QtiPlot - Anpassningshjälpreda - &Preview &Förhandsgranskning - From Från - + Data Set + + + + Weighting + + + + Re&load + + + + &Guess + &Gissa + + + &Range + + + To Till - - - Select Function - - - - Fitting Session - - - Custom Output - - Choose plug&ins folder... Välj plug&in-mapp... - Start Fitting Session - &One table for all fits &En tabell för alla anpassningar - You can't define functions recursively! Du kan inte definiera funktioner rekursivt! - - QtiPlot fit model QtiPlot anpassningsmodell - - All files Alla filer - - - QtiPlot QtiPlot - - Save Fit Model As Spara anpassningsmodell som - Are you sure you want to remove fit model file: %1 ? Är du säker på att du vill ta bort anpassningsmodellfil: %1 ? - Remove Fit Model Tag bort anpassningsmodell - Choose &models folder... Väl&j modellmapp... - Choose the fit models folder Välj modellanpassningsmappen - &Residuals Plot &Residudiagram - Co&nf. Bands Ko&nf. band - Pred. &Bands Pred. &band - &Scale Errors with sqrt(Chi^2/doF) &Skalfel med sqrt(Chi^2/doF) - Direct Weighting Direkt viktning - Error: Fel: @@ -12564,12 +12782,10 @@ Folder - kB kB - bytes byte @@ -12577,108 +12793,86 @@ FrequencyCountDialog - QtiPlot - Frequency count QtiPlot - Fel i frekvensräkning - Statistics on %1 Statistik för %1 - Mean Medel - Standard Deviation Standardavvikelse - Median Median - Size Storlek - From Minimum Från minimum - To Maximum Till maximum - Step Size - &Apply &Tillämpa - &Cancel &Avbryt - &Ok &Ok - QtiPlot - Error QtiPlot - Fel - Not enough data points, operation aborted! Inte tillräckligt med datapunkter, åtgärd avbruten! - QtiPlot - Frequency input error QtiPlot - Fel i frekvensindata - Please enter frequency limits that satisfy: From < To ! Mata in frekvensgränser som uppfyller: Från < Till! - - Count Räkna - Frequency count of %1 Frekvensräkning på %1 - BinCtr BinCtr - BinEnd BinEnd - Sum Summa @@ -12686,97 +12880,98 @@ FunctionDialog - Clear list - Rensa lista + Rensa lista - Clear Function - Rensa funktion + Rensa funktion - QtiPlot - Add function curve QtiPlot - Lägg till funktionskurva - Curve type Kurvtyp - + Click here to select a recently typed expression + + + + Rece&nt + + + f(x)= f(x)= - From x= Från x= - To x= Till x= - - - Points Punkter - - Parameter Parameter - - To Till - + QtiPlot + QtiPlot + + + Sorry, there are no recent expressions available! + + + + Recent Functions + + + + Please, choose a function: + + + y = y= - x = x= - - From Från - R = R = - Theta = Teta = - Function Funktion - Parametric plot Parametriskt diagram - Polar plot Polärt diagram @@ -12789,71 +12984,50 @@ Ok - - QtiPlot - Start limit error - QtiPlot - Startgränsfel + QtiPlot - Startgränsfel - - QtiPlot - End limit error - QtiPlot - Slutgränsfel + QtiPlot - Slutgränsfel - - - QtiPlot - Input error QtiPlot - Indatafel - Please enter x limits that satisfy: from < end! Mata in x-gränser som tillfredställer villkoret: från < slut! - - - - - QtiPlot - Input function error QtiPlot - Fel i indatafunktion - - Please enter parameter limits that satisfy: from < end! Mata in parameter-gränser som tillfredställer villkoret: från < slut! - Clea&r Function &Rensa funktion - &Ok &Ok - &Close &Stäng - Constant Konstant - Value Värde - &Add Function @@ -12877,32 +13051,26 @@ (bredd) - GaussAmp - GaussAmp Fit GaussAmp-anpassning - offset förskjutning - amplitude amplitud - center centrum - width bredd @@ -12910,7 +13078,6 @@ GaussFit - Gauss Gauss @@ -12931,27 +13098,22 @@ (offset) - Gauss Fit Gaussanpassning - area yta - center centrum - width bredd - offset förskjutning @@ -12967,9 +13129,6 @@ Höger - - - QtiPlot - Warning QtiPlot - Varning @@ -12986,7 +13145,6 @@ Topp %1 vald! Klicka för att välja punkt och dubbelklicka/tryck 'Retur' för att ställa in position för nästa punkt! - Title Titel @@ -13003,12 +13161,10 @@ QtiPlot - Flytta punktfel - QtiPlot - File open error QtiPlot - Filöppningsfel - Image file: <p><b> %1 </b><p>does not exist anymore! Bildfil: <p><b> %1 </b><p> finns inte längre! @@ -13017,22 +13173,18 @@ QtiPlot - Fel i indatafuktion - The columns Kolumnerna - are empty and will not be added to the plot! är tomma och kommer ej att läggas till diagrammet! - The column Kolumnen - is empty and will not be added to the plot! är tom och kommer ej att läggas till diagrammet! @@ -13041,46 +13193,34 @@ Klipp &ut - - &Copy &Kopiera - - &Delete &Tag bort - - - &Properties... &Egenskaper... - &Rescale to show all &Skala om för att visa allt - Ctrl+Shift+R Ctrl+Shift+S - &Hide axis &Dölj axlar - &Show grids &Visa rutnät - &Scale... &Skala... @@ -13355,22 +13495,14 @@ Bandsspärr-FFT-filter av - There are no curves available on this plot! Det finns inga kurvor tillgängliga på detta diagram! - - - - - - QtiPlot - Error QtiPlot - Fel - There are no curves with more than two points on this plot. Operation aborted! Det finns inga kurvor med mer än två punkter i detta diagram. Åtgärd avbruten! @@ -13443,49 +13575,38 @@ medelvärdesutjämning av - - Please provide a valid file name! Ange ett giltigt filnamn! - File format not handled, operation aborted! Filformatet hanteras ej, avbryts! - layer - Data set generated from curve Datamängd genererad från kurva - Table - Tabell + Tabell - F F - - Couldn't change the axis type to the requested format! Kunde inte ändra axeltyp till det begärda formatet! - Y Axis Title Y-axeltitel - X Axis Title X-axeltitel @@ -13494,14 +13615,10 @@ - - Cu&t Klipp u&t - - C&lear &Rensa @@ -13509,17 +13626,14 @@ Graph3D - X axis X-axel - Y axis Y-axel - Z axis Z-axel @@ -13564,20 +13678,14 @@ Kunde inte skriva till fil: <br><h4> - - - QtiPlot - Error QtiPlot - Fel - - Please provide a valid file name! Ange ett giltigt filnamn! - File format not handled, operation aborted! Filformatet hanteras ej, avbryts! @@ -13636,7 +13744,6 @@ ImageExportDialog - QtiPlot - Choose a filename to save under QtiPlot - Välj ett filnamn att sparas under @@ -13645,7 +13752,6 @@ Visa exp&ortval - Resolution (DPI) Upplösning (DPI) @@ -13658,17 +13764,14 @@ Exportera till &standardpappersstorlek - &Keep aspect ratio Behåll aspe&kten - Image quality Bildkvalitet - Save transparency Spara tarnsparens @@ -13677,117 +13780,118 @@ An&passad sidstorlek - Native fonts Ursprungliga teckensniitt - LaTeX file LaTeX-fil - Export 3D texts as Exportera 3D-texter som - Export in &color - - &Escape special characters in title/axis labels - - - - Export &font sizes - Bitmap images Bitmapbilder - 3D Sort mode 3D-sorteringsmod - No sort Ingen sortering - Simple sort Enkel sortering - BSP sort BSO-sortering - inch tum - mm mm - cm cm - point punkt - pixel pixel - Unit Enhet - Width Bredd - Height Höjd - + QtiPlot + QtiPlot + + + Overwrite file? + + + + %1 already exists. + + + + Do you want to replace it? + + + + QtiPlot - Export error + QtiPlot - Fel vi export + + + Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! + Kunde inte skriva till filen: <br><h4> %1 </h4><p>Verifiera att du har rättighet att skriva på denna plats! + + Custom print size Anpassad utskriftsstorlek - + &Escape special characters in texts + + + Scale Fonts Factor - Automatic Automatiskt - Print Resolution (DPI) @@ -13820,20 +13924,35 @@ + ImageProfilesTool + + Position + Position + + + x + + + + y + + + + Z-Value + + + + ImageWidget - - QtiPlot - File openning error QtiPlot - Filöppningsfel - The file: <b>%1</b> doesn't exist! Filen: <b>>%1</b> saknas! - You don't have the permission to open this file: <b>%1</b> Du har inte tillåtelse att öppna denna fil: <b>%1</b> @@ -13841,48 +13960,38 @@ ImportASCIIDialog - QtiPlot - Import ASCII File(s) QtiPlot - Importera ASCII-fil(er) - All files Alla filer - Text files Textfiler - Data files Datafiler - Comma Separated Values Kommaseparerade värden - Import each file as: Importera varje fil som: - - New Table Ny tabell - New Columns Nya kolumner - New Rows Nya rader @@ -13891,29 +14000,18 @@ Skriv över aktuell tabell - Separator: Skiljetecken: - - - - - TAB TAB - - - - SPACE MELLANSLAG - The column separator can be customized. The following special codes can be used: \t for a TAB character @@ -13924,19 +14022,16 @@ \s för MELLANSLAG - The separator must not contain the following characters: 0-9eE.+- Skiljetecknet får ej bestå av följande tecken: 0-9eE.+- - Ignore first Hoppa över första - lines rader @@ -13945,12 +14040,10 @@ Använd första raden till att &namnge kolumner - &Remove white spaces from line ends Tag bo&rt "vita" mellanslag från radslut - By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. @@ -13960,7 +14053,6 @@ raderna i ASCII-filen. - Warning: checking this option leads to column overlaping if the columns in the ASCII file don't have the same number of rows. @@ -13969,8 +14061,6 @@ har samma antal rader. - - To avoid this problem you should precisely define the column separator using TAB and SPACE characters. @@ -13980,12 +14070,10 @@ MELLANSLAG. - &Simplify white spaces Förenkla "vita" mellan&slag - By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal @@ -13998,7 +14086,6 @@ att bytas mot ett enda MELLANSLAG. - Warning: checking this option leads to column overlaping if the columns in the ASCII file don't have the same number of rows. @@ -14008,12 +14095,10 @@ har samma antal rader. - Decimal Separators Decimalskiljare - System Locale Setting Systemlokaliseringsinställning @@ -14026,12 +14111,10 @@ Ko&m ihåg ovanstående val - &Help &Hjälp - The column separator can be customized. The following special codes can be used: \t for a TAB character \s for a SPACE @@ -14040,62 +14123,50 @@ \s för MELLANSLAG - The separator must not contain the following characters: 0-9eE.+- Skiljetecknet får ej bestå av följande tecken: 0-9eE.+- - Remove white spaces from line ends Tag bort "vita" mellanslag från radslut - By checking this option all white spaces will be removed from the beginning and the end of the lines in the ASCII file. Genom att markera detta val, kommer alla "vita" mellanslag i början och slutet av raderna i ASCII-filen att tas bort. - Simplify white spaces Förenkla "vita" mellanslag - By checking this option each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. Genom att markera detta val, kommer varje följd av "vita" mellanslag (inklusive tabulator) att ersättas av ett mellanslag. - By checking this option all white spaces will be removed from the beginning and the end of the lines and each sequence of internal whitespaces (including the TAB character) will be replaced with a single space. Genom att markera detta val, kommer alla "vita" mellanslag i början och slutet av raderna i ASCII-filen att tas bort samt varje följd av inre "vita" mellanslag (inkl. tabulatortecken) att ersättas med ett mellanslag. - Warning: using these two last options leads to column overlaping if the columns in the ASCII file don't have the same number of rows. Varning: vid användandet av de två sista valen, kommer att leda till kolumnöverlappning om kolumnerna i ASCII-filen inte har samma antal rader. - To avoid this problem you should precisely define the column separator using TAB and SPACE characters. För att undvika detta problem, bör du exakt definiera kolumnseparatorn genom att använda tabulator- coh mellanslagstecken. - QtiPlot - Help QtiPlot - Hjälp - Ignore lines starting with Uteslut rader, som börjar med - Use second row as &comments Används andra raden som &kommentarer - Import as &read-only Importera som sk&rivskyddat @@ -14108,7 +14179,6 @@ Linjer - All Allt @@ -14129,68 +14199,58 @@ Välj en fil först! - &Preview Lines &Förhandsgranska rader - - New Matrice Ny matris - Overwrite Current Window Skriv över aktuellt fönster - + New Matrix + + + Use first row &as - Column Names - Column Comments - Endline character Radslutstecken - LF (Unix) LF (Unix) - CRLF (Windows) CRLF (Windows) - CR (Mac) CR (Mac) - QtiPlot - File openning error QtiPlot - Filöppningsfel - You don't have the permission to open this file: <b>%1</b> Du har inte tillåtelse att öppna denna fil: <b>%1</b> - Omit &thousands separator Uteslut &tusentalsåtskiljare @@ -14431,7 +14491,6 @@ IntDialog - QtiPlot - Integration Options QtiPlot - Integrationsalternativ @@ -14448,22 +14507,18 @@ Antal iterationer (Max=40) - Tolerance Tolerans - Lower limit Undre gräns - Upper limit Övre gräns - &Integrate &Integrera @@ -14472,7 +14527,6 @@ &Hjälp - &Close &Stäng @@ -14549,22 +14603,18 @@ Gränserna måste vara inom definitionsområdet för x; om du inte vet maximum- (minimum-) värde på x, skriv max (min) i fältet. - Function Funktion - Variable Variabel - Order (1 - 5, 1 = Trapezoidal Rule) Ordning (1 - 5, 1 = trapetsregel) - Number of iterations (Max=20) Antal iterationer (Max=20) @@ -14573,7 +14623,6 @@ Rita yta - &Plot area &Rityta @@ -14581,8 +14630,6 @@ Integration - - Integration Integrering @@ -14591,23 +14638,18 @@ Rita - - Numerical integration of Numerisk integration av - using a %1 order method genom en %1-ordningens metod - Iterations Iterationer - Tolerance Tolerans @@ -14616,58 +14658,46 @@ max - Points Punkter - from från - - to till - Peak at Topp vid - Area Yta - QtiPlot - Error QtiPlot - Fel - Unknown integration method. Valid values must be in the range: 1 (Trapezoidal Method) to 5. Okänd integrationsmetod. Giltiga värden måste vara i området: 1 (Trapestmetod) till 5. - Plot Rita - QtiPlot - Input error QtiPlot - Indatafel - From Från - using the Trapezoidal Rule använder trapetsregel @@ -14675,78 +14705,46 @@ Interpolation - - QtiPlot QtiPlot - - Error Fel - Unknown interpolation method. Valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. Okänd interpoleringsmetod. Giltiga värden måste vara i området: 0- linjär, 1 - kubisk, 2- Akima. - - - - Linear Linjär - - - - - - Int Int - - - - - - Interpolation Interpolation - - - - Cubic Kubisk - - - - Akima Akima - QtiPlot - Error QtiPlot - Fel - Unknown interpolation method, valid values are: 0 - Linear, 1 - Cubic, 2 - Akima. Okänd interpoleringsmetod. Giltiga värden måste vara i området: 0- linjär, 1 - kubisk, 2- Akima. - You need at least %1 points in order to perform this operation! Du behöver mints %1 punkter för att utföra åtgärden! @@ -14754,42 +14752,34 @@ InterpolationDialog - QtiPlot - Interpolation Options QtiPlot - Interpoleringsalternativ - Make curve from Gör en kurva från - Spline Anpassad kurva - Linear Linjär - Cubic Kubisk - Non-rounded Akima Icke-avrundad Akima - Points Punkter - From Xmin Från Xmin @@ -14798,32 +14788,26 @@ 0 - To Xmax Till Xmax - Color Färg - &Make &Gör - &Close &Stäng - QtiPlot - Warning QtiPlot - Varning - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! Kurvan <b> %1 </b> finns inte längre. Åtgärden avbruten! @@ -14836,12 +14820,10 @@ QtiPlot - Slutgränsfel - QtiPlot - Input error QtiPlot - Indatafel - Please enter x limits that satisfy: from < to! Mata in x-gränser som tillfredställer villkoret: från < till! @@ -14849,7 +14831,6 @@ LayerButton - Activate layer @@ -14857,7 +14838,6 @@ LayerDialog - QtiPlot - Arrange Layers QtiPlot - Arrangera lager @@ -14866,43 +14846,34 @@ Antal lager - Automatic &layout Automatisk &layout - Horizontal Horisontell - - Center Centrum - Left Vänster - Right Höger - Vertical Vertikal - Top Topp - Bottom Botten @@ -14911,79 +14882,58 @@ Uppriktning - Columns Kolumner - Rows Rader - Grid Rutnät - &Layer Canvas Size &Lager-kanvasstorlek - Width Bredd - - - - - - - - pixels pixlar - Height Höjd - Columns gap Kolumngap - Rows gap Radgap - Left margin Vänster marginal - Right margin Höger marginal - Top margin Toppmarginal - Bottom margin Bottenmarginal - Spacing Mellanrum @@ -15012,116 +14962,145 @@ Teckensnitt - &Apply &Tillämpa - &OK &OK - - &Cancel &Avbryt - QtiPlot - Delete Layers? QtiPlot - Tag bort lager? - You are about to delete %1 existing layers. Du är på väg att ta bort %1 befintliga lager. - Are you sure you want to continue this operation? Är du säker på att du vill fortsätta denna åtgärd? - &Continue &Fortsätt - QtiPlot - Columns input error QtiPlot - Kolumnindatafel - The number of columns you've entered is greater than the number of graphs (%1)! Det antal kolumner du har matat in är större än antalet diagram (%1)! - QtiPlot - Rows input error QtiPlot - Radindatafel - The number of rows you've entered is greater than the number of graphs (%1)! Det antal rader du har matat in är större än antalet diagram (%1)! - Layers Lager - Number Tal - Alignment Upplinjering - + Unit + Enhet + + + inch + + + + mm + mm + + + cm + cm + + + point + punkt + + + pixel + pixel + + + &Keep aspect ratio + Behåll aspe&kten + + + Margins + + + Swap Layers Byt lager - Source Layer Källager - Destination Layer Mållager - &Swap B&yt - QtiPlot - Error QtiPlot - Fel - Please enter different indexes for the source and destination layers! Skriv in olika index för käll- och mållager! + + Link &X axes + + + + &Fixed size + + + + Align + + + + Canvases + + + + Co&mmon axes + + LineDialog - QtiPlot - Line options QtiPlot - Linje-alternativ - Color Färg @@ -15154,12 +15133,10 @@ 5 - Arrow at &start Pil vid &början - Arrow at &end Pil vid &slut @@ -15168,78 +15145,62 @@ &Alternativ - Length Längd - Angle Vinkel - &Filled &Fylld - Arrow &Head Pil&huvud - Set &Default Sätt stan&dard - &Apply &Tillämpa - &Ok &Ok - Page - Layer Scales - Attach to - Scale Coordinates Skala koordinater - Pixels Pixlar - Unit Enhet - Start Point Startpunkt - - X X @@ -15248,33 +15209,26 @@ Till - End Point Slutpunkt - &Geometry &Geometri - - Y Y - Type Typ - Width Bredd - &Line &Linje @@ -15282,43 +15236,42 @@ LineProfileTool - - QtiPlot - Pixel selection warning QtiPlot - Pixel-valsvarning - Please select an image marker first. Välj en bildmarkering först. - Please select the end line point inside the image rectangle! Välj linjens slutpunkt innanför bildrektangeln! - pixel pixel - intensity intensitet - + x + + + + y + + + Table - Tabell + Tabell - pixels pixlar - pixel intensity (a.u.) pixelintensitet ("a.u.") @@ -15326,22 +15279,18 @@ LinearFit - Linear Regression Linjär regression - Linear Linjär - QtiPlot - Fit Error QtiPlot - Anpassningsfel - You need at least %1 data points for this fit operation. Operation aborted! Du behöver minst %1 punkter för att genomföra denna anpassningsåtgärd. Åtgärden avbruten! @@ -15349,22 +15298,18 @@ LinearSlopeFit - Linear Regression Linjär regression - LinearSlope Linjärlutning - QtiPlot - Fit Error QtiPlot - Anpassningsfel - You need at least %1 data points for this fit operation. Operation aborted! Du behöver minst %1 punkter för att denna anpassning. Åtgärden avbruten! @@ -15372,32 +15317,26 @@ LogisticFit - Logistic Logistik - init value begynnelsevärde - final value slutvärde - center centrum - power effekt - Logistic Fit Logistisk anpassning @@ -15405,7 +15344,6 @@ LorentzFit - Lorentz Lorentz @@ -15426,27 +15364,22 @@ (offset) - Lorentz Fit Lorenzanpassning - area yta - center centrum - width bredd - offset förskjutning @@ -15462,21 +15395,14 @@ Avbryt - - - - - QtiPlot - Error QtiPlot - Fel - Calculation failed, the matrix is not square! Beräkning misslyckades, matrisen är ej kvadratisk! - Inversion failed, the matrix is not square! Inversionen misslyckades, matrisen är ej kvadratisk! @@ -15497,7 +15423,6 @@ - Ctrl+A Matrix: select all Ctrl+A @@ -15513,120 +15438,90 @@ <p>Vill du verkligen fortsätta? - - - - - - QtiPlot QtiPlot - - Please provide a valid file name! Ange ett giltigt filnamn! - File format not handled, operation aborted! Filformatet hanteras ej, avbryter! - QtiPlot - ASCII Export Error QtiPlot - ASCII exportfel - Could not write to file: <br><h4>%1</h4><p>Please verify that you have the right to write to this location! Kunde inte skriva till filen: <br><h4> %1 </h4><p>Verifiera att du har rättighet att skriva på denna plats! - Set Dimensions Ställ in dimensioner - Invert Invertera - Transpose Transponera - Flip Vertically Vik vertikalt - Flip Horizontally Vik horisontellt - Rotate 90° Rotera 90 - - Calculate Values Beräkna värden - Clear Selection Rensa valet - Paste Klistra in - Delete Rows Tag bort rader - Delete Columns Tag bort kolumn - Insert Row Sätt in rad - Insert Column Sätt in kolumn - - Import Image Importera bild - Forward FFT Framåt FFT - Inverse FFT Omvänd FFT - Import ASCII File Importera ASCII-fil @@ -15639,46 +15534,30 @@ Fel - - - - - Memory Allocation Error Minnesallokeringsfel - - - - - Not enough memory, operation aborted! Ej tillräckligt med minne, uppgiften avbruten! - Rotate -90° Rotera -90 - Due to memory limitations it will not be possible to undo this change. Do you want to continue anyways? P. g. a. minnesbegränsningar är det inte möjligt att ångra denna ändring. Vill du fortsätta ändå? - Warning Varning - - Set Data Mode Ställ in dataläge - kB kB @@ -15686,82 +15565,66 @@ MatrixDialog - Cell Width Cell bredd - Data Format Dataformat - Numeric Display Numerisk display - QtiPlot - Matrix Properties QtiPlot - Matrisegenskaper - &OK &OK - &Cancel &Avbryt - &Apply &Tillämpa - Decimal: 1000 Decimal: 1000 - Scientific: 1E3 Vetenskalpligt: 1E3 - Default Decimal Digits Standarddecimala siffror - Significant Digits= Signifikanta siffror= - Set Columns Width Ställ in kolumnbredd - Decimal Decimal - Scientific Vetenskalplig - Set Data Format %1 Ställ in dataformat %1 - Precision %1 digits Precision %1 siffror @@ -15769,52 +15632,38 @@ MatrixModel - Edited cell Redigera cell - - - - QtiPlot QtiPlot - - Memory Allocation Error Minnesallokeringsfel - - Not enough memory, operation aborted! Ej tillräckligt med minne, uppgiften avbruten! - Input Size Error Indatastorleksfel - The dimensions you have specified are not acceptable! De dimensioner du valt kan ej accepteras! - Please enter positive values for which the product rows*columns does not exceed the maximum integer value available on your system! Mata in ett positivt värde för vilket produkten rader*kolumner inte överskrider det maximala heltalsvärde tillgängligt i ditt system! - Multiline expressions take much more time to evaluate! Do you want to continue anyways? Flerradiga uttryck tar mycket längre tid att utvärdera! Vill du fortsätta ändå? - Warning Varning @@ -15822,57 +15671,46 @@ MatrixSizeDialog - Dimensions Dimensioner - Coordinates Koordinater - Rows Rader - Columns Kolumner - X (Columns) X (Kolumner) - Y (Rows) Y (Rader) - First Först - Last Sist - QtiPlot - Matrix Dimensions QtiPlot - Matrisdimensioner - &OK &OK - &Cancel &Avbryt @@ -15881,12 +15719,10 @@ QtiPlot - Indatafel - Set Coordinates x[%1 : %2], y[%3 : %4] Ställ in koordinater x[%1 : %2],y[%3 : %4] - &Apply &Tillämpa @@ -15894,23 +15730,18 @@ MatrixValuesDialog - QtiPlot - Set Matrix Values QtiPlot - Sätt matrisvärden - For row (i) För rad (i) - - to till - For col (j) För kol (j) @@ -15923,7 +15754,6 @@ Lägg till cell - Cell(i,j)= Cell(i,j)= @@ -15940,32 +15770,26 @@ Avbryt - Add &Function Lägg till &funktion - Add Ce&ll Lägg till c&ell - &Apply &Tillämpa - &Close &Stäng - Set New Formula Ställ in ny formel - Use built-in muParser (much faster) Använd inbyggd muParser (mycket snabbare) @@ -15973,47 +15797,38 @@ MdiSubWindow - QtiPlot QtiPlot - Do you want to hide or delete Vill du dölja eller ta bort - Delete Tabort - Hide Dölj - Cancel Avbryt - Normal Normal - Minimized Minimerad - Maximized Maximerad - Hidden Gömd @@ -16022,7 +15837,6 @@ kB - B B @@ -16034,22 +15848,18 @@ QtiPlot - Gissa bästa ursprung för det nya lagret? - Do you want QtiPlot to rearrange the remaining layers? Vill du att QtiPlit skall arrangera om de återstående lagren? - &Yes &Ja - &No &Nej - &Cancel &Avbryt @@ -16058,101 +15868,78 @@ mata in din text här - Add layer - Remove active layer - QtiPlot - Guess best layout? QtiPlot - Gissa bästa layout? - - - QtiPlot - Error QtiPlot - Fel - - Please provide a valid file name! Ange ett giltigt filnamn! - File format not handled, operation aborted! Filformatet hanteras ej, avbryts! - kB kB - Offset Amount... - Reverse Order - Fill Area... - Offset Dialog - Total Y Offset (%) - Total X Offset (%) - &Apply &Tillämpa - - &Close - Fill Curves - Enable Fill - Fill with Color - Side Lines @@ -16164,106 +15951,78 @@ Mångtopp - Gauss Gauss - Lorentz Lorentz - multi-peak mångtopp - - - Peak Topp - QtiPlot - Fit Error QtiPlot - Anpassningsfel - Could not allocate enough memory for the fit curves! Kunde inte tilldela tillräckligt med minne för anpassningskurvorna! - - - Fit Anpassa - fit of anpassning av - - peak topp - Area Yta - Center Centrum - Width Bredd - Height Höjd - Gauss Fit Gaussanpassning - Lorentz Fit Lorenzanpassning - - area yta - - center centrum - - width bredd - - offset förskjutning @@ -16271,12 +16030,10 @@ MultiPeakFitTool - Move cursor and click to select a point and double-click/press 'Enter' to set the position of a peak! Flytta markör och klicka för att välja en punkt och dubbelklicka/tryck vagnretur för att markera platsen för en topp! - Peak %1 selected! Click to select a point and double-click/press 'Enter' to set the position of the next peak! Topp %1 vald! Klicka för att välja punkt och dubbelklicka/tryck 'Retur' för att ställa in position för nästa punkt! @@ -16327,7 +16084,6 @@ NonLinearFit - NonLinear Icke-linjär @@ -16336,44 +16092,38 @@ Icke-linjär - - QtiPlot - Input function error QtiPlot - Fel i indatafunktion - Please enter a valid non-empty expression! Operation aborted! Skriv in ett giltigt, ej tomt, uttryck! Åtgärden avbröts! - - QtiPlot - Fit Error QtiPlot - Anpassningsfel - There are no parameters specified for this fit operation. Please define a list of parameters first! Inga parametrar har specificerats för denna anpassningsåtgärd! Definiera en lista med parameterar först! + Ignore + + + You must provide a list containing at least 2 parameters for this type of fit. Operation aborted! Du måste tillhandahålla en lista med åtminstone 2 parametrar för denna anpassningstyp. Åtgärden avbröts! - You must provide a list containing at least one parameter for this type of fit. Operation aborted! Du måste lämna en lista med åtminstone en parameter för denna typ av anpasssning. Åtgärden avbruten! - Non-linear Fit Icke-linjär anpassning - - constant konstant @@ -16381,22 +16131,18 @@ Note - Add tab - Please, enter new title: - Title Titel - untitled @@ -16404,62 +16150,58 @@ OpenProjectDialog - QtiPlot - Open Project QtiPlot - Öppna projekt - QtiPlot project QtiPlot-projekt - Compressed QtiPlot project Komprimerat QtiPlot-projekt - Origin project Origin projekt - Origin matrix Originmatris - Origin worksheet Origin arbetsblad - Origin graph Origindiagram - Backup files Säkerhetsfiler - + Excel + + + + ODF Spreadsheet + + + All files Alla filer - Open As Öppna som - New Project Window Nytt projektfönster - New Folder Ny mapp @@ -16467,77 +16209,62 @@ PatternBox - Solid Massiv - Horizontal Horisontell - Vertical Vertikal - Cross Kors - BDiagonal BDiagonal - FDiagonal FDiagonal - DiagCross DiagKors - Dense1 Täthet1 - Dense2 Täthet2 - Dense3 Täthet3 - Dense4 Täthet4 - Dense5 Täthet5 - Dense6 Täthet6 - Dense7 Täthet17 - None Ingen @@ -16663,110 +16390,86 @@ Plot3DDialog - QtiPlot - Surface Plot Options QtiPlot - Ytdiagramalternativ - &Apply &Tillämpa - &OK &OK - &Cancel &Avbryt - - X X - - Y Y - - Z Z - From Från - To Till - Type Typ - linear linjär - logarithmic logaritmisk - Major Ticks Huvudskalstreck - Minor Ticks Delskalstreck - &Scale &Skala - Title Titel - Axis Font Axelteckensnitt - &Choose font &Välj teckensnitt - Major Ticks Length Huvudskalstreckslängd - Minor Ticks Length Delskalstreckslängd - &Axis &Axel @@ -16775,12 +16478,10 @@ &Färg - &Font &Teckensnitt - &Title &Titel @@ -16801,17 +16502,14 @@ Data - &Line &Linje - &Background &Bakgrund - General Allmänt @@ -16820,12 +16518,10 @@ &Axlar - Lab&els Etik&etter - &Numbers &Tal @@ -16834,206 +16530,166 @@ &Rutnät - Coordinate System Koordinatsystem - Opacity Genomskinlighet - + Scale to paper si&ze + + + + Print Crop&marks + Skriv ut urklipps&markeringar + + + &Print + &Skriv ut + + &Colors &Färg - Show Legend Visa beskrivning - Orthogonal Vinkelrät - - Line Width Linjebredd - Resolution Upplösning - Numbers Font Talteckensnitt - &Choose Font &Välj teckensnitt - Distance labels - axis Avstånd etiketter - axlar - Zoom (%) Zoom (%) - X Zoom (%) X Zoom (%) - Y Zoom (%) Y Zoom (%) - Z Zoom (%) Z Zoom (%) - &General &Allmänt - Ma&jor Grids - Mi&nor Grids - Color Färg - - Style Stil - - Solid Massiv - - Dash - - - Dot Punkt - - Dash Dot - - Dash Dot Dot - - Short Dash - - Short Dot - - Short Dash Dot - G&rid - Cross Hair Hårkors - Cone Kon - - - - Width Bredd - Smooth angles Jämna vinklar - Radius Radie - Smooth line Jämn linje - Boxed "Fyrkantad" - Quality Kvalitet - Points Punkter - Bars Staplar @@ -17058,17 +16714,14 @@ Mata in skal-gränser som tillfredställer villkoret: från < till! - &Worksheet &Arbetsblad - &Matrix &Matris - Co&lor Fä&rg @@ -17081,37 +16734,57 @@ M&in - A&xes A&xlar - Linea&r color map Linjä&r färgkarta - Color map &file Färgkarte&fil - - - None Ingen - Draw lines Rita linjer - Filled bars Fyllda staplar + + Tick Labels + + + + Format + Format + + + Automatic + Automatiskt + + + Decimal: 10000.0 + Decimal: 10000.0 + + + Scientific: 1e4 + Vetenskapligt: 1E4 {1e?} + + + Engineering: 10k + Tekniskt: 10k + + + Precision + Precision + PlotDialog @@ -17120,9 +16793,6 @@ QtiPlot - Anpassade kurvor - - - &Plot Associations... &Diagram-associationer... @@ -17131,516 +16801,362 @@ R&edigera funktion... - Plot type Diagramtyp - &Worksheet &Arbetsblad - &Apply &Tillämpa - &OK &OK - &Cancel &Avbryt - Attach curve to: Koppla kurva till: - x Axis x-axel - - Bottom Botten - - Top Topp - y Axis y-axel - - - Left Vänster - - - Right Höger - - Axes Axlar - Connect Anslut - No line Ingen linje - Lines Linjer - Sticks Stavar - Horizontal Steps Horisontella steg - Dots Prickar - Spline Anpassad kurva - Vertical Steps Vertikala steg - - - - - Style Stil - - - - - Width Bredd - - - - - - Color Färg - Fill area under curve Fyll yta under kurva - Fill color Fyllnadsfärg - - - - - - Pattern Mönster - - - - Line Linje - - - Size Storlek - &Speed Mode, Skip Points if needed - data points - Apply to curves with more than: - - Tolerance (Douglas Peuker algorithm) - - - - - - Speed - - - Apply Format &to - - - Selected Curve - - Fill Color Fyllnadsfärg - - Edge Color Kantfärg - - Edge Width Kantbredd - - Skip Points - - None - - - - Symbol Symbol - - Box Låda - - Type Typ - No Box Ingen låda - Rectangle Rektangel - Diamond Diamant - Perc 10, 25, 75, 90 Percentil 10,25,75,90 - Notch Hack - - Range Område - - - Standard Deviation Standardavvikelse - - Standard Error Standardfel - Perc 25, 75 Percentil 25,75 - Perc 10, 90 Percentil 10,90 - Perc 5, 95 Percentil 5,95 - Perc 1, 99 Percentil 1,99 - - Max-Min Max-Min - - Constant Konstant - - Percentile (%) Percentil (%) - Coefficient Koefficient - Box Width Lådbredd - Whiskers Morrhår - No Whiskers Inga morrhår - 75-25 75-25 - 90-10 90-10 - 95-5 95-5 - 99-1 99-1 - Coef Koeff - - Box/Whiskers Låda/morrhår - Max Max - 99% 99% - - Mean Medelvärde - 1% 1% - Min Min - - Percentile Percentil - - Image Bild - &Gray Scale &Gråskala - &Default Color Map Stab&dardfärgkarta - &Custom Color Map An&passad färgkarta - - Contour Lines Konturlinjer - Levels Nivåer - Use &Color Map Använd &färgkarta - Use Default &Pen Använd standard&penna - Color Bar Scale Färgstapelskala - Axis Axel - Contour Kontur - Direction Riktning - Plus Plus - Minus Minus - &X Error Bar &X-felstapel - - Line Width Linjebredd @@ -17665,373 +17181,286 @@ 5 - Cap Width Toppbredd - 8 8 - 10 10 - 12 12 - 16 16 - 20 20 - Through Symbol Genom-symbol - - - Error Bars Felstaplar - Automatic Binning Autmatisk "Binning" - &Show statistics &Visa Statistik - Bin Size Högstorlek - Begin Början - End Slut - - Histogram Data Histogramdata - Gap Between Bars (in %) Gap mellan staplar (i %) - Offset (in %) Förskjutning (i %) - - Spacing Mellanrum - Arrowheads Pilhuvuden - Length Längd - - Angle Vinkel - &Filled &Fylld - - End Point Slutpunkt - - X End X-slut - - Y End Y-slut - Position Position - Tail Svans - Middle Mitten - Head Huvud - - Vector Vektor - - - Bins Högar - - Histogram and Probabilities for Histogram och sannolikhet för - Quantity Kvantitet - Sum Summa - Percent Procent - Minimum Minimum - Maximum Maximum - &Delete &Tag bort - - &Edit... - &Redigera... + &Redigera... - - Colors Färger - + &Function + + + Vertical Bars Vertikala staplar - Horizontal Bars Horisontella staplar - Histogram Histogram - Vector XYXY Vektor XYXY - Vector XYAM Vektor XYAM - Scatter Spridning - Line + Symbol Linje + Symbol - - - - QtiPlot - Input error QtiPlot - Indatafel - Please enter a valid start limit! Mata in en giltig startgräns! - Please enter a valid end limit! Mata in en giltig slutgräns! - Please enter a valid bin size value! Mata in ett giltigt högvärde! - QtiPlot - Start limit error QtiPlot - Startgränsfel - QtiPlot - End limit error QtiPlot - Slutgränsfel - Please enter limits that satisfy: begin < end! Mata in gränser som tillfredställer villkoret: början < slut! - - QtiPlot - Bin size input error QtiPlot - Fel storlek för högar - Please enter a positive bin size value! Mata in ett positivt högvärde! - Vector Data Vektordata - Magnitude Magnitud - QtiPlot - Plot details QtiPlot - Diagramdetaljer - Titles Titlar - Axes Labels Axeletiketter - Axes Numbers Axelnummer - Legends Beskrivningar - - Fonts Teckensnitt - Background Color Bakgrundsfärg - - Opacity Genomskinlighet - - Transparent Transparent - Canvas Color Dukfärg - Border Color Ramfärg - Margin Marginal - Antialiasing Antialiasing @@ -18040,20 +17469,10 @@ Tillämpa på alla lager - - - - - - - - - Layer Lager - Origin Ursprung @@ -18062,44 +17481,34 @@ pixel - X= X= - Y= Y= - width= bredd= - height= höjd= - Keep aspect ratio Behåll aspekten - - - Geometry Geometri - Border Ram - First color Första färg @@ -18108,400 +17517,321 @@ Tårtradie - Fill Fyllnad - Pie Tårta - &Scale layers to paper size &Skala lager till pappersstorlek - Print Crop&marks Skriv ut urklipps&markeringar - - Print Skriv ut - &Show Vi&sa - Column Kolumn - White O&ut Vitna &ut - Justify Justera - Center Centrum - &Font &Teckensnitt - Rotate (deg) Rotera (grad) - X Offset (font height %) X-förskjutning (teckensnittshöjd %) - Y Offset (font height %) Y-förskjutning (teckensnittshöjd %) - - - - - Labels Etiketter - 3D View 3D-vy - View Angle (deg) Betraktningsvinkel (grad) - Thickness (% of radius) Tjocklek (% av radie) - Rotation Vridning - Starting Azimuth (deg) Azimut start (grad) - Radius/Center Radie/centrum - Radius (% of frame) Radie (% av ram) - Horizontal Offset (% of frame) Horisonetll förskjutning (% av ram) - - Pie Geometry Tårtgeometri - Automatic &Format Automatiskt &format - &Values &Värden - &Percentages &Procent - Categories/&Rows Kategorier/&rader - Associate Position with &Wedge Koppla position med &kil - Dist. from Pie Edge Avst. från tårtkant - Counter cloc&kwise &Motsols - inch - mm mm - cm cm - point punkt - pixel pixel - Unit Enhet - Apply &to... &Tillämpa på... - - - - Window Fönster - - - - All Windows Alla fönster - Set As &Default Sätt stan&dard - Pen - Matrix Matris - Use matrix formula to calculate values - - Values - &Show Contour Lines - Set Equidistant Levels - Start - Step Steg - Set &Levels - Use &Table Custom Pen + + Link &X axes + + + + Miscellaneous + + + + 0 (all data points) + + + + Tolerance (Douglas-Peucker algorithm) + + + + Scale &Fonts + Skala &teckensnitt + + + Do not &resize layers when window size changes + Förändra inte sto&rlek på lager när fönsterstorlek ändras + + + Dimensions + Dimensioner + PlotWizard - QtiPlot - Select Columns to Plot QtiPlot - Välj kolumner för plottning - &X &X - x&Err xF&el - &Y &Y - yE&rr yFe&l - &Z &Z - &New curve &Ny kurva - &Delete curve &Tag bort kurva - Worksheet Arbetsblad - &Plot &Rita - &Close &Stäng - - - - - - - - - - - - - - - - QtiPlot - Error QtiPlot - Fel - Please define a Y column for the following curve Välj en Y-kolumn för följande kurva - You have already defined a X column! Du har redan definierat en X-kolumn! - - - - You must define a X column first! Du måste definiera en X-kolumn först! - You have already defined a Y column! Du har redan definierat en Y-kolumn! - - - This kind of curve is not handled by QtiPlot! Denna typ av kurva kan ej hanteras av QtiPlot! - You have already defined a Z column! Du har redan definierat en Z-kolumn! - - You must define a Y column first! Du måste definiera en Y-kolumn först! - - You have already defined an error-bars column! Du har redan definierat en felstapel-kolumn! - You must add a new curve first! Du måste lägga till en ny kurva förts! @@ -18513,37 +17843,26 @@ Plugin - QtiPlot - File not found QtiPlot - Fil inte hittad - Plugin file: <p><b> %1 </b> <p>not found. Operation aborted! Plugin-fil: <p><b> %1 </b> <p> ej hittad. Åtgärd avbruten! - - - - QtiPlot - Plugin Error QtiPlot - Plugin-fel - The plugin does not implement a %1 method necessary for simplex fitting. Denna Plugin implementerar ej en %1 metod, nödvändig för simplex-anpassning. - - - The plugin does not implement a %1 method necessary for Levenberg-Marquardt fitting. Denna Plugin implementerar ej en %1 metod, nödvändig för Levenberg-Marquardt-anpassning. - Plugin Fit Plugin-anpassning @@ -18551,32 +17870,26 @@ PolynomFitDialog - QtiPlot - Polynomial Fit Options QtiPlot - Polynomanpasssningsalternativ - Polynomial Fit of Polynomanpasssning av - Order (1 - 9, 1 = linear) Ordning (1 - 9, 1 = linjär) - Fit curve # pts Anpassa kurva # punkter - Not enough points Inte tillräckligt många punkter - Fit curve Xmin Anpassa kurva Xmin @@ -18585,37 +17898,30 @@ 0 - Fit curve Xmax Anpassa kurva Xmax - Color Färg - Show Formula on Graph? Visa formel på diagram? - &Fit &Anpassa - &Close &Stäng - QtiPlot - Warning QtiPlot - Varning - The curve <b> %1 </b> doesn't exist anymore! Operation aborted! Kurvan <b> %1 </b> finns inte längre. Åtgärden avbruten! @@ -18627,39 +17933,76 @@ Mång - Polynomial Polynomisk - QtiPlot - Fit Error QtiPlot - Anpassningsfel - You need at least %1 data points for this fit operation. Operation aborted! Du behöver minst %1 punkter för denna anpassningsåtgärd. Åtgärden avbruten! - Polynomial Fit Polynomanpasssning + PreviewTable + + Numeric + Numerisk + + + Text + Text + + + Date + Datum + + + Time + Tid + + + Month + Månad + + + Day + + + + Choose column type + + + + Column type: + + + + PythonScripting - Failed to export QtiPlot API Misslyckades med att exportera QtiPlot API + Couldn't find initialization files + + + + Please indicate the correct path to the Python configuration files in the preferences dialog. + + + Accessing QtiPlot functions or objects from Python code won't work.Probably your version of SIP differs from the one QtiPlot was compiled against. Åtkomst av QtiPlots funktioner eller objekt från Pythonkod fungerar ej. Troligen är din version av SIP skild från den QtiPlot kompilerades mot. - Accessing QtiPlot functions or objects from Python code won't work. Probably your version of Qt/SIP/PyQt differs from the one QtiPlot was compiled against. @@ -18667,12 +18010,10 @@ QObject - The file is not an QtiPlot fit model file. Filen är inte en QtiPlot-anpassningsmodellfil. - The file is not an QtiPlot fit model version 1.0 file. Filen är inte en QtiPlot-anpassningsmodellfil version 1.0. @@ -18687,354 +18028,286 @@ %3 - The file is not a QtiPlot custom action file. Filen är inte en anpassad åtgfärdsfil för QtiPlot. - The file is not an QtiPlot custom action version 1.0 file. Filen är inte en anpassad åtgfärdsfil för QtiPlot version 1.0. - The file is not a QtiPlot custom menu file. Filen är inte en QtiPlot-anpassad menyfil. - The file is not a QtiPlot custom menu version 1.0 file. Filen är inte en QtiPlot-anpassad menyfil version 1.0. - QtiPlot - Script Error - Python-like syntax is not supported in this case since it severely reduces drawing speed! - - QtiPlot - Math Error - - - - QtiPlot QtiPlot - - Ignored data point at x = %1. - - - - Found non-removable singularity at x = %1. - abs(x): Absolute value of x. - acos(x): Inverse cos function. - acosh(x): Hyperbolic inverse cos function. - asin(x): Inverse sin function. - asinh(x): Hyperbolic inverse sin function. - atan(x): Inverse tan function. - atanh(x): Hyperbolic inverse tan function. - avg(x,y,...): Mean value of all arguments. - bessel_j0(x): Regular cylindrical Bessel function of zeroth order, J_0(x). - bessel_j1(x): Regular cylindrical Bessel function of first order, J_1(x). - bessel_jn(double x, int n): Regular cylindrical Bessel function of order n, J_n(x). - bessel_jn_zero(double n, unsigned int s): s-th positive zero x_s of regular cylindrical Bessel function of order n, J_n(x_s)=0 - bessel_y0(x): Irregular cylindrical Bessel function of zeroth order, Y_0(x), for x>0. - bessel_y1(x): Irregular cylindrical Bessel function of first order, Y_1(x), for x>0. - bessel_yn(double x, int n): Irregular cylindrical Bessel function of order n, Y_n(x), for x>0. - beta(a,b): Computes the Beta Function, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) for a > 0, b > 0. - ceil(x): Round to the next larger integer, smallest integer larger or equal to x. - cos(x): Calculate cosine. - cosh(x): Hyperbolic cos function. - erf(x): The error function. - erfc(x): Complementary error function erfc(x) = 1 - erf(x). - erfz(x): The Gaussian probability density function Z(x). - erfq(x): The upper tail of the Gaussian probability function Q(x). - exp(x): Exponential function: e raised to the power of x. - floor(x): Round to the next smaller integer, largest integer smaller or equal to x. - gamma(x): Computes the Gamma function, subject to x not being a negative integer. - gammaln(x): Computes the logarithm of the Gamma function, subject to x not a being negative integer. For x<0, log(|Gamma(x)|) is returned. - gauss_cdf(x, sigma): Computes the cumulative distribution function for a Gaussian distribution with standard deviation sigma. - gauss_pdf(x, sigma): Computes the probability density at x for a Gaussian distribution with standard deviation sigma. - hazard(x): Computes the hazard function for the normal distribution h(x) = erfz(x)/erfq(x). - if(e1, e2, e3): if e1 then e2 else e3. - inv_gauss_cdf(x, sigma): Computes the inverse of the cumulative distribution function for a Gaussian distribution with standard deviation sigma. - ln(x): Calculate natural logarithm log_e. - log(x): Calculate decimal logarithm log_10. - log10(x): Calculate decimal logarithm log_10. - log2(x): Calculate binary logarithm log_2. - min(x,y,...): Calculate minimum of all arguments. - max(x,y,...): Calculate maximum of all arguments. - mod(x,y): Calculate rest of integer division x/y, x modulo y. - pow(x,y): Raise x to the power of y, x^y. - rint(x): Round to nearest integer. - sign(x): Sign function: -1 if x<0; 1 if x>0. - sin(x): Calculate sine. - sinh(x): Hyperbolic sin function. - sqrt(x): Square root function. - sum(x,y,...): Calculate sum of all arguments. - tan(x): Calculate tangent function. - tanh(x): Hyperbolic tan function. - ttable(x, n): Student's t-distribution with n degrees of freedom. - w0(x): Compute the principal branch of Lambert's W function, W_0(x). W is defined as a solution to the equation W(x)*exp(W(x))=x. @@ -19042,121 +18315,111 @@ - wm1(x): Compute the secondary branch of Lambert's W function, W_{-1}(x). W is defined as a solution to the equation W(x)*exp(W(x))=x. For x<0, there are two real-valued branches; this function computes the one where W<-1 for x<0. (also see w0(x)). + + AVG("colName", i, j): + The average of all cells from row i to j in column colName. + + + + SUM("colName", i, j): + The sum of all cells from row i to j in column colName. + + + + QtiPlot - Memory Allocation Error + QtiPlot - Minnesallokeringsfel + + + Not enough memory, operation aborted! + Ej tillräckligt med minne, uppgiften avbruten! + + + The function %1 is not defined in the specified interval! + + + + rnd(seed): + Returns a pseudo-random number in the range 0 to 1. Calling this function several times with the same seed will return the same value. + + QtColorPicker - - - Black - - White - - Red - - Dark red - - Green - - Dark green - - Blue - - Dark blue - - Cyan - - Dark cyan - - Magenta - - Dark magenta - - Yellow - - Dark yellow - - Gray - - Dark gray - - Light gray - Custom @@ -19164,36 +18427,22 @@ RangeSelectorTool - - - - - - QtiPlot - Warning QtiPlot - Varning - All the curves on this plot are empty! Alla kurvor på detta diagram är tomma! - Click or use Ctrl+arrow key to select range (arrows select active cursor)! Klicka eller använd Crrl+pil-tangent för att välja område (pilar väljer aktiv markör)! - - - Right Höger - - - Left Vänster @@ -19208,21 +18457,14 @@ Delta_y - - - - - The column '%1' is read-only! Operation aborted! Kolumnen '%1' är skrivskydad! Åtgärd avbruten! - Remove data from curves? - Copy data to clipboard? @@ -19230,47 +18472,38 @@ RenameWindowDialog - Window Title Fönstertitel - &Name (single word) &Namn (ett enda ord) - &Label &Etikett - &Both Name and Label &Både namn och etikett - QtiPlot - Rename Window QtiPlot - Omdöp fönster - &OK &OK - &Cancel &Avbryt - QtiPlot - Warning QtiPlot - Varning - For internal consistency reasons the underscore character is replaced with a minus sign. Av interna skäl byts understrykningstecknet mot minustecken. @@ -19278,7 +18511,6 @@ ScreenPickerTool - Click on plot or move cursor to display coordinates! Klicka på diagram eller fluytta markör för att visa upp koordinater! @@ -19286,18 +18518,14 @@ ScriptEdit - Auto&exec - &Functions &Funktioner - - Text Text @@ -19306,28 +18534,22 @@ Pythonkälla - - All Files Alla filer - QtiPlot - Import Text From File QtiPlot - Importera text från fil - QtiPlot - Error Opening File QtiPlot - Filöppningsfel - Could not open file "%1" for reading. Kunde inte öppna fil för läsning. - Save Text to File Spara text till fil @@ -19350,47 +18572,38 @@ &Nej - QtiPlot - File Save Error QtiPlot - Filsparningsfel - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Kunde inte skriva till filen: <br><h4> %1 </h4><p>Verifiera att du har rättighet att skriva på denna plats! - E&xecute &Utför - Ctrl+J Ctrl+J - Execute &All Utför &allt - Ctrl+Shift+J Ctrl+Shift+J - &Evaluate Expression Utvärd&era uttryck - Ctrl+Return Ctrl+vagnretur - &Print &Skriv ut @@ -19403,62 +18616,50 @@ E&xportera - &Save &Spara - &Import... &Importera... - Sa&ve as... Sp&ara som... - &Find... &Leta... - &Replace... &Byt ut... - &Find next Sök &nästa - &Find previous Sök &föregående - Rena&me Tab... - A&dd Tab - C&lose Tab - QtiPlot QtiPlot - QtiPlot has finished searching the document. QtoPlot är klar med att söka i dokumentet. @@ -19470,22 +18671,14 @@ QtiPlot - Python-skriptfönster - - &File &Arkiv - - &Edit &Redigera - - - - E&xecute Utf&ör @@ -19494,56 +18687,38 @@ Gö&m - - Ctrl+N Ctrl+N - - Ctrl+O Ctrl+O - - Ctrl+S Ctrl+S - - Ctrl+P Ctrl+P - - Ctrl+Z Ctrl+Z - - Ctrl+Y Ctrl+Y - - Ctrl+x Ctrl+x - - Ctrl+C Ctrl+C - - Ctrl+V Ctrl+V @@ -19552,90 +18727,62 @@ Del - - CTRL+J CTRL+J - - CTRL+SHIFT+J CTRL+SHIFT+J - - CTRL+Return CTRL+vagnretur - QtiPlot - File Save Error QtiPlot - Filsparningsfel - Could not write to file: <br><h4> %1 </h4><p>Please verify that you have the right to write to this location! Kunde inte skriva till filen: <br><h4> %1 </h4><p>Verifiera att du har rättighet att skriva på denna plats! - - &New &Ny - - &Open... &Öppna... - - &Save &Spara - - Save &As... Sp&ara som... - - &Print &Skriv ut - - &Undo &Ångra - - &Redo Gö&r om - - &Cut Klipp &ut - - &Copy &Kopiera - - &Paste Klistra &in @@ -19644,146 +18791,102 @@ &Tag bort - - Execute &All Utför &allt - - &Evaluate Expression Utvärd&era uttryck - - QtiPlot - Script Window QtiPlot - Skriptfönster - &Window &Fönster - - Increase Indent - - Decrease Indent - - &Find... &Leta... - - Ctrl+Alt+F Ctrl+Alt+F - - Find &Next - - F3 F3 - - Find &Previous - - F4 - - &Replace... &Byt ut... - Always on &Top Alltid övers&t - You need to close and reopen the script window before your changes become effective! Do you want to close it now? Du måste stänga och återöppna skriptfönstret innan dina ändringar tar! Vill du stänga nu? - - QtiPlot QtiPlot - Show &Line Numbers Visa rad&nummer - - Script Output Panel - - Show Script &Output Panel - - Ouput on Next &Line - Show Script Output Panel - - Print Pre&view... - Script print preview - - &Close - - Show &Workspace @@ -19791,7 +18894,6 @@ ScriptingEnv - %1 Source (*.%2);; %1 källa (*.%2);; @@ -19799,27 +18901,22 @@ ScriptingLangDialog - QtiPlot - Select scripting language QtiPlot - Välj skriptspråk - OK OK - Cancel Avbryt - QtiPlot - Scripting Error QtiPlot - Skriptningsfel - Scripting language "%1" failed to initialize. Misslyckades med att initiera skript-språkrt "%1" . @@ -19827,32 +18924,26 @@ SetColValuesDialog - QtiPlot - Set column values QtiPlot - Sätt kolumnvärden - For row (i) För rad (i) - to till - Add function Lägg till funktion - Add column Lägg till kolumn - Add cell Lägg till cell @@ -19861,7 +18952,6 @@ &OK - &Apply &Tillämpa @@ -19870,17 +18960,14 @@ Avbryt - &Close &Stäng - Use built-in muParser (much faster) Använd inbyggd muParser (mycket snabbare) - Clear &Formulas @@ -19908,32 +18995,26 @@ Boltzmann (Sigmodial) - Boltzmann (Sigmoidal) Fit Biltzmann (sigmoidal) anpassning - Boltzmann Boltzmann - init value begynnelsevärde - final value slutvärde - center centrum - time constant tidskonstant @@ -19941,59 +19022,46 @@ SmoothCurveDialog - QtiPlot - Smoothing Options QtiPlot - Utjämningsfel - Curve Kurva - Polynomial Order Polynomordning - Points to the Left Punkter till vänster - Points to the Right Punkter till höger - - - Color Färg - f - Iterations Iterationer - Points Punkter - &Smooth &Jämna ut - &Close &Stäng @@ -20001,31 +19069,14 @@ SmoothFilter - Smoothed Utjämnad - - - - - - - - QtiPlot QtiPlot - - - - - - - - Error Fel @@ -20034,66 +19085,50 @@ Okänt utjämningsfilter. Giltiga värden är: 1 - Savitky-Golay, 2 - FFR, 3 - glidande medelvärdesfönster. - Unknown smooth filter. Valid values are: 1 - Savitky-Golay, 2 - FFT, 3 - Moving Window Average, 4 - Lowess. - - - - points punkter - Savitzky-Golay smoothing Savitzky-Golay-utjämning - FFT smoothing FFT-utjämning - average smoothing medelvärdesutjämning - - Lowess smoothing + Lowess smoothing with f=%1 and %2 iterations - The number of points must be positive! Antal punkter måste vara positivt! - - The polynomial order must be lower than the number of left points plus the number of right points! Polynomordningen måste vara lägre än antal vänsterpunkter plus antal högrepunkter! - Setting polynomial order is only available for Savitzky-Golay smooth filters! Ignored option! Inställnnga av polynpmordning är bara giltigt vid Savitky-Golay-utjämningsfilter. Åtgärden avbryts! - Setting Lowess parameter is only available for Lowess smooth filters! Ignored option! - The parameter f must be between 0 and 1! - The number of iterations must be at least 1! @@ -20101,70 +19136,115 @@ SortDialog - QtiPlot - Sorting Options QtiPlot - Sorteringsalternativ - Sort columns Sortera kolumner - Order Ordning - Leading column Inledande kolumn - &Sort &Sortera - &Close &Stäng - Separately Separat - Together Tillsammans - Ascending Stigande - Descending Fallande + SubtractDataDialog + + QtiPlot + QtiPlot + + + Math on Data Sets + + + + Cu&rve + + + + &Operator + + + + &Data set + + + + Current &folder + + + + &Value + + + + &Apply + &Tillämpa + + + &Close + + + + Error + Fel + + + Data set %1 must containt at least two valid data points in order to perform this operation! + + + + + SubtractLineTool + + Move cursor and click to select and double-click/press 'Enter' to set the position of the first point! + + + + First point selected! Click to select and double-click/press 'Enter' to set the position of the 2nd point! + + + + SurfaceDialog - QtiPlot - Define surface plot QtiPlot - Definiera ytdiagram - f(x,y)= f(x,y)= - X - axis X-axel @@ -20177,45 +19257,30 @@ 1 - - - - - From Från - - - - - To Till - Y - axis Y-axel - Z - axis Z-axel - Clear &list - Rensa &lista + Rensa &lista - &OK &OK - &Close &Stäng @@ -20244,200 +19309,185 @@ QtiPlot - Z-slutgränsfel - QtiPlot - Input error QtiPlot - Indatafel - Please enter limits that satisfy: from < end! Mata in gränser som tillfredställer: från < slut! - QtiPlot - Input function error QtiPlot - Fel i indatafunktion - Surface type Yttyp - Function Funktion - Parametric Parametrisk - - + Clea&r + &Rensa + + + Rece&nt + + + + Click here to select a recently typed expression + + + Mesh Nät - - Columns Kolumner - - Rows Rader - Equations Ekvationer - X(u,v)= X(u,v)= - Y(u,v)= Y(u,v)= - Z(u,v)= Z(u,v)= - u u - - Periodic Periodisk - v v - QtiPlot - X Formula Error QtiPlot - X-formelfel - QtiPlot - Y Formula Error QtiPlot - Y-formelfel - QtiPlot - Z Formula Error QtiPlot - Z-formelfel - + QtiPlot + QtiPlot + + + Sorry, there are no recent expressions available! + + + + Recent Functions + + + + Please, choose a function: + + + QtiPlot - u start limit error - QtiPlot - u-startgränsfel + QtiPlot - u-startgränsfel - - QtiPlot - u end limit error - QtiPlot - u-slutgränsfel + QtiPlot - u-slutgränsfel - QtiPlot - v start limit error - QtiPlot - v-startgränsfel + QtiPlot - v-startgränsfel SymbolBox - No Symbol Ingen symbol - Ellipse Ellips - Rectangle Rektangel - Diamond Romb - Triangle Triangel - Down Triangle Nedåtriktad triangel - Up Triangle Uppåtriktad triangel - Left Triangle Vänsterriktad triangel - Right Triangle Högerriktad triangel - Cross Kors - Diagonal Cross Diagonalt kors - Horizontal Line Horisontell linje - Vertical Line Vertikal linje - Star 1 Stjärna 1 - Star 2 Stjärna 2 - Hexagon Hexagon @@ -20445,12 +19495,10 @@ SymbolDialog - &Close &Stäng - QtiPlot - Choose Symbol QtiPlot - Välj symbol @@ -20458,21 +19506,6 @@ Table - - - - - - - - - - - - - - - QtiPlot - Error QtiPlot - Fel @@ -20483,8 +19516,6 @@ Vill du skjuta in celler? - - Yes Ja @@ -20493,8 +19524,6 @@ Nej - - Cancel Avbryt @@ -20547,31 +19576,22 @@ QtiPlot - Läser fil... - QtiPlot - ASCII Export Error QtiPlot - ASCII exportfel - Rows will be deleted from the table! Rader kommer att tas bort från tabellen! - - Do you really want to continue? Vill du verkligen fortsätta? - - - - QtiPlot QtiPlot - Columns will be deleted from the table! Kolumner kommer att tas bort från tabellen! @@ -20618,7 +19638,6 @@ Kolumnnamnet måste skilja sig från tabellnamnet: <b> - There is already a column called : <b> Det finns redan en kolumn kallad: <b> @@ -20629,12 +19648,10 @@ - Could not write to file: <br><h4> Kunde inte skriva till fil: <br><h4> - Please indicate the name of the leading column! Peka ut namnet på inledande kolumn! @@ -20643,78 +19660,50 @@ Den inledande kolumnen har typen satt till 'Text'! Avbryter! - The leading column is empty! Operation aborted! Den inledande kolumnen är tom! Avbryter! - - - Column '%1' is read only! Kolumn '%1' är skrivskyddad! - The table '%1' contains read-only columns! Operation aborted! Tabell '%1' innehåller skrivskyddade kolumner! Åtgärd avbryts! - - - - - - - - The folowing columns Följande kolumner - - - - - - - - are read only! är skrivskyddade! - Paste operation - How should QtiPlot interpret first clipboard line? - &Values &Värden - Column &Names - &Comments - Qtiplot Qtiplot - Reading file... Läser fil... @@ -20723,17 +19712,14 @@ QtiPlot - Indatafel - kB kB - Multiline expressions take much more time to evaluate! Do you want to continue anyways? Flerradiga uttryck tar mycket längra tid att utvärdera! Vill du fortsätta ändå? - Warning Varning @@ -20741,343 +19727,274 @@ TableDialog - QtiPlot - Column options QtiPlot - Kolumnalternativ - Column Name: Kolumnnamn: - Enumerate all to the right Numrera allt till höger - &OK &OK - &Apply &Tillämpa - &Cancel &Avbryt - Plot Designation: Diagrambeteckning: - None Inget - X (abscissae) X (abskissa) - Y (ordinates) Y (ordinata) - Z (height) Z (höjd) - X Error X-fel - Y Error Y-fel - Display Visning - Numeric Numerisk - Text Text - Date Datum - Time Tid - Month Månad - Day of Week Veckodag - Format: Format: - Precision: Precision: - Apply to all columns to the right Tillämpa på alla kolumner till höger - Options Alternativ - Column Width: Kolumnbredd: - Apply to all Tillämpa på allt - Comment: Kommentar: - QtiPlot - Warning QtiPlot - Varning - For internal consistency reasons the underscore character is replaced with a minus sign. Av interna skäl byts understrykningstecknet mot minustecken. - - QtiPlot - Error QtiPlot - Fel - The column names must only contain letters and digits! - Kolumnnamnen får bara innehålla bokstäver och siffror! + Kolumnnamnen får bara innehålla bokstäver och siffror! - Default Standard - Decimal: 1000 Decimal: 1000 - Scientific: 1E3 Vetenskalpligt: 1E3 - yyyy-MM-dd yyyy-mm-dd - h h - h ap h ap - h AP h AP - h:mm h:mm - h:mm ap h.mm ap - hh:mm hh:mm - h:mm:ss h:mm:ss - h:mm:ss.zzz h:mm:ss,zzz - mm:ss mm:ss - mm:ss.zzz mm:ss:zzz - hmm hmm - hmmss hmmss - hhmmss hhmmss - &Display Comments in Header &Visa kommentarer i huvud - dd/MM/yyyy dd/MM/yyyy - dd.MM.yyyy dd.MM.yyyy - dd MM yyyy dd MM yyyy - yyyyMMdd yyyyMMdd - Couldn't guess the source data format, please specify it using the 'Format' box! Kunde inte gissa källdataformat, beskriv det genom att använda 'Format'-lådan! - For more information about the supported date/time formats please read the Qt documentation for the QDateTime class! För ytterligare information om stödda datum/tid-format, läs Qt-dokumentationen för QDateTime class! - &Read-only Sk&rivskyddat - Label Etikett - &Hidden &Gömd - dd/MM/yyyy HH:mm dd/MM/yyyy HH:mm - dd/MM/yyyy HH:mm:ss dd/MM/yyyy HH:mm:ss - dd.MM.yyyy HH:mm dd.MM.yyyy HH:mm - dd.MM.yyyy HH:mm:ss dd.MM.yyyy HH:mm:ss - dd MM yyyy HH:mm dd MM yyyy HH:mm - dd MM yyyy HH:mm:ss dd MM yyyy HH:mm:ss - yyyy-MM-dd HH:mm dd-MM-yyyy HH:mm - yyyy-MM-dd HH:mm:ss yyyy-MM-dd HH:mm:ss - yyyyMMdd HH:mm yyyyMMdd HH:mm - yyyyMMdd HH:mm:ss yyyyMMdd HH:mm:ss @@ -21085,23 +20002,18 @@ TableStatistics - Row Statistics of %1 Radstatistik för %1 - Row Rad - Cols Kolumner - - Mean Medelvärde @@ -21110,79 +20022,58 @@ Standardavvikelse - - Variance Varians - - Sum Summa - - Max Max - - Min Min - Column Statistics of %1 Kolumnstatistik för %1 - Col Kol - Rows Rader - iMax iMax - iMin iMin - RowStats Radstat - - StandardDev Standav - ColStats Kolstat - - StandardError Standardfel - - Median Median @@ -21190,7 +20081,6 @@ TextDialog - QtiPlot - Text options QtiPlot - Text-alternativ @@ -21203,12 +20093,10 @@ &OK - Font Teckensnitt - &Font &Teckensnitt @@ -21221,17 +20109,14 @@ Uppriktning - Center Centrum - Left Vänster - Right Höger @@ -21312,12 +20197,10 @@ U - Text Color Textfärg - Alignment Upplinjering @@ -21342,70 +20225,54 @@ Tillämpa format på all etiketter i &lager - - - - QtiPlot QtiPlot - X Axis Title X-axeltitel - Y Axis Title Y-axeltitel - Top Axis Title Toppaxeltitel - Right Axis Title Titel på höger axel - &Apply to... &Tillämpa på... - Object Objekt - Layer Lager - Window Fönster - All Windows Alla fönster - &Close &Stäng - Distance to axis Avstånd till axel - &Inverted @@ -21413,17 +20280,14 @@ TextEditor - QtiPlot QtiPlot - Confirmation Bekräftelse - Are you sure you want to add %1 text lines into this text box? Är du säker på att du vill lägga till %1 textrader till denna textbox? @@ -21431,19 +20295,16 @@ TextFormatButtons - B Button bold B - It Button italics It - U Button underline U @@ -21452,47 +20313,38 @@ ThreeExpFit - Exponential decay Exponentiellt avtagande - ExpDecay3 - first amplitude första anmplitud - first lifetime första livslängd - second amplitude andra anmplitud - second lifetime andra livslängd - third amplitude tredje anmplitud - third lifetime tredje livslängd - offset förskjutning @@ -21500,36 +20352,26 @@ TranslateCurveTool - Curve selected! Move cursor and click to choose a point and double-click/press 'Enter' to finish! Kurva vald! Flytta markör och klicka för att välja punkt samt dubbelklicka/tryck 'Retur' för att avsluta! - - - - QtiPlot - Warning QtiPlot - Varning - This operation cannot be performed on function curves. Denna operation kan ej utföras på funktionskurvor. - This operation cannot be performed on curves plotted from columns having a non-numerical format. Denna åtgärd kan ej utföras på kurvor ritade från kolumner med ett icke-numeriskt format. - - The column '%1' is read-only! Operation aborted! Kolumnen '%1' är skrivskydad! Åtgärd avbruten! - Double-click on plot to select a data point! Dubbelklicka på diagram för att välja datapunkt! @@ -21537,37 +20379,30 @@ TwoExpFit - Exponential decay Exponentiellt avtagande - ExpDecay2 - first amplitude första anmplitud - first lifetime första livslängd - second amplitude andra anmplitud - second lifetime andra livslängd - offset förskjutning @@ -24121,10 +22956,6 @@ muParserScript - - - - Out of memory Slut på minne @@ -24145,27 +22976,18 @@ Syntaxfel: '=' utan variabelnamn. - col() works only on tables! col() fungerar bara för tabeller! - - There's no column named %1 in table %2! Det finns ingen kolumn kallad %1 i tabell %2! - - - There's no row %1 in table %2! Det finns ingen rad %1 i tabell %2! - - - There's no column %1 in table %2! Det finns ingen kolumn %1 i tabell %2! @@ -24174,42 +22996,42 @@ cell() fungerar bara för matriser! - There's no row %1 in matrix %2! Det finns ingen rad %1 i matris %2! - There's no column %1 in matrix %2! Det finns ingen kolumn %1 i matris %2! - tablecol() works only on tables! tablecol() fungerar bara för tabeller! - tablecol: wrong number of arguments (need 2, got %1) tablecol: fel antal argument (2 behövs, fick %1) - tablecol: first argument must be a string (table name) taaablecol: första argumentet måste vara en sträng (tabellnamn) - Couldn't find a table named %1. Kunde inte finna tabell kallad %1. - - cell() works only on tables and matrices! cell() fungerar bara för tabeller och matriser! + SUM() works only on tables! + + + + AVG() works only on tables! + + + Multiline expressions take much more time to evaluate! Do you want to continue anyways? Flerradiga uttryck tar mycket längra tid att utvärdera! Vill du fortsätta ändå? === added file 'qtiplot_0.9.7.14-1_amd64.build' --- qtiplot_0.9.7.14-1_amd64.build 1970-01-01 00:00:00 +0000 +++ qtiplot_0.9.7.14-1_amd64.build 2010-07-21 23:41:24 +0000 @@ -0,0 +1,156 @@ +I: Using pkgname logfile +I: Current time: Sun May 23 23:19:43 CEST 2010 +I: pbuilder-time-stamp: 1274649583 +I: Obtaining the cached apt archive contents +I: Installing the build-deps + -> Attempting to satisfy build-dependencies + -> Creating pbuilder-satisfydepends-dummy package +Package: pbuilder-satisfydepends-dummy +Version: 0.invalid.0 +Architecture: amd64 +Maintainer: Debian Pbuilder Team +Description: Dummy package to satisfy dependencies with aptitude - created by pbuilder + This package was created automatically by pbuilder and should +Depends: debhelper (>= 7), quilt, dblatex, docbook-utils, doxygen, libgsl0-dev, zlib1g-dev, libpng12-dev, liborigin2-dev (>= 1:06042009+svn1724), libmuparser-dev (>= 1.32), python-all-dev (>= 2.4.4), python-qt4, python-qt4-dev, python-sip4-dev, sip4, libqt4-opengl-dev +dpkg-deb: building package `pbuilder-satisfydepends-dummy' in `/tmp/satisfydepends-aptitude/pbuilder-satisfydepends-dummy.deb'. +Reading package lists... +Building dependency tree... +Reading state information... +aptitude is already the newest version. +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Selecting previously deselected package pbuilder-satisfydepends-dummy. +(Reading database ... 10981 files and directories currently installed.) +Unpacking pbuilder-satisfydepends-dummy (from .../pbuilder-satisfydepends-dummy.deb) ... +dpkg: dependency problems prevent configuration of pbuilder-satisfydepends-dummy: + pbuilder-satisfydepends-dummy depends on debhelper (>= 7); however: + Package debhelper is not installed. + pbuilder-satisfydepends-dummy depends on quilt; however: + Package quilt is not installed. + pbuilder-satisfydepends-dummy depends on dblatex; however: + Package dblatex is not installed. + pbuilder-satisfydepends-dummy depends on docbook-utils; however: + Package docbook-utils is not installed. + pbuilder-satisfydepends-dummy depends on doxygen; however: + Package doxygen is not installed. + pbuilder-satisfydepends-dummy depends on libgsl0-dev; however: + Package libgsl0-dev is not installed. + pbuilder-satisfydepends-dummy depends on zlib1g-dev; however: + Package zlib1g-dev is not installed. + pbuilder-satisfydepends-dummy depends on libpng12-dev; however: + Package libpng12-dev is not installed. + pbuilder-satisfydepends-dummy depends on liborigin2-dev (>= 1:06042009+svn1724); however: + Package liborigin2-dev is not installed. + pbuilder-satisfydepends-dummy depends on libmuparser-dev (>= 1.32); however: + Package libmuparser-dev is not installed. + pbuilder-satisfydepends-dummy depends on python-all-dev (>= 2.4.4); however: + Package python-all-dev is not installed. + pbuilder-satisfydepends-dummy depends on python-qt4; however: + Package python-qt4 is not installed. + pbuilder-satisfydepends-dummy depends on python-qt4-dev; however: + Package python-qt4-dev is not installed. + pbuilder-satisfydepends-dummy depends on python-sip4-dev; however: + Package python-sip4-dev is not installed. + pbuilder-satisfydepends-dummy depends on sip4; however: + Package sip4 is not installed. + pbuilder-satisfydepends-dummy depends on libqt4-opengl-dev; however: + Package libqt4-opengl-dev is not installed. +dpkg: error processing pbuilder-satisfydepends-dummy (--install): + dependency problems - leaving unconfigured +Errors were encountered while processing: + pbuilder-satisfydepends-dummy +Reading package lists... +Building dependency tree... +Reading state information... +Initializing package states... +Writing extended state information... +The following NEW packages will be installed: + apt-utils{a} bsdmainutils{a} dblatex{a} debhelper{a} diffstat{a} + docbook-dsssl{a} docbook-utils{a} docbook-xml{a} doxygen{a} file{a} + fontconfig{a} fontconfig-config{a} gettext{a} gettext-base{a} + groff-base{a} html2text{a} intltool-debian{a} jadetex{a} libasound2{a} + libasyncns0{a} libaudio2{a} libbsd0{a} libcap2{a} libcroco3{a} + libdb4.5{a} libdbus-1-3{a} libdrm2{a} libflac8{a} libfontconfig1{a} + libfreetype6{a} libgl1-mesa-dev{a} libgl1-mesa-glx{a} libglib2.0-0{a} + libglu1-mesa{a} libglu1-mesa-dev{a} libgsl0-dev{a} libgsl0ldbl{a} + libice6{a} libidn11{a} libjpeg62{a} libjs-jquery{a} libkpathsea5{a} + liblcms1{a} libmagic1{a} libmng1{a} libmuparser-dev{a} libmuparser0{a} + libogg0{a} libopenjpeg2{a} libosp5{a} libostyle1c2{a} libpcre3{a} + libphonon4{a} libpng12-0{a} libpng12-dev{a} libpoppler5{a} + libpthread-stubs0{a} libpthread-stubs0-dev{a} libpulse-mainloop-glib0{a} + libpulse0{a} libpython2.6{a} libqt4-assistant{a} libqt4-dbus{a} + libqt4-designer{a} libqt4-dev{a} libqt4-help{a} libqt4-multimedia{a} + libqt4-network{a} libqt4-opengl{a} libqt4-opengl-dev{a} + libqt4-qt3support{a} libqt4-script{a} libqt4-scripttools{a} libqt4-sql{a} + libqt4-svg{a} libqt4-test{a} libqt4-webkit{a} libqt4-xml{a} + libqt4-xmlpatterns{a} libqtcore4{a} libqtgui4{a} libsgmls-perl{a} + libsm6{a} libsndfile1{a} libsp1c2{a} libssl0.9.8{a} libtiff4{a} + libvorbis0a{a} libvorbisenc2{a} libwrap0{a} libx11-6{a} libx11-data{a} + libx11-dev{a} libxau-dev{a} libxau6{a} libxaw7{a} libxcb1{a} + libxcb1-dev{a} libxdamage1{a} libxdmcp-dev{a} libxdmcp6{a} libxext6{a} + libxfixes3{a} libxi6{a} libxml2{a} libxmu6{a} libxpm4{a} libxrender1{a} + libxslt1.1{a} libxt6{a} libxtst6{a} libxxf86vm1{a} luatex{a} lynx{a} + lynx-cur{a} man-db{a} mesa-common-dev{a} mime-support{a} openjade{a} + po-debconf{a} preview-latex-style{a} python{a} python-all{a} + python-all-dev{a} python-apt{a} python-central{a} python-dev{a} + python-minimal{a} python-qt4{a} python-qt4-dev{a} python-sip{a} + python-sip-dev{a} python-support{a} python2.5{a} python2.5-dev{a} + python2.5-minimal{a} python2.6{a} python2.6-dev{a} python2.6-minimal{a} + qt4-qmake{a} quilt{a} sgml-base{a} sgml-data{a} sgmlspl{a} sp{a} + tex-common{a} texlive{a} texlive-base{a} texlive-bibtex-extra{a} + texlive-binaries{a} texlive-common{a} texlive-doc-base{a} + texlive-extra-utils{a} texlive-fonts-recommended{a} texlive-latex-base{a} + texlive-latex-extra{a} texlive-latex-recommended{a} texlive-math-extra{a} + texlive-pictures{a} tipa{a} ttf-dejavu-core{a} ucf{a} x11-common{a} + x11proto-core-dev{a} x11proto-input-dev{a} x11proto-kb-dev{a} xml-core{a} + xsltproc{a} xtrans-dev{a} zlib1g-dev{a} +The following partially installed packages will be configured: + pbuilder-satisfydepends-dummy{b} +0 packages upgraded, 170 newly installed, 0 to remove and 0 not upgraded. +Need to get 113MB/168MB of archives. After unpacking 499MB will be used. +The following packages have unmet dependencies: + pbuilder-satisfydepends-dummy: Depends: liborigin2-dev (>= 1:06042009+svn1724) but it is not going to be installed. +The following actions will resolve these dependencies: + + Remove the following packages: +1) pbuilder-satisfydepends-dummy + + + +The following NEW packages will be installed: + apt-utils{a} bsdmainutils{a} libpng12-0{a} +The following packages will be REMOVED: + pbuilder-satisfydepends-dummy{a} +0 packages upgraded, 3 newly installed, 1 to remove and 0 not upgraded. +Need to get 226kB/607kB of archives. After unpacking 1540kB will be used. +Writing extended state information... +Get:1 http://ftp.tu-chemnitz.de sid/main apt-utils 0.7.25.3 [226kB] +debconf: delaying package configuration, since apt-utils is not installed +Fetched 226kB in 5s (42.6kB/s) +(Reading database ... 10981 files and directories currently installed.) +Removing pbuilder-satisfydepends-dummy ... +Selecting previously deselected package apt-utils. +(Reading database ... 10981 files and directories currently installed.) +Unpacking apt-utils (from .../apt-utils_0.7.25.3_amd64.deb) ... +Selecting previously deselected package bsdmainutils. +Unpacking bsdmainutils (from .../bsdmainutils_8.0.11_amd64.deb) ... +Selecting previously deselected package libpng12-0. +Unpacking libpng12-0 (from .../libpng12-0_1.2.43-1_amd64.deb) ... +Setting up apt-utils (0.7.25.3) ... +Setting up bsdmainutils (8.0.11) ... +update-alternatives: using /usr/bin/bsd-write to provide /usr/bin/write (write) in auto mode. +update-alternatives: using /usr/bin/bsd-from to provide /usr/bin/from (from) in auto mode. +Setting up libpng12-0 (1.2.43-1) ... +Reading package lists... +Building dependency tree... +Reading state information... +Reading extended state information... +Initializing package states... +Writing extended state information... +Aptitude couldn't satisfy the build dependencies +E: pbuilder-satisfydepends failed. +I: Copying back the cached apt archive contents +I: new cache content apt-utils_0.7.25.3_amd64.deb added +I: unmounting dev/pts filesystem +I: unmounting proc filesystem +I: cleaning the build env +I: removing directory /var/cache/pbuilder/build//31075 and its subdirectories